MK3S_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 ed 57 jmp 0xafda ; 0xafda <__dtors_end> 4: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 8: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> c: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 10: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 14: 0d 94 d6 bb jmp 0x377ac ; 0x377ac <__vector_5> 18: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 1c: 0c 94 61 76 jmp 0xecc2 ; 0xecc2 <__vector_7> 20: 0c 94 7e 76 jmp 0xecfc ; 0xecfc <__vector_8> 24: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 28: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 2c: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 30: 0c 94 b9 68 jmp 0xd172 ; 0xd172 <__vector_12> 34: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 38: 0d 94 e0 47 jmp 0x28fc0 ; 0x28fc0 <__vector_14> 3c: 0d 94 6c 41 jmp 0x282d8 ; 0x282d8 <__vector_15> 40: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 44: 0d 94 95 58 jmp 0x2b12a ; 0x2b12a <__vector_17> 48: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 4c: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 50: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 54: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 58: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 5c: 0c 94 68 75 jmp 0xead0 ; 0xead0 <__vector_23> 60: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 64: 0d 94 78 d6 jmp 0x3acf0 ; 0x3acf0 <__vector_25> 68: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 6c: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 70: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 74: 0c 94 6b 8f jmp 0x11ed6 ; 0x11ed6 <__vector_29> 78: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 7c: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 80: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 84: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 88: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 8c: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 90: 0d 94 34 d6 jmp 0x3ac68 ; 0x3ac68 <__vector_36> 94: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 98: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> 9c: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> a0: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> a4: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> a8: 0d 94 02 37 jmp 0x26e04 ; 0x26e04 <__vector_42> ac: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> b0: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> b4: 0d 94 e4 36 jmp 0x26dc8 ; 0x26dc8 <__vector_45> b8: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> bc: 0d 94 2a 4d jmp 0x29a54 ; 0x29a54 <__vector_47> c0: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> c4: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> c8: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> cc: 0d 94 a4 36 jmp 0x26d48 ; 0x26d48 <__vector_51> d0: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> d4: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> d8: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> dc: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__bad_interrupt> e0: 0c 94 1e 58 jmp 0xb03c ; 0xb03c <__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 20 53 44 20 63 61 72 64 00 ..No SD card. 00003c45 : 3c45: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00003c55 : 3c55: ff ff 43 6c 65 61 72 20 54 4d 20 65 72 72 6f 72 ..Clear TM error ... 00003c66 : 3c66: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 00003c75 : 3c75: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 00003c83 : 3c83: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00003c8f : 3c8f: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00003c9f : 3c9f: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00003ca9 : 3ca9: ff ff 54 75 6e 65 00 ..Tune. 00003cb0 : 3cb0: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 00003cc0 : 3cc0: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00003cca : 3cca: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00003cd8 : 3cd8: ff ff 42 72 69 67 68 74 6e 65 73 73 00 ..Brightness. 00003ce5 : 3ce5: ff ff 41 73 73 69 73 74 00 ..Assist. 00003cee : 3cee: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00003cf7 : 3cf7: ff ff 4f 6e 63 65 00 ..Once. 00003cfe : 3cfe: ff ff 53 6f 75 6e 64 00 ..Sound. 00003d06 : 3d06: ff ff 4c 6f 75 64 00 ..Loud. 00003d0d : 3d0d: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 00003d1b : 3d1b: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 3d2b: 74 00 t. 00003d2d : 3d2d: ff ff 46 6c 6f 77 00 ..Flow. 00003d34 : 3d34: ff ff 53 70 65 65 64 00 ..Speed. 00003d3c : 3d3c: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 00003d4c : 3d4c: ff ff 4e 2f 41 00 ..N/A. 00003d52 : 3d52: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00003d60 : 3d60: ff ff 4d 65 73 68 00 ..Mesh. 00003d67 : 3d67: ff ff 54 69 6d 65 6f 75 74 00 ..Timeout. 00003d71 : 3d71: ff ff 4d 6f 64 65 00 ..Mode. 00003d78 : 3d78: ff ff 41 75 74 6f 00 ..Auto. 00003d7f : 3d7f: ff ff 44 69 6d 00 ..Dim. 00003d85 : 3d85: ff ff 42 72 69 67 68 74 00 ..Bright. 00003d8e : 3d8e: ff ff 4c 65 76 65 6c 20 44 69 6d 6d 65 64 00 ..Level Dimmed. 00003d9d : 3d9d: ff ff 4c 65 76 65 6c 20 42 72 69 67 68 74 00 ..Level Bright. 00003dac : 3dac: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00003db7 : 3db7: ff ff 59 65 73 00 ..Yes. 00003dbd : 3dbd: ff ff 4e 6f 00 ..No. 00003dc2 : 3dc2: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 00003dcf : 3dcf: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 00003ddf : 3ddf: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 3def: 65 2e 20 43 6f 6e 74 69 6e 75 65 20 61 6e 79 77 e. Continue anyw 3dff: 61 79 3f 00 ay?. 00003e03 : 3e03: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 00003e0e : 3e0e: ff ff 4d 61 69 6e 00 ..Main. 00003e15 : 3e15: ff ff 49 6e 73 65 72 74 20 74 68 65 20 66 69 6c ..Insert the fil 3e25: 61 6d 65 6e 74 20 28 64 6f 20 6e 6f 74 20 6c 6f ament (do not lo 3e35: 61 64 20 69 74 29 20 69 6e 74 6f 20 74 68 65 20 ad it) into the 3e45: 65 78 74 72 75 64 65 72 20 61 6e 64 20 74 68 65 extruder and the 3e55: 6e 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 n press the knob 3e65: 2e 00 .. 00003e67 : 3e67: ff ff 53 65 6e 73 6f 72 20 76 65 72 69 66 69 65 ..Sensor verifie 3e77: 64 2c 20 72 65 6d 6f 76 65 20 74 68 65 20 66 69 d, remove the fi 3e87: 6c 61 6d 65 6e 74 20 6e 6f 77 2e 00 lament now.. 00003e93 : 3e93: ff ff 56 65 72 69 66 69 63 61 74 69 6f 6e 20 66 ..Verification f 3ea3: 61 69 6c 65 64 2c 20 72 65 6d 6f 76 65 20 74 68 ailed, remove th 3eb3: 65 20 66 69 6c 61 6d 65 6e 74 20 61 6e 64 20 74 e filament and t 3ec3: 72 79 20 61 67 61 69 6e 2e 00 ry again.. 00003ecd : 3ecd: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 74 ..Please check t 3edd: 68 65 20 49 52 20 73 65 6e 73 6f 72 20 63 6f 6e he IR sensor con 3eed: 6e 65 63 74 69 6f 6e 2c 20 75 6e 6c 6f 61 64 20 nection, unload 3efd: 66 69 6c 61 6d 65 6e 74 20 69 66 20 70 72 65 73 filament if pres 3f0d: 65 6e 74 2e 00 ent.. 00003f12 : 3f12: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 3f22: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 3f32: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 3f42: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 00003f4f : 3f4f: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 3f5f: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 3f6f: 6c 69 6e 67 00 ling. 00003f74 : 3f74: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3f84: 74 3a 00 t:. 00003f87 : 3f87: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00003f95 : 3f95: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00003fa6 : 3fa6: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00003fb3 : 3fb3: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 00003fc1 : 3fc1: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 3fd1: 6d 65 00 me. 00003fd4 : 3fd4: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00003fe2 : 3fe2: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 3ff2: 72 73 00 rs. 00003ff5 : 3ff5: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 4005: 64 00 d. 00004007 : 4007: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00004016 : 4016: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 4026: 73 00 s. 00004028 : 4028: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 4038: 73 00 s. 0000403a : 403a: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 404a: 73 00 s. 0000404c : 404c: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 405c: 6f 70 73 00 ops. 00004060 : 4060: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 0000406f : 406f: ff ff 42 61 63 6b 00 ..Back. 00004076 : 4076: ff ff 53 74 72 69 63 74 00 ..Strict. 0000407f : 407f: ff ff 57 61 72 6e 00 ..Warn. 00004086 : 4086: ff ff 4e 6f 6e 65 00 ..None. 0000408d : 408d: ff ff 48 6f 74 65 6e 64 20 61 74 20 32 38 30 43 ..Hotend at 280C 409d: 21 20 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ! Nozzle changed 40ad: 20 61 6e 64 20 74 69 67 68 74 65 6e 65 64 20 74 and tightened t 40bd: 6f 20 73 70 65 63 73 3f 00 o specs?. 000040c6 : 40c6: ff ff 46 6f 72 20 61 20 4e 6f 7a 7a 6c 65 20 63 ..For a Nozzle c 40d6: 68 61 6e 67 65 20 70 6c 65 61 73 65 20 72 65 61 hange please rea 40e6: 64 0a 70 72 75 73 61 2e 69 6f 2f 6e 6f 7a 7a 6c d.prusa.io/nozzl 40f6: 65 2d 6d 6b 33 73 00 e-mk3s. 000040fd : 40fd: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 410d: 68 65 64 00 hed. 00004111 : 4111: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 0000411c : 411c: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 0000412b : 412b: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 0000413b : 413b: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 414b: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 415b: 68 65 20 47 2d 63 6f 64 65 2e 20 43 6f 6e 74 69 he G-code. Conti 416b: 6e 75 65 3f 00 nue?. 00004170 : 4170: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 4180: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 4190: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 41a0: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 41b0: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 20 50 e in settings. P 41c0: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 000041d0 : 41d0: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 41e0: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 43 lament loaded. C 41f0: 6f 6e 74 69 6e 75 65 3f 00 ontinue?. 000041f9 : 41f9: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4209: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 20 50 lament loaded. P 4219: 72 69 6e 74 20 63 61 6e 63 65 6c 6c 65 64 2e 00 rint cancelled.. 00004229 : 4229: ff ff 4d 4b 33 53 20 66 69 72 6d 77 61 72 65 20 ..MK3S firmware 4239: 64 65 74 65 63 74 65 64 20 6f 6e 20 4d 4b 33 20 detected on MK3 4249: 70 72 69 6e 74 65 72 00 printer. 00004251 : 4251: ff ff 42 6c 61 63 6b 6f 75 74 20 6f 63 63 75 72 ..Blackout occur 4261: 72 65 64 2e 20 52 65 63 6f 76 65 72 20 70 72 69 red. Recover pri 4271: 6e 74 3f 00 nt?. 00004275 : 4275: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 4285: 6e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 20 79 not calibrated y 4295: 65 74 2e 00 et.. 00004299 : 4299: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 42a9: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 42b9: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 42c9: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 42d9: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 42e9: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 42f9: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4309: 6e 20 66 6c 6f 77 2e 00 n flow.. 00004311 : 4311: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 4321: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 4331: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 4341: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 4351: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 4361: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 4371: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 00004381 : 4381: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 4391: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 43a1: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 43b1: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 43c1: 2e 00 .. 000043c3 : 43c3: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 43d3: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 43e3: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 43f3: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 000043ff : 43ff: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 440f: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 441f: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 442f: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 0000443a : 443a: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 444a: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 0000445b : 445b: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 446b: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 447b: 67 65 64 2e 00 ged.. 00004480 : 4480: ff ff 53 68 65 65 74 00 ..Sheet. 00004488 : 4488: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 00004497 : 4497: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 000044a2 : 44a2: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000044ad : 44ad: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 44bd: 64 00 d. 000044bf : 44bf: ff ff 25 73 20 6c 65 76 65 6c 20 65 78 70 65 63 ..%s level expec 44cf: 74 65 64 00 ted. 000044d3 : 44d3: ff ff 46 61 6c 73 65 20 74 72 69 67 67 65 72 69 ..False triggeri 44e3: 6e 67 00 ng. 000044e6 : 44e6: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 44f6: 72 00 r. 000044f8 : 44f8: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 00004502 : 4502: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 4512: 73 00 s. 00004514 : 4514: ff ff 41 78 69 73 00 ..Axis. 0000451b : 451b: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00004529 : 4529: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00004538 : 4538: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 4548: 6e 3f 00 n?. 0000454b : 454b: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 455b: 6e 3f 00 n?. 0000455e : 455e: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 456e: 74 00 t. 00004570 : 4570: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 0000457a : 457a: ff ff 4d 6f 74 6f 72 00 ..Motor. 00004582 : 4582: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 0000458d : 458d: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 0000459c : 459c: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 000045a9 : 45a9: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 000045b9 : 45b9: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 45c9: 74 6f 72 00 tor. 000045cd : 45cd: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 000045dd : 45dd: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 45ed: 21 00 !. 000045ef : 45ef: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45ff: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 460f: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 461f: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 462f: 79 2e 00 y.. 00004632 : 4632: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4642: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 4652: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 4662: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 4672: 6a 6f 62 21 00 job!. 00004677 : 4677: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4687: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 4697: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 46a7: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 46b7: 73 21 00 s!. 000046ba : 46ba: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 46ca: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 46da: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 46ea: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 46fa: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 00004706 : 4706: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4716: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 4726: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 4736: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 4746: 68 61 62 6c 65 2e 00 hable.. 0000474d : 474d: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 475d: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 476d: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 477d: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 478d: 68 61 62 6c 65 2e 00 hable.. 00004794 : 4794: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 47a4: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 47b4: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 47c4: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 47d4: 2e 00 .. 000047d6 : 47d6: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 47e6: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 47f6: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 4806: 75 61 6c 2e 00 ual.. 0000480b : 480b: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 481b: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 482b: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 483b: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 0000484a : 484a: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 485a: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 486a: 61 74 62 65 64 2e 00 atbed.. 00004871 : 4871: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 4881: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 4891: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 48a1: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 48b1: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 48c1: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 48d1: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 48e1: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 48f1: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 4901: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 00004910 : 4910: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 4920: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 4930: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 4940: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 4950: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 4960: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 4970: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 4980: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 4990: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 49a0: 69 61 74 65 6c 79 2e 00 iately.. 000049a8 : 49a8: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 49b8: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 49c8: 74 00 t. 000049ca : 49ca: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 49da: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 49ea: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 49fa: 74 00 t. 000049fc : 49fc: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 4a0c: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 4a1c: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 4a2c: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00004a38 : 4a38: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 00004a44 : 4a44: ff ff 54 48 45 52 4d 41 4c 20 41 4e 4f 4d 41 4c ..THERMAL ANOMAL 4a54: 59 00 Y. 00004a56 : 4a56: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00004a67 : 4a67: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00004a77 : 4a77: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 4a87: 6e 65 00 ne. 00004a8a : 4a8a: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 00004a9a : 4a9a: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 00004aa5 : 4aa5: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 00004ab3 : 4ab3: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 00004ac3 : 4ac3: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 00004acd : 4acd: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 00004ad9 : 4ad9: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00004aea : 4aea: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4afa: 73 00 s. 00004afc : 4afc: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4b0c: 65 73 00 es. 00004b0f : 4b0f: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004b20 : 4b20: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 4b30: 6c 75 72 65 73 00 lures. 00004b36 : 4b36: ff ff 50 6f 77 65 72 20 66 61 69 6c 75 72 65 73 ..Power failures ... 00004b47 : 4b47: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004b56 : 4b56: ff ff 43 72 61 73 68 00 ..Crash. 00004b5e : 4b5e: ff ff 54 6f 74 61 6c 00 ..Total. 00004b66 : 4b66: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00004b73 : 4b73: ff ff 41 6d 62 69 65 6e 74 00 ..Ambient. 00004b7d : 4b7d: ff ff 56 6f 6c 74 61 67 65 73 00 ..Voltages. 00004b88 : 4b88: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004b97 : 4b97: ff ff 42 65 6c 74 20 73 74 61 74 75 73 00 ..Belt status. 00004ba5 : 4ba5: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004bb3 : 4bb3: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004bc3 : 4bc3: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4bd3: 6c 73 00 ls. 00004bd6 : 4bd6: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4be6: 72 3a 00 r:. 00004be9 : 4be9: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004bf3 : 4bf3: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004c03 : 4c03: ff ff 44 61 74 65 3a 00 ..Date:. 00004c0b : 4c0b: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4c1b: 6d 65 6e 74 00 ment. 00004c20 : 4c20: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4c30: 6e 74 00 nt. 00004c33 : 4c33: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004c44 : 4c44: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4c54: 63 75 74 00 cut. 00004c58 : 4c58: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4c68: 65 6a 65 63 74 00 eject. 00004c6e : 4c6e: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4c7e: 75 6e 6c 6f 61 64 00 unload. 00004c85 : 4c85: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4c95: 6c 6f 61 64 00 load. 00004c9a : 4c9a: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00004ca5 : 4ca5: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 4cb5: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 4cc5: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00004cd0 : 4cd0: ff ff 45 6a 65 63 74 00 ..Eject. 00004cd8 : 4cd8: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 4ce8: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 4cf8: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 4d08: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 4d18: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 00004d25 : 4d25: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 00004d36 : 4d36: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 4d46: 6d 65 00 me. 00004d49 : 4d49: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00004d59 : 4d59: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 00004d66 : 4d66: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 4d76: 7a 7a 6c 65 21 00 zzle!. 00004d7c : 4d7c: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00004d85 : 4d85: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 4d95: 6d 20 6d 69 6e 00 m min. 00004d9b : 4d9b: ff ff 4c 65 66 74 00 ..Left. 00004da2 : 4da2: ff ff 52 69 67 68 74 00 ..Right. 00004daa : 4daa: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00004dba : 4dba: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00004dc8 : 4dc8: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00004dd6 : 4dd6: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 4de6: 66 73 65 74 00 fset. 00004deb : 4deb: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00004df9 : 4df9: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00004e0a : 4e0a: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00004e1b : 4e1b: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00004e2c : 4e2c: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00004e3d : 4e3d: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 4e4d: 65 3a 00 e:. 00004e50 : 4e50: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4e60: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00004e6b : 4e6b: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4e7b: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 4e8b: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 4e9b: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 4eab: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 4ebb: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00004ec7 : 4ec7: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00004ed2 : 4ed2: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00004edb : 4edb: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00004ee4 : 4ee4: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00004eed : 4eed: ff ff 43 72 61 73 68 20 64 65 74 65 63 74 69 6f ..Crash detectio 4efd: 6e 20 63 61 6e 0a 62 65 20 74 75 72 6e 65 64 20 n can.be turned 4f0d: 6f 6e 20 6f 6e 6c 79 20 69 6e 0a 4e 6f 72 6d 61 on only in.Norma 4f1d: 6c 20 6d 6f 64 65 00 l mode. 00004f24 : 4f24: ff ff 57 41 52 4e 49 4e 47 3a 0a 43 72 61 73 68 ..WARNING:.Crash 4f34: 20 64 65 74 65 63 74 69 6f 6e 0a 64 69 73 61 62 detection.disab 4f44: 6c 65 64 20 69 6e 0a 53 74 65 61 6c 74 68 20 6d led in.Stealth m 4f54: 6f 64 65 00 ode. 00004f58 : 4f58: ff ff 4d 6f 64 65 20 63 68 61 6e 67 65 20 69 6e ..Mode change in 4f68: 20 70 72 6f 67 72 65 73 73 2e 2e 2e 00 progress.... 00004f75 : 4f75: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 4f85: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004f8f : 4f8f: ff ff 43 6f 6d 6d 75 6e 69 74 79 20 6d 61 64 65 ..Community made ... 00004fa0 : 4fa0: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 4fb0: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 4fc0: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 4fd0: 65 74 00 et. 00004fd3 : 4fd3: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 4fe3: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00004ff1 : 4ff1: ff ff 3e 43 61 6e 63 65 6c 00 ..>Cancel. 00004ffb : 4ffb: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 500b: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 501b: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 502b: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 503b: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 504b: 6e 6e 69 6e 67 2e 20 43 6f 6e 74 69 6e 75 65 3f nning. Continue? ... 0000505c : 505c: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 506c: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 507c: 2e 00 .. 0000507e : 507e: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 508e: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 509e: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 50ae: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 50be: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 000050ca : 50ca: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 50da: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 50ea: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 50fa: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 510a: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 511a: 6c 6f 61 64 20 69 74 2e 00 load it.. 00005123 : 5123: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 5133: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 5143: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 5153: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 5163: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 5173: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 5183: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 5193: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 51a3: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 51b3: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 000051c3 : 51c3: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 51d3: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 51e3: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 51f3: 2e 00 .. 000051f5 : 51f5: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 5205: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 5215: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 5225: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 5235: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 5245: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 0000524e : 524e: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 525e: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 526e: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 527e: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 528e: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 0000529d : 529d: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 52ad: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 52bd: 20 69 74 20 6e 6f 77 3f 00 it now?. 000052c6 : 52c6: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 52d6: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 52e6: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 000052f0 : 52f0: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 5300: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 0000530d : 530d: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 531d: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 532d: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 533d: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 534d: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 535d: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 536d: 2e 00 .. 0000536f : 536f: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 537f: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 0000538e : 538e: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 539e: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 53ae: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 53be: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 000053cd : 53cd: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 53dd: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 53ed: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 53fd: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 540d: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 541d: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 542d: 65 65 74 73 2e 00 eets.. 00005433 : 5433: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 5443: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 5453: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 00005463 : 5463: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 5473: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 5483: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 5493: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 54a3: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 54b3: 64 3f 00 d?. 000054b6 : 54b6: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 54c6: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 54d6: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 54e6: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 000054f7 : 54f7: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 5507: 61 64 65 64 3f 00 aded?. 0000550d : 550d: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 551d: 63 61 6c 2e 20 74 61 6b 65 73 20 61 70 70 72 6f cal. takes appro 552d: 78 2e 20 31 32 20 6d 69 6e 73 2e 20 53 65 65 0a x. 12 mins. See. 553d: 70 72 75 73 61 2e 69 6f 2f 74 6d 2d 63 61 6c 00 prusa.io/tm-cal. 0000554d : 554d: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 555d: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 556d: 50 4c 41 2e 00 PLA.. 00005572 : 5572: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 5582: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 00005592 : 5592: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 55a2: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 55b2: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 000055c0 : 55c0: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 55d0: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 55e0: 20 66 69 72 73 74 2e 00 first.. 000055e8 : 55e8: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 55f8: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 5608: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 5618: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 00005626 : 5626: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 5636: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 5646: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 5656: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 5666: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 0000566f : 566f: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 567f: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 568f: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 569f: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 56af: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 56bf: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 56cf: 65 73 73 3f 00 ess?. 000056d4 : 56d4: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 56e4: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 56f4: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 5704: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 5714: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 5724: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 5734: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 5744: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 5754: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 5764: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 5774: 69 6e 74 2e 00 int.. 00005779 : 5779: ff ff 45 2d 63 6f 72 72 65 63 74 00 ..E-correct. 00005785 : 5785: ff ff 5a 2d 63 6f 72 72 65 63 74 00 ..Z-correct. 00005791 : 5791: ff ff 59 2d 63 6f 72 72 65 63 74 00 ..Y-correct. 0000579d : 579d: ff ff 58 2d 63 6f 72 72 65 63 74 00 ..X-correct. 000057a9 : 57a9: ff ff 50 61 75 73 65 00 ..Pause. 000057b1 : 57b1: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 000057bd : 57bd: ff ff 43 6f 6e 74 2e 00 ..Cont.. 000057c5 : 57c5: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 000057d3 : 57d3: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 000057df : 57df: ff ff 4d 4d 55 20 4d 6f 64 65 00 ..MMU Mode. 000057ea : 57ea: ff ff 43 75 74 74 65 72 00 ..Cutter. 000057f3 : 57f3: ff ff 53 74 65 61 6c 74 68 00 ..Stealth. 000057fd : 57fd: ff ff 43 72 61 73 68 20 64 65 74 2e 00 ..Crash det.. 0000580a : 580a: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 00005816 : 5816: ff ff 42 65 64 00 ..Bed. 0000581c : 581c: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 00005829 : 5829: ff ff 4d 6f 64 65 6c 00 ..Model. 00005831 : 5831: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 0000583a : 583a: ff ff 43 68 65 63 6b 73 00 ..Checks. 00005843 : 5843: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00005853 : 5853: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 0000585f : 585f: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 0000586a : 586a: ff ff 53 6f 72 74 00 ..Sort. 00005871 : 5871: ff ff 54 69 6d 65 00 ..Time. 00005878 : 5878: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00005881 : 5881: ff ff 53 44 20 63 61 72 64 00 ..SD card. 0000588b : 588b: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 589b: 65 00 e. 0000589d : 589d: ff ff 52 50 69 20 70 6f 72 74 00 ..RPi port. 000058a8 : 58a8: ff ff 4c 69 6e 2e 20 63 6f 72 72 65 63 74 69 6f ..Lin. correctio 58b8: 6e 00 n. 000058ba : 58ba: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 000058c5 : 58c5: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 000058d4 : 58d4: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 58e4: 72 73 00 rs. 000058e7 : 58e7: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 000058f3 : 58f3: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 00005901 : 5901: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 5911: 6e 73 6f 72 00 nsor. 00005916 : 5916: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 5926: 72 00 r. 00005928 : 5928: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 00005931 : 5931: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 5941: 49 4e 44 41 00 INDA. 00005946 : 5946: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 5956: 65 6e 74 00 ent. 0000595a : 595a: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 596a: 6f 72 00 or. 0000596d : 596d: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 597d: 63 74 6f 72 00 ctor. 00005982 : 5982: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 00005993 : 5993: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 59a3: 6e 74 00 nt. 000059a6 : 59a6: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 59b6: 65 00 e. 000059b8 : 59b8: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 59c8: 20 73 6c 6f 74 00 slot. 000059ce : 59ce: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 59de: 6d 65 6e 74 00 ment. 000059e3 : 59e3: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 000059f4 : 59f4: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5a04: 65 6e 74 00 ent. 00005a08 : 5a08: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 00005a17 : 5a17: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 5a27: 73 65 72 00 ser. 00005a2b : 5a2b: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 5a3b: 6d 65 6e 74 73 00 ments. 00005a41 : 5a41: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 00005a52 : 5a52: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 5a62: 7a 6c 65 00 zle. 00005a66 : 5a66: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 5a76: 72 75 64 65 72 00 ruder. 00005a7c : 5a7c: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 5a8c: 44 41 00 DA. 00005a8f : 5a8f: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 5a9f: 75 6c 6c 65 79 00 ulley. 00005aa5 : 5aa5: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 5ab5: 49 4e 44 41 00 INDA. 00005aba : 5aba: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 5aca: 6c 65 72 00 ler. 00005ace : 5ace: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 00005adf : 5adf: ff ff 4f 4b 00 ..OK. 00005ae4 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.544>: 5ae4: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 00005af4 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.543>: 5af4: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5b04: 45 00 E. 00005b06 <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.542>: 5b06: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5b16: 45 44 00 ED. 00005b19 <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.541>: 5b19: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5b29: 59 00 Y. 00005b2b <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.540>: 5b2b: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 5b3b: 4f 52 00 OR. 00005b3e <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.539>: 5b3e: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 5b4e: 4e 45 45 44 45 44 00 NEEDED. 00005b55 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.538>: 5b55: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005b62 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.537>: 5b62: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 00005b71 <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.536>: 5b71: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 5b81: 4f 41 44 45 44 00 OADED. 00005b87 <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.535>: 5b87: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5b97: 45 52 52 4f 52 00 ERROR. 00005b9d <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.534>: 5b9d: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 5bad: 44 49 4e 47 00 DING. 00005bb2 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.533>: 5bb2: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005bc2 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.532>: 5bc2: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5bd2: 41 49 4c 45 44 00 AILED. 00005bd8 <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.531>: 5bd8: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5be8: 52 54 45 44 00 RTED. 00005bed <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.530>: 5bed: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 5bfd: 47 45 20 45 52 52 00 GE ERR. 00005c04 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.529>: 5c04: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5c14: 45 54 00 ET. 00005c17 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.528>: 5c17: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5c27: 4f 52 00 OR. 00005c2a <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.527>: 5c2a: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 5c3a: 52 52 4f 52 00 RROR. 00005c3f <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.526>: 5c3f: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 5c4f: 4f 20 48 4f 54 00 O HOT. 00005c55 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.525>: 5c55: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 5c65: 4f 56 45 00 OVE. 00005c69 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.524>: 5c69: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 5c79: 4f 4d 45 00 OME. 00005c7d <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.523>: 5c7d: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5c8d: 54 20 4d 4f 56 45 00 T MOVE. 00005c94 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.522>: 5c94: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5ca4: 54 20 48 4f 4d 45 00 T HOME. 00005cab <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.521>: 5cab: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5cbb: 46 41 49 4c 45 44 00 FAILED. 00005cc2 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.520>: 5cc2: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005cd2 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.519>: 5cd2: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5ce2: 52 4c 59 00 RLY. 00005ce6 <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.518>: 5ce6: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5cf6: 4d 4f 56 45 00 MOVE. 00005cfb <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.517>: 5cfb: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5d0b: 54 55 43 4b 00 TUCK. 00005d10 <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.516>: 5d10: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5d20: 54 52 49 47 47 2e 00 TRIGG.. 00005d27 <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.515>: 5d27: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5d37: 54 55 43 4b 00 TUCK. 00005d3c <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.514>: 5d3c: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 5d4c: 49 47 47 45 52 00 IGGER. 00005d52 : 5d52: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005d61 : 5d61: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005d72 : 5d72: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5d82: 6e 74 00 nt. 00005d85 : 5d85: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5d95: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5da5: 72 65 2e 2e 2e 00 re.... 00005dab : 5dab: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005dbb : 5dbb: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5dcb: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5ddb: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5deb: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5dfb: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5e0b: 30 2e 00 0.. 00005e0e : 5e0e: ff ff 75 6e 6b 6e 6f 77 6e 20 73 74 61 74 65 00 ..unknown state. 00005e1e : 5e1e: ff ff 20 30 2e 34 20 6f 72 20 6e 65 77 65 72 00 .. 0.4 or newer. 00005e2e : 5e2e: ff ff 20 30 2e 33 20 6f 72 20 6f 6c 64 65 72 00 .. 0.3 or older. 00005e3e : 5e3e: ff ff 4f 66 66 00 ..Off. 00005e44 : 5e44: ff ff 4f 6e 00 ..On. 00005e49 : 5e49: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5e59: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005e66 : 5e66: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5e76: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5e86: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5e96: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5ea6: 2e 00 .. 00005ea8 : 5ea8: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5eb8: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5ec8: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5ed8: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005ee1 : 5ee1: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5ef1: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5f01: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5f11: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5f21: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5f31: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005f3f : 5f3f: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5f4f: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5f5f: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5f6f: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5f7f: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005f89 : 5f89: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5f99: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5fa9: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5fb9: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5fc9: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005fd3 : 5fd3: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5fe3: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5ff3: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 6003: 4d 4d 55 2e 00 MMU.. 00006008 : 6008: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 6018: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 6028: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 6038: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 6048: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 6058: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 6068: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 6078: 29 2e 00 ).. 0000607b : 607b: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 608b: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 609b: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 60ab: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 60bb: 69 74 20 66 69 72 73 74 2e 00 it first.. 000060c5 : 60c5: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 60d5: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 60e5: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 60f5: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 00006106 : 6106: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 6116: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 6126: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 6136: 63 74 6f 72 73 2e 00 ctors.. 0000613d : 613d: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 614d: 6e 6c 69 6e 65 2e 00 nline.. 00006154 : 6154: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 6164: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 6174: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 6184: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 6194: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 000061a0 : 61a0: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 61b0: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 000061c0 : 61c0: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 61d0: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 61e0: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 61f0: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 6200: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 0000620f : 620f: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 621f: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 622f: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 623f: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 624f: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 625f: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 626f: 6e 65 65 64 65 64 2e 00 needed.. 00006277 : 6277: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 6287: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 6297: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 62a7: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 62b7: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 62c7: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 62d7: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 62e7: 6f 70 65 72 6c 79 2e 00 operly.. 000062ef : 62ef: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 62ff: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 630f: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 631f: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 632f: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 633f: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 634f: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 635f: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 636f: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 637f: 2e 00 .. 00006381 : 6381: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 6391: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 63a1: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 63b1: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 63c1: 20 77 69 72 69 6e 67 2e 00 wiring.. 000063ca : 63ca: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 63da: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 63ea: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 63fa: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 640a: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 641a: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 642a: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 00006437 : 6437: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6447: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 6457: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 6467: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 6477: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 6487: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 6497: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 64a7: 61 63 68 65 64 20 69 74 2e 00 ached it.. 000064b1 : 64b1: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 64c1: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 64d1: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 64e1: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 64f1: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 6501: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 6511: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 6521: 6f 72 6b 73 2e 00 orks.. 00006527 : 6527: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 6537: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 6547: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 6557: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 6567: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 6577: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 00006588 : 6588: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00006592 : 6592: ff ff 53 74 6f 70 00 ..Stop. 00006599 : 6599: ff ff 4c 6f 61 64 00 ..Load. 000065a0 : 65a0: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 000065a9 : 65a9: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 000065b4 : 65b4: ff ff 52 65 74 72 79 00 ..Retry. 000065bc : 65bc: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 65cc: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 65dc: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 65ec: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 65fc: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 660c: 74 2e 00 t.. 0000660f : 660f: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 0000661d : 661d: ff ff 44 6f 6e 65 00 ..Done. 00006624 : 6624: ff ff 52 65 63 6f 76 65 72 69 6e 67 20 70 72 69 ..Recovering pri 6634: 6e 74 00 nt. 00006637 <__loc_pri_end>: 6637: 65 6e ori r22, 0xE5 ; 229 6639: 71 75 andi r23, 0x51 ; 81 663b: 65 69 ori r22, 0x95 ; 149 663d: 6e 67 ori r22, 0x7E ; 126 663f: 20 22 and r2, r16 ... 00006642 : 6642: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 6652: 6c 65 00 le. 00006655 : 6655: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 6665: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 6675: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 0000667f : 667f: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 668f: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 669f: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000066a9 : 66a9: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 66b9: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 000066c8 : 66c8: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 66d8: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 66e8: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 66f8: 3a 20 00 : . 000066fb : 66fb: 25 6c 75 20 62 79 74 65 73 20 77 72 69 74 74 65 %lu bytes writte 670b: 6e 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 n to %S at addre 671b: 73 73 20 30 78 25 30 34 6c 78 0a 00 ss 0x%04lx.. 00006727 : 6727: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 6737: 20 25 53 0a 00 %S.. 0000673c <__c.2366>: 673c: 3f 3f 00 ??. 0000673f <__c.2364>: 673f: 52 6f 6d 61 6e 61 00 Romana. 00006746 <__c.2361>: 6746: 48 72 76 61 74 73 6b 69 00 Hrvatski. 0000674f <__c.2358>: 674f: 4d 61 67 79 61 72 00 Magyar. 00006756 <__c.2355>: 6756: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 00006761 <__c.2352>: 6761: 4e 6f 72 73 6b 00 Norsk. 00006767 <__c.2349>: 6767: 53 76 65 6e 73 6b 61 00 Svenska. 0000676f <__c.2346>: 676f: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 0000677a <__c.2343>: 677a: 50 6f 6c 73 6b 69 00 Polski. 00006781 <__c.2340>: 6781: 49 74 61 6c 69 61 6e 6f 00 Italiano. 0000678a <__c.2337>: 678a: 46 72 61 6e 63 61 69 73 00 Francais. 00006793 <__c.2334>: 6793: 45 73 70 61 6e 6f 6c 00 Espanol. 0000679b <__c.2331>: 679b: 44 65 75 74 73 63 68 00 Deutsch. 000067a3 <__c.2328>: 67a3: 43 65 73 74 69 6e 61 00 Cestina. 000067ab <__c.2325>: 67ab: 45 6e 67 6c 69 73 68 00 English. 000067b3 : 67b3: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 000067be : 67be: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 67ce: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 67de: 31 40 3a 25 75 0a 00 1@:%u.. 000067e5 : 67e5: 52 65 73 65 6e 64 00 Resend. 000067ec : 67ec: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 000067f8 : 67f8: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 6808: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 00006812 : 6812: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 6822: 64 65 74 65 63 74 65 64 21 00 detected!. 0000682c : 682c: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 683c: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 684c: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 685c: 72 65 64 2e 00 red.. 00006861 : 6861: 64 75 6d 70 20 63 6c 65 61 72 65 64 0a 00 dump cleared.. 0000686f : 686f: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 687f: 65 0a 00 e.. 00006882 : 6882: 44 32 31 20 2d 20 72 65 61 64 20 63 72 61 73 68 D21 - read crash 6892: 20 64 75 6d 70 0a 00 dump.. 00006899 : 6899: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 68a9: 65 0a 00 e.. 000068ac : 68ac: 64 75 6d 70 20 63 6f 6d 70 6c 65 74 65 64 20 69 dump completed i 68bc: 6e 20 25 6c 75 6d 73 0a 00 n %lums.. 000068c5 : 68c5: 58 46 4c 41 53 48 00 XFLASH. 000068cc : 68cc: 45 45 50 52 4f 4d 00 EEPROM. 000068d3 : 68d3: 53 52 41 4d 00 SRAM. 000068d8 : 68d8: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 68e8: 6f 70 0a 00 op.. 000068ec : 68ec: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 68fc: 20 30 00 0. 000068ff : 68ff: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 00006910 : 6910: 74 6d 63 32 31 33 30 5f 70 72 69 6e 74 5f 63 75 tmc2130_print_cu 6920: 72 72 65 6e 74 73 28 29 0a 09 48 09 52 0a 58 09 rrents()..H.R.X. 6930: 25 64 09 25 64 0a 59 09 25 64 09 25 64 0a 5a 09 %d.%d.Y.%d.%d.Z. 6940: 25 64 09 25 64 0a 45 09 25 64 09 25 64 0a 00 %d.%d.E.%d.%d.. 0000694f : 694f: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 695f: 20 00 . 00006961 : 6961: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 6971: 20 22 00 ". 00006974 <_ZZ16process_commandsvE3__c__67_>: 6974: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 6984: 72 75 64 65 72 20 00 ruder . 0000698b : 698b: 7a 5f 6d 61 78 3a 20 00 z_max: . 00006993 : 6993: 7a 5f 6d 69 6e 3a 20 00 z_min: . 0000699b <_ZZ16process_commandsvE3__c__66_>: 699b: 79 5f 6d 61 78 3a 20 00 y_max: . 000069a3 <_ZZ16process_commandsvE3__c__65_>: 69a3: 79 5f 6d 69 6e 3a 20 00 y_min: . 000069ab <_ZZ16process_commandsvE3__c__64_>: 69ab: 78 5f 6d 61 78 3a 20 00 x_max: . 000069b3 : 69b3: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 000069bd : 69bd: 6f 70 65 6e 00 open. 000069c2 <_ZZ16process_commandsvE3__c__63_>: 69c2: 78 5f 6d 69 6e 3a 20 00 x_min: . 000069ca <_ZZ16process_commandsvE3__c__62_>: 69ca: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 69da: 70 20 73 74 61 74 75 73 00 p status. 000069e3 : 69e3: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 69f3: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 00006a00 : 6a00: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 6a10: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 00006a1d : 6a1d: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 61 75 //action:uvlo_au 6a2d: 74 6f 5f 72 65 63 6f 76 65 72 79 5f 72 65 61 64 to_recovery_read 6a3d: 79 00 y. 00006a3f <_ZZ16process_commandsvE3__c__45_>: 6a3f: 53 49 4c 45 4e 54 00 SILENT. 00006a46 <_ZZ16process_commandsvE3__c__44_>: 6a46: 4e 4f 52 4d 41 4c 00 NORMAL. 00006a4d <_ZZ16process_commandsvE3__c__43_>: 6a4d: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 6a5d: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 6a6d: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 6a7d: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 6a8d: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 6a9d: 64 0a 00 d.. 00006aa0 <_ZZ16process_commandsvE3__c__42_>: 6aa0: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 6ab0: 0a 00 .. 00006ab2 <_ZZ16process_commandsvE3__c__38_>: 6ab2: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 00006ac0 <_ZZ16process_commandsvE3__c__37_>: 6ac0: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 00006ad0 : 6ad0: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 6ae0: 20 25 73 0a 00 %s.. 00006ae5 <_ZZ16process_commandsvE3__c__35_>: 6ae5: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 6af5: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 6b05: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006b11 <_ZZ16process_commandsvE3__c__34_>: 6b11: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 00006b1e <_ZZ16process_commandsvE3__c__33_>: 6b1e: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 6b2e: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 6b3e: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6b4e: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 00006b5a <_ZZ16process_commandsvE3__c__32_>: 6b5a: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 00006b67 <_ZZ16process_commandsvE3__c__31_>: 6b67: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 6b77: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006b80 <_ZZ16process_commandsvE3__c__28_>: 6b80: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006b89 <_ZZ16process_commandsvE3__c__27_>: 6b89: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6b99: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 00006ba5 <_ZZ16process_commandsvE3__c__26_>: 6ba5: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006bae <_ZZ16process_commandsvE3__c__10_>: 6bae: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6bbe: 64 20 52 50 4d 0a 00 d RPM.. 00006bc5 : 6bc5: 4d 31 30 37 00 M107. 00006bca : 6bca: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 63 61 Thermal Model ca 6bda: 6c 2e 00 l.. 00006bdd : 6bdd: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6bed: 52 4f 52 00 ROR. 00006bf1 : 6bf1: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6c01: 52 52 4f 52 00 RROR. 00006c06 : 6c06: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006c17 : 6c17: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006c27 : 6c27: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006c36 : 6c36: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6c46: 64 79 00 dy. 00006c49 : 6c49: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006c59 : 6c59: 41 78 69 73 20 6c 65 6e 67 74 68 20 64 69 66 66 Axis length diff 6c69: 65 72 65 6e 63 65 3a 25 2e 33 66 0a 00 erence:%.3f.. 00006c76 : 6c76: 4d 65 61 73 75 72 65 64 20 61 78 69 73 20 6c 65 Measured axis le 6c86: 6e 67 74 68 3a 25 2e 33 66 0a 00 ngth:%.3f.. 00006c91 : 6c91: 4f 4b 00 OK. 00006c94 : 6c94: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6ca4: 65 64 00 ed. 00006ca7 <_ZZN10CardReader7releaseEvE3__c.lto_priv.552>: 6ca7: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006cb8 : 6cb8: 46 61 6b 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 Fake serial numb 6cc8: 65 72 00 er. 00006ccb : 6ccb: 45 2d 63 6f 6f 6c 20 6d 6f 64 65 00 E-cool mode. 00006cd7 : 6cd7: 41 4c 54 46 41 4e 20 64 65 74 2e 00 ALTFAN det.. 00006ce3 : 6ce3: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006cf2 : 6cf2: 4d 38 34 00 M84. 00006cf6 : 6cf6: 4d 37 30 32 00 M702. 00006cfb : 6cfb: 4d 38 33 00 M83. 00006cff : 6cff: 47 32 38 20 57 00 G28 W. 00006d05 : 6d05: 4d 35 30 30 00 M500. 00006d0a : 6d0a: 45 78 74 65 72 6e 61 6c 20 53 50 49 20 66 6c 61 External SPI fla 6d1a: 73 68 0a 58 46 4c 41 53 48 20 69 73 20 6e 6f 74 sh.XFLASH is not 6d2a: 20 72 65 73 2d 0a 70 6f 6e 64 69 6e 67 2e 20 4c res-.ponding. L 6d3a: 61 6e 67 75 61 67 65 0a 73 77 69 74 63 68 20 75 anguage.switch u 6d4a: 6e 61 76 61 69 6c 61 62 6c 65 2e 00 navailable.. 00006d56 : 6d56: 58 46 4c 41 53 48 20 6e 6f 74 20 72 65 73 70 6f XFLASH not respo 6d66: 6e 64 69 6e 67 2e 00 nding.. 00006d6d : 6d6d: 46 57 20 63 72 61 73 68 20 64 65 74 65 63 74 65 FW crash detecte 6d7d: 64 21 20 59 6f 75 20 63 61 6e 20 63 6f 6e 74 69 d! You can conti 6d8d: 6e 75 65 20 70 72 69 6e 74 69 6e 67 2e 20 44 65 nue printing. De 6d9d: 62 75 67 20 64 61 74 61 20 61 76 61 69 6c 61 62 bug data availab 6dad: 6c 65 20 66 6f 72 20 61 6e 61 6c 79 73 69 73 2e le for analysis. 6dbd: 20 43 6f 6e 74 61 63 74 20 73 75 70 70 6f 72 74 Contact support 6dcd: 20 74 6f 20 73 75 62 6d 69 74 20 64 65 74 61 69 to submit detai 6ddd: 6c 73 2e 00 ls.. 00006de1 : 6de1: 2f 2f 61 63 74 69 6f 6e 3a 64 75 6d 70 5f 61 76 //action:dump_av 6df1: 61 69 6c 61 62 6c 65 00 ailable. 00006df9 <_ZZ5setupE3__c__14_>: 6df9: 43 72 61 73 68 44 65 74 65 63 74 20 44 49 53 41 CrashDetect DISA 6e09: 42 4c 45 44 00 BLED. 00006e0e <_ZZ5setupE3__c__13_>: 6e0e: 43 72 61 73 68 44 65 74 65 63 74 20 45 4e 41 42 CrashDetect ENAB 6e1e: 4c 45 44 21 00 LED!. 00006e23 <_ZZ5setupE3__c__10_>: 6e23: 48 6f 74 65 6e 64 20 66 61 6e 20 74 79 70 65 3a Hotend fan type: 6e33: 20 00 . 00006e35 : 6e35: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6e45: 79 74 65 73 3a 20 00 ytes: . 00006e4c : 6e4c: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006e5b : 6e5b: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006e67 : 6e67: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006e77 : 6e77: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006e87 : 6e87: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006e97 : 6e97: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006ea8 : 6ea8: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006eb8 : 6eb8: 50 6f 77 65 72 55 70 00 PowerUp. 00006ec0 : 6ec0: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6ed0: 20 66 69 6c 65 00 file. 00006ed6 : 6ed6: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6ee6: 2e 00 .. 00006ee8 : 6ee8: 6f 6b 00 ok. 00006eeb : 6eeb: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006ef4 : 6ef4: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 6f04: 25 66 20 25 66 0a 00 %f %f.. 00006f0b : 6f0b: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6f1b: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6f2b: 69 6c 65 64 2e 0a 00 iled... 00006f32 : 6f32: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6f42: 65 73 73 2e 0a 00 ess... 00006f48 : 6f48: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6f58: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006f69 : 6f69: 31 2f 34 00 1/4. 00006f6d : 6f6d: 31 2f 34 00 1/4. 00006f71 : 6f71: 31 2f 39 00 1/9. 00006f75 : 6f75: 54 4d 43 20 44 52 49 56 45 52 20 4f 56 45 52 54 TMC DRIVER OVERT 6f85: 45 4d 50 00 EMP. 00006f89 : 6f89: 48 6f 6c 64 20 63 75 72 72 65 6e 74 20 74 72 75 Hold current tru 6f99: 6e 63 61 74 65 64 20 74 6f 20 52 75 6e 20 63 75 ncated to Run cu 6fa9: 72 72 65 6e 74 00 rrent. 00006faf : 6faf: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006fb9 : 6fb9: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006fc2 : 6fc2: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006fcb : 6fcb: 86 25 33 64 25 25 00 .%3d%%. 00006fd2 : 6fd2: 2d 2d 2d 25 25 00 ---%%. 00006fd8 : 6fd8: 25 33 64 25 25 00 %3d%%. 00006fde : 6fde: 20 53 44 00 SD. 00006fe2 : 6fe2: 20 20 20 00 . 00006fe6 : 6fe6: 20 48 4f 00 HO. 00006fea : 6fea: 87 2d 2d 3a 2d 2d 20 20 00 .--:-- . 00006ff3 : 6ff3: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006ffe : 6ffe: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 0000700d : 700d: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 0000701d : 701d: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 0000702c <_ZZL16lcd_support_menuvE3__c__17_>: 702c: 44 75 6d 70 20 6d 65 6d 6f 72 79 00 Dump memory. 00007038 : 7038: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00007049 : 7049: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 7059: 6d 00 m. 0000705b : 705b: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00007067 : 7067: 4d 37 30 31 00 M701. 0000706c : 706c: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 707c: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 708c: 32 64 6d 00 2dm. 00007090 : 7090: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 70a0: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 70b0: 32 64 73 00 2ds. 000070b4 : 70b4: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 000070bc : 70bc: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 000070ca : 70ca: 25 33 2e 32 66 81 00 %3.2f.. 000070d1 : 70d1: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 70e1: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 70f1: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 000070fe : 70fe: 20 20 30 00 0. 00007102 : 7102: 20 20 31 00 1. 00007106 : 7106: 46 49 4e 44 41 00 FINDA. 0000710c : 710c: 50 49 4e 44 41 00 PINDA. 00007112 : 7112: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 7122: 3a 20 25 64 0a 00 : %d.. 00007128 : 7128: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 00007132 : 7132: 46 69 72 6d 77 61 72 65 00 Firmware. 0000713b : 713b: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00007148 : 7148: 46 6c 61 73 68 41 69 72 00 FlashAir. 00007151 : 7151: 50 72 75 73 61 20 69 33 20 4d 4b 33 53 20 4f 4b Prusa i3 MK3S OK 7161: 2e 00 .. 00007163 : 7163: 4d 36 30 30 00 M600. 00007168 : 7168: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 00007173 : 7173: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 00007183 : 7183: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 7193: 65 64 00 ed. 00007196 : 7196: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 000071a3 : 71a3: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 71b3: 65 3a 20 00 e: . 000071b7 : 71b7: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 71c7: 64 69 72 3a 20 00 dir: . 000071cd : 71cd: 4d 32 34 00 M24. 000071d1 : 71d1: 4d 32 33 20 25 73 00 M23 %s. 000071d8 : 71d8: 31 2f 39 00 1/9. 000071dc : 71dc: 88 00 .. 000071de : 71de: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 71ee: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 000071fc : 71fc: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 720c: 70 72 65 76 65 6e 74 65 64 00 prevented. 00007216 : 7216: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 00007223 : 7223: 50 4f 57 45 52 20 50 41 4e 49 43 20 44 45 54 45 POWER PANIC DETE 7233: 43 54 45 44 00 CTED. 00007238 : 7238: 55 56 4c 4f 20 2d 20 65 6e 64 20 25 64 0a 00 UVLO - end %d.. 00007247 : 7247: 55 56 4c 4f 5f 54 49 4e 59 20 2d 20 65 6e 64 20 UVLO_TINY - end 7257: 25 64 0a 00 %d.. 0000725b : 725b: 77 6f 72 6c 64 20 63 6f 6f 72 64 69 6e 61 74 65 world coordinate 726b: 73 3a 20 28 25 2e 33 66 2c 20 25 2e 33 66 2c 20 s: (%.3f, %.3f, 727b: 25 2e 33 66 29 0a 00 %.3f).. 00007282 : 7282: 4d 32 32 30 20 53 25 64 00 M220 S%d. 0000728b : 728b: 44 6f 6e 65 20 72 65 61 64 69 6e 67 20 45 45 50 Done reading EEP 729b: 52 4f 4d 0a 00 ROM.. 000072a0 : 72a0: 54 65 6d 70 65 72 61 74 75 72 65 20 52 65 73 74 Temperature Rest 72b0: 6f 72 65 64 0a 00 ored.. 000072b6 : 72b6: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 000072c6 <__noloc_end>: 72c6: 08 4a sbci r16, 0xA8 ; 168 72c8: d7 3b cpi r29, 0xB7 ; 183 72ca: 3b ce rjmp .-906 ; 0x6f42 72cc: 01 6e ori r16, 0xE1 ; 225 72ce: 84 bc out 0x24, r8 ; 36 72d0: bf fd .word 0xfdbf ; ???? 72d2: c1 2f mov r28, r17 72d4: 3d 6c ori r19, 0xCD ; 205 72d6: 74 31 cpi r23, 0x14 ; 20 72d8: 9a bd out 0x2a, r25 ; 42 72da: 56 83 std Z+6, r21 ; 0x06 72dc: 3d da rcall .-2950 ; 0x6758 <__c.2355+0x2> 72de: 3d 00 .word 0x003d ; ???? 72e0: c7 7f andi r28, 0xF7 ; 247 72e2: 11 be out 0x31, r1 ; 49 72e4: d9 e4 ldi r29, 0x49 ; 73 72e6: bb 4c sbci r27, 0xCB ; 203 72e8: 3e 91 ld r19, -X 72ea: 6b aa std Y+51, r6 ; 0x33 72ec: aa be out 0x3a, r10 ; 58 72ee: 00 00 nop 72f0: 00 80 ld r0, Z 72f2: 3f 05 cpc r19, r15 72f4: a8 4c sbci r26, 0xC8 ; 200 72f6: cd b2 in r12, 0x1d ; 29 72f8: d4 4e sbci r29, 0xE4 ; 228 72fa: b9 38 cpi r27, 0x89 ; 137 72fc: 36 a9 ldd r19, Z+54 ; 0x36 72fe: 02 0c add r0, r2 7300: 50 b9 out 0x00, r21 ; 0 7302: 91 86 std Z+9, r9 ; 0x09 7304: 88 08 sbc r8, r8 7306: 3c a6 std Y+44, r3 ; 0x2c 7308: aa aa std Y+50, r10 ; 0x32 730a: 2a be out 0x3a, r2 ; 58 730c: 00 00 nop 730e: 00 80 ld r0, Z 7310: 3f 07 cpc r19, r31 7312: 63 42 sbci r22, 0x23 ; 35 7314: 36 b7 in r19, 0x36 ; 54 7316: 9b d8 rcall .-3786 ; 0x644e 7318: a7 1a sub r10, r23 731a: 39 68 ori r19, 0x89 ; 137 731c: 56 18 sub r5, r6 731e: ae ba out 0x1e, r10 ; 30 7320: ab 55 subi r26, 0x5B ; 91 7322: 8c 1d adc r24, r12 7324: 3c b7 in r19, 0x3c ; 60 7326: cc 57 subi r28, 0x7C ; 124 7328: 63 bd out 0x23, r22 ; 35 732a: 6d ed ldi r22, 0xDD ; 221 732c: fd 75 andi r31, 0x5D ; 93 732e: 3e f6 brtc .-114 ; 0x72be 7330: 17 72 andi r17, 0x27 ; 39 7332: 31 bf out 0x31, r19 ; 49 7334: 00 00 nop 7336: 00 80 ld r0, Z 7338: 3f 08 sbc r3, r15 733a: 00 00 nop 733c: 00 be out 0x30, r0 ; 48 733e: 92 24 eor r9, r2 7340: 49 12 cpse r4, r25 7342: 3e ab std Y+54, r19 ; 0x36 7344: aa aa std Y+50, r10 ; 0x32 7346: 2a be out 0x3a, r2 ; 58 7348: cd cc rjmp .-1638 ; 0x6ce4 734a: cc 4c sbci r28, 0xCC ; 204 734c: 3e 00 .word 0x003e ; ???? 734e: 00 00 nop 7350: 80 be out 0x30, r8 ; 48 7352: ab aa std Y+51, r10 ; 0x33 7354: aa aa std Y+50, r10 ; 0x32 7356: 3e 00 .word 0x003e ; ???? 7358: 00 00 nop 735a: 00 bf out 0x30, r16 ; 48 735c: 00 00 nop 735e: 00 80 ld r0, Z 7360: 3f 00 .word 0x003f ; ???? 7362: 00 00 nop 7364: 00 00 nop 7366: 08 41 sbci r16, 0x18 ; 24 7368: 78 d3 rcall .+1776 ; 0x7a5a 736a: bb 43 sbci r27, 0x3B ; 59 736c: 87 d1 rcall .+782 ; 0x767c <__trampolines_start+0x2e8> 736e: 13 3d cpi r17, 0xD3 ; 211 7370: 19 0e add r1, r25 7372: 3c c3 rjmp .+1656 ; 0x79ec 7374: bd 42 sbci r27, 0x2D ; 45 7376: 82 ad ldd r24, Z+58 ; 0x3a 7378: 2b 3e cpi r18, 0xEB ; 235 737a: 68 ec ldi r22, 0xC8 ; 200 737c: 82 76 andi r24, 0x62 ; 98 737e: be d9 rcall .-3204 ; 0x66fc 7380: 8f e1 ldi r24, 0x1F ; 31 7382: a9 3e cpi r26, 0xE9 ; 233 7384: 4c 80 ldd r4, Y+4 ; 0x04 7386: ef ff .word 0xffef ; ???? 7388: be 01 movw r22, r28 738a: c4 ff sbrs r28, 4 738c: 7f 3f cpi r23, 0xFF ; 255 738e: 00 00 nop 7390: 00 00 nop ... 00007394 <__trampolines_start>: 7394: 0c 94 e3 ce jmp 0x19dc6 ; 0x19dc6 7398: 0d 94 95 40 jmp 0x2812a ; 0x2812a 739c: 0d 94 ee 2b jmp 0x257dc ; 0x257dc 73a0: 0d 94 dd 67 jmp 0x2cfba ; 0x2cfba 73a4: 0d 94 e3 68 jmp 0x2d1c6 ; 0x2d1c6 73a8: 0d 94 24 0f jmp 0x21e48 ; 0x21e48 73ac: 0d 94 f0 65 jmp 0x2cbe0 ; 0x2cbe0 73b0: 0d 94 df 53 jmp 0x2a7be ; 0x2a7be 73b4: 0d 94 ba 06 jmp 0x20d74 ; 0x20d74 73b8: 0d 94 8c 24 jmp 0x24918 ; 0x24918 73bc: 0d 94 61 3e jmp 0x27cc2 ; 0x27cc2 73c0: 0c 94 25 d8 jmp 0x1b04a ; 0x1b04a 73c4: 0c 94 db ce jmp 0x19db6 ; 0x19db6 73c8: 0d 94 74 26 jmp 0x24ce8 ; 0x24ce8 73cc: 0d 94 fc 09 jmp 0x213f8 ; 0x213f8 73d0: 0c 94 ea ce jmp 0x19dd4 ; 0x19dd4 73d4: 0d 94 f4 0f jmp 0x21fe8 ; 0x21fe8 73d8: 0c 94 2b d8 jmp 0x1b056 ; 0x1b056 73dc: 0c 94 d0 75 jmp 0xeba0 ; 0xeba0 <__vector_23+0xd0> 73e0: 0d 94 33 2c jmp 0x25866 ; 0x25866 73e4: 0c 94 45 df jmp 0x1be8a ; 0x1be8a 73e8: 0d 94 e7 65 jmp 0x2cbce ; 0x2cbce 73ec: 0d 94 40 14 jmp 0x22880 ; 0x22880 73f0: 0c 94 52 d3 jmp 0x1a6a4 ; 0x1a6a4 () [clone .lto_priv.447]> 73f4: 0d 94 66 23 jmp 0x246cc ; 0x246cc 73f8: 0d 94 d9 10 jmp 0x221b2 ; 0x221b2 73fc: 0d 94 b7 06 jmp 0x20d6e ; 0x20d6e 7400: 0d 94 c0 06 jmp 0x20d80 ; 0x20d80 7404: 0c 94 0d df jmp 0x1be1a ; 0x1be1a 7408: 0d 94 9e 9f jmp 0x33f3c ; 0x33f3c 740c: 0c 94 a3 d6 jmp 0x1ad46 ; 0x1ad46 7410: 0c 94 21 df jmp 0x1be42 ; 0x1be42 7414: 0d 94 05 67 jmp 0x2ce0a ; 0x2ce0a 7418: 0c 94 fe d3 jmp 0x1a7fc ; 0x1a7fc 741c: 0d 94 39 40 jmp 0x28072 ; 0x28072 7420: 0c 94 d9 75 jmp 0xebb2 ; 0xebb2 <__vector_23+0xe2> 7424: 0d 94 5a 68 jmp 0x2d0b4 ; 0x2d0b4 7428: 0d 94 17 23 jmp 0x2462e ; 0x2462e 742c: 0d 94 d3 68 jmp 0x2d1a6 ; 0x2d1a6 7430: 0d 94 3f 2e jmp 0x25c7e ; 0x25c7e 7434: 0c 94 22 cf jmp 0x19e44 ; 0x19e44 7438: 0d 94 c8 2d jmp 0x25b90 ; 0x25b90 743c: 0c 94 f4 e3 jmp 0x1c7e8 ; 0x1c7e8 7440: 0c 94 3e d3 jmp 0x1a67c ; 0x1a67c () [clone .lto_priv.451]> 7444: 0c 94 f1 d5 jmp 0x1abe2 ; 0x1abe2 7448: 0c 94 d9 d1 jmp 0x1a3b2 ; 0x1a3b2 744c: 0d 94 f7 25 jmp 0x24bee ; 0x24bee 7450: 0c 94 4f df jmp 0x1be9e ; 0x1be9e 7454: 0d 94 cf 65 jmp 0x2cb9e ; 0x2cb9e 7458: 0d 94 a4 65 jmp 0x2cb48 ; 0x2cb48 745c: 0d 94 eb 68 jmp 0x2d1d6 ; 0x2d1d6 7460: 0d 94 01 26 jmp 0x24c02 ; 0x24c02 7464: 0d 94 d5 1b jmp 0x237aa ; 0x237aa 7468: 0d 94 c7 27 jmp 0x24f8e ; 0x24f8e 746c: 0d 94 d2 64 jmp 0x2c9a4 ; 0x2c9a4 7470: 0d 94 98 65 jmp 0x2cb30 ; 0x2cb30 7474: 0d 94 42 06 jmp 0x20c84 ; 0x20c84 7478: 0d 94 10 2a jmp 0x25420 ; 0x25420 747c: 0d 94 58 0c jmp 0x218b0 ; 0x218b0 7480: 0d 94 24 68 jmp 0x2d048 ; 0x2d048 7484: 0c 94 fc 75 jmp 0xebf8 ; 0xebf8 <__vector_23+0x128> 7488: 0c 94 90 df jmp 0x1bf20 ; 0x1bf20 748c: 0d 94 8b 32 jmp 0x26516 ; 0x26516 7490: 0d 94 9e 99 jmp 0x3333c ; 0x3333c 7494: 0d 94 cc 06 jmp 0x20d98 ; 0x20d98 7498: 0d 94 14 26 jmp 0x24c28 ; 0x24c28 749c: 0c 94 ce d6 jmp 0x1ad9c ; 0x1ad9c 74a0: 0d 94 e7 06 jmp 0x20dce ; 0x20dce 74a4: 0c 94 b2 ce jmp 0x19d64 ; 0x19d64 74a8: 0d 94 82 24 jmp 0x24904 ; 0x24904 74ac: 0d 94 22 65 jmp 0x2ca44 ; 0x2ca44 74b0: 0d 94 5e 22 jmp 0x244bc ; 0x244bc 74b4: 0c 94 02 cf jmp 0x19e04 ; 0x19e04 74b8: 0d 94 20 0f jmp 0x21e40 ; 0x21e40 74bc: 0c 94 ba 75 jmp 0xeb74 ; 0xeb74 <__vector_23+0xa4> 74c0: 0d 94 a1 3b jmp 0x27742 ; 0x27742 74c4: 0d 94 be 6d jmp 0x2db7c ; 0x2db7c 74c8: 0c 94 ac 75 jmp 0xeb58 ; 0xeb58 <__vector_23+0x88> 74cc: 0c 94 68 df jmp 0x1bed0 ; 0x1bed0 74d0: 0d 94 be 26 jmp 0x24d7c ; 0x24d7c 74d4: 0d 94 1a 68 jmp 0x2d034 ; 0x2d034 74d8: 0d 94 d1 2d jmp 0x25ba2 ; 0x25ba2 74dc: 0d 94 1a 0f jmp 0x21e34 ; 0x21e34 74e0: 0d 94 1d 68 jmp 0x2d03a ; 0x2d03a 74e4: 0c 94 dc d8 jmp 0x1b1b8 ; 0x1b1b8 74e8: 0c 94 08 df jmp 0x1be10 ; 0x1be10 74ec: 0d 94 20 0e jmp 0x21c40 ; 0x21c40 74f0: 0d 94 04 29 jmp 0x25208 ; 0x25208 74f4: 0d 94 2e 26 jmp 0x24c5c ; 0x24c5c 74f8: 0d 94 66 26 jmp 0x24ccc ; 0x24ccc 74fc: 0c 94 f4 ce jmp 0x19de8 ; 0x19de8 7500: 0c 94 30 d2 jmp 0x1a460 ; 0x1a460 7504: 0d 94 d5 65 jmp 0x2cbaa ; 0x2cbaa 7508: 0c 94 72 df jmp 0x1bee4 ; 0x1bee4 750c: 0d 94 ba 68 jmp 0x2d174 ; 0x2d174 7510: 0d 94 aa 23 jmp 0x24754 ; 0x24754 7514: 0c 94 be cf jmp 0x19f7c ; 0x19f7c 7518: 0c 94 bd d8 jmp 0x1b17a ; 0x1b17a 751c: 0c 94 ce d1 jmp 0x1a39c ; 0x1a39c 7520: 0d 94 c0 68 jmp 0x2d180 ; 0x2d180 7524: 0c 94 65 d3 jmp 0x1a6ca ; 0x1a6ca 7528: 0c 94 57 d3 jmp 0x1a6ae ; 0x1a6ae () [clone .lto_priv.446]> 752c: 0d 94 86 68 jmp 0x2d10c ; 0x2d10c 7530: 0c 94 48 d3 jmp 0x1a690 ; 0x1a690 () [clone .lto_priv.449]> 7534: 0d 94 f4 13 jmp 0x227e8 ; 0x227e8 7538: 0d 94 2c 0f jmp 0x21e58 ; 0x21e58 753c: 0c 94 86 df jmp 0x1bf0c ; 0x1bf0c 7540: 0d 94 bd 06 jmp 0x20d7a ; 0x20d7a 7544: 0d 94 1c 0e jmp 0x21c38 ; 0x21c38 7548: 0d 94 be 23 jmp 0x2477c ; 0x2477c 754c: 0d 94 db 06 jmp 0x20db6 ; 0x20db6 7550: 0c 94 ad d8 jmp 0x1b15a ; 0x1b15a 7554: 0c 94 43 d3 jmp 0x1a686 ; 0x1a686 () [clone .lto_priv.450]> 7558: 0c 94 00 df jmp 0x1be00 ; 0x1be00 755c: 0c 94 b8 cf jmp 0x19f70 ; 0x19f70 7560: 0c 94 4d d3 jmp 0x1a69a ; 0x1a69a () [clone .lto_priv.448]> 7564: 0d 94 77 22 jmp 0x244ee ; 0x244ee 7568: 0d 94 5f 26 jmp 0x24cbe ; 0x24cbe 756c: 0c 94 47 d7 jmp 0x1ae8e ; 0x1ae8e 7570: 0d 94 bc 21 jmp 0x24378 ; 0x24378 7574: 0c 94 10 cf jmp 0x19e20 ; 0x19e20 7578: 0d 94 9a 9f jmp 0x33f34 ; 0x33f34 757c: 0d 94 7e d1 jmp 0x3a2fc ; 0x3a2fc 7580: 0d 94 2f 05 jmp 0x20a5e ; 0x20a5e 7584: 0d 94 ab 06 jmp 0x20d56 ; 0x20d56 7588: 0d 94 1a 2f jmp 0x25e34 ; 0x25e34 758c: 0c 94 1e d4 jmp 0x1a83c ; 0x1a83c 7590: 0d 94 cb 68 jmp 0x2d196 ; 0x2d196 7594: 0c 94 15 cf jmp 0x19e2a ; 0x19e2a 7598: 0d 94 8f 3c jmp 0x2791e ; 0x2791e 759c: 0d 94 d2 6d jmp 0x2dba4 ; 0x2dba4 75a0: 0d 94 bd 25 jmp 0x24b7a ; 0x24b7a 75a4: 0d 94 66 06 jmp 0x20ccc ; 0x20ccc 75a8: 0d 94 6e 36 jmp 0x26cdc ; 0x26cdc 75ac: 0c 94 7c df jmp 0x1bef8 ; 0x1bef8 75b0: 0d 94 c8 40 jmp 0x28190 ; 0x28190 75b4: 0d 94 46 1d jmp 0x23a8c ; 0x23a8c 75b8: 0d 94 58 26 jmp 0x24cb0 ; 0x24cb0 75bc: 0d 94 a5 0e jmp 0x21d4a ; 0x21d4a 75c0: 0d 94 ac 25 jmp 0x24b58 ; 0x24b58 75c4: 0c 94 57 d7 jmp 0x1aeae ; 0x1aeae 75c8: 0d 94 a0 25 jmp 0x24b40 ; 0x24b40 75cc: 0d 94 1b 26 jmp 0x24c36 ; 0x24c36 75d0: 0d 94 52 0c jmp 0x218a4 ; 0x218a4 75d4: 0d 94 39 99 jmp 0x33272 ; 0x33272 75d8: 0c 94 e8 d7 jmp 0x1afd0 ; 0x1afd0 75dc: 0c 94 1a cf jmp 0x19e34 ; 0x19e34 75e0: 0d 94 c0 3d jmp 0x27b80 ; 0x27b80 75e4: 0d 94 28 22 jmp 0x24450 ; 0x24450 75e8: 0d 94 d2 23 jmp 0x247a4 ; 0x247a4 75ec: 0d 94 42 0f jmp 0x21e84 ; 0x21e84 75f0: 0c 94 61 d3 jmp 0x1a6c2 ; 0x1a6c2 () [clone .lto_priv.444]> 75f4: 0c 94 5c d3 jmp 0x1a6b8 ; 0x1a6b8 () [clone .lto_priv.445]> 75f8: 0d 94 14 23 jmp 0x24628 ; 0x24628 75fc: 0d 94 04 66 jmp 0x2cc08 ; 0x2cc08 7600: 0c 94 79 5d jmp 0xbaf2 ; 0xbaf2 7604: 0d 94 52 2b jmp 0x256a4 ; 0x256a4 7608: 0d 94 bd 24 jmp 0x2497a ; 0x2497a 760c: 0c 94 fa ce jmp 0x19df4 ; 0x19df4 7610: 0d 94 c6 0a jmp 0x2158c ; 0x2158c 7614: 0c 94 1e cf jmp 0x19e3c ; 0x19e3c 7618: 0d 94 fb 68 jmp 0x2d1f6 ; 0x2d1f6 761c: 0c 94 87 75 jmp 0xeb0e ; 0xeb0e <__vector_23+0x3e> 7620: 0d 94 2f 6e jmp 0x2dc5e ; 0x2dc5e 7624: 0d 94 af 66 jmp 0x2cd5e ; 0x2cd5e 7628: 0d 94 75 27 jmp 0x24eea ; 0x24eea 762c: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 7630: 0d 94 8c 68 jmp 0x2d118 ; 0x2d118 7634: 0d 94 f3 68 jmp 0x2d1e6 ; 0x2d1e6 7638: 0c 94 b5 d8 jmp 0x1b16a ; 0x1b16a 763c: 0d 94 7b 9f jmp 0x33ef6 ; 0x33ef6 7640: 0d 94 35 9f jmp 0x33e6a ; 0x33e6a 7644: 0d 94 77 cf jmp 0x39eee ; 0x39eee <_menu_edit_P()> 7648: 0d 94 97 9f jmp 0x33f2e ; 0x33f2e 764c: 0c 94 15 e6 jmp 0x1cc2a ; 0x1cc2a 7650: 0c 94 d5 ce jmp 0x19daa ; 0x19daa 7654: 0d 94 e5 3a jmp 0x275ca ; 0x275ca 7658: 0c 94 33 df jmp 0x1be66 ; 0x1be66 765c: 0d 94 6d 26 jmp 0x24cda ; 0x24cda 7660: 0d 94 e1 2b jmp 0x257c2 ; 0x257c2 7664: 0d 94 28 28 jmp 0x25050 ; 0x25050 7668: 0c 94 99 d6 jmp 0x1ad32 ; 0x1ad32 766c: 0c 94 c5 d8 jmp 0x1b18a ; 0x1b18a 7670: 0d 94 d4 24 jmp 0x249a8 ; 0x249a8 7674: 0d 94 5e 65 jmp 0x2cabc ; 0x2cabc 7678: 0d 94 e9 2b jmp 0x257d2 ; 0x257d2 767c: 0d 94 4c 40 jmp 0x28098 ; 0x28098 7680: 0d 94 b4 23 jmp 0x24768 ; 0x24768 7684: 0d 94 7b 99 jmp 0x332f6 ; 0x332f6 7688: 0c 94 c2 d1 jmp 0x1a384 ; 0x1a384 768c: 0d 94 0b 69 jmp 0x2d216 ; 0x2d216 7690: 0c 94 2b df jmp 0x1be56 ; 0x1be56 7694: 0c 94 f0 ce jmp 0x19de0 ; 0x19de0 7698: 0c 94 bb 65 jmp 0xcb76 ; 0xcb76 <_GLOBAL__sub_D_card> 769c: 0d 94 cb 73 jmp 0x2e796 ; 0x2e796 76a0: 0d 94 4e 06 jmp 0x20c9c ; 0x20c9c 76a4: 0c 94 17 df jmp 0x1be2e ; 0x1be2e 76a8: 0d 94 20 99 jmp 0x33240 ; 0x33240 76ac: 0d 94 e3 30 jmp 0x261c6 ; 0x261c6 76b0: 0c 94 22 d8 jmp 0x1b044 ; 0x1b044 76b4: 0d 94 34 15 jmp 0x22a68 ; 0x22a68 76b8: 0d 94 53 66 jmp 0x2cca6 ; 0x2cca6 76bc: 0d 94 36 44 jmp 0x2886c ; 0x2886c 76c0: 0c 94 b3 cf jmp 0x19f66 ; 0x19f66 76c4: 0d 94 be 65 jmp 0x2cb7c ; 0x2cb7c 76c8: 0d 94 28 0f jmp 0x21e50 ; 0x21e50 76cc: 0c 94 27 d2 jmp 0x1a44e ; 0x1a44e 76d0: 0d 94 13 69 jmp 0x2d226 ; 0x2d226 76d4: 0d 94 51 58 jmp 0x2b0a2 ; 0x2b0a2 76d8: 0c 94 7f 78 jmp 0xf0fe ; 0xf0fe 76dc: 0c 94 6d d2 jmp 0x1a4da ; 0x1a4da 76e0: 0c 94 fe ce jmp 0x19dfc ; 0x19dfc 76e4: 0d 94 b5 0d jmp 0x21b6a ; 0x21b6a 76e8: 0c 94 59 df jmp 0x1beb2 ; 0x1beb2 76ec: 0c 94 16 cf jmp 0x19e2c ; 0x19e2c 76f0: 0d 94 e0 13 jmp 0x227c0 ; 0x227c0 76f4: 0c 94 28 d8 jmp 0x1b050 ; 0x1b050 76f8: 0d 94 9d 28 jmp 0x2513a ; 0x2513a 76fc: 0c 94 9a df jmp 0x1bf34 ; 0x1bf34 7700: 0d 94 a7 9f jmp 0x33f4e ; 0x33f4e 7704: 0c 94 37 d8 jmp 0x1b06e ; 0x1b06e 7708: 0d 94 04 27 jmp 0x24e08 ; 0x24e08 770c: 0d 94 fa 21 jmp 0x243f4 ; 0x243f4 7710: 0c 94 3b df jmp 0x1be76 ; 0x1be76 7714: 0d 94 03 69 jmp 0x2d206 ; 0x2d206 7718: 0c 94 d1 d8 jmp 0x1b1a2 ; 0x1b1a2 771c: 0c 94 e7 ce jmp 0x19dce ; 0x19dce 7720: 0d 94 48 65 jmp 0x2ca90 ; 0x2ca90 7724: 0d 94 9b 99 jmp 0x33336 ; 0x33336 7728: 0d 94 b2 24 jmp 0x24964 ; 0x24964 772c: 0d 94 d9 40 jmp 0x281b2 ; 0x281b2 7730: 0d 94 c1 35 jmp 0x26b82 ; 0x26b82 7734: 0d 94 de 23 jmp 0x247bc ; 0x247bc 7738: 0c 94 0c cf jmp 0x19e18 ; 0x19e18 773c: 0d 94 da 2d jmp 0x25bb4 ; 0x25bb4 7740: 0d 94 a0 24 jmp 0x24940 ; 0x24940 7744: 0d 94 92 2e jmp 0x25d24 ; 0x25d24 7748: 0c 94 67 79 jmp 0xf2ce ; 0xf2ce 774c: 0d 94 98 99 jmp 0x33330 ; 0x33330 7750: 0d 94 d8 06 jmp 0x20db0 ; 0x20db0 7754: 0c 94 2e d8 jmp 0x1b05c ; 0x1b05c 7758: 0c 94 eb d8 jmp 0x1b1d6 ; 0x1b1d6 775c: 0d 94 bd 68 jmp 0x2d17a ; 0x2d17a 7760: 0d 94 27 68 jmp 0x2d04e ; 0x2d04e 7764: 0d 94 bf 54 jmp 0x2a97e ; 0x2a97e 7768: 0d 94 d3 1b jmp 0x237a6 ; 0x237a6 776c: 0c 94 0e 76 jmp 0xec1c ; 0xec1c <__vector_23+0x14c> 7770: 0d 94 62 22 jmp 0x244c4 ; 0x244c4 7774: 0c 94 a1 75 jmp 0xeb42 ; 0xeb42 <__vector_23+0x72> 7778: 0d 94 74 1c jmp 0x238e8 ; 0x238e8 777c: 0d 94 c9 25 jmp 0x24b92 ; 0x24b92 7780: 0d 94 53 29 jmp 0x252a6 ; 0x252a6 7784: 0d 94 c3 68 jmp 0x2d186 ; 0x2d186 7788: 0c 94 08 cf jmp 0x19e10 ; 0x19e10 778c: 0c 94 a0 d1 jmp 0x1a340 ; 0x1a340 7790: 0d 94 96 24 jmp 0x2492c ; 0x2492c 7794: 0d 94 f5 67 jmp 0x2cfea ; 0x2cfea 7798: 0d 94 f5 40 jmp 0x281ea ; 0x281ea 779c: 0d 94 7a 05 jmp 0x20af4 ; 0x20af4 77a0: 0d 94 c8 23 jmp 0x24790 ; 0x24790 77a4: 0d 94 54 65 jmp 0x2caa8 ; 0x2caa8 77a8: 0d 94 89 68 jmp 0x2d112 ; 0x2d112 77ac: 0d 94 ea 1b jmp 0x237d4 ; 0x237d4 77b0: 0c 94 94 d1 jmp 0x1a328 ; 0x1a328 77b4: 0d 94 ac 9f jmp 0x33f58 ; 0x33f58 77b8: 0c 94 df ce jmp 0x19dbe ; 0x19dbe 77bc: 0d 94 e7 24 jmp 0x249ce ; 0x249ce 77c0: 0d 94 5e 1d jmp 0x23abc ; 0x23abc 77c4: 0c 94 39 72 jmp 0xe472 ; 0xe472 77c8: 0c 94 1f d8 jmp 0x1b03e ; 0x1b03e 77cc: 0d 94 db 68 jmp 0x2d1b6 ; 0x2d1b6 77d0: 0d 94 d9 65 jmp 0x2cbb2 ; 0x2cbb2 77d4: 0c 94 b3 d1 jmp 0x1a366 ; 0x1a366 000077d8 <__trampolines_end>: 77d8: 6e 61 ori r22, 0x1E ; 30 77da: 6e 00 .word 0x006e ; ???? 000077dc <__c.2228>: 77dc: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 77ec: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 77fc: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 780c: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 781c: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 782c: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 783c: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 784c: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 785c: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 786c: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 787c: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 788c: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 789c: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 78ac: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 78bc: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 78cc: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 000078da : 78da: 22 00 ". 000078dc : ... 000078dd : 78dd: 20 45 53 50 00 ESP. 000078e2 : 78e2: 20 4e 53 50 00 NSP. 000078e7 : 78e7: 20 4f 46 46 00 OFF. 000078ec : 78ec: 20 4f 4e 00 ON. 000078f0 : 78f0: 50 56 30 31 00 PV01. 000078f5 : 78f5: 20 5b 4d 50 5d 20 00 [MP] . 000078fc : 78fc: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 790c: 74 65 73 00 tes. 00007910 : 7910: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 0000791b : 791b: 4d 33 31 30 00 M310. 00007920 : 7920: 4d 31 31 32 00 M112. 00007925 : 7925: 4d 31 31 30 00 M110. 0000792a : 792a: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 00007939 : 7939: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 00007949 : 7949: 54 4d 3a 20 73 74 6f 72 65 64 20 63 61 6c 69 62 TM: stored calib 7959: 72 61 74 69 6f 6e 20 69 6e 76 61 6c 69 64 2c 20 ration invalid, 7969: 72 65 73 65 74 74 69 6e 67 00 resetting. 00007973 : 7973: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 7983: 72 65 74 72 69 65 76 65 64 00 retrieved. 0000798d : 798d: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 799d: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 79ad: 64 00 d. 000079af : 79af: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 79bf: 00 00 8c 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 79cf: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 79df: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 79ef: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 79ff: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 7a0f: 00 00 00 00 cd cc cc 3e 3d 0a 81 41 ff 08 43 3e .......>=..A..C> 7a1f: b0 99 ab 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ...C.B.B.Z4?Lb.E 7a2f: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 7a3f: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 c8 42 ......A....?...B 7a4f: 00 00 c8 42 00 00 40 41 00 00 f0 42 c0 03 00 00 ...B..@A...B.... 7a5f: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 20 ............... 7a6f: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 00007a80 : 7a80: 43 75 73 74 6f 6d 00 Custom. 00007a87 : 7a87: 4e 79 6c 6f 6e 50 41 00 NylonPA. 00007a8f : 7a8f: 53 61 74 69 6e 20 20 00 Satin . 00007a97 : 7a97: 54 65 78 74 75 72 00 Textur. 00007a9e : 7a9e: 53 6d 6f 6f 74 68 00 Smooth. 00007aa5 : 7aa5: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 7ab5: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 7ac5: 78 70 65 63 74 65 64 00 xpected. 00007acd : 7acd: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 7add: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 7aed: 70 65 63 74 65 64 00 pected. 00007af4 : 7af4: 31 2e 30 00 1.0. 00007af8 : 7af8: 31 2e 35 00 1.5. 00007afc : 7afc: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 00007b04 : 7b04: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 7b14: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 00007b21 : 7b21: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 7b31: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 00007b3a <_PRI_LANG_SIGNATURE>: 7b3a: ff ff ff ff .... 00007b3e : 7b3e: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7b4e: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7b5e: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7b6e: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7b7e: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7b8e: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7b9e: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7bae: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7bbe: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7bce: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 7bde: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7bee: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7bfe: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7c0e: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7c1e: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7c2e: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7c3e: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7c4e: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7c5e: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7c6e: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7c7e: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7c8e: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7c9e: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7cae: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7cbe: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7cfa: 00 40 14 54 .@.T 00007cfe : 7cfe: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7d0e: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007d16 : 7d16: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7d26: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007d2e : 7d2e: 4e 41 4e NAN 00007d31 : 7d31: 49 4e 46 INF 00007d34 : 7d34: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7d44: 20 69 6e 70 75 74 00 input. 00007d4b : 7d4b: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7d5b: 20 75 73 65 72 00 user. 00007d61 : 7d61: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007d72 : 7d72: 00 00 7f 43 00 80 54 43 00 00 52 43 ...C..TC..RC 00007d7e : 7d7e: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007d8a : 7d8a: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007d96 : 7d96: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00007da2 : 7da2: 25 33 64 20 73 74 65 70 3d 25 32 64 20 6d 73 63 %3d step=%2d msc 7db2: 6e 74 3d 25 34 64 0a 00 nt=%4d.. 00007dba : 7dba: 00 00 7f 43 00 80 58 43 9a d9 51 43 ...C..XC..QC 00007dc6 : 7dc6: ff ff ff ... 00007dc9 : 7dc9: 20 41 3a 00 A:. 00007dcd : 7dcd: 20 50 3a 00 P:. 00007dd1 : 7dd1: 20 42 40 3a 00 B@:. 00007dd6 : 7dd6: 20 40 3a 00 @:. 00007dda : 7dda: 20 2f 00 /. 00007ddd : 7ddd: 20 54 30 3a 00 T0:. 00007de2 : 7de2: 20 2f 00 /. 00007de5 : 7de5: 20 42 3a 00 B:. 00007de9 : 7de9: 20 2f 00 /. 00007dec : 7dec: 54 3a 00 T:. 00007def : 7def: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7dff: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7e0f: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007e20 : 7e20: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7e30: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7e40: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 7e50: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007e59 : 7e59: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7e69: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7e79: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007e88 : 7e88: 20 20 00 . 00007e8b : 7e8b: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007e9c : 7e9c: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7eac: 20 35 2e 30 66 00 5.0f. 00007eb2 : 7eb2: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007ebf : 7ebf: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7ecf: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007edd : 7edd: 20 45 3a 00 E:. 00007ee1 : 7ee1: 20 5a 3a 00 Z:. 00007ee5 : 7ee5: 20 59 3a 00 Y:. 00007ee9 : 7ee9: 20 45 3a 00 E:. 00007eed : 7eed: 20 5a 3a 00 Z:. 00007ef1 : 7ef1: 20 59 3a 00 Y:. 00007ef5 : 7ef5: 58 3a 00 X:. 00007ef8 : 7ef8: 20 2d 3e 20 00 -> . 00007efd : 7efd: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007f09 : 7f09: 2c 20 00 , . 00007f0c : 7f0c: 66 73 65 6e 73 6f 72 20 76 30 2e 34 20 69 6e 20 fsensor v0.4 in 7f1c: 66 61 75 6c 74 20 72 61 6e 67 65 20 34 2e 36 2d fault range 4.6- 7f2c: 35 56 20 2d 20 75 6e 63 6f 6e 6e 65 63 74 65 64 5V - unconnected ... 00007f3d : 7f3d: 66 73 65 6e 73 6f 72 20 69 6e 20 66 6f 72 62 69 fsensor in forbi 7f4d: 64 64 65 6e 20 72 61 6e 67 65 20 31 2e 35 2d 33 dden range 1.5-3 7f5d: 56 20 2d 20 63 68 65 63 6b 20 73 65 6e 73 6f 72 V - check sensor ... 00007f6e : 7f6e: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7f7e: 6f 77 6e 00 own. 00007f82 : 7f82: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007f8a : 7f8a: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7f9a: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007fa9 : 7fa9: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7fb9: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7fc9: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7fd9: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007fe6 : 7fe6: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7ff6: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 8006: 69 6e 67 20 74 6f 20 30 00 ing to 0. 0000800f : 800f: 20 45 3a 30 20 42 3a 00 E:0 B:. 00008017 : 8017: 54 3a 00 T:. 0000801a : 801a: 47 31 20 5a 25 2d 2e 33 66 20 46 25 2d 2e 33 66 G1 Z%-.3f F%-.3f ... 0000802b : 802b: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 0000803b : 803b: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 804b: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00008055 : 8055: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00008060 : 8060: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 8070: 20 72 61 6e 67 65 21 00 range!. 00008078 <_sPrinterName>: 8078: 4d 4b 33 53 00 MK3S. 0000807d <_sPrinterMmuName>: 807d: 4d 4b 33 53 4d 4d 55 33 00 MK3SMMU3. 00008086 <_nPrinterMmuType>: 8086: 5e 76 ^v 00008088 <_nPrinterType>: 8088: 2e 01 .. 0000808a : 808a: 25 33 64 2f 25 33 64 00 %3d/%3d. 00008092 : 8092: 25 33 64 00 %3d. 00008096 : 8096: 20 0a 20 0a 20 0a 20 00 . . . . 0000809e : 809e: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 80ae: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 80be: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 80ce: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 80de: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 80ee: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 80fe: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 810e: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 811e: 0a 00 .. 00008120 : 8120: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 8130: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 0000813f : 813f: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 814f: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 815f: 25 2e 32 66 0a 00 %.2f.. 00008165 : 8165: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 8175: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 8185: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 8195: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 81a5: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 81b5: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 81c5: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 81d5: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 81e5: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 81f5: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 8205: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 8215: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 8225: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 8235: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 8245: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 8255: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00008266 : 8266: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 8276: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 8286: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 8296: 2e 32 66 0a 00 .2f.. 0000829b : 829b: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 82ab: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 82bb: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 000082c8 : 82c8: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 82d8: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 82e8: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 82f8: 66 0a 25 53 55 53 74 65 70 20 72 65 73 6f 6c 75 f.%SUStep resolu 8308: 74 69 6f 6e 3a 20 0a 25 53 20 4d 33 35 30 20 58 tion: .%S M350 X 8318: 25 64 20 59 25 64 20 5a 25 64 20 45 25 64 0a 25 %d Y%d Z%d E%d.% 8328: 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 72 61 74 SMaximum feedrat 8338: 65 73 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f es - normal (mm/ 8348: 73 29 3a 0a 25 53 20 20 4d 32 30 33 20 58 25 2e s):.%S M203 X%. 8358: 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 2f Y%.2f Z%.2f E 8368: 25 2e 32 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 %.2f.%SMaximum f 8378: 65 65 64 72 61 74 65 73 20 2d 20 73 74 65 61 6c eedrates - steal 8388: 74 68 20 28 6d 6d 2f 73 29 3a 0a 25 53 20 20 4d th (mm/s):.%S M 8398: 32 30 33 20 58 25 2e 32 66 20 59 25 2e 32 66 20 203 X%.2f Y%.2f 83a8: 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 4d 61 Z%.2f E%.2f.%SMa 83b8: 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 61 74 69 ximum accelerati 83c8: 6f 6e 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f on - normal (mm/ 83d8: 73 32 29 3a 0a 25 53 20 20 4d 32 30 31 20 58 25 s2):.%S M201 X% 83e8: 6c 75 20 59 25 6c 75 20 5a 25 6c 75 20 45 25 6c lu Y%lu Z%lu E%l 83f8: 75 0a 25 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 u.%SMaximum acce 8408: 6c 65 72 61 74 69 6f 6e 20 2d 20 73 74 65 61 6c leration - steal 8418: 74 68 20 28 6d 6d 2f 73 32 29 3a 0a 25 53 20 20 th (mm/s2):.%S 8428: 4d 32 30 31 20 58 25 6c 75 20 59 25 6c 75 20 5a M201 X%lu Y%lu Z 8438: 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 63 65 6c %lu E%lu.%SAccel 8448: 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 69 6e 74 eration: P=print 8458: 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 54 3d 74 , R=retract, T=t 8468: 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 34 20 50 ravel.%S M204 P 8478: 25 2e 32 66 20 52 25 2e 32 66 20 54 25 2e 32 66 %.2f R%.2f T%.2f 8488: 0a 25 53 41 64 76 61 6e 63 65 64 20 76 61 72 69 .%SAdvanced vari 8498: 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 66 65 65 ables: S=Min fee 84a8: 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 54 3d drate (mm/s), T= 84b8: 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 65 64 72 Min travel feedr 84c8: 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 3d 6d 69 ate (mm/s), B=mi 84d8: 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 20 74 69 nimum segment ti 84e8: 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 78 69 6d me (us), X=maxim 84f8: 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d 6d 2f 73 um XY jerk (mm/s 8508: 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d 20 5a 20 ), Z=maximum Z 8518: 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 20 45 3d jerk (mm/s), E= 8528: 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 6b 20 28 maximum E jerk ( 8538: 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 35 20 53 mm/s).%S M205 S 8548: 25 2e 32 66 20 54 25 2e 32 66 20 42 25 6c 75 20 %.2f T%.2f B%lu 8558: 58 25 2e 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 X%.2f Y%.2f Z%.2 8568: 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d 65 20 6f f E%.2f.%SHome o 8578: 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 53 20 20 ffset (mm):.%S 8588: 4d 32 30 36 20 58 25 2e 32 66 20 59 25 2e 32 66 M206 X%.2f Y%.2f 8598: 20 5a 25 2e 32 66 0a 00 Z%.2f.. 000085a0 : 85a0: 54 4d 3a 20 52 5b 25 75 5d 20 65 73 74 69 6d 61 TM: R[%u] estima 85b0: 74 65 2e 00 te.. 000085b4 : 85b4: 54 4d 3a 20 25 53 20 52 20 25 64 43 00 TM: %S R %dC. 000085c1 : 85c1: 54 4d 3a 20 25 53 20 43 20 65 73 74 2e 00 TM: %S C est.. 000085cf : 85cf: 54 4d 3a 20 63 6f 6f 6c 20 64 6f 77 6e 20 3c 25 TM: cool down <% 85df: 64 43 00 dC. 000085e2 : 85e2: 72 65 66 69 6e 65 00 refine. 000085e9 : 85e9: 69 6e 69 74 69 61 6c 00 initial. 000085f1 : 85f1: 54 4d 3a 20 63 61 6c 69 62 72 2e 20 66 61 69 6c TM: calibr. fail 8601: 65 64 21 00 ed!. 00008605 : 8605: 54 4d 3a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 TM: calibration 8615: 73 74 61 72 74 00 start. 0000861b : 861b: 54 4d 3a 20 43 61 6c 2e 20 4e 4f 54 20 49 44 4c TM: Cal. NOT IDL 862b: 45 00 E. 0000862d : 862d: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00008638 : 8638: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00008643 : 8643: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 00008650 : 8650: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 8660: 49 4f 4e 00 ION. 00008664 : 8664: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 00008674 : 8674: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 00008684 : ... 00008685 : 8685: 33 2e 31 34 2e 31 00 3.14.1. 0000868c : 868c: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 869c: 20 46 69 6c 65 3a 20 00 File: . 000086a4 : 86a4: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 000086b2 : 86b2: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 000086c2 : 86c2: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 000086ce : 86ce: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 000086de : 86de: 25 33 64 2f 25 33 64 00 %3d/%3d. 000086e6 : 86e6: 4f 4b 00 OK. 000086e9 : 86e9: 42 41 44 00 BAD. 000086ed : 86ed: 52 41 4d 42 6f 20 46 41 4e 20 00 RAMBo FAN . 000086f8 : 86f8: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008705 : 8705: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008713 : 8713: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008721 <_ZZ16process_commandsvE3__c__98_>: 8721: 22 28 32 29 00 "(2). 00008726 <_ZZ16process_commandsvE3__c__97_>: 8726: 25 53 3a 20 25 53 0a 00 %S: %S.. 0000872e <_ZZ16process_commandsvE3__c__96_>: 872e: 2c 20 4d 39 30 37 20 45 20 69 67 6e 6f 72 65 64 , M907 E ignored ... 0000873f <_ZZ16process_commandsvE3__c__95_>: 873f: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 00008750 <_ZZ16process_commandsvE3__c__94_>: 8750: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 0000875a <_ZZ16process_commandsvE3__c__93_>: 875a: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 0000876b <_ZZ16process_commandsvE3__c__91_>: 876b: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 877b: 65 70 2c 20 75 6d 00 ep, um. 00008782 <_ZZ16process_commandsvE3__c__92_>: 8782: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 8792: 3a 20 00 : . 00008795 <_ZZ16process_commandsvE3__c__90_>: 8795: 50 3a 00 P:. 00008798 <_ZZ16process_commandsvE3__c__89_>: 8798: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 87a8: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 87b8: 65 3a 00 e:. 000087bb <_ZZ16process_commandsvE3__c__88_>: 87bb: 20 41 00 A. 000087be <_ZZ16process_commandsvE3__c__87_>: 87be: 20 50 00 P. 000087c1 <_ZZ16process_commandsvE3__c__86_>: 87c1: 20 42 00 B. 000087c4 <_ZZ16process_commandsvE3__c__85_>: 87c4: 20 4c 00 L. 000087c7 <_ZZ16process_commandsvE3__c__84_>: 87c7: 20 52 00 R. 000087ca <_ZZ16process_commandsvE3__c__83_>: 87ca: 20 5a 00 Z. 000087cd <_ZZ16process_commandsvE3__c__82_>: 87cd: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 000087de <_ZZ16process_commandsvE3__c__81_>: 87de: 53 68 65 65 74 20 00 Sheet . 000087e5 <_ZZ16process_commandsvE3__c__80_>: 87e5: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 87f5: 52 41 4e 47 45 00 RANGE. 000087fb <_ZZ16process_commandsvE3__c__79_>: 87fb: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 880b: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 0000881a <_ZZ16process_commandsvE3__c__78_>: 881a: 41 55 54 4f 00 AUTO. 0000881f <_ZZ16process_commandsvE3__c__77_>: 881f: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 0000882f <_ZZ16process_commandsvE3__c__76_>: 882f: 20 64 3a 00 d:. 00008833 <_ZZ16process_commandsvE3__c__75_>: 8833: 20 69 3a 00 i:. 00008837 <_ZZ16process_commandsvE3__c__74_>: 8837: 20 70 3a 00 p:. 0000883b <_ZZ16process_commandsvE3__c__73_>: 883b: 20 64 3a 00 d:. 0000883f <_ZZ16process_commandsvE3__c__72_>: 883f: 20 69 3a 00 i:. 00008843 <_ZZ16process_commandsvE3__c__71_>: 8843: 20 70 3a 00 p:. 00008847 <_ZZ16process_commandsvE3__c__70_>: 8847: 25 69 25 25 0a 00 %i%%.. 0000884d <_ZZ16process_commandsvE3__c__69_>: 884d: 25 69 25 25 0a 00 %i%%.. 00008853 <_ZZ16process_commandsvE3__c__68_>: 8853: 22 28 31 29 00 "(1). 00008858 <_ZZ16process_commandsvE3__c__61_>: 8858: 2f 2f 00 //. 0000885b <_ZZ16process_commandsvE3__c__60_>: ... 0000885c <_ZZ16process_commandsvE3__c__59_>: 885c: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 886c: 31 00 1. 0000886e <_ZZ16process_commandsvE3__c__58_>: 886e: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 0000887d <_ZZ16process_commandsvE3__c__57_>: 887d: 31 2e 30 00 1.0. 00008881 <_ZZ16process_commandsvE3__c__56_>: 8881: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 8891: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 88a1: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 88b1: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 88c1: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 88d1: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 000088db <_ZZ16process_commandsvE3__c__55_>: 88db: 30 30 30 30 30 30 30 30 30 00 000000000. 000088e5 <_ZZ16process_commandsvE3__c__54_>: 88e5: 5f 00 _. 000088e7 <_ZZ16process_commandsvE3__c__53_>: 88e7: 38 32 33 37 00 8237. 000088ec <_ZZ16process_commandsvE3__c__52_>: 88ec: 2b 00 +. 000088ee <_ZZ16process_commandsvE3__c__51_>: 88ee: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 88fe: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 0000890c <_ZZ16process_commandsvE3__c__50_>: 890c: 4d 31 31 33 20 53 00 M113 S. 00008913 <_ZZ16process_commandsvE3__c__49_>: 8913: 6f 6b 20 00 ok . 00008917 <_ZZ16process_commandsvE3__c__48_>: 8917: 20 63 6d 2e 00 cm.. 0000891c <_ZZ16process_commandsvE3__c__47_>: 891c: 20 6d 69 6e 20 00 min . 00008922 <_ZZ16process_commandsvE3__c__46_>: 8922: 53 54 41 54 53 20 00 STATS . 00008929 <_ZZ16process_commandsvE3__c__41_>: 8929: 6e 2f 61 00 n/a. 0000892d <_ZZ16process_commandsvE3__c__40_>: 892d: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 893d: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 0000894d : 894d: 00 01 25 31 1d 0c 40 24 30 1c 0b 45 23 2f 1b 0a ..%1..@$0..E#/.. 895d: 17 ff 04 06 22 2b 1a 03 36 37 35 38 ...."+..6758 00008969 <_ZZ16process_commandsvE3__c__39_>: 8969: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 00008978 <_ZZ16process_commandsvE3__c__36_>: 8978: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 8988: 25 73 0a 00 %s.. 0000898c <_ZZ16process_commandsvE3__c__30_>: 898c: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 899c: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 000089aa <_ZZ16process_commandsvE3__c__29_>: 89aa: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 89ba: 74 6f 72 00 tor. 000089be <_ZZ16process_commandsvE3__c__25_>: 89be: 73 65 74 00 set. 000089c2 <_ZZ16process_commandsvE3__c__24_>: 89c2: 6e 6f 7a 7a 6c 65 00 nozzle. 000089c9 <_ZZ16process_commandsvE3__c__23_>: 89c9: 4d 42 4c 00 MBL. 000089cd <_ZZ16process_commandsvE3__c__22_>: 89cd: 46 52 00 FR. 000089d0 <_ZZ16process_commandsvE3__c__21_>: 89d0: 4c 7a 00 Lz. 000089d3 <_ZZ16process_commandsvE3__c__20_>: 89d3: 4c 61 6e 67 00 Lang. 000089d8 <_ZZ16process_commandsvE3__c__19_>: 89d8: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 2d 45 49 4e 53 1_75mm_MK3S-EINS 89e8: 79 5f 31 30 61 2d 45 33 44 76 36 66 75 6c 6c 00 y_10a-E3Dv6full. 000089f8 <_ZZ16process_commandsvE3__c__18_>: 89f8: 52 65 76 00 Rev. 000089fc <_ZZ16process_commandsvE3__c__17_>: 89fc: 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 00008a08 <_ZZ16process_commandsvE3__c__16_>: 8a08: 46 69 72 00 Fir. 00008a0c <_ZZ16process_commandsvE3__c__15_>: 8a0c: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 00008a17 <_ZZ16process_commandsvE3__c__14_>: 8a17: 53 4e 00 SN. 00008a1a <_ZZ16process_commandsvE3__c__13_>: 8a1a: 52 45 53 45 54 00 RESET. 00008a20 <_ZZ16process_commandsvE3__c__12_>: 8a20: 4d 4d 55 52 45 53 00 MMURES. 00008a27 <_ZZ16process_commandsvE3__c__11_>: 8a27: 75 76 6c 6f 00 uvlo. 00008a2c : 8a2c: 46 41 4e 00 FAN. 00008a30 : 8a30: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 00008a3a : 8a3a: 50 52 55 53 41 00 PRUSA. 00008a40 : 8a40: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 00008a4a : 8a4a: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 00008a54 : 8a54: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 00008a5e : 8a5e: 54 4d 43 5f 00 TMC_. 00008a63 : 8a63: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008a70 : 8a70: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008a7e : 8a7e: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 00008a8d : 8a8d: 43 52 41 53 48 5f 00 CRASH_. 00008a94 : 8a94: 47 31 20 58 31 30 20 59 31 38 30 20 46 34 30 30 G1 X10 Y180 F400 8aa4: 30 00 0. 00008aa6 : 8aa6: 47 31 20 5a 31 30 20 46 31 33 30 30 00 G1 Z10 F1300. 00008ab3 : 8ab3: 4d 31 34 30 20 53 30 00 M140 S0. 00008abb : 8abb: 4d 31 30 34 20 53 30 00 M104 S0. 00008ac3 : 8ac3: 47 31 20 45 2d 30 2e 30 37 35 20 46 32 31 30 30 G1 E-0.075 F2100 ... 00008ad4 : 8ad4: 47 31 20 46 34 30 30 30 00 G1 F4000. 00008add : 8add: 4d 32 30 34 20 53 31 30 30 30 00 M204 S1000. 00008ae8 : 8ae8: 47 31 20 5a 35 20 46 37 32 30 30 00 G1 Z5 F7200. 00008af4 : 8af4: 47 31 20 45 2d 31 2e 35 20 46 32 31 30 30 00 G1 E-1.5 F2100. 00008b03 : 8b03: 47 39 30 00 G90. 00008b07 : 8b07: 47 31 20 58 35 20 45 34 20 46 31 30 30 30 00 G1 X5 E4 F1000. 00008b16 : 8b16: 47 31 20 5a 30 2e 32 20 46 31 30 30 30 00 G1 Z0.2 F1000. 00008b24 : 8b24: 47 31 20 58 35 35 20 45 32 35 20 46 31 34 30 30 G1 X55 E25 F1400 ... 00008b35 : 8b35: 47 31 20 59 2d 32 20 46 31 30 30 30 00 G1 Y-2 F1000. 00008b42 : 8b42: 47 31 20 58 32 34 30 20 45 32 35 20 20 46 32 32 G1 X240 E25 F22 8b52: 30 30 00 00. 00008b55 : 8b55: 47 31 20 5a 30 2e 33 20 46 31 30 30 30 00 G1 Z0.3 F1000. 00008b63 : 8b63: 47 31 20 58 35 35 20 45 38 20 46 32 30 30 30 00 G1 X55 E8 F2000. 00008b73 : 8b73: 47 31 20 58 35 20 45 32 39 20 46 31 38 30 30 00 G1 X5 E29 F1800. 00008b83 : 8b83: 47 31 20 58 35 35 20 45 32 39 20 46 31 30 37 33 G1 X55 E29 F1073 ... 00008b94 : 8b94: 47 39 32 20 45 30 00 G92 E0. 00008b9b : 8b9b: 47 32 38 00 G28. 00008b9f : 8b9f: 4d 31 30 39 00 M109. 00008ba4 : 8ba4: 4d 31 39 30 00 M190. 00008ba9 : 8ba9: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 8bb9: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 8bc9: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 8bd9: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 8be9: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 8bf9: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 8c09: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 8c19: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 00008c29 : 8c29: 4d 34 34 00 M44. 00008c2d : 8c2d: 47 32 38 20 58 59 00 G28 XY. 00008c34 : 8c34: 4d 20 38 34 00 M 84. 00008c39 : 8c39: 85 2e 2e 00 .... 00008c3d : 8c3d: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008c4a : 8c4a: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 00008c57 : 8c57: 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f 72 20 Filament sensor 8c67: 62 6f 61 72 64 20 63 68 61 6e 67 65 20 64 65 74 board change det 8c77: 65 63 74 65 64 3a 20 72 65 76 69 73 69 6f 6e 25 ected: revision% 8c87: 53 0a 00 S.. 00008c8a : 8c8a: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8c9a: 74 20 73 65 6e 73 6f 72 20 6c 6f 77 20 6c 65 76 t sensor low lev 8caa: 65 6c 3a 20 25 34 2e 32 66 56 0a 00 el: %4.2fV.. 00008cb6 : 8cb6: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8cc6: 74 20 73 65 6e 73 6f 72 20 68 69 67 68 20 6c 65 t sensor high le 8cd6: 76 65 6c 3a 20 25 34 2e 32 66 56 0a 00 vel: %4.2fV.. 00008ce3 : 8ce3: 25 33 64 2f 30 00 %3d/0. 00008ce9 : 8ce9: 25 33 64 2f 30 00 %3d/0. 00008cef : 8cef: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 00008cff : 8cff: 48 6f 74 65 6e 64 00 Hotend. 00008d06 : 8d06: 42 65 64 00 Bed. 00008d0a : 8d0a: 5a 00 Z. 00008d0c : 8d0c: 59 00 Y. 00008d0e : 8d0e: 58 00 X. 00008d10 <_ZL13STR_SEPARATOR.lto_priv.455>: 8d10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8d20: 2d 2d 2d 2d 00 ----. 00008d25 : 8d25: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 8d35: 6c 4e 72 00 lNr. 00008d39 : 8d39: c5 6b c3 8a bb 8a b3 8a a6 8a 94 8a .k.......... 00008d45 : 8d45: 47 31 20 58 25 64 20 59 25 64 20 45 25 2d 2e 35 G1 X%d Y%d E%-.5 8d55: 66 00 f. 00008d57 : 8d57: 47 31 20 46 31 30 38 30 00 G1 F1080. 00008d60 : 8d60: 47 31 20 5a 25 2d 2e 33 66 20 46 37 32 30 30 00 G1 Z%-.3f F7200. 00008d70 : 8d70: 47 31 20 58 35 30 20 59 31 35 35 00 G1 X50 Y155. 00008d7c : 8d7c: 94 8b 03 8b fb 6c f4 8a e8 8a dd 8a d4 8a .....l........ 00008d8a : 8d8a: 47 31 20 58 25 64 20 45 25 2d 2e 33 66 20 46 31 G1 X%d E%-.3f F1 8d9a: 30 30 30 00 000. 00008d9e : 8d9e: 83 8b 73 8b 63 8b 55 8b 94 8b 42 8b 35 8b 24 8b ..s.c.U...B.5.$. 8dae: 16 8b 07 8b .... 00008db2 : 8db2: 54 25 64 00 T%d. 00008db6 : 8db6: 47 31 20 5a 30 2e 34 20 46 31 30 30 30 00 G1 Z0.4 F1000. 00008dc4 : 8dc4: 47 31 20 59 2d 33 20 46 31 30 30 30 00 G1 Y-3 F1000. 00008dd1 : 8dd1: c5 6b a4 8b 9f 8b 9b 8b 94 8b .k........ 00008ddb : 8ddb: 4d 38 34 20 58 59 00 M84 XY. 00008de2 : 8de2: 4d 31 30 39 20 53 32 38 30 00 M109 S280. 00008dec : 8dec: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8dfc: 30 30 00 00. 00008dff : 8dff: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008e09 : 8e09: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8e19: 46 38 30 30 30 00 F8000. 00008e1f : 8e1f: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8e2f: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8e3f: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008e4f : 8e4f: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8e5f: 20 44 25 2e 32 66 00 D%.2f. 00008e66 : 8e66: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008e73 : 8e73: 52 43 00 RC. 00008e76 : 8e76: 44 45 56 00 DEV. 00008e7a : 8e7a: 42 45 54 41 00 BETA. 00008e7f : 8e7f: 41 4c 50 48 41 00 ALPHA. 00008e85 : 8e85: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8e95: 01 01 00 00 04 01 07 01 0a 01 .......... 00008e9f : 8e9f: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8eaf: 02 01 00 00 05 01 08 01 0b 01 .......... 00008eb9 : 8eb9: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8ec9: 00 01 00 00 03 01 06 01 09 01 .......... 00008ed3 : 8ed3: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8ee3: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8ef3: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8f03: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8f13: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8f23: 05 04 04 04 08 08 ...... 00008f29 : 8f29: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8f39: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8f49: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8f59: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8f69: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8f79: 80 10 20 40 04 80 .. @.. 00008f7f : 8f7f: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8fab: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008fd5 : 8fd5: 33 2e 31 34 2e 31 00 3.14.1. 00008fdc : 8fdc: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8fec: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8ffc: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 0000900a : 900a: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 0000901a : 901a: 43 5a 50 58 00 CZPX. 0000901f : 901f: 3b 53 00 ;S. 00009022 : 9022: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00009030 : 9030: 61 64 63 5f 69 6e 69 74 00 adc_init. 00009039 : 9039: 20 0a 20 0a 20 0a 20 00 . . . . 00009041 : 9041: 41 6c 6c 20 44 61 74 61 00 All Data. 0000904a : 904a: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00009057 : 9057: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00009065 : 9065: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00009070 : 9070: 4c 61 6e 67 75 61 67 65 00 Language. 00009079 <_ZZL13factory_resetcE3__c.lto_priv.551>: 9079: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 0000908a : 908a: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00009098 : 9098: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 000090a2 <_ZL8MSG_INT4.lto_priv.501>: 90a2: 49 4e 54 34 00 INT4. 000090a7 : 90a7: 03 00 0e 00 01 00 40 00 ......@. 000090af : 90af: 03 00 02 00 00 00 04 00 ........ 000090b7 <_ZZ5setupE3__c__12_>: 90b7: 4e 4f 43 54 55 41 00 NOCTUA. 000090be <_ZZ5setupE3__c__11_>: 90be: 41 4c 54 46 41 4e 00 ALTFAN. 000090c5 : 90c5: 55 6e 6b 6e 6f 77 6e 00 Unknown. 000090cd : 90cd: 31 39 37 30 2d 30 31 2d 30 31 20 30 31 3a 30 30 1970-01-01 01:00 90dd: 3a 30 30 00 :00. 000090e1 : 90e1: 20 33 2e 31 34 2e 31 2d 38 32 33 37 5f 30 30 30 3.14.1-8237_000 90f1: 30 30 30 30 30 30 00 000000. 000090f8 : 90f8: 73 74 61 72 74 00 start. 000090fe : 90fe: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 0000910f : 910f: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 0000911a : 911a: 43 5a 50 58 00 CZPX. 0000911f : 911f: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 00009130 : 9130: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 00009140 : 9140: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 00009150 : 9150: 4d 32 39 00 M29. 00009154 : 9154: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 0000915c : 915c: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 916c: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 0000917b : 917b: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 918b: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 00009195 : 9195: 33 33 29 42 00 00 58 41 9a 99 8d 41 33 33 53 40 33)B..XA...A33S@ 000091a5 : 91a5: 20 0a 20 0a 20 00 . . . 000091ab : 91ab: 4d 4d 55 32 3a 00 MMU2:. 000091b1 : 91b1: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 000091c2 : 91c2: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 91d2: 6e 74 65 72 0a 00 nter.. 000091d8 : 91d8: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 91e8: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 91f8: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 9208: 20 61 64 3d 25 64 0a 00 ad=%d.. 00009210 : 9210: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 9220: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 9230: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000923d : 923d: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 924d: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 925d: 25 64 0a 00 %d.. 00009261 : 9261: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 9271: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 9281: 0a 00 .. 00009283 : 9283: 25 30 32 78 00 %02x. 00009288 : 9288: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 9298: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 000092a4 : 92a4: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 92b4: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 000092c0 : 92c0: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 92d0: fc 03 f8 01 f0 00 00 00 ........ 000092d8 : 92d8: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 92e8: f8 01 f0 00 00 00 00 00 ........ 000092f0 : 92f0: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 9300: 65 61 76 65 0a 00 eave.. 00009306 : 9306: 20 3c 20 00 < . 0000930a : 930a: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 931a: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 932a: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 933a: 3a 00 :. 0000933c : ... 0000933d : 933d: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ 934d: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 0000935d : 935d: 25 64 2f 34 00 %d/4. 00009362 : 9362: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 0000936e : 936e: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 937e: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 938e: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 939e: 2e 00 .. 000093a0 : 93a0: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 93b0: 64 00 d. 000093b2 : 93b2: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 93c2: 69 78 65 64 00 ixed. 000093c7 : 93c7: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 93d7: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 93e7: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 93f7: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 9407: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 9417: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 9427: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 9437: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 9447: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 9457: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 9467: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 9477: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 9487: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 9497: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 94a7: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 94b7: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 94c7: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 94d7: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 94e7: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 94f7: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 9507: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 9517: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 9527: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 9537: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 9547: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 9557: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 9567: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 9577: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 9587: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 9597: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 95a7: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 95b7: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 95c7: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 95d7: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 95e7: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 95f7: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 9607: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 9617: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 9627: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 9637: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 9647: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 9657: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 9667: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 9677: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 9687: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 9697: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 96a7: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 96b7: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 96c7: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 96d7: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 96e7: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 96f7: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 9707: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 9717: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 9727: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 9737: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 9747: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 9757: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 9767: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 9777: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 9787: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 9797: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 97a7: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 97b7: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 000097c7 : 97c7: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 97d7: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 97e7: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 97f7: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 9807: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 9817: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 9827: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 9837: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 9847: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 9857: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 9867: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 9877: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 9887: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 9897: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 98a7: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 98b7: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 98c7: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 98d7: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 98e7: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 98f7: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 9907: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 9917: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 9927: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 9937: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 9947: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 9957: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 9967: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 9977: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 9987: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 9997: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 99a7: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 99b7: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 99c7: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 99d7: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 99e7: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 99f7: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 9a07: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 9a17: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 9a27: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 9a37: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 9a47: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 9a57: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 9a67: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9a77: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9a87: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 9a97: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 9aa7: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 9ab7: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 9ac7: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 9ad7: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 9ae7: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 9af7: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 9b07: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 9b17: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 9b27: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9b37: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9b47: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9b57: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9b67: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9b77: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9b87: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9b97: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9ba7: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9bb7: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009bc7 <_ZZ12PID_autotunefiiE3__c__16_>: 9bc7: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9bd7: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9be7: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9bf7: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9c07: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9c17: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009c23 <_ZZ12PID_autotunefiiE3__c__15_>: 9c23: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9c33: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009c40 <_ZZ12PID_autotunefiiE3__c__14_>: 9c40: 20 40 3a 00 @:. 00009c44 <_ZZ12PID_autotunefiiE3__c__13_>: 9c44: 54 3a 00 T:. 00009c47 <_ZZ12PID_autotunefiiE3__c__12_>: 9c47: 42 3a 00 B:. 00009c4a <_ZZ12PID_autotunefiiE3__c__11_>: 9c4a: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9c5a: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9c6a: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009c74 <_ZZ12PID_autotunefiiE3__c__10_>: 9c74: 20 4b 64 3a 20 00 Kd: . 00009c7a : 9c7a: 20 4b 69 3a 20 00 Ki: . 00009c80 : 9c80: 20 4b 70 3a 20 00 Kp: . 00009c86 : 9c86: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009c94 : 9c94: 20 54 75 3a 20 00 Tu: . 00009c9a : 9c9a: 20 4b 75 3a 20 00 Ku: . 00009ca0 : 9ca0: 20 6d 61 78 3a 20 00 max: . 00009ca7 : 9ca7: 20 6d 69 6e 3a 20 00 min: . 00009cae : 9cae: 20 64 3a 20 00 d: . 00009cb3 : 9cb3: 20 62 69 61 73 3a 20 00 bias: . 00009cbb : 9cbb: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9ccb: 72 74 00 rt. 00009cce : 9cce: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9cde: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9cee: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009cf8 : 9cf8: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9d08: 20 25 6c 78 0a 00 %lx.. 00009d0e : 9d0e: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009d16 : 9d16: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009d22 : 9d22: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009d2e : 9d2e: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009d36 : 9d36: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009d42 : 9d42: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009d4e : 9d4e: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9d5e: 64 00 d. 00009d60 : 9d60: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9d70: 72 65 64 21 00 red!. 00009d75 : 9d75: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9d85: 66 0a 00 f.. 00009d88 : 9d88: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9d98: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9da8: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9db8: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9dc8: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9dd8: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9de8: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9df8: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9e08: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9e18: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9e28: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9e38: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9e48: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9e58: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9e68: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9e78: 00 3f 00 00 .?.. 00009e7c : 9e7c: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9e8c: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9e9c: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9eac: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9ebc: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9ecc: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9edc: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9eec: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9efc: f0 3f dd ff f0 3f d8 ff .?...?.. 00009f04 : 9f04: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9f14: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009f1c : 9f1c: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9f2c: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009f35 : 9f35: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009f45 : 9f45: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9f55: 57 41 59 00 WAY. 00009f59 : 9f59: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9f69: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9f79: 29 00 ). 00009f7b : 9f7b: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9f8b: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9f9b: 44 29 00 D). 00009f9e : 9f9e: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009fac : 9fac: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9fbc: 52 00 R. 00009fbe : 9fbe: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009fca : 9fca: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9fda: 20 6f 66 66 2e 20 00 off. . 00009fe1 : 9fe1: 3a 20 00 : . 00009fe4 : 9fe4: 45 72 72 3a 20 00 Err: . 00009fea : 9fea: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009ffa : 9ffa: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 0000a009 : a009: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para a019: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e a029: 6e 61 62 6c 65 00 nable. 0000a02f : a02f: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U a03f: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f a04f: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B a05f: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T a06f: 25 2e 32 66 0a 00 %.2f.. 0000a075 : a075: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. a085: 32 66 0a 00 2f.. 0000a089 : a089: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se a099: 74 74 69 6e 67 73 3a 00 ttings:. 0000a0a1 : a0a1: 00 00 a4 41 33 33 93 41 9a 99 85 41 33 33 73 41 ...A33.A...A33sA a0b1: 9a 99 61 41 cd cc 54 41 33 33 4b 41 9a 99 41 41 ..aA..TA33KA..AA a0c1: 33 33 3b 41 cd cc 34 41 00 00 30 41 cd cc 2c 41 33;A..4A..0A..,A a0d1: 9a 99 29 41 66 66 26 41 33 33 23 41 9a 99 21 41 ..)Aff&A33#A..!A 0000a0e1 : a0e1: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current a0f1: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 0000a101 : a101: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 0000a10d : a10d: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent a11d: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% a12d: 30 32 78 29 0a 00 02x).. 0000a133 : a133: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi a143: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom a153: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x a163: 25 30 32 78 0a 00 %02x.. 0000a169 : a169: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d a179: 0a 00 .. 0000a17b : a17b: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v a18b: 61 6c 3d 25 32 64 0a 00 al=%2d.. 0000a193 : a193: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 0000a19d : a19d: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 0000a1ae : a1ae: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 0000a1be <__c.1906>: a1be: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! a1ce: 21 00 !. 0000a1d0 : a1d0: 3a 20 00 : . 0000a1d3 : a1d3: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 0000a1e1 : a1e1: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000a1ea : a1ea: 20 3a 20 00 : . 0000a1ee : a1ee: 25 33 53 00 %3S. 0000a1f2 : a1f2: 25 2d 37 73 00 %-7s. 0000a1f7 : a1f7: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 a207: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 0000a212 : a212: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a222: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000a231 : a231: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a241: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a251: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a25e : a25e: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a26e: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a27e: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a28e: 25 2d 33 64 00 %-3d. 0000a293 : a293: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a29d : a29d: 0a 20 49 52 20 3a 20 20 20 20 20 20 20 25 33 2e . IR : %3. a2ad: 31 66 56 00 1fV. 0000a2b1 : a2b1: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a2c1: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a2d1: 31 66 56 00 1fV. 0000a2d5 : a2d5: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a2e4 : a2e4: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a2f0 <_ZZL16lcd_support_menuvE3__c__16_>: a2f0: 20 00 . 0000a2f2 <_ZZL16lcd_support_menuvE3__c__15_>: a2f2: 20 00 . 0000a2f4 <_ZZL16lcd_support_menuvE3__c__14_>: a2f4: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a304: 3a 00 :. 0000a306 <_ZZL16lcd_support_menuvE3__c__13_>: a306: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a315 <_ZZL16lcd_support_menuvE3__c__12_>: a315: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a31e <_ZZL16lcd_support_menuvE3__c__11_>: a31e: 20 46 57 3a 00 FW:. 0000a323 <_ZZL16lcd_support_menuvE3__c__10_>: a323: 46 69 6c 2e 20 73 65 6e 73 6f 72 20 76 2e 3a 00 Fil. sensor v.:. 0000a333 : a333: 31 39 37 30 2d 30 31 2d 30 31 00 1970-01-01. 0000a33e : a33e: 45 33 44 76 36 66 75 6c 6c 00 E3Dv6full. 0000a348 : a348: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a352 : a352: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 00 1_75mm_MK3S. 0000a35e : a35e: 20 48 61 73 68 3a 30 30 30 30 30 30 30 30 30 00 Hash:000000000. 0000a36e : a36e: 20 52 65 70 6f 3a 55 6e 6b 6e 6f 77 6e 00 Repo:Unknown. 0000a37c : a37c: 20 33 2e 31 34 2e 31 2d 38 32 33 37 00 3.14.1-8237. 0000a389 : a389: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a393 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a393: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a3a2 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a3a2: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a3ae <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a3ae: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a3be <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a3be: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a3ca <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a3ca: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a3da <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a3da: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a3e6 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a3e6: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a3f6 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a3f6: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a402 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a402: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a411 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a411: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a41d <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a41d: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a42c : a42c: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a438 : a438: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a448 : a448: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a454 : a454: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a464 : a464: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a470 : a470: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a47f : a47f: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a48b : a48b: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a49a : a49a: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a4a6 : a4a6: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a4b5 : a4b5: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a4bf : a4bf: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a4ca : a4ca: 58 3a 00 X:. 0000a4cd : a4cd: 59 3a 00 Y:. 0000a4d0 : a4d0: 5a 3a 00 Z:. 0000a4d3 : a4d3: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a4e4 : a4e4: 25 33 75 00 %3u. 0000a4e8 : a4e8: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a4f8: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a508: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a518: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a523 : a523: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a533: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a543: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a553: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a55c : a55c: 47 38 30 00 G80. 0000a560 : a560: 4d 34 35 00 M45. 0000a564 : a564: 4d 34 35 20 5a 00 M45 Z. 0000a56a : a56a: 47 37 36 00 G76. 0000a56e : a56e: 4d 37 30 31 20 50 30 00 M701 P0. 0000a576 : a576: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d a586: 0a 00 .. 0000a588 : a588: 4d 39 31 34 00 M914. 0000a58d : a58d: 4d 39 31 35 00 M915. 0000a592 : a592: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 0000a59f : a59f: 46 73 65 6e 73 6f 72 20 44 65 74 65 63 74 69 6f Fsensor Detectio a5af: 6e 00 n. 0000a5b1 : a5b1: 30 2e 38 30 00 0.80. 0000a5b6 : a5b6: 30 2e 36 30 00 0.60. 0000a5bb : a5bb: 30 2e 34 30 00 0.40. 0000a5c0 : a5c0: 30 2e 32 35 00 0.25. 0000a5c5 : a5c5: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 0000a5cf : a5cf: 4d 4d 55 00 MMU. 0000a5d3 : a5d3: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a5e3: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a5f3: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a603: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a60b <_ZL4endl.lto_priv.390>: a60b: 0a 00 .. 0000a60d : a60d: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a61c : a61c: 25 64 0a 00 %d.. 0000a620 : a620: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a631 : a631: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a641: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a651: 25 25 0a 00 %%.. 0000a655 : a655: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a665: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a671 : a671: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a681: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a691 <_ZL16ramming_sequence.lto_priv.393>: a691: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a6a1: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a6b1: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a6c1: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a6d1: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a6e1: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a6f1: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a701: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a711: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a721 <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.391>: a721: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a731: 74 73 00 ts. 0000a734 : a734: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a744: 6f 70 70 65 64 00 opped. 0000a74a : a74a: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a75a : a75a: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a76a: 73 74 61 72 74 65 64 00 started. 0000a772 : a772: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a782: 6e 67 00 ng. 0000a785 : a785: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a795: 70 65 6e 64 69 6e 67 00 pending. 0000a79d : a79d: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a7aa : a7aa: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a7b4 <_ZL9mmu2Magic.lto_priv.374>: a7b4: 4d 4d 55 32 3a 00 MMU2:. 0000a7ba : a7ba: 47 31 20 58 25 64 20 59 25 2d 2e 32 66 20 45 25 G1 X%d Y%-.2f E% a7ca: 2d 2e 33 66 00 -.3f. 0000a7cf : a7cf: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a7df: 20 00 . 0000a7e1 : a7e1: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a7f1: 6e 65 64 00 ned. 0000a7f5 : a7f5: df 5a ce 5a ba 5a a5 5a 8f 5a 7c 5a 66 5a 52 5a .Z.Z.Z.Z.Z|ZfZRZ a805: 41 5a 2b 5a ba 5a ce 5a 17 5a 08 5a f4 59 e3 59 AZ+Z.Z.Z.Z.Z.Y.Y a815: ce 59 72 5d b8 59 a6 59 93 59 82 59 6d 59 5a 59 .Yr].Y.Y.Y.YmYZY a825: 46 59 31 59 28 59 16 59 01 59 FY1Y(Y.Y.Y 0000a82f : a82f: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a839 : a839: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a849: 75 6e 6f 75 74 21 00 unout!. 0000a850 : a850: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a860: 6d 65 6f 75 74 00 meout. 0000a866 : a866: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a875 : a875: 03 00 03 ... 0000a878 : a878: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a889 : a889: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a897 : a897: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a8a8 : a8a8: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a8b8: 64 00 d. 0000a8ba : a8ba: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a8ca: 65 64 00 ed. 0000a8cd <_ZN4MMU2L11errorTitlesE.lto_priv.508>: a8cd: 3c 5d 27 5d 10 5d fb 5c e6 5c d2 5c c2 5c ab 5c <]'].].\.\.\.\.\ a8dd: 94 5c 7d 5c 69 5c 55 5c 3f 5c 3f 5c 3f 5c 2a 5c .\}\i\U\?\?\?\*\ a8ed: 2a 5c 2a 5c 17 5c 17 5c 17 5c 04 5c 04 5c 04 5c *\*\.\.\.\.\.\.\ a8fd: ed 5b ed 5b ed 5b d8 5b d8 5b d8 5b c2 5b c2 5b .[.[.[.[.[.[.[.[ a90d: c2 5b b2 5b 9d 5b 87 5b 71 5b 62 5b 55 5b 3e 5b .[.[.[.[q[b[U[>[ a91d: 2b 5b 19 5b 06 5b f4 5a e4 5a +[.[.[.Z.Z 0000a927 : a927: 42 75 74 74 6f 6e 00 Button. 0000a92e : a92e: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a93e: 74 6e 4c 4d 52 20 00 tnLMR . 0000a945 <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.507>: a945: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a955: 20 20 20 81 00 .. 0000a95a : a95a: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a96a: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a975 : a975: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a983 : a983: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl a993: 65 61 72 65 64 00 eared. 0000a999 : a999: 20 57 3a 00 W:. 0000a99d : a99d: 20 45 3a 00 E:. 0000a9a1 : a9a1: 54 3a 00 T:. 0000a9a4 : a9a4: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000a9b5 : a9b5: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000a9c2 : a9c2: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000a9d0 : a9d0: 20 53 69 7a 65 3a 20 00 Size: . 0000a9d8 : a9d8: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000a9e6 : a9e6: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000a9f7 : a9f7: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000aa08 : aa08: 22 20 70 6f 73 00 " pos. 0000aa0e : aa0e: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000aa19 : aa19: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL aa29: 74 61 72 67 65 74 3a 22 00 target:". 0000aa32 : aa32: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s aa42: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w aa52: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev aa62: 65 6c 73 2e 00 els.. 0000aa67 : aa67: 20 22 25 73 22 00 "%s". 0000aa6d : aa6d: 20 25 23 6c 78 00 %#lx. 0000aa73 : aa73: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000aa7c : aa7c: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% aa8c: 73 22 0a 00 s".. 0000aa90 : aa90: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000aa99 : aa99: 04 1a .. 0000aa9b : aa9b: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt aaab: 74 65 6d 70 74 73 00 tempts. 0000aab2 : aab2: 08 1b 1c ... 0000aab5 : aab5: 0b 14 .. 0000aab7 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.392>: aab7: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000aac6 : aac6: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000aad5 <_ZL10bufferFull.lto_priv.570>: aad5: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer aae5: 20 66 75 6c 6c 21 00 full!. 0000aaec : aaec: 45 72 72 6f 72 3a 00 Error:. 0000aaf3 : aaf3: 22 00 ". 0000aaf5 : aaf5: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the ab05: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000ab0e <_ZL9mmu2Magic.lto_priv.375>: ab0e: 4d 4d 55 32 3a 00 MMU2:. 0000ab14 : ab14: 65 63 68 6f 3a 00 echo:. 0000ab1a : ab1a: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000ab22 : ab22: 4d 4d 55 20 69 73 20 00 MMU is . 0000ab2a : ab2a: 25 2e 31 30 53 20 00 %.10S . 0000ab31 : ab31: 25 34 64 00 %4d. 0000ab35 : ab35: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t ab45: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000ab52 : ab52: 25 64 2f 39 00 %d/9. 0000ab57 : ab57: 4d 4d 55 32 3a 00 MMU2:. 0000ab5d : ab5d: 25 33 64 00 %3d. 0000ab61 : ab61: 18 01 04 19 02 0a ...... 0000ab67 : ab67: 27 65 b1 64 37 64 ca 63 81 63 ef 62 77 62 0f 62 'e.d7d.c.c.bwb.b ab77: c0 61 a0 61 54 61 a0 61 3d 61 3d 61 3d 61 3d 61 .a.aTa.a=a=a=a=a ab87: 3d 61 3d 61 3d 61 3d 61 3d 61 3d 61 3d 61 3d 61 =a=a=a=a=a=a=a=a ab97: 3d 61 3d 61 3d 61 3d 61 3d 61 3d 61 3d 61 3d 61 =a=a=a=a=a=a=a=a aba7: 3d 61 3d 61 06 61 c5 60 7b 60 08 60 d3 5f 89 5f =a=a.a.`{`.`._._ abb7: 3f 5f e1 5e a8 5e 66 5e 49 5e ?_.^.^f^I^ 0000abc1 : abc1: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. abd1: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ abe1: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000abee : abee: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. abfe: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... ac0e: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. ac1e: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. ac2e: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. ac3e: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000ac48 : ac48: b4 65 1d 66 a9 65 a0 65 99 65 d0 4c a9 3c 92 65 .e.f.e.e.e.L.<.e ac58: 88 65 .e 0000ac5a : ac5a: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ac6a: 34 25 68 75 00 4%hu. 0000ac6f : ac6f: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ac7f: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ac8f: 6e 65 63 74 21 00 nect!. 0000ac95 : ac95: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000aca3 : aca3: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000acb3 : acb3: 73 74 61 72 74 0a 00 start.. 0000acba : acba: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ acca: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe acda: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial acea: 20 00 . 0000acec <_ZZL25restore_print_from_eeprombE3__c__12_>: acec: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 0000acf7 <_ZZL25restore_print_from_eeprombE3__c__11_>: acf7: 47 34 20 53 30 00 G4 S0. 0000acfd <_ZZL25restore_print_from_eeprombE3__c__10_>: acfd: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 0000ad07 : ad07: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 0000ad10 : ad10: 4d 31 30 36 20 53 25 75 00 M106 S%u. 0000ad19 : ad19: 47 31 20 46 25 64 00 G1 F%d. 0000ad20 : ad20: 4d 38 32 00 M82. 0000ad24 : ad24: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 0000ad2f : ad2f: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. ad3f: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 0000ad49 : ad49: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 0000ad53 : ad53: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 0000ad60 : ad60: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f ad70: 20 46 33 30 30 30 00 F3000. 0000ad77 : ad77: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 0000ad87 : ad87: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 0000ad91 : ad91: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 0000ad9c : ad9c: 4d 31 30 39 20 53 25 64 00 M109 S%d. 0000ada5 : ada5: 4d 31 34 30 20 53 25 64 00 M140 S%d. 0000adae : adae: 4d 31 30 34 20 53 25 64 00 M104 S%d. 0000adb7 : adb7: 47 32 38 20 58 20 59 00 G28 X Y. 0000adbf : adbf: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 0000adcd : adcd: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p addd: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... aded: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b adfd: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... ae0d: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T ae1d: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... ae2d: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F ae3d: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... ae4d: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 ae5d: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. ae6d: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* ae7d: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... ae8d: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. ae9d: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. aead: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. aebd: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. aecd: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. aedd: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` aeed: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. aefd: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr af0d: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... af1d: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D af2d: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. af3d: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V af4d: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... af5d: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( af6d: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... af7d: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: af8d: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... af9d: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... afad: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... afbd: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 0000afcd : afcd: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 0000afd6 <__ctors_start>: afd6: 4e 3b cpi r20, 0xBE ; 190 0000afd8 <__ctors_end>: afd8: bb 65 ori r27, 0x5B ; 91 0000afda <__dtors_end>: afda: 11 24 eor r1, r1 afdc: 1f be out 0x3f, r1 ; 63 afde: cf ef ldi r28, 0xFF ; 255 afe0: d1 e2 ldi r29, 0x21 ; 33 afe2: de bf out 0x3e, r29 ; 62 afe4: cd bf out 0x3d, r28 ; 61 afe6: 00 e0 ldi r16, 0x00 ; 0 afe8: 0c bf out 0x3c, r16 ; 60 0000afea <__do_copy_data>: afea: 13 e0 ldi r17, 0x03 ; 3 afec: a0 e0 ldi r26, 0x00 ; 0 afee: b2 e0 ldi r27, 0x02 ; 2 aff0: e6 eb ldi r30, 0xB6 ; 182 aff2: f7 ec ldi r31, 0xC7 ; 199 aff4: 03 e0 ldi r16, 0x03 ; 3 aff6: 0b bf out 0x3b, r16 ; 59 aff8: 02 c0 rjmp .+4 ; 0xaffe <__do_copy_data+0x14> affa: 07 90 elpm r0, Z+ affc: 0d 92 st X+, r0 affe: a2 32 cpi r26, 0x22 ; 34 b000: b1 07 cpc r27, r17 b002: d9 f7 brne .-10 ; 0xaffa <__do_copy_data+0x10> 0000b004 <__do_clear_bss>: b004: 28 e1 ldi r18, 0x18 ; 24 b006: a2 e2 ldi r26, 0x22 ; 34 b008: b3 e0 ldi r27, 0x03 ; 3 b00a: 01 c0 rjmp .+2 ; 0xb00e <.do_clear_bss_start> 0000b00c <.do_clear_bss_loop>: b00c: 1d 92 st X+, r1 0000b00e <.do_clear_bss_start>: b00e: a6 31 cpi r26, 0x16 ; 22 b010: b2 07 cpc r27, r18 b012: e1 f7 brne .-8 ; 0xb00c <.do_clear_bss_loop> 0000b014 <__do_global_ctors>: b014: 17 e5 ldi r17, 0x57 ; 87 b016: cc ee ldi r28, 0xEC ; 236 b018: d7 e5 ldi r29, 0x57 ; 87 b01a: 00 e0 ldi r16, 0x00 ; 0 b01c: 06 c0 rjmp .+12 ; 0xb02a <__do_global_ctors+0x16> b01e: 21 97 sbiw r28, 0x01 ; 1 b020: 01 09 sbc r16, r1 b022: 80 2f mov r24, r16 b024: fe 01 movw r30, r28 b026: 0f 94 1f de call 0x3bc3e ; 0x3bc3e <__tablejump2__> b02a: cb 3e cpi r28, 0xEB ; 235 b02c: d1 07 cpc r29, r17 b02e: 80 e0 ldi r24, 0x00 ; 0 b030: 08 07 cpc r16, r24 b032: a9 f7 brne .-22 ; 0xb01e <__do_global_ctors+0xa> b034: 0e 94 dc f8 call 0x1f1b8 ; 0x1f1b8
b038: 0d 94 c9 e3 jmp 0x3c792 ; 0x3c792 <__do_global_dtors> 0000b03c <__bad_interrupt>: b03c: 0c 94 b1 68 jmp 0xd162 ; 0xd162 <__vector_default> 0000b040 : b040: 2f 92 push r2 b042: 3f 92 push r3 b044: 4f 92 push r4 b046: 5f 92 push r5 b048: 6f 92 push r6 b04a: 7f 92 push r7 b04c: 8f 92 push r8 b04e: 9f 92 push r9 b050: af 92 push r10 b052: bf 92 push r11 b054: cf 92 push r12 b056: df 92 push r13 b058: ef 92 push r14 b05a: ff 92 push r15 b05c: 0f 93 push r16 b05e: 1f 93 push r17 b060: cf 93 push r28 b062: df 93 push r29 b064: cd b7 in r28, 0x3d ; 61 b066: de b7 in r29, 0x3e ; 62 b068: 2f 97 sbiw r28, 0x0f ; 15 b06a: 0f b6 in r0, 0x3f ; 63 b06c: f8 94 cli b06e: de bf out 0x3e, r29 ; 62 b070: 0f be out 0x3f, r0 ; 63 b072: cd bf out 0x3d, r28 ; 61 b074: 6c 01 movw r12, r24 b076: 1b 01 movw r2, r22 b078: 5a 01 movw r10, r20 b07a: fc 01 movw r30, r24 b07c: 17 82 std Z+7, r1 ; 0x07 b07e: 16 82 std Z+6, r1 ; 0x06 b080: 83 81 ldd r24, Z+3 ; 0x03 b082: 9e 01 movw r18, r28 b084: 2f 5f subi r18, 0xFF ; 255 b086: 3f 4f sbci r19, 0xFF ; 255 b088: 49 01 movw r8, r18 b08a: 81 fd sbrc r24, 1 b08c: d2 c0 rjmp .+420 ; 0xb232 b08e: 8f ef ldi r24, 0xFF ; 255 b090: 9f ef ldi r25, 0xFF ; 255 b092: ee c2 rjmp .+1500 ; 0xb670 b094: f1 2c mov r15, r1 b096: 51 2c mov r5, r1 b098: 00 e0 ldi r16, 0x00 ; 0 b09a: 00 32 cpi r16, 0x20 ; 32 b09c: 38 f4 brcc .+14 ; 0xb0ac b09e: 8b 32 cpi r24, 0x2B ; 43 b0a0: 09 f1 breq .+66 ; 0xb0e4 b0a2: 90 f4 brcc .+36 ; 0xb0c8 b0a4: 80 32 cpi r24, 0x20 ; 32 b0a6: f9 f0 breq .+62 ; 0xb0e6 b0a8: 83 32 cpi r24, 0x23 ; 35 b0aa: 09 f1 breq .+66 ; 0xb0ee b0ac: 07 fd sbrc r16, 7 b0ae: 34 c0 rjmp .+104 ; 0xb118 b0b0: 20 ed ldi r18, 0xD0 ; 208 b0b2: 28 0f add r18, r24 b0b4: 2a 30 cpi r18, 0x0A ; 10 b0b6: 20 f5 brcc .+72 ; 0xb100 b0b8: 06 ff sbrs r16, 6 b0ba: 1b c0 rjmp .+54 ; 0xb0f2 b0bc: fa e0 ldi r31, 0x0A ; 10 b0be: ff 9e mul r15, r31 b0c0: 20 0d add r18, r0 b0c2: 11 24 eor r1, r1 b0c4: f2 2e mov r15, r18 b0c6: 05 c0 rjmp .+10 ; 0xb0d2 b0c8: 8d 32 cpi r24, 0x2D ; 45 b0ca: 79 f0 breq .+30 ; 0xb0ea b0cc: 80 33 cpi r24, 0x30 ; 48 b0ce: 71 f7 brne .-36 ; 0xb0ac b0d0: 01 60 ori r16, 0x01 ; 1 b0d2: f1 01 movw r30, r2 b0d4: 93 fd sbrc r25, 3 b0d6: 85 91 lpm r24, Z+ b0d8: 93 ff sbrs r25, 3 b0da: 81 91 ld r24, Z+ b0dc: 1f 01 movw r2, r30 b0de: 81 11 cpse r24, r1 b0e0: dc cf rjmp .-72 ; 0xb09a b0e2: 1a c0 rjmp .+52 ; 0xb118 b0e4: 02 60 ori r16, 0x02 ; 2 b0e6: 04 60 ori r16, 0x04 ; 4 b0e8: f4 cf rjmp .-24 ; 0xb0d2 b0ea: 08 60 ori r16, 0x08 ; 8 b0ec: f2 cf rjmp .-28 ; 0xb0d2 b0ee: 00 61 ori r16, 0x10 ; 16 b0f0: f0 cf rjmp .-32 ; 0xb0d2 b0f2: 3a e0 ldi r19, 0x0A ; 10 b0f4: 53 9e mul r5, r19 b0f6: 20 0d add r18, r0 b0f8: 11 24 eor r1, r1 b0fa: 52 2e mov r5, r18 b0fc: 00 62 ori r16, 0x20 ; 32 b0fe: e9 cf rjmp .-46 ; 0xb0d2 b100: 8e 32 cpi r24, 0x2E ; 46 b102: 21 f4 brne .+8 ; 0xb10c b104: 06 fd sbrc r16, 6 b106: b1 c2 rjmp .+1378 ; 0xb66a b108: 00 64 ori r16, 0x40 ; 64 b10a: e3 cf rjmp .-58 ; 0xb0d2 b10c: 8c 36 cpi r24, 0x6C ; 108 b10e: 11 f4 brne .+4 ; 0xb114 b110: 00 68 ori r16, 0x80 ; 128 b112: df cf rjmp .-66 ; 0xb0d2 b114: 88 36 cpi r24, 0x68 ; 104 b116: e9 f2 breq .-70 ; 0xb0d2 b118: 9b eb ldi r25, 0xBB ; 187 b11a: 98 0f add r25, r24 b11c: 93 30 cpi r25, 0x03 ; 3 b11e: 08 f0 brcs .+2 ; 0xb122 b120: 5f c0 rjmp .+190 ; 0xb1e0 b122: 00 61 ori r16, 0x10 ; 16 b124: 80 5e subi r24, 0xE0 ; 224 b126: 06 fd sbrc r16, 6 b128: 02 c0 rjmp .+4 ; 0xb12e b12a: 46 e0 ldi r20, 0x06 ; 6 b12c: f4 2e mov r15, r20 b12e: 10 2f mov r17, r16 b130: 1f 73 andi r17, 0x3F ; 63 b132: 85 36 cpi r24, 0x65 ; 101 b134: 09 f0 breq .+2 ; 0xb138 b136: 5b c0 rjmp .+182 ; 0xb1ee b138: 10 64 ori r17, 0x40 ; 64 b13a: 17 ff sbrs r17, 7 b13c: 61 c0 rjmp .+194 ; 0xb200 b13e: 8f 2d mov r24, r15 b140: 9b e3 ldi r25, 0x3B ; 59 b142: 9f 15 cp r25, r15 b144: 08 f4 brcc .+2 ; 0xb148 b146: 8b e3 ldi r24, 0x3B ; 59 b148: 44 24 eor r4, r4 b14a: 43 94 inc r4 b14c: 48 0e add r4, r24 b14e: 27 e0 ldi r18, 0x07 ; 7 b150: 35 01 movw r6, r10 b152: f4 e0 ldi r31, 0x04 ; 4 b154: 6f 0e add r6, r31 b156: 71 1c adc r7, r1 b158: f5 01 movw r30, r10 b15a: 60 81 ld r22, Z b15c: 71 81 ldd r23, Z+1 ; 0x01 b15e: 82 81 ldd r24, Z+2 ; 0x02 b160: 93 81 ldd r25, Z+3 ; 0x03 b162: 04 2d mov r16, r4 b164: a4 01 movw r20, r8 b166: 0f 94 c8 d9 call 0x3b390 ; 0x3b390 <__ftoa_engine> b16a: 5c 01 movw r10, r24 b16c: f9 81 ldd r31, Y+1 ; 0x01 b16e: fc 87 std Y+12, r31 ; 0x0c b170: f0 ff sbrs r31, 0 b172: 03 c0 rjmp .+6 ; 0xb17a b174: 0d e2 ldi r16, 0x2D ; 45 b176: f3 ff sbrs r31, 3 b178: 07 c0 rjmp .+14 ; 0xb188 b17a: 0b e2 ldi r16, 0x2B ; 43 b17c: 11 fd sbrc r17, 1 b17e: 04 c0 rjmp .+8 ; 0xb188 b180: 01 2f mov r16, r17 b182: 04 70 andi r16, 0x04 ; 4 b184: 12 fd sbrc r17, 2 b186: 00 e2 ldi r16, 0x20 ; 32 b188: 2c 85 ldd r18, Y+12 ; 0x0c b18a: 2c 70 andi r18, 0x0C ; 12 b18c: e2 2e mov r14, r18 b18e: 09 f4 brne .+2 ; 0xb192 b190: 6b c0 rjmp .+214 ; 0xb268 b192: 01 11 cpse r16, r1 b194: d8 c2 rjmp .+1456 ; 0xb746 b196: f3 e0 ldi r31, 0x03 ; 3 b198: e1 2c mov r14, r1 b19a: f5 15 cp r31, r5 b19c: a0 f4 brcc .+40 ; 0xb1c6 b19e: 83 e0 ldi r24, 0x03 ; 3 b1a0: e5 2c mov r14, r5 b1a2: e8 1a sub r14, r24 b1a4: 13 fd sbrc r17, 3 b1a6: 08 c0 rjmp .+16 ; 0xb1b8 b1a8: b6 01 movw r22, r12 b1aa: 80 e2 ldi r24, 0x20 ; 32 b1ac: 90 e0 ldi r25, 0x00 ; 0 b1ae: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b1b2: ea 94 dec r14 b1b4: e1 10 cpse r14, r1 b1b6: f8 cf rjmp .-16 ; 0xb1a8 b1b8: 00 23 and r16, r16 b1ba: 29 f0 breq .+10 ; 0xb1c6 b1bc: b6 01 movw r22, r12 b1be: 80 2f mov r24, r16 b1c0: 90 e0 ldi r25, 0x00 ; 0 b1c2: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b1c6: 3c 85 ldd r19, Y+12 ; 0x0c b1c8: 28 ed ldi r18, 0xD8 ; 216 b1ca: a2 2e mov r10, r18 b1cc: 27 e7 ldi r18, 0x77 ; 119 b1ce: b2 2e mov r11, r18 b1d0: 33 fd sbrc r19, 3 b1d2: 04 c0 rjmp .+8 ; 0xb1dc b1d4: 9c ed ldi r25, 0xDC ; 220 b1d6: a9 2e mov r10, r25 b1d8: 97 e7 ldi r25, 0x77 ; 119 b1da: b9 2e mov r11, r25 b1dc: 10 71 andi r17, 0x10 ; 16 b1de: 22 c0 rjmp .+68 ; 0xb224 b1e0: 9b e9 ldi r25, 0x9B ; 155 b1e2: 98 0f add r25, r24 b1e4: 93 30 cpi r25, 0x03 ; 3 b1e6: 08 f0 brcs .+2 ; 0xb1ea b1e8: 47 c1 rjmp .+654 ; 0xb478 b1ea: 0f 7e andi r16, 0xEF ; 239 b1ec: 9c cf rjmp .-200 ; 0xb126 b1ee: 86 36 cpi r24, 0x66 ; 102 b1f0: 11 f4 brne .+4 ; 0xb1f6 b1f2: 10 68 ori r17, 0x80 ; 128 b1f4: a2 cf rjmp .-188 ; 0xb13a b1f6: ff 20 and r15, r15 b1f8: 09 f4 brne .+2 ; 0xb1fc b1fa: 9f cf rjmp .-194 ; 0xb13a b1fc: fa 94 dec r15 b1fe: 9d cf rjmp .-198 ; 0xb13a b200: e7 e0 ldi r30, 0x07 ; 7 b202: 2f 2d mov r18, r15 b204: ef 15 cp r30, r15 b206: 18 f4 brcc .+6 ; 0xb20e b208: 27 e0 ldi r18, 0x07 ; 7 b20a: 37 e0 ldi r19, 0x07 ; 7 b20c: f3 2e mov r15, r19 b20e: 41 2c mov r4, r1 b210: 9f cf rjmp .-194 ; 0xb150 b212: 11 11 cpse r17, r1 b214: 80 52 subi r24, 0x20 ; 32 b216: b6 01 movw r22, r12 b218: 90 e0 ldi r25, 0x00 ; 0 b21a: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b21e: 8f ef ldi r24, 0xFF ; 255 b220: a8 1a sub r10, r24 b222: b8 0a sbc r11, r24 b224: f5 01 movw r30, r10 b226: 84 91 lpm r24, Z b228: 81 11 cpse r24, r1 b22a: f3 cf rjmp .-26 ; 0xb212 b22c: e1 10 cpse r14, r1 b22e: 84 c2 rjmp .+1288 ; 0xb738 b230: 53 01 movw r10, r6 b232: f6 01 movw r30, r12 b234: 93 81 ldd r25, Z+3 ; 0x03 b236: f1 01 movw r30, r2 b238: 93 fd sbrc r25, 3 b23a: 85 91 lpm r24, Z+ b23c: 93 ff sbrs r25, 3 b23e: 81 91 ld r24, Z+ b240: 1f 01 movw r2, r30 b242: 88 23 and r24, r24 b244: 09 f4 brne .+2 ; 0xb248 b246: 11 c2 rjmp .+1058 ; 0xb66a b248: 85 32 cpi r24, 0x25 ; 37 b24a: 41 f4 brne .+16 ; 0xb25c b24c: 93 fd sbrc r25, 3 b24e: 85 91 lpm r24, Z+ b250: 93 ff sbrs r25, 3 b252: 81 91 ld r24, Z+ b254: 1f 01 movw r2, r30 b256: 85 32 cpi r24, 0x25 ; 37 b258: 09 f0 breq .+2 ; 0xb25c b25a: 1c cf rjmp .-456 ; 0xb094 b25c: b6 01 movw r22, r12 b25e: 90 e0 ldi r25, 0x00 ; 0 b260: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b264: 35 01 movw r6, r10 b266: e4 cf rjmp .-56 ; 0xb230 b268: 17 ff sbrs r17, 7 b26a: 6f c0 rjmp .+222 ; 0xb34a b26c: 4a 0c add r4, r10 b26e: fc 85 ldd r31, Y+12 ; 0x0c b270: f4 ff sbrs r31, 4 b272: 04 c0 rjmp .+8 ; 0xb27c b274: 8a 81 ldd r24, Y+2 ; 0x02 b276: 81 33 cpi r24, 0x31 ; 49 b278: 09 f4 brne .+2 ; 0xb27c b27a: 4a 94 dec r4 b27c: 14 14 cp r1, r4 b27e: 0c f0 brlt .+2 ; 0xb282 b280: 86 c0 rjmp .+268 ; 0xb38e b282: 28 e0 ldi r18, 0x08 ; 8 b284: 24 15 cp r18, r4 b286: 10 f4 brcc .+4 ; 0xb28c b288: 88 e0 ldi r24, 0x08 ; 8 b28a: 48 2e mov r4, r24 b28c: 85 e0 ldi r24, 0x05 ; 5 b28e: 90 e0 ldi r25, 0x00 ; 0 b290: 17 ff sbrs r17, 7 b292: 06 c0 rjmp .+12 ; 0xb2a0 b294: c5 01 movw r24, r10 b296: b7 fe sbrs r11, 7 b298: 02 c0 rjmp .+4 ; 0xb29e b29a: 90 e0 ldi r25, 0x00 ; 0 b29c: 80 e0 ldi r24, 0x00 ; 0 b29e: 01 96 adiw r24, 0x01 ; 1 b2a0: 01 11 cpse r16, r1 b2a2: 01 96 adiw r24, 0x01 ; 1 b2a4: ff 20 and r15, r15 b2a6: 31 f0 breq .+12 ; 0xb2b4 b2a8: 2f 2d mov r18, r15 b2aa: 30 e0 ldi r19, 0x00 ; 0 b2ac: 2f 5f subi r18, 0xFF ; 255 b2ae: 3f 4f sbci r19, 0xFF ; 255 b2b0: 82 0f add r24, r18 b2b2: 93 1f adc r25, r19 b2b4: 58 16 cp r5, r24 b2b6: 19 06 cpc r1, r25 b2b8: 19 f0 breq .+6 ; 0xb2c0 b2ba: 14 f0 brlt .+4 ; 0xb2c0 b2bc: e5 2c mov r14, r5 b2be: e8 1a sub r14, r24 b2c0: 81 2f mov r24, r17 b2c2: 89 70 andi r24, 0x09 ; 9 b2c4: 11 f4 brne .+4 ; 0xb2ca b2c6: e1 10 cpse r14, r1 b2c8: 67 c0 rjmp .+206 ; 0xb398 b2ca: 00 23 and r16, r16 b2cc: 29 f0 breq .+10 ; 0xb2d8 b2ce: b6 01 movw r22, r12 b2d0: 80 2f mov r24, r16 b2d2: 90 e0 ldi r25, 0x00 ; 0 b2d4: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b2d8: 13 fd sbrc r17, 3 b2da: 02 c0 rjmp .+4 ; 0xb2e0 b2dc: e1 10 cpse r14, r1 b2de: 63 c0 rjmp .+198 ; 0xb3a6 b2e0: 17 ff sbrs r17, 7 b2e2: 7c c0 rjmp .+248 ; 0xb3dc b2e4: 85 01 movw r16, r10 b2e6: b7 fe sbrs r11, 7 b2e8: 02 c0 rjmp .+4 ; 0xb2ee b2ea: 10 e0 ldi r17, 0x00 ; 0 b2ec: 00 e0 ldi r16, 0x00 ; 0 b2ee: c5 01 movw r24, r10 b2f0: 84 19 sub r24, r4 b2f2: 91 09 sbc r25, r1 b2f4: 2c 01 movw r4, r24 b2f6: 6f 2d mov r22, r15 b2f8: 70 e0 ldi r23, 0x00 ; 0 b2fa: ee 27 eor r30, r30 b2fc: ff 27 eor r31, r31 b2fe: e6 1b sub r30, r22 b300: f7 0b sbc r31, r23 b302: ff 87 std Y+15, r31 ; 0x0f b304: ee 87 std Y+14, r30 ; 0x0e b306: 0f 3f cpi r16, 0xFF ; 255 b308: 10 07 cpc r17, r16 b30a: 29 f4 brne .+10 ; 0xb316 b30c: b6 01 movw r22, r12 b30e: 8e e2 ldi r24, 0x2E ; 46 b310: 90 e0 ldi r25, 0x00 ; 0 b312: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b316: a0 16 cp r10, r16 b318: b1 06 cpc r11, r17 b31a: 0c f4 brge .+2 ; 0xb31e b31c: 4b c0 rjmp .+150 ; 0xb3b4 b31e: 40 16 cp r4, r16 b320: 51 06 cpc r5, r17 b322: 0c f0 brlt .+2 ; 0xb326 b324: 47 c0 rjmp .+142 ; 0xb3b4 b326: f5 01 movw r30, r10 b328: e0 1b sub r30, r16 b32a: f1 0b sbc r31, r17 b32c: e8 0d add r30, r8 b32e: f9 1d adc r31, r9 b330: 81 81 ldd r24, Z+1 ; 0x01 b332: 01 50 subi r16, 0x01 ; 1 b334: 11 09 sbc r17, r1 b336: 2e 85 ldd r18, Y+14 ; 0x0e b338: 3f 85 ldd r19, Y+15 ; 0x0f b33a: 02 17 cp r16, r18 b33c: 13 07 cpc r17, r19 b33e: e4 f1 brlt .+120 ; 0xb3b8 b340: b6 01 movw r22, r12 b342: 90 e0 ldi r25, 0x00 ; 0 b344: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b348: de cf rjmp .-68 ; 0xb306 b34a: 16 fd sbrc r17, 6 b34c: 9f cf rjmp .-194 ; 0xb28c b34e: ef 2d mov r30, r15 b350: f0 e0 ldi r31, 0x00 ; 0 b352: ea 15 cp r30, r10 b354: fb 05 cpc r31, r11 b356: 34 f0 brlt .+12 ; 0xb364 b358: 3c ef ldi r19, 0xFC ; 252 b35a: a3 16 cp r10, r19 b35c: 3f ef ldi r19, 0xFF ; 255 b35e: b3 06 cpc r11, r19 b360: 0c f0 brlt .+2 ; 0xb364 b362: 10 68 ori r17, 0x80 ; 128 b364: 32 96 adiw r30, 0x02 ; 2 b366: e8 0d add r30, r8 b368: f9 1d adc r31, r9 b36a: 01 c0 rjmp .+2 ; 0xb36e b36c: fa 94 dec r15 b36e: ff 20 and r15, r15 b370: 19 f0 breq .+6 ; 0xb378 b372: 82 91 ld r24, -Z b374: 80 33 cpi r24, 0x30 ; 48 b376: d1 f3 breq .-12 ; 0xb36c b378: 17 ff sbrs r17, 7 b37a: 88 cf rjmp .-240 ; 0xb28c b37c: 44 24 eor r4, r4 b37e: 43 94 inc r4 b380: 4f 0c add r4, r15 b382: fa 14 cp r15, r10 b384: 1b 04 cpc r1, r11 b386: 31 f0 breq .+12 ; 0xb394 b388: 2c f0 brlt .+10 ; 0xb394 b38a: fa 18 sub r15, r10 b38c: 7f cf rjmp .-258 ; 0xb28c b38e: 44 24 eor r4, r4 b390: 43 94 inc r4 b392: 7c cf rjmp .-264 ; 0xb28c b394: f1 2c mov r15, r1 b396: 7a cf rjmp .-268 ; 0xb28c b398: b6 01 movw r22, r12 b39a: 80 e2 ldi r24, 0x20 ; 32 b39c: 90 e0 ldi r25, 0x00 ; 0 b39e: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b3a2: ea 94 dec r14 b3a4: 90 cf rjmp .-224 ; 0xb2c6 b3a6: b6 01 movw r22, r12 b3a8: 80 e3 ldi r24, 0x30 ; 48 b3aa: 90 e0 ldi r25, 0x00 ; 0 b3ac: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b3b0: ea 94 dec r14 b3b2: 94 cf rjmp .-216 ; 0xb2dc b3b4: 80 e3 ldi r24, 0x30 ; 48 b3b6: bd cf rjmp .-134 ; 0xb332 b3b8: a0 16 cp r10, r16 b3ba: b1 06 cpc r11, r17 b3bc: 41 f4 brne .+16 ; 0xb3ce b3be: 9a 81 ldd r25, Y+2 ; 0x02 b3c0: 96 33 cpi r25, 0x36 ; 54 b3c2: 50 f4 brcc .+20 ; 0xb3d8 b3c4: 95 33 cpi r25, 0x35 ; 53 b3c6: 19 f4 brne .+6 ; 0xb3ce b3c8: 3c 85 ldd r19, Y+12 ; 0x0c b3ca: 34 ff sbrs r19, 4 b3cc: 05 c0 rjmp .+10 ; 0xb3d8 b3ce: b6 01 movw r22, r12 b3d0: 90 e0 ldi r25, 0x00 ; 0 b3d2: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b3d6: 2a cf rjmp .-428 ; 0xb22c b3d8: 81 e3 ldi r24, 0x31 ; 49 b3da: f9 cf rjmp .-14 ; 0xb3ce b3dc: 8a 81 ldd r24, Y+2 ; 0x02 b3de: 81 33 cpi r24, 0x31 ; 49 b3e0: 19 f0 breq .+6 ; 0xb3e8 b3e2: 9c 85 ldd r25, Y+12 ; 0x0c b3e4: 9f 7e andi r25, 0xEF ; 239 b3e6: 9c 87 std Y+12, r25 ; 0x0c b3e8: b6 01 movw r22, r12 b3ea: 90 e0 ldi r25, 0x00 ; 0 b3ec: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b3f0: ff 20 and r15, r15 b3f2: a9 f0 breq .+42 ; 0xb41e b3f4: b6 01 movw r22, r12 b3f6: 8e e2 ldi r24, 0x2E ; 46 b3f8: 90 e0 ldi r25, 0x00 ; 0 b3fa: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b3fe: f3 94 inc r15 b400: f3 94 inc r15 b402: e2 e0 ldi r30, 0x02 ; 2 b404: 01 e0 ldi r16, 0x01 ; 1 b406: 0e 0f add r16, r30 b408: e8 0d add r30, r8 b40a: f9 2d mov r31, r9 b40c: f1 1d adc r31, r1 b40e: 80 81 ld r24, Z b410: b6 01 movw r22, r12 b412: 90 e0 ldi r25, 0x00 ; 0 b414: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b418: e0 2f mov r30, r16 b41a: 0f 11 cpse r16, r15 b41c: f3 cf rjmp .-26 ; 0xb404 b41e: 85 e6 ldi r24, 0x65 ; 101 b420: 90 e0 ldi r25, 0x00 ; 0 b422: 14 ff sbrs r17, 4 b424: 02 c0 rjmp .+4 ; 0xb42a b426: 85 e4 ldi r24, 0x45 ; 69 b428: 90 e0 ldi r25, 0x00 ; 0 b42a: b6 01 movw r22, r12 b42c: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b430: b7 fc sbrc r11, 7 b432: 06 c0 rjmp .+12 ; 0xb440 b434: a1 14 cp r10, r1 b436: b1 04 cpc r11, r1 b438: c1 f4 brne .+48 ; 0xb46a b43a: ec 85 ldd r30, Y+12 ; 0x0c b43c: e4 ff sbrs r30, 4 b43e: 15 c0 rjmp .+42 ; 0xb46a b440: b1 94 neg r11 b442: a1 94 neg r10 b444: b1 08 sbc r11, r1 b446: 8d e2 ldi r24, 0x2D ; 45 b448: b6 01 movw r22, r12 b44a: 90 e0 ldi r25, 0x00 ; 0 b44c: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b450: 80 e3 ldi r24, 0x30 ; 48 b452: 2a e0 ldi r18, 0x0A ; 10 b454: a2 16 cp r10, r18 b456: b1 04 cpc r11, r1 b458: 54 f4 brge .+20 ; 0xb46e b45a: b6 01 movw r22, r12 b45c: 90 e0 ldi r25, 0x00 ; 0 b45e: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b462: b6 01 movw r22, r12 b464: c5 01 movw r24, r10 b466: c0 96 adiw r24, 0x30 ; 48 b468: b4 cf rjmp .-152 ; 0xb3d2 b46a: 8b e2 ldi r24, 0x2B ; 43 b46c: ed cf rjmp .-38 ; 0xb448 b46e: 8f 5f subi r24, 0xFF ; 255 b470: fa e0 ldi r31, 0x0A ; 10 b472: af 1a sub r10, r31 b474: b1 08 sbc r11, r1 b476: ed cf rjmp .-38 ; 0xb452 b478: 83 36 cpi r24, 0x63 ; 99 b47a: c9 f0 breq .+50 ; 0xb4ae b47c: 83 37 cpi r24, 0x73 ; 115 b47e: 71 f1 breq .+92 ; 0xb4dc b480: 83 35 cpi r24, 0x53 ; 83 b482: 09 f0 breq .+2 ; 0xb486 b484: 5b c0 rjmp .+182 ; 0xb53c b486: 35 01 movw r6, r10 b488: f2 e0 ldi r31, 0x02 ; 2 b48a: 6f 0e add r6, r31 b48c: 71 1c adc r7, r1 b48e: f5 01 movw r30, r10 b490: a0 80 ld r10, Z b492: b1 80 ldd r11, Z+1 ; 0x01 b494: 6f 2d mov r22, r15 b496: 70 e0 ldi r23, 0x00 ; 0 b498: 06 fd sbrc r16, 6 b49a: 02 c0 rjmp .+4 ; 0xb4a0 b49c: 6f ef ldi r22, 0xFF ; 255 b49e: 7f ef ldi r23, 0xFF ; 255 b4a0: c5 01 movw r24, r10 b4a2: 0f 94 0b db call 0x3b616 ; 0x3b616 b4a6: 9d 87 std Y+13, r25 ; 0x0d b4a8: 8c 87 std Y+12, r24 ; 0x0c b4aa: 00 68 ori r16, 0x80 ; 128 b4ac: 0d c0 rjmp .+26 ; 0xb4c8 b4ae: 35 01 movw r6, r10 b4b0: 32 e0 ldi r19, 0x02 ; 2 b4b2: 63 0e add r6, r19 b4b4: 71 1c adc r7, r1 b4b6: f5 01 movw r30, r10 b4b8: 80 81 ld r24, Z b4ba: 89 83 std Y+1, r24 ; 0x01 b4bc: 21 e0 ldi r18, 0x01 ; 1 b4be: 30 e0 ldi r19, 0x00 ; 0 b4c0: 3d 87 std Y+13, r19 ; 0x0d b4c2: 2c 87 std Y+12, r18 ; 0x0c b4c4: 54 01 movw r10, r8 b4c6: 0f 77 andi r16, 0x7F ; 127 b4c8: 03 fd sbrc r16, 3 b4ca: 06 c0 rjmp .+12 ; 0xb4d8 b4cc: 2c 85 ldd r18, Y+12 ; 0x0c b4ce: 3d 85 ldd r19, Y+13 ; 0x0d b4d0: 52 16 cp r5, r18 b4d2: 13 06 cpc r1, r19 b4d4: 09 f0 breq .+2 ; 0xb4d8 b4d6: a8 f4 brcc .+42 ; 0xb502 b4d8: e5 2c mov r14, r5 b4da: 2b c0 rjmp .+86 ; 0xb532 b4dc: 35 01 movw r6, r10 b4de: 32 e0 ldi r19, 0x02 ; 2 b4e0: 63 0e add r6, r19 b4e2: 71 1c adc r7, r1 b4e4: f5 01 movw r30, r10 b4e6: a0 80 ld r10, Z b4e8: b1 80 ldd r11, Z+1 ; 0x01 b4ea: 6f 2d mov r22, r15 b4ec: 70 e0 ldi r23, 0x00 ; 0 b4ee: 06 fd sbrc r16, 6 b4f0: 02 c0 rjmp .+4 ; 0xb4f6 b4f2: 6f ef ldi r22, 0xFF ; 255 b4f4: 7f ef ldi r23, 0xFF ; 255 b4f6: c5 01 movw r24, r10 b4f8: 0f 94 30 db call 0x3b660 ; 0x3b660 b4fc: 9d 87 std Y+13, r25 ; 0x0d b4fe: 8c 87 std Y+12, r24 ; 0x0c b500: e2 cf rjmp .-60 ; 0xb4c6 b502: b6 01 movw r22, r12 b504: 80 e2 ldi r24, 0x20 ; 32 b506: 90 e0 ldi r25, 0x00 ; 0 b508: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b50c: 5a 94 dec r5 b50e: de cf rjmp .-68 ; 0xb4cc b510: f5 01 movw r30, r10 b512: 07 fd sbrc r16, 7 b514: 85 91 lpm r24, Z+ b516: 07 ff sbrs r16, 7 b518: 81 91 ld r24, Z+ b51a: 5f 01 movw r10, r30 b51c: b6 01 movw r22, r12 b51e: 90 e0 ldi r25, 0x00 ; 0 b520: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b524: e1 10 cpse r14, r1 b526: ea 94 dec r14 b528: 8c 85 ldd r24, Y+12 ; 0x0c b52a: 9d 85 ldd r25, Y+13 ; 0x0d b52c: 01 97 sbiw r24, 0x01 ; 1 b52e: 9d 87 std Y+13, r25 ; 0x0d b530: 8c 87 std Y+12, r24 ; 0x0c b532: ec 85 ldd r30, Y+12 ; 0x0c b534: fd 85 ldd r31, Y+13 ; 0x0d b536: ef 2b or r30, r31 b538: 59 f7 brne .-42 ; 0xb510 b53a: 78 ce rjmp .-784 ; 0xb22c b53c: 84 36 cpi r24, 0x64 ; 100 b53e: 19 f0 breq .+6 ; 0xb546 b540: 89 36 cpi r24, 0x69 ; 105 b542: 09 f0 breq .+2 ; 0xb546 b544: 74 c0 rjmp .+232 ; 0xb62e b546: 35 01 movw r6, r10 b548: 07 ff sbrs r16, 7 b54a: 66 c0 rjmp .+204 ; 0xb618 b54c: f4 e0 ldi r31, 0x04 ; 4 b54e: 6f 0e add r6, r31 b550: 71 1c adc r7, r1 b552: f5 01 movw r30, r10 b554: 60 81 ld r22, Z b556: 71 81 ldd r23, Z+1 ; 0x01 b558: 82 81 ldd r24, Z+2 ; 0x02 b55a: 93 81 ldd r25, Z+3 ; 0x03 b55c: 10 2f mov r17, r16 b55e: 1f 76 andi r17, 0x6F ; 111 b560: 97 ff sbrs r25, 7 b562: 08 c0 rjmp .+16 ; 0xb574 b564: 90 95 com r25 b566: 80 95 com r24 b568: 70 95 com r23 b56a: 61 95 neg r22 b56c: 7f 4f sbci r23, 0xFF ; 255 b56e: 8f 4f sbci r24, 0xFF ; 255 b570: 9f 4f sbci r25, 0xFF ; 255 b572: 10 68 ori r17, 0x80 ; 128 b574: 2a e0 ldi r18, 0x0A ; 10 b576: 30 e0 ldi r19, 0x00 ; 0 b578: a4 01 movw r20, r8 b57a: 0f 94 9e dc call 0x3b93c ; 0x3b93c <__ultoa_invert> b57e: a8 2e mov r10, r24 b580: a8 18 sub r10, r8 b582: ba 2c mov r11, r10 b584: 01 2f mov r16, r17 b586: 16 ff sbrs r17, 6 b588: 0a c0 rjmp .+20 ; 0xb59e b58a: 0e 7f andi r16, 0xFE ; 254 b58c: af 14 cp r10, r15 b58e: 38 f4 brcc .+14 ; 0xb59e b590: 14 ff sbrs r17, 4 b592: 04 c0 rjmp .+8 ; 0xb59c b594: 12 fd sbrc r17, 2 b596: 02 c0 rjmp .+4 ; 0xb59c b598: 01 2f mov r16, r17 b59a: 0e 7e andi r16, 0xEE ; 238 b59c: bf 2c mov r11, r15 b59e: 04 ff sbrs r16, 4 b5a0: a3 c0 rjmp .+326 ; 0xb6e8 b5a2: fe 01 movw r30, r28 b5a4: ea 0d add r30, r10 b5a6: f1 1d adc r31, r1 b5a8: 80 81 ld r24, Z b5aa: 80 33 cpi r24, 0x30 ; 48 b5ac: 09 f0 breq .+2 ; 0xb5b0 b5ae: 95 c0 rjmp .+298 ; 0xb6da b5b0: 09 7e andi r16, 0xE9 ; 233 b5b2: f0 2f mov r31, r16 b5b4: f8 70 andi r31, 0x08 ; 8 b5b6: ef 2e mov r14, r31 b5b8: 03 fd sbrc r16, 3 b5ba: a5 c0 rjmp .+330 ; 0xb706 b5bc: 00 ff sbrs r16, 0 b5be: 9f c0 rjmp .+318 ; 0xb6fe b5c0: fa 2c mov r15, r10 b5c2: b5 14 cp r11, r5 b5c4: 10 f4 brcc .+4 ; 0xb5ca b5c6: f5 0c add r15, r5 b5c8: fb 18 sub r15, r11 b5ca: 04 ff sbrs r16, 4 b5cc: a2 c0 rjmp .+324 ; 0xb712 b5ce: b6 01 movw r22, r12 b5d0: 80 e3 ldi r24, 0x30 ; 48 b5d2: 90 e0 ldi r25, 0x00 ; 0 b5d4: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b5d8: 02 ff sbrs r16, 2 b5da: 09 c0 rjmp .+18 ; 0xb5ee b5dc: 88 e7 ldi r24, 0x78 ; 120 b5de: 90 e0 ldi r25, 0x00 ; 0 b5e0: 01 ff sbrs r16, 1 b5e2: 02 c0 rjmp .+4 ; 0xb5e8 b5e4: 88 e5 ldi r24, 0x58 ; 88 b5e6: 90 e0 ldi r25, 0x00 ; 0 b5e8: b6 01 movw r22, r12 b5ea: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b5ee: af 14 cp r10, r15 b5f0: 08 f4 brcc .+2 ; 0xb5f4 b5f2: 9b c0 rjmp .+310 ; 0xb72a b5f4: aa 94 dec r10 b5f6: 0a 2d mov r16, r10 b5f8: 10 e0 ldi r17, 0x00 ; 0 b5fa: 0f 5f subi r16, 0xFF ; 255 b5fc: 1f 4f sbci r17, 0xFF ; 255 b5fe: 08 0d add r16, r8 b600: 19 1d adc r17, r9 b602: f8 01 movw r30, r16 b604: 82 91 ld r24, -Z b606: 8f 01 movw r16, r30 b608: b6 01 movw r22, r12 b60a: 90 e0 ldi r25, 0x00 ; 0 b60c: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b610: 80 16 cp r8, r16 b612: 91 06 cpc r9, r17 b614: b1 f7 brne .-20 ; 0xb602 b616: 0a ce rjmp .-1004 ; 0xb22c b618: f2 e0 ldi r31, 0x02 ; 2 b61a: 6f 0e add r6, r31 b61c: 71 1c adc r7, r1 b61e: f5 01 movw r30, r10 b620: 60 81 ld r22, Z b622: 71 81 ldd r23, Z+1 ; 0x01 b624: 07 2e mov r0, r23 b626: 00 0c add r0, r0 b628: 88 0b sbc r24, r24 b62a: 99 0b sbc r25, r25 b62c: 97 cf rjmp .-210 ; 0xb55c b62e: 10 2f mov r17, r16 b630: 85 37 cpi r24, 0x75 ; 117 b632: a9 f4 brne .+42 ; 0xb65e b634: 1f 7e andi r17, 0xEF ; 239 b636: 2a e0 ldi r18, 0x0A ; 10 b638: 30 e0 ldi r19, 0x00 ; 0 b63a: 35 01 movw r6, r10 b63c: 17 ff sbrs r17, 7 b63e: 44 c0 rjmp .+136 ; 0xb6c8 b640: f4 e0 ldi r31, 0x04 ; 4 b642: 6f 0e add r6, r31 b644: 71 1c adc r7, r1 b646: f5 01 movw r30, r10 b648: 60 81 ld r22, Z b64a: 71 81 ldd r23, Z+1 ; 0x01 b64c: 82 81 ldd r24, Z+2 ; 0x02 b64e: 93 81 ldd r25, Z+3 ; 0x03 b650: a4 01 movw r20, r8 b652: 0f 94 9e dc call 0x3b93c ; 0x3b93c <__ultoa_invert> b656: a8 2e mov r10, r24 b658: a8 18 sub r10, r8 b65a: 1f 77 andi r17, 0x7F ; 127 b65c: 92 cf rjmp .-220 ; 0xb582 b65e: 19 7f andi r17, 0xF9 ; 249 b660: 8f 36 cpi r24, 0x6F ; 111 b662: 79 f1 breq .+94 ; 0xb6c2 b664: f0 f4 brcc .+60 ; 0xb6a2 b666: 88 35 cpi r24, 0x58 ; 88 b668: 39 f1 breq .+78 ; 0xb6b8 b66a: f6 01 movw r30, r12 b66c: 86 81 ldd r24, Z+6 ; 0x06 b66e: 97 81 ldd r25, Z+7 ; 0x07 b670: 2f 96 adiw r28, 0x0f ; 15 b672: 0f b6 in r0, 0x3f ; 63 b674: f8 94 cli b676: de bf out 0x3e, r29 ; 62 b678: 0f be out 0x3f, r0 ; 63 b67a: cd bf out 0x3d, r28 ; 61 b67c: df 91 pop r29 b67e: cf 91 pop r28 b680: 1f 91 pop r17 b682: 0f 91 pop r16 b684: ff 90 pop r15 b686: ef 90 pop r14 b688: df 90 pop r13 b68a: cf 90 pop r12 b68c: bf 90 pop r11 b68e: af 90 pop r10 b690: 9f 90 pop r9 b692: 8f 90 pop r8 b694: 7f 90 pop r7 b696: 6f 90 pop r6 b698: 5f 90 pop r5 b69a: 4f 90 pop r4 b69c: 3f 90 pop r3 b69e: 2f 90 pop r2 b6a0: 08 95 ret b6a2: 80 37 cpi r24, 0x70 ; 112 b6a4: 39 f0 breq .+14 ; 0xb6b4 b6a6: 88 37 cpi r24, 0x78 ; 120 b6a8: 01 f7 brne .-64 ; 0xb66a b6aa: 14 fd sbrc r17, 4 b6ac: 14 60 ori r17, 0x04 ; 4 b6ae: 20 e1 ldi r18, 0x10 ; 16 b6b0: 30 e0 ldi r19, 0x00 ; 0 b6b2: c3 cf rjmp .-122 ; 0xb63a b6b4: 10 61 ori r17, 0x10 ; 16 b6b6: f9 cf rjmp .-14 ; 0xb6aa b6b8: 04 fd sbrc r16, 4 b6ba: 16 60 ori r17, 0x06 ; 6 b6bc: 20 e1 ldi r18, 0x10 ; 16 b6be: 32 e0 ldi r19, 0x02 ; 2 b6c0: bc cf rjmp .-136 ; 0xb63a b6c2: 28 e0 ldi r18, 0x08 ; 8 b6c4: 30 e0 ldi r19, 0x00 ; 0 b6c6: b9 cf rjmp .-142 ; 0xb63a b6c8: f2 e0 ldi r31, 0x02 ; 2 b6ca: 6f 0e add r6, r31 b6cc: 71 1c adc r7, r1 b6ce: f5 01 movw r30, r10 b6d0: 60 81 ld r22, Z b6d2: 71 81 ldd r23, Z+1 ; 0x01 b6d4: 90 e0 ldi r25, 0x00 ; 0 b6d6: 80 e0 ldi r24, 0x00 ; 0 b6d8: bb cf rjmp .-138 ; 0xb650 b6da: 02 fd sbrc r16, 2 b6dc: 02 c0 rjmp .+4 ; 0xb6e2 b6de: b3 94 inc r11 b6e0: 68 cf rjmp .-304 ; 0xb5b2 b6e2: b3 94 inc r11 b6e4: b3 94 inc r11 b6e6: 65 cf rjmp .-310 ; 0xb5b2 b6e8: 80 2f mov r24, r16 b6ea: 86 78 andi r24, 0x86 ; 134 b6ec: 09 f4 brne .+2 ; 0xb6f0 b6ee: 61 cf rjmp .-318 ; 0xb5b2 b6f0: f6 cf rjmp .-20 ; 0xb6de b6f2: b6 01 movw r22, r12 b6f4: 80 e2 ldi r24, 0x20 ; 32 b6f6: 90 e0 ldi r25, 0x00 ; 0 b6f8: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b6fc: b3 94 inc r11 b6fe: b5 14 cp r11, r5 b700: c0 f3 brcs .-16 ; 0xb6f2 b702: e1 2c mov r14, r1 b704: 62 cf rjmp .-316 ; 0xb5ca b706: e5 2c mov r14, r5 b708: eb 18 sub r14, r11 b70a: b5 14 cp r11, r5 b70c: 08 f4 brcc .+2 ; 0xb710 b70e: 5d cf rjmp .-326 ; 0xb5ca b710: f8 cf rjmp .-16 ; 0xb702 b712: 80 2f mov r24, r16 b714: 86 78 andi r24, 0x86 ; 134 b716: 09 f4 brne .+2 ; 0xb71a b718: 6a cf rjmp .-300 ; 0xb5ee b71a: 8b e2 ldi r24, 0x2B ; 43 b71c: 01 ff sbrs r16, 1 b71e: 80 e2 ldi r24, 0x20 ; 32 b720: 07 fd sbrc r16, 7 b722: 8d e2 ldi r24, 0x2D ; 45 b724: b6 01 movw r22, r12 b726: 90 e0 ldi r25, 0x00 ; 0 b728: 60 cf rjmp .-320 ; 0xb5ea b72a: b6 01 movw r22, r12 b72c: 80 e3 ldi r24, 0x30 ; 48 b72e: 90 e0 ldi r25, 0x00 ; 0 b730: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b734: fa 94 dec r15 b736: 5b cf rjmp .-330 ; 0xb5ee b738: b6 01 movw r22, r12 b73a: 80 e2 ldi r24, 0x20 ; 32 b73c: 90 e0 ldi r25, 0x00 ; 0 b73e: 0f 94 77 db call 0x3b6ee ; 0x3b6ee b742: ea 94 dec r14 b744: 73 cd rjmp .-1306 ; 0xb22c b746: 24 e0 ldi r18, 0x04 ; 4 b748: e1 2c mov r14, r1 b74a: 25 15 cp r18, r5 b74c: 08 f0 brcs .+2 ; 0xb750 b74e: 36 cd rjmp .-1428 ; 0xb1bc b750: 84 e0 ldi r24, 0x04 ; 4 b752: 26 cd rjmp .-1460 ; 0xb1a0 0000b754 : 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 ( b754: 20 e0 ldi r18, 0x00 ; 0 b756: 30 e0 ldi r19, 0x00 ; 0 b758: 40 e8 ldi r20, 0x80 ; 128 b75a: 5f eb ldi r21, 0xBF ; 191 b75c: 60 91 ab 02 lds r22, 0x02AB ; 0x8002ab b760: 70 91 ac 02 lds r23, 0x02AC ; 0x8002ac b764: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad b768: 90 91 ae 02 lds r25, 0x02AE ; 0x8002ae b76c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> b770: 88 23 and r24, r24 b772: 21 f1 breq .+72 ; 0xb7bc (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b774: e0 91 6d 12 lds r30, 0x126D ; 0x80126d b778: f0 91 6e 12 lds r31, 0x126E ; 0x80126e b77c: e0 58 subi r30, 0x80 ; 128 b77e: 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) && ( b780: 80 81 ld r24, Z b782: 8b 7f andi r24, 0xFB ; 251 b784: 82 30 cpi r24, 0x02 ; 2 b786: d1 f4 brne .+52 ; 0xb7bc (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)); b788: 80 e1 ldi r24, 0x10 ; 16 b78a: eb ea ldi r30, 0xAB ; 171 b78c: f2 e0 ldi r31, 0x02 ; 2 b78e: a0 e4 ldi r26, 0x40 ; 64 b790: b7 e0 ldi r27, 0x07 ; 7 b792: 01 90 ld r0, Z+ b794: 0d 92 st X+, r0 b796: 8a 95 dec r24 b798: e1 f7 brne .-8 ; 0xb792 saved_start_position[0] = SAVED_START_POSITION_UNSET; b79a: 80 e0 ldi r24, 0x00 ; 0 b79c: 90 e0 ldi r25, 0x00 ; 0 b79e: a0 e8 ldi r26, 0x80 ; 128 b7a0: bf eb ldi r27, 0xBF ; 191 b7a2: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab b7a6: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac b7aa: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad b7ae: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae return saved_segment_idx; b7b2: 80 91 08 18 lds r24, 0x1808 ; 0x801808 b7b6: 90 91 09 18 lds r25, 0x1809 ; 0x801809 b7ba: 08 95 ret } else return 1; //begin with the first segment b7bc: 81 e0 ldi r24, 0x01 ; 1 b7be: 90 e0 ldi r25, 0x00 ; 0 } b7c0: 08 95 ret 0000b7c2 : 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) { b7c2: cf 92 push r12 b7c4: df 92 push r13 b7c6: ef 92 push r14 b7c8: ff 92 push r15 b7ca: 0f 93 push r16 b7cc: 1f 93 push r17 b7ce: cf 93 push r28 b7d0: 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); b7d2: 90 e0 ldi r25, 0x00 ; 0 b7d4: ec 01 movw r28, r24 b7d6: cc 0f add r28, r28 b7d8: dd 1f adc r29, r29 b7da: cc 0f add r28, r28 b7dc: dd 1f adc r29, r29 b7de: fe 01 movw r30, r28 b7e0: e6 57 subi r30, 0x76 ; 118 b7e2: 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); b7e4: 25 91 lpm r18, Z+ b7e6: 35 91 lpm r19, Z+ b7e8: 45 91 lpm r20, Z+ b7ea: 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]; b7ec: fe 01 movw r30, r28 b7ee: ed 53 subi r30, 0x3D ; 61 b7f0: f9 4f sbci r31, 0xF9 ; 249 b7f2: c0 80 ld r12, Z b7f4: d1 80 ldd r13, Z+1 ; 0x01 b7f6: e2 80 ldd r14, Z+2 ; 0x02 b7f8: f3 80 ldd r15, Z+3 ; 0x03 b7fa: 8e 01 movw r16, r28 b7fc: 00 5c subi r16, 0xC0 ; 192 b7fe: 18 4f sbci r17, 0xF8 ; 248 b800: c7 01 movw r24, r14 b802: b6 01 movw r22, r12 b804: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> b808: f8 01 movw r30, r16 b80a: 60 83 st Z, r22 b80c: 71 83 std Z+1, r23 ; 0x01 b80e: 82 83 std Z+2, r24 ; 0x02 b810: 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); b812: fe 01 movw r30, r28 b814: e2 58 subi r30, 0x82 ; 130 b816: 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); b818: 25 91 lpm r18, Z+ b81a: 35 91 lpm r19, Z+ b81c: 45 91 lpm r20, Z+ b81e: 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]; b820: 8e 01 movw r16, r28 b822: 0f 5d subi r16, 0xDF ; 223 b824: 1d 4f sbci r17, 0xFD ; 253 b826: c7 01 movw r24, r14 b828: b6 01 movw r22, r12 b82a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> b82e: f8 01 movw r30, r16 b830: 60 83 st Z, r22 b832: 71 83 std Z+1, r23 ; 0x01 b834: 82 83 std Z+2, r24 ; 0x02 b836: 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); b838: fe 01 movw r30, r28 b83a: ee 58 subi r30, 0x8E ; 142 b83c: 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); b83e: 25 91 lpm r18, Z+ b840: 35 91 lpm r19, Z+ b842: 45 91 lpm r20, Z+ b844: 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]; b846: cb 5e subi r28, 0xEB ; 235 b848: dd 4f sbci r29, 0xFD ; 253 b84a: c7 01 movw r24, r14 b84c: b6 01 movw r22, r12 b84e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> b852: 68 83 st Y, r22 b854: 79 83 std Y+1, r23 ; 0x01 b856: 8a 83 std Y+2, r24 ; 0x02 b858: 9b 83 std Y+3, r25 ; 0x03 } b85a: df 91 pop r29 b85c: cf 91 pop r28 b85e: 1f 91 pop r17 b860: 0f 91 pop r16 b862: ff 90 pop r15 b864: ef 90 pop r14 b866: df 90 pop r13 b868: cf 90 pop r12 b86a: 08 95 ret 0000b86c : 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)); } b86c: 80 e1 ldi r24, 0x10 ; 16 b86e: e1 e5 ldi r30, 0x51 ; 81 b870: f5 e0 ldi r31, 0x05 ; 5 b872: a0 e4 ldi r26, 0x40 ; 64 b874: b7 e0 ldi r27, 0x07 ; 7 b876: 01 90 ld r0, Z+ b878: 0d 92 st X+, r0 b87a: 8a 95 dec r24 b87c: e1 f7 brne .-8 ; 0xb876 b87e: 08 95 ret 0000b880 : /// @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)); b880: ed ef ldi r30, 0xFD ; 253 b882: fc e7 ldi r31, 0x7C ; 124 b884: 83 30 cpi r24, 0x03 ; 3 b886: 21 f0 breq .+8 ; 0xb890 b888: e8 2f mov r30, r24 b88a: f0 e0 ldi r31, 0x00 ; 0 b88c: e6 50 subi r30, 0x06 ; 6 b88e: f3 48 sbci r31, 0x83 ; 131 b890: 84 91 lpm r24, Z } b892: 08 95 ret 0000b894 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b894: 40 91 7e 10 lds r20, 0x107E ; 0x80107e b898: 50 91 7f 10 lds r21, 0x107F ; 0x80107f return 0; b89c: 90 e0 ldi r25, 0x00 ; 0 b89e: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b8a0: 41 15 cp r20, r1 b8a2: 51 05 cpc r21, r1 b8a4: b1 f1 breq .+108 ; 0xb912 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b8a6: 20 91 6d 12 lds r18, 0x126D ; 0x80126d b8aa: 30 91 6e 12 lds r19, 0x126E ; 0x80126e char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b8ae: 90 e0 ldi r25, 0x00 ; 0 b8b0: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b8b2: f9 01 movw r30, r18 b8b4: e0 58 subi r30, 0x80 ; 128 b8b6: ff 4e sbci r31, 0xEF ; 239 b8b8: a0 81 ld r26, Z b8ba: a2 30 cpi r26, 0x02 ; 2 b8bc: 21 f4 brne .+8 ; 0xb8c6 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b8be: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b8c0: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b8c2: 86 0f add r24, r22 b8c4: 97 1f adc r25, r23 } if (-- _buflen == 0) b8c6: 41 50 subi r20, 0x01 ; 1 b8c8: 51 09 sbc r21, r1 b8ca: 19 f1 breq .+70 ; 0xb912 b8cc: f9 01 movw r30, r18 b8ce: ed 57 subi r30, 0x7D ; 125 b8d0: 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) ; b8d2: a1 91 ld r26, Z+ b8d4: 9f 01 movw r18, r30 b8d6: 20 58 subi r18, 0x80 ; 128 b8d8: 30 41 sbci r19, 0x10 ; 16 b8da: a1 11 cpse r26, r1 b8dc: fa cf rjmp .-12 ; 0xb8d2 b8de: f9 01 movw r30, r18 b8e0: e0 58 subi r30, 0x80 ; 128 b8e2: 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) ; b8e4: 2d 3e cpi r18, 0xED ; 237 b8e6: a1 e0 ldi r26, 0x01 ; 1 b8e8: 3a 07 cpc r19, r26 b8ea: 30 f4 brcc .+12 ; 0xb8f8 b8ec: a1 91 ld r26, Z+ b8ee: a1 11 cpse r26, r1 b8f0: e0 cf rjmp .-64 ; 0xb8b2 b8f2: 2f 5f subi r18, 0xFF ; 255 b8f4: 3f 4f sbci r19, 0xFF ; 255 b8f6: f6 cf rjmp .-20 ; 0xb8e4 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b8f8: 2d 3e cpi r18, 0xED ; 237 b8fa: e1 e0 ldi r30, 0x01 ; 1 b8fc: 3e 07 cpc r19, r30 b8fe: c9 f6 brne .-78 ; 0xb8b2 b900: e0 e8 ldi r30, 0x80 ; 128 b902: f0 e1 ldi r31, 0x10 ; 16 b904: 9f 01 movw r18, r30 b906: 20 58 subi r18, 0x80 ; 128 b908: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b90a: a1 91 ld r26, Z+ b90c: aa 23 and r26, r26 b90e: d1 f3 breq .-12 ; 0xb904 b910: d0 cf rjmp .-96 ; 0xb8b2 } } return sdlen; } b912: 08 95 ret 0000b914 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b914: 98 2f mov r25, r24 b916: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b918: 83 ff sbrs r24, 3 b91a: 0d c0 rjmp .+26 ; 0xb936 b91c: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b920: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b922: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b926: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b92a: 88 7f andi r24, 0xF8 ; 248 b92c: 97 70 andi r25, 0x07 ; 7 b92e: 89 2b or r24, r25 b930: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b934: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b936: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b93a: 87 7f andi r24, 0xF7 ; 247 b93c: f2 cf rjmp .-28 ; 0xb922 0000b93e : 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)); }; b93e: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b942: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b946: 4a e0 ldi r20, 0x0A ; 10 b948: 50 e0 ldi r21, 0x00 ; 0 b94a: 70 e0 ldi r23, 0x00 ; 0 b94c: 60 e0 ldi r22, 0x00 ; 0 b94e: 01 96 adiw r24, 0x01 ; 1 b950: 0f 94 9a d8 call 0x3b134 ; 0x3b134 b954: 86 2f mov r24, r22 b956: 08 95 ret 0000b958 : // 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)); }; b958: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b95c: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b960: 4a e0 ldi r20, 0x0A ; 10 b962: 50 e0 ldi r21, 0x00 ; 0 b964: 70 e0 ldi r23, 0x00 ; 0 b966: 60 e0 ldi r22, 0x00 ; 0 b968: 01 96 adiw r24, 0x01 ; 1 b96a: 0f 94 9a d8 call 0x3b134 ; 0x3b134 b96e: cb 01 movw r24, r22 b970: 08 95 ret 0000b972 : // 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); } b972: 80 91 93 03 lds r24, 0x0393 ; 0x800393 b976: 90 91 94 03 lds r25, 0x0394 ; 0x800394 b97a: 4a e0 ldi r20, 0x0A ; 10 b97c: 50 e0 ldi r21, 0x00 ; 0 b97e: 70 e0 ldi r23, 0x00 ; 0 b980: 60 e0 ldi r22, 0x00 ; 0 b982: 01 96 adiw r24, 0x01 ; 1 b984: 0d 94 9a d8 jmp 0x3b134 ; 0x3b134 0000b988 : // 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; b988: 80 91 92 04 lds r24, 0x0492 ; 0x800492 b98c: 90 91 93 04 lds r25, 0x0493 ; 0x800493 b990: 90 93 91 04 sts 0x0491, r25 ; 0x800491 b994: 80 93 90 04 sts 0x0490, r24 ; 0x800490 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); b998: 88 ee ldi r24, 0xE8 ; 232 b99a: 9e e6 ldi r25, 0x6E ; 110 b99c: 9f 93 push r25 b99e: 8f 93 push r24 b9a0: 80 91 78 03 lds r24, 0x0378 ; 0x800378 b9a4: 90 91 79 03 lds r25, 0x0379 ; 0x800379 b9a8: a0 91 7a 03 lds r26, 0x037A ; 0x80037a b9ac: b0 91 7b 03 lds r27, 0x037B ; 0x80037b b9b0: 01 96 adiw r24, 0x01 ; 1 b9b2: a1 1d adc r26, r1 b9b4: b1 1d adc r27, r1 b9b6: bf 93 push r27 b9b8: af 93 push r26 b9ba: 9f 93 push r25 b9bc: 8f 93 push r24 b9be: 85 ee ldi r24, 0xE5 ; 229 b9c0: 97 e6 ldi r25, 0x67 ; 103 b9c2: 9f 93 push r25 b9c4: 8f 93 push r24 b9c6: 8c ee ldi r24, 0xEC ; 236 b9c8: 97 e6 ldi r25, 0x67 ; 103 b9ca: 9f 93 push r25 b9cc: 8f 93 push r24 b9ce: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 b9d2: 8d b7 in r24, 0x3d ; 61 b9d4: 9e b7 in r25, 0x3e ; 62 b9d6: 0a 96 adiw r24, 0x0a ; 10 b9d8: 0f b6 in r0, 0x3f ; 63 b9da: f8 94 cli b9dc: 9e bf out 0x3e, r25 ; 62 b9de: 0f be out 0x3f, r0 ; 63 b9e0: 8d bf out 0x3d, r24 ; 61 } b9e2: 08 95 ret 0000b9e4 : 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) { b9e4: 0f 93 push r16 b9e6: 1f 93 push r17 b9e8: cf 93 push r28 b9ea: df 93 push r29 b9ec: ec 01 movw r28, r24 b9ee: c6 0f add r28, r22 b9f0: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b9f2: 8c 17 cp r24, r28 b9f4: 9d 07 cpc r25, r29 b9f6: 79 f0 breq .+30 ; 0xba16 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b9f8: 8c 01 movw r16, r24 b9fa: 0f 5f subi r16, 0xFF ; 255 b9fc: 1f 4f sbci r17, 0xFF ; 255 b9fe: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e ba02: 8f 3f cpi r24, 0xFF ; 255 ba04: 31 f0 breq .+12 ; 0xba12 return true; ba06: 81 e0 ldi r24, 0x01 ; 1 } return false; } ba08: df 91 pop r29 ba0a: cf 91 pop r28 ba0c: 1f 91 pop r17 ba0e: 0f 91 pop r16 ba10: 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) ba12: c8 01 movw r24, r16 ba14: ee cf rjmp .-36 ; 0xb9f2 return true; } return false; ba16: 80 e0 ldi r24, 0x00 ; 0 ba18: f7 cf rjmp .-18 ; 0xba08 0000ba1a : #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; } ba1a: 68 2f mov r22, r24 ba1c: 88 0f add r24, r24 ba1e: 77 0b sbc r23, r23 ba20: 80 91 6d 12 lds r24, 0x126D ; 0x80126d ba24: 90 91 6e 12 lds r25, 0x126E ; 0x80126e ba28: 8d 57 subi r24, 0x7D ; 125 ba2a: 9f 4e sbci r25, 0xEF ; 239 ba2c: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc ba30: 9c 01 movw r18, r24 ba32: 90 93 94 03 sts 0x0394, r25 ; 0x800394 ba36: 80 93 93 03 sts 0x0393, r24 ; 0x800393 ba3a: 81 e0 ldi r24, 0x01 ; 1 ba3c: 23 2b or r18, r19 ba3e: 09 f4 brne .+2 ; 0xba42 ba40: 80 e0 ldi r24, 0x00 ; 0 ba42: 08 95 ret 0000ba44 : #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 { ba44: 0f 93 push r16 ba46: 1f 93 push r17 ba48: cf 93 push r28 ba4a: df 93 push r29 ba4c: 8c 01 movw r16, r24 ba4e: 86 2f mov r24, r22 ba50: ea 01 movw r28, r20 if (code_seen(code)) { ba52: 0e 94 0d 5d call 0xba1a ; 0xba1a ba56: 88 23 and r24, r24 ba58: 19 f1 breq .+70 ; 0xbaa0 // Verify value is within allowed range int16_t temp = code_value_short(); ba5a: 0e 94 ac 5c call 0xb958 ; 0xb958 if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { ba5e: 9c 01 movw r18, r24 ba60: 97 ff sbrs r25, 7 ba62: 03 c0 rjmp .+6 ; 0xba6a ba64: 31 95 neg r19 ba66: 21 95 neg r18 ba68: 31 09 sbc r19, r1 ba6a: 25 36 cpi r18, 0x65 ; 101 ba6c: 31 05 cpc r19, r1 ba6e: 9c f0 brlt .+38 ; 0xba96 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); ba70: 9f 93 push r25 ba72: 8f 93 push r24 ba74: 8c ee ldi r24, 0xEC ; 236 ba76: 9a ea ldi r25, 0xAA ; 170 ba78: 9f 93 push r25 ba7a: 8f 93 push r24 ba7c: 8f ee ldi r24, 0xEF ; 239 ba7e: 9d e7 ldi r25, 0x7D ; 125 ba80: 9f 93 push r25 ba82: 8f 93 push r24 ba84: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 ba88: 0f 90 pop r0 ba8a: 0f 90 pop r0 ba8c: 0f 90 pop r0 ba8e: 0f 90 pop r0 ba90: 0f 90 pop r0 ba92: 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; ba94: 80 e0 ldi r24, 0x00 ; 0 }; ba96: df 91 pop r29 ba98: cf 91 pop r28 ba9a: 1f 91 pop r17 ba9c: 0f 91 pop r16 ba9e: 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) { baa0: f8 01 movw r30, r16 baa2: 80 81 ld r24, Z baa4: 88 23 and r24, r24 baa6: b1 f3 breq .-20 ; 0xba94 return (int8_t)eeprom_read_byte(eep_address); baa8: ce 01 movw r24, r28 } return 0; }; baaa: df 91 pop r29 baac: cf 91 pop r28 baae: 1f 91 pop r17 bab0: 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); bab2: 0d 94 0f dd jmp 0x3ba1e ; 0x3ba1e 0000bab6 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); bab6: 60 e0 ldi r22, 0x00 ; 0 bab8: 86 e6 ldi r24, 0x66 ; 102 baba: 9f e0 ldi r25, 0x0F ; 15 babc: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 bac0: 60 e0 ldi r22, 0x00 ; 0 bac2: 88 e6 ldi r24, 0x68 ; 104 bac4: 9f e0 ldi r25, 0x0F ; 15 bac6: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 baca: 60 e0 ldi r22, 0x00 ; 0 bacc: 85 e6 ldi r24, 0x65 ; 101 bace: 9f e0 ldi r25, 0x0F ; 15 bad0: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 bad4: 60 e0 ldi r22, 0x00 ; 0 bad6: 84 e6 ldi r24, 0x64 ; 100 bad8: 9f e0 ldi r25, 0x0F ; 15 bada: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 bade: 60 e0 ldi r22, 0x00 ; 0 bae0: 82 ed ldi r24, 0xD2 ; 210 bae2: 9e e0 ldi r25, 0x0E ; 14 bae4: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 bae8: 60 e0 ldi r22, 0x00 ; 0 baea: 8f ec ldi r24, 0xCF ; 207 baec: 9e e0 ldi r25, 0x0E ; 14 baee: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0000baf2 : return altfanStatus.isAltfan; } void altfanOverride_toggle() { altfanStatus.altfanOverride = !altfanStatus.altfanOverride; baf2: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> baf6: 81 fb bst r24, 1 baf8: 66 27 eor r22, r22 bafa: 60 f9 bld r22, 0 bafc: 91 e0 ldi r25, 0x01 ; 1 bafe: 69 27 eor r22, r25 bb00: 60 fb bst r22, 0 bb02: 81 f9 bld r24, 1 bb04: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> bb08: 8b e2 ldi r24, 0x2B ; 43 bb0a: 9d e0 ldi r25, 0x0D ; 13 bb0c: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0000bb10 : // 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) bb10: 80 36 cpi r24, 0x60 ; 96 bb12: 91 05 cpc r25, r1 bb14: f8 f4 brcc .+62 ; 0xbb54 return false; if (bufindr == bufindw && buflen > 0) bb16: 40 91 6d 12 lds r20, 0x126D ; 0x80126d bb1a: 50 91 6e 12 lds r21, 0x126E ; 0x80126e bb1e: 20 91 7b 10 lds r18, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> bb22: 30 91 7c 10 lds r19, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> bb26: 42 17 cp r20, r18 bb28: 53 07 cpc r21, r19 bb2a: 39 f4 brne .+14 ; 0xbb3a bb2c: 60 91 7e 10 lds r22, 0x107E ; 0x80107e bb30: 70 91 7f 10 lds r23, 0x107F ; 0x80107f bb34: 16 16 cp r1, r22 bb36: 17 06 cpc r1, r23 bb38: 6c f0 brlt .+26 ; 0xbb54 // 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); bb3a: b9 01 movw r22, r18 bb3c: 68 0f add r22, r24 bb3e: 79 1f adc r23, r25 bb40: fb 01 movw r30, r22 bb42: e3 59 subi r30, 0x93 ; 147 bb44: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) bb46: 24 17 cp r18, r20 bb48: 35 07 cpc r19, r21 bb4a: 30 f4 brcc .+12 ; 0xbb58 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; bb4c: 81 e0 ldi r24, 0x01 ; 1 bb4e: 4e 17 cp r20, r30 bb50: 5f 07 cpc r21, r31 bb52: 08 f4 brcc .+2 ; 0xbb56 // 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; bb54: 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; } bb56: 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? bb58: ee 3e cpi r30, 0xEE ; 238 bb5a: f1 40 sbci r31, 0x01 ; 1 bb5c: f8 f0 brcs .+62 ; 0xbb9c // 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); bb5e: 6c 5f subi r22, 0xFC ; 252 bb60: 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) || bb62: 6e 3e cpi r22, 0xEE ; 238 bb64: 71 40 sbci r23, 0x01 ; 1 bb66: 18 f4 brcc .+6 ; 0xbb6e // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) bb68: 49 36 cpi r20, 0x69 ; 105 bb6a: 51 05 cpc r21, r1 bb6c: b8 f4 brcc .+46 ; 0xbb9c return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { bb6e: 83 59 subi r24, 0x93 ; 147 bb70: 9f 4f sbci r25, 0xFF ; 255 bb72: 48 17 cp r20, r24 bb74: 59 07 cpc r21, r25 bb76: 70 f3 brcs .-36 ; 0xbb54 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); bb78: 4d ee ldi r20, 0xED ; 237 bb7a: 51 e0 ldi r21, 0x01 ; 1 bb7c: 42 1b sub r20, r18 bb7e: 53 0b sbc r21, r19 bb80: 70 e0 ldi r23, 0x00 ; 0 bb82: 60 e0 ldi r22, 0x00 ; 0 bb84: c9 01 movw r24, r18 bb86: 80 58 subi r24, 0x80 ; 128 bb88: 9f 4e sbci r25, 0xEF ; 239 bb8a: 0f 94 41 e3 call 0x3c682 ; 0x3c682 // 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; } bb8e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); bb90: f8 94 cli bb92: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> bb96: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.568> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; bb9a: 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; bb9c: 81 e0 ldi r24, 0x01 ; 1 bb9e: 08 95 ret 0000bba0 : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { bba0: 2f 92 push r2 bba2: 3f 92 push r3 bba4: 4f 92 push r4 bba6: 5f 92 push r5 bba8: 6f 92 push r6 bbaa: 7f 92 push r7 bbac: 8f 92 push r8 bbae: 9f 92 push r9 bbb0: af 92 push r10 bbb2: bf 92 push r11 bbb4: cf 92 push r12 bbb6: df 92 push r13 bbb8: ef 92 push r14 bbba: ff 92 push r15 bbbc: 0f 93 push r16 bbbe: 1f 93 push r17 bbc0: cf 93 push r28 bbc2: df 93 push r29 bbc4: cd b7 in r28, 0x3d ; 61 bbc6: de b7 in r29, 0x3e ; 62 bbc8: cc 58 subi r28, 0x8C ; 140 bbca: d2 40 sbci r29, 0x02 ; 2 bbcc: 0f b6 in r0, 0x3f ; 63 bbce: f8 94 cli bbd0: de bf out 0x3e, r29 ; 62 bbd2: 0f be out 0x3f, r0 ; 63 bbd4: cd bf out 0x3d, r28 ; 61 bbd6: cb 58 subi r28, 0x8B ; 139 bbd8: dd 4f sbci r29, 0xFD ; 253 bbda: 68 83 st Y, r22 bbdc: 79 83 std Y+1, r23 ; 0x01 bbde: 8a 83 std Y+2, r24 ; 0x02 bbe0: 9b 83 std Y+3, r25 ; 0x03 bbe2: c5 57 subi r28, 0x75 ; 117 bbe4: 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; bbe6: fe 01 movw r30, r28 bbe8: e7 54 subi r30, 0x47 ; 71 bbea: fe 4f sbci r31, 0xFE ; 254 bbec: 88 e2 ldi r24, 0x28 ; 40 bbee: df 01 movw r26, r30 bbf0: 1d 92 st X+, r1 bbf2: 8a 95 dec r24 bbf4: e9 f7 brne .-6 ; 0xbbf0 bbf6: e8 5b subi r30, 0xB8 ; 184 bbf8: f1 40 sbci r31, 0x01 ; 1 bbfa: 1f 01 movw r2, r30 bbfc: 80 e9 ldi r24, 0x90 ; 144 bbfe: 91 e0 ldi r25, 0x01 ; 1 bc00: df 01 movw r26, r30 bc02: fc 01 movw r30, r24 bc04: 1d 92 st X+, r1 bc06: 31 97 sbiw r30, 0x01 ; 1 bc08: e9 f7 brne .-6 ; 0xbc04 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; bc0a: c7 5a subi r28, 0xA7 ; 167 bc0c: dd 4f sbci r29, 0xFD ; 253 bc0e: 19 82 std Y+1, r1 ; 0x01 bc10: 18 82 st Y, r1 bc12: c9 55 subi r28, 0x59 ; 89 bc14: d2 40 sbci r29, 0x02 ; 2 bc16: 9e 01 movw r18, r28 bc18: 2f 51 subi r18, 0x1F ; 31 bc1a: 3e 4f sbci r19, 0xFE ; 254 bc1c: c1 59 subi r28, 0x91 ; 145 bc1e: dd 4f sbci r29, 0xFD ; 253 bc20: 39 83 std Y+1, r19 ; 0x01 bc22: 28 83 st Y, r18 bc24: cf 56 subi r28, 0x6F ; 111 bc26: d2 40 sbci r29, 0x02 ; 2 bc28: 8e 01 movw r16, r28 bc2a: 07 5a subi r16, 0xA7 ; 167 bc2c: 1d 4f sbci r17, 0xFD ; 253 bc2e: ce 01 movw r24, r28 bc30: 8f 5c subi r24, 0xCF ; 207 bc32: 9d 4f sbci r25, 0xFD ; 253 bc34: c3 59 subi r28, 0x93 ; 147 bc36: dd 4f sbci r29, 0xFD ; 253 bc38: 99 83 std Y+1, r25 ; 0x01 bc3a: 88 83 st Y, r24 bc3c: cd 56 subi r28, 0x6D ; 109 bc3e: d2 40 sbci r29, 0x02 ; 2 bc40: 3c 01 movw r6, r24 bc42: 49 01 movw r8, r18 bc44: 40 eb ldi r20, 0xB0 ; 176 bc46: a4 2e mov r10, r20 bc48: 4f e0 ldi r20, 0x0F ; 15 bc4a: b4 2e mov r11, r20 bc4c: 53 e2 ldi r21, 0x23 ; 35 bc4e: c5 2e mov r12, r21 bc50: d1 2c mov r13, r1 for (i = 0; i < n; i++) { bc52: f1 2c mov r15, r1 bc54: 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]; bc56: b6 01 movw r22, r12 bc58: 0d 2c mov r0, r13 bc5a: 00 0c add r0, r0 bc5c: 88 0b sbc r24, r24 bc5e: 99 0b sbc r25, r25 bc60: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> bc64: d4 01 movw r26, r8 bc66: 6d 93 st X+, r22 bc68: 7d 93 st X+, r23 bc6a: 8d 93 st X+, r24 bc6c: 9d 93 st X+, r25 bc6e: 4d 01 movw r8, r26 f[i] = (float)shift[i]; bc70: f8 01 movw r30, r16 bc72: 61 91 ld r22, Z+ bc74: 71 91 ld r23, Z+ bc76: 8f 01 movw r16, r30 bc78: 07 2e mov r0, r23 bc7a: 00 0c add r0, r0 bc7c: 88 0b sbc r24, r24 bc7e: 99 0b sbc r25, r25 bc80: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> bc84: d3 01 movw r26, r6 bc86: 6d 93 st X+, r22 bc88: 7d 93 st X+, r23 bc8a: 8d 93 st X+, r24 bc8c: 9d 93 st X+, r25 bc8e: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { bc90: bf ef ldi r27, 0xFF ; 255 bc92: eb 1a sub r14, r27 bc94: fb 0a sbc r15, r27 bc96: e6 e0 ldi r30, 0x06 ; 6 bc98: ee 16 cp r14, r30 bc9a: f1 04 cpc r15, r1 bc9c: 09 f0 breq .+2 ; 0xbca0 bc9e: 38 c3 rjmp .+1648 ; 0xc310 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; bca0: cb 58 subi r28, 0x8B ; 139 bca2: dd 4f sbci r29, 0xFD ; 253 bca4: 28 81 ld r18, Y bca6: 39 81 ldd r19, Y+1 ; 0x01 bca8: 4a 81 ldd r20, Y+2 ; 0x02 bcaa: 5b 81 ldd r21, Y+3 ; 0x03 bcac: c5 57 subi r28, 0x75 ; 117 bcae: d2 40 sbci r29, 0x02 ; 2 bcb0: c1 59 subi r28, 0x91 ; 145 bcb2: dd 4f sbci r29, 0xFD ; 253 bcb4: a8 81 ld r26, Y bcb6: b9 81 ldd r27, Y+1 ; 0x01 bcb8: cf 56 subi r28, 0x6F ; 111 bcba: d2 40 sbci r29, 0x02 ; 2 bcbc: 6d 91 ld r22, X+ bcbe: 7d 91 ld r23, X+ bcc0: 8d 91 ld r24, X+ bcc2: 9c 91 ld r25, X bcc4: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> bcc8: 41 2c mov r4, r1 bcca: 51 2c mov r5, r1 bccc: 32 01 movw r6, r4 bcce: 18 16 cp r1, r24 bcd0: 0c f4 brge .+2 ; 0xbcd4 bcd2: 02 c3 rjmp .+1540 ; 0xc2d8 bcd4: c3 59 subi r28, 0x93 ; 147 bcd6: dd 4f sbci r29, 0xFD ; 253 bcd8: 08 81 ld r16, Y bcda: 19 81 ldd r17, Y+1 ; 0x01 bcdc: cd 56 subi r28, 0x6D ; 109 bcde: d2 40 sbci r29, 0x02 ; 2 bce0: 0c 5e subi r16, 0xEC ; 236 bce2: 1f 4f sbci r17, 0xFF ; 255 bce4: c1 59 subi r28, 0x91 ; 145 bce6: dd 4f sbci r29, 0xFD ; 253 bce8: e8 80 ld r14, Y bcea: f9 80 ldd r15, Y+1 ; 0x01 bcec: cf 56 subi r28, 0x6F ; 111 bcee: d2 40 sbci r29, 0x02 ; 2 bcf0: b4 e1 ldi r27, 0x14 ; 20 bcf2: eb 0e add r14, r27 bcf4: f1 1c adc r15, r1 bcf6: 6e 01 movw r12, r28 bcf8: ef ed ldi r30, 0xDF ; 223 bcfa: ce 1a sub r12, r30 bcfc: ed ef ldi r30, 0xFD ; 253 bcfe: de 0a sbc r13, r30 bd00: 9e 01 movw r18, r28 bd02: 2b 55 subi r18, 0x5B ; 91 bd04: 3e 4f sbci r19, 0xFE ; 254 bd06: cf 58 subi r28, 0x8F ; 143 bd08: dd 4f sbci r29, 0xFD ; 253 bd0a: 39 83 std Y+1, r19 ; 0x01 bd0c: 28 83 st Y, r18 bd0e: c1 57 subi r28, 0x71 ; 113 bd10: 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]); bd12: d8 01 movw r26, r16 bd14: 4d 90 ld r4, X+ bd16: 5d 90 ld r5, X+ bd18: 6d 90 ld r6, X+ bd1a: 7c 90 ld r7, X bd1c: f7 01 movw r30, r14 bd1e: 60 81 ld r22, Z bd20: 71 81 ldd r23, Z+1 ; 0x01 bd22: 82 81 ldd r24, Z+2 ; 0x02 bd24: 93 81 ldd r25, Z+3 ; 0x03 bd26: d7 01 movw r26, r14 bd28: 5e 91 ld r21, -X bd2a: 4e 91 ld r20, -X bd2c: 3e 91 ld r19, -X bd2e: 2e 91 ld r18, -X bd30: 7d 01 movw r14, r26 bd32: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> bd36: 4b 01 movw r8, r22 bd38: 5c 01 movw r10, r24 bd3a: f8 01 movw r30, r16 bd3c: 52 91 ld r21, -Z bd3e: 42 91 ld r20, -Z bd40: 32 91 ld r19, -Z bd42: 22 91 ld r18, -Z bd44: 8f 01 movw r16, r30 bd46: c3 01 movw r24, r6 bd48: b2 01 movw r22, r4 bd4a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> bd4e: a5 01 movw r20, r10 bd50: 94 01 movw r18, r8 bd52: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> bd56: d6 01 movw r26, r12 bd58: 9e 93 st -X, r25 bd5a: 8e 93 st -X, r24 bd5c: 7e 93 st -X, r23 bd5e: 6e 93 st -X, r22 bd60: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; bd62: cf 58 subi r28, 0x8F ; 143 bd64: dd 4f sbci r29, 0xFD ; 253 bd66: e8 81 ld r30, Y bd68: f9 81 ldd r31, Y+1 ; 0x01 bd6a: c1 57 subi r28, 0x71 ; 113 bd6c: d2 40 sbci r29, 0x02 ; 2 bd6e: b2 92 st -Z, r11 bd70: a2 92 st -Z, r10 bd72: 92 92 st -Z, r9 bd74: 82 92 st -Z, r8 bd76: cf 58 subi r28, 0x8F ; 143 bd78: dd 4f sbci r29, 0xFD ; 253 bd7a: f9 83 std Y+1, r31 ; 0x01 bd7c: e8 83 st Y, r30 bd7e: c1 57 subi r28, 0x71 ; 113 bd80: 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--) { bd82: c3 59 subi r28, 0x93 ; 147 bd84: dd 4f sbci r29, 0xFD ; 253 bd86: 28 81 ld r18, Y bd88: 39 81 ldd r19, Y+1 ; 0x01 bd8a: cd 56 subi r28, 0x6D ; 109 bd8c: d2 40 sbci r29, 0x02 ; 2 bd8e: 02 17 cp r16, r18 bd90: 13 07 cpc r17, r19 bd92: 09 f0 breq .+2 ; 0xbd96 bd94: be cf rjmp .-132 ; 0xbd12 bd96: 4e 01 movw r8, r28 bd98: 3f e6 ldi r19, 0x6F ; 111 bd9a: 83 1a sub r8, r19 bd9c: 3e ef ldi r19, 0xFE ; 254 bd9e: 93 0a sbc r9, r19 bda0: 5e 01 movw r10, r28 bda2: 83 ef ldi r24, 0xF3 ; 243 bda4: a8 1a sub r10, r24 bda6: 8d ef ldi r24, 0xFD ; 253 bda8: b8 0a sbc r11, r24 bdaa: 61 01 movw r12, r2 bdac: 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 bdd0: 9b 01 movw r18, r22 bdd2: ac 01 movw r20, r24 bdd4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> bdd8: f8 01 movw r30, r16 bdda: 64 a7 std Z+44, r22 ; 0x2c bddc: 75 a7 std Z+45, r23 ; 0x2d bdde: 86 a7 std Z+46, r24 ; 0x2e bde0: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { bde2: f1 e0 ldi r31, 0x01 ; 1 bde4: ef 16 cp r14, r31 bde6: f1 04 cpc r15, r1 bde8: 61 f0 breq .+24 ; 0xbe02 m[i][i - 1] = h[i - 1]; bdea: d8 01 movw r26, r16 bdec: 98 96 adiw r26, 0x28 ; 40 bdee: 4d 92 st X+, r4 bdf0: 5d 92 st X+, r5 bdf2: 6d 92 st X+, r6 bdf4: 7c 92 st X, r7 bdf6: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; bdf8: f8 01 movw r30, r16 bdfa: 44 82 std Z+4, r4 ; 0x04 bdfc: 55 82 std Z+5, r5 ; 0x05 bdfe: 66 82 std Z+6, r6 ; 0x06 be00: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); be02: ff ef ldi r31, 0xFF ; 255 be04: ef 1a sub r14, r31 be06: ff 0a sbc r15, r31 be08: f5 01 movw r30, r10 be0a: 20 81 ld r18, Z be0c: 31 81 ldd r19, Z+1 ; 0x01 be0e: 42 81 ldd r20, Z+2 ; 0x02 be10: 53 81 ldd r21, Z+3 ; 0x03 be12: 84 e0 ldi r24, 0x04 ; 4 be14: a8 0e add r10, r24 be16: b1 1c adc r11, r1 be18: 64 81 ldd r22, Z+4 ; 0x04 be1a: 75 81 ldd r23, Z+5 ; 0x05 be1c: 86 81 ldd r24, Z+6 ; 0x06 be1e: 97 81 ldd r25, Z+7 ; 0x07 be20: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> be24: 20 e0 ldi r18, 0x00 ; 0 be26: 30 e0 ldi r19, 0x00 ; 0 be28: 40 ec ldi r20, 0xC0 ; 192 be2a: 50 e4 ldi r21, 0x40 ; 64 be2c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> be30: d6 01 movw r26, r12 be32: dc 96 adiw r26, 0x3c ; 60 be34: 6d 93 st X+, r22 be36: 7d 93 st X+, r23 be38: 8d 93 st X+, r24 be3a: 9c 93 st X, r25 be3c: df 97 sbiw r26, 0x3f ; 63 be3e: 04 5d subi r16, 0xD4 ; 212 be40: 1f 4f sbci r17, 0xFF ; 255 be42: b8 e2 ldi r27, 0x28 ; 40 be44: cb 0e add r12, r27 be46: 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 be50: b1 cf rjmp .-158 ; 0xbdb4 be52: 7e 01 movw r14, r28 be54: fd e2 ldi r31, 0x2D ; 45 be56: ef 0e add r14, r31 be58: f1 1c adc r15, r1 be5a: 28 e2 ldi r18, 0x28 ; 40 be5c: a2 2e mov r10, r18 be5e: b1 2c mov r11, r1 be60: 00 eb ldi r16, 0xB0 ; 176 be62: 1f ef ldi r17, 0xFF ; 255 be64: 24 e0 ldi r18, 0x04 ; 4 be66: 22 0e add r2, r18 be68: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i be86: 2b 01 movw r4, r22 be88: 3c 01 movw r6, r24 be8a: 61 01 movw r12, r2 be8c: c0 1a sub r12, r16 be8e: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) be90: 88 24 eor r8, r8 be92: 83 94 inc r8 be94: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; be96: f6 01 movw r30, r12 be98: e0 0f add r30, r16 be9a: f1 1f adc r31, r17 be9c: ea 0d add r30, r10 be9e: fb 1d adc r31, r11 bea0: 20 81 ld r18, Z bea2: 31 81 ldd r19, Z+1 ; 0x01 bea4: 42 81 ldd r20, Z+2 ; 0x02 bea6: 53 81 ldd r21, Z+3 ; 0x03 bea8: c3 01 movw r24, r6 beaa: b2 01 movw r22, r4 beac: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> beb0: 9b 01 movw r18, r22 beb2: ac 01 movw r20, r24 beb4: f6 01 movw r30, r12 beb6: 60 81 ld r22, Z beb8: 71 81 ldd r23, Z+1 ; 0x01 beba: 82 81 ldd r24, Z+2 ; 0x02 bebc: 93 81 ldd r25, Z+3 ; 0x03 bebe: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> bec2: d6 01 movw r26, r12 bec4: 6d 93 st X+, r22 bec6: 7d 93 st X+, r23 bec8: 8d 93 st X+, r24 beca: 9d 93 st X+, r25 becc: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bedc: 3c e2 ldi r19, 0x2C ; 44 bede: e3 0e add r14, r19 bee0: f1 1c adc r15, r1 bee2: 08 52 subi r16, 0x28 ; 40 bee4: 11 09 sbc r17, r1 bee6: 88 e2 ldi r24, 0x28 ; 40 bee8: a8 0e add r10, r24 beea: 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 bef4: ba cf rjmp .-140 ; 0xbe6a bef6: 1e 01 movw r2, r28 bef8: f5 eb ldi r31, 0xB5 ; 181 befa: 2f 0e add r2, r31 befc: 31 1c adc r3, r1 befe: 6e 01 movw r12, r28 bf00: 21 eb ldi r18, 0xB1 ; 177 bf02: c2 0e add r12, r18 bf04: d1 1c adc r13, r1 bf06: 7e 01 movw r14, r28 bf08: 37 e3 ldi r19, 0x37 ; 55 bf0a: e3 1a sub r14, r19 bf0c: 3e ef ldi r19, 0xFE ; 254 bf0e: 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--) { bf10: 04 e0 ldi r16, 0x04 ; 4 bf12: 10 e0 ldi r17, 0x00 ; 0 bf14: 48 01 movw r8, r16 bf16: b1 2c mov r11, r1 bf18: a1 2c mov r10, r1 sum = 0; bf1a: 41 2c mov r4, r1 bf1c: 51 2c mov r5, r1 bf1e: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; bf20: f6 01 movw r30, r12 bf22: ea 0d add r30, r10 bf24: fb 1d adc r31, r11 bf26: d7 01 movw r26, r14 bf28: aa 0d add r26, r10 bf2a: bb 1d adc r27, r11 bf2c: 2d 91 ld r18, X+ bf2e: 3d 91 ld r19, X+ bf30: 4d 91 ld r20, X+ bf32: 5c 91 ld r21, X bf34: 60 81 ld r22, Z bf36: 71 81 ldd r23, Z+1 ; 0x01 bf38: 82 81 ldd r24, Z+2 ; 0x02 bf3a: 93 81 ldd r25, Z+3 ; 0x03 bf3c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> bf40: 9b 01 movw r18, r22 bf42: ac 01 movw r20, r24 bf44: c3 01 movw r24, r6 bf46: b2 01 movw r22, r4 bf48: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> bf4c: 2b 01 movw r4, r22 bf4e: 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++) bf50: 8f ef ldi r24, 0xFF ; 255 bf52: 88 1a sub r8, r24 bf54: 98 0a sbc r9, r24 bf56: 94 e0 ldi r25, 0x04 ; 4 bf58: a9 0e add r10, r25 bf5a: b1 1c adc r11, r1 bf5c: a5 e0 ldi r26, 0x05 ; 5 bf5e: 8a 16 cp r8, r26 bf60: 91 04 cpc r9, r1 bf62: f1 f6 brne .-68 ; 0xbf20 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; bf64: a3 01 movw r20, r6 bf66: 92 01 movw r18, r4 bf68: f1 01 movw r30, r2 bf6a: 60 81 ld r22, Z bf6c: 71 81 ldd r23, Z+1 ; 0x01 bf6e: 82 81 ldd r24, Z+2 ; 0x02 bf70: 93 81 ldd r25, Z+3 ; 0x03 bf72: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> bf76: d6 01 movw r26, r12 bf78: 2d 91 ld r18, X+ bf7a: 3d 91 ld r19, X+ bf7c: 4d 91 ld r20, X+ bf7e: 5c 91 ld r21, X bf80: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> bf84: f7 01 movw r30, r14 bf86: 60 83 st Z, r22 bf88: 71 83 std Z+1, r23 ; 0x01 bf8a: 82 83 std Z+2, r24 ; 0x02 bf8c: 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--) { bf8e: 01 50 subi r16, 0x01 ; 1 bf90: 11 09 sbc r17, r1 bf92: f8 e2 ldi r31, 0x28 ; 40 bf94: 2f 1a sub r2, r31 bf96: 31 08 sbc r3, r1 bf98: 2c e2 ldi r18, 0x2C ; 44 bf9a: c2 1a sub r12, r18 bf9c: d1 08 sbc r13, r1 bf9e: 34 e0 ldi r19, 0x04 ; 4 bfa0: e3 1a sub r14, r19 bfa2: f1 08 sbc r15, r1 bfa4: 01 15 cp r16, r1 bfa6: 11 05 cpc r17, r1 bfa8: 09 f0 breq .+2 ; 0xbfac bfaa: b4 cf rjmp .-152 ; 0xbf14 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { bfac: cb 50 subi r28, 0x0B ; 11 bfae: de 4f sbci r29, 0xFE ; 254 bfb0: 88 81 ld r24, Y bfb2: 99 81 ldd r25, Y+1 ; 0x01 bfb4: aa 81 ldd r26, Y+2 ; 0x02 bfb6: bb 81 ldd r27, Y+3 ; 0x03 bfb8: c5 5f subi r28, 0xF5 ; 245 bfba: d1 40 sbci r29, 0x01 ; 1 bfbc: cf 57 subi r28, 0x7F ; 127 bfbe: dd 4f sbci r29, 0xFD ; 253 bfc0: 88 83 st Y, r24 bfc2: 99 83 std Y+1, r25 ; 0x01 bfc4: aa 83 std Y+2, r26 ; 0x02 bfc6: bb 83 std Y+3, r27 ; 0x03 bfc8: c1 58 subi r28, 0x81 ; 129 bfca: d2 40 sbci r29, 0x02 ; 2 bfcc: 1e 01 movw r2, r28 bfce: 97 e4 ldi r25, 0x47 ; 71 bfd0: 29 1a sub r2, r25 bfd2: 9e ef ldi r25, 0xFE ; 254 bfd4: 39 0a sbc r3, r25 bfd6: 10 e0 ldi r17, 0x00 ; 0 bfd8: 00 e0 ldi r16, 0x00 ; 0 bfda: c1 59 subi r28, 0x91 ; 145 bfdc: dd 4f sbci r29, 0xFD ; 253 bfde: a8 81 ld r26, Y bfe0: b9 81 ldd r27, Y+1 ; 0x01 bfe2: cf 56 subi r28, 0x6F ; 111 bfe4: d2 40 sbci r29, 0x02 ; 2 bfe6: cd 90 ld r12, X+ bfe8: dd 90 ld r13, X+ bfea: ed 90 ld r14, X+ bfec: fd 90 ld r15, X+ bfee: c1 59 subi r28, 0x91 ; 145 bff0: dd 4f sbci r29, 0xFD ; 253 bff2: b9 83 std Y+1, r27 ; 0x01 bff4: a8 83 st Y, r26 bff6: cf 56 subi r28, 0x6F ; 111 bff8: d2 40 sbci r29, 0x02 ; 2 bffa: cb 58 subi r28, 0x8B ; 139 bffc: dd 4f sbci r29, 0xFD ; 253 bffe: 28 81 ld r18, Y c000: 39 81 ldd r19, Y+1 ; 0x01 c002: 4a 81 ldd r20, Y+2 ; 0x02 c004: 5b 81 ldd r21, Y+3 ; 0x03 c006: c5 57 subi r28, 0x75 ; 117 c008: d2 40 sbci r29, 0x02 ; 2 c00a: c7 01 movw r24, r14 c00c: b6 01 movw r22, r12 c00e: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> c012: 18 16 cp r1, r24 c014: b4 f0 brlt .+44 ; 0xc042 c016: cb 58 subi r28, 0x8B ; 139 c018: dd 4f sbci r29, 0xFD ; 253 c01a: 28 81 ld r18, Y c01c: 39 81 ldd r19, Y+1 ; 0x01 c01e: 4a 81 ldd r20, Y+2 ; 0x02 c020: 5b 81 ldd r21, Y+3 ; 0x03 c022: c5 57 subi r28, 0x75 ; 117 c024: d2 40 sbci r29, 0x02 ; 2 c026: c1 59 subi r28, 0x91 ; 145 c028: dd 4f sbci r29, 0xFD ; 253 c02a: e8 81 ld r30, Y c02c: f9 81 ldd r31, Y+1 ; 0x01 c02e: cf 56 subi r28, 0x6F ; 111 c030: d2 40 sbci r29, 0x02 ; 2 c032: 60 81 ld r22, Z c034: 71 81 ldd r23, Z+1 ; 0x01 c036: 82 81 ldd r24, Z+2 ; 0x02 c038: 93 81 ldd r25, Z+3 ; 0x03 c03a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> c03e: 87 ff sbrs r24, 7 c040: 18 c0 rjmp .+48 ; 0xc072 c042: 04 30 cpi r16, 0x04 ; 4 c044: 11 05 cpc r17, r1 c046: 09 f0 breq .+2 ; 0xc04a c048: 30 c1 rjmp .+608 ; 0xc2aa c04a: cb 58 subi r28, 0x8B ; 139 c04c: dd 4f sbci r29, 0xFD ; 253 c04e: 28 81 ld r18, Y c050: 39 81 ldd r19, Y+1 ; 0x01 c052: 4a 81 ldd r20, Y+2 ; 0x02 c054: 5b 81 ldd r21, Y+3 ; 0x03 c056: c5 57 subi r28, 0x75 ; 117 c058: d2 40 sbci r29, 0x02 ; 2 c05a: cf 57 subi r28, 0x7F ; 127 c05c: dd 4f sbci r29, 0xFD ; 253 c05e: 68 81 ld r22, Y c060: 79 81 ldd r23, Y+1 ; 0x01 c062: 8a 81 ldd r24, Y+2 ; 0x02 c064: 9b 81 ldd r25, Y+3 ; 0x03 c066: c1 58 subi r28, 0x81 ; 129 c068: d2 40 sbci r29, 0x02 ; 2 c06a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> c06e: 87 ff sbrs r24, 7 c070: 1c c1 rjmp .+568 ; 0xc2aa a = (s[i + 1] - s[i]) / (6 * h[i]); c072: d1 01 movw r26, r2 c074: 14 96 adiw r26, 0x04 ; 4 c076: 8d 90 ld r8, X+ c078: 9d 90 ld r9, X+ c07a: ad 90 ld r10, X+ c07c: bc 90 ld r11, X c07e: 17 97 sbiw r26, 0x07 ; 7 c080: 8d 91 ld r24, X+ c082: 9d 91 ld r25, X+ c084: 0d 90 ld r0, X+ c086: bc 91 ld r27, X c088: a0 2d mov r26, r0 c08a: cf 58 subi r28, 0x8F ; 143 c08c: dd 4f sbci r29, 0xFD ; 253 c08e: 88 83 st Y, r24 c090: 99 83 std Y+1, r25 ; 0x01 c092: aa 83 std Y+2, r26 ; 0x02 c094: bb 83 std Y+3, r27 ; 0x03 c096: c1 57 subi r28, 0x71 ; 113 c098: d2 40 sbci r29, 0x02 ; 2 c09a: f8 01 movw r30, r16 c09c: ee 0f add r30, r30 c09e: ff 1f adc r31, r31 c0a0: ee 0f add r30, r30 c0a2: ff 1f adc r31, r31 c0a4: 21 e9 ldi r18, 0x91 ; 145 c0a6: 31 e0 ldi r19, 0x01 ; 1 c0a8: 2c 0f add r18, r28 c0aa: 3d 1f adc r19, r29 c0ac: e2 0f add r30, r18 c0ae: f3 1f adc r31, r19 c0b0: 40 80 ld r4, Z c0b2: 51 80 ldd r5, Z+1 ; 0x01 c0b4: 62 80 ldd r6, Z+2 ; 0x02 c0b6: 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; c0b8: c3 59 subi r28, 0x93 ; 147 c0ba: dd 4f sbci r29, 0xFD ; 253 c0bc: a8 81 ld r26, Y c0be: b9 81 ldd r27, Y+1 ; 0x01 c0c0: cd 56 subi r28, 0x6D ; 109 c0c2: d2 40 sbci r29, 0x02 ; 2 c0c4: 8d 91 ld r24, X+ c0c6: 9d 91 ld r25, X+ c0c8: 0d 90 ld r0, X+ c0ca: bc 91 ld r27, X c0cc: a0 2d mov r26, r0 c0ce: c3 58 subi r28, 0x83 ; 131 c0d0: dd 4f sbci r29, 0xFD ; 253 c0d2: 88 83 st Y, r24 c0d4: 99 83 std Y+1, r25 ; 0x01 c0d6: aa 83 std Y+2, r26 ; 0x02 c0d8: bb 83 std Y+3, r27 ; 0x03 c0da: cd 57 subi r28, 0x7D ; 125 c0dc: 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; c0de: a7 01 movw r20, r14 c0e0: 96 01 movw r18, r12 c0e2: cb 58 subi r28, 0x8B ; 139 c0e4: dd 4f sbci r29, 0xFD ; 253 c0e6: 68 81 ld r22, Y c0e8: 79 81 ldd r23, Y+1 ; 0x01 c0ea: 8a 81 ldd r24, Y+2 ; 0x02 c0ec: 9b 81 ldd r25, Y+3 ; 0x03 c0ee: c5 57 subi r28, 0x75 ; 117 c0f0: d2 40 sbci r29, 0x02 ; 2 c0f2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> c0f6: 6b 01 movw r12, r22 c0f8: 7c 01 movw r14, r24 c0fa: 20 e0 ldi r18, 0x00 ; 0 c0fc: 30 e0 ldi r19, 0x00 ; 0 c0fe: 40 e4 ldi r20, 0x40 ; 64 c100: 50 e4 ldi r21, 0x40 ; 64 c102: 0f 94 a7 e1 call 0x3c34e ; 0x3c34e c106: cb 57 subi r28, 0x7B ; 123 c108: dd 4f sbci r29, 0xFD ; 253 c10a: 68 83 st Y, r22 c10c: 79 83 std Y+1, r23 ; 0x01 c10e: 8a 83 std Y+2, r24 ; 0x02 c110: 9b 83 std Y+3, r25 ; 0x03 c112: c5 58 subi r28, 0x85 ; 133 c114: 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; c116: c3 58 subi r28, 0x83 ; 131 c118: dd 4f sbci r29, 0xFD ; 253 c11a: 28 81 ld r18, Y c11c: 39 81 ldd r19, Y+1 ; 0x01 c11e: 4a 81 ldd r20, Y+2 ; 0x02 c120: 5b 81 ldd r21, Y+3 ; 0x03 c122: cd 57 subi r28, 0x7D ; 125 c124: d2 40 sbci r29, 0x02 ; 2 c126: c3 59 subi r28, 0x93 ; 147 c128: dd 4f sbci r29, 0xFD ; 253 c12a: e8 81 ld r30, Y c12c: f9 81 ldd r31, Y+1 ; 0x01 c12e: cd 56 subi r28, 0x6D ; 109 c130: d2 40 sbci r29, 0x02 ; 2 c132: 64 81 ldd r22, Z+4 ; 0x04 c134: 75 81 ldd r23, Z+5 ; 0x05 c136: 86 81 ldd r24, Z+6 ; 0x06 c138: 97 81 ldd r25, Z+7 ; 0x07 c13a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> c13e: a3 01 movw r20, r6 c140: 92 01 movw r18, r4 c142: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> c146: c7 58 subi r28, 0x87 ; 135 c148: dd 4f sbci r29, 0xFD ; 253 c14a: 68 83 st Y, r22 c14c: 79 83 std Y+1, r23 ; 0x01 c14e: 8a 83 std Y+2, r24 ; 0x02 c150: 9b 83 std Y+3, r25 ; 0x03 c152: c9 57 subi r28, 0x79 ; 121 c154: d2 40 sbci r29, 0x02 ; 2 c156: a3 01 movw r20, r6 c158: 92 01 movw r18, r4 c15a: c3 01 movw r24, r6 c15c: b2 01 movw r22, r4 c15e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> c162: cf 58 subi r28, 0x8F ; 143 c164: dd 4f sbci r29, 0xFD ; 253 c166: 28 81 ld r18, Y c168: 39 81 ldd r19, Y+1 ; 0x01 c16a: 4a 81 ldd r20, Y+2 ; 0x02 c16c: 5b 81 ldd r21, Y+3 ; 0x03 c16e: c1 57 subi r28, 0x71 ; 113 c170: d2 40 sbci r29, 0x02 ; 2 c172: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c176: c7 57 subi r28, 0x77 ; 119 c178: dd 4f sbci r29, 0xFD ; 253 c17a: 68 83 st Y, r22 c17c: 79 83 std Y+1, r23 ; 0x01 c17e: 8a 83 std Y+2, r24 ; 0x02 c180: 9b 83 std Y+3, r25 ; 0x03 c182: c9 58 subi r28, 0x89 ; 137 c184: d2 40 sbci r29, 0x02 ; 2 c186: a3 01 movw r20, r6 c188: 92 01 movw r18, r4 c18a: c5 01 movw r24, r10 c18c: b4 01 movw r22, r8 c18e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c192: 9b 01 movw r18, r22 c194: ac 01 movw r20, r24 c196: c7 57 subi r28, 0x77 ; 119 c198: dd 4f sbci r29, 0xFD ; 253 c19a: 68 81 ld r22, Y c19c: 79 81 ldd r23, Y+1 ; 0x01 c19e: 8a 81 ldd r24, Y+2 ; 0x02 c1a0: 9b 81 ldd r25, Y+3 ; 0x03 c1a2: c9 58 subi r28, 0x89 ; 137 c1a4: d2 40 sbci r29, 0x02 ; 2 c1a6: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> c1aa: 20 e0 ldi r18, 0x00 ; 0 c1ac: 30 e0 ldi r19, 0x00 ; 0 c1ae: 40 ec ldi r20, 0xC0 ; 192 c1b0: 50 e4 ldi r21, 0x40 ; 64 c1b2: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> c1b6: 9b 01 movw r18, r22 c1b8: ac 01 movw r20, r24 c1ba: c7 58 subi r28, 0x87 ; 135 c1bc: dd 4f sbci r29, 0xFD ; 253 c1be: 68 81 ld r22, Y c1c0: 79 81 ldd r23, Y+1 ; 0x01 c1c2: 8a 81 ldd r24, Y+2 ; 0x02 c1c4: 9b 81 ldd r25, Y+3 ; 0x03 c1c6: c9 57 subi r28, 0x79 ; 121 c1c8: d2 40 sbci r29, 0x02 ; 2 c1ca: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__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; c1ce: a7 01 movw r20, r14 c1d0: 96 01 movw r18, r12 c1d2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c1d6: c7 58 subi r28, 0x87 ; 135 c1d8: dd 4f sbci r29, 0xFD ; 253 c1da: 68 83 st Y, r22 c1dc: 79 83 std Y+1, r23 ; 0x01 c1de: 8a 83 std Y+2, r24 ; 0x02 c1e0: 9b 83 std Y+3, r25 ; 0x03 c1e2: c9 57 subi r28, 0x79 ; 121 c1e4: 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]); c1e6: cf 58 subi r28, 0x8F ; 143 c1e8: dd 4f sbci r29, 0xFD ; 253 c1ea: 28 81 ld r18, Y c1ec: 39 81 ldd r19, Y+1 ; 0x01 c1ee: 4a 81 ldd r20, Y+2 ; 0x02 c1f0: 5b 81 ldd r21, Y+3 ; 0x03 c1f2: c1 57 subi r28, 0x71 ; 113 c1f4: d2 40 sbci r29, 0x02 ; 2 c1f6: c5 01 movw r24, r10 c1f8: b4 01 movw r22, r8 c1fa: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> c1fe: 4b 01 movw r8, r22 c200: 5c 01 movw r10, r24 c202: 20 e0 ldi r18, 0x00 ; 0 c204: 30 e0 ldi r19, 0x00 ; 0 c206: 40 ec ldi r20, 0xC0 ; 192 c208: 50 e4 ldi r21, 0x40 ; 64 c20a: c3 01 movw r24, r6 c20c: b2 01 movw r22, r4 c20e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c212: 9b 01 movw r18, r22 c214: ac 01 movw r20, r24 c216: c5 01 movw r24, r10 c218: b4 01 movw r22, r8 c21a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__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; c21e: cb 57 subi r28, 0x7B ; 123 c220: dd 4f sbci r29, 0xFD ; 253 c222: 28 81 ld r18, Y c224: 39 81 ldd r19, Y+1 ; 0x01 c226: 4a 81 ldd r20, Y+2 ; 0x02 c228: 5b 81 ldd r21, Y+3 ; 0x03 c22a: c5 58 subi r28, 0x85 ; 133 c22c: d2 40 sbci r29, 0x02 ; 2 c22e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c232: 4b 01 movw r8, r22 c234: 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; c236: 20 e0 ldi r18, 0x00 ; 0 c238: 30 e0 ldi r19, 0x00 ; 0 c23a: 40 e0 ldi r20, 0x00 ; 0 c23c: 5f e3 ldi r21, 0x3F ; 63 c23e: cf 58 subi r28, 0x8F ; 143 c240: dd 4f sbci r29, 0xFD ; 253 c242: 68 81 ld r22, Y c244: 79 81 ldd r23, Y+1 ; 0x01 c246: 8a 81 ldd r24, Y+2 ; 0x02 c248: 9b 81 ldd r25, Y+3 ; 0x03 c24a: c1 57 subi r28, 0x71 ; 113 c24c: d2 40 sbci r29, 0x02 ; 2 c24e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c252: 2b 01 movw r4, r22 c254: 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; c256: a7 01 movw r20, r14 c258: 96 01 movw r18, r12 c25a: c7 01 movw r24, r14 c25c: b6 01 movw r22, r12 c25e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c262: 9b 01 movw r18, r22 c264: ac 01 movw r20, r24 c266: c3 01 movw r24, r6 c268: b2 01 movw r22, r4 c26a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c26e: 9b 01 movw r18, r22 c270: ac 01 movw r20, r24 c272: c5 01 movw r24, r10 c274: b4 01 movw r22, r8 c276: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> c27a: 9b 01 movw r18, r22 c27c: ac 01 movw r20, r24 c27e: c7 58 subi r28, 0x87 ; 135 c280: dd 4f sbci r29, 0xFD ; 253 c282: 68 81 ld r22, Y c284: 79 81 ldd r23, Y+1 ; 0x01 c286: 8a 81 ldd r24, Y+2 ; 0x02 c288: 9b 81 ldd r25, Y+3 ; 0x03 c28a: c9 57 subi r28, 0x79 ; 121 c28c: d2 40 sbci r29, 0x02 ; 2 c28e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> c292: c3 58 subi r28, 0x83 ; 131 c294: dd 4f sbci r29, 0xFD ; 253 c296: 28 81 ld r18, Y c298: 39 81 ldd r19, Y+1 ; 0x01 c29a: 4a 81 ldd r20, Y+2 ; 0x02 c29c: 5b 81 ldd r21, Y+3 ; 0x03 c29e: cd 57 subi r28, 0x7D ; 125 c2a0: d2 40 sbci r29, 0x02 ; 2 c2a2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> c2a6: 2b 01 movw r4, r22 c2a8: 3c 01 movw r6, r24 c2aa: 0f 5f subi r16, 0xFF ; 255 c2ac: 1f 4f sbci r17, 0xFF ; 255 c2ae: f4 e0 ldi r31, 0x04 ; 4 c2b0: 2f 0e add r2, r31 c2b2: 31 1c adc r3, r1 c2b4: c3 59 subi r28, 0x93 ; 147 c2b6: dd 4f sbci r29, 0xFD ; 253 c2b8: 28 81 ld r18, Y c2ba: 39 81 ldd r19, Y+1 ; 0x01 c2bc: cd 56 subi r28, 0x6D ; 109 c2be: d2 40 sbci r29, 0x02 ; 2 c2c0: 2c 5f subi r18, 0xFC ; 252 c2c2: 3f 4f sbci r19, 0xFF ; 255 c2c4: c3 59 subi r28, 0x93 ; 147 c2c6: dd 4f sbci r29, 0xFD ; 253 c2c8: 39 83 std Y+1, r19 ; 0x01 c2ca: 28 83 st Y, r18 c2cc: cd 56 subi r28, 0x6D ; 109 c2ce: 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 c2d6: 81 ce rjmp .-766 ; 0xbfda sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } c2d8: c3 01 movw r24, r6 c2da: b2 01 movw r22, r4 c2dc: c4 57 subi r28, 0x74 ; 116 c2de: dd 4f sbci r29, 0xFD ; 253 c2e0: 0f b6 in r0, 0x3f ; 63 c2e2: f8 94 cli c2e4: de bf out 0x3e, r29 ; 62 c2e6: 0f be out 0x3f, r0 ; 63 c2e8: cd bf out 0x3d, r28 ; 61 c2ea: df 91 pop r29 c2ec: cf 91 pop r28 c2ee: 1f 91 pop r17 c2f0: 0f 91 pop r16 c2f2: ff 90 pop r15 c2f4: ef 90 pop r14 c2f6: df 90 pop r13 c2f8: cf 90 pop r12 c2fa: bf 90 pop r11 c2fc: af 90 pop r10 c2fe: 9f 90 pop r9 c300: 8f 90 pop r8 c302: 7f 90 pop r7 c304: 6f 90 pop r6 c306: 5f 90 pop r5 c308: 4f 90 pop r4 c30a: 3f 90 pop r3 c30c: 2f 90 pop r2 c30e: 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)); c310: c5 01 movw r24, r10 c312: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a c316: d8 01 movw r26, r16 c318: 8d 93 st X+, r24 c31a: 9c 93 st X, r25 c31c: b5 e0 ldi r27, 0x05 ; 5 c31e: cb 0e add r12, r27 c320: d1 1c adc r13, r1 c322: e2 e0 ldi r30, 0x02 ; 2 c324: ae 0e add r10, r30 c326: b1 1c adc r11, r1 c328: 96 cc rjmp .-1748 ; 0xbc56 0000c32a : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { c32a: 0f 93 push r16 c32c: 1f 93 push r17 c32e: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) c330: 20 91 95 13 lds r18, 0x1395 ; 0x801395 c334: 21 30 cpi r18, 0x01 ; 1 c336: 79 f5 brne .+94 ; 0xc396 c338: 8c 01 movw r16, r24 c33a: 80 e5 ldi r24, 0x50 ; 80 c33c: 0e 94 0d 5d call 0xba1a ; 0xba1a c340: 88 23 and r24, r24 c342: 49 f1 breq .+82 ; 0xc396 { mmuSlotIndex = code_value_uint8(); c344: 0e 94 9f 5c call 0xb93e ; 0xb93e c348: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { c34a: 85 30 cpi r24, 0x05 ; 5 c34c: 20 f5 brcc .+72 ; 0xc396 switch (gcode) c34e: 01 3c cpi r16, 0xC1 ; 193 c350: 82 e0 ldi r24, 0x02 ; 2 c352: 18 07 cpc r17, r24 c354: 49 f0 breq .+18 ; 0xc368 c356: 02 3c cpi r16, 0xC2 ; 194 c358: 12 40 sbci r17, 0x02 ; 2 c35a: 69 f0 breq .+26 ; 0xc376 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c35c: 8c 2f mov r24, r28 default: break; } } } } c35e: cf 91 pop r28 c360: 1f 91 pop r17 c362: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c364: 0d 94 03 a0 jmp 0x34006 ; 0x34006 break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c368: 60 e0 ldi r22, 0x00 ; 0 c36a: 8c 2f mov r24, r28 default: break; } } } } c36c: cf 91 pop r28 c36e: 1f 91 pop r17 c370: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c372: 0d 94 46 a0 jmp 0x3408c ; 0x3408c break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ c376: 8e ec ldi r24, 0xCE ; 206 c378: 9e e0 ldi r25, 0x0E ; 14 c37a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e c37e: 88 23 and r24, r24 c380: 51 f0 breq .+20 ; 0xc396 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { c382: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 c386: 88 23 and r24, r24 c388: 31 f0 breq .+12 ; 0xc396 c38a: 8c 2f mov r24, r28 default: break; } } } } c38c: cf 91 pop r28 c38e: 1f 91 pop r17 c390: 0f 91 pop r16 c392: 0d 94 c3 a0 jmp 0x34186 ; 0x34186 c396: cf 91 pop r28 c398: 1f 91 pop r17 c39a: 0f 91 pop r16 c39c: 08 95 ret 0000c39e : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c39e: cf 93 push r28 c3a0: 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(); c3a2: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 cli(); c3a6: f8 94 cli tmc2130_mode = mode; c3a8: c0 93 69 06 sts 0x0669, r28 ; 0x800669 update_mode_profile(); c3ac: 0f 94 45 aa call 0x3548a ; 0x3548a 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(); c3b0: 0e 94 cc f8 call 0x1f198 ; 0x1f198 1 #else 0 #endif ) , enableECool(enableECool) { } c3b4: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c3b6: 82 70 andi r24, 0x02 ; 2 c3b8: 0f 94 eb 3a call 0x275d6 ; 0x275d6 // 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(); c3bc: 0f 94 35 58 call 0x2b06a ; 0x2b06a sei(); c3c0: 78 94 sei } c3c2: cf 91 pop r28 c3c4: 08 95 ret 0000c3c6 : 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);} c3c6: 8f 92 push r8 c3c8: 9f 92 push r9 c3ca: af 92 push r10 c3cc: bf 92 push r11 c3ce: cf 92 push r12 c3d0: df 92 push r13 c3d2: ef 92 push r14 c3d4: ff 92 push r15 c3d6: 0f 93 push r16 c3d8: 1f 93 push r17 c3da: cf 93 push r28 c3dc: df 93 push r29 c3de: 00 91 93 03 lds r16, 0x0393 ; 0x800393 c3e2: 10 91 94 03 lds r17, 0x0394 ; 0x800394 c3e6: 0f 5f subi r16, 0xFF ; 255 c3e8: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c3ea: 68 01 movw r12, r16 c3ec: 8f ef ldi r24, 0xFF ; 255 c3ee: c8 1a sub r12, r24 c3f0: d8 0a sbc r13, r24 c3f2: d8 01 movw r26, r16 c3f4: dc 91 ld r29, X } while (isspace(c)); c3f6: 8d 2f mov r24, r29 c3f8: 90 e0 ldi r25, 0x00 ; 0 c3fa: 0f 94 a0 da call 0x3b540 ; 0x3b540 c3fe: 7c 01 movw r14, r24 c400: 89 2b or r24, r25 c402: 01 f5 brne .+64 ; 0xc444 flag = 0; if (c == '-') { c404: dd 32 cpi r29, 0x2D ; 45 c406: 01 f5 brne .+64 ; 0xc448 flag = FL_MINUS; c = *nptr++; c408: 68 01 movw r12, r16 c40a: b2 e0 ldi r27, 0x02 ; 2 c40c: cb 0e add r12, r27 c40e: d1 1c adc r13, r1 c410: f8 01 movw r30, r16 c412: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c414: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c416: 86 01 movw r16, r12 c418: 01 50 subi r16, 0x01 ; 1 c41a: 11 09 sbc r17, r1 c41c: 43 e0 ldi r20, 0x03 ; 3 c41e: 50 e0 ldi r21, 0x00 ; 0 c420: 61 e3 ldi r22, 0x31 ; 49 c422: 7d e7 ldi r23, 0x7D ; 125 c424: c8 01 movw r24, r16 c426: 0f 94 d6 da call 0x3b5ac ; 0x3b5ac c42a: 89 2b or r24, r25 c42c: c1 f4 brne .+48 ; 0xc45e nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c42e: 60 e0 ldi r22, 0x00 ; 0 c430: 70 e0 ldi r23, 0x00 ; 0 c432: 80 e8 ldi r24, 0x80 ; 128 c434: 9f ef ldi r25, 0xFF ; 255 c436: c1 11 cpse r28, r1 c438: db c0 rjmp .+438 ; 0xc5f0 c43a: 60 e0 ldi r22, 0x00 ; 0 c43c: 70 e0 ldi r23, 0x00 ; 0 c43e: 80 e8 ldi r24, 0x80 ; 128 c440: 9f e7 ldi r25, 0x7F ; 127 c442: d6 c0 rjmp .+428 ; 0xc5f0 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c444: 86 01 movw r16, r12 c446: d1 cf rjmp .-94 ; 0xc3ea flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c448: db 32 cpi r29, 0x2B ; 43 c44a: 39 f4 brne .+14 ; 0xc45a c = *nptr++; c44c: 68 01 movw r12, r16 c44e: f2 e0 ldi r31, 0x02 ; 2 c450: cf 0e add r12, r31 c452: d1 1c adc r13, r1 c454: d8 01 movw r26, r16 c456: 11 96 adiw r26, 0x01 ; 1 c458: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c45a: c0 e0 ldi r28, 0x00 ; 0 c45c: dc cf rjmp .-72 ; 0xc416 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)) { c45e: 43 e0 ldi r20, 0x03 ; 3 c460: 50 e0 ldi r21, 0x00 ; 0 c462: 6e e2 ldi r22, 0x2E ; 46 c464: 7d e7 ldi r23, 0x7D ; 125 c466: c8 01 movw r24, r16 c468: 0f 94 d6 da call 0x3b5ac ; 0x3b5ac c46c: 89 2b or r24, r25 c46e: 09 f4 brne .+2 ; 0xc472 c470: cc c0 rjmp .+408 ; 0xc60a c472: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c474: 10 e0 ldi r17, 0x00 ; 0 c476: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c478: 20 e0 ldi r18, 0x00 ; 0 c47a: 30 e0 ldi r19, 0x00 ; 0 c47c: a9 01 movw r20, r18 c47e: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c480: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c482: da 30 cpi r29, 0x0A ; 10 c484: 60 f5 brcc .+88 ; 0xc4de flag |= FL_ANY; c486: bc 2e mov r11, r28 c488: 68 94 set c48a: b1 f8 bld r11, 1 c48c: 8c 2f mov r24, r28 c48e: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c490: c2 ff sbrs r28, 2 c492: 09 c0 rjmp .+18 ; 0xc4a6 if (!(flag & FL_DOT)) c494: 81 11 cpse r24, r1 c496: 02 c0 rjmp .+4 ; 0xc49c exp += 1; c498: 0f 5f subi r16, 0xFF ; 255 c49a: 1f 4f sbci r17, 0xFF ; 255 c49c: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c49e: d6 01 movw r26, r12 c4a0: dc 91 ld r29, X c4a2: cb 2d mov r28, r11 c4a4: ec cf rjmp .-40 ; 0xc47e if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c4a6: 88 23 and r24, r24 c4a8: 11 f0 breq .+4 ; 0xc4ae exp -= 1; c4aa: 01 50 subi r16, 0x01 ; 1 c4ac: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c4ae: a5 e0 ldi r26, 0x05 ; 5 c4b0: b0 e0 ldi r27, 0x00 ; 0 c4b2: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 <__muluhisi3> c4b6: 9b 01 movw r18, r22 c4b8: ac 01 movw r20, r24 c4ba: 22 0f add r18, r18 c4bc: 33 1f adc r19, r19 c4be: 44 1f adc r20, r20 c4c0: 55 1f adc r21, r21 c4c2: 2d 0f add r18, r29 c4c4: 31 1d adc r19, r1 c4c6: 41 1d adc r20, r1 c4c8: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c4ca: 28 39 cpi r18, 0x98 ; 152 c4cc: b9 e9 ldi r27, 0x99 ; 153 c4ce: 3b 07 cpc r19, r27 c4d0: 4b 07 cpc r20, r27 c4d2: b9 e1 ldi r27, 0x19 ; 25 c4d4: 5b 07 cpc r21, r27 c4d6: 10 f3 brcs .-60 ; 0xc49c flag |= FL_OVFL; c4d8: c6 60 ori r28, 0x06 ; 6 c4da: bc 2e mov r11, r28 c4dc: df cf rjmp .-66 ; 0xc49c } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c4de: de 3f cpi r29, 0xFE ; 254 c4e0: 31 f4 brne .+12 ; 0xc4ee c4e2: c3 fd sbrc r28, 3 c4e4: 33 c0 rjmp .+102 ; 0xc54c flag |= FL_DOT; c4e6: bc 2e mov r11, r28 c4e8: 68 94 set c4ea: b3 f8 bld r11, 3 c4ec: d7 cf rjmp .-82 ; 0xc49c } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c4ee: d5 33 cpi r29, 0x35 ; 53 c4f0: 69 f5 brne .+90 ; 0xc54c { int i; c = *nptr++; c4f2: 80 81 ld r24, Z i = 2; if (c == '-') { c4f4: 8d 32 cpi r24, 0x2D ; 45 c4f6: 31 f4 brne .+12 ; 0xc504 flag |= FL_MEXP; c4f8: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c4fa: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c4fc: 6e 5f subi r22, 0xFE ; 254 c4fe: 7f 4f sbci r23, 0xFF ; 255 c500: 81 81 ldd r24, Z+1 ; 0x01 c502: 05 c0 rjmp .+10 ; 0xc50e c504: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c506: 8b 32 cpi r24, 0x2B ; 43 c508: c9 f3 breq .-14 ; 0xc4fc // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c50a: 6f 5f subi r22, 0xFF ; 255 c50c: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c50e: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c510: 8a 30 cpi r24, 0x0A ; 10 c512: e0 f4 brcc .+56 ; 0xc54c c514: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c516: b0 e8 ldi r27, 0x80 ; 128 c518: eb 16 cp r14, r27 c51a: bc e0 ldi r27, 0x0C ; 12 c51c: fb 06 cpc r15, r27 c51e: 5c f4 brge .+22 ; 0xc536 i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c520: b7 01 movw r22, r14 c522: 66 0f add r22, r22 c524: 77 1f adc r23, r23 c526: 66 0f add r22, r22 c528: 77 1f adc r23, r23 c52a: e6 0e add r14, r22 c52c: f7 1e adc r15, r23 c52e: ee 0c add r14, r14 c530: ff 1c adc r15, r15 c532: e8 0e add r14, r24 c534: f1 1c adc r15, r1 c = *nptr++ - '0'; c536: 81 91 ld r24, Z+ c538: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c53a: 8a 30 cpi r24, 0x0A ; 10 c53c: 60 f3 brcs .-40 ; 0xc516 if (flag & FL_MEXP) c53e: c4 ff sbrs r28, 4 c540: 03 c0 rjmp .+6 ; 0xc548 i = -i; c542: f1 94 neg r15 c544: e1 94 neg r14 c546: f1 08 sbc r15, r1 exp += i; c548: 0e 0d add r16, r14 c54a: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c54c: ca 01 movw r24, r20 c54e: b9 01 movw r22, r18 c550: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c554: c3 70 andi r28, 0x03 ; 3 c556: c3 30 cpi r28, 0x03 ; 3 c558: 09 f4 brne .+2 ; 0xc55c x.flt = -x.flt; c55a: 90 58 subi r25, 0x80 ; 128 c55c: 4b 01 movw r8, r22 c55e: 5c 01 movw r10, r24 if (x.flt != 0) { c560: 20 e0 ldi r18, 0x00 ; 0 c562: 30 e0 ldi r19, 0x00 ; 0 c564: a9 01 movw r20, r18 c566: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> c56a: 88 23 and r24, r24 c56c: 09 f4 brne .+2 ; 0xc570 c56e: 3e c0 rjmp .+124 ; 0xc5ec if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c570: ca e2 ldi r28, 0x2A ; 42 c572: dd e7 ldi r29, 0x7D ; 125 if ((flag & FL_MINUS) && (flag & FL_ANY)) x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { c574: 17 ff sbrs r17, 7 c576: 05 c0 rjmp .+10 ; 0xc582 nptr = (void*)(pwr_m10 + 5); exp = -exp; c578: 11 95 neg r17 c57a: 01 95 neg r16 c57c: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c57e: c2 e1 ldi r28, 0x12 ; 18 c580: dd e7 ldi r29, 0x7D ; 125 c582: 6e 01 movw r12, r28 c584: e8 e1 ldi r30, 0x18 ; 24 c586: ce 1a sub r12, r30 c588: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c58a: 80 e2 ldi r24, 0x20 ; 32 c58c: e8 2e mov r14, r24 c58e: f1 2c mov r15, r1 c590: 0d c0 rjmp .+26 ; 0xc5ac for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c592: fe 01 movw r30, r28 c594: 25 91 lpm r18, Z+ c596: 35 91 lpm r19, Z+ c598: 45 91 lpm r20, Z+ c59a: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c59c: 0e 19 sub r16, r14 c59e: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c5a0: c5 01 movw r24, r10 c5a2: b4 01 movw r22, r8 c5a4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c5a8: 4b 01 movw r8, r22 c5aa: 5c 01 movw r10, r24 c5ac: d5 01 movw r26, r10 c5ae: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c5b0: 0e 15 cp r16, r14 c5b2: 1f 05 cpc r17, r15 c5b4: 74 f7 brge .-36 ; 0xc592 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c5b6: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c5b8: f5 94 asr r15 c5ba: e7 94 ror r14 c5bc: cc 16 cp r12, r28 c5be: dd 06 cpc r13, r29 c5c0: a9 f7 brne .-22 ; 0xc5ac not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c5c2: 8a 2f mov r24, r26 c5c4: 88 0f add r24, r24 c5c6: 8b 2f mov r24, r27 c5c8: 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) c5ca: 8f 3f cpi r24, 0xFF ; 255 c5cc: 49 f0 breq .+18 ; 0xc5e0 c5ce: 20 e0 ldi r18, 0x00 ; 0 c5d0: 30 e0 ldi r19, 0x00 ; 0 c5d2: a9 01 movw r20, r18 c5d4: c5 01 movw r24, r10 c5d6: b4 01 movw r22, r8 c5d8: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> c5dc: 81 11 cpse r24, r1 c5de: 06 c0 rjmp .+12 ; 0xc5ec errno = ERANGE; c5e0: 82 e2 ldi r24, 0x22 ; 34 c5e2: 90 e0 ldi r25, 0x00 ; 0 c5e4: 90 93 0b 18 sts 0x180B, r25 ; 0x80180b c5e8: 80 93 0a 18 sts 0x180A, r24 ; 0x80180a } return x.flt; c5ec: c5 01 movw r24, r10 c5ee: b4 01 movw r22, r8 c5f0: df 91 pop r29 c5f2: cf 91 pop r28 c5f4: 1f 91 pop r17 c5f6: 0f 91 pop r16 c5f8: ff 90 pop r15 c5fa: ef 90 pop r14 c5fc: df 90 pop r13 c5fe: cf 90 pop r12 c600: bf 90 pop r11 c602: af 90 pop r10 c604: 9f 90 pop r9 c606: 8f 90 pop r8 c608: 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; c60a: 60 e0 ldi r22, 0x00 ; 0 c60c: 70 e0 ldi r23, 0x00 ; 0 c60e: 80 ec ldi r24, 0xC0 ; 192 c610: 9f e7 ldi r25, 0x7F ; 127 c612: ee cf rjmp .-36 ; 0xc5f0 0000c614 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c614: 2f 92 push r2 c616: 3f 92 push r3 c618: 4f 92 push r4 c61a: 5f 92 push r5 c61c: 6f 92 push r6 c61e: 7f 92 push r7 c620: 8f 92 push r8 c622: 9f 92 push r9 c624: af 92 push r10 c626: bf 92 push r11 c628: cf 92 push r12 c62a: df 92 push r13 c62c: ef 92 push r14 c62e: ff 92 push r15 c630: 0f 93 push r16 c632: 1f 93 push r17 c634: cf 93 push r28 c636: df 93 push r29 c638: 00 d0 rcall .+0 ; 0xc63a c63a: cd b7 in r28, 0x3d ; 61 c63c: de b7 in r29, 0x3e ; 62 c63e: 8d ed ldi r24, 0xDD ; 221 c640: c8 2e mov r12, r24 c642: 82 e0 ldi r24, 0x02 ; 2 c644: d8 2e mov r13, r24 c646: 81 e5 ldi r24, 0x51 ; 81 c648: 95 e0 ldi r25, 0x05 ; 5 c64a: 9b 83 std Y+3, r25 ; 0x03 c64c: 8a 83 std Y+2, r24 ; 0x02 c64e: 90 e4 ldi r25, 0x40 ; 64 c650: e9 2e mov r14, r25 c652: 97 e0 ldi r25, 0x07 ; 7 c654: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c656: 33 24 eor r3, r3 c658: 33 94 inc r3 c65a: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c65c: f6 01 movw r30, r12 c65e: 81 91 ld r24, Z+ c660: 6f 01 movw r12, r30 c662: 0e 94 0d 5d call 0xba1a ; 0xba1a c666: 28 2e mov r2, r24 c668: 88 23 and r24, r24 c66a: 09 f4 brne .+2 ; 0xc66e c66c: a6 c0 rjmp .+332 ; 0xc7ba { bool relative = axis_relative_modes & mask; c66e: 10 91 dd 03 lds r17, 0x03DD ; 0x8003dd c672: 13 21 and r17, r3 destination[i] = code_value(); c674: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 c678: 2b 01 movw r4, r22 c67a: 3c 01 movw r6, r24 c67c: ea 81 ldd r30, Y+2 ; 0x02 c67e: fb 81 ldd r31, Y+3 ; 0x03 c680: 40 82 st Z, r4 c682: 51 82 std Z+1, r5 ; 0x01 c684: 62 82 std Z+2, r6 ; 0x02 c686: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c688: 03 30 cpi r16, 0x03 ; 3 c68a: 09 f0 breq .+2 ; 0xc68e c68c: 46 c0 rjmp .+140 ; 0xc71a 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; c68e: f1 e0 ldi r31, 0x01 ; 1 c690: f9 83 std Y+1, r31 ; 0x01 c692: 11 11 cpse r17, r1 c694: 01 c0 rjmp .+2 ; 0xc698 c696: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c698: 80 90 bb 02 lds r8, 0x02BB ; 0x8002bb c69c: 90 90 bc 02 lds r9, 0x02BC ; 0x8002bc c6a0: a0 90 bd 02 lds r10, 0x02BD ; 0x8002bd c6a4: b0 90 be 02 lds r11, 0x02BE ; 0x8002be if (emult != 1.) { c6a8: 20 e0 ldi r18, 0x00 ; 0 c6aa: 30 e0 ldi r19, 0x00 ; 0 c6ac: 40 e8 ldi r20, 0x80 ; 128 c6ae: 5f e3 ldi r21, 0x3F ; 63 c6b0: c5 01 movw r24, r10 c6b2: b4 01 movw r22, r8 c6b4: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> c6b8: 88 23 and r24, r24 c6ba: 59 f1 breq .+86 ; 0xc712 if (! relative) { c6bc: 11 11 cpse r17, r1 c6be: 15 c0 rjmp .+42 ; 0xc6ea destination[i] -= current_position[i]; c6c0: 20 91 4c 07 lds r18, 0x074C ; 0x80074c c6c4: 30 91 4d 07 lds r19, 0x074D ; 0x80074d c6c8: 40 91 4e 07 lds r20, 0x074E ; 0x80074e c6cc: 50 91 4f 07 lds r21, 0x074F ; 0x80074f c6d0: c3 01 movw r24, r6 c6d2: b2 01 movw r22, r4 c6d4: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> c6d8: 60 93 5d 05 sts 0x055D, r22 ; 0x80055d c6dc: 70 93 5e 05 sts 0x055E, r23 ; 0x80055e c6e0: 80 93 5f 05 sts 0x055F, r24 ; 0x80055f c6e4: 90 93 60 05 sts 0x0560, r25 ; 0x800560 relative = true; c6e8: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c6ea: a5 01 movw r20, r10 c6ec: 94 01 movw r18, r8 c6ee: 60 91 5d 05 lds r22, 0x055D ; 0x80055d c6f2: 70 91 5e 05 lds r23, 0x055E ; 0x80055e c6f6: 80 91 5f 05 lds r24, 0x055F ; 0x80055f c6fa: 90 91 60 05 lds r25, 0x0560 ; 0x800560 c6fe: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> c702: 60 93 5d 05 sts 0x055D, r22 ; 0x80055d c706: 70 93 5e 05 sts 0x055E, r23 ; 0x80055e c70a: 80 93 5f 05 sts 0x055F, r24 ; 0x80055f c70e: 90 93 60 05 sts 0x0560, r25 ; 0x800560 } } if (relative) c712: e9 81 ldd r30, Y+1 ; 0x01 c714: e1 11 cpse r30, r1 c716: 03 c0 rjmp .+6 ; 0xc71e c718: 22 c0 rjmp .+68 ; 0xc75e c71a: 11 23 and r17, r17 c71c: 99 f0 breq .+38 ; 0xc744 destination[i] += current_position[i]; c71e: f7 01 movw r30, r14 c720: 20 81 ld r18, Z c722: 31 81 ldd r19, Z+1 ; 0x01 c724: 42 81 ldd r20, Z+2 ; 0x02 c726: 53 81 ldd r21, Z+3 ; 0x03 c728: ea 81 ldd r30, Y+2 ; 0x02 c72a: fb 81 ldd r31, Y+3 ; 0x03 c72c: 60 81 ld r22, Z c72e: 71 81 ldd r23, Z+1 ; 0x01 c730: 82 81 ldd r24, Z+2 ; 0x02 c732: 93 81 ldd r25, Z+3 ; 0x03 c734: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> c738: ea 81 ldd r30, Y+2 ; 0x02 c73a: fb 81 ldd r31, Y+3 ; 0x03 c73c: 60 83 st Z, r22 c73e: 71 83 std Z+1, r23 ; 0x01 c740: 82 83 std Z+2, r24 ; 0x02 c742: 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) { c744: 0f 5f subi r16, 0xFF ; 255 c746: 33 0c add r3, r3 c748: 8a 81 ldd r24, Y+2 ; 0x02 c74a: 9b 81 ldd r25, Y+3 ; 0x03 c74c: 04 96 adiw r24, 0x04 ; 4 c74e: 9b 83 std Y+3, r25 ; 0x03 c750: 8a 83 std Y+2, r24 ; 0x02 c752: 94 e0 ldi r25, 0x04 ; 4 c754: e9 0e add r14, r25 c756: f1 1c adc r15, r1 c758: 04 30 cpi r16, 0x04 ; 4 c75a: 09 f0 breq .+2 ; 0xc75e c75c: 7f cf rjmp .-258 ; 0xc65c 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')) { c75e: 86 e4 ldi r24, 0x46 ; 70 c760: 0e 94 0d 5d call 0xba1a ; 0xba1a c764: 88 23 and r24, r24 c766: 99 f0 breq .+38 ; 0xc78e const float next_feedrate = code_value(); c768: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 c76c: 6b 01 movw r12, r22 c76e: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c770: 20 e0 ldi r18, 0x00 ; 0 c772: 30 e0 ldi r19, 0x00 ; 0 c774: a9 01 movw r20, r18 c776: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> c77a: 18 16 cp r1, r24 c77c: 44 f4 brge .+16 ; 0xc78e c77e: c0 92 90 02 sts 0x0290, r12 ; 0x800290 c782: d0 92 91 02 sts 0x0291, r13 ; 0x800291 c786: e0 92 92 02 sts 0x0292, r14 ; 0x800292 c78a: f0 92 93 02 sts 0x0293, r15 ; 0x800293 } } c78e: 0f 90 pop r0 c790: 0f 90 pop r0 c792: 0f 90 pop r0 c794: df 91 pop r29 c796: cf 91 pop r28 c798: 1f 91 pop r17 c79a: 0f 91 pop r16 c79c: ff 90 pop r15 c79e: ef 90 pop r14 c7a0: df 90 pop r13 c7a2: cf 90 pop r12 c7a4: bf 90 pop r11 c7a6: af 90 pop r10 c7a8: 9f 90 pop r9 c7aa: 8f 90 pop r8 c7ac: 7f 90 pop r7 c7ae: 6f 90 pop r6 c7b0: 5f 90 pop r5 c7b2: 4f 90 pop r4 c7b4: 3f 90 pop r3 c7b6: 2f 90 pop r2 c7b8: 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? c7ba: f7 01 movw r30, r14 c7bc: 80 81 ld r24, Z c7be: 91 81 ldd r25, Z+1 ; 0x01 c7c0: a2 81 ldd r26, Z+2 ; 0x02 c7c2: b3 81 ldd r27, Z+3 ; 0x03 c7c4: ea 81 ldd r30, Y+2 ; 0x02 c7c6: fb 81 ldd r31, Y+3 ; 0x03 c7c8: 80 83 st Z, r24 c7ca: 91 83 std Z+1, r25 ; 0x01 c7cc: a2 83 std Z+2, r26 ; 0x02 c7ce: b3 83 std Z+3, r27 ; 0x03 c7d0: b9 cf rjmp .-142 ; 0xc744 0000c7d2 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c7d2: 2f 92 push r2 c7d4: 3f 92 push r3 c7d6: 4f 92 push r4 c7d8: 5f 92 push r5 c7da: 6f 92 push r6 c7dc: 7f 92 push r7 c7de: 8f 92 push r8 c7e0: 9f 92 push r9 c7e2: af 92 push r10 c7e4: bf 92 push r11 c7e6: cf 92 push r12 c7e8: df 92 push r13 c7ea: ef 92 push r14 c7ec: ff 92 push r15 c7ee: 0f 93 push r16 c7f0: 1f 93 push r17 c7f2: cf 93 push r28 c7f4: df 93 push r29 c7f6: cd b7 in r28, 0x3d ; 61 c7f8: de b7 in r29, 0x3e ; 62 c7fa: 65 97 sbiw r28, 0x15 ; 21 c7fc: 0f b6 in r0, 0x3f ; 63 c7fe: f8 94 cli c800: de bf out 0x3e, r29 ; 62 c802: 0f be out 0x3f, r0 ; 63 c804: cd bf out 0x3d, r28 ; 61 c806: 69 8b std Y+17, r22 ; 0x11 c808: 7a 8b std Y+18, r23 ; 0x12 c80a: 8b 8b std Y+19, r24 ; 0x13 c80c: 9c 8b std Y+20, r25 ; 0x14 c80e: 49 01 movw r8, r18 c810: 5a 01 movw r10, r20 c812: 30 2e mov r3, r16 c814: cd 8a std Y+21, r12 ; 0x15 c816: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c818: 81 e0 ldi r24, 0x01 ; 1 c81a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c81e: df 92 push r13 c820: 2d 89 ldd r18, Y+21 ; 0x15 c822: 2f 93 push r18 c824: 1f 92 push r1 c826: ef 92 push r14 c828: 87 e2 ldi r24, 0x27 ; 39 c82a: 97 e6 ldi r25, 0x67 ; 103 c82c: 9f 93 push r25 c82e: 8f 93 push r24 c830: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c834: 81 e4 ldi r24, 0x41 ; 65 c836: 0e 94 0d 5d call 0xba1a ; 0xba1a c83a: 0f 90 pop r0 c83c: 0f 90 pop r0 c83e: 0f 90 pop r0 c840: 0f 90 pop r0 c842: 0f 90 pop r0 c844: 0f 90 pop r0 c846: 88 23 and r24, r24 c848: a1 f0 breq .+40 ; 0xc872 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c84a: 80 91 93 03 lds r24, 0x0393 ; 0x800393 c84e: 90 91 94 03 lds r25, 0x0394 ; 0x800394 c852: fc 01 movw r30, r24 c854: 21 81 ldd r18, Z+1 ; 0x01 c856: 28 37 cpi r18, 0x78 ; 120 c858: 09 f0 breq .+2 ; 0xc85c c85a: 69 c0 rjmp .+210 ; 0xc92e c85c: 40 e1 ldi r20, 0x10 ; 16 c85e: 50 e0 ldi r21, 0x00 ; 0 c860: 70 e0 ldi r23, 0x00 ; 0 c862: 60 e0 ldi r22, 0x00 ; 0 c864: 02 96 adiw r24, 0x02 ; 2 c866: 0f 94 9a d8 call 0x3b134 ; 0x3b134 c86a: 69 8b std Y+17, r22 ; 0x11 c86c: 7a 8b std Y+18, r23 ; 0x12 c86e: 8b 8b std Y+19, r24 ; 0x13 c870: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c872: 83 e4 ldi r24, 0x43 ; 67 c874: 0e 94 0d 5d call 0xba1a ; 0xba1a c878: 88 23 and r24, r24 c87a: 09 f4 brne .+2 ; 0xc87e c87c: 65 c0 rjmp .+202 ; 0xc948 count = code_value_long(); c87e: 0e 94 b9 5c call 0xb972 ; 0xb972 c882: 2b 01 movw r4, r22 c884: 3c 01 movw r6, r24 c886: c9 88 ldd r12, Y+17 ; 0x11 c888: da 88 ldd r13, Y+18 ; 0x12 c88a: eb 88 ldd r14, Y+19 ; 0x13 c88c: fc 88 ldd r15, Y+20 ; 0x14 c88e: 8c 14 cp r8, r12 c890: 9d 04 cpc r9, r13 c892: ae 04 cpc r10, r14 c894: bf 04 cpc r11, r15 c896: 10 f4 brcc .+4 ; 0xc89c c898: 75 01 movw r14, r10 c89a: 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) c89c: d3 01 movw r26, r6 c89e: c2 01 movw r24, r4 c8a0: 8c 0d add r24, r12 c8a2: 9d 1d adc r25, r13 c8a4: ae 1d adc r26, r14 c8a6: bf 1d adc r27, r15 c8a8: 88 16 cp r8, r24 c8aa: 99 06 cpc r9, r25 c8ac: aa 06 cpc r10, r26 c8ae: bb 06 cpc r11, r27 c8b0: 28 f0 brcs .+10 ; 0xc8bc c8b2: 8c 15 cp r24, r12 c8b4: 9d 05 cpc r25, r13 c8b6: ae 05 cpc r26, r14 c8b8: bf 05 cpc r27, r15 c8ba: 30 f4 brcc .+12 ; 0xc8c8 count = addr_end - addr_start; c8bc: 24 01 movw r4, r8 c8be: 35 01 movw r6, r10 c8c0: 4c 18 sub r4, r12 c8c2: 5d 08 sbc r5, r13 c8c4: 6e 08 sbc r6, r14 c8c6: 7f 08 sbc r7, r15 if (code_seen('X')) c8c8: 88 e5 ldi r24, 0x58 ; 88 c8ca: 0e 94 0d 5d call 0xba1a ; 0xba1a c8ce: 88 23 and r24, r24 c8d0: 09 f4 brne .+2 ; 0xc8d4 c8d2: 91 c0 rjmp .+290 ; 0xc9f6 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c8d4: 20 91 93 03 lds r18, 0x0393 ; 0x800393 c8d8: 30 91 94 03 lds r19, 0x0394 ; 0x800394 c8dc: 2f 5f subi r18, 0xFF ; 255 c8de: 3f 4f sbci r19, 0xFF ; 255 c8e0: fe 01 movw r30, r28 c8e2: 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; c8e4: 10 e0 ldi r17, 0x00 ; 0 c8e6: 00 e0 ldi r16, 0x00 ; 0 c8e8: 4f 01 movw r8, r30 c8ea: d9 01 movw r26, r18 while (*hex) c8ec: 8c 91 ld r24, X c8ee: 2f 5f subi r18, 0xFF ; 255 c8f0: 3f 4f sbci r19, 0xFF ; 255 c8f2: 88 23 and r24, r24 c8f4: 09 f4 brne .+2 ; 0xc8f8 c8f6: 3f c0 rjmp .+126 ; 0xc976 { if (count && (parsed >= count)) break; c8f8: 00 31 cpi r16, 0x10 ; 16 c8fa: 11 05 cpc r17, r1 c8fc: e1 f1 breq .+120 ; 0xc976 char c = *(hex++); if (c == ' ') continue; c8fe: 80 32 cpi r24, 0x20 ; 32 c900: a1 f3 breq .-24 ; 0xc8ea if (c == '\n') break; c902: 8a 30 cpi r24, 0x0A ; 10 c904: c1 f1 breq .+112 ; 0xc976 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c906: 90 ed ldi r25, 0xD0 ; 208 c908: 98 0f add r25, r24 c90a: 9a 30 cpi r25, 0x0A ; 10 c90c: 10 f5 brcc .+68 ; 0xc952 c90e: 82 95 swap r24 c910: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c912: 9d 01 movw r18, r26 c914: 2e 5f subi r18, 0xFE ; 254 c916: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c918: 11 96 adiw r26, 0x01 ; 1 c91a: 9c 91 ld r25, X c91c: 40 ed ldi r20, 0xD0 ; 208 c91e: 49 0f add r20, r25 c920: 4a 30 cpi r20, 0x0A ; 10 c922: f8 f4 brcc .+62 ; 0xc962 c924: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c926: 81 93 st Z+, r24 parsed++; c928: 0f 5f subi r16, 0xFF ; 255 c92a: 1f 4f sbci r17, 0xFF ; 255 c92c: de cf rjmp .-68 ; 0xc8ea { 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(); c92e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 c932: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> c936: 9b 01 movw r18, r22 c938: 77 0f add r23, r23 c93a: 44 0b sbc r20, r20 c93c: 55 0b sbc r21, r21 c93e: 29 8b std Y+17, r18 ; 0x11 c940: 3a 8b std Y+18, r19 ; 0x12 c942: 4b 8b std Y+19, r20 ; 0x13 c944: 5c 8b std Y+20, r21 ; 0x14 c946: 95 cf rjmp .-214 ; 0xc872 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 c948: 44 24 eor r4, r4 c94a: 4a 94 dec r4 c94c: 54 2c mov r5, r4 c94e: 32 01 movw r6, r4 c950: 9a cf rjmp .-204 ; 0xc886 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); c952: 9f e9 ldi r25, 0x9F ; 159 c954: 98 0f add r25, r24 c956: 96 30 cpi r25, 0x06 ; 6 c958: 58 f4 brcc .+22 ; 0xc970 c95a: 82 95 swap r24 c95c: 80 7f andi r24, 0xF0 ; 240 c95e: 80 57 subi r24, 0x70 ; 112 c960: d8 cf rjmp .-80 ; 0xc912 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c962: 4f e9 ldi r20, 0x9F ; 159 c964: 49 0f add r20, r25 c966: 46 30 cpi r20, 0x06 ; 6 c968: 18 f4 brcc .+6 ; 0xc970 c96a: 97 55 subi r25, 0x57 ; 87 c96c: 89 2b or r24, r25 c96e: db cf rjmp .-74 ; 0xc926 else return -parsed; c970: 11 95 neg r17 c972: 01 95 neg r16 c974: 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); c976: 28 01 movw r4, r16 c978: 01 2e mov r0, r17 c97a: 00 0c add r0, r0 c97c: 66 08 sbc r6, r6 c97e: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c980: da 8a std Y+18, r13 ; 0x12 c982: 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++) c984: b1 2c mov r11, r1 c986: a1 2c mov r10, r1 c988: 0a 15 cp r16, r10 c98a: 1b 05 cpc r17, r11 c98c: f1 f0 breq .+60 ; 0xc9ca { switch (type) c98e: 33 20 and r3, r3 c990: 39 f0 breq .+14 ; 0xc9a0 c992: 31 e0 ldi r19, 0x01 ; 1 c994: 33 16 cp r3, r19 c996: 71 f0 breq .+28 ; 0xc9b4 } // 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++) c998: 4f ef ldi r20, 0xFF ; 255 c99a: a4 1a sub r10, r20 c99c: b4 0a sbc r11, r20 c99e: f4 cf rjmp .-24 ; 0xc988 { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c9a0: f4 01 movw r30, r8 c9a2: ea 0d add r30, r10 c9a4: fb 1d adc r31, r11 c9a6: 80 81 ld r24, Z c9a8: e9 89 ldd r30, Y+17 ; 0x11 c9aa: fa 89 ldd r31, Y+18 ; 0x12 c9ac: ea 0d add r30, r10 c9ae: fb 1d adc r31, r11 c9b0: 80 83 st Z, r24 c9b2: f2 cf rjmp .-28 ; 0xc998 case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c9b4: f4 01 movw r30, r8 c9b6: ea 0d add r30, r10 c9b8: 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); c9ba: 60 81 ld r22, Z c9bc: 89 89 ldd r24, Y+17 ; 0x11 c9be: 9a 89 ldd r25, Y+18 ; 0x12 c9c0: 8a 0d add r24, r10 c9c2: 9b 1d adc r25, r11 c9c4: 0f 94 57 dd call 0x3baae ; 0x3baae c9c8: e7 cf rjmp .-50 ; 0xc998 { 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); c9ca: ff 92 push r15 c9cc: ef 92 push r14 c9ce: df 92 push r13 c9d0: cf 92 push r12 c9d2: 2f 92 push r2 c9d4: 5d 89 ldd r21, Y+21 ; 0x15 c9d6: 5f 93 push r21 c9d8: 7f 92 push r7 c9da: 6f 92 push r6 c9dc: 5f 92 push r5 c9de: 4f 92 push r4 c9e0: 8b ef ldi r24, 0xFB ; 251 c9e2: 96 e6 ldi r25, 0x66 ; 102 c9e4: 9f 93 push r25 c9e6: 8f 93 push r24 c9e8: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 c9ec: 0f b6 in r0, 0x3f ; 63 c9ee: f8 94 cli c9f0: de bf out 0x3e, r29 ; 62 c9f2: 0f be out 0x3f, r0 ; 63 c9f4: 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); c9f6: 03 2d mov r16, r3 c9f8: a3 01 movw r20, r6 c9fa: 92 01 movw r18, r4 c9fc: c7 01 movw r24, r14 c9fe: b6 01 movw r22, r12 ca00: 0f 94 5a 85 call 0x30ab4 ; 0x30ab4 } ca04: 65 96 adiw r28, 0x15 ; 21 ca06: 0f b6 in r0, 0x3f ; 63 ca08: f8 94 cli ca0a: de bf out 0x3e, r29 ; 62 ca0c: 0f be out 0x3f, r0 ; 63 ca0e: cd bf out 0x3d, r28 ; 61 ca10: df 91 pop r29 ca12: cf 91 pop r28 ca14: 1f 91 pop r17 ca16: 0f 91 pop r16 ca18: ff 90 pop r15 ca1a: ef 90 pop r14 ca1c: df 90 pop r13 ca1e: cf 90 pop r12 ca20: bf 90 pop r11 ca22: af 90 pop r10 ca24: 9f 90 pop r9 ca26: 8f 90 pop r8 ca28: 7f 90 pop r7 ca2a: 6f 90 pop r6 ca2c: 5f 90 pop r5 ca2e: 4f 90 pop r4 ca30: 3f 90 pop r3 ca32: 2f 90 pop r2 ca34: 08 95 ret 0000ca36 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); ca36: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> ca3a: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> ca3e: 90 e0 ldi r25, 0x00 ; 0 ca40: 8a 30 cpi r24, 0x0A ; 10 ca42: 20 f0 brcs .+8 ; 0xca4c ca44: 89 5a subi r24, 0xA9 ; 169 ca46: 9f 4f sbci r25, 0xFF ; 255 ca48: 0d 94 77 db jmp 0x3b6ee ; 0x3b6ee ca4c: c0 96 adiw r24, 0x30 ; 48 ca4e: fc cf rjmp .-8 ; 0xca48 0000ca50 : 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); ca50: 84 ff sbrs r24, 4 ca52: 18 c0 rjmp .+48 ; 0xca84 ca54: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); ca56: 85 ff sbrs r24, 5 ca58: 17 c0 rjmp .+46 ; 0xca88 ca5a: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); ca5c: 2f b7 in r18, 0x3f ; 63 ca5e: 86 ff sbrs r24, 6 ca60: 15 c0 rjmp .+42 ; 0xca8c ca62: f8 94 cli ca64: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ca68: 90 68 ori r25, 0x80 ; 128 ca6a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ca6e: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); ca70: 87 ff sbrs r24, 7 ca72: 11 c0 rjmp .+34 ; 0xca96 ca74: 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); ca76: 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); ca78: 85 e0 ldi r24, 0x05 ; 5 ca7a: 8a 95 dec r24 ca7c: f1 f7 brne .-4 ; 0xca7a ca7e: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); ca80: 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(); } ca82: 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); ca84: 8d 98 cbi 0x11, 5 ; 17 ca86: e7 cf rjmp .-50 ; 0xca56 WRITE(LCD_PINS_D5, value & 0x20); ca88: a4 98 cbi 0x14, 4 ; 20 ca8a: e8 cf rjmp .-48 ; 0xca5c WRITE(LCD_PINS_D6, value & 0x40); ca8c: f8 94 cli ca8e: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ca92: 9f 77 andi r25, 0x7F ; 127 ca94: ea cf rjmp .-44 ; 0xca6a WRITE(LCD_PINS_D7, value & 0x80); ca96: a3 98 cbi 0x14, 3 ; 20 ca98: ee cf rjmp .-36 ; 0xca76 0000ca9a : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { ca9a: 0f 93 push r16 ca9c: 1f 93 push r17 ca9e: cf 93 push r28 caa0: df 93 push r29 caa2: c8 2f mov r28, r24 caa4: d6 2f mov r29, r22 caa6: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); caa8: 60 ff sbrs r22, 0 caaa: 15 c0 rjmp .+42 ; 0xcad6 caac: 5d 9a sbi 0x0b, 5 ; 11 caae: 8a e1 ldi r24, 0x1A ; 26 cab0: 8a 95 dec r24 cab2: f1 f7 brne .-4 ; 0xcab0 cab4: 00 c0 rjmp .+0 ; 0xcab6 _delay_us(5); lcd_writebits(data); cab6: 8c 2f mov r24, r28 cab8: 0e 94 28 65 call 0xca50 ; 0xca50 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { cabc: d1 fd sbrc r29, 1 cabe: 04 c0 rjmp .+8 ; 0xcac8 // _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 cac0: 8c 2f mov r24, r28 cac2: 82 95 swap r24 cac4: 0e 94 28 65 call 0xca50 ; 0xca50 } #endif delayMicroseconds(duration); cac8: c8 01 movw r24, r16 } caca: df 91 pop r29 cacc: cf 91 pop r28 cace: 1f 91 pop r17 cad0: 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); cad2: 0c 94 35 de jmp 0x1bc6a ; 0x1bc6a 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); cad6: 5d 98 cbi 0x0b, 5 ; 11 cad8: ea cf rjmp .-44 ; 0xcaae 0000cada : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { cada: cf 92 push r12 cadc: df 92 push r13 cade: ef 92 push r14 cae0: ff 92 push r15 cae2: cf 93 push r28 cae4: df 93 push r29 cae6: ec 01 movw r28, r24 cae8: 6a 01 movw r12, r20 caea: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) caec: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e caf0: 6f 3f cpi r22, 0xFF ; 255 caf2: 7f 4f sbci r23, 0xFF ; 255 caf4: 8f 4f sbci r24, 0xFF ; 255 caf6: 9f 4f sbci r25, 0xFF ; 255 caf8: 59 f4 brne .+22 ; 0xcb10 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); cafa: b7 01 movw r22, r14 cafc: a6 01 movw r20, r12 cafe: 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); } cb00: df 91 pop r29 cb02: cf 91 pop r28 cb04: ff 90 pop r15 cb06: ef 90 pop r14 cb08: df 90 pop r13 cb0a: 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); cb0c: 0d 94 65 dd jmp 0x3baca ; 0x3baca } 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); } cb10: df 91 pop r29 cb12: cf 91 pop r28 cb14: ff 90 pop r15 cb16: ef 90 pop r14 cb18: df 90 pop r13 cb1a: cf 90 pop r12 cb1c: 08 95 ret 0000cb1e : /// 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)); cb1e: 80 e1 ldi r24, 0x10 ; 16 cb20: e0 e4 ldi r30, 0x40 ; 64 cb22: f7 e0 ldi r31, 0x07 ; 7 cb24: ab e9 ldi r26, 0x9B ; 155 cb26: b2 e0 ldi r27, 0x02 ; 2 cb28: 01 90 ld r0, Z+ cb2a: 0d 92 st X+, r0 cb2c: 8a 95 dec r24 cb2e: e1 f7 brne .-8 ; 0xcb28 saved_feedmultiply2 = feedmultiply; //save feedmultiply cb30: 80 91 39 02 lds r24, 0x0239 ; 0x800239 cb34: 90 91 3a 02 lds r25, 0x023A ; 0x80023a cb38: 90 93 70 03 sts 0x0370, r25 ; 0x800370 cb3c: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); cb40: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a cb44: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b cb48: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab cb4c: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa saved_bed_temperature = (uint8_t)degTargetBed(); cb50: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 cb54: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; cb58: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd cb5c: 83 fb bst r24, 3 cb5e: 88 27 eor r24, r24 cb60: 80 f9 bld r24, 0 cb62: 80 93 03 18 sts 0x1803, r24 ; 0x801803 saved_fan_speed = fanSpeed; cb66: 80 91 df 03 lds r24, 0x03DF ; 0x8003df cb6a: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 isPartialBackupAvailable = true; cb6e: 81 e0 ldi r24, 0x01 ; 1 cb70: 80 93 50 07 sts 0x0750, r24 ; 0x800750 } cb74: 08 95 ret 0000cb76 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } cb76: cf 93 push r28 cb78: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { cb7a: 8b ef ldi r24, 0xFB ; 251 cb7c: 96 e1 ldi r25, 0x16 ; 22 cb7e: 0e 94 4d 79 call 0xf29a ; 0xf29a #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader cb82: 89 e3 ldi r24, 0x39 ; 57 cb84: 95 e1 ldi r25, 0x15 ; 21 cb86: 89 2b or r24, r25 cb88: 51 f0 breq .+20 ; 0xcb9e <_GLOBAL__sub_D_card+0x28> cb8a: cb e0 ldi r28, 0x0B ; 11 cb8c: d6 e1 ldi r29, 0x16 ; 22 cb8e: a3 97 sbiw r28, 0x23 ; 35 cb90: ce 01 movw r24, r28 cb92: 0e 94 4d 79 call 0xf29a ; 0xf29a cb96: 85 e1 ldi r24, 0x15 ; 21 cb98: c9 33 cpi r28, 0x39 ; 57 cb9a: d8 07 cpc r29, r24 cb9c: c1 f7 brne .-16 ; 0xcb8e <_GLOBAL__sub_D_card+0x18> cb9e: 86 e1 ldi r24, 0x16 ; 22 cba0: 95 e1 ldi r25, 0x15 ; 21 cba2: 0e 94 4d 79 call 0xf29a ; 0xf29a cba6: 81 ef ldi r24, 0xF1 ; 241 cba8: 94 e1 ldi r25, 0x14 ; 20 cbaa: df 91 pop r29 cbac: cf 91 pop r28 cbae: 0c 94 4d 79 jmp 0xf29a ; 0xf29a 0000cbb2 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { cbb2: cf 93 push r28 cbb4: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; cbb6: c0 e4 ldi r28, 0x40 ; 64 cbb8: d7 e0 ldi r29, 0x07 ; 7 cbba: 20 e0 ldi r18, 0x00 ; 0 cbbc: 30 e0 ldi r19, 0x00 ; 0 cbbe: 48 ec ldi r20, 0xC8 ; 200 cbc0: 51 e4 ldi r21, 0x41 ; 65 cbc2: 6c 85 ldd r22, Y+12 ; 0x0c cbc4: 7d 85 ldd r23, Y+13 ; 0x0d cbc6: 8e 85 ldd r24, Y+14 ; 0x0e cbc8: 9f 85 ldd r25, Y+15 ; 0x0f cbca: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> cbce: 6c 87 std Y+12, r22 ; 0x0c cbd0: 7d 87 std Y+13, r23 ; 0x0d cbd2: 8e 87 std Y+14, r24 ; 0x0e cbd4: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cbd6: 63 e3 ldi r22, 0x33 ; 51 cbd8: 73 e3 ldi r23, 0x33 ; 51 cbda: 83 e5 ldi r24, 0x53 ; 83 cbdc: 90 e4 ldi r25, 0x40 ; 64 } cbde: df 91 pop r29 cbe0: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cbe2: 0d 94 11 ba jmp 0x37422 ; 0x37422 0000cbe6 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); cbe6: 60 e0 ldi r22, 0x00 ; 0 cbe8: 85 ea ldi r24, 0xA5 ; 165 cbea: 9f e0 ldi r25, 0x0F ; 15 cbec: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 cbf0: 60 e0 ldi r22, 0x00 ; 0 cbf2: 8f e7 ldi r24, 0x7F ; 127 cbf4: 9c e0 ldi r25, 0x0C ; 12 cbf6: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 // 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; cbfa: 80 e0 ldi r24, 0x00 ; 0 cbfc: 90 e0 ldi r25, 0x00 ; 0 cbfe: a0 e8 ldi r26, 0x80 ; 128 cc00: bf eb ldi r27, 0xBF ; 191 cc02: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab cc06: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac cc0a: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad cc0e: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cc12: 82 e0 ldi r24, 0x02 ; 2 cc14: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; cc18: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 } cc1c: 08 95 ret 0000cc1e : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) cc1e: 80 91 aa 05 lds r24, 0x05AA ; 0x8005aa cc22: 90 91 ab 05 lds r25, 0x05AB ; 0x8005ab cc26: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a cc2a: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b cc2e: 28 17 cp r18, r24 cc30: 39 07 cpc r19, r25 cc32: 71 f0 breq .+28 ; 0xcc50 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; cc34: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b cc38: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; cc3c: 81 e0 ldi r24, 0x01 ; 1 cc3e: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db wait_for_heater(_millis(), active_extruder); cc42: 0f 94 55 3e call 0x27caa ; 0x27caa cc46: 0f 94 12 81 call 0x30224 ; 0x30224 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; cc4a: 82 e0 ldi r24, 0x02 ; 2 cc4c: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db } } cc50: 08 95 ret 0000cc52 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { cc52: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 cc56: 88 23 and r24, r24 cc58: 41 f0 breq .+16 ; 0xcc6a // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; cc5a: 80 91 39 02 lds r24, 0x0239 ; 0x800239 cc5e: 90 91 3a 02 lds r25, 0x023A ; 0x80023a cc62: 90 93 70 03 sts 0x0370, r25 ; 0x800370 cc66: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f } cc6a: 08 95 ret 0000cc6c : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) cc6c: 80 91 9f 05 lds r24, 0x059F ; 0x80059f cc70: 90 91 a0 05 lds r25, 0x05A0 ; 0x8005a0 cc74: 00 97 sbiw r24, 0x00 ; 0 cc76: 29 f1 breq .+74 ; 0xccc2 cc78: 20 91 56 0e lds r18, 0x0E56 ; 0x800e56 cc7c: 21 11 cpse r18, r1 cc7e: 21 c0 rjmp .+66 ; 0xccc2 cc80: 20 91 55 0e lds r18, 0x0E55 ; 0x800e55 cc84: 21 11 cpse r18, r1 cc86: 1d c0 rjmp .+58 ; 0xccc2 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); cc88: fc 01 movw r30, r24 cc8a: e8 5a subi r30, 0xA8 ; 168 cc8c: ff 4f sbci r31, 0xFF ; 255 cc8e: 20 e1 ldi r18, 0x10 ; 16 cc90: ab ea ldi r26, 0xAB ; 171 cc92: b2 e0 ldi r27, 0x02 ; 2 cc94: 01 90 ld r0, Z+ cc96: 0d 92 st X+, r0 cc98: 2a 95 dec r18 cc9a: e1 f7 brne .-8 ; 0xcc94 saved_feedrate2 = current_block->gcode_feedrate; cc9c: fc 01 movw r30, r24 cc9e: e6 59 subi r30, 0x96 ; 150 cca0: ff 4f sbci r31, 0xFF ; 255 cca2: 20 81 ld r18, Z cca4: 31 81 ldd r19, Z+1 ; 0x01 cca6: 30 93 fe 17 sts 0x17FE, r19 ; 0x8017fe ccaa: 20 93 fd 17 sts 0x17FD, r18 ; 0x8017fd saved_segment_idx = current_block->segment_idx; ccae: 88 59 subi r24, 0x98 ; 152 ccb0: 9f 4f sbci r25, 0xFF ; 255 ccb2: fc 01 movw r30, r24 ccb4: 80 81 ld r24, Z ccb6: 91 81 ldd r25, Z+1 ; 0x01 ccb8: 90 93 09 18 sts 0x1809, r25 ; 0x801809 ccbc: 80 93 08 18 sts 0x1808, r24 ; 0x801808 ccc0: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; ccc2: 80 e0 ldi r24, 0x00 ; 0 ccc4: 90 e0 ldi r25, 0x00 ; 0 ccc6: a0 e8 ldi r26, 0x80 ; 128 ccc8: bf eb ldi r27, 0xBF ; 191 ccca: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab ccce: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac ccd2: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad ccd6: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_feedrate2 = feedrate; ccda: 60 91 90 02 lds r22, 0x0290 ; 0x800290 ccde: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cce2: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cce6: 90 91 93 02 lds r25, 0x0293 ; 0x800293 ccea: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> ccee: 70 93 fe 17 sts 0x17FE, r23 ; 0x8017fe ccf2: 60 93 fd 17 sts 0x17FD, r22 ; 0x8017fd saved_segment_idx = 0; ccf6: 10 92 09 18 sts 0x1809, r1 ; 0x801809 ccfa: 10 92 08 18 sts 0x1808, r1 ; 0x801808 } } ccfe: 08 95 ret 0000cd00 : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { cd00: cf 92 push r12 cd02: df 92 push r13 cd04: ef 92 push r14 cd06: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { cd08: 80 91 6b 14 lds r24, 0x146B ; 0x80146b cd0c: 88 23 and r24, r24 cd0e: d9 f1 breq .+118 ; 0xcd86 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue cd10: 80 91 80 03 lds r24, 0x0380 ; 0x800380 cd14: 90 91 81 03 lds r25, 0x0381 ; 0x800381 cd18: a0 91 82 03 lds r26, 0x0382 ; 0x800382 cd1c: b0 91 83 03 lds r27, 0x0383 ; 0x800383 cd20: 80 93 ff 17 sts 0x17FF, r24 ; 0x8017ff cd24: 90 93 00 18 sts 0x1800, r25 ; 0x801800 cd28: a0 93 01 18 sts 0x1801, r26 ; 0x801801 cd2c: b0 93 02 18 sts 0x1802, r27 ; 0x801802 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner cd30: 0f 94 d3 a9 call 0x353a6 ; 0x353a6 saved_sdpos -= sdlen_planner; cd34: c0 90 ff 17 lds r12, 0x17FF ; 0x8017ff cd38: d0 90 00 18 lds r13, 0x1800 ; 0x801800 cd3c: e0 90 01 18 lds r14, 0x1801 ; 0x801801 cd40: f0 90 02 18 lds r15, 0x1802 ; 0x801802 cd44: c8 1a sub r12, r24 cd46: d9 0a sbc r13, r25 cd48: e1 08 sbc r14, r1 cd4a: f1 08 sbc r15, r1 cd4c: c0 92 ff 17 sts 0x17FF, r12 ; 0x8017ff cd50: d0 92 00 18 sts 0x1800, r13 ; 0x801800 cd54: e0 92 01 18 sts 0x1801, r14 ; 0x801801 cd58: f0 92 02 18 sts 0x1802, r15 ; 0x801802 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue cd5c: 0e 94 4a 5c call 0xb894 ; 0xb894 saved_sdpos -= sdlen_cmdqueue; cd60: c8 1a sub r12, r24 cd62: d9 0a sbc r13, r25 cd64: e1 08 sbc r14, r1 cd66: f1 08 sbc r15, r1 cd68: c0 92 ff 17 sts 0x17FF, r12 ; 0x8017ff cd6c: d0 92 00 18 sts 0x1800, r13 ; 0x801800 cd70: e0 92 01 18 sts 0x1801, r14 ; 0x801801 cd74: f0 92 02 18 sts 0x1802, r15 ; 0x801802 saved_printing_type = PowerPanic::PRINT_TYPE_SD; cd78: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } cd7c: ff 90 pop r15 cd7e: ef 90 pop r14 cd80: df 90 pop r13 cd82: cf 90 pop r12 cd84: 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 cd86: 80 91 0e 05 lds r24, 0x050E ; 0x80050e cd8a: 88 23 and r24, r24 cd8c: b1 f1 breq .+108 ; 0xcdfa saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue cd8e: 80 91 78 03 lds r24, 0x0378 ; 0x800378 cd92: 90 91 79 03 lds r25, 0x0379 ; 0x800379 cd96: a0 91 7a 03 lds r26, 0x037A ; 0x80037a cd9a: b0 91 7b 03 lds r27, 0x037B ; 0x80037b cd9e: 80 93 ff 17 sts 0x17FF, r24 ; 0x8017ff cda2: 90 93 00 18 sts 0x1800, r25 ; 0x801800 cda6: a0 93 01 18 sts 0x1801, r26 ; 0x801801 cdaa: b0 93 02 18 sts 0x1802, r27 ; 0x801802 //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 cdae: 0f 94 d3 a9 call 0x353a6 ; 0x353a6 saved_sdpos -= nlines; cdb2: 40 91 ff 17 lds r20, 0x17FF ; 0x8017ff cdb6: 50 91 00 18 lds r21, 0x1800 ; 0x801800 cdba: 60 91 01 18 lds r22, 0x1801 ; 0x801801 cdbe: 70 91 02 18 lds r23, 0x1802 ; 0x801802 cdc2: 48 1b sub r20, r24 cdc4: 51 09 sbc r21, r1 cdc6: 61 09 sbc r22, r1 cdc8: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer cdca: 80 91 7e 10 lds r24, 0x107E ; 0x80107e cdce: 90 91 7f 10 lds r25, 0x107F ; 0x80107f cdd2: 09 2e mov r0, r25 cdd4: 00 0c add r0, r0 cdd6: aa 0b sbc r26, r26 cdd8: bb 0b sbc r27, r27 cdda: 48 1b sub r20, r24 cddc: 59 0b sbc r21, r25 cdde: 6a 0b sbc r22, r26 cde0: 7b 0b sbc r23, r27 cde2: 40 93 ff 17 sts 0x17FF, r20 ; 0x8017ff cde6: 50 93 00 18 sts 0x1800, r21 ; 0x801800 cdea: 60 93 01 18 sts 0x1801, r22 ; 0x801801 cdee: 70 93 02 18 sts 0x1802, r23 ; 0x801802 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; cdf2: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cdf4: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a cdf8: c1 cf rjmp .-126 ; 0xcd7c cdfa: 82 e0 ldi r24, 0x02 ; 2 cdfc: fb cf rjmp .-10 ; 0xcdf4 0000cdfe : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { cdfe: cf 92 push r12 ce00: df 92 push r13 ce02: ef 92 push r14 ce04: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); ce06: c0 90 03 07 lds r12, 0x0703 ; 0x800703 ce0a: d0 90 04 07 lds r13, 0x0704 ; 0x800704 ce0e: e0 90 05 07 lds r14, 0x0705 ; 0x800705 ce12: f0 90 06 07 lds r15, 0x0706 ; 0x800706 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { ce16: 80 91 02 07 lds r24, 0x0702 ; 0x800702 ce1a: 88 23 and r24, r24 ce1c: 09 f4 brne .+2 ; 0xce20 ce1e: 4e c0 rjmp .+156 ; 0xcebc ce20: 20 e0 ldi r18, 0x00 ; 0 ce22: 30 e0 ldi r19, 0x00 ; 0 ce24: a9 01 movw r20, r18 ce26: c7 01 movw r24, r14 ce28: b6 01 movw r22, r12 ce2a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> ce2e: 18 16 cp r1, r24 ce30: 0c f0 brlt .+2 ; 0xce34 ce32: 44 c0 rjmp .+136 ; 0xcebc float area = M_PI * diameter * diameter * 0.25; ce34: 2b ed ldi r18, 0xDB ; 219 ce36: 3f e0 ldi r19, 0x0F ; 15 ce38: 49 e4 ldi r20, 0x49 ; 73 ce3a: 50 e4 ldi r21, 0x40 ; 64 ce3c: c7 01 movw r24, r14 ce3e: b6 01 movw r22, r12 ce40: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> ce44: a7 01 movw r20, r14 ce46: 96 01 movw r18, r12 ce48: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> ce4c: 20 e0 ldi r18, 0x00 ; 0 ce4e: 30 e0 ldi r19, 0x00 ; 0 ce50: 40 e8 ldi r20, 0x80 ; 128 ce52: 5e e3 ldi r21, 0x3E ; 62 ce54: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> ce58: 9b 01 movw r18, r22 ce5a: ac 01 movw r20, r24 out = 1.f / area; ce5c: 60 e0 ldi r22, 0x00 ; 0 ce5e: 70 e0 ldi r23, 0x00 ; 0 ce60: 80 e8 ldi r24, 0x80 ; 128 ce62: 9f e3 ldi r25, 0x3F ; 63 ce64: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> ce68: 6b 01 movw r12, r22 ce6a: 7c 01 movw r14, r24 } if (extrudemultiply != 100) ce6c: 60 91 94 02 lds r22, 0x0294 ; 0x800294 ce70: 70 91 95 02 lds r23, 0x0295 ; 0x800295 ce74: 64 36 cpi r22, 0x64 ; 100 ce76: 71 05 cpc r23, r1 ce78: a1 f0 breq .+40 ; 0xcea2 out *= float(extrudemultiply) * 0.01f; ce7a: 07 2e mov r0, r23 ce7c: 00 0c add r0, r0 ce7e: 88 0b sbc r24, r24 ce80: 99 0b sbc r25, r25 ce82: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> ce86: 2a e0 ldi r18, 0x0A ; 10 ce88: 37 ed ldi r19, 0xD7 ; 215 ce8a: 43 e2 ldi r20, 0x23 ; 35 ce8c: 5c e3 ldi r21, 0x3C ; 60 ce8e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> ce92: 9b 01 movw r18, r22 ce94: ac 01 movw r20, r24 ce96: c7 01 movw r24, r14 ce98: b6 01 movw r22, r12 ce9a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> ce9e: 6b 01 movw r12, r22 cea0: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cea2: c0 92 bb 02 sts 0x02BB, r12 ; 0x8002bb cea6: d0 92 bc 02 sts 0x02BC, r13 ; 0x8002bc ceaa: e0 92 bd 02 sts 0x02BD, r14 ; 0x8002bd ceae: 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 } ceb2: ff 90 pop r15 ceb4: ef 90 pop r14 ceb6: df 90 pop r13 ceb8: cf 90 pop r12 ceba: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; cebc: c1 2c mov r12, r1 cebe: d1 2c mov r13, r1 cec0: 80 e8 ldi r24, 0x80 ; 128 cec2: e8 2e mov r14, r24 cec4: 8f e3 ldi r24, 0x3F ; 63 cec6: f8 2e mov r15, r24 cec8: d1 cf rjmp .-94 ; 0xce6c 0000ceca : } } #endif //FAST_PWM_FAN void save_statistics() { ceca: 8f 92 push r8 cecc: 9f 92 push r9 cece: af 92 push r10 ced0: bf 92 push r11 ced2: cf 92 push r12 ced4: df 92 push r13 ced6: ef 92 push r14 ced8: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter ceda: 81 ef ldi r24, 0xF1 ; 241 cedc: 9f e0 ldi r25, 0x0F ; 15 cede: 0f 94 fc 7a call 0x2f5f8 ; 0x2f5f8 cee2: 6b 01 movw r12, r22 cee4: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cee6: 8d ee ldi r24, 0xED ; 237 cee8: 9f e0 ldi r25, 0x0F ; 15 ceea: 0f 94 fc 7a call 0x2f5f8 ; 0x2f5f8 ceee: 4b 01 movw r8, r22 cef0: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; cef2: 0f 94 ad 53 call 0x2a75a ; 0x2a75a cef6: 2c e3 ldi r18, 0x3C ; 60 cef8: 30 e0 ldi r19, 0x00 ; 0 cefa: 40 e0 ldi r20, 0x00 ; 0 cefc: 50 e0 ldi r21, 0x00 ; 0 cefe: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min cf02: ba 01 movw r22, r20 cf04: a9 01 movw r20, r18 cf06: 48 0d add r20, r8 cf08: 59 1d adc r21, r9 cf0a: 6a 1d adc r22, r10 cf0c: 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); cf0e: 8d ee ldi r24, 0xED ; 237 cf10: 9f e0 ldi r25, 0x0F ; 15 cf12: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); cf16: 60 91 5f 06 lds r22, 0x065F ; 0x80065f cf1a: 70 91 60 06 lds r23, 0x0660 ; 0x800660 cf1e: 80 91 61 06 lds r24, 0x0661 ; 0x800661 cf22: 90 91 62 06 lds r25, 0x0662 ; 0x800662 cf26: 28 ee ldi r18, 0xE8 ; 232 cf28: 33 e0 ldi r19, 0x03 ; 3 cf2a: 40 e0 ldi r20, 0x00 ; 0 cf2c: 50 e0 ldi r21, 0x00 ; 0 cf2e: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> cf32: ba 01 movw r22, r20 cf34: a9 01 movw r20, r18 cf36: 4c 0d add r20, r12 cf38: 5d 1d adc r21, r13 cf3a: 6e 1d adc r22, r14 cf3c: 7f 1d adc r23, r15 cf3e: 81 ef ldi r24, 0xF1 ; 241 cf40: 9f e0 ldi r25, 0x0F ; 15 cf42: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a print_job_timer.reset(); cf46: 0f 94 65 57 call 0x2aeca ; 0x2aeca total_filament_used = 0; cf4a: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f cf4e: 10 92 60 06 sts 0x0660, r1 ; 0x800660 cf52: 10 92 61 06 sts 0x0661, r1 ; 0x800661 cf56: 10 92 62 06 sts 0x0662, r1 ; 0x800662 if (MMU2::mmu2.Enabled()) { cf5a: 80 91 95 13 lds r24, 0x1395 ; 0x801395 cf5e: 81 30 cpi r24, 0x01 ; 1 cf60: 81 f4 brne .+32 ; 0xcf82 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); cf62: 60 91 99 13 lds r22, 0x1399 ; 0x801399 cf66: 70 91 9a 13 lds r23, 0x139A ; 0x80139a cf6a: 90 e0 ldi r25, 0x00 ; 0 cf6c: 80 e0 ldi r24, 0x00 ; 0 cf6e: 0f 94 e4 7a call 0x2f5c8 ; 0x2f5c8 /// @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; }; cf72: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a cf76: 10 92 99 13 sts 0x1399, r1 ; 0x801399 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } cf7a: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c cf7e: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b // @@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 } } cf82: ff 90 pop r15 cf84: ef 90 pop r14 cf86: df 90 pop r13 cf88: cf 90 pop r12 cf8a: bf 90 pop r11 cf8c: af 90 pop r10 cf8e: 9f 90 pop r9 cf90: 8f 90 pop r8 cf92: 08 95 ret 0000cf94 : } #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); cf94: 80 91 df 03 lds r24, 0x03DF ; 0x8003df cf98: 1f 92 push r1 cf9a: 8f 93 push r24 cf9c: 80 91 69 03 lds r24, 0x0369 ; 0x800369 cfa0: 1f 92 push r1 cfa2: 8f 93 push r24 cfa4: ee ea ldi r30, 0xAE ; 174 cfa6: f4 e0 ldi r31, 0x04 ; 4 cfa8: 42 81 ldd r20, Z+2 ; 0x02 cfaa: 53 81 ldd r21, Z+3 ; 0x03 cfac: 2c e3 ldi r18, 0x3C ; 60 cfae: 24 9f mul r18, r20 cfb0: c0 01 movw r24, r0 cfb2: 25 9f mul r18, r21 cfb4: 90 0d add r25, r0 cfb6: 11 24 eor r1, r1 cfb8: 9f 93 push r25 cfba: 8f 93 push r24 cfbc: 40 81 ld r20, Z cfbe: 51 81 ldd r21, Z+1 ; 0x01 cfc0: 24 9f mul r18, r20 cfc2: c0 01 movw r24, r0 cfc4: 25 9f mul r18, r21 cfc6: 90 0d add r25, r0 cfc8: 11 24 eor r1, r1 cfca: 9f 93 push r25 cfcc: 8f 93 push r24 cfce: 8e eb ldi r24, 0xBE ; 190 cfd0: 97 e6 ldi r25, 0x67 ; 103 cfd2: 9f 93 push r25 cfd4: 8f 93 push r24 cfd6: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 cfda: 8d b7 in r24, 0x3d ; 61 cfdc: 9e b7 in r25, 0x3e ; 62 cfde: 0a 96 adiw r24, 0x0a ; 10 cfe0: 0f b6 in r0, 0x3f ; 63 cfe2: f8 94 cli cfe4: 9e bf out 0x3e, r25 ; 62 cfe6: 0f be out 0x3f, r0 ; 63 cfe8: 8d bf out 0x3d, r24 ; 61 } cfea: 08 95 ret 0000cfec : // 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) { cfec: cf 93 push r28 cfee: 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); cff0: 8f ef ldi r24, 0xFF ; 255 cff2: 9f e0 ldi r25, 0x0F ; 15 cff4: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { cff8: 81 30 cpi r24, 0x01 ; 1 cffa: 21 f0 breq .+8 ; 0xd004 cffc: 80 91 69 06 lds r24, 0x0669 ; 0x800669 d000: 81 30 cpi r24, 0x01 ; 1 d002: 29 f4 brne .+10 ; 0xd00e //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); d004: 81 e0 ldi r24, 0x01 ; 1 d006: 8c 27 eor r24, r28 } } d008: 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); d00a: 0c 94 cf 61 jmp 0xc39e ; 0xc39e } } d00e: cf 91 pop r28 d010: 08 95 ret 0000d012 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); d012: 84 e8 ldi r24, 0x84 ; 132 d014: 93 e0 ldi r25, 0x03 ; 3 d016: 0d 94 f8 40 jmp 0x281f0 ; 0x281f0 ::start()> 0000d01a : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; d01a: 20 e0 ldi r18, 0x00 ; 0 d01c: 30 e0 ldi r19, 0x00 ; 0 d01e: 40 e7 ldi r20, 0x70 ; 112 d020: 52 e4 ldi r21, 0x42 ; 66 d022: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> } d026: 08 95 ret 0000d028 : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; d028: 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; d02c: 40 91 64 03 lds r20, 0x0364 ; 0x800364 d030: 50 91 65 03 lds r21, 0x0365 ; 0x800365 d034: 60 91 66 03 lds r22, 0x0366 ; 0x800366 d038: 70 91 67 03 lds r23, 0x0367 ; 0x800367 d03c: 40 93 90 02 sts 0x0290, r20 ; 0x800290 d040: 50 93 91 02 sts 0x0291, r21 ; 0x800291 d044: 60 93 92 02 sts 0x0292, r22 ; 0x800292 d048: 70 93 93 02 sts 0x0293, r23 ; 0x800293 feedmultiply = original_feedmultiply; d04c: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d050: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); d054: 84 e8 ldi r24, 0x84 ; 132 d056: 93 e0 ldi r25, 0x03 ; 3 d058: 0d 94 f8 40 jmp 0x281f0 ; 0x281f0 ::start()> 0000d05c : 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) { d05c: 1f 93 push r17 d05e: cf 93 push r28 d060: df 93 push r29 d062: 18 2f mov r17, r24 saved_feedrate = feedrate; d064: 80 91 90 02 lds r24, 0x0290 ; 0x800290 d068: 90 91 91 02 lds r25, 0x0291 ; 0x800291 d06c: a0 91 92 02 lds r26, 0x0292 ; 0x800292 d070: b0 91 93 02 lds r27, 0x0293 ; 0x800293 d074: 80 93 64 03 sts 0x0364, r24 ; 0x800364 d078: 90 93 65 03 sts 0x0365, r25 ; 0x800365 d07c: a0 93 66 03 sts 0x0366, r26 ; 0x800366 d080: b0 93 67 03 sts 0x0367, r27 ; 0x800367 int l_feedmultiply = feedmultiply; d084: c0 91 39 02 lds r28, 0x0239 ; 0x800239 d088: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; d08c: 84 e6 ldi r24, 0x64 ; 100 d08e: 90 e0 ldi r25, 0x00 ; 0 d090: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d094: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); d098: 84 e8 ldi r24, 0x84 ; 132 d09a: 93 e0 ldi r25, 0x03 ; 3 d09c: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> d0a0: 10 93 8f 02 sts 0x028F, r17 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(enable_endstops_now); return l_feedmultiply; } d0a4: ce 01 movw r24, r28 d0a6: df 91 pop r29 d0a8: cf 91 pop r28 d0aa: 1f 91 pop r17 d0ac: 08 95 ret 0000d0ae : d0ae: 40 e0 ldi r20, 0x00 ; 0 d0b0: 50 e0 ldi r21, 0x00 ; 0 d0b2: ba 01 movw r22, r20 d0b4: 8d ee ldi r24, 0xED ; 237 d0b6: 9f e0 ldi r25, 0x0F ; 15 d0b8: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a d0bc: 40 e0 ldi r20, 0x00 ; 0 d0be: 50 e0 ldi r21, 0x00 ; 0 d0c0: ba 01 movw r22, r20 d0c2: 81 ef ldi r24, 0xF1 ; 241 d0c4: 9f e0 ldi r25, 0x0F ; 15 d0c6: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 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(); d0ca: 0e 94 5b 5d call 0xbab6 ; 0xbab6 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); d0ce: 70 e0 ldi r23, 0x00 ; 0 d0d0: 60 e0 ldi r22, 0x00 ; 0 d0d2: 85 e0 ldi r24, 0x05 ; 5 d0d4: 9f e0 ldi r25, 0x0F ; 15 d0d6: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 d0da: 70 e0 ldi r23, 0x00 ; 0 d0dc: 60 e0 ldi r22, 0x00 ; 0 d0de: 83 e0 ldi r24, 0x03 ; 3 d0e0: 9f e0 ldi r25, 0x0F ; 15 d0e2: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 d0e6: 70 e0 ldi r23, 0x00 ; 0 d0e8: 60 e0 ldi r22, 0x00 ; 0 d0ea: 81 e0 ldi r24, 0x01 ; 1 d0ec: 9f e0 ldi r25, 0x0F ; 15 d0ee: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 d0f2: 70 e0 ldi r23, 0x00 ; 0 d0f4: 60 e0 ldi r22, 0x00 ; 0 d0f6: 8f ef ldi r24, 0xFF ; 255 d0f8: 9e e0 ldi r25, 0x0E ; 14 d0fa: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 d0fe: 70 e0 ldi r23, 0x00 ; 0 d100: 60 e0 ldi r22, 0x00 ; 0 d102: 83 ed ldi r24, 0xD3 ; 211 d104: 9e e0 ldi r25, 0x0E ; 14 d106: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 d10a: 70 e0 ldi r23, 0x00 ; 0 d10c: 60 e0 ldi r22, 0x00 ; 0 d10e: 80 ed ldi r24, 0xD0 ; 208 d110: 9e e0 ldi r25, 0x0E ; 14 d112: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); d116: 40 e0 ldi r20, 0x00 ; 0 d118: 50 e0 ldi r21, 0x00 ; 0 d11a: ba 01 movw r22, r20 d11c: 88 ea ldi r24, 0xA8 ; 168 d11e: 9c e0 ldi r25, 0x0C ; 12 d120: 0d 94 45 dd jmp 0x3ba8a ; 0x3ba8a 0000d124 : wdt_disable(); } } void softReset(void) { cli(); d124: 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" ); d126: 88 e1 ldi r24, 0x18 ; 24 d128: 98 e0 ldi r25, 0x08 ; 8 d12a: 0f b6 in r0, 0x3f ; 63 d12c: f8 94 cli d12e: a8 95 wdr d130: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d134: 0f be out 0x3f, r0 ; 63 d136: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d13a: ff cf rjmp .-2 ; 0xd13a 0000d13c : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { d13c: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); d13e: 9f b7 in r25, 0x3f ; 63 d140: f8 94 cli d142: e2 e0 ldi r30, 0x02 ; 2 d144: f1 e0 ldi r31, 0x01 ; 1 d146: 80 81 ld r24, Z d148: 84 60 ori r24, 0x04 ; 4 d14a: 80 83 st Z, r24 d14c: 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); d14e: 6c 2f mov r22, r28 d150: 83 e0 ldi r24, 0x03 ; 3 d152: 9d e0 ldi r25, 0x0D ; 13 d154: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); d158: 8c 2f mov r24, r28 d15a: 0e 94 6e e3 call 0x1c6dc ; 0x1c6dc #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); d15e: 0e 94 92 68 call 0xd124 ; 0xd124 0000d162 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { d162: 1f 92 push r1 d164: 0f 92 push r0 d166: 0f b6 in r0, 0x3f ; 63 d168: 0f 92 push r0 d16a: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); d16c: 83 e0 ldi r24, 0x03 ; 3 d16e: 0e 94 9e 68 call 0xd13c ; 0xd13c 0000d172 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { d172: 1f 92 push r1 d174: 0f 92 push r0 d176: 0f b6 in r0, 0x3f ; 63 d178: 0f 92 push r0 d17a: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); d17c: 82 e0 ldi r24, 0x02 ; 2 d17e: 0e 94 9e 68 call 0xd13c ; 0xd13c 0000d182 : } #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); d182: 85 ea ldi r24, 0xA5 ; 165 d184: 9f e0 ldi r25, 0x0F ; 15 d186: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e d18a: 91 e0 ldi r25, 0x01 ; 1 d18c: 81 11 cpse r24, r1 d18e: 01 c0 rjmp .+2 ; 0xd192 d190: 90 e0 ldi r25, 0x00 ; 0 } d192: 89 2f mov r24, r25 d194: 08 95 ret 0000d196 : 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(); d196: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc d19a: 81 11 cpse r24, r1 d19c: 06 c0 rjmp .+12 ; 0xd1aa d19e: 81 e0 ldi r24, 0x01 ; 1 d1a0: 90 91 99 03 lds r25, 0x0399 ; 0x800399 d1a4: 92 30 cpi r25, 0x02 ; 2 d1a6: 09 f0 breq .+2 ; 0xd1aa d1a8: 80 e0 ldi r24, 0x00 ; 0 } d1aa: 08 95 ret 0000d1ac : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); d1ac: 80 91 6b 14 lds r24, 0x146B ; 0x80146b d1b0: 81 11 cpse r24, r1 d1b2: 0a c0 rjmp .+20 ; 0xd1c8 d1b4: 80 91 0e 05 lds r24, 0x050E ; 0x80050e d1b8: 81 11 cpse r24, r1 d1ba: 06 c0 rjmp .+12 ; 0xd1c8 d1bc: 81 e0 ldi r24, 0x01 ; 1 d1be: 90 91 99 03 lds r25, 0x0399 ; 0x800399 d1c2: 91 30 cpi r25, 0x01 ; 1 d1c4: 09 f0 breq .+2 ; 0xd1c8 d1c6: 80 e0 ldi r24, 0x00 ; 0 } d1c8: 08 95 ret 0000d1ca : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { d1ca: cf 93 push r28 d1cc: df 93 push r29 return ( !homing_flag d1ce: c0 91 55 0e lds r28, 0x0E55 ; 0x800e55 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d1d2: c1 11 cpse r28, r1 d1d4: 1f c0 rjmp .+62 ; 0xd214 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag d1d6: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 d1da: 81 11 cpse r24, r1 d1dc: 1c c0 rjmp .+56 ; 0xd216 && !printingIsPaused() d1de: 0e 94 cb 68 call 0xd196 ; 0xd196 d1e2: 81 11 cpse r24, r1 d1e4: 18 c0 rjmp .+48 ; 0xd216 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d1e6: d0 91 62 0e lds r29, 0x0E62 ; 0x800e62 d1ea: d4 30 cpi r29, 0x04 ; 4 d1ec: 61 f4 brne .+24 ; 0xd206 d1ee: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a d1f2: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b d1f6: 89 2b or r24, r25 d1f8: 91 f4 brne .+36 ; 0xd21e d1fa: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 d1fe: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 d202: 89 2b or r24, r25 d204: 61 f4 brne .+24 ; 0xd21e || printJobOngoing() d206: 0e 94 d6 68 call 0xd1ac ; 0xd1ac d20a: c8 2f mov r28, r24 d20c: 81 11 cpse r24, r1 d20e: 03 c0 rjmp .+6 ; 0xd216 || lcd_commands_type == LcdCommands::Idle d210: c1 e0 ldi r28, 0x01 ; 1 d212: 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) d214: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } d216: 8c 2f mov r24, r28 d218: df 91 pop r29 d21a: cf 91 pop r28 d21c: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d21e: c1 e0 ldi r28, 0x01 ; 1 d220: fa cf rjmp .-12 ; 0xd216 0000d222 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); d222: 0e 94 e5 68 call 0xd1ca ; 0xd1ca d226: 88 23 and r24, r24 d228: 89 f0 breq .+34 ; 0xd24c d22a: 20 e0 ldi r18, 0x00 ; 0 d22c: 30 e0 ldi r19, 0x00 ; 0 d22e: 40 e0 ldi r20, 0x00 ; 0 d230: 50 e4 ldi r21, 0x40 ; 64 d232: 60 91 48 07 lds r22, 0x0748 ; 0x800748 d236: 70 91 49 07 lds r23, 0x0749 ; 0x800749 d23a: 80 91 4a 07 lds r24, 0x074A ; 0x80074a d23e: 90 91 4b 07 lds r25, 0x074B ; 0x80074b d242: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> d246: 88 1f adc r24, r24 d248: 88 27 eor r24, r24 d24a: 88 1f adc r24, r24 } d24c: 08 95 ret 0000d24e : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() d24e: 0e 94 d6 68 call 0xd1ac ; 0xd1ac || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; d252: 81 11 cpse r24, r1 d254: 18 c0 rjmp .+48 ; 0xd286 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() d256: 0e 94 cb 68 call 0xd196 ; 0xd196 d25a: 81 11 cpse r24, r1 d25c: 14 c0 rjmp .+40 ; 0xd286 || saved_printing d25e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 d262: 81 11 cpse r24, r1 d264: 10 c0 rjmp .+32 ; 0xd286 || (lcd_commands_type != LcdCommands::Idle) d266: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 d26a: 81 11 cpse r24, r1 d26c: 0b c0 rjmp .+22 ; 0xd284 || MMU2::mmu2.MMU_PRINT_SAVED() d26e: 80 91 96 13 lds r24, 0x1396 ; 0x801396 d272: 81 11 cpse r24, r1 d274: 07 c0 rjmp .+14 ; 0xd284 || homing_flag d276: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 d27a: 81 11 cpse r24, r1 d27c: 04 c0 rjmp .+8 ; 0xd286 || mesh_bed_leveling_flag; d27e: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 d282: 08 95 ret d284: 81 e0 ldi r24, 0x01 ; 1 } d286: 08 95 ret 0000d288 : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; d288: fc 01 movw r30, r24 d28a: 20 81 ld r18, Z d28c: 21 11 cpse r18, r1 d28e: 01 c0 rjmp .+2 ; 0xd292 d290: 66 95 lsr r22 d292: fc 01 movw r30, r24 d294: 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() } d296: 08 95 ret 0000d298 : 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) { d298: fc 01 movw r30, r24 iRun = ir; d29a: 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); d29c: 21 e0 ldi r18, 0x01 ; 1 d29e: 60 32 cpi r22, 0x20 ; 32 d2a0: 08 f0 brcs .+2 ; 0xd2a4 d2a2: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { d2a4: 90 81 ld r25, Z d2a6: 29 17 cp r18, r25 d2a8: 81 f0 breq .+32 ; 0xd2ca d2aa: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { d2ac: 99 23 and r25, r25 d2ae: 51 f0 breq .+20 ; 0xd2c4 // 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; d2b0: 90 e0 ldi r25, 0x00 ; 0 d2b2: 95 95 asr r25 d2b4: 87 95 ror r24 d2b6: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; d2b8: 70 e0 ldi r23, 0x00 ; 0 d2ba: 75 95 asr r23 d2bc: 67 95 ror r22 d2be: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; d2c0: 20 83 st Z, r18 d2c2: 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; d2c4: 88 0f add r24, r24 d2c6: 82 83 std Z+2, r24 ; 0x02 d2c8: fb cf rjmp .-10 ; 0xd2c0 } // Update vSense vSense = newvSense; } else if (!vSense) { d2ca: 21 11 cpse r18, r1 d2cc: 04 c0 rjmp .+8 ; 0xd2d6 // 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; d2ce: 70 e0 ldi r23, 0x00 ; 0 d2d0: 75 95 asr r23 d2d2: 67 95 ror r22 d2d4: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } d2d6: 08 95 ret 0000d2d8 : } #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; } d2d8: 20 91 6d 12 lds r18, 0x126D ; 0x80126d d2dc: 30 91 6e 12 lds r19, 0x126E ; 0x80126e d2e0: bc 01 movw r22, r24 d2e2: c9 01 movw r24, r18 d2e4: 8d 57 subi r24, 0x7D ; 125 d2e6: 9f 4e sbci r25, 0xEF ; 239 d2e8: 0f 94 16 db call 0x3b62c ; 0x3b62c d2ec: 9c 01 movw r18, r24 d2ee: 90 93 94 03 sts 0x0394, r25 ; 0x800394 d2f2: 80 93 93 03 sts 0x0393, r24 ; 0x800393 d2f6: 81 e0 ldi r24, 0x01 ; 1 d2f8: 23 2b or r18, r19 d2fa: 09 f4 brne .+2 ; 0xd2fe d2fc: 80 e0 ldi r24, 0x00 ; 0 d2fe: 08 95 ret 0000d300 : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } d300: 80 e1 ldi r24, 0x10 ; 16 d302: e0 e4 ldi r30, 0x40 ; 64 d304: f7 e0 ldi r31, 0x07 ; 7 d306: a1 e5 ldi r26, 0x51 ; 81 d308: b5 e0 ldi r27, 0x05 ; 5 d30a: 01 90 ld r0, Z+ d30c: 0d 92 st X+, r0 d30e: 8a 95 dec r24 d310: e1 f7 brne .-8 ; 0xd30a d312: 08 95 ret 0000d314 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { d314: 4f 92 push r4 d316: 5f 92 push r5 d318: 6f 92 push r6 d31a: 7f 92 push r7 d31c: 8f 92 push r8 d31e: 9f 92 push r9 d320: af 92 push r10 d322: bf 92 push r11 d324: cf 92 push r12 d326: df 92 push r13 d328: ef 92 push r14 d32a: ff 92 push r15 d32c: 0f 93 push r16 d32e: 1f 93 push r17 d330: cf 93 push r28 d332: df 93 push r29 d334: 00 d0 rcall .+0 ; 0xd336 d336: 00 d0 rcall .+0 ; 0xd338 d338: 1f 92 push r1 d33a: 1f 92 push r1 d33c: cd b7 in r28, 0x3d ; 61 d33e: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; d340: 20 91 57 0e lds r18, 0x0E57 ; 0x800e57 d344: 22 23 and r18, r18 d346: 09 f4 brne .+2 ; 0xd34a d348: 73 c1 rjmp .+742 ; 0xd630 #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; d34a: 20 91 de 03 lds r18, 0x03DE ; 0x8003de d34e: 22 30 cpi r18, 0x02 ; 2 d350: 09 f4 brne .+2 ; 0xd354 d352: 6e c1 rjmp .+732 ; 0xd630 if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb d354: 20 91 de 03 lds r18, 0x03DE ; 0x8003de d358: 21 30 cpi r18, 0x01 ; 1 d35a: 11 f4 brne .+4 ; 0xd360 d35c: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de d360: 2b 01 movw r4, r22 d362: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; d364: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) d368: 10 91 ac 05 lds r17, 0x05AC ; 0x8005ac d36c: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee d370: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef d374: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 d378: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 d37c: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> d380: 61 17 cp r22, r17 d382: 31 f0 breq .+12 ; 0xd390 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; d384: 81 2f mov r24, r17 d386: 90 e0 ldi r25, 0x00 ; 0 d388: 90 93 69 0e sts 0x0E69, r25 ; 0x800e69 d38c: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d390: 0e 94 0f 66 call 0xcc1e ; 0xcc1e // Restore saved fan speed fanSpeed = saved_fan_speed; d394: 80 91 a9 05 lds r24, 0x05A9 ; 0x8005a9 d398: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d39c: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd d3a0: 80 91 03 18 lds r24, 0x1803 ; 0x801803 d3a4: 81 95 neg r24 d3a6: 89 27 eor r24, r25 d3a8: 88 70 andi r24, 0x08 ; 8 d3aa: 89 27 eor r24, r25 d3ac: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd float e = saved_pos[E_AXIS] - e_move; d3b0: a3 01 movw r20, r6 d3b2: 92 01 movw r18, r4 d3b4: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d3b8: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d3bc: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d3c0: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d3c4: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> d3c8: 6d 83 std Y+5, r22 ; 0x05 d3ca: 7e 83 std Y+6, r23 ; 0x06 d3cc: 8f 83 std Y+7, r24 ; 0x07 d3ce: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d3d0: ce 01 movw r24, r28 d3d2: 05 96 adiw r24, 0x05 ; 5 d3d4: 0f 94 62 aa call 0x354c4 ; 0x354c4 #ifdef FANCHECK fans_check_enabled = false; d3d8: 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) d3dc: 20 e0 ldi r18, 0x00 ; 0 d3de: 30 e0 ldi r19, 0x00 ; 0 d3e0: 40 e8 ldi r20, 0x80 ; 128 d3e2: 5f eb ldi r21, 0xBF ; 191 d3e4: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d3e8: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d3ec: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d3f0: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d3f4: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> d3f8: 81 11 cpse r24, r1 d3fa: 20 c0 rjmp .+64 ; 0xd43c { saved_pos[X_AXIS] = current_position[X_AXIS]; d3fc: 80 91 40 07 lds r24, 0x0740 ; 0x800740 d400: 90 91 41 07 lds r25, 0x0741 ; 0x800741 d404: a0 91 42 07 lds r26, 0x0742 ; 0x800742 d408: b0 91 43 07 lds r27, 0x0743 ; 0x800743 d40c: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b d410: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c d414: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d d418: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_pos[Y_AXIS] = current_position[Y_AXIS]; d41c: 80 91 44 07 lds r24, 0x0744 ; 0x800744 d420: 90 91 45 07 lds r25, 0x0745 ; 0x800745 d424: a0 91 46 07 lds r26, 0x0746 ; 0x800746 d428: b0 91 47 07 lds r27, 0x0747 ; 0x800747 d42c: 80 93 9f 02 sts 0x029F, r24 ; 0x80029f d430: 90 93 a0 02 sts 0x02A0, r25 ; 0x8002a0 d434: a0 93 a1 02 sts 0x02A1, r26 ; 0x8002a1 d438: 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); d43c: a3 01 movw r20, r6 d43e: 92 01 movw r18, r4 d440: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d444: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d448: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d44c: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d450: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> d454: 69 83 std Y+1, r22 ; 0x01 d456: 7a 83 std Y+2, r23 ; 0x02 d458: 8b 83 std Y+3, r24 ; 0x03 d45a: 9c 83 std Y+4, r25 ; 0x04 d45c: e0 90 48 07 lds r14, 0x0748 ; 0x800748 d460: f0 90 49 07 lds r15, 0x0749 ; 0x800749 d464: 00 91 4a 07 lds r16, 0x074A ; 0x80074a d468: 10 91 4b 07 lds r17, 0x074B ; 0x80074b d46c: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d470: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d474: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d478: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d47c: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d480: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d484: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d488: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d48c: 1f 92 push r1 d48e: 1f 92 push r1 d490: 1f 92 push r1 d492: 1f 92 push r1 d494: e2 e6 ldi r30, 0x62 ; 98 d496: 8e 2e mov r8, r30 d498: e7 e2 ldi r30, 0x27 ; 39 d49a: 9e 2e mov r9, r30 d49c: e6 e7 ldi r30, 0x76 ; 118 d49e: ae 2e mov r10, r30 d4a0: e2 e4 ldi r30, 0x42 ; 66 d4a2: be 2e mov r11, r30 d4a4: fe 01 movw r30, r28 d4a6: 31 96 adiw r30, 0x01 ; 1 d4a8: 6f 01 movw r12, r30 d4aa: 0f 94 bc aa call 0x35578 ; 0x35578 //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); d4ae: a3 01 movw r20, r6 d4b0: 92 01 movw r18, r4 d4b2: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d4b6: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d4ba: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d4be: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d4c2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> d4c6: 69 83 std Y+1, r22 ; 0x01 d4c8: 7a 83 std Y+2, r23 ; 0x02 d4ca: 8b 83 std Y+3, r24 ; 0x03 d4cc: 9c 83 std Y+4, r25 ; 0x04 d4ce: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d4d2: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d4d6: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d4da: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d4de: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d4e2: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d4e6: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d4ea: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d4ee: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d4f2: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d4f6: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d4fa: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d4fe: 1f 92 push r1 d500: 1f 92 push r1 d502: 1f 92 push r1 d504: 1f 92 push r1 d506: 0f 94 bc aa call 0x35578 ; 0x35578 //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); d50a: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d50e: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d512: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d516: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d51a: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d51e: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d522: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d526: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d52a: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d52e: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d532: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d536: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d53a: 1f 92 push r1 d53c: 1f 92 push r1 d53e: 1f 92 push r1 d540: 1f 92 push r1 d542: 81 2c mov r8, r1 d544: 91 2c mov r9, r1 d546: f8 ee ldi r31, 0xE8 ; 232 d548: af 2e mov r10, r31 d54a: f2 e4 ldi r31, 0x42 ; 66 d54c: bf 2e mov r11, r31 d54e: a7 ea ldi r26, 0xA7 ; 167 d550: ca 2e mov r12, r26 d552: a2 e0 ldi r26, 0x02 ; 2 d554: da 2e mov r13, r26 d556: 0f 94 bc aa call 0x35578 ; 0x35578 st_synchronize(); d55a: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 #ifdef FANCHECK fans_check_enabled = true; d55e: 11 e0 ldi r17, 0x01 ; 1 d560: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d564: 60 91 fd 17 lds r22, 0x17FD ; 0x8017fd d568: 70 91 fe 17 lds r23, 0x17FE ; 0x8017fe d56c: 90 e0 ldi r25, 0x00 ; 0 d56e: 80 e0 ldi r24, 0x00 ; 0 d570: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> d574: 60 93 90 02 sts 0x0290, r22 ; 0x800290 d578: 70 93 91 02 sts 0x0291, r23 ; 0x800291 d57c: 80 93 92 02 sts 0x0292, r24 ; 0x800292 d580: 90 93 93 02 sts 0x0293, r25 ; 0x800293 feedmultiply = saved_feedmultiply2; d584: 80 91 6f 03 lds r24, 0x036F ; 0x80036f d588: 90 91 70 03 lds r25, 0x0370 ; 0x800370 d58c: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d590: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d594: 80 e1 ldi r24, 0x10 ; 16 d596: eb e9 ldi r30, 0x9B ; 155 d598: f2 e0 ldi r31, 0x02 ; 2 d59a: a0 e4 ldi r26, 0x40 ; 64 d59c: b7 e0 ldi r27, 0x07 ; 7 d59e: 01 90 ld r0, Z+ d5a0: 0d 92 st X+, r0 d5a2: 8a 95 dec r24 d5a4: e1 f7 brne .-8 ; 0xd59e set_destination_to_current(); d5a6: 0e 94 80 69 call 0xd300 ; 0xd300 //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d5aa: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d5ae: 0f b6 in r0, 0x3f ; 63 d5b0: f8 94 cli d5b2: de bf out 0x3e, r29 ; 62 d5b4: 0f be out 0x3f, r0 ; 63 d5b6: cd bf out 0x3d, r28 ; 61 d5b8: 81 11 cpse r24, r1 d5ba: 51 c0 rjmp .+162 ; 0xd65e card.setIndex(saved_sdpos); d5bc: 60 91 ff 17 lds r22, 0x17FF ; 0x8017ff d5c0: 70 91 00 18 lds r23, 0x1800 ; 0x801800 d5c4: 80 91 01 18 lds r24, 0x1801 ; 0x801801 d5c8: 90 91 02 18 lds r25, 0x1802 ; 0x801802 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; d5cc: 60 93 7f 17 sts 0x177F, r22 ; 0x80177f d5d0: 70 93 80 17 sts 0x1780, r23 ; 0x801780 d5d4: 80 93 81 17 sts 0x1781, r24 ; 0x801781 d5d8: 90 93 82 17 sts 0x1782, r25 ; 0x801782 d5dc: 0f 94 3b 76 call 0x2ec76 ; 0x2ec76 sdpos_atomic = saved_sdpos; d5e0: 80 91 ff 17 lds r24, 0x17FF ; 0x8017ff d5e4: 90 91 00 18 lds r25, 0x1800 ; 0x801800 d5e8: a0 91 01 18 lds r26, 0x1801 ; 0x801801 d5ec: b0 91 02 18 lds r27, 0x1802 ; 0x801802 d5f0: 80 93 80 03 sts 0x0380, r24 ; 0x800380 d5f4: 90 93 81 03 sts 0x0381, r25 ; 0x800381 d5f8: a0 93 82 03 sts 0x0382, r26 ; 0x800382 d5fc: b0 93 83 03 sts 0x0383, r27 ; 0x800383 card.sdprinting = true; d600: 10 93 6b 14 sts 0x146B, r17 ; 0x80146b d604: 60 e0 ldi r22, 0x00 ; 0 d606: 85 ea ldi r24, 0xA5 ; 165 d608: 9f e0 ldi r25, 0x0F ; 15 d60a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 d60e: 60 e0 ldi r22, 0x00 ; 0 d610: 8f e7 ldi r24, 0x7F ; 127 d612: 9c e0 ldi r25, 0x0C ; 12 d614: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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); d618: 81 e5 ldi r24, 0x51 ; 81 d61a: 91 e7 ldi r25, 0x71 ; 113 d61c: 0f 94 e0 0a call 0x215c0 ; 0x215c0 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d620: 82 e0 ldi r24, 0x02 ; 2 d622: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d626: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 planner_aborted = true; // unroll the stack d62a: 81 e0 ldi r24, 0x01 ; 1 d62c: 80 93 5a 0e sts 0x0E5A, r24 ; 0x800e5a } d630: 28 96 adiw r28, 0x08 ; 8 d632: 0f b6 in r0, 0x3f ; 63 d634: f8 94 cli d636: de bf out 0x3e, r29 ; 62 d638: 0f be out 0x3f, r0 ; 63 d63a: cd bf out 0x3d, r28 ; 61 d63c: df 91 pop r29 d63e: cf 91 pop r28 d640: 1f 91 pop r17 d642: 0f 91 pop r16 d644: ff 90 pop r15 d646: ef 90 pop r14 d648: df 90 pop r13 d64a: cf 90 pop r12 d64c: bf 90 pop r11 d64e: af 90 pop r10 d650: 9f 90 pop r9 d652: 8f 90 pop r8 d654: 7f 90 pop r7 d656: 6f 90 pop r6 d658: 5f 90 pop r5 d65a: 4f 90 pop r4 d65c: 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 d65e: 81 30 cpi r24, 0x01 ; 1 d660: 89 f6 brne .-94 ; 0xd604 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d662: 80 91 ff 17 lds r24, 0x17FF ; 0x8017ff d666: 90 91 00 18 lds r25, 0x1800 ; 0x801800 d66a: a0 91 01 18 lds r26, 0x1801 ; 0x801801 d66e: b0 91 02 18 lds r27, 0x1802 ; 0x801802 d672: 80 93 78 03 sts 0x0378, r24 ; 0x800378 d676: 90 93 79 03 sts 0x0379, r25 ; 0x800379 d67a: a0 93 7a 03 sts 0x037A, r26 ; 0x80037a d67e: b0 93 7b 03 sts 0x037B, r27 ; 0x80037b serial_count = 0; d682: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a d686: 10 92 79 10 sts 0x1079, r1 ; 0x801079 FlushSerialRequestResend(); d68a: 0e 94 c4 5c call 0xb988 ; 0xb988 d68e: ba cf rjmp .-140 ; 0xd604 0000d690 : 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) { d690: 3f 92 push r3 d692: 4f 92 push r4 d694: 5f 92 push r5 d696: 6f 92 push r6 d698: 7f 92 push r7 d69a: 8f 92 push r8 d69c: 9f 92 push r9 d69e: af 92 push r10 d6a0: bf 92 push r11 d6a2: cf 92 push r12 d6a4: df 92 push r13 d6a6: ef 92 push r14 d6a8: ff 92 push r15 d6aa: 0f 93 push r16 d6ac: 1f 93 push r17 d6ae: cf 93 push r28 d6b0: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d6b2: 30 90 e8 17 lds r3, 0x17E8 ; 0x8017e8 d6b6: 33 20 and r3, r3 d6b8: 09 f4 brne .+2 ; 0xd6bc d6ba: 80 c0 rjmp .+256 ; 0xd7bc d6bc: 8b 01 movw r16, r22 d6be: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d6c0: 31 fe sbrs r3, 1 d6c2: 54 c0 rjmp .+168 ; 0xd76c // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d6c4: 88 80 ld r8, Y d6c6: 99 80 ldd r9, Y+1 ; 0x01 d6c8: aa 80 ldd r10, Y+2 ; 0x02 d6ca: bb 80 ldd r11, Y+3 ; 0x03 d6cc: fb 01 movw r30, r22 d6ce: c0 80 ld r12, Z d6d0: d1 80 ldd r13, Z+1 ; 0x01 d6d2: e2 80 ldd r14, Z+2 ; 0x02 d6d4: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d6d6: 20 91 bd 17 lds r18, 0x17BD ; 0x8017bd d6da: 30 91 be 17 lds r19, 0x17BE ; 0x8017be d6de: 40 91 bf 17 lds r20, 0x17BF ; 0x8017bf d6e2: 50 91 c0 17 lds r21, 0x17C0 ; 0x8017c0 d6e6: c5 01 movw r24, r10 d6e8: b4 01 movw r22, r8 d6ea: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> d6ee: 2b 01 movw r4, r22 d6f0: 3c 01 movw r6, r24 d6f2: 20 91 c1 17 lds r18, 0x17C1 ; 0x8017c1 d6f6: 30 91 c2 17 lds r19, 0x17C2 ; 0x8017c2 d6fa: 40 91 c3 17 lds r20, 0x17C3 ; 0x8017c3 d6fe: 50 91 c4 17 lds r21, 0x17C4 ; 0x8017c4 d702: c7 01 movw r24, r14 d704: b6 01 movw r22, r12 d706: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> d70a: 9b 01 movw r18, r22 d70c: ac 01 movw r20, r24 d70e: c3 01 movw r24, r6 d710: b2 01 movw r22, r4 d712: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> d716: 2b 01 movw r4, r22 d718: 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; d71a: 20 91 b5 17 lds r18, 0x17B5 ; 0x8017b5 d71e: 30 91 b6 17 lds r19, 0x17B6 ; 0x8017b6 d722: 40 91 b7 17 lds r20, 0x17B7 ; 0x8017b7 d726: 50 91 b8 17 lds r21, 0x17B8 ; 0x8017b8 d72a: c5 01 movw r24, r10 d72c: b4 01 movw r22, r8 d72e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> d732: 4b 01 movw r8, r22 d734: 5c 01 movw r10, r24 d736: 20 91 b9 17 lds r18, 0x17B9 ; 0x8017b9 d73a: 30 91 ba 17 lds r19, 0x17BA ; 0x8017ba d73e: 40 91 bb 17 lds r20, 0x17BB ; 0x8017bb d742: 50 91 bc 17 lds r21, 0x17BC ; 0x8017bc d746: c7 01 movw r24, r14 d748: b6 01 movw r22, r12 d74a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> d74e: 9b 01 movw r18, r22 d750: ac 01 movw r20, r24 d752: c5 01 movw r24, r10 d754: b4 01 movw r22, r8 d756: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d75a: 68 83 st Y, r22 d75c: 79 83 std Y+1, r23 ; 0x01 d75e: 8a 83 std Y+2, r24 ; 0x02 d760: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d762: f8 01 movw r30, r16 d764: 40 82 st Z, r4 d766: 51 82 std Z+1, r5 ; 0x01 d768: 62 82 std Z+2, r6 ; 0x02 d76a: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d76c: 30 fe sbrs r3, 0 d76e: 26 c0 rjmp .+76 ; 0xd7bc // Then add the offset. x += world2machine_shift[0]; d770: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 d774: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 d778: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 d77c: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 d780: 68 81 ld r22, Y d782: 79 81 ldd r23, Y+1 ; 0x01 d784: 8a 81 ldd r24, Y+2 ; 0x02 d786: 9b 81 ldd r25, Y+3 ; 0x03 d788: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> d78c: 68 83 st Y, r22 d78e: 79 83 std Y+1, r23 ; 0x01 d790: 8a 83 std Y+2, r24 ; 0x02 d792: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d794: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 d798: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 d79c: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 d7a0: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 d7a4: f8 01 movw r30, r16 d7a6: 60 81 ld r22, Z d7a8: 71 81 ldd r23, Z+1 ; 0x01 d7aa: 82 81 ldd r24, Z+2 ; 0x02 d7ac: 93 81 ldd r25, Z+3 ; 0x03 d7ae: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> d7b2: f8 01 movw r30, r16 d7b4: 60 83 st Z, r22 d7b6: 71 83 std Z+1, r23 ; 0x01 d7b8: 82 83 std Z+2, r24 ; 0x02 d7ba: 93 83 std Z+3, r25 ; 0x03 } } } d7bc: df 91 pop r29 d7be: cf 91 pop r28 d7c0: 1f 91 pop r17 d7c2: 0f 91 pop r16 d7c4: ff 90 pop r15 d7c6: ef 90 pop r14 d7c8: df 90 pop r13 d7ca: cf 90 pop r12 d7cc: bf 90 pop r11 d7ce: af 90 pop r10 d7d0: 9f 90 pop r9 d7d2: 8f 90 pop r8 d7d4: 7f 90 pop r7 d7d6: 6f 90 pop r6 d7d8: 5f 90 pop r5 d7da: 4f 90 pop r4 d7dc: 3f 90 pop r3 d7de: 08 95 ret 0000d7e0 : } } } inline bool world2machine_clamp(float &x, float &y) { d7e0: 2f 92 push r2 d7e2: 3f 92 push r3 d7e4: 4f 92 push r4 d7e6: 5f 92 push r5 d7e8: 6f 92 push r6 d7ea: 7f 92 push r7 d7ec: 8f 92 push r8 d7ee: 9f 92 push r9 d7f0: af 92 push r10 d7f2: bf 92 push r11 d7f4: cf 92 push r12 d7f6: df 92 push r13 d7f8: ef 92 push r14 d7fa: ff 92 push r15 d7fc: 0f 93 push r16 d7fe: 1f 93 push r17 d800: cf 93 push r28 d802: df 93 push r29 d804: 00 d0 rcall .+0 ; 0xd806 d806: 00 d0 rcall .+0 ; 0xd808 d808: 1f 92 push r1 d80a: 1f 92 push r1 d80c: cd b7 in r28, 0x3d ; 61 d80e: de b7 in r29, 0x3e ; 62 d810: 8c 01 movw r16, r24 d812: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d814: fc 01 movw r30, r24 d816: 80 81 ld r24, Z d818: 91 81 ldd r25, Z+1 ; 0x01 d81a: a2 81 ldd r26, Z+2 ; 0x02 d81c: b3 81 ldd r27, Z+3 ; 0x03 d81e: 89 83 std Y+1, r24 ; 0x01 d820: 9a 83 std Y+2, r25 ; 0x02 d822: ab 83 std Y+3, r26 ; 0x03 d824: bc 83 std Y+4, r27 ; 0x04 out_y = y; d826: fb 01 movw r30, r22 d828: 80 81 ld r24, Z d82a: 91 81 ldd r25, Z+1 ; 0x01 d82c: a2 81 ldd r26, Z+2 ; 0x02 d82e: b3 81 ldd r27, Z+3 ; 0x03 d830: 8d 83 std Y+5, r24 ; 0x05 d832: 9e 83 std Y+6, r25 ; 0x06 d834: af 83 std Y+7, r26 ; 0x07 d836: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d838: be 01 movw r22, r28 d83a: 6b 5f subi r22, 0xFB ; 251 d83c: 7f 4f sbci r23, 0xFF ; 255 d83e: ce 01 movw r24, r28 d840: 01 96 adiw r24, 0x01 ; 1 d842: 0e 94 48 6b call 0xd690 ; 0xd690 inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d846: c9 80 ldd r12, Y+1 ; 0x01 d848: da 80 ldd r13, Y+2 ; 0x02 d84a: eb 80 ldd r14, Y+3 ; 0x03 d84c: fc 80 ldd r15, Y+4 ; 0x04 d84e: 20 e0 ldi r18, 0x00 ; 0 d850: 30 e0 ldi r19, 0x00 ; 0 d852: a9 01 movw r20, r18 d854: c7 01 movw r24, r14 d856: b6 01 movw r22, r12 d858: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> d85c: 87 ff sbrs r24, 7 d85e: 35 c0 rjmp .+106 ; 0xd8ca tmpx = X_MIN_POS; d860: 19 82 std Y+1, r1 ; 0x01 d862: 1a 82 std Y+2, r1 ; 0x02 d864: 1b 82 std Y+3, r1 ; 0x03 d866: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d868: ff 24 eor r15, r15 d86a: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d86c: 8d 80 ldd r8, Y+5 ; 0x05 d86e: 9e 80 ldd r9, Y+6 ; 0x06 d870: af 80 ldd r10, Y+7 ; 0x07 d872: b8 84 ldd r11, Y+8 ; 0x08 d874: 20 e0 ldi r18, 0x00 ; 0 d876: 30 e0 ldi r19, 0x00 ; 0 d878: 40 e8 ldi r20, 0x80 ; 128 d87a: 50 ec ldi r21, 0xC0 ; 192 d87c: c5 01 movw r24, r10 d87e: b4 01 movw r22, r8 d880: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> d884: 87 ff sbrs r24, 7 d886: 35 c0 rjmp .+106 ; 0xd8f2 tmpy = Y_MIN_POS; d888: 80 e0 ldi r24, 0x00 ; 0 d88a: 90 e0 ldi r25, 0x00 ; 0 d88c: a0 e8 ldi r26, 0x80 ; 128 d88e: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d890: 8d 83 std Y+5, r24 ; 0x05 d892: 9e 83 std Y+6, r25 ; 0x06 d894: af 83 std Y+7, r26 ; 0x07 d896: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d898: cd 80 ldd r12, Y+5 ; 0x05 d89a: de 80 ldd r13, Y+6 ; 0x06 d89c: ef 80 ldd r14, Y+7 ; 0x07 d89e: f8 84 ldd r15, Y+8 ; 0x08 d8a0: 89 80 ldd r8, Y+1 ; 0x01 d8a2: 9a 80 ldd r9, Y+2 ; 0x02 d8a4: ab 80 ldd r10, Y+3 ; 0x03 d8a6: 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) { d8a8: 70 90 e8 17 lds r7, 0x17E8 ; 0x8017e8 d8ac: 71 10 cpse r7, r1 d8ae: 4c c0 rjmp .+152 ; 0xd948 // No correction. out_x = x; d8b0: f8 01 movw r30, r16 d8b2: 80 82 st Z, r8 d8b4: 91 82 std Z+1, r9 ; 0x01 d8b6: a2 82 std Z+2, r10 ; 0x02 d8b8: b3 82 std Z+3, r11 ; 0x03 out_y = y; d8ba: f1 01 movw r30, r2 d8bc: c0 82 st Z, r12 d8be: d1 82 std Z+1, r13 ; 0x01 d8c0: e2 82 std Z+2, r14 ; 0x02 d8c2: 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) { d8c4: ff 24 eor r15, r15 d8c6: f3 94 inc r15 d8c8: 25 c0 rjmp .+74 ; 0xd914 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) { d8ca: 20 e0 ldi r18, 0x00 ; 0 d8cc: 30 e0 ldi r19, 0x00 ; 0 d8ce: 4f e7 ldi r20, 0x7F ; 127 d8d0: 53 e4 ldi r21, 0x43 ; 67 d8d2: c7 01 movw r24, r14 d8d4: b6 01 movw r22, r12 d8d6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d8da: 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) { d8dc: 18 16 cp r1, r24 d8de: 34 f6 brge .-116 ; 0xd86c tmpx = X_MAX_POS; d8e0: 80 e0 ldi r24, 0x00 ; 0 d8e2: 90 e0 ldi r25, 0x00 ; 0 d8e4: af e7 ldi r26, 0x7F ; 127 d8e6: b3 e4 ldi r27, 0x43 ; 67 d8e8: 89 83 std Y+1, r24 ; 0x01 d8ea: 9a 83 std Y+2, r25 ; 0x02 d8ec: ab 83 std Y+3, r26 ; 0x03 d8ee: bc 83 std Y+4, r27 ; 0x04 d8f0: bb cf rjmp .-138 ; 0xd868 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d8f2: 20 e0 ldi r18, 0x00 ; 0 d8f4: 30 e8 ldi r19, 0x80 ; 128 d8f6: 44 e5 ldi r20, 0x54 ; 84 d8f8: 53 e4 ldi r21, 0x43 ; 67 d8fa: c5 01 movw r24, r10 d8fc: b4 01 movw r22, r8 d8fe: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> d902: 18 16 cp r1, r24 d904: 2c f4 brge .+10 ; 0xd910 tmpy = Y_MAX_POS; d906: 80 e0 ldi r24, 0x00 ; 0 d908: 90 e8 ldi r25, 0x80 ; 128 d90a: a4 e5 ldi r26, 0x54 ; 84 d90c: b3 e4 ldi r27, 0x43 ; 67 d90e: c0 cf rjmp .-128 ; 0xd890 clamped = true; } if (clamped) d910: f1 10 cpse r15, r1 d912: c2 cf rjmp .-124 ; 0xd898 machine2world(tmpx, tmpy, x, y); return clamped; } d914: 8f 2d mov r24, r15 d916: 28 96 adiw r28, 0x08 ; 8 d918: 0f b6 in r0, 0x3f ; 63 d91a: f8 94 cli d91c: de bf out 0x3e, r29 ; 62 d91e: 0f be out 0x3f, r0 ; 63 d920: cd bf out 0x3d, r28 ; 61 d922: df 91 pop r29 d924: cf 91 pop r28 d926: 1f 91 pop r17 d928: 0f 91 pop r16 d92a: ff 90 pop r15 d92c: ef 90 pop r14 d92e: df 90 pop r13 d930: cf 90 pop r12 d932: bf 90 pop r11 d934: af 90 pop r10 d936: 9f 90 pop r9 d938: 8f 90 pop r8 d93a: 7f 90 pop r7 d93c: 6f 90 pop r6 d93e: 5f 90 pop r5 d940: 4f 90 pop r4 d942: 3f 90 pop r3 d944: 2f 90 pop r2 d946: 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) { d948: 70 fe sbrs r7, 0 d94a: 1c c0 rjmp .+56 ; 0xd984 // Then add the offset. x -= world2machine_shift[0]; d94c: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 d950: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 d954: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 d958: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 d95c: c5 01 movw r24, r10 d95e: b4 01 movw r22, r8 d960: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> d964: 4b 01 movw r8, r22 d966: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d968: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 d96c: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 d970: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 d974: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 d978: c7 01 movw r24, r14 d97a: b6 01 movw r22, r12 d97c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> d980: 6b 01 movw r12, r22 d982: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d984: 71 fe sbrs r7, 1 d986: 9e cf rjmp .-196 ; 0xd8c4 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d988: 20 91 d0 17 lds r18, 0x17D0 ; 0x8017d0 d98c: 30 91 d1 17 lds r19, 0x17D1 ; 0x8017d1 d990: 40 91 d2 17 lds r20, 0x17D2 ; 0x8017d2 d994: 50 91 d3 17 lds r21, 0x17D3 ; 0x8017d3 d998: c5 01 movw r24, r10 d99a: b4 01 movw r22, r8 d99c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> d9a0: 2b 01 movw r4, r22 d9a2: 3c 01 movw r6, r24 d9a4: 20 91 d4 17 lds r18, 0x17D4 ; 0x8017d4 d9a8: 30 91 d5 17 lds r19, 0x17D5 ; 0x8017d5 d9ac: 40 91 d6 17 lds r20, 0x17D6 ; 0x8017d6 d9b0: 50 91 d7 17 lds r21, 0x17D7 ; 0x8017d7 d9b4: c7 01 movw r24, r14 d9b6: b6 01 movw r22, r12 d9b8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> d9bc: 9b 01 movw r18, r22 d9be: ac 01 movw r20, r24 d9c0: c3 01 movw r24, r6 d9c2: b2 01 movw r22, r4 d9c4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> d9c8: f8 01 movw r30, r16 d9ca: 60 83 st Z, r22 d9cc: 71 83 std Z+1, r23 ; 0x01 d9ce: 82 83 std Z+2, r24 ; 0x02 d9d0: 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; d9d2: 20 91 d8 17 lds r18, 0x17D8 ; 0x8017d8 d9d6: 30 91 d9 17 lds r19, 0x17D9 ; 0x8017d9 d9da: 40 91 da 17 lds r20, 0x17DA ; 0x8017da d9de: 50 91 db 17 lds r21, 0x17DB ; 0x8017db d9e2: c5 01 movw r24, r10 d9e4: b4 01 movw r22, r8 d9e6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> d9ea: 4b 01 movw r8, r22 d9ec: 5c 01 movw r10, r24 d9ee: 20 91 dc 17 lds r18, 0x17DC ; 0x8017dc d9f2: 30 91 dd 17 lds r19, 0x17DD ; 0x8017dd d9f6: 40 91 de 17 lds r20, 0x17DE ; 0x8017de d9fa: 50 91 df 17 lds r21, 0x17DF ; 0x8017df d9fe: c7 01 movw r24, r14 da00: b6 01 movw r22, r12 da02: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> da06: 9b 01 movw r18, r22 da08: ac 01 movw r20, r24 da0a: c5 01 movw r24, r10 da0c: b4 01 movw r22, r8 da0e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> da12: f1 01 movw r30, r2 da14: 60 83 st Z, r22 da16: 71 83 std Z+1, r23 ; 0x01 da18: 82 83 std Z+2, r24 ; 0x02 da1a: 93 83 std Z+3, r25 ; 0x03 da1c: 53 cf rjmp .-346 ; 0xd8c4 0000da1e : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { da1e: cf 92 push r12 da20: df 92 push r13 da22: ef 92 push r14 da24: ff 92 push r15 da26: cf 93 push r28 da28: df 93 push r29 da2a: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); da2c: bc 01 movw r22, r24 da2e: 6c 5f subi r22, 0xFC ; 252 da30: 7f 4f sbci r23, 0xFF ; 255 da32: 0e 94 f0 6b call 0xd7e0 ; 0xd7e0 // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; da36: c0 90 29 02 lds r12, 0x0229 ; 0x800229 da3a: d0 90 2a 02 lds r13, 0x022A ; 0x80022a da3e: e0 90 2b 02 lds r14, 0x022B ; 0x80022b da42: f0 90 2c 02 lds r15, 0x022C ; 0x80022c da46: a7 01 movw r20, r14 da48: 96 01 movw r18, r12 da4a: 68 85 ldd r22, Y+8 ; 0x08 da4c: 79 85 ldd r23, Y+9 ; 0x09 da4e: 8a 85 ldd r24, Y+10 ; 0x0a da50: 9b 85 ldd r25, Y+11 ; 0x0b da52: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> da56: 87 ff sbrs r24, 7 da58: 04 c0 rjmp .+8 ; 0xda62 da5a: c8 86 std Y+8, r12 ; 0x08 da5c: d9 86 std Y+9, r13 ; 0x09 da5e: ea 86 std Y+10, r14 ; 0x0a da60: 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]; da62: c0 90 1d 02 lds r12, 0x021D ; 0x80021d da66: d0 90 1e 02 lds r13, 0x021E ; 0x80021e da6a: e0 90 1f 02 lds r14, 0x021F ; 0x80021f da6e: f0 90 20 02 lds r15, 0x0220 ; 0x800220 da72: a7 01 movw r20, r14 da74: 96 01 movw r18, r12 da76: 68 85 ldd r22, Y+8 ; 0x08 da78: 79 85 ldd r23, Y+9 ; 0x09 da7a: 8a 85 ldd r24, Y+10 ; 0x0a da7c: 9b 85 ldd r25, Y+11 ; 0x0b da7e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> da82: 18 16 cp r1, r24 da84: 24 f4 brge .+8 ; 0xda8e da86: c8 86 std Y+8, r12 ; 0x08 da88: d9 86 std Y+9, r13 ; 0x09 da8a: ea 86 std Y+10, r14 ; 0x0a da8c: fb 86 std Y+11, r15 ; 0x0b } } da8e: df 91 pop r29 da90: cf 91 pop r28 da92: ff 90 pop r15 da94: ef 90 pop r14 da96: df 90 pop r13 da98: cf 90 pop r12 da9a: 08 95 ret 0000da9c : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { da9c: 2f 92 push r2 da9e: 3f 92 push r3 daa0: 4f 92 push r4 daa2: 5f 92 push r5 daa4: 6f 92 push r6 daa6: 7f 92 push r7 daa8: 8f 92 push r8 daaa: 9f 92 push r9 daac: af 92 push r10 daae: bf 92 push r11 dab0: cf 92 push r12 dab2: df 92 push r13 dab4: ef 92 push r14 dab6: ff 92 push r15 dab8: 0f 93 push r16 daba: 1f 93 push r17 dabc: cf 93 push r28 dabe: df 93 push r29 dac0: cd b7 in r28, 0x3d ; 61 dac2: de b7 in r29, 0x3e ; 62 dac4: a2 97 sbiw r28, 0x22 ; 34 dac6: 0f b6 in r0, 0x3f ; 63 dac8: f8 94 cli daca: de bf out 0x3e, r29 ; 62 dacc: 0f be out 0x3f, r0 ; 63 dace: cd bf out 0x3d, r28 ; 61 dad0: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); dad2: 81 e5 ldi r24, 0x51 ; 81 dad4: 95 e0 ldi r25, 0x05 ; 5 dad6: 0e 94 0f 6d call 0xda1e ; 0xda1e previous_millis_cmd.start(); dada: 84 e8 ldi r24, 0x84 ; 132 dadc: 93 e0 ldi r25, 0x03 ; 3 dade: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::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])) { dae2: 40 90 40 07 lds r4, 0x0740 ; 0x800740 dae6: 50 90 41 07 lds r5, 0x0741 ; 0x800741 daea: 60 90 42 07 lds r6, 0x0742 ; 0x800742 daee: 70 90 43 07 lds r7, 0x0743 ; 0x800743 daf2: c0 90 51 05 lds r12, 0x0551 ; 0x800551 daf6: d0 90 52 05 lds r13, 0x0552 ; 0x800552 dafa: e0 90 53 05 lds r14, 0x0553 ; 0x800553 dafe: f0 90 54 05 lds r15, 0x0554 ; 0x800554 db02: a7 01 movw r20, r14 db04: 96 01 movw r18, r12 db06: c3 01 movw r24, r6 db08: b2 01 movw r22, r4 db0a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> db0e: 81 11 cpse r24, r1 db10: 3f c0 rjmp .+126 ; 0xdb90 db12: 20 91 55 05 lds r18, 0x0555 ; 0x800555 db16: 30 91 56 05 lds r19, 0x0556 ; 0x800556 db1a: 40 91 57 05 lds r20, 0x0557 ; 0x800557 db1e: 50 91 58 05 lds r21, 0x0558 ; 0x800558 db22: 60 91 44 07 lds r22, 0x0744 ; 0x800744 db26: 70 91 45 07 lds r23, 0x0745 ; 0x800745 db2a: 80 91 46 07 lds r24, 0x0746 ; 0x800746 db2e: 90 91 47 07 lds r25, 0x0747 ; 0x800747 db32: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> db36: 81 11 cpse r24, r1 db38: 2b c0 rjmp .+86 ; 0xdb90 plan_buffer_line_destinationXYZE(feedrate/60); db3a: 20 e0 ldi r18, 0x00 ; 0 db3c: 30 e0 ldi r19, 0x00 ; 0 db3e: 40 e7 ldi r20, 0x70 ; 112 db40: 52 e4 ldi r21, 0x42 ; 66 db42: 60 91 90 02 lds r22, 0x0290 ; 0x800290 db46: 70 91 91 02 lds r23, 0x0291 ; 0x800291 db4a: 80 91 92 02 lds r24, 0x0292 ; 0x800292 db4e: 90 91 93 02 lds r25, 0x0293 ; 0x800293 db52: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> db56: 0f 94 de b9 call 0x373bc ; 0x373bc #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); db5a: 0e 94 36 5c call 0xb86c ; 0xb86c } db5e: a2 96 adiw r28, 0x22 ; 34 db60: 0f b6 in r0, 0x3f ; 63 db62: f8 94 cli db64: de bf out 0x3e, r29 ; 62 db66: 0f be out 0x3f, r0 ; 63 db68: cd bf out 0x3d, r28 ; 61 db6a: df 91 pop r29 db6c: cf 91 pop r28 db6e: 1f 91 pop r17 db70: 0f 91 pop r16 db72: ff 90 pop r15 db74: ef 90 pop r14 db76: df 90 pop r13 db78: cf 90 pop r12 db7a: bf 90 pop r11 db7c: af 90 pop r10 db7e: 9f 90 pop r9 db80: 8f 90 pop r8 db82: 7f 90 pop r7 db84: 6f 90 pop r6 db86: 5f 90 pop r5 db88: 4f 90 pop r4 db8a: 3f 90 pop r3 db8c: 2f 90 pop r2 db8e: 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); db90: 60 91 39 02 lds r22, 0x0239 ; 0x800239 db94: 70 91 3a 02 lds r23, 0x023A ; 0x80023a db98: 07 2e mov r0, r23 db9a: 00 0c add r0, r0 db9c: 88 0b sbc r24, r24 db9e: 99 0b sbc r25, r25 dba0: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> dba4: 20 91 90 02 lds r18, 0x0290 ; 0x800290 dba8: 30 91 91 02 lds r19, 0x0291 ; 0x800291 dbac: 40 91 92 02 lds r20, 0x0292 ; 0x800292 dbb0: 50 91 93 02 lds r21, 0x0293 ; 0x800293 dbb4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> dbb8: 2e e3 ldi r18, 0x3E ; 62 dbba: 33 ec ldi r19, 0xC3 ; 195 dbbc: 4e e2 ldi r20, 0x2E ; 46 dbbe: 59 e3 ldi r21, 0x39 ; 57 dbc0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> dbc4: 6f 83 std Y+7, r22 ; 0x07 dbc6: 78 87 std Y+8, r23 ; 0x08 dbc8: 89 87 std Y+9, r24 ; 0x09 dbca: 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) { dbcc: 80 91 9d 13 lds r24, 0x139D ; 0x80139d dbd0: 88 23 and r24, r24 dbd2: 09 f4 brne .+2 ; 0xdbd6 dbd4: 0f c1 rjmp .+542 ; 0xddf4 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]; dbd6: a3 01 movw r20, r6 dbd8: 92 01 movw r18, r4 dbda: c7 01 movw r24, r14 dbdc: b6 01 movw r22, r12 dbde: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> dbe2: 2b 01 movw r4, r22 dbe4: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; dbe6: 20 91 44 07 lds r18, 0x0744 ; 0x800744 dbea: 30 91 45 07 lds r19, 0x0745 ; 0x800745 dbee: 40 91 46 07 lds r20, 0x0746 ; 0x800746 dbf2: 50 91 47 07 lds r21, 0x0747 ; 0x800747 dbf6: 60 91 55 05 lds r22, 0x0555 ; 0x800555 dbfa: 70 91 56 05 lds r23, 0x0556 ; 0x800556 dbfe: 80 91 57 05 lds r24, 0x0557 ; 0x800557 dc02: 90 91 58 05 lds r25, 0x0558 ; 0x800558 dc06: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> dc0a: 6b 87 std Y+11, r22 ; 0x0b dc0c: 7c 87 std Y+12, r23 ; 0x0c dc0e: 8d 87 std Y+13, r24 ; 0x0d dc10: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); dc12: c3 01 movw r24, r6 dc14: b2 01 movw r22, r4 dc16: 9f 77 andi r25, 0x7F ; 127 dc18: 2b 85 ldd r18, Y+11 ; 0x0b dc1a: 3c 85 ldd r19, Y+12 ; 0x0c dc1c: 4d 85 ldd r20, Y+13 ; 0x0d dc1e: 5e 85 ldd r21, Y+14 ; 0x0e dc20: 5f 77 andi r21, 0x7F ; 127 dc22: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> dc26: 6b 01 movw r12, r22 dc28: 7c 01 movw r14, r24 if (len > 0) dc2a: 20 e0 ldi r18, 0x00 ; 0 dc2c: 30 e0 ldi r19, 0x00 ; 0 dc2e: a9 01 movw r20, r18 dc30: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> dc34: 18 16 cp r1, r24 dc36: 0c f0 brlt .+2 ; 0xdc3a dc38: dd c0 rjmp .+442 ; 0xddf4 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); dc3a: 20 e0 ldi r18, 0x00 ; 0 dc3c: 30 e0 ldi r19, 0x00 ; 0 dc3e: 40 ef ldi r20, 0xF0 ; 240 dc40: 51 e4 ldi r21, 0x41 ; 65 dc42: c7 01 movw r24, r14 dc44: b6 01 movw r22, r12 dc46: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> dc4a: 0f 94 15 df call 0x3be2a ; 0x3be2a dc4e: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> dc52: 7e 83 std Y+6, r23 ; 0x06 dc54: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { dc56: 62 30 cpi r22, 0x02 ; 2 dc58: 71 05 cpc r23, r1 dc5a: 08 f4 brcc .+2 ; 0xdc5e dc5c: cb c0 rjmp .+406 ; 0xddf4 dc5e: 21 14 cp r2, r1 dc60: 31 04 cpc r3, r1 dc62: 09 f4 brne .+2 ; 0xdc66 dc64: c7 c0 rjmp .+398 ; 0xddf4 float dz = z - current_position[Z_AXIS]; dc66: 20 91 48 07 lds r18, 0x0748 ; 0x800748 dc6a: 30 91 49 07 lds r19, 0x0749 ; 0x800749 dc6e: 40 91 4a 07 lds r20, 0x074A ; 0x80074a dc72: 50 91 4b 07 lds r21, 0x074B ; 0x80074b dc76: 60 91 59 05 lds r22, 0x0559 ; 0x800559 dc7a: 70 91 5a 05 lds r23, 0x055A ; 0x80055a dc7e: 80 91 5b 05 lds r24, 0x055B ; 0x80055b dc82: 90 91 5c 05 lds r25, 0x055C ; 0x80055c dc86: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> dc8a: 6f 87 std Y+15, r22 ; 0x0f dc8c: 78 8b std Y+16, r23 ; 0x10 dc8e: 89 8b std Y+17, r24 ; 0x11 dc90: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; dc92: 20 91 4c 07 lds r18, 0x074C ; 0x80074c dc96: 30 91 4d 07 lds r19, 0x074D ; 0x80074d dc9a: 40 91 4e 07 lds r20, 0x074E ; 0x80074e dc9e: 50 91 4f 07 lds r21, 0x074F ; 0x80074f dca2: 60 91 5d 05 lds r22, 0x055D ; 0x80055d dca6: 70 91 5e 05 lds r23, 0x055E ; 0x80055e dcaa: 80 91 5f 05 lds r24, 0x055F ; 0x80055f dcae: 90 91 60 05 lds r25, 0x0560 ; 0x800560 dcb2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> dcb6: 6b 8b std Y+19, r22 ; 0x13 dcb8: 7c 8b std Y+20, r23 ; 0x14 dcba: 8d 8b std Y+21, r24 ; 0x15 dcbc: 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); dcbe: ad 81 ldd r26, Y+5 ; 0x05 dcc0: be 81 ldd r27, Y+6 ; 0x06 dcc2: cd 01 movw r24, r26 dcc4: b0 e0 ldi r27, 0x00 ; 0 dcc6: a0 e0 ldi r26, 0x00 ; 0 dcc8: 8f 8f std Y+31, r24 ; 0x1f dcca: 98 a3 std Y+32, r25 ; 0x20 dccc: a9 a3 std Y+33, r26 ; 0x21 dcce: 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) { dcd0: 2d 81 ldd r18, Y+5 ; 0x05 dcd2: 3e 81 ldd r19, Y+6 ; 0x06 dcd4: 22 16 cp r2, r18 dcd6: 33 06 cpc r3, r19 dcd8: 08 f0 brcs .+2 ; 0xdcdc dcda: 8c c0 rjmp .+280 ; 0xddf4 float t = float(i) / float(n_segments); dcdc: b1 01 movw r22, r2 dcde: 90 e0 ldi r25, 0x00 ; 0 dce0: 80 e0 ldi r24, 0x00 ; 0 dce2: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> dce6: 6b 01 movw r12, r22 dce8: 7c 01 movw r14, r24 dcea: 6f 8d ldd r22, Y+31 ; 0x1f dcec: 78 a1 ldd r23, Y+32 ; 0x20 dcee: 89 a1 ldd r24, Y+33 ; 0x21 dcf0: 9a a1 ldd r25, Y+34 ; 0x22 dcf2: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> dcf6: 9b 01 movw r18, r22 dcf8: ac 01 movw r20, r24 dcfa: c7 01 movw r24, r14 dcfc: b6 01 movw r22, r12 dcfe: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> dd02: 6b 01 movw r12, r22 dd04: 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, dd06: ac 01 movw r20, r24 dd08: 9b 01 movw r18, r22 dd0a: 6b 89 ldd r22, Y+19 ; 0x13 dd0c: 7c 89 ldd r23, Y+20 ; 0x14 dd0e: 8d 89 ldd r24, Y+21 ; 0x15 dd10: 9e 89 ldd r25, Y+22 ; 0x16 dd12: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> dd16: 9b 01 movw r18, r22 dd18: ac 01 movw r20, r24 dd1a: 60 91 4c 07 lds r22, 0x074C ; 0x80074c dd1e: 70 91 4d 07 lds r23, 0x074D ; 0x80074d dd22: 80 91 4e 07 lds r24, 0x074E ; 0x80074e dd26: 90 91 4f 07 lds r25, 0x074F ; 0x80074f dd2a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> dd2e: 69 83 std Y+1, r22 ; 0x01 dd30: 7a 83 std Y+2, r23 ; 0x02 dd32: 8b 83 std Y+3, r24 ; 0x03 dd34: 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, dd36: a7 01 movw r20, r14 dd38: 96 01 movw r18, r12 dd3a: 6f 85 ldd r22, Y+15 ; 0x0f dd3c: 78 89 ldd r23, Y+16 ; 0x10 dd3e: 89 89 ldd r24, Y+17 ; 0x11 dd40: 9a 89 ldd r25, Y+18 ; 0x12 dd42: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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, dd46: 20 91 48 07 lds r18, 0x0748 ; 0x800748 dd4a: 30 91 49 07 lds r19, 0x0749 ; 0x800749 dd4e: 40 91 4a 07 lds r20, 0x074A ; 0x80074a dd52: 50 91 4b 07 lds r21, 0x074B ; 0x80074b dd56: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> dd5a: 6f 8b std Y+23, r22 ; 0x17 dd5c: 78 8f std Y+24, r23 ; 0x18 dd5e: 89 8f std Y+25, r24 ; 0x19 dd60: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, dd62: a7 01 movw r20, r14 dd64: 96 01 movw r18, r12 dd66: 6b 85 ldd r22, Y+11 ; 0x0b dd68: 7c 85 ldd r23, Y+12 ; 0x0c dd6a: 8d 85 ldd r24, Y+13 ; 0x0d dd6c: 9e 85 ldd r25, Y+14 ; 0x0e dd6e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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, dd72: 20 91 44 07 lds r18, 0x0744 ; 0x800744 dd76: 30 91 45 07 lds r19, 0x0745 ; 0x800745 dd7a: 40 91 46 07 lds r20, 0x0746 ; 0x800746 dd7e: 50 91 47 07 lds r21, 0x0747 ; 0x800747 dd82: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> dd86: 6b 8f std Y+27, r22 ; 0x1b dd88: 7c 8f std Y+28, r23 ; 0x1c dd8a: 8d 8f std Y+29, r24 ; 0x1d dd8c: 9e 8f std Y+30, r25 ; 0x1e dd8e: a7 01 movw r20, r14 dd90: 96 01 movw r18, r12 dd92: c3 01 movw r24, r6 dd94: b2 01 movw r22, r4 dd96: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> dd9a: 20 91 40 07 lds r18, 0x0740 ; 0x800740 dd9e: 30 91 41 07 lds r19, 0x0741 ; 0x800741 dda2: 40 91 42 07 lds r20, 0x0742 ; 0x800742 dda6: 50 91 43 07 lds r21, 0x0743 ; 0x800743 ddaa: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> ddae: 3f 92 push r3 ddb0: 2f 92 push r2 ddb2: a0 e4 ldi r26, 0x40 ; 64 ddb4: b7 e0 ldi r27, 0x07 ; 7 ddb6: bf 93 push r27 ddb8: af 93 push r26 ddba: 8f 80 ldd r8, Y+7 ; 0x07 ddbc: 98 84 ldd r9, Y+8 ; 0x08 ddbe: a9 84 ldd r10, Y+9 ; 0x09 ddc0: ba 84 ldd r11, Y+10 ; 0x0a ddc2: de 01 movw r26, r28 ddc4: 11 96 adiw r26, 0x01 ; 1 ddc6: 6d 01 movw r12, r26 ddc8: ef 88 ldd r14, Y+23 ; 0x17 ddca: f8 8c ldd r15, Y+24 ; 0x18 ddcc: 09 8d ldd r16, Y+25 ; 0x19 ddce: 1a 8d ldd r17, Y+26 ; 0x1a ddd0: 2b 8d ldd r18, Y+27 ; 0x1b ddd2: 3c 8d ldd r19, Y+28 ; 0x1c ddd4: 4d 8d ldd r20, Y+29 ; 0x1d ddd6: 5e 8d ldd r21, Y+30 ; 0x1e ddd8: 0f 94 bc aa call 0x35578 ; 0x35578 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) dddc: 0f 90 pop r0 ddde: 0f 90 pop r0 dde0: 0f 90 pop r0 dde2: 0f 90 pop r0 dde4: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a dde8: 81 11 cpse r24, r1 ddea: b7 ce rjmp .-658 ; 0xdb5a 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) { ddec: bf ef ldi r27, 0xFF ; 255 ddee: 2b 1a sub r2, r27 ddf0: 3b 0a sbc r3, r27 ddf2: 6e cf rjmp .-292 ; 0xdcd0 if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); ddf4: e0 90 59 05 lds r14, 0x0559 ; 0x800559 ddf8: f0 90 5a 05 lds r15, 0x055A ; 0x80055a ddfc: 00 91 5b 05 lds r16, 0x055B ; 0x80055b de00: 10 91 5c 05 lds r17, 0x055C ; 0x80055c de04: 20 91 55 05 lds r18, 0x0555 ; 0x800555 de08: 30 91 56 05 lds r19, 0x0556 ; 0x800556 de0c: 40 91 57 05 lds r20, 0x0557 ; 0x800557 de10: 50 91 58 05 lds r21, 0x0558 ; 0x800558 de14: 60 91 51 05 lds r22, 0x0551 ; 0x800551 de18: 70 91 52 05 lds r23, 0x0552 ; 0x800552 de1c: 80 91 53 05 lds r24, 0x0553 ; 0x800553 de20: 90 91 54 05 lds r25, 0x0554 ; 0x800554 de24: 1f 92 push r1 de26: 1f 92 push r1 de28: e0 e4 ldi r30, 0x40 ; 64 de2a: f7 e0 ldi r31, 0x07 ; 7 de2c: ff 93 push r31 de2e: ef 93 push r30 de30: 8f 80 ldd r8, Y+7 ; 0x07 de32: 98 84 ldd r9, Y+8 ; 0x08 de34: a9 84 ldd r10, Y+9 ; 0x09 de36: ba 84 ldd r11, Y+10 ; 0x0a de38: ed e5 ldi r30, 0x5D ; 93 de3a: ce 2e mov r12, r30 de3c: e5 e0 ldi r30, 0x05 ; 5 de3e: de 2e mov r13, r30 de40: 0f 94 bc aa call 0x35578 ; 0x35578 de44: 0f 90 pop r0 de46: 0f 90 pop r0 de48: 0f 90 pop r0 de4a: 0f 90 pop r0 de4c: 86 ce rjmp .-756 ; 0xdb5a 0000de4e : /// @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) { de4e: cf 92 push r12 de50: df 92 push r13 de52: ef 92 push r14 de54: ff 92 push r15 de56: cf 93 push r28 de58: 9b 01 movw r18, r22 de5a: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; de5c: c0 90 48 07 lds r12, 0x0748 ; 0x800748 de60: d0 90 49 07 lds r13, 0x0749 ; 0x800749 de64: e0 90 4a 07 lds r14, 0x074A ; 0x80074a de68: f0 90 4b 07 lds r15, 0x074B ; 0x80074b // Prepare to move Z axis current_position[Z_AXIS] += delta; de6c: c7 01 movw r24, r14 de6e: b6 01 movw r22, r12 de70: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> de74: 60 93 48 07 sts 0x0748, r22 ; 0x800748 de78: 70 93 49 07 sts 0x0749, r23 ; 0x800749 de7c: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a de80: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b #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); de84: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) de86: 90 91 3f 07 lds r25, 0x073F ; 0x80073f de8a: 91 11 cpse r25, r1 de8c: 02 c0 rjmp .+4 ; 0xde92 de8e: 84 ff sbrs r24, 4 de90: 26 c0 rjmp .+76 ; 0xdede { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); de92: 80 e4 ldi r24, 0x40 ; 64 de94: 97 e0 ldi r25, 0x07 ; 7 de96: 0e 94 0f 6d call 0xda1e ; 0xda1e plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); de9a: e0 91 99 02 lds r30, 0x0299 ; 0x800299 de9e: f0 91 9a 02 lds r31, 0x029A ; 0x80029a dea2: 60 85 ldd r22, Z+8 ; 0x08 dea4: 71 85 ldd r23, Z+9 ; 0x09 dea6: 82 85 ldd r24, Z+10 ; 0x0a dea8: 93 85 ldd r25, Z+11 ; 0x0b deaa: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); deae: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; deb2: a7 01 movw r20, r14 deb4: 96 01 movw r18, r12 deb6: 60 91 48 07 lds r22, 0x0748 ; 0x800748 deba: 70 91 49 07 lds r23, 0x0749 ; 0x800749 debe: 80 91 4a 07 lds r24, 0x074A ; 0x80074a dec2: 90 91 4b 07 lds r25, 0x074B ; 0x80074b dec6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> deca: 6b 01 movw r12, r22 decc: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } dece: c7 01 movw r24, r14 ded0: b6 01 movw r22, r12 ded2: cf 91 pop r28 ded4: ff 90 pop r15 ded6: ef 90 pop r14 ded8: df 90 pop r13 deda: cf 90 pop r12 dedc: 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(); dede: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); dee0: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); dee4: 81 e0 ldi r24, 0x01 ; 1 dee6: 0f 94 09 63 call 0x2c612 ; 0x2c612 deea: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); deec: 84 e0 ldi r24, 0x04 ; 4 deee: 0f 94 5d 3a call 0x274ba ; 0x274ba #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); def2: 65 e5 ldi r22, 0x55 ; 85 def4: 75 e5 ldi r23, 0x55 ; 85 def6: 85 e5 ldi r24, 0x55 ; 85 def8: 91 e4 ldi r25, 0x41 ; 65 defa: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); defe: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; df02: 82 e0 ldi r24, 0x02 ; 2 df04: 0f 94 c7 57 call 0x2af8e ; 0x2af8e df08: a7 01 movw r20, r14 df0a: 96 01 movw r18, r12 df0c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> df10: 6b 01 movw r12, r22 df12: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) df14: 0f 94 17 63 call 0x2c62e ; 0x2c62e df18: 88 23 and r24, r24 df1a: 91 f0 breq .+36 ; 0xdf40 { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; df1c: 80 91 1d 02 lds r24, 0x021D ; 0x80021d df20: 90 91 1e 02 lds r25, 0x021E ; 0x80021e df24: a0 91 1f 02 lds r26, 0x021F ; 0x80021f df28: b0 91 20 02 lds r27, 0x0220 ; 0x800220 df2c: 80 93 48 07 sts 0x0748, r24 ; 0x800748 df30: 90 93 49 07 sts 0x0749, r25 ; 0x800749 df34: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a df38: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_set_position_curposXYZE(); df3c: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 } tmc2130_home_exit(); df40: 0f 94 2e 3a call 0x2745c ; 0x2745c #endif //TMC2130 enable_z_endstop(z_endstop_enabled); df44: 8c 2f mov r24, r28 df46: 0f 94 09 63 call 0x2c612 ; 0x2c612 df4a: c1 cf rjmp .-126 ; 0xdece 0000df4c : // // 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) { df4c: 8f 92 push r8 df4e: 9f 92 push r9 df50: af 92 push r10 df52: bf 92 push r11 df54: cf 92 push r12 df56: df 92 push r13 df58: ef 92 push r14 df5a: ff 92 push r15 df5c: 4b 01 movw r8, r22 df5e: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) df60: c0 90 48 07 lds r12, 0x0748 ; 0x800748 df64: d0 90 49 07 lds r13, 0x0749 ; 0x800749 df68: e0 90 4a 07 lds r14, 0x074A ; 0x80074a df6c: f0 90 4b 07 lds r15, 0x074B ; 0x80074b df70: ac 01 movw r20, r24 df72: 9b 01 movw r18, r22 df74: c7 01 movw r24, r14 df76: b6 01 movw r22, r12 df78: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> df7c: 87 ff sbrs r24, 7 df7e: 11 c0 rjmp .+34 ; 0xdfa2 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); df80: a5 01 movw r20, r10 df82: 94 01 movw r18, r8 df84: c7 01 movw r24, r14 df86: b6 01 movw r22, r12 df88: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> df8c: 9f 77 andi r25, 0x7F ; 127 } df8e: ff 90 pop r15 df90: ef 90 pop r14 df92: df 90 pop r13 df94: cf 90 pop r12 df96: bf 90 pop r11 df98: af 90 pop r10 df9a: 9f 90 pop r9 df9c: 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)); df9e: 0c 94 27 6f jmp 0xde4e ; 0xde4e } dfa2: ff 90 pop r15 dfa4: ef 90 pop r14 dfa6: df 90 pop r13 dfa8: cf 90 pop r12 dfaa: bf 90 pop r11 dfac: af 90 pop r10 dfae: 9f 90 pop r9 dfb0: 8f 90 pop r8 dfb2: 08 95 ret 0000dfb4 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { dfb4: ec e5 ldi r30, 0x5C ; 92 dfb6: 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; dfb8: 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]; dfba: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty dfbc: 8f 37 cpi r24, 0x7F ; 127 dfbe: 31 f0 breq .+12 ; 0xdfcc dfc0: df 01 movw r26, r30 dfc2: 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 dfc4: 87 ff sbrs r24, 7 dfc6: 07 c0 rjmp .+14 ; 0xdfd6 lcd_custom_characters[i] = c & 0x7F; dfc8: 8f 77 andi r24, 0x7F ; 127 dfca: 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++) { dfcc: 83 e0 ldi r24, 0x03 ; 3 dfce: e4 36 cpi r30, 0x64 ; 100 dfd0: f8 07 cpc r31, r24 dfd2: 99 f7 brne .-26 ; 0xdfba for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dfd4: 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; dfd6: 9c 93 st X, r25 dfd8: f9 cf rjmp .-14 ; 0xdfcc 0000dfda : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dfda: 90 91 6d 02 lds r25, 0x026D ; 0x80026d dfde: 98 17 cp r25, r24 dfe0: 10 f4 brcc .+4 ; 0xdfe6 lcd_draw_update = lcdDrawUpdateOverride; dfe2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; dfe6: 80 91 6e 02 lds r24, 0x026E ; 0x80026e dfea: 88 23 and r24, r24 dfec: 39 f0 breq .+14 ; 0xdffc if (lcd_lcdupdate_func) dfee: e0 91 0c 04 lds r30, 0x040C ; 0x80040c dff2: f0 91 0d 04 lds r31, 0x040D ; 0x80040d dff6: 30 97 sbiw r30, 0x00 ; 0 dff8: 09 f0 breq .+2 ; 0xdffc lcd_lcdupdate_func(); dffa: 19 94 eijmp } dffc: 08 95 ret 0000dffe : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { dffe: cf 93 push r28 e000: df 93 push r29 e002: cd b7 in r28, 0x3d ; 61 e004: de b7 in r29, 0x3e ; 62 e006: ae 01 movw r20, r28 e008: 4a 5f subi r20, 0xFA ; 250 e00a: 5f 4f sbci r21, 0xFF ; 255 e00c: fa 01 movw r30, r20 e00e: 61 91 ld r22, Z+ e010: 71 91 ld r23, Z+ e012: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); e014: 8c ef ldi r24, 0xFC ; 252 e016: 93 e0 ldi r25, 0x03 ; 3 e018: 0f 94 56 dc call 0x3b8ac ; 0x3b8ac va_end(args); return ret; } e01c: df 91 pop r29 e01e: cf 91 pop r28 e020: 08 95 ret 0000e022 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); e022: 6c ef ldi r22, 0xFC ; 252 e024: 73 e0 ldi r23, 0x03 ; 3 e026: 0d 94 a7 db jmp 0x3b74e ; 0x3b74e 0000e02a : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); e02a: 6c ef ldi r22, 0xFC ; 252 e02c: 73 e0 ldi r23, 0x03 ; 3 e02e: 08 2e mov r0, r24 e030: 00 0c add r0, r0 e032: 99 0b sbc r25, r25 e034: 0d 94 77 db jmp 0x3b6ee ; 0x3b6ee 0000e038 : va_end(args); return ret; } void lcd_space(uint8_t n) { e038: cf 93 push r28 e03a: c8 2f mov r28, r24 while (n--) lcd_putc(' '); e03c: c1 50 subi r28, 0x01 ; 1 e03e: 20 f0 brcs .+8 ; 0xe048 e040: 80 e2 ldi r24, 0x20 ; 32 e042: 0e 94 15 70 call 0xe02a ; 0xe02a e046: fa cf rjmp .-12 ; 0xe03c } e048: cf 91 pop r28 e04a: 08 95 ret 0000e04c : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { e04c: cf 93 push r28 e04e: c8 2f mov r28, r24 e050: 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); e052: 64 30 cpi r22, 0x04 ; 4 e054: 08 f0 brcs .+2 ; 0xe058 e056: 83 e0 ldi r24, 0x03 ; 3 e058: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b } void lcd_set_cursor(uint8_t col, uint8_t row) { lcd_set_current_row(row); uint8_t addr = col + lcd_get_row_offset(lcd_currline); e05c: 0e 94 40 5c call 0xb880 ; 0xb880 e060: 8c 0f add r24, r28 lcd_ddram_address = addr; e062: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e066: 44 e6 ldi r20, 0x64 ; 100 e068: 50 e0 ldi r21, 0x00 ; 0 e06a: 60 e0 ldi r22, 0x00 ; 0 e06c: 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); } e06e: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e070: 0c 94 4d 65 jmp 0xca9a ; 0xca9a 0000e074 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { e074: cf 93 push r28 e076: df 93 push r29 e078: ea 01 movw r28, r20 lcd_set_cursor(c, r); e07a: 0e 94 26 70 call 0xe04c ; 0xe04c return fputs_P(str, lcdout); e07e: 6c ef ldi r22, 0xFC ; 252 e080: 73 e0 ldi r23, 0x03 ; 3 e082: ce 01 movw r24, r28 } e084: df 91 pop r29 e086: 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); e088: 0d 94 a7 db jmp 0x3b74e ; 0x3b74e 0000e08c : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { e08c: cf 93 push r28 e08e: c4 2f mov r28, r20 lcd_set_cursor(c, r); e090: 0e 94 26 70 call 0xe04c ; 0xe04c return fputc(ch, lcdout); e094: 6c ef ldi r22, 0xFC ; 252 e096: 73 e0 ldi r23, 0x03 ; 3 e098: 8c 2f mov r24, r28 e09a: cc 0f add r28, r28 e09c: 99 0b sbc r25, r25 } e09e: 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); e0a0: 0d 94 77 db jmp 0x3b6ee ; 0x3b6ee 0000e0a4 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); e0a4: 60 e0 ldi r22, 0x00 ; 0 e0a6: 80 e0 ldi r24, 0x00 ; 0 e0a8: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_ddram_address = 0; e0ac: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a } e0b0: 08 95 ret 0000e0b2 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e0b2: 40 e4 ldi r20, 0x40 ; 64 e0b4: 56 e0 ldi r21, 0x06 ; 6 e0b6: 60 e0 ldi r22, 0x00 ; 0 e0b8: 81 e0 ldi r24, 0x01 ; 1 e0ba: 0e 94 4d 65 call 0xca9a ; 0xca9a // 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; e0be: 10 92 5b 03 sts 0x035B, r1 ; 0x80035b lcd_ddram_address = 0; e0c2: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); e0c6: 48 e0 ldi r20, 0x08 ; 8 e0c8: 50 e0 ldi r21, 0x00 ; 0 e0ca: 6f e7 ldi r22, 0x7F ; 127 e0cc: 70 e0 ldi r23, 0x00 ; 0 e0ce: 8c e5 ldi r24, 0x5C ; 92 e0d0: 93 e0 ldi r25, 0x03 ; 3 e0d2: 0d 94 41 e3 jmp 0x3c682 ; 0x3c682 0000e0d6 : } 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) e0d6: 90 91 6e 02 lds r25, 0x026E ; 0x80026e e0da: 98 17 cp r25, r24 e0dc: 09 f1 breq .+66 ; 0xe120 { lcd_update_enabled = enabled; e0de: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) e0e2: 88 23 and r24, r24 e0e4: e9 f0 breq .+58 ; 0xe120 { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; e0e6: 10 92 35 05 sts 0x0535, r1 ; 0x800535 e0ea: 10 92 34 05 sts 0x0534, r1 ; 0x800534 lcd_encoder_diff = 0; e0ee: 10 92 cf 05 sts 0x05CF, r1 ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.557> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); e0f2: 84 ed ldi r24, 0xD4 ; 212 e0f4: 93 e0 ldi r25, 0x03 ; 3 e0f6: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; e0fa: 0f 94 55 3e call 0x27caa ; 0x27caa e0fe: 61 50 subi r22, 0x01 ; 1 e100: 71 09 sbc r23, r1 e102: 81 09 sbc r24, r1 e104: 91 09 sbc r25, r1 e106: 60 93 d0 03 sts 0x03D0, r22 ; 0x8003d0 e10a: 70 93 d1 03 sts 0x03D1, r23 ; 0x8003d1 e10e: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 e112: 90 93 d3 03 sts 0x03D3, r25 ; 0x8003d3 // Full update. lcd_clear(); e116: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_update(2); e11a: 82 e0 ldi r24, 0x02 ; 2 e11c: 0c 94 ed 6f jmp 0xdfda ; 0xdfda } else { // Clear the LCD always, or let it to the caller? } } } e120: 08 95 ret 0000e122 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { e122: cf 93 push r28 e124: c8 2f mov r28, r24 lcd_currline = 0; e126: 10 92 5b 03 sts 0x035B, r1 ; 0x80035b lcd_ddram_address = 0; e12a: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); e12e: 48 e0 ldi r20, 0x08 ; 8 e130: 50 e0 ldi r21, 0x00 ; 0 e132: 6f e7 ldi r22, 0x7F ; 127 e134: 70 e0 ldi r23, 0x00 ; 0 e136: 8c e5 ldi r24, 0x5C ; 92 e138: 93 e0 ldi r25, 0x03 ; 3 e13a: 0f 94 41 e3 call 0x3c682 ; 0x3c682 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 e13e: 44 e9 ldi r20, 0x94 ; 148 e140: 51 e1 ldi r21, 0x11 ; 17 e142: 62 e0 ldi r22, 0x02 ; 2 e144: 80 e3 ldi r24, 0x30 ; 48 e146: 0e 94 4d 65 call 0xca9a ; 0xca9a // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e14a: 46 e9 ldi r20, 0x96 ; 150 e14c: 50 e0 ldi r21, 0x00 ; 0 e14e: 62 e0 ldi r22, 0x02 ; 2 e150: 80 e3 ldi r24, 0x30 ; 48 e152: 0e 94 4d 65 call 0xca9a ; 0xca9a // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e156: 46 e9 ldi r20, 0x96 ; 150 e158: 50 e0 ldi r21, 0x00 ; 0 e15a: 62 e0 ldi r22, 0x02 ; 2 e15c: 80 e3 ldi r24, 0x30 ; 48 e15e: 0e 94 4d 65 call 0xca9a ; 0xca9a #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); e162: 46 e9 ldi r20, 0x96 ; 150 e164: 50 e0 ldi r21, 0x00 ; 0 e166: 62 e0 ldi r22, 0x02 ; 2 e168: 80 e2 ldi r24, 0x20 ; 32 e16a: 0e 94 4d 65 call 0xca9a ; 0xca9a #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); e16e: 80 91 0a 04 lds r24, 0x040A ; 0x80040a <_ZL19lcd_displayfunction.lto_priv.567> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e172: 44 e6 ldi r20, 0x64 ; 100 e174: 50 e0 ldi r21, 0x00 ; 0 e176: 60 e0 ldi r22, 0x00 ; 0 e178: 80 62 ori r24, 0x20 ; 32 e17a: 0e 94 4d 65 call 0xca9a ; 0xca9a } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; e17e: 84 e0 ldi r24, 0x04 ; 4 e180: 80 93 59 03 sts 0x0359, r24 ; 0x800359 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e184: 44 e6 ldi r20, 0x64 ; 100 e186: 50 e0 ldi r21, 0x00 ; 0 e188: 60 e0 ldi r22, 0x00 ; 0 e18a: 8c e0 ldi r24, 0x0C ; 12 e18c: 0e 94 4d 65 call 0xca9a ; 0xca9a 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(); e190: c1 11 cpse r28, r1 e192: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e196: 44 e6 ldi r20, 0x64 ; 100 e198: 50 e0 ldi r21, 0x00 ; 0 e19a: 60 e0 ldi r22, 0x00 ; 0 e19c: 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); } e19e: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1a0: 0c 94 4d 65 jmp 0xca9a ; 0xca9a 0000e1a4 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); e1a4: 81 e0 ldi r24, 0x01 ; 1 e1a6: 0c 94 91 70 jmp 0xe122 ; 0xe122 0000e1aa : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { e1aa: cf 92 push r12 e1ac: df 92 push r13 e1ae: ff 92 push r15 e1b0: 0f 93 push r16 e1b2: 1f 93 push r17 e1b4: cf 93 push r28 e1b6: df 93 push r29 e1b8: 00 d0 rcall .+0 ; 0xe1ba e1ba: 00 d0 rcall .+0 ; 0xe1bc e1bc: 1f 92 push r1 e1be: 1f 92 push r1 e1c0: cd b7 in r28, 0x3d ; 61 e1c2: de b7 in r29, 0x3e ; 62 if (value == '\n') { e1c4: 8a 30 cpi r24, 0x0A ; 10 e1c6: d9 f4 brne .+54 ; 0xe1fe if (lcd_currline > 3) lcd_currline = -1; e1c8: 80 91 5b 03 lds r24, 0x035B ; 0x80035b e1cc: 84 30 cpi r24, 0x04 ; 4 e1ce: 18 f0 brcs .+6 ; 0xe1d6 e1d0: 8f ef ldi r24, 0xFF ; 255 e1d2: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b lcd_set_cursor(0, lcd_currline + 1); // LF e1d6: 60 91 5b 03 lds r22, 0x035B ; 0x80035b e1da: 6f 5f subi r22, 0xFF ; 255 e1dc: 80 e0 ldi r24, 0x00 ; 0 e1de: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } e1e2: 28 96 adiw r28, 0x08 ; 8 e1e4: 0f b6 in r0, 0x3f ; 63 e1e6: f8 94 cli e1e8: de bf out 0x3e, r29 ; 62 e1ea: 0f be out 0x3f, r0 ; 63 e1ec: cd bf out 0x3d, r28 ; 61 e1ee: df 91 pop r29 e1f0: cf 91 pop r28 e1f2: 1f 91 pop r17 e1f4: 0f 91 pop r16 e1f6: ff 90 pop r15 e1f8: df 90 pop r13 e1fa: cf 90 pop r12 e1fc: 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))) { e1fe: 90 e8 ldi r25, 0x80 ; 128 e200: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); e202: 44 e6 ldi r20, 0x64 ; 100 e204: 50 e0 ldi r21, 0x00 ; 0 e206: 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))) { e208: 9a 34 cpi r25, 0x4A ; 74 e20a: 08 f5 brcc .+66 ; 0xe24e // 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. e20c: 48 2f mov r20, r24 e20e: 40 58 subi r20, 0x80 ; 128 e210: 55 0b sbc r21, r21 e212: 9a 01 movw r18, r20 e214: 96 e0 ldi r25, 0x06 ; 6 e216: 92 9f mul r25, r18 e218: a0 01 movw r20, r0 e21a: 93 9f mul r25, r19 e21c: 50 0d add r21, r0 e21e: 11 24 eor r1, r1 e220: fa 01 movw r30, r20 e222: ed 5b subi r30, 0xBD ; 189 e224: f4 48 sbci r31, 0x84 ; 132 e226: f4 90 lpm r15, Z e228: ec e5 ldi r30, 0x5C ; 92 e22a: f3 e0 ldi r31, 0x03 ; 3 e22c: 30 e0 ldi r19, 0x00 ; 0 e22e: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; e230: 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)) { e232: 61 91 ld r22, Z+ e234: 78 2f mov r23, r24 e236: 76 27 eor r23, r22 e238: 7f 77 andi r23, 0x7F ; 127 e23a: 89 f4 brne .+34 ; 0xe25e lcd_custom_characters[i] = c; // mark the custom character as used e23c: f9 01 movw r30, r18 e23e: e4 5a subi r30, 0xA4 ; 164 e240: fc 4f sbci r31, 0xFC ; 252 e242: 80 83 st Z, r24 e244: 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); e246: 44 e6 ldi r20, 0x64 ; 100 e248: 50 e0 ldi r21, 0x00 ; 0 e24a: 61 e0 ldi r22, 0x01 ; 1 e24c: 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); e24e: 0e 94 4d 65 call 0xca9a ; 0xca9a lcd_ddram_address++; // no need for preventing ddram overflow e252: 80 91 5a 03 lds r24, 0x035A ; 0x80035a e256: 8f 5f subi r24, 0xFF ; 255 e258: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a e25c: c2 cf rjmp .-124 ; 0xe1e2 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 e25e: 6f 37 cpi r22, 0x7F ; 127 e260: 09 f0 breq .+2 ; 0xe264 e262: 3c c0 rjmp .+120 ; 0xe2dc lcd_custom_characters[i] = c; // mark the custom character as used e264: f9 01 movw r30, r18 e266: e4 5a subi r30, 0xA4 ; 164 e268: fc 4f sbci r31, 0xFC ; 252 e26a: 80 83 st Z, r24 slotToUse = i; e26c: 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; e26e: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e270: fa 01 movw r30, r20 e272: e2 5c subi r30, 0xC2 ; 194 e274: f4 48 sbci r31, 0x84 ; 132 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e276: 8e 01 movw r16, r28 e278: 0f 5f subi r16, 0xFF ; 255 e27a: 1f 4f sbci r17, 0xFF ; 255 e27c: d8 01 movw r26, r16 e27e: 95 91 lpm r25, Z+ e280: 88 e0 ldi r24, 0x08 ; 8 e282: 18 2e mov r1, r24 0000e284 : e284: 10 fe sbrs r1, 0 e286: 05 90 lpm r0, Z+ e288: 02 94 swap r0 e28a: 80 2d mov r24, r0 e28c: 97 95 ror r25 e28e: 88 1f adc r24, r24 e290: 8d 93 st X+, r24 e292: 1a 94 dec r1 e294: b9 f7 brne .-18 ; 0xe284 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e296: bf 2d mov r27, r15 e298: e8 e0 ldi r30, 0x08 ; 8 e29a: be 02 muls r27, r30 e29c: c0 01 movw r24, r0 e29e: 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); e2a0: 44 e6 ldi r20, 0x64 ; 100 e2a2: 50 e0 ldi r21, 0x00 ; 0 e2a4: 60 e0 ldi r22, 0x00 ; 0 e2a6: 80 64 ori r24, 0x40 ; 64 e2a8: 0e 94 4d 65 call 0xca9a ; 0xca9a e2ac: 6e 01 movw r12, r28 e2ae: f9 e0 ldi r31, 0x09 ; 9 e2b0: cf 0e add r12, r31 e2b2: 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); e2b4: 44 e6 ldi r20, 0x64 ; 100 e2b6: 50 e0 ldi r21, 0x00 ; 0 e2b8: 61 e0 ldi r22, 0x01 ; 1 e2ba: d8 01 movw r26, r16 e2bc: 8d 91 ld r24, X+ e2be: 8d 01 movw r16, r26 e2c0: 0e 94 4d 65 call 0xca9a ; 0xca9a : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e2c4: c0 16 cp r12, r16 e2c6: d1 06 cpc r13, r17 e2c8: a9 f7 brne .-22 ; 0xe2b4 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e2ca: 80 91 5a 03 lds r24, 0x035A ; 0x80035a delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e2ce: 44 e6 ldi r20, 0x64 ; 100 e2d0: 50 e0 ldi r21, 0x00 ; 0 e2d2: 60 e0 ldi r22, 0x00 ; 0 e2d4: 80 68 ori r24, 0x80 ; 128 e2d6: 0e 94 4d 65 call 0xca9a ; 0xca9a e2da: b5 cf rjmp .-150 ; 0xe246 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 e2dc: 67 ff sbrs r22, 7 slotToUse = i; e2de: 92 2f mov r25, r18 e2e0: 2f 5f subi r18, 0xFF ; 255 e2e2: 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++) { e2e4: 28 30 cpi r18, 0x08 ; 8 e2e6: 31 05 cpc r19, r1 e2e8: 09 f0 breq .+2 ; 0xe2ec e2ea: a3 cf rjmp .-186 ; 0xe232 } // 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) { e2ec: 9f 3f cpi r25, 0xFF ; 255 e2ee: 09 f0 breq .+2 ; 0xe2f2 e2f0: be cf rjmp .-132 ; 0xe26e e2f2: a9 cf rjmp .-174 ; 0xe246 0000e2f4 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e2f4: 8f 92 push r8 e2f6: 9f 92 push r9 e2f8: af 92 push r10 e2fa: bf 92 push r11 e2fc: ef 92 push r14 e2fe: ff 92 push r15 e300: 0f 93 push r16 e302: 1f 93 push r17 e304: cf 93 push r28 e306: df 93 push r29 e308: cd b7 in r28, 0x3d ; 61 e30a: de b7 in r29, 0x3e ; 62 e30c: a0 97 sbiw r28, 0x20 ; 32 e30e: 0f b6 in r0, 0x3f ; 63 e310: f8 94 cli e312: de bf out 0x3e, r29 ; 62 e314: 0f be out 0x3f, r0 ; 63 e316: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e318: 61 15 cp r22, r1 e31a: 71 05 cpc r23, r1 e31c: 81 05 cpc r24, r1 e31e: 91 05 cpc r25, r1 e320: 99 f4 brne .+38 ; 0xe348 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e322: 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)); } e324: a0 96 adiw r28, 0x20 ; 32 e326: 0f b6 in r0, 0x3f ; 63 e328: f8 94 cli e32a: de bf out 0x3e, r29 ; 62 e32c: 0f be out 0x3f, r0 ; 63 e32e: cd bf out 0x3d, r28 ; 61 e330: df 91 pop r29 e332: cf 91 pop r28 e334: 1f 91 pop r17 e336: 0f 91 pop r16 e338: ff 90 pop r15 e33a: ef 90 pop r14 e33c: bf 90 pop r11 e33e: af 90 pop r10 e340: 9f 90 pop r9 e342: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e344: 0c 94 d5 70 jmp 0xe1aa ; 0xe1aa } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e348: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e34a: 84 2e mov r8, r20 e34c: 91 2c mov r9, r1 e34e: b1 2c mov r11, r1 e350: a1 2c mov r10, r1 e352: 9e 01 movw r18, r28 e354: 2f 5f subi r18, 0xFF ; 255 e356: 3f 4f sbci r19, 0xFF ; 255 e358: 79 01 movw r14, r18 e35a: a5 01 movw r20, r10 e35c: 94 01 movw r18, r8 e35e: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> e362: f7 01 movw r30, r14 e364: e0 0f add r30, r16 e366: f1 1d adc r31, r1 e368: 60 83 st Z, r22 n /= base; e36a: b9 01 movw r22, r18 e36c: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e36e: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e370: 61 15 cp r22, r1 e372: 71 05 cpc r23, r1 e374: 81 05 cpc r24, r1 e376: 91 05 cpc r25, r1 e378: 81 f7 brne .-32 ; 0xe35a e37a: 0e 0d add r16, r14 e37c: 1f 2d mov r17, r15 e37e: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e380: e0 16 cp r14, r16 e382: f1 06 cpc r15, r17 e384: 59 f0 breq .+22 ; 0xe39c lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e386: f8 01 movw r30, r16 e388: 82 91 ld r24, -Z e38a: 8f 01 movw r16, r30 e38c: 8a 30 cpi r24, 0x0A ; 10 e38e: 20 f4 brcc .+8 ; 0xe398 e390: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e392: 0e 94 d5 70 call 0xe1aa ; 0xe1aa e396: f4 cf rjmp .-24 ; 0xe380 { 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)); e398: 89 5c subi r24, 0xC9 ; 201 e39a: fb cf rjmp .-10 ; 0xe392 } e39c: a0 96 adiw r28, 0x20 ; 32 e39e: 0f b6 in r0, 0x3f ; 63 e3a0: f8 94 cli e3a2: de bf out 0x3e, r29 ; 62 e3a4: 0f be out 0x3f, r0 ; 63 e3a6: cd bf out 0x3d, r28 ; 61 e3a8: df 91 pop r29 e3aa: cf 91 pop r28 e3ac: 1f 91 pop r17 e3ae: 0f 91 pop r16 e3b0: ff 90 pop r15 e3b2: ef 90 pop r14 e3b4: bf 90 pop r11 e3b6: af 90 pop r10 e3b8: 9f 90 pop r9 e3ba: 8f 90 pop r8 e3bc: 08 95 ret 0000e3be : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e3be: cf 92 push r12 e3c0: df 92 push r13 e3c2: ef 92 push r14 e3c4: ff 92 push r15 e3c6: 6b 01 movw r12, r22 e3c8: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e3ca: f7 fe sbrs r15, 7 e3cc: 0b c0 rjmp .+22 ; 0xe3e4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e3ce: 8d e2 ldi r24, 0x2D ; 45 e3d0: 0e 94 d5 70 call 0xe1aa ; 0xe1aa else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e3d4: f0 94 com r15 e3d6: e0 94 com r14 e3d8: d0 94 com r13 e3da: c0 94 com r12 e3dc: c1 1c adc r12, r1 e3de: d1 1c adc r13, r1 e3e0: e1 1c adc r14, r1 e3e2: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e3e4: 4a e0 ldi r20, 0x0A ; 10 e3e6: c7 01 movw r24, r14 e3e8: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e3ea: ff 90 pop r15 e3ec: ef 90 pop r14 e3ee: df 90 pop r13 e3f0: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e3f2: 0c 94 7a 71 jmp 0xe2f4 ; 0xe2f4 0000e3f6 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e3f6: 0f 93 push r16 e3f8: 1f 93 push r17 e3fa: cf 93 push r28 e3fc: 8c 01 movw r16, r24 e3fe: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e400: cc 23 and r28, r28 e402: 59 f0 breq .+22 ; 0xe41a e404: f8 01 movw r30, r16 e406: 24 91 lpm r18, Z e408: 22 23 and r18, r18 e40a: 39 f0 breq .+14 ; 0xe41a lcd_write(pgm_read_byte(s++)); e40c: 0f 5f subi r16, 0xFF ; 255 e40e: 1f 4f sbci r17, 0xFF ; 255 e410: 84 91 lpm r24, Z e412: 0e 94 d5 70 call 0xe1aa ; 0xe1aa --len; e416: c1 50 subi r28, 0x01 ; 1 e418: f3 cf rjmp .-26 ; 0xe400 } lcd_space(len); e41a: 8c 2f mov r24, r28 e41c: 0e 94 1c 70 call 0xe038 ; 0xe038 return len; } e420: 8c 2f mov r24, r28 e422: cf 91 pop r28 e424: 1f 91 pop r17 e426: 0f 91 pop r16 e428: 08 95 ret 0000e42a : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e42a: 0f 93 push r16 e42c: 1f 93 push r17 e42e: cf 93 push r28 e430: 8c 01 movw r16, r24 e432: c6 2f mov r28, r22 while (len && *s) { e434: cc 23 and r28, r28 e436: 49 f0 breq .+18 ; 0xe44a e438: f8 01 movw r30, r16 e43a: 81 91 ld r24, Z+ e43c: 8f 01 movw r16, r30 e43e: 88 23 and r24, r24 e440: 21 f0 breq .+8 ; 0xe44a lcd_write(*(s++)); e442: 0e 94 d5 70 call 0xe1aa ; 0xe1aa --len; e446: c1 50 subi r28, 0x01 ; 1 e448: f5 cf rjmp .-22 ; 0xe434 } lcd_space(len); e44a: 8c 2f mov r24, r28 e44c: 0e 94 1c 70 call 0xe038 ; 0xe038 return len; } e450: 8c 2f mov r24, r28 e452: cf 91 pop r28 e454: 1f 91 pop r17 e456: 0f 91 pop r16 e458: 08 95 ret 0000e45a : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e45a: cf 93 push r28 e45c: df 93 push r29 e45e: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e460: 89 91 ld r24, Y+ e462: 88 23 and r24, r24 e464: 19 f0 breq .+6 ; 0xe46c e466: 0e 94 d5 70 call 0xe1aa ; 0xe1aa e46a: fa cf rjmp .-12 ; 0xe460 } e46c: df 91 pop r29 e46e: cf 91 pop r28 e470: 08 95 ret 0000e472 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e472: 0e 94 d5 70 call 0xe1aa ; 0xe1aa return 0; } e476: 90 e0 ldi r25, 0x00 ; 0 e478: 80 e0 ldi r24, 0x00 ; 0 e47a: 08 95 ret 0000e47c : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e47c: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 lcd_longpress_trigger = 0; e480: 10 92 d2 05 sts 0x05D2, r1 ; 0x8005d2 } e484: 08 95 ret 0000e486 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e486: cf 93 push r28 bool clicked = LCD_CLICKED; e488: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 e48c: c1 e0 ldi r28, 0x01 ; 1 e48e: 81 11 cpse r24, r1 e490: 04 c0 rjmp .+8 ; 0xe49a e492: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e494: 8c 2f mov r24, r28 e496: cf 91 pop r28 e498: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e49a: 0e 94 3e 72 call 0xe47c ; 0xe47c e49e: fa cf rjmp .-12 ; 0xe494 0000e4a0 : 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 e4a0: e0 e0 ldi r30, 0x00 ; 0 e4a2: f1 e0 ldi r31, 0x01 ; 1 e4a4: 85 91 lpm r24, Z+ e4a6: 95 91 lpm r25, Z+ e4a8: a5 91 lpm r26, Z+ e4aa: b4 91 lpm r27, Z e4ac: 85 3a cpi r24, 0xA5 ; 165 e4ae: 9a 45 sbci r25, 0x5A ; 90 e4b0: a4 4b sbci r26, 0xB4 ; 180 e4b2: bb 44 sbci r27, 0x4B ; 75 e4b4: 29 f4 brne .+10 ; 0xe4c0 return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e4b6: ea e0 ldi r30, 0x0A ; 10 e4b8: f1 e0 ldi r31, 0x01 ; 1 e4ba: 85 91 lpm r24, Z+ e4bc: 94 91 lpm r25, Z e4be: 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 e4c0: 8f e3 ldi r24, 0x3F ; 63 e4c2: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e4c4: 08 95 ret 0000e4c6 : 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); e4c6: 8e ef ldi r24, 0xFE ; 254 e4c8: 9f e0 ldi r25, 0x0F ; 15 e4ca: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e4ce: 8e 3f cpi r24, 0xFE ; 254 e4d0: 39 f0 breq .+14 ; 0xe4e0 e4d2: 91 e0 ldi r25, 0x01 ; 1 e4d4: 20 91 58 03 lds r18, 0x0358 ; 0x800358 e4d8: 28 13 cpse r18, r24 e4da: 90 e0 ldi r25, 0x00 ; 0 e4dc: 89 2f mov r24, r25 e4de: 08 95 ret e4e0: 80 e0 ldi r24, 0x00 ; 0 } e4e2: 08 95 ret 0000e4e4 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e4e4: 10 92 58 03 sts 0x0358, r1 ; 0x800358 eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e4e8: 6e ef ldi r22, 0xFE ; 254 e4ea: 8e ef ldi r24, 0xFE ; 254 e4ec: 9f e0 ldi r25, 0x0F ; 15 e4ee: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0000e4f2 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e4f2: 85 37 cpi r24, 0x75 ; 117 e4f4: 28 e6 ldi r18, 0x68 ; 104 e4f6: 92 07 cpc r25, r18 e4f8: 09 f4 brne .+2 ; 0xe4fc e4fa: 59 c0 rjmp .+178 ; 0xe5ae e4fc: f8 f4 brcc .+62 ; 0xe53c e4fe: 8e 36 cpi r24, 0x6E ; 110 e500: 25 e6 ldi r18, 0x65 ; 101 e502: 92 07 cpc r25, r18 e504: 09 f4 brne .+2 ; 0xe508 e506: 59 c0 rjmp .+178 ; 0xe5ba e508: 50 f4 brcc .+20 ; 0xe51e e50a: 83 37 cpi r24, 0x73 ; 115 e50c: 23 e6 ldi r18, 0x63 ; 99 e50e: 92 07 cpc r25, r18 e510: b1 f1 breq .+108 ; 0xe57e e512: 85 36 cpi r24, 0x65 ; 101 e514: 94 46 sbci r25, 0x64 ; 100 e516: b1 f1 breq .+108 ; 0xe584 //#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("??"); e518: 8c e3 ldi r24, 0x3C ; 60 e51a: 97 e6 ldi r25, 0x67 ; 103 e51c: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e51e: 82 37 cpi r24, 0x72 ; 114 e520: 26 e6 ldi r18, 0x66 ; 102 e522: 92 07 cpc r25, r18 e524: 91 f1 breq .+100 ; 0xe58a e526: 82 37 cpi r24, 0x72 ; 114 e528: 28 e6 ldi r18, 0x68 ; 104 e52a: 92 07 cpc r25, r18 e52c: 09 f4 brne .+2 ; 0xe530 e52e: 42 c0 rjmp .+132 ; 0xe5b4 e530: 83 37 cpi r24, 0x73 ; 115 e532: 95 46 sbci r25, 0x65 ; 101 e534: 89 f7 brne .-30 ; 0xe518 { 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"); e536: 83 e9 ldi r24, 0x93 ; 147 e538: 97 e6 ldi r25, 0x67 ; 103 e53a: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e53c: 8c 36 cpi r24, 0x6C ; 108 e53e: 20 e7 ldi r18, 0x70 ; 112 e540: 92 07 cpc r25, r18 e542: 31 f1 breq .+76 ; 0xe590 e544: 70 f4 brcc .+28 ; 0xe562 e546: 8c 36 cpi r24, 0x6C ; 108 e548: 2e e6 ldi r18, 0x6E ; 110 e54a: 92 07 cpc r25, r18 e54c: 21 f1 breq .+72 ; 0xe596 e54e: 8f 36 cpi r24, 0x6F ; 111 e550: 2e e6 ldi r18, 0x6E ; 110 e552: 92 07 cpc r25, r18 e554: 31 f1 breq .+76 ; 0xe5a2 e556: 84 37 cpi r24, 0x74 ; 116 e558: 99 46 sbci r25, 0x69 ; 105 e55a: f1 f6 brne .-68 ; 0xe518 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"); e55c: 81 e8 ldi r24, 0x81 ; 129 e55e: 97 e6 ldi r25, 0x67 ; 103 e560: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e562: 8b 36 cpi r24, 0x6B ; 107 e564: 23 e7 ldi r18, 0x73 ; 115 e566: 92 07 cpc r25, r18 e568: f9 f0 breq .+62 ; 0xe5a8 e56a: 86 37 cpi r24, 0x76 ; 118 e56c: 23 e7 ldi r18, 0x73 ; 115 e56e: 92 07 cpc r25, r18 e570: a9 f0 breq .+42 ; 0xe59c e572: 8f 36 cpi r24, 0x6F ; 111 e574: 92 47 sbci r25, 0x72 ; 114 e576: 81 f6 brne .-96 ; 0xe518 #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 e578: 8f e3 ldi r24, 0x3F ; 63 e57a: 97 e6 ldi r25, 0x67 ; 103 e57c: 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"); e57e: 83 ea ldi r24, 0xA3 ; 163 e580: 97 e6 ldi r25, 0x67 ; 103 e582: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e584: 8b e9 ldi r24, 0x9B ; 155 e586: 97 e6 ldi r25, 0x67 ; 103 e588: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e58a: 8a e8 ldi r24, 0x8A ; 138 e58c: 97 e6 ldi r25, 0x67 ; 103 e58e: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e590: 8a e7 ldi r24, 0x7A ; 122 e592: 97 e6 ldi r25, 0x67 ; 103 e594: 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 e596: 8f e6 ldi r24, 0x6F ; 111 e598: 97 e6 ldi r25, 0x67 ; 103 e59a: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e59c: 87 e6 ldi r24, 0x67 ; 103 e59e: 97 e6 ldi r25, 0x67 ; 103 e5a0: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e5a2: 81 e6 ldi r24, 0x61 ; 97 e5a4: 97 e6 ldi r25, 0x67 ; 103 e5a6: 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 e5a8: 86 e5 ldi r24, 0x56 ; 86 e5aa: 97 e6 ldi r25, 0x67 ; 103 e5ac: 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 e5ae: 8f e4 ldi r24, 0x4F ; 79 e5b0: 97 e6 ldi r25, 0x67 ; 103 e5b2: 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 e5b4: 86 e4 ldi r24, 0x46 ; 70 e5b6: 97 e6 ldi r25, 0x67 ; 103 e5b8: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e5ba: 8b ea ldi r24, 0xAB ; 171 e5bc: 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("??"); } e5be: 08 95 ret 0000e5c0 : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e5c0: cf 92 push r12 e5c2: df 92 push r13 e5c4: ef 92 push r14 e5c6: ff 92 push r15 e5c8: 1f 93 push r17 e5ca: cf 93 push r28 e5cc: df 93 push r29 e5ce: cd b7 in r28, 0x3d ; 61 e5d0: de b7 in r29, 0x3e ; 62 e5d2: 60 97 sbiw r28, 0x10 ; 16 e5d4: 0f b6 in r0, 0x3f ; 63 e5d6: f8 94 cli e5d8: de bf out 0x3e, r29 ; 62 e5da: 0f be out 0x3f, r0 ; 63 e5dc: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e5de: 88 23 and r24, r24 e5e0: c1 f1 breq .+112 ; 0xe652 e5e2: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e5e4: 81 30 cpi r24, 0x01 ; 1 e5e6: 81 f4 brne .+32 ; 0xe608 e5e8: 0e 94 50 72 call 0xe4a0 ; 0xe4a0 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e5ec: 60 96 adiw r28, 0x10 ; 16 e5ee: 0f b6 in r0, 0x3f ; 63 e5f0: f8 94 cli e5f2: de bf out 0x3e, r29 ; 62 e5f4: 0f be out 0x3f, r0 ; 63 e5f6: cd bf out 0x3d, r28 ; 61 e5f8: df 91 pop r29 e5fa: cf 91 pop r28 e5fc: 1f 91 pop r17 e5fe: ff 90 pop r15 e600: ef 90 pop r14 e602: df 90 pop r13 e604: cf 90 pop r12 e606: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e608: 8c e5 ldi r24, 0x5C ; 92 e60a: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e60c: 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--; e60e: 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; e610: c1 2c mov r12, r1 e612: d1 2c mov r13, r1 e614: 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 e616: 20 e1 ldi r18, 0x10 ; 16 e618: 30 e0 ldi r19, 0x00 ; 0 e61a: ae 01 movw r20, r28 e61c: 4f 5f subi r20, 0xFF ; 255 e61e: 5f 4f sbci r21, 0xFF ; 255 e620: c7 01 movw r24, r14 e622: b6 01 movw r22, r12 e624: 0e 94 99 e2 call 0x1c532 ; 0x1c532 if (header.magic != LANG_MAGIC) break; //break if not valid e628: 89 81 ldd r24, Y+1 ; 0x01 e62a: 9a 81 ldd r25, Y+2 ; 0x02 e62c: ab 81 ldd r26, Y+3 ; 0x03 e62e: bc 81 ldd r27, Y+4 ; 0x04 e630: 85 3a cpi r24, 0xA5 ; 165 e632: 9a 45 sbci r25, 0x5A ; 90 e634: a4 4b sbci r26, 0xB4 ; 180 e636: bb 44 sbci r27, 0x4B ; 75 e638: 79 f4 brne .+30 ; 0xe658 if (--lang == 0) return header.code; e63a: 11 50 subi r17, 0x01 ; 1 e63c: 19 f4 brne .+6 ; 0xe644 e63e: 8b 85 ldd r24, Y+11 ; 0x0b e640: 9c 85 ldd r25, Y+12 ; 0x0c e642: d4 cf rjmp .-88 ; 0xe5ec addr += header.size; //calc address of next table e644: 8d 81 ldd r24, Y+5 ; 0x05 e646: 9e 81 ldd r25, Y+6 ; 0x06 e648: c8 0e add r12, r24 e64a: d9 1e adc r13, r25 e64c: e1 1c adc r14, r1 e64e: f1 1c adc r15, r1 e650: e2 cf rjmp .-60 ; 0xe616 return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e652: 8e e6 ldi r24, 0x6E ; 110 e654: 95 e6 ldi r25, 0x65 ; 101 e656: ca cf rjmp .-108 ; 0xe5ec 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; e658: 8f e3 ldi r24, 0x3F ; 63 e65a: 9f e3 ldi r25, 0x3F ; 63 e65c: c7 cf rjmp .-114 ; 0xe5ec 0000e65e : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e65e: cf 92 push r12 e660: df 92 push r13 e662: ef 92 push r14 e664: ff 92 push r15 e666: 1f 93 push r17 e668: cf 93 push r28 e66a: df 93 push r29 e66c: cd b7 in r28, 0x3d ; 61 e66e: de b7 in r29, 0x3e ; 62 e670: 60 97 sbiw r28, 0x10 ; 16 e672: 0f b6 in r0, 0x3f ; 63 e674: f8 94 cli e676: de bf out 0x3e, r29 ; 62 e678: 0f be out 0x3f, r0 ; 63 e67a: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e67c: ea e3 ldi r30, 0x3A ; 58 e67e: fb e7 ldi r31, 0x7B ; 123 e680: 85 91 lpm r24, Z+ e682: 95 91 lpm r25, Z+ e684: a5 91 lpm r26, Z+ e686: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e688: 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) e68a: 8f 3f cpi r24, 0xFF ; 255 e68c: 9f 4f sbci r25, 0xFF ; 255 e68e: af 4f sbci r26, 0xFF ; 255 e690: bf 4f sbci r27, 0xFF ; 255 e692: 09 f1 breq .+66 ; 0xe6d6 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e694: 8c e5 ldi r24, 0x5C ; 92 e696: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e698: 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; e69a: c1 2c mov r12, r1 e69c: d1 2c mov r13, r1 e69e: 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) e6a0: 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 e6a2: 20 e1 ldi r18, 0x10 ; 16 e6a4: 30 e0 ldi r19, 0x00 ; 0 e6a6: ae 01 movw r20, r28 e6a8: 4f 5f subi r20, 0xFF ; 255 e6aa: 5f 4f sbci r21, 0xFF ; 255 e6ac: c7 01 movw r24, r14 e6ae: b6 01 movw r22, r12 e6b0: 0e 94 99 e2 call 0x1c532 ; 0x1c532 if (header.magic != LANG_MAGIC) break; //break if magic not valid e6b4: 89 81 ldd r24, Y+1 ; 0x01 e6b6: 9a 81 ldd r25, Y+2 ; 0x02 e6b8: ab 81 ldd r26, Y+3 ; 0x03 e6ba: bc 81 ldd r27, Y+4 ; 0x04 e6bc: 85 3a cpi r24, 0xA5 ; 165 e6be: 9a 45 sbci r25, 0x5A ; 90 e6c0: a4 4b sbci r26, 0xB4 ; 180 e6c2: bb 44 sbci r27, 0x4B ; 75 e6c4: 41 f4 brne .+16 ; 0xe6d6 addr += header.size; //calc address of next table e6c6: 8d 81 ldd r24, Y+5 ; 0x05 e6c8: 9e 81 ldd r25, Y+6 ; 0x06 e6ca: c8 0e add r12, r24 e6cc: d9 1e adc r13, r25 e6ce: e1 1c adc r14, r1 e6d0: f1 1c adc r15, r1 count++; //inc counter e6d2: 1f 5f subi r17, 0xFF ; 255 e6d4: e6 cf rjmp .-52 ; 0xe6a2 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e6d6: 81 2f mov r24, r17 e6d8: 60 96 adiw r28, 0x10 ; 16 e6da: 0f b6 in r0, 0x3f ; 63 e6dc: f8 94 cli e6de: de bf out 0x3e, r29 ; 62 e6e0: 0f be out 0x3f, r0 ; 63 e6e2: cd bf out 0x3d, r28 ; 61 e6e4: df 91 pop r29 e6e6: cf 91 pop r28 e6e8: 1f 91 pop r17 e6ea: ff 90 pop r15 e6ec: ef 90 pop r14 e6ee: df 90 pop r13 e6f0: cf 90 pop r12 e6f2: 08 95 ret 0000e6f4 : 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) { e6f4: 0f 93 push r16 e6f6: 1f 93 push r17 e6f8: cf 93 push r28 e6fa: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e6fc: 81 11 cpse r24, r1 e6fe: 06 c0 rjmp .+12 ; 0xe70c { lang_table = 0; e700: 10 92 57 03 sts 0x0357, r1 ; 0x800357 e704: 10 92 56 03 sts 0x0356, r1 ; 0x800356 lang_selected = lang; e708: 10 92 58 03 sts 0x0358, r1 ; 0x800358 } #ifdef XFLASH if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; e70c: 8c 2f mov r24, r28 e70e: 0e 94 e0 72 call 0xe5c0 ; 0xe5c0 e712: 8c 01 movw r16, r24 e714: 0e 94 50 72 call 0xe4a0 ; 0xe4a0 e718: 08 17 cp r16, r24 e71a: 19 07 cpc r17, r25 e71c: 19 f0 breq .+6 ; 0xe724 if (lang == LANG_ID_SEC) //current secondary language e71e: c1 30 cpi r28, 0x01 ; 1 e720: 09 f0 breq .+2 ; 0xe724 e722: 3e c0 rjmp .+124 ; 0xe7a0 { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e724: e0 e0 ldi r30, 0x00 ; 0 e726: f1 e0 ldi r31, 0x01 ; 1 e728: 85 91 lpm r24, Z+ e72a: 95 91 lpm r25, Z+ e72c: a5 91 lpm r26, Z+ e72e: b4 91 lpm r27, Z e730: 85 3a cpi r24, 0xA5 ; 165 e732: 9a 45 sbci r25, 0x5A ; 90 e734: a4 4b sbci r26, 0xB4 ; 180 e736: bb 44 sbci r27, 0x4B ; 75 e738: 09 f0 breq .+2 ; 0xe73c e73a: 31 c0 rjmp .+98 ; 0xe79e } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e73c: e4 e0 ldi r30, 0x04 ; 4 e73e: f1 e0 ldi r31, 0x01 ; 1 e740: 65 91 lpm r22, Z+ e742: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e744: e8 e0 ldi r30, 0x08 ; 8 e746: f1 e0 ldi r31, 0x01 ; 1 e748: 45 91 lpm r20, Z+ e74a: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e74c: 30 e0 ldi r19, 0x00 ; 0 e74e: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e750: 90 e0 ldi r25, 0x00 ; 0 e752: 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++) e754: 62 17 cp r22, r18 e756: 73 07 cpc r23, r19 e758: 89 f5 brne .+98 ; 0xe7bc sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e75a: 84 1b sub r24, r20 e75c: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e75e: 98 27 eor r25, r24 e760: 89 27 eor r24, r25 e762: 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)) e764: 48 17 cp r20, r24 e766: 59 07 cpc r21, r25 e768: d1 f4 brne .+52 ; 0xe79e if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e76a: ec e0 ldi r30, 0x0C ; 12 e76c: f1 e0 ldi r31, 0x01 ; 1 e76e: 45 91 lpm r20, Z+ e770: 55 91 lpm r21, Z+ e772: 65 91 lpm r22, Z+ e774: 74 91 lpm r23, Z e776: ea e3 ldi r30, 0x3A ; 58 e778: fb e7 ldi r31, 0x7B ; 123 e77a: 85 91 lpm r24, Z+ e77c: 95 91 lpm r25, Z+ e77e: a5 91 lpm r26, Z+ e780: b4 91 lpm r27, Z e782: 48 17 cp r20, r24 e784: 59 07 cpc r21, r25 e786: 6a 07 cpc r22, r26 e788: 7b 07 cpc r23, r27 e78a: 49 f4 brne .+18 ; 0xe79e { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e78c: 80 e0 ldi r24, 0x00 ; 0 e78e: 91 e0 ldi r25, 0x01 ; 1 e790: 90 93 57 03 sts 0x0357, r25 ; 0x800357 e794: 80 93 56 03 sts 0x0356, r24 ; 0x800356 lang_selected = lang; // set language id e798: 81 e0 ldi r24, 0x01 ; 1 e79a: 80 93 58 03 sts 0x0358, r24 ; 0x800358 if (lang == LANG_ID_SEC) //current secondary language { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid { if (lang_check(_SEC_LANG_TABLE)) if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e79e: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e7a0: 80 91 58 03 lds r24, 0x0358 ; 0x800358 e7a4: 8c 13 cpse r24, r28 e7a6: 1c c0 rjmp .+56 ; 0xe7e0 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e7a8: 6c 2f mov r22, r28 e7aa: 8e ef ldi r24, 0xFE ; 254 e7ac: 9f e0 ldi r25, 0x0F ; 15 e7ae: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 return 1; e7b2: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e7b4: cf 91 pop r28 e7b6: 1f 91 pop r17 e7b8: 0f 91 pop r16 e7ba: 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); e7bc: f9 01 movw r30, r18 e7be: e0 50 subi r30, 0x00 ; 0 e7c0: ff 4f sbci r31, 0xFF ; 255 e7c2: e4 91 lpm r30, Z e7c4: f0 e0 ldi r31, 0x00 ; 0 e7c6: a8 e0 ldi r26, 0x08 ; 8 e7c8: 20 fd sbrc r18, 0 e7ca: a0 e0 ldi r26, 0x00 ; 0 e7cc: 02 c0 rjmp .+4 ; 0xe7d2 e7ce: ee 0f add r30, r30 e7d0: ff 1f adc r31, r31 e7d2: aa 95 dec r26 e7d4: e2 f7 brpl .-8 ; 0xe7ce e7d6: 8e 0f add r24, r30 e7d8: 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++) e7da: 2f 5f subi r18, 0xFF ; 255 e7dc: 3f 4f sbci r19, 0xFF ; 255 e7de: ba cf rjmp .-140 ; 0xe754 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e7e0: 80 e0 ldi r24, 0x00 ; 0 e7e2: e8 cf rjmp .-48 ; 0xe7b4 0000e7e4 : //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. e7e4: 20 91 58 03 lds r18, 0x0358 ; 0x800358 e7e8: 21 11 cpse r18, r1 e7ea: 04 c0 rjmp .+8 ; 0xe7f4 e7ec: fc 01 movw r30, r24 e7ee: 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 } e7f0: cf 01 movw r24, r30 e7f2: 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. e7f4: 40 91 56 03 lds r20, 0x0356 ; 0x800356 e7f8: 50 91 57 03 lds r21, 0x0357 ; 0x800357 e7fc: 41 15 cp r20, r1 e7fe: 51 05 cpc r21, r1 e800: a9 f3 breq .-22 ; 0xe7ec uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e802: fc 01 movw r30, r24 e804: 25 91 lpm r18, Z+ e806: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e808: 2f 3f cpi r18, 0xFF ; 255 e80a: 32 07 cpc r19, r18 e80c: 79 f3 breq .-34 ; 0xe7ec ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e80e: f9 01 movw r30, r18 e810: 38 96 adiw r30, 0x08 ; 8 e812: ee 0f add r30, r30 e814: ff 1f adc r31, r31 e816: e4 0f add r30, r20 e818: f5 1f adc r31, r21 e81a: 25 91 lpm r18, Z+ e81c: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e81e: fa 01 movw r30, r20 e820: e2 0f add r30, r18 e822: f3 1f adc r31, r19 e824: 24 91 lpm r18, Z e826: 22 23 and r18, r18 e828: 09 f3 breq .-62 ; 0xe7ec e82a: e2 cf rjmp .-60 ; 0xe7f0 0000e82c : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e82c: cf 93 push r28 e82e: df 93 push r29 e830: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e832: 20 e0 ldi r18, 0x00 ; 0 e834: 30 e0 ldi r19, 0x00 ; 0 e836: 4c e8 ldi r20, 0x8C ; 140 e838: 52 e4 ldi r21, 0x42 ; 66 e83a: 60 91 4c 07 lds r22, 0x074C ; 0x80074c e83e: 70 91 4d 07 lds r23, 0x074D ; 0x80074d e842: 80 91 4e 07 lds r24, 0x074E ; 0x80074e e846: 90 91 4f 07 lds r25, 0x074F ; 0x80074f e84a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> e84e: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c e852: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d e856: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e e85a: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e85e: 60 e0 ldi r22, 0x00 ; 0 e860: 70 e0 ldi r23, 0x00 ; 0 e862: 80 ea ldi r24, 0xA0 ; 160 e864: 91 e4 ldi r25, 0x41 ; 65 e866: 0f 94 11 ba call 0x37422 ; 0x37422 load_filament_final_feed(); e86a: 0e 94 d9 65 call 0xcbb2 ; 0xcbb2 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e86e: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e872: 82 e7 ldi r24, 0x72 ; 114 e874: 9d e5 ldi r25, 0x5D ; 93 e876: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 e87a: ac 01 movw r20, r24 e87c: 60 e0 ldi r22, 0x00 ; 0 e87e: 80 e0 ldi r24, 0x00 ; 0 e880: 0e 94 3a 70 call 0xe074 ; 0xe074 if (filament_name[0]) { e884: 88 81 ld r24, Y e886: 88 23 and r24, r24 e888: 39 f0 breq .+14 ; 0xe898 lcd_set_cursor(0, 1); e88a: 61 e0 ldi r22, 0x01 ; 1 e88c: 80 e0 ldi r24, 0x00 ; 0 e88e: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print(filament_name); e892: ce 01 movw r24, r28 e894: 0e 94 2d 72 call 0xe45a ; 0xe45a } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e898: 8a ee ldi r24, 0xEA ; 234 e89a: 99 e3 ldi r25, 0x39 ; 57 e89c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 e8a0: ac 01 movw r20, r24 e8a2: 62 e0 ldi r22, 0x02 ; 2 e8a4: 80 e0 ldi r24, 0x00 ; 0 e8a6: 0e 94 3a 70 call 0xe074 ; 0xe074 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 e8aa: 83 e4 ldi r24, 0x43 ; 67 e8ac: 9b e2 ldi r25, 0x2B ; 43 e8ae: 0f 94 9a 35 call 0x26b34 ; 0x26b34 lcd_loading_filament(filament_name); st_synchronize(); } e8b2: df 91 pop r29 e8b4: 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(); e8b6: 0d 94 db 57 jmp 0x2afb6 ; 0x2afb6 0000e8ba : * 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; e8ba: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 e8be: 8f 3f cpi r24, 0xFF ; 255 e8c0: 11 f1 breq .+68 ; 0xe906 lcd_update_enable(false); e8c2: 80 e0 ldi r24, 0x00 ; 0 e8c4: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_clear(); e8c8: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e8cc: 8e ec ldi r24, 0xCE ; 206 e8ce: 99 e5 ldi r25, 0x59 ; 89 e8d0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 e8d4: ac 01 movw r20, r24 e8d6: 61 e0 ldi r22, 0x01 ; 1 e8d8: 80 e0 ldi r24, 0x00 ; 0 e8da: 0e 94 3a 70 call 0xe074 ; 0xe074 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e8de: 80 e2 ldi r24, 0x20 ; 32 e8e0: 0e 94 d5 70 call 0xe1aa ; 0xe1aa lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e8e4: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 e8e8: 68 2f mov r22, r24 e8ea: 70 e0 ldi r23, 0x00 ; 0 e8ec: 6f 5f subi r22, 0xFF ; 255 e8ee: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e8f0: 07 2e mov r0, r23 e8f2: 00 0c add r0, r0 e8f4: 88 0b sbc r24, r24 e8f6: 99 0b sbc r25, r25 e8f8: 0e 94 df 71 call 0xe3be ; 0xe3be // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e8fc: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 lcd_update_enable(true); e900: 81 e0 ldi r24, 0x01 ; 1 e902: 0c 94 6b 70 jmp 0xe0d6 ; 0xe0d6 } e906: 08 95 ret 0000e908 : } #ifdef TMC2130 bool calibrate_z_auto() { e908: 4f 92 push r4 e90a: 5f 92 push r5 e90c: 6f 92 push r6 e90e: 7f 92 push r7 e910: 8f 92 push r8 e912: 9f 92 push r9 e914: af 92 push r10 e916: bf 92 push r11 e918: ef 92 push r14 e91a: ff 92 push r15 e91c: 0f 93 push r16 e91e: 1f 93 push r17 e920: cf 93 push r28 e922: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e924: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e928: 8a e8 ldi r24, 0x8A ; 138 e92a: 9a e4 ldi r25, 0x4A ; 74 e92c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 e930: ac 01 movw r20, r24 e932: 61 e0 ldi r22, 0x01 ; 1 e934: 80 e0 ldi r24, 0x00 ; 0 e936: 0e 94 3a 70 call 0xe074 ; 0xe074 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e93a: d0 91 8f 02 lds r29, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; e93e: 81 e0 ldi r24, 0x01 ; 1 e940: 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); e944: e8 ec ldi r30, 0xC8 ; 200 e946: fd e7 ldi r31, 0x7D ; 125 e948: 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); e94a: 84 e0 ldi r24, 0x04 ; 4 e94c: 0f 94 5d 3a call 0x274ba ; 0x274ba current_position[Z_AXIS] = 0; e950: 80 e4 ldi r24, 0x40 ; 64 e952: e8 2e mov r14, r24 e954: 87 e0 ldi r24, 0x07 ; 7 e956: f8 2e mov r15, r24 e958: f7 01 movw r30, r14 e95a: 10 86 std Z+8, r1 ; 0x08 e95c: 11 86 std Z+9, r1 ; 0x09 e95e: 12 86 std Z+10, r1 ; 0x0a e960: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e962: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 set_destination_to_current(); e966: 0e 94 80 69 call 0xd300 ; 0xd300 #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); e96a: e2 ec ldi r30, 0xC2 ; 194 e96c: fd e7 ldi r31, 0x7D ; 125 e96e: 85 90 lpm r8, Z+ e970: 95 90 lpm r9, Z+ e972: a5 90 lpm r10, Z+ e974: 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); e976: 01 e5 ldi r16, 0x51 ; 81 e978: 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); e97a: 8c 2f mov r24, r28 e97c: 99 27 eor r25, r25 e97e: 81 95 neg r24 e980: 0c f4 brge .+2 ; 0xe984 e982: 90 95 com r25 e984: 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); e986: 07 2e mov r0, r23 e988: 00 0c add r0, r0 e98a: 88 0b sbc r24, r24 e98c: 99 0b sbc r25, r25 e98e: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> e992: 2b 01 movw r4, r22 e994: 3c 01 movw r6, r24 e996: 2d ec ldi r18, 0xCD ; 205 e998: 3c ec ldi r19, 0xCC ; 204 e99a: 4c e8 ldi r20, 0x8C ; 140 e99c: 5f e3 ldi r21, 0x3F ; 63 e99e: c5 01 movw r24, r10 e9a0: b4 01 movw r22, r8 e9a2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> e9a6: 9b 01 movw r18, r22 e9a8: ac 01 movw r20, r24 e9aa: c3 01 movw r24, r6 e9ac: b2 01 movw r22, r4 e9ae: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> e9b2: f8 01 movw r30, r16 e9b4: 20 85 ldd r18, Z+8 ; 0x08 e9b6: 31 85 ldd r19, Z+9 ; 0x09 e9b8: 42 85 ldd r20, Z+10 ; 0x0a e9ba: 53 85 ldd r21, Z+11 ; 0x0b e9bc: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> e9c0: f8 01 movw r30, r16 e9c2: 60 87 std Z+8, r22 ; 0x08 e9c4: 71 87 std Z+9, r23 ; 0x09 e9c6: 82 87 std Z+10, r24 ; 0x0a e9c8: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e9ca: 80 e0 ldi r24, 0x00 ; 0 e9cc: 90 e0 ldi r25, 0x00 ; 0 e9ce: a8 e4 ldi r26, 0x48 ; 72 e9d0: b4 e4 ldi r27, 0x44 ; 68 e9d2: 80 93 90 02 sts 0x0290, r24 ; 0x800290 e9d6: 90 93 91 02 sts 0x0291, r25 ; 0x800291 e9da: a0 93 92 02 sts 0x0292, r26 ; 0x800292 e9de: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); e9e2: 65 e5 ldi r22, 0x55 ; 85 e9e4: 75 e5 ldi r23, 0x55 ; 85 e9e6: 85 e5 ldi r24, 0x55 ; 85 e9e8: 91 e4 ldi r25, 0x41 ; 65 e9ea: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); e9ee: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e9f2: 0f 94 2e 3a call 0x2745c ; 0x2745c e9f6: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[Z_AXIS] = 0; e9fa: f7 01 movw r30, r14 e9fc: 10 86 std Z+8, r1 ; 0x08 e9fe: 11 86 std Z+9, r1 ; 0x09 ea00: 12 86 std Z+10, r1 ; 0x0a ea02: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); ea04: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 set_destination_to_current(); ea08: 0e 94 80 69 call 0xd300 ; 0xd300 destination[Z_AXIS] += 10 * axis_up_dir; //10mm up ea0c: f6 ef ldi r31, 0xF6 ; 246 ea0e: cf 02 muls r28, r31 ea10: b0 01 movw r22, r0 ea12: 11 24 eor r1, r1 ea14: 07 2e mov r0, r23 ea16: 00 0c add r0, r0 ea18: 88 0b sbc r24, r24 ea1a: 99 0b sbc r25, r25 ea1c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> ea20: 9b 01 movw r18, r22 ea22: ac 01 movw r20, r24 ea24: f8 01 movw r30, r16 ea26: 60 85 ldd r22, Z+8 ; 0x08 ea28: 71 85 ldd r23, Z+9 ; 0x09 ea2a: 82 85 ldd r24, Z+10 ; 0x0a ea2c: 93 85 ldd r25, Z+11 ; 0x0b ea2e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> ea32: f8 01 movw r30, r16 ea34: 60 87 std Z+8, r22 ; 0x08 ea36: 71 87 std Z+9, r23 ; 0x09 ea38: 82 87 std Z+10, r24 ; 0x0a ea3a: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; ea3c: 80 e0 ldi r24, 0x00 ; 0 ea3e: 90 e0 ldi r25, 0x00 ; 0 ea40: a8 ec ldi r26, 0xC8 ; 200 ea42: b3 e4 ldi r27, 0x43 ; 67 ea44: 80 93 90 02 sts 0x0290, r24 ; 0x800290 ea48: 90 93 91 02 sts 0x0291, r25 ; 0x800291 ea4c: a0 93 92 02 sts 0x0292, r26 ; 0x800292 ea50: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); ea54: 65 e5 ldi r22, 0x55 ; 85 ea56: 75 e5 ldi r23, 0x55 ; 85 ea58: 85 ed ldi r24, 0xD5 ; 213 ea5a: 90 e4 ldi r25, 0x40 ; 64 ea5c: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); ea60: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 ea64: 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; ea68: 80 e0 ldi r24, 0x00 ; 0 ea6a: 90 e0 ldi r25, 0x00 ; 0 ea6c: ab e5 ldi r26, 0x5B ; 91 ea6e: b3 e4 ldi r27, 0x43 ; 67 ea70: f7 01 movw r30, r14 ea72: 80 87 std Z+8, r24 ; 0x08 ea74: 91 87 std Z+9, r25 ; 0x09 ea76: a2 87 std Z+10, r26 ; 0x0a ea78: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); ea7a: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 return true; } ea7e: 81 e0 ldi r24, 0x01 ; 1 ea80: df 91 pop r29 ea82: cf 91 pop r28 ea84: 1f 91 pop r17 ea86: 0f 91 pop r16 ea88: ff 90 pop r15 ea8a: ef 90 pop r14 ea8c: bf 90 pop r11 ea8e: af 90 pop r10 ea90: 9f 90 pop r9 ea92: 8f 90 pop r8 ea94: 7f 90 pop r7 ea96: 6f 90 pop r6 ea98: 5f 90 pop r5 ea9a: 4f 90 pop r4 ea9c: 08 95 ret 0000ea9e : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { ea9e: cf 93 push r28 eaa0: df 93 push r29 eaa2: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; eaa4: 60 ff sbrs r22, 0 eaa6: 03 c0 rjmp .+6 ; 0xeaae eaa8: 28 e5 ldi r18, 0x58 ; 88 eaaa: 28 83 st Y, r18 eaac: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; eaae: 61 ff sbrs r22, 1 eab0: 03 c0 rjmp .+6 ; 0xeab8 eab2: 29 e5 ldi r18, 0x59 ; 89 eab4: 28 83 st Y, r18 eab6: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; eab8: 80 e2 ldi r24, 0x20 ; 32 eaba: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); eabc: 80 e0 ldi r24, 0x00 ; 0 eabe: 96 e3 ldi r25, 0x36 ; 54 eac0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 eac4: bc 01 movw r22, r24 eac6: ce 01 movw r24, r28 } eac8: df 91 pop r29 eaca: 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)); eacc: 0d 94 c6 da jmp 0x3b58c ; 0x3b58c 0000ead0 <__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 { ead0: 1f 92 push r1 ead2: 0f 92 push r0 ead4: 0f b6 in r0, 0x3f ; 63 ead6: 0f 92 push r0 ead8: 11 24 eor r1, r1 eada: 0b b6 in r0, 0x3b ; 59 eadc: 0f 92 push r0 eade: 2f 93 push r18 eae0: 8f 93 push r24 eae2: 9f 93 push r25 eae4: ef 93 push r30 eae6: ff 93 push r31 switch(state){ eae8: e0 91 51 03 lds r30, 0x0351 ; 0x800351 eaec: e8 30 cpi r30, 0x08 ; 8 eaee: e8 f4 brcc .+58 ; 0xeb2a <__vector_23+0x5a> eaf0: f0 e0 ldi r31, 0x00 ; 0 eaf2: 88 27 eor r24, r24 eaf4: e1 58 subi r30, 0x81 ; 129 eaf6: fa 48 sbci r31, 0x8A ; 138 eaf8: 8f 4f sbci r24, 0xFF ; 255 eafa: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> eafe: 87 75 andi r24, 0x57 ; 87 eb00: a1 75 andi r26, 0x51 ; 81 eb02: ac 75 andi r26, 0x5C ; 92 eb04: ba 75 andi r27, 0x5A ; 90 eb06: d0 75 andi r29, 0x50 ; 80 eb08: d9 75 andi r29, 0x59 ; 89 eb0a: fc 75 andi r31, 0x5C ; 92 eb0c: 0e 76 andi r16, 0x6E ; 110 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin eb0e: 80 91 6a 06 lds r24, 0x066A ; 0x80066a eb12: 81 11 cpse r24, r1 eb14: 0a c0 rjmp .+20 ; 0xeb2a <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! eb16: 80 91 17 06 lds r24, 0x0617 ; 0x800617 eb1a: 88 0f add r24, r24 eb1c: 80 93 50 03 sts 0x0350, r24 ; 0x800350 if( pwm != 0 ){ eb20: 88 23 and r24, r24 eb22: 19 f0 breq .+6 ; 0xeb2a <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period eb24: 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 eb26: 80 93 51 03 sts 0x0351, r24 ; 0x800351 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } eb2a: ff 91 pop r31 eb2c: ef 91 pop r30 eb2e: 9f 91 pop r25 eb30: 8f 91 pop r24 eb32: 2f 91 pop r18 eb34: 0f 90 pop r0 eb36: 0b be out 0x3b, r0 ; 59 eb38: 0f 90 pop r0 eb3a: 0f be out 0x3f, r0 ; 63 eb3c: 0f 90 pop r0 eb3e: 1f 90 pop r1 eb40: 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) eb42: 80 91 4f 03 lds r24, 0x034F ; 0x80034f eb46: 8f 5f subi r24, 0xFF ; 255 eb48: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f if( slowCounter > pwm ){ eb4c: 90 91 50 03 lds r25, 0x0350 ; 0x800350 eb50: 98 17 cp r25, r24 eb52: 58 f3 brcs .-42 ; 0xeb2a <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 eb54: 82 e0 ldi r24, 0x02 ; 2 eb56: e7 cf rjmp .-50 ; 0xeb26 <__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 eb58: 83 e0 ldi r24, 0x03 ; 3 eb5a: 80 93 51 03 sts 0x0351, r24 ; 0x800351 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE eb5e: 8f e0 ldi r24, 0x0F ; 15 eb60: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e TCNT0 = 255; // force overflow on the next clock cycle eb64: 8f ef ldi r24, 0xFF ; 255 eb66: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz eb68: 81 e0 ldi r24, 0x01 ; 1 eb6a: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) eb6c: 84 b5 in r24, 0x24 ; 36 eb6e: 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 eb70: 84 bd out 0x24, r24 ; 36 eb72: db cf rjmp .-74 ; 0xeb2a <__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; eb74: 80 91 4e 03 lds r24, 0x034E ; 0x80034e eb78: 82 95 swap r24 eb7a: 80 7f andi r24, 0xF0 ; 240 eb7c: 81 95 neg r24 eb7e: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ eb80: 80 91 4e 03 lds r24, 0x034E ; 0x80034e eb84: 88 23 and r24, r24 eb86: 21 f0 breq .+8 ; 0xeb90 <__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; eb88: 81 50 subi r24, 0x01 ; 1 eb8a: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e eb8e: cd cf rjmp .-102 ; 0xeb2a <__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; eb90: 84 e0 ldi r24, 0x04 ; 4 eb92: 80 93 51 03 sts 0x0351, r24 ; 0x800351 OCR0B = 255; // full duty eb96: 8f ef ldi r24, 0xFF ; 255 eb98: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle eb9a: 8e ef ldi r24, 0xFE ; 254 eb9c: 86 bd out 0x26, r24 ; 38 eb9e: c5 cf rjmp .-118 ; 0xeb2a <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; eba0: 85 e0 ldi r24, 0x05 ; 5 eba2: 80 93 51 03 sts 0x0351, r24 ; 0x800351 OCR0B = 255; // full duty eba6: 8f ef ldi r24, 0xFF ; 255 eba8: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle ebaa: 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 ebac: 82 e0 ldi r24, 0x02 ; 2 ebae: 85 bd out 0x25, r24 ; 37 ebb0: bc cf rjmp .-136 ; 0xeb2a <__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; ebb2: 2f ef ldi r18, 0xFF ; 255 ebb4: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin ebb6: 80 91 6a 06 lds r24, 0x066A ; 0x80066a ebba: 81 11 cpse r24, r1 ebbc: b6 cf rjmp .-148 ; 0xeb2a <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less ebbe: 80 91 4f 03 lds r24, 0x034F ; 0x80034f ebc2: 8f 5f subi r24, 0xFF ; 255 ebc4: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f if( slowCounter < pwm ){ ebc8: 90 91 50 03 lds r25, 0x0350 ; 0x800350 ebcc: 89 17 cp r24, r25 ebce: 08 f4 brcc .+2 ; 0xebd2 <__vector_23+0x102> ebd0: ac cf rjmp .-168 ; 0xeb2a <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain ebd2: 80 91 17 06 lds r24, 0x0617 ; 0x800617 ebd6: 90 e0 ldi r25, 0x00 ; 0 ebd8: 8f 37 cpi r24, 0x7F ; 127 ebda: 91 05 cpc r25, r1 ebdc: 0c f0 brlt .+2 ; 0xebe0 <__vector_23+0x110> ebde: a5 cf rjmp .-182 ; 0xeb2a <__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; ebe0: 86 e0 ldi r24, 0x06 ; 6 ebe2: 80 93 51 03 sts 0x0351, r24 ; 0x800351 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ebe6: 8f e0 ldi r24, 0x0F ; 15 ebe8: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e TCNT0 = 255; // force overflow on the next clock cycle ebec: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ebee: 81 e0 ldi r24, 0x01 ; 1 ebf0: 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 ebf2: 84 b5 in r24, 0x24 ; 36 ebf4: 80 61 ori r24, 0x10 ; 16 ebf6: bc cf rjmp .-136 ; 0xeb70 <__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 ebf8: 80 91 4e 03 lds r24, 0x034E ; 0x80034e ebfc: 82 95 swap r24 ebfe: 80 7f andi r24, 0xF0 ; 240 ec00: 81 95 neg r24 ec02: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ ec04: 80 91 4e 03 lds r24, 0x034E ; 0x80034e ec08: 81 11 cpse r24, r1 ec0a: be cf rjmp .-132 ; 0xeb88 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; ec0c: 87 e0 ldi r24, 0x07 ; 7 ec0e: 80 93 51 03 sts 0x0351, r24 ; 0x800351 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes ec12: 80 e8 ldi r24, 0x80 ; 128 ec14: 86 bd out 0x26, r24 ; 38 OCR0B = 255; ec16: 8f ef ldi r24, 0xFF ; 255 ec18: 88 bd out 0x28, r24 ; 40 ec1a: 87 cf rjmp .-242 ; 0xeb2a <__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 ec1c: 10 92 51 03 sts 0x0351, r1 ; 0x800351 TCNT0 = 128; ec20: 80 e8 ldi r24, 0x80 ; 128 ec22: 86 bd out 0x26, r24 ; 38 OCR0B = 255; ec24: 8f ef ldi r24, 0xFF ; 255 ec26: 88 bd out 0x28, r24 ; 40 ec28: c1 cf rjmp .-126 ; 0xebac <__vector_23+0xdc> 0000ec2a : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { ec2a: cf 93 push r28 ec2c: df 93 push r29 ec2e: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); ec30: 87 e6 ldi r24, 0x67 ; 103 ec32: 9f e0 ldi r25, 0x0F ; 15 ec34: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e ec38: 91 e0 ldi r25, 0x01 ; 1 ec3a: 81 11 cpse r24, r1 ec3c: 01 c0 rjmp .+2 ; 0xec40 ec3e: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { ec40: 81 e0 ldi r24, 0x01 ; 1 ec42: 28 81 ld r18, Y ec44: 21 11 cpse r18, r1 ec46: 01 c0 rjmp .+2 ; 0xec4a ec48: 80 e0 ldi r24, 0x00 ; 0 ec4a: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; ec4c: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); ec4e: 87 e0 ldi r24, 0x07 ; 7 ec50: 9f e0 ldi r25, 0x0F ; 15 ec52: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e ec56: 91 e0 ldi r25, 0x01 ; 1 ec58: 81 11 cpse r24, r1 ec5a: 01 c0 rjmp .+2 ; 0xec5e ec5c: 90 e0 ldi r25, 0x00 ; 0 ec5e: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); ec60: 85 ed ldi r24, 0xD5 ; 213 ec62: 9e e0 ldi r25, 0x0E ; 14 ec64: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e ec68: 91 e0 ldi r25, 0x01 ; 1 ec6a: 81 11 cpse r24, r1 ec6c: 01 c0 rjmp .+2 ; 0xec70 ec6e: 90 e0 ldi r25, 0x00 ; 0 ec70: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); ec72: 87 e4 ldi r24, 0x47 ; 71 ec74: 9d e0 ldi r25, 0x0D ; 13 ec76: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e if (sensorActionOnError == SensorActionOnError::_Undef) { ec7a: 8f 3f cpi r24, 0xFF ; 255 ec7c: 21 f0 breq .+8 ; 0xec86 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); ec7e: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } ec80: df 91 pop r29 ec82: cf 91 pop r28 ec84: 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; ec86: 18 86 std Y+8, r1 ; 0x08 ec88: fb cf rjmp .-10 ; 0xec80 0000ec8a : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { ec8a: cf 93 push r28 ec8c: c8 2f mov r28, r24 ec8e: 68 2f mov r22, r24 ec90: 87 e6 ldi r24, 0x67 ; 103 ec92: 9f e0 ldi r25, 0x0F ; 15 ec94: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { ec98: cc 23 and r28, r28 ec9a: 19 f0 breq .+6 ; 0xeca2 fsensor.init(); } else { fsensor.deinit(); } } ec9c: 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(); ec9e: 0d 94 ef 85 jmp 0x30bde ; 0x30bde } else { fsensor.deinit(); } } eca2: 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(); eca4: 0d 94 df 85 jmp 0x30bbe ; 0x30bbe 0000eca8 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; eca8: 10 92 33 05 sts 0x0533, r1 ; 0x800533 extruder_autofan_last_check = _millis(); ecac: 0f 94 55 3e call 0x27caa ; 0x27caa ecb0: 60 93 99 17 sts 0x1799, r22 ; 0x801799 ecb4: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a ecb8: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b ecbc: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c } ecc0: 08 95 ret 0000ecc2 <__vector_7>: EICRB ^= (1 << 6); //change edge } #endif //(defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) #ifdef EXTRUDER_ALTFAN_DETECT ISR(INT6_vect) { ecc2: 1f 92 push r1 ecc4: 0f 92 push r0 ecc6: 0f b6 in r0, 0x3f ; 63 ecc8: 0f 92 push r0 ecca: 11 24 eor r1, r1 eccc: 0b b6 in r0, 0x3b ; 59 ecce: 0f 92 push r0 ecd0: 8f 93 push r24 ecd2: 9f 93 push r25 ecd4: ef 93 push r30 ecd6: ff 93 push r31 fan_edge_counter[0]++; ecd8: e2 eb ldi r30, 0xB2 ; 178 ecda: f4 e0 ldi r31, 0x04 ; 4 ecdc: 80 81 ld r24, Z ecde: 91 81 ldd r25, Z+1 ; 0x01 ece0: 01 96 adiw r24, 0x01 ; 1 ece2: 91 83 std Z+1, r25 ; 0x01 ece4: 80 83 st Z, r24 } ece6: ff 91 pop r31 ece8: ef 91 pop r30 ecea: 9f 91 pop r25 ecec: 8f 91 pop r24 ecee: 0f 90 pop r0 ecf0: 0b be out 0x3b, r0 ; 59 ecf2: 0f 90 pop r0 ecf4: 0f be out 0x3f, r0 ; 63 ecf6: 0f 90 pop r0 ecf8: 1f 90 pop r1 ecfa: 18 95 reti 0000ecfc <__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) { ecfc: 1f 92 push r1 ecfe: 0f 92 push r0 ed00: 0f b6 in r0, 0x3f ; 63 ed02: 0f 92 push r0 ed04: 11 24 eor r1, r1 ed06: 2f 93 push r18 ed08: 4f 93 push r20 ed0a: 5f 93 push r21 ed0c: 6f 93 push r22 ed0e: 7f 93 push r23 ed10: 8f 93 push r24 ed12: 9f 93 push r25 ed14: af 93 push r26 ed16: 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; ed18: 80 91 33 05 lds r24, 0x0533 ; 0x800533 ed1c: 88 23 and r24, r24 ed1e: f1 f0 breq .+60 ; 0xed5c <__vector_8+0x60> ed20: 80 91 9d 04 lds r24, 0x049D ; 0x80049d ed24: 8b 34 cpi r24, 0x4B ; 75 ed26: d0 f0 brcs .+52 ; 0xed5c <__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 ed28: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ed2c: 86 ff sbrs r24, 6 ed2e: 24 c0 rjmp .+72 ; 0xed78 <__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; ed30: 80 91 35 06 lds r24, 0x0635 ; 0x800635 ed34: 90 91 36 06 lds r25, 0x0636 ; 0x800636 ed38: a0 91 37 06 lds r26, 0x0637 ; 0x800637 ed3c: b0 91 38 06 lds r27, 0x0638 ; 0x800638 t_fan_rising_edge = millis_nc(); ed40: 80 93 47 03 sts 0x0347, r24 ; 0x800347 ed44: 90 93 48 03 sts 0x0348, r25 ; 0x800348 ed48: a0 93 49 03 sts 0x0349, r26 ; 0x800349 ed4c: b0 93 4a 03 sts 0x034A, r27 ; 0x80034a else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse } } EICRB ^= (1 << 6); //change edge ed50: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ed54: 90 e4 ldi r25, 0x40 ; 64 ed56: 89 27 eor r24, r25 ed58: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } ed5c: bf 91 pop r27 ed5e: af 91 pop r26 ed60: 9f 91 pop r25 ed62: 8f 91 pop r24 ed64: 7f 91 pop r23 ed66: 6f 91 pop r22 ed68: 5f 91 pop r21 ed6a: 4f 91 pop r20 ed6c: 2f 91 pop r18 ed6e: 0f 90 pop r0 ed70: 0f be out 0x3f, r0 ; 63 ed72: 0f 90 pop r0 ed74: 1f 90 pop r1 ed76: 18 95 reti ed78: 80 91 35 06 lds r24, 0x0635 ; 0x800635 ed7c: 90 91 36 06 lds r25, 0x0636 ; 0x800636 ed80: a0 91 37 06 lds r26, 0x0637 ; 0x800637 ed84: b0 91 38 06 lds r27, 0x0638 ; 0x800638 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 ed88: 40 91 47 03 lds r20, 0x0347 ; 0x800347 ed8c: 50 91 48 03 lds r21, 0x0348 ; 0x800348 ed90: 60 91 49 03 lds r22, 0x0349 ; 0x800349 ed94: 70 91 4a 03 lds r23, 0x034A ; 0x80034a ed98: 84 1b sub r24, r20 ed9a: 95 0b sbc r25, r21 ed9c: a6 0b sbc r26, r22 ed9e: b7 0b sbc r27, r23 eda0: 20 91 df 03 lds r18, 0x03DF ; 0x8003df eda4: 44 e0 ldi r20, 0x04 ; 4 eda6: 50 e0 ldi r21, 0x00 ; 0 eda8: 60 e0 ldi r22, 0x00 ; 0 edaa: 70 e0 ldi r23, 0x00 ; 0 edac: 25 36 cpi r18, 0x65 ; 101 edae: 20 f0 brcs .+8 ; 0xedb8 <__vector_8+0xbc> edb0: 43 e0 ldi r20, 0x03 ; 3 edb2: 50 e0 ldi r21, 0x00 ; 0 edb4: 60 e0 ldi r22, 0x00 ; 0 edb6: 70 e0 ldi r23, 0x00 ; 0 edb8: 84 17 cp r24, r20 edba: 95 07 cpc r25, r21 edbc: a6 07 cpc r26, r22 edbe: b7 07 cpc r27, r23 edc0: 38 f2 brcs .-114 ; 0xed50 <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse edc2: 80 91 b4 04 lds r24, 0x04B4 ; 0x8004b4 edc6: 90 91 b5 04 lds r25, 0x04B5 ; 0x8004b5 edca: 02 96 adiw r24, 0x02 ; 2 edcc: 90 93 b5 04 sts 0x04B5, r25 ; 0x8004b5 edd0: 80 93 b4 04 sts 0x04B4, r24 ; 0x8004b4 edd4: bd cf rjmp .-134 ; 0xed50 <__vector_8+0x54> 0000edd6 : } #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) void countFanSpeed() { edd6: 8f 92 push r8 edd8: 9f 92 push r9 edda: af 92 push r10 eddc: bf 92 push r11 edde: cf 92 push r12 ede0: df 92 push r13 ede2: ef 92 push r14 ede4: ff 92 push r15 ede6: 0f 93 push r16 ede8: 1f 93 push r17 edea: cf 93 push r28 edec: 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))); edee: c2 eb ldi r28, 0xB2 ; 178 edf0: d4 e0 ldi r29, 0x04 ; 4 edf2: 68 81 ld r22, Y edf4: 79 81 ldd r23, Y+1 ; 0x01 edf6: 07 2e mov r0, r23 edf8: 00 0c add r0, r0 edfa: 88 0b sbc r24, r24 edfc: 99 0b sbc r25, r25 edfe: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> ee02: 6b 01 movw r12, r22 ee04: 7c 01 movw r14, r24 ee06: 0f 94 55 3e call 0x27caa ; 0x27caa ee0a: 0e ea ldi r16, 0xAE ; 174 ee0c: 14 e0 ldi r17, 0x04 ; 4 ee0e: 80 90 99 17 lds r8, 0x1799 ; 0x801799 ee12: 90 90 9a 17 lds r9, 0x179A ; 0x80179a ee16: a0 90 9b 17 lds r10, 0x179B ; 0x80179b ee1a: b0 90 9c 17 lds r11, 0x179C ; 0x80179c ee1e: 68 19 sub r22, r8 ee20: 79 09 sbc r23, r9 ee22: 8a 09 sbc r24, r10 ee24: 9b 09 sbc r25, r11 ee26: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> ee2a: 9b 01 movw r18, r22 ee2c: ac 01 movw r20, r24 ee2e: 60 e0 ldi r22, 0x00 ; 0 ee30: 70 e0 ldi r23, 0x00 ; 0 ee32: 8a e7 ldi r24, 0x7A ; 122 ee34: 93 e4 ldi r25, 0x43 ; 67 ee36: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> ee3a: a7 01 movw r20, r14 ee3c: 96 01 movw r18, r12 ee3e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> ee42: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> ee46: f8 01 movw r30, r16 ee48: 71 83 std Z+1, r23 ; 0x01 ee4a: 60 83 st Z, r22 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); ee4c: 6a 81 ldd r22, Y+2 ; 0x02 ee4e: 7b 81 ldd r23, Y+3 ; 0x03 ee50: 07 2e mov r0, r23 ee52: 00 0c add r0, r0 ee54: 88 0b sbc r24, r24 ee56: 99 0b sbc r25, r25 ee58: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> ee5c: 6b 01 movw r12, r22 ee5e: 7c 01 movw r14, r24 ee60: 0f 94 55 3e call 0x27caa ; 0x27caa ee64: 80 90 99 17 lds r8, 0x1799 ; 0x801799 ee68: 90 90 9a 17 lds r9, 0x179A ; 0x80179a ee6c: a0 90 9b 17 lds r10, 0x179B ; 0x80179b ee70: b0 90 9c 17 lds r11, 0x179C ; 0x80179c ee74: 68 19 sub r22, r8 ee76: 79 09 sbc r23, r9 ee78: 8a 09 sbc r24, r10 ee7a: 9b 09 sbc r25, r11 ee7c: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> ee80: 9b 01 movw r18, r22 ee82: ac 01 movw r20, r24 ee84: 60 e0 ldi r22, 0x00 ; 0 ee86: 70 e0 ldi r23, 0x00 ; 0 ee88: 8a e7 ldi r24, 0x7A ; 122 ee8a: 93 e4 ldi r25, 0x43 ; 67 ee8c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> ee90: a7 01 movw r20, r14 ee92: 96 01 movw r18, r12 ee94: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> ee98: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> ee9c: f8 01 movw r30, r16 ee9e: 73 83 std Z+3, r23 ; 0x03 eea0: 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; eea2: 19 82 std Y+1, r1 ; 0x01 eea4: 18 82 st Y, r1 fan_edge_counter[1] = 0; eea6: 1b 82 std Y+3, r1 ; 0x03 eea8: 1a 82 std Y+2, r1 ; 0x02 } eeaa: df 91 pop r29 eeac: cf 91 pop r28 eeae: 1f 91 pop r17 eeb0: 0f 91 pop r16 eeb2: ff 90 pop r15 eeb4: ef 90 pop r14 eeb6: df 90 pop r13 eeb8: cf 90 pop r12 eeba: bf 90 pop r11 eebc: af 90 pop r10 eebe: 9f 90 pop r9 eec0: 8f 90 pop r8 eec2: 08 95 ret 0000eec4 : 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; eec4: 80 93 4b 03 sts 0x034B, r24 ; 0x80034b newFanSpeed = 0; eec8: 10 92 69 03 sts 0x0369, r1 ; 0x800369 if (fanState & 0x01) eecc: 80 ff sbrs r24, 0 eece: 08 c0 rjmp .+16 ; 0xeee0 { #ifdef EXTRUDER_ALTFAN_DETECT if (altfanStatus.isAltfan && !altfanStatus.altfanOverride) newFanSpeed = EXTRUDER_ALTFAN_SPEED_SILENT; eed0: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> eed4: 83 70 andi r24, 0x03 ; 3 eed6: 81 30 cpi r24, 0x01 ; 1 eed8: e9 f4 brne .+58 ; 0xef14 eeda: 80 e8 ldi r24, 0x80 ; 128 else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; eedc: 80 93 69 03 sts 0x0369, r24 ; 0x800369 #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); eee0: 20 91 69 03 lds r18, 0x0369 ; 0x800369 } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) eee4: 8f ef ldi r24, 0xFF ; 255 eee6: 82 0f add r24, r18 eee8: 8e 3f cpi r24, 0xFE ; 254 eeea: d8 f0 brcs .+54 ; 0xef22 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); eeec: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> eef0: 87 7f andi r24, 0xF7 ; 247 eef2: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; eef6: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> eefa: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); eefe: 9f b7 in r25, 0x3f ; 63 ef00: 22 23 and r18, r18 ef02: 51 f0 breq .+20 ; 0xef18 ef04: f8 94 cli ef06: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ef0a: 80 62 ori r24, 0x20 ; 32 ef0c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ef10: 9f bf out 0x3f, r25 ; 63 ef12: 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; ef14: 8f ef ldi r24, 0xFF ; 255 ef16: e2 cf rjmp .-60 ; 0xeedc ef18: f8 94 cli ef1a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ef1e: 8f 7d andi r24, 0xDF ; 223 ef20: f5 cf rjmp .-22 ; 0xef0c 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; ef22: ef b7 in r30, 0x3f ; 63 ef24: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); ef26: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ef2a: 88 60 ori r24, 0x08 ; 8 ef2c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; ef30: 30 e0 ldi r19, 0x00 ; 0 ef32: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> ef36: 4f ef ldi r20, 0xFF ; 255 ef38: 50 e0 ldi r21, 0x00 ; 0 ef3a: 81 ff sbrs r24, 1 ef3c: 04 c0 rjmp .+8 ; 0xef46 ef3e: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> ef42: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> ef46: 24 9f mul r18, r20 ef48: c0 01 movw r24, r0 ef4a: 25 9f mul r18, r21 ef4c: 90 0d add r25, r0 ef4e: 34 9f mul r19, r20 ef50: 90 0d add r25, r0 ef52: 11 24 eor r1, r1 ef54: 6f ef ldi r22, 0xFF ; 255 ef56: 70 e0 ldi r23, 0x00 ; 0 ef58: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> ef5c: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ef60: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; ef64: ef bf out 0x3f, r30 ; 63 #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } ef66: 08 95 ret 0000ef68 : 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); ef68: 8b e2 ldi r24, 0x2B ; 43 ef6a: 9d e0 ldi r25, 0x0D ; 13 ef6c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e ef70: 90 91 b6 04 lds r25, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> ef74: 80 fb bst r24, 0 ef76: 91 f9 bld r25, 1 ef78: 90 93 b6 04 sts 0x04B6, r25 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> #endif resetFanCheck(); ef7c: 0e 94 54 76 call 0xeca8 ; 0xeca8 setExtruderAutoFanState(1); ef80: 81 e0 ldi r24, 0x01 ; 1 ef82: 0c 94 62 77 jmp 0xeec4 ; 0xeec4 0000ef86 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { ef86: 1f 93 push r17 ef88: cf 93 push r28 ef8a: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) ef8c: d0 91 4b 03 lds r29, 0x034B ; 0x80034b ef90: d1 fd sbrc r29, 1 ef92: 1d c0 rjmp .+58 ; 0xefce temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; ef94: 10 91 1b 05 lds r17, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ef98: c1 e0 ldi r28, 0x01 ; 1 ef9a: 20 e0 ldi r18, 0x00 ; 0 ef9c: 30 e0 ldi r19, 0x00 ; 0 ef9e: 48 e4 ldi r20, 0x48 ; 72 efa0: 52 e4 ldi r21, 0x42 ; 66 efa2: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e efa6: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f efaa: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 efae: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 efb2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> efb6: 18 16 cp r1, r24 efb8: 0c f0 brlt .+2 ; 0xefbc efba: 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; efbc: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; efbe: cd 2b or r28, r29 efc0: 81 e0 ldi r24, 0x01 ; 1 efc2: 11 11 cpse r17, r1 efc4: 01 c0 rjmp .+2 ; 0xefc8 efc6: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); efc8: c8 2b or r28, r24 efca: c0 93 4b 03 sts 0x034B, r28 ; 0x80034b } setExtruderAutoFanState(fanState); efce: 80 91 4b 03 lds r24, 0x034B ; 0x80034b #endif } efd2: df 91 pop r29 efd4: cf 91 pop r28 efd6: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); efd8: 0c 94 62 77 jmp 0xeec4 ; 0xeec4 0000efdc : 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) { efdc: ef 92 push r14 efde: ff 92 push r15 efe0: 0f 93 push r16 efe2: 1f 93 push r17 efe4: cf 93 push r28 efe6: df 93 push r29 efe8: ec 01 movw r28, r24 efea: 8b 01 movw r16, r22 efec: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) efee: 0e 94 f2 5c call 0xb9e4 ; 0xb9e4 eff2: 81 11 cpse r24, r1 eff4: 0b c0 rjmp .+22 ; 0xf00c #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); eff6: a8 01 movw r20, r16 eff8: be 01 movw r22, r28 effa: 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); } effc: df 91 pop r29 effe: cf 91 pop r28 f000: 1f 91 pop r17 f002: 0f 91 pop r16 f004: ff 90 pop r15 f006: 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); f008: 0d 94 23 dd jmp 0x3ba46 ; 0x3ba46 } 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); } f00c: df 91 pop r29 f00e: cf 91 pop r28 f010: 1f 91 pop r17 f012: 0f 91 pop r16 f014: ff 90 pop r15 f016: ef 90 pop r14 f018: 08 95 ret 0000f01a : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { f01a: 0f 93 push r16 f01c: 1f 93 push r17 f01e: cf 93 push r28 f020: df 93 push r29 f022: 8c 01 movw r16, r24 f024: d6 2f mov r29, r22 f026: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); f028: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a if (val == EEPROM_EMPTY_VALUE16) { f02c: 8f 3f cpi r24, 0xFF ; 255 f02e: 98 07 cpc r25, r24 f030: 39 f4 brne .+14 ; 0xf040 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); f032: 6d 2f mov r22, r29 f034: 7c 2f mov r23, r28 f036: c8 01 movw r24, r16 f038: 0f 94 6d dd call 0x3bada ; 0x3bada 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; f03c: 8d 2f mov r24, r29 f03e: 9c 2f mov r25, r28 } return val; } f040: df 91 pop r29 f042: cf 91 pop r28 f044: 1f 91 pop r17 f046: 0f 91 pop r16 f048: 08 95 ret 0000f04a : 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) { f04a: 0f 93 push r16 f04c: 1f 93 push r17 f04e: cf 93 push r28 f050: 8c 01 movw r16, r24 f052: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); f054: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e if (val == EEPROM_EMPTY_VALUE) { f058: 8f 3f cpi r24, 0xFF ; 255 f05a: 29 f4 brne .+10 ; 0xf066 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); f05c: 6c 2f mov r22, r28 f05e: c8 01 movw r24, r16 f060: 0f 94 57 dd call 0x3baae ; 0x3baae 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; f064: 8c 2f mov r24, r28 } return val; } f066: cf 91 pop r28 f068: 1f 91 pop r17 f06a: 0f 91 pop r16 f06c: 08 95 ret 0000f06e : 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) { f06e: cf 93 push r28 f070: df 93 push r29 f072: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); f074: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a f078: bc 01 movw r22, r24 f07a: 6f 5f subi r22, 0xFF ; 255 f07c: 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); f07e: 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); } f080: df 91 pop r29 f082: 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); f084: 0d 94 6d dd jmp 0x3bada ; 0x3bada 0000f088 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { f088: cf 93 push r28 f08a: df 93 push r29 f08c: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); f08e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e f092: 61 e0 ldi r22, 0x01 ; 1 f094: 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); f096: 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); } f098: df 91 pop r29 f09a: 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); f09c: 0d 94 57 dd jmp 0x3baae ; 0x3baae 0000f0a0 : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { f0a0: cf 93 push r28 f0a2: df 93 push r29 f0a4: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); f0a6: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e f0aa: 61 e0 ldi r22, 0x01 ; 1 f0ac: 81 11 cpse r24, r1 f0ae: 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); f0b0: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } f0b2: df 91 pop r29 f0b4: 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); f0b6: 0d 94 57 dd jmp 0x3baae ; 0x3baae 0000f0ba : 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); f0ba: 2b e0 ldi r18, 0x0B ; 11 f0bc: 82 9f mul r24, r18 f0be: c0 01 movw r24, r0 f0c0: 11 24 eor r1, r1 f0c2: 80 5b subi r24, 0xB0 ; 176 f0c4: 92 4f sbci r25, 0xF2 ; 242 f0c6: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a f0ca: 21 e0 ldi r18, 0x01 ; 1 f0cc: 01 96 adiw r24, 0x01 ; 1 f0ce: 09 f4 brne .+2 ; 0xf0d2 f0d0: 20 e0 ldi r18, 0x00 ; 0 } f0d2: 82 2f mov r24, r18 f0d4: 08 95 ret 0000f0d6 : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { f0d6: cf 93 push r28 f0d8: df 93 push r29 f0da: c8 2f mov r28, r24 f0dc: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; f0de: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; f0e0: c8 30 cpi r28, 0x08 ; 8 f0e2: 0c f0 brlt .+2 ; 0xf0e6 f0e4: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; f0e6: 8c 2f mov r24, r28 f0e8: 0e 94 5d 78 call 0xf0ba ; 0xf0ba f0ec: 81 11 cpse r24, r1 f0ee: 03 c0 rjmp .+6 ; 0xf0f6 f0f0: 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) f0f2: a9 f7 brne .-22 ; 0xf0de { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; f0f4: cf ef ldi r28, 0xFF ; 255 } f0f6: 8c 2f mov r24, r28 f0f8: df 91 pop r29 f0fa: cf 91 pop r28 f0fc: 08 95 ret 0000f0fe : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); f0fe: 81 ea ldi r24, 0xA1 ; 161 f100: 9d e0 ldi r25, 0x0D ; 13 f102: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e sheet = eeprom_next_initialized_sheet(sheet); f106: 0e 94 6b 78 call 0xf0d6 ; 0xf0d6 if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); f10a: 87 fd sbrc r24, 7 f10c: 05 c0 rjmp .+10 ; 0xf118 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f10e: 68 2f mov r22, r24 f110: 81 ea ldi r24, 0xA1 ; 161 f112: 9d e0 ldi r25, 0x0D ; 13 f114: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 { 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); } f118: 08 95 ret 0000f11a : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { f11a: 0f 93 push r16 f11c: 1f 93 push r17 f11e: cf 93 push r28 f120: c8 2f mov r28, r24 f122: 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")); f124: 6e e9 ldi r22, 0x9E ; 158 f126: 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) f128: 82 30 cpi r24, 0x02 ; 2 f12a: 70 f0 brcs .+28 ; 0xf148 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); f12c: 67 e9 ldi r22, 0x97 ; 151 f12e: 7a e7 ldi r23, 0x7A ; 122 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) f130: 84 30 cpi r24, 0x04 ; 4 f132: 50 f0 brcs .+20 ; 0xf148 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); f134: 6f e8 ldi r22, 0x8F ; 143 f136: 7a e7 ldi r23, 0x7A ; 122 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) f138: 84 30 cpi r24, 0x04 ; 4 f13a: 31 f0 breq .+12 ; 0xf148 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); f13c: 67 e8 ldi r22, 0x87 ; 135 f13e: 7a e7 ldi r23, 0x7A ; 122 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) f140: 85 30 cpi r24, 0x05 ; 5 f142: 11 f0 breq .+4 ; 0xf148 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); f144: 60 e8 ldi r22, 0x80 ; 128 f146: 7a e7 ldi r23, 0x7A ; 122 f148: c8 01 movw r24, r16 f14a: 0f 94 c6 da call 0x3b58c ; 0x3b58c } if (index <4 || index >5) f14e: 8c ef ldi r24, 0xFC ; 252 f150: 8c 0f add r24, r28 f152: 82 30 cpi r24, 0x02 ; 2 f154: 28 f0 brcs .+10 ; 0xf160 { sheetName.c[6] = '0' + ((index % 2)+1); f156: c1 70 andi r28, 0x01 ; 1 f158: cf 5c subi r28, 0xCF ; 207 f15a: f8 01 movw r30, r16 f15c: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; f15e: 17 82 std Z+7, r1 ; 0x07 } } f160: cf 91 pop r28 f162: 1f 91 pop r17 f164: 0f 91 pop r16 f166: 08 95 ret 0000f168 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f168: 61 e0 ldi r22, 0x01 ; 1 f16a: 80 ec ldi r24, 0xC0 ; 192 f16c: 9f e0 ldi r25, 0x0F ; 15 f16e: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 f172: 60 e0 ldi r22, 0x00 ; 0 f174: 8f eb ldi r24, 0xBF ; 191 f176: 9f e0 ldi r25, 0x0F ; 15 f178: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 f17c: 60 e0 ldi r22, 0x00 ; 0 f17e: 8e eb ldi r24, 0xBE ; 190 f180: 9f e0 ldi r25, 0x0F ; 15 f182: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 f186: 60 e0 ldi r22, 0x00 ; 0 f188: 8d eb ldi r24, 0xBD ; 189 f18a: 9f e0 ldi r25, 0x0F ; 15 f18c: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 f190: 60 e0 ldi r22, 0x00 ; 0 f192: 8c eb ldi r24, 0xBC ; 188 f194: 9f e0 ldi r25, 0x0F ; 15 f196: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0000f19a : } void print_hex_byte(uint8_t val) { f19a: cf 93 push r28 f19c: c8 2f mov r28, r24 print_hex_nibble(val >> 4); f19e: 82 95 swap r24 f1a0: 8f 70 andi r24, 0x0F ; 15 f1a2: 0e 94 1b 65 call 0xca36 ; 0xca36 print_hex_nibble(val & 15); f1a6: 8c 2f mov r24, r28 f1a8: 8f 70 andi r24, 0x0F ; 15 } f1aa: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); f1ac: 0c 94 1b 65 jmp 0xca36 ; 0xca36 0000f1b0 : // 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) { f1b0: 80 91 7e 10 lds r24, 0x107E ; 0x80107e f1b4: 90 91 7f 10 lds r25, 0x107F ; 0x80107f f1b8: 18 16 cp r1, r24 f1ba: 19 06 cpc r1, r25 f1bc: 0c f0 brlt .+2 ; 0xf1c0 f1be: 43 c0 rjmp .+134 ; 0xf246 SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { f1c0: 01 97 sbiw r24, 0x01 ; 1 f1c2: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f f1c6: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e f1ca: 89 2b or r24, r25 f1cc: a1 f4 brne .+40 ; 0xf1f6 // Empty buffer. if (serial_count == 0) f1ce: 80 91 79 10 lds r24, 0x1079 ; 0x801079 f1d2: 90 91 7a 10 lds r25, 0x107A ; 0x80107a f1d6: 89 2b or r24, r25 f1d8: 21 f4 brne .+8 ; 0xf1e2 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; f1da: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> f1de: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.568> bufindr = bufindw; f1e2: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> f1e6: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> f1ea: 90 93 6e 12 sts 0x126E, r25 ; 0x80126e f1ee: 80 93 6d 12 sts 0x126D, r24 ; 0x80126d SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; f1f2: 81 e0 ldi r24, 0x01 ; 1 f1f4: 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) ; f1f6: 80 91 6d 12 lds r24, 0x126D ; 0x80126d f1fa: 90 91 6e 12 lds r25, 0x126E ; 0x80126e f1fe: 03 96 adiw r24, 0x03 ; 3 f200: fc 01 movw r30, r24 f202: e0 58 subi r30, 0x80 ; 128 f204: ff 4e sbci r31, 0xEF ; 239 f206: 20 81 ld r18, Z f208: 01 96 adiw r24, 0x01 ; 1 f20a: 21 11 cpse r18, r1 f20c: f9 cf rjmp .-14 ; 0xf200 f20e: fc 01 movw r30, r24 f210: e0 58 subi r30, 0x80 ; 128 f212: 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) ; f214: 8d 3e cpi r24, 0xED ; 237 f216: 21 e0 ldi r18, 0x01 ; 1 f218: 92 07 cpc r25, r18 f21a: 40 f4 brcc .+16 ; 0xf22c f21c: 41 91 ld r20, Z+ f21e: 9c 01 movw r18, r24 f220: 2f 5f subi r18, 0xFF ; 255 f222: 3f 4f sbci r19, 0xFF ; 255 f224: 41 11 cpse r20, r1 f226: e1 cf rjmp .-62 ; 0xf1ea f228: c9 01 movw r24, r18 f22a: f4 cf rjmp .-24 ; 0xf214 // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { f22c: e0 e8 ldi r30, 0x80 ; 128 f22e: f0 e1 ldi r31, 0x10 ; 16 f230: 8d 3e cpi r24, 0xED ; 237 f232: 21 e0 ldi r18, 0x01 ; 1 f234: 92 07 cpc r25, r18 f236: c9 f6 brne .-78 ; 0xf1ea f238: cf 01 movw r24, r30 f23a: 80 58 subi r24, 0x80 ; 128 f23c: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; f23e: 21 91 ld r18, Z+ f240: 22 23 and r18, r18 f242: d1 f3 breq .-12 ; 0xf238 f244: d2 cf rjmp .-92 ; 0xf1ea SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; f246: 80 e0 ldi r24, 0x00 ; 0 } f248: 08 95 ret 0000f24a : 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; f24a: 80 91 90 04 lds r24, 0x0490 ; 0x800490 f24e: 90 91 91 04 lds r25, 0x0491 ; 0x800491 f252: 20 91 92 04 lds r18, 0x0492 ; 0x800492 f256: 30 91 93 04 lds r19, 0x0493 ; 0x800493 f25a: 82 1b sub r24, r18 f25c: 93 0b sbc r25, r19 } f25e: 8f 77 andi r24, 0x7F ; 127 f260: 99 27 eor r25, r25 f262: 08 95 ret 0000f264 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; f264: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) f266: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; f268: 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; f26a: db 01 movw r26, r22 f26c: 4d 91 ld r20, X+ f26e: bd 01 movw r22, r26 f270: 40 32 cpi r20, 0x20 ; 32 f272: 49 f0 breq .+18 ; 0xf286 if (i == 8) f274: 28 30 cpi r18, 0x08 ; 8 f276: 11 f4 brne .+4 ; 0xf27c { *pos++='.'; f278: 30 83 st Z, r19 f27a: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; f27c: db 01 movw r26, r22 f27e: 11 97 sbiw r26, 0x01 ; 1 f280: 4c 91 ld r20, X f282: 40 83 st Z, r20 f284: 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++) f286: 2f 5f subi r18, 0xFF ; 255 f288: 2b 30 cpi r18, 0x0B ; 11 f28a: 79 f7 brne .-34 ; 0xf26a { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; f28c: 10 82 st Z, r1 return buffer; } f28e: 08 95 ret 0000f290 : 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);} f290: 40 e0 ldi r20, 0x00 ; 0 f292: 50 e0 ldi r21, 0x00 ; 0 f294: ba 01 movw r22, r20 f296: 0d 94 2a 6d jmp 0x2da54 ; 0x2da54 0000f29a : 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();} f29a: fc 01 movw r30, r24 f29c: 23 81 ldd r18, Z+3 ; 0x03 f29e: 21 11 cpse r18, r1 f2a0: 0d 94 f2 a3 jmp 0x347e4 ; 0x347e4 f2a4: 08 95 ret 0000f2a6 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) f2a6: 90 91 1e 05 lds r25, 0x051E ; 0x80051e f2aa: 91 11 cpse r25, r1 f2ac: 07 c0 rjmp .+14 ; 0xf2bc { while (!((M_UCSRxA) & (1 << M_UDREx))); f2ae: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> f2b2: 95 ff sbrs r25, 5 f2b4: fc cf rjmp .-8 ; 0xf2ae M_UDRx = c; f2b6: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> f2ba: 08 95 ret } else if (selectedSerialPort == 1) f2bc: 91 30 cpi r25, 0x01 ; 1 f2be: 31 f4 brne .+12 ; 0xf2cc { while (!((UCSR1A) & (1 << UDRE1))); f2c0: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> f2c4: 95 ff sbrs r25, 5 f2c6: fc cf rjmp .-8 ; 0xf2c0 UDR1 = c; f2c8: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } f2cc: 08 95 ret 0000f2ce : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); f2ce: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 return 0; } f2d2: 90 e0 ldi r25, 0x00 ; 0 f2d4: 80 e0 ldi r24, 0x00 ; 0 f2d6: 08 95 ret 0000f2d8 : 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) { f2d8: cf 93 push r28 f2da: df 93 push r29 f2dc: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { f2de: fe 01 movw r30, r28 f2e0: 84 91 lpm r24, Z f2e2: 88 23 and r24, r24 f2e4: 21 f0 breq .+8 ; 0xf2ee MYSERIAL.write((char)ch); f2e6: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 ++str; f2ea: 21 96 adiw r28, 0x01 ; 1 f2ec: f8 cf rjmp .-16 ; 0xf2de } } f2ee: df 91 pop r29 f2f0: cf 91 pop r28 f2f2: 08 95 ret 0000f2f4 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { f2f4: cf 92 push r12 f2f6: df 92 push r13 f2f8: ef 92 push r14 f2fa: 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]; f2fc: c0 90 5e 0e lds r12, 0x0E5E ; 0x800e5e f300: d0 90 5f 0e lds r13, 0x0E5F ; 0x800e5f f304: e0 90 60 0e lds r14, 0x0E60 ; 0x800e60 f308: f0 90 61 0e lds r15, 0x0E61 ; 0x800e61 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); f30c: 87 e1 ldi r24, 0x17 ; 23 f30e: 90 e8 ldi r25, 0x80 ; 128 f310: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f314: 42 e0 ldi r20, 0x02 ; 2 f316: c7 01 movw r24, r14 f318: b6 01 movw r22, r12 f31a: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); f31e: 8f e0 ldi r24, 0x0F ; 15 f320: 90 e8 ldi r25, 0x80 ; 128 f322: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f326: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee f32a: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef f32e: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 f332: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 f336: 41 e0 ldi r20, 0x01 ; 1 f338: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } f33c: ff 90 pop r15 f33e: ef 90 pop r14 f340: df 90 pop r13 f342: 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(); f344: 0d 94 11 d6 jmp 0x3ac22 ; 0x3ac22 0000f348 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { f348: 4f 92 push r4 f34a: 5f 92 push r5 f34c: 6f 92 push r6 f34e: 7f 92 push r7 f350: 8f 92 push r8 f352: 9f 92 push r9 f354: af 92 push r10 f356: bf 92 push r11 f358: cf 92 push r12 f35a: df 92 push r13 f35c: ef 92 push r14 f35e: ff 92 push r15 f360: 0f 93 push r16 f362: 1f 93 push r17 f364: cf 93 push r28 f366: df 93 push r29 f368: cc 24 eor r12, r12 f36a: ca 94 dec r12 f36c: dc 2c mov r13, r12 f36e: 76 01 movw r14, r12 f370: 0e ea ldi r16, 0xAE ; 174 f372: 1f e0 ldi r17, 0x0F ; 15 f374: 93 e2 ldi r25, 0x23 ; 35 f376: 89 2e mov r8, r25 f378: 91 2c mov r9, r1 f37a: a1 2c mov r10, r1 f37c: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; f37e: 41 2c mov r4, r1 f380: 51 2c mov r5, r1 f382: 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; f384: d0 e0 ldi r29, 0x00 ; 0 f386: 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) { f388: 8f ef ldi r24, 0xFF ; 255 f38a: c8 16 cp r12, r24 f38c: 09 f4 brne .+2 ; 0xf390 f38e: 5d c0 rjmp .+186 ; 0xf44a usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); f390: c8 01 movw r24, r16 f392: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a f396: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; f398: bc 01 movw r22, r24 f39a: 99 0f add r25, r25 f39c: 88 0b sbc r24, r24 f39e: 99 0b sbc r25, r25 f3a0: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f3a4: 20 91 77 06 lds r18, 0x0677 ; 0x800677 f3a8: 30 91 78 06 lds r19, 0x0678 ; 0x800678 f3ac: 40 91 79 06 lds r20, 0x0679 ; 0x800679 f3b0: 50 91 7a 06 lds r21, 0x067A ; 0x80067a f3b4: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> f3b8: 2b 01 movw r4, r22 f3ba: 3c 01 movw r6, r24 f3bc: c7 01 movw r24, r14 f3be: b6 01 movw r22, r12 f3c0: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); f3c4: 89 e0 ldi r24, 0x09 ; 9 f3c6: 9f e7 ldi r25, 0x7F ; 127 f3c8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f3cc: c5 01 movw r24, r10 f3ce: b4 01 movw r22, r8 f3d0: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); f3d4: 89 e0 ldi r24, 0x09 ; 9 f3d6: 9f e7 ldi r25, 0x7F ; 127 f3d8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f3dc: be 01 movw r22, r28 f3de: 0d 2e mov r0, r29 f3e0: 00 0c add r0, r0 f3e2: 88 0b sbc r24, r24 f3e4: 99 0b sbc r25, r25 f3e6: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); f3ea: 89 e0 ldi r24, 0x09 ; 9 f3ec: 9f e7 ldi r25, 0x7F ; 127 f3ee: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLLN(mm * 1000); f3f2: 20 e0 ldi r18, 0x00 ; 0 f3f4: 30 e0 ldi r19, 0x00 ; 0 f3f6: 4a e7 ldi r20, 0x7A ; 122 f3f8: 54 e4 ldi r21, 0x44 ; 68 f3fa: c3 01 movw r24, r6 f3fc: b2 01 movw r22, r4 f3fe: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> f402: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 f406: 85 e0 ldi r24, 0x05 ; 5 f408: 88 0e add r8, r24 f40a: 91 1c adc r9, r1 f40c: a1 1c adc r10, r1 f40e: b1 1c adc r11, r1 f410: 0e 5f subi r16, 0xFE ; 254 f412: 1f 4f sbci r17, 0xFF ; 255 f414: 8f ef ldi r24, 0xFF ; 255 f416: c8 1a sub r12, r24 f418: d8 0a sbc r13, r24 f41a: e8 0a sbc r14, r24 f41c: 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++) { f41e: 0a 3b cpi r16, 0xBA ; 186 f420: 8f e0 ldi r24, 0x0F ; 15 f422: 18 07 cpc r17, r24 f424: 09 f0 breq .+2 ; 0xf428 f426: b0 cf rjmp .-160 ; 0xf388 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f428: df 91 pop r29 f42a: cf 91 pop r28 f42c: 1f 91 pop r17 f42e: 0f 91 pop r16 f430: ff 90 pop r15 f432: ef 90 pop r14 f434: df 90 pop r13 f436: cf 90 pop r12 f438: bf 90 pop r11 f43a: af 90 pop r10 f43c: 9f 90 pop r9 f43e: 8f 90 pop r8 f440: 7f 90 pop r7 f442: 6f 90 pop r6 f444: 5f 90 pop r5 f446: 4f 90 pop r4 f448: 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); f44a: 8c e4 ldi r24, 0x4C ; 76 f44c: 9d e3 ldi r25, 0x3D ; 61 f44e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f452: b8 cf rjmp .-144 ; 0xf3c4 0000f454 : /// @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) { f454: 88 23 and r24, r24 f456: 71 f1 breq .+92 ; 0xf4b4 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f458: 8d ef ldi r24, 0xFD ; 253 f45a: 9e e7 ldi r25, 0x7E ; 126 f45c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f460: 60 91 24 13 lds r22, 0x1324 ; 0x801324 f464: 70 e0 ldi r23, 0x00 ; 0 f466: 90 e0 ldi r25, 0x00 ; 0 f468: 80 e0 ldi r24, 0x00 ; 0 f46a: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; f46e: 80 91 24 13 lds r24, 0x1324 ; 0x801324 f472: 84 30 cpi r24, 0x04 ; 4 f474: d8 f0 brcs .+54 ; 0xf4ac f476: 10 92 24 13 sts 0x1324, r1 ; 0x801324 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f47a: 88 ef ldi r24, 0xF8 ; 248 f47c: 9e e7 ldi r25, 0x7E ; 126 f47e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN((int)currentMMUSlot); f482: 80 91 24 13 lds r24, 0x1324 ; 0x801324 f486: 90 e0 ldi r25, 0x00 ; 0 f488: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 return currentMMUSlot; f48c: 80 91 24 13 lds r24, 0x1324 ; 0x801324 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; f490: 20 91 aa 05 lds r18, 0x05AA ; 0x8005aa f494: 30 91 ab 05 lds r19, 0x05AB ; 0x8005ab f498: 30 93 6b 0e sts 0x0E6B, r19 ; 0x800e6b f49c: 20 93 6a 0e sts 0x0E6A, r18 ; 0x800e6a slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); f4a0: 0f 94 02 1c call 0x23804 ; 0x23804 load_filament_final_feed(); // @@TODO verify f4a4: 0e 94 d9 65 call 0xcbb2 ; 0xcbb2 st_synchronize(); f4a8: 0d 94 db 57 jmp 0x2afb6 ; 0x2afb6 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; f4ac: 8f 5f subi r24, 0xFF ; 255 f4ae: 80 93 24 13 sts 0x1324, r24 ; 0x801324 f4b2: e3 cf rjmp .-58 ; 0xf47a 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); f4b4: 84 e7 ldi r24, 0x74 ; 116 f4b6: 9f e3 ldi r25, 0x3F ; 63 f4b8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 f4bc: 70 e0 ldi r23, 0x00 ; 0 f4be: 60 e0 ldi r22, 0x00 ; 0 f4c0: 0e 94 ed d8 call 0x1b1da ; 0x1b1da f4c4: e5 cf rjmp .-54 ; 0xf490 0000f4c6 : return final_result; } void gcode_M114() { f4c6: cf 93 push r28 f4c8: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f4ca: 85 ef ldi r24, 0xF5 ; 245 f4cc: 9e e7 ldi r25, 0x7E ; 126 f4ce: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOL(current_position[X_AXIS]); f4d2: c0 e4 ldi r28, 0x40 ; 64 f4d4: d7 e0 ldi r29, 0x07 ; 7 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f4d6: 68 81 ld r22, Y f4d8: 79 81 ldd r23, Y+1 ; 0x01 f4da: 8a 81 ldd r24, Y+2 ; 0x02 f4dc: 9b 81 ldd r25, Y+3 ; 0x03 f4de: 42 e0 ldi r20, 0x02 ; 2 f4e0: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOLPGM(" Y:"); f4e4: 81 ef ldi r24, 0xF1 ; 241 f4e6: 9e e7 ldi r25, 0x7E ; 126 f4e8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f4ec: 6c 81 ldd r22, Y+4 ; 0x04 f4ee: 7d 81 ldd r23, Y+5 ; 0x05 f4f0: 8e 81 ldd r24, Y+6 ; 0x06 f4f2: 9f 81 ldd r25, Y+7 ; 0x07 f4f4: 42 e0 ldi r20, 0x02 ; 2 f4f6: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f4fa: 8d ee ldi r24, 0xED ; 237 f4fc: 9e e7 ldi r25, 0x7E ; 126 f4fe: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f502: 68 85 ldd r22, Y+8 ; 0x08 f504: 79 85 ldd r23, Y+9 ; 0x09 f506: 8a 85 ldd r24, Y+10 ; 0x0a f508: 9b 85 ldd r25, Y+11 ; 0x0b f50a: 42 e0 ldi r20, 0x02 ; 2 f50c: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f510: 89 ee ldi r24, 0xE9 ; 233 f512: 9e e7 ldi r25, 0x7E ; 126 f514: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f518: 6c 85 ldd r22, Y+12 ; 0x0c f51a: 7d 85 ldd r23, Y+13 ; 0x0d f51c: 8e 85 ldd r24, Y+14 ; 0x0e f51e: 9f 85 ldd r25, Y+15 ; 0x0f f520: 42 e0 ldi r20, 0x02 ; 2 f522: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f526: 83 eb ldi r24, 0xB3 ; 179 f528: 97 e6 ldi r25, 0x67 ; 103 f52a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f52e: 80 e0 ldi r24, 0x00 ; 0 f530: 0f 94 b9 57 call 0x2af72 ; 0x2af72 f534: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f538: cb e6 ldi r28, 0x6B ; 107 f53a: d6 e0 ldi r29, 0x06 ; 6 f53c: 2c 81 ldd r18, Y+4 ; 0x04 f53e: 3d 81 ldd r19, Y+5 ; 0x05 f540: 4e 81 ldd r20, Y+6 ; 0x06 f542: 5f 81 ldd r21, Y+7 ; 0x07 f544: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> f548: 42 e0 ldi r20, 0x02 ; 2 f54a: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOLPGM(" Y:"); f54e: 85 ee ldi r24, 0xE5 ; 229 f550: 9e e7 ldi r25, 0x7E ; 126 f552: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f556: 81 e0 ldi r24, 0x01 ; 1 f558: 0f 94 b9 57 call 0x2af72 ; 0x2af72 f55c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f560: 28 85 ldd r18, Y+8 ; 0x08 f562: 39 85 ldd r19, Y+9 ; 0x09 f564: 4a 85 ldd r20, Y+10 ; 0x0a f566: 5b 85 ldd r21, Y+11 ; 0x0b f568: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> f56c: 42 e0 ldi r20, 0x02 ; 2 f56e: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOLPGM(" Z:"); f572: 81 ee ldi r24, 0xE1 ; 225 f574: 9e e7 ldi r25, 0x7E ; 126 f576: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f57a: 82 e0 ldi r24, 0x02 ; 2 f57c: 0f 94 b9 57 call 0x2af72 ; 0x2af72 f580: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f584: 2c 85 ldd r18, Y+12 ; 0x0c f586: 3d 85 ldd r19, Y+13 ; 0x0d f588: 4e 85 ldd r20, Y+14 ; 0x0e f58a: 5f 85 ldd r21, Y+15 ; 0x0f f58c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> f590: 42 e0 ldi r20, 0x02 ; 2 f592: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOLPGM(" E:"); f596: 8d ed ldi r24, 0xDD ; 221 f598: 9e e7 ldi r25, 0x7E ; 126 f59a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f59e: 83 e0 ldi r24, 0x03 ; 3 f5a0: 0f 94 b9 57 call 0x2af72 ; 0x2af72 f5a4: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f5a8: 28 89 ldd r18, Y+16 ; 0x10 f5aa: 39 89 ldd r19, Y+17 ; 0x11 f5ac: 4a 89 ldd r20, Y+18 ; 0x12 f5ae: 5b 89 ldd r21, Y+19 ; 0x13 f5b0: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> } f5b4: df 91 pop r29 f5b6: 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]); f5b8: 0d 94 53 75 jmp 0x2eaa6 ; 0x2eaa6 0000f5bc : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f5bc: 8c ee ldi r24, 0xEC ; 236 f5be: 9d e7 ldi r25, 0x7D ; 125 f5c0: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f5c4: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e f5c8: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f f5cc: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 f5d0: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 f5d4: 41 e0 ldi r20, 0x01 ; 1 f5d6: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f5da: 89 ee ldi r24, 0xE9 ; 233 f5dc: 9d e7 ldi r25, 0x7D ; 125 f5de: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f5e2: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a f5e6: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b f5ea: 07 2e mov r0, r23 f5ec: 00 0c add r0, r0 f5ee: 88 0b sbc r24, r24 f5f0: 99 0b sbc r25, r25 f5f2: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f5f6: 41 e0 ldi r20, 0x01 ; 1 f5f8: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f5fc: 85 ee ldi r24, 0xE5 ; 229 f5fe: 9d e7 ldi r25, 0x7D ; 125 f600: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f604: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee f608: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef f60c: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 f610: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 f614: 41 e0 ldi r20, 0x01 ; 1 f616: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f61a: 82 ee ldi r24, 0xE2 ; 226 f61c: 9d e7 ldi r25, 0x7D ; 125 f61e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f622: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 f626: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 f62a: 07 2e mov r0, r23 f62c: 00 0c add r0, r0 f62e: 88 0b sbc r24, r24 f630: 99 0b sbc r25, r25 f632: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f636: 41 e0 ldi r20, 0x01 ; 1 f638: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f63c: 8d ed ldi r24, 0xDD ; 221 f63e: 9d e7 ldi r25, 0x7D ; 125 f640: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f644: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e f648: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f f64c: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 f650: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 f654: 41 e0 ldi r20, 0x01 ; 1 f656: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f65a: 8a ed ldi r24, 0xDA ; 218 f65c: 9d e7 ldi r25, 0x7D ; 125 f65e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f662: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a f666: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b f66a: 07 2e mov r0, r23 f66c: 00 0c add r0, r0 f66e: 88 0b sbc r24, r24 f670: 99 0b sbc r25, r25 f672: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f676: 41 e0 ldi r20, 0x01 ; 1 f678: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f67c: 86 ed ldi r24, 0xD6 ; 214 f67e: 9d e7 ldi r25, 0x7D ; 125 f680: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f684: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> f688: 70 e0 ldi r23, 0x00 ; 0 f68a: 90 e0 ldi r25, 0x00 ; 0 f68c: 80 e0 ldi r24, 0x00 ; 0 f68e: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f692: 81 ed ldi r24, 0xD1 ; 209 f694: 9d e7 ldi r25, 0x7D ; 125 f696: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f69a: 60 91 17 06 lds r22, 0x0617 ; 0x800617 f69e: 70 e0 ldi r23, 0x00 ; 0 f6a0: 90 e0 ldi r25, 0x00 ; 0 f6a2: 80 e0 ldi r24, 0x00 ; 0 f6a4: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f6a8: 8d ec ldi r24, 0xCD ; 205 f6aa: 9d e7 ldi r25, 0x7D ; 125 f6ac: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f6b0: 60 91 95 03 lds r22, 0x0395 ; 0x800395 f6b4: 70 91 96 03 lds r23, 0x0396 ; 0x800396 f6b8: 80 91 97 03 lds r24, 0x0397 ; 0x800397 f6bc: 90 91 98 03 lds r25, 0x0398 ; 0x800398 f6c0: 41 e0 ldi r20, 0x01 ; 1 f6c2: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f6c6: 89 ec ldi r24, 0xC9 ; 201 f6c8: 9d e7 ldi r25, 0x7D ; 125 f6ca: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 f6ce: 60 91 50 06 lds r22, 0x0650 ; 0x800650 f6d2: 70 91 51 06 lds r23, 0x0651 ; 0x800651 f6d6: 80 91 52 06 lds r24, 0x0652 ; 0x800652 f6da: 90 91 53 06 lds r25, 0x0653 ; 0x800653 f6de: 41 e0 ldi r20, 0x01 ; 1 f6e0: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f6e4: 0d 94 11 d6 jmp 0x3ac22 ; 0x3ac22 0000f6e8 : } } 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); } f6e8: 20 91 63 14 lds r18, 0x1463 ; 0x801463 f6ec: 30 e0 ldi r19, 0x00 ; 0 f6ee: a8 ee ldi r26, 0xE8 ; 232 f6f0: b3 e0 ldi r27, 0x03 ; 3 f6f2: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> f6f6: ab 01 movw r20, r22 f6f8: bc 01 movw r22, r24 f6fa: 84 e6 ldi r24, 0x64 ; 100 f6fc: 94 e1 ldi r25, 0x14 ; 20 f6fe: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f702: 88 23 and r24, r24 f704: 99 f0 breq .+38 ; 0xf72c f706: 80 91 62 14 lds r24, 0x1462 ; 0x801462 { if(autoReportFeatures.Temp()){ f70a: 80 fd sbrc r24, 0 gcode_M105(); f70c: 0e 94 de 7a call 0xf5bc ; 0xf5bc f710: 80 91 62 14 lds r24, 0x1462 ; 0x801462 } if(autoReportFeatures.Pos()){ f714: 82 fd sbrc r24, 2 gcode_M114(); f716: 0e 94 63 7a call 0xf4c6 ; 0xf4c6 f71a: 80 91 62 14 lds r24, 0x1462 ; 0x801462 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f71e: 81 fd sbrc r24, 1 gcode_M123(); f720: 0e 94 ca 67 call 0xcf94 ; 0xcf94 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f724: 84 e6 ldi r24, 0x64 ; 100 f726: 94 e1 ldi r25, 0x14 ; 20 f728: 0d 94 f8 40 jmp 0x281f0 ; 0x281f0 ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f72c: 08 95 ret 0000f72e : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f72e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 MYSERIAL.println(); f732: 0d 94 11 d6 jmp 0x3ac22 ; 0x3ac22 0000f736 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f736: 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))); f738: 81 ea ldi r24, 0xA1 ; 161 f73a: 9d e0 ldi r25, 0x0D ; 13 f73c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f740: cb e0 ldi r28, 0x0B ; 11 f742: 8c 9f mul r24, r28 f744: c0 01 movw r24, r0 f746: 11 24 eor r1, r1 f748: 80 5b subi r24, 0xB0 ; 176 f74a: 92 4f sbci r25, 0xF2 ; 242 f74c: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f750: 81 56 subi r24, 0x61 ; 97 f752: 90 4f sbci r25, 0xF0 ; 240 f754: 80 3a cpi r24, 0xA0 ; 160 f756: 9f 40 sbci r25, 0x0F ; 15 f758: c8 f0 brcs .+50 ; 0xf78c 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"); f75a: 86 ee ldi r24, 0xE6 ; 230 f75c: 9f e7 ldi r25, 0x7F ; 127 f75e: 0e 94 97 7b call 0xf72e ; 0xf72e eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f762: 81 ea ldi r24, 0xA1 ; 161 f764: 9d e0 ldi r25, 0x0D ; 13 f766: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 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-> f76a: 8c 9f mul r24, r28 f76c: c0 01 movw r24, r0 f76e: 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); f770: 70 e0 ldi r23, 0x00 ; 0 f772: 60 e0 ldi r22, 0x00 ; 0 f774: 80 5b subi r24, 0xB0 ; 176 f776: 92 4f sbci r25, 0xF2 ; 242 f778: 0f 94 6d dd call 0x3bada ; 0x3bada 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.")); f77c: 89 ea ldi r24, 0xA9 ; 169 f77e: 9f e7 ldi r25, 0x7F ; 127 f780: 0f 94 d6 34 call 0x269ac ; 0x269ac lcd_update_enable(true); f784: 81 e0 ldi r24, 0x01 ; 1 } } f786: 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); f788: 0c 94 6b 70 jmp 0xe0d6 ; 0xe0d6 } } f78c: cf 91 pop r28 f78e: 08 95 ret 0000f790 : // 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) { f790: ff 92 push r15 f792: 0f 93 push r16 f794: 1f 93 push r17 f796: cf 93 push r28 f798: df 93 push r29 if(Stopped == false) { f79a: 90 91 11 05 lds r25, 0x0511 ; 0x800511 f79e: 91 11 cpse r25, r1 f7a0: 4f c0 rjmp .+158 ; 0xf840 f7a2: c8 2f mov r28, r24 Stopped = true; f7a4: 81 e0 ldi r24, 0x01 ; 1 f7a6: 80 93 11 05 sts 0x0511, r24 ; 0x800511 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f7aa: cc 23 and r28, r28 f7ac: 11 f1 breq .+68 ; 0xf7f2 f7ae: 0e 94 d6 68 call 0xd1ac ; 0xd1ac f7b2: 88 23 and r24, r24 f7b4: f1 f0 breq .+60 ; 0xf7f2 if (!printingIsPaused()) { f7b6: 0e 94 cb 68 call 0xd196 ; 0xd196 f7ba: 81 11 cpse r24, r1 f7bc: 22 c0 rjmp .+68 ; 0xf802 lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f7be: 81 ea ldi r24, 0xA1 ; 161 f7c0: 96 e3 ldi r25, 0x36 ; 54 f7c2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 f7c6: 63 e0 ldi r22, 0x03 ; 3 f7c8: 0f 94 bd 05 call 0x20b7a ; 0x20b7a // 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; f7cc: f0 90 ac 05 lds r15, 0x05AC ; 0x8005ac uint16_t ext_temp = saved_extruder_temperature; f7d0: 00 91 aa 05 lds r16, 0x05AA ; 0x8005aa f7d4: 10 91 ab 05 lds r17, 0x05AB ; 0x8005ab uint8_t fan_speed = saved_fan_speed; f7d8: d0 91 a9 05 lds r29, 0x05A9 ; 0x8005a9 lcd_pause_print(); f7dc: 0f 94 61 3e call 0x27cc2 ; 0x27cc2 saved_bed_temperature = bed_temp; f7e0: f0 92 ac 05 sts 0x05AC, r15 ; 0x8005ac saved_extruder_temperature = ext_temp; f7e4: 10 93 ab 05 sts 0x05AB, r17 ; 0x8005ab f7e8: 00 93 aa 05 sts 0x05AA, r16 ; 0x8005aa saved_fan_speed = fan_speed; f7ec: d0 93 a9 05 sts 0x05A9, r29 ; 0x8005a9 f7f0: 08 c0 rjmp .+16 ; 0xf802 } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f7f2: 61 e0 ldi r22, 0x01 ; 1 f7f4: 80 e0 ldi r24, 0x00 ; 0 f7f6: 0f 94 e1 14 call 0x229c2 ; 0x229c2 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f7fa: 8c ee ldi r24, 0xEC ; 236 f7fc: 9a ea ldi r25, 0xAA ; 170 f7fe: cc 23 and r28, r28 f800: 11 f0 breq .+4 ; 0xf806 f802: 84 e1 ldi r24, 0x14 ; 20 f804: 9b ea ldi r25, 0xAB ; 171 f806: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f80a: 8c e2 ldi r24, 0x2C ; 44 f80c: 98 e6 ldi r25, 0x68 ; 104 f80e: 0e 94 97 7b call 0xf72e ; 0xf72e // 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)); f812: 86 e9 ldi r24, 0x96 ; 150 f814: 96 e3 ldi r25, 0x36 ; 54 f816: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 f81a: 0f 94 e0 0a call 0x215c0 ; 0x215c0 // 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); f81e: 9f b7 in r25, 0x3f ; 63 f820: f8 94 cli f822: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f826: 84 60 ori r24, 0x04 ; 4 f828: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f82c: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f82e: 0f 94 1d 26 call 0x24c3a ; 0x24c3a if(!allow_recovery) { f832: c1 11 cpse r28, r1 f834: 05 c0 rjmp .+10 ; 0xf840 // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f836: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce f83a: 81 60 ori r24, 0x01 ; 1 f83c: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce } } } f840: df 91 pop r29 f842: cf 91 pop r28 f844: 1f 91 pop r17 f846: 0f 91 pop r16 f848: ff 90 pop r15 f84a: 08 95 ret 0000f84c : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f84c: ec 01 movw r28, r24 cli(); // Stop interrupts f84e: f8 94 cli disable_heater(); f850: 0f 94 21 44 call 0x28842 ; 0x28842 disable_x(); f854: 17 9a sbi 0x02, 7 ; 2 f856: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); f85a: 16 9a sbi 0x02, 6 ; 2 f85c: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e poweroff_z(); disable_e0(); f860: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f862: 8c ee ldi r24, 0xEC ; 236 f864: 9a ea ldi r25, 0xAA ; 170 f866: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f86a: 8a e8 ldi r24, 0x8A ; 138 f86c: 9f e7 ldi r25, 0x7F ; 127 f86e: 0e 94 97 7b call 0xf72e ; 0xf72e if (full_screen_message != NULL) { f872: 20 97 sbiw r28, 0x00 ; 0 f874: 79 f0 breq .+30 ; 0xf894 SERIAL_ERRORLNRPGM(full_screen_message); f876: ce 01 movw r24, r28 f878: 0e 94 97 7b call 0xf72e ; 0xf72e f87c: be 01 movw r22, r28 f87e: 85 e9 ldi r24, 0x95 ; 149 f880: 9c e0 ldi r25, 0x0C ; 12 f882: 0f 94 6d dd call 0x3bada ; 0x3bada 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); f886: 62 e4 ldi r22, 0x42 ; 66 f888: 84 e9 ldi r24, 0x94 ; 148 f88a: 9c e0 ldi r25, 0x0C ; 12 f88c: 0f 94 57 dd call 0x3baae ; 0x3baae // 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(); f890: 0e 94 92 68 call 0xd124 ; 0xd124 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f894: c2 e8 ldi r28, 0x82 ; 130 f896: df e7 ldi r29, 0x7F ; 127 f898: f1 cf rjmp .-30 ; 0xf87c 0000f89a : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f89a: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f89e: 86 fd sbrc r24, 6 f8a0: 35 c0 rjmp .+106 ; 0xf90c FORCE_HIGH_POWER_END; f8a2: 80 e0 ldi r24, 0x00 ; 0 f8a4: 0e 94 f6 67 call 0xcfec ; 0xcfec current_position[Z_AXIS] = 0; f8a8: 10 92 48 07 sts 0x0748, r1 ; 0x800748 f8ac: 10 92 49 07 sts 0x0749, r1 ; 0x800749 f8b0: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a f8b4: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b plan_set_position_curposXYZE(); f8b8: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f8bc: 20 e0 ldi r18, 0x00 ; 0 f8be: 30 e0 ldi r19, 0x00 ; 0 f8c0: 40 ea ldi r20, 0xA0 ; 160 f8c2: 50 e4 ldi r21, 0x40 ; 64 f8c4: 60 91 48 07 lds r22, 0x0748 ; 0x800748 f8c8: 70 91 49 07 lds r23, 0x0749 ; 0x800749 f8cc: 80 91 4a 07 lds r24, 0x074A ; 0x80074a f8d0: 90 91 4b 07 lds r25, 0x074B ; 0x80074b f8d4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> f8d8: 60 93 48 07 sts 0x0748, r22 ; 0x800748 f8dc: 70 93 49 07 sts 0x0749, r23 ; 0x800749 f8e0: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a f8e4: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f8e8: e0 91 99 02 lds r30, 0x0299 ; 0x800299 f8ec: f0 91 9a 02 lds r31, 0x029A ; 0x80029a f8f0: 60 85 ldd r22, Z+8 ; 0x08 f8f2: 71 85 ldd r23, Z+9 ; 0x09 f8f4: 82 85 ldd r24, Z+10 ; 0x0a f8f6: 93 85 ldd r25, Z+11 ; 0x0b f8f8: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); f8fc: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f900: 8c eb ldi r24, 0xBC ; 188 f902: 95 e6 ldi r25, 0x65 ; 101 f904: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 f908: 0e 94 26 7c call 0xf84c ; 0xf84c } } f90c: 08 95 ret 0000f90e : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f90e: 2f 92 push r2 f910: 3f 92 push r3 f912: 4f 92 push r4 f914: 5f 92 push r5 f916: 6f 92 push r6 f918: 7f 92 push r7 f91a: 8f 92 push r8 f91c: 9f 92 push r9 f91e: af 92 push r10 f920: bf 92 push r11 f922: cf 92 push r12 f924: df 92 push r13 f926: ef 92 push r14 f928: ff 92 push r15 f92a: 0f 93 push r16 f92c: 1f 93 push r17 f92e: cf 93 push r28 f930: df 93 push r29 f932: cd b7 in r28, 0x3d ; 61 f934: de b7 in r29, 0x3e ; 62 f936: 60 97 sbiw r28, 0x10 ; 16 f938: 0f b6 in r0, 0x3f ; 63 f93a: f8 94 cli f93c: de bf out 0x3e, r29 ; 62 f93e: 0f be out 0x3f, r0 ; 63 f940: cd bf out 0x3d, r28 ; 61 f942: 28 2e mov r2, r24 f944: 6e 87 std Y+14, r22 ; 0x0e f946: 5a 87 std Y+10, r21 ; 0x0a f948: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f94a: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> f94e: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f950: 77 24 eor r7, r7 f952: 73 94 inc r7 f954: 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) f958: 42 e0 ldi r20, 0x02 ; 2 f95a: 84 17 cp r24, r20 f95c: 09 f4 brne .+2 ; 0xf960 f95e: d4 c1 rjmp .+936 ; 0xfd08 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); f960: 08 2f mov r16, r24 f962: 10 e0 ldi r17, 0x00 ; 0 f964: f8 01 movw r30, r16 f966: ea 53 subi r30, 0x3A ; 58 f968: 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); f96a: 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); f96c: 83 2d mov r24, r3 f96e: 03 2c mov r0, r3 f970: 00 0c add r0, r0 f972: 99 0b sbc r25, r25 f974: 9c 87 std Y+12, r25 ; 0x0c f976: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f978: d8 01 movw r26, r16 f97a: aa 0f add r26, r26 f97c: bb 1f adc r27, r27 f97e: aa 0f add r26, r26 f980: bb 1f adc r27, r27 f982: ba 83 std Y+2, r27 ; 0x02 f984: a9 83 std Y+1, r26 ; 0x01 f986: fd 01 movw r30, r26 f988: e3 53 subi r30, 0x33 ; 51 f98a: fd 4f sbci r31, 0xFD ; 253 f98c: 80 81 ld r24, Z f98e: 91 81 ldd r25, Z+1 ; 0x01 f990: a2 81 ldd r26, Z+2 ; 0x02 f992: b3 81 ldd r27, Z+3 ; 0x03 f994: 8b 83 std Y+3, r24 ; 0x03 f996: 9c 83 std Y+4, r25 ; 0x04 f998: ad 83 std Y+5, r26 ; 0x05 f99a: be 83 std Y+6, r27 ; 0x06 f99c: 80 93 90 02 sts 0x0290, r24 ; 0x800290 f9a0: 90 93 91 02 sts 0x0291, r25 ; 0x800291 f9a4: a0 93 92 02 sts 0x0292, r26 ; 0x800292 f9a8: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); f9ac: bc 01 movw r22, r24 f9ae: cd 01 movw r24, r26 f9b0: 0e 94 0d 68 call 0xd01a ; 0xd01a f9b4: 6b 01 movw r12, r22 f9b6: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f9b8: 81 e0 ldi r24, 0x01 ; 1 f9ba: 02 2c mov r0, r2 f9bc: 01 c0 rjmp .+2 ; 0xf9c0 f9be: 88 0f add r24, r24 f9c0: 0a 94 dec r0 f9c2: ea f7 brpl .-6 ; 0xf9be f9c4: 0f 94 5d 3a call 0x274ba ; 0x274ba // 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; f9c8: a9 81 ldd r26, Y+1 ; 0x01 f9ca: ba 81 ldd r27, Y+2 ; 0x02 f9cc: a0 5c subi r26, 0xC0 ; 192 f9ce: b8 4f sbci r27, 0xF8 ; 248 f9d0: b8 87 std Y+8, r27 ; 0x08 f9d2: af 83 std Y+7, r26 ; 0x07 f9d4: fd 01 movw r30, r26 f9d6: 10 82 st Z, r1 f9d8: 11 82 std Z+1, r1 ; 0x01 f9da: 12 82 std Z+2, r1 ; 0x02 f9dc: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f9de: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 set_destination_to_current(); f9e2: 0e 94 80 69 call 0xd300 ; 0xd300 // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f9e6: 63 2d mov r22, r3 f9e8: 03 2c mov r0, r3 f9ea: 00 0c add r0, r0 f9ec: 77 0b sbc r23, r23 f9ee: 88 0b sbc r24, r24 f9f0: 99 0b sbc r25, r25 f9f2: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> f9f6: 4b 01 movw r8, r22 f9f8: 5c 01 movw r10, r24 f9fa: 49 81 ldd r20, Y+1 ; 0x01 f9fc: 5a 81 ldd r21, Y+2 ; 0x02 f9fe: 4f 5a subi r20, 0xAF ; 175 fa00: 5a 4f sbci r21, 0xFA ; 250 fa02: 58 8b std Y+16, r21 ; 0x10 fa04: 4f 87 std Y+15, r20 ; 0x0f fa06: 20 e0 ldi r18, 0x00 ; 0 fa08: 30 e0 ldi r19, 0x00 ; 0 fa0a: 40 e4 ldi r20, 0x40 ; 64 fa0c: 50 ec ldi r21, 0xC0 ; 192 fa0e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fa12: af 85 ldd r26, Y+15 ; 0x0f fa14: b8 89 ldd r27, Y+16 ; 0x10 fa16: 6d 93 st X+, r22 fa18: 7d 93 st X+, r23 fa1a: 8d 93 st X+, r24 fa1c: 9c 93 st X, r25 fa1e: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); fa20: c7 01 movw r24, r14 fa22: b6 01 movw r22, r12 fa24: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fa28: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); fa2c: 0f 94 25 63 call 0x2c64a ; 0x2c64a fa30: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; fa34: ef 81 ldd r30, Y+7 ; 0x07 fa36: f8 85 ldd r31, Y+8 ; 0x08 fa38: 10 82 st Z, r1 fa3a: 11 82 std Z+1, r1 ; 0x01 fa3c: 12 82 std Z+2, r1 ; 0x02 fa3e: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); fa40: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 destination[axis] = 1. * axis_home_dir; fa44: af 85 ldd r26, Y+15 ; 0x0f fa46: b8 89 ldd r27, Y+16 ; 0x10 fa48: 8d 92 st X+, r8 fa4a: 9d 92 st X+, r9 fa4c: ad 92 st X+, r10 fa4e: bc 92 st X, r11 fa50: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); fa52: c7 01 movw r24, r14 fa54: b6 01 movw r22, r12 fa56: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fa5a: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 fa5e: 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); fa62: e9 81 ldd r30, Y+1 ; 0x01 fa64: fa 81 ldd r31, Y+2 ; 0x02 fa66: e6 54 subi r30, 0x46 ; 70 fa68: 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); fa6a: 45 90 lpm r4, Z+ fa6c: 55 90 lpm r5, Z+ fa6e: 65 90 lpm r6, Z+ fa70: 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); fa72: 2d ec ldi r18, 0xCD ; 205 fa74: 3c ec ldi r19, 0xCC ; 204 fa76: 4c e8 ldi r20, 0x8C ; 140 fa78: 5f e3 ldi r21, 0x3F ; 63 fa7a: c5 01 movw r24, r10 fa7c: b4 01 movw r22, r8 fa7e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fa82: a3 01 movw r20, r6 fa84: 92 01 movw r18, r4 fa86: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fa8a: ef 85 ldd r30, Y+15 ; 0x0f fa8c: f8 89 ldd r31, Y+16 ; 0x10 fa8e: 60 83 st Z, r22 fa90: 71 83 std Z+1, r23 ; 0x01 fa92: 82 83 std Z+2, r24 ; 0x02 fa94: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); fa96: c7 01 movw r24, r14 fa98: b6 01 movw r22, r12 fa9a: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fa9e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 faa2: 71 2c mov r7, r1 faa4: 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; faa6: 4f 80 ldd r4, Y+7 ; 0x07 faa8: 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(); faaa: 0f 94 25 63 call 0x2c64a ; 0x2c64a faae: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; fab2: d2 01 movw r26, r4 fab4: 1d 92 st X+, r1 fab6: 1d 92 st X+, r1 fab8: 1d 92 st X+, r1 faba: 1c 92 st X, r1 fabc: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); fabe: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 destination[axis] = -10.f * axis_home_dir; fac2: 20 e0 ldi r18, 0x00 ; 0 fac4: 30 e0 ldi r19, 0x00 ; 0 fac6: 40 e2 ldi r20, 0x20 ; 32 fac8: 51 ec ldi r21, 0xC1 ; 193 faca: c5 01 movw r24, r10 facc: b4 01 movw r22, r8 face: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fad2: ef 85 ldd r30, Y+15 ; 0x0f fad4: f8 89 ldd r31, Y+16 ; 0x10 fad6: 60 83 st Z, r22 fad8: 71 83 std Z+1, r23 ; 0x01 fada: 82 83 std Z+2, r24 ; 0x02 fadc: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); fade: c7 01 movw r24, r14 fae0: b6 01 movw r22, r12 fae2: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fae6: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 endstops_hit_on_purpose(); faea: 0f 94 25 63 call 0x2c64a ; 0x2c64a faee: f1 e0 ldi r31, 0x01 ; 1 faf0: 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; faf4: 20 e0 ldi r18, 0x00 ; 0 faf6: 30 e0 ldi r19, 0x00 ; 0 faf8: 40 e3 ldi r20, 0x30 ; 48 fafa: 51 e4 ldi r21, 0x41 ; 65 fafc: c5 01 movw r24, r10 fafe: b4 01 movw r22, r8 fb00: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fb04: af 85 ldd r26, Y+15 ; 0x0f fb06: b8 89 ldd r27, Y+16 ; 0x10 fb08: 6d 93 st X+, r22 fb0a: 7d 93 st X+, r23 fb0c: 8d 93 st X+, r24 fb0e: 9c 93 st X, r25 fb10: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; fb12: 8b 81 ldd r24, Y+3 ; 0x03 fb14: 9c 81 ldd r25, Y+4 ; 0x04 fb16: ad 81 ldd r26, Y+5 ; 0x05 fb18: be 81 ldd r27, Y+6 ; 0x06 fb1a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fb1e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fb22: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fb26: 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); fb2a: c7 01 movw r24, r14 fb2c: b6 01 movw r22, r12 fb2e: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fb32: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); fb36: 82 2d mov r24, r2 fb38: 0f 94 fa 38 call 0x271f4 ; 0x271f4 fb3c: 9c 01 movw r18, r24 fb3e: 44 e0 ldi r20, 0x04 ; 4 fb40: 36 95 lsr r19 fb42: 27 95 ror r18 fb44: 4a 95 dec r20 fb46: e1 f7 brne .-8 ; 0xfb40 if (pstep) pstep[i] = mscnt >> 4; fb48: a9 85 ldd r26, Y+9 ; 0x09 fb4a: ba 85 ldd r27, Y+10 ; 0x0a fb4c: 10 97 sbiw r26, 0x00 ; 0 fb4e: 21 f0 breq .+8 ; 0xfb58 fb50: fd 01 movw r30, r26 fb52: e6 0d add r30, r6 fb54: f7 1d adc r31, r7 fb56: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); fb58: 9f 93 push r25 fb5a: 8f 93 push r24 fb5c: 3f 93 push r19 fb5e: 2f 93 push r18 fb60: 7f 92 push r7 fb62: 6f 92 push r6 fb64: e2 ea ldi r30, 0xA2 ; 162 fb66: fd e7 ldi r31, 0x7D ; 125 fb68: ff 93 push r31 fb6a: ef 93 push r30 fb6c: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 fb70: 4f ef ldi r20, 0xFF ; 255 fb72: 64 1a sub r6, r20 fb74: 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++) fb76: 0f b6 in r0, 0x3f ; 63 fb78: f8 94 cli fb7a: de bf out 0x3e, r29 ; 62 fb7c: 0f be out 0x3f, r0 ; 63 fb7e: cd bf out 0x3d, r28 ; 61 fb80: 9e 85 ldd r25, Y+14 ; 0x0e fb82: 69 16 cp r6, r25 fb84: 08 f4 brcc .+2 ; 0xfb88 fb86: 91 cf rjmp .-222 ; 0xfaaa 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(); fb88: 0f 94 25 63 call 0x2c64a ; 0x2c64a fb8c: 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)) fb90: 80 91 f2 04 lds r24, 0x04F2 ; 0x8004f2 fb94: 88 23 and r24, r24 fb96: 09 f4 brne .+2 ; 0xfb9a fb98: b2 c0 rjmp .+356 ; 0xfcfe } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; fb9a: f8 01 movw r30, r16 fb9c: ed 50 subi r30, 0x0D ; 13 fb9e: fb 4f sbci r31, 0xFB ; 251 fba0: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) fba2: 60 34 cpi r22, 0x40 ; 64 fba4: 08 f0 brcs .+2 ; 0xfba8 fba6: ab c0 rjmp .+342 ; 0xfcfe endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; fba8: f8 01 movw r30, r16 fbaa: e6 5a subi r30, 0xA6 ; 166 fbac: fd 4f sbci r31, 0xFD ; 253 fbae: a0 81 ld r26, Z fbb0: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); fbb2: f8 01 movw r30, r16 fbb4: eb 50 subi r30, 0x0B ; 11 fbb6: fb 4f sbci r31, 0xFB ; 251 fbb8: 80 81 ld r24, Z fbba: 40 e0 ldi r20, 0x00 ; 0 fbbc: 51 e0 ldi r21, 0x01 ; 1 fbbe: 02 c0 rjmp .+4 ; 0xfbc4 fbc0: 56 95 lsr r21 fbc2: 47 95 ror r20 fbc4: 8a 95 dec r24 fbc6: e2 f7 brpl .-8 ; 0xfbc0 if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); fbc8: 82 2d mov r24, r2 fbca: 0f 94 f3 8a call 0x315e6 ; 0x315e6 if (back > 0) fbce: bb 81 ldd r27, Y+3 ; 0x03 fbd0: bb 23 and r27, r27 fbd2: 39 f0 breq .+14 ; 0xfbe2 tmc2130_do_steps(axis, back, -axis_home_dir, 1000); fbd4: 43 2d mov r20, r3 fbd6: 41 95 neg r20 fbd8: 6b 2f mov r22, r27 fbda: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); fbdc: 82 2d mov r24, r2 fbde: 0f 94 c4 8a call 0x31588 ; 0x31588 tmc2130_home_exit(); fbe2: 0f 94 2e 3a call 0x2745c ; 0x2745c #endif //TMC2130 axis_is_at_home(axis); fbe6: 82 2d mov r24, r2 fbe8: 0e 94 e1 5b call 0xb7c2 ; 0xb7c2 axis_known_position[axis] = true; fbec: f8 01 movw r30, r16 fbee: e3 5c subi r30, 0xC3 ; 195 fbf0: f8 4f sbci r31, 0xF8 ; 248 fbf2: 81 e0 ldi r24, 0x01 ; 1 fbf4: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; fbf6: 6b 85 ldd r22, Y+11 ; 0x0b fbf8: 7c 85 ldd r23, Y+12 ; 0x0c fbfa: 71 95 neg r23 fbfc: 61 95 neg r22 fbfe: 71 09 sbc r23, r1 fc00: 07 2e mov r0, r23 fc02: 00 0c add r0, r0 fc04: 88 0b sbc r24, r24 fc06: 99 0b sbc r25, r25 fc08: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> fc0c: 2a e0 ldi r18, 0x0A ; 10 fc0e: 37 ed ldi r19, 0xD7 ; 215 fc10: 43 e2 ldi r20, 0x23 ; 35 fc12: 5c e3 ldi r21, 0x3C ; 60 fc14: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fc18: 4b 01 movw r8, r22 fc1a: 5c 01 movw r10, r24 fc1c: f8 01 movw r30, r16 fc1e: e8 5a subi r30, 0xA8 ; 168 fc20: fd 4f sbci r31, 0xFD ; 253 fc22: 60 81 ld r22, Z fc24: 70 e0 ldi r23, 0x00 ; 0 fc26: 90 e0 ldi r25, 0x00 ; 0 fc28: 80 e0 ldi r24, 0x00 ; 0 fc2a: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> fc2e: 9b 01 movw r18, r22 fc30: ac 01 movw r20, r24 fc32: c5 01 movw r24, r10 fc34: b4 01 movw r22, r8 fc36: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fc3a: 4b 01 movw r8, r22 fc3c: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; fc3e: e9 81 ldd r30, Y+1 ; 0x01 fc40: fa 81 ldd r31, Y+2 ; 0x02 fc42: e0 5c subi r30, 0xC0 ; 192 fc44: f8 4f sbci r31, 0xF8 ; 248 fc46: fc 83 std Y+4, r31 ; 0x04 fc48: eb 83 std Y+3, r30 ; 0x03 fc4a: ac 01 movw r20, r24 fc4c: 9b 01 movw r18, r22 fc4e: 60 81 ld r22, Z fc50: 71 81 ldd r23, Z+1 ; 0x01 fc52: 82 81 ldd r24, Z+2 ; 0x02 fc54: 93 81 ldd r25, Z+3 ; 0x03 fc56: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> fc5a: ab 81 ldd r26, Y+3 ; 0x03 fc5c: bc 81 ldd r27, Y+4 ; 0x04 fc5e: 6d 93 st X+, r22 fc60: 7d 93 st X+, r23 fc62: 8d 93 st X+, r24 fc64: 9c 93 st X, r25 fc66: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); fc68: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 current_position[axis] += dist; fc6c: eb 81 ldd r30, Y+3 ; 0x03 fc6e: fc 81 ldd r31, Y+4 ; 0x04 fc70: 20 81 ld r18, Z fc72: 31 81 ldd r19, Z+1 ; 0x01 fc74: 42 81 ldd r20, Z+2 ; 0x02 fc76: 53 81 ldd r21, Z+3 ; 0x03 fc78: c5 01 movw r24, r10 fc7a: b4 01 movw r22, r8 fc7c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> fc80: ab 81 ldd r26, Y+3 ; 0x03 fc82: bc 81 ldd r27, Y+4 ; 0x04 fc84: 6d 93 st X+, r22 fc86: 7d 93 st X+, r23 fc88: 8d 93 st X+, r24 fc8a: 9c 93 st X, r25 fc8c: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; fc8e: e9 81 ldd r30, Y+1 ; 0x01 fc90: fa 81 ldd r31, Y+2 ; 0x02 fc92: ef 5a subi r30, 0xAF ; 175 fc94: fa 4f sbci r31, 0xFA ; 250 fc96: 60 83 st Z, r22 fc98: 71 83 std Z+1, r23 ; 0x01 fc9a: 82 83 std Z+2, r24 ; 0x02 fc9c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); fc9e: 20 e0 ldi r18, 0x00 ; 0 fca0: 30 e0 ldi r19, 0x00 ; 0 fca2: 40 e0 ldi r20, 0x00 ; 0 fca4: 5f e3 ldi r21, 0x3F ; 63 fca6: c7 01 movw r24, r14 fca8: b6 01 movw r22, r12 fcaa: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fcae: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fcb2: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 feedrate = 0.0; fcb6: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fcba: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fcbe: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fcc2: 10 92 93 02 sts 0x0293, r1 ; 0x800293 fcc6: fd 85 ldd r31, Y+13 ; 0x0d fcc8: f0 93 8f 02 sts 0x028F, r31 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } fccc: 60 96 adiw r28, 0x10 ; 16 fcce: 0f b6 in r0, 0x3f ; 63 fcd0: f8 94 cli fcd2: de bf out 0x3e, r29 ; 62 fcd4: 0f be out 0x3f, r0 ; 63 fcd6: cd bf out 0x3d, r28 ; 61 fcd8: df 91 pop r29 fcda: cf 91 pop r28 fcdc: 1f 91 pop r17 fcde: 0f 91 pop r16 fce0: ff 90 pop r15 fce2: ef 90 pop r14 fce4: df 90 pop r13 fce6: cf 90 pop r12 fce8: bf 90 pop r11 fcea: af 90 pop r10 fcec: 9f 90 pop r9 fcee: 8f 90 pop r8 fcf0: 7f 90 pop r7 fcf2: 6f 90 pop r6 fcf4: 5f 90 pop r5 fcf6: 4f 90 pop r4 fcf8: 3f 90 pop r3 fcfa: 2f 90 pop r2 fcfc: 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); fcfe: 43 2d mov r20, r3 fd00: 41 95 neg r20 fd02: 68 e0 ldi r22, 0x08 ; 8 fd04: 70 e0 ldi r23, 0x00 ; 0 fd06: 6a cf rjmp .-300 ; 0xfbdc feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; fd08: 81 e0 ldi r24, 0x01 ; 1 fd0a: 0e 94 f6 67 call 0xcfec ; 0xcfec #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); fd0e: e8 ec ldi r30, 0xC8 ; 200 fd10: fd e7 ldi r31, 0x7D ; 125 fd12: b4 91 lpm r27, Z fd14: 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; fd16: 10 92 48 07 sts 0x0748, r1 ; 0x800748 fd1a: 10 92 49 07 sts 0x0749, r1 ; 0x800749 fd1e: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a fd22: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b plan_set_position_curposXYZE(); fd26: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 #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); fd2a: e2 ec ldi r30, 0xC2 ; 194 fd2c: fd e7 ldi r31, 0x7D ; 125 fd2e: 85 90 lpm r8, Z+ fd30: 95 90 lpm r9, Z+ fd32: a5 90 lpm r10, Z+ fd34: 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; fd36: e9 81 ldd r30, Y+1 ; 0x01 fd38: 6e 2f mov r22, r30 fd3a: ee 0f add r30, r30 fd3c: 77 0b sbc r23, r23 fd3e: 88 0b sbc r24, r24 fd40: 99 0b sbc r25, r25 fd42: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> fd46: 6b 01 movw r12, r22 fd48: 7c 01 movw r14, r24 fd4a: 20 e0 ldi r18, 0x00 ; 0 fd4c: 30 e0 ldi r19, 0x00 ; 0 fd4e: 40 ec ldi r20, 0xC0 ; 192 fd50: 5f e3 ldi r21, 0x3F ; 63 fd52: c5 01 movw r24, r10 fd54: b4 01 movw r22, r8 fd56: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fd5a: a7 01 movw r20, r14 fd5c: 96 01 movw r18, r12 fd5e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fd62: 60 93 59 05 sts 0x0559, r22 ; 0x800559 fd66: 70 93 5a 05 sts 0x055A, r23 ; 0x80055a fd6a: 80 93 5b 05 sts 0x055B, r24 ; 0x80055b fd6e: 90 93 5c 05 sts 0x055C, r25 ; 0x80055c feedrate = homing_feedrate[axis]; fd72: 80 e0 ldi r24, 0x00 ; 0 fd74: 90 e0 ldi r25, 0x00 ; 0 fd76: a8 e4 ldi r26, 0x48 ; 72 fd78: b4 e4 ldi r27, 0x44 ; 68 fd7a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fd7e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fd82: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fd86: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); fd8a: bc 01 movw r22, r24 fd8c: cd 01 movw r24, r26 fd8e: 0e 94 0d 68 call 0xd01a ; 0xd01a fd92: 4b 01 movw r8, r22 fd94: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); fd96: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fd9a: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 #ifdef TMC2130 check_Z_crash(); fd9e: 0e 94 4d 7c call 0xf89a ; 0xf89a #endif //TMC2130 current_position[axis] = 0; fda2: 10 92 48 07 sts 0x0748, r1 ; 0x800748 fda6: 10 92 49 07 sts 0x0749, r1 ; 0x800749 fdaa: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a fdae: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b plan_set_position_curposXYZE(); fdb2: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 #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); fdb6: ee e9 ldi r30, 0x9E ; 158 fdb8: fd e7 ldi r31, 0x7D ; 125 fdba: 65 91 lpm r22, Z+ fdbc: 75 91 lpm r23, Z+ fdbe: 85 91 lpm r24, Z+ fdc0: 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; fdc2: 90 58 subi r25, 0x80 ; 128 fdc4: a7 01 movw r20, r14 fdc6: 96 01 movw r18, r12 fdc8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fdcc: 60 93 59 05 sts 0x0559, r22 ; 0x800559 fdd0: 70 93 5a 05 sts 0x055A, r23 ; 0x80055a fdd4: 80 93 5b 05 sts 0x055B, r24 ; 0x80055b fdd8: 90 93 5c 05 sts 0x055C, r25 ; 0x80055c plan_buffer_line_destinationXYZE(feedrate_mm_s); fddc: c5 01 movw r24, r10 fdde: b4 01 movw r22, r8 fde0: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fde4: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 #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); fde8: ee e9 ldi r30, 0x9E ; 158 fdea: fd e7 ldi r31, 0x7D ; 125 fdec: 65 91 lpm r22, Z+ fdee: 75 91 lpm r23, Z+ fdf0: 85 91 lpm r24, Z+ fdf2: 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; fdf4: 9b 01 movw r18, r22 fdf6: ac 01 movw r20, r24 fdf8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> fdfc: a7 01 movw r20, r14 fdfe: 96 01 movw r18, r12 fe00: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> fe04: 60 93 59 05 sts 0x0559, r22 ; 0x800559 fe08: 70 93 5a 05 sts 0x055A, r23 ; 0x80055a fe0c: 80 93 5b 05 sts 0x055B, r24 ; 0x80055b fe10: 90 93 5c 05 sts 0x055C, r25 ; 0x80055c feedrate = homing_feedrate[axis] / 2; fe14: 80 e0 ldi r24, 0x00 ; 0 fe16: 90 e0 ldi r25, 0x00 ; 0 fe18: a8 ec ldi r26, 0xC8 ; 200 fe1a: b3 e4 ldi r27, 0x43 ; 67 fe1c: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fe20: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fe24: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fe28: b0 93 93 02 sts 0x0293, r27 ; 0x800293 feedrate_mm_s = get_feedrate_mm_s(feedrate); fe2c: bc 01 movw r22, r24 fe2e: cd 01 movw r24, r26 fe30: 0e 94 0d 68 call 0xd01a ; 0xd01a plan_buffer_line_destinationXYZE(feedrate_mm_s); fe34: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); fe38: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 #ifdef TMC2130 check_Z_crash(); fe3c: 0e 94 4d 7c call 0xf89a ; 0xf89a #endif //TMC2130 axis_is_at_home(axis); fe40: 82 e0 ldi r24, 0x02 ; 2 fe42: 0e 94 e1 5b call 0xb7c2 ; 0xb7c2 destination[axis] = current_position[axis]; fe46: 80 91 48 07 lds r24, 0x0748 ; 0x800748 fe4a: 90 91 49 07 lds r25, 0x0749 ; 0x800749 fe4e: a0 91 4a 07 lds r26, 0x074A ; 0x80074a fe52: b0 91 4b 07 lds r27, 0x074B ; 0x80074b fe56: 80 93 59 05 sts 0x0559, r24 ; 0x800559 fe5a: 90 93 5a 05 sts 0x055A, r25 ; 0x80055a fe5e: a0 93 5b 05 sts 0x055B, r26 ; 0x80055b fe62: b0 93 5c 05 sts 0x055C, r27 ; 0x80055c feedrate = 0.0; fe66: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fe6a: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fe6e: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fe72: 10 92 93 02 sts 0x0293, r1 ; 0x800293 endstops_hit_on_purpose(); fe76: 0f 94 25 63 call 0x2c64a ; 0x2c64a axis_known_position[axis] = true; fe7a: 70 92 3f 07 sts 0x073F, r7 ; 0x80073f #ifdef TMC2130 FORCE_HIGH_POWER_END; fe7e: 80 e0 ldi r24, 0x00 ; 0 fe80: 0e 94 f6 67 call 0xcfec ; 0xcfec fe84: 20 cf rjmp .-448 ; 0xfcc6 0000fe86 : #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 { fe86: 2f 92 push r2 fe88: 3f 92 push r3 fe8a: 4f 92 push r4 fe8c: 5f 92 push r5 fe8e: 6f 92 push r6 fe90: 7f 92 push r7 fe92: 8f 92 push r8 fe94: 9f 92 push r9 fe96: af 92 push r10 fe98: bf 92 push r11 fe9a: cf 92 push r12 fe9c: df 92 push r13 fe9e: ef 92 push r14 fea0: ff 92 push r15 fea2: 0f 93 push r16 fea4: 1f 93 push r17 fea6: cf 93 push r28 fea8: df 93 push r29 feaa: 00 d0 rcall .+0 ; 0xfeac feac: 1f 92 push r1 feae: 1f 92 push r1 feb0: cd b7 in r28, 0x3d ; 61 feb2: de b7 in r29, 0x3e ; 62 feb4: d8 2e mov r13, r24 feb6: 2a 01 movw r4, r20 feb8: 3b 01 movw r6, r22 feba: 32 2e mov r3, r18 febc: e9 82 std Y+1, r14 ; 0x01 febe: fa 82 std Y+2, r15 ; 0x02 fec0: 0b 83 std Y+3, r16 ; 0x03 fec2: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); fec4: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 homing_flag = true; fec8: 81 e0 ldi r24, 0x01 ; 1 feca: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 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; fece: fc 2c mov r15, r12 fed0: e3 2c mov r14, r3 fed2: d3 10 cpse r13, r3 fed4: 10 c0 rjmp .+32 ; 0xfef6 fed6: ed 2c mov r14, r13 fed8: dc 10 cpse r13, r12 feda: 0d c0 rjmp .+26 ; 0xfef6 // 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); fedc: 60 e0 ldi r22, 0x00 ; 0 fede: 70 e0 ldi r23, 0x00 ; 0 fee0: 80 ea ldi r24, 0xA0 ; 160 fee2: 90 e4 ldi r25, 0x40 ; 64 fee4: 0e 94 a6 6f call 0xdf4c ; 0xdf4c // 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; fee8: ff 24 eor r15, r15 feea: f3 94 inc r15 feec: ee 24 eor r14, r14 feee: e3 94 inc r14 fef0: 22 24 eor r2, r2 fef2: 23 94 inc r2 fef4: 01 c0 rjmp .+2 ; 0xfef8 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; fef6: 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(); fef8: 0f 94 2e cb call 0x3965c ; 0x3965c // 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; fefc: 80 91 9d 13 lds r24, 0x139D ; 0x80139d ff00: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; ff02: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); ff06: 82 e0 ldi r24, 0x02 ; 2 ff08: 0f 94 c7 57 call 0x2af8e ; 0x2af8e ff0c: 60 93 48 07 sts 0x0748, r22 ; 0x800748 ff10: 70 93 49 07 sts 0x0749, r23 ; 0x800749 ff14: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a ff18: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) ff1c: f1 10 cpse r15, r1 babystep_undo(); ff1e: 0f 94 d3 c6 call 0x38da6 ; 0x38da6 int l_feedmultiply = setup_for_endstop_move(); ff22: 81 e0 ldi r24, 0x01 ; 1 ff24: 0e 94 2e 68 call 0xd05c ; 0xd05c ff28: 8c 01 movw r16, r24 set_destination_to_current(); ff2a: 0e 94 80 69 call 0xd300 ; 0xd300 feedrate = 0.0; ff2e: 10 92 90 02 sts 0x0290, r1 ; 0x800290 ff32: 10 92 91 02 sts 0x0291, r1 ; 0x800291 ff36: 10 92 92 02 sts 0x0292, r1 ; 0x800292 ff3a: 10 92 93 02 sts 0x0293, r1 ; 0x800293 current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) ff3e: 22 20 and r2, r2 ff40: 09 f4 brne .+2 ; 0xff44 ff42: 77 c1 rjmp .+750 ; 0x10232 { if (!calib) ff44: 9b 8d ldd r25, Y+27 ; 0x1b ff46: 91 11 cpse r25, r1 ff48: 6a c1 rjmp .+724 ; 0x1021e homeaxis(X_AXIS); ff4a: 50 e0 ldi r21, 0x00 ; 0 ff4c: 40 e0 ldi r20, 0x00 ; 0 ff4e: 61 e0 ldi r22, 0x01 ; 1 ff50: 80 e0 ldi r24, 0x00 ; 0 ff52: 0e 94 87 7c call 0xf90e ; 0xf90e else tmc2130_home_calibrate(X_AXIS); } if(home_y) ff56: ee 20 and r14, r14 ff58: 31 f0 breq .+12 ; 0xff66 { if (!calib) homeaxis(Y_AXIS); ff5a: 50 e0 ldi r21, 0x00 ; 0 ff5c: 40 e0 ldi r20, 0x00 ; 0 ff5e: 61 e0 ldi r22, 0x01 ; 1 ff60: 81 e0 ldi r24, 0x01 ; 1 ff62: 0e 94 87 7c call 0xf90e ; 0xf90e if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) ff66: dd 20 and r13, r13 ff68: e9 f0 breq .+58 ; 0xffa4 ff6a: 41 14 cp r4, r1 ff6c: 51 04 cpc r5, r1 ff6e: 61 04 cpc r6, r1 ff70: 71 04 cpc r7, r1 ff72: c1 f0 breq .+48 ; 0xffa4 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; ff74: c3 01 movw r24, r6 ff76: b2 01 movw r22, r4 ff78: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> ff7c: 9b 01 movw r18, r22 ff7e: ac 01 movw r20, r24 ff80: 60 91 c3 06 lds r22, 0x06C3 ; 0x8006c3 ff84: 70 91 c4 06 lds r23, 0x06C4 ; 0x8006c4 ff88: 80 91 c5 06 lds r24, 0x06C5 ; 0x8006c5 ff8c: 90 91 c6 06 lds r25, 0x06C6 ; 0x8006c6 ff90: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> ff94: 60 93 40 07 sts 0x0740, r22 ; 0x800740 ff98: 70 93 41 07 sts 0x0741, r23 ; 0x800741 ff9c: 80 93 42 07 sts 0x0742, r24 ; 0x800742 ffa0: 90 93 43 07 sts 0x0743, r25 ; 0x800743 if(home_y_axis && home_y_value != 0) ffa4: 33 20 and r3, r3 ffa6: 01 f1 breq .+64 ; 0xffe8 ffa8: 89 81 ldd r24, Y+1 ; 0x01 ffaa: 9a 81 ldd r25, Y+2 ; 0x02 ffac: ab 81 ldd r26, Y+3 ; 0x03 ffae: bc 81 ldd r27, Y+4 ; 0x04 ffb0: 00 97 sbiw r24, 0x00 ; 0 ffb2: a1 05 cpc r26, r1 ffb4: b1 05 cpc r27, r1 ffb6: c1 f0 breq .+48 ; 0xffe8 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; ffb8: bc 01 movw r22, r24 ffba: cd 01 movw r24, r26 ffbc: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> ffc0: 9b 01 movw r18, r22 ffc2: ac 01 movw r20, r24 ffc4: 60 91 c7 06 lds r22, 0x06C7 ; 0x8006c7 ffc8: 70 91 c8 06 lds r23, 0x06C8 ; 0x8006c8 ffcc: 80 91 c9 06 lds r24, 0x06C9 ; 0x8006c9 ffd0: 90 91 ca 06 lds r25, 0x06CA ; 0x8006ca ffd4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> ffd8: 60 93 44 07 sts 0x0744, r22 ; 0x800744 ffdc: 70 93 45 07 sts 0x0745, r23 ; 0x800745 ffe0: 80 93 46 07 sts 0x0746, r24 ; 0x800746 ffe4: 90 93 47 07 sts 0x0747, r25 ; 0x800747 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { ffe8: ff 20 and r15, r15 ffea: 09 f4 brne .+2 ; 0xffee ffec: a2 c0 rjmp .+324 ; 0x10132 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); ffee: 60 e0 ldi r22, 0x00 ; 0 fff0: 70 e0 ldi r23, 0x00 ; 0 fff2: 80 ea ldi r24, 0xA0 ; 160 fff4: 90 e4 ldi r25, 0x40 ; 64 fff6: 0e 94 a6 6f call 0xdf4c ; 0xdf4c if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); fffa: 80 91 3d 07 lds r24, 0x073D ; 0x80073d fffe: 81 11 cpse r24, r1 10000: 05 c0 rjmp .+10 ; 0x1000c 10002: 50 e0 ldi r21, 0x00 ; 0 10004: 40 e0 ldi r20, 0x00 ; 0 10006: 61 e0 ldi r22, 0x01 ; 1 10008: 0e 94 87 7c call 0xf90e ; 0xf90e if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); 1000c: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 10010: 81 11 cpse r24, r1 10012: 06 c0 rjmp .+12 ; 0x10020 10014: 50 e0 ldi r21, 0x00 ; 0 10016: 40 e0 ldi r20, 0x00 ; 0 10018: 61 e0 ldi r22, 0x01 ; 1 1001a: 81 e0 ldi r24, 0x01 ; 1 1001c: 0e 94 87 7c call 0xf90e ; 0xf90e // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); 10020: 0f 94 93 cb call 0x39726 ; 0x39726 world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); 10024: e1 e4 ldi r30, 0x41 ; 65 10026: f3 e9 ldi r31, 0x93 ; 147 10028: 85 91 lpm r24, Z+ 1002a: 95 91 lpm r25, Z+ 1002c: a5 91 lpm r26, Z+ 1002e: b4 91 lpm r27, Z 10030: ed e3 ldi r30, 0x3D ; 61 10032: f3 e9 ldi r31, 0x93 ; 147 10034: 45 91 lpm r20, Z+ 10036: 55 91 lpm r21, Z+ 10038: 65 91 lpm r22, Z+ 1003a: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; 1003c: 40 93 51 05 sts 0x0551, r20 ; 0x800551 10040: 50 93 52 05 sts 0x0552, r21 ; 0x800552 10044: 60 93 53 05 sts 0x0553, r22 ; 0x800553 10048: 70 93 54 05 sts 0x0554, r23 ; 0x800554 out_y = y; 1004c: 80 93 55 05 sts 0x0555, r24 ; 0x800555 10050: 90 93 56 05 sts 0x0556, r25 ; 0x800556 10054: a0 93 57 05 sts 0x0557, r26 ; 0x800557 10058: b0 93 58 05 sts 0x0558, r27 ; 0x800558 world2machine(out_x, out_y); 1005c: 65 e5 ldi r22, 0x55 ; 85 1005e: 75 e0 ldi r23, 0x05 ; 5 10060: 81 e5 ldi r24, 0x51 ; 81 10062: 95 e0 ldi r25, 0x05 ; 5 10064: 0e 94 48 6b call 0xd690 ; 0xd690 world2machine_reset(); 10068: 0f 94 f5 ca call 0x395ea ; 0x395ea if (destination[Y_AXIS] < Y_MIN_POS) 1006c: 20 e0 ldi r18, 0x00 ; 0 1006e: 30 e0 ldi r19, 0x00 ; 0 10070: 40 e8 ldi r20, 0x80 ; 128 10072: 50 ec ldi r21, 0xC0 ; 192 10074: 60 91 55 05 lds r22, 0x0555 ; 0x800555 10078: 70 91 56 05 lds r23, 0x0556 ; 0x800556 1007c: 80 91 57 05 lds r24, 0x0557 ; 0x800557 10080: 90 91 58 05 lds r25, 0x0558 ; 0x800558 10084: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 10088: 87 ff sbrs r24, 7 1008a: 0c c0 rjmp .+24 ; 0x100a4 destination[Y_AXIS] = Y_MIN_POS; 1008c: 80 e0 ldi r24, 0x00 ; 0 1008e: 90 e0 ldi r25, 0x00 ; 0 10090: a0 e8 ldi r26, 0x80 ; 128 10092: b0 ec ldi r27, 0xC0 ; 192 10094: 80 93 55 05 sts 0x0555, r24 ; 0x800555 10098: 90 93 56 05 sts 0x0556, r25 ; 0x800556 1009c: a0 93 57 05 sts 0x0557, r26 ; 0x800557 100a0: b0 93 58 05 sts 0x0558, r27 ; 0x800558 feedrate = homing_feedrate[X_AXIS] / 20; 100a4: 80 e0 ldi r24, 0x00 ; 0 100a6: 90 e0 ldi r25, 0x00 ; 0 100a8: a6 e1 ldi r26, 0x16 ; 22 100aa: b3 e4 ldi r27, 0x43 ; 67 100ac: 80 93 90 02 sts 0x0290, r24 ; 0x800290 100b0: 90 93 91 02 sts 0x0291, r25 ; 0x800291 100b4: a0 93 92 02 sts 0x0292, r26 ; 0x800292 100b8: b0 93 93 02 sts 0x0293, r27 ; 0x800293 100bc: 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(); 100c0: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 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); 100c4: 60 91 90 02 lds r22, 0x0290 ; 0x800290 100c8: 70 91 91 02 lds r23, 0x0291 ; 0x800291 100cc: 80 91 92 02 lds r24, 0x0292 ; 0x800292 100d0: 90 91 93 02 lds r25, 0x0293 ; 0x800293 100d4: 0f 94 de b9 call 0x373bc ; 0x373bc st_synchronize(); 100d8: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position[X_AXIS] = destination[X_AXIS]; 100dc: 80 91 51 05 lds r24, 0x0551 ; 0x800551 100e0: 90 91 52 05 lds r25, 0x0552 ; 0x800552 100e4: a0 91 53 05 lds r26, 0x0553 ; 0x800553 100e8: b0 91 54 05 lds r27, 0x0554 ; 0x800554 100ec: 80 93 40 07 sts 0x0740, r24 ; 0x800740 100f0: 90 93 41 07 sts 0x0741, r25 ; 0x800741 100f4: a0 93 42 07 sts 0x0742, r26 ; 0x800742 100f8: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = destination[Y_AXIS]; 100fc: 80 91 55 05 lds r24, 0x0555 ; 0x800555 10100: 90 91 56 05 lds r25, 0x0556 ; 0x800556 10104: a0 91 57 05 lds r26, 0x0557 ; 0x800557 10108: b0 91 58 05 lds r27, 0x0558 ; 0x800558 1010c: 80 93 44 07 sts 0x0744, r24 ; 0x800744 10110: 90 93 45 07 sts 0x0745, r25 ; 0x800745 10114: a0 93 46 07 sts 0x0746, r26 ; 0x800746 10118: b0 93 47 07 sts 0x0747, r27 ; 0x800747 1011c: 81 e0 ldi r24, 0x01 ; 1 1011e: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); endstops_hit_on_purpose(); 10122: 0f 94 25 63 call 0x2c64a ; 0x2c64a homeaxis(Z_AXIS); 10126: 50 e0 ldi r21, 0x00 ; 0 10128: 40 e0 ldi r20, 0x00 ; 0 1012a: 61 e0 ldi r22, 0x01 ; 1 1012c: 82 e0 ldi r24, 0x02 ; 2 1012e: 0e 94 87 7c call 0xf90e ; 0xf90e homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) 10132: cc 20 and r12, r12 10134: e9 f0 breq .+58 ; 0x10170 10136: 81 14 cp r8, r1 10138: 91 04 cpc r9, r1 1013a: a1 04 cpc r10, r1 1013c: b1 04 cpc r11, r1 1013e: c1 f0 breq .+48 ; 0x10170 current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; 10140: c5 01 movw r24, r10 10142: b4 01 movw r22, r8 10144: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 10148: 9b 01 movw r18, r22 1014a: ac 01 movw r20, r24 1014c: 60 91 cb 06 lds r22, 0x06CB ; 0x8006cb 10150: 70 91 cc 06 lds r23, 0x06CC ; 0x8006cc 10154: 80 91 cd 06 lds r24, 0x06CD ; 0x8006cd 10158: 90 91 ce 06 lds r25, 0x06CE ; 0x8006ce 1015c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 10160: 60 93 48 07 sts 0x0748, r22 ; 0x800748 10164: 70 93 49 07 sts 0x0749, r23 ; 0x800749 10168: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 1016c: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b // 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(); 10170: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 clean_up_after_endstop_move(l_feedmultiply); 10174: c8 01 movw r24, r16 10176: 0e 94 14 68 call 0xd028 ; 0xd028 endstops_hit_on_purpose(); 1017a: 0f 94 25 63 call 0x2c64a ; 0x2c64a // Load the machine correction matrix world2machine_initialize(); 1017e: 0f 94 93 cb call 0x39726 ; 0x39726 // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); 10182: 0f 94 31 c9 call 0x39262 ; 0x39262 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) 10186: d1 10 cpse r13, r1 10188: 07 c0 rjmp .+14 ; 0x10198 1018a: 31 10 cpse r3, r1 1018c: 05 c0 rjmp .+10 ; 0x10198 1018e: 8c 8d ldd r24, Y+28 ; 0x1c 10190: 81 11 cpse r24, r1 10192: 02 c0 rjmp .+4 ; 0x10198 10194: cc 20 and r12, r12 10196: 39 f1 breq .+78 ; 0x101e6 { if (! home_z && mbl_was_active) { 10198: f1 10 cpse r15, r1 1019a: 25 c0 rjmp .+74 ; 0x101e6 1019c: 9d 81 ldd r25, Y+5 ; 0x05 1019e: 99 23 and r25, r25 101a0: 11 f1 breq .+68 ; 0x101e6 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; 101a2: 81 e0 ldi r24, 0x01 ; 1 101a4: 80 93 9d 13 sts 0x139D, r24 ; 0x80139d // 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)); 101a8: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 101ac: 6b 01 movw r12, r22 101ae: 7c 01 movw r14, r24 101b0: 80 e0 ldi r24, 0x00 ; 0 101b2: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 101b6: a7 01 movw r20, r14 101b8: 96 01 movw r18, r12 101ba: 0f 94 d1 95 call 0x32ba2 ; 0x32ba2 101be: 9b 01 movw r18, r22 101c0: ac 01 movw r20, r24 101c2: 60 91 48 07 lds r22, 0x0748 ; 0x800748 101c6: 70 91 49 07 lds r23, 0x0749 ; 0x800749 101ca: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 101ce: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 101d2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 101d6: 60 93 48 07 sts 0x0748, r22 ; 0x800748 101da: 70 93 49 07 sts 0x0749, r23 ; 0x800749 101de: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 101e2: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b } #endif prusa_statistics(20); st_synchronize(); 101e6: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 homing_flag = false; 101ea: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 #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 } 101ee: 0f 90 pop r0 101f0: 0f 90 pop r0 101f2: 0f 90 pop r0 101f4: 0f 90 pop r0 101f6: 0f 90 pop r0 101f8: df 91 pop r29 101fa: cf 91 pop r28 101fc: 1f 91 pop r17 101fe: 0f 91 pop r16 10200: ff 90 pop r15 10202: ef 90 pop r14 10204: df 90 pop r13 10206: cf 90 pop r12 10208: bf 90 pop r11 1020a: af 90 pop r10 1020c: 9f 90 pop r9 1020e: 8f 90 pop r8 10210: 7f 90 pop r7 10212: 6f 90 pop r6 10214: 5f 90 pop r5 10216: 4f 90 pop r4 10218: 3f 90 pop r3 1021a: 2f 90 pop r2 1021c: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); 1021e: 80 e0 ldi r24, 0x00 ; 0 10220: 0f 94 20 37 call 0x26e40 ; 0x26e40 } if(home_y) 10224: ee 20 and r14, r14 10226: 09 f4 brne .+2 ; 0x1022a 10228: 9e ce rjmp .-708 ; 0xff66 { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); 1022a: 81 e0 ldi r24, 0x01 ; 1 1022c: 0f 94 20 37 call 0x26e40 ; 0x26e40 10230: 9a ce rjmp .-716 ; 0xff66 homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) 10232: ee 20 and r14, r14 10234: 09 f4 brne .+2 ; 0x10238 10236: 97 ce rjmp .-722 ; 0xff66 { if (!calib) 10238: ab 8d ldd r26, Y+27 ; 0x1b 1023a: aa 23 and r26, r26 1023c: 09 f4 brne .+2 ; 0x10240 1023e: 8d ce rjmp .-742 ; 0xff5a 10240: f4 cf rjmp .-24 ; 0x1022a 00010242 : 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) { 10242: 8f 92 push r8 10244: 9f 92 push r9 10246: af 92 push r10 10248: bf 92 push r11 1024a: cf 92 push r12 1024c: ef 92 push r14 1024e: ff 92 push r15 10250: 0f 93 push r16 10252: 1f 93 push r17 10254: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); 10256: 91 e0 ldi r25, 0x01 ; 1 10258: 9f 93 push r25 1025a: 1f 92 push r1 1025c: 81 2c mov r8, r1 1025e: 91 2c mov r9, r1 10260: 54 01 movw r10, r8 10262: c4 2e mov r12, r20 10264: e1 2c mov r14, r1 10266: f1 2c mov r15, r1 10268: 87 01 movw r16, r14 1026a: 40 e0 ldi r20, 0x00 ; 0 1026c: 50 e0 ldi r21, 0x00 ; 0 1026e: ba 01 movw r22, r20 10270: 0e 94 43 7f call 0xfe86 ; 0xfe86 10274: 0f 90 pop r0 10276: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } 10278: 1f 91 pop r17 1027a: 0f 91 pop r16 1027c: ff 90 pop r15 1027e: ef 90 pop r14 10280: cf 90 pop r12 10282: bf 90 pop r11 10284: af 90 pop r10 10286: 9f 90 pop r9 10288: 8f 90 pop r8 1028a: 08 95 ret 0001028c : // 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(); 1028c: 84 e8 ldi r24, 0x84 ; 132 1028e: 93 e0 ldi r25, 0x03 ; 3 10290: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) 10294: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 10298: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 1029c: 89 2b or r24, r25 1029e: 79 f0 breq .+30 ; 0x102be 102a0: e0 91 6d 12 lds r30, 0x126D ; 0x80126d 102a4: f0 91 6e 12 lds r31, 0x126E ; 0x80126e 102a8: e0 58 subi r30, 0x80 ; 128 102aa: ff 4e sbci r31, 0xEF ; 239 102ac: 80 81 ld r24, Z 102ae: 81 30 cpi r24, 0x01 ; 1 102b0: 11 f0 breq .+4 ; 0x102b6 102b2: 86 30 cpi r24, 0x06 ; 6 102b4: 21 f4 brne .+8 ; 0x102be SERIAL_PROTOCOLLNRPGM(MSG_OK); 102b6: 88 ee ldi r24, 0xE8 ; 232 102b8: 9e e6 ldi r25, 0x6E ; 110 102ba: 0c 94 97 7b jmp 0xf72e ; 0xf72e } 102be: 08 95 ret 000102c0 : void cmdqueue_reset() { while (buflen) 102c0: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 102c4: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 102c8: 89 2b or r24, r25 102ca: 29 f0 breq .+10 ; 0x102d6 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); 102cc: 0e 94 46 81 call 0x1028c ; 0x1028c cmdqueue_pop_front(); 102d0: 0e 94 d8 78 call 0xf1b0 ; 0xf1b0 102d4: f5 cf rjmp .-22 ; 0x102c0 } bufindr = 0; 102d6: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 102da: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d bufindw = 0; 102de: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 102e2: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.568> //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; 102e6: 81 e0 ldi r24, 0x01 ; 1 102e8: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d } 102ec: 08 95 ret 000102ee : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { 102ee: ef 92 push r14 102f0: ff 92 push r15 102f2: 0f 93 push r16 102f4: 1f 93 push r17 102f6: cf 93 push r28 102f8: df 93 push r29 if (mbl.active) { 102fa: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 102fe: 88 23 and r24, r24 10300: 89 f1 breq .+98 ; 0x10364 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); 10302: 82 eb ldi r24, 0xB2 ; 178 10304: 9e e7 ldi r25, 0x7E ; 126 10306: 0e 94 97 7b call 0xf72e ; 0xf72e SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); 1030a: 8c e9 ldi r24, 0x9C ; 156 1030c: 9e e7 ldi r25, 0x7E ; 126 1030e: 0e 94 97 7b call 0xf72e ; 0xf72e SERIAL_PROTOCOLLNPGM("Measured points:"); 10312: 8b e8 ldi r24, 0x8B ; 139 10314: 9e e7 ldi r25, 0x7E ; 126 10316: 0e 94 97 7b call 0xf72e ; 0xf72e for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { 1031a: c7 e0 ldi r28, 0x07 ; 7 1031c: dc e1 ldi r29, 0x1C ; 28 1031e: c1 50 subi r28, 0x01 ; 1 10320: 58 f1 brcs .+86 ; 0x10378 10322: cd 9f mul r28, r29 10324: 70 01 movw r14, r0 10326: 11 24 eor r1, r1 10328: 01 e0 ldi r16, 0x01 ; 1 1032a: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); 1032c: 88 e8 ldi r24, 0x88 ; 136 1032e: 9e e7 ldi r25, 0x7E ; 126 10330: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOL_F(z_values[y][x], 5); 10334: f8 01 movw r30, r16 10336: ee 0f add r30, r30 10338: ff 1f adc r31, r31 1033a: ee 0f add r30, r30 1033c: ff 1f adc r31, r31 1033e: ee 0d add r30, r14 10340: ff 1d adc r31, r15 10342: e6 56 subi r30, 0x66 ; 102 10344: fc 4e sbci r31, 0xEC ; 236 10346: 60 81 ld r22, Z 10348: 71 81 ldd r23, Z+1 ; 0x01 1034a: 82 81 ldd r24, Z+2 ; 0x02 1034c: 93 81 ldd r25, Z+3 ; 0x03 1034e: 45 e0 ldi r20, 0x05 ; 5 10350: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 10354: 0f 5f subi r16, 0xFF ; 255 10356: 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++) { 10358: 08 30 cpi r16, 0x08 ; 8 1035a: 11 05 cpc r17, r1 1035c: 39 f7 brne .-50 ; 0x1032c SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); 1035e: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 10362: dd cf rjmp .-70 ; 0x1031e mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10364: 8f eb ldi r24, 0xBF ; 191 10366: 9e e7 ldi r25, 0x7E ; 126 return; } 10368: df 91 pop r29 1036a: cf 91 pop r28 1036c: 1f 91 pop r17 1036e: 0f 91 pop r16 10370: ff 90 pop r15 10372: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10374: 0c 94 97 7b jmp 0xf72e ; 0xf72e return; } 10378: df 91 pop r29 1037a: cf 91 pop r28 1037c: 1f 91 pop r17 1037e: 0f 91 pop r16 10380: ff 90 pop r15 10382: ef 90 pop r14 10384: 08 95 ret 00010386 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { 10386: 8f 92 push r8 10388: 9f 92 push r9 1038a: af 92 push r10 1038c: bf 92 push r11 1038e: cf 92 push r12 10390: df 92 push r13 10392: ef 92 push r14 10394: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); 10396: 0f 94 55 3e call 0x27caa ; 0x27caa 1039a: 6b 01 movw r12, r22 1039c: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { 1039e: 20 91 2f 02 lds r18, 0x022F ; 0x80022f 103a2: 22 23 and r18, r18 103a4: 09 f1 breq .+66 ; 0x103e8 103a6: 40 91 96 02 lds r20, 0x0296 ; 0x800296 103aa: 41 30 cpi r20, 0x01 ; 1 103ac: e9 f0 breq .+58 ; 0x103e8 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; 103ae: 80 91 10 02 lds r24, 0x0210 ; 0x800210 103b2: 90 91 11 02 lds r25, 0x0211 ; 0x800211 103b6: a0 91 12 02 lds r26, 0x0212 ; 0x800212 103ba: b0 91 13 02 lds r27, 0x0213 ; 0x800213 103be: 46 01 movw r8, r12 103c0: 57 01 movw r10, r14 103c2: 88 1a sub r8, r24 103c4: 99 0a sbc r9, r25 103c6: aa 0a sbc r10, r26 103c8: bb 0a sbc r11, r27 103ca: 30 e0 ldi r19, 0x00 ; 0 103cc: a8 ee ldi r26, 0xE8 ; 232 103ce: b3 e0 ldi r27, 0x03 ; 3 103d0: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 103d4: 86 16 cp r8, r22 103d6: 97 06 cpc r9, r23 103d8: a8 06 cpc r10, r24 103da: b9 06 cpc r11, r25 103dc: 6c f0 brlt .+26 ; 0x103f8 switch (busy_state) { 103de: 44 30 cpi r20, 0x04 ; 4 103e0: 31 f1 breq .+76 ; 0x1042e 103e2: 9c f4 brge .+38 ; 0x1040a 103e4: 42 30 cpi r20, 0x02 ; 2 103e6: d4 f4 brge .+52 ; 0x1041c break; default: break; } } prev_busy_signal_ms = ms; 103e8: c0 92 10 02 sts 0x0210, r12 ; 0x800210 103ec: d0 92 11 02 sts 0x0211, r13 ; 0x800211 103f0: e0 92 12 02 sts 0x0212, r14 ; 0x800212 103f4: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } 103f8: ff 90 pop r15 103fa: ef 90 pop r14 103fc: df 90 pop r13 103fe: cf 90 pop r12 10400: bf 90 pop r11 10402: af 90 pop r10 10404: 9f 90 pop r9 10406: 8f 90 pop r8 10408: 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) { 1040a: 45 30 cpi r20, 0x05 ; 5 1040c: 69 f7 brne .-38 ; 0x103e8 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; 1040e: 84 e1 ldi r24, 0x14 ; 20 10410: 9b ea ldi r25, 0xAB ; 171 10412: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM("busy: paused for input"); 10416: 84 e3 ldi r24, 0x34 ; 52 10418: 9d e7 ldi r25, 0x7D ; 125 1041a: 06 c0 rjmp .+12 ; 0x10428 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; 1041c: 84 e1 ldi r24, 0x14 ; 20 1041e: 9b ea ldi r25, 0xAB ; 171 10420: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM("busy: processing"); 10424: 81 e6 ldi r24, 0x61 ; 97 10426: 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"); 10428: 0e 94 97 7b call 0xf72e ; 0xf72e 1042c: dd cf rjmp .-70 ; 0x103e8 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; 1042e: 84 e1 ldi r24, 0x14 ; 20 10430: 9b ea ldi r25, 0xAB ; 171 10432: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM("busy: paused for user"); 10436: 8b e4 ldi r24, 0x4B ; 75 10438: 9d e7 ldi r25, 0x7D ; 125 1043a: f6 cf rjmp .-20 ; 0x10428 0001043c : //} } #endif //TACH_0 void checkFans() { 1043c: cf 92 push r12 1043e: df 92 push r13 10440: ef 92 push r14 10442: ff 92 push r15 10444: 0f 93 push r16 10446: 1f 93 push r17 10448: cf 93 push r28 1044a: df 93 push r29 1044c: 1f 92 push r1 1044e: 1f 92 push r1 10450: cd b7 in r28, 0x3d ; 61 10452: 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)) { 10454: 0f 94 55 3e call 0x27caa ; 0x27caa 10458: 00 91 99 17 lds r16, 0x1799 ; 0x801799 1045c: 10 91 9a 17 lds r17, 0x179A ; 0x80179a 10460: 20 91 9b 17 lds r18, 0x179B ; 0x80179b 10464: 30 91 9c 17 lds r19, 0x179C ; 0x80179c 10468: 60 1b sub r22, r16 1046a: 71 0b sbc r23, r17 1046c: 82 0b sbc r24, r18 1046e: 93 0b sbc r25, r19 10470: 69 38 cpi r22, 0x89 ; 137 10472: 73 41 sbci r23, 0x13 ; 19 10474: 81 05 cpc r24, r1 10476: 91 05 cpc r25, r1 10478: d0 f0 brcs .+52 ; 0x104ae 1047a: 80 91 33 05 lds r24, 0x0533 ; 0x800533 1047e: 81 11 cpse r24, r1 10480: 16 c0 rjmp .+44 ; 0x104ae extruder_autofan_last_check = _millis(); 10482: 0f 94 55 3e call 0x27caa ; 0x27caa 10486: 60 93 99 17 sts 0x1799, r22 ; 0x801799 1048a: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 1048e: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 10492: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c fanSpeedBckp = fanSpeedSoftPwm; 10496: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 1049a: 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 1049e: 8b 34 cpi r24, 0x4B ; 75 104a0: 18 f0 brcs .+6 ; 0x104a8 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 104a2: 8f ef ldi r24, 0xFF ; 255 104a4: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d } fan_measuring = true; 104a8: 81 e0 ldi r24, 0x01 ; 1 104aa: 80 93 33 05 sts 0x0533, r24 ; 0x800533 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 104ae: 0f 94 55 3e call 0x27caa ; 0x27caa 104b2: 00 91 99 17 lds r16, 0x1799 ; 0x801799 104b6: 10 91 9a 17 lds r17, 0x179A ; 0x80179a 104ba: 20 91 9b 17 lds r18, 0x179B ; 0x80179b 104be: 30 91 9c 17 lds r19, 0x179C ; 0x80179c 104c2: 60 1b sub r22, r16 104c4: 71 0b sbc r23, r17 104c6: 82 0b sbc r24, r18 104c8: 93 0b sbc r25, r19 104ca: 65 36 cpi r22, 0x65 ; 101 104cc: 71 05 cpc r23, r1 104ce: 81 05 cpc r24, r1 104d0: 91 05 cpc r25, r1 104d2: 08 f4 brcc .+2 ; 0x104d6 104d4: f7 c0 rjmp .+494 ; 0x106c4 104d6: 80 91 33 05 lds r24, 0x0533 ; 0x800533 104da: 88 23 and r24, r24 104dc: 09 f4 brne .+2 ; 0x104e0 104de: f2 c0 rjmp .+484 ; 0x106c4 countFanSpeed(); 104e0: 0e 94 eb 76 call 0xedd6 ; 0xedd6 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 104e4: 83 e0 ldi r24, 0x03 ; 3 104e6: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 104e8: 82 e0 ldi r24, 0x02 ; 2 104ea: 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) 104ec: 80 91 38 02 lds r24, 0x0238 ; 0x800238 104f0: 88 23 and r24, r24 104f2: 51 f0 breq .+20 ; 0x10508 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 104f4: 87 e8 ldi r24, 0x87 ; 135 104f6: 9f e0 ldi r25, 0x0F ; 15 104f8: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 104fc: 91 e0 ldi r25, 0x01 ; 1 104fe: 81 11 cpse r24, r1 10500: 01 c0 rjmp .+2 ; 0x10504 10502: 90 e0 ldi r25, 0x00 ; 0 10504: 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]++;} 10508: 80 91 ae 04 lds r24, 0x04AE ; 0x8004ae 1050c: 90 91 af 04 lds r25, 0x04AF ; 0x8004af 10510: 44 97 sbiw r24, 0x14 ; 20 10512: 0c f0 brlt .+2 ; 0x10516 10514: a0 c0 rjmp .+320 ; 0x10656 10516: 20 e0 ldi r18, 0x00 ; 0 10518: 30 e0 ldi r19, 0x00 ; 0 1051a: 48 e4 ldi r20, 0x48 ; 72 1051c: 52 e4 ldi r21, 0x42 ; 66 1051e: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 10522: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 10526: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 1052a: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 1052e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 10532: 18 16 cp r1, r24 10534: 0c f0 brlt .+2 ; 0x10538 10536: 8f c0 rjmp .+286 ; 0x10656 10538: 80 91 4c 03 lds r24, 0x034C ; 0x80034c 1053c: 8f 5f subi r24, 0xFF ; 255 1053e: 80 93 4c 03 sts 0x034C, r24 ; 0x80034c else fan_speed_errors[0] = 0; #endif #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; 10542: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 10546: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 1054a: 05 97 sbiw r24, 0x05 ; 5 1054c: 0c f0 brlt .+2 ; 0x10550 1054e: 89 c0 rjmp .+274 ; 0x10662 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); 10550: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 10554: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 10558: 98 17 cp r25, r24 1055a: 09 f4 brne .+2 ; 0x1055e 1055c: 7f c0 rjmp .+254 ; 0x1065c 1055e: e0 91 54 0e lds r30, 0x0E54 ; 0x800e54 10562: 8e e6 ldi r24, 0x6E ; 110 10564: e8 9f mul r30, r24 10566: f0 01 movw r30, r0 10568: 11 24 eor r1, r1 1056a: e7 54 subi r30, 0x47 ; 71 1056c: f8 4f sbci r31, 0xF8 ; 248 1056e: 80 81 ld r24, Z 10570: 8c 34 cpi r24, 0x4C ; 76 10572: 08 f4 brcc .+2 ; 0x10576 10574: 76 c0 rjmp .+236 ; 0x10662 10576: 80 91 4d 03 lds r24, 0x034D ; 0x80034d 1057a: 8f 5f subi r24, 0xFF ; 255 1057c: 80 93 4d 03 sts 0x034D, r24 ; 0x80034d else fan_speed_errors[1] = 0; #endif // drop the fan_check_error flag when both fans are ok if( fan_speed_errors[0] == 0 && fan_speed_errors[1] == 0 && fan_check_error == EFCE_REPORTED){ 10580: 80 91 4c 03 lds r24, 0x034C ; 0x80034c 10584: 81 11 cpse r24, r1 10586: 0b c0 rjmp .+22 ; 0x1059e 10588: 80 91 4d 03 lds r24, 0x034D ; 0x80034d 1058c: 81 11 cpse r24, r1 1058e: 07 c0 rjmp .+14 ; 0x1059e 10590: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 10594: 82 30 cpi r24, 0x02 ; 2 10596: 19 f4 brne .+6 ; 0x1059e // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 10598: 81 e0 ldi r24, 0x01 ; 1 1059a: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 1059e: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 105a2: 81 30 cpi r24, 0x01 ; 1 105a4: 61 f4 brne .+24 ; 0x105be 105a6: 0e 94 27 69 call 0xd24e ; 0xd24e 105aa: 81 11 cpse r24, r1 105ac: 08 c0 rjmp .+16 ; 0x105be fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 105ae: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 105b2: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> 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 105b6: 81 e5 ldi r24, 0x51 ; 81 105b8: 91 e7 ldi r25, 0x71 ; 113 105ba: 0f 94 e0 0a call 0x215c0 ; 0x215c0 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 105be: 80 91 38 02 lds r24, 0x0238 ; 0x800238 105c2: 88 23 and r24, r24 105c4: 09 f4 brne .+2 ; 0x105c8 105c6: 6e c0 rjmp .+220 ; 0x106a4 105c8: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 105cc: 82 30 cpi r24, 0x02 ; 2 105ce: 09 f4 brne .+2 ; 0x105d2 105d0: 69 c0 rjmp .+210 ; 0x106a4 105d2: 8c e4 ldi r24, 0x4C ; 76 105d4: e8 2e mov r14, r24 105d6: 83 e0 ldi r24, 0x03 ; 3 105d8: f8 2e mov r15, r24 105da: fe 01 movw r30, r28 105dc: 31 96 adiw r30, 0x01 ; 1 105de: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 105e0: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 105e2: 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]) 105e4: f7 01 movw r30, r14 105e6: 91 91 ld r25, Z+ 105e8: 7f 01 movw r14, r30 105ea: f6 01 movw r30, r12 105ec: 81 91 ld r24, Z+ 105ee: 6f 01 movw r12, r30 105f0: 89 17 cp r24, r25 105f2: 68 f5 brcc .+90 ; 0x1064e { fan_speed_errors[fan] = 0; 105f4: f7 01 movw r30, r14 105f6: 31 97 sbiw r30, 0x01 ; 1 105f8: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 105fa: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 105fe: 82 30 cpi r24, 0x02 ; 2 10600: 31 f1 breq .+76 ; 0x1064e fan_check_error = EFCE_REPORTED; 10602: 00 93 de 03 sts 0x03DE, r16 ; 0x8003de if (printJobOngoing()) { 10606: 0e 94 d6 68 call 0xd1ac ; 0xd1ac 1060a: 88 23 and r24, r24 1060c: 81 f1 breq .+96 ; 0x1066e // A print is ongoing, pause the print normally if(!printingIsPaused()) { 1060e: 0e 94 cb 68 call 0xd196 ; 0xd196 10612: 81 11 cpse r24, r1 10614: 06 c0 rjmp .+12 ; 0x10622 if (usb_timer.running()) 10616: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1061a: 88 23 and r24, r24 1061c: 29 f1 breq .+74 ; 0x10668 lcd_pause_usb_print(); 1061e: 0f 94 52 2b call 0x256a4 ; 0x256a4 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 10622: 11 30 cpi r17, 0x01 ; 1 10624: 59 f1 breq .+86 ; 0x1067c //! 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); 10626: 85 ea ldi r24, 0xA5 ; 165 10628: 9a e7 ldi r25, 0x7A ; 122 1062a: 0e 94 97 7b call 0xf72e ; 0xf72e if (get_message_level() == 0) { 1062e: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> 10632: 81 11 cpse r24, r1 10634: 0c c0 rjmp .+24 ; 0x1064e Sound_MakeCustom(200,0,true); 10636: 41 e0 ldi r20, 0x01 ; 1 10638: 70 e0 ldi r23, 0x00 ; 0 1063a: 60 e0 ldi r22, 0x00 ; 0 1063c: 88 ec ldi r24, 0xC8 ; 200 1063e: 90 e0 ldi r25, 0x00 ; 0 10640: 0f 94 1a 69 call 0x2d234 ; 0x2d234 LCD_ALERTMESSAGERPGM(lcdMsg); 10644: 62 e0 ldi r22, 0x02 ; 2 10646: 81 ef ldi r24, 0xF1 ; 241 10648: 9b e6 ldi r25, 0x6B ; 107 1064a: 0f 94 bd 05 call 0x20b7a ; 0x20b7a 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++) 1064e: 11 30 cpi r17, 0x01 ; 1 10650: 49 f1 breq .+82 ; 0x106a4 10652: 11 e0 ldi r17, 0x01 ; 1 10654: c7 cf rjmp .-114 ; 0x105e4 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; 10656: 10 92 4c 03 sts 0x034C, r1 ; 0x80034c 1065a: 73 cf rjmp .-282 ; 0x10542 #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]++; 1065c: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 10660: 87 cf rjmp .-242 ; 0x10570 else fan_speed_errors[1] = 0; 10662: 10 92 4d 03 sts 0x034D, r1 ; 0x80034d 10666: 8c cf rjmp .-232 ; 0x10580 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 10668: 0f 94 61 3e call 0x27cc2 ; 0x27cc2 1066c: da cf rjmp .-76 ; 0x10622 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1066e: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 10672: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 10676: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db 1067a: d3 cf rjmp .-90 ; 0x10622 //! 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); 1067c: 8d ec ldi r24, 0xCD ; 205 1067e: 9a e7 ldi r25, 0x7A ; 122 10680: 0e 94 97 7b call 0xf72e ; 0xf72e if (get_message_level() == 0) { 10684: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> 10688: 81 11 cpse r24, r1 1068a: 0c c0 rjmp .+24 ; 0x106a4 Sound_MakeCustom(200,0,true); 1068c: 41 e0 ldi r20, 0x01 ; 1 1068e: 70 e0 ldi r23, 0x00 ; 0 10690: 60 e0 ldi r22, 0x00 ; 0 10692: 88 ec ldi r24, 0xC8 ; 200 10694: 90 e0 ldi r25, 0x00 ; 0 10696: 0f 94 1a 69 call 0x2d234 ; 0x2d234 LCD_ALERTMESSAGERPGM(lcdMsg); 1069a: 62 e0 ldi r22, 0x02 ; 2 1069c: 8d ed ldi r24, 0xDD ; 221 1069e: 9b e6 ldi r25, 0x6B ; 107 106a0: 0f 94 bd 05 call 0x20b7a ; 0x20b7a } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 106a4: 80 91 14 02 lds r24, 0x0214 ; 0x800214 106a8: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d //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(); 106ac: 0f 94 55 3e call 0x27caa ; 0x27caa 106b0: 60 93 99 17 sts 0x1799, r22 ; 0x801799 106b4: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 106b8: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 106bc: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c fan_measuring = false; 106c0: 10 92 33 05 sts 0x0533, r1 ; 0x800533 } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 106c4: 0f 90 pop r0 106c6: 0f 90 pop r0 106c8: df 91 pop r29 106ca: cf 91 pop r28 106cc: 1f 91 pop r17 106ce: 0f 91 pop r16 106d0: ff 90 pop r15 106d2: ef 90 pop r14 106d4: df 90 pop r13 106d6: 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(); 106d8: 0c 94 c3 77 jmp 0xef86 ; 0xef86 000106dc : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 106dc: cf 92 push r12 106de: df 92 push r13 106e0: ef 92 push r14 106e2: ff 92 push r15 106e4: 6b 01 movw r12, r22 106e6: 7c 01 movw r14, r24 la10c_orig_jerk = j; 106e8: c0 92 52 03 sts 0x0352, r12 ; 0x800352 106ec: d0 92 53 03 sts 0x0353, r13 ; 0x800353 106f0: e0 92 54 03 sts 0x0354, r14 ; 0x800354 106f4: f0 92 55 03 sts 0x0355, r15 ; 0x800355 if(la10c_mode != LA10C_LA10) 106f8: 80 91 6e 03 lds r24, 0x036E ; 0x80036e 106fc: 82 30 cpi r24, 0x02 ; 2 106fe: b1 f4 brne .+44 ; 0x1072c 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) 10700: 20 e0 ldi r18, 0x00 ; 0 10702: 30 e0 ldi r19, 0x00 ; 0 10704: 40 e9 ldi r20, 0x90 ; 144 10706: 50 e4 ldi r21, 0x40 ; 64 10708: c7 01 movw r24, r14 1070a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1070e: 87 ff sbrs r24, 7 10710: 14 c0 rjmp .+40 ; 0x1073a 10712: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 10716: 90 91 9c 06 lds r25, 0x069C ; 0x80069c 1071a: a0 91 9d 06 lds r26, 0x069D ; 0x80069d 1071e: b0 91 9e 06 lds r27, 0x069E ; 0x80069e 10722: 80 3d cpi r24, 0xD0 ; 208 10724: 97 40 sbci r25, 0x07 ; 7 10726: a1 05 cpc r26, r1 10728: b1 05 cpc r27, r1 1072a: 20 f5 brcc .+72 ; 0x10774 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 1072c: c7 01 movw r24, r14 1072e: b6 01 movw r22, r12 10730: ff 90 pop r15 10732: ef 90 pop r14 10734: df 90 pop r13 10736: cf 90 pop r12 10738: 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: 1073a: 2a e9 ldi r18, 0x9A ; 154 1073c: 39 e9 ldi r19, 0x99 ; 153 1073e: 49 e9 ldi r20, 0x99 ; 153 10740: 5e e3 ldi r21, 0x3E ; 62 10742: c7 01 movw r24, r14 10744: b6 01 movw r22, r12 10746: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1074a: 87 ff sbrs r24, 7 1074c: 0a c0 rjmp .+20 ; 0x10762 1074e: 20 e0 ldi r18, 0x00 ; 0 10750: 30 e0 ldi r19, 0x00 ; 0 10752: 48 e3 ldi r20, 0x38 ; 56 10754: 51 e4 ldi r21, 0x41 ; 65 10756: c7 01 movw r24, r14 10758: b6 01 movw r22, r12 1075a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1075e: 6b 01 movw r12, r22 10760: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 10762: 81 e2 ldi r24, 0x21 ; 33 10764: 9b e7 ldi r25, 0x7B ; 123 10766: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(j); 1076a: c7 01 movw r24, r14 1076c: b6 01 movw r22, r12 1076e: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 10772: dc cf rjmp .-72 ; 0x1072c // 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: 10774: 2a e9 ldi r18, 0x9A ; 154 10776: 39 e9 ldi r19, 0x99 ; 153 10778: 49 e9 ldi r20, 0x99 ; 153 1077a: 5e e3 ldi r21, 0x3E ; 62 1077c: c7 01 movw r24, r14 1077e: b6 01 movw r22, r12 10780: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 10784: 87 fd sbrc r24, 7 10786: e3 cf rjmp .-58 ; 0x1074e j < 4.5? j * 0.25 + 3.375: 10788: 20 e0 ldi r18, 0x00 ; 0 1078a: 30 e0 ldi r19, 0x00 ; 0 1078c: 40 e8 ldi r20, 0x80 ; 128 1078e: 5e e3 ldi r21, 0x3E ; 62 10790: c7 01 movw r24, r14 10792: b6 01 movw r22, r12 10794: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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: 10798: 20 e0 ldi r18, 0x00 ; 0 1079a: 30 e0 ldi r19, 0x00 ; 0 1079c: 48 e5 ldi r20, 0x58 ; 88 1079e: 50 e4 ldi r21, 0x40 ; 64 107a0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 107a4: dc cf rjmp .-72 ; 0x1075e 000107a6 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 107a6: cf 92 push r12 107a8: df 92 push r13 107aa: ef 92 push r14 107ac: ff 92 push r15 107ae: cf 93 push r28 if(mode == la10c_mode) return; 107b0: 90 91 6e 03 lds r25, 0x036E ; 0x80036e 107b4: 98 17 cp r25, r24 107b6: b9 f1 breq .+110 ; 0x10826 107b8: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 107ba: c0 90 52 03 lds r12, 0x0352 ; 0x800352 107be: d0 90 53 03 lds r13, 0x0353 ; 0x800353 107c2: e0 90 54 03 lds r14, 0x0354 ; 0x800354 107c6: f0 90 55 03 lds r15, 0x0355 ; 0x800355 107ca: 20 e0 ldi r18, 0x00 ; 0 107cc: 30 e0 ldi r19, 0x00 ; 0 107ce: a9 01 movw r20, r18 107d0: c7 01 movw r24, r14 107d2: b6 01 movw r22, r12 107d4: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 107d8: 88 23 and r24, r24 107da: 41 f0 breq .+16 ; 0x107ec cs.max_jerk[E_AXIS] = la10c_orig_jerk; 107dc: c0 92 bf 06 sts 0x06BF, r12 ; 0x8006bf 107e0: d0 92 c0 06 sts 0x06C0, r13 ; 0x8006c0 107e4: e0 92 c1 06 sts 0x06C1, r14 ; 0x8006c1 107e8: f0 92 c2 06 sts 0x06C2, r15 ; 0x8006c2 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 107ec: 84 e0 ldi r24, 0x04 ; 4 107ee: 9b e7 ldi r25, 0x7B ; 123 107f0: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 switch(mode) 107f4: c1 30 cpi r28, 0x01 ; 1 107f6: 11 f1 breq .+68 ; 0x1083c 107f8: e0 f0 brcs .+56 ; 0x10832 107fa: c2 30 cpi r28, 0x02 ; 2 107fc: 11 f1 breq .+68 ; 0x10842 { 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; 107fe: c0 93 6e 03 sts 0x036E, r28 ; 0x80036e // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 10802: 60 91 bf 06 lds r22, 0x06BF ; 0x8006bf 10806: 70 91 c0 06 lds r23, 0x06C0 ; 0x8006c0 1080a: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 1080e: 90 91 c2 06 lds r25, 0x06C2 ; 0x8006c2 10812: 0e 94 6e 83 call 0x106dc ; 0x106dc 10816: 60 93 bf 06 sts 0x06BF, r22 ; 0x8006bf 1081a: 70 93 c0 06 sts 0x06C0, r23 ; 0x8006c0 1081e: 80 93 c1 06 sts 0x06C1, r24 ; 0x8006c1 10822: 90 93 c2 06 sts 0x06C2, r25 ; 0x8006c2 } 10826: cf 91 pop r28 10828: ff 90 pop r15 1082a: ef 90 pop r14 1082c: df 90 pop r13 1082e: cf 90 pop r12 10830: 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; 10832: 8c ef ldi r24, 0xFC ; 252 10834: 9a e7 ldi r25, 0x7A ; 122 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10836: 0e 94 97 7b call 0xf72e ; 0xf72e 1083a: e1 cf rjmp .-62 ; 0x107fe SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 1083c: 88 ef ldi r24, 0xF8 ; 248 1083e: 9a e7 ldi r25, 0x7A ; 122 10840: fa cf rjmp .-12 ; 0x10836 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10842: 84 ef ldi r24, 0xF4 ; 244 10844: 9a e7 ldi r25, 0x7A ; 122 10846: f7 cf rjmp .-18 ; 0x10836 00010848 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 10848: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 disable_x(); 1084c: 17 9a sbi 0x02, 7 ; 2 1084e: ed e3 ldi r30, 0x3D ; 61 10850: f7 e0 ldi r31, 0x07 ; 7 10852: 10 82 st Z, r1 disable_y(); 10854: 16 9a sbi 0x02, 6 ; 2 10856: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 10858: 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); } 1085a: 80 e0 ldi r24, 0x00 ; 0 1085c: 0e 94 d3 83 call 0x107a6 ; 0x107a6 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 10860: 8f ef ldi r24, 0xFF ; 255 10862: 9f ef ldi r25, 0xFF ; 255 10864: 90 93 8a 02 sts 0x028A, r25 ; 0x80028a 10868: 80 93 89 02 sts 0x0289, r24 ; 0x800289 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 1086c: 2f ef ldi r18, 0xFF ; 255 1086e: 20 93 86 02 sts 0x0286, r18 ; 0x800286 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 10872: 90 93 8e 02 sts 0x028E, r25 ; 0x80028e 10876: 80 93 8d 02 sts 0x028D, r24 ; 0x80028d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 1087a: 20 93 85 02 sts 0x0285, r18 ; 0x800285 print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 1087e: 90 93 88 02 sts 0x0288, r25 ; 0x800288 10882: 80 93 87 02 sts 0x0287, r24 ; 0x800287 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 10886: 90 93 8c 02 sts 0x028C, r25 ; 0x80028c 1088a: 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(); } 1088e: 08 95 ret 00010890 : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 10890: 41 ed ldi r20, 0xD1 ; 209 10892: 50 e0 ldi r21, 0x00 ; 0 10894: 6f ea ldi r22, 0xAF ; 175 10896: 79 e7 ldi r23, 0x79 ; 121 10898: 8b e6 ldi r24, 0x6B ; 107 1089a: 96 e0 ldi r25, 0x06 ; 6 1089c: 0f 94 a9 da call 0x3b552 ; 0x3b552 // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 108a0: 0f 94 03 aa call 0x35406 ; 0x35406 #ifdef PIDTEMP updatePID(); 108a4: 0f 94 dd 4f call 0x29fba ; 0x29fba #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 108a8: 0f 94 b6 46 call 0x28d6c ; 0x28d6c #endif calculate_extruder_multipliers(); 108ac: 0e 94 ff 66 call 0xcdfe ; 0xcdfe SERIAL_ECHO_START; 108b0: 84 e1 ldi r24, 0x14 ; 20 108b2: 9b ea ldi r25, 0xAB ; 171 108b4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 108b8: 8d e8 ldi r24, 0x8D ; 141 108ba: 99 e7 ldi r25, 0x79 ; 121 108bc: 0c 94 97 7b jmp 0xf72e ; 0xf72e 000108c0 : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 108c0: cf 93 push r28 108c2: df 93 push r29 strcpy_P(cs.version, default_conf.version); 108c4: 6f ea ldi r22, 0xAF ; 175 108c6: 79 e7 ldi r23, 0x79 ; 121 108c8: 8b e6 ldi r24, 0x6B ; 107 108ca: 96 e0 ldi r25, 0x06 ; 6 108cc: 0f 94 c6 da call 0x3b58c ; 0x3b58c #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); 108d0: 41 ed ldi r20, 0xD1 ; 209 108d2: 50 e0 ldi r21, 0x00 ; 0 108d4: 64 e1 ldi r22, 0x14 ; 20 108d6: 70 e0 ldi r23, 0x00 ; 0 108d8: 8b e6 ldi r24, 0x6B ; 107 108da: 96 e0 ldi r25, 0x06 ; 6 108dc: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 108e0: 60 91 1d 05 lds r22, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> 108e4: 82 e0 ldi r24, 0x02 ; 2 108e6: 9d e0 ldi r25, 0x0D ; 13 108e8: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 } 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); 108ec: cb e8 ldi r28, 0x8B ; 139 108ee: 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); 108f0: 4a a5 ldd r20, Y+42 ; 0x2a 108f2: 5b a5 ldd r21, Y+43 ; 0x2b 108f4: 6c a5 ldd r22, Y+44 ; 0x2c 108f6: 7d a5 ldd r23, Y+45 ; 0x2d 108f8: 8e ef ldi r24, 0xFE ; 254 108fa: 9c e0 ldi r25, 0x0C ; 12 108fc: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 10900: 4e a5 ldd r20, Y+46 ; 0x2e 10902: 5f a5 ldd r21, Y+47 ; 0x2f 10904: 68 a9 ldd r22, Y+48 ; 0x30 10906: 79 a9 ldd r23, Y+49 ; 0x31 10908: 82 ea ldi r24, 0xA2 ; 162 1090a: 9c e0 ldi r25, 0x0C ; 12 1090c: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 10910: 4a a9 ldd r20, Y+50 ; 0x32 10912: 5b a9 ldd r21, Y+51 ; 0x33 10914: 6c a9 ldd r22, Y+52 ; 0x34 10916: 7d a9 ldd r23, Y+53 ; 0x35 10918: 8e e9 ldi r24, 0x9E ; 158 1091a: 9c e0 ldi r25, 0x0C ; 12 1091c: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 10920: 4e a9 ldd r20, Y+54 ; 0x36 10922: 5f a9 ldd r21, Y+55 ; 0x37 10924: 68 ad ldd r22, Y+56 ; 0x38 10926: 79 ad ldd r23, Y+57 ; 0x39 10928: 8a ef ldi r24, 0xFA ; 250 1092a: 9c e0 ldi r25, 0x0C ; 12 1092c: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 10930: 4a ad ldd r20, Y+58 ; 0x3a 10932: 5b ad ldd r21, Y+59 ; 0x3b 10934: 6c ad ldd r22, Y+60 ; 0x3c 10936: 7d ad ldd r23, Y+61 ; 0x3d 10938: 8a e9 ldi r24, 0x9A ; 154 1093a: 9c e0 ldi r25, 0x0C ; 12 1093c: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 10940: 6e ad ldd r22, Y+62 ; 0x3e 10942: 7f ad ldd r23, Y+63 ; 0x3f 10944: 88 e9 ldi r24, 0x98 ; 152 10946: 9c e0 ldi r25, 0x0C ; 12 10948: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 #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); 1094c: 40 e4 ldi r20, 0x40 ; 64 1094e: 50 e0 ldi r21, 0x00 ; 0 10950: 6a eb ldi r22, 0xBA ; 186 10952: 7c e0 ldi r23, 0x0C ; 12 10954: 8b ec ldi r24, 0xCB ; 203 10956: 92 e1 ldi r25, 0x12 ; 18 10958: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1095c: 40 91 0b 13 lds r20, 0x130B ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 10960: 50 91 0c 13 lds r21, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 10964: 60 91 0d 13 lds r22, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 10968: 70 91 0e 13 lds r23, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> 1096c: 86 eb ldi r24, 0xB6 ; 182 1096e: 9c e0 ldi r25, 0x0C ; 12 10970: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 10974: 40 91 0f 13 lds r20, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 10978: 50 91 10 13 lds r21, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 1097c: 60 91 11 13 lds r22, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 10980: 70 91 12 13 lds r23, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 10984: 82 eb ldi r24, 0xB2 ; 178 10986: 9c e0 ldi r25, 0x0C ; 12 10988: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 1098c: 40 91 13 13 lds r20, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 10990: 50 91 14 13 lds r21, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 10994: 60 91 15 13 lds r22, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 10998: 70 91 16 13 lds r23, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 1099c: 8e ea ldi r24, 0xAE ; 174 1099e: 9c e0 ldi r25, 0x0C ; 12 109a0: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 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; 109a4: 84 e1 ldi r24, 0x14 ; 20 109a6: 9b ea ldi r25, 0xAB ; 171 109a8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM("Settings Stored"); 109ac: 89 e3 ldi r24, 0x39 ; 57 109ae: 99 e7 ldi r25, 0x79 ; 121 } 109b0: df 91 pop r29 109b2: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 109b4: 0c 94 97 7b jmp 0xf72e ; 0xf72e 000109b8 : { cmdbuffer_front_already_processed = true; } void get_command() { 109b8: 2f 92 push r2 109ba: 3f 92 push r3 109bc: 4f 92 push r4 109be: 5f 92 push r5 109c0: 6f 92 push r6 109c2: 7f 92 push r7 109c4: 8f 92 push r8 109c6: 9f 92 push r9 109c8: af 92 push r10 109ca: bf 92 push r11 109cc: cf 92 push r12 109ce: df 92 push r13 109d0: ef 92 push r14 109d2: ff 92 push r15 109d4: 0f 93 push r16 109d6: 1f 93 push r17 109d8: cf 93 push r28 109da: df 93 push r29 109dc: cd b7 in r28, 0x3d ; 61 109de: de b7 in r29, 0x3e ; 62 109e0: a2 97 sbiw r28, 0x22 ; 34 109e2: 0f b6 in r0, 0x3f ; 63 109e4: f8 94 cli 109e6: de bf out 0x3e, r29 ; 62 109e8: 0f be out 0x3f, r0 ; 63 109ea: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 109ec: 8f e5 ldi r24, 0x5F ; 95 109ee: 90 e0 ldi r25, 0x00 ; 0 109f0: 0e 94 88 5d call 0xbb10 ; 0xbb10 109f4: 88 23 and r24, r24 109f6: 09 f4 brne .+2 ; 0x109fa 109f8: 91 c0 rjmp .+290 ; 0x10b1c return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 109fa: 0e 94 25 79 call 0xf24a ; 0xf24a 109fe: 8f 37 cpi r24, 0x7F ; 127 10a00: 91 05 cpc r25, r1 10a02: 61 f4 brne .+24 ; 0x10a1c // 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; 10a04: 80 91 92 04 lds r24, 0x0492 ; 0x800492 10a08: 90 91 93 04 lds r25, 0x0493 ; 0x800493 10a0c: 90 93 91 04 sts 0x0491, r25 ; 0x800491 10a10: 80 93 90 04 sts 0x0490, r24 ; 0x800490 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 10a14: 8a e2 ldi r24, 0x2A ; 42 10a16: 99 e7 ldi r25, 0x79 ; 121 10a18: 0e 94 97 7b call 0xf72e ; 0xf72e 10a1c: 1e 01 movw r2, r28 10a1e: 2f e1 ldi r18, 0x1F ; 31 10a20: 22 0e add r2, r18 10a22: 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; 10a24: dd 24 eor r13, r13 10a26: 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 10a28: 0e 94 25 79 call 0xf24a ; 0xf24a 10a2c: 18 16 cp r1, r24 10a2e: 19 06 cpc r1, r25 10a30: 0c f0 brlt .+2 ; 0x10a34 10a32: 68 c0 rjmp .+208 ; 0x10b04 10a34: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 10a38: 88 23 and r24, r24 10a3a: 29 f0 breq .+10 ; 0x10a46 10a3c: 0e 94 cb 68 call 0xd196 ; 0xd196 10a40: 88 23 and r24, r24 10a42: 09 f4 brne .+2 ; 0x10a46 10a44: 5f c0 rjmp .+190 ; 0x10b04 10a46: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 10a4a: 81 11 cpse r24, r1 10a4c: 5b c0 rjmp .+182 ; 0x10b04 #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 10a4e: 0f 94 18 d6 call 0x3ac30 ; 0x3ac30 if (rec < 0) continue; 10a52: 97 fd sbrc r25, 7 10a54: e9 cf rjmp .-46 ; 0x10a28 mp_handle_rx_char((uint8_t)rec); 10a56: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 10a58: 8f 3f cpi r24, 0xFF ; 255 10a5a: 09 f0 breq .+2 ; 0x10a5e 10a5c: 7b c0 rjmp .+246 ; 0x10b54 if (mp_cmd_count > 0) { 10a5e: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10a62: 88 23 and r24, r24 10a64: 09 f4 brne .+2 ; 0x10a68 10a66: 73 c0 rjmp .+230 ; 0x10b4e mp_cmd_active = 1; 10a68: d0 92 3d 03 sts 0x033D, r13 ; 0x80033d mp_cmd_count = 0; 10a6c: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e char c_res[2] = {0, 0}; 10a70: 1f 8e std Y+31, r1 ; 0x1f 10a72: 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) { 10a74: c0 90 41 03 lds r12, 0x0341 ; 0x800341 10a78: cc 20 and r12, r12 10a7a: b1 f2 breq .-84 ; 0x10a28 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]; 10a7c: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 10a80: 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) 10a82: 91 e0 ldi r25, 0x01 ; 1 10a84: 9c 15 cp r25, r12 10a86: 18 f4 brcc .+6 ; 0x10a8e out[i] = (char)mp_char_out_buf[i]; 10a88: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10a8c: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10a8e: 10 92 41 03 sts 0x0341, r1 ; 0x800341 10a92: 3a a2 std Y+34, r3 ; 0x22 10a94: 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]; 10a96: 89 a1 ldd r24, Y+33 ; 0x21 10a98: 82 19 sub r24, r2 10a9a: 8c 15 cp r24, r12 10a9c: 28 f6 brcc .-118 ; 0x10a28 10a9e: e9 a1 ldd r30, Y+33 ; 0x21 10aa0: fa a1 ldd r31, Y+34 ; 0x22 10aa2: 11 91 ld r17, Z+ 10aa4: fa a3 std Y+34, r31 ; 0x22 10aa6: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10aa8: 84 e4 ldi r24, 0x44 ; 68 10aaa: 93 e0 ldi r25, 0x03 ; 3 10aac: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> if (serial_char < 0) 10ab0: 17 fd sbrc r17, 7 10ab2: f1 cf rjmp .-30 ; 0x10a96 10ab4: 80 91 79 10 lds r24, 0x1079 ; 0x801079 10ab8: 90 91 7a 10 lds r25, 0x107A ; 0x80107a // 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' || 10abc: 1a 30 cpi r17, 0x0A ; 10 10abe: 09 f4 brne .+2 ; 0x10ac2 10ac0: 4a c1 rjmp .+660 ; 0x10d56 10ac2: 1d 30 cpi r17, 0x0D ; 13 10ac4: 09 f4 brne .+2 ; 0x10ac8 10ac6: 47 c1 rjmp .+654 ; 0x10d56 serial_char == '\r' || 10ac8: 8f 35 cpi r24, 0x5F ; 95 10aca: 91 05 cpc r25, r1 10acc: 0c f0 brlt .+2 ; 0x10ad0 10ace: 48 c1 rjmp .+656 ; 0x10d60 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; 10ad0: 1b 33 cpi r17, 0x3B ; 59 10ad2: 11 f4 brne .+4 ; 0x10ad8 10ad4: d0 92 43 03 sts 0x0343, r13 ; 0x800343 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10ad8: 20 91 43 03 lds r18, 0x0343 ; 0x800343 10adc: 21 11 cpse r18, r1 10ade: db cf rjmp .-74 ; 0x10a96 10ae0: 9c 01 movw r18, r24 10ae2: 2f 5f subi r18, 0xFF ; 255 10ae4: 3f 4f sbci r19, 0xFF ; 255 10ae6: 30 93 7a 10 sts 0x107A, r19 ; 0x80107a 10aea: 20 93 79 10 sts 0x1079, r18 ; 0x801079 10aee: 20 91 7b 10 lds r18, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 10af2: 30 91 7c 10 lds r19, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 10af6: 20 58 subi r18, 0x80 ; 128 10af8: 3f 4e sbci r19, 0xEF ; 239 10afa: 82 0f add r24, r18 10afc: 93 1f adc r25, r19 10afe: fc 01 movw r30, r24 10b00: 13 83 std Z+3, r17 ; 0x03 10b02: c9 cf rjmp .-110 ; 0x10a96 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10b04: 80 91 79 10 lds r24, 0x1079 ; 0x801079 10b08: 90 91 7a 10 lds r25, 0x107A ; 0x80107a 10b0c: 18 16 cp r1, r24 10b0e: 19 06 cpc r1, r25 10b10: 0c f4 brge .+2 ; 0x10b14 10b12: 56 c2 rjmp .+1196 ; 0x10fc0 SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10b14: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 10b18: 81 11 cpse r24, r1 10b1a: 66 c2 rjmp .+1228 ; 0x10fe8 prusa_statistics(6); } } #endif //SDSUPPORT } 10b1c: a2 96 adiw r28, 0x22 ; 34 10b1e: 0f b6 in r0, 0x3f ; 63 10b20: f8 94 cli 10b22: de bf out 0x3e, r29 ; 62 10b24: 0f be out 0x3f, r0 ; 63 10b26: cd bf out 0x3d, r28 ; 61 10b28: df 91 pop r29 10b2a: cf 91 pop r28 10b2c: 1f 91 pop r17 10b2e: 0f 91 pop r16 10b30: ff 90 pop r15 10b32: ef 90 pop r14 10b34: df 90 pop r13 10b36: cf 90 pop r12 10b38: bf 90 pop r11 10b3a: af 90 pop r10 10b3c: 9f 90 pop r9 10b3e: 8f 90 pop r8 10b40: 7f 90 pop r7 10b42: 6f 90 pop r6 10b44: 5f 90 pop r5 10b46: 4f 90 pop r4 10b48: 3f 90 pop r3 10b4a: 2f 90 pop r2 10b4c: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10b4e: d0 92 3e 03 sts 0x033E, r13 ; 0x80033e 10b52: 8e cf rjmp .-228 ; 0x10a70 return; } if (mp_cmd_active > 0) { 10b54: 30 91 3d 03 lds r19, 0x033D ; 0x80033d 10b58: 33 23 and r19, r19 10b5a: 09 f4 brne .+2 ; 0x10b5e 10b5c: 57 c0 rjmp .+174 ; 0x10c0c } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10b5e: 89 3f cpi r24, 0xF9 ; 249 10b60: 09 f4 brne .+2 ; 0x10b64 10b62: 3f c0 rjmp .+126 ; 0x10be2 10b64: 80 f5 brcc .+96 ; 0x10bc6 10b66: 86 3f cpi r24, 0xF6 ; 246 10b68: 09 f4 brne .+2 ; 0x10b6c 10b6a: 48 c0 rjmp .+144 ; 0x10bfc #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10b6c: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10b70: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10b72: 27 3f cpi r18, 0xF7 ; 247 10b74: 79 f1 breq .+94 ; 0x10bd4 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. 10b76: 85 ef ldi r24, 0xF5 ; 245 10b78: 98 e7 ldi r25, 0x78 ; 120 10b7a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 // 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); 10b7e: 80 ef ldi r24, 0xF0 ; 240 10b80: 98 e7 ldi r25, 0x78 ; 120 10b82: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 // Echo current state if (mp_config & MPConfig_Active) 10b86: 10 91 3c 03 lds r17, 0x033C ; 0x80033c SERIAL_ECHOPGM(" ON"); 10b8a: 8c ee ldi r24, 0xEC ; 236 10b8c: 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) 10b8e: 10 fd sbrc r17, 0 10b90: 02 c0 rjmp .+4 ; 0x10b96 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10b92: 87 ee ldi r24, 0xE7 ; 231 10b94: 98 e7 ldi r25, 0x78 ; 120 10b96: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if (mp_config & MPConfig_NoSpaces) 10b9a: 01 2f mov r16, r17 10b9c: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10b9e: 82 ee ldi r24, 0xE2 ; 226 10ba0: 98 e7 ldi r25, 0x78 ; 120 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10ba2: 11 fd sbrc r17, 1 10ba4: 02 c0 rjmp .+4 ; 0x10baa SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 10ba6: 8d ed ldi r24, 0xDD ; 221 10ba8: 98 e7 ldi r25, 0x78 ; 120 10baa: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM(""); 10bae: 8c ed ldi r24, 0xDC ; 220 10bb0: 98 e7 ldi r25, 0x78 ; 120 10bb2: 0e 94 97 7b call 0xf72e ; 0xf72e // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 10bb6: 00 23 and r16, r16 10bb8: 29 f1 breq .+74 ; 0x10c04 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10bba: 45 e4 ldi r20, 0x45 ; 69 10bbc: 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; 10bc0: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d 10bc4: 55 cf rjmp .-342 ; 0x10a70 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10bc6: 8a 3f cpi r24, 0xFA ; 250 10bc8: 41 f0 breq .+16 ; 0x10bda case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10bca: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10bce: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10bd0: 2b 3f cpi r18, 0xFB ; 251 10bd2: 89 f6 brne .-94 ; 0x10b76 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10bd4: 80 93 3c 03 sts 0x033C, r24 ; 0x80033c 10bd8: ce cf rjmp .-100 ; 0x10b76 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10bda: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10bde: 8e 7f andi r24, 0xFE ; 254 10be0: f9 cf rjmp .-14 ; 0x10bd4 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10be2: 10 92 41 03 sts 0x0341, r1 ; 0x800341 mp_cmd_active = MPCommand_None; 10be6: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d mp_config = MPConfig_None; 10bea: 10 92 3c 03 sts 0x033C, r1 ; 0x80033c mp_char_buf = 0; 10bee: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b mp_cmd_count = 0; 10bf2: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e mp_cmd_active = 0; mp_full_char_queue = 0; 10bf6: 10 92 3a 03 sts 0x033A, r1 ; 0x80033a 10bfa: bd cf rjmp .-134 ; 0x10b76 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10bfc: 80 91 3c 03 lds r24, 0x033C ; 0x80033c 10c00: 8d 7f andi r24, 0xFD ; 253 10c02: e8 cf rjmp .-48 ; 0x10bd4 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 10c04: 50 e2 ldi r21, 0x20 ; 32 10c06: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10c0a: da cf rjmp .-76 ; 0x10bc0 mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10c0c: 20 91 3e 03 lds r18, 0x033E ; 0x80033e 10c10: 40 91 3c 03 lds r20, 0x033C ; 0x80033c 10c14: 22 23 and r18, r18 10c16: 31 f1 breq .+76 ; 0x10c64 10c18: e0 91 41 03 lds r30, 0x0341 ; 0x800341 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 10c1c: 40 ff sbrs r20, 0 10c1e: 49 c0 rjmp .+146 ; 0x10cb2 if (mp_full_char_queue > 0) { 10c20: 30 91 3a 03 lds r19, 0x033A ; 0x80033a 10c24: 33 23 and r19, r19 10c26: 09 f4 brne .+2 ; 0x10c2a 10c28: 40 c0 rjmp .+128 ; 0x10caa #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; 10c2a: 21 e0 ldi r18, 0x01 ; 1 10c2c: 2e 0f add r18, r30 10c2e: 20 93 41 03 sts 0x0341, r18 ; 0x800341 10c32: ae 2f mov r26, r30 10c34: b0 e0 ldi r27, 0x00 ; 0 10c36: a1 5c subi r26, 0xC1 ; 193 10c38: bc 4f sbci r27, 0xFC ; 252 10c3a: ff ef ldi r31, 0xFF ; 255 10c3c: 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) { 10c3e: 50 91 3b 03 lds r21, 0x033B ; 0x80033b 10c42: 55 23 and r21, r21 10c44: 51 f0 breq .+20 ; 0x10c5a #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; 10c46: ee 5f subi r30, 0xFE ; 254 10c48: e0 93 41 03 sts 0x0341, r30 ; 0x800341 10c4c: e2 2f mov r30, r18 10c4e: f0 e0 ldi r31, 0x00 ; 0 10c50: e1 5c subi r30, 0xC1 ; 193 10c52: fc 4f sbci r31, 0xFC ; 252 10c54: 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; 10c56: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b } --mp_full_char_queue; 10c5a: 31 50 subi r19, 0x01 ; 1 10c5c: 30 93 3a 03 sts 0x033A, r19 ; 0x80033a return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 10c60: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e 10c64: e0 91 41 03 lds r30, 0x0341 ; 0x800341 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 10c68: 40 ff sbrs r20, 0 10c6a: 6c c0 rjmp .+216 ; 0x10d44 if (mp_full_char_queue > 0) { 10c6c: 20 91 3a 03 lds r18, 0x033A ; 0x80033a 10c70: 22 23 and r18, r18 10c72: 49 f1 breq .+82 ; 0x10cc6 #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; 10c74: 91 e0 ldi r25, 0x01 ; 1 10c76: 9e 0f add r25, r30 10c78: 90 93 41 03 sts 0x0341, r25 ; 0x800341 10c7c: ae 2f mov r26, r30 10c7e: b0 e0 ldi r27, 0x00 ; 0 10c80: a1 5c subi r26, 0xC1 ; 193 10c82: bc 4f sbci r27, 0xFC ; 252 10c84: 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) { 10c86: 80 91 3b 03 lds r24, 0x033B ; 0x80033b 10c8a: 88 23 and r24, r24 10c8c: 51 f0 breq .+20 ; 0x10ca2 #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; 10c8e: ee 5f subi r30, 0xFE ; 254 10c90: e0 93 41 03 sts 0x0341, r30 ; 0x800341 10c94: e9 2f mov r30, r25 10c96: f0 e0 ldi r31, 0x00 ; 0 10c98: e1 5c subi r30, 0xC1 ; 193 10c9a: fc 4f sbci r31, 0xFC ; 252 10c9c: 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; 10c9e: 10 92 3b 03 sts 0x033B, r1 ; 0x80033b } --mp_full_char_queue; 10ca2: 21 50 subi r18, 0x01 ; 1 10ca4: 20 93 3a 03 sts 0x033A, r18 ; 0x80033a 10ca8: e3 ce rjmp .-570 ; 0x10a70 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; 10caa: 22 e0 ldi r18, 0x02 ; 2 10cac: 20 93 3a 03 sts 0x033A, r18 ; 0x80033a 10cb0: d7 cf rjmp .-82 ; 0x10c60 #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; 10cb2: 21 e0 ldi r18, 0x01 ; 1 10cb4: 2e 0f add r18, r30 10cb6: 20 93 41 03 sts 0x0341, r18 ; 0x800341 10cba: f0 e0 ldi r31, 0x00 ; 0 10cbc: e1 5c subi r30, 0xC1 ; 193 10cbe: fc 4f sbci r31, 0xFC ; 252 10cc0: 5f ef ldi r21, 0xFF ; 255 10cc2: 50 83 st Z, r21 10cc4: cd cf rjmp .-102 ; 0x10c60 10cc6: a8 2f mov r26, r24 10cc8: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10cca: 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; 10ccc: 31 e0 ldi r19, 0x01 ; 1 10cce: af 30 cpi r26, 0x0F ; 15 10cd0: 29 f0 breq .+10 ; 0x10cdc 10cd2: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 10cd4: a0 50 subi r26, 0x00 ; 0 10cd6: be 4f sbci r27, 0xFE ; 254 10cd8: 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; 10cda: 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; 10cdc: 58 2f mov r21, r24 10cde: 50 7f andi r21, 0xF0 ; 240 10ce0: 50 3f cpi r21, 0xF0 ; 240 10ce2: 59 f4 brne .+22 ; 0x10cfa 10ce4: 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) { 10ce6: 30 ff sbrs r19, 0 10ce8: 13 c0 rjmp .+38 ; 0x10d10 ++mp_full_char_queue; 10cea: d0 92 3a 03 sts 0x033A, r13 ; 0x80033a if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10cee: 31 ff sbrs r19, 1 10cf0: 0c c0 rjmp .+24 ; 0x10d0a 10cf2: 82 e0 ldi r24, 0x02 ; 2 10cf4: 80 93 3a 03 sts 0x033A, r24 ; 0x80033a 10cf8: bb ce rjmp .-650 ; 0x10a70 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 10cfa: 82 95 swap r24 10cfc: 8f 70 andi r24, 0x0F ; 15 10cfe: a8 2f mov r26, r24 10d00: b0 e0 ldi r27, 0x00 ; 0 10d02: a0 50 subi r26, 0x00 ; 0 10d04: be 4f sbci r27, 0xFE ; 254 10d06: 2c 91 ld r18, X 10d08: ee cf rjmp .-36 ; 0x10ce6 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]; 10d0a: 20 93 3b 03 sts 0x033B, r18 ; 0x80033b 10d0e: b0 ce rjmp .-672 ; 0x10a70 #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: 81 e0 ldi r24, 0x01 ; 1 10d12: 8e 0f add r24, r30 10d14: 80 93 41 03 sts 0x0341, r24 ; 0x800341 10d18: ae 2f mov r26, r30 10d1a: b0 e0 ldi r27, 0x00 ; 0 10d1c: a1 5c subi r26, 0xC1 ; 193 10d1e: bc 4f sbci r27, 0xFC ; 252 10d20: 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') { 10d22: 4a 30 cpi r20, 0x0A ; 10 10d24: 09 f4 brne .+2 ; 0x10d28 10d26: a4 ce rjmp .-696 ; 0x10a70 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10d28: 31 ff sbrs r19, 1 10d2a: 03 c0 rjmp .+6 ; 0x10d32 10d2c: d0 92 3a 03 sts 0x033A, r13 ; 0x80033a 10d30: 9f ce rjmp .-706 ; 0x10a70 #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; 10d32: ee 5f subi r30, 0xFE ; 254 10d34: e0 93 41 03 sts 0x0341, r30 ; 0x800341 10d38: e8 2f mov r30, r24 10d3a: f0 e0 ldi r31, 0x00 ; 0 10d3c: e1 5c subi r30, 0xC1 ; 193 10d3e: fc 4f sbci r31, 0xFC ; 252 10d40: 20 83 st Z, r18 10d42: 96 ce rjmp .-724 ; 0x10a70 10d44: 91 e0 ldi r25, 0x01 ; 1 10d46: 9e 0f add r25, r30 10d48: 90 93 41 03 sts 0x0341, r25 ; 0x800341 10d4c: f0 e0 ldi r31, 0x00 ; 0 10d4e: e1 5c subi r30, 0xC1 ; 193 10d50: fc 4f sbci r31, 0xFC ; 252 10d52: 80 83 st Z, r24 10d54: 8d ce rjmp .-742 ; 0x10a70 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 10d56: 00 97 sbiw r24, 0x00 ; 0 10d58: 19 f4 brne .+6 ; 0x10d60 comment_mode = false; //for new command 10d5a: 10 92 43 03 sts 0x0343, r1 ; 0x800343 10d5e: de ce rjmp .-580 ; 0x10b1c 10d60: 00 91 7b 10 lds r16, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 10d64: 10 91 7c 10 lds r17, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 10d68: 0d 57 subi r16, 0x7D ; 125 10d6a: 1f 4e sbci r17, 0xEF ; 239 10d6c: 80 0f add r24, r16 10d6e: 91 1f adc r25, r17 10d70: fc 01 movw r30, r24 10d72: 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) 10d74: 1a 83 std Y+2, r17 ; 0x02 10d76: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10d78: 80 91 43 03 lds r24, 0x0343 ; 0x800343 10d7c: 81 11 cpse r24, r1 10d7e: 03 c1 rjmp .+518 ; 0x10f86 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10d80: f8 01 movw r30, r16 10d82: 80 81 ld r24, Z 10d84: 8e 34 cpi r24, 0x4E ; 78 10d86: 09 f0 breq .+2 ; 0x10d8a 10d88: 8a c0 rjmp .+276 ; 0x10e9e // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10d8a: 4a e0 ldi r20, 0x0A ; 10 10d8c: 50 e0 ldi r21, 0x00 ; 0 10d8e: be 01 movw r22, r28 10d90: 6f 5f subi r22, 0xFF ; 255 10d92: 7f 4f sbci r23, 0xFF ; 255 10d94: c8 01 movw r24, r16 10d96: 01 96 adiw r24, 0x01 ; 1 10d98: 0f 94 9a d8 call 0x3b134 ; 0x3b134 10d9c: 2b 01 movw r4, r22 10d9e: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10da0: e9 80 ldd r14, Y+1 ; 0x01 10da2: fa 80 ldd r15, Y+2 ; 0x02 10da4: f7 01 movw r30, r14 10da6: 80 81 ld r24, Z 10da8: 80 32 cpi r24, 0x20 ; 32 10daa: 31 f4 brne .+12 ; 0x10db8 10dac: ff ef ldi r31, 0xFF ; 255 10dae: ef 1a sub r14, r31 10db0: ff 0a sbc r15, r31 10db2: fa 82 std Y+2, r15 ; 0x02 10db4: e9 82 std Y+1, r14 ; 0x01 10db6: f4 cf rjmp .-24 ; 0x10da0 // 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)) { 10db8: 80 90 78 03 lds r8, 0x0378 ; 0x800378 10dbc: 90 90 79 03 lds r9, 0x0379 ; 0x800379 10dc0: a0 90 7a 03 lds r10, 0x037A ; 0x80037a 10dc4: b0 90 7b 03 lds r11, 0x037B ; 0x80037b 10dc8: d5 01 movw r26, r10 10dca: c4 01 movw r24, r8 10dcc: 01 96 adiw r24, 0x01 ; 1 10dce: a1 1d adc r26, r1 10dd0: b1 1d adc r27, r1 10dd2: 84 15 cp r24, r4 10dd4: 95 05 cpc r25, r5 10dd6: a6 05 cpc r26, r6 10dd8: b7 05 cpc r27, r7 10dda: 49 f0 breq .+18 ; 0x10dee 10ddc: 44 e0 ldi r20, 0x04 ; 4 10dde: 50 e0 ldi r21, 0x00 ; 0 10de0: 65 e2 ldi r22, 0x25 ; 37 10de2: 79 e7 ldi r23, 0x79 ; 121 10de4: c7 01 movw r24, r14 10de6: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 10dea: 89 2b or r24, r25 10dec: a1 f4 brne .+40 ; 0x10e16 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10dee: 6a e2 ldi r22, 0x2A ; 42 10df0: 70 e0 ldi r23, 0x00 ; 0 10df2: c7 01 movw r24, r14 10df4: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc 10df8: 90 93 94 03 sts 0x0394, r25 ; 0x800394 10dfc: 80 93 93 03 sts 0x0393, r24 ; 0x800393 10e00: 00 97 sbiw r24, 0x00 ; 0 10e02: 09 f4 brne .+2 ; 0x10e06 10e04: 45 c0 rjmp .+138 ; 0x10e90 10e06: f8 01 movw r30, r16 { byte checksum = 0; 10e08: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10e0a: e8 17 cp r30, r24 10e0c: f9 07 cpc r31, r25 10e0e: 71 f0 breq .+28 ; 0x10e2c checksum = checksum^(*p++); 10e10: 21 91 ld r18, Z+ 10e12: f2 26 eor r15, r18 10e14: fa cf rjmp .-12 ; 0x10e0a 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; 10e16: 8c ee ldi r24, 0xEC ; 236 10e18: 9a ea ldi r25, 0xAA ; 170 10e1a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10e1e: 88 ec ldi r24, 0xC8 ; 200 10e20: 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 10e22: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 10e26: c5 01 movw r24, r10 10e28: b4 01 movw r22, r8 10e2a: 15 c0 rjmp .+42 ; 0x10e56 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10e2c: 0e 94 ac 5c call 0xb958 ; 0xb958 10e30: f8 16 cp r15, r24 10e32: 19 06 cpc r1, r25 10e34: d9 f0 breq .+54 ; 0x10e6c SERIAL_ERROR_START; 10e36: 8c ee ldi r24, 0xEC ; 236 10e38: 9a ea ldi r25, 0xAA ; 170 10e3a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10e3e: 89 ea ldi r24, 0xA9 ; 169 10e40: 96 e6 ldi r25, 0x66 ; 102 10e42: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 10e46: 60 91 78 03 lds r22, 0x0378 ; 0x800378 10e4a: 70 91 79 03 lds r23, 0x0379 ; 0x800379 10e4e: 80 91 7a 03 lds r24, 0x037A ; 0x80037a 10e52: 90 91 7b 03 lds r25, 0x037B ; 0x80037b 10e56: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10e5a: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10e5e: 0e 94 c4 5c call 0xb988 ; 0xb988 serial_count = 0; 10e62: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 10e66: 10 92 79 10 sts 0x1079, r1 ; 0x801079 10e6a: 58 ce rjmp .-848 ; 0x10b1c return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10e6c: e0 91 93 03 lds r30, 0x0393 ; 0x800393 10e70: f0 91 94 03 lds r31, 0x0394 ; 0x800394 10e74: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 10e76: e9 80 ldd r14, Y+1 ; 0x01 10e78: fa 80 ldd r15, Y+2 ; 0x02 10e7a: 60 e2 ldi r22, 0x20 ; 32 10e7c: 79 e7 ldi r23, 0x79 ; 121 10e7e: c7 01 movw r24, r14 10e80: 0f 94 bd da call 0x3b57a ; 0x3b57a 10e84: 89 2b or r24, r25 10e86: 39 f5 brne .+78 ; 0x10ed6 kill(MSG_M112_KILL); 10e88: 83 ee ldi r24, 0xE3 ; 227 10e8a: 99 e6 ldi r25, 0x69 ; 105 10e8c: 0e 94 26 7c call 0xf84c ; 0xf84c // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10e90: 8c ee ldi r24, 0xEC ; 236 10e92: 9a ea ldi r25, 0xAA ; 170 10e94: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10e98: 8f e7 ldi r24, 0x7F ; 127 10e9a: 96 e6 ldi r25, 0x66 ; 102 10e9c: c2 cf rjmp .-124 ; 0x10e22 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10e9e: 89 81 ldd r24, Y+1 ; 0x01 10ea0: 9a 81 ldd r25, Y+2 ; 0x02 10ea2: fc 01 movw r30, r24 10ea4: 20 81 ld r18, Z 10ea6: 20 32 cpi r18, 0x20 ; 32 10ea8: 21 f4 brne .+8 ; 0x10eb2 10eaa: 01 96 adiw r24, 0x01 ; 1 10eac: 9a 83 std Y+2, r25 ; 0x02 10eae: 89 83 std Y+1, r24 ; 0x01 10eb0: f6 cf rjmp .-20 ; 0x10e9e // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10eb2: 6a e2 ldi r22, 0x2A ; 42 10eb4: 70 e0 ldi r23, 0x00 ; 0 10eb6: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc 10eba: 89 2b or r24, r25 10ebc: 39 f0 breq .+14 ; 0x10ecc { SERIAL_ERROR_START; 10ebe: 8c ee ldi r24, 0xEC ; 236 10ec0: 9a ea ldi r25, 0xAA ; 170 10ec2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10ec6: 85 e5 ldi r24, 0x55 ; 85 10ec8: 96 e6 ldi r25, 0x66 ; 102 10eca: bb cf rjmp .-138 ; 0x10e42 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 10ecc: 44 24 eor r4, r4 10ece: 4a 94 dec r4 10ed0: 54 2c mov r5, r4 10ed2: 32 01 movw r6, r4 10ed4: d0 cf rjmp .-96 ; 0x10e76 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) 10ed6: 44 e0 ldi r20, 0x04 ; 4 10ed8: 50 e0 ldi r21, 0x00 ; 0 10eda: 6b e1 ldi r22, 0x1B ; 27 10edc: 79 e7 ldi r23, 0x79 ; 121 10ede: c7 01 movw r24, r14 10ee0: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 10ee4: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10ee6: f7 01 movw r30, r14 10ee8: 80 81 ld r24, Z 10eea: 87 34 cpi r24, 0x47 ; 71 10eec: 81 f4 brne .+32 ; 0x10f0e 10eee: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 10ef2: 85 30 cpi r24, 0x05 ; 5 10ef4: 61 f0 breq .+24 ; 0x10f0e usb_timer.start(); 10ef6: 8e e0 ldi r24, 0x0E ; 14 10ef8: 95 e0 ldi r25, 0x05 ; 5 10efa: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10efe: f6 e0 ldi r31, 0x06 ; 6 10f00: f0 93 64 0e sts 0x0E64, r31 ; 0x800e64 <_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); 10f04: 60 e0 ldi r22, 0x00 ; 0 10f06: 85 ea ldi r24, 0xA5 ; 165 10f08: 9f e0 ldi r25, 0x0F ; 15 10f0a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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) { 10f0e: ab 28 or r10, r11 10f10: 21 f0 breq .+8 ; 0x10f1a 10f12: 80 91 11 05 lds r24, 0x0511 ; 0x800511 10f16: 81 11 cpse r24, r1 10f18: a4 cf rjmp .-184 ; 0x10e62 } // 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; 10f1a: 26 e0 ldi r18, 0x06 ; 6 10f1c: 77 fc sbrc r7, 7 10f1e: 21 e0 ldi r18, 0x01 ; 1 10f20: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 10f24: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 10f28: fc 01 movw r30, r24 10f2a: e0 58 subi r30, 0x80 ; 128 10f2c: ff 4e sbci r31, 0xEF ; 239 10f2e: 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) 10f30: 49 81 ldd r20, Y+1 ; 0x01 10f32: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10f34: 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) 10f36: da 01 movw r26, r20 10f38: 40 17 cp r20, r16 10f3a: 51 07 cpc r21, r17 10f3c: a1 f5 brne .+104 ; 0x10fa6 cmd_len = strlen(cmd_start) + 1; 10f3e: 01 90 ld r0, Z+ 10f40: 00 20 and r0, r0 10f42: e9 f7 brne .-6 ; 0x10f3e 10f44: 9f 01 movw r18, r30 10f46: 20 1b sub r18, r16 10f48: 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; 10f4a: 03 96 adiw r24, 0x03 ; 3 10f4c: 28 0f add r18, r24 10f4e: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10f50: 2d 3e cpi r18, 0xED ; 237 10f52: f1 e0 ldi r31, 0x01 ; 1 10f54: 3f 07 cpc r19, r31 10f56: 79 f1 breq .+94 ; 0x10fb6 // 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; 10f58: 30 93 7c 10 sts 0x107C, r19 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 10f5c: 20 93 7b 10 sts 0x107B, r18 ; 0x80107b <_ZL7bufindw.lto_priv.568> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10f60: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 10f64: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 10f68: 01 96 adiw r24, 0x01 ; 1 10f6a: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f 10f6e: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e // Update the processed gcode line if (gcode_N >= 0) 10f72: 77 fc sbrc r7, 7 10f74: 08 c0 rjmp .+16 ; 0x10f86 gcode_LastN = gcode_N; 10f76: 40 92 78 03 sts 0x0378, r4 ; 0x800378 10f7a: 50 92 79 03 sts 0x0379, r5 ; 0x800379 10f7e: 60 92 7a 03 sts 0x037A, r6 ; 0x80037a 10f82: 70 92 7b 03 sts 0x037B, r7 ; 0x80037b SERIAL_ECHOPGM("Number of commands in the buffer: "); SERIAL_ECHO(buflen); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } // end of 'not comment mode' serial_count = 0; //clear buffer 10f86: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 10f8a: 10 92 79 10 sts 0x1079, r1 ; 0x801079 // 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)) 10f8e: 0e 94 25 79 call 0xf24a ; 0xf24a 10f92: 89 2b or r24, r25 10f94: 09 f4 brne .+2 ; 0x10f98 10f96: c2 cd rjmp .-1148 ; 0x10b1c 10f98: 8f e5 ldi r24, 0x5F ; 95 10f9a: 90 e0 ldi r25, 0x00 ; 0 10f9c: 0e 94 88 5d call 0xbb10 ; 0xbb10 10fa0: 81 11 cpse r24, r1 10fa2: 79 cd rjmp .-1294 ; 0x10a96 10fa4: bb cd rjmp .-1162 ; 0x10b1c 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]; } 10fa6: 6d 91 ld r22, X+ 10fa8: 61 93 st Z+, r22 10faa: 9d 01 movw r18, r26 10fac: 24 1b sub r18, r20 10fae: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10fb0: 61 11 cpse r22, r1 10fb2: f9 cf rjmp .-14 ; 0x10fa6 10fb4: ca cf rjmp .-108 ; 0x10f4a } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10fb6: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 10fba: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.568> 10fbe: d0 cf rjmp .-96 ; 0x10f60 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10fc0: 60 ed ldi r22, 0xD0 ; 208 10fc2: 77 e0 ldi r23, 0x07 ; 7 10fc4: 84 e4 ldi r24, 0x44 ; 68 10fc6: 93 e0 ldi r25, 0x03 ; 3 10fc8: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 10fcc: 88 23 and r24, r24 10fce: 09 f4 brne .+2 ; 0x10fd2 10fd0: a1 cd rjmp .-1214 ; 0x10b14 comment_mode = false; 10fd2: 10 92 43 03 sts 0x0343, r1 ; 0x800343 serial_count = 0; 10fd6: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 10fda: 10 92 79 10 sts 0x1079, r1 ; 0x801079 SERIAL_ECHOLNPGM("RX timeout"); 10fde: 80 e1 ldi r24, 0x10 ; 16 10fe0: 99 e7 ldi r25, 0x79 ; 121 10fe2: 0e 94 97 7b call 0xf72e ; 0xf72e 10fe6: 9a cd rjmp .-1228 ; 0x10b1c return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10fe8: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 10fec: 88 23 and r24, r24 10fee: 09 f4 brne .+2 ; 0x10ff2 10ff0: 95 cd rjmp .-1238 ; 0x10b1c 10ff2: 80 91 79 10 lds r24, 0x1079 ; 0x801079 10ff6: 90 91 7a 10 lds r25, 0x107A ; 0x80107a 10ffa: 89 2b or r24, r25 10ffc: 09 f0 breq .+2 ; 0x11000 10ffe: 8e cd rjmp .-1252 ; 0x10b1c //'#' 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; 11000: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 11004: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 11008: 89 2b or r24, r25 1100a: 11 f4 brne .+4 ; 0x11010 1100c: 10 92 42 03 sts 0x0342, r1 ; 0x800342 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 11010: 28 e7 ldi r18, 0x78 ; 120 11012: e2 2e mov r14, r18 11014: 20 e1 ldi r18, 0x10 ; 16 11016: 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; 11018: 32 e0 ldi r19, 0x02 ; 2 1101a: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 1101c: cc 24 eor r12, r12 1101e: 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) { 11020: 40 91 7f 17 lds r20, 0x177F ; 0x80177f 11024: 50 91 80 17 lds r21, 0x1780 ; 0x801780 11028: 60 91 81 17 lds r22, 0x1781 ; 0x801781 1102c: 70 91 82 17 lds r23, 0x1782 ; 0x801782 11030: 80 91 78 17 lds r24, 0x1778 ; 0x801778 11034: 90 91 79 17 lds r25, 0x1779 ; 0x801779 11038: a0 91 7a 17 lds r26, 0x177A ; 0x80177a 1103c: b0 91 7b 17 lds r27, 0x177B ; 0x80177b 11040: 48 17 cp r20, r24 11042: 59 07 cpc r21, r25 11044: 6a 07 cpc r22, r26 11046: 7b 07 cpc r23, r27 11048: 08 f0 brcs .+2 ; 0x1104c 1104a: 2f c1 rjmp .+606 ; 0x112aa 1104c: 80 91 42 03 lds r24, 0x0342 ; 0x800342 11050: 81 11 cpse r24, r1 11052: 2b c1 rjmp .+598 ; 0x112aa : "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() ){ 11054: 0f 94 22 7b call 0x2f644 ; 0x2f644 11058: 88 23 and r24, r24 1105a: 49 f1 breq .+82 ; 0x110ae 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; 1105c: 20 91 16 17 lds r18, 0x1716 ; 0x801716 11060: 30 91 17 17 lds r19, 0x1717 ; 0x801717 // 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; 11064: 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; 11066: 9b ef ldi r25, 0xFB ; 251 11068: 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 == ';' ){ 1106a: f8 01 movw r30, r16 1106c: 80 81 ld r24, Z 1106e: 8b 33 cpi r24, 0x3B ; 59 11070: 51 f5 brne .+84 ; 0x110c6 // 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); 11072: f8 01 movw r30, r16 00011074 : 11074: 61 91 ld r22, Z+ 11076: 6a 30 cpi r22, 0x0A ; 10 11078: e9 f7 brne .-6 ; 0x11074 1107a: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 1107c: cf 01 movw r24, r30 1107e: 88 57 subi r24, 0x78 ; 120 11080: 9e 40 sbci r25, 0x0E ; 14 11082: 81 30 cpi r24, 0x01 ; 1 11084: 92 40 sbci r25, 0x02 ; 2 11086: d4 f0 brlt .+52 ; 0x110bc // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 11088: c8 01 movw r24, r16 1108a: 82 1b sub r24, r18 1108c: 93 0b sbc r25, r19 1108e: 01 97 sbiw r24, 0x01 ; 1 11090: 0f 94 13 7b call 0x2f626 ; 0x2f626 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 11094: 8b ef ldi r24, 0xFB ; 251 11096: 96 e1 ldi r25, 0x16 ; 22 11098: 0f 94 14 6c call 0x2d828 ; 0x2d828 1109c: 88 23 and r24, r24 1109e: 39 f0 breq .+14 ; 0x110ae if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 110a0: 0f 94 22 7b call 0x2f644 ; 0x2f644 rdPtr = start = blockBuffBegin; 110a4: 28 e7 ldi r18, 0x78 ; 120 110a6: 3e e0 ldi r19, 0x0E ; 14 110a8: 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 110aa: 81 11 cpse r24, r1 110ac: e2 cf rjmp .-60 ; 0x11072 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 110ae: f0 92 17 17 sts 0x1717, r15 ; 0x801717 110b2: e0 92 16 17 sts 0x1716, r14 ; 0x801716 return -1; 110b6: 0f ef ldi r16, 0xFF ; 255 110b8: 1f ef ldi r17, 0xFF ; 255 110ba: 37 c0 rjmp .+110 ; 0x1112a 110bc: 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){ 110be: b1 10 cpse r11, r1 110c0: d5 c0 rjmp .+426 ; 0x1126c // 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 110c2: 01 50 subi r16, 0x01 ; 1 110c4: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 110c6: c8 01 movw r24, r16 110c8: 82 1b sub r24, r18 110ca: 93 0b sbc r25, r19 110cc: 01 96 adiw r24, 0x01 ; 1 110ce: 0f 94 13 7b call 0x2f626 ; 0x2f626 int16_t rv = *rdPtr++; 110d2: c8 01 movw r24, r16 110d4: 01 96 adiw r24, 0x01 ; 1 110d6: f8 01 movw r30, r16 110d8: 00 81 ld r16, Z 110da: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 110dc: 80 90 03 17 lds r8, 0x1703 ; 0x801703 110e0: 90 90 04 17 lds r9, 0x1704 ; 0x801704 110e4: a0 90 05 17 lds r10, 0x1705 ; 0x801705 110e8: b0 90 06 17 lds r11, 0x1706 ; 0x801706 110ec: 40 91 0c 17 lds r20, 0x170C ; 0x80170c 110f0: 50 91 0d 17 lds r21, 0x170D ; 0x80170d 110f4: 60 91 0e 17 lds r22, 0x170E ; 0x80170e 110f8: 70 91 0f 17 lds r23, 0x170F ; 0x80170f 110fc: 84 16 cp r8, r20 110fe: 95 06 cpc r9, r21 11100: a6 06 cpc r10, r22 11102: b7 06 cpc r11, r23 11104: a0 f6 brcc .-88 ; 0x110ae // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 11106: 9c 01 movw r18, r24 11108: 28 57 subi r18, 0x78 ; 120 1110a: 3e 40 sbci r19, 0x0E ; 14 1110c: 21 15 cp r18, r1 1110e: 32 40 sbci r19, 0x02 ; 2 11110: 44 f0 brlt .+16 ; 0x11122 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 11112: 8b ef ldi r24, 0xFB ; 251 11114: 96 e1 ldi r25, 0x16 ; 22 11116: 0f 94 14 6c call 0x2d828 ; 0x2d828 1111a: 88 23 and r24, r24 1111c: 41 f2 breq .-112 ; 0x110ae // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 1111e: 88 e7 ldi r24, 0x78 ; 120 11120: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 11122: 90 93 17 17 sts 0x1717, r25 ; 0x801717 11126: 80 93 16 17 sts 0x1716, r24 ; 0x801716 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_;} 1112a: 40 91 03 17 lds r20, 0x1703 ; 0x801703 1112e: 50 91 04 17 lds r21, 0x1704 ; 0x801704 11132: 60 91 05 17 lds r22, 0x1705 ; 0x801705 11136: 70 91 06 17 lds r23, 0x1706 ; 0x801706 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(); 1113a: 40 93 7f 17 sts 0x177F, r20 ; 0x80177f 1113e: 50 93 80 17 sts 0x1780, r21 ; 0x801780 11142: 60 93 81 17 sts 0x1781, r22 ; 0x801781 11146: 70 93 82 17 sts 0x1782, r23 ; 0x801782 1114a: 80 91 79 10 lds r24, 0x1079 ; 0x801079 1114e: 90 91 7a 10 lds r25, 0x107A ; 0x80107a int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 11152: 0a 30 cpi r16, 0x0A ; 10 11154: 61 f0 breq .+24 ; 0x1116e || serial_char == '\r' 11156: 0d 30 cpi r16, 0x0D ; 13 11158: 51 f0 breq .+20 ; 0x1116e || serial_char == '#' 1115a: 03 32 cpi r16, 0x23 ; 35 1115c: 09 f4 brne .+2 ; 0x11160 1115e: 8c c0 rjmp .+280 ; 0x11278 || serial_count >= (MAX_CMD_SIZE - 1) 11160: 8f 35 cpi r24, 0x5F ; 95 11162: 91 05 cpc r25, r1 11164: 3c f4 brge .+14 ; 0x11174 || n==-1 11166: 0f 3f cpi r16, 0xFF ; 255 11168: 10 07 cpc r17, r16 1116a: 09 f0 breq .+2 ; 0x1116e 1116c: 8c c0 rjmp .+280 ; 0x11286 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 1116e: 00 97 sbiw r24, 0x00 ; 0 11170: 09 f4 brne .+2 ; 0x11174 11172: d4 cc rjmp .-1624 ; 0x10b1c 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); }; 11174: 20 91 fe 16 lds r18, 0x16FE ; 0x8016fe 11178: 21 11 cpse r18, r1 1117a: 03 c0 rjmp .+6 ; 0x11182 1117c: 40 e0 ldi r20, 0x00 ; 0 1117e: 50 e0 ldi r21, 0x00 ; 0 11180: 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; 11182: 20 91 80 03 lds r18, 0x0380 ; 0x800380 11186: 30 91 81 03 lds r19, 0x0381 ; 0x800381 1118a: 42 1b sub r20, r18 1118c: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 1118e: a0 91 7b 10 lds r26, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 11192: b0 91 7c 10 lds r27, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 11196: fd 01 movw r30, r26 11198: e0 58 subi r30, 0x80 ; 128 1119a: ff 4e sbci r31, 0xEF ; 239 1119c: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 1119e: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 111a0: 52 83 std Z+2, r21 ; 0x02 111a2: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 111a4: 80 58 subi r24, 0x80 ; 128 111a6: 9f 4e sbci r25, 0xEF ; 239 111a8: fc 01 movw r30, r24 111aa: ea 0f add r30, r26 111ac: fb 1f adc r31, r27 111ae: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 111b0: a0 58 subi r26, 0x80 ; 128 111b2: bf 4e sbci r27, 0xEF ; 239 111b4: fd 01 movw r30, r26 111b6: 01 90 ld r0, Z+ 111b8: 00 20 and r0, r0 111ba: e9 f7 brne .-6 ; 0x111b6 111bc: 31 97 sbiw r30, 0x01 ; 1 111be: ea 1b sub r30, r26 111c0: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 111c2: 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; 111c4: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 111c8: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 111cc: 01 96 adiw r24, 0x01 ; 1 111ce: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f 111d2: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e 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); 111d6: 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; 111d8: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 111dc: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 111e0: e8 0f add r30, r24 111e2: f9 2f mov r31, r25 111e4: f1 1d adc r31, r1 111e6: f0 93 7c 10 sts 0x107C, r31 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 111ea: e0 93 7b 10 sts 0x107B, r30 ; 0x80107b <_ZL7bufindw.lto_priv.568> 111ee: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 111f2: 88 23 and r24, r24 111f4: 09 f4 brne .+2 ; 0x111f8 111f6: 43 c0 rjmp .+134 ; 0x1127e 111f8: 80 91 7f 17 lds r24, 0x177F ; 0x80177f 111fc: 90 91 80 17 lds r25, 0x1780 ; 0x801780 11200: a0 91 81 17 lds r26, 0x1781 ; 0x801781 11204: b0 91 82 17 lds r27, 0x1782 ; 0x801782 sdpos_atomic = card.get_sdpos(); 11208: 80 93 80 03 sts 0x0380, r24 ; 0x800380 1120c: 90 93 81 03 sts 0x0381, r25 ; 0x800381 11210: a0 93 82 03 sts 0x0382, r26 ; 0x800382 11214: b0 93 83 03 sts 0x0383, r27 ; 0x800383 if (bufindw == sizeof(cmdbuffer)) 11218: ed 3e cpi r30, 0xED ; 237 1121a: f1 40 sbci r31, 0x01 ; 1 1121c: 21 f4 brne .+8 ; 0x11226 bufindw = 0; 1121e: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 11222: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.568> sei(); 11226: 78 94 sei comment_mode = false; //for new command 11228: 10 92 43 03 sts 0x0343, r1 ; 0x800343 serial_count = 0; //clear buffer 1122c: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 11230: 10 92 79 10 sts 0x1079, r1 ; 0x801079 if(card.eof()) break; 11234: 40 91 7f 17 lds r20, 0x177F ; 0x80177f 11238: 50 91 80 17 lds r21, 0x1780 ; 0x801780 1123c: 60 91 81 17 lds r22, 0x1781 ; 0x801781 11240: 70 91 82 17 lds r23, 0x1782 ; 0x801782 11244: 80 91 78 17 lds r24, 0x1778 ; 0x801778 11248: 90 91 79 17 lds r25, 0x1779 ; 0x801779 1124c: a0 91 7a 17 lds r26, 0x177A ; 0x80177a 11250: b0 91 7b 17 lds r27, 0x177B ; 0x80177b 11254: 48 17 cp r20, r24 11256: 59 07 cpc r21, r25 11258: 6a 07 cpc r22, r26 1125a: 7b 07 cpc r23, r27 1125c: 30 f5 brcc .+76 ; 0x112aa // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 1125e: 8f e5 ldi r24, 0x5F ; 95 11260: 90 e0 ldi r25, 0x00 ; 0 11262: 0e 94 88 5d call 0xbb10 ; 0xbb10 11266: 81 11 cpse r24, r1 11268: db ce rjmp .-586 ; 0x11020 1126a: 58 cc rjmp .-1872 ; 0x10b1c 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 == ';' ){ 1126c: f8 01 movw r30, r16 1126e: 80 81 ld r24, Z 11270: 8b 33 cpi r24, 0x3B ; 59 11272: 09 f4 brne .+2 ; 0x11276 11274: fa ce rjmp .-524 ; 0x1106a 11276: 25 cf rjmp .-438 ; 0x110c2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 11278: c0 92 42 03 sts 0x0342, r12 ; 0x800342 1127c: 78 cf rjmp .-272 ; 0x1116e 1127e: 80 e0 ldi r24, 0x00 ; 0 11280: 90 e0 ldi r25, 0x00 ; 0 11282: dc 01 movw r26, r24 11284: c1 cf rjmp .-126 ; 0x11208 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 11286: 9c 01 movw r18, r24 11288: 2f 5f subi r18, 0xFF ; 255 1128a: 3f 4f sbci r19, 0xFF ; 255 1128c: 30 93 7a 10 sts 0x107A, r19 ; 0x80107a 11290: 20 93 79 10 sts 0x1079, r18 ; 0x801079 11294: 20 91 7b 10 lds r18, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 11298: 30 91 7c 10 lds r19, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 1129c: 20 58 subi r18, 0x80 ; 128 1129e: 3f 4e sbci r19, 0xEF ; 239 112a0: 82 0f add r24, r18 112a2: 93 1f adc r25, r19 112a4: fc 01 movw r30, r24 112a6: 03 83 std Z+3, r16 ; 0x03 112a8: bb ce rjmp .-650 ; 0x11020 } } if(card.eof()) 112aa: 40 91 7f 17 lds r20, 0x177F ; 0x80177f 112ae: 50 91 80 17 lds r21, 0x1780 ; 0x801780 112b2: 60 91 81 17 lds r22, 0x1781 ; 0x801781 112b6: 70 91 82 17 lds r23, 0x1782 ; 0x801782 112ba: 80 91 78 17 lds r24, 0x1778 ; 0x801778 112be: 90 91 79 17 lds r25, 0x1779 ; 0x801779 112c2: a0 91 7a 17 lds r26, 0x177A ; 0x80177a 112c6: b0 91 7b 17 lds r27, 0x177B ; 0x80177b 112ca: 48 17 cp r20, r24 112cc: 59 07 cpc r21, r25 112ce: 6a 07 cpc r22, r26 112d0: 7b 07 cpc r23, r27 112d2: 08 f4 brcc .+2 ; 0x112d6 112d4: 23 cc rjmp .-1978 ; 0x10b1c { // 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()) 112d6: 0e 94 4a 5c call 0xb894 ; 0xb894 112da: 89 2b or r24, r25 112dc: 09 f0 breq .+2 ; 0x112e0 112de: 1e cc rjmp .-1988 ; 0x10b1c lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 112e0: 8b ef ldi r24, 0xFB ; 251 112e2: 96 e1 ldi r25, 0x16 ; 22 112e4: 0f 94 f5 6c call 0x2d9ea ; 0x2d9ea file.close(); 112e8: 8b ef ldi r24, 0xFB ; 251 112ea: 96 e1 ldi r25, 0x16 ; 22 112ec: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 saving = false; 112f0: 10 92 69 14 sts 0x1469, r1 ; 0x801469 logging = false; 112f4: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a { // 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 112f8: 82 e4 ldi r24, 0x42 ; 66 112fa: 96 e6 ldi r25, 0x66 ; 102 112fc: 0e 94 97 7b call 0xf72e ; 0xf72e char time[30]; uint32_t t = print_job_timer.duration() / 60; 11300: 0f 94 ad 53 call 0x2a75a ; 0x2a75a 11304: 6b 01 movw r12, r22 11306: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 11308: 0e 94 65 67 call 0xceca ; 0xceca // 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; 1130c: 8c e3 ldi r24, 0x3C ; 60 1130e: 88 2e mov r8, r24 11310: 91 2c mov r9, r1 11312: a1 2c mov r10, r1 11314: b1 2c mov r11, r1 11316: c7 01 movw r24, r14 11318: b6 01 movw r22, r12 1131a: a5 01 movw r20, r10 1131c: 94 01 movw r18, r8 1131e: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> int hours, minutes; minutes = t % 60; 11322: ca 01 movw r24, r20 11324: b9 01 movw r22, r18 11326: a5 01 movw r20, r10 11328: 94 01 movw r18, r8 1132a: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 1132e: 7f 93 push r23 11330: 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; 11332: c7 01 movw r24, r14 11334: b6 01 movw r22, r12 11336: 20 e1 ldi r18, 0x10 ; 16 11338: 3e e0 ldi r19, 0x0E ; 14 1133a: 40 e0 ldi r20, 0x00 ; 0 1133c: 50 e0 ldi r21, 0x00 ; 0 1133e: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 11342: 3f 93 push r19 11344: 2f 93 push r18 11346: 8c ef ldi r24, 0xFC ; 252 11348: 98 e7 ldi r25, 0x78 ; 120 1134a: 9f 93 push r25 1134c: 8f 93 push r24 1134e: 8e 01 movw r16, r28 11350: 0f 5f subi r16, 0xFF ; 255 11352: 1f 4f sbci r17, 0xFF ; 255 11354: 1f 93 push r17 11356: 0f 93 push r16 11358: 0f 94 26 dc call 0x3b84c ; 0x3b84c SERIAL_ECHO_START; 1135c: 84 e1 ldi r24, 0x14 ; 20 1135e: 9b ea ldi r25, 0xAB ; 171 11360: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(time); 11364: c8 01 movw r24, r16 11366: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 lcd_setstatus(time); 1136a: c8 01 movw r24, r16 1136c: 0f 94 20 14 call 0x22840 ; 0x22840 card.printingHasFinished(); 11370: 0f 94 b4 7f call 0x2ff68 ; 0x2ff68 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 11374: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.569> if(!mounted) 11378: 0f b6 in r0, 0x3f ; 63 1137a: f8 94 cli 1137c: de bf out 0x3e, r29 ; 62 1137e: 0f be out 0x3f, r0 ; 63 11380: cd bf out 0x3d, r28 ; 61 11382: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 11386: 88 23 and r24, r24 11388: 19 f0 breq .+6 ; 0x11390 1138a: 0f 94 56 76 call 0x2ecac ; 0x2ecac 1138e: c6 cb rjmp .-2164 ; 0x10b1c { mount(); 11390: 81 e0 ldi r24, 0x01 ; 1 11392: 0f 94 f3 7f call 0x2ffe6 ; 0x2ffe6 if(!mounted) //fail 11396: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 1139a: 81 11 cpse r24, r1 1139c: f6 cf rjmp .-20 ; 0x1138a 1139e: be cb rjmp .-2180 ; 0x10b1c 000113a0 : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 113a0: cf 93 push r28 113a2: df 93 push r29 113a4: ec 01 movw r28, r24 { while (*str) 113a6: 89 91 ld r24, Y+ 113a8: 88 23 and r24, r24 113aa: 19 f0 breq .+6 ; 0x113b2 write(*str++); 113ac: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 113b0: fa cf rjmp .-12 ; 0x113a6 } 113b2: df 91 pop r29 113b4: cf 91 pop r28 113b6: 08 95 ret 000113b8 : //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) { 113b8: ff 92 push r15 113ba: 0f 93 push r16 113bc: 1f 93 push r17 113be: cf 93 push r28 113c0: df 93 push r29 113c2: ec 01 movw r28, r24 113c4: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 113c6: 66 23 and r22, r22 113c8: 09 f4 brne .+2 ; 0x113cc 113ca: 4b c0 rjmp .+150 ; 0x11462 #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); 113cc: 0f 94 cd da call 0x3b59a ; 0x3b59a <__strlen_P> 113d0: 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)) { 113d2: c8 01 movw r24, r16 113d4: 0e 94 88 5d call 0xbb10 ; 0xbb10 113d8: 88 23 and r24, r24 113da: 09 f4 brne .+2 ; 0x113de 113dc: 53 c0 rjmp .+166 ; 0x11484 // 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; 113de: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 113e2: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 113e6: fc 01 movw r30, r24 113e8: e0 58 subi r30, 0x80 ; 128 113ea: ff 4e sbci r31, 0xEF ; 239 113ec: 23 e0 ldi r18, 0x03 ; 3 113ee: 20 83 st Z, r18 113f0: 8d 57 subi r24, 0x7D ; 125 113f2: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 113f4: 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) 113f6: ff 20 and r15, r15 113f8: e9 f1 breq .+122 ; 0x11474 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 113fa: 0f 94 c6 da call 0x3b58c ; 0x3b58c else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 113fe: 84 e1 ldi r24, 0x14 ; 20 11400: 9b ea ldi r25, 0xAB ; 171 11402: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(MSG_Enqueing); 11406: 87 e3 ldi r24, 0x37 ; 55 11408: 96 e6 ldi r25, 0x66 ; 102 1140a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 1140e: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 11412: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 11416: 8d 57 subi r24, 0x7D ; 125 11418: 9f 4e sbci r25, 0xEF ; 239 1141a: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_ECHOLNPGM("\""); 1141e: 8a ed ldi r24, 0xDA ; 218 11420: 98 e7 ldi r25, 0x78 ; 120 11422: 0e 94 97 7b call 0xf72e ; 0xf72e bufindw += len + (CMDHDRSIZE + 1); 11426: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 1142a: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 1142e: 04 96 adiw r24, 0x04 ; 4 11430: 08 0f add r16, r24 11432: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 11434: 0d 3e cpi r16, 0xED ; 237 11436: 81 e0 ldi r24, 0x01 ; 1 11438: 18 07 cpc r17, r24 1143a: f9 f0 breq .+62 ; 0x1147a strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 1143c: 10 93 7c 10 sts 0x107C, r17 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 11440: 00 93 7b 10 sts 0x107B, r16 ; 0x80107b <_ZL7bufindw.lto_priv.568> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11444: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 11448: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 1144c: 01 96 adiw r24, 0x01 ; 1 1144e: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f 11452: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11456: df 91 pop r29 11458: cf 91 pop r28 1145a: 1f 91 pop r17 1145c: 0f 91 pop r16 1145e: ff 90 pop r15 11460: 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); 11462: fc 01 movw r30, r24 11464: 01 90 ld r0, Z+ 11466: 00 20 and r0, r0 11468: e9 f7 brne .-6 ; 0x11464 1146a: 31 97 sbiw r30, 0x01 ; 1 1146c: 8f 01 movw r16, r30 1146e: 08 1b sub r16, r24 11470: 19 0b sbc r17, r25 11472: af cf rjmp .-162 ; 0x113d2 // 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); 11474: 0f 94 7a e3 call 0x3c6f4 ; 0x3c6f4 11478: c2 cf rjmp .-124 ; 0x113fe SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 1147a: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 1147e: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b <_ZL7bufindw.lto_priv.568> 11482: e0 cf rjmp .-64 ; 0x11444 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 11484: 8c ee ldi r24, 0xEC ; 236 11486: 9a ea ldi r25, 0xAA ; 170 11488: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(MSG_Enqueing); 1148c: 87 e3 ldi r24, 0x37 ; 55 1148e: 96 e6 ldi r25, 0x66 ; 102 11490: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 11494: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 11496: ff 20 and r15, r15 11498: 59 f0 breq .+22 ; 0x114b0 SERIAL_PROTOCOLRPGM(cmd); 1149a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 1149e: 85 ed ldi r24, 0xD5 ; 213 114a0: 9a ea ldi r25, 0xAA ; 170 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 114a2: df 91 pop r29 114a4: cf 91 pop r28 114a6: 1f 91 pop r17 114a8: 0f 91 pop r16 114aa: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 114ac: 0c 94 97 7b jmp 0xf72e ; 0xf72e 114b0: 0e 94 d0 89 call 0x113a0 ; 0x113a0 114b4: f4 cf rjmp .-24 ; 0x1149e 000114b6 : { 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) { 114b6: 0f 93 push r16 114b8: 1f 93 push r17 114ba: cf 93 push r28 114bc: df 93 push r29 114be: d6 2f mov r29, r22 114c0: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 114c2: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); 114c4: f8 01 movw r30, r16 114c6: 85 91 lpm r24, Z+ 114c8: 94 91 lpm r25, Z 114ca: 61 e0 ldi r22, 0x01 ; 1 114cc: 0e 94 dc 89 call 0x113b8 ; 0x113b8 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) 114d0: cf 5f subi r28, 0xFF ; 255 114d2: 0e 5f subi r16, 0xFE ; 254 114d4: 1f 4f sbci r17, 0xFF ; 255 114d6: dc 13 cpse r29, r28 114d8: f5 cf rjmp .-22 ; 0x114c4 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } 114da: df 91 pop r29 114dc: cf 91 pop r28 114de: 1f 91 pop r17 114e0: 0f 91 pop r16 114e2: 08 95 ret 000114e4 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 114e4: cf 93 push r28 114e6: df 93 push r29 114e8: cd b7 in r28, 0x3d ; 61 114ea: de b7 in r29, 0x3e ; 62 114ec: 6e 97 sbiw r28, 0x1e ; 30 114ee: 0f b6 in r0, 0x3f ; 63 114f0: f8 94 cli 114f2: de bf out 0x3e, r29 ; 62 114f4: 0f be out 0x3f, r0 ; 63 114f6: cd bf out 0x3d, r28 ; 61 114f8: 9e 01 movw r18, r28 114fa: 2c 5d subi r18, 0xDC ; 220 114fc: 3f 4f sbci r19, 0xFF ; 255 114fe: f9 01 movw r30, r18 11500: 41 91 ld r20, Z+ 11502: 51 91 ld r21, Z+ 11504: 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); 11506: 6e e1 ldi r22, 0x1E ; 30 11508: 70 e0 ldi r23, 0x00 ; 0 1150a: ce 01 movw r24, r28 1150c: 01 96 adiw r24, 0x01 ; 1 1150e: 0f 94 65 dc call 0x3b8ca ; 0x3b8ca va_end(ap); enquecommand(cmd_buffer, false); 11512: 60 e0 ldi r22, 0x00 ; 0 11514: ce 01 movw r24, r28 11516: 01 96 adiw r24, 0x01 ; 1 11518: 0e 94 dc 89 call 0x113b8 ; 0x113b8 } 1151c: 6e 96 adiw r28, 0x1e ; 30 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 11528: df 91 pop r29 1152a: cf 91 pop r28 1152c: 08 95 ret 0001152e : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 1152e: ef 92 push r14 11530: ff 92 push r15 11532: 0f 93 push r16 11534: 1f 93 push r17 11536: cf 93 push r28 11538: df 93 push r29 1153a: cd b7 in r28, 0x3d ; 61 1153c: de b7 in r29, 0x3e ; 62 1153e: 6b 97 sbiw r28, 0x1b ; 27 11540: 0f b6 in r0, 0x3f ; 63 11542: f8 94 cli 11544: de bf out 0x3e, r29 ; 62 11546: 0f be out 0x3f, r0 ; 63 11548: 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); 1154a: 8a e5 ldi r24, 0x5A ; 90 1154c: 9f e0 ldi r25, 0x0F ; 15 1154e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 11552: e8 2e mov r14, r24 11554: 0a e0 ldi r16, 0x0A ; 10 11556: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 11558: 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); 1155a: 48 e0 ldi r20, 0x08 ; 8 1155c: 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++) { 1155e: fe 14 cp r15, r14 11560: 79 f0 breq .+30 ; 0x11580 eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 11562: b8 01 movw r22, r16 11564: ce 01 movw r24, r28 11566: 0e 96 adiw r24, 0x0e ; 14 11568: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe dir_name[8] = '\0'; 1156c: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 1156e: 60 e0 ldi r22, 0x00 ; 0 11570: ce 01 movw r24, r28 11572: 0e 96 adiw r24, 0x0e ; 14 11574: 0f 94 45 7d call 0x2fa8a ; 0x2fa8a 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++) { 11578: f3 94 inc r15 1157a: 08 5f subi r16, 0xF8 ; 248 1157c: 1f 4f sbci r17, 0xFF ; 255 1157e: ed cf rjmp .-38 ; 0x1155a 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); 11580: 65 e9 ldi r22, 0x95 ; 149 11582: 7f e0 ldi r23, 0x0F ; 15 11584: 8e 01 movw r16, r28 11586: 0f 5f subi r16, 0xFF ; 255 11588: 1f 4f sbci r17, 0xFF ; 255 1158a: c8 01 movw r24, r16 1158c: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 11590: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 11592: 8e e2 ldi r24, 0x2E ; 46 11594: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 11596: 43 e0 ldi r20, 0x03 ; 3 11598: 50 e0 ldi r21, 0x00 ; 0 1159a: 61 e9 ldi r22, 0x91 ; 145 1159c: 7c e0 ldi r23, 0x0C ; 12 1159e: ce 01 movw r24, r28 115a0: 48 96 adiw r24, 0x18 ; 24 115a2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe extension_ptr[4] = '\0'; 115a6: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 115a8: be 01 movw r22, r28 115aa: 69 5e subi r22, 0xE9 ; 233 115ac: 7f 4f sbci r23, 0xFF ; 255 115ae: c8 01 movw r24, r16 115b0: 0f 94 5b e3 call 0x3c6b6 ; 0x3c6b6 enquecommandf_P(MSG_M23, filename); 115b4: 1f 93 push r17 115b6: 0f 93 push r16 115b8: 81 ed ldi r24, 0xD1 ; 209 115ba: 91 e7 ldi r25, 0x71 ; 113 115bc: 9f 93 push r25 115be: 8f 93 push r24 115c0: 0e 94 72 8a call 0x114e4 ; 0x114e4 115c4: 0f 90 pop r0 115c6: 0f 90 pop r0 115c8: 0f 90 pop r0 115ca: 0f 90 pop r0 } 115cc: 6b 96 adiw r28, 0x1b ; 27 115ce: 0f b6 in r0, 0x3f ; 63 115d0: f8 94 cli 115d2: de bf out 0x3e, r29 ; 62 115d4: 0f be out 0x3f, r0 ; 63 115d6: cd bf out 0x3d, r28 ; 61 115d8: df 91 pop r29 115da: cf 91 pop r28 115dc: 1f 91 pop r17 115de: 0f 91 pop r16 115e0: ff 90 pop r15 115e2: ef 90 pop r14 115e4: 08 95 ret 000115e6 : //! 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) { 115e6: bf 92 push r11 115e8: cf 92 push r12 115ea: df 92 push r13 115ec: ef 92 push r14 115ee: ff 92 push r15 115f0: 0f 93 push r16 115f2: 1f 93 push r17 115f4: cf 93 push r28 115f6: df 93 push r29 if (saved_printing) return; 115f8: e0 91 57 0e lds r30, 0x0E57 ; 0x800e57 115fc: e1 11 cpse r30, r1 115fe: b1 c0 rjmp .+354 ; 0x11762 11600: 05 2f mov r16, r21 11602: 14 2f mov r17, r20 11604: e9 01 movw r28, r18 11606: 6b 01 movw r12, r22 11608: 7c 01 movw r14, r24 cli(); 1160a: f8 94 cli save_print_file_state(); 1160c: 0e 94 80 66 call 0xcd00 ; 0xcd00 // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 11610: b0 90 56 0e lds r11, 0x0E56 ; 0x800e56 11614: b1 10 cpse r11, r1 11616: 02 c0 rjmp .+4 ; 0x1161c 11618: b0 90 55 0e lds r11, 0x0E55 ; 0x800e55 save_planner_global_state(); 1161c: 0e 94 36 66 call 0xcc6c ; 0xcc6c planner_abort_hard(); //abort printing 11620: 0f 94 8b bb call 0x37716 ; 0x37716 memcpy(saved_pos, current_position, sizeof(saved_pos)); 11624: 80 e1 ldi r24, 0x10 ; 16 11626: e0 e4 ldi r30, 0x40 ; 64 11628: f7 e0 ldi r31, 0x07 ; 7 1162a: ab e9 ldi r26, 0x9B ; 155 1162c: b2 e0 ldi r27, 0x02 ; 2 1162e: 01 90 ld r0, Z+ 11630: 0d 92 st X+, r0 11632: 8a 95 dec r24 11634: e1 f7 brne .-8 ; 0x1162e if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 11636: bb 20 and r11, r11 11638: 61 f0 breq .+24 ; 0x11652 1163a: 80 e0 ldi r24, 0x00 ; 0 1163c: 90 e0 ldi r25, 0x00 ; 0 1163e: a0 e8 ldi r26, 0x80 ; 128 11640: bf eb ldi r27, 0xBF ; 191 11642: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 11646: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 1164a: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 1164e: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_feedmultiply2 = feedmultiply; //save feedmultiply 11652: 80 91 39 02 lds r24, 0x0239 ; 0x800239 11656: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 1165a: 90 93 70 03 sts 0x0370, r25 ; 0x800370 1165e: 80 93 6f 03 sts 0x036F, r24 ; 0x80036f saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 11662: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 11666: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 1166a: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab 1166e: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa saved_bed_temperature = (uint8_t)degTargetBed(); 11672: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 11676: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 1167a: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 1167e: 83 fb bst r24, 3 11680: 88 27 eor r24, r24 11682: 80 f9 bld r24, 0 11684: 80 93 03 18 sts 0x1803, r24 ; 0x801803 saved_fan_speed = fanSpeed; 11688: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 1168c: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 cmdqueue_reset(); //empty cmdqueue 11690: 0e 94 60 81 call 0x102c0 ; 0x102c0 card.sdprinting = false; 11694: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b // card.closefile(); saved_printing = true; 11698: 81 e0 ldi r24, 0x01 ; 1 1169a: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 1169e: 0f 94 35 58 call 0x2b06a ; 0x2b06a sei(); 116a2: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 116a4: 20 e0 ldi r18, 0x00 ; 0 116a6: 30 e0 ldi r19, 0x00 ; 0 116a8: a9 01 movw r20, r18 116aa: c7 01 movw r24, r14 116ac: b6 01 movw r22, r12 116ae: 0f 94 2c df call 0x3be58 ; 0x3be58 <__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) 116b2: 20 e0 ldi r18, 0x00 ; 0 116b4: 30 e0 ldi r19, 0x00 ; 0 116b6: a9 01 movw r20, r18 116b8: f8 01 movw r30, r16 116ba: 6c 2f mov r22, r28 116bc: 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 116be: 81 11 cpse r24, r1 116c0: 5a c0 rjmp .+180 ; 0x11776 116c2: 8f 2f mov r24, r31 116c4: 90 2f mov r25, r16 116c6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 116ca: 88 23 and r24, r24 116cc: 09 f4 brne .+2 ; 0x116d0 116ce: 49 c0 rjmp .+146 ; 0x11762 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 116d0: 80 91 03 18 lds r24, 0x1803 ; 0x801803 116d4: 81 11 cpse r24, r1 116d6: 05 c0 rjmp .+10 ; 0x116e2 enquecommand_P(MSG_M83); 116d8: 61 e0 ldi r22, 0x01 ; 1 116da: 8b ef ldi r24, 0xFB ; 251 116dc: 9c e6 ldi r25, 0x6C ; 108 116de: 0e 94 dc 89 call 0x113b8 ; 0x113b8 // 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); 116e2: 0f 93 push r16 116e4: 1f 93 push r17 116e6: df 93 push r29 116e8: cf 93 push r28 116ea: 86 eb ldi r24, 0xB6 ; 182 116ec: 92 e7 ldi r25, 0x72 ; 114 116ee: 9f 93 push r25 116f0: 8f 93 push r24 116f2: 0e 94 72 8a call 0x114e4 ; 0x114e4 } if(z_move) 116f6: 0f 90 pop r0 116f8: 0f 90 pop r0 116fa: 0f 90 pop r0 116fc: 0f 90 pop r0 116fe: 0f 90 pop r0 11700: 0f 90 pop r0 11702: 20 e0 ldi r18, 0x00 ; 0 11704: 30 e0 ldi r19, 0x00 ; 0 11706: a9 01 movw r20, r18 11708: c7 01 movw r24, r14 1170a: b6 01 movw r22, r12 1170c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 11710: 88 23 and r24, r24 11712: 21 f1 breq .+72 ; 0x1175c { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 11714: 84 e4 ldi r24, 0x44 ; 68 11716: 8f 93 push r24 11718: 88 e4 ldi r24, 0x48 ; 72 1171a: 8f 93 push r24 1171c: 1f 92 push r1 1171e: 1f 92 push r1 11720: 20 91 a3 02 lds r18, 0x02A3 ; 0x8002a3 11724: 30 91 a4 02 lds r19, 0x02A4 ; 0x8002a4 11728: 40 91 a5 02 lds r20, 0x02A5 ; 0x8002a5 1172c: 50 91 a6 02 lds r21, 0x02A6 ; 0x8002a6 11730: c7 01 movw r24, r14 11732: b6 01 movw r22, r12 11734: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 11738: 9f 93 push r25 1173a: 8f 93 push r24 1173c: 7f 93 push r23 1173e: 6f 93 push r22 11740: 8a e1 ldi r24, 0x1A ; 26 11742: 90 e8 ldi r25, 0x80 ; 128 11744: 9f 93 push r25 11746: 8f 93 push r24 11748: 0e 94 72 8a call 0x114e4 ; 0x114e4 1174c: 8d b7 in r24, 0x3d ; 61 1174e: 9e b7 in r25, 0x3e ; 62 11750: 0a 96 adiw r24, 0x0a ; 10 11752: 0f b6 in r0, 0x3f ; 63 11754: f8 94 cli 11756: 9e bf out 0x3e, r25 ; 62 11758: 0f be out 0x3f, r0 ; 63 1175a: 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; 1175c: 81 e0 ldi r24, 0x01 ; 1 1175e: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d // 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(); } } 11762: df 91 pop r29 11764: cf 91 pop r28 11766: 1f 91 pop r17 11768: 0f 91 pop r16 1176a: ff 90 pop r15 1176c: ef 90 pop r14 1176e: df 90 pop r13 11770: cf 90 pop r12 11772: bf 90 pop r11 11774: 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) 11776: 8f 2f mov r24, r31 11778: 90 2f mov r25, r16 1177a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1177e: 88 23 and r24, r24 11780: 49 f2 breq .-110 ; 0x11714 11782: a6 cf rjmp .-180 ; 0x116d0 00011784 : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 11784: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 11788: 88 23 and r24, r24 1178a: 21 f1 breq .+72 ; 0x117d4 if (backlightMode == BACKLIGHT_MODE_AUTO) 1178c: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 11790: 82 30 cpi r24, 0x02 ; 2 11792: e9 f4 brne .+58 ; 0x117ce { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 11794: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 11798: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 1179c: 28 ee ldi r18, 0xE8 ; 232 1179e: 33 e0 ldi r19, 0x03 ; 3 117a0: 0f 94 2f de call 0x3bc5e ; 0x3bc5e <__usmulhisi3> 117a4: ab 01 movw r20, r22 117a6: bc 01 movw r22, r24 117a8: 85 e3 ldi r24, 0x35 ; 53 117aa: 93 e0 ldi r25, 0x03 ; 3 117ac: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 117b0: 88 23 and r24, r24 117b2: 31 f0 breq .+12 ; 0x117c0 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); 117b4: 60 91 f9 03 lds r22, 0x03F9 ; 0x8003f9 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 117b8: 70 e0 ldi r23, 0x00 ; 0 117ba: 85 e0 ldi r24, 0x05 ; 5 117bc: 0c 94 c8 de jmp 0x1bd90 ; 0x1bd90 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); 117c0: 80 91 35 03 lds r24, 0x0335 ; 0x800335 117c4: 88 23 and r24, r24 117c6: 31 f0 breq .+12 ; 0x117d4 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); 117c8: 60 91 fa 03 lds r22, 0x03FA ; 0x8003fa 117cc: f5 cf rjmp .-22 ; 0x117b8 { 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); 117ce: 81 11 cpse r24, r1 117d0: fb cf rjmp .-10 ; 0x117c8 117d2: f0 cf rjmp .-32 ; 0x117b4 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 117d4: 08 95 ret 000117d6 : 117d6: 60 91 fa 03 lds r22, 0x03FA ; 0x8003fa 117da: 84 e3 ldi r24, 0x34 ; 52 117dc: 9d e0 ldi r25, 0x0D ; 13 117de: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 117e2: 60 91 f9 03 lds r22, 0x03F9 ; 0x8003f9 117e6: 83 e3 ldi r24, 0x33 ; 51 117e8: 9d e0 ldi r25, 0x0D ; 13 117ea: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 117ee: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 117f2: 82 e3 ldi r24, 0x32 ; 50 117f4: 9d e0 ldi r25, 0x0D ; 13 117f6: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 117fa: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 117fe: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 11802: 80 e3 ldi r24, 0x30 ; 48 11804: 9d e0 ldi r25, 0x0D ; 13 11806: 0d 94 51 dd jmp 0x3baa2 ; 0x3baa2 0001180a : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 1180a: 88 23 and r24, r24 1180c: 61 f0 breq .+24 ; 0x11826 { backlightMode = BACKLIGHT_MODE_BRIGHT; 1180e: 81 e0 ldi r24, 0x01 ; 1 11810: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; 11814: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 11818: 8e 31 cpi r24, 0x1E ; 30 1181a: 18 f4 brcc .+6 ; 0x11822 1181c: 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); 1181e: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa } backlight_update(); 11822: 0c 94 c2 8b jmp 0x11784 ; 0x11784 backlightMode = BACKLIGHT_MODE_BRIGHT; if (backlightLevel_HIGH < 30) backlightLevel_HIGH = 30; } else { backlightMode = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_MODE); 11826: 82 e3 ldi r24, 0x32 ; 50 11828: 9d e0 ldi r25, 0x0D ; 13 1182a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1182e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 11832: 84 e3 ldi r24, 0x34 ; 52 11834: 9d e0 ldi r25, 0x0D ; 13 11836: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1183a: f1 cf rjmp .-30 ; 0x1181e 0001183c : 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; 1183c: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 11840: 88 23 and r24, r24 11842: 31 f0 breq .+12 ; 0x11850 backlightTimer.start(); 11844: 85 e3 ldi r24, 0x35 ; 53 11846: 93 e0 ldi r25, 0x03 ; 3 11848: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> backlight_update(); 1184c: 0c 94 c2 8b jmp 0x11784 ; 0x11784 } 11850: 08 95 ret 00011852 : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 11852: ff 92 push r15 11854: 0f 93 push r16 11856: 1f 93 push r17 11858: cf 93 push r28 1185a: df 93 push r29 if (!backlightSupport) return; 1185c: 90 91 fb 03 lds r25, 0x03FB ; 0x8003fb 11860: 99 23 and r25, r25 11862: 99 f1 breq .+102 ; 0x118ca if (flashNo) 11864: 88 23 and r24, r24 11866: 51 f1 breq .+84 ; 0x118bc { uint8_t backlightMode_bck = backlightMode; 11868: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 1186c: c8 2f mov r28, r24 1186e: d0 e0 ldi r29, 0x00 ; 0 11870: cc 0f add r28, r28 11872: dd 1f adc r29, r29 11874: 10 e0 ldi r17, 0x00 ; 0 11876: ff 24 eor r15, r15 11878: f3 94 inc r15 1187a: 21 2f mov r18, r17 1187c: 30 e0 ldi r19, 0x00 ; 0 1187e: 80 91 35 03 lds r24, 0x0335 ; 0x800335 11882: 8f 25 eor r24, r15 11884: 02 30 cpi r16, 0x02 ; 2 11886: 09 f0 breq .+2 ; 0x1188a 11888: 80 e0 ldi r24, 0x00 ; 0 1188a: 8c 0f add r24, r28 1188c: 9d 2f mov r25, r29 1188e: 91 1d adc r25, r1 11890: 28 17 cp r18, r24 11892: 39 07 cpc r19, r25 11894: 8c f4 brge .+34 ; 0x118b8 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 11896: 81 e0 ldi r24, 0x01 ; 1 11898: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 1189c: 91 11 cpse r25, r1 1189e: 80 e0 ldi r24, 0x00 ; 0 118a0: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 118a4: 0e 94 c2 8b call 0x11784 ; 0x11784 _delay(BL_FLASH_DELAY_MS); 118a8: 69 e1 ldi r22, 0x19 ; 25 118aa: 70 e0 ldi r23, 0x00 ; 0 118ac: 80 e0 ldi r24, 0x00 ; 0 118ae: 90 e0 ldi r25, 0x00 ; 0 118b0: 0f 94 5c 3c call 0x278b8 ; 0x278b8 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++) 118b4: 1f 5f subi r17, 0xFF ; 255 118b6: e1 cf rjmp .-62 ; 0x1187a { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 118b8: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 118bc: df 91 pop r29 118be: cf 91 pop r28 118c0: 1f 91 pop r17 118c2: 0f 91 pop r16 118c4: ff 90 pop r15 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 118c6: 0c 94 1e 8c jmp 0x1183c ; 0x1183c } 118ca: df 91 pop r29 118cc: cf 91 pop r28 118ce: 1f 91 pop r17 118d0: 0f 91 pop r16 118d2: ff 90 pop r15 118d4: 08 95 ret 000118d6 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 118d6: 0f 93 push r16 118d8: 1f 93 push r17 118da: cf 93 push r28 118dc: df 93 push r29 118de: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { 118e0: 80 91 85 17 lds r24, 0x1785 ; 0x801785 118e4: 81 30 cpi r24, 0x01 ; 1 118e6: 21 f0 breq .+8 ; 0x118f0 118e8: 82 30 cpi r24, 0x02 ; 2 118ea: 49 f0 breq .+18 ; 0x118fe return checkFilamentEvents(); } break; case State::disabled: case State::error: default: return false; 118ec: c0 e0 ldi r28, 0x00 ; 0 118ee: 4b c0 rjmp .+150 ; 0x11986 } 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. 118f0: 82 e0 ldi r24, 0x02 ; 2 118f2: 80 93 85 17 sts 0x1785, r24 ; 0x801785 // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldFilamentPresent = fsensor.getFilamentPresent(); 118f6: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 118fa: 80 93 88 17 sts 0x1788, r24 ; 0x801788 [[fallthrough]]; case State::ready: { postponedLoadEvent = false; 118fe: 10 92 89 17 sts 0x1789, r1 ; 0x801789 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 11902: 80 91 85 17 lds r24, 0x1785 ; 0x801785 11906: 82 30 cpi r24, 0x02 ; 2 11908: 09 f0 breq .+2 ; 0x1190c 1190a: 92 c0 rjmp .+292 ; 0x11a30 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 1190c: 80 91 8a 17 lds r24, 0x178A ; 0x80178a 11910: 81 11 cpse r24, r1 11912: cc c0 rjmp .+408 ; 0x11aac return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); 11914: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 11918: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { 1191a: 80 91 88 17 lds r24, 0x1788 ; 0x801788 1191e: c8 17 cp r28, r24 11920: 29 f3 breq .-54 ; 0x118ec oldFilamentPresent = newFilamentPresent; 11922: c0 93 88 17 sts 0x1788, r28 ; 0x801788 eventBlankingTimer.start(); 11926: 8a e8 ldi r24, 0x8A ; 138 11928: 97 e1 ldi r25, 0x17 ; 23 1192a: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> if (newFilamentPresent) { // filament insertion 1192e: cc 23 and r28, r28 11930: 09 f4 brne .+2 ; 0x11934 11932: c5 c0 rjmp .+394 ; 0x11abe } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11934: 80 91 86 17 lds r24, 0x1786 ; 0x801786 11938: 88 23 and r24, r24 1193a: 11 f1 breq .+68 ; 0x11980 return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1193c: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 11940: 81 11 cpse r24, r1 11942: 1e c0 rjmp .+60 ; 0x11980 && !( 11944: 80 91 95 13 lds r24, 0x1395 ; 0x801395 11948: 81 30 cpi r24, 0x01 ; 1 1194a: d1 f0 breq .+52 ; 0x11980 } //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); 1194c: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 11950: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 11954: 89 1b sub r24, r25 11956: 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 11958: 99 f4 brne .+38 ; 0x11980 || printJobOngoing() 1195a: 0e 94 d6 68 call 0xd1ac ; 0xd1ac 1195e: 81 11 cpse r24, r1 11960: 0f c0 rjmp .+30 ; 0x11980 || (lcd_commands_type == LcdCommands::Layer1Cal) 11962: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 11966: 84 30 cpi r24, 0x04 ; 4 11968: 59 f0 breq .+22 ; 0x11980 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 1196a: 8f e5 ldi r24, 0x5F ; 95 1196c: 9f e0 ldi r25, 0x0F ; 15 1196e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11972: 81 11 cpse r24, r1 11974: 05 c0 rjmp .+10 ; 0x11980 || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 11976: 61 e0 ldi r22, 0x01 ; 1 11978: 86 e8 ldi r24, 0x86 ; 134 1197a: 9a e3 ldi r25, 0x3A ; 58 1197c: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 11980: 81 e0 ldi r24, 0x01 ; 1 11982: 80 93 89 17 sts 0x1789, r24 ; 0x801789 sensorRevision = (SensorRevision)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_PCB); } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { 11986: 80 91 85 17 lds r24, 0x1785 ; 0x801785 1198a: 82 30 cpi r24, 0x02 ; 2 1198c: 09 f0 breq .+2 ; 0x11990 1198e: 4b c0 rjmp .+150 ; 0x11a26 return true; } bool IR_sensor_analog::getVoltReady() const { bool ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } 11990: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11992: f8 94 cli 11994: 80 91 8f 17 lds r24, 0x178F ; 0x80178f (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11998: 9f bf out 0x3f, r25 ; 63 } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { if (getVoltReady()) { 1199a: 88 23 and r24, r24 1199c: 09 f4 brne .+2 ; 0x119a0 1199e: 43 c0 rjmp .+134 ; 0x11a26 ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } return ret; } void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } 119a0: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 119a2: f8 94 cli 119a4: 10 92 8f 17 sts 0x178F, r1 ; 0x80178f (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 119a8: 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(); 119aa: 0f 94 62 7b call 0x2f6c4 ; 0x2f6c4 119ae: 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) { 119b0: 80 91 94 17 lds r24, 0x1794 ; 0x801794 119b4: 90 91 95 17 lds r25, 0x1795 ; 0x801795 119b8: 80 17 cp r24, r16 119ba: 91 07 cpc r25, r17 119bc: 08 f0 brcs .+2 ; 0x119c0 119be: d7 c0 rjmp .+430 ; 0x11b6e maxVolt = volt; 119c0: 10 93 95 17 sts 0x1795, r17 ; 0x801795 119c4: 00 93 94 17 sts 0x1794, r16 ; 0x801794 //! 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 && 119c8: 80 91 92 17 lds r24, 0x1792 ; 0x801792 119cc: 90 91 93 17 lds r25, 0x1793 ; 0x801793 119d0: 9c 01 movw r18, r24 119d2: 26 5d subi r18, 0xD6 ; 214 119d4: 33 40 sbci r19, 0x03 ; 3 119d6: 29 35 cpi r18, 0x59 ; 89 119d8: 3f 40 sbci r19, 0x0F ; 15 119da: 08 f0 brcs .+2 ; 0x119de 119dc: d5 c0 rjmp .+426 ; 0x11b88 119de: 80 91 94 17 lds r24, 0x1794 ; 0x801794 119e2: 90 91 95 17 lds r25, 0x1795 ; 0x801795 119e6: 8d 55 subi r24, 0x5D ; 93 119e8: 96 42 sbci r25, 0x26 ; 38 119ea: 87 37 cpi r24, 0x77 ; 119 119ec: 94 41 sbci r25, 0x14 ; 20 119ee: 20 f4 brcc .+8 ; 0x119f8 maxVolt <= IRsensor_Hopen_TRESHOLD) { IR_ANALOG_Check(SensorRevision::_Old, SensorRevision::_Rev04); 119f0: 61 e0 ldi r22, 0x01 ; 1 119f2: 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); 119f4: 0f 94 7a 7b call 0x2f6f4 ; 0x2f6f4 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) { 119f8: c8 01 movw r24, r16 119fa: 8e 52 subi r24, 0x2E ; 46 119fc: 93 41 sbci r25, 0x13 ; 19 119fe: 80 33 cpi r24, 0x30 ; 48 11a00: 93 41 sbci r25, 0x13 ; 19 11a02: 08 f0 brcs .+2 ; 0x11a06 11a04: d2 c0 rjmp .+420 ; 0x11baa /// 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) { 11a06: 80 91 98 17 lds r24, 0x1798 ; 0x801798 11a0a: 91 e0 ldi r25, 0x01 ; 1 11a0c: 98 0f add r25, r24 11a0e: 90 93 98 17 sts 0x1798, r25 ; 0x801798 11a12: 85 30 cpi r24, 0x05 ; 5 11a14: 08 f4 brcc .+2 ; 0x11a18 11a16: cb c0 rjmp .+406 ; 0x11bae puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); 11a18: 8d e3 ldi r24, 0x3D ; 61 11a1a: 9f e7 ldi r25, 0x7F ; 127 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")); 11a1c: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 11a20: 83 e0 ldi r24, 0x03 ; 3 11a22: 80 93 85 17 sts 0x1785, r24 ; 0x801785 #ifdef FILAMENT_SENSOR if (fsensor.update()) { 11a26: cc 23 and r28, r28 11a28: 19 f0 breq .+6 ; 0x11a30 lcd_draw_update = 1; //cause lcd update so that fsensor event polling can be done from the lcd draw routine. 11a2a: 81 e0 ldi r24, 0x01 ; 1 11a2c: 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) 11a30: 0e 94 27 69 call 0xd24e ; 0xd24e 11a34: 81 11 cpse r24, r1 11a36: c9 c0 rjmp .+402 ; 0x11bca 11a38: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 11a3c: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 11a40: 00 97 sbiw r24, 0x00 ; 0 11a42: 39 f4 brne .+14 ; 0x11a52 11a44: 20 91 68 0e lds r18, 0x0E68 ; 0x800e68 11a48: 30 91 69 0e lds r19, 0x0E69 ; 0x800e69 11a4c: 23 2b or r18, r19 11a4e: 09 f4 brne .+2 ; 0x11a52 11a50: bc c0 rjmp .+376 ; 0x11bca 11a52: 40 91 30 02 lds r20, 0x0230 ; 0x800230 11a56: 50 91 31 02 lds r21, 0x0231 ; 0x800231 11a5a: 60 91 32 02 lds r22, 0x0232 ; 0x800232 11a5e: 70 91 33 02 lds r23, 0x0233 ; 0x800233 11a62: 41 15 cp r20, r1 11a64: 51 05 cpc r21, r1 11a66: 61 05 cpc r22, r1 11a68: 71 05 cpc r23, r1 11a6a: 09 f4 brne .+2 ; 0x11a6e 11a6c: ae c0 rjmp .+348 ; 0x11bca { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 11a6e: 89 2b or r24, r25 11a70: 31 f4 brne .+12 ; 0x11a7e 11a72: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 11a76: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 11a7a: 89 2b or r24, r25 11a7c: 29 f0 breq .+10 ; 0x11a88 11a7e: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 11a82: 88 23 and r24, r24 11a84: 09 f4 brne .+2 ; 0x11a88 11a86: 09 c1 rjmp .+530 ; 0x11c9a { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 11a88: 88 ed ldi r24, 0xD8 ; 216 11a8a: 95 e0 ldi r25, 0x05 ; 5 11a8c: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 11a90: 88 23 and r24, r24 11a92: 09 f4 brne .+2 ; 0x11a96 11a94: 9c c0 rjmp .+312 ; 0x11bce { disable_heater(); 11a96: 0f 94 21 44 call 0x28842 ; 0x28842 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 11a9a: 82 e7 ldi r24, 0x72 ; 114 11a9c: 96 e3 ldi r25, 0x36 ; 54 11a9e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 11aa2: 0f 94 d6 34 call 0x269ac ; 0x269ac lcd_return_to_status(); 11aa6: 0f 94 1d 26 call 0x24c3a ; 0x24c3a 11aaa: 91 c0 rjmp .+290 ; 0x11bce } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 11aac: 64 e6 ldi r22, 0x64 ; 100 11aae: 70 e0 ldi r23, 0x00 ; 0 11ab0: 8a e8 ldi r24, 0x8A ; 138 11ab2: 97 e1 ldi r25, 0x17 ; 23 11ab4: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 11ab8: 81 11 cpse r24, r1 11aba: 2c cf rjmp .-424 ; 0x11914 11abc: 17 cf rjmp .-466 ; 0x118ec } } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled 11abe: c0 91 87 17 lds r28, 0x1787 ; 0x801787 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11ac2: cc 23 and r28, r28 11ac4: 09 f4 brne .+2 ; 0x11ac8 11ac6: 4f c0 rjmp .+158 ; 0x11b66 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 11ac8: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 11acc: 81 11 cpse r24, r1 11ace: 5b cf rjmp .-330 ; 0x11986 11ad0: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 11ad4: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 11ad8: 89 1b sub r24, r25 11ada: 8f 70 andi r24, 0x0F ; 15 && ( 11adc: 29 f4 brne .+10 ; 0x11ae8 moves_planned() != 0 || printJobOngoing() 11ade: 0e 94 d6 68 call 0xd1ac ; 0xd1ac 11ae2: 88 23 and r24, r24 11ae4: 09 f4 brne .+2 ; 0x11ae8 11ae6: 4f cf rjmp .-354 ; 0x11986 ) && !( saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11ae8: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11aec: 81 11 cpse r24, r1 11aee: 3d c0 rjmp .+122 ; 0x11b6a saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 11af0: 80 91 95 13 lds r24, 0x1395 ; 0x801395 11af4: 81 30 cpi r24, 0x01 ; 1 11af6: 09 f4 brne .+2 ; 0x11afa 11af8: 46 cf rjmp .-372 ; 0x11986 || (lcd_commands_type == LcdCommands::Layer1Cal) 11afa: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 11afe: 84 30 cpi r24, 0x04 ; 4 11b00: 09 f4 brne .+2 ; 0x11b04 11b02: 41 cf rjmp .-382 ; 0x11986 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11b04: 8f e5 ldi r24, 0x5F ; 95 11b06: 9f e0 ldi r25, 0x0F ; 15 11b08: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11b0c: 81 11 cpse r24, r1 11b0e: 3b cf rjmp .-394 ; 0x11986 } //! @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); 11b10: 82 e1 ldi r24, 0x12 ; 18 11b12: 98 e6 ldi r25, 0x68 ; 104 11b14: 9f 93 push r25 11b16: 8f 93 push r24 11b18: 88 ef ldi r24, 0xF8 ; 248 11b1a: 97 e6 ldi r25, 0x67 ; 103 11b1c: 9f 93 push r25 11b1e: 8f 93 push r24 11b20: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11b24: 10 92 87 17 sts 0x1787, r1 ; 0x801787 autoLoadEnabled = false; 11b28: 10 92 86 17 sts 0x1786, r1 ; 0x801786 stop_and_save_print_to_ram(0, 0); 11b2c: 20 e0 ldi r18, 0x00 ; 0 11b2e: 30 e0 ldi r19, 0x00 ; 0 11b30: a9 01 movw r20, r18 11b32: ca 01 movw r24, r20 11b34: b9 01 movw r22, r18 11b36: 0e 94 f3 8a call 0x115e6 ; 0x115e6 restore_print_from_ram_and_continue(0); 11b3a: 60 e0 ldi r22, 0x00 ; 0 11b3c: 70 e0 ldi r23, 0x00 ; 0 11b3e: cb 01 movw r24, r22 11b40: 0e 94 8a 69 call 0xd314 ; 0xd314 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11b44: 85 e6 ldi r24, 0x65 ; 101 11b46: 9f e0 ldi r25, 0x0F ; 15 11b48: 0e 94 44 78 call 0xf088 ; 0xf088 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11b4c: 81 e0 ldi r24, 0x01 ; 1 11b4e: 9f e0 ldi r25, 0x0F ; 15 11b50: 0e 94 37 78 call 0xf06e ; 0xf06e enquecommand_front_P(MSG_M600); 11b54: 83 e6 ldi r24, 0x63 ; 99 11b56: 91 e7 ldi r25, 0x71 ; 113 11b58: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 11b5c: 0f 90 pop r0 11b5e: 0f 90 pop r0 11b60: 0f 90 pop r0 11b62: 0f 90 pop r0 11b64: 10 cf rjmp .-480 ; 0x11986 postponedLoadEvent = true; } else { // filament removal // puts_P(PSTR("filament removed")); triggerFilamentRemoved(); } return true; 11b66: c1 e0 ldi r28, 0x01 ; 1 11b68: 0e cf rjmp .-484 ; 0x11986 11b6a: c8 2f mov r28, r24 11b6c: 0c cf rjmp .-488 ; 0x11986 // 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) { 11b6e: 80 91 92 17 lds r24, 0x1792 ; 0x801792 11b72: 90 91 93 17 lds r25, 0x1793 ; 0x801793 11b76: 08 17 cp r16, r24 11b78: 19 07 cpc r17, r25 11b7a: 08 f0 brcs .+2 ; 0x11b7e 11b7c: 25 cf rjmp .-438 ; 0x119c8 minVolt = volt; 11b7e: 10 93 93 17 sts 0x1793, r17 ; 0x801793 11b82: 00 93 92 17 sts 0x1792, r16 ; 0x801792 11b86: 20 cf rjmp .-448 ; 0x119c8 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) { 11b88: 86 3d cpi r24, 0xD6 ; 214 11b8a: 93 40 sbci r25, 0x03 ; 3 11b8c: 08 f0 brcs .+2 ; 0x11b90 11b8e: 34 cf rjmp .-408 ; 0x119f8 11b90: 80 91 94 17 lds r24, 0x1794 ; 0x801794 11b94: 90 91 95 17 lds r25, 0x1795 ; 0x801795 11b98: 84 5d subi r24, 0xD4 ; 212 11b9a: 9a 43 sbci r25, 0x3A ; 58 11b9c: 8d 31 cpi r24, 0x1D ; 29 11b9e: 95 40 sbci r25, 0x05 ; 5 11ba0: 08 f0 brcs .+2 ; 0x11ba4 11ba2: 2a cf rjmp .-428 ; 0x119f8 IR_ANALOG_Check(SensorRevision::_Rev04, SensorRevision::_Old); 11ba4: 60 e0 ldi r22, 0x00 ; 0 11ba6: 81 e0 ldi r24, 0x01 ; 1 11ba8: 25 cf rjmp .-438 ; 0x119f4 if (voltageErrorCnt++ > 4) { puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); return false; } } else { voltageErrorCnt = 0; 11baa: 10 92 98 17 sts 0x1798, r1 ; 0x801798 } if (sensorRevision == SensorRevision::_Rev04) { 11bae: 80 91 8e 17 lds r24, 0x178E ; 0x80178e 11bb2: 81 30 cpi r24, 0x01 ; 1 11bb4: 09 f0 breq .+2 ; 0x11bb8 11bb6: 37 cf rjmp .-402 ; 0x11a26 /// 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) { 11bb8: 03 5d subi r16, 0xD3 ; 211 11bba: 1a 43 sbci r17, 0x3A ; 58 11bbc: 0e 31 cpi r16, 0x1E ; 30 11bbe: 15 40 sbci r17, 0x05 ; 5 11bc0: 08 f0 brcs .+2 ; 0x11bc4 11bc2: 31 cf rjmp .-414 ; 0x11a26 puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected")); 11bc4: 8c e0 ldi r24, 0x0C ; 12 11bc6: 9f e7 ldi r25, 0x7F ; 127 11bc8: 29 cf rjmp .-430 ; 0x11a1c inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11bca: 10 92 d8 05 sts 0x05D8, r1 ; 0x8005d8 #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)){ 11bce: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 11bd2: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 11bd6: 03 97 sbiw r24, 0x03 ; 3 11bd8: 14 f4 brge .+4 ; 0x11bde get_command(); 11bda: 0e 94 dc 84 call 0x109b8 ; 0x109b8 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); 11bde: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 11be2: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 11be6: 98 17 cp r25, r24 11be8: 81 f0 breq .+32 ; 0x11c0a 11bea: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 11bee: 86 30 cpi r24, 0x06 ; 6 11bf0: 61 f4 brne .+24 ; 0x11c0a 11bf2: 68 e8 ldi r22, 0x88 ; 136 11bf4: 73 e1 ldi r23, 0x13 ; 19 11bf6: 8e e0 ldi r24, 0x0E ; 14 11bf8: 95 e0 ldi r25, 0x05 ; 5 11bfa: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 11bfe: 88 23 and r24, r24 11c00: 21 f0 breq .+8 ; 0x11c0a { // 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(); 11c02: 8e e0 ldi r24, 0x0E ; 14 11c04: 95 e0 ldi r25, 0x05 ; 5 11c06: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 11c0a: 40 91 7c 03 lds r20, 0x037C ; 0x80037c 11c0e: 50 91 7d 03 lds r21, 0x037D ; 0x80037d 11c12: 60 91 7e 03 lds r22, 0x037E ; 0x80037e 11c16: 70 91 7f 03 lds r23, 0x037F ; 0x80037f 11c1a: 41 15 cp r20, r1 11c1c: 51 05 cpc r21, r1 11c1e: 61 05 cpc r22, r1 11c20: 71 05 cpc r23, r1 11c22: 09 f0 breq .+2 ; 0x11c26 11c24: 3f c0 rjmp .+126 ; 0x11ca4 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 11c26: 40 91 34 02 lds r20, 0x0234 ; 0x800234 11c2a: 50 91 35 02 lds r21, 0x0235 ; 0x800235 11c2e: 60 91 36 02 lds r22, 0x0236 ; 0x800236 11c32: 70 91 37 02 lds r23, 0x0237 ; 0x800237 11c36: 41 15 cp r20, r1 11c38: 51 05 cpc r21, r1 11c3a: 61 05 cpc r22, r1 11c3c: 71 05 cpc r23, r1 11c3e: a9 f0 breq .+42 ; 0x11c6a 11c40: 84 e8 ldi r24, 0x84 ; 132 11c42: 93 e0 ldi r25, 0x03 ; 3 11c44: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 11c48: 88 23 and r24, r24 11c4a: 79 f0 breq .+30 ; 0x11c6a 11c4c: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 11c50: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 if(blocks_queued() == false && ignore_stepper_queue == false) { 11c54: 98 13 cpse r25, r24 11c56: 09 c0 rjmp .+18 ; 0x11c6a 11c58: d1 11 cpse r29, r1 11c5a: 07 c0 rjmp .+14 ; 0x11c6a disable_x(); 11c5c: 17 9a sbi 0x02, 7 ; 2 11c5e: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); 11c62: 16 9a sbi 0x02, 6 ; 2 11c64: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_z(); disable_e0(); 11c68: 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; 11c6a: c0 91 df 03 lds r28, 0x03DF ; 0x8003df block_t *block; if(block_buffer_tail != block_buffer_head) 11c6e: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 11c72: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 11c76: 98 17 cp r25, r24 11c78: 01 f1 breq .+64 ; 0x11cba { uint8_t block_index = block_buffer_tail; 11c7a: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 tail_fan_speed = block_buffer[block_index].fan_speed; 11c7e: 9e e6 ldi r25, 0x6E ; 110 11c80: 89 9f mul r24, r25 11c82: f0 01 movw r30, r0 11c84: 11 24 eor r1, r1 11c86: e7 54 subi r30, 0x47 ; 71 11c88: f8 4f sbci r31, 0xF8 ; 248 11c8a: c0 81 ld r28, Z while(block_index != block_buffer_head) 11c8c: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 11c90: 98 17 cp r25, r24 11c92: 99 f0 breq .+38 ; 0x11cba 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); 11c94: 8f 5f subi r24, 0xFF ; 255 11c96: 8f 70 andi r24, 0x0F ; 15 11c98: f9 cf rjmp .-14 ; 0x11c8c { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11c9a: 88 ed ldi r24, 0xD8 ; 216 11c9c: 95 e0 ldi r25, 0x05 ; 5 11c9e: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> 11ca2: 95 cf rjmp .-214 ; 0x11bce // 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)) 11ca4: 84 e8 ldi r24, 0x84 ; 132 11ca6: 93 e0 ldi r25, 0x03 ; 3 11ca8: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 11cac: 88 23 and r24, r24 11cae: 09 f4 brne .+2 ; 0x11cb2 11cb0: ba cf rjmp .-140 ; 0x11c26 kill(PSTR("Inactivity Shutdown")); 11cb2: 8e e6 ldi r24, 0x6E ; 110 11cb4: 9f e7 ldi r25, 0x7F ; 127 11cb6: 0e 94 26 7c call 0xf84c ; 0xf84c 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) { 11cba: cc 23 and r28, r28 11cbc: 09 f4 brne .+2 ; 0x11cc0 11cbe: 9f c0 rjmp .+318 ; 0x11dfe if (fan_kick_end == 0) { 11cc0: 80 91 6a 03 lds r24, 0x036A ; 0x80036a 11cc4: 90 91 6b 03 lds r25, 0x036B ; 0x80036b 11cc8: a0 91 6c 03 lds r26, 0x036C ; 0x80036c 11ccc: b0 91 6d 03 lds r27, 0x036D ; 0x80036d 11cd0: 89 2b or r24, r25 11cd2: 8a 2b or r24, r26 11cd4: 8b 2b or r24, r27 11cd6: 81 f4 brne .+32 ; 0x11cf8 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11cd8: 0f 94 55 3e call 0x27caa ; 0x27caa 11cdc: 60 5e subi r22, 0xE0 ; 224 11cde: 7c 4f sbci r23, 0xFC ; 252 11ce0: 8f 4f sbci r24, 0xFF ; 255 11ce2: 9f 4f sbci r25, 0xFF ; 255 11ce4: 60 93 6a 03 sts 0x036A, r22 ; 0x80036a 11ce8: 70 93 6b 03 sts 0x036B, r23 ; 0x80036b 11cec: 80 93 6c 03 sts 0x036C, r24 ; 0x80036c 11cf0: 90 93 6d 03 sts 0x036D, r25 ; 0x80036d tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 11cf4: cf ef ldi r28, 0xFF ; 255 11cf6: 0f c0 rjmp .+30 ; 0x11d16 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()) 11cf8: 0f 94 55 3e call 0x27caa ; 0x27caa 11cfc: 00 91 6a 03 lds r16, 0x036A ; 0x80036a 11d00: 10 91 6b 03 lds r17, 0x036B ; 0x80036b 11d04: 20 91 6c 03 lds r18, 0x036C ; 0x80036c 11d08: 30 91 6d 03 lds r19, 0x036D ; 0x80036d 11d0c: 60 17 cp r22, r16 11d0e: 71 07 cpc r23, r17 11d10: 82 07 cpc r24, r18 11d12: 93 07 cpc r25, r19 11d14: 78 f3 brcs .-34 ; 0x11cf4 } 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 11d16: 80 91 33 05 lds r24, 0x0533 ; 0x800533 11d1a: 88 23 and r24, r24 11d1c: 09 f4 brne .+2 ; 0x11d20 11d1e: 78 c0 rjmp .+240 ; 0x11e10 fanSpeedBckp = tail_fan_speed; 11d20: 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) { 11d24: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.558> 11d28: 81 11 cpse r24, r1 11d2a: 07 c0 rjmp .+14 ; 0x11d3a return; } avoidRecursion = true; 11d2c: 81 e0 ldi r24, 0x01 ; 1 11d2e: 80 93 0c 05 sts 0x050C, r24 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.558> mmu_loop_inner(true); 11d32: 0f 94 ac 99 call 0x33358 ; 0x33358 avoidRecursion = false; 11d36: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.558> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 11d3a: 80 91 d1 05 lds r24, 0x05D1 ; 0x8005d1 <_ZL26lcd_backlight_wake_trigger.lto_priv.556> 11d3e: 88 23 and r24, r24 11d40: e1 f1 breq .+120 ; 0x11dba lcd_backlight_wake_trigger = false; 11d42: 10 92 d1 05 sts 0x05D1, r1 ; 0x8005d1 <_ZL26lcd_backlight_wake_trigger.lto_priv.556> backlight_wake(); 11d46: 80 e0 ldi r24, 0x00 ; 0 11d48: 0e 94 29 8c call 0x11852 ; 0x11852 bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 11d4c: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11d4e: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11d50: 80 91 cf 05 lds r24, 0x05CF ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.557> 11d54: 28 2f mov r18, r24 11d56: 08 2e mov r0, r24 11d58: 00 0c add r0, r0 11d5a: 33 0b sbc r19, r19 11d5c: 37 ff sbrs r19, 7 11d5e: 03 c0 rjmp .+6 ; 0x11d66 11d60: 31 95 neg r19 11d62: 21 95 neg r18 11d64: 31 09 sbc r19, r1 11d66: 24 30 cpi r18, 0x04 ; 4 11d68: 31 05 cpc r19, r1 11d6a: 0c f4 brge .+2 ; 0x11d6e 11d6c: 54 c0 rjmp .+168 ; 0x11e16 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11d6e: 98 2f mov r25, r24 11d70: 87 ff sbrs r24, 7 11d72: 02 c0 rjmp .+4 ; 0x11d78 11d74: 93 e0 ldi r25, 0x03 ; 3 11d76: 98 0f add r25, r24 11d78: 95 95 asr r25 11d7a: 95 95 asr r25 11d7c: 20 91 34 05 lds r18, 0x0534 ; 0x800534 11d80: 30 91 35 05 lds r19, 0x0535 ; 0x800535 11d84: 29 0f add r18, r25 11d86: 31 1d adc r19, r1 11d88: 97 fd sbrc r25, 7 11d8a: 3a 95 dec r19 11d8c: 30 93 35 05 sts 0x0535, r19 ; 0x800535 11d90: 20 93 34 05 sts 0x0534, r18 ; 0x800534 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 11d94: 83 78 andi r24, 0x83 ; 131 11d96: 87 ff sbrs r24, 7 11d98: 03 c0 rjmp .+6 ; 0x11da0 11d9a: 81 50 subi r24, 0x01 ; 1 11d9c: 8c 6f ori r24, 0xFC ; 252 11d9e: 8f 5f subi r24, 0xFF ; 255 11da0: 80 93 cf 05 sts 0x05CF, r24 ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.557> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11da4: 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); 11da6: 86 e0 ldi r24, 0x06 ; 6 11da8: 0f 94 2e 63 call 0x2c65c ; 0x2c65c if (lcd_draw_update == 0) { 11dac: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11db0: 81 11 cpse r24, r1 11db2: 03 c0 rjmp .+6 ; 0x11dba // Update LCD rendering at minimum lcd_draw_update = 1; 11db4: 81 e0 ldi r24, 0x01 ; 1 11db6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11dba: 0e 94 c2 8b call 0x11784 ; 0x11784 // handle longpress if(lcd_longpress_trigger) 11dbe: 80 91 d2 05 lds r24, 0x05D2 ; 0x8005d2 11dc2: 88 23 and r24, r24 11dc4: 61 f0 breq .+24 ; 0x11dde { lcd_consume_click(); // Reset trigger to prevent recursion 11dc6: 0e 94 3e 72 call 0xe47c ; 0xe47c // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11dca: e0 91 0e 04 lds r30, 0x040E ; 0x80040e 11dce: f0 91 0f 04 lds r31, 0x040F ; 0x80040f 11dd2: 30 97 sbiw r30, 0x00 ; 0 11dd4: 21 f0 breq .+8 ; 0x11dde 11dd6: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 11dda: 81 11 cpse r24, r1 { lcd_longpress_func(); 11ddc: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 11dde: 0e 94 74 7b call 0xf6e8 ; 0xf6e8 #endif //AUTO_REPORT host_keepalive(); 11de2: 0e 94 c3 81 call 0x10386 ; 0x10386 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 11de6: 40 e3 ldi r20, 0x30 ; 48 11de8: 55 e7 ldi r21, 0x75 ; 117 11dea: 60 e0 ldi r22, 0x00 ; 0 11dec: 70 e0 ldi r23, 0x00 ; 0 11dee: 8a e9 ldi r24, 0x9A ; 154 11df0: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 11df2: df 91 pop r29 11df4: cf 91 pop r28 11df6: 1f 91 pop r17 11df8: 0f 91 pop r16 11dfa: 0d 94 39 3f jmp 0x27e72 ; 0x27e72 ::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; 11dfe: 10 92 6a 03 sts 0x036A, r1 ; 0x80036a 11e02: 10 92 6b 03 sts 0x036B, r1 ; 0x80036b 11e06: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c 11e0a: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d 11e0e: 83 cf rjmp .-250 ; 0x11d16 #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; 11e10: c0 93 9d 04 sts 0x049D, r28 ; 0x80049d 11e14: 87 cf rjmp .-242 ; 0x11d24 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; 11e16: 10 92 cf 05 sts 0x05CF, r1 ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.557> 11e1a: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 11e1c: 80 e0 ldi r24, 0x00 ; 0 11e1e: c4 cf rjmp .-120 ; 0x11da8 00011e20 : #endif #endif } void delay_keep_alive(unsigned int ms) { 11e20: cf 93 push r28 11e22: df 93 push r29 11e24: ec 01 movw r28, r24 for (;;) { manage_heater(); 11e26: 0f 94 66 4d call 0x29acc ; 0x29acc // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11e2a: 81 e0 ldi r24, 0x01 ; 1 11e2c: 0e 94 6b 8c call 0x118d6 ; 0x118d6 lcd_update(0); 11e30: 80 e0 ldi r24, 0x00 ; 0 11e32: 0e 94 ed 6f call 0xdfda ; 0xdfda if (ms == 0) 11e36: 20 97 sbiw r28, 0x00 ; 0 11e38: 99 f0 breq .+38 ; 0x11e60 break; else if (ms >= 50) { 11e3a: c2 33 cpi r28, 0x32 ; 50 11e3c: d1 05 cpc r29, r1 11e3e: 40 f0 brcs .+16 ; 0x11e50 _delay(50); 11e40: 62 e3 ldi r22, 0x32 ; 50 11e42: 70 e0 ldi r23, 0x00 ; 0 11e44: 80 e0 ldi r24, 0x00 ; 0 11e46: 90 e0 ldi r25, 0x00 ; 0 11e48: 0f 94 5c 3c call 0x278b8 ; 0x278b8 ms -= 50; 11e4c: e2 97 sbiw r28, 0x32 ; 50 11e4e: eb cf rjmp .-42 ; 0x11e26 } else { _delay(ms); 11e50: be 01 movw r22, r28 11e52: 90 e0 ldi r25, 0x00 ; 0 11e54: 80 e0 ldi r24, 0x00 ; 0 11e56: 0f 94 5c 3c call 0x278b8 ; 0x278b8 ms = 0; 11e5a: d0 e0 ldi r29, 0x00 ; 0 11e5c: c0 e0 ldi r28, 0x00 ; 0 11e5e: e3 cf rjmp .-58 ; 0x11e26 } } } 11e60: df 91 pop r29 11e62: cf 91 pop r28 11e64: 08 95 ret 00011e66 : /// @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) { 11e66: cf 93 push r28 11e68: df 93 push r29 11e6a: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11e6c: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11e6e: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 11e72: 81 e0 ldi r24, 0x01 ; 1 11e74: 0e 94 6b 8c call 0x118d6 ; 0x118d6 11e78: 80 91 93 13 lds r24, 0x1393 ; 0x801393 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11e7c: 8f 3f cpi r24, 0xFF ; 255 11e7e: d9 f4 brne .+54 ; 0x11eb6 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11e80: 80 91 28 13 lds r24, 0x1328 ; 0x801328 11e84: 84 30 cpi r24, 0x04 ; 4 11e86: 21 f4 brne .+8 ; 0x11e90 }; 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 11e88: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 11e8c: 81 11 cpse r24, r1 11e8e: ef cf rjmp .-34 ; 0x11e6e 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 11e90: 80 91 66 13 lds r24, 0x1366 ; 0x801366 11e94: 90 91 67 13 lds r25, 0x1367 ; 0x801367 11e98: 01 97 sbiw r24, 0x01 ; 1 11e9a: 49 f7 brne .-46 ; 0x11e6e && lastErrorCode != ec) // The error code is not a duplicate 11e9c: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 11ea0: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 11ea4: 89 32 cpi r24, 0x29 ; 41 11ea6: 90 48 sbci r25, 0x80 ; 128 11ea8: 11 f3 breq .-60 ; 0x11e6e { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11eaa: 60 e0 ldi r22, 0x00 ; 0 11eac: 89 e2 ldi r24, 0x29 ; 41 11eae: 90 e8 ldi r25, 0x80 ; 128 11eb0: 0f 94 1f 82 call 0x3043e ; 0x3043e 11eb4: dc cf rjmp .-72 ; 0x11e6e inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11eb6: d0 93 93 13 sts 0x1393, r29 ; 0x801393 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11eba: 85 30 cpi r24, 0x05 ; 5 11ebc: 39 f4 brne .+14 ; 0x11ecc if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11ebe: cf 3f cpi r28, 0xFF ; 255 11ec0: f9 f2 breq .-66 ; 0x11e80 MMU2::mmu2.eject_filament(eject_slot, true); 11ec2: 61 e0 ldi r22, 0x01 ; 1 11ec4: 8c 2f mov r24, r28 11ec6: 0f 94 46 a0 call 0x3408c ; 0x3408c 11eca: d1 cf rjmp .-94 ; 0x11e6e // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11ecc: 84 30 cpi r24, 0x04 ; 4 11ece: c1 f6 brne .-80 ; 0x11e80 } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11ed0: df 91 pop r29 11ed2: cf 91 pop r28 11ed4: 08 95 ret 00011ed6 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 11ed6: 1f 92 push r1 11ed8: 0f 92 push r0 11eda: 0f b6 in r0, 0x3f ; 63 11edc: 0f 92 push r0 11ede: 11 24 eor r1, r1 11ee0: 0b b6 in r0, 0x3b ; 59 11ee2: 0f 92 push r0 11ee4: 2f 93 push r18 11ee6: 3f 93 push r19 11ee8: 4f 93 push r20 11eea: 5f 93 push r21 11eec: 6f 93 push r22 11eee: 7f 93 push r23 11ef0: 8f 93 push r24 11ef2: 9f 93 push r25 11ef4: af 93 push r26 11ef6: bf 93 push r27 11ef8: ef 93 push r30 11efa: ff 93 push r31 adc_values[adc_channel] += ADC; 11efc: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 11f00: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 11f04: e0 91 34 03 lds r30, 0x0334 ; 0x800334 11f08: f0 e0 ldi r31, 0x00 ; 0 11f0a: ee 0f add r30, r30 11f0c: ff 1f adc r31, r31 11f0e: ec 5d subi r30, 0xDC ; 220 11f10: fc 4f sbci r31, 0xFC ; 252 11f12: 80 81 ld r24, Z 11f14: 91 81 ldd r25, Z+1 ; 0x01 11f16: 82 0f add r24, r18 11f18: 93 1f adc r25, r19 11f1a: 91 83 std Z+1, r25 ; 0x01 11f1c: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 11f1e: 80 91 23 03 lds r24, 0x0323 ; 0x800323 11f22: 8f 5f subi r24, 0xFF ; 255 11f24: 80 93 23 03 sts 0x0323, r24 ; 0x800323 11f28: 80 31 cpi r24, 0x10 ; 16 11f2a: 09 f0 breq .+2 ; 0x11f2e <__vector_29+0x58> 11f2c: 60 c0 rjmp .+192 ; 0x11fee <__vector_29+0x118> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 11f2e: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11f32: 8f 5f subi r24, 0xFF ; 255 11f34: 80 93 34 03 sts 0x0334, r24 ; 0x800334 11f38: 88 30 cpi r24, 0x08 ; 8 11f3a: 09 f0 breq .+2 ; 0x11f3e <__vector_29+0x68> 11f3c: 50 c0 rjmp .+160 ; 0x11fde <__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 11f3e: 80 91 24 03 lds r24, 0x0324 ; 0x800324 11f42: 90 91 25 03 lds r25, 0x0325 ; 0x800325 11f46: 90 93 06 06 sts 0x0606, r25 ; 0x800606 11f4a: 80 93 05 06 sts 0x0605, r24 ; 0x800605 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11f4e: 80 91 28 03 lds r24, 0x0328 ; 0x800328 11f52: 90 91 29 03 lds r25, 0x0329 ; 0x800329 11f56: 90 93 04 06 sts 0x0604, r25 ; 0x800604 11f5a: 80 93 03 06 sts 0x0603, r24 ; 0x800603 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11f5e: 80 91 2a 03 lds r24, 0x032A ; 0x80032a 11f62: 90 91 2b 03 lds r25, 0x032B ; 0x80032b 11f66: 90 93 02 06 sts 0x0602, r25 ; 0x800602 11f6a: 80 93 01 06 sts 0x0601, r24 ; 0x800601 #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR current_temperature_raw_ambient = adc_values[ADC_PIN_IDX(TEMP_AMBIENT_PIN)]; // 5->6 11f6e: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11f72: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11f76: 90 93 10 06 sts 0x0610, r25 ; 0x800610 11f7a: 80 93 0f 06 sts 0x060F, r24 ; 0x80060f #endif //AMBIENT_THERMISTOR #ifdef VOLT_PWR_PIN current_voltage_raw_pwr = adc_values[ADC_PIN_IDX(VOLT_PWR_PIN)]; 11f7e: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11f82: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11f86: 90 93 57 06 sts 0x0657, r25 ; 0x800657 11f8a: 80 93 56 06 sts 0x0656, r24 ; 0x800656 #endif #ifdef VOLT_BED_PIN current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 11f8e: 80 91 32 03 lds r24, 0x0332 ; 0x800332 11f92: 90 91 33 03 lds r25, 0x0333 ; 0x800333 11f96: 90 93 55 06 sts 0x0655, r25 ; 0x800655 11f9a: 80 93 54 06 sts 0x0654, r24 ; 0x800654 #endif #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) fsensor.voltUpdate(adc_values[ADC_PIN_IDX(VOLT_IR_PIN)]); 11f9e: 80 91 30 03 lds r24, 0x0330 ; 0x800330 11fa2: 90 91 31 03 lds r25, 0x0331 ; 0x800331 return event; } void IR_sensor_analog::voltUpdate(uint16_t raw) { // to be called from the ADC ISR when a cycle is finished voltRaw = raw; 11fa6: 90 93 91 17 sts 0x1791, r25 ; 0x801791 11faa: 80 93 90 17 sts 0x1790, r24 ; 0x801790 voltReady = true; 11fae: 81 e0 ldi r24, 0x01 ; 1 11fb0: 80 93 8f 17 sts 0x178F, r24 ; 0x80178f #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) adc_values_ready = true; 11fb4: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16adc_values_ready.lto_priv.469> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11fb8: ff 91 pop r31 11fba: ef 91 pop r30 11fbc: bf 91 pop r27 11fbe: af 91 pop r26 11fc0: 9f 91 pop r25 11fc2: 8f 91 pop r24 11fc4: 7f 91 pop r23 11fc6: 6f 91 pop r22 11fc8: 5f 91 pop r21 11fca: 4f 91 pop r20 11fcc: 3f 91 pop r19 11fce: 2f 91 pop r18 11fd0: 0f 90 pop r0 11fd2: 0b be out 0x3b, r0 ; 59 11fd4: 0f 90 pop r0 11fd6: 0f be out 0x3f, r0 ; 63 11fd8: 0f 90 pop r0 11fda: 1f 90 pop r1 11fdc: 18 95 reti 11fde: 80 91 22 03 lds r24, 0x0322 ; 0x800322 <__data_end> return; // do not start the next measurement since there are no channels remaining } // find the next channel while (++adc_channel_idx) { if (ADC_CHAN_MSK & (1 << adc_channel_idx)) { 11fe2: 4f e5 ldi r20, 0x5F ; 95 11fe4: 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) { 11fe6: 8f 5f subi r24, 0xFF ; 255 11fe8: 41 f4 brne .+16 ; 0x11ffa <__vector_29+0x124> 11fea: 10 92 22 03 sts 0x0322, r1 ; 0x800322 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11fee: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11ff2: 80 64 ori r24, 0x40 ; 64 11ff4: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11ff8: df cf rjmp .-66 ; 0x11fb8 <__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)) { 11ffa: 9a 01 movw r18, r20 11ffc: 08 2e mov r0, r24 11ffe: 02 c0 rjmp .+4 ; 0x12004 <__vector_29+0x12e> 12000: 35 95 asr r19 12002: 27 95 ror r18 12004: 0a 94 dec r0 12006: e2 f7 brpl .-8 ; 0x12000 <__vector_29+0x12a> 12008: 20 ff sbrs r18, 0 1200a: ed cf rjmp .-38 ; 0x11fe6 <__vector_29+0x110> 1200c: 80 93 22 03 sts 0x0322, r24 ; 0x800322 <__data_end> adc_setmux(adc_channel_idx); 12010: 0e 94 8a 5c call 0xb914 ; 0xb914 adc_count = 0; 12014: 10 92 23 03 sts 0x0323, r1 ; 0x800323 12018: ea cf rjmp .-44 ; 0x11fee <__vector_29+0x118> 0001201a : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 1201a: cf 93 push r28 1201c: 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 1201e: ca e7 ldi r28, 0x7A ; 122 12020: d0 e0 ldi r29, 0x00 ; 0 12022: 88 81 ld r24, Y 12024: 8f 7b andi r24, 0xBF ; 191 12026: 88 83 st Y, r24 adc_count = 0; 12028: 10 92 23 03 sts 0x0323, r1 ; 0x800323 adc_channel = 0; 1202c: 10 92 34 03 sts 0x0334, r1 ; 0x800334 adc_channel_idx = first_channel_idx; 12030: 10 92 22 03 sts 0x0322, r1 ; 0x800322 <__data_end> adc_setmux(adc_channel_idx); 12034: 80 e0 ldi r24, 0x00 ; 0 12036: 0e 94 8a 5c call 0xb914 ; 0xb914 memset((void*)adc_values, 0, sizeof(adc_values)); 1203a: e4 e2 ldi r30, 0x24 ; 36 1203c: f3 e0 ldi r31, 0x03 ; 3 1203e: 80 e1 ldi r24, 0x10 ; 16 12040: df 01 movw r26, r30 12042: 1d 92 st X+, r1 12044: 8a 95 dec r24 12046: e9 f7 brne .-6 ; 0x12042 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 12048: 88 81 ld r24, Y 1204a: 80 64 ori r24, 0x40 ; 64 1204c: 88 83 st Y, r24 } 1204e: df 91 pop r29 12050: cf 91 pop r28 12052: 08 95 ret 00012054 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 12054: 2f 92 push r2 12056: 3f 92 push r3 12058: 4f 92 push r4 1205a: 5f 92 push r5 1205c: 6f 92 push r6 1205e: 7f 92 push r7 12060: 8f 92 push r8 12062: 9f 92 push r9 12064: af 92 push r10 12066: bf 92 push r11 12068: cf 92 push r12 1206a: df 92 push r13 1206c: ef 92 push r14 1206e: ff 92 push r15 12070: 0f 93 push r16 12072: 1f 93 push r17 12074: cf 93 push r28 12076: df 93 push r29 12078: cd b7 in r28, 0x3d ; 61 1207a: de b7 in r29, 0x3e ; 62 1207c: a4 97 sbiw r28, 0x24 ; 36 1207e: 0f b6 in r0, 0x3f ; 63 12080: f8 94 cli 12082: de bf out 0x3e, r29 ; 62 12084: 0f be out 0x3f, r0 ; 63 12086: 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(); 12088: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 if (planner_aborted) 1208c: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 12090: 81 11 cpse r24, r1 12092: 17 c0 rjmp .+46 ; 0x120c2 return; mesh_bed_leveling_flag = true; 12094: 81 e0 ldi r24, 0x01 ; 1 12096: 80 93 56 0e sts 0x0E56, r24 ; 0x800e56 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { 1209a: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 1209e: 88 23 and r24, r24 120a0: 49 f0 breq .+18 ; 0x120b4 120a2: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 120a6: 88 23 and r24, r24 120a8: 29 f0 breq .+10 ; 0x120b4 120aa: 20 91 3f 07 lds r18, 0x073F ; 0x80073f 120ae: 2f 83 std Y+7, r18 ; 0x07 120b0: 21 11 cpse r18, r1 120b2: 20 c0 rjmp .+64 ; 0x120f4 120b4: 81 e0 ldi r24, 0x01 ; 1 120b6: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d // 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); 120ba: 8f ef ldi r24, 0xFF ; 255 120bc: 9c e6 ldi r25, 0x6C ; 108 120be: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 120c2: a4 96 adiw r28, 0x24 ; 36 120c4: 0f b6 in r0, 0x3f ; 63 120c6: f8 94 cli 120c8: de bf out 0x3e, r29 ; 62 120ca: 0f be out 0x3f, r0 ; 63 120cc: cd bf out 0x3d, r28 ; 61 120ce: df 91 pop r29 120d0: cf 91 pop r28 120d2: 1f 91 pop r17 120d4: 0f 91 pop r16 120d6: ff 90 pop r15 120d8: ef 90 pop r14 120da: df 90 pop r13 120dc: cf 90 pop r12 120de: bf 90 pop r11 120e0: af 90 pop r10 120e2: 9f 90 pop r9 120e4: 8f 90 pop r8 120e6: 7f 90 pop r7 120e8: 6f 90 pop r6 120ea: 5f 90 pop r5 120ec: 4f 90 pop r4 120ee: 3f 90 pop r3 120f0: 2f 90 pop r2 120f2: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 120f4: 8b ea ldi r24, 0xAB ; 171 120f6: 9d e0 ldi r25, 0x0D ; 13 120f8: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 120fc: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 120fe: 8e e4 ldi r24, 0x4E ; 78 12100: 0e 94 0d 5d call 0xba1a ; 0xba1a 12104: 08 2f mov r16, r24 12106: 0e 94 9f 5c call 0xb93e ; 0xb93e 1210a: 8e 83 std Y+6, r24 ; 0x06 1210c: 00 23 and r16, r16 1210e: 29 f0 breq .+10 ; 0x1211a 12110: 87 30 cpi r24, 0x07 ; 7 12112: 09 f4 brne .+2 ; 0x12116 12114: c9 c0 rjmp .+402 ; 0x122a8 12116: 83 30 cpi r24, 0x03 ; 3 12118: 29 f0 breq .+10 ; 0x12124 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; 1211a: 13 30 cpi r17, 0x03 ; 3 1211c: 09 f0 breq .+2 ; 0x12120 1211e: c3 c0 rjmp .+390 ; 0x122a6 12120: 63 e0 ldi r22, 0x03 ; 3 12122: 6e 83 std Y+6, r22 ; 0x06 12124: 80 e0 ldi r24, 0x00 ; 0 12126: 90 e0 ldi r25, 0x00 ; 0 12128: a0 e8 ldi r26, 0x80 ; 128 1212a: bf e3 ldi r27, 0x3F ; 63 1212c: 8a 83 std Y+2, r24 ; 0x02 1212e: 9b 83 std Y+3, r25 ; 0x03 12130: ac 83 std Y+4, r26 ; 0x04 12132: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 12134: 8a ea ldi r24, 0xAA ; 170 12136: 9d e0 ldi r25, 0x0D ; 13 12138: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1213c: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 1213e: 83 e4 ldi r24, 0x43 ; 67 12140: 0e 94 0d 5d call 0xba1a ; 0xba1a 12144: 18 2f mov r17, r24 12146: 0e 94 9f 5c call 0xb93e ; 0xb93e 1214a: 11 23 and r17, r17 1214c: 29 f0 breq .+10 ; 0x12158 1214e: 88 23 and r24, r24 12150: 19 f0 breq .+6 ; 0x12158 12152: 8b 30 cpi r24, 0x0B ; 11 12154: 08 f4 brcc .+2 ; 0x12158 12156: 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; 12158: 88 e5 ldi r24, 0x58 ; 88 1215a: 0e 94 0d 5d call 0xba1a ; 0xba1a 1215e: 88 23 and r24, r24 12160: 09 f4 brne .+2 ; 0x12164 12162: ab c0 rjmp .+342 ; 0x122ba 12164: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 12168: 20 e0 ldi r18, 0x00 ; 0 1216a: 30 e0 ldi r19, 0x00 ; 0 1216c: 48 e0 ldi r20, 0x08 ; 8 1216e: 52 e4 ldi r21, 0x42 ; 66 12170: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 12174: 20 e0 ldi r18, 0x00 ; 0 12176: 30 e0 ldi r19, 0x00 ; 0 12178: 48 eb ldi r20, 0xB8 ; 184 1217a: 51 e4 ldi r21, 0x41 ; 65 1217c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 12180: 6a 87 std Y+10, r22 ; 0x0a 12182: 7b 87 std Y+11, r23 ; 0x0b 12184: 8c 87 std Y+12, r24 ; 0x0c 12186: 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; 12188: 89 e5 ldi r24, 0x59 ; 89 1218a: 0e 94 0d 5d call 0xba1a ; 0xba1a 1218e: 88 23 and r24, r24 12190: 09 f4 brne .+2 ; 0x12194 12192: 9c c0 rjmp .+312 ; 0x122cc 12194: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 12198: 20 e0 ldi r18, 0x00 ; 0 1219a: 30 e0 ldi r19, 0x00 ; 0 1219c: 48 e0 ldi r20, 0x08 ; 8 1219e: 52 e4 ldi r21, 0x42 ; 66 121a0: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 121a4: 20 e0 ldi r18, 0x00 ; 0 121a6: 30 e0 ldi r19, 0x00 ; 0 121a8: 40 ea ldi r20, 0xA0 ; 160 121aa: 50 e4 ldi r21, 0x40 ; 64 121ac: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 121b0: 6c 8b std Y+20, r22 ; 0x14 121b2: 7d 8b std Y+21, r23 ; 0x15 121b4: 8e 8b std Y+22, r24 ; 0x16 121b6: 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; 121b8: 87 e5 ldi r24, 0x57 ; 87 121ba: 0e 94 0d 5d call 0xba1a ; 0xba1a 121be: 88 23 and r24, r24 121c0: 09 f4 brne .+2 ; 0x121c4 121c2: 89 c0 rjmp .+274 ; 0x122d6 121c4: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 121c8: 2a 85 ldd r18, Y+10 ; 0x0a 121ca: 3b 85 ldd r19, Y+11 ; 0x0b 121cc: 4c 85 ldd r20, Y+12 ; 0x0c 121ce: 5d 85 ldd r21, Y+13 ; 0x0d 121d0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 121d4: 20 e0 ldi r18, 0x00 ; 0 121d6: 30 e0 ldi r19, 0x00 ; 0 121d8: 48 e8 ldi r20, 0x88 ; 136 121da: 52 e4 ldi r21, 0x42 ; 66 121dc: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 121e0: 69 8f std Y+25, r22 ; 0x19 121e2: 7a 8f std Y+26, r23 ; 0x1a 121e4: 8b 8f std Y+27, r24 ; 0x1b 121e6: 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; 121e8: 88 e4 ldi r24, 0x48 ; 72 121ea: 0e 94 0d 5d call 0xba1a ; 0xba1a 121ee: 88 23 and r24, r24 121f0: 09 f4 brne .+2 ; 0x121f4 121f2: 7a c0 rjmp .+244 ; 0x122e8 121f4: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 121f8: 2c 89 ldd r18, Y+20 ; 0x14 121fa: 3d 89 ldd r19, Y+21 ; 0x15 121fc: 4e 89 ldd r20, Y+22 ; 0x16 121fe: 5f 89 ldd r21, Y+23 ; 0x17 12200: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 12204: 20 e0 ldi r18, 0x00 ; 0 12206: 30 e0 ldi r19, 0x00 ; 0 12208: 48 e8 ldi r20, 0x88 ; 136 1220a: 52 e4 ldi r21, 0x42 ; 66 1220c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 12210: 6d 8f std Y+29, r22 ; 0x1d 12212: 7e 8f std Y+30, r23 ; 0x1e 12214: 8f 8f std Y+31, r24 ; 0x1f 12216: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 12218: 0f 94 9d 8b call 0x3173a ; 0x3173a mbl.z_values[0][0] = min_pos[Z_AXIS]; 1221c: 80 91 29 02 lds r24, 0x0229 ; 0x800229 12220: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 12224: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 12228: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 1222c: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e 12230: 90 93 9f 13 sts 0x139F, r25 ; 0x80139f 12234: a0 93 a0 13 sts 0x13A0, r26 ; 0x8013a0 12238: b0 93 a1 13 sts 0x13A1, r27 ; 0x8013a1 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 1223c: 0f 94 d3 c6 call 0x38da6 ; 0x38da6 12240: 05 ec ldi r16, 0xC5 ; 197 12242: 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) 12244: c8 01 movw r24, r16 12246: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 1224a: 01 96 adiw r24, 0x01 ; 1 1224c: 09 f0 breq .+2 ; 0x12250 1224e: 51 c0 rjmp .+162 ; 0x122f2 12250: 0e 5f subi r16, 0xFE ; 254 12252: 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) { 12254: 05 3d cpi r16, 0xD5 ; 213 12256: 8f e0 ldi r24, 0x0F ; 15 12258: 18 07 cpc r17, r24 1225a: a1 f7 brne .-24 ; 0x12244 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 1225c: 21 2c mov r2, r1 1225e: ad e9 ldi r26, 0x9D ; 157 12260: b3 e1 ldi r27, 0x13 ; 19 12262: ba a3 std Y+34, r27 ; 0x22 12264: 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; 12266: b9 87 std Y+9, r27 ; 0x09 12268: a8 87 std Y+8, r26 ; 0x08 1226a: 51 2c mov r5, r1 1226c: 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; 1226e: 31 2c mov r3, r1 12270: 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)); 12272: 84 2d mov r24, r4 12274: 63 e0 ldi r22, 0x03 ; 3 12276: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__udivmodqi4> 1227a: 98 8b std Y+16, r25 ; 0x10 1227c: 68 84 ldd r6, Y+8 ; 0x08 1227e: 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++) { 12280: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 12282: f8 89 ldd r31, Y+16 ; 0x10 12284: f1 11 cpse r31, r1 12286: 37 c0 rjmp .+110 ; 0x122f6 12288: 81 2f mov r24, r17 1228a: 63 e0 ldi r22, 0x03 ; 3 1228c: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__udivmodqi4> 12290: 91 11 cpse r25, r1 12292: 31 c0 rjmp .+98 ; 0x122f6 if (isOn3x3Mesh) { if (has_z && (row || col)) { 12294: 21 10 cpse r2, r1 12296: 3f c1 rjmp .+638 ; 0x12516 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 12298: 7e 81 ldd r23, Y+6 ; 0x06 1229a: 73 30 cpi r23, 0x03 ; 3 1229c: 09 f4 brne .+2 ; 0x122a0 1229e: 70 c0 rjmp .+224 ; 0x12380 122a0: 8f 81 ldd r24, Y+7 ; 0x07 122a2: 8e 87 std Y+14, r24 ; 0x0e 122a4: 37 c0 rjmp .+110 ; 0x12314 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; 122a6: 1e 83 std Y+6, r17 ; 0x06 122a8: 6a e9 ldi r22, 0x9A ; 154 122aa: 79 e9 ldi r23, 0x99 ; 153 122ac: 89 e1 ldi r24, 0x19 ; 25 122ae: 9f e3 ldi r25, 0x3F ; 63 122b0: 6a 83 std Y+2, r22 ; 0x02 122b2: 7b 83 std Y+3, r23 ; 0x03 122b4: 8c 83 std Y+4, r24 ; 0x04 122b6: 9d 83 std Y+5, r25 ; 0x05 122b8: 3d cf rjmp .-390 ; 0x12134 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; 122ba: 80 e0 ldi r24, 0x00 ; 0 122bc: 90 e0 ldi r25, 0x00 ; 0 122be: a0 e8 ldi r26, 0x80 ; 128 122c0: bf ef ldi r27, 0xFF ; 255 122c2: 8a 87 std Y+10, r24 ; 0x0a 122c4: 9b 87 std Y+11, r25 ; 0x0b 122c6: ac 87 std Y+12, r26 ; 0x0c 122c8: bd 87 std Y+13, r27 ; 0x0d 122ca: 5e cf rjmp .-324 ; 0x12188 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 122cc: 60 e0 ldi r22, 0x00 ; 0 122ce: 70 e0 ldi r23, 0x00 ; 0 122d0: 80 e8 ldi r24, 0x80 ; 128 122d2: 9f ef ldi r25, 0xFF ; 255 122d4: 6d cf rjmp .-294 ; 0x121b0 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 122d6: 80 e0 ldi r24, 0x00 ; 0 122d8: 90 e0 ldi r25, 0x00 ; 0 122da: a0 e8 ldi r26, 0x80 ; 128 122dc: bf e7 ldi r27, 0x7F ; 127 122de: 89 8f std Y+25, r24 ; 0x19 122e0: 9a 8f std Y+26, r25 ; 0x1a 122e2: ab 8f std Y+27, r26 ; 0x1b 122e4: bc 8f std Y+28, r27 ; 0x1c 122e6: 80 cf rjmp .-256 ; 0x121e8 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 122e8: 60 e0 ldi r22, 0x00 ; 0 122ea: 70 e0 ldi r23, 0x00 ; 0 122ec: 80 e8 ldi r24, 0x80 ; 128 122ee: 9f e7 ldi r25, 0x7F ; 127 122f0: 8f cf rjmp .-226 ; 0x12210 122f2: 2f 80 ldd r2, Y+7 ; 0x07 122f4: b4 cf rjmp .-152 ; 0x1225e 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; } 122f6: 60 e0 ldi r22, 0x00 ; 0 122f8: 70 e0 ldi r23, 0x00 ; 0 122fa: 80 ec ldi r24, 0xC0 ; 192 122fc: 9f e7 ldi r25, 0x7F ; 127 122fe: d3 01 movw r26, r6 12300: 11 96 adiw r26, 0x01 ; 1 12302: 6d 93 st X+, r22 12304: 7d 93 st X+, r23 12306: 8d 93 st X+, r24 12308: 9c 93 st X, r25 1230a: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 1230c: be 81 ldd r27, Y+6 ; 0x06 1230e: b3 30 cpi r27, 0x03 ; 3 12310: c1 f1 breq .+112 ; 0x12382 12312: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 12314: 81 2f mov r24, r17 12316: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 1231a: 4b 01 movw r8, r22 1231c: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 1231e: 80 2f mov r24, r16 12320: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 12324: 6b 01 movw r12, r22 12326: 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)) { 12328: a5 01 movw r20, r10 1232a: 94 01 movw r18, r8 1232c: 6a 85 ldd r22, Y+10 ; 0x0a 1232e: 7b 85 ldd r23, Y+11 ; 0x0b 12330: 8c 85 ldd r24, Y+12 ; 0x0c 12332: 9d 85 ldd r25, Y+13 ; 0x0d 12334: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 12338: 18 16 cp r1, r24 1233a: 0c f4 brge .+2 ; 0x1233e 1233c: 1c c1 rjmp .+568 ; 0x12576 1233e: 29 8d ldd r18, Y+25 ; 0x19 12340: 3a 8d ldd r19, Y+26 ; 0x1a 12342: 4b 8d ldd r20, Y+27 ; 0x1b 12344: 5c 8d ldd r21, Y+28 ; 0x1c 12346: c5 01 movw r24, r10 12348: b4 01 movw r22, r8 1234a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1234e: 18 16 cp r1, r24 12350: 0c f4 brge .+2 ; 0x12354 12352: 11 c1 rjmp .+546 ; 0x12576 12354: a7 01 movw r20, r14 12356: 96 01 movw r18, r12 12358: 6c 89 ldd r22, Y+20 ; 0x14 1235a: 7d 89 ldd r23, Y+21 ; 0x15 1235c: 8e 89 ldd r24, Y+22 ; 0x16 1235e: 9f 89 ldd r25, Y+23 ; 0x17 12360: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 12364: 18 16 cp r1, r24 12366: 0c f4 brge .+2 ; 0x1236a 12368: 06 c1 rjmp .+524 ; 0x12576 1236a: 2d 8d ldd r18, Y+29 ; 0x1d 1236c: 3e 8d ldd r19, Y+30 ; 0x1e 1236e: 4f 8d ldd r20, Y+31 ; 0x1f 12370: 58 a1 ldd r21, Y+32 ; 0x20 12372: c7 01 movw r24, r14 12374: b6 01 movw r22, r12 12376: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1237a: 18 16 cp r1, r24 1237c: 0c f4 brge .+2 ; 0x12380 1237e: fb c0 rjmp .+502 ; 0x12576 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 12380: 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++) { 12382: 1f 5f subi r17, 0xFF ; 255 12384: 24 e0 ldi r18, 0x04 ; 4 12386: 62 0e add r6, r18 12388: 71 1c adc r7, r1 1238a: 17 30 cpi r17, 0x07 ; 7 1238c: 09 f0 breq .+2 ; 0x12390 1238e: 79 cf rjmp .-270 ; 0x12282 12390: 6f ef ldi r22, 0xFF ; 255 12392: 46 1a sub r4, r22 12394: 56 0a sbc r5, r22 12396: 88 85 ldd r24, Y+8 ; 0x08 12398: 99 85 ldd r25, Y+9 ; 0x09 1239a: 4c 96 adiw r24, 0x1c ; 28 1239c: 99 87 std Y+9, r25 ; 0x09 1239e: 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++) { 123a0: 97 e0 ldi r25, 0x07 ; 7 123a2: 49 16 cp r4, r25 123a4: 51 04 cpc r5, r1 123a6: 09 f0 breq .+2 ; 0x123aa 123a8: 63 cf rjmp .-314 ; 0x12270 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 123aa: 0f 94 51 16 call 0x22ca2 ; 0x22ca2 // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 123ae: a0 91 72 07 lds r26, 0x0772 ; 0x800772 123b2: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 123b4: b0 91 f0 03 lds r27, 0x03F0 ; 0x8003f0 123b8: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 123ba: 81 e0 ldi r24, 0x01 ; 1 123bc: 80 93 72 07 sts 0x0772, r24 ; 0x800772 custom_message_state = meshPointsToProbe + 10; 123c0: 8a e0 ldi r24, 0x0A ; 10 123c2: 83 0d add r24, r3 123c4: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 lcd_update(1); 123c8: 81 e0 ldi r24, 0x01 ; 1 123ca: 0e 94 ed 6f call 0xdfda ; 0xdfda // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 123ce: 80 e0 ldi r24, 0x00 ; 0 123d0: 90 e0 ldi r25, 0x00 ; 0 123d2: a0 ea ldi r26, 0xA0 ; 160 123d4: b0 e4 ldi r27, 0x40 ; 64 123d6: 80 93 48 07 sts 0x0748, r24 ; 0x800748 123da: 90 93 49 07 sts 0x0749, r25 ; 0x800749 123de: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 123e2: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 123e6: 65 e5 ldi r22, 0x55 ; 85 123e8: 75 e5 ldi r23, 0x55 ; 85 123ea: 85 e5 ldi r24, 0x55 ; 85 123ec: 91 e4 ldi r25, 0x41 ; 65 123ee: 0f 94 11 ba call 0x37422 ; 0x37422 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 123f2: 80 e0 ldi r24, 0x00 ; 0 123f4: 0e 94 2e 68 call 0xd05c ; 0xd05c 123f8: 9c a3 std Y+36, r25 ; 0x24 123fa: 8b a3 std Y+35, r24 ; 0x23 123fc: 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 123fe: 83 2d mov r24, r3 12400: 67 e0 ldi r22, 0x07 ; 7 12402: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__udivmodqi4> 12406: f8 2e mov r15, r24 12408: 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 1240a: 68 2f mov r22, r24 1240c: 70 e0 ldi r23, 0x00 ; 0 1240e: 7f 87 std Y+15, r23 ; 0x0f 12410: 6e 87 std Y+14, r22 ; 0x0e 12412: 80 ff sbrs r24, 0 12414: 03 c0 rjmp .+6 ; 0x1241c 12416: 76 e0 ldi r23, 0x06 ; 6 12418: 79 1b sub r23, r25 1241a: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 1241c: 80 2f mov r24, r16 1241e: 63 e0 ldi r22, 0x03 ; 3 12420: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__udivmodqi4> 12424: 91 11 cpse r25, r1 12426: 05 c0 rjmp .+10 ; 0x12432 12428: 8f 2d mov r24, r15 1242a: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__udivmodqi4> 1242e: 11 e0 ldi r17, 0x01 ; 1 12430: 91 11 cpse r25, r1 12432: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 12434: 80 2f mov r24, r16 12436: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 1243a: 68 8b std Y+16, r22 ; 0x10 1243c: 79 8b std Y+17, r23 ; 0x11 1243e: 8a 8b std Y+18, r24 ; 0x12 12440: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 12442: 8f 2d mov r24, r15 12444: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 12448: 4b 01 movw r8, r22 1244a: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 1244c: 8e 81 ldd r24, Y+6 ; 0x06 1244e: 83 30 cpi r24, 0x03 ; 3 12450: 09 f0 breq .+2 ; 0x12454 12452: 99 c0 rjmp .+306 ; 0x12586 if (!isOn3x3Mesh) { 12454: 11 11 cpse r17, r1 12456: c8 c0 rjmp .+400 ; 0x125e8 12458: 27 e0 ldi r18, 0x07 ; 7 1245a: ae 85 ldd r26, Y+14 ; 0x0e 1245c: bf 85 ldd r27, Y+15 ; 0x0f 1245e: 2a 9f mul r18, r26 12460: f0 01 movw r30, r0 12462: 2b 9f mul r18, r27 12464: f0 0d add r31, r0 12466: 11 24 eor r1, r1 12468: e0 0f add r30, r16 1246a: f1 1d adc r31, r1 1246c: ee 0f add r30, r30 1246e: ff 1f adc r31, r31 12470: ee 0f add r30, r30 12472: ff 1f adc r31, r31 12474: e3 56 subi r30, 0x63 ; 99 12476: fc 4e sbci r31, 0xEC ; 236 12478: 60 e0 ldi r22, 0x00 ; 0 1247a: 70 e0 ldi r23, 0x00 ; 0 1247c: 80 ec ldi r24, 0xC0 ; 192 1247e: 9f e7 ldi r25, 0x7F ; 127 12480: 61 83 std Z+1, r22 ; 0x01 12482: 72 83 std Z+2, r23 ; 0x02 12484: 83 83 std Z+3, r24 ; 0x03 12486: 94 83 std Z+4, r25 ; 0x04 12488: 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) { 1248a: e1 e3 ldi r30, 0x31 ; 49 1248c: 3e 12 cpse r3, r30 1248e: b7 cf rjmp .-146 ; 0x123fe custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12490: 80 e0 ldi r24, 0x00 ; 0 12492: 90 e0 ldi r25, 0x00 ; 0 12494: a0 ea ldi r26, 0xA0 ; 160 12496: b0 e4 ldi r27, 0x40 ; 64 12498: 80 93 48 07 sts 0x0748, r24 ; 0x800748 1249c: 90 93 49 07 sts 0x0749, r25 ; 0x800749 124a0: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 124a4: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 124a8: 65 e5 ldi r22, 0x55 ; 85 124aa: 75 e5 ldi r23, 0x55 ; 85 124ac: 85 e5 ldi r24, 0x55 ; 85 124ae: 91 e4 ldi r25, 0x41 ; 65 124b0: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 124b4: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 124b8: b1 e3 ldi r27, 0x31 ; 49 124ba: 3b 16 cp r3, r27 124bc: 09 f4 brne .+2 ; 0x124c0 124be: 33 c2 rjmp .+1126 ; 0x12926 if (g80_fail_cnt++ >= 1) { 124c0: 80 91 68 03 lds r24, 0x0368 ; 0x800368 124c4: 91 e0 ldi r25, 0x01 ; 1 124c6: 98 0f add r25, r24 124c8: 90 93 68 03 sts 0x0368, r25 ; 0x800368 124cc: 88 23 and r24, r24 124ce: 09 f4 brne .+2 ; 0x124d2 124d0: d3 c1 rjmp .+934 ; 0x12878 print_stop(); 124d2: 60 e0 ldi r22, 0x00 ; 0 124d4: 80 e0 ldi r24, 0x00 ; 0 124d6: 0f 94 e1 14 call 0x229c2 ; 0x229c2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 124da: 86 e4 ldi r24, 0x46 ; 70 124dc: 96 e3 ldi r25, 0x36 ; 54 124de: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 124e2: 0f 94 d6 34 call 0x269ac ; 0x269ac lcd_z_calibration_prompt(false); 124e6: 80 e0 ldi r24, 0x00 ; 0 124e8: 0f 94 42 66 call 0x2cc84 ; 0x2cc84 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 124ec: 81 e0 ldi r24, 0x01 ; 1 124ee: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 124f2: 81 e5 ldi r24, 0x51 ; 81 124f4: 91 e7 ldi r25, 0x71 ; 113 124f6: 0f 94 e0 0a call 0x215c0 ; 0x215c0 custom_message_type = custom_message_type_old; 124fa: 2f 81 ldd r18, Y+7 ; 0x07 124fc: 20 93 72 07 sts 0x0772, r18 ; 0x800772 custom_message_state = custom_message_state_old; 12500: 68 85 ldd r22, Y+8 ; 0x08 12502: 60 93 f0 03 sts 0x03F0, r22 ; 0x8003f0 lcd_update(2); 12506: 82 e0 ldi r24, 0x02 ; 2 12508: 0e 94 ed 6f call 0xdfda ; 0xdfda st_synchronize(); 1250c: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 mesh_bed_leveling_flag = false; 12510: 10 92 56 0e sts 0x0E56, r1 ; 0x800e56 12514: d6 cd rjmp .-1108 ; 0x120c2 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)) { 12516: 01 11 cpse r16, r1 12518: 03 c0 rjmp .+6 ; 0x12520 1251a: 11 23 and r17, r17 1251c: 09 f4 brne .+2 ; 0x12520 1251e: bc ce rjmp .-648 ; 0x12298 // 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))); 12520: 81 2f mov r24, r17 12522: 63 e0 ldi r22, 0x03 ; 3 12524: 0f 94 ca dd call 0x3bb94 ; 0x3bb94 <__divmodqi4> 12528: 84 0d add r24, r4 1252a: 95 2d mov r25, r5 1252c: 91 1d adc r25, r1 1252e: 88 0f add r24, r24 12530: 99 1f adc r25, r25 12532: 8d 53 subi r24, 0x3D ; 61 12534: 90 4f sbci r25, 0xF0 ; 240 12536: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 1253a: bc 01 movw r22, r24 1253c: 99 0f add r25, r25 1253e: 88 0b sbc r24, r24 12540: 99 0b sbc r25, r25 12542: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 12546: 2a e0 ldi r18, 0x0A ; 10 12548: 37 ed ldi r19, 0xD7 ; 215 1254a: 43 e2 ldi r20, 0x23 ; 35 1254c: 5c e3 ldi r21, 0x3C ; 60 1254e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 12552: 9b 01 movw r18, r22 12554: ac 01 movw r20, r24 12556: 60 91 9e 13 lds r22, 0x139E ; 0x80139e 1255a: 70 91 9f 13 lds r23, 0x139F ; 0x80139f 1255e: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 12562: 90 91 a1 13 lds r25, 0x13A1 ; 0x8013a1 12566: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1256a: f3 01 movw r30, r6 1256c: 61 83 std Z+1, r22 ; 0x01 1256e: 72 83 std Z+2, r23 ; 0x02 12570: 83 83 std Z+3, r24 ; 0x03 12572: 94 83 std Z+4, r25 ; 0x04 12574: 91 ce rjmp .-734 ; 0x12298 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)) { 12576: fe 85 ldd r31, Y+14 ; 0x0e 12578: ff 23 and r31, r31 1257a: 09 f4 brne .+2 ; 0x1257e 1257c: 02 cf rjmp .-508 ; 0x12382 1257e: 22 20 and r2, r2 12580: 09 f4 brne .+2 ; 0x12584 12582: fe ce rjmp .-516 ; 0x12380 12584: fe ce rjmp .-516 ; 0x12382 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)) { 12586: 28 89 ldd r18, Y+16 ; 0x10 12588: 39 89 ldd r19, Y+17 ; 0x11 1258a: 4a 89 ldd r20, Y+18 ; 0x12 1258c: 5b 89 ldd r21, Y+19 ; 0x13 1258e: 6a 85 ldd r22, Y+10 ; 0x0a 12590: 7b 85 ldd r23, Y+11 ; 0x0b 12592: 8c 85 ldd r24, Y+12 ; 0x0c 12594: 9d 85 ldd r25, Y+13 ; 0x0d 12596: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1259a: 18 16 cp r1, r24 1259c: 04 f1 brlt .+64 ; 0x125de 1259e: 28 89 ldd r18, Y+16 ; 0x10 125a0: 39 89 ldd r19, Y+17 ; 0x11 125a2: 4a 89 ldd r20, Y+18 ; 0x12 125a4: 5b 89 ldd r21, Y+19 ; 0x13 125a6: 69 8d ldd r22, Y+25 ; 0x19 125a8: 7a 8d ldd r23, Y+26 ; 0x1a 125aa: 8b 8d ldd r24, Y+27 ; 0x1b 125ac: 9c 8d ldd r25, Y+28 ; 0x1c 125ae: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 125b2: 87 fd sbrc r24, 7 125b4: 14 c0 rjmp .+40 ; 0x125de 125b6: a5 01 movw r20, r10 125b8: 94 01 movw r18, r8 125ba: 6c 89 ldd r22, Y+20 ; 0x14 125bc: 7d 89 ldd r23, Y+21 ; 0x15 125be: 8e 89 ldd r24, Y+22 ; 0x16 125c0: 9f 89 ldd r25, Y+23 ; 0x17 125c2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 125c6: 18 16 cp r1, r24 125c8: 54 f0 brlt .+20 ; 0x125de 125ca: a5 01 movw r20, r10 125cc: 94 01 movw r18, r8 125ce: 6d 8d ldd r22, Y+29 ; 0x1d 125d0: 7e 8d ldd r23, Y+30 ; 0x1e 125d2: 8f 8d ldd r24, Y+31 ; 0x1f 125d4: 98 a1 ldd r25, Y+32 ; 0x20 125d6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 125da: 87 ff sbrs r24, 7 125dc: 05 c0 rjmp .+10 ; 0x125e8 125de: 11 23 and r17, r17 125e0: 09 f4 brne .+2 ; 0x125e4 125e2: 52 cf rjmp .-348 ; 0x12488 125e4: 21 10 cpse r2, r1 125e6: 50 cf rjmp .-352 ; 0x12488 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 125e8: 10 e0 ldi r17, 0x00 ; 0 125ea: a7 e0 ldi r26, 0x07 ; 7 125ec: 8e 85 ldd r24, Y+14 ; 0x0e 125ee: 9f 85 ldd r25, Y+15 ; 0x0f 125f0: a8 9f mul r26, r24 125f2: f0 01 movw r30, r0 125f4: a9 9f mul r26, r25 125f6: f0 0d add r31, r0 125f8: 11 24 eor r1, r1 125fa: e0 0f add r30, r16 125fc: f1 1f adc r31, r17 125fe: ee 0f add r30, r30 12600: ff 1f adc r31, r31 12602: ee 0f add r30, r30 12604: ff 1f adc r31, r31 12606: e3 56 subi r30, 0x63 ; 99 12608: fc 4e sbci r31, 0xEC ; 236 1260a: 41 80 ldd r4, Z+1 ; 0x01 1260c: 52 80 ldd r5, Z+2 ; 0x02 1260e: 63 80 ldd r6, Z+3 ; 0x03 12610: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 12612: c1 2c mov r12, r1 12614: d1 2c mov r13, r1 12616: e0 ea ldi r30, 0xA0 ; 160 12618: ee 2e mov r14, r30 1261a: e0 e4 ldi r30, 0x40 ; 64 1261c: fe 2e mov r15, r30 1261e: 22 20 and r2, r2 12620: 51 f0 breq .+20 ; 0x12636 12622: 23 e3 ldi r18, 0x33 ; 51 12624: 33 e3 ldi r19, 0x33 ; 51 12626: 43 eb ldi r20, 0xB3 ; 179 12628: 5e e3 ldi r21, 0x3E ; 62 1262a: c3 01 movw r24, r6 1262c: b2 01 movw r22, r4 1262e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 12632: 6b 01 movw r12, r22 12634: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 12636: a7 01 movw r20, r14 12638: 96 01 movw r18, r12 1263a: 60 91 48 07 lds r22, 0x0748 ; 0x800748 1263e: 70 91 49 07 lds r23, 0x0749 ; 0x800749 12642: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 12646: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 1264a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1264e: 87 ff sbrs r24, 7 12650: 10 c0 rjmp .+32 ; 0x12672 current_position[Z_AXIS] = init_z_bckp; 12652: c0 92 48 07 sts 0x0748, r12 ; 0x800748 12656: d0 92 49 07 sts 0x0749, r13 ; 0x800749 1265a: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 1265e: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12662: 65 e5 ldi r22, 0x55 ; 85 12664: 75 e5 ldi r23, 0x55 ; 85 12666: 85 e5 ldi r24, 0x55 ; 85 12668: 91 e4 ldi r25, 0x41 ; 65 1266a: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1266e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12672: 68 89 ldd r22, Y+16 ; 0x10 12674: 79 89 ldd r23, Y+17 ; 0x11 12676: 8a 89 ldd r24, Y+18 ; 0x12 12678: 9b 89 ldd r25, Y+19 ; 0x13 1267a: 60 93 40 07 sts 0x0740, r22 ; 0x800740 1267e: 70 93 41 07 sts 0x0741, r23 ; 0x800741 12682: 80 93 42 07 sts 0x0742, r24 ; 0x800742 12686: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] = y_pos; 1268a: 80 92 44 07 sts 0x0744, r8 ; 0x800744 1268e: 90 92 45 07 sts 0x0745, r9 ; 0x800745 12692: a0 92 46 07 sts 0x0746, r10 ; 0x800746 12696: b0 92 47 07 sts 0x0747, r11 ; 0x800747 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 1269a: 64 e4 ldi r22, 0x44 ; 68 1269c: 77 e0 ldi r23, 0x07 ; 7 1269e: 80 e4 ldi r24, 0x40 ; 64 126a0: 97 e0 ldi r25, 0x07 ; 7 126a2: 0e 94 f0 6b call 0xd7e0 ; 0xd7e0 plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 126a6: 60 e0 ldi r22, 0x00 ; 0 126a8: 70 e0 ldi r23, 0x00 ; 0 126aa: 86 e1 ldi r24, 0x16 ; 22 126ac: 93 e4 ldi r25, 0x43 ; 67 126ae: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 126b2: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 if (planner_aborted) 126b6: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 126ba: 88 23 and r24, r24 126bc: 39 f0 breq .+14 ; 0x126cc { custom_message_type = custom_message_type_old; 126be: 7f 81 ldd r23, Y+7 ; 0x07 126c0: 70 93 72 07 sts 0x0772, r23 ; 0x800772 custom_message_state = custom_message_state_old; 126c4: 88 85 ldd r24, Y+8 ; 0x08 126c6: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 126ca: fb cc rjmp .-1546 ; 0x120c2 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 126cc: 81 2c mov r8, r1 126ce: 91 2c mov r9, r1 126d0: 70 e2 ldi r23, 0x20 ; 32 126d2: a7 2e mov r10, r23 126d4: 71 ec ldi r23, 0xC1 ; 193 126d6: b7 2e mov r11, r23 126d8: 22 20 and r2, r2 126da: 51 f0 breq .+20 ; 0x126f0 126dc: 2a 81 ldd r18, Y+2 ; 0x02 126de: 3b 81 ldd r19, Y+3 ; 0x03 126e0: 4c 81 ldd r20, Y+4 ; 0x04 126e2: 5d 81 ldd r21, Y+5 ; 0x05 126e4: c3 01 movw r24, r6 126e6: b2 01 movw r22, r4 126e8: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 126ec: 4b 01 movw r8, r22 126ee: 5c 01 movw r10, r24 126f0: 48 8d ldd r20, Y+24 ; 0x18 126f2: c5 01 movw r24, r10 126f4: b4 01 movw r22, r8 126f6: 0f 94 a7 8b call 0x3174e ; 0x3174e 126fa: 81 11 cpse r24, r1 126fc: 0b c0 rjmp .+22 ; 0x12714 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)); 126fe: 8c eb ldi r24, 0xBC ; 188 12700: 95 e6 ldi r25, 0x65 ; 101 12702: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 12706: 9f 93 push r25 12708: 8f 93 push r24 1270a: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1270e: 0f 90 pop r0 12710: 0f 90 pop r0 12712: be ce rjmp .-644 ; 0x12490 // 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. 12714: 20 91 48 07 lds r18, 0x0748 ; 0x800748 12718: 30 91 49 07 lds r19, 0x0749 ; 0x800749 1271c: 40 91 4a 07 lds r20, 0x074A ; 0x80074a 12720: 50 91 4b 07 lds r21, 0x074B ; 0x80074b 12724: c7 01 movw r24, r14 12726: b6 01 movw r22, r12 12728: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1272c: 20 e0 ldi r18, 0x00 ; 0 1272e: 30 e0 ldi r19, 0x00 ; 0 12730: a9 01 movw r20, r18 12732: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 12736: 87 ff sbrs r24, 7 12738: 36 c0 rjmp .+108 ; 0x127a6 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1273a: 60 e0 ldi r22, 0x00 ; 0 1273c: 70 e0 ldi r23, 0x00 ; 0 1273e: 80 ea ldi r24, 0xA0 ; 160 12740: 90 e4 ldi r25, 0x40 ; 64 12742: 60 93 48 07 sts 0x0748, r22 ; 0x800748 12746: 70 93 49 07 sts 0x0749, r23 ; 0x800749 1274a: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 1274e: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12752: 65 e5 ldi r22, 0x55 ; 85 12754: 75 e5 ldi r23, 0x55 ; 85 12756: 85 e5 ldi r24, 0x55 ; 85 12758: 91 e4 ldi r25, 0x41 ; 65 1275a: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1275e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 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 12762: 48 8d ldd r20, Y+24 ; 0x18 12764: c5 01 movw r24, r10 12766: b4 01 movw r22, r8 12768: 0f 94 a7 8b call 0x3174e ; 0x3174e 1276c: 88 23 and r24, r24 1276e: 39 f2 breq .-114 ; 0x126fe printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 12770: 20 91 48 07 lds r18, 0x0748 ; 0x800748 12774: 30 91 49 07 lds r19, 0x0749 ; 0x800749 12778: 40 91 4a 07 lds r20, 0x074A ; 0x80074a 1277c: 50 91 4b 07 lds r21, 0x074B ; 0x80074b 12780: 60 e0 ldi r22, 0x00 ; 0 12782: 70 e0 ldi r23, 0x00 ; 0 12784: 80 ea ldi r24, 0xA0 ; 160 12786: 90 e4 ldi r25, 0x40 ; 64 12788: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1278c: 2d ec ldi r18, 0xCD ; 205 1278e: 3c ec ldi r19, 0xCC ; 204 12790: 4c ec ldi r20, 0xCC ; 204 12792: 5d e3 ldi r21, 0x3D ; 61 12794: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 12798: 87 ff sbrs r24, 7 1279a: 05 c0 rjmp .+10 ; 0x127a6 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 1279c: 89 e5 ldi r24, 0x59 ; 89 1279e: 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")); 127a0: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 127a4: 75 ce rjmp .-790 ; 0x12490 127a6: c0 90 48 07 lds r12, 0x0748 ; 0x800748 127aa: d0 90 49 07 lds r13, 0x0749 ; 0x800749 127ae: e0 90 4a 07 lds r14, 0x074A ; 0x80074a 127b2: f0 90 4b 07 lds r15, 0x074B ; 0x80074b 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 127b6: 22 20 and r2, r2 127b8: a1 f0 breq .+40 ; 0x127e2 127ba: a7 01 movw r20, r14 127bc: 96 01 movw r18, r12 127be: c3 01 movw r24, r6 127c0: b2 01 movw r22, r4 127c2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 127c6: 9b 01 movw r18, r22 127c8: ac 01 movw r20, r24 127ca: 5f 77 andi r21, 0x7F ; 127 127cc: 6a 81 ldd r22, Y+2 ; 0x02 127ce: 7b 81 ldd r23, Y+3 ; 0x03 127d0: 8c 81 ldd r24, Y+4 ; 0x04 127d2: 9d 81 ldd r25, Y+5 ; 0x05 127d4: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 127d8: 87 ff sbrs r24, 7 127da: 03 c0 rjmp .+6 ; 0x127e2 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 127dc: 80 e2 ldi r24, 0x20 ; 32 127de: 9e e7 ldi r25, 0x7E ; 126 127e0: df cf rjmp .-66 ; 0x127a0 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 127e2: 8f ea ldi r24, 0xAF ; 175 127e4: 9f e0 ldi r25, 0x0F ; 15 127e6: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 127ea: 88 23 and r24, r24 127ec: 09 f4 brne .+2 ; 0x127f0 127ee: 40 c0 rjmp .+128 ; 0x12870 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); } 127f0: 86 ea ldi r24, 0xA6 ; 166 127f2: 9f e0 ldi r25, 0x0F ; 15 127f4: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e if (!calibration_status_pinda()) return 0; 127f8: 88 23 and r24, r24 127fa: d1 f1 breq .+116 ; 0x12870 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 127fc: 60 91 95 03 lds r22, 0x0395 ; 0x800395 12800: 70 91 96 03 lds r23, 0x0396 ; 0x800396 12804: 80 91 97 03 lds r24, 0x0397 ; 0x800397 12808: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1280c: 0e 94 d0 5d call 0xbba0 ; 0xbba0 12810: 20 91 77 06 lds r18, 0x0677 ; 0x800677 12814: 30 91 78 06 lds r19, 0x0678 ; 0x800678 12818: 40 91 79 06 lds r20, 0x0679 ; 0x800679 1281c: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 12820: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 12824: 9b 01 movw r18, r22 12826: ac 01 movw r20, r24 12828: e7 e0 ldi r30, 0x07 ; 7 1282a: ae 85 ldd r26, Y+14 ; 0x0e 1282c: bf 85 ldd r27, Y+15 ; 0x0f 1282e: ea 9f mul r30, r26 12830: c0 01 movw r24, r0 12832: eb 9f mul r30, r27 12834: 90 0d add r25, r0 12836: 11 24 eor r1, r1 12838: 08 0f add r16, r24 1283a: 19 1f adc r17, r25 1283c: 00 0f add r16, r16 1283e: 11 1f adc r17, r17 12840: 00 0f add r16, r16 12842: 11 1f adc r17, r17 12844: 03 56 subi r16, 0x63 ; 99 12846: 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; 12848: c7 01 movw r24, r14 1284a: b6 01 movw r22, r12 1284c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 12850: d8 01 movw r26, r16 12852: 11 96 adiw r26, 0x01 ; 1 12854: 6d 93 st X+, r22 12856: 7d 93 st X+, r23 12858: 8d 93 st X+, r24 1285a: 9c 93 st X, r25 1285c: 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--; 1285e: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 12862: 81 50 subi r24, 0x01 ; 1 12864: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 mesh_point++; lcd_update(1); 12868: 81 e0 ldi r24, 0x01 ; 1 1286a: 0e 94 ed 6f call 0xdfda ; 0xdfda 1286e: 0c ce rjmp .-1000 ; 0x12488 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 12870: 20 e0 ldi r18, 0x00 ; 0 12872: 30 e0 ldi r19, 0x00 ; 0 12874: a9 01 movw r20, r18 12876: d8 cf rjmp .-80 ; 0x12828 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); 12878: 85 e0 ldi r24, 0x05 ; 5 1287a: 0f 94 2e 63 call 0x2c65c ; 0x2c65c 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; 1287e: c1 2c mov r12, r1 12880: d1 2c mov r13, r1 12882: 90 ea ldi r25, 0xA0 ; 160 12884: e9 2e mov r14, r25 12886: 90 e4 ldi r25, 0x40 ; 64 12888: 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)); 1288a: 82 e1 ldi r24, 0x12 ; 18 1288c: 96 e3 ldi r25, 0x36 ; 54 1288e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 12892: 0f 94 4f 34 call 0x2689e ; 0x2689e #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 12896: 8e e1 ldi r24, 0x1E ; 30 12898: 90 e0 ldi r25, 0x00 ; 0 1289a: 0f 94 39 4f call 0x29e72 ; 0x29e72 calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 1289e: 0e 94 84 74 call 0xe908 ; 0xe908 #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); 128a2: 80 e0 ldi r24, 0x00 ; 0 128a4: 0f 94 09 63 call 0x2c612 ; 0x2c612 128a8: 18 2f mov r17, r24 raise_z(-1); 128aa: 60 e0 ldi r22, 0x00 ; 0 128ac: 70 e0 ldi r23, 0x00 ; 0 128ae: 80 e8 ldi r24, 0x80 ; 128 128b0: 9f eb ldi r25, 0xBF ; 191 128b2: 0e 94 27 6f call 0xde4e ; 0xde4e enable_z_endstop(true); 128b6: 81 e0 ldi r24, 0x01 ; 1 128b8: 0f 94 09 63 call 0x2c612 ; 0x2c612 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 128bc: 84 e0 ldi r24, 0x04 ; 4 128be: 0f 94 5d 3a call 0x274ba ; 0x274ba #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 128c2: c0 92 48 07 sts 0x0748, r12 ; 0x800748 128c6: d0 92 49 07 sts 0x0749, r13 ; 0x800749 128ca: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 128ce: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 128d2: 65 e5 ldi r22, 0x55 ; 85 128d4: 75 e5 ldi r23, 0x55 ; 85 128d6: 85 e5 ldi r24, 0x55 ; 85 128d8: 91 e4 ldi r25, 0x41 ; 65 128da: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 128de: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 #ifdef TMC2130 tmc2130_home_exit(); 128e2: 0f 94 2e 3a call 0x2745c ; 0x2745c #endif // TMC2130 enable_z_endstop(bState); 128e6: 81 2f mov r24, r17 128e8: 0f 94 09 63 call 0x2c612 ; 0x2c612 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 128ec: 82 e0 ldi r24, 0x02 ; 2 128ee: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 128f2: 20 e0 ldi r18, 0x00 ; 0 128f4: 30 e0 ldi r19, 0x00 ; 0 128f6: 40 ea ldi r20, 0xA0 ; 160 128f8: 50 e4 ldi r21, 0x40 ; 64 128fa: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 128fe: 18 16 cp r1, r24 12900: 24 f2 brlt .-120 ; 0x1288a custom_message_type = custom_message_type_old; 12902: ef 81 ldd r30, Y+7 ; 0x07 12904: e0 93 72 07 sts 0x0772, r30 ; 0x800772 custom_message_state = custom_message_state_old; 12908: f8 85 ldd r31, Y+8 ; 0x08 1290a: f0 93 f0 03 sts 0x03F0, r31 ; 0x8003f0 lcd_update_enable(true); // display / status-line recovery 1290e: 81 e0 ldi r24, 0x01 ; 1 12910: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 12914: 41 e0 ldi r20, 0x01 ; 1 12916: 61 e0 ldi r22, 0x01 ; 1 12918: 81 e0 ldi r24, 0x01 ; 1 1291a: 0e 94 21 81 call 0x10242 ; 0x10242 1291e: 81 e0 ldi r24, 0x01 ; 1 12920: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d 12924: ce cb rjmp .-2148 ; 0x120c2 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 12926: 10 92 68 03 sts 0x0368, r1 ; 0x800368 clean_up_after_endstop_move(l_feedmultiply); 1292a: 8b a1 ldd r24, Y+35 ; 0x23 1292c: 9c a1 ldd r25, Y+36 ; 0x24 1292e: 0e 94 14 68 call 0xd028 ; 0xd028 } } void babystep_apply() { babystep_load(); 12932: 0f 94 7d c6 call 0x38cfa ; 0x38cfa shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 12936: 60 91 67 05 lds r22, 0x0567 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.513> 1293a: 70 91 68 05 lds r23, 0x0568 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.513+0x1> 1293e: 07 2e mov r0, r23 12940: 00 0c add r0, r0 12942: 88 0b sbc r24, r24 12944: 99 0b sbc r25, r25 12946: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1294a: 90 58 subi r25, 0x80 ; 128 1294c: 20 91 77 06 lds r18, 0x0677 ; 0x800677 12950: 30 91 78 06 lds r19, 0x0678 ; 0x800678 12954: 40 91 79 06 lds r20, 0x0679 ; 0x800679 12958: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 1295c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 12960: 0f 94 99 c6 call 0x38d32 ; 0x38d32 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; 12964: 80 ec ldi r24, 0xC0 ; 192 12966: 9f e0 ldi r25, 0x0F ; 15 12968: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1296c: 91 e0 ldi r25, 0x01 ; 1 1296e: 81 30 cpi r24, 0x01 ; 1 12970: 09 f0 breq .+2 ; 0x12974 12972: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12974: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 12976: 4f eb ldi r20, 0xBF ; 191 12978: 5f e0 ldi r21, 0x0F ; 15 1297a: 6c e4 ldi r22, 0x4C ; 76 1297c: ce 01 movw r24, r28 1297e: 01 96 adiw r24, 0x01 ; 1 12980: 0e 94 22 5d call 0xba44 ; 0xba44 12984: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 12986: 4e eb ldi r20, 0xBE ; 190 12988: 5f e0 ldi r21, 0x0F ; 15 1298a: 62 e5 ldi r22, 0x52 ; 82 1298c: ce 01 movw r24, r28 1298e: 01 96 adiw r24, 0x01 ; 1 12990: 0e 94 22 5d call 0xba44 ; 0xba44 12994: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 12996: 4d eb ldi r20, 0xBD ; 189 12998: 5f e0 ldi r21, 0x0F ; 15 1299a: 66 e4 ldi r22, 0x46 ; 70 1299c: ce 01 movw r24, r28 1299e: 01 96 adiw r24, 0x01 ; 1 129a0: 0e 94 22 5d call 0xba44 ; 0xba44 129a4: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 129a6: 4c eb ldi r20, 0xBC ; 188 129a8: 5f e0 ldi r21, 0x0F ; 15 129aa: 62 e4 ldi r22, 0x42 ; 66 129ac: ce 01 movw r24, r28 129ae: 01 96 adiw r24, 0x01 ; 1 129b0: 0e 94 22 5d call 0xba44 ; 0xba44 129b4: 21 2f mov r18, r17 129b6: 11 0f add r17, r17 129b8: 33 0b sbc r19, r19 129ba: 08 2e mov r0, r24 129bc: 00 0c add r0, r0 129be: 99 0b sbc r25, r25 129c0: 5c 01 movw r10, r24 129c2: a2 1a sub r10, r18 129c4: b3 0a sbc r11, r19 129c6: 8f 2d mov r24, r15 129c8: ff 0c add r15, r15 129ca: 99 0b sbc r25, r25 129cc: 28 0f add r18, r24 129ce: 39 1f adc r19, r25 129d0: 46 e0 ldi r20, 0x06 ; 6 129d2: 42 9f mul r20, r18 129d4: 60 01 movw r12, r0 129d6: 43 9f mul r20, r19 129d8: d0 0c add r13, r0 129da: 11 24 eor r1, r1 129dc: f1 2c mov r15, r1 129de: e1 2c mov r14, r1 129e0: 00 2e mov r0, r16 129e2: 00 0c add r0, r0 129e4: 11 0b sbc r17, r17 129e6: 08 1b sub r16, r24 129e8: 19 0b sbc r17, r25 129ea: b7 01 movw r22, r14 129ec: 62 56 subi r22, 0x62 ; 98 129ee: 7c 4e sbci r23, 0xEC ; 236 129f0: 3b 01 movw r6, r22 129f2: 46 01 movw r8, r12 129f4: 77 e0 ldi r23, 0x07 ; 7 129f6: 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 * ( 129f8: d3 01 movw r26, r6 129fa: 2d 90 ld r2, X+ 129fc: 3d 90 ld r3, X+ 129fe: 4d 90 ld r4, X+ 12a00: 5d 90 ld r5, X+ 12a02: 3d 01 movw r6, r26 12a04: fd 01 movw r30, r26 12a06: 34 97 sbiw r30, 0x04 ; 4 12a08: fb 87 std Y+11, r31 ; 0x0b 12a0a: ea 87 std Y+10, r30 ; 0x0a 12a0c: b4 01 movw r22, r8 12a0e: 09 2c mov r0, r9 12a10: 00 0c add r0, r0 12a12: 88 0b sbc r24, r24 12a14: 99 0b sbc r25, r25 12a16: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 12a1a: 2f e3 ldi r18, 0x3F ; 63 12a1c: 33 ec ldi r19, 0xC3 ; 195 12a1e: 4e e2 ldi r20, 0x2E ; 46 12a20: 59 e3 ldi r21, 0x39 ; 57 12a22: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 12a26: a2 01 movw r20, r4 12a28: 91 01 movw r18, r2 12a2a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 12a2e: aa 85 ldd r26, Y+10 ; 0x0a 12a30: bb 85 ldd r27, Y+11 ; 0x0b 12a32: 6d 93 st X+, r22 12a34: 7d 93 st X+, r23 12a36: 8d 93 st X+, r24 12a38: 9c 93 st X, r25 12a3a: 13 97 sbiw r26, 0x03 ; 3 12a3c: ba 81 ldd r27, Y+2 ; 0x02 12a3e: b1 50 subi r27, 0x01 ; 1 12a40: ba 83 std Y+2, r27 ; 0x02 12a42: 80 0e add r8, r16 12a44: 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++) { 12a46: b1 11 cpse r27, r1 12a48: d7 cf rjmp .-82 ; 0x129f8 12a4a: ca 0c add r12, r10 12a4c: db 1c adc r13, r11 12a4e: ec e1 ldi r30, 0x1C ; 28 12a50: ee 0e add r14, r30 12a52: 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++) { 12a54: f4 ec ldi r31, 0xC4 ; 196 12a56: ef 16 cp r14, r31 12a58: f1 04 cpc r15, r1 12a5a: 39 f6 brne .-114 ; 0x129ea + 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) 12a5c: 0f 94 51 16 call 0x22ca2 ; 0x22ca2 { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 12a60: 8d e4 ldi r24, 0x4D ; 77 12a62: 0e 94 0d 5d call 0xba1a ; 0xba1a 12a66: 88 23 and r24, r24 12a68: 09 f4 brne .+2 ; 0x12a6c 12a6a: 84 c0 rjmp .+264 ; 0x12b74 12a6c: 0e 94 9f 5c call 0xb93e ; 0xb93e if (nMeasPoints == 7 && useMagnetCompensation) { 12a70: 2e 81 ldd r18, Y+6 ; 0x06 12a72: 27 30 cpi r18, 0x07 ; 7 12a74: 09 f0 breq .+2 ; 0x12a78 12a76: 94 c0 rjmp .+296 ; 0x12ba0 12a78: 88 23 and r24, r24 12a7a: 09 f4 brne .+2 ; 0x12a7e 12a7c: 91 c0 rjmp .+290 ; 0x12ba0 12a7e: bb 24 eor r11, r11 12a80: b3 94 inc r11 12a82: aa 24 eor r10, r10 12a84: aa 94 dec r10 12a86: ab 0c add r10, r11 12a88: 09 a1 ldd r16, Y+33 ; 0x21 12a8a: 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++) { 12a8c: 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++; } 12a8e: 8e ef ldi r24, 0xFE ; 254 12a90: 88 2e mov r8, r24 12a92: 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)) { 12a94: 6a 2d mov r22, r10 12a96: 86 2d mov r24, r6 12a98: 0f 94 48 c6 call 0x38c90 ; 0x38c90 12a9c: 99 24 eor r9, r9 12a9e: 93 94 inc r9 12aa0: 96 0c add r9, r6 12aa2: 81 11 cpse r24, r1 12aa4: 6e c0 rjmp .+220 ; 0x12b82 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++; } 12aa6: 6b 2d mov r22, r11 12aa8: 86 2d mov r24, r6 12aaa: 0f 94 48 c6 call 0x38c90 ; 0x38c90 } 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; 12aae: c1 2c mov r12, r1 12ab0: d1 2c mov r13, r1 12ab2: 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; 12ab4: 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++; } 12ab6: 88 23 and r24, r24 12ab8: 81 f0 breq .+32 ; 0x12ada 12aba: 20 e0 ldi r18, 0x00 ; 0 12abc: 30 e0 ldi r19, 0x00 ; 0 12abe: a9 01 movw r20, r18 12ac0: d8 01 movw r26, r16 12ac2: 5d 96 adiw r26, 0x1d ; 29 12ac4: 6d 91 ld r22, X+ 12ac6: 7d 91 ld r23, X+ 12ac8: 8d 91 ld r24, X+ 12aca: 9c 91 ld r25, X 12acc: 90 97 sbiw r26, 0x20 ; 32 12ace: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 12ad2: 6b 01 movw r12, r22 12ad4: 7c 01 movw r14, r24 12ad6: 77 24 eor r7, r7 12ad8: 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++; } 12ada: 68 2d mov r22, r8 12adc: 86 2d mov r24, r6 12ade: 0f 94 48 c6 call 0x38c90 ; 0x38c90 12ae2: 88 23 and r24, r24 12ae4: 69 f0 breq .+26 ; 0x12b00 12ae6: f8 01 movw r30, r16 12ae8: 7b 97 sbiw r30, 0x1b ; 27 12aea: 20 81 ld r18, Z 12aec: 31 81 ldd r19, Z+1 ; 0x01 12aee: 42 81 ldd r20, Z+2 ; 0x02 12af0: 53 81 ldd r21, Z+3 ; 0x03 12af2: c7 01 movw r24, r14 12af4: b6 01 movw r22, r12 12af6: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 12afa: 6b 01 movw r12, r22 12afc: 7c 01 movw r14, r24 12afe: 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++; } 12b00: 6a 2d mov r22, r10 12b02: 89 2d mov r24, r9 12b04: 0f 94 48 c6 call 0x38c90 ; 0x38c90 12b08: 88 23 and r24, r24 12b0a: 61 f0 breq .+24 ; 0x12b24 12b0c: f8 01 movw r30, r16 12b0e: 25 81 ldd r18, Z+5 ; 0x05 12b10: 36 81 ldd r19, Z+6 ; 0x06 12b12: 47 81 ldd r20, Z+7 ; 0x07 12b14: 50 85 ldd r21, Z+8 ; 0x08 12b16: c7 01 movw r24, r14 12b18: b6 01 movw r22, r12 12b1a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 12b1e: 6b 01 movw r12, r22 12b20: 7c 01 movw r14, r24 12b22: 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++; } 12b24: 6a 2d mov r22, r10 12b26: 8f ef ldi r24, 0xFF ; 255 12b28: 86 0d add r24, r6 12b2a: 0f 94 48 c6 call 0x38c90 ; 0x38c90 12b2e: 88 23 and r24, r24 12b30: 31 f1 breq .+76 ; 0x12b7e 12b32: f8 01 movw r30, r16 12b34: 33 97 sbiw r30, 0x03 ; 3 12b36: 20 81 ld r18, Z 12b38: 31 81 ldd r19, Z+1 ; 0x01 12b3a: 42 81 ldd r20, Z+2 ; 0x02 12b3c: 53 81 ldd r21, Z+3 ; 0x03 12b3e: c7 01 movw r24, r14 12b40: b6 01 movw r22, r12 12b42: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 12b46: 6b 01 movw r12, r22 12b48: 7c 01 movw r14, r24 12b4a: 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 12b4c: 67 2d mov r22, r7 12b4e: 70 e0 ldi r23, 0x00 ; 0 12b50: 90 e0 ldi r25, 0x00 ; 0 12b52: 80 e0 ldi r24, 0x00 ; 0 12b54: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 12b58: 9b 01 movw r18, r22 12b5a: ac 01 movw r20, r24 12b5c: c7 01 movw r24, r14 12b5e: b6 01 movw r22, r12 12b60: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 12b64: d8 01 movw r26, r16 12b66: 11 96 adiw r26, 0x01 ; 1 12b68: 6d 93 st X+, r22 12b6a: 7d 93 st X+, r23 12b6c: 8d 93 st X+, r24 12b6e: 9c 93 st X, r25 12b70: 14 97 sbiw r26, 0x04 ; 4 12b72: 07 c0 rjmp .+14 ; 0x12b82 } 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); 12b74: 8c ea ldi r24, 0xAC ; 172 12b76: 9d e0 ldi r25, 0x0D ; 13 12b78: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 12b7c: 79 cf rjmp .-270 ; 0x12a70 12b7e: 71 10 cpse r7, r1 12b80: e5 cf rjmp .-54 ; 0x12b4c //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++) { 12b82: 69 2c mov r6, r9 12b84: 0c 5f subi r16, 0xFC ; 252 12b86: 1f 4f sbci r17, 0xFF ; 255 12b88: b7 e0 ldi r27, 0x07 ; 7 12b8a: 9b 12 cpse r9, r27 12b8c: 83 cf rjmp .-250 ; 0x12a94 12b8e: b3 94 inc r11 12b90: e9 a1 ldd r30, Y+33 ; 0x21 12b92: fa a1 ldd r31, Y+34 ; 0x22 12b94: 7c 96 adiw r30, 0x1c ; 28 12b96: fa a3 std Y+34, r31 ; 0x22 12b98: 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++) { 12b9a: f8 e0 ldi r31, 0x08 ; 8 12b9c: bf 12 cpse r11, r31 12b9e: 71 cf rjmp .-286 ; 0x12a82 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12ba0: 81 e0 ldi r24, 0x01 ; 1 12ba2: 80 93 9d 13 sts 0x139D, r24 ; 0x80139d if (code_seen('O') && !code_value_uint8()) { 12ba6: 8f e4 ldi r24, 0x4F ; 79 12ba8: 0e 94 0d 5d call 0xba1a ; 0xba1a 12bac: 81 11 cpse r24, r1 12bae: 03 c0 rjmp .+6 ; 0x12bb6 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12bb0: 0f 94 ee c6 call 0x38ddc ; 0x38ddc 12bb4: 9b cc rjmp .-1738 ; 0x124ec } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 12bb6: 0e 94 9f 5c call 0xb93e ; 0xb93e 12bba: 81 11 cpse r24, r1 12bbc: f9 cf rjmp .-14 ; 0x12bb0 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12bbe: 0e 94 09 68 call 0xd012 ; 0xd012 12bc2: 94 cc rjmp .-1752 ; 0x124ec 00012bc4 : //! @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() { 12bc4: 4f 92 push r4 12bc6: 5f 92 push r5 12bc8: 6f 92 push r6 12bca: 7f 92 push r7 12bcc: 8f 92 push r8 12bce: 9f 92 push r9 12bd0: af 92 push r10 12bd2: bf 92 push r11 12bd4: ef 92 push r14 12bd6: ff 92 push r15 12bd8: 0f 93 push r16 12bda: 1f 93 push r17 12bdc: cf 93 push r28 12bde: df 93 push r29 12be0: 1f 92 push r1 12be2: cd b7 in r28, 0x3d ; 61 12be4: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 12be6: 44 e0 ldi r20, 0x04 ; 4 12be8: 50 e0 ldi r21, 0x00 ; 0 12bea: 64 e1 ldi r22, 0x14 ; 20 12bec: 70 e0 ldi r23, 0x00 ; 0 12bee: 8b e6 ldi r24, 0x6B ; 107 12bf0: 96 e0 ldi r25, 0x06 ; 6 12bf2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 12bf6: 43 e0 ldi r20, 0x03 ; 3 12bf8: 50 e0 ldi r21, 0x00 ; 0 12bfa: 6f ea ldi r22, 0xAF ; 175 12bfc: 79 e7 ldi r23, 0x79 ; 121 12bfe: 8b e6 ldi r24, 0x6B ; 107 12c00: 96 e0 ldi r25, 0x06 ; 6 12c02: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 12c06: 89 2b or r24, r25 12c08: 09 f0 breq .+2 ; 0x12c0c 12c0a: 9f c1 rjmp .+830 ; 0x12f4a { // 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)); 12c0c: e3 e7 ldi r30, 0x73 ; 115 12c0e: fa e7 ldi r31, 0x7A ; 122 12c10: 45 91 lpm r20, Z+ 12c12: 55 91 lpm r21, Z+ 12c14: 65 91 lpm r22, Z+ 12c16: 74 91 lpm r23, Z 12c18: 88 ed ldi r24, 0xD8 ; 216 12c1a: 90 e0 ldi r25, 0x00 ; 0 12c1c: 0e 94 6d 65 call 0xcada ; 0xcada eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 12c20: e7 e7 ldi r30, 0x77 ; 119 12c22: fa e7 ldi r31, 0x7A ; 122 12c24: 45 91 lpm r20, Z+ 12c26: 55 91 lpm r21, Z+ 12c28: 65 91 lpm r22, Z+ 12c2a: 74 91 lpm r23, Z 12c2c: 8c ed ldi r24, 0xDC ; 220 12c2e: 90 e0 ldi r25, 0x00 ; 0 12c30: 0e 94 6d 65 call 0xcada ; 0xcada eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 12c34: eb e7 ldi r30, 0x7B ; 123 12c36: fa e7 ldi r31, 0x7A ; 122 12c38: 64 91 lpm r22, Z 12c3a: 80 ee ldi r24, 0xE0 ; 224 12c3c: 90 e0 ldi r25, 0x00 ; 0 12c3e: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 12c42: ec e7 ldi r30, 0x7C ; 124 12c44: fa e7 ldi r31, 0x7A ; 122 12c46: 65 91 lpm r22, Z+ 12c48: 74 91 lpm r23, Z 12c4a: 81 ee ldi r24, 0xE1 ; 225 12c4c: 90 e0 ldi r25, 0x00 ; 0 12c4e: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 12c52: ee e7 ldi r30, 0x7E ; 126 12c54: fa e7 ldi r31, 0x7A ; 122 12c56: 65 91 lpm r22, Z+ 12c58: 74 91 lpm r23, Z 12c5a: 83 ee ldi r24, 0xE3 ; 227 12c5c: 90 e0 ldi r25, 0x00 ; 0 12c5e: 0e 94 0d 78 call 0xf01a ; 0xf01a // 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)); 12c62: ef e6 ldi r30, 0x6F ; 111 12c64: fa e7 ldi r31, 0x7A ; 122 12c66: 45 91 lpm r20, Z+ 12c68: 55 91 lpm r21, Z+ 12c6a: 65 91 lpm r22, Z+ 12c6c: 74 91 lpm r23, Z 12c6e: 84 ed ldi r24, 0xD4 ; 212 12c70: 90 e0 ldi r25, 0x00 ; 0 12c72: 0e 94 6d 65 call 0xcada ; 0xcada // 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); 12c76: 4b e4 ldi r20, 0x4B ; 75 12c78: 5a e7 ldi r21, 0x7A ; 122 12c7a: 60 e1 ldi r22, 0x10 ; 16 12c7c: 70 e0 ldi r23, 0x00 ; 0 12c7e: 80 eb ldi r24, 0xB0 ; 176 12c80: 90 e0 ldi r25, 0x00 ; 0 12c82: 0e 94 ee 77 call 0xefdc ; 0xefdc 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); 12c86: 4b e5 ldi r20, 0x5B ; 91 12c88: 5a e7 ldi r21, 0x7A ; 122 12c8a: 60 e1 ldi r22, 0x10 ; 16 12c8c: 70 e0 ldi r23, 0x00 ; 0 12c8e: 80 ec ldi r24, 0xC0 ; 192 12c90: 90 e0 ldi r25, 0x00 ; 0 12c92: 0e 94 ee 77 call 0xefdc ; 0xefdc #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 12c96: 4b e6 ldi r20, 0x6B ; 107 12c98: 5a e7 ldi r21, 0x7A ; 122 12c9a: 64 e0 ldi r22, 0x04 ; 4 12c9c: 70 e0 ldi r23, 0x00 ; 0 12c9e: 80 ed ldi r24, 0xD0 ; 208 12ca0: 90 e0 ldi r25, 0x00 ; 0 12ca2: 0e 94 ee 77 call 0xefdc ; 0xefdc #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 12ca6: 41 ed ldi r20, 0xD1 ; 209 12ca8: 50 e0 ldi r21, 0x00 ; 0 12caa: 64 e1 ldi r22, 0x14 ; 20 12cac: 70 e0 ldi r23, 0x00 ; 0 12cae: 8b e6 ldi r24, 0x6B ; 107 12cb0: 96 e0 ldi r25, 0x06 ; 6 12cb2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe calculate_extruder_multipliers(); 12cb6: 0e 94 ff 66 call 0xcdfe ; 0xcdfe 12cba: 0b e6 ldi r16, 0x6B ; 107 12cbc: 16 e0 ldi r17, 0x06 ; 6 12cbe: 87 e0 ldi r24, 0x07 ; 7 12cc0: e8 2e mov r14, r24 12cc2: 87 e0 ldi r24, 0x07 ; 7 12cc4: 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; 12cc6: 94 ec ldi r25, 0xC4 ; 196 12cc8: 89 2e mov r8, r25 12cca: 99 e0 ldi r25, 0x09 ; 9 12ccc: 99 2e mov r9, r25 12cce: a1 2c mov r10, r1 12cd0: 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; 12cd2: 20 ec ldi r18, 0xC0 ; 192 12cd4: 42 2e mov r4, r18 12cd6: 23 e0 ldi r18, 0x03 ; 3 12cd8: 52 2e mov r5, r18 12cda: 61 2c mov r6, r1 12cdc: 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) 12cde: 20 e0 ldi r18, 0x00 ; 0 12ce0: 30 e0 ldi r19, 0x00 ; 0 12ce2: 48 e4 ldi r20, 0x48 ; 72 12ce4: 53 e4 ldi r21, 0x43 ; 67 12ce6: f8 01 movw r30, r16 12ce8: 64 89 ldd r22, Z+20 ; 0x14 12cea: 75 89 ldd r23, Z+21 ; 0x15 12cec: 86 89 ldd r24, Z+22 ; 0x16 12cee: 97 89 ldd r25, Z+23 ; 0x17 12cf0: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 12cf4: 18 16 cp r1, r24 12cf6: 4c f4 brge .+18 ; 0x12d0a cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 12cf8: 80 e0 ldi r24, 0x00 ; 0 12cfa: 90 e0 ldi r25, 0x00 ; 0 12cfc: a8 e4 ldi r26, 0x48 ; 72 12cfe: b3 e4 ldi r27, 0x43 ; 67 12d00: f8 01 movw r30, r16 12d02: 84 8b std Z+20, r24 ; 0x14 12d04: 95 8b std Z+21, r25 ; 0x15 12d06: a6 8b std Z+22, r26 ; 0x16 12d08: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 12d0a: f7 01 movw r30, r14 12d0c: 61 91 ld r22, Z+ 12d0e: 71 91 ld r23, Z+ 12d10: 81 91 ld r24, Z+ 12d12: 91 91 ld r25, Z+ 12d14: 7f 01 movw r14, r30 12d16: 20 e0 ldi r18, 0x00 ; 0 12d18: 30 e0 ldi r19, 0x00 ; 0 12d1a: 48 ec ldi r20, 0xC8 ; 200 12d1c: 52 e4 ldi r21, 0x42 ; 66 12d1e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 12d22: 18 16 cp r1, r24 12d24: 54 f4 brge .+20 ; 0x12d3a cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 12d26: 80 e0 ldi r24, 0x00 ; 0 12d28: 90 e0 ldi r25, 0x00 ; 0 12d2a: a8 ec ldi r26, 0xC8 ; 200 12d2c: b2 e4 ldi r27, 0x42 ; 66 12d2e: f7 01 movw r30, r14 12d30: 34 97 sbiw r30, 0x04 ; 4 12d32: 80 83 st Z, r24 12d34: 91 83 std Z+1, r25 ; 0x01 12d36: a2 83 std Z+2, r26 ; 0x02 12d38: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 12d3a: f8 01 movw r30, r16 12d3c: 84 a1 ldd r24, Z+36 ; 0x24 12d3e: 95 a1 ldd r25, Z+37 ; 0x25 12d40: a6 a1 ldd r26, Z+38 ; 0x26 12d42: b7 a1 ldd r27, Z+39 ; 0x27 12d44: 85 3c cpi r24, 0xC5 ; 197 12d46: 99 40 sbci r25, 0x09 ; 9 12d48: a1 05 cpc r26, r1 12d4a: b1 05 cpc r27, r1 12d4c: 28 f0 brcs .+10 ; 0x12d58 cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 12d4e: f8 01 movw r30, r16 12d50: 84 a2 std Z+36, r8 ; 0x24 12d52: 95 a2 std Z+37, r9 ; 0x25 12d54: a6 a2 std Z+38, r10 ; 0x26 12d56: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 12d58: f7 01 movw r30, r14 12d5a: 84 85 ldd r24, Z+12 ; 0x0c 12d5c: 95 85 ldd r25, Z+13 ; 0x0d 12d5e: a6 85 ldd r26, Z+14 ; 0x0e 12d60: b7 85 ldd r27, Z+15 ; 0x0f 12d62: 81 3c cpi r24, 0xC1 ; 193 12d64: 93 40 sbci r25, 0x03 ; 3 12d66: a1 05 cpc r26, r1 12d68: b1 05 cpc r27, r1 12d6a: 28 f0 brcs .+10 ; 0x12d76 cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12d6c: f7 01 movw r30, r14 12d6e: 44 86 std Z+12, r4 ; 0x0c 12d70: 55 86 std Z+13, r5 ; 0x0d 12d72: 66 86 std Z+14, r6 ; 0x0e 12d74: 77 86 std Z+15, r7 ; 0x0f 12d76: 0c 5f subi r16, 0xFC ; 252 12d78: 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++) 12d7a: f6 e0 ldi r31, 0x06 ; 6 12d7c: 03 37 cpi r16, 0x73 ; 115 12d7e: 1f 07 cpc r17, r31 12d80: 09 f0 breq .+2 ; 0x12d84 12d82: ad cf rjmp .-166 ; 0x12cde 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]); 12d84: 60 91 27 07 lds r22, 0x0727 ; 0x800727 12d88: 70 e0 ldi r23, 0x00 ; 0 12d8a: 80 e0 ldi r24, 0x00 ; 0 12d8c: 0f 94 7f 39 call 0x272fe ; 0x272fe tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12d90: 60 91 28 07 lds r22, 0x0728 ; 0x800728 12d94: 70 e0 ldi r23, 0x00 ; 0 12d96: 81 e0 ldi r24, 0x01 ; 1 12d98: 0f 94 7f 39 call 0x272fe ; 0x272fe tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 12d9c: 60 91 29 07 lds r22, 0x0729 ; 0x800729 12da0: 70 e0 ldi r23, 0x00 ; 0 12da2: 82 e0 ldi r24, 0x02 ; 2 12da4: 0f 94 7f 39 call 0x272fe ; 0x272fe tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 12da8: 60 91 2a 07 lds r22, 0x072A ; 0x80072a 12dac: 70 e0 ldi r23, 0x00 ; 0 12dae: 83 e0 ldi r24, 0x03 ; 3 12db0: 0f 94 7f 39 call 0x272fe ; 0x272fe #endif //TMC2130 reset_acceleration_rates(); 12db4: 0f 94 03 aa call 0x35406 ; 0x35406 // Call updatePID (similar to when we have processed M301) updatePID(); 12db8: 0f 94 dd 4f call 0x29fba ; 0x29fba } 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; 12dbc: ce 01 movw r24, r28 12dbe: 01 96 adiw r24, 0x01 ; 1 12dc0: 0f 94 a8 46 call 0x28d50 ; 0x28d50 // 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)); 12dc4: 40 e0 ldi r20, 0x00 ; 0 12dc6: 50 e0 ldi r21, 0x00 ; 0 12dc8: ba 01 movw r22, r20 12dca: 82 ea ldi r24, 0xA2 ; 162 12dcc: 9c e0 ldi r25, 0x0C ; 12 12dce: 0e 94 6d 65 call 0xcada ; 0xcada eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12dd2: 40 e0 ldi r20, 0x00 ; 0 12dd4: 50 e0 ldi r21, 0x00 ; 0 12dd6: 60 e8 ldi r22, 0x80 ; 128 12dd8: 7f e3 ldi r23, 0x3F ; 63 12dda: 8e e9 ldi r24, 0x9E ; 158 12ddc: 9c e0 ldi r25, 0x0C ; 12 12dde: 0e 94 6d 65 call 0xcada ; 0xcada eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 12de2: 48 eb ldi r20, 0xB8 ; 184 12de4: 5e e1 ldi r21, 0x1E ; 30 12de6: 65 e8 ldi r22, 0x85 ; 133 12de8: 7d e3 ldi r23, 0x3D ; 61 12dea: 8a e9 ldi r24, 0x9A ; 154 12dec: 9c e0 ldi r25, 0x0C ; 12 12dee: 0e 94 6d 65 call 0xcada ; 0xcada eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 12df2: 64 e3 ldi r22, 0x34 ; 52 12df4: 78 e0 ldi r23, 0x08 ; 8 12df6: 88 e9 ldi r24, 0x98 ; 152 12df8: 9c e0 ldi r25, 0x0C ; 12 12dfa: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 12dfe: 61 e0 ldi r22, 0x01 ; 1 12e00: 87 e9 ldi r24, 0x97 ; 151 12e02: 9c e0 ldi r25, 0x0C ; 12 12e04: 0e 94 25 78 call 0xf04a ; 0xf04a thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 12e08: 82 e0 ldi r24, 0x02 ; 2 12e0a: 9d e0 ldi r25, 0x0D ; 13 12e0c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 12e10: 91 e0 ldi r25, 0x01 ; 1 12e12: 81 11 cpse r24, r1 12e14: 01 c0 rjmp .+2 ; 0x12e18 12e16: 90 e0 ldi r25, 0x00 ; 0 12e18: 90 93 1d 05 sts 0x051D, r25 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> thermal_model::data.P = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_P); 12e1c: 8e ef ldi r24, 0xFE ; 254 12e1e: 9c e0 ldi r25, 0x0C ; 12 12e20: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 12e24: 60 93 b5 12 sts 0x12B5, r22 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 12e28: 70 93 b6 12 sts 0x12B6, r23 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 12e2c: 80 93 b7 12 sts 0x12B7, r24 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 12e30: 90 93 b8 12 sts 0x12B8, r25 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> thermal_model::data.U = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_U); 12e34: 82 ea ldi r24, 0xA2 ; 162 12e36: 9c e0 ldi r25, 0x0C ; 12 12e38: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 12e3c: 60 93 b9 12 sts 0x12B9, r22 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 12e40: 70 93 ba 12 sts 0x12BA, r23 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 12e44: 80 93 bb 12 sts 0x12BB, r24 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 12e48: 90 93 bc 12 sts 0x12BC, r25 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> thermal_model::data.V = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_V); 12e4c: 8e e9 ldi r24, 0x9E ; 158 12e4e: 9c e0 ldi r25, 0x0C ; 12 12e50: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 12e54: 60 93 bd 12 sts 0x12BD, r22 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 12e58: 70 93 be 12 sts 0x12BE, r23 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 12e5c: 80 93 bf 12 sts 0x12BF, r24 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 12e60: 90 93 c0 12 sts 0x12C0, r25 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> thermal_model::data.C = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_C); 12e64: 8a ef ldi r24, 0xFA ; 250 12e66: 9c e0 ldi r25, 0x0C ; 12 12e68: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 12e6c: 60 93 c1 12 sts 0x12C1, r22 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 12e70: 70 93 c2 12 sts 0x12C2, r23 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 12e74: 80 93 c3 12 sts 0x12C3, r24 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 12e78: 90 93 c4 12 sts 0x12C4, r25 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> thermal_model::data.fS = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_D); 12e7c: 8a e9 ldi r24, 0x9A ; 154 12e7e: 9c e0 ldi r25, 0x0C ; 12 12e80: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 12e84: 60 93 c5 12 sts 0x12C5, r22 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 12e88: 70 93 c6 12 sts 0x12C6, r23 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 12e8c: 80 93 c7 12 sts 0x12C7, r24 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 12e90: 90 93 c8 12 sts 0x12C8, r25 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> thermal_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_THERMAL_MODEL_L)); 12e94: 88 e9 ldi r24, 0x98 ; 152 12e96: 9c e0 ldi r25, 0x0C ; 12 12e98: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 12e9c: 0f 94 8b 43 call 0x28716 ; 0x28716 eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12ea0: 40 e4 ldi r20, 0x40 ; 64 12ea2: 50 e0 ldi r21, 0x00 ; 0 12ea4: 6a eb ldi r22, 0xBA ; 186 12ea6: 7c e0 ldi r23, 0x0C ; 12 12ea8: 8b ec ldi r24, 0xCB ; 203 12eaa: 92 e1 ldi r25, 0x12 ; 18 12eac: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12eb0: 86 eb ldi r24, 0xB6 ; 182 12eb2: 9c e0 ldi r25, 0x0C ; 12 12eb4: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 12eb8: 60 93 0b 13 sts 0x130B, r22 ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 12ebc: 70 93 0c 13 sts 0x130C, r23 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 12ec0: 80 93 0d 13 sts 0x130D, r24 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 12ec4: 90 93 0e 13 sts 0x130E, r25 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> thermal_model::data.warn = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_W); 12ec8: 82 eb ldi r24, 0xB2 ; 178 12eca: 9c e0 ldi r25, 0x0C ; 12 12ecc: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 12ed0: 60 93 0f 13 sts 0x130F, r22 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 12ed4: 70 93 10 13 sts 0x1310, r23 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 12ed8: 80 93 11 13 sts 0x1311, r24 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 12edc: 90 93 12 13 sts 0x1312, r25 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> thermal_model::data.err = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_E); 12ee0: 8e ea ldi r24, 0xAE ; 174 12ee2: 9c e0 ldi r25, 0x0C ; 12 12ee4: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 12ee8: 60 93 13 13 sts 0x1313, r22 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 12eec: 70 93 14 13 sts 0x1314, r23 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 12ef0: 80 93 15 13 sts 0x1315, r24 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 12ef4: 90 93 16 13 sts 0x1316, r25 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> if(!thermal_model::calibrated()) { 12ef8: 0f 94 aa 43 call 0x28754 ; 0x28754 12efc: 81 11 cpse r24, r1 12efe: 06 c0 rjmp .+12 ; 0x12f0c SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 12f00: 89 e4 ldi r24, 0x49 ; 73 12f02: 99 e7 ldi r25, 0x79 ; 121 12f04: 0e 94 97 7b call 0xf72e ; 0xf72e thermal_model_reset_settings(); 12f08: 0f 94 b6 46 call 0x28d6c ; 0x28d6c } thermal_model::setup(); 12f0c: 0f 94 12 44 call 0x28824 ; 0x28824 } 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; 12f10: ce 01 movw r24, r28 12f12: 01 96 adiw r24, 0x01 ; 1 12f14: 0f 94 9b 46 call 0x28d36 ; 0x28d36 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 12f18: 84 e1 ldi r24, 0x14 ; 20 12f1a: 9b ea ldi r25, 0xAB ; 171 12f1c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM("Stored settings retrieved"); 12f20: 83 e7 ldi r24, 0x73 ; 115 12f22: 99 e7 ldi r25, 0x79 ; 121 12f24: 0e 94 97 7b call 0xf72e ; 0xf72e 12f28: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 12f2a: 0f 90 pop r0 12f2c: df 91 pop r29 12f2e: cf 91 pop r28 12f30: 1f 91 pop r17 12f32: 0f 91 pop r16 12f34: ff 90 pop r15 12f36: ef 90 pop r14 12f38: bf 90 pop r11 12f3a: af 90 pop r10 12f3c: 9f 90 pop r9 12f3e: 8f 90 pop r8 12f40: 7f 90 pop r7 12f42: 6f 90 pop r6 12f44: 5f 90 pop r5 12f46: 4f 90 pop r4 12f48: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 12f4a: 0e 94 48 84 call 0x10890 ; 0x10890 //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))) { 12f4e: 64 e0 ldi r22, 0x04 ; 4 12f50: 70 e0 ldi r23, 0x00 ; 0 12f52: 84 e1 ldi r24, 0x14 ; 20 12f54: 90 e0 ldi r25, 0x00 ; 0 12f56: 0e 94 f2 5c call 0xb9e4 ; 0xb9e4 12f5a: 91 e0 ldi r25, 0x01 ; 1 12f5c: 89 27 eor r24, r25 12f5e: e5 cf rjmp .-54 ; 0x12f2a 00012f60 : 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() 12f60: 2f 92 push r2 12f62: 3f 92 push r3 12f64: 4f 92 push r4 12f66: 5f 92 push r5 12f68: 6f 92 push r6 12f6a: 7f 92 push r7 12f6c: 8f 92 push r8 12f6e: 9f 92 push r9 12f70: af 92 push r10 12f72: bf 92 push r11 12f74: cf 92 push r12 12f76: df 92 push r13 12f78: ef 92 push r14 12f7a: ff 92 push r15 12f7c: 0f 93 push r16 12f7e: 1f 93 push r17 12f80: cf 93 push r28 12f82: df 93 push r29 12f84: cd b7 in r28, 0x3d ; 61 12f86: de b7 in r29, 0x3e ; 62 12f88: cf 58 subi r28, 0x8F ; 143 12f8a: d1 09 sbc r29, r1 12f8c: 0f b6 in r0, 0x3f ; 63 12f8e: f8 94 cli 12f90: de bf out 0x3e, r29 ; 62 12f92: 0f be out 0x3f, r0 ; 63 12f94: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12f96: 82 e0 ldi r24, 0x02 ; 2 12f98: 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) 12f9c: a0 90 6d 12 lds r10, 0x126D ; 0x80126d 12fa0: b0 90 6e 12 lds r11, 0x126E ; 0x80126e 12fa4: 85 01 movw r16, r10 12fa6: 0d 57 subi r16, 0x7D ; 125 12fa8: 1f 4e sbci r17, 0xEF ; 239 12faa: 46 e0 ldi r20, 0x06 ; 6 12fac: 50 e0 ldi r21, 0x00 ; 0 12fae: 6d e8 ldi r22, 0x8D ; 141 12fb0: 7a e8 ldi r23, 0x8A ; 138 12fb2: c8 01 movw r24, r16 12fb4: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 12fb8: 89 2b or r24, r25 12fba: 09 f0 breq .+2 ; 0x12fbe 12fbc: b8 c0 rjmp .+368 ; 0x1312e { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12fbe: 8e e7 ldi r24, 0x7E ; 126 12fc0: 9a e8 ldi r25, 0x8A ; 138 12fc2: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 12fc6: 88 23 and r24, r24 12fc8: 09 f4 brne .+2 ; 0x12fcc 12fca: 91 c0 rjmp .+290 ; 0x130ee { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12fcc: 88 e5 ldi r24, 0x58 ; 88 12fce: 0e 94 0d 5d call 0xba1a ; 0xba1a 12fd2: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12fd4: 89 e5 ldi r24, 0x59 ; 89 12fd6: 0e 94 0d 5d call 0xba1a ; 0xba1a 12fda: 81 11 cpse r24, r1 12fdc: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12fde: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12fe2: 1a 82 std Y+2, r1 ; 0x02 12fe4: 19 82 std Y+1, r1 ; 0x01 12fe6: fe 01 movw r30, r28 12fe8: 33 96 adiw r30, 0x03 ; 3 12fea: 83 e1 ldi r24, 0x13 ; 19 12fec: df 01 movw r26, r30 12fee: 1d 92 st X+, r1 12ff0: 8a 95 dec r24 12ff2: e9 f7 brne .-6 ; 0x12fee if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12ff4: 48 ec ldi r20, 0xC8 ; 200 12ff6: 5f ea ldi r21, 0xAF ; 175 12ff8: 60 e0 ldi r22, 0x00 ; 0 12ffa: 70 e0 ldi r23, 0x00 ; 0 12ffc: 83 e7 ldi r24, 0x73 ; 115 12ffe: 93 e0 ldi r25, 0x03 ; 3 13000: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 13004: 81 11 cpse r24, r1 crashDet_counter = 0; 13006: 10 92 72 03 sts 0x0372, r1 ; 0x800372 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 1300a: 00 91 72 03 lds r16, 0x0372 ; 0x800372 1300e: 0f 5f subi r16, 0xFF ; 255 13010: 00 93 72 03 sts 0x0372, r16 ; 0x800372 automatic_recovery_after_crash = false; } crashDetTimer.start(); 13014: 83 e7 ldi r24, 0x73 ; 115 13016: 93 e0 ldi r25, 0x03 ; 3 13018: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> crashDet_axes |= mask; 1301c: 80 91 71 03 lds r24, 0x0371 ; 0x800371 13020: 81 2b or r24, r17 13022: 80 93 71 03 sts 0x0371, r24 ; 0x800371 if (mask & X_AXIS_MASK) { 13026: 10 ff sbrs r17, 0 13028: 08 c0 rjmp .+16 ; 0x1303a eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 1302a: 86 e6 ldi r24, 0x66 ; 102 1302c: 9f e0 ldi r25, 0x0F ; 15 1302e: 0e 94 44 78 call 0xf088 ; 0xf088 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 13032: 85 e0 ldi r24, 0x05 ; 5 13034: 9f e0 ldi r25, 0x0F ; 15 13036: 0e 94 37 78 call 0xf06e ; 0xf06e } if (mask & Y_AXIS_MASK) { 1303a: 11 ff sbrs r17, 1 1303c: 08 c0 rjmp .+16 ; 0x1304e eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 1303e: 88 e6 ldi r24, 0x68 ; 104 13040: 9f e0 ldi r25, 0x0F ; 15 13042: 0e 94 44 78 call 0xf088 ; 0xf088 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 13046: 83 e0 ldi r24, 0x03 ; 3 13048: 9f e0 ldi r25, 0x0F ; 15 1304a: 0e 94 37 78 call 0xf06e ; 0xf06e } lcd_update_enable(true); 1304e: 81 e0 ldi r24, 0x01 ; 1 13050: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_update(2); 13054: 82 e0 ldi r24, 0x02 ; 2 13056: 0e 94 ed 6f call 0xdfda ; 0xdfda // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 1305a: 61 2f mov r22, r17 1305c: ce 01 movw r24, r28 1305e: 01 96 adiw r24, 0x01 ; 1 13060: 0e 94 4f 75 call 0xea9e ; 0xea9e lcd_setstatus(msg); 13064: ce 01 movw r24, r28 13066: 01 96 adiw r24, 0x01 ; 1 13068: 0f 94 20 14 call 0x22840 ; 0x22840 gcode_G28(true, true, false); //home X and Y 1306c: 40 e0 ldi r20, 0x00 ; 0 1306e: 61 e0 ldi r22, 0x01 ; 1 13070: 81 e0 ldi r24, 0x01 ; 1 13072: 0e 94 21 81 call 0x10242 ; 0x10242 if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 13076: 61 e0 ldi r22, 0x01 ; 1 13078: 83 e1 ldi r24, 0x13 ; 19 1307a: 97 e8 ldi r25, 0x87 ; 135 crashdet_fmt_error(msg, mask); lcd_setstatus(msg); gcode_G28(true, true, false); //home X and Y if (automatic_recovery_after_crash) { 1307c: 03 30 cpi r16, 0x03 ; 3 1307e: 60 f1 brcs .+88 ; 0x130d8 13080: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 13084: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 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); 13088: 80 e0 ldi r24, 0x00 ; 0 1308a: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_clear(); 1308e: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 crashdet_fmt_error(msg, crashDet_axes); 13092: 60 91 71 03 lds r22, 0x0371 ; 0x800371 13096: ce 01 movw r24, r28 13098: 01 96 adiw r24, 0x01 ; 1 1309a: 0e 94 4f 75 call 0xea9e ; 0xea9e crashDet_axes = 0; 1309e: 10 92 71 03 sts 0x0371, r1 ; 0x800371 lcd_print(msg); 130a2: ce 01 movw r24, r28 130a4: 01 96 adiw r24, 0x01 ; 1 130a6: 0e 94 2d 72 call 0xe45a ; 0xe45a // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 130aa: 86 e6 ldi r24, 0x66 ; 102 130ac: 9c e3 ldi r25, 0x3C ; 60 130ae: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 130b2: ac 01 movw r20, r24 130b4: 61 e0 ldi r22, 0x01 ; 1 130b6: 80 e0 ldi r24, 0x00 ; 0 130b8: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_putc('?'); 130bc: 8f e3 ldi r24, 0x3F ; 63 130be: 0e 94 15 70 call 0xe02a ; 0xe02a //! @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); 130c2: 40 e0 ldi r20, 0x00 ; 0 130c4: 60 e0 ldi r22, 0x00 ; 0 130c6: 90 e0 ldi r25, 0x00 ; 0 130c8: 80 e0 ldi r24, 0x00 ; 0 130ca: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce 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")); 130ce: 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) 130d0: 81 11 cpse r24, r1 130d2: 0a c0 rjmp .+20 ; 0x130e8 { enquecommand_P(PSTR("CRASH_RECOVER")); 130d4: 85 e0 ldi r24, 0x05 ; 5 130d6: 97 e8 ldi r25, 0x87 ; 135 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 130d8: 0e 94 dc 89 call 0x113b8 ; 0x113b8 SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 130dc: 81 e0 ldi r24, 0x01 ; 1 130de: 80 93 96 02 sts 0x0296, r24 ; 0x800296 ClearToSend(); 130e2: 0e 94 46 81 call 0x1028c ; 0x1028c 130e6: 5e c3 rjmp .+1724 ; 0x137a4 { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 130e8: 88 ef ldi r24, 0xF8 ; 248 130ea: 96 e8 ldi r25, 0x86 ; 134 130ec: f5 cf rjmp .-22 ; 0x130d8 crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 130ee: 80 e7 ldi r24, 0x70 ; 112 130f0: 9a e8 ldi r25, 0x8A ; 138 130f2: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 130f6: 88 23 and r24, r24 130f8: 69 f0 breq .+26 ; 0x13114 } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 130fa: 0e 94 cb 68 call 0xd196 ; 0xd196 130fe: 81 11 cpse r24, r1 13100: 06 c0 rjmp .+12 ; 0x1310e 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 13102: 60 e0 ldi r22, 0x00 ; 0 13104: 70 e0 ldi r23, 0x00 ; 0 13106: 80 e8 ldi r24, 0x80 ; 128 13108: 9f e3 ldi r25, 0x3F ; 63 1310a: 0e 94 8a 69 call 0xd314 ; 0xd314 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 1310e: 0f 94 da 3a call 0x275b4 ; 0x275b4 13112: e4 cf rjmp .-56 ; 0x130dc else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 13114: 83 e6 ldi r24, 0x63 ; 99 13116: 9a e8 ldi r25, 0x8A ; 138 13118: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 1311c: 88 23 and r24, r24 1311e: f1 f2 breq .-68 ; 0x130dc } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 13120: 0f 94 da 3a call 0x275b4 ; 0x275b4 // Abort the print print_stop(); 13124: 60 e0 ldi r22, 0x00 ; 0 13126: 80 e0 ldi r24, 0x00 ; 0 13128: 0f 94 e1 14 call 0x229c2 ; 0x229c2 1312c: d7 cf rjmp .-82 ; 0x130dc // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 1312e: 44 e0 ldi r20, 0x04 ; 4 13130: 50 e0 ldi r21, 0x00 ; 0 13132: 6e e5 ldi r22, 0x5E ; 94 13134: 7a e8 ldi r23, 0x8A ; 138 13136: c8 01 movw r24, r16 13138: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 1313c: 89 2b or r24, r25 1313e: 09 f0 breq .+2 ; 0x13142 13140: fc c0 rjmp .+504 ; 0x1333a { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 13142: 85 01 movw r16, r10 13144: 09 57 subi r16, 0x79 ; 121 13146: 1f 4e sbci r17, 0xEF ; 239 13148: 49 e0 ldi r20, 0x09 ; 9 1314a: 50 e0 ldi r21, 0x00 ; 0 1314c: 64 e5 ldi r22, 0x54 ; 84 1314e: 7a e8 ldi r23, 0x8A ; 138 13150: c8 01 movw r24, r16 13152: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 13156: 89 2b or r24, r25 13158: c9 f4 brne .+50 ; 0x1318c { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1315a: f5 01 movw r30, r10 1315c: e0 57 subi r30, 0x70 ; 112 1315e: ff 4e sbci r31, 0xEF ; 239 13160: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 13162: 15 34 cpi r17, 0x45 ; 69 13164: 89 f0 breq .+34 ; 0x13188 13166: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 13168: 14 30 cpi r17, 0x04 ; 4 1316a: 08 f0 brcs .+2 ; 0x1316e 1316c: b7 cf rjmp .-146 ; 0x130dc { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 1316e: 4a e0 ldi r20, 0x0A ; 10 13170: 50 e0 ldi r21, 0x00 ; 0 13172: 70 e0 ldi r23, 0x00 ; 0 13174: 60 e0 ldi r22, 0x00 ; 0 13176: c5 01 movw r24, r10 13178: 8f 56 subi r24, 0x6F ; 111 1317a: 9f 4e sbci r25, 0xEF ; 239 1317c: 0f 94 9a d8 call 0x3b134 ; 0x3b134 tmc2130_set_wave(axis, 247, fac); 13180: 81 2f mov r24, r17 13182: 0f 94 dc 87 call 0x30fb8 ; 0x30fb8 13186: aa cf rjmp .-172 ; 0x130dc // ### 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'); 13188: 13 e0 ldi r17, 0x03 ; 3 1318a: f1 cf rjmp .-30 ; 0x1316e } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 1318c: 49 e0 ldi r20, 0x09 ; 9 1318e: 50 e0 ldi r21, 0x00 ; 0 13190: 6a e4 ldi r22, 0x4A ; 74 13192: 7a e8 ldi r23, 0x8A ; 138 13194: c8 01 movw r24, r16 13196: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 1319a: 89 2b or r24, r25 1319c: 51 f5 brne .+84 ; 0x131f2 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1319e: f5 01 movw r30, r10 131a0: e0 57 subi r30, 0x70 ; 112 131a2: ff 4e sbci r31, 0xEF ; 239 131a4: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 131a6: 15 34 cpi r17, 0x45 ; 69 131a8: 11 f1 breq .+68 ; 0x131ee 131aa: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 131ac: 14 30 cpi r17, 0x04 ; 4 131ae: 08 f0 brcs .+2 ; 0x131b2 131b0: 95 cf rjmp .-214 ; 0x130dc { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 131b2: 4a e0 ldi r20, 0x0A ; 10 131b4: 50 e0 ldi r21, 0x00 ; 0 131b6: 70 e0 ldi r23, 0x00 ; 0 131b8: 60 e0 ldi r22, 0x00 ; 0 131ba: c5 01 movw r24, r10 131bc: 8f 56 subi r24, 0x6F ; 111 131be: 9f 4e sbci r25, 0xEF ; 239 131c0: 0f 94 9a d8 call 0x3b134 ; 0x3b134 131c4: e1 2f mov r30, r17 131c6: f0 e0 ldi r31, 0x00 ; 0 131c8: eb 50 subi r30, 0x0B ; 11 131ca: fb 4f sbci r31, 0xFB ; 251 131cc: 80 81 ld r24, Z 131ce: 40 e0 ldi r20, 0x00 ; 0 131d0: 51 e0 ldi r21, 0x01 ; 1 131d2: 02 c0 rjmp .+4 ; 0x131d8 131d4: 56 95 lsr r21 131d6: 47 95 ror r20 131d8: 8a 95 dec r24 131da: e2 f7 brpl .-8 ; 0x131d4 uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 131dc: 84 2f mov r24, r20 131de: 88 0f add r24, r24 131e0: 88 0f add r24, r24 131e2: 81 50 subi r24, 0x01 ; 1 131e4: 68 23 and r22, r24 131e6: 81 2f mov r24, r17 131e8: 0f 94 f3 8a call 0x315e6 ; 0x315e6 131ec: 77 cf rjmp .-274 ; 0x130dc // ### 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'); 131ee: 13 e0 ldi r17, 0x03 ; 3 131f0: e0 cf rjmp .-64 ; 0x131b2 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 131f2: 49 e0 ldi r20, 0x09 ; 9 131f4: 50 e0 ldi r21, 0x00 ; 0 131f6: 60 e4 ldi r22, 0x40 ; 64 131f8: 7a e8 ldi r23, 0x8A ; 138 131fa: c8 01 movw r24, r16 131fc: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 13200: 89 2b or r24, r25 13202: 09 f0 breq .+2 ; 0x13206 13204: 6b cf rjmp .-298 ; 0x130dc { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 13206: f5 01 movw r30, r10 13208: e0 57 subi r30, 0x70 ; 112 1320a: ff 4e sbci r31, 0xEF ; 239 1320c: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 1320e: 85 34 cpi r24, 0x45 ; 69 13210: 09 f4 brne .+2 ; 0x13214 13212: 90 c0 rjmp .+288 ; 0x13334 13214: 18 ea ldi r17, 0xA8 ; 168 13216: c1 2e mov r12, r17 13218: c8 0e add r12, r24 if (axis < 4) 1321a: b3 e0 ldi r27, 0x03 ; 3 1321c: bc 15 cp r27, r12 1321e: 08 f4 brcc .+2 ; 0x13222 13220: 5d cf rjmp .-326 ; 0x130dc { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 13222: ec 2c mov r14, r12 13224: f1 2c mov r15, r1 13226: 47 01 movw r8, r14 13228: 88 0c add r8, r8 1322a: 99 1c adc r9, r9 1322c: f4 01 movw r30, r8 1322e: e3 58 subi r30, 0x83 ; 131 13230: fd 4f sbci r31, 0xFD ; 253 13232: 00 81 ld r16, Z 13234: 20 2f mov r18, r16 13236: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 13238: 10 2f mov r17, r16 1323a: 12 95 swap r17 1323c: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 1323e: 00 1f adc r16, r16 13240: 00 27 eor r16, r16 13242: 00 1f adc r16, r16 13244: 61 81 ldd r22, Z+1 ; 0x01 13246: 67 70 andi r22, 0x07 ; 7 13248: 66 0f add r22, r22 1324a: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 1324c: f4 01 movw r30, r8 1324e: e2 58 subi r30, 0x82 ; 130 13250: fd 4f sbci r31, 0xFD ; 253 13252: d0 80 ld r13, Z 13254: d6 94 lsr r13 13256: d6 94 lsr r13 13258: d6 94 lsr r13 1325a: ed 2d mov r30, r13 1325c: e3 70 andi r30, 0x03 ; 3 1325e: de 2e mov r13, r30 char* str_end = 0; 13260: 1a 82 std Y+2, r1 ; 0x02 13262: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 13264: c5 01 movw r24, r10 13266: 8f 56 subi r24, 0x6F ; 111 13268: 9f 4e sbci r25, 0xEF ; 239 1326a: dc 01 movw r26, r24 1326c: 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; 1326e: 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]) 13270: 33 23 and r19, r19 13272: e1 f1 breq .+120 ; 0x132ec { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 13274: 4a e0 ldi r20, 0x0A ; 10 13276: 50 e0 ldi r21, 0x00 ; 0 13278: be 01 movw r22, r28 1327a: 6f 5f subi r22, 0xFF ; 255 1327c: 7f 4f sbci r23, 0xFF ; 255 1327e: 0f 94 9a d8 call 0x3b134 ; 0x3b134 13282: 6f 70 andi r22, 0x0F ; 15 13284: b6 2e mov r11, r22 if (str_end && *str_end) 13286: 89 81 ldd r24, Y+1 ; 0x01 13288: 9a 81 ldd r25, Y+2 ; 0x02 1328a: 00 97 sbiw r24, 0x00 ; 0 1328c: 79 f1 breq .+94 ; 0x132ec 1328e: fc 01 movw r30, r24 13290: 20 81 ld r18, Z 13292: 22 23 and r18, r18 13294: 59 f1 breq .+86 ; 0x132ec { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 13296: 4a e0 ldi r20, 0x0A ; 10 13298: 50 e0 ldi r21, 0x00 ; 0 1329a: be 01 movw r22, r28 1329c: 6f 5f subi r22, 0xFF ; 255 1329e: 7f 4f sbci r23, 0xFF ; 255 132a0: 0f 94 9a d8 call 0x3b134 ; 0x3b134 132a4: 16 2f mov r17, r22 132a6: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 132a8: 89 81 ldd r24, Y+1 ; 0x01 132aa: 9a 81 ldd r25, Y+2 ; 0x02 132ac: 00 97 sbiw r24, 0x00 ; 0 132ae: f1 f0 breq .+60 ; 0x132ec 132b0: dc 01 movw r26, r24 132b2: 2c 91 ld r18, X 132b4: 22 23 and r18, r18 132b6: d1 f0 breq .+52 ; 0x132ec { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 132b8: 4a e0 ldi r20, 0x0A ; 10 132ba: 50 e0 ldi r21, 0x00 ; 0 132bc: be 01 movw r22, r28 132be: 6f 5f subi r22, 0xFF ; 255 132c0: 7f 4f sbci r23, 0xFF ; 255 132c2: 0f 94 9a d8 call 0x3b134 ; 0x3b134 132c6: 06 2f mov r16, r22 132c8: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 132ca: 89 81 ldd r24, Y+1 ; 0x01 132cc: 9a 81 ldd r25, Y+2 ; 0x02 132ce: 00 97 sbiw r24, 0x00 ; 0 132d0: 69 f0 breq .+26 ; 0x132ec 132d2: fc 01 movw r30, r24 132d4: 20 81 ld r18, Z 132d6: 22 23 and r18, r18 132d8: 49 f0 breq .+18 ; 0x132ec chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 132da: 4a e0 ldi r20, 0x0A ; 10 132dc: 50 e0 ldi r21, 0x00 ; 0 132de: be 01 movw r22, r28 132e0: 6f 5f subi r22, 0xFF ; 255 132e2: 7f 4f sbci r23, 0xFF ; 255 132e4: 0f 94 9a d8 call 0x3b134 ; 0x3b134 132e8: 63 70 andi r22, 0x03 ; 3 132ea: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 132ec: f4 01 movw r30, r8 132ee: e3 58 subi r30, 0x83 ; 131 132f0: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 132f2: 17 70 andi r17, 0x07 ; 7 132f4: 12 95 swap r17 132f6: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 132f8: 60 2f mov r22, r16 132fa: 67 95 ror r22 132fc: 66 27 eor r22, r22 132fe: 67 95 ror r22 13300: 1b 29 or r17, r11 13302: 16 2b or r17, r22 13304: 10 83 st Z, r17 13306: 60 2f mov r22, r16 13308: 66 95 lsr r22 1330a: 01 81 ldd r16, Z+1 ; 0x01 1330c: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 1330e: 2d 2d mov r18, r13 13310: 23 70 andi r18, 0x03 ; 3 13312: d2 2e mov r13, r18 13314: dd 0c add r13, r13 13316: dd 0c add r13, r13 13318: dd 0c add r13, r13 1331a: 06 2b or r16, r22 1331c: d0 2a or r13, r16 1331e: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 13320: f7 01 movw r30, r14 13322: eb 50 subi r30, 0x0B ; 11 13324: fb 4f sbci r31, 0xFB ; 251 13326: 50 e0 ldi r21, 0x00 ; 0 13328: 40 e0 ldi r20, 0x00 ; 0 1332a: 60 81 ld r22, Z 1332c: 8c 2d mov r24, r12 1332e: 0f 94 14 39 call 0x27228 ; 0x27228 13332: d4 ce rjmp .-600 ; 0x130dc // ### 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'); 13334: b3 e0 ldi r27, 0x03 ; 3 13336: cb 2e mov r12, r27 13338: 74 cf rjmp .-280 ; 0x13222 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) { 1333a: 45 e0 ldi r20, 0x05 ; 5 1333c: 50 e0 ldi r21, 0x00 ; 0 1333e: 6a e3 ldi r22, 0x3A ; 58 13340: 7a e8 ldi r23, 0x8A ; 138 13342: c8 01 movw r24, r16 13344: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 13348: 89 2b or r24, r25 1334a: 09 f0 breq .+2 ; 0x1334e 1334c: 64 c1 rjmp .+712 ; 0x13616 - `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"))) { 1334e: 80 e3 ldi r24, 0x30 ; 48 13350: 9a e8 ldi r25, 0x8A ; 138 13352: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 13356: 88 23 and r24, r24 13358: 09 f4 brne .+2 ; 0x1335c 1335a: 3c c0 rjmp .+120 ; 0x133d4 //! 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 1335c: 10 92 33 05 sts 0x0533, r1 ; 0x800533 13360: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 13362: c1 2c mov r12, r1 13364: d1 2c mov r13, r1 13366: 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); 13368: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 1336a: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 1336c: 64 e1 ldi r22, 0x14 ; 20 1336e: 70 e0 ldi r23, 0x00 ; 0 13370: 80 e0 ldi r24, 0x00 ; 0 13372: 90 e0 ldi r25, 0x00 ; 0 13374: 0f 94 5c 3c call 0x278b8 ; 0x278b8 unsigned long tachMeasure = _micros(); 13378: 0f 94 36 3c call 0x2786c ; 0x2786c 1337c: 4b 01 movw r8, r22 1337e: 5c 01 movw r10, r24 cli(); 13380: f8 94 cli SET_INPUT(TACH_1); 13382: 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 ) ; 13384: 67 9b sbis 0x0c, 7 ; 12 13386: fe cf rjmp .-4 ; 0x13384 sei(); 13388: 78 94 sei tachMeasure = _micros() - tachMeasure; 1338a: 0f 94 36 3c call 0x2786c ; 0x2786c 1338e: dc 01 movw r26, r24 13390: cb 01 movw r24, r22 13392: 88 19 sub r24, r8 13394: 99 09 sbc r25, r9 13396: aa 09 sbc r26, r10 13398: bb 09 sbc r27, r11 1339a: c8 16 cp r12, r24 1339c: d9 06 cpc r13, r25 1339e: ea 06 cpc r14, r26 133a0: fb 06 cpc r15, r27 133a2: 10 f4 brcc .+4 ; 0x133a8 133a4: 6c 01 movw r12, r24 133a6: 7d 01 movw r14, r26 133a8: 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){ 133aa: f1 f6 brne .-68 ; 0x13368 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 "); 133ac: 8d ee ldi r24, 0xED ; 237 133ae: 96 e8 ldi r25, 0x86 ; 134 133b0: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 133b4: 89 ee ldi r24, 0xE9 ; 233 133b6: 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 ){ 133b8: 35 ef ldi r19, 0xF5 ; 245 133ba: c3 16 cp r12, r19 133bc: 31 e0 ldi r19, 0x01 ; 1 133be: d3 06 cpc r13, r19 133c0: e1 04 cpc r14, r1 133c2: f1 04 cpc r15, r1 133c4: 10 f4 brcc .+4 ; 0x133ca // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 133c6: 86 ee ldi r24, 0xE6 ; 230 133c8: 96 e8 ldi r25, 0x86 ; 134 133ca: 0e 94 97 7b call 0xf72e ; 0xf72e } // cleanup after the test function SET_INPUT(TACH_1); 133ce: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 133d0: 77 9a sbi 0x0e, 7 ; 14 133d2: 84 ce rjmp .-760 ; 0x130dc */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 133d4: 8c e2 ldi r24, 0x2C ; 44 133d6: 9a e8 ldi r25, 0x8A ; 138 133d8: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 133dc: 88 23 and r24, r24 133de: 21 f1 breq .+72 ; 0x13428 printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 133e0: 40 91 b0 04 lds r20, 0x04B0 ; 0x8004b0 133e4: 50 91 b1 04 lds r21, 0x04B1 ; 0x8004b1 133e8: 2c e3 ldi r18, 0x3C ; 60 133ea: 24 9f mul r18, r20 133ec: c0 01 movw r24, r0 133ee: 25 9f mul r18, r21 133f0: 90 0d add r25, r0 133f2: 11 24 eor r1, r1 133f4: 9f 93 push r25 133f6: 8f 93 push r24 133f8: 40 91 ae 04 lds r20, 0x04AE ; 0x8004ae 133fc: 50 91 af 04 lds r21, 0x04AF ; 0x8004af 13400: 24 9f mul r18, r20 13402: c0 01 movw r24, r0 13404: 25 9f mul r18, r21 13406: 90 0d add r25, r0 13408: 11 24 eor r1, r1 1340a: 9f 93 push r25 1340c: 8f 93 push r24 1340e: 8e ea ldi r24, 0xAE ; 174 13410: 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); 13412: 9f 93 push r25 13414: 8f 93 push r24 13416: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1341a: 0f 90 pop r0 1341c: 0f 90 pop r0 1341e: 0f 90 pop r0 13420: 0f 90 pop r0 13422: 0f 90 pop r0 13424: 0f 90 pop r0 13426: 5a ce rjmp .-844 ; 0x130dc 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 13428: 87 e2 ldi r24, 0x27 ; 39 1342a: 9a e8 ldi r25, 0x8A ; 138 1342c: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 13430: 88 23 and r24, r24 13432: 11 f1 breq .+68 ; 0x13478 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 13434: 8c e8 ldi r24, 0x8C ; 140 13436: 9f e0 ldi r25, 0x0F ; 15 13438: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1343c: 81 11 cpse r24, r1 1343e: 10 c0 rjmp .+32 ; 0x13460 // M24 - Start SD print enquecommand_P(MSG_M24); 13440: 61 e0 ldi r22, 0x01 ; 1 13442: 8d ec ldi r24, 0xCD ; 205 13444: 91 e7 ldi r25, 0x71 ; 113 13446: 0e 94 dc 89 call 0x113b8 ; 0x113b8 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1344a: 60 e0 ldi r22, 0x00 ; 0 1344c: 85 ea ldi r24, 0xA5 ; 165 1344e: 9f e0 ldi r25, 0x0F ; 15 13450: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 13454: 60 e0 ldi r22, 0x00 ; 0 13456: 8f e7 ldi r24, 0x7F ; 127 13458: 9c e0 ldi r25, 0x0C ; 12 1345a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 1345e: 3e ce rjmp .-900 ; 0x130dc // 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) { 13460: 81 30 cpi r24, 0x01 ; 1 13462: 09 f0 breq .+2 ; 0x13466 13464: 3b ce rjmp .-906 ; 0x130dc // 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(); 13466: 0f 94 80 57 call 0x2af00 ; 0x2af00 usb_timer.start(); 1346a: 8e e0 ldi r24, 0x0E ; 14 1346c: 95 e0 ldi r25, 0x05 ; 5 1346e: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::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(); 13472: 0f 94 61 3e call 0x27cc2 ; 0x27cc2 13476: 32 ce rjmp .-924 ; 0x130dc } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 13478: 80 e2 ldi r24, 0x20 ; 32 1347a: 9a e8 ldi r25, 0x8A ; 138 1347c: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 13480: 88 23 and r24, r24 13482: 21 f0 breq .+8 ; 0x1348c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 13484: 80 e0 ldi r24, 0x00 ; 0 13486: 0f 94 86 1c call 0x2390c ; 0x2390c 1348a: 28 ce rjmp .-944 ; 0x130dc MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 1348c: 8a e1 ldi r24, 0x1A ; 26 1348e: 9a e8 ldi r25, 0x8A ; 138 13490: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 13494: 88 23 and r24, r24 13496: 51 f0 breq .+20 ; 0x134ac #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 13498: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e6> 1349c: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e7> 134a0: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e8> 134a4: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e9> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 134a8: 0e 94 92 68 call 0xd124 ; 0xd124 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 134ac: 87 e1 ldi r24, 0x17 ; 23 134ae: 9a e8 ldi r25, 0x8A ; 138 134b0: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 134b4: 88 23 and r24, r24 134b6: a9 f0 breq .+42 ; 0x134e2 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 134b8: 44 e1 ldi r20, 0x14 ; 20 134ba: 50 e0 ldi r21, 0x00 ; 0 134bc: 65 e1 ldi r22, 0x15 ; 21 134be: 7d e0 ldi r23, 0x0D ; 13 134c0: ce 01 movw r24, r28 134c2: 01 96 adiw r24, 0x01 ; 1 134c4: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe if (SN[19]) 134c8: 8c 89 ldd r24, Y+20 ; 0x14 134ca: 88 23 and r24, r24 134cc: 29 f0 breq .+10 ; 0x134d8 puts_P(PSTR("SN invalid")); 134ce: 8c e0 ldi r24, 0x0C ; 12 134d0: 9a e8 ldi r25, 0x8A ; 138 134d2: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 134d6: 02 ce rjmp .-1020 ; 0x130dc else puts(SN); 134d8: ce 01 movw r24, r28 134da: 01 96 adiw r24, 0x01 ; 1 134dc: 0f 94 9e e3 call 0x3c73c ; 0x3c73c 134e0: fd cd rjmp .-1030 ; 0x130dc } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 134e2: 88 e0 ldi r24, 0x08 ; 8 134e4: 9a e8 ldi r25, 0x8A ; 138 134e6: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 134ea: 88 23 and r24, r24 134ec: 29 f0 breq .+10 ; 0x134f8 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 134ee: 8c ef ldi r24, 0xFC ; 252 134f0: 99 e8 ldi r25, 0x89 ; 137 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 134f2: 0e 94 97 7b call 0xf72e ; 0xf72e 134f6: f2 cd rjmp .-1052 ; 0x130dc 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 134f8: 88 ef ldi r24, 0xF8 ; 248 134fa: 99 e8 ldi r25, 0x89 ; 137 134fc: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 13500: 88 23 and r24, r24 13502: 19 f0 breq .+6 ; 0x1350a SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 13504: 88 ed ldi r24, 0xD8 ; 216 13506: 99 e8 ldi r25, 0x89 ; 137 13508: f4 cf rjmp .-24 ; 0x134f2 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 1350a: 83 ed ldi r24, 0xD3 ; 211 1350c: 99 e8 ldi r25, 0x89 ; 137 1350e: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 13512: 88 23 and r24, r24 13514: 19 f0 breq .+6 ; 0x1351c lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 13516: 0e 94 72 72 call 0xe4e4 ; 0xe4e4 1351a: e0 cd rjmp .-1088 ; 0x130dc 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 1351c: 80 ed ldi r24, 0xD0 ; 208 1351e: 99 e8 ldi r25, 0x89 ; 137 13520: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 13524: 88 23 and r24, r24 13526: 79 f0 breq .+30 ; 0x13546 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 13528: 81 ea ldi r24, 0xA1 ; 161 1352a: 9d e0 ldi r25, 0x0D ; 13 1352c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 13530: 4b e0 ldi r20, 0x0B ; 11 13532: 84 9f mul r24, r20 13534: c0 01 movw r24, r0 13536: 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); 13538: 70 e0 ldi r23, 0x00 ; 0 1353a: 60 e0 ldi r22, 0x00 ; 0 1353c: 80 5b subi r24, 0xB0 ; 176 1353e: 92 4f sbci r25, 0xF2 ; 242 13540: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 13544: cb cd rjmp .-1130 ; 0x130dc } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 13546: 8d ec ldi r24, 0xCD ; 205 13548: 99 e8 ldi r25, 0x89 ; 137 1354a: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 1354e: 88 23 and r24, r24 13550: 51 f0 breq .+20 ; 0x13566 // 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(); 13552: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 Sound_MakeCustom(100,0,false); 13556: 40 e0 ldi r20, 0x00 ; 0 13558: 70 e0 ldi r23, 0x00 ; 0 1355a: 60 e0 ldi r22, 0x00 ; 0 1355c: 84 e6 ldi r24, 0x64 ; 100 1355e: 90 e0 ldi r25, 0x00 ; 0 13560: 0f 94 1a 69 call 0x2d234 ; 0x2d234 13564: d8 cf rjmp .-80 ; 0x13516 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 13566: 89 ec ldi r24, 0xC9 ; 201 13568: 99 e8 ldi r25, 0x89 ; 137 1356a: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 1356e: 88 23 and r24, r24 13570: e1 f0 breq .+56 ; 0x135aa // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13572: 86 e5 ldi r24, 0x56 ; 86 13574: 0e 94 0d 5d call 0xba1a ; 0xba1a 13578: 88 23 and r24, r24 1357a: 09 f4 brne .+2 ; 0x1357e 1357c: af cd rjmp .-1186 ; 0x130dc bool value = code_value_short(); 1357e: 0e 94 ac 5c call 0xb958 ; 0xb958 13582: 11 e0 ldi r17, 0x01 ; 1 13584: 89 2b or r24, r25 13586: 09 f4 brne .+2 ; 0x1358a 13588: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 1358a: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 if(value != mbl.active) { 1358e: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 13592: 90 e0 ldi r25, 0x00 ; 0 13594: 18 17 cp r17, r24 13596: 19 06 cpc r1, r25 13598: 09 f4 brne .+2 ; 0x1359c 1359a: a0 cd rjmp .-1216 ; 0x130dc mbl.active = value; 1359c: 10 93 9d 13 sts 0x139D, r17 ; 0x80139d // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 135a0: 88 e4 ldi r24, 0x48 ; 72 135a2: 97 e0 ldi r25, 0x07 ; 7 135a4: 0f 94 95 aa call 0x3552a ; 0x3552a 135a8: 99 cd rjmp .-1230 ; 0x130dc } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 135aa: 82 ec ldi r24, 0xC2 ; 194 135ac: 99 e8 ldi r25, 0x89 ; 137 135ae: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 135b2: 88 23 and r24, r24 135b4: 09 f4 brne .+2 ; 0x135b8 135b6: 92 cd rjmp .-1244 ; 0x130dc uint16_t nDiameter; if(code_seen('D')) { 135b8: 84 e4 ldi r24, 0x44 ; 68 135ba: 0e 94 0d 5d call 0xba1a ; 0xba1a 135be: 88 23 and r24, r24 135c0: a1 f0 breq .+40 ; 0x135ea nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 135c2: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 135c6: 20 e0 ldi r18, 0x00 ; 0 135c8: 30 e0 ldi r19, 0x00 ; 0 135ca: 4a e7 ldi r20, 0x7A ; 122 135cc: 54 e4 ldi r21, 0x44 ; 68 135ce: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 135d2: 20 e0 ldi r18, 0x00 ; 0 135d4: 30 e0 ldi r19, 0x00 ; 0 135d6: 40 e0 ldi r20, 0x00 ; 0 135d8: 5f e3 ldi r21, 0x3F ; 63 135da: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 135de: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> nozzle_diameter_check(nDiameter); 135e2: cb 01 movw r24, r22 135e4: 0f 94 77 15 call 0x22aee ; 0x22aee 135e8: 79 cd rjmp .-1294 ; 0x130dc } else if(code_seen_P(PSTR("set")) && farm_mode) { 135ea: 8e eb ldi r24, 0xBE ; 190 135ec: 99 e8 ldi r25, 0x89 ; 137 135ee: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 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); 135f2: 85 ea ldi r24, 0xA5 ; 165 135f4: 9d e0 ldi r25, 0x0D ; 13 135f6: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 135fa: bc 01 movw r22, r24 135fc: 90 e0 ldi r25, 0x00 ; 0 135fe: 80 e0 ldi r24, 0x00 ; 0 13600: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 13604: 20 e0 ldi r18, 0x00 ; 0 13606: 30 e0 ldi r19, 0x00 ; 0 13608: 4a e7 ldi r20, 0x7A ; 122 1360a: 54 e4 ldi r21, 0x44 ; 68 1360c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 13610: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 13614: 63 cd rjmp .-1338 ; 0x130dc } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 13616: d8 01 movw r26, r16 13618: 8c 91 ld r24, X 1361a: 87 34 cpi r24, 0x47 ; 71 1361c: 11 f0 breq .+4 ; 0x13622 1361e: 0c 94 a6 a6 jmp 0x14d4c ; 0x14d4c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 13622: 10 93 94 03 sts 0x0394, r17 ; 0x800394 13626: 00 93 93 03 sts 0x0393, r16 ; 0x800393 gcode_in_progress = code_value_short(); 1362a: 0e 94 ac 5c call 0xb958 ; 0xb958 1362e: 90 93 92 03 sts 0x0392, r25 ; 0x800392 13632: 80 93 91 03 sts 0x0391, r24 ; 0x800391 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 13636: 8e 31 cpi r24, 0x1E ; 30 13638: 91 05 cpc r25, r1 1363a: 09 f4 brne .+2 ; 0x1363e 1363c: da c6 rjmp .+3508 ; 0x143f2 1363e: 0c f0 brlt .+2 ; 0x13642 13640: 45 c1 rjmp .+650 ; 0x138cc 13642: 84 30 cpi r24, 0x04 ; 4 13644: 91 05 cpc r25, r1 13646: 09 f4 brne .+2 ; 0x1364a 13648: 7e c6 rjmp .+3324 ; 0x14346 1364a: 0c f0 brlt .+2 ; 0x1364e 1364c: c5 c0 rjmp .+394 ; 0x137d8 1364e: 97 fd sbrc r25, 7 13650: cb c0 rjmp .+406 ; 0x137e8 13652: 02 97 sbiw r24, 0x02 ; 2 13654: 0c f0 brlt .+2 ; 0x13658 13656: fc c1 rjmp .+1016 ; 0x13a50 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 13658: 0e 94 aa 5b call 0xb754 ; 0xb754 1365c: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 1365e: 0e 94 0a 63 call 0xc614 ; 0xc614 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 13662: 60 91 5f 06 lds r22, 0x065F ; 0x80065f 13666: 70 91 60 06 lds r23, 0x0660 ; 0x800660 1366a: 80 91 61 06 lds r24, 0x0661 ; 0x800661 1366e: 90 91 62 06 lds r25, 0x0662 ; 0x800662 13672: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 13676: 6b 01 movw r12, r22 13678: 7c 01 movw r14, r24 1367a: 40 90 4c 07 lds r4, 0x074C ; 0x80074c 1367e: 50 90 4d 07 lds r5, 0x074D ; 0x80074d 13682: 60 90 4e 07 lds r6, 0x074E ; 0x80074e 13686: 70 90 4f 07 lds r7, 0x074F ; 0x80074f 1368a: 80 90 5d 05 lds r8, 0x055D ; 0x80055d 1368e: 90 90 5e 05 lds r9, 0x055E ; 0x80055e 13692: a0 90 5f 05 lds r10, 0x055F ; 0x80055f 13696: b0 90 60 05 lds r11, 0x0560 ; 0x800560 1369a: a5 01 movw r20, r10 1369c: 94 01 movw r18, r8 1369e: c3 01 movw r24, r6 136a0: b2 01 movw r22, r4 136a2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 136a6: 20 e0 ldi r18, 0x00 ; 0 136a8: 30 e0 ldi r19, 0x00 ; 0 136aa: 48 ec ldi r20, 0xC8 ; 200 136ac: 52 e4 ldi r21, 0x42 ; 66 136ae: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 136b2: 9b 01 movw r18, r22 136b4: ac 01 movw r20, r24 136b6: c7 01 movw r24, r14 136b8: b6 01 movw r22, r12 136ba: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 136be: 18 16 cp r1, r24 136c0: d4 f4 brge .+52 ; 0x136f6 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 136c2: a3 01 movw r20, r6 136c4: 92 01 movw r18, r4 136c6: c5 01 movw r24, r10 136c8: b4 01 movw r22, r8 136ca: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 136ce: 20 e0 ldi r18, 0x00 ; 0 136d0: 30 e0 ldi r19, 0x00 ; 0 136d2: 48 ec ldi r20, 0xC8 ; 200 136d4: 52 e4 ldi r21, 0x42 ; 66 136d6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 136da: a7 01 movw r20, r14 136dc: 96 01 movw r18, r12 136de: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 136e2: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 136e6: 60 93 5f 06 sts 0x065F, r22 ; 0x80065f 136ea: 70 93 60 06 sts 0x0660, r23 ; 0x800660 136ee: 80 93 61 06 sts 0x0661, r24 ; 0x800661 136f2: 90 93 62 06 sts 0x0662, r25 ; 0x800662 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 136f6: 80 91 ed 06 lds r24, 0x06ED ; 0x8006ed 136fa: 88 23 and r24, r24 136fc: 09 f4 brne .+2 ; 0x13700 136fe: a4 c1 rjmp .+840 ; 0x13a48 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 13700: 88 e5 ldi r24, 0x58 ; 88 13702: 0e 94 0d 5d call 0xba1a ; 0xba1a 13706: 81 11 cpse r24, r1 13708: 9f c1 rjmp .+830 ; 0x13a48 1370a: 89 e5 ldi r24, 0x59 ; 89 1370c: 0e 94 0d 5d call 0xba1a ; 0xba1a 13710: 81 11 cpse r24, r1 13712: 9a c1 rjmp .+820 ; 0x13a48 13714: 8a e5 ldi r24, 0x5A ; 90 13716: 0e 94 0d 5d call 0xba1a ; 0xba1a 1371a: 81 11 cpse r24, r1 1371c: 95 c1 rjmp .+810 ; 0x13a48 1371e: 85 e4 ldi r24, 0x45 ; 69 13720: 0e 94 0d 5d call 0xba1a ; 0xba1a 13724: 88 23 and r24, r24 13726: 09 f4 brne .+2 ; 0x1372a 13728: 8f c1 rjmp .+798 ; 0x13a48 float echange=destination[E_AXIS]-current_position[E_AXIS]; 1372a: 20 91 4c 07 lds r18, 0x074C ; 0x80074c 1372e: 30 91 4d 07 lds r19, 0x074D ; 0x80074d 13732: 40 91 4e 07 lds r20, 0x074E ; 0x80074e 13736: 50 91 4f 07 lds r21, 0x074F ; 0x80074f 1373a: 60 91 5d 05 lds r22, 0x055D ; 0x80055d 1373e: 70 91 5e 05 lds r23, 0x055E ; 0x80055e 13742: 80 91 5f 05 lds r24, 0x055F ; 0x80055f 13746: 90 91 60 05 lds r25, 0x0560 ; 0x800560 1374a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1374e: 6b 01 movw r12, r22 13750: 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 13752: 2d ec ldi r18, 0xCD ; 205 13754: 3c ec ldi r19, 0xCC ; 204 13756: 4c ec ldi r20, 0xCC ; 204 13758: 5d eb ldi r21, 0xBD ; 189 1375a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1375e: 87 ff sbrs r24, 7 13760: 65 c1 rjmp .+714 ; 0x13a2c 13762: 80 91 3c 07 lds r24, 0x073C ; 0x80073c 13766: 81 11 cpse r24, r1 13768: 0c 94 5b ce jmp 0x19cb6 ; 0x19cb6 st_synchronize(); 1376c: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13770: 80 91 5d 05 lds r24, 0x055D ; 0x80055d 13774: 90 91 5e 05 lds r25, 0x055E ; 0x80055e 13778: a0 91 5f 05 lds r26, 0x055F ; 0x80055f 1377c: b0 91 60 05 lds r27, 0x0560 ; 0x800560 13780: 80 93 4c 07 sts 0x074C, r24 ; 0x80074c 13784: 90 93 4d 07 sts 0x074D, r25 ; 0x80074d 13788: a0 93 4e 07 sts 0x074E, r26 ; 0x80074e 1378c: b0 93 4f 07 sts 0x074F, r27 ; 0x80074f plan_set_e_position(current_position[E_AXIS]); //AND from the planner 13790: 8c e4 ldi r24, 0x4C ; 76 13792: 97 e0 ldi r25, 0x07 ; 7 13794: 0f 94 62 aa call 0x354c4 ; 0x354c4 retract(!retracted[active_extruder]); 13798: 90 91 3c 07 lds r25, 0x073C ; 0x80073c 1379c: 81 e0 ldi r24, 0x01 ; 1 1379e: 89 27 eor r24, r25 137a0: 0f 94 78 89 call 0x312f0 ; 0x312f0 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 137a4: c1 57 subi r28, 0x71 ; 113 137a6: df 4f sbci r29, 0xFF ; 255 137a8: 0f b6 in r0, 0x3f ; 63 137aa: f8 94 cli 137ac: de bf out 0x3e, r29 ; 62 137ae: 0f be out 0x3f, r0 ; 63 137b0: cd bf out 0x3d, r28 ; 61 137b2: df 91 pop r29 137b4: cf 91 pop r28 137b6: 1f 91 pop r17 137b8: 0f 91 pop r16 137ba: ff 90 pop r15 137bc: ef 90 pop r14 137be: df 90 pop r13 137c0: cf 90 pop r12 137c2: bf 90 pop r11 137c4: af 90 pop r10 137c6: 9f 90 pop r9 137c8: 8f 90 pop r8 137ca: 7f 90 pop r7 137cc: 6f 90 pop r6 137ce: 5f 90 pop r5 137d0: 4f 90 pop r4 137d2: 3f 90 pop r3 137d4: 2f 90 pop r2 137d6: 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) 137d8: 8b 30 cpi r24, 0x0B ; 11 137da: 91 05 cpc r25, r1 137dc: 09 f4 brne .+2 ; 0x137e0 137de: 00 c6 rjmp .+3072 ; 0x143e0 137e0: dc f4 brge .+54 ; 0x13818 137e2: 0a 97 sbiw r24, 0x0a ; 10 137e4: 09 f4 brne .+2 ; 0x137e8 137e6: f8 c5 rjmp .+3056 ; 0x143d8 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 137e8: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 137ec: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 137f0: 8d 57 subi r24, 0x7D ; 125 137f2: 9f 4e sbci r25, 0xEF ; 239 137f4: 9f 93 push r25 137f6: 8f 93 push r24 137f8: 1f 92 push r1 137fa: 87 e4 ldi r24, 0x47 ; 71 137fc: 8f 93 push r24 137fe: 80 ed ldi r24, 0xD0 ; 208 13800: 9a e6 ldi r25, 0x6A ; 106 13802: 9f 93 push r25 13804: 8f 93 push r24 13806: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1380a: 0f 90 pop r0 1380c: 0f 90 pop r0 1380e: 0f 90 pop r0 13810: 0f 90 pop r0 13812: 0f 90 pop r0 13814: 0f 90 pop r0 13816: a5 c0 rjmp .+330 ; 0x13962 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) 13818: 85 31 cpi r24, 0x15 ; 21 1381a: 91 05 cpc r25, r1 1381c: 09 f4 brne .+2 ; 0x13820 1381e: a1 c0 rjmp .+322 ; 0x13962 13820: 4c 97 sbiw r24, 0x1c ; 28 13822: 11 f7 brne .-60 ; 0x137e8 { 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]); 13824: 88 e5 ldi r24, 0x58 ; 88 13826: 0e 94 0d 5d call 0xba1a ; 0xba1a 1382a: 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; 1382c: 41 2c mov r4, r1 1382e: 51 2c mov r5, r1 13830: 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(); 13832: 88 23 and r24, r24 13834: 21 f0 breq .+8 ; 0x1383e 13836: 0e 94 b9 5c call 0xb972 ; 0xb972 1383a: 2b 01 movw r4, r22 1383c: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 1383e: 89 e5 ldi r24, 0x59 ; 89 13840: 0e 94 0d 5d call 0xba1a ; 0xba1a 13844: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 13846: 88 23 and r24, r24 13848: 09 f4 brne .+2 ; 0x1384c 1384a: cc c5 rjmp .+2968 ; 0x143e4 1384c: 0e 94 b9 5c call 0xb972 ; 0xb972 13850: 6e 96 adiw r28, 0x1e ; 30 13852: 6c af std Y+60, r22 ; 0x3c 13854: 7d af std Y+61, r23 ; 0x3d 13856: 8e af std Y+62, r24 ; 0x3e 13858: 9f af std Y+63, r25 ; 0x3f 1385a: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 1385c: 8a e5 ldi r24, 0x5A ; 90 1385e: 0e 94 0d 5d call 0xba1a ; 0xba1a 13862: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 13864: 81 2c mov r8, r1 13866: 91 2c mov r9, r1 13868: 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(); 1386a: 88 23 and r24, r24 1386c: 21 f0 breq .+8 ; 0x13876 1386e: 0e 94 b9 5c call 0xb972 ; 0xb972 13872: 4b 01 movw r8, r22 13874: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 13876: 87 e5 ldi r24, 0x57 ; 87 13878: 0e 94 0d 5d call 0xba1a ; 0xba1a 1387c: 67 96 adiw r28, 0x17 ; 23 1387e: 8f af std Y+63, r24 ; 0x3f 13880: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13882: 83 e4 ldi r24, 0x43 ; 67 13884: 0e 94 0d 5d call 0xba1a ; 0xba1a gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 13888: 67 96 adiw r28, 0x17 ; 23 1388a: ff ad ldd r31, Y+63 ; 0x3f 1388c: 67 97 sbiw r28, 0x17 ; 23 1388e: ff 93 push r31 13890: 8f 93 push r24 13892: cd 2c mov r12, r13 13894: 6e 96 adiw r28, 0x1e ; 30 13896: ec ac ldd r14, Y+60 ; 0x3c 13898: fd ac ldd r15, Y+61 ; 0x3d 1389a: 0e ad ldd r16, Y+62 ; 0x3e 1389c: 1f ad ldd r17, Y+63 ; 0x3f 1389e: 6e 97 sbiw r28, 0x1e ; 30 138a0: 22 2d mov r18, r2 138a2: b3 01 movw r22, r6 138a4: a2 01 movw r20, r4 138a6: 83 2d mov r24, r3 138a8: 0e 94 43 7f call 0xfe86 ; 0xfe86 #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) { 138ac: 0f 90 pop r0 138ae: 0f 90 pop r0 138b0: 31 10 cpse r3, r1 138b2: 57 c0 rjmp .+174 ; 0x13962 138b4: 21 10 cpse r2, r1 138b6: 55 c0 rjmp .+170 ; 0x13962 138b8: 67 96 adiw r28, 0x17 ; 23 138ba: 2f ad ldd r18, Y+63 ; 0x3f 138bc: 67 97 sbiw r28, 0x17 ; 23 138be: 21 11 cpse r18, r1 138c0: 50 c0 rjmp .+160 ; 0x13962 138c2: d1 10 cpse r13, r1 138c4: 4e c0 rjmp .+156 ; 0x13962 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 138c6: 0e 94 2a 90 call 0x12054 ; 0x12054 138ca: 4b c0 rjmp .+150 ; 0x13962 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) 138cc: 86 35 cpi r24, 0x56 ; 86 138ce: 91 05 cpc r25, r1 138d0: 11 f4 brne .+4 ; 0x138d6 138d2: 0c 94 55 a6 jmp 0x14caa ; 0x14caa 138d6: b4 f5 brge .+108 ; 0x13944 138d8: 8c 34 cpi r24, 0x4C ; 76 138da: 91 05 cpc r25, r1 138dc: 09 f4 brne .+2 ; 0x138e0 138de: df c5 rjmp .+3006 ; 0x1449e 138e0: 3c f5 brge .+78 ; 0x13930 138e2: 08 e2 ldi r16, 0x28 ; 40 138e4: 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)); 138e6: 70 e8 ldi r23, 0x80 ; 128 138e8: e7 2e mov r14, r23 138ea: 7b e6 ldi r23, 0x6B ; 107 138ec: 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) 138ee: 8b 34 cpi r24, 0x4B ; 75 138f0: 91 05 cpc r25, r1 138f2: 09 f0 breq .+2 ; 0x138f6 138f4: 79 cf rjmp .-270 ; 0x137e8 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)); 138f6: 60 2f mov r22, r16 138f8: 70 e0 ldi r23, 0x00 ; 0 138fa: 90 e0 ldi r25, 0x00 ; 0 138fc: 80 e0 ldi r24, 0x00 ; 0 138fe: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 13902: 0e 94 d0 5d call 0xbba0 ; 0xbba0 13906: 9f 93 push r25 13908: 8f 93 push r24 1390a: 7f 93 push r23 1390c: 6f 93 push r22 1390e: 1f 93 push r17 13910: 0f 93 push r16 13912: ff 92 push r15 13914: ef 92 push r14 13916: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1391a: 0f 5f subi r16, 0xFF ; 255 1391c: 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++) 1391e: 0f b6 in r0, 0x3f ; 63 13920: f8 94 cli 13922: de bf out 0x3e, r29 ; 62 13924: 0f be out 0x3f, r0 ; 63 13926: cd bf out 0x3d, r28 ; 61 13928: 0f 36 cpi r16, 0x6F ; 111 1392a: 11 05 cpc r17, r1 1392c: 21 f7 brne .-56 ; 0x138f6 1392e: 19 c0 rjmp .+50 ; 0x13962 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) 13930: 80 35 cpi r24, 0x50 ; 80 13932: 91 05 cpc r25, r1 13934: 41 f2 breq .-112 ; 0x138c6 13936: 81 35 cpi r24, 0x51 ; 81 13938: 91 05 cpc r25, r1 1393a: 09 f0 breq .+2 ; 0x1393e 1393c: 55 cf rjmp .-342 ; 0x137e8 /*! ### 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(); 1393e: 0e 94 77 81 call 0x102ee ; 0x102ee 13942: 0f c0 rjmp .+30 ; 0x13962 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) 13944: 8a 35 cpi r24, 0x5A ; 90 13946: 91 05 cpc r25, r1 13948: 11 f4 brne .+4 ; 0x1394e 1394a: 0c 94 5f a6 jmp 0x14cbe ; 0x14cbe 1394e: 74 f4 brge .+28 ; 0x1396c 13950: 87 35 cpi r24, 0x57 ; 87 13952: 91 05 cpc r25, r1 13954: 11 f4 brne .+4 ; 0x1395a 13956: 0c 94 5a a6 jmp 0x14cb4 ; 0x14cb4 1395a: 88 35 cpi r24, 0x58 ; 88 1395c: 91 05 cpc r25, r1 1395e: 09 f0 breq .+2 ; 0x13962 13960: 43 cf rjmp .-378 ; 0x137e8 #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; 13962: 10 92 92 03 sts 0x0392, r1 ; 0x800392 13966: 10 92 91 03 sts 0x0391, r1 ; 0x800391 1396a: b8 cb rjmp .-2192 ; 0x130dc 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) 1396c: 8b 35 cpi r24, 0x5B ; 91 1396e: 91 05 cpc r25, r1 13970: 11 f4 brne .+4 ; 0x13976 13972: 0c 94 66 a6 jmp 0x14ccc ; 0x14ccc 13976: 8c 35 cpi r24, 0x5C ; 92 13978: 91 05 cpc r25, r1 1397a: 09 f0 breq .+2 ; 0x1397e 1397c: 35 cf rjmp .-406 ; 0x137e8 1397e: fd ed ldi r31, 0xDD ; 221 13980: cf 2e mov r12, r31 13982: f2 e0 ldi r31, 0x02 ; 2 13984: df 2e mov r13, r31 13986: 8e 01 movw r16, r28 13988: 0f 5b subi r16, 0xBF ; 191 1398a: 1f 4f sbci r17, 0xFF ; 255 1398c: 9e 01 movw r18, r28 1398e: 2f 5f subi r18, 0xFF ; 255 13990: 3f 4f sbci r19, 0xFF ; 255 13992: 79 01 movw r14, r18 13994: a1 ee ldi r26, 0xE1 ; 225 13996: 8a 2e mov r8, r26 13998: a2 e0 ldi r26, 0x02 ; 2 1399a: 9a 2e mov r9, r26 1399c: 58 01 movw r10, r16 1399e: 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]); 139a0: d6 01 movw r26, r12 139a2: 8d 91 ld r24, X+ 139a4: 6d 01 movw r12, r26 139a6: 0e 94 0d 5d call 0xba1a ; 0xba1a 139aa: f5 01 movw r30, r10 139ac: 81 93 st Z+, r24 139ae: 5f 01 movw r10, r30 if(codes[i]) 139b0: 88 23 and r24, r24 139b2: 41 f0 breq .+16 ; 0x139c4 values[i] = code_value(); 139b4: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 139b8: d7 01 movw r26, r14 139ba: 6d 93 st X+, r22 139bc: 7d 93 st X+, r23 139be: 8d 93 st X+, r24 139c0: 9c 93 st X, r25 139c2: 13 97 sbiw r26, 0x03 ; 3 139c4: b4 e0 ldi r27, 0x04 ; 4 139c6: eb 0e add r14, r27 139c8: 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) 139ca: 8c 14 cp r8, r12 139cc: 9d 04 cpc r9, r13 139ce: 41 f7 brne .-48 ; 0x139a0 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 139d0: f8 01 movw r30, r16 139d2: d3 80 ldd r13, Z+3 ; 0x03 139d4: dd 20 and r13, r13 139d6: 11 f4 brne .+4 ; 0x139dc 139d8: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 139dc: 20 e0 ldi r18, 0x00 ; 0 139de: 30 e0 ldi r19, 0x00 ; 0 139e0: a9 01 movw r20, r18 139e2: 6d 85 ldd r22, Y+13 ; 0x0d 139e4: 7e 85 ldd r23, Y+14 ; 0x0e 139e6: 8f 85 ldd r24, Y+15 ; 0x0f 139e8: 98 89 ldd r25, Y+16 ; 0x10 139ea: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 139ee: 81 11 cpse r24, r1 139f0: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 139f4: d8 01 movw r26, r16 139f6: 8c 91 ld r24, X 139f8: 81 11 cpse r24, r1 139fa: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 139fe: 11 96 adiw r26, 0x01 ; 1 13a00: 8c 91 ld r24, X 13a02: 11 97 sbiw r26, 0x01 ; 1 13a04: 81 11 cpse r24, r1 13a06: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 13a0a: 12 96 adiw r26, 0x02 ; 2 13a0c: 8c 91 ld r24, X 13a0e: 81 11 cpse r24, r1 13a10: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 { // 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; 13a14: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c 13a18: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d 13a1c: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e 13a20: 10 92 4f 07 sts 0x074F, r1 ; 0x80074f st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 13a24: 81 e0 ldi r24, 0x01 ; 1 13a26: 80 93 b8 04 sts 0x04B8, r24 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.502> 13a2a: 9b cf rjmp .-202 ; 0x13962 #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 13a2c: 2d ec ldi r18, 0xCD ; 205 13a2e: 3c ec ldi r19, 0xCC ; 204 13a30: 4c ec ldi r20, 0xCC ; 204 13a32: 5d e3 ldi r21, 0x3D ; 61 13a34: c7 01 movw r24, r14 13a36: b6 01 movw r22, r12 13a38: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 13a3c: 18 16 cp r1, r24 13a3e: 24 f4 brge .+8 ; 0x13a48 13a40: 80 91 3c 07 lds r24, 0x073C ; 0x80073c 13a44: 81 11 cpse r24, r1 13a46: 92 ce rjmp .-732 ; 0x1376c } } } #endif //FWRETRACT prepare_move(start_segment_idx); 13a48: c8 01 movw r24, r16 13a4a: 0e 94 4e 6d call 0xda9c ; 0xda9c 13a4e: 89 cf rjmp .-238 ; 0x13962 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 13a50: 0e 94 aa 5b call 0xb754 ; 0xb754 13a54: e0 96 adiw r28, 0x30 ; 48 13a56: 9f af std Y+63, r25 ; 0x3f 13a58: 8e af std Y+62, r24 ; 0x3e 13a5a: 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 13a5c: 0e 94 0a 63 call 0xc614 ; 0xc614 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 13a60: 89 e4 ldi r24, 0x49 ; 73 13a62: 0e 94 0d 5d call 0xba1a ; 0xba1a 13a66: 88 23 and r24, r24 13a68: 09 f4 brne .+2 ; 0x13a6c 13a6a: 00 c4 rjmp .+2048 ; 0x1426c 13a6c: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 13a70: 60 93 89 03 sts 0x0389, r22 ; 0x800389 13a74: 70 93 8a 03 sts 0x038A, r23 ; 0x80038a 13a78: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b 13a7c: 90 93 8c 03 sts 0x038C, r25 ; 0x80038c offset[1] = code_seen('J') ? code_value() : 0.f; 13a80: 8a e4 ldi r24, 0x4A ; 74 13a82: 0e 94 0d 5d call 0xba1a ; 0xba1a 13a86: c1 2c mov r12, r1 13a88: d1 2c mov r13, r1 13a8a: 76 01 movw r14, r12 13a8c: 88 23 and r24, r24 13a8e: 21 f0 breq .+8 ; 0x13a98 13a90: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 13a94: 6b 01 movw r12, r22 13a96: 7c 01 movw r14, r24 13a98: c0 92 8d 03 sts 0x038D, r12 ; 0x80038d 13a9c: d0 92 8e 03 sts 0x038E, r13 ; 0x80038e 13aa0: e0 92 8f 03 sts 0x038F, r14 ; 0x80038f 13aa4: f0 92 90 03 sts 0x0390, r15 ; 0x800390 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 13aa8: e0 91 91 03 lds r30, 0x0391 ; 0x800391 13aac: f0 91 92 03 lds r31, 0x0392 ; 0x800392 13ab0: c2 57 subi r28, 0x72 ; 114 13ab2: df 4f sbci r29, 0xFF ; 255 13ab4: f9 83 std Y+1, r31 ; 0x01 13ab6: e8 83 st Y, r30 13ab8: ce 58 subi r28, 0x8E ; 142 13aba: 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 13abc: 80 90 89 03 lds r8, 0x0389 ; 0x800389 13ac0: 90 90 8a 03 lds r9, 0x038A ; 0x80038a 13ac4: a0 90 8b 03 lds r10, 0x038B ; 0x80038b 13ac8: b0 90 8c 03 lds r11, 0x038C ; 0x80038c 13acc: a7 01 movw r20, r14 13ace: 96 01 movw r18, r12 13ad0: c5 01 movw r24, r10 13ad2: b4 01 movw r22, r8 13ad4: 0f 94 d3 e0 call 0x3c1a6 ; 0x3c1a6 13ad8: ae 96 adiw r28, 0x2e ; 46 13ada: 6c af std Y+60, r22 ; 0x3c 13adc: 7d af std Y+61, r23 ; 0x3d 13ade: 8e af std Y+62, r24 ; 0x3e 13ae0: 9f af std Y+63, r25 ; 0x3f 13ae2: 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); 13ae4: 60 91 39 02 lds r22, 0x0239 ; 0x800239 13ae8: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 13aec: 07 2e mov r0, r23 13aee: 00 0c add r0, r0 13af0: 88 0b sbc r24, r24 13af2: 99 0b sbc r25, r25 13af4: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 13af8: 20 91 90 02 lds r18, 0x0290 ; 0x800290 13afc: 30 91 91 02 lds r19, 0x0291 ; 0x800291 13b00: 40 91 92 02 lds r20, 0x0292 ; 0x800292 13b04: 50 91 93 02 lds r21, 0x0293 ; 0x800293 13b08: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13b0c: 2e e3 ldi r18, 0x3E ; 62 13b0e: 33 ec ldi r19, 0xC3 ; 195 13b10: 4e e2 ldi r20, 0x2E ; 46 13b12: 59 e3 ldi r21, 0x39 ; 57 13b14: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13b18: aa 96 adiw r28, 0x2a ; 42 13b1a: 6c af std Y+60, r22 ; 0x3c 13b1c: 7d af std Y+61, r23 ; 0x3d 13b1e: 8e af std Y+62, r24 ; 0x3e 13b20: 9f af std Y+63, r25 ; 0x3f 13b22: 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)); 13b24: 80 e1 ldi r24, 0x10 ; 16 13b26: e0 e4 ldi r30, 0x40 ; 64 13b28: f7 e0 ldi r31, 0x07 ; 7 13b2a: de 01 movw r26, r28 13b2c: 11 96 adiw r26, 0x01 ; 1 13b2e: 01 90 ld r0, Z+ 13b30: 0d 92 st X+, r0 13b32: 8a 95 dec r24 13b34: e1 f7 brne .-8 ; 0x13b2e float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 13b36: a5 01 movw r20, r10 13b38: 94 01 movw r18, r8 13b3a: 50 58 subi r21, 0x80 ; 128 13b3c: 6e 96 adiw r28, 0x1e ; 30 13b3e: 2c af std Y+60, r18 ; 0x3c 13b40: 3d af std Y+61, r19 ; 0x3d 13b42: 4e af std Y+62, r20 ; 0x3e 13b44: 5f af std Y+63, r21 ; 0x3f 13b46: 6e 97 sbiw r28, 0x1e ; 30 float r_axis_y = -offset[Y_AXIS]; 13b48: d7 01 movw r26, r14 13b4a: c6 01 movw r24, r12 13b4c: b0 58 subi r27, 0x80 ; 128 13b4e: 6a 96 adiw r28, 0x1a ; 26 13b50: 8c af std Y+60, r24 ; 0x3c 13b52: 9d af std Y+61, r25 ; 0x3d 13b54: ae af std Y+62, r26 ; 0x3e 13b56: bf af std Y+63, r27 ; 0x3f 13b58: 6a 97 sbiw r28, 0x1a ; 26 float center_axis_x = start_position[X_AXIS] - r_axis_x; 13b5a: 29 81 ldd r18, Y+1 ; 0x01 13b5c: 3a 81 ldd r19, Y+2 ; 0x02 13b5e: 4b 81 ldd r20, Y+3 ; 0x03 13b60: 5c 81 ldd r21, Y+4 ; 0x04 13b62: e6 96 adiw r28, 0x36 ; 54 13b64: 2c af std Y+60, r18 ; 0x3c 13b66: 3d af std Y+61, r19 ; 0x3d 13b68: 4e af std Y+62, r20 ; 0x3e 13b6a: 5f af std Y+63, r21 ; 0x3f 13b6c: e6 97 sbiw r28, 0x36 ; 54 13b6e: c5 01 movw r24, r10 13b70: b4 01 movw r22, r8 13b72: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 13b76: ea 96 adiw r28, 0x3a ; 58 13b78: 6c af std Y+60, r22 ; 0x3c 13b7a: 7d af std Y+61, r23 ; 0x3d 13b7c: 8e af std Y+62, r24 ; 0x3e 13b7e: 9f af std Y+63, r25 ; 0x3f 13b80: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13b82: 8d 81 ldd r24, Y+5 ; 0x05 13b84: 9e 81 ldd r25, Y+6 ; 0x06 13b86: af 81 ldd r26, Y+7 ; 0x07 13b88: b8 85 ldd r27, Y+8 ; 0x08 13b8a: ee 96 adiw r28, 0x3e ; 62 13b8c: 8c af std Y+60, r24 ; 0x3c 13b8e: 9d af std Y+61, r25 ; 0x3d 13b90: ae af std Y+62, r26 ; 0x3e 13b92: bf af std Y+63, r27 ; 0x3f 13b94: ee 97 sbiw r28, 0x3e ; 62 13b96: 9c 01 movw r18, r24 13b98: ad 01 movw r20, r26 13b9a: c7 01 movw r24, r14 13b9c: b6 01 movw r22, r12 13b9e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 13ba2: ce 57 subi r28, 0x7E ; 126 13ba4: df 4f sbci r29, 0xFF ; 255 13ba6: 68 83 st Y, r22 13ba8: 79 83 std Y+1, r23 ; 0x01 13baa: 8a 83 std Y+2, r24 ; 0x02 13bac: 9b 83 std Y+3, r25 ; 0x03 13bae: c2 58 subi r28, 0x82 ; 130 13bb0: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13bb2: 29 85 ldd r18, Y+9 ; 0x09 13bb4: 3a 85 ldd r19, Y+10 ; 0x0a 13bb6: 4b 85 ldd r20, Y+11 ; 0x0b 13bb8: 5c 85 ldd r21, Y+12 ; 0x0c 13bba: 60 91 59 05 lds r22, 0x0559 ; 0x800559 13bbe: 70 91 5a 05 lds r23, 0x055A ; 0x80055a 13bc2: 80 91 5b 05 lds r24, 0x055B ; 0x80055b 13bc6: 90 91 5c 05 lds r25, 0x055C ; 0x80055c 13bca: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 13bce: c2 58 subi r28, 0x82 ; 130 13bd0: df 4f sbci r29, 0xFF ; 255 13bd2: 68 83 st Y, r22 13bd4: 79 83 std Y+1, r23 ; 0x01 13bd6: 8a 83 std Y+2, r24 ; 0x02 13bd8: 9b 83 std Y+3, r25 ; 0x03 13bda: ce 57 subi r28, 0x7E ; 126 13bdc: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 13bde: 20 91 51 05 lds r18, 0x0551 ; 0x800551 13be2: 30 91 52 05 lds r19, 0x0552 ; 0x800552 13be6: 40 91 53 05 lds r20, 0x0553 ; 0x800553 13bea: 50 91 54 05 lds r21, 0x0554 ; 0x800554 13bee: ca 57 subi r28, 0x7A ; 122 13bf0: df 4f sbci r29, 0xFF ; 255 13bf2: 28 83 st Y, r18 13bf4: 39 83 std Y+1, r19 ; 0x01 13bf6: 4a 83 std Y+2, r20 ; 0x02 13bf8: 5b 83 std Y+3, r21 ; 0x03 13bfa: c6 58 subi r28, 0x86 ; 134 13bfc: d0 40 sbci r29, 0x00 ; 0 13bfe: ea 96 adiw r28, 0x3a ; 58 13c00: 2c ad ldd r18, Y+60 ; 0x3c 13c02: 3d ad ldd r19, Y+61 ; 0x3d 13c04: 4e ad ldd r20, Y+62 ; 0x3e 13c06: 5f ad ldd r21, Y+63 ; 0x3f 13c08: ea 97 sbiw r28, 0x3a ; 58 13c0a: ca 57 subi r28, 0x7A ; 122 13c0c: df 4f sbci r29, 0xFF ; 255 13c0e: 68 81 ld r22, Y 13c10: 79 81 ldd r23, Y+1 ; 0x01 13c12: 8a 81 ldd r24, Y+2 ; 0x02 13c14: 9b 81 ldd r25, Y+3 ; 0x03 13c16: c6 58 subi r28, 0x86 ; 134 13c18: d0 40 sbci r29, 0x00 ; 0 13c1a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 13c1e: 6b 01 movw r12, r22 13c20: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 13c22: 80 91 55 05 lds r24, 0x0555 ; 0x800555 13c26: 90 91 56 05 lds r25, 0x0556 ; 0x800556 13c2a: a0 91 57 05 lds r26, 0x0557 ; 0x800557 13c2e: b0 91 58 05 lds r27, 0x0558 ; 0x800558 13c32: c6 57 subi r28, 0x76 ; 118 13c34: df 4f sbci r29, 0xFF ; 255 13c36: 88 83 st Y, r24 13c38: 99 83 std Y+1, r25 ; 0x01 13c3a: aa 83 std Y+2, r26 ; 0x02 13c3c: bb 83 std Y+3, r27 ; 0x03 13c3e: ca 58 subi r28, 0x8A ; 138 13c40: d0 40 sbci r29, 0x00 ; 0 13c42: ce 57 subi r28, 0x7E ; 126 13c44: df 4f sbci r29, 0xFF ; 255 13c46: 28 81 ld r18, Y 13c48: 39 81 ldd r19, Y+1 ; 0x01 13c4a: 4a 81 ldd r20, Y+2 ; 0x02 13c4c: 5b 81 ldd r21, Y+3 ; 0x03 13c4e: c2 58 subi r28, 0x82 ; 130 13c50: d0 40 sbci r29, 0x00 ; 0 13c52: bc 01 movw r22, r24 13c54: cd 01 movw r24, r26 13c56: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 13c5a: 4b 01 movw r8, r22 13c5c: 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; 13c5e: 30 90 2f 07 lds r3, 0x072F ; 0x80072f 13c62: 20 90 30 07 lds r2, 0x0730 ; 0x800730 13c66: 90 91 31 07 lds r25, 0x0731 ; 0x800731 13c6a: 6f 96 adiw r28, 0x1f ; 31 13c6c: 9f af std Y+63, r25 ; 0x3f 13c6e: 6f 97 sbiw r28, 0x1f ; 31 13c70: a0 91 32 07 lds r26, 0x0732 ; 0x800732 13c74: a3 96 adiw r28, 0x23 ; 35 13c76: af af std Y+63, r26 ; 0x3f 13c78: 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); 13c7a: a7 01 movw r20, r14 13c7c: 96 01 movw r18, r12 13c7e: 6e 96 adiw r28, 0x1e ; 30 13c80: 6c ad ldd r22, Y+60 ; 0x3c 13c82: 7d ad ldd r23, Y+61 ; 0x3d 13c84: 8e ad ldd r24, Y+62 ; 0x3e 13c86: 9f ad ldd r25, Y+63 ; 0x3f 13c88: 6e 97 sbiw r28, 0x1e ; 30 13c8a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13c8e: 2b 01 movw r4, r22 13c90: 3c 01 movw r6, r24 13c92: a5 01 movw r20, r10 13c94: 94 01 movw r18, r8 13c96: 6a 96 adiw r28, 0x1a ; 26 13c98: 6c ad ldd r22, Y+60 ; 0x3c 13c9a: 7d ad ldd r23, Y+61 ; 0x3d 13c9c: 8e ad ldd r24, Y+62 ; 0x3e 13c9e: 9f ad ldd r25, Y+63 ; 0x3f 13ca0: 6a 97 sbiw r28, 0x1a ; 26 13ca2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13ca6: 9b 01 movw r18, r22 13ca8: ac 01 movw r20, r24 13caa: c3 01 movw r24, r6 13cac: b2 01 movw r22, r4 13cae: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 13cb2: 2b 01 movw r4, r22 13cb4: 3c 01 movw r6, r24 13cb6: a5 01 movw r20, r10 13cb8: 94 01 movw r18, r8 13cba: 6e 96 adiw r28, 0x1e ; 30 13cbc: 6c ad ldd r22, Y+60 ; 0x3c 13cbe: 7d ad ldd r23, Y+61 ; 0x3d 13cc0: 8e ad ldd r24, Y+62 ; 0x3e 13cc2: 9f ad ldd r25, Y+63 ; 0x3f 13cc4: 6e 97 sbiw r28, 0x1e ; 30 13cc6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13cca: 4b 01 movw r8, r22 13ccc: 5c 01 movw r10, r24 13cce: a7 01 movw r20, r14 13cd0: 96 01 movw r18, r12 13cd2: 6a 96 adiw r28, 0x1a ; 26 13cd4: 6c ad ldd r22, Y+60 ; 0x3c 13cd6: 7d ad ldd r23, Y+61 ; 0x3d 13cd8: 8e ad ldd r24, Y+62 ; 0x3e 13cda: 9f ad ldd r25, Y+63 ; 0x3f 13cdc: 6a 97 sbiw r28, 0x1a ; 26 13cde: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13ce2: 9b 01 movw r18, r22 13ce4: ac 01 movw r20, r24 13ce6: c5 01 movw r24, r10 13ce8: b4 01 movw r22, r8 13cea: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 13cee: a3 01 movw r20, r6 13cf0: 92 01 movw r18, r4 13cf2: 0f 94 b6 de call 0x3bd6c ; 0x3bd6c 13cf6: 6b 01 movw r12, r22 13cf8: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 13cfa: 20 e0 ldi r18, 0x00 ; 0 13cfc: 30 e0 ldi r19, 0x00 ; 0 13cfe: a9 01 movw r20, r18 13d00: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 13d04: 87 ff sbrs r24, 7 13d06: 0a c0 rjmp .+20 ; 0x13d1c 13d08: 2b ed ldi r18, 0xDB ; 219 13d0a: 3f e0 ldi r19, 0x0F ; 15 13d0c: 49 ec ldi r20, 0xC9 ; 201 13d0e: 50 e4 ldi r21, 0x40 ; 64 13d10: c7 01 movw r24, r14 13d12: b6 01 movw r22, r12 13d14: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 13d18: 6b 01 movw r12, r22 13d1a: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 13d1c: 60 91 38 07 lds r22, 0x0738 ; 0x800738 13d20: 70 91 39 07 lds r23, 0x0739 ; 0x800739 13d24: 61 15 cp r22, r1 13d26: 71 05 cpc r23, r1 13d28: 09 f4 brne .+2 ; 0x13d2c 13d2a: a4 c2 rjmp .+1352 ; 0x14274 { // 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); 13d2c: 90 e0 ldi r25, 0x00 ; 0 13d2e: 80 e0 ldi r24, 0x00 ; 0 13d30: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 13d34: 9b 01 movw r18, r22 13d36: ac 01 movw r20, r24 13d38: 6b ed ldi r22, 0xDB ; 219 13d3a: 7f e0 ldi r23, 0x0F ; 15 13d3c: 89 ec ldi r24, 0xC9 ; 201 13d3e: 90 e4 ldi r25, 0x40 ; 64 13d40: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 13d44: ae 96 adiw r28, 0x2e ; 46 13d46: 2c ad ldd r18, Y+60 ; 0x3c 13d48: 3d ad ldd r19, Y+61 ; 0x3d 13d4a: 4e ad ldd r20, Y+62 ; 0x3e 13d4c: 5f ad ldd r21, Y+63 ; 0x3f 13d4e: ae 97 sbiw r28, 0x2e ; 46 13d50: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13d54: 5b 01 movw r10, r22 13d56: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 13d58: 60 91 3a 07 lds r22, 0x073A ; 0x80073a 13d5c: 70 91 3b 07 lds r23, 0x073B ; 0x80073b 13d60: 61 15 cp r22, r1 13d62: 71 05 cpc r23, r1 13d64: f1 f0 breq .+60 ; 0x13da2 { // 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)); 13d66: 90 e0 ldi r25, 0x00 ; 0 13d68: 80 e0 ldi r24, 0x00 ; 0 13d6a: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 13d6e: 20 e0 ldi r18, 0x00 ; 0 13d70: 30 e0 ldi r19, 0x00 ; 0 13d72: 40 e7 ldi r20, 0x70 ; 112 13d74: 52 e4 ldi r21, 0x42 ; 66 13d76: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13d7a: 9b 01 movw r18, r22 13d7c: ac 01 movw r20, r24 13d7e: aa 96 adiw r28, 0x2a ; 42 13d80: 6c ad ldd r22, Y+60 ; 0x3c 13d82: 7d ad ldd r23, Y+61 ; 0x3d 13d84: 8e ad ldd r24, Y+62 ; 0x3e 13d86: 9f ad ldd r25, Y+63 ; 0x3f 13d88: aa 97 sbiw r28, 0x2a ; 42 13d8a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 13d8e: 3b 01 movw r6, r22 13d90: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13d92: 95 01 movw r18, r10 13d94: a8 01 movw r20, r16 13d96: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 13d9a: 87 ff sbrs r24, 7 13d9c: 02 c0 rjmp .+4 ; 0x13da2 mm_per_arc_segment = mm_per_arc_segment_sec; 13d9e: 53 01 movw r10, r6 13da0: 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) 13da2: 40 90 33 07 lds r4, 0x0733 ; 0x800733 13da6: 50 90 34 07 lds r5, 0x0734 ; 0x800734 13daa: 60 90 35 07 lds r6, 0x0735 ; 0x800735 13dae: 70 90 36 07 lds r7, 0x0736 ; 0x800736 13db2: 95 01 movw r18, r10 13db4: a8 01 movw r20, r16 13db6: b2 01 movw r22, r4 13db8: c3 01 movw r24, r6 13dba: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 13dbe: 18 16 cp r1, r24 13dc0: c4 f0 brlt .+48 ; 0x13df2 { // 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) { 13dc2: 95 01 movw r18, r10 13dc4: a8 01 movw r20, r16 13dc6: 63 2d mov r22, r3 13dc8: 72 2d mov r23, r2 13dca: 6f 96 adiw r28, 0x1f ; 31 13dcc: 8f ad ldd r24, Y+63 ; 0x3f 13dce: 6f 97 sbiw r28, 0x1f ; 31 13dd0: a3 96 adiw r28, 0x23 ; 35 13dd2: 9f ad ldd r25, Y+63 ; 0x3f 13dd4: a3 97 sbiw r28, 0x23 ; 35 13dd6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 13dda: 25 01 movw r4, r10 13ddc: 38 01 movw r6, r16 13dde: 87 ff sbrs r24, 7 13de0: 08 c0 rjmp .+16 ; 0x13df2 // 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; 13de2: 43 2c mov r4, r3 13de4: 52 2c mov r5, r2 13de6: 6f 96 adiw r28, 0x1f ; 31 13de8: 6f ac ldd r6, Y+63 ; 0x3f 13dea: 6f 97 sbiw r28, 0x1f ; 31 13dec: a3 96 adiw r28, 0x23 ; 35 13dee: 7f ac ldd r7, Y+63 ; 0x3f 13df0: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 13df2: c2 57 subi r28, 0x72 ; 114 13df4: df 4f sbci r29, 0xFF ; 255 13df6: e8 81 ld r30, Y 13df8: f9 81 ldd r31, Y+1 ; 0x01 13dfa: ce 58 subi r28, 0x8E ; 142 13dfc: d0 40 sbci r29, 0x00 ; 0 13dfe: 32 97 sbiw r30, 0x02 ; 2 13e00: 51 f4 brne .+20 ; 0x13e16 13e02: 2b ed ldi r18, 0xDB ; 219 13e04: 3f e0 ldi r19, 0x0F ; 15 13e06: 49 ec ldi r20, 0xC9 ; 201 13e08: 50 e4 ldi r21, 0x40 ; 64 13e0a: c7 01 movw r24, r14 13e0c: b6 01 movw r22, r12 13e0e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 13e12: 6b 01 movw r12, r22 13e14: 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) 13e16: ca 57 subi r28, 0x7A ; 122 13e18: df 4f sbci r29, 0xFF ; 255 13e1a: 28 81 ld r18, Y 13e1c: 39 81 ldd r19, Y+1 ; 0x01 13e1e: 4a 81 ldd r20, Y+2 ; 0x02 13e20: 5b 81 ldd r21, Y+3 ; 0x03 13e22: c6 58 subi r28, 0x86 ; 134 13e24: d0 40 sbci r29, 0x00 ; 0 13e26: e6 96 adiw r28, 0x36 ; 54 13e28: 6c ad ldd r22, Y+60 ; 0x3c 13e2a: 7d ad ldd r23, Y+61 ; 0x3d 13e2c: 8e ad ldd r24, Y+62 ; 0x3e 13e2e: 9f ad ldd r25, Y+63 ; 0x3f 13e30: e6 97 sbiw r28, 0x36 ; 54 13e32: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 13e36: 81 11 cpse r24, r1 13e38: 25 c0 rjmp .+74 ; 0x13e84 13e3a: c6 57 subi r28, 0x76 ; 118 13e3c: df 4f sbci r29, 0xFF ; 255 13e3e: 28 81 ld r18, Y 13e40: 39 81 ldd r19, Y+1 ; 0x01 13e42: 4a 81 ldd r20, Y+2 ; 0x02 13e44: 5b 81 ldd r21, Y+3 ; 0x03 13e46: ca 58 subi r28, 0x8A ; 138 13e48: d0 40 sbci r29, 0x00 ; 0 13e4a: ee 96 adiw r28, 0x3e ; 62 13e4c: 6c ad ldd r22, Y+60 ; 0x3c 13e4e: 7d ad ldd r23, Y+61 ; 0x3d 13e50: 8e ad ldd r24, Y+62 ; 0x3e 13e52: 9f ad ldd r25, Y+63 ; 0x3f 13e54: ee 97 sbiw r28, 0x3e ; 62 13e56: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 13e5a: 81 11 cpse r24, r1 13e5c: 13 c0 rjmp .+38 ; 0x13e84 13e5e: 20 e0 ldi r18, 0x00 ; 0 13e60: 30 e0 ldi r19, 0x00 ; 0 13e62: a9 01 movw r20, r18 13e64: c7 01 movw r24, r14 13e66: b6 01 movw r22, r12 13e68: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 13e6c: 81 11 cpse r24, r1 13e6e: 0a c0 rjmp .+20 ; 0x13e84 { angular_travel_total += 2 * M_PI; 13e70: 2b ed ldi r18, 0xDB ; 219 13e72: 3f e0 ldi r19, 0x0F ; 15 13e74: 49 ec ldi r20, 0xC9 ; 201 13e76: 50 e4 ldi r21, 0x40 ; 64 13e78: c7 01 movw r24, r14 13e7a: b6 01 movw r22, r12 13e7c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 13e80: 6b 01 movw r12, r22 13e82: 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)); 13e84: a7 01 movw r20, r14 13e86: 96 01 movw r18, r12 13e88: ae 96 adiw r28, 0x2e ; 46 13e8a: 6c ad ldd r22, Y+60 ; 0x3c 13e8c: 7d ad ldd r23, Y+61 ; 0x3d 13e8e: 8e ad ldd r24, Y+62 ; 0x3e 13e90: 9f ad ldd r25, Y+63 ; 0x3f 13e92: ae 97 sbiw r28, 0x2e ; 46 13e94: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13e98: c2 58 subi r28, 0x82 ; 130 13e9a: df 4f sbci r29, 0xFF ; 255 13e9c: 28 81 ld r18, Y 13e9e: 39 81 ldd r19, Y+1 ; 0x01 13ea0: 4a 81 ldd r20, Y+2 ; 0x02 13ea2: 5b 81 ldd r21, Y+3 ; 0x03 13ea4: ce 57 subi r28, 0x7E ; 126 13ea6: d0 40 sbci r29, 0x00 ; 0 13ea8: 0f 94 d3 e0 call 0x3c1a6 ; 0x3c1a6 13eac: 4b 01 movw r8, r22 13eae: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13eb0: 2f e6 ldi r18, 0x6F ; 111 13eb2: 32 e1 ldi r19, 0x12 ; 18 13eb4: 43 e8 ldi r20, 0x83 ; 131 13eb6: 5a e3 ldi r21, 0x3A ; 58 13eb8: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 13ebc: 87 fd sbrc r24, 7 13ebe: cf c1 rjmp .+926 ; 0x1425e // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13ec0: 92 01 movw r18, r4 13ec2: a3 01 movw r20, r6 13ec4: c5 01 movw r24, r10 13ec6: b4 01 movw r22, r8 13ec8: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 13ecc: 0f 94 15 df call 0x3be2a ; 0x3be2a 13ed0: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 13ed4: a4 96 adiw r28, 0x24 ; 36 13ed6: 7f af std Y+63, r23 ; 0x3f 13ed8: 6e af std Y+62, r22 ; 0x3e 13eda: 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) 13edc: 62 30 cpi r22, 0x02 ; 2 13ede: 71 05 cpc r23, r1 13ee0: 08 f4 brcc .+2 ; 0x13ee4 13ee2: 8b c1 rjmp .+790 ; 0x141fa 13ee4: e0 96 adiw r28, 0x30 ; 48 13ee6: 4e ad ldd r20, Y+62 ; 0x3e 13ee8: 5f ad ldd r21, Y+63 ; 0x3f 13eea: e0 97 sbiw r28, 0x30 ; 48 13eec: 45 2b or r20, r21 13eee: 09 f4 brne .+2 ; 0x13ef2 13ef0: 84 c1 rjmp .+776 ; 0x141fa 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; 13ef2: 50 91 37 07 lds r21, 0x0737 ; 0x800737 13ef6: 6f 96 adiw r28, 0x1f ; 31 13ef8: 5f af std Y+63, r21 ; 0x3f 13efa: 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, 13efc: 90 e0 ldi r25, 0x00 ; 0 13efe: 80 e0 ldi r24, 0x00 ; 0 13f00: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 13f04: 4b 01 movw r8, r22 13f06: 5c 01 movw r10, r24 13f08: ac 01 movw r20, r24 13f0a: 9b 01 movw r18, r22 13f0c: c7 01 movw r24, r14 13f0e: b6 01 movw r22, r12 13f10: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 13f14: 2b 01 movw r4, r22 13f16: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 13f18: a5 01 movw r20, r10 13f1a: 94 01 movw r18, r8 13f1c: c2 58 subi r28, 0x82 ; 130 13f1e: df 4f sbci r29, 0xFF ; 255 13f20: 68 81 ld r22, Y 13f22: 79 81 ldd r23, Y+1 ; 0x01 13f24: 8a 81 ldd r24, Y+2 ; 0x02 13f26: 9b 81 ldd r25, Y+3 ; 0x03 13f28: ce 57 subi r28, 0x7E ; 126 13f2a: d0 40 sbci r29, 0x00 ; 0 13f2c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 13f30: ee 96 adiw r28, 0x3e ; 62 13f32: 6c af std Y+60, r22 ; 0x3c 13f34: 7d af std Y+61, r23 ; 0x3d 13f36: 8e af std Y+62, r24 ; 0x3e 13f38: 9f af std Y+63, r25 ; 0x3f 13f3a: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 13f3c: 2d 85 ldd r18, Y+13 ; 0x0d 13f3e: 3e 85 ldd r19, Y+14 ; 0x0e 13f40: 4f 85 ldd r20, Y+15 ; 0x0f 13f42: 58 89 ldd r21, Y+16 ; 0x10 13f44: 60 91 5d 05 lds r22, 0x055D ; 0x80055d 13f48: 70 91 5e 05 lds r23, 0x055E ; 0x80055e 13f4c: 80 91 5f 05 lds r24, 0x055F ; 0x80055f 13f50: 90 91 60 05 lds r25, 0x0560 ; 0x800560 13f54: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 13f58: a5 01 movw r20, r10 13f5a: 94 01 movw r18, r8 13f5c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 13f60: c2 58 subi r28, 0x82 ; 130 13f62: df 4f sbci r29, 0xFF ; 255 13f64: 68 83 st Y, r22 13f66: 79 83 std Y+1, r23 ; 0x01 13f68: 8a 83 std Y+2, r24 ; 0x02 13f6a: 9b 83 std Y+3, r25 ; 0x03 13f6c: ce 57 subi r28, 0x7E ; 126 13f6e: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13f70: a3 01 movw r20, r6 13f72: 92 01 movw r18, r4 13f74: c3 01 movw r24, r6 13f76: b2 01 movw r22, r4 13f78: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13f7c: 6b 01 movw r12, r22 13f7e: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13f80: ac 01 movw r20, r24 13f82: 9b 01 movw r18, r22 13f84: c3 01 movw r24, r6 13f86: b2 01 movw r22, r4 13f88: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13f8c: 20 e0 ldi r18, 0x00 ; 0 13f8e: 30 e0 ldi r19, 0x00 ; 0 13f90: 40 ec ldi r20, 0xC0 ; 192 13f92: 50 e4 ldi r21, 0x40 ; 64 13f94: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 13f98: 9b 01 movw r18, r22 13f9a: ac 01 movw r20, r24 13f9c: c3 01 movw r24, r6 13f9e: b2 01 movw r22, r4 13fa0: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 13fa4: ae 96 adiw r28, 0x2e ; 46 13fa6: 6c af std Y+60, r22 ; 0x3c 13fa8: 7d af std Y+61, r23 ; 0x3d 13faa: 8e af std Y+62, r24 ; 0x3e 13fac: 9f af std Y+63, r25 ; 0x3f 13fae: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13fb0: 20 e0 ldi r18, 0x00 ; 0 13fb2: 30 e0 ldi r19, 0x00 ; 0 13fb4: 40 e0 ldi r20, 0x00 ; 0 13fb6: 5f e3 ldi r21, 0x3F ; 63 13fb8: c7 01 movw r24, r14 13fba: b6 01 movw r22, r12 13fbc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13fc0: 9b 01 movw r18, r22 13fc2: ac 01 movw r20, r24 13fc4: 60 e0 ldi r22, 0x00 ; 0 13fc6: 70 e0 ldi r23, 0x00 ; 0 13fc8: 80 e8 ldi r24, 0x80 ; 128 13fca: 9f e3 ldi r25, 0x3F ; 63 13fcc: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 13fd0: e6 96 adiw r28, 0x36 ; 54 13fd2: 6c af std Y+60, r22 ; 0x3c 13fd4: 7d af std Y+61, r23 ; 0x3d 13fd6: 8e af std Y+62, r24 ; 0x3e 13fd8: 9f af std Y+63, r25 ; 0x3f 13fda: 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++) { 13fdc: 22 24 eor r2, r2 13fde: 23 94 inc r2 13fe0: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13fe2: 6f 96 adiw r28, 0x1f ; 31 13fe4: 8f ad ldd r24, Y+63 ; 0x3f 13fe6: 6f 97 sbiw r28, 0x1f ; 31 13fe8: 81 11 cpse r24, r1 13fea: 4d c1 rjmp .+666 ; 0x14286 // 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); 13fec: b1 01 movw r22, r2 13fee: 90 e0 ldi r25, 0x00 ; 0 13ff0: 80 e0 ldi r24, 0x00 ; 0 13ff2: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 13ff6: a3 01 movw r20, r6 13ff8: 92 01 movw r18, r4 13ffa: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 13ffe: 6b 01 movw r12, r22 14000: 7c 01 movw r14, r24 14002: 0f 94 31 df call 0x3be62 ; 0x3be62 14006: 6a 96 adiw r28, 0x1a ; 26 14008: 6c af std Y+60, r22 ; 0x3c 1400a: 7d af std Y+61, r23 ; 0x3d 1400c: 8e af std Y+62, r24 ; 0x3e 1400e: 9f af std Y+63, r25 ; 0x3f 14010: 6a 97 sbiw r28, 0x1a ; 26 14012: c7 01 movw r24, r14 14014: b6 01 movw r22, r12 14016: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 1401a: 4b 01 movw r8, r22 1401c: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 1401e: c0 90 89 03 lds r12, 0x0389 ; 0x800389 14022: d0 90 8a 03 lds r13, 0x038A ; 0x80038a 14026: e0 90 8b 03 lds r14, 0x038B ; 0x80038b 1402a: f0 90 8c 03 lds r15, 0x038C ; 0x80038c 1402e: f7 fa bst r15, 7 14030: f0 94 com r15 14032: f7 f8 bld r15, 7 14034: f0 94 com r15 14036: 20 91 8d 03 lds r18, 0x038D ; 0x80038d 1403a: 30 91 8e 03 lds r19, 0x038E ; 0x80038e 1403e: 40 91 8f 03 lds r20, 0x038F ; 0x80038f 14042: 50 91 90 03 lds r21, 0x0390 ; 0x800390 14046: a2 96 adiw r28, 0x22 ; 34 14048: 2c af std Y+60, r18 ; 0x3c 1404a: 3d af std Y+61, r19 ; 0x3d 1404c: 4e af std Y+62, r20 ; 0x3e 1404e: 5f af std Y+63, r21 ; 0x3f 14050: a2 97 sbiw r28, 0x22 ; 34 14052: a7 01 movw r20, r14 14054: 96 01 movw r18, r12 14056: 6a 96 adiw r28, 0x1a ; 26 14058: 6c ad ldd r22, Y+60 ; 0x3c 1405a: 7d ad ldd r23, Y+61 ; 0x3d 1405c: 8e ad ldd r24, Y+62 ; 0x3e 1405e: 9f ad ldd r25, Y+63 ; 0x3f 14060: 6a 97 sbiw r28, 0x1a ; 26 14062: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 14066: 6e 96 adiw r28, 0x1e ; 30 14068: 6c af std Y+60, r22 ; 0x3c 1406a: 7d af std Y+61, r23 ; 0x3d 1406c: 8e af std Y+62, r24 ; 0x3e 1406e: 9f af std Y+63, r25 ; 0x3f 14070: 6e 97 sbiw r28, 0x1e ; 30 14072: a2 96 adiw r28, 0x22 ; 34 14074: 2c ad ldd r18, Y+60 ; 0x3c 14076: 3d ad ldd r19, Y+61 ; 0x3d 14078: 4e ad ldd r20, Y+62 ; 0x3e 1407a: 5f ad ldd r21, Y+63 ; 0x3f 1407c: a2 97 sbiw r28, 0x22 ; 34 1407e: c5 01 movw r24, r10 14080: b4 01 movw r22, r8 14082: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 14086: 9b 01 movw r18, r22 14088: ac 01 movw r20, r24 1408a: 6e 96 adiw r28, 0x1e ; 30 1408c: 6c ad ldd r22, Y+60 ; 0x3c 1408e: 7d ad ldd r23, Y+61 ; 0x3d 14090: 8e ad ldd r24, Y+62 ; 0x3e 14092: 9f ad ldd r25, Y+63 ; 0x3f 14094: 6e 97 sbiw r28, 0x1e ; 30 14096: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1409a: 6e 96 adiw r28, 0x1e ; 30 1409c: 6c af std Y+60, r22 ; 0x3c 1409e: 7d af std Y+61, r23 ; 0x3d 140a0: 8e af std Y+62, r24 ; 0x3e 140a2: 9f af std Y+63, r25 ; 0x3f 140a4: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 140a6: a7 01 movw r20, r14 140a8: 96 01 movw r18, r12 140aa: c5 01 movw r24, r10 140ac: b4 01 movw r22, r8 140ae: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 140b2: 6b 01 movw r12, r22 140b4: 7c 01 movw r14, r24 140b6: a2 96 adiw r28, 0x22 ; 34 140b8: 2c ad ldd r18, Y+60 ; 0x3c 140ba: 3d ad ldd r19, Y+61 ; 0x3d 140bc: 4e ad ldd r20, Y+62 ; 0x3e 140be: 5f ad ldd r21, Y+63 ; 0x3f 140c0: a2 97 sbiw r28, 0x22 ; 34 140c2: 6a 96 adiw r28, 0x1a ; 26 140c4: 6c ad ldd r22, Y+60 ; 0x3c 140c6: 7d ad ldd r23, Y+61 ; 0x3d 140c8: 8e ad ldd r24, Y+62 ; 0x3e 140ca: 9f ad ldd r25, Y+63 ; 0x3f 140cc: 6a 97 sbiw r28, 0x1a ; 26 140ce: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 140d2: 9b 01 movw r18, r22 140d4: ac 01 movw r20, r24 140d6: c7 01 movw r24, r14 140d8: b6 01 movw r22, r12 140da: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 140de: 6a 96 adiw r28, 0x1a ; 26 140e0: 6c af std Y+60, r22 ; 0x3c 140e2: 7d af std Y+61, r23 ; 0x3d 140e4: 8e af std Y+62, r24 ; 0x3e 140e6: 9f af std Y+63, r25 ; 0x3f 140e8: 6a 97 sbiw r28, 0x1a ; 26 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 140ea: 30 91 37 07 lds r19, 0x0737 ; 0x800737 140ee: 6f 96 adiw r28, 0x1f ; 31 140f0: 3f af std Y+63, r19 ; 0x3f 140f2: 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; 140f4: 6e 96 adiw r28, 0x1e ; 30 140f6: 2c ad ldd r18, Y+60 ; 0x3c 140f8: 3d ad ldd r19, Y+61 ; 0x3d 140fa: 4e ad ldd r20, Y+62 ; 0x3e 140fc: 5f ad ldd r21, Y+63 ; 0x3f 140fe: 6e 97 sbiw r28, 0x1e ; 30 14100: ea 96 adiw r28, 0x3a ; 58 14102: 6c ad ldd r22, Y+60 ; 0x3c 14104: 7d ad ldd r23, Y+61 ; 0x3d 14106: 8e ad ldd r24, Y+62 ; 0x3e 14108: 9f ad ldd r25, Y+63 ; 0x3f 1410a: ea 97 sbiw r28, 0x3a ; 58 1410c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 14110: 69 83 std Y+1, r22 ; 0x01 14112: 7a 83 std Y+2, r23 ; 0x02 14114: 8b 83 std Y+3, r24 ; 0x03 14116: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 14118: 6a 96 adiw r28, 0x1a ; 26 1411a: 2c ad ldd r18, Y+60 ; 0x3c 1411c: 3d ad ldd r19, Y+61 ; 0x3d 1411e: 4e ad ldd r20, Y+62 ; 0x3e 14120: 5f ad ldd r21, Y+63 ; 0x3f 14122: 6a 97 sbiw r28, 0x1a ; 26 14124: ce 57 subi r28, 0x7E ; 126 14126: df 4f sbci r29, 0xFF ; 255 14128: 68 81 ld r22, Y 1412a: 79 81 ldd r23, Y+1 ; 0x01 1412c: 8a 81 ldd r24, Y+2 ; 0x02 1412e: 9b 81 ldd r25, Y+3 ; 0x03 14130: c2 58 subi r28, 0x82 ; 130 14132: d0 40 sbci r29, 0x00 ; 0 14134: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 14138: 6d 83 std Y+5, r22 ; 0x05 1413a: 7e 83 std Y+6, r23 ; 0x06 1413c: 8f 83 std Y+7, r24 ; 0x07 1413e: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 14140: ee 96 adiw r28, 0x3e ; 62 14142: 2c ad ldd r18, Y+60 ; 0x3c 14144: 3d ad ldd r19, Y+61 ; 0x3d 14146: 4e ad ldd r20, Y+62 ; 0x3e 14148: 5f ad ldd r21, Y+63 ; 0x3f 1414a: ee 97 sbiw r28, 0x3e ; 62 1414c: 69 85 ldd r22, Y+9 ; 0x09 1414e: 7a 85 ldd r23, Y+10 ; 0x0a 14150: 8b 85 ldd r24, Y+11 ; 0x0b 14152: 9c 85 ldd r25, Y+12 ; 0x0c 14154: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 14158: 69 87 std Y+9, r22 ; 0x09 1415a: 7a 87 std Y+10, r23 ; 0x0a 1415c: 8b 87 std Y+11, r24 ; 0x0b 1415e: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 14160: c2 58 subi r28, 0x82 ; 130 14162: df 4f sbci r29, 0xFF ; 255 14164: 28 81 ld r18, Y 14166: 39 81 ldd r19, Y+1 ; 0x01 14168: 4a 81 ldd r20, Y+2 ; 0x02 1416a: 5b 81 ldd r21, Y+3 ; 0x03 1416c: ce 57 subi r28, 0x7E ; 126 1416e: d0 40 sbci r29, 0x00 ; 0 14170: 6d 85 ldd r22, Y+13 ; 0x0d 14172: 7e 85 ldd r23, Y+14 ; 0x0e 14174: 8f 85 ldd r24, Y+15 ; 0x0f 14176: 98 89 ldd r25, Y+16 ; 0x10 14178: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1417c: 6d 87 std Y+13, r22 ; 0x0d 1417e: 7e 87 std Y+14, r23 ; 0x0e 14180: 8f 87 std Y+15, r24 ; 0x0f 14182: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 14184: ce 01 movw r24, r28 14186: 01 96 adiw r24, 0x01 ; 1 14188: 0e 94 0f 6d call 0xda1e ; 0xda1e // Insert the segment into the buffer if (i >= start_segment_idx) 1418c: e0 96 adiw r28, 0x30 ; 48 1418e: 8e ad ldd r24, Y+62 ; 0x3e 14190: 9f ad ldd r25, Y+63 ; 0x3f 14192: e0 97 sbiw r28, 0x30 ; 48 14194: 28 16 cp r2, r24 14196: 39 06 cpc r3, r25 14198: 08 f1 brcs .+66 ; 0x141dc plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 1419a: e9 84 ldd r14, Y+9 ; 0x09 1419c: fa 84 ldd r15, Y+10 ; 0x0a 1419e: 0b 85 ldd r16, Y+11 ; 0x0b 141a0: 1c 85 ldd r17, Y+12 ; 0x0c 141a2: 2d 81 ldd r18, Y+5 ; 0x05 141a4: 3e 81 ldd r19, Y+6 ; 0x06 141a6: 4f 81 ldd r20, Y+7 ; 0x07 141a8: 58 85 ldd r21, Y+8 ; 0x08 141aa: 69 81 ldd r22, Y+1 ; 0x01 141ac: 7a 81 ldd r23, Y+2 ; 0x02 141ae: 8b 81 ldd r24, Y+3 ; 0x03 141b0: 9c 81 ldd r25, Y+4 ; 0x04 141b2: 3f 92 push r3 141b4: 2f 92 push r2 141b6: a0 e4 ldi r26, 0x40 ; 64 141b8: b7 e0 ldi r27, 0x07 ; 7 141ba: bf 93 push r27 141bc: af 93 push r26 141be: aa 96 adiw r28, 0x2a ; 42 141c0: 8c ac ldd r8, Y+60 ; 0x3c 141c2: 9d ac ldd r9, Y+61 ; 0x3d 141c4: ae ac ldd r10, Y+62 ; 0x3e 141c6: bf ac ldd r11, Y+63 ; 0x3f 141c8: aa 97 sbiw r28, 0x2a ; 42 141ca: de 01 movw r26, r28 141cc: 1d 96 adiw r26, 0x0d ; 13 141ce: 6d 01 movw r12, r26 141d0: 0f 94 bc aa call 0x35578 ; 0x35578 141d4: 0f 90 pop r0 141d6: 0f 90 pop r0 141d8: 0f 90 pop r0 141da: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 141dc: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 141e0: 81 11 cpse r24, r1 141e2: 3d c0 rjmp .+122 ; 0x1425e 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++) { 141e4: bf ef ldi r27, 0xFF ; 255 141e6: 2b 1a sub r2, r27 141e8: 3b 0a sbc r3, r27 141ea: a4 96 adiw r28, 0x24 ; 36 141ec: ee ad ldd r30, Y+62 ; 0x3e 141ee: ff ad ldd r31, Y+63 ; 0x3f 141f0: a4 97 sbiw r28, 0x24 ; 36 141f2: e2 15 cp r30, r2 141f4: f3 05 cpc r31, r3 141f6: 09 f0 breq .+2 ; 0x141fa 141f8: f4 ce rjmp .-536 ; 0x13fe2 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 141fa: 81 e5 ldi r24, 0x51 ; 81 141fc: 95 e0 ldi r25, 0x05 ; 5 141fe: 0e 94 0f 6d call 0xda1e ; 0xda1e // 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); 14202: e0 90 59 05 lds r14, 0x0559 ; 0x800559 14206: f0 90 5a 05 lds r15, 0x055A ; 0x80055a 1420a: 00 91 5b 05 lds r16, 0x055B ; 0x80055b 1420e: 10 91 5c 05 lds r17, 0x055C ; 0x80055c 14212: 20 91 55 05 lds r18, 0x0555 ; 0x800555 14216: 30 91 56 05 lds r19, 0x0556 ; 0x800556 1421a: 40 91 57 05 lds r20, 0x0557 ; 0x800557 1421e: 50 91 58 05 lds r21, 0x0558 ; 0x800558 14222: 60 91 51 05 lds r22, 0x0551 ; 0x800551 14226: 70 91 52 05 lds r23, 0x0552 ; 0x800552 1422a: 80 91 53 05 lds r24, 0x0553 ; 0x800553 1422e: 90 91 54 05 lds r25, 0x0554 ; 0x800554 14232: 1f 92 push r1 14234: 1f 92 push r1 14236: e0 e4 ldi r30, 0x40 ; 64 14238: f7 e0 ldi r31, 0x07 ; 7 1423a: ff 93 push r31 1423c: ef 93 push r30 1423e: aa 96 adiw r28, 0x2a ; 42 14240: 8c ac ldd r8, Y+60 ; 0x3c 14242: 9d ac ldd r9, Y+61 ; 0x3d 14244: ae ac ldd r10, Y+62 ; 0x3e 14246: bf ac ldd r11, Y+63 ; 0x3f 14248: aa 97 sbiw r28, 0x2a ; 42 1424a: ed e5 ldi r30, 0x5D ; 93 1424c: ce 2e mov r12, r30 1424e: e5 e0 ldi r30, 0x05 ; 5 14250: de 2e mov r13, r30 14252: 0f 94 bc aa call 0x35578 ; 0x35578 14256: 0f 90 pop r0 14258: 0f 90 pop r0 1425a: 0f 90 pop r0 1425c: 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(); 1425e: 0e 94 36 5c call 0xb86c ; 0xb86c previous_millis_cmd.start(); 14262: 84 e8 ldi r24, 0x84 ; 132 14264: 93 e0 ldi r25, 0x03 ; 3 14266: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> 1426a: 7b cb rjmp .-2314 ; 0x13962 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; 1426c: 60 e0 ldi r22, 0x00 ; 0 1426e: 70 e0 ldi r23, 0x00 ; 0 14270: cb 01 movw r24, r22 14272: fe cb rjmp .-2052 ; 0x13a70 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; 14274: a3 2c mov r10, r3 14276: b2 2c mov r11, r2 14278: 6f 96 adiw r28, 0x1f ; 31 1427a: 0f ad ldd r16, Y+63 ; 0x3f 1427c: 6f 97 sbiw r28, 0x1f ; 31 1427e: a3 96 adiw r28, 0x23 ; 35 14280: 1f ad ldd r17, Y+63 ; 0x3f 14282: a3 97 sbiw r28, 0x23 ; 35 14284: 69 cd rjmp .-1326 ; 0x13d58 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) { 14286: 6f 96 adiw r28, 0x1f ; 31 14288: 4f ad ldd r20, Y+63 ; 0x3f 1428a: 6f 97 sbiw r28, 0x1f ; 31 1428c: 41 50 subi r20, 0x01 ; 1 1428e: 6f 96 adiw r28, 0x1f ; 31 14290: 4f af std Y+63, r20 ; 0x3f 14292: 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; 14294: ae 96 adiw r28, 0x2e ; 46 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: ae 97 sbiw r28, 0x2e ; 46 142a0: 6e 96 adiw r28, 0x1e ; 30 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: 6e 97 sbiw r28, 0x1e ; 30 142ac: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 142b0: 6b 01 movw r12, r22 142b2: 7c 01 movw r14, r24 142b4: e6 96 adiw r28, 0x36 ; 54 142b6: 2c ad ldd r18, Y+60 ; 0x3c 142b8: 3d ad ldd r19, Y+61 ; 0x3d 142ba: 4e ad ldd r20, Y+62 ; 0x3e 142bc: 5f ad ldd r21, Y+63 ; 0x3f 142be: e6 97 sbiw r28, 0x36 ; 54 142c0: 6a 96 adiw r28, 0x1a ; 26 142c2: 6c ad ldd r22, Y+60 ; 0x3c 142c4: 7d ad ldd r23, Y+61 ; 0x3d 142c6: 8e ad ldd r24, Y+62 ; 0x3e 142c8: 9f ad ldd r25, Y+63 ; 0x3f 142ca: 6a 97 sbiw r28, 0x1a ; 26 142cc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 142d0: 9b 01 movw r18, r22 142d2: ac 01 movw r20, r24 142d4: c7 01 movw r24, r14 142d6: b6 01 movw r22, r12 142d8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 142dc: 7b 01 movw r14, r22 142de: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 142e0: e6 96 adiw r28, 0x36 ; 54 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: e6 97 sbiw r28, 0x36 ; 54 142ec: 6e 96 adiw r28, 0x1e ; 30 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: 6e 97 sbiw r28, 0x1e ; 30 142f8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 142fc: 4b 01 movw r8, r22 142fe: 5c 01 movw r10, r24 14300: ae 96 adiw r28, 0x2e ; 46 14302: 2c ad ldd r18, Y+60 ; 0x3c 14304: 3d ad ldd r19, Y+61 ; 0x3d 14306: 4e ad ldd r20, Y+62 ; 0x3e 14308: 5f ad ldd r21, Y+63 ; 0x3f 1430a: ae 97 sbiw r28, 0x2e ; 46 1430c: 6a 96 adiw r28, 0x1a ; 26 1430e: 6c ad ldd r22, Y+60 ; 0x3c 14310: 7d ad ldd r23, Y+61 ; 0x3d 14312: 8e ad ldd r24, Y+62 ; 0x3e 14314: 9f ad ldd r25, Y+63 ; 0x3f 14316: 6a 97 sbiw r28, 0x1a ; 26 14318: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1431c: 9b 01 movw r18, r22 1431e: ac 01 movw r20, r24 14320: c5 01 movw r24, r10 14322: b4 01 movw r22, r8 14324: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 14328: 6e 96 adiw r28, 0x1e ; 30 1432a: 6c af std Y+60, r22 ; 0x3c 1432c: 7d af std Y+61, r23 ; 0x3d 1432e: 8e af std Y+62, r24 ; 0x3e 14330: 9f af std Y+63, r25 ; 0x3f 14332: 6e 97 sbiw r28, 0x1e ; 30 r_axis_y = r_axisi; 14334: c7 01 movw r24, r14 14336: d8 01 movw r26, r16 14338: 6a 96 adiw r28, 0x1a ; 26 1433a: 8c af std Y+60, r24 ; 0x3c 1433c: 9d af std Y+61, r25 ; 0x3d 1433e: ae af std Y+62, r26 ; 0x3e 14340: bf af std Y+63, r27 ; 0x3f 14342: 6a 97 sbiw r28, 0x1a ; 26 14344: d7 ce rjmp .-594 ; 0x140f4 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14346: 80 e5 ldi r24, 0x50 ; 80 14348: 0e 94 0d 5d call 0xba1a ; 0xba1a - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 1434c: c1 2c mov r12, r1 1434e: d1 2c mov r13, r1 14350: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14352: 88 23 and r24, r24 14354: 31 f0 breq .+12 ; 0x14362 14356: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1435a: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 1435e: 6b 01 movw r12, r22 14360: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 14362: 83 e5 ldi r24, 0x53 ; 83 14364: 0e 94 0d 5d call 0xba1a ; 0xba1a 14368: 88 23 and r24, r24 1436a: 61 f0 breq .+24 ; 0x14384 1436c: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 14370: 20 e0 ldi r18, 0x00 ; 0 14372: 30 e0 ldi r19, 0x00 ; 0 14374: 4a e7 ldi r20, 0x7A ; 122 14376: 54 e4 ldi r21, 0x44 ; 68 14378: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1437c: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 14380: 6b 01 movw r12, r22 14382: 7c 01 movw r14, r24 if(codenum != 0) 14384: c1 14 cp r12, r1 14386: d1 04 cpc r13, r1 14388: e1 04 cpc r14, r1 1438a: f1 04 cpc r15, r1 1438c: 41 f0 breq .+16 ; 0x1439e { if(custom_message_type != CustomMsg::M117) 1438e: 80 91 72 07 lds r24, 0x0772 ; 0x800772 14392: 87 30 cpi r24, 0x07 ; 7 14394: 21 f0 breq .+8 ; 0x1439e { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 14396: 85 ea ldi r24, 0xA5 ; 165 14398: 9b e6 ldi r25, 0x6B ; 107 1439a: 0f 94 e0 0a call 0x215c0 ; 0x215c0 } } st_synchronize(); 1439e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 codenum += _millis(); // keep track of when we started waiting 143a2: 0f 94 55 3e call 0x27caa ; 0x27caa 143a6: c6 0e add r12, r22 143a8: d7 1e adc r13, r23 143aa: e8 1e adc r14, r24 143ac: f9 1e adc r15, r25 previous_millis_cmd.start(); 143ae: 84 e8 ldi r24, 0x84 ; 132 143b0: 93 e0 ldi r25, 0x03 ; 3 143b2: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> while(_millis() < codenum) { 143b6: 0f 94 55 3e call 0x27caa ; 0x27caa 143ba: 6c 15 cp r22, r12 143bc: 7d 05 cpc r23, r13 143be: 8e 05 cpc r24, r14 143c0: 9f 05 cpc r25, r15 143c2: 08 f0 brcs .+2 ; 0x143c6 143c4: ce ca rjmp .-2660 ; 0x13962 manage_heater(); 143c6: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(); 143ca: 80 e0 ldi r24, 0x00 ; 0 143cc: 0e 94 6b 8c call 0x118d6 ; 0x118d6 lcd_update(0); 143d0: 80 e0 ldi r24, 0x00 ; 0 143d2: 0e 94 ed 6f call 0xdfda ; 0xdfda 143d6: ef cf rjmp .-34 ; 0x143b6 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); 143d8: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 143da: 0f 94 78 89 call 0x312f0 ; 0x312f0 143de: c1 ca rjmp .-2686 ; 0x13962 143e0: 80 e0 ldi r24, 0x00 ; 0 143e2: fb cf rjmp .-10 ; 0x143da - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 143e4: 6e 96 adiw r28, 0x1e ; 30 143e6: 1c ae std Y+60, r1 ; 0x3c 143e8: 1d ae std Y+61, r1 ; 0x3d 143ea: 1e ae std Y+62, r1 ; 0x3e 143ec: 1f ae std Y+63, r1 ; 0x3f 143ee: 6e 97 sbiw r28, 0x1e ; 30 143f0: 35 ca rjmp .-2966 ; 0x1385c Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 143f2: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 homing_flag = true; 143f6: 81 e0 ldi r24, 0x01 ; 1 143f8: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 143fc: 0e 94 2e 68 call 0xd05c ; 0xd05c 14400: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 14402: 80 e0 ldi r24, 0x00 ; 0 14404: 90 e0 ldi r25, 0x00 ; 0 14406: a8 e4 ldi r26, 0x48 ; 72 14408: b4 e4 ldi r27, 0x44 ; 68 1440a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 1440e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 14412: a0 93 92 02 sts 0x0292, r26 ; 0x800292 14416: b0 93 93 02 sts 0x0293, r27 ; 0x800293 find_bed_induction_sensor_point_z(-10.f, 3); 1441a: 43 e0 ldi r20, 0x03 ; 3 1441c: 60 e0 ldi r22, 0x00 ; 0 1441e: 70 e0 ldi r23, 0x00 ; 0 14420: 80 e2 ldi r24, 0x20 ; 32 14422: 91 ec ldi r25, 0xC1 ; 193 14424: 0f 94 a7 8b call 0x3174e ; 0x3174e printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 14428: 70 90 48 07 lds r7, 0x0748 ; 0x800748 1442c: 60 90 49 07 lds r6, 0x0749 ; 0x800749 14430: 50 90 4a 07 lds r5, 0x074A ; 0x80074a 14434: 40 90 4b 07 lds r4, 0x074B ; 0x80074b 14438: b0 90 44 07 lds r11, 0x0744 ; 0x800744 1443c: a0 90 45 07 lds r10, 0x0745 ; 0x800745 14440: 90 90 46 07 lds r9, 0x0746 ; 0x800746 14444: 80 90 47 07 lds r8, 0x0747 ; 0x800747 14448: f0 90 40 07 lds r15, 0x0740 ; 0x800740 1444c: e0 90 41 07 lds r14, 0x0741 ; 0x800741 14450: d0 90 42 07 lds r13, 0x0742 ; 0x800742 14454: c0 90 43 07 lds r12, 0x0743 ; 0x800743 14458: 86 e1 ldi r24, 0x16 ; 22 1445a: 98 e5 ldi r25, 0x58 ; 88 1445c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 14460: 4f 92 push r4 14462: 5f 92 push r5 14464: 6f 92 push r6 14466: 7f 92 push r7 14468: 8f 92 push r8 1446a: 9f 92 push r9 1446c: af 92 push r10 1446e: bf 92 push r11 14470: cf 92 push r12 14472: df 92 push r13 14474: ef 92 push r14 14476: ff 92 push r15 14478: 9f 93 push r25 1447a: 8f 93 push r24 1447c: 89 e8 ldi r24, 0x89 ; 137 1447e: 9b e6 ldi r25, 0x6B ; 107 14480: 9f 93 push r25 14482: 8f 93 push r24 14484: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 clean_up_after_endstop_move(l_feedmultiply); 14488: c8 01 movw r24, r16 1448a: 0e 94 14 68 call 0xd028 ; 0xd028 homing_flag = false; 1448e: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 14492: 0f b6 in r0, 0x3f ; 63 14494: f8 94 cli 14496: de bf out 0x3e, r29 ; 62 14498: 0f be out 0x3f, r0 ; 63 1449a: cd bf out 0x3d, r28 ; 61 1449c: 62 ca rjmp .-2876 ; 0x13962 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 1449e: 20 e0 ldi r18, 0x00 ; 0 144a0: 30 e0 ldi r19, 0x00 ; 0 144a2: 40 e2 ldi r20, 0x20 ; 32 144a4: 51 e4 ldi r21, 0x41 ; 65 144a6: 60 91 95 03 lds r22, 0x0395 ; 0x800395 144aa: 70 91 96 03 lds r23, 0x0396 ; 0x800396 144ae: 80 91 97 03 lds r24, 0x0397 ; 0x800397 144b2: 90 91 98 03 lds r25, 0x0398 ; 0x800398 144b6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 144ba: 87 ff sbrs r24, 7 144bc: 05 c0 rjmp .+10 ; 0x144c8 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 144be: 8a ea ldi r24, 0xAA ; 170 144c0: 99 e8 ldi r25, 0x89 ; 137 144c2: 0e 94 97 7b call 0xf72e ; 0xf72e 144c6: 4d ca rjmp .-2918 ; 0x13962 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 144c8: 82 e0 ldi r24, 0x02 ; 2 144ca: 0e 94 41 f8 call 0x1f082 ; 0x1f082 144ce: 81 11 cpse r24, r1 144d0: 07 c0 rjmp .+14 ; 0x144e0 //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)); 144d2: 8f e5 ldi r24, 0x5F ; 95 144d4: 9a e3 ldi r25, 0x3A ; 58 144d6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 144da: 0f 94 d6 34 call 0x269ac ; 0x269ac 144de: 41 ca rjmp .-2942 ; 0x13962 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 144e0: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 144e4: 88 23 and r24, r24 144e6: 41 f0 breq .+16 ; 0x144f8 144e8: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 144ec: 88 23 and r24, r24 144ee: 21 f0 breq .+8 ; 0x144f8 144f0: 10 91 3f 07 lds r17, 0x073F ; 0x80073f 144f4: 11 11 cpse r17, r1 144f6: 08 c0 rjmp .+16 ; 0x14508 144f8: 81 e0 ldi r24, 0x01 ; 1 144fa: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d { // 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); 144fe: 8f ef ldi r24, 0xFF ; 255 14500: 9c e6 ldi r25, 0x6C ; 108 14502: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 14506: 2d ca rjmp .-2982 ; 0x13962 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 14508: 86 e1 ldi r24, 0x16 ; 22 1450a: 9a e3 ldi r25, 0x3A ; 58 1450c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 14510: 0f 94 d6 34 call 0x269ac ; 0x269ac uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 14514: 80 ef ldi r24, 0xF0 ; 240 14516: 92 e5 ldi r25, 0x52 ; 82 14518: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1451c: 41 e0 ldi r20, 0x01 ; 1 1451e: 60 e0 ldi r22, 0x00 ; 0 14520: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce if (result == LCD_LEFT_BUTTON_CHOICE) 14524: 81 11 cpse r24, r1 14526: 61 c0 rjmp .+194 ; 0x145ea { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14528: 80 e0 ldi r24, 0x00 ; 0 1452a: 90 e0 ldi r25, 0x00 ; 0 1452c: a0 ea ldi r26, 0xA0 ; 160 1452e: b0 e4 ldi r27, 0x40 ; 64 14530: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14534: 90 93 49 07 sts 0x0749, r25 ; 0x800749 14538: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 1453c: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14540: 60 e0 ldi r22, 0x00 ; 0 14542: 70 e0 ldi r23, 0x00 ; 0 14544: 88 e4 ldi r24, 0x48 ; 72 14546: 92 e4 ldi r25, 0x42 ; 66 14548: 0f 94 11 ba call 0x37422 ; 0x37422 current_position[Z_AXIS] = 50; 1454c: 80 e0 ldi r24, 0x00 ; 0 1454e: 90 e0 ldi r25, 0x00 ; 0 14550: a8 e4 ldi r26, 0x48 ; 72 14552: b2 e4 ldi r27, 0x42 ; 66 14554: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14558: 90 93 49 07 sts 0x0749, r25 ; 0x800749 1455c: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 14560: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b current_position[Y_AXIS] = 180; 14564: 80 e0 ldi r24, 0x00 ; 0 14566: 90 e0 ldi r25, 0x00 ; 0 14568: a4 e3 ldi r26, 0x34 ; 52 1456a: b3 e4 ldi r27, 0x43 ; 67 1456c: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14570: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14574: a0 93 46 07 sts 0x0746, r26 ; 0x800746 14578: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 1457c: 60 e0 ldi r22, 0x00 ; 0 1457e: 70 e0 ldi r23, 0x00 ; 0 14580: 88 e4 ldi r24, 0x48 ; 72 14582: 92 e4 ldi r25, 0x42 ; 66 14584: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 14588: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 1458c: 86 ec ldi r24, 0xC6 ; 198 1458e: 92 e5 ldi r25, 0x52 ; 82 14590: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 14594: 0f 94 d6 34 call 0x269ac ; 0x269ac current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14598: e1 e4 ldi r30, 0x41 ; 65 1459a: f3 e9 ldi r31, 0x93 ; 147 1459c: 85 91 lpm r24, Z+ 1459e: 95 91 lpm r25, Z+ 145a0: a5 91 lpm r26, Z+ 145a2: b4 91 lpm r27, Z 145a4: 80 93 44 07 sts 0x0744, r24 ; 0x800744 145a8: 90 93 45 07 sts 0x0745, r25 ; 0x800745 145ac: a0 93 46 07 sts 0x0746, r26 ; 0x800746 145b0: b0 93 47 07 sts 0x0747, r27 ; 0x800747 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 145b4: ed e3 ldi r30, 0x3D ; 61 145b6: f3 e9 ldi r31, 0x93 ; 147 145b8: 85 91 lpm r24, Z+ 145ba: 95 91 lpm r25, Z+ 145bc: a5 91 lpm r26, Z+ 145be: b4 91 lpm r27, Z 145c0: 80 93 40 07 sts 0x0740, r24 ; 0x800740 145c4: 90 93 41 07 sts 0x0741, r25 ; 0x800741 145c8: a0 93 42 07 sts 0x0742, r26 ; 0x800742 145cc: b0 93 43 07 sts 0x0743, r27 ; 0x800743 plan_buffer_line_curposXYZE(3000 / 60); 145d0: 60 e0 ldi r22, 0x00 ; 0 145d2: 70 e0 ldi r23, 0x00 ; 0 145d4: 88 e4 ldi r24, 0x48 ; 72 145d6: 92 e4 ldi r25, 0x42 ; 66 145d8: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 145dc: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 gcode_G28(false, false, true); 145e0: 41 e0 ldi r20, 0x01 ; 1 145e2: 60 e0 ldi r22, 0x00 ; 0 145e4: 80 e0 ldi r24, 0x00 ; 0 145e6: 0e 94 21 81 call 0x10242 ; 0x10242 } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 145ea: 20 e0 ldi r18, 0x00 ; 0 145ec: 30 e0 ldi r19, 0x00 ; 0 145ee: 4c e0 ldi r20, 0x0C ; 12 145f0: 52 e4 ldi r21, 0x42 ; 66 145f2: 60 91 95 03 lds r22, 0x0395 ; 0x800395 145f6: 70 91 96 03 lds r23, 0x0396 ; 0x800396 145fa: 80 91 97 03 lds r24, 0x0397 ; 0x800397 145fe: 90 91 98 03 lds r25, 0x0398 ; 0x800398 14602: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 14606: 18 16 cp r1, r24 14608: 0c f0 brlt .+2 ; 0x1460c 1460a: 73 c0 rjmp .+230 ; 0x146f2 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 1460c: 80 e0 ldi r24, 0x00 ; 0 1460e: 90 e0 ldi r25, 0x00 ; 0 14610: a8 ec ldi r26, 0xC8 ; 200 14612: b2 e4 ldi r27, 0x42 ; 66 14614: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14618: 90 93 49 07 sts 0x0749, r25 ; 0x800749 1461c: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 14620: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14624: 60 e0 ldi r22, 0x00 ; 0 14626: 70 e0 ldi r23, 0x00 ; 0 14628: 88 e4 ldi r24, 0x48 ; 72 1462a: 92 e4 ldi r25, 0x42 ; 66 1462c: 0f 94 11 ba call 0x37422 ; 0x37422 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 14630: 0f 94 21 44 call 0x28842 ; 0x28842 LongTimer pinda_timeout; 14634: 19 82 std Y+1, r1 ; 0x01 14636: 1a 82 std Y+2, r1 ; 0x02 14638: 1b 82 std Y+3, r1 ; 0x03 1463a: 1c 82 std Y+4, r1 ; 0x04 1463c: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 1463e: ce 01 movw r24, r28 14640: 01 96 adiw r24, 0x01 ; 1 14642: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::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); 14646: 03 e2 ldi r16, 0x23 ; 35 14648: 6e ed ldi r22, 0xDE ; 222 1464a: e6 2e mov r14, r22 1464c: 66 e8 ldi r22, 0x86 ; 134 1464e: f6 2e mov r15, r22 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 14650: 20 e0 ldi r18, 0x00 ; 0 14652: 30 e0 ldi r19, 0x00 ; 0 14654: 4c e0 ldi r20, 0x0C ; 12 14656: 52 e4 ldi r21, 0x42 ; 66 14658: 60 91 95 03 lds r22, 0x0395 ; 0x800395 1465c: 70 91 96 03 lds r23, 0x0396 ; 0x800396 14660: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14664: 90 91 98 03 lds r25, 0x0398 ; 0x800398 14668: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1466c: 18 16 cp r1, r24 1466e: c4 f5 brge .+112 ; 0x146e0 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14670: 88 ec ldi r24, 0xC8 ; 200 14672: 99 e3 ldi r25, 0x39 ; 57 14674: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 14678: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1467c: 42 e8 ldi r20, 0x82 ; 130 1467e: 64 e0 ldi r22, 0x04 ; 4 14680: 80 e0 ldi r24, 0x00 ; 0 14682: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 14686: 1f 92 push r1 14688: 0f 93 push r16 1468a: 60 91 95 03 lds r22, 0x0395 ; 0x800395 1468e: 70 91 96 03 lds r23, 0x0396 ; 0x800396 14692: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14696: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1469a: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 1469e: 7f 93 push r23 146a0: 6f 93 push r22 146a2: ff 92 push r15 146a4: ef 92 push r14 146a6: 0e 94 ff 6f call 0xdffe ; 0xdffe lcd_putc(LCD_STR_DEGREE[0]); 146aa: 81 e8 ldi r24, 0x81 ; 129 146ac: 0e 94 15 70 call 0xe02a ; 0xe02a delay_keep_alive(1000); 146b0: 88 ee ldi r24, 0xE8 ; 232 146b2: 93 e0 ldi r25, 0x03 ; 3 146b4: 0e 94 10 8f call 0x11e20 ; 0x11e20 serialecho_temperatures(); 146b8: 0e 94 7a 79 call 0xf2f4 ; 0xf2f4 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 146bc: 40 e0 ldi r20, 0x00 ; 0 146be: 53 e5 ldi r21, 0x53 ; 83 146c0: 67 e0 ldi r22, 0x07 ; 7 146c2: 70 e0 ldi r23, 0x00 ; 0 146c4: ce 01 movw r24, r28 146c6: 01 96 adiw r24, 0x01 ; 1 146c8: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 146cc: 0f 90 pop r0 146ce: 0f 90 pop r0 146d0: 0f 90 pop r0 146d2: 0f 90 pop r0 146d4: 0f 90 pop r0 146d6: 0f 90 pop r0 146d8: 88 23 and r24, r24 146da: 09 f4 brne .+2 ; 0x146de 146dc: b9 cf rjmp .-142 ; 0x14650 target_temp_reached = false; 146de: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 146e0: 81 e0 ldi r24, 0x01 ; 1 146e2: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 146e6: 11 11 cpse r17, r1 146e8: 04 c0 rjmp .+8 ; 0x146f2 lcd_temp_cal_show_result(false); 146ea: 80 e0 ldi r24, 0x00 ; 0 146ec: 0f 94 67 35 call 0x26ace ; 0x26ace 146f0: 38 c9 rjmp .-3472 ; 0x13962 break; } } st_synchronize(); 146f2: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 146f6: 81 e0 ldi r24, 0x01 ; 1 146f8: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 lcd_update_enable(true); 146fc: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 14700: 8c e8 ldi r24, 0x8C ; 140 14702: 99 e8 ldi r25, 0x89 ; 137 14704: 0e 94 97 7b call 0xf72e ; 0xf72e float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 14708: 80 90 95 03 lds r8, 0x0395 ; 0x800395 1470c: 90 90 96 03 lds r9, 0x0396 ; 0x800396 14710: a0 90 97 03 lds r10, 0x0397 ; 0x800397 14714: b0 90 98 03 lds r11, 0x0398 ; 0x800398 14718: 20 e0 ldi r18, 0x00 ; 0 1471a: 30 e0 ldi r19, 0x00 ; 0 1471c: 40 ea ldi r20, 0xA0 ; 160 1471e: 50 e4 ldi r21, 0x40 ; 64 14720: c5 01 movw r24, r10 14722: b4 01 movw r22, r8 14724: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 14728: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 1472c: 25 e0 ldi r18, 0x05 ; 5 1472e: 26 9f mul r18, r22 14730: a0 01 movw r20, r0 14732: 27 9f mul r18, r23 14734: 50 0d add r21, r0 14736: 11 24 eor r1, r1 14738: ba 01 movw r22, r20 1473a: 55 0f add r21, r21 1473c: 88 0b sbc r24, r24 1473e: 99 0b sbc r25, r25 14740: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 14744: 1b 01 movw r2, r22 14746: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 14748: 20 e0 ldi r18, 0x00 ; 0 1474a: 30 e0 ldi r19, 0x00 ; 0 1474c: 4c e0 ldi r20, 0x0C ; 12 1474e: 52 e4 ldi r21, 0x42 ; 66 14750: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 14754: 87 ff sbrs r24, 7 14756: 06 c0 rjmp .+12 ; 0x14764 14758: 21 2c mov r2, r1 1475a: 31 2c mov r3, r1 1475c: 4c e0 ldi r20, 0x0C ; 12 1475e: e4 2e mov r14, r20 14760: 52 e4 ldi r21, 0x42 ; 66 14762: f5 2e mov r15, r21 if (start_temp < current_temperature_pinda) start_temp += 5; 14764: 22 2d mov r18, r2 14766: 33 2d mov r19, r3 14768: 4e 2d mov r20, r14 1476a: 5f 2d mov r21, r15 1476c: c5 01 movw r24, r10 1476e: b4 01 movw r22, r8 14770: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 14774: 18 16 cp r1, r24 14776: 64 f4 brge .+24 ; 0x14790 14778: 20 e0 ldi r18, 0x00 ; 0 1477a: 30 e0 ldi r19, 0x00 ; 0 1477c: 40 ea ldi r20, 0xA0 ; 160 1477e: 50 e4 ldi r21, 0x40 ; 64 14780: 62 2d mov r22, r2 14782: 73 2d mov r23, r3 14784: 8e 2d mov r24, r14 14786: 9f 2d mov r25, r15 14788: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1478c: 1b 01 movw r2, r22 1478e: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 14790: ff 92 push r15 14792: ef 92 push r14 14794: 3f 92 push r3 14796: 2f 92 push r2 14798: 87 e6 ldi r24, 0x67 ; 103 1479a: 9b e6 ldi r25, 0x6B ; 107 1479c: 9f 93 push r25 1479e: 8f 93 push r24 147a0: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 setTargetBed(70 + (start_temp - 30)); 147a4: 20 e0 ldi r18, 0x00 ; 0 147a6: 30 e0 ldi r19, 0x00 ; 0 147a8: 40 ef ldi r20, 0xF0 ; 240 147aa: 51 e4 ldi r21, 0x41 ; 65 147ac: 62 2d mov r22, r2 147ae: 73 2d mov r23, r3 147b0: 8e 2d mov r24, r14 147b2: 9f 2d mov r25, r15 147b4: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 147b8: 20 e0 ldi r18, 0x00 ; 0 147ba: 30 e0 ldi r19, 0x00 ; 0 147bc: 4c e8 ldi r20, 0x8C ; 140 147be: 52 e4 ldi r21, 0x42 ; 66 147c0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 147c4: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 147c8: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 147cc: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 custom_message_type = CustomMsg::TempCal; 147d0: 84 e0 ldi r24, 0x04 ; 4 147d2: 80 93 72 07 sts 0x0772, r24 ; 0x800772 custom_message_state = 1; 147d6: 81 e0 ldi r24, 0x01 ; 1 147d8: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 147dc: 83 e8 ldi r24, 0x83 ; 131 147de: 9a e3 ldi r25, 0x3A ; 58 147e0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 147e4: 0f 94 e0 0a call 0x215c0 ; 0x215c0 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 147e8: 80 e0 ldi r24, 0x00 ; 0 147ea: 90 e0 ldi r25, 0x00 ; 0 147ec: a0 ea ldi r26, 0xA0 ; 160 147ee: b0 e4 ldi r27, 0x40 ; 64 147f0: 80 93 48 07 sts 0x0748, r24 ; 0x800748 147f4: 90 93 49 07 sts 0x0749, r25 ; 0x800749 147f8: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 147fc: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14800: 60 e0 ldi r22, 0x00 ; 0 14802: 70 e0 ldi r23, 0x00 ; 0 14804: 88 e4 ldi r24, 0x48 ; 72 14806: 92 e4 ldi r25, 0x42 ; 66 14808: 0f 94 11 ba call 0x37422 ; 0x37422 current_position[X_AXIS] = PINDA_PREHEAT_X; 1480c: 80 e0 ldi r24, 0x00 ; 0 1480e: 90 e0 ldi r25, 0x00 ; 0 14810: a0 ea ldi r26, 0xA0 ; 160 14812: b1 e4 ldi r27, 0x41 ; 65 14814: 80 93 40 07 sts 0x0740, r24 ; 0x800740 14818: 90 93 41 07 sts 0x0741, r25 ; 0x800741 1481c: a0 93 42 07 sts 0x0742, r26 ; 0x800742 14820: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14824: 80 e0 ldi r24, 0x00 ; 0 14826: 90 e0 ldi r25, 0x00 ; 0 14828: a0 e7 ldi r26, 0x70 ; 112 1482a: b2 e4 ldi r27, 0x42 ; 66 1482c: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14830: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14834: a0 93 46 07 sts 0x0746, r26 ; 0x800746 14838: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 1483c: 60 e0 ldi r22, 0x00 ; 0 1483e: 70 e0 ldi r23, 0x00 ; 0 14840: 88 e4 ldi r24, 0x48 ; 72 14842: 92 e4 ldi r25, 0x42 ; 66 14844: 0f 94 11 ba call 0x37422 ; 0x37422 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14848: 8a e9 ldi r24, 0x9A ; 154 1484a: 99 e9 ldi r25, 0x99 ; 153 1484c: a9 e1 ldi r26, 0x19 ; 25 1484e: be e3 ldi r27, 0x3E ; 62 14850: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14854: 90 93 49 07 sts 0x0749, r25 ; 0x800749 14858: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 1485c: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14860: 60 e0 ldi r22, 0x00 ; 0 14862: 70 e0 ldi r23, 0x00 ; 0 14864: 88 e4 ldi r24, 0x48 ; 72 14866: 92 e4 ldi r25, 0x42 ; 66 14868: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1486c: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 14870: 0f 90 pop r0 14872: 0f 90 pop r0 14874: 0f 90 pop r0 14876: 0f 90 pop r0 14878: 0f 90 pop r0 1487a: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 1487c: 20 91 95 03 lds r18, 0x0395 ; 0x800395 14880: 30 91 96 03 lds r19, 0x0396 ; 0x800396 14884: 40 91 97 03 lds r20, 0x0397 ; 0x800397 14888: 50 91 98 03 lds r21, 0x0398 ; 0x800398 1488c: 62 2d mov r22, r2 1488e: 73 2d mov r23, r3 14890: 8e 2d mov r24, r14 14892: 9f 2d mov r25, r15 14894: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 14898: 18 16 cp r1, r24 1489a: 3c f4 brge .+14 ; 0x148aa { delay_keep_alive(1000); 1489c: 88 ee ldi r24, 0xE8 ; 232 1489e: 93 e0 ldi r25, 0x03 ; 3 148a0: 0e 94 10 8f call 0x11e20 ; 0x11e20 serialecho_temperatures(); 148a4: 0e 94 7a 79 call 0xf2f4 ; 0xf2f4 148a8: e9 cf rjmp .-46 ; 0x1487c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 148aa: 60 e0 ldi r22, 0x00 ; 0 148ac: 86 ea ldi r24, 0xA6 ; 166 148ae: 9f e0 ldi r25, 0x0F ; 15 148b0: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 } 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; 148b4: 80 e0 ldi r24, 0x00 ; 0 148b6: 90 e0 ldi r25, 0x00 ; 0 148b8: a0 ea ldi r26, 0xA0 ; 160 148ba: b0 e4 ldi r27, 0x40 ; 64 148bc: 80 93 48 07 sts 0x0748, r24 ; 0x800748 148c0: 90 93 49 07 sts 0x0749, r25 ; 0x800749 148c4: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 148c8: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 148cc: 60 e0 ldi r22, 0x00 ; 0 148ce: 70 e0 ldi r23, 0x00 ; 0 148d0: 88 e4 ldi r24, 0x48 ; 72 148d2: 92 e4 ldi r25, 0x42 ; 66 148d4: 0f 94 11 ba call 0x37422 ; 0x37422 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 148d8: ed e3 ldi r30, 0x3D ; 61 148da: f3 e9 ldi r31, 0x93 ; 147 148dc: 85 91 lpm r24, Z+ 148de: 95 91 lpm r25, Z+ 148e0: a5 91 lpm r26, Z+ 148e2: b4 91 lpm r27, Z 148e4: 80 93 40 07 sts 0x0740, r24 ; 0x800740 148e8: 90 93 41 07 sts 0x0741, r25 ; 0x800741 148ec: a0 93 42 07 sts 0x0742, r26 ; 0x800742 148f0: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 148f4: e1 e4 ldi r30, 0x41 ; 65 148f6: f3 e9 ldi r31, 0x93 ; 147 148f8: 85 91 lpm r24, Z+ 148fa: 95 91 lpm r25, Z+ 148fc: a5 91 lpm r26, Z+ 148fe: b4 91 lpm r27, Z 14900: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14904: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14908: a0 93 46 07 sts 0x0746, r26 ; 0x800746 1490c: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 14910: 60 e0 ldi r22, 0x00 ; 0 14912: 70 e0 ldi r23, 0x00 ; 0 14914: 88 e4 ldi r24, 0x48 ; 72 14916: 92 e4 ldi r25, 0x42 ; 66 14918: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1491c: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 14920: 43 e0 ldi r20, 0x03 ; 3 14922: 60 e0 ldi r22, 0x00 ; 0 14924: 70 e0 ldi r23, 0x00 ; 0 14926: 80 e8 ldi r24, 0x80 ; 128 14928: 9f eb ldi r25, 0xBF ; 191 1492a: 0f 94 a7 8b call 0x3174e ; 0x3174e if (find_z_result == false) { 1492e: 81 11 cpse r24, r1 14930: 06 c0 rjmp .+12 ; 0x1493e 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); 14932: 0f 94 67 35 call 0x26ace ; 0x26ace homing_flag = false; 14936: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 1493a: 0c 94 b1 9c jmp 0x13962 ; 0x13962 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 1493e: 90 91 48 07 lds r25, 0x0748 ; 0x800748 14942: 67 96 adiw r28, 0x17 ; 23 14944: 9f af std Y+63, r25 ; 0x3f 14946: 67 97 sbiw r28, 0x17 ; 23 14948: a0 91 49 07 lds r26, 0x0749 ; 0x800749 1494c: 6b 96 adiw r28, 0x1b ; 27 1494e: af af std Y+63, r26 ; 0x3f 14950: 6b 97 sbiw r28, 0x1b ; 27 14952: b0 91 4a 07 lds r27, 0x074A ; 0x80074a 14956: 6f 96 adiw r28, 0x1f ; 31 14958: bf af std Y+63, r27 ; 0x3f 1495a: 6f 97 sbiw r28, 0x1f ; 31 1495c: e0 91 4b 07 lds r30, 0x074B ; 0x80074b 14960: a7 96 adiw r28, 0x27 ; 39 14962: ef af std Y+63, r30 ; 0x3f 14964: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 14966: ef 93 push r30 14968: bf 93 push r27 1496a: af 93 push r26 1496c: 9f 93 push r25 1496e: 8a e5 ldi r24, 0x5A ; 90 14970: 9b e6 ldi r25, 0x6B ; 107 14972: 9f 93 push r25 14974: 8f 93 push r24 14976: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1497a: 0f 90 pop r0 1497c: 0f 90 pop r0 1497e: 0f 90 pop r0 14980: 0f 90 pop r0 14982: 0f 90 pop r0 14984: 0f 90 pop r0 14986: 2e ea ldi r18, 0xAE ; 174 14988: 82 2e mov r8, r18 1498a: 2f e0 ldi r18, 0x0F ; 15 1498c: 92 2e mov r9, r18 1498e: 33 e2 ldi r19, 0x23 ; 35 14990: c3 2e mov r12, r19 14992: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 14994: 0f ef ldi r16, 0xFF ; 255 14996: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 14998: b6 01 movw r22, r12 1499a: 0d 2c mov r0, r13 1499c: 00 0c add r0, r0 1499e: 88 0b sbc r24, r24 149a0: 99 0b sbc r25, r25 149a2: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 149a6: 2b 01 movw r4, r22 149a8: 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)); 149aa: df 92 push r13 149ac: cf 92 push r12 149ae: c8 01 movw r24, r16 149b0: 02 96 adiw r24, 0x02 ; 2 149b2: 9f 93 push r25 149b4: 8f 93 push r24 149b6: 2e e1 ldi r18, 0x1E ; 30 149b8: 3b e6 ldi r19, 0x6B ; 107 149ba: 3f 93 push r19 149bc: 2f 93 push r18 149be: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 149c2: 58 01 movw r10, r16 149c4: 5f ef ldi r21, 0xFF ; 255 149c6: a5 1a sub r10, r21 149c8: b5 0a sbc r11, r21 if (i >= 0) { 149ca: 0f 90 pop r0 149cc: 0f 90 pop r0 149ce: 0f 90 pop r0 149d0: 0f 90 pop r0 149d2: 0f 90 pop r0 149d4: 0f 90 pop r0 149d6: 11 f4 brne .+4 ; 0x149dc 149d8: 0c 94 69 ce jmp 0x19cd2 ; 0x19cd2 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 149dc: 70 e0 ldi r23, 0x00 ; 0 149de: 60 e0 ldi r22, 0x00 ; 0 149e0: c4 01 movw r24, r8 149e2: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 149e6: a3 01 movw r20, r6 149e8: 92 01 movw r18, r4 149ea: 62 2d mov r22, r2 149ec: 73 2d mov r23, r3 149ee: 8e 2d mov r24, r14 149f0: 9f 2d mov r25, r15 149f2: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 149f6: 18 16 cp r1, r24 149f8: 44 f4 brge .+16 ; 0x14a0a } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 149fa: 85 e0 ldi r24, 0x05 ; 5 149fc: a8 16 cp r10, r24 149fe: b1 04 cpc r11, r1 14a00: 11 f0 breq .+4 ; 0x14a06 14a02: 0c 94 75 ce jmp 0x19cea ; 0x19cea 14a06: 05 e0 ldi r16, 0x05 ; 5 14a08: 10 e0 ldi r17, 0x00 ; 0 14a0a: 58 01 movw r10, r16 14a0c: 97 e2 ldi r25, 0x27 ; 39 14a0e: a9 1a sub r10, r25 14a10: 98 ef ldi r25, 0xF8 ; 248 14a12: b9 0a sbc r11, r25 14a14: aa 0c add r10, r10 14a16: bb 1c adc r11, r11 14a18: 85 e0 ldi r24, 0x05 ; 5 14a1a: 80 9f mul r24, r16 14a1c: 10 01 movw r2, r0 14a1e: 81 9f mul r24, r17 14a20: 30 0c add r3, r0 14a22: 11 24 eor r1, r1 14a24: 0d 5f subi r16, 0xFD ; 253 14a26: 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; 14a28: 8a e9 ldi r24, 0x9A ; 154 14a2a: 48 2e mov r4, r24 14a2c: 89 e9 ldi r24, 0x99 ; 153 14a2e: 58 2e mov r5, r24 14a30: 89 e1 ldi r24, 0x19 ; 25 14a32: 68 2e mov r6, r24 14a34: 8e e3 ldi r24, 0x3E ; 62 14a36: 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); 14a38: 95 ee ldi r25, 0xE5 ; 229 14a3a: 89 2e mov r8, r25 14a3c: 9a e6 ldi r25, 0x6A ; 106 14a3e: 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++) 14a40: c8 01 movw r24, r16 14a42: 02 97 sbiw r24, 0x02 ; 2 14a44: 05 97 sbiw r24, 0x05 ; 5 14a46: 0c f0 brlt .+2 ; 0x14a4a 14a48: d4 c0 rjmp .+424 ; 0x14bf2 { float temp = (40 + i * 5); 14a4a: b1 01 movw r22, r2 14a4c: 63 5d subi r22, 0xD3 ; 211 14a4e: 7f 4f sbci r23, 0xFF ; 255 14a50: 07 2e mov r0, r23 14a52: 00 0c add r0, r0 14a54: 88 0b sbc r24, r24 14a56: 99 0b sbc r25, r25 14a58: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 14a5c: 6b 01 movw r12, r22 14a5e: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 14a60: 1f 93 push r17 14a62: 0f 93 push r16 14a64: a1 e1 ldi r26, 0x11 ; 17 14a66: bb e6 ldi r27, 0x6B ; 107 14a68: bf 93 push r27 14a6a: af 93 push r26 14a6c: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 custom_message_state = i + 2; 14a70: 00 93 f0 03 sts 0x03F0, r16 ; 0x8003f0 setTargetBed(50 + 10 * (temp - 30) / 5); 14a74: 20 e0 ldi r18, 0x00 ; 0 14a76: 30 e0 ldi r19, 0x00 ; 0 14a78: 40 ef ldi r20, 0xF0 ; 240 14a7a: 51 e4 ldi r21, 0x41 ; 65 14a7c: c7 01 movw r24, r14 14a7e: b6 01 movw r22, r12 14a80: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 14a84: 20 e0 ldi r18, 0x00 ; 0 14a86: 30 e0 ldi r19, 0x00 ; 0 14a88: 40 e2 ldi r20, 0x20 ; 32 14a8a: 51 e4 ldi r21, 0x41 ; 65 14a8c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 14a90: 20 e0 ldi r18, 0x00 ; 0 14a92: 30 e0 ldi r19, 0x00 ; 0 14a94: 40 ea ldi r20, 0xA0 ; 160 14a96: 50 e4 ldi r21, 0x40 ; 64 14a98: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 14a9c: 20 e0 ldi r18, 0x00 ; 0 14a9e: 30 e0 ldi r19, 0x00 ; 0 14aa0: 48 e4 ldi r20, 0x48 ; 72 14aa2: 52 e4 ldi r21, 0x42 ; 66 14aa4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 14aa8: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 14aac: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 14ab0: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14ab4: 80 e0 ldi r24, 0x00 ; 0 14ab6: 90 e0 ldi r25, 0x00 ; 0 14ab8: a0 ea ldi r26, 0xA0 ; 160 14aba: b0 e4 ldi r27, 0x40 ; 64 14abc: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14ac0: 90 93 49 07 sts 0x0749, r25 ; 0x800749 14ac4: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 14ac8: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14acc: 60 e0 ldi r22, 0x00 ; 0 14ace: 70 e0 ldi r23, 0x00 ; 0 14ad0: 88 e4 ldi r24, 0x48 ; 72 14ad2: 92 e4 ldi r25, 0x42 ; 66 14ad4: 0f 94 11 ba call 0x37422 ; 0x37422 current_position[X_AXIS] = PINDA_PREHEAT_X; 14ad8: 20 e0 ldi r18, 0x00 ; 0 14ada: 30 e0 ldi r19, 0x00 ; 0 14adc: 40 ea ldi r20, 0xA0 ; 160 14ade: 51 e4 ldi r21, 0x41 ; 65 14ae0: 20 93 40 07 sts 0x0740, r18 ; 0x800740 14ae4: 30 93 41 07 sts 0x0741, r19 ; 0x800741 14ae8: 40 93 42 07 sts 0x0742, r20 ; 0x800742 14aec: 50 93 43 07 sts 0x0743, r21 ; 0x800743 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14af0: 80 e0 ldi r24, 0x00 ; 0 14af2: 90 e0 ldi r25, 0x00 ; 0 14af4: a0 e7 ldi r26, 0x70 ; 112 14af6: b2 e4 ldi r27, 0x42 ; 66 14af8: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14afc: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14b00: a0 93 46 07 sts 0x0746, r26 ; 0x800746 14b04: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 14b08: 60 e0 ldi r22, 0x00 ; 0 14b0a: 70 e0 ldi r23, 0x00 ; 0 14b0c: 88 e4 ldi r24, 0x48 ; 72 14b0e: 92 e4 ldi r25, 0x42 ; 66 14b10: 0f 94 11 ba call 0x37422 ; 0x37422 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14b14: 40 92 48 07 sts 0x0748, r4 ; 0x800748 14b18: 50 92 49 07 sts 0x0749, r5 ; 0x800749 14b1c: 60 92 4a 07 sts 0x074A, r6 ; 0x80074a 14b20: 70 92 4b 07 sts 0x074B, r7 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14b24: 60 e0 ldi r22, 0x00 ; 0 14b26: 70 e0 ldi r23, 0x00 ; 0 14b28: 88 e4 ldi r24, 0x48 ; 72 14b2a: 92 e4 ldi r25, 0x42 ; 66 14b2c: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 14b30: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 14b34: 0f 90 pop r0 14b36: 0f 90 pop r0 14b38: 0f 90 pop r0 14b3a: 0f 90 pop r0 while (current_temperature_pinda < temp) 14b3c: 20 91 95 03 lds r18, 0x0395 ; 0x800395 14b40: 30 91 96 03 lds r19, 0x0396 ; 0x800396 14b44: 40 91 97 03 lds r20, 0x0397 ; 0x800397 14b48: 50 91 98 03 lds r21, 0x0398 ; 0x800398 14b4c: c7 01 movw r24, r14 14b4e: b6 01 movw r22, r12 14b50: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 14b54: 18 16 cp r1, r24 14b56: 3c f4 brge .+14 ; 0x14b66 { delay_keep_alive(1000); 14b58: 88 ee ldi r24, 0xE8 ; 232 14b5a: 93 e0 ldi r25, 0x03 ; 3 14b5c: 0e 94 10 8f call 0x11e20 ; 0x11e20 serialecho_temperatures(); 14b60: 0e 94 7a 79 call 0xf2f4 ; 0xf2f4 14b64: eb cf rjmp .-42 ; 0x14b3c } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14b66: 80 e0 ldi r24, 0x00 ; 0 14b68: 90 e0 ldi r25, 0x00 ; 0 14b6a: a0 ea ldi r26, 0xA0 ; 160 14b6c: b0 e4 ldi r27, 0x40 ; 64 14b6e: 80 93 48 07 sts 0x0748, r24 ; 0x800748 14b72: 90 93 49 07 sts 0x0749, r25 ; 0x800749 14b76: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 14b7a: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(3000 / 60); 14b7e: 60 e0 ldi r22, 0x00 ; 0 14b80: 70 e0 ldi r23, 0x00 ; 0 14b82: 88 e4 ldi r24, 0x48 ; 72 14b84: 92 e4 ldi r25, 0x42 ; 66 14b86: 0f 94 11 ba call 0x37422 ; 0x37422 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14b8a: ed e3 ldi r30, 0x3D ; 61 14b8c: f3 e9 ldi r31, 0x93 ; 147 14b8e: 85 91 lpm r24, Z+ 14b90: 95 91 lpm r25, Z+ 14b92: a5 91 lpm r26, Z+ 14b94: b4 91 lpm r27, Z 14b96: 80 93 40 07 sts 0x0740, r24 ; 0x800740 14b9a: 90 93 41 07 sts 0x0741, r25 ; 0x800741 14b9e: a0 93 42 07 sts 0x0742, r26 ; 0x800742 14ba2: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14ba6: e1 e4 ldi r30, 0x41 ; 65 14ba8: f3 e9 ldi r31, 0x93 ; 147 14baa: 85 91 lpm r24, Z+ 14bac: 95 91 lpm r25, Z+ 14bae: a5 91 lpm r26, Z+ 14bb0: b4 91 lpm r27, Z 14bb2: 80 93 44 07 sts 0x0744, r24 ; 0x800744 14bb6: 90 93 45 07 sts 0x0745, r25 ; 0x800745 14bba: a0 93 46 07 sts 0x0746, r26 ; 0x800746 14bbe: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(3000 / 60); 14bc2: 60 e0 ldi r22, 0x00 ; 0 14bc4: 70 e0 ldi r23, 0x00 ; 0 14bc6: 88 e4 ldi r24, 0x48 ; 72 14bc8: 92 e4 ldi r25, 0x42 ; 66 14bca: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 14bce: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 find_z_result = find_bed_induction_sensor_point_z(-1.f); 14bd2: 43 e0 ldi r20, 0x03 ; 3 14bd4: 60 e0 ldi r22, 0x00 ; 0 14bd6: 70 e0 ldi r23, 0x00 ; 0 14bd8: 80 e8 ldi r24, 0x80 ; 128 14bda: 9f eb ldi r25, 0xBF ; 191 14bdc: 0f 94 a7 8b call 0x3174e ; 0x3174e 14be0: 95 e0 ldi r25, 0x05 ; 5 14be2: 29 0e add r2, r25 14be4: 31 1c adc r3, r1 14be6: 0f 5f subi r16, 0xFF ; 255 14be8: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 14bea: 81 11 cpse r24, r1 14bec: 04 c0 rjmp .+8 ; 0x14bf6 lcd_temp_cal_show_result(find_z_result); 14bee: 0f 94 67 35 call 0x26ace ; 0x26ace 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); 14bf2: 81 e0 ldi r24, 0x01 ; 1 14bf4: 9e ce rjmp .-708 ; 0x14932 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]); 14bf6: 67 96 adiw r28, 0x17 ; 23 14bf8: 7f ad ldd r23, Y+63 ; 0x3f 14bfa: 67 97 sbiw r28, 0x17 ; 23 14bfc: 6b 96 adiw r28, 0x1b ; 27 14bfe: 6f ad ldd r22, Y+63 ; 0x3f 14c00: 6b 97 sbiw r28, 0x1b ; 27 14c02: 6f 96 adiw r28, 0x1f ; 31 14c04: 9f ad ldd r25, Y+63 ; 0x3f 14c06: 6f 97 sbiw r28, 0x1f ; 31 14c08: a7 96 adiw r28, 0x27 ; 39 14c0a: 8f ad ldd r24, Y+63 ; 0x3f 14c0c: a7 97 sbiw r28, 0x27 ; 39 14c0e: 27 2f mov r18, r23 14c10: 36 2f mov r19, r22 14c12: 49 2f mov r20, r25 14c14: 58 2f mov r21, r24 14c16: 60 91 48 07 lds r22, 0x0748 ; 0x800748 14c1a: 70 91 49 07 lds r23, 0x0749 ; 0x800749 14c1e: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 14c22: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 14c26: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 14c2a: f6 2e mov r15, r22 14c2c: e7 2e mov r14, r23 14c2e: d8 2e mov r13, r24 14c30: c9 2e mov r12, r25 14c32: 20 91 77 06 lds r18, 0x0677 ; 0x800677 14c36: 30 91 78 06 lds r19, 0x0678 ; 0x800678 14c3a: 40 91 79 06 lds r20, 0x0679 ; 0x800679 14c3e: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 14c42: d7 01 movw r26, r14 14c44: f6 01 movw r30, r12 14c46: 6b 2f mov r22, r27 14c48: 7a 2f mov r23, r26 14c4a: 8f 2f mov r24, r31 14c4c: 9e 2f mov r25, r30 14c4e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 14c52: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 14c56: a6 96 adiw r28, 0x26 ; 38 14c58: 6c af std Y+60, r22 ; 0x3c 14c5a: 7d af std Y+61, r23 ; 0x3d 14c5c: 8e af std Y+62, r24 ; 0x3e 14c5e: 9f af std Y+63, r25 ; 0x3f 14c60: 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); 14c62: cf 92 push r12 14c64: df 92 push r13 14c66: ef 92 push r14 14c68: ff 92 push r15 14c6a: 80 91 98 03 lds r24, 0x0398 ; 0x800398 14c6e: 8f 93 push r24 14c70: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14c74: 8f 93 push r24 14c76: 80 91 96 03 lds r24, 0x0396 ; 0x800396 14c7a: 8f 93 push r24 14c7c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14c80: 8f 93 push r24 14c82: 9f 92 push r9 14c84: 8f 92 push r8 14c86: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 14c8a: a4 96 adiw r28, 0x24 ; 36 14c8c: 6e ad ldd r22, Y+62 ; 0x3e 14c8e: 7f ad ldd r23, Y+63 ; 0x3f 14c90: a4 97 sbiw r28, 0x24 ; 36 14c92: c5 01 movw r24, r10 14c94: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 14c98: a2 e0 ldi r26, 0x02 ; 2 14c9a: aa 0e add r10, r26 14c9c: b1 1c adc r11, r1 14c9e: 0f b6 in r0, 0x3f ; 63 14ca0: f8 94 cli 14ca2: de bf out 0x3e, r29 ; 62 14ca4: 0f be out 0x3f, r0 ; 63 14ca6: cd bf out 0x3d, r28 ; 61 14ca8: cb ce rjmp .-618 ; 0x14a40 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 14caa: 80 e1 ldi r24, 0x10 ; 16 14cac: 0e 94 07 e6 call 0x1cc0e ; 0x1cc0e 14cb0: 0c 94 b1 9c jmp 0x13962 ; 0x13962 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 14cb4: 80 e1 ldi r24, 0x10 ; 16 14cb6: 0e 94 5c e6 call 0x1ccb8 ; 0x1ccb8 14cba: 0c 94 b1 9c jmp 0x13962 ; 0x13962 /*! ### 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); 14cbe: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 14cc2: 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; 14cc4: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd 14cc8: 0c 94 b1 9c jmp 0x13962 ; 0x13962 14ccc: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 14cd0: 87 60 ori r24, 0x07 ; 7 14cd2: f8 cf rjmp .-16 ; 0x14cc4 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 14cd4: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 14cd8: f1 2c mov r15, r1 14cda: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 14cdc: f8 01 movw r30, r16 14cde: 81 91 ld r24, Z+ 14ce0: 8f 01 movw r16, r30 14ce2: 88 23 and r24, r24 14ce4: d1 f0 breq .+52 ; 0x14d1a current_position[i] = values[i] + cs.add_homing[i]; 14ce6: 97 01 movw r18, r14 14ce8: 20 5c subi r18, 0xC0 ; 192 14cea: 38 4f sbci r19, 0xF8 ; 248 14cec: 59 01 movw r10, r18 14cee: f3 01 movw r30, r6 14cf0: ee 0d add r30, r14 14cf2: ff 1d adc r31, r15 14cf4: 20 81 ld r18, Z 14cf6: 31 81 ldd r19, Z+1 ; 0x01 14cf8: 42 81 ldd r20, Z+2 ; 0x02 14cfa: 53 81 ldd r21, Z+3 ; 0x03 14cfc: f7 01 movw r30, r14 14cfe: ed 53 subi r30, 0x3D ; 61 14d00: f9 4f sbci r31, 0xF9 ; 249 14d02: 60 81 ld r22, Z 14d04: 71 81 ldd r23, Z+1 ; 0x01 14d06: 82 81 ldd r24, Z+2 ; 0x02 14d08: 93 81 ldd r25, Z+3 ; 0x03 14d0a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 14d0e: d5 01 movw r26, r10 14d10: 6d 93 st X+, r22 14d12: 7d 93 st X+, r23 14d14: 8d 93 st X+, r24 14d16: 9c 93 st X, r25 14d18: 13 97 sbiw r26, 0x03 ; 3 14d1a: b4 e0 ldi r27, 0x04 ; 4 14d1c: eb 0e add r14, r27 14d1e: 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) 14d20: ec e0 ldi r30, 0x0C ; 12 14d22: ee 16 cp r14, r30 14d24: f1 04 cpc r15, r1 14d26: d1 f6 brne .-76 ; 0x14cdc { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 14d28: dd 20 and r13, r13 14d2a: 61 f0 breq .+24 ; 0x14d44 current_position[E_AXIS] = values[E_AXIS]; 14d2c: 8d 85 ldd r24, Y+13 ; 0x0d 14d2e: 9e 85 ldd r25, Y+14 ; 0x0e 14d30: af 85 ldd r26, Y+15 ; 0x0f 14d32: b8 89 ldd r27, Y+16 ; 0x10 14d34: 80 93 4c 07 sts 0x074C, r24 ; 0x80074c 14d38: 90 93 4d 07 sts 0x074D, r25 ; 0x80074d 14d3c: a0 93 4e 07 sts 0x074E, r26 ; 0x80074e 14d40: b0 93 4f 07 sts 0x074F, r27 ; 0x80074f // Set all at once plan_set_position_curposXYZE(); 14d44: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 14d48: 0c 94 b1 9c jmp 0x13962 ; 0x13962 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 14d4c: 8d 34 cpi r24, 0x4D ; 77 14d4e: 11 f0 breq .+4 ; 0x14d54 14d50: 0c 94 da cc jmp 0x199b4 ; 0x199b4 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 14d54: 10 93 94 03 sts 0x0394, r17 ; 0x800394 14d58: 00 93 93 03 sts 0x0393, r16 ; 0x800393 14d5c: f8 01 movw r30, r16 14d5e: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 14d60: 81 91 ld r24, Z+ 14d62: 80 32 cpi r24, 0x20 ; 32 14d64: e9 f3 breq .-6 ; 0x14d60 14d66: 89 30 cpi r24, 0x09 ; 9 14d68: d9 f3 breq .-10 ; 0x14d60 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 14d6a: 80 53 subi r24, 0x30 ; 48 14d6c: 8a 30 cpi r24, 0x0A ; 10 14d6e: 70 f0 brcs .+28 ; 0x14d8c printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14d70: 1f 93 push r17 14d72: 0f 93 push r16 14d74: 88 e7 ldi r24, 0x78 ; 120 14d76: 99 e8 ldi r25, 0x89 ; 137 14d78: 9f 93 push r25 14d7a: 8f 93 push r24 14d7c: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 14d80: 0f 90 pop r0 14d82: 0f 90 pop r0 14d84: 0f 90 pop r0 14d86: 0f 90 pop r0 14d88: 0c 94 6e 98 jmp 0x130dc ; 0x130dc } else { mcode_in_progress = code_value_short(); 14d8c: 0e 94 ac 5c call 0xb958 ; 0xb958 14d90: 90 93 59 0e sts 0x0E59, r25 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.548+0x1> 14d94: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 <_ZL17mcode_in_progress.lto_priv.548> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d98: 89 3c cpi r24, 0xC9 ; 201 14d9a: 91 05 cpc r25, r1 14d9c: 11 f4 brne .+4 ; 0x14da2 14d9e: 0c 94 a6 b4 jmp 0x1694c ; 0x1694c 14da2: 0c f0 brlt .+2 ; 0x14da6 14da4: 08 c3 rjmp .+1552 ; 0x153b6 14da6: 8e 34 cpi r24, 0x4E ; 78 14da8: 91 05 cpc r25, r1 14daa: 11 f4 brne .+4 ; 0x14db0 14dac: 0c 94 5e b0 jmp 0x160bc ; 0x160bc 14db0: 0c f0 brlt .+2 ; 0x14db4 14db2: 0e c2 rjmp .+1052 ; 0x151d0 14db4: 8c 31 cpi r24, 0x1C ; 28 14db6: 91 05 cpc r25, r1 14db8: 09 f4 brne .+2 ; 0x14dbc 14dba: e2 c7 rjmp .+4036 ; 0x15d80 14dbc: 0c f0 brlt .+2 ; 0x14dc0 14dbe: f1 c0 rjmp .+482 ; 0x14fa2 14dc0: 85 31 cpi r24, 0x15 ; 21 14dc2: 91 05 cpc r25, r1 14dc4: 09 f4 brne .+2 ; 0x14dc8 14dc6: f5 c6 rjmp .+3562 ; 0x15bb2 14dc8: 0c f0 brlt .+2 ; 0x14dcc 14dca: 5a c0 rjmp .+180 ; 0x14e80 14dcc: 81 31 cpi r24, 0x11 ; 17 14dce: 91 05 cpc r25, r1 14dd0: 09 f4 brne .+2 ; 0x14dd4 14dd2: e4 c6 rjmp .+3528 ; 0x15b9c 14dd4: dc f4 brge .+54 ; 0x14e0c 14dd6: 02 97 sbiw r24, 0x02 ; 2 14dd8: 08 f4 brcc .+2 ; 0x14ddc 14dda: 54 c6 rjmp .+3240 ; 0x15a84 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 14ddc: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 14de0: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 14de4: 8d 57 subi r24, 0x7D ; 125 14de6: 9f 4e sbci r25, 0xEF ; 239 14de8: 9f 93 push r25 14dea: 8f 93 push r24 14dec: 1f 92 push r1 14dee: 8d e4 ldi r24, 0x4D ; 77 14df0: 8f 93 push r24 14df2: 80 ed ldi r24, 0xD0 ; 208 14df4: 9a e6 ldi r25, 0x6A ; 106 14df6: 9f 93 push r25 14df8: 8f 93 push r24 14dfa: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 14dfe: 0f 90 pop r0 14e00: 0f 90 pop r0 14e02: 0f 90 pop r0 14e04: 0f 90 pop r0 14e06: 0f 90 pop r0 14e08: 0f 90 pop r0 14e0a: 21 c6 rjmp .+3138 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e0c: 82 31 cpi r24, 0x12 ; 18 14e0e: 91 05 cpc r25, r1 14e10: 11 f4 brne .+4 ; 0x14e16 14e12: 0c 94 c1 b1 jmp 0x16382 ; 0x16382 14e16: 44 97 sbiw r24, 0x14 ; 20 14e18: 09 f7 brne .-62 ; 0x14ddc #### 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() 14e1a: 81 e0 ldi r24, 0x01 ; 1 14e1c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 14e20: 80 ec ldi r24, 0xC0 ; 192 14e22: 9a e6 ldi r25, 0x6A ; 106 14e24: 0e 94 97 7b call 0xf72e ; 0xf72e card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 14e28: 84 e5 ldi r24, 0x54 ; 84 14e2a: 0e 94 0d 5d call 0xba1a ; 0xba1a 14e2e: 18 2f mov r17, r24 14e30: 8c e4 ldi r24, 0x4C ; 76 14e32: 0e 94 0d 5d call 0xba1a ; 0xba1a 14e36: 00 e0 ldi r16, 0x00 ; 0 14e38: 80 fb bst r24, 0 14e3a: 00 f9 bld r16, 0 14e3c: 10 fb bst r17, 0 14e3e: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 14e40: 81 ef ldi r24, 0xF1 ; 241 14e42: 94 e1 ldi r25, 0x14 ; 20 14e44: 0e 94 48 79 call 0xf290 ; 0xf290 lsDive("",root, NULL, LS_SerialPrint, params); 14e48: 83 e2 ldi r24, 0x23 ; 35 14e4a: e1 ef ldi r30, 0xF1 ; 241 14e4c: f4 e1 ldi r31, 0x14 ; 20 14e4e: de 01 movw r26, r28 14e50: 11 96 adiw r26, 0x01 ; 1 14e52: 01 90 ld r0, Z+ 14e54: 0d 92 st X+, r0 14e56: 8a 95 dec r24 14e58: e1 f7 brne .-8 ; 0x14e52 14e5a: 20 e0 ldi r18, 0x00 ; 0 14e5c: 50 e0 ldi r21, 0x00 ; 0 14e5e: 40 e0 ldi r20, 0x00 ; 0 14e60: be 01 movw r22, r28 14e62: 6f 5f subi r22, 0xFF ; 255 14e64: 7f 4f sbci r23, 0xFF ; 255 14e66: 81 ef ldi r24, 0xF1 ; 241 14e68: 92 e0 ldi r25, 0x02 ; 2 14e6a: 0f 94 ae 77 call 0x2ef5c ; 0x2ef5c 14e6e: ce 01 movw r24, r28 14e70: 01 96 adiw r24, 0x01 ; 1 14e72: 0e 94 4d 79 call 0xf29a ; 0xf29a SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14e76: 82 eb ldi r24, 0xB2 ; 178 14e78: 9a e6 ldi r25, 0x6A ; 106 14e7a: 0e 94 97 7b call 0xf72e ; 0xf72e 14e7e: e7 c5 rjmp .+3022 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14e80: 88 31 cpi r24, 0x18 ; 24 14e82: 91 05 cpc r25, r1 14e84: 09 f4 brne .+2 ; 0x14e88 14e86: a6 c6 rjmp .+3404 ; 0x15bd4 14e88: 84 f4 brge .+32 ; 0x14eaa 14e8a: 86 31 cpi r24, 0x16 ; 22 14e8c: 91 05 cpc r25, r1 14e8e: 09 f4 brne .+2 ; 0x14e92 14e90: 94 c6 rjmp .+3368 ; 0x15bba 14e92: 47 97 sbiw r24, 0x17 ; 23 14e94: 09 f0 breq .+2 ; 0x14e98 14e96: a2 cf rjmp .-188 ; 0x14ddc M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 14e98: 80 91 93 03 lds r24, 0x0393 ; 0x800393 14e9c: 90 91 94 03 lds r25, 0x0394 ; 0x800394 14ea0: 61 e0 ldi r22, 0x01 ; 1 14ea2: 04 96 adiw r24, 0x04 ; 4 14ea4: 0f 94 7c 7e call 0x2fcf8 ; 0x2fcf8 14ea8: d2 c5 rjmp .+2980 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14eaa: 8a 31 cpi r24, 0x1A ; 26 14eac: 91 05 cpc r25, r1 14eae: 09 f4 brne .+2 ; 0x14eb2 14eb0: d7 c6 rjmp .+3502 ; 0x15c60 14eb2: 0c f0 brlt .+2 ; 0x14eb6 14eb4: f7 c6 rjmp .+3566 ; 0x15ca4 14eb6: 0d ed ldi r16, 0xDD ; 221 14eb8: 12 e0 ldi r17, 0x02 ; 2 14eba: ff e3 ldi r31, 0x3F ; 63 14ebc: af 2e mov r10, r31 14ebe: f2 e0 ldi r31, 0x02 ; 2 14ec0: bf 2e mov r11, r31 14ec2: a1 e2 ldi r26, 0x21 ; 33 14ec4: ca 2e mov r12, r26 14ec6: a2 e0 ldi r26, 0x02 ; 2 14ec8: da 2e mov r13, r26 14eca: b5 e1 ldi r27, 0x15 ; 21 14ecc: eb 2e mov r14, r27 14ece: b2 e0 ldi r27, 0x02 ; 2 14ed0: 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])) { 14ed2: f8 01 movw r30, r16 14ed4: 81 91 ld r24, Z+ 14ed6: 8f 01 movw r16, r30 14ed8: 0e 94 0d 5d call 0xba1a ; 0xba1a 14edc: 88 23 and r24, r24 14ede: 21 f1 breq .+72 ; 0x14f28 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 14ee0: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 14ee4: d6 01 movw r26, r12 14ee6: 4d 90 ld r4, X+ 14ee8: 5d 90 ld r5, X+ 14eea: 6d 90 ld r6, X+ 14eec: 7c 90 ld r7, X 14eee: a3 01 movw r20, r6 14ef0: 92 01 movw r18, r4 14ef2: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 14ef6: 87 fd sbrc r24, 7 14ef8: 11 c0 rjmp .+34 ; 0x14f1c 14efa: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 14efe: f7 01 movw r30, r14 14f00: 40 80 ld r4, Z 14f02: 51 80 ldd r5, Z+1 ; 0x01 14f04: 62 80 ldd r6, Z+2 ; 0x02 14f06: 73 80 ldd r7, Z+3 ; 0x03 14f08: a3 01 movw r20, r6 14f0a: 92 01 movw r18, r4 14f0c: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 14f10: 18 16 cp r1, r24 14f12: 24 f0 brlt .+8 ; 0x14f1c 14f14: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 14f18: 2b 01 movw r4, r22 14f1a: 3c 01 movw r6, r24 14f1c: d5 01 movw r26, r10 14f1e: 4d 92 st X+, r4 14f20: 5d 92 st X+, r5 14f22: 6d 92 st X+, r6 14f24: 7c 92 st X, r7 14f26: 13 97 sbiw r26, 0x03 ; 3 14f28: b4 e0 ldi r27, 0x04 ; 4 14f2a: ab 0e add r10, r27 14f2c: b1 1c adc r11, r1 14f2e: e4 e0 ldi r30, 0x04 ; 4 14f30: ce 0e add r12, r30 14f32: d1 1c adc r13, r1 14f34: f4 e0 ldi r31, 0x04 ; 4 14f36: ef 0e add r14, r31 14f38: 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++) { 14f3a: 22 e0 ldi r18, 0x02 ; 2 14f3c: 00 3e cpi r16, 0xE0 ; 224 14f3e: 12 07 cpc r17, r18 14f40: 41 f6 brne .-112 ; 0x14ed2 //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')) { 14f42: 83 e5 ldi r24, 0x53 ; 83 14f44: 0e 94 0d 5d call 0xba1a ; 0xba1a 14f48: 88 23 and r24, r24 14f4a: 11 f4 brne .+4 ; 0x14f50 14f4c: 0c 94 5f c5 jmp 0x18abe ; 0x18abe if ( code_value_uint8() == 0 ) { 14f50: 0e 94 9f 5c call 0xb93e ; 0xb93e 14f54: 81 11 cpse r24, r1 14f56: 7b c5 rjmp .+2806 ; 0x15a4e pause_position[X_AXIS] = X_PAUSE_POS; 14f58: 80 e0 ldi r24, 0x00 ; 0 14f5a: 90 e0 ldi r25, 0x00 ; 0 14f5c: a8 e4 ldi r26, 0x48 ; 72 14f5e: b2 e4 ldi r27, 0x42 ; 66 14f60: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.494> 14f64: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.494+0x1> 14f68: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.494+0x2> 14f6c: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.494+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14f70: 80 e0 ldi r24, 0x00 ; 0 14f72: 90 e0 ldi r25, 0x00 ; 0 14f74: ae e3 ldi r26, 0x3E ; 62 14f76: b3 e4 ldi r27, 0x43 ; 67 14f78: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.494+0x4> 14f7c: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.494+0x5> 14f80: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.494+0x6> 14f84: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.494+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14f88: 80 e0 ldi r24, 0x00 ; 0 14f8a: 90 e0 ldi r25, 0x00 ; 0 14f8c: a0 ea ldi r26, 0xA0 ; 160 14f8e: b1 e4 ldi r27, 0x41 ; 65 14f90: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.494+0x8> 14f94: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.494+0x9> 14f98: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.494+0xa> 14f9c: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.494+0xb> 14fa0: 56 c5 rjmp .+2732 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14fa2: 8d 32 cpi r24, 0x2D ; 45 14fa4: 91 05 cpc r25, r1 14fa6: 09 f4 brne .+2 ; 0x14faa 14fa8: 8d c7 rjmp .+3866 ; 0x15ec4 14faa: 0c f0 brlt .+2 ; 0x14fae 14fac: e3 c0 rjmp .+454 ; 0x15174 14fae: 8f 31 cpi r24, 0x1F ; 31 14fb0: 91 05 cpc r25, r1 14fb2: 09 f4 brne .+2 ; 0x14fb6 14fb4: 14 c7 rjmp .+3624 ; 0x15dde 14fb6: 0c f0 brlt .+2 ; 0x14fba 14fb8: 63 c0 rjmp .+198 ; 0x15080 14fba: 8d 31 cpi r24, 0x1D ; 29 14fbc: 91 05 cpc r25, r1 14fbe: 09 f4 brne .+2 ; 0x14fc2 14fc0: 46 c5 rjmp .+2700 ; 0x15a4e 14fc2: 4e 97 sbiw r24, 0x1e ; 30 14fc4: 09 f0 breq .+2 ; 0x14fc8 14fc6: 0a cf rjmp .-492 ; 0x14ddc M30 [filename] */ case 30: if (card.mounted){ 14fc8: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 14fcc: 88 23 and r24, r24 14fce: 09 f4 brne .+2 ; 0x14fd2 14fd0: 3e c5 rjmp .+2684 ; 0x15a4e lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14fd2: 8b ef ldi r24, 0xFB ; 251 14fd4: 96 e1 ldi r25, 0x16 ; 22 14fd6: 0f 94 f5 6c call 0x2d9ea ; 0x2d9ea file.close(); 14fda: 8b ef ldi r24, 0xFB ; 251 14fdc: 96 e1 ldi r25, 0x16 ; 22 14fde: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 saving = false; 14fe2: 10 92 69 14 sts 0x1469, r1 ; 0x801469 logging = false; 14fe6: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a card.closefile(); card.removeFile(strchr_pointer + 4); 14fea: 00 91 93 03 lds r16, 0x0393 ; 0x800393 14fee: 10 91 94 03 lds r17, 0x0394 ; 0x800394 14ff2: 0c 5f subi r16, 0xFC ; 252 14ff4: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14ff6: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 14ffa: 88 23 and r24, r24 14ffc: 09 f4 brne .+2 ; 0x15000 14ffe: 27 c5 rjmp .+2638 ; 0x15a4e file.close(); 15000: 8b ef ldi r24, 0xFB ; 251 15002: 96 e1 ldi r25, 0x16 ; 22 15004: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 sdprinting = false; 15008: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b const char *fname=name; 1500c: 23 96 adiw r28, 0x03 ; 3 1500e: 1f af std Y+63, r17 ; 0x3f 15010: 0e af std Y+62, r16 ; 0x3e 15012: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 15014: ce 01 movw r24, r28 15016: 8f 5b subi r24, 0xBF ; 191 15018: 9f 4f sbci r25, 0xFF ; 255 1501a: 0f 94 f7 7d call 0x2fbee ; 0x2fbee 1501e: 88 23 and r24, r24 15020: 09 f4 brne .+2 ; 0x15024 15022: 15 c5 rjmp .+2602 ; 0x15a4e return; if (file.remove(curDir, fname)) 15024: 23 96 adiw r28, 0x03 ; 3 15026: 4e ad ldd r20, Y+62 ; 0x3e 15028: 5f ad ldd r21, Y+63 ; 0x3f 1502a: 23 97 sbiw r28, 0x03 ; 3 1502c: 60 91 14 15 lds r22, 0x1514 ; 0x801514 15030: 70 91 15 15 lds r23, 0x1515 ; 0x801515 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 15034: 19 82 std Y+1, r1 ; 0x01 15036: 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; 15038: 22 e0 ldi r18, 0x02 ; 2 1503a: ce 01 movw r24, r28 1503c: 01 96 adiw r24, 0x01 ; 1 1503e: 0f 94 bc d6 call 0x3ad78 ; 0x3ad78 15042: 81 11 cpse r24, r1 15044: a5 c6 rjmp .+3402 ; 0x15d90 return file.remove(); fail: // can't set iostate - static function return false; 15046: 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; 15048: ce 01 movw r24, r28 1504a: 01 96 adiw r24, 0x01 ; 1 1504c: 0e 94 4d 79 call 0xf29a ; 0xf29a 15050: 11 23 and r17, r17 15052: 09 f4 brne .+2 ; 0x15056 15054: b4 c6 rjmp .+3432 ; 0x15dbe { SERIAL_PROTOCOLPGM("File deleted:"); 15056: 84 ea ldi r24, 0xA4 ; 164 15058: 96 e8 ldi r25, 0x86 ; 134 1505a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLLN(fname); 1505e: 23 96 adiw r28, 0x03 ; 3 15060: 8e ad ldd r24, Y+62 ; 0x3e 15062: 9f ad ldd r25, Y+63 ; 0x3f 15064: 23 97 sbiw r28, 0x03 ; 3 15066: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 sdpos = 0; 1506a: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 1506e: 10 92 80 17 sts 0x1780, r1 ; 0x801780 15072: 10 92 81 17 sts 0x1781, r1 ; 0x801781 15076: 10 92 82 17 sts 0x1782, r1 ; 0x801782 #ifdef SDCARD_SORT_ALPHA presort(); 1507a: 0f 94 c3 7b call 0x2f786 ; 0x2f786 1507e: e7 c4 rjmp .+2510 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15080: 8a 32 cpi r24, 0x2A ; 42 15082: 91 05 cpc r25, r1 15084: 09 f4 brne .+2 ; 0x15088 15086: d2 c6 rjmp .+3492 ; 0x15e2c 15088: 8c 32 cpi r24, 0x2C ; 44 1508a: 91 05 cpc r25, r1 1508c: 09 f4 brne .+2 ; 0x15090 1508e: 01 c7 rjmp .+3586 ; 0x15e92 15090: 80 97 sbiw r24, 0x20 ; 32 15092: 09 f0 breq .+2 ; 0x15096 15094: a3 ce rjmp .-698 ; 0x14ddc - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 15096: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 1509a: 81 11 cpse r24, r1 st_synchronize(); 1509c: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 150a0: 00 91 93 03 lds r16, 0x0393 ; 0x800393 150a4: 10 91 94 03 lds r17, 0x0394 ; 0x800394 150a8: 0c 5f subi r16, 0xFC ; 252 150aa: 1f 4f sbci r17, 0xFF ; 255 150ac: 61 e2 ldi r22, 0x21 ; 33 150ae: 70 e0 ldi r23, 0x00 ; 0 150b0: c8 01 movw r24, r16 150b2: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc if(namestartpos==NULL) 150b6: 00 97 sbiw r24, 0x00 ; 0 150b8: 19 f0 breq .+6 ; 0x150c0 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 150ba: 8c 01 movw r16, r24 150bc: 0f 5f subi r16, 0xFF ; 255 150be: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 150c0: 80 e5 ldi r24, 0x50 ; 80 150c2: 0e 94 0d 5d call 0xba1a ; 0xba1a 150c6: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 150c8: 80 91 93 03 lds r24, 0x0393 ; 0x800393 150cc: 90 91 94 03 lds r25, 0x0394 ; 0x800394 150d0: 08 17 cp r16, r24 150d2: 19 07 cpc r17, r25 150d4: 08 f4 brcc .+2 ; 0x150d8 call_procedure=false; //false alert, 'P' found within filename 150d6: f1 2c mov r15, r1 if( card.mounted ) 150d8: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 150dc: 88 23 and r24, r24 150de: 09 f4 brne .+2 ; 0x150e2 150e0: b6 c4 rjmp .+2412 ; 0x15a4e { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 150e2: 61 e0 ldi r22, 0x01 ; 1 150e4: 6f 25 eor r22, r15 150e6: c8 01 movw r24, r16 150e8: 0f 94 7c 7e call 0x2fcf8 ; 0x2fcf8 if(code_seen('S')) 150ec: 83 e5 ldi r24, 0x53 ; 83 150ee: 0e 94 0d 5d call 0xba1a ; 0xba1a 150f2: 88 23 and r24, r24 150f4: 99 f0 breq .+38 ; 0x1511c if(strchr_pointer 150fa: 90 91 94 03 lds r25, 0x0394 ; 0x800394 150fe: 80 17 cp r24, r16 15100: 91 07 cpc r25, r17 15102: 60 f4 brcc .+24 ; 0x1511c card.setIndex(code_value_long()); 15104: 0e 94 b9 5c call 0xb972 ; 0xb972 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 15108: 60 93 7f 17 sts 0x177F, r22 ; 0x80177f 1510c: 70 93 80 17 sts 0x1780, r23 ; 0x801780 15110: 80 93 81 17 sts 0x1781, r24 ; 0x801781 15114: 90 93 82 17 sts 0x1782, r25 ; 0x801782 15118: 0f 94 3b 76 call 0x2ec76 ; 0x2ec76 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 1511c: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 15120: 88 23 and r24, r24 15122: 31 f0 breq .+12 ; 0x15130 { sdprinting = true; 15124: 81 e0 ldi r24, 0x01 ; 1 15126: 80 93 6b 14 sts 0x146B, r24 ; 0x80146b 1512a: 85 e0 ldi r24, 0x05 ; 5 1512c: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> card.startFileprint(); if(!call_procedure) 15130: f1 10 cpse r15, r1 15132: 8d c4 rjmp .+2330 ; 0x15a4e 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); }; 15134: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 15138: 88 23 and r24, r24 1513a: 61 f0 breq .+24 ; 0x15154 { if(!card.get_sdpos()) 1513c: 80 91 7f 17 lds r24, 0x177F ; 0x80177f 15140: 90 91 80 17 lds r25, 0x1780 ; 0x801780 15144: a0 91 81 17 lds r26, 0x1781 ; 0x801781 15148: b0 91 82 17 lds r27, 0x1782 ; 0x801782 1514c: 89 2b or r24, r25 1514e: 8a 2b or r24, r26 15150: 8b 2b or r24, r27 15152: 69 f4 brne .+26 ; 0x1516e { // A new print has started from scratch, reset stats failstats_reset_print(); 15154: 0e 94 5b 5d call 0xbab6 ; 0xbab6 sdpos_atomic = 0; 15158: 10 92 80 03 sts 0x0380, r1 ; 0x800380 1515c: 10 92 81 03 sts 0x0381, r1 ; 0x800381 15160: 10 92 82 03 sts 0x0382, r1 ; 0x800382 15164: 10 92 83 03 sts 0x0383, r1 ; 0x800383 15168: 80 e0 ldi r24, 0x00 ; 0 1516a: 0e 94 d3 83 call 0x107a6 ; 0x107a6 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 1516e: 0f 94 80 57 call 0x2af00 ; 0x2af00 15172: 6d c4 rjmp .+2266 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15174: 89 34 cpi r24, 0x49 ; 73 15176: 91 05 cpc r25, r1 15178: 09 f4 brne .+2 ; 0x1517c 1517a: e8 c6 rjmp .+3536 ; 0x15f4c 1517c: cc f4 brge .+50 ; 0x151b0 1517e: 8e 32 cpi r24, 0x2E ; 46 15180: 91 05 cpc r25, r1 15182: 09 f4 brne .+2 ; 0x15186 15184: a5 c6 rjmp .+3402 ; 0x15ed0 15186: 88 34 cpi r24, 0x48 ; 72 15188: 91 05 cpc r25, r1 1518a: 09 f0 breq .+2 ; 0x1518e 1518c: 27 ce rjmp .-946 ; 0x14ddc #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 1518e: 83 e5 ldi r24, 0x53 ; 83 15190: 0e 94 0d 5d call 0xba1a ; 0xba1a 15194: 88 23 and r24, r24 15196: 09 f4 brne .+2 ; 0x1519a 15198: ca c6 rjmp .+3476 ; 0x15f2e switch (code_value_uint8()){ 1519a: 0e 94 9f 5c call 0xb93e ; 0xb93e 1519e: 88 23 and r24, r24 151a0: 09 f4 brne .+2 ; 0x151a4 151a2: c2 c6 rjmp .+3460 ; 0x15f28 151a4: 81 30 cpi r24, 0x01 ; 1 151a6: 09 f0 breq .+2 ; 0x151aa 151a8: 52 c4 rjmp .+2212 ; 0x15a4e 151aa: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 151ae: 4f c4 rjmp .+2206 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151b0: 8c 34 cpi r24, 0x4C ; 76 151b2: 91 05 cpc r25, r1 151b4: 09 f4 brne .+2 ; 0x151b8 151b6: 6a c7 rjmp .+3796 ; 0x1608c 151b8: 0c f0 brlt .+2 ; 0x151bc 151ba: 7b c7 rjmp .+3830 ; 0x160b2 151bc: 8b 34 cpi r24, 0x4B ; 75 151be: 91 05 cpc r25, r1 151c0: 09 f0 breq .+2 ; 0x151c4 151c2: 0c ce rjmp .-1000 ; 0x14ddc /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 151c4: 0f 94 49 15 call 0x22a92 ; 0x22a92 151c8: 88 23 and r24, r24 151ca: 09 f4 brne .+2 ; 0x151ce 151cc: 40 c4 rjmp .+2176 ; 0x15a4e 151ce: cf cf rjmp .-98 ; 0x1516e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151d0: 8e 36 cpi r24, 0x6E ; 110 151d2: 91 05 cpc r25, r1 151d4: 11 f4 brne .+4 ; 0x151da 151d6: 0c 94 b6 b2 jmp 0x1656c ; 0x1656c 151da: 0c f0 brlt .+2 ; 0x151de 151dc: 7d c0 rjmp .+250 ; 0x152d8 151de: 86 35 cpi r24, 0x56 ; 86 151e0: 91 05 cpc r25, r1 151e2: 11 f4 brne .+4 ; 0x151e8 151e4: 0c 94 11 b2 jmp 0x16422 ; 0x16422 151e8: b4 f5 brge .+108 ; 0x15256 151ea: 83 35 cpi r24, 0x53 ; 83 151ec: 91 05 cpc r25, r1 151ee: 11 f4 brne .+4 ; 0x151f4 151f0: 0c 94 bb b1 jmp 0x16376 ; 0x16376 151f4: 74 f4 brge .+28 ; 0x15212 151f6: 8f 34 cpi r24, 0x4F ; 79 151f8: 91 05 cpc r25, r1 151fa: 09 f4 brne .+2 ; 0x151fe 151fc: 7a c7 rjmp .+3828 ; 0x160f2 151fe: 82 35 cpi r24, 0x52 ; 82 15200: 91 05 cpc r25, r1 15202: 09 f0 breq .+2 ; 0x15206 15204: eb cd rjmp .-1066 ; 0x14ddc /*! ### 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; 15206: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 1520a: 87 7f andi r24, 0xF7 ; 247 1520c: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd 15210: 1e c4 rjmp .+2108 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15212: 84 35 cpi r24, 0x54 ; 84 15214: 91 05 cpc r25, r1 15216: 11 f4 brne .+4 ; 0x1521c 15218: 0c 94 c1 b1 jmp 0x16382 ; 0x16382 1521c: 85 35 cpi r24, 0x55 ; 85 1521e: 91 05 cpc r25, r1 15220: 09 f0 breq .+2 ; 0x15224 15222: dc cd rjmp .-1096 ; 0x14ddc #### 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')) { 15224: 83 e5 ldi r24, 0x53 ; 83 15226: 0e 94 0d 5d call 0xba1a ; 0xba1a 1522a: 88 23 and r24, r24 1522c: 09 f4 brne .+2 ; 0x15230 1522e: 0f c4 rjmp .+2078 ; 0x15a4e max_inactive_time = code_value() * 1000; 15230: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15234: 20 e0 ldi r18, 0x00 ; 0 15236: 30 e0 ldi r19, 0x00 ; 0 15238: 4a e7 ldi r20, 0x7A ; 122 1523a: 54 e4 ldi r21, 0x44 ; 68 1523c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 15240: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 15244: 60 93 7c 03 sts 0x037C, r22 ; 0x80037c 15248: 70 93 7d 03 sts 0x037D, r23 ; 0x80037d 1524c: 80 93 7e 03 sts 0x037E, r24 ; 0x80037e 15250: 90 93 7f 03 sts 0x037F, r25 ; 0x80037f 15254: fc c3 rjmp .+2040 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15256: 89 36 cpi r24, 0x69 ; 105 15258: 91 05 cpc r25, r1 1525a: 09 f4 brne .+2 ; 0x1525e 1525c: a6 c7 rjmp .+3916 ; 0x161aa 1525e: c4 f4 brge .+48 ; 0x15290 15260: 8c 35 cpi r24, 0x5C ; 92 15262: 91 05 cpc r25, r1 15264: 11 f4 brne .+4 ; 0x1526a 15266: 0c 94 2e b2 jmp 0x1645c ; 0x1645c 1526a: 88 36 cpi r24, 0x68 ; 104 1526c: 91 05 cpc r25, r1 1526e: 09 f0 breq .+2 ; 0x15272 15270: b5 cd rjmp .-1174 ; 0x14ddc #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 15272: 83 e5 ldi r24, 0x53 ; 83 15274: 0e 94 0d 5d call 0xba1a ; 0xba1a 15278: 88 23 and r24, r24 1527a: 09 f4 brne .+2 ; 0x1527e 1527c: e8 c3 rjmp .+2000 ; 0x15a4e { setTargetHotend(code_value()); 1527e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 15282: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 15286: 70 93 6b 0e sts 0x0E6B, r23 ; 0x800e6b 1528a: 60 93 6a 0e sts 0x0E6A, r22 ; 0x800e6a 1528e: df c3 rjmp .+1982 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15290: 8b 36 cpi r24, 0x6B ; 107 15292: 91 05 cpc r25, r1 15294: 11 f4 brne .+4 ; 0x1529a 15296: 0c 94 b8 b1 jmp 0x16370 ; 0x16370 1529a: 14 f4 brge .+4 ; 0x152a0 1529c: 0c 94 aa b1 jmp 0x16354 ; 0x16354 152a0: 8d 36 cpi r24, 0x6D ; 109 152a2: 91 05 cpc r25, r1 152a4: 09 f0 breq .+2 ; 0x152a8 152a6: 9a cd rjmp .-1228 ; 0x14ddc 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)); 152a8: 83 ec ldi r24, 0xC3 ; 195 152aa: 9a e4 ldi r25, 0x4A ; 74 152ac: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 152b0: 0f 94 e0 0a call 0x215c0 ; 0x215c0 heating_status = HeatingStatus::EXTRUDER_HEATING; 152b4: 81 e0 ldi r24, 0x01 ; 1 152b6: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 152ba: 83 e5 ldi r24, 0x53 ; 83 152bc: 0e 94 0d 5d call 0xba1a ; 0xba1a 152c0: 88 23 and r24, r24 152c2: 09 f4 brne .+2 ; 0x152c6 152c4: 85 c7 rjmp .+3850 ; 0x161d0 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 152c6: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 152ca: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 152ce: 70 93 6b 0e sts 0x0E6B, r23 ; 0x800e6b 152d2: 60 93 6a 0e sts 0x0E6A, r22 ; 0x800e6a 152d6: 81 c7 rjmp .+3842 ; 0x161da } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 152d8: 87 37 cpi r24, 0x77 ; 119 152da: 91 05 cpc r25, r1 152dc: 11 f4 brne .+4 ; 0x152e2 152de: 0c 94 fb b3 jmp 0x167f6 ; 0x167f6 152e2: 94 f5 brge .+100 ; 0x15348 152e4: 82 37 cpi r24, 0x72 ; 114 152e6: 91 05 cpc r25, r1 152e8: 11 f4 brne .+4 ; 0x152ee 152ea: 0c 94 b0 b3 jmp 0x16760 ; 0x16760 152ee: a4 f4 brge .+40 ; 0x15318 152f0: 80 37 cpi r24, 0x70 ; 112 152f2: 91 05 cpc r25, r1 152f4: 09 f4 brne .+2 ; 0x152f8 152f6: 46 c7 rjmp .+3724 ; 0x16184 152f8: 81 37 cpi r24, 0x71 ; 113 152fa: 91 05 cpc r25, r1 152fc: 09 f0 breq .+2 ; 0x15300 152fe: 6e cd rjmp .-1316 ; 0x14ddc #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 15300: 83 e5 ldi r24, 0x53 ; 83 15302: 0e 94 0d 5d call 0xba1a ; 0xba1a 15306: 88 23 and r24, r24 15308: 11 f4 brne .+4 ; 0x1530e 1530a: 0c 94 c7 b2 jmp 0x1658e ; 0x1658e host_keepalive_interval = code_value_uint8(); 1530e: 0e 94 9f 5c call 0xb93e ; 0xb93e 15312: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 15316: 9b c3 rjmp .+1846 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15318: 85 37 cpi r24, 0x75 ; 117 1531a: 91 05 cpc r25, r1 1531c: 11 f4 brne .+4 ; 0x15322 1531e: 0c 94 b3 b3 jmp 0x16766 ; 0x16766 15322: 14 f0 brlt .+4 ; 0x15328 15324: 0c 94 c3 b3 jmp 0x16786 ; 0x16786 15328: 83 37 cpi r24, 0x73 ; 115 1532a: 91 05 cpc r25, r1 1532c: 09 f0 breq .+2 ; 0x15330 1532e: 56 cd rjmp .-1364 ; 0x14ddc #### 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')) { 15330: 86 e5 ldi r24, 0x56 ; 86 15332: 0e 94 0d 5d call 0xba1a ; 0xba1a 15336: 88 23 and r24, r24 15338: 11 f4 brne .+4 ; 0x1533e 1533a: 0c 94 dc b2 jmp 0x165b8 ; 0x165b8 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 1533e: 85 e8 ldi r24, 0x85 ; 133 15340: 96 e8 ldi r25, 0x86 ; 134 15342: 0e 94 97 7b call 0xf72e ; 0xf72e 15346: 83 c3 rjmp .+1798 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15348: 8c 38 cpi r24, 0x8C ; 140 1534a: 91 05 cpc r25, r1 1534c: 09 f4 brne .+2 ; 0x15350 1534e: 1e c7 rjmp .+3644 ; 0x1618c 15350: 54 f4 brge .+20 ; 0x15366 15352: 8b 37 cpi r24, 0x7B ; 123 15354: 91 05 cpc r25, r1 15356: 11 f4 brne .+4 ; 0x1535c 15358: 0c 94 60 b4 jmp 0x168c0 ; 0x168c0 1535c: 8d 37 cpi r24, 0x7D ; 125 1535e: 91 05 cpc r25, r1 15360: 09 f4 brne .+2 ; 0x15364 15362: a9 cd rjmp .-1198 ; 0x14eb6 15364: 3b cd rjmp .-1418 ; 0x14ddc 15366: 8e 3b cpi r24, 0xBE ; 190 15368: 91 05 cpc r25, r1 1536a: 09 f4 brne .+2 ; 0x1536e 1536c: 66 c7 rjmp .+3788 ; 0x1623a 1536e: 88 3c cpi r24, 0xC8 ; 200 15370: 91 05 cpc r25, r1 15372: 11 f4 brne .+4 ; 0x15378 15374: 0c 94 63 b4 jmp 0x168c6 ; 0x168c6 15378: 8b 39 cpi r24, 0x9B ; 155 1537a: 91 05 cpc r25, r1 1537c: 09 f0 breq .+2 ; 0x15380 1537e: 2e cd rjmp .-1444 ; 0x14ddc bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 15380: 83 e5 ldi r24, 0x53 ; 83 15382: 0e 94 0d 5d call 0xba1a ; 0xba1a 15386: 88 23 and r24, r24 15388: 59 f0 breq .+22 ; 0x153a0 autoReportFeatures.SetPeriod( code_value_uint8() ); 1538a: 0e 94 9f 5c call 0xb93e ; 0xb93e 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; 1538e: 80 93 63 14 sts 0x1463, r24 ; 0x801463 if (auto_report_period != 0){ 15392: 88 23 and r24, r24 15394: 09 f4 brne .+2 ; 0x15398 15396: 15 c7 rjmp .+3626 ; 0x161c2 auto_report_timer.start(); 15398: 84 e6 ldi r24, 0x64 ; 100 1539a: 94 e1 ldi r25, 0x14 ; 20 1539c: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 153a0: 83 e4 ldi r24, 0x43 ; 67 153a2: 0e 94 0d 5d call 0xba1a ; 0xba1a 153a6: 88 23 and r24, r24 153a8: 09 f4 brne .+2 ; 0x153ac 153aa: 0e c7 rjmp .+3612 ; 0x161c8 autoReportFeatures.SetMask(code_value_uint8()); 153ac: 0e 94 9f 5c call 0xb93e ; 0xb93e 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; } 153b0: 80 93 62 14 sts 0x1462, r24 ; 0x801462 153b4: 4c c3 rjmp .+1688 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 153b6: 86 3f cpi r24, 0xF6 ; 246 153b8: f1 e0 ldi r31, 0x01 ; 1 153ba: 9f 07 cpc r25, r31 153bc: 11 f4 brne .+4 ; 0x153c2 153be: 0c 94 1a be jmp 0x17c34 ; 0x17c34 153c2: 0c f0 brlt .+2 ; 0x153c6 153c4: f7 c1 rjmp .+1006 ; 0x157b4 153c6: 8c 32 cpi r24, 0x2C ; 44 153c8: 31 e0 ldi r19, 0x01 ; 1 153ca: 93 07 cpc r25, r19 153cc: 11 f4 brne .+4 ; 0x153d2 153ce: 0c 94 26 b7 jmp 0x16e4c ; 0x16e4c 153d2: 0c f0 brlt .+2 ; 0x153d6 153d4: 1b c1 rjmp .+566 ; 0x1560c 153d6: 80 3d cpi r24, 0xD0 ; 208 153d8: 91 05 cpc r25, r1 153da: 11 f4 brne .+4 ; 0x153e0 153dc: 0c 94 15 b6 jmp 0x16c2a ; 0x16c2a 153e0: 0c f0 brlt .+2 ; 0x153e4 153e2: 73 c0 rjmp .+230 ; 0x154ca 153e4: 8d 3c cpi r24, 0xCD ; 205 153e6: 91 05 cpc r25, r1 153e8: 11 f4 brne .+4 ; 0x153ee 153ea: 0c 94 7c b5 jmp 0x16af8 ; 0x16af8 153ee: 9c f5 brge .+102 ; 0x15456 153f0: 8b 3c cpi r24, 0xCB ; 203 153f2: 91 05 cpc r25, r1 153f4: 11 f4 brne .+4 ; 0x153fa 153f6: 0c 94 f3 b4 jmp 0x169e6 ; 0x169e6 153fa: 8c 3c cpi r24, 0xCC ; 204 153fc: 91 05 cpc r25, r1 153fe: 09 f0 breq .+2 ; 0x15402 15400: ed cc rjmp .-1574 ; 0x14ddc - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 15402: 83 e5 ldi r24, 0x53 ; 83 15404: 0e 94 0d 5d call 0xba1a ; 0xba1a 15408: 88 23 and r24, r24 1540a: 11 f4 brne .+4 ; 0x15410 1540c: 0c 94 4b b5 jmp 0x16a96 ; 0x16a96 // 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(); 15410: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15414: 60 93 2b 07 sts 0x072B, r22 ; 0x80072b 15418: 70 93 2c 07 sts 0x072C, r23 ; 0x80072c 1541c: 80 93 2d 07 sts 0x072D, r24 ; 0x80072d 15420: 90 93 2e 07 sts 0x072E, r25 ; 0x80072e 15424: 60 93 9f 06 sts 0x069F, r22 ; 0x80069f 15428: 70 93 a0 06 sts 0x06A0, r23 ; 0x8006a0 1542c: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 15430: 90 93 a2 06 sts 0x06A2, r25 ; 0x8006a2 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 15434: 84 e5 ldi r24, 0x54 ; 84 15436: 0e 94 0d 5d call 0xba1a ; 0xba1a 1543a: 88 23 and r24, r24 1543c: 09 f4 brne .+2 ; 0x15440 1543e: 07 c3 rjmp .+1550 ; 0x15a4e cs.retract_acceleration = code_value(); 15440: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15444: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 15448: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 1544c: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 15450: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 15454: fc c2 rjmp .+1528 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15456: 8e 3c cpi r24, 0xCE ; 206 15458: 91 05 cpc r25, r1 1545a: 11 f4 brne .+4 ; 0x15460 1545c: 0c 94 f5 b5 jmp 0x16bea ; 0x16bea 15460: 8f 3c cpi r24, 0xCF ; 207 15462: 91 05 cpc r25, r1 15464: 09 f0 breq .+2 ; 0x15468 15466: ba cc rjmp .-1676 ; 0x14ddc - `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')) 15468: 83 e5 ldi r24, 0x53 ; 83 1546a: 0e 94 0d 5d call 0xba1a ; 0xba1a 1546e: 88 23 and r24, r24 15470: 51 f0 breq .+20 ; 0x15486 { cs.retract_length = code_value() ; 15472: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15476: 60 93 ee 06 sts 0x06EE, r22 ; 0x8006ee 1547a: 70 93 ef 06 sts 0x06EF, r23 ; 0x8006ef 1547e: 80 93 f0 06 sts 0x06F0, r24 ; 0x8006f0 15482: 90 93 f1 06 sts 0x06F1, r25 ; 0x8006f1 } if(code_seen('F')) 15486: 86 e4 ldi r24, 0x46 ; 70 15488: 0e 94 0d 5d call 0xba1a ; 0xba1a 1548c: 88 23 and r24, r24 1548e: 61 f0 breq .+24 ; 0x154a8 { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 15490: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15494: 0e 94 0d 68 call 0xd01a ; 0xd01a 15498: 60 93 f2 06 sts 0x06F2, r22 ; 0x8006f2 1549c: 70 93 f3 06 sts 0x06F3, r23 ; 0x8006f3 154a0: 80 93 f4 06 sts 0x06F4, r24 ; 0x8006f4 154a4: 90 93 f5 06 sts 0x06F5, r25 ; 0x8006f5 } if(code_seen('Z')) 154a8: 8a e5 ldi r24, 0x5A ; 90 154aa: 0e 94 0d 5d call 0xba1a ; 0xba1a 154ae: 88 23 and r24, r24 154b0: 09 f4 brne .+2 ; 0x154b4 154b2: cd c2 rjmp .+1434 ; 0x15a4e { cs.retract_zlift = code_value() ; 154b4: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 154b8: 60 93 f6 06 sts 0x06F6, r22 ; 0x8006f6 154bc: 70 93 f7 06 sts 0x06F7, r23 ; 0x8006f7 154c0: 80 93 f8 06 sts 0x06F8, r24 ; 0x8006f8 154c4: 90 93 f9 06 sts 0x06F9, r25 ; 0x8006f9 154c8: c2 c2 rjmp .+1412 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 154ca: 8c 3d cpi r24, 0xDC ; 220 154cc: 91 05 cpc r25, r1 154ce: 11 f4 brne .+4 ; 0x154d4 154d0: 0c 94 7c b6 jmp 0x16cf8 ; 0x16cf8 154d4: 0c f0 brlt .+2 ; 0x154d8 154d6: 7d c0 rjmp .+250 ; 0x155d2 154d8: 81 3d cpi r24, 0xD1 ; 209 154da: 91 05 cpc r25, r1 154dc: 11 f4 brne .+4 ; 0x154e2 154de: 0c 94 39 b6 jmp 0x16c72 ; 0x16c72 154e2: 86 3d cpi r24, 0xD6 ; 214 154e4: 91 05 cpc r25, r1 154e6: 09 f0 breq .+2 ; 0x154ea 154e8: 79 cc rjmp .-1806 ; 0x14ddc 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; 154ea: 80 e5 ldi r24, 0x50 ; 80 154ec: 0e 94 0d 5d call 0xba1a ; 0xba1a 154f0: 88 23 and r24, r24 154f2: 11 f4 brne .+4 ; 0x154f8 154f4: 0c 94 68 b6 jmp 0x16cd0 ; 0x16cd0 154f8: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 154fc: 2b 01 movw r4, r22 154fe: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 15500: 83 e5 ldi r24, 0x53 ; 83 15502: 0e 94 0d 5d call 0xba1a ; 0xba1a 15506: 88 23 and r24, r24 15508: 11 f4 brne .+4 ; 0x1550e 1550a: 0c 94 72 b6 jmp 0x16ce4 ; 0x16ce4 1550e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15512: 4b 01 movw r8, r22 15514: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 15516: 8e e4 ldi r24, 0x4E ; 78 15518: 0e 94 0d 5d call 0xba1a ; 0xba1a 1551c: d0 90 37 07 lds r13, 0x0737 ; 0x800737 15520: 88 23 and r24, r24 15522: 29 f0 breq .+10 ; 0x1552e 15524: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15528: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 1552c: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 1552e: 82 e5 ldi r24, 0x52 ; 82 15530: 0e 94 0d 5d call 0xba1a ; 0xba1a 15534: e0 90 38 07 lds r14, 0x0738 ; 0x800738 15538: f0 90 39 07 lds r15, 0x0739 ; 0x800739 1553c: 88 23 and r24, r24 1553e: 29 f0 breq .+10 ; 0x1554a 15540: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15544: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 15548: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 1554a: 86 e4 ldi r24, 0x46 ; 70 1554c: 0e 94 0d 5d call 0xba1a ; 0xba1a 15550: 00 91 3a 07 lds r16, 0x073A ; 0x80073a 15554: 10 91 3b 07 lds r17, 0x073B ; 0x80073b 15558: 88 23 and r24, r24 1555a: 29 f0 breq .+10 ; 0x15566 1555c: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15560: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 15564: 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) 15566: 20 e0 ldi r18, 0x00 ; 0 15568: 30 e0 ldi r19, 0x00 ; 0 1556a: a9 01 movw r20, r18 1556c: c3 01 movw r24, r6 1556e: b2 01 movw r22, r4 15570: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 15574: 18 16 cp r1, r24 15576: 0c f0 brlt .+2 ; 0x1557a 15578: 6a c2 rjmp .+1236 ; 0x15a4e 1557a: 20 e0 ldi r18, 0x00 ; 0 1557c: 30 e0 ldi r19, 0x00 ; 0 1557e: a9 01 movw r20, r18 15580: c5 01 movw r24, r10 15582: b4 01 movw r22, r8 15584: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 15588: 87 fd sbrc r24, 7 1558a: 61 c2 rjmp .+1218 ; 0x15a4e 1558c: a5 01 movw r20, r10 1558e: 94 01 movw r18, r8 15590: c3 01 movw r24, r6 15592: b2 01 movw r22, r4 15594: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 15598: 87 fd sbrc r24, 7 1559a: 59 c2 rjmp .+1202 ; 0x15a4e { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 1559c: 40 92 2f 07 sts 0x072F, r4 ; 0x80072f 155a0: 50 92 30 07 sts 0x0730, r5 ; 0x800730 155a4: 60 92 31 07 sts 0x0731, r6 ; 0x800731 155a8: 70 92 32 07 sts 0x0732, r7 ; 0x800732 cs.min_mm_per_arc_segment = s; 155ac: 80 92 33 07 sts 0x0733, r8 ; 0x800733 155b0: 90 92 34 07 sts 0x0734, r9 ; 0x800734 155b4: a0 92 35 07 sts 0x0735, r10 ; 0x800735 155b8: b0 92 36 07 sts 0x0736, r11 ; 0x800736 cs.n_arc_correction = n; 155bc: d0 92 37 07 sts 0x0737, r13 ; 0x800737 cs.min_arc_segments = r; 155c0: f0 92 39 07 sts 0x0739, r15 ; 0x800739 155c4: e0 92 38 07 sts 0x0738, r14 ; 0x800738 cs.arc_segments_per_sec = f; 155c8: 10 93 3b 07 sts 0x073B, r17 ; 0x80073b 155cc: 00 93 3a 07 sts 0x073A, r16 ; 0x80073a 155d0: 3e c2 rjmp .+1148 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 155d2: 82 3e cpi r24, 0xE2 ; 226 155d4: 91 05 cpc r25, r1 155d6: 11 f4 brne .+4 ; 0x155dc 155d8: 0c 94 cd b6 jmp 0x16d9a ; 0x16d9a 155dc: 80 3f cpi r24, 0xF0 ; 240 155de: 91 05 cpc r25, r1 155e0: 09 f4 brne .+2 ; 0x155e4 155e2: 35 c2 rjmp .+1130 ; 0x15a4e 155e4: 8d 3d cpi r24, 0xDD ; 221 155e6: 91 05 cpc r25, r1 155e8: 09 f0 breq .+2 ; 0x155ec 155ea: f8 cb rjmp .-2064 ; 0x14ddc #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 155ec: 83 e5 ldi r24, 0x53 ; 83 155ee: 0e 94 0d 5d call 0xba1a ; 0xba1a 155f2: 88 23 and r24, r24 155f4: 11 f4 brne .+4 ; 0x155fa 155f6: 0c 94 bb b6 jmp 0x16d76 ; 0x16d76 { extrudemultiply = code_value_short(); 155fa: 0e 94 ac 5c call 0xb958 ; 0xb958 155fe: 90 93 95 02 sts 0x0295, r25 ; 0x800295 15602: 80 93 94 02 sts 0x0294, r24 ; 0x800294 calculate_extruder_multipliers(); 15606: 0e 94 ff 66 call 0xcdfe ; 0xcdfe 1560a: 21 c2 rjmp .+1090 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1560c: 80 39 cpi r24, 0x90 ; 144 1560e: 51 e0 ldi r21, 0x01 ; 1 15610: 95 07 cpc r25, r21 15612: 11 f4 brne .+4 ; 0x15618 15614: 0c 94 eb bd jmp 0x17bd6 ; 0x17bd6 15618: 0c f0 brlt .+2 ; 0x1561c 1561a: a7 c0 rjmp .+334 ; 0x1576a 1561c: 8f 32 cpi r24, 0x2F ; 47 1561e: b1 e0 ldi r27, 0x01 ; 1 15620: 9b 07 cpc r25, r27 15622: 11 f4 brne .+4 ; 0x15628 15624: 0c 94 ca b7 jmp 0x16f94 ; 0x16f94 15628: c4 f4 brge .+48 ; 0x1565a 1562a: 8d 32 cpi r24, 0x2D ; 45 1562c: f1 e0 ldi r31, 0x01 ; 1 1562e: 9f 07 cpc r25, r31 15630: 11 f4 brne .+4 ; 0x15636 15632: 0c 94 4d b7 jmp 0x16e9a ; 0x16e9a 15636: 8e 32 cpi r24, 0x2E ; 46 15638: 91 40 sbci r25, 0x01 ; 1 1563a: 09 f0 breq .+2 ; 0x1563e 1563c: cf cb rjmp .-2146 ; 0x14ddc - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 1563e: 83 e5 ldi r24, 0x53 ; 83 15640: 0e 94 0d 5d call 0xba1a ; 0xba1a 15644: 88 23 and r24, r24 15646: 11 f4 brne .+4 ; 0x1564c 15648: 0c 94 c6 b7 jmp 0x16f8c ; 0x16f8c 1564c: 0e 94 ac 5c call 0xb958 ; 0xb958 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 15650: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 15654: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 15658: fa c1 rjmp .+1012 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1565a: 86 33 cpi r24, 0x36 ; 54 1565c: 31 e0 ldi r19, 0x01 ; 1 1565e: 93 07 cpc r25, r19 15660: 11 f4 brne .+4 ; 0x15666 15662: 0c 94 fd b7 jmp 0x16ffa ; 0x16ffa 15666: 8e 35 cpi r24, 0x5E ; 94 15668: 41 e0 ldi r20, 0x01 ; 1 1566a: 94 07 cpc r25, r20 1566c: 11 f4 brne .+4 ; 0x15672 1566e: 0c 94 f3 ca jmp 0x195e6 ; 0x195e6 15672: 80 33 cpi r24, 0x30 ; 48 15674: 91 40 sbci r25, 0x01 ; 1 15676: 09 f0 breq .+2 ; 0x1567a 15678: b1 cb rjmp .-2206 ; 0x14ddc - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 1567a: 80 e5 ldi r24, 0x50 ; 80 1567c: 0e 94 0d 5d call 0xba1a ; 0xba1a 15680: 88 23 and r24, r24 15682: 51 f0 breq .+20 ; 0x15698 15684: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15688: 60 93 df 06 sts 0x06DF, r22 ; 0x8006df 1568c: 70 93 e0 06 sts 0x06E0, r23 ; 0x8006e0 15690: 80 93 e1 06 sts 0x06E1, r24 ; 0x8006e1 15694: 90 93 e2 06 sts 0x06E2, r25 ; 0x8006e2 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 15698: 89 e4 ldi r24, 0x49 ; 73 1569a: 0e 94 0d 5d call 0xba1a ; 0xba1a 1569e: 88 23 and r24, r24 156a0: 81 f0 breq .+32 ; 0x156c2 156a2: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 156a6: 2c ea ldi r18, 0xAC ; 172 156a8: 35 ec ldi r19, 0xC5 ; 197 156aa: 47 e2 ldi r20, 0x27 ; 39 156ac: 5e e3 ldi r21, 0x3E ; 62 156ae: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 156b2: 60 93 e3 06 sts 0x06E3, r22 ; 0x8006e3 156b6: 70 93 e4 06 sts 0x06E4, r23 ; 0x8006e4 156ba: 80 93 e5 06 sts 0x06E5, r24 ; 0x8006e5 156be: 90 93 e6 06 sts 0x06E6, r25 ; 0x8006e6 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 156c2: 84 e4 ldi r24, 0x44 ; 68 156c4: 0e 94 0d 5d call 0xba1a ; 0xba1a 156c8: 88 23 and r24, r24 156ca: 81 f0 breq .+32 ; 0x156ec 156cc: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 } float unscalePID_i(float i) { return i/PID_dT; 156d0: 2c ea ldi r18, 0xAC ; 172 156d2: 35 ec ldi r19, 0xC5 ; 197 156d4: 47 e2 ldi r20, 0x27 ; 39 156d6: 5e e3 ldi r21, 0x3E ; 62 156d8: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 156dc: 60 93 e7 06 sts 0x06E7, r22 ; 0x8006e7 156e0: 70 93 e8 06 sts 0x06E8, r23 ; 0x8006e8 156e4: 80 93 e9 06 sts 0x06E9, r24 ; 0x8006e9 156e8: 90 93 ea 06 sts 0x06EA, r25 ; 0x8006ea updatePID(); 156ec: 0f 94 dd 4f call 0x29fba ; 0x29fba SERIAL_PROTOCOLRPGM(MSG_OK); 156f0: 88 ee ldi r24, 0xE8 ; 232 156f2: 9e e6 ldi r25, 0x6E ; 110 156f4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLPGM(" p:"); 156f8: 87 e3 ldi r24, 0x37 ; 55 156fa: 98 e8 ldi r25, 0x88 ; 136 156fc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15700: 60 91 df 06 lds r22, 0x06DF ; 0x8006df 15704: 70 91 e0 06 lds r23, 0x06E0 ; 0x8006e0 15708: 80 91 e1 06 lds r24, 0x06E1 ; 0x8006e1 1570c: 90 91 e2 06 lds r25, 0x06E2 ; 0x8006e2 15710: 42 e0 ldi r20, 0x02 ; 2 15712: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 15716: 83 e3 ldi r24, 0x33 ; 51 15718: 98 e8 ldi r25, 0x88 ; 136 1571a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 1571e: 2c ea ldi r18, 0xAC ; 172 15720: 35 ec ldi r19, 0xC5 ; 197 15722: 47 e2 ldi r20, 0x27 ; 39 15724: 5e e3 ldi r21, 0x3E ; 62 15726: 60 91 e3 06 lds r22, 0x06E3 ; 0x8006e3 1572a: 70 91 e4 06 lds r23, 0x06E4 ; 0x8006e4 1572e: 80 91 e5 06 lds r24, 0x06E5 ; 0x8006e5 15732: 90 91 e6 06 lds r25, 0x06E6 ; 0x8006e6 15736: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1573a: 42 e0 ldi r20, 0x02 ; 2 1573c: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 15740: 8f e2 ldi r24, 0x2F ; 47 15742: 98 e8 ldi r25, 0x88 ; 136 15744: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15748: 2c ea ldi r18, 0xAC ; 172 1574a: 35 ec ldi r19, 0xC5 ; 197 1574c: 47 e2 ldi r20, 0x27 ; 39 1574e: 5e e3 ldi r21, 0x3E ; 62 15750: 60 91 e7 06 lds r22, 0x06E7 ; 0x8006e7 15754: 70 91 e8 06 lds r23, 0x06E8 ; 0x8006e8 15758: 80 91 e9 06 lds r24, 0x06E9 ; 0x8006e9 1575c: 90 91 ea 06 lds r25, 0x06EA ; 0x8006ea 15760: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 15764: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 15768: 72 c1 rjmp .+740 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1576a: 86 39 cpi r24, 0x96 ; 150 1576c: a1 e0 ldi r26, 0x01 ; 1 1576e: 9a 07 cpc r25, r26 15770: 11 f4 brne .+4 ; 0x15776 15772: 0c 94 0d be jmp 0x17c1a ; 0x17c1a 15776: 74 f4 brge .+28 ; 0x15794 15778: 83 39 cpi r24, 0x93 ; 147 1577a: e1 e0 ldi r30, 0x01 ; 1 1577c: 9e 07 cpc r25, r30 1577e: 11 f4 brne .+4 ; 0x15784 15780: 0c 94 ef bd jmp 0x17bde ; 0x17bde 15784: 85 39 cpi r24, 0x95 ; 149 15786: 91 40 sbci r25, 0x01 ; 1 15788: 09 f0 breq .+2 ; 0x1578c 1578a: 28 cb rjmp .-2480 ; 0x14ddc */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 1578c: 81 e0 ldi r24, 0x01 ; 1 1578e: 0e 94 45 76 call 0xec8a ; 0xec8a 15792: 5d c1 rjmp .+698 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15794: 84 3f cpi r24, 0xF4 ; 244 15796: 21 e0 ldi r18, 0x01 ; 1 15798: 92 07 cpc r25, r18 1579a: 11 f4 brne .+4 ; 0x157a0 1579c: 0c 94 12 be jmp 0x17c24 ; 0x17c24 157a0: 14 f0 brlt .+4 ; 0x157a6 157a2: 0c 94 16 be jmp 0x17c2c ; 0x17c2c 157a6: 84 3a cpi r24, 0xA4 ; 164 157a8: 91 40 sbci r25, 0x01 ; 1 157aa: 09 f0 breq .+2 ; 0x157ae 157ac: 17 cb rjmp .-2514 ; 0x14ddc M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 157ae: 0e 94 77 81 call 0x102ee ; 0x102ee 157b2: 4d c1 rjmp .+666 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 157b4: 83 3c cpi r24, 0xC3 ; 195 157b6: 52 e0 ldi r21, 0x02 ; 2 157b8: 95 07 cpc r25, r21 157ba: 11 f4 brne .+4 ; 0x157c0 157bc: 0c 94 70 cc jmp 0x198e0 ; 0x198e0 157c0: 0c f0 brlt .+2 ; 0x157c4 157c2: 95 c0 rjmp .+298 ; 0x158ee 157c4: 8a 35 cpi r24, 0x5A ; 90 157c6: b2 e0 ldi r27, 0x02 ; 2 157c8: 9b 07 cpc r25, r27 157ca: 11 f4 brne .+4 ; 0x157d0 157cc: 0c 94 6e c5 jmp 0x18adc ; 0x18adc 157d0: 3c f5 brge .+78 ; 0x15820 157d2: 88 32 cpi r24, 0x28 ; 40 157d4: f2 e0 ldi r31, 0x02 ; 2 157d6: 9f 07 cpc r25, r31 157d8: 11 f4 brne .+4 ; 0x157de 157da: 0c 94 31 c1 jmp 0x18262 ; 0x18262 157de: ac f4 brge .+42 ; 0x1580a 157e0: 87 3f cpi r24, 0xF7 ; 247 157e2: 31 e0 ldi r19, 0x01 ; 1 157e4: 93 07 cpc r25, r19 157e6: 11 f4 brne .+4 ; 0x157ec 157e8: 0c 94 1e be jmp 0x17c3c ; 0x17c3c 157ec: 8d 3f cpi r24, 0xFD ; 253 157ee: 91 40 sbci r25, 0x01 ; 1 157f0: 09 f0 breq .+2 ; 0x157f4 157f2: f4 ca rjmp .-2584 ; 0x14ddc M509 */ case 509: { lang_reset(); 157f4: 0e 94 72 72 call 0xe4e4 ; 0xe4e4 SERIAL_ECHO_START; 157f8: 84 e1 ldi r24, 0x14 ; 20 157fa: 9b ea ldi r25, 0xAB ; 171 157fc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 15800: 8f e1 ldi r24, 0x1F ; 31 15802: 98 e8 ldi r25, 0x88 ; 136 15804: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 15808: 22 c1 rjmp .+580 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1580a: 88 35 cpi r24, 0x58 ; 88 1580c: 52 e0 ldi r21, 0x02 ; 2 1580e: 95 07 cpc r25, r21 15810: 11 f4 brne .+4 ; 0x15816 15812: 0c 94 66 c1 jmp 0x182cc ; 0x182cc 15816: 89 35 cpi r24, 0x59 ; 89 15818: 92 40 sbci r25, 0x02 ; 2 1581a: 09 f4 brne .+2 ; 0x1581e 1581c: 4c cb rjmp .-2408 ; 0x14eb6 1581e: de ca rjmp .-2628 ; 0x14ddc 15820: 8e 3b cpi r24, 0xBE ; 190 15822: b2 e0 ldi r27, 0x02 ; 2 15824: 9b 07 cpc r25, r27 15826: 11 f4 brne .+4 ; 0x1582c 15828: 0c 94 30 cc jmp 0x19860 ; 0x19860 1582c: 0c f0 brlt .+2 ; 0x15830 1582e: 4d c0 rjmp .+154 ; 0x158ca 15830: 8b 35 cpi r24, 0x5B ; 91 15832: f2 e0 ldi r31, 0x02 ; 2 15834: 9f 07 cpc r25, r31 15836: 11 f4 brne .+4 ; 0x1583c 15838: 0c 94 76 c5 jmp 0x18aec ; 0x18aec 1583c: 8d 3b cpi r24, 0xBD ; 189 1583e: 92 40 sbci r25, 0x02 ; 2 15840: 09 f0 breq .+2 ; 0x15844 15842: cc ca rjmp .-2664 ; 0x14ddc case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 15844: 80 91 95 13 lds r24, 0x1395 ; 0x801395 15848: 81 30 cpi r24, 0x01 ; 1 1584a: 11 f4 brne .+4 ; 0x15850 1584c: 0c 94 d1 cb jmp 0x197a2 ; 0x197a2 - `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; 15850: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15852: 8c e4 ldi r24, 0x4C ; 76 15854: 0e 94 0d 5d call 0xba1a ; 0xba1a - `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 15858: c1 2c mov r12, r1 1585a: d1 2c mov r13, r1 1585c: 6c e8 ldi r22, 0x8C ; 140 1585e: e6 2e mov r14, r22 15860: 62 e4 ldi r22, 0x42 ; 66 15862: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 15864: 88 23 and r24, r24 15866: 21 f0 breq .+8 ; 0x15870 15868: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1586c: 6b 01 movw r12, r22 1586e: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 15870: 8a e5 ldi r24, 0x5A ; 90 15872: 0e 94 0d 5d call 0xba1a ; 0xba1a 15876: 88 23 and r24, r24 15878: 11 f4 brne .+4 ; 0x1587e 1587a: 0c 94 e2 cb jmp 0x197c4 ; 0x197c4 1587e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15882: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 15884: 0e 94 27 6f call 0xde4e ; 0xde4e 15888: 4b 01 movw r8, r22 1588a: 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 1588c: 8a e5 ldi r24, 0x5A ; 90 1588e: 0e 94 0d 5d call 0xba1a ; 0xba1a 15892: 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; 15894: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 15898: 10 92 86 17 sts 0x1786, r1 ; 0x801786 void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){ FSensorBlockRunout fsBlockRunout; prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 1589c: 80 91 95 13 lds r24, 0x1395 ; 0x801395 158a0: 81 30 cpi r24, 0x01 ; 1 158a2: 11 f0 breq .+4 ; 0x158a8 158a4: 0c 94 e7 cb jmp 0x197ce ; 0x197ce if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 158a8: 15 30 cpi r17, 0x05 ; 5 158aa: 18 f4 brcc .+6 ; 0x158b2 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 158ac: 81 2f mov r24, r17 158ae: 0f 94 02 1c call 0x23804 ; 0x23804 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 158b2: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 158b6: 85 e8 ldi r24, 0x85 ; 133 158b8: 97 e1 ldi r25, 0x17 ; 23 158ba: 0e 94 15 76 call 0xec2a ; 0xec2a // 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); 158be: c5 01 movw r24, r10 158c0: b4 01 movw r22, r8 158c2: 90 58 subi r25, 0x80 ; 128 158c4: 0e 94 27 6f call 0xde4e ; 0xde4e 158c8: c2 c0 rjmp .+388 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 158ca: 81 3c cpi r24, 0xC1 ; 193 158cc: 32 e0 ldi r19, 0x02 ; 2 158ce: 93 07 cpc r25, r19 158d0: 11 f4 brne .+4 ; 0x158d6 158d2: 0c 94 64 cc jmp 0x198c8 ; 0x198c8 158d6: 14 f0 brlt .+4 ; 0x158dc 158d8: 0c 94 6a cc jmp 0x198d4 ; 0x198d4 158dc: 80 3c cpi r24, 0xC0 ; 192 158de: 92 40 sbci r25, 0x02 ; 2 158e0: 09 f0 breq .+2 ; 0x158e4 158e2: 7c ca rjmp .-2824 ; 0x14ddc #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 158e4: 80 ec ldi r24, 0xC0 ; 192 158e6: 92 e0 ldi r25, 0x02 ; 2 158e8: 0e 94 95 61 call 0xc32a ; 0xc32a 158ec: b0 c0 rjmp .+352 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 158ee: 84 38 cpi r24, 0x84 ; 132 158f0: a3 e0 ldi r26, 0x03 ; 3 158f2: 9a 07 cpc r25, r26 158f4: 11 f4 brne .+4 ; 0x158fa 158f6: 0c 94 20 c9 jmp 0x19240 ; 0x19240 158fa: 0c f0 brlt .+2 ; 0x158fe 158fc: 97 c0 rjmp .+302 ; 0x15a2c 158fe: 82 35 cpi r24, 0x52 ; 82 15900: e3 e0 ldi r30, 0x03 ; 3 15902: 9e 07 cpc r25, r30 15904: 11 f4 brne .+4 ; 0x1590a 15906: 0c 94 7c c5 jmp 0x18af8 ; 0x18af8 1590a: 94 f5 brge .+100 ; 0x15970 1590c: 84 3c cpi r24, 0xC4 ; 196 1590e: 22 e0 ldi r18, 0x02 ; 2 15910: 92 07 cpc r25, r18 15912: 11 f4 brne .+4 ; 0x15918 15914: 0c 94 8d cc jmp 0x1991a ; 0x1991a 15918: 85 3c cpi r24, 0xC5 ; 197 1591a: 92 40 sbci r25, 0x02 ; 2 1591c: 09 f0 breq .+2 ; 0x15920 1591e: 5e ca rjmp .-2884 ; 0x14ddc M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 15920: 83 e5 ldi r24, 0x53 ; 83 15922: 0e 94 0d 5d call 0xba1a ; 0xba1a 15926: 88 23 and r24, r24 15928: 51 f0 breq .+20 ; 0x1593e { switch (code_value_uint8()) 1592a: 0e 94 9f 5c call 0xb93e ; 0xb93e 1592e: 88 23 and r24, r24 15930: 11 f4 brne .+4 ; 0x15936 15932: 0c 94 b9 cc jmp 0x19972 ; 0x19972 15936: 81 30 cpi r24, 0x01 ; 1 15938: 11 f4 brne .+4 ; 0x1593e 1593a: 0c 94 c6 cc jmp 0x1998c ; 0x1998c break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 1593e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 15942: 81 30 cpi r24, 0x01 ; 1 15944: 91 f4 brne .+36 ; 0x1596a 15946: 88 e5 ldi r24, 0x58 ; 88 15948: 0e 94 0d 5d call 0xba1a ; 0xba1a 1594c: 88 23 and r24, r24 1594e: 69 f0 breq .+26 ; 0x1596a { switch (code_value_uint8()) 15950: 0e 94 9f 5c call 0xb93e ; 0xb93e 15954: 81 30 cpi r24, 0x01 ; 1 15956: 11 f4 brne .+4 ; 0x1595c 15958: 0c 94 d4 cc jmp 0x199a8 ; 0x199a8 1595c: 10 f4 brcc .+4 ; 0x15962 1595e: 0c 94 cf cc jmp 0x1999e ; 0x1999e 15962: 8a 32 cpi r24, 0x2A ; 42 15964: 11 f4 brne .+4 ; 0x1596a 15966: 0c 94 d8 cc jmp 0x199b0 ; 0x199b0 break; default: break; } } MMU2::mmu2.Status(); 1596a: 0f 94 82 75 call 0x2eb04 ; 0x2eb04 1596e: 6f c0 rjmp .+222 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15970: 8d 35 cpi r24, 0x5D ; 93 15972: 43 e0 ldi r20, 0x03 ; 3 15974: 94 07 cpc r25, r20 15976: 11 f4 brne .+4 ; 0x1597c 15978: 0c 94 f2 c6 jmp 0x18de4 ; 0x18de4 1597c: 8e 35 cpi r24, 0x5E ; 94 1597e: 53 e0 ldi r21, 0x03 ; 3 15980: 95 07 cpc r25, r21 15982: 11 f4 brne .+4 ; 0x15988 15984: 0c 94 8a c7 jmp 0x18f14 ; 0x18f14 15988: 8c 35 cpi r24, 0x5C ; 92 1598a: 93 40 sbci r25, 0x03 ; 3 1598c: 09 f0 breq .+2 ; 0x15990 1598e: 26 ca rjmp .-2996 ; 0x14ddc */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 15990: 83 e5 ldi r24, 0x53 ; 83 15992: 0e 94 0d 5d call 0xba1a ; 0xba1a 15996: 88 23 and r24, r24 15998: 09 f4 brne .+2 ; 0x1599c 1599a: 59 c0 rjmp .+178 ; 0x15a4e set_target_pinda = code_value_short(); 1599c: 0e 94 ac 5c call 0xb958 ; 0xb958 159a0: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 159a2: 8a ee ldi r24, 0xEA ; 234 159a4: 99 e3 ldi r25, 0x39 ; 57 159a6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 159aa: 0f 94 e0 0a call 0x215c0 ; 0x215c0 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 159ae: 88 e9 ldi r24, 0x98 ; 152 159b0: 97 e8 ldi r25, 0x87 ; 135 159b2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLLN(set_target_pinda); 159b6: c8 01 movw r24, r16 159b8: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 codenum = _millis(); 159bc: 0f 94 55 3e call 0x27caa ; 0x27caa 159c0: 4b 01 movw r8, r22 159c2: 5c 01 movw r10, r24 cancel_heatup = false; 159c4: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.402> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 159c8: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 159cc: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 159d0: 89 2b or r24, r25 159d2: 41 f4 brne .+16 ; 0x159e4 159d4: ff 24 eor r15, r15 159d6: f3 94 inc r15 159d8: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 159dc: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 159e0: 89 2b or r24, r25 159e2: 09 f0 breq .+2 ; 0x159e6 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 159e4: 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)) ) { 159e6: 28 01 movw r4, r16 159e8: 01 2e mov r0, r17 159ea: 00 0c add r0, r0 159ec: 66 08 sbc r6, r6 159ee: 77 08 sbc r7, r7 159f0: f1 10 cpse r15, r1 159f2: 0c 94 b2 c6 jmp 0x18d64 ; 0x18d64 159f6: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.402> 159fa: 81 11 cpse r24, r1 159fc: 12 c0 rjmp .+36 ; 0x15a22 159fe: c3 01 movw r24, r6 15a00: b2 01 movw r22, r4 15a02: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 15a06: 20 91 95 03 lds r18, 0x0395 ; 0x800395 15a0a: 30 91 96 03 lds r19, 0x0396 ; 0x800396 15a0e: 40 91 97 03 lds r20, 0x0397 ; 0x800397 15a12: 50 91 98 03 lds r21, 0x0398 ; 0x800398 15a16: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 15a1a: 18 16 cp r1, r24 15a1c: 14 f4 brge .+4 ; 0x15a22 15a1e: 0c 94 c4 c6 jmp 0x18d88 ; 0x18d88 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 15a22: 88 ee ldi r24, 0xE8 ; 232 15a24: 9e e6 ldi r25, 0x6E ; 110 15a26: 0f 94 e0 0a call 0x215c0 ; 0x215c0 15a2a: 11 c0 rjmp .+34 ; 0x15a4e } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15a2c: 81 39 cpi r24, 0x91 ; 145 15a2e: b3 e0 ldi r27, 0x03 ; 3 15a30: 9b 07 cpc r25, r27 15a32: 11 f4 brne .+4 ; 0x15a38 15a34: 0c 94 53 ca jmp 0x194a6 ; 0x194a6 15a38: 84 f4 brge .+32 ; 0x15a5a 15a3a: 8b 38 cpi r24, 0x8B ; 139 15a3c: f3 e0 ldi r31, 0x03 ; 3 15a3e: 9f 07 cpc r25, r31 15a40: 11 f4 brne .+4 ; 0x15a46 15a42: 0c 94 cf c9 jmp 0x1939e ; 0x1939e 15a46: 8c 38 cpi r24, 0x8C ; 140 15a48: 93 40 sbci r25, 0x03 ; 3 15a4a: 09 f0 breq .+2 ; 0x15a4e 15a4c: c7 c9 rjmp .-3186 ; 0x14ddc */ 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; 15a4e: 10 92 59 0e sts 0x0E59, r1 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.548+0x1> 15a52: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 <_ZL17mcode_in_progress.lto_priv.548> 15a56: 0c 94 6e 98 jmp 0x130dc ; 0x130dc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15a5a: 84 39 cpi r24, 0x94 ; 148 15a5c: 33 e0 ldi r19, 0x03 ; 3 15a5e: 93 07 cpc r25, r19 15a60: 14 f4 brge .+4 ; 0x15a66 15a62: 0c 94 a2 ca jmp 0x19544 ; 0x19544 15a66: 80 3a cpi r24, 0xA0 ; 160 15a68: 93 40 sbci r25, 0x03 ; 3 15a6a: 09 f0 breq .+2 ; 0x15a6e 15a6c: b7 c9 rjmp .-3218 ; 0x14ddc M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 15a6e: 80 91 93 03 lds r24, 0x0393 ; 0x800393 15a72: 90 91 94 03 lds r25, 0x0394 ; 0x800394 } } void CardReader::openLogFile(const char* name) { logging = true; 15a76: 21 e0 ldi r18, 0x01 ; 1 15a78: 20 93 6a 14 sts 0x146A, r18 ; 0x80146a openFileWrite(name); 15a7c: 05 96 adiw r24, 0x05 ; 5 15a7e: 0f 94 97 84 call 0x3092e ; 0x3092e 15a82: e5 cf rjmp .-54 ; 0x15a4e - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 15a84: 00 91 93 03 lds r16, 0x0393 ; 0x800393 15a88: 10 91 94 03 lds r17, 0x0394 ; 0x800394 15a8c: 0e 5f subi r16, 0xFE ; 254 15a8e: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 15a90: 80 e5 ldi r24, 0x50 ; 80 15a92: 0e 94 0d 5d call 0xba1a ; 0xba1a */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 15a96: c1 2c mov r12, r1 15a98: d1 2c mov r13, r1 15a9a: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 15a9c: 88 23 and r24, r24 15a9e: 21 f0 breq .+8 ; 0x15aa8 15aa0: 0e 94 b9 5c call 0xb972 ; 0xb972 15aa4: 6b 01 movw r12, r22 15aa6: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 15aa8: 83 e5 ldi r24, 0x53 ; 83 15aaa: 0e 94 0d 5d call 0xba1a ; 0xba1a 15aae: 88 23 and r24, r24 15ab0: 51 f0 breq .+20 ; 0x15ac6 15ab2: 0e 94 b9 5c call 0xb972 ; 0xb972 15ab6: 9b 01 movw r18, r22 15ab8: ac 01 movw r20, r24 15aba: a8 ee ldi r26, 0xE8 ; 232 15abc: b3 e0 ldi r27, 0x03 ; 3 15abe: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 <__muluhisi3> 15ac2: 6b 01 movw r12, r22 15ac4: 7c 01 movw r14, r24 15ac6: c8 01 movw r24, r16 15ac8: 0f 5f subi r16, 0xFF ; 255 15aca: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 15acc: dc 01 movw r26, r24 15ace: 4c 91 ld r20, X 15ad0: 40 32 cpi r20, 0x20 ; 32 15ad2: c9 f3 breq .-14 ; 0x15ac6 custom_message_type = CustomMsg::M0Wait; 15ad4: 26 e0 ldi r18, 0x06 ; 6 15ad6: 20 93 72 07 sts 0x0772, r18 ; 0x800772 if (!expiration_time_set && *src != '\0') { 15ada: c1 14 cp r12, r1 15adc: d1 04 cpc r13, r1 15ade: e1 04 cpc r14, r1 15ae0: f1 04 cpc r15, r1 15ae2: a1 f5 brne .+104 ; 0x15b4c 15ae4: 2c 91 ld r18, X 15ae6: 22 23 and r18, r18 15ae8: 89 f1 breq .+98 ; 0x15b4c lcd_setstatus(src); 15aea: 0f 94 20 14 call 0x22840 ; 0x22840 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(); 15aee: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 15af2: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 15af6: 84 60 ori r24, 0x04 ; 4 15af8: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce previous_millis_cmd.start(); 15afc: 84 e8 ldi r24, 0x84 ; 132 15afe: 93 e0 ldi r25, 0x03 ; 3 15b00: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> if (expiration_time_set) { 15b04: c1 14 cp r12, r1 15b06: d1 04 cpc r13, r1 15b08: e1 04 cpc r14, r1 15b0a: f1 04 cpc r15, r1 15b0c: 79 f1 breq .+94 ; 0x15b6c codenum += _millis(); // keep track of when we started waiting 15b0e: 0f 94 55 3e call 0x27caa ; 0x27caa 15b12: c6 0e add r12, r22 15b14: d7 1e adc r13, r23 15b16: e8 1e adc r14, r24 15b18: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 15b1a: 84 e0 ldi r24, 0x04 ; 4 15b1c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(_millis() < codenum && !lcd_clicked()) { 15b20: 0f 94 55 3e call 0x27caa ; 0x27caa 15b24: 6c 15 cp r22, r12 15b26: 7d 05 cpc r23, r13 15b28: 8e 05 cpc r24, r14 15b2a: 9f 05 cpc r25, r15 15b2c: b0 f0 brcs .+44 ; 0x15b5a delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 15b2e: 82 e0 ldi r24, 0x02 ; 2 15b30: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 15b34: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 15b38: 8b 7f andi r24, 0xFB ; 251 15b3a: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce if (IS_SD_PRINTING) 15b3e: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 15b42: 88 23 and r24, r24 15b44: 31 f1 breq .+76 ; 0x15b92 custom_message_type = CustomMsg::Status; 15b46: 10 92 72 07 sts 0x0772, r1 ; 0x800772 15b4a: 81 cf rjmp .-254 ; 0x15a4e } 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)); 15b4c: 83 e0 ldi r24, 0x03 ; 3 15b4e: 9a e3 ldi r25, 0x3A ; 58 15b50: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 15b54: 0f 94 e0 0a call 0x215c0 ; 0x215c0 15b58: ca cf rjmp .-108 ; 0x15aee 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()) { 15b5a: 0e 94 43 72 call 0xe486 ; 0xe486 15b5e: 81 11 cpse r24, r1 15b60: e6 cf rjmp .-52 ; 0x15b2e delay_keep_alive(0); 15b62: 90 e0 ldi r25, 0x00 ; 0 15b64: 80 e0 ldi r24, 0x00 ; 0 15b66: 0e 94 10 8f call 0x11e20 ; 0x11e20 15b6a: da cf rjmp .-76 ; 0x15b20 //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 15b6c: 10 91 96 02 lds r17, 0x0296 ; 0x800296 KEEPALIVE_STATE(PAUSED_FOR_USER); 15b70: 84 e0 ldi r24, 0x04 ; 4 15b72: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 15b76: 0e 94 3e 72 call 0xe47c ; 0xe47c while(!lcd_clicked()) 15b7a: 0e 94 43 72 call 0xe486 ; 0xe486 15b7e: 81 11 cpse r24, r1 15b80: 05 c0 rjmp .+10 ; 0x15b8c { delay_keep_alive(0); 15b82: 90 e0 ldi r25, 0x00 ; 0 15b84: 80 e0 ldi r24, 0x00 ; 0 15b86: 0e 94 10 8f call 0x11e20 ; 0x11e20 15b8a: f7 cf rjmp .-18 ; 0x15b7a } KEEPALIVE_STATE(busy_state_backup); 15b8c: 10 93 96 02 sts 0x0296, r17 ; 0x800296 15b90: d1 cf rjmp .-94 ; 0x15b34 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 15b92: 81 e5 ldi r24, 0x51 ; 81 15b94: 91 e7 ldi r25, 0x71 ; 113 15b96: 0f 94 e0 0a call 0x215c0 ; 0x215c0 15b9a: 59 cf rjmp .-334 ; 0x15a4e /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 15b9c: 88 ef ldi r24, 0xF8 ; 248 15b9e: 99 e3 ldi r25, 0x39 ; 57 15ba0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 15ba4: 0f 94 e0 0a call 0x215c0 ; 0x215c0 enable_x(); 15ba8: 17 98 cbi 0x02, 7 ; 2 enable_y(); 15baa: 16 98 cbi 0x02, 6 ; 2 enable_z(); 15bac: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 15bae: 14 98 cbi 0x02, 4 ; 2 15bb0: 4e cf rjmp .-356 ; 0x15a4e /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 15bb2: 81 e0 ldi r24, 0x01 ; 1 15bb4: 0f 94 f3 7f call 0x2ffe6 ; 0x2ffe6 15bb8: 4a cf rjmp .-364 ; 0x15a4e presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 15bba: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b mounted = false; 15bbe: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c SERIAL_ECHO_START; 15bc2: 84 e1 ldi r24, 0x14 ; 20 15bc4: 9b ea ldi r25, 0xAB ; 171 15bc6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 15bca: 87 ea ldi r24, 0xA7 ; 167 15bcc: 9c e6 ldi r25, 0x6C ; 108 15bce: 0e 94 97 7b call 0xf72e ; 0xf72e 15bd2: 3d cf rjmp .-390 ; 0x15a4e /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 15bd4: 0e 94 cb 68 call 0xd196 ; 0xd196 15bd8: 88 23 and r24, r24 15bda: 19 f0 breq .+6 ; 0x15be2 lcd_resume_print(); 15bdc: 0f 94 f4 13 call 0x227e8 ; 0x227e8 15be0: 36 cf rjmp .-404 ; 0x15a4e else { if (!filament_presence_check()) { 15be2: 0f 94 49 15 call 0x22a92 ; 0x22a92 15be6: 88 23 and r24, r24 15be8: 09 f4 brne .+2 ; 0x15bec 15bea: 31 cf rjmp .-414 ; 0x15a4e 15bec: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 15bf0: 88 23 and r24, r24 15bf2: 61 f0 breq .+24 ; 0x15c0c // Print was aborted break; } if (!card.get_sdpos()) 15bf4: 80 91 7f 17 lds r24, 0x177F ; 0x80177f 15bf8: 90 91 80 17 lds r25, 0x1780 ; 0x801780 15bfc: a0 91 81 17 lds r26, 0x1781 ; 0x801781 15c00: b0 91 82 17 lds r27, 0x1782 ; 0x801782 15c04: 89 2b or r24, r25 15c06: 8a 2b or r24, r26 15c08: 8b 2b or r24, r27 15c0a: 69 f4 brne .+26 ; 0x15c26 { // A new print has started from scratch, reset stats failstats_reset_print(); 15c0c: 0e 94 5b 5d call 0xbab6 ; 0xbab6 sdpos_atomic = 0; 15c10: 10 92 80 03 sts 0x0380, r1 ; 0x800380 15c14: 10 92 81 03 sts 0x0381, r1 ; 0x800381 15c18: 10 92 82 03 sts 0x0382, r1 ; 0x800382 15c1c: 10 92 83 03 sts 0x0383, r1 ; 0x800383 15c20: 80 e0 ldi r24, 0x00 ; 0 15c22: 0e 94 d3 83 call 0x107a6 ; 0x107a6 } void CardReader::startFileprint() { if(mounted) 15c26: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 15c2a: 88 23 and r24, r24 15c2c: 31 f0 breq .+12 ; 0x15c3a { sdprinting = true; 15c2e: 81 e0 ldi r24, 0x01 ; 1 15c30: 80 93 6b 14 sts 0x146B, r24 ; 0x80146b 15c34: 85 e0 ldi r24, 0x05 ; 5 15c36: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 15c3a: 0f 94 80 57 call 0x2af00 ; 0x2af00 if (MMU2::mmu2.Enabled()) 15c3e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 15c42: 81 30 cpi r24, 0x01 ; 1 15c44: 09 f0 breq .+2 ; 0x15c48 15c46: 03 cf rjmp .-506 ; 0x15a4e { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 15c48: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 15c4c: 88 23 and r24, r24 15c4e: 09 f4 brne .+2 ; 0x15c52 15c50: fe ce rjmp .-516 ; 0x15a4e 15c52: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 15c56: 81 11 cpse r24, r1 15c58: fa ce rjmp .-524 ; 0x15a4e { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 15c5a: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 15c5e: f7 ce rjmp .-530 ; 0x15a4e #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 15c60: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 15c64: 88 23 and r24, r24 15c66: 09 f4 brne .+2 ; 0x15c6a 15c68: f2 ce rjmp .-540 ; 0x15a4e 15c6a: 83 e5 ldi r24, 0x53 ; 83 15c6c: 0e 94 0d 5d call 0xba1a ; 0xba1a 15c70: 88 23 and r24, r24 15c72: 09 f4 brne .+2 ; 0x15c76 15c74: ec ce rjmp .-552 ; 0x15a4e long index = code_value_long(); 15c76: 0e 94 b9 5c call 0xb972 ; 0xb972 15c7a: 6b 01 movw r12, r22 15c7c: 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);}; 15c7e: c0 92 7f 17 sts 0x177F, r12 ; 0x80177f 15c82: d0 92 80 17 sts 0x1780, r13 ; 0x801780 15c86: e0 92 81 17 sts 0x1781, r14 ; 0x801781 15c8a: f0 92 82 17 sts 0x1782, r15 ; 0x801782 15c8e: 0f 94 3b 76 call 0x2ec76 ; 0x2ec76 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; 15c92: c0 92 80 03 sts 0x0380, r12 ; 0x800380 15c96: d0 92 81 03 sts 0x0381, r13 ; 0x800381 15c9a: e0 92 82 03 sts 0x0382, r14 ; 0x800382 15c9e: f0 92 83 03 sts 0x0383, r15 ; 0x800383 15ca2: d5 ce rjmp .-598 ; 0x15a4e #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 15ca4: 80 e5 ldi r24, 0x50 ; 80 15ca6: 0e 94 0d 5d call 0xba1a ; 0xba1a 15caa: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 15cac: 0e 94 cb 68 call 0xd196 ; 0xd196 15cb0: 88 23 and r24, r24 15cb2: 91 f0 breq .+36 ; 0x15cd8 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 15cb4: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 15cb8: 88 23 and r24, r24 15cba: 49 f0 breq .+18 ; 0x15cce 15cbc: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 15cc0: 81 11 cpse r24, r1 15cc2: 05 c0 rjmp .+10 ; 0x15cce SERIAL_PROTOCOLLNPGM("SD print paused"); 15cc4: 8e ec ldi r24, 0xCE ; 206 15cc6: 96 e8 ldi r25, 0x86 ; 134 15cc8: 0e 94 97 7b call 0xf72e ; 0xf72e 15ccc: c0 ce rjmp .-640 ; 0x15a4e else SERIAL_PROTOCOLLNPGM("Print saved"); 15cce: 82 ec ldi r24, 0xC2 ; 194 15cd0: 96 e8 ldi r25, 0x86 ; 134 15cd2: 0e 94 97 7b call 0xf72e ; 0xf72e 15cd6: bb ce rjmp .-650 ; 0x15a4e } else if (sdprinting) 15cd8: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 15cdc: 88 23 and r24, r24 15cde: 09 f4 brne .+2 ; 0x15ce2 15ce0: 4a c0 rjmp .+148 ; 0x15d76 { if (arg_P) 15ce2: 11 23 and r17, r17 15ce4: e1 f1 breq .+120 ; 0x15d5e { printAbsFilenameFast(); 15ce6: 0f 94 c0 7a call 0x2f580 ; 0x2f580 SERIAL_PROTOCOLLN(); 15cea: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 15cee: 8f e4 ldi r24, 0x4F ; 79 15cf0: 99 e6 ldi r25, 0x69 ; 105 15cf2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15cf6: 60 91 7f 17 lds r22, 0x177F ; 0x80177f 15cfa: 70 91 80 17 lds r23, 0x1780 ; 0x801780 15cfe: 80 91 81 17 lds r24, 0x1781 ; 0x801781 15d02: 90 91 82 17 lds r25, 0x1782 ; 0x801782 15d06: 4a e0 ldi r20, 0x0A ; 10 15d08: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15d0c: 8f e2 ldi r24, 0x2F ; 47 15d0e: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 15d12: 60 91 78 17 lds r22, 0x1778 ; 0x801778 15d16: 70 91 79 17 lds r23, 0x1779 ; 0x801779 15d1a: 80 91 7a 17 lds r24, 0x177A ; 0x80177a 15d1e: 90 91 7b 17 lds r25, 0x177B ; 0x80177b 15d22: 4a e0 ldi r20, 0x0A ; 10 15d24: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 15d28: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 15d2c: 0f 94 ad 53 call 0x2a75a ; 0x2a75a 15d30: 2c e3 ldi r18, 0x3C ; 60 15d32: 30 e0 ldi r19, 0x00 ; 0 15d34: 40 e0 ldi r20, 0x00 ; 0 15d36: 50 e0 ldi r21, 0x00 ; 0 15d38: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 15d3c: c9 01 movw r24, r18 15d3e: 6c e3 ldi r22, 0x3C ; 60 15d40: 70 e0 ldi r23, 0x00 ; 0 15d42: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 15d46: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 15d48: 90 e0 ldi r25, 0x00 ; 0 15d4a: 80 e0 ldi r24, 0x00 ; 0 15d4c: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15d50: 8a e3 ldi r24, 0x3A ; 58 15d52: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 15d56: c8 01 movw r24, r16 15d58: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 15d5c: 78 ce rjmp .-784 ; 0x15a4e { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 15d5e: 80 91 82 14 lds r24, 0x1482 ; 0x801482 15d62: 88 23 and r24, r24 15d64: 29 f0 breq .+10 ; 0x15d70 15d66: 82 e8 ldi r24, 0x82 ; 130 15d68: 94 e1 ldi r25, 0x14 ; 20 15d6a: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 15d6e: bf cf rjmp .-130 ; 0x15cee 15d70: 8d e6 ldi r24, 0x6D ; 109 15d72: 94 e1 ldi r25, 0x14 ; 20 15d74: fa cf rjmp .-12 ; 0x15d6a SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 15d76: 82 eb ldi r24, 0xB2 ; 178 15d78: 96 e8 ldi r25, 0x86 ; 134 15d7a: 0e 94 97 7b call 0xf72e ; 0xf72e 15d7e: 67 ce rjmp .-818 ; 0x15a4e /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 15d80: 80 91 93 03 lds r24, 0x0393 ; 0x800393 15d84: 90 91 94 03 lds r25, 0x0394 ; 0x800394 15d88: 04 96 adiw r24, 0x04 ; 4 15d8a: 0f 94 97 84 call 0x3092e ; 0x3092e 15d8e: 5f ce rjmp .-834 ; 0x15a4e * 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; 15d90: ce 01 movw r24, r28 15d92: 01 96 adiw r24, 0x01 ; 1 15d94: 0f 94 1c 77 call 0x2ee38 ; 0x2ee38 15d98: 88 23 and r24, r24 15d9a: 09 f4 brne .+2 ; 0x15d9e 15d9c: 54 c9 rjmp .-3416 ; 0x15046 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 15d9e: 61 e0 ldi r22, 0x01 ; 1 15da0: ce 01 movw r24, r28 15da2: 01 96 adiw r24, 0x01 ; 1 15da4: 0f 94 fb a3 call 0x347f6 ; 0x347f6 if (!d) goto fail; 15da8: 00 97 sbiw r24, 0x00 ; 0 15daa: 09 f4 brne .+2 ; 0x15dae 15dac: 4c c9 rjmp .-3432 ; 0x15046 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 15dae: 25 ee ldi r18, 0xE5 ; 229 15db0: fc 01 movw r30, r24 15db2: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 15db4: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 15db6: 0f 94 19 6a call 0x2d432 ; 0x2d432 15dba: 18 2f mov r17, r24 15dbc: 45 c9 rjmp .-3446 ; 0x15048 presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 15dbe: 8c e8 ldi r24, 0x8C ; 140 15dc0: 96 e8 ldi r25, 0x86 ; 134 15dc2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 15dc6: 23 96 adiw r28, 0x03 ; 3 15dc8: 8e ad ldd r24, Y+62 ; 0x3e 15dca: 9f ad ldd r25, Y+63 ; 0x3f 15dcc: 23 97 sbiw r28, 0x03 ; 3 15dce: 0e 94 d0 89 call 0x113a0 ; 0x113a0 15dd2: 8e e2 ldi r24, 0x2E ; 46 15dd4: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 15dd8: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 15ddc: 38 ce rjmp .-912 ; 0x15a4e ### 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(); 15dde: 0f 94 ad 53 call 0x2a75a ; 0x2a75a int16_t sec, min; min = t / 60; sec = t % 60; 15de2: 2c e3 ldi r18, 0x3C ; 60 15de4: 30 e0 ldi r19, 0x00 ; 0 15de6: 40 e0 ldi r20, 0x00 ; 0 15de8: 50 e0 ldi r21, 0x00 ; 0 15dea: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 15dee: 7f 93 push r23 15df0: 6f 93 push r22 15df2: 3f 93 push r19 15df4: 2f 93 push r18 15df6: 89 e6 ldi r24, 0x69 ; 105 15df8: 99 e8 ldi r25, 0x89 ; 137 15dfa: 9f 93 push r25 15dfc: 8f 93 push r24 15dfe: 8e 01 movw r16, r28 15e00: 0f 5f subi r16, 0xFF ; 255 15e02: 1f 4f sbci r17, 0xFF ; 255 15e04: 1f 93 push r17 15e06: 0f 93 push r16 15e08: 0f 94 26 dc call 0x3b84c ; 0x3b84c SERIAL_ECHO_START; 15e0c: 84 e1 ldi r24, 0x14 ; 20 15e0e: 9b ea ldi r25, 0xAB ; 171 15e10: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(time); 15e14: c8 01 movw r24, r16 15e16: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 lcd_setstatus(time); 15e1a: c8 01 movw r24, r16 15e1c: 0f 94 20 14 call 0x22840 ; 0x22840 autotempShutdown(); 15e20: 0f b6 in r0, 0x3f ; 63 15e22: f8 94 cli 15e24: de bf out 0x3e, r29 ; 62 15e26: 0f be out 0x3f, r0 ; 63 15e28: cd bf out 0x3d, r28 ; 61 15e2a: 11 ce rjmp .-990 ; 0x15a4e #### 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')) 15e2c: 83 e5 ldi r24, 0x53 ; 83 15e2e: 0e 94 0d 5d call 0xba1a ; 0xba1a 15e32: 88 23 and r24, r24 15e34: 09 f4 brne .+2 ; 0x15e38 15e36: 0b ce rjmp .-1002 ; 0x15a4e { uint8_t pin_status = code_value_uint8(); 15e38: 0e 94 9f 5c call 0xb93e ; 0xb93e 15e3c: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 15e3e: 80 e5 ldi r24, 0x50 ; 80 15e40: 0e 94 0d 5d call 0xba1a ; 0xba1a */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 15e44: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 15e46: 88 23 and r24, r24 15e48: 19 f0 breq .+6 ; 0x15e50 pin_number = code_value_uint8(); 15e4a: 0e 94 9f 5c call 0xb93e ; 0xb93e 15e4e: 18 2f mov r17, r24 15e50: ed e4 ldi r30, 0x4D ; 77 15e52: f9 e8 ldi r31, 0x89 ; 137 15e54: 89 e6 ldi r24, 0x69 ; 105 15e56: 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) 15e58: 24 91 lpm r18, Z 15e5a: 21 17 cp r18, r17 15e5c: 09 f4 brne .+2 ; 0x15e60 15e5e: f7 cd rjmp .-1042 ; 0x15a4e 15e60: 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++) 15e62: 8e 17 cp r24, r30 15e64: 9f 07 cpc r25, r31 15e66: c1 f7 brne .-16 ; 0x15e58 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 15e68: 16 30 cpi r17, 0x06 ; 6 15e6a: 81 f4 brne .+32 ; 0x15e8c fanSpeed = pin_status; 15e6c: 00 93 df 03 sts 0x03DF, r16 ; 0x8003df #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 15e70: 61 e0 ldi r22, 0x01 ; 1 15e72: 81 2f mov r24, r17 15e74: 0e 94 97 de call 0x1bd2e ; 0x1bd2e digitalWrite(pin_number, pin_status); 15e78: 60 2f mov r22, r16 15e7a: 81 2f mov r24, r17 15e7c: 0e 94 69 de call 0x1bcd2 ; 0x1bcd2 analogWrite(pin_number, pin_status); 15e80: 60 2f mov r22, r16 15e82: 70 e0 ldi r23, 0x00 ; 0 15e84: 81 2f mov r24, r17 15e86: 0e 94 c8 de call 0x1bd90 ; 0x1bd90 15e8a: e1 cd rjmp .-1086 ; 0x15a4e } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 15e8c: 17 fd sbrc r17, 7 15e8e: df cd rjmp .-1090 ; 0x15a4e 15e90: ef cf rjmp .-34 ; 0x15e70 ### 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); 15e92: 80 e1 ldi r24, 0x10 ; 16 15e94: 0e 94 07 e6 call 0x1cc0e ; 0x1cc0e eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 15e98: 81 ea ldi r24, 0xA1 ; 161 15e9a: 9d e0 ldi r25, 0x0D ; 13 15e9c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 15ea0: 3b e0 ldi r19, 0x0B ; 11 15ea2: 83 9f mul r24, r19 15ea4: c0 01 movw r24, r0 15ea6: 11 24 eor r1, r1 15ea8: 70 e0 ldi r23, 0x00 ; 0 15eaa: 60 e0 ldi r22, 0x00 ; 0 15eac: 80 5b subi r24, 0xB0 ; 176 15eae: 92 4f sbci r25, 0xF2 ; 242 15eb0: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 15eb4: 82 e0 ldi r24, 0x02 ; 2 15eb6: 0e 94 07 e6 call 0x1cc0e ; 0x1cc0e reset_bed_offset_and_skew(); 15eba: 0f 94 4d cb call 0x3969a ; 0x3969a // 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(); 15ebe: 0f 94 2e cb call 0x3965c ; 0x3965c 15ec2: c5 cd rjmp .-1142 ; 0x15a4e */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 15ec4: 8a e5 ldi r24, 0x5A ; 90 15ec6: 0e 94 0d 5d call 0xba1a ; 0xba1a // 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); 15eca: 0e 94 69 e6 call 0x1ccd2 ; 0x1ccd2 15ece: bf cd rjmp .-1154 ; 0x15a4e ### 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()) { 15ed0: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 15ed4: 88 23 and r24, r24 15ed6: 19 f1 breq .+70 ; 0x15f1e uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 15ed8: ce 01 movw r24, r28 15eda: 01 96 adiw r24, 0x01 ; 1 15edc: 0f 94 ff 84 call 0x309fe ; 0x309fe 15ee0: 88 23 and r24, r24 15ee2: c1 f0 breq .+48 ; 0x15f14 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15ee4: 89 81 ldd r24, Y+1 ; 0x01 15ee6: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15eea: 8e e2 ldi r24, 0x2E ; 46 15eec: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15ef0: 8a 81 ldd r24, Y+2 ; 0x02 15ef2: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15ef6: 8e e2 ldi r24, 0x2E ; 46 15ef8: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15efc: 8b 81 ldd r24, Y+3 ; 0x03 15efe: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 15f02: 8e e2 ldi r24, 0x2E ; 46 15f04: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 15f08: 8c 81 ldd r24, Y+4 ; 0x04 15f0a: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 15f0e: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 15f12: 9d cd rjmp .-1222 ; 0x15a4e SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 15f14: 8d e2 ldi r24, 0x2D ; 45 15f16: 99 e8 ldi r25, 0x89 ; 137 15f18: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 15f1c: 98 cd rjmp .-1232 ; 0x15a4e } } else { SERIAL_PROTOCOLLNPGM("n/a"); 15f1e: 89 e2 ldi r24, 0x29 ; 41 15f20: 99 e8 ldi r25, 0x89 ; 137 15f22: 0e 94 97 7b call 0xf72e ; 0xf72e 15f26: 93 cd rjmp .-1242 ; 0x15a4e 15f28: 10 92 64 0e sts 0x0E64, r1 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 15f2c: 90 cd rjmp .-1248 ; 0x15a4e break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 15f2e: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 15f32: 1f 92 push r1 15f34: 8f 93 push r24 15f36: 80 ea ldi r24, 0xA0 ; 160 15f38: 9a e6 ldi r25, 0x6A ; 106 15f3a: 9f 93 push r25 15f3c: 8f 93 push r24 15f3e: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 15f42: 0f 90 pop r0 15f44: 0f 90 pop r0 15f46: 0f 90 pop r0 15f48: 0f 90 pop r0 15f4a: 81 cd rjmp .-1278 ; 0x15a4e - `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(); 15f4c: 80 e5 ldi r24, 0x50 ; 80 15f4e: 0e 94 0d 5d call 0xba1a ; 0xba1a 15f52: 88 23 and r24, r24 15f54: 21 f0 breq .+8 ; 0x15f5e 15f56: 0e 94 9f 5c call 0xb93e ; 0xb93e 15f5a: 80 93 86 02 sts 0x0286, r24 ; 0x800286 if(code_seen('R')) print_time_remaining_normal = code_value(); 15f5e: 82 e5 ldi r24, 0x52 ; 82 15f60: 0e 94 0d 5d call 0xba1a ; 0xba1a 15f64: 88 23 and r24, r24 15f66: 41 f0 breq .+16 ; 0x15f78 15f68: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15f6c: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 15f70: 70 93 8a 02 sts 0x028A, r23 ; 0x80028a 15f74: 60 93 89 02 sts 0x0289, r22 ; 0x800289 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 15f78: 81 e5 ldi r24, 0x51 ; 81 15f7a: 0e 94 0d 5d call 0xba1a ; 0xba1a 15f7e: 88 23 and r24, r24 15f80: 21 f0 breq .+8 ; 0x15f8a 15f82: 0e 94 9f 5c call 0xb93e ; 0xb93e 15f86: 80 93 85 02 sts 0x0285, r24 ; 0x800285 if(code_seen('S')) print_time_remaining_silent = code_value(); 15f8a: 83 e5 ldi r24, 0x53 ; 83 15f8c: 0e 94 0d 5d call 0xba1a ; 0xba1a 15f90: 88 23 and r24, r24 15f92: 41 f0 breq .+16 ; 0x15fa4 15f94: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15f98: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 15f9c: 70 93 8e 02 sts 0x028E, r23 ; 0x80028e 15fa0: 60 93 8d 02 sts 0x028D, r22 ; 0x80028d if(code_seen('C')){ 15fa4: 83 e4 ldi r24, 0x43 ; 67 15fa6: 0e 94 0d 5d call 0xba1a ; 0xba1a 15faa: 88 23 and r24, r24 15fac: a9 f0 breq .+42 ; 0x15fd8 float print_time_to_change_normal_f = code_value(); 15fae: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15fb2: 6b 01 movw r12, r22 15fb4: 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; 15fb6: 20 e0 ldi r18, 0x00 ; 0 15fb8: 30 e0 ldi r19, 0x00 ; 0 15fba: a9 01 movw r20, r18 15fbc: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 15fc0: 6f ef ldi r22, 0xFF ; 255 15fc2: 7f ef ldi r23, 0xFF ; 255 15fc4: 18 16 cp r1, r24 15fc6: 24 f4 brge .+8 ; 0x15fd0 15fc8: c7 01 movw r24, r14 15fca: b6 01 movw r22, r12 15fcc: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 15fd0: 70 93 88 02 sts 0x0288, r23 ; 0x800288 15fd4: 60 93 87 02 sts 0x0287, r22 ; 0x800287 } if(code_seen('D')){ 15fd8: 84 e4 ldi r24, 0x44 ; 68 15fda: 0e 94 0d 5d call 0xba1a ; 0xba1a 15fde: 88 23 and r24, r24 15fe0: a9 f0 breq .+42 ; 0x1600c float print_time_to_change_silent_f = code_value(); 15fe2: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 15fe6: 6b 01 movw r12, r22 15fe8: 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; 15fea: 20 e0 ldi r18, 0x00 ; 0 15fec: 30 e0 ldi r19, 0x00 ; 0 15fee: a9 01 movw r20, r18 15ff0: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 15ff4: 6f ef ldi r22, 0xFF ; 255 15ff6: 7f ef ldi r23, 0xFF ; 255 15ff8: 18 16 cp r1, r24 15ffa: 24 f4 brge .+8 ; 0x16004 15ffc: c7 01 movw r24, r14 15ffe: b6 01 movw r22, r12 16000: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 16004: 70 93 8c 02 sts 0x028C, r23 ; 0x80028c 16008: 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); 1600c: 80 91 88 02 lds r24, 0x0288 ; 0x800288 16010: 8f 93 push r24 16012: 80 91 87 02 lds r24, 0x0287 ; 0x800287 16016: 8f 93 push r24 16018: 80 91 8a 02 lds r24, 0x028A ; 0x80028a 1601c: 8f 93 push r24 1601e: 80 91 89 02 lds r24, 0x0289 ; 0x800289 16022: 8f 93 push r24 16024: 80 91 86 02 lds r24, 0x0286 ; 0x800286 16028: 28 2f mov r18, r24 1602a: 08 2e mov r0, r24 1602c: 00 0c add r0, r0 1602e: 33 0b sbc r19, r19 16030: 3f 93 push r19 16032: 8f 93 push r24 16034: 86 e4 ldi r24, 0x46 ; 70 16036: 9a e6 ldi r25, 0x6A ; 106 16038: 9f 93 push r25 1603a: 8f 93 push r24 1603c: 0d e4 ldi r16, 0x4D ; 77 1603e: 1a e6 ldi r17, 0x6A ; 106 16040: 1f 93 push r17 16042: 0f 93 push r16 16044: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 16048: 80 91 8c 02 lds r24, 0x028C ; 0x80028c 1604c: 8f 93 push r24 1604e: 80 91 8b 02 lds r24, 0x028B ; 0x80028b 16052: 8f 93 push r24 16054: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 16058: 8f 93 push r24 1605a: 80 91 8d 02 lds r24, 0x028D ; 0x80028d 1605e: 8f 93 push r24 16060: 80 91 85 02 lds r24, 0x0285 ; 0x800285 16064: 28 2f mov r18, r24 16066: 08 2e mov r0, r24 16068: 00 0c add r0, r0 1606a: 33 0b sbc r19, r19 1606c: 3f 93 push r19 1606e: 8f 93 push r24 16070: 8f e3 ldi r24, 0x3F ; 63 16072: 9a e6 ldi r25, 0x6A ; 106 16074: 9f 93 push r25 16076: 8f 93 push r24 16078: 1f 93 push r17 1607a: 0f 93 push r16 1607c: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 16080: 0f b6 in r0, 0x3f ; 63 16082: f8 94 cli 16084: de bf out 0x3e, r29 ; 62 16086: 0f be out 0x3f, r0 ; 63 16088: cd bf out 0x3d, r28 ; 61 1608a: e1 cc rjmp .-1598 ; 0x15a4e } else return false; } bool Stopwatch::pause() { if (isRunning()) { 1608c: 80 91 99 03 lds r24, 0x0399 ; 0x800399 16090: 81 30 cpi r24, 0x01 ; 1 16092: 09 f0 breq .+2 ; 0x16096 16094: dc cc rjmp .-1608 ; 0x15a4e state = PAUSED; 16096: 82 e0 ldi r24, 0x02 ; 2 16098: 80 93 99 03 sts 0x0399, r24 ; 0x800399 stopTimestamp = _millis(); 1609c: 0f 94 55 3e call 0x27caa ; 0x27caa 160a0: 60 93 4c 06 sts 0x064C, r22 ; 0x80064c 160a4: 70 93 4d 06 sts 0x064D, r23 ; 0x80064d 160a8: 80 93 4e 06 sts 0x064E, r24 ; 0x80064e 160ac: 90 93 4f 06 sts 0x064F, r25 ; 0x80064f 160b0: ce cc rjmp .-1636 ; 0x15a4e /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 160b2: 0f 94 a4 57 call 0x2af48 ; 0x2af48 save_statistics(); 160b6: 0e 94 65 67 call 0xceca ; 0xceca 160ba: c9 cc rjmp .-1646 ; 0x15a4e ### 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 "); 160bc: 82 e2 ldi r24, 0x22 ; 34 160be: 99 e8 ldi r25, 0x89 ; 137 160c0: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 160c4: 8d ee ldi r24, 0xED ; 237 160c6: 9f e0 ldi r25, 0x0F ; 15 160c8: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 160cc: 4a e0 ldi r20, 0x0A ; 10 160ce: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc SERIAL_ECHOPGM(" min "); 160d2: 8c e1 ldi r24, 0x1C ; 28 160d4: 99 e8 ldi r25, 0x89 ; 137 160d6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 160da: 81 ef ldi r24, 0xF1 ; 241 160dc: 9f e0 ldi r25, 0x0F ; 15 160de: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 160e2: 4a e0 ldi r20, 0x0A ; 10 160e4: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc SERIAL_ECHOLNPGM(" cm."); 160e8: 87 e1 ldi r24, 0x17 ; 23 160ea: 99 e8 ldi r25, 0x89 ; 137 160ec: 0e 94 97 7b call 0xf72e ; 0xf72e 160f0: ae cc rjmp .-1700 ; 0x15a4e void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 160f2: 8a e9 ldi r24, 0x9A ; 154 160f4: 93 e0 ldi r25, 0x03 ; 3 160f6: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 160fa: 83 e5 ldi r24, 0x53 ; 83 160fc: 0e 94 0d 5d call 0xba1a ; 0xba1a 16100: 88 23 and r24, r24 16102: 09 f1 breq .+66 ; 0x16146 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 16104: 62 e2 ldi r22, 0x22 ; 34 16106: 70 e0 ldi r23, 0x00 ; 0 16108: 80 91 93 03 lds r24, 0x0393 ; 0x800393 1610c: 90 91 94 03 lds r25, 0x0394 ; 0x800394 16110: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc 16114: 8c 01 movw r16, r24 if (!this->ptr) { 16116: 89 2b or r24, r25 16118: b1 f0 breq .+44 ; 0x16146 // First quote not found return; } // Skip the leading quote this->ptr++; 1611a: 0f 5f subi r16, 0xFF ; 255 1611c: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 1611e: 62 e2 ldi r22, 0x22 ; 34 16120: 70 e0 ldi r23, 0x00 ; 0 16122: c8 01 movw r24, r16 16124: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc if(!pStrEnd) { 16128: 89 2b or r24, r25 1612a: 69 f0 breq .+26 ; 0x16146 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 1612c: e6 e4 ldi r30, 0x46 ; 70 1612e: f6 e0 ldi r31, 0x06 ; 6 16130: 83 e0 ldi r24, 0x03 ; 3 16132: df 01 movw r26, r30 16134: 1d 92 st X+, r1 16136: 8a 95 dec r24 16138: e9 f7 brne .-6 ; 0x16134 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 1613a: 42 e0 ldi r20, 0x02 ; 2 1613c: 50 e0 ldi r21, 0x00 ; 0 1613e: b8 01 movw r22, r16 16140: cf 01 movw r24, r30 16142: 0f 94 8f e3 call 0x3c71e ; 0x3c71e } #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 16146: 8c e8 ldi r24, 0x8C ; 140 16148: 9f e0 ldi r25, 0x0F ; 15 1614a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e && printer_recovering() && printingIsPaused()) { 1614e: 81 30 cpi r24, 0x01 ; 1 16150: 09 f0 breq .+2 ; 0x16154 16152: 7d cc rjmp .-1798 ; 0x15a4e #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() 16154: 0e 94 c1 68 call 0xd182 ; 0xd182 16158: 88 23 and r24, r24 1615a: 09 f4 brne .+2 ; 0x1615e 1615c: 78 cc rjmp .-1808 ; 0x15a4e && printingIsPaused()) { 1615e: 0e 94 cb 68 call 0xd196 ; 0xd196 16162: 88 23 and r24, r24 16164: 09 f4 brne .+2 ; 0x16168 16166: 73 cc rjmp .-1818 ; 0x15a4e // 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) { 16168: 80 91 ed 04 lds r24, 0x04ED ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.549> 1616c: 88 23 and r24, r24 1616e: 29 f0 breq .+10 ; 0x1617a SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 16170: 8d e1 ldi r24, 0x1D ; 29 16172: 9a e6 ldi r25, 0x6A ; 106 16174: 0e 94 97 7b call 0xf72e ; 0xf72e 16178: 6a cc rjmp .-1836 ; 0x15a4e } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 1617a: 80 e0 ldi r24, 0x00 ; 0 1617c: 9a e6 ldi r25, 0x6A ; 106 1617e: 0e 94 97 7b call 0xf72e ; 0xf72e 16182: 65 cc rjmp .-1846 ; 0x15a4e /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 16184: 83 ee ldi r24, 0xE3 ; 227 16186: 99 e6 ldi r25, 0x69 ; 105 16188: 0e 94 26 7c call 0xf84c ; 0xf84c #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 1618c: 83 e5 ldi r24, 0x53 ; 83 1618e: 0e 94 0d 5d call 0xba1a ; 0xba1a 16192: 88 23 and r24, r24 16194: 09 f4 brne .+2 ; 0x16198 16196: 5b cc rjmp .-1866 ; 0x15a4e 16198: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1619c: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 161a0: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 161a4: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 161a8: 52 cc rjmp .-1884 ; 0x15a4e 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 "); 161aa: 83 e1 ldi r24, 0x13 ; 19 161ac: 99 e8 ldi r25, 0x89 ; 137 161ae: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 gcode_M105(); 161b2: 0e 94 de 7a call 0xf5bc ; 0xf5bc cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 161b6: 0e 94 d8 78 call 0xf1b0 ; 0xf1b0 cmdbuffer_front_already_processed = true; 161ba: 81 e0 ldi r24, 0x01 ; 1 161bc: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d 161c0: 46 cc rjmp .-1908 ; 0x15a4e 161c2: 10 92 64 14 sts 0x1464, r1 ; 0x801464 161c6: ec c8 rjmp .-3624 ; 0x153a0 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; } 161c8: 81 e0 ldi r24, 0x01 ; 1 161ca: 80 93 62 14 sts 0x1462, r24 ; 0x801462 161ce: 3f cc rjmp .-1922 ; 0x15a4e #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 161d0: 82 e5 ldi r24, 0x52 ; 82 161d2: 0e 94 0d 5d call 0xba1a ; 0xba1a 161d6: 81 11 cpse r24, r1 161d8: 76 c8 rjmp .-3860 ; 0x152c6 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 161da: 0f 94 55 3e call 0x27caa ; 0x27caa 161de: 6b 01 movw r12, r22 161e0: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 161e2: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 161e6: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 161ea: 07 2e mov r0, r23 161ec: 00 0c add r0, r0 161ee: 88 0b sbc r24, r24 161f0: 99 0b sbc r25, r25 161f2: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 161f6: 11 e0 ldi r17, 0x01 ; 1 161f8: 20 91 5e 0e lds r18, 0x0E5E ; 0x800e5e 161fc: 30 91 5f 0e lds r19, 0x0E5F ; 0x800e5f 16200: 40 91 60 0e lds r20, 0x0E60 ; 0x800e60 16204: 50 91 61 0e lds r21, 0x0E61 ; 0x800e61 16208: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1620c: 18 16 cp r1, r24 1620e: 0c f0 brlt .+2 ; 0x16212 16210: 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 16212: 10 93 5d 0e sts 0x0E5D, r17 ; 0x800e5d <_ZL16target_direction.lto_priv.550> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 16216: c7 01 movw r24, r14 16218: b6 01 movw r22, r12 1621a: 0f 94 12 81 call 0x30224 ; 0x30224 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 1621e: 83 eb ldi r24, 0xB3 ; 179 16220: 9a e4 ldi r25, 0x4A ; 74 16222: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 16226: 0f 94 e0 0a call 0x215c0 ; 0x215c0 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 1622a: 82 e0 ldi r24, 0x02 ; 2 1622c: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db prusa_statistics(2); previous_millis_cmd.start(); 16230: 84 e8 ldi r24, 0x84 ; 132 16232: 93 e0 ldi r25, 0x03 ; 3 16234: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> 16238: 0a cc rjmp .-2028 ; 0x15a4e */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 1623a: 85 ea ldi r24, 0xA5 ; 165 1623c: 9a e4 ldi r25, 0x4A ; 74 1623e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 16242: 0f 94 e0 0a call 0x215c0 ; 0x215c0 heating_status = HeatingStatus::BED_HEATING; 16246: 83 e0 ldi r24, 0x03 ; 3 16248: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db prusa_statistics(1); if (code_seen('S')) 1624c: 83 e5 ldi r24, 0x53 ; 83 1624e: 0e 94 0d 5d call 0xba1a ; 0xba1a 16252: 18 2f mov r17, r24 16254: 88 23 and r24, r24 16256: 49 f0 breq .+18 ; 0x1626a setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 16258: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1625c: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 16260: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 16264: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 16268: 05 c0 rjmp .+10 ; 0x16274 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 1626a: 82 e5 ldi r24, 0x52 ; 82 1626c: 0e 94 0d 5d call 0xba1a ; 0xba1a 16270: 81 11 cpse r24, r1 16272: f2 cf rjmp .-28 ; 0x16258 { setTargetBed(code_value()); } codenum = _millis(); 16274: 0f 94 55 3e call 0x27caa ; 0x27caa 16278: 6b 01 movw r12, r22 1627a: 7c 01 movw r14, r24 cancel_heatup = false; 1627c: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 <_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; 16280: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 16284: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 16288: 07 2e mov r0, r23 1628a: 00 0c add r0, r0 1628c: 88 0b sbc r24, r24 1628e: 99 0b sbc r25, r25 16290: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 16294: 01 e0 ldi r16, 0x01 ; 1 16296: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 1629a: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 1629e: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 162a2: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 162a6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 162aa: 18 16 cp r1, r24 162ac: 0c f0 brlt .+2 ; 0x162b0 162ae: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 162b0: 00 93 5d 0e sts 0x0E5D, r16 ; 0x800e5d <_ZL16target_direction.lto_priv.550> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 162b4: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.402> 162b8: 81 11 cpse r24, r1 162ba: 1a c0 rjmp .+52 ; 0x162f0 162bc: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 162c0: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 162c4: 07 2e mov r0, r23 162c6: 00 0c add r0, r0 162c8: 88 0b sbc r24, r24 162ca: 99 0b sbc r25, r25 162cc: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 162d0: 20 91 ee 04 lds r18, 0x04EE ; 0x8004ee 162d4: 30 91 ef 04 lds r19, 0x04EF ; 0x8004ef 162d8: 40 91 f0 04 lds r20, 0x04F0 ; 0x8004f0 162dc: 50 91 f1 04 lds r21, 0x04F1 ; 0x8004f1 162e0: e0 91 5d 0e lds r30, 0x0E5D ; 0x800e5d <_ZL16target_direction.lto_priv.550> 162e4: ee 23 and r30, r30 162e6: 91 f0 breq .+36 ; 0x1630c 162e8: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 162ec: 18 16 cp r1, r24 162ee: a4 f0 brlt .+40 ; 0x16318 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 162f0: 8a e9 ldi r24, 0x9A ; 154 162f2: 9a e4 ldi r25, 0x4A ; 74 162f4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 162f8: 0f 94 e0 0a call 0x215c0 ; 0x215c0 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 162fc: 84 e0 ldi r24, 0x04 ; 4 162fe: 80 93 db 03 sts 0x03DB, r24 ; 0x8003db previous_millis_cmd.start(); 16302: 84 e8 ldi r24, 0x84 ; 132 16304: 93 e0 ldi r25, 0x03 ; 3 16306: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> 1630a: a1 cb rjmp .-2238 ; 0x15a4e codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 1630c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 16310: 87 ff sbrs r24, 7 16312: ee cf rjmp .-36 ; 0x162f0 16314: 11 11 cpse r17, r1 16316: ec cf rjmp .-40 ; 0x162f0 { if (lcd_commands_type == LcdCommands::LongPause) { 16318: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1631c: 82 30 cpi r24, 0x02 ; 2 1631e: 41 f3 breq .-48 ; 0x162f0 // 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. 16320: 0f 94 55 3e call 0x27caa ; 0x27caa 16324: 6c 19 sub r22, r12 16326: 7d 09 sbc r23, r13 16328: 8e 09 sbc r24, r14 1632a: 9f 09 sbc r25, r15 1632c: 69 3e cpi r22, 0xE9 ; 233 1632e: 73 40 sbci r23, 0x03 ; 3 16330: 81 05 cpc r24, r1 16332: 91 05 cpc r25, r1 16334: 30 f0 brcs .+12 ; 0x16342 { if (!farm_mode) { serialecho_temperatures(); 16336: 0e 94 7a 79 call 0xf2f4 ; 0xf2f4 } codenum = _millis(); 1633a: 0f 94 55 3e call 0x27caa ; 0x27caa 1633e: 6b 01 movw r12, r22 16340: 7c 01 movw r14, r24 } manage_heater(); 16342: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(); 16346: 80 e0 ldi r24, 0x00 ; 0 16348: 0e 94 6b 8c call 0x118d6 ; 0x118d6 lcd_update(0); 1634c: 80 e0 ldi r24, 0x00 ; 0 1634e: 0e 94 ed 6f call 0xdfda ; 0xdfda 16352: b0 cf rjmp .-160 ; 0x162b4 #### 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')){ 16354: 83 e5 ldi r24, 0x53 ; 83 16356: 0e 94 0d 5d call 0xba1a ; 0xba1a 1635a: 88 23 and r24, r24 1635c: 29 f0 breq .+10 ; 0x16368 fanSpeed = code_value_uint8(); 1635e: 0e 94 9f 5c call 0xb93e ; 0xb93e 16362: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 16366: 73 cb rjmp .-2330 ; 0x15a4e } else { fanSpeed = 255; 16368: 8f ef ldi r24, 0xFF ; 255 1636a: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 1636e: 6f cb rjmp .-2338 ; 0x15a4e /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 16370: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df 16374: 6c cb rjmp .-2344 ; 0x15a4e /*! ### 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; 16376: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 1637a: 88 60 ori r24, 0x08 ; 8 1637c: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd 16380: 66 cb rjmp .-2356 ; 0x15a4e ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 16382: 83 e5 ldi r24, 0x53 ; 83 16384: 0e 94 0d 5d call 0xba1a ; 0xba1a 16388: 88 23 and r24, r24 1638a: 99 f0 breq .+38 ; 0x163b2 stepper_inactive_time = code_value() * 1000; 1638c: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16390: 20 e0 ldi r18, 0x00 ; 0 16392: 30 e0 ldi r19, 0x00 ; 0 16394: 4a e7 ldi r20, 0x7A ; 122 16396: 54 e4 ldi r21, 0x44 ; 68 16398: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1639c: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 163a0: 60 93 34 02 sts 0x0234, r22 ; 0x800234 163a4: 70 93 35 02 sts 0x0235, r23 ; 0x800235 163a8: 80 93 36 02 sts 0x0236, r24 ; 0x800236 163ac: 90 93 37 02 sts 0x0237, r25 ; 0x800237 163b0: 4e cb rjmp .-2404 ; 0x15a4e } 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]))); 163b2: 88 e5 ldi r24, 0x58 ; 88 163b4: 0e 94 0d 5d call 0xba1a ; 0xba1a 163b8: 88 23 and r24, r24 163ba: d1 f0 breq .+52 ; 0x163f0 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 163bc: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 if (code_seen('X')) disable_x(); 163c0: 88 e5 ldi r24, 0x58 ; 88 163c2: 0e 94 0d 5d call 0xba1a ; 0xba1a 163c6: 81 11 cpse r24, r1 163c8: 28 c0 rjmp .+80 ; 0x1641a if (code_seen('Y')) disable_y(); 163ca: 89 e5 ldi r24, 0x59 ; 89 163cc: 0e 94 0d 5d call 0xba1a ; 0xba1a 163d0: 88 23 and r24, r24 163d2: 19 f0 breq .+6 ; 0x163da 163d4: 16 9a sbi 0x02, 6 ; 2 163d6: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e if (code_seen('Z')) disable_z(); 163da: 8a e5 ldi r24, 0x5A ; 90 163dc: 0e 94 0d 5d call 0xba1a ; 0xba1a #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 163e0: 85 e4 ldi r24, 0x45 ; 69 163e2: 0e 94 0d 5d call 0xba1a ; 0xba1a 163e6: 88 23 and r24, r24 163e8: 09 f4 brne .+2 ; 0x163ec 163ea: 31 cb rjmp .-2462 ; 0x15a4e 163ec: 14 9a sbi 0x02, 4 ; 2 163ee: 2f cb rjmp .-2466 ; 0x15a4e 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]))); 163f0: 89 e5 ldi r24, 0x59 ; 89 163f2: 0e 94 0d 5d call 0xba1a ; 0xba1a 163f6: 81 11 cpse r24, r1 163f8: e1 cf rjmp .-62 ; 0x163bc 163fa: 8a e5 ldi r24, 0x5A ; 90 163fc: 0e 94 0d 5d call 0xba1a ; 0xba1a 16400: 81 11 cpse r24, r1 16402: dc cf rjmp .-72 ; 0x163bc 16404: 85 e4 ldi r24, 0x45 ; 69 16406: 0e 94 0d 5d call 0xba1a ; 0xba1a 1640a: 81 11 cpse r24, r1 1640c: d7 cf rjmp .-82 ; 0x163bc if(all_axis) { st_synchronize(); 1640e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 disable_e0(); 16412: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 16414: 0e 94 24 84 call 0x10848 ; 0x10848 16418: 1a cb rjmp .-2508 ; 0x15a4e } else { st_synchronize(); if (code_seen('X')) disable_x(); 1641a: 17 9a sbi 0x02, 7 ; 2 1641c: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d 16420: d4 cf rjmp .-88 ; 0x163ca #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 16422: 83 e5 ldi r24, 0x53 ; 83 16424: 0e 94 0d 5d call 0xba1a ; 0xba1a 16428: 88 23 and r24, r24 1642a: 09 f4 brne .+2 ; 0x1642e 1642c: 10 cb rjmp .-2528 ; 0x15a4e safetytimer_inactive_time = code_value() * 1000; 1642e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16432: 20 e0 ldi r18, 0x00 ; 0 16434: 30 e0 ldi r19, 0x00 ; 0 16436: 4a e7 ldi r20, 0x7A ; 122 16438: 54 e4 ldi r21, 0x44 ; 68 1643a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1643e: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 16442: 60 93 30 02 sts 0x0230, r22 ; 0x800230 16446: 70 93 31 02 sts 0x0231, r23 ; 0x800231 1644a: 80 93 32 02 sts 0x0232, r24 ; 0x800232 1644e: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 16452: 88 ed ldi r24, 0xD8 ; 216 16454: 95 e0 ldi r25, 0x05 ; 5 16456: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> 1645a: f9 ca rjmp .-2574 ; 0x15a4e 1645c: 7d ed ldi r23, 0xDD ; 221 1645e: c7 2e mov r12, r23 16460: 72 e0 ldi r23, 0x02 ; 2 16462: d7 2e mov r13, r23 16464: eb e6 ldi r30, 0x6B ; 107 16466: ee 2e mov r14, r30 16468: e6 e0 ldi r30, 0x06 ; 6 1646a: 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++) 1646c: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 1646e: f6 01 movw r30, r12 16470: 81 91 ld r24, Z+ 16472: 6f 01 movw r12, r30 16474: 0e 94 0d 5d call 0xba1a ; 0xba1a 16478: 88 23 and r24, r24 1647a: 09 f4 brne .+2 ; 0x1647e 1647c: 65 c0 rjmp .+202 ; 0x16548 { float value = code_value(); 1647e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16482: 2b 01 movw r4, r22 16484: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 16486: 13 30 cpi r17, 0x03 ; 3 16488: 09 f0 breq .+2 ; 0x1648c 1648a: 68 c0 rjmp .+208 ; 0x1655c if(value < 20.0) { 1648c: 20 e0 ldi r18, 0x00 ; 0 1648e: 30 e0 ldi r19, 0x00 ; 0 16490: 40 ea ldi r20, 0xA0 ; 160 16492: 51 e4 ldi r21, 0x41 ; 65 16494: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 16498: 87 ff sbrs r24, 7 1649a: 4e c0 rjmp .+156 ; 0x16538 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 1649c: a3 01 movw r20, r6 1649e: 92 01 movw r18, r4 164a0: 60 91 7b 06 lds r22, 0x067B ; 0x80067b 164a4: 70 91 7c 06 lds r23, 0x067C ; 0x80067c 164a8: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 164ac: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 164b0: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 164b4: 4b 01 movw r8, r22 164b6: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 164b8: ac 01 movw r20, r24 164ba: 9b 01 movw r18, r22 164bc: 60 91 bf 06 lds r22, 0x06BF ; 0x8006bf 164c0: 70 91 c0 06 lds r23, 0x06C0 ; 0x8006c0 164c4: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 164c8: 90 91 c2 06 lds r25, 0x06C2 ; 0x8006c2 164cc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 164d0: 60 93 bf 06 sts 0x06BF, r22 ; 0x8006bf 164d4: 70 93 c0 06 sts 0x06C0, r23 ; 0x8006c0 164d8: 80 93 c1 06 sts 0x06C1, r24 ; 0x8006c1 164dc: 90 93 c2 06 sts 0x06C2, r25 ; 0x8006c2 max_feedrate[E_AXIS] *= factor; 164e0: 20 90 99 02 lds r2, 0x0299 ; 0x800299 164e4: 30 90 9a 02 lds r3, 0x029A ; 0x80029a 164e8: a5 01 movw r20, r10 164ea: 94 01 movw r18, r8 164ec: d1 01 movw r26, r2 164ee: 1c 96 adiw r26, 0x0c ; 12 164f0: 6d 91 ld r22, X+ 164f2: 7d 91 ld r23, X+ 164f4: 8d 91 ld r24, X+ 164f6: 9c 91 ld r25, X 164f8: 1f 97 sbiw r26, 0x0f ; 15 164fa: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 164fe: f1 01 movw r30, r2 16500: 64 87 std Z+12, r22 ; 0x0c 16502: 75 87 std Z+13, r23 ; 0x0d 16504: 86 87 std Z+14, r24 ; 0x0e 16506: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 16508: 60 91 f9 17 lds r22, 0x17F9 ; 0x8017f9 1650c: 70 91 fa 17 lds r23, 0x17FA ; 0x8017fa 16510: 80 91 fb 17 lds r24, 0x17FB ; 0x8017fb 16514: 90 91 fc 17 lds r25, 0x17FC ; 0x8017fc 16518: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 1651c: a5 01 movw r20, r10 1651e: 94 01 movw r18, r8 16520: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 16524: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 16528: 60 93 f9 17 sts 0x17F9, r22 ; 0x8017f9 1652c: 70 93 fa 17 sts 0x17FA, r23 ; 0x8017fa 16530: 80 93 fb 17 sts 0x17FB, r24 ; 0x8017fb 16534: 90 93 fc 17 sts 0x17FC, r25 ; 0x8017fc } cs.axis_steps_per_mm[E_AXIS] = value; 16538: 40 92 7b 06 sts 0x067B, r4 ; 0x80067b 1653c: 50 92 7c 06 sts 0x067C, r5 ; 0x80067c 16540: 60 92 7d 06 sts 0x067D, r6 ; 0x80067d 16544: 70 92 7e 06 sts 0x067E, r7 ; 0x80067e 16548: b4 e0 ldi r27, 0x04 ; 4 1654a: eb 0e add r14, r27 1654c: f1 1c adc r15, r1 1654e: 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++) 16550: 14 30 cpi r17, 0x04 ; 4 16552: 09 f0 breq .+2 ; 0x16556 16554: 8c cf rjmp .-232 ; 0x1646e } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 16556: 0f 94 03 aa call 0x35406 ; 0x35406 1655a: 79 ca rjmp .-2830 ; 0x15a4e 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; 1655c: d7 01 movw r26, r14 1655e: 14 96 adiw r26, 0x04 ; 4 16560: 4d 92 st X+, r4 16562: 5d 92 st X+, r5 16564: 6d 92 st X+, r6 16566: 7c 92 st X, r7 16568: 17 97 sbiw r26, 0x07 ; 7 1656a: ee cf rjmp .-36 ; 0x16548 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 1656c: 8e e4 ldi r24, 0x4E ; 78 1656e: 0e 94 0d 5d call 0xba1a ; 0xba1a 16572: 88 23 and r24, r24 16574: 09 f4 brne .+2 ; 0x16578 16576: 6b ca rjmp .-2858 ; 0x15a4e gcode_LastN = code_value_long(); 16578: 0e 94 b9 5c call 0xb972 ; 0xb972 1657c: 60 93 78 03 sts 0x0378, r22 ; 0x800378 16580: 70 93 79 03 sts 0x0379, r23 ; 0x800379 16584: 80 93 7a 03 sts 0x037A, r24 ; 0x80037a 16588: 90 93 7b 03 sts 0x037B, r25 ; 0x80037b 1658c: 60 ca rjmp .-2880 ; 0x15a4e case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 1658e: 84 e1 ldi r24, 0x14 ; 20 16590: 9b ea ldi r25, 0xAB ; 171 16592: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 16596: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 1659a: d1 2c mov r13, r1 1659c: f1 2c mov r15, r1 1659e: 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); } 165a0: 8c e0 ldi r24, 0x0C ; 12 165a2: 99 e8 ldi r25, 0x89 ; 137 165a4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 165a8: 4a e0 ldi r20, 0x0A ; 10 165aa: c7 01 movw r24, r14 165ac: b6 01 movw r22, r12 165ae: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 165b2: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 165b6: 4b ca rjmp .-2922 ; 0x15a4e */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 165b8: 85 e5 ldi r24, 0x55 ; 85 165ba: 0e 94 0d 5d call 0xba1a ; 0xba1a 165be: 88 23 and r24, r24 165c0: 09 f4 brne .+2 ; 0x165c4 165c2: 5a c0 rjmp .+180 ; 0x16678 // 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); 165c4: 00 91 93 03 lds r16, 0x0393 ; 0x800393 165c8: 10 91 94 03 lds r17, 0x0394 ; 0x800394 165cc: 0f 5f subi r16, 0xFF ; 255 165ce: 1f 4f sbci r17, 0xFF ; 255 165d0: 10 93 94 03 sts 0x0394, r17 ; 0x800394 165d4: 00 93 93 03 sts 0x0393, r16 ; 0x800393 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 165d8: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 165dc: 88 23 and r24, r24 165de: 09 f4 brne .+2 ; 0x165e2 165e0: 36 ca rjmp .-2964 ; 0x15a4e // 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)) 165e2: be 01 movw r22, r28 165e4: 6f 5f subi r22, 0xFF ; 255 165e6: 7f 4f sbci r23, 0xFF ; 255 165e8: c8 01 movw r24, r16 165ea: 0e 94 4e f8 call 0x1f09c ; 0x1f09c 165ee: 88 23 and r24, r24 165f0: 09 f4 brne .+2 ; 0x165f4 165f2: 2d ca rjmp .-2982 ; 0x15a4e 165f4: 87 ea ldi r24, 0xA7 ; 167 165f6: 90 e9 ldi r25, 0x90 ; 144 165f8: de 01 movw r26, r28 165fa: 11 96 adiw r26, 0x01 ; 1 165fc: be 01 movw r22, r28 165fe: 67 5f subi r22, 0xF7 ; 247 16600: 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]); 16602: fc 01 movw r30, r24 16604: 45 91 lpm r20, Z+ 16606: 54 91 lpm r21, Z if (ver_gcode[i] > v) 16608: 2d 91 ld r18, X+ 1660a: 3d 91 ld r19, X+ 1660c: 42 17 cp r20, r18 1660e: 53 07 cpc r21, r19 16610: 10 f4 brcc .+4 ; 0x16616 16612: 0c 94 8b ce jmp 0x19d16 ; 0x19d16 return 1; else if (ver_gcode[i] < v) 16616: 24 17 cp r18, r20 16618: 35 07 cpc r19, r21 1661a: 08 f4 brcc .+2 ; 0x1661e 1661c: 18 ca rjmp .-3024 ; 0x15a4e 1661e: 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) 16620: a6 17 cp r26, r22 16622: b7 07 cpc r27, r23 16624: 71 f7 brne .-36 ; 0x16602 16626: 13 ca rjmp .-3034 ; 0x15a4e 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)); 16628: 84 e9 ldi r24, 0x94 ; 148 1662a: 99 e3 ldi r25, 0x39 ; 57 1662c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 16630: ac 01 movw r20, r24 16632: 63 e0 ldi r22, 0x03 ; 3 16634: 80 e0 ldi r24, 0x00 ; 0 16636: 0e 94 3a 70 call 0xe074 ; 0xe074 Sound_MakeCustom(50,1000,false); 1663a: 40 e0 ldi r20, 0x00 ; 0 1663c: 68 ee ldi r22, 0xE8 ; 232 1663e: 73 e0 ldi r23, 0x03 ; 3 16640: 82 e3 ldi r24, 0x32 ; 50 16642: 90 e0 ldi r25, 0x00 ; 0 16644: 0f 94 1a 69 call 0x2d234 ; 0x2d234 delay_keep_alive(500); 16648: 84 ef ldi r24, 0xF4 ; 244 1664a: 91 e0 ldi r25, 0x01 ; 1 1664c: 0e 94 10 8f call 0x11e20 ; 0x11e20 Sound_MakeCustom(50,1000,false); 16650: 40 e0 ldi r20, 0x00 ; 0 16652: 68 ee ldi r22, 0xE8 ; 232 16654: 73 e0 ldi r23, 0x03 ; 3 16656: 82 e3 ldi r24, 0x32 ; 50 16658: 90 e0 ldi r25, 0x00 ; 0 1665a: 0f 94 1a 69 call 0x2d234 ; 0x2d234 lcd_wait_for_click_delay(30); 1665e: 8e e1 ldi r24, 0x1E ; 30 16660: 90 e0 ldi r25, 0x00 ; 0 16662: 0f 94 39 4f call 0x29e72 ; 0x29e72 lcd_update_enable(true); 16666: 81 e0 ldi r24, 0x01 ; 1 16668: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_clear(); 1666c: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_update(0); 16670: 80 e0 ldi r24, 0x00 ; 0 16672: 0e 94 ed 6f call 0xdfda ; 0xdfda 16676: eb c9 rjmp .-3114 ; 0x15a4e } 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); 16678: 41 e1 ldi r20, 0x11 ; 17 1667a: 50 e0 ldi r21, 0x00 ; 0 1667c: 60 e8 ldi r22, 0x80 ; 128 1667e: 7c e0 ldi r23, 0x0C ; 12 16680: ce 01 movw r24, r28 16682: 01 96 adiw r24, 0x01 ; 1 16684: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 16688: 8e ee ldi r24, 0xEE ; 238 1668a: 98 e8 ldi r25, 0x88 ; 136 1668c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 16690: 85 e8 ldi r24, 0x85 ; 133 16692: 96 e8 ldi r25, 0x86 ; 134 16694: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM("+"); 16698: 8c ee ldi r24, 0xEC ; 236 1669a: 98 e8 ldi r25, 0x88 ; 136 1669c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 166a0: 87 ee ldi r24, 0xE7 ; 231 166a2: 98 e8 ldi r25, 0x88 ; 136 166a4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM("_"); 166a8: 85 ee ldi r24, 0xE5 ; 229 166aa: 98 e8 ldi r25, 0x88 ; 136 166ac: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM(FW_COMMIT_HASH); 166b0: 8b ed ldi r24, 0xDB ; 219 166b2: 98 e8 ldi r25, 0x88 ; 136 166b4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 166b8: 81 e8 ldi r24, 0x81 ; 129 166ba: 98 e8 ldi r25, 0x88 ; 136 166bc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM(PROTOCOL_VERSION); 166c0: 8d e7 ldi r24, 0x7D ; 125 166c2: 98 e8 ldi r25, 0x88 ; 136 166c4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 166c8: 8e e6 ldi r24, 0x6E ; 110 166ca: 98 e8 ldi r25, 0x88 ; 136 166cc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 166d0: ce 01 movw r24, r28 166d2: 01 96 adiw r24, 0x01 ; 1 166d4: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 166d8: 8c e5 ldi r24, 0x5C ; 92 166da: 98 e8 ldi r25, 0x88 ; 136 166dc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 166e0: 8b e5 ldi r24, 0x5B ; 91 166e2: 98 e8 ldi r25, 0x88 ; 136 166e4: 0e 94 97 7b call 0xf72e ; 0xf72e } #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'); 166e8: 1f 92 push r1 166ea: 61 e3 ldi r22, 0x31 ; 49 166ec: f6 2e mov r15, r22 166ee: ff 92 push r15 166f0: 84 e7 ldi r24, 0x74 ; 116 166f2: 96 e8 ldi r25, 0x86 ; 134 166f4: 9f 93 push r25 166f6: 8f 93 push r24 166f8: 0d e2 ldi r16, 0x2D ; 45 166fa: 16 e8 ldi r17, 0x86 ; 134 166fc: 1f 93 push r17 166fe: 0f 93 push r16 16700: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 16704: 1f 92 push r1 16706: ff 92 push r15 16708: 84 e6 ldi r24, 0x64 ; 100 1670a: 96 e8 ldi r25, 0x86 ; 134 1670c: 9f 93 push r25 1670e: 8f 93 push r24 16710: 1f 93 push r17 16712: 0f 93 push r16 16714: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 16718: 1f 92 push r1 1671a: ff 92 push r15 1671c: 80 e5 ldi r24, 0x50 ; 80 1671e: 96 e8 ldi r25, 0x86 ; 134 16720: 9f 93 push r25 16722: 8f 93 push r24 16724: 1f 93 push r17 16726: 0f 93 push r16 16728: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1672c: 1f 92 push r1 1672e: ff 92 push r15 16730: 83 e4 ldi r24, 0x43 ; 67 16732: 96 e8 ldi r25, 0x86 ; 134 16734: 9f 93 push r25 16736: 8f 93 push r24 16738: 1f 93 push r17 1673a: 0f 93 push r16 1673c: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 16740: 1f 92 push r1 16742: ff 92 push r15 16744: 88 e3 ldi r24, 0x38 ; 56 16746: 96 e8 ldi r25, 0x86 ; 134 16748: 9f 93 push r25 1674a: 8f 93 push r24 1674c: 1f 93 push r17 1674e: 0f 93 push r16 16750: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 16754: 0f b6 in r0, 0x3f ; 63 16756: f8 94 cli 16758: de bf out 0x3e, r29 ; 62 1675a: 0f be out 0x3f, r0 ; 63 1675c: cd bf out 0x3d, r28 ; 61 1675e: 77 c9 rjmp .-3346 ; 0x15a4e /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 16760: 0e 94 63 7a call 0xf4c6 ; 0xf4c6 16764: 74 c9 rjmp .-3352 ; 0x15a4e /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 16766: e0 91 93 03 lds r30, 0x0393 ; 0x800393 1676a: f0 91 94 03 lds r31, 0x0394 ; 0x800394 1676e: cf 01 movw r24, r30 16770: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 16772: 24 81 ldd r18, Z+4 ; 0x04 16774: 20 32 cpi r18, 0x20 ; 32 16776: 09 f4 brne .+2 ; 0x1677a 16778: 01 96 adiw r24, 0x01 ; 1 1677a: 0f 94 20 14 call 0x22840 ; 0x22840 custom_message_type = CustomMsg::M117; 1677e: 87 e0 ldi r24, 0x07 ; 7 16780: 80 93 72 07 sts 0x0772, r24 ; 0x800772 16784: 64 c9 rjmp .-3384 ; 0x15a4e - `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; 16786: 00 91 93 03 lds r16, 0x0393 ; 0x800393 1678a: 10 91 94 03 lds r17, 0x0394 ; 0x800394 1678e: 0b 5f subi r16, 0xFB ; 251 16790: 1f 4f sbci r17, 0xFF ; 255 16792: 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; 16794: f1 2c mov r15, r1 16796: 40 e0 ldi r20, 0x00 ; 0 16798: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 1679a: e9 f0 breq .+58 ; 0x167d6 // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 1679c: d8 01 movw r26, r16 1679e: 9c 91 ld r25, X 167a0: 29 2f mov r18, r25 167a2: 2b 7f andi r18, 0xFB ; 251 167a4: 21 34 cpi r18, 0x41 ; 65 167a6: b9 f4 brne .+46 ; 0x167d6 167a8: 11 96 adiw r26, 0x01 ; 1 167aa: 2c 91 ld r18, X 167ac: 21 33 cpi r18, 0x31 ; 49 167ae: 99 f4 brne .+38 ; 0x167d6 switch (p[0]) { 167b0: 91 34 cpi r25, 0x41 ; 65 167b2: 71 f0 breq .+28 ; 0x167d0 167b4: 95 34 cpi r25, 0x45 ; 69 167b6: 09 f4 brne .+2 ; 0x167ba case 'A': hasA = true; break; case 'E': hasE = true; break; 167b8: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 167ba: 98 01 movw r18, r16 167bc: 2e 5f subi r18, 0xFE ; 254 167be: 3f 4f sbci r19, 0xFF ; 255 167c0: 89 01 movw r16, r18 167c2: 2f 5f subi r18, 0xFF ; 255 167c4: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 167c6: f8 01 movw r30, r16 167c8: 90 81 ld r25, Z 167ca: 90 32 cpi r25, 0x20 ; 32 167cc: c9 f3 breq .-14 ; 0x167c0 167ce: e4 cf rjmp .-56 ; 0x16798 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; 167d0: ff 24 eor r15, r15 167d2: f3 94 inc r15 167d4: f2 cf rjmp .-28 ; 0x167ba } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 167d6: 44 23 and r20, r20 167d8: 21 f0 breq .+8 ; 0x167e2 167da: 84 e1 ldi r24, 0x14 ; 20 167dc: 9b ea ldi r25, 0xAB ; 171 167de: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if (hasA) SERIAL_ECHOPGM("//"); 167e2: ff 20 and r15, r15 167e4: 21 f0 breq .+8 ; 0x167ee 167e6: 88 e5 ldi r24, 0x58 ; 88 167e8: 98 e8 ldi r25, 0x88 ; 136 167ea: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(p); 167ee: c8 01 movw r24, r16 167f0: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 167f4: 2c c9 rjmp .-3496 ; 0x15a4e /*! ### 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 167f6: 8a ec ldi r24, 0xCA ; 202 167f8: 99 e6 ldi r25, 0x69 ; 105 167fa: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLLN(); 167fe: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 16802: 82 ec ldi r24, 0xC2 ; 194 16804: 99 e6 ldi r25, 0x69 ; 105 16806: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 1680a: 1e 99 sbic 0x03, 6 ; 3 1680c: 47 c0 rjmp .+142 ; 0x1689c SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1680e: 8d eb ldi r24, 0xBD ; 189 16810: 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); 16812: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16816: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 1681a: 8b ea ldi r24, 0xAB ; 171 1681c: 99 e6 ldi r25, 0x69 ; 105 1681e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 16822: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 16826: 82 fd sbrc r24, 2 16828: 3c c0 rjmp .+120 ; 0x168a2 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1682a: 8d eb ldi r24, 0xBD ; 189 1682c: 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); 1682e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16832: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 16836: 83 ea ldi r24, 0xA3 ; 163 16838: 99 e6 ldi r25, 0x69 ; 105 1683a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 1683e: 1d 99 sbic 0x03, 5 ; 3 16840: 33 c0 rjmp .+102 ; 0x168a8 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16842: 8d eb ldi r24, 0xBD ; 189 16844: 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); 16846: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1684a: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 1684e: 8b e9 ldi r24, 0x9B ; 155 16850: 99 e6 ldi r25, 0x69 ; 105 16852: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 16856: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1685a: 87 fd sbrc r24, 7 1685c: 28 c0 rjmp .+80 ; 0x168ae SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1685e: 8d eb ldi r24, 0xBD ; 189 16860: 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); 16862: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16866: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 1686a: 83 e9 ldi r24, 0x93 ; 147 1686c: 99 e6 ldi r25, 0x69 ; 105 1686e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 16872: 1c 99 sbic 0x03, 4 ; 3 16874: 1f c0 rjmp .+62 ; 0x168b4 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 16876: 8d eb ldi r24, 0xBD ; 189 16878: 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); 1687a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1687e: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 16882: 8b e8 ldi r24, 0x8B ; 139 16884: 99 e6 ldi r25, 0x69 ; 105 16886: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 1688a: 01 9b sbis 0x00, 1 ; 0 1688c: 16 c0 rjmp .+44 ; 0x168ba SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 1688e: 8d eb ldi r24, 0xBD ; 189 16890: 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); 16892: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 16896: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 1689a: d9 c8 rjmp .-3662 ; 0x15a4e 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); 1689c: 83 eb ldi r24, 0xB3 ; 179 1689e: 99 e6 ldi r25, 0x69 ; 105 168a0: b8 cf rjmp .-144 ; 0x16812 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); 168a2: 83 eb ldi r24, 0xB3 ; 179 168a4: 99 e6 ldi r25, 0x69 ; 105 168a6: c3 cf rjmp .-122 ; 0x1682e 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); 168a8: 83 eb ldi r24, 0xB3 ; 179 168aa: 99 e6 ldi r25, 0x69 ; 105 168ac: cc cf rjmp .-104 ; 0x16846 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); 168ae: 83 eb ldi r24, 0xB3 ; 179 168b0: 99 e6 ldi r25, 0x69 ; 105 168b2: d7 cf rjmp .-82 ; 0x16862 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); 168b4: 83 eb ldi r24, 0xB3 ; 179 168b6: 99 e6 ldi r25, 0x69 ; 105 168b8: e0 cf rjmp .-64 ; 0x1687a 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); 168ba: 83 eb ldi r24, 0xB3 ; 179 168bc: 99 e6 ldi r25, 0x69 ; 105 168be: e9 cf rjmp .-46 ; 0x16892 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 168c0: 0e 94 ca 67 call 0xcf94 ; 0xcf94 168c4: c4 c8 rjmp .-3704 ; 0x15a4e */ 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')) { 168c6: 84 e5 ldi r24, 0x54 ; 84 168c8: 0e 94 0d 5d call 0xba1a ; 0xba1a 168cc: 88 23 and r24, r24 168ce: 69 f0 breq .+26 ; 0x168ea extruder = code_value_uint8(); 168d0: 0e 94 9f 5c call 0xb93e ; 0xb93e if(extruder >= EXTRUDERS) { 168d4: 88 23 and r24, r24 168d6: 49 f0 breq .+18 ; 0x168ea SERIAL_ECHO_START; 168d8: 84 e1 ldi r24, 0x14 ; 20 168da: 9b ea ldi r25, 0xAB ; 171 168dc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 168e0: 84 e7 ldi r24, 0x74 ; 116 168e2: 99 e6 ldi r25, 0x69 ; 105 168e4: 0e 94 d0 89 call 0x113a0 ; 0x113a0 168e8: b2 c8 rjmp .-3740 ; 0x15a4e SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 168ea: 84 e4 ldi r24, 0x44 ; 68 168ec: 0e 94 0d 5d call 0xba1a ; 0xba1a 168f0: 88 23 and r24, r24 168f2: 09 f4 brne .+2 ; 0x168f6 168f4: ac c8 rjmp .-3752 ; 0x15a4e float diameter = code_value(); 168f6: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 if (diameter == 0.0) { 168fa: 20 e0 ldi r18, 0x00 ; 0 168fc: 30 e0 ldi r19, 0x00 ; 0 168fe: a9 01 movw r20, r18 16900: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 16904: 81 11 cpse r24, r1 16906: 05 c0 rjmp .+10 ; 0x16912 // 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; 16908: 10 92 02 07 sts 0x0702, r1 ; 0x800702 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 1690c: 0e 94 ff 66 call 0xcdfe ; 0xcdfe 16910: 9e c8 rjmp .-3780 ; 0x15a4e // 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(); 16912: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16916: 6b 01 movw r12, r22 16918: 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]); 1691a: 20 e0 ldi r18, 0x00 ; 0 1691c: 30 e0 ldi r19, 0x00 ; 0 1691e: a9 01 movw r20, r18 16920: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 16924: 81 11 cpse r24, r1 16926: 06 c0 rjmp .+12 ; 0x16934 16928: c1 2c mov r12, r1 1692a: d1 2c mov r13, r1 1692c: 50 ee ldi r21, 0xE0 ; 224 1692e: e5 2e mov r14, r21 16930: 5f e3 ldi r21, 0x3F ; 63 16932: f5 2e mov r15, r21 16934: c0 92 03 07 sts 0x0703, r12 ; 0x800703 16938: d0 92 04 07 sts 0x0704, r13 ; 0x800704 1693c: e0 92 05 07 sts 0x0705, r14 ; 0x800705 16940: f0 92 06 07 sts 0x0706, r15 ; 0x800706 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; 16944: 81 e0 ldi r24, 0x01 ; 1 16946: 80 93 02 07 sts 0x0702, r24 ; 0x800702 1694a: e0 cf rjmp .-64 ; 0x1690c 1694c: 3d ed ldi r19, 0xDD ; 221 1694e: c3 2e mov r12, r19 16950: 32 e0 ldi r19, 0x02 ; 2 16952: d3 2e mov r13, r19 16954: 4b e6 ldi r20, 0x6B ; 107 16956: e4 2e mov r14, r20 16958: 46 e0 ldi r20, 0x06 ; 6 1695a: 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++) 1695c: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 1695e: d6 01 movw r26, r12 16960: 8d 91 ld r24, X+ 16962: 6d 01 movw r12, r26 16964: 0e 94 0d 5d call 0xba1a ; 0xba1a 16968: 88 23 and r24, r24 1696a: 41 f1 breq .+80 ; 0x169bc { unsigned long val = code_value(); 1696c: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16970: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 16974: 12 30 cpi r17, 0x02 ; 2 16976: 4c f5 brge .+82 ; 0x169ca { if (val > NORMAL_MAX_ACCEL_XY) 16978: 65 3c cpi r22, 0xC5 ; 197 1697a: b9 e0 ldi r27, 0x09 ; 9 1697c: 7b 07 cpc r23, r27 1697e: 81 05 cpc r24, r1 16980: 91 05 cpc r25, r1 16982: 40 f5 brcc .+80 ; 0x169d4 16984: 56 2f mov r21, r22 16986: 47 2f mov r20, r23 16988: 38 2f mov r19, r24 1698a: 29 2f mov r18, r25 1698c: 61 3c cpi r22, 0xC1 ; 193 1698e: e3 e0 ldi r30, 0x03 ; 3 16990: 7e 07 cpc r23, r30 16992: 81 05 cpc r24, r1 16994: 91 05 cpc r25, r1 16996: 20 f0 brcs .+8 ; 0x169a0 16998: 50 ec ldi r21, 0xC0 ; 192 1699a: 43 e0 ldi r20, 0x03 ; 3 1699c: 30 e0 ldi r19, 0x00 ; 0 1699e: 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; 169a0: d7 01 movw r26, r14 169a2: 94 96 adiw r26, 0x24 ; 36 169a4: 6d 93 st X+, r22 169a6: 7d 93 st X+, r23 169a8: 8d 93 st X+, r24 169aa: 9c 93 st X, r25 169ac: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 169ae: f7 01 movw r30, r14 169b0: e4 55 subi r30, 0x54 ; 84 169b2: ff 4f sbci r31, 0xFF ; 255 169b4: 50 83 st Z, r21 169b6: 41 83 std Z+1, r20 ; 0x01 169b8: 32 83 std Z+2, r19 ; 0x02 169ba: 23 83 std Z+3, r18 ; 0x03 169bc: b4 e0 ldi r27, 0x04 ; 4 169be: eb 0e add r14, r27 169c0: f1 1c adc r15, r1 169c2: 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++) 169c4: 14 30 cpi r17, 0x04 ; 4 169c6: 59 f6 brne .-106 ; 0x1695e 169c8: c6 cd rjmp .-1140 ; 0x16556 { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 169ca: 56 2f mov r21, r22 169cc: 47 2f mov r20, r23 169ce: 38 2f mov r19, r24 169d0: 29 2f mov r18, r25 169d2: e6 cf rjmp .-52 ; 0x169a0 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; 169d4: 50 ec ldi r21, 0xC0 ; 192 169d6: 43 e0 ldi r20, 0x03 ; 3 169d8: 30 e0 ldi r19, 0x00 ; 0 169da: 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; 169dc: 64 ec ldi r22, 0xC4 ; 196 169de: 79 e0 ldi r23, 0x09 ; 9 169e0: 80 e0 ldi r24, 0x00 ; 0 169e2: 90 e0 ldi r25, 0x00 ; 0 169e4: dd cf rjmp .-70 ; 0x169a0 169e6: 9d ed ldi r25, 0xDD ; 221 169e8: a9 2e mov r10, r25 169ea: 92 e0 ldi r25, 0x02 ; 2 169ec: b9 2e mov r11, r25 169ee: 2b e6 ldi r18, 0x6B ; 107 169f0: c2 2e mov r12, r18 169f2: 26 e0 ldi r18, 0x06 ; 6 169f4: 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++) 169f6: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 169f8: f5 01 movw r30, r10 169fa: 81 91 ld r24, Z+ 169fc: 5f 01 movw r10, r30 169fe: 0e 94 0d 5d call 0xba1a ; 0xba1a 16a02: 88 23 and r24, r24 16a04: 71 f1 breq .+92 ; 0x16a62 { float val = code_value(); 16a06: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16a0a: 7b 01 movw r14, r22 16a0c: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 16a0e: f1 e0 ldi r31, 0x01 ; 1 16a10: f9 15 cp r31, r9 16a12: b8 f1 brcs .+110 ; 0x16a82 { if (val > NORMAL_MAX_FEEDRATE_XY) 16a14: 20 e0 ldi r18, 0x00 ; 0 16a16: 30 e0 ldi r19, 0x00 ; 0 16a18: 48 e4 ldi r20, 0x48 ; 72 16a1a: 53 e4 ldi r21, 0x43 ; 67 16a1c: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 16a20: 18 16 cp r1, r24 16a22: 44 f1 brlt .+80 ; 0x16a74 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(); 16a24: 5e 2c mov r5, r14 16a26: 6f 2c mov r6, r15 16a28: 70 2e mov r7, r16 16a2a: 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) 16a2c: 20 e0 ldi r18, 0x00 ; 0 16a2e: 30 e0 ldi r19, 0x00 ; 0 16a30: 48 ec ldi r20, 0xC8 ; 200 16a32: 52 e4 ldi r21, 0x42 ; 66 16a34: b7 01 movw r22, r14 16a36: c8 01 movw r24, r16 16a38: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 16a3c: 18 16 cp r1, r24 16a3e: 34 f1 brlt .+76 ; 0x16a8c val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 16a40: 85 2d mov r24, r5 16a42: 96 2d mov r25, r6 16a44: a7 2d mov r26, r7 16a46: b8 2d mov r27, r8 16a48: f6 01 movw r30, r12 16a4a: 84 8b std Z+20, r24 ; 0x14 16a4c: 95 8b std Z+21, r25 ; 0x15 16a4e: a6 8b std Z+22, r26 ; 0x16 16a50: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 16a52: c7 01 movw r24, r14 16a54: d8 01 movw r26, r16 16a56: e4 56 subi r30, 0x64 ; 100 16a58: ff 4f sbci r31, 0xFF ; 255 16a5a: 80 83 st Z, r24 16a5c: 91 83 std Z+1, r25 ; 0x01 16a5e: a2 83 std Z+2, r26 ; 0x02 16a60: 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++) 16a62: 93 94 inc r9 16a64: f4 e0 ldi r31, 0x04 ; 4 16a66: cf 0e add r12, r31 16a68: d1 1c adc r13, r1 16a6a: 24 e0 ldi r18, 0x04 ; 4 16a6c: 92 12 cpse r9, r18 16a6e: c4 cf rjmp .-120 ; 0x169f8 16a70: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 16a74: 51 2c mov r5, r1 16a76: 61 2c mov r6, r1 16a78: b8 e4 ldi r27, 0x48 ; 72 16a7a: 7b 2e mov r7, r27 16a7c: 83 e4 ldi r24, 0x43 ; 67 16a7e: 88 2e mov r8, r24 16a80: d5 cf rjmp .-86 ; 0x16a2c 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(); 16a82: 56 2e mov r5, r22 16a84: 6f 2c mov r6, r15 16a86: 78 2e mov r7, r24 16a88: 81 2e mov r8, r17 16a8a: da cf rjmp .-76 ; 0x16a40 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; 16a8c: e1 2c mov r14, r1 16a8e: f1 2c mov r15, r1 16a90: 08 ec ldi r16, 0xC8 ; 200 16a92: 12 e4 ldi r17, 0x42 ; 66 16a94: d5 cf rjmp .-86 ; 0x16a40 // 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')) 16a96: 80 e5 ldi r24, 0x50 ; 80 16a98: 0e 94 0d 5d call 0xba1a ; 0xba1a 16a9c: 88 23 and r24, r24 16a9e: 51 f0 breq .+20 ; 0x16ab4 cs.acceleration = code_value(); 16aa0: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16aa4: 60 93 9f 06 sts 0x069F, r22 ; 0x80069f 16aa8: 70 93 a0 06 sts 0x06A0, r23 ; 0x8006a0 16aac: 80 93 a1 06 sts 0x06A1, r24 ; 0x8006a1 16ab0: 90 93 a2 06 sts 0x06A2, r25 ; 0x8006a2 if(code_seen('R')) 16ab4: 82 e5 ldi r24, 0x52 ; 82 16ab6: 0e 94 0d 5d call 0xba1a ; 0xba1a 16aba: 88 23 and r24, r24 16abc: 51 f0 breq .+20 ; 0x16ad2 cs.retract_acceleration = code_value(); 16abe: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16ac2: 60 93 a3 06 sts 0x06A3, r22 ; 0x8006a3 16ac6: 70 93 a4 06 sts 0x06A4, r23 ; 0x8006a4 16aca: 80 93 a5 06 sts 0x06A5, r24 ; 0x8006a5 16ace: 90 93 a6 06 sts 0x06A6, r25 ; 0x8006a6 if(code_seen('T')) 16ad2: 84 e5 ldi r24, 0x54 ; 84 16ad4: 0e 94 0d 5d call 0xba1a ; 0xba1a 16ad8: 88 23 and r24, r24 16ada: 11 f4 brne .+4 ; 0x16ae0 16adc: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e cs.travel_acceleration = code_value(); 16ae0: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16ae4: 60 93 2b 07 sts 0x072B, r22 ; 0x80072b 16ae8: 70 93 2c 07 sts 0x072C, r23 ; 0x80072c 16aec: 80 93 2d 07 sts 0x072D, r24 ; 0x80072d 16af0: 90 93 2e 07 sts 0x072E, r25 ; 0x80072e 16af4: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 16af8: 83 e5 ldi r24, 0x53 ; 83 16afa: 0e 94 0d 5d call 0xba1a ; 0xba1a 16afe: 88 23 and r24, r24 16b00: 51 f0 breq .+20 ; 0x16b16 16b02: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16b06: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 16b0a: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 16b0e: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 16b12: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa if(code_seen('T')) cs.mintravelfeedrate = code_value(); 16b16: 84 e5 ldi r24, 0x54 ; 84 16b18: 0e 94 0d 5d call 0xba1a ; 0xba1a 16b1c: 88 23 and r24, r24 16b1e: 51 f0 breq .+20 ; 0x16b34 16b20: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16b24: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 16b28: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 16b2c: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 16b30: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 16b34: 82 e4 ldi r24, 0x42 ; 66 16b36: 0e 94 0d 5d call 0xba1a ; 0xba1a 16b3a: 88 23 and r24, r24 16b3c: 61 f0 breq .+24 ; 0x16b56 16b3e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16b42: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 16b46: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 16b4a: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 16b4e: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 16b52: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 16b56: 88 e5 ldi r24, 0x58 ; 88 16b58: 0e 94 0d 5d call 0xba1a ; 0xba1a 16b5c: 88 23 and r24, r24 16b5e: 91 f0 breq .+36 ; 0x16b84 16b60: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16b64: 60 93 b7 06 sts 0x06B7, r22 ; 0x8006b7 16b68: 70 93 b8 06 sts 0x06B8, r23 ; 0x8006b8 16b6c: 80 93 b9 06 sts 0x06B9, r24 ; 0x8006b9 16b70: 90 93 ba 06 sts 0x06BA, r25 ; 0x8006ba 16b74: 60 93 b3 06 sts 0x06B3, r22 ; 0x8006b3 16b78: 70 93 b4 06 sts 0x06B4, r23 ; 0x8006b4 16b7c: 80 93 b5 06 sts 0x06B5, r24 ; 0x8006b5 16b80: 90 93 b6 06 sts 0x06B6, r25 ; 0x8006b6 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 16b84: 89 e5 ldi r24, 0x59 ; 89 16b86: 0e 94 0d 5d call 0xba1a ; 0xba1a 16b8a: 88 23 and r24, r24 16b8c: 51 f0 breq .+20 ; 0x16ba2 16b8e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16b92: 60 93 b7 06 sts 0x06B7, r22 ; 0x8006b7 16b96: 70 93 b8 06 sts 0x06B8, r23 ; 0x8006b8 16b9a: 80 93 b9 06 sts 0x06B9, r24 ; 0x8006b9 16b9e: 90 93 ba 06 sts 0x06BA, r25 ; 0x8006ba if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 16ba2: 8a e5 ldi r24, 0x5A ; 90 16ba4: 0e 94 0d 5d call 0xba1a ; 0xba1a 16ba8: 88 23 and r24, r24 16baa: 51 f0 breq .+20 ; 0x16bc0 16bac: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16bb0: 60 93 bb 06 sts 0x06BB, r22 ; 0x8006bb 16bb4: 70 93 bc 06 sts 0x06BC, r23 ; 0x8006bc 16bb8: 80 93 bd 06 sts 0x06BD, r24 ; 0x8006bd 16bbc: 90 93 be 06 sts 0x06BE, r25 ; 0x8006be if(code_seen('E')) 16bc0: 85 e4 ldi r24, 0x45 ; 69 16bc2: 0e 94 0d 5d call 0xba1a ; 0xba1a 16bc6: 88 23 and r24, r24 16bc8: 11 f4 brne .+4 ; 0x16bce 16bca: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { float e = code_value(); 16bce: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 16bd2: 0e 94 6e 83 call 0x106dc ; 0x106dc #endif cs.max_jerk[E_AXIS] = e; 16bd6: 60 93 bf 06 sts 0x06BF, r22 ; 0x8006bf 16bda: 70 93 c0 06 sts 0x06C0, r23 ; 0x8006c0 16bde: 80 93 c1 06 sts 0x06C1, r24 ; 0x8006c1 16be2: 90 93 c2 06 sts 0x06C2, r25 ; 0x8006c2 16be6: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 16bea: 0d ed ldi r16, 0xDD ; 221 16bec: 12 e0 ldi r17, 0x02 ; 2 16bee: f3 ec ldi r31, 0xC3 ; 195 16bf0: ef 2e mov r14, r31 16bf2: f6 e0 ldi r31, 0x06 ; 6 16bf4: ff 2e mov r15, r31 16bf6: a0 ee ldi r26, 0xE0 ; 224 16bf8: ca 2e mov r12, r26 16bfa: a2 e0 ldi r26, 0x02 ; 2 16bfc: 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(); 16bfe: d8 01 movw r26, r16 16c00: 8d 91 ld r24, X+ 16c02: 8d 01 movw r16, r26 16c04: 0e 94 0d 5d call 0xba1a ; 0xba1a 16c08: 88 23 and r24, r24 16c0a: 39 f0 breq .+14 ; 0x16c1a 16c0c: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16c10: f7 01 movw r30, r14 16c12: 60 83 st Z, r22 16c14: 71 83 std Z+1, r23 ; 0x01 16c16: 82 83 std Z+2, r24 ; 0x02 16c18: 93 83 std Z+3, r25 ; 0x03 16c1a: f4 e0 ldi r31, 0x04 ; 4 16c1c: ef 0e add r14, r31 16c1e: 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++) 16c20: c0 16 cp r12, r16 16c22: d1 06 cpc r13, r17 16c24: 61 f7 brne .-40 ; 0x16bfe 16c26: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e - `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')) 16c2a: 83 e5 ldi r24, 0x53 ; 83 16c2c: 0e 94 0d 5d call 0xba1a ; 0xba1a 16c30: 88 23 and r24, r24 16c32: 51 f0 breq .+20 ; 0x16c48 { cs.retract_recover_length = code_value() ; 16c34: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16c38: 60 93 fa 06 sts 0x06FA, r22 ; 0x8006fa 16c3c: 70 93 fb 06 sts 0x06FB, r23 ; 0x8006fb 16c40: 80 93 fc 06 sts 0x06FC, r24 ; 0x8006fc 16c44: 90 93 fd 06 sts 0x06FD, r25 ; 0x8006fd } if(code_seen('F')) 16c48: 86 e4 ldi r24, 0x46 ; 70 16c4a: 0e 94 0d 5d call 0xba1a ; 0xba1a 16c4e: 88 23 and r24, r24 16c50: 11 f4 brne .+4 ; 0x16c56 16c52: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 16c56: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16c5a: 0e 94 0d 68 call 0xd01a ; 0xd01a 16c5e: 60 93 fe 06 sts 0x06FE, r22 ; 0x8006fe 16c62: 70 93 ff 06 sts 0x06FF, r23 ; 0x8006ff 16c66: 80 93 00 07 sts 0x0700, r24 ; 0x800700 16c6a: 90 93 01 07 sts 0x0701, r25 ; 0x800701 16c6e: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e #### 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')) 16c72: 83 e5 ldi r24, 0x53 ; 83 16c74: 0e 94 0d 5d call 0xba1a ; 0xba1a 16c78: 88 23 and r24, r24 16c7a: 11 f4 brne .+4 ; 0x16c80 16c7c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { switch(code_value_uint8()) 16c80: 0e 94 9f 5c call 0xb93e ; 0xb93e 16c84: 88 23 and r24, r24 16c86: c1 f0 breq .+48 ; 0x16cb8 16c88: 81 30 cpi r24, 0x01 ; 1 16c8a: e1 f0 breq .+56 ; 0x16cc4 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 16c8c: 84 e1 ldi r24, 0x14 ; 20 16c8e: 9b ea ldi r25, 0xAB ; 171 16c90: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 16c94: 81 e6 ldi r24, 0x61 ; 97 16c96: 99 e6 ldi r25, 0x69 ; 105 16c98: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 16c9c: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 16ca0: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 16ca4: 8d 57 subi r24, 0x7D ; 125 16ca6: 9f 4e sbci r25, 0xEF ; 239 16ca8: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_ECHOLNPGM("\"(1)"); 16cac: 83 e5 ldi r24, 0x53 ; 83 16cae: 98 e8 ldi r25, 0x88 ; 136 16cb0: 0e 94 97 7b call 0xf72e ; 0xf72e 16cb4: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 16cb8: 10 92 ed 06 sts 0x06ED, r1 ; 0x8006ed retracted[0]=false; 16cbc: 10 92 3c 07 sts 0x073C, r1 ; 0x80073c 16cc0: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 16cc4: 80 93 ed 06 sts 0x06ED, r24 ; 0x8006ed retracted[0]=false; 16cc8: 10 92 3c 07 sts 0x073C, r1 ; 0x80073c 16ccc: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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; 16cd0: 40 90 2f 07 lds r4, 0x072F ; 0x80072f 16cd4: 50 90 30 07 lds r5, 0x0730 ; 0x800730 16cd8: 60 90 31 07 lds r6, 0x0731 ; 0x800731 16cdc: 70 90 32 07 lds r7, 0x0732 ; 0x800732 16ce0: 0c 94 80 aa jmp 0x15500 ; 0x15500 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 16ce4: 80 90 33 07 lds r8, 0x0733 ; 0x800733 16ce8: 90 90 34 07 lds r9, 0x0734 ; 0x800734 16cec: a0 90 35 07 lds r10, 0x0735 ; 0x800735 16cf0: b0 90 36 07 lds r11, 0x0736 ; 0x800736 16cf4: 0c 94 8b aa jmp 0x15516 ; 0x15516 - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 16cf8: 82 e4 ldi r24, 0x42 ; 66 16cfa: 0e 94 0d 5d call 0xba1a ; 0xba1a 16cfe: 18 2f mov r17, r24 16d00: 88 23 and r24, r24 16d02: 41 f0 breq .+16 ; 0x16d14 { saved_feedmultiply_mm = feedmultiply; 16d04: 80 91 39 02 lds r24, 0x0239 ; 0x800239 16d08: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 16d0c: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 16d10: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 16d14: 83 e5 ldi r24, 0x53 ; 83 16d16: 0e 94 0d 5d call 0xba1a ; 0xba1a 16d1a: 08 2f mov r16, r24 16d1c: 88 23 and r24, r24 16d1e: 39 f0 breq .+14 ; 0x16d2e { feedmultiply = code_value_short(); 16d20: 0e 94 ac 5c call 0xb958 ; 0xb958 16d24: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 16d28: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 16d2c: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 16d2e: 82 e5 ldi r24, 0x52 ; 82 16d30: 0e 94 0d 5d call 0xba1a ; 0xba1a 16d34: 88 23 and r24, r24 16d36: 51 f0 breq .+20 ; 0x16d4c { feedmultiply = saved_feedmultiply_mm; 16d38: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 16d3c: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 16d40: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 16d44: 80 93 39 02 sts 0x0239, r24 ; 0x800239 16d48: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e codesWereSeen = true; } if (!codesWereSeen) 16d4c: 11 11 cpse r17, r1 16d4e: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { printf_P(PSTR("%i%%\n"), feedmultiply); 16d52: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 16d56: 8f 93 push r24 16d58: 80 91 39 02 lds r24, 0x0239 ; 0x800239 16d5c: 8f 93 push r24 16d5e: 8d e4 ldi r24, 0x4D ; 77 16d60: 98 e8 ldi r25, 0x88 ; 136 16d62: 9f 93 push r25 16d64: 8f 93 push r24 16d66: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 16d6a: 0f 90 pop r0 16d6c: 0f 90 pop r0 16d6e: 0f 90 pop r0 16d70: 0f 90 pop r0 16d72: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 16d76: 80 91 95 02 lds r24, 0x0295 ; 0x800295 16d7a: 8f 93 push r24 16d7c: 80 91 94 02 lds r24, 0x0294 ; 0x800294 16d80: 8f 93 push r24 16d82: 87 e4 ldi r24, 0x47 ; 71 16d84: 98 e8 ldi r25, 0x88 ; 136 16d86: 9f 93 push r25 16d88: 8f 93 push r24 16d8a: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 16d8e: 0f 90 pop r0 16d90: 0f 90 pop r0 16d92: 0f 90 pop r0 16d94: 0f 90 pop r0 16d96: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 16d9a: 80 e5 ldi r24, 0x50 ; 80 16d9c: 0e 94 0d 5d call 0xba1a ; 0xba1a 16da0: 88 23 and r24, r24 16da2: 11 f4 brne .+4 ; 0x16da8 16da4: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e int pin_number = code_value_short(); // pin number 16da8: 0e 94 ac 5c call 0xb958 ; 0xb958 16dac: 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 16dae: 83 e5 ldi r24, 0x53 ; 83 16db0: 0e 94 0d 5d call 0xba1a ; 0xba1a */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 16db4: 0f ef ldi r16, 0xFF ; 255 16db6: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 16db8: 88 23 and r24, r24 16dba: 19 f0 breq .+6 ; 0x16dc2 16dbc: 0e 94 ac 5c call 0xb958 ; 0xb958 16dc0: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 16dc2: c8 01 movw r24, r16 16dc4: 01 96 adiw r24, 0x01 ; 1 16dc6: 03 97 sbiw r24, 0x03 ; 3 16dc8: 10 f0 brcs .+4 ; 0x16dce 16dca: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 16dce: ed e4 ldi r30, 0x4D ; 77 16dd0: 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)) 16dd2: 84 91 lpm r24, Z 16dd4: 08 2e mov r0, r24 16dd6: 00 0c add r0, r0 16dd8: 99 0b sbc r25, r25 16dda: e8 16 cp r14, r24 16ddc: f9 06 cpc r15, r25 16dde: 11 f4 brne .+4 ; 0x16de4 16de0: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 16de4: 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++) 16de6: 29 e8 ldi r18, 0x89 ; 137 16de8: e9 36 cpi r30, 0x69 ; 105 16dea: f2 07 cpc r31, r18 16dec: 91 f7 brne .-28 ; 0x16dd2 pin_number = -1; break; } } if (pin_number > -1) 16dee: f7 fe sbrs r15, 7 16df0: 02 c0 rjmp .+4 ; 0x16df6 16df2: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { int target = LOW; st_synchronize(); 16df6: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 pinMode(pin_number, INPUT); 16dfa: de 2c mov r13, r14 16dfc: 60 e0 ldi r22, 0x00 ; 0 16dfe: 8e 2d mov r24, r14 16e00: 0e 94 97 de call 0x1bd2e ; 0x1bd2e switch(pin_state){ 16e04: 0f 3f cpi r16, 0xFF ; 255 16e06: 10 07 cpc r17, r16 16e08: b1 f0 breq .+44 ; 0x16e36 16e0a: 01 30 cpi r16, 0x01 ; 1 16e0c: 11 05 cpc r17, r1 16e0e: 11 f0 breq .+4 ; 0x16e14 } } if (pin_number > -1) { int target = LOW; 16e10: 10 e0 ldi r17, 0x00 ; 0 16e12: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 16e14: 8d 2d mov r24, r13 16e16: 0e 94 40 de call 0x1bc80 ; 0x1bc80 16e1a: 80 17 cp r24, r16 16e1c: 91 07 cpc r25, r17 16e1e: 11 f4 brne .+4 ; 0x16e24 16e20: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e manage_heater(); 16e24: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(); 16e28: 80 e0 ldi r24, 0x00 ; 0 16e2a: 0e 94 6b 8c call 0x118d6 ; 0x118d6 lcd_update(0); 16e2e: 80 e0 ldi r24, 0x00 ; 0 16e30: 0e 94 ed 6f call 0xdfda ; 0xdfda 16e34: ef cf rjmp .-34 ; 0x16e14 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 16e36: 8e 2d mov r24, r14 16e38: 0e 94 40 de call 0x1bc80 ; 0x1bc80 16e3c: 31 e0 ldi r19, 0x01 ; 1 16e3e: 20 e0 ldi r18, 0x00 ; 0 16e40: 89 2b or r24, r25 16e42: 09 f0 breq .+2 ; 0x16e46 16e44: 30 e0 ldi r19, 0x00 ; 0 16e46: 03 2f mov r16, r19 16e48: 12 2f mov r17, r18 16e4a: e4 cf rjmp .-56 ; 0x16e14 - `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; 16e4c: 80 e5 ldi r24, 0x50 ; 80 16e4e: 0e 94 0d 5d call 0xba1a ; 0xba1a 16e52: 08 ee ldi r16, 0xE8 ; 232 16e54: 13 e0 ldi r17, 0x03 ; 3 16e56: 88 23 and r24, r24 16e58: 29 f0 breq .+10 ; 0x16e64 16e5a: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16e5e: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 16e62: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 16e64: 83 e5 ldi r24, 0x53 ; 83 16e66: 0e 94 0d 5d call 0xba1a ; 0xba1a 16e6a: 88 23 and r24, r24 16e6c: 71 f0 breq .+28 ; 0x16e8a beepS = 0; else { beepS = code_value(); 16e6e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16e72: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> if (!beepS) { 16e76: 61 15 cp r22, r1 16e78: 71 05 cpc r23, r1 16e7a: 49 f4 brne .+18 ; 0x16e8e // handle S0 as a pause _delay(beepP); 16e7c: b8 01 movw r22, r16 16e7e: 90 e0 ldi r25, 0x00 ; 0 16e80: 80 e0 ldi r24, 0x00 ; 0 16e82: 0f 94 5c 3c call 0x278b8 ; 0x278b8 16e86: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 16e8a: 70 e0 ldi r23, 0x00 ; 0 16e8c: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 16e8e: 40 e0 ldi r20, 0x00 ; 0 16e90: c8 01 movw r24, r16 16e92: 0f 94 1a 69 call 0x2d234 ; 0x2d234 16e96: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 16e9a: 80 e5 ldi r24, 0x50 ; 80 16e9c: 0e 94 0d 5d call 0xba1a ; 0xba1a 16ea0: 88 23 and r24, r24 16ea2: 51 f0 breq .+20 ; 0x16eb8 16ea4: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16ea8: 60 93 d3 06 sts 0x06D3, r22 ; 0x8006d3 16eac: 70 93 d4 06 sts 0x06D4, r23 ; 0x8006d4 16eb0: 80 93 d5 06 sts 0x06D5, r24 ; 0x8006d5 16eb4: 90 93 d6 06 sts 0x06D6, r25 ; 0x8006d6 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 16eb8: 89 e4 ldi r24, 0x49 ; 73 16eba: 0e 94 0d 5d call 0xba1a ; 0xba1a 16ebe: 88 23 and r24, r24 16ec0: 81 f0 breq .+32 ; 0x16ee2 16ec2: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16ec6: 2c ea ldi r18, 0xAC ; 172 16ec8: 35 ec ldi r19, 0xC5 ; 197 16eca: 47 e2 ldi r20, 0x27 ; 39 16ecc: 5e e3 ldi r21, 0x3E ; 62 16ece: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 16ed2: 60 93 d7 06 sts 0x06D7, r22 ; 0x8006d7 16ed6: 70 93 d8 06 sts 0x06D8, r23 ; 0x8006d8 16eda: 80 93 d9 06 sts 0x06D9, r24 ; 0x8006d9 16ede: 90 93 da 06 sts 0x06DA, r25 ; 0x8006da if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 16ee2: 84 e4 ldi r24, 0x44 ; 68 16ee4: 0e 94 0d 5d call 0xba1a ; 0xba1a 16ee8: 88 23 and r24, r24 16eea: 81 f0 breq .+32 ; 0x16f0c 16eec: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 } float unscalePID_i(float i) { return i/PID_dT; 16ef0: 2c ea ldi r18, 0xAC ; 172 16ef2: 35 ec ldi r19, 0xC5 ; 197 16ef4: 47 e2 ldi r20, 0x27 ; 39 16ef6: 5e e3 ldi r21, 0x3E ; 62 16ef8: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 16efc: 60 93 db 06 sts 0x06DB, r22 ; 0x8006db 16f00: 70 93 dc 06 sts 0x06DC, r23 ; 0x8006dc 16f04: 80 93 dd 06 sts 0x06DD, r24 ; 0x8006dd 16f08: 90 93 de 06 sts 0x06DE, r25 ; 0x8006de updatePID(); 16f0c: 0f 94 dd 4f call 0x29fba ; 0x29fba SERIAL_PROTOCOLRPGM(MSG_OK); 16f10: 88 ee ldi r24, 0xE8 ; 232 16f12: 9e e6 ldi r25, 0x6E ; 110 16f14: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLPGM(" p:"); 16f18: 83 e4 ldi r24, 0x43 ; 67 16f1a: 98 e8 ldi r25, 0x88 ; 136 16f1c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 16f20: 60 91 d3 06 lds r22, 0x06D3 ; 0x8006d3 16f24: 70 91 d4 06 lds r23, 0x06D4 ; 0x8006d4 16f28: 80 91 d5 06 lds r24, 0x06D5 ; 0x8006d5 16f2c: 90 91 d6 06 lds r25, 0x06D6 ; 0x8006d6 16f30: 42 e0 ldi r20, 0x02 ; 2 16f32: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 16f36: 8f e3 ldi r24, 0x3F ; 63 16f38: 98 e8 ldi r25, 0x88 ; 136 16f3a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 16f3e: 2c ea ldi r18, 0xAC ; 172 16f40: 35 ec ldi r19, 0xC5 ; 197 16f42: 47 e2 ldi r20, 0x27 ; 39 16f44: 5e e3 ldi r21, 0x3E ; 62 16f46: 60 91 d7 06 lds r22, 0x06D7 ; 0x8006d7 16f4a: 70 91 d8 06 lds r23, 0x06D8 ; 0x8006d8 16f4e: 80 91 d9 06 lds r24, 0x06D9 ; 0x8006d9 16f52: 90 91 da 06 lds r25, 0x06DA ; 0x8006da 16f56: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 16f5a: 42 e0 ldi r20, 0x02 ; 2 16f5c: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 16f60: 8b e3 ldi r24, 0x3B ; 59 16f62: 98 e8 ldi r25, 0x88 ; 136 16f64: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 16f68: 2c ea ldi r18, 0xAC ; 172 16f6a: 35 ec ldi r19, 0xC5 ; 197 16f6c: 47 e2 ldi r20, 0x27 ; 39 16f6e: 5e e3 ldi r21, 0x3E ; 62 16f70: 60 91 db 06 lds r22, 0x06DB ; 0x8006db 16f74: 70 91 dc 06 lds r23, 0x06DC ; 0x8006dc 16f78: 80 91 dd 06 lds r24, 0x06DD ; 0x8006dd 16f7c: 90 91 de 06 lds r25, 0x06DE ; 0x8006de 16f80: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 16f84: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 16f88: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 16f8c: 90 e0 ldi r25, 0x00 ; 0 16f8e: 80 e0 ldi r24, 0x00 ; 0 16f90: 0c 94 28 ab jmp 0x15650 ; 0x15650 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 16f94: 85 e4 ldi r24, 0x45 ; 69 16f96: 0e 94 0d 5d call 0xba1a ; 0xba1a - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 16f9a: 10 e0 ldi r17, 0x00 ; 0 16f9c: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 16f9e: 88 23 and r24, r24 16fa0: 59 f0 breq .+22 ; 0x16fb8 16fa2: 0e 94 ac 5c call 0xb958 ; 0xb958 16fa6: 8c 01 movw r16, r24 if (e < 0) temp = 70; 16fa8: c1 2c mov r12, r1 16faa: d1 2c mov r13, r1 16fac: 7c e8 ldi r23, 0x8C ; 140 16fae: e7 2e mov r14, r23 16fb0: 72 e4 ldi r23, 0x42 ; 66 16fb2: 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) 16fb4: 97 fd sbrc r25, 7 16fb6: 06 c0 rjmp .+12 ; 0x16fc4 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 16fb8: c1 2c mov r12, r1 16fba: d1 2c mov r13, r1 16fbc: e6 e1 ldi r30, 0x16 ; 22 16fbe: ee 2e mov r14, r30 16fc0: e3 e4 ldi r30, 0x43 ; 67 16fc2: 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(); 16fc4: 83 e5 ldi r24, 0x53 ; 83 16fc6: 0e 94 0d 5d call 0xba1a ; 0xba1a 16fca: 88 23 and r24, r24 16fcc: 21 f0 breq .+8 ; 0x16fd6 16fce: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 16fd2: 6b 01 movw r12, r22 16fd4: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 16fd6: 83 e4 ldi r24, 0x43 ; 67 16fd8: 0e 94 0d 5d call 0xba1a ; 0xba1a 16fdc: 88 23 and r24, r24 16fde: 51 f0 breq .+20 ; 0x16ff4 16fe0: 0e 94 ac 5c call 0xb958 ; 0xb958 PID_autotune(temp, e, c); 16fe4: 9c 01 movw r18, r24 16fe6: a8 01 movw r20, r16 16fe8: c7 01 movw r24, r14 16fea: b6 01 movw r22, r12 16fec: 0f 94 0a 50 call 0x2a014 ; 0x2a014 16ff0: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e */ case 303: { float temp = 150.0; int e = 0; int c = 5; 16ff4: 85 e0 ldi r24, 0x05 ; 5 16ff6: 90 e0 ldi r25, 0x00 ; 0 16ff8: f5 cf rjmp .-22 ; 0x16fe4 { // 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(); 16ffa: 89 e4 ldi r24, 0x49 ; 73 16ffc: 0e 94 0d 5d call 0xba1a ; 0xba1a 17000: 88 23 and r24, r24 17002: 09 f4 brne .+2 ; 0x17006 17004: 30 c2 rjmp .+1120 ; 0x17466 17006: 0e 94 ac 5c call 0xb958 ; 0xb958 1700a: ab 96 adiw r28, 0x2b ; 43 1700c: 8f af std Y+63, r24 ; 0x3f 1700e: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 17010: 82 e5 ldi r24, 0x52 ; 82 17012: 0e 94 0d 5d call 0xba1a ; 0xba1a 17016: 88 23 and r24, r24 17018: 09 f4 brne .+2 ; 0x1701c 1701a: 2a c2 rjmp .+1108 ; 0x17470 1701c: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 17020: e2 96 adiw r28, 0x32 ; 50 17022: 6c af std Y+60, r22 ; 0x3c 17024: 7d af std Y+61, r23 ; 0x3d 17026: 8e af std Y+62, r24 ; 0x3e 17028: 9f af std Y+63, r25 ; 0x3f 1702a: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 1702c: 80 e5 ldi r24, 0x50 ; 80 1702e: 0e 94 0d 5d call 0xba1a ; 0xba1a - `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; 17032: c1 2c mov r12, r1 17034: d1 2c mov r13, r1 17036: 60 ec ldi r22, 0xC0 ; 192 17038: e6 2e mov r14, r22 1703a: 6f e7 ldi r22, 0x7F ; 127 1703c: 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(); 1703e: 88 23 and r24, r24 17040: 21 f0 breq .+8 ; 0x1704a 17042: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 17046: 6b 01 movw r12, r22 17048: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 1704a: 85 e5 ldi r24, 0x55 ; 85 1704c: 0e 94 0d 5d call 0xba1a ; 0xba1a 17050: 88 23 and r24, r24 17052: 09 f4 brne .+2 ; 0x17056 17054: 18 c2 rjmp .+1072 ; 0x17486 17056: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1705a: 6e 96 adiw r28, 0x1e ; 30 1705c: 6c af std Y+60, r22 ; 0x3c 1705e: 7d af std Y+61, r23 ; 0x3d 17060: 8e af std Y+62, r24 ; 0x3e 17062: 9f af std Y+63, r25 ; 0x3f 17064: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 17066: 86 e5 ldi r24, 0x56 ; 86 17068: 0e 94 0d 5d call 0xba1a ; 0xba1a 1706c: 88 23 and r24, r24 1706e: 09 f4 brne .+2 ; 0x17072 17070: 15 c2 rjmp .+1066 ; 0x1749c 17072: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 17076: a2 96 adiw r28, 0x22 ; 34 17078: 6c af std Y+60, r22 ; 0x3c 1707a: 7d af std Y+61, r23 ; 0x3d 1707c: 8e af std Y+62, r24 ; 0x3e 1707e: 9f af std Y+63, r25 ; 0x3f 17080: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 17082: 83 e4 ldi r24, 0x43 ; 67 17084: 0e 94 0d 5d call 0xba1a ; 0xba1a 17088: 88 23 and r24, r24 1708a: 09 f4 brne .+2 ; 0x1708e 1708c: 12 c2 rjmp .+1060 ; 0x174b2 1708e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 17092: 6a 96 adiw r28, 0x1a ; 26 17094: 6c af std Y+60, r22 ; 0x3c 17096: 7d af std Y+61, r23 ; 0x3d 17098: 8e af std Y+62, r24 ; 0x3e 1709a: 9f af std Y+63, r25 ; 0x3f 1709c: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 1709e: 84 e4 ldi r24, 0x44 ; 68 170a0: 0e 94 0d 5d call 0xba1a ; 0xba1a 170a4: 88 23 and r24, r24 170a6: 09 f4 brne .+2 ; 0x170aa 170a8: 0f c2 rjmp .+1054 ; 0x174c8 170aa: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 170ae: aa 96 adiw r28, 0x2a ; 42 170b0: 6c af std Y+60, r22 ; 0x3c 170b2: 7d af std Y+61, r23 ; 0x3d 170b4: 8e af std Y+62, r24 ; 0x3e 170b6: 9f af std Y+63, r25 ; 0x3f 170b8: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 170ba: 8c e4 ldi r24, 0x4C ; 76 170bc: 0e 94 0d 5d call 0xba1a ; 0xba1a 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; 170c0: 0f ef ldi r16, 0xFF ; 255 170c2: 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(); 170c4: 88 23 and r24, r24 170c6: 19 f0 breq .+6 ; 0x170ce 170c8: 0e 94 ac 5c call 0xb958 ; 0xb958 170cc: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 170ce: 83 e5 ldi r24, 0x53 ; 83 170d0: 0e 94 0d 5d call 0xba1a ; 0xba1a 170d4: 88 23 and r24, r24 170d6: 09 f4 brne .+2 ; 0x170da 170d8: 02 c2 rjmp .+1028 ; 0x174de 170da: 0e 94 ac 5c call 0xb958 ; 0xb958 170de: e3 96 adiw r28, 0x33 ; 51 170e0: 8f af std Y+63, r24 ; 0x3f 170e2: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 170e4: 82 e4 ldi r24, 0x42 ; 66 170e6: 0e 94 0d 5d call 0xba1a ; 0xba1a 170ea: 88 23 and r24, r24 170ec: 09 f4 brne .+2 ; 0x170f0 170ee: fc c1 rjmp .+1016 ; 0x174e8 170f0: 0e 94 ac 5c call 0xb958 ; 0xb958 170f4: e7 96 adiw r28, 0x37 ; 55 170f6: 8f af std Y+63, r24 ; 0x3f 170f8: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 170fa: 84 e5 ldi r24, 0x54 ; 84 170fc: 0e 94 0d 5d call 0xba1a ; 0xba1a 17100: 88 23 and r24, r24 17102: 09 f4 brne .+2 ; 0x17106 17104: f6 c1 rjmp .+1004 ; 0x174f2 17106: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1710a: a6 96 adiw r28, 0x26 ; 38 1710c: 6c af std Y+60, r22 ; 0x3c 1710e: 7d af std Y+61, r23 ; 0x3d 17110: 8e af std Y+62, r24 ; 0x3e 17112: 9f af std Y+63, r25 ; 0x3f 17114: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 17116: 85 e4 ldi r24, 0x45 ; 69 17118: 0e 94 0d 5d call 0xba1a ; 0xba1a - `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; 1711c: 41 2c mov r4, r1 1711e: 51 2c mov r5, r1 17120: 50 ec ldi r21, 0xC0 ; 192 17122: 65 2e mov r6, r21 17124: 5f e7 ldi r21, 0x7F ; 127 17126: 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(); 17128: 88 23 and r24, r24 1712a: 21 f0 breq .+8 ; 0x17134 1712c: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 17130: 2b 01 movw r4, r22 17132: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 17134: 87 e5 ldi r24, 0x57 ; 87 17136: 0e 94 0d 5d call 0xba1a ; 0xba1a - `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; 1713a: 81 2c mov r8, r1 1713c: 91 2c mov r9, r1 1713e: 40 ec ldi r20, 0xC0 ; 192 17140: a4 2e mov r10, r20 17142: 4f e7 ldi r20, 0x7F ; 127 17144: 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(); 17146: 88 23 and r24, r24 17148: 21 f0 breq .+8 ; 0x17152 1714a: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1714e: 4b 01 movw r8, r22 17150: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 17152: 81 e4 ldi r24, 0x41 ; 65 17154: 0e 94 0d 5d call 0xba1a ; 0xba1a 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; 17158: 22 24 eor r2, r2 1715a: 2a 94 dec r2 1715c: 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(); 1715e: 88 23 and r24, r24 17160: 19 f0 breq .+6 ; 0x17168 17162: 0e 94 ac 5c call 0xb958 ; 0xb958 17166: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 17168: 86 e4 ldi r24, 0x46 ; 70 1716a: 0e 94 0d 5d call 0xba1a ; 0xba1a 1716e: 88 23 and r24, r24 17170: 09 f4 brne .+2 ; 0x17174 17172: ca c1 rjmp .+916 ; 0x17508 17174: 0e 94 ac 5c call 0xb958 ; 0xb958 17178: eb 96 adiw r28, 0x3b ; 59 1717a: 8f af std Y+63, r24 ; 0x3f 1717c: 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) 1717e: e2 96 adiw r28, 0x32 ; 50 17180: 2c ad ldd r18, Y+60 ; 0x3c 17182: 3d ad ldd r19, Y+61 ; 0x3d 17184: 4e ad ldd r20, Y+62 ; 0x3e 17186: 5f ad ldd r21, Y+63 ; 0x3f 17188: e2 97 sbiw r28, 0x32 ; 50 1718a: ca 01 movw r24, r20 1718c: b9 01 movw r22, r18 1718e: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17192: 88 23 and r24, r24 17194: 09 f4 brne .+2 ; 0x17198 17196: c1 c1 rjmp .+898 ; 0x1751a 17198: a7 01 movw r20, r14 1719a: 96 01 movw r18, r12 1719c: c7 01 movw r24, r14 1719e: b6 01 movw r22, r12 171a0: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 171a4: 88 23 and r24, r24 171a6: 09 f4 brne .+2 ; 0x171aa 171a8: b8 c1 rjmp .+880 ; 0x1751a 171aa: 6e 96 adiw r28, 0x1e ; 30 171ac: 2c ad ldd r18, Y+60 ; 0x3c 171ae: 3d ad ldd r19, Y+61 ; 0x3d 171b0: 4e ad ldd r20, Y+62 ; 0x3e 171b2: 5f ad ldd r21, Y+63 ; 0x3f 171b4: 6e 97 sbiw r28, 0x1e ; 30 171b6: ca 01 movw r24, r20 171b8: b9 01 movw r22, r18 171ba: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 171be: 88 23 and r24, r24 171c0: 09 f4 brne .+2 ; 0x171c4 171c2: ab c1 rjmp .+854 ; 0x1751a 171c4: a2 96 adiw r28, 0x22 ; 34 171c6: 2c ad ldd r18, Y+60 ; 0x3c 171c8: 3d ad ldd r19, Y+61 ; 0x3d 171ca: 4e ad ldd r20, Y+62 ; 0x3e 171cc: 5f ad ldd r21, Y+63 ; 0x3f 171ce: a2 97 sbiw r28, 0x22 ; 34 171d0: ca 01 movw r24, r20 171d2: b9 01 movw r22, r18 171d4: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 171d8: 88 23 and r24, r24 171da: 09 f4 brne .+2 ; 0x171de 171dc: 9e c1 rjmp .+828 ; 0x1751a 171de: 6a 96 adiw r28, 0x1a ; 26 171e0: 2c ad ldd r18, Y+60 ; 0x3c 171e2: 3d ad ldd r19, Y+61 ; 0x3d 171e4: 4e ad ldd r20, Y+62 ; 0x3e 171e6: 5f ad ldd r21, Y+63 ; 0x3f 171e8: 6a 97 sbiw r28, 0x1a ; 26 171ea: ca 01 movw r24, r20 171ec: b9 01 movw r22, r18 171ee: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 171f2: 88 23 and r24, r24 171f4: 09 f4 brne .+2 ; 0x171f8 171f6: 91 c1 rjmp .+802 ; 0x1751a 171f8: aa 96 adiw r28, 0x2a ; 42 171fa: 2c ad ldd r18, Y+60 ; 0x3c 171fc: 3d ad ldd r19, Y+61 ; 0x3d 171fe: 4e ad ldd r20, Y+62 ; 0x3e 17200: 5f ad ldd r21, Y+63 ; 0x3f 17202: aa 97 sbiw r28, 0x2a ; 42 17204: ca 01 movw r24, r20 17206: b9 01 movw r22, r18 17208: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1720c: 88 23 and r24, r24 1720e: 09 f4 brne .+2 ; 0x17212 17210: 84 c1 rjmp .+776 ; 0x1751a 17212: a6 96 adiw r28, 0x26 ; 38 17214: 2c ad ldd r18, Y+60 ; 0x3c 17216: 3d ad ldd r19, Y+61 ; 0x3d 17218: 4e ad ldd r20, Y+62 ; 0x3e 1721a: 5f ad ldd r21, Y+63 ; 0x3f 1721c: a6 97 sbiw r28, 0x26 ; 38 1721e: ca 01 movw r24, r20 17220: b9 01 movw r22, r18 17222: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17226: 88 23 and r24, r24 17228: 09 f4 brne .+2 ; 0x1722c 1722a: 77 c1 rjmp .+750 ; 0x1751a 1722c: a5 01 movw r20, r10 1722e: 94 01 movw r18, r8 17230: c5 01 movw r24, r10 17232: b4 01 movw r22, r8 17234: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17238: 88 23 and r24, r24 1723a: 09 f4 brne .+2 ; 0x1723e 1723c: 6e c1 rjmp .+732 ; 0x1751a 1723e: a3 01 movw r20, r6 17240: 92 01 movw r18, r4 17242: c3 01 movw r24, r6 17244: b2 01 movw r22, r4 17246: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1724a: 88 23 and r24, r24 1724c: 09 f4 brne .+2 ; 0x17250 1724e: 65 c1 rjmp .+714 ; 0x1751a && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 17250: ab 96 adiw r28, 0x2b ; 43 17252: 4f ad ldd r20, Y+63 ; 0x3f 17254: ab 97 sbiw r28, 0x2b ; 43 17256: 47 ff sbrs r20, 7 17258: 60 c1 rjmp .+704 ; 0x1751a 1725a: e3 96 adiw r28, 0x33 ; 51 1725c: 5f ad ldd r21, Y+63 ; 0x3f 1725e: e3 97 sbiw r28, 0x33 ; 51 17260: 57 ff sbrs r21, 7 17262: 5b c1 rjmp .+694 ; 0x1751a 17264: e7 96 adiw r28, 0x37 ; 55 17266: 8f ad ldd r24, Y+63 ; 0x3f 17268: e7 97 sbiw r28, 0x37 ; 55 1726a: 87 ff sbrs r24, 7 1726c: 5b c1 rjmp .+694 ; 0x17524 1726e: 37 fe sbrs r3, 7 17270: 9f c1 rjmp .+830 ; 0x175b0 17272: 17 fd sbrc r17, 7 17274: 4e c1 rjmp .+668 ; 0x17512 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; 17276: ce 01 movw r24, r28 17278: 01 96 adiw r24, 0x01 ; 1 1727a: 0f 94 a8 46 call 0x28d50 ; 0x28d50 if(!isnan(P) && P > 0) thermal_model::data.P = P; 1727e: a7 01 movw r20, r14 17280: 96 01 movw r18, r12 17282: c7 01 movw r24, r14 17284: b6 01 movw r22, r12 17286: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1728a: 88 23 and r24, r24 1728c: 09 f4 brne .+2 ; 0x17290 1728e: 31 c2 rjmp .+1122 ; 0x176f2 if(!isnan(U)) thermal_model::data.U = U; 17290: 6e 96 adiw r28, 0x1e ; 30 17292: 2c ad ldd r18, Y+60 ; 0x3c 17294: 3d ad ldd r19, Y+61 ; 0x3d 17296: 4e ad ldd r20, Y+62 ; 0x3e 17298: 5f ad ldd r21, Y+63 ; 0x3f 1729a: 6e 97 sbiw r28, 0x1e ; 30 1729c: ca 01 movw r24, r20 1729e: b9 01 movw r22, r18 172a0: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 172a4: 81 11 cpse r24, r1 172a6: 0e c0 rjmp .+28 ; 0x172c4 172a8: 6e 96 adiw r28, 0x1e ; 30 172aa: 2c ad ldd r18, Y+60 ; 0x3c 172ac: 3d ad ldd r19, Y+61 ; 0x3d 172ae: 4e ad ldd r20, Y+62 ; 0x3e 172b0: 5f ad ldd r21, Y+63 ; 0x3f 172b2: 6e 97 sbiw r28, 0x1e ; 30 172b4: 20 93 b9 12 sts 0x12B9, r18 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 172b8: 30 93 ba 12 sts 0x12BA, r19 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 172bc: 40 93 bb 12 sts 0x12BB, r20 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 172c0: 50 93 bc 12 sts 0x12BC, r21 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> if(!isnan(V)) thermal_model::data.V = V; 172c4: a2 96 adiw r28, 0x22 ; 34 172c6: 2c ad ldd r18, Y+60 ; 0x3c 172c8: 3d ad ldd r19, Y+61 ; 0x3d 172ca: 4e ad ldd r20, Y+62 ; 0x3e 172cc: 5f ad ldd r21, Y+63 ; 0x3f 172ce: a2 97 sbiw r28, 0x22 ; 34 172d0: ca 01 movw r24, r20 172d2: b9 01 movw r22, r18 172d4: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 172d8: 81 11 cpse r24, r1 172da: 0e c0 rjmp .+28 ; 0x172f8 172dc: a2 96 adiw r28, 0x22 ; 34 172de: 8c ad ldd r24, Y+60 ; 0x3c 172e0: 9d ad ldd r25, Y+61 ; 0x3d 172e2: ae ad ldd r26, Y+62 ; 0x3e 172e4: bf ad ldd r27, Y+63 ; 0x3f 172e6: a2 97 sbiw r28, 0x22 ; 34 172e8: 80 93 bd 12 sts 0x12BD, r24 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 172ec: 90 93 be 12 sts 0x12BE, r25 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 172f0: a0 93 bf 12 sts 0x12BF, r26 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 172f4: b0 93 c0 12 sts 0x12C0, r27 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 172f8: 6a 96 adiw r28, 0x1a ; 26 172fa: 2c ad ldd r18, Y+60 ; 0x3c 172fc: 3d ad ldd r19, Y+61 ; 0x3d 172fe: 4e ad ldd r20, Y+62 ; 0x3e 17300: 5f ad ldd r21, Y+63 ; 0x3f 17302: 6a 97 sbiw r28, 0x1a ; 26 17304: ca 01 movw r24, r20 17306: b9 01 movw r22, r18 17308: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1730c: 81 11 cpse r24, r1 1730e: 1b c0 rjmp .+54 ; 0x17346 17310: 20 e0 ldi r18, 0x00 ; 0 17312: 30 e0 ldi r19, 0x00 ; 0 17314: a9 01 movw r20, r18 17316: 6a 96 adiw r28, 0x1a ; 26 17318: 6c ad ldd r22, Y+60 ; 0x3c 1731a: 7d ad ldd r23, Y+61 ; 0x3d 1731c: 8e ad ldd r24, Y+62 ; 0x3e 1731e: 9f ad ldd r25, Y+63 ; 0x3f 17320: 6a 97 sbiw r28, 0x1a ; 26 17322: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 17326: 18 16 cp r1, r24 17328: 74 f4 brge .+28 ; 0x17346 1732a: 6a 96 adiw r28, 0x1a ; 26 1732c: 2c ad ldd r18, Y+60 ; 0x3c 1732e: 3d ad ldd r19, Y+61 ; 0x3d 17330: 4e ad ldd r20, Y+62 ; 0x3e 17332: 5f ad ldd r21, Y+63 ; 0x3f 17334: 6a 97 sbiw r28, 0x1a ; 26 17336: 20 93 c1 12 sts 0x12C1, r18 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 1733a: 30 93 c2 12 sts 0x12C2, r19 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 1733e: 40 93 c3 12 sts 0x12C3, r20 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 17342: 50 93 c4 12 sts 0x12C4, r21 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> if(!isnan(D)) thermal_model::data.fS = D; 17346: aa 96 adiw r28, 0x2a ; 42 17348: 2c ad ldd r18, Y+60 ; 0x3c 1734a: 3d ad ldd r19, Y+61 ; 0x3d 1734c: 4e ad ldd r20, Y+62 ; 0x3e 1734e: 5f ad ldd r21, Y+63 ; 0x3f 17350: aa 97 sbiw r28, 0x2a ; 42 17352: ca 01 movw r24, r20 17354: b9 01 movw r22, r18 17356: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1735a: 81 11 cpse r24, r1 1735c: 0e c0 rjmp .+28 ; 0x1737a 1735e: aa 96 adiw r28, 0x2a ; 42 17360: 8c ad ldd r24, Y+60 ; 0x3c 17362: 9d ad ldd r25, Y+61 ; 0x3d 17364: ae ad ldd r26, Y+62 ; 0x3e 17366: bf ad ldd r27, Y+63 ; 0x3f 17368: aa 97 sbiw r28, 0x2a ; 42 1736a: 80 93 c5 12 sts 0x12C5, r24 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 1736e: 90 93 c6 12 sts 0x12C6, r25 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 17372: a0 93 c7 12 sts 0x12C7, r26 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 17376: b0 93 c8 12 sts 0x12C8, r27 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> if(L >= 0) thermal_model_set_lag(L); 1737a: 17 fd sbrc r17, 7 1737c: 03 c0 rjmp .+6 ; 0x17384 1737e: c8 01 movw r24, r16 17380: 0f 94 8b 43 call 0x28716 ; 0x28716 if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 17384: a6 96 adiw r28, 0x26 ; 38 17386: 2c ad ldd r18, Y+60 ; 0x3c 17388: 3d ad ldd r19, Y+61 ; 0x3d 1738a: 4e ad ldd r20, Y+62 ; 0x3e 1738c: 5f ad ldd r21, Y+63 ; 0x3f 1738e: a6 97 sbiw r28, 0x26 ; 38 17390: ca 01 movw r24, r20 17392: b9 01 movw r22, r18 17394: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17398: 81 11 cpse r24, r1 1739a: 0e c0 rjmp .+28 ; 0x173b8 1739c: a6 96 adiw r28, 0x26 ; 38 1739e: 2c ad ldd r18, Y+60 ; 0x3c 173a0: 3d ad ldd r19, Y+61 ; 0x3d 173a2: 4e ad ldd r20, Y+62 ; 0x3e 173a4: 5f ad ldd r21, Y+63 ; 0x3f 173a6: a6 97 sbiw r28, 0x26 ; 38 173a8: 20 93 0b 13 sts 0x130B, r18 ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 173ac: 30 93 0c 13 sts 0x130C, r19 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 173b0: 40 93 0d 13 sts 0x130D, r20 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 173b4: 50 93 0e 13 sts 0x130E, r21 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 173b8: a5 01 movw r20, r10 173ba: 94 01 movw r18, r8 173bc: c5 01 movw r24, r10 173be: b4 01 movw r22, r8 173c0: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 173c4: 81 11 cpse r24, r1 173c6: 11 c0 rjmp .+34 ; 0x173ea 173c8: 20 e0 ldi r18, 0x00 ; 0 173ca: 30 e0 ldi r19, 0x00 ; 0 173cc: a9 01 movw r20, r18 173ce: c5 01 movw r24, r10 173d0: b4 01 movw r22, r8 173d2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 173d6: 18 16 cp r1, r24 173d8: 44 f4 brge .+16 ; 0x173ea 173da: 80 92 0f 13 sts 0x130F, r8 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 173de: 90 92 10 13 sts 0x1310, r9 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 173e2: a0 92 11 13 sts 0x1311, r10 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 173e6: b0 92 12 13 sts 0x1312, r11 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 173ea: a3 01 movw r20, r6 173ec: 92 01 movw r18, r4 173ee: c3 01 movw r24, r6 173f0: b2 01 movw r22, r4 173f2: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 173f6: 81 11 cpse r24, r1 173f8: 11 c0 rjmp .+34 ; 0x1741c 173fa: 20 e0 ldi r18, 0x00 ; 0 173fc: 30 e0 ldi r19, 0x00 ; 0 173fe: a9 01 movw r20, r18 17400: c3 01 movw r24, r6 17402: b2 01 movw r22, r4 17404: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 17408: 18 16 cp r1, r24 1740a: 44 f4 brge .+16 ; 0x1741c 1740c: 40 92 13 13 sts 0x1313, r4 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 17410: 50 92 14 13 sts 0x1314, r5 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 17414: 60 92 15 13 sts 0x1315, r6 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 17418: 70 92 16 13 sts 0x1316, r7 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> // ensure warn <= err if (thermal_model::data.warn > thermal_model::data.err) 1741c: c0 90 13 13 lds r12, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 17420: d0 90 14 13 lds r13, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 17424: e0 90 15 13 lds r14, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 17428: f0 90 16 13 lds r15, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 1742c: a7 01 movw r20, r14 1742e: 96 01 movw r18, r12 17430: 60 91 0f 13 lds r22, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 17434: 70 91 10 13 lds r23, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 17438: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 1743c: 90 91 12 13 lds r25, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 17440: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 17444: 18 16 cp r1, r24 17446: 44 f4 brge .+16 ; 0x17458 thermal_model::data.warn = thermal_model::data.err; 17448: c0 92 0f 13 sts 0x130F, r12 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 1744c: d0 92 10 13 sts 0x1310, r13 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 17450: e0 92 11 13 sts 0x1311, r14 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 17454: f0 92 12 13 sts 0x1312, r15 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> thermal_model::setup(); 17458: 0f 94 12 44 call 0x28824 ; 0x28824 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; 1745c: ce 01 movw r24, r28 1745e: 01 96 adiw r24, 0x01 ; 1 17460: 0f 94 9b 46 call 0x28d36 ; 0x28d36 17464: c8 c0 rjmp .+400 ; 0x175f6 */ 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; 17466: 4f ef ldi r20, 0xFF ; 255 17468: ab 96 adiw r28, 0x2b ; 43 1746a: 4f af std Y+63, r20 ; 0x3f 1746c: ab 97 sbiw r28, 0x2b ; 43 1746e: d0 cd rjmp .-1120 ; 0x17010 - `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; 17470: 80 e0 ldi r24, 0x00 ; 0 17472: 90 e0 ldi r25, 0x00 ; 0 17474: a0 ec ldi r26, 0xC0 ; 192 17476: bf e7 ldi r27, 0x7F ; 127 17478: e2 96 adiw r28, 0x32 ; 50 1747a: 8c af std Y+60, r24 ; 0x3c 1747c: 9d af std Y+61, r25 ; 0x3d 1747e: ae af std Y+62, r26 ; 0x3e 17480: bf af std Y+63, r27 ; 0x3f 17482: e2 97 sbiw r28, 0x32 ; 50 17484: d3 cd rjmp .-1114 ; 0x1702c 17486: 20 e0 ldi r18, 0x00 ; 0 17488: 30 e0 ldi r19, 0x00 ; 0 1748a: 40 ec ldi r20, 0xC0 ; 192 1748c: 5f e7 ldi r21, 0x7F ; 127 1748e: 6e 96 adiw r28, 0x1e ; 30 17490: 2c af std Y+60, r18 ; 0x3c 17492: 3d af std Y+61, r19 ; 0x3d 17494: 4e af std Y+62, r20 ; 0x3e 17496: 5f af std Y+63, r21 ; 0x3f 17498: 6e 97 sbiw r28, 0x1e ; 30 1749a: e5 cd rjmp .-1078 ; 0x17066 1749c: 80 e0 ldi r24, 0x00 ; 0 1749e: 90 e0 ldi r25, 0x00 ; 0 174a0: a0 ec ldi r26, 0xC0 ; 192 174a2: bf e7 ldi r27, 0x7F ; 127 174a4: a2 96 adiw r28, 0x22 ; 34 174a6: 8c af std Y+60, r24 ; 0x3c 174a8: 9d af std Y+61, r25 ; 0x3d 174aa: ae af std Y+62, r26 ; 0x3e 174ac: bf af std Y+63, r27 ; 0x3f 174ae: a2 97 sbiw r28, 0x22 ; 34 174b0: e8 cd rjmp .-1072 ; 0x17082 174b2: 20 e0 ldi r18, 0x00 ; 0 174b4: 30 e0 ldi r19, 0x00 ; 0 174b6: 40 ec ldi r20, 0xC0 ; 192 174b8: 5f e7 ldi r21, 0x7F ; 127 174ba: 6a 96 adiw r28, 0x1a ; 26 174bc: 2c af std Y+60, r18 ; 0x3c 174be: 3d af std Y+61, r19 ; 0x3d 174c0: 4e af std Y+62, r20 ; 0x3e 174c2: 5f af std Y+63, r21 ; 0x3f 174c4: 6a 97 sbiw r28, 0x1a ; 26 174c6: eb cd rjmp .-1066 ; 0x1709e 174c8: 80 e0 ldi r24, 0x00 ; 0 174ca: 90 e0 ldi r25, 0x00 ; 0 174cc: a0 ec ldi r26, 0xC0 ; 192 174ce: bf e7 ldi r27, 0x7F ; 127 174d0: aa 96 adiw r28, 0x2a ; 42 174d2: 8c af std Y+60, r24 ; 0x3c 174d4: 9d af std Y+61, r25 ; 0x3d 174d6: ae af std Y+62, r26 ; 0x3e 174d8: bf af std Y+63, r27 ; 0x3f 174da: aa 97 sbiw r28, 0x2a ; 42 174dc: ee cd rjmp .-1060 ; 0x170ba int8_t I = -1, S = -1, B = -1, F = -1; 174de: 9f ef ldi r25, 0xFF ; 255 174e0: e3 96 adiw r28, 0x33 ; 51 174e2: 9f af std Y+63, r25 ; 0x3f 174e4: e3 97 sbiw r28, 0x33 ; 51 174e6: fe cd rjmp .-1028 ; 0x170e4 174e8: af ef ldi r26, 0xFF ; 255 174ea: e7 96 adiw r28, 0x37 ; 55 174ec: af af std Y+63, r26 ; 0x3f 174ee: e7 97 sbiw r28, 0x37 ; 55 174f0: 04 ce rjmp .-1016 ; 0x170fa - `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; 174f2: 20 e0 ldi r18, 0x00 ; 0 174f4: 30 e0 ldi r19, 0x00 ; 0 174f6: 40 ec ldi r20, 0xC0 ; 192 174f8: 5f e7 ldi r21, 0x7F ; 127 174fa: a6 96 adiw r28, 0x26 ; 38 174fc: 2c af std Y+60, r18 ; 0x3c 174fe: 3d af std Y+61, r19 ; 0x3d 17500: 4e af std Y+62, r20 ; 0x3e 17502: 5f af std Y+63, r21 ; 0x3f 17504: a6 97 sbiw r28, 0x26 ; 38 17506: 07 ce rjmp .-1010 ; 0x17116 int8_t I = -1, S = -1, B = -1, F = -1; 17508: 3f ef ldi r19, 0xFF ; 255 1750a: eb 96 adiw r28, 0x3b ; 59 1750c: 3f af std Y+63, r19 ; 0x3f 1750e: eb 97 sbiw r28, 0x3b ; 59 17510: 36 ce rjmp .-916 ; 0x1717e 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(); 17512: 0f 94 ca 42 call 0x28594 ; 0x28594 17516: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e break; } // update all parameters if(B >= 0) 1751a: e7 96 adiw r28, 0x37 ; 55 1751c: 9f ad ldd r25, Y+63 ; 0x3f 1751e: e7 97 sbiw r28, 0x37 ; 55 17520: 97 fd sbrc r25, 7 17522: 09 c0 rjmp .+18 ; 0x17536 thermal_model_set_warn_beep(B); 17524: 81 e0 ldi r24, 0x01 ; 1 17526: e7 96 adiw r28, 0x37 ; 55 17528: af ad ldd r26, Y+63 ; 0x3f 1752a: e7 97 sbiw r28, 0x37 ; 55 1752c: a1 11 cpse r26, r1 1752e: 01 c0 rjmp .+2 ; 0x17532 17530: 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; 17532: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.467> if(!isnan(P) || !isnan(U) || !isnan(V) || !isnan(C) || !isnan(D) || (L >= 0) || !isnan(T) || !isnan(W) || !isnan(E)) 17536: a7 01 movw r20, r14 17538: 96 01 movw r18, r12 1753a: c7 01 movw r24, r14 1753c: b6 01 movw r22, r12 1753e: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17542: 88 23 and r24, r24 17544: 09 f4 brne .+2 ; 0x17548 17546: 97 ce rjmp .-722 ; 0x17276 17548: 6e 96 adiw r28, 0x1e ; 30 1754a: 2c ad ldd r18, Y+60 ; 0x3c 1754c: 3d ad ldd r19, Y+61 ; 0x3d 1754e: 4e ad ldd r20, Y+62 ; 0x3e 17550: 5f ad ldd r21, Y+63 ; 0x3f 17552: 6e 97 sbiw r28, 0x1e ; 30 17554: ca 01 movw r24, r20 17556: b9 01 movw r22, r18 17558: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1755c: 88 23 and r24, r24 1755e: 09 f4 brne .+2 ; 0x17562 17560: 8a ce rjmp .-748 ; 0x17276 17562: a2 96 adiw r28, 0x22 ; 34 17564: 2c ad ldd r18, Y+60 ; 0x3c 17566: 3d ad ldd r19, Y+61 ; 0x3d 17568: 4e ad ldd r20, Y+62 ; 0x3e 1756a: 5f ad ldd r21, Y+63 ; 0x3f 1756c: a2 97 sbiw r28, 0x22 ; 34 1756e: ca 01 movw r24, r20 17570: b9 01 movw r22, r18 17572: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17576: 88 23 and r24, r24 17578: 09 f4 brne .+2 ; 0x1757c 1757a: 7d ce rjmp .-774 ; 0x17276 1757c: 6a 96 adiw r28, 0x1a ; 26 1757e: 2c ad ldd r18, Y+60 ; 0x3c 17580: 3d ad ldd r19, Y+61 ; 0x3d 17582: 4e ad ldd r20, Y+62 ; 0x3e 17584: 5f ad ldd r21, Y+63 ; 0x3f 17586: 6a 97 sbiw r28, 0x1a ; 26 17588: ca 01 movw r24, r20 1758a: b9 01 movw r22, r18 1758c: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17590: 88 23 and r24, r24 17592: 09 f4 brne .+2 ; 0x17596 17594: 70 ce rjmp .-800 ; 0x17276 17596: aa 96 adiw r28, 0x2a ; 42 17598: 2c ad ldd r18, Y+60 ; 0x3c 1759a: 3d ad ldd r19, Y+61 ; 0x3d 1759c: 4e ad ldd r20, Y+62 ; 0x3e 1759e: 5f ad ldd r21, Y+63 ; 0x3f 175a0: aa 97 sbiw r28, 0x2a ; 42 175a2: ca 01 movw r24, r20 175a4: b9 01 movw r22, r18 175a6: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 175aa: 88 23 and r24, r24 175ac: 09 f4 brne .+2 ; 0x175b0 175ae: 63 ce rjmp .-826 ; 0x17276 175b0: 17 fd sbrc r17, 7 175b2: 02 c0 rjmp .+4 ; 0x175b8 175b4: 0c 94 ac ce jmp 0x19d58 ; 0x19d58 175b8: a6 96 adiw r28, 0x26 ; 38 175ba: 2c ad ldd r18, Y+60 ; 0x3c 175bc: 3d ad ldd r19, Y+61 ; 0x3d 175be: 4e ad ldd r20, Y+62 ; 0x3e 175c0: 5f ad ldd r21, Y+63 ; 0x3f 175c2: a6 97 sbiw r28, 0x26 ; 38 175c4: ca 01 movw r24, r20 175c6: b9 01 movw r22, r18 175c8: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 175cc: 88 23 and r24, r24 175ce: 09 f4 brne .+2 ; 0x175d2 175d0: 52 ce rjmp .-860 ; 0x17276 175d2: a5 01 movw r20, r10 175d4: 94 01 movw r18, r8 175d6: c5 01 movw r24, r10 175d8: b4 01 movw r22, r8 175da: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 175de: 88 23 and r24, r24 175e0: 09 f4 brne .+2 ; 0x175e4 175e2: 49 ce rjmp .-878 ; 0x17276 175e4: a3 01 movw r20, r6 175e6: 92 01 movw r18, r4 175e8: c3 01 movw r24, r6 175ea: b2 01 movw r22, r4 175ec: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 175f0: 88 23 and r24, r24 175f2: 09 f4 brne .+2 ; 0x175f6 175f4: 40 ce rjmp .-896 ; 0x17276 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 175f6: ab 96 adiw r28, 0x2b ; 43 175f8: 3f ad ldd r19, Y+63 ; 0x3f 175fa: ab 97 sbiw r28, 0x2b ; 43 175fc: 37 fd sbrc r19, 7 175fe: 3b c0 rjmp .+118 ; 0x17676 17600: e2 96 adiw r28, 0x32 ; 50 17602: 2c ad ldd r18, Y+60 ; 0x3c 17604: 3d ad ldd r19, Y+61 ; 0x3d 17606: 4e ad ldd r20, Y+62 ; 0x3e 17608: 5f ad ldd r21, Y+63 ; 0x3f 1760a: e2 97 sbiw r28, 0x32 ; 50 1760c: ca 01 movw r24, r20 1760e: b9 01 movw r22, r18 17610: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17614: 81 11 cpse r24, r1 17616: 2f c0 rjmp .+94 ; 0x17676 thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 17618: ab 96 adiw r28, 0x2b ; 43 1761a: 4f ad ldd r20, Y+63 ; 0x3f 1761c: ab 97 sbiw r28, 0x2b ; 43 1761e: 40 31 cpi r20, 0x10 ; 16 17620: 54 f5 brge .+84 ; 0x17676 17622: 20 e0 ldi r18, 0x00 ; 0 17624: 30 e0 ldi r19, 0x00 ; 0 17626: a9 01 movw r20, r18 17628: e2 96 adiw r28, 0x32 ; 50 1762a: 6c ad ldd r22, Y+60 ; 0x3c 1762c: 7d ad ldd r23, Y+61 ; 0x3d 1762e: 8e ad ldd r24, Y+62 ; 0x3e 17630: 9f ad ldd r25, Y+63 ; 0x3f 17632: e2 97 sbiw r28, 0x32 ; 50 17634: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 17638: 18 16 cp r1, r24 1763a: ec f4 brge .+58 ; 0x17676 return; TempMgrGuard temp_mgr_guard; 1763c: ce 01 movw r24, r28 1763e: 01 96 adiw r24, 0x01 ; 1 17640: 0f 94 a8 46 call 0x28d50 ; 0x28d50 thermal_model::data.R[index] = R; 17644: ab 96 adiw r28, 0x2b ; 43 17646: 5f ad ldd r21, Y+63 ; 0x3f 17648: ab 97 sbiw r28, 0x2b ; 43 1764a: 84 e0 ldi r24, 0x04 ; 4 1764c: 58 02 muls r21, r24 1764e: f0 01 movw r30, r0 17650: 11 24 eor r1, r1 17652: e5 53 subi r30, 0x35 ; 53 17654: fd 4e sbci r31, 0xED ; 237 17656: e2 96 adiw r28, 0x32 ; 50 17658: 2c ad ldd r18, Y+60 ; 0x3c 1765a: 3d ad ldd r19, Y+61 ; 0x3d 1765c: 4e ad ldd r20, Y+62 ; 0x3e 1765e: 5f ad ldd r21, Y+63 ; 0x3f 17660: e2 97 sbiw r28, 0x32 ; 50 17662: 20 83 st Z, r18 17664: 31 83 std Z+1, r19 ; 0x01 17666: 42 83 std Z+2, r20 ; 0x02 17668: 53 83 std Z+3, r21 ; 0x03 thermal_model::setup(); 1766a: 0f 94 12 44 call 0x28824 ; 0x28824 void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 1766e: ce 01 movw r24, r28 17670: 01 96 adiw r24, 0x01 ; 1 17672: 0f 94 9b 46 call 0x28d36 ; 0x28d36 thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17676: e3 96 adiw r28, 0x33 ; 51 17678: 3f ad ldd r19, Y+63 ; 0x3f 1767a: e3 97 sbiw r28, 0x33 ; 51 1767c: 37 fd sbrc r19, 7 1767e: 06 c0 rjmp .+12 ; 0x1768c 17680: 81 e0 ldi r24, 0x01 ; 1 17682: 31 11 cpse r19, r1 17684: 01 c0 rjmp .+2 ; 0x17688 17686: 80 e0 ldi r24, 0x00 ; 0 17688: 0f 94 47 47 call 0x28e8e ; 0x28e8e // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 1768c: 37 fe sbrs r3, 7 1768e: 02 c0 rjmp .+4 ; 0x17694 17690: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 17694: 11 e0 ldi r17, 0x01 ; 1 17696: eb 96 adiw r28, 0x3b ; 59 17698: 4f ad ldd r20, Y+63 ; 0x3f 1769a: eb 97 sbiw r28, 0x3b ; 59 1769c: 14 16 cp r1, r20 1769e: 0c f0 brlt .+2 ; 0x176a2 176a0: 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; 176a2: 81 e0 ldi r24, 0x01 ; 1 176a4: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.554> } //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); 176a8: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 176ac: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 176b0: 89 1b sub r24, r25 176b2: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 176b4: 41 f4 brne .+16 ; 0x176c6 176b6: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 176ba: 85 30 cpi r24, 0x05 ; 5 176bc: 69 f1 breq .+90 ; 0x17718 176be: 0e 94 27 69 call 0xd24e ; 0xd24e 176c2: 88 23 and r24, r24 176c4: 49 f1 breq .+82 ; 0x17718 sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 176c6: 8b e1 ldi r24, 0x1B ; 27 176c8: 96 e8 ldi r25, 0x86 ; 134 176ca: 9f 93 push r25 176cc: 8f 93 push r24 176ce: 81 e0 ldi r24, 0x01 ; 1 176d0: 90 e0 ldi r25, 0x00 ; 0 176d2: 8c 0f add r24, r28 176d4: 9d 1f adc r25, r29 176d6: 9f 93 push r25 176d8: 8f 93 push r24 176da: 0f 94 26 dc call 0x3b84c ; 0x3b84c lcd_setstatus_serial(tm_message); 176de: ce 01 movw r24, r28 176e0: 01 96 adiw r24, 0x01 ; 1 176e2: 0f 94 cf 0a call 0x2159e ; 0x2159e return; 176e6: 0f 90 pop r0 176e8: 0f 90 pop r0 176ea: 0f 90 pop r0 176ec: 0f 90 pop r0 176ee: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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; 176f2: 20 e0 ldi r18, 0x00 ; 0 176f4: 30 e0 ldi r19, 0x00 ; 0 176f6: a9 01 movw r20, r18 176f8: c7 01 movw r24, r14 176fa: b6 01 movw r22, r12 176fc: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 17700: 18 16 cp r1, r24 17702: 0c f0 brlt .+2 ; 0x17706 17704: c5 cd rjmp .-1142 ; 0x17290 17706: c0 92 b5 12 sts 0x12B5, r12 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 1770a: d0 92 b6 12 sts 0x12B6, r13 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 1770e: e0 92 b7 12 sts 0x12B7, r14 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 17712: f0 92 b8 12 sts 0x12B8, r15 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> 17716: bc cd rjmp .-1160 ; 0x17290 lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 17718: 83 e0 ldi r24, 0x03 ; 3 1771a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 1771e: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 17722: 82 60 ori r24, 0x02 ; 2 17724: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce lcd_return_to_status(); 17728: 0f 94 1d 26 call 0x24c3a ; 0x24c3a // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 1772c: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 17730: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 17734: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 17738: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 1773c: 6e 96 adiw r28, 0x1e ; 30 1773e: 2c af std Y+60, r18 ; 0x3c 17740: 3d af std Y+61, r19 ; 0x3d 17742: 4e af std Y+62, r20 ; 0x3e 17744: 5f af std Y+63, r21 ; 0x3f 17746: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 17748: 80 e4 ldi r24, 0x40 ; 64 1774a: eb ec ldi r30, 0xCB ; 203 1774c: f2 e1 ldi r31, 0x12 ; 18 1774e: de 01 movw r26, r28 17750: 11 96 adiw r26, 0x01 ; 1 17752: 01 90 ld r0, Z+ 17754: 0d 92 st X+, r0 17756: 8a 95 dec r24 17758: e1 f7 brne .-8 ; 0x17752 orig_enabled = thermal_model::enabled; 1775a: 30 91 1d 05 lds r19, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> 1775e: 67 96 adiw r28, 0x17 ; 23 17760: 3f af std Y+63, r19 ; 0x3f 17762: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 17764: 81 2f mov r24, r17 17766: 0f 94 69 47 call 0x28ed2 ; 0x28ed2 // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 1776a: 85 e0 ldi r24, 0x05 ; 5 1776c: 96 e8 ldi r25, 0x86 ; 134 1776e: 0e 94 97 7b call 0xf72e ; 0xf72e thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17772: 21 14 cp r2, r1 17774: 31 04 cpc r3, r1 17776: 19 f4 brne .+6 ; 0x1777e 17778: 26 ee ldi r18, 0xE6 ; 230 1777a: 22 2e mov r2, r18 1777c: 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); 1777e: 80 e0 ldi r24, 0x00 ; 0 17780: 0f 94 c0 42 call 0x28580 ; 0x28580 17784: 82 e0 ldi r24, 0x02 ; 2 17786: 48 2e mov r4, r24 17788: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 1778a: 99 ee ldi r25, 0xE9 ; 233 1778c: 69 2e mov r6, r25 1778e: 95 e8 ldi r25, 0x85 ; 133 17790: 79 2e mov r7, r25 17792: ae 01 movw r20, r28 17794: 4f 5b subi r20, 0xBF ; 191 17796: 5f 4f sbci r21, 0xFF ; 255 17798: 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); 1779a: 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; 1779c: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 177a0: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 177a4: 20 e0 ldi r18, 0x00 ; 0 177a6: 30 e0 ldi r19, 0x00 ; 0 177a8: 48 e4 ldi r20, 0x48 ; 72 177aa: 52 e4 ldi r21, 0x42 ; 66 177ac: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 177b0: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 177b4: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 177b8: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 177bc: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 177c0: 87 fd sbrc r24, 7 177c2: 58 c0 rjmp .+176 ; 0x17874 sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 177c4: 1f 92 push r1 177c6: 1f 93 push r17 177c8: 8f ec ldi r24, 0xCF ; 207 177ca: 95 e8 ldi r25, 0x85 ; 133 177cc: 9f 93 push r25 177ce: 8f 93 push r24 177d0: 9f 92 push r9 177d2: 8f 92 push r8 177d4: 0f 94 26 dc call 0x3b84c ; 0x3b84c lcd_setstatus_serial(tm_message); 177d8: c4 01 movw r24, r8 177da: 0f 94 cf 0a call 0x2159e ; 0x2159e } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 177de: 00 91 df 03 lds r16, 0x03DF ; 0x8003df set_fan_speed(255); 177e2: 8f ef ldi r24, 0xFF ; 255 177e4: 0f 94 c0 42 call 0x28580 ; 0x28580 177e8: 0f 90 pop r0 177ea: 0f 90 pop r0 177ec: 0f 90 pop r0 177ee: 0f 90 pop r0 177f0: 0f 90 pop r0 177f2: 0f 90 pop r0 while(current_temperature[0] >= temp) { 177f4: c0 90 5e 0e lds r12, 0x0E5E ; 0x800e5e 177f8: d0 90 5f 0e lds r13, 0x0E5F ; 0x800e5f 177fc: e0 90 60 0e lds r14, 0x0E60 ; 0x800e60 17800: f0 90 61 0e lds r15, 0x0E61 ; 0x800e61 17804: 20 e0 ldi r18, 0x00 ; 0 17806: 30 e0 ldi r19, 0x00 ; 0 17808: 48 e4 ldi r20, 0x48 ; 72 1780a: 52 e4 ldi r21, 0x42 ; 66 1780c: c7 01 movw r24, r14 1780e: b6 01 movw r22, r12 17810: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 17814: 87 fd sbrc r24, 7 17816: 27 c0 rjmp .+78 ; 0x17866 if(temp_error_state.v) break; 17818: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 1781c: 81 11 cpse r24, r1 1781e: 23 c0 rjmp .+70 ; 0x17866 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 17820: 20 91 50 06 lds r18, 0x0650 ; 0x800650 17824: 30 91 51 06 lds r19, 0x0651 ; 0x800651 17828: 40 91 52 06 lds r20, 0x0652 ; 0x800652 1782c: 50 91 53 06 lds r21, 0x0653 ; 0x800653 17830: 60 91 0b 13 lds r22, 0x130B ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 17834: 70 91 0c 13 lds r23, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 17838: 80 91 0d 13 lds r24, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 1783c: 90 91 0e 13 lds r25, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> 17840: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 17844: 20 e0 ldi r18, 0x00 ; 0 17846: 30 e0 ldi r19, 0x00 ; 0 17848: 40 ea ldi r20, 0xA0 ; 160 1784a: 50 e4 ldi r21, 0x40 ; 64 1784c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 17850: 9b 01 movw r18, r22 17852: ac 01 movw r20, r24 17854: c7 01 movw r24, r14 17856: b6 01 movw r22, r12 17858: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1785c: 87 fd sbrc r24, 7 1785e: 03 c0 rjmp .+6 ; 0x17866 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 17860: 0f 94 8e 4f call 0x29f1c ; 0x29f1c 17864: c7 cf rjmp .-114 ; 0x177f4 } set_fan_speed(old_speed); 17866: 80 2f mov r24, r16 17868: 0f 94 c0 42 call 0x28580 ; 0x28580 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); 1786c: 80 e1 ldi r24, 0x10 ; 16 1786e: 97 e2 ldi r25, 0x27 ; 39 17870: 0f 94 bb 4f call 0x29f76 ; 0x29f76 } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 17874: 7f 92 push r7 17876: 6f 92 push r6 17878: e1 ec ldi r30, 0xC1 ; 193 1787a: f5 e8 ldi r31, 0x85 ; 133 1787c: ff 93 push r31 1787e: ef 93 push r30 17880: 9f 92 push r9 17882: 8f 92 push r8 17884: 0f 94 26 dc call 0x3b84c ; 0x3b84c lcd_setstatus_serial(tm_message); 17888: c4 01 movw r24, r8 1788a: 0f 94 cf 0a call 0x2159e ; 0x2159e target_temperature[0] = cal_temp; 1788e: 30 92 6b 0e sts 0x0E6B, r3 ; 0x800e6b 17892: 20 92 6a 0e sts 0x0E6A, r2 ; 0x800e6a samples = record(); 17896: 0f 94 d3 1c call 0x239a6 ; 0x239a6 1789a: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 1789c: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 178a0: 0f 90 pop r0 178a2: 0f 90 pop r0 178a4: 0f 90 pop r0 178a6: 0f 90 pop r0 178a8: 0f 90 pop r0 178aa: 0f 90 pop r0 178ac: 81 11 cpse r24, r1 178ae: 7a c0 rjmp .+244 ; 0x179a4 178b0: a1 14 cp r10, r1 178b2: b1 04 cpc r11, r1 178b4: 09 f4 brne .+2 ; 0x178b8 178b6: 76 c0 rjmp .+236 ; 0x179a4 return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 178b8: 60 91 cb 12 lds r22, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+0x40> 178bc: 70 91 cc 12 lds r23, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x41> 178c0: 80 91 cd 12 lds r24, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x42> 178c4: 90 91 ce 12 lds r25, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.394+0x43> 178c8: 9b 01 movw r18, r22 178ca: ac 01 movw r20, r24 178cc: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 178d0: 88 23 and r24, r24 178d2: 61 f0 breq .+24 ; 0x178ec thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 178d4: 80 e0 ldi r24, 0x00 ; 0 178d6: 90 e0 ldi r25, 0x00 ; 0 178d8: a8 e4 ldi r26, 0x48 ; 72 178da: b2 e4 ldi r27, 0x42 ; 66 178dc: 80 93 cb 12 sts 0x12CB, r24 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+0x40> 178e0: 90 93 cc 12 sts 0x12CC, r25 ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x41> 178e4: a0 93 cd 12 sts 0x12CD, r26 ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x42> 178e8: b0 93 ce 12 sts 0x12CE, r27 ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.394+0x43> e = estimate(samples, &thermal_model::data.C, 178ec: c0 90 50 06 lds r12, 0x0650 ; 0x800650 178f0: d0 90 51 06 lds r13, 0x0651 ; 0x800651 178f4: e0 90 52 06 lds r14, 0x0652 ; 0x800652 178f8: f0 90 53 06 lds r15, 0x0653 ; 0x800653 178fc: 00 e0 ldi r16, 0x00 ; 0 178fe: 20 e0 ldi r18, 0x00 ; 0 17900: 30 e0 ldi r19, 0x00 ; 0 17902: 40 ea ldi r20, 0xA0 ; 160 17904: 51 e4 ldi r21, 0x41 ; 65 17906: 61 ec ldi r22, 0xC1 ; 193 17908: 72 e1 ldi r23, 0x12 ; 18 1790a: c5 01 movw r24, r10 1790c: 0e 94 69 dc call 0x1b8d2 ; 0x1b8d2 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)) 17910: 9b 01 movw r18, r22 17912: ac 01 movw r20, r24 17914: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17918: 81 11 cpse r24, r1 1791a: 44 c0 rjmp .+136 ; 0x179a4 return true; wait_temp(); 1791c: 0f 94 99 4f call 0x29f32 ; 0x29f32 if(i) break; // we don't need to refine R 17920: 4a 94 dec r4 17922: 45 28 or r4, r5 17924: 09 f4 brne .+2 ; 0x17928 17926: 85 c0 rjmp .+266 ; 0x17a32 wait(30000); // settle PID regulation 17928: 80 e3 ldi r24, 0x30 ; 48 1792a: 95 e7 ldi r25, 0x75 ; 117 1792c: 0f 94 bb 4f call 0x29f76 ; 0x29f76 sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 17930: 3f 92 push r3 17932: 2f 92 push r2 17934: 7f 92 push r7 17936: 6f 92 push r6 17938: 44 eb ldi r20, 0xB4 ; 180 1793a: 55 e8 ldi r21, 0x85 ; 133 1793c: 5f 93 push r21 1793e: 4f 93 push r20 17940: 9f 92 push r9 17942: 8f 92 push r8 17944: 0f 94 26 dc call 0x3b84c ; 0x3b84c lcd_setstatus_serial(tm_message); 17948: c4 01 movw r24, r8 1794a: 0f 94 cf 0a call 0x2159e ; 0x2159e samples = record(); 1794e: 0f 94 d3 1c call 0x239a6 ; 0x239a6 if(temp_error_state.v || !samples) 17952: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 17956: 0f b6 in r0, 0x3f ; 63 17958: f8 94 cli 1795a: de bf out 0x3e, r29 ; 62 1795c: 0f be out 0x3f, r0 ; 63 1795e: cd bf out 0x3d, r28 ; 61 17960: 21 11 cpse r18, r1 17962: 20 c0 rjmp .+64 ; 0x179a4 17964: 00 97 sbiw r24, 0x00 ; 0 17966: f1 f0 breq .+60 ; 0x179a4 return true; e = estimate(samples, &thermal_model::data.R[0], 17968: c0 90 50 06 lds r12, 0x0650 ; 0x800650 1796c: d0 90 51 06 lds r13, 0x0651 ; 0x800651 17970: e0 90 52 06 lds r14, 0x0652 ; 0x800652 17974: f0 90 53 06 lds r15, 0x0653 ; 0x800653 17978: 20 e0 ldi r18, 0x00 ; 0 1797a: 30 e0 ldi r19, 0x00 ; 0 1797c: 48 e4 ldi r20, 0x48 ; 72 1797e: 52 e4 ldi r21, 0x42 ; 66 17980: 6b ec ldi r22, 0xCB ; 203 17982: 72 e1 ldi r23, 0x12 ; 18 17984: 0e 94 69 dc call 0x1b8d2 ; 0x1b8d2 // 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")); 17988: b2 ee ldi r27, 0xE2 ; 226 1798a: 6b 2e mov r6, r27 1798c: b5 e8 ldi r27, 0x85 ; 133 1798e: 7b 2e mov r7, r27 17990: 44 24 eor r4, r4 17992: 43 94 inc r4 17994: 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)) 17996: 9b 01 movw r18, r22 17998: ac 01 movw r20, r24 1799a: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1799e: 88 23 and r24, r24 179a0: 09 f4 brne .+2 ; 0x179a4 179a2: fc ce rjmp .-520 ; 0x1779c 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; 179a4: 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); 179a6: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.554> // always reset temperature disable_heater(); 179aa: 0f 94 21 44 call 0x28842 ; 0x28842 if(thermal_model_autotune_err) { 179ae: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.554> 179b2: 88 23 and r24, r24 179b4: 09 f4 brne .+2 ; 0x179b8 179b6: fd c0 rjmp .+506 ; 0x17bb2 sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 179b8: 81 ef ldi r24, 0xF1 ; 241 179ba: 95 e8 ldi r25, 0x85 ; 133 179bc: 9f 93 push r25 179be: 8f 93 push r24 179c0: 9f 92 push r9 179c2: 8f 92 push r8 179c4: 0f 94 26 dc call 0x3b84c ; 0x3b84c lcd_setstatus_serial(tm_message); 179c8: c4 01 movw r24, r8 179ca: 0f 94 cf 0a call 0x2159e ; 0x2159e if(temp_error_state.v) 179ce: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 179d2: 0f 90 pop r0 179d4: 0f 90 pop r0 179d6: 0f 90 pop r0 179d8: 0f 90 pop r0 179da: 88 23 and r24, r24 179dc: 19 f0 breq .+6 ; 0x179e4 thermal_model_cal::set_fan_speed(255); 179de: 8f ef ldi r24, 0xFF ; 255 179e0: 0f 94 c0 42 call 0x28580 ; 0x28580 // show calibrated values before overwriting them thermal_model_report_settings(); 179e4: 0f 94 ca 42 call 0x28594 ; 0x28594 // restore original state thermal_model::data.C = orig_C; 179e8: 6e 96 adiw r28, 0x1e ; 30 179ea: 2c ad ldd r18, Y+60 ; 0x3c 179ec: 3d ad ldd r19, Y+61 ; 0x3d 179ee: 4e ad ldd r20, Y+62 ; 0x3e 179f0: 5f ad ldd r21, Y+63 ; 0x3f 179f2: 6e 97 sbiw r28, 0x1e ; 30 179f4: 20 93 c1 12 sts 0x12C1, r18 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 179f8: 30 93 c2 12 sts 0x12C2, r19 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 179fc: 40 93 c3 12 sts 0x12C3, r20 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 17a00: 50 93 c4 12 sts 0x12C4, r21 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); 17a04: 80 e4 ldi r24, 0x40 ; 64 17a06: fe 01 movw r30, r28 17a08: 31 96 adiw r30, 0x01 ; 1 17a0a: ab ec ldi r26, 0xCB ; 203 17a0c: b2 e1 ldi r27, 0x12 ; 18 17a0e: 01 90 ld r0, Z+ 17a10: 0d 92 st X+, r0 17a12: 8a 95 dec r24 17a14: e1 f7 brne .-8 ; 0x17a0e thermal_model_set_enabled(orig_enabled); 17a16: 67 96 adiw r28, 0x17 ; 23 17a18: 8f ad ldd r24, Y+63 ; 0x3f 17a1a: 67 97 sbiw r28, 0x17 ; 23 17a1c: 0f 94 47 47 call 0x28e8e ; 0x28e8e thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 17a20: 0e 94 3e 72 call 0xe47c ; 0xe47c menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 17a24: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 17a28: 8d 7f andi r24, 0xFD ; 253 17a2a: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce 17a2e: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e // 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); 17a32: 8f ef ldi r24, 0xFF ; 255 17a34: 0f 94 c0 42 call 0x28580 ; 0x28580 wait(30000); 17a38: 80 e3 ldi r24, 0x30 ; 48 17a3a: 95 e7 ldi r25, 0x75 ; 117 17a3c: 0f 94 bb 4f call 0x29f76 ; 0x29f76 17a40: e7 e0 ldi r30, 0x07 ; 7 17a42: 6e 2e mov r6, r30 17a44: e3 e1 ldi r30, 0x13 ; 19 17a46: 7e 2e mov r7, r30 17a48: 1f ef ldi r17, 0xFF ; 255 17a4a: ff e0 ldi r31, 0x0F ; 15 17a4c: af 2e mov r10, r31 17a4e: 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; 17a50: 21 2c mov r2, r1 17a52: 31 2c mov r3, r1 17a54: a0 ec ldi r26, 0xC0 ; 192 17a56: 4a 2e mov r4, r26 17a58: af e7 ldi r26, 0x7F ; 127 17a5a: 5a 2e mov r5, r26 17a5c: f3 01 movw r30, r6 17a5e: 20 82 st Z, r2 17a60: 31 82 std Z+1, r3 ; 0x01 17a62: 42 82 std Z+2, r4 ; 0x02 17a64: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 17a66: 81 2f mov r24, r17 17a68: 0f 94 c0 42 call 0x28580 ; 0x28580 wait(10000); 17a6c: 80 e1 ldi r24, 0x10 ; 16 17a6e: 97 e2 ldi r25, 0x27 ; 39 17a70: 0f 94 bb 4f call 0x29f76 ; 0x29f76 sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 17a74: bf 92 push r11 17a76: af 92 push r10 17a78: 20 ea ldi r18, 0xA0 ; 160 17a7a: 35 e8 ldi r19, 0x85 ; 133 17a7c: 3f 93 push r19 17a7e: 2f 93 push r18 17a80: 9f 92 push r9 17a82: 8f 92 push r8 17a84: 0f 94 26 dc call 0x3b84c ; 0x3b84c lcd_setstatus_serial(tm_message); 17a88: c4 01 movw r24, r8 17a8a: 0f 94 cf 0a call 0x2159e ; 0x2159e samples = record(); 17a8e: 0f 94 d3 1c call 0x239a6 ; 0x239a6 if(temp_error_state.v || !samples) 17a92: 20 91 1b 05 lds r18, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 17a96: 0f 90 pop r0 17a98: 0f 90 pop r0 17a9a: 0f 90 pop r0 17a9c: 0f 90 pop r0 17a9e: 0f 90 pop r0 17aa0: 0f 90 pop r0 17aa2: 21 11 cpse r18, r1 17aa4: 7f cf rjmp .-258 ; 0x179a4 17aa6: 00 97 sbiw r24, 0x00 ; 0 17aa8: 09 f4 brne .+2 ; 0x17aac 17aaa: 7c cf rjmp .-264 ; 0x179a4 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], 17aac: c0 90 50 06 lds r12, 0x0650 ; 0x800650 17ab0: d0 90 51 06 lds r13, 0x0651 ; 0x800651 17ab4: e0 90 52 06 lds r14, 0x0652 ; 0x800652 17ab8: f0 90 53 06 lds r15, 0x0653 ; 0x800653 17abc: 20 91 cb 12 lds r18, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.394+0x40> 17ac0: 30 91 cc 12 lds r19, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.394+0x41> 17ac4: 40 91 cd 12 lds r20, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.394+0x42> 17ac8: 50 91 ce 12 lds r21, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.394+0x43> 17acc: 0a 2d mov r16, r10 17ace: b3 01 movw r22, r6 17ad0: 0e 94 69 dc call 0x1b8d2 ; 0x1b8d2 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)) 17ad4: 9b 01 movw r18, r22 17ad6: ac 01 movw r20, r24 17ad8: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 17adc: 81 11 cpse r24, r1 17ade: 62 cf rjmp .-316 ; 0x179a4 17ae0: 54 e0 ldi r21, 0x04 ; 4 17ae2: a5 1a sub r10, r21 17ae4: b1 08 sbc r11, r1 17ae6: 80 e1 ldi r24, 0x10 ; 16 17ae8: 68 1a sub r6, r24 17aea: 71 08 sbc r7, r1 17aec: 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) { 17aee: 9f ef ldi r25, 0xFF ; 255 17af0: a9 16 cp r10, r25 17af2: b9 06 cpc r11, r25 17af4: 09 f0 breq .+2 ; 0x17af8 17af6: b2 cf rjmp .-156 ; 0x17a5c 17af8: 63 e0 ldi r22, 0x03 ; 3 17afa: e6 2e mov r14, r22 17afc: 63 e1 ldi r22, 0x13 ; 19 17afe: f6 2e mov r15, r22 17b00: 0e e0 ldi r16, 0x0E ; 14 17b02: 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; 17b04: 7f e0 ldi r23, 0x0F ; 15 17b06: 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)) { 17b08: 8f e0 ldi r24, 0x0F ; 15 17b0a: 90 e0 ldi r25, 0x00 ; 0 17b0c: 80 1b sub r24, r16 17b0e: 91 0b sbc r25, r17 17b10: 83 70 andi r24, 0x03 ; 3 17b12: 99 27 eor r25, r25 17b14: 89 2b or r24, r25 17b16: 59 f4 brne .+22 ; 0x17b2e next = i; 17b18: 30 2e mov r3, r16 17b1a: 01 50 subi r16, 0x01 ; 1 17b1c: 11 09 sbc r17, r1 17b1e: f4 e0 ldi r31, 0x04 ; 4 17b20: ef 1a sub r14, r31 17b22: 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) { 17b24: 01 15 cp r16, r1 17b26: 11 05 cpc r17, r1 17b28: 79 f7 brne .-34 ; 0x17b08 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; 17b2a: 80 e0 ldi r24, 0x00 ; 0 17b2c: 3c cf rjmp .-392 ; 0x179a6 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; 17b2e: 8c ef ldi r24, 0xFC ; 252 17b30: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 17b32: 87 fd sbrc r24, 7 17b34: 80 e0 ldi r24, 0x00 ; 0 17b36: 08 2e mov r0, r24 17b38: 00 0c add r0, r0 17b3a: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17b3c: fc 01 movw r30, r24 17b3e: ee 0f add r30, r30 17b40: ff 1f adc r31, r31 17b42: ee 0f add r30, r30 17b44: ff 1f adc r31, r31 17b46: e5 53 subi r30, 0x35 ; 53 17b48: fd 4e sbci r31, 0xED ; 237 17b4a: 40 80 ld r4, Z 17b4c: 51 80 ldd r5, Z+1 ; 0x01 17b4e: 62 80 ldd r6, Z+2 ; 0x02 17b50: 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; 17b52: b8 01 movw r22, r16 17b54: 68 1b sub r22, r24 17b56: 79 0b sbc r23, r25 17b58: 07 2e mov r0, r23 17b5a: 00 0c add r0, r0 17b5c: 88 0b sbc r24, r24 17b5e: 99 0b sbc r25, r25 17b60: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 17b64: 20 e0 ldi r18, 0x00 ; 0 17b66: 30 e0 ldi r19, 0x00 ; 0 17b68: 40 e8 ldi r20, 0x80 ; 128 17b6a: 5e e3 ldi r21, 0x3E ; 62 17b6c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 17b70: 5b 01 movw r10, r22 17b72: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 17b74: a3 2d mov r26, r3 17b76: b4 e0 ldi r27, 0x04 ; 4 17b78: ab 02 muls r26, r27 17b7a: f0 01 movw r30, r0 17b7c: 11 24 eor r1, r1 17b7e: e5 53 subi r30, 0x35 ; 53 17b80: fd 4e sbci r31, 0xED ; 237 17b82: a3 01 movw r20, r6 17b84: 92 01 movw r18, r4 17b86: 60 81 ld r22, Z 17b88: 71 81 ldd r23, Z+1 ; 0x01 17b8a: 82 81 ldd r24, Z+2 ; 0x02 17b8c: 93 81 ldd r25, Z+3 ; 0x03 17b8e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 17b92: 9b 01 movw r18, r22 17b94: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 17b96: c6 01 movw r24, r12 17b98: b5 01 movw r22, r10 17b9a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 17b9e: a3 01 movw r20, r6 17ba0: 92 01 movw r18, r4 17ba2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 17ba6: f7 01 movw r30, r14 17ba8: 60 83 st Z, r22 17baa: 71 83 std Z+1, r23 ; 0x01 17bac: 82 83 std Z+2, r24 ; 0x02 17bae: 93 83 std Z+3, r25 ; 0x03 17bb0: b4 cf rjmp .-152 ; 0x17b1a // 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); 17bb2: 88 e0 ldi r24, 0x08 ; 8 17bb4: 0e 94 5c e6 call 0x1ccb8 ; 0x1ccb8 lcd_setstatuspgm(MSG_WELCOME); 17bb8: 81 e5 ldi r24, 0x51 ; 81 17bba: 91 e7 ldi r25, 0x71 ; 113 17bbc: 0f 94 e0 0a call 0x215c0 ; 0x215c0 thermal_model_cal::set_fan_speed(0); 17bc0: 80 e0 ldi r24, 0x00 ; 0 17bc2: 0f 94 c0 42 call 0x28580 ; 0x28580 thermal_model_set_enabled(orig_enabled); 17bc6: 67 96 adiw r28, 0x17 ; 23 17bc8: 8f ad ldd r24, Y+63 ; 0x3f 17bca: 67 97 sbiw r28, 0x17 ; 23 17bcc: 0f 94 47 47 call 0x28e8e ; 0x28e8e thermal_model_report_settings(); 17bd0: 0f 94 ca 42 call 0x28594 ; 0x28594 17bd4: 25 cf rjmp .-438 ; 0x17a20 M400 */ case 400: { st_synchronize(); 17bd6: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 17bda: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e */ 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()) 17bde: 80 91 95 13 lds r24, 0x1395 ; 0x801395 17be2: 81 30 cpi r24, 0x01 ; 1 17be4: 11 f0 breq .+4 ; 0x17bea 17be6: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 17bea: 85 e4 ldi r24, 0x45 ; 69 17bec: 0e 94 0d 5d call 0xba1a ; 0xba1a 17bf0: 81 11 cpse r24, r1 17bf2: 0e 94 9f 5c call 0xb93e ; 0xb93e if(code_seen('F')) filament = code_value_uint8(); 17bf6: 86 e4 ldi r24, 0x46 ; 70 17bf8: 0e 94 0d 5d call 0xba1a ; 0xba1a 17bfc: 81 11 cpse r24, r1 17bfe: 0e 94 9f 5c call 0xb93e ; 0xb93e MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 17c02: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 17c06: 88 23 and r24, r24 17c08: 11 f4 brne .+4 ; 0x17c0e 17c0a: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 17c0e: 60 e0 ldi r22, 0x00 ; 0 17c10: 80 e0 ldi r24, 0x00 ; 0 17c12: 0f 94 20 9f call 0x33e40 ; 0x33e40 17c16: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 17c1a: 80 e0 ldi r24, 0x00 ; 0 17c1c: 0e 94 45 76 call 0xec8a ; 0xec8a 17c20: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e M500 */ case 500: { Config_StoreSettings(); 17c24: 0e 94 60 84 call 0x108c0 ; 0x108c0 17c28: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e M501 */ case 501: { Config_RetrieveSettings(); 17c2c: 0e 94 e2 95 call 0x12bc4 ; 0x12bc4 17c30: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e M502 */ case 502: { Config_ResetDefault(); 17c34: 0e 94 48 84 call 0x10890 ; 0x10890 17c38: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e #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( 17c3c: 80 91 ce 06 lds r24, 0x06CE ; 0x8006ce 17c40: 8f 93 push r24 17c42: 80 91 cd 06 lds r24, 0x06CD ; 0x8006cd 17c46: 8f 93 push r24 17c48: 80 91 cc 06 lds r24, 0x06CC ; 0x8006cc 17c4c: 8f 93 push r24 17c4e: 80 91 cb 06 lds r24, 0x06CB ; 0x8006cb 17c52: 8f 93 push r24 17c54: 80 91 ca 06 lds r24, 0x06CA ; 0x8006ca 17c58: 8f 93 push r24 17c5a: 80 91 c9 06 lds r24, 0x06C9 ; 0x8006c9 17c5e: 8f 93 push r24 17c60: 80 91 c8 06 lds r24, 0x06C8 ; 0x8006c8 17c64: 8f 93 push r24 17c66: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 17c6a: 8f 93 push r24 17c6c: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 17c70: 8f 93 push r24 17c72: 80 91 c5 06 lds r24, 0x06C5 ; 0x8006c5 17c76: 8f 93 push r24 17c78: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 17c7c: 8f 93 push r24 17c7e: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 17c82: 8f 93 push r24 17c84: 04 e1 ldi r16, 0x14 ; 20 17c86: 1b ea ldi r17, 0xAB ; 171 17c88: 1f 93 push r17 17c8a: 0f 93 push r16 17c8c: 1f 93 push r17 17c8e: 0f 93 push r16 17c90: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 17c94: 8f 93 push r24 17c96: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 17c9a: 8f 93 push r24 17c9c: 80 91 c0 06 lds r24, 0x06C0 ; 0x8006c0 17ca0: 8f 93 push r24 17ca2: 80 91 bf 06 lds r24, 0x06BF ; 0x8006bf 17ca6: 8f 93 push r24 17ca8: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 17cac: 8f 93 push r24 17cae: 80 91 bd 06 lds r24, 0x06BD ; 0x8006bd 17cb2: 8f 93 push r24 17cb4: 80 91 bc 06 lds r24, 0x06BC ; 0x8006bc 17cb8: 8f 93 push r24 17cba: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 17cbe: 8f 93 push r24 17cc0: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 17cc4: 8f 93 push r24 17cc6: 80 91 b9 06 lds r24, 0x06B9 ; 0x8006b9 17cca: 8f 93 push r24 17ccc: 80 91 b8 06 lds r24, 0x06B8 ; 0x8006b8 17cd0: 8f 93 push r24 17cd2: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 17cd6: 8f 93 push r24 17cd8: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 17cdc: 8f 93 push r24 17cde: 80 91 b5 06 lds r24, 0x06B5 ; 0x8006b5 17ce2: 8f 93 push r24 17ce4: 80 91 b4 06 lds r24, 0x06B4 ; 0x8006b4 17ce8: 8f 93 push r24 17cea: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 17cee: 8f 93 push r24 17cf0: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 17cf4: 8f 93 push r24 17cf6: 80 91 b1 06 lds r24, 0x06B1 ; 0x8006b1 17cfa: 8f 93 push r24 17cfc: 80 91 b0 06 lds r24, 0x06B0 ; 0x8006b0 17d00: 8f 93 push r24 17d02: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 17d06: 8f 93 push r24 17d08: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 17d0c: 8f 93 push r24 17d0e: 80 91 ad 06 lds r24, 0x06AD ; 0x8006ad 17d12: 8f 93 push r24 17d14: 80 91 ac 06 lds r24, 0x06AC ; 0x8006ac 17d18: 8f 93 push r24 17d1a: 80 91 ab 06 lds r24, 0x06AB ; 0x8006ab 17d1e: 8f 93 push r24 17d20: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 17d24: 8f 93 push r24 17d26: 80 91 a9 06 lds r24, 0x06A9 ; 0x8006a9 17d2a: 8f 93 push r24 17d2c: 80 91 a8 06 lds r24, 0x06A8 ; 0x8006a8 17d30: 8f 93 push r24 17d32: 80 91 a7 06 lds r24, 0x06A7 ; 0x8006a7 17d36: 8f 93 push r24 17d38: 1f 93 push r17 17d3a: 0f 93 push r16 17d3c: 1f 93 push r17 17d3e: 0f 93 push r16 17d40: 80 91 2e 07 lds r24, 0x072E ; 0x80072e 17d44: 8f 93 push r24 17d46: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 17d4a: 8f 93 push r24 17d4c: 80 91 2c 07 lds r24, 0x072C ; 0x80072c 17d50: 8f 93 push r24 17d52: 80 91 2b 07 lds r24, 0x072B ; 0x80072b 17d56: 8f 93 push r24 17d58: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 17d5c: 8f 93 push r24 17d5e: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 17d62: 8f 93 push r24 17d64: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 17d68: 8f 93 push r24 17d6a: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 17d6e: 8f 93 push r24 17d70: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 17d74: 8f 93 push r24 17d76: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 17d7a: 8f 93 push r24 17d7c: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 17d80: 8f 93 push r24 17d82: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 17d86: 8f 93 push r24 17d88: 1f 93 push r17 17d8a: 0f 93 push r16 17d8c: 1f 93 push r17 17d8e: 0f 93 push r16 17d90: 80 91 26 07 lds r24, 0x0726 ; 0x800726 17d94: 8f 93 push r24 17d96: 80 91 25 07 lds r24, 0x0725 ; 0x800725 17d9a: 8f 93 push r24 17d9c: 80 91 24 07 lds r24, 0x0724 ; 0x800724 17da0: 8f 93 push r24 17da2: 80 91 23 07 lds r24, 0x0723 ; 0x800723 17da6: 8f 93 push r24 17da8: 80 91 22 07 lds r24, 0x0722 ; 0x800722 17dac: 8f 93 push r24 17dae: 80 91 21 07 lds r24, 0x0721 ; 0x800721 17db2: 8f 93 push r24 17db4: 80 91 20 07 lds r24, 0x0720 ; 0x800720 17db8: 8f 93 push r24 17dba: 80 91 1f 07 lds r24, 0x071F ; 0x80071f 17dbe: 8f 93 push r24 17dc0: 80 91 1e 07 lds r24, 0x071E ; 0x80071e 17dc4: 8f 93 push r24 17dc6: 80 91 1d 07 lds r24, 0x071D ; 0x80071d 17dca: 8f 93 push r24 17dcc: 80 91 1c 07 lds r24, 0x071C ; 0x80071c 17dd0: 8f 93 push r24 17dd2: 80 91 1b 07 lds r24, 0x071B ; 0x80071b 17dd6: 8f 93 push r24 17dd8: 80 91 1a 07 lds r24, 0x071A ; 0x80071a 17ddc: 8f 93 push r24 17dde: 80 91 19 07 lds r24, 0x0719 ; 0x800719 17de2: 8f 93 push r24 17de4: 80 91 18 07 lds r24, 0x0718 ; 0x800718 17de8: 8f 93 push r24 17dea: 80 91 17 07 lds r24, 0x0717 ; 0x800717 17dee: 8f 93 push r24 17df0: 1f 93 push r17 17df2: 0f 93 push r16 17df4: 1f 93 push r17 17df6: 0f 93 push r16 17df8: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 17dfc: 8f 93 push r24 17dfe: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 17e02: 8f 93 push r24 17e04: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 17e08: 8f 93 push r24 17e0a: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 17e0e: 8f 93 push r24 17e10: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 17e14: 8f 93 push r24 17e16: 80 91 99 06 lds r24, 0x0699 ; 0x800699 17e1a: 8f 93 push r24 17e1c: 80 91 98 06 lds r24, 0x0698 ; 0x800698 17e20: 8f 93 push r24 17e22: 80 91 97 06 lds r24, 0x0697 ; 0x800697 17e26: 8f 93 push r24 17e28: 80 91 96 06 lds r24, 0x0696 ; 0x800696 17e2c: 8f 93 push r24 17e2e: 80 91 95 06 lds r24, 0x0695 ; 0x800695 17e32: 8f 93 push r24 17e34: 80 91 94 06 lds r24, 0x0694 ; 0x800694 17e38: 8f 93 push r24 17e3a: 80 91 93 06 lds r24, 0x0693 ; 0x800693 17e3e: 8f 93 push r24 17e40: 80 91 92 06 lds r24, 0x0692 ; 0x800692 17e44: 8f 93 push r24 17e46: 80 91 91 06 lds r24, 0x0691 ; 0x800691 17e4a: 8f 93 push r24 17e4c: 80 91 90 06 lds r24, 0x0690 ; 0x800690 17e50: 8f 93 push r24 17e52: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 17e56: 8f 93 push r24 17e58: 1f 93 push r17 17e5a: 0f 93 push r16 17e5c: 1f 93 push r17 17e5e: 0f 93 push r16 17e60: 80 91 16 07 lds r24, 0x0716 ; 0x800716 17e64: 8f 93 push r24 17e66: 80 91 15 07 lds r24, 0x0715 ; 0x800715 17e6a: 8f 93 push r24 17e6c: 80 91 14 07 lds r24, 0x0714 ; 0x800714 17e70: 8f 93 push r24 17e72: 80 91 13 07 lds r24, 0x0713 ; 0x800713 17e76: 8f 93 push r24 17e78: 80 91 12 07 lds r24, 0x0712 ; 0x800712 17e7c: 8f 93 push r24 17e7e: 80 91 11 07 lds r24, 0x0711 ; 0x800711 17e82: 8f 93 push r24 17e84: 80 91 10 07 lds r24, 0x0710 ; 0x800710 17e88: 8f 93 push r24 17e8a: 80 91 0f 07 lds r24, 0x070F ; 0x80070f 17e8e: 8f 93 push r24 17e90: 80 91 0e 07 lds r24, 0x070E ; 0x80070e 17e94: 8f 93 push r24 17e96: 80 91 0d 07 lds r24, 0x070D ; 0x80070d 17e9a: 8f 93 push r24 17e9c: 80 91 0c 07 lds r24, 0x070C ; 0x80070c 17ea0: 8f 93 push r24 17ea2: 80 91 0b 07 lds r24, 0x070B ; 0x80070b 17ea6: 8f 93 push r24 17ea8: 80 91 0a 07 lds r24, 0x070A ; 0x80070a 17eac: 8f 93 push r24 17eae: 80 91 09 07 lds r24, 0x0709 ; 0x800709 17eb2: 8f 93 push r24 17eb4: 80 91 08 07 lds r24, 0x0708 ; 0x800708 17eb8: 8f 93 push r24 17eba: 80 91 07 07 lds r24, 0x0707 ; 0x800707 17ebe: 8f 93 push r24 17ec0: 1f 93 push r17 17ec2: 0f 93 push r16 17ec4: 1f 93 push r17 17ec6: 0f 93 push r16 17ec8: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 17ecc: 8f 93 push r24 17ece: 80 91 8d 06 lds r24, 0x068D ; 0x80068d 17ed2: 8f 93 push r24 17ed4: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 17ed8: 8f 93 push r24 17eda: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 17ede: 8f 93 push r24 17ee0: 80 91 8a 06 lds r24, 0x068A ; 0x80068a 17ee4: 8f 93 push r24 17ee6: 80 91 89 06 lds r24, 0x0689 ; 0x800689 17eea: 8f 93 push r24 17eec: 80 91 88 06 lds r24, 0x0688 ; 0x800688 17ef0: 8f 93 push r24 17ef2: 80 91 87 06 lds r24, 0x0687 ; 0x800687 17ef6: 8f 93 push r24 17ef8: 80 91 86 06 lds r24, 0x0686 ; 0x800686 17efc: 8f 93 push r24 17efe: 80 91 85 06 lds r24, 0x0685 ; 0x800685 17f02: 8f 93 push r24 17f04: 80 91 84 06 lds r24, 0x0684 ; 0x800684 17f08: 8f 93 push r24 17f0a: 80 91 83 06 lds r24, 0x0683 ; 0x800683 17f0e: 8f 93 push r24 17f10: 80 91 82 06 lds r24, 0x0682 ; 0x800682 17f14: 8f 93 push r24 17f16: 80 91 81 06 lds r24, 0x0681 ; 0x800681 17f1a: 8f 93 push r24 17f1c: 80 91 80 06 lds r24, 0x0680 ; 0x800680 17f20: 8f 93 push r24 17f22: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 17f26: 8f 93 push r24 17f28: 1f 93 push r17 17f2a: 0f 93 push r16 17f2c: 1f 93 push r17 17f2e: 0f 93 push r16 17f30: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 17f34: 1f 92 push r1 17f36: 8f 93 push r24 17f38: 80 91 29 07 lds r24, 0x0729 ; 0x800729 17f3c: 1f 92 push r1 17f3e: 8f 93 push r24 17f40: 80 91 28 07 lds r24, 0x0728 ; 0x800728 17f44: 1f 92 push r1 17f46: 8f 93 push r24 17f48: 80 91 27 07 lds r24, 0x0727 ; 0x800727 17f4c: 1f 92 push r1 17f4e: 8f 93 push r24 17f50: 1f 93 push r17 17f52: 0f 93 push r16 17f54: 1f 93 push r17 17f56: 0f 93 push r16 17f58: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 17f5c: 8f 93 push r24 17f5e: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 17f62: 8f 93 push r24 17f64: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 17f68: 8f 93 push r24 17f6a: 80 91 7b 06 lds r24, 0x067B ; 0x80067b 17f6e: 8f 93 push r24 17f70: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 17f74: 8f 93 push r24 17f76: 80 91 79 06 lds r24, 0x0679 ; 0x800679 17f7a: 8f 93 push r24 17f7c: 80 91 78 06 lds r24, 0x0678 ; 0x800678 17f80: 8f 93 push r24 17f82: 80 91 77 06 lds r24, 0x0677 ; 0x800677 17f86: 8f 93 push r24 17f88: 80 91 76 06 lds r24, 0x0676 ; 0x800676 17f8c: 8f 93 push r24 17f8e: 80 91 75 06 lds r24, 0x0675 ; 0x800675 17f92: 8f 93 push r24 17f94: 80 91 74 06 lds r24, 0x0674 ; 0x800674 17f98: 8f 93 push r24 17f9a: 80 91 73 06 lds r24, 0x0673 ; 0x800673 17f9e: 8f 93 push r24 17fa0: 80 91 72 06 lds r24, 0x0672 ; 0x800672 17fa4: 8f 93 push r24 17fa6: 80 91 71 06 lds r24, 0x0671 ; 0x800671 17faa: 8f 93 push r24 17fac: 80 91 70 06 lds r24, 0x0670 ; 0x800670 17fb0: 8f 93 push r24 17fb2: 80 91 6f 06 lds r24, 0x066F ; 0x80066f 17fb6: 8f 93 push r24 17fb8: 1f 93 push r17 17fba: 0f 93 push r16 17fbc: 1f 93 push r17 17fbe: 0f 93 push r16 17fc0: 88 ec ldi r24, 0xC8 ; 200 17fc2: 92 e8 ldi r25, 0x82 ; 130 17fc4: 9f 93 push r25 17fc6: 8f 93 push r24 17fc8: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 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"), 17fcc: 0f b6 in r0, 0x3f ; 63 17fce: f8 94 cli 17fd0: de bf out 0x3e, r29 ; 62 17fd2: 0f be out 0x3f, r0 ; 63 17fd4: 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; 17fd6: 2c ea ldi r18, 0xAC ; 172 17fd8: 35 ec ldi r19, 0xC5 ; 197 17fda: 47 e2 ldi r20, 0x27 ; 39 17fdc: 5e e3 ldi r21, 0x3E ; 62 17fde: 60 91 db 06 lds r22, 0x06DB ; 0x8006db 17fe2: 70 91 dc 06 lds r23, 0x06DC ; 0x8006dc 17fe6: 80 91 dd 06 lds r24, 0x06DD ; 0x8006dd 17fea: 90 91 de 06 lds r25, 0x06DE ; 0x8006de 17fee: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 17ff2: 9f 93 push r25 17ff4: 8f 93 push r24 17ff6: 7f 93 push r23 17ff8: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 17ffa: 2c ea ldi r18, 0xAC ; 172 17ffc: 35 ec ldi r19, 0xC5 ; 197 17ffe: 47 e2 ldi r20, 0x27 ; 39 18000: 5e e3 ldi r21, 0x3E ; 62 18002: 60 91 d7 06 lds r22, 0x06D7 ; 0x8006d7 18006: 70 91 d8 06 lds r23, 0x06D8 ; 0x8006d8 1800a: 80 91 d9 06 lds r24, 0x06D9 ; 0x8006d9 1800e: 90 91 da 06 lds r25, 0x06DA ; 0x8006da 18012: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 18016: 9f 93 push r25 18018: 8f 93 push r24 1801a: 7f 93 push r23 1801c: 6f 93 push r22 1801e: 80 91 d6 06 lds r24, 0x06D6 ; 0x8006d6 18022: 8f 93 push r24 18024: 80 91 d5 06 lds r24, 0x06D5 ; 0x8006d5 18028: 8f 93 push r24 1802a: 80 91 d4 06 lds r24, 0x06D4 ; 0x8006d4 1802e: 8f 93 push r24 18030: 80 91 d3 06 lds r24, 0x06D3 ; 0x8006d3 18034: 8f 93 push r24 18036: 1f 93 push r17 18038: 0f 93 push r16 1803a: 1f 93 push r17 1803c: 0f 93 push r16 1803e: 8b e9 ldi r24, 0x9B ; 155 18040: 92 e8 ldi r25, 0x82 ; 130 18042: 9f 93 push r25 18044: 8f 93 push r24 18046: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 1804a: 2c ea ldi r18, 0xAC ; 172 1804c: 35 ec ldi r19, 0xC5 ; 197 1804e: 47 e2 ldi r20, 0x27 ; 39 18050: 5e e3 ldi r21, 0x3E ; 62 18052: 60 91 e7 06 lds r22, 0x06E7 ; 0x8006e7 18056: 70 91 e8 06 lds r23, 0x06E8 ; 0x8006e8 1805a: 80 91 e9 06 lds r24, 0x06E9 ; 0x8006e9 1805e: 90 91 ea 06 lds r25, 0x06EA ; 0x8006ea 18062: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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"), 18066: 9f 93 push r25 18068: 8f 93 push r24 1806a: 7f 93 push r23 1806c: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 1806e: 2c ea ldi r18, 0xAC ; 172 18070: 35 ec ldi r19, 0xC5 ; 197 18072: 47 e2 ldi r20, 0x27 ; 39 18074: 5e e3 ldi r21, 0x3E ; 62 18076: 60 91 e3 06 lds r22, 0x06E3 ; 0x8006e3 1807a: 70 91 e4 06 lds r23, 0x06E4 ; 0x8006e4 1807e: 80 91 e5 06 lds r24, 0x06E5 ; 0x8006e5 18082: 90 91 e6 06 lds r25, 0x06E6 ; 0x8006e6 18086: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1808a: 9f 93 push r25 1808c: 8f 93 push r24 1808e: 7f 93 push r23 18090: 6f 93 push r22 18092: 80 91 e2 06 lds r24, 0x06E2 ; 0x8006e2 18096: 8f 93 push r24 18098: 80 91 e1 06 lds r24, 0x06E1 ; 0x8006e1 1809c: 8f 93 push r24 1809e: 80 91 e0 06 lds r24, 0x06E0 ; 0x8006e0 180a2: 8f 93 push r24 180a4: 80 91 df 06 lds r24, 0x06DF ; 0x8006df 180a8: 8f 93 push r24 180aa: 1f 93 push r17 180ac: 0f 93 push r16 180ae: 1f 93 push r17 180b0: 0f 93 push r16 180b2: 86 e6 ldi r24, 0x66 ; 102 180b4: 92 e8 ldi r25, 0x82 ; 130 180b6: 9f 93 push r25 180b8: 8f 93 push r24 180ba: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 180be: 0f b6 in r0, 0x3f ; 63 180c0: f8 94 cli 180c2: de bf out 0x3e, r29 ; 62 180c4: 0f be out 0x3f, r0 ; 63 180c6: cd bf out 0x3d, r28 ; 61 180c8: 80 91 ed 06 lds r24, 0x06ED ; 0x8006ed 180cc: 1f 92 push r1 180ce: 8f 93 push r24 180d0: 1f 93 push r17 180d2: 0f 93 push r16 180d4: 1f 93 push r17 180d6: 0f 93 push r16 180d8: 20 e0 ldi r18, 0x00 ; 0 180da: 30 e0 ldi r19, 0x00 ; 0 180dc: 40 e7 ldi r20, 0x70 ; 112 180de: 52 e4 ldi r21, 0x42 ; 66 180e0: 60 91 fe 06 lds r22, 0x06FE ; 0x8006fe 180e4: 70 91 ff 06 lds r23, 0x06FF ; 0x8006ff 180e8: 80 91 00 07 lds r24, 0x0700 ; 0x800700 180ec: 90 91 01 07 lds r25, 0x0701 ; 0x800701 180f0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 180f4: 9f 93 push r25 180f6: 8f 93 push r24 180f8: 7f 93 push r23 180fa: 6f 93 push r22 180fc: 80 91 fd 06 lds r24, 0x06FD ; 0x8006fd 18100: 8f 93 push r24 18102: 80 91 fc 06 lds r24, 0x06FC ; 0x8006fc 18106: 8f 93 push r24 18108: 80 91 fb 06 lds r24, 0x06FB ; 0x8006fb 1810c: 8f 93 push r24 1810e: 80 91 fa 06 lds r24, 0x06FA ; 0x8006fa 18112: 8f 93 push r24 18114: 1f 93 push r17 18116: 0f 93 push r16 18118: 1f 93 push r17 1811a: 0f 93 push r16 1811c: 80 91 f9 06 lds r24, 0x06F9 ; 0x8006f9 18120: 8f 93 push r24 18122: 80 91 f8 06 lds r24, 0x06F8 ; 0x8006f8 18126: 8f 93 push r24 18128: 80 91 f7 06 lds r24, 0x06F7 ; 0x8006f7 1812c: 8f 93 push r24 1812e: 80 91 f6 06 lds r24, 0x06F6 ; 0x8006f6 18132: 8f 93 push r24 18134: 20 e0 ldi r18, 0x00 ; 0 18136: 30 e0 ldi r19, 0x00 ; 0 18138: 40 e7 ldi r20, 0x70 ; 112 1813a: 52 e4 ldi r21, 0x42 ; 66 1813c: 60 91 f2 06 lds r22, 0x06F2 ; 0x8006f2 18140: 70 91 f3 06 lds r23, 0x06F3 ; 0x8006f3 18144: 80 91 f4 06 lds r24, 0x06F4 ; 0x8006f4 18148: 90 91 f5 06 lds r25, 0x06F5 ; 0x8006f5 1814c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 18150: 9f 93 push r25 18152: 8f 93 push r24 18154: 7f 93 push r23 18156: 6f 93 push r22 18158: 80 91 f1 06 lds r24, 0x06F1 ; 0x8006f1 1815c: 8f 93 push r24 1815e: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 18162: 8f 93 push r24 18164: 80 91 ef 06 lds r24, 0x06EF ; 0x8006ef 18168: 8f 93 push r24 1816a: 80 91 ee 06 lds r24, 0x06EE ; 0x8006ee 1816e: 8f 93 push r24 18170: 1f 93 push r17 18172: 0f 93 push r16 18174: 1f 93 push r17 18176: 0f 93 push r16 18178: 85 e6 ldi r24, 0x65 ; 101 1817a: 91 e8 ldi r25, 0x81 ; 129 1817c: 9f 93 push r25 1817e: 8f 93 push r24 18180: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 ); #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) { 18184: 0f b6 in r0, 0x3f ; 63 18186: f8 94 cli 18188: de bf out 0x3e, r29 ; 62 1818a: 0f be out 0x3f, r0 ; 63 1818c: cd bf out 0x3d, r28 ; 61 1818e: 80 91 02 07 lds r24, 0x0702 ; 0x800702 18192: 88 23 and r24, r24 18194: 09 f4 brne .+2 ; 0x18198 18196: 58 c0 rjmp .+176 ; 0x18248 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 18198: 80 91 06 07 lds r24, 0x0706 ; 0x800706 1819c: 8f 93 push r24 1819e: 80 91 05 07 lds r24, 0x0705 ; 0x800705 181a2: 8f 93 push r24 181a4: 80 91 04 07 lds r24, 0x0704 ; 0x800704 181a8: 8f 93 push r24 181aa: 80 91 03 07 lds r24, 0x0703 ; 0x800703 181ae: 8f 93 push r24 181b0: 1f 93 push r17 181b2: 0f 93 push r16 181b4: 1f 93 push r17 181b6: 0f 93 push r16 181b8: 8f e3 ldi r24, 0x3F ; 63 181ba: 91 e8 ldi r25, 0x81 ; 129 181bc: 9f 93 push r25 181be: 8f 93 push r24 181c0: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 181c4: 0f b6 in r0, 0x3f ; 63 181c6: f8 94 cli 181c8: de bf out 0x3e, r29 ; 62 181ca: 0f be out 0x3f, r0 ; 63 181cc: 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( 181ce: 80 91 3b 07 lds r24, 0x073B ; 0x80073b 181d2: 8f 93 push r24 181d4: 80 91 3a 07 lds r24, 0x073A ; 0x80073a 181d8: 8f 93 push r24 181da: 80 91 39 07 lds r24, 0x0739 ; 0x800739 181de: 8f 93 push r24 181e0: 80 91 38 07 lds r24, 0x0738 ; 0x800738 181e4: 8f 93 push r24 181e6: 80 91 37 07 lds r24, 0x0737 ; 0x800737 181ea: 1f 92 push r1 181ec: 8f 93 push r24 181ee: 80 91 36 07 lds r24, 0x0736 ; 0x800736 181f2: 8f 93 push r24 181f4: 80 91 35 07 lds r24, 0x0735 ; 0x800735 181f8: 8f 93 push r24 181fa: 80 91 34 07 lds r24, 0x0734 ; 0x800734 181fe: 8f 93 push r24 18200: 80 91 33 07 lds r24, 0x0733 ; 0x800733 18204: 8f 93 push r24 18206: 80 91 32 07 lds r24, 0x0732 ; 0x800732 1820a: 8f 93 push r24 1820c: 80 91 31 07 lds r24, 0x0731 ; 0x800731 18210: 8f 93 push r24 18212: 80 91 30 07 lds r24, 0x0730 ; 0x800730 18216: 8f 93 push r24 18218: 80 91 2f 07 lds r24, 0x072F ; 0x80072f 1821c: 8f 93 push r24 1821e: 84 e1 ldi r24, 0x14 ; 20 18220: 9b ea ldi r25, 0xAB ; 171 18222: 9f 93 push r25 18224: 8f 93 push r24 18226: 9f 93 push r25 18228: 8f 93 push r24 1822a: 8e e9 ldi r24, 0x9E ; 158 1822c: 90 e8 ldi r25, 0x80 ; 128 1822e: 9f 93 push r25 18230: 8f 93 push r24 18232: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 "%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(); 18236: 0f 94 ca 42 call 0x28594 ; 0x28594 1823a: 0f b6 in r0, 0x3f ; 63 1823c: f8 94 cli 1823e: de bf out 0x3e, r29 ; 62 18240: 0f be out 0x3f, r0 ; 63 18242: cd bf out 0x3d, r28 ; 61 18244: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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); 18248: 1f 93 push r17 1824a: 0f 93 push r16 1824c: 80 e2 ldi r24, 0x20 ; 32 1824e: 91 e8 ldi r25, 0x81 ; 129 18250: 9f 93 push r25 18252: 8f 93 push r24 18254: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 18258: 0f 90 pop r0 1825a: 0f 90 pop r0 1825c: 0f 90 pop r0 1825e: 0f 90 pop r0 18260: b6 cf rjmp .-148 ; 0x181ce #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 18262: 80 e5 ldi r24, 0x50 ; 80 18264: 0e 94 0d 5d call 0xba1a ; 0xba1a 18268: 88 23 and r24, r24 1826a: 11 f4 brne .+4 ; 0x18270 1826c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { uint8_t valCnt = 0; IP_address = 0; 18270: 10 92 58 06 sts 0x0658, r1 ; 0x800658 18274: 10 92 59 06 sts 0x0659, r1 ; 0x800659 18278: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 1827c: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 18280: 08 e5 ldi r16, 0x58 ; 88 18282: 16 e0 ldi r17, 0x06 ; 6 18284: 3c e5 ldi r19, 0x5C ; 92 18286: e3 2e mov r14, r19 18288: 36 e0 ldi r19, 0x06 ; 6 1828a: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 1828c: 4a e2 ldi r20, 0x2A ; 42 1828e: d4 2e mov r13, r20 18290: e0 91 93 03 lds r30, 0x0393 ; 0x800393 18294: f0 91 94 03 lds r31, 0x0394 ; 0x800394 18298: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 1829a: 0e 94 ac 5c call 0xb958 ; 0xb958 1829e: d8 01 movw r26, r16 182a0: 8d 93 st X+, r24 182a2: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 182a4: ea 16 cp r14, r26 182a6: fb 06 cpc r15, r27 182a8: 11 f4 brne .+4 ; 0x182ae 182aa: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 182ae: 8e e2 ldi r24, 0x2E ; 46 182b0: 0e 94 0d 5d call 0xba1a ; 0xba1a 182b4: 81 11 cpse r24, r1 182b6: ec cf rjmp .-40 ; 0x18290 if (valCnt != 4) IP_address = 0; 182b8: 10 92 58 06 sts 0x0658, r1 ; 0x800658 182bc: 10 92 59 06 sts 0x0659, r1 ; 0x800659 182c0: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 182c4: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 182c8: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e - `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(); 182cc: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 /// 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; 182d0: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 182d4: 81 11 cpse r24, r1 182d6: 02 c0 rjmp .+4 ; 0x182dc 182d8: 0e 94 8f 65 call 0xcb1e ; 0xcb1e 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(); 182dc: 85 e4 ldi r24, 0x45 ; 69 182de: 0e 94 0d 5d call 0xba1a ; 0xba1a 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; 182e2: 81 2c mov r8, r1 182e4: 91 2c mov r9, r1 182e6: a1 2c mov r10, r1 182e8: 20 ec ldi r18, 0xC0 ; 192 182ea: 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(); 182ec: 88 23 and r24, r24 182ee: 21 f0 breq .+8 ; 0x182f8 182f0: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 182f4: 4b 01 movw r8, r22 182f6: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 182f8: 8c e4 ldi r24, 0x4C ; 76 182fa: 0e 94 0d 5d call 0xba1a ; 0xba1a 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; 182fe: c1 2c mov r12, r1 18300: d1 2c mov r13, r1 18302: 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(); 18304: 88 23 and r24, r24 18306: 21 f0 breq .+8 ; 0x18310 18308: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1830c: 6b 01 movw r12, r22 1830e: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 18310: 8a e5 ldi r24, 0x5A ; 90 18312: 0e 94 0d 5d call 0xba1a ; 0xba1a // 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; 18316: 41 2c mov r4, r1 18318: 51 2c mov r5, r1 1831a: 98 ed ldi r25, 0xD8 ; 216 1831c: 69 2e mov r6, r25 1831e: 91 e4 ldi r25, 0x41 ; 65 18320: 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()); 18322: 88 23 and r24, r24 18324: 31 f0 breq .+12 ; 0x18332 18326: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1832a: 2b 01 movw r4, r22 1832c: 3c 01 movw r6, r24 1832e: e8 94 clt 18330: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 18332: 88 e5 ldi r24, 0x58 ; 88 18334: 0e 94 0d 5d call 0xba1a ; 0xba1a 18338: 88 23 and r24, r24 1833a: 09 f4 brne .+2 ; 0x1833e 1833c: ba c1 rjmp .+884 ; 0x186b2 1833e: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 18342: 6a 96 adiw r28, 0x1a ; 26 18344: 6c af std Y+60, r22 ; 0x3c 18346: 7d af std Y+61, r23 ; 0x3d 18348: 8e af std Y+62, r24 ; 0x3e 1834a: 9f af std Y+63, r25 ; 0x3f 1834c: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 1834e: 89 e5 ldi r24, 0x59 ; 89 18350: 0e 94 0d 5d call 0xba1a ; 0xba1a 18354: 88 23 and r24, r24 18356: 09 f4 brne .+2 ; 0x1835a 18358: b7 c1 rjmp .+878 ; 0x186c8 1835a: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1835e: 6e 96 adiw r28, 0x1e ; 30 18360: 6c af std Y+60, r22 ; 0x3c 18362: 7d af std Y+61, r23 ; 0x3d 18364: 8e af std Y+62, r24 ; 0x3e 18366: 9f af std Y+63, r25 ; 0x3f 18368: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 1836a: 1a 82 std Y+2, r1 ; 0x02 1836c: 19 82 std Y+1, r1 ; 0x01 1836e: fe 01 movw r30, r28 18370: 33 96 adiw r30, 0x03 ; 3 18372: 83 e1 ldi r24, 0x13 ; 19 18374: df 01 movw r26, r30 18376: 1d 92 st X+, r1 18378: 8a 95 dec r24 1837a: e9 f7 brne .-6 ; 0x18376 if (code_seen('C')) { 1837c: 83 e4 ldi r24, 0x43 ; 67 1837e: 0e 94 0d 5d call 0xba1a ; 0xba1a 18382: 88 23 and r24, r24 18384: f9 f0 breq .+62 ; 0x183c4 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18386: 62 e2 ldi r22, 0x22 ; 34 18388: 70 e0 ldi r23, 0x00 ; 0 1838a: 80 91 93 03 lds r24, 0x0393 ; 0x800393 1838e: 90 91 94 03 lds r25, 0x0394 ; 0x800394 18392: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc 18396: 8c 01 movw r16, r24 if (!this->ptr) { 18398: 89 2b or r24, r25 1839a: a1 f0 breq .+40 ; 0x183c4 // First quote not found return; } // Skip the leading quote this->ptr++; 1839c: 0f 5f subi r16, 0xFF ; 255 1839e: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 183a0: 62 e2 ldi r22, 0x22 ; 34 183a2: 70 e0 ldi r23, 0x00 ; 0 183a4: c8 01 movw r24, r16 183a6: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc if(!pStrEnd) { 183aa: 00 97 sbiw r24, 0x00 ; 0 183ac: 59 f0 breq .+22 ; 0x183c4 // Second quote not found return; } this->len = pStrEnd - this->ptr; 183ae: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 183b0: 84 31 cpi r24, 0x14 ; 20 183b2: 08 f0 brcs .+2 ; 0x183b6 183b4: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 183b6: 48 2f mov r20, r24 183b8: 50 e0 ldi r21, 0x00 ; 0 183ba: b8 01 movw r22, r16 183bc: ce 01 movw r24, r28 183be: 01 96 adiw r24, 0x01 ; 1 183c0: 0f 94 38 e3 call 0x3c670 ; 0x3c670 } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 183c4: 80 91 95 13 lds r24, 0x1395 ; 0x801395 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; 183c8: 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"))) 183ca: 81 30 cpi r24, 0x01 ; 1 183cc: 29 f4 brne .+10 ; 0x183d8 183ce: 8a e1 ldi r24, 0x1A ; 26 183d0: 98 e8 ldi r25, 0x88 ; 136 183d2: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 183d6: 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(); 183d8: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 183dc: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // Retract E if (!printingIsPaused()) 183e0: 0e 94 cb 68 call 0xd196 ; 0xd196 183e4: 81 11 cpse r24, r1 183e6: 77 c1 rjmp .+750 ; 0x186d6 { current_position[E_AXIS] += e_shift; 183e8: a5 01 movw r20, r10 183ea: 94 01 movw r18, r8 183ec: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 183f0: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 183f4: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 183f8: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 183fc: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 18400: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 18404: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 18408: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 1840c: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 18410: 60 e0 ldi r22, 0x00 ; 0 18412: 70 e0 ldi r23, 0x00 ; 0 18414: 88 ee ldi r24, 0xE8 ; 232 18416: 92 e4 ldi r25, 0x42 ; 66 18418: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1841c: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 18420: 8d e0 ldi r24, 0x0D ; 13 18422: 90 e7 ldi r25, 0x70 ; 112 18424: 0e 94 97 7b call 0xf72e ; 0xf72e // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 18428: c3 01 movw r24, r6 1842a: b2 01 movw r22, r4 1842c: 0e 94 27 6f call 0xde4e ; 0xde4e // Move XY to side current_position[X_AXIS] = x_position; 18430: 6a 96 adiw r28, 0x1a ; 26 18432: 2c ad ldd r18, Y+60 ; 0x3c 18434: 3d ad ldd r19, Y+61 ; 0x3d 18436: 4e ad ldd r20, Y+62 ; 0x3e 18438: 5f ad ldd r21, Y+63 ; 0x3f 1843a: 6a 97 sbiw r28, 0x1a ; 26 1843c: 20 93 40 07 sts 0x0740, r18 ; 0x800740 18440: 30 93 41 07 sts 0x0741, r19 ; 0x800741 18444: 40 93 42 07 sts 0x0742, r20 ; 0x800742 18448: 50 93 43 07 sts 0x0743, r21 ; 0x800743 current_position[Y_AXIS] = y_position; 1844c: 6e 96 adiw r28, 0x1e ; 30 1844e: 8c ad ldd r24, Y+60 ; 0x3c 18450: 9d ad ldd r25, Y+61 ; 0x3d 18452: ae ad ldd r26, Y+62 ; 0x3e 18454: bf ad ldd r27, Y+63 ; 0x3f 18456: 6e 97 sbiw r28, 0x1e ; 30 18458: 80 93 44 07 sts 0x0744, r24 ; 0x800744 1845c: 90 93 45 07 sts 0x0745, r25 ; 0x800745 18460: a0 93 46 07 sts 0x0746, r26 ; 0x800746 18464: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 18468: 60 e0 ldi r22, 0x00 ; 0 1846a: 70 e0 ldi r23, 0x00 ; 0 1846c: 88 e4 ldi r24, 0x48 ; 72 1846e: 92 e4 ldi r25, 0x42 ; 66 18470: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 18474: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 bool repeat = false; 18478: 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; 1847a: 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)); 1847c: 0a e8 ldi r16, 0x8A ; 138 1847e: 20 2e mov r2, r16 18480: 00 e8 ldi r16, 0x80 ; 128 18482: 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)); 18484: 82 e9 ldi r24, 0x92 ; 146 18486: 88 2e mov r8, r24 18488: 80 e8 ldi r24, 0x80 ; 128 1848a: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 1848c: 80 91 95 13 lds r24, 0x1395 ; 0x801395 18490: 81 30 cpi r24, 0x01 ; 1 18492: 09 f0 breq .+2 ; 0x18496 18494: 23 c1 rjmp .+582 ; 0x186dc eject_slot = MMU2::mmu2.get_current_tool(); 18496: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 1849a: a8 2e mov r10, r24 mmu_M600_unload_filament(); 1849c: 0e 94 5d 74 call 0xe8ba ; 0xe8ba } 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 184a0: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 184a4: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 184a8: 10 92 86 17 sts 0x1786, r1 ; 0x801786 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 184ac: 80 91 95 13 lds r24, 0x1395 ; 0x801395 184b0: 81 30 cpi r24, 0x01 ; 1 184b2: 09 f4 brne .+2 ; 0x184b6 184b4: e1 c1 rjmp .+962 ; 0x18878 { KEEPALIVE_STATE(PAUSED_FOR_USER); 184b6: 84 e0 ldi r24, 0x04 ; 4 184b8: 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); 184bc: 82 e7 ldi r24, 0x72 ; 114 184be: 99 e3 ldi r25, 0x39 ; 57 184c0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 184c4: 40 e0 ldi r20, 0x00 ; 0 184c6: 60 e0 ldi r22, 0x00 ; 0 184c8: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce 184cc: 08 2f mov r16, r24 lcd_update_enable(false); 184ce: 80 e0 ldi r24, 0x00 ; 0 184d0: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 184d4: 01 30 cpi r16, 0x01 ; 1 184d6: 29 f5 brne .+74 ; 0x18522 lcd_clear(); 184d8: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 184dc: 8a ee ldi r24, 0xEA ; 234 184de: 99 e3 ldi r25, 0x39 ; 57 184e0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 184e4: ac 01 movw r20, r24 184e6: 62 e0 ldi r22, 0x02 ; 2 184e8: 80 e0 ldi r24, 0x00 ; 0 184ea: 0e 94 3a 70 call 0xe074 ; 0xe074 current_position[X_AXIS] = 100; 184ee: 80 e0 ldi r24, 0x00 ; 0 184f0: 90 e0 ldi r25, 0x00 ; 0 184f2: a8 ec ldi r26, 0xC8 ; 200 184f4: b2 e4 ldi r27, 0x42 ; 66 184f6: 80 93 40 07 sts 0x0740, r24 ; 0x800740 184fa: 90 93 41 07 sts 0x0741, r25 ; 0x800741 184fe: a0 93 42 07 sts 0x0742, r26 ; 0x800742 18502: b0 93 43 07 sts 0x0743, r27 ; 0x800743 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 18506: 60 e0 ldi r22, 0x00 ; 0 18508: 70 e0 ldi r23, 0x00 ; 0 1850a: 88 e4 ldi r24, 0x48 ; 72 1850c: 92 e4 ldi r25, 0x42 ; 66 1850e: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 18512: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 18516: 80 e4 ldi r24, 0x40 ; 64 18518: 99 e3 ldi r25, 0x39 ; 57 1851a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1851e: 0f 94 d6 34 call 0x269ac ; 0x269ac preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 18522: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 18526: 8e ec ldi r24, 0xCE ; 206 18528: 98 e3 ldi r25, 0x38 ; 56 1852a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1852e: ac 01 movw r20, r24 18530: 60 e0 ldi r22, 0x00 ; 0 18532: 80 e0 ldi r24, 0x00 ; 0 18534: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(0, 1); 18538: 61 e0 ldi r22, 0x01 ; 1 1853a: 80 e0 ldi r24, 0x00 ; 0 1853c: 0e 94 26 70 call 0xe04c ; 0xe04c if (filament_name[0]) { 18540: 89 81 ldd r24, Y+1 ; 0x01 18542: 88 23 and r24, r24 18544: 41 f0 breq .+16 ; 0x18556 lcd_print(filament_name); 18546: ce 01 movw r24, r28 18548: 01 96 adiw r24, 0x01 ; 1 1854a: 0e 94 2d 72 call 0xe45a ; 0xe45a lcd_set_cursor(0, 2); 1854e: 62 e0 ldi r22, 0x02 ; 2 18550: 80 e0 ldi r24, 0x00 ; 0 18552: 0e 94 26 70 call 0xe04c ; 0xe04c } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 18556: 80 91 86 17 lds r24, 0x1786 ; 0x801786 1855a: 81 11 cpse r24, r1 1855c: 06 c0 rjmp .+12 ; 0x1856a #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 1855e: 89 eb ldi r24, 0xB9 ; 185 18560: 98 e3 ldi r25, 0x38 ; 56 18562: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 18566: 0e 94 11 70 call 0xe022 ; 0xe022 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); 1856a: 84 e0 ldi r24, 0x04 ; 4 1856c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(!lcd_clicked()) 18570: 0e 94 43 72 call 0xe486 ; 0xe486 18574: 81 11 cpse r24, r1 18576: 10 c0 rjmp .+32 ; 0x18598 { manage_heater(); 18578: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 1857c: 81 e0 ldi r24, 0x01 ; 1 1857e: 0e 94 6b 8c call 0x118d6 ; 0x118d6 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 18582: 80 91 89 17 lds r24, 0x1789 ; 0x801789 18586: 88 23 and r24, r24 18588: 99 f3 breq .-26 ; 0x18570 Sound_MakeCustom(50,1000,false); 1858a: 40 e0 ldi r20, 0x00 ; 0 1858c: 68 ee ldi r22, 0xE8 ; 232 1858e: 73 e0 ldi r23, 0x03 ; 3 18590: 82 e3 ldi r24, 0x32 ; 50 18592: 90 e0 ldi r25, 0x00 ; 0 18594: 0f 94 1a 69 call 0x2d234 ; 0x2d234 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 18598: 32 e0 ldi r19, 0x02 ; 2 1859a: 30 93 96 02 sts 0x0296, r19 ; 0x800296 M600_load_filament_movements(filament_name); 1859e: ce 01 movw r24, r28 185a0: 01 96 adiw r24, 0x01 ; 1 185a2: 0e 94 16 74 call 0xe82c ; 0xe82c Sound_MakeCustom(50,1000,false); 185a6: 40 e0 ldi r20, 0x00 ; 0 185a8: 68 ee ldi r22, 0xE8 ; 232 185aa: 73 e0 ldi r23, 0x03 ; 3 185ac: 82 e3 ldi r24, 0x32 ; 50 185ae: 90 e0 ldi r25, 0x00 ; 0 185b0: 0f 94 1a 69 call 0x2d234 ; 0x2d234 else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 185b4: 11 11 cpse r17, r1 185b6: a6 c1 rjmp .+844 ; 0x18904 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); 185b8: b4 e0 ldi r27, 0x04 ; 4 185ba: bb 2e mov r11, r27 185bc: b0 92 96 02 sts 0x0296, r11 ; 0x800296 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 185c0: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 185c4: 8a e0 ldi r24, 0x0A ; 10 185c6: 99 e3 ldi r25, 0x39 ; 57 185c8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 185cc: ac 01 movw r20, r24 185ce: 60 e0 ldi r22, 0x00 ; 0 185d0: 81 e0 ldi r24, 0x01 ; 1 185d2: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 185d6: 84 ef ldi r24, 0xF4 ; 244 185d8: 98 e3 ldi r25, 0x38 ; 56 185da: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 185de: ac 01 movw r20, r24 185e0: 61 e0 ldi r22, 0x01 ; 1 185e2: 81 e0 ldi r24, 0x01 ; 1 185e4: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 185e8: 80 ee ldi r24, 0xE0 ; 224 185ea: 98 e3 ldi r25, 0x38 ; 56 185ec: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 185f0: ac 01 movw r20, r24 185f2: 62 e0 ldi r22, 0x02 ; 2 185f4: 81 e0 ldi r24, 0x01 ; 1 185f6: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 185fa: 84 e0 ldi r24, 0x04 ; 4 185fc: 9c e3 ldi r25, 0x3C ; 60 185fe: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 18602: ac 01 movw r20, r24 18604: 63 e0 ldi r22, 0x03 ; 3 18606: 81 e0 ldi r24, 0x01 ; 1 18608: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_putc_at(0, cursor_pos, '>'); 1860c: 4e e3 ldi r20, 0x3E ; 62 1860e: 60 e0 ldi r22, 0x00 ; 0 18610: 80 e0 ldi r24, 0x00 ; 0 18612: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_consume_click(); 18616: 0e 94 3e 72 call 0xe47c ; 0xe47c uint8_t lcd_alright() { uint8_t cursor_pos = 0; 1861a: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 1861c: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 18620: 81 e0 ldi r24, 0x01 ; 1 18622: 0e 94 6b 8c call 0x118d6 ; 0x118d6 if (lcd_encoder) 18626: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1862a: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1862e: 00 97 sbiw r24, 0x00 ; 0 18630: d9 f0 breq .+54 ; 0x18668 { if (lcd_encoder < 0 ) { 18632: 97 ff sbrs r25, 7 18634: 2a c1 rjmp .+596 ; 0x1888a // Rotating knob counter clockwise if (cursor_pos > 0) 18636: 00 23 and r16, r16 18638: 09 f4 brne .+2 ; 0x1863c 1863a: 2b c1 rjmp .+598 ; 0x18892 cursor_pos--; 1863c: 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 ")); 1863e: 46 e9 ldi r20, 0x96 ; 150 18640: 50 e8 ldi r21, 0x80 ; 128 18642: 60 e0 ldi r22, 0x00 ; 0 18644: 80 e0 ldi r24, 0x00 ; 0 18646: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_putc_at(0, cursor_pos, '>'); 1864a: 4e e3 ldi r20, 0x3E ; 62 1864c: 60 2f mov r22, r16 1864e: 80 e0 ldi r24, 0x00 ; 0 18650: 0e 94 46 70 call 0xe08c ; 0xe08c // Consume rotation event and make feedback sound lcd_encoder = 0; 18654: 10 92 35 05 sts 0x0535, r1 ; 0x800535 18658: 10 92 34 05 sts 0x0534, r1 ; 0x800534 _delay(100); 1865c: 64 e6 ldi r22, 0x64 ; 100 1865e: 70 e0 ldi r23, 0x00 ; 0 18660: 80 e0 ldi r24, 0x00 ; 0 18662: 90 e0 ldi r25, 0x00 ; 0 18664: 0f 94 5c 3c call 0x278b8 ; 0x278b8 } if (lcd_clicked()) 18668: 0e 94 43 72 call 0xe486 ; 0xe486 1866c: 88 23 and r24, r24 1866e: b1 f2 breq .-84 ; 0x1861c { lcd_clear(); 18670: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_return_to_status(); 18674: 0f 94 1d 26 call 0x24c3a ; 0x24c3a lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 18678: 42 e0 ldi r20, 0x02 ; 2 1867a: 40 93 96 02 sts 0x0296, r20 ; 0x800296 switch(lcd_change_filament_state) 1867e: 02 30 cpi r16, 0x02 ; 2 18680: 09 f4 brne .+2 ; 0x18684 18682: 10 c1 rjmp .+544 ; 0x188a4 18684: 03 30 cpi r16, 0x03 ; 3 18686: 09 f4 brne .+2 ; 0x1868a 18688: f7 c1 rjmp .+1006 ; 0x18a78 1868a: 01 30 cpi r16, 0x01 ; 1 1868c: 09 f0 breq .+2 ; 0x18690 1868e: 29 c1 rjmp .+594 ; 0x188e2 { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 18690: 80 91 95 13 lds r24, 0x1395 ; 0x801395 18694: 81 30 cpi r24, 0x01 ; 1 18696: 09 f0 breq .+2 ; 0x1869a 18698: 00 c1 rjmp .+512 ; 0x1889a uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 1869a: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 1869e: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 186a0: 0e 94 5d 74 call 0xe8ba ; 0xe8ba // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 186a4: 80 2f mov r24, r16 186a6: 0e 94 33 8f call 0x11e66 ; 0x11e66 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 186aa: 80 e0 ldi r24, 0x00 ; 0 186ac: 0e 94 2a 7a call 0xf454 ; 0xf454 186b0: 85 cf rjmp .-246 ; 0x185bc // 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; 186b2: 20 e0 ldi r18, 0x00 ; 0 186b4: 30 e0 ldi r19, 0x00 ; 0 186b6: 43 e5 ldi r20, 0x53 ; 83 186b8: 53 e4 ldi r21, 0x43 ; 67 186ba: 6a 96 adiw r28, 0x1a ; 26 186bc: 2c af std Y+60, r18 ; 0x3c 186be: 3d af std Y+61, r19 ; 0x3d 186c0: 4e af std Y+62, r20 ; 0x3e 186c2: 5f af std Y+63, r21 ; 0x3f 186c4: 6a 97 sbiw r28, 0x1a ; 26 186c6: 43 ce rjmp .-890 ; 0x1834e float y_position = FILAMENTCHANGE_YPOS; 186c8: 6e 96 adiw r28, 0x1e ; 30 186ca: 1c ae std Y+60, r1 ; 0x3c 186cc: 1d ae std Y+61, r1 ; 0x3d 186ce: 1e ae std Y+62, r1 ; 0x3e 186d0: 1f ae std Y+63, r1 ; 0x3f 186d2: 6e 97 sbiw r28, 0x1e ; 30 186d4: 4a ce rjmp .-876 ; 0x1836a 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(); 186d6: 0e 94 0f 66 call 0xcc1e ; 0xcc1e 186da: a6 ce rjmp .-692 ; 0x18428 //! //! 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); 186dc: 84 e0 ldi r24, 0x04 ; 4 186de: 80 93 96 02 sts 0x0296, r24 ; 0x800296 unsigned long waiting_start_time = _millis(); 186e2: 0f 94 55 3e call 0x27caa ; 0x27caa 186e6: 2b 01 movw r4, r22 186e8: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 186ea: 8e e8 ldi r24, 0x8E ; 142 186ec: 98 e3 ldi r25, 0x38 ; 56 186ee: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 186f2: 0f 94 4f 34 call 0x2689e ; 0x2689e while (!(wait_for_user_state == 0 && lcd_clicked())){ 186f6: 0e 94 43 72 call 0xe486 ; 0xe486 186fa: 08 2f mov r16, r24 186fc: 81 11 cpse r24, r1 186fe: 38 c0 rjmp .+112 ; 0x18770 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) { 18700: a3 01 movw r20, r6 18702: 92 01 movw r18, r4 18704: 20 54 subi r18, 0x40 ; 64 18706: 38 4d sbci r19, 0xD8 ; 216 18708: 46 4f sbci r20, 0xF6 ; 246 1870a: 5f 4f sbci r21, 0xFF ; 255 1870c: 6a 96 adiw r28, 0x1a ; 26 1870e: 2c af std Y+60, r18 ; 0x3c 18710: 3d af std Y+61, r19 ; 0x3d 18712: 4e af std Y+62, r20 ; 0x3e 18714: 5f af std Y+63, r21 ; 0x3f 18716: 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(); 18718: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 1871c: 81 e0 ldi r24, 0x01 ; 1 1871e: 0e 94 6b 8c call 0x118d6 ; 0x118d6 if (wait_for_user_state != 2) sound_wait_for_user(); 18722: 02 30 cpi r16, 0x02 ; 2 18724: 09 f4 brne .+2 ; 0x18728 18726: 67 c0 rjmp .+206 ; 0x187f6 18728: 0f 94 be 69 call 0x2d37c ; 0x2d37c 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); 1872c: 84 e0 ldi r24, 0x04 ; 4 1872e: 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) { 18730: 01 30 cpi r16, 0x01 ; 1 18732: 39 f1 breq .+78 ; 0x18782 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 18734: 0e 94 10 8f call 0x11e20 ; 0x11e20 if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 18738: 0f 94 55 3e call 0x27caa ; 0x27caa 1873c: 6a 96 adiw r28, 0x1a ; 26 1873e: 2c ad ldd r18, Y+60 ; 0x3c 18740: 3d ad ldd r19, Y+61 ; 0x3d 18742: 4e ad ldd r20, Y+62 ; 0x3e 18744: 5f ad ldd r21, Y+63 ; 0x3f 18746: 6a 97 sbiw r28, 0x1a ; 26 18748: 26 17 cp r18, r22 1874a: 37 07 cpc r19, r23 1874c: 48 07 cpc r20, r24 1874e: 59 07 cpc r21, r25 18750: 90 f6 brcc .-92 ; 0x186f6 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 18752: 8d e5 ldi r24, 0x5D ; 93 18754: 98 e3 ldi r25, 0x38 ; 56 18756: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1875a: 0f 94 4f 34 call 0x2689e ; 0x2689e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1875e: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 18762: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 18766: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 disable_e0(); 1876a: 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; 1876c: 01 e0 ldi r16, 0x01 ; 1 1876e: d4 cf rjmp .-88 ; 0x18718 18770: 10 92 69 05 sts 0x0569, r1 ; 0x800569 <_ZL10beep_timer.lto_priv.510> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 18774: 10 92 6c 05 sts 0x056C, r1 ; 0x80056c <_ZL6bFirst.lto_priv.511> 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); 18778: c7 01 movw r24, r14 1877a: b6 01 movw r22, r12 1877c: 0f 94 a1 15 call 0x22b42 ; 0x22b42 18780: 8f ce rjmp .-738 ; 0x184a0 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); 18782: 0e 94 10 8f call 0x11e20 ; 0x11e20 if (lcd_clicked()) { 18786: 0e 94 43 72 call 0xe486 ; 0xe486 1878a: 88 23 and r24, r24 1878c: 29 f2 breq .-118 ; 0x18718 1878e: 80 91 aa 05 lds r24, 0x05AA ; 0x8005aa 18792: 90 91 ab 05 lds r25, 0x05AB ; 0x8005ab 18796: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 1879a: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1879e: 8c e5 ldi r24, 0x5C ; 92 187a0: 90 e5 ldi r25, 0x50 ; 80 187a2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 187a6: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 187aa: 42 e8 ldi r20, 0x82 ; 130 187ac: 64 e0 ldi r22, 0x04 ; 4 187ae: 80 e0 ldi r24, 0x00 ; 0 187b0: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 187b4: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 187b8: 8f 93 push r24 187ba: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 187be: 8f 93 push r24 187c0: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 187c4: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 187c8: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 187cc: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 187d0: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 187d4: 7f 93 push r23 187d6: 6f 93 push r22 187d8: 3f 92 push r3 187da: 2f 92 push r2 187dc: 0e 94 ff 6f call 0xdffe ; 0xdffe lcd_putc(LCD_STR_DEGREE[0]); 187e0: 81 e8 ldi r24, 0x81 ; 129 187e2: 0e 94 15 70 call 0xe02a ; 0xe02a 187e6: 0f 90 pop r0 187e8: 0f 90 pop r0 187ea: 0f 90 pop r0 187ec: 0f 90 pop r0 187ee: 0f 90 pop r0 187f0: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 187f2: 02 e0 ldi r16, 0x02 ; 2 187f4: 91 cf rjmp .-222 ; 0x18718 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 187f6: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 187fa: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 187fe: 07 2e mov r0, r23 18800: 00 0c add r0, r0 18802: 88 0b sbc r24, r24 18804: 99 0b sbc r25, r25 18806: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 1880a: 20 91 5e 0e lds r18, 0x0E5E ; 0x800e5e 1880e: 30 91 5f 0e lds r19, 0x0E5F ; 0x800e5f 18812: 40 91 60 0e lds r20, 0x0E60 ; 0x800e60 18816: 50 91 61 0e lds r21, 0x0E61 ; 0x800e61 1881a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1881e: 9f 77 andi r25, 0x7F ; 127 18820: 20 e0 ldi r18, 0x00 ; 0 18822: 30 e0 ldi r19, 0x00 ; 0 18824: 40 ea ldi r20, 0xA0 ; 160 18826: 50 e4 ldi r21, 0x40 ; 64 18828: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1882c: 87 ff sbrs r24, 7 1882e: 0b c0 rjmp .+22 ; 0x18846 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 18830: 8e e8 ldi r24, 0x8E ; 142 18832: 98 e3 ldi r25, 0x38 ; 56 18834: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 18838: 0f 94 4f 34 call 0x2689e ; 0x2689e waiting_start_time = _millis(); 1883c: 0f 94 55 3e call 0x27caa ; 0x27caa 18840: 2b 01 movw r4, r22 18842: 3c 01 movw r6, r24 18844: 58 cf rjmp .-336 ; 0x186f6 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 18846: 64 e0 ldi r22, 0x04 ; 4 18848: 81 e0 ldi r24, 0x01 ; 1 1884a: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 1884e: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 18852: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 18856: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 1885a: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 1885e: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 18862: 7f 93 push r23 18864: 6f 93 push r22 18866: 9f 92 push r9 18868: 8f 92 push r8 1886a: 0e 94 ff 6f call 0xdffe ; 0xdffe 1886e: 0f 90 pop r0 18870: 0f 90 pop r0 18872: 0f 90 pop r0 18874: 0f 90 pop r0 18876: 50 cf rjmp .-352 ; 0x18718 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 18878: 11 11 cpse r17, r1 1887a: 03 c0 rjmp .+6 ; 0x18882 1887c: 8a 2d mov r24, r10 1887e: 0e 94 33 8f call 0x11e66 ; 0x11e66 mmu_M600_load_filament(automatic); 18882: 81 2f mov r24, r17 18884: 0e 94 2a 7a call 0xf454 ; 0xf454 18888: 95 ce rjmp .-726 ; 0x185b4 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 1888a: 03 30 cpi r16, 0x03 ; 3 1888c: 10 f4 brcc .+4 ; 0x18892 cursor_pos++; 1888e: 0f 5f subi r16, 0xFF ; 255 18890: d6 ce rjmp .-596 ; 0x1863e else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18892: 87 e0 ldi r24, 0x07 ; 7 18894: 0f 94 2e 63 call 0x2c65c ; 0x2c65c 18898: d2 ce rjmp .-604 ; 0x1863e 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); 1889a: ce 01 movw r24, r28 1889c: 01 96 adiw r24, 0x01 ; 1 1889e: 0e 94 16 74 call 0xe82c ; 0xe82c 188a2: 8c ce rjmp .-744 ; 0x185bc } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 188a4: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 load_filament_final_feed(); 188a8: 0e 94 d9 65 call 0xcbb2 ; 0xcbb2 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(); 188ac: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 188b0: 8e e1 ldi r24, 0x1E ; 30 188b2: 99 e3 ldi r25, 0x39 ; 57 188b4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 188b8: ac 01 movw r20, r24 188ba: 60 e0 ldi r22, 0x00 ; 0 188bc: 80 e0 ldi r24, 0x00 ; 0 188be: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 188c2: 8a ee ldi r24, 0xEA ; 234 188c4: 99 e3 ldi r25, 0x39 ; 57 188c6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 188ca: ac 01 movw r20, r24 188cc: 62 e0 ldi r22, 0x02 ; 2 188ce: 80 e0 ldi r24, 0x00 ; 0 188d0: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 188d4: 87 e9 ldi r24, 0x97 ; 151 188d6: 9d e1 ldi r25, 0x1D ; 29 188d8: 0f 94 9a 35 call 0x26b34 ; 0x26b34 lcd_loading_color(); st_synchronize(); 188dc: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 188e0: 6d ce rjmp .-806 ; 0x185bc } void lcd_change_success() { lcd_clear(); 188e2: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 188e6: 8e e2 ldi r24, 0x2E ; 46 188e8: 99 e3 ldi r25, 0x39 ; 57 188ea: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 188ee: ac 01 movw r20, r24 188f0: 62 e0 ldi r22, 0x02 ; 2 188f2: 80 e0 ldi r24, 0x00 ; 0 188f4: 0e 94 3a 70 call 0xe074 ; 0xe074 //! @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) 188f8: 00 23 and r16, r16 188fa: 19 f0 breq .+6 ; 0x18902 188fc: 03 30 cpi r16, 0x03 ; 3 188fe: 09 f0 breq .+2 ; 0x18902 18900: 5d ce rjmp .-838 ; 0x185bc default: lcd_change_success(); break; } } return false; 18902: 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(); } 18904: 85 e8 ldi r24, 0x85 ; 133 18906: 97 e1 ldi r25, 0x17 ; 23 18908: 0e 94 15 76 call 0xec2a ; 0xec2a current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 1890c: b1 10 cpse r11, r1 1890e: be cd rjmp .-1156 ; 0x1848c if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 18910: 81 e0 ldi r24, 0x01 ; 1 18912: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 // Not let's go back to print fanSpeed = saved_fan_speed; 18916: 80 91 a9 05 lds r24, 0x05A9 ; 0x8005a9 1891a: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df // Feed a little of filament to stabilize pressure if (!automatic) { 1891e: 11 11 cpse r17, r1 18920: 27 c0 rjmp .+78 ; 0x18970 if (printingIsPaused()) 18922: 0e 94 cb 68 call 0xd196 ; 0xd196 18926: c0 90 4c 07 lds r12, 0x074C ; 0x80074c 1892a: d0 90 4d 07 lds r13, 0x074D ; 0x80074d 1892e: e0 90 4e 07 lds r14, 0x074E ; 0x80074e 18932: f0 90 4f 07 lds r15, 0x074F ; 0x80074f 18936: 88 23 and r24, r24 18938: 09 f4 brne .+2 ; 0x1893c 1893a: a1 c0 rjmp .+322 ; 0x18a7e { // 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; 1893c: 20 e0 ldi r18, 0x00 ; 0 1893e: 30 e0 ldi r19, 0x00 ; 0 18940: 40 e8 ldi r20, 0x80 ; 128 18942: 5f e3 ldi r21, 0x3F ; 63 18944: c7 01 movw r24, r14 18946: b6 01 movw r22, r12 18948: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1894c: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 18950: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 18954: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 18958: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 1895c: 60 e0 ldi r22, 0x00 ; 0 1895e: 70 e0 ldi r23, 0x00 ; 0 18960: 88 ee ldi r24, 0xE8 ; 232 18962: 92 e4 ldi r25, 0x42 ; 66 18964: 0f 94 11 ba call 0x37422 ; 0x37422 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 18968: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 1896c: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 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); 18970: e0 90 48 07 lds r14, 0x0748 ; 0x800748 18974: f0 90 49 07 lds r15, 0x0749 ; 0x800749 18978: 00 91 4a 07 lds r16, 0x074A ; 0x80074a 1897c: 10 91 4b 07 lds r17, 0x074B ; 0x80074b 18980: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 18984: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 18988: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 1898c: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 18990: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 18994: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 18998: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 1899c: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 189a0: 1f 92 push r1 189a2: 1f 92 push r1 189a4: 1f 92 push r1 189a6: 1f 92 push r1 189a8: 81 2c mov r8, r1 189aa: 91 2c mov r9, r1 189ac: e8 e4 ldi r30, 0x48 ; 72 189ae: ae 2e mov r10, r30 189b0: e2 e4 ldi r30, 0x42 ; 66 189b2: be 2e mov r11, r30 189b4: fc e4 ldi r31, 0x4C ; 76 189b6: cf 2e mov r12, r31 189b8: f7 e0 ldi r31, 0x07 ; 7 189ba: df 2e mov r13, r31 189bc: 0f 94 bc aa call 0x35578 ; 0x35578 st_synchronize(); 189c0: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 189c4: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 189c8: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 189cc: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 189d0: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 189d4: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 189d8: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 189dc: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 189e0: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 189e4: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 189e8: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 189ec: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 189f0: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 189f4: 1f 92 push r1 189f6: 1f 92 push r1 189f8: 1f 92 push r1 189fa: 1f 92 push r1 189fc: 81 2c mov r8, r1 189fe: 91 2c mov r9, r1 18a00: a0 e7 ldi r26, 0x70 ; 112 18a02: aa 2e mov r10, r26 18a04: a1 e4 ldi r26, 0x41 ; 65 18a06: ba 2e mov r11, r26 18a08: 0f 94 bc aa call 0x35578 ; 0x35578 st_synchronize(); 18a0c: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 18a10: 87 ea ldi r24, 0xA7 ; 167 18a12: 92 e0 ldi r25, 0x02 ; 2 18a14: 0f 94 62 aa call 0x354c4 ; 0x354c4 memcpy(current_position, saved_pos, sizeof(saved_pos)); 18a18: 80 e1 ldi r24, 0x10 ; 16 18a1a: eb e9 ldi r30, 0x9B ; 155 18a1c: f2 e0 ldi r31, 0x02 ; 2 18a1e: a0 e4 ldi r26, 0x40 ; 64 18a20: b7 e0 ldi r27, 0x07 ; 7 18a22: 01 90 ld r0, Z+ 18a24: 0d 92 st X+, r0 18a26: 8a 95 dec r24 18a28: e1 f7 brne .-8 ; 0x18a22 set_destination_to_current(); 18a2a: 0e 94 80 69 call 0xd300 ; 0xd300 // Recover feed rate feedmultiply = saved_feedmultiply2; 18a2e: 80 91 6f 03 lds r24, 0x036F ; 0x80036f 18a32: 90 91 70 03 lds r25, 0x0370 ; 0x800370 18a36: 80 93 39 02 sts 0x0239, r24 ; 0x800239 18a3a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 18a3e: 9f 93 push r25 18a40: 8f 93 push r24 18a42: 82 e8 ldi r24, 0x82 ; 130 18a44: 92 e7 ldi r25, 0x72 ; 114 18a46: 9f 93 push r25 18a48: 8f 93 push r24 18a4a: 0e 94 72 8a call 0x114e4 ; 0x114e4 if (printingIsPaused()) { 18a4e: 0e 94 cb 68 call 0xd196 ; 0xd196 18a52: 0f b6 in r0, 0x3f ; 63 18a54: f8 94 cli 18a56: de bf out 0x3e, r29 ; 62 18a58: 0f be out 0x3f, r0 ; 63 18a5a: cd bf out 0x3d, r28 ; 61 18a5c: 88 23 and r24, r24 18a5e: 31 f1 breq .+76 ; 0x18aac lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 18a60: 8c e1 ldi r24, 0x1C ; 28 18a62: 91 e4 ldi r25, 0x41 ; 65 18a64: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 18a68: 0f 94 e0 0a call 0x215c0 ; 0x215c0 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 18a6c: 10 92 72 07 sts 0x0772, r1 ; 0x800772 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 18a70: 10 92 50 07 sts 0x0750, r1 ; 0x800750 18a74: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e st_synchronize(); break; // Unload filament case 3: return true; 18a78: bb 24 eor r11, r11 18a7a: b3 94 inc r11 18a7c: 43 cf rjmp .-378 ; 0x18904 setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 18a7e: 20 e0 ldi r18, 0x00 ; 0 18a80: 30 e0 ldi r19, 0x00 ; 0 18a82: 40 ea ldi r20, 0xA0 ; 160 18a84: 50 e4 ldi r21, 0x40 ; 64 18a86: c7 01 movw r24, r14 18a88: b6 01 movw r22, r12 18a8a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 18a8e: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 18a92: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 18a96: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 18a9a: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 18a9e: 60 e0 ldi r22, 0x00 ; 0 18aa0: 70 e0 ldi r23, 0x00 ; 0 18aa2: 80 e0 ldi r24, 0x00 ; 0 18aa4: 90 e4 ldi r25, 0x40 ; 64 18aa6: 0f 94 11 ba call 0x37422 ; 0x37422 18aaa: 62 cf rjmp .-316 ; 0x18970 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18aac: 81 e5 ldi r24, 0x51 ; 81 18aae: 91 e7 ldi r25, 0x71 ; 113 18ab0: 0f 94 e0 0a call 0x215c0 ; 0x215c0 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 18ab4: 86 e0 ldi r24, 0x06 ; 6 18ab6: 9c e6 ldi r25, 0x6C ; 108 18ab8: 0e 94 97 7b call 0xf72e ; 0xf72e 18abc: d7 cf rjmp .-82 ; 0x18a6c SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18abe: 0e 94 cb 68 call 0xd196 ; 0xd196 18ac2: 81 11 cpse r24, r1 18ac4: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e st_synchronize(); 18ac8: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18acc: 0e 94 46 81 call 0x1028c ; 0x1028c cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18ad0: 0e 94 d8 78 call 0xf1b0 ; 0xf1b0 lcd_pause_print(); 18ad4: 0f 94 61 3e call 0x27cc2 ; 0x27cc2 18ad8: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 18adc: 0e 94 cb 68 call 0xd196 ; 0xd196 18ae0: 88 23 and r24, r24 18ae2: 11 f4 brne .+4 ; 0x18ae8 18ae4: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 18ae8: 0c 94 ee ad jmp 0x15bdc ; 0x15bdc /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 18aec: 60 e0 ldi r22, 0x00 ; 0 18aee: 80 e0 ldi r24, 0x00 ; 0 18af0: 0f 94 e1 14 call 0x229c2 ; 0x229c2 18af4: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 18af8: 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')) { 18afa: 83 e5 ldi r24, 0x53 ; 83 18afc: 0e 94 0d 5d call 0xba1a ; 0xba1a 18b00: 88 23 and r24, r24 18b02: b1 f0 breq .+44 ; 0x18b30 iSel = code_value_uint8(); 18b04: 0e 94 9f 5c call 0xb93e ; 0xb93e 18b08: 18 2f mov r17, r24 if (iSel>=max_sheets) 18b0a: 88 30 cpi r24, 0x08 ; 8 18b0c: b0 f0 brcs .+44 ; 0x18b3a { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 18b0e: 8b ef ldi r24, 0xFB ; 251 18b10: 97 e8 ldi r25, 0x87 ; 135 18b12: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18b16: 4a e0 ldi r20, 0x0A ; 10 18b18: 67 e0 ldi r22, 0x07 ; 7 18b1a: 70 e0 ldi r23, 0x00 ; 0 18b1c: 80 e0 ldi r24, 0x00 ; 0 18b1e: 90 e0 ldi r25, 0x00 ; 0 18b20: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 18b24: 81 ef ldi r24, 0xF1 ; 241 18b26: 92 e0 ldi r25, 0x02 ; 2 18b28: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 18b2c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18b30: 81 ea ldi r24, 0xA1 ; 161 18b32: 9d e0 ldi r25, 0x0D ; 13 18b34: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 18b38: 18 2f mov r17, r24 } if (code_seen('Z')){ 18b3a: 8a e5 ldi r24, 0x5A ; 90 18b3c: 0e 94 0d 5d call 0xba1a ; 0xba1a 18b40: 88 23 and r24, r24 18b42: 09 f4 brne .+2 ; 0x18b46 18b44: d7 c0 rjmp .+430 ; 0x18cf4 z_val = code_value(); 18b46: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 18b4a: 2b 01 movw r4, r22 18b4c: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 18b4e: 20 91 77 06 lds r18, 0x0677 ; 0x800677 18b52: 30 91 78 06 lds r19, 0x0678 ; 0x800678 18b56: 40 91 79 06 lds r20, 0x0679 ; 0x800679 18b5a: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 18b5e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 18b62: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 18b66: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 18b68: 9b 01 movw r18, r22 18b6a: 21 56 subi r18, 0x61 ; 97 18b6c: 30 4f sbci r19, 0xF0 ; 240 18b6e: 20 3a cpi r18, 0xA0 ; 160 18b70: 3f 40 sbci r19, 0x0F ; 15 18b72: 30 f0 brcs .+12 ; 0x18b80 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 18b74: 85 ee ldi r24, 0xE5 ; 229 18b76: 97 e8 ldi r25, 0x87 ; 135 18b78: 0e 94 97 7b call 0xf72e ; 0xf72e 18b7c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 18b80: 5b e0 ldi r21, 0x0B ; 11 18b82: 15 9f mul r17, r21 18b84: 90 01 movw r18, r0 18b86: 11 24 eor r1, r1 18b88: c9 01 movw r24, r18 18b8a: 80 5b subi r24, 0xB0 ; 176 18b8c: 92 4f sbci r25, 0xF2 ; 242 18b8e: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 { 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')) 18b92: 8c e4 ldi r24, 0x4C ; 76 18b94: 0e 94 0d 5d call 0xba1a ; 0xba1a 18b98: bb e0 ldi r27, 0x0B ; 11 18b9a: 1b 9f mul r17, r27 18b9c: 70 01 movw r14, r0 18b9e: 11 24 eor r1, r1 18ba0: 57 01 movw r10, r14 18ba2: e7 eb ldi r30, 0xB7 ; 183 18ba4: ae 1a sub r10, r30 18ba6: e2 ef ldi r30, 0xF2 ; 242 18ba8: be 0a sbc r11, r30 18baa: 88 23 and r24, r24 18bac: 09 f4 brne .+2 ; 0x18bb0 18bae: be c0 rjmp .+380 ; 0x18d2c { char *src = strchr_pointer + 1; 18bb0: e0 91 93 03 lds r30, 0x0393 ; 0x800393 18bb4: f0 91 94 03 lds r31, 0x0394 ; 0x800394 18bb8: 31 96 adiw r30, 0x01 ; 1 18bba: bf 01 movw r22, r30 while (*src == ' ') ++src; 18bbc: 81 91 ld r24, Z+ 18bbe: 80 32 cpi r24, 0x20 ; 32 18bc0: e1 f3 breq .-8 ; 0x18bba if (*src != '\0') 18bc2: 88 23 and r24, r24 18bc4: 31 f0 breq .+12 ; 0x18bd2 { strncpy(strLabel,src,7); 18bc6: 47 e0 ldi r20, 0x07 ; 7 18bc8: 50 e0 ldi r21, 0x00 ; 0 18bca: ce 01 movw r24, r28 18bcc: 01 96 adiw r24, 0x01 ; 1 18bce: 0f 94 8f e3 call 0x3c71e ; 0x3c71e #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); 18bd2: 47 e0 ldi r20, 0x07 ; 7 18bd4: 50 e0 ldi r21, 0x00 ; 0 18bd6: b5 01 movw r22, r10 18bd8: ce 01 movw r24, r28 18bda: 01 96 adiw r24, 0x01 ; 1 18bdc: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 18be0: 82 e4 ldi r24, 0x42 ; 66 18be2: 0e 94 0d 5d call 0xba1a ; 0xba1a 18be6: 57 01 movw r10, r14 18be8: fe ea ldi r31, 0xAE ; 174 18bea: af 1a sub r10, r31 18bec: f2 ef ldi r31, 0xF2 ; 242 18bee: bf 0a sbc r11, r31 18bf0: 88 23 and r24, r24 18bf2: 09 f4 brne .+2 ; 0x18bf6 18bf4: a3 c0 rjmp .+326 ; 0x18d3c { iBedC = code_value_uint8(); 18bf6: 0e 94 9f 5c call 0xb93e ; 0xb93e 18bfa: 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); 18bfc: 68 2f mov r22, r24 18bfe: c5 01 movw r24, r10 18c00: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 18c04: 80 e5 ldi r24, 0x50 ; 80 18c06: 0e 94 0d 5d call 0xba1a ; 0xba1a 18c0a: 2d ea ldi r18, 0xAD ; 173 18c0c: e2 1a sub r14, r18 18c0e: 22 ef ldi r18, 0xF2 ; 242 18c10: f2 0a sbc r15, r18 18c12: 88 23 and r24, r24 18c14: 09 f4 brne .+2 ; 0x18c18 18c16: 97 c0 rjmp .+302 ; 0x18d46 { iPindaC = code_value_uint8(); 18c18: 0e 94 9f 5c call 0xb93e ; 0xb93e 18c1c: b8 2e mov r11, r24 18c1e: 68 2f mov r22, r24 18c20: c7 01 movw r24, r14 18c22: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 18c26: 81 e4 ldi r24, 0x41 ; 65 18c28: 0e 94 0d 5d call 0xba1a ; 0xba1a 18c2c: 88 23 and r24, r24 18c2e: 09 f4 brne .+2 ; 0x18c32 18c30: 8f c0 rjmp .+286 ; 0x18d50 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18c32: 0e 94 9f 5c call 0xb93e ; 0xb93e 18c36: 81 11 cpse r24, r1 18c38: 06 c0 rjmp .+12 ; 0x18c46 18c3a: 81 ea ldi r24, 0xA1 ; 161 18c3c: 9d e0 ldi r25, 0x0D ; 13 18c3e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 18c42: 18 13 cpse r17, r24 18c44: 8d c0 rjmp .+282 ; 0x18d60 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 18c46: 81 2f mov r24, r17 18c48: 0e 94 5d 78 call 0xf0ba ; 0xf0ba 18c4c: 08 2f mov r16, r24 18c4e: 88 23 and r24, r24 18c50: 29 f0 breq .+10 ; 0x18c5c 18c52: 61 2f mov r22, r17 18c54: 81 ea ldi r24, 0xA1 ; 161 18c56: 9d e0 ldi r25, 0x0D ; 13 18c58: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 18c5c: 8e ed ldi r24, 0xDE ; 222 18c5e: 97 e8 ldi r25, 0x87 ; 135 18c60: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18c64: 61 2f mov r22, r17 18c66: 70 e0 ldi r23, 0x00 ; 0 18c68: 90 e0 ldi r25, 0x00 ; 0 18c6a: 80 e0 ldi r24, 0x00 ; 0 18c6c: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 18c70: 81 2f mov r24, r17 18c72: 0e 94 5d 78 call 0xf0ba ; 0xf0ba 18c76: 81 11 cpse r24, r1 18c78: 04 c0 rjmp .+8 ; 0x18c82 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 18c7a: 8d ec ldi r24, 0xCD ; 205 18c7c: 97 e8 ldi r25, 0x87 ; 135 18c7e: 0e 94 97 7b call 0xf72e ; 0xf72e SERIAL_PROTOCOLPGM(" Z"); 18c82: 8a ec ldi r24, 0xCA ; 202 18c84: 97 e8 ldi r25, 0x87 ; 135 18c86: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18c8a: 44 e0 ldi r20, 0x04 ; 4 18c8c: c3 01 movw r24, r6 18c8e: b2 01 movw r22, r4 18c90: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 18c94: 87 ec ldi r24, 0xC7 ; 199 18c96: 97 e8 ldi r25, 0x87 ; 135 18c98: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18c9c: b6 01 movw r22, r12 18c9e: dd 0c add r13, r13 18ca0: 88 0b sbc r24, r24 18ca2: 99 0b sbc r25, r25 18ca4: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 18ca8: 84 ec ldi r24, 0xC4 ; 196 18caa: 97 e8 ldi r25, 0x87 ; 135 18cac: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 18cb0: ce 01 movw r24, r28 18cb2: 01 96 adiw r24, 0x01 ; 1 18cb4: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 18cb8: 81 ec ldi r24, 0xC1 ; 193 18cba: 97 e8 ldi r25, 0x87 ; 135 18cbc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 18cc0: 69 2d mov r22, r9 18cc2: 70 e0 ldi r23, 0x00 ; 0 18cc4: 90 e0 ldi r25, 0x00 ; 0 18cc6: 80 e0 ldi r24, 0x00 ; 0 18cc8: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18ccc: 8e eb ldi r24, 0xBE ; 190 18cce: 97 e8 ldi r25, 0x87 ; 135 18cd0: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 18cd4: 6b 2d mov r22, r11 18cd6: 70 e0 ldi r23, 0x00 ; 0 18cd8: 90 e0 ldi r25, 0x00 ; 0 18cda: 80 e0 ldi r24, 0x00 ; 0 18cdc: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 18ce0: 8b eb ldi r24, 0xBB ; 187 18ce2: 97 e8 ldi r25, 0x87 ; 135 18ce4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLLN((int)bIsActive); 18ce8: 80 2f mov r24, r16 18cea: 90 e0 ldi r25, 0x00 ; 0 18cec: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 18cf0: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } 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))); 18cf4: ab e0 ldi r26, 0x0B ; 11 18cf6: 1a 9f mul r17, r26 18cf8: c0 01 movw r24, r0 18cfa: 11 24 eor r1, r1 18cfc: 80 5b subi r24, 0xB0 ; 176 18cfe: 92 4f sbci r25, 0xF2 ; 242 18d00: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 18d04: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 18d06: bc 01 movw r22, r24 18d08: 99 0f add r25, r25 18d0a: 88 0b sbc r24, r24 18d0c: 99 0b sbc r25, r25 18d0e: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 18d12: 20 91 77 06 lds r18, 0x0677 ; 0x800677 18d16: 30 91 78 06 lds r19, 0x0678 ; 0x800678 18d1a: 40 91 79 06 lds r20, 0x0679 ; 0x800679 18d1e: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 18d22: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 18d26: 2b 01 movw r4, r22 18d28: 3c 01 movw r6, r24 18d2a: 33 cf rjmp .-410 ; 0x18b92 } 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)); 18d2c: 47 e0 ldi r20, 0x07 ; 7 18d2e: 50 e0 ldi r21, 0x00 ; 0 18d30: b5 01 movw r22, r10 18d32: ce 01 movw r24, r28 18d34: 01 96 adiw r24, 0x01 ; 1 18d36: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe 18d3a: 52 cf rjmp .-348 ; 0x18be0 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); 18d3c: c5 01 movw r24, r10 18d3e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 18d42: 98 2e mov r9, r24 18d44: 5f cf rjmp .-322 ; 0x18c04 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); 18d46: c7 01 movw r24, r14 18d48: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 18d4c: b8 2e mov r11, r24 18d4e: 6b cf rjmp .-298 ; 0x18c26 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18d50: 81 ea ldi r24, 0xA1 ; 161 18d52: 9d e0 ldi r25, 0x0D ; 13 18d54: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 18d58: 01 e0 ldi r16, 0x01 ; 1 18d5a: 18 17 cp r17, r24 18d5c: 09 f4 brne .+2 ; 0x18d60 18d5e: 7e cf rjmp .-260 ; 0x18c5c { 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; 18d60: 00 e0 ldi r16, 0x00 ; 0 18d62: 7c cf rjmp .-264 ; 0x18c5c 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)) ) { 18d64: c3 01 movw r24, r6 18d66: b2 01 movw r22, r4 18d68: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 18d6c: 20 91 95 03 lds r18, 0x0395 ; 0x800395 18d70: 30 91 96 03 lds r19, 0x0396 ; 0x800396 18d74: 40 91 97 03 lds r20, 0x0397 ; 0x800397 18d78: 50 91 98 03 lds r21, 0x0398 ; 0x800398 18d7c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 18d80: 87 fd sbrc r24, 7 18d82: 02 c0 rjmp .+4 ; 0x18d88 18d84: 0c 94 11 ad jmp 0x15a22 ; 0x15a22 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 18d88: 0f 94 55 3e call 0x27caa ; 0x27caa 18d8c: 68 19 sub r22, r8 18d8e: 79 09 sbc r23, r9 18d90: 8a 09 sbc r24, r10 18d92: 9b 09 sbc r25, r11 18d94: 69 3e cpi r22, 0xE9 ; 233 18d96: 73 40 sbci r23, 0x03 ; 3 18d98: 81 05 cpc r24, r1 18d9a: 91 05 cpc r25, r1 18d9c: c8 f0 brcs .+50 ; 0x18dd0 { SERIAL_PROTOCOLPGM("P:"); 18d9e: 85 e9 ldi r24, 0x95 ; 149 18da0: 97 e8 ldi r25, 0x87 ; 135 18da2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18da6: 60 91 95 03 lds r22, 0x0395 ; 0x800395 18daa: 70 91 96 03 lds r23, 0x0396 ; 0x800396 18dae: 80 91 97 03 lds r24, 0x0397 ; 0x800397 18db2: 90 91 98 03 lds r25, 0x0398 ; 0x800398 18db6: 41 e0 ldi r20, 0x01 ; 1 18db8: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18dbc: 8f e2 ldi r24, 0x2F ; 47 18dbe: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 18dc2: c8 01 movw r24, r16 18dc4: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 codenum = _millis(); 18dc8: 0f 94 55 3e call 0x27caa ; 0x27caa 18dcc: 4b 01 movw r8, r22 18dce: 5c 01 movw r10, r24 } manage_heater(); 18dd0: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(); 18dd4: 80 e0 ldi r24, 0x00 ; 0 18dd6: 0e 94 6b 8c call 0x118d6 ; 0x118d6 lcd_update(0); 18dda: 80 e0 ldi r24, 0x00 ; 0 18ddc: 0e 94 ed 6f call 0xdfda ; 0xdfda 18de0: 0c 94 f8 ac jmp 0x159f0 ; 0x159f0 - `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 18de4: 8f e3 ldi r24, 0x3F ; 63 18de6: 0e 94 0d 5d call 0xba1a ; 0xba1a 18dea: 88 23 and r24, r24 18dec: c9 f0 breq .+50 ; 0x18e20 SERIAL_PROTOCOLPGM("PINDA cal status: "); 18dee: 82 e8 ldi r24, 0x82 ; 130 18df0: 97 e8 ldi r25, 0x87 ; 135 18df2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 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); } 18df6: 86 ea ldi r24, 0xA6 ; 166 18df8: 9f e0 ldi r25, 0x0F ; 15 18dfa: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 18dfe: 21 e0 ldi r18, 0x01 ; 1 18e00: 30 e0 ldi r19, 0x00 ; 0 18e02: 81 11 cpse r24, r1 18e04: 02 c0 rjmp .+4 ; 0x18e0a 18e06: 30 e0 ldi r19, 0x00 ; 0 18e08: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 18e0a: c9 01 movw r24, r18 18e0c: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 SERIAL_PROTOCOLLNRPGM(_header); 18e10: 8b e6 ldi r24, 0x6B ; 107 18e12: 97 e8 ldi r25, 0x87 ; 135 18e14: 0e 94 97 7b call 0xf72e ; 0xf72e gcode_M861_print_pinda_cal_eeprom(); 18e18: 0e 94 a4 79 call 0xf348 ; 0xf348 18e1c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } else if (code_seen('!')) { // ! - Set factory default values 18e20: 81 e2 ldi r24, 0x21 ; 33 18e22: 0e 94 0d 5d call 0xba1a ; 0xba1a 18e26: 88 23 and r24, r24 18e28: 49 f1 breq .+82 ; 0x18e7c 18e2a: 61 e0 ldi r22, 0x01 ; 1 18e2c: 86 ea ldi r24, 0xA6 ; 166 18e2e: 9f e0 ldi r25, 0x0F ; 15 18e30: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 18e34: 68 e0 ldi r22, 0x08 ; 8 18e36: 70 e0 ldi r23, 0x00 ; 0 18e38: 80 eb ldi r24, 0xB0 ; 176 18e3a: 9f e0 ldi r25, 0x0F ; 15 18e3c: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 18e40: 68 e1 ldi r22, 0x18 ; 24 18e42: 70 e0 ldi r23, 0x00 ; 0 18e44: 82 eb ldi r24, 0xB2 ; 178 18e46: 9f e0 ldi r25, 0x0F ; 15 18e48: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 18e4c: 60 e3 ldi r22, 0x30 ; 48 18e4e: 70 e0 ldi r23, 0x00 ; 0 18e50: 84 eb ldi r24, 0xB4 ; 180 18e52: 9f e0 ldi r25, 0x0F ; 15 18e54: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 18e58: 60 e5 ldi r22, 0x50 ; 80 18e5a: 70 e0 ldi r23, 0x00 ; 0 18e5c: 86 eb ldi r24, 0xB6 ; 182 18e5e: 9f e0 ldi r25, 0x0F ; 15 18e60: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 18e64: 68 e7 ldi r22, 0x78 ; 120 18e66: 70 e0 ldi r23, 0x00 ; 0 18e68: 88 eb ldi r24, 0xB8 ; 184 18e6a: 9f e0 ldi r25, 0x0F ; 15 18e6c: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 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"); 18e70: 8a e5 ldi r24, 0x5A ; 90 18e72: 97 e8 ldi r25, 0x87 ; 135 18e74: 0e 94 97 7b call 0xf72e ; 0xf72e 18e78: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 18e7c: 8a e5 ldi r24, 0x5A ; 90 18e7e: 0e 94 0d 5d call 0xba1a ; 0xba1a 18e82: 88 23 and r24, r24 18e84: c1 f0 breq .+48 ; 0x18eb6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 18e86: 61 e0 ldi r22, 0x01 ; 1 18e88: 86 ea ldi r24, 0xA6 ; 166 18e8a: 9f e0 ldi r25, 0x0F ; 15 18e8c: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 18e90: 00 eb ldi r16, 0xB0 ; 176 18e92: 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); 18e94: 70 e0 ldi r23, 0x00 ; 0 18e96: 60 e0 ldi r22, 0x00 ; 0 18e98: c8 01 movw r24, r16 18e9a: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 18e9e: 0e 5f subi r16, 0xFE ; 254 18ea0: 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++) { 18ea2: 0a 3b cpi r16, 0xBA ; 186 18ea4: 4f e0 ldi r20, 0x0F ; 15 18ea6: 14 07 cpc r17, r20 18ea8: a9 f7 brne .-22 ; 0x18e94 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 18eaa: 80 e5 ldi r24, 0x50 ; 80 18eac: 97 e8 ldi r25, 0x87 ; 135 18eae: 0e 94 97 7b call 0xf72e ; 0xf72e 18eb2: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 18eb6: 83 e5 ldi r24, 0x53 ; 83 18eb8: 0e 94 0d 5d call 0xba1a ; 0xba1a 18ebc: 88 23 and r24, r24 18ebe: 21 f1 breq .+72 ; 0x18f08 int16_t usteps = code_value_short(); 18ec0: 0e 94 ac 5c call 0xb958 ; 0xb958 18ec4: 8c 01 movw r16, r24 if (code_seen('I')) { 18ec6: 89 e4 ldi r24, 0x49 ; 73 18ec8: 0e 94 0d 5d call 0xba1a ; 0xba1a 18ecc: 88 23 and r24, r24 18ece: 11 f4 brne .+4 ; 0x18ed4 18ed0: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e uint8_t index = code_value_uint8(); 18ed4: 0e 94 9f 5c call 0xb93e ; 0xb93e if (index < 5) { 18ed8: 85 30 cpi r24, 0x05 ; 5 18eda: 10 f0 brcs .+4 ; 0x18ee0 18edc: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 18ee0: 90 e0 ldi r25, 0x00 ; 0 18ee2: 88 52 subi r24, 0x28 ; 40 18ee4: 98 4f sbci r25, 0xF8 ; 248 18ee6: b8 01 movw r22, r16 18ee8: 88 0f add r24, r24 18eea: 99 1f adc r25, r25 18eec: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 SERIAL_PROTOCOLLNRPGM(MSG_OK); 18ef0: 88 ee ldi r24, 0xE8 ; 232 18ef2: 9e e6 ldi r25, 0x6E ; 110 18ef4: 0e 94 97 7b call 0xf72e ; 0xf72e SERIAL_PROTOCOLLNRPGM(_header); 18ef8: 8b e6 ldi r24, 0x6B ; 107 18efa: 97 e8 ldi r25, 0x87 ; 135 18efc: 0e 94 97 7b call 0xf72e ; 0xf72e gcode_M861_print_pinda_cal_eeprom(); 18f00: 0e 94 a4 79 call 0xf348 ; 0xf348 18f04: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 18f08: 8f e3 ldi r24, 0x3F ; 63 18f0a: 97 e8 ldi r25, 0x87 ; 135 18f0c: 0e 94 97 7b call 0xf72e ; 0xf72e 18f10: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e */ 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); 18f14: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 18f18: 20 e0 ldi r18, 0x00 ; 0 18f1a: 30 e0 ldi r19, 0x00 ; 0 18f1c: 40 e2 ldi r20, 0x20 ; 32 18f1e: 51 e4 ldi r21, 0x41 ; 65 18f20: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 18f24: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 18f28: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 18f2a: 63 30 cpi r22, 0x03 ; 3 18f2c: 09 f4 brne .+2 ; 0x18f30 18f2e: a2 c0 rjmp .+324 ; 0x19074 18f30: 98 f5 brcc .+102 ; 0x18f98 18f32: 61 30 cpi r22, 0x01 ; 1 18f34: 09 f4 brne .+2 ; 0x18f38 18f36: 59 c0 rjmp .+178 ; 0x18fea 18f38: 62 30 cpi r22, 0x02 ; 2 18f3a: 11 f0 breq .+4 ; 0x18f40 18f3c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18f40: 80 91 95 13 lds r24, 0x1395 ; 0x801395 return pgm_read_word(&_nPrinterMmuType); 18f44: e6 e8 ldi r30, 0x86 ; 134 18f46: f0 e8 ldi r31, 0x80 ; 128 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 18f48: 81 30 cpi r24, 0x01 ; 1 18f4a: 11 f0 breq .+4 ; 0x18f50 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 18f4c: e8 e8 ldi r30, 0x88 ; 136 18f4e: f0 e8 ldi r31, 0x80 ; 128 18f50: 05 91 lpm r16, Z+ 18f52: 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')) 18f54: 80 e5 ldi r24, 0x50 ; 80 18f56: 0e 94 0d 5d call 0xba1a ; 0xba1a 18f5a: 88 23 and r24, r24 18f5c: 09 f4 brne .+2 ; 0x18f60 18f5e: 79 c0 rjmp .+242 ; 0x19052 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 18f60: 0e 94 b9 5c call 0xb972 ; 0xb972 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 18f64: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 18f68: ff 20 and r15, r15 18f6a: 11 f4 brne .+4 ; 0x18f70 18f6c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e return; if (nPrinterModel == actualPrinterModel) 18f70: 60 17 cp r22, r16 18f72: 71 07 cpc r23, r17 18f74: 11 f4 brne .+4 ; 0x18f7a 18f76: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 18f7a: 8d ef ldi r24, 0xFD ; 253 18f7c: 97 e3 ldi r25, 0x37 ; 55 18f7e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 18f82: 8c 01 movw r16, r24 18f84: 85 ec ldi r24, 0xC5 ; 197 18f86: 97 e3 ldi r25, 0x37 ; 55 18f88: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 18f8c: 4f 2d mov r20, r15 18f8e: b8 01 movw r22, r16 18f90: 0f 94 38 15 call 0x22a70 ; 0x22a70 18f94: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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) 18f98: 64 30 cpi r22, 0x04 ; 4 18f9a: 09 f4 brne .+2 ; 0x18f9e 18f9c: be c0 rjmp .+380 ; 0x1911a 18f9e: 65 30 cpi r22, 0x05 ; 5 18fa0: 11 f0 breq .+4 ; 0x18fa6 18fa2: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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')) 18fa6: 80 e5 ldi r24, 0x50 ; 80 18fa8: 0e 94 0d 5d call 0xba1a ; 0xba1a 18fac: 88 23 and r24, r24 18fae: 09 f4 brne .+2 ; 0x18fb2 18fb0: 3a c1 rjmp .+628 ; 0x19226 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 18fb2: 0e 94 b9 5c call 0xb972 ; 0xb972 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 18fb6: 10 91 e8 04 lds r17, 0x04E8 ; 0x8004e8 18fba: 11 23 and r17, r17 18fbc: 11 f4 brne .+4 ; 0x18fc2 18fbe: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 18fc2: 62 30 cpi r22, 0x02 ; 2 18fc4: 71 05 cpc r23, r1 18fc6: 10 f4 brcc .+4 ; 0x18fcc 18fc8: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 18fcc: 89 ee ldi r24, 0xE9 ; 233 18fce: 96 e3 ldi r25, 0x36 ; 54 18fd0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 18fd4: 7c 01 movw r14, r24 18fd6: 88 eb ldi r24, 0xB8 ; 184 18fd8: 96 e3 ldi r25, 0x36 ; 54 18fda: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 18fde: 41 2f mov r20, r17 18fe0: b7 01 movw r22, r14 18fe2: 0f 94 38 15 call 0x22a70 ; 0x22a70 18fe6: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 18fea: 80 e5 ldi r24, 0x50 ; 80 18fec: 0e 94 0d 5d call 0xba1a ; 0xba1a 18ff0: 88 23 and r24, r24 18ff2: a9 f0 breq .+42 ; 0x1901e { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 18ff4: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 18ff8: 20 e0 ldi r18, 0x00 ; 0 18ffa: 30 e0 ldi r19, 0x00 ; 0 18ffc: 4a e7 ldi r20, 0x7A ; 122 18ffe: 54 e4 ldi r21, 0x44 ; 68 19000: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 19004: 20 e0 ldi r18, 0x00 ; 0 19006: 30 e0 ldi r19, 0x00 ; 0 19008: 40 e0 ldi r20, 0x00 ; 0 1900a: 5f e3 ldi r21, 0x3F ; 63 1900c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 19010: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> nozzle_diameter_check(nDiameter); 19014: cb 01 movw r24, r22 19016: 0f 94 77 15 call 0x22aee ; 0x22aee 1901a: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } else if(code_seen('Q')) 1901e: 81 e5 ldi r24, 0x51 ; 81 19020: 0e 94 0d 5d call 0xba1a ; 0xba1a 19024: 88 23 and r24, r24 19026: 11 f4 brne .+4 ; 0x1902c 19028: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 1902c: 85 ea ldi r24, 0xA5 ; 165 1902e: 9d e0 ldi r25, 0x0D ; 13 19030: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 19034: bc 01 movw r22, r24 19036: 90 e0 ldi r25, 0x00 ; 0 19038: 80 e0 ldi r24, 0x00 ; 0 1903a: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 1903e: 20 e0 ldi r18, 0x00 ; 0 19040: 30 e0 ldi r19, 0x00 ; 0 19042: 4a e7 ldi r20, 0x7A ; 122 19044: 54 e4 ldi r21, 0x44 ; 68 19046: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1904a: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 1904e: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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')) 19052: 81 e5 ldi r24, 0x51 ; 81 19054: 0e 94 0d 5d call 0xba1a ; 0xba1a 19058: 88 23 and r24, r24 1905a: 11 f4 brne .+4 ; 0x19060 1905c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 19060: b8 01 movw r22, r16 19062: 90 e0 ldi r25, 0x00 ; 0 19064: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 19066: 4a e0 ldi r20, 0x0A ; 10 19068: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 1906c: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 19070: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 19074: 80 91 95 13 lds r24, 0x1395 ; 0x801395 return _sPrinterMmuName; 19078: 6d e7 ldi r22, 0x7D ; 125 1907a: e6 2e mov r14, r22 1907c: 60 e8 ldi r22, 0x80 ; 128 1907e: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 19080: 81 30 cpi r24, 0x01 ; 1 19082: 21 f0 breq .+8 ; 0x1908c return _sPrinterMmuName; } else { return _sPrinterName; 19084: 58 e7 ldi r21, 0x78 ; 120 19086: e5 2e mov r14, r21 19088: 50 e8 ldi r21, 0x80 ; 128 1908a: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 1908c: 80 e5 ldi r24, 0x50 ; 80 1908e: 0e 94 0d 5d call 0xba1a ; 0xba1a 19092: 88 23 and r24, r24 19094: b1 f1 breq .+108 ; 0x19102 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 19096: 62 e2 ldi r22, 0x22 ; 34 19098: 70 e0 ldi r23, 0x00 ; 0 1909a: 80 91 93 03 lds r24, 0x0393 ; 0x800393 1909e: 90 91 94 03 lds r25, 0x0394 ; 0x800394 190a2: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc 190a6: 8c 01 movw r16, r24 if (!this->ptr) { 190a8: 89 2b or r24, r25 190aa: d1 f0 breq .+52 ; 0x190e0 // First quote not found return; } // Skip the leading quote this->ptr++; 190ac: 0f 5f subi r16, 0xFF ; 255 190ae: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 190b0: 62 e2 ldi r22, 0x22 ; 34 190b2: 70 e0 ldi r23, 0x00 ; 0 190b4: c8 01 movw r24, r16 190b6: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc if(!pStrEnd) { 190ba: 00 97 sbiw r24, 0x00 ; 0 190bc: 89 f0 breq .+34 ; 0x190e0 // Second quote not found return; } this->len = pStrEnd - this->ptr; 190be: d8 2e mov r13, r24 190c0: d0 1a sub r13, r16 190c2: c7 01 movw r24, r14 190c4: 0f 94 cd da call 0x3b59a ; 0x3b59a <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 190c8: d8 12 cpse r13, r24 190ca: 0a c0 rjmp .+20 ; 0x190e0 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 190cc: ac 01 movw r20, r24 190ce: 55 27 eor r21, r21 190d0: b7 01 movw r22, r14 190d2: c8 01 movw r24, r16 190d4: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 190d8: 89 2b or r24, r25 190da: 11 f4 brne .+4 ; 0x190e0 190dc: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } } render_M862_warnings( 190e0: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 190e4: 8d ef ldi r24, 0xFD ; 253 190e6: 97 e3 ldi r25, 0x37 ; 55 190e8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 190ec: 8c 01 movw r16, r24 190ee: 85 ec ldi r24, 0xC5 ; 197 190f0: 97 e3 ldi r25, 0x37 ; 55 190f2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 190f6: 4f 2d mov r20, r15 190f8: b8 01 movw r22, r16 190fa: 0f 94 38 15 call 0x22a70 ; 0x22a70 190fe: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 19102: 81 e5 ldi r24, 0x51 ; 81 19104: 0e 94 0d 5d call 0xba1a ; 0xba1a 19108: 88 23 and r24, r24 1910a: 11 f4 brne .+4 ; 0x19110 1910c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e SERIAL_PROTOCOLLNRPGM(type); 19110: c7 01 movw r24, r14 19112: 0e 94 97 7b call 0xf72e ; 0xf72e 19116: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 1911a: 80 e5 ldi r24, 0x50 ; 80 1911c: 0e 94 0d 5d call 0xba1a ; 0xba1a 19120: 88 23 and r24, r24 19122: 09 f4 brne .+2 ; 0x19126 19124: 77 c0 rjmp .+238 ; 0x19214 fw_version_check(++strchr_pointer); 19126: 80 91 93 03 lds r24, 0x0393 ; 0x800393 1912a: 90 91 94 03 lds r25, 0x0394 ; 0x800394 1912e: 01 96 adiw r24, 0x01 ; 1 19130: 90 93 94 03 sts 0x0394, r25 ; 0x800394 19134: 80 93 93 03 sts 0x0393, r24 ; 0x800393 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 19138: 20 91 e9 04 lds r18, 0x04E9 ; 0x8004e9 1913c: 22 23 and r18, r18 1913e: 11 f4 brne .+4 ; 0x19144 19140: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 19144: be 01 movw r22, r28 19146: 6f 5f subi r22, 0xFF ; 255 19148: 7f 4f sbci r23, 0xFF ; 255 1914a: 0e 94 4e f8 call 0x1f09c ; 0x1f09c nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 1914e: 8a e0 ldi r24, 0x0A ; 10 19150: 90 e0 ldi r25, 0x00 ; 0 19152: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 19156: 29 81 ldd r18, Y+1 ; 0x01 19158: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 1915a: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1915c: 82 17 cp r24, r18 1915e: 93 07 cpc r25, r19 19160: 28 f0 brcs .+10 ; 0x1916c return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19162: 11 e0 ldi r17, 0x01 ; 1 19164: 28 17 cp r18, r24 19166: 39 07 cpc r19, r25 19168: 08 f4 brcc .+2 ; 0x1916c 1916a: 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; 1916c: 12 95 swap r17 1916e: 11 0f add r17, r17 19170: 11 0f add r17, r17 19172: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 19174: 8c e0 ldi r24, 0x0C ; 12 19176: 90 e0 ldi r25, 0x00 ; 0 19178: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 1917c: ac 01 movw r20, r24 1917e: 2b 81 ldd r18, Y+3 ; 0x03 19180: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19182: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19184: 42 17 cp r20, r18 19186: 53 07 cpc r21, r19 19188: 28 f0 brcs .+10 ; 0x19194 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 1918a: 81 e0 ldi r24, 0x01 ; 1 1918c: 24 17 cp r18, r20 1918e: 35 07 cpc r19, r21 19190: 08 f4 brcc .+2 ; 0x19194 19192: 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; 19194: 50 e1 ldi r21, 0x10 ; 16 19196: 85 9f mul r24, r21 19198: c0 01 movw r24, r0 1919a: 11 24 eor r1, r1 1919c: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 1919e: 8e e0 ldi r24, 0x0E ; 14 191a0: 90 e0 ldi r25, 0x00 ; 0 191a2: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 191a6: ac 01 movw r20, r24 191a8: 2d 81 ldd r18, Y+5 ; 0x05 191aa: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 191ac: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 191ae: 42 17 cp r20, r18 191b0: 53 07 cpc r21, r19 191b2: 28 f0 brcs .+10 ; 0x191be return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 191b4: 81 e0 ldi r24, 0x01 ; 1 191b6: 24 17 cp r18, r20 191b8: 35 07 cpc r19, r21 191ba: 08 f4 brcc .+2 ; 0x191be 191bc: 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; 191be: a4 e0 ldi r26, 0x04 ; 4 191c0: 8a 9f mul r24, r26 191c2: c0 01 movw r24, r0 191c4: 11 24 eor r1, r1 191c6: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 191c8: 80 e1 ldi r24, 0x10 ; 16 191ca: 90 e0 ldi r25, 0x00 ; 0 191cc: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 191d0: ac 01 movw r20, r24 191d2: 2f 81 ldd r18, Y+7 ; 0x07 191d4: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 191d6: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 191d8: 42 17 cp r20, r18 191da: 53 07 cpc r21, r19 191dc: 28 f0 brcs .+10 ; 0x191e8 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 191de: 91 e0 ldi r25, 0x01 ; 1 191e0: 24 17 cp r18, r20 191e2: 35 07 cpc r19, r21 191e4: 08 f4 brcc .+2 ; 0x191e8 191e6: 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)); 191e8: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 191ea: 16 35 cpi r17, 0x56 ; 86 191ec: 10 f4 brcc .+4 ; 0x191f2 191ee: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 191f2: f0 90 e9 04 lds r15, 0x04E9 ; 0x8004e9 191f6: 82 e7 ldi r24, 0x72 ; 114 191f8: 97 e3 ldi r25, 0x37 ; 55 191fa: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 191fe: 8c 01 movw r16, r24 19200: 82 e4 ldi r24, 0x42 ; 66 19202: 97 e3 ldi r25, 0x37 ; 55 19204: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 19208: 4f 2d mov r20, r15 1920a: b8 01 movw r22, r16 1920c: 0f 94 38 15 call 0x22a70 ; 0x22a70 19210: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e else if(code_seen('Q')) 19214: 81 e5 ldi r24, 0x51 ; 81 19216: 0e 94 0d 5d call 0xba1a ; 0xba1a 1921a: 88 23 and r24, r24 1921c: 11 f4 brne .+4 ; 0x19222 1921e: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 19222: 0c 94 9f a9 jmp 0x1533e ; 0x1533e { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 19226: 81 e5 ldi r24, 0x51 ; 81 19228: 0e 94 0d 5d call 0xba1a ; 0xba1a 1922c: 88 23 and r24, r24 1922e: 11 f4 brne .+4 ; 0x19234 19230: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e SERIAL_PROTOCOLLN(GCODE_LEVEL); 19234: 81 e0 ldi r24, 0x01 ; 1 19236: 90 e0 ldi r25, 0x00 ; 0 19238: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 1923c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e * 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; 19240: 8b e4 ldi r24, 0x4B ; 75 19242: 0e 94 0d 5d call 0xba1a ; 0xba1a 19246: c1 2c mov r12, r1 19248: d1 2c mov r13, r1 1924a: e1 2c mov r14, r1 1924c: 40 ec ldi r20, 0xC0 ; 192 1924e: f4 2e mov r15, r20 19250: 88 23 and r24, r24 19252: 49 f1 breq .+82 ; 0x192a6 19254: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 19258: 6b 01 movw r12, r22 1925a: 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) 1925c: 20 e0 ldi r18, 0x00 ; 0 1925e: 30 e0 ldi r19, 0x00 ; 0 19260: a9 01 movw r20, r18 19262: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 19266: 81 11 cpse r24, r1 19268: 1e c0 rjmp .+60 ; 0x192a6 { extruder_advance_K = 0; 1926a: 10 92 04 18 sts 0x1804, r1 ; 0x801804 1926e: 10 92 05 18 sts 0x1805, r1 ; 0x801805 19272: 10 92 06 18 sts 0x1806, r1 ; 0x801806 19276: 10 92 07 18 sts 0x1807, r1 ; 0x801807 1927a: 0e 94 d3 83 call 0x107a6 ; 0x107a6 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 1927e: 84 e1 ldi r24, 0x14 ; 20 19280: 9b ea ldi r25, 0xAB ; 171 19282: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM("Advance K="); 19286: 85 e5 ldi r24, 0x55 ; 85 19288: 90 e8 ldi r25, 0x80 ; 128 1928a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(extruder_advance_K); 1928e: 60 91 04 18 lds r22, 0x1804 ; 0x801804 19292: 70 91 05 18 lds r23, 0x1805 ; 0x801805 19296: 80 91 06 18 lds r24, 0x1806 ; 0x801806 1929a: 90 91 07 18 lds r25, 0x1807 ; 0x801807 1929e: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 192a2: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 192a6: 80 91 6e 03 lds r24, 0x036E ; 0x80036e 192aa: 81 11 cpse r24, r1 192ac: 1b c0 rjmp .+54 ; 0x192e4 { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 192ae: 20 e0 ldi r18, 0x00 ; 0 192b0: 30 e0 ldi r19, 0x00 ; 0 192b2: a9 01 movw r20, r18 192b4: c7 01 movw r24, r14 192b6: b6 01 movw r22, r12 192b8: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 192bc: 87 ff sbrs r24, 7 192be: 05 c0 rjmp .+10 ; 0x192ca } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 192c0: 80 e6 ldi r24, 0x60 ; 96 192c2: 90 e8 ldi r25, 0x80 ; 128 192c4: 0e 94 97 7b call 0xf72e ; 0xf72e 192c8: da cf rjmp .-76 ; 0x1927e return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 192ca: 20 e0 ldi r18, 0x00 ; 0 192cc: 30 e0 ldi r19, 0x00 ; 0 192ce: 40 e2 ldi r20, 0x20 ; 32 192d0: 51 e4 ldi r21, 0x41 ; 65 192d2: c7 01 movw r24, r14 192d4: b6 01 movw r22, r12 192d6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 192da: 87 ff sbrs r24, 7 192dc: 2c c0 rjmp .+88 ; 0x19336 192de: 81 e0 ldi r24, 0x01 ; 1 192e0: 0e 94 d3 83 call 0x107a6 ; 0x107a6 } if(la10c_mode == LA10C_LA15) 192e4: 80 91 6e 03 lds r24, 0x036E ; 0x80036e return (k >= 0 && k < LA_K_MAX? k: -1); 192e8: 20 e0 ldi r18, 0x00 ; 0 192ea: 30 e0 ldi r19, 0x00 ; 0 192ec: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 192ee: 81 30 cpi r24, 0x01 ; 1 192f0: 21 f5 brne .+72 ; 0x1933a return (k >= 0 && k < LA_K_MAX? k: -1); 192f2: c7 01 movw r24, r14 192f4: b6 01 movw r22, r12 192f6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 192fa: 87 fd sbrc r24, 7 192fc: e1 cf rjmp .-62 ; 0x192c0 192fe: 20 e0 ldi r18, 0x00 ; 0 19300: 30 e0 ldi r19, 0x00 ; 0 19302: 40 e2 ldi r20, 0x20 ; 32 19304: 51 e4 ldi r21, 0x41 ; 65 19306: c7 01 movw r24, r14 19308: b6 01 movw r22, r12 1930a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1930e: 87 ff sbrs r24, 7 19310: d7 cf rjmp .-82 ; 0x192c0 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 19312: 20 e0 ldi r18, 0x00 ; 0 19314: 30 e0 ldi r19, 0x00 ; 0 19316: a9 01 movw r20, r18 19318: c7 01 movw r24, r14 1931a: b6 01 movw r22, r12 1931c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 19320: 87 fd sbrc r24, 7 19322: ce cf rjmp .-100 ; 0x192c0 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 19324: c0 92 04 18 sts 0x1804, r12 ; 0x801804 19328: d0 92 05 18 sts 0x1805, r13 ; 0x801805 1932c: e0 92 06 18 sts 0x1806, r14 ; 0x801806 19330: f0 92 07 18 sts 0x1807, r15 ; 0x801807 19334: a4 cf rjmp .-184 ; 0x1927e if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 19336: 82 e0 ldi r24, 0x02 ; 2 19338: d3 cf rjmp .-90 ; 0x192e0 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 1933a: c7 01 movw r24, r14 1933c: b6 01 movw r22, r12 1933e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 19342: 87 fd sbrc r24, 7 19344: bd cf rjmp .-134 ; 0x192c0 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 19346: 2f e6 ldi r18, 0x6F ; 111 19348: 32 e1 ldi r19, 0x12 ; 18 1934a: 43 e0 ldi r20, 0x03 ; 3 1934c: 5b e3 ldi r21, 0x3B ; 59 1934e: c7 01 movw r24, r14 19350: b6 01 movw r22, r12 19352: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 19356: 2a e0 ldi r18, 0x0A ; 10 19358: 37 ed ldi r19, 0xD7 ; 215 1935a: 43 e2 ldi r20, 0x23 ; 35 1935c: 5c e3 ldi r21, 0x3C ; 60 1935e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 19362: 6b 01 movw r12, r22 19364: 7c 01 movw r14, r24 return new_K < 0? 0: 19366: 20 e0 ldi r18, 0x00 ; 0 19368: 30 e0 ldi r19, 0x00 ; 0 1936a: a9 01 movw r20, r18 1936c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 19370: 87 fd sbrc r24, 7 19372: 11 c0 rjmp .+34 ; 0x19396 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 19374: 20 e0 ldi r18, 0x00 ; 0 19376: 30 e0 ldi r19, 0x00 ; 0 19378: 40 e2 ldi r20, 0x20 ; 32 1937a: 51 e4 ldi r21, 0x41 ; 65 1937c: c7 01 movw r24, r14 1937e: b6 01 movw r22, r12 19380: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 19384: 18 16 cp r1, r24 19386: 2c f6 brge .-118 ; 0x19312 19388: c1 2c mov r12, r1 1938a: d1 2c mov r13, r1 1938c: 30 e2 ldi r19, 0x20 ; 32 1938e: e3 2e mov r14, r19 19390: 31 e4 ldi r19, 0x41 ; 65 19392: f3 2e mov r15, r19 19394: c7 cf rjmp .-114 ; 0x19324 // 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: 19396: c1 2c mov r12, r1 19398: d1 2c mov r13, r1 1939a: 76 01 movw r14, r12 1939c: c3 cf rjmp .-122 ; 0x19324 1939e: 9d ed ldi r25, 0xDD ; 221 193a0: 89 2e mov r8, r25 193a2: 92 e0 ldi r25, 0x02 ; 2 193a4: 99 2e mov r9, r25 193a6: 0d e5 ldi r16, 0x5D ; 93 193a8: 12 e0 ldi r17, 0x02 ; 2 193aa: 25 ef ldi r18, 0xF5 ; 245 193ac: a2 2e mov r10, r18 193ae: 24 e0 ldi r18, 0x04 ; 4 193b0: 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++){ 193b2: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 193b4: f4 01 movw r30, r8 193b6: 81 91 ld r24, Z+ 193b8: 4f 01 movw r8, r30 193ba: 0e 94 0d 5d call 0xba1a ; 0xba1a 193be: 88 23 and r24, r24 193c0: 09 f4 brne .+2 ; 0x193c4 193c2: 45 c0 rjmp .+138 ; 0x1944e if( i == E_AXIS && FarmOrUserECool() ){ 193c4: f3 e0 ldi r31, 0x03 ; 3 193c6: 7f 12 cpse r7, r31 193c8: 04 c0 rjmp .+8 ; 0x193d2 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(); 193ca: 0e 94 cc f8 call 0x1f198 ; 0x1f198 193ce: 81 11 cpse r24, r1 193d0: 61 c0 rjmp .+194 ; 0x19494 SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 193d2: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 193d6: 6b 01 movw r12, r22 193d8: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 193da: 20 e0 ldi r18, 0x00 ; 0 193dc: 30 e0 ldi r19, 0x00 ; 0 193de: a9 01 movw r20, r18 193e0: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 193e4: 87 fd sbrc r24, 7 193e6: 46 c0 rjmp .+140 ; 0x19474 if (cur > 1029) cur = 1029; //limit max 193e8: 20 e0 ldi r18, 0x00 ; 0 193ea: 30 ea ldi r19, 0xA0 ; 160 193ec: 40 e8 ldi r20, 0x80 ; 128 193ee: 54 e4 ldi r21, 0x44 ; 68 193f0: c7 01 movw r24, r14 193f2: b6 01 movw r22, r12 193f4: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 193f8: 18 16 cp r1, r24 193fa: a4 f1 brlt .+104 ; 0x19464 //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; 193fc: 20 e0 ldi r18, 0x00 ; 0 193fe: 30 e0 ldi r19, 0x00 ; 0 19400: 47 e0 ldi r20, 0x07 ; 7 19402: 54 e4 ldi r21, 0x44 ; 68 19404: c7 01 movw r24, r14 19406: b6 01 movw r22, r12 19408: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1940c: 87 fd sbrc r24, 7 1940e: 35 c0 rjmp .+106 ; 0x1947a 19410: 20 e0 ldi r18, 0x00 ; 0 19412: 30 e0 ldi r19, 0x00 ; 0 19414: 4c e7 ldi r20, 0x7C ; 124 19416: 52 e4 ldi r21, 0x42 ; 66 19418: c7 01 movw r24, r14 1941a: b6 01 movw r22, r12 1941c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 19420: 20 e0 ldi r18, 0x00 ; 0 19422: 30 ea ldi r19, 0xA0 ; 160 19424: 40 e8 ldi r20, 0x80 ; 128 19426: 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); 19428: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1942c: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 19430: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 19432: c8 01 movw r24, r16 19434: 0e 94 44 69 call 0xd288 ; 0xd288 currents[i].setiRun(val); 19438: 6f 2d mov r22, r15 1943a: c8 01 movw r24, r16 1943c: 0e 94 4c 69 call 0xd298 ; 0xd298 tmc2130_setup_chopper(i, tmc2130_mres[i]); 19440: 50 e0 ldi r21, 0x00 ; 0 19442: 40 e0 ldi r20, 0x00 ; 0 19444: d5 01 movw r26, r10 19446: 6c 91 ld r22, X 19448: 87 2d mov r24, r7 1944a: 0f 94 14 39 call 0x27228 ; 0x27228 */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 1944e: 73 94 inc r7 19450: 0d 5f subi r16, 0xFD ; 253 19452: 1f 4f sbci r17, 0xFF ; 255 19454: bf ef ldi r27, 0xFF ; 255 19456: ab 1a sub r10, r27 19458: bb 0a sbc r11, r27 1945a: e4 e0 ldi r30, 0x04 ; 4 1945c: 7e 12 cpse r7, r30 1945e: aa cf rjmp .-172 ; 0x193b4 19460: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 19464: c1 2c mov r12, r1 19466: 80 ea ldi r24, 0xA0 ; 160 19468: d8 2e mov r13, r24 1946a: 80 e8 ldi r24, 0x80 ; 128 1946c: e8 2e mov r14, r24 1946e: 84 e4 ldi r24, 0x44 ; 68 19470: f8 2e mov r15, r24 19472: ce cf rjmp .-100 ; 0x19410 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 19474: c1 2c mov r12, r1 19476: d1 2c mov r13, r1 19478: 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); 1947a: 20 e0 ldi r18, 0x00 ; 0 1947c: 30 e0 ldi r19, 0x00 ; 0 1947e: 4c e7 ldi r20, 0x7C ; 124 19480: 52 e4 ldi r21, 0x42 ; 66 19482: c7 01 movw r24, r14 19484: b6 01 movw r22, r12 19486: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1948a: 20 e0 ldi r18, 0x00 ; 0 1948c: 34 eb ldi r19, 0xB4 ; 180 1948e: 40 e9 ldi r20, 0x90 ; 144 19490: 54 e4 ldi r21, 0x44 ; 68 19492: ca cf rjmp .-108 ; 0x19428 if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 19494: 81 ee ldi r24, 0xE1 ; 225 19496: 90 ea ldi r25, 0xA0 ; 160 19498: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM(", M907 E ignored"); 1949c: 8e e2 ldi r24, 0x2E ; 46 1949e: 97 e8 ldi r25, 0x87 ; 135 194a0: 0e 94 97 7b call 0xf72e ; 0xf72e 194a4: d4 cf rjmp .-88 ; 0x1944e 194a6: 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; } 194aa: 80 91 66 02 lds r24, 0x0266 ; 0x800266 194ae: 81 11 cpse r24, r1 194b0: 01 c0 rjmp .+2 ; 0x194b4 194b2: 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"), 194b4: 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() 194b6: 86 e6 ldi r24, 0x66 ; 102 194b8: 92 e0 ldi r25, 0x02 ; 2 194ba: 0f 94 1f 3c call 0x2783e ; 0x2783e 194be: 88 2e mov r8, r24 194c0: c0 90 64 02 lds r12, 0x0264 ; 0x800264 194c4: 80 91 63 02 lds r24, 0x0263 ; 0x800263 194c8: 81 11 cpse r24, r1 194ca: 01 c0 rjmp .+2 ; 0x194ce 194cc: 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"), 194ce: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 194d0: 83 e6 ldi r24, 0x63 ; 99 194d2: 92 e0 ldi r25, 0x02 ; 2 194d4: 0f 94 1f 3c call 0x2783e ; 0x2783e 194d8: 98 2e mov r9, r24 194da: 00 91 61 02 lds r16, 0x0261 ; 0x800261 194de: 80 91 60 02 lds r24, 0x0260 ; 0x800260 194e2: 81 11 cpse r24, r1 194e4: 01 c0 rjmp .+2 ; 0x194e8 194e6: 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"), 194e8: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 194ea: 80 e6 ldi r24, 0x60 ; 96 194ec: 92 e0 ldi r25, 0x02 ; 2 194ee: 0f 94 1f 3c call 0x2783e ; 0x2783e 194f2: e8 2e mov r14, r24 194f4: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 194f8: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 194fc: 81 11 cpse r24, r1 194fe: 01 c0 rjmp .+2 ; 0x19502 19500: 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(), 19502: 8d e5 ldi r24, 0x5D ; 93 19504: 92 e0 ldi r25, 0x02 ; 2 19506: 0f 94 1f 3c call 0x2783e ; 0x2783e 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"), 1950a: bf 92 push r11 1950c: af 92 push r10 1950e: 1f 92 push r1 19510: 8f 92 push r8 19512: df 92 push r13 19514: cf 92 push r12 19516: 1f 92 push r1 19518: 9f 92 push r9 1951a: 1f 93 push r17 1951c: 0f 93 push r16 1951e: 1f 92 push r1 19520: ef 92 push r14 19522: 1f 92 push r1 19524: ff 92 push r15 19526: 1f 92 push r1 19528: 8f 93 push r24 1952a: 80 e1 ldi r24, 0x10 ; 16 1952c: 99 e6 ldi r25, 0x69 ; 105 1952e: 9f 93 push r25 19530: 8f 93 push r24 19532: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 19536: 0f b6 in r0, 0x3f ; 63 19538: f8 94 cli 1953a: de bf out 0x3e, r29 ; 62 1953c: 0f be out 0x3f, r0 ; 63 1953e: cd bf out 0x3d, r28 ; 61 19540: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e - `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; 19544: 11 e0 ldi r17, 0x01 ; 1 19546: 82 39 cpi r24, 0x92 ; 146 19548: 93 40 sbci r25, 0x03 ; 3 1954a: 09 f4 brne .+2 ; 0x1954e 1954c: 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')) 1954e: 82 e5 ldi r24, 0x52 ; 82 19550: 0e 94 0d 5d call 0xba1a ; 0xba1a 19554: 88 23 and r24, r24 19556: 81 f0 breq .+32 ; 0x19578 { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 19558: 8f ef ldi r24, 0xFF ; 255 1955a: 9f e0 ldi r25, 0x0F ; 15 1955c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 19560: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 19562: 80 91 69 06 lds r24, 0x0669 ; 0x800669 19566: 81 17 cp r24, r17 19568: 11 f4 brne .+4 ; 0x1956e 1956a: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 1956e: 81 2f mov r24, r17 19570: 0e 94 cf 61 call 0xc39e ; 0xc39e 19574: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e //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')) 19578: 80 e5 ldi r24, 0x50 ; 80 1957a: 0e 94 0d 5d call 0xba1a ; 0xba1a 1957e: 88 23 and r24, r24 19580: 89 f0 breq .+34 ; 0x195a4 { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 19582: 01 e0 ldi r16, 0x01 ; 1 19584: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 <_ZL17mcode_in_progress.lto_priv.548> 19588: 90 91 59 0e lds r25, 0x0E59 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.548+0x1> 1958c: 82 39 cpi r24, 0x92 ; 146 1958e: 93 40 sbci r25, 0x03 ; 3 19590: 09 f4 brne .+2 ; 0x19594 19592: 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); 19594: 60 2f mov r22, r16 19596: 8f ef ldi r24, 0xFF ; 255 19598: 9f e0 ldi r25, 0x0F ; 15 1959a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 1959e: 00 93 a0 03 sts 0x03A0, r16 ; 0x8003a0 195a2: df cf rjmp .-66 ; 0x19562 //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')) 195a4: 81 e5 ldi r24, 0x51 ; 81 195a6: 0e 94 0d 5d call 0xba1a ; 0xba1a 195aa: 88 23 and r24, r24 195ac: d1 f2 breq .-76 ; 0x19562 { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 195ae: 80 91 69 06 lds r24, 0x0669 ; 0x800669 195b2: 81 11 cpse r24, r1 195b4: 15 c0 rjmp .+42 ; 0x195e0 195b6: 8a e7 ldi r24, 0x7A ; 122 195b8: 98 e5 ldi r25, 0x58 ; 88 195ba: 9f 93 push r25 195bc: 8f 93 push r24 195be: 83 e7 ldi r24, 0x73 ; 115 195c0: 9d e3 ldi r25, 0x3D ; 61 195c2: 9f 93 push r25 195c4: 8f 93 push r24 195c6: 86 e2 ldi r24, 0x26 ; 38 195c8: 97 e8 ldi r25, 0x87 ; 135 195ca: 9f 93 push r25 195cc: 8f 93 push r24 195ce: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 195d2: 0f 90 pop r0 195d4: 0f 90 pop r0 195d6: 0f 90 pop r0 195d8: 0f 90 pop r0 195da: 0f 90 pop r0 195dc: 0f 90 pop r0 195de: c1 cf rjmp .-126 ; 0x19562 195e0: 80 ef ldi r24, 0xF0 ; 240 195e2: 9c e3 ldi r25, 0x3C ; 60 195e4: ea cf rjmp .-44 ; 0x195ba 195e6: 8d ed ldi r24, 0xDD ; 221 195e8: 92 e0 ldi r25, 0x02 ; 2 195ea: 6c 96 adiw r28, 0x1c ; 28 195ec: 9f af std Y+63, r25 ; 0x3f 195ee: 8e af std Y+62, r24 ; 0x3e 195f0: 6c 97 sbiw r28, 0x1c ; 28 195f2: eb e6 ldi r30, 0x6B ; 107 195f4: ee 2e mov r14, r30 195f6: e6 e0 ldi r30, 0x06 ; 6 195f8: fe 2e mov r15, r30 195fa: f1 e5 ldi r31, 0x51 ; 81 195fc: cf 2e mov r12, r31 195fe: f7 e0 ldi r31, 0x07 ; 7 19600: df 2e mov r13, r31 19602: a5 ef ldi r26, 0xF5 ; 245 19604: 2a 2e mov r2, r26 19606: a4 e0 ldi r26, 0x04 ; 4 19608: 3a 2e mov r3, r26 1960a: b7 e2 ldi r27, 0x27 ; 39 1960c: 8b 2e mov r8, r27 1960e: b7 e0 ldi r27, 0x07 ; 7 19610: 9b 2e mov r9, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 1962e: b8 2e mov r11, r24 19630: 88 23 and r24, r24 19632: 09 f4 brne .+2 ; 0x19636 19634: 75 c0 rjmp .+234 ; 0x19720 { uint16_t res_new = code_value(); 19636: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 1963a: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 1963e: 2b 01 movw r4, r22 19640: 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 19642: 68 30 cpi r22, 0x08 ; 8 19644: 71 05 cpc r23, r1 19646: 09 f4 brne .+2 ; 0x1964a 19648: 59 c3 rjmp .+1714 ; 0x19cfc 1964a: 60 31 cpi r22, 0x10 ; 16 1964c: 71 05 cpc r23, r1 1964e: 09 f4 brne .+2 ; 0x19652 19650: 55 c3 rjmp .+1706 ; 0x19cfc 19652: 81 e0 ldi r24, 0x01 ; 1 19654: 00 32 cpi r16, 0x20 ; 32 19656: 11 05 cpc r17, r1 19658: 09 f0 breq .+2 ; 0x1965c 1965a: 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 1965c: 67 96 adiw r28, 0x17 ; 23 1965e: bf ad ldd r27, Y+63 ; 0x3f 19660: 67 97 sbiw r28, 0x17 ; 23 19662: b3 30 cpi r27, 0x03 ; 3 19664: 09 f4 brne .+2 ; 0x19668 19666: 55 c3 rjmp .+1706 ; 0x19d12 19668: 92 01 movw r18, r4 1966a: 21 50 subi r18, 0x01 ; 1 1966c: 31 09 sbc r19, r1 1966e: 22 30 cpi r18, 0x02 ; 2 19670: 31 05 cpc r19, r1 19672: 08 f0 brcs .+2 ; 0x19676 19674: 49 c3 rjmp .+1682 ; 0x19d08 19676: 9b 2d mov r25, r11 19678: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 1967a: 67 96 adiw r28, 0x17 ; 23 1967c: ef ad ldd r30, Y+63 ; 0x3f 1967e: 67 97 sbiw r28, 0x17 ; 23 19680: e3 30 cpi r30, 0x03 ; 3 19682: 41 f4 brne .+16 ; 0x19694 19684: 00 34 cpi r16, 0x40 ; 64 19686: 11 05 cpc r17, r1 19688: 31 f0 breq .+12 ; 0x19696 1968a: bb 24 eor r11, r11 1968c: b3 94 inc r11 1968e: 00 38 cpi r16, 0x80 ; 128 19690: 11 05 cpc r17, r1 19692: 09 f0 breq .+2 ; 0x19696 19694: b1 2c mov r11, r1 #endif if (res_valid) 19696: 81 11 cpse r24, r1 19698: 03 c0 rjmp .+6 ; 0x196a0 1969a: bb 20 and r11, r11 1969c: 09 f4 brne .+2 ; 0x196a0 1969e: 40 c0 rjmp .+128 ; 0x19720 { st_synchronize(); 196a0: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 196a4: d1 01 movw r26, r2 196a6: 8c 91 ld r24, X 196a8: a1 2c mov r10, r1 196aa: bb 24 eor r11, r11 196ac: b3 94 inc r11 196ae: 02 c0 rjmp .+4 ; 0x196b4 196b0: b6 94 lsr r11 196b2: a7 94 ror r10 196b4: 8a 95 dec r24 196b6: e2 f7 brpl .-8 ; 0x196b0 uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 196b8: b2 01 movw r22, r4 196ba: 67 96 adiw r28, 0x17 ; 23 196bc: 8f ad ldd r24, Y+63 ; 0x3f 196be: 67 97 sbiw r28, 0x17 ; 23 196c0: 0f 94 7f 39 call 0x272fe ; 0x272fe cs.axis_ustep_resolution[i] = res_new; 196c4: f4 01 movw r30, r8 196c6: 40 82 st Z, r4 if (res_new > res) 196c8: a0 16 cp r10, r16 196ca: b1 06 cpc r11, r17 196cc: 08 f0 brcs .+2 ; 0x196d0 196ce: 40 c0 rjmp .+128 ; 0x19750 { uint16_t fac = (res_new / res); 196d0: c8 01 movw r24, r16 196d2: b5 01 movw r22, r10 196d4: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 196d8: 2b 01 movw r4, r22 196da: 71 2c mov r7, r1 196dc: 61 2c mov r6, r1 196de: c3 01 movw r24, r6 196e0: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 196e4: 9b 01 movw r18, r22 196e6: ac 01 movw r20, r24 196e8: d7 01 movw r26, r14 196ea: 14 96 adiw r26, 0x04 ; 4 196ec: 6d 91 ld r22, X+ 196ee: 7d 91 ld r23, X+ 196f0: 8d 91 ld r24, X+ 196f2: 9c 91 ld r25, X 196f4: 17 97 sbiw r26, 0x07 ; 7 196f6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 196fa: f7 01 movw r30, r14 196fc: 64 83 std Z+4, r22 ; 0x04 196fe: 75 83 std Z+5, r23 ; 0x05 19700: 86 83 std Z+6, r24 ; 0x06 19702: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 19704: d6 01 movw r26, r12 19706: 2d 91 ld r18, X+ 19708: 3d 91 ld r19, X+ 1970a: 4d 91 ld r20, X+ 1970c: 5c 91 ld r21, X 1970e: c3 01 movw r24, r6 19710: b2 01 movw r22, r4 19712: 0f 94 72 dd call 0x3bae4 ; 0x3bae4 <__mulsi3> 19716: f6 01 movw r30, r12 19718: 60 83 st Z, r22 1971a: 71 83 std Z+1, r23 ; 0x01 1971c: 82 83 std Z+2, r24 ; 0x02 1971e: 93 83 std Z+3, r25 ; 0x03 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 1974a: 66 cf rjmp .-308 ; 0x19618 1974c: 0c 94 ab b2 jmp 0x16556 ; 0x16556 cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 19750: c5 01 movw r24, r10 19752: b8 01 movw r22, r16 19754: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 19758: 2b 01 movw r4, r22 1975a: 71 2c mov r7, r1 1975c: 61 2c mov r6, r1 1975e: c3 01 movw r24, r6 19760: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 19764: 9b 01 movw r18, r22 19766: ac 01 movw r20, r24 19768: d7 01 movw r26, r14 1976a: 14 96 adiw r26, 0x04 ; 4 1976c: 6d 91 ld r22, X+ 1976e: 7d 91 ld r23, X+ 19770: 8d 91 ld r24, X+ 19772: 9c 91 ld r25, X 19774: 17 97 sbiw r26, 0x07 ; 7 19776: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1977a: f7 01 movw r30, r14 1977c: 64 83 std Z+4, r22 ; 0x04 1977e: 75 83 std Z+5, r23 ; 0x05 19780: 86 83 std Z+6, r24 ; 0x06 19782: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 19784: d6 01 movw r26, r12 19786: 6d 91 ld r22, X+ 19788: 7d 91 ld r23, X+ 1978a: 8d 91 ld r24, X+ 1978c: 9c 91 ld r25, X 1978e: a3 01 movw r20, r6 19790: 92 01 movw r18, r4 19792: 0f 94 00 de call 0x3bc00 ; 0x3bc00 <__divmodsi4> 19796: f6 01 movw r30, r12 19798: 20 83 st Z, r18 1979a: 31 83 std Z+1, r19 ; 0x01 1979c: 42 83 std Z+2, r20 ; 0x02 1979e: 53 83 std Z+3, r21 ; 0x03 197a0: bf cf rjmp .-130 ; 0x19720 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') ) { 197a2: 80 e5 ldi r24, 0x50 ; 80 197a4: 0e 94 0d 5d call 0xba1a ; 0xba1a 197a8: 88 23 and r24, r24 197aa: 29 f0 breq .+10 ; 0x197b6 mmuSlotIndex = code_value_uint8(); 197ac: 0e 94 9f 5c call 0xb93e ; 0xb93e 197b0: 18 2f mov r17, r24 197b2: 0c 94 29 ac jmp 0x15852 ; 0x15852 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') ) { 197b6: 84 e5 ldi r24, 0x54 ; 84 197b8: 0e 94 0d 5d call 0xba1a ; 0xba1a 197bc: 81 11 cpse r24, r1 197be: f6 cf rjmp .-20 ; 0x197ac 197c0: 0c 94 28 ac jmp 0x15850 ; 0x15850 */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 197c4: 60 e0 ldi r22, 0x00 ; 0 197c6: 70 e0 ldi r23, 0x00 ; 0 197c8: cb 01 movw r24, r22 197ca: 0c 94 42 ac jmp 0x15884 ; 0x15884 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; 197ce: 82 e0 ldi r24, 0x02 ; 2 197d0: 80 93 72 07 sts 0x0772, r24 ; 0x800772 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 197d4: 82 e7 ldi r24, 0x72 ; 114 197d6: 9d e5 ldi r25, 0x5D ; 93 197d8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 197dc: 0f 94 e0 0a call 0x215c0 ; 0x215c0 current_position[E_AXIS] += fastLoadLength; 197e0: a7 01 movw r20, r14 197e2: 96 01 movw r18, r12 197e4: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 197e8: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 197ec: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 197f0: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 197f4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 197f8: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 197fc: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 19800: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 19804: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 19808: 60 e0 ldi r22, 0x00 ; 0 1980a: 70 e0 ldi r23, 0x00 ; 0 1980c: 80 ea ldi r24, 0xA0 ; 160 1980e: 91 e4 ldi r25, 0x41 ; 65 19810: 0f 94 11 ba call 0x37422 ; 0x37422 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 19814: 01 11 cpse r16, r1 19816: 06 c0 rjmp .+12 ; 0x19824 raise_z_above(MIN_Z_FOR_LOAD); 19818: 60 e0 ldi r22, 0x00 ; 0 1981a: 70 e0 ldi r23, 0x00 ; 0 1981c: 88 e4 ldi r24, 0x48 ; 72 1981e: 92 e4 ldi r25, 0x42 ; 66 19820: 0e 94 a6 6f call 0xdf4c ; 0xdf4c } load_filament_final_feed(); // slow sequence 19824: 0e 94 d9 65 call 0xcbb2 ; 0xcbb2 st_synchronize(); 19828: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 Sound_MakeCustom(50, 500, false); 1982c: 40 e0 ldi r20, 0x00 ; 0 1982e: 64 ef ldi r22, 0xF4 ; 244 19830: 71 e0 ldi r23, 0x01 ; 1 19832: 82 e3 ldi r24, 0x32 ; 50 19834: 90 e0 ldi r25, 0x00 ; 0 19836: 0f 94 1a 69 call 0x2d234 ; 0x2d234 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 1983a: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1983e: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 19840: 0f 94 3d 67 call 0x2ce7a ; 0x2ce7a #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 19844: 81 e0 ldi r24, 0x01 ; 1 19846: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_update(2); 1984a: 82 e0 ldi r24, 0x02 ; 2 1984c: 0e 94 ed 6f call 0xdfda ; 0xdfda lcd_setstatuspgm(MSG_WELCOME); 19850: 81 e5 ldi r24, 0x51 ; 81 19852: 91 e7 ldi r25, 0x71 ; 113 19854: 0f 94 e0 0a call 0x215c0 ; 0x215c0 custom_message_type = CustomMsg::Status; 19858: 10 92 72 07 sts 0x0772, r1 ; 0x800772 1985c: 0c 94 59 ac jmp 0x158b2 ; 0x158b2 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 19860: 85 e5 ldi r24, 0x55 ; 85 19862: 0e 94 0d 5d call 0xba1a ; 0xba1a - `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; 19866: c1 2c mov r12, r1 19868: d1 2c mov r13, r1 1986a: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 1986c: 88 23 and r24, r24 1986e: 21 f0 breq .+8 ; 0x19878 19870: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 19874: 6b 01 movw r12, r22 19876: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 19878: 8a e5 ldi r24, 0x5A ; 90 1987a: 0e 94 0d 5d call 0xba1a ; 0xba1a 1987e: 88 23 and r24, r24 19880: a1 f0 breq .+40 ; 0x198aa 19882: 0e 94 e3 61 call 0xc3c6 ; 0xc3c6 19886: 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); 19888: 0e 94 27 6f call 0xde4e ; 0xde4e 1988c: 4b 01 movw r8, r22 1988e: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 19890: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19894: 81 30 cpi r24, 0x01 ; 1 19896: 99 f4 brne .+38 ; 0x198be 19898: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 1989c: c5 01 movw r24, r10 1989e: b4 01 movw r22, r8 198a0: 90 58 subi r25, 0x80 ; 128 198a2: 0e 94 27 6f call 0xde4e ; 0xde4e 198a6: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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 198aa: 60 e0 ldi r22, 0x00 ; 0 198ac: 70 e0 ldi r23, 0x00 ; 0 198ae: 80 ea ldi r24, 0xA0 ; 160 198b0: 91 e4 ldi r25, 0x41 ; 65 198b2: 0e 94 a6 6f call 0xdf4c ; 0xdf4c - `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; 198b6: 60 e0 ldi r22, 0x00 ; 0 198b8: 70 e0 ldi r23, 0x00 ; 0 198ba: cb 01 movw r24, r22 198bc: e5 cf rjmp .-54 ; 0x19888 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 198be: c7 01 movw r24, r14 198c0: b6 01 movw r22, r12 198c2: 0f 94 a1 15 call 0x22b42 ; 0x22b42 198c6: ea cf rjmp .-44 ; 0x1989c #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 198c8: 81 ec ldi r24, 0xC1 ; 193 198ca: 92 e0 ldi r25, 0x02 ; 2 198cc: 0e 94 95 61 call 0xc32a ; 0xc32a 198d0: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 198d4: 82 ec ldi r24, 0xC2 ; 194 198d6: 92 e0 ldi r25, 0x02 ; 2 198d8: 0e 94 95 61 call 0xc32a ; 0xc32a 198dc: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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() ) { 198e0: 80 91 95 13 lds r24, 0x1395 ; 0x801395 198e4: 81 30 cpi r24, 0x01 ; 1 198e6: 11 f0 breq .+4 ; 0x198ec 198e8: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e if( code_seen('A') ) { 198ec: 81 e4 ldi r24, 0x41 ; 65 198ee: 0e 94 0d 5d call 0xba1a ; 0xba1a 198f2: 88 23 and r24, r24 198f4: 11 f4 brne .+4 ; 0x198fa 198f6: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 198fa: 80 91 93 03 lds r24, 0x0393 ; 0x800393 198fe: 90 91 94 03 lds r25, 0x0394 ; 0x800394 19902: 40 e1 ldi r20, 0x10 ; 16 19904: 50 e0 ldi r21, 0x00 ; 0 19906: 70 e0 ldi r23, 0x00 ; 0 19908: 60 e0 ldi r22, 0x00 ; 0 1990a: 01 96 adiw r24, 0x01 ; 1 1990c: 0f 94 9a d8 call 0x3b134 ; 0x3b134 19910: 86 2f mov r24, r22 19912: 0f 94 a2 1c call 0x23944 ; 0x23944 19916: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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() ){ 1991a: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1991e: 81 30 cpi r24, 0x01 ; 1 19920: 11 f0 breq .+4 ; 0x19926 19922: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e uint8_t addr = 0; if( code_seen('A') ) { 19926: 81 e4 ldi r24, 0x41 ; 65 19928: 0e 94 0d 5d call 0xba1a ; 0xba1a Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 1992c: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 1992e: 88 23 and r24, r24 19930: 61 f0 breq .+24 ; 0x1994a addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 19932: 80 91 93 03 lds r24, 0x0393 ; 0x800393 19936: 90 91 94 03 lds r25, 0x0394 ; 0x800394 1993a: 40 e1 ldi r20, 0x10 ; 16 1993c: 50 e0 ldi r21, 0x00 ; 0 1993e: 70 e0 ldi r23, 0x00 ; 0 19940: 60 e0 ldi r22, 0x00 ; 0 19942: 01 96 adiw r24, 0x01 ; 1 19944: 0f 94 9a d8 call 0x3b134 ; 0x3b134 19948: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 1994a: 88 e5 ldi r24, 0x58 ; 88 1994c: 0e 94 0d 5d call 0xba1a ; 0xba1a 19950: 88 23 and r24, r24 19952: 61 f0 breq .+24 ; 0x1996c data = code_value_short(); 19954: 0e 94 ac 5c call 0xb958 ; 0xb958 } if(addr){ 19958: 11 23 and r17, r17 1995a: 11 f4 brne .+4 ; 0x19960 1995c: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e MMU2::mmu2.WriteRegister(addr, data); 19960: bc 01 movw r22, r24 19962: 81 2f mov r24, r17 19964: 0e 94 f6 dd call 0x1bbec ; 0x1bbec 19968: 0c 94 27 ad jmp 0x15a4e ; 0x15a4e 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; 1996c: 90 e0 ldi r25, 0x00 ; 0 1996e: 80 e0 ldi r24, 0x00 ; 0 19970: f3 cf rjmp .-26 ; 0x19958 19972: 60 e0 ldi r22, 0x00 ; 0 19974: 8c ea ldi r24, 0xAC ; 172 19976: 9c e0 ldi r25, 0x0C ; 12 19978: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 1997c: 10 92 95 13 sts 0x1395, r1 ; 0x801395 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 19980: 10 92 43 13 sts 0x1343, r1 ; 0x801343 currentScope = Scope::Stopped; 19984: 10 92 28 13 sts 0x1328, r1 ; 0x801328 19988: 0c 94 9f ac jmp 0x1593e ; 0x1593e 1998c: 61 e0 ldi r22, 0x01 ; 1 1998e: 8c ea ldi r24, 0xAC ; 172 19990: 9c e0 ldi r25, 0x0C ; 12 19992: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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(); 19996: 0e 94 56 da call 0x1b4ac ; 0x1b4ac 1999a: 0c 94 9f ac jmp 0x1593e ; 0x1593e break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 1999e: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 199a0: 0f 94 86 1c call 0x2390c ; 0x2390c 199a4: 0c 94 b5 ac jmp 0x1596a ; 0x1596a } void MMU2::TriggerResetPin() { reset(); 199a8: 0f 94 97 c2 call 0x3852e ; 0x3852e 199ac: 0c 94 b5 ac jmp 0x1596a ; 0x1596a void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 199b0: 8a e2 ldi r24, 0x2A ; 42 199b2: f6 cf rjmp .-20 ; 0x199a0 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') { 199b4: 84 35 cpi r24, 0x54 ; 84 199b6: 09 f0 breq .+2 ; 0x199ba 199b8: 79 c0 rjmp .+242 ; 0x19aac strchr_pointer = CMDBUFFER_CURRENT_STRING; 199ba: 10 93 94 03 sts 0x0394, r17 ; 0x800394 199be: 00 93 93 03 sts 0x0393, r16 ; 0x800393 processing_tcode = true; 199c2: 81 e0 ldi r24, 0x01 ; 1 199c4: 80 93 9f 03 sts 0x039F, r24 ; 0x80039f TCodes(strchr_pointer, code_value_uint8()); 199c8: 0e 94 9f 5c call 0xb93e ; 0xb93e 199cc: 18 2f mov r17, r24 199ce: 20 91 93 03 lds r18, 0x0393 ; 0x800393 199d2: 30 91 94 03 lds r19, 0x0394 ; 0x800394 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 199d6: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 199d8: 79 01 movw r14, r18 199da: e9 0e add r14, r25 199dc: f1 1c adc r15, r1 199de: d7 01 movw r26, r14 199e0: 8c 91 ld r24, X 199e2: 80 32 cpi r24, 0x20 ; 32 199e4: 11 f0 breq .+4 ; 0x199ea 199e6: 89 30 cpi r24, 0x09 ; 9 199e8: 11 f4 brne .+4 ; 0x199ee 199ea: 9f 5f subi r25, 0xFF ; 255 199ec: f5 cf rjmp .-22 ; 0x199d8 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 199ee: 08 2e mov r0, r24 199f0: 00 0c add r0, r0 199f2: 99 0b sbc r25, r25 199f4: 0f 94 23 e3 call 0x3c646 ; 0x3c646 199f8: f7 01 movw r30, r14 199fa: 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'); 199fc: 90 ed ldi r25, 0xD0 ; 208 199fe: 98 0f add r25, r24 19a00: 95 30 cpi r25, 0x05 ; 5 19a02: 58 f0 brcs .+22 ; 0x19a1a 19a04: 8f 33 cpi r24, 0x3F ; 63 19a06: 59 f0 breq .+22 ; 0x19a1e 19a08: 88 37 cpi r24, 0x78 ; 120 19a0a: 49 f0 breq .+18 ; 0x19a1e 19a0c: 83 36 cpi r24, 0x63 ; 99 19a0e: f1 f0 breq .+60 ; 0x19a4c } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 19a10: 8b e2 ldi r24, 0x2B ; 43 19a12: 90 e8 ldi r25, 0x80 ; 128 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19a14: 0e 94 97 7b call 0xf72e ; 0xf72e 19a18: 13 c0 rjmp .+38 ; 0x19a40 strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 19a1a: 8f 33 cpi r24, 0x3F ; 63 19a1c: a9 f4 brne .+42 ; 0x19a48 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 19a1e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19a22: 81 30 cpi r24, 0x01 ; 1 19a24: 69 f4 brne .+26 ; 0x19a40 MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 19a26: 84 e7 ldi r24, 0x74 ; 116 19a28: 9f e3 ldi r25, 0x3F ; 63 19a2a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 19a2e: 70 e0 ldi r23, 0x00 ; 0 19a30: 60 e0 ldi r22, 0x00 ; 0 19a32: 0e 94 ed d8 call 0x1b1da ; 0x1b1da 19a36: 68 2f mov r22, r24 19a38: d7 01 movw r26, r14 19a3a: 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()); 19a3c: 0f 94 3b 1c call 0x23876 ; 0x23876 processing_tcode = false; 19a40: 10 92 9f 03 sts 0x039F, r1 ; 0x80039f 19a44: 0c 94 6e 98 jmp 0x130dc ; 0x130dc } 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'){ 19a48: 83 36 cpi r24, 0x63 ; 99 19a4a: 49 f4 brne .+18 ; 0x19a5e // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 19a4c: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19a50: 81 30 cpi r24, 0x01 ; 1 19a52: b1 f7 brne .-20 ; 0x19a40 MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 19a54: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 19a58: 68 2f mov r22, r24 19a5a: 83 e6 ldi r24, 0x63 ; 99 19a5c: ef cf rjmp .-34 ; 0x19a3c } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 19a5e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 19a62: 81 30 cpi r24, 0x01 ; 1 19a64: 69 f4 brne .+26 ; 0x19a80 if (codeValue == MMU2::mmu2.get_current_tool()){ 19a66: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 19a6a: 18 13 cpse r17, r24 19a6c: 05 c0 rjmp .+10 ; 0x19a78 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 19a6e: 8b e3 ldi r24, 0x3B ; 59 19a70: 90 e8 ldi r25, 0x80 ; 128 19a72: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 19a76: e4 cf rjmp .-56 ; 0x19a40 #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); 19a78: 81 2f mov r24, r17 19a7a: 0f 94 1f 19 call 0x2323e ; 0x2323e 19a7e: e0 cf rjmp .-64 ; 0x19a40 } } else { SERIAL_ECHO_START; 19a80: 84 e1 ldi r24, 0x14 ; 20 19a82: 9b ea ldi r25, 0xAB ; 171 19a84: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if (codeValue >= EXTRUDERS) { 19a88: 11 23 and r17, r17 19a8a: 59 f0 breq .+22 ; 0x19aa2 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 19a8c: 84 e5 ldi r24, 0x54 ; 84 19a8e: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 19a92: 81 2f mov r24, r17 19a94: 90 e0 ldi r25, 0x00 ; 0 19a96: c0 96 adiw r24, 0x30 ; 48 19a98: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19a9c: 8f ef ldi r24, 0xFF ; 255 19a9e: 98 e6 ldi r25, 0x68 ; 104 19aa0: b9 cf rjmp .-142 ; 0x19a14 // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19aa2: 8c ee ldi r24, 0xEC ; 236 19aa4: 98 e6 ldi r25, 0x68 ; 104 19aa6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 19aaa: ca cf rjmp .-108 ; 0x19a40 /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19aac: 84 34 cpi r24, 0x44 ; 68 19aae: 09 f0 breq .+2 ; 0x19ab2 19ab0: ee c0 rjmp .+476 ; 0x19c8e { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19ab2: 10 93 94 03 sts 0x0394, r17 ; 0x800394 19ab6: 00 93 93 03 sts 0x0393, r16 ; 0x800393 switch(code_value_short()) 19aba: 0e 94 ac 5c call 0xb958 ; 0xb958 19abe: 86 30 cpi r24, 0x06 ; 6 19ac0: 91 05 cpc r25, r1 19ac2: 09 f4 brne .+2 ; 0x19ac6 19ac4: 79 c0 rjmp .+242 ; 0x19bb8 19ac6: 9c f4 brge .+38 ; 0x19aee 19ac8: 82 30 cpi r24, 0x02 ; 2 19aca: 91 05 cpc r25, r1 19acc: 09 f4 brne .+2 ; 0x19ad0 19ace: 52 c0 rjmp .+164 ; 0x19b74 19ad0: 83 30 cpi r24, 0x03 ; 3 19ad2: 91 05 cpc r25, r1 19ad4: 09 f4 brne .+2 ; 0x19ad8 19ad6: 61 c0 rjmp .+194 ; 0x19b9a 19ad8: 01 96 adiw r24, 0x01 ; 1 19ada: 89 f4 brne .+34 ; 0x19afe * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 19adc: 88 ed ldi r24, 0xD8 ; 216 19ade: 98 e6 ldi r25, 0x68 ; 104 19ae0: 9f 93 push r25 19ae2: 8f 93 push r24 19ae4: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 19ae8: 0f 90 pop r0 19aea: 0f 90 pop r0 19aec: ff cf rjmp .-2 ; 0x19aec 19aee: 85 31 cpi r24, 0x15 ; 21 19af0: 91 05 cpc r25, r1 19af2: 09 f4 brne .+2 ; 0x19af6 19af4: 8d c0 rjmp .+282 ; 0x19c10 19af6: 94 f4 brge .+36 ; 0x19b1c 19af8: 44 97 sbiw r24, 0x14 ; 20 19afa: 09 f4 brne .+2 ; 0x19afe 19afc: 69 c0 rjmp .+210 ; 0x19bd0 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 19afe: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 19b02: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 19b06: 8d 57 subi r24, 0x7D ; 125 19b08: 9f 4e sbci r25, 0xEF ; 239 19b0a: 9f 93 push r25 19b0c: 8f 93 push r24 19b0e: 1f 92 push r1 19b10: 84 e4 ldi r24, 0x44 ; 68 19b12: 8f 93 push r24 19b14: 80 ed ldi r24, 0xD0 ; 208 19b16: 9a e6 ldi r25, 0x6A ; 106 19b18: 0c 94 09 9a jmp 0x13412 ; 0x13412 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 19b1c: 86 31 cpi r24, 0x16 ; 22 19b1e: 91 05 cpc r25, r1 19b20: 09 f4 brne .+2 ; 0x19b24 19b22: 9b c0 rjmp .+310 ; 0x19c5a 19b24: 86 34 cpi r24, 0x46 ; 70 19b26: 91 05 cpc r25, r1 19b28: 51 f7 brne .-44 ; 0x19afe #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 19b2a: 83 e5 ldi r24, 0x53 ; 83 19b2c: 0e 94 0d 5d call 0xba1a ; 0xba1a 19b30: 88 23 and r24, r24 19b32: 11 f4 brne .+4 ; 0x19b38 19b34: 0c 94 6e 98 jmp 0x130dc ; 0x130dc thermal_model_log_enable(code_value_short()); 19b38: 0e 94 ac 5c call 0xb958 ; 0xb958 19b3c: 11 e0 ldi r17, 0x01 ; 1 19b3e: 00 97 sbiw r24, 0x00 ; 0 19b40: 09 f4 brne .+2 ; 0x19b44 19b42: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 19b44: 89 2b or r24, r25 19b46: 91 f0 breq .+36 ; 0x19b6c TempMgrGuard temp_mgr_guard; 19b48: ce 01 movw r24, r28 19b4a: 01 96 adiw r24, 0x01 ; 1 19b4c: 0f 94 a8 46 call 0x28d50 ; 0x28d50 thermal_model::log_buf.entry.stamp = _millis(); 19b50: 0f 94 55 3e call 0x27caa ; 0x27caa 19b54: 60 93 1e 06 sts 0x061E, r22 ; 0x80061e <_ZN13thermal_modelL7log_bufE.lto_priv.555> 19b58: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x1> 19b5c: 80 93 20 06 sts 0x0620, r24 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x2> 19b60: 90 93 21 06 sts 0x0621, r25 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x3> #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { TempMgrGuard temp_mgr_guard; 19b64: ce 01 movw r24, r28 19b66: 01 96 adiw r24, 0x01 ; 1 19b68: 0f 94 9b 46 call 0x28d36 ; 0x28d36 thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 19b6c: 10 93 2e 06 sts 0x062E, r17 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x10> 19b70: 0c 94 6e 98 jmp 0x130dc ; 0x130dc - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 19b74: 43 ed ldi r20, 0xD3 ; 211 19b76: c4 2e mov r12, r20 19b78: 48 e6 ldi r20, 0x68 ; 104 19b7a: d4 2e mov r13, r20 19b7c: 52 e0 ldi r21, 0x02 ; 2 19b7e: e5 2e mov r14, r21 19b80: 00 e0 ldi r16, 0x00 ; 0 19b82: 20 e0 ldi r18, 0x00 ; 0 19b84: 32 e2 ldi r19, 0x22 ; 34 19b86: 40 e0 ldi r20, 0x00 ; 0 19b88: 50 e0 ldi r21, 0x00 ; 0 19b8a: 60 e0 ldi r22, 0x00 ; 0 19b8c: 72 e0 ldi r23, 0x02 ; 2 19b8e: 80 e0 ldi r24, 0x00 ; 0 19b90: 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")); 19b92: 0e 94 e9 63 call 0xc7d2 ; 0xc7d2 19b96: 0c 94 6e 98 jmp 0x130dc ; 0x130dc - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 19b9a: 2c ec ldi r18, 0xCC ; 204 19b9c: c2 2e mov r12, r18 19b9e: 28 e6 ldi r18, 0x68 ; 104 19ba0: d2 2e mov r13, r18 19ba2: 33 e0 ldi r19, 0x03 ; 3 19ba4: e3 2e mov r14, r19 19ba6: 01 e0 ldi r16, 0x01 ; 1 19ba8: 20 e0 ldi r18, 0x00 ; 0 19baa: 30 e1 ldi r19, 0x10 ; 16 19bac: 40 e0 ldi r20, 0x00 ; 0 19bae: 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")); 19bb0: 60 e0 ldi r22, 0x00 ; 0 19bb2: 70 e0 ldi r23, 0x00 ; 0 19bb4: cb 01 movw r24, r22 19bb6: ed cf rjmp .-38 ; 0x19b92 19bb8: 85 ec ldi r24, 0xC5 ; 197 19bba: c8 2e mov r12, r24 19bbc: 88 e6 ldi r24, 0x68 ; 104 19bbe: d8 2e mov r13, r24 19bc0: 96 e0 ldi r25, 0x06 ; 6 19bc2: e9 2e mov r14, r25 19bc4: 03 e0 ldi r16, 0x03 ; 3 19bc6: 20 e0 ldi r18, 0x00 ; 0 19bc8: 30 e0 ldi r19, 0x00 ; 0 19bca: 44 e0 ldi r20, 0x04 ; 4 19bcc: 50 e0 ldi r21, 0x00 ; 0 19bce: f0 cf rjmp .-32 ; 0x19bb0 #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 19bd0: 85 e4 ldi r24, 0x45 ; 69 19bd2: 0e 94 0d 5d call 0xba1a ; 0xba1a 19bd6: 88 23 and r24, r24 19bd8: 29 f0 breq .+10 ; 0x19be4 xfdump_full_dump_and_reset(); 19bda: 80 e0 ldi r24, 0x00 ; 0 19bdc: 0e 94 6e e3 call 0x1c6dc ; 0x1c6dc 19be0: 0c 94 6e 98 jmp 0x130dc ; 0x130dc else { unsigned long ts = _millis(); 19be4: 0f 94 55 3e call 0x27caa ; 0x27caa 19be8: 6b 01 movw r12, r22 19bea: 7c 01 movw r14, r24 xfdump_dump(); 19bec: 0e 94 9c e3 call 0x1c738 ; 0x1c738 ts = _millis() - ts; 19bf0: 0f 94 55 3e call 0x27caa ; 0x27caa 19bf4: dc 01 movw r26, r24 19bf6: cb 01 movw r24, r22 19bf8: 8c 19 sub r24, r12 19bfa: 9d 09 sbc r25, r13 19bfc: ae 09 sbc r26, r14 19bfe: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 19c00: bf 93 push r27 19c02: af 93 push r26 19c04: 9f 93 push r25 19c06: 8f 93 push r24 19c08: 8c ea ldi r24, 0xAC ; 172 19c0a: 98 e6 ldi r25, 0x68 ; 104 19c0c: 0c 94 09 9a jmp 0x13412 ; 0x13412 } } void dcode_21() { if(!xfdump_check_state()) 19c10: 90 e0 ldi r25, 0x00 ; 0 19c12: 80 e0 ldi r24, 0x00 ; 0 19c14: 0e 94 ba e2 call 0x1c574 ; 0x1c574 19c18: 81 11 cpse r24, r1 19c1a: 07 c0 rjmp .+14 ; 0x19c2a DBG(_N("no dump available\n")); 19c1c: 89 e9 ldi r24, 0x99 ; 153 19c1e: 98 e6 ldi r25, 0x68 ; 104 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19c20: 9f 93 push r25 19c22: 8f 93 push r24 19c24: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 19c28: 14 c0 rjmp .+40 ; 0x19c52 { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 19c2a: 81 e0 ldi r24, 0x01 ; 1 19c2c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D21 - read crash dump\n")); 19c30: 82 e8 ldi r24, 0x82 ; 130 19c32: 98 e6 ldi r25, 0x68 ; 104 19c34: 9f 93 push r25 19c36: 8f 93 push r24 19c38: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 19c3c: 03 e0 ldi r16, 0x03 ; 3 19c3e: 20 e0 ldi r18, 0x00 ; 0 19c40: 33 e2 ldi r19, 0x23 ; 35 19c42: 40 e0 ldi r20, 0x00 ; 0 19c44: 50 e0 ldi r21, 0x00 ; 0 19c46: 60 e0 ldi r22, 0x00 ; 0 19c48: 70 ed ldi r23, 0xD0 ; 208 19c4a: 83 e0 ldi r24, 0x03 ; 3 19c4c: 90 e0 ldi r25, 0x00 ; 0 19c4e: 0f 94 5a 85 call 0x30ab4 ; 0x30ab4 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19c52: 0f 90 pop r0 19c54: 0f 90 pop r0 19c56: 0c 94 6e 98 jmp 0x130dc ; 0x130dc } } void dcode_22() { if(!xfdump_check_state()) 19c5a: 90 e0 ldi r25, 0x00 ; 0 19c5c: 80 e0 ldi r24, 0x00 ; 0 19c5e: 0e 94 ba e2 call 0x1c574 ; 0x1c574 19c62: 81 11 cpse r24, r1 19c64: 03 c0 rjmp .+6 ; 0x19c6c DBG(_N("no dump available\n")); 19c66: 8f e6 ldi r24, 0x6F ; 111 19c68: 98 e6 ldi r25, 0x68 ; 104 19c6a: da cf rjmp .-76 ; 0x19c20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 19c6c: 8c e5 ldi r24, 0x5C ; 92 19c6e: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 19c70: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 19c72: 0e 94 f2 e2 call 0x1c5e4 ; 0x1c5e4 _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 19c76: 40 e0 ldi r20, 0x00 ; 0 19c78: 50 ed ldi r21, 0xD0 ; 208 19c7a: 63 e0 ldi r22, 0x03 ; 3 19c7c: 70 e0 ldi r23, 0x00 ; 0 19c7e: 80 e2 ldi r24, 0x20 ; 32 19c80: 0e 94 74 e2 call 0x1c4e8 ; 0x1c4e8 xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 19c84: 0e 94 56 e2 call 0x1c4ac ; 0x1c4ac else { xfdump_reset(); DBG(_N("dump cleared\n")); 19c88: 81 e6 ldi r24, 0x61 ; 97 19c8a: 98 e6 ldi r25, 0x68 ; 104 19c8c: c9 cf rjmp .-110 ; 0x19c20 } } else { SERIAL_ECHO_START; 19c8e: 84 e1 ldi r24, 0x14 ; 20 19c90: 9b ea ldi r25, 0xAB ; 171 19c92: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 19c96: 81 e6 ldi r24, 0x61 ; 97 19c98: 99 e6 ldi r25, 0x69 ; 105 19c9a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19c9e: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 19ca2: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 19ca6: 8d 57 subi r24, 0x7D ; 125 19ca8: 9f 4e sbci r25, 0xEF ; 239 19caa: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_ECHOLNPGM("\"(2)"); 19cae: 81 e2 ldi r24, 0x21 ; 33 19cb0: 97 e8 ldi r25, 0x87 ; 135 19cb2: 0c 94 79 9a jmp 0x134f2 ; 0x134f2 #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 19cb6: 2d ec ldi r18, 0xCD ; 205 19cb8: 3c ec ldi r19, 0xCC ; 204 19cba: 4c ec ldi r20, 0xCC ; 204 19cbc: 5d e3 ldi r21, 0x3D ; 61 19cbe: c7 01 movw r24, r14 19cc0: b6 01 movw r22, r12 19cc2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 19cc6: 18 16 cp r1, r24 19cc8: 14 f4 brge .+4 ; 0x19cce 19cca: 0c 94 b6 9b jmp 0x1376c ; 0x1376c 19cce: 0c 94 24 9d jmp 0x13a48 ; 0x13a48 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; 19cd2: a3 01 movw r20, r6 19cd4: 92 01 movw r18, r4 19cd6: 62 2d mov r22, r2 19cd8: 73 2d mov r23, r3 19cda: 8e 2d mov r24, r14 19cdc: 9f 2d mov r25, r15 19cde: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 19ce2: 18 16 cp r1, r24 19ce4: 14 f0 brlt .+4 ; 0x19cea 19ce6: 0c 94 05 a5 jmp 0x14a0a ; 0x14a0a 19cea: e5 e0 ldi r30, 0x05 ; 5 19cec: ce 0e add r12, r30 19cee: d1 1c adc r13, r1 19cf0: f2 e0 ldi r31, 0x02 ; 2 19cf2: 8f 0e add r8, r31 19cf4: 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; 19cf6: 85 01 movw r16, r10 19cf8: 0c 94 cc a4 jmp 0x14998 ; 0x14998 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 19cfc: 67 96 adiw r28, 0x17 ; 23 19cfe: 2f ad ldd r18, Y+63 ; 0x3f 19d00: 67 97 sbiw r28, 0x17 ; 23 19d02: 8b 2d mov r24, r11 19d04: 23 30 cpi r18, 0x03 ; 3 19d06: 29 f0 breq .+10 ; 0x19d12 19d08: 91 e0 ldi r25, 0x01 ; 1 19d0a: 04 30 cpi r16, 0x04 ; 4 19d0c: 11 05 cpc r17, r1 19d0e: 09 f4 brne .+2 ; 0x19d12 19d10: b3 cc rjmp .-1690 ; 0x19678 19d12: 90 e0 ldi r25, 0x00 ; 0 19d14: b1 cc rjmp .-1694 ; 0x19678 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)); 19d16: 86 ea ldi r24, 0xA6 ; 166 19d18: 99 e3 ldi r25, 0x39 ; 57 19d1a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 19d1e: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_puts_at_P(0, 2, PSTR("")); 19d22: 44 e8 ldi r20, 0x84 ; 132 19d24: 56 e8 ldi r21, 0x86 ; 134 19d26: 62 e0 ldi r22, 0x02 ; 2 19d28: 80 e0 ldi r24, 0x00 ; 0 19d2a: 0e 94 3a 70 call 0xe074 ; 0xe074 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 19d2e: f8 01 movw r30, r16 19d30: 81 91 ld r24, Z+ 19d32: 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'; 19d34: 98 2f mov r25, r24 19d36: 9f 7d andi r25, 0xDF ; 223 19d38: 11 f4 brne .+4 ; 0x19d3e 19d3a: 0c 94 14 b3 jmp 0x16628 ; 0x16628 19d3e: 97 ef ldi r25, 0xF7 ; 247 19d40: 98 0f add r25, r24 19d42: 92 30 cpi r25, 0x02 ; 2 19d44: 10 f4 brcc .+4 ; 0x19d4a 19d46: 0c 94 14 b3 jmp 0x16628 ; 0x16628 19d4a: 8d 30 cpi r24, 0x0D ; 13 19d4c: 11 f4 brne .+4 ; 0x19d52 19d4e: 0c 94 14 b3 jmp 0x16628 ; 0x16628 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); 19d52: 0e 94 15 70 call 0xe02a ; 0xe02a 19d56: eb cf rjmp .-42 ; 0x19d2e 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; 19d58: ce 01 movw r24, r28 19d5a: 01 96 adiw r24, 0x01 ; 1 19d5c: 0f 94 a8 46 call 0x28d50 ; 0x28d50 19d60: 0c 94 48 b9 jmp 0x17290 ; 0x17290 00019d64 : uint8_t check_pinda_0() { return _PINDA?0:1; } 19d64: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 19d68: 90 91 f7 03 lds r25, 0x03F7 ; 0x8003f7 19d6c: 08 95 ret 00019d6e : 19d6e: 81 50 subi r24, 0x01 ; 1 19d70: 82 31 cpi r24, 0x12 ; 18 19d72: 08 f0 brcs .+2 ; 0x19d76 19d74: 5a c0 rjmp .+180 ; 0x19e2a 19d76: e8 2f mov r30, r24 19d78: f0 e0 ldi r31, 0x00 ; 0 19d7a: 88 27 eor r24, r24 19d7c: ed 53 subi r30, 0x3D ; 61 19d7e: f1 43 sbci r31, 0x31 ; 49 19d80: 8f 4f sbci r24, 0xFF ; 255 19d82: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 19d86: e3 ce rjmp .-570 ; 0x19b4e 19d88: e7 ce rjmp .-562 ; 0x19b58 19d8a: d5 ce rjmp .-598 ; 0x19b36 19d8c: db ce rjmp .-586 ; 0x19b44 19d8e: df ce rjmp .-578 ; 0x19b4e 19d90: 15 cf rjmp .-470 ; 0x19bbc 19d92: ea ce rjmp .-556 ; 0x19b68 19d94: f0 ce rjmp .-544 ; 0x19b76 19d96: f4 ce rjmp .-536 ; 0x19b80 19d98: fa ce rjmp .-524 ; 0x19b8e 19d9a: fe ce rjmp .-516 ; 0x19b98 19d9c: 02 cf rjmp .-508 ; 0x19ba2 19d9e: 08 cf rjmp .-496 ; 0x19bb0 19da0: 0c cf rjmp .-488 ; 0x19bba 19da2: 15 cf rjmp .-470 ; 0x19bce 19da4: 10 cf rjmp .-480 ; 0x19bc6 19da6: 16 cf rjmp .-468 ; 0x19bd4 19da8: 1a cf rjmp .-460 ; 0x19bde 19daa: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19dae: 8f 77 andi r24, 0x7F ; 127 19db0: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19db4: 08 95 ret 19db6: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19dba: 8f 7d andi r24, 0xDF ; 223 19dbc: f9 cf rjmp .-14 ; 0x19db0 19dbe: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19dc2: 87 7f andi r24, 0xF7 ; 247 19dc4: f5 cf rjmp .-22 ; 0x19db0 19dc6: 84 b5 in r24, 0x24 ; 36 19dc8: 8f 77 andi r24, 0x7F ; 127 19dca: 84 bd out 0x24, r24 ; 36 19dcc: 08 95 ret 19dce: 84 b5 in r24, 0x24 ; 36 19dd0: 8f 7d andi r24, 0xDF ; 223 19dd2: fb cf rjmp .-10 ; 0x19dca 19dd4: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19dd8: 8f 77 andi r24, 0x7F ; 127 19dda: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19dde: 08 95 ret 19de0: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19de4: 8f 7d andi r24, 0xDF ; 223 19de6: f9 cf rjmp .-14 ; 0x19dda 19de8: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19dec: 8f 77 andi r24, 0x7F ; 127 19dee: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19df2: 08 95 ret 19df4: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19df8: 8f 7d andi r24, 0xDF ; 223 19dfa: f9 cf rjmp .-14 ; 0x19dee 19dfc: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19e00: 87 7f andi r24, 0xF7 ; 247 19e02: f5 cf rjmp .-22 ; 0x19dee 19e04: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19e08: 8f 77 andi r24, 0x7F ; 127 19e0a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19e0e: 08 95 ret 19e10: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19e14: 8f 7d andi r24, 0xDF ; 223 19e16: f9 cf rjmp .-14 ; 0x19e0a 19e18: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19e1c: 87 7f andi r24, 0xF7 ; 247 19e1e: f5 cf rjmp .-22 ; 0x19e0a 19e20: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19e24: 8f 77 andi r24, 0x7F ; 127 19e26: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19e2a: 08 95 ret 19e2c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19e30: 8f 7d andi r24, 0xDF ; 223 19e32: f9 cf rjmp .-14 ; 0x19e26 19e34: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19e38: 87 7f andi r24, 0xF7 ; 247 19e3a: f5 cf rjmp .-22 ; 0x19e26 00019e3c : 19e3c: 83 b1 in r24, 0x03 ; 3 19e3e: 82 95 swap r24 19e40: 81 70 andi r24, 0x01 ; 1 19e42: 08 95 ret 00019e44 : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19e44: cf 92 push r12 19e46: df 92 push r13 19e48: ef 92 push r14 19e4a: 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; 19e4c: 20 91 f8 03 lds r18, 0x03F8 ; 0x8003f8 19e50: b0 e0 ldi r27, 0x00 ; 0 19e52: a0 e0 ldi r26, 0x00 ; 0 19e54: c0 90 61 07 lds r12, 0x0761 ; 0x800761 19e58: d0 90 62 07 lds r13, 0x0762 ; 0x800762 19e5c: e0 90 63 07 lds r14, 0x0763 ; 0x800763 19e60: f0 90 64 07 lds r15, 0x0764 ; 0x800764 19e64: 20 ff sbrs r18, 0 19e66: 42 c0 rjmp .+132 ; 0x19eec 19e68: c8 1a sub r12, r24 19e6a: d9 0a sbc r13, r25 19e6c: ea 0a sbc r14, r26 19e6e: fb 0a sbc r15, r27 19e70: c0 92 61 07 sts 0x0761, r12 ; 0x800761 19e74: d0 92 62 07 sts 0x0762, r13 ; 0x800762 19e78: e0 92 63 07 sts 0x0763, r14 ; 0x800763 19e7c: f0 92 64 07 sts 0x0764, r15 ; 0x800764 19e80: cb 01 movw r24, r22 19e82: b0 e0 ldi r27, 0x00 ; 0 19e84: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19e86: c0 90 65 07 lds r12, 0x0765 ; 0x800765 19e8a: d0 90 66 07 lds r13, 0x0766 ; 0x800766 19e8e: e0 90 67 07 lds r14, 0x0767 ; 0x800767 19e92: f0 90 68 07 lds r15, 0x0768 ; 0x800768 19e96: 21 ff sbrs r18, 1 19e98: 36 c0 rjmp .+108 ; 0x19f06 19e9a: c8 1a sub r12, r24 19e9c: d9 0a sbc r13, r25 19e9e: ea 0a sbc r14, r26 19ea0: fb 0a sbc r15, r27 19ea2: c0 92 65 07 sts 0x0765, r12 ; 0x800765 19ea6: d0 92 66 07 sts 0x0766, r13 ; 0x800766 19eaa: e0 92 67 07 sts 0x0767, r14 ; 0x800767 19eae: f0 92 68 07 sts 0x0768, r15 ; 0x800768 19eb2: 70 e0 ldi r23, 0x00 ; 0 19eb4: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19eb6: 80 91 69 07 lds r24, 0x0769 ; 0x800769 19eba: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 19ebe: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 19ec2: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 19ec6: 22 ff sbrs r18, 2 19ec8: 2b c0 rjmp .+86 ; 0x19f20 19eca: 84 1b sub r24, r20 19ecc: 95 0b sbc r25, r21 19ece: a6 0b sbc r26, r22 19ed0: b7 0b sbc r27, r23 19ed2: 80 93 69 07 sts 0x0769, r24 ; 0x800769 19ed6: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 19eda: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 19ede: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 19ee2: ff 90 pop r15 19ee4: ef 90 pop r14 19ee6: df 90 pop r13 19ee8: cf 90 pop r12 19eea: 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; 19eec: 8c 0d add r24, r12 19eee: 9d 1d adc r25, r13 19ef0: ae 1d adc r26, r14 19ef2: bf 1d adc r27, r15 19ef4: 80 93 61 07 sts 0x0761, r24 ; 0x800761 19ef8: 90 93 62 07 sts 0x0762, r25 ; 0x800762 19efc: a0 93 63 07 sts 0x0763, r26 ; 0x800763 19f00: b0 93 64 07 sts 0x0764, r27 ; 0x800764 19f04: bd cf rjmp .-134 ; 0x19e80 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 19f06: 8c 0d add r24, r12 19f08: 9d 1d adc r25, r13 19f0a: ae 1d adc r26, r14 19f0c: bf 1d adc r27, r15 19f0e: 80 93 65 07 sts 0x0765, r24 ; 0x800765 19f12: 90 93 66 07 sts 0x0766, r25 ; 0x800766 19f16: a0 93 67 07 sts 0x0767, r26 ; 0x800767 19f1a: b0 93 68 07 sts 0x0768, r27 ; 0x800768 19f1e: c9 cf rjmp .-110 ; 0x19eb2 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 19f20: 84 0f add r24, r20 19f22: 95 1f adc r25, r21 19f24: a6 1f adc r26, r22 19f26: b7 1f adc r27, r23 19f28: d4 cf rjmp .-88 ; 0x19ed2 00019f2a : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 19f2a: fb 01 movw r30, r22 *v = 0; 19f2c: 11 82 std Z+1, r1 ; 0x01 19f2e: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 19f30: 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'; 19f32: dc 01 movw r26, r24 19f34: 2c 91 ld r18, X 19f36: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 19f38: 2a 30 cpi r18, 0x0A ; 10 19f3a: a0 f4 brcc .+40 ; 0x19f64 *v *= 10; 19f3c: 40 81 ld r20, Z 19f3e: 51 81 ldd r21, Z+1 ; 0x01 19f40: 64 9f mul r22, r20 19f42: 90 01 movw r18, r0 19f44: 65 9f mul r22, r21 19f46: 30 0d add r19, r0 19f48: 11 24 eor r1, r1 19f4a: 31 83 std Z+1, r19 ; 0x01 19f4c: 20 83 st Z, r18 *v += *str - '0'; 19f4e: 4d 91 ld r20, X+ 19f50: cd 01 movw r24, r26 19f52: 20 53 subi r18, 0x30 ; 48 19f54: 31 09 sbc r19, r1 19f56: 24 0f add r18, r20 19f58: 31 1d adc r19, r1 19f5a: 47 fd sbrc r20, 7 19f5c: 3a 95 dec r19 19f5e: 31 83 std Z+1, r19 ; 0x01 19f60: 20 83 st Z, r18 19f62: e7 cf rjmp .-50 ; 0x19f32 ++str; } return str; } 19f64: 08 95 ret 00019f66 : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 19f66: 85 e0 ldi r24, 0x05 ; 5 19f68: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 lcd_return_to_status(); 19f6c: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00019f70 : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 19f70: 83 ee ldi r24, 0xE3 ; 227 19f72: 9c e6 ldi r25, 0x6C ; 108 19f74: 0e 94 97 7b call 0xf72e ; 0xf72e lcd_return_to_status(); 19f78: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00019f7c : //! 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) { 19f7c: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 19f80: 81 30 cpi r24, 0x01 ; 1 19f82: 21 f4 brne .+8 ; 0x19f8c SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 19f84: 86 e3 ldi r24, 0x36 ; 54 19f86: 9c e6 ldi r25, 0x6C ; 108 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 19f88: 0c 94 97 7b jmp 0xf72e ; 0xf72e 19f8c: 87 e2 ldi r24, 0x27 ; 39 19f8e: 9c e6 ldi r25, 0x6C ; 108 19f90: fb cf rjmp .-10 ; 0x19f88 00019f92 : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 19f92: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 19f96: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d #endif manage_heater(); 19f9a: 0d 94 66 4d jmp 0x29acc ; 0x29acc 00019f9e : 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, 19f9e: 1f 93 push r17 19fa0: cf 93 push r28 19fa2: df 93 push r29 19fa4: c8 2f mov r28, r24 19fa6: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 19fa8: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 19fac: 82 ea ldi r24, 0xA2 ; 162 19fae: 94 e4 ldi r25, 0x44 ; 68 19fb0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 19fb4: ac 01 movw r20, r24 19fb6: 60 e0 ldi r22, 0x00 ; 0 19fb8: 80 e0 ldi r24, 0x00 ; 0 19fba: 0e 94 3a 70 call 0xe074 ; 0xe074 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)); 19fbe: 88 e3 ldi r24, 0x38 ; 56 19fc0: 95 e4 ldi r25, 0x45 ; 69 19fc2: c1 11 cpse r28, r1 19fc4: 02 c0 rjmp .+4 ; 0x19fca 19fc6: 8b e4 ldi r24, 0x4B ; 75 19fc8: 95 e4 ldi r25, 0x45 ; 69 19fca: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 19fce: ac 01 movw r20, r24 19fd0: 61 e0 ldi r22, 0x01 ; 1 19fd2: 80 e0 ldi r24, 0x00 ; 0 19fd4: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_selftest_setfan(255); 19fd8: 8f ef ldi r24, 0xFF ; 255 19fda: 0e 94 c9 cf call 0x19f92 ; 0x19f92 break; } _delay(500); 19fde: 64 ef ldi r22, 0xF4 ; 244 19fe0: 71 e0 ldi r23, 0x01 ; 1 19fe2: 80 e0 ldi r24, 0x00 ; 0 19fe4: 90 e0 ldi r25, 0x00 ; 0 19fe6: 0f 94 5c 3c call 0x278b8 ; 0x278b8 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 19fea: 87 e9 ldi r24, 0x97 ; 151 19fec: 94 e4 ldi r25, 0x44 ; 68 19fee: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 19ff2: ac 01 movw r20, r24 19ff4: 62 e0 ldi r22, 0x02 ; 2 19ff6: 81 e0 ldi r24, 0x01 ; 1 19ff8: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_putc_at(0, 3, '>'); 19ffc: 4e e3 ldi r20, 0x3E ; 62 19ffe: 63 e0 ldi r22, 0x03 ; 3 1a000: 80 e0 ldi r24, 0x00 ; 0 1a002: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 1a006: 88 e8 ldi r24, 0x88 ; 136 1a008: 94 e4 ldi r25, 0x44 ; 68 1a00a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a00e: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_encoder = _default; 1a012: 6d 2f mov r22, r29 1a014: 70 e0 ldi r23, 0x00 ; 0 1a016: 70 93 35 05 sts 0x0535, r23 ; 0x800535 1a01a: 60 93 34 05 sts 0x0534, r22 ; 0x800534 KEEPALIVE_STATE(PAUSED_FOR_USER); 1a01e: 84 e0 ldi r24, 0x04 ; 4 1a020: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 1a024: 0e 94 3e 72 call 0xe47c ; 0xe47c 1a028: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 1a02a: 11 e0 ldi r17, 0x01 ; 1 1a02c: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 1a02e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1a032: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1a036: 00 97 sbiw r24, 0x00 ; 0 1a038: 19 f1 breq .+70 ; 0x1a080 if (lcd_encoder < 0) { 1a03a: 97 ff sbrs r25, 7 1a03c: 0b c0 rjmp .+22 ; 0x1a054 _result = !check_opposite; 1a03e: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 1a040: 4e e3 ldi r20, 0x3E ; 62 1a042: 62 e0 ldi r22, 0x02 ; 2 1a044: 80 e0 ldi r24, 0x00 ; 0 1a046: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_putc_at(0, 3, ' '); 1a04a: 40 e2 ldi r20, 0x20 ; 32 1a04c: 63 e0 ldi r22, 0x03 ; 3 1a04e: 80 e0 ldi r24, 0x00 ; 0 1a050: 0e 94 46 70 call 0xe08c ; 0xe08c } if (lcd_encoder > 0) { 1a054: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1a058: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1a05c: 18 16 cp r1, r24 1a05e: 19 06 cpc r1, r25 1a060: 5c f4 brge .+22 ; 0x1a078 _result = check_opposite; lcd_putc_at(0, 2, ' '); 1a062: 40 e2 ldi r20, 0x20 ; 32 1a064: 62 e0 ldi r22, 0x02 ; 2 1a066: 80 e0 ldi r24, 0x00 ; 0 1a068: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_putc_at(0, 3, '>'); 1a06c: 4e e3 ldi r20, 0x3E ; 62 1a06e: 63 e0 ldi r22, 0x03 ; 3 1a070: 80 e0 ldi r24, 0x00 ; 0 1a072: 0e 94 46 70 call 0xe08c ; 0xe08c 1a076: dc 2f mov r29, r28 } lcd_encoder = 0; 1a078: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1a07c: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } manage_heater(); 1a080: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 1a084: 81 e0 ldi r24, 0x01 ; 1 1a086: 0e 94 6b 8c call 0x118d6 ; 0x118d6 _delay(100); 1a08a: 64 e6 ldi r22, 0x64 ; 100 1a08c: 70 e0 ldi r23, 0x00 ; 0 1a08e: 80 e0 ldi r24, 0x00 ; 0 1a090: 90 e0 ldi r25, 0x00 ; 0 1a092: 0f 94 5c 3c call 0x278b8 ; 0x278b8 } while (!lcd_clicked()); 1a096: 0e 94 43 72 call 0xe486 ; 0xe486 1a09a: 88 23 and r24, r24 1a09c: 41 f2 breq .-112 ; 0x1a02e KEEPALIVE_STATE(IN_HANDLER); 1a09e: 82 e0 ldi r24, 0x02 ; 2 1a0a0: 80 93 96 02 sts 0x0296, r24 ; 0x800296 setExtruderAutoFanState(0); // Turn off hotend fan 1a0a4: 80 e0 ldi r24, 0x00 ; 0 1a0a6: 0e 94 62 77 call 0xeec4 ; 0xeec4 lcd_selftest_setfan(0); // Turn off print fan 1a0aa: 80 e0 ldi r24, 0x00 ; 0 1a0ac: 0e 94 c9 cf call 0x19f92 ; 0x19f92 return _result; } 1a0b0: 8d 2f mov r24, r29 1a0b2: df 91 pop r29 1a0b4: cf 91 pop r28 1a0b6: 1f 91 pop r17 1a0b8: 08 95 ret 0001a0ba : #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) { 1a0ba: cf 93 push r28 1a0bc: df 93 push r29 1a0be: c8 2f mov r28, r24 1a0c0: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 1a0c2: c1 50 subi r28, 0x01 ; 1 1a0c4: 98 f0 brcs .+38 ; 0x1a0ec for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1a0c6: 4d e2 ldi r20, 0x2D ; 45 1a0c8: 6d 2f mov r22, r29 1a0ca: 82 e1 ldi r24, 0x12 ; 18 1a0cc: 0e 94 46 70 call 0xe08c ; 0xe08c delay_keep_alive(1000 / sizeof(symbols)); 1a0d0: 84 ef ldi r24, 0xF4 ; 244 1a0d2: 91 e0 ldi r25, 0x01 ; 1 1a0d4: 0e 94 10 8f call 0x11e20 ; 0x11e20 // 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]); 1a0d8: 4c e7 ldi r20, 0x7C ; 124 1a0da: 6d 2f mov r22, r29 1a0dc: 82 e1 ldi r24, 0x12 ; 18 1a0de: 0e 94 46 70 call 0xe08c ; 0xe08c delay_keep_alive(1000 / sizeof(symbols)); 1a0e2: 84 ef ldi r24, 0xF4 ; 244 1a0e4: 91 e0 ldi r25, 0x01 ; 1 1a0e6: 0e 94 10 8f call 0x11e20 ; 0x11e20 1a0ea: eb cf rjmp .-42 ; 0x1a0c2 } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1a0ec: 0f 94 55 3e call 0x27caa ; 0x27caa 1a0f0: 60 93 99 17 sts 0x1799, r22 ; 0x801799 1a0f4: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 1a0f8: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 1a0fc: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c #endif fan_measuring = true; 1a100: 81 e0 ldi r24, 0x01 ; 1 1a102: 80 93 33 05 sts 0x0533, r24 ; 0x800533 while(fan_measuring) { 1a106: 80 91 33 05 lds r24, 0x0533 ; 0x800533 1a10a: 88 23 and r24, r24 1a10c: 29 f0 breq .+10 ; 0x1a118 delay_keep_alive(100); 1a10e: 84 e6 ldi r24, 0x64 ; 100 1a110: 90 e0 ldi r25, 0x00 ; 0 1a112: 0e 94 10 8f call 0x11e20 ; 0x11e20 1a116: f7 cf rjmp .-18 ; 0x1a106 } gcode_M123(); } 1a118: df 91 pop r29 1a11a: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 1a11c: 0c 94 ca 67 jmp 0xcf94 ; 0xcf94 0001a120 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 1a120: cf 93 push r28 1a122: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1a124: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 1a128: c0 e4 ldi r28, 0x40 ; 64 1a12a: 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)); 1a12c: 60 91 72 13 lds r22, 0x1372 ; 0x801372 1a130: 70 e0 ldi r23, 0x00 ; 0 1a132: 90 e0 ldi r25, 0x00 ; 0 1a134: 80 e0 ldi r24, 0x00 ; 0 1a136: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1a13a: 9b 01 movw r18, r22 1a13c: ac 01 movw r20, r24 1a13e: 6c 85 ldd r22, Y+12 ; 0x0c 1a140: 7d 85 ldd r23, Y+13 ; 0x0d 1a142: 8e 85 ldd r24, Y+14 ; 0x0e 1a144: 9f 85 ldd r25, Y+15 ; 0x0f 1a146: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1a14a: 6c 87 std Y+12, r22 ; 0x0c 1a14c: 7d 87 std Y+13, r23 ; 0x0d 1a14e: 8e 87 std Y+14, r24 ; 0x0e 1a150: 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])); 1a152: 62 e0 ldi r22, 0x02 ; 2 1a154: 85 e9 ldi r24, 0x95 ; 149 1a156: 91 e9 ldi r25, 0x91 ; 145 } 1a158: df 91 pop r29 1a15a: 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])); 1a15c: 0d 94 ab 87 jmp 0x30f56 ; 0x30f56 0001a160 : 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) { 1a160: 0f 93 push r16 1a162: 1f 93 push r17 1a164: cf 93 push r28 1a166: df 93 push r29 1a168: 98 2f mov r25, r24 1a16a: 86 2f mov r24, r22 1a16c: 14 2f mov r17, r20 1a16e: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a170: 69 2f mov r22, r25 1a172: 0e 94 26 70 call 0xe04c ; 0xe04c switch (_state) 1a176: 11 30 cpi r17, 0x01 ; 1 1a178: 21 f0 breq .+8 ; 0x1a182 1a17a: 12 30 cpi r17, 0x02 ; 2 1a17c: 79 f0 breq .+30 ; 0x1a19c lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a17e: ce 01 movw r24, r28 1a180: 15 c0 rjmp .+42 ; 0x1a1ac { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a182: ce 01 movw r24, r28 1a184: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_putc(':'); 1a188: 8a e3 ldi r24, 0x3A ; 58 1a18a: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_putc(_indicator); 1a18e: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a190: df 91 pop r29 1a192: cf 91 pop r28 1a194: 1f 91 pop r17 1a196: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a198: 0c 94 15 70 jmp 0xe02a ; 0xe02a break; case 2: lcd_puts_P(_name_PROGMEM); 1a19c: ce 01 movw r24, r28 1a19e: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_putc(':'); 1a1a2: 8a e3 ldi r24, 0x3A ; 58 1a1a4: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_puts_P(MSG_OK_CAPS); 1a1a8: 81 e9 ldi r24, 0x91 ; 145 1a1aa: 9c e6 ldi r25, 0x6C ; 108 break; default: lcd_puts_P(_name_PROGMEM); } } 1a1ac: df 91 pop r29 1a1ae: cf 91 pop r28 1a1b0: 1f 91 pop r17 1a1b2: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a1b4: 0c 94 11 70 jmp 0xe022 ; 0xe022 0001a1b8 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 1a1b8: df 92 push r13 1a1ba: ef 92 push r14 1a1bc: ff 92 push r15 1a1be: 0f 93 push r16 1a1c0: 1f 93 push r17 1a1c2: cf 93 push r28 1a1c4: df 93 push r29 1a1c6: cd b7 in r28, 0x3d ; 61 1a1c8: de b7 in r29, 0x3e ; 62 1a1ca: 63 97 sbiw r28, 0x13 ; 19 1a1cc: 0f b6 in r0, 0x3f ; 63 1a1ce: f8 94 cli 1a1d0: de bf out 0x3e, r29 ; 62 1a1d2: 0f be out 0x3f, r0 ; 63 1a1d4: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1a1d6: 30 91 15 05 lds r19, 0x0515 ; 0x800515 1a1da: 20 91 14 05 lds r18, 0x0514 ; 0x800514 1a1de: 32 13 cpse r19, r18 1a1e0: 73 c0 rjmp .+230 ; 0x1a2c8 1a1e2: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 1a1e4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a1e8: 88 23 and r24, r24 1a1ea: 09 f4 brne .+2 ; 0x1a1ee 1a1ec: 45 c0 rjmp .+138 ; 0x1a278 //! //! @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)); 1a1ee: 80 e8 ldi r24, 0x80 ; 128 1a1f0: 94 e4 ldi r25, 0x44 ; 68 1a1f2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a1f6: 9f 93 push r25 1a1f8: 8f 93 push r24 1a1fa: 84 e5 ldi r24, 0x54 ; 84 1a1fc: 91 e9 ldi r25, 0x91 ; 145 1a1fe: 9f 93 push r25 1a200: 8f 93 push r24 1a202: 8e 01 movw r16, r28 1a204: 0f 5f subi r16, 0xFF ; 255 1a206: 1f 4f sbci r17, 0xFF ; 255 1a208: 1f 93 push r17 1a20a: 0f 93 push r16 1a20c: 0f 94 26 dc call 0x3b84c ; 0x3b84c 1a210: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 1a212: 47 e0 ldi r20, 0x07 ; 7 1a214: 50 e0 ldi r21, 0x00 ; 0 1a216: b7 01 movw r22, r14 1a218: 80 0f add r24, r16 1a21a: 91 2f mov r25, r17 1a21c: 91 1d adc r25, r1 1a21e: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe 1a222: 0f 90 pop r0 1a224: 0f 90 pop r0 1a226: 0f 90 pop r0 1a228: 0f 90 pop r0 1a22a: 0f 90 pop r0 1a22c: 0f 90 pop r0 1a22e: 20 e0 ldi r18, 0x00 ; 0 1a230: 82 2f mov r24, r18 1a232: 8d 0d add r24, r13 1a234: 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) 1a236: 27 30 cpi r18, 0x07 ; 7 1a238: 39 f0 breq .+14 ; 0x1a248 1a23a: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 1a23c: f8 01 movw r30, r16 1a23e: e8 0f add r30, r24 1a240: f9 1f adc r31, r25 1a242: 30 81 ld r19, Z 1a244: 31 11 cpse r19, r1 1a246: f4 cf rjmp .-24 ; 0x1a230 } buffer.c[index] = ']'; 1a248: f8 01 movw r30, r16 1a24a: e8 0f add r30, r24 1a24c: f9 1f adc r31, r25 1a24e: 2d e5 ldi r18, 0x5D ; 93 1a250: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 1a252: 8c 0f add r24, r28 1a254: 9d 1f adc r25, r29 1a256: fc 01 movw r30, r24 1a258: 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()); 1a25a: 0f 94 50 cd call 0x39aa0 ; 0x39aa0 1a25e: 48 2f mov r20, r24 1a260: 60 91 12 05 lds r22, 0x0512 ; 0x800512 1a264: 80 e0 ldi r24, 0x00 ; 0 1a266: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_print_pad(buffer.c, LCD_WIDTH - 2); 1a26a: 62 e1 ldi r22, 0x12 ; 18 1a26c: c8 01 movw r24, r16 1a26e: 0e 94 15 72 call 0xe42a ; 0xe42a lcd_putc(type_char); 1a272: 80 e2 ldi r24, 0x20 ; 32 1a274: 0e 94 15 70 call 0xe02a ; 0xe02a 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)) 1a278: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a27c: 88 23 and r24, r24 1a27e: 21 f1 breq .+72 ; 0x1a2c8 1a280: 20 91 15 05 lds r18, 0x0515 ; 0x800515 1a284: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1a288: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1a28c: 28 17 cp r18, r24 1a28e: 19 06 cpc r1, r25 1a290: d9 f4 brne .+54 ; 0x1a2c8 { lcd_update_enabled = 0; 1a292: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 1a296: 8f e7 ldi r24, 0x7F ; 127 1a298: 98 e7 ldi r25, 0x78 ; 120 1a29a: 89 2b or r24, r25 1a29c: 11 f0 breq .+4 ; 0x1a2a2 1a29e: 0e 94 7f 78 call 0xf0fe ; 0xf0fe lcd_update_enabled = 1; 1a2a2: 81 e0 ldi r24, 0x01 ; 1 1a2a4: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 1a2a8: 0f 94 74 cd call 0x39ae8 ; 0x39ae8 return; } } menu_item++; } 1a2ac: 63 96 adiw r28, 0x13 ; 19 1a2ae: 0f b6 in r0, 0x3f ; 63 1a2b0: f8 94 cli 1a2b2: de bf out 0x3e, r29 ; 62 1a2b4: 0f be out 0x3f, r0 ; 63 1a2b6: cd bf out 0x3d, r28 ; 61 1a2b8: df 91 pop r29 1a2ba: cf 91 pop r28 1a2bc: 1f 91 pop r17 1a2be: 0f 91 pop r16 1a2c0: ff 90 pop r15 1a2c2: ef 90 pop r14 1a2c4: df 90 pop r13 1a2c6: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 1a2c8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a2cc: 8f 5f subi r24, 0xFF ; 255 1a2ce: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a2d2: ec cf rjmp .-40 ; 0x1a2ac 0001a2d4 : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 1a2d4: cf 92 push r12 1a2d6: df 92 push r13 1a2d8: ef 92 push r14 1a2da: ff 92 push r15 1a2dc: 0f 93 push r16 1a2de: 1f 93 push r17 1a2e0: cf 93 push r28 1a2e2: df 93 push r29 1a2e4: 6c 01 movw r12, r24 1a2e6: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 1a2e8: c4 2f mov r28, r20 1a2ea: d0 e0 ldi r29, 0x00 ; 0 1a2ec: ae 01 movw r20, r28 1a2ee: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 1a2f2: 89 2b or r24, r25 1a2f4: b9 f4 brne .+46 ; 0x1a324 Number(str + tagSize, v); 1a2f6: b8 01 movw r22, r16 1a2f8: c6 01 movw r24, r12 1a2fa: 8c 0f add r24, r28 1a2fc: 9d 1f adc r25, r29 1a2fe: 0e 94 95 cf call 0x19f2a ; 0x19f2a *v |= tagMask; 1a302: f8 01 movw r30, r16 1a304: 20 81 ld r18, Z 1a306: 31 81 ldd r19, Z+1 ; 0x01 1a308: 2e 29 or r18, r14 1a30a: 3f 29 or r19, r15 1a30c: 31 83 std Z+1, r19 ; 0x01 1a30e: 20 83 st Z, r18 return true; 1a310: 81 e0 ldi r24, 0x01 ; 1 } return false; } 1a312: df 91 pop r29 1a314: cf 91 pop r28 1a316: 1f 91 pop r17 1a318: 0f 91 pop r16 1a31a: ff 90 pop r15 1a31c: ef 90 pop r14 1a31e: df 90 pop r13 1a320: cf 90 pop r12 1a322: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 1a324: 80 e0 ldi r24, 0x00 ; 0 1a326: f5 cf rjmp .-22 ; 0x1a312 0001a328 : } #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); 1a328: 87 ea ldi r24, 0xA7 ; 167 1a32a: 9c e0 ldi r25, 0x0C ; 12 1a32c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e if (value > 1) value = 1; 1a330: 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) 1a332: 82 30 cpi r24, 0x02 ; 2 1a334: 08 f4 brcc .+2 ; 0x1a338 1a336: 68 27 eor r22, r24 1a338: 87 ea ldi r24, 0xA7 ; 167 1a33a: 9c e0 ldi r25, 0x0C ; 12 1a33c: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0001a340 : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 1a340: cf 93 push r28 1a342: df 93 push r29 1a344: c5 e1 ldi r28, 0x15 ; 21 1a346: 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++)); 1a348: fe 01 movw r30, r28 1a34a: e0 5f subi r30, 0xF0 ; 240 1a34c: ff 47 sbci r31, 0x7F ; 127 1a34e: 64 91 lpm r22, Z 1a350: ce 01 movw r24, r28 1a352: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 1a356: 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++) { 1a358: c9 32 cpi r28, 0x29 ; 41 1a35a: 8d e0 ldi r24, 0x0D ; 13 1a35c: d8 07 cpc r29, r24 1a35e: a1 f7 brne .-24 ; 0x1a348 eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 1a360: df 91 pop r29 1a362: cf 91 pop r28 1a364: 08 95 ret 0001a366 : 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); 1a366: 8a ea ldi r24, 0xAA ; 170 1a368: 9d e0 ldi r25, 0x0D ; 13 1a36a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 1a36e: 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) { 1a370: 83 30 cpi r24, 0x03 ; 3 1a372: 21 f0 breq .+8 ; 0x1a37c case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 1a374: 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) { 1a376: 85 30 cpi r24, 0x05 ; 5 1a378: 09 f0 breq .+2 ; 0x1a37c case 1: mbl_z_probe_nr = 3; break; 1a37a: 63 e0 ldi r22, 0x03 ; 3 1a37c: 8a ea ldi r24, 0xAA ; 170 1a37e: 9d e0 ldi r25, 0x0D ; 13 1a380: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0001a384 : 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); 1a384: 8b ea ldi r24, 0xAB ; 171 1a386: 9d e0 ldi r25, 0x0D ; 13 1a388: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 1a38c: 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; 1a38e: 83 30 cpi r24, 0x03 ; 3 1a390: 09 f4 brne .+2 ; 0x1a394 1a392: 67 e0 ldi r22, 0x07 ; 7 1a394: 8b ea ldi r24, 0xAB ; 171 1a396: 9d e0 ldi r25, 0x0D ; 13 1a398: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0001a39c : #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); 1a39c: 8c ea ldi r24, 0xAC ; 172 1a39e: 9d e0 ldi r25, 0x0D ; 13 1a3a0: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e magnet_elimination = !magnet_elimination; 1a3a4: 61 e0 ldi r22, 0x01 ; 1 1a3a6: 81 11 cpse r24, r1 1a3a8: 60 e0 ldi r22, 0x00 ; 0 1a3aa: 8c ea ldi r24, 0xAC ; 172 1a3ac: 9d e0 ldi r25, 0x0D ; 13 1a3ae: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0001a3b2 : 1a3b2: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1a3b6: 81 ea ldi r24, 0xA1 ; 161 1a3b8: 9d e0 ldi r25, 0x0D ; 13 1a3ba: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 //! @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(); 1a3be: 0d 94 53 29 jmp 0x252a6 ; 0x252a6 0001a3c2 : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a3c2: 0f 93 push r16 1a3c4: 1f 93 push r17 1a3c6: cf 93 push r28 1a3c8: df 93 push r29 1a3ca: 00 d0 rcall .+0 ; 0x1a3cc 1a3cc: 00 d0 rcall .+0 ; 0x1a3ce 1a3ce: 1f 92 push r1 1a3d0: 1f 92 push r1 1a3d2: cd b7 in r28, 0x3d ; 61 1a3d4: de b7 in r29, 0x3e ; 62 1a3d6: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a3d8: 8a e0 ldi r24, 0x0A ; 10 1a3da: 90 e0 ldi r25, 0x00 ; 0 1a3dc: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 1a3e0: 9a 83 std Y+2, r25 ; 0x02 1a3e2: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a3e4: 8c e0 ldi r24, 0x0C ; 12 1a3e6: 90 e0 ldi r25, 0x00 ; 0 1a3e8: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 1a3ec: 9c 83 std Y+4, r25 ; 0x04 1a3ee: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a3f0: 8e e0 ldi r24, 0x0E ; 14 1a3f2: 90 e0 ldi r25, 0x00 ; 0 1a3f4: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 1a3f8: 9e 83 std Y+6, r25 ; 0x06 1a3fa: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a3fc: 80 e1 ldi r24, 0x10 ; 16 1a3fe: 90 e0 ldi r25, 0x00 ; 0 1a400: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 1a404: 98 87 std Y+8, r25 ; 0x08 1a406: 8f 83 std Y+7, r24 ; 0x07 1a408: c8 01 movw r24, r16 1a40a: de 01 movw r26, r28 1a40c: 11 96 adiw r26, 0x01 ; 1 1a40e: be 01 movw r22, r28 1a410: 67 5f subi r22, 0xF7 ; 247 1a412: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a414: fc 01 movw r30, r24 1a416: 25 91 lpm r18, Z+ 1a418: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a41a: 4d 91 ld r20, X+ 1a41c: 5d 91 ld r21, X+ 1a41e: 42 17 cp r20, r18 1a420: 53 07 cpc r21, r19 1a422: 48 f0 brcs .+18 ; 0x1a436 return true; else if (v < ver_eeprom[i]) 1a424: 24 17 cp r18, r20 1a426: 35 07 cpc r19, r21 1a428: 20 f0 brcs .+8 ; 0x1a432 1a42a: 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) { 1a42c: a6 17 cp r26, r22 1a42e: b7 07 cpc r27, r23 1a430: 89 f7 brne .-30 ; 0x1a414 return true; else if (v < ver_eeprom[i]) break; } return false; 1a432: 80 e0 ldi r24, 0x00 ; 0 1a434: 01 c0 rjmp .+2 ; 0x1a438 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; 1a436: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a438: 28 96 adiw r28, 0x08 ; 8 1a43a: 0f b6 in r0, 0x3f ; 63 1a43c: f8 94 cli 1a43e: de bf out 0x3e, r29 ; 62 1a440: 0f be out 0x3f, r0 ; 63 1a442: cd bf out 0x3d, r28 ; 61 1a444: df 91 pop r29 1a446: cf 91 pop r28 1a448: 1f 91 pop r17 1a44a: 0f 91 pop r16 1a44c: 08 95 ret 0001a44e : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1a44e: 0e 94 97 8a call 0x1152e ; 0x1152e // M24: Start/resume SD print enquecommand_P(MSG_M24); 1a452: 61 e0 ldi r22, 0x01 ; 1 1a454: 8d ec ldi r24, 0xCD ; 205 1a456: 91 e7 ldi r25, 0x71 ; 113 1a458: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_return_to_status(); 1a45c: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 0001a460 : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a460: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a462: 82 ec ldi r24, 0xC2 ; 194 1a464: 9d e3 ldi r25, 0x3D ; 61 1a466: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a46a: ac 01 movw r20, r24 1a46c: 60 e0 ldi r22, 0x00 ; 0 1a46e: 80 e0 ldi r24, 0x00 ; 0 1a470: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_putc_at(0, 1, '\n'); 1a474: 4a e0 ldi r20, 0x0A ; 10 1a476: 61 e0 ldi r22, 0x01 ; 1 1a478: 80 e0 ldi r24, 0x00 ; 0 1a47a: 0e 94 46 70 call 0xe08c ; 0xe08c MENU_BEGIN(); 1a47e: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1a482: 10 92 12 05 sts 0x0512, r1 ; 0x800512 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a486: 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(); 1a488: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a48c: 84 30 cpi r24, 0x04 ; 4 1a48e: 18 f5 brcc .+70 ; 0x1a4d6 1a490: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a494: 81 11 cpse r24, r1 1a496: 02 c0 rjmp .+4 ; 0x1a49c 1a498: c0 93 12 05 sts 0x0512, r28 ; 0x800512 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1a49c: 8d eb ldi r24, 0xBD ; 189 1a49e: 9d e3 ldi r25, 0x3D ; 61 1a4a0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a4a4: 66 e1 ldi r22, 0x16 ; 22 1a4a6: 7b e3 ldi r23, 0x3B ; 59 1a4a8: 0f 94 0b ce call 0x39c16 ; 0x39c16 MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a4ac: 87 eb ldi r24, 0xB7 ; 183 1a4ae: 9d e3 ldi r25, 0x3D ; 61 1a4b0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a4b4: 6a e5 ldi r22, 0x5A ; 90 1a4b6: 7b e3 ldi r23, 0x3B ; 59 1a4b8: 0f 94 0b ce call 0x39c16 ; 0x39c16 MENU_END(); 1a4bc: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a4c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a4c4: 8f 5f subi r24, 0xFF ; 255 1a4c6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a4ca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a4ce: 8f 5f subi r24, 0xFF ; 255 1a4d0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a4d4: d9 cf rjmp .-78 ; 0x1a488 // 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(); } 1a4d6: cf 91 pop r28 1a4d8: 08 95 ret 0001a4da : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1a4da: cf 93 push r28 1a4dc: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1a4de: 84 ed ldi r24, 0xD4 ; 212 1a4e0: 93 e0 ldi r25, 0x03 ; 3 1a4e2: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1a4e6: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 1a4ea: 81 11 cpse r24, r1 1a4ec: 18 c0 rjmp .+48 ; 0x1a51e 1a4ee: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 1a4f2: 81 11 cpse r24, r1 1a4f4: 14 c0 rjmp .+40 ; 0x1a51e 1a4f6: c0 91 66 0e lds r28, 0x0E66 ; 0x800e66 1a4fa: d0 91 67 0e lds r29, 0x0E67 ; 0x800e67 1a4fe: 8a e3 ldi r24, 0x3A ; 58 1a500: cc 3c cpi r28, 0xCC ; 204 1a502: d8 07 cpc r29, r24 1a504: 61 f0 breq .+24 ; 0x1a51e 1a506: 8b e3 ldi r24, 0x3B ; 59 1a508: ce 39 cpi r28, 0x9E ; 158 1a50a: d8 07 cpc r29, r24 1a50c: 41 f0 breq .+16 ; 0x1a51e 1a50e: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 1a512: 81 11 cpse r24, r1 1a514: 04 c0 rjmp .+8 ; 0x1a51e 1a516: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1a51a: 88 23 and r24, r24 1a51c: 31 f0 breq .+12 ; 0x1a52a { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1a51e: 82 e0 ldi r24, 0x02 ; 2 1a520: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a524: df 91 pop r29 1a526: cf 91 pop r28 1a528: 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) 1a52a: 8a e3 ldi r24, 0x3A ; 58 1a52c: c2 3b cpi r28, 0xB2 ; 178 1a52e: d8 07 cpc r29, r24 1a530: 49 f4 brne .+18 ; 0x1a544 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1a532: 82 e0 ldi r24, 0x02 ; 2 1a534: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a538: 8a e2 ldi r24, 0x2A ; 42 1a53a: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a53c: df 91 pop r29 1a53e: 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); 1a540: 0c 94 50 78 jmp 0xf0a0 ; 0xf0a0 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); 1a544: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 1a548: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 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 1a54c: 98 13 cpse r25, r24 1a54e: 04 c0 rjmp .+8 ; 0x1a558 1a550: 0e 94 d6 68 call 0xd1ac ; 0xd1ac 1a554: 88 23 and r24, r24 1a556: 61 f0 breq .+24 ; 0x1a570 if ( babystep_allowed_strict() 1a558: 0e 94 11 69 call 0xd222 ; 0xd222 && (menu_menu == lcd_status_screen // and in listed menus... 1a55c: 81 11 cpse r24, r1 1a55e: 10 c0 rjmp .+32 ; 0x1a580 Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1a560: 82 e0 ldi r24, 0x02 ; 2 1a562: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1a566: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a568: df 91 pop r29 1a56a: cf 91 pop r28 1a56c: 0d 94 2e 63 jmp 0x2c65c ; 0x2c65c menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1a570: 8b e3 ldi r24, 0x3B ; 59 1a572: c2 3b cpi r28, 0xB2 ; 178 1a574: d8 07 cpc r29, r24 1a576: e1 f4 brne .+56 ; 0x1a5b0 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a578: 60 e0 ldi r22, 0x00 ; 0 1a57a: 8e e9 ldi r24, 0x9E ; 158 1a57c: 9b e3 ldi r25, 0x3B ; 59 1a57e: 14 c0 rjmp .+40 ; 0x1a5a8 // 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... 1a580: 8b e3 ldi r24, 0x3B ; 59 1a582: c2 3b cpi r28, 0xB2 ; 178 1a584: d8 07 cpc r29, r24 1a586: 59 f0 breq .+22 ; 0x1a59e || menu_menu == lcd_main_menu 1a588: 83 ee ldi r24, 0xE3 ; 227 1a58a: c4 3f cpi r28, 0xF4 ; 244 1a58c: d8 07 cpc r29, r24 1a58e: 39 f0 breq .+14 ; 0x1a59e || menu_menu == lcd_tune_menu 1a590: 84 ed ldi r24, 0xD4 ; 212 1a592: ce 31 cpi r28, 0x1E ; 30 1a594: d8 07 cpc r29, r24 1a596: 19 f0 breq .+6 ; 0x1a59e || menu_menu == lcd_support_menu 1a598: c4 5c subi r28, 0xC4 ; 196 1a59a: da 43 sbci r29, 0x3A ; 58 1a59c: 09 f7 brne .-62 ; 0x1a560 ) ){ lcd_clear(); 1a59e: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 menu_submenu(lcd_babystep_z); 1a5a2: 60 e0 ldi r22, 0x00 ; 0 1a5a4: 8c ec ldi r24, 0xCC ; 204 1a5a6: 9a e3 ldi r25, 0x3A ; 58 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a5a8: df 91 pop r29 1a5aa: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a5ac: 0d 94 fb cf jmp 0x39ff6 ; 0x39ff6 } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1a5b0: 83 ee ldi r24, 0xE3 ; 227 1a5b2: c4 3f cpi r28, 0xF4 ; 244 1a5b4: d8 07 cpc r29, r24 1a5b6: 01 f3 breq .-64 ; 0x1a578 || menu_menu == lcd_preheat_menu 1a5b8: 8a e3 ldi r24, 0x3A ; 58 1a5ba: c4 3d cpi r28, 0xD4 ; 212 1a5bc: d8 07 cpc r29, r24 1a5be: e1 f2 breq .-72 ; 0x1a578 || menu_menu == lcd_sdcard_menu 1a5c0: 89 e3 ldi r24, 0x39 ; 57 1a5c2: cc 3f cpi r28, 0xFC ; 252 1a5c4: d8 07 cpc r29, r24 1a5c6: c1 f2 breq .-80 ; 0x1a578 || menu_menu == lcd_settings_menu 1a5c8: 8a e3 ldi r24, 0x3A ; 58 1a5ca: c6 34 cpi r28, 0x46 ; 70 1a5cc: d8 07 cpc r29, r24 1a5ce: a1 f2 breq .-88 ; 0x1a578 || menu_menu == lcd_control_temperature_menu 1a5d0: 83 ed ldi r24, 0xD3 ; 211 1a5d2: ce 3f cpi r28, 0xFE ; 254 1a5d4: d8 07 cpc r29, r24 1a5d6: 81 f2 breq .-96 ; 0x1a578 #if (LANG_MODE != 0) || menu_menu == lcd_language 1a5d8: 8a e3 ldi r24, 0x3A ; 58 1a5da: ca 37 cpi r28, 0x7A ; 122 1a5dc: d8 07 cpc r29, r24 1a5de: 61 f2 breq .-104 ; 0x1a578 #endif || menu_menu == lcd_support_menu 1a5e0: c4 5c subi r28, 0xC4 ; 196 1a5e2: da 43 sbci r29, 0x3A ; 58 1a5e4: 09 f0 breq .+2 ; 0x1a5e8 1a5e6: bc cf rjmp .-136 ; 0x1a560 1a5e8: c7 cf rjmp .-114 ; 0x1a578 0001a5ea : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a5ea: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1a5ee: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a5f2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a5f6: 84 30 cpi r24, 0x04 ; 4 1a5f8: 08 f0 brcs .+2 ; 0x1a5fc 1a5fa: 3f c0 rjmp .+126 ; 0x1a67a 1a5fc: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a600: 8e e8 ldi r24, 0x8E ; 142 1a602: 9b e3 ldi r25, 0x3B ; 59 1a604: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a608: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 if(eeprom_is_sheet_initialized(selected_sheet)){ 1a60c: 80 91 da 03 lds r24, 0x03DA ; 0x8003da 1a610: 0e 94 5d 78 call 0xf0ba ; 0xf0ba 1a614: 88 23 and r24, r24 1a616: 41 f0 breq .+16 ; 0x1a628 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a618: 85 e8 ldi r24, 0x85 ; 133 1a61a: 9b e3 ldi r25, 0x3B ; 59 1a61c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a620: 6e e2 ldi r22, 0x2E ; 46 1a622: 78 ed ldi r23, 0xD8 ; 216 1a624: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } if (lcd_commands_type == LcdCommands::Idle) 1a628: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1a62c: 81 11 cpse r24, r1 1a62e: 08 c0 rjmp .+16 ; 0x1a640 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a630: 82 e7 ldi r24, 0x72 ; 114 1a632: 9b e3 ldi r25, 0x3B ; 59 1a634: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a638: 69 ed ldi r22, 0xD9 ; 217 1a63a: 71 ed ldi r23, 0xD1 ; 209 1a63c: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a640: 89 e6 ldi r24, 0x69 ; 105 1a642: 9b e3 ldi r25, 0x3B ; 59 1a644: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a648: 61 ef ldi r22, 0xF1 ; 241 1a64a: 75 ed ldi r23, 0xD5 ; 213 1a64c: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a650: 81 e6 ldi r24, 0x61 ; 97 1a652: 9b e3 ldi r25, 0x3B ; 59 1a654: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a658: 65 e1 ldi r22, 0x15 ; 21 1a65a: 76 ee ldi r23, 0xE6 ; 230 1a65c: 0f 94 0b ce call 0x39c16 ; 0x39c16 MENU_END(); 1a660: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a664: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a668: 8f 5f subi r24, 0xFF ; 255 1a66a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a66e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a672: 8f 5f subi r24, 0xFF ; 255 1a674: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a678: bc cf rjmp .-136 ; 0x1a5f2 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a67a: 08 95 ret 0001a67c () [clone .lto_priv.451]>: } template static void select_sheet_menu() { selected_sheet = number; 1a67c: 87 e0 ldi r24, 0x07 ; 7 1a67e: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a682: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 0001a686 () [clone .lto_priv.450]>: } template static void select_sheet_menu() { selected_sheet = number; 1a686: 86 e0 ldi r24, 0x06 ; 6 1a688: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a68c: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 0001a690 () [clone .lto_priv.449]>: } template static void select_sheet_menu() { selected_sheet = number; 1a690: 85 e0 ldi r24, 0x05 ; 5 1a692: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a696: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 0001a69a () [clone .lto_priv.448]>: } template static void select_sheet_menu() { selected_sheet = number; 1a69a: 84 e0 ldi r24, 0x04 ; 4 1a69c: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a6a0: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 0001a6a4 () [clone .lto_priv.447]>: } template static void select_sheet_menu() { selected_sheet = number; 1a6a4: 83 e0 ldi r24, 0x03 ; 3 1a6a6: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a6aa: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 0001a6ae () [clone .lto_priv.446]>: } template static void select_sheet_menu() { selected_sheet = number; 1a6ae: 82 e0 ldi r24, 0x02 ; 2 1a6b0: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a6b4: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 0001a6b8 () [clone .lto_priv.445]>: } template static void select_sheet_menu() { selected_sheet = number; 1a6b8: 81 e0 ldi r24, 0x01 ; 1 1a6ba: 80 93 da 03 sts 0x03DA, r24 ; 0x8003da lcd_sheet_menu(); 1a6be: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 0001a6c2 () [clone .lto_priv.444]>: } template static void select_sheet_menu() { selected_sheet = number; 1a6c2: 10 92 da 03 sts 0x03DA, r1 ; 0x8003da lcd_sheet_menu(); 1a6c6: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 0001a6ca : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a6ca: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1a6ce: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a6d2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a6d6: 84 30 cpi r24, 0x04 ; 4 1a6d8: 08 f0 brcs .+2 ; 0x1a6dc 1a6da: 8f c0 rjmp .+286 ; 0x1a7fa 1a6dc: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1a6e0: 8e e0 ldi r24, 0x0E ; 14 1a6e2: 9e e3 ldi r25, 0x3E ; 62 1a6e4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a6e8: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1a6ec: 83 e1 ldi r24, 0x13 ; 19 1a6ee: 9b e3 ldi r25, 0x3B ; 59 1a6f0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a6f4: 6c e5 ldi r22, 0x5C ; 92 1a6f6: 7b e3 ldi r23, 0x3B ; 59 1a6f8: 0f 94 0b ce call 0x39c16 ; 0x39c16 if (lcd_commands_type == LcdCommands::Idle) 1a6fc: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1a700: 81 11 cpse r24, r1 1a702: 08 c0 rjmp .+16 ; 0x1a714 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1a704: 82 e7 ldi r24, 0x72 ; 114 1a706: 9b e3 ldi r25, 0x3B ; 59 1a708: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a70c: 60 ec ldi r22, 0xC0 ; 192 1a70e: 7b e3 ldi r23, 0x3B ; 59 1a710: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1a714: 88 e3 ldi r24, 0x38 ; 56 1a716: 9a e4 ldi r25, 0x4A ; 74 1a718: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a71c: 6f ef ldi r22, 0xFF ; 255 1a71e: 7c e6 ldi r23, 0x6C ; 108 1a720: 0f 94 84 cd call 0x39b08 ; 0x39b08 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1a724: 87 e0 ldi r24, 0x07 ; 7 1a726: 9b e3 ldi r25, 0x3B ; 59 1a728: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a72c: 66 ee ldi r22, 0xE6 ; 230 1a72e: 79 e3 ldi r23, 0x39 ; 57 1a730: 0f 94 0b ce call 0x39c16 ; 0x39c16 #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1a734: 8c ef ldi r24, 0xFC ; 252 1a736: 9a e3 ldi r25, 0x3A ; 58 1a738: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a73c: 64 eb ldi r22, 0xB4 ; 180 1a73e: 7b e3 ldi r23, 0x3B ; 59 1a740: 0f 94 0b ce call 0x39c16 ; 0x39c16 // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1a744: 8c ee ldi r24, 0xEC ; 236 1a746: 9a e3 ldi r25, 0x3A ; 58 1a748: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a74c: 6c e7 ldi r22, 0x7C ; 124 1a74e: 7a e3 ldi r23, 0x3A ; 58 1a750: 0f 94 0b ce call 0x39c16 ; 0x39c16 // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1a754: 8e ed ldi r24, 0xDE ; 222 1a756: 9a e3 ldi r25, 0x3A ; 58 1a758: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a75c: 64 eb ldi r22, 0xB4 ; 180 1a75e: 7a e3 ldi r23, 0x3A ; 58 1a760: 0f 94 0b ce call 0x39c16 ; 0x39c16 MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1a764: 8a ec ldi r24, 0xCA ; 202 1a766: 9a e3 ldi r25, 0x3A ; 58 1a768: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a76c: 6e e2 ldi r22, 0x2E ; 46 1a76e: 7b e3 ldi r23, 0x3B ; 59 1a770: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1a774: 86 eb ldi r24, 0xB6 ; 182 1a776: 9a e3 ldi r25, 0x3A ; 58 1a778: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a77c: 6e ed ldi r22, 0xDE ; 222 1a77e: 7b e3 ldi r23, 0x3B ; 59 1a780: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1a784: 84 ea ldi r24, 0xA4 ; 164 1a786: 9a e3 ldi r25, 0x3A ; 58 1a788: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a78c: 64 ee ldi r22, 0xE4 ; 228 1a78e: 79 e3 ldi r23, 0x39 ; 57 1a790: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #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")); 1a794: 80 e9 ldi r24, 0x90 ; 144 1a796: 9a e3 ldi r25, 0x3A ; 58 1a798: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a79c: 69 e2 ldi r22, 0x29 ; 41 1a79e: 7c e8 ldi r23, 0x8C ; 140 1a7a0: 0f 94 84 cd call 0x39b08 ; 0x39b08 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1a7a4: 20 e0 ldi r18, 0x00 ; 0 1a7a6: 30 e0 ldi r19, 0x00 ; 0 1a7a8: 40 e2 ldi r20, 0x20 ; 32 1a7aa: 51 e4 ldi r21, 0x41 ; 65 1a7ac: 60 91 95 03 lds r22, 0x0395 ; 0x800395 1a7b0: 70 91 96 03 lds r23, 0x0396 ; 0x800396 1a7b4: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1a7b8: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1a7bc: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1a7c0: 87 fd sbrc r24, 7 1a7c2: 08 c0 rjmp .+16 ; 0x1a7d4 MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1a7c4: 83 e8 ldi r24, 0x83 ; 131 1a7c6: 9a e3 ldi r25, 0x3A ; 58 1a7c8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a7cc: 6c ed ldi r22, 0xDC ; 220 1a7ce: 7a e3 ldi r23, 0x3A ; 58 1a7d0: 0f 94 0b ce call 0x39c16 ; 0x39c16 #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1a7d4: 63 eb ldi r22, 0xB3 ; 179 1a7d6: 7f ec ldi r23, 0xCF ; 207 1a7d8: 8a ec ldi r24, 0xCA ; 202 1a7da: 9b e6 ldi r25, 0x6B ; 107 1a7dc: 0f 94 0b ce call 0x39c16 ; 0x39c16 #endif //THERMAL_MODEL MENU_END(); 1a7e0: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a7e4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a7e8: 8f 5f subi r24, 0xFF ; 255 1a7ea: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a7ee: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a7f2: 8f 5f subi r24, 0xFF ; 255 1a7f4: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a7f8: 6c cf rjmp .-296 ; 0x1a6d2 #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1a7fa: 08 95 ret 0001a7fc : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a7fc: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1a800: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a804: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a808: 84 30 cpi r24, 0x04 ; 4 1a80a: b8 f4 brcc .+46 ; 0x1a83a 1a80c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a810: 8c ea ldi r24, 0xAC ; 172 1a812: 9d e3 ldi r25, 0x3D ; 61 1a814: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a818: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 menuitems_temperature_common(); 1a81c: 0f 94 a5 31 call 0x2634a ; 0x2634a MENU_END(); 1a820: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a824: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a828: 8f 5f subi r24, 0xFF ; 255 1a82a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a82e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a832: 8f 5f subi r24, 0xFF ; 255 1a834: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a838: e5 cf rjmp .-54 ; 0x1a804 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1a83a: 08 95 ret 0001a83c : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1a83c: ef 92 push r14 1a83e: ff 92 push r15 1a840: 0f 93 push r16 1a842: 1f 93 push r17 1a844: cf 93 push r28 1a846: df 93 push r29 1a848: 80 91 94 02 lds r24, 0x0294 ; 0x800294 1a84c: 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) 1a850: 20 91 b2 03 lds r18, 0x03B2 ; 0x8003b2 1a854: 21 11 cpse r18, r1 1a856: 97 c0 rjmp .+302 ; 0x1a986 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1a858: 21 e0 ldi r18, 0x01 ; 1 1a85a: 20 93 b2 03 sts 0x03B2, r18 ; 0x8003b2 _md->extrudemultiply = extrudemultiply; 1a85e: 90 93 b4 03 sts 0x03B4, r25 ; 0x8003b4 1a862: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 // 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); 1a866: 8f ef ldi r24, 0xFF ; 255 1a868: 9f e0 ldi r25, 0x0F ; 15 1a86a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1a86e: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 MENU_BEGIN(); 1a872: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1a876: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1a87a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a87e: 84 30 cpi r24, 0x04 ; 4 1a880: 08 f0 brcs .+2 ; 0x1a884 1a882: 99 c0 rjmp .+306 ; 0x1a9b6 1a884: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1a888: 0f 94 0e cd call 0x39a1c ; 0x39a1c 1a88c: 81 11 cpse r24, r1 1a88e: 0e 94 29 66 call 0xcc52 ; 0xcc52 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1a892: 8e e0 ldi r24, 0x0E ; 14 1a894: 9e e3 ldi r25, 0x3E ; 62 1a896: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a89a: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1a89e: 84 e3 ldi r24, 0x34 ; 52 1a8a0: 9d e3 ldi r25, 0x3D ; 61 1a8a2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a8a6: f1 2c mov r15, r1 1a8a8: e1 2c mov r14, r1 1a8aa: 07 ee ldi r16, 0xE7 ; 231 1a8ac: 13 e0 ldi r17, 0x03 ; 3 1a8ae: 2a e0 ldi r18, 0x0A ; 10 1a8b0: 30 e0 ldi r19, 0x00 ; 0 1a8b2: 40 e1 ldi r20, 0x10 ; 16 1a8b4: 69 e3 ldi r22, 0x39 ; 57 1a8b6: 72 e0 ldi r23, 0x02 ; 2 1a8b8: 0f 94 de ce call 0x39dbc ; 0x39dbc menuitems_temperature_common(); 1a8bc: 0f 94 a5 31 call 0x2634a ; 0x2634a MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1a8c0: 8d e2 ldi r24, 0x2D ; 45 1a8c2: 9d e3 ldi r25, 0x3D ; 61 1a8c4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a8c8: 2a e0 ldi r18, 0x0A ; 10 1a8ca: 30 e0 ldi r19, 0x00 ; 0 1a8cc: 40 e1 ldi r20, 0x10 ; 16 1a8ce: 64 e9 ldi r22, 0x94 ; 148 1a8d0: 72 e0 ldi r23, 0x02 ; 2 1a8d2: 0f 94 de ce call 0x39dbc ; 0x39dbc #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); 1a8d6: 8b e1 ldi r24, 0x1B ; 27 1a8d8: 9d e3 ldi r25, 0x3D ; 61 1a8da: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a8de: 68 e7 ldi r22, 0x78 ; 120 1a8e0: 7b e3 ldi r23, 0x3B ; 59 1a8e2: 0f 94 0b ce call 0x39c16 ; 0x39c16 #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1a8e6: 0e 94 cb 68 call 0xd196 ; 0xd196 1a8ea: 88 23 and r24, r24 1a8ec: 41 f0 breq .+16 ; 0x1a8fe MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1a8ee: 88 e3 ldi r24, 0x38 ; 56 1a8f0: 9a e4 ldi r25, 0x4A ; 74 1a8f2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a8f6: 6d e2 ldi r22, 0x2D ; 45 1a8f8: 7c e8 ldi r23, 0x8C ; 140 1a8fa: 0f 94 84 cd call 0x39b08 ; 0x39b08 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1a8fe: 8d e0 ldi r24, 0x0D ; 13 1a900: 9d e3 ldi r25, 0x3D ; 61 1a902: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a906: 6a e9 ldi r22, 0x9A ; 154 1a908: 7b e3 ldi r23, 0x3B ; 59 1a90a: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1a90e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1a912: 81 30 cpi r24, 0x01 ; 1 1a914: 11 f4 brne .+4 ; 0x1a91a { menuitems_MMU_settings_common(); 1a916: 0f 94 42 32 call 0x26484 ; 0x26484 } SETTINGS_FANS_CHECK(); 1a91a: 0f 94 8b 31 call 0x26316 ; 0x26316 SETTINGS_SILENT_MODE(); 1a91e: 0f 94 de 31 call 0x263bc ; 0x263bc SETTINGS_SOUND; 1a922: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1a926: 82 30 cpi r24, 0x02 ; 2 1a928: 09 f4 brne .+2 ; 0x1a92c 1a92a: 3f c0 rjmp .+126 ; 0x1a9aa 1a92c: 83 30 cpi r24, 0x03 ; 3 1a92e: 09 f4 brne .+2 ; 0x1a932 1a930: 3f c0 rjmp .+126 ; 0x1a9b0 1a932: 81 30 cpi r24, 0x01 ; 1 1a934: b9 f1 breq .+110 ; 0x1a9a4 1a936: 86 e0 ldi r24, 0x06 ; 6 1a938: 9d e3 ldi r25, 0x3D ; 61 1a93a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a93e: ec 01 movw r28, r24 1a940: 8e ef ldi r24, 0xFE ; 254 1a942: 9c e3 ldi r25, 0x3C ; 60 1a944: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a948: 22 e0 ldi r18, 0x02 ; 2 1a94a: 44 e0 ldi r20, 0x04 ; 4 1a94c: 5b e3 ldi r21, 0x3B ; 59 1a94e: be 01 movw r22, r28 1a950: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #ifdef LCD_BL_PIN if (backlightSupport) 1a954: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 1a958: 88 23 and r24, r24 1a95a: 41 f0 breq .+16 ; 0x1a96c { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1a95c: 88 ed ldi r24, 0xD8 ; 216 1a95e: 9c e3 ldi r25, 0x3C ; 60 1a960: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1a964: 6e ec ldi r22, 0xCE ; 206 1a966: 76 ed ldi r23, 0xD6 ; 214 1a968: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } #endif //LCD_BL_PIN MENU_END(); 1a96c: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1a970: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a974: 8f 5f subi r24, 0xFF ; 255 1a976: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1a97a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a97e: 8f 5f subi r24, 0xFF ; 255 1a980: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1a984: 7a cf rjmp .-268 ; 0x1a87a { // 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) 1a986: 20 91 b3 03 lds r18, 0x03B3 ; 0x8003b3 1a98a: 30 91 b4 03 lds r19, 0x03B4 ; 0x8003b4 1a98e: 28 17 cp r18, r24 1a990: 39 07 cpc r19, r25 1a992: 09 f4 brne .+2 ; 0x1a996 1a994: 68 cf rjmp .-304 ; 0x1a866 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1a996: 90 93 b4 03 sts 0x03B4, r25 ; 0x8003b4 1a99a: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 calculate_extruder_multipliers(); 1a99e: 0e 94 ff 66 call 0xcdfe ; 0xcdfe 1a9a2: 61 cf rjmp .-318 ; 0x1a866 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1a9a4: 87 ef ldi r24, 0xF7 ; 247 1a9a6: 9c e3 ldi r25, 0x3C ; 60 1a9a8: c8 cf rjmp .-112 ; 0x1a93a 1a9aa: 8e ee ldi r24, 0xEE ; 238 1a9ac: 9c e3 ldi r25, 0x3C ; 60 1a9ae: c5 cf rjmp .-118 ; 0x1a93a 1a9b0: 85 ee ldi r24, 0xE5 ; 229 1a9b2: 9c e3 ldi r25, 0x3C ; 60 1a9b4: c2 cf rjmp .-124 ; 0x1a93a { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1a9b6: df 91 pop r29 1a9b8: cf 91 pop r28 1a9ba: 1f 91 pop r17 1a9bc: 0f 91 pop r16 1a9be: ff 90 pop r15 1a9c0: ef 90 pop r14 1a9c2: 08 95 ret 0001a9c4 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1a9c4: bf 92 push r11 1a9c6: cf 92 push r12 1a9c8: df 92 push r13 1a9ca: ef 92 push r14 1a9cc: ff 92 push r15 1a9ce: 0f 93 push r16 1a9d0: 1f 93 push r17 1a9d2: cf 93 push r28 1a9d4: df 93 push r29 1a9d6: c8 2f mov r28, r24 1a9d8: f6 2e mov r15, r22 1a9da: e4 2e mov r14, r20 1a9dc: b2 2e mov r11, r18 1a9de: 68 01 movw r12, r16 lcd_update_enable(false); 1a9e0: 80 e0 ldi r24, 0x00 ; 0 1a9e2: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1a9e6: dc e7 ldi r29, 0x7C ; 124 1a9e8: fe 14 cp r15, r14 1a9ea: 08 f0 brcs .+2 ; 0x1a9ee 1a9ec: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1a9ee: bb 20 and r11, r11 1a9f0: 09 f1 breq .+66 ; 0x1aa34 lcd_clear(); 1a9f2: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1a9f6: c1 11 cpse r28, r1 1a9f8: 20 c0 rjmp .+64 ; 0x1aa3a if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1a9fa: 82 ea ldi r24, 0xA2 ; 162 1a9fc: 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)); 1a9fe: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1aa02: 0e 94 11 70 call 0xe022 ; 0xe022 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1aa06: 88 ef ldi r24, 0xF8 ; 248 1aa08: 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 1aa0a: 82 30 cpi r24, 0x02 ; 2 1aa0c: 78 f5 brcc .+94 ; 0x1aa6c || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1aa0e: 85 ef ldi r24, 0xF5 ; 245 1aa10: 9f e3 ldi r25, 0x3F ; 63 1aa12: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1aa16: 0e 94 11 70 call 0xe022 ; 0xe022 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)); 1aa1a: 84 ed ldi r24, 0xD4 ; 212 1aa1c: 9f e3 ldi r25, 0x3F ; 63 1aa1e: cc 30 cpi r28, 0x0C ; 12 1aa20: 49 f1 breq .+82 ; 0x1aa74 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1aa22: 8d ea ldi r24, 0xAD ; 173 1aa24: 94 e4 ldi r25, 0x44 ; 68 1aa26: cd 30 cpi r28, 0x0D ; 13 1aa28: 29 f1 breq .+74 ; 0x1aa74 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1aa2a: ce 30 cpi r28, 0x0E ; 14 1aa2c: 39 f5 brne .+78 ; 0x1aa7c 1aa2e: 81 ec ldi r24, 0xC1 ; 193 1aa30: 9f e3 ldi r25, 0x3F ; 63 1aa32: 20 c0 rjmp .+64 ; 0x1aa74 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1aa34: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 1aa38: de cf rjmp .-68 ; 0x1a9f6 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1aa3a: c1 30 cpi r28, 0x01 ; 1 1aa3c: f1 f2 breq .-68 ; 0x1a9fa if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1aa3e: c2 30 cpi r28, 0x02 ; 2 1aa40: e1 f2 breq .-72 ; 0x1a9fa if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1aa42: 8c e4 ldi r24, 0x4C ; 76 1aa44: 90 e4 ldi r25, 0x40 ; 64 1aa46: c3 30 cpi r28, 0x03 ; 3 1aa48: d1 f2 breq .-76 ; 0x1a9fe if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1aa4a: 8a e3 ldi r24, 0x3A ; 58 1aa4c: 90 e4 ldi r25, 0x40 ; 64 1aa4e: c4 30 cpi r28, 0x04 ; 4 1aa50: b1 f2 breq .-84 ; 0x1a9fe if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1aa52: 88 e2 ldi r24, 0x28 ; 40 1aa54: 90 e4 ldi r25, 0x40 ; 64 1aa56: c5 30 cpi r28, 0x05 ; 5 1aa58: 91 f2 breq .-92 ; 0x1a9fe if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1aa5a: 86 e1 ldi r24, 0x16 ; 22 1aa5c: 90 e4 ldi r25, 0x40 ; 64 1aa5e: c6 30 cpi r28, 0x06 ; 6 1aa60: 71 f2 breq .-100 ; 0x1a9fe if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1aa62: c7 30 cpi r28, 0x07 ; 7 1aa64: 81 f6 brne .-96 ; 0x1aa06 1aa66: 87 e0 ldi r24, 0x07 ; 7 1aa68: 90 e4 ldi r25, 0x40 ; 64 1aa6a: c9 cf rjmp .-110 ; 0x1a9fe 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)); 1aa6c: ca 30 cpi r28, 0x0A ; 10 1aa6e: 99 f5 brne .+102 ; 0x1aad6 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1aa70: 82 ee ldi r24, 0xE2 ; 226 1aa72: 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)); 1aa74: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1aa78: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1aa7c: 40 e1 ldi r20, 0x10 ; 16 1aa7e: 5d e8 ldi r21, 0x8D ; 141 1aa80: 61 e0 ldi r22, 0x01 ; 1 1aa82: 80 e0 ldi r24, 0x00 ; 0 1aa84: 0e 94 3a 70 call 0xe074 ; 0xe074 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1aa88: c3 30 cpi r28, 0x03 ; 3 1aa8a: 70 f5 brcc .+92 ; 0x1aae8 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1aa8c: 83 eb ldi r24, 0xB3 ; 179 1aa8e: 9f e3 ldi r25, 0x3F ; 63 1aa90: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1aa94: ac 01 movw r20, r24 1aa96: 62 e0 ldi r22, 0x02 ; 2 1aa98: 80 e0 ldi r24, 0x00 ; 0 1aa9a: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(18, 2); 1aa9e: 62 e0 ldi r22, 0x02 ; 2 1aaa0: 82 e1 ldi r24, 0x12 ; 18 1aaa2: 0e 94 26 70 call 0xe04c ; 0xe04c (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1aaa6: c1 11 cpse r28, r1 1aaa8: 1a c0 rjmp .+52 ; 0x1aade 1aaaa: 8d 2f mov r24, r29 1aaac: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1aab0: 86 ea ldi r24, 0xA6 ; 166 1aab2: 9f e3 ldi r25, 0x3F ; 63 1aab4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1aab8: ac 01 movw r20, r24 1aaba: 63 e0 ldi r22, 0x03 ; 3 1aabc: 80 e0 ldi r24, 0x00 ; 0 1aabe: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(18, 3); 1aac2: 63 e0 ldi r22, 0x03 ; 3 1aac4: 82 e1 ldi r24, 0x12 ; 18 1aac6: 0e 94 26 70 call 0xe04c ; 0xe04c (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1aaca: c2 30 cpi r28, 0x02 ; 2 1aacc: 19 f1 breq .+70 ; 0x1ab14 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); 1aace: 8d 2f mov r24, r29 1aad0: 0e 94 15 70 call 0xe02a ; 0xe02a 1aad4: 23 c0 rjmp .+70 ; 0x1ab1c 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)); 1aad6: cb 30 cpi r28, 0x0B ; 11 1aad8: 09 f0 breq .+2 ; 0x1aadc 1aada: 9f cf rjmp .-194 ; 0x1aa1a 1aadc: c9 cf rjmp .-110 ; 0x1aa70 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); 1aade: 81 e9 ldi r24, 0x91 ; 145 1aae0: 9c e6 ldi r25, 0x6C ; 108 1aae2: 0e 94 11 70 call 0xe022 ; 0xe022 1aae6: e4 cf rjmp .-56 ; 0x1aab0 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) 1aae8: 86 ef ldi r24, 0xF6 ; 246 1aaea: 8c 0f add r24, r28 1aaec: 82 30 cpi r24, 0x02 ; 2 1aaee: 80 f5 brcc .+96 ; 0x1ab50 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1aaf0: 86 ee ldi r24, 0xE6 ; 230 1aaf2: 94 e4 ldi r25, 0x44 ; 68 1aaf4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1aaf8: ac 01 movw r20, r24 1aafa: 62 e0 ldi r22, 0x02 ; 2 1aafc: 80 e0 ldi r24, 0x00 ; 0 1aafe: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_putc(':'); 1ab02: 8a e3 ldi r24, 0x3A ; 58 1ab04: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_set_cursor(18, 2); 1ab08: 62 e0 ldi r22, 0x02 ; 2 1ab0a: 82 e1 ldi r24, 0x12 ; 18 1ab0c: 0e 94 26 70 call 0xe04c ; 0xe04c (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1ab10: ca 30 cpi r28, 0x0A ; 10 1ab12: e9 f2 breq .-70 ; 0x1aace 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); 1ab14: 81 e9 ldi r24, 0x91 ; 145 1ab16: 9c e6 ldi r25, 0x6C ; 108 1ab18: 0e 94 11 70 call 0xe022 ; 0xe022 _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); 1ab1c: c1 14 cp r12, r1 1ab1e: d1 04 cpc r13, r1 1ab20: 19 f0 breq .+6 ; 0x1ab28 1ab22: c6 01 movw r24, r12 1ab24: 0e 94 10 8f call 0x11e20 ; 0x11e20 _progress++; 1ab28: 81 e0 ldi r24, 0x01 ; 1 1ab2a: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1ab2c: 4e 2d mov r20, r14 1ab2e: 50 e0 ldi r21, 0x00 ; 0 1ab30: 44 0f add r20, r20 1ab32: 55 1f adc r21, r21 1ab34: 84 17 cp r24, r20 1ab36: 15 06 cpc r1, r21 1ab38: 0c f0 brlt .+2 ; 0x1ab3c 1ab3a: 80 e0 ldi r24, 0x00 ; 0 } 1ab3c: df 91 pop r29 1ab3e: cf 91 pop r28 1ab40: 1f 91 pop r17 1ab42: 0f 91 pop r16 1ab44: ff 90 pop r15 1ab46: ef 90 pop r14 1ab48: df 90 pop r13 1ab4a: cf 90 pop r12 1ab4c: bf 90 pop r11 1ab4e: 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) 1ab50: ca 30 cpi r28, 0x0A ; 10 1ab52: 20 f7 brcc .-56 ; 0x1ab1c { //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); 1ab54: 41 e0 ldi r20, 0x01 ; 1 1ab56: c4 30 cpi r28, 0x04 ; 4 1ab58: 21 f0 breq .+8 ; 0x1ab62 1ab5a: 42 e0 ldi r20, 0x02 ; 2 1ab5c: c3 30 cpi r28, 0x03 ; 3 1ab5e: 09 f4 brne .+2 ; 0x1ab62 1ab60: 40 e0 ldi r20, 0x00 ; 0 1ab62: 0d 2f mov r16, r29 1ab64: 2e e0 ldi r18, 0x0E ; 14 1ab66: 3d e8 ldi r19, 0x8D ; 141 1ab68: 62 e0 ldi r22, 0x02 ; 2 1ab6a: 82 e0 ldi r24, 0x02 ; 2 1ab6c: 0e 94 b0 d0 call 0x1a160 ; 0x1a160 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1ab70: 41 e0 ldi r20, 0x01 ; 1 1ab72: c5 30 cpi r28, 0x05 ; 5 1ab74: 21 f0 breq .+8 ; 0x1ab7e 1ab76: 42 e0 ldi r20, 0x02 ; 2 1ab78: c5 30 cpi r28, 0x05 ; 5 1ab7a: 08 f4 brcc .+2 ; 0x1ab7e 1ab7c: 40 e0 ldi r20, 0x00 ; 0 1ab7e: 0d 2f mov r16, r29 1ab80: 2c e0 ldi r18, 0x0C ; 12 1ab82: 3d e8 ldi r19, 0x8D ; 141 1ab84: 68 e0 ldi r22, 0x08 ; 8 1ab86: 82 e0 ldi r24, 0x02 ; 2 1ab88: 0e 94 b0 d0 call 0x1a160 ; 0x1a160 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1ab8c: 41 e0 ldi r20, 0x01 ; 1 1ab8e: c6 30 cpi r28, 0x06 ; 6 1ab90: 21 f0 breq .+8 ; 0x1ab9a 1ab92: 42 e0 ldi r20, 0x02 ; 2 1ab94: c6 30 cpi r28, 0x06 ; 6 1ab96: 08 f4 brcc .+2 ; 0x1ab9a 1ab98: 40 e0 ldi r20, 0x00 ; 0 1ab9a: 0d 2f mov r16, r29 1ab9c: 2a e0 ldi r18, 0x0A ; 10 1ab9e: 3d e8 ldi r19, 0x8D ; 141 1aba0: 6e e0 ldi r22, 0x0E ; 14 1aba2: 82 e0 ldi r24, 0x02 ; 2 1aba4: 0e 94 b0 d0 call 0x1a160 ; 0x1a160 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1aba8: 41 e0 ldi r20, 0x01 ; 1 1abaa: c7 30 cpi r28, 0x07 ; 7 1abac: 21 f0 breq .+8 ; 0x1abb6 1abae: 42 e0 ldi r20, 0x02 ; 2 1abb0: c7 30 cpi r28, 0x07 ; 7 1abb2: 08 f4 brcc .+2 ; 0x1abb6 1abb4: 40 e0 ldi r20, 0x00 ; 0 1abb6: 0d 2f mov r16, r29 1abb8: 26 e0 ldi r18, 0x06 ; 6 1abba: 3d e8 ldi r19, 0x8D ; 141 1abbc: 60 e0 ldi r22, 0x00 ; 0 1abbe: 83 e0 ldi r24, 0x03 ; 3 1abc0: 0e 94 b0 d0 call 0x1a160 ; 0x1a160 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1abc4: 41 e0 ldi r20, 0x01 ; 1 1abc6: c8 30 cpi r28, 0x08 ; 8 1abc8: 21 f0 breq .+8 ; 0x1abd2 1abca: 42 e0 ldi r20, 0x02 ; 2 1abcc: c8 30 cpi r28, 0x08 ; 8 1abce: 08 f4 brcc .+2 ; 0x1abd2 1abd0: 40 e0 ldi r20, 0x00 ; 0 1abd2: 0d 2f mov r16, r29 1abd4: 2f ef ldi r18, 0xFF ; 255 1abd6: 3c e8 ldi r19, 0x8C ; 140 1abd8: 69 e0 ldi r22, 0x09 ; 9 1abda: 83 e0 ldi r24, 0x03 ; 3 1abdc: 0e 94 b0 d0 call 0x1a160 ; 0x1a160 1abe0: 9d cf rjmp .-198 ; 0x1ab1c 0001abe2 : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1abe2: cf 93 push r28 1abe4: 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) 1abe6: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 1abea: 81 11 cpse r24, r1 1abec: 18 c0 rjmp .+48 ; 0x1ac1e { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1abee: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1abf2: 8b e0 ldi r24, 0x0B ; 11 1abf4: 68 9f mul r22, r24 1abf6: b0 01 movw r22, r0 1abf8: 11 24 eor r1, r1 1abfa: 67 5b subi r22, 0xB7 ; 183 1abfc: 72 4f sbci r23, 0xF2 ; 242 1abfe: 47 e0 ldi r20, 0x07 ; 7 1ac00: 50 e0 ldi r21, 0x00 ; 0 1ac02: 87 ea ldi r24, 0xA7 ; 167 1ac04: 93 e0 ldi r25, 0x03 ; 3 1ac06: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe lcd_encoder = menuData->name[0]; 1ac0a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1ac0e: 90 e0 ldi r25, 0x00 ; 0 1ac10: 90 93 35 05 sts 0x0535, r25 ; 0x800535 1ac14: 80 93 34 05 sts 0x0534, r24 ; 0x800534 menuData->initialized = true; 1ac18: 81 e0 ldi r24, 0x01 ; 1 1ac1a: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1ac1e: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1ac22: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1ac26: 80 97 sbiw r24, 0x20 ; 32 1ac28: 34 f4 brge .+12 ; 0x1ac36 1ac2a: 80 e2 ldi r24, 0x20 ; 32 1ac2c: 90 e0 ldi r25, 0x00 ; 0 1ac2e: 90 93 35 05 sts 0x0535, r25 ; 0x800535 1ac32: 80 93 34 05 sts 0x0534, r24 ; 0x800534 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1ac36: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1ac3a: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1ac3e: 8f 3f cpi r24, 0xFF ; 255 1ac40: 91 05 cpc r25, r1 1ac42: 39 f0 breq .+14 ; 0x1ac52 1ac44: 34 f0 brlt .+12 ; 0x1ac52 1ac46: 8f ef ldi r24, 0xFF ; 255 1ac48: 90 e0 ldi r25, 0x00 ; 0 1ac4a: 90 93 35 05 sts 0x0535, r25 ; 0x800535 1ac4e: 80 93 34 05 sts 0x0534, r24 ; 0x800534 menuData->name[menuData->selected] = lcd_encoder; 1ac52: e0 91 a6 03 lds r30, 0x03A6 ; 0x8003a6 1ac56: f0 e0 ldi r31, 0x00 ; 0 1ac58: eb 55 subi r30, 0x5B ; 91 1ac5a: fc 4f sbci r31, 0xFC ; 252 1ac5c: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1ac60: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1ac62: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 1ac66: c7 ea ldi r28, 0xA7 ; 167 1ac68: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1ac6a: 89 91 ld r24, Y+ 1ac6c: 0e 94 15 70 call 0xe02a ; 0xe02a 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) 1ac70: 83 e0 ldi r24, 0x03 ; 3 1ac72: ce 3a cpi r28, 0xAE ; 174 1ac74: d8 07 cpc r29, r24 1ac76: c9 f7 brne .-14 ; 0x1ac6a { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1ac78: 4e e5 ldi r20, 0x5E ; 94 1ac7a: 61 e0 ldi r22, 0x01 ; 1 1ac7c: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 1ac80: 0e 94 46 70 call 0xe08c ; 0xe08c if (menuData->selected > 0) 1ac84: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 1ac88: 88 23 and r24, r24 1ac8a: 29 f0 breq .+10 ; 0x1ac96 { lcd_putc_at(menuData->selected-1, 1, ' '); 1ac8c: 40 e2 ldi r20, 0x20 ; 32 1ac8e: 61 e0 ldi r22, 0x01 ; 1 1ac90: 81 50 subi r24, 0x01 ; 1 1ac92: 0e 94 46 70 call 0xe08c ; 0xe08c } if (lcd_clicked()) 1ac96: 0e 94 43 72 call 0xe486 ; 0xe486 1ac9a: 88 23 and r24, r24 1ac9c: 99 f0 breq .+38 ; 0x1acc4 { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1ac9e: e0 91 a6 03 lds r30, 0x03A6 ; 0x8003a6 1aca2: 8e 2f mov r24, r30 1aca4: 90 e0 ldi r25, 0x00 ; 0 1aca6: 01 96 adiw r24, 0x01 ; 1 1aca8: 07 97 sbiw r24, 0x07 ; 7 1acaa: 78 f4 brcc .+30 ; 0x1acca { lcd_encoder = menuData->name[++(menuData->selected)]; 1acac: ef 5f subi r30, 0xFF ; 255 1acae: e0 93 a6 03 sts 0x03A6, r30 ; 0x8003a6 1acb2: f0 e0 ldi r31, 0x00 ; 0 1acb4: eb 55 subi r30, 0x5B ; 91 1acb6: fc 4f sbci r31, 0xFC ; 252 1acb8: 82 81 ldd r24, Z+2 ; 0x02 1acba: 90 e0 ldi r25, 0x00 ; 0 1acbc: 90 93 35 05 sts 0x0535, r25 ; 0x800535 1acc0: 80 93 34 05 sts 0x0534, r24 ; 0x800534 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1acc4: df 91 pop r29 1acc6: cf 91 pop r28 1acc8: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1acca: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1acce: 8b e0 ldi r24, 0x0B ; 11 1acd0: 68 9f mul r22, r24 1acd2: b0 01 movw r22, r0 1acd4: 11 24 eor r1, r1 1acd6: 67 5b subi r22, 0xB7 ; 183 1acd8: 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); 1acda: 47 e0 ldi r20, 0x07 ; 7 1acdc: 50 e0 ldi r21, 0x00 ; 0 1acde: 87 ea ldi r24, 0xA7 ; 167 1ace0: 93 e0 ldi r25, 0x03 ; 3 1ace2: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1ace6: df 91 pop r29 1ace8: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1acea: 0d 94 56 d1 jmp 0x3a2ac ; 0x3a2ac 0001acee : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1acee: cf 93 push r28 1acf0: df 93 push r29 current_position[axis] += 10; 1acf2: 94 e0 ldi r25, 0x04 ; 4 1acf4: 89 9f mul r24, r25 1acf6: e0 01 movw r28, r0 1acf8: 11 24 eor r1, r1 1acfa: c0 5c subi r28, 0xC0 ; 192 1acfc: d8 4f sbci r29, 0xF8 ; 248 1acfe: 20 e0 ldi r18, 0x00 ; 0 1ad00: 30 e0 ldi r19, 0x00 ; 0 1ad02: 40 e2 ldi r20, 0x20 ; 32 1ad04: 51 e4 ldi r21, 0x41 ; 65 1ad06: 68 81 ld r22, Y 1ad08: 79 81 ldd r23, Y+1 ; 0x01 1ad0a: 8a 81 ldd r24, Y+2 ; 0x02 1ad0c: 9b 81 ldd r25, Y+3 ; 0x03 1ad0e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1ad12: 68 83 st Y, r22 1ad14: 79 83 std Y+1, r23 ; 0x01 1ad16: 8a 83 std Y+2, r24 ; 0x02 1ad18: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1ad1a: 60 e0 ldi r22, 0x00 ; 0 1ad1c: 70 e0 ldi r23, 0x00 ; 0 1ad1e: 84 e3 ldi r24, 0x34 ; 52 1ad20: 92 e4 ldi r25, 0x42 ; 66 1ad22: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1ad26: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 crashdet_use_eeprom_setting(); } 1ad2a: df 91 pop r29 1ad2c: 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(); 1ad2e: 0d 94 da 3a jmp 0x275b4 ; 0x275b4 0001ad32 : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1ad32: 0f 94 c3 7b call 0x2f786 ; 0x2f786 #endif menu_top = 0; 1ad36: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 lcd_encoder = 0; 1ad3a: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1ad3e: 10 92 34 05 sts 0x0534, r1 ; 0x800534 menu_data_reset(); //Forces reloading of cached variables. 1ad42: 0d 94 b0 ce jmp 0x39d60 ; 0x39d60 0001ad46 : } } void CardReader::updir() { if(workDirDepth > 0) 1ad46: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 1ad4a: 88 23 and r24, r24 1ad4c: f9 f0 breq .+62 ; 0x1ad8c { --workDirDepth; 1ad4e: 81 50 subi r24, 0x01 ; 1 1ad50: 80 93 0b 16 sts 0x160B, r24 ; 0x80160b workDir = workDirParents[0]; 1ad54: 93 e2 ldi r25, 0x23 ; 35 1ad56: e9 e3 ldi r30, 0x39 ; 57 1ad58: f5 e1 ldi r31, 0x15 ; 21 1ad5a: a6 e1 ldi r26, 0x16 ; 22 1ad5c: b5 e1 ldi r27, 0x15 ; 21 1ad5e: 01 90 ld r0, Z+ 1ad60: 0d 92 st X+, r0 1ad62: 9a 95 dec r25 1ad64: e1 f7 brne .-8 ; 0x1ad5e 1ad66: 29 e3 ldi r18, 0x39 ; 57 1ad68: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1ad6a: 90 e0 ldi r25, 0x00 ; 0 1ad6c: 98 17 cp r25, r24 1ad6e: 60 f4 brcc .+24 ; 0x1ad88 { workDirParents[d] = workDirParents[d+1]; 1ad70: 43 e2 ldi r20, 0x23 ; 35 1ad72: f9 01 movw r30, r18 1ad74: b3 96 adiw r30, 0x23 ; 35 1ad76: d9 01 movw r26, r18 1ad78: 01 90 ld r0, Z+ 1ad7a: 0d 92 st X+, r0 1ad7c: 4a 95 dec r20 1ad7e: e1 f7 brne .-8 ; 0x1ad78 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1ad80: 9f 5f subi r25, 0xFF ; 255 1ad82: 2d 5d subi r18, 0xDD ; 221 1ad84: 3f 4f sbci r19, 0xFF ; 255 1ad86: f2 cf rjmp .-28 ; 0x1ad6c { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1ad88: 0f 94 c3 7b call 0x2f786 ; 0x2f786 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1ad8c: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 lcd_encoder = 0; 1ad90: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1ad94: 10 92 34 05 sts 0x0534, r1 ; 0x800534 menu_data_reset(); //Forces reloading of cached variables. 1ad98: 0d 94 b0 ce jmp 0x39d60 ; 0x39d60 0001ad9c : } backlight_save(); } static void lcd_backlight_menu() { 1ad9c: ef 92 push r14 1ad9e: ff 92 push r15 1ada0: 0f 93 push r16 1ada2: 1f 93 push r17 1ada4: cf 93 push r28 1ada6: df 93 push r29 MENU_BEGIN(); 1ada8: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1adac: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1adb0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1adb4: 84 30 cpi r24, 0x04 ; 4 1adb6: 08 f0 brcs .+2 ; 0x1adba 1adb8: 63 c0 rjmp .+198 ; 0x1ae80 1adba: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1adbe: 0f 94 0e cd call 0x39a1c ; 0x39a1c 1adc2: 81 11 cpse r24, r1 1adc4: 0e 94 eb 8b call 0x117d6 ; 0x117d6 backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1adc8: 8f e6 ldi r24, 0x6F ; 111 1adca: 90 e4 ldi r25, 0x40 ; 64 1adcc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1add0: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1add4: c0 91 f9 03 lds r28, 0x03F9 ; 0x8003f9 1add8: d0 e0 ldi r29, 0x00 ; 0 1adda: 8d e9 ldi r24, 0x9D ; 157 1addc: 9d e3 ldi r25, 0x3D ; 61 1adde: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ade2: f1 2c mov r15, r1 1ade4: e1 2c mov r14, r1 1ade6: 0f ef ldi r16, 0xFF ; 255 1ade8: 10 e0 ldi r17, 0x00 ; 0 1adea: 9e 01 movw r18, r28 1adec: 48 e0 ldi r20, 0x08 ; 8 1adee: 6a ef ldi r22, 0xFA ; 250 1adf0: 73 e0 ldi r23, 0x03 ; 3 1adf2: 0f 94 de ce call 0x39dbc ; 0x39dbc MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1adf6: 00 91 fa 03 lds r16, 0x03FA ; 0x8003fa 1adfa: 10 e0 ldi r17, 0x00 ; 0 1adfc: 8e e8 ldi r24, 0x8E ; 142 1adfe: 9d e3 ldi r25, 0x3D ; 61 1ae00: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ae04: 30 e0 ldi r19, 0x00 ; 0 1ae06: 20 e0 ldi r18, 0x00 ; 0 1ae08: 48 e0 ldi r20, 0x08 ; 8 1ae0a: 69 ef ldi r22, 0xF9 ; 249 1ae0c: 73 e0 ldi r23, 0x03 ; 3 1ae0e: 0f 94 de ce call 0x39dbc ; 0x39dbc 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); 1ae12: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1ae16: 81 30 cpi r24, 0x01 ; 1 1ae18: 59 f5 brne .+86 ; 0x1ae70 1ae1a: 85 e8 ldi r24, 0x85 ; 133 1ae1c: 9d e3 ldi r25, 0x3D ; 61 1ae1e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ae22: ec 01 movw r28, r24 1ae24: 81 e7 ldi r24, 0x71 ; 113 1ae26: 9d e3 ldi r25, 0x3D ; 61 1ae28: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ae2c: 22 e0 ldi r18, 0x02 ; 2 1ae2e: 47 e4 ldi r20, 0x47 ; 71 1ae30: 57 ed ldi r21, 0xD7 ; 215 1ae32: be 01 movw r22, r28 1ae34: 0f 94 1d d0 call 0x3a03a ; 0x3a03a MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); 1ae38: 87 e6 ldi r24, 0x67 ; 103 1ae3a: 9d e3 ldi r25, 0x3D ; 61 1ae3c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ae40: f1 2c mov r15, r1 1ae42: e1 2c mov r14, r1 1ae44: 07 ee ldi r16, 0xE7 ; 231 1ae46: 13 e0 ldi r17, 0x03 ; 3 1ae48: 21 e0 ldi r18, 0x01 ; 1 1ae4a: 30 e0 ldi r19, 0x00 ; 0 1ae4c: 40 e1 ldi r20, 0x10 ; 16 1ae4e: 6d e4 ldi r22, 0x4D ; 77 1ae50: 72 e0 ldi r23, 0x02 ; 2 1ae52: 0f 94 de ce call 0x39dbc ; 0x39dbc MENU_END(); 1ae56: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1ae5a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1ae5e: 8f 5f subi r24, 0xFF ; 255 1ae60: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1ae64: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1ae68: 8f 5f subi r24, 0xFF ; 255 1ae6a: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1ae6e: a0 cf rjmp .-192 ; 0x1adb0 ); 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); 1ae70: 81 11 cpse r24, r1 1ae72: 03 c0 rjmp .+6 ; 0x1ae7a 1ae74: 8f e7 ldi r24, 0x7F ; 127 1ae76: 9d e3 ldi r25, 0x3D ; 61 1ae78: d2 cf rjmp .-92 ; 0x1ae1e 1ae7a: 88 e7 ldi r24, 0x78 ; 120 1ae7c: 9d e3 ldi r25, 0x3D ; 61 1ae7e: cf cf rjmp .-98 ; 0x1ae1e MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, 1, 999); MENU_END(); } 1ae80: df 91 pop r29 1ae82: cf 91 pop r28 1ae84: 1f 91 pop r17 1ae86: 0f 91 pop r16 1ae88: ff 90 pop r15 1ae8a: ef 90 pop r14 1ae8c: 08 95 ret 0001ae8e : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1ae8e: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1ae92: 88 23 and r24, r24 1ae94: 31 f0 breq .+12 ; 0x1aea2 1ae96: 81 30 cpi r24, 0x01 ; 1 1ae98: 41 f4 brne .+16 ; 0x1aeaa { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1ae9a: 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(); 1ae9e: 0c 94 eb 8b jmp 0x117d6 ; 0x117d6 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; 1aea2: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1aea4: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1aea8: fa cf rjmp .-12 ; 0x1ae9e 1aeaa: 81 e0 ldi r24, 0x01 ; 1 1aeac: fb cf rjmp .-10 ; 0x1aea4 0001aeae : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 1aeae: bf 92 push r11 1aeb0: cf 92 push r12 1aeb2: df 92 push r13 1aeb4: ef 92 push r14 1aeb6: ff 92 push r15 1aeb8: 0f 93 push r16 1aeba: 1f 93 push r17 1aebc: cf 93 push r28 1aebe: df 93 push r29 1aec0: 00 d0 rcall .+0 ; 0x1aec2 1aec2: 1f 92 push r1 1aec4: cd b7 in r28, 0x3d ; 61 1aec6: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1aec8: 8c ea ldi r24, 0xAC ; 172 1aeca: 9d e0 ldi r25, 0x0D ; 13 1aecc: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1aed0: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1aed2: 8b ea ldi r24, 0xAB ; 171 1aed4: 9d e0 ldi r25, 0x0D ; 13 1aed6: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1aeda: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1aedc: 8a ea ldi r24, 0xAA ; 170 1aede: 9d e0 ldi r25, 0x0D ; 13 1aee0: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1aee4: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1aee6: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1aeea: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 1aeee: 80 e3 ldi r24, 0x30 ; 48 1aef0: d8 2e mov r13, r24 1aef2: df 0c add r13, r15 sToggle[1] = 'x'; 1aef4: 98 e7 ldi r25, 0x78 ; 120 1aef6: 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'; 1aef8: 20 e3 ldi r18, 0x30 ; 48 1aefa: e2 2e mov r14, r18 1aefc: 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(); 1aefe: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1af02: 84 30 cpi r24, 0x04 ; 4 1af04: 08 f0 brcs .+2 ; 0x1af08 1af06: 56 c0 rjmp .+172 ; 0x1afb4 1af08: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1af0c: 0f 94 0e cd call 0x39a1c ; 0x39a1c 1af10: 88 23 and r24, r24 1af12: 31 f0 breq .+12 ; 0x1af20 1af14: 87 e0 ldi r24, 0x07 ; 7 1af16: f8 12 cpse r15, r24 1af18: 03 c0 rjmp .+6 ; 0x1af20 1af1a: 81 e0 ldi r24, 0x01 ; 1 1af1c: 0f 94 42 66 call 0x2cc84 ; 0x2cc84 // 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)); 1af20: 8c ea ldi r24, 0xAC ; 172 1af22: 9d e3 ldi r25, 0x3D ; 61 1af24: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1af28: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 sToggle[0] = points_nr + '0'; 1af2c: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1af2e: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1af30: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1af32: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1af34: 80 e6 ldi r24, 0x60 ; 96 1af36: 9d e3 ldi r25, 0x3D ; 61 1af38: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1af3c: 20 e0 ldi r18, 0x00 ; 0 1af3e: 42 ec ldi r20, 0xC2 ; 194 1af40: 51 ed ldi r21, 0xD1 ; 209 1af42: be 01 movw r22, r28 1af44: 6f 5f subi r22, 0xFF ; 255 1af46: 7f 4f sbci r23, 0xFF ; 255 1af48: 0f 94 1d d0 call 0x3a03a ; 0x3a03a sToggle[0] = mbl_z_probe_nr + '0'; 1af4c: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1af4e: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1af50: 82 e5 ldi r24, 0x52 ; 82 1af52: 9d e3 ldi r25, 0x3D ; 61 1af54: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1af58: 20 e0 ldi r18, 0x00 ; 0 1af5a: 43 eb ldi r20, 0xB3 ; 179 1af5c: 51 ed ldi r21, 0xD1 ; 209 1af5e: be 01 movw r22, r28 1af60: 6f 5f subi r22, 0xFF ; 255 1af62: 7f 4f sbci r23, 0xFF ; 255 1af64: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 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); 1af68: 87 e0 ldi r24, 0x07 ; 7 1af6a: f8 12 cpse r15, r24 1af6c: 20 c0 rjmp .+64 ; 0x1afae 1af6e: 84 e4 ldi r24, 0x44 ; 68 1af70: 9e e5 ldi r25, 0x5E ; 94 1af72: c1 10 cpse r12, r1 1af74: 02 c0 rjmp .+4 ; 0x1af7a 1af76: 8e e3 ldi r24, 0x3E ; 62 1af78: 9e e5 ldi r25, 0x5E ; 94 1af7a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1af7e: 8c 01 movw r16, r24 1af80: 8c e3 ldi r24, 0x3C ; 60 1af82: 9d e3 ldi r25, 0x3D ; 61 1af84: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1af88: 22 e0 ldi r18, 0x02 ; 2 1af8a: 4e ec ldi r20, 0xCE ; 206 1af8c: 51 ed ldi r21, 0xD1 ; 209 1af8e: b8 01 movw r22, r16 1af90: 0f 94 1d d0 call 0x3a03a ; 0x3a03a MENU_END(); 1af94: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 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(); 1af98: 90 91 12 05 lds r25, 0x0512 ; 0x800512 1af9c: 9f 5f subi r25, 0xFF ; 255 1af9e: 90 93 12 05 sts 0x0512, r25 ; 0x800512 1afa2: 90 91 14 05 lds r25, 0x0514 ; 0x800514 1afa6: 9f 5f subi r25, 0xFF ; 255 1afa8: 90 93 14 05 sts 0x0514, r25 ; 0x800514 1afac: a8 cf rjmp .-176 ; 0x1aefe 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); 1afae: 8c e4 ldi r24, 0x4C ; 76 1afb0: 9d e3 ldi r25, 0x3D ; 61 1afb2: e3 cf rjmp .-58 ; 0x1af7a MENU_END(); } 1afb4: 0f 90 pop r0 1afb6: 0f 90 pop r0 1afb8: 0f 90 pop r0 1afba: 0f 90 pop r0 1afbc: df 91 pop r29 1afbe: cf 91 pop r28 1afc0: 1f 91 pop r17 1afc2: 0f 91 pop r16 1afc4: ff 90 pop r15 1afc6: ef 90 pop r14 1afc8: df 90 pop r13 1afca: cf 90 pop r12 1afcc: bf 90 pop r11 1afce: 08 95 ret 0001afd0 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1afd0: cf 93 push r28 MENU_BEGIN(); 1afd2: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1afd6: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1afda: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1afde: 84 30 cpi r24, 0x04 ; 4 1afe0: 60 f5 brcc .+88 ; 0x1b03a 1afe2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1afe6: 8e e0 ldi r24, 0x0E ; 14 1afe8: 9e e3 ldi r25, 0x3E ; 62 1afea: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1afee: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1aff2: 8f e2 ldi r24, 0x2F ; 47 1aff4: 9b e3 ldi r25, 0x3B ; 59 1aff6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1affa: 6c ed ldi r22, 0xDC ; 220 1affc: 78 ed ldi r23, 0xD8 ; 216 1affe: 0f 94 0b ce call 0x39c16 ; 0x39c16 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b002: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1b004: 84 ef ldi r24, 0xF4 ; 244 1b006: 9b e3 ldi r25, 0x3B ; 59 1b008: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1b00c: 61 e3 ldi r22, 0x31 ; 49 1b00e: 6c 0f add r22, r28 1b010: 2c 2f mov r18, r28 1b012: 4b ee ldi r20, 0xEB ; 235 1b014: 58 ed ldi r21, 0xD8 ; 216 1b016: 0f 94 b4 cd call 0x39b68 ; 0x39b68 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++) 1b01a: cf 5f subi r28, 0xFF ; 255 1b01c: c5 30 cpi r28, 0x05 ; 5 1b01e: 91 f7 brne .-28 ; 0x1b004 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1b020: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1b024: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b028: 8f 5f subi r24, 0xFF ; 255 1b02a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b02e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b032: 8f 5f subi r24, 0xFF ; 255 1b034: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b038: d0 cf rjmp .-96 ; 0x1afda 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(); } 1b03a: cf 91 pop r28 1b03c: 08 95 ret 0001b03e : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1b03e: 84 e0 ldi r24, 0x04 ; 4 1b040: 0d 94 8f 68 jmp 0x2d11e ; 0x2d11e 0001b044 : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1b044: 85 e0 ldi r24, 0x05 ; 5 1b046: 0d 94 8f 68 jmp 0x2d11e ; 0x2d11e 0001b04a : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1b04a: 86 e0 ldi r24, 0x06 ; 6 1b04c: 0d 94 8f 68 jmp 0x2d11e ; 0x2d11e 0001b050 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1b050: 87 e0 ldi r24, 0x07 ; 7 1b052: 0d 94 8f 68 jmp 0x2d11e ; 0x2d11e 0001b056 : 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); 1b056: 88 e0 ldi r24, 0x08 ; 8 1b058: 0d 94 8f 68 jmp 0x2d11e ; 0x2d11e 0001b05c : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1b05c: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1b060: 81 ea ldi r24, 0xA1 ; 161 1b062: 9d e0 ldi r25, 0x0D ; 13 1b064: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1b068: 83 e0 ldi r24, 0x03 ; 3 1b06a: 0d 94 3a d1 jmp 0x3a274 ; 0x3a274 0001b06e : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1b06e: cf 93 push r28 MENU_BEGIN(); 1b070: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1b074: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b078: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b07c: 84 30 cpi r24, 0x04 ; 4 1b07e: 88 f5 brcc .+98 ; 0x1b0e2 1b080: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1b084: 0f 94 0e cd call 0x39a1c ; 0x39a1c 1b088: 81 11 cpse r24, r1 1b08a: 0f 94 be 35 call 0x26b7c ; 0x26b7c clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b08e: 8e e0 ldi r24, 0x0E ; 14 1b090: 9e e3 ldi r25, 0x3E ; 62 1b092: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1b096: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1b09a: 8f e2 ldi r24, 0x2F ; 47 1b09c: 9b e3 ldi r25, 0x3B ; 59 1b09e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1b0a2: 66 ed ldi r22, 0xD6 ; 214 1b0a4: 7b e3 ldi r23, 0x3B ; 59 1b0a6: 0f 94 0b ce call 0x39c16 ; 0x39c16 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b0aa: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1b0ac: 84 ef ldi r24, 0xF4 ; 244 1b0ae: 9b e3 ldi r25, 0x3B ; 59 1b0b0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1b0b4: 61 e3 ldi r22, 0x31 ; 49 1b0b6: 6c 0f add r22, r28 1b0b8: 2c 2f mov r18, r28 1b0ba: 42 e3 ldi r20, 0x32 ; 50 1b0bc: 5a e3 ldi r21, 0x3A ; 58 1b0be: 0f 94 b4 cd call 0x39b68 ; 0x39b68 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++) 1b0c2: cf 5f subi r28, 0xFF ; 255 1b0c4: c5 30 cpi r28, 0x05 ; 5 1b0c6: 91 f7 brne .-28 ; 0x1b0ac MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1b0c8: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1b0cc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b0d0: 8f 5f subi r24, 0xFF ; 255 1b0d2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b0d6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b0da: 8f 5f subi r24, 0xFF ; 255 1b0dc: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b0e0: cb cf rjmp .-106 ; 0x1b078 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(); } 1b0e2: cf 91 pop r28 1b0e4: 08 95 ret 0001b0e6 : } // 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)) { 1b0e6: ef 92 push r14 1b0e8: ff 92 push r15 1b0ea: 0f 93 push r16 1b0ec: 1f 93 push r17 1b0ee: cf 93 push r28 1b0f0: 8c 01 movw r16, r24 1b0f2: 7b 01 movw r14, r22 MENU_BEGIN(); 1b0f4: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1b0f8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 1b0fc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b100: 84 30 cpi r24, 0x04 ; 4 1b102: 28 f5 brcc .+74 ; 0x1b14e 1b104: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 1b108: 0f 94 0e cd call 0x39a1c ; 0x39a1c 1b10c: 81 11 cpse r24, r1 1b10e: 0f 94 be 35 call 0x26b7c ; 0x26b7c clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b112: 8e e0 ldi r24, 0x0E ; 14 1b114: 9e e3 ldi r25, 0x3E ; 62 1b116: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1b11a: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b11e: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1b120: 61 e3 ldi r22, 0x31 ; 49 1b122: 6c 0f add r22, r28 1b124: 2c 2f mov r18, r28 1b126: a7 01 movw r20, r14 1b128: c8 01 movw r24, r16 1b12a: 0f 94 b4 cd call 0x39b68 ; 0x39b68 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b12e: cf 5f subi r28, 0xFF ; 255 1b130: c5 30 cpi r28, 0x05 ; 5 1b132: b1 f7 brne .-20 ; 0x1b120 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1b134: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 // 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(); 1b138: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1b13c: 8f 5f subi r24, 0xFF ; 255 1b13e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1b142: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1b146: 8f 5f subi r24, 0xFF ; 255 1b148: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1b14c: d7 cf rjmp .-82 ; 0x1b0fc ); 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(); } 1b14e: cf 91 pop r28 1b150: 1f 91 pop r17 1b152: 0f 91 pop r16 1b154: ff 90 pop r15 1b156: ef 90 pop r14 1b158: 08 95 ret 0001b15a : 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); 1b15a: 82 e5 ldi r24, 0x52 ; 82 1b15c: 9d e5 ldi r25, 0x5D ; 93 1b15e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1b162: 65 ec ldi r22, 0xC5 ; 197 1b164: 78 ed ldi r23, 0xD8 ; 216 1b166: 0c 94 73 d8 jmp 0x1b0e6 ; 0x1b0e6 0001b16a : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1b16a: 81 e6 ldi r24, 0x61 ; 97 1b16c: 9d e5 ldi r25, 0x5D ; 93 1b16e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1b172: 61 ed ldi r22, 0xD1 ; 209 1b174: 78 ed ldi r23, 0xD8 ; 216 1b176: 0c 94 73 d8 jmp 0x1b0e6 ; 0x1b0e6 0001b17a : 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); 1b17a: 84 ef ldi r24, 0xF4 ; 244 1b17c: 9b e3 ldi r25, 0x3B ; 59 1b17e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1b182: 6c eb ldi r22, 0xBC ; 188 1b184: 7b e3 ldi r23, 0x3B ; 59 1b186: 0c 94 73 d8 jmp 0x1b0e6 ; 0x1b0e6 0001b18a : 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){ 1b18a: cf 93 push r28 1b18c: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1b18e: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 1b192: 88 23 and r24, r24 1b194: 21 f0 breq .+8 ; 0x1b19e 1b196: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1b198: cf 91 pop r28 1b19a: 0d 94 c3 a0 jmp 0x34186 ; 0x34186 1b19e: cf 91 pop r28 1b1a0: 08 95 ret 0001b1a2 : 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) { 1b1a2: cf 93 push r28 1b1a4: c8 2f mov r28, r24 menu_back(); 1b1a6: 0f 94 56 d1 call 0x3a2ac ; 0x3a2ac MMU2::mmu2.eject_filament(filament, true); 1b1aa: 61 e0 ldi r22, 0x01 ; 1 1b1ac: 8c 2f mov r24, r28 1b1ae: 0f 94 46 a0 call 0x3408c ; 0x3408c // Clear the filament action clearFilamentAction(); } 1b1b2: 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(); 1b1b4: 0d 94 be 35 jmp 0x26b7c ; 0x26b7c 0001b1b8 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 1b1b8: 80 e0 ldi r24, 0x00 ; 0 1b1ba: 0f 94 03 a0 call 0x34006 ; 0x34006 1b1be: 81 e0 ldi r24, 0x01 ; 1 1b1c0: 0f 94 03 a0 call 0x34006 ; 0x34006 1b1c4: 82 e0 ldi r24, 0x02 ; 2 1b1c6: 0f 94 03 a0 call 0x34006 ; 0x34006 1b1ca: 83 e0 ldi r24, 0x03 ; 3 1b1cc: 0f 94 03 a0 call 0x34006 ; 0x34006 1b1d0: 84 e0 ldi r24, 0x04 ; 4 1b1d2: 0d 94 03 a0 jmp 0x34006 ; 0x34006 0001b1d6 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1b1d6: 0d 94 03 a0 jmp 0x34006 ; 0x34006 0001b1da : //! //! @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) 1b1da: 4f 92 push r4 1b1dc: 5f 92 push r5 1b1de: 6f 92 push r6 1b1e0: 7f 92 push r7 1b1e2: 8f 92 push r8 1b1e4: 9f 92 push r9 1b1e6: af 92 push r10 1b1e8: bf 92 push r11 1b1ea: cf 92 push r12 1b1ec: df 92 push r13 1b1ee: ef 92 push r14 1b1f0: ff 92 push r15 1b1f2: 0f 93 push r16 1b1f4: 1f 93 push r17 1b1f6: cf 93 push r28 1b1f8: df 93 push r29 1b1fa: 6c 01 movw r12, r24 1b1fc: 7b 01 movw r14, r22 1b1fe: 80 91 95 13 lds r24, 0x1395 ; 0x801395 { //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); 1b202: 67 2b or r22, r23 1b204: 29 f0 breq .+10 ; 0x1b210 1b206: 06 e0 ldi r16, 0x06 ; 6 1b208: 81 30 cpi r24, 0x01 ; 1 1b20a: 29 f0 breq .+10 ; 0x1b216 1b20c: 05 e0 ldi r16, 0x05 ; 5 1b20e: 03 c0 rjmp .+6 ; 0x1b216 1b210: 04 e0 ldi r16, 0x04 ; 4 1b212: 81 30 cpi r24, 0x01 ; 1 1b214: d9 f3 breq .-10 ; 0x1b20c const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1b216: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 KEEPALIVE_STATE(PAUSED_FOR_USER); 1b21a: 84 e0 ldi r24, 0x04 ; 4 1b21c: 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; 1b220: 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; 1b222: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1b224: 03 50 subi r16, 0x03 ; 3 1b226: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1b228: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 1b22c: 81 e0 ldi r24, 0x01 ; 1 1b22e: 0e 94 6b 8c call 0x118d6 ; 0x118d6 if (lcd_encoder) 1b232: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1b236: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1b23a: 00 97 sbiw r24, 0x00 ; 0 1b23c: 09 f4 brne .+2 ; 0x1b240 1b23e: 9d c0 rjmp .+314 ; 0x1b37a { if (lcd_encoder < 0) 1b240: 97 ff sbrs r25, 7 1b242: 88 c0 rjmp .+272 ; 0x1b354 { cursor_pos--; 1b244: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1b246: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1b24a: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } if (cursor_pos > 3) 1b24e: c4 30 cpi r28, 0x04 ; 4 1b250: 0c f4 brge .+2 ; 0x1b254 1b252: 86 c0 rjmp .+268 ; 0x1b360 { cursor_pos = 3; if (first < items_no - 3) 1b254: 88 2d mov r24, r8 1b256: 08 2c mov r0, r8 1b258: 00 0c add r0, r0 1b25a: 99 0b sbc r25, r25 1b25c: 80 17 cp r24, r16 1b25e: 91 07 cpc r25, r17 1b260: 0c f0 brlt .+2 ; 0x1b264 1b262: 7a c0 rjmp .+244 ; 0x1b358 { first++; 1b264: 83 94 inc r8 lcd_clear(); 1b266: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1b26a: 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); 1b26c: c1 14 cp r12, r1 1b26e: d1 04 cpc r13, r1 1b270: 29 f0 breq .+10 ; 0x1b27c 1b272: a6 01 movw r20, r12 1b274: 60 e0 ldi r22, 0x00 ; 0 1b276: 80 e0 ldi r24, 0x00 ; 0 1b278: 0e 94 3a 70 call 0xe074 ; 0xe074 const bool last_visible = (first == items_no - 3); 1b27c: a8 2c mov r10, r8 1b27e: 08 2c mov r0, r8 1b280: 00 0c add r0, r0 1b282: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1b284: e1 14 cp r14, r1 1b286: f1 04 cpc r15, r1 1b288: 29 f0 breq .+10 ; 0x1b294 1b28a: 82 e0 ldi r24, 0x02 ; 2 1b28c: 98 2e mov r9, r24 1b28e: a0 16 cp r10, r16 1b290: b1 06 cpc r11, r17 1b292: 11 f0 breq .+4 ; 0x1b298 1b294: 93 e0 ldi r25, 0x03 ; 3 1b296: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1b298: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1b29a: df 5f subi r29, 0xFF ; 255 1b29c: 4b ee ldi r20, 0xEB ; 235 1b29e: 5e e6 ldi r21, 0x6E ; 110 1b2a0: 6d 2f mov r22, r29 1b2a2: 81 e0 ldi r24, 0x01 ; 1 1b2a4: 0e 94 3a 70 call 0xe074 ; 0xe074 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++) 1b2a8: 9d 12 cpse r9, r29 1b2aa: f7 cf rjmp .-18 ; 0x1b29a 1b2ac: 48 2c mov r4, r8 1b2ae: 08 2c mov r0, r8 1b2b0: 00 0c add r0, r0 1b2b2: 55 08 sbc r5, r5 1b2b4: 66 08 sbc r6, r6 1b2b6: 77 08 sbc r7, r7 1b2b8: 8f ef ldi r24, 0xFF ; 255 1b2ba: 48 1a sub r4, r24 1b2bc: 58 0a sbc r5, r24 1b2be: 68 0a sbc r6, r24 1b2c0: 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++) 1b2c2: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1b2c4: 93 94 inc r9 1b2c6: 69 2d mov r22, r9 1b2c8: 8a e0 ldi r24, 0x0A ; 10 1b2ca: 0e 94 26 70 call 0xe04c ; 0xe04c 1b2ce: c3 01 movw r24, r6 1b2d0: b2 01 movw r22, r4 1b2d2: 0e 94 df 71 call 0xe3be ; 0xe3be 1b2d6: 8f ef ldi r24, 0xFF ; 255 1b2d8: 48 1a sub r4, r24 1b2da: 58 0a sbc r5, r24 1b2dc: 68 0a sbc r6, r24 1b2de: 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++) 1b2e0: d9 11 cpse r29, r9 1b2e2: f0 cf rjmp .-32 ; 0x1b2c4 { 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); 1b2e4: e1 14 cp r14, r1 1b2e6: f1 04 cpc r15, r1 1b2e8: 41 f0 breq .+16 ; 0x1b2fa 1b2ea: a0 16 cp r10, r16 1b2ec: b1 06 cpc r11, r17 1b2ee: 29 f4 brne .+10 ; 0x1b2fa 1b2f0: a7 01 movw r20, r14 1b2f2: 63 e0 ldi r22, 0x03 ; 3 1b2f4: 81 e0 ldi r24, 0x01 ; 1 1b2f6: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1b2fa: 45 ea ldi r20, 0xA5 ; 165 1b2fc: 51 e9 ldi r21, 0x91 ; 145 1b2fe: 61 e0 ldi r22, 0x01 ; 1 1b300: 80 e0 ldi r24, 0x00 ; 0 1b302: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_putc_at(0, cursor_pos, '>'); 1b306: 4e e3 ldi r20, 0x3E ; 62 1b308: 6c 2f mov r22, r28 1b30a: 80 e0 ldi r24, 0x00 ; 0 1b30c: 0e 94 46 70 call 0xe08c ; 0xe08c _delay(100); 1b310: 64 e6 ldi r22, 0x64 ; 100 1b312: 70 e0 ldi r23, 0x00 ; 0 1b314: 80 e0 ldi r24, 0x00 ; 0 1b316: 90 e0 ldi r25, 0x00 ; 0 1b318: 0f 94 5c 3c call 0x278b8 ; 0x278b8 if (lcd_clicked()) 1b31c: 0e 94 43 72 call 0xe486 ; 0xe486 1b320: 88 23 and r24, r24 1b322: 09 f4 brne .+2 ; 0x1b326 1b324: 81 cf rjmp .-254 ; 0x1b228 { KEEPALIVE_STATE(IN_HANDLER); 1b326: 82 e0 ldi r24, 0x02 ; 2 1b328: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(cursor_pos + first - 1); 1b32c: 8f ef ldi r24, 0xFF ; 255 1b32e: 8c 0f add r24, r28 1b330: 88 0d add r24, r8 } } } 1b332: df 91 pop r29 1b334: cf 91 pop r28 1b336: 1f 91 pop r17 1b338: 0f 91 pop r16 1b33a: ff 90 pop r15 1b33c: ef 90 pop r14 1b33e: df 90 pop r13 1b340: cf 90 pop r12 1b342: bf 90 pop r11 1b344: af 90 pop r10 1b346: 9f 90 pop r9 1b348: 8f 90 pop r8 1b34a: 7f 90 pop r7 1b34c: 6f 90 pop r6 1b34e: 5f 90 pop r5 1b350: 4f 90 pop r4 1b352: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b354: cf 5f subi r28, 0xFF ; 255 1b356: 77 cf rjmp .-274 ; 0x1b246 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); 1b358: 87 e0 ldi r24, 0x07 ; 7 1b35a: 0f 94 2e 63 call 0x2c65c ; 0x2c65c 1b35e: 85 cf rjmp .-246 ; 0x1b26a } } if (cursor_pos < 1) 1b360: c1 11 cpse r28, r1 1b362: 84 cf rjmp .-248 ; 0x1b26c { cursor_pos = 1; if (first > 0) 1b364: 18 14 cp r1, r8 1b366: 2c f4 brge .+10 ; 0x1b372 { first--; 1b368: 8a 94 dec r8 lcd_clear(); 1b36a: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 } } if (cursor_pos < 1) { cursor_pos = 1; 1b36e: c1 e0 ldi r28, 0x01 ; 1 1b370: 7d cf rjmp .-262 ; 0x1b26c if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b372: 87 e0 ldi r24, 0x07 ; 7 1b374: 0f 94 2e 63 call 0x2c65c ; 0x2c65c 1b378: fa cf rjmp .-12 ; 0x1b36e cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1b37a: c4 30 cpi r28, 0x04 ; 4 1b37c: 0c f0 brlt .+2 ; 0x1b380 1b37e: 6a cf rjmp .-300 ; 0x1b254 1b380: 75 cf rjmp .-278 ; 0x1b26c 0001b382 : } #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) { 1b382: 4f 92 push r4 1b384: 5f 92 push r5 1b386: 6f 92 push r6 1b388: 7f 92 push r7 1b38a: af 92 push r10 1b38c: bf 92 push r11 1b38e: cf 92 push r12 1b390: df 92 push r13 1b392: ef 92 push r14 1b394: ff 92 push r15 1b396: 0f 93 push r16 1b398: 1f 93 push r17 1b39a: cf 93 push r28 1b39c: df 93 push r29 1b39e: 24 e0 ldi r18, 0x04 ; 4 1b3a0: 30 e0 ldi r19, 0x00 ; 0 1b3a2: 41 e0 ldi r20, 0x01 ; 1 1b3a4: 50 e0 ldi r21, 0x00 ; 0 1b3a6: d9 01 movw r26, r18 1b3a8: a7 55 subi r26, 0x57 ; 87 1b3aa: b4 47 sbci r27, 0x74 ; 116 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 1b3ac: fd 01 movw r30, r26 1b3ae: 65 91 lpm r22, Z+ 1b3b0: 74 91 lpm r23, Z 1b3b2: 86 17 cp r24, r22 1b3b4: 97 07 cpc r25, r23 1b3b6: 0c f0 brlt .+2 ; 0x1b3ba 1b3b8: 66 c0 rjmp .+204 ; 0x1b486 { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b3ba: 41 50 subi r20, 0x01 ; 1 1b3bc: 51 09 sbc r21, r1 1b3be: 44 0f add r20, r20 1b3c0: 55 1f adc r21, r21 1b3c2: 44 0f add r20, r20 1b3c4: 55 1f adc r21, r21 1b3c6: ea 01 movw r28, r20 1b3c8: c5 55 subi r28, 0x55 ; 85 1b3ca: d4 47 sbci r29, 0x74 ; 116 1b3cc: fe 01 movw r30, r28 1b3ce: 05 91 lpm r16, Z+ 1b3d0: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 1b3d2: 47 55 subi r20, 0x57 ; 87 1b3d4: 54 47 sbci r21, 0x74 ; 116 1b3d6: fa 01 movw r30, r20 1b3d8: 65 91 lpm r22, Z+ 1b3da: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b3dc: f9 01 movw r30, r18 1b3de: e5 55 subi r30, 0x55 ; 85 1b3e0: f4 47 sbci r31, 0x74 ; 116 1b3e2: e5 90 lpm r14, Z+ 1b3e4: f4 90 lpm r15, Z 1b3e6: fe 01 movw r30, r28 1b3e8: c5 90 lpm r12, Z+ 1b3ea: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 1b3ec: fd 01 movw r30, r26 1b3ee: c5 91 lpm r28, Z+ 1b3f0: d4 91 lpm r29, Z 1b3f2: fa 01 movw r30, r20 1b3f4: a5 90 lpm r10, Z+ 1b3f6: 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])) * 1b3f8: 86 1b sub r24, r22 1b3fa: 97 0b sbc r25, r23 1b3fc: bc 01 movw r22, r24 1b3fe: 99 0f add r25, r25 1b400: 88 0b sbc r24, r24 1b402: 99 0b sbc r25, r25 1b404: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1b408: 2b 01 movw r4, r22 1b40a: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b40c: b7 01 movw r22, r14 1b40e: 6c 19 sub r22, r12 1b410: 7d 09 sbc r23, r13 1b412: 07 2e mov r0, r23 1b414: 00 0c add r0, r0 1b416: 88 0b sbc r24, r24 1b418: 99 0b sbc r25, r25 1b41a: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1b41e: 9b 01 movw r18, r22 1b420: 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])) * 1b422: c3 01 movw r24, r6 1b424: b2 01 movw r22, r4 1b426: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b42a: 6b 01 movw r12, r22 1b42c: 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])); 1b42e: be 01 movw r22, r28 1b430: 6a 19 sub r22, r10 1b432: 7b 09 sbc r23, r11 1b434: 07 2e mov r0, r23 1b436: 00 0c add r0, r0 1b438: 88 0b sbc r24, r24 1b43a: 99 0b sbc r25, r25 1b43c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1b440: 9b 01 movw r18, r22 1b442: 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])) / 1b444: c7 01 movw r24, r14 1b446: b6 01 movw r22, r12 1b448: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1b44c: 6b 01 movw r12, r22 1b44e: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b450: b8 01 movw r22, r16 1b452: 11 0f add r17, r17 1b454: 88 0b sbc r24, r24 1b456: 99 0b sbc r25, r25 1b458: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1b45c: 9b 01 movw r18, r22 1b45e: ac 01 movw r20, r24 1b460: c7 01 movw r24, r14 1b462: b6 01 movw r22, r12 1b464: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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; } 1b468: df 91 pop r29 1b46a: cf 91 pop r28 1b46c: 1f 91 pop r17 1b46e: 0f 91 pop r16 1b470: ff 90 pop r15 1b472: ef 90 pop r14 1b474: df 90 pop r13 1b476: cf 90 pop r12 1b478: bf 90 pop r11 1b47a: af 90 pop r10 1b47c: 7f 90 pop r7 1b47e: 6f 90 pop r6 1b480: 5f 90 pop r5 1b482: 4f 90 pop r4 1b484: 08 95 ret 1b486: 4f 5f subi r20, 0xFF ; 255 1b488: 5f 4f sbci r21, 0xFF ; 255 1b48a: 2c 5f subi r18, 0xFC ; 252 1b48c: 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 1b494: 88 cf rjmp .-240 ; 0x1b3a6 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 1b496: e7 e2 ldi r30, 0x27 ; 39 1b498: fc e8 ldi r31, 0x8C ; 140 1b49a: 65 91 lpm r22, Z+ 1b49c: 74 91 lpm r23, Z 1b49e: 07 2e mov r0, r23 1b4a0: 00 0c add r0, r0 1b4a2: 88 0b sbc r24, r24 1b4a4: 99 0b sbc r25, r25 1b4a6: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1b4aa: de cf rjmp .-68 ; 0x1b468 0001b4ac : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1b4ac: 1f 93 push r17 1b4ae: cf 93 push r28 1b4b0: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1b4b2: e1 e0 ldi r30, 0x01 ; 1 1b4b4: f1 e0 ldi r31, 0x01 ; 1 1b4b6: 80 81 ld r24, Z 1b4b8: 8e 7f andi r24, 0xFE ; 254 1b4ba: 80 83 st Z, r24 PORTH |= 0x01; 1b4bc: e2 e0 ldi r30, 0x02 ; 2 1b4be: f1 e0 ldi r31, 0x01 ; 1 1b4c0: 80 81 ld r24, Z 1b4c2: 81 60 ori r24, 0x01 ; 1 1b4c4: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1b4c6: ef e1 ldi r30, 0x1F ; 31 1b4c8: f5 e0 ldi r31, 0x05 ; 5 1b4ca: 90 e1 ldi r25, 0x10 ; 16 1b4cc: 90 83 st Z, r25 ptr[1] = 0; 1b4ce: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1b4d0: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1b4d2: e0 ed ldi r30, 0xD0 ; 208 1b4d4: f0 e0 ldi r31, 0x00 ; 0 1b4d6: 80 81 ld r24, Z 1b4d8: 82 60 ori r24, 0x02 ; 2 1b4da: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1b4dc: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1b4e0: e1 ed ldi r30, 0xD1 ; 209 1b4e2: f0 e0 ldi r31, 0x00 ; 0 1b4e4: 88 e1 ldi r24, 0x18 ; 24 1b4e6: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1b4e8: 80 81 ld r24, Z 1b4ea: 80 68 ori r24, 0x80 ; 128 1b4ec: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1b4ee: ef e6 ldi r30, 0x6F ; 111 1b4f0: f2 e1 ldi r31, 0x12 ; 18 1b4f2: 80 ee ldi r24, 0xE0 ; 224 1b4f4: 9b e3 ldi r25, 0x3B ; 59 1b4f6: 91 87 std Z+9, r25 ; 0x09 1b4f8: 80 87 std Z+8, r24 ; 0x08 1b4fa: 8a ed ldi r24, 0xDA ; 218 1b4fc: 9a e3 ldi r25, 0x3A ; 58 1b4fe: 93 87 std Z+11, r25 ; 0x0b 1b500: 82 87 std Z+10, r24 ; 0x0a 1b502: 13 e0 ldi r17, 0x03 ; 3 1b504: 13 83 std Z+3, r17 ; 0x03 1b506: 15 86 std Z+13, r1 ; 0x0d 1b508: 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); 1b50a: 9f b7 in r25, 0x3f ; 63 1b50c: f8 94 cli 1b50e: e5 e0 ldi r30, 0x05 ; 5 1b510: f1 e0 ldi r31, 0x01 ; 1 1b512: 80 81 ld r24, Z 1b514: 80 62 ori r24, 0x20 ; 32 1b516: 80 83 st Z, r24 1b518: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1b51a: e4 e0 ldi r30, 0x04 ; 4 1b51c: f1 e0 ldi r31, 0x01 ; 1 1b51e: 80 81 ld r24, Z 1b520: 80 62 ori r24, 0x20 ; 32 1b522: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1b524: 0f 94 97 c2 call 0x3852e ; 0x3852e mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1b528: 83 e6 ldi r24, 0x63 ; 99 1b52a: 0f 94 53 87 call 0x30ea6 ; 0x30ea6 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1b52e: 81 e2 ldi r24, 0x21 ; 33 1b530: 97 ea ldi r25, 0xA7 ; 167 1b532: 0e 94 97 7b call 0xf72e ; 0xf72e retryAttempts = MAX_RETRIES; 1b536: c6 e2 ldi r28, 0x26 ; 38 1b538: d3 e1 ldi r29, 0x13 ; 19 1b53a: 10 93 7a 13 sts 0x137A, r17 ; 0x80137a } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1b53e: 87 eb ldi r24, 0xB7 ; 183 1b540: 9a ea ldi r25, 0xAA ; 170 1b542: 0e 94 97 7b call 0xf72e ; 0xf72e /// @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; } 1b546: 8a e0 ldi r24, 0x0A ; 10 1b548: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1b54a: 82 e0 ldi r24, 0x02 ; 2 1b54c: 80 93 95 13 sts 0x1395, r24 ; 0x801395 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1b550: 81 e0 ldi r24, 0x01 ; 1 1b552: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1b554: 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; 1b556: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1b558: 86 e0 ldi r24, 0x06 ; 6 1b55a: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1b55c: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1b55e: df 91 pop r29 1b560: cf 91 pop r28 1b562: 1f 91 pop r17 1b564: 0d 94 26 98 jmp 0x3304c ; 0x3304c 0001b568 : useU2X = false; } #endif // set up the first (original serial port) if (useU2X) { M_UCSRxA = 1 << M_U2Xx; 1b568: 22 e0 ldi r18, 0x02 ; 2 1b56a: 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; 1b56e: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> M_UBRRxL = baud_setting; 1b572: 90 e1 ldi r25, 0x10 ; 16 1b574: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> sbi(M_UCSRxB, M_RXENx); 1b578: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b57c: 80 61 ori r24, 0x10 ; 16 1b57e: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_TXENx); 1b582: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b586: 88 60 ori r24, 0x08 ; 8 1b588: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_RXCIEx); 1b58c: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b590: 80 68 ori r24, 0x80 ; 128 1b592: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> if (selectedSerialPort == 1) { //set up also the second serial port 1b596: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 1b59a: 81 30 cpi r24, 0x01 ; 1 1b59c: a9 f4 brne .+42 ; 0x1b5c8 if (useU2X) { UCSR1A = 1 << U2X1; 1b59e: 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; 1b5a2: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> UBRR1L = baud_setting; 1b5a6: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> sbi(UCSR1B, RXEN1); 1b5aa: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b5ae: 80 61 ori r24, 0x10 ; 16 1b5b0: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, TXEN1); 1b5b4: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b5b8: 88 60 ori r24, 0x08 ; 8 1b5ba: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, RXCIE1); 1b5be: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b5c2: 80 68 ori r24, 0x80 ; 128 1b5c4: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> } } 1b5c8: 08 95 ret 0001b5ca : { 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) 1b5ca: 2f 92 push r2 1b5cc: 3f 92 push r3 1b5ce: 4f 92 push r4 1b5d0: 5f 92 push r5 1b5d2: 6f 92 push r6 1b5d4: 7f 92 push r7 1b5d6: 8f 92 push r8 1b5d8: 9f 92 push r9 1b5da: af 92 push r10 1b5dc: bf 92 push r11 1b5de: cf 92 push r12 1b5e0: df 92 push r13 1b5e2: ef 92 push r14 1b5e4: ff 92 push r15 1b5e6: 0f 93 push r16 1b5e8: 1f 93 push r17 1b5ea: cf 93 push r28 1b5ec: df 93 push r29 1b5ee: 00 d0 rcall .+0 ; 0x1b5f0 1b5f0: 00 d0 rcall .+0 ; 0x1b5f2 1b5f2: 1f 92 push r1 1b5f4: cd b7 in r28, 0x3d ; 61 1b5f6: de b7 in r29, 0x3e ; 62 1b5f8: 69 83 std Y+1, r22 ; 0x01 1b5fa: 49 01 movw r8, r18 1b5fc: 5a 01 movw r10, r20 1b5fe: 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; 1b600: 68 2f mov r22, r24 1b602: 70 e0 ldi r23, 0x00 ; 0 1b604: 90 e0 ldi r25, 0x00 ; 0 1b606: 80 e0 ldi r24, 0x00 ; 0 1b608: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1b60c: 24 e0 ldi r18, 0x04 ; 4 1b60e: 32 e0 ldi r19, 0x02 ; 2 1b610: 41 e0 ldi r20, 0x01 ; 1 1b612: 5c e3 ldi r21, 0x3C ; 60 1b614: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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] 1b618: 20 91 b5 12 lds r18, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 1b61c: 30 91 b6 12 lds r19, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 1b620: 40 91 b7 12 lds r20, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 1b624: 50 91 b8 12 lds r21, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> 1b628: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b62c: 6b 01 movw r12, r22 1b62e: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1b630: 20 91 b9 12 lds r18, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 1b634: 30 91 ba 12 lds r19, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 1b638: 40 91 bb 12 lds r20, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 1b63c: 50 91 bc 12 lds r21, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> 1b640: c5 01 movw r24, r10 1b642: b4 01 movw r22, r8 1b644: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b648: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 1b64c: 30 91 be 12 lds r19, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 1b650: 40 91 bf 12 lds r20, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 1b654: 50 91 c0 12 lds r21, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> 1b658: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1b65c: a7 01 movw r20, r14 1b65e: 96 01 movw r18, r12 1b660: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b664: 6b 01 movw r12, r22 1b666: 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; 1b668: 20 91 0b 13 lds r18, 0x130B ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 1b66c: 30 91 0c 13 lds r19, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 1b670: 40 91 0d 13 lds r20, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 1b674: 50 91 0e 13 lds r21, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> 1b678: c8 01 movw r24, r16 1b67a: b2 01 movw r22, r4 1b67c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1b680: 9b 01 movw r18, r22 1b682: 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 1b684: c5 01 movw r24, r10 1b686: b4 01 movw r22, r8 1b688: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__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) 1b68c: 39 81 ldd r19, Y+1 ; 0x01 1b68e: 24 e0 ldi r18, 0x04 ; 4 1b690: 32 9f mul r19, r18 1b692: f0 01 movw r30, r0 1b694: 11 24 eor r1, r1 1b696: e5 53 subi r30, 0x35 ; 53 1b698: 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 1b69a: 20 81 ld r18, Z 1b69c: 31 81 ldd r19, Z+1 ; 0x01 1b69e: 42 81 ldd r20, Z+2 ; 0x02 1b6a0: 53 81 ldd r21, Z+3 ; 0x03 1b6a2: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1b6a6: 9b 01 movw r18, r22 1b6a8: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1b6aa: c7 01 movw r24, r14 1b6ac: b6 01 movw r22, r12 1b6ae: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1b6b2: 20 91 18 13 lds r18, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8d> 1b6b6: 30 91 19 13 lds r19, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8e> 1b6ba: 40 91 1a 13 lds r20, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8f> 1b6be: 50 91 1b 13 lds r21, 0x131B ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.394+0x90> 1b6c2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b6c6: 6f 83 std Y+7, r22 ; 0x07 1b6c8: 79 83 std Y+1, r23 ; 0x01 1b6ca: 18 2f mov r17, r24 1b6cc: 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); 1b6ce: 20 91 ac 12 lds r18, 0x12AC ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.394+0x21> 1b6d2: e2 2f mov r30, r18 1b6d4: f0 e0 ldi r31, 0x00 ; 0 1b6d6: 80 91 ab 12 lds r24, 0x12AB ; 0x8012ab <_ZN13thermal_modelL4dataE.lto_priv.394+0x20> 1b6da: 81 50 subi r24, 0x01 ; 1 1b6dc: 99 0b sbc r25, r25 1b6de: e8 17 cp r30, r24 1b6e0: f9 07 cpc r31, r25 1b6e2: 09 f4 brne .+2 ; 0x1b6e6 1b6e4: f4 c0 rjmp .+488 ; 0x1b8ce 1b6e6: 2f 5f subi r18, 0xFF ; 255 1b6e8: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1b6ea: 5e 81 ldd r21, Y+6 ; 0x06 1b6ec: 44 e0 ldi r20, 0x04 ; 4 1b6ee: 54 9f mul r21, r20 1b6f0: 10 01 movw r2, r0 1b6f2: 11 24 eor r1, r1 1b6f4: d1 01 movw r26, r2 1b6f6: a5 57 subi r26, 0x75 ; 117 1b6f8: bd 4e sbci r27, 0xED ; 237 1b6fa: 2d 91 ld r18, X+ 1b6fc: 3d 91 ld r19, X+ 1b6fe: 4d 91 ld r20, X+ 1b700: 5c 91 ld r21, X 1b702: 2a 83 std Y+2, r18 ; 0x02 1b704: 3b 83 std Y+3, r19 ; 0x03 1b706: 4c 83 std Y+4, r20 ; 0x04 1b708: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1b70a: ee 0f add r30, r30 1b70c: ff 1f adc r31, r31 1b70e: ee 0f add r30, r30 1b710: ff 1f adc r31, r31 1b712: e5 57 subi r30, 0x75 ; 117 1b714: fd 4e sbci r31, 0xED ; 237 1b716: 40 80 ld r4, Z 1b718: 51 80 ldd r5, Z+1 ; 0x01 1b71a: 62 80 ldd r6, Z+2 ; 0x02 1b71c: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1b71e: c0 90 c5 12 lds r12, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 1b722: d0 90 c6 12 lds r13, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 1b726: e0 90 c7 12 lds r14, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 1b72a: f0 90 c8 12 lds r15, 0x12C8 ; 0x8012c8 <_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; 1b72e: 92 01 movw r18, r4 1b730: a3 01 movw r20, r6 1b732: b2 01 movw r22, r4 1b734: c3 01 movw r24, r6 1b736: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1b73a: 88 23 and r24, r24 1b73c: 21 f0 breq .+8 ; 0x1b746 1b73e: 4f 80 ldd r4, Y+7 ; 0x07 1b740: 59 80 ldd r5, Y+1 ; 0x01 1b742: 61 2e mov r6, r17 1b744: 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; 1b746: a1 01 movw r20, r2 1b748: 45 57 subi r20, 0x75 ; 117 1b74a: 5d 4e sbci r21, 0xED ; 237 1b74c: 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); 1b74e: a7 01 movw r20, r14 1b750: 96 01 movw r18, r12 1b752: 60 e0 ldi r22, 0x00 ; 0 1b754: 70 e0 ldi r23, 0x00 ; 0 1b756: 80 e8 ldi r24, 0x80 ; 128 1b758: 9f e3 ldi r25, 0x3F ; 63 1b75a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1b75e: 92 01 movw r18, r4 1b760: a3 01 movw r20, r6 1b762: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b766: 2b 01 movw r4, r22 1b768: 3c 01 movw r6, r24 1b76a: a7 01 movw r20, r14 1b76c: 96 01 movw r18, r12 1b76e: 6f 81 ldd r22, Y+7 ; 0x07 1b770: 79 81 ldd r23, Y+1 ; 0x01 1b772: 81 2f mov r24, r17 1b774: 90 2f mov r25, r16 1b776: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b77a: 9b 01 movw r18, r22 1b77c: ac 01 movw r20, r24 1b77e: c3 01 movw r24, r6 1b780: b2 01 movw r22, r4 1b782: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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; 1b786: f1 01 movw r30, r2 1b788: 60 83 st Z, r22 1b78a: 71 83 std Z+1, r23 ; 0x01 1b78c: 82 83 std Z+2, r24 ; 0x02 1b78e: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1b790: fe 81 ldd r31, Y+6 ; 0x06 1b792: f0 93 ac 12 sts 0x12AC, r31 ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.394+0x21> // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; 1b796: 20 91 b1 12 lds r18, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x26> 1b79a: 30 91 b2 12 lds r19, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x27> 1b79e: 40 91 b3 12 lds r20, 0x12B3 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x28> 1b7a2: 50 91 b4 12 lds r21, 0x12B4 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x29> 1b7a6: c5 01 movw r24, r10 1b7a8: b4 01 movw r22, r8 1b7aa: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1b7ae: 2a 81 ldd r18, Y+2 ; 0x02 1b7b0: 3b 81 ldd r19, Y+3 ; 0x03 1b7b2: 4c 81 ldd r20, Y+4 ; 0x04 1b7b4: 5d 81 ldd r21, Y+5 ; 0x05 1b7b6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1b7ba: 2b 01 movw r4, r22 1b7bc: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1b7be: c0 90 ad 12 lds r12, 0x12AD ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 1b7c2: d0 90 ae 12 lds r13, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 1b7c6: e0 90 af 12 lds r14, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 1b7ca: f0 90 b0 12 lds r15, 0x12B0 ; 0x8012b0 <_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; 1b7ce: a7 01 movw r20, r14 1b7d0: 96 01 movw r18, r12 1b7d2: c7 01 movw r24, r14 1b7d4: b6 01 movw r22, r12 1b7d6: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 1b7da: 88 23 and r24, r24 1b7dc: 19 f0 breq .+6 ; 0x1b7e4 1b7de: c1 2c mov r12, r1 1b7e0: d1 2c mov r13, r1 1b7e2: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1b7e4: 23 e3 ldi r18, 0x33 ; 51 1b7e6: 33 e3 ldi r19, 0x33 ; 51 1b7e8: 43 e7 ldi r20, 0x73 ; 115 1b7ea: 5f e3 ldi r21, 0x3F ; 63 1b7ec: c7 01 movw r24, r14 1b7ee: b6 01 movw r22, r12 1b7f0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b7f4: 6b 01 movw r12, r22 1b7f6: 7c 01 movw r14, r24 1b7f8: 2d ec ldi r18, 0xCD ; 205 1b7fa: 3c ec ldi r19, 0xCC ; 204 1b7fc: 4c e4 ldi r20, 0x4C ; 76 1b7fe: 5d e3 ldi r21, 0x3D ; 61 1b800: c3 01 movw r24, r6 1b802: b2 01 movw r22, r4 1b804: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b808: 9b 01 movw r18, r22 1b80a: ac 01 movw r20, r24 1b80c: c7 01 movw r24, r14 1b80e: b6 01 movw r22, r12 1b810: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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; 1b814: 80 92 b1 12 sts 0x12B1, r8 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x26> 1b818: 90 92 b2 12 sts 0x12B2, r9 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x27> 1b81c: a0 92 b3 12 sts 0x12B3, r10 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x28> 1b820: b0 92 b4 12 sts 0x12B4, r11 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x29> dT_err_prev = dT_err_f; 1b824: 60 93 ad 12 sts 0x12AD, r22 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 1b828: 70 93 ae 12 sts 0x12AE, r23 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 1b82c: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 1b830: 90 93 b0 12 sts 0x12B0, r25 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> // check and trigger errors flag_bits.error = (fabsf(dT_err_f) > err_s); 1b834: 6b 01 movw r12, r22 1b836: 7c 01 movw r14, r24 1b838: e8 94 clt 1b83a: f7 f8 bld r15, 7 1b83c: 21 e0 ldi r18, 0x01 ; 1 1b83e: 29 83 std Y+1, r18 ; 0x01 1b840: 20 91 20 13 lds r18, 0x1320 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.394+0x95> 1b844: 30 91 21 13 lds r19, 0x1321 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.394+0x96> 1b848: 40 91 22 13 lds r20, 0x1322 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.394+0x97> 1b84c: 50 91 23 13 lds r21, 0x1323 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.394+0x98> 1b850: c7 01 movw r24, r14 1b852: b6 01 movw r22, r12 1b854: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1b858: 18 16 cp r1, r24 1b85a: 0c f0 brlt .+2 ; 0x1b85e 1b85c: 19 82 std Y+1, r1 ; 0x01 1b85e: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 1b862: 39 81 ldd r19, Y+1 ; 0x01 1b864: 30 fb bst r19, 0 1b866: 81 f9 bld r24, 1 1b868: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1b86c: 41 e0 ldi r20, 0x01 ; 1 1b86e: 49 83 std Y+1, r20 ; 0x01 1b870: 20 91 1c 13 lds r18, 0x131C ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.394+0x91> 1b874: 30 91 1d 13 lds r19, 0x131D ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.394+0x92> 1b878: 40 91 1e 13 lds r20, 0x131E ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.394+0x93> 1b87c: 50 91 1f 13 lds r21, 0x131F ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.394+0x94> 1b880: c7 01 movw r24, r14 1b882: b6 01 movw r22, r12 1b884: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1b888: 18 16 cp r1, r24 1b88a: 0c f0 brlt .+2 ; 0x1b88e 1b88c: 19 82 std Y+1, r1 ; 0x01 1b88e: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 1b892: 59 81 ldd r21, Y+1 ; 0x01 1b894: 50 fb bst r21, 0 1b896: 82 f9 bld r24, 2 1b898: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> } 1b89c: 27 96 adiw r28, 0x07 ; 7 1b89e: 0f b6 in r0, 0x3f ; 63 1b8a0: f8 94 cli 1b8a2: de bf out 0x3e, r29 ; 62 1b8a4: 0f be out 0x3f, r0 ; 63 1b8a6: cd bf out 0x3d, r28 ; 61 1b8a8: df 91 pop r29 1b8aa: cf 91 pop r28 1b8ac: 1f 91 pop r17 1b8ae: 0f 91 pop r16 1b8b0: ff 90 pop r15 1b8b2: ef 90 pop r14 1b8b4: df 90 pop r13 1b8b6: cf 90 pop r12 1b8b8: bf 90 pop r11 1b8ba: af 90 pop r10 1b8bc: 9f 90 pop r9 1b8be: 8f 90 pop r8 1b8c0: 7f 90 pop r7 1b8c2: 6f 90 pop r6 1b8c4: 5f 90 pop r5 1b8c6: 4f 90 pop r4 1b8c8: 3f 90 pop r3 1b8ca: 2f 90 pop r2 1b8cc: 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); 1b8ce: 1e 82 std Y+6, r1 ; 0x06 1b8d0: 0c cf rjmp .-488 ; 0x1b6ea 0001b8d2 : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1b8d2: 2f 92 push r2 1b8d4: 3f 92 push r3 1b8d6: 4f 92 push r4 1b8d8: 5f 92 push r5 1b8da: 6f 92 push r6 1b8dc: 7f 92 push r7 1b8de: 8f 92 push r8 1b8e0: 9f 92 push r9 1b8e2: af 92 push r10 1b8e4: bf 92 push r11 1b8e6: cf 92 push r12 1b8e8: df 92 push r13 1b8ea: ef 92 push r14 1b8ec: ff 92 push r15 1b8ee: 0f 93 push r16 1b8f0: 1f 93 push r17 1b8f2: cf 93 push r28 1b8f4: df 93 push r29 1b8f6: cd b7 in r28, 0x3d ; 61 1b8f8: de b7 in r29, 0x3e ; 62 1b8fa: a4 97 sbiw r28, 0x24 ; 36 1b8fc: 0f b6 in r0, 0x3f ; 63 1b8fe: f8 94 cli 1b900: de bf out 0x3e, r29 ; 62 1b902: 0f be out 0x3f, r0 ; 63 1b904: cd bf out 0x3d, r28 ; 61 1b906: 9b 8f std Y+27, r25 ; 0x1b 1b908: 8a 8f std Y+26, r24 ; 0x1a 1b90a: 7a 8b std Y+18, r23 ; 0x12 1b90c: 69 8b std Y+17, r22 ; 0x11 1b90e: 2b 8b std Y+19, r18 ; 0x13 1b910: 3c 8b std Y+20, r19 ; 0x14 1b912: 4d 8b std Y+21, r20 ; 0x15 1b914: 5e 8b std Y+22, r21 ; 0x16 1b916: 0c 8f std Y+28, r16 ; 0x1c 1b918: cd 8e std Y+29, r12 ; 0x1d 1b91a: de 8e std Y+30, r13 ; 0x1e 1b91c: ef 8e std Y+31, r14 ; 0x1f 1b91e: 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; 1b920: 20 91 1d 05 lds r18, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> 1b924: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1b926: 80 e0 ldi r24, 0x00 ; 0 1b928: 0f 94 69 47 call 0x28ed2 ; 0x28ed2 float orig = *var; 1b92c: a9 89 ldd r26, Y+17 ; 0x11 1b92e: ba 89 ldd r27, Y+18 ; 0x12 1b930: 8d 91 ld r24, X+ 1b932: 9d 91 ld r25, X+ 1b934: 0d 90 ld r0, X+ 1b936: bc 91 ld r27, X 1b938: a0 2d mov r26, r0 1b93a: 89 a3 std Y+33, r24 ; 0x21 1b93c: 9a a3 std Y+34, r25 ; 0x22 1b93e: ab a3 std Y+35, r26 ; 0x23 1b940: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1b942: 80 e0 ldi r24, 0x00 ; 0 1b944: 90 e0 ldi r25, 0x00 ; 0 1b946: a0 ea ldi r26, 0xA0 ; 160 1b948: b0 e4 ldi r27, 0x40 ; 64 1b94a: 89 83 std Y+1, r24 ; 0x01 1b94c: 9a 83 std Y+2, r25 ; 0x02 1b94e: ab 83 std Y+3, r26 ; 0x03 1b950: bc 83 std Y+4, r27 ; 0x04 1b952: 8b 89 ldd r24, Y+19 ; 0x13 1b954: 9c 89 ldd r25, Y+20 ; 0x14 1b956: ad 89 ldd r26, Y+21 ; 0x15 1b958: be 89 ldd r27, Y+22 ; 0x16 1b95a: 8d 83 std Y+5, r24 ; 0x05 1b95c: 9e 83 std Y+6, r25 ; 0x06 1b95e: af 83 std Y+7, r26 ; 0x07 1b960: 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]); 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: bc 01 movw r22, r24 1b96c: cd 01 movw r24, r26 1b96e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1b972: 2a e7 ldi r18, 0x7A ; 122 1b974: 37 e3 ldi r19, 0x37 ; 55 1b976: 4e e1 ldi r20, 0x1E ; 30 1b978: 5f e3 ldi r21, 0x3F ; 63 1b97a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1b97e: 6b 01 movw r12, r22 1b980: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 1b982: 20 e0 ldi r18, 0x00 ; 0 1b984: 30 e0 ldi r19, 0x00 ; 0 1b986: 40 ea ldi r20, 0xA0 ; 160 1b988: 50 e4 ldi r21, 0x40 ; 64 1b98a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1b98e: 69 87 std Y+9, r22 ; 0x09 1b990: 7a 87 std Y+10, r23 ; 0x0a 1b992: 8b 87 std Y+11, r24 ; 0x0b 1b994: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1b996: a7 01 movw r20, r14 1b998: 96 01 movw r18, r12 1b99a: 6b 89 ldd r22, Y+19 ; 0x13 1b99c: 7c 89 ldd r23, Y+20 ; 0x14 1b99e: 8d 89 ldd r24, Y+21 ; 0x15 1b9a0: 9e 89 ldd r25, Y+22 ; 0x16 1b9a2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1b9a6: 6d 87 std Y+13, r22 ; 0x0d 1b9a8: 7e 87 std Y+14, r23 ; 0x0e 1b9aa: 8f 87 std Y+15, r24 ; 0x0f 1b9ac: 98 8b std Y+16, r25 ; 0x10 1b9ae: 31 2c mov r3, r1 1b9b0: 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); 1b9b2: 29 85 ldd r18, Y+9 ; 0x09 1b9b4: 3a 85 ldd r19, Y+10 ; 0x0a 1b9b6: 4b 85 ldd r20, Y+11 ; 0x0b 1b9b8: 5c 85 ldd r21, Y+12 ; 0x0c 1b9ba: cd 8c ldd r12, Y+29 ; 0x1d 1b9bc: de 8c ldd r13, Y+30 ; 0x1e 1b9be: ef 8c ldd r14, Y+31 ; 0x1f 1b9c0: f8 a0 ldd r15, Y+32 ; 0x20 1b9c2: 0c 8d ldd r16, Y+28 ; 0x1c 1b9c4: 69 89 ldd r22, Y+17 ; 0x11 1b9c6: 7a 89 ldd r23, Y+18 ; 0x12 1b9c8: 8a 8d ldd r24, Y+26 ; 0x1a 1b9ca: 9b 8d ldd r25, Y+27 ; 0x1b 1b9cc: 0f 94 b6 41 call 0x2836c ; 0x2836c 1b9d0: 4b 01 movw r8, r22 1b9d2: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1b9d4: 2d 85 ldd r18, Y+13 ; 0x0d 1b9d6: 3e 85 ldd r19, Y+14 ; 0x0e 1b9d8: 4f 85 ldd r20, Y+15 ; 0x0f 1b9da: 58 89 ldd r21, Y+16 ; 0x10 1b9dc: cd 8c ldd r12, Y+29 ; 0x1d 1b9de: de 8c ldd r13, Y+30 ; 0x1e 1b9e0: ef 8c ldd r14, Y+31 ; 0x1f 1b9e2: f8 a0 ldd r15, Y+32 ; 0x20 1b9e4: 0c 8d ldd r16, Y+28 ; 0x1c 1b9e6: 69 89 ldd r22, Y+17 ; 0x11 1b9e8: 7a 89 ldd r23, Y+18 ; 0x12 1b9ea: 8a 8d ldd r24, Y+26 ; 0x1a 1b9ec: 9b 8d ldd r25, Y+27 ; 0x1b 1b9ee: 0f 94 b6 41 call 0x2836c ; 0x2836c 1b9f2: 9b 01 movw r18, r22 1b9f4: ac 01 movw r20, r24 bool dir = (c2 < c1); 1b9f6: 11 e0 ldi r17, 0x01 ; 1 1b9f8: c5 01 movw r24, r10 1b9fa: b4 01 movw r22, r8 1b9fc: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1ba00: 18 16 cp r1, r24 1ba02: 0c f0 brlt .+2 ; 0x1ba06 1ba04: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1ba06: 01 e0 ldi r16, 0x01 ; 1 1ba08: 01 27 eor r16, r17 1ba0a: 80 2f mov r24, r16 1ba0c: 90 e0 ldi r25, 0x00 ; 0 1ba0e: e1 2f mov r30, r17 1ba10: f0 e0 ldi r31, 0x00 ; 0 1ba12: ee 0f add r30, r30 1ba14: ff 1f adc r31, r31 1ba16: ee 0f add r30, r30 1ba18: ff 1f adc r31, r31 1ba1a: 41 e0 ldi r20, 0x01 ; 1 1ba1c: 50 e0 ldi r21, 0x00 ; 0 1ba1e: 4c 0f add r20, r28 1ba20: 5d 1f adc r21, r29 1ba22: 4e 0f add r20, r30 1ba24: 5f 1f adc r21, r31 1ba26: 8c 01 movw r16, r24 1ba28: 00 0f add r16, r16 1ba2a: 11 1f adc r17, r17 1ba2c: 00 0f add r16, r16 1ba2e: 11 1f adc r17, r17 1ba30: a1 e0 ldi r26, 0x01 ; 1 1ba32: b0 e0 ldi r27, 0x00 ; 0 1ba34: ac 0f add r26, r28 1ba36: bd 1f adc r27, r29 1ba38: 0a 0f add r16, r26 1ba3a: 1b 1f adc r17, r27 1ba3c: f8 01 movw r30, r16 1ba3e: 38 96 adiw r30, 0x08 ; 8 1ba40: f8 8f std Y+24, r31 ; 0x18 1ba42: ef 8b std Y+23, r30 ; 0x17 1ba44: f8 01 movw r30, r16 1ba46: 80 85 ldd r24, Z+8 ; 0x08 1ba48: 91 85 ldd r25, Z+9 ; 0x09 1ba4a: a2 85 ldd r26, Z+10 ; 0x0a 1ba4c: b3 85 ldd r27, Z+11 ; 0x0b 1ba4e: fa 01 movw r30, r20 1ba50: 80 83 st Z, r24 1ba52: 91 83 std Z+1, r25 ; 0x01 1ba54: a2 83 std Z+2, r26 ; 0x02 1ba56: 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]); 1ba58: 8d 80 ldd r8, Y+5 ; 0x05 1ba5a: 9e 80 ldd r9, Y+6 ; 0x06 1ba5c: af 80 ldd r10, Y+7 ; 0x07 1ba5e: b8 84 ldd r11, Y+8 ; 0x08 1ba60: c9 80 ldd r12, Y+1 ; 0x01 1ba62: da 80 ldd r13, Y+2 ; 0x02 1ba64: eb 80 ldd r14, Y+3 ; 0x03 1ba66: fc 80 ldd r15, Y+4 ; 0x04 1ba68: a7 01 movw r20, r14 1ba6a: 96 01 movw r18, r12 1ba6c: c5 01 movw r24, r10 1ba6e: b4 01 movw r22, r8 1ba70: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1ba74: 2a e7 ldi r18, 0x7A ; 122 1ba76: 37 e3 ldi r19, 0x37 ; 55 1ba78: 4e e1 ldi r20, 0x1E ; 30 1ba7a: 5f e3 ldi r21, 0x3F ; 63 1ba7c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ba80: 2b 01 movw r4, r22 1ba82: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1ba84: ac 01 movw r20, r24 1ba86: 9b 01 movw r18, r22 1ba88: c7 01 movw r24, r14 1ba8a: b6 01 movw r22, r12 1ba8c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1ba90: 69 87 std Y+9, r22 ; 0x09 1ba92: 7a 87 std Y+10, r23 ; 0x0a 1ba94: 8b 87 std Y+11, r24 ; 0x0b 1ba96: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1ba98: a3 01 movw r20, r6 1ba9a: 92 01 movw r18, r4 1ba9c: c5 01 movw r24, r10 1ba9e: b4 01 movw r22, r8 1baa0: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1baa4: 6d 87 std Y+13, r22 ; 0x0d 1baa6: 7e 87 std Y+14, r23 ; 0x0e 1baa8: 8f 87 std Y+15, r24 ; 0x0f 1baaa: 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]; 1baac: d8 01 movw r26, r16 1baae: 18 96 adiw r26, 0x08 ; 8 1bab0: 4c 90 ld r4, X 1bab2: ef 89 ldd r30, Y+23 ; 0x17 1bab4: f8 8d ldd r31, Y+24 ; 0x18 1bab6: 51 80 ldd r5, Z+1 ; 0x01 1bab8: 62 80 ldd r6, Z+2 ; 0x02 1baba: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1babc: a5 01 movw r20, r10 1babe: 94 01 movw r18, r8 1bac0: c7 01 movw r24, r14 1bac2: b6 01 movw r22, r12 1bac4: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1bac8: 24 2d mov r18, r4 1baca: 35 2d mov r19, r5 1bacc: 46 2d mov r20, r6 1bace: 57 2d mov r21, r7 1bad0: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1bad4: 9f 77 andi r25, 0x7F ; 127 1bad6: 2c e0 ldi r18, 0x0C ; 12 1bad8: 31 e9 ldi r19, 0x91 ; 145 1bada: 43 ec ldi r20, 0xC3 ; 195 1badc: 5e e3 ldi r21, 0x3E ; 62 1bade: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1bae2: 6b 01 movw r12, r22 1bae4: 7c 01 movw r14, r24 1bae6: 5b 01 movw r10, r22 1bae8: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1baea: ff 92 push r15 1baec: 8f 93 push r24 1baee: df 92 push r13 1baf0: 6f 93 push r22 1baf2: 7f 92 push r7 1baf4: 6f 92 push r6 1baf6: 5f 92 push r5 1baf8: 4f 92 push r4 1bafa: 3f 92 push r3 1bafc: 2f 92 push r2 1bafe: 2b e7 ldi r18, 0x7B ; 123 1bb00: 31 e9 ldi r19, 0x91 ; 145 1bb02: 3f 93 push r19 1bb04: 2f 93 push r18 1bb06: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if(e < thr) { 1bb0a: 0f b6 in r0, 0x3f ; 63 1bb0c: f8 94 cli 1bb0e: de bf out 0x3e, r29 ; 62 1bb10: 0f be out 0x3f, r0 ; 63 1bb12: cd bf out 0x3d, r28 ; 61 1bb14: 2a e0 ldi r18, 0x0A ; 10 1bb16: 37 ed ldi r19, 0xD7 ; 215 1bb18: 43 e2 ldi r20, 0x23 ; 35 1bb1a: 5c e3 ldi r21, 0x3C ; 60 1bb1c: 6c 2d mov r22, r12 1bb1e: 7d 2d mov r23, r13 1bb20: 8e 2d mov r24, r14 1bb22: 9f 2d mov r25, r15 1bb24: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1bb28: 87 ff sbrs r24, 7 1bb2a: 42 c0 rjmp .+132 ; 0x1bbb0 if(x == min || x == max) { 1bb2c: 20 e0 ldi r18, 0x00 ; 0 1bb2e: 30 e0 ldi r19, 0x00 ; 0 1bb30: 40 ea ldi r20, 0xA0 ; 160 1bb32: 50 e4 ldi r21, 0x40 ; 64 1bb34: 64 2d mov r22, r4 1bb36: 75 2d mov r23, r5 1bb38: 86 2d mov r24, r6 1bb3a: 97 2d mov r25, r7 1bb3c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1bb40: 88 23 and r24, r24 1bb42: f1 f1 breq .+124 ; 0x1bbc0 1bb44: 24 2d mov r18, r4 1bb46: 35 2d mov r19, r5 1bb48: 46 2d mov r20, r6 1bb4a: 57 2d mov r21, r7 1bb4c: 6b 89 ldd r22, Y+19 ; 0x13 1bb4e: 7c 89 ldd r23, Y+20 ; 0x14 1bb50: 8d 89 ldd r24, Y+21 ; 0x15 1bb52: 9e 89 ldd r25, Y+22 ; 0x16 1bb54: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1bb58: 88 23 and r24, r24 1bb5a: 91 f1 breq .+100 ; 0x1bbc0 // real value likely outside of the search boundaries break; } *var = x; 1bb5c: 84 2d mov r24, r4 1bb5e: 95 2d mov r25, r5 1bb60: a6 2d mov r26, r6 1bb62: b7 2d mov r27, r7 1bb64: e9 89 ldd r30, Y+17 ; 0x11 1bb66: fa 89 ldd r31, Y+18 ; 0x12 1bb68: 80 83 st Z, r24 1bb6a: 91 83 std Z+1, r25 ; 0x01 1bb6c: a2 83 std Z+2, r26 ; 0x02 1bb6e: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bb70: 89 8d ldd r24, Y+25 ; 0x19 1bb72: 0f 94 69 47 call 0x28ed2 ; 0x28ed2 SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1bb76: 6a 2d mov r22, r10 1bb78: 7b 2d mov r23, r11 1bb7a: 80 2f mov r24, r16 1bb7c: 91 2f mov r25, r17 1bb7e: a4 96 adiw r28, 0x24 ; 36 1bb80: 0f b6 in r0, 0x3f ; 63 1bb82: f8 94 cli 1bb84: de bf out 0x3e, r29 ; 62 1bb86: 0f be out 0x3f, r0 ; 63 1bb88: cd bf out 0x3d, r28 ; 61 1bb8a: df 91 pop r29 1bb8c: cf 91 pop r28 1bb8e: 1f 91 pop r17 1bb90: 0f 91 pop r16 1bb92: ff 90 pop r15 1bb94: ef 90 pop r14 1bb96: df 90 pop r13 1bb98: cf 90 pop r12 1bb9a: bf 90 pop r11 1bb9c: af 90 pop r10 1bb9e: 9f 90 pop r9 1bba0: 8f 90 pop r8 1bba2: 7f 90 pop r7 1bba4: 6f 90 pop r6 1bba6: 5f 90 pop r5 1bba8: 4f 90 pop r4 1bbaa: 3f 90 pop r3 1bbac: 2f 90 pop r2 1bbae: 08 95 ret 1bbb0: ff ef ldi r31, 0xFF ; 255 1bbb2: 2f 1a sub r2, r31 1bbb4: 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) { 1bbb6: 2e e1 ldi r18, 0x1E ; 30 1bbb8: 22 16 cp r2, r18 1bbba: 31 04 cpc r3, r1 1bbbc: 09 f0 breq .+2 ; 0x1bbc0 1bbbe: f9 ce rjmp .-526 ; 0x1b9b2 thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1bbc0: 8c e5 ldi r24, 0x5C ; 92 1bbc2: 91 e9 ldi r25, 0x91 ; 145 1bbc4: 0e 94 97 7b call 0xf72e ; 0xf72e *var = orig; 1bbc8: 89 a1 ldd r24, Y+33 ; 0x21 1bbca: 9a a1 ldd r25, Y+34 ; 0x22 1bbcc: ab a1 ldd r26, Y+35 ; 0x23 1bbce: bc a1 ldd r27, Y+36 ; 0x24 1bbd0: e9 89 ldd r30, Y+17 ; 0x11 1bbd2: fa 89 ldd r31, Y+18 ; 0x12 1bbd4: 80 83 st Z, r24 1bbd6: 91 83 std Z+1, r25 ; 0x01 1bbd8: a2 83 std Z+2, r26 ; 0x02 1bbda: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bbdc: 89 8d ldd r24, Y+25 ; 0x19 1bbde: 0f 94 69 47 call 0x28ed2 ; 0x28ed2 return NAN; 1bbe2: a1 2c mov r10, r1 1bbe4: b1 2c mov r11, r1 1bbe6: 00 ec ldi r16, 0xC0 ; 192 1bbe8: 1f e7 ldi r17, 0x7F ; 127 1bbea: c5 cf rjmp .-118 ; 0x1bb76 0001bbec : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1bbec: ef 92 push r14 1bbee: ff 92 push r15 1bbf0: 0f 93 push r16 1bbf2: 1f 93 push r17 1bbf4: cf 93 push r28 1bbf6: df 93 push r29 1bbf8: 00 d0 rcall .+0 ; 0x1bbfa 1bbfa: 1f 92 push r1 1bbfc: 1f 92 push r1 1bbfe: cd b7 in r28, 0x3d ; 61 1bc00: de b7 in r29, 0x3e ; 62 1bc02: 08 2f mov r16, r24 1bc04: 16 2f mov r17, r22 1bc06: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1bc08: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 1bc0c: 88 23 and r24, r24 1bc0e: d9 f0 breq .+54 ; 0x1bc46 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) { 1bc10: 0b 30 cpi r16, 0x0B ; 11 1bc12: 29 f1 breq .+74 ; 0x1bc5e 1bc14: 04 31 cpi r16, 0x14 ; 20 1bc16: 31 f1 breq .+76 ; 0x1bc64 /// @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()) { 1bc18: 87 e5 ldi r24, 0x57 ; 87 1bc1a: e8 2e mov r14, r24 1bc1c: e9 82 std Y+1, r14 ; 0x01 1bc1e: 0a 83 std Y+2, r16 ; 0x02 1bc20: 1b 83 std Y+3, r17 ; 0x03 1bc22: fc 82 std Y+4, r15 ; 0x04 1bc24: ce 01 movw r24, r28 1bc26: 01 96 adiw r24, 0x01 ; 1 1bc28: 0f 94 66 c2 call 0x384cc ; 0x384cc 1bc2c: 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)); 1bc2e: 47 e5 ldi r20, 0x57 ; 87 1bc30: 50 2f mov r21, r16 1bc32: 61 2f mov r22, r17 1bc34: 7f 2d mov r23, r15 1bc36: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 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)); 1bc3a: 60 e0 ldi r22, 0x00 ; 0 1bc3c: 80 e0 ldi r24, 0x00 ; 0 1bc3e: 0f 94 20 9f call 0x33e40 ; 0x33e40 1bc42: 88 23 and r24, r24 1bc44: 59 f3 breq .-42 ; 0x1bc1c return true; } 1bc46: 0f 90 pop r0 1bc48: 0f 90 pop r0 1bc4a: 0f 90 pop r0 1bc4c: 0f 90 pop r0 1bc4e: 0f 90 pop r0 1bc50: df 91 pop r29 1bc52: cf 91 pop r28 1bc54: 1f 91 pop r17 1bc56: 0f 91 pop r16 1bc58: ff 90 pop r15 1bc5a: ef 90 pop r14 1bc5c: 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); 1bc5e: 10 93 72 13 sts 0x1372, r17 ; 0x801372 1bc62: da cf rjmp .-76 ; 0x1bc18 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1bc64: 10 93 73 13 sts 0x1373, r17 ; 0x801373 1bc68: d7 cf rjmp .-82 ; 0x1bc18 0001bc6a : #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) 1bc6a: 82 30 cpi r24, 0x02 ; 2 1bc6c: 91 05 cpc r25, r1 1bc6e: 38 f0 brcs .+14 ; 0x1bc7e // 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 1bc70: 88 0f add r24, r24 1bc72: 99 1f adc r25, r25 1bc74: 88 0f add r24, r24 1bc76: 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, 1bc78: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1bc7a: 01 97 sbiw r24, 0x01 ; 1 1bc7c: f1 f7 brne .-4 ; 0x1bc7a "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1bc7e: 08 95 ret 0001bc80 : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1bc80: cf 93 push r28 1bc82: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1bc84: 28 2f mov r18, r24 1bc86: 30 e0 ldi r19, 0x00 ; 0 1bc88: f9 01 movw r30, r18 1bc8a: e1 58 subi r30, 0x81 ; 129 1bc8c: f0 47 sbci r31, 0x70 ; 112 1bc8e: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1bc90: f9 01 movw r30, r18 1bc92: e7 5d subi r30, 0xD7 ; 215 1bc94: f0 47 sbci r31, 0x70 ; 112 1bc96: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1bc98: f9 01 movw r30, r18 1bc9a: ed 52 subi r30, 0x2D ; 45 1bc9c: f1 47 sbci r31, 0x71 ; 113 1bc9e: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1bca0: cc 23 and r28, r28 1bca2: a1 f0 breq .+40 ; 0x1bccc // 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); 1bca4: 81 11 cpse r24, r1 1bca6: 0e 94 b7 ce call 0x19d6e ; 0x19d6e if (*portInputRegister(port) & bit) return HIGH; 1bcaa: ec 2f mov r30, r28 1bcac: f0 e0 ldi r31, 0x00 ; 0 1bcae: ee 0f add r30, r30 1bcb0: ff 1f adc r31, r31 1bcb2: e7 54 subi r30, 0x47 ; 71 1bcb4: f1 47 sbci r31, 0x71 ; 113 1bcb6: a5 91 lpm r26, Z+ 1bcb8: b4 91 lpm r27, Z 1bcba: ec 91 ld r30, X 1bcbc: ed 23 and r30, r29 1bcbe: 81 e0 ldi r24, 0x01 ; 1 1bcc0: 90 e0 ldi r25, 0x00 ; 0 1bcc2: 09 f4 brne .+2 ; 0x1bcc6 1bcc4: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1bcc6: df 91 pop r29 1bcc8: cf 91 pop r28 1bcca: 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; 1bccc: 80 e0 ldi r24, 0x00 ; 0 1bcce: 90 e0 ldi r25, 0x00 ; 0 1bcd0: fa cf rjmp .-12 ; 0x1bcc6 0001bcd2 : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1bcd2: 1f 93 push r17 1bcd4: cf 93 push r28 1bcd6: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1bcd8: 28 2f mov r18, r24 1bcda: 30 e0 ldi r19, 0x00 ; 0 1bcdc: f9 01 movw r30, r18 1bcde: e1 58 subi r30, 0x81 ; 129 1bce0: f0 47 sbci r31, 0x70 ; 112 1bce2: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1bce4: f9 01 movw r30, r18 1bce6: e7 5d subi r30, 0xD7 ; 215 1bce8: f0 47 sbci r31, 0x70 ; 112 1bcea: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1bcec: f9 01 movw r30, r18 1bcee: ed 52 subi r30, 0x2D ; 45 1bcf0: f1 47 sbci r31, 0x71 ; 113 1bcf2: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1bcf4: cc 23 and r28, r28 1bcf6: a9 f0 breq .+42 ; 0x1bd22 1bcf8: 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); 1bcfa: 81 11 cpse r24, r1 1bcfc: 0e 94 b7 ce call 0x19d6e ; 0x19d6e out = portOutputRegister(port); 1bd00: ec 2f mov r30, r28 1bd02: f0 e0 ldi r31, 0x00 ; 0 1bd04: ee 0f add r30, r30 1bd06: ff 1f adc r31, r31 1bd08: e1 56 subi r30, 0x61 ; 97 1bd0a: f1 47 sbci r31, 0x71 ; 113 1bd0c: a5 91 lpm r26, Z+ 1bd0e: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1bd10: 8f b7 in r24, 0x3f ; 63 cli(); 1bd12: f8 94 cli if (val == LOW) { *out &= ~bit; 1bd14: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1bd16: 11 11 cpse r17, r1 1bd18: 08 c0 rjmp .+16 ; 0x1bd2a *out &= ~bit; 1bd1a: d0 95 com r29 1bd1c: de 23 and r29, r30 } else { *out |= bit; 1bd1e: dc 93 st X, r29 } SREG = oldSREG; 1bd20: 8f bf out 0x3f, r24 ; 63 } 1bd22: df 91 pop r29 1bd24: cf 91 pop r28 1bd26: 1f 91 pop r17 1bd28: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1bd2a: de 2b or r29, r30 1bd2c: f8 cf rjmp .-16 ; 0x1bd1e 0001bd2e : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1bd2e: cf 93 push r28 1bd30: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1bd32: 90 e0 ldi r25, 0x00 ; 0 1bd34: fc 01 movw r30, r24 1bd36: e7 5d subi r30, 0xD7 ; 215 1bd38: f0 47 sbci r31, 0x70 ; 112 1bd3a: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1bd3c: 8d 52 subi r24, 0x2D ; 45 1bd3e: 91 47 sbci r25, 0x71 ; 113 1bd40: fc 01 movw r30, r24 1bd42: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1bd44: 88 23 and r24, r24 1bd46: d1 f0 breq .+52 ; 0x1bd7c // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1bd48: 90 e0 ldi r25, 0x00 ; 0 1bd4a: 88 0f add r24, r24 1bd4c: 99 1f adc r25, r25 1bd4e: fc 01 movw r30, r24 1bd50: eb 57 subi r30, 0x7B ; 123 1bd52: f1 47 sbci r31, 0x71 ; 113 1bd54: a5 91 lpm r26, Z+ 1bd56: b4 91 lpm r27, Z out = portOutputRegister(port); 1bd58: fc 01 movw r30, r24 1bd5a: e1 56 subi r30, 0x61 ; 97 1bd5c: f1 47 sbci r31, 0x71 ; 113 1bd5e: c5 91 lpm r28, Z+ 1bd60: d4 91 lpm r29, Z if (mode == INPUT) { 1bd62: 61 11 cpse r22, r1 1bd64: 0e c0 rjmp .+28 ; 0x1bd82 uint8_t oldSREG = SREG; 1bd66: 9f b7 in r25, 0x3f ; 63 cli(); 1bd68: f8 94 cli *reg &= ~bit; 1bd6a: 8c 91 ld r24, X 1bd6c: e2 2f mov r30, r18 1bd6e: e0 95 com r30 1bd70: 8e 23 and r24, r30 1bd72: 8c 93 st X, r24 *out &= ~bit; 1bd74: 28 81 ld r18, Y 1bd76: e2 23 and r30, r18 1bd78: e8 83 st Y, r30 SREG = oldSREG; 1bd7a: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1bd7c: df 91 pop r29 1bd7e: cf 91 pop r28 1bd80: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1bd82: 8f b7 in r24, 0x3f ; 63 cli(); 1bd84: f8 94 cli *reg |= bit; 1bd86: ec 91 ld r30, X 1bd88: e2 2b or r30, r18 1bd8a: ec 93 st X, r30 SREG = oldSREG; 1bd8c: 8f bf out 0x3f, r24 ; 63 1bd8e: f6 cf rjmp .-20 ; 0x1bd7c 0001bd90 : // 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) { 1bd90: 1f 93 push r17 1bd92: cf 93 push r28 1bd94: df 93 push r29 1bd96: 18 2f mov r17, r24 1bd98: 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); 1bd9a: 61 e0 ldi r22, 0x01 ; 1 1bd9c: 0e 94 97 de call 0x1bd2e ; 0x1bd2e if (val == 0) 1bda0: 20 97 sbiw r28, 0x00 ; 0 1bda2: 39 f4 brne .+14 ; 0x1bdb2 { digitalWrite(pin, LOW); 1bda4: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1bda6: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1bda8: df 91 pop r29 1bdaa: cf 91 pop r28 1bdac: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1bdae: 0c 94 69 de jmp 0x1bcd2 ; 0x1bcd2 pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1bdb2: cf 3f cpi r28, 0xFF ; 255 1bdb4: d1 05 cpc r29, r1 1bdb6: 11 f4 brne .+4 ; 0x1bdbc { digitalWrite(pin, HIGH); 1bdb8: 61 e0 ldi r22, 0x01 ; 1 1bdba: f5 cf rjmp .-22 ; 0x1bda6 } else { switch(digitalPinToTimer(pin)) 1bdbc: e1 2f mov r30, r17 1bdbe: f0 e0 ldi r31, 0x00 ; 0 1bdc0: e1 58 subi r30, 0x81 ; 129 1bdc2: f0 47 sbci r31, 0x70 ; 112 1bdc4: e4 91 lpm r30, Z 1bdc6: e1 50 subi r30, 0x01 ; 1 1bdc8: e2 31 cpi r30, 0x12 ; 18 1bdca: 08 f0 brcs .+2 ; 0x1bdce 1bdcc: b3 c0 rjmp .+358 ; 0x1bf34 1bdce: f0 e0 ldi r31, 0x00 ; 0 1bdd0: 88 27 eor r24, r24 1bdd2: e2 51 subi r30, 0x12 ; 18 1bdd4: f1 42 sbci r31, 0x21 ; 33 1bdd6: 8f 4f sbci r24, 0xFF ; 255 1bdd8: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 1bddc: 00 df rcall .-512 ; 0x1bbde 1bdde: 08 df rcall .-496 ; 0x1bbf0 1bde0: 0d df rcall .-486 ; 0x1bbfc 1bde2: 17 df rcall .-466 ; 0x1bc12 1bde4: 21 df rcall .-446 ; 0x1bc28 1bde6: 9a df rcall .-204 ; 0x1bd1c 1bde8: 2b df rcall .-426 ; 0x1bc40 1bdea: 33 df rcall .-410 ; 0x1bc52 1bdec: 3b df rcall .-394 ; 0x1bc64 1bdee: 45 df rcall .-374 ; 0x1bc7a 1bdf0: 4f df rcall .-354 ; 0x1bc90 1bdf2: 59 df rcall .-334 ; 0x1bca6 1bdf4: 68 df rcall .-304 ; 0x1bcc6 1bdf6: 72 df rcall .-284 ; 0x1bcdc 1bdf8: 9a df rcall .-204 ; 0x1bd2e 1bdfa: 7c df rcall .-264 ; 0x1bcf4 1bdfc: 86 df rcall .-244 ; 0x1bd0a 1bdfe: 90 df rcall .-224 ; 0x1bd20 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1be00: 84 b5 in r24, 0x24 ; 36 1be02: 80 68 ori r24, 0x80 ; 128 1be04: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1be06: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1be08: df 91 pop r29 1be0a: cf 91 pop r28 1be0c: 1f 91 pop r17 1be0e: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1be10: 84 b5 in r24, 0x24 ; 36 1be12: 80 62 ori r24, 0x20 ; 32 1be14: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1be16: c8 bd out 0x28, r28 ; 40 1be18: f7 cf rjmp .-18 ; 0x1be08 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1be1a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1be1e: 80 68 ori r24, 0x80 ; 128 1be20: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1be24: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1be28: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1be2c: ed cf rjmp .-38 ; 0x1be08 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1be2e: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1be32: 80 62 ori r24, 0x20 ; 32 1be34: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1be38: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1be3c: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1be40: e3 cf rjmp .-58 ; 0x1be08 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1be42: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1be46: 88 60 ori r24, 0x08 ; 8 1be48: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1be4c: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1be50: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1be54: d9 cf rjmp .-78 ; 0x1be08 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1be56: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1be5a: 80 68 ori r24, 0x80 ; 128 1be5c: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1be60: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1be64: d1 cf rjmp .-94 ; 0x1be08 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1be66: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1be6a: 80 62 ori r24, 0x20 ; 32 1be6c: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1be70: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1be74: c9 cf rjmp .-110 ; 0x1be08 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1be76: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1be7a: 80 68 ori r24, 0x80 ; 128 1be7c: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1be80: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1be84: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1be88: bf cf rjmp .-130 ; 0x1be08 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1be8a: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1be8e: 80 62 ori r24, 0x20 ; 32 1be90: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1be94: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1be98: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1be9c: b5 cf rjmp .-150 ; 0x1be08 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1be9e: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1bea2: 88 60 ori r24, 0x08 ; 8 1bea4: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1bea8: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1beac: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1beb0: ab cf rjmp .-170 ; 0x1be08 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1beb2: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1beb6: 80 68 ori r24, 0x80 ; 128 1beb8: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1bebc: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1bec0: 8f 7b andi r24, 0xBF ; 191 1bec2: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1bec6: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1beca: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1bece: 9c cf rjmp .-200 ; 0x1be08 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1bed0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1bed4: 80 62 ori r24, 0x20 ; 32 1bed6: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1beda: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1bede: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1bee2: 92 cf rjmp .-220 ; 0x1be08 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1bee4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1bee8: 88 60 ori r24, 0x08 ; 8 1beea: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1beee: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1bef2: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1bef6: 88 cf rjmp .-240 ; 0x1be08 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1bef8: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1befc: 80 68 ori r24, 0x80 ; 128 1befe: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1bf02: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1bf06: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1bf0a: 7e cf rjmp .-260 ; 0x1be08 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1bf0c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1bf10: 80 62 ori r24, 0x20 ; 32 1bf12: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1bf16: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1bf1a: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1bf1e: 74 cf rjmp .-280 ; 0x1be08 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1bf20: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1bf24: 88 60 ori r24, 0x08 ; 8 1bf26: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1bf2a: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1bf2e: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1bf32: 6a cf rjmp .-300 ; 0x1be08 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1bf34: c0 38 cpi r28, 0x80 ; 128 1bf36: d1 05 cpc r29, r1 1bf38: 0c f0 brlt .+2 ; 0x1bf3c 1bf3a: 3e cf rjmp .-388 ; 0x1bdb8 1bf3c: 33 cf rjmp .-410 ; 0x1bda4 0001bf3e : } } /// 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){ 1bf3e: 4f 92 push r4 1bf40: 5f 92 push r5 1bf42: 6f 92 push r6 1bf44: 7f 92 push r7 1bf46: 8f 92 push r8 1bf48: 9f 92 push r9 1bf4a: af 92 push r10 1bf4c: bf 92 push r11 1bf4e: cf 92 push r12 1bf50: df 92 push r13 1bf52: ef 92 push r14 1bf54: ff 92 push r15 1bf56: 0f 93 push r16 1bf58: 1f 93 push r17 1bf5a: cf 93 push r28 1bf5c: 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 1bf5e: 86 b9 out 0x06, r24 ; 6 1bf60: fa 01 movw r30, r20 1bf62: e0 80 ld r14, Z 1bf64: 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){ 1bf66: 16 16 cp r1, r22 1bf68: 17 06 cpc r1, r23 1bf6a: b4 f4 brge .+44 ; 0x1bf98 1bf6c: e2 16 cp r14, r18 1bf6e: f3 06 cpc r15, r19 1bf70: 99 f4 brne .+38 ; 0x1bf98 delayMicroseconds(delay_us); 1bf72: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1bf74: df 91 pop r29 1bf76: cf 91 pop r28 1bf78: 1f 91 pop r17 1bf7a: 0f 91 pop r16 1bf7c: ff 90 pop r15 1bf7e: ef 90 pop r14 1bf80: df 90 pop r13 1bf82: cf 90 pop r12 1bf84: bf 90 pop r11 1bf86: af 90 pop r10 1bf88: 9f 90 pop r9 1bf8a: 8f 90 pop r8 1bf8c: 7f 90 pop r7 1bf8e: 6f 90 pop r6 1bf90: 5f 90 pop r5 1bf92: 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); 1bf94: 0c 94 35 de jmp 0x1bc6a ; 0x1bc6a 1bf98: 89 01 movw r16, r18 1bf9a: 6a 01 movw r12, r20 1bf9c: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1bf9e: b7 01 movw r22, r14 1bfa0: 90 e0 ldi r25, 0x00 ; 0 1bfa2: 80 e0 ldi r24, 0x00 ; 0 1bfa4: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 1bfa8: 2d eb ldi r18, 0xBD ; 189 1bfaa: 37 e3 ldi r19, 0x37 ; 55 1bfac: 46 e8 ldi r20, 0x86 ; 134 1bfae: 55 e3 ldi r21, 0x35 ; 53 1bfb0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1bfb4: 4b 01 movw r8, r22 1bfb6: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1bfb8: be 01 movw r22, r28 1bfba: 0d 2e mov r0, r29 1bfbc: 00 0c add r0, r0 1bfbe: 88 0b sbc r24, r24 1bfc0: 99 0b sbc r25, r25 1bfc2: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1bfc6: a5 01 movw r20, r10 1bfc8: 94 01 movw r18, r8 1bfca: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1bfce: 2b 01 movw r4, r22 1bfd0: 3c 01 movw r6, r24 1bfd2: a5 01 movw r20, r10 1bfd4: 94 01 movw r18, r8 1bfd6: 6a e0 ldi r22, 0x0A ; 10 1bfd8: 77 ed ldi r23, 0xD7 ; 215 1bfda: 83 e2 ldi r24, 0x23 ; 35 1bfdc: 9c e3 ldi r25, 0x3C ; 60 1bfde: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1bfe2: 9b 01 movw r18, r22 1bfe4: ac 01 movw r20, r24 1bfe6: c3 01 movw r24, r6 1bfe8: b2 01 movw r22, r4 1bfea: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1bfee: 4b 01 movw r8, r22 1bff0: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1bff2: 2a e0 ldi r18, 0x0A ; 10 1bff4: 37 ed ldi r19, 0xD7 ; 215 1bff6: 43 e2 ldi r20, 0x23 ; 35 1bff8: 5e e3 ldi r21, 0x3E ; 62 1bffa: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1bffe: 18 16 cp r1, r24 1c000: dc f5 brge .+118 ; 0x1c078 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)); 1c002: a5 01 movw r20, r10 1c004: 94 01 movw r18, r8 1c006: 6a e0 ldi r22, 0x0A ; 10 1c008: 77 ed ldi r23, 0xD7 ; 215 1c00a: 83 e2 ldi r24, 0x23 ; 35 1c00c: 9c e3 ldi r25, 0x3C ; 60 1c00e: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1c012: 20 e0 ldi r18, 0x00 ; 0 1c014: 34 e2 ldi r19, 0x24 ; 36 1c016: 44 e7 ldi r20, 0x74 ; 116 1c018: 59 e4 ldi r21, 0x49 ; 73 1c01a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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); 1c01e: 20 e0 ldi r18, 0x00 ; 0 1c020: 30 e0 ldi r19, 0x00 ; 0 1c022: 40 e0 ldi r20, 0x00 ; 0 1c024: 5f e3 ldi r21, 0x3F ; 63 1c026: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1c02a: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 1c02e: 5b 01 movw r10, r22 1c030: 60 17 cp r22, r16 1c032: 71 07 cpc r23, r17 1c034: 08 f4 brcc .+2 ; 0x1c038 1c036: 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){ 1c038: ea 14 cp r14, r10 1c03a: fb 04 cpc r15, r11 1c03c: 31 f4 brne .+12 ; 0x1c04a 1c03e: 20 97 sbiw r28, 0x00 ; 0 1c040: 21 f0 breq .+8 ; 0x1c04a if (acc > 0) 1c042: fc f0 brlt .+62 ; 0x1c082 t1--; 1c044: f1 e0 ldi r31, 0x01 ; 1 1c046: af 1a sub r10, r31 1c048: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1c04a: c5 01 movw r24, r10 1c04c: 0e 94 35 de call 0x1bc6a ; 0x1bc6a delay_us = t1; 1c050: f6 01 movw r30, r12 1c052: b1 82 std Z+1, r11 ; 0x01 1c054: a0 82 st Z, r10 } 1c056: df 91 pop r29 1c058: cf 91 pop r28 1c05a: 1f 91 pop r17 1c05c: 0f 91 pop r16 1c05e: ff 90 pop r15 1c060: ef 90 pop r14 1c062: df 90 pop r13 1c064: cf 90 pop r12 1c066: bf 90 pop r11 1c068: af 90 pop r10 1c06a: 9f 90 pop r9 1c06c: 8f 90 pop r8 1c06e: 7f 90 pop r7 1c070: 6f 90 pop r6 1c072: 5f 90 pop r5 1c074: 4f 90 pop r4 1c076: 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 1c078: 80 e1 ldi r24, 0x10 ; 16 1c07a: a8 2e mov r10, r24 1c07c: 87 e2 ldi r24, 0x27 ; 39 1c07e: b8 2e mov r11, r24 1c080: db cf rjmp .-74 ; 0x1c038 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1c082: 8f ef ldi r24, 0xFF ; 255 1c084: a8 1a sub r10, r24 1c086: b8 0a sbc r11, r24 1c088: e0 cf rjmp .-64 ; 0x1c04a 0001c08a : /// 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){ 1c08a: 2f 92 push r2 1c08c: 3f 92 push r3 1c08e: 4f 92 push r4 1c090: 5f 92 push r5 1c092: 6f 92 push r6 1c094: 7f 92 push r7 1c096: 8f 92 push r8 1c098: 9f 92 push r9 1c09a: af 92 push r10 1c09c: bf 92 push r11 1c09e: cf 92 push r12 1c0a0: df 92 push r13 1c0a2: ef 92 push r14 1c0a4: ff 92 push r15 1c0a6: 0f 93 push r16 1c0a8: 1f 93 push r17 1c0aa: cf 93 push r28 1c0ac: df 93 push r29 1c0ae: 00 d0 rcall .+0 ; 0x1c0b0 1c0b0: cd b7 in r28, 0x3d ; 61 1c0b2: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1c0b4: f9 01 movw r30, r18 1c0b6: e0 80 ld r14, Z 1c0b8: f1 80 ldd r15, Z+1 ; 0x01 1c0ba: e1 14 cp r14, r1 1c0bc: f1 04 cpc r15, r1 1c0be: 09 f4 brne .+2 ; 0x1c0c2 1c0c0: 6b c0 rjmp .+214 ; 0x1c198 1c0c2: 16 16 cp r1, r22 1c0c4: 17 06 cpc r1, r23 1c0c6: 0c f0 brlt .+2 ; 0x1c0ca 1c0c8: 67 c0 rjmp .+206 ; 0x1c198 1c0ca: 19 01 movw r2, r18 1c0cc: 5b 83 std Y+3, r21 ; 0x03 1c0ce: 4a 83 std Y+2, r20 ; 0x02 1c0d0: 6b 01 movw r12, r22 1c0d2: 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)); 1c0d4: fa 01 movw r30, r20 1c0d6: 00 81 ld r16, Z 1c0d8: 11 81 ldd r17, Z+1 ; 0x01 1c0da: b8 01 movw r22, r16 1c0dc: 90 e0 ldi r25, 0x00 ; 0 1c0de: 80 e0 ldi r24, 0x00 ; 0 1c0e0: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 1c0e4: 4b 01 movw r8, r22 1c0e6: 5c 01 movw r10, r24 1c0e8: b6 01 movw r22, r12 1c0ea: 0d 2c mov r0, r13 1c0ec: 00 0c add r0, r0 1c0ee: 88 0b sbc r24, r24 1c0f0: 99 0b sbc r25, r25 1c0f2: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1c0f6: 2b 01 movw r4, r22 1c0f8: 3c 01 movw r6, r24 1c0fa: a5 01 movw r20, r10 1c0fc: 94 01 movw r18, r8 1c0fe: c5 01 movw r24, r10 1c100: b4 01 movw r22, r8 1c102: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1c106: 9b 01 movw r18, r22 1c108: ac 01 movw r20, r24 1c10a: c3 01 movw r24, r6 1c10c: b2 01 movw r22, r4 1c10e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1c112: 9b 01 movw r18, r22 1c114: ac 01 movw r20, r24 1c116: 6a e0 ldi r22, 0x0A ; 10 1c118: 77 ed ldi r23, 0xD7 ; 215 1c11a: 83 ea ldi r24, 0xA3 ; 163 1c11c: 9b e3 ldi r25, 0x3B ; 59 1c11e: 0f 94 36 df call 0x3be6c ; 0x3be6c <__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); 1c122: 20 e0 ldi r18, 0x00 ; 0 1c124: 30 e0 ldi r19, 0x00 ; 0 1c126: 40 e0 ldi r20, 0x00 ; 0 1c128: 5f e3 ldi r21, 0x3F ; 63 1c12a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1c12e: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__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){ 1c132: 6e 15 cp r22, r14 1c134: 7f 05 cpc r23, r15 1c136: 28 f5 brcc .+74 ; 0x1c182 1c138: f9 81 ldd r31, Y+1 ; 0x01 1c13a: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1c13c: ea 81 ldd r30, Y+2 ; 0x02 1c13e: fb 81 ldd r31, Y+3 ; 0x03 1c140: 80 81 ld r24, Z 1c142: 91 81 ldd r25, Z+1 ; 0x01 1c144: 0e 94 35 de call 0x1bc6a ; 0x1bc6a } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1c148: f1 01 movw r30, r2 1c14a: 80 81 ld r24, Z 1c14c: 91 81 ldd r25, Z+1 ; 0x01 1c14e: 01 97 sbiw r24, 0x01 ; 1 1c150: 91 83 std Z+1, r25 ; 0x01 1c152: 80 83 st Z, r24 return true; 1c154: 81 e0 ldi r24, 0x01 ; 1 } 1c156: 0f 90 pop r0 1c158: 0f 90 pop r0 1c15a: 0f 90 pop r0 1c15c: df 91 pop r29 1c15e: cf 91 pop r28 1c160: 1f 91 pop r17 1c162: 0f 91 pop r16 1c164: ff 90 pop r15 1c166: ef 90 pop r14 1c168: df 90 pop r13 1c16a: cf 90 pop r12 1c16c: bf 90 pop r11 1c16e: af 90 pop r10 1c170: 9f 90 pop r9 1c172: 8f 90 pop r8 1c174: 7f 90 pop r7 1c176: 6f 90 pop r6 1c178: 5f 90 pop r5 1c17a: 4f 90 pop r4 1c17c: 3f 90 pop r3 1c17e: 2f 90 pop r2 1c180: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1c182: 66 27 eor r22, r22 1c184: 77 27 eor r23, r23 1c186: 6c 19 sub r22, r12 1c188: 7d 09 sbc r23, r13 1c18a: 98 01 movw r18, r16 1c18c: 4a 81 ldd r20, Y+2 ; 0x02 1c18e: 5b 81 ldd r21, Y+3 ; 0x03 1c190: 89 81 ldd r24, Y+1 ; 0x01 1c192: 0e 94 9f df call 0x1bf3e ; 0x1bf3e 1c196: d8 cf rjmp .-80 ; 0x1c148 /// 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; 1c198: 80 e0 ldi r24, 0x00 ; 0 1c19a: dd cf rjmp .-70 ; 0x1c156 0001c19c : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1c19c: 0f 93 push r16 1c19e: 1f 93 push r17 1c1a0: cf 93 push r28 1c1a2: df 93 push r29 1c1a4: 18 2f mov r17, r24 1c1a6: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c1a8: d1 e0 ldi r29, 0x01 ; 1 1c1aa: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1c1ac: 81 2f mov r24, r17 1c1ae: 8d 23 and r24, r29 1c1b0: 29 f0 breq .+10 ; 0x1c1bc sm4_set_dir(i, dir & mask); 1c1b2: 60 2f mov r22, r16 1c1b4: 6d 23 and r22, r29 1c1b6: 8c 2f mov r24, r28 1c1b8: 0f 94 f0 69 call 0x2d3e0 ; 0x2d3e0 } } } 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) { 1c1bc: cf 5f subi r28, 0xFF ; 255 1c1be: dd 0f add r29, r29 1c1c0: c3 30 cpi r28, 0x03 ; 3 1c1c2: a1 f7 brne .-24 ; 0x1c1ac if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1c1c4: df 91 pop r29 1c1c6: cf 91 pop r28 1c1c8: 1f 91 pop r17 1c1ca: 0f 91 pop r16 1c1cc: 08 95 ret 0001c1ce : //@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) { 1c1ce: 8f 92 push r8 1c1d0: 9f 92 push r9 1c1d2: af 92 push r10 1c1d4: bf 92 push r11 1c1d6: cf 92 push r12 1c1d8: df 92 push r13 1c1da: ef 92 push r14 1c1dc: ff 92 push r15 1c1de: 30 e0 ldi r19, 0x00 ; 0 1c1e0: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c1e2: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1c1e4: 48 2f mov r20, r24 1c1e6: 49 23 and r20, r25 1c1e8: 19 f1 breq .+70 ; 0x1c230 count_position[i] += dir & mask ? -1L : 1L; 1c1ea: a9 01 movw r20, r18 1c1ec: 44 0f add r20, r20 1c1ee: 55 1f adc r21, r21 1c1f0: 44 0f add r20, r20 1c1f2: 55 1f adc r21, r21 1c1f4: fa 01 movw r30, r20 1c1f6: ef 59 subi r30, 0x9F ; 159 1c1f8: f8 4f sbci r31, 0xF8 ; 248 1c1fa: c0 80 ld r12, Z 1c1fc: d1 80 ldd r13, Z+1 ; 0x01 1c1fe: e2 80 ldd r14, Z+2 ; 0x02 1c200: f3 80 ldd r15, Z+3 ; 0x03 1c202: 76 2f mov r23, r22 1c204: 79 23 and r23, r25 1c206: 81 2c mov r8, r1 1c208: 91 2c mov r9, r1 1c20a: 54 01 movw r10, r8 1c20c: 83 94 inc r8 1c20e: 77 23 and r23, r23 1c210: 21 f0 breq .+8 ; 0x1c21a 1c212: 88 24 eor r8, r8 1c214: 8a 94 dec r8 1c216: 98 2c mov r9, r8 1c218: 54 01 movw r10, r8 1c21a: c8 0c add r12, r8 1c21c: d9 1c adc r13, r9 1c21e: ea 1c adc r14, r10 1c220: fb 1c adc r15, r11 1c222: 4f 59 subi r20, 0x9F ; 159 1c224: 58 4f sbci r21, 0xF8 ; 248 1c226: fa 01 movw r30, r20 1c228: c0 82 st Z, r12 1c22a: d1 82 std Z+1, r13 ; 0x01 1c22c: e2 82 std Z+2, r14 ; 0x02 1c22e: 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) { 1c230: 99 0f add r25, r25 1c232: 2f 5f subi r18, 0xFF ; 255 1c234: 3f 4f sbci r19, 0xFF ; 255 1c236: 23 30 cpi r18, 0x03 ; 3 1c238: 31 05 cpc r19, r1 1c23a: a1 f6 brne .-88 ; 0x1c1e4 if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1c23c: ff 90 pop r15 1c23e: ef 90 pop r14 1c240: df 90 pop r13 1c242: cf 90 pop r12 1c244: bf 90 pop r11 1c246: af 90 pop r10 1c248: 9f 90 pop r9 1c24a: 8f 90 pop r8 1c24c: 08 95 ret 0001c24e : /// 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) { 1c24e: 2f 92 push r2 1c250: 3f 92 push r3 1c252: 4f 92 push r4 1c254: 5f 92 push r5 1c256: 6f 92 push r6 1c258: 7f 92 push r7 1c25a: 8f 92 push r8 1c25c: 9f 92 push r9 1c25e: af 92 push r10 1c260: bf 92 push r11 1c262: cf 92 push r12 1c264: df 92 push r13 1c266: ef 92 push r14 1c268: ff 92 push r15 1c26a: 0f 93 push r16 1c26c: 1f 93 push r17 1c26e: cf 93 push r28 1c270: df 93 push r29 1c272: 00 d0 rcall .+0 ; 0x1c274 1c274: 00 d0 rcall .+0 ; 0x1c276 1c276: cd b7 in r28, 0x3d ; 61 1c278: 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]; 1c27a: c0 90 61 07 lds r12, 0x0761 ; 0x800761 1c27e: d0 90 62 07 lds r13, 0x0762 ; 0x800762 1c282: e0 90 63 07 lds r14, 0x0763 ; 0x800763 1c286: f0 90 64 07 lds r15, 0x0764 ; 0x800764 1c28a: 7c 01 movw r14, r24 1c28c: ec 18 sub r14, r12 1c28e: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1c290: 80 91 65 07 lds r24, 0x0765 ; 0x800765 1c294: 90 91 66 07 lds r25, 0x0766 ; 0x800766 1c298: a0 91 67 07 lds r26, 0x0767 ; 0x800767 1c29c: b0 91 68 07 lds r27, 0x0768 ; 0x800768 1c2a0: 68 1b sub r22, r24 1c2a2: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1c2a4: 80 91 69 07 lds r24, 0x0769 ; 0x800769 1c2a8: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 1c2ac: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 1c2b0: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 1c2b4: fa 01 movw r30, r20 1c2b6: e8 1b sub r30, r24 1c2b8: f9 0b sbc r31, r25 1c2ba: fa 83 std Y+2, r31 ; 0x02 1c2bc: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1c2be: fb 01 movw r30, r22 1c2c0: ff 0f add r31, r31 1c2c2: ee 0b sbc r30, r30 1c2c4: ff 0f add r31, r31 1c2c6: fe 2f mov r31, r30 1c2c8: ee 1f adc r30, r30 1c2ca: e2 70 andi r30, 0x02 ; 2 1c2cc: 89 81 ldd r24, Y+1 ; 0x01 1c2ce: 9a 81 ldd r25, Y+2 ; 0x02 1c2d0: 88 e0 ldi r24, 0x08 ; 8 1c2d2: 98 02 muls r25, r24 1c2d4: 81 2d mov r24, r1 1c2d6: 99 0b sbc r25, r25 1c2d8: 11 24 eor r1, r1 1c2da: 84 70 andi r24, 0x04 ; 4 1c2dc: e8 2b or r30, r24 1c2de: 8f 2d mov r24, r15 1c2e0: 88 1f adc r24, r24 1c2e2: 88 27 eor r24, r24 1c2e4: 88 1f adc r24, r24 1c2e6: e8 2b or r30, r24 1c2e8: e0 93 f8 03 sts 0x03F8, r30 ; 0x8003f8 asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1c2ec: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1c2f0: 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; 1c2f2: 8a e0 ldi r24, 0x0A ; 10 1c2f4: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1c2f6: e0 fd sbrc r30, 0 1c2f8: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1c2fa: e1 fd sbrc r30, 1 1c2fc: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1c2fe: e2 fd sbrc r30, 2 1c300: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1c302: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1c304: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1c308: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1c30a: 8e e1 ldi r24, 0x1E ; 30 1c30c: 9f ec ldi r25, 0xCF ; 207 1c30e: 01 11 cpse r16, r1 1c310: 02 c0 rjmp .+4 ; 0x1c316 1c312: 90 e0 ldi r25, 0x00 ; 0 1c314: 80 e0 ldi r24, 0x00 ; 0 1c316: 90 93 66 05 sts 0x0566, r25 ; 0x800566 1c31a: 80 93 65 05 sts 0x0565, r24 ; 0x800565 xyzcal_sm4_delay = delay_us; 1c31e: 30 93 f7 03 sts 0x03F7, r19 ; 0x8003f7 1c322: 20 93 f6 03 sts 0x03F6, r18 ; 0x8003f6 // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1c326: 29 81 ldd r18, Y+1 ; 0x01 1c328: 3a 81 ldd r19, Y+2 ; 0x02 1c32a: 3e 83 std Y+6, r19 ; 0x06 1c32c: 2d 83 std Y+5, r18 ; 0x05 1c32e: 37 ff sbrs r19, 7 1c330: 05 c0 rjmp .+10 ; 0x1c33c 1c332: 31 95 neg r19 1c334: 21 95 neg r18 1c336: 31 09 sbc r19, r1 1c338: 3e 83 std Y+6, r19 ; 0x06 1c33a: 2d 83 std Y+5, r18 ; 0x05 1c33c: 8b 01 movw r16, r22 1c33e: 77 ff sbrs r23, 7 1c340: 03 c0 rjmp .+6 ; 0x1c348 1c342: 11 95 neg r17 1c344: 01 95 neg r16 1c346: 11 09 sbc r17, r1 1c348: f7 fe sbrs r15, 7 1c34a: 03 c0 rjmp .+6 ; 0x1c352 1c34c: f1 94 neg r15 1c34e: e1 94 neg r14 1c350: 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); 1c352: 98 01 movw r18, r16 1c354: d8 01 movw r26, r16 1c356: 0f 94 27 de call 0x3bc4e ; 0x3bc4e <__mulhisi3> 1c35a: 4b 01 movw r8, r22 1c35c: 5c 01 movw r10, r24 1c35e: 2d 81 ldd r18, Y+5 ; 0x05 1c360: 3e 81 ldd r19, Y+6 ; 0x06 1c362: d9 01 movw r26, r18 1c364: 0f 94 27 de call 0x3bc4e ; 0x3bc4e <__mulhisi3> 1c368: 86 0e add r8, r22 1c36a: 97 1e adc r9, r23 1c36c: a8 1e adc r10, r24 1c36e: b9 1e adc r11, r25 1c370: 97 01 movw r18, r14 1c372: d7 01 movw r26, r14 1c374: 0f 94 27 de call 0x3bc4e ; 0x3bc4e <__mulhisi3> 1c378: 68 0d add r22, r8 1c37a: 79 1d adc r23, r9 1c37c: 8a 1d adc r24, r10 1c37e: 9b 1d adc r25, r11 1c380: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 1c384: 0f 94 05 e2 call 0x3c40a ; 0x3c40a 1c388: 20 e0 ldi r18, 0x00 ; 0 1c38a: 30 e0 ldi r19, 0x00 ; 0 1c38c: 40 e0 ldi r20, 0x00 ; 0 1c38e: 5f e3 ldi r21, 0x3F ; 63 1c390: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1c394: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 1c398: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1c39a: 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; 1c39c: 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; 1c39e: 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; 1c3a0: 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; 1c3a2: 1c 82 std Y+4, r1 ; 0x04 1c3a4: 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; 1c3a6: 31 2c mov r3, r1 1c3a8: 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; 1c3aa: 1a 82 std Y+2, r1 ; 0x02 1c3ac: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1c3ae: 61 14 cp r6, r1 1c3b0: 71 04 cpc r7, r1 1c3b2: 09 f4 brne .+2 ; 0x1c3b6 1c3b4: 47 c0 rjmp .+142 ; 0x1c444 if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1c3b6: e0 91 65 05 lds r30, 0x0565 ; 0x800565 1c3ba: f0 91 66 05 lds r31, 0x0566 ; 0x800566 1c3be: 30 97 sbiw r30, 0x00 ; 0 1c3c0: e9 f5 brne .+122 ; 0x1c43c uint8_t sm = 0; //step mask 1c3c2: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1c3c4: ec 14 cp r14, r12 1c3c6: fd 04 cpc r15, r13 1c3c8: 40 f0 brcs .+16 ; 0x1c3da sm |= 1; cx += dd; 1c3ca: c4 0c add r12, r4 1c3cc: d5 1c adc r13, r5 x++; 1c3ce: 89 81 ldd r24, Y+1 ; 0x01 1c3d0: 9a 81 ldd r25, Y+2 ; 0x02 1c3d2: 01 96 adiw r24, 0x01 ; 1 1c3d4: 9a 83 std Y+2, r25 ; 0x02 1c3d6: 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; 1c3d8: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1c3da: 0a 15 cp r16, r10 1c3dc: 1b 05 cpc r17, r11 1c3de: 30 f0 brcs .+12 ; 0x1c3ec sm |= 2; 1c3e0: 82 60 ori r24, 0x02 ; 2 cy += dd; 1c3e2: a4 0c add r10, r4 1c3e4: b5 1c adc r11, r5 y++; 1c3e6: 9f ef ldi r25, 0xFF ; 255 1c3e8: 29 1a sub r2, r25 1c3ea: 39 0a sbc r3, r25 } if (cz <= dz){ 1c3ec: ed 81 ldd r30, Y+5 ; 0x05 1c3ee: fe 81 ldd r31, Y+6 ; 0x06 1c3f0: e8 15 cp r30, r8 1c3f2: f9 05 cpc r31, r9 1c3f4: 48 f0 brcs .+18 ; 0x1c408 sm |= 4; 1c3f6: 84 60 ori r24, 0x04 ; 4 cz += dd; 1c3f8: 84 0c add r8, r4 1c3fa: 95 1c adc r9, r5 z++; 1c3fc: 2b 81 ldd r18, Y+3 ; 0x03 1c3fe: 3c 81 ldd r19, Y+4 ; 0x04 1c400: 2f 5f subi r18, 0xFF ; 255 1c402: 3f 4f sbci r19, 0xFF ; 255 1c404: 3c 83 std Y+4, r19 ; 0x04 1c406: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1c408: ce 18 sub r12, r14 1c40a: df 08 sbc r13, r15 cy -= dy; 1c40c: a0 1a sub r10, r16 1c40e: b1 0a sbc r11, r17 cz -= dz; 1c410: ed 81 ldd r30, Y+5 ; 0x05 1c412: fe 81 ldd r31, Y+6 ; 0x06 1c414: 8e 1a sub r8, r30 1c416: 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 1c418: 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); 1c41a: e0 91 61 05 lds r30, 0x0561 ; 0x800561 1c41e: f0 91 62 05 lds r31, 0x0562 ; 0x800562 1c422: 30 97 sbiw r30, 0x00 ; 0 1c424: d1 f1 breq .+116 ; 0x1c49a 1c426: b2 01 movw r22, r4 1c428: c3 01 movw r24, r6 1c42a: 19 95 eicall if (delay) delayMicroseconds(delay); 1c42c: 00 97 sbiw r24, 0x00 ; 0 1c42e: 11 f0 breq .+4 ; 0x1c434 1c430: 0e 94 35 de call 0x1bc6a ; 0x1bc6a nd--; 1c434: f1 e0 ldi r31, 0x01 ; 1 1c436: 6f 1a sub r6, r31 1c438: 71 08 sbc r7, r1 1c43a: b9 cf rjmp .-142 ; 0x1c3ae 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; 1c43c: 19 95 eicall 1c43e: 88 23 and r24, r24 1c440: 09 f4 brne .+2 ; 0x1c444 1c442: bf cf rjmp .-130 ; 0x1c3c2 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) 1c444: e0 91 63 05 lds r30, 0x0563 ; 0x800563 1c448: f0 91 64 05 lds r31, 0x0564 ; 0x800564 1c44c: 30 97 sbiw r30, 0x00 ; 0 1c44e: 41 f0 breq .+16 ; 0x1c460 (*sm4_update_pos_cb)(x, y, z, 0); 1c450: 30 e0 ldi r19, 0x00 ; 0 1c452: 20 e0 ldi r18, 0x00 ; 0 1c454: 4b 81 ldd r20, Y+3 ; 0x03 1c456: 5c 81 ldd r21, Y+4 ; 0x04 1c458: b1 01 movw r22, r2 1c45a: 89 81 ldd r24, Y+1 ; 0x01 1c45c: 9a 81 ldd r25, Y+2 ; 0x02 1c45e: 19 95 eicall 1c460: 81 e0 ldi r24, 0x01 ; 1 1c462: 67 28 or r6, r7 1c464: 09 f4 brne .+2 ; 0x1c468 1c466: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1c468: 26 96 adiw r28, 0x06 ; 6 1c46a: 0f b6 in r0, 0x3f ; 63 1c46c: f8 94 cli 1c46e: de bf out 0x3e, r29 ; 62 1c470: 0f be out 0x3f, r0 ; 63 1c472: cd bf out 0x3d, r28 ; 61 1c474: df 91 pop r29 1c476: cf 91 pop r28 1c478: 1f 91 pop r17 1c47a: 0f 91 pop r16 1c47c: ff 90 pop r15 1c47e: ef 90 pop r14 1c480: df 90 pop r13 1c482: cf 90 pop r12 1c484: bf 90 pop r11 1c486: af 90 pop r10 1c488: 9f 90 pop r9 1c48a: 8f 90 pop r8 1c48c: 7f 90 pop r7 1c48e: 6f 90 pop r6 1c490: 5f 90 pop r5 1c492: 4f 90 pop r4 1c494: 3f 90 pop r3 1c496: 2f 90 pop r2 1c498: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1c49a: 84 ef ldi r24, 0xF4 ; 244 1c49c: 91 e0 ldi r25, 0x01 ; 1 1c49e: c8 cf rjmp .-112 ; 0x1c430 0001c4a0 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1c4a0: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1c4a2: 0d b4 in r0, 0x2d ; 45 1c4a4: 07 fe sbrs r0, 7 1c4a6: fd cf rjmp .-6 ; 0x1c4a2 return SPDR; 1c4a8: 8e b5 in r24, 0x2e ; 46 } 1c4aa: 08 95 ret 0001c4ac : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1c4ac: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1c4ae: 85 e0 ldi r24, 0x05 ; 5 1c4b0: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 uint8_t val = _SPI_RX(); // receive value 1c4b4: 8f ef ldi r24, 0xFF ; 255 1c4b6: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 _CS_HIGH(); 1c4ba: 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) ; 1c4bc: 80 fd sbrc r24, 0 1c4be: f6 cf rjmp .-20 ; 0x1c4ac } 1c4c0: 08 95 ret 0001c4c2 : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1c4c2: 1f 93 push r17 1c4c4: cf 93 push r28 1c4c6: df 93 push r29 1c4c8: ea 01 movw r28, r20 1c4ca: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1c4cc: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1c4d0: 81 2f mov r24, r17 1c4d2: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1c4d6: 8d 2f mov r24, r29 1c4d8: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1c4dc: 8c 2f mov r24, r28 } 1c4de: df 91 pop r29 1c4e0: cf 91 pop r28 1c4e2: 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 1c4e4: 0c 94 50 e2 jmp 0x1c4a0 ; 0x1c4a0 0001c4e8 : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1c4e8: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1c4ea: 0e 94 61 e2 call 0x1c4c2 ; 0x1c4c2 _CS_HIGH(); 1c4ee: 45 9a sbi 0x08, 5 ; 8 } 1c4f0: 08 95 ret 0001c4f2 : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1c4f2: ef 92 push r14 1c4f4: ff 92 push r15 1c4f6: 0f 93 push r16 1c4f8: 1f 93 push r17 1c4fa: cf 93 push r28 1c4fc: df 93 push r29 1c4fe: 7a 01 movw r14, r20 1c500: 89 01 movw r16, r18 _CS_LOW(); 1c502: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c504: ab 01 movw r20, r22 1c506: bc 01 movw r22, r24 1c508: 82 e0 ldi r24, 0x02 ; 2 1c50a: 0e 94 61 e2 call 0x1c4c2 ; 0x1c4c2 1c50e: e7 01 movw r28, r14 1c510: 0e 0d add r16, r14 1c512: 1f 1d adc r17, r15 while (cnt--) // send data 1c514: c0 17 cp r28, r16 1c516: d1 07 cpc r29, r17 1c518: 41 f4 brne .+16 ; 0x1c52a _SPI_TX(*(data++)); _CS_HIGH(); 1c51a: 45 9a sbi 0x08, 5 ; 8 } 1c51c: df 91 pop r29 1c51e: cf 91 pop r28 1c520: 1f 91 pop r17 1c522: 0f 91 pop r16 1c524: ff 90 pop r15 1c526: ef 90 pop r14 1c528: 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++)); 1c52a: 89 91 ld r24, Y+ 1c52c: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 1c530: f1 cf rjmp .-30 ; 0x1c514 0001c532 : _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) { 1c532: ef 92 push r14 1c534: ff 92 push r15 1c536: 0f 93 push r16 1c538: 1f 93 push r17 1c53a: cf 93 push r28 1c53c: df 93 push r29 1c53e: 7a 01 movw r14, r20 1c540: 89 01 movw r16, r18 _CS_LOW(); 1c542: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1c544: ab 01 movw r20, r22 1c546: bc 01 movw r22, r24 1c548: 83 e0 ldi r24, 0x03 ; 3 1c54a: 0e 94 61 e2 call 0x1c4c2 ; 0x1c4c2 1c54e: e7 01 movw r28, r14 1c550: 0e 0d add r16, r14 1c552: 1f 1d adc r17, r15 while (cnt--) // receive data 1c554: c0 17 cp r28, r16 1c556: d1 07 cpc r29, r17 1c558: 41 f4 brne .+16 ; 0x1c56a *(data++) = _SPI_RX(); _CS_HIGH(); 1c55a: 45 9a sbi 0x08, 5 ; 8 } 1c55c: df 91 pop r29 1c55e: cf 91 pop r28 1c560: 1f 91 pop r17 1c562: 0f 91 pop r16 1c564: ff 90 pop r15 1c566: ef 90 pop r14 1c568: 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(); 1c56a: 8f ef ldi r24, 0xFF ; 255 1c56c: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 1c570: 89 93 st Y+, r24 1c572: f0 cf rjmp .-32 ; 0x1c554 0001c574 : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1c574: 0f 93 push r16 1c576: 1f 93 push r17 1c578: cf 93 push r28 1c57a: df 93 push r29 1c57c: 00 d0 rcall .+0 ; 0x1c57e 1c57e: 1f 92 push r1 1c580: cd b7 in r28, 0x3d ; 61 1c582: de b7 in r29, 0x3e ; 62 1c584: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c586: 8c e5 ldi r24, 0x5C ; 92 1c588: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c58a: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1c58c: 24 e0 ldi r18, 0x04 ; 4 1c58e: 30 e0 ldi r19, 0x00 ; 0 1c590: ae 01 movw r20, r28 1c592: 4f 5f subi r20, 0xFF ; 255 1c594: 5f 4f sbci r21, 0xFF ; 255 1c596: 60 e0 ldi r22, 0x00 ; 0 1c598: 70 ed ldi r23, 0xD0 ; 208 1c59a: 83 e0 ldi r24, 0x03 ; 3 1c59c: 90 e0 ldi r25, 0x00 ; 0 1c59e: 0e 94 99 e2 call 0x1c532 ; 0x1c532 (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1c5a2: 89 81 ldd r24, Y+1 ; 0x01 1c5a4: 9a 81 ldd r25, Y+2 ; 0x02 1c5a6: ab 81 ldd r26, Y+3 ; 0x03 1c5a8: bc 81 ldd r27, Y+4 ; 0x04 1c5aa: 87 34 cpi r24, 0x47 ; 71 1c5ac: 95 45 sbci r25, 0x55 ; 85 1c5ae: a2 45 sbci r26, 0x52 ; 82 1c5b0: b5 45 sbci r27, 0x55 ; 85 1c5b2: 71 f4 brne .+28 ; 0x1c5d0 return false; if (reason) 1c5b4: 01 15 cp r16, r1 1c5b6: 11 05 cpc r17, r1 1c5b8: 49 f0 breq .+18 ; 0x1c5cc { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1c5ba: 21 e0 ldi r18, 0x01 ; 1 1c5bc: 30 e0 ldi r19, 0x00 ; 0 1c5be: a8 01 movw r20, r16 1c5c0: 65 e0 ldi r22, 0x05 ; 5 1c5c2: 70 ed ldi r23, 0xD0 ; 208 1c5c4: 83 e0 ldi r24, 0x03 ; 3 1c5c6: 90 e0 ldi r25, 0x00 ; 0 1c5c8: 0e 94 99 e2 call 0x1c532 ; 0x1c532 (uint8_t*)reason, sizeof(*reason)); } return true; 1c5cc: 81 e0 ldi r24, 0x01 ; 1 1c5ce: 01 c0 rjmp .+2 ; 0x1c5d2 XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1c5d0: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1c5d2: 0f 90 pop r0 1c5d4: 0f 90 pop r0 1c5d6: 0f 90 pop r0 1c5d8: 0f 90 pop r0 1c5da: df 91 pop r29 1c5dc: cf 91 pop r28 1c5de: 1f 91 pop r17 1c5e0: 0f 91 pop r16 1c5e2: 08 95 ret 0001c5e4 : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1c5e4: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1c5e6: 86 e0 ldi r24, 0x06 ; 6 1c5e8: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 _CS_HIGH(); 1c5ec: 45 9a sbi 0x08, 5 ; 8 } 1c5ee: 08 95 ret 0001c5f0 : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1c5f0: 4f 92 push r4 1c5f2: 5f 92 push r5 1c5f4: 6f 92 push r6 1c5f6: 7f 92 push r7 1c5f8: 8f 92 push r8 1c5fa: 9f 92 push r9 1c5fc: af 92 push r10 1c5fe: bf 92 push r11 1c600: ef 92 push r14 1c602: ff 92 push r15 1c604: 0f 93 push r16 1c606: 1f 93 push r17 1c608: cf 93 push r28 1c60a: df 93 push r29 1c60c: 7c 01 movw r14, r24 1c60e: 4a 01 movw r8, r20 1c610: 5b 01 movw r10, r22 1c612: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c614: 8c e5 ldi r24, 0x5C ; 92 1c616: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c618: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1c61a: 41 2c mov r4, r1 1c61c: 80 ed ldi r24, 0xD0 ; 208 1c61e: 58 2e mov r5, r24 1c620: 83 e0 ldi r24, 0x03 ; 3 1c622: 68 2e mov r6, r24 1c624: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1c626: 0e 94 f2 e2 call 0x1c5e4 ; 0x1c5e4 _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1c62a: b3 01 movw r22, r6 1c62c: a2 01 movw r20, r4 1c62e: 80 e2 ldi r24, 0x20 ; 32 1c630: 0e 94 74 e2 call 0x1c4e8 ; 0x1c4e8 xflash_sector_erase(addr); xflash_wait_busy(); 1c634: 0e 94 56 e2 call 0x1c4ac ; 0x1c4ac static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1c638: 80 e1 ldi r24, 0x10 ; 16 1c63a: 58 0e add r5, r24 1c63c: 61 1c adc r6, r1 1c63e: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1c640: 41 14 cp r4, r1 1c642: 51 04 cpc r5, r1 1c644: e4 e0 ldi r30, 0x04 ; 4 1c646: 6e 06 cpc r6, r30 1c648: 71 04 cpc r7, r1 1c64a: 69 f7 brne .-38 ; 0x1c626 // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1c64c: 8d b7 in r24, 0x3d ; 61 1c64e: 9e b7 in r25, 0x3e ; 62 1c650: f7 01 movw r30, r14 1c652: 93 87 std Z+11, r25 ; 0x0b 1c654: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1c656: 00 d0 rcall .+0 ; 0x1c658 1c658: 8f 91 pop r24 1c65a: 9f 91 pop r25 1c65c: af 91 pop r26 hdr.pc = GETPC(); 1c65e: b0 e0 ldi r27, 0x00 ; 0 1c660: 86 83 std Z+6, r24 ; 0x06 1c662: 97 83 std Z+7, r25 ; 0x07 1c664: a0 87 std Z+8, r26 ; 0x08 1c666: 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(); 1c668: 0e 94 f2 e2 call 0x1c5e4 ; 0x1c5e4 xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1c66c: 2c e0 ldi r18, 0x0C ; 12 1c66e: 30 e0 ldi r19, 0x00 ; 0 1c670: a7 01 movw r20, r14 1c672: 60 e0 ldi r22, 0x00 ; 0 1c674: 70 ed ldi r23, 0xD0 ; 208 1c676: 83 e0 ldi r24, 0x03 ; 3 1c678: 90 e0 ldi r25, 0x00 ; 0 1c67a: 0e 94 79 e2 call 0x1c4f2 ; 0x1c4f2 xflash_wait_busy(); 1c67e: 0e 94 56 e2 call 0x1c4ac ; 0x1c4ac void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1c682: 0e 94 f2 e2 call 0x1c5e4 ; 0x1c5e4 _CS_LOW(); 1c686: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c688: b5 01 movw r22, r10 1c68a: a4 01 movw r20, r8 1c68c: 82 e0 ldi r24, 0x02 ; 2 1c68e: 0e 94 61 e2 call 0x1c4c2 ; 0x1c4c2 1c692: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1c694: 21 96 adiw r28, 0x01 ; 1 1c696: 80 81 ld r24, Z 1c698: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 if(!--cnt || !(++addr & 0xFF)) 1c69c: 01 50 subi r16, 0x01 ; 1 1c69e: 11 09 sbc r17, r1 1c6a0: 41 f0 breq .+16 ; 0x1c6b2 1c6a2: ff ef ldi r31, 0xFF ; 255 1c6a4: 8f 1a sub r8, r31 1c6a6: 9f 0a sbc r9, r31 1c6a8: af 0a sbc r10, r31 1c6aa: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1c6ac: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1c6ae: 81 10 cpse r8, r1 1c6b0: f1 cf rjmp .-30 ; 0x1c694 { // on a page boundary or end of write _CS_HIGH(); 1c6b2: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1c6b4: 0e 94 56 e2 call 0x1c4ac ; 0x1c4ac _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1c6b8: 01 15 cp r16, r1 1c6ba: 11 05 cpc r17, r1 1c6bc: 11 f7 brne .-60 ; 0x1c682 // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1c6be: df 91 pop r29 1c6c0: cf 91 pop r28 1c6c2: 1f 91 pop r17 1c6c4: 0f 91 pop r16 1c6c6: ff 90 pop r15 1c6c8: ef 90 pop r14 1c6ca: bf 90 pop r11 1c6cc: af 90 pop r10 1c6ce: 9f 90 pop r9 1c6d0: 8f 90 pop r8 1c6d2: 7f 90 pop r7 1c6d4: 6f 90 pop r6 1c6d6: 5f 90 pop r5 1c6d8: 4f 90 pop r4 1c6da: 08 95 ret 0001c6dc : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1c6dc: cf 93 push r28 1c6de: df 93 push r29 1c6e0: cd b7 in r28, 0x3d ; 61 1c6e2: de b7 in r29, 0x3e ; 62 1c6e4: 2c 97 sbiw r28, 0x0c ; 12 1c6e6: 0f b6 in r0, 0x3f ; 63 1c6e8: f8 94 cli 1c6ea: de bf out 0x3e, r29 ; 62 1c6ec: 0f be out 0x3f, r0 ; 63 1c6ee: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c6f0: 47 e4 ldi r20, 0x47 ; 71 1c6f2: 55 e5 ldi r21, 0x55 ; 85 1c6f4: 62 e5 ldi r22, 0x52 ; 82 1c6f6: 75 e5 ldi r23, 0x55 ; 85 1c6f8: 49 83 std Y+1, r20 ; 0x01 1c6fa: 5a 83 std Y+2, r21 ; 0x02 1c6fc: 6b 83 std Y+3, r22 ; 0x03 1c6fe: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1c700: 91 e0 ldi r25, 0x01 ; 1 1c702: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1c704: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1c706: f8 94 cli 1c708: 88 e1 ldi r24, 0x18 ; 24 1c70a: 9d e0 ldi r25, 0x0D ; 13 1c70c: 0f b6 in r0, 0x3f ; 63 1c70e: f8 94 cli 1c710: a8 95 wdr 1c712: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1c716: 0f be out 0x3f, r0 ; 63 1c718: 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); 1c71c: 00 e0 ldi r16, 0x00 ; 0 1c71e: 12 e2 ldi r17, 0x22 ; 34 1c720: 30 e0 ldi r19, 0x00 ; 0 1c722: 20 e0 ldi r18, 0x00 ; 0 1c724: 40 e0 ldi r20, 0x00 ; 0 1c726: 51 ed ldi r21, 0xD1 ; 209 1c728: 63 e0 ldi r22, 0x03 ; 3 1c72a: 70 e0 ldi r23, 0x00 ; 0 1c72c: ce 01 movw r24, r28 1c72e: 01 96 adiw r24, 0x01 ; 1 1c730: 0e 94 f8 e2 call 0x1c5f0 ; 0x1c5f0 // force a reset even sooner softReset(); 1c734: 0e 94 92 68 call 0xd124 ; 0xd124 0001c738 : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1c738: 0f 93 push r16 1c73a: 1f 93 push r17 1c73c: cf 93 push r28 1c73e: df 93 push r29 1c740: cd b7 in r28, 0x3d ; 61 1c742: de b7 in r29, 0x3e ; 62 1c744: 2c 97 sbiw r28, 0x0c ; 12 1c746: 0f b6 in r0, 0x3f ; 63 1c748: f8 94 cli 1c74a: de bf out 0x3e, r29 ; 62 1c74c: 0f be out 0x3f, r0 ; 63 1c74e: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c750: 87 e4 ldi r24, 0x47 ; 71 1c752: 95 e5 ldi r25, 0x55 ; 85 1c754: a2 e5 ldi r26, 0x52 ; 82 1c756: b5 e5 ldi r27, 0x55 ; 85 1c758: 89 83 std Y+1, r24 ; 0x01 1c75a: 9a 83 std Y+2, r25 ; 0x02 1c75c: ab 83 std Y+3, r26 ; 0x03 1c75e: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1c760: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1c762: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1c764: 00 e0 ldi r16, 0x00 ; 0 1c766: 10 e2 ldi r17, 0x20 ; 32 1c768: 20 e0 ldi r18, 0x00 ; 0 1c76a: 32 e0 ldi r19, 0x02 ; 2 1c76c: 40 e0 ldi r20, 0x00 ; 0 1c76e: 53 ed ldi r21, 0xD3 ; 211 1c770: 63 e0 ldi r22, 0x03 ; 3 1c772: 70 e0 ldi r23, 0x00 ; 0 1c774: ce 01 movw r24, r28 1c776: 01 96 adiw r24, 0x01 ; 1 1c778: 0e 94 f8 e2 call 0x1c5f0 ; 0x1c5f0 (uint8_t*)RAMSTART, RAMSIZE); } 1c77c: 2c 96 adiw r28, 0x0c ; 12 1c77e: 0f b6 in r0, 0x3f ; 63 1c780: f8 94 cli 1c782: de bf out 0x3e, r29 ; 62 1c784: 0f be out 0x3f, r0 ; 63 1c786: cd bf out 0x3d, r28 ; 61 1c788: df 91 pop r29 1c78a: cf 91 pop r28 1c78c: 1f 91 pop r17 1c78e: 0f 91 pop r16 1c790: 08 95 ret 0001c792 : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1c792: cf 93 push r28 _CS_HIGH(); 1c794: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1c796: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c798: 8c e5 ldi r24, 0x5C ; 92 1c79a: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c79c: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1c79e: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1c7a0: 80 e9 ldi r24, 0x90 ; 144 1c7a2: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1c7a6: 80 e0 ldi r24, 0x00 ; 0 1c7a8: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 1c7ac: 80 e0 ldi r24, 0x00 ; 0 1c7ae: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 1c7b2: 80 e0 ldi r24, 0x00 ; 0 1c7b4: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1c7b8: 8f ef ldi r24, 0xFF ; 255 1c7ba: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 1c7be: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1c7c0: 8f ef ldi r24, 0xFF ; 255 1c7c2: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 1c7c6: 98 2f mov r25, r24 _CS_HIGH(); 1c7c8: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1c7ca: cf 3e cpi r28, 0xEF ; 239 1c7cc: 11 f0 breq .+4 ; 0x1c7d2 1c7ce: c8 3c cpi r28, 0xC8 ; 200 1c7d0: 19 f4 brne .+6 ; 0x1c7d8 1c7d2: 81 e0 ldi r24, 0x01 ; 1 1c7d4: 91 31 cpi r25, 0x11 ; 17 1c7d6: 09 f0 breq .+2 ; 0x1c7da int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1c7d8: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1c7da: cf 91 pop r28 1c7dc: 08 95 ret 0001c7de : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 1c7de: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1c7e2: 80 95 com r24 1c7e4: 81 70 andi r24, 0x01 ; 1 1c7e6: 08 95 ret 0001c7e8 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1c7e8: 1f 93 push r17 1c7ea: cf 93 push r28 1c7ec: df 93 push r29 MENU_BEGIN(); 1c7ee: 0f 94 8e ce call 0x39d1c ; 0x39d1c 1c7f2: 10 92 12 05 sts 0x0512, r1 ; 0x800512 #endif //SDSUPPORT if(!farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1c7f6: 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 1c7f8: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1c7fa: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1c7fe: 84 30 cpi r24, 0x04 ; 4 1c800: 08 f0 brcs .+2 ; 0x1c804 1c802: 01 c2 rjmp .+1026 ; 0x1cc06 1c804: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1c808: 8a ec ldi r24, 0xCA ; 202 1c80a: 9c e3 ldi r25, 0x3C ; 60 1c80c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c810: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 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)) { 1c814: 0e 94 27 69 call 0xd24e ; 0xd24e 1c818: 81 11 cpse r24, r1 1c81a: 19 c0 rjmp .+50 ; 0x1c84e 1c81c: 0e 94 c1 68 call 0xd182 ; 0xd182 1c820: 81 11 cpse r24, r1 1c822: 15 c0 rjmp .+42 ; 0x1c84e 1c824: 80 91 db 03 lds r24, 0x03DB ; 0x8003db 1c828: 81 11 cpse r24, r1 1c82a: 11 c0 rjmp .+34 ; 0x1c84e #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1c82c: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.395> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1c830: 83 30 cpi r24, 0x03 ; 3 1c832: 09 f0 breq .+2 ; 0x1c836 1c834: 51 c0 rjmp .+162 ; 0x1c8d8 1c836: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 1c83a: 88 23 and r24, r24 1c83c: 41 f0 breq .+16 ; 0x1c84e MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1c83e: 80 ec ldi r24, 0xC0 ; 192 1c840: 9c e3 ldi r25, 0x3C ; 60 1c842: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c846: 67 e2 ldi r22, 0x27 ; 39 1c848: 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); 1c84a: 0f 94 0b ce call 0x39c16 ; 0x39c16 } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1c84e: 0e 94 11 69 call 0xd222 ; 0xd222 1c852: 88 23 and r24, r24 1c854: 81 f0 breq .+32 ; 0x1c876 1c856: 0e 94 d6 68 call 0xd1ac ; 0xd1ac 1c85a: 81 11 cpse r24, r1 1c85c: 04 c0 rjmp .+8 ; 0x1c866 1c85e: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1c862: 84 30 cpi r24, 0x04 ; 4 1c864: 41 f4 brne .+16 ; 0x1c876 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1c866: 80 eb ldi r24, 0xB0 ; 176 1c868: 9c e3 ldi r25, 0x3C ; 60 1c86a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c86e: 6c ec ldi r22, 0xCC ; 204 1c870: 7a e3 ldi r23, 0x3A ; 58 1c872: 0f 94 0c d1 call 0x3a218 ; 0x3a218 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1c876: 0e 94 c1 68 call 0xd182 ; 0xd182 1c87a: 81 11 cpse r24, r1 1c87c: 61 c0 rjmp .+194 ; 0x1c940 } //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); 1c87e: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 1c882: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 1c886: 89 1b sub r24, r25 1c888: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1c88a: a9 f5 brne .+106 ; 0x1c8f6 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1c88c: 0e 94 27 69 call 0xd24e ; 0xd24e 1c890: 81 11 cpse r24, r1 1c892: 31 c0 rjmp .+98 ; 0x1c8f6 #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1c894: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1c898: 82 30 cpi r24, 0x02 ; 2 1c89a: 69 f1 breq .+90 ; 0x1c8f6 #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1c89c: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c8a0: 81 11 cpse r24, r1 1c8a2: 31 c0 rjmp .+98 ; 0x1c906 MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1c8a4: 8f e9 ldi r24, 0x9F ; 159 1c8a6: 9c e3 ldi r25, 0x3C ; 60 1c8a8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c8ac: 64 ed ldi r22, 0xD4 ; 212 1c8ae: 7a e3 ldi r23, 0x3A ; 58 1c8b0: 0f 94 0c d1 call 0x3a218 ; 0x3a218 if (M79_timer_get_status()) { 1c8b4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL9M79_timer.lto_priv.463> 1c8b8: 88 23 and r24, r24 1c8ba: 29 f1 breq .+74 ; 0x1c906 #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1c8bc: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 1c8c0: 81 30 cpi r24, 0x01 ; 1 1c8c2: 09 f0 breq .+2 ; 0x1c8c6 1c8c4: 7e c0 rjmp .+252 ; 0x1c9c2 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1c8c6: 8f e8 ldi r24, 0x8F ; 143 1c8c8: 9c e3 ldi r25, 0x3C ; 60 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1c8ca: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c8ce: 6e eb ldi r22, 0xBE ; 190 1c8d0: 7f ec ldi r23, 0xCF ; 207 1c8d2: 0f 94 0b ce call 0x39c16 ; 0x39c16 1c8d6: 17 c0 rjmp .+46 ; 0x1c906 // 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()) { 1c8d8: 84 30 cpi r24, 0x04 ; 4 1c8da: 09 f0 breq .+2 ; 0x1c8de 1c8dc: b8 cf rjmp .-144 ; 0x1c84e 1c8de: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL9M79_timer.lto_priv.463> 1c8e2: 88 23 and r24, r24 1c8e4: 09 f4 brne .+2 ; 0x1c8e8 1c8e6: b3 cf rjmp .-154 ; 0x1c84e MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1c8e8: 80 ec ldi r24, 0xC0 ; 192 1c8ea: 9c e3 ldi r25, 0x3C ; 60 1c8ec: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c8f0: 68 eb ldi r22, 0xB8 ; 184 1c8f2: 7f ec ldi r23, 0xCF ; 207 1c8f4: aa cf rjmp .-172 ; 0x1c84a 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); 1c8f6: 89 ea ldi r24, 0xA9 ; 169 1c8f8: 9c e3 ldi r25, 0x3C ; 60 1c8fa: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c8fe: 6e e1 ldi r22, 0x1E ; 30 1c900: 74 ed ldi r23, 0xD4 ; 212 1c902: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #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) { 1c906: c0 91 56 0e lds r28, 0x0E56 ; 0x800e56 1c90a: 0e 94 cb 68 call 0xd196 ; 0xd196 1c90e: c1 11 cpse r28, r1 1c910: 17 c0 rjmp .+46 ; 0x1c940 1c912: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 1c916: 91 11 cpse r25, r1 1c918: 13 c0 rjmp .+38 ; 0x1c940 1c91a: 81 11 cpse r24, r1 1c91c: 15 c0 rjmp .+42 ; 0x1c948 1c91e: 80 91 9f 03 lds r24, 0x039F ; 0x80039f 1c922: 81 11 cpse r24, r1 1c924: 0d c0 rjmp .+26 ; 0x1c940 if (usb_timer.running()) { 1c926: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1c92a: 88 23 and r24, r24 1c92c: 09 f4 brne .+2 ; 0x1c930 1c92e: 4c c0 rjmp .+152 ; 0x1c9c8 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1c930: 85 e7 ldi r24, 0x75 ; 117 1c932: 9c e3 ldi r25, 0x3C ; 60 1c934: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c938: 62 e0 ldi r22, 0x02 ; 2 1c93a: 7b e3 ldi r23, 0x3B ; 59 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1c93c: 0f 94 0b ce call 0x39c16 ; 0x39c16 } } } if (printingIsPaused() 1c940: 0e 94 cb 68 call 0xd196 ; 0xd196 && !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) { 1c944: 88 23 and r24, r24 1c946: f1 f0 breq .+60 ; 0x1c984 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1c948: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 1c94c: 81 11 cpse r24, r1 1c94e: 1a c0 rjmp .+52 ; 0x1c984 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1c950: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1c954: 82 30 cpi r24, 0x02 ; 2 1c956: b1 f0 breq .+44 ; 0x1c984 #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1c958: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1c95c: 82 30 cpi r24, 0x02 ; 2 1c95e: 21 f4 brne .+8 ; 0x1c968 1c960: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 1c964: 99 23 and r25, r25 1c966: 71 f0 breq .+28 ; 0x1c984 && custom_message_type != CustomMsg::Resuming) { 1c968: 90 91 72 07 lds r25, 0x0772 ; 0x800772 1c96c: 98 30 cpi r25, 0x08 ; 8 1c96e: 51 f0 breq .+20 ; 0x1c984 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1c970: 81 11 cpse r24, r1 1c972: 36 c0 rjmp .+108 ; 0x1c9e0 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1c974: 86 e6 ldi r24, 0x66 ; 102 1c976: 9c e3 ldi r25, 0x3C ; 60 1c978: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c97c: 6a e9 ldi r22, 0x9A ; 154 1c97e: 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); 1c980: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1c984: 0e 94 d6 68 call 0xd1ac ; 0xd1ac && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1c988: 81 11 cpse r24, r1 1c98a: 08 c0 rjmp .+16 ; 0x1c99c 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())) 1c98c: 0e 94 cb 68 call 0xd196 ; 0xd196 1c990: 81 11 cpse r24, r1 1c992: 04 c0 rjmp .+8 ; 0x1c99c 1c994: 0e 94 c1 68 call 0xd182 ; 0xd182 1c998: 88 23 and r24, r24 1c99a: 41 f0 breq .+16 ; 0x1c9ac && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1c99c: 80 91 72 07 lds r24, 0x0772 ; 0x800772 1c9a0: 81 30 cpi r24, 0x01 ; 1 1c9a2: 21 f0 breq .+8 ; 0x1c9ac 1c9a4: 80 91 9f 03 lds r24, 0x039F ; 0x80039f 1c9a8: 88 23 and r24, r24 1c9aa: 39 f1 breq .+78 ; 0x1c9fa MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1c9ac: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1c9b0: 88 23 and r24, r24 1c9b2: 59 f1 breq .+86 ; 0x1ca0a MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1c9b4: 85 e5 ldi r24, 0x55 ; 85 1c9b6: 9c e3 ldi r25, 0x3C ; 60 1c9b8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c9bc: 6a e5 ldi r22, 0x5A ; 90 1c9be: 7b e3 ldi r23, 0x3B ; 59 1c9c0: 22 c0 rjmp .+68 ; 0x1ca06 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); 1c9c2: 83 e8 ldi r24, 0x83 ; 131 1c9c4: 9c e3 ldi r25, 0x3C ; 60 1c9c6: 81 cf rjmp .-254 ; 0x1c8ca } } 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) { 1c9c8: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 1c9cc: 88 23 and r24, r24 1c9ce: 09 f4 brne .+2 ; 0x1c9d2 1c9d0: b7 cf rjmp .-146 ; 0x1c940 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1c9d2: 85 e7 ldi r24, 0x75 ; 117 1c9d4: 9c e3 ldi r25, 0x3C ; 60 1c9d6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c9da: 6e ed ldi r22, 0xDE ; 222 1c9dc: 79 e3 ldi r23, 0x39 ; 57 1c9de: ae cf rjmp .-164 ; 0x1c93c #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())) { 1c9e0: 81 30 cpi r24, 0x01 ; 1 1c9e2: 81 f6 brne .-96 ; 0x1c984 1c9e4: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL9M79_timer.lto_priv.463> 1c9e8: 88 23 and r24, r24 1c9ea: 61 f2 breq .-104 ; 0x1c984 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1c9ec: 86 e6 ldi r24, 0x66 ; 102 1c9ee: 9c e3 ldi r25, 0x3C ; 60 1c9f0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1c9f4: 68 e0 ldi r22, 0x08 ; 8 1c9f6: 7b e3 ldi r23, 0x3B ; 59 1c9f8: c3 cf rjmp .-122 ; 0x1c980 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1c9fa: 82 ec ldi r24, 0xC2 ; 194 1c9fc: 9d e3 ldi r25, 0x3D ; 61 1c9fe: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ca02: 60 e3 ldi r22, 0x30 ; 48 1ca04: 72 ed ldi r23, 0xD2 ; 210 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1ca06: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1ca0a: 0e 94 c1 68 call 0xd182 ; 0xd182 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ca0e: 81 11 cpse r24, r1 1ca10: 91 c0 rjmp .+290 ; 0x1cb34 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() 1ca12: 0e 94 27 69 call 0xd24e ; 0xd24e 1ca16: 81 11 cpse r24, r1 1ca18: 8d c0 rjmp .+282 ; 0x1cb34 1ca1a: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 1ca1e: 81 11 cpse r24, r1 1ca20: 89 c0 rjmp .+274 ; 0x1cb34 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ca22: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1ca26: 82 30 cpi r24, 0x02 ; 2 1ca28: 09 f4 brne .+2 ; 0x1ca2c 1ca2a: 84 c0 rjmp .+264 ; 0x1cb34 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1ca2c: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 1ca30: 81 11 cpse r24, r1 1ca32: 05 c0 rjmp .+10 ; 0x1ca3e || lcd_commands_type != LcdCommands::Idle) { 1ca34: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1ca38: 88 23 and r24, r24 1ca3a: 09 f4 brne .+2 ; 0x1ca3e 1ca3c: ac c0 rjmp .+344 ; 0x1cb96 if (!card.isFileOpen()) { 1ca3e: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1ca42: 81 11 cpse r24, r1 1ca44: 12 c0 rjmp .+36 ; 0x1ca6a if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1ca46: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 1ca4a: 81 11 cpse r24, r1 1ca4c: 0e c0 rjmp .+28 ; 0x1ca6a 1ca4e: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 1ca52: 81 11 cpse r24, r1 1ca54: 0a c0 rjmp .+20 ; 0x1ca6a bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1ca56: d0 93 d9 03 sts 0x03D9, r29 ; 0x8003d9 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1ca5a: 85 e4 ldi r24, 0x45 ; 69 1ca5c: 9c e3 ldi r25, 0x3C ; 60 1ca5e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ca62: 6c ef ldi r22, 0xFC ; 252 1ca64: 79 e3 ldi r23, 0x39 ; 57 1ca66: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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)); 1ca6a: 81 ea ldi r24, 0xA1 ; 161 1ca6c: 9d e0 ldi r25, 0x0D ; 13 1ca6e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1ca72: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1ca74: 0e 94 6b 78 call 0xf0d6 ; 0xf0d6 if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1ca78: 87 fd sbrc r24, 7 1ca7a: 09 c0 rjmp .+18 ; 0x1ca8e 1ca7c: c8 17 cp r28, r24 1ca7e: 39 f0 breq .+14 ; 0x1ca8e MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1ca80: c1 02 muls r28, r17 1ca82: c0 01 movw r24, r0 1ca84: 11 24 eor r1, r1 1ca86: 87 5b subi r24, 0xB7 ; 183 1ca88: 92 4f sbci r25, 0xF2 ; 242 1ca8a: 0e 94 dc d0 call 0x1a1b8 ; 0x1a1b8 SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1ca8e: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1ca92: 81 11 cpse r24, r1 1ca94: 4f c0 rjmp .+158 ; 0x1cb34 1ca96: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1ca9a: 81 11 cpse r24, r1 1ca9c: 4b c0 rjmp .+150 ; 0x1cb34 if (MMU2::mmu2.Enabled()) { 1ca9e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1caa2: 81 30 cpi r24, 0x01 ; 1 1caa4: 09 f0 breq .+2 ; 0x1caa8 1caa6: 80 c0 rjmp .+256 ; 0x1cba8 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1caa8: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 1caac: 81 11 cpse r24, r1 1caae: 0c c0 rjmp .+24 ; 0x1cac8 1cab0: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 1cab4: 81 11 cpse r24, r1 1cab6: 08 c0 rjmp .+16 ; 0x1cac8 // 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); 1cab8: 87 e2 ldi r24, 0x27 ; 39 1caba: 9c e3 ldi r25, 0x3C ; 60 1cabc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cac0: 68 ee ldi r22, 0xE8 ; 232 1cac2: 77 ed ldi r23, 0xD7 ; 215 1cac4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1cac8: 86 e1 ldi r24, 0x16 ; 22 1caca: 9c e3 ldi r25, 0x3C ; 60 1cacc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cad0: 6f e1 ldi r22, 0x1F ; 31 1cad2: 78 ed ldi r23, 0xD8 ; 216 1cad4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1cad8: 84 e0 ldi r24, 0x04 ; 4 1cada: 9c e3 ldi r25, 0x3C ; 60 1cadc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cae0: 62 e2 ldi r22, 0x22 ; 34 1cae2: 78 ed ldi r23, 0xD8 ; 216 1cae4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1cae8: 81 e6 ldi r24, 0x61 ; 97 1caea: 9d e5 ldi r25, 0x5D ; 93 1caec: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1caf0: 65 e2 ldi r22, 0x25 ; 37 1caf2: 78 ed ldi r23, 0xD8 ; 216 1caf4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1caf8: 8e ec ldi r24, 0xCE ; 206 1cafa: 9e e0 ldi r25, 0x0E ; 14 1cafc: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1cb00: 88 23 and r24, r24 1cb02: 41 f0 breq .+16 ; 0x1cb14 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1cb04: 82 e5 ldi r24, 0x52 ; 82 1cb06: 9d e5 ldi r25, 0x5D ; 93 1cb08: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cb0c: 68 e2 ldi r22, 0x28 ; 40 1cb0e: 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); 1cb10: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1cb14: 8c ea ldi r24, 0xAC ; 172 1cb16: 9d e3 ldi r25, 0x3D ; 61 1cb18: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cb1c: 66 e4 ldi r22, 0x46 ; 70 1cb1e: 7a e3 ldi r23, 0x3A ; 58 1cb20: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1cb24: 82 ed ldi r24, 0xD2 ; 210 1cb26: 9b e3 ldi r25, 0x3B ; 59 1cb28: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cb2c: 65 e6 ldi r22, 0x65 ; 101 1cb2e: 73 ed ldi r23, 0xD3 ; 211 1cb30: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1cb34: 85 ec ldi r24, 0xC5 ; 197 1cb36: 9b e3 ldi r25, 0x3B ; 59 1cb38: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cb3c: 68 ed ldi r22, 0xD8 ; 216 1cb3e: 79 e3 ldi r23, 0x39 ; 57 1cb40: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1cb44: 88 eb ldi r24, 0xB8 ; 184 1cb46: 9b e3 ldi r25, 0x3B ; 59 1cb48: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cb4c: 66 e8 ldi r22, 0x86 ; 134 1cb4e: 7b e3 ldi r23, 0x3B ; 59 1cb50: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #endif if (MMU2::mmu2.Enabled()) { 1cb54: 80 91 95 13 lds r24, 0x1395 ; 0x801395 1cb58: 81 30 cpi r24, 0x01 ; 1 1cb5a: 41 f4 brne .+16 ; 0x1cb6c MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1cb5c: 87 ea ldi r24, 0xA7 ; 167 1cb5e: 9b e3 ldi r25, 0x3B ; 59 1cb60: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cb64: 62 ef ldi r22, 0xF2 ; 242 1cb66: 7a e3 ldi r23, 0x3A ; 58 1cb68: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 1cb6c: 8d e9 ldi r24, 0x9D ; 157 1cb6e: 9b e3 ldi r25, 0x3B ; 59 1cb70: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cb74: 64 ec ldi r22, 0xC4 ; 196 1cb76: 7a e3 ldi r23, 0x3A ; 58 1cb78: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_END(); 1cb7c: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1cb80: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1cb84: 8f 5f subi r24, 0xFF ; 255 1cb86: 80 93 12 05 sts 0x0512, r24 ; 0x800512 1cb8a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1cb8e: 8f 5f subi r24, 0xFF ; 255 1cb90: 80 93 14 05 sts 0x0514, r24 ; 0x800514 1cb94: 32 ce rjmp .-924 ; 0x1c7fa #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 1cb96: d0 93 d9 03 sts 0x03D9, r29 ; 0x8003d9 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1cb9a: 88 e3 ldi r24, 0x38 ; 56 1cb9c: 9c e3 ldi r25, 0x3C ; 60 1cb9e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cba2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 1cba6: 61 cf rjmp .-318 ; 0x1ca6a MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1cba8: 80 91 85 17 lds r24, 0x1785 ; 0x801785 1cbac: 88 23 and r24, r24 1cbae: e1 f0 breq .+56 ; 0x1cbe8 if (!fsensor.getAutoLoadEnabled()) { 1cbb0: 80 91 86 17 lds r24, 0x1786 ; 0x801786 1cbb4: 81 11 cpse r24, r1 1cbb6: 08 c0 rjmp .+16 ; 0x1cbc8 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1cbb8: 84 ef ldi r24, 0xF4 ; 244 1cbba: 9b e3 ldi r25, 0x3B ; 59 1cbbc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cbc0: 6e ea ldi r22, 0xAE ; 174 1cbc2: 7b e3 ldi r23, 0x3B ; 59 1cbc4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } if (!fsensor.getFilamentPresent()) { 1cbc8: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 1cbcc: 81 11 cpse r24, r1 1cbce: 14 c0 rjmp .+40 ; 0x1cbf8 if (fsensor.getAutoLoadEnabled()) { 1cbd0: 80 91 86 17 lds r24, 0x1786 ; 0x801786 1cbd4: 88 23 and r24, r24 1cbd6: 09 f4 brne .+2 ; 0x1cbda 1cbd8: 9d cf rjmp .-198 ; 0x1cb14 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1cbda: 80 ee ldi r24, 0xE0 ; 224 1cbdc: 9b e3 ldi r25, 0x3B ; 59 1cbde: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cbe2: 60 e3 ldi r22, 0x30 ; 48 1cbe4: 7b e3 ldi r23, 0x3B ; 59 1cbe6: 94 cf rjmp .-216 ; 0x1cb10 } 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); 1cbe8: 84 ef ldi r24, 0xF4 ; 244 1cbea: 9b e3 ldi r25, 0x3B ; 59 1cbec: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cbf0: 6e ea ldi r22, 0xAE ; 174 1cbf2: 7b e3 ldi r23, 0x3B ; 59 1cbf4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 1cbf8: 84 e0 ldi r24, 0x04 ; 4 1cbfa: 9c e3 ldi r25, 0x3C ; 60 1cbfc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cc00: 60 e9 ldi r22, 0x90 ; 144 1cc02: 7a e3 ldi r23, 0x3A ; 58 1cc04: 85 cf rjmp .-246 ; 0x1cb10 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1cc06: df 91 pop r29 1cc08: cf 91 pop r28 1cc0a: 1f 91 pop r17 1cc0c: 08 95 ret 0001cc0e : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1cc0e: cf 93 push r28 1cc10: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1cc12: 86 ea ldi r24, 0xA6 ; 166 1cc14: 9c e0 ldi r25, 0x0C ; 12 1cc16: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e status &= ~components; 1cc1a: c0 95 com r28 1cc1c: 6c 2f mov r22, r28 1cc1e: 68 23 and r22, r24 1cc20: 86 ea ldi r24, 0xA6 ; 166 1cc22: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1cc24: cf 91 pop r28 1cc26: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0001cc2a : } } } static void lcd_reset_sheet() { 1cc2a: 1f 93 push r17 1cc2c: cf 93 push r28 1cc2e: df 93 push r29 1cc30: 00 d0 rcall .+0 ; 0x1cc32 1cc32: 00 d0 rcall .+0 ; 0x1cc34 1cc34: 1f 92 push r1 1cc36: 1f 92 push r1 1cc38: cd b7 in r28, 0x3d ; 61 1cc3a: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1cc3c: be 01 movw r22, r28 1cc3e: 6f 5f subi r22, 0xFF ; 255 1cc40: 7f 4f sbci r23, 0xFF ; 255 1cc42: 80 91 da 03 lds r24, 0x03DA ; 0x8003da 1cc46: 0e 94 8d 78 call 0xf11a ; 0xf11a eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1cc4a: 80 91 da 03 lds r24, 0x03DA ; 0x8003da 1cc4e: 1b e0 ldi r17, 0x0B ; 11 1cc50: 81 9f mul r24, r17 1cc52: c0 01 movw r24, r0 1cc54: 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); 1cc56: 6f ef ldi r22, 0xFF ; 255 1cc58: 7f ef ldi r23, 0xFF ; 255 1cc5a: 80 5b subi r24, 0xB0 ; 176 1cc5c: 92 4f sbci r25, 0xF2 ; 242 1cc5e: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1cc62: 60 91 da 03 lds r22, 0x03DA ; 0x8003da 1cc66: 61 9f mul r22, r17 1cc68: b0 01 movw r22, r0 1cc6a: 11 24 eor r1, r1 1cc6c: 67 5b subi r22, 0xB7 ; 183 1cc6e: 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); 1cc70: 47 e0 ldi r20, 0x07 ; 7 1cc72: 50 e0 ldi r21, 0x00 ; 0 1cc74: ce 01 movw r24, r28 1cc76: 01 96 adiw r24, 0x01 ; 1 1cc78: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1cc7c: 81 ea ldi r24, 0xA1 ; 161 1cc7e: 9d e0 ldi r25, 0x0D ; 13 1cc80: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1cc84: 90 91 da 03 lds r25, 0x03DA ; 0x8003da 1cc88: 89 13 cpse r24, r25 1cc8a: 0a c0 rjmp .+20 ; 0x1cca0 { eeprom_switch_to_next_sheet(); 1cc8c: 0e 94 7f 78 call 0xf0fe ; 0xf0fe if (-1 == eeprom_next_initialized_sheet(0)) 1cc90: 80 e0 ldi r24, 0x00 ; 0 1cc92: 0e 94 6b 78 call 0xf0d6 ; 0xf0d6 1cc96: 8f 3f cpi r24, 0xFF ; 255 1cc98: 19 f4 brne .+6 ; 0x1cca0 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1cc9a: 80 e1 ldi r24, 0x10 ; 16 1cc9c: 0e 94 07 e6 call 0x1cc0e ; 0x1cc0e } menu_back(); 1cca0: 0f 94 56 d1 call 0x3a2ac ; 0x3a2ac } 1cca4: 28 96 adiw r28, 0x08 ; 8 1cca6: 0f b6 in r0, 0x3f ; 63 1cca8: f8 94 cli 1ccaa: de bf out 0x3e, r29 ; 62 1ccac: 0f be out 0x3f, r0 ; 63 1ccae: cd bf out 0x3d, r28 ; 61 1ccb0: df 91 pop r29 1ccb2: cf 91 pop r28 1ccb4: 1f 91 pop r17 1ccb6: 08 95 ret 0001ccb8 : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1ccb8: cf 93 push r28 1ccba: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1ccbc: 86 ea ldi r24, 0xA6 ; 166 1ccbe: 9c e0 ldi r25, 0x0C ; 12 1ccc0: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e status |= components; 1ccc4: 68 2f mov r22, r24 1ccc6: 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); 1ccc8: 86 ea ldi r24, 0xA6 ; 166 1ccca: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1cccc: cf 91 pop r28 1ccce: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0001ccd2 : //! @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) 1ccd2: 2f 92 push r2 1ccd4: 3f 92 push r3 1ccd6: 4f 92 push r4 1ccd8: 5f 92 push r5 1ccda: 6f 92 push r6 1ccdc: 7f 92 push r7 1ccde: 8f 92 push r8 1cce0: 9f 92 push r9 1cce2: af 92 push r10 1cce4: bf 92 push r11 1cce6: cf 92 push r12 1cce8: df 92 push r13 1ccea: ef 92 push r14 1ccec: ff 92 push r15 1ccee: 0f 93 push r16 1ccf0: 1f 93 push r17 1ccf2: cf 93 push r28 1ccf4: df 93 push r29 1ccf6: cd b7 in r28, 0x3d ; 61 1ccf8: de b7 in r29, 0x3e ; 62 1ccfa: ce 5c subi r28, 0xCE ; 206 1ccfc: d1 09 sbc r29, r1 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: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 1cd0a: 81 e0 ldi r24, 0x01 ; 1 1cd0c: 0e 94 f6 67 call 0xcfec ; 0xcfec #endif // TMC2130 FORCE_BL_ON_START; 1cd10: 81 e0 ldi r24, 0x01 ; 1 1cd12: 0e 94 05 8c call 0x1180a ; 0x1180a // Only Z calibration? if (!onlyZ) 1cd16: 11 11 cpse r17, r1 1cd18: 04 c0 rjmp .+8 ; 0x1cd22 { disable_heater(); 1cd1a: 0f 94 21 44 call 0x28842 ; 0x28842 eeprom_adjust_bed_reset(); //reset bed level correction 1cd1e: 0e 94 b4 78 call 0xf168 ; 0xf168 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 1cd22: 80 e0 ldi r24, 0x00 ; 0 1cd24: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 // Let the planner use the uncorrected coordinates. mbl.reset(); 1cd28: 0f 94 9d 8b call 0x3173a ; 0x3173a // 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(); 1cd2c: 0f 94 2e cb call 0x3965c ; 0x3965c babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 1cd30: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.513+0x1> 1cd34: 10 92 67 05 sts 0x0567, r1 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.513> // 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)); 1cd38: ed e3 ldi r30, 0x3D ; 61 1cd3a: f7 e0 ldi r31, 0x07 ; 7 1cd3c: 83 e0 ldi r24, 0x03 ; 3 1cd3e: df 01 movw r26, r30 1cd40: 1d 92 st X+, r1 1cd42: 8a 95 dec r24 1cd44: e9 f7 brne .-6 ; 0x1cd40 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 1cd46: 81 e0 ldi r24, 0x01 ; 1 1cd48: 0e 94 2e 68 call 0xd05c ; 0xd05c 1cd4c: c7 55 subi r28, 0x57 ; 87 1cd4e: df 4f sbci r29, 0xFF ; 255 1cd50: 99 83 std Y+1, r25 ; 0x01 1cd52: 88 83 st Y, r24 1cd54: c9 5a subi r28, 0xA9 ; 169 1cd56: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 1cd58: 88 e3 ldi r24, 0x38 ; 56 1cd5a: 9a e4 ldi r25, 0x4A ; 74 1cd5c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cd60: 0f 94 4f 34 call 0x2689e ; 0x2689e raise_z_above(MESH_HOME_Z_SEARCH); 1cd64: 60 e0 ldi r22, 0x00 ; 0 1cd66: 70 e0 ldi r23, 0x00 ; 0 1cd68: 80 ea ldi r24, 0xA0 ; 160 1cd6a: 90 e4 ldi r25, 0x40 ; 64 1cd6c: 0e 94 a6 6f call 0xdf4c ; 0xdf4c } /**/ void home_xy() { set_destination_to_current(); 1cd70: 0e 94 80 69 call 0xd300 ; 0xd300 homeaxis(X_AXIS); 1cd74: 50 e0 ldi r21, 0x00 ; 0 1cd76: 40 e0 ldi r20, 0x00 ; 0 1cd78: 61 e0 ldi r22, 0x01 ; 1 1cd7a: 80 e0 ldi r24, 0x00 ; 0 1cd7c: 0e 94 87 7c call 0xf90e ; 0xf90e homeaxis(Y_AXIS); 1cd80: 50 e0 ldi r21, 0x00 ; 0 1cd82: 40 e0 ldi r20, 0x00 ; 0 1cd84: 61 e0 ldi r22, 0x01 ; 1 1cd86: 81 e0 ldi r24, 0x01 ; 1 1cd88: 0e 94 87 7c call 0xf90e ; 0xf90e plan_set_position_curposXYZE(); 1cd8c: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 endstops_hit_on_purpose(); 1cd90: 0f 94 25 63 call 0x2c64a ; 0x2c64a 1cd94: 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; 1cd98: 20 e0 ldi r18, 0x00 ; 0 1cd9a: 30 e0 ldi r19, 0x00 ; 0 1cd9c: 40 ea ldi r20, 0xA0 ; 160 1cd9e: 50 e4 ldi r21, 0x40 ; 64 1cda0: 60 91 40 07 lds r22, 0x0740 ; 0x800740 1cda4: 70 91 41 07 lds r23, 0x0741 ; 0x800741 1cda8: 80 91 42 07 lds r24, 0x0742 ; 0x800742 1cdac: 90 91 43 07 lds r25, 0x0743 ; 0x800743 1cdb0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1cdb4: 60 93 40 07 sts 0x0740, r22 ; 0x800740 1cdb8: 70 93 41 07 sts 0x0741, r23 ; 0x800741 1cdbc: 80 93 42 07 sts 0x0742, r24 ; 0x800742 1cdc0: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] += 5; 1cdc4: 20 e0 ldi r18, 0x00 ; 0 1cdc6: 30 e0 ldi r19, 0x00 ; 0 1cdc8: 40 ea ldi r20, 0xA0 ; 160 1cdca: 50 e4 ldi r21, 0x40 ; 64 1cdcc: 60 91 44 07 lds r22, 0x0744 ; 0x800744 1cdd0: 70 91 45 07 lds r23, 0x0745 ; 0x800745 1cdd4: 80 91 46 07 lds r24, 0x0746 ; 0x800746 1cdd8: 90 91 47 07 lds r25, 0x0747 ; 0x800747 1cddc: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1cde0: 60 93 44 07 sts 0x0744, r22 ; 0x800744 1cde4: 70 93 45 07 sts 0x0745, r23 ; 0x800745 1cde8: 80 93 46 07 sts 0x0746, r24 ; 0x800746 1cdec: 90 93 47 07 sts 0x0747, r25 ; 0x800747 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1cdf0: 60 e0 ldi r22, 0x00 ; 0 1cdf2: 70 e0 ldi r23, 0x00 ; 0 1cdf4: 80 ea ldi r24, 0xA0 ; 160 1cdf6: 91 e4 ldi r25, 0x41 ; 65 1cdf8: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1cdfc: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 1ce00: 0e 94 84 74 call 0xe908 ; 0xe908 1ce04: e5 96 adiw r28, 0x35 ; 53 1ce06: 8f af std Y+63, r24 ; 0x3f 1ce08: e5 97 sbiw r28, 0x35 ; 53 1ce0a: 81 11 cpse r24, r1 1ce0c: 04 c0 rjmp .+8 ; 0x1ce16 //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 1ce0e: e5 96 adiw r28, 0x35 ; 53 1ce10: 1f ae std Y+63, r1 ; 0x3f 1ce12: e5 97 sbiw r28, 0x35 ; 53 1ce14: 0d c3 rjmp .+1562 ; 0x1d430 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 1ce16: 8c ef ldi r24, 0xFC ; 252 1ce18: 99 e4 ldi r25, 0x49 ; 73 1ce1a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ce1e: 0f 94 d6 34 call 0x269ac ; 0x269ac if(onlyZ){ 1ce22: 11 23 and r17, r17 1ce24: 09 f4 brne .+2 ; 0x1ce28 1ce26: df c2 rjmp .+1470 ; 0x1d3e6 prompt_steel_sheet_on_bed(true); 1ce28: 81 e0 ldi r24, 0x01 ; 1 1ce2a: 0f 94 25 66 call 0x2cc4a ; 0x2cc4a lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 1ce2e: 8a ec ldi r24, 0xCA ; 202 1ce30: 99 e4 ldi r25, 0x49 ; 73 1ce32: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ce36: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_puts_at_P(0,3,_n("1/9")); 1ce3a: 41 e7 ldi r20, 0x71 ; 113 1ce3c: 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")); 1ce3e: 63 e0 ldi r22, 0x03 ; 3 1ce40: 80 e0 ldi r24, 0x00 ; 0 1ce42: 0e 94 3a 70 call 0xe074 ; 0xe074 } refresh_cmd_timeout(); 1ce46: 0e 94 09 68 call 0xd012 ; 0xd012 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 1ce4a: 11 11 cpse r17, r1 1ce4c: 1b c0 rjmp .+54 ; 0x1ce84 { KEEPALIVE_STATE(PAUSED_FOR_USER); 1ce4e: 84 e0 ldi r24, 0x04 ; 4 1ce50: 80 93 96 02 sts 0x0296, r24 ; 0x800296 prompt_steel_sheet_on_bed(false); 1ce54: 80 e0 ldi r24, 0x00 ; 0 1ce56: 0f 94 25 66 call 0x2cc4a ; 0x2cc4a lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 1ce5a: 80 e1 ldi r24, 0x10 ; 16 1ce5c: 99 e4 ldi r25, 0x49 ; 73 1ce5e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ce62: 0f 94 d6 34 call 0x269ac ; 0x269ac KEEPALIVE_STATE(IN_HANDLER); 1ce66: 82 e0 ldi r24, 0x02 ; 2 1ce68: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 1ce6c: 88 ea ldi r24, 0xA8 ; 168 1ce6e: 99 e4 ldi r25, 0x49 ; 73 1ce70: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ce74: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_puts_at_P(0,3,_n("1/4")); 1ce78: 49 e6 ldi r20, 0x69 ; 105 1ce7a: 5f e6 ldi r21, 0x6F ; 111 1ce7c: 63 e0 ldi r22, 0x03 ; 3 1ce7e: 80 e0 ldi r24, 0x00 ; 0 1ce80: 0e 94 3a 70 call 0xe074 ; 0xe074 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 1ce84: 00 91 8f 02 lds r16, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 1ce88: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 1ce8c: 60 e0 ldi r22, 0x00 ; 0 1ce8e: 70 e0 ldi r23, 0x00 ; 0 1ce90: 80 e8 ldi r24, 0x80 ; 128 1ce92: 9f eb ldi r25, 0xBF ; 191 1ce94: 0e 94 27 6f call 0xde4e ; 0xde4e // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1ce98: c1 2c mov r12, r1 1ce9a: d1 2c mov r13, r1 1ce9c: b0 ea ldi r27, 0xA0 ; 160 1ce9e: eb 2e mov r14, r27 1cea0: b0 e4 ldi r27, 0x40 ; 64 1cea2: fb 2e mov r15, r27 1cea4: c0 92 48 07 sts 0x0748, r12 ; 0x800748 1cea8: d0 92 49 07 sts 0x0749, r13 ; 0x800749 1ceac: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 1ceb0: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b 1ceb4: 81 e0 ldi r24, 0x01 ; 1 1ceb6: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 1ceba: 84 e0 ldi r24, 0x04 ; 4 1cebc: 0f 94 5d 3a call 0x274ba ; 0x274ba #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1cec0: 60 e0 ldi r22, 0x00 ; 0 1cec2: 70 e0 ldi r23, 0x00 ; 0 1cec4: 80 ea ldi r24, 0xA0 ; 160 1cec6: 91 e4 ldi r25, 0x41 ; 65 1cec8: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1cecc: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 #ifdef TMC2130 tmc2130_home_exit(); 1ced0: 0f 94 2e 3a call 0x2745c ; 0x2745c 1ced4: 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)) && 1ced8: 82 e0 ldi r24, 0x02 ; 2 1ceda: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 1cede: 2d ec ldi r18, 0xCD ; 205 1cee0: 3c ec ldi r19, 0xCC ; 204 1cee2: 44 ea ldi r20, 0xA4 ; 164 1cee4: 50 e4 ldi r21, 0x40 ; 64 1cee6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1ceea: 18 16 cp r1, r24 1ceec: 0c f4 brge .+2 ; 0x1cef0 1ceee: 84 c2 rjmp .+1288 ; 0x1d3f8 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 1cef0: 82 e0 ldi r24, 0x02 ; 2 1cef2: 0f 94 c7 57 call 0x2af8e ; 0x2af8e #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)) && 1cef6: 23 e3 ldi r18, 0x33 ; 51 1cef8: 33 e3 ldi r19, 0x33 ; 51 1cefa: 4b e9 ldi r20, 0x9B ; 155 1cefc: 50 e4 ldi r21, 0x40 ; 64 1cefe: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1cf02: 87 fd sbrc r24, 7 1cf04: 79 c2 rjmp .+1266 ; 0x1d3f8 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 1cf06: 11 11 cpse r17, r1 1cf08: 7c c2 rjmp .+1272 ; 0x1d402 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1cf0a: 80 e1 ldi r24, 0x10 ; 16 1cf0c: 0e 94 07 e6 call 0x1cc0e ; 0x1cc0e eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1cf10: 81 ea ldi r24, 0xA1 ; 161 1cf12: 9d e0 ldi r25, 0x0D ; 13 1cf14: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1cf18: bb e0 ldi r27, 0x0B ; 11 1cf1a: 8b 9f mul r24, r27 1cf1c: c0 01 movw r24, r0 1cf1e: 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); 1cf20: 70 e0 ldi r23, 0x00 ; 0 1cf22: 60 e0 ldi r22, 0x00 ; 0 1cf24: 80 5b subi r24, 0xB0 ; 176 1cf26: 92 4f sbci r25, 0xF2 ; 242 1cf28: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 } 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(); 1cf2c: 0e 94 09 68 call 0xd012 ; 0xd012 // 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); 1cf30: ee e9 ldi r30, 0x9E ; 158 1cf32: f3 e1 ldi r31, 0x13 ; 19 1cf34: 84 ec ldi r24, 0xC4 ; 196 1cf36: df 01 movw r26, r30 1cf38: 1d 92 st X+, r1 1cf3a: 8a 95 dec r24 1cf3c: e9 f7 brne .-6 ; 0x1cf38 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 1cf3e: 82 e6 ldi r24, 0x62 ; 98 1cf40: 93 e9 ldi r25, 0x93 ; 147 1cf42: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 MYSERIAL.println(int(iteration + 1)); 1cf46: 81 e0 ldi r24, 0x01 ; 1 1cf48: 90 e0 ldi r25, 0x00 ; 0 1cf4a: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 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)); 1cf4e: 88 ea ldi r24, 0xA8 ; 168 1cf50: 99 e4 ldi r25, 0x49 ; 73 1cf52: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1cf56: 0f 94 4f 34 call 0x2689e ; 0x2689e #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; 1cf5a: c0 92 48 07 sts 0x0748, r12 ; 0x800748 1cf5e: d0 92 49 07 sts 0x0749, r13 ; 0x800749 1cf62: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 1cf66: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b 1cf6a: b2 e0 ldi r27, 0x02 ; 2 1cf6c: e1 96 adiw r28, 0x31 ; 49 1cf6e: bf af std Y+63, r27 ; 0x3f 1cf70: e1 97 sbiw r28, 0x31 ; 49 1cf72: 2d e3 ldi r18, 0x3D ; 61 1cf74: 33 e9 ldi r19, 0x93 ; 147 1cf76: cd 56 subi r28, 0x6D ; 109 1cf78: df 4f sbci r29, 0xFF ; 255 1cf7a: 39 83 std Y+1, r19 ; 0x01 1cf7c: 28 83 st Y, r18 1cf7e: c3 59 subi r28, 0x93 ; 147 1cf80: d0 40 sbci r29, 0x00 ; 0 1cf82: 4d e9 ldi r20, 0x9D ; 157 1cf84: 53 e1 ldi r21, 0x13 ; 19 1cf86: cf 56 subi r28, 0x6F ; 111 1cf88: df 4f sbci r29, 0xFF ; 255 1cf8a: 59 83 std Y+1, r21 ; 0x01 1cf8c: 48 83 st Y, r20 1cf8e: c1 59 subi r28, 0x91 ; 145 1cf90: d0 40 sbci r29, 0x00 ; 0 1cf92: a0 96 adiw r28, 0x20 ; 32 1cf94: 5f af std Y+63, r21 ; 0x3f 1cf96: 4e af std Y+62, r20 ; 0x3e 1cf98: a0 97 sbiw r28, 0x20 ; 32 1cf9a: e0 96 adiw r28, 0x30 ; 48 1cf9c: 3f af std Y+63, r19 ; 0x3f 1cf9e: 2e af std Y+62, r18 ; 0x3e 1cfa0: 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; 1cfa2: a7 96 adiw r28, 0x27 ; 39 1cfa4: 1f ae std Y+63, r1 ; 0x3f 1cfa6: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 1cfa8: 31 2c mov r3, r1 1cfaa: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 1cfac: 0e 94 09 68 call 0xd012 ; 0xd012 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 1cfb0: 63 e0 ldi r22, 0x03 ; 3 1cfb2: 80 e0 ldi r24, 0x00 ; 0 1cfb4: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%d/4"),(k+1)); 1cfb8: bf ef ldi r27, 0xFF ; 255 1cfba: 2b 1a sub r2, r27 1cfbc: 3b 0a sbc r3, r27 1cfbe: 3f 92 push r3 1cfc0: 2f 92 push r2 1cfc2: ed e5 ldi r30, 0x5D ; 93 1cfc4: f3 e9 ldi r31, 0x93 ; 147 1cfc6: ff 93 push r31 1cfc8: ef 93 push r30 1cfca: 0e 94 ff 6f call 0xdffe ; 0xdffe } #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); 1cfce: 65 e5 ldi r22, 0x55 ; 85 1cfd0: 75 e5 ldi r23, 0x55 ; 85 1cfd2: 85 e5 ldi r24, 0x55 ; 85 1cfd4: 91 e4 ldi r25, 0x41 ; 65 1cfd6: 0f 94 ce c2 call 0x3859c ; 0x3859c 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); 1cfda: e0 96 adiw r28, 0x30 ; 48 1cfdc: ee ad ldd r30, Y+62 ; 0x3e 1cfde: ff ad ldd r31, Y+63 ; 0x3f 1cfe0: e0 97 sbiw r28, 0x30 ; 48 1cfe2: 85 91 lpm r24, Z+ 1cfe4: 95 91 lpm r25, Z+ 1cfe6: a5 91 lpm r26, Z+ 1cfe8: b4 91 lpm r27, Z 1cfea: 80 93 40 07 sts 0x0740, r24 ; 0x800740 1cfee: 90 93 41 07 sts 0x0741, r25 ; 0x800741 1cff2: a0 93 42 07 sts 0x0742, r26 ; 0x800742 1cff6: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 1cffa: e0 96 adiw r28, 0x30 ; 48 1cffc: ee ad ldd r30, Y+62 ; 0x3e 1cffe: ff ad ldd r31, Y+63 ; 0x3f 1d000: e0 97 sbiw r28, 0x30 ; 48 1d002: 34 96 adiw r30, 0x04 ; 4 1d004: 85 91 lpm r24, Z+ 1d006: 95 91 lpm r25, Z+ 1d008: a5 91 lpm r26, Z+ 1d00a: b4 91 lpm r27, Z 1d00c: 80 93 44 07 sts 0x0744, r24 ; 0x800744 1d010: 90 93 45 07 sts 0x0745, r25 ; 0x800745 1d014: a0 93 46 07 sts 0x0746, r26 ; 0x800746 1d018: b0 93 47 07 sts 0x0747, r27 ; 0x800747 MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 1d01c: 60 e0 ldi r22, 0x00 ; 0 1d01e: 70 e0 ldi r23, 0x00 ; 0 1d020: 88 e4 ldi r24, 0x48 ; 72 1d022: 92 e4 ldi r25, 0x42 ; 66 1d024: 0f 94 ce c2 call 0x3859c ; 0x3859c return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 1d028: 42 ec ldi r20, 0xC2 ; 194 1d02a: 51 e9 ldi r21, 0x91 ; 145 1d02c: 5f 93 push r21 1d02e: 4f 93 push r20 1d030: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 1d034: 41 eb ldi r20, 0xB1 ; 177 1d036: 51 e9 ldi r21, 0x91 ; 145 1d038: 63 e0 ldi r22, 0x03 ; 3 1d03a: 84 e0 ldi r24, 0x04 ; 4 1d03c: 0e 94 3a 70 call 0xe074 ; 0xe074 // disable heaters and stop motion before we initialize sm4 disable_heater(); 1d040: 0f 94 21 44 call 0x28842 ; 0x28842 st_synchronize(); 1d044: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 1d048: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d04c: 8d 7f andi r24, 0xFD ; 253 1d04e: 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" ); 1d052: 0f b6 in r0, 0x3f ; 63 1d054: f8 94 cli 1d056: a8 95 wdr 1d058: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d05c: 88 61 ori r24, 0x18 ; 24 1d05e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d062: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d066: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 1d068: 10 92 66 05 sts 0x0566, r1 ; 0x800566 1d06c: 10 92 65 05 sts 0x0565, r1 ; 0x800565 sm4_update_pos_cb = xyzcal_update_pos; 1d070: 82 e2 ldi r24, 0x22 ; 34 1d072: 9f ec ldi r25, 0xCF ; 207 1d074: 90 93 64 05 sts 0x0564, r25 ; 0x800564 1d078: 80 93 63 05 sts 0x0563, r24 ; 0x800563 sm4_calc_delay_cb = xyzcal_calc_delay; 1d07c: a2 eb ldi r26, 0xB2 ; 178 1d07e: be ec ldi r27, 0xCE ; 206 1d080: b0 93 62 05 sts 0x0562, r27 ; 0x800562 1d084: a0 93 61 05 sts 0x0561, r26 ; 0x800561 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]); 1d088: 00 91 69 07 lds r16, 0x0769 ; 0x800769 1d08c: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 1d090: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 1d094: 30 91 6c 07 lds r19, 0x076C ; 0x80076c 1d098: 40 91 65 07 lds r20, 0x0765 ; 0x800765 1d09c: 50 91 66 07 lds r21, 0x0766 ; 0x800766 1d0a0: 60 91 67 07 lds r22, 0x0767 ; 0x800767 1d0a4: 70 91 68 07 lds r23, 0x0768 ; 0x800768 1d0a8: 80 91 61 07 lds r24, 0x0761 ; 0x800761 1d0ac: 90 91 62 07 lds r25, 0x0762 ; 0x800762 1d0b0: a0 91 63 07 lds r26, 0x0763 ; 0x800763 1d0b4: b0 91 64 07 lds r27, 0x0764 ; 0x800764 1d0b8: 3f 93 push r19 1d0ba: 2f 93 push r18 1d0bc: 1f 93 push r17 1d0be: 0f 93 push r16 1d0c0: 7f 93 push r23 1d0c2: 6f 93 push r22 1d0c4: 5f 93 push r21 1d0c6: 4f 93 push r20 1d0c8: bf 93 push r27 1d0ca: af 93 push r26 1d0cc: 9f 93 push r25 1d0ce: 8f 93 push r24 1d0d0: e1 e6 ldi r30, 0x61 ; 97 1d0d2: f2 e9 ldi r31, 0x92 ; 146 1d0d4: ff 93 push r31 1d0d6: ef 93 push r30 1d0d8: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 int16_t x0 = _X; 1d0dc: 40 90 61 07 lds r4, 0x0761 ; 0x800761 1d0e0: 50 90 62 07 lds r5, 0x0762 ; 0x800762 1d0e4: 60 90 63 07 lds r6, 0x0763 ; 0x800763 1d0e8: 70 90 64 07 lds r7, 0x0764 ; 0x800764 1d0ec: b4 2c mov r11, r4 1d0ee: a5 2c mov r10, r5 int16_t y0 = _Y; 1d0f0: 80 91 65 07 lds r24, 0x0765 ; 0x800765 1d0f4: 90 91 66 07 lds r25, 0x0766 ; 0x800766 1d0f8: a0 91 67 07 lds r26, 0x0767 ; 0x800767 1d0fc: b0 91 68 07 lds r27, 0x0768 ; 0x800768 1d100: a6 96 adiw r28, 0x26 ; 38 1d102: 8c af std Y+60, r24 ; 0x3c 1d104: 9d af std Y+61, r25 ; 0x3d 1d106: ae af std Y+62, r26 ; 0x3e 1d108: bf af std Y+63, r27 ; 0x3f 1d10a: a6 97 sbiw r28, 0x26 ; 38 1d10c: a3 96 adiw r28, 0x23 ; 35 1d10e: 9f ac ldd r9, Y+63 ; 0x3f 1d110: a3 97 sbiw r28, 0x23 ; 35 1d112: a4 96 adiw r28, 0x24 ; 36 1d114: 8f ac ldd r8, Y+63 ; 0x3f 1d116: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 1d118: c0 90 69 07 lds r12, 0x0769 ; 0x800769 1d11c: d0 90 6a 07 lds r13, 0x076A ; 0x80076a 1d120: e0 90 6b 07 lds r14, 0x076B ; 0x80076b 1d124: f0 90 6c 07 lds r15, 0x076C ; 0x80076c 1d128: 0f b6 in r0, 0x3f ; 63 1d12a: f8 94 cli 1d12c: de bf out 0x3e, r29 ; 62 1d12e: 0f be out 0x3f, r0 ; 63 1d130: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 1d132: b5 e0 ldi r27, 0x05 ; 5 1d134: cb 16 cp r12, r27 1d136: b7 ef ldi r27, 0xF7 ; 247 1d138: db 06 cpc r13, r27 1d13a: 0c f4 brge .+2 ; 0x1d13e 1d13c: d9 c1 rjmp .+946 ; 0x1d4f0 } 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; 1d13e: 1a 82 std Y+2, r1 ; 0x02 1d140: 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); 1d142: 1f 92 push r1 1d144: 1f 92 push r1 1d146: e3 e0 ldi r30, 0x03 ; 3 1d148: ef 93 push r30 1d14a: f4 e8 ldi r31, 0x84 ; 132 1d14c: ff 93 push r31 1d14e: 1f 92 push r1 1d150: 24 e6 ldi r18, 0x64 ; 100 1d152: 2f 93 push r18 1d154: df 92 push r13 1d156: cf 92 push r12 1d158: 8f 92 push r8 1d15a: 9f 92 push r9 1d15c: af 92 push r10 1d15e: bf 92 push r11 1d160: 48 ed ldi r20, 0xD8 ; 216 1d162: 51 e9 ldi r21, 0x91 ; 145 1d164: 5f 93 push r21 1d166: 4f 93 push r20 1d168: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if (!ret && (ad < 720)) 1d16c: 0f b6 in r0, 0x3f ; 63 1d16e: f8 94 cli 1d170: de bf out 0x3e, r29 ; 62 1d172: 0f be out 0x3f, r0 ; 63 1d174: cd bf out 0x3d, r28 ; 61 1d176: 89 81 ldd r24, Y+1 ; 0x01 1d178: 9a 81 ldd r25, Y+2 ; 0x02 1d17a: 80 3d cpi r24, 0xD0 ; 208 1d17c: 92 40 sbci r25, 0x02 ; 2 1d17e: 08 f4 brcc .+2 ; 0x1d182 1d180: 82 c1 rjmp .+772 ; 0x1d486 if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 1d182: 89 81 ldd r24, Y+1 ; 0x01 1d184: 9a 81 ldd r25, Y+2 ; 0x02 1d186: 80 3a cpi r24, 0xA0 ; 160 1d188: 95 40 sbci r25, 0x05 ; 5 1d18a: 10 f0 brcs .+4 ; 0x1d190 1d18c: 0c 94 c3 f7 jmp 0x1ef86 ; 0x1ef86 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 1d190: 9e 01 movw r18, r28 1d192: 2f 5f subi r18, 0xFF ; 255 1d194: 3f 4f sbci r19, 0xFF ; 255 1d196: 79 01 movw r14, r18 1d198: 10 e0 ldi r17, 0x00 ; 0 1d19a: 00 e0 ldi r16, 0x00 ; 0 1d19c: 2c e7 ldi r18, 0x7C ; 124 1d19e: 3c ef ldi r19, 0xFC ; 252 1d1a0: a6 01 movw r20, r12 1d1a2: 44 56 subi r20, 0x64 ; 100 1d1a4: 51 09 sbc r21, r1 1d1a6: 69 2d mov r22, r9 1d1a8: 78 2d mov r23, r8 1d1aa: 8b 2d mov r24, r11 1d1ac: 9a 2d mov r25, r10 1d1ae: 0f 94 95 94 call 0x3292a ; 0x3292a 1d1b2: 88 23 and r24, r24 1d1b4: 11 f4 brne .+4 ; 0x1d1ba 1d1b6: 0c 94 c3 f7 jmp 0x1ef86 ; 0x1ef86 ad += 720; 1d1ba: 89 81 ldd r24, Y+1 ; 0x01 1d1bc: 9a 81 ldd r25, Y+2 ; 0x02 1d1be: 80 53 subi r24, 0x30 ; 48 1d1c0: 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); 1d1c2: c0 90 69 07 lds r12, 0x0769 ; 0x800769 1d1c6: d0 90 6a 07 lds r13, 0x076A ; 0x80076a 1d1ca: e0 90 6b 07 lds r14, 0x076B ; 0x80076b 1d1ce: f0 90 6c 07 lds r15, 0x076C ; 0x80076c 1d1d2: 00 91 65 07 lds r16, 0x0765 ; 0x800765 1d1d6: 10 91 66 07 lds r17, 0x0766 ; 0x800766 1d1da: 20 91 67 07 lds r18, 0x0767 ; 0x800767 1d1de: 30 91 68 07 lds r19, 0x0768 ; 0x800768 1d1e2: 40 91 61 07 lds r20, 0x0761 ; 0x800761 1d1e6: 50 91 62 07 lds r21, 0x0762 ; 0x800762 1d1ea: 60 91 63 07 lds r22, 0x0763 ; 0x800763 1d1ee: 70 91 64 07 lds r23, 0x0764 ; 0x800764 1d1f2: 9f 93 push r25 1d1f4: 8f 93 push r24 1d1f6: df 92 push r13 1d1f8: cf 92 push r12 1d1fa: 1f 93 push r17 1d1fc: 0f 93 push r16 1d1fe: 5f 93 push r21 1d200: 4f 93 push r20 1d202: 8d e3 ldi r24, 0x3D ; 61 1d204: 92 e9 ldi r25, 0x92 ; 146 1d206: 9f 93 push r25 1d208: 8f 93 push r24 1d20a: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 /// 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); 1d20e: 40 91 69 07 lds r20, 0x0769 ; 0x800769 1d212: 50 91 6a 07 lds r21, 0x076A ; 0x80076a 1d216: 60 91 6b 07 lds r22, 0x076B ; 0x80076b 1d21a: 70 91 6c 07 lds r23, 0x076C ; 0x80076c 1d21e: 48 54 subi r20, 0x48 ; 72 1d220: 51 09 sbc r21, r1 1d222: 00 e0 ldi r16, 0x00 ; 0 1d224: 28 ec ldi r18, 0xC8 ; 200 1d226: 30 e0 ldi r19, 0x00 ; 0 1d228: a3 96 adiw r28, 0x23 ; 35 1d22a: 6f ad ldd r22, Y+63 ; 0x3f 1d22c: a3 97 sbiw r28, 0x23 ; 35 1d22e: a4 96 adiw r28, 0x24 ; 36 1d230: 7f ad ldd r23, Y+63 ; 0x3f 1d232: a4 97 sbiw r28, 0x24 ; 36 1d234: c2 01 movw r24, r4 1d236: 0e 94 27 e1 call 0x1c24e ; 0x1c24e /// 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; 1d23a: 20 91 61 07 lds r18, 0x0761 ; 0x800761 1d23e: 30 91 62 07 lds r19, 0x0762 ; 0x800762 1d242: 40 91 63 07 lds r20, 0x0763 ; 0x800763 1d246: 50 91 64 07 lds r21, 0x0764 ; 0x800764 1d24a: 6e 96 adiw r28, 0x1e ; 30 1d24c: 2c af std Y+60, r18 ; 0x3c 1d24e: 3d af std Y+61, r19 ; 0x3d 1d250: 4e af std Y+62, r20 ; 0x3e 1d252: 5f af std Y+63, r21 ; 0x3f 1d254: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 1d256: 80 91 65 07 lds r24, 0x0765 ; 0x800765 1d25a: 90 91 66 07 lds r25, 0x0766 ; 0x800766 1d25e: a0 91 67 07 lds r26, 0x0767 ; 0x800767 1d262: b0 91 68 07 lds r27, 0x0768 ; 0x800768 1d266: ae 96 adiw r28, 0x2e ; 46 1d268: 8c af std Y+60, r24 ; 0x3c 1d26a: 9d af std Y+61, r25 ; 0x3d 1d26c: ae af std Y+62, r26 ; 0x3e 1d26e: bf af std Y+63, r27 ; 0x3f 1d270: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 1d272: 20 91 69 07 lds r18, 0x0769 ; 0x800769 1d276: 30 91 6a 07 lds r19, 0x076A ; 0x80076a 1d27a: 40 91 6b 07 lds r20, 0x076B ; 0x80076b 1d27e: 50 91 6c 07 lds r21, 0x076C ; 0x80076c 1d282: e9 96 adiw r28, 0x39 ; 57 1d284: 2c af std Y+60, r18 ; 0x3c 1d286: 3d af std Y+61, r19 ; 0x3d 1d288: 4e af std Y+62, r20 ; 0x3e 1d28a: 5f af std Y+63, r21 ; 0x3f 1d28c: e9 97 sbiw r28, 0x39 ; 57 1d28e: a3 e7 ldi r26, 0x73 ; 115 1d290: bb e0 ldi r27, 0x0B ; 11 1d292: 0f b6 in r0, 0x3f ; 63 1d294: f8 94 cli 1d296: de bf out 0x3e, r29 ; 62 1d298: 0f be out 0x3f, r0 ; 63 1d29a: cd bf out 0x3d, r28 ; 61 1d29c: 90 e0 ldi r25, 0x00 ; 0 1d29e: 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)); 1d2a0: fc 01 movw r30, r24 1d2a2: e8 52 subi r30, 0x28 ; 40 1d2a4: fd 46 sbci r31, 0x6D ; 109 1d2a6: 25 91 lpm r18, Z+ 1d2a8: 34 91 lpm r19, Z 1d2aa: 2d 93 st X+, r18 1d2ac: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 1d2ae: fc 01 movw r30, r24 1d2b0: e0 54 subi r30, 0x40 ; 64 1d2b2: fd 46 sbci r31, 0x6D ; 109 1d2b4: 25 91 lpm r18, Z+ 1d2b6: 34 91 lpm r19, Z 1d2b8: 57 96 adiw r26, 0x17 ; 23 1d2ba: 3c 93 st X, r19 1d2bc: 2e 93 st -X, r18 1d2be: 56 97 sbiw r26, 0x16 ; 22 1d2c0: 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++){ 1d2c2: 88 31 cpi r24, 0x18 ; 24 1d2c4: 91 05 cpc r25, r1 1d2c6: 61 f7 brne .-40 ; 0x1d2a0 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); 1d2c8: e7 96 adiw r28, 0x37 ; 55 1d2ca: 4e ad ldd r20, Y+62 ; 0x3e 1d2cc: 5f ad ldd r21, Y+63 ; 0x3f 1d2ce: e7 97 sbiw r28, 0x37 ; 55 1d2d0: ac 96 adiw r28, 0x2c ; 44 1d2d2: 6e ad ldd r22, Y+62 ; 0x3e 1d2d4: 7f ad ldd r23, Y+63 ; 0x3f 1d2d6: ac 97 sbiw r28, 0x2c ; 44 1d2d8: 6c 96 adiw r28, 0x1c ; 28 1d2da: 8e ad ldd r24, Y+62 ; 0x3e 1d2dc: 9f ad ldd r25, Y+63 ; 0x3f 1d2de: 6c 97 sbiw r28, 0x1c ; 28 1d2e0: 0f 94 1d 91 call 0x3223a ; 0x3223a 1d2e4: 23 e7 ldi r18, 0x73 ; 115 1d2e6: 37 e0 ldi r19, 0x07 ; 7 1d2e8: a4 96 adiw r28, 0x24 ; 36 1d2ea: 3f af std Y+63, r19 ; 0x3f 1d2ec: 2e af std Y+62, r18 ; 0x3e 1d2ee: a4 97 sbiw r28, 0x24 ; 36 1d2f0: 79 01 movw r14, r18 1d2f2: f0 e2 ldi r31, 0x20 ; 32 1d2f4: 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]); 1d2f6: a3 e8 ldi r26, 0x83 ; 131 1d2f8: ca 2e mov r12, r26 1d2fa: a2 e9 ldi r26, 0x92 ; 146 1d2fc: da 2e mov r13, r26 } DBG(endl); 1d2fe: 0b e0 ldi r16, 0x0B ; 11 1d300: 16 ea ldi r17, 0xA6 ; 166 for (uint8_t i = 0; i < 12; i++){ pattern08[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_08 + i)); pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); } xyzcal_scan_pixels_32x32_Zhop(x, y, z, 2400, 200, matrix32); 1d302: 57 01 movw r10, r14 1d304: e0 e2 ldi r30, 0x20 ; 32 1d306: 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]); 1d308: d5 01 movw r26, r10 1d30a: 8d 91 ld r24, X+ 1d30c: 5d 01 movw r10, r26 1d30e: 1f 92 push r1 1d310: 8f 93 push r24 1d312: df 92 push r13 1d314: cf 92 push r12 1d316: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1d31a: 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){ 1d31c: 0f 90 pop r0 1d31e: 0f 90 pop r0 1d320: 0f 90 pop r0 1d322: 0f 90 pop r0 1d324: 81 10 cpse r8, r1 1d326: f0 cf rjmp .-32 ; 0x1d308 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 1d328: 1f 93 push r17 1d32a: 0f 93 push r16 1d32c: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1d330: 9a 94 dec r9 1d332: b0 e2 ldi r27, 0x20 ; 32 1d334: eb 0e add r14, r27 1d336: 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){ 1d338: 0f 90 pop r0 1d33a: 0f 90 pop r0 1d33c: 91 10 cpse r9, r1 1d33e: e1 cf rjmp .-62 ; 0x1d302 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 1d340: 1f 93 push r17 1d342: 0f 93 push r16 1d344: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1d348: 63 e7 ldi r22, 0x73 ; 115 1d34a: 7b e0 ldi r23, 0x0B ; 11 1d34c: 0f 90 pop r0 1d34e: 0f 90 pop r0 1d350: e3 e7 ldi r30, 0x73 ; 115 1d352: 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; 1d354: 90 e0 ldi r25, 0x00 ; 0 1d356: 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; 1d358: 50 e0 ldi r21, 0x00 ; 0 1d35a: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 1d35c: 21 91 ld r18, Z+ 1d35e: 21 11 cpse r18, r1 1d360: 07 c3 rjmp .+1550 ; 0x1d970 ++mins; 1d362: 4f 5f subi r20, 0xFF ; 255 1d364: 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){ 1d366: 6e 17 cp r22, r30 1d368: 7f 07 cpc r23, r31 1d36a: c1 f7 brne .-16 ; 0x1d35c ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 1d36c: 9a 01 movw r18, r20 1d36e: 28 0f add r18, r24 1d370: 39 1f adc r19, r25 1d372: 25 38 cpi r18, 0x85 ; 133 1d374: 33 40 sbci r19, 0x03 ; 3 1d376: a4 f0 brlt .+40 ; 0x1d3a0 && mins > threshold_extreme 1d378: 43 33 cpi r20, 0x33 ; 51 1d37a: 51 05 cpc r21, r1 1d37c: 8c f0 brlt .+34 ; 0x1d3a0 && maxs > threshold_extreme 1d37e: 83 33 cpi r24, 0x33 ; 51 1d380: 91 05 cpc r25, r1 1d382: 74 f0 brlt .+28 ; 0x1d3a0 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 1d384: 20 e0 ldi r18, 0x00 ; 0 1d386: 34 e0 ldi r19, 0x04 ; 4 1d388: 24 1b sub r18, r20 1d38a: 35 0b sbc r19, r21 1d38c: 28 1b sub r18, r24 1d38e: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 1d390: 24 17 cp r18, r20 1d392: 35 07 cpc r19, r21 1d394: 2c f4 brge .+10 ; 0x1d3a0 } 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; 1d396: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 1d398: 28 17 cp r18, r24 1d39a: 39 07 cpc r19, r25 1d39c: 0c f4 brge .+2 ; 0x1d3a0 1d39e: d8 c0 rjmp .+432 ; 0x1d550 } /// 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; 1d3a0: 66 96 adiw r28, 0x16 ; 22 1d3a2: 1f ae std Y+63, r1 ; 0x3f 1d3a4: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 1d3a6: 62 96 adiw r28, 0x12 ; 18 1d3a8: 1f ae std Y+63, r1 ; 0x3f 1d3aa: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 1d3ac: 22 96 adiw r28, 0x02 ; 2 1d3ae: 1f ae std Y+63, r1 ; 0x3f 1d3b0: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 1d3b2: 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) 1d3b4: 83 e7 ldi r24, 0x73 ; 115 1d3b6: 97 e0 ldi r25, 0x07 ; 7 1d3b8: 89 2b or r24, r25 1d3ba: 99 f0 breq .+38 ; 0x1d3e2 1d3bc: 83 e7 ldi r24, 0x73 ; 115 1d3be: 9b e0 ldi r25, 0x0B ; 11 return -1; 1d3c0: 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) 1d3c2: 00 97 sbiw r24, 0x00 ; 0 1d3c4: 49 f0 breq .+18 ; 0x1d3d8 1d3c6: ae 01 movw r20, r28 1d3c8: 4f 5a subi r20, 0xAF ; 175 1d3ca: 5f 4f sbci r21, 0xFF ; 255 1d3cc: be 01 movw r22, r28 1d3ce: 6b 5a subi r22, 0xAB ; 171 1d3d0: 7f 4f sbci r23, 0xFF ; 255 1d3d2: 0f 94 40 90 call 0x32080 ; 0x32080 1d3d6: 08 2f mov r16, r24 1d3d8: 8b e8 ldi r24, 0x8B ; 139 1d3da: 9b e0 ldi r25, 0x0B ; 11 1d3dc: 89 2b or r24, r25 1d3de: 09 f0 breq .+2 ; 0x1d3e2 1d3e0: cc c2 rjmp .+1432 ; 0x1d97a 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; 1d3e2: 8f ef ldi r24, 0xFF ; 255 1d3e4: dc c2 rjmp .+1464 ; 0x1d99e 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)); 1d3e6: 88 ea ldi r24, 0xA8 ; 168 1d3e8: 99 e4 ldi r25, 0x49 ; 73 1d3ea: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1d3ee: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_puts_at_P(0,3,_n("1/4")); 1d3f2: 4d e6 ldi r20, 0x6D ; 109 1d3f4: 5f e6 ldi r21, 0x6F ; 111 1d3f6: 23 cd rjmp .-1466 ; 0x1ce3e } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 1d3f8: 8e e6 ldi r24, 0x6E ; 110 1d3fa: 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); 1d3fc: 0f 94 d6 34 call 0x269ac ; 0x269ac 1d400: 06 cd rjmp .-1524 ; 0x1ce0e 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); 1d402: c7 55 subi r28, 0x57 ; 87 1d404: df 4f sbci r29, 0xFF ; 255 1d406: 88 81 ld r24, Y 1d408: 99 81 ldd r25, Y+1 ; 0x01 1d40a: c9 5a subi r28, 0xA9 ; 169 1d40c: d0 40 sbci r29, 0x00 ; 0 1d40e: 0e 94 14 68 call 0xd028 ; 0xd028 // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 1d412: 0f 94 93 cb call 0x39726 ; 0x39726 // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 1d416: 0f 94 31 c9 call 0x39262 ; 0x39262 //FIXME bool result = sample_mesh_and_store_reference(); 1d41a: 0f 94 40 c7 call 0x38e80 ; 0x38e80 1d41e: e5 96 adiw r28, 0x35 ; 53 1d420: 8f af std Y+63, r24 ; 0x3f 1d422: e5 97 sbiw r28, 0x35 ; 53 if (result) 1d424: 88 23 and r24, r24 1d426: 09 f4 brne .+2 ; 0x1d42a 1d428: f2 cc rjmp .-1564 ; 0x1ce0e { calibration_status_set(CALIBRATION_STATUS_Z); 1d42a: 84 e0 ldi r24, 0x04 ; 4 1d42c: 0e 94 5c e6 call 0x1ccb8 ; 0x1ccb8 } else { // Timeouted. } lcd_update_enable(true); 1d430: 81 e0 ldi r24, 0x01 ; 1 1d432: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 #ifdef TMC2130 FORCE_HIGH_POWER_END; 1d436: 80 e0 ldi r24, 0x00 ; 0 1d438: 0e 94 f6 67 call 0xcfec ; 0xcfec #endif // TMC2130 FORCE_BL_ON_END; 1d43c: 80 e0 ldi r24, 0x00 ; 0 1d43e: 0e 94 05 8c call 0x1180a ; 0x1180a return final_result; } 1d442: e5 96 adiw r28, 0x35 ; 53 1d444: 8f ad ldd r24, Y+63 ; 0x3f 1d446: e5 97 sbiw r28, 0x35 ; 53 1d448: c2 53 subi r28, 0x32 ; 50 1d44a: df 4f sbci r29, 0xFF ; 255 1d44c: 0f b6 in r0, 0x3f ; 63 1d44e: f8 94 cli 1d450: de bf out 0x3e, r29 ; 62 1d452: 0f be out 0x3f, r0 ; 63 1d454: cd bf out 0x3d, r28 ; 61 1d456: df 91 pop r29 1d458: cf 91 pop r28 1d45a: 1f 91 pop r17 1d45c: 0f 91 pop r16 1d45e: ff 90 pop r15 1d460: ef 90 pop r14 1d462: df 90 pop r13 1d464: cf 90 pop r12 1d466: bf 90 pop r11 1d468: af 90 pop r10 1d46a: 9f 90 pop r9 1d46c: 8f 90 pop r8 1d46e: 7f 90 pop r7 1d470: 6f 90 pop r6 1d472: 5f 90 pop r5 1d474: 4f 90 pop r4 1d476: 3f 90 pop r3 1d478: 2f 90 pop r2 1d47a: 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) { 1d47c: e1 e0 ldi r30, 0x01 ; 1 1d47e: e1 96 adiw r28, 0x31 ; 49 1d480: ef af std Y+63, r30 ; 0x3f 1d482: e1 97 sbiw r28, 0x31 ; 49 1d484: 76 cd rjmp .-1300 ; 0x1cf72 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) 1d486: fe 01 movw r30, r28 1d488: 31 96 adiw r30, 0x01 ; 1 1d48a: 7f 01 movw r14, r30 1d48c: 10 e0 ldi r17, 0x00 ; 0 1d48e: 00 e0 ldi r16, 0x00 ; 0 1d490: 24 e8 ldi r18, 0x84 ; 132 1d492: 33 e0 ldi r19, 0x03 ; 3 1d494: a6 01 movw r20, r12 1d496: 69 2d mov r22, r9 1d498: 78 2d mov r23, r8 1d49a: 8b 2d mov r24, r11 1d49c: 9a 2d mov r25, r10 1d49e: 0f 94 95 94 call 0x3292a ; 0x3292a ad += 0; if (!ret && (ad < 1440)) 1d4a2: 88 23 and r24, r24 1d4a4: 09 f4 brne .+2 ; 0x1d4a8 1d4a6: 6d ce rjmp .-806 ; 0x1d182 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; 1d4a8: 89 81 ldd r24, Y+1 ; 0x01 1d4aa: 9a 81 ldd r25, Y+2 ; 0x02 1d4ac: 8a ce rjmp .-748 ; 0x1d1c2 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)) 1d4ae: 89 81 ldd r24, Y+1 ; 0x01 1d4b0: 9a 81 ldd r25, Y+2 ; 0x02 1d4b2: 80 34 cpi r24, 0x40 ; 64 1d4b4: 9b 40 sbci r25, 0x0B ; 11 1d4b6: b8 f4 brcc .+46 ; 0x1d4e6 if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 1d4b8: ce 01 movw r24, r28 1d4ba: 01 96 adiw r24, 0x01 ; 1 1d4bc: 7c 01 movw r14, r24 1d4be: 04 eb ldi r16, 0xB4 ; 180 1d4c0: 10 e0 ldi r17, 0x00 ; 0 1d4c2: 2c e7 ldi r18, 0x7C ; 124 1d4c4: 3c ef ldi r19, 0xFC ; 252 1d4c6: a6 01 movw r20, r12 1d4c8: 4c 52 subi r20, 0x2C ; 44 1d4ca: 51 40 sbci r21, 0x01 ; 1 1d4cc: 69 2d mov r22, r9 1d4ce: 78 2d mov r23, r8 1d4d0: 8b 2d mov r24, r11 1d4d2: 9a 2d mov r25, r10 1d4d4: 0f 94 95 94 call 0x3292a ; 0x3292a 1d4d8: 88 23 and r24, r24 1d4da: 29 f0 breq .+10 ; 0x1d4e6 ad += 2160; 1d4dc: 89 81 ldd r24, Y+1 ; 0x01 1d4de: 9a 81 ldd r25, Y+2 ; 0x02 1d4e0: 80 59 subi r24, 0x90 ; 144 1d4e2: 97 4f sbci r25, 0xF7 ; 247 1d4e4: 6e ce rjmp .-804 ; 0x1d1c2 /// 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; 1d4e6: 90 e9 ldi r25, 0x90 ; 144 1d4e8: c9 1a sub r12, r25 1d4ea: 91 e0 ldi r25, 0x01 ; 1 1d4ec: d9 0a sbc r13, r25 1d4ee: 21 ce rjmp .-958 ; 0x1d132 } //@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]); 1d4f0: 00 91 69 07 lds r16, 0x0769 ; 0x800769 1d4f4: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 1d4f8: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 1d4fc: 30 91 6c 07 lds r19, 0x076C ; 0x80076c 1d500: 40 91 65 07 lds r20, 0x0765 ; 0x800765 1d504: 50 91 66 07 lds r21, 0x0766 ; 0x800766 1d508: 60 91 67 07 lds r22, 0x0767 ; 0x800767 1d50c: 70 91 68 07 lds r23, 0x0768 ; 0x800768 1d510: 80 91 61 07 lds r24, 0x0761 ; 0x800761 1d514: 90 91 62 07 lds r25, 0x0762 ; 0x800762 1d518: a0 91 63 07 lds r26, 0x0763 ; 0x800763 1d51c: b0 91 64 07 lds r27, 0x0764 ; 0x800764 1d520: 3f 93 push r19 1d522: 2f 93 push r18 1d524: 1f 93 push r17 1d526: 0f 93 push r16 1d528: 7f 93 push r23 1d52a: 6f 93 push r22 1d52c: 5f 93 push r21 1d52e: 4f 93 push r20 1d530: bf 93 push r27 1d532: af 93 push r26 1d534: 9f 93 push r25 1d536: 8f 93 push r24 1d538: 80 e1 ldi r24, 0x10 ; 16 1d53a: 92 e9 ldi r25, 0x92 ; 146 1d53c: 9f 93 push r25 1d53e: 8f 93 push r24 1d540: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1d544: 0f b6 in r0, 0x3f ; 63 1d546: f8 94 cli 1d548: de bf out 0x3e, r29 ; 62 1d54a: 0f be out 0x3f, r0 ; 63 1d54c: 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; 1d54e: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 1d550: 80 ef ldi r24, 0xF0 ; 240 1d552: 92 e9 ldi r25, 0x92 ; 146 1d554: 9f 93 push r25 1d556: 8f 93 push r24 1d558: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 lcd_set_cursor(4,3); 1d55c: 63 e0 ldi r22, 0x03 ; 3 1d55e: 84 e0 ldi r24, 0x04 ; 4 1d560: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_space(16); 1d564: 80 e1 ldi r24, 0x10 ; 16 1d566: 0e 94 1c 70 call 0xe038 ; 0xe038 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 1d56a: 0f 94 44 ba call 0x37488 ; 0x37488 : "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" ); 1d56e: 88 e1 ldi r24, 0x18 ; 24 1d570: 98 e2 ldi r25, 0x28 ; 40 1d572: 0f b6 in r0, 0x3f ; 63 1d574: f8 94 cli 1d576: a8 95 wdr 1d578: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d57c: 0f be out 0x3f, r0 ; 63 1d57e: 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); 1d582: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d586: 80 64 ori r24, 0x40 ; 64 1d588: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 1d58c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d590: 82 60 ori r24, 0x02 ; 2 1d592: 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){ 1d596: 0f 90 pop r0 1d598: 0f 90 pop r0 1d59a: 1d 3f cpi r17, 0xFD ; 253 1d59c: 09 f4 brne .+2 ; 0x1d5a0 1d59e: 64 c3 rjmp .+1736 ; 0x1dc68 1d5a0: 1f 3f cpi r17, 0xFF ; 255 1d5a2: 11 f4 brne .+4 ; 0x1d5a8 1d5a4: 0c 94 7f f7 jmp 0x1eefe ; 0x1eefe 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); 1d5a8: 20 e0 ldi r18, 0x00 ; 0 1d5aa: 30 e0 ldi r19, 0x00 ; 0 1d5ac: a9 01 movw r20, r18 1d5ae: a0 96 adiw r28, 0x20 ; 32 1d5b0: ee ad ldd r30, Y+62 ; 0x3e 1d5b2: ff ad ldd r31, Y+63 ; 0x3f 1d5b4: a0 97 sbiw r28, 0x20 ; 32 1d5b6: 61 81 ldd r22, Z+1 ; 0x01 1d5b8: 72 81 ldd r23, Z+2 ; 0x02 1d5ba: 83 81 ldd r24, Z+3 ; 0x03 1d5bc: 94 81 ldd r25, Z+4 ; 0x04 1d5be: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 1d5c2: 20 91 40 07 lds r18, 0x0740 ; 0x800740 1d5c6: 30 91 41 07 lds r19, 0x0741 ; 0x800741 1d5ca: 40 91 42 07 lds r20, 0x0742 ; 0x800742 1d5ce: 50 91 43 07 lds r21, 0x0743 ; 0x800743 1d5d2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1d5d6: a0 96 adiw r28, 0x20 ; 32 1d5d8: ae ad ldd r26, Y+62 ; 0x3e 1d5da: bf ad ldd r27, Y+63 ; 0x3f 1d5dc: a0 97 sbiw r28, 0x20 ; 32 1d5de: 11 96 adiw r26, 0x01 ; 1 1d5e0: 6d 93 st X+, r22 1d5e2: 7d 93 st X+, r23 1d5e4: 8d 93 st X+, r24 1d5e6: 9c 93 st X, r25 1d5e8: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d5ea: c0 90 44 07 lds r12, 0x0744 ; 0x800744 1d5ee: d0 90 45 07 lds r13, 0x0745 ; 0x800745 1d5f2: e0 90 46 07 lds r14, 0x0746 ; 0x800746 1d5f6: f0 90 47 07 lds r15, 0x0747 ; 0x800747 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); 1d5fa: 20 e0 ldi r18, 0x00 ; 0 1d5fc: 30 e0 ldi r19, 0x00 ; 0 1d5fe: a9 01 movw r20, r18 1d600: 15 96 adiw r26, 0x05 ; 5 1d602: 6d 91 ld r22, X+ 1d604: 7d 91 ld r23, X+ 1d606: 8d 91 ld r24, X+ 1d608: 9c 91 ld r25, X 1d60a: 18 97 sbiw r26, 0x08 ; 8 1d60c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d610: a7 01 movw r20, r14 1d612: 96 01 movw r18, r12 1d614: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1d618: a0 96 adiw r28, 0x20 ; 32 1d61a: ee ad ldd r30, Y+62 ; 0x3e 1d61c: ff ad ldd r31, Y+63 ; 0x3f 1d61e: a0 97 sbiw r28, 0x20 ; 32 1d620: 65 83 std Z+5, r22 ; 0x05 1d622: 76 83 std Z+6, r23 ; 0x06 1d624: 87 83 std Z+7, r24 ; 0x07 1d626: 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) 1d628: 20 e0 ldi r18, 0x00 ; 0 1d62a: 30 e0 ldi r19, 0x00 ; 0 1d62c: 40 e8 ldi r20, 0x80 ; 128 1d62e: 50 ec ldi r21, 0xC0 ; 192 1d630: c7 01 movw r24, r14 1d632: b6 01 movw r22, r12 1d634: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1d638: 87 ff sbrs r24, 7 1d63a: 0c c0 rjmp .+24 ; 0x1d654 current_position[Y_AXIS] = Y_MIN_POS; 1d63c: 80 e0 ldi r24, 0x00 ; 0 1d63e: 90 e0 ldi r25, 0x00 ; 0 1d640: a0 e8 ldi r26, 0x80 ; 128 1d642: b0 ec ldi r27, 0xC0 ; 192 1d644: 80 93 44 07 sts 0x0744, r24 ; 0x800744 1d648: 90 93 45 07 sts 0x0745, r25 ; 0x800745 1d64c: a0 93 46 07 sts 0x0746, r26 ; 0x800746 1d650: b0 93 47 07 sts 0x0747, r27 ; 0x800747 // 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; 1d654: 20 e0 ldi r18, 0x00 ; 0 1d656: 30 e0 ldi r19, 0x00 ; 0 1d658: 40 e4 ldi r20, 0x40 ; 64 1d65a: 50 e4 ldi r21, 0x40 ; 64 1d65c: 60 91 48 07 lds r22, 0x0748 ; 0x800748 1d660: 70 91 49 07 lds r23, 0x0749 ; 0x800749 1d664: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 1d668: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 1d66c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1d670: 60 93 48 07 sts 0x0748, r22 ; 0x800748 1d674: 70 93 49 07 sts 0x0749, r23 ; 0x800749 1d678: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 1d67c: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b 1d680: e0 96 adiw r28, 0x30 ; 48 1d682: 2e ad ldd r18, Y+62 ; 0x3e 1d684: 3f ad ldd r19, Y+63 ; 0x3f 1d686: e0 97 sbiw r28, 0x30 ; 48 1d688: 28 5f subi r18, 0xF8 ; 248 1d68a: 3f 4f sbci r19, 0xFF ; 255 1d68c: e0 96 adiw r28, 0x30 ; 48 1d68e: 3f af std Y+63, r19 ; 0x3f 1d690: 2e af std Y+62, r18 ; 0x3e 1d692: e0 97 sbiw r28, 0x30 ; 48 1d694: a0 96 adiw r28, 0x20 ; 32 1d696: 4e ad ldd r20, Y+62 ; 0x3e 1d698: 5f ad ldd r21, Y+63 ; 0x3f 1d69a: a0 97 sbiw r28, 0x20 ; 32 1d69c: 48 5f subi r20, 0xF8 ; 248 1d69e: 5f 4f sbci r21, 0xFF ; 255 1d6a0: a0 96 adiw r28, 0x20 ; 32 1d6a2: 5f af std Y+63, r21 ; 0x3f 1d6a4: 4e af std Y+62, r20 ; 0x3e 1d6a6: 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) { 1d6a8: 54 e0 ldi r21, 0x04 ; 4 1d6aa: 25 16 cp r2, r21 1d6ac: 31 04 cpc r3, r1 1d6ae: 09 f0 breq .+2 ; 0x1d6b2 1d6b0: 7d cc rjmp .-1798 ; 0x1cfac go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 1d6b2: a7 96 adiw r28, 0x27 ; 39 1d6b4: 6f ad ldd r22, Y+63 ; 0x3f 1d6b6: a7 97 sbiw r28, 0x27 ; 39 1d6b8: 66 23 and r22, r22 1d6ba: 31 f0 breq .+12 ; 0x1d6c8 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) { 1d6bc: e1 96 adiw r28, 0x31 ; 49 1d6be: 8f ad ldd r24, Y+63 ; 0x3f 1d6c0: e1 97 sbiw r28, 0x31 ; 49 1d6c2: 81 30 cpi r24, 0x01 ; 1 1d6c4: 09 f0 breq .+2 ; 0x1d6c8 1d6c6: da ce rjmp .-588 ; 0x1d47c #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 1d6c8: 88 e4 ldi r24, 0x48 ; 72 1d6ca: 9f e6 ldi r25, 0x6F ; 111 1d6cc: 9f 93 push r25 1d6ce: 8f 93 push r24 1d6d0: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 1d6d4: 90 e0 ldi r25, 0x00 ; 0 1d6d6: 80 e0 ldi r24, 0x00 ; 0 1d6d8: 0e 94 10 8f call 0x11e20 ; 0x11e20 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) { 1d6dc: 0f 90 pop r0 1d6de: 0f 90 pop r0 1d6e0: 20 e0 ldi r18, 0x00 ; 0 1d6e2: 30 e0 ldi r19, 0x00 ; 0 1d6e4: 40 e9 ldi r20, 0x90 ; 144 1d6e6: 50 ec ldi r21, 0xC0 ; 192 1d6e8: 60 91 a2 13 lds r22, 0x13A2 ; 0x8013a2 1d6ec: 70 91 a3 13 lds r23, 0x13A3 ; 0x8013a3 1d6f0: 80 91 a4 13 lds r24, 0x13A4 ; 0x8013a4 1d6f4: 90 91 a5 13 lds r25, 0x13A5 ; 0x8013a5 1d6f8: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1d6fc: 87 ff sbrs r24, 7 1d6fe: bb c2 rjmp .+1398 ; 0x1dc76 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 1d700: 8c e3 ldi r24, 0x3C ; 60 1d702: 93 e9 ldi r25, 0x93 ; 147 1d704: 0e 94 97 7b call 0xf72e ; 0xf72e SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 1d708: 8a e0 ldi r24, 0x0A ; 10 1d70a: 93 e9 ldi r25, 0x93 ; 147 1d70c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1d710: 60 91 a2 13 lds r22, 0x13A2 ; 0x8013a2 1d714: 70 91 a3 13 lds r23, 0x13A3 ; 0x8013a3 1d718: 80 91 a4 13 lds r24, 0x13A4 ; 0x8013a4 1d71c: 90 91 a5 13 lds r25, 0x13A5 ; 0x8013a5 1d720: 42 e0 ldi r20, 0x02 ; 2 1d722: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 1d726: 86 e0 ldi r24, 0x06 ; 6 1d728: 93 e9 ldi r25, 0x93 ; 147 1d72a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 1d72e: 60 e0 ldi r22, 0x00 ; 0 1d730: 70 e0 ldi r23, 0x00 ; 0 1d732: 80 e9 ldi r24, 0x90 ; 144 1d734: 90 ec ldi r25, 0xC0 ; 192 1d736: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 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 1d73a: 92 e0 ldi r25, 0x02 ; 2 1d73c: af 96 adiw r28, 0x2f ; 47 1d73e: 9f af std Y+63, r25 ; 0x3f 1d740: 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; 1d742: 10 92 ce 13 sts 0x13CE, r1 ; 0x8013ce 1d746: 10 92 cf 13 sts 0x13CF, r1 ; 0x8013cf 1d74a: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 1d74e: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 cntr[1] = 0.f; 1d752: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 1d756: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1d75a: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 1d75e: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 1d762: a4 e6 ldi r26, 0x64 ; 100 1d764: e6 96 adiw r28, 0x36 ; 54 1d766: af af std Y+63, r26 ; 0x3f 1d768: 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; 1d76a: a2 96 adiw r28, 0x22 ; 34 1d76c: 1c ae std Y+60, r1 ; 0x3c 1d76e: 1d ae std Y+61, r1 ; 0x3d 1d770: 1e ae std Y+62, r1 ; 0x3e 1d772: 1f ae std Y+63, r1 ; 0x3f 1d774: 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; 1d776: a6 96 adiw r28, 0x26 ; 38 1d778: 1c ae std Y+60, r1 ; 0x3c 1d77a: 1d ae std Y+61, r1 ; 0x3d 1d77c: 1e ae std Y+62, r1 ; 0x3e 1d77e: 1f ae std Y+63, r1 ; 0x3f 1d780: 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 }; 1d782: fe 01 movw r30, r28 1d784: 31 96 adiw r30, 0x01 ; 1 1d786: 68 96 adiw r28, 0x18 ; 24 1d788: ff af std Y+63, r31 ; 0x3f 1d78a: ee af std Y+62, r30 ; 0x3e 1d78c: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 1d78e: 9e 01 movw r18, r28 1d790: 2f 5b subi r18, 0xBF ; 191 1d792: 3f 4f sbci r19, 0xFF ; 255 1d794: 6a 96 adiw r28, 0x1a ; 26 1d796: 3f af std Y+63, r19 ; 0x3f 1d798: 2e af std Y+62, r18 ; 0x3e 1d79a: 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; 1d79c: a6 96 adiw r28, 0x26 ; 38 1d79e: 6c ad ldd r22, Y+60 ; 0x3c 1d7a0: 7d ad ldd r23, Y+61 ; 0x3d 1d7a2: 8e ad ldd r24, Y+62 ; 0x3e 1d7a4: 9f ad ldd r25, Y+63 ; 0x3f 1d7a6: a6 97 sbiw r28, 0x26 ; 38 1d7a8: 0f 94 31 df call 0x3be62 ; 0x3be62 1d7ac: 6e 96 adiw r28, 0x1e ; 30 1d7ae: 6c af std Y+60, r22 ; 0x3c 1d7b0: 7d af std Y+61, r23 ; 0x3d 1d7b2: 8e af std Y+62, r24 ; 0x3e 1d7b4: 9f af std Y+63, r25 ; 0x3f 1d7b6: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 1d7b8: a6 96 adiw r28, 0x26 ; 38 1d7ba: 6c ad ldd r22, Y+60 ; 0x3c 1d7bc: 7d ad ldd r23, Y+61 ; 0x3d 1d7be: 8e ad ldd r24, Y+62 ; 0x3e 1d7c0: 9f ad ldd r25, Y+63 ; 0x3f 1d7c2: a6 97 sbiw r28, 0x26 ; 38 1d7c4: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 1d7c8: cb 57 subi r28, 0x7B ; 123 1d7ca: df 4f sbci r29, 0xFF ; 255 1d7cc: 68 83 st Y, r22 1d7ce: 79 83 std Y+1, r23 ; 0x01 1d7d0: 8a 83 std Y+2, r24 ; 0x02 1d7d2: 9b 83 std Y+3, r25 ; 0x03 1d7d4: c5 58 subi r28, 0x85 ; 133 1d7d6: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 1d7d8: a2 96 adiw r28, 0x22 ; 34 1d7da: 6c ad ldd r22, Y+60 ; 0x3c 1d7dc: 7d ad ldd r23, Y+61 ; 0x3d 1d7de: 8e ad ldd r24, Y+62 ; 0x3e 1d7e0: 9f ad ldd r25, Y+63 ; 0x3f 1d7e2: a2 97 sbiw r28, 0x22 ; 34 1d7e4: 0f 94 31 df call 0x3be62 ; 0x3be62 1d7e8: c7 57 subi r28, 0x77 ; 119 1d7ea: df 4f sbci r29, 0xFF ; 255 1d7ec: 68 83 st Y, r22 1d7ee: 79 83 std Y+1, r23 ; 0x01 1d7f0: 8a 83 std Y+2, r24 ; 0x02 1d7f2: 9b 83 std Y+3, r25 ; 0x03 1d7f4: c9 58 subi r28, 0x89 ; 137 1d7f6: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 1d7f8: a2 96 adiw r28, 0x22 ; 34 1d7fa: 6c ad ldd r22, Y+60 ; 0x3c 1d7fc: 7d ad ldd r23, Y+61 ; 0x3d 1d7fe: 8e ad ldd r24, Y+62 ; 0x3e 1d800: 9f ad ldd r25, Y+63 ; 0x3f 1d802: a2 97 sbiw r28, 0x22 ; 34 1d804: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 1d808: cb 56 subi r28, 0x6B ; 107 1d80a: df 4f sbci r29, 0xFF ; 255 1d80c: 68 83 st Y, r22 1d80e: 79 83 std Y+1, r23 ; 0x01 1d810: 8a 83 std Y+2, r24 ; 0x02 1d812: 9b 83 std Y+3, r25 ; 0x03 1d814: c5 59 subi r28, 0x95 ; 149 1d816: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 1d818: 68 96 adiw r28, 0x18 ; 24 1d81a: ae ad ldd r26, Y+62 ; 0x3e 1d81c: bf ad ldd r27, Y+63 ; 0x3f 1d81e: 68 97 sbiw r28, 0x18 ; 24 1d820: e0 e4 ldi r30, 0x40 ; 64 1d822: 1d 92 st X+, r1 1d824: ea 95 dec r30 1d826: e9 f7 brne .-6 ; 0x1d822 float b[4] = { 0.f }; 1d828: 80 e1 ldi r24, 0x10 ; 16 1d82a: 6a 96 adiw r28, 0x1a ; 26 1d82c: ae ad ldd r26, Y+62 ; 0x3e 1d82e: bf ad ldd r27, Y+63 ; 0x3f 1d830: 6a 97 sbiw r28, 0x1a ; 26 1d832: 1d 92 st X+, r1 1d834: 8a 95 dec r24 1d836: e9 f7 brne .-6 ; 0x1d832 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 1d838: 90 e0 ldi r25, 0x00 ; 0 1d83a: 80 e0 ldi r24, 0x00 ; 0 1d83c: 0e 94 10 8f call 0x11e20 ; 0x11e20 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); 1d840: 20 91 ce 13 lds r18, 0x13CE ; 0x8013ce 1d844: 30 91 cf 13 lds r19, 0x13CF ; 0x8013cf 1d848: 40 91 d0 13 lds r20, 0x13D0 ; 0x8013d0 1d84c: 50 91 d1 13 lds r21, 0x13D1 ; 0x8013d1 1d850: c5 55 subi r28, 0x55 ; 85 1d852: df 4f sbci r29, 0xFF ; 255 1d854: 28 83 st Y, r18 1d856: 39 83 std Y+1, r19 ; 0x01 1d858: 4a 83 std Y+2, r20 ; 0x02 1d85a: 5b 83 std Y+3, r21 ; 0x03 1d85c: cb 5a subi r28, 0xAB ; 171 1d85e: 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); 1d860: 80 91 d2 13 lds r24, 0x13D2 ; 0x8013d2 1d864: 90 91 d3 13 lds r25, 0x13D3 ; 0x8013d3 1d868: a0 91 d4 13 lds r26, 0x13D4 ; 0x8013d4 1d86c: b0 91 d5 13 lds r27, 0x13D5 ; 0x8013d5 1d870: c1 55 subi r28, 0x51 ; 81 1d872: df 4f sbci r29, 0xFF ; 255 1d874: 88 83 st Y, r24 1d876: 99 83 std Y+1, r25 ; 0x01 1d878: aa 83 std Y+2, r26 ; 0x02 1d87a: bb 83 std Y+3, r27 ; 0x03 1d87c: cf 5a subi r28, 0xAF ; 175 1d87e: d0 40 sbci r29, 0x00 ; 0 1d880: de 01 movw r26, r28 1d882: af 5b subi r26, 0xBF ; 191 1d884: bf 4f sbci r27, 0xFF ; 255 1d886: c7 56 subi r28, 0x67 ; 103 1d888: df 4f sbci r29, 0xFF ; 255 1d88a: b9 83 std Y+1, r27 ; 0x01 1d88c: a8 83 st Y, r26 1d88e: c9 59 subi r28, 0x99 ; 153 1d890: d0 40 sbci r29, 0x00 ; 0 1d892: fe 01 movw r30, r28 1d894: 31 96 adiw r30, 0x01 ; 1 1d896: ac 96 adiw r28, 0x2c ; 44 1d898: ff af std Y+63, r31 ; 0x3f 1d89a: ee af std Y+62, r30 ; 0x3e 1d89c: 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) { 1d89e: 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])); 1d8a0: cb 56 subi r28, 0x6B ; 107 1d8a2: df 4f sbci r29, 0xFF ; 255 1d8a4: 28 81 ld r18, Y 1d8a6: 39 81 ldd r19, Y+1 ; 0x01 1d8a8: 4a 81 ldd r20, Y+2 ; 0x02 1d8aa: 5b 81 ldd r21, Y+3 ; 0x03 1d8ac: c5 59 subi r28, 0x95 ; 149 1d8ae: d0 40 sbci r29, 0x00 ; 0 1d8b0: 50 58 subi r21, 0x80 ; 128 1d8b2: ed 96 adiw r28, 0x3d ; 61 1d8b4: 2c af std Y+60, r18 ; 0x3c 1d8b6: 3d af std Y+61, r19 ; 0x3d 1d8b8: 4e af std Y+62, r20 ; 0x3e 1d8ba: 5f af std Y+63, r21 ; 0x3f 1d8bc: 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])); 1d8be: c7 57 subi r28, 0x77 ; 119 1d8c0: df 4f sbci r29, 0xFF ; 255 1d8c2: 88 81 ld r24, Y 1d8c4: 99 81 ldd r25, Y+1 ; 0x01 1d8c6: aa 81 ldd r26, Y+2 ; 0x02 1d8c8: bb 81 ldd r27, Y+3 ; 0x03 1d8ca: c9 58 subi r28, 0x89 ; 137 1d8cc: d0 40 sbci r29, 0x00 ; 0 1d8ce: b0 58 subi r27, 0x80 ; 128 1d8d0: c3 58 subi r28, 0x83 ; 131 1d8d2: df 4f sbci r29, 0xFF ; 255 1d8d4: 88 83 st Y, r24 1d8d6: 99 83 std Y+1, r25 ; 0x01 1d8d8: aa 83 std Y+2, r26 ; 0x02 1d8da: bb 83 std Y+3, r27 ; 0x03 1d8dc: cd 57 subi r28, 0x7D ; 125 1d8de: 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]) : 1d8e0: cb 57 subi r28, 0x7B ; 123 1d8e2: df 4f sbci r29, 0xFF ; 255 1d8e4: 28 81 ld r18, Y 1d8e6: 39 81 ldd r19, Y+1 ; 0x01 1d8e8: 4a 81 ldd r20, Y+2 ; 0x02 1d8ea: 5b 81 ldd r21, Y+3 ; 0x03 1d8ec: c5 58 subi r28, 0x85 ; 133 1d8ee: d0 40 sbci r29, 0x00 ; 0 1d8f0: 50 58 subi r21, 0x80 ; 128 1d8f2: cf 57 subi r28, 0x7F ; 127 1d8f4: df 4f sbci r29, 0xFF ; 255 1d8f6: 28 83 st Y, r18 1d8f8: 39 83 std Y+1, r19 ; 0x01 1d8fa: 4a 83 std Y+2, r20 ; 0x02 1d8fc: 5b 83 std Y+3, r21 ; 0x03 1d8fe: c1 58 subi r28, 0x81 ; 129 1d900: 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) { 1d902: ac 96 adiw r28, 0x2c ; 44 1d904: 2e ac ldd r2, Y+62 ; 0x3e 1d906: 3f ac ldd r3, Y+63 ; 0x3f 1d908: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 1d90a: 10 e0 ldi r17, 0x00 ; 0 1d90c: 6d e9 ldi r22, 0x9D ; 157 1d90e: 46 2e mov r4, r22 1d910: 63 e1 ldi r22, 0x13 ; 19 1d912: 56 2e mov r5, r22 1d914: 74 e0 ldi r23, 0x04 ; 4 1d916: 77 2e mov r7, r23 acc = 0; 1d918: c1 2c mov r12, r1 1d91a: d1 2c mov r13, r1 1d91c: 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) { 1d91e: 01 30 cpi r16, 0x01 ; 1 1d920: 11 f4 brne .+4 ; 0x1d926 1d922: 0c 94 37 f8 jmp 0x1f06e ; 0x1f06e 1d926: 11 30 cpi r17, 0x01 ; 1 1d928: 11 f4 brne .+4 ; 0x1d92e 1d92a: 0c 94 e5 f7 jmp 0x1efca ; 0x1efca float a = (r == 0) ? 1.f : 1d92e: 00 23 and r16, r16 1d930: 11 f4 brne .+4 ; 0x1d936 1d932: 0c 94 25 f8 jmp 0x1f04a ; 0x1f04a ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1d936: 02 30 cpi r16, 0x02 ; 2 1d938: 09 f0 breq .+2 ; 0x1d93c 1d93a: a1 c1 rjmp .+834 ; 0x1dc7e 1d93c: d2 01 movw r26, r4 1d93e: 11 96 adiw r26, 0x01 ; 1 1d940: 2d 91 ld r18, X+ 1d942: 3d 91 ld r19, X+ 1d944: 4d 91 ld r20, X+ 1d946: 5c 91 ld r21, X 1d948: 14 97 sbiw r26, 0x04 ; 4 1d94a: cf 57 subi r28, 0x7F ; 127 1d94c: df 4f sbci r29, 0xFF ; 255 1d94e: 68 81 ld r22, Y 1d950: 79 81 ldd r23, Y+1 ; 0x01 1d952: 8a 81 ldd r24, Y+2 ; 0x02 1d954: 9b 81 ldd r25, Y+3 ; 0x03 1d956: c1 58 subi r28, 0x81 ; 129 1d958: d0 40 sbci r29, 0x00 ; 0 1d95a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1d95e: 4b 01 movw r8, r22 1d960: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1d962: 11 11 cpse r17, r1 1d964: 9a c1 rjmp .+820 ; 0x1dc9a 1d966: 60 e0 ldi r22, 0x00 ; 0 1d968: 70 e0 ldi r23, 0x00 ; 0 1d96a: 80 e8 ldi r24, 0x80 ; 128 1d96c: 9f e3 ldi r25, 0x3F ; 63 1d96e: aa c1 rjmp .+852 ; 0x1dcc4 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 1d970: 2f 3f cpi r18, 0xFF ; 255 1d972: 09 f0 breq .+2 ; 0x1d976 1d974: f8 cc rjmp .-1552 ; 0x1d366 ++maxs; 1d976: 01 96 adiw r24, 0x01 ; 1 1d978: f6 cc rjmp .-1556 ; 0x1d366 1d97a: ae 01 movw r20, r28 1d97c: 4f 5f subi r20, 0xFF ; 255 1d97e: 5f 4f sbci r21, 0xFF ; 255 1d980: be 01 movw r22, r28 1d982: 6f 5b subi r22, 0xBF ; 191 1d984: 7f 4f sbci r23, 0xFF ; 255 1d986: 8b e8 ldi r24, 0x8B ; 139 1d988: 9b e0 ldi r25, 0x0B ; 11 1d98a: 0f 94 40 90 call 0x32080 ; 0x32080 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; 1d98e: 66 96 adiw r28, 0x16 ; 22 1d990: 6f ad ldd r22, Y+63 ; 0x3f 1d992: 66 97 sbiw r28, 0x16 ; 22 row = r08; 1d994: 62 96 adiw r28, 0x12 ; 18 1d996: 1f ad ldd r17, Y+63 ; 0x3f 1d998: 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){ 1d99a: 80 17 cp r24, r16 1d99c: 28 f0 brcs .+10 ; 0x1d9a8 col = c08; row = r08; return match08; } col = c10; 1d99e: 22 96 adiw r28, 0x02 ; 2 1d9a0: 6f ad ldd r22, Y+63 ; 0x3f 1d9a2: 22 97 sbiw r28, 0x02 ; 2 row = r10; 1d9a4: 19 81 ldd r17, Y+1 ; 0x01 1d9a6: 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){ 1d9a8: 08 35 cpi r16, 0x58 ; 88 1d9aa: 08 f4 brcc .+2 ; 0x1d9ae 1d9ac: 5b c1 rjmp .+694 ; 0x1dc64 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 1d9ae: 70 e0 ldi r23, 0x00 ; 0 1d9b0: 90 e0 ldi r25, 0x00 ; 0 1d9b2: 80 e0 ldi r24, 0x00 ; 0 1d9b4: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1d9b8: 20 e0 ldi r18, 0x00 ; 0 1d9ba: 30 e0 ldi r19, 0x00 ; 0 1d9bc: 40 eb ldi r20, 0xB0 ; 176 1d9be: 50 e4 ldi r21, 0x40 ; 64 1d9c0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1d9c4: 2b 01 movw r4, r22 1d9c6: 3c 01 movw r6, r24 1d9c8: 65 96 adiw r28, 0x15 ; 21 1d9ca: 4c ae std Y+60, r4 ; 0x3c 1d9cc: 5d ae std Y+61, r5 ; 0x3d 1d9ce: 6e ae std Y+62, r6 ; 0x3e 1d9d0: 7f ae std Y+63, r7 ; 0x3f 1d9d2: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 1d9d4: 61 2f mov r22, r17 1d9d6: 70 e0 ldi r23, 0x00 ; 0 1d9d8: 90 e0 ldi r25, 0x00 ; 0 1d9da: 80 e0 ldi r24, 0x00 ; 0 1d9dc: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1d9e0: 20 e0 ldi r18, 0x00 ; 0 1d9e2: 30 e0 ldi r19, 0x00 ; 0 1d9e4: 40 eb ldi r20, 0xB0 ; 176 1d9e6: 50 e4 ldi r21, 0x40 ; 64 1d9e8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1d9ec: 4b 01 movw r8, r22 1d9ee: 5c 01 movw r10, r24 1d9f0: 25 96 adiw r28, 0x05 ; 5 1d9f2: 8c ae std Y+60, r8 ; 0x3c 1d9f4: 9d ae std Y+61, r9 ; 0x3d 1d9f6: ae ae std Y+62, r10 ; 0x3e 1d9f8: bf ae std Y+63, r11 ; 0x3f 1d9fa: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 1d9fc: 20 e0 ldi r18, 0x00 ; 0 1d9fe: 30 e0 ldi r19, 0x00 ; 0 1da00: 40 e9 ldi r20, 0x90 ; 144 1da02: 50 e4 ldi r21, 0x40 ; 64 1da04: 29 83 std Y+1, r18 ; 0x01 1da06: 3a 83 std Y+2, r19 ; 0x02 1da08: 4b 83 std Y+3, r20 ; 0x03 1da0a: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 1da0c: ae 01 movw r20, r28 1da0e: 4f 5f subi r20, 0xFF ; 255 1da10: 5f 4f sbci r21, 0xFF ; 255 1da12: be 01 movw r22, r28 1da14: 6f 5b subi r22, 0xBF ; 191 1da16: 7f 4f sbci r23, 0xFF ; 255 1da18: ce 01 movw r24, r28 1da1a: 8f 5a subi r24, 0xAF ; 175 1da1c: 9f 4f sbci r25, 0xFF ; 255 1da1e: 0f 94 f5 8c call 0x319ea ; 0x319ea if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 1da22: a3 01 movw r20, r6 1da24: 92 01 movw r18, r4 1da26: 65 96 adiw r28, 0x15 ; 21 1da28: 6c ad ldd r22, Y+60 ; 0x3c 1da2a: 7d ad ldd r23, Y+61 ; 0x3d 1da2c: 8e ad ldd r24, Y+62 ; 0x3e 1da2e: 9f ad ldd r25, Y+63 ; 0x3f 1da30: 65 97 sbiw r28, 0x15 ; 21 1da32: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1da36: 6b 01 movw r12, r22 1da38: 7c 01 movw r14, r24 1da3a: 9f 77 andi r25, 0x7F ; 127 1da3c: 20 e0 ldi r18, 0x00 ; 0 1da3e: 30 e0 ldi r19, 0x00 ; 0 1da40: 40 e4 ldi r20, 0x40 ; 64 1da42: 50 e4 ldi r21, 0x40 ; 64 1da44: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1da48: 18 16 cp r1, r24 1da4a: 34 f1 brlt .+76 ; 0x1da98 1da4c: a5 01 movw r20, r10 1da4e: 94 01 movw r18, r8 1da50: 25 96 adiw r28, 0x05 ; 5 1da52: 6c ad ldd r22, Y+60 ; 0x3c 1da54: 7d ad ldd r23, Y+61 ; 0x3d 1da56: 8e ad ldd r24, Y+62 ; 0x3e 1da58: 9f ad ldd r25, Y+63 ; 0x3f 1da5a: 25 97 sbiw r28, 0x05 ; 5 1da5c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1da60: 9f 77 andi r25, 0x7F ; 127 1da62: 20 e0 ldi r18, 0x00 ; 0 1da64: 30 e0 ldi r19, 0x00 ; 0 1da66: 40 e4 ldi r20, 0x40 ; 64 1da68: 50 e4 ldi r21, 0x40 ; 64 1da6a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1da6e: 18 16 cp r1, r24 1da70: 9c f0 brlt .+38 ; 0x1da98 1da72: 20 e0 ldi r18, 0x00 ; 0 1da74: 30 e0 ldi r19, 0x00 ; 0 1da76: 40 ea ldi r20, 0xA0 ; 160 1da78: 50 e4 ldi r21, 0x40 ; 64 1da7a: 69 81 ldd r22, Y+1 ; 0x01 1da7c: 7a 81 ldd r23, Y+2 ; 0x02 1da7e: 8b 81 ldd r24, Y+3 ; 0x03 1da80: 9c 81 ldd r25, Y+4 ; 0x04 1da82: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1da86: 9f 77 andi r25, 0x7F ; 127 1da88: 20 e0 ldi r18, 0x00 ; 0 1da8a: 30 e0 ldi r19, 0x00 ; 0 1da8c: 40 e4 ldi r20, 0x40 ; 64 1da8e: 50 e4 ldi r21, 0x40 ; 64 1da90: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1da94: 18 16 cp r1, r24 1da96: bc f5 brge .+110 ; 0x1db06 //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 1da98: 20 e0 ldi r18, 0x00 ; 0 1da9a: 30 e0 ldi r19, 0x00 ; 0 1da9c: 40 ea ldi r20, 0xA0 ; 160 1da9e: 50 e4 ldi r21, 0x40 ; 64 1daa0: 69 81 ldd r22, Y+1 ; 0x01 1daa2: 7a 81 ldd r23, Y+2 ; 0x02 1daa4: 8b 81 ldd r24, Y+3 ; 0x03 1daa6: 9c 81 ldd r25, Y+4 ; 0x04 1daa8: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1daac: 9f 93 push r25 1daae: 8f 93 push r24 1dab0: 7f 93 push r23 1dab2: 6f 93 push r22 1dab4: a5 01 movw r20, r10 1dab6: 94 01 movw r18, r8 1dab8: 25 96 adiw r28, 0x05 ; 5 1daba: 6c ad ldd r22, Y+60 ; 0x3c 1dabc: 7d ad ldd r23, Y+61 ; 0x3d 1dabe: 8e ad ldd r24, Y+62 ; 0x3e 1dac0: 9f ad ldd r25, Y+63 ; 0x3f 1dac2: 25 97 sbiw r28, 0x05 ; 5 1dac4: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1dac8: 9f 93 push r25 1daca: 8f 93 push r24 1dacc: 7f 93 push r23 1dace: 6f 93 push r22 1dad0: ff 92 push r15 1dad2: ef 92 push r14 1dad4: df 92 push r13 1dad6: cf 92 push r12 1dad8: 84 ea ldi r24, 0xA4 ; 164 1dada: 92 e9 ldi r25, 0x92 ; 146 1dadc: 9f 93 push r25 1dade: 8f 93 push r24 1dae0: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 1dae4: 65 96 adiw r28, 0x15 ; 21 1dae6: 4c ae std Y+60, r4 ; 0x3c 1dae8: 5d ae std Y+61, r5 ; 0x3d 1daea: 6e ae std Y+62, r6 ; 0x3e 1daec: 7f ae std Y+63, r7 ; 0x3f 1daee: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 1daf0: 25 96 adiw r28, 0x05 ; 5 1daf2: 8c ae std Y+60, r8 ; 0x3c 1daf4: 9d ae std Y+61, r9 ; 0x3d 1daf6: ae ae std Y+62, r10 ; 0x3e 1daf8: bf ae std Y+63, r11 ; 0x3f 1dafa: 25 97 sbiw r28, 0x05 ; 5 1dafc: 0f b6 in r0, 0x3f ; 63 1dafe: f8 94 cli 1db00: de bf out 0x3e, r29 ; 62 1db02: 0f be out 0x3f, r0 ; 63 1db04: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 1db06: 20 e0 ldi r18, 0x00 ; 0 1db08: 30 e0 ldi r19, 0x00 ; 0 1db0a: 48 e7 ldi r20, 0x78 ; 120 1db0c: 51 e4 ldi r21, 0x41 ; 65 1db0e: 65 96 adiw r28, 0x15 ; 21 1db10: 6c ad ldd r22, Y+60 ; 0x3c 1db12: 7d ad ldd r23, Y+61 ; 0x3d 1db14: 8e ad ldd r24, Y+62 ; 0x3e 1db16: 9f ad ldd r25, Y+63 ; 0x3f 1db18: 65 97 sbiw r28, 0x15 ; 21 1db1a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1db1e: 20 e0 ldi r18, 0x00 ; 0 1db20: 30 e0 ldi r19, 0x00 ; 0 1db22: 40 e8 ldi r20, 0x80 ; 128 1db24: 52 e4 ldi r21, 0x42 ; 66 1db26: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1db2a: 6b 01 movw r12, r22 1db2c: 7c 01 movw r14, r24 1db2e: 6c 96 adiw r28, 0x1c ; 28 1db30: ae ad ldd r26, Y+62 ; 0x3e 1db32: bf ad ldd r27, Y+63 ; 0x3f 1db34: 6c 97 sbiw r28, 0x1c ; 28 1db36: bd 01 movw r22, r26 1db38: bb 0f add r27, r27 1db3a: 88 0b sbc r24, r24 1db3c: 99 0b sbc r25, r25 1db3e: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1db42: 9b 01 movw r18, r22 1db44: ac 01 movw r20, r24 1db46: c7 01 movw r24, r14 1db48: b6 01 movw r22, r12 1db4a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1db4e: 6b 01 movw r12, r22 1db50: 7c 01 movw r14, r24 1db52: 65 96 adiw r28, 0x15 ; 21 1db54: cc ae std Y+60, r12 ; 0x3c 1db56: dd ae std Y+61, r13 ; 0x3d 1db58: ee ae std Y+62, r14 ; 0x3e 1db5a: ff ae std Y+63, r15 ; 0x3f 1db5c: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 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: 25 96 adiw r28, 0x05 ; 5 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: 25 97 sbiw r28, 0x05 ; 5 1db72: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__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 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1db82: 4b 01 movw r8, r22 1db84: 5c 01 movw r10, r24 1db86: ac 96 adiw r28, 0x2c ; 44 1db88: ee ad ldd r30, Y+62 ; 0x3e 1db8a: ff ad ldd r31, Y+63 ; 0x3f 1db8c: ac 97 sbiw r28, 0x2c ; 44 1db8e: bf 01 movw r22, r30 1db90: ff 0f add r31, r31 1db92: 88 0b sbc r24, r24 1db94: 99 0b sbc r25, r25 1db96: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 1db9a: 9b 01 movw r18, r22 1db9c: ac 01 movw r20, r24 1db9e: c5 01 movw r24, r10 1dba0: b4 01 movw r22, r8 1dba2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1dba6: 25 96 adiw r28, 0x05 ; 5 1dba8: 6c af std Y+60, r22 ; 0x3c 1dbaa: 7d af std Y+61, r23 ; 0x3d 1dbac: 8e af std Y+62, r24 ; 0x3e 1dbae: 9f af std Y+63, r25 ; 0x3f 1dbb0: 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; 1dbb2: 2a e0 ldi r18, 0x0A ; 10 1dbb4: 37 ed ldi r19, 0xD7 ; 215 1dbb6: 43 e2 ldi r20, 0x23 ; 35 1dbb8: 5c e3 ldi r21, 0x3C ; 60 1dbba: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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)); 1dbbe: 9f 93 push r25 1dbc0: 8f 93 push r24 1dbc2: 7f 93 push r23 1dbc4: 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; 1dbc6: 2a e0 ldi r18, 0x0A ; 10 1dbc8: 37 ed ldi r19, 0xD7 ; 215 1dbca: 43 e2 ldi r20, 0x23 ; 35 1dbcc: 5c e3 ldi r21, 0x3C ; 60 1dbce: c7 01 movw r24, r14 1dbd0: b6 01 movw r22, r12 1dbd2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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)); 1dbd6: 9f 93 push r25 1dbd8: 8f 93 push r24 1dbda: 7f 93 push r23 1dbdc: 6f 93 push r22 1dbde: 88 e8 ldi r24, 0x88 ; 136 1dbe0: 92 e9 ldi r25, 0x92 ; 146 1dbe2: 9f 93 push r25 1dbe4: 8f 93 push r24 1dbe6: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 1dbea: 20 e0 ldi r18, 0x00 ; 0 1dbec: 30 e0 ldi r19, 0x00 ; 0 1dbee: 40 e0 ldi r20, 0x00 ; 0 1dbf0: 5f e3 ldi r21, 0x3F ; 63 1dbf2: 25 96 adiw r28, 0x05 ; 5 1dbf4: 6c ad ldd r22, Y+60 ; 0x3c 1dbf6: 7d ad ldd r23, Y+61 ; 0x3d 1dbf8: 8e ad ldd r24, Y+62 ; 0x3e 1dbfa: 9f ad ldd r25, Y+63 ; 0x3f 1dbfc: 25 97 sbiw r28, 0x05 ; 5 1dbfe: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1dc02: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 1dc06: 6b 01 movw r12, r22 1dc08: 20 e0 ldi r18, 0x00 ; 0 1dc0a: 30 e0 ldi r19, 0x00 ; 0 1dc0c: 40 e0 ldi r20, 0x00 ; 0 1dc0e: 5f e3 ldi r21, 0x3F ; 63 1dc10: 65 96 adiw r28, 0x15 ; 21 1dc12: 6c ad ldd r22, Y+60 ; 0x3c 1dc14: 7d ad ldd r23, Y+61 ; 0x3d 1dc16: 8e ad ldd r24, Y+62 ; 0x3e 1dc18: 9f ad ldd r25, Y+63 ; 0x3f 1dc1a: 65 97 sbiw r28, 0x15 ; 21 1dc1c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1dc20: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 1dc24: 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); 1dc26: 00 e0 ldi r16, 0x00 ; 0 1dc28: 28 ec ldi r18, 0xC8 ; 200 1dc2a: 30 e0 ldi r19, 0x00 ; 0 1dc2c: e7 96 adiw r28, 0x37 ; 55 1dc2e: 4e ad ldd r20, Y+62 ; 0x3e 1dc30: 5f ad ldd r21, Y+63 ; 0x3f 1dc32: e7 97 sbiw r28, 0x37 ; 55 1dc34: b6 01 movw r22, r12 1dc36: 0e 94 27 e1 call 0x1c24e ; 0x1c24e 1dc3a: 0f b6 in r0, 0x3f ; 63 1dc3c: f8 94 cli 1dc3e: de bf out 0x3e, r29 ; 62 1dc40: 0f be out 0x3f, r0 ; 63 1dc42: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 1dc44: 10 e0 ldi r17, 0x00 ; 0 1dc46: 83 e5 ldi r24, 0x53 ; 83 1dc48: 9e e0 ldi r25, 0x0E ; 14 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 1dc4a: a4 96 adiw r28, 0x24 ; 36 1dc4c: ae ad ldd r26, Y+62 ; 0x3e 1dc4e: bf ad ldd r27, Y+63 ; 0x3f 1dc50: a4 97 sbiw r28, 0x24 ; 36 1dc52: 1d 92 st X+, r1 1dc54: a4 96 adiw r28, 0x24 ; 36 1dc56: bf af std Y+63, r27 ; 0x3f 1dc58: ae af std Y+62, r26 ; 0x3e 1dc5a: 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++) 1dc5c: 8a 17 cp r24, r26 1dc5e: 9b 07 cpc r25, r27 1dc60: a1 f7 brne .-24 ; 0x1dc4a 1dc62: 76 cc rjmp .-1812 ; 0x1d550 /// 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; 1dc64: 1f ef ldi r17, 0xFF ; 255 1dc66: ef cf rjmp .-34 ; 0x1dc46 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; 1dc68: e5 96 adiw r28, 0x35 ; 53 1dc6a: bf ad ldd r27, Y+63 ; 0x3f 1dc6c: e5 97 sbiw r28, 0x35 ; 53 1dc6e: a7 96 adiw r28, 0x27 ; 39 1dc70: bf af std Y+63, r27 ; 0x3f 1dc72: a7 97 sbiw r28, 0x27 ; 39 1dc74: 99 cc rjmp .-1742 ; 0x1d5a8 // 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; 1dc76: af 96 adiw r28, 0x2f ; 47 1dc78: 1f ae std Y+63, r1 ; 0x3f 1dc7a: af 97 sbiw r28, 0x2f ; 47 1dc7c: 62 cd rjmp .-1340 ; 0x1d742 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]) : 1dc7e: f2 01 movw r30, r4 1dc80: 25 81 ldd r18, Z+5 ; 0x05 1dc82: 36 81 ldd r19, Z+6 ; 0x06 1dc84: 47 81 ldd r20, Z+7 ; 0x07 1dc86: 50 85 ldd r21, Z+8 ; 0x08 1dc88: c3 58 subi r28, 0x83 ; 131 1dc8a: df 4f sbci r29, 0xFF ; 255 1dc8c: 68 81 ld r22, Y 1dc8e: 79 81 ldd r23, Y+1 ; 0x01 1dc90: 8a 81 ldd r24, Y+2 ; 0x02 1dc92: 9b 81 ldd r25, Y+3 ; 0x03 1dc94: cd 57 subi r28, 0x7D ; 125 1dc96: d0 40 sbci r29, 0x00 ; 0 1dc98: 60 ce rjmp .-832 ; 0x1d95a (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 1dc9a: 12 30 cpi r17, 0x02 ; 2 1dc9c: 11 f0 breq .+4 ; 0x1dca2 1dc9e: 0c 94 26 f7 jmp 0x1ee4c ; 0x1ee4c 1dca2: d2 01 movw r26, r4 1dca4: 11 96 adiw r26, 0x01 ; 1 1dca6: 2d 91 ld r18, X+ 1dca8: 3d 91 ld r19, X+ 1dcaa: 4d 91 ld r20, X+ 1dcac: 5c 91 ld r21, X 1dcae: 14 97 sbiw r26, 0x04 ; 4 1dcb0: cf 57 subi r28, 0x7F ; 127 1dcb2: df 4f sbci r29, 0xFF ; 255 1dcb4: 68 81 ld r22, Y 1dcb6: 79 81 ldd r23, Y+1 ; 0x01 1dcb8: 8a 81 ldd r24, Y+2 ; 0x02 1dcba: 9b 81 ldd r25, Y+3 ; 0x03 1dcbc: c1 58 subi r28, 0x81 ; 129 1dcbe: d0 40 sbci r29, 0x00 ; 0 1dcc0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 1dcc4: 9b 01 movw r18, r22 1dcc6: ac 01 movw r20, r24 1dcc8: c5 01 movw r24, r10 1dcca: b4 01 movw r22, r8 1dccc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1dcd0: 9b 01 movw r18, r22 1dcd2: ac 01 movw r20, r24 1dcd4: c7 01 movw r24, r14 1dcd6: b6 01 movw r22, r12 1dcd8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1dcdc: 6b 01 movw r12, r22 1dcde: 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) { 1dce0: 01 11 cpse r16, r1 1dce2: 0c 94 33 f8 jmp 0x1f066 ; 0x1f066 1dce6: 7a 94 dec r7 1dce8: f8 e0 ldi r31, 0x08 ; 8 1dcea: 4f 0e add r4, r31 1dcec: 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) { 1dcee: 71 10 cpse r7, r1 1dcf0: 16 ce rjmp .-980 ; 0x1d91e (-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; 1dcf2: d1 01 movw r26, r2 1dcf4: cd 92 st X+, r12 1dcf6: dd 92 st X+, r13 1dcf8: ed 92 st X+, r14 1dcfa: fd 92 st X+, r15 1dcfc: 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) { 1dcfe: 1f 5f subi r17, 0xFF ; 255 1dd00: 14 30 cpi r17, 0x04 ; 4 1dd02: 09 f0 breq .+2 ; 0x1dd06 1dd04: 03 ce rjmp .-1018 ; 0x1d90c 1dd06: 3d e3 ldi r19, 0x3D ; 61 1dd08: 23 2e mov r2, r19 1dd0a: 33 e9 ldi r19, 0x93 ; 147 1dd0c: 33 2e mov r3, r19 1dd0e: ed e9 ldi r30, 0x9D ; 157 1dd10: f3 e1 ldi r31, 0x13 ; 19 1dd12: a8 96 adiw r28, 0x28 ; 40 1dd14: ff af std Y+63, r31 ; 0x3f 1dd16: ee af std Y+62, r30 ; 0x3e 1dd18: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 1dd1a: c3 57 subi r28, 0x73 ; 115 1dd1c: df 4f sbci r29, 0xFF ; 255 1dd1e: 18 82 st Y, r1 1dd20: cd 58 subi r28, 0x8D ; 141 1dd22: d0 40 sbci r29, 0x00 ; 0 1dd24: c3 56 subi r28, 0x63 ; 99 1dd26: df 4f sbci r29, 0xFF ; 255 1dd28: 18 82 st Y, r1 1dd2a: cd 59 subi r28, 0x9D ; 157 1dd2c: d0 40 sbci r29, 0x00 ; 0 1dd2e: cf 55 subi r28, 0x5F ; 95 1dd30: df 4f sbci r29, 0xFF ; 255 1dd32: 18 82 st Y, r1 1dd34: c1 5a subi r28, 0xA1 ; 161 1dd36: d0 40 sbci r29, 0x00 ; 0 1dd38: 10 e0 ldi r17, 0x00 ; 0 1dd3a: a8 96 adiw r28, 0x28 ; 40 1dd3c: ae ad ldd r26, Y+62 ; 0x3e 1dd3e: bf ad ldd r27, Y+63 ; 0x3f 1dd40: a8 97 sbiw r28, 0x28 ; 40 1dd42: 11 96 adiw r26, 0x01 ; 1 1dd44: 2d 91 ld r18, X+ 1dd46: 3d 91 ld r19, X+ 1dd48: 4d 91 ld r20, X+ 1dd4a: 5c 91 ld r21, X 1dd4c: 14 97 sbiw r26, 0x04 ; 4 1dd4e: e4 96 adiw r28, 0x34 ; 52 1dd50: 2c af std Y+60, r18 ; 0x3c 1dd52: 3d af std Y+61, r19 ; 0x3d 1dd54: 4e af std Y+62, r20 ; 0x3e 1dd56: 5f af std Y+63, r21 ; 0x3f 1dd58: e4 97 sbiw r28, 0x34 ; 52 1dd5a: 15 96 adiw r26, 0x05 ; 5 1dd5c: 4d 90 ld r4, X+ 1dd5e: 5d 90 ld r5, X+ 1dd60: 6d 90 ld r6, X+ 1dd62: 7c 90 ld r7, X 1dd64: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1dd66: 00 23 and r16, r16 1dd68: 11 f4 brne .+4 ; 0x1dd6e 1dd6a: 0c 94 59 f7 jmp 0x1eeb2 ; 0x1eeb2 ((r == 1) ? 0.f : 1dd6e: 81 2c mov r8, r1 1dd70: 91 2c mov r9, r1 1dd72: 54 01 movw r10, r8 1dd74: 01 30 cpi r16, 0x01 ; 1 1dd76: 81 f0 breq .+32 ; 0x1dd98 ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1dd78: 02 30 cpi r16, 0x02 ; 2 1dd7a: 11 f0 breq .+4 ; 0x1dd80 1dd7c: 0c 94 4d f7 jmp 0x1ee9a ; 0x1ee9a 1dd80: cf 57 subi r28, 0x7F ; 127 1dd82: df 4f sbci r29, 0xFF ; 255 1dd84: 68 81 ld r22, Y 1dd86: 79 81 ldd r23, Y+1 ; 0x01 1dd88: 8a 81 ldd r24, Y+2 ; 0x02 1dd8a: 9b 81 ldd r25, Y+3 ; 0x03 1dd8c: c1 58 subi r28, 0x81 ; 129 1dd8e: d0 40 sbci r29, 0x00 ; 0 1dd90: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1dd94: 4b 01 movw r8, r22 1dd96: 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); 1dd98: e4 96 adiw r28, 0x34 ; 52 1dd9a: 2c ad ldd r18, Y+60 ; 0x3c 1dd9c: 3d ad ldd r19, Y+61 ; 0x3d 1dd9e: 4e ad ldd r20, Y+62 ; 0x3e 1dda0: 5f ad ldd r21, Y+63 ; 0x3f 1dda2: e4 97 sbiw r28, 0x34 ; 52 1dda4: 6e 96 adiw r28, 0x1e ; 30 1dda6: 6c ad ldd r22, Y+60 ; 0x3c 1dda8: 7d ad ldd r23, Y+61 ; 0x3d 1ddaa: 8e ad ldd r24, Y+62 ; 0x3e 1ddac: 9f ad ldd r25, Y+63 ; 0x3f 1ddae: 6e 97 sbiw r28, 0x1e ; 30 1ddb0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ddb4: 6b 01 movw r12, r22 1ddb6: 7c 01 movw r14, r24 1ddb8: f1 01 movw r30, r2 1ddba: 25 91 lpm r18, Z+ 1ddbc: 35 91 lpm r19, Z+ 1ddbe: 45 91 lpm r20, Z+ 1ddc0: 54 91 lpm r21, Z 1ddc2: cb 55 subi r28, 0x5B ; 91 1ddc4: df 4f sbci r29, 0xFF ; 255 1ddc6: 28 83 st Y, r18 1ddc8: 39 83 std Y+1, r19 ; 0x01 1ddca: 4a 83 std Y+2, r20 ; 0x02 1ddcc: 5b 83 std Y+3, r21 ; 0x03 1ddce: c5 5a subi r28, 0xA5 ; 165 1ddd0: d0 40 sbci r29, 0x00 ; 0 1ddd2: a3 01 movw r20, r6 1ddd4: 92 01 movw r18, r4 1ddd6: cb 56 subi r28, 0x6B ; 107 1ddd8: df 4f sbci r29, 0xFF ; 255 1ddda: 68 81 ld r22, Y 1dddc: 79 81 ldd r23, Y+1 ; 0x01 1ddde: 8a 81 ldd r24, Y+2 ; 0x02 1dde0: 9b 81 ldd r25, Y+3 ; 0x03 1dde2: c5 59 subi r28, 0x95 ; 149 1dde4: d0 40 sbci r29, 0x00 ; 0 1dde6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ddea: 9b 01 movw r18, r22 1ddec: ac 01 movw r20, r24 1ddee: c7 01 movw r24, r14 1ddf0: b6 01 movw r22, r12 1ddf2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1ddf6: c5 55 subi r28, 0x55 ; 85 1ddf8: df 4f sbci r29, 0xFF ; 255 1ddfa: 28 81 ld r18, Y 1ddfc: 39 81 ldd r19, Y+1 ; 0x01 1ddfe: 4a 81 ldd r20, Y+2 ; 0x02 1de00: 5b 81 ldd r21, Y+3 ; 0x03 1de02: cb 5a subi r28, 0xAB ; 171 1de04: d0 40 sbci r29, 0x00 ; 0 1de06: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1de0a: cb 55 subi r28, 0x5B ; 91 1de0c: df 4f sbci r29, 0xFF ; 255 1de0e: 28 81 ld r18, Y 1de10: 39 81 ldd r19, Y+1 ; 0x01 1de12: 4a 81 ldd r20, Y+2 ; 0x02 1de14: 5b 81 ldd r21, Y+3 ; 0x03 1de16: c5 5a subi r28, 0xA5 ; 165 1de18: d0 40 sbci r29, 0x00 ; 0 1de1a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 1de1e: a5 01 movw r20, r10 1de20: 94 01 movw r18, r8 1de22: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1de26: c3 57 subi r28, 0x73 ; 115 1de28: df 4f sbci r29, 0xFF ; 255 1de2a: 28 81 ld r18, Y 1de2c: cd 58 subi r28, 0x8D ; 141 1de2e: d0 40 sbci r29, 0x00 ; 0 1de30: c3 56 subi r28, 0x63 ; 99 1de32: df 4f sbci r29, 0xFF ; 255 1de34: 38 81 ld r19, Y 1de36: cd 59 subi r28, 0x9D ; 157 1de38: d0 40 sbci r29, 0x00 ; 0 1de3a: cf 55 subi r28, 0x5F ; 95 1de3c: df 4f sbci r29, 0xFF ; 255 1de3e: 48 81 ld r20, Y 1de40: c1 5a subi r28, 0xA1 ; 161 1de42: d0 40 sbci r29, 0x00 ; 0 1de44: 51 2f mov r21, r17 1de46: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1de4a: c3 57 subi r28, 0x73 ; 115 1de4c: df 4f sbci r29, 0xFF ; 255 1de4e: 68 83 st Y, r22 1de50: 79 83 std Y+1, r23 ; 0x01 1de52: 8a 83 std Y+2, r24 ; 0x02 1de54: 9b 83 std Y+3, r25 ; 0x03 1de56: cd 58 subi r28, 0x8D ; 141 1de58: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 1de5a: 00 23 and r16, r16 1de5c: 11 f4 brne .+4 ; 0x1de62 1de5e: 0c 94 61 f7 jmp 0x1eec2 ; 0x1eec2 ((r == 1) ? 1.f : 1de62: 01 30 cpi r16, 0x01 ; 1 1de64: 11 f4 brne .+4 ; 0x1de6a 1de66: 0c 94 66 f7 jmp 0x1eecc ; 0x1eecc ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1de6a: 02 30 cpi r16, 0x02 ; 2 1de6c: 61 f0 breq .+24 ; 0x1de86 1de6e: a3 01 movw r20, r6 1de70: 92 01 movw r18, r4 1de72: ed 96 adiw r28, 0x3d ; 61 1de74: 6c ad ldd r22, Y+60 ; 0x3c 1de76: 7d ad ldd r23, Y+61 ; 0x3d 1de78: 8e ad ldd r24, Y+62 ; 0x3e 1de7a: 9f ad ldd r25, Y+63 ; 0x3f 1de7c: ed 97 sbiw r28, 0x3d ; 61 1de7e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1de82: 6b 01 movw r12, r22 1de84: 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); 1de86: f1 01 movw r30, r2 1de88: 34 96 adiw r30, 0x04 ; 4 1de8a: 85 90 lpm r8, Z+ 1de8c: 95 90 lpm r9, Z+ 1de8e: a5 90 lpm r10, Z+ 1de90: b4 90 lpm r11, Z 1de92: e4 96 adiw r28, 0x34 ; 52 1de94: 2c ad ldd r18, Y+60 ; 0x3c 1de96: 3d ad ldd r19, Y+61 ; 0x3d 1de98: 4e ad ldd r20, Y+62 ; 0x3e 1de9a: 5f ad ldd r21, Y+63 ; 0x3f 1de9c: e4 97 sbiw r28, 0x34 ; 52 1de9e: cb 57 subi r28, 0x7B ; 123 1dea0: df 4f sbci r29, 0xFF ; 255 1dea2: 68 81 ld r22, Y 1dea4: 79 81 ldd r23, Y+1 ; 0x01 1dea6: 8a 81 ldd r24, Y+2 ; 0x02 1dea8: 9b 81 ldd r25, Y+3 ; 0x03 1deaa: c5 58 subi r28, 0x85 ; 133 1deac: d0 40 sbci r29, 0x00 ; 0 1deae: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1deb2: e4 96 adiw r28, 0x34 ; 52 1deb4: 6c af std Y+60, r22 ; 0x3c 1deb6: 7d af std Y+61, r23 ; 0x3d 1deb8: 8e af std Y+62, r24 ; 0x3e 1deba: 9f af std Y+63, r25 ; 0x3f 1debc: e4 97 sbiw r28, 0x34 ; 52 1debe: a3 01 movw r20, r6 1dec0: 92 01 movw r18, r4 1dec2: c7 57 subi r28, 0x77 ; 119 1dec4: df 4f sbci r29, 0xFF ; 255 1dec6: 68 81 ld r22, Y 1dec8: 79 81 ldd r23, Y+1 ; 0x01 1deca: 8a 81 ldd r24, Y+2 ; 0x02 1decc: 9b 81 ldd r25, Y+3 ; 0x03 1dece: c9 58 subi r28, 0x89 ; 137 1ded0: d0 40 sbci r29, 0x00 ; 0 1ded2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ded6: 9b 01 movw r18, r22 1ded8: ac 01 movw r20, r24 1deda: e4 96 adiw r28, 0x34 ; 52 1dedc: 6c ad ldd r22, Y+60 ; 0x3c 1dede: 7d ad ldd r23, Y+61 ; 0x3d 1dee0: 8e ad ldd r24, Y+62 ; 0x3e 1dee2: 9f ad ldd r25, Y+63 ; 0x3f 1dee4: e4 97 sbiw r28, 0x34 ; 52 1dee6: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1deea: c1 55 subi r28, 0x51 ; 81 1deec: df 4f sbci r29, 0xFF ; 255 1deee: 28 81 ld r18, Y 1def0: 39 81 ldd r19, Y+1 ; 0x01 1def2: 4a 81 ldd r20, Y+2 ; 0x02 1def4: 5b 81 ldd r21, Y+3 ; 0x03 1def6: cf 5a subi r28, 0xAF ; 175 1def8: d0 40 sbci r29, 0x00 ; 0 1defa: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1defe: a5 01 movw r20, r10 1df00: 94 01 movw r18, r8 1df02: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 1df06: a7 01 movw r20, r14 1df08: 96 01 movw r18, r12 1df0a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1df0e: c3 57 subi r28, 0x73 ; 115 1df10: df 4f sbci r29, 0xFF ; 255 1df12: 28 81 ld r18, Y 1df14: 39 81 ldd r19, Y+1 ; 0x01 1df16: 4a 81 ldd r20, Y+2 ; 0x02 1df18: 5b 81 ldd r21, Y+3 ; 0x03 1df1a: cd 58 subi r28, 0x8D ; 141 1df1c: d0 40 sbci r29, 0x00 ; 0 1df1e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1df22: c3 57 subi r28, 0x73 ; 115 1df24: df 4f sbci r29, 0xFF ; 255 1df26: 68 83 st Y, r22 1df28: cd 58 subi r28, 0x8D ; 141 1df2a: d0 40 sbci r29, 0x00 ; 0 1df2c: c3 56 subi r28, 0x63 ; 99 1df2e: df 4f sbci r29, 0xFF ; 255 1df30: 78 83 st Y, r23 1df32: cd 59 subi r28, 0x9D ; 157 1df34: d0 40 sbci r29, 0x00 ; 0 1df36: cf 55 subi r28, 0x5F ; 95 1df38: df 4f sbci r29, 0xFF ; 255 1df3a: 88 83 st Y, r24 1df3c: c1 5a subi r28, 0xA1 ; 161 1df3e: d0 40 sbci r29, 0x00 ; 0 1df40: 19 2f mov r17, r25 1df42: a8 96 adiw r28, 0x28 ; 40 1df44: 4e ad ldd r20, Y+62 ; 0x3e 1df46: 5f ad ldd r21, Y+63 ; 0x3f 1df48: a8 97 sbiw r28, 0x28 ; 40 1df4a: 48 5f subi r20, 0xF8 ; 248 1df4c: 5f 4f sbci r21, 0xFF ; 255 1df4e: a8 96 adiw r28, 0x28 ; 40 1df50: 5f af std Y+63, r21 ; 0x3f 1df52: 4e af std Y+62, r20 ; 0x3e 1df54: a8 97 sbiw r28, 0x28 ; 40 1df56: 58 e0 ldi r21, 0x08 ; 8 1df58: 25 0e add r2, r21 1df5a: 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) { 1df5c: ad eb ldi r26, 0xBD ; 189 1df5e: b3 e1 ldi r27, 0x13 ; 19 1df60: a8 96 adiw r28, 0x28 ; 40 1df62: ee ad ldd r30, Y+62 ; 0x3e 1df64: ff ad ldd r31, Y+63 ; 0x3f 1df66: a8 97 sbiw r28, 0x28 ; 40 1df68: ae 17 cp r26, r30 1df6a: bf 07 cpc r27, r31 1df6c: 09 f0 breq .+2 ; 0x1df70 1df6e: e5 ce rjmp .-566 ; 0x1dd3a 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; 1df70: 90 58 subi r25, 0x80 ; 128 1df72: c7 56 subi r28, 0x67 ; 103 1df74: df 4f sbci r29, 0xFF ; 255 1df76: a8 81 ld r26, Y 1df78: b9 81 ldd r27, Y+1 ; 0x01 1df7a: c9 59 subi r28, 0x99 ; 153 1df7c: d0 40 sbci r29, 0x00 ; 0 1df7e: 6d 93 st X+, r22 1df80: 7d 93 st X+, r23 1df82: 8d 93 st X+, r24 1df84: 9d 93 st X+, r25 1df86: c7 56 subi r28, 0x67 ; 103 1df88: df 4f sbci r29, 0xFF ; 255 1df8a: b9 83 std Y+1, r27 ; 0x01 1df8c: a8 83 st Y, r26 1df8e: c9 59 subi r28, 0x99 ; 153 1df90: 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) { 1df92: 0f 5f subi r16, 0xFF ; 255 1df94: ac 96 adiw r28, 0x2c ; 44 1df96: ee ad ldd r30, Y+62 ; 0x3e 1df98: ff ad ldd r31, Y+63 ; 0x3f 1df9a: ac 97 sbiw r28, 0x2c ; 44 1df9c: 70 96 adiw r30, 0x10 ; 16 1df9e: ac 96 adiw r28, 0x2c ; 44 1dfa0: ff af std Y+63, r31 ; 0x3f 1dfa2: ee af std Y+62, r30 ; 0x3e 1dfa4: ac 97 sbiw r28, 0x2c ; 44 1dfa6: 04 30 cpi r16, 0x04 ; 4 1dfa8: 09 f0 breq .+2 ; 0x1dfac 1dfaa: ab cc rjmp .-1706 ; 0x1d902 } // 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]; 1dfac: 25 96 adiw r28, 0x05 ; 5 1dfae: 2c ad ldd r18, Y+60 ; 0x3c 1dfb0: 3d ad ldd r19, Y+61 ; 0x3d 1dfb2: 4e ad ldd r20, Y+62 ; 0x3e 1dfb4: 5f ad ldd r21, Y+63 ; 0x3f 1dfb6: 25 97 sbiw r28, 0x05 ; 5 1dfb8: ae 96 adiw r28, 0x2e ; 46 1dfba: 2c af std Y+60, r18 ; 0x3c 1dfbc: 3d af std Y+61, r19 ; 0x3d 1dfbe: 4e af std Y+62, r20 ; 0x3e 1dfc0: 5f af std Y+63, r21 ; 0x3f 1dfc2: ae 97 sbiw r28, 0x2e ; 46 1dfc4: 8d 81 ldd r24, Y+5 ; 0x05 1dfc6: 9e 81 ldd r25, Y+6 ; 0x06 1dfc8: af 81 ldd r26, Y+7 ; 0x07 1dfca: b8 85 ldd r27, Y+8 ; 0x08 1dfcc: e4 96 adiw r28, 0x34 ; 52 1dfce: 8c af std Y+60, r24 ; 0x3c 1dfd0: 9d af std Y+61, r25 ; 0x3d 1dfd2: ae af std Y+62, r26 ; 0x3e 1dfd4: bf af std Y+63, r27 ; 0x3f 1dfd6: e4 97 sbiw r28, 0x34 ; 52 1dfd8: 29 85 ldd r18, Y+9 ; 0x09 1dfda: 3a 85 ldd r19, Y+10 ; 0x0a 1dfdc: 4b 85 ldd r20, Y+11 ; 0x0b 1dfde: 5c 85 ldd r21, Y+12 ; 0x0c 1dfe0: ed 96 adiw r28, 0x3d ; 61 1dfe2: 2c af std Y+60, r18 ; 0x3c 1dfe4: 3d af std Y+61, r19 ; 0x3d 1dfe6: 4e af std Y+62, r20 ; 0x3e 1dfe8: 5f af std Y+63, r21 ; 0x3f 1dfea: ed 97 sbiw r28, 0x3d ; 61 1dfec: 8d 85 ldd r24, Y+13 ; 0x0d 1dfee: 9e 85 ldd r25, Y+14 ; 0x0e 1dff0: af 85 ldd r26, Y+15 ; 0x0f 1dff2: b8 89 ldd r27, Y+16 ; 0x10 1dff4: c3 58 subi r28, 0x83 ; 131 1dff6: df 4f sbci r29, 0xFF ; 255 1dff8: 88 83 st Y, r24 1dffa: 99 83 std Y+1, r25 ; 0x01 1dffc: aa 83 std Y+2, r26 ; 0x02 1dffe: bb 83 std Y+3, r27 ; 0x03 1e000: cd 57 subi r28, 0x7D ; 125 1e002: d0 40 sbci r29, 0x00 ; 0 1e004: 29 81 ldd r18, Y+1 ; 0x01 1e006: 3a 81 ldd r19, Y+2 ; 0x02 1e008: 4b 81 ldd r20, Y+3 ; 0x03 1e00a: 5c 81 ldd r21, Y+4 ; 0x04 1e00c: cf 57 subi r28, 0x7F ; 127 1e00e: df 4f sbci r29, 0xFF ; 255 1e010: 28 83 st Y, r18 1e012: 39 83 std Y+1, r19 ; 0x01 1e014: 4a 83 std Y+2, r20 ; 0x02 1e016: 5b 83 std Y+3, r21 ; 0x03 1e018: c1 58 subi r28, 0x81 ; 129 1e01a: 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]; 1e01c: 29 96 adiw r28, 0x09 ; 9 1e01e: 8c ad ldd r24, Y+60 ; 0x3c 1e020: 9d ad ldd r25, Y+61 ; 0x3d 1e022: ae ad ldd r26, Y+62 ; 0x3e 1e024: bf ad ldd r27, Y+63 ; 0x3f 1e026: 29 97 sbiw r28, 0x09 ; 9 1e028: cb 57 subi r28, 0x7B ; 123 1e02a: df 4f sbci r29, 0xFF ; 255 1e02c: 88 83 st Y, r24 1e02e: 99 83 std Y+1, r25 ; 0x01 1e030: aa 83 std Y+2, r26 ; 0x02 1e032: bb 83 std Y+3, r27 ; 0x03 1e034: c5 58 subi r28, 0x85 ; 133 1e036: d0 40 sbci r29, 0x00 ; 0 1e038: 29 89 ldd r18, Y+17 ; 0x11 1e03a: 3a 89 ldd r19, Y+18 ; 0x12 1e03c: 4b 89 ldd r20, Y+19 ; 0x13 1e03e: 5c 89 ldd r21, Y+20 ; 0x14 1e040: c7 57 subi r28, 0x77 ; 119 1e042: df 4f sbci r29, 0xFF ; 255 1e044: 28 83 st Y, r18 1e046: 39 83 std Y+1, r19 ; 0x01 1e048: 4a 83 std Y+2, r20 ; 0x02 1e04a: 5b 83 std Y+3, r21 ; 0x03 1e04c: c9 58 subi r28, 0x89 ; 137 1e04e: d0 40 sbci r29, 0x00 ; 0 1e050: 89 8d ldd r24, Y+25 ; 0x19 1e052: 9a 8d ldd r25, Y+26 ; 0x1a 1e054: ab 8d ldd r26, Y+27 ; 0x1b 1e056: bc 8d ldd r27, Y+28 ; 0x1c 1e058: cb 56 subi r28, 0x6B ; 107 1e05a: df 4f sbci r29, 0xFF ; 255 1e05c: 88 83 st Y, r24 1e05e: 99 83 std Y+1, r25 ; 0x01 1e060: aa 83 std Y+2, r26 ; 0x02 1e062: bb 83 std Y+3, r27 ; 0x03 1e064: c5 59 subi r28, 0x95 ; 149 1e066: d0 40 sbci r29, 0x00 ; 0 1e068: 2d 8d ldd r18, Y+29 ; 0x1d 1e06a: 3e 8d ldd r19, Y+30 ; 0x1e 1e06c: 4f 8d ldd r20, Y+31 ; 0x1f 1e06e: 58 a1 ldd r21, Y+32 ; 0x20 1e070: c7 56 subi r28, 0x67 ; 103 1e072: df 4f sbci r29, 0xFF ; 255 1e074: 28 83 st Y, r18 1e076: 39 83 std Y+1, r19 ; 0x01 1e078: 4a 83 std Y+2, r20 ; 0x02 1e07a: 5b 83 std Y+3, r21 ; 0x03 1e07c: c9 59 subi r28, 0x99 ; 153 1e07e: d0 40 sbci r29, 0x00 ; 0 1e080: 8d 89 ldd r24, Y+21 ; 0x15 1e082: 9e 89 ldd r25, Y+22 ; 0x16 1e084: af 89 ldd r26, Y+23 ; 0x17 1e086: b8 8d ldd r27, Y+24 ; 0x18 1e088: c3 57 subi r28, 0x73 ; 115 1e08a: df 4f sbci r29, 0xFF ; 255 1e08c: 88 83 st Y, r24 1e08e: 99 83 std Y+1, r25 ; 0x01 1e090: aa 83 std Y+2, r26 ; 0x02 1e092: bb 83 std Y+3, r27 ; 0x03 1e094: cd 58 subi r28, 0x8D ; 141 1e096: 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]; 1e098: 2d 96 adiw r28, 0x0d ; 13 1e09a: 2c ad ldd r18, Y+60 ; 0x3c 1e09c: 3d ad ldd r19, Y+61 ; 0x3d 1e09e: 4e ad ldd r20, Y+62 ; 0x3e 1e0a0: 5f ad ldd r21, Y+63 ; 0x3f 1e0a2: 2d 97 sbiw r28, 0x0d ; 13 1e0a4: c3 56 subi r28, 0x63 ; 99 1e0a6: df 4f sbci r29, 0xFF ; 255 1e0a8: 28 83 st Y, r18 1e0aa: 39 83 std Y+1, r19 ; 0x01 1e0ac: 4a 83 std Y+2, r20 ; 0x02 1e0ae: 5b 83 std Y+3, r21 ; 0x03 1e0b0: cd 59 subi r28, 0x9D ; 157 1e0b2: d0 40 sbci r29, 0x00 ; 0 1e0b4: 89 a1 ldd r24, Y+33 ; 0x21 1e0b6: 9a a1 ldd r25, Y+34 ; 0x22 1e0b8: ab a1 ldd r26, Y+35 ; 0x23 1e0ba: bc a1 ldd r27, Y+36 ; 0x24 1e0bc: cf 55 subi r28, 0x5F ; 95 1e0be: df 4f sbci r29, 0xFF ; 255 1e0c0: 88 83 st Y, r24 1e0c2: 99 83 std Y+1, r25 ; 0x01 1e0c4: aa 83 std Y+2, r26 ; 0x02 1e0c6: bb 83 std Y+3, r27 ; 0x03 1e0c8: c1 5a subi r28, 0xA1 ; 161 1e0ca: d0 40 sbci r29, 0x00 ; 0 1e0cc: 2d a1 ldd r18, Y+37 ; 0x25 1e0ce: 3e a1 ldd r19, Y+38 ; 0x26 1e0d0: 4f a1 ldd r20, Y+39 ; 0x27 1e0d2: 58 a5 ldd r21, Y+40 ; 0x28 1e0d4: cb 55 subi r28, 0x5B ; 91 1e0d6: df 4f sbci r29, 0xFF ; 255 1e0d8: 28 83 st Y, r18 1e0da: 39 83 std Y+1, r19 ; 0x01 1e0dc: 4a 83 std Y+2, r20 ; 0x02 1e0de: 5b 83 std Y+3, r21 ; 0x03 1e0e0: c5 5a subi r28, 0xA5 ; 165 1e0e2: d0 40 sbci r29, 0x00 ; 0 1e0e4: 8d a5 ldd r24, Y+45 ; 0x2d 1e0e6: 9e a5 ldd r25, Y+46 ; 0x2e 1e0e8: af a5 ldd r26, Y+47 ; 0x2f 1e0ea: b8 a9 ldd r27, Y+48 ; 0x30 1e0ec: cd 54 subi r28, 0x4D ; 77 1e0ee: df 4f sbci r29, 0xFF ; 255 1e0f0: 88 83 st Y, r24 1e0f2: 99 83 std Y+1, r25 ; 0x01 1e0f4: aa 83 std Y+2, r26 ; 0x02 1e0f6: bb 83 std Y+3, r27 ; 0x03 1e0f8: c3 5b subi r28, 0xB3 ; 179 1e0fa: d0 40 sbci r29, 0x00 ; 0 1e0fc: 29 a5 ldd r18, Y+41 ; 0x29 1e0fe: 3a a5 ldd r19, Y+42 ; 0x2a 1e100: 4b a5 ldd r20, Y+43 ; 0x2b 1e102: 5c a5 ldd r21, Y+44 ; 0x2c 1e104: c9 54 subi r28, 0x49 ; 73 1e106: df 4f sbci r29, 0xFF ; 255 1e108: 28 83 st Y, r18 1e10a: 39 83 std Y+1, r19 ; 0x01 1e10c: 4a 83 std Y+2, r20 ; 0x02 1e10e: 5b 83 std Y+3, r21 ; 0x03 1e110: c7 5b subi r28, 0xB7 ; 183 1e112: 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]; 1e114: 61 96 adiw r28, 0x11 ; 17 1e116: 8c ad ldd r24, Y+60 ; 0x3c 1e118: 9d ad ldd r25, Y+61 ; 0x3d 1e11a: ae ad ldd r26, Y+62 ; 0x3e 1e11c: bf ad ldd r27, Y+63 ; 0x3f 1e11e: 61 97 sbiw r28, 0x11 ; 17 1e120: c5 54 subi r28, 0x45 ; 69 1e122: df 4f sbci r29, 0xFF ; 255 1e124: 88 83 st Y, r24 1e126: 99 83 std Y+1, r25 ; 0x01 1e128: aa 83 std Y+2, r26 ; 0x02 1e12a: bb 83 std Y+3, r27 ; 0x03 1e12c: cb 5b subi r28, 0xBB ; 187 1e12e: d0 40 sbci r29, 0x00 ; 0 1e130: 29 a9 ldd r18, Y+49 ; 0x31 1e132: 3a a9 ldd r19, Y+50 ; 0x32 1e134: 4b a9 ldd r20, Y+51 ; 0x33 1e136: 5c a9 ldd r21, Y+52 ; 0x34 1e138: c1 54 subi r28, 0x41 ; 65 1e13a: df 4f sbci r29, 0xFF ; 255 1e13c: 28 83 st Y, r18 1e13e: 39 83 std Y+1, r19 ; 0x01 1e140: 4a 83 std Y+2, r20 ; 0x02 1e142: 5b 83 std Y+3, r21 ; 0x03 1e144: cf 5b subi r28, 0xBF ; 191 1e146: d0 40 sbci r29, 0x00 ; 0 1e148: 8d a9 ldd r24, Y+53 ; 0x35 1e14a: 9e a9 ldd r25, Y+54 ; 0x36 1e14c: af a9 ldd r26, Y+55 ; 0x37 1e14e: b8 ad ldd r27, Y+56 ; 0x38 1e150: cd 53 subi r28, 0x3D ; 61 1e152: df 4f sbci r29, 0xFF ; 255 1e154: 88 83 st Y, r24 1e156: 99 83 std Y+1, r25 ; 0x01 1e158: aa 83 std Y+2, r26 ; 0x02 1e15a: bb 83 std Y+3, r27 ; 0x03 1e15c: c3 5c subi r28, 0xC3 ; 195 1e15e: d0 40 sbci r29, 0x00 ; 0 1e160: 29 ad ldd r18, Y+57 ; 0x39 1e162: 3a ad ldd r19, Y+58 ; 0x3a 1e164: 4b ad ldd r20, Y+59 ; 0x3b 1e166: 5c ad ldd r21, Y+60 ; 0x3c 1e168: c9 53 subi r28, 0x39 ; 57 1e16a: df 4f sbci r29, 0xFF ; 255 1e16c: 28 83 st Y, r18 1e16e: 39 83 std Y+1, r19 ; 0x01 1e170: 4a 83 std Y+2, r20 ; 0x02 1e172: 5b 83 std Y+3, r21 ; 0x03 1e174: c7 5c subi r28, 0xC7 ; 199 1e176: d0 40 sbci r29, 0x00 ; 0 1e178: 21 96 adiw r28, 0x01 ; 1 1e17a: 8c ad ldd r24, Y+60 ; 0x3c 1e17c: 9d ad ldd r25, Y+61 ; 0x3d 1e17e: ae ad ldd r26, Y+62 ; 0x3e 1e180: bf ad ldd r27, Y+63 ; 0x3f 1e182: 21 97 sbiw r28, 0x01 ; 1 1e184: c5 53 subi r28, 0x35 ; 53 1e186: df 4f sbci r29, 0xFF ; 255 1e188: 88 83 st Y, r24 1e18a: 99 83 std Y+1, r25 ; 0x01 1e18c: aa 83 std Y+2, r26 ; 0x02 1e18e: bb 83 std Y+3, r27 ; 0x03 1e190: cb 5c subi r28, 0xCB ; 203 1e192: d0 40 sbci r29, 0x00 ; 0 1e194: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1e196: c1 2c mov r12, r1 1e198: d1 2c mov r13, r1 1e19a: 76 01 movw r14, r12 1e19c: 46 01 movw r8, r12 1e19e: 57 01 movw r10, r14 1e1a0: 26 01 movw r4, r12 1e1a2: 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]; 1e1a4: a3 01 movw r20, r6 1e1a6: 92 01 movw r18, r4 1e1a8: e4 96 adiw r28, 0x34 ; 52 1e1aa: 6c ad ldd r22, Y+60 ; 0x3c 1e1ac: 7d ad ldd r23, Y+61 ; 0x3d 1e1ae: 8e ad ldd r24, Y+62 ; 0x3e 1e1b0: 9f ad ldd r25, Y+63 ; 0x3f 1e1b2: e4 97 sbiw r28, 0x34 ; 52 1e1b4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e1b8: 9b 01 movw r18, r22 1e1ba: ac 01 movw r20, r24 1e1bc: ae 96 adiw r28, 0x2e ; 46 1e1be: 6c ad ldd r22, Y+60 ; 0x3c 1e1c0: 7d ad ldd r23, Y+61 ; 0x3d 1e1c2: 8e ad ldd r24, Y+62 ; 0x3e 1e1c4: 9f ad ldd r25, Y+63 ; 0x3f 1e1c6: ae 97 sbiw r28, 0x2e ; 46 1e1c8: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e1cc: 2b 01 movw r4, r22 1e1ce: 3c 01 movw r6, r24 1e1d0: a5 01 movw r20, r10 1e1d2: 94 01 movw r18, r8 1e1d4: ed 96 adiw r28, 0x3d ; 61 1e1d6: 6c ad ldd r22, Y+60 ; 0x3c 1e1d8: 7d ad ldd r23, Y+61 ; 0x3d 1e1da: 8e ad ldd r24, Y+62 ; 0x3e 1e1dc: 9f ad ldd r25, Y+63 ; 0x3f 1e1de: ed 97 sbiw r28, 0x3d ; 61 1e1e0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e1e4: 9b 01 movw r18, r22 1e1e6: ac 01 movw r20, r24 1e1e8: c3 01 movw r24, r6 1e1ea: b2 01 movw r22, r4 1e1ec: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e1f0: 2b 01 movw r4, r22 1e1f2: 3c 01 movw r6, r24 1e1f4: a7 01 movw r20, r14 1e1f6: 96 01 movw r18, r12 1e1f8: c3 58 subi r28, 0x83 ; 131 1e1fa: df 4f sbci r29, 0xFF ; 255 1e1fc: 68 81 ld r22, Y 1e1fe: 79 81 ldd r23, Y+1 ; 0x01 1e200: 8a 81 ldd r24, Y+2 ; 0x02 1e202: 9b 81 ldd r25, Y+3 ; 0x03 1e204: cd 57 subi r28, 0x7D ; 125 1e206: d0 40 sbci r29, 0x00 ; 0 1e208: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e20c: 9b 01 movw r18, r22 1e20e: ac 01 movw r20, r24 1e210: c3 01 movw r24, r6 1e212: b2 01 movw r22, r4 1e214: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e218: cf 57 subi r28, 0x7F ; 127 1e21a: df 4f sbci r29, 0xFF ; 255 1e21c: 28 81 ld r18, Y 1e21e: 39 81 ldd r19, Y+1 ; 0x01 1e220: 4a 81 ldd r20, Y+2 ; 0x02 1e222: 5b 81 ldd r21, Y+3 ; 0x03 1e224: c1 58 subi r28, 0x81 ; 129 1e226: d0 40 sbci r29, 0x00 ; 0 1e228: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1e22c: 6e 96 adiw r28, 0x1e ; 30 1e22e: 6c af std Y+60, r22 ; 0x3c 1e230: 7d af std Y+61, r23 ; 0x3d 1e232: 8e af std Y+62, r24 ; 0x3e 1e234: 9f af std Y+63, r25 ; 0x3f 1e236: 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]; 1e238: c7 57 subi r28, 0x77 ; 119 1e23a: df 4f sbci r29, 0xFF ; 255 1e23c: 28 81 ld r18, Y 1e23e: 39 81 ldd r19, Y+1 ; 0x01 1e240: 4a 81 ldd r20, Y+2 ; 0x02 1e242: 5b 81 ldd r21, Y+3 ; 0x03 1e244: c9 58 subi r28, 0x89 ; 137 1e246: d0 40 sbci r29, 0x00 ; 0 1e248: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e24c: 9b 01 movw r18, r22 1e24e: ac 01 movw r20, r24 1e250: cb 57 subi r28, 0x7B ; 123 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: c5 58 subi r28, 0x85 ; 133 1e25e: d0 40 sbci r29, 0x00 ; 0 1e260: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e264: 2b 01 movw r4, r22 1e266: 3c 01 movw r6, r24 1e268: a5 01 movw r20, r10 1e26a: 94 01 movw r18, r8 1e26c: cb 56 subi r28, 0x6B ; 107 1e26e: df 4f sbci r29, 0xFF ; 255 1e270: 68 81 ld r22, Y 1e272: 79 81 ldd r23, Y+1 ; 0x01 1e274: 8a 81 ldd r24, Y+2 ; 0x02 1e276: 9b 81 ldd r25, Y+3 ; 0x03 1e278: c5 59 subi r28, 0x95 ; 149 1e27a: d0 40 sbci r29, 0x00 ; 0 1e27c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e280: 9b 01 movw r18, r22 1e282: ac 01 movw r20, r24 1e284: c3 01 movw r24, r6 1e286: b2 01 movw r22, r4 1e288: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e28c: 4b 01 movw r8, r22 1e28e: 5c 01 movw r10, r24 1e290: a7 01 movw r20, r14 1e292: 96 01 movw r18, r12 1e294: c7 56 subi r28, 0x67 ; 103 1e296: df 4f sbci r29, 0xFF ; 255 1e298: 68 81 ld r22, Y 1e29a: 79 81 ldd r23, Y+1 ; 0x01 1e29c: 8a 81 ldd r24, Y+2 ; 0x02 1e29e: 9b 81 ldd r25, Y+3 ; 0x03 1e2a0: c9 59 subi r28, 0x99 ; 153 1e2a2: d0 40 sbci r29, 0x00 ; 0 1e2a4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e2a8: 9b 01 movw r18, r22 1e2aa: ac 01 movw r20, r24 1e2ac: c5 01 movw r24, r10 1e2ae: b4 01 movw r22, r8 1e2b0: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e2b4: c3 57 subi r28, 0x73 ; 115 1e2b6: df 4f sbci r29, 0xFF ; 255 1e2b8: 28 81 ld r18, Y 1e2ba: 39 81 ldd r19, Y+1 ; 0x01 1e2bc: 4a 81 ldd r20, Y+2 ; 0x02 1e2be: 5b 81 ldd r21, Y+3 ; 0x03 1e2c0: cd 58 subi r28, 0x8D ; 141 1e2c2: d0 40 sbci r29, 0x00 ; 0 1e2c4: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1e2c8: 2b 01 movw r4, r22 1e2ca: 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]; 1e2cc: cf 55 subi r28, 0x5F ; 95 1e2ce: df 4f sbci r29, 0xFF ; 255 1e2d0: 28 81 ld r18, Y 1e2d2: 39 81 ldd r19, Y+1 ; 0x01 1e2d4: 4a 81 ldd r20, Y+2 ; 0x02 1e2d6: 5b 81 ldd r21, Y+3 ; 0x03 1e2d8: c1 5a subi r28, 0xA1 ; 161 1e2da: d0 40 sbci r29, 0x00 ; 0 1e2dc: 6e 96 adiw r28, 0x1e ; 30 1e2de: 6c ad ldd r22, Y+60 ; 0x3c 1e2e0: 7d ad ldd r23, Y+61 ; 0x3d 1e2e2: 8e ad ldd r24, Y+62 ; 0x3e 1e2e4: 9f ad ldd r25, Y+63 ; 0x3f 1e2e6: 6e 97 sbiw r28, 0x1e ; 30 1e2e8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e2ec: 9b 01 movw r18, r22 1e2ee: ac 01 movw r20, r24 1e2f0: c3 56 subi r28, 0x63 ; 99 1e2f2: df 4f sbci r29, 0xFF ; 255 1e2f4: 68 81 ld r22, Y 1e2f6: 79 81 ldd r23, Y+1 ; 0x01 1e2f8: 8a 81 ldd r24, Y+2 ; 0x02 1e2fa: 9b 81 ldd r25, Y+3 ; 0x03 1e2fc: cd 59 subi r28, 0x9D ; 157 1e2fe: d0 40 sbci r29, 0x00 ; 0 1e300: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e304: 4b 01 movw r8, r22 1e306: 5c 01 movw r10, r24 1e308: cb 55 subi r28, 0x5B ; 91 1e30a: df 4f sbci r29, 0xFF ; 255 1e30c: 28 81 ld r18, Y 1e30e: 39 81 ldd r19, Y+1 ; 0x01 1e310: 4a 81 ldd r20, Y+2 ; 0x02 1e312: 5b 81 ldd r21, Y+3 ; 0x03 1e314: c5 5a subi r28, 0xA5 ; 165 1e316: d0 40 sbci r29, 0x00 ; 0 1e318: c3 01 movw r24, r6 1e31a: b2 01 movw r22, r4 1e31c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e320: 9b 01 movw r18, r22 1e322: ac 01 movw r20, r24 1e324: c5 01 movw r24, r10 1e326: b4 01 movw r22, r8 1e328: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e32c: 4b 01 movw r8, r22 1e32e: 5c 01 movw r10, r24 1e330: a7 01 movw r20, r14 1e332: 96 01 movw r18, r12 1e334: cd 54 subi r28, 0x4D ; 77 1e336: df 4f sbci r29, 0xFF ; 255 1e338: 68 81 ld r22, Y 1e33a: 79 81 ldd r23, Y+1 ; 0x01 1e33c: 8a 81 ldd r24, Y+2 ; 0x02 1e33e: 9b 81 ldd r25, Y+3 ; 0x03 1e340: c3 5b subi r28, 0xB3 ; 179 1e342: d0 40 sbci r29, 0x00 ; 0 1e344: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e348: 9b 01 movw r18, r22 1e34a: ac 01 movw r20, r24 1e34c: c5 01 movw r24, r10 1e34e: b4 01 movw r22, r8 1e350: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e354: c9 54 subi r28, 0x49 ; 73 1e356: df 4f sbci r29, 0xFF ; 255 1e358: 28 81 ld r18, Y 1e35a: 39 81 ldd r19, Y+1 ; 0x01 1e35c: 4a 81 ldd r20, Y+2 ; 0x02 1e35e: 5b 81 ldd r21, Y+3 ; 0x03 1e360: c7 5b subi r28, 0xB7 ; 183 1e362: d0 40 sbci r29, 0x00 ; 0 1e364: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1e368: 4b 01 movw r8, r22 1e36a: 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]; 1e36c: c1 54 subi r28, 0x41 ; 65 1e36e: df 4f sbci r29, 0xFF ; 255 1e370: 28 81 ld r18, Y 1e372: 39 81 ldd r19, Y+1 ; 0x01 1e374: 4a 81 ldd r20, Y+2 ; 0x02 1e376: 5b 81 ldd r21, Y+3 ; 0x03 1e378: cf 5b subi r28, 0xBF ; 191 1e37a: d0 40 sbci r29, 0x00 ; 0 1e37c: 6e 96 adiw r28, 0x1e ; 30 1e37e: 6c ad ldd r22, Y+60 ; 0x3c 1e380: 7d ad ldd r23, Y+61 ; 0x3d 1e382: 8e ad ldd r24, Y+62 ; 0x3e 1e384: 9f ad ldd r25, Y+63 ; 0x3f 1e386: 6e 97 sbiw r28, 0x1e ; 30 1e388: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e38c: 9b 01 movw r18, r22 1e38e: ac 01 movw r20, r24 1e390: c5 54 subi r28, 0x45 ; 69 1e392: df 4f sbci r29, 0xFF ; 255 1e394: 68 81 ld r22, Y 1e396: 79 81 ldd r23, Y+1 ; 0x01 1e398: 8a 81 ldd r24, Y+2 ; 0x02 1e39a: 9b 81 ldd r25, Y+3 ; 0x03 1e39c: cb 5b subi r28, 0xBB ; 187 1e39e: d0 40 sbci r29, 0x00 ; 0 1e3a0: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e3a4: 6b 01 movw r12, r22 1e3a6: 7c 01 movw r14, r24 1e3a8: cd 53 subi r28, 0x3D ; 61 1e3aa: df 4f sbci r29, 0xFF ; 255 1e3ac: 28 81 ld r18, Y 1e3ae: 39 81 ldd r19, Y+1 ; 0x01 1e3b0: 4a 81 ldd r20, Y+2 ; 0x02 1e3b2: 5b 81 ldd r21, Y+3 ; 0x03 1e3b4: c3 5c subi r28, 0xC3 ; 195 1e3b6: d0 40 sbci r29, 0x00 ; 0 1e3b8: c3 01 movw r24, r6 1e3ba: b2 01 movw r22, r4 1e3bc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e3c0: 9b 01 movw r18, r22 1e3c2: ac 01 movw r20, r24 1e3c4: c7 01 movw r24, r14 1e3c6: b6 01 movw r22, r12 1e3c8: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e3cc: 6b 01 movw r12, r22 1e3ce: 7c 01 movw r14, r24 1e3d0: c9 53 subi r28, 0x39 ; 57 1e3d2: df 4f sbci r29, 0xFF ; 255 1e3d4: 28 81 ld r18, Y 1e3d6: 39 81 ldd r19, Y+1 ; 0x01 1e3d8: 4a 81 ldd r20, Y+2 ; 0x02 1e3da: 5b 81 ldd r21, Y+3 ; 0x03 1e3dc: c7 5c subi r28, 0xC7 ; 199 1e3de: d0 40 sbci r29, 0x00 ; 0 1e3e0: c5 01 movw r24, r10 1e3e2: b4 01 movw r22, r8 1e3e4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e3e8: 9b 01 movw r18, r22 1e3ea: ac 01 movw r20, r24 1e3ec: c7 01 movw r24, r14 1e3ee: b6 01 movw r22, r12 1e3f0: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e3f4: c5 53 subi r28, 0x35 ; 53 1e3f6: df 4f sbci r29, 0xFF ; 255 1e3f8: 28 81 ld r18, Y 1e3fa: 39 81 ldd r19, Y+1 ; 0x01 1e3fc: 4a 81 ldd r20, Y+2 ; 0x02 1e3fe: 5b 81 ldd r21, Y+3 ; 0x03 1e400: cb 5c subi r28, 0xCB ; 203 1e402: d0 40 sbci r29, 0x00 ; 0 1e404: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1e408: 6b 01 movw r12, r22 1e40a: 7c 01 movw r14, r24 1e40c: 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) { 1e40e: 09 f0 breq .+2 ; 0x1e412 1e410: c9 ce rjmp .-622 ; 0x1e1a4 // 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]; 1e412: 6e 96 adiw r28, 0x1e ; 30 1e414: 2c ad ldd r18, Y+60 ; 0x3c 1e416: 3d ad ldd r19, Y+61 ; 0x3d 1e418: 4e ad ldd r20, Y+62 ; 0x3e 1e41a: 5f ad ldd r21, Y+63 ; 0x3f 1e41c: 6e 97 sbiw r28, 0x1e ; 30 1e41e: c5 55 subi r28, 0x55 ; 85 1e420: df 4f sbci r29, 0xFF ; 255 1e422: 68 81 ld r22, Y 1e424: 79 81 ldd r23, Y+1 ; 0x01 1e426: 8a 81 ldd r24, Y+2 ; 0x02 1e428: 9b 81 ldd r25, Y+3 ; 0x03 1e42a: cb 5a subi r28, 0xAB ; 171 1e42c: d0 40 sbci r29, 0x00 ; 0 1e42e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e432: 60 93 ce 13 sts 0x13CE, r22 ; 0x8013ce 1e436: 70 93 cf 13 sts 0x13CF, r23 ; 0x8013cf 1e43a: 80 93 d0 13 sts 0x13D0, r24 ; 0x8013d0 1e43e: 90 93 d1 13 sts 0x13D1, r25 ; 0x8013d1 cntr[1] += h[1]; 1e442: a3 01 movw r20, r6 1e444: 92 01 movw r18, r4 1e446: c1 55 subi r28, 0x51 ; 81 1e448: df 4f sbci r29, 0xFF ; 255 1e44a: 68 81 ld r22, Y 1e44c: 79 81 ldd r23, Y+1 ; 0x01 1e44e: 8a 81 ldd r24, Y+2 ; 0x02 1e450: 9b 81 ldd r25, Y+3 ; 0x03 1e452: cf 5a subi r28, 0xAF ; 175 1e454: d0 40 sbci r29, 0x00 ; 0 1e456: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e45a: 60 93 d2 13 sts 0x13D2, r22 ; 0x8013d2 1e45e: 70 93 d3 13 sts 0x13D3, r23 ; 0x8013d3 1e462: 80 93 d4 13 sts 0x13D4, r24 ; 0x8013d4 1e466: 90 93 d5 13 sts 0x13D5, r25 ; 0x8013d5 a1 += h[2]; 1e46a: a5 01 movw r20, r10 1e46c: 94 01 movw r18, r8 1e46e: a6 96 adiw r28, 0x26 ; 38 1e470: 6c ad ldd r22, Y+60 ; 0x3c 1e472: 7d ad ldd r23, Y+61 ; 0x3d 1e474: 8e ad ldd r24, Y+62 ; 0x3e 1e476: 9f ad ldd r25, Y+63 ; 0x3f 1e478: a6 97 sbiw r28, 0x26 ; 38 1e47a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e47e: a6 96 adiw r28, 0x26 ; 38 1e480: 6c af std Y+60, r22 ; 0x3c 1e482: 7d af std Y+61, r23 ; 0x3d 1e484: 8e af std Y+62, r24 ; 0x3e 1e486: 9f af std Y+63, r25 ; 0x3f 1e488: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1e48a: a7 01 movw r20, r14 1e48c: 96 01 movw r18, r12 1e48e: a2 96 adiw r28, 0x22 ; 34 1e490: 6c ad ldd r22, Y+60 ; 0x3c 1e492: 7d ad ldd r23, Y+61 ; 0x3d 1e494: 8e ad ldd r24, Y+62 ; 0x3e 1e496: 9f ad ldd r25, Y+63 ; 0x3f 1e498: a2 97 sbiw r28, 0x22 ; 34 1e49a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e49e: a2 96 adiw r28, 0x22 ; 34 1e4a0: 6c af std Y+60, r22 ; 0x3c 1e4a2: 7d af std Y+61, r23 ; 0x3d 1e4a4: 8e af std Y+62, r24 ; 0x3e 1e4a6: 9f af std Y+63, r25 ; 0x3f 1e4a8: a2 97 sbiw r28, 0x22 ; 34 1e4aa: e6 96 adiw r28, 0x36 ; 54 1e4ac: 9f ad ldd r25, Y+63 ; 0x3f 1e4ae: e6 97 sbiw r28, 0x36 ; 54 1e4b0: 91 50 subi r25, 0x01 ; 1 1e4b2: e6 96 adiw r28, 0x36 ; 54 1e4b4: 9f af std Y+63, r25 ; 0x3f 1e4b6: 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) { 1e4b8: 91 11 cpse r25, r1 1e4ba: 70 c9 rjmp .-3360 ; 0x1d79c SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1e4bc: a6 96 adiw r28, 0x26 ; 38 1e4be: 6c ad ldd r22, Y+60 ; 0x3c 1e4c0: 7d ad ldd r23, Y+61 ; 0x3d 1e4c2: 8e ad ldd r24, Y+62 ; 0x3e 1e4c4: 9f ad ldd r25, Y+63 ; 0x3f 1e4c6: a6 97 sbiw r28, 0x26 ; 38 1e4c8: 0f 94 31 df call 0x3be62 ; 0x3be62 1e4cc: 60 93 be 13 sts 0x13BE, r22 ; 0x8013be 1e4d0: 70 93 bf 13 sts 0x13BF, r23 ; 0x8013bf 1e4d4: 80 93 c0 13 sts 0x13C0, r24 ; 0x8013c0 1e4d8: 90 93 c1 13 sts 0x13C1, r25 ; 0x8013c1 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1e4dc: a6 96 adiw r28, 0x26 ; 38 1e4de: 6c ad ldd r22, Y+60 ; 0x3c 1e4e0: 7d ad ldd r23, Y+61 ; 0x3d 1e4e2: 8e ad ldd r24, Y+62 ; 0x3e 1e4e4: 9f ad ldd r25, Y+63 ; 0x3f 1e4e6: a6 97 sbiw r28, 0x26 ; 38 1e4e8: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 1e4ec: 60 93 c2 13 sts 0x13C2, r22 ; 0x8013c2 1e4f0: 70 93 c3 13 sts 0x13C3, r23 ; 0x8013c3 1e4f4: 80 93 c4 13 sts 0x13C4, r24 ; 0x8013c4 1e4f8: 90 93 c5 13 sts 0x13C5, r25 ; 0x8013c5 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1e4fc: a2 96 adiw r28, 0x22 ; 34 1e4fe: 6c ad ldd r22, Y+60 ; 0x3c 1e500: 7d ad ldd r23, Y+61 ; 0x3d 1e502: 8e ad ldd r24, Y+62 ; 0x3e 1e504: 9f ad ldd r25, Y+63 ; 0x3f 1e506: a2 97 sbiw r28, 0x22 ; 34 1e508: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 1e50c: 90 58 subi r25, 0x80 ; 128 1e50e: 60 93 c6 13 sts 0x13C6, r22 ; 0x8013c6 1e512: 70 93 c7 13 sts 0x13C7, r23 ; 0x8013c7 1e516: 80 93 c8 13 sts 0x13C8, r24 ; 0x8013c8 1e51a: 90 93 c9 13 sts 0x13C9, r25 ; 0x8013c9 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1e51e: a2 96 adiw r28, 0x22 ; 34 1e520: 6c ad ldd r22, Y+60 ; 0x3c 1e522: 7d ad ldd r23, Y+61 ; 0x3d 1e524: 8e ad ldd r24, Y+62 ; 0x3e 1e526: 9f ad ldd r25, Y+63 ; 0x3f 1e528: a2 97 sbiw r28, 0x22 ; 34 1e52a: 0f 94 31 df call 0x3be62 ; 0x3be62 1e52e: 60 93 ca 13 sts 0x13CA, r22 ; 0x8013ca 1e532: 70 93 cb 13 sts 0x13CB, r23 ; 0x8013cb 1e536: 80 93 cc 13 sts 0x13CC, r24 ; 0x8013cc 1e53a: 90 93 cd 13 sts 0x13CD, r25 ; 0x8013cd BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1e53e: a6 96 adiw r28, 0x26 ; 38 1e540: 2c ad ldd r18, Y+60 ; 0x3c 1e542: 3d ad ldd r19, Y+61 ; 0x3d 1e544: 4e ad ldd r20, Y+62 ; 0x3e 1e546: 5f ad ldd r21, Y+63 ; 0x3f 1e548: a6 97 sbiw r28, 0x26 ; 38 1e54a: a2 96 adiw r28, 0x22 ; 34 1e54c: 6c ad ldd r22, Y+60 ; 0x3c 1e54e: 7d ad ldd r23, Y+61 ; 0x3d 1e550: 8e ad ldd r24, Y+62 ; 0x3e 1e552: 9f ad ldd r25, Y+63 ; 0x3f 1e554: a2 97 sbiw r28, 0x22 ; 34 1e556: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e55a: 4b 01 movw r8, r22 1e55c: 5c 01 movw r10, r24 1e55e: 7c 01 movw r14, r24 1e560: 6b 01 movw r12, r22 1e562: e8 94 clt 1e564: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1e566: 21 ee ldi r18, 0xE1 ; 225 1e568: 3e e2 ldi r19, 0x2E ; 46 1e56a: 45 e6 ldi r20, 0x65 ; 101 1e56c: 52 e4 ldi r21, 0x42 ; 66 1e56e: a2 96 adiw r28, 0x22 ; 34 1e570: 6c ad ldd r22, Y+60 ; 0x3c 1e572: 7d ad ldd r23, Y+61 ; 0x3d 1e574: 8e ad ldd r24, Y+62 ; 0x3e 1e576: 9f ad ldd r25, Y+63 ; 0x3f 1e578: a2 97 sbiw r28, 0x22 ; 34 1e57a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e57e: 9f 93 push r25 1e580: 8f 93 push r24 1e582: 7f 93 push r23 1e584: 6f 93 push r22 1e586: 21 ee ldi r18, 0xE1 ; 225 1e588: 3e e2 ldi r19, 0x2E ; 46 1e58a: 45 e6 ldi r20, 0x65 ; 101 1e58c: 52 e4 ldi r21, 0x42 ; 66 1e58e: c5 01 movw r24, r10 1e590: b4 01 movw r22, r8 1e592: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e596: 9f 93 push r25 1e598: 8f 93 push r24 1e59a: 7f 93 push r23 1e59c: 6f 93 push r22 1e59e: 84 ef ldi r24, 0xF4 ; 244 1e5a0: 9e e6 ldi r25, 0x6E ; 110 1e5a2: 9f 93 push r25 1e5a4: 8f 93 push r24 1e5a6: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1e5aa: b7 01 movw r22, r14 1e5ac: a6 01 movw r20, r12 1e5ae: 80 e6 ldi r24, 0x60 ; 96 1e5b0: 9f e0 ldi r25, 0x0F ; 15 1e5b2: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 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) 1e5b6: 0f b6 in r0, 0x3f ; 63 1e5b8: f8 94 cli 1e5ba: de bf out 0x3e, r29 ; 62 1e5bc: 0f be out 0x3f, r0 ; 63 1e5be: cd bf out 0x3d, r28 ; 61 1e5c0: 2f e1 ldi r18, 0x1F ; 31 1e5c2: 32 e4 ldi r19, 0x42 ; 66 1e5c4: 49 e0 ldi r20, 0x09 ; 9 1e5c6: 5b e3 ldi r21, 0x3B ; 59 1e5c8: c7 01 movw r24, r14 1e5ca: b6 01 movw r22, r12 1e5cc: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__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; 1e5d0: 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) 1e5d2: 18 16 cp r1, r24 1e5d4: 64 f4 brge .+24 ; 0x1e5ee result = (angleDiff > bed_skew_angle_extreme) ? 1e5d6: 25 e3 ldi r18, 0x35 ; 53 1e5d8: 3a ef ldi r19, 0xFA ; 250 1e5da: 4e e8 ldi r20, 0x8E ; 142 1e5dc: 5b e3 ldi r21, 0x3B ; 59 1e5de: c7 01 movw r24, r14 1e5e0: b6 01 movw r22, r12 1e5e2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1e5e6: 12 e0 ldi r17, 0x02 ; 2 1e5e8: 18 16 cp r1, r24 1e5ea: 0c f0 brlt .+2 ; 0x1e5ee 1e5ec: 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 || 1e5ee: 25 e3 ldi r18, 0x35 ; 53 1e5f0: 3a ef ldi r19, 0xFA ; 250 1e5f2: 4e e8 ldi r20, 0x8E ; 142 1e5f4: 5b e3 ldi r21, 0x3B ; 59 1e5f6: a6 96 adiw r28, 0x26 ; 38 1e5f8: 6c ad ldd r22, Y+60 ; 0x3c 1e5fa: 7d ad ldd r23, Y+61 ; 0x3d 1e5fc: 8e ad ldd r24, Y+62 ; 0x3e 1e5fe: 9f ad ldd r25, Y+63 ; 0x3f 1e600: a6 97 sbiw r28, 0x26 ; 38 1e602: 9f 77 andi r25, 0x7F ; 127 1e604: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1e608: 18 16 cp r1, r24 1e60a: 0c f4 brge .+2 ; 0x1e60e 1e60c: 67 c4 rjmp .+2254 ; 0x1eedc 1e60e: 25 e3 ldi r18, 0x35 ; 53 1e610: 3a ef ldi r19, 0xFA ; 250 1e612: 4e e8 ldi r20, 0x8E ; 142 1e614: 5b e3 ldi r21, 0x3B ; 59 1e616: a2 96 adiw r28, 0x22 ; 34 1e618: 6c ad ldd r22, Y+60 ; 0x3c 1e61a: 7d ad ldd r23, Y+61 ; 0x3d 1e61c: 8e ad ldd r24, Y+62 ; 0x3e 1e61e: 9f ad ldd r25, Y+63 ; 0x3f 1e620: a2 97 sbiw r28, 0x22 ; 34 1e622: 9f 77 andi r25, 0x7F ; 127 1e624: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1e628: 18 16 cp r1, r24 1e62a: 0c f4 brge .+2 ; 0x1e62e 1e62c: 57 c4 rjmp .+2222 ; 0x1eedc 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]; 1e62e: 20 91 be 13 lds r18, 0x13BE ; 0x8013be 1e632: 30 91 bf 13 lds r19, 0x13BF ; 0x8013bf 1e636: 40 91 c0 13 lds r20, 0x13C0 ; 0x8013c0 1e63a: 50 91 c1 13 lds r21, 0x13C1 ; 0x8013c1 1e63e: ae 96 adiw r28, 0x2e ; 46 1e640: 2c af std Y+60, r18 ; 0x3c 1e642: 3d af std Y+61, r19 ; 0x3d 1e644: 4e af std Y+62, r20 ; 0x3e 1e646: 5f af std Y+63, r21 ; 0x3f 1e648: ae 97 sbiw r28, 0x2e ; 46 1e64a: 80 91 c6 13 lds r24, 0x13C6 ; 0x8013c6 1e64e: 90 91 c7 13 lds r25, 0x13C7 ; 0x8013c7 1e652: a0 91 c8 13 lds r26, 0x13C8 ; 0x8013c8 1e656: b0 91 c9 13 lds r27, 0x13C9 ; 0x8013c9 1e65a: e9 96 adiw r28, 0x39 ; 57 1e65c: 8c af std Y+60, r24 ; 0x3c 1e65e: 9d af std Y+61, r25 ; 0x3d 1e660: ae af std Y+62, r26 ; 0x3e 1e662: bf af std Y+63, r27 ; 0x3f 1e664: e9 97 sbiw r28, 0x39 ; 57 1e666: 20 91 ce 13 lds r18, 0x13CE ; 0x8013ce 1e66a: 30 91 cf 13 lds r19, 0x13CF ; 0x8013cf 1e66e: 40 91 d0 13 lds r20, 0x13D0 ; 0x8013d0 1e672: 50 91 d1 13 lds r21, 0x13D1 ; 0x8013d1 1e676: e4 96 adiw r28, 0x34 ; 52 1e678: 2c af std Y+60, r18 ; 0x3c 1e67a: 3d af std Y+61, r19 ; 0x3d 1e67c: 4e af std Y+62, r20 ; 0x3e 1e67e: 5f af std Y+63, r21 ; 0x3f 1e680: 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]; 1e682: 80 91 c2 13 lds r24, 0x13C2 ; 0x8013c2 1e686: 90 91 c3 13 lds r25, 0x13C3 ; 0x8013c3 1e68a: a0 91 c4 13 lds r26, 0x13C4 ; 0x8013c4 1e68e: b0 91 c5 13 lds r27, 0x13C5 ; 0x8013c5 1e692: ed 96 adiw r28, 0x3d ; 61 1e694: 8c af std Y+60, r24 ; 0x3c 1e696: 9d af std Y+61, r25 ; 0x3d 1e698: ae af std Y+62, r26 ; 0x3e 1e69a: bf af std Y+63, r27 ; 0x3f 1e69c: ed 97 sbiw r28, 0x3d ; 61 1e69e: 20 91 ca 13 lds r18, 0x13CA ; 0x8013ca 1e6a2: 30 91 cb 13 lds r19, 0x13CB ; 0x8013cb 1e6a6: 40 91 cc 13 lds r20, 0x13CC ; 0x8013cc 1e6aa: 50 91 cd 13 lds r21, 0x13CD ; 0x8013cd 1e6ae: c3 58 subi r28, 0x83 ; 131 1e6b0: df 4f sbci r29, 0xFF ; 255 1e6b2: 28 83 st Y, r18 1e6b4: 39 83 std Y+1, r19 ; 0x01 1e6b6: 4a 83 std Y+2, r20 ; 0x02 1e6b8: 5b 83 std Y+3, r21 ; 0x03 1e6ba: cd 57 subi r28, 0x7D ; 125 1e6bc: d0 40 sbci r29, 0x00 ; 0 1e6be: 80 91 d2 13 lds r24, 0x13D2 ; 0x8013d2 1e6c2: 90 91 d3 13 lds r25, 0x13D3 ; 0x8013d3 1e6c6: a0 91 d4 13 lds r26, 0x13D4 ; 0x8013d4 1e6ca: b0 91 d5 13 lds r27, 0x13D5 ; 0x8013d5 1e6ce: cf 57 subi r28, 0x7F ; 127 1e6d0: df 4f sbci r29, 0xFF ; 255 1e6d2: 88 83 st Y, r24 1e6d4: 99 83 std Y+1, r25 ; 0x01 1e6d6: aa 83 std Y+2, r26 ; 0x02 1e6d8: bb 83 std Y+3, r27 ; 0x03 1e6da: c1 58 subi r28, 0x81 ; 129 1e6dc: d0 40 sbci r29, 0x00 ; 0 1e6de: ad e3 ldi r26, 0x3D ; 61 1e6e0: b3 e9 ldi r27, 0x93 ; 147 1e6e2: 6c 96 adiw r28, 0x1c ; 28 1e6e4: bf af std Y+63, r27 ; 0x3f 1e6e6: ae af std Y+62, r26 ; 0x3e 1e6e8: 6c 97 sbiw r28, 0x1c ; 28 1e6ea: 8d e9 ldi r24, 0x9D ; 157 1e6ec: 28 2e mov r2, r24 1e6ee: 83 e1 ldi r24, 0x13 ; 19 1e6f0: 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]; 1e6f2: f1 01 movw r30, r2 1e6f4: c1 80 ldd r12, Z+1 ; 0x01 1e6f6: d2 80 ldd r13, Z+2 ; 0x02 1e6f8: e3 80 ldd r14, Z+3 ; 0x03 1e6fa: f4 80 ldd r15, Z+4 ; 0x04 1e6fc: 45 80 ldd r4, Z+5 ; 0x05 1e6fe: 56 80 ldd r5, Z+6 ; 0x06 1e700: 67 80 ldd r6, Z+7 ; 0x07 1e702: 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; 1e704: 6c 96 adiw r28, 0x1c ; 28 1e706: ee ad ldd r30, Y+62 ; 0x3e 1e708: ff ad ldd r31, Y+63 ; 0x3f 1e70a: 6c 97 sbiw r28, 0x1c ; 28 1e70c: 25 91 lpm r18, Z+ 1e70e: 35 91 lpm r19, Z+ 1e710: 45 91 lpm r20, Z+ 1e712: 54 91 lpm r21, Z 1e714: cb 57 subi r28, 0x7B ; 123 1e716: df 4f sbci r29, 0xFF ; 255 1e718: 28 83 st Y, r18 1e71a: 39 83 std Y+1, r19 ; 0x01 1e71c: 4a 83 std Y+2, r20 ; 0x02 1e71e: 5b 83 std Y+3, r21 ; 0x03 1e720: c5 58 subi r28, 0x85 ; 133 1e722: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1e724: 6c 96 adiw r28, 0x1c ; 28 1e726: ee ad ldd r30, Y+62 ; 0x3e 1e728: ff ad ldd r31, Y+63 ; 0x3f 1e72a: 6c 97 sbiw r28, 0x1c ; 28 1e72c: 34 96 adiw r30, 0x04 ; 4 1e72e: 85 90 lpm r8, Z+ 1e730: 95 90 lpm r9, Z+ 1e732: a5 90 lpm r10, Z+ 1e734: 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]; 1e736: ed 96 adiw r28, 0x3d ; 61 1e738: 2c ad ldd r18, Y+60 ; 0x3c 1e73a: 3d ad ldd r19, Y+61 ; 0x3d 1e73c: 4e ad ldd r20, Y+62 ; 0x3e 1e73e: 5f ad ldd r21, Y+63 ; 0x3f 1e740: ed 97 sbiw r28, 0x3d ; 61 1e742: c7 01 movw r24, r14 1e744: b6 01 movw r22, r12 1e746: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e74a: c7 57 subi r28, 0x77 ; 119 1e74c: df 4f sbci r29, 0xFF ; 255 1e74e: 68 83 st Y, r22 1e750: 79 83 std Y+1, r23 ; 0x01 1e752: 8a 83 std Y+2, r24 ; 0x02 1e754: 9b 83 std Y+3, r25 ; 0x03 1e756: c9 58 subi r28, 0x89 ; 137 1e758: d0 40 sbci r29, 0x00 ; 0 1e75a: c3 58 subi r28, 0x83 ; 131 1e75c: df 4f sbci r29, 0xFF ; 255 1e75e: 28 81 ld r18, Y 1e760: 39 81 ldd r19, Y+1 ; 0x01 1e762: 4a 81 ldd r20, Y+2 ; 0x02 1e764: 5b 81 ldd r21, Y+3 ; 0x03 1e766: cd 57 subi r28, 0x7D ; 125 1e768: d0 40 sbci r29, 0x00 ; 0 1e76a: c3 01 movw r24, r6 1e76c: b2 01 movw r22, r4 1e76e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e772: 9b 01 movw r18, r22 1e774: ac 01 movw r20, r24 1e776: c7 57 subi r28, 0x77 ; 119 1e778: df 4f sbci r29, 0xFF ; 255 1e77a: 68 81 ld r22, Y 1e77c: 79 81 ldd r23, Y+1 ; 0x01 1e77e: 8a 81 ldd r24, Y+2 ; 0x02 1e780: 9b 81 ldd r25, Y+3 ; 0x03 1e782: c9 58 subi r28, 0x89 ; 137 1e784: d0 40 sbci r29, 0x00 ; 0 1e786: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e78a: cf 57 subi r28, 0x7F ; 127 1e78c: df 4f sbci r29, 0xFF ; 255 1e78e: 28 81 ld r18, Y 1e790: 39 81 ldd r19, Y+1 ; 0x01 1e792: 4a 81 ldd r20, Y+2 ; 0x02 1e794: 5b 81 ldd r21, Y+3 ; 0x03 1e796: c1 58 subi r28, 0x81 ; 129 1e798: d0 40 sbci r29, 0x00 ; 0 1e79a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e79e: 9b 01 movw r18, r22 1e7a0: 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; 1e7a2: c5 01 movw r24, r10 1e7a4: b4 01 movw r22, r8 1e7a6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e7aa: 4b 01 movw r8, r22 1e7ac: 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]; 1e7ae: a7 01 movw r20, r14 1e7b0: 96 01 movw r18, r12 1e7b2: ae 96 adiw r28, 0x2e ; 46 1e7b4: 6c ad ldd r22, Y+60 ; 0x3c 1e7b6: 7d ad ldd r23, Y+61 ; 0x3d 1e7b8: 8e ad ldd r24, Y+62 ; 0x3e 1e7ba: 9f ad ldd r25, Y+63 ; 0x3f 1e7bc: ae 97 sbiw r28, 0x2e ; 46 1e7be: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e7c2: 6b 01 movw r12, r22 1e7c4: 7c 01 movw r14, r24 1e7c6: a3 01 movw r20, r6 1e7c8: 92 01 movw r18, r4 1e7ca: e9 96 adiw r28, 0x39 ; 57 1e7cc: 6c ad ldd r22, Y+60 ; 0x3c 1e7ce: 7d ad ldd r23, Y+61 ; 0x3d 1e7d0: 8e ad ldd r24, Y+62 ; 0x3e 1e7d2: 9f ad ldd r25, Y+63 ; 0x3f 1e7d4: e9 97 sbiw r28, 0x39 ; 57 1e7d6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e7da: 9b 01 movw r18, r22 1e7dc: ac 01 movw r20, r24 1e7de: c7 01 movw r24, r14 1e7e0: b6 01 movw r22, r12 1e7e2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e7e6: e4 96 adiw r28, 0x34 ; 52 1e7e8: 2c ad ldd r18, Y+60 ; 0x3c 1e7ea: 3d ad ldd r19, Y+61 ; 0x3d 1e7ec: 4e ad ldd r20, Y+62 ; 0x3e 1e7ee: 5f ad ldd r21, Y+63 ; 0x3f 1e7f0: e4 97 sbiw r28, 0x34 ; 52 1e7f2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e7f6: 9b 01 movw r18, r22 1e7f8: 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; 1e7fa: cb 57 subi r28, 0x7B ; 123 1e7fc: df 4f sbci r29, 0xFF ; 255 1e7fe: 68 81 ld r22, Y 1e800: 79 81 ldd r23, Y+1 ; 0x01 1e802: 8a 81 ldd r24, Y+2 ; 0x02 1e804: 9b 81 ldd r25, Y+3 ; 0x03 1e806: c5 58 subi r28, 0x85 ; 133 1e808: d0 40 sbci r29, 0x00 ; 0 1e80a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1e80e: a5 01 movw r20, r10 1e810: 94 01 movw r18, r8 1e812: 0f 94 d3 e0 call 0x3c1a6 ; 0x3c1a6 } 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) { 1e816: 2d ec ldi r18, 0xCD ; 205 1e818: 3c ec ldi r19, 0xCC ; 204 1e81a: 4c e4 ldi r20, 0x4C ; 76 1e81c: 5f e3 ldi r21, 0x3F ; 63 1e81e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1e822: 18 16 cp r1, r24 1e824: 0c f4 brge .+2 ; 0x1e828 result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1e826: 1e ef ldi r17, 0xFE ; 254 1e828: 38 e0 ldi r19, 0x08 ; 8 1e82a: 23 0e add r2, r19 1e82c: 31 1c adc r3, r1 1e82e: 6c 96 adiw r28, 0x1c ; 28 1e830: 4e ad ldd r20, Y+62 ; 0x3e 1e832: 5f ad ldd r21, Y+63 ; 0x3f 1e834: 6c 97 sbiw r28, 0x1c ; 28 1e836: 48 5f subi r20, 0xF8 ; 248 1e838: 5f 4f sbci r21, 0xFF ; 255 1e83a: 6c 96 adiw r28, 0x1c ; 28 1e83c: 5f af std Y+63, r21 ; 0x3f 1e83e: 4e af std Y+62, r20 ; 0x3e 1e840: 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) { 1e842: a8 96 adiw r28, 0x28 ; 40 1e844: 8e ad ldd r24, Y+62 ; 0x3e 1e846: 9f ad ldd r25, Y+63 ; 0x3f 1e848: a8 97 sbiw r28, 0x28 ; 40 1e84a: 82 15 cp r24, r2 1e84c: 93 05 cpc r25, r3 1e84e: 09 f0 breq .+2 ; 0x1e852 1e850: 50 cf rjmp .-352 ; 0x1e6f2 MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1e852: 11 11 cpse r17, r1 1e854: 62 c1 rjmp .+708 ; 0x1eb1a #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); 1e856: a2 96 adiw r28, 0x22 ; 34 1e858: 2c ad ldd r18, Y+60 ; 0x3c 1e85a: 3d ad ldd r19, Y+61 ; 0x3d 1e85c: 4e ad ldd r20, Y+62 ; 0x3e 1e85e: 5f ad ldd r21, Y+63 ; 0x3f 1e860: a2 97 sbiw r28, 0x22 ; 34 1e862: a6 96 adiw r28, 0x26 ; 38 1e864: 6c ad ldd r22, Y+60 ; 0x3c 1e866: 7d ad ldd r23, Y+61 ; 0x3d 1e868: 8e ad ldd r24, Y+62 ; 0x3e 1e86a: 9f ad ldd r25, Y+63 ; 0x3f 1e86c: a6 97 sbiw r28, 0x26 ; 38 1e86e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e872: 20 e0 ldi r18, 0x00 ; 0 1e874: 30 e0 ldi r19, 0x00 ; 0 1e876: 40 e0 ldi r20, 0x00 ; 0 1e878: 5f e3 ldi r21, 0x3F ; 63 1e87a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e87e: 6b 01 movw r12, r22 1e880: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1e882: 0f 94 31 df call 0x3be62 ; 0x3be62 1e886: a2 96 adiw r28, 0x22 ; 34 1e888: 6c af std Y+60, r22 ; 0x3c 1e88a: 7d af std Y+61, r23 ; 0x3d 1e88c: 8e af std Y+62, r24 ; 0x3e 1e88e: 9f af std Y+63, r25 ; 0x3f 1e890: a2 97 sbiw r28, 0x22 ; 34 1e892: 60 93 be 13 sts 0x13BE, r22 ; 0x8013be 1e896: 70 93 bf 13 sts 0x13BF, r23 ; 0x8013bf 1e89a: 80 93 c0 13 sts 0x13C0, r24 ; 0x8013c0 1e89e: 90 93 c1 13 sts 0x13C1, r25 ; 0x8013c1 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1e8a2: c7 01 movw r24, r14 1e8a4: b6 01 movw r22, r12 1e8a6: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 1e8aa: a6 96 adiw r28, 0x26 ; 38 1e8ac: 6c af std Y+60, r22 ; 0x3c 1e8ae: 7d af std Y+61, r23 ; 0x3d 1e8b0: 8e af std Y+62, r24 ; 0x3e 1e8b2: 9f af std Y+63, r25 ; 0x3f 1e8b4: a6 97 sbiw r28, 0x26 ; 38 1e8b6: 60 93 c2 13 sts 0x13C2, r22 ; 0x8013c2 1e8ba: 70 93 c3 13 sts 0x13C3, r23 ; 0x8013c3 1e8be: 80 93 c4 13 sts 0x13C4, r24 ; 0x8013c4 1e8c2: 90 93 c5 13 sts 0x13C5, r25 ; 0x8013c5 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1e8c6: 9b 01 movw r18, r22 1e8c8: ac 01 movw r20, r24 1e8ca: 50 58 subi r21, 0x80 ; 128 1e8cc: aa 96 adiw r28, 0x2a ; 42 1e8ce: 2c af std Y+60, r18 ; 0x3c 1e8d0: 3d af std Y+61, r19 ; 0x3d 1e8d2: 4e af std Y+62, r20 ; 0x3e 1e8d4: 5f af std Y+63, r21 ; 0x3f 1e8d6: aa 97 sbiw r28, 0x2a ; 42 1e8d8: 20 93 c6 13 sts 0x13C6, r18 ; 0x8013c6 1e8dc: 30 93 c7 13 sts 0x13C7, r19 ; 0x8013c7 1e8e0: 40 93 c8 13 sts 0x13C8, r20 ; 0x8013c8 1e8e4: 50 93 c9 13 sts 0x13C9, r21 ; 0x8013c9 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1e8e8: a2 96 adiw r28, 0x22 ; 34 1e8ea: 8c ad ldd r24, Y+60 ; 0x3c 1e8ec: 9d ad ldd r25, Y+61 ; 0x3d 1e8ee: ae ad ldd r26, Y+62 ; 0x3e 1e8f0: bf ad ldd r27, Y+63 ; 0x3f 1e8f2: a2 97 sbiw r28, 0x22 ; 34 1e8f4: 80 93 ca 13 sts 0x13CA, r24 ; 0x8013ca 1e8f8: 90 93 cb 13 sts 0x13CB, r25 ; 0x8013cb 1e8fc: a0 93 cc 13 sts 0x13CC, r26 ; 0x8013cc 1e900: b0 93 cd 13 sts 0x13CD, r27 ; 0x8013cd // Refresh the offset. cntr[0] = 0.f; 1e904: 10 92 ce 13 sts 0x13CE, r1 ; 0x8013ce 1e908: 10 92 cf 13 sts 0x13CF, r1 ; 0x8013cf 1e90c: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 1e910: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 cntr[1] = 0.f; 1e914: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 1e918: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1e91c: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 1e920: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 float wx = 0.f; 1e924: 41 2c mov r4, r1 1e926: 51 2c mov r5, r1 1e928: 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]; 1e92a: cf 56 subi r28, 0x6F ; 111 1e92c: df 4f sbci r29, 0xFF ; 255 1e92e: a8 81 ld r26, Y 1e930: b9 81 ldd r27, Y+1 ; 0x01 1e932: c1 59 subi r28, 0x91 ; 145 1e934: d0 40 sbci r29, 0x00 ; 0 1e936: 11 96 adiw r26, 0x01 ; 1 1e938: 8d 90 ld r8, X+ 1e93a: 9d 90 ld r9, X+ 1e93c: ad 90 ld r10, X+ 1e93e: bc 90 ld r11, X 1e940: 14 97 sbiw r26, 0x04 ; 4 1e942: 15 96 adiw r26, 0x05 ; 5 1e944: 2d 91 ld r18, X+ 1e946: 3d 91 ld r19, X+ 1e948: 4d 91 ld r20, X+ 1e94a: 5c 91 ld r21, X 1e94c: 18 97 sbiw r26, 0x08 ; 8 1e94e: 6e 96 adiw r28, 0x1e ; 30 1e950: 2c af std Y+60, r18 ; 0x3c 1e952: 3d af std Y+61, r19 ; 0x3d 1e954: 4e af std Y+62, r20 ; 0x3e 1e956: 5f af std Y+63, r21 ; 0x3f 1e958: 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); 1e95a: cd 56 subi r28, 0x6D ; 109 1e95c: df 4f sbci r29, 0xFF ; 255 1e95e: e8 81 ld r30, Y 1e960: f9 81 ldd r31, Y+1 ; 0x01 1e962: c3 59 subi r28, 0x93 ; 147 1e964: d0 40 sbci r29, 0x00 ; 0 1e966: c5 90 lpm r12, Z+ 1e968: d5 90 lpm r13, Z+ 1e96a: e5 90 lpm r14, Z+ 1e96c: 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]; 1e96e: a5 01 movw r20, r10 1e970: 94 01 movw r18, r8 1e972: a2 96 adiw r28, 0x22 ; 34 1e974: 6c ad ldd r22, Y+60 ; 0x3c 1e976: 7d ad ldd r23, Y+61 ; 0x3d 1e978: 8e ad ldd r24, Y+62 ; 0x3e 1e97a: 9f ad ldd r25, Y+63 ; 0x3f 1e97c: a2 97 sbiw r28, 0x22 ; 34 1e97e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e982: ae 96 adiw r28, 0x2e ; 46 1e984: 6c af std Y+60, r22 ; 0x3c 1e986: 7d af std Y+61, r23 ; 0x3d 1e988: 8e af std Y+62, r24 ; 0x3e 1e98a: 9f af std Y+63, r25 ; 0x3f 1e98c: ae 97 sbiw r28, 0x2e ; 46 1e98e: 6e 96 adiw r28, 0x1e ; 30 1e990: 2c ad ldd r18, Y+60 ; 0x3c 1e992: 3d ad ldd r19, Y+61 ; 0x3d 1e994: 4e ad ldd r20, Y+62 ; 0x3e 1e996: 5f ad ldd r21, Y+63 ; 0x3f 1e998: 6e 97 sbiw r28, 0x1e ; 30 1e99a: aa 96 adiw r28, 0x2a ; 42 1e99c: 6c ad ldd r22, Y+60 ; 0x3c 1e99e: 7d ad ldd r23, Y+61 ; 0x3d 1e9a0: 8e ad ldd r24, Y+62 ; 0x3e 1e9a2: 9f ad ldd r25, Y+63 ; 0x3f 1e9a4: aa 97 sbiw r28, 0x2a ; 42 1e9a6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1e9aa: 9b 01 movw r18, r22 1e9ac: ac 01 movw r20, r24 1e9ae: ae 96 adiw r28, 0x2e ; 46 1e9b0: 6c ad ldd r22, Y+60 ; 0x3c 1e9b2: 7d ad ldd r23, Y+61 ; 0x3d 1e9b4: 8e ad ldd r24, Y+62 ; 0x3e 1e9b6: 9f ad ldd r25, Y+63 ; 0x3f 1e9b8: ae 97 sbiw r28, 0x2e ; 46 1e9ba: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e9be: 9b 01 movw r18, r22 1e9c0: 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); 1e9c2: c7 01 movw r24, r14 1e9c4: b6 01 movw r22, r12 1e9c6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1e9ca: 20 91 ce 13 lds r18, 0x13CE ; 0x8013ce 1e9ce: 30 91 cf 13 lds r19, 0x13CF ; 0x8013cf 1e9d2: 40 91 d0 13 lds r20, 0x13D0 ; 0x8013d0 1e9d6: 50 91 d1 13 lds r21, 0x13D1 ; 0x8013d1 1e9da: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1e9de: 6b 01 movw r12, r22 1e9e0: 7c 01 movw r14, r24 1e9e2: c0 92 ce 13 sts 0x13CE, r12 ; 0x8013ce 1e9e6: d0 92 cf 13 sts 0x13CF, r13 ; 0x8013cf 1e9ea: e0 92 d0 13 sts 0x13D0, r14 ; 0x8013d0 1e9ee: f0 92 d1 13 sts 0x13D1, r15 ; 0x8013d1 wx += w; 1e9f2: 20 e0 ldi r18, 0x00 ; 0 1e9f4: 30 e0 ldi r19, 0x00 ; 0 1e9f6: 40 e8 ldi r20, 0x80 ; 128 1e9f8: 5f e3 ldi r21, 0x3F ; 63 1e9fa: c3 01 movw r24, r6 1e9fc: b2 01 movw r22, r4 1e9fe: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1ea02: 2b 01 movw r4, r22 1ea04: 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); 1ea06: cd 56 subi r28, 0x6D ; 109 1ea08: df 4f sbci r29, 0xFF ; 255 1ea0a: e8 81 ld r30, Y 1ea0c: f9 81 ldd r31, Y+1 ; 0x01 1ea0e: c3 59 subi r28, 0x93 ; 147 1ea10: d0 40 sbci r29, 0x00 ; 0 1ea12: 34 96 adiw r30, 0x04 ; 4 1ea14: 25 91 lpm r18, Z+ 1ea16: 35 91 lpm r19, Z+ 1ea18: 45 91 lpm r20, Z+ 1ea1a: 54 91 lpm r21, Z 1ea1c: ae 96 adiw r28, 0x2e ; 46 1ea1e: 2c af std Y+60, r18 ; 0x3c 1ea20: 3d af std Y+61, r19 ; 0x3d 1ea22: 4e af std Y+62, r20 ; 0x3e 1ea24: 5f af std Y+63, r21 ; 0x3f 1ea26: 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]; 1ea28: a5 01 movw r20, r10 1ea2a: 94 01 movw r18, r8 1ea2c: a6 96 adiw r28, 0x26 ; 38 1ea2e: 6c ad ldd r22, Y+60 ; 0x3c 1ea30: 7d ad ldd r23, Y+61 ; 0x3d 1ea32: 8e ad ldd r24, Y+62 ; 0x3e 1ea34: 9f ad ldd r25, Y+63 ; 0x3f 1ea36: a6 97 sbiw r28, 0x26 ; 38 1ea38: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ea3c: 4b 01 movw r8, r22 1ea3e: 5c 01 movw r10, r24 1ea40: 6e 96 adiw r28, 0x1e ; 30 1ea42: 2c ad ldd r18, Y+60 ; 0x3c 1ea44: 3d ad ldd r19, Y+61 ; 0x3d 1ea46: 4e ad ldd r20, Y+62 ; 0x3e 1ea48: 5f ad ldd r21, Y+63 ; 0x3f 1ea4a: 6e 97 sbiw r28, 0x1e ; 30 1ea4c: a2 96 adiw r28, 0x22 ; 34 1ea4e: 6c ad ldd r22, Y+60 ; 0x3c 1ea50: 7d ad ldd r23, Y+61 ; 0x3d 1ea52: 8e ad ldd r24, Y+62 ; 0x3e 1ea54: 9f ad ldd r25, Y+63 ; 0x3f 1ea56: a2 97 sbiw r28, 0x22 ; 34 1ea58: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ea5c: 9b 01 movw r18, r22 1ea5e: ac 01 movw r20, r24 1ea60: c5 01 movw r24, r10 1ea62: b4 01 movw r22, r8 1ea64: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1ea68: 9b 01 movw r18, r22 1ea6a: 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); 1ea6c: ae 96 adiw r28, 0x2e ; 46 1ea6e: 6c ad ldd r22, Y+60 ; 0x3c 1ea70: 7d ad ldd r23, Y+61 ; 0x3d 1ea72: 8e ad ldd r24, Y+62 ; 0x3e 1ea74: 9f ad ldd r25, Y+63 ; 0x3f 1ea76: ae 97 sbiw r28, 0x2e ; 46 1ea78: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1ea7c: 20 91 d2 13 lds r18, 0x13D2 ; 0x8013d2 1ea80: 30 91 d3 13 lds r19, 0x13D3 ; 0x8013d3 1ea84: 40 91 d4 13 lds r20, 0x13D4 ; 0x8013d4 1ea88: 50 91 d5 13 lds r21, 0x13D5 ; 0x8013d5 1ea8c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1ea90: 4b 01 movw r8, r22 1ea92: 5c 01 movw r10, r24 1ea94: 80 92 d2 13 sts 0x13D2, r8 ; 0x8013d2 1ea98: 90 92 d3 13 sts 0x13D3, r9 ; 0x8013d3 1ea9c: a0 92 d4 13 sts 0x13D4, r10 ; 0x8013d4 1eaa0: b0 92 d5 13 sts 0x13D5, r11 ; 0x8013d5 1eaa4: cf 56 subi r28, 0x6F ; 111 1eaa6: df 4f sbci r29, 0xFF ; 255 1eaa8: 48 81 ld r20, Y 1eaaa: 59 81 ldd r21, Y+1 ; 0x01 1eaac: c1 59 subi r28, 0x91 ; 145 1eaae: d0 40 sbci r29, 0x00 ; 0 1eab0: 48 5f subi r20, 0xF8 ; 248 1eab2: 5f 4f sbci r21, 0xFF ; 255 1eab4: cf 56 subi r28, 0x6F ; 111 1eab6: df 4f sbci r29, 0xFF ; 255 1eab8: 59 83 std Y+1, r21 ; 0x01 1eaba: 48 83 st Y, r20 1eabc: c1 59 subi r28, 0x91 ; 145 1eabe: d0 40 sbci r29, 0x00 ; 0 1eac0: cd 56 subi r28, 0x6D ; 109 1eac2: df 4f sbci r29, 0xFF ; 255 1eac4: 88 81 ld r24, Y 1eac6: 99 81 ldd r25, Y+1 ; 0x01 1eac8: c3 59 subi r28, 0x93 ; 147 1eaca: d0 40 sbci r29, 0x00 ; 0 1eacc: 08 96 adiw r24, 0x08 ; 8 1eace: cd 56 subi r28, 0x6D ; 109 1ead0: df 4f sbci r29, 0xFF ; 255 1ead2: 99 83 std Y+1, r25 ; 0x01 1ead4: 88 83 st Y, r24 1ead6: c3 59 subi r28, 0x93 ; 147 1ead8: 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) { 1eada: 24 16 cp r2, r20 1eadc: 35 06 cpc r3, r21 1eade: 09 f0 breq .+2 ; 0x1eae2 1eae0: 24 cf rjmp .-440 ; 0x1e92a SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1eae2: a3 01 movw r20, r6 1eae4: 92 01 movw r18, r4 1eae6: c7 01 movw r24, r14 1eae8: b6 01 movw r22, r12 1eaea: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1eaee: 60 93 ce 13 sts 0x13CE, r22 ; 0x8013ce 1eaf2: 70 93 cf 13 sts 0x13CF, r23 ; 0x8013cf 1eaf6: 80 93 d0 13 sts 0x13D0, r24 ; 0x8013d0 1eafa: 90 93 d1 13 sts 0x13D1, r25 ; 0x8013d1 cntr[1] /= wy; 1eafe: a3 01 movw r20, r6 1eb00: 92 01 movw r18, r4 1eb02: c5 01 movw r24, r10 1eb04: b4 01 movw r22, r8 1eb06: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1eb0a: 60 93 d2 13 sts 0x13D2, r22 ; 0x8013d2 1eb0e: 70 93 d3 13 sts 0x13D3, r23 ; 0x8013d3 1eb12: 80 93 d4 13 sts 0x13D4, r24 ; 0x8013d4 1eb16: 90 93 d5 13 sts 0x13D5, r25 ; 0x8013d5 #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]; 1eb1a: 40 90 be 13 lds r4, 0x13BE ; 0x8013be 1eb1e: 50 90 bf 13 lds r5, 0x13BF ; 0x8013bf 1eb22: 60 90 c0 13 lds r6, 0x13C0 ; 0x8013c0 1eb26: 70 90 c1 13 lds r7, 0x13C1 ; 0x8013c1 1eb2a: c0 90 ca 13 lds r12, 0x13CA ; 0x8013ca 1eb2e: d0 90 cb 13 lds r13, 0x13CB ; 0x8013cb 1eb32: e0 90 cc 13 lds r14, 0x13CC ; 0x8013cc 1eb36: f0 90 cd 13 lds r15, 0x13CD ; 0x8013cd 1eb3a: 20 91 c2 13 lds r18, 0x13C2 ; 0x8013c2 1eb3e: 30 91 c3 13 lds r19, 0x13C3 ; 0x8013c3 1eb42: 40 91 c4 13 lds r20, 0x13C4 ; 0x8013c4 1eb46: 50 91 c5 13 lds r21, 0x13C5 ; 0x8013c5 1eb4a: a2 96 adiw r28, 0x22 ; 34 1eb4c: 2c af std Y+60, r18 ; 0x3c 1eb4e: 3d af std Y+61, r19 ; 0x3d 1eb50: 4e af std Y+62, r20 ; 0x3e 1eb52: 5f af std Y+63, r21 ; 0x3f 1eb54: a2 97 sbiw r28, 0x22 ; 34 1eb56: 80 91 c6 13 lds r24, 0x13C6 ; 0x8013c6 1eb5a: 90 91 c7 13 lds r25, 0x13C7 ; 0x8013c7 1eb5e: a0 91 c8 13 lds r26, 0x13C8 ; 0x8013c8 1eb62: b0 91 c9 13 lds r27, 0x13C9 ; 0x8013c9 1eb66: a6 96 adiw r28, 0x26 ; 38 1eb68: 8c af std Y+60, r24 ; 0x3c 1eb6a: 9d af std Y+61, r25 ; 0x3d 1eb6c: ae af std Y+62, r26 ; 0x3e 1eb6e: bf af std Y+63, r27 ; 0x3f 1eb70: a6 97 sbiw r28, 0x26 ; 38 1eb72: a7 01 movw r20, r14 1eb74: 96 01 movw r18, r12 1eb76: c3 01 movw r24, r6 1eb78: b2 01 movw r22, r4 1eb7a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1eb7e: 4b 01 movw r8, r22 1eb80: 5c 01 movw r10, r24 1eb82: a6 96 adiw r28, 0x26 ; 38 1eb84: 2c ad ldd r18, Y+60 ; 0x3c 1eb86: 3d ad ldd r19, Y+61 ; 0x3d 1eb88: 4e ad ldd r20, Y+62 ; 0x3e 1eb8a: 5f ad ldd r21, Y+63 ; 0x3f 1eb8c: a6 97 sbiw r28, 0x26 ; 38 1eb8e: a2 96 adiw r28, 0x22 ; 34 1eb90: 6c ad ldd r22, Y+60 ; 0x3c 1eb92: 7d ad ldd r23, Y+61 ; 0x3d 1eb94: 8e ad ldd r24, Y+62 ; 0x3e 1eb96: 9f ad ldd r25, Y+63 ; 0x3f 1eb98: a2 97 sbiw r28, 0x22 ; 34 1eb9a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1eb9e: 9b 01 movw r18, r22 1eba0: ac 01 movw r20, r24 1eba2: c5 01 movw r24, r10 1eba4: b4 01 movw r22, r8 1eba6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 1ebaa: 4b 01 movw r8, r22 1ebac: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1ebae: ac 01 movw r20, r24 1ebb0: 9b 01 movw r18, r22 1ebb2: c7 01 movw r24, r14 1ebb4: b6 01 movw r22, r12 1ebb6: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1ebba: 6b 01 movw r12, r22 1ebbc: 7c 01 movw r14, r24 1ebbe: a6 96 adiw r28, 0x26 ; 38 1ebc0: 6c ad ldd r22, Y+60 ; 0x3c 1ebc2: 7d ad ldd r23, Y+61 ; 0x3d 1ebc4: 8e ad ldd r24, Y+62 ; 0x3e 1ebc6: 9f ad ldd r25, Y+63 ; 0x3f 1ebc8: a6 97 sbiw r28, 0x26 ; 38 1ebca: 90 58 subi r25, 0x80 ; 128 1ebcc: a5 01 movw r20, r10 1ebce: 94 01 movw r18, r8 1ebd0: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1ebd4: a6 96 adiw r28, 0x26 ; 38 1ebd6: 6c af std Y+60, r22 ; 0x3c 1ebd8: 7d af std Y+61, r23 ; 0x3d 1ebda: 8e af std Y+62, r24 ; 0x3e 1ebdc: 9f af std Y+63, r25 ; 0x3f 1ebde: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1ebe0: a2 96 adiw r28, 0x22 ; 34 1ebe2: 6c ad ldd r22, Y+60 ; 0x3c 1ebe4: 7d ad ldd r23, Y+61 ; 0x3d 1ebe6: 8e ad ldd r24, Y+62 ; 0x3e 1ebe8: 9f ad ldd r25, Y+63 ; 0x3f 1ebea: a2 97 sbiw r28, 0x22 ; 34 1ebec: 90 58 subi r25, 0x80 ; 128 1ebee: a5 01 movw r20, r10 1ebf0: 94 01 movw r18, r8 1ebf2: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1ebf6: aa 96 adiw r28, 0x2a ; 42 1ebf8: 6c af std Y+60, r22 ; 0x3c 1ebfa: 7d af std Y+61, r23 ; 0x3d 1ebfc: 8e af std Y+62, r24 ; 0x3e 1ebfe: 9f af std Y+63, r25 ; 0x3f 1ec00: aa 97 sbiw r28, 0x2a ; 42 1ec02: a5 01 movw r20, r10 1ec04: 94 01 movw r18, r8 1ec06: c3 01 movw r24, r6 1ec08: b2 01 movw r22, r4 1ec0a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 1ec0e: 4b 01 movw r8, r22 1ec10: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ec12: 40 90 ce 13 lds r4, 0x13CE ; 0x8013ce 1ec16: 50 90 cf 13 lds r5, 0x13CF ; 0x8013cf 1ec1a: 60 90 d0 13 lds r6, 0x13D0 ; 0x8013d0 1ec1e: 70 90 d1 13 lds r7, 0x13D1 ; 0x8013d1 1ec22: 20 91 d2 13 lds r18, 0x13D2 ; 0x8013d2 1ec26: 30 91 d3 13 lds r19, 0x13D3 ; 0x8013d3 1ec2a: 40 91 d4 13 lds r20, 0x13D4 ; 0x8013d4 1ec2e: 50 91 d5 13 lds r21, 0x13D5 ; 0x8013d5 1ec32: a2 96 adiw r28, 0x22 ; 34 1ec34: 2c af std Y+60, r18 ; 0x3c 1ec36: 3d af std Y+61, r19 ; 0x3d 1ec38: 4e af std Y+62, r20 ; 0x3e 1ec3a: 5f af std Y+63, r21 ; 0x3f 1ec3c: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1ec3e: c0 92 be 13 sts 0x13BE, r12 ; 0x8013be 1ec42: d0 92 bf 13 sts 0x13BF, r13 ; 0x8013bf 1ec46: e0 92 c0 13 sts 0x13C0, r14 ; 0x8013c0 1ec4a: f0 92 c1 13 sts 0x13C1, r15 ; 0x8013c1 vec_x[1] = Ainv[1][0]; 1ec4e: aa 96 adiw r28, 0x2a ; 42 1ec50: 8c ad ldd r24, Y+60 ; 0x3c 1ec52: 9d ad ldd r25, Y+61 ; 0x3d 1ec54: ae ad ldd r26, Y+62 ; 0x3e 1ec56: bf ad ldd r27, Y+63 ; 0x3f 1ec58: aa 97 sbiw r28, 0x2a ; 42 1ec5a: 80 93 c2 13 sts 0x13C2, r24 ; 0x8013c2 1ec5e: 90 93 c3 13 sts 0x13C3, r25 ; 0x8013c3 1ec62: a0 93 c4 13 sts 0x13C4, r26 ; 0x8013c4 1ec66: b0 93 c5 13 sts 0x13C5, r27 ; 0x8013c5 vec_y[0] = Ainv[0][1]; 1ec6a: a6 96 adiw r28, 0x26 ; 38 1ec6c: 2c ad ldd r18, Y+60 ; 0x3c 1ec6e: 3d ad ldd r19, Y+61 ; 0x3d 1ec70: 4e ad ldd r20, Y+62 ; 0x3e 1ec72: 5f ad ldd r21, Y+63 ; 0x3f 1ec74: a6 97 sbiw r28, 0x26 ; 38 1ec76: 20 93 c6 13 sts 0x13C6, r18 ; 0x8013c6 1ec7a: 30 93 c7 13 sts 0x13C7, r19 ; 0x8013c7 1ec7e: 40 93 c8 13 sts 0x13C8, r20 ; 0x8013c8 1ec82: 50 93 c9 13 sts 0x13C9, r21 ; 0x8013c9 vec_y[1] = Ainv[1][1]; 1ec86: 80 92 ca 13 sts 0x13CA, r8 ; 0x8013ca 1ec8a: 90 92 cb 13 sts 0x13CB, r9 ; 0x8013cb 1ec8e: a0 92 cc 13 sts 0x13CC, r10 ; 0x8013cc 1ec92: b0 92 cd 13 sts 0x13CD, r11 ; 0x8013cd 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], 1ec96: c7 01 movw r24, r14 1ec98: b6 01 movw r22, r12 1ec9a: 90 58 subi r25, 0x80 ; 128 1ec9c: a3 01 movw r20, r6 1ec9e: 92 01 movw r18, r4 1eca0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1eca4: 6b 01 movw r12, r22 1eca6: 7c 01 movw r14, r24 1eca8: a2 96 adiw r28, 0x22 ; 34 1ecaa: 2c ad ldd r18, Y+60 ; 0x3c 1ecac: 3d ad ldd r19, Y+61 ; 0x3d 1ecae: 4e ad ldd r20, Y+62 ; 0x3e 1ecb0: 5f ad ldd r21, Y+63 ; 0x3f 1ecb2: a2 97 sbiw r28, 0x22 ; 34 1ecb4: a6 96 adiw r28, 0x26 ; 38 1ecb6: 6c ad ldd r22, Y+60 ; 0x3c 1ecb8: 7d ad ldd r23, Y+61 ; 0x3d 1ecba: 8e ad ldd r24, Y+62 ; 0x3e 1ecbc: 9f ad ldd r25, Y+63 ; 0x3f 1ecbe: a6 97 sbiw r28, 0x26 ; 38 1ecc0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ecc4: 9b 01 movw r18, r22 1ecc6: ac 01 movw r20, r24 1ecc8: c7 01 movw r24, r14 1ecca: b6 01 movw r22, r12 1eccc: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__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]; 1ecd0: 60 93 ce 13 sts 0x13CE, r22 ; 0x8013ce 1ecd4: 70 93 cf 13 sts 0x13CF, r23 ; 0x8013cf 1ecd8: 80 93 d0 13 sts 0x13D0, r24 ; 0x8013d0 1ecdc: 90 93 d1 13 sts 0x13D1, r25 ; 0x8013d1 { 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] 1ece0: aa 96 adiw r28, 0x2a ; 42 1ece2: 6c ad ldd r22, Y+60 ; 0x3c 1ece4: 7d ad ldd r23, Y+61 ; 0x3d 1ece6: 8e ad ldd r24, Y+62 ; 0x3e 1ece8: 9f ad ldd r25, Y+63 ; 0x3f 1ecea: aa 97 sbiw r28, 0x2a ; 42 1ecec: 90 58 subi r25, 0x80 ; 128 1ecee: a3 01 movw r20, r6 1ecf0: 92 01 movw r18, r4 1ecf2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ecf6: 6b 01 movw r12, r22 1ecf8: 7c 01 movw r14, r24 1ecfa: a2 96 adiw r28, 0x22 ; 34 1ecfc: 2c ad ldd r18, Y+60 ; 0x3c 1ecfe: 3d ad ldd r19, Y+61 ; 0x3d 1ed00: 4e ad ldd r20, Y+62 ; 0x3e 1ed02: 5f ad ldd r21, Y+63 ; 0x3f 1ed04: a2 97 sbiw r28, 0x22 ; 34 1ed06: c5 01 movw r24, r10 1ed08: b4 01 movw r22, r8 1ed0a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1ed0e: 9b 01 movw r18, r22 1ed10: ac 01 movw r20, r24 1ed12: c7 01 movw r24, r14 1ed14: b6 01 movw r22, r12 1ed16: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__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]; 1ed1a: 60 93 d2 13 sts 0x13D2, r22 ; 0x8013d2 1ed1e: 70 93 d3 13 sts 0x13D3, r23 ; 0x8013d3 1ed22: 80 93 d4 13 sts 0x13D4, r24 ; 0x8013d4 1ed26: 90 93 d5 13 sts 0x13D5, r25 ; 0x8013d5 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 1ed2a: 90 e0 ldi r25, 0x00 ; 0 1ed2c: 80 e0 ldi r24, 0x00 ; 0 1ed2e: 0e 94 10 8f call 0x11e20 ; 0x11e20 if (result >= 0) { 1ed32: 17 fd sbrc r17, 7 1ed34: d5 c0 rjmp .+426 ; 0x1eee0 DBG(_n("Calibration success.\n")); 1ed36: 82 e3 ldi r24, 0x32 ; 50 1ed38: 9f e6 ldi r25, 0x6F ; 111 1ed3a: 9f 93 push r25 1ed3c: 8f 93 push r24 1ed3e: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 world2machine_update(vec_x, vec_y, cntr); 1ed42: 4e ec ldi r20, 0xCE ; 206 1ed44: 53 e1 ldi r21, 0x13 ; 19 1ed46: 66 ec ldi r22, 0xC6 ; 198 1ed48: 73 e1 ldi r23, 0x13 ; 19 1ed4a: 8e eb ldi r24, 0xBE ; 190 1ed4c: 93 e1 ldi r25, 0x13 ; 19 1ed4e: 0f 94 ac c9 call 0x39358 ; 0x39358 #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); 1ed52: 48 e0 ldi r20, 0x08 ; 8 1ed54: 50 e0 ldi r21, 0x00 ; 0 1ed56: 65 ee ldi r22, 0xE5 ; 229 1ed58: 7f e0 ldi r23, 0x0F ; 15 1ed5a: 8e ec ldi r24, 0xCE ; 206 1ed5c: 93 e1 ldi r25, 0x13 ; 19 1ed5e: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 1ed62: 48 e0 ldi r20, 0x08 ; 8 1ed64: 50 e0 ldi r21, 0x00 ; 0 1ed66: 6d ed ldi r22, 0xDD ; 221 1ed68: 7f e0 ldi r23, 0x0F ; 15 1ed6a: 8e eb ldi r24, 0xBE ; 190 1ed6c: 93 e1 ldi r25, 0x13 ; 19 1ed6e: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 1ed72: 48 e0 ldi r20, 0x08 ; 8 1ed74: 50 e0 ldi r21, 0x00 ; 0 1ed76: 65 ed ldi r22, 0xD5 ; 213 1ed78: 7f e0 ldi r23, 0x0F ; 15 1ed7a: 86 ec ldi r24, 0xC6 ; 198 1ed7c: 93 e1 ldi r25, 0x13 ; 19 1ed7e: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 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(); 1ed82: 0f 94 31 c9 call 0x39262 ; 0x39262 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1ed86: 0f 90 pop r0 1ed88: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1ed8a: c7 55 subi r28, 0x57 ; 87 1ed8c: df 4f sbci r29, 0xFF ; 255 1ed8e: 88 81 ld r24, Y 1ed90: 99 81 ldd r25, Y+1 ; 0x01 1ed92: c9 5a subi r28, 0xA9 ; 169 1ed94: d0 40 sbci r29, 0x00 ; 0 1ed96: 0e 94 14 68 call 0xd028 ; 0xd028 // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1ed9a: 80 e0 ldi r24, 0x00 ; 0 1ed9c: 90 e0 ldi r25, 0x00 ; 0 1ed9e: a0 ea ldi r26, 0xA0 ; 160 1eda0: b0 e4 ldi r27, 0x40 ; 64 1eda2: 80 93 48 07 sts 0x0748, r24 ; 0x800748 1eda6: 90 93 49 07 sts 0x0749, r25 ; 0x800749 1edaa: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 1edae: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1edb2: 60 e0 ldi r22, 0x00 ; 0 1edb4: 70 e0 ldi r23, 0x00 ; 0 1edb6: 80 ea ldi r24, 0xA0 ; 160 1edb8: 91 e4 ldi r25, 0x41 ; 65 1edba: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 1edbe: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 //#ifndef NEW_XYZCAL if (result >= 0) 1edc2: 17 fd sbrc r17, 7 1edc4: 22 c0 rjmp .+68 ; 0x1ee0a 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; 1edc6: 10 92 48 07 sts 0x0748, r1 ; 0x800748 1edca: 10 92 49 07 sts 0x0749, r1 ; 0x800749 1edce: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a 1edd2: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b destination[Z_AXIS] = 150.F; 1edd6: 80 e0 ldi r24, 0x00 ; 0 1edd8: 90 e0 ldi r25, 0x00 ; 0 1edda: a6 e1 ldi r26, 0x16 ; 22 1eddc: b3 e4 ldi r27, 0x43 ; 67 1edde: 80 93 59 05 sts 0x0559, r24 ; 0x800559 1ede2: 90 93 5a 05 sts 0x055A, r25 ; 0x80055a 1ede6: a0 93 5b 05 sts 0x055B, r26 ; 0x80055b 1edea: b0 93 5c 05 sts 0x055C, r27 ; 0x80055c plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1edee: 65 e5 ldi r22, 0x55 ; 85 1edf0: 75 e5 ldi r23, 0x55 ; 85 1edf2: 85 e5 ldi r24, 0x55 ; 85 1edf4: 91 e4 ldi r25, 0x41 ; 65 1edf6: 0f 94 de b9 call 0x373bc ; 0x373bc lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1edfa: 8a e4 ldi r24, 0x4A ; 74 1edfc: 98 e4 ldi r25, 0x48 ; 72 1edfe: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ee02: 0f 94 d6 34 call 0x269ac ; 0x269ac // 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()) 1ee06: 0f 94 40 c7 call 0x38e80 ; 0x38e80 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1ee0a: 81 e0 ldi r24, 0x01 ; 1 1ee0c: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_update(2); 1ee10: 82 e0 ldi r24, 0x02 ; 2 1ee12: 0e 94 ed 6f call 0xdfda ; 0xdfda 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)); 1ee16: 8b e0 ldi r24, 0x0B ; 11 1ee18: 98 e4 ldi r25, 0x48 ; 72 } 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) { 1ee1a: 1f 3f cpi r17, 0xFF ; 255 1ee1c: 99 f0 breq .+38 ; 0x1ee44 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) { 1ee1e: 1e 3f cpi r17, 0xFE ; 254 1ee20: 09 f0 breq .+2 ; 0x1ee24 1ee22: 73 c0 rjmp .+230 ; 0x1ef0a if (point_too_far_mask == 0) 1ee24: af 96 adiw r28, 0x2f ; 47 1ee26: 4f ad ldd r20, Y+63 ; 0x3f 1ee28: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1ee2a: 86 ed ldi r24, 0xD6 ; 214 1ee2c: 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) 1ee2e: 44 23 and r20, r20 1ee30: 49 f0 breq .+18 ; 0x1ee44 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1ee32: af 96 adiw r28, 0x2f ; 47 1ee34: 5f ad ldd r21, Y+63 ; 0x3f 1ee36: 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); 1ee38: 84 e9 ldi r24, 0x94 ; 148 1ee3a: 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) 1ee3c: 52 30 cpi r21, 0x02 ; 2 1ee3e: 11 f0 breq .+4 ; 0x1ee44 // 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); 1ee40: 8d e4 ldi r24, 0x4D ; 77 1ee42: 97 e4 ldi r25, 0x47 ; 71 1ee44: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ee48: 0c 94 fe e9 jmp 0x1d3fc ; 0x1d3fc (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]) : 1ee4c: f2 01 movw r30, r4 1ee4e: 25 81 ldd r18, Z+5 ; 0x05 1ee50: 36 81 ldd r19, Z+6 ; 0x06 1ee52: 47 81 ldd r20, Z+7 ; 0x07 1ee54: 50 85 ldd r21, Z+8 ; 0x08 1ee56: c3 58 subi r28, 0x83 ; 131 1ee58: df 4f sbci r29, 0xFF ; 255 1ee5a: 68 81 ld r22, Y 1ee5c: 79 81 ldd r23, Y+1 ; 0x01 1ee5e: 8a 81 ldd r24, Y+2 ; 0x02 1ee60: 9b 81 ldd r25, Y+3 ; 0x03 1ee62: cd 57 subi r28, 0x7D ; 125 1ee64: d0 40 sbci r29, 0x00 ; 0 1ee66: 0c 94 60 ee jmp 0x1dcc0 ; 0x1dcc0 // 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]) : 1ee6a: f2 01 movw r30, r4 1ee6c: 25 81 ldd r18, Z+5 ; 0x05 1ee6e: 36 81 ldd r19, Z+6 ; 0x06 1ee70: 47 81 ldd r20, Z+7 ; 0x07 1ee72: 50 85 ldd r21, Z+8 ; 0x08 1ee74: ed 96 adiw r28, 0x3d ; 61 1ee76: 6c ad ldd r22, Y+60 ; 0x3c 1ee78: 7d ad ldd r23, Y+61 ; 0x3d 1ee7a: 8e ad ldd r24, Y+62 ; 0x3e 1ee7c: 9f ad ldd r25, Y+63 ; 0x3f 1ee7e: ed 97 sbiw r28, 0x3d ; 61 1ee80: b8 c0 rjmp .+368 ; 0x1eff2 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1ee82: f2 01 movw r30, r4 1ee84: 25 81 ldd r18, Z+5 ; 0x05 1ee86: 36 81 ldd r19, Z+6 ; 0x06 1ee88: 47 81 ldd r20, Z+7 ; 0x07 1ee8a: 50 85 ldd r21, Z+8 ; 0x08 1ee8c: ed 96 adiw r28, 0x3d ; 61 1ee8e: 6c ad ldd r22, Y+60 ; 0x3c 1ee90: 7d ad ldd r23, Y+61 ; 0x3d 1ee92: 8e ad ldd r24, Y+62 ; 0x3e 1ee94: 9f ad ldd r25, Y+63 ; 0x3f 1ee96: ed 97 sbiw r28, 0x3d ; 61 1ee98: c6 c0 rjmp .+396 ; 0x1f026 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]) : 1ee9a: a3 01 movw r20, r6 1ee9c: 92 01 movw r18, r4 1ee9e: c3 58 subi r28, 0x83 ; 131 1eea0: df 4f sbci r29, 0xFF ; 255 1eea2: 68 81 ld r22, Y 1eea4: 79 81 ldd r23, Y+1 ; 0x01 1eea6: 8a 81 ldd r24, Y+2 ; 0x02 1eea8: 9b 81 ldd r25, Y+3 ; 0x03 1eeaa: cd 57 subi r28, 0x7D ; 125 1eeac: d0 40 sbci r29, 0x00 ; 0 1eeae: 0c 94 c8 ee jmp 0x1dd90 ; 0x1dd90 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1eeb2: 81 2c mov r8, r1 1eeb4: 91 2c mov r9, r1 1eeb6: 20 e8 ldi r18, 0x80 ; 128 1eeb8: a2 2e mov r10, r18 1eeba: 2f e3 ldi r18, 0x3F ; 63 1eebc: b2 2e mov r11, r18 1eebe: 0c 94 cc ee jmp 0x1dd98 ; 0x1dd98 float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1eec2: c1 2c mov r12, r1 1eec4: d1 2c mov r13, r1 1eec6: 76 01 movw r14, r12 1eec8: 0c 94 43 ef jmp 0x1de86 ; 0x1de86 ((r == 1) ? 1.f : 1eecc: c1 2c mov r12, r1 1eece: d1 2c mov r13, r1 1eed0: 90 e8 ldi r25, 0x80 ; 128 1eed2: e9 2e mov r14, r25 1eed4: 9f e3 ldi r25, 0x3F ; 63 1eed6: f9 2e mov r15, r25 1eed8: 0c 94 43 ef jmp 0x1de86 ; 0x1de86 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; 1eedc: 12 e0 ldi r17, 0x02 ; 2 1eede: a7 cb rjmp .-2226 ; 0x1e62e } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1eee0: 1e 3f cpi r17, 0xFE ; 254 1eee2: 89 f4 brne .+34 ; 0x1ef06 1eee4: af 96 adiw r28, 0x2f ; 47 1eee6: 3f ad ldd r19, Y+63 ; 0x3f 1eee8: af 97 sbiw r28, 0x2f ; 47 1eeea: 32 30 cpi r19, 0x02 ; 2 1eeec: 09 f0 breq .+2 ; 0x1eef0 1eeee: 4d cf rjmp .-358 ; 0x1ed8a DBG(_n("Fitting failed => calibration failed.\n")); 1eef0: 8b e0 ldi r24, 0x0B ; 11 1eef2: 9f e6 ldi r25, 0x6F ; 111 1eef4: 9f 93 push r25 1eef6: 8f 93 push r24 1eef8: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 1eefc: 44 cf rjmp .-376 ; 0x1ed86 // 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; 1eefe: af 96 adiw r28, 0x2f ; 47 1ef00: 1f ae std Y+63, r1 ; 0x3f 1ef02: af 97 sbiw r28, 0x2f ; 47 1ef04: 42 cf rjmp .-380 ; 0x1ed8a } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1ef06: 1f ef ldi r17, 0xFF ; 255 1ef08: 40 cf rjmp .-384 ; 0x1ed8a 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) { 1ef0a: af 96 adiw r28, 0x2f ; 47 1ef0c: 6f ad ldd r22, Y+63 ; 0x3f 1ef0e: af 97 sbiw r28, 0x2f ; 47 1ef10: 61 11 cpse r22, r1 1ef12: 13 c0 rjmp .+38 ; 0x1ef3a 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); 1ef14: 82 e3 ldi r24, 0x32 ; 50 1ef16: 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) { 1ef18: 11 30 cpi r17, 0x01 ; 1 1ef1a: 51 f0 breq .+20 ; 0x1ef30 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); 1ef1c: 8f ee ldi r24, 0xEF ; 239 1ef1e: 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) { 1ef20: 12 30 cpi r17, 0x02 ; 2 1ef22: 31 f0 breq .+12 ; 0x1ef30 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1ef24: 86 ed ldi r24, 0xD6 ; 214 1ef26: 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) { 1ef28: 11 11 cpse r17, r1 1ef2a: 02 c0 rjmp .+4 ; 0x1ef30 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); 1ef2c: 87 e7 ldi r24, 0x77 ; 119 1ef2e: 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); 1ef30: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 break; } lcd_show_fullscreen_message_and_wait_P(msg); 1ef34: 0f 94 d6 34 call 0x269ac ; 0x269ac 1ef38: 0d c0 rjmp .+26 ; 0x1ef54 // 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) 1ef3a: af 96 adiw r28, 0x2f ; 47 1ef3c: 8f ad ldd r24, Y+63 ; 0x3f 1ef3e: af 97 sbiw r28, 0x2f ; 47 1ef40: 82 30 cpi r24, 0x02 ; 2 1ef42: f1 f4 brne .+60 ; 0x1ef80 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1ef44: 86 e0 ldi r24, 0x06 ; 6 1ef46: 97 e4 ldi r25, 0x47 ; 71 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); 1ef48: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 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); 1ef4c: 0f 94 d6 34 call 0x269ac ; 0x269ac } if (point_too_far_mask == 0 || result > 0) { 1ef50: 11 16 cp r1, r17 1ef52: 04 f3 brlt .-64 ; 0x1ef14 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1ef54: 1f 3f cpi r17, 0xFF ; 255 1ef56: 11 f4 brne .+4 ; 0x1ef5c 1ef58: 0c 94 07 e7 jmp 0x1ce0e ; 0x1ce0e { // 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); 1ef5c: 86 e0 ldi r24, 0x06 ; 6 1ef5e: 0e 94 5c e6 call 0x1ccb8 ; 0x1ccb8 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1ef62: 8f e5 ldi r24, 0x5F ; 95 1ef64: 9f e0 ldi r25, 0x0F ; 15 1ef66: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1ef6a: 81 11 cpse r24, r1 1ef6c: 0c 94 18 ea jmp 0x1d430 ; 0x1d430 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1ef70: 81 e7 ldi r24, 0x71 ; 113 1ef72: 98 e4 ldi r25, 0x48 ; 72 1ef74: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1ef78: 0f 94 d6 34 call 0x269ac ; 0x269ac 1ef7c: 0c 94 18 ea jmp 0x1d430 ; 0x1d430 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); 1ef80: 8a eb ldi r24, 0xBA ; 186 1ef82: 96 e4 ldi r25, 0x46 ; 70 1ef84: e1 cf rjmp .-62 ; 0x1ef48 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)) 1ef86: 89 81 ldd r24, Y+1 ; 0x01 1ef88: 9a 81 ldd r25, Y+2 ; 0x02 1ef8a: 80 37 cpi r24, 0x70 ; 112 1ef8c: 98 40 sbci r25, 0x08 ; 8 1ef8e: 10 f0 brcs .+4 ; 0x1ef94 1ef90: 0c 94 57 ea jmp 0x1d4ae ; 0x1d4ae if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1ef94: ae 01 movw r20, r28 1ef96: 4f 5f subi r20, 0xFF ; 255 1ef98: 5f 4f sbci r21, 0xFF ; 255 1ef9a: 7a 01 movw r14, r20 1ef9c: 04 eb ldi r16, 0xB4 ; 180 1ef9e: 10 e0 ldi r17, 0x00 ; 0 1efa0: 24 e8 ldi r18, 0x84 ; 132 1efa2: 33 e0 ldi r19, 0x03 ; 3 1efa4: a6 01 movw r20, r12 1efa6: 48 5c subi r20, 0xC8 ; 200 1efa8: 51 09 sbc r21, r1 1efaa: 69 2d mov r22, r9 1efac: 78 2d mov r23, r8 1efae: 8b 2d mov r24, r11 1efb0: 9a 2d mov r25, r10 1efb2: 0f 94 95 94 call 0x3292a ; 0x3292a 1efb6: 88 23 and r24, r24 1efb8: 11 f4 brne .+4 ; 0x1efbe 1efba: 0c 94 57 ea jmp 0x1d4ae ; 0x1d4ae ad += 1440; 1efbe: 89 81 ldd r24, Y+1 ; 0x01 1efc0: 9a 81 ldd r25, Y+2 ; 0x02 1efc2: 80 56 subi r24, 0x60 ; 96 1efc4: 9a 4f sbci r25, 0xFA ; 250 1efc6: 0c 94 e1 e8 jmp 0x1d1c2 ; 0x1d1c2 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) { 1efca: 00 23 and r16, r16 1efcc: 11 f4 brne .+4 ; 0x1efd2 1efce: 0c 94 73 ee jmp 0x1dce6 ; 0x1dce6 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1efd2: 02 30 cpi r16, 0x02 ; 2 1efd4: 09 f0 breq .+2 ; 0x1efd8 1efd6: 49 cf rjmp .-366 ; 0x1ee6a 1efd8: d2 01 movw r26, r4 1efda: 11 96 adiw r26, 0x01 ; 1 1efdc: 2d 91 ld r18, X+ 1efde: 3d 91 ld r19, X+ 1efe0: 4d 91 ld r20, X+ 1efe2: 5c 91 ld r21, X 1efe4: 14 97 sbiw r26, 0x04 ; 4 1efe6: 6e 96 adiw r28, 0x1e ; 30 1efe8: 6c ad ldd r22, Y+60 ; 0x3c 1efea: 7d ad ldd r23, Y+61 ; 0x3d 1efec: 8e ad ldd r24, Y+62 ; 0x3e 1efee: 9f ad ldd r25, Y+63 ; 0x3f 1eff0: 6e 97 sbiw r28, 0x1e ; 30 1eff2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1eff6: 4b 01 movw r8, r22 1eff8: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1effa: 60 e0 ldi r22, 0x00 ; 0 1effc: 70 e0 ldi r23, 0x00 ; 0 1effe: 80 e8 ldi r24, 0x80 ; 128 1f000: 9f e3 ldi r25, 0x3F ; 63 1f002: 11 30 cpi r17, 0x01 ; 1 1f004: 91 f0 breq .+36 ; 0x1f02a ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1f006: 12 30 cpi r17, 0x02 ; 2 1f008: 09 f0 breq .+2 ; 0x1f00c 1f00a: 3b cf rjmp .-394 ; 0x1ee82 1f00c: d2 01 movw r26, r4 1f00e: 11 96 adiw r26, 0x01 ; 1 1f010: 2d 91 ld r18, X+ 1f012: 3d 91 ld r19, X+ 1f014: 4d 91 ld r20, X+ 1f016: 5c 91 ld r21, X 1f018: 14 97 sbiw r26, 0x04 ; 4 1f01a: 6e 96 adiw r28, 0x1e ; 30 1f01c: 6c ad ldd r22, Y+60 ; 0x3c 1f01e: 7d ad ldd r23, Y+61 ; 0x3d 1f020: 8e ad ldd r24, Y+62 ; 0x3e 1f022: 9f ad ldd r25, Y+63 ; 0x3f 1f024: 6e 97 sbiw r28, 0x1e ; 30 1f026: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1f02a: 9b 01 movw r18, r22 1f02c: ac 01 movw r20, r24 1f02e: c5 01 movw r24, r10 1f030: b4 01 movw r22, r8 1f032: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 1f036: 9b 01 movw r18, r22 1f038: ac 01 movw r20, r24 1f03a: c7 01 movw r24, r14 1f03c: b6 01 movw r22, r12 1f03e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 1f042: 6b 01 movw r12, r22 1f044: 7c 01 movw r14, r24 1f046: 0c 94 73 ee jmp 0x1dce6 ; 0x1dce6 // 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 : 1f04a: 81 2c mov r8, r1 1f04c: 91 2c mov r9, r1 1f04e: 50 e8 ldi r21, 0x80 ; 128 1f050: a5 2e mov r10, r21 1f052: 5f e3 ldi r21, 0x3F ; 63 1f054: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1f056: 11 11 cpse r17, r1 1f058: 0c 94 4d ee jmp 0x1dc9a ; 0x1dc9a ((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; 1f05c: 20 e0 ldi r18, 0x00 ; 0 1f05e: 30 e0 ldi r19, 0x00 ; 0 1f060: 40 e8 ldi r20, 0x80 ; 128 1f062: 5f e3 ldi r21, 0x3F ; 63 1f064: ea cf rjmp .-44 ; 0x1f03a } // 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) { 1f066: 11 11 cpse r17, r1 1f068: b4 cf rjmp .-152 ; 0x1efd2 1f06a: 0c 94 73 ee jmp 0x1dce6 ; 0x1dce6 float a = (r == 1) ? 1.f : 1f06e: 81 2c mov r8, r1 1f070: 91 2c mov r9, r1 1f072: 40 e8 ldi r20, 0x80 ; 128 1f074: a4 2e mov r10, r20 1f076: 4f e3 ldi r20, 0x3F ; 63 1f078: 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) { 1f07a: 11 11 cpse r17, r1 1f07c: be cf rjmp .-132 ; 0x1effa 1f07e: 0c 94 73 ee jmp 0x1dce6 ; 0x1dce6 0001f082 : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1f082: cf 93 push r28 1f084: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1f086: 86 ea ldi r24, 0xA6 ; 166 1f088: 9c e0 ldi r25, 0x0C ; 12 1f08a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e return ((status & components) == components); 1f08e: 98 2f mov r25, r24 1f090: 9c 23 and r25, r28 1f092: 81 e0 ldi r24, 0x01 ; 1 1f094: 9c 13 cpse r25, r28 1f096: 80 e0 ldi r24, 0x00 ; 0 } 1f098: cf 91 pop r28 1f09a: 08 95 ret 0001f09c : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1f09c: 0f 93 push r16 1f09e: 1f 93 push r17 1f0a0: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1f0a2: 0e 94 95 cf call 0x19f2a ; 0x19f2a if (*str != '.') 1f0a6: fc 01 movw r30, r24 1f0a8: 20 81 ld r18, Z 1f0aa: 2e 32 cpi r18, 0x2E ; 46 1f0ac: 11 f0 breq .+4 ; 0x1f0b2 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 1f0ae: 80 e0 ldi r24, 0x00 ; 0 1f0b0: 34 c0 rjmp .+104 ; 0x1f11a // 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); 1f0b2: b8 01 movw r22, r16 1f0b4: 6e 5f subi r22, 0xFE ; 254 1f0b6: 7f 4f sbci r23, 0xFF ; 255 1f0b8: 01 96 adiw r24, 0x01 ; 1 1f0ba: 0e 94 95 cf call 0x19f2a ; 0x19f2a if (*str != '.') 1f0be: fc 01 movw r30, r24 1f0c0: 20 81 ld r18, Z 1f0c2: 2e 32 cpi r18, 0x2E ; 46 1f0c4: a1 f7 brne .-24 ; 0x1f0ae return false; ++str; } str = Number(str, version + 2); 1f0c6: b8 01 movw r22, r16 1f0c8: 6c 5f subi r22, 0xFC ; 252 1f0ca: 7f 4f sbci r23, 0xFF ; 255 1f0cc: 01 96 adiw r24, 0x01 ; 1 1f0ce: 0e 94 95 cf call 0x19f2a ; 0x19f2a version[3] = FIRMWARE_REVISION_RELEASED; 1f0d2: 20 e4 ldi r18, 0x40 ; 64 1f0d4: 30 e0 ldi r19, 0x00 ; 0 1f0d6: f8 01 movw r30, r16 1f0d8: 37 83 std Z+7, r19 ; 0x07 1f0da: 26 83 std Z+6, r18 ; 0x06 1f0dc: fc 01 movw r30, r24 1f0de: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1f0e0: 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'; 1f0e2: 89 2f mov r24, r25 1f0e4: 8f 7d andi r24, 0xDF ; 223 1f0e6: c1 f1 breq .+112 ; 0x1f158 1f0e8: 87 ef ldi r24, 0xF7 ; 247 1f0ea: 89 0f add r24, r25 1f0ec: 82 30 cpi r24, 0x02 ; 2 1f0ee: a0 f1 brcs .+104 ; 0x1f158 1f0f0: 9d 30 cpi r25, 0x0D ; 13 1f0f2: 91 f1 breq .+100 ; 0x1f158 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 == '-'){ 1f0f4: 9d 32 cpi r25, 0x2D ; 45 1f0f6: 99 f7 brne .-26 ; 0x1f0de // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f0f8: 11 96 adiw r26, 0x01 ; 1 1f0fa: 9c 91 ld r25, X 1f0fc: 92 34 cpi r25, 0x42 ; 66 1f0fe: e1 f0 breq .+56 ; 0x1f138 1f100: 7c f4 brge .+30 ; 0x1f120 1f102: 91 34 cpi r25, 0x41 ; 65 1f104: a1 f6 brne .-88 ; 0x1f0ae 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); 1f106: 0a 5f subi r16, 0xFA ; 250 1f108: 1f 4f sbci r17, 0xFF ; 255 1f10a: 28 e0 ldi r18, 0x08 ; 8 1f10c: 30 e0 ldi r19, 0x00 ; 0 1f10e: 45 e0 ldi r20, 0x05 ; 5 1f110: 6f e7 ldi r22, 0x7F ; 127 1f112: 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); 1f114: cf 01 movw r24, r30 1f116: 0e 94 6a d1 call 0x1a2d4 ; 0x1a2d4 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1f11a: 1f 91 pop r17 1f11c: 0f 91 pop r16 1f11e: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f120: 94 34 cpi r25, 0x44 ; 68 1f122: 91 f0 breq .+36 ; 0x1f148 1f124: 92 35 cpi r25, 0x52 ; 82 1f126: 19 f6 brne .-122 ; 0x1f0ae 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); 1f128: 0a 5f subi r16, 0xFA ; 250 1f12a: 1f 4f sbci r17, 0xFF ; 255 1f12c: 20 e2 ldi r18, 0x20 ; 32 1f12e: 30 e0 ldi r19, 0x00 ; 0 1f130: 42 e0 ldi r20, 0x02 ; 2 1f132: 63 e7 ldi r22, 0x73 ; 115 1f134: 7e e8 ldi r23, 0x8E ; 142 1f136: ee cf rjmp .-36 ; 0x1f114 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); 1f138: 0a 5f subi r16, 0xFA ; 250 1f13a: 1f 4f sbci r17, 0xFF ; 255 1f13c: 20 e1 ldi r18, 0x10 ; 16 1f13e: 30 e0 ldi r19, 0x00 ; 0 1f140: 44 e0 ldi r20, 0x04 ; 4 1f142: 6a e7 ldi r22, 0x7A ; 122 1f144: 7e e8 ldi r23, 0x8E ; 142 1f146: e6 cf rjmp .-52 ; 0x1f114 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); 1f148: 0a 5f subi r16, 0xFA ; 250 1f14a: 1f 4f sbci r17, 0xFF ; 255 1f14c: 30 e0 ldi r19, 0x00 ; 0 1f14e: 20 e0 ldi r18, 0x00 ; 0 1f150: 43 e0 ldi r20, 0x03 ; 3 1f152: 66 e7 ldi r22, 0x76 ; 118 1f154: 7e e8 ldi r23, 0x8E ; 142 1f156: de cf rjmp .-68 ; 0x1f114 // 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; 1f158: 81 e0 ldi r24, 0x01 ; 1 1f15a: df cf rjmp .-66 ; 0x1f11a 0001f15c : 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)) { 1f15c: 0f 93 push r16 1f15e: 1f 93 push r17 1f160: cf 93 push r28 1f162: df 93 push r29 1f164: eb 01 movw r28, r22 1f166: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1f168: 81 30 cpi r24, 0x01 ; 1 1f16a: 81 f0 breq .+32 ; 0x1f18c 1f16c: 82 30 cpi r24, 0x02 ; 2 1f16e: 89 f0 breq .+34 ; 0x1f192 case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1f170: 86 e8 ldi r24, 0x86 ; 134 1f172: 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); 1f174: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 1f178: 22 e0 ldi r18, 0x02 ; 2 1f17a: a8 01 movw r20, r16 1f17c: bc 01 movw r22, r24 1f17e: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1f180: df 91 pop r29 1f182: cf 91 pop r28 1f184: 1f 91 pop r17 1f186: 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); 1f188: 0d 94 1d d0 jmp 0x3a03a ; 0x3a03a 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); 1f18c: 8f e7 ldi r24, 0x7F ; 127 1f18e: 90 e4 ldi r25, 0x40 ; 64 1f190: f1 cf rjmp .-30 ; 0x1f174 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1f192: 86 e7 ldi r24, 0x76 ; 118 1f194: 90 e4 ldi r25, 0x40 ; 64 1f196: ee cf rjmp .-36 ; 0x1f174 0001f198 : /// (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 ) 1f198: 84 e0 ldi r24, 0x04 ; 4 1f19a: 9d e0 ldi r25, 0x0D ; 13 1f19c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1f1a0: 8a 32 cpi r24, 0x2A ; 42 1f1a2: 39 f4 brne .+14 ; 0x1f1b2 1f1a4: 8a e2 ldi r24, 0x2A ; 42 1f1a6: 9d e0 ldi r25, 0x0D ; 13 1f1a8: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1f1ac: 91 e0 ldi r25, 0x01 ; 1 1f1ae: 81 30 cpi r24, 0x01 ; 1 1f1b0: 09 f0 breq .+2 ; 0x1f1b4 1f1b2: 90 e0 ldi r25, 0x00 ; 0 } 1f1b4: 89 2f mov r24, r25 1f1b6: 08 95 ret 0001f1b8
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f1b8: cf 93 push r28 1f1ba: df 93 push r29 1f1bc: cd b7 in r28, 0x3d ; 61 1f1be: de b7 in r29, 0x3e ; 62 1f1c0: 67 97 sbiw r28, 0x17 ; 23 1f1c2: 0f b6 in r0, 0x3f ; 63 1f1c4: f8 94 cli 1f1c6: de bf out 0x3e, r29 ; 62 1f1c8: 0f be out 0x3f, r0 ; 63 1f1ca: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f1cc: 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); 1f1ce: 84 b5 in r24, 0x24 ; 36 1f1d0: 82 60 ori r24, 0x02 ; 2 1f1d2: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f1d4: 84 b5 in r24, 0x24 ; 36 1f1d6: 81 60 ori r24, 0x01 ; 1 1f1d8: 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); 1f1da: 85 b5 in r24, 0x25 ; 37 1f1dc: 82 60 ori r24, 0x02 ; 2 1f1de: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f1e0: 85 b5 in r24, 0x25 ; 37 1f1e2: 81 60 ori r24, 0x01 ; 1 1f1e4: 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); 1f1e6: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f1ea: 81 60 ori r24, 0x01 ; 1 1f1ec: 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; 1f1f0: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f1f4: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f1f8: 82 60 ori r24, 0x02 ; 2 1f1fa: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f1fe: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f202: 81 60 ori r24, 0x01 ; 1 1f204: 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); 1f208: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f20c: 81 60 ori r24, 0x01 ; 1 1f20e: 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); 1f212: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f216: 84 60 ori r24, 0x04 ; 4 1f218: 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); 1f21c: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f220: 81 60 ori r24, 0x01 ; 1 1f222: 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 1f226: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f22a: 82 60 ori r24, 0x02 ; 2 1f22c: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f230: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f234: 81 60 ori r24, 0x01 ; 1 1f236: 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 1f23a: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f23e: 81 60 ori r24, 0x01 ; 1 1f240: 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 1f244: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f248: 82 60 ori r24, 0x02 ; 2 1f24a: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f24e: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f252: 81 60 ori r24, 0x01 ; 1 1f254: 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 1f258: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f25c: 81 60 ori r24, 0x01 ; 1 1f25e: 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 1f262: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f266: 82 60 ori r24, 0x02 ; 2 1f268: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f26c: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f270: 81 60 ori r24, 0x01 ; 1 1f272: 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 1f276: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f27a: 81 60 ori r24, 0x01 ; 1 1f27c: 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); 1f280: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f284: 84 60 ori r24, 0x04 ; 4 1f286: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f28a: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f28e: 82 60 ori r24, 0x02 ; 2 1f290: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f294: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f298: 81 60 ori r24, 0x01 ; 1 1f29a: 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); 1f29e: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f2a2: 80 68 ori r24, 0x80 ; 128 1f2a4: 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; 1f2a8: 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) { 1f2ac: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f2ae: f8 94 cli wdt_reset(); 1f2b0: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f2b2: 84 b7 in r24, 0x34 ; 52 1f2b4: 87 7f andi r24, 0xF7 ; 247 1f2b6: 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" ); 1f2b8: 0f b6 in r0, 0x3f ; 63 1f2ba: f8 94 cli 1f2bc: a8 95 wdr 1f2be: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f2c2: 88 61 ori r24, 0x18 ; 24 1f2c4: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f2c8: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f2cc: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f2ce: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f2d0: 9f b7 in r25, 0x3f ; 63 1f2d2: 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 1f2d4: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f2d8: 84 e0 ldi r24, 0x04 ; 4 1f2da: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f2e2: 81 60 ori r24, 0x01 ; 1 1f2e4: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f2ec: 8d 7f andi r24, 0xFD ; 253 1f2ee: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f2f6: 8b 7f andi r24, 0xFB ; 251 1f2f8: 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; 1f2fc: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f300: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f302: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f304: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f306: 6a e0 ldi r22, 0x0A ; 10 1f308: 70 e0 ldi r23, 0x00 ; 0 1f30a: 80 e0 ldi r24, 0x00 ; 0 1f30c: 90 e0 ldi r25, 0x00 ; 0 1f30e: 0f 94 5c 3c call 0x278b8 ; 0x278b8 backlightSupport = !READ(LCD_BL_PIN); 1f312: 9c b1 in r25, 0x0c ; 12 1f314: 81 e0 ldi r24, 0x01 ; 1 1f316: 29 2f mov r18, r25 1f318: 28 70 andi r18, 0x08 ; 8 1f31a: 93 fd sbrc r25, 3 1f31c: 80 e0 ldi r24, 0x00 ; 0 1f31e: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb if (!backlightSupport) return; 1f322: 21 11 cpse r18, r1 1f324: 22 c0 rjmp .+68 ; 0x1f36a //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f326: 62 e0 ldi r22, 0x02 ; 2 1f328: 82 e3 ldi r24, 0x32 ; 50 1f32a: 9d e0 ldi r25, 0x0D ; 13 1f32c: 0e 94 25 78 call 0xf04a ; 0xf04a 1f330: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, 130); 1f334: 62 e8 ldi r22, 0x82 ; 130 1f336: 84 e3 ldi r24, 0x34 ; 52 1f338: 9d e0 ldi r25, 0x0D ; 13 1f33a: 0e 94 25 78 call 0xf04a ; 0xf04a 1f33e: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, 50); 1f342: 62 e3 ldi r22, 0x32 ; 50 1f344: 83 e3 ldi r24, 0x33 ; 51 1f346: 9d e0 ldi r25, 0x0D ; 13 1f348: 0e 94 25 78 call 0xf04a ; 0xf04a 1f34c: 80 93 f9 03 sts 0x03F9, r24 ; 0x8003f9 backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, 10); // in seconds 1f350: 6a e0 ldi r22, 0x0A ; 10 1f352: 70 e0 ldi r23, 0x00 ; 0 1f354: 80 e3 ldi r24, 0x30 ; 48 1f356: 9d e0 ldi r25, 0x0D ; 13 1f358: 0e 94 0d 78 call 0xf01a ; 0xf01a 1f35c: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f360: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f364: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f366: 0e 94 1e 8c call 0x1183c ; 0x1183c return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f36a: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f36c: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f36e: 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); 1f370: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f372: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f374: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f378: 80 68 ori r24, 0x80 ; 128 1f37a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f37e: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f380: 80 91 0a 04 lds r24, 0x040A ; 0x80040a <_ZL19lcd_displayfunction.lto_priv.567> 1f384: 88 60 ori r24, 0x08 ; 8 1f386: 80 93 0a 04 sts 0x040A, r24 ; 0x80040a <_ZL19lcd_displayfunction.lto_priv.567> 1f38a: 2f ef ldi r18, 0xFF ; 255 1f38c: 30 e7 ldi r19, 0x70 ; 112 1f38e: 82 e0 ldi r24, 0x02 ; 2 1f390: 21 50 subi r18, 0x01 ; 1 1f392: 30 40 sbci r19, 0x00 ; 0 1f394: 80 40 sbci r24, 0x00 ; 0 1f396: e1 f7 brne .-8 ; 0x1f390 1f398: 00 c0 rjmp .+0 ; 0x1f39a 1f39a: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f39c: 81 e0 ldi r24, 0x01 ; 1 1f39e: 0e 94 91 70 call 0xe122 ; 0xe122 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f3a2: 89 e3 ldi r24, 0x39 ; 57 1f3a4: 92 e7 ldi r25, 0x72 ; 114 1f3a6: 90 93 05 04 sts 0x0405, r25 ; 0x800405 <_lcdout+0x9> 1f3aa: 80 93 04 04 sts 0x0404, r24 ; 0x800404 <_lcdout+0x8> 1f3ae: 10 92 07 04 sts 0x0407, r1 ; 0x800407 <_lcdout+0xb> 1f3b2: 10 92 06 04 sts 0x0406, r1 ; 0x800406 <_lcdout+0xa> 1f3b6: 12 e0 ldi r17, 0x02 ; 2 1f3b8: 10 93 ff 03 sts 0x03FF, r17 ; 0x8003ff <_lcdout+0x3> 1f3bc: 10 92 09 04 sts 0x0409, r1 ; 0x800409 <_lcdout+0xd> 1f3c0: 10 92 08 04 sts 0x0408, r1 ; 0x800408 <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f3c4: 0e 94 d2 70 call 0xe1a4 ; 0xe1a4 lcd_longpress_func = menu_lcd_longpress_func; 1f3c8: 8d e6 ldi r24, 0x6D ; 109 1f3ca: 92 ed ldi r25, 0xD2 ; 210 1f3cc: 90 93 0f 04 sts 0x040F, r25 ; 0x80040f 1f3d0: 80 93 0e 04 sts 0x040E, r24 ; 0x80040e lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f3d4: 8a ee ldi r24, 0xEA ; 234 1f3d6: 99 e3 ldi r25, 0x39 ; 57 1f3d8: 90 93 0d 04 sts 0x040D, r25 ; 0x80040d 1f3dc: 80 93 0c 04 sts 0x040C, r24 ; 0x80040c menu_menu = lcd_status_screen; 1f3e0: 82 eb ldi r24, 0xB2 ; 178 1f3e2: 9b e3 ldi r25, 0x3B ; 59 1f3e4: 90 93 67 0e sts 0x0E67, r25 ; 0x800e67 1f3e8: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 SET_INPUT(BTN_EN1); 1f3ec: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f3f0: 8b 7f andi r24, 0xFB ; 251 1f3f2: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f3f6: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f3fa: 8d 7f andi r24, 0xFD ; 253 1f3fc: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f400: 9f b7 in r25, 0x3f ; 63 1f402: f8 94 cli 1f404: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f408: 84 60 ori r24, 0x04 ; 4 1f40a: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f40e: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f410: 9f b7 in r25, 0x3f ; 63 1f412: f8 94 cli 1f414: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f418: 82 60 ori r24, 0x02 ; 2 1f41a: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f41e: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f420: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f424: 8f 7b andi r24, 0xBF ; 191 1f426: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f42a: 9f b7 in r25, 0x3f ; 63 1f42c: f8 94 cli 1f42e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f432: 80 64 ori r24, 0x40 ; 64 1f434: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f438: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f43a: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f43e: 8e 7f andi r24, 0xFE ; 254 1f440: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f444: 9f b7 in r25, 0x3f ; 63 1f446: f8 94 cli 1f448: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f44c: 81 60 ori r24, 0x01 ; 1 1f44e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f452: 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); 1f454: af e9 ldi r26, 0x9F ; 159 1f456: bf e0 ldi r27, 0x0F ; 15 1f458: 11 97 sbiw r26, 0x01 ; 1 1f45a: f1 f7 brne .-4 ; 0x1f458 1f45c: 00 c0 rjmp .+0 ; 0x1f45e 1f45e: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f460: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f464: 80 95 com r24 1f466: 81 70 andi r24, 0x01 ; 1 1f468: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f46c: 44 e1 ldi r20, 0x14 ; 20 1f46e: 50 e0 ldi r21, 0x00 ; 0 1f470: 61 e5 ldi r22, 0x51 ; 81 1f472: 71 e7 ldi r23, 0x71 ; 113 1f474: 87 e3 ldi r24, 0x37 ; 55 1f476: 95 e0 ldi r25, 0x05 ; 5 1f478: 0f 94 fc da call 0x3b5f8 ; 0x3b5f8 timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f47c: 0f 94 ce bf call 0x37f9c ; 0x37f9c } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f480: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f484: 85 ed ldi r24, 0xD5 ; 213 1f486: 9f e8 ldi r25, 0x8F ; 143 1f488: 9f 93 push r25 1f48a: 8f 93 push r24 1f48c: 8c ed ldi r24, 0xDC ; 220 1f48e: 9f e8 ldi r25, 0x8F ; 143 1f490: 9f 93 push r25 1f492: 8f 93 push r24 1f494: 0e 94 ff 6f call 0xdffe ; 0xdffe static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f498: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f49c: 84 60 ori r24, 0x04 ; 4 1f49e: 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)); 1f4a2: 60 e0 ldi r22, 0x00 ; 0 1f4a4: 87 ed ldi r24, 0xD7 ; 215 1f4a6: 9e e0 ldi r25, 0x0E ; 14 1f4a8: 0e 94 25 78 call 0xf04a ; 0xf04a 1f4ac: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1f4b0: 60 e0 ldi r22, 0x00 ; 0 1f4b2: 88 e0 ldi r24, 0x08 ; 8 1f4b4: 9f e0 ldi r25, 0x0F ; 15 1f4b6: 0e 94 25 78 call 0xf04a ; 0xf04a 1f4ba: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e MYSERIAL.begin(BAUDRATE); 1f4be: 0e 94 b4 da call 0x1b568 ; 0x1b568 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f4c2: 87 e6 ldi r24, 0x67 ; 103 1f4c4: 99 e7 ldi r25, 0x79 ; 121 1f4c6: 90 93 06 05 sts 0x0506, r25 ; 0x800506 <_uartout+0x9> 1f4ca: 80 93 05 05 sts 0x0505, r24 ; 0x800505 <_uartout+0x8> 1f4ce: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_uartout+0xb> 1f4d2: 10 92 07 05 sts 0x0507, r1 ; 0x800507 <_uartout+0xa> 1f4d6: 10 93 00 05 sts 0x0500, r17 ; 0x800500 <_uartout+0x3> 1f4da: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_uartout+0xd> 1f4de: 10 92 09 05 sts 0x0509, r1 ; 0x800509 <_uartout+0xc> stdout = uartout; 1f4e2: 8d ef ldi r24, 0xFD ; 253 1f4e4: 94 e0 ldi r25, 0x04 ; 4 1f4e6: 90 93 13 18 sts 0x1813, r25 ; 0x801813 <__iob+0x3> 1f4ea: 80 93 12 18 sts 0x1812, r24 ; 0x801812 <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1f4ee: 0e 94 c9 e3 call 0x1c792 ; 0x1c792 1f4f2: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1f4f4: 0f 90 pop r0 1f4f6: 0f 90 pop r0 1f4f8: 0f 90 pop r0 1f4fa: 0f 90 pop r0 1f4fc: 8e 01 movw r16, r28 1f4fe: 0f 5f subi r16, 0xFF ; 255 1f500: 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; 1f502: aa 24 eor r10, r10 1f504: a3 94 inc r10 if (xflash_success) 1f506: 88 23 and r24, r24 1f508: 09 f4 brne .+2 ; 0x1f50c 1f50a: d8 c0 rjmp .+432 ; 0x1f6bc { optiboot_status = optiboot_xflash_enter(); 1f50c: 0f 94 dc bf call 0x37fb8 ; 0x37fb8 1f510: 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)) 1f512: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e6> 1f516: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e7> 1f51a: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e8> 1f51e: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e9> 1f522: 8a 3a cpi r24, 0xAA ; 170 1f524: 95 45 sbci r25, 0x55 ; 85 1f526: aa 4a sbci r26, 0xAA ; 170 1f528: b5 45 sbci r27, 0x55 ; 85 1f52a: 09 f0 breq .+2 ; 0x1f52e 1f52c: bf c0 rjmp .+382 ; 0x1f6ac 1f52e: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e5> 1f532: 87 ff sbrs r24, 7 1f534: bb c0 rjmp .+374 ; 0x1f6ac { uint8_t lang = boot_reserved >> 3; 1f536: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7e4> 1f53a: 98 2c mov r9, r8 1f53c: 96 94 lsr r9 1f53e: 96 94 lsr r9 1f540: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1f542: f8 2d mov r31, r8 1f544: f7 70 andi r31, 0x07 ; 7 1f546: 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 1f548: 99 20 and r9, r9 1f54a: 09 f4 brne .+2 ; 0x1f54e 1f54c: af c0 rjmp .+350 ; 0x1f6ac #ifdef XFLASH if (lang == LANG_ID_SEC) 1f54e: 21 e0 ldi r18, 0x01 ; 1 1f550: 92 12 cpse r9, r18 1f552: 24 c0 rjmp .+72 ; 0x1f59c { 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 1f554: 40 e1 ldi r20, 0x10 ; 16 1f556: 50 e0 ldi r21, 0x00 ; 0 1f558: 60 e0 ldi r22, 0x00 ; 0 1f55a: 71 e0 ldi r23, 0x01 ; 1 1f55c: c8 01 movw r24, r16 1f55e: 0f 94 a9 da call 0x3b552 ; 0x3b552 if (offset) *offset = ui; 1f562: 60 e0 ldi r22, 0x00 ; 0 1f564: 71 e0 ldi r23, 0x01 ; 1 1f566: 6b 01 movw r12, r22 1f568: f1 2c mov r15, r1 1f56a: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 1f56c: 89 81 ldd r24, Y+1 ; 0x01 1f56e: 9a 81 ldd r25, Y+2 ; 0x02 1f570: ab 81 ldd r26, Y+3 ; 0x03 1f572: bc 81 ldd r27, Y+4 ; 0x04 1f574: 85 3a cpi r24, 0xA5 ; 165 1f576: 9a 45 sbci r25, 0x5A ; 90 1f578: a4 4b sbci r26, 0xB4 ; 180 1f57a: bb 44 sbci r27, 0x4B ; 75 1f57c: 09 f0 breq .+2 ; 0x1f580 1f57e: 96 c0 rjmp .+300 ; 0x1f6ac { lcd_puts_at_P(1,0,PSTR("Language update")); 1f580: 4a e0 ldi r20, 0x0A ; 10 1f582: 50 e9 ldi r21, 0x90 ; 144 1f584: 60 e0 ldi r22, 0x00 ; 0 1f586: 81 e0 ldi r24, 0x01 ; 1 1f588: 0e 94 3a 70 call 0xe074 ; 0xe074 for (uint8_t i = 0; i < state; i++) 1f58c: 91 2c mov r9, r1 1f58e: 89 14 cp r8, r9 1f590: 39 f1 breq .+78 ; 0x1f5e0 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1f592: 8e e2 ldi r24, 0x2E ; 46 1f594: 0e 94 d5 70 call 0xe1aa ; 0xe1aa 1f598: 93 94 inc r9 1f59a: f9 cf rjmp .-14 ; 0x1f58e SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1f59c: 8c e5 ldi r24, 0x5C ; 92 1f59e: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1f5a0: 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; 1f5a2: c1 2c mov r12, r1 1f5a4: d1 2c mov r13, r1 1f5a6: 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 1f5a8: 20 e1 ldi r18, 0x10 ; 16 1f5aa: 30 e0 ldi r19, 0x00 ; 0 1f5ac: a8 01 movw r20, r16 1f5ae: c7 01 movw r24, r14 1f5b0: b6 01 movw r22, r12 1f5b2: 0e 94 99 e2 call 0x1c532 ; 0x1c532 if (header->magic != LANG_MAGIC) break; //break if not valid 1f5b6: 89 81 ldd r24, Y+1 ; 0x01 1f5b8: 9a 81 ldd r25, Y+2 ; 0x02 1f5ba: ab 81 ldd r26, Y+3 ; 0x03 1f5bc: bc 81 ldd r27, Y+4 ; 0x04 1f5be: 85 3a cpi r24, 0xA5 ; 165 1f5c0: 9a 45 sbci r25, 0x5A ; 90 1f5c2: a4 4b sbci r26, 0xB4 ; 180 1f5c4: bb 44 sbci r27, 0x4B ; 75 1f5c6: 09 f0 breq .+2 ; 0x1f5ca 1f5c8: 71 c0 rjmp .+226 ; 0x1f6ac if (offset) *offset = addr; if (--lang == 0) return 1; 1f5ca: f2 e0 ldi r31, 0x02 ; 2 1f5cc: 9f 16 cp r9, r31 1f5ce: c1 f2 breq .-80 ; 0x1f580 addr += header->size; //calc address of next table 1f5d0: 8d 81 ldd r24, Y+5 ; 0x05 1f5d2: 9e 81 ldd r25, Y+6 ; 0x06 1f5d4: c8 0e add r12, r24 1f5d6: d9 1e adc r13, r25 1f5d8: e1 1c adc r14, r1 1f5da: f1 1c adc r15, r1 1f5dc: 9a 94 dec r9 1f5de: e4 cf rjmp .-56 ; 0x1f5a8 lcd_print('.'); _delay(100); 1f5e0: 64 e6 ldi r22, 0x64 ; 100 1f5e2: 70 e0 ldi r23, 0x00 ; 0 1f5e4: 80 e0 ldi r24, 0x00 ; 0 1f5e6: 90 e0 ldi r25, 0x00 ; 0 1f5e8: 0f 94 5c 3c call 0x278b8 ; 0x278b8 boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1f5ec: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7e4> 1f5f0: 88 7f andi r24, 0xF8 ; 248 1f5f2: 91 e0 ldi r25, 0x01 ; 1 1f5f4: 98 0d add r25, r8 1f5f6: 97 70 andi r25, 0x07 ; 7 1f5f8: 89 2b or r24, r25 1f5fa: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7e4> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1f5fe: 91 2c mov r9, r1 1f600: 98 2c mov r9, r8 1f602: 88 24 eor r8, r8 1f604: 92 94 swap r9 1f606: 80 ef ldi r24, 0xF0 ; 240 1f608: 98 22 and r9, r24 1f60a: 8d 81 ldd r24, Y+5 ; 0x05 1f60c: 9e 81 ldd r25, Y+6 ; 0x06 1f60e: 88 16 cp r8, r24 1f610: 99 06 cpc r9, r25 1f612: 08 f0 brcs .+2 ; 0x1f616 1f614: 46 c0 rjmp .+140 ; 0x1f6a2 { cli(); 1f616: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1f618: 0d 81 ldd r16, Y+5 ; 0x05 1f61a: 1e 81 ldd r17, Y+6 ; 0x06 1f61c: 08 19 sub r16, r8 1f61e: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1f620: 01 30 cpi r16, 0x01 ; 1 1f622: 20 e1 ldi r18, 0x10 ; 16 1f624: 12 07 cpc r17, r18 1f626: 10 f0 brcs .+4 ; 0x1f62c 1f628: 00 e0 ldi r16, 0x00 ; 0 1f62a: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1f62c: c7 01 movw r24, r14 1f62e: b6 01 movw r22, r12 1f630: 68 0d add r22, r8 1f632: 79 1d adc r23, r9 1f634: 81 1d adc r24, r1 1f636: 91 1d adc r25, r1 1f638: 98 01 movw r18, r16 1f63a: 40 e0 ldi r20, 0x00 ; 0 1f63c: 58 e0 ldi r21, 0x08 ; 8 1f63e: 0e 94 99 e2 call 0x1c532 ; 0x1c532 } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1f642: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1f644: 8a ea ldi r24, 0xAA ; 170 1f646: 95 e5 ldi r25, 0x55 ; 85 1f648: dc 01 movw r26, r24 1f64a: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e6> 1f64e: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e7> 1f652: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e8> 1f656: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e9> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1f65a: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e5> 1f65e: 83 60 ori r24, 0x03 ; 3 1f660: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e5> boot_copy_size = (uint16_t)size; 1f664: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7e3> 1f668: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7e2> boot_src_addr = (uint32_t)rptr; 1f66c: 80 e0 ldi r24, 0x00 ; 0 1f66e: 98 e0 ldi r25, 0x08 ; 8 1f670: a0 e0 ldi r26, 0x00 ; 0 1f672: b0 e0 ldi r27, 0x00 ; 0 1f674: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7da> 1f678: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7db> 1f67c: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7dc> 1f680: b0 93 f3 1f sts 0x1FF3, r27 ; 0x801ff3 <__bss_end+0x7dd> if (state == 0) { //TODO - check header integrity } bootapp_ram2flash(LANGBOOT_RAMBUFFER, _SEC_LANG_TABLE + state * LANGBOOT_BLOCKSIZE, size); 1f684: c4 01 movw r24, r8 1f686: 80 50 subi r24, 0x00 ; 0 1f688: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1f68a: b0 e0 ldi r27, 0x00 ; 0 1f68c: a0 e0 ldi r26, 0x00 ; 0 1f68e: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7de> 1f692: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7df> 1f696: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7e0> 1f69a: b0 93 f7 1f sts 0x1FF7, r27 ; 0x801ff7 <__bss_end+0x7e1> 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(); 1f69e: 0e 94 92 68 call 0xd124 ; 0xd124 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1f6a2: 61 e0 ldi r22, 0x01 ; 1 1f6a4: 8e ef ldi r24, 0xFE ; 254 1f6a6: 9f e0 ldi r25, 0x0F ; 15 1f6a8: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1f6ac: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e6> 1f6b0: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e7> 1f6b4: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e8> 1f6b8: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e9> 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(); 1f6bc: 0e 94 cc f8 call 0x1f198 ; 0x1f198 setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1f6c0: 88 23 and r24, r24 1f6c2: 51 f0 breq .+20 ; 0x1f6d8 //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1f6c4: 64 e2 ldi r22, 0x24 ; 36 1f6c6: 86 e6 ldi r24, 0x66 ; 102 1f6c8: 92 e0 ldi r25, 0x02 ; 2 1f6ca: 0e 94 4c 69 call 0xd298 ; 0xd298 currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1f6ce: 64 e2 ldi r22, 0x24 ; 36 1f6d0: 86 e6 ldi r24, 0x66 ; 102 1f6d2: 92 e0 ldi r25, 0x02 ; 2 1f6d4: 0e 94 44 69 call 0xd288 ; 0xd288 #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); 1f6d8: 44 e1 ldi r20, 0x14 ; 20 1f6da: 50 e0 ldi r21, 0x00 ; 0 1f6dc: 65 e1 ldi r22, 0x15 ; 21 1f6de: 7d e0 ldi r23, 0x0D ; 13 1f6e0: c8 01 movw r24, r16 1f6e2: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1f6e6: 8c 89 ldd r24, Y+20 ; 0x14 1f6e8: 81 11 cpse r24, r1 1f6ea: 0a c0 rjmp .+20 ; 0x1f700 1f6ec: 44 e0 ldi r20, 0x04 ; 4 1f6ee: 50 e0 ldi r21, 0x00 ; 0 1f6f0: 6a e1 ldi r22, 0x1A ; 26 1f6f2: 71 e9 ldi r23, 0x91 ; 145 1f6f4: c8 01 movw r24, r16 1f6f6: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 1f6fa: 89 2b or r24, r25 1f6fc: 09 f4 brne .+2 ; 0x1f700 1f6fe: 51 c0 rjmp .+162 ; 0x1f7a2 * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1f700: e0 90 1e 05 lds r14, 0x051E ; 0x80051e uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1f704: 1d 8a std Y+21, r1 ; 0x15 1f706: 1f 8a std Y+23, r1 ; 0x17 1f708: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1f70a: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e timeout.start(); 1f70e: ce 01 movw r24, r28 1f710: 45 96 adiw r24, 0x15 ; 21 1f712: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1f716: 62 e3 ldi r22, 0x32 ; 50 1f718: 70 e0 ldi r23, 0x00 ; 0 1f71a: 80 e0 ldi r24, 0x00 ; 0 1f71c: 90 e0 ldi r25, 0x00 ; 0 1f71e: 0f 94 5c 3c call 0x278b8 ; 0x278b8 // 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; 1f722: 80 91 92 04 lds r24, 0x0492 ; 0x800492 1f726: 90 91 93 04 lds r25, 0x0493 ; 0x800493 1f72a: 90 93 91 04 sts 0x0491, r25 ; 0x800491 1f72e: 80 93 90 04 sts 0x0490, r24 ; 0x800490 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1f732: 8f e1 ldi r24, 0x1F ; 31 1f734: 90 e9 ldi r25, 0x90 ; 144 1f736: 0e 94 97 7b call 0xf72e ; 0xf72e 1f73a: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1f73c: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1f73e: 33 e1 ldi r19, 0x13 ; 19 1f740: f3 16 cp r15, r19 1f742: a1 f0 breq .+40 ; 0x1f76c { if (timeout.expired(250u)) 1f744: 6a ef ldi r22, 0xFA ; 250 1f746: 70 e0 ldi r23, 0x00 ; 0 1f748: ce 01 movw r24, r28 1f74a: 45 96 adiw r24, 0x15 ; 21 1f74c: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 1f750: 81 11 cpse r24, r1 1f752: c1 c0 rjmp .+386 ; 0x1f8d6 goto exit; if (MYSERIAL.available() > 0) 1f754: 0e 94 25 79 call 0xf24a ; 0xf24a 1f758: 18 16 cp r1, r24 1f75a: 19 06 cpc r1, r25 1f75c: 84 f7 brge .-32 ; 0x1f73e { SN[rxIndex] = MYSERIAL.read(); 1f75e: 0f 94 18 d6 call 0x3ac30 ; 0x3ac30 1f762: d6 01 movw r26, r12 1f764: 8d 93 st X+, r24 1f766: 6d 01 movw r12, r26 rxIndex++; 1f768: f3 94 inc r15 1f76a: e9 cf rjmp .-46 ; 0x1f73e } } SN[rxIndex] = 0; 1f76c: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1f76e: 44 e0 ldi r20, 0x04 ; 4 1f770: 50 e0 ldi r21, 0x00 ; 0 1f772: 6a e1 ldi r22, 0x1A ; 26 1f774: 70 e9 ldi r23, 0x90 ; 144 1f776: c8 01 movw r24, r16 1f778: 0f 94 ee da call 0x3b5dc ; 0x3b5dc ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1f77c: 89 2b or r24, r25 1f77e: 59 f6 brne .-106 ; 0x1f716 1f780: 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; 1f782: e0 92 1e 05 sts 0x051E, r14 ; 0x80051e { 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)) 1f786: 88 23 and r24, r24 1f788: 09 f4 brne .+2 ; 0x1f78c 1f78a: a7 c0 rjmp .+334 ; 0x1f8da #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); 1f78c: 44 e1 ldi r20, 0x14 ; 20 1f78e: 50 e0 ldi r21, 0x00 ; 0 1f790: 65 e1 ldi r22, 0x15 ; 21 1f792: 7d e0 ldi r23, 0x0D ; 13 1f794: c8 01 movw r24, r16 1f796: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1f79a: 8f e0 ldi r24, 0x0F ; 15 1f79c: 91 e9 ldi r25, 0x91 ; 145 } else puts_P(PSTR("SN update failed")); 1f79e: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1f7a2: a1 10 cpse r10, r1 1f7a4: 04 c0 rjmp .+8 ; 0x1f7ae 1f7a6: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 1f7aa: 88 23 and r24, r24 1f7ac: 21 f0 breq .+8 ; 0x1f7b6 SERIAL_PROTOCOLLNPGM("start"); 1f7ae: 88 ef ldi r24, 0xF8 ; 248 1f7b0: 90 e9 ldi r25, 0x90 ; 144 1f7b2: 0e 94 97 7b call 0xf72e ; 0xf72e #endif SERIAL_ECHO_START; 1f7b6: 84 e1 ldi r24, 0x14 ; 20 1f7b8: 9b ea ldi r25, 0xAB ; 171 1f7ba: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1f7be: 81 ee ldi r24, 0xE1 ; 225 1f7c0: 90 e9 ldi r25, 0x90 ; 144 1f7c2: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1f7c6: 60 e0 ldi r22, 0x00 ; 0 1f7c8: 8c ea ldi r24, 0xAC ; 172 1f7ca: 9c e0 ldi r25, 0x0C ; 12 1f7cc: 0e 94 25 78 call 0xf04a ; 0xf04a 1f7d0: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1f7d2: 0e 94 56 da call 0x1b4ac ; 0x1b4ac } MMU2::mmu2.Status(); 1f7d6: 0f 94 82 75 call 0x2eb04 ; 0x2eb04 } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1f7da: 82 e2 ldi r24, 0x22 ; 34 1f7dc: 90 e9 ldi r25, 0x90 ; 144 1f7de: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1f7e2: 62 e0 ldi r22, 0x02 ; 2 1f7e4: 86 ed ldi r24, 0xD6 ; 214 1f7e6: 9e e0 ldi r25, 0x0E ; 14 1f7e8: 0e 94 25 78 call 0xf04a ; 0xf04a if (status == (uint8_t)EEPROM::Enabled) 1f7ec: 81 30 cpi r24, 0x01 ; 1 1f7ee: 09 f0 breq .+2 ; 0x1f7f2 1f7f0: 77 c0 rjmp .+238 ; 0x1f8e0 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1f7f2: 86 e4 ldi r24, 0x46 ; 70 1f7f4: 9e e5 ldi r25, 0x5E ; 94 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1f7f6: 0e 94 97 7b call 0xf72e ; 0xf72e #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1f7fa: 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); 1f7fc: f0 fe sbrs r15, 0 1f7fe: 04 c0 rjmp .+8 ; 0x1f808 1f800: 88 eb ldi r24, 0xB8 ; 184 1f802: 9e e6 ldi r25, 0x6E ; 110 1f804: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1f808: f1 fe sbrs r15, 1 1f80a: 04 c0 rjmp .+8 ; 0x1f814 1f80c: 88 ea ldi r24, 0xA8 ; 168 1f80e: 9e e6 ldi r25, 0x6E ; 110 1f810: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1f814: f2 fe sbrs r15, 2 1f816: 04 c0 rjmp .+8 ; 0x1f820 1f818: 87 e9 ldi r24, 0x97 ; 151 1f81a: 9e e6 ldi r25, 0x6E ; 110 1f81c: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1f820: f3 fe sbrs r15, 3 1f822: 04 c0 rjmp .+8 ; 0x1f82c 1f824: 87 e8 ldi r24, 0x87 ; 135 1f826: 9e e6 ldi r25, 0x6E ; 110 1f828: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1f82c: f5 fe sbrs r15, 5 1f82e: 04 c0 rjmp .+8 ; 0x1f838 1f830: 87 e7 ldi r24, 0x77 ; 119 1f832: 9e e6 ldi r25, 0x6E ; 110 1f834: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 MCUSR = 0; 1f838: 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; 1f83a: 84 e1 ldi r24, 0x14 ; 20 1f83c: 9b ea ldi r25, 0xAB ; 171 1f83e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1f842: 87 e6 ldi r24, 0x67 ; 103 1f844: 9e e6 ldi r25, 0x6E ; 110 1f846: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1f84a: 8d ec ldi r24, 0xCD ; 205 1f84c: 90 e9 ldi r25, 0x90 ; 144 1f84e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1f852: 8b e5 ldi r24, 0x5B ; 91 1f854: 9e e6 ldi r25, 0x6E ; 110 1f856: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1f85a: 85 ec ldi r24, 0xC5 ; 197 1f85c: 90 e9 ldi r25, 0x90 ; 144 1f85e: 0e 94 97 7b call 0xf72e ; 0xf72e #endif #endif SERIAL_ECHO_START; 1f862: 84 e1 ldi r24, 0x14 ; 20 1f864: 9b ea ldi r25, 0xAB ; 171 1f866: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1f86a: 8c e4 ldi r24, 0x4C ; 76 1f86c: 9e e6 ldi r25, 0x6E ; 110 1f86e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1f872: 80 91 0c 18 lds r24, 0x180C ; 0x80180c <__brkval> 1f876: 90 91 0d 18 lds r25, 0x180D ; 0x80180d <__brkval+0x1> 1f87a: 00 97 sbiw r24, 0x00 ; 0 1f87c: a1 f1 breq .+104 ; 0x1f8e6 1f87e: 08 1b sub r16, r24 1f880: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1f882: b8 01 movw r22, r16 1f884: 11 0f add r17, r17 1f886: 88 0b sbc r24, r24 1f888: 99 0b sbc r25, r25 1f88a: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1f88e: 85 e3 ldi r24, 0x35 ; 53 1f890: 9e e6 ldi r25, 0x6E ; 110 1f892: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1f896: 80 ee ldi r24, 0xE0 ; 224 1f898: 96 e0 ldi r25, 0x06 ; 6 1f89a: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 #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); 1f89e: 6e e2 ldi r22, 0x2E ; 46 1f8a0: 71 e0 ldi r23, 0x01 ; 1 1f8a2: 8e ee ldi r24, 0xEE ; 238 1f8a4: 9e e0 ldi r25, 0x0E ; 14 1f8a6: 0e 94 0d 78 call 0xf01a ; 0xf01a 1f8aa: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1f8ac: 66 e3 ldi r22, 0x36 ; 54 1f8ae: 71 e0 ldi r23, 0x01 ; 1 1f8b0: 8c ee ldi r24, 0xEC ; 236 1f8b2: 9e e0 ldi r25, 0x0E ; 14 1f8b4: 0e 94 0d 78 call 0xf01a ; 0xf01a if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1f8b8: 0e 32 cpi r16, 0x2E ; 46 1f8ba: 11 40 sbci r17, 0x01 ; 1 1f8bc: 11 f0 breq .+4 ; 0x1f8c2 1f8be: 0d 94 af 04 jmp 0x2095e ; 0x2095e if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1f8c2: 01 e0 ldi r16, 0x01 ; 1 1f8c4: 86 33 cpi r24, 0x36 ; 54 1f8c6: 91 40 sbci r25, 0x01 ; 1 1f8c8: 09 f4 brne .+2 ; 0x1f8cc 1f8ca: 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(); 1f8cc: 0e 94 e2 95 call 0x12bc4 ; 0x12bc4 1f8d0: f8 2e mov r15, r24 1f8d2: 0d 94 b7 04 jmp 0x2096e ; 0x2096e _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1f8d6: 80 e0 ldi r24, 0x00 ; 0 1f8d8: 54 cf rjmp .-344 ; 0x1f782 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1f8da: 8e ef ldi r24, 0xFE ; 254 1f8dc: 90 e9 ldi r25, 0x90 ; 144 1f8de: 5f cf rjmp .-322 ; 0x1f79e 1f8e0: 80 e4 ldi r24, 0x40 ; 64 1f8e2: 9e e5 ldi r25, 0x5E ; 94 1f8e4: 88 cf rjmp .-240 ; 0x1f7f6 1f8e6: 06 51 subi r16, 0x16 ; 22 1f8e8: 18 41 sbci r17, 0x18 ; 24 1f8ea: cb cf rjmp .-106 ; 0x1f882 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1f8ec: 81 e3 ldi r24, 0x31 ; 49 1f8ee: 91 e0 ldi r25, 0x01 ; 1 1f8f0: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.482+0x1> 1f8f4: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.482> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1f8f8: c0 90 98 04 lds r12, 0x0498 ; 0x800498 <_ZL12maxttemp_raw.lto_priv.475> 1f8fc: d0 90 99 04 lds r13, 0x0499 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.475+0x1> 1f900: c6 01 movw r24, r12 1f902: 0e 94 c1 d9 call 0x1b382 ; 0x1b382 1f906: 20 e0 ldi r18, 0x00 ; 0 1f908: 30 e8 ldi r19, 0x80 ; 128 1f90a: 48 e9 ldi r20, 0x98 ; 152 1f90c: 53 e4 ldi r21, 0x43 ; 67 1f90e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1f912: 18 16 cp r1, r24 1f914: 44 f4 brge .+16 ; 0x1f926 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1f916: f0 e1 ldi r31, 0x10 ; 16 1f918: cf 0e add r12, r31 1f91a: d1 1c adc r13, r1 1f91c: d0 92 99 04 sts 0x0499, r13 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.475+0x1> 1f920: c0 92 98 04 sts 0x0498, r12 ; 0x800498 <_ZL12maxttemp_raw.lto_priv.475> 1f924: e9 cf rjmp .-46 ; 0x1f8f8 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1f926: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.483> 1f92a: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.483+0x1> 1f92e: 0f 94 c0 49 call 0x29380 ; 0x29380 1f932: 20 e0 ldi r18, 0x00 ; 0 1f934: 30 e0 ldi r19, 0x00 ; 0 1f936: 40 e2 ldi r20, 0x20 ; 32 1f938: 51 e4 ldi r21, 0x41 ; 65 1f93a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1f93e: 87 ff sbrs r24, 7 1f940: 0a c0 rjmp .+20 ; 0x1f956 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1f942: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.483> 1f946: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.483+0x1> 1f94a: 40 97 sbiw r24, 0x10 ; 16 1f94c: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.483+0x1> 1f950: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.483> 1f954: e8 cf rjmp .-48 ; 0x1f926 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1f956: 80 91 96 04 lds r24, 0x0496 ; 0x800496 <_ZL16bed_maxttemp_raw.lto_priv.476> 1f95a: 90 91 97 04 lds r25, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.476+0x1> 1f95e: 0f 94 c0 49 call 0x29380 ; 0x29380 1f962: 20 e0 ldi r18, 0x00 ; 0 1f964: 30 e0 ldi r19, 0x00 ; 0 1f966: 4a ef ldi r20, 0xFA ; 250 1f968: 52 e4 ldi r21, 0x42 ; 66 1f96a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1f96e: 18 16 cp r1, r24 1f970: 54 f4 brge .+20 ; 0x1f986 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1f972: 80 91 96 04 lds r24, 0x0496 ; 0x800496 <_ZL16bed_maxttemp_raw.lto_priv.476> 1f976: 90 91 97 04 lds r25, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.476+0x1> 1f97a: 40 96 adiw r24, 0x10 ; 16 1f97c: 90 93 97 04 sts 0x0497, r25 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.476+0x1> 1f980: 80 93 96 04 sts 0x0496, r24 ; 0x800496 <_ZL16bed_maxttemp_raw.lto_priv.476> 1f984: e8 cf rjmp .-48 ; 0x1f956 #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1f986: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.474> 1f98a: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.474+0x1> 1f98e: 0f 94 2b 49 call 0x29256 ; 0x29256 1f992: 20 e0 ldi r18, 0x00 ; 0 1f994: 30 e0 ldi r19, 0x00 ; 0 1f996: 40 ef ldi r20, 0xF0 ; 240 1f998: 51 ec ldi r21, 0xC1 ; 193 1f99a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 1f99e: 87 ff sbrs r24, 7 1f9a0: 0a c0 rjmp .+20 ; 0x1f9b6 #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1f9a2: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.474> 1f9a6: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.474+0x1> 1f9aa: 40 97 sbiw r24, 0x10 ; 16 1f9ac: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.474+0x1> 1f9b0: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.474> 1f9b4: e8 cf rjmp .-48 ; 0x1f986 #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1f9b6: 80 91 94 04 lds r24, 0x0494 ; 0x800494 <_ZL20ambient_maxttemp_raw.lto_priv.477> 1f9ba: 90 91 95 04 lds r25, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.477+0x1> 1f9be: 0f 94 2b 49 call 0x29256 ; 0x29256 1f9c2: 20 e0 ldi r18, 0x00 ; 0 1f9c4: 30 e0 ldi r19, 0x00 ; 0 1f9c6: 40 ea ldi r20, 0xA0 ; 160 1f9c8: 52 e4 ldi r21, 0x42 ; 66 1f9ca: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 1f9ce: 18 16 cp r1, r24 1f9d0: 54 f4 brge .+20 ; 0x1f9e6 #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1f9d2: 80 91 94 04 lds r24, 0x0494 ; 0x800494 <_ZL20ambient_maxttemp_raw.lto_priv.477> 1f9d6: 90 91 95 04 lds r25, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.477+0x1> 1f9da: 40 96 adiw r24, 0x10 ; 16 1f9dc: 90 93 95 04 sts 0x0495, r25 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.477+0x1> 1f9e0: 80 93 94 04 sts 0x0494, r24 ; 0x800494 <_ZL20ambient_maxttemp_raw.lto_priv.477> 1f9e4: e8 cf rjmp .-48 ; 0x1f9b6 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1f9e6: 9f b7 in r25, 0x3f ; 63 1f9e8: f8 94 cli TCNT0 = 0; 1f9ea: 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; 1f9ec: 8f ef ldi r24, 0xFF ; 255 1f9ee: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1f9f0: 83 e3 ldi r24, 0x33 ; 51 1f9f2: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1f9f4: 12 e0 ldi r17, 0x02 ; 2 1f9f6: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1f9f8: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f9fc: 81 60 ori r24, 0x01 ; 1 1f9fe: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1fa02: 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; 1fa04: 80 e8 ldi r24, 0x80 ; 128 1fa06: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1fa0a: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1fa0e: 84 60 ori r24, 0x04 ; 4 1fa10: 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; 1fa14: 2f b7 in r18, 0x3f ; 63 1fa16: f8 94 cli SET_OUTPUT(BEEPER); 1fa18: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fa1c: 84 60 ori r24, 0x04 ; 4 1fa1e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1fa22: 9f b7 in r25, 0x3f ; 63 1fa24: f8 94 cli 1fa26: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fa2a: 8b 7f andi r24, 0xFB ; 251 1fa2c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fa30: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1fa32: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fa36: 80 62 ori r24, 0x20 ; 32 1fa38: 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); 1fa3c: 81 e0 ldi r24, 0x01 ; 1 1fa3e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1fa42: 85 e1 ldi r24, 0x15 ; 21 1fa44: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1fa48: 8f ef ldi r24, 0xFF ; 255 1fa4a: 90 e0 ldi r25, 0x00 ; 0 1fa4c: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1fa50: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1fa54: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1fa58: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1fa5c: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1fa60: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1fa64: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1fa68: 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")); 1fa6a: 80 e3 ldi r24, 0x30 ; 48 1fa6c: 90 e9 ldi r25, 0x90 ; 144 1fa6e: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1fa72: 8f e5 ldi r24, 0x5F ; 95 1fa74: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1fa78: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1fa7c: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1fa80: 80 64 ori r24, 0x40 ; 64 1fa82: 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); 1fa86: 8f e9 ldi r24, 0x9F ; 159 1fa88: 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(); 1fa8c: 0e 94 0d 90 call 0x1201a ; 0x1201a // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fa90: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1fa92: f8 94 cli // CTC TCCRxB &= ~(1< 1fa98: 8f 7e andi r24, 0xEF ; 239 1fa9a: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1faa2: 88 60 ori r24, 0x08 ; 8 1faa4: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1faac: 8d 7f andi r24, 0xFD ; 253 1faae: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1fab6: 8e 7f andi r24, 0xFE ; 254 1fab8: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1fac0: 8f 73 andi r24, 0x3F ; 63 1fac2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1faca: 8f 7c andi r24, 0xCF ; 207 1facc: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fad4: 84 60 ori r24, 0x04 ; 4 1fad6: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fade: 8d 7f andi r24, 0xFD ; 253 1fae0: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fae8: 8e 7f andi r24, 0xFE ; 254 1faea: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 1faee: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 1faf2: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 1faf6: 2b ee ldi r18, 0xEB ; 235 1faf8: 31 e4 ldi r19, 0x41 ; 65 1fafa: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1fafe: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1fb02: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 1fb04: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 1fb08: 82 60 ori r24, 0x02 ; 2 1fb0a: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fb0e: 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: ")); 1fb10: 83 e2 ldi r24, 0x23 ; 35 1fb12: 9e e6 ldi r25, 0x6E ; 110 1fb14: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 } bool extruder_altfan_detect() { // override isAltFan setting for detection altfanStatus.isAltfan = 0; 1fb18: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> 1fb1c: 8e 7f andi r24, 0xFE ; 254 1fb1e: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> // During initialisation, use the EEPROM value altfanStatus.altfanOverride = eeprom_init_default_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE, 0); 1fb22: 60 e0 ldi r22, 0x00 ; 0 1fb24: 8b e2 ldi r24, 0x2B ; 43 1fb26: 9d e0 ldi r25, 0x0D ; 13 1fb28: 0e 94 25 78 call 0xf04a ; 0xf04a 1fb2c: 90 91 b6 04 lds r25, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> 1fb30: 80 fb bst r24, 0 1fb32: 91 f9 bld r25, 1 1fb34: 90 93 b6 04 sts 0x04B6, r25 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> setExtruderAutoFanState(3); 1fb38: 83 e0 ldi r24, 0x03 ; 3 1fb3a: 0e 94 62 77 call 0xeec4 ; 0xeec4 SET_INPUT(TACH_0); 1fb3e: 6e 98 cbi 0x0d, 6 ; 13 CRITICAL_SECTION_START; 1fb40: 9f b7 in r25, 0x3f ; 63 1fb42: f8 94 cli EICRB &= ~(1 << ISC61); 1fb44: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fb48: 8f 7d andi r24, 0xDF ; 223 1fb4a: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << ISC60); 1fb4e: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fb52: 80 61 ori r24, 0x10 ; 16 1fb54: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EIMSK |= (1 << INT6); 1fb58: ee 9a sbi 0x1d, 6 ; 29 fan_edge_counter[0] = 0; 1fb5a: 10 92 b3 04 sts 0x04B3, r1 ; 0x8004b3 1fb5e: 10 92 b2 04 sts 0x04B2, r1 ; 0x8004b2 CRITICAL_SECTION_END; 1fb62: 9f bf out 0x3f, r25 ; 63 extruder_autofan_last_check = _millis(); 1fb64: 0f 94 55 3e call 0x27caa ; 0x27caa 1fb68: 60 93 99 17 sts 0x1799, r22 ; 0x801799 1fb6c: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 1fb70: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 1fb74: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c _delay(1000); 1fb78: 68 ee ldi r22, 0xE8 ; 232 1fb7a: 73 e0 ldi r23, 0x03 ; 3 1fb7c: 80 e0 ldi r24, 0x00 ; 0 1fb7e: 90 e0 ldi r25, 0x00 ; 0 1fb80: 0f 94 5c 3c call 0x278b8 ; 0x278b8 EIMSK &= ~(1 << INT6); 1fb84: ee 98 cbi 0x1d, 6 ; 29 countFanSpeed(); 1fb86: 0e 94 eb 76 call 0xedd6 ; 0xedd6 // restore fan state altfanStatus.isAltfan = fan_speed[0] > 100; 1fb8a: 91 e0 ldi r25, 0x01 ; 1 1fb8c: 20 91 ae 04 lds r18, 0x04AE ; 0x8004ae 1fb90: 30 91 af 04 lds r19, 0x04AF ; 0x8004af 1fb94: 25 36 cpi r18, 0x65 ; 101 1fb96: 31 05 cpc r19, r1 1fb98: 0c f4 brge .+2 ; 0x1fb9c 1fb9a: 90 e0 ldi r25, 0x00 ; 0 1fb9c: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> 1fba0: 90 fb bst r25, 0 1fba2: 80 f9 bld r24, 0 1fba4: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> setExtruderAutoFanState(1); 1fba8: 81 e0 ldi r24, 0x01 ; 1 1fbaa: 0e 94 62 77 call 0xeec4 ; 0xeec4 return altfanStatus.isAltfan; 1fbae: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> if (extruder_altfan_detect()) 1fbb2: 80 ff sbrs r24, 0 1fbb4: c4 c0 rjmp .+392 ; 0x1fd3e SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); 1fbb6: 8e eb ldi r24, 0xBE ; 190 1fbb8: 90 e9 ldi r25, 0x90 ; 144 else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1fbba: 0e 94 97 7b call 0xf72e ; 0xf72e // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1fbbe: 10 92 53 0e sts 0x0E53, r1 ; 0x800e53 block_buffer_tail = 0; 1fbc2: 10 92 54 0e sts 0x0E54, r1 ; 0x800e54 memset(position, 0, sizeof(position)); // clear position 1fbc6: 80 e1 ldi r24, 0x10 ; 16 1fbc8: e1 e5 ldi r30, 0x51 ; 81 1fbca: f7 e0 ldi r31, 0x07 ; 7 1fbcc: df 01 movw r26, r30 1fbce: 28 2f mov r18, r24 1fbd0: 1d 92 st X+, r1 1fbd2: 2a 95 dec r18 1fbd4: e9 f7 brne .-6 ; 0x1fbd0 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1fbd6: ed ec ldi r30, 0xCD ; 205 1fbd8: f4 e0 ldi r31, 0x04 ; 4 1fbda: df 01 movw r26, r30 1fbdc: 28 2f mov r18, r24 1fbde: 1d 92 st X+, r1 1fbe0: 2a 95 dec r18 1fbe2: e9 f7 brne .-6 ; 0x1fbde #endif memset(previous_speed, 0, sizeof(previous_speed)); 1fbe4: ed eb ldi r30, 0xBD ; 189 1fbe6: f4 e0 ldi r31, 0x04 ; 4 1fbe8: df 01 movw r26, r30 1fbea: 1d 92 st X+, r1 1fbec: 8a 95 dec r24 1fbee: e9 f7 brne .-6 ; 0x1fbea previous_nominal_speed = 0.0; 1fbf0: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.504> 1fbf4: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.504+0x1> 1fbf8: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.504+0x2> 1fbfc: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.504+0x3> plan_reset_next_e_queue = false; 1fc00: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.502> plan_reset_next_e_sched = false; 1fc04: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.503> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1fc08: 84 e0 ldi r24, 0x04 ; 4 1fc0a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 if (!READ(BTN_ENC)) 1fc0e: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fc12: 86 fd sbrc r24, 6 1fc14: cd c0 rjmp .+410 ; 0x1fdb0 1fc16: bf ef ldi r27, 0xFF ; 255 1fc18: e3 ed ldi r30, 0xD3 ; 211 1fc1a: f0 e3 ldi r31, 0x30 ; 48 1fc1c: b1 50 subi r27, 0x01 ; 1 1fc1e: e0 40 sbci r30, 0x00 ; 0 1fc20: f0 40 sbci r31, 0x00 ; 0 1fc22: e1 f7 brne .-8 ; 0x1fc1c 1fc24: 00 c0 rjmp .+0 ; 0x1fc26 1fc26: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1fc28: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fc2c: 86 fd sbrc r24, 6 1fc2e: c0 c0 rjmp .+384 ; 0x1fdb0 { lcd_clear(); 1fc30: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_P(PSTR("Factory RESET")); 1fc34: 8a e8 ldi r24, 0x8A ; 138 1fc36: 90 e9 ldi r25, 0x90 ; 144 1fc38: 0e 94 11 70 call 0xe022 ; 0xe022 SET_OUTPUT(BEEPER); 1fc3c: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fc40: 84 60 ori r24, 0x04 ; 4 1fc42: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1fc46: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1fc4a: 82 30 cpi r24, 0x02 ; 2 1fc4c: 41 f0 breq .+16 ; 0x1fc5e WRITE(BEEPER, HIGH); 1fc4e: 9f b7 in r25, 0x3f ; 63 1fc50: f8 94 cli 1fc52: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fc56: 84 60 ori r24, 0x04 ; 4 1fc58: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fc5c: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1fc5e: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fc62: 86 ff sbrs r24, 6 1fc64: fc cf rjmp .-8 ; 0x1fc5e WRITE(BEEPER, LOW); 1fc66: 9f b7 in r25, 0x3f ; 63 1fc68: f8 94 cli 1fc6a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fc6e: 8b 7f andi r24, 0xFB ; 251 1fc70: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fc74: 9f bf out 0x3f, r25 ; 63 1fc76: 2f ef ldi r18, 0xFF ; 255 1fc78: 37 ea ldi r19, 0xA7 ; 167 1fc7a: 81 e6 ldi r24, 0x61 ; 97 1fc7c: 21 50 subi r18, 0x01 ; 1 1fc7e: 30 40 sbci r19, 0x00 ; 0 1fc80: 80 40 sbci r24, 0x00 ; 0 1fc82: e1 f7 brne .-8 ; 0x1fc7c 1fc84: 00 c0 rjmp .+0 ; 0x1fc86 1fc86: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1fc88: 80 e7 ldi r24, 0x70 ; 112 1fc8a: 90 e9 ldi r25, 0x90 ; 144 1fc8c: 9a 83 std Y+2, r25 ; 0x02 1fc8e: 89 83 std Y+1, r24 ; 0x01 1fc90: 85 e6 ldi r24, 0x65 ; 101 1fc92: 90 e9 ldi r25, 0x90 ; 144 1fc94: 9c 83 std Y+4, r25 ; 0x04 1fc96: 8b 83 std Y+3, r24 ; 0x03 1fc98: 87 e5 ldi r24, 0x57 ; 87 1fc9a: 90 e9 ldi r25, 0x90 ; 144 1fc9c: 9e 83 std Y+6, r25 ; 0x06 1fc9e: 8d 83 std Y+5, r24 ; 0x05 1fca0: 8a e4 ldi r24, 0x4A ; 74 1fca2: 90 e9 ldi r25, 0x90 ; 144 1fca4: 98 87 std Y+8, r25 ; 0x08 1fca6: 8f 83 std Y+7, r24 ; 0x07 1fca8: 81 e4 ldi r24, 0x41 ; 65 1fcaa: 90 e9 ldi r25, 0x90 ; 144 1fcac: 9a 87 std Y+10, r25 ; 0x0a 1fcae: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1fcb0: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_putc_at(0, 0, '>'); 1fcb4: 4e e3 ldi r20, 0x3E ; 62 1fcb6: 60 e0 ldi r22, 0x00 ; 0 1fcb8: 80 e0 ldi r24, 0x00 ; 0 1fcba: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_consume_click(); 1fcbe: 0e 94 3e 72 call 0xe47c ; 0xe47c } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1fcc2: 10 e0 ldi r17, 0x00 ; 0 1fcc4: d1 2c mov r13, r1 1fcc6: 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]); 1fcc8: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1fccc: f6 01 movw r30, r12 1fcce: e8 0f add r30, r24 1fcd0: f1 1d adc r31, r1 1fcd2: 87 fd sbrc r24, 7 1fcd4: fa 95 dec r31 1fcd6: ee 0f add r30, r30 1fcd8: ff 1f adc r31, r31 1fcda: a1 e0 ldi r26, 0x01 ; 1 1fcdc: b0 e0 ldi r27, 0x00 ; 0 1fcde: ac 0f add r26, r28 1fce0: bd 1f adc r27, r29 1fce2: ea 0f add r30, r26 1fce4: fb 1f adc r31, r27 1fce6: 40 81 ld r20, Z 1fce8: 51 81 ldd r21, Z+1 ; 0x01 1fcea: 6c 2d mov r22, r12 1fcec: 81 e0 ldi r24, 0x01 ; 1 1fcee: 0e 94 3a 70 call 0xe074 ; 0xe074 1fcf2: bf ef ldi r27, 0xFF ; 255 1fcf4: cb 1a sub r12, r27 1fcf6: 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++) { 1fcf8: e4 e0 ldi r30, 0x04 ; 4 1fcfa: ce 16 cp r12, r30 1fcfc: d1 04 cpc r13, r1 1fcfe: 21 f7 brne .-56 ; 0x1fcc8 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1fd00: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 1fd04: 81 e0 ldi r24, 0x01 ; 1 1fd06: 0e 94 6b 8c call 0x118d6 ; 0x118d6 if (lcd_encoder) { 1fd0a: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1fd0e: 90 91 35 05 lds r25, 0x0535 ; 0x800535 1fd12: 00 97 sbiw r24, 0x00 ; 0 1fd14: 89 f1 breq .+98 ; 0x1fd78 if (lcd_encoder < 0) { 1fd16: 97 ff sbrs r25, 7 1fd18: 15 c0 rjmp .+42 ; 0x1fd44 cursor_pos--; 1fd1a: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1fd1c: 14 30 cpi r17, 0x04 ; 4 1fd1e: 0c f4 brge .+2 ; 0x1fd22 1fd20: a9 c0 rjmp .+338 ; 0x1fe74 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1fd22: 87 e0 ldi r24, 0x07 ; 7 1fd24: 0f 94 2e 63 call 0x2c65c ; 0x2c65c if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1fd28: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1fd2c: 18 16 cp r1, r24 1fd2e: 2c f0 brlt .+10 ; 0x1fd3a first++; 1fd30: 8f 5f subi r24, 0xFF ; 255 1fd32: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 1fd36: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1fd3a: 13 e0 ldi r17, 0x03 ; 3 1fd3c: 06 c0 rjmp .+12 ; 0x1fd4a #ifdef EXTRUDER_ALTFAN_DETECT SERIAL_ECHORPGM(_n("Hotend fan type: ")); if (extruder_altfan_detect()) SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1fd3e: 87 eb ldi r24, 0xB7 ; 183 1fd40: 90 e9 ldi r25, 0x90 ; 144 1fd42: 3b cf rjmp .-394 ; 0x1fbba if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1fd44: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1fd46: 14 30 cpi r17, 0x04 ; 4 1fd48: 60 f7 brcc .-40 ; 0x1fd22 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1fd4a: 49 e3 ldi r20, 0x39 ; 57 1fd4c: 50 e9 ldi r21, 0x90 ; 144 1fd4e: 60 e0 ldi r22, 0x00 ; 0 1fd50: 80 e0 ldi r24, 0x00 ; 0 1fd52: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(0, cursor_pos); 1fd56: 61 2f mov r22, r17 1fd58: 80 e0 ldi r24, 0x00 ; 0 1fd5a: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_putc('>'); 1fd5e: 8e e3 ldi r24, 0x3E ; 62 1fd60: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_encoder = 0; 1fd64: 10 92 35 05 sts 0x0535, r1 ; 0x800535 1fd68: 10 92 34 05 sts 0x0534, r1 ; 0x800534 _delay(100); 1fd6c: 64 e6 ldi r22, 0x64 ; 100 1fd6e: 70 e0 ldi r23, 0x00 ; 0 1fd70: 80 e0 ldi r24, 0x00 ; 0 1fd72: 90 e0 ldi r25, 0x00 ; 0 1fd74: 0f 94 5c 3c call 0x278b8 ; 0x278b8 } if (lcd_clicked()) { 1fd78: 0e 94 43 72 call 0xe486 ; 0xe486 1fd7c: 88 23 and r24, r24 1fd7e: 09 f4 brne .+2 ; 0x1fd82 1fd80: a1 cf rjmp .-190 ; 0x1fcc4 return(cursor_pos + first); 1fd82: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1fd86: 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(); 1fd88: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 Sound_MakeCustom(100,0,false); 1fd8c: 40 e0 ldi r20, 0x00 ; 0 1fd8e: 70 e0 ldi r23, 0x00 ; 0 1fd90: 60 e0 ldi r22, 0x00 ; 0 1fd92: 84 e6 ldi r24, 0x64 ; 100 1fd94: 90 e0 ldi r25, 0x00 ; 0 1fd96: 0f 94 1a 69 call 0x2d234 ; 0x2d234 switch (level) { 1fd9a: 12 30 cpi r17, 0x02 ; 2 1fd9c: 09 f4 brne .+2 ; 0x1fda0 1fd9e: a0 c0 rjmp .+320 ; 0x1fee0 1fda0: 08 f0 brcs .+2 ; 0x1fda4 1fda2: 79 c0 rjmp .+242 ; 0x1fe96 1fda4: 11 23 and r17, r17 1fda6: 09 f4 brne .+2 ; 0x1fdaa 1fda8: 93 c0 rjmp .+294 ; 0x1fed0 1fdaa: 11 30 cpi r17, 0x01 ; 1 1fdac: 09 f4 brne .+2 ; 0x1fdb0 1fdae: 93 c0 rjmp .+294 ; 0x1fed6 case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1fdb0: 82 e0 ldi r24, 0x02 ; 2 1fdb2: 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); 1fdb6: 60 e0 ldi r22, 0x00 ; 0 1fdb8: 8f ef ldi r24, 0xFF ; 255 1fdba: 9f e0 ldi r25, 0x0F ; 15 1fdbc: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1fdc0: 61 e0 ldi r22, 0x01 ; 1 1fdc2: 8f e5 ldi r24, 0x5F ; 95 1fdc4: 9f e0 ldi r25, 0x0F ; 15 1fdc6: 0e 94 25 78 call 0xf04a ; 0xf04a #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 1fdca: 8f ef ldi r24, 0xFF ; 255 1fdcc: 9f e0 ldi r25, 0x0F ; 15 1fdce: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1fdd2: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 1fdd4: 8f 3f cpi r24, 0xFF ; 255 1fdd6: 09 f4 brne .+2 ; 0x1fdda 1fdd8: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 1fdda: 10 92 69 06 sts 0x0669, r1 ; 0x800669 tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); 1fdde: 61 e0 ldi r22, 0x01 ; 1 1fde0: 89 e6 ldi r24, 0x69 ; 105 1fde2: 9f e0 ldi r25, 0x0F ; 15 1fde4: 0e 94 25 78 call 0xf04a ; 0xf04a 1fde8: 91 e0 ldi r25, 0x01 ; 1 1fdea: 81 11 cpse r24, r1 1fdec: 01 c0 rjmp .+2 ; 0x1fdf0 1fdee: 90 e0 ldi r25, 0x00 ; 0 1fdf0: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 1fdf4: 88 23 and r24, r24 1fdf6: 09 f4 brne .+2 ; 0x1fdfa 1fdf8: 92 c0 rjmp .+292 ; 0x1ff1e puts_P(_N("CrashDetect ENABLED!")); 1fdfa: 8e e0 ldi r24, 0x0E ; 14 1fdfc: 9e e6 ldi r25, 0x6E ; 110 } else { puts_P(_N("CrashDetect DISABLED")); 1fdfe: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 1fe02: 87 ef ldi r24, 0xF7 ; 247 1fe04: 9e e0 ldi r25, 0x0E ; 14 1fe06: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1fe0a: c8 2e mov r12, r24 1fe0c: 80 93 f9 04 sts 0x04F9, r24 ; 0x8004f9 tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 1fe10: 86 ef ldi r24, 0xF6 ; 246 1fe12: 9e e0 ldi r25, 0x0E ; 14 1fe14: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1fe18: d8 2e mov r13, r24 1fe1a: 80 93 fa 04 sts 0x04FA, r24 ; 0x8004fa tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 1fe1e: 85 ef ldi r24, 0xF5 ; 245 1fe20: 9e e0 ldi r25, 0x0E ; 14 1fe22: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1fe26: e8 2e mov r14, r24 1fe28: 80 93 fb 04 sts 0x04FB, r24 ; 0x8004fb #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[E_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_E_FAC); 1fe2c: 84 ef ldi r24, 0xF4 ; 244 1fe2e: 9e e0 ldi r25, 0x0E ; 14 1fe30: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 1fe34: 80 93 fc 04 sts 0x04FC, r24 ; 0x8004fc if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 1fe38: 2f ef ldi r18, 0xFF ; 255 1fe3a: c2 12 cpse r12, r18 1fe3c: 02 c0 rjmp .+4 ; 0x1fe42 1fe3e: 10 92 f9 04 sts 0x04F9, r1 ; 0x8004f9 if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 1fe42: 3f ef ldi r19, 0xFF ; 255 1fe44: d3 12 cpse r13, r19 1fe46: 02 c0 rjmp .+4 ; 0x1fe4c 1fe48: 10 92 fa 04 sts 0x04FA, r1 ; 0x8004fa if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 1fe4c: 9f ef ldi r25, 0xFF ; 255 1fe4e: e9 12 cpse r14, r25 1fe50: 02 c0 rjmp .+4 ; 0x1fe56 1fe52: 10 92 fb 04 sts 0x04FB, r1 ; 0x8004fb if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 1fe56: 8f 3f cpi r24, 0xFF ; 255 1fe58: 11 f4 brne .+4 ; 0x1fe5e 1fe5a: 10 92 fc 04 sts 0x04FC, r1 ; 0x8004fc #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 1fe5e: 80 91 27 07 lds r24, 0x0727 ; 0x800727 1fe62: 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--; 1fe64: 28 e0 ldi r18, 0x08 ; 8 1fe66: 96 95 lsr r25 1fe68: 87 95 ror r24 1fe6a: 00 97 sbiw r24, 0x00 ; 0 1fe6c: 09 f4 brne .+2 ; 0x1fe70 1fe6e: 5a c0 rjmp .+180 ; 0x1ff24 1fe70: 21 50 subi r18, 0x01 ; 1 1fe72: f9 cf rjmp .-14 ; 0x1fe66 first++; lcd_clear(); } } if (cursor_pos < 0) { 1fe74: 1f 3f cpi r17, 0xFF ; 255 1fe76: 09 f0 breq .+2 ; 0x1fe7a 1fe78: 68 cf rjmp .-304 ; 0x1fd4a cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1fe7a: 87 e0 ldi r24, 0x07 ; 7 1fe7c: 0f 94 2e 63 call 0x2c65c ; 0x2c65c if (first > 0) { 1fe80: 80 91 dd 04 lds r24, 0x04DD ; 0x8004dd 1fe84: 18 16 cp r1, r24 1fe86: 2c f4 brge .+10 ; 0x1fe92 first--; 1fe88: 81 50 subi r24, 0x01 ; 1 1fe8a: 80 93 dd 04 sts 0x04DD, r24 ; 0x8004dd lcd_clear(); 1fe8e: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1fe92: 10 e0 ldi r17, 0x00 ; 0 1fe94: 5a cf rjmp .-332 ; 0x1fd4a // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1fe96: 13 30 cpi r17, 0x03 ; 3 1fe98: 29 f1 breq .+74 ; 0x1fee4 1fe9a: 14 30 cpi r17, 0x04 ; 4 1fe9c: 09 f0 breq .+2 ; 0x1fea0 1fe9e: 88 cf rjmp .-240 ; 0x1fdb0 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1fea0: 69 e7 ldi r22, 0x79 ; 121 1fea2: 70 e9 ldi r23, 0x90 ; 144 1fea4: 80 e0 ldi r24, 0x00 ; 0 1fea6: 90 e1 ldi r25, 0x10 ; 16 1fea8: 0f 94 f0 cc call 0x399e0 ; 0x399e0 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1feac: 10 e0 ldi r17, 0x00 ; 0 1feae: 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); 1feb0: 6f ef ldi r22, 0xFF ; 255 1feb2: c8 01 movw r24, r16 1feb4: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1feb8: c8 01 movw r24, r16 1feba: 0f 94 c1 cc call 0x39982 ; 0x39982 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1febe: 0f 5f subi r16, 0xFF ; 255 1fec0: 1f 4f sbci r17, 0xFF ; 255 1fec2: 01 15 cp r16, r1 1fec4: f0 e1 ldi r31, 0x10 ; 16 1fec6: 1f 07 cpc r17, r31 1fec8: 99 f7 brne .-26 ; 0x1feb0 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1feca: 0f 94 e2 cc call 0x399c4 ; 0x399c4 1fece: e7 cb rjmp .-2098 ; 0x1f69e lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1fed0: 0e 94 72 72 call 0xe4e4 ; 0xe4e4 1fed4: 6d cf rjmp .-294 ; 0x1fdb0 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1fed6: 0e 94 57 68 call 0xd0ae ; 0xd0ae lcd_menu_statistics(); 1feda: 0f 94 df 53 call 0x2a7be ; 0x2a7be 1fede: 68 cf rjmp .-304 ; 0x1fdb0 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1fee0: 0e 94 57 68 call 0xd0ae ; 0xd0ae // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1fee4: 0e 94 72 72 call 0xe4e4 ; 0xe4e4 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1fee8: 84 e0 ldi r24, 0x04 ; 4 1feea: 0e 94 07 e6 call 0x1cc0e ; 0x1cc0e 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); 1feee: 62 e0 ldi r22, 0x02 ; 2 1fef0: 8f e5 ldi r24, 0x5F ; 95 1fef2: 9f e0 ldi r25, 0x0F ; 15 1fef4: 0f 94 57 dd call 0x3baae ; 0x3baae eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1fef8: 81 e0 ldi r24, 0x01 ; 1 1fefa: 0e 94 45 76 call 0xec8a ; 0xec8a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1fefe: 11 e0 ldi r17, 0x01 ; 1 1ff00: 10 93 86 17 sts 0x1786, r17 ; 0x801786 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ff04: 61 e0 ldi r22, 0x01 ; 1 1ff06: 87 e0 ldi r24, 0x07 ; 7 1ff08: 9f e0 ldi r25, 0x0F ; 15 1ff0a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1ff0e: 10 93 87 17 sts 0x1787, r17 ; 0x801787 1ff12: 61 e0 ldi r22, 0x01 ; 1 1ff14: 85 ed ldi r24, 0xD5 ; 213 1ff16: 9e e0 ldi r25, 0x0E ; 14 1ff18: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 1ff1c: 49 cf rjmp .-366 ; 0x1fdb0 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")); 1ff1e: 89 ef ldi r24, 0xF9 ; 249 1ff20: 9d e6 ldi r25, 0x6D ; 109 1ff22: 6d cf rjmp .-294 ; 0x1fdfe 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]); 1ff24: 20 93 f5 04 sts 0x04F5, r18 ; 0x8004f5 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 1ff28: 80 91 28 07 lds r24, 0x0728 ; 0x800728 1ff2c: 90 e0 ldi r25, 0x00 ; 0 1ff2e: 28 e0 ldi r18, 0x08 ; 8 1ff30: 96 95 lsr r25 1ff32: 87 95 ror r24 1ff34: 00 97 sbiw r24, 0x00 ; 0 1ff36: 11 f0 breq .+4 ; 0x1ff3c 1ff38: 21 50 subi r18, 0x01 ; 1 1ff3a: fa cf rjmp .-12 ; 0x1ff30 1ff3c: 20 93 f6 04 sts 0x04F6, r18 ; 0x8004f6 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 1ff40: 80 91 29 07 lds r24, 0x0729 ; 0x800729 1ff44: 90 e0 ldi r25, 0x00 ; 0 1ff46: 28 e0 ldi r18, 0x08 ; 8 1ff48: 96 95 lsr r25 1ff4a: 87 95 ror r24 1ff4c: 00 97 sbiw r24, 0x00 ; 0 1ff4e: 11 f0 breq .+4 ; 0x1ff54 1ff50: 21 50 subi r18, 0x01 ; 1 1ff52: fa cf rjmp .-12 ; 0x1ff48 1ff54: 20 93 f7 04 sts 0x04F7, r18 ; 0x8004f7 tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 1ff58: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 1ff5c: 90 e0 ldi r25, 0x00 ; 0 1ff5e: 28 e0 ldi r18, 0x08 ; 8 1ff60: 96 95 lsr r25 1ff62: 87 95 ror r24 1ff64: 00 97 sbiw r24, 0x00 ; 0 1ff66: 11 f0 breq .+4 ; 0x1ff6c 1ff68: 21 50 subi r18, 0x01 ; 1 1ff6a: fa cf rjmp .-12 ; 0x1ff60 1ff6c: 20 93 f8 04 sts 0x04F8, r18 ; 0x8004f8 return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 1ff70: 0e 94 cc f8 call 0x1f198 ; 0x1f198 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) { } 1ff74: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 1ff76: 82 70 andi r24, 0x02 ; 2 1ff78: 0f 94 eb 3a call 0x275d6 ; 0x275d6 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1ff7c: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1ff80: 81 60 ori r24, 0x01 ; 1 1ff82: 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); 1ff86: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1ff8a: 82 60 ori r24, 0x02 ; 2 1ff8c: 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); 1ff90: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1ff94: 84 60 ori r24, 0x04 ; 4 1ff96: 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); 1ff9a: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1ff9e: 80 64 ori r24, 0x40 ; 64 1ffa0: 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); 1ffa4: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1ffa6: 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); 1ffa8: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 1ffaa: 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); 1ffac: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 1ffae: 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); 1ffb0: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 1ffb2: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 1ffb4: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 1ffb6: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 1ffb8: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 1ffba: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 1ffbc: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 1ffbe: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 1ffc0: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1ffc4: 8b 7f andi r24, 0xFB ; 251 1ffc6: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 1ffca: 9f b7 in r25, 0x3f ; 63 1ffcc: f8 94 cli 1ffce: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 1ffd2: 84 60 ori r24, 0x04 ; 4 1ffd4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 1ffd8: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 1ffda: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1ffde: 8f 77 andi r24, 0x7F ; 127 1ffe0: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 1ffe4: 9f b7 in r25, 0x3f ; 63 1ffe6: f8 94 cli 1ffe8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 1ffec: 80 68 ori r24, 0x80 ; 128 1ffee: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 1fff2: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 1fff4: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 1fff6: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 1fff8: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 1fffa: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 1fffc: 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(); 1fffe: 17 9a sbi 0x02, 7 ; 2 20000: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d 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); 20004: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 20006: 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(); 20008: 16 9a sbi 0x02, 6 ; 2 2000a: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 2000e: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 20010: 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); 20012: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 20014: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 20016: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 2001c: 8f 7e andi r24, 0xEF ; 239 2001e: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 20026: 88 60 ori r24, 0x08 ; 8 20028: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 20030: 8d 7f andi r24, 0xFD ; 253 20032: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 2003a: 8e 7f andi r24, 0xFE ; 254 2003c: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 20044: 8f 73 andi r24, 0x3F ; 63 20046: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 2004e: 8f 7c andi r24, 0xCF ; 207 20050: 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< 20058: 88 7f andi r24, 0xF8 ; 248 2005a: 82 60 ori r24, 0x02 ; 2 2005c: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 20060: 80 e0 ldi r24, 0x00 ; 0 20062: 90 e4 ldi r25, 0x40 ; 64 20064: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 20068: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 2006c: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 20070: 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; 20074: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 20078: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> nextAdvanceISR = ADV_NEVER; 2007c: 8f ef ldi r24, 0xFF ; 255 2007e: 9f ef ldi r25, 0xFF ; 255 20080: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 20084: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> main_Rate = ADV_NEVER; 20088: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.491+0x1> 2008c: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.491> current_adv_steps = 0; 20090: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 20094: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 20098: 81 e0 ldi r24, 0x01 ; 1 2009a: 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(); 2009e: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 200a2: 82 60 ori r24, 0x02 ; 2 200a4: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 200a8: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 200aa: 81 e0 ldi r24, 0x01 ; 1 200ac: 11 11 cpse r17, r1 200ae: 01 c0 rjmp .+2 ; 0x200b2 200b0: 80 e0 ldi r24, 0x00 ; 0 200b2: 80 93 69 06 sts 0x0669, r24 ; 0x800669 update_mode_profile(); 200b6: 0f 94 45 aa call 0x3548a ; 0x3548a 200ba: 0e 94 cc f8 call 0x1f198 ; 0x1f198 200be: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 200c0: 82 70 andi r24, 0x02 ; 2 200c2: 0f 94 eb 3a call 0x275d6 ; 0x275d6 setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 200c6: 0f 94 f5 ca call 0x395ea ; 0x395ea // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 200ca: 80 e4 ldi r24, 0x40 ; 64 200cc: 97 e0 ldi r25, 0x07 ; 7 200ce: 0e 94 0f 6d call 0xda1e ; 0xda1e plan_set_position_curposXYZE(); 200d2: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 200d6: b1 10 cpse r11, r1 200d8: 08 c0 rjmp .+16 ; 0x200ea } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 200da: 86 e5 ldi r24, 0x56 ; 86 200dc: 9d e6 ldi r25, 0x6D ; 109 200de: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 200e2: 8a e0 ldi r24, 0x0A ; 10 200e4: 9d e6 ldi r25, 0x6D ; 109 200e6: 0f 94 d6 34 call 0x269ac ; 0x269ac } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 200ea: 84 e9 ldi r24, 0x94 ; 148 200ec: 9c e0 ldi r25, 0x0C ; 12 200ee: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 200f2: 82 34 cpi r24, 0x42 ; 66 200f4: 59 f4 brne .+22 ; 0x2010c 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); 200f6: 6f ef ldi r22, 0xFF ; 255 200f8: 84 e9 ldi r24, 0x94 ; 148 200fa: 9c e0 ldi r25, 0x0C ; 12 200fc: 0f 94 57 dd call 0x3baae ; 0x3baae // 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); 20100: 85 e9 ldi r24, 0x95 ; 149 20102: 9c e0 ldi r25, 0x0C ; 12 20104: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a lcd_show_fullscreen_message_and_wait_P(kill_msg); 20108: 0f 94 d6 34 call 0x269ac ; 0x269ac // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 2010c: 0f 94 ef 85 call 0x30bde ; 0x30bde #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 20110: 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); 20112: 8b eb ldi r24, 0xBB ; 187 20114: 9f e0 ldi r25, 0x0F ; 15 20116: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2011a: 91 e0 ldi r25, 0x01 ; 1 2011c: 81 30 cpi r24, 0x01 ; 1 2011e: 09 f0 breq .+2 ; 0x20122 20120: 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; } 20122: 90 93 dc 16 sts 0x16DC, r25 ; 0x8016dc // 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(); 20126: 81 e0 ldi r24, 0x01 ; 1 20128: 0f 94 f3 7f call 0x2ffe6 ; 0x2ffe6 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 2012c: 60 e0 ldi r22, 0x00 ; 0 2012e: 84 e6 ldi r24, 0x64 ; 100 20130: 9f e0 ldi r25, 0x0F ; 15 20132: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 20136: 60 e0 ldi r22, 0x00 ; 0 20138: 86 e6 ldi r24, 0x66 ; 102 2013a: 9f e0 ldi r25, 0x0F ; 15 2013c: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 20140: 60 e0 ldi r22, 0x00 ; 0 20142: 88 e6 ldi r24, 0x68 ; 104 20144: 9f e0 ldi r25, 0x0F ; 15 20146: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 2014a: 60 e0 ldi r22, 0x00 ; 0 2014c: 85 e6 ldi r24, 0x65 ; 101 2014e: 9f e0 ldi r25, 0x0F ; 15 20150: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 20154: 70 e0 ldi r23, 0x00 ; 0 20156: 60 e0 ldi r22, 0x00 ; 0 20158: 8f ef ldi r24, 0xFF ; 255 2015a: 9e e0 ldi r25, 0x0E ; 14 2015c: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 20160: 70 e0 ldi r23, 0x00 ; 0 20162: 60 e0 ldi r22, 0x00 ; 0 20164: 85 e0 ldi r24, 0x05 ; 5 20166: 9f e0 ldi r25, 0x0F ; 15 20168: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 2016c: 70 e0 ldi r23, 0x00 ; 0 2016e: 60 e0 ldi r22, 0x00 ; 0 20170: 83 e0 ldi r24, 0x03 ; 3 20172: 9f e0 ldi r25, 0x0F ; 15 20174: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 20178: 70 e0 ldi r23, 0x00 ; 0 2017a: 60 e0 ldi r22, 0x00 ; 0 2017c: 81 e0 ldi r24, 0x01 ; 1 2017e: 9f e0 ldi r25, 0x0F ; 15 20180: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 20184: 70 e0 ldi r23, 0x00 ; 0 20186: 60 e0 ldi r22, 0x00 ; 0 20188: 83 ed ldi r24, 0xD3 ; 211 2018a: 9e e0 ldi r25, 0x0E ; 14 2018c: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 20190: 70 e0 ldi r23, 0x00 ; 0 20192: 60 e0 ldi r22, 0x00 ; 0 20194: 80 ed ldi r24, 0xD0 ; 208 20196: 9e e0 ldi r25, 0x0E ; 14 20198: 0e 94 0d 78 call 0xf01a ; 0xf01a eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 2019c: 60 e0 ldi r22, 0x00 ; 0 2019e: 82 ed ldi r24, 0xD2 ; 210 201a0: 9e e0 ldi r25, 0x0E ; 14 201a2: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 201a6: 60 e0 ldi r22, 0x00 ; 0 201a8: 8f ec ldi r24, 0xCF ; 207 201aa: 9e e0 ldi r25, 0x0E ; 14 201ac: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 201b0: 88 ea ldi r24, 0xA8 ; 168 201b2: 9c e0 ldi r25, 0x0C ; 12 201b4: 0f 94 fc 7a call 0x2f5f8 ; 0x2f5f8 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 201b8: 81 ea ldi r24, 0xA1 ; 161 201ba: 9d e0 ldi r25, 0x0D ; 13 201bc: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 201c0: 8f 3f cpi r24, 0xFF ; 255 201c2: 71 f4 brne .+28 ; 0x201e0 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 201c4: 60 e0 ldi r22, 0x00 ; 0 201c6: 81 ea ldi r24, 0xA1 ; 161 201c8: 9d e0 ldi r25, 0x0D ; 13 201ca: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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); 201ce: 88 ef ldi r24, 0xF8 ; 248 201d0: 9f e0 ldi r25, 0x0F ; 15 201d2: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 201d6: bc 01 movw r22, r24 201d8: 80 e5 ldi r24, 0x50 ; 80 201da: 9d e0 ldi r25, 0x0D ; 13 201dc: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 201e0: 39 e4 ldi r19, 0x49 ; 73 201e2: c3 2e mov r12, r19 201e4: 3d e0 ldi r19, 0x0D ; 13 201e6: d3 2e mov r13, r19 201e8: 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); 201ea: be 01 movw r22, r28 201ec: 6f 5f subi r22, 0xFF ; 255 201ee: 7f 4f sbci r23, 0xFF ; 255 201f0: 81 2f mov r24, r17 201f2: 0e 94 8d 78 call 0xf11a ; 0xf11a eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 201f6: ae 01 movw r20, r28 201f8: 4f 5f subi r20, 0xFF ; 255 201fa: 5f 4f sbci r21, 0xFF ; 255 201fc: 67 e0 ldi r22, 0x07 ; 7 201fe: 70 e0 ldi r23, 0x00 ; 0 20200: c6 01 movw r24, r12 20202: 0e 94 ee 77 call 0xefdc ; 0xefdc 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++) { 20206: 1f 5f subi r17, 0xFF ; 255 20208: ab e0 ldi r26, 0x0B ; 11 2020a: ca 0e add r12, r26 2020c: d1 1c adc r13, r1 2020e: 18 30 cpi r17, 0x08 ; 8 20210: 61 f7 brne .-40 ; 0x201ea 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)))) 20212: 81 ea ldi r24, 0xA1 ; 161 20214: 9d e0 ldi r25, 0x0D ; 13 20216: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2021a: 0e 94 5d 78 call 0xf0ba ; 0xf0ba 2021e: 81 11 cpse r24, r1 20220: 02 c0 rjmp .+4 ; 0x20226 { eeprom_switch_to_next_sheet(); 20222: 0e 94 7f 78 call 0xf0fe ; 0xf0fe } check_babystep(); 20226: 0e 94 9b 7b call 0xf736 ; 0xf736 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 2022a: 80 e8 ldi r24, 0x80 ; 128 2022c: 9c e0 ldi r25, 0x0C ; 12 2022e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 20232: 8f 3f cpi r24, 0xFF ; 255 20234: 41 f4 brne .+16 ; 0x20246 #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); 20236: 4e e0 ldi r20, 0x0E ; 14 20238: 50 e0 ldi r21, 0x00 ; 0 2023a: 60 e8 ldi r22, 0x80 ; 128 2023c: 7c e0 ldi r23, 0x0C ; 12 2023e: 81 ee ldi r24, 0xE1 ; 225 20240: 92 e0 ldi r25, 0x02 ; 2 20242: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 #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); 20246: 85 e0 ldi r24, 0x05 ; 5 20248: 9d e0 ldi r25, 0x0D ; 13 2024a: 0f 94 fc 7a call 0x2f5f8 ; 0x2f5f8 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 2024e: 8d ee ldi r24, 0xED ; 237 20250: 9f e0 ldi r25, 0x0F ; 15 20252: 0f 94 fc 7a call 0x2f5f8 ; 0x2f5f8 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 20256: 81 ef ldi r24, 0xF1 ; 241 20258: 9f e0 ldi r25, 0x0F ; 15 2025a: 0f 94 fc 7a call 0x2f5f8 ; 0x2f5f8 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 2025e: 60 e0 ldi r22, 0x00 ; 0 20260: 8e ec ldi r24, 0xCE ; 206 20262: 9e e0 ldi r25, 0x0E ; 14 20264: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 20268: 61 e0 ldi r22, 0x01 ; 1 2026a: 87 ea ldi r24, 0xA7 ; 167 2026c: 9c e0 ldi r25, 0x0C ; 12 2026e: 0e 94 25 78 call 0xf04a ; 0xf04a putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 20272: 8e ef ldi r24, 0xFE ; 254 20274: 9f e0 ldi r25, 0x0F ; 15 20276: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2027a: 0e 94 7a 73 call 0xe6f4 ; 0xe6f4 2027e: 81 11 cpse r24, r1 20280: 02 c0 rjmp .+4 ; 0x20286 lcd_language(); 20282: 0f 94 2e 26 call 0x24c5c ; 0x24c5c lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 20286: 60 e0 ldi r22, 0x00 ; 0 20288: 8f ea ldi r24, 0xAF ; 175 2028a: 9f e0 ldi r25, 0x0F ; 15 2028c: 0e 94 25 78 call 0xf04a ; 0xf04a if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 20290: 86 ea ldi r24, 0xA6 ; 166 20292: 9f e0 ldi r25, 0x0F ; 15 20294: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 20298: 8f 3f cpi r24, 0xFF ; 255 2029a: d9 f4 brne .+54 ; 0x202d2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2029c: 61 e0 ldi r22, 0x01 ; 1 2029e: 86 ea ldi r24, 0xA6 ; 166 202a0: 9f e0 ldi r25, 0x0F ; 15 202a2: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 202a6: 20 eb ldi r18, 0xB0 ; 176 202a8: c2 2e mov r12, r18 202aa: 2f e0 ldi r18, 0x0F ; 15 202ac: 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); 202ae: 70 e0 ldi r23, 0x00 ; 0 202b0: 60 e0 ldi r22, 0x00 ; 0 202b2: c6 01 movw r24, r12 202b4: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 202b8: b2 e0 ldi r27, 0x02 ; 2 202ba: cb 0e add r12, r27 202bc: 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++) { 202be: ea eb ldi r30, 0xBA ; 186 202c0: ce 16 cp r12, r30 202c2: ef e0 ldi r30, 0x0F ; 15 202c4: de 06 cpc r13, r30 202c6: 99 f7 brne .-26 ; 0x202ae if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 202c8: 60 e0 ldi r22, 0x00 ; 0 202ca: 8f ea ldi r24, 0xAF ; 175 202cc: 9f e0 ldi r25, 0x0F ; 15 202ce: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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); 202d2: 60 e0 ldi r22, 0x00 ; 0 202d4: 85 ea ldi r24, 0xA5 ; 165 202d6: 9f e0 ldi r25, 0x0F ; 15 202d8: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 202dc: 60 e0 ldi r22, 0x00 ; 0 202de: 8f e7 ldi r24, 0x7F ; 127 202e0: 9c e0 ldi r25, 0x0C ; 12 202e2: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 202e6: 60 e0 ldi r22, 0x00 ; 0 202e8: 89 e0 ldi r24, 0x09 ; 9 202ea: 9f e0 ldi r25, 0x0F ; 15 202ec: 0e 94 25 78 call 0xf04a ; 0xf04a } 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); 202f0: 61 e0 ldi r22, 0x01 ; 1 202f2: 8c ea ldi r24, 0xAC ; 172 202f4: 9d e0 ldi r25, 0x0D ; 13 202f6: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 202fa: 63 e0 ldi r22, 0x03 ; 3 202fc: 8b ea ldi r24, 0xAB ; 171 202fe: 9d e0 ldi r25, 0x0D ; 13 20300: 0e 94 25 78 call 0xf04a ; 0xf04a eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 20304: 63 e0 ldi r22, 0x03 ; 3 20306: 8a ea ldi r24, 0xAA ; 170 20308: 9d e0 ldi r25, 0x0D ; 13 2030a: 0e 94 25 78 call 0xf04a ; 0xf04a //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 2030e: 61 e0 ldi r22, 0x01 ; 1 20310: 89 ea ldi r24, 0xA9 ; 169 20312: 9d e0 ldi r25, 0x0D ; 13 20314: 0e 94 25 78 call 0xf04a ; 0xf04a #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 20318: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 2031a: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 2031c: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20320: 8f 7b andi r24, 0xBF ; 191 20322: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 20326: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 2032a: 80 68 ori r24, 0x80 ; 128 2032c: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 20330: 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); 20332: 84 e0 ldi r24, 0x04 ; 4 20334: 80 93 96 02 sts 0x0296, r24 ; 0x800296 void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 20338: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 2033a: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 2033c: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 2033e: 50 9a sbi 0x0a, 0 ; 10 20340: 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); 20342: 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); 20344: f5 e0 ldi r31, 0x05 ; 5 20346: fa 95 dec r31 20348: f1 f7 brne .-4 ; 0x20346 2034a: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 2034c: 58 98 cbi 0x0b, 0 ; 11 2034e: 25 e0 ldi r18, 0x05 ; 5 20350: 2a 95 dec r18 20352: f1 f7 brne .-4 ; 0x20350 20354: 00 00 nop 20356: 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++) { 20358: a1 f7 brne .-24 ; 0x20342 WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 2035a: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 2035c: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 2035e: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 20362: 8c 7f andi r24, 0xFC ; 252 20364: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 20368: 8c e0 ldi r24, 0x0C ; 12 2036a: 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); 2036e: 84 ea ldi r24, 0xA4 ; 164 20370: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 20374: 88 e0 ldi r24, 0x08 ; 8 20376: 0f 94 c2 3e call 0x27d84 ; 0x27d84 2037a: 81 11 cpse r24, r1 2037c: 14 c0 rjmp .+40 ; 0x203a6 return 1; // send address TWDR = TW_WRITE | (address << 1); 2037e: 8a ee ldi r24, 0xEA ; 234 20380: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 20384: 84 e8 ldi r24, 0x84 ; 132 20386: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2038a: 88 e1 ldi r24, 0x18 ; 24 2038c: 0f 94 c2 3e call 0x27d84 ; 0x27d84 20390: 81 11 cpse r24, r1 20392: 09 c0 rjmp .+18 ; 0x203a6 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 20394: 84 e9 ldi r24, 0x94 ; 148 20396: 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)); 2039a: 89 e2 ldi r24, 0x29 ; 41 2039c: 92 e4 ldi r25, 0x42 ; 66 2039e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 203a2: 0f 94 d6 34 call 0x269ac ; 0x269ac #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 203a6: 02 30 cpi r16, 0x02 ; 2 203a8: 81 f0 breq .+32 ; 0x203ca 203aa: 03 30 cpi r16, 0x03 ; 3 203ac: 09 f4 brne .+2 ; 0x203b0 203ae: 37 c1 rjmp .+622 ; 0x2061e 203b0: 01 30 cpi r16, 0x01 ; 1 203b2: b9 f4 brne .+46 ; 0x203e2 //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)); 203b4: 8b e5 ldi r24, 0x5B ; 91 203b6: 94 e4 ldi r25, 0x44 ; 68 203b8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 203bc: 0f 94 d6 34 call 0x269ac ; 0x269ac 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); 203c0: 66 e3 ldi r22, 0x36 ; 54 203c2: 71 e0 ldi r23, 0x01 ; 1 203c4: 8c ee ldi r24, 0xEC ; 236 203c6: 9e e0 ldi r25, 0x0E ; 14 203c8: 0a c0 rjmp .+20 ; 0x203de eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 203ca: 8a e3 ldi r24, 0x3A ; 58 203cc: 94 e4 ldi r25, 0x44 ; 68 203ce: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 203d2: 0f 94 d6 34 call 0x269ac ; 0x269ac 203d6: 6e e2 ldi r22, 0x2E ; 46 203d8: 71 e0 ldi r23, 0x01 ; 1 203da: 8e ee ldi r24, 0xEE ; 238 203dc: 9e e0 ldi r25, 0x0E ; 14 203de: 0f 94 6d dd call 0x3bada ; 0x3bada eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 203e2: f1 10 cpse r15, r1 203e4: 08 c0 rjmp .+16 ; 0x203f6 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 203e6: 83 ec ldi r24, 0xC3 ; 195 203e8: 93 e4 ldi r25, 0x43 ; 67 203ea: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 203ee: 0f 94 d6 34 call 0x269ac ; 0x269ac Config_StoreSettings(); 203f2: 0e 94 60 84 call 0x108c0 ; 0x108c0 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 203f6: 80 e8 ldi r24, 0x80 ; 128 203f8: 0e 94 41 f8 call 0x1f082 ; 0x1f082 203fc: 88 23 and r24, r24 203fe: c9 f0 breq .+50 ; 0x20432 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 20400: 87 ef ldi r24, 0xF7 ; 247 20402: 9f e0 ldi r25, 0x0F ; 15 20404: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 20408: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 2040a: 81 30 cpi r24, 0x01 ; 1 2040c: 71 f4 brne .+28 ; 0x2042a // 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)) { 2040e: 8f ea ldi r24, 0xAF ; 175 20410: 90 e9 ldi r25, 0x90 ; 144 20412: 0e 94 e1 d1 call 0x1a3c2 ; 0x1a3c2 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); 20416: 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)) { 20418: 88 23 and r24, r24 2041a: 39 f0 breq .+14 ; 0x2042a // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 2041c: 81 e8 ldi r24, 0x81 ; 129 2041e: 93 e4 ldi r25, 0x43 ; 67 20420: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20424: 0f 94 d6 34 call 0x269ac ; 0x269ac calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 20428: 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); 2042a: 86 ea ldi r24, 0xA6 ; 166 2042c: 9c e0 ldi r25, 0x0C ; 12 2042e: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 20432: 87 ea ldi r24, 0xA7 ; 167 20434: 90 e9 ldi r25, 0x90 ; 144 20436: 0e 94 e1 d1 call 0x1a3c2 ; 0x1a3c2 2043a: f8 2e mov r15, r24 2043c: 88 23 and r24, r24 2043e: 31 f0 breq .+12 ; 0x2044c if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 20440: 8f e1 ldi r24, 0x1F ; 31 20442: 0e 94 41 f8 call 0x1f082 ; 0x1f082 20446: 91 e0 ldi r25, 0x01 ; 1 20448: f8 2e mov r15, r24 2044a: 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; 2044c: 10 e0 ldi r17, 0x00 ; 0 2044e: 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)); 20450: f8 01 movw r30, r16 20452: e8 56 subi r30, 0x68 ; 104 20454: ff 46 sbci r31, 0x6F ; 111 20456: 64 91 lpm r22, Z 20458: c8 01 movw r24, r16 2045a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 2045e: 0f 5f subi r16, 0xFF ; 255 20460: 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){ 20462: 0a 30 cpi r16, 0x0A ; 10 20464: 11 05 cpc r17, r1 20466: a1 f7 brne .-24 ; 0x20450 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])); 20468: e7 ea ldi r30, 0xA7 ; 167 2046a: f0 e9 ldi r31, 0x90 ; 144 2046c: 65 91 lpm r22, Z+ 2046e: 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); 20470: 8a e0 ldi r24, 0x0A ; 10 20472: 90 e0 ldi r25, 0x00 ; 0 20474: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 20478: e9 ea ldi r30, 0xA9 ; 169 2047a: f0 e9 ldi r31, 0x90 ; 144 2047c: 65 91 lpm r22, Z+ 2047e: 74 91 lpm r23, Z 20480: 8c e0 ldi r24, 0x0C ; 12 20482: 90 e0 ldi r25, 0x00 ; 0 20484: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 20488: eb ea ldi r30, 0xAB ; 171 2048a: f0 e9 ldi r31, 0x90 ; 144 2048c: 65 91 lpm r22, Z+ 2048e: 74 91 lpm r23, Z 20490: 8e e0 ldi r24, 0x0E ; 14 20492: 90 e0 ldi r25, 0x00 ; 0 20494: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 // 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])); 20498: ed ea ldi r30, 0xAD ; 173 2049a: f0 e9 ldi r31, 0x90 ; 144 2049c: 65 91 lpm r22, Z+ 2049e: 74 91 lpm r23, Z 204a0: 80 e1 ldi r24, 0x10 ; 16 204a2: 90 e0 ldi r25, 0x00 ; 0 204a4: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 204a8: 8f e5 ldi r24, 0x5F ; 95 204aa: 9f e0 ldi r25, 0x0F ; 15 204ac: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 204b0: 88 23 and r24, r24 204b2: 09 f4 brne .+2 ; 0x204b6 204b4: c1 c0 rjmp .+386 ; 0x20638 // first time run of wizard or service prep lcd_wizard(WizState::Run); 204b6: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 204b8: 0f 94 90 64 call 0x2c920 ; 0x2c920 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 204bc: 83 e0 ldi r24, 0x03 ; 3 204be: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 204c2: 81 e0 ldi r24, 0x01 ; 1 204c4: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_clear(); 204c8: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_update(2); 204cc: 82 e0 ldi r24, 0x02 ; 2 204ce: 0e 94 ed 6f call 0xdfda ; 0xdfda #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 204d2: 60 e0 ldi r22, 0x00 ; 0 204d4: 8e ef ldi r24, 0xFE ; 254 204d6: 9e e0 ldi r25, 0x0E ; 14 204d8: 0e 94 25 78 call 0xf04a ; 0xf04a 204dc: 80 93 f3 04 sts 0x04F3, r24 ; 0x8004f3 tmc2130_home_bsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_BSTEPS, 48); 204e0: 60 e3 ldi r22, 0x30 ; 48 204e2: 8d ef ldi r24, 0xFD ; 253 204e4: 9e e0 ldi r25, 0x0E ; 14 204e6: 0e 94 25 78 call 0xf04a ; 0xf04a 204ea: 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); 204ee: 60 e3 ldi r22, 0x30 ; 48 204f0: 8c ef ldi r24, 0xFC ; 252 204f2: 9e e0 ldi r25, 0x0E ; 14 204f4: 0e 94 25 78 call 0xf04a ; 0xf04a 204f8: 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); 204fc: 60 e0 ldi r22, 0x00 ; 0 204fe: 8b ef ldi r24, 0xFB ; 251 20500: 9e e0 ldi r25, 0x0E ; 14 20502: 0e 94 25 78 call 0xf04a ; 0xf04a 20506: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 tmc2130_home_bsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_BSTEPS, 48); 2050a: 60 e3 ldi r22, 0x30 ; 48 2050c: 8a ef ldi r24, 0xFA ; 250 2050e: 9e e0 ldi r25, 0x0E ; 14 20510: 0e 94 25 78 call 0xf04a ; 0xf04a 20514: 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); 20518: 60 e3 ldi r22, 0x30 ; 48 2051a: 89 ef ldi r24, 0xF9 ; 249 2051c: 9e e0 ldi r25, 0x0E ; 14 2051e: 0e 94 25 78 call 0xf04a ; 0xf04a 20522: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 20526: 60 e0 ldi r22, 0x00 ; 0 20528: 88 ef ldi r24, 0xF8 ; 248 2052a: 9e e0 ldi r25, 0x0E ; 14 2052c: 0e 94 25 78 call 0xf04a ; 0xf04a 20530: 80 93 f2 04 sts 0x04F2, r24 ; 0x8004f2 static void fw_crash_init() { #ifdef XFLASH_DUMP dump_crash_reason crash_reason; if(xfdump_check_state(&crash_reason)) 20534: ce 01 movw r24, r28 20536: 01 96 adiw r24, 0x01 ; 1 20538: 0e 94 ba e2 call 0x1c574 ; 0x1c574 2053c: 88 23 and r24, r24 2053e: 89 f0 breq .+34 ; 0x20562 { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 20540: 81 ee ldi r24, 0xE1 ; 225 20542: 9d e6 ldi r25, 0x6D ; 109 20544: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 20548: 89 81 ldd r24, Y+1 ; 0x01 2054a: 88 23 and r24, r24 2054c: 51 f0 breq .+20 ; 0x20562 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 2054e: 83 e0 ldi r24, 0x03 ; 3 20550: 9d e0 ldi r25, 0x0D ; 13 20552: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e { // 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 && 20556: 8f 3f cpi r24, 0xFF ; 255 20558: 21 f0 breq .+8 ; 0x20562 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 2055a: 8d e6 ldi r24, 0x6D ; 109 2055c: 9d e6 ldi r25, 0x6D ; 109 2055e: 0f 94 d6 34 call 0x269ac ; 0x269ac if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20562: 6f ef ldi r22, 0xFF ; 255 20564: 83 e0 ldi r24, 0x03 ; 3 20566: 9d e0 ldi r25, 0x0D ; 13 20568: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 2056c: 0e 94 c1 68 call 0xd182 ; 0xd182 20570: 88 23 and r24, r24 20572: d9 f1 breq .+118 ; 0x205ea manage_heater(); // Update temperatures 20574: 0f 94 66 4d call 0x29acc ; 0x29acc //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 20578: 8c e8 ldi r24, 0x8C ; 140 2057a: 9f e0 ldi r25, 0x0F ; 15 2057c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 20580: 08 2f mov r16, r24 20582: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 20586: 80 90 ee 04 lds r8, 0x04EE ; 0x8004ee 2058a: 90 90 ef 04 lds r9, 0x04EF ; 0x8004ef 2058e: a0 90 f0 04 lds r10, 0x04F0 ; 0x8004f0 20592: b0 90 f1 04 lds r11, 0x04F1 ; 0x8004f1 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER printf_P(_N("Power panic detected!\nCurrent bed temp:%d\nSaved bed temp:%d\n"), (int)degBed(), eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED)); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER uvlo_auto_recovery_ready = (degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET)); 20596: 8b e8 ldi r24, 0x8B ; 139 20598: 9f e0 ldi r25, 0x0F ; 15 2059a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2059e: 68 2f mov r22, r24 205a0: 70 e0 ldi r23, 0x00 ; 0 205a2: 90 e0 ldi r25, 0x00 ; 0 205a4: 80 e0 ldi r24, 0x00 ; 0 205a6: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 205aa: 20 e0 ldi r18, 0x00 ; 0 205ac: 30 e0 ldi r19, 0x00 ; 0 205ae: 40 ea ldi r20, 0xA0 ; 160 205b0: 50 e4 ldi r21, 0x40 ; 64 205b2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 205b6: 6b 01 movw r12, r22 205b8: 7c 01 movw r14, r24 205ba: 11 e0 ldi r17, 0x01 ; 1 205bc: ac 01 movw r20, r24 205be: 9b 01 movw r18, r22 205c0: c5 01 movw r24, r10 205c2: b4 01 movw r22, r8 205c4: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 205c8: 18 16 cp r1, r24 205ca: 0c f0 brlt .+2 ; 0x205ce 205cc: 10 e0 ldi r17, 0x00 ; 0 205ce: 10 93 ed 04 sts 0x04ED, r17 ; 0x8004ed <_ZL24uvlo_auto_recovery_ready.lto_priv.549> if (uvlo_auto_recovery_ready){ 205d2: a7 01 movw r20, r14 205d4: 96 01 movw r18, r12 205d6: c5 01 movw r24, r10 205d8: b4 01 movw r22, r8 205da: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 205de: 18 16 cp r1, r24 205e0: 0c f0 brlt .+2 ; 0x205e4 205e2: 58 c0 rjmp .+176 ; 0x20694 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 205e4: 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); 205e6: 0f 94 7f d2 call 0x3a4fe ; 0x3a4fe printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 205ea: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 205ec: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 205ee: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 205f2: 81 60 ori r24, 0x01 ; 1 205f4: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 205f8: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 205fc: 8d 7f andi r24, 0xFD ; 253 205fe: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 20602: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 20604: 64 99 sbic 0x0c, 4 ; 12 20606: 57 c0 rjmp .+174 ; 0x206b6 20608: 0e 94 c1 68 call 0xd182 ; 0xd182 2060c: 88 23 and r24, r24 2060e: 09 f4 brne .+2 ; 0x20612 20610: 52 c0 rjmp .+164 ; 0x206b6 { SERIAL_ECHOLNRPGM(MSG_INT4); 20612: 82 ea ldi r24, 0xA2 ; 162 20614: 90 e9 ldi r25, 0x90 ; 144 20616: 0e 94 97 7b call 0xf72e ; 0xf72e uvlo_drain_reset(); 2061a: 0f 94 b8 a9 call 0x35370 ; 0x35370 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)); 2061e: 8f ef ldi r24, 0xFF ; 255 20620: 93 e4 ldi r25, 0x43 ; 67 20622: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20626: 0f 94 d6 34 call 0x269ac ; 0x269ac 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); 2062a: 6e e2 ldi r22, 0x2E ; 46 2062c: 71 e0 ldi r23, 0x01 ; 1 2062e: 8e ee ldi r24, 0xEE ; 238 20630: 9e e0 ldi r25, 0x0E ; 14 20632: 0f 94 6d dd call 0x3bada ; 0x3bada 20636: c4 ce rjmp .-632 ; 0x203c0 // 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); 20638: 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) { 2063a: f1 10 cpse r15, r1 2063c: 3d cf rjmp .-390 ; 0x204b8 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 2063e: 0e 94 41 f8 call 0x1f082 ; 0x1f082 20642: 81 11 cpse r24, r1 20644: 07 c0 rjmp .+14 ; 0x20654 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 20646: 81 e1 ldi r24, 0x11 ; 17 20648: 93 e4 ldi r25, 0x43 ; 67 // 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)); 2064a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2064e: 0f 94 d6 34 call 0x269ac ; 0x269ac 20652: 34 cf rjmp .-408 ; 0x204bc 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)) { 20654: 84 e0 ldi r24, 0x04 ; 4 20656: 0e 94 41 f8 call 0x1f082 ; 0x1f082 2065a: 81 11 cpse r24, r1 2065c: 03 c0 rjmp .+6 ; 0x20664 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 2065e: 89 e9 ldi r24, 0x99 ; 153 20660: 92 e4 ldi r25, 0x42 ; 66 20662: f3 cf rjmp .-26 ; 0x2064a } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 20664: 80 e1 ldi r24, 0x10 ; 16 20666: 0e 94 41 f8 call 0x1f082 ; 0x1f082 2066a: 81 11 cpse r24, r1 2066c: 06 c0 rjmp .+12 ; 0x2067a lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 2066e: 81 e7 ldi r24, 0x71 ; 113 20670: 98 e4 ldi r25, 0x48 ; 72 20672: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20676: 0f 94 d6 34 call 0x269ac ; 0x269ac #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 2067a: 88 e0 ldi r24, 0x08 ; 8 2067c: 0e 94 41 f8 call 0x1f082 ; 0x1f082 20680: 81 11 cpse r24, r1 20682: 1c cf rjmp .-456 ; 0x204bc 20684: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> 20688: 88 23 and r24, r24 2068a: 09 f4 brne .+2 ; 0x2068e 2068c: 17 cf rjmp .-466 ; 0x204bc lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 2068e: 85 e7 ldi r24, 0x75 ; 117 20690: 92 e4 ldi r25, 0x42 ; 66 20692: db cf rjmp .-74 ; 0x2064a 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) { 20694: 01 30 cpi r16, 0x01 ; 1 20696: 11 f4 brne .+4 ; 0x2069c recover_print(0); 20698: 80 e0 ldi r24, 0x00 ; 0 2069a: a5 cf rjmp .-182 ; 0x205e6 } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 2069c: 81 e5 ldi r24, 0x51 ; 81 2069e: 92 e4 ldi r25, 0x42 ; 66 206a0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 206a4: 41 e0 ldi r20, 0x01 ; 1 206a6: 60 e0 ldi r22, 0x00 ; 0 206a8: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce if ( btn == LCD_LEFT_BUTTON_CHOICE) { 206ac: 88 23 and r24, r24 206ae: a1 f3 breq .-24 ; 0x20698 recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 206b0: 0e 94 f3 65 call 0xcbe6 ; 0xcbe6 206b4: 9a cf rjmp .-204 ; 0x205ea ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 206b6: 61 e0 ldi r22, 0x01 ; 1 206b8: 88 ea ldi r24, 0xA8 ; 168 206ba: 9d e0 ldi r25, 0x0D ; 13 206bc: 0e 94 25 78 call 0xf04a ; 0xf04a 206c0: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec if (farm_mode) { oCheckMode = ClCheckMode::_Strict; eeprom_update_byte_notify((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Strict); } oNozzleDiameter = (ClNozzleDiameter)eeprom_init_default_byte((uint8_t *)EEPROM_NOZZLE_DIAMETER, (uint8_t)ClNozzleDiameter::_Diameter_400); 206c4: 68 e2 ldi r22, 0x28 ; 40 206c6: 87 ea ldi r24, 0xA7 ; 167 206c8: 9d e0 ldi r25, 0x0D ; 13 206ca: 0e 94 25 78 call 0xf04a ; 0xf04a 206ce: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 206d2: 60 e9 ldi r22, 0x90 ; 144 206d4: 71 e0 ldi r23, 0x01 ; 1 206d6: 85 ea ldi r24, 0xA5 ; 165 206d8: 9d e0 ldi r25, 0x0D ; 13 206da: 0e 94 0d 78 call 0xf01a ; 0xf01a oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 206de: 61 e0 ldi r22, 0x01 ; 1 206e0: 84 ea ldi r24, 0xA4 ; 164 206e2: 9d e0 ldi r25, 0x0D ; 13 206e4: 0e 94 25 78 call 0xf04a ; 0xf04a 206e8: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 206ec: 61 e0 ldi r22, 0x01 ; 1 206ee: 83 ea ldi r24, 0xA3 ; 163 206f0: 9d e0 ldi r25, 0x0D ; 13 206f2: 0e 94 25 78 call 0xf04a ; 0xf04a 206f6: 80 93 e9 04 sts 0x04E9, r24 ; 0x8004e9 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 206fa: 61 e0 ldi r22, 0x01 ; 1 206fc: 82 ea ldi r24, 0xA2 ; 162 206fe: 9d e0 ldi r25, 0x0D ; 13 20700: 0e 94 25 78 call 0xf04a ; 0xf04a 20704: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 20708: 61 e0 ldi r22, 0x01 ; 1 2070a: 80 e2 ldi r24, 0x20 ; 32 2070c: 9c e0 ldi r25, 0x0C ; 12 2070e: 0e 94 25 78 call 0xf04a ; 0xf04a 20712: 80 93 e7 04 sts 0x04E7, r24 ; 0x8004e7 // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 20716: 81 e0 ldi r24, 0x01 ; 1 20718: 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" ); 2071c: 88 e1 ldi r24, 0x18 ; 24 2071e: 98 e2 ldi r25, 0x28 ; 40 20720: 0f b6 in r0, 0x3f ; 63 20722: f8 94 cli 20724: a8 95 wdr 20726: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2072a: 0f be out 0x3f, r0 ; 63 2072c: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 20730: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 20734: 80 64 ori r24, 0x40 ; 64 20736: 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; 2073a: 85 e0 ldi r24, 0x05 ; 5 2073c: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 2073e: 00 e0 ldi r16, 0x00 ; 0 20740: 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); 20742: cc 24 eor r12, r12 20744: 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); 20746: 94 e0 ldi r25, 0x04 ; 4 20748: 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; 2074a: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a if(Stopped) { 2074e: 80 91 11 05 lds r24, 0x0511 ; 0x800511 20752: 88 23 and r24, r24 20754: 09 f4 brne .+2 ; 0x20758 20756: c4 c0 rjmp .+392 ; 0x208e0 // 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); 20758: 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. 2075c: 0e 94 cb 68 call 0xd196 ; 0xd196 20760: 88 23 and r24, r24 20762: 09 f4 brne .+2 ; 0x20766 20764: c0 c0 rjmp .+384 ; 0x208e6 20766: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2076a: 81 30 cpi r24, 0x01 ; 1 2076c: 09 f0 breq .+2 ; 0x20770 2076e: bb c0 rjmp .+374 ; 0x208e6 usb_timer.start(); 20770: 8e e0 ldi r24, 0x0E ; 14 20772: 95 e0 ldi r25, 0x05 ; 5 20774: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> } else #endif { get_command(); 20778: 0e 94 dc 84 call 0x109b8 ; 0x109b8 // 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) 2077c: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.569> 20780: 88 23 and r24, r24 20782: 89 f0 breq .+34 ; 0x207a6 return; if(autostart_atmillis.expired(5000)) 20784: 68 e8 ldi r22, 0x88 ; 136 20786: 73 e1 ldi r23, 0x13 ; 19 20788: 8c e7 ldi r24, 0x7C ; 124 2078a: 97 e1 ldi r25, 0x17 ; 23 2078c: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 20790: 81 11 cpse r24, r1 20792: 09 c0 rjmp .+18 ; 0x207a6 return; } autostart_stilltocheck = false; 20794: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.569> if(!mounted) 20798: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 2079c: 88 23 and r24, r24 2079e: 09 f4 brne .+2 ; 0x207a2 207a0: ae c0 rjmp .+348 ; 0x208fe 207a2: 0f 94 56 76 call 0x2ecac ; 0x2ecac #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 207a6: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 207aa: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 207ae: 89 2b or r24, r25 207b0: 09 f4 brne .+2 ; 0x207b4 207b2: 61 c0 rjmp .+194 ; 0x20876 { cmdbuffer_front_already_processed = false; 207b4: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d #ifdef SDSUPPORT if(card.saving) 207b8: 80 91 69 14 lds r24, 0x1469 ; 0x801469 207bc: 88 23 and r24, r24 207be: d1 f1 breq .+116 ; 0x20834 { // 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) { 207c0: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 207c4: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 207c8: dc 01 movw r26, r24 207ca: ad 57 subi r26, 0x7D ; 125 207cc: bf 4e sbci r27, 0xEF ; 239 207ce: 7d 01 movw r14, r26 207d0: 60 e5 ldi r22, 0x50 ; 80 207d2: 71 e9 ldi r23, 0x91 ; 145 207d4: cd 01 movw r24, r26 207d6: 0f 94 16 db call 0x3b62c ; 0x3b62c 207da: 89 2b or r24, r25 207dc: 09 f0 breq .+2 ; 0x207e0 207de: 9c c0 rjmp .+312 ; 0x20918 else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 207e0: 10 92 fb 16 sts 0x16FB, r1 ; 0x8016fb /** 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)); 207e4: f7 01 movw r30, r14 207e6: 01 90 ld r0, Z+ 207e8: 00 20 and r0, r0 207ea: e9 f7 brne .-6 ; 0x207e6 207ec: 31 97 sbiw r30, 0x01 ; 1 207ee: bf 01 movw r22, r30 207f0: 6e 19 sub r22, r14 207f2: 7f 09 sbc r23, r15 207f4: c7 01 movw r24, r14 207f6: 0f 94 91 82 call 0x30522 ; 0x30522 207fa: 62 e0 ldi r22, 0x02 ; 2 207fc: 70 e0 ldi r23, 0x00 ; 0 207fe: 8f ee ldi r24, 0xEF ; 239 20800: 92 e0 ldi r25, 0x02 ; 2 20802: 0f 94 91 82 call 0x30522 ; 0x30522 file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 20806: 80 91 fb 16 lds r24, 0x16FB ; 0x8016fb 2080a: 88 23 and r24, r24 2080c: 41 f0 breq .+16 ; 0x2081e { SERIAL_ERROR_START; 2080e: 8c ee ldi r24, 0xEC ; 236 20810: 9a ea ldi r25, 0xAA ; 170 20812: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 20816: 80 ec ldi r24, 0xC0 ; 192 20818: 9e e6 ldi r25, 0x6E ; 110 2081a: 0e 94 97 7b call 0xf72e ; 0xf72e card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 2081e: 80 91 6a 14 lds r24, 0x146A ; 0x80146a 20822: 88 23 and r24, r24 20824: 09 f4 brne .+2 ; 0x20828 20826: 73 c0 rjmp .+230 ; 0x2090e */ void process_commands() { if (!buflen) return; //empty command 20828: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 2082c: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 20830: 89 2b or r24, r25 20832: 11 f0 breq .+4 ; 0x20838 20834: 0e 94 b0 97 call 0x12f60 ; 0x12f60 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 20838: 80 91 7d 10 lds r24, 0x107D ; 0x80107d 2083c: 81 11 cpse r24, r1 2083e: 19 c0 rjmp .+50 ; 0x20872 20840: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 20844: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 20848: 89 2b or r24, r25 2084a: 99 f0 breq .+38 ; 0x20872 { // 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; 2084c: e0 91 6d 12 lds r30, 0x126D ; 0x80126d 20850: f0 91 6e 12 lds r31, 0x126E ; 0x80126e 20854: e0 58 subi r30, 0x80 ; 128 20856: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 20858: 80 81 ld r24, Z 2085a: 82 30 cpi r24, 0x02 ; 2 2085c: 09 f0 breq .+2 ; 0x20860 2085e: 6b c0 rjmp .+214 ; 0x20936 { // 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(); 20860: 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; 20862: 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); 20864: 81 81 ldd r24, Z+1 ; 0x01 20866: 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); 20868: 0f 94 ea a9 call 0x353d4 ; 0x353d4 sei(); 2086c: 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(); 2086e: 0e 94 d8 78 call 0xf1b0 ; 0xf1b0 } host_keepalive(); 20872: 0e 94 c3 81 call 0x10386 ; 0x10386 } } //check heater every n milliseconds manage_heater(); 20876: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(printingIsPaused()); 2087a: 0e 94 cb 68 call 0xd196 ; 0xd196 2087e: 0e 94 6b 8c call 0x118d6 ; 0x118d6 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 20882: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.493> 20886: 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; 20888: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.493> checkHitEndstops(); lcd_update(0); 2088c: 80 e0 ldi r24, 0x00 ; 0 2088e: 0e 94 ed 6f call 0xdfda ; 0xdfda #ifdef TMC2130 tmc2130_check_overtemp(); 20892: 0f 94 f0 3e call 0x27de0 ; 0x27de0 if (tmc2130_sg_crash) 20896: 80 91 0d 05 lds r24, 0x050D ; 0x80050d 2089a: 88 23 and r24, r24 2089c: 79 f0 breq .+30 ; 0x208bc { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 2089e: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d // crashdet_stop_and_save_print(); switch (crash) 208a2: 82 30 cpi r24, 0x02 ; 2 208a4: 09 f4 brne .+2 ; 0x208a8 208a6: 53 c0 rjmp .+166 ; 0x2094e 208a8: 83 30 cpi r24, 0x03 ; 3 208aa: 09 f4 brne .+2 ; 0x208ae 208ac: 54 c0 rjmp .+168 ; 0x20956 208ae: 81 30 cpi r24, 0x01 ; 1 208b0: 29 f4 brne .+10 ; 0x208bc { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 208b2: 61 e0 ldi r22, 0x01 ; 1 208b4: 80 e4 ldi r24, 0x40 ; 64 208b6: 91 e9 ldi r25, 0x91 ; 145 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 208b8: 0e 94 dc 89 call 0x113b8 ; 0x113b8 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) { 208bc: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.558> 208c0: 81 11 cpse r24, r1 208c2: 07 c0 rjmp .+14 ; 0x208d2 return; } avoidRecursion = true; 208c4: c0 92 0c 05 sts 0x050C, r12 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.558> mmu_loop_inner(true); 208c8: 81 e0 ldi r24, 0x01 ; 1 208ca: 0f 94 ac 99 call 0x33358 ; 0x33358 avoidRecursion = false; 208ce: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.558> 208d2: 01 15 cp r16, r1 208d4: 11 05 cpc r17, r1 208d6: 09 f4 brne .+2 ; 0x208da 208d8: 38 cf rjmp .-400 ; 0x2074a 208da: 0e 94 00 00 call 0 ; 0x0 <__vectors> 208de: 35 cf rjmp .-406 ; 0x2074a // 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); 208e0: c0 92 96 02 sts 0x0296, r12 ; 0x800296 208e4: 3b cf rjmp .-394 ; 0x2075c } 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. 208e6: 60 e1 ldi r22, 0x10 ; 16 208e8: 77 e2 ldi r23, 0x27 ; 39 208ea: 8e e0 ldi r24, 0x0E ; 14 208ec: 95 e0 ldi r25, 0x05 ; 5 208ee: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 208f2: 88 23 and r24, r24 208f4: 09 f4 brne .+2 ; 0x208f8 208f6: 40 cf rjmp .-384 ; 0x20778 } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 208f8: b0 92 64 0e sts 0x0E64, r11 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 208fc: 3d cf rjmp .-390 ; 0x20778 return; } autostart_stilltocheck = false; if(!mounted) { mount(); 208fe: 81 e0 ldi r24, 0x01 ; 1 20900: 0f 94 f3 7f call 0x2ffe6 ; 0x2ffe6 if(!mounted) //fail 20904: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 20908: 81 11 cpse r24, r1 2090a: 4b cf rjmp .-362 ; 0x207a2 2090c: 4c cf rjmp .-360 ; 0x207a6 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); 2090e: 88 ee ldi r24, 0xE8 ; 232 20910: 9e e6 ldi r25, 0x6E ; 110 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 20912: 0e 94 97 7b call 0xf72e ; 0xf72e 20916: 90 cf rjmp .-224 ; 0x20838 lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20918: 8b ef ldi r24, 0xFB ; 251 2091a: 96 e1 ldi r25, 0x16 ; 22 2091c: 0f 94 f5 6c call 0x2d9ea ; 0x2d9ea file.close(); 20920: 8b ef ldi r24, 0xFB ; 251 20922: 96 e1 ldi r25, 0x16 ; 22 20924: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 saving = false; 20928: 10 92 69 14 sts 0x1469, r1 ; 0x801469 logging = false; 2092c: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a 20930: 86 ed ldi r24, 0xD6 ; 214 20932: 9e e6 ldi r25, 0x6E ; 110 20934: ee cf rjmp .-36 ; 0x20912 // 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){ 20936: 86 30 cpi r24, 0x06 ; 6 20938: 09 f0 breq .+2 ; 0x2093c 2093a: 99 cf rjmp .-206 ; 0x2086e 2093c: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 20940: 81 11 cpse r24, r1 20942: 95 cf rjmp .-214 ; 0x2086e cli(); 20944: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 20946: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 20948: 81 e0 ldi r24, 0x01 ; 1 2094a: 90 e0 ldi r25, 0x00 ; 0 2094c: 8d cf rjmp .-230 ; 0x20868 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; 2094e: 61 e0 ldi r22, 0x01 ; 1 20950: 80 e3 ldi r24, 0x30 ; 48 20952: 91 e9 ldi r25, 0x91 ; 145 20954: b1 cf rjmp .-158 ; 0x208b8 case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20956: 61 e0 ldi r22, 0x01 ; 1 20958: 8f e1 ldi r24, 0x1F ; 31 2095a: 91 e9 ldi r25, 0x91 ; 145 2095c: ad cf rjmp .-166 ; 0x208b8 { 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; 2095e: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 20960: 86 33 cpi r24, 0x36 ; 54 20962: 91 40 sbci r25, 0x01 ; 1 20964: 09 f0 breq .+2 ; 0x20968 20966: 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(); 20968: 0e 94 48 84 call 0x10890 ; 0x10890 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; 2096c: 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; 2096e: 82 ea ldi r24, 0xA2 ; 162 20970: 92 ea ldi r25, 0xA2 ; 162 20972: a0 e0 ldi r26, 0x00 ; 0 20974: b0 e0 ldi r27, 0x00 ; 0 20976: 80 93 36 18 sts 0x1836, r24 ; 0x801836 <__bss_end+0x20> 2097a: 90 93 37 18 sts 0x1837, r25 ; 0x801837 <__bss_end+0x21> 2097e: a0 93 38 18 sts 0x1838, r26 ; 0x801838 <__bss_end+0x22> 20982: b0 93 39 18 sts 0x1839, r27 ; 0x801839 <__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; 20986: 10 92 aa 04 sts 0x04AA, r1 ; 0x8004aa <_ZL14iState_sum_min.lto_priv.480> 2098a: 10 92 ab 04 sts 0x04AB, r1 ; 0x8004ab <_ZL14iState_sum_min.lto_priv.480+0x1> 2098e: 10 92 ac 04 sts 0x04AC, r1 ; 0x8004ac <_ZL14iState_sum_min.lto_priv.480+0x2> 20992: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL14iState_sum_min.lto_priv.480+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 20996: 20 91 d7 06 lds r18, 0x06D7 ; 0x8006d7 2099a: 30 91 d8 06 lds r19, 0x06D8 ; 0x8006d8 2099e: 40 91 d9 06 lds r20, 0x06D9 ; 0x8006d9 209a2: 50 91 da 06 lds r21, 0x06DA ; 0x8006da 209a6: 60 e0 ldi r22, 0x00 ; 0 209a8: 70 e0 ldi r23, 0x00 ; 0 209aa: 8f e7 ldi r24, 0x7F ; 127 209ac: 93 e4 ldi r25, 0x43 ; 67 209ae: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 209b2: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 <_ZL14iState_sum_max.lto_priv.481> 209b6: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.481+0x1> 209ba: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.481+0x2> 209be: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.481+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 209c2: 10 92 a2 04 sts 0x04A2, r1 ; 0x8004a2 <_ZL19temp_iState_min_bed.lto_priv.478> 209c6: 10 92 a3 04 sts 0x04A3, r1 ; 0x8004a3 <_ZL19temp_iState_min_bed.lto_priv.478+0x1> 209ca: 10 92 a4 04 sts 0x04A4, r1 ; 0x8004a4 <_ZL19temp_iState_min_bed.lto_priv.478+0x2> 209ce: 10 92 a5 04 sts 0x04A5, r1 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.478+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 209d2: 20 91 e3 06 lds r18, 0x06E3 ; 0x8006e3 209d6: 30 91 e4 06 lds r19, 0x06E4 ; 0x8006e4 209da: 40 91 e5 06 lds r20, 0x06E5 ; 0x8006e5 209de: 50 91 e6 06 lds r21, 0x06E6 ; 0x8006e6 209e2: 60 e0 ldi r22, 0x00 ; 0 209e4: 70 e0 ldi r23, 0x00 ; 0 209e6: 8f e7 ldi r24, 0x7F ; 127 209e8: 93 e4 ldi r25, 0x43 ; 67 209ea: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 209ee: 60 93 9e 04 sts 0x049E, r22 ; 0x80049e <_ZL19temp_iState_max_bed.lto_priv.479> 209f2: 70 93 9f 04 sts 0x049F, r23 ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.479+0x1> 209f6: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.479+0x2> 209fa: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.479+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 209fe: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20a00: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20a02: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20a06: 88 60 ori r24, 0x08 ; 8 20a08: 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)); 20a0c: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 20a10: 90 e0 ldi r25, 0x00 ; 0 20a12: b4 e0 ldi r27, 0x04 ; 4 20a14: 95 95 asr r25 20a16: 87 95 ror r24 20a18: ba 95 dec r27 20a1a: e1 f7 brne .-8 ; 0x20a14 20a1c: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c <_ZL12soft_pwm_fan.lto_priv.472> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 20a20: 8a e0 ldi r24, 0x0A ; 10 20a22: 90 e0 ldi r25, 0x00 ; 0 20a24: 90 93 9b 04 sts 0x049B, r25 ; 0x80049b <_ZL8minttemp.lto_priv.473+0x1> 20a28: 80 93 9a 04 sts 0x049A, r24 ; 0x80049a <_ZL8minttemp.lto_priv.473> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20a2c: c0 90 54 02 lds r12, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.484> 20a30: d0 90 55 02 lds r13, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.484+0x1> 20a34: c6 01 movw r24, r12 20a36: 0e 94 c1 d9 call 0x1b382 ; 0x1b382 20a3a: 20 e0 ldi r18, 0x00 ; 0 20a3c: 30 e0 ldi r19, 0x00 ; 0 20a3e: 40 e2 ldi r20, 0x20 ; 32 20a40: 51 e4 ldi r21, 0x41 ; 65 20a42: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 20a46: 87 fd sbrc r24, 7 20a48: 02 c0 rjmp .+4 ; 0x20a4e 20a4a: 0c 94 76 fc jmp 0x1f8ec ; 0x1f8ec #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20a4e: e0 e1 ldi r30, 0x10 ; 16 20a50: ce 1a sub r12, r30 20a52: d1 08 sbc r13, r1 20a54: d0 92 55 02 sts 0x0255, r13 ; 0x800255 <_ZL12minttemp_raw.lto_priv.484+0x1> 20a58: c0 92 54 02 sts 0x0254, r12 ; 0x800254 <_ZL12minttemp_raw.lto_priv.484> 20a5c: e7 cf rjmp .-50 ; 0x20a2c 00020a5e : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20a5e: 0f 94 8e ce call 0x39d1c ; 0x39d1c 20a62: 10 92 12 05 sts 0x0512, r1 ; 0x800512 20a66: 80 91 12 05 lds r24, 0x0512 ; 0x800512 20a6a: 84 30 cpi r24, 0x04 ; 4 20a6c: 08 f0 brcs .+2 ; 0x20a70 20a6e: 41 c0 rjmp .+130 ; 0x20af2 20a70: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 20a74: 8f e6 ldi r24, 0x6F ; 111 20a76: 90 e4 ldi r25, 0x40 ; 64 20a78: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20a7c: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 eeprom_update_byte_notify((uint8_t *)EEPROM_ALTFAN_OVERRIDE, altfanStatus.altfanOverride); } bool altfanOverride_get() { return altfanStatus.altfanOverride; 20a80: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> #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 20a84: 81 ff sbrs r24, 1 20a86: 2f c0 rjmp .+94 ; 0x20ae6 20a88: 8e e3 ldi r24, 0x3E ; 62 20a8a: 9e e5 ldi r25, 0x5E ; 94 20a8c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20a90: 22 e0 ldi r18, 0x02 ; 2 20a92: 49 e7 ldi r20, 0x79 ; 121 20a94: 5d e5 ldi r21, 0x5D ; 93 20a96: bc 01 movw r22, r24 20a98: 87 ed ldi r24, 0xD7 ; 215 20a9a: 9c e6 ldi r25, 0x6C ; 108 20a9c: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #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 20aa0: 0e 94 cc f8 call 0x1f198 ; 0x1f198 20aa4: 88 23 and r24, r24 20aa6: 11 f1 breq .+68 ; 0x20aec 20aa8: 84 e4 ldi r24, 0x44 ; 68 20aaa: 9e e5 ldi r25, 0x5E ; 94 20aac: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20ab0: 22 e0 ldi r18, 0x02 ; 2 20ab2: 4e ec ldi r20, 0xCE ; 206 20ab4: 5b e3 ldi r21, 0x3B ; 59 20ab6: bc 01 movw r22, r24 20ab8: 8b ec ldi r24, 0xCB ; 203 20aba: 9c e6 ldi r25, 0x6C ; 108 20abc: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #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 20ac0: 60 ea ldi r22, 0xA0 ; 160 20ac2: 71 ed ldi r23, 0xD1 ; 209 20ac4: 88 eb ldi r24, 0xB8 ; 184 20ac6: 9c e6 ldi r25, 0x6C ; 108 20ac8: 0f 94 0b ce call 0x39c16 ; 0x39c16 #endif //PRUSA_SN_SUPPORT MENU_END(); 20acc: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20ad0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 20ad4: 8f 5f subi r24, 0xFF ; 255 20ad6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 20ada: 80 91 14 05 lds r24, 0x0514 ; 0x800514 20ade: 8f 5f subi r24, 0xFF ; 255 20ae0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 20ae4: c0 cf rjmp .-128 ; 0x20a66 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 20ae6: 84 e4 ldi r24, 0x44 ; 68 20ae8: 9e e5 ldi r25, 0x5E ; 94 20aea: d0 cf rjmp .-96 ; 0x20a8c #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 20aec: 8e e3 ldi r24, 0x3E ; 62 20aee: 9e e5 ldi r25, 0x5E ; 94 20af0: dd cf rjmp .-70 ; 0x20aac #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(); } 20af2: 08 95 ret 00020af4 : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 20af4: 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(); 20af6: 0e 94 cc f8 call 0x1f198 ; 0x1f198 20afa: c1 e0 ldi r28, 0x01 ; 1 20afc: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 20afe: 6f ef ldi r22, 0xFF ; 255 20b00: 09 f0 breq .+2 ; 0x20b04 20b02: 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); 20b04: 84 e0 ldi r24, 0x04 ; 4 20b06: 9d e0 ldi r25, 0x0D ; 13 20b08: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 1 #else 0 #endif ) , enableECool(enableECool) { } 20b0c: 8c 2f mov r24, r28 20b0e: 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)); 20b10: 82 70 andi r24, 0x02 ; 2 } 20b12: 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)); 20b14: 0d 94 eb 3a jmp 0x275d6 ; 0x275d6 00020b18 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 20b18: 44 e1 ldi r20, 0x14 ; 20 20b1a: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 20b1c: 66 23 and r22, r22 20b1e: 89 f0 breq .+34 ; 0x20b42 strncpy_P(lcd_status_message, message, LCD_WIDTH); 20b20: bc 01 movw r22, r24 20b22: 87 e3 ldi r24, 0x37 ; 55 20b24: 95 e0 ldi r25, 0x05 ; 5 20b26: 0f 94 fc da call 0x3b5f8 ; 0x3b5f8 else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 20b2a: 10 92 4b 05 sts 0x054B, r1 ; 0x80054b <_ZL18lcd_status_message.lto_priv.465+0x14> lcd_status_message_idx = 0; // Print message from beginning 20b2e: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.461> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 20b32: 84 e9 ldi r24, 0x94 ; 148 20b34: 9c e6 ldi r25, 0x6C ; 108 20b36: 0e 94 97 7b call 0xf72e ; 0xf72e // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 20b3a: 81 e0 ldi r24, 0x01 ; 1 20b3c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 20b40: 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); 20b42: bc 01 movw r22, r24 20b44: 87 e3 ldi r24, 0x37 ; 55 20b46: 95 e0 ldi r25, 0x05 ; 5 20b48: 0f 94 8f e3 call 0x3c71e ; 0x3c71e 20b4c: ee cf rjmp .-36 ; 0x20b2a 00020b4e : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 20b4e: 90 91 cd 03 lds r25, 0x03CD ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> 20b52: 89 17 cp r24, r25 20b54: 80 f4 brcc .+32 ; 0x20b76 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 20b56: 91 30 cpi r25, 0x01 ; 1 20b58: 61 f4 brne .+24 ; 0x20b72 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 20b5a: 80 91 4c 05 lds r24, 0x054C ; 0x80054c <_ZL26lcd_status_message_timeout.lto_priv.464> 20b5e: 88 23 and r24, r24 20b60: 51 f0 breq .+20 ; 0x20b76 20b62: 40 e2 ldi r20, 0x20 ; 32 20b64: 5e e4 ldi r21, 0x4E ; 78 20b66: 60 e0 ldi r22, 0x00 ; 0 20b68: 70 e0 ldi r23, 0x00 ; 0 20b6a: 8c e4 ldi r24, 0x4C ; 76 20b6c: 95 e0 ldi r25, 0x05 ; 5 20b6e: 0d 94 39 3f jmp 0x27e72 ; 0x27e72 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 20b72: 80 e0 ldi r24, 0x00 ; 0 20b74: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 20b76: 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; } 20b78: 08 95 ret 00020b7a : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 20b7a: ef 92 push r14 20b7c: ff 92 push r15 20b7e: 1f 93 push r17 20b80: cf 93 push r28 20b82: df 93 push r29 20b84: ec 01 movw r28, r24 20b86: 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)) { 20b88: 86 2f mov r24, r22 20b8a: 0f 94 a7 05 call 0x20b4e ; 0x20b4e 20b8e: 88 23 and r24, r24 20b90: e9 f0 breq .+58 ; 0x20bcc bool same = !(progmem? strcmp_P(lcd_status_message, message): 20b92: be 01 movw r22, r28 20b94: 87 e3 ldi r24, 0x37 ; 55 20b96: 95 e0 ldi r25, 0x05 ; 5 20b98: 0f 94 bd da call 0x3b57a ; 0x3b57a 20b9c: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 20b9e: 8c e4 ldi r24, 0x4C ; 76 20ba0: 95 e0 ldi r25, 0x05 ; 5 20ba2: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> lcd_status_message_level = severity; 20ba6: 10 93 cd 03 sts 0x03CD, r17 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> custom_message_type = CustomMsg::Status; 20baa: 10 92 72 07 sts 0x0772, r1 ; 0x800772 custom_message_state = 0; 20bae: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 if (!same) { 20bb2: ef 28 or r14, r15 20bb4: 59 f0 breq .+22 ; 0x20bcc // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 20bb6: 61 e0 ldi r22, 0x01 ; 1 20bb8: ce 01 movw r24, r28 20bba: 0f 94 8c 05 call 0x20b18 ; 0x20b18 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20bbe: df 91 pop r29 20bc0: cf 91 pop r28 20bc2: 1f 91 pop r17 20bc4: ff 90 pop r15 20bc6: 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(); 20bc8: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20bcc: df 91 pop r29 20bce: cf 91 pop r28 20bd0: 1f 91 pop r17 20bd2: ff 90 pop r15 20bd4: ef 90 pop r14 20bd6: 08 95 ret 00020bd8 : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 20bd8: 1f 93 push r17 20bda: cf 93 push r28 20bdc: df 93 push r29 20bde: 18 2f mov r17, r24 20be0: eb 01 movw r28, r22 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 20be2: 80 e0 ldi r24, 0x00 ; 0 20be4: 0f 94 2e 63 call 0x2c65c ; 0x2c65c { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 20be8: 80 e0 ldi r24, 0x00 ; 0 20bea: 0e 94 05 8c call 0x1180a ; 0x1180a target_temperature[0] = 0; 20bee: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 20bf2: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a target_temperature_bed = 0; 20bf6: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 20bfa: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 manage_heater(); 20bfe: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(); 20c02: 80 e0 ldi r24, 0x00 ; 0 20c04: 0e 94 6b 8c call 0x118d6 ; 0x118d6 lcd_clear(); 20c08: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 20c0c: 8d ed ldi r24, 0xDD ; 221 20c0e: 95 e4 ldi r25, 0x45 ; 69 20c10: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20c14: ac 01 movw r20, r24 20c16: 60 e0 ldi r22, 0x00 ; 0 20c18: 80 e0 ldi r24, 0x00 ; 0 20c1a: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 20c1e: 8d ec ldi r24, 0xCD ; 205 20c20: 95 e4 ldi r25, 0x45 ; 69 20c22: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20c26: ac 01 movw r20, r24 20c28: 61 e0 ldi r22, 0x01 ; 1 20c2a: 80 e0 ldi r24, 0x00 ; 0 20c2c: 0e 94 3a 70 call 0xe074 ; 0xe074 switch (testError) 20c30: 11 50 subi r17, 0x01 ; 1 20c32: 1c 30 cpi r17, 0x0C ; 12 20c34: a0 f4 brcc .+40 ; 0x20c5e 20c36: e1 2f mov r30, r17 20c38: f0 e0 ldi r31, 0x00 ; 0 20c3a: 88 27 eor r24, r24 20c3c: ed 5d subi r30, 0xDD ; 221 20c3e: f9 4f sbci r31, 0xF9 ; 249 20c40: 8e 4f sbci r24, 0xFE ; 254 20c42: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 20c46: 3a 3a cpi r19, 0xAA ; 170 20c48: 50 3b cpi r21, 0xB0 ; 176 20c4a: d2 3a cpi r29, 0xA2 ; 162 20c4c: c2 3a cpi r28, 0xA2 ; 162 20c4e: fe 39 cpi r31, 0x9E ; 158 20c50: da 39 cpi r29, 0x9A ; 154 20c52: a0 3a cpi r26, 0xA0 ; 160 20c54: 00 3a cpi r16, 0xA0 ; 160 20c56: 4a 3a cpi r20, 0xAA ; 170 20c58: a8 3b cpi r26, 0xB8 ; 184 20c5a: a6 3a cpi r26, 0xA6 ; 166 20c5c: 50 3a cpi r21, 0xA0 ; 160 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 20c5e: 89 eb ldi r24, 0xB9 ; 185 20c60: 95 e4 ldi r25, 0x45 ; 69 20c62: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20c66: ac 01 movw r20, r24 20c68: 62 e0 ldi r22, 0x02 ; 2 20c6a: 80 e0 ldi r24, 0x00 ; 0 20c6c: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 20c70: 89 ea ldi r24, 0xA9 ; 169 20c72: 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)); 20c74: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20c78: ac 01 movw r20, r24 20c7a: 63 e0 ldi r22, 0x03 ; 3 20c7c: 80 e0 ldi r24, 0x00 ; 0 20c7e: 0e 94 3a 70 call 0xe074 ; 0xe074 20c82: 45 c0 rjmp .+138 ; 0x20d0e 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)); 20c84: 8c e9 ldi r24, 0x9C ; 156 20c86: 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)); 20c88: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20c8c: ac 01 movw r20, r24 20c8e: 62 e0 ldi r22, 0x02 ; 2 20c90: 80 e0 ldi r24, 0x00 ; 0 20c92: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20c96: 8d e8 ldi r24, 0x8D ; 141 20c98: 95 e4 ldi r25, 0x45 ; 69 20c9a: ec cf rjmp .-40 ; 0x20c74 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)); 20c9c: 82 e8 ldi r24, 0x82 ; 130 20c9e: 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)); 20ca0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20ca4: ac 01 movw r20, r24 20ca6: 62 e0 ldi r22, 0x02 ; 2 20ca8: 80 e0 ldi r24, 0x00 ; 0 20caa: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20cae: 8d e8 ldi r24, 0x8D ; 141 20cb0: 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)); 20cb2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20cb6: ac 01 movw r20, r24 20cb8: 63 e0 ldi r22, 0x03 ; 3 20cba: 80 e0 ldi r24, 0x00 ; 0 20cbc: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(18, 3); 20cc0: 63 e0 ldi r22, 0x03 ; 3 20cc2: 82 e1 ldi r24, 0x12 ; 18 20cc4: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print(_error_1); 20cc8: ce 01 movw r24, r28 20cca: 1f c0 rjmp .+62 ; 0x20d0a 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)); 20ccc: 8a e7 ldi r24, 0x7A ; 122 20cce: 95 e4 ldi r25, 0x45 ; 69 20cd0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20cd4: ac 01 movw r20, r24 20cd6: 62 e0 ldi r22, 0x02 ; 2 20cd8: 80 e0 ldi r24, 0x00 ; 0 20cda: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(18, 2); 20cde: 62 e0 ldi r22, 0x02 ; 2 20ce0: 82 e1 ldi r24, 0x12 ; 18 20ce2: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print(_error_1); 20ce6: ce 01 movw r24, r28 20ce8: 0e 94 2d 72 call 0xe45a ; 0xe45a lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 20cec: 80 e7 ldi r24, 0x70 ; 112 20cee: 95 e4 ldi r25, 0x45 ; 69 20cf0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20cf4: ac 01 movw r20, r24 20cf6: 63 e0 ldi r22, 0x03 ; 3 20cf8: 80 e0 ldi r24, 0x00 ; 0 20cfa: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(18, 3); 20cfe: 63 e0 ldi r22, 0x03 ; 3 20d00: 82 e1 ldi r24, 0x12 ; 18 20d02: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print(_error_2); 20d06: 81 ef ldi r24, 0xF1 ; 241 20d08: 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); 20d0a: 0e 94 2d 72 call 0xe45a ; 0xe45a lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 20d0e: 68 ee ldi r22, 0xE8 ; 232 20d10: 73 e0 ldi r23, 0x03 ; 3 20d12: 80 e0 ldi r24, 0x00 ; 0 20d14: 90 e0 ldi r25, 0x00 ; 0 20d16: 0f 94 5c 3c call 0x278b8 ; 0x278b8 20d1a: 80 e0 ldi r24, 0x00 ; 0 20d1c: 0f 94 2e 63 call 0x2c65c ; 0x2c65c lcd_beeper_quick_feedback(); do { _delay(100); 20d20: 64 e6 ldi r22, 0x64 ; 100 20d22: 70 e0 ldi r23, 0x00 ; 0 20d24: 80 e0 ldi r24, 0x00 ; 0 20d26: 90 e0 ldi r25, 0x00 ; 0 20d28: 0f 94 5c 3c call 0x278b8 ; 0x278b8 manage_heater(); 20d2c: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(); 20d30: 80 e0 ldi r24, 0x00 ; 0 20d32: 0e 94 6b 8c call 0x118d6 ; 0x118d6 } while (!lcd_clicked()); 20d36: 0e 94 43 72 call 0xe486 ; 0xe486 20d3a: 88 23 and r24, r24 20d3c: 89 f3 breq .-30 ; 0x20d20 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 20d3e: 8d ea ldi r24, 0xAD ; 173 20d40: 94 e4 ldi r25, 0x44 ; 68 20d42: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20d46: 62 e0 ldi r22, 0x02 ; 2 20d48: 0f 94 bd 05 call 0x20b7a ; 0x20b7a lcd_return_to_status(); } 20d4c: df 91 pop r29 20d4e: cf 91 pop r28 20d50: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 20d52: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 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)); 20d56: 8e e5 ldi r24, 0x5E ; 94 20d58: 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)); 20d5a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20d5e: ac 01 movw r20, r24 20d60: 62 e0 ldi r22, 0x02 ; 2 20d62: 80 e0 ldi r24, 0x00 ; 0 20d64: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 20d68: 8a e7 ldi r24, 0x7A ; 122 20d6a: 95 e4 ldi r25, 0x45 ; 69 20d6c: a2 cf rjmp .-188 ; 0x20cb2 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)); 20d6e: 8b e4 ldi r24, 0x4B ; 75 20d70: 95 e4 ldi r25, 0x45 ; 69 20d72: 96 cf rjmp .-212 ; 0x20ca0 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)); 20d74: 88 e3 ldi r24, 0x38 ; 56 20d76: 95 e4 ldi r25, 0x45 ; 69 20d78: 93 cf rjmp .-218 ; 0x20ca0 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)); 20d7a: 89 e2 ldi r24, 0x29 ; 41 20d7c: 95 e4 ldi r25, 0x45 ; 69 20d7e: ed cf rjmp .-38 ; 0x20d5a 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)); 20d80: 8b e1 ldi r24, 0x1B ; 27 20d82: 95 e4 ldi r25, 0x45 ; 69 20d84: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20d88: ac 01 movw r20, r24 20d8a: 62 e0 ldi r22, 0x02 ; 2 20d8c: 80 e0 ldi r24, 0x00 ; 0 20d8e: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 20d92: 84 e1 ldi r24, 0x14 ; 20 20d94: 95 e4 ldi r25, 0x45 ; 69 20d96: 8d cf rjmp .-230 ; 0x20cb2 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 20d98: 82 e0 ldi r24, 0x02 ; 2 20d9a: 95 e4 ldi r25, 0x45 ; 69 20d9c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20da0: ac 01 movw r20, r24 20da2: 62 e0 ldi r22, 0x02 ; 2 20da4: 80 e0 ldi r24, 0x00 ; 0 20da6: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 20daa: 88 ef ldi r24, 0xF8 ; 248 20dac: 94 e4 ldi r25, 0x44 ; 68 20dae: 81 cf rjmp .-254 ; 0x20cb2 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20db0: 86 ee ldi r24, 0xE6 ; 230 20db2: 94 e4 ldi r25, 0x44 ; 68 20db4: 69 cf rjmp .-302 ; 0x20c88 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)); 20db6: 86 ee ldi r24, 0xE6 ; 230 20db8: 94 e4 ldi r25, 0x44 ; 68 20dba: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20dbe: ac 01 movw r20, r24 20dc0: 62 e0 ldi r22, 0x02 ; 2 20dc2: 80 e0 ldi r24, 0x00 ; 0 20dc4: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 3, _T(MSG_FALSE_TRIGGERING)); 20dc8: 83 ed ldi r24, 0xD3 ; 211 20dca: 94 e4 ldi r25, 0x44 ; 68 20dcc: 53 cf rjmp .-346 ; 0x20c74 break; case TestError::FsensorLevel: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20dce: 86 ee ldi r24, 0xE6 ; 230 20dd0: 94 e4 ldi r25, 0x44 ; 68 20dd2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20dd6: ac 01 movw r20, r24 20dd8: 62 e0 ldi r22, 0x02 ; 2 20dda: 80 e0 ldi r24, 0x00 ; 0 20ddc: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(0, 3); 20de0: 63 e0 ldi r22, 0x03 ; 3 20de2: 80 e0 ldi r24, 0x00 ; 0 20de4: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); 20de8: 8f eb ldi r24, 0xBF ; 191 20dea: 94 e4 ldi r25, 0x44 ; 68 20dec: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 20df0: df 93 push r29 20df2: cf 93 push r28 20df4: 9f 93 push r25 20df6: 8f 93 push r24 20df8: 0e 94 ff 6f call 0xdffe ; 0xdffe 20dfc: 0f 90 pop r0 20dfe: 0f 90 pop r0 20e00: 0f 90 pop r0 20e02: 0f 90 pop r0 20e04: 84 cf rjmp .-248 ; 0x20d0e 00020e06 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 20e06: 8f 92 push r8 20e08: 9f 92 push r9 20e0a: af 92 push r10 20e0c: bf 92 push r11 20e0e: cf 92 push r12 20e10: df 92 push r13 20e12: ef 92 push r14 20e14: ff 92 push r15 20e16: 0f 93 push r16 20e18: 1f 93 push r17 20e1a: cf 93 push r28 20e1c: df 93 push r29 20e1e: f8 2e mov r15, r24 20e20: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 20e24: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 20e28: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 20e2c: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 20e30: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 20e34: 4b 01 movw r8, r22 20e36: 6b 01 movw r12, r22 20e38: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 20e3c: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 20e40: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 20e44: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 20e48: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 20e4c: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 20e4e: ff 20 and r15, r15 20e50: 09 f4 brne .+2 ; 0x20e54 20e52: a6 c0 rjmp .+332 ; 0x20fa0 20e54: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 20e56: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 20e58: 24 eb ldi r18, 0xB4 ; 180 20e5a: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 20e5c: 90 e0 ldi r25, 0x00 ; 0 20e5e: 80 e0 ldi r24, 0x00 ; 0 20e60: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 20e64: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a target_temperature_bed = (_isbed) ? 100 : 0; 20e68: 84 e6 ldi r24, 0x64 ; 100 20e6a: 90 e0 ldi r25, 0x00 ; 0 20e6c: f1 10 cpse r15, r1 20e6e: 02 c0 rjmp .+4 ; 0x20e74 20e70: 90 e0 ldi r25, 0x00 ; 0 20e72: 80 e0 ldi r24, 0x00 ; 0 20e74: 90 93 69 0e sts 0x0E69, r25 ; 0x800e69 20e78: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 20e7c: e0 90 1d 05 lds r14, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); 20e80: 80 e0 ldi r24, 0x00 ; 0 20e82: 0f 94 47 47 call 0x28e8e ; 0x28e8e #endif //THERMAL_MODEL manage_heater(); 20e86: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 20e8a: 81 e0 ldi r24, 0x01 ; 1 20e8c: 0e 94 6b 8c call 0x118d6 ; 0x118d6 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 20e90: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 20e92: 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 20e94: 85 e0 ldi r24, 0x05 ; 5 20e96: 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) 20e98: 80 91 11 05 lds r24, 0x0511 ; 0x800511 20e9c: 81 11 cpse r24, r1 20e9e: 1c c0 rjmp .+56 ; 0x20ed8 { manage_heater(); 20ea0: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 20ea4: 81 e0 ldi r24, 0x01 ; 1 20ea6: 0e 94 6b 8c call 0x118d6 ; 0x118d6 _progress = (_isbed? 20eaa: 00 e9 ldi r16, 0x90 ; 144 20eac: 11 e0 ldi r17, 0x01 ; 1 20eae: 20 e0 ldi r18, 0x00 ; 0 20eb0: 42 e0 ldi r20, 0x02 ; 2 20eb2: 6a 2d mov r22, r10 20eb4: 87 e0 ldi r24, 0x07 ; 7 20eb6: f1 10 cpse r15, r1 20eb8: 01 c0 rjmp .+2 ; 0x20ebc 20eba: 88 e0 ldi r24, 0x08 ; 8 20ebc: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 20ec0: 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 20ec2: 8b 2d mov r24, r11 20ec4: 68 2d mov r22, r8 20ec6: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__udivmodqi4> 20eca: 91 11 cpse r25, r1 20ecc: 02 c0 rjmp .+4 ; 0x20ed2 20ece: 0e 94 7a 79 call 0xf2f4 ; 0xf2f4 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 20ed2: b3 94 inc r11 20ed4: b9 10 cpse r11, r9 20ed6: e0 cf rjmp .-64 ; 0x20e98 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 20ed8: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 20edc: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a target_temperature_bed = 0; 20ee0: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 20ee4: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 manage_heater(); 20ee8: 0f 94 66 4d call 0x29acc ; 0x29acc 20eec: b6 01 movw r22, r12 20eee: dd 0c add r13, r13 20ef0: 88 0b sbc r24, r24 20ef2: 99 0b sbc r25, r25 20ef4: 4e 01 movw r8, r28 20ef6: dd 0f add r29, r29 20ef8: aa 08 sbc r10, r10 20efa: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 20efc: ff 20 and r15, r15 20efe: 09 f4 brne .+2 ; 0x20f02 20f00: 54 c0 rjmp .+168 ; 0x20faa 20f02: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 20f06: 9b 01 movw r18, r22 20f08: ac 01 movw r20, r24 20f0a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 20f0e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 20f12: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 20f16: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 20f1a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 20f1e: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 20f22: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 20f24: c5 01 movw r24, r10 20f26: b4 01 movw r22, r8 20f28: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 20f2c: 9b 01 movw r18, r22 20f2e: ac 01 movw r20, r24 20f30: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 20f34: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 20f38: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 20f3c: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 20f40: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 20f44: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 20f48: 10 91 11 05 lds r17, 0x0511 ; 0x800511 20f4c: 11 11 cpse r17, r1 20f4e: 0c c0 rjmp .+24 ; 0x20f68 20f50: f1 10 cpse r15, r1 20f52: 4b c0 rjmp .+150 ; 0x20fea 20f54: 69 30 cpi r22, 0x09 ; 9 20f56: 71 05 cpc r23, r1 20f58: 0c f0 brlt .+2 ; 0x20f5c 20f5a: 4d c0 rjmp .+154 ; 0x20ff6 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 20f5c: 8e e1 ldi r24, 0x1E ; 30 20f5e: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 20f60: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 20f62: c8 17 cp r28, r24 20f64: d9 07 cpc r29, r25 20f66: 34 f4 brge .+12 ; 0x20f74 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 20f68: 61 ef ldi r22, 0xF1 ; 241 20f6a: 72 e0 ldi r23, 0x02 ; 2 20f6c: 80 e0 ldi r24, 0x00 ; 0 20f6e: 0f 94 ec 05 call 0x20bd8 ; 0x20bd8 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 20f72: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 20f74: 8e 2d mov r24, r14 20f76: 0f 94 47 47 call 0x28e8e ; 0x28e8e #endif //THERMAL_MODEL manage_heater(); 20f7a: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 20f7e: 81 e0 ldi r24, 0x01 ; 1 20f80: 0e 94 6b 8c call 0x118d6 ; 0x118d6 return _stepresult; } 20f84: 81 2f mov r24, r17 20f86: df 91 pop r29 20f88: cf 91 pop r28 20f8a: 1f 91 pop r17 20f8c: 0f 91 pop r16 20f8e: ff 90 pop r15 20f90: ef 90 pop r14 20f92: df 90 pop r13 20f94: cf 90 pop r12 20f96: bf 90 pop r11 20f98: af 90 pop r10 20f9a: 9f 90 pop r9 20f9c: 8f 90 pop r8 20f9e: 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 20fa0: 9c e3 ldi r25, 0x3C ; 60 20fa2: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 20fa4: 88 ec ldi r24, 0xC8 ; 200 20fa6: 90 e0 ldi r25, 0x00 ; 0 20fa8: 5b cf rjmp .-330 ; 0x20e60 target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 20faa: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 20fae: 9b 01 movw r18, r22 20fb0: ac 01 movw r20, r24 20fb2: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 20fb6: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 20fba: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 20fbe: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 20fc2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 20fc6: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 20fca: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 20fcc: c5 01 movw r24, r10 20fce: b4 01 movw r22, r8 20fd0: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 20fd4: 9b 01 movw r18, r22 20fd6: ac 01 movw r20, r24 20fd8: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 20fdc: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 20fe0: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 20fe4: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 20fe8: ab cf rjmp .-170 ; 0x20f40 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 20fea: 89 e0 ldi r24, 0x09 ; 9 20fec: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 20fee: 6e 31 cpi r22, 0x1E ; 30 20ff0: 71 05 cpc r23, r1 20ff2: 0c f4 brge .+2 ; 0x20ff6 20ff4: b5 cf rjmp .-150 ; 0x20f60 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 20ff6: 61 ef ldi r22, 0xF1 ; 241 20ff8: 72 e0 ldi r23, 0x02 ; 2 20ffa: 81 e0 ldi r24, 0x01 ; 1 20ffc: 0f 94 ec 05 call 0x20bd8 ; 0x20bd8 21000: b9 cf rjmp .-142 ; 0x20f74 00021002 : plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); crashdet_use_eeprom_setting(); } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 21002: 2f 92 push r2 21004: 3f 92 push r3 21006: 4f 92 push r4 21008: 5f 92 push r5 2100a: 6f 92 push r6 2100c: 7f 92 push r7 2100e: 8f 92 push r8 21010: 9f 92 push r9 21012: af 92 push r10 21014: bf 92 push r11 21016: cf 92 push r12 21018: df 92 push r13 2101a: ef 92 push r14 2101c: ff 92 push r15 2101e: 1f 93 push r17 21020: cf 93 push r28 21022: df 93 push r29 21024: 00 d0 rcall .+0 ; 0x21026 21026: 00 d0 rcall .+0 ; 0x21028 21028: 1f 92 push r1 2102a: cd b7 in r28, 0x3d ; 61 2102c: de b7 in r29, 0x3e ; 62 2102e: 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) { 21030: 68 2e mov r6, r24 21032: 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; 21034: 81 2c mov r8, r1 21036: 20 e8 ldi r18, 0x80 ; 128 21038: 92 2e mov r9, r18 2103a: 2c e5 ldi r18, 0x5C ; 92 2103c: a2 2e mov r10, r18 2103e: 23 e4 ldi r18, 0x43 ; 67 21040: 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) { 21042: 81 30 cpi r24, 0x01 ; 1 21044: 31 f0 breq .+12 ; 0x21052 case 0: axis_length = X_MAX_POS; break; 21046: 81 2c mov r8, r1 21048: 91 2c mov r9, r1 2104a: 9f e7 ldi r25, 0x7F ; 127 2104c: a9 2e mov r10, r25 2104e: 93 e4 ldi r25, 0x43 ; 67 21050: 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; 21052: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 21056: 0f 94 2e 3a call 0x2745c ; 0x2745c } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 2105a: 81 e0 ldi r24, 0x01 ; 1 2105c: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 21060: 60 e0 ldi r22, 0x00 ; 0 21062: 70 e0 ldi r23, 0x00 ; 0 21064: 80 ea ldi r24, 0xA0 ; 160 21066: 90 e4 ldi r25, 0x40 ; 64 21068: 0e 94 a6 6f call 0xdf4c ; 0xdf4c tmc2130_home_enter(1 << axis); 2106c: 81 e0 ldi r24, 0x01 ; 1 2106e: 01 2e mov r0, r17 21070: 01 c0 rjmp .+2 ; 0x21074 21072: 88 0f add r24, r24 21074: 0a 94 dec r0 21076: ea f7 brpl .-6 ; 0x21072 21078: 0f 94 5d 3a call 0x274ba ; 0x274ba // first axis length measurement begin current_position[axis] -= (axis_length + margin); 2107c: 20 e0 ldi r18, 0x00 ; 0 2107e: 30 e0 ldi r19, 0x00 ; 0 21080: 40 e7 ldi r20, 0x70 ; 112 21082: 52 e4 ldi r21, 0x42 ; 66 21084: c5 01 movw r24, r10 21086: b4 01 movw r22, r8 21088: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2108c: 69 83 std Y+1, r22 ; 0x01 2108e: 7a 83 std Y+2, r23 ; 0x02 21090: 8b 83 std Y+3, r24 ; 0x03 21092: 9c 83 std Y+4, r25 ; 0x04 21094: 13 01 movw r2, r6 21096: 22 0c add r2, r2 21098: 33 1c adc r3, r3 2109a: 22 0c add r2, r2 2109c: 33 1c adc r3, r3 2109e: c1 01 movw r24, r2 210a0: 80 5c subi r24, 0xC0 ; 192 210a2: 98 4f sbci r25, 0xF8 ; 248 210a4: 9e 83 std Y+6, r25 ; 0x06 210a6: 8d 83 std Y+5, r24 ; 0x05 210a8: 29 81 ldd r18, Y+1 ; 0x01 210aa: 3a 81 ldd r19, Y+2 ; 0x02 210ac: 4b 81 ldd r20, Y+3 ; 0x03 210ae: 5c 81 ldd r21, Y+4 ; 0x04 210b0: fc 01 movw r30, r24 210b2: 60 81 ld r22, Z 210b4: 71 81 ldd r23, Z+1 ; 0x01 210b6: 82 81 ldd r24, Z+2 ; 0x02 210b8: 93 81 ldd r25, Z+3 ; 0x03 210ba: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 210be: ed 81 ldd r30, Y+5 ; 0x05 210c0: fe 81 ldd r31, Y+6 ; 0x06 210c2: 60 83 st Z, r22 210c4: 71 83 std Z+1, r23 ; 0x01 210c6: 82 83 std Z+2, r24 ; 0x02 210c8: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 210ca: 60 e0 ldi r22, 0x00 ; 0 210cc: 70 e0 ldi r23, 0x00 ; 0 210ce: 84 e3 ldi r24, 0x34 ; 52 210d0: 92 e4 ldi r25, 0x42 ; 66 210d2: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 210d6: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 210da: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.486> tmc2130_sg_measure_cnt = 0; 210de: 10 92 c5 03 sts 0x03C5, r1 ; 0x8003c5 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488> 210e2: 10 92 c6 03 sts 0x03C6, r1 ; 0x8003c6 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x1> 210e6: 10 92 c7 03 sts 0x03C7, r1 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x2> 210ea: 10 92 c8 03 sts 0x03C8, r1 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x3> tmc2130_sg_measure_val = 0; 210ee: 10 92 c9 03 sts 0x03C9, r1 ; 0x8003c9 <_ZL22tmc2130_sg_measure_val.lto_priv.487> 210f2: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x1> 210f6: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x2> 210fa: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x3> tmc2130_sg_measure_start(axis); current_position_init = st_get_position_mm(axis); 210fe: 81 2f mov r24, r17 21100: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 21104: 6b 01 movw r12, r22 21106: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 21108: 20 e0 ldi r18, 0x00 ; 0 2110a: 30 e0 ldi r19, 0x00 ; 0 2110c: 40 ef ldi r20, 0xF0 ; 240 2110e: 52 e4 ldi r21, 0x42 ; 66 21110: ed 81 ldd r30, Y+5 ; 0x05 21112: fe 81 ldd r31, Y+6 ; 0x06 21114: 60 81 ld r22, Z 21116: 71 81 ldd r23, Z+1 ; 0x01 21118: 82 81 ldd r24, Z+2 ; 0x02 2111a: 93 81 ldd r25, Z+3 ; 0x03 2111c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 21120: ed 81 ldd r30, Y+5 ; 0x05 21122: fe 81 ldd r31, Y+6 ; 0x06 21124: 60 83 st Z, r22 21126: 71 83 std Z+1, r23 ; 0x01 21128: 82 83 std Z+2, r24 ; 0x02 2112a: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2112c: 60 e0 ldi r22, 0x00 ; 0 2112e: 70 e0 ldi r23, 0x00 ; 0 21130: 84 e3 ldi r24, 0x34 ; 52 21132: 92 e4 ldi r25, 0x42 ; 66 21134: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 21138: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position[axis] += axis_length; 2113c: a5 01 movw r20, r10 2113e: 94 01 movw r18, r8 21140: ed 81 ldd r30, Y+5 ; 0x05 21142: fe 81 ldd r31, Y+6 ; 0x06 21144: 60 81 ld r22, Z 21146: 71 81 ldd r23, Z+1 ; 0x01 21148: 82 81 ldd r24, Z+2 ; 0x02 2114a: 93 81 ldd r25, Z+3 ; 0x03 2114c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 21150: ed 81 ldd r30, Y+5 ; 0x05 21152: fe 81 ldd r31, Y+6 ; 0x06 21154: 60 83 st Z, r22 21156: 71 83 std Z+1, r23 ; 0x01 21158: 82 83 std Z+2, r24 ; 0x02 2115a: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2115c: 60 e0 ldi r22, 0x00 ; 0 2115e: 70 e0 ldi r23, 0x00 ; 0 21160: 84 e3 ldi r24, 0x34 ; 52 21162: 92 e4 ldi r25, 0x42 ; 66 21164: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 21168: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 2116c: 8f ef ldi r24, 0xFF ; 255 2116e: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.486> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 21172: 60 91 c9 03 lds r22, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_val.lto_priv.487> 21176: 70 91 ca 03 lds r23, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x1> 2117a: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x2> 2117e: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x3> 21182: 20 91 c5 03 lds r18, 0x03C5 ; 0x8003c5 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488> 21186: 30 91 c6 03 lds r19, 0x03C6 ; 0x8003c6 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x1> 2118a: 40 91 c7 03 lds r20, 0x03C7 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x2> 2118e: 50 91 c8 03 lds r21, 0x03C8 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x3> 21192: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 21196: 2d 83 std Y+5, r18 ; 0x05 21198: 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); 2119a: 3f 93 push r19 2119c: 2f 93 push r18 2119e: f8 e5 ldi r31, 0x58 ; 88 211a0: 6f 0e add r6, r31 211a2: 71 1c adc r7, r1 211a4: 7f 92 push r7 211a6: 6f 92 push r6 211a8: 8f ee ldi r24, 0xEF ; 239 211aa: 9c e8 ldi r25, 0x8C ; 140 211ac: 9f 93 push r25 211ae: 8f 93 push r24 211b0: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 211b4: 0f 90 pop r0 211b6: 0f 90 pop r0 211b8: 0f 90 pop r0 211ba: 0f 90 pop r0 211bc: 0f 90 pop r0 211be: 0f 90 pop r0 211c0: 8b e5 ldi r24, 0x5B ; 91 211c2: 9f e0 ldi r25, 0x0F ; 15 211c4: 11 11 cpse r17, r1 211c6: 02 c0 rjmp .+4 ; 0x211cc 211c8: 8d e5 ldi r24, 0x5D ; 93 211ca: 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); 211cc: 6d 81 ldd r22, Y+5 ; 0x05 211ce: 7f 81 ldd r23, Y+7 ; 0x07 211d0: 0f 94 6d dd call 0x3bada ; 0x3bada current_position_final = st_get_position_mm(axis); 211d4: 81 2f mov r24, r17 211d6: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 211da: 2b 01 movw r4, r22 211dc: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 211de: a7 01 movw r20, r14 211e0: 96 01 movw r18, r12 211e2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 211e6: 6b 01 movw r12, r22 211e8: 7c 01 movw r14, r24 211ea: e8 94 clt 211ec: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 211ee: c1 01 movw r24, r2 211f0: 80 5c subi r24, 0xC0 ; 192 211f2: 98 4f sbci r25, 0xF8 ; 248 211f4: 9e 83 std Y+6, r25 ; 0x06 211f6: 8d 83 std Y+5, r24 ; 0x05 211f8: 20 e0 ldi r18, 0x00 ; 0 211fa: 30 e0 ldi r19, 0x00 ; 0 211fc: 40 e7 ldi r20, 0x70 ; 112 211fe: 52 e4 ldi r21, 0x42 ; 66 21200: fc 01 movw r30, r24 21202: 60 81 ld r22, Z 21204: 71 81 ldd r23, Z+1 ; 0x01 21206: 82 81 ldd r24, Z+2 ; 0x02 21208: 93 81 ldd r25, Z+3 ; 0x03 2120a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 2120e: ed 81 ldd r30, Y+5 ; 0x05 21210: fe 81 ldd r31, Y+6 ; 0x06 21212: 60 83 st Z, r22 21214: 71 83 std Z+1, r23 ; 0x01 21216: 82 83 std Z+2, r24 ; 0x02 21218: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2121a: 60 e0 ldi r22, 0x00 ; 0 2121c: 70 e0 ldi r23, 0x00 ; 0 2121e: 84 e3 ldi r24, 0x34 ; 52 21220: 92 e4 ldi r25, 0x42 ; 66 21222: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 21226: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position[axis] -= (axis_length + margin); 2122a: 29 81 ldd r18, Y+1 ; 0x01 2122c: 3a 81 ldd r19, Y+2 ; 0x02 2122e: 4b 81 ldd r20, Y+3 ; 0x03 21230: 5c 81 ldd r21, Y+4 ; 0x04 21232: ed 81 ldd r30, Y+5 ; 0x05 21234: fe 81 ldd r31, Y+6 ; 0x06 21236: 60 81 ld r22, Z 21238: 71 81 ldd r23, Z+1 ; 0x01 2123a: 82 81 ldd r24, Z+2 ; 0x02 2123c: 93 81 ldd r25, Z+3 ; 0x03 2123e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 21242: ed 81 ldd r30, Y+5 ; 0x05 21244: fe 81 ldd r31, Y+6 ; 0x06 21246: 60 83 st Z, r22 21248: 71 83 std Z+1, r23 ; 0x01 2124a: 82 83 std Z+2, r24 ; 0x02 2124c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2124e: 60 e0 ldi r22, 0x00 ; 0 21250: 70 e0 ldi r23, 0x00 ; 0 21252: 84 e3 ldi r24, 0x34 ; 52 21254: 92 e4 ldi r25, 0x42 ; 66 21256: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 2125a: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position_init = st_get_position_mm(axis); 2125e: 81 2f mov r24, r17 21260: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 21264: 9b 01 movw r18, r22 21266: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 21268: c3 01 movw r24, r6 2126a: b2 01 movw r22, r4 2126c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 21270: 2b 01 movw r4, r22 21272: 3c 01 movw r6, r24 21274: e8 94 clt 21276: 77 f8 bld r7, 7 tmc2130_home_exit(); 21278: 0f 94 2e 3a call 0x2745c ; 0x2745c //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]); 2127c: ff 92 push r15 2127e: ef 92 push r14 21280: df 92 push r13 21282: cf 92 push r12 21284: 86 e7 ldi r24, 0x76 ; 118 21286: 9c e6 ldi r25, 0x6C ; 108 21288: 9f 93 push r25 2128a: 8f 93 push r24 2128c: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 21290: a5 01 movw r20, r10 21292: 94 01 movw r18, r8 21294: c7 01 movw r24, r14 21296: b6 01 movw r22, r12 21298: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 2129c: 9f 77 andi r25, 0x7F ; 127 2129e: 0f 90 pop r0 212a0: 0f 90 pop r0 212a2: 0f 90 pop r0 212a4: 0f 90 pop r0 212a6: 0f 90 pop r0 212a8: 0f 90 pop r0 212aa: 20 e0 ldi r18, 0x00 ; 0 212ac: 30 e0 ldi r19, 0x00 ; 0 212ae: 40 ea ldi r20, 0xA0 ; 160 212b0: 50 e4 ldi r21, 0x40 ; 64 212b2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 212b6: 18 16 cp r1, r24 212b8: 0c f4 brge .+2 ; 0x212bc 212ba: 53 c0 rjmp .+166 ; 0x21362 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]); 212bc: 7f 92 push r7 212be: 6f 92 push r6 212c0: 5f 92 push r5 212c2: 4f 92 push r4 212c4: 86 e7 ldi r24, 0x76 ; 118 212c6: 9c e6 ldi r25, 0x6C ; 108 212c8: 9f 93 push r25 212ca: 8f 93 push r24 212cc: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 212d0: a5 01 movw r20, r10 212d2: 94 01 movw r18, r8 212d4: c3 01 movw r24, r6 212d6: b2 01 movw r22, r4 212d8: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 212dc: 9f 77 andi r25, 0x7F ; 127 212de: 0f 90 pop r0 212e0: 0f 90 pop r0 212e2: 0f 90 pop r0 212e4: 0f 90 pop r0 212e6: 0f 90 pop r0 212e8: 0f 90 pop r0 212ea: 20 e0 ldi r18, 0x00 ; 0 212ec: 30 e0 ldi r19, 0x00 ; 0 212ee: 40 ea ldi r20, 0xA0 ; 160 212f0: 50 e4 ldi r21, 0x40 ; 64 212f2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 212f6: 18 16 cp r1, r24 212f8: a4 f1 brlt .+104 ; 0x21362 endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 212fa: a3 01 movw r20, r6 212fc: 92 01 movw r18, r4 212fe: c7 01 movw r24, r14 21300: b6 01 movw r22, r12 21302: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 21306: 6b 01 movw r12, r22 21308: 7c 01 movw r14, r24 2130a: e8 94 clt 2130c: f7 f8 bld r15, 7 2130e: ff 92 push r15 21310: ef 92 push r14 21312: df 92 push r13 21314: cf 92 push r12 21316: 89 e5 ldi r24, 0x59 ; 89 21318: 9c e6 ldi r25, 0x6C ; 108 2131a: 9f 93 push r25 2131c: 8f 93 push r24 2131e: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 21322: 0f 90 pop r0 21324: 0f 90 pop r0 21326: 0f 90 pop r0 21328: 0f 90 pop r0 2132a: 0f 90 pop r0 2132c: 0f 90 pop r0 2132e: 20 e0 ldi r18, 0x00 ; 0 21330: 30 e0 ldi r19, 0x00 ; 0 21332: 40 e8 ldi r20, 0x80 ; 128 21334: 5f e3 ldi r21, 0x3F ; 63 21336: c7 01 movw r24, r14 21338: b6 01 movw r22, r12 2133a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2133e: 18 16 cp r1, r24 21340: 0c f4 brge .+2 ; 0x21344 21342: 44 c0 rjmp .+136 ; 0x213cc plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 21344: ed 81 ldd r30, Y+5 ; 0x05 21346: fe 81 ldd r31, Y+6 ; 0x06 21348: 10 82 st Z, r1 2134a: 11 82 std Z+1, r1 ; 0x01 2134c: 12 82 std Z+2, r1 ; 0x02 2134e: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 21350: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 reset_crash_det(axis); 21354: 81 2f mov r24, r17 21356: 0e 94 77 d6 call 0x1acee ; 0x1acee endstops_hit_on_purpose(); 2135a: 0f 94 25 63 call 0x2c64a ; 0x2c64a return true; 2135e: 81 e0 ldi r24, 0x01 ; 1 21360: 1d c0 rjmp .+58 ; 0x2139c 21362: 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"; 21366: 64 ef ldi r22, 0xF4 ; 244 21368: 72 e0 ldi r23, 0x02 ; 2 2136a: 11 30 cpi r17, 0x01 ; 1 2136c: 11 f0 breq .+4 ; 0x21372 2136e: 62 ef ldi r22, 0xF2 ; 242 21370: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 21372: 88 e0 ldi r24, 0x08 ; 8 21374: 0f 94 ec 05 call 0x20bd8 ; 0x20bd8 current_position[axis] = 0; 21378: f1 01 movw r30, r2 2137a: e0 5c subi r30, 0xC0 ; 192 2137c: f8 4f sbci r31, 0xF8 ; 248 2137e: 10 82 st Z, r1 21380: 11 82 std Z+1, r1 ; 0x01 21382: 12 82 std Z+2, r1 ; 0x02 21384: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 21386: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 reset_crash_det(axis); 2138a: 81 2f mov r24, r17 2138c: 0e 94 77 d6 call 0x1acee ; 0x1acee 21390: 81 e0 ldi r24, 0x01 ; 1 21392: 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(); 21396: 0f 94 25 63 call 0x2c64a ; 0x2c64a return false; 2139a: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 2139c: 27 96 adiw r28, 0x07 ; 7 2139e: 0f b6 in r0, 0x3f ; 63 213a0: f8 94 cli 213a2: de bf out 0x3e, r29 ; 62 213a4: 0f be out 0x3f, r0 ; 63 213a6: cd bf out 0x3d, r28 ; 61 213a8: df 91 pop r29 213aa: cf 91 pop r28 213ac: 1f 91 pop r17 213ae: ff 90 pop r15 213b0: ef 90 pop r14 213b2: df 90 pop r13 213b4: cf 90 pop r12 213b6: bf 90 pop r11 213b8: af 90 pop r10 213ba: 9f 90 pop r9 213bc: 8f 90 pop r8 213be: 7f 90 pop r7 213c0: 6f 90 pop r6 213c2: 5f 90 pop r5 213c4: 4f 90 pop r4 213c6: 3f 90 pop r3 213c8: 2f 90 pop r2 213ca: 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"; 213cc: 64 ef ldi r22, 0xF4 ; 244 213ce: 72 e0 ldi r23, 0x02 ; 2 213d0: 11 30 cpi r17, 0x01 ; 1 213d2: 11 f0 breq .+4 ; 0x213d8 213d4: 62 ef ldi r22, 0xF2 ; 242 213d6: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 213d8: 87 e0 ldi r24, 0x07 ; 7 213da: 0f 94 ec 05 call 0x20bd8 ; 0x20bd8 current_position[axis] = 0; 213de: f1 01 movw r30, r2 213e0: e0 5c subi r30, 0xC0 ; 192 213e2: f8 4f sbci r31, 0xF8 ; 248 213e4: 10 82 st Z, r1 213e6: 11 82 std Z+1, r1 ; 0x01 213e8: 12 82 std Z+2, r1 ; 0x02 213ea: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 213ec: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 reset_crash_det(axis); 213f0: 81 2f mov r24, r17 213f2: 0e 94 77 d6 call 0x1acee ; 0x1acee 213f6: cf cf rjmp .-98 ; 0x21396 000213f8 : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 213f8: 0f 93 push r16 213fa: 1f 93 push r17 213fc: cf 93 push r28 213fe: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 21400: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 21404: 81 e0 ldi r24, 0x01 ; 1 21406: 0e 94 f6 67 call 0xcfec ; 0xcfec uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 2140a: 8d e5 ldi r24, 0x5D ; 93 2140c: 9f e0 ldi r25, 0x0F ; 15 2140e: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 21412: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 21414: 8b e5 ldi r24, 0x5B ; 91 21416: 9f e0 ldi r25, 0x0F ; 15 21418: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 2141c: 18 2f mov r17, r24 2141e: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 21420: 8a e3 ldi r24, 0x3A ; 58 21422: 90 e4 ldi r25, 0x40 ; 64 21424: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 21428: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 2142c: 61 e0 ldi r22, 0x01 ; 1 2142e: 80 e0 ldi r24, 0x00 ; 0 21430: 0e 94 26 70 call 0xe04c ; 0xe04c 21434: df 93 push r29 21436: cf 93 push r28 21438: 8a e4 ldi r24, 0x4A ; 74 2143a: 9c e8 ldi r25, 0x8C ; 140 2143c: 9f 93 push r25 2143e: 8f 93 push r24 21440: 0e 94 ff 6f call 0xdffe ; 0xdffe KEEPALIVE_STATE(IN_HANDLER); 21444: 82 e0 ldi r24, 0x02 ; 2 21446: 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)){ 2144a: 80 e0 ldi r24, 0x00 ; 0 2144c: 0f 94 01 08 call 0x21002 ; 0x21002 21450: 0f 90 pop r0 21452: 0f 90 pop r0 21454: 0f 90 pop r0 21456: 0f 90 pop r0 21458: 88 23 and r24, r24 2145a: 09 f4 brne .+2 ; 0x2145e 2145c: 45 c0 rjmp .+138 ; 0x214e8 X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 2145e: 8d e5 ldi r24, 0x5D ; 93 21460: 9f e0 ldi r25, 0x0F ; 15 21462: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 21466: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 21468: 61 e0 ldi r22, 0x01 ; 1 2146a: 8a e0 ldi r24, 0x0A ; 10 2146c: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 21470: be 01 movw r22, r28 21472: 90 e0 ldi r25, 0x00 ; 0 21474: 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); 21476: 4a e0 ldi r20, 0x0A ; 10 21478: 0e 94 7a 71 call 0xe2f4 ; 0xe2f4 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 2147c: 88 e2 ldi r24, 0x28 ; 40 2147e: 90 e4 ldi r25, 0x40 ; 64 21480: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 21484: ac 01 movw r20, r24 21486: 62 e0 ldi r22, 0x02 ; 2 21488: 80 e0 ldi r24, 0x00 ; 0 2148a: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 2148e: 63 e0 ldi r22, 0x03 ; 3 21490: 80 e0 ldi r24, 0x00 ; 0 21492: 0e 94 26 70 call 0xe04c ; 0xe04c 21496: 0f 93 push r16 21498: 1f 93 push r17 2149a: 8d e3 ldi r24, 0x3D ; 61 2149c: 9c e8 ldi r25, 0x8C ; 140 2149e: 9f 93 push r25 214a0: 8f 93 push r24 214a2: 0e 94 ff 6f call 0xdffe ; 0xdffe if (lcd_selfcheck_axis_sg(Y_AXIS)) 214a6: 81 e0 ldi r24, 0x01 ; 1 214a8: 0f 94 01 08 call 0x21002 ; 0x21002 214ac: 0f 90 pop r0 214ae: 0f 90 pop r0 214b0: 0f 90 pop r0 214b2: 0f 90 pop r0 214b4: 88 23 and r24, r24 214b6: c1 f0 breq .+48 ; 0x214e8 { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 214b8: 8b e5 ldi r24, 0x5B ; 91 214ba: 9f e0 ldi r25, 0x0F ; 15 214bc: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 214c0: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 214c2: 63 e0 ldi r22, 0x03 ; 3 214c4: 8a e0 ldi r24, 0x0A ; 10 214c6: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 214ca: be 01 movw r22, r28 214cc: 90 e0 ldi r25, 0x00 ; 0 214ce: 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); 214d0: 4a e0 ldi r20, 0x0A ; 10 214d2: 0e 94 7a 71 call 0xe2f4 ; 0xe2f4 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 214d6: 43 e8 ldi r20, 0x83 ; 131 214d8: 63 e0 ldi r22, 0x03 ; 3 214da: 83 e1 ldi r24, 0x13 ; 19 214dc: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_wait_for_click_delay(10); 214e0: 8a e0 ldi r24, 0x0A ; 10 214e2: 90 e0 ldi r25, 0x00 ; 0 214e4: 0f 94 39 4f call 0x29e72 ; 0x29e72 } } FORCE_HIGH_POWER_END; 214e8: 80 e0 ldi r24, 0x00 ; 0 214ea: 0e 94 f6 67 call 0xcfec ; 0xcfec KEEPALIVE_STATE(NOT_BUSY); 214ee: 81 e0 ldi r24, 0x01 ; 1 214f0: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 214f4: df 91 pop r29 214f6: cf 91 pop r28 214f8: 1f 91 pop r17 214fa: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 214fc: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00021500 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 21500: 0f 94 1d 26 call 0x24c3a ; 0x24c3a lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 21504: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 21508: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 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() 2150c: 81 11 cpse r24, r1 2150e: 32 c0 rjmp .+100 ; 0x21574 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 21510: 80 91 38 02 lds r24, 0x0238 ; 0x800238 21514: 81 11 cpse r24, r1 21516: 02 c0 rjmp .+4 ; 0x2151c #endif ) { return false; // abort if error persists } return true; 21518: 81 e0 ldi r24, 0x01 ; 1 2151a: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 2151c: 8f ef ldi r24, 0xFF ; 255 2151e: 0e 94 c9 cf call 0x19f92 ; 0x19f92 setExtruderAutoFanState(3); //force enables the hotend fan 21522: 83 e0 ldi r24, 0x03 ; 3 21524: 0e 94 62 77 call 0xeec4 ; 0xeec4 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 21528: 0f 94 55 3e call 0x27caa ; 0x27caa 2152c: 60 93 99 17 sts 0x1799, r22 ; 0x801799 21530: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 21534: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 21538: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c fan_measuring = true; 2153c: 81 e0 ldi r24, 0x01 ; 1 2153e: 80 93 33 05 sts 0x0533, r24 ; 0x800533 #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 21542: 68 ee ldi r22, 0xE8 ; 232 21544: 73 e0 ldi r23, 0x03 ; 3 21546: 80 e0 ldi r24, 0x00 ; 0 21548: 90 e0 ldi r25, 0x00 ; 0 2154a: 0f 94 5c 3c call 0x278b8 ; 0x278b8 manage_heater(); 2154e: 0f 94 66 4d call 0x29acc ; 0x29acc setExtruderAutoFanState(1); //releases lock on the hotend fan 21552: 81 e0 ldi r24, 0x01 ; 1 21554: 0e 94 62 77 call 0xeec4 ; 0xeec4 lcd_selftest_setfan(0); 21558: 80 e0 ldi r24, 0x00 ; 0 2155a: 0e 94 c9 cf call 0x19f92 ; 0x19f92 #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 2155e: 80 91 ae 04 lds r24, 0x04AE ; 0x8004ae 21562: 90 91 af 04 lds r25, 0x04AF ; 0x8004af 21566: 45 97 sbiw r24, 0x15 ; 21 21568: 3c f4 brge .+14 ; 0x21578 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 2156a: 62 e0 ldi r22, 0x02 ; 2 2156c: 81 ef ldi r24, 0xF1 ; 241 2156e: 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); 21570: 0f 94 bd 05 call 0x20b7a ; 0x20b7a if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 21574: 80 e0 ldi r24, 0x00 ; 0 } return true; } 21576: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 21578: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 2157c: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 21580: 45 97 sbiw r24, 0x15 ; 21 21582: 54 f6 brge .-108 ; 0x21518 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 21584: 62 e0 ldi r22, 0x02 ; 2 21586: 8d ed ldi r24, 0xDD ; 221 21588: 9b e6 ldi r25, 0x6B ; 107 2158a: f2 cf rjmp .-28 ; 0x21570 0002158c : //! @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; 2158c: 0f 94 80 0a call 0x21500 ; 0x21500 21590: 88 23 and r24, r24 21592: 21 f0 breq .+8 ; 0x2159c // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 21594: 87 e1 ldi r24, 0x17 ; 23 21596: 9c e6 ldi r25, 0x6C ; 108 21598: 0c 94 97 7b jmp 0xf72e ; 0xf72e } 2159c: 08 95 ret 0002159e : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 2159e: cf 93 push r28 215a0: df 93 push r29 215a2: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 215a4: 80 e0 ldi r24, 0x00 ; 0 215a6: 0f 94 a7 05 call 0x20b4e ; 0x20b4e 215aa: 88 23 and r24, r24 215ac: 21 f0 breq .+8 ; 0x215b6 lcd_updatestatus(message); 215ae: 60 e0 ldi r22, 0x00 ; 0 215b0: ce 01 movw r24, r28 215b2: 0f 94 8c 05 call 0x20b18 ; 0x20b18 SERIAL_ECHOLN(message); 215b6: ce 01 movw r24, r28 } 215b8: df 91 pop r29 215ba: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 215bc: 0d 94 14 d6 jmp 0x3ac28 ; 0x3ac28 000215c0 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 215c0: cf 93 push r28 215c2: df 93 push r29 215c4: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 215c6: 80 e0 ldi r24, 0x00 ; 0 215c8: 0f 94 a7 05 call 0x20b4e ; 0x20b4e 215cc: 88 23 and r24, r24 215ce: 31 f0 breq .+12 ; 0x215dc lcd_updatestatus(message, true); 215d0: 61 e0 ldi r22, 0x01 ; 1 215d2: ce 01 movw r24, r28 } 215d4: df 91 pop r29 215d6: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 215d8: 0d 94 8c 05 jmp 0x20b18 ; 0x20b18 } 215dc: df 91 pop r29 215de: cf 91 pop r28 215e0: 08 95 ret 000215e2 : } } void lcd_print_stop_finish(); void lcd_commands() 215e2: 2f 92 push r2 215e4: 3f 92 push r3 215e6: 4f 92 push r4 215e8: 5f 92 push r5 215ea: 6f 92 push r6 215ec: 7f 92 push r7 215ee: 8f 92 push r8 215f0: 9f 92 push r9 215f2: af 92 push r10 215f4: bf 92 push r11 215f6: cf 92 push r12 215f8: df 92 push r13 215fa: ef 92 push r14 215fc: ff 92 push r15 215fe: 0f 93 push r16 21600: 1f 93 push r17 21602: cf 93 push r28 21604: df 93 push r29 21606: 00 d0 rcall .+0 ; 0x21608 21608: 1f 92 push r1 2160a: 1f 92 push r1 2160c: cd b7 in r28, 0x3d ; 61 2160e: 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) 21610: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 21614: 81 30 cpi r24, 0x01 ; 1 21616: 09 f0 breq .+2 ; 0x2161a 21618: 61 c0 rjmp .+194 ; 0x216dc 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); 2161a: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2161e: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 { if (!blocks_queued() && !homing_flag) 21622: 98 13 cpse r25, r24 21624: 5b c0 rjmp .+182 ; 0x216dc 21626: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 2162a: 81 11 cpse r24, r1 2162c: 57 c0 rjmp .+174 ; 0x216dc { custom_message_type = CustomMsg::Status; 2162e: 10 92 72 07 sts 0x0772, r1 ; 0x800772 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 21632: 8b e2 ldi r24, 0x2B ; 43 21634: 91 e4 ldi r25, 0x41 ; 65 21636: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2163a: 0f 94 e0 0a call 0x215c0 ; 0x215c0 lcd_commands_type = LcdCommands::Idle; 2163e: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 21642: 82 e0 ldi r24, 0x02 ; 2 21644: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 21648: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 #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(); 2164c: 0f 94 a4 57 call 0x2af48 ; 0x2af48 save_statistics(); 21650: 0e 94 65 67 call 0xceca ; 0xceca // lift Z raise_z(10); 21654: 60 e0 ldi r22, 0x00 ; 0 21656: 70 e0 ldi r23, 0x00 ; 0 21658: 80 e2 ldi r24, 0x20 ; 32 2165a: 91 e4 ldi r25, 0x41 ; 65 2165c: 0e 94 27 6f call 0xde4e ; 0xde4e // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 21660: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 21664: 88 23 and r24, r24 21666: 21 f1 breq .+72 ; 0x216b0 21668: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 2166c: 88 23 and r24, r24 2166e: 01 f1 breq .+64 ; 0x216b0 current_position[X_AXIS] = X_CANCEL_POS; 21670: 80 e0 ldi r24, 0x00 ; 0 21672: 90 e0 ldi r25, 0x00 ; 0 21674: a8 e4 ldi r26, 0x48 ; 72 21676: b2 e4 ldi r27, 0x42 ; 66 21678: 80 93 40 07 sts 0x0740, r24 ; 0x800740 2167c: 90 93 41 07 sts 0x0741, r25 ; 0x800741 21680: a0 93 42 07 sts 0x0742, r26 ; 0x800742 21684: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = Y_CANCEL_POS; 21688: 80 e0 ldi r24, 0x00 ; 0 2168a: 90 e0 ldi r25, 0x00 ; 0 2168c: ae e3 ldi r26, 0x3E ; 62 2168e: b3 e4 ldi r27, 0x43 ; 67 21690: 80 93 44 07 sts 0x0744, r24 ; 0x800744 21694: 90 93 45 07 sts 0x0745, r25 ; 0x800745 21698: a0 93 46 07 sts 0x0746, r26 ; 0x800746 2169c: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 216a0: 60 e0 ldi r22, 0x00 ; 0 216a2: 70 e0 ldi r23, 0x00 ; 0 216a4: 84 e3 ldi r24, 0x34 ; 52 216a6: 92 e4 ldi r25, 0x42 ; 66 216a8: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 216ac: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 216b0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> // 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()) { 216b4: 88 23 and r24, r24 216b6: 09 f4 brne .+2 ; 0x216ba 216b8: c9 c0 rjmp .+402 ; 0x2184c // time to stop the error beep WRITE(BEEPER, LOW); 216ba: 9f b7 in r25, 0x3f ; 63 216bc: f8 94 cli 216be: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 216c2: 8b 7f andi r24, 0xFB ; 251 216c4: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 216c8: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 216ca: 0f 94 36 44 call 0x2886c ; 0x2886c finishAndDisableSteppers(); //M84 216ce: 0e 94 24 84 call 0x10848 ; 0x10848 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 216d2: 88 e0 ldi r24, 0x08 ; 8 216d4: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd did_pause_print = false; // Clear pause state in case the print was aborted while paused 216d8: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 216dc: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 216e0: 82 30 cpi r24, 0x02 ; 2 216e2: 09 f0 breq .+2 ; 0x216e6 216e4: 6a c0 rjmp .+212 ; 0x217ba 216e6: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 216ea: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 { if (!blocks_queued() && !homing_flag) 216ee: 98 13 cpse r25, r24 216f0: 64 c0 rjmp .+200 ; 0x217ba 216f2: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 216f6: 81 11 cpse r24, r1 216f8: 60 c0 rjmp .+192 ; 0x217ba { if (custom_message_type != CustomMsg::M117) 216fa: 80 91 72 07 lds r24, 0x0772 ; 0x800772 216fe: 87 30 cpi r24, 0x07 ; 7 21700: 41 f0 breq .+16 ; 0x21712 { custom_message_type = CustomMsg::Status; 21702: 10 92 72 07 sts 0x0772, r1 ; 0x800772 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 21706: 8c e1 ldi r24, 0x1C ; 28 21708: 91 e4 ldi r25, 0x41 ; 65 2170a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2170e: 0f 94 e0 0a call 0x215c0 ; 0x215c0 } lcd_commands_type = LcdCommands::Idle; 21712: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 21716: 82 e0 ldi r24, 0x02 ; 2 21718: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 2171c: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 21720: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 21724: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 21728: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 2172c: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 21730: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.494+0x8> 21734: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.494+0x9> 21738: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.494+0xa> 2173c: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.494+0xb> 21740: 0e 94 27 6f call 0xde4e ; 0xde4e // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 21744: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 21748: 88 23 and r24, r24 2174a: 51 f1 breq .+84 ; 0x217a0 2174c: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 21750: 88 23 and r24, r24 21752: 31 f1 breq .+76 ; 0x217a0 current_position[X_AXIS] = pause_position[X_AXIS]; 21754: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.494> 21758: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.494+0x1> 2175c: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.494+0x2> 21760: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.494+0x3> 21764: 80 93 40 07 sts 0x0740, r24 ; 0x800740 21768: 90 93 41 07 sts 0x0741, r25 ; 0x800741 2176c: a0 93 42 07 sts 0x0742, r26 ; 0x800742 21770: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pause_position[Y_AXIS]; 21774: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.494+0x4> 21778: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.494+0x5> 2177c: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.494+0x6> 21780: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.494+0x7> 21784: 80 93 44 07 sts 0x0744, r24 ; 0x800744 21788: 90 93 45 07 sts 0x0745, r25 ; 0x800745 2178c: a0 93 46 07 sts 0x0746, r26 ; 0x800746 21790: b0 93 47 07 sts 0x0747, r27 ; 0x800747 plan_buffer_line_curposXYZE(50); 21794: 60 e0 ldi r22, 0x00 ; 0 21796: 70 e0 ldi r23, 0x00 ; 0 21798: 88 e4 ldi r24, 0x48 ; 72 2179a: 92 e4 ldi r25, 0x42 ; 66 2179c: 0f 94 11 ba call 0x37422 ; 0x37422 217a0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> } // did we come here from a thermal error? if(get_temp_error()) { 217a4: 88 23 and r24, r24 217a6: 09 f4 brne .+2 ; 0x217aa 217a8: 78 c0 rjmp .+240 ; 0x2189a // time to stop the error beep WRITE(BEEPER, LOW); 217aa: 9f b7 in r25, 0x3f ; 63 217ac: f8 94 cli 217ae: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 217b2: 8b 7f andi r24, 0xFB ; 251 217b4: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 217b8: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 217ba: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 217be: 84 30 cpi r24, 0x04 ; 4 217c0: 09 f0 breq .+2 ; 0x217c4 217c2: aa c0 rjmp .+340 ; 0x21918 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 217c4: 85 ea ldi r24, 0xA5 ; 165 217c6: 9d e0 ldi r25, 0x0D ; 13 217c8: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 217cc: 30 91 53 0e lds r19, 0x0E53 ; 0x800e53 217d0: 20 91 54 0e lds r18, 0x0E54 ; 0x800e54 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 217d4: 32 13 cpse r19, r18 217d6: 79 c1 rjmp .+754 ; 0x21aca 217d8: 20 91 7e 10 lds r18, 0x107E ; 0x80107e 217dc: 30 91 7f 10 lds r19, 0x107F ; 0x80107f 217e0: 23 2b or r18, r19 217e2: 09 f0 breq .+2 ; 0x217e6 217e4: 72 c1 rjmp .+740 ; 0x21aca 217e6: 20 91 57 0e lds r18, 0x0E57 ; 0x800e57 217ea: 29 83 std Y+1, r18 ; 0x01 217ec: 21 11 cpse r18, r1 217ee: 6d c1 rjmp .+730 ; 0x21aca { if (lcd_commands_step == 0) 217f0: 20 91 f4 03 lds r18, 0x03F4 ; 0x8003f4 217f4: 21 11 cpse r18, r1 217f6: 54 c0 rjmp .+168 ; 0x218a0 lcd_commands_step = 12; 217f8: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 217fa: 20 93 f4 03 sts 0x03F4, r18 ; 0x8003f4 } 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; 217fe: 44 96 adiw r24, 0x14 ; 20 21800: bc 01 movw r22, r24 21802: 90 e0 ldi r25, 0x00 ; 0 21804: 80 e0 ldi r24, 0x00 ; 0 21806: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 2180a: 20 e0 ldi r18, 0x00 ; 0 2180c: 30 e0 ldi r19, 0x00 ; 0 2180e: 4a e7 ldi r20, 0x7A ; 122 21810: 54 e4 ldi r21, 0x44 ; 68 21812: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 21816: 6b 01 movw r12, r22 21818: 7c 01 movw r14, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 2181a: e0 91 f4 03 lds r30, 0x03F4 ; 0x8003f4 2181e: e1 50 subi r30, 0x01 ; 1 21820: ec 30 cpi r30, 0x0C ; 12 21822: 08 f0 brcs .+2 ; 0x21826 21824: 79 c0 rjmp .+242 ; 0x21918 21826: f0 e0 ldi r31, 0x00 ; 0 21828: 88 27 eor r24, r24 2182a: e6 5e subi r30, 0xE6 ; 230 2182c: f3 4f sbci r31, 0xF3 ; 243 2182e: 8e 4f sbci r24, 0xFE ; 254 21830: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 21834: f6 3a cpi r31, 0xA6 ; 166 21836: 9c 3a cpi r25, 0xAC ; 172 21838: 64 3b cpi r22, 0xB4 ; 180 2183a: d4 39 cpi r29, 0x94 ; 148 2183c: 5c 3a cpi r21, 0xAC ; 172 2183e: 6e 3a cpi r22, 0xAE ; 174 21840: de 3a cpi r29, 0xAE ; 174 21842: 76 3a cpi r23, 0xA6 ; 166 21844: a2 3a cpi r26, 0xA2 ; 162 21846: 72 3b cpi r23, 0xB2 ; 178 21848: 3e 3a cpi r19, 0xAE ; 174 2184a: e8 3a cpi r30, 0xA8 ; 168 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 2184c: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // restore the auto hotend state hotendDefaultAutoFanState(); 21850: 0e 94 b4 77 call 0xef68 ; 0xef68 if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21854: 80 91 95 13 lds r24, 0x1395 ; 0x801395 21858: 81 30 cpi r24, 0x01 ; 1 2185a: 09 f0 breq .+2 ; 0x2185e 2185c: 36 cf rjmp .-404 ; 0x216ca fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 2185e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 21862: 88 23 and r24, r24 21864: 09 f4 brne .+2 ; 0x21868 21866: 31 cf rjmp .-414 ; 0x216ca #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21868: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 2186c: 82 30 cpi r24, 0x02 ; 2 2186e: 09 f4 brne .+2 ; 0x21872 21870: 2c cf rjmp .-424 ; 0x216ca #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()) 21872: 0e 94 cb 68 call 0xd196 ; 0xd196 21876: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 21878: 0e 94 0f 66 call 0xcc1e ; 0xcc1e } // 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) { 2187c: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 21880: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 21884: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 21888: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2188c: 28 17 cp r18, r24 2188e: 39 07 cpc r19, r25 21890: 0c f4 brge .+2 ; 0x21894 21892: 1b cf rjmp .-458 ; 0x216ca MMU2::mmu2.unload(); // M702 21894: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 21898: 18 cf rjmp .-464 ; 0x216ca } else { // Turn off the print fan fanSpeed = 0; 2189a: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df 2189e: 8d cf rjmp .-230 ; 0x217ba if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 218a0: 21 50 subi r18, 0x01 ; 1 218a2: ab cf rjmp .-170 ; 0x217fa preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 218a4: 65 e0 ldi r22, 0x05 ; 5 218a6: 81 ed ldi r24, 0xD1 ; 209 218a8: 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]))); 218aa: 0e 94 5b 8a call 0x114b6 ; 0x114b6 218ae: 34 c0 rjmp .+104 ; 0x21918 //! @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()) 218b0: 80 91 95 13 lds r24, 0x1395 ; 0x801395 218b4: 81 30 cpi r24, 0x01 ; 1 218b6: 69 f5 brne .+90 ; 0x21912 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 218b8: 30 91 f3 03 lds r19, 0x03F3 ; 0x8003f3 <_ZL16lay1cal_filament.lto_priv.453> 218bc: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 218be: 61 e0 ldi r22, 0x01 ; 1 218c0: 8b ef ldi r24, 0xFB ; 251 218c2: 9c e6 ldi r25, 0x6C ; 108 218c4: 0e 94 dc 89 call 0x113b8 ; 0x113b8 enquecommand_P(PSTR("G1 Y-3 F1000")); 218c8: 61 e0 ldi r22, 0x01 ; 1 218ca: 84 ec ldi r24, 0xC4 ; 196 218cc: 9d e8 ldi r25, 0x8D ; 141 218ce: 0e 94 dc 89 call 0x113b8 ; 0x113b8 enquecommand_P(PSTR("G1 Z0.4 F1000")); 218d2: 61 e0 ldi r22, 0x01 ; 1 218d4: 86 eb ldi r24, 0xB6 ; 182 218d6: 9d e8 ldi r25, 0x8D ; 141 218d8: 0e 94 dc 89 call 0x113b8 ; 0x113b8 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 218dc: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 if(currentTool == filament ){ 218e0: 9b 81 ldd r25, Y+3 ; 0x03 218e2: 98 17 cp r25, r24 218e4: b1 f0 breq .+44 ; 0x21912 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 218e6: 8f 3f cpi r24, 0xFF ; 255 218e8: 29 f0 breq .+10 ; 0x218f4 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 218ea: 61 e0 ldi r22, 0x01 ; 1 218ec: 86 ef ldi r24, 0xF6 ; 246 218ee: 9c e6 ldi r25, 0x6C ; 108 218f0: 0e 94 dc 89 call 0x113b8 ; 0x113b8 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 218f4: 1f 92 push r1 218f6: 2b 81 ldd r18, Y+3 ; 0x03 218f8: 2f 93 push r18 218fa: 82 eb ldi r24, 0xB2 ; 178 218fc: 9d e8 ldi r25, 0x8D ; 141 218fe: 9f 93 push r25 21900: 8f 93 push r24 21902: 0e 94 72 8a call 0x114e4 ; 0x114e4 21906: 0f 90 pop r0 21908: 0f 90 pop r0 2190a: 0f 90 pop r0 2190c: 0f 90 pop r0 return true; 2190e: 31 e0 ldi r19, 0x01 ; 1 21910: 39 83 std Y+1, r19 ; 0x01 21912: 89 81 ldd r24, Y+1 ; 0x01 21914: 80 93 f2 03 sts 0x03F2, r24 ; 0x8003f2 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 21918: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 2191c: 83 30 cpi r24, 0x03 ; 3 2191e: 09 f0 breq .+2 ; 0x21922 21920: d4 c0 rjmp .+424 ; 0x21aca if (lcd_commands_step == 0) { 21922: 90 91 f4 03 lds r25, 0x03F4 ; 0x8003f4 21926: 91 11 cpse r25, r1 21928: 09 c0 rjmp .+18 ; 0x2193c custom_message_type = CustomMsg::PidCal; 2192a: 80 93 72 07 sts 0x0772, r24 ; 0x800772 custom_message_state = 1; 2192e: 91 e0 ldi r25, 0x01 ; 1 21930: 90 93 f0 03 sts 0x03F0, r25 ; 0x8003f0 lcd_draw_update = 3; 21934: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 21938: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 2193c: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21940: 83 30 cpi r24, 0x03 ; 3 21942: 19 f5 brne .+70 ; 0x2198a 21944: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 21948: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 2194c: 98 13 cpse r25, r24 2194e: 1d c0 rjmp .+58 ; 0x2198a return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 21950: 0f 94 21 44 call 0x28842 ; 0x28842 pid_tuning_finished = false; 21954: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.470> 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); 21958: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.454+0x1> 2195c: 8f 93 push r24 2195e: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.454> 21962: 8f 93 push r24 21964: 86 e6 ldi r24, 0x66 ; 102 21966: 9e e8 ldi r25, 0x8E ; 142 21968: 9f 93 push r25 2196a: 8f 93 push r24 2196c: 0e 94 72 8a call 0x114e4 ; 0x114e4 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 21970: 81 e1 ldi r24, 0x11 ; 17 21972: 91 e4 ldi r25, 0x41 ; 65 21974: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 21978: 0f 94 e0 0a call 0x215c0 ; 0x215c0 lcd_commands_step = 2; 2197c: 82 e0 ldi r24, 0x02 ; 2 2197e: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 21982: 0f 90 pop r0 21984: 0f 90 pop r0 21986: 0f 90 pop r0 21988: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 2198a: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 2198e: 82 30 cpi r24, 0x02 ; 2 21990: 09 f0 breq .+2 ; 0x21994 21992: 7c c0 rjmp .+248 ; 0x21a8c 21994: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.470> 21998: 88 23 and r24, r24 2199a: 09 f4 brne .+2 ; 0x2199e 2199c: 77 c0 rjmp .+238 ; 0x21a8c custom_message_state = 0; 2199e: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 219a2: 8d ef ldi r24, 0xFD ; 253 219a4: 90 e4 ldi r25, 0x40 ; 64 219a6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 219aa: 0f 94 e0 0a call 0x215c0 ; 0x215c0 219ae: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 219b2: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 219b6: 30 91 ec 03 lds r19, 0x03EC ; 0x8003ec <_Kp> 219ba: 39 83 std Y+1, r19 ; 0x01 219bc: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Kp+0x1> 219c0: 8b 83 std Y+3, r24 ; 0x03 219c2: 10 91 ee 03 lds r17, 0x03EE ; 0x8003ee <_Kp+0x2> 219c6: 00 91 ef 03 lds r16, 0x03EF ; 0x8003ef <_Kp+0x3> 219ca: 20 e0 ldi r18, 0x00 ; 0 219cc: 30 e0 ldi r19, 0x00 ; 0 219ce: a9 01 movw r20, r18 219d0: b9 81 ldd r27, Y+1 ; 0x01 219d2: f8 01 movw r30, r16 219d4: 6b 2f mov r22, r27 219d6: 78 2f mov r23, r24 219d8: 8f 2f mov r24, r31 219da: 9e 2f mov r25, r30 219dc: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 219e0: 81 11 cpse r24, r1 219e2: 1f c0 rjmp .+62 ; 0x21a22 219e4: 20 e0 ldi r18, 0x00 ; 0 219e6: 30 e0 ldi r19, 0x00 ; 0 219e8: a9 01 movw r20, r18 219ea: 60 91 e8 03 lds r22, 0x03E8 ; 0x8003e8 <_Ki> 219ee: 70 91 e9 03 lds r23, 0x03E9 ; 0x8003e9 <_Ki+0x1> 219f2: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Ki+0x2> 219f6: 90 91 eb 03 lds r25, 0x03EB ; 0x8003eb <_Ki+0x3> 219fa: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 219fe: 81 11 cpse r24, r1 21a00: 10 c0 rjmp .+32 ; 0x21a22 21a02: 20 e0 ldi r18, 0x00 ; 0 21a04: 30 e0 ldi r19, 0x00 ; 0 21a06: a9 01 movw r20, r18 21a08: 60 91 e4 03 lds r22, 0x03E4 ; 0x8003e4 <_Kd> 21a0c: 70 91 e5 03 lds r23, 0x03E5 ; 0x8003e5 <_Kd+0x1> 21a10: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_Kd+0x2> 21a14: 90 91 e7 03 lds r25, 0x03E7 ; 0x8003e7 <_Kd+0x3> 21a18: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 21a1c: 88 23 and r24, r24 21a1e: 09 f4 brne .+2 ; 0x21a22 21a20: 47 c2 rjmp .+1166 ; 0x21eb0 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 21a22: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 <_Kd+0x3> 21a26: 8f 93 push r24 21a28: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_Kd+0x2> 21a2c: 8f 93 push r24 21a2e: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 <_Kd+0x1> 21a32: 8f 93 push r24 21a34: 80 91 e4 03 lds r24, 0x03E4 ; 0x8003e4 <_Kd> 21a38: 8f 93 push r24 21a3a: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Ki+0x3> 21a3e: 8f 93 push r24 21a40: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Ki+0x2> 21a44: 8f 93 push r24 21a46: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Ki+0x1> 21a4a: 8f 93 push r24 21a4c: 80 91 e8 03 lds r24, 0x03E8 ; 0x8003e8 <_Ki> 21a50: 8f 93 push r24 21a52: 0f 93 push r16 21a54: 1f 93 push r17 21a56: 9b 81 ldd r25, Y+3 ; 0x03 21a58: 9f 93 push r25 21a5a: 29 81 ldd r18, Y+1 ; 0x01 21a5c: 2f 93 push r18 21a5e: 8f e4 ldi r24, 0x4F ; 79 21a60: 9e e8 ldi r25, 0x8E ; 142 21a62: 9f 93 push r25 21a64: 8f 93 push r24 21a66: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommand_P(MSG_M500); 21a6a: 61 e0 ldi r22, 0x01 ; 1 21a6c: 85 e0 ldi r24, 0x05 ; 5 21a6e: 9d e6 ldi r25, 0x6D ; 109 21a70: 0e 94 dc 89 call 0x113b8 ; 0x113b8 21a74: 0f b6 in r0, 0x3f ; 63 21a76: f8 94 cli 21a78: de bf out 0x3e, r29 ; 62 21a7a: 0f be out 0x3f, r0 ; 63 21a7c: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 21a7e: 81 ee ldi r24, 0xE1 ; 225 21a80: 93 e0 ldi r25, 0x03 ; 3 21a82: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> lcd_commands_step = 1; 21a86: 81 e0 ldi r24, 0x01 ; 1 21a88: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 21a8c: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21a90: 81 30 cpi r24, 0x01 ; 1 21a92: d9 f4 brne .+54 ; 0x21aca 21a94: 60 ed ldi r22, 0xD0 ; 208 21a96: 77 e0 ldi r23, 0x07 ; 7 21a98: 81 ee ldi r24, 0xE1 ; 225 21a9a: 93 e0 ldi r25, 0x03 ; 3 21a9c: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 21aa0: 88 23 and r24, r24 21aa2: 99 f0 breq .+38 ; 0x21aca lcd_setstatuspgm(MSG_WELCOME); 21aa4: 81 e5 ldi r24, 0x51 ; 81 21aa6: 91 e7 ldi r25, 0x71 ; 113 21aa8: 0f 94 e0 0a call 0x215c0 ; 0x215c0 custom_message_type = CustomMsg::Status; 21aac: 10 92 72 07 sts 0x0772, r1 ; 0x800772 pid_temp = DEFAULT_PID_TEMP; 21ab0: 82 ed ldi r24, 0xD2 ; 210 21ab2: 90 e0 ldi r25, 0x00 ; 0 21ab4: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.454+0x1> 21ab8: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.454> lcd_commands_step = 0; 21abc: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 lcd_commands_type = LcdCommands::Idle; 21ac0: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 21ac4: 82 e0 ldi r24, 0x02 ; 2 21ac6: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); } } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) 21aca: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 21ace: 95 30 cpi r25, 0x05 ; 5 21ad0: 99 f4 brne .+38 ; 0x21af8 21ad2: 20 91 7e 10 lds r18, 0x107E ; 0x80107e 21ad6: 30 91 7f 10 lds r19, 0x107F ; 0x80107f 21ada: 23 2b or r18, r19 21adc: 71 f5 brne .+92 ; 0x21b3a { switch (lcd_commands_step) 21ade: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21ae2: 82 30 cpi r24, 0x02 ; 2 21ae4: 09 f4 brne .+2 ; 0x21ae8 21ae6: 0d c2 rjmp .+1050 ; 0x21f02 21ae8: 08 f0 brcs .+2 ; 0x21aec 21aea: e7 c1 rjmp .+974 ; 0x21eba 21aec: 88 23 and r24, r24 21aee: 09 f4 brne .+2 ; 0x21af2 21af0: f8 c1 rjmp .+1008 ; 0x21ee2 21af2: 81 30 cpi r24, 0x01 ; 1 21af4: 09 f4 brne .+2 ; 0x21af8 21af6: 10 c2 rjmp .+1056 ; 0x21f18 break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 21af8: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 21afc: 86 30 cpi r24, 0x06 ; 6 21afe: e9 f4 brne .+58 ; 0x21b3a 21b00: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 21b04: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 21b08: 98 13 cpse r25, r24 21b0a: 17 c0 rjmp .+46 ; 0x21b3a 21b0c: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 21b10: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 21b14: 89 2b or r24, r25 21b16: 89 f4 brne .+34 ; 0x21b3a 21b18: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 21b1c: 81 11 cpse r24, r1 21b1e: 0d c0 rjmp .+26 ; 0x21b3a #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) 21b20: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 21b24: 81 30 cpi r24, 0x01 ; 1 21b26: 09 f4 brne .+2 ; 0x21b2a 21b28: 4c c2 rjmp .+1176 ; 0x21fc2 21b2a: 08 f4 brcc .+2 ; 0x21b2e 21b2c: 0f c2 rjmp .+1054 ; 0x21f4c 21b2e: 82 30 cpi r24, 0x02 ; 2 21b30: 09 f4 brne .+2 ; 0x21b34 21b32: 2e c2 rjmp .+1116 ; 0x21f90 21b34: 83 30 cpi r24, 0x03 ; 3 21b36: 09 f4 brne .+2 ; 0x21b3a 21b38: 0d c2 rjmp .+1050 ; 0x21f54 menu_depth = 3; break; } } } } 21b3a: 0f 90 pop r0 21b3c: 0f 90 pop r0 21b3e: 0f 90 pop r0 21b40: 0f 90 pop r0 21b42: 0f 90 pop r0 21b44: df 91 pop r29 21b46: cf 91 pop r28 21b48: 1f 91 pop r17 21b4a: 0f 91 pop r16 21b4c: ff 90 pop r15 21b4e: ef 90 pop r14 21b50: df 90 pop r13 21b52: cf 90 pop r12 21b54: bf 90 pop r11 21b56: af 90 pop r10 21b58: 9f 90 pop r9 21b5a: 8f 90 pop r8 21b5c: 7f 90 pop r7 21b5e: 6f 90 pop r6 21b60: 5f 90 pop r5 21b62: 4f 90 pop r4 21b64: 3f 90 pop r3 21b66: 2f 90 pop r2 21b68: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 21b6a: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 menu_depth = 0; 21b6e: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 menu_submenu(lcd_babystep_z, true); 21b72: 61 e0 ldi r22, 0x01 ; 1 21b74: 8c ec ldi r24, 0xCC ; 204 21b76: 9a e3 ldi r25, 0x3A ; 58 21b78: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 21b7c: 80 91 95 13 lds r24, 0x1395 ; 0x801395 21b80: 81 30 cpi r24, 0x01 ; 1 21b82: f1 f4 brne .+60 ; 0x21bc0 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 21b84: 80 91 f2 03 lds r24, 0x03F2 ; 0x8003f2 21b88: 10 e0 ldi r17, 0x00 ; 0 21b8a: 81 11 cpse r24, r1 21b8c: 01 c0 rjmp .+2 ; 0x21b90 21b8e: 12 e0 ldi r17, 0x02 ; 2 21b90: 21 2f mov r18, r17 21b92: 30 e0 ldi r19, 0x00 ; 0 21b94: 22 0f add r18, r18 21b96: 33 1f adc r19, r19 21b98: 22 56 subi r18, 0x62 ; 98 21b9a: 32 47 sbci r19, 0x72 ; 114 21b9c: 3a 83 std Y+2, r19 ; 0x02 21b9e: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 21ba0: e9 81 ldd r30, Y+1 ; 0x01 21ba2: fa 81 ldd r31, Y+2 ; 0x02 21ba4: 85 91 lpm r24, Z+ 21ba6: 94 91 lpm r25, Z 21ba8: 61 e0 ldi r22, 0x01 ; 1 21baa: 0e 94 dc 89 call 0x113b8 ; 0x113b8 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) 21bae: 1f 5f subi r17, 0xFF ; 255 21bb0: 89 81 ldd r24, Y+1 ; 0x01 21bb2: 9a 81 ldd r25, Y+2 ; 0x02 21bb4: 02 96 adiw r24, 0x02 ; 2 21bb6: 9a 83 std Y+2, r25 ; 0x02 21bb8: 89 83 std Y+1, r24 ; 0x01 21bba: 1a 30 cpi r17, 0x0A ; 10 21bbc: 89 f7 brne .-30 ; 0x21ba0 21bbe: ac ce rjmp .-680 ; 0x21918 } } 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)); 21bc0: 20 e0 ldi r18, 0x00 ; 0 21bc2: 30 e0 ldi r19, 0x00 ; 0 21bc4: 40 e8 ldi r20, 0x80 ; 128 21bc6: 50 e4 ldi r21, 0x40 ; 64 21bc8: c7 01 movw r24, r14 21bca: b6 01 movw r22, r12 21bcc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 21bd0: 20 e0 ldi r18, 0x00 ; 0 21bd2: 30 e0 ldi r19, 0x00 ; 0 21bd4: 40 e7 ldi r20, 0x70 ; 112 21bd6: 52 e4 ldi r21, 0x42 ; 66 21bd8: 0f 94 11 86 call 0x30c22 ; 0x30c22 21bdc: 9f 93 push r25 21bde: 8f 93 push r24 21be0: 7f 93 push r23 21be2: 6f 93 push r22 21be4: 1f 92 push r1 21be6: 8c e3 ldi r24, 0x3C ; 60 21be8: 8f 93 push r24 21bea: 2a e8 ldi r18, 0x8A ; 138 21bec: 3d e8 ldi r19, 0x8D ; 141 21bee: 3f 93 push r19 21bf0: 2f 93 push r18 21bf2: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 21bf6: 20 e0 ldi r18, 0x00 ; 0 21bf8: 30 e0 ldi r19, 0x00 ; 0 21bfa: 40 e0 ldi r20, 0x00 ; 0 21bfc: 51 e4 ldi r21, 0x41 ; 65 21bfe: c7 01 movw r24, r14 21c00: b6 01 movw r22, r12 21c02: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 21c06: 20 e0 ldi r18, 0x00 ; 0 21c08: 30 e0 ldi r19, 0x00 ; 0 21c0a: 40 e2 ldi r20, 0x20 ; 32 21c0c: 52 e4 ldi r21, 0x42 ; 66 21c0e: 0f 94 11 86 call 0x30c22 ; 0x30c22 21c12: 9f 93 push r25 21c14: 8f 93 push r24 21c16: 7f 93 push r23 21c18: 6f 93 push r22 21c1a: 1f 92 push r1 21c1c: 84 e6 ldi r24, 0x64 ; 100 21c1e: 8f 93 push r24 21c20: 2a e8 ldi r18, 0x8A ; 138 21c22: 3d e8 ldi r19, 0x8D ; 141 21c24: 3f 93 push r19 21c26: 2f 93 push r18 21c28: 0e 94 72 8a call 0x114e4 ; 0x114e4 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)); 21c2c: 0f b6 in r0, 0x3f ; 63 21c2e: f8 94 cli 21c30: de bf out 0x3e, r29 ; 62 21c32: 0f be out 0x3f, r0 ; 63 21c34: cd bf out 0x3d, r28 ; 61 21c36: 70 ce rjmp .-800 ; 0x21918 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]))); 21c38: 67 e0 ldi r22, 0x07 ; 7 21c3a: 8c e7 ldi r24, 0x7C ; 124 21c3c: 9d e8 ldi r25, 0x8D ; 141 21c3e: 35 ce rjmp .-918 ; 0x218aa } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 21c40: 61 e0 ldi r22, 0x01 ; 1 21c42: 80 e7 ldi r24, 0x70 ; 112 21c44: 9d e8 ldi r25, 0x8D ; 141 21c46: 0e 94 dc 89 call 0x113b8 ; 0x113b8 static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 21c4a: 8e e3 ldi r24, 0x3E ; 62 21c4c: 8f 93 push r24 21c4e: 8c e4 ldi r24, 0x4C ; 76 21c50: 8f 93 push r24 21c52: 8c ec ldi r24, 0xCC ; 204 21c54: 8f 93 push r24 21c56: 8d ec ldi r24, 0xCD ; 205 21c58: 8f 93 push r24 21c5a: 80 e6 ldi r24, 0x60 ; 96 21c5c: 9d e8 ldi r25, 0x8D ; 141 21c5e: 9f 93 push r25 21c60: 8f 93 push r24 21c62: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommand_P(PSTR("G1 F1080")); 21c66: 61 e0 ldi r22, 0x01 ; 1 21c68: 87 e5 ldi r24, 0x57 ; 87 21c6a: 9d e8 ldi r25, 0x8D ; 141 21c6c: 0e 94 dc 89 call 0x113b8 ; 0x113b8 enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 21c70: 20 e0 ldi r18, 0x00 ; 0 21c72: 30 e0 ldi r19, 0x00 ; 0 21c74: 40 e8 ldi r20, 0x80 ; 128 21c76: 50 e4 ldi r21, 0x40 ; 64 21c78: c7 01 movw r24, r14 21c7a: b6 01 movw r22, r12 21c7c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 21c80: 20 e0 ldi r18, 0x00 ; 0 21c82: 30 e0 ldi r19, 0x00 ; 0 21c84: 48 ec ldi r20, 0xC8 ; 200 21c86: 51 e4 ldi r21, 0x41 ; 65 21c88: 0f 94 11 86 call 0x30c22 ; 0x30c22 21c8c: 9f 93 push r25 21c8e: 8f 93 push r24 21c90: 7f 93 push r23 21c92: 6f 93 push r22 21c94: 1f 92 push r1 21c96: 1b e9 ldi r17, 0x9B ; 155 21c98: 1f 93 push r17 21c9a: 1f 92 push r1 21c9c: 8b e4 ldi r24, 0x4B ; 75 21c9e: 8f 93 push r24 21ca0: 85 e4 ldi r24, 0x45 ; 69 21ca2: 9d e8 ldi r25, 0x8D ; 141 21ca4: 9f 93 push r25 21ca6: 8f 93 push r24 21ca8: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 21cac: a7 01 movw r20, r14 21cae: 96 01 movw r18, r12 21cb0: c7 01 movw r24, r14 21cb2: b6 01 movw r22, r12 21cb4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 21cb8: 20 e0 ldi r18, 0x00 ; 0 21cba: 30 e0 ldi r19, 0x00 ; 0 21cbc: 48 ec ldi r20, 0xC8 ; 200 21cbe: 51 e4 ldi r21, 0x41 ; 65 21cc0: 0f 94 11 86 call 0x30c22 ; 0x30c22 21cc4: 9f 93 push r25 21cc6: 8f 93 push r24 21cc8: 7f 93 push r23 21cca: 6f 93 push r22 21ccc: 1f 92 push r1 21cce: 1f 93 push r17 21cd0: 1f 92 push r1 21cd2: 84 e6 ldi r24, 0x64 ; 100 21cd4: 8f 93 push r24 21cd6: 85 e4 ldi r24, 0x45 ; 69 21cd8: 9d e8 ldi r25, 0x8D ; 141 21cda: 9f 93 push r25 21cdc: 8f 93 push r24 21cde: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 21ce2: 20 e0 ldi r18, 0x00 ; 0 21ce4: 30 e0 ldi r19, 0x00 ; 0 21ce6: 48 ec ldi r20, 0xC8 ; 200 21ce8: 52 e4 ldi r21, 0x42 ; 66 21cea: c7 01 movw r24, r14 21cec: b6 01 movw r22, r12 21cee: 0f 94 11 86 call 0x30c22 ; 0x30c22 21cf2: 9f 93 push r25 21cf4: 8f 93 push r24 21cf6: 7f 93 push r23 21cf8: 6f 93 push r22 21cfa: 1f 92 push r1 21cfc: 1f 93 push r17 21cfe: 1f 92 push r1 21d00: 18 ec ldi r17, 0xC8 ; 200 21d02: 1f 93 push r17 21d04: 85 e4 ldi r24, 0x45 ; 69 21d06: 9d e8 ldi r25, 0x8D ; 141 21d08: 9f 93 push r25 21d0a: 8f 93 push r24 21d0c: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 21d10: 0f b6 in r0, 0x3f ; 63 21d12: f8 94 cli 21d14: de bf out 0x3e, r29 ; 62 21d16: 0f be out 0x3f, r0 ; 63 21d18: cd bf out 0x3d, r28 ; 61 21d1a: 20 e0 ldi r18, 0x00 ; 0 21d1c: 30 e0 ldi r19, 0x00 ; 0 21d1e: 40 ea ldi r20, 0xA0 ; 160 21d20: 51 e4 ldi r21, 0x41 ; 65 21d22: c7 01 movw r24, r14 21d24: b6 01 movw r22, r12 21d26: 0f 94 11 86 call 0x30c22 ; 0x30c22 21d2a: 9f 93 push r25 21d2c: 8f 93 push r24 21d2e: 7f 93 push r23 21d30: 6f 93 push r22 21d32: 1f 92 push r1 21d34: 87 e8 ldi r24, 0x87 ; 135 21d36: 8f 93 push r24 21d38: 1f 92 push r1 21d3a: 1f 93 push r17 21d3c: 25 e4 ldi r18, 0x45 ; 69 21d3e: 3d e8 ldi r19, 0x8D ; 141 21d40: 3f 93 push r19 21d42: 2f 93 push r18 21d44: 0e 94 72 8a call 0x114e4 ; 0x114e4 21d48: 71 cf rjmp .-286 ; 0x21c2c //! @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); 21d4a: 20 e0 ldi r18, 0x00 ; 0 21d4c: 30 e0 ldi r19, 0x00 ; 0 21d4e: 46 e1 ldi r20, 0x16 ; 22 21d50: 53 e4 ldi r21, 0x43 ; 67 21d52: c7 01 movw r24, r14 21d54: b6 01 movw r22, r12 21d56: 0f 94 11 86 call 0x30c22 ; 0x30c22 21d5a: 56 2e mov r5, r22 21d5c: 47 2e mov r4, r23 21d5e: 38 2e mov r3, r24 21d60: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 21d62: 20 e0 ldi r18, 0x00 ; 0 21d64: 30 e0 ldi r19, 0x00 ; 0 21d66: 40 ea ldi r20, 0xA0 ; 160 21d68: 51 e4 ldi r21, 0x41 ; 65 21d6a: c7 01 movw r24, r14 21d6c: b6 01 movw r22, r12 21d6e: 0f 94 11 86 call 0x30c22 ; 0x30c22 21d72: 6b 83 std Y+3, r22 ; 0x03 21d74: c7 2e mov r12, r23 21d76: 78 2e mov r7, r24 21d78: 69 2e mov r6, r25 21d7a: 85 e0 ldi r24, 0x05 ; 5 21d7c: 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; 21d7e: 81 2c mov r8, r1 21d80: 91 2c mov r9, r1 21d82: 96 e1 ldi r25, 0x16 ; 22 21d84: a9 2e mov r10, r25 21d86: 93 e4 ldi r25, 0x43 ; 67 21d88: 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; 21d8a: 32 e3 ldi r19, 0x32 ; 50 21d8c: 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; 21d8e: 87 e8 ldi r24, 0x87 ; 135 21d90: 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); 21d92: 05 e4 ldi r16, 0x45 ; 69 21d94: 1d e8 ldi r17, 0x8D ; 141 21d96: 9d 81 ldd r25, Y+5 ; 0x05 21d98: e9 2e mov r14, r25 21d9a: f1 2c mov r15, r1 21d9c: 3c 81 ldd r19, Y+4 ; 0x04 21d9e: 23 2f mov r18, r19 21da0: 30 e0 ldi r19, 0x00 ; 0 21da2: 3a 83 std Y+2, r19 ; 0x02 21da4: 29 83 std Y+1, r18 ; 0x01 21da6: 2f 92 push r2 21da8: 3f 92 push r3 21daa: 4f 92 push r4 21dac: 5f 92 push r5 21dae: 1f 92 push r1 21db0: 9f 93 push r25 21db2: 1f 92 push r1 21db4: 8c 81 ldd r24, Y+4 ; 0x04 21db6: 8f 93 push r24 21db8: 1f 93 push r17 21dba: 0f 93 push r16 21dbc: 0e 94 72 8a call 0x114e4 ; 0x114e4 y_pos -= short_length; 21dc0: b7 01 movw r22, r14 21dc2: ff 0c add r15, r15 21dc4: 88 0b sbc r24, r24 21dc6: 99 0b sbc r25, r25 21dc8: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 21dcc: 20 e0 ldi r18, 0x00 ; 0 21dce: 30 e0 ldi r19, 0x00 ; 0 21dd0: 40 ea ldi r20, 0xA0 ; 160 21dd2: 51 e4 ldi r21, 0x41 ; 65 21dd4: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 21dd8: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 21ddc: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 21dde: 6f 92 push r6 21de0: 7f 92 push r7 21de2: cf 92 push r12 21de4: 9b 81 ldd r25, Y+3 ; 0x03 21de6: 9f 93 push r25 21de8: 1f 92 push r1 21dea: 2d 81 ldd r18, Y+5 ; 0x05 21dec: 2f 93 push r18 21dee: 1f 92 push r1 21df0: 3c 81 ldd r19, Y+4 ; 0x04 21df2: 3f 93 push r19 21df4: 1f 93 push r17 21df6: 0f 93 push r16 21df8: 0e 94 72 8a call 0x114e4 ; 0x114e4 x_pos += long_length; 21dfc: 29 81 ldd r18, Y+1 ; 0x01 21dfe: 3a 81 ldd r19, Y+2 ; 0x02 21e00: b9 01 movw r22, r18 21e02: 33 0f add r19, r19 21e04: 88 0b sbc r24, r24 21e06: 99 0b sbc r25, r25 21e08: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 21e0c: a5 01 movw r20, r10 21e0e: 94 01 movw r18, r8 21e10: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 21e14: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 21e18: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 21e1a: b7 fa bst r11, 7 21e1c: b0 94 com r11 21e1e: b7 f8 bld r11, 7 21e20: b0 94 com r11 21e22: 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) 21e24: 0f b6 in r0, 0x3f ; 63 21e26: f8 94 cli 21e28: de bf out 0x3e, r29 ; 62 21e2a: 0f be out 0x3f, r0 ; 63 21e2c: cd bf out 0x3d, r28 ; 61 21e2e: d1 10 cpse r13, r1 21e30: b2 cf rjmp .-156 ; 0x21d96 21e32: 72 cd rjmp .-1308 ; 0x21918 break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 21e34: b7 01 movw r22, r14 21e36: a6 01 movw r20, r12 21e38: 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); 21e3a: 0f 94 38 86 call 0x30c70 ; 0x30c70 21e3e: 6c cd rjmp .-1320 ; 0x21918 break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 21e40: b7 01 movw r22, r14 21e42: a6 01 movw r20, r12 21e44: 84 e0 ldi r24, 0x04 ; 4 21e46: f9 cf rjmp .-14 ; 0x21e3a break; case 4: lay1cal_square(8, layer_height, extrusion_width); 21e48: b7 01 movw r22, r14 21e4a: a6 01 movw r20, r12 21e4c: 88 e0 ldi r24, 0x08 ; 8 21e4e: f5 cf rjmp .-22 ; 0x21e3a break; case 3: lay1cal_square(12, layer_height, extrusion_width); 21e50: b7 01 movw r22, r14 21e52: a6 01 movw r20, r12 21e54: 8c e0 ldi r24, 0x0C ; 12 21e56: f1 cf rjmp .-30 ; 0x21e3a 21e58: 90 91 95 13 lds r25, 0x1395 ; 0x801395 21e5c: 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]))); 21e5e: 66 e0 ldi r22, 0x06 ; 6 21e60: 89 e3 ldi r24, 0x39 ; 57 21e62: 9d e8 ldi r25, 0x8D ; 141 21e64: 0e 94 5b 8a call 0x114b6 ; 0x114b6 if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 21e68: 29 81 ldd r18, Y+1 ; 0x01 21e6a: 21 30 cpi r18, 0x01 ; 1 21e6c: 29 f4 brne .+10 ; 0x21e78 21e6e: 61 e0 ldi r22, 0x01 ; 1 21e70: 86 ef ldi r24, 0xF6 ; 246 21e72: 9c e6 ldi r25, 0x6C ; 108 21e74: 0e 94 dc 89 call 0x113b8 ; 0x113b8 enquecommand_P(MSG_M84);// disable motors 21e78: 61 e0 ldi r22, 0x01 ; 1 21e7a: 82 ef ldi r24, 0xF2 ; 242 21e7c: 9c e6 ldi r25, 0x6C ; 108 21e7e: 0e 94 dc 89 call 0x113b8 ; 0x113b8 21e82: 4a cd rjmp .-1388 ; 0x21918 break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 21e84: 81 e5 ldi r24, 0x51 ; 81 21e86: 91 e7 ldi r25, 0x71 ; 113 21e88: 0f 94 e0 0a call 0x215c0 ; 0x215c0 lcd_commands_step = 0; 21e8c: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 lcd_commands_type = LcdCommands::Idle; 21e90: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 21e94: 82 e0 ldi r24, 0x02 ; 2 21e96: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 21e9a: 8f e5 ldi r24, 0x5F ; 95 21e9c: 9f e0 ldi r25, 0x0F ; 15 21e9e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 21ea2: 88 23 and r24, r24 21ea4: 09 f4 brne .+2 ; 0x21ea8 21ea6: 11 ce rjmp .-990 ; 0x21aca lcd_wizard(WizState::RepeatLay1Cal); 21ea8: 8c e0 ldi r24, 0x0C ; 12 21eaa: 0f 94 90 64 call 0x2c920 ; 0x2c920 21eae: 34 cd rjmp .-1432 ; 0x21918 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."); 21eb0: 8f e1 ldi r24, 0x1F ; 31 21eb2: 9e e8 ldi r25, 0x8E ; 142 21eb4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 21eb8: e2 cd rjmp .-1084 ; 0x21a7e } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 21eba: 84 30 cpi r24, 0x04 ; 4 21ebc: a9 f0 breq .+42 ; 0x21ee8 21ebe: c0 f0 brcs .+48 ; 0x21ef0 21ec0: 85 30 cpi r24, 0x05 ; 5 21ec2: 09 f0 breq .+2 ; 0x21ec6 21ec4: 19 ce rjmp .-974 ; 0x21af8 case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 21ec6: 61 e0 ldi r22, 0x01 ; 1 21ec8: 8f ef ldi r24, 0xFF ; 255 21eca: 9c e6 ldi r25, 0x6C ; 108 21ecc: 0e 94 dc 89 call 0x113b8 ; 0x113b8 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 21ed0: 61 e0 ldi r22, 0x01 ; 1 21ed2: 89 e0 ldi r24, 0x09 ; 9 21ed4: 9e e8 ldi r25, 0x8E ; 142 21ed6: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_commands_step = 4; 21eda: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 21edc: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 21ee0: 0b ce rjmp .-1002 ; 0x21af8 if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 21ee2: 90 93 f4 03 sts 0x03F4, r25 ; 0x8003f4 21ee6: ef cf rjmp .-34 ; 0x21ec6 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 21ee8: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 lcd_commands_step = 3; 21eec: 83 e0 ldi r24, 0x03 ; 3 21eee: f6 cf rjmp .-20 ; 0x21edc SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 21ef0: 10 92 3d 02 sts 0x023D, r1 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.467> break; case 3: thermal_model_set_warn_beep(false); enquecommand_P(PSTR("M310 A F1")); 21ef4: 61 e0 ldi r22, 0x01 ; 1 21ef6: 8f ef ldi r24, 0xFF ; 255 21ef8: 9d e8 ldi r25, 0x8D ; 141 21efa: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_commands_step = 2; 21efe: 82 e0 ldi r24, 0x02 ; 2 21f00: ed cf rjmp .-38 ; 0x21edc break; case 2: if (thermal_model_autotune_result()) 21f02: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.554> 21f06: 81 11 cpse r24, r1 21f08: 05 c0 rjmp .+10 ; 0x21f14 enquecommand_P(MSG_M500); 21f0a: 61 e0 ldi r22, 0x01 ; 1 21f0c: 85 e0 ldi r24, 0x05 ; 5 21f0e: 9d e6 ldi r25, 0x6D ; 109 21f10: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_commands_step = 1; 21f14: 81 e0 ldi r24, 0x01 ; 1 21f16: e2 cf rjmp .-60 ; 0x21edc break; case 1: lcd_commands_step = 0; 21f18: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 lcd_commands_type = LcdCommands::Idle; 21f1c: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 21f20: 92 e0 ldi r25, 0x02 ; 2 21f22: 90 93 64 0e sts 0x0E64, r25 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 21f26: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.467> SetPrinterState(PrinterState::Idle); thermal_model_set_warn_beep(true); bool res = thermal_model_autotune_result(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 21f2a: 8f e5 ldi r24, 0x5F ; 95 21f2c: 9f e0 ldi r25, 0x0F ; 15 21f2e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 21f32: 88 23 and r24, r24 21f34: 09 f4 brne .+2 ; 0x21f38 21f36: 01 ce rjmp .-1022 ; 0x21b3a // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 21f38: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.554> 21f3c: 81 11 cpse r24, r1 21f3e: 04 c0 rjmp .+8 ; 0x21f48 21f40: 81 e0 ldi r24, 0x01 ; 1 21f42: 0f 94 90 64 call 0x2c920 ; 0x2c920 21f46: d8 cd rjmp .-1104 ; 0x21af8 21f48: 8e e0 ldi r24, 0x0E ; 14 21f4a: fb cf rjmp .-10 ; 0x21f42 #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 21f4c: 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; 21f4e: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 21f52: f3 cd rjmp .-1050 ; 0x21b3a case 0: lcd_commands_step = 3; break; case 3: #ifndef QUICK_NOZZLE_CHANGE lcd_show_fullscreen_message_and_wait_P(_T(MSG_NOZZLE_CNG_READ_HELP)); 21f54: 86 ec ldi r24, 0xC6 ; 198 21f56: 90 e4 ldi r25, 0x40 ; 64 21f58: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 21f5c: 0f 94 d6 34 call 0x269ac ; 0x269ac enquecommand_P(G28W); 21f60: 61 e0 ldi r22, 0x01 ; 1 21f62: 8f ef ldi r24, 0xFF ; 255 21f64: 9c e6 ldi r25, 0x6C ; 108 21f66: 0e 94 dc 89 call 0x113b8 ; 0x113b8 enquecommand_P(PSTR("G1 X125 Z200 F1000")); 21f6a: 61 e0 ldi r22, 0x01 ; 1 21f6c: 8c ee ldi r24, 0xEC ; 236 21f6e: 9d e8 ldi r25, 0x8D ; 141 21f70: 0e 94 dc 89 call 0x113b8 ; 0x113b8 enquecommand_P(PSTR("M109 S280")); 21f74: 61 e0 ldi r22, 0x01 ; 1 21f76: 82 ee ldi r24, 0xE2 ; 226 21f78: 9d e8 ldi r25, 0x8D ; 141 21f7a: 0e 94 dc 89 call 0x113b8 ; 0x113b8 #ifdef THERMAL_MODEL was_enabled = thermal_model_enabled(); 21f7e: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> 21f82: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 thermal_model_set_enabled(false); 21f86: 80 e0 ldi r24, 0x00 ; 0 21f88: 0f 94 47 47 call 0x28e8e ; 0x28e8e } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 21f8c: 82 e0 ldi r24, 0x02 ; 2 21f8e: df cf rjmp .-66 ; 0x21f4e break; case 2: enquecommand_P(PSTR("M84 XY")); 21f90: 61 e0 ldi r22, 0x01 ; 1 21f92: 8b ed ldi r24, 0xDB ; 219 21f94: 9d e8 ldi r25, 0x8D ; 141 21f96: 0e 94 dc 89 call 0x113b8 ; 0x113b8 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 21f9a: 8d e8 ldi r24, 0x8D ; 141 21f9c: 90 e4 ldi r25, 0x40 ; 64 21f9e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 21fa2: 41 e0 ldi r20, 0x01 ; 1 21fa4: 60 e0 ldi r22, 0x00 ; 0 21fa6: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce 21faa: 81 11 cpse r24, r1 21fac: c6 cd rjmp .-1140 ; 0x21b3a 21fae: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 21fb2: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a #ifndef QUICK_NOZZLE_CHANGE setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); 21fb6: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 21fba: 0f 94 47 47 call 0x28e8e ; 0x28e8e #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 21fbe: 81 e0 ldi r24, 0x01 ; 1 21fc0: c6 cf rjmp .-116 ; 0x21f4e } break; case 1: lcd_commands_step = 0; 21fc2: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 lcd_commands_type = LcdCommands::Idle; 21fc6: 10 92 62 0e sts 0x0E62, r1 ; 0x800e62 21fca: 82 e0 ldi r24, 0x02 ; 2 21fcc: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 21fd0: 20 e0 ldi r18, 0x00 ; 0 21fd2: 41 e0 ldi r20, 0x01 ; 1 21fd4: 62 e0 ldi r22, 0x02 ; 2 21fd6: 70 e0 ldi r23, 0x00 ; 0 21fd8: 82 eb ldi r24, 0xB2 ; 178 21fda: 9a e3 ldi r25, 0x3A ; 58 21fdc: 0f 94 b8 ce call 0x39d70 ; 0x39d70 menu_depth = 3; 21fe0: 83 e0 ldi r24, 0x03 ; 3 21fe2: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 21fe6: a9 cd rjmp .-1198 ; 0x21b3a 00021fe8 : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 21fe8: 0f 93 push r16 21fea: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 21fec: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 21ff0: 80 95 com r24 21ff2: 81 70 andi r24, 0x01 ; 1 21ff4: 90 91 0b 04 lds r25, 0x040B ; 0x80040b 21ff8: 89 17 cp r24, r25 21ffa: a1 f1 breq .+104 ; 0x22064 { if(menu_menu == lcd_sdcard_menu) { 21ffc: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 22000: 90 91 67 0e lds r25, 0x0E67 ; 0x800e67 22004: 8c 5f subi r24, 0xFC ; 252 22006: 99 43 sbci r25, 0x39 ; 57 22008: 11 f4 brne .+4 ; 0x2200e // 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(); 2200a: 0f 94 56 d1 call 0x3a2ac ; 0x3a2ac } lcd_draw_update = 2; 2200e: 82 e0 ldi r24, 0x02 ; 2 22010: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 22014: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22018: 80 95 com r24 2201a: 81 70 andi r24, 0x01 ; 1 2201c: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 22020: 0e 94 d2 70 call 0xe1a4 ; 0xe1a4 backlight_wake(); 22024: 80 e0 ldi r24, 0x00 ; 0 22026: 0e 94 29 8c call 0x11852 ; 0x11852 if (lcd_oldcardstatus) 2202a: 80 91 0b 04 lds r24, 0x040B ; 0x80040b 2202e: 88 23 and r24, r24 22030: 09 f4 brne .+2 ; 0x22034 22032: 71 c0 rjmp .+226 ; 0x22116 { if (!card.mounted) 22034: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 22038: 81 11 cpse r24, r1 2203a: 05 c0 rjmp .+10 ; 0x22046 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 2203c: 0f 94 f3 7f call 0x2ffe6 ; 0x2ffe6 card.presort_flag = true; //force sorting of the SD menu 22040: 81 e0 ldi r24, 0x01 ; 1 22042: 80 93 ba 14 sts 0x14BA, r24 ; 0x8014ba } LCD_MESSAGERPGM(MSG_WELCOME); 22046: 81 e5 ldi r24, 0x51 ; 81 22048: 91 e7 ldi r25, 0x71 ; 113 2204a: 0f 94 e0 0a call 0x215c0 ; 0x215c0 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 2204e: 10 92 d9 03 sts 0x03D9, r1 ; 0x8003d9 menu_submenu(lcd_sdcard_menu, true); 22052: 61 e0 ldi r22, 0x01 ; 1 22054: 8c ef ldi r24, 0xFC ; 252 22056: 99 e3 ldi r25, 0x39 ; 57 22058: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 lcd_timeoutToStatus.start(); 2205c: 84 ed ldi r24, 0xD4 ; 212 2205e: 93 e0 ldi r25, 0x03 ; 3 22060: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 22064: 0f 94 55 3e call 0x27caa ; 0x27caa 22068: 00 91 d0 03 lds r16, 0x03D0 ; 0x8003d0 2206c: 10 91 d1 03 lds r17, 0x03D1 ; 0x8003d1 22070: 20 91 d2 03 lds r18, 0x03D2 ; 0x8003d2 22074: 30 91 d3 03 lds r19, 0x03D3 ; 0x8003d3 22078: 06 17 cp r16, r22 2207a: 17 07 cpc r17, r23 2207c: 28 07 cpc r18, r24 2207e: 39 07 cpc r19, r25 22080: e8 f5 brcc .+122 ; 0x220fc { if (lcd_draw_update) { 22082: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22086: 88 23 and r24, r24 22088: 31 f0 breq .+12 ; 0x22096 lcd_timeoutToStatus.start(); 2208a: 84 ed ldi r24, 0xD4 ; 212 2208c: 93 e0 ldi r25, 0x03 ; 3 2208e: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> lcd_frame_start(); 22092: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 } (*menu_menu)(); 22096: e0 91 66 0e lds r30, 0x0E66 ; 0x800e66 2209a: f0 91 67 0e lds r31, 0x0E67 ; 0x800e67 2209e: 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)))); 220a0: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 220a4: 90 91 67 0e lds r25, 0x0E67 ; 0x800e67 220a8: 8c 5c subi r24, 0xCC ; 204 220aa: 9a 43 sbci r25, 0x3A ; 58 220ac: 09 f4 brne .+2 ; 0x220b0 220ae: 46 c0 rjmp .+140 ; 0x2213c } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 220b0: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 220b4: 90 91 67 0e lds r25, 0x0E67 ; 0x800e67 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 220b8: 2b e3 ldi r18, 0x3B ; 59 220ba: 82 3b cpi r24, 0xB2 ; 178 220bc: 92 07 cpc r25, r18 220be: 09 f0 breq .+2 ; 0x220c2 220c0: 5e c0 rjmp .+188 ; 0x2217e } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 220c2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 220c6: 82 30 cpi r24, 0x02 ; 2 220c8: 21 f4 brne .+8 ; 0x220d2 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 220ca: 0e 94 d2 70 call 0xe1a4 ; 0xe1a4 lcd_status_message_idx = 0; // Re-draw message from beginning 220ce: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.461> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 220d2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 220d6: 88 23 and r24, r24 220d8: 19 f0 breq .+6 ; 0x220e0 220da: 81 50 subi r24, 0x01 ; 1 220dc: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 220e0: 0f 94 55 3e call 0x27caa ; 0x27caa 220e4: 6c 59 subi r22, 0x9C ; 156 220e6: 7f 4f sbci r23, 0xFF ; 255 220e8: 8f 4f sbci r24, 0xFF ; 255 220ea: 9f 4f sbci r25, 0xFF ; 255 220ec: 60 93 d0 03 sts 0x03D0, r22 ; 0x8003d0 220f0: 70 93 d1 03 sts 0x03D1, r23 ; 0x8003d1 220f4: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 220f8: 90 93 d3 03 sts 0x03D3, r25 ; 0x8003d3 } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 220fc: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 22100: 84 30 cpi r24, 0x04 ; 4 22102: 09 f0 breq .+2 ; 0x22106 22104: 53 c0 rjmp .+166 ; 0x221ac 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) { 22106: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 2210a: 81 11 cpse r24, r1 2210c: 4f c0 rjmp .+158 ; 0x221ac 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(); } 2210e: 1f 91 pop r17 22110: 0f 91 pop r16 22112: 0d 94 f1 0a jmp 0x215e2 ; 0x215e2 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 22116: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b mounted = false; 2211a: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c SERIAL_ECHO_START; 2211e: 84 e1 ldi r24, 0x14 ; 20 22120: 9b ea ldi r25, 0xAB ; 171 22122: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 22126: 87 ea ldi r24, 0xA7 ; 167 22128: 9c e6 ldi r25, 0x6C ; 108 2212a: 0e 94 97 7b call 0xf72e ; 0xf72e lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 2212e: 80 e6 ldi r24, 0x60 ; 96 22130: 90 e4 ldi r25, 0x40 ; 64 22132: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 22136: 0f 94 e0 0a call 0x215c0 ; 0x215c0 2213a: 94 cf rjmp .-216 ; 0x22064 // 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)))); 2213c: 0e 94 e5 68 call 0xd1ca ; 0xd1ca 22140: 81 11 cpse r24, r1 22142: 0e c0 rjmp .+28 ; 0x22160 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) 22144: e0 91 66 0e lds r30, 0x0E66 ; 0x800e66 22148: f0 91 67 0e lds r31, 0x0E67 ; 0x800e67 2214c: 30 97 sbiw r30, 0x00 ; 0 2214e: 39 f5 brne .+78 ; 0x2219e { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 22150: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_return_to_status(); 22154: 0f 94 1d 26 call 0x24c3a ; 0x24c3a lcd_draw_update = 2; 22158: 82 e0 ldi r24, 0x02 ; 2 2215a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 2215e: b1 cf rjmp .-158 ; 0x220c2 // 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)))); 22160: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 22164: 81 11 cpse r24, r1 22166: a4 cf rjmp .-184 ; 0x220b0 22168: 40 e9 ldi r20, 0x90 ; 144 2216a: 5f e5 ldi r21, 0x5F ; 95 2216c: 61 e0 ldi r22, 0x01 ; 1 2216e: 70 e0 ldi r23, 0x00 ; 0 22170: 84 ed ldi r24, 0xD4 ; 212 22172: 93 e0 ldi r25, 0x03 ; 3 22174: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 22178: 81 11 cpse r24, r1 2217a: e4 cf rjmp .-56 ; 0x22144 2217c: 99 cf rjmp .-206 ; 0x220b0 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 2217e: 8c 5c subi r24, 0xCC ; 204 22180: 9a 43 sbci r25, 0x3A ; 58 22182: 09 f4 brne .+2 ; 0x22186 22184: 9e cf rjmp .-196 ; 0x220c2 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 22186: 40 e3 ldi r20, 0x30 ; 48 22188: 55 e7 ldi r21, 0x75 ; 117 2218a: 60 e0 ldi r22, 0x00 ; 0 2218c: 70 e0 ldi r23, 0x00 ; 0 2218e: 84 ed ldi r24, 0xD4 ; 212 22190: 93 e0 ldi r25, 0x03 ; 3 22192: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 22196: 88 23 and r24, r24 22198: 09 f4 brne .+2 ; 0x2219c 2219a: 93 cf rjmp .-218 ; 0x220c2 2219c: d3 cf rjmp .-90 ; 0x22144 // 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; 2219e: 81 e0 ldi r24, 0x01 ; 1 221a0: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf (*menu_menu)(); 221a4: 19 95 eicall menu_leaving = 0; 221a6: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf 221aa: d2 cf rjmp .-92 ; 0x22150 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(); } 221ac: 1f 91 pop r17 221ae: 0f 91 pop r16 221b0: 08 95 ret 000221b2 : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 221b2: 2f 92 push r2 221b4: 3f 92 push r3 221b6: 4f 92 push r4 221b8: 5f 92 push r5 221ba: 6f 92 push r6 221bc: 7f 92 push r7 221be: 8f 92 push r8 221c0: 9f 92 push r9 221c2: af 92 push r10 221c4: bf 92 push r11 221c6: cf 92 push r12 221c8: df 92 push r13 221ca: ef 92 push r14 221cc: ff 92 push r15 221ce: 0f 93 push r16 221d0: 1f 93 push r17 221d2: cf 93 push r28 221d4: df 93 push r29 221d6: cd b7 in r28, 0x3d ; 61 221d8: de b7 in r29, 0x3e ; 62 221da: 2d 97 sbiw r28, 0x0d ; 13 221dc: 0f b6 in r0, 0x3f ; 63 221de: f8 94 cli 221e0: de bf out 0x3e, r29 ; 62 221e2: 0f be out 0x3f, r0 ; 63 221e4: 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) 221e6: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 221ea: 81 30 cpi r24, 0x01 ; 1 221ec: 31 f1 breq .+76 ; 0x2223a 221ee: 30 f0 brcs .+12 ; 0x221fc 221f0: 82 30 cpi r24, 0x02 ; 2 221f2: 09 f4 brne .+2 ; 0x221f6 221f4: 7d c2 rjmp .+1274 ; 0x226f0 { _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. 221f6: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 221fa: fe c0 rjmp .+508 ; 0x223f8 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 221fc: 80 91 ba 14 lds r24, 0x14BA ; 0x8014ba 22200: 88 23 and r24, r24 22202: 49 f0 breq .+18 ; 0x22216 { card.presort_flag = false; 22204: 10 92 ba 14 sts 0x14BA, r1 ; 0x8014ba lcd_update_enabled = false; 22208: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 2220c: 0f 94 c3 7b call 0x2f786 ; 0x2f786 lcd_update_enabled = true; 22210: 81 e0 ldi r24, 0x01 ; 1 22212: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 22216: 0f 94 73 7a call 0x2f4e6 ; 0x2f4e6 2221a: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 2221e: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 22222: 89 e0 ldi r24, 0x09 ; 9 22224: 9f e0 ldi r25, 0x0F ; 15 22226: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2222a: 80 93 af 03 sts 0x03AF, r24 ; 0x8003af _md->menuState = _standard; 2222e: 81 e0 ldi r24, 0x01 ; 1 22230: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 _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. 22234: 8f ef ldi r24, 0xFF ; 255 22236: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae } // 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. 2223a: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 2223e: 81 11 cpse r24, r1 22240: 07 c0 rjmp .+14 ; 0x22250 { _md->lcd_scrollTimer.start(); 22242: 80 eb ldi r24, 0xB0 ; 176 22244: 93 e0 ldi r25, 0x03 ; 3 22246: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> lcd_draw_update = 1; 2224a: 81 e0 ldi r24, 0x01 ; 1 2224c: 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. 22250: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22254: 81 11 cpse r24, r1 22256: 21 c0 rjmp .+66 ; 0x2229a 22258: 64 ef ldi r22, 0xF4 ; 244 2225a: 71 e0 ldi r23, 0x01 ; 1 2225c: 80 eb ldi r24, 0xB0 ; 176 2225e: 93 e0 ldi r25, 0x03 ; 3 22260: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 22264: 88 23 and r24, r24 22266: a1 f0 breq .+40 ; 0x22290 22268: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 2226c: 8f 3f cpi r24, 0xFF ; 255 2226e: 81 f0 breq .+32 ; 0x22290 { _md->menuState = _scrolling; 22270: 82 e0 ldi r24, 0x02 ; 2 22272: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 _md->offset = 0; 22276: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 _md->scrollPointer = NULL; 2227a: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 2227e: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 _md->lcd_scrollTimer.start(); 22282: 80 eb ldi r24, 0xB0 ; 176 22284: 93 e0 ldi r25, 0x03 ; 3 22286: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 2228a: 81 e0 ldi r24, 0x01 ; 1 2228c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 22290: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22294: 88 23 and r24, r24 22296: 09 f4 brne .+2 ; 0x2229a 22298: ab c0 rjmp .+342 ; 0x223f0 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. 2229a: 8f ef ldi r24, 0xFF ; 255 2229c: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae //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(); 222a0: 80 eb ldi r24, 0xB0 ; 176 222a2: 93 e0 ldi r25, 0x03 ; 3 222a4: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> MENU_BEGIN(); 222a8: 0f 94 8e ce call 0x39d1c ; 0x39d1c 222ac: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if(eFilamentAction != FilamentAction::None) return; // Create a copy of card.filename on the stack since card.filename pointer // will be modified by the SD card library when searching for the file char selected_filename[FILENAME_LENGTH]; strcpy(selected_filename, filename); 222b0: ce 01 movw r24, r28 222b2: 01 96 adiw r24, 0x01 ; 1 222b4: 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); 222b6: f1 ed ldi r31, 0xD1 ; 209 222b8: 2f 2e mov r2, r31 222ba: f1 e7 ldi r31, 0x71 ; 113 222bc: 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(); 222be: 80 91 12 05 lds r24, 0x0512 ; 0x800512 222c2: 84 30 cpi r24, 0x04 ; 4 222c4: 08 f0 brcs .+2 ; 0x222c8 222c6: 98 c0 rjmp .+304 ; 0x223f8 222c8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 222cc: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 222d0: 88 23 and r24, r24 222d2: 09 f4 brne .+2 ; 0x222d6 222d4: aa c0 rjmp .+340 ; 0x2242a 222d6: 8e e0 ldi r24, 0x0E ; 14 222d8: 9e e3 ldi r25, 0x3E ; 62 222da: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 222de: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 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;}; 222e2: 6d e6 ldi r22, 0x6D ; 109 222e4: 74 e1 ldi r23, 0x14 ; 20 222e6: 86 e1 ldi r24, 0x16 ; 22 222e8: 95 e1 ldi r25, 0x15 ; 21 222ea: 0f 94 15 a4 call 0x3482a ; 0x3482a card.getWorkDirName(); if (card.filename[0] == '/') 222ee: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 222f2: 8f 32 cpi r24, 0x2F ; 47 222f4: 09 f0 breq .+2 ; 0x222f8 222f6: 9c c0 rjmp .+312 ; 0x22430 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 222f8: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 222fc: 88 23 and r24, r24 222fe: 41 f0 breq .+16 ; 0x22310 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 22300: 83 e0 ldi r24, 0x03 ; 3 22302: 9e e3 ldi r25, 0x3E ; 62 22304: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 22308: 69 e9 ldi r22, 0x99 ; 153 2230a: 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. 2230c: 0f 94 0b ce call 0x39c16 ; 0x39c16 for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 22310: c0 90 ac 03 lds r12, 0x03AC ; 0x8003ac 22314: d0 90 ad 03 lds r13, 0x03AD ; 0x8003ad } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 22318: 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. 2231a: 91 e0 ldi r25, 0x01 ; 1 2231c: c9 1a sub r12, r25 2231e: d1 08 sbc r13, r1 22320: 08 f4 brcc .+2 ; 0x22324 22322: d9 c1 rjmp .+946 ; 0x226d6 { if (menu_item == menu_line) //If the file is on the screen. 22324: 80 91 15 05 lds r24, 0x0515 ; 0x800515 22328: 90 91 14 05 lds r25, 0x0514 ; 0x800514 2232c: 89 13 cpse r24, r25 2232e: cf c1 rjmp .+926 ; 0x226ce { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 22330: 60 91 af 03 lds r22, 0x03AF ; 0x8003af 22334: c6 01 movw r24, r12 22336: 0f 94 31 84 call 0x30862 ; 0x30862 #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 2233a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2233e: 90 e0 ldi r25, 0x00 ; 0 22340: 20 91 34 05 lds r18, 0x0534 ; 0x800534 22344: 30 91 35 05 lds r19, 0x0535 ; 0x800535 22348: 10 91 b7 14 lds r17, 0x14B7 ; 0x8014b7 2234c: 82 17 cp r24, r18 2234e: 93 07 cpc r25, r19 22350: 51 f4 brne .+20 ; 0x22366 { _md->selectedFileID = i; 22352: d0 92 ab 03 sts 0x03AB, r13 ; 0x8003ab 22356: c0 92 aa 03 sts 0x03AA, r12 ; 0x8003aa _md->isDir = card.filenameIsDir; 2235a: 10 93 a7 03 sts 0x03A7, r17 ; 0x8003a7 _md->row = menu_row; 2235e: 40 91 12 05 lds r20, 0x0512 ; 0x800512 22362: 40 93 ae 03 sts 0x03AE, r20 ; 0x8003ae 22366: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 2236a: 11 23 and r17, r17 2236c: 09 f4 brne .+2 ; 0x22370 2236e: 65 c0 rjmp .+202 ; 0x2243a #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) 22370: 44 23 and r20, r20 22372: e9 f0 breq .+58 ; 0x223ae { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 22374: 40 91 82 14 lds r20, 0x1482 ; 0x801482 22378: ed e6 ldi r30, 0x6D ; 109 2237a: ae 2e mov r10, r30 2237c: e4 e1 ldi r30, 0x14 ; 20 2237e: be 2e mov r11, r30 22380: 44 23 and r20, r20 22382: 21 f0 breq .+8 ; 0x2238c 22384: 72 e8 ldi r23, 0x82 ; 130 22386: a7 2e mov r10, r23 22388: 74 e1 ldi r23, 0x14 ; 20 2238a: b7 2e mov r11, r23 2238c: 60 91 12 05 lds r22, 0x0512 ; 0x800512 } static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 2; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 22390: 4e e3 ldi r20, 0x3E ; 62 22392: 82 17 cp r24, r18 22394: 93 07 cpc r25, r19 22396: 09 f0 breq .+2 ; 0x2239a 22398: 40 e2 ldi r20, 0x20 ; 32 2239a: 80 e0 ldi r24, 0x00 ; 0 2239c: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_putc(LCD_STR_FOLDER[0]); 223a0: 85 e8 ldi r24, 0x85 ; 133 223a2: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_print_pad(longFilename, len); 223a6: 62 e1 ldi r22, 0x12 ; 18 223a8: c5 01 movw r24, r10 223aa: 0e 94 15 72 call 0xe42a ; 0xe42a 223ae: 80 91 15 05 lds r24, 0x0515 ; 0x800515 { if (lcd_draw_update) { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 223b2: 90 91 13 05 lds r25, 0x0513 ; 0x800513 223b6: 99 23 and r25, r25 223b8: 09 f4 brne .+2 ; 0x223bc 223ba: 89 c1 rjmp .+786 ; 0x226ce 223bc: 20 91 34 05 lds r18, 0x0534 ; 0x800534 223c0: 30 91 35 05 lds r19, 0x0535 ; 0x800535 223c4: 82 17 cp r24, r18 223c6: 13 06 cpc r1, r19 223c8: 09 f0 breq .+2 ; 0x223cc 223ca: 81 c1 rjmp .+770 ; 0x226ce { lcd_update_enabled = false; 223cc: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 223d0: 61 e0 ldi r22, 0x01 ; 1 223d2: 8d e6 ldi r24, 0x6D ; 109 223d4: 94 e1 ldi r25, 0x14 ; 20 223d6: 0f 94 45 7d call 0x2fa8a ; 0x2fa8a lcd_encoder = 0; 223da: 10 92 35 05 sts 0x0535, r1 ; 0x800535 223de: 10 92 34 05 sts 0x0534, r1 ; 0x800534 menu_data_reset(); //Forces reloading of cached variables. 223e2: 0f 94 b0 ce call 0x39d60 ; 0x39d60 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 223e6: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 223ea: 0f 94 74 cd call 0x39ae8 ; 0x39ae8 223ee: 95 cf rjmp .-214 ; 0x2231a _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()) 223f0: 0e 94 43 72 call 0xe486 ; 0xe486 223f4: 81 11 cpse r24, r1 223f6: 51 cf rjmp .-350 ; 0x2229a _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 223f8: 2d 96 adiw r28, 0x0d ; 13 223fa: 0f b6 in r0, 0x3f ; 63 223fc: f8 94 cli 223fe: de bf out 0x3e, r29 ; 62 22400: 0f be out 0x3f, r0 ; 63 22402: cd bf out 0x3d, r28 ; 61 22404: df 91 pop r29 22406: cf 91 pop r28 22408: 1f 91 pop r17 2240a: 0f 91 pop r16 2240c: ff 90 pop r15 2240e: ef 90 pop r14 22410: df 90 pop r13 22412: cf 90 pop r12 22414: bf 90 pop r11 22416: af 90 pop r10 22418: 9f 90 pop r9 2241a: 8f 90 pop r8 2241c: 7f 90 pop r7 2241e: 6f 90 pop r6 22420: 5f 90 pop r5 22422: 4f 90 pop r4 22424: 3f 90 pop r3 22426: 2f 90 pop r2 22428: 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 2242a: 8f e6 ldi r24, 0x6F ; 111 2242c: 90 e4 ldi r25, 0x40 ; 64 2242e: 55 cf rjmp .-342 ; 0x222da 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. 22430: 63 ea ldi r22, 0xA3 ; 163 22432: 76 ed ldi r23, 0xD6 ; 214 22434: 89 e3 ldi r24, 0x39 ; 57 22436: 9c e8 ldi r25, 0x8C ; 140 22438: 69 cf rjmp .-302 ; 0x2230c menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 2243a: 44 23 and r20, r20 2243c: d1 f0 breq .+52 ; 0x22472 { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 2243e: 40 91 82 14 lds r20, 0x1482 ; 0x801482 22442: 6d e6 ldi r22, 0x6D ; 109 22444: a6 2e mov r10, r22 22446: 64 e1 ldi r22, 0x14 ; 20 22448: b6 2e mov r11, r22 2244a: 44 23 and r20, r20 2244c: 21 f0 breq .+8 ; 0x22456 2244e: 52 e8 ldi r21, 0x82 ; 130 22450: a5 2e mov r10, r21 22452: 54 e1 ldi r21, 0x14 ; 20 22454: b5 2e mov r11, r21 22456: 60 91 12 05 lds r22, 0x0512 ; 0x800512 bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 1; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 2245a: 4e e3 ldi r20, 0x3E ; 62 2245c: 82 17 cp r24, r18 2245e: 93 07 cpc r25, r19 22460: 09 f0 breq .+2 ; 0x22464 22462: 40 e2 ldi r20, 0x20 ; 32 22464: 80 e0 ldi r24, 0x00 ; 0 22466: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_print_pad(longFilename, len); 2246a: 63 e1 ldi r22, 0x13 ; 19 2246c: c5 01 movw r24, r10 2246e: 0e 94 15 72 call 0xe42a ; 0xe42a 22472: 80 91 15 05 lds r24, 0x0515 ; 0x800515 { if (lcd_draw_update) { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 22476: 90 91 13 05 lds r25, 0x0513 ; 0x800513 2247a: 99 23 and r25, r25 2247c: 09 f4 brne .+2 ; 0x22480 2247e: 27 c1 rjmp .+590 ; 0x226ce 22480: 20 91 34 05 lds r18, 0x0534 ; 0x800534 22484: 30 91 35 05 lds r19, 0x0535 ; 0x800535 22488: 82 17 cp r24, r18 2248a: 13 06 cpc r1, r19 2248c: 09 f0 breq .+2 ; 0x22490 2248e: 1f c1 rjmp .+574 ; 0x226ce { lcd_update_enabled = false; 22490: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 22494: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 22498: 81 11 cpse r24, r1 2249a: a5 cf rjmp .-182 ; 0x223e6 // 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); 2249c: 6d e6 ldi r22, 0x6D ; 109 2249e: 74 e1 ldi r23, 0x14 ; 20 224a0: c7 01 movw r24, r14 224a2: 0f 94 7a e3 call 0x3c6f4 ; 0x3c6f4 224a6: 47 01 movw r8, r14 224a8: 45 e9 ldi r20, 0x95 ; 149 224aa: a4 2e mov r10, r20 224ac: 4f e0 ldi r20, 0x0F ; 15 224ae: 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] == '.') { 224b0: f4 01 movw r30, r8 224b2: 61 91 ld r22, Z+ 224b4: 4f 01 movw r8, r30 224b6: 66 23 and r22, r22 224b8: 19 f0 breq .+6 ; 0x224c0 224ba: 6e 32 cpi r22, 0x2E ; 46 224bc: 09 f0 breq .+2 ; 0x224c0 224be: 4b c0 rjmp .+150 ; 0x22556 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 224c0: 60 e0 ldi r22, 0x00 ; 0 224c2: c5 01 movw r24, r10 224c4: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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, '.'); 224c8: 6e e2 ldi r22, 0x2E ; 46 224ca: 70 e0 ldi r23, 0x00 ; 0 224cc: c7 01 movw r24, r14 224ce: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc 224d2: 3c 01 movw r6, r24 if (extension_ptr) { 224d4: 89 2b or r24, r25 224d6: 19 f0 breq .+6 ; 0x224de extension_ptr++; // skip the '.' 224d8: 8f ef ldi r24, 0xFF ; 255 224da: 68 1a sub r6, r24 224dc: 78 0a sbc r7, r24 224de: 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); 224e0: 31 e9 ldi r19, 0x91 ; 145 224e2: a3 2e mov r10, r19 224e4: 3c e0 ldi r19, 0x0C ; 12 224e6: 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') { 224e8: 61 14 cp r6, r1 224ea: 71 04 cpc r7, r1 224ec: 21 f0 breq .+8 ; 0x224f6 224ee: f4 01 movw r30, r8 224f0: 60 81 ld r22, Z 224f2: 61 11 cpse r22, r1 224f4: 01 c0 rjmp .+2 ; 0x224f8 224f6: 60 e0 ldi r22, 0x00 ; 0 224f8: c5 01 movw r24, r10 224fa: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 224fe: ff ef ldi r31, 0xFF ; 255 22500: af 1a sub r10, r31 22502: bf 0a sbc r11, r31 22504: 2f ef ldi r18, 0xFF ; 255 22506: 82 1a sub r8, r18 22508: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 2250a: 84 e9 ldi r24, 0x94 ; 148 2250c: a8 16 cp r10, r24 2250e: 8c e0 ldi r24, 0x0C ; 12 22510: b8 06 cpc r11, r24 22512: 51 f7 brne .-44 ; 0x224e8 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 22514: 60 90 0b 16 lds r6, 0x160B ; 0x80160b 22518: 66 2d mov r22, r6 2251a: 8a e5 ldi r24, 0x5A ; 90 2251c: 9f e0 ldi r25, 0x0F ; 15 2251e: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 22522: 89 e6 ldi r24, 0x69 ; 105 22524: 94 e1 ldi r25, 0x14 ; 20 22526: 2a e0 ldi r18, 0x0A ; 10 22528: a2 2e mov r10, r18 2252a: 2f e0 ldi r18, 0x0F ; 15 2252c: 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++) { 2252e: 71 2c mov r7, r1 22530: 4c 01 movw r8, r24 22532: e9 e0 ldi r30, 0x09 ; 9 22534: 8e 0e add r8, r30 22536: 91 1c adc r9, r1 22538: 76 14 cp r7, r6 2253a: d1 f0 breq .+52 ; 0x22570 #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); 2253c: 48 e0 ldi r20, 0x08 ; 8 2253e: 50 e0 ldi r21, 0x00 ; 0 22540: b5 01 movw r22, r10 22542: 8e 5a subi r24, 0xAE ; 174 22544: 9f 4f sbci r25, 0xFF ; 255 22546: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 2254a: 73 94 inc r7 2254c: f8 e0 ldi r31, 0x08 ; 8 2254e: af 0e add r10, r31 22550: b1 1c adc r11, r1 22552: c4 01 movw r24, r8 22554: ed cf rjmp .-38 ; 0x22530 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 22556: c5 01 movw r24, r10 22558: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 2255c: ff ef ldi r31, 0xFF ; 255 2255e: af 1a sub r10, r31 22560: 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++) { 22562: 2d e9 ldi r18, 0x9D ; 157 22564: a2 16 cp r10, r18 22566: 2f e0 ldi r18, 0x0F ; 15 22568: b2 06 cpc r11, r18 2256a: 09 f0 breq .+2 ; 0x2256e 2256c: a1 cf rjmp .-190 ; 0x224b0 2256e: ac cf rjmp .-168 ; 0x224c8 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 22570: 61 e0 ldi r22, 0x01 ; 1 22572: c7 01 movw r24, r14 22574: 0f 94 7c 7e call 0x2fcf8 ; 0x2fcf8 } uint32_t CardReader::getFileSize() { return filesize; 22578: 40 90 78 17 lds r4, 0x1778 ; 0x801778 2257c: 50 90 79 17 lds r5, 0x1779 ; 0x801779 22580: 60 90 7a 17 lds r6, 0x177A ; 0x80177a 22584: 70 90 7b 17 lds r7, 0x177B ; 0x80177b bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 22588: 94 2d mov r25, r4 2258a: 85 2d mov r24, r5 2258c: 21 e0 ldi r18, 0x01 ; 1 2258e: 42 16 cp r4, r18 22590: 28 e7 ldi r18, 0x78 ; 120 22592: 52 06 cpc r5, r18 22594: 61 04 cpc r6, r1 22596: 71 04 cpc r7, r1 22598: 10 f0 brcs .+4 ; 0x2259e 2259a: 90 e0 ldi r25, 0x00 ; 0 2259c: 88 e7 ldi r24, 0x78 ; 120 2259e: a9 2e mov r10, r25 225a0: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 225a2: 81 e0 ldi r24, 0x01 ; 1 225a4: 48 16 cp r4, r24 225a6: 88 e7 ldi r24, 0x78 ; 120 225a8: 58 06 cpc r5, r24 225aa: 61 04 cpc r6, r1 225ac: 71 04 cpc r7, r1 225ae: 08 f4 brcc .+2 ; 0x225b2 225b0: 5d c0 rjmp .+186 ; 0x2266c startPos = filesize - END_FILE_SECTION; 225b2: 98 e7 ldi r25, 0x78 ; 120 225b4: 59 1a sub r5, r25 225b6: 61 08 sbc r6, r1 225b8: 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);}; 225ba: 40 92 7f 17 sts 0x177F, r4 ; 0x80177f 225be: 50 92 80 17 sts 0x1780, r5 ; 0x801780 225c2: 60 92 81 17 sts 0x1781, r6 ; 0x801781 225c6: 70 92 82 17 sts 0x1782, r7 ; 0x801782 225ca: c3 01 movw r24, r6 225cc: b2 01 movw r22, r4 225ce: 0f 94 3b 76 call 0x2ec76 ; 0x2ec76 card.setIndex(startPos); } cmdqueue_reset(); 225d2: 0e 94 60 81 call 0x102c0 ; 0x102c0 cmdqueue_serial_disabled = true; 225d6: 00 93 a2 03 sts 0x03A2, r16 ; 0x8003a2 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 225da: 8f ec ldi r24, 0xCF ; 207 225dc: 9d e3 ldi r25, 0x3D ; 61 225de: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 225e2: bc 01 movw r22, r24 225e4: c5 01 movw r24, r10 225e6: 0f 94 f0 cc call 0x399e0 ; 0x399e0 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; } 225ea: 80 91 7f 17 lds r24, 0x177F ; 0x80177f 225ee: 90 91 80 17 lds r25, 0x1780 ; 0x801780 225f2: a0 91 81 17 lds r26, 0x1781 ; 0x801781 225f6: b0 91 82 17 lds r27, 0x1782 ; 0x801782 while (!card.eof() && !result) { 225fa: 40 91 78 17 lds r20, 0x1778 ; 0x801778 225fe: 50 91 79 17 lds r21, 0x1779 ; 0x801779 22602: 60 91 7a 17 lds r22, 0x177A ; 0x80177a 22606: 70 91 7b 17 lds r23, 0x177B ; 0x80177b 2260a: 84 17 cp r24, r20 2260c: 95 07 cpc r25, r21 2260e: a6 07 cpc r26, r22 22610: b7 07 cpc r27, r23 22612: 80 f5 brcc .+96 ; 0x22674 22614: 11 11 cpse r17, r1 22616: 2e c0 rjmp .+92 ; 0x22674 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); }; 22618: 20 91 fe 16 lds r18, 0x16FE ; 0x8016fe 2261c: 21 11 cpse r18, r1 2261e: 03 c0 rjmp .+6 ; 0x22626 22620: 80 e0 ldi r24, 0x00 ; 0 22622: 90 e0 ldi r25, 0x00 ; 0 22624: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 22626: 84 19 sub r24, r4 22628: 95 09 sbc r25, r5 2262a: 0f 94 c1 cc call 0x39982 ; 0x39982 card.sdprinting = true; 2262e: 00 93 6b 14 sts 0x146B, r16 ; 0x80146b get_command(); 22632: 0e 94 dc 84 call 0x109b8 ; 0x109b8 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 22636: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 2263a: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 2263e: 89 2b or r24, r25 22640: a1 f2 breq .-88 ; 0x225ea { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 22642: 82 ef ldi r24, 0xF2 ; 242 22644: 9c e6 ldi r25, 0x6C ; 108 22646: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 2264a: 81 11 cpse r24, r1 2264c: 05 c0 rjmp .+10 ; 0x22658 2264e: 84 e3 ldi r24, 0x34 ; 52 22650: 9c e8 ldi r25, 0x8C ; 140 22652: 0e 94 6c 69 call 0xd2d8 ; 0xd2d8 22656: 81 11 cpse r24, r1 22658: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 2265a: 80 91 7d 10 lds r24, 0x107D ; 0x80107d 2265e: 81 11 cpse r24, r1 22660: 02 c0 rjmp .+4 ; 0x22666 cmdqueue_pop_front(); 22662: 0e 94 d8 78 call 0xf1b0 ; 0xf1b0 cmdbuffer_front_already_processed = false; 22666: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 2266a: e5 cf rjmp .-54 ; 0x22636 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; 2266c: 41 2c mov r4, r1 2266e: 51 2c mov r5, r1 22670: 32 01 movw r6, r4 22672: af cf rjmp .-162 ; 0x225d2 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 22674: 0f 94 e2 cc call 0x399c4 ; 0x399c4 cmdqueue_serial_disabled = false; 22678: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 card.printingHasFinished(); 2267c: 0f 94 b4 7f call 0x2ff68 ; 0x2ff68 lcd_setstatuspgm(MSG_WELCOME); 22680: 81 e5 ldi r24, 0x51 ; 81 22682: 91 e7 ldi r25, 0x71 ; 113 22684: 0f 94 e0 0a call 0x215c0 ; 0x215c0 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)) { 22688: 11 23 and r17, r17 2268a: 91 f0 breq .+36 ; 0x226b0 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); 2268c: ff 92 push r15 2268e: ef 92 push r14 22690: 3f 92 push r3 22692: 2f 92 push r2 22694: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommand_P(MSG_M24); 22698: 61 e0 ldi r22, 0x01 ; 1 2269a: 8d ec ldi r24, 0xCD ; 205 2269c: 91 e7 ldi r25, 0x71 ; 113 2269e: 0e 94 dc 89 call 0x113b8 ; 0x113b8 226a2: 0f 90 pop r0 226a4: 0f 90 pop r0 226a6: 0f 90 pop r0 226a8: 0f 90 pop r0 } lcd_return_to_status(); 226aa: 0f 94 1d 26 call 0x24c3a ; 0x24c3a 226ae: 9b ce rjmp .-714 ; 0x223e6 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); 226b0: 8f ed ldi r24, 0xDF ; 223 226b2: 9d e3 ldi r25, 0x3D ; 61 226b4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 226b8: 41 e0 ldi r20, 0x01 ; 1 226ba: 60 e0 ldi r22, 0x00 ; 0 226bc: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce 226c0: 18 2f mov r17, r24 lcd_update_enable(true); 226c2: 81 e0 ldi r24, 0x01 ; 1 226c4: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 } if (result) { 226c8: 11 23 and r17, r17 226ca: 01 f3 breq .-64 ; 0x2268c 226cc: ee cf rjmp .-36 ; 0x226aa lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 226ce: 8f 5f subi r24, 0xFF ; 255 226d0: 80 93 15 05 sts 0x0515, r24 ; 0x800515 226d4: 22 ce rjmp .-956 ; 0x2231a else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 226d6: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 _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(); 226da: 80 91 12 05 lds r24, 0x0512 ; 0x800512 226de: 8f 5f subi r24, 0xFF ; 255 226e0: 80 93 12 05 sts 0x0512, r24 ; 0x800512 226e4: 80 91 14 05 lds r24, 0x0514 ; 0x800514 226e8: 8f 5f subi r24, 0xFF ; 255 226ea: 80 93 14 05 sts 0x0514, r24 ; 0x800514 226ee: e7 cd rjmp .-1074 ; 0x222be 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. 226f0: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 226f4: 11 e0 ldi r17, 0x01 ; 1 226f6: 81 11 cpse r24, r1 226f8: 05 c0 rjmp .+10 ; 0x22704 226fa: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 226fe: 81 11 cpse r24, r1 22700: 01 c0 rjmp .+2 ; 0x22704 22702: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 22704: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 22708: 90 91 a9 03 lds r25, 0x03A9 ; 0x8003a9 2270c: 89 2b or r24, r25 2270e: 91 f4 brne .+36 ; 0x22734 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 22710: 60 91 af 03 lds r22, 0x03AF ; 0x8003af 22714: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 22718: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab 2271c: 0f 94 31 84 call 0x30862 ; 0x30862 #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 22720: 80 91 82 14 lds r24, 0x1482 ; 0x801482 22724: 81 11 cpse r24, r1 22726: 46 c0 rjmp .+140 ; 0x227b4 22728: 8d e6 ldi r24, 0x6D ; 109 2272a: 94 e1 ldi r25, 0x14 ; 20 2272c: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 22730: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } if (rewindFlag) 22734: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 22736: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 2273a: 6c e2 ldi r22, 0x2C ; 44 2273c: 71 e0 ldi r23, 0x01 ; 1 2273e: 80 eb ldi r24, 0xB0 ; 176 22740: 93 e0 ldi r25, 0x03 ; 3 22742: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 22746: 81 11 cpse r24, r1 22748: 03 c0 rjmp .+6 ; 0x22750 2274a: 11 23 and r17, r17 2274c: 09 f4 brne .+2 ; 0x22750 2274e: 54 ce rjmp .-856 ; 0x223f8 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 22750: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 22754: 02 e1 ldi r16, 0x12 ; 18 22756: 81 11 cpse r24, r1 22758: 01 c0 rjmp .+2 ; 0x2275c 2275a: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 2275c: 4e e3 ldi r20, 0x3E ; 62 2275e: 60 91 ae 03 lds r22, 0x03AE ; 0x8003ae 22762: 80 e0 ldi r24, 0x00 ; 0 22764: 0e 94 46 70 call 0xe08c ; 0xe08c if (_md->isDir) 22768: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2276c: 88 23 and r24, r24 2276e: 19 f0 breq .+6 ; 0x22776 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 22770: 85 e8 ldi r24, 0x85 ; 133 22772: 0e 94 d5 70 call 0xe1aa ; 0xe1aa lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 22776: 20 91 a6 03 lds r18, 0x03A6 ; 0x8003a6 2277a: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 2277e: 90 91 a9 03 lds r25, 0x03A9 ; 0x8003a9 22782: 60 2f mov r22, r16 22784: 82 0f add r24, r18 22786: 91 1d adc r25, r1 22788: 0e 94 15 72 call 0xe42a ; 0xe42a 2278c: 81 11 cpse r24, r1 2278e: 15 c0 rjmp .+42 ; 0x227ba { _md->lcd_scrollTimer.start(); 22790: 80 eb ldi r24, 0xB0 ; 176 22792: 93 e0 ldi r25, 0x03 ; 3 22794: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> _md->offset++; 22798: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 2279c: 8f 5f subi r24, 0xFF ; 255 2279e: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 } else { // stop at the end of the string _md->lcd_scrollTimer.stop(); } } if (rewindFlag) //go back to sd_menu. 227a2: 11 23 and r17, r17 227a4: 09 f4 brne .+2 ; 0x227a8 227a6: 28 ce rjmp .-944 ; 0x223f8 227a8: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 227ac: 81 e0 ldi r24, 0x01 ; 1 227ae: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 227b2: 22 ce rjmp .-956 ; 0x223f8 #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; 227b4: 82 e8 ldi r24, 0x82 ; 130 227b6: 94 e1 ldi r25, 0x14 ; 20 227b8: b9 cf rjmp .-142 ; 0x2272c 227ba: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 227be: f1 cf rjmp .-30 ; 0x227a2 000227c0 : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 227c0: 61 e0 ldi r22, 0x01 ; 1 227c2: 83 e6 ldi r24, 0x63 ; 99 227c4: 91 e7 ldi r25, 0x71 ; 113 227c6: 0e 94 dc 89 call 0x113b8 ; 0x113b8 custom_message_type = CustomMsg::FilamentLoading; //just print status message 227ca: 82 e0 ldi r24, 0x02 ; 2 227cc: 80 93 72 07 sts 0x0772, r24 ; 0x800772 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 227d0: 8b e2 ldi r24, 0x2B ; 43 227d2: 9a e5 ldi r25, 0x5A ; 90 227d4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 227d8: 0f 94 e0 0a call 0x215c0 ; 0x215c0 lcd_return_to_status(); 227dc: 0f 94 1d 26 call 0x24c3a ; 0x24c3a lcd_draw_update = 3; 227e0: 83 e0 ldi r24, 0x03 ; 3 227e2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 227e6: 08 95 ret 000227e8 : //! @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; 227e8: 0f 94 80 0a call 0x21500 ; 0x21500 227ec: 88 23 and r24, r24 227ee: 39 f1 breq .+78 ; 0x2283e cmdqueue_serial_disabled = false; 227f0: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 227f4: 8b e2 ldi r24, 0x2B ; 43 227f6: 9a e5 ldi r25, 0x5A ; 90 227f8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 227fc: 0f 94 e0 0a call 0x215c0 ; 0x215c0 st_synchronize(); 22800: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 custom_message_type = CustomMsg::Resuming; 22804: 88 e0 ldi r24, 0x08 ; 8 22806: 80 93 72 07 sts 0x0772, r24 ; 0x800772 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); 2280a: 0e 94 b4 77 call 0xef68 ; 0xef68 Stopped = false; 2280e: 10 92 11 05 sts 0x0511, r1 ; 0x800511 restore_print_from_ram_and_continue(default_retraction); 22812: 60 e0 ldi r22, 0x00 ; 0 22814: 70 e0 ldi r23, 0x00 ; 0 22816: 80 e8 ldi r24, 0x80 ; 128 22818: 9f e3 ldi r25, 0x3F ; 63 2281a: 0e 94 8a 69 call 0xd314 ; 0xd314 did_pause_print = false; 2281e: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 22822: 80 91 99 03 lds r24, 0x0399 ; 0x800399 22826: 82 30 cpi r24, 0x02 ; 2 22828: 11 f4 brne .+4 ; 0x2282e 2282a: 0f 94 80 57 call 0x2af00 ; 0x2af00 refresh_cmd_timeout(); 2282e: 0e 94 09 68 call 0xd012 ; 0xd012 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 22832: 86 e0 ldi r24, 0x06 ; 6 22834: 9c e6 ldi r25, 0x6C ; 108 22836: 0e 94 97 7b call 0xf72e ; 0xf72e custom_message_type = CustomMsg::Status; 2283a: 10 92 72 07 sts 0x0772, r1 ; 0x800772 } 2283e: 08 95 ret 00022840 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 22840: cf 93 push r28 22842: df 93 push r29 22844: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 22846: 80 e0 ldi r24, 0x00 ; 0 22848: 0f 94 a7 05 call 0x20b4e ; 0x20b4e 2284c: 88 23 and r24, r24 2284e: 31 f0 breq .+12 ; 0x2285c lcd_updatestatus(message); 22850: 60 e0 ldi r22, 0x00 ; 0 22852: ce 01 movw r24, r28 } 22854: df 91 pop r29 22856: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 22858: 0d 94 8c 05 jmp 0x20b18 ; 0x20b18 } 2285c: df 91 pop r29 2285e: cf 91 pop r28 22860: 08 95 ret 00022862 : #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()); 22862: 0f 94 6a 7b call 0x2f6d4 ; 0x2f6d4 22866: 9f 93 push r25 22868: 8f 93 push r24 2286a: 87 e5 ldi r24, 0x57 ; 87 2286c: 9c e8 ldi r25, 0x8C ; 140 2286e: 9f 93 push r25 22870: 8f 93 push r24 22872: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 22876: 0f 90 pop r0 22878: 0f 90 pop r0 2287a: 0f 90 pop r0 2287c: 0f 90 pop r0 } 2287e: 08 95 ret 00022880 : printf_IRSensorAnalogBoardChange(); } return true; } static void lcd_detect_IRsensor(){ 22880: ef 92 push r14 22882: ff 92 push r15 22884: 0f 93 push r16 22886: 1f 93 push r17 22888: cf 93 push r28 2288a: 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(); 2288c: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 22890: c8 2f mov r28, r24 if(loaded){ lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 22892: 82 e1 ldi r24, 0x12 ; 18 22894: 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){ 22896: c1 11 cpse r28, r1 22898: 8a c0 rjmp .+276 ; 0x229ae 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)); 2289a: 8d ec ldi r24, 0xCD ; 205 2289c: 9e e3 ldi r25, 0x3E ; 62 2289e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 228a2: 0f 94 d6 34 call 0x269ac ; 0x269ac 228a6: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 228aa: 10 92 86 17 sts 0x1786, r1 ; 0x801786 228ae: d0 91 8e 17 lds r29, 0x178E ; 0x80178e 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(); 228b2: 0f 94 62 7b call 0x2f6c4 ; 0x2f6c4 228b6: 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)); 228b8: bc 01 movw r22, r24 228ba: 90 e0 ldi r25, 0x00 ; 0 228bc: 80 e0 ldi r24, 0x00 ; 0 228be: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 228c2: 20 e0 ldi r18, 0x00 ; 0 228c4: 30 ec ldi r19, 0xC0 ; 192 228c6: 4f e7 ldi r20, 0x7F ; 127 228c8: 56 e4 ldi r21, 0x46 ; 70 228ca: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 228ce: 20 e0 ldi r18, 0x00 ; 0 228d0: 30 e0 ldi r19, 0x00 ; 0 228d2: 40 ea ldi r20, 0xA0 ; 160 228d4: 50 e4 ldi r21, 0x40 ; 64 228d6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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) ); 228da: 9f 93 push r25 228dc: 8f 93 push r24 228de: 7f 93 push r23 228e0: 6f 93 push r22 228e2: 86 eb ldi r24, 0xB6 ; 182 228e4: 9c e8 ldi r25, 0x8C ; 140 228e6: 9f 93 push r25 228e8: 8f 93 push r24 228ea: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if(volt_IR_int < fsensor.IRsensor_Hmin_TRESHOLD){ 228ee: 0f 90 pop r0 228f0: 0f 90 pop r0 228f2: 0f 90 pop r0 228f4: 0f 90 pop r0 228f6: 0f 90 pop r0 228f8: 0f 90 pop r0 228fa: 0d 35 cpi r16, 0x5D ; 93 228fc: 86 e2 ldi r24, 0x26 ; 38 228fe: 18 07 cpc r17, r24 22900: 08 f4 brcc .+2 ; 0x22904 22902: 3f c0 rjmp .+126 ; 0x22982 if(!bStandalone) lcd_selftest_error(TestError::FsensorLevel,"HIGH",""); return false; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_INSERT_FIL)); 22904: 85 e1 ldi r24, 0x15 ; 21 22906: 9e e3 ldi r25, 0x3E ; 62 22908: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2290c: 0f 94 d6 34 call 0x269ac ; 0x269ac volt_IR_int = fsensor.getVoltRaw(); 22910: 0f 94 62 7b call 0x2f6c4 ; 0x2f6c4 22914: 7c 01 movw r14, r24 22916: bc 01 movw r22, r24 22918: 90 e0 ldi r25, 0x00 ; 0 2291a: 80 e0 ldi r24, 0x00 ; 0 2291c: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 22920: 20 e0 ldi r18, 0x00 ; 0 22922: 30 ec ldi r19, 0xC0 ; 192 22924: 4f e7 ldi r20, 0x7F ; 127 22926: 56 e4 ldi r21, 0x46 ; 70 22928: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 2292c: 20 e0 ldi r18, 0x00 ; 0 2292e: 30 e0 ldi r19, 0x00 ; 0 22930: 40 ea ldi r20, 0xA0 ; 160 22932: 50 e4 ldi r21, 0x40 ; 64 22934: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> printf_P(PSTR("Measured filament sensor low level: %4.2fV\n"), Raw2Voltage(volt_IR_int)); 22938: 9f 93 push r25 2293a: 8f 93 push r24 2293c: 7f 93 push r23 2293e: 6f 93 push r22 22940: 8a e8 ldi r24, 0x8A ; 138 22942: 9c e8 ldi r25, 0x8C ; 140 22944: 9f 93 push r25 22946: 8f 93 push r24 22948: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if(volt_IR_int > (fsensor.IRsensor_Lmax_TRESHOLD)){ 2294c: 0f 90 pop r0 2294e: 0f 90 pop r0 22950: 0f 90 pop r0 22952: 0f 90 pop r0 22954: 0f 90 pop r0 22956: 0f 90 pop r0 22958: 8f e2 ldi r24, 0x2F ; 47 2295a: e8 16 cp r14, r24 2295c: 83 e1 ldi r24, 0x13 ; 19 2295e: f8 06 cpc r15, r24 22960: 80 f4 brcc .+32 ; 0x22982 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; 22962: 61 e0 ldi r22, 0x01 ; 1 22964: 03 3d cpi r16, 0xD3 ; 211 22966: 1a 43 sbci r17, 0x3A ; 58 22968: 08 f0 brcs .+2 ; 0x2296c 2296a: 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) { 2296c: d6 17 cp r29, r22 2296e: 41 f0 breq .+16 ; 0x22980 return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 22970: 60 93 8e 17 sts 0x178E, r22 ; 0x80178e 22974: 88 e4 ldi r24, 0x48 ; 72 22976: 9d e0 ldi r25, 0x0D ; 13 22978: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 fsensor.setSensorRevision(newSensorRevision, true); printf_IRSensorAnalogBoardChange(); 2297c: 0f 94 31 14 call 0x22862 ; 0x22862 } return true; 22980: 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(); } 22982: 85 e8 ldi r24, 0x85 ; 133 22984: 97 e1 ldi r25, 0x17 ; 23 22986: 0e 94 15 76 call 0xec2a ; 0xec2a } 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)); 2298a: 83 e9 ldi r24, 0x93 ; 147 2298c: 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){ 2298e: cc 23 and r28, r28 22990: 71 f0 breq .+28 ; 0x229ae lcd_show_fullscreen_message_and_wait_P(_T(MSG_FS_VERIFIED)); 22992: 87 e6 ldi r24, 0x67 ; 103 22994: 9e e3 ldi r25, 0x3E ; 62 22996: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2299a: 0f 94 d6 34 call 0x269ac ; 0x269ac fsensor.init(); } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); } } 2299e: df 91 pop r29 229a0: cf 91 pop r28 229a2: 1f 91 pop r17 229a4: 0f 91 pop r16 229a6: ff 90 pop r15 229a8: 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(); 229aa: 0d 94 ef 85 jmp 0x30bde ; 0x30bde } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); 229ae: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 } } 229b2: df 91 pop r29 229b4: cf 91 pop r28 229b6: 1f 91 pop r17 229b8: 0f 91 pop r16 229ba: ff 90 pop r15 229bc: 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)); 229be: 0d 94 d6 34 jmp 0x269ac ; 0x269ac 000229c2 : 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) { 229c2: cf 93 push r28 229c4: df 93 push r29 229c6: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 229c8: 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) { 229ca: 66 23 and r22, r22 229cc: d9 f1 breq .+118 ; 0x22a44 229ce: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 229d0: 0f 94 21 44 call 0x28842 ; 0x28842 cancel_heatup = true; 229d4: 81 e0 ldi r24, 0x01 ; 1 229d6: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.402> heating_status = HeatingStatus::NO_HEATING; 229da: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db // Clear any saved printing state cancel_saved_printing(); 229de: 0e 94 f3 65 call 0xcbe6 ; 0xcbe6 // Abort the planner planner_abort_hard(); 229e2: 0f 94 8b bb call 0x37716 ; 0x37716 // Reset the queue cmdqueue_reset(); 229e6: 0e 94 60 81 call 0x102c0 ; 0x102c0 cmdqueue_serial_disabled = false; 229ea: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 st_reset_timer(); 229ee: 0f 94 35 58 call 0x2b06a ; 0x2b06a CRITICAL_SECTION_END; 229f2: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 229f4: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc print_job_timer.stop(); 229f8: 0f 94 a4 57 call 0x2af48 ; 0x2af48 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 229fc: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 22a00: 88 23 and r24, r24 22a02: 71 f0 breq .+28 ; 0x22a20 // Reset the sd status card.sdprinting = false; 22a04: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 22a08: 8b ef ldi r24, 0xFB ; 251 22a0a: 96 e1 ldi r25, 0x16 ; 22 22a0c: 0f 94 f5 6c call 0x2d9ea ; 0x2d9ea file.close(); 22a10: 8b ef ldi r24, 0xFB ; 251 22a12: 96 e1 ldi r25, 0x16 ; 22 22a14: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 saving = false; 22a18: 10 92 69 14 sts 0x1469, r1 ; 0x801469 logging = false; 22a1c: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 22a20: 89 e4 ldi r24, 0x49 ; 73 22a22: 9c e6 ldi r25, 0x6C ; 108 22a24: 0e 94 97 7b call 0xf72e ; 0xf72e #ifdef MESH_BED_LEVELING mbl.active = false; 22a28: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d #endif if (interactive) { 22a2c: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 22a2e: 10 92 11 05 sts 0x0511, r1 ; 0x800511 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 22a32: 81 e0 ldi r24, 0x01 ; 1 22a34: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 22a38: 10 92 64 0e sts 0x0E64, r1 ; 0x800e64 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 22a3c: df 91 pop r29 22a3e: 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(); 22a40: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a } void ConditionalStop() { CRITICAL_SECTION_START; 22a44: 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; 22a46: 81 e0 ldi r24, 0x01 ; 1 22a48: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.402> heating_status = HeatingStatus::NO_HEATING; 22a4c: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db // Clear any saved printing state cancel_saved_printing(); 22a50: 0e 94 f3 65 call 0xcbe6 ; 0xcbe6 // Abort the planner planner_abort_hard(); 22a54: 0f 94 8b bb call 0x37716 ; 0x37716 // Reset the queue cmdqueue_reset(); 22a58: 0e 94 60 81 call 0x102c0 ; 0x102c0 cmdqueue_serial_disabled = false; 22a5c: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 st_reset_timer(); 22a60: 0f 94 35 58 call 0x2b06a ; 0x2b06a CRITICAL_SECTION_END; 22a64: df bf out 0x3f, r29 ; 63 22a66: ca cf rjmp .-108 ; 0x229fc 00022a68 : } void lcd_print_stop() { print_stop(true); 22a68: 60 e0 ldi r22, 0x00 ; 0 22a6a: 81 e0 ldi r24, 0x01 ; 1 22a6c: 0d 94 e1 14 jmp 0x229c2 ; 0x229c2 00022a70 : } static void render_M862_warnings(const char* warning, const char* strict, uint8_t check) { if (check == 1) { // Warning, stop print if user selects 'No' 22a70: 41 30 cpi r20, 0x01 ; 1 22a72: 41 f4 brne .+16 ; 0x22a84 if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 22a74: 40 e0 ldi r20, 0x00 ; 0 22a76: 61 e0 ldi r22, 0x01 ; 1 22a78: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce 22a7c: 81 30 cpi r24, 0x01 ; 1 22a7e: 41 f4 brne .+16 ; 0x22a90 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 22a80: 0d 94 34 15 jmp 0x22a68 ; 0x22a68 { 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 22a84: 42 30 cpi r20, 0x02 ; 2 22a86: 21 f4 brne .+8 ; 0x22a90 lcd_show_fullscreen_message_and_wait_P(strict); 22a88: cb 01 movw r24, r22 22a8a: 0f 94 d6 34 call 0x269ac ; 0x269ac 22a8e: f8 cf rjmp .-16 ; 0x22a80 lcd_print_stop(); } } 22a90: 08 95 ret 00022a92 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 22a92: 0f 93 push r16 22a94: 1f 93 push r17 22a96: 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)) { 22a98: 8c ea ldi r24, 0xAC ; 172 22a9a: 9c e0 ldi r25, 0x0C ; 12 22a9c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 22aa0: 88 23 and r24, r24 22aa2: 29 f0 breq .+10 ; 0x22aae return false; } } done: return true; 22aa4: 81 e0 ldi r24, 0x01 ; 1 } 22aa6: cf 91 pop r28 22aa8: 1f 91 pop r17 22aaa: 0f 91 pop r16 22aac: 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()) { 22aae: 80 91 85 17 lds r24, 0x1785 ; 0x801785 22ab2: 88 23 and r24, r24 22ab4: b9 f3 breq .-18 ; 0x22aa4 22ab6: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 22aba: 81 11 cpse r24, r1 22abc: f3 cf rjmp .-26 ; 0x22aa4 if (oCheckFilament == ClCheckMode::_None) { 22abe: c0 91 e7 04 lds r28, 0x04E7 ; 0x8004e7 22ac2: cc 23 and r28, r28 22ac4: 79 f3 breq .-34 ; 0x22aa4 goto done; } render_M862_warnings( 22ac6: 89 ef ldi r24, 0xF9 ; 249 22ac8: 91 e4 ldi r25, 0x41 ; 65 22aca: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 22ace: 8c 01 movw r16, r24 22ad0: 80 ed ldi r24, 0xD0 ; 208 22ad2: 91 e4 ldi r25, 0x41 ; 65 22ad4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 22ad8: 4c 2f mov r20, r28 22ada: b8 01 movw r22, r16 22adc: 0f 94 38 15 call 0x22a70 ; 0x22a70 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 22ae0: 81 e0 ldi r24, 0x01 ; 1 22ae2: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 22ae6: 91 30 cpi r25, 0x01 ; 1 22ae8: f1 f6 brne .-68 ; 0x22aa6 22aea: 80 e0 ldi r24, 0x00 ; 0 22aec: dc cf rjmp .-72 ; 0x22aa6 00022aee : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 22aee: 1f 93 push r17 22af0: cf 93 push r28 22af2: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 22af4: 10 91 ec 04 lds r17, 0x04EC ; 0x8004ec 22af8: 11 23 and r17, r17 22afa: f9 f0 breq .+62 ; 0x22b3a 22afc: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 22afe: 85 ea ldi r24, 0xA5 ; 165 22b00: 9d e0 ldi r25, 0x0D ; 13 22b02: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a if (nDiameter == nDiameter_um) 22b06: 8c 17 cp r24, r28 22b08: 9d 07 cpc r25, r29 22b0a: b9 f0 breq .+46 ; 0x22b3a // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 22b0c: 80 e7 ldi r24, 0x70 ; 112 22b0e: 91 e4 ldi r25, 0x41 ; 65 22b10: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 22b14: ec 01 movw r28, r24 22b16: 8b e3 ldi r24, 0x3B ; 59 22b18: 91 e4 ldi r25, 0x41 ; 65 22b1a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 22b1e: 41 2f mov r20, r17 22b20: be 01 movw r22, r28 22b22: 0f 94 38 15 call 0x22a70 ; 0x22a70 ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 22b26: 10 92 f5 03 sts 0x03F5, r1 ; 0x8003f5 menu_submenu(lcd_hw_setup_menu); 22b2a: 60 e0 ldi r22, 0x00 ; 0 22b2c: 82 eb ldi r24, 0xB2 ; 178 22b2e: 9a e3 ldi r25, 0x3A ; 58 } } 22b30: df 91 pop r29 22b32: cf 91 pop r28 22b34: 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); 22b36: 0d 94 fb cf jmp 0x39ff6 ; 0x39ff6 } } 22b3a: df 91 pop r29 22b3c: cf 91 pop r28 22b3e: 1f 91 pop r17 22b40: 08 95 ret 00022b42 : } /// @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) { 22b42: cf 92 push r12 22b44: df 92 push r13 22b46: ef 92 push r14 22b48: ff 92 push r15 22b4a: cf 93 push r28 22b4c: 6b 01 movw r12, r22 22b4e: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 22b50: 82 e0 ldi r24, 0x02 ; 2 22b52: 80 93 72 07 sts 0x0772, r24 ; 0x800772 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 22b56: 8e ec ldi r24, 0xCE ; 206 22b58: 99 e5 ldi r25, 0x59 ; 89 22b5a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 22b5e: 0f 94 e0 0a call 0x215c0 ; 0x215c0 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 22b62: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 22b66: 10 92 86 17 sts 0x1786, r1 ; 0x801786 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 22b6a: 20 e0 ldi r18, 0x00 ; 0 22b6c: 30 e0 ldi r19, 0x00 ; 0 22b6e: 44 e3 ldi r20, 0x34 ; 52 22b70: 52 e4 ldi r21, 0x42 ; 66 22b72: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 22b76: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 22b7a: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 22b7e: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 22b82: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 22b86: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 22b8a: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 22b8e: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 22b92: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 22b96: 6a e0 ldi r22, 0x0A ; 10 22b98: 77 e5 ldi r23, 0x57 ; 87 22b9a: 8d ea ldi r24, 0xAD ; 173 22b9c: 92 e4 ldi r25, 0x42 ; 66 22b9e: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 22ba2: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 22ba6: 20 e0 ldi r18, 0x00 ; 0 22ba8: 30 e0 ldi r19, 0x00 ; 0 22baa: 4c e0 ldi r20, 0x0C ; 12 22bac: 52 e4 ldi r21, 0x42 ; 66 22bae: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 22bb2: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 22bb6: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 22bba: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 22bbe: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 22bc2: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 22bc6: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 22bca: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 22bce: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 22bd2: 69 e2 ldi r22, 0x29 ; 41 22bd4: 7c e5 ldi r23, 0x5C ; 92 22bd6: 85 e8 ldi r24, 0x85 ; 133 22bd8: 91 e4 ldi r25, 0x41 ; 65 22bda: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 22bde: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 22be2: 20 e0 ldi r18, 0x00 ; 0 22be4: 30 e0 ldi r19, 0x00 ; 0 22be6: a9 01 movw r20, r18 22be8: c7 01 movw r24, r14 22bea: b6 01 movw r22, r12 22bec: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 22bf0: 88 23 and r24, r24 22bf2: e1 f0 breq .+56 ; 0x22c2c { current_position[E_AXIS] += unloadLength; 22bf4: a7 01 movw r20, r14 22bf6: 96 01 movw r18, r12 22bf8: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 22bfc: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 22c00: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 22c04: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 22c08: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 22c0c: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 22c10: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 22c14: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 22c18: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 22c1c: 60 e0 ldi r22, 0x00 ; 0 22c1e: 70 e0 ldi r23, 0x00 ; 0 22c20: 80 e2 ldi r24, 0x20 ; 32 22c22: 91 e4 ldi r25, 0x41 ; 65 22c24: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 22c28: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 22c2c: 8a e3 ldi r24, 0x3A ; 58 22c2e: 9b e3 ldi r25, 0x3B ; 59 22c30: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 22c34: 0f 94 4f 34 call 0x2689e ; 0x2689e //disable extruder steppers so filament can be removed disable_e0(); 22c38: 14 9a sbi 0x02, 4 ; 2 _delay(100); 22c3a: 64 e6 ldi r22, 0x64 ; 100 22c3c: 70 e0 ldi r23, 0x00 ; 0 22c3e: 80 e0 ldi r24, 0x00 ; 0 22c40: 90 e0 ldi r25, 0x00 ; 0 22c42: 0f 94 5c 3c call 0x278b8 ; 0x278b8 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 22c46: 82 e0 ldi r24, 0x02 ; 2 22c48: 0f 94 2e 63 call 0x2c65c ; 0x2c65c 22c4c: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 22c4e: 0e 94 43 72 call 0xe486 ; 0xe486 22c52: 81 11 cpse r24, r1 22c54: 07 c0 rjmp .+14 ; 0x22c64 22c56: c1 50 subi r28, 0x01 ; 1 22c58: 29 f0 breq .+10 ; 0x22c64 delay_keep_alive(100); 22c5a: 84 e6 ldi r24, 0x64 ; 100 22c5c: 90 e0 ldi r25, 0x00 ; 0 22c5e: 0e 94 10 8f call 0x11e20 ; 0x11e20 22c62: f5 cf rjmp .-22 ; 0x22c4e counterBeep++; } st_synchronize(); 22c64: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 while (lcd_clicked()) delay_keep_alive(100); 22c68: 0e 94 43 72 call 0xe486 ; 0xe486 22c6c: 88 23 and r24, r24 22c6e: 29 f0 breq .+10 ; 0x22c7a 22c70: 84 e6 ldi r24, 0x64 ; 100 22c72: 90 e0 ldi r25, 0x00 ; 0 22c74: 0e 94 10 8f call 0x11e20 ; 0x11e20 22c78: f7 cf rjmp .-18 ; 0x22c68 lcd_update_enable(true); 22c7a: 81 e0 ldi r24, 0x01 ; 1 22c7c: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_setstatuspgm(MSG_WELCOME); 22c80: 81 e5 ldi r24, 0x51 ; 81 22c82: 91 e7 ldi r25, 0x71 ; 113 22c84: 0f 94 e0 0a call 0x215c0 ; 0x215c0 custom_message_type = CustomMsg::Status; 22c88: 10 92 72 07 sts 0x0772, r1 ; 0x800772 clearFilamentAction(); 22c8c: 0f 94 be 35 call 0x26b7c ; 0x26b7c #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 22c90: 85 e8 ldi r24, 0x85 ; 133 22c92: 97 e1 ldi r25, 0x17 ; 23 } 22c94: cf 91 pop r28 22c96: ff 90 pop r15 22c98: ef 90 pop r14 22c9a: df 90 pop r13 22c9c: cf 90 pop r12 22c9e: 0c 94 15 76 jmp 0xec2a ; 0xec2a 00022ca2 : 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() 22ca2: 2f 92 push r2 22ca4: 3f 92 push r3 22ca6: 4f 92 push r4 22ca8: 5f 92 push r5 22caa: 6f 92 push r6 22cac: 7f 92 push r7 22cae: 8f 92 push r8 22cb0: 9f 92 push r9 22cb2: af 92 push r10 22cb4: bf 92 push r11 22cb6: cf 92 push r12 22cb8: df 92 push r13 22cba: ef 92 push r14 22cbc: ff 92 push r15 22cbe: 0f 93 push r16 22cc0: 1f 93 push r17 22cc2: cf 93 push r28 22cc4: df 93 push r29 22cc6: 00 d0 rcall .+0 ; 0x22cc8 22cc8: 00 d0 rcall .+0 ; 0x22cca 22cca: 00 d0 rcall .+0 ; 0x22ccc 22ccc: cd b7 in r28, 0x3d ; 61 22cce: de b7 in r29, 0x3e ; 62 22cd0: 0d e9 ldi r16, 0x9D ; 157 22cd2: 13 e1 ldi r17, 0x13 ; 19 22cd4: 1f 83 std Y+7, r17 ; 0x07 22cd6: 0e 83 std Y+6, r16 ; 0x06 22cd8: 2e 80 ldd r2, Y+6 ; 0x06 22cda: 3f 80 ldd r3, Y+7 ; 0x07 22cdc: 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])) 22cde: f1 01 movw r30, r2 22ce0: 61 81 ldd r22, Z+1 ; 0x01 22ce2: 72 81 ldd r23, Z+2 ; 0x02 22ce4: 83 81 ldd r24, Z+3 ; 0x03 22ce6: 94 81 ldd r25, Z+4 ; 0x04 22ce8: 9b 01 movw r18, r22 22cea: ac 01 movw r20, r24 22cec: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 22cf0: 88 23 and r24, r24 22cf2: 09 f4 brne .+2 ; 0x22cf6 22cf4: 7c c0 rjmp .+248 ; 0x22dee mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 22cf6: 89 81 ldd r24, Y+1 ; 0x01 22cf8: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 22cfc: 20 e0 ldi r18, 0x00 ; 0 22cfe: 30 e0 ldi r19, 0x00 ; 0 22d00: 48 eb ldi r20, 0xB8 ; 184 22d02: 51 e4 ldi r21, 0x41 ; 65 22d04: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 22d08: 6b 01 movw r12, r22 22d0a: 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)) + 22d0c: 20 e0 ldi r18, 0x00 ; 0 22d0e: 30 e0 ldi r19, 0x00 ; 0 22d10: 4c ef ldi r20, 0xFC ; 252 22d12: 52 e4 ldi r21, 0x42 ; 66 22d14: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 22d18: 2b 01 movw r4, r22 22d1a: 3c 01 movw r6, r24 22d1c: 20 e0 ldi r18, 0x00 ; 0 22d1e: 30 e0 ldi r19, 0x00 ; 0 22d20: 44 e6 ldi r20, 0x64 ; 100 22d22: 53 e4 ldi r21, 0x43 ; 67 22d24: c7 01 movw r24, r14 22d26: b6 01 movw r22, r12 22d28: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 22d2c: 4b 01 movw r8, r22 22d2e: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22d30: 20 e0 ldi r18, 0x00 ; 0 22d32: 30 e0 ldi r19, 0x00 ; 0 22d34: 40 ec ldi r20, 0xC0 ; 192 22d36: 51 e4 ldi r21, 0x41 ; 65 22d38: c7 01 movw r24, r14 22d3a: b6 01 movw r22, r12 22d3c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 22d40: 6b 01 movw r12, r22 22d42: 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)) + 22d44: ee 81 ldd r30, Y+6 ; 0x06 22d46: ff 81 ldd r31, Y+7 ; 0x07 22d48: 21 81 ldd r18, Z+1 ; 0x01 22d4a: 32 81 ldd r19, Z+2 ; 0x02 22d4c: 43 81 ldd r20, Z+3 ; 0x03 22d4e: 54 81 ldd r21, Z+4 ; 0x04 22d50: c3 01 movw r24, r6 22d52: b2 01 movw r22, r4 22d54: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22d58: a5 01 movw r20, r10 22d5a: 94 01 movw r18, r8 22d5c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22d60: 20 e0 ldi r18, 0x00 ; 0 22d62: 30 e9 ldi r19, 0x90 ; 144 22d64: 42 ea ldi r20, 0xA2 ; 162 22d66: 56 e4 ldi r21, 0x46 ; 70 22d68: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 22d6c: 6a 83 std Y+2, r22 ; 0x02 22d6e: 7b 83 std Y+3, r23 ; 0x03 22d70: 8c 83 std Y+4, r24 ; 0x04 22d72: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22d74: ee 81 ldd r30, Y+6 ; 0x06 22d76: ff 81 ldd r31, Y+7 ; 0x07 22d78: 25 85 ldd r18, Z+13 ; 0x0d 22d7a: 36 85 ldd r19, Z+14 ; 0x0e 22d7c: 47 85 ldd r20, Z+15 ; 0x0f 22d7e: 50 89 ldd r21, Z+16 ; 0x10 22d80: c7 01 movw r24, r14 22d82: b6 01 movw r22, r12 22d84: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22d88: a5 01 movw r20, r10 22d8a: 94 01 movw r18, r8 22d8c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22d90: 20 e0 ldi r18, 0x00 ; 0 22d92: 30 e9 ldi r19, 0x90 ; 144 22d94: 42 e2 ldi r20, 0x22 ; 34 22d96: 56 ec ldi r21, 0xC6 ; 198 22d98: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 22d9c: 9b 01 movw r18, r22 22d9e: 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)) + 22da0: 6a 81 ldd r22, Y+2 ; 0x02 22da2: 7b 81 ldd r23, Y+3 ; 0x03 22da4: 8c 81 ldd r24, Y+4 ; 0x04 22da6: 9d 81 ldd r25, Y+5 ; 0x05 22da8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 22dac: 4b 01 movw r8, r22 22dae: 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)); 22db0: ee 81 ldd r30, Y+6 ; 0x06 22db2: ff 81 ldd r31, Y+7 ; 0x07 22db4: 21 8d ldd r18, Z+25 ; 0x19 22db6: 32 8d ldd r19, Z+26 ; 0x1a 22db8: 43 8d ldd r20, Z+27 ; 0x1b 22dba: 54 8d ldd r21, Z+28 ; 0x1c 22dbc: c7 01 movw r24, r14 22dbe: b6 01 movw r22, r12 22dc0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22dc4: a3 01 movw r20, r6 22dc6: 92 01 movw r18, r4 22dc8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22dcc: 20 e0 ldi r18, 0x00 ; 0 22dce: 30 e9 ldi r19, 0x90 ; 144 22dd0: 42 ea ldi r20, 0xA2 ; 162 22dd2: 56 e4 ldi r21, 0x46 ; 70 22dd4: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 22dd8: 9b 01 movw r18, r22 22dda: 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)) + 22ddc: c5 01 movw r24, r10 22dde: b4 01 movw r22, r8 22de0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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] = 22de4: f1 01 movw r30, r2 22de6: 61 83 std Z+1, r22 ; 0x01 22de8: 72 83 std Z+2, r23 ; 0x02 22dea: 83 83 std Z+3, r24 ; 0x03 22dec: 94 83 std Z+4, r25 ; 0x04 22dee: f4 e0 ldi r31, 0x04 ; 4 22df0: 2f 0e add r2, r31 22df2: 31 1c adc r3, r1 22df4: 29 81 ldd r18, Y+1 ; 0x01 22df6: 2f 5f subi r18, 0xFF ; 255 22df8: 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) { 22dfa: 27 30 cpi r18, 0x07 ; 7 22dfc: 09 f0 breq .+2 ; 0x22e00 22dfe: 6f cf rjmp .-290 ; 0x22cde 22e00: 8e 81 ldd r24, Y+6 ; 0x06 22e02: 9f 81 ldd r25, Y+7 ; 0x07 22e04: 4c 96 adiw r24, 0x1c ; 28 22e06: 9f 83 std Y+7, r25 ; 0x07 22e08: 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) { 22e0a: 81 56 subi r24, 0x61 ; 97 22e0c: 94 41 sbci r25, 0x14 ; 20 22e0e: 09 f0 breq .+2 ; 0x22e12 22e10: 63 cf rjmp .-314 ; 0x22cd8 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() 22e12: 19 87 std Y+9, r17 ; 0x09 22e14: 08 87 std Y+8, r16 ; 0x08 22e16: f1 e0 ldi r31, 0x01 ; 1 22e18: 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)) + 22e1a: c8 01 movw r24, r16 22e1c: 8b 5a subi r24, 0xAB ; 171 22e1e: 9f 4f sbci r25, 0xFF ; 255 22e20: 9f 83 std Y+7, r25 ; 0x07 22e22: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 22e24: 18 01 movw r2, r16 22e26: 99 ea ldi r25, 0xA9 ; 169 22e28: 29 0e add r2, r25 22e2a: 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])) 22e2c: e8 85 ldd r30, Y+8 ; 0x08 22e2e: f9 85 ldd r31, Y+9 ; 0x09 22e30: 65 8d ldd r22, Z+29 ; 0x1d 22e32: 76 8d ldd r23, Z+30 ; 0x1e 22e34: 87 8d ldd r24, Z+31 ; 0x1f 22e36: 90 a1 ldd r25, Z+32 ; 0x20 22e38: 9b 01 movw r18, r22 22e3a: ac 01 movw r20, r24 22e3c: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 22e40: 88 23 and r24, r24 22e42: 09 f4 brne .+2 ; 0x22e46 22e44: 79 c0 rjmp .+242 ; 0x22f38 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 22e46: 89 81 ldd r24, Y+1 ; 0x01 22e48: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 22e4c: 20 e0 ldi r18, 0x00 ; 0 22e4e: 30 e0 ldi r19, 0x00 ; 0 22e50: 40 ea ldi r20, 0xA0 ; 160 22e52: 50 e4 ldi r21, 0x40 ; 64 22e54: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 22e58: 6b 01 movw r12, r22 22e5a: 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)) + 22e5c: 20 e0 ldi r18, 0x00 ; 0 22e5e: 30 e0 ldi r19, 0x00 ; 0 22e60: 48 ed ldi r20, 0xD8 ; 216 22e62: 52 e4 ldi r21, 0x42 ; 66 22e64: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 22e68: 2b 01 movw r4, r22 22e6a: 3c 01 movw r6, r24 22e6c: 20 e0 ldi r18, 0x00 ; 0 22e6e: 30 e0 ldi r19, 0x00 ; 0 22e70: 42 e5 ldi r20, 0x52 ; 82 22e72: 53 e4 ldi r21, 0x43 ; 67 22e74: c7 01 movw r24, r14 22e76: b6 01 movw r22, r12 22e78: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 22e7c: 4b 01 movw r8, r22 22e7e: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 22e80: 20 e0 ldi r18, 0x00 ; 0 22e82: 30 e0 ldi r19, 0x00 ; 0 22e84: 40 ec ldi r20, 0xC0 ; 192 22e86: 50 e4 ldi r21, 0x40 ; 64 22e88: c7 01 movw r24, r14 22e8a: b6 01 movw r22, r12 22e8c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 22e90: 6b 01 movw r12, r22 22e92: 7c 01 movw r14, r24 22e94: ee 81 ldd r30, Y+6 ; 0x06 22e96: ff 81 ldd r31, Y+7 ; 0x07 22e98: 20 81 ld r18, Z 22e9a: 31 81 ldd r19, Z+1 ; 0x01 22e9c: 42 81 ldd r20, Z+2 ; 0x02 22e9e: 53 81 ldd r21, Z+3 ; 0x03 22ea0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22ea4: a5 01 movw r20, r10 22ea6: 94 01 movw r18, r8 22ea8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22eac: 20 e0 ldi r18, 0x00 ; 0 22eae: 30 e9 ldi r19, 0x90 ; 144 22eb0: 42 e2 ldi r20, 0x22 ; 34 22eb2: 56 ec ldi r21, 0xC6 ; 198 22eb4: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 22eb8: 6a 83 std Y+2, r22 ; 0x02 22eba: 7b 83 std Y+3, r23 ; 0x03 22ebc: 8c 83 std Y+4, r24 ; 0x04 22ebe: 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)) + 22ec0: f8 01 movw r30, r16 22ec2: 21 81 ldd r18, Z+1 ; 0x01 22ec4: 32 81 ldd r19, Z+2 ; 0x02 22ec6: 43 81 ldd r20, Z+3 ; 0x03 22ec8: 54 81 ldd r21, Z+4 ; 0x04 22eca: c3 01 movw r24, r6 22ecc: b2 01 movw r22, r4 22ece: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22ed2: a5 01 movw r20, r10 22ed4: 94 01 movw r18, r8 22ed6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22eda: 20 e0 ldi r18, 0x00 ; 0 22edc: 30 e9 ldi r19, 0x90 ; 144 22ede: 42 ea ldi r20, 0xA2 ; 162 22ee0: 56 e4 ldi r21, 0x46 ; 70 22ee2: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 22ee6: 9b 01 movw r18, r22 22ee8: ac 01 movw r20, r24 22eea: 6a 81 ldd r22, Y+2 ; 0x02 22eec: 7b 81 ldd r23, Y+3 ; 0x03 22eee: 8c 81 ldd r24, Y+4 ; 0x04 22ef0: 9d 81 ldd r25, Y+5 ; 0x05 22ef2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 22ef6: 4b 01 movw r8, r22 22ef8: 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)); 22efa: f1 01 movw r30, r2 22efc: 20 81 ld r18, Z 22efe: 31 81 ldd r19, Z+1 ; 0x01 22f00: 42 81 ldd r20, Z+2 ; 0x02 22f02: 53 81 ldd r21, Z+3 ; 0x03 22f04: c7 01 movw r24, r14 22f06: b6 01 movw r22, r12 22f08: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22f0c: a3 01 movw r20, r6 22f0e: 92 01 movw r18, r4 22f10: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 22f14: 20 e0 ldi r18, 0x00 ; 0 22f16: 30 e9 ldi r19, 0x90 ; 144 22f18: 42 ea ldi r20, 0xA2 ; 162 22f1a: 56 e4 ldi r21, 0x46 ; 70 22f1c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 22f20: 9b 01 movw r18, r22 22f22: 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)) + 22f24: c5 01 movw r24, r10 22f26: b4 01 movw r22, r8 22f28: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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] = 22f2c: e8 85 ldd r30, Y+8 ; 0x08 22f2e: f9 85 ldd r31, Y+9 ; 0x09 22f30: 65 8f std Z+29, r22 ; 0x1d 22f32: 76 8f std Z+30, r23 ; 0x1e 22f34: 87 8f std Z+31, r24 ; 0x1f 22f36: 90 a3 std Z+32, r25 ; 0x20 22f38: 88 85 ldd r24, Y+8 ; 0x08 22f3a: 99 85 ldd r25, Y+9 ; 0x09 22f3c: 4c 96 adiw r24, 0x1c ; 28 22f3e: 99 87 std Y+9, r25 ; 0x09 22f40: 88 87 std Y+8, r24 ; 0x08 22f42: 99 81 ldd r25, Y+1 ; 0x01 22f44: 9f 5f subi r25, 0xFF ; 255 22f46: 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) { 22f48: 96 30 cpi r25, 0x06 ; 6 22f4a: 09 f0 breq .+2 ; 0x22f4e 22f4c: 6f cf rjmp .-290 ; 0x22e2c 22f4e: 0c 5f subi r16, 0xFC ; 252 22f50: 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) { 22f52: e3 e1 ldi r30, 0x13 ; 19 22f54: 09 3b cpi r16, 0xB9 ; 185 22f56: 1e 07 cpc r17, r30 22f58: 09 f0 breq .+2 ; 0x22f5c 22f5a: 5b cf rjmp .-330 ; 0x22e12 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: 29 96 adiw r28, 0x09 ; 9 22f5e: 0f b6 in r0, 0x3f ; 63 22f60: f8 94 cli 22f62: de bf out 0x3e, r29 ; 62 22f64: 0f be out 0x3f, r0 ; 63 22f66: cd bf out 0x3d, r28 ; 61 22f68: df 91 pop r29 22f6a: cf 91 pop r28 22f6c: 1f 91 pop r17 22f6e: 0f 91 pop r16 22f70: ff 90 pop r15 22f72: ef 90 pop r14 22f74: df 90 pop r13 22f76: cf 90 pop r12 22f78: bf 90 pop r11 22f7a: af 90 pop r10 22f7c: 9f 90 pop r9 22f7e: 8f 90 pop r8 22f80: 7f 90 pop r7 22f82: 6f 90 pop r6 22f84: 5f 90 pop r5 22f86: 4f 90 pop r4 22f88: 3f 90 pop r3 22f8a: 2f 90 pop r2 22f8c: 08 95 ret 00022f8e : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 22f8e: 2f 92 push r2 22f90: 3f 92 push r3 22f92: 4f 92 push r4 22f94: 5f 92 push r5 22f96: 6f 92 push r6 22f98: 7f 92 push r7 22f9a: 8f 92 push r8 22f9c: 9f 92 push r9 22f9e: af 92 push r10 22fa0: bf 92 push r11 22fa2: cf 92 push r12 22fa4: df 92 push r13 22fa6: ef 92 push r14 22fa8: ff 92 push r15 22faa: 0f 93 push r16 22fac: 1f 93 push r17 22fae: cf 93 push r28 22fb0: df 93 push r29 22fb2: cd b7 in r28, 0x3d ; 61 22fb4: de b7 in r29, 0x3e ; 62 22fb6: 67 97 sbiw r28, 0x17 ; 23 22fb8: 0f b6 in r0, 0x3f ; 63 22fba: f8 94 cli 22fbc: de bf out 0x3e, r29 ; 62 22fbe: 0f be out 0x3f, r0 ; 63 22fc0: cd bf out 0x3d, r28 ; 61 22fc2: 08 2f mov r16, r24 22fc4: ce 01 movw r24, r28 22fc6: 46 96 adiw r24, 0x16 ; 22 22fc8: 9f 8b std Y+23, r25 ; 0x17 22fca: 8e 8b std Y+22, r24 ; 0x16 22fcc: 83 e0 ldi r24, 0x03 ; 3 22fce: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 22fd0: 95 e1 ldi r25, 0x15 ; 21 22fd2: 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 22fd4: 0f 94 ac c2 call 0x38558 ; 0x38558 tool_change_extruder = slot; 22fd8: 00 93 7d 13 sts 0x137D, r16 ; 0x80137d state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 22fdc: 40 2f mov r20, r16 22fde: 64 e5 ldi r22, 0x54 ; 84 22fe0: ce 01 movw r24, r28 22fe2: 01 96 adiw r24, 0x01 ; 1 22fe4: 0f 94 8a c2 call 0x38514 ; 0x38514 22fe8: 49 81 ldd r20, Y+1 ; 0x01 22fea: 5a 81 ldd r21, Y+2 ; 0x02 22fec: 6b 81 ldd r22, Y+3 ; 0x03 22fee: 7c 81 ldd r23, Y+4 ; 0x04 22ff0: 8d 81 ldd r24, Y+5 ; 0x05 22ff2: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 22ff6: 61 e0 ldi r22, 0x01 ; 1 22ff8: 81 e0 ldi r24, 0x01 ; 1 22ffa: 0f 94 20 9f call 0x33e40 ; 0x33e40 22ffe: 18 2f mov r17, r24 23000: 81 11 cpse r24, r1 23002: 07 c0 rjmp .+14 ; 0x23012 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 23004: 0f 94 ee c1 call 0x383dc ; 0x383dc // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 23008: 0f 94 be 9e call 0x33d7c ; 0x33d7c // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 2300c: 0f 94 ae 9f call 0x33f5c ; 0x33f5c 23010: e1 cf rjmp .-62 ; 0x22fd4 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 23012: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 23016: 0f 94 e2 c2 call 0x385c4 ; 0x385c4 2301a: 81 30 cpi r24, 0x01 ; 1 2301c: 79 f1 breq .+94 ; 0x2307c // 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(); 2301e: 0f 94 ae 9f call 0x33f5c ; 0x33f5c if (retries == 2 && cutter_enabled()) { 23022: 92 e0 ldi r25, 0x02 ; 2 23024: f9 12 cpse r15, r25 23026: 09 c0 rjmp .+18 ; 0x2303a 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; 23028: 8e ec ldi r24, 0xCE ; 206 2302a: 9e e0 ldi r25, 0x0E ; 14 2302c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 23030: 81 30 cpi r24, 0x01 ; 1 23032: 19 f4 brne .+6 ; 0x2303a CutFilamentInner(slot); // try cutting filament tip at the last attempt 23034: 80 2f mov r24, r16 23036: 0f 94 99 a0 call 0x34132 ; 0x34132 2303a: 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) { 2303c: f1 10 cpse r15, r1 2303e: ca cf rjmp .-108 ; 0x22fd4 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()) { 23040: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 23044: 88 23 and r24, r24 23046: 09 f4 brne .+2 ; 0x2304a 23048: ef c0 rjmp .+478 ; 0x23228 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 2304a: 67 96 adiw r28, 0x17 ; 23 2304c: 0f b6 in r0, 0x3f ; 63 2304e: f8 94 cli 23050: de bf out 0x3e, r29 ; 62 23052: 0f be out 0x3f, r0 ; 63 23054: cd bf out 0x3d, r28 ; 61 23056: df 91 pop r29 23058: cf 91 pop r28 2305a: 1f 91 pop r17 2305c: 0f 91 pop r16 2305e: ff 90 pop r15 23060: ef 90 pop r14 23062: df 90 pop r13 23064: cf 90 pop r12 23066: bf 90 pop r11 23068: af 90 pop r10 2306a: 9f 90 pop r9 2306c: 8f 90 pop r8 2306e: 7f 90 pop r7 23070: 6f 90 pop r6 23072: 5f 90 pop r5 23074: 4f 90 pop r4 23076: 3f 90 pop r3 23078: 2f 90 pop r2 2307a: 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(); 2307c: 60 91 72 13 lds r22, 0x1372 ; 0x801372 23080: 70 e0 ldi r23, 0x00 ; 0 23082: 90 e0 ldi r25, 0x00 ; 0 23084: 80 e0 ldi r24, 0x00 ; 0 23086: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2308a: 9b 01 movw r18, r22 2308c: ac 01 movw r20, r24 2308e: 60 e0 ldi r22, 0x00 ; 0 23090: 70 e0 ldi r23, 0x00 ; 0 23092: 8c e5 ldi r24, 0x5C ; 92 23094: 92 e4 ldi r25, 0x42 ; 66 23096: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 2309a: 36 2e mov r3, r22 2309c: 87 2e mov r8, r23 2309e: 98 2e mov r9, r24 230a0: 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)) 230a2: 26 2f mov r18, r22 230a4: 37 2f mov r19, r23 230a6: 48 2f mov r20, r24 230a8: 59 2f mov r21, r25 230aa: 60 e0 ldi r22, 0x00 ; 0 230ac: 70 e0 ldi r23, 0x00 ; 0 230ae: 80 e2 ldi r24, 0x20 ; 32 230b0: 91 e4 ldi r25, 0x41 ; 65 230b2: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 230b6: 2b 01 movw r4, r22 230b8: 3c 01 movw r6, r24 230ba: e7 e3 ldi r30, 0x37 ; 55 230bc: f5 e0 ldi r31, 0x05 ; 5 230be: 82 2d mov r24, r2 230c0: 11 92 st Z+, r1 230c2: 8a 95 dec r24 230c4: e9 f7 brne .-6 ; 0x230c0 lcd_status_message_idx = 0; 230c6: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.461> 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); 230ca: 83 2d mov r24, r3 230cc: 98 2d mov r25, r8 230ce: a9 2d mov r26, r9 230d0: be 2d mov r27, r14 230d2: bc 01 movw r22, r24 230d4: 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++) { 230d6: 91 2c mov r9, r1 230d8: 31 2c mov r3, r1 230da: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 230dc: 5b 01 movw r10, r22 230de: 6c 01 movw r12, r24 230e0: d7 fa bst r13, 7 230e2: d0 94 com r13 230e4: d7 f8 bld r13, 7 230e6: d0 94 com r13 230e8: 20 e0 ldi r18, 0x00 ; 0 230ea: 30 e0 ldi r19, 0x00 ; 0 230ec: 48 e4 ldi r20, 0x48 ; 72 230ee: 52 e4 ldi r21, 0x42 ; 66 230f0: 0f 94 ae c2 call 0x3855c ; 0x3855c 230f4: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 230f8: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 while (planner_any_moves()) { 230fc: 98 17 cp r25, r24 230fe: 09 f4 brne .+2 ; 0x23102 23100: 49 c0 rjmp .+146 ; 0x23194 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 23102: 11 23 and r17, r17 23104: 31 f0 breq .+12 ; 0x23112 23106: 0f 94 e2 c2 call 0x385c4 ; 0x385c4 2310a: 11 e0 ldi r17, 0x01 ; 1 2310c: 81 30 cpi r24, 0x01 ; 1 2310e: 09 f0 breq .+2 ; 0x23112 23110: 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); 23112: 83 e0 ldi r24, 0x03 ; 3 23114: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 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); 23118: 20 91 4c 07 lds r18, 0x074C ; 0x80074c 2311c: 30 91 4d 07 lds r19, 0x074D ; 0x80074d 23120: 40 91 4e 07 lds r20, 0x074E ; 0x80074e 23124: 50 91 4f 07 lds r21, 0x074F ; 0x80074f 23128: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 2312c: a3 01 movw r20, r6 2312e: 92 01 movw r18, r4 23130: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23134: 0f 94 15 df call 0x3be2a ; 0x3be2a 23138: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 2313c: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 2313e: e6 16 cp r14, r22 23140: c1 f0 breq .+48 ; 0x23172 23142: e3 2d mov r30, r3 23144: e4 31 cpi r30, 0x14 ; 20 23146: 08 f0 brcs .+2 ; 0x2314a 23148: 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); 2314a: 33 24 eor r3, r3 2314c: 33 94 inc r3 2314e: 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] : '-'); 23150: 8f ef ldi r24, 0xFF ; 255 23152: 11 11 cpse r17, r1 23154: 01 c0 rjmp .+2 ; 0x23158 23156: 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; 23158: f0 e0 ldi r31, 0x00 ; 0 2315a: e9 5c subi r30, 0xC9 ; 201 2315c: fa 4f sbci r31, 0xFA ; 250 2315e: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 23160: 91 e0 ldi r25, 0x01 ; 1 23162: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 23166: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 2316a: 81 11 cpse r24, r1 2316c: 02 c0 rjmp .+4 ; 0x23172 2316e: 0f 94 7c 3f call 0x27ef8 ; 0x27ef8 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 23172: 90 e0 ldi r25, 0x00 ; 0 23174: 80 e0 ldi r24, 0x00 ; 0 23176: 0e 94 10 8f call 0x11e20 ; 0x11e20 } 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: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 2317c: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 23180: 88 23 and r24, r24 23182: 09 f4 brne .+2 ; 0x23186 23184: b7 cf rjmp .-146 ; 0x230f4 return false; // power panic or a similar issue happened, bail out fast 23186: 10 e0 ldi r17, 0x00 ; 0 23188: 37 c0 rjmp .+110 ; 0x231f8 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); 2318a: c6 01 movw r24, r12 2318c: b5 01 movw r22, r10 2318e: 99 24 eor r9, r9 23190: 93 94 inc r9 23192: aa cf rjmp .-172 ; 0x230e8 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++) { 23194: 91 e0 ldi r25, 0x01 ; 1 23196: 99 12 cpse r9, r25 23198: f8 cf rjmp .-16 ; 0x2318a return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 2319a: 0f 94 ac c2 call 0x38558 ; 0x38558 if (!filament_inserted) { 2319e: 11 11 cpse r17, r1 231a0: 08 c0 rjmp .+16 ; 0x231b2 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 231a2: 8f ec ldi r24, 0xCF ; 207 231a4: 9e e0 ldi r25, 0x0E ; 14 231a6: 0e 94 44 78 call 0xf088 ; 0xf088 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 231aa: 80 ed ldi r24, 0xD0 ; 208 231ac: 9e e0 ldi r25, 0x0E ; 14 231ae: 0e 94 37 78 call 0xf06e ; 0xf06e 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); 231b2: 44 e1 ldi r20, 0x14 ; 20 231b4: 50 e0 ldi r21, 0x00 ; 0 231b6: 67 e3 ldi r22, 0x37 ; 55 231b8: 75 e0 ldi r23, 0x05 ; 5 231ba: ce 01 movw r24, r28 231bc: 01 96 adiw r24, 0x01 ; 1 231be: 0f 94 8f e3 call 0x3c71e ; 0x3c71e 231c2: fe 01 movw r30, r28 231c4: 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'; 231c6: 81 91 ld r24, Z+ 231c8: 87 fd sbrc r24, 7 231ca: 2c c0 rjmp .+88 ; 0x23224 231cc: 80 e3 ldi r24, 0x30 ; 48 231ce: df 01 movw r26, r30 231d0: 11 97 sbiw r26, 0x01 ; 1 231d2: 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++) { 231d4: 8e 89 ldd r24, Y+22 ; 0x16 231d6: 9f 89 ldd r25, Y+23 ; 0x17 231d8: 8e 17 cp r24, r30 231da: 9f 07 cpc r25, r31 231dc: a1 f7 brne .-24 ; 0x231c6 // 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; 231de: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 231e0: 84 e1 ldi r24, 0x14 ; 20 231e2: 9b ea ldi r25, 0xAB ; 171 231e4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 231e8: 8b ea ldi r24, 0xAB ; 171 231ea: 91 e9 ldi r25, 0x91 ; 145 231ec: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 231f0: ce 01 movw r24, r28 231f2: 01 96 adiw r24, 0x01 ; 1 231f4: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 231f8: 8c e4 ldi r24, 0x4C ; 76 231fa: 95 e0 ldi r25, 0x05 ; 5 231fc: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::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()) { 23200: 11 23 and r17, r17 23202: 09 f4 brne .+2 ; 0x23206 23204: 0c cf rjmp .-488 ; 0x2301e // 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 23206: 80 2f mov r24, r16 23208: 0f 94 53 87 call 0x30ea6 ; 0x30ea6 } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 2320c: 00 93 24 13 sts 0x1324, r16 ; 0x801324 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 23210: 80 91 99 13 lds r24, 0x1399 ; 0x801399 23214: 90 91 9a 13 lds r25, 0x139A ; 0x80139a 23218: 01 96 adiw r24, 0x01 ; 1 2321a: 90 93 9a 13 sts 0x139A, r25 ; 0x80139a 2321e: 80 93 99 13 sts 0x1399, r24 ; 0x801399 23222: 13 cf rjmp .-474 ; 0x2304a 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'; 23224: 81 e3 ldi r24, 0x31 ; 49 23226: d3 cf rjmp .-90 ; 0x231ce void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 23228: 8a e2 ldi r24, 0x2A ; 42 2322a: 90 e8 ldi r25, 0x80 ; 128 2322c: 90 93 27 13 sts 0x1327, r25 ; 0x801327 23230: 80 93 26 13 sts 0x1326, r24 ; 0x801326 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 23234: 61 e0 ldi r22, 0x01 ; 1 23236: 81 e0 ldi r24, 0x01 ; 1 23238: 0f 94 20 9f call 0x33e40 ; 0x33e40 2323c: c7 ce rjmp .-626 ; 0x22fcc 0002323e : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 2323e: cf 93 push r28 23240: df 93 push r29 23242: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 23244: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 23248: c8 2f mov r28, r24 2324a: 88 23 and r24, r24 2324c: d9 f0 breq .+54 ; 0x23284 return false; } if (slot != extruder) { 2324e: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 23252: 8d 17 cp r24, r29 23254: b9 f0 breq .+46 ; 0x23284 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(); 23256: 0e 94 27 69 call 0xd24e ; 0xd24e if (/*FindaDetectsFilament()*/ 2325a: 81 11 cpse r24, r1 2325c: 02 c0 rjmp .+4 ; 0x23262 /*!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(); 2325e: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 23262: 0f 94 48 87 call 0x30e90 ; 0x30e90 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23266: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2326a: 10 92 86 17 sts 0x1786, r1 ; 0x801786 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2326e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 23272: 8d 2f mov r24, r29 23274: 0f 94 c7 17 call 0x22f8e ; 0x22f8e #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 23278: 85 e8 ldi r24, 0x85 ; 133 2327a: 97 e1 ldi r25, 0x17 ; 23 2327c: 0e 94 15 76 call 0xec2a ; 0xec2a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 23280: 0f 94 c9 87 call 0x30f92 ; 0x30f92 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 23284: 8c 2f mov r24, r28 23286: df 91 pop r29 23288: cf 91 pop r28 2328a: 08 95 ret 0002328c : { (void)lcd_selftest(); } bool lcd_selftest() { 2328c: cf 92 push r12 2328e: df 92 push r13 23290: ef 92 push r14 23292: ff 92 push r15 23294: 0f 93 push r16 23296: 1f 93 push r17 23298: cf 93 push r28 2329a: df 93 push r29 2329c: 00 d0 rcall .+0 ; 0x2329e 2329e: 1f 92 push r1 232a0: cd b7 in r28, 0x3d ; 61 232a2: 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) { 232a4: 80 91 8e 17 lds r24, 0x178E ; 0x80178e 232a8: 8f 3f cpi r24, 0xFF ; 255 232aa: 31 f4 brne .+12 ; 0x232b8 if (!MMU2::mmu2.Enabled()) { 232ac: 80 91 95 13 lds r24, 0x1395 ; 0x801395 232b0: 81 30 cpi r24, 0x01 ; 1 232b2: 11 f0 breq .+4 ; 0x232b8 lcd_detect_IRsensor(); 232b4: 0f 94 40 14 call 0x22880 ; 0x22880 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(); 232b8: 0f 94 21 44 call 0x28842 ; 0x28842 uint8_t fanSpeedBckp = fanSpeed; 232bc: d0 90 df 03 lds r13, 0x03DF ; 0x8003df fanSpeed = 255; 232c0: 8f ef ldi r24, 0xFF ; 255 232c2: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 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)); 232c6: 89 ee ldi r24, 0xE9 ; 233 232c8: e8 2e mov r14, r24 232ca: 8c e8 ldi r24, 0x8C ; 140 232cc: 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()); 232ce: 03 ee ldi r16, 0xE3 ; 227 232d0: 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)) { 232d2: 20 e0 ldi r18, 0x00 ; 0 232d4: 30 e0 ldi r19, 0x00 ; 0 232d6: 48 e4 ldi r20, 0x48 ; 72 232d8: 52 e4 ldi r21, 0x42 ; 66 232da: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 232de: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 232e2: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 232e6: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 232ea: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 232ee: 18 16 cp r1, r24 232f0: 8c f0 brlt .+34 ; 0x23314 232f2: 20 e0 ldi r18, 0x00 ; 0 232f4: 30 e0 ldi r19, 0x00 ; 0 232f6: 48 e4 ldi r20, 0x48 ; 72 232f8: 52 e4 ldi r21, 0x42 ; 66 232fa: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 232fe: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 23302: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 23306: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 2330a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2330e: 18 16 cp r1, r24 23310: 0c f0 brlt .+2 ; 0x23314 23312: 42 c0 rjmp .+132 ; 0x23398 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 23314: 8f e4 ldi r24, 0x4F ; 79 23316: 9f e3 ldi r25, 0x3F ; 63 23318: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2331c: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 23320: 42 e8 ldi r20, 0x82 ; 130 23322: 64 e0 ldi r22, 0x04 ; 4 23324: 80 e0 ldi r24, 0x00 ; 0 23326: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 2332a: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2332e: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 23332: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 23336: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 2333a: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 2333e: 7f 93 push r23 23340: 6f 93 push r22 23342: ff 92 push r15 23344: ef 92 push r14 23346: 0e 94 ff 6f call 0xdffe ; 0xdffe lcd_putc(LCD_STR_DEGREE[0]); 2334a: 81 e8 ldi r24, 0x81 ; 129 2334c: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 23350: 40 e8 ldi r20, 0x80 ; 128 23352: 64 e0 ldi r22, 0x04 ; 4 23354: 89 e0 ldi r24, 0x09 ; 9 23356: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 2335a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 2335e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 23362: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 23366: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 2336a: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 2336e: 7f 93 push r23 23370: 6f 93 push r22 23372: 1f 93 push r17 23374: 0f 93 push r16 23376: 0e 94 ff 6f call 0xdffe ; 0xdffe lcd_putc(LCD_STR_DEGREE[0]); 2337a: 81 e8 ldi r24, 0x81 ; 129 2337c: 0e 94 15 70 call 0xe02a ; 0xe02a delay_keep_alive(1000); 23380: 88 ee ldi r24, 0xE8 ; 232 23382: 93 e0 ldi r25, 0x03 ; 3 23384: 0e 94 10 8f call 0x11e20 ; 0x11e20 serialecho_temperatures(); 23388: 0e 94 7a 79 call 0xf2f4 ; 0xf2f4 2338c: 0f b6 in r0, 0x3f ; 63 2338e: f8 94 cli 23390: de bf out 0x3e, r29 ; 62 23392: 0f be out 0x3f, r0 ; 63 23394: cd bf out 0x3d, r28 ; 61 23396: 9d cf rjmp .-198 ; 0x232d2 } fanSpeed = fanSpeedBckp; 23398: d0 92 df 03 sts 0x03DF, r13 ; 0x8003df lcd_update_enable(true); 2339c: 81 e0 ldi r24, 0x01 ; 1 2339e: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 233a2: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 233a6: 85 e9 ldi r24, 0x95 ; 149 233a8: 9f e3 ldi r25, 0x3F ; 63 233aa: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 233ae: ac 01 movw r20, r24 233b0: 60 e0 ldi r22, 0x00 ; 0 233b2: 80 e0 ldi r24, 0x00 ; 0 233b4: 0e 94 3a 70 call 0xe074 ; 0xe074 #ifdef TMC2130 FORCE_HIGH_POWER_START; 233b8: 81 e0 ldi r24, 0x01 ; 1 233ba: 0e 94 f6 67 call 0xcfec ; 0xcfec #endif // TMC2130 FORCE_BL_ON_START; 233be: 81 e0 ldi r24, 0x01 ; 1 233c0: 0e 94 05 8c call 0x1180a ; 0x1180a _delay(2000); 233c4: 60 ed ldi r22, 0xD0 ; 208 233c6: 77 e0 ldi r23, 0x07 ; 7 233c8: 80 e0 ldi r24, 0x00 ; 0 233ca: 90 e0 ldi r25, 0x00 ; 0 233cc: 0f 94 5c 3c call 0x278b8 ; 0x278b8 KEEPALIVE_STATE(IN_HANDLER); 233d0: 82 e0 ldi r24, 0x02 ; 2 233d2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 233d6: 00 ed ldi r16, 0xD0 ; 208 233d8: 17 e0 ldi r17, 0x07 ; 7 233da: 21 e0 ldi r18, 0x01 ; 1 233dc: 43 e0 ldi r20, 0x03 ; 3 233de: 60 e0 ldi r22, 0x00 ; 0 233e0: 80 e0 ldi r24, 0x00 ; 0 233e2: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 233e6: 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 233e8: 83 e0 ldi r24, 0x03 ; 3 233ea: 0e 94 62 77 call 0xeec4 ; 0xeec4 lcd_selftest_setfan(0); // print fan off 233ee: 80 e0 ldi r24, 0x00 ; 0 233f0: 0e 94 c9 cf call 0x19f92 ; 0x19f92 lcd_selftest_measure_fans(2, 18, 2); 233f4: 62 e0 ldi r22, 0x02 ; 2 233f6: 82 e0 ldi r24, 0x02 ; 2 233f8: 0e 94 5d d0 call 0x1a0ba ; 0x1a0ba setExtruderAutoFanState(0); // hotend fan off 233fc: 80 e0 ldi r24, 0x00 ; 0 233fe: 0e 94 62 77 call 0xeec4 ; 0xeec4 if (fan_speed[0] < failThr) { 23402: c0 90 ae 04 lds r12, 0x04AE ; 0x8004ae 23406: d0 90 af 04 lds r13, 0x04AF ; 0x8004af 2340a: 94 e1 ldi r25, 0x14 ; 20 2340c: c9 16 cp r12, r25 2340e: d1 04 cpc r13, r1 23410: 5c f1 brlt .+86 ; 0x23468 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 23412: 21 e0 ldi r18, 0x01 ; 1 23414: 43 e0 ldi r20, 0x03 ; 3 23416: 6f 2d mov r22, r15 23418: 81 e0 ldi r24, 0x01 ; 1 2341a: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 2341e: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 23420: 8f ef ldi r24, 0xFF ; 255 23422: 0e 94 c9 cf call 0x19f92 ; 0x19f92 lcd_selftest_measure_fans(5, 18, 3); 23426: 63 e0 ldi r22, 0x03 ; 3 23428: 85 e0 ldi r24, 0x05 ; 5 2342a: 0e 94 5d d0 call 0x1a0ba ; 0x1a0ba lcd_selftest_setfan(0); 2342e: 80 e0 ldi r24, 0x00 ; 0 23430: 0e 94 c9 cf call 0x19f92 ; 0x19f92 if (fan_speed[1] < failThr) { 23434: 80 91 b0 04 lds r24, 0x04B0 ; 0x8004b0 23438: 90 91 b1 04 lds r25, 0x04B1 ; 0x8004b1 2343c: 84 31 cpi r24, 0x14 ; 20 2343e: 91 05 cpc r25, r1 23440: cc f4 brge .+50 ; 0x23474 #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 23442: 61 ef ldi r22, 0xF1 ; 241 23444: 72 e0 ldi r23, 0x02 ; 2 23446: 85 e0 ldi r24, 0x05 ; 5 23448: 0f 94 ec 05 call 0x20bd8 ; 0x20bd8 } } if (_swapped_fan) { 2344c: 96 e4 ldi r25, 0x46 ; 70 2344e: c9 16 cp r12, r25 23450: d1 04 cpc r13, r1 23452: 9c f4 brge .+38 ; 0x2347a { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 23454: 08 e8 ldi r16, 0x88 ; 136 23456: 13 e1 ldi r17, 0x13 ; 19 23458: 21 e0 ldi r18, 0x01 ; 1 2345a: 43 e0 ldi r20, 0x03 ; 3 2345c: 6f 2d mov r22, r15 2345e: 8d e0 ldi r24, 0x0D ; 13 23460: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 23464: e1 2c mov r14, r1 23466: 5d c1 rjmp .+698 ; 0x23722 #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 23468: 61 ef ldi r22, 0xF1 ; 241 2346a: 72 e0 ldi r23, 0x02 ; 2 2346c: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 2346e: 0f 94 ec 05 call 0x20bd8 ; 0x20bd8 23472: f0 cf rjmp .-32 ; 0x23454 lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 23474: 86 34 cpi r24, 0x46 ; 70 23476: 91 05 cpc r25, r1 23478: 54 f4 brge .+20 ; 0x2348e } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 2347a: 60 e0 ldi r22, 0x00 ; 0 2347c: 81 e0 ldi r24, 0x01 ; 1 2347e: 0e 94 cf cf call 0x19f9e ; 0x19f9e if (_result) { 23482: 81 11 cpse r24, r1 23484: 7c c1 rjmp .+760 ; 0x2377e lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 23486: 61 ef ldi r22, 0xF1 ; 241 23488: 72 e0 ldi r23, 0x02 ; 2 2348a: 89 e0 ldi r24, 0x09 ; 9 2348c: f0 cf rjmp .-32 ; 0x2346e { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 2348e: 86 e4 ldi r24, 0x46 ; 70 23490: c8 16 cp r12, r24 23492: d1 04 cpc r13, r1 23494: 94 f7 brge .-28 ; 0x2347a } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 23496: 00 ed ldi r16, 0xD0 ; 208 23498: 17 e0 ldi r17, 0x07 ; 7 2349a: 21 e0 ldi r18, 0x01 ; 1 2349c: 43 e0 ldi r20, 0x03 ; 3 2349e: 6f 2d mov r22, r15 234a0: 82 e0 ldi r24, 0x02 ; 2 234a2: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 234a6: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 234a8: 1c 9b sbis 0x03, 4 ; 3 234aa: 18 c0 rjmp .+48 ; 0x234dc { #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; 234ac: 1c 9b sbis 0x03, 4 ; 3 234ae: 16 c0 rjmp .+44 ; 0x234dc 234b0: 20 e0 ldi r18, 0x00 ; 0 234b2: 30 e0 ldi r19, 0x00 ; 0 234b4: 40 e2 ldi r20, 0x20 ; 32 234b6: 51 e4 ldi r21, 0x41 ; 65 234b8: 60 91 48 07 lds r22, 0x0748 ; 0x800748 234bc: 70 91 49 07 lds r23, 0x0749 ; 0x800749 234c0: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 234c4: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 234c8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 234cc: 60 93 48 07 sts 0x0748, r22 ; 0x800748 234d0: 70 93 49 07 sts 0x0749, r23 ; 0x800749 234d4: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 234d8: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 234dc: 60 e0 ldi r22, 0x00 ; 0 234de: 70 e0 ldi r23, 0x00 ; 0 234e0: 84 e3 ldi r24, 0x34 ; 52 234e2: 92 e4 ldi r25, 0x42 ; 66 234e4: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 234e8: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 if ( 234ec: 1c 9b sbis 0x03, 4 ; 3 234ee: 51 c1 rjmp .+674 ; 0x23792 ((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] = ""; 234f0: 1a 82 std Y+2, r1 ; 0x02 234f2: 19 82 std Y+1, r1 ; 0x01 234f4: 1c 82 std Y+4, r1 ; 0x04 234f6: 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"); 234f8: 1c 9b sbis 0x03, 4 ; 3 234fa: 06 c0 rjmp .+12 ; 0x23508 234fc: 66 ef ldi r22, 0xF6 ; 246 234fe: 72 e0 ldi r23, 0x02 ; 2 23500: ce 01 movw r24, r28 23502: 01 96 adiw r24, 0x01 ; 1 23504: 0f 94 5b e3 call 0x3c6b6 ; 0x3c6b6 lcd_selftest_error(TestError::Endstops, _error, ""); 23508: be 01 movw r22, r28 2350a: 6f 5f subi r22, 0xFF ; 255 2350c: 7f 4f sbci r23, 0xFF ; 255 2350e: 82 e0 ldi r24, 0x02 ; 2 23510: 0f 94 ec 05 call 0x20bd8 ; 0x20bd8 ((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; 23514: 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(); 23516: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 2351a: 81 e0 ldi r24, 0x01 ; 1 2351c: 0e 94 6b 8c call 0x118d6 ; 0x118d6 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 23520: 11 23 and r17, r17 23522: 09 f4 brne .+2 ; 0x23526 23524: 97 cf rjmp .-210 ; 0x23454 { //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); 23526: 00 ed ldi r16, 0xD0 ; 208 23528: 17 e0 ldi r17, 0x07 ; 7 2352a: 21 e0 ldi r18, 0x01 ; 1 2352c: 43 e0 ldi r20, 0x03 ; 3 2352e: 6f 2d mov r22, r15 23530: 84 e0 ldi r24, 0x04 ; 4 23532: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 23536: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 23538: 80 e0 ldi r24, 0x00 ; 0 2353a: 0f 94 01 08 call 0x21002 ; 0x21002 } if (_result) 2353e: 88 23 and r24, r24 23540: 09 f4 brne .+2 ; 0x23544 23542: 88 cf rjmp .-240 ; 0x23454 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 23544: 10 e0 ldi r17, 0x00 ; 0 23546: 00 e0 ldi r16, 0x00 ; 0 23548: 21 e0 ldi r18, 0x01 ; 1 2354a: 43 e0 ldi r20, 0x03 ; 3 2354c: 6f 2d mov r22, r15 2354e: 84 e0 ldi r24, 0x04 ; 4 23550: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 23554: 0c ed ldi r16, 0xDC ; 220 23556: 15 e0 ldi r17, 0x05 ; 5 23558: 21 e0 ldi r18, 0x01 ; 1 2355a: 43 e0 ldi r20, 0x03 ; 3 2355c: 68 2f mov r22, r24 2355e: 85 e0 ldi r24, 0x05 ; 5 23560: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 23564: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 23566: 81 e0 ldi r24, 0x01 ; 1 23568: 0f 94 01 08 call 0x21002 ; 0x21002 #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 2356c: 88 23 and r24, r24 2356e: 09 f4 brne .+2 ; 0x23572 23570: 71 cf rjmp .-286 ; 0x23454 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 23572: 10 e0 ldi r17, 0x00 ; 0 23574: 00 e0 ldi r16, 0x00 ; 0 23576: 21 e0 ldi r18, 0x01 ; 1 23578: 43 e0 ldi r20, 0x03 ; 3 2357a: 6f 2d mov r22, r15 2357c: 86 e0 ldi r24, 0x06 ; 6 2357e: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 23582: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 23584: 0f 94 2e 3a call 0x2745c ; 0x2745c 23588: 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); 2358c: ed e3 ldi r30, 0x3D ; 61 2358e: f3 e9 ldi r31, 0x93 ; 147 23590: 85 91 lpm r24, Z+ 23592: 95 91 lpm r25, Z+ 23594: a5 91 lpm r26, Z+ 23596: b4 91 lpm r27, Z 23598: 80 93 40 07 sts 0x0740, r24 ; 0x800740 2359c: 90 93 41 07 sts 0x0741, r25 ; 0x800741 235a0: a0 93 42 07 sts 0x0742, r26 ; 0x800742 235a4: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 235a8: e1 e4 ldi r30, 0x41 ; 65 235aa: f3 e9 ldi r31, 0x93 ; 147 235ac: 65 91 lpm r22, Z+ 235ae: 75 91 lpm r23, Z+ 235b0: 85 91 lpm r24, Z+ 235b2: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 235b4: 20 e0 ldi r18, 0x00 ; 0 235b6: 30 e0 ldi r19, 0x00 ; 0 235b8: 40 e8 ldi r20, 0x80 ; 128 235ba: 50 e4 ldi r21, 0x40 ; 64 235bc: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 235c0: 60 93 44 07 sts 0x0744, r22 ; 0x800744 235c4: 70 93 45 07 sts 0x0745, r23 ; 0x800745 235c8: 80 93 46 07 sts 0x0746, r24 ; 0x800746 235cc: 90 93 47 07 sts 0x0747, r25 ; 0x800747 #endif //TMC2130 raise_z(10); 235d0: 60 e0 ldi r22, 0x00 ; 0 235d2: 70 e0 ldi r23, 0x00 ; 0 235d4: 80 e2 ldi r24, 0x20 ; 32 235d6: 91 e4 ldi r25, 0x41 ; 65 235d8: 0e 94 27 6f call 0xde4e ; 0xde4e set_destination_to_current(); 235dc: 0e 94 80 69 call 0xd300 ; 0xd300 _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 235e0: 0c ed ldi r16, 0xDC ; 220 235e2: 15 e0 ldi r17, 0x05 ; 5 235e4: 21 e0 ldi r18, 0x01 ; 1 235e6: 43 e0 ldi r20, 0x03 ; 3 235e8: 6f 2d mov r22, r15 235ea: 86 e0 ldi r24, 0x06 ; 6 235ec: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 235f0: 50 e0 ldi r21, 0x00 ; 0 235f2: 40 e0 ldi r20, 0x00 ; 0 235f4: 61 e0 ldi r22, 0x01 ; 1 235f6: 82 e0 ldi r24, 0x02 ; 2 235f8: 0e 94 87 7c call 0xf90e ; 0xf90e #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); 235fc: 60 e0 ldi r22, 0x00 ; 0 235fe: 70 e0 ldi r23, 0x00 ; 0 23600: 80 ea ldi r24, 0xA0 ; 160 23602: 91 e4 ldi r25, 0x41 ; 65 23604: 0e 94 27 6f call 0xde4e ; 0xde4e } #ifdef TMC2130 if (_result) { raise_z(10); 23608: 60 e0 ldi r22, 0x00 ; 0 2360a: 70 e0 ldi r23, 0x00 ; 0 2360c: 80 e2 ldi r24, 0x20 ; 32 2360e: 91 e4 ldi r25, 0x41 ; 65 23610: 0e 94 27 6f call 0xde4e ; 0xde4e _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 23614: 10 e0 ldi r17, 0x00 ; 0 23616: 00 e0 ldi r16, 0x00 ; 0 23618: 21 e0 ldi r18, 0x01 ; 1 2361a: 42 e0 ldi r20, 0x02 ; 2 2361c: 60 e0 ldi r22, 0x00 ; 0 2361e: 8e e0 ldi r24, 0x0E ; 14 23620: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 bool bres = tmc2130_home_calibrate(X_AXIS); 23624: 80 e0 ldi r24, 0x00 ; 0 23626: 0f 94 20 37 call 0x26e40 ; 0x26e40 2362a: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 2362c: 21 e0 ldi r18, 0x01 ; 1 2362e: 42 e0 ldi r20, 0x02 ; 2 23630: 61 e0 ldi r22, 0x01 ; 1 23632: 8e e0 ldi r24, 0x0E ; 14 23634: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 bres &= tmc2130_home_calibrate(Y_AXIS); 23638: 81 e0 ldi r24, 0x01 ; 1 2363a: 0f 94 20 37 call 0x26e40 ; 0x26e40 2363e: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 23640: 21 e0 ldi r18, 0x01 ; 1 23642: 42 e0 ldi r20, 0x02 ; 2 23644: 62 e0 ldi r22, 0x02 ; 2 23646: 8e e0 ldi r24, 0x0E ; 14 23648: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 2364c: f8 2e mov r15, r24 if (bres) 2364e: ee 20 and r14, r14 23650: 09 f4 brne .+2 ; 0x23654 23652: 00 cf rjmp .-512 ; 0x23454 23654: 61 e0 ldi r22, 0x01 ; 1 23656: 88 ef ldi r24, 0xF8 ; 248 23658: 9e e0 ldi r25, 0x0E ; 14 2365a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 2365e: 00 ed ldi r16, 0xD0 ; 208 23660: 17 e0 ldi r17, 0x07 ; 7 23662: 21 e0 ldi r18, 0x01 ; 1 23664: 43 e0 ldi r20, 0x03 ; 3 23666: 6f 2d mov r22, r15 23668: 87 e0 ldi r24, 0x07 ; 7 2366a: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 2366e: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 23670: 81 e0 ldi r24, 0x01 ; 1 23672: 0f 94 03 07 call 0x20e06 ; 0x20e06 } if (_result) 23676: 88 23 and r24, r24 23678: 09 f4 brne .+2 ; 0x2367c 2367a: ec ce rjmp .-552 ; 0x23454 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 2367c: 08 ee ldi r16, 0xE8 ; 232 2367e: 13 e0 ldi r17, 0x03 ; 3 23680: 21 e0 ldi r18, 0x01 ; 1 23682: 43 e0 ldi r20, 0x03 ; 3 23684: 6f 2d mov r22, r15 23686: 88 e0 ldi r24, 0x08 ; 8 23688: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 2368c: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 2368e: 80 e0 ldi r24, 0x00 ; 0 23690: 0f 94 03 07 call 0x20e06 ; 0x20e06 23694: e8 2e mov r14, r24 } if (_result) 23696: 88 23 and r24, r24 23698: 09 f4 brne .+2 ; 0x2369c 2369a: dc ce rjmp .-584 ; 0x23454 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 2369c: 00 ed ldi r16, 0xD0 ; 208 2369e: 17 e0 ldi r17, 0x07 ; 7 236a0: 21 e0 ldi r18, 0x01 ; 1 236a2: 43 e0 ldi r20, 0x03 ; 3 236a4: 6f 2d mov r22, r15 236a6: 89 e0 ldi r24, 0x09 ; 9 236a8: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 236ac: 90 91 95 13 lds r25, 0x1395 ; 0x801395 236b0: 91 30 cpi r25, 0x01 ; 1 236b2: 79 f5 brne .+94 ; 0x23712 { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 236b4: 21 e0 ldi r18, 0x01 ; 1 236b6: 43 e0 ldi r20, 0x03 ; 3 236b8: 68 2f mov r22, r24 236ba: 8a e0 ldi r24, 0x0A ; 10 236bc: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 236c0: 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); 236c2: 84 e7 ldi r24, 0x74 ; 116 236c4: 9f e3 ldi r25, 0x3F ; 63 236c6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 236ca: 70 e0 ldi r23, 0x00 ; 0 236cc: 60 e0 ldi r22, 0x00 ; 0 236ce: 0e 94 ed d8 call 0x1b1da ; 0x1b1da 236d2: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 236d4: 10 e0 ldi r17, 0x00 ; 0 236d6: 00 e0 ldi r16, 0x00 ; 0 236d8: 21 e0 ldi r18, 0x01 ; 1 236da: 41 e0 ldi r20, 0x01 ; 1 236dc: 60 e0 ldi r22, 0x00 ; 0 236de: 8a e0 ldi r24, 0x0A ; 10 236e0: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 236e4: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 236e8: 10 92 6b 02 sts 0x026B, r1 ; 0x80026b // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 236ec: 8d 2d mov r24, r13 236ee: 0f 94 1f 19 call 0x2323e ; 0x2323e MMU2::mmu2.unload(); //Unload filament 236f2: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 236f6: 8f ea ldi r24, 0xAF ; 175 236f8: 90 e0 ldi r25, 0x00 ; 0 236fa: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 236fe: 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 23702: 00 ed ldi r16, 0xD0 ; 208 23704: 17 e0 ldi r17, 0x07 ; 7 23706: 21 e0 ldi r18, 0x01 ; 1 23708: 43 e0 ldi r20, 0x03 ; 3 2370a: 6f 2d mov r22, r15 2370c: 8b e0 ldi r24, 0x0B ; 11 2370e: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 23712: 08 e8 ldi r16, 0x88 ; 136 23714: 13 e1 ldi r17, 0x13 ; 19 23716: 21 e0 ldi r18, 0x01 ; 1 23718: 43 e0 ldi r20, 0x03 ; 3 2371a: 68 2f mov r22, r24 2371c: 8c e0 ldi r24, 0x0C ; 12 2371e: 0e 94 e2 d4 call 0x1a9c4 ; 0x1a9c4 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 23722: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 23726: 61 e0 ldi r22, 0x01 ; 1 23728: 82 ef ldi r24, 0xF2 ; 242 2372a: 9c e6 ldi r25, 0x6C ; 108 2372c: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_update_enable(true); 23730: 81 e0 ldi r24, 0x01 ; 1 23732: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 if (_result) 23736: ee 20 and r14, r14 23738: 71 f1 breq .+92 ; 0x23796 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 2373a: 81 e0 ldi r24, 0x01 ; 1 2373c: 0e 94 5c e6 call 0x1ccb8 ; 0x1ccb8 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 23740: 87 e8 ldi r24, 0x87 ; 135 23742: 9f e3 ldi r25, 0x3F ; 63 23744: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 23748: 0f 94 e0 0a call 0x215c0 ; 0x215c0 lcd_return_to_status(); 2374c: 0f 94 1d 26 call 0x24c3a ; 0x24c3a else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 23750: 80 e0 ldi r24, 0x00 ; 0 23752: 0e 94 f6 67 call 0xcfec ; 0xcfec #endif // TMC2130 FORCE_BL_ON_END; 23756: 80 e0 ldi r24, 0x00 ; 0 23758: 0e 94 05 8c call 0x1180a ; 0x1180a KEEPALIVE_STATE(NOT_BUSY); 2375c: 81 e0 ldi r24, 0x01 ; 1 2375e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(_result); } 23762: 8e 2d mov r24, r14 23764: 0f 90 pop r0 23766: 0f 90 pop r0 23768: 0f 90 pop r0 2376a: 0f 90 pop r0 2376c: df 91 pop r29 2376e: cf 91 pop r28 23770: 1f 91 pop r17 23772: 0f 91 pop r16 23774: ff 90 pop r15 23776: ef 90 pop r14 23778: df 90 pop r13 2377a: cf 90 pop r12 2377c: 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); 2377e: 61 e0 ldi r22, 0x01 ; 1 23780: 80 e0 ldi r24, 0x00 ; 0 23782: 0e 94 cf cf call 0x19f9e ; 0x19f9e if (!_result){ 23786: 81 11 cpse r24, r1 23788: 86 ce rjmp .-756 ; 0x23496 lcd_selftest_error(TestError::PrintFan, "", ""); 2378a: 61 ef ldi r22, 0xF1 ; 241 2378c: 72 e0 ldi r23, 0x02 ; 2 2378e: 85 e0 ldi r24, 0x05 ; 5 23790: 6e ce rjmp .-804 ; 0x2346e #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 23792: 11 e0 ldi r17, 0x01 ; 1 23794: c0 ce rjmp .-640 ; 0x23516 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 23796: 8d ea ldi r24, 0xAD ; 173 23798: 94 e4 ldi r25, 0x44 ; 68 2379a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2379e: 62 e0 ldi r22, 0x02 ; 2 237a0: 0f 94 bd 05 call 0x20b7a ; 0x20b7a 237a4: d5 cf rjmp .-86 ; 0x23750 000237a6 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 237a6: 0d 94 46 19 jmp 0x2328c ; 0x2328c 000237aa : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 237aa: cf 93 push r28 237ac: 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); 237ae: 8c e1 ldi r24, 0x1C ; 28 237b0: 9b e3 ldi r25, 0x3B ; 59 237b2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 237b6: 6c 2f mov r22, r28 237b8: 0f 94 cf c1 call 0x3839e ; 0x3839e return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 237bc: 8c 2f mov r24, r28 237be: 0f 94 1f 19 call 0x2323e ; 0x2323e 237c2: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 planner_synchronize(); unload(); 237c6: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 ScreenUpdateEnable(); 237ca: 0f 94 cc c1 call 0x38398 ; 0x38398 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 237ce: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 237d0: 0d 94 be 35 jmp 0x26b7c ; 0x26b7c 000237d4 : 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(){ 237d4: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 237d6: c0 e0 ldi r28, 0x00 ; 0 237d8: 8c e1 ldi r24, 0x1C ; 28 237da: 9b e3 ldi r25, 0x3B ; 59 237dc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 237e0: 6c 2f mov r22, r28 237e2: 0f 94 cf c1 call 0x3839e ; 0x3839e return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 237e6: 8c 2f mov r24, r28 237e8: 0f 94 1f 19 call 0x2323e ; 0x2323e 237ec: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 planner_synchronize(); unload(); 237f0: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 ScreenUpdateEnable(); 237f4: 0f 94 cc c1 call 0x38398 ; 0x38398 237f8: cf 5f subi r28, 0xFF ; 255 237fa: c5 30 cpi r28, 0x05 ; 5 237fc: 69 f7 brne .-38 ; 0x237d8 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 237fe: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 23800: 0d 94 be 35 jmp 0x26b7c ; 0x26b7c 00023804 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 23804: cf 93 push r28 23806: df 93 push r29 23808: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 2380a: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 2380e: c8 2f mov r28, r24 23810: 88 23 and r24, r24 23812: 69 f1 breq .+90 ; 0x2386e safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 23814: 88 ec ldi r24, 0xC8 ; 200 23816: 90 e0 ldi r25, 0x00 ; 0 23818: 0f 94 2b c6 call 0x38c56 ; 0x38c56 (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); 2381c: 82 e0 ldi r24, 0x02 ; 2 2381e: 0f 94 2e 63 call 0x2c65c ; 0x2c65c void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 23822: 82 e7 ldi r24, 0x72 ; 114 23824: 9d e5 ldi r25, 0x5D ; 93 23826: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2382a: 6d 2f mov r22, r29 2382c: 0f 94 cf c1 call 0x3839e ; 0x3839e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 23830: 0f 94 48 87 call 0x30e90 ; 0x30e90 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23834: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 23838: 10 92 86 17 sts 0x1786, r1 ; 0x801786 { // 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 2383c: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 23840: 83 36 cpi r24, 0x63 ; 99 23842: 29 f0 breq .+10 ; 0x2384e return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 23844: 62 e1 ldi r22, 0x12 ; 18 23846: 81 e9 ldi r24, 0x91 ; 145 23848: 96 ea ldi r25, 0xA6 ; 166 2384a: 0f 94 ab 87 call 0x30f56 ; 0x30f56 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 2384e: 8d 2f mov r24, r29 23850: 0f 94 c7 17 call 0x22f8e ; 0x22f8e // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 23854: 0e 94 90 d0 call 0x1a120 ; 0x1a120 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); 23858: 83 e0 ldi r24, 0x03 ; 3 2385a: 0f 94 2e 63 call 0x2c65c ; 0x2c65c #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 2385e: 85 e8 ldi r24, 0x85 ; 133 23860: 97 e1 ldi r25, 0x17 ; 23 23862: 0e 94 15 76 call 0xec2a ; 0xec2a explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 23866: 0f 94 c9 87 call 0x30f92 ; 0x30f92 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 2386a: 0f 94 cc c1 call 0x38398 ; 0x38398 return true; } 2386e: 8c 2f mov r24, r28 23870: df 91 pop r29 23872: cf 91 pop r28 23874: 08 95 ret 00023876 : /// 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) { 23876: 1f 93 push r17 23878: cf 93 push r28 2387a: df 93 push r29 2387c: c8 2f mov r28, r24 2387e: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 23880: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 23884: d8 2f mov r29, r24 23886: 88 23 and r24, r24 23888: a9 f0 breq .+42 ; 0x238b4 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 2388a: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2388e: 10 92 86 17 sts 0x1786, r1 ; 0x801786 return false; } FSensorBlockRunout blockRunout; switch (code) { 23892: c3 36 cpi r28, 0x63 ; 99 23894: 11 f1 breq .+68 ; 0x238da 23896: c8 37 cpi r28, 0x78 ; 120 23898: 91 f0 breq .+36 ; 0x238be 2389a: cf 33 cpi r28, 0x3F ; 63 2389c: 39 f4 brne .+14 ; 0x238ac case '?': { waitForHotendTargetTemp(100, [] {}); 2389e: 84 e6 ldi r24, 0x64 ; 100 238a0: 90 e0 ldi r25, 0x00 ; 0 238a2: 0f 94 2b c6 call 0x38c56 ; 0x38c56 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> load_filament_to_nozzle(slot); 238a6: 81 2f mov r24, r17 238a8: 0f 94 02 1c call 0x23804 ; 0x23804 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 238ac: 85 e8 ldi r24, 0x85 ; 133 238ae: 97 e1 ldi r25, 0x17 ; 23 238b0: 0e 94 15 76 call 0xec2a ; 0xec2a execute_load_to_nozzle_sequence(); } break; } return true; } 238b4: 8d 2f mov r24, r29 238b6: df 91 pop r29 238b8: cf 91 pop r28 238ba: 1f 91 pop r17 238bc: 08 95 ret 238be: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 238c2: 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); 238c6: 81 2f mov r24, r17 238c8: 0f 94 1f 19 call 0x2323e ; 0x2323e 238cc: 8f ea ldi r24, 0xAF ; 175 238ce: 90 e0 ldi r25, 0x00 ; 0 238d0: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 238d4: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 238d8: e9 cf rjmp .-46 ; 0x238ac thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 238da: 84 e6 ldi r24, 0x64 ; 100 238dc: 90 e0 ldi r25, 0x00 ; 0 238de: 0f 94 2b c6 call 0x38c56 ; 0x38c56 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> execute_load_to_nozzle_sequence(); 238e2: 0e 94 90 d0 call 0x1a120 ; 0x1a120 238e6: e2 cf rjmp .-60 ; 0x238ac 000238e8 : 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); 238e8: 0f 94 02 1c call 0x23804 ; 0x23804 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 238ec: 0e 94 d9 65 call 0xcbb2 ; 0xcbb2 st_synchronize(); 238f0: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // Ask user if the extruded color is correct: lcd_return_to_status(); 238f4: 0f 94 1d 26 call 0x24c3a ; 0x24c3a lcd_load_filament_color_check(); 238f8: 0f 94 3d 67 call 0x2ce7a ; 0x2ce7a lcd_setstatuspgm(MSG_WELCOME); 238fc: 81 e5 ldi r24, 0x51 ; 81 238fe: 91 e7 ldi r25, 0x71 ; 113 23900: 0f 94 e0 0a call 0x215c0 ; 0x215c0 custom_message_type = CustomMsg::Status; 23904: 10 92 72 07 sts 0x0772, r1 ; 0x800772 // Clear the filament action clearFilamentAction(); 23908: 0d 94 be 35 jmp 0x26b7c ; 0x26b7c 0002390c : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 2390c: cf 93 push r28 2390e: df 93 push r29 23910: 00 d0 rcall .+0 ; 0x23912 23912: 1f 92 push r1 23914: 1f 92 push r1 23916: cd b7 in r28, 0x3d ; 61 23918: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 2391a: 48 2f mov r20, r24 2391c: 68 e5 ldi r22, 0x58 ; 88 2391e: ce 01 movw r24, r28 23920: 01 96 adiw r24, 0x01 ; 1 23922: 0f 94 8a c2 call 0x38514 ; 0x38514 23926: 49 81 ldd r20, Y+1 ; 0x01 23928: 5a 81 ldd r21, Y+2 ; 0x02 2392a: 6b 81 ldd r22, Y+3 ; 0x03 2392c: 7c 81 ldd r23, Y+4 ; 0x04 2392e: 8d 81 ldd r24, Y+5 ; 0x05 23930: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 } 23934: 0f 90 pop r0 23936: 0f 90 pop r0 23938: 0f 90 pop r0 2393a: 0f 90 pop r0 2393c: 0f 90 pop r0 2393e: df 91 pop r29 23940: cf 91 pop r28 23942: 08 95 ret 00023944 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 23944: 1f 93 push r17 23946: cf 93 push r28 23948: df 93 push r29 2394a: 00 d0 rcall .+0 ; 0x2394c 2394c: 1f 92 push r1 2394e: 1f 92 push r1 23950: cd b7 in r28, 0x3d ; 61 23952: de b7 in r29, 0x3e ; 62 23954: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 23956: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 2395a: 88 23 and r24, r24 2395c: d9 f0 breq .+54 ; 0x23994 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 2395e: 41 2f mov r20, r17 23960: 62 e5 ldi r22, 0x52 ; 82 23962: ce 01 movw r24, r28 23964: 01 96 adiw r24, 0x01 ; 1 23966: 0f 94 8a c2 call 0x38514 ; 0x38514 2396a: 49 81 ldd r20, Y+1 ; 0x01 2396c: 5a 81 ldd r21, Y+2 ; 0x02 2396e: 6b 81 ldd r22, Y+3 ; 0x03 23970: 7c 81 ldd r23, Y+4 ; 0x04 23972: 8d 81 ldd r24, Y+5 ; 0x05 23974: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 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)); 23978: 60 e0 ldi r22, 0x00 ; 0 2397a: 80 e0 ldi r24, 0x00 ; 0 2397c: 0f 94 20 9f call 0x33e40 ; 0x33e40 23980: 88 23 and r24, r24 23982: 69 f3 breq .-38 ; 0x2395e // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 23984: 20 91 41 13 lds r18, 0x1341 ; 0x801341 23988: 30 91 42 13 lds r19, 0x1342 ; 0x801342 2398c: 30 93 92 13 sts 0x1392, r19 ; 0x801392 23990: 20 93 91 13 sts 0x1391, r18 ; 0x801391 return true; } 23994: 0f 90 pop r0 23996: 0f 90 pop r0 23998: 0f 90 pop r0 2399a: 0f 90 pop r0 2399c: 0f 90 pop r0 2399e: df 91 pop r29 239a0: cf 91 pop r28 239a2: 1f 91 pop r17 239a4: 08 95 ret 000239a6 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 239a6: ff 92 push r15 239a8: 0f 93 push r16 239aa: 1f 93 push r17 239ac: cf 93 push r28 239ae: df 93 push r29 239b0: 1f 92 push r1 239b2: cd b7 in r28, 0x3d ; 61 239b4: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 239b6: ce 01 movw r24, r28 239b8: 01 96 adiw r24, 0x01 ; 1 239ba: 0f 94 a8 46 call 0x28d50 ; 0x28d50 uint16_t pos = 0; 239be: 10 e0 ldi r17, 0x00 ; 0 239c0: 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]; 239c2: 85 e0 ldi r24, 0x05 ; 5 239c4: 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()) { 239c6: d1 99 sbic 0x1a, 1 ; 26 239c8: 11 c0 rjmp .+34 ; 0x239ec // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 239ca: 0f 94 66 4d call 0x29acc ; 0x29acc static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 239ce: 0e 3d cpi r16, 0xDE ; 222 239d0: 11 05 cpc r17, r1 239d2: c9 f7 brne .-14 ; 0x239c6 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 239d4: ce 01 movw r24, r28 239d6: 01 96 adiw r24, 0x01 ; 1 239d8: 0f 94 9b 46 call 0x28d36 ; 0x28d36 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 239dc: c8 01 movw r24, r16 239de: 0f 90 pop r0 239e0: df 91 pop r29 239e2: cf 91 pop r28 239e4: 1f 91 pop r17 239e6: 0f 91 pop r16 239e8: ff 90 pop r15 239ea: 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(); 239ec: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 239ee: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.469> 239f2: 88 23 and r24, r24 239f4: 61 f3 breq .-40 ; 0x239ce adc_values_ready = false; 239f6: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.469> adc_start_cycle(); 239fa: 0e 94 0d 90 call 0x1201a ; 0x1201a temp_mgr_isr(); 239fe: 0f 94 c3 4a call 0x29586 ; 0x29586 // stop recording for an hard error condition if(temp_error_state.v) 23a02: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 23a06: 81 11 cpse r24, r1 23a08: 1b c0 rjmp .+54 ; 0x23a40 return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 23a0a: f0 9e mul r15, r16 23a0c: f0 01 movw r30, r0 23a0e: f1 9e mul r15, r17 23a10: f0 0d add r31, r0 23a12: 11 24 eor r1, r1 23a14: ed 58 subi r30, 0x8D ; 141 23a16: f8 4f sbci r31, 0xF8 ; 248 entry.temp = current_temperature_isr[0]; 23a18: 80 91 17 05 lds r24, 0x0517 ; 0x800517 23a1c: 90 91 18 05 lds r25, 0x0518 ; 0x800518 23a20: a0 91 19 05 lds r26, 0x0519 ; 0x800519 23a24: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 23a28: 80 83 st Z, r24 23a2a: 91 83 std Z+1, r25 ; 0x01 23a2c: a2 83 std Z+2, r26 ; 0x02 23a2e: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 23a30: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 23a34: 84 83 std Z+4, r24 ; 0x04 ++pos; 23a36: 0f 5f subi r16, 0xFF ; 255 23a38: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 23a3a: 0f 94 8e 4f call 0x29f1c ; 0x29f1c 23a3e: c7 cf rjmp .-114 ; 0x239ce adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 23a40: 10 e0 ldi r17, 0x00 ; 0 23a42: 00 e0 ldi r16, 0x00 ; 0 23a44: c7 cf rjmp .-114 ; 0x239d4 00023a46 : 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) { 23a46: fc 01 movw r30, r24 switch(*oCheckSetting) { 23a48: 80 81 ld r24, Z 23a4a: 88 23 and r24, r24 23a4c: 21 f0 breq .+8 ; 0x23a56 23a4e: 81 30 cpi r24, 0x01 ; 1 23a50: 29 f4 brne .+10 ; 0x23a5c case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23a52: 82 e0 ldi r24, 0x02 ; 2 23a54: 01 c0 rjmp .+2 ; 0x23a58 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 23a56: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23a58: 80 83 st Z, r24 23a5a: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 23a5c: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 23a5e: 08 95 ret 00023a60 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 23a60: fc 01 movw r30, r24 23a62: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 23a64: 90 32 cpi r25, 0x20 ; 32 23a66: 49 f0 breq .+18 ; 0x23a7a 23a68: 87 ef ldi r24, 0xF7 ; 247 23a6a: 89 0f add r24, r25 23a6c: 82 30 cpi r24, 0x02 ; 2 23a6e: 28 f0 brcs .+10 ; 0x23a7a 23a70: 81 e0 ldi r24, 0x01 ; 1 23a72: 9d 30 cpi r25, 0x0D ; 13 23a74: 19 f0 breq .+6 ; 0x23a7c 23a76: 80 e0 ldi r24, 0x00 ; 0 23a78: 08 95 ret 23a7a: 81 e0 ldi r24, 0x01 ; 1 } 23a7c: 08 95 ret 00023a7e : 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; 23a7e: 88 3e cpi r24, 0xE8 ; 232 23a80: 23 e0 ldi r18, 0x03 ; 3 23a82: 92 07 cpc r25, r18 23a84: 10 f0 brcs .+4 ; 0x23a8a 23a86: 87 ee ldi r24, 0xE7 ; 231 23a88: 93 e0 ldi r25, 0x03 ; 3 } 23a8a: 08 95 ret 00023a8c : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 23a8c: 90 91 21 05 lds r25, 0x0521 ; 0x800521 23a90: 80 91 20 05 lds r24, 0x0520 ; 0x800520 23a94: 2f ef ldi r18, 0xFF ; 255 23a96: 3f ef ldi r19, 0xFF ; 255 23a98: 89 17 cp r24, r25 23a9a: 71 f0 breq .+28 ; 0x23ab8 _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 23a9c: e9 2f mov r30, r25 23a9e: f0 e0 ldi r31, 0x00 ; 0 23aa0: ed 5d subi r30, 0xDD ; 221 23aa2: fa 4f sbci r31, 0xFA ; 250 23aa4: 20 81 ld r18, Z 23aa6: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 23aa8: 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 23aaa: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 23aae: 98 17 cp r25, r24 23ab0: 08 f0 brcs .+2 ; 0x23ab4 23ab2: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 23ab4: 90 93 21 05 sts 0x0521, r25 ; 0x800521 return rbuf_get(uart2_ibuf); } 23ab8: c9 01 movw r24, r18 23aba: 08 95 ret 00023abc : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 23abc: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 23ac0: 95 ff sbrs r25, 5 23ac2: fc cf rjmp .-8 ; 0x23abc UDR2 = c; // transmit byte 23ac4: 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; } 23ac8: 90 e0 ldi r25, 0x00 ; 0 23aca: 80 e0 ldi r24, 0x00 ; 0 23acc: 08 95 ret 00023ace : } 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) { 23ace: cf 92 push r12 23ad0: df 92 push r13 23ad2: ef 92 push r14 23ad4: ff 92 push r15 23ad6: 0f 93 push r16 23ad8: 1f 93 push r17 23ada: cf 93 push r28 23adc: df 93 push r29 23ade: 8c 01 movw r16, r24 23ae0: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23ae2: 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; 23ae4: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 23ae6: 61 50 subi r22, 0x01 ; 1 23ae8: 77 0b sbc r23, r23 23aea: 29 2f mov r18, r25 23aec: 30 e0 ldi r19, 0x00 ; 0 23aee: 26 17 cp r18, r22 23af0: 37 07 cpc r19, r23 23af2: 2c f0 brlt .+10 ; 0x23afe } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 23af4: 55 23 and r21, r21 23af6: 19 f1 breq .+70 ; 0x23b3e { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23af8: 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; 23afa: 50 e0 ldi r21, 0x00 ; 0 23afc: f6 cf rjmp .-20 ; 0x23aea for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 23afe: 78 01 movw r14, r16 23b00: e2 0e add r14, r18 23b02: f3 1e adc r15, r19 23b04: f7 01 movw r30, r14 23b06: 80 81 ld r24, Z 23b08: d9 01 movw r26, r18 23b0a: 11 96 adiw r26, 0x01 ; 1 23b0c: 68 01 movw r12, r16 23b0e: ca 0e add r12, r26 23b10: db 1e adc r13, r27 23b12: f6 01 movw r30, r12 23b14: 40 81 ld r20, Z 23b16: 48 17 cp r20, r24 23b18: 80 f4 brcc .+32 ; 0x23b3a { uint8_t d = data[i]; data[i] = data[i+1]; 23b1a: f7 01 movw r30, r14 23b1c: 40 83 st Z, r20 data[i+1] = d; 23b1e: f6 01 movw r30, r12 23b20: 80 83 st Z, r24 if (data2) 23b22: 20 97 sbiw r28, 0x00 ; 0 23b24: 49 f0 breq .+18 ; 0x23b38 { d = data2[i]; 23b26: fe 01 movw r30, r28 23b28: e2 0f add r30, r18 23b2a: f3 1f adc r31, r19 23b2c: 80 81 ld r24, Z data2[i] = data2[i+1]; 23b2e: ac 0f add r26, r28 23b30: bd 1f adc r27, r29 23b32: 2c 91 ld r18, X 23b34: 20 83 st Z, r18 data2[i+1] = d; 23b36: 8c 93 st X, r24 } changed = 1; 23b38: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23b3a: 9f 5f subi r25, 0xFF ; 255 23b3c: d6 cf rjmp .-84 ; 0x23aea data2[i+1] = d; } changed = 1; } } } 23b3e: df 91 pop r29 23b40: cf 91 pop r28 23b42: 1f 91 pop r17 23b44: 0f 91 pop r16 23b46: ff 90 pop r15 23b48: ef 90 pop r14 23b4a: df 90 pop r13 23b4c: cf 90 pop r12 23b4e: 08 95 ret 00023b50 : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 23b50: 81 30 cpi r24, 0x01 ; 1 23b52: 41 f0 breq .+16 ; 0x23b64 23b54: 28 f0 brcs .+10 ; 0x23b60 23b56: 82 30 cpi r24, 0x02 ; 2 23b58: 39 f0 breq .+14 ; 0x23b68 23b5a: 83 30 cpi r24, 0x03 ; 3 23b5c: 71 f0 breq .+28 ; 0x23b7a 23b5e: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 23b60: a0 9a sbi 0x14, 0 ; 20 23b62: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 23b64: a2 9a sbi 0x14, 2 ; 20 23b66: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 23b68: 9f b7 in r25, 0x3f ; 63 23b6a: f8 94 cli 23b6c: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23b70: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 23b72: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23b76: 9f bf out 0x3f, r25 ; 63 } } 23b78: 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; 23b7a: 9f b7 in r25, 0x3f ; 63 23b7c: f8 94 cli 23b7e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23b82: 80 61 ori r24, 0x10 ; 16 23b84: f6 cf rjmp .-20 ; 0x23b72 00023b86 : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 23b86: 81 30 cpi r24, 0x01 ; 1 23b88: 41 f0 breq .+16 ; 0x23b9a 23b8a: 28 f0 brcs .+10 ; 0x23b96 23b8c: 82 30 cpi r24, 0x02 ; 2 23b8e: 39 f0 breq .+14 ; 0x23b9e 23b90: 83 30 cpi r24, 0x03 ; 3 23b92: 71 f0 breq .+28 ; 0x23bb0 23b94: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 23b96: a0 98 cbi 0x14, 0 ; 20 23b98: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 23b9a: a2 98 cbi 0x14, 2 ; 20 23b9c: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 23b9e: 9f b7 in r25, 0x3f ; 63 23ba0: f8 94 cli 23ba2: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23ba6: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 23ba8: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23bac: 9f bf out 0x3f, r25 ; 63 } } 23bae: 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; 23bb0: 9f b7 in r25, 0x3f ; 63 23bb2: f8 94 cli 23bb4: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23bb8: 8f 7e andi r24, 0xEF ; 239 23bba: f6 cf rjmp .-20 ; 0x23ba8 00023bbc : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 23bbc: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 23bbe: 0d b4 in r0, 0x2d ; 45 23bc0: 07 fe sbrs r0, 7 23bc2: fd cf rjmp .-6 ; 0x23bbe return SPDR; 23bc4: 8e b5 in r24, 0x2e ; 46 } 23bc6: 08 95 ret 00023bc8 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 23bc8: 2f 92 push r2 23bca: 3f 92 push r3 23bcc: 4f 92 push r4 23bce: 5f 92 push r5 23bd0: 6f 92 push r6 23bd2: 7f 92 push r7 23bd4: 8f 92 push r8 23bd6: 9f 92 push r9 23bd8: af 92 push r10 23bda: bf 92 push r11 23bdc: cf 92 push r12 23bde: df 92 push r13 23be0: ef 92 push r14 23be2: ff 92 push r15 23be4: 0f 93 push r16 23be6: 1f 93 push r17 23be8: cf 93 push r28 23bea: df 93 push r29 23bec: cd b7 in r28, 0x3d ; 61 23bee: de b7 in r29, 0x3e ; 62 23bf0: 2e 97 sbiw r28, 0x0e ; 14 23bf2: 0f b6 in r0, 0x3f ; 63 23bf4: f8 94 cli 23bf6: de bf out 0x3e, r29 ; 62 23bf8: 0f be out 0x3f, r0 ; 63 23bfa: 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]); 23bfc: 20 90 18 06 lds r2, 0x0618 ; 0x800618 23c00: 30 90 19 06 lds r3, 0x0619 ; 0x800619 23c04: 40 90 17 05 lds r4, 0x0517 ; 0x800517 23c08: 50 90 18 05 lds r5, 0x0518 ; 0x800518 23c0c: 60 90 19 05 lds r6, 0x0519 ; 0x800519 23c10: 70 90 1a 05 lds r7, 0x051A ; 0x80051a #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 23c14: 21 14 cp r2, r1 23c16: 31 04 cpc r3, r1 23c18: 39 f4 brne .+14 ; 0x23c28 pid_output = 0; pid_reset[e] = true; 23c1a: 81 e0 ldi r24, 0x01 ; 1 23c1c: 80 93 ef 05 sts 0x05EF, r24 ; 0x8005ef 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; 23c20: 81 2c mov r8, r1 23c22: 91 2c mov r9, r1 23c24: 54 01 movw r10, r8 23c26: f9 c0 rjmp .+498 ; 0x23e1a #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 23c28: b1 01 movw r22, r2 23c2a: 03 2c mov r0, r3 23c2c: 00 0c add r0, r0 23c2e: 88 0b sbc r24, r24 23c30: 99 0b sbc r25, r25 23c32: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 23c36: a3 01 movw r20, r6 23c38: 92 01 movw r18, r4 23c3a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 23c3e: 6b 01 movw r12, r22 23c40: 7c 01 movw r14, r24 if(pid_reset[e]) { 23c42: 80 91 ef 05 lds r24, 0x05EF ; 0x8005ef 23c46: 88 23 and r24, r24 23c48: 91 f0 breq .+36 ; 0x23c6e iState_sum[e] = 0.0; 23c4a: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb 23c4e: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec 23c52: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 23c56: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 23c5a: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 23c5e: 10 92 e8 05 sts 0x05E8, r1 ; 0x8005e8 23c62: 10 92 e9 05 sts 0x05E9, r1 ; 0x8005e9 23c66: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea pid_reset[e] = false; 23c6a: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 23c6e: 20 91 d3 06 lds r18, 0x06D3 ; 0x8006d3 23c72: 30 91 d4 06 lds r19, 0x06D4 ; 0x8006d4 23c76: 40 91 d5 06 lds r20, 0x06D5 ; 0x8006d5 23c7a: 50 91 d6 06 lds r21, 0x06D6 ; 0x8006d6 23c7e: c7 01 movw r24, r14 23c80: b6 01 movw r22, r12 23c82: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23c86: 69 83 std Y+1, r22 ; 0x01 23c88: 7a 83 std Y+2, r23 ; 0x02 23c8a: 8b 83 std Y+3, r24 ; 0x03 23c8c: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 23c8e: 20 91 eb 05 lds r18, 0x05EB ; 0x8005eb 23c92: 30 91 ec 05 lds r19, 0x05EC ; 0x8005ec 23c96: 40 91 ed 05 lds r20, 0x05ED ; 0x8005ed 23c9a: 50 91 ee 05 lds r21, 0x05EE ; 0x8005ee 23c9e: c7 01 movw r24, r14 23ca0: b6 01 movw r22, r12 23ca2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 23ca6: 4b 01 movw r8, r22 23ca8: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 23caa: 20 91 aa 04 lds r18, 0x04AA ; 0x8004aa <_ZL14iState_sum_min.lto_priv.480> 23cae: 2d 87 std Y+13, r18 ; 0x0d 23cb0: 30 91 ab 04 lds r19, 0x04AB ; 0x8004ab <_ZL14iState_sum_min.lto_priv.480+0x1> 23cb4: 39 87 std Y+9, r19 ; 0x09 23cb6: 10 91 ac 04 lds r17, 0x04AC ; 0x8004ac <_ZL14iState_sum_min.lto_priv.480+0x2> 23cba: 00 91 ad 04 lds r16, 0x04AD ; 0x8004ad <_ZL14iState_sum_min.lto_priv.480+0x3> 23cbe: 41 2f mov r20, r17 23cc0: 50 2f mov r21, r16 23cc2: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 23cc6: 87 fd sbrc r24, 7 23cc8: 17 c0 rjmp .+46 ; 0x23cf8 23cca: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 <_ZL14iState_sum_max.lto_priv.481> 23cce: 8d 87 std Y+13, r24 ; 0x0d 23cd0: 90 91 a7 04 lds r25, 0x04A7 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.481+0x1> 23cd4: 99 87 std Y+9, r25 ; 0x09 23cd6: 10 91 a8 04 lds r17, 0x04A8 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.481+0x2> 23cda: 00 91 a9 04 lds r16, 0x04A9 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.481+0x3> 23cde: 9c 01 movw r18, r24 23ce0: 41 2f mov r20, r17 23ce2: 50 2f mov r21, r16 23ce4: b4 01 movw r22, r8 23ce6: c5 01 movw r24, r10 23ce8: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 23cec: 18 16 cp r1, r24 23cee: 24 f0 brlt .+8 ; 0x23cf8 23cf0: 8d 86 std Y+13, r8 ; 0x0d 23cf2: 99 86 std Y+9, r9 ; 0x09 23cf4: 1a 2d mov r17, r10 23cf6: 0b 2d mov r16, r11 23cf8: 8d 85 ldd r24, Y+13 ; 0x0d 23cfa: 99 85 ldd r25, Y+9 ; 0x09 23cfc: a1 2f mov r26, r17 23cfe: b0 2f mov r27, r16 23d00: 80 93 eb 05 sts 0x05EB, r24 ; 0x8005eb 23d04: 90 93 ec 05 sts 0x05EC, r25 ; 0x8005ec 23d08: a0 93 ed 05 sts 0x05ED, r26 ; 0x8005ed 23d0c: b0 93 ee 05 sts 0x05EE, r27 ; 0x8005ee iTerm[e] = cs.Ki * iState_sum[e]; 23d10: 20 91 d7 06 lds r18, 0x06D7 ; 0x8006d7 23d14: 30 91 d8 06 lds r19, 0x06D8 ; 0x8006d8 23d18: 40 91 d9 06 lds r20, 0x06D9 ; 0x8006d9 23d1c: 50 91 da 06 lds r21, 0x06DA ; 0x8006da 23d20: bc 01 movw r22, r24 23d22: 81 2f mov r24, r17 23d24: 90 2f mov r25, r16 23d26: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23d2a: 6d 83 std Y+5, r22 ; 0x05 23d2c: 7e 83 std Y+6, r23 ; 0x06 23d2e: 8f 83 std Y+7, r24 ; 0x07 23d30: 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 23d32: 20 91 e3 05 lds r18, 0x05E3 ; 0x8005e3 23d36: 30 91 e4 05 lds r19, 0x05E4 ; 0x8005e4 23d3a: 40 91 e5 05 lds r20, 0x05E5 ; 0x8005e5 23d3e: 50 91 e6 05 lds r21, 0x05E6 ; 0x8005e6 23d42: c3 01 movw r24, r6 23d44: b2 01 movw r22, r4 23d46: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 23d4a: 20 91 db 06 lds r18, 0x06DB ; 0x8006db 23d4e: 30 91 dc 06 lds r19, 0x06DC ; 0x8006dc 23d52: 40 91 dd 06 lds r20, 0x06DD ; 0x8006dd 23d56: 50 91 de 06 lds r21, 0x06DE ; 0x8006de 23d5a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23d5e: 20 ed ldi r18, 0xD0 ; 208 23d60: 3c ec ldi r19, 0xCC ; 204 23d62: 4c e4 ldi r20, 0x4C ; 76 23d64: 5d e3 ldi r21, 0x3D ; 61 23d66: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23d6a: 4b 01 movw r8, r22 23d6c: 5c 01 movw r10, r24 23d6e: 23 e3 ldi r18, 0x33 ; 51 23d70: 33 e3 ldi r19, 0x33 ; 51 23d72: 43 e7 ldi r20, 0x73 ; 115 23d74: 5f e3 ldi r21, 0x3F ; 63 23d76: 60 91 e7 05 lds r22, 0x05E7 ; 0x8005e7 23d7a: 70 91 e8 05 lds r23, 0x05E8 ; 0x8005e8 23d7e: 80 91 e9 05 lds r24, 0x05E9 ; 0x8005e9 23d82: 90 91 ea 05 lds r25, 0x05EA ; 0x8005ea 23d86: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23d8a: 9b 01 movw r18, r22 23d8c: ac 01 movw r20, r24 23d8e: c5 01 movw r24, r10 23d90: b4 01 movw r22, r8 23d92: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 23d96: 4b 01 movw r8, r22 23d98: 5c 01 movw r10, r24 23d9a: 80 92 e7 05 sts 0x05E7, r8 ; 0x8005e7 23d9e: 90 92 e8 05 sts 0x05E8, r9 ; 0x8005e8 23da2: a0 92 e9 05 sts 0x05E9, r10 ; 0x8005e9 23da6: b0 92 ea 05 sts 0x05EA, r11 ; 0x8005ea 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) 23daa: 2d 81 ldd r18, Y+5 ; 0x05 23dac: 3e 81 ldd r19, Y+6 ; 0x06 23dae: 4f 81 ldd r20, Y+7 ; 0x07 23db0: 58 85 ldd r21, Y+8 ; 0x08 23db2: 69 81 ldd r22, Y+1 ; 0x01 23db4: 7a 81 ldd r23, Y+2 ; 0x02 23db6: 8b 81 ldd r24, Y+3 ; 0x03 23db8: 9c 81 ldd r25, Y+4 ; 0x04 23dba: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 23dbe: a5 01 movw r20, r10 23dc0: 94 01 movw r18, r8 23dc2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 23dc6: 4b 01 movw r8, r22 23dc8: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 23dca: 20 e0 ldi r18, 0x00 ; 0 23dcc: 30 e0 ldi r19, 0x00 ; 0 23dce: 4f e7 ldi r20, 0x7F ; 127 23dd0: 53 e4 ldi r21, 0x43 ; 67 23dd2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 23dd6: 20 e0 ldi r18, 0x00 ; 0 23dd8: 30 e0 ldi r19, 0x00 ; 0 23dda: 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) { 23ddc: 18 16 cp r1, r24 23dde: 0c f0 brlt .+2 ; 0x23de2 23de0: 6d c1 rjmp .+730 ; 0x240bc if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 23de2: c7 01 movw r24, r14 23de4: b6 01 movw r22, r12 23de6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 23dea: 18 16 cp r1, r24 23dec: 84 f4 brge .+32 ; 0x23e0e 23dee: a7 01 movw r20, r14 23df0: 96 01 movw r18, r12 23df2: 6d 85 ldd r22, Y+13 ; 0x0d 23df4: 79 85 ldd r23, Y+9 ; 0x09 23df6: 81 2f mov r24, r17 23df8: 90 2f mov r25, r16 23dfa: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 23dfe: 60 93 eb 05 sts 0x05EB, r22 ; 0x8005eb 23e02: 70 93 ec 05 sts 0x05EC, r23 ; 0x8005ec 23e06: 80 93 ed 05 sts 0x05ED, r24 ; 0x8005ed 23e0a: 90 93 ee 05 sts 0x05EE, r25 ; 0x8005ee pid_output=PID_MAX; 23e0e: 81 2c mov r8, r1 23e10: 91 2c mov r9, r1 23e12: 3f e7 ldi r19, 0x7F ; 127 23e14: a3 2e mov r10, r19 23e16: 33 e4 ldi r19, 0x43 ; 67 23e18: 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; 23e1a: 40 92 e3 05 sts 0x05E3, r4 ; 0x8005e3 23e1e: 50 92 e4 05 sts 0x05E4, r5 ; 0x8005e4 23e22: 60 92 e5 05 sts 0x05E5, r6 ; 0x8005e5 23e26: 70 92 e6 05 sts 0x05E6, r7 ; 0x8005e6 pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 23e2a: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.482> 23e2e: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.482+0x1> 23e32: 07 2e mov r0, r23 23e34: 00 0c add r0, r0 23e36: 88 0b sbc r24, r24 23e38: 99 0b sbc r25, r25 23e3a: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 23e3e: 9b 01 movw r18, r22 23e40: ac 01 movw r20, r24 23e42: c3 01 movw r24, r6 23e44: b2 01 movw r22, r4 23e46: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 23e4a: 87 ff sbrs r24, 7 23e4c: 57 c1 rjmp .+686 ; 0x240fc 23e4e: 23 28 or r2, r3 23e50: 09 f4 brne .+2 ; 0x23e54 23e52: 54 c1 rjmp .+680 ; 0x240fc soft_pwm[e] = (int)pid_output >> 1; 23e54: c5 01 movw r24, r10 23e56: b4 01 movw r22, r8 23e58: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 23e5c: 75 95 asr r23 23e5e: 67 95 ror r22 23e60: 60 93 16 05 sts 0x0516, r22 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 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); 23e64: 20 91 11 06 lds r18, 0x0611 ; 0x800611 23e68: 30 91 12 06 lds r19, 0x0612 ; 0x800612 23e6c: 3a 83 std Y+2, r19 ; 0x02 23e6e: 29 83 std Y+1, r18 ; 0x01 23e70: 40 90 13 06 lds r4, 0x0613 ; 0x800613 23e74: 50 90 14 06 lds r5, 0x0614 ; 0x800614 23e78: 60 90 15 06 lds r6, 0x0615 ; 0x800615 23e7c: 70 90 16 06 lds r7, 0x0616 ; 0x800616 #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 23e80: b9 01 movw r22, r18 23e82: 33 0f add r19, r19 23e84: 88 0b sbc r24, r24 23e86: 99 0b sbc r25, r25 23e88: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 23e8c: a3 01 movw r20, r6 23e8e: 92 01 movw r18, r4 23e90: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 23e94: 6b 01 movw r12, r22 23e96: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 23e98: 20 91 df 06 lds r18, 0x06DF ; 0x8006df 23e9c: 30 91 e0 06 lds r19, 0x06E0 ; 0x8006e0 23ea0: 40 91 e1 06 lds r20, 0x06E1 ; 0x8006e1 23ea4: 50 91 e2 06 lds r21, 0x06E2 ; 0x8006e2 23ea8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23eac: 6d 83 std Y+5, r22 ; 0x05 23eae: 7e 83 std Y+6, r23 ; 0x06 23eb0: 8f 83 std Y+7, r24 ; 0x07 23eb2: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 23eb4: 20 91 f8 05 lds r18, 0x05F8 ; 0x8005f8 23eb8: 30 91 f9 05 lds r19, 0x05F9 ; 0x8005f9 23ebc: 40 91 fa 05 lds r20, 0x05FA ; 0x8005fa 23ec0: 50 91 fb 05 lds r21, 0x05FB ; 0x8005fb 23ec4: c7 01 movw r24, r14 23ec6: b6 01 movw r22, r12 23ec8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 23ecc: 5b 01 movw r10, r22 23ece: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 23ed0: 30 91 a2 04 lds r19, 0x04A2 ; 0x8004a2 <_ZL19temp_iState_min_bed.lto_priv.478> 23ed4: 3e 87 std Y+14, r19 ; 0x0e 23ed6: 80 91 a3 04 lds r24, 0x04A3 ; 0x8004a3 <_ZL19temp_iState_min_bed.lto_priv.478+0x1> 23eda: 8d 87 std Y+13, r24 ; 0x0d 23edc: 30 90 a4 04 lds r3, 0x04A4 ; 0x8004a4 <_ZL19temp_iState_min_bed.lto_priv.478+0x2> 23ee0: 20 90 a5 04 lds r2, 0x04A5 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.478+0x3> 23ee4: 23 2f mov r18, r19 23ee6: 38 2f mov r19, r24 23ee8: 43 2d mov r20, r3 23eea: 52 2d mov r21, r2 23eec: b5 01 movw r22, r10 23eee: c8 01 movw r24, r16 23ef0: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 23ef4: 87 fd sbrc r24, 7 23ef6: 18 c0 rjmp .+48 ; 0x23f28 23ef8: 90 91 9e 04 lds r25, 0x049E ; 0x80049e <_ZL19temp_iState_max_bed.lto_priv.479> 23efc: 9e 87 std Y+14, r25 ; 0x0e 23efe: 20 91 9f 04 lds r18, 0x049F ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.479+0x1> 23f02: 2d 87 std Y+13, r18 ; 0x0d 23f04: 30 90 a0 04 lds r3, 0x04A0 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.479+0x2> 23f08: 20 90 a1 04 lds r2, 0x04A1 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.479+0x3> 23f0c: 29 2f mov r18, r25 23f0e: 3d 85 ldd r19, Y+13 ; 0x0d 23f10: 43 2d mov r20, r3 23f12: 52 2d mov r21, r2 23f14: b5 01 movw r22, r10 23f16: c8 01 movw r24, r16 23f18: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 23f1c: 18 16 cp r1, r24 23f1e: 24 f0 brlt .+8 ; 0x23f28 23f20: ae 86 std Y+14, r10 ; 0x0e 23f22: bd 86 std Y+13, r11 ; 0x0d 23f24: 30 2e mov r3, r16 23f26: 21 2e mov r2, r17 23f28: 8e 85 ldd r24, Y+14 ; 0x0e 23f2a: 9d 85 ldd r25, Y+13 ; 0x0d 23f2c: a3 2d mov r26, r3 23f2e: b2 2d mov r27, r2 23f30: 80 93 f8 05 sts 0x05F8, r24 ; 0x8005f8 23f34: 90 93 f9 05 sts 0x05F9, r25 ; 0x8005f9 23f38: a0 93 fa 05 sts 0x05FA, r26 ; 0x8005fa 23f3c: b0 93 fb 05 sts 0x05FB, r27 ; 0x8005fb iTerm_bed = cs.bedKi * temp_iState_bed; 23f40: 20 91 e3 06 lds r18, 0x06E3 ; 0x8006e3 23f44: 30 91 e4 06 lds r19, 0x06E4 ; 0x8006e4 23f48: 40 91 e5 06 lds r20, 0x06E5 ; 0x8006e5 23f4c: 50 91 e6 06 lds r21, 0x06E6 ; 0x8006e6 23f50: bc 01 movw r22, r24 23f52: 83 2d mov r24, r3 23f54: 92 2d mov r25, r2 23f56: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23f5a: 69 87 std Y+9, r22 ; 0x09 23f5c: 7a 87 std Y+10, r23 ; 0x0a 23f5e: 8b 87 std Y+11, r24 ; 0x0b 23f60: 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); 23f62: 20 91 f4 05 lds r18, 0x05F4 ; 0x8005f4 23f66: 30 91 f5 05 lds r19, 0x05F5 ; 0x8005f5 23f6a: 40 91 f6 05 lds r20, 0x05F6 ; 0x8005f6 23f6e: 50 91 f7 05 lds r21, 0x05F7 ; 0x8005f7 23f72: c3 01 movw r24, r6 23f74: b2 01 movw r22, r4 23f76: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 23f7a: 20 91 e7 06 lds r18, 0x06E7 ; 0x8006e7 23f7e: 30 91 e8 06 lds r19, 0x06E8 ; 0x8006e8 23f82: 40 91 e9 06 lds r20, 0x06E9 ; 0x8006e9 23f86: 50 91 ea 06 lds r21, 0x06EA ; 0x8006ea 23f8a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23f8e: 20 ed ldi r18, 0xD0 ; 208 23f90: 3c ec ldi r19, 0xCC ; 204 23f92: 4c e4 ldi r20, 0x4C ; 76 23f94: 5d e3 ldi r21, 0x3D ; 61 23f96: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23f9a: 4b 01 movw r8, r22 23f9c: 5c 01 movw r10, r24 23f9e: 23 e3 ldi r18, 0x33 ; 51 23fa0: 33 e3 ldi r19, 0x33 ; 51 23fa2: 43 e7 ldi r20, 0x73 ; 115 23fa4: 5f e3 ldi r21, 0x3F ; 63 23fa6: 60 91 f0 05 lds r22, 0x05F0 ; 0x8005f0 23faa: 70 91 f1 05 lds r23, 0x05F1 ; 0x8005f1 23fae: 80 91 f2 05 lds r24, 0x05F2 ; 0x8005f2 23fb2: 90 91 f3 05 lds r25, 0x05F3 ; 0x8005f3 23fb6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 23fba: 9b 01 movw r18, r22 23fbc: ac 01 movw r20, r24 23fbe: c5 01 movw r24, r10 23fc0: b4 01 movw r22, r8 23fc2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 23fc6: 4b 01 movw r8, r22 23fc8: 5c 01 movw r10, r24 23fca: 80 92 f0 05 sts 0x05F0, r8 ; 0x8005f0 23fce: 90 92 f1 05 sts 0x05F1, r9 ; 0x8005f1 23fd2: a0 92 f2 05 sts 0x05F2, r10 ; 0x8005f2 23fd6: b0 92 f3 05 sts 0x05F3, r11 ; 0x8005f3 temp_dState_bed = pid_input; 23fda: 40 92 f4 05 sts 0x05F4, r4 ; 0x8005f4 23fde: 50 92 f5 05 sts 0x05F5, r5 ; 0x8005f5 23fe2: 60 92 f6 05 sts 0x05F6, r6 ; 0x8005f6 23fe6: 70 92 f7 05 sts 0x05F7, r7 ; 0x8005f7 pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 23fea: 29 85 ldd r18, Y+9 ; 0x09 23fec: 3a 85 ldd r19, Y+10 ; 0x0a 23fee: 4b 85 ldd r20, Y+11 ; 0x0b 23ff0: 5c 85 ldd r21, Y+12 ; 0x0c 23ff2: 6d 81 ldd r22, Y+5 ; 0x05 23ff4: 7e 81 ldd r23, Y+6 ; 0x06 23ff6: 8f 81 ldd r24, Y+7 ; 0x07 23ff8: 98 85 ldd r25, Y+8 ; 0x08 23ffa: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 23ffe: a5 01 movw r20, r10 24000: 94 01 movw r18, r8 24002: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 24006: 4b 01 movw r8, r22 24008: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 2400a: 20 e0 ldi r18, 0x00 ; 0 2400c: 30 e0 ldi r19, 0x00 ; 0 2400e: 4f e7 ldi r20, 0x7F ; 127 24010: 53 e4 ldi r21, 0x43 ; 67 24012: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 24016: 20 e0 ldi r18, 0x00 ; 0 24018: 30 e0 ldi r19, 0x00 ; 0 2401a: 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) { 2401c: 18 16 cp r1, r24 2401e: 0c f0 brlt .+2 ; 0x24022 24020: 70 c0 rjmp .+224 ; 0x24102 if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 24022: c7 01 movw r24, r14 24024: b6 01 movw r22, r12 24026: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2402a: 18 16 cp r1, r24 2402c: 84 f4 brge .+32 ; 0x2404e 2402e: a7 01 movw r20, r14 24030: 96 01 movw r18, r12 24032: 6e 85 ldd r22, Y+14 ; 0x0e 24034: 7d 85 ldd r23, Y+13 ; 0x0d 24036: 83 2d mov r24, r3 24038: 92 2d mov r25, r2 2403a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 2403e: 60 93 f8 05 sts 0x05F8, r22 ; 0x8005f8 24042: 70 93 f9 05 sts 0x05F9, r23 ; 0x8005f9 24046: 80 93 fa 05 sts 0x05FA, r24 ; 0x8005fa 2404a: 90 93 fb 05 sts 0x05FB, r25 ; 0x8005fb pid_output=MAX_BED_POWER; 2404e: 81 2c mov r8, r1 24050: 91 2c mov r9, r1 24052: 9f e7 ldi r25, 0x7F ; 127 24054: a9 2e mov r10, r25 24056: 93 e4 ldi r25, 0x43 ; 67 24058: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 2405a: 20 e0 ldi r18, 0x00 ; 0 2405c: 30 e0 ldi r19, 0x00 ; 0 2405e: 4a ef ldi r20, 0xFA ; 250 24060: 52 e4 ldi r21, 0x42 ; 66 24062: c3 01 movw r24, r6 24064: b2 01 movw r22, r4 24066: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2406a: 87 ff sbrs r24, 7 2406c: 6d c0 rjmp .+218 ; 0x24148 { soft_pwm_bed = (int)pid_output >> 1; 2406e: c5 01 movw r24, r10 24070: b4 01 movw r22, r8 24072: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 24076: 75 95 asr r23 24078: 67 95 ror r22 2407a: 60 93 17 06 sts 0x0617, r22 ; 0x800617 soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 2407e: 89 81 ldd r24, Y+1 ; 0x01 24080: 9a 81 ldd r25, Y+2 ; 0x02 24082: 89 2b or r24, r25 24084: 11 f4 brne .+4 ; 0x2408a { soft_pwm_bed = 0; 24086: 10 92 17 06 sts 0x0617, r1 ; 0x800617 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); } 2408a: 2e 96 adiw r28, 0x0e ; 14 2408c: 0f b6 in r0, 0x3f ; 63 2408e: f8 94 cli 24090: de bf out 0x3e, r29 ; 62 24092: 0f be out 0x3f, r0 ; 63 24094: cd bf out 0x3d, r28 ; 61 24096: df 91 pop r29 24098: cf 91 pop r28 2409a: 1f 91 pop r17 2409c: 0f 91 pop r16 2409e: ff 90 pop r15 240a0: ef 90 pop r14 240a2: df 90 pop r13 240a4: cf 90 pop r12 240a6: bf 90 pop r11 240a8: af 90 pop r10 240aa: 9f 90 pop r9 240ac: 8f 90 pop r8 240ae: 7f 90 pop r7 240b0: 6f 90 pop r6 240b2: 5f 90 pop r5 240b4: 4f 90 pop r4 240b6: 3f 90 pop r3 240b8: 2f 90 pop r2 240ba: 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) { 240bc: c5 01 movw r24, r10 240be: b4 01 movw r22, r8 240c0: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 240c4: 87 ff sbrs r24, 7 240c6: a9 ce rjmp .-686 ; 0x23e1a if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 240c8: 20 e0 ldi r18, 0x00 ; 0 240ca: 30 e0 ldi r19, 0x00 ; 0 240cc: a9 01 movw r20, r18 240ce: c7 01 movw r24, r14 240d0: b6 01 movw r22, r12 240d2: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 240d6: 87 ff sbrs r24, 7 240d8: a3 cd rjmp .-1210 ; 0x23c20 240da: a7 01 movw r20, r14 240dc: 96 01 movw r18, r12 240de: 6d 85 ldd r22, Y+13 ; 0x0d 240e0: 79 85 ldd r23, Y+9 ; 0x09 240e2: 81 2f mov r24, r17 240e4: 90 2f mov r25, r16 240e6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 240ea: 60 93 eb 05 sts 0x05EB, r22 ; 0x8005eb 240ee: 70 93 ec 05 sts 0x05EC, r23 ; 0x8005ec 240f2: 80 93 ed 05 sts 0x05ED, r24 ; 0x8005ed 240f6: 90 93 ee 05 sts 0x05EE, r25 ; 0x8005ee 240fa: 92 cd rjmp .-1244 ; 0x23c20 // 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; 240fc: 10 92 16 05 sts 0x0516, r1 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 24100: b1 ce rjmp .-670 ; 0x23e64 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){ 24102: c5 01 movw r24, r10 24104: b4 01 movw r22, r8 24106: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2410a: 87 ff sbrs r24, 7 2410c: a6 cf rjmp .-180 ; 0x2405a if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 2410e: 20 e0 ldi r18, 0x00 ; 0 24110: 30 e0 ldi r19, 0x00 ; 0 24112: a9 01 movw r20, r18 24114: c7 01 movw r24, r14 24116: b6 01 movw r22, r12 24118: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2411c: 87 ff sbrs r24, 7 2411e: 10 c0 rjmp .+32 ; 0x24140 24120: a7 01 movw r20, r14 24122: 96 01 movw r18, r12 24124: 6e 85 ldd r22, Y+14 ; 0x0e 24126: 7d 85 ldd r23, Y+13 ; 0x0d 24128: 83 2d mov r24, r3 2412a: 92 2d mov r25, r2 2412c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 24130: 60 93 f8 05 sts 0x05F8, r22 ; 0x8005f8 24134: 70 93 f9 05 sts 0x05F9, r23 ; 0x8005f9 24138: 80 93 fa 05 sts 0x05FA, r24 ; 0x8005fa 2413c: 90 93 fb 05 sts 0x05FB, r25 ; 0x8005fb pid_output=0; 24140: 81 2c mov r8, r1 24142: 91 2c mov r9, r1 24144: 54 01 movw r10, r8 24146: 89 cf rjmp .-238 ; 0x2405a { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 24148: 10 92 17 06 sts 0x0617, r1 ; 0x800617 2414c: 98 cf rjmp .-208 ; 0x2407e 0002414e : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 24152: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 24156: 90 93 19 06 sts 0x0619, r25 ; 0x800619 2415a: 80 93 18 06 sts 0x0618, r24 ; 0x800618 target_temperature_bed_isr = target_temperature_bed; 2415e: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 24162: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 24166: 90 93 12 06 sts 0x0612, r25 ; 0x800612 2416a: 80 93 11 06 sts 0x0611, r24 ; 0x800611 } 2416e: 08 95 ret 00024170 : { // 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) 24170: 81 30 cpi r24, 0x01 ; 1 24172: 41 f1 breq .+80 ; 0x241c4 24174: 20 f0 brcs .+8 ; 0x2417e 24176: 82 30 cpi r24, 0x02 ; 2 24178: 09 f4 brne .+2 ; 0x2417c 2417a: 45 c0 rjmp .+138 ; 0x24206 2417c: 08 95 ret { case X_AXIS: { enable_x(); 2417e: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 24180: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 24184: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 24186: 91 e0 ldi r25, 0x01 ; 1 24188: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 2418a: 86 17 cp r24, r22 2418c: 59 f0 breq .+22 ; 0x241a4 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 2418e: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24192: 66 23 and r22, r22 24194: 89 f0 breq .+34 ; 0x241b8 24196: 91 60 ori r25, 0x01 ; 1 24198: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 2419c: eb e4 ldi r30, 0x4B ; 75 2419e: f0 e0 ldi r31, 0x00 ; 0 241a0: 31 97 sbiw r30, 0x01 ; 1 241a2: f1 f7 brne .-4 ; 0x241a0 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 241a4: 91 e0 ldi r25, 0x01 ; 1 241a6: 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); 241a8: 88 23 and r24, r24 241aa: 41 f0 breq .+16 ; 0x241bc 241ac: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 241b0: 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); 241b2: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 241b6: 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); 241b8: 9e 7f andi r25, 0xFE ; 254 241ba: ee cf rjmp .-36 ; 0x24198 #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); 241bc: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 241c0: 8e 7f andi r24, 0xFE ; 254 241c2: f7 cf rjmp .-18 ; 0x241b2 } break; case Y_AXIS: { enable_y(); 241c4: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 241c6: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 241ca: 81 e0 ldi r24, 0x01 ; 1 241cc: 29 2f mov r18, r25 241ce: 22 70 andi r18, 0x02 ; 2 241d0: 91 ff sbrs r25, 1 241d2: 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) { 241d4: 86 17 cp r24, r22 241d6: 59 f0 breq .+22 ; 0x241ee WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 241d8: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 241dc: 66 23 and r22, r22 241de: 79 f0 breq .+30 ; 0x241fe 241e0: 82 60 ori r24, 0x02 ; 2 241e2: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 241e6: 8b e4 ldi r24, 0x4B ; 75 241e8: 90 e0 ldi r25, 0x00 ; 0 241ea: 01 97 sbiw r24, 0x01 ; 1 241ec: f1 f7 brne .-4 ; 0x241ea delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 241ee: 82 e0 ldi r24, 0x02 ; 2 241f0: 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); 241f2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 241f6: 22 23 and r18, r18 241f8: 21 f0 breq .+8 ; 0x24202 241fa: 82 60 ori r24, 0x02 ; 2 241fc: da cf rjmp .-76 ; 0x241b2 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); 241fe: 8d 7f andi r24, 0xFD ; 253 24200: f0 cf rjmp .-32 ; 0x241e2 #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); 24202: 8d 7f andi r24, 0xFD ; 253 24204: d6 cf rjmp .-84 ; 0x241b2 } break; case Z_AXIS: { enable_z(); 24206: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 24208: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 2420c: 81 e0 ldi r24, 0x01 ; 1 2420e: 29 2f mov r18, r25 24210: 24 70 andi r18, 0x04 ; 4 24212: 92 ff sbrs r25, 2 24214: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 24216: 91 e0 ldi r25, 0x01 ; 1 24218: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 2421a: 86 17 cp r24, r22 2421c: 59 f0 breq .+22 ; 0x24234 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 2421e: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24222: 66 23 and r22, r22 24224: 91 f0 breq .+36 ; 0x2424a 24226: 94 60 ori r25, 0x04 ; 4 24228: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2422c: eb e4 ldi r30, 0x4B ; 75 2422e: f0 e0 ldi r31, 0x00 ; 0 24230: 31 97 sbiw r30, 0x01 ; 1 24232: f1 f7 brne .-4 ; 0x24230 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 24234: 94 e0 ldi r25, 0x04 ; 4 24236: 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) { 24238: 86 17 cp r24, r22 2423a: 09 f4 brne .+2 ; 0x2423e 2423c: bc cf rjmp .-136 ; 0x241b6 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 2423e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24242: 22 23 and r18, r18 24244: 21 f0 breq .+8 ; 0x2424e 24246: 84 60 ori r24, 0x04 ; 4 24248: b4 cf rjmp .-152 ; 0x241b2 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); 2424a: 9b 7f andi r25, 0xFB ; 251 2424c: ed cf rjmp .-38 ; 0x24228 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); 2424e: 8b 7f andi r24, 0xFB ; 251 24250: b0 cf rjmp .-160 ; 0x241b2 00024252 : } } static void checkRx(void) { if (selectedSerialPort == 0) { 24252: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 24256: 81 11 cpse r24, r1 24258: 25 c0 rjmp .+74 ; 0x242a4 if((M_UCSRxA & (1< 2425e: 87 ff sbrs r24, 7 24260: 3d c0 rjmp .+122 ; 0x242dc // Test for a framing error. if (M_UCSRxA & (1< 24266: 84 ff sbrs r24, 4 24268: 03 c0 rjmp .+6 ; 0x24270 // 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); 2426a: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 2426e: 08 95 ret } else { unsigned char c = M_UDRx; 24270: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 24274: 20 91 90 04 lds r18, 0x0490 ; 0x800490 24278: 30 91 91 04 lds r19, 0x0491 ; 0x800491 2427c: c9 01 movw r24, r18 2427e: 01 96 adiw r24, 0x01 ; 1 24280: 8f 77 andi r24, 0x7F ; 127 24282: 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) { 24284: 60 91 92 04 lds r22, 0x0492 ; 0x800492 24288: 70 91 93 04 lds r23, 0x0493 ; 0x800493 2428c: 86 17 cp r24, r22 2428e: 97 07 cpc r25, r23 24290: 29 f1 breq .+74 ; 0x242dc // 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; 24292: 20 5f subi r18, 0xF0 ; 240 24294: 3b 4f sbci r19, 0xFB ; 251 24296: f9 01 movw r30, r18 24298: 40 83 st Z, r20 rx_buffer.head = i; 2429a: 90 93 91 04 sts 0x0491, r25 ; 0x800491 2429e: 80 93 90 04 sts 0x0490, r24 ; 0x800490 242a2: 1c c0 rjmp .+56 ; 0x242dc UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 242a8: 87 ff sbrs r24, 7 242aa: 18 c0 rjmp .+48 ; 0x242dc // Test for a framing error. if (UCSR1A & (1< 242b0: 84 ff sbrs r24, 4 242b2: 03 c0 rjmp .+6 ; 0x242ba // 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); 242b4: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 242b8: 08 95 ret } else { unsigned char c = UDR1; 242ba: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 242be: 20 91 90 04 lds r18, 0x0490 ; 0x800490 242c2: 30 91 91 04 lds r19, 0x0491 ; 0x800491 242c6: c9 01 movw r24, r18 242c8: 01 96 adiw r24, 0x01 ; 1 242ca: 8f 77 andi r24, 0x7F ; 127 242cc: 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) { 242ce: 60 91 92 04 lds r22, 0x0492 ; 0x800492 242d2: 70 91 93 04 lds r23, 0x0493 ; 0x800493 242d6: 68 17 cp r22, r24 242d8: 79 07 cpc r23, r25 242da: d9 f6 brne .-74 ; 0x24292 M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 242dc: 08 95 ret 000242de : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 242de: 23 e0 ldi r18, 0x03 ; 3 242e0: 81 11 cpse r24, r1 242e2: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 242f6: 94 60 ori r25, 0x04 ; 4 242f8: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 242fc: 3f bf out 0x3f, r19 ; 63 242fe: fb 01 movw r30, r22 24300: 31 97 sbiw r30, 0x01 ; 1 24302: f1 f7 brne .-4 ; 0x24300 delayMicroseconds(200); WRITE(BEEPER,LOW); 24304: 3f b7 in r19, 0x3f ; 63 24306: f8 94 cli 24308: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2430c: 9b 7f andi r25, 0xFB ; 251 2430e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24312: 3f bf out 0x3f, r19 ; 63 24314: fa 01 movw r30, r20 24316: 31 97 sbiw r30, 0x01 ; 1 24318: f1 f7 brne .-4 ; 0x24316 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); } } 24320: 08 95 ret 00024322 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 24322: 8a e0 ldi r24, 0x0A ; 10 24324: 2b e8 ldi r18, 0x8B ; 139 24326: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 24328: 4f b7 in r20, 0x3f ; 63 2432a: f8 94 cli 2432c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24330: 94 60 ori r25, 0x04 ; 4 24332: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24336: 4f bf out 0x3f, r20 ; 63 24338: f9 01 movw r30, r18 2433a: 31 97 sbiw r30, 0x01 ; 1 2433c: f1 f7 brne .-4 ; 0x2433a delayMicroseconds(100); WRITE(BEEPER,LOW); 2433e: 4f b7 in r20, 0x3f ; 63 24340: f8 94 cli 24342: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24346: 9b 7f andi r25, 0xFB ; 251 24348: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2434c: 4f bf out 0x3f, r20 ; 63 2434e: f9 01 movw r30, r18 24350: 31 97 sbiw r30, 0x01 ; 1 24352: f1 f7 brne .-4 ; 0x24350 24354: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 24356: 41 f7 brne .-48 ; 0x24328 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 24358: 08 95 ret 0002435a : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 2435a: 87 ea ldi r24, 0xA7 ; 167 2435c: 9c e0 ldi r25, 0x0C ; 12 2435e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e if (eeprom_setting != 0) 24362: 81 11 cpse r24, r1 24364: 05 c0 rjmp .+10 ; 0x24370 return false; switch(eFilamentAction) { 24366: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 2436a: 81 50 subi r24, 0x01 ; 1 2436c: 88 30 cpi r24, 0x08 ; 8 2436e: 10 f0 brcs .+4 ; 0x24374 #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; 24370: 80 e0 ldi r24, 0x00 ; 0 24372: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 24374: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 24376: 08 95 ret 00024378 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 24378: 0f 94 8e ce call 0x39d1c ; 0x39d1c 2437c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24380: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24384: 84 30 cpi r24, 0x04 ; 4 24386: a8 f5 brcc .+106 ; 0x243f2 24388: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 2438c: 8c ea ldi r24, 0xAC ; 172 2438e: 9d e3 ldi r25, 0x3D ; 61 24390: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24394: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 24398: 84 ee ldi r24, 0xE4 ; 228 2439a: 9e e4 ldi r25, 0x4E ; 78 2439c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 243a0: 6c e1 ldi r22, 0x1C ; 28 243a2: 7a e3 ldi r23, 0x3A ; 58 243a4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 243a8: 8b ed ldi r24, 0xDB ; 219 243aa: 9e e4 ldi r25, 0x4E ; 78 243ac: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 243b0: 6c e6 ldi r22, 0x6C ; 108 243b2: 7a e3 ldi r23, 0x3A ; 58 243b4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 243b8: 82 ed ldi r24, 0xD2 ; 210 243ba: 9e e4 ldi r25, 0x4E ; 78 243bc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 243c0: 6e e9 ldi r22, 0x9E ; 158 243c2: 7b e3 ldi r23, 0x3B ; 59 243c4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 243c8: 87 ec ldi r24, 0xC7 ; 199 243ca: 9e e4 ldi r25, 0x4E ; 78 243cc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 243d0: 60 ef ldi r22, 0xF0 ; 240 243d2: 7a e3 ldi r23, 0x3A ; 58 243d4: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_END(); 243d8: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 243dc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 243e0: 8f 5f subi r24, 0xFF ; 255 243e2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 243e6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 243ea: 8f 5f subi r24, 0xFF ; 255 243ec: 80 93 14 05 sts 0x0514, r24 ; 0x800514 243f0: c7 cf rjmp .-114 ; 0x24380 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(); } 243f2: 08 95 ret 000243f4 : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 243f4: 0f 94 8e ce call 0x39d1c ; 0x39d1c 243f8: 10 92 12 05 sts 0x0512, r1 ; 0x800512 243fc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24400: 84 30 cpi r24, 0x04 ; 4 24402: 28 f5 brcc .+74 ; 0x2444e 24404: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 24408: 8e e0 ldi r24, 0x0E ; 14 2440a: 9e e3 ldi r25, 0x3E ; 62 2440c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24410: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 24414: 86 e6 ldi r24, 0x66 ; 102 24416: 9b e4 ldi r25, 0x4B ; 75 24418: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2441c: 64 e3 ldi r22, 0x34 ; 52 2441e: 7a e3 ldi r23, 0x3A ; 58 24420: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 24424: 8e e5 ldi r24, 0x5E ; 94 24426: 9b e4 ldi r25, 0x4B ; 75 24428: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2442c: 62 e3 ldi r22, 0x32 ; 50 2442e: 7b e3 ldi r23, 0x3B ; 59 24430: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_END(); 24434: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 24438: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2443c: 8f 5f subi r24, 0xFF ; 255 2443e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 24442: 80 91 14 05 lds r24, 0x0514 ; 0x800514 24446: 8f 5f subi r24, 0xFF ; 255 24448: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2444c: d7 cf rjmp .-82 ; 0x243fc 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(); } 2444e: 08 95 ret 00024450 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 24450: 0f 94 8e ce call 0x39d1c ; 0x39d1c 24454: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24458: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2445c: 84 30 cpi r24, 0x04 ; 4 2445e: 68 f5 brcc .+90 ; 0x244ba 24460: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 24464: 8e e0 ldi r24, 0x0E ; 14 24466: 9e e3 ldi r25, 0x3E ; 62 24468: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2446c: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 24470: 86 e6 ldi r24, 0x66 ; 102 24472: 9b e4 ldi r25, 0x4B ; 75 24474: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24478: 68 e7 ldi r22, 0x78 ; 120 2447a: 7a e3 ldi r23, 0x3A ; 58 2447c: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 24480: 8e e5 ldi r24, 0x5E ; 94 24482: 9b e4 ldi r25, 0x4B ; 75 24484: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24488: 6c e7 ldi r22, 0x7C ; 124 2448a: 7b e3 ldi r23, 0x3B ; 59 2448c: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 24490: 8c ef ldi r24, 0xFC ; 252 24492: 9a e4 ldi r25, 0x4A ; 74 24494: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24498: 66 e5 ldi r22, 0x56 ; 86 2449a: 7b e3 ldi r23, 0x3B ; 59 2449c: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_END(); 244a0: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 244a4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 244a8: 8f 5f subi r24, 0xFF ; 255 244aa: 80 93 12 05 sts 0x0512, r24 ; 0x800512 244ae: 80 91 14 05 lds r24, 0x0514 ; 0x800514 244b2: 8f 5f subi r24, 0xFF ; 255 244b4: 80 93 14 05 sts 0x0514, r24 ; 0x800514 244b8: cf cf rjmp .-98 ; 0x24458 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(); } 244ba: 08 95 ret 000244bc : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 244bc: 89 ea ldi r24, 0xA9 ; 169 244be: 9d e0 ldi r25, 0x0D ; 13 244c0: 0c 94 50 78 jmp 0xf0a0 ; 0xf0a0 000244c4 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 244c4: 8c ea ldi r24, 0xAC ; 172 244c6: 9c e0 ldi r25, 0x0C ; 12 244c8: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e if (current_state) 244cc: 88 23 and r24, r24 244ce: 61 f0 breq .+24 ; 0x244e8 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 244d0: 10 92 95 13 sts 0x1395, r1 ; 0x801395 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 244d4: 10 92 43 13 sts 0x1343, r1 ; 0x801343 currentScope = Scope::Stopped; 244d8: 10 92 28 13 sts 0x1328, r1 ; 0x801328 else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 244dc: 8c ea ldi r24, 0xAC ; 172 244de: 9c e0 ldi r25, 0x0C ; 12 244e0: 0e 94 50 78 call 0xf0a0 ; 0xf0a0 MMU2::mmu2.Status(); 244e4: 0d 94 82 75 jmp 0x2eb04 ; 0x2eb04 { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 244e8: 0e 94 56 da call 0x1b4ac ; 0x1b4ac 244ec: f7 cf rjmp .-18 ; 0x244dc 000244ee : 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) 244ee: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 244f2: 88 23 and r24, r24 244f4: 21 f0 breq .+8 ; 0x244fe 244f6: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 244fa: 88 23 and r24, r24 244fc: 51 f0 breq .+20 ; 0x24512 { _md->status = 1; 244fe: 81 e0 ldi r24, 0x01 ; 1 24500: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 24504: 60 e0 ldi r22, 0x00 ; 0 24506: 8a e2 ldi r24, 0x2A ; 42 24508: 9d e0 ldi r25, 0x0D ; 13 2450a: 0e 94 25 78 call 0xf04a ; 0xf04a 2450e: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 } MENU_BEGIN(); 24512: 0f 94 8e ce call 0x39d1c ; 0x39d1c 24516: 10 92 12 05 sts 0x0512, r1 ; 0x800512 2451a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2451e: 84 30 cpi r24, 0x04 ; 4 24520: 08 f0 brcs .+2 ; 0x24524 24522: 81 c0 rjmp .+258 ; 0x24626 24524: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 24528: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 2452c: 81 11 cpse r24, r1 2452e: 4a c0 rjmp .+148 ; 0x245c4 24530: 8f e6 ldi r24, 0x6F ; 111 24532: 90 e4 ldi r25, 0x40 ; 64 24534: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24538: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 2453c: 8e e8 ldi r24, 0x8E ; 142 2453e: 9b e3 ldi r25, 0x3B ; 59 24540: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24544: 64 e1 ldi r22, 0x14 ; 20 24546: 7a e3 ldi r23, 0x3A ; 58 24548: 0f 94 0c d1 call 0x3a218 ; 0x3a218 SETTINGS_NOZZLE; 2454c: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 24550: 8c 33 cpi r24, 0x3C ; 60 24552: 09 f4 brne .+2 ; 0x24556 24554: 54 c0 rjmp .+168 ; 0x245fe 24556: c8 f5 brcc .+114 ; 0x245ca 24558: 89 31 cpi r24, 0x19 ; 25 2455a: 09 f4 brne .+2 ; 0x2455e 2455c: 44 c0 rjmp .+136 ; 0x245e6 2455e: 88 32 cpi r24, 0x28 ; 40 24560: c1 f1 breq .+112 ; 0x245d2 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 24562: 83 e4 ldi r24, 0x43 ; 67 24564: 98 e5 ldi r25, 0x58 ; 88 24566: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2456a: 62 e6 ldi r22, 0x62 ; 98 2456c: 7a e3 ldi r23, 0x3A ; 58 2456e: 0f 94 0b ce call 0x39c16 ; 0x39c16 MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 24572: 8a e3 ldi r24, 0x3A ; 58 24574: 98 e5 ldi r25, 0x58 ; 88 24576: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2457a: 6a ef ldi r22, 0xFA ; 250 2457c: 79 e3 ldi r23, 0x39 ; 57 2457e: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #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); 24582: 80 91 95 13 lds r24, 0x1395 ; 0x801395 24586: 81 30 cpi r24, 0x01 ; 1 24588: 31 f0 breq .+12 ; 0x24596 2458a: 66 ef ldi r22, 0xF6 ; 246 2458c: 79 e3 ldi r23, 0x39 ; 57 2458e: 8f e9 ldi r24, 0x9F ; 159 24590: 95 ea ldi r25, 0xA5 ; 165 24592: 0f 94 0b ce call 0x39c16 ; 0x39c16 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (_md->experimental_menu_visibility) 24596: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 2459a: 88 23 and r24, r24 2459c: 31 f0 breq .+12 ; 0x245aa { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 2459e: 60 ec ldi r22, 0xC0 ; 192 245a0: 7a e3 ldi r23, 0x3A ; 58 245a2: 82 e9 ldi r24, 0x92 ; 146 245a4: 95 ea ldi r25, 0xA5 ; 165 245a6: 0f 94 0c d1 call 0x3a218 ; 0x3a218 //! //! 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(); 245aa: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 245ae: 80 91 12 05 lds r24, 0x0512 ; 0x800512 245b2: 8f 5f subi r24, 0xFF ; 255 245b4: 80 93 12 05 sts 0x0512, r24 ; 0x800512 245b8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 245bc: 8f 5f subi r24, 0xFF ; 255 245be: 80 93 14 05 sts 0x0514, r24 ; 0x800514 245c2: ab cf rjmp .-170 ; 0x2451a MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 245c4: 8c ea ldi r24, 0xAC ; 172 245c6: 9d e3 ldi r25, 0x3D ; 61 245c8: b5 cf rjmp .-150 ; 0x24534 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 245ca: 80 35 cpi r24, 0x50 ; 80 245cc: 11 f1 breq .+68 ; 0x24612 245ce: 8f 3f cpi r24, 0xFF ; 255 245d0: 41 f6 brne .-112 ; 0x24562 245d2: 83 e5 ldi r24, 0x53 ; 83 245d4: 98 e5 ldi r25, 0x58 ; 88 245d6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 245da: 22 e0 ldi r18, 0x02 ; 2 245dc: 4e eb ldi r20, 0xBE ; 190 245de: 5b e3 ldi r21, 0x3B ; 59 245e0: 6b eb ldi r22, 0xBB ; 187 245e2: 75 ea ldi r23, 0xA5 ; 165 245e4: 09 c0 rjmp .+18 ; 0x245f8 245e6: 83 e5 ldi r24, 0x53 ; 83 245e8: 98 e5 ldi r25, 0x58 ; 88 245ea: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 245ee: 22 e0 ldi r18, 0x02 ; 2 245f0: 4e eb ldi r20, 0xBE ; 190 245f2: 5b e3 ldi r21, 0x3B ; 59 245f4: 60 ec ldi r22, 0xC0 ; 192 245f6: 75 ea ldi r23, 0xA5 ; 165 245f8: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 245fc: b2 cf rjmp .-156 ; 0x24562 245fe: 83 e5 ldi r24, 0x53 ; 83 24600: 98 e5 ldi r25, 0x58 ; 88 24602: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24606: 22 e0 ldi r18, 0x02 ; 2 24608: 4e eb ldi r20, 0xBE ; 190 2460a: 5b e3 ldi r21, 0x3B ; 59 2460c: 66 eb ldi r22, 0xB6 ; 182 2460e: 75 ea ldi r23, 0xA5 ; 165 24610: f3 cf rjmp .-26 ; 0x245f8 24612: 83 e5 ldi r24, 0x53 ; 83 24614: 98 e5 ldi r25, 0x58 ; 88 24616: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2461a: 22 e0 ldi r18, 0x02 ; 2 2461c: 4e eb ldi r20, 0xBE ; 190 2461e: 5b e3 ldi r21, 0x3B ; 59 24620: 61 eb ldi r22, 0xB1 ; 177 24622: 75 ea ldi r23, 0xA5 ; 165 24624: e9 cf rjmp .-46 ; 0x245f8 //! 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(); } 24626: 08 95 ret 00024628 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 24628: 80 e0 ldi r24, 0x00 ; 0 2462a: 0d 94 86 1c jmp 0x2390c ; 0x2390c 0002462e : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 2462e: 0f 94 8e ce call 0x39d1c ; 0x39d1c 24632: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24636: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2463a: 84 30 cpi r24, 0x04 ; 4 2463c: 08 f0 brcs .+2 ; 0x24640 2463e: 45 c0 rjmp .+138 ; 0x246ca 24640: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 24644: 8a eb ldi r24, 0xBA ; 186 24646: 98 e5 ldi r25, 0x58 ; 88 24648: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2464c: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 24650: 61 e6 ldi r22, 0x61 ; 97 24652: 73 ed ldi r23, 0xD3 ; 211 24654: 89 e4 ldi r24, 0x49 ; 73 24656: 9d e0 ldi r25, 0x0D ; 13 24658: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 2465c: 6c e5 ldi r22, 0x5C ; 92 2465e: 73 ed ldi r23, 0xD3 ; 211 24660: 84 e5 ldi r24, 0x54 ; 84 24662: 9d e0 ldi r25, 0x0D ; 13 24664: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 24668: 67 e5 ldi r22, 0x57 ; 87 2466a: 73 ed ldi r23, 0xD3 ; 211 2466c: 8f e5 ldi r24, 0x5F ; 95 2466e: 9d e0 ldi r25, 0x0D ; 13 24670: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 24674: 62 e5 ldi r22, 0x52 ; 82 24676: 73 ed ldi r23, 0xD3 ; 211 24678: 8a e6 ldi r24, 0x6A ; 106 2467a: 9d e0 ldi r25, 0x0D ; 13 2467c: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 24680: 6d e4 ldi r22, 0x4D ; 77 24682: 73 ed ldi r23, 0xD3 ; 211 24684: 85 e7 ldi r24, 0x75 ; 117 24686: 9d e0 ldi r25, 0x0D ; 13 24688: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 2468c: 68 e4 ldi r22, 0x48 ; 72 2468e: 73 ed ldi r23, 0xD3 ; 211 24690: 80 e8 ldi r24, 0x80 ; 128 24692: 9d e0 ldi r25, 0x0D ; 13 24694: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 24698: 63 e4 ldi r22, 0x43 ; 67 2469a: 73 ed ldi r23, 0xD3 ; 211 2469c: 8b e8 ldi r24, 0x8B ; 139 2469e: 9d e0 ldi r25, 0x0D ; 13 246a0: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 246a4: 6e e3 ldi r22, 0x3E ; 62 246a6: 73 ed ldi r23, 0xD3 ; 211 246a8: 86 e9 ldi r24, 0x96 ; 150 246aa: 9d e0 ldi r25, 0x0D ; 13 246ac: 0f 94 bc d0 call 0x3a178 ; 0x3a178 MENU_END(); 246b0: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 246b4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 246b8: 8f 5f subi r24, 0xFF ; 255 246ba: 80 93 12 05 sts 0x0512, r24 ; 0x800512 246be: 80 91 14 05 lds r24, 0x0514 ; 0x800514 246c2: 8f 5f subi r24, 0xFF ; 255 246c4: 80 93 14 05 sts 0x0514, r24 ; 0x800514 246c8: b6 cf rjmp .-148 ; 0x24636 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(); } 246ca: 08 95 ret 000246cc : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 246cc: 0f 94 8e ce call 0x39d1c ; 0x39d1c 246d0: 10 92 12 05 sts 0x0512, r1 ; 0x800512 246d4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 246d8: 84 30 cpi r24, 0x04 ; 4 246da: d8 f5 brcc .+118 ; 0x24752 246dc: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 246e0: 8a eb ldi r24, 0xBA ; 186 246e2: 98 e5 ldi r25, 0x58 ; 88 246e4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 246e8: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 246ec: 81 e3 ldi r24, 0x31 ; 49 246ee: 98 e5 ldi r25, 0x58 ; 88 246f0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 246f4: 40 ed ldi r20, 0xD0 ; 208 246f6: 5b e3 ldi r21, 0x3B ; 59 246f8: bc 01 movw r22, r24 246fa: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 246fe: 0e 94 ae f8 call 0x1f15c ; 0x1f15c settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 24702: 89 e2 ldi r24, 0x29 ; 41 24704: 98 e5 ldi r25, 0x58 ; 88 24706: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2470a: 44 ea ldi r20, 0xA4 ; 164 2470c: 5a e3 ldi r21, 0x3A ; 58 2470e: bc 01 movw r22, r24 24710: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 24714: 0e 94 ae f8 call 0x1f15c ; 0x1f15c settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 24718: 40 e4 ldi r20, 0x40 ; 64 2471a: 5b e3 ldi r21, 0x3B ; 59 2471c: 62 e3 ldi r22, 0x32 ; 50 2471e: 71 e7 ldi r23, 0x71 ; 113 24720: 80 91 e9 04 lds r24, 0x04E9 ; 0x8004e9 24724: 0e 94 ae f8 call 0x1f15c ; 0x1f15c settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 24728: 48 e8 ldi r20, 0x88 ; 136 2472a: 5a e3 ldi r21, 0x3A ; 58 2472c: 6b ee ldi r22, 0xEB ; 235 2472e: 7e e6 ldi r23, 0x6E ; 110 24730: 80 91 e7 04 lds r24, 0x04E7 ; 0x8004e7 24734: 0e 94 ae f8 call 0x1f15c ; 0x1f15c MENU_END(); 24738: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 2473c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24740: 8f 5f subi r24, 0xFF ; 255 24742: 80 93 12 05 sts 0x0512, r24 ; 0x800512 24746: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2474a: 8f 5f subi r24, 0xFF ; 255 2474c: 80 93 14 05 sts 0x0514, r24 ; 0x800514 24750: c1 cf rjmp .-126 ; 0x246d4 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(); } 24752: 08 95 ret 00024754 : 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); 24754: 87 ee ldi r24, 0xE7 ; 231 24756: 94 e0 ldi r25, 0x04 ; 4 24758: 0f 94 23 1d call 0x23a46 ; 0x23a46 2475c: 60 91 e7 04 lds r22, 0x04E7 ; 0x8004e7 24760: 80 e2 ldi r24, 0x20 ; 32 24762: 9c e0 ldi r25, 0x0C ; 12 24764: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 00024768 : 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); 24768: 89 ee ldi r24, 0xE9 ; 233 2476a: 94 e0 ldi r25, 0x04 ; 4 2476c: 0f 94 23 1d call 0x23a46 ; 0x23a46 24770: 60 91 e9 04 lds r22, 0x04E9 ; 0x8004e9 24774: 83 ea ldi r24, 0xA3 ; 163 24776: 9d e0 ldi r25, 0x0D ; 13 24778: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0002477c : 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); 2477c: 8a ee ldi r24, 0xEA ; 234 2477e: 94 e0 ldi r25, 0x04 ; 4 24780: 0f 94 23 1d call 0x23a46 ; 0x23a46 24784: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 24788: 84 ea ldi r24, 0xA4 ; 164 2478a: 9d e0 ldi r25, 0x0D ; 13 2478c: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 00024790 : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 24790: 8c ee ldi r24, 0xEC ; 236 24792: 94 e0 ldi r25, 0x04 ; 4 24794: 0f 94 23 1d call 0x23a46 ; 0x23a46 24798: 60 91 ec 04 lds r22, 0x04EC ; 0x8004ec 2479c: 88 ea ldi r24, 0xA8 ; 168 2479e: 9d e0 ldi r25, 0x0D ; 13 247a0: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 000247a4 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 247a4: 80 91 8d 17 lds r24, 0x178D ; 0x80178d case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 247a8: 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) { 247aa: 81 11 cpse r24, r1 247ac: 01 c0 rjmp .+2 ; 0x247b0 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 247ae: 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; 247b0: 60 93 8d 17 sts 0x178D, r22 ; 0x80178d 247b4: 87 e4 ldi r24, 0x47 ; 71 247b6: 9d e0 ldi r25, 0x0D ; 13 247b8: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 000247bc : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 247bc: cf 93 push r28 247be: df 93 push r29 MENU_BEGIN(); 247c0: 0f 94 8e ce call 0x39d1c ; 0x39d1c 247c4: 10 92 12 05 sts 0x0512, r1 ; 0x800512 247c8: 80 91 12 05 lds r24, 0x0512 ; 0x800512 247cc: 84 30 cpi r24, 0x04 ; 4 247ce: 08 f0 brcs .+2 ; 0x247d2 247d0: 96 c0 rjmp .+300 ; 0x248fe 247d2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_BACK)); 247d6: 8f e6 ldi r24, 0x6F ; 111 247d8: 90 e4 ldi r25, 0x40 ; 64 247da: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 247de: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 247e2: 80 91 85 17 lds r24, 0x1785 ; 0x801785 247e6: 88 23 and r24, r24 247e8: f1 f1 breq .+124 ; 0x24866 247ea: 84 e4 ldi r24, 0x44 ; 68 247ec: 9e e5 ldi r25, 0x5E ; 94 247ee: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 247f2: ec 01 movw r28, r24 247f4: 8d e0 ldi r24, 0x0D ; 13 247f6: 9d e3 ldi r25, 0x3D ; 61 247f8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 247fc: 22 e0 ldi r18, 0x02 ; 2 247fe: 4c e4 ldi r20, 0x4C ; 76 24800: 5a e3 ldi r21, 0x3A ; 58 24802: be 01 movw r22, r28 24804: 0f 94 1d d0 call 0x3a03a ; 0x3a03a 24808: 80 91 85 17 lds r24, 0x1785 ; 0x801785 if (fsensor.isEnabled()) { 2480c: 88 23 and r24, r24 2480e: 09 f4 brne .+2 ; 0x24812 24810: 66 c0 rjmp .+204 ; 0x248de if (fsensor.isError()) { 24812: 83 30 cpi r24, 0x03 ; 3 24814: 59 f5 brne .+86 ; 0x2486c MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 24816: 8c e4 ldi r24, 0x4C ; 76 24818: 9d e3 ldi r25, 0x3D ; 61 2481a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2481e: ec 01 movw r28, r24 24820: 83 ed ldi r24, 0xD3 ; 211 24822: 97 e5 ldi r25, 0x57 ; 87 24824: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24828: 22 e0 ldi r18, 0x02 ; 2 2482a: 46 ee ldi r20, 0xE6 ; 230 2482c: 5a e3 ldi r21, 0x3A ; 58 2482e: be 01 movw r22, r28 24830: 0f 94 1d d0 call 0x3a03a ; 0x3a03a MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 24834: 8c e4 ldi r24, 0x4C ; 76 24836: 9d e3 ldi r25, 0x3D ; 61 24838: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2483c: ec 01 movw r28, r24 2483e: 85 ec ldi r24, 0xC5 ; 197 24840: 97 e5 ldi r25, 0x57 ; 87 24842: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24846: 22 e0 ldi r18, 0x02 ; 2 24848: 46 ee ldi r20, 0xE6 ; 230 2484a: 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); 2484c: be 01 movw r22, r28 2484e: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #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()) { 24852: 80 91 8d 17 lds r24, 0x178D ; 0x80178d 24856: 88 23 and r24, r24 24858: 99 f1 breq .+102 ; 0x248c0 2485a: 81 30 cpi r24, 0x01 ; 1 2485c: 09 f4 brne .+2 ; 0x24860 2485e: 4c c0 rjmp .+152 ; 0x248f8 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(); 24860: 0f 94 d2 23 call 0x247a4 ; 0x247a4 24864: 3c c0 rjmp .+120 ; 0x248de 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); 24866: 8e e3 ldi r24, 0x3E ; 62 24868: 9e e5 ldi r25, 0x5E ; 94 2486a: c1 cf rjmp .-126 ; 0x247ee #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); 2486c: 80 91 87 17 lds r24, 0x1787 ; 0x801787 24870: 88 23 and r24, r24 24872: 01 f1 breq .+64 ; 0x248b4 24874: 84 e4 ldi r24, 0x44 ; 68 24876: 9e e5 ldi r25, 0x5E ; 94 24878: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2487c: ec 01 movw r28, r24 2487e: 83 ed ldi r24, 0xD3 ; 211 24880: 97 e5 ldi r25, 0x57 ; 87 24882: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24886: 22 e0 ldi r18, 0x02 ; 2 24888: 4c ed ldi r20, 0xDC ; 220 2488a: 59 e3 ldi r21, 0x39 ; 57 2488c: be 01 movw r22, r28 2488e: 0f 94 1d d0 call 0x3a03a ; 0x3a03a MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24892: 80 91 86 17 lds r24, 0x1786 ; 0x801786 24896: 88 23 and r24, r24 24898: 81 f0 breq .+32 ; 0x248ba 2489a: 84 e4 ldi r24, 0x44 ; 68 2489c: 9e e5 ldi r25, 0x5E ; 94 2489e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 248a2: ec 01 movw r28, r24 248a4: 85 ec ldi r24, 0xC5 ; 197 248a6: 97 e5 ldi r25, 0x57 ; 87 248a8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 248ac: 22 e0 ldi r18, 0x02 ; 2 248ae: 44 e5 ldi r20, 0x54 ; 84 248b0: 5a e3 ldi r21, 0x3A ; 58 248b2: cc cf rjmp .-104 ; 0x2484c #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); 248b4: 8e e3 ldi r24, 0x3E ; 62 248b6: 9e e5 ldi r25, 0x5E ; 94 248b8: df cf rjmp .-66 ; 0x24878 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 248ba: 8e e3 ldi r24, 0x3E ; 62 248bc: 9e e5 ldi r25, 0x5E ; 94 248be: ef cf rjmp .-34 ; 0x2489e #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); 248c0: 8d eb ldi r24, 0xBD ; 189 248c2: 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); 248c4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 248c8: ec 01 movw r28, r24 248ca: 81 eb ldi r24, 0xB1 ; 177 248cc: 97 e5 ldi r25, 0x57 ; 87 248ce: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 248d2: 22 e0 ldi r18, 0x02 ; 2 248d4: 44 ef ldi r20, 0xF4 ; 244 248d6: 5a e3 ldi r21, 0x3A ; 58 248d8: be 01 movw r22, r28 248da: 0f 94 1d d0 call 0x3a03a ; 0x3a03a default: lcd_fsensor_actionNA_set(); } } MENU_END(); 248de: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 248e2: 80 91 12 05 lds r24, 0x0512 ; 0x800512 248e6: 8f 5f subi r24, 0xFF ; 255 248e8: 80 93 12 05 sts 0x0512, r24 ; 0x800512 248ec: 80 91 14 05 lds r24, 0x0514 ; 0x800514 248f0: 8f 5f subi r24, 0xFF ; 255 248f2: 80 93 14 05 sts 0x0514, r24 ; 0x800514 248f6: 68 cf rjmp .-304 ; 0x247c8 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); 248f8: 89 ea ldi r24, 0xA9 ; 169 248fa: 97 e5 ldi r25, 0x57 ; 87 248fc: e3 cf rjmp .-58 ; 0x248c4 lcd_fsensor_actionNA_set(); } } MENU_END(); } 248fe: df 91 pop r29 24900: cf 91 pop r28 24902: 08 95 ret 00024904 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 24904: e5 e8 ldi r30, 0x85 ; 133 24906: f7 e1 ldi r31, 0x17 ; 23 24908: 61 81 ldd r22, Z+1 ; 0x01 2490a: 81 e0 ldi r24, 0x01 ; 1 2490c: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2490e: 61 83 std Z+1, r22 ; 0x01 24910: 87 e0 ldi r24, 0x07 ; 7 24912: 9f e0 ldi r25, 0x0F ; 15 24914: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 00024918 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 24918: e5 e8 ldi r30, 0x85 ; 133 2491a: f7 e1 ldi r31, 0x17 ; 23 2491c: 62 81 ldd r22, Z+2 ; 0x02 2491e: 81 e0 ldi r24, 0x01 ; 1 24920: 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; 24922: 62 83 std Z+2, r22 ; 0x02 24924: 85 ed ldi r24, 0xD5 ; 213 24926: 9e e0 ldi r25, 0x0E ; 14 24928: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0002492c : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 2492c: ec ed ldi r30, 0xDC ; 220 2492e: f6 e1 ldi r31, 0x16 ; 22 24930: 60 81 ld r22, Z 24932: 81 e0 ldi r24, 0x01 ; 1 24934: 68 27 eor r22, r24 24936: 60 83 st Z, r22 24938: 8b eb ldi r24, 0xBB ; 187 2493a: 9f e0 ldi r25, 0x0F ; 15 2493c: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 00024940 : 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; 24940: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 24944: 81 30 cpi r24, 0x01 ; 1 24946: 51 f4 brne .+20 ; 0x2495c 24948: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e 2494c: 60 91 1e 05 lds r22, 0x051E ; 0x80051e 24950: 88 e0 ldi r24, 0x08 ; 8 24952: 9f e0 ldi r25, 0x0F ; 15 24954: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 24958: 0c 94 b4 da jmp 0x1b568 ; 0x1b568 } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 2495c: 81 e0 ldi r24, 0x01 ; 1 2495e: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e 24962: f4 cf rjmp .-24 ; 0x2494c 00024964 : 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); 24964: 8f ea ldi r24, 0xAF ; 175 24966: 9f e0 ldi r25, 0x0F ; 15 24968: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e temp_cal_active = !temp_cal_active; 2496c: 61 e0 ldi r22, 0x01 ; 1 2496e: 81 11 cpse r24, r1 24970: 60 e0 ldi r22, 0x00 ; 0 24972: 8f ea ldi r24, 0xAF ; 175 24974: 9f e0 ldi r25, 0x0F ; 15 24976: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0002497a : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 2497a: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 2497e: 81 30 cpi r24, 0x01 ; 1 24980: 71 f0 breq .+28 ; 0x2499e 24982: 20 f0 brcs .+8 ; 0x2498c 24984: 82 30 cpi r24, 0x02 ; 2 24986: 69 f4 brne .+26 ; 0x249a2 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 24988: 83 e0 ldi r24, 0x03 ; 3 2498a: 01 c0 rjmp .+2 ; 0x2498e void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 2498c: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 2498e: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de 24992: 60 91 de 04 lds r22, 0x04DE ; 0x8004de 24996: 87 ed ldi r24, 0xD7 ; 215 24998: 9e e0 ldi r25, 0x0E ; 14 2499a: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 2499e: 82 e0 ldi r24, 0x02 ; 2 249a0: f6 cf rjmp .-20 ; 0x2498e break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 249a2: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de 249a6: f5 cf rjmp .-22 ; 0x24992 000249a8 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 249a8: 89 e0 ldi r24, 0x09 ; 9 249aa: 9f e0 ldi r25, 0x0F ; 15 249ac: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 249b0: 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) { 249b2: 88 23 and r24, r24 249b4: 21 f0 breq .+8 ; 0x249be case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 249b6: 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) { 249b8: 81 30 cpi r24, 0x01 ; 1 249ba: 09 f0 breq .+2 ; 0x249be case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 249bc: 60 e0 ldi r22, 0x00 ; 0 249be: 89 e0 ldi r24, 0x09 ; 9 249c0: 9f e0 ldi r25, 0x0F ; 15 249c2: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 249c6: 81 e0 ldi r24, 0x01 ; 1 249c8: 80 93 ba 14 sts 0x14BA, r24 ; 0x8014ba } 249cc: 08 95 ret 000249ce : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 249ce: ef 92 push r14 249d0: ff 92 push r15 249d2: 0f 93 push r16 249d4: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 249d6: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 249da: 81 11 cpse r24, r1 249dc: 35 c0 rjmp .+106 ; 0x24a48 { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 249de: 80 ec ldi r24, 0xC0 ; 192 249e0: 9f e0 ldi r25, 0x0F ; 15 249e2: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 249e6: 81 30 cpi r24, 0x01 ; 1 249e8: 61 f5 brne .+88 ; 0x24a42 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 249ea: 8f eb ldi r24, 0xBF ; 191 249ec: 9f e0 ldi r25, 0x0F ; 15 249ee: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 249f2: 08 2e mov r0, r24 249f4: 00 0c add r0, r0 249f6: 99 0b sbc r25, r25 249f8: 90 93 b4 03 sts 0x03B4, r25 ; 0x8003b4 249fc: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 24a00: 8e eb ldi r24, 0xBE ; 190 24a02: 9f e0 ldi r25, 0x0F ; 15 24a04: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24a08: 08 2e mov r0, r24 24a0a: 00 0c add r0, r0 24a0c: 99 0b sbc r25, r25 24a0e: 90 93 b6 03 sts 0x03B6, r25 ; 0x8003b6 24a12: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 24a16: 8d eb ldi r24, 0xBD ; 189 24a18: 9f e0 ldi r25, 0x0F ; 15 24a1a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24a1e: 08 2e mov r0, r24 24a20: 00 0c add r0, r0 24a22: 99 0b sbc r25, r25 24a24: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 24a28: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 24a2c: 8c eb ldi r24, 0xBC ; 188 24a2e: 9f e0 ldi r25, 0x0F ; 15 24a30: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24a34: 08 2e mov r0, r24 24a36: 00 0c add r0, r0 24a38: 99 0b sbc r25, r25 24a3a: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 24a3e: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 } _md->status = 1; 24a42: 81 e0 ldi r24, 0x01 ; 1 24a44: 80 93 b2 03 sts 0x03B2, r24 ; 0x8003b2 } MENU_BEGIN(); 24a48: 0f 94 8e ce call 0x39d1c ; 0x39d1c 24a4c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 24a50: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24a54: 84 30 cpi r24, 0x04 ; 4 24a56: 08 f0 brcs .+2 ; 0x24a5a 24a58: 6e c0 rjmp .+220 ; 0x24b36 24a5a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 24a5e: 0f 94 0e cd call 0x39a1c ; 0x39a1c 24a62: 88 23 and r24, r24 24a64: e9 f0 breq .+58 ; 0x24aa0 24a66: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 24a6a: 8f eb ldi r24, 0xBF ; 191 24a6c: 9f e0 ldi r25, 0x0F ; 15 24a6e: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 24a72: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 24a76: 8d eb ldi r24, 0xBD ; 189 24a78: 9f e0 ldi r25, 0x0F ; 15 24a7a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 24a7e: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 24a82: 8c eb ldi r24, 0xBC ; 188 24a84: 9f e0 ldi r25, 0x0F ; 15 24a86: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 24a8a: 60 91 b5 03 lds r22, 0x03B5 ; 0x8003b5 24a8e: 8e eb ldi r24, 0xBE ; 190 24a90: 9f e0 ldi r25, 0x0F ; 15 24a92: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 24a96: 61 e0 ldi r22, 0x01 ; 1 24a98: 80 ec ldi r24, 0xC0 ; 192 24a9a: 9f e0 ldi r25, 0x0F ; 15 24a9c: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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)); 24aa0: 8f e6 ldi r24, 0x6F ; 111 24aa2: 90 e4 ldi r25, 0x40 ; 64 24aa4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24aa8: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24aac: 8c e2 ldi r24, 0x2C ; 44 24aae: 9e e4 ldi r25, 0x4E ; 78 24ab0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24ab4: f1 2c mov r15, r1 24ab6: e1 2c mov r14, r1 24ab8: 04 e6 ldi r16, 0x64 ; 100 24aba: 10 e0 ldi r17, 0x00 ; 0 24abc: 2c e9 ldi r18, 0x9C ; 156 24abe: 3f ef ldi r19, 0xFF ; 255 24ac0: 40 e1 ldi r20, 0x10 ; 16 24ac2: 63 eb ldi r22, 0xB3 ; 179 24ac4: 73 e0 ldi r23, 0x03 ; 3 24ac6: 0f 94 de ce call 0x39dbc ; 0x39dbc MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24aca: 8b e1 ldi r24, 0x1B ; 27 24acc: 9e e4 ldi r25, 0x4E ; 78 24ace: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24ad2: 2c e9 ldi r18, 0x9C ; 156 24ad4: 3f ef ldi r19, 0xFF ; 255 24ad6: 40 e1 ldi r20, 0x10 ; 16 24ad8: 65 eb ldi r22, 0xB5 ; 181 24ada: 73 e0 ldi r23, 0x03 ; 3 24adc: 0f 94 de ce call 0x39dbc ; 0x39dbc MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24ae0: 8a e0 ldi r24, 0x0A ; 10 24ae2: 9e e4 ldi r25, 0x4E ; 78 24ae4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24ae8: 2c e9 ldi r18, 0x9C ; 156 24aea: 3f ef ldi r19, 0xFF ; 255 24aec: 40 e1 ldi r20, 0x10 ; 16 24aee: 67 eb ldi r22, 0xB7 ; 183 24af0: 73 e0 ldi r23, 0x03 ; 3 24af2: 0f 94 de ce call 0x39dbc ; 0x39dbc MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24af6: 89 ef ldi r24, 0xF9 ; 249 24af8: 9d e4 ldi r25, 0x4D ; 77 24afa: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24afe: 2c e9 ldi r18, 0x9C ; 156 24b00: 3f ef ldi r19, 0xFF ; 255 24b02: 40 e1 ldi r20, 0x10 ; 16 24b04: 69 eb ldi r22, 0xB9 ; 185 24b06: 73 e0 ldi r23, 0x03 ; 3 24b08: 0f 94 de ce call 0x39dbc ; 0x39dbc MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 24b0c: 81 e6 ldi r24, 0x61 ; 97 24b0e: 9b e3 ldi r25, 0x3B ; 59 24b10: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24b14: 6c e3 ldi r22, 0x3C ; 60 24b16: 7b e3 ldi r23, 0x3B ; 59 24b18: 0f 94 0b ce call 0x39c16 ; 0x39c16 MENU_END(); 24b1c: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 _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(); 24b20: 80 91 12 05 lds r24, 0x0512 ; 0x800512 24b24: 8f 5f subi r24, 0xFF ; 255 24b26: 80 93 12 05 sts 0x0512, r24 ; 0x800512 24b2a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 24b2e: 8f 5f subi r24, 0xFF ; 255 24b30: 80 93 14 05 sts 0x0514, r24 ; 0x800514 24b34: 8d cf rjmp .-230 ; 0x24a50 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(); } 24b36: 1f 91 pop r17 24b38: 0f 91 pop r16 24b3a: ff 90 pop r15 24b3c: ef 90 pop r14 24b3e: 08 95 ret 00024b40 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 24b40: 8e ec ldi r24, 0xCE ; 206 24b42: 9e e0 ldi r25, 0x0E ; 14 24b44: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24b48: 60 e0 ldi r22, 0x00 ; 0 24b4a: 81 30 cpi r24, 0x01 ; 1 24b4c: 09 f0 breq .+2 ; 0x24b50 24b4e: 61 e0 ldi r22, 0x01 ; 1 24b50: 8e ec ldi r24, 0xCE ; 206 24b52: 9e e0 ldi r25, 0x0E ; 14 24b54: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 00024b58 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 24b58: 60 91 38 02 lds r22, 0x0238 ; 0x800238 24b5c: 81 e0 ldi r24, 0x01 ; 1 24b5e: 68 27 eor r22, r24 24b60: 60 93 38 02 sts 0x0238, r22 ; 0x800238 24b64: 87 e8 ldi r24, 0x87 ; 135 24b66: 9f e0 ldi r25, 0x0F ; 15 24b68: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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. 24b6c: 80 91 38 02 lds r24, 0x0238 ; 0x800238 24b70: 81 11 cpse r24, r1 24b72: 02 c0 rjmp .+4 ; 0x24b78 24b74: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de #endif //FANCHECK } 24b78: 08 95 ret 00024b7a : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 24b7a: 86 ed ldi r24, 0xD6 ; 214 24b7c: 9e e0 ldi r25, 0x0E ; 14 24b7e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24b82: 61 e0 ldi r22, 0x01 ; 1 24b84: 82 30 cpi r24, 0x02 ; 2 24b86: 09 f0 breq .+2 ; 0x24b8a 24b88: 62 e0 ldi r22, 0x02 ; 2 24b8a: 86 ed ldi r24, 0xD6 ; 214 24b8c: 9e e0 ldi r25, 0x0E ; 14 24b8e: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 00024b92 : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 24b92: cf 93 push r28 24b94: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 24b96: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 24b9a: 8c 33 cpi r24, 0x3C ; 60 24b9c: e1 f0 breq .+56 ; 0x24bd6 24b9e: 80 35 cpi r24, 0x50 ; 80 24ba0: 01 f1 breq .+64 ; 0x24be2 24ba2: 88 32 cpi r24, 0x28 ; 40 24ba4: 91 f0 breq .+36 ; 0x24bca case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 24ba6: 88 e2 ldi r24, 0x28 ; 40 24ba8: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=400; 24bac: c0 e9 ldi r28, 0x90 ; 144 24bae: d1 e0 ldi r29, 0x01 ; 1 24bb0: 60 91 eb 04 lds r22, 0x04EB ; 0x8004eb 24bb4: 87 ea ldi r24, 0xA7 ; 167 24bb6: 9d e0 ldi r25, 0x0D ; 13 24bb8: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 24bbc: be 01 movw r22, r28 24bbe: 85 ea ldi r24, 0xA5 ; 165 24bc0: 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); } 24bc2: df 91 pop r29 24bc4: cf 91 pop r28 24bc6: 0d 94 51 dd jmp 0x3baa2 ; 0x3baa2 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 24bca: 8c e3 ldi r24, 0x3C ; 60 24bcc: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=600; 24bd0: c8 e5 ldi r28, 0x58 ; 88 24bd2: d2 e0 ldi r29, 0x02 ; 2 24bd4: ed cf rjmp .-38 ; 0x24bb0 break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 24bd6: 80 e5 ldi r24, 0x50 ; 80 24bd8: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=800; 24bdc: c0 e2 ldi r28, 0x20 ; 32 24bde: d3 e0 ldi r29, 0x03 ; 3 24be0: e7 cf rjmp .-50 ; 0x24bb0 break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 24be2: 89 e1 ldi r24, 0x19 ; 25 24be4: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb nDiameter=250; 24be8: ca ef ldi r28, 0xFA ; 250 24bea: d0 e0 ldi r29, 0x00 ; 0 24bec: e1 cf rjmp .-62 ; 0x24bb0 00024bee : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 24bee: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 24bf2: 8d ee ldi r24, 0xED ; 237 24bf4: 9e e4 ldi r25, 0x4E ; 78 24bf6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24bfa: 0e 94 11 70 call 0xe022 ; 0xe022 menu_back_if_clicked(); 24bfe: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00024c02 : } static void lcd_crash_mode_info2() { lcd_home(); 24c02: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 24c06: 84 e2 ldi r24, 0x24 ; 36 24c08: 9f e4 ldi r25, 0x4F ; 79 24c0a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24c0e: 0e 94 11 70 call 0xe022 ; 0xe022 menu_back_if_clicked(); 24c12: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00024c16 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 24c16: 81 30 cpi r24, 0x01 ; 1 24c18: 21 f4 brne .+8 ; 0x24c22 case STATE_ON: lcd_puts_P(_N(" 1")); 24c1a: 82 e0 ldi r24, 0x02 ; 2 24c1c: 91 e7 ldi r25, 0x71 ; 113 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 24c1e: 0c 94 11 70 jmp 0xe022 ; 0xe022 24c22: 8e ef ldi r24, 0xFE ; 254 24c24: 90 e7 ldi r25, 0x70 ; 112 24c26: fb cf rjmp .-10 ; 0x24c1e 00024c28 : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 24c28: 81 e0 ldi r24, 0x01 ; 1 24c2a: 90 91 85 17 lds r25, 0x1785 ; 0x801785 24c2e: 91 11 cpse r25, r1 24c30: 80 e0 ldi r24, 0x00 ; 0 24c32: 0c 94 45 76 jmp 0xec8a ; 0xec8a 00024c36 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 24c36: 0d 94 ef 85 jmp 0x30bde ; 0x30bde 00024c3a : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 24c3a: 0e 94 d2 70 call 0xe1a4 ; 0xe1a4 lcd_status_message_idx = 0; // Re-draw message from beginning 24c3e: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.461> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 24c42: 20 e0 ldi r18, 0x00 ; 0 24c44: 41 e0 ldi r20, 0x01 ; 1 24c46: 70 e0 ldi r23, 0x00 ; 0 24c48: 60 e0 ldi r22, 0x00 ; 0 24c4a: 82 eb ldi r24, 0xB2 ; 178 24c4c: 9b e3 ldi r25, 0x3B ; 59 24c4e: 0f 94 b8 ce call 0x39d70 ; 0x39d70 menu_depth = 0; 24c52: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 24c56: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 } 24c5a: 08 95 ret 00024c5c : } } #if (LANG_MODE != 0) void lcd_language() { 24c5c: cf 93 push r28 24c5e: df 93 push r29 lcd_update_enable(true); 24c60: 81 e0 ldi r24, 0x01 ; 1 24c62: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 menu_goto(lcd_language_menu, 0, true, true); 24c66: 21 e0 ldi r18, 0x01 ; 1 24c68: 41 e0 ldi r20, 0x01 ; 1 24c6a: 70 e0 ldi r23, 0x00 ; 0 24c6c: 60 e0 ldi r22, 0x00 ; 0 24c6e: 82 e1 ldi r24, 0x12 ; 18 24c70: 9b e3 ldi r25, 0x3B ; 59 24c72: 0f 94 b8 ce call 0x39d70 ; 0x39d70 24c76: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 24c7a: c0 91 66 0e lds r28, 0x0E66 ; 0x800e66 24c7e: d0 91 67 0e lds r29, 0x0E67 ; 0x800e67 24c82: 0e 94 63 72 call 0xe4c6 ; 0xe4c6 24c86: c2 5b subi r28, 0xB2 ; 178 24c88: db 43 sbci r29, 0x3B ; 59 24c8a: 39 f0 breq .+14 ; 0x24c9a 24c8c: 81 11 cpse r24, r1 24c8e: 07 c0 rjmp .+14 ; 0x24c9e { delay_keep_alive(50); 24c90: 82 e3 ldi r24, 0x32 ; 50 24c92: 90 e0 ldi r25, 0x00 ; 0 24c94: 0e 94 10 8f call 0x11e20 ; 0x11e20 24c98: f0 cf rjmp .-32 ; 0x24c7a } if (lang_is_selected()) 24c9a: 88 23 and r24, r24 24c9c: 21 f0 breq .+8 ; 0x24ca6 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 24c9e: df 91 pop r29 24ca0: 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(); 24ca2: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a else lang_select(LANG_ID_PRI); 24ca6: 80 e0 ldi r24, 0x00 ; 0 } 24ca8: df 91 pop r29 24caa: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 24cac: 0c 94 7a 73 jmp 0xe6f4 ; 0xe6f4 00024cb0 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 24cb0: 61 e0 ldi r22, 0x01 ; 1 24cb2: 8a e6 ldi r24, 0x6A ; 106 24cb4: 95 ea ldi r25, 0xA5 ; 165 24cb6: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_return_to_status(); 24cba: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00024cbe : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 24cbe: 61 e0 ldi r22, 0x01 ; 1 24cc0: 84 e6 ldi r24, 0x64 ; 100 24cc2: 95 ea ldi r25, 0xA5 ; 165 24cc4: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_return_to_status(); 24cc8: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00024ccc : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 24ccc: 61 e0 ldi r22, 0x01 ; 1 24cce: 80 e6 ldi r24, 0x60 ; 96 24cd0: 95 ea ldi r25, 0xA5 ; 165 24cd2: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_return_to_status(); 24cd6: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00024cda : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 24cda: 61 e0 ldi r22, 0x01 ; 1 24cdc: 8c e5 ldi r24, 0x5C ; 92 24cde: 95 ea ldi r25, 0xA5 ; 165 24ce0: 0e 94 dc 89 call 0x113b8 ; 0x113b8 lcd_return_to_status(); 24ce4: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00024ce8 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 24ce8: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 24cec: 8d e3 ldi r24, 0x3D ; 61 24cee: 9e e4 ldi r25, 0x4E ; 78 24cf0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24cf4: ac 01 movw r20, r24 24cf6: 60 e0 ldi r22, 0x00 ; 0 24cf8: 80 e0 ldi r24, 0x00 ; 0 24cfa: 0e 94 3a 70 call 0xe074 ; 0xe074 pid_temp += lcd_encoder; 24cfe: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.454> 24d02: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.454+0x1> 24d06: 20 91 34 05 lds r18, 0x0534 ; 0x800534 24d0a: 30 91 35 05 lds r19, 0x0535 ; 0x800535 24d0e: 82 0f add r24, r18 24d10: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 24d12: 82 33 cpi r24, 0x32 ; 50 24d14: 21 e0 ldi r18, 0x01 ; 1 24d16: 92 07 cpc r25, r18 24d18: 50 f1 brcs .+84 ; 0x24d6e 24d1a: 81 e3 ldi r24, 0x31 ; 49 24d1c: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 24d1e: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.454+0x1> 24d22: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.454> lcd_encoder = 0; 24d26: 10 92 35 05 sts 0x0535, r1 ; 0x800535 24d2a: 10 92 34 05 sts 0x0534, r1 ; 0x800534 lcd_set_cursor(1, 2); 24d2e: 62 e0 ldi r22, 0x02 ; 2 24d30: 81 e0 ldi r24, 0x01 ; 1 24d32: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%3u"), pid_temp); 24d36: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.454+0x1> 24d3a: 8f 93 push r24 24d3c: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.454> 24d40: 8f 93 push r24 24d42: 84 ee ldi r24, 0xE4 ; 228 24d44: 94 ea ldi r25, 0xA4 ; 164 24d46: 9f 93 push r25 24d48: 8f 93 push r24 24d4a: 0e 94 ff 6f call 0xdffe ; 0xdffe if (lcd_clicked()) { 24d4e: 0e 94 43 72 call 0xe486 ; 0xe486 24d52: 0f 90 pop r0 24d54: 0f 90 pop r0 24d56: 0f 90 pop r0 24d58: 0f 90 pop r0 24d5a: 88 23 and r24, r24 24d5c: 71 f0 breq .+28 ; 0x24d7a lcd_commands_type = LcdCommands::PidExtruder; 24d5e: 83 e0 ldi r24, 0x03 ; 3 24d60: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 lcd_return_to_status(); 24d64: 0f 94 1d 26 call 0x24c3a ; 0x24c3a lcd_update(2); 24d68: 82 e0 ldi r24, 0x02 ; 2 24d6a: 0c 94 ed 6f jmp 0xdfda ; 0xdfda { 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; 24d6e: 8a 30 cpi r24, 0x0A ; 10 24d70: 91 05 cpc r25, r1 24d72: a8 f6 brcc .-86 ; 0x24d1e 24d74: 8a e0 ldi r24, 0x0A ; 10 24d76: 90 e0 ldi r25, 0x00 ; 0 24d78: d2 cf rjmp .-92 ; 0x24d1e lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 24d7a: 08 95 ret 00024d7c : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 24d7c: df 92 push r13 24d7e: ef 92 push r14 24d80: ff 92 push r15 24d82: 0f 93 push r16 24d84: 1f 93 push r17 24d86: cf 93 push r28 24d88: df 93 push r29 24d8a: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 24d8e: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 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] ); 24d92: ce ea ldi r28, 0xAE ; 174 24d94: d4 e0 ldi r29, 0x04 ; 4 24d96: 8a 81 ldd r24, Y+2 ; 0x02 24d98: 9b 81 ldd r25, Y+3 ; 0x03 24d9a: 2c e3 ldi r18, 0x3C ; 60 24d9c: f2 2e mov r15, r18 24d9e: f8 9e mul r15, r24 24da0: 80 01 movw r16, r0 24da2: f9 9e mul r15, r25 24da4: 10 0d add r17, r0 24da6: 11 24 eor r1, r1 24da8: 86 ea ldi r24, 0xA6 ; 166 24daa: 9f e3 ldi r25, 0x3F ; 63 24dac: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24db0: e8 2e mov r14, r24 24db2: d9 2e mov r13, r25 24db4: 88 81 ld r24, Y 24db6: 99 81 ldd r25, Y+1 ; 0x01 24db8: f8 9e mul r15, r24 24dba: e0 01 movw r28, r0 24dbc: f9 9e mul r15, r25 24dbe: d0 0d add r29, r0 24dc0: 11 24 eor r1, r1 24dc2: 83 eb ldi r24, 0xB3 ; 179 24dc4: 9f e3 ldi r25, 0x3F ; 63 24dc6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24dca: 1f 93 push r17 24dcc: 0f 93 push r16 24dce: df 92 push r13 24dd0: ef 92 push r14 24dd2: df 93 push r29 24dd4: cf 93 push r28 24dd6: 9f 93 push r25 24dd8: 8f 93 push r24 24dda: 87 ef ldi r24, 0xF7 ; 247 24ddc: 91 ea ldi r25, 0xA1 ; 161 24dde: 9f 93 push r25 24de0: 8f 93 push r24 24de2: 0e 94 ff 6f call 0xdffe ; 0xdffe menu_back_if_clicked(); 24de6: 8d b7 in r24, 0x3d ; 61 24de8: 9e b7 in r25, 0x3e ; 62 24dea: 0a 96 adiw r24, 0x0a ; 10 24dec: 0f b6 in r0, 0x3f ; 63 24dee: f8 94 cli 24df0: 9e bf out 0x3e, r25 ; 62 24df2: 0f be out 0x3f, r0 ; 63 24df4: 8d bf out 0x3d, r24 ; 61 } 24df6: df 91 pop r29 24df8: cf 91 pop r28 24dfa: 1f 91 pop r17 24dfc: 0f 91 pop r16 24dfe: ff 90 pop r15 24e00: ef 90 pop r14 24e02: 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(); 24e04: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00024e08 : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 24e08: 0f 93 push r16 24e0a: 1f 93 push r17 24e0c: cf 93 push r28 24e0e: df 93 push r29 lcd_home(); 24e10: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 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))); 24e14: 8b e5 ldi r24, 0x5B ; 91 24e16: 9f e0 ldi r25, 0x0F ; 15 24e18: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 24e1c: 18 2f mov r17, r24 24e1e: 09 2f mov r16, r25 24e20: 8d e5 ldi r24, 0x5D ; 93 24e22: 9f e0 ldi r25, 0x0F ; 15 24e24: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 24e28: ec 01 movw r28, r24 24e2a: 87 e9 ldi r24, 0x97 ; 151 24e2c: 9b e4 ldi r25, 0x4B ; 75 24e2e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24e32: 0f 93 push r16 24e34: 1f 93 push r17 24e36: df 93 push r29 24e38: cf 93 push r28 24e3a: 9f 93 push r25 24e3c: 8f 93 push r24 24e3e: 85 ed ldi r24, 0xD5 ; 213 24e40: 92 ea ldi r25, 0xA2 ; 162 24e42: 9f 93 push r25 24e44: 8f 93 push r24 24e46: 0e 94 ff 6f call 0xdffe ; 0xdffe menu_back_if_clicked(); 24e4a: 8d b7 in r24, 0x3d ; 61 24e4c: 9e b7 in r25, 0x3e ; 62 24e4e: 08 96 adiw r24, 0x08 ; 8 24e50: 0f b6 in r0, 0x3f ; 63 24e52: f8 94 cli 24e54: 9e bf out 0x3e, r25 ; 62 24e56: 0f be out 0x3f, r0 ; 63 24e58: 8d bf out 0x3d, r24 ; 61 } 24e5a: df 91 pop r29 24e5c: cf 91 pop r28 24e5e: 1f 91 pop r17 24e60: 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(); 24e62: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00024e66 : #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){ 24e66: cf 93 push r28 24e68: df 93 push r29 24e6a: cd b7 in r28, 0x3d ; 61 24e6c: de b7 in r29, 0x3e ; 62 24e6e: 2f 97 sbiw r28, 0x0f ; 15 24e70: 0f b6 in r0, 0x3f ; 63 24e72: f8 94 cli 24e74: de bf out 0x3e, r29 ; 62 24e76: 0f be out 0x3f, r0 ; 63 24e78: cd bf out 0x3d, r28 ; 61 24e7a: fc 01 movw r30, r24 24e7c: de 01 movw r26, r28 24e7e: 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; 24e80: 90 e0 ldi r25, 0x00 ; 0 24e82: 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); 24e84: 84 91 lpm r24, Z 24e86: 41 e0 ldi r20, 0x01 ; 1 24e88: 49 0f add r20, r25 if( ! b ) 24e8a: 88 23 and r24, r24 24e8c: 29 f0 breq .+10 ; 0x24e98 break; dst[i] = b; 24e8e: 8d 93 st X+, r24 24e90: 31 96 adiw r30, 0x01 ; 1 24e92: 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 24e94: 4d 30 cpi r20, 0x0D ; 13 24e96: b1 f7 brne .-20 ; 0x24e84 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 24e98: f9 01 movw r30, r18 24e9a: e9 0f add r30, r25 24e9c: f1 1d adc r31, r1 24e9e: 8a e3 ldi r24, 0x3A ; 58 24ea0: 80 83 st Z, r24 ++i; 24ea2: 9f 5f subi r25, 0xFF ; 255 24ea4: f9 01 movw r30, r18 24ea6: e9 0f add r30, r25 24ea8: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 24eaa: 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 24eac: 9e 30 cpi r25, 0x0E ; 14 24eae: 19 f0 breq .+6 ; 0x24eb6 dst[i] = ' '; 24eb0: 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 24eb2: 9f 5f subi r25, 0xFF ; 255 24eb4: fb cf rjmp .-10 ; 0x24eac dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 24eb6: 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 24eb8: 7f 93 push r23 24eba: 6f 93 push r22 24ebc: 3f 93 push r19 24ebe: 2f 93 push r18 24ec0: 83 e9 ldi r24, 0x93 ; 147 24ec2: 92 ea ldi r25, 0xA2 ; 162 24ec4: 9f 93 push r25 24ec6: 8f 93 push r24 24ec8: 0e 94 ff 6f call 0xdffe ; 0xdffe 24ecc: 0f 90 pop r0 24ece: 0f 90 pop r0 24ed0: 0f 90 pop r0 24ed2: 0f 90 pop r0 24ed4: 0f 90 pop r0 24ed6: 0f 90 pop r0 } 24ed8: 2f 96 adiw r28, 0x0f ; 15 24eda: 0f b6 in r0, 0x3f ; 63 24edc: f8 94 cli 24ede: de bf out 0x3e, r29 ; 62 24ee0: 0f be out 0x3f, r0 ; 63 24ee2: cd bf out 0x3d, r28 ; 61 24ee4: df 91 pop r29 24ee6: cf 91 pop r28 24ee8: 08 95 ret 00024eea : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 24eea: cf 92 push r12 24eec: df 92 push r13 24eee: ef 92 push r14 24ef0: ff 92 push r15 24ef2: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 24ef6: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 24efa: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 24efe: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 24f02: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 24f06: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 24f0a: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 24f0e: 6b 01 movw r12, r22 24f10: 81 e3 ldi r24, 0x31 ; 49 24f12: 98 e5 ldi r25, 0x58 ; 88 24f14: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24f18: b6 01 movw r22, r12 24f1a: 0f 94 33 27 call 0x24e66 ; 0x24e66 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 24f1e: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 24f22: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 24f26: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 24f2a: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 24f2e: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 24f32: 6b 01 movw r12, r22 24f34: 86 e1 ldi r24, 0x16 ; 22 24f36: 98 e5 ldi r25, 0x58 ; 88 24f38: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24f3c: b6 01 movw r22, r12 24f3e: 0f 94 33 27 call 0x24e66 ; 0x24e66 #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 24f42: 60 91 50 06 lds r22, 0x0650 ; 0x800650 24f46: 70 91 51 06 lds r23, 0x0651 ; 0x800651 24f4a: 80 91 52 06 lds r24, 0x0652 ; 0x800652 24f4e: 90 91 53 06 lds r25, 0x0653 ; 0x800653 24f52: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 24f56: 6b 01 movw r12, r22 24f58: 83 e7 ldi r24, 0x73 ; 115 24f5a: 9b e4 ldi r25, 0x4B ; 75 24f5c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24f60: b6 01 movw r22, r12 24f62: 0f 94 33 27 call 0x24e66 ; 0x24e66 #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 24f66: 60 91 95 03 lds r22, 0x0395 ; 0x800395 24f6a: 70 91 96 03 lds r23, 0x0396 ; 0x800396 24f6e: 80 91 97 03 lds r24, 0x0397 ; 0x800397 24f72: 90 91 98 03 lds r25, 0x0398 ; 0x800398 24f76: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 24f7a: 8c e0 ldi r24, 0x0C ; 12 24f7c: 91 e7 ldi r25, 0x71 ; 113 24f7e: 0f 94 33 27 call 0x24e66 ; 0x24e66 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 24f82: ff 90 pop r15 24f84: ef 90 pop r14 24f86: df 90 pop r13 24f88: 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(); 24f8a: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00024f8e : //! | 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() { 24f8e: af 92 push r10 24f90: bf 92 push r11 24f92: cf 92 push r12 24f94: df 92 push r13 24f96: ef 92 push r14 24f98: ff 92 push r15 24f9a: 0f 93 push r16 24f9c: 1f 93 push r17 24f9e: cf 93 push r28 24fa0: df 93 push r29 24fa2: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 24fa6: 84 e6 ldi r24, 0x64 ; 100 24fa8: 9f e0 ldi r25, 0x0F ; 15 24faa: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24fae: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 24fb0: 85 e6 ldi r24, 0x65 ; 101 24fb2: 9f e0 ldi r25, 0x0F ; 15 24fb4: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24fb8: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 24fba: 86 e6 ldi r24, 0x66 ; 102 24fbc: 9f e0 ldi r25, 0x0F ; 15 24fbe: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24fc2: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 24fc4: 88 e6 ldi r24, 0x68 ; 104 24fc6: 9f e0 ldi r25, 0x0F ; 15 24fc8: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 24fcc: a8 2e mov r10, r24 lcd_home(); 24fce: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_printf_P(failStatsFmt, 24fd2: 86 e5 ldi r24, 0x56 ; 86 24fd4: 9b e4 ldi r25, 0x4B ; 75 24fd6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24fda: d8 2e mov r13, r24 24fdc: c9 2e mov r12, r25 24fde: 87 e4 ldi r24, 0x47 ; 71 24fe0: 9b e4 ldi r25, 0x4B ; 75 24fe2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24fe6: 08 2f mov r16, r24 24fe8: f9 2e mov r15, r25 24fea: 86 e3 ldi r24, 0x36 ; 54 24fec: 9b e4 ldi r25, 0x4B ; 75 24fee: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24ff2: ec 01 movw r28, r24 24ff4: 80 e2 ldi r24, 0x20 ; 32 24ff6: 9b e4 ldi r25, 0x4B ; 75 24ff8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 24ffc: 1f 92 push r1 24ffe: af 92 push r10 25000: 1f 92 push r1 25002: bf 92 push r11 25004: cf 92 push r12 25006: df 92 push r13 25008: 1f 92 push r1 2500a: ef 92 push r14 2500c: ff 92 push r15 2500e: 0f 93 push r16 25010: 1f 92 push r1 25012: 1f 93 push r17 25014: df 93 push r29 25016: cf 93 push r28 25018: 9f 93 push r25 2501a: 8f 93 push r24 2501c: 8e e5 ldi r24, 0x5E ; 94 2501e: 92 ea ldi r25, 0xA2 ; 162 25020: 9f 93 push r25 25022: 8f 93 push r24 25024: 0e 94 ff 6f call 0xdffe ; 0xdffe _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 25028: 8d b7 in r24, 0x3d ; 61 2502a: 9e b7 in r25, 0x3e ; 62 2502c: 42 96 adiw r24, 0x12 ; 18 2502e: 0f b6 in r0, 0x3f ; 63 25030: f8 94 cli 25032: 9e bf out 0x3e, r25 ; 62 25034: 0f be out 0x3f, r0 ; 63 25036: 8d bf out 0x3d, r24 ; 61 } 25038: df 91 pop r29 2503a: cf 91 pop r28 2503c: 1f 91 pop r17 2503e: 0f 91 pop r16 25040: ff 90 pop r15 25042: ef 90 pop r14 25044: df 90 pop r13 25046: cf 90 pop r12 25048: bf 90 pop r11 2504a: 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(); 2504c: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00025050 : //! | 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() { 25050: 6f 92 push r6 25052: 7f 92 push r7 25054: 8f 92 push r8 25056: 9f 92 push r9 25058: af 92 push r10 2505a: bf 92 push r11 2505c: cf 92 push r12 2505e: df 92 push r13 25060: ef 92 push r14 25062: ff 92 push r15 25064: 0f 93 push r16 25066: 1f 93 push r17 25068: cf 93 push r28 2506a: df 93 push r29 2506c: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25070: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_printf_P(failStatsFmt, 25074: 83 e0 ldi r24, 0x03 ; 3 25076: 9f e0 ldi r25, 0x0F ; 15 25078: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 2507c: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 25080: 78 2e mov r7, r24 25082: 69 2e mov r6, r25 25084: 85 e0 ldi r24, 0x05 ; 5 25086: 9f e0 ldi r25, 0x0F ; 15 25088: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 2508c: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 25090: 98 2e mov r9, r24 25092: 89 2e mov r8, r25 25094: 86 e5 ldi r24, 0x56 ; 86 25096: 9b e4 ldi r25, 0x4B ; 75 25098: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2509c: b8 2e mov r11, r24 2509e: a9 2e mov r10, r25 250a0: 81 e0 ldi r24, 0x01 ; 1 250a2: 9f e0 ldi r25, 0x0F ; 15 250a4: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 250a8: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 250ac: d8 2e mov r13, r24 250ae: c9 2e mov r12, r25 250b0: 87 e4 ldi r24, 0x47 ; 71 250b2: 9b e4 ldi r25, 0x4B ; 75 250b4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 250b8: f8 2e mov r15, r24 250ba: e9 2e mov r14, r25 250bc: 8f ef ldi r24, 0xFF ; 255 250be: 9e e0 ldi r25, 0x0E ; 14 250c0: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 250c4: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 250c8: 18 2f mov r17, r24 250ca: 09 2f mov r16, r25 250cc: 86 e3 ldi r24, 0x36 ; 54 250ce: 9b e4 ldi r25, 0x4B ; 75 250d0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 250d4: ec 01 movw r28, r24 250d6: 8f e0 ldi r24, 0x0F ; 15 250d8: 9b e4 ldi r25, 0x4B ; 75 250da: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 250de: 6f 92 push r6 250e0: 7f 92 push r7 250e2: 8f 92 push r8 250e4: 9f 92 push r9 250e6: af 92 push r10 250e8: bf 92 push r11 250ea: cf 92 push r12 250ec: df 92 push r13 250ee: ef 92 push r14 250f0: ff 92 push r15 250f2: 0f 93 push r16 250f4: 1f 93 push r17 250f6: df 93 push r29 250f8: cf 93 push r28 250fa: 9f 93 push r25 250fc: 8f 93 push r24 250fe: 8e e5 ldi r24, 0x5E ; 94 25100: 92 ea ldi r25, 0xA2 ; 162 25102: 9f 93 push r25 25104: 8f 93 push r24 25106: 0e 94 ff 6f call 0xdffe ; 0xdffe _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(); 2510a: 8d b7 in r24, 0x3d ; 61 2510c: 9e b7 in r25, 0x3e ; 62 2510e: 42 96 adiw r24, 0x12 ; 18 25110: 0f b6 in r0, 0x3f ; 63 25112: f8 94 cli 25114: 9e bf out 0x3e, r25 ; 62 25116: 0f be out 0x3f, r0 ; 63 25118: 8d bf out 0x3d, r24 ; 61 } 2511a: df 91 pop r29 2511c: cf 91 pop r28 2511e: 1f 91 pop r17 25120: 0f 91 pop r16 25122: ff 90 pop r15 25124: ef 90 pop r14 25126: df 90 pop r13 25128: cf 90 pop r12 2512a: bf 90 pop r11 2512c: af 90 pop r10 2512e: 9f 90 pop r9 25130: 8f 90 pop r8 25132: 7f 90 pop r7 25134: 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(); 25136: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 0002513a : //! | 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() { 2513a: 8f 92 push r8 2513c: 9f 92 push r9 2513e: af 92 push r10 25140: bf 92 push r11 25142: cf 92 push r12 25144: df 92 push r13 25146: ef 92 push r14 25148: ff 92 push r15 2514a: 0f 93 push r16 2514c: 1f 93 push r17 2514e: cf 93 push r28 25150: df 93 push r29 25152: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25156: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_printf_P( 2515a: 80 91 9b 13 lds r24, 0x139B ; 0x80139b 2515e: 90 91 9c 13 lds r25, 0x139C ; 0x80139c 25162: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 25166: 98 2e mov r9, r24 25168: 89 2e mov r8, r25 2516a: 8a ee ldi r24, 0xEA ; 234 2516c: 9a e4 ldi r25, 0x4A ; 74 2516e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25172: b8 2e mov r11, r24 25174: a9 2e mov r10, r25 25176: 80 ed ldi r24, 0xD0 ; 208 25178: 9e e0 ldi r25, 0x0E ; 14 2517a: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 2517e: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 25182: d8 2e mov r13, r24 25184: c9 2e mov r12, r25 25186: 89 ed ldi r24, 0xD9 ; 217 25188: 9a e4 ldi r25, 0x4A ; 74 2518a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2518e: f8 2e mov r15, r24 25190: e9 2e mov r14, r25 25192: 83 ed ldi r24, 0xD3 ; 211 25194: 9e e0 ldi r25, 0x0E ; 14 25196: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 2519a: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 2519e: 18 2f mov r17, r24 251a0: 09 2f mov r16, r25 251a2: 8d ec ldi r24, 0xCD ; 205 251a4: 9a e4 ldi r25, 0x4A ; 74 251a6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 251aa: ec 01 movw r28, r24 251ac: 8f e0 ldi r24, 0x0F ; 15 251ae: 9b e4 ldi r25, 0x4B ; 75 251b0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 251b4: 8f 92 push r8 251b6: 9f 92 push r9 251b8: af 92 push r10 251ba: bf 92 push r11 251bc: cf 92 push r12 251be: df 92 push r13 251c0: ef 92 push r14 251c2: ff 92 push r15 251c4: 0f 93 push r16 251c6: 1f 93 push r17 251c8: df 93 push r29 251ca: cf 93 push r28 251cc: 9f 93 push r25 251ce: 8f 93 push r24 251d0: 81 e3 ldi r24, 0x31 ; 49 251d2: 92 ea ldi r25, 0xA2 ; 162 251d4: 9f 93 push r25 251d6: 8f 93 push r24 251d8: 0e 94 ff 6f call 0xdffe ; 0xdffe ), _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(); 251dc: 8d b7 in r24, 0x3d ; 61 251de: 9e b7 in r25, 0x3e ; 62 251e0: 40 96 adiw r24, 0x10 ; 16 251e2: 0f b6 in r0, 0x3f ; 63 251e4: f8 94 cli 251e6: 9e bf out 0x3e, r25 ; 62 251e8: 0f be out 0x3f, r0 ; 63 251ea: 8d bf out 0x3d, r24 ; 61 } 251ec: df 91 pop r29 251ee: cf 91 pop r28 251f0: 1f 91 pop r17 251f2: 0f 91 pop r16 251f4: ff 90 pop r15 251f6: ef 90 pop r14 251f8: df 90 pop r13 251fa: cf 90 pop r12 251fc: bf 90 pop r11 251fe: af 90 pop r10 25200: 9f 90 pop r9 25202: 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(); 25204: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00025208 : //! | 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() { 25208: cf 92 push r12 2520a: df 92 push r13 2520c: ef 92 push r14 2520e: ff 92 push r15 25210: 0f 93 push r16 25212: 1f 93 push r17 25214: cf 93 push r28 25216: df 93 push r29 25218: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 2521c: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 " %-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) )); 25220: 8f ec ldi r24, 0xCF ; 207 25222: 9e e0 ldi r25, 0x0E ; 14 25224: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 25228: 90 e0 ldi r25, 0x00 ; 0 2522a: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 2522e: d8 2e mov r13, r24 25230: c9 2e mov r12, r25 25232: 89 ed ldi r24, 0xD9 ; 217 25234: 9a e4 ldi r25, 0x4A ; 74 25236: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2523a: f8 2e mov r15, r24 2523c: 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) ), 2523e: 82 ed ldi r24, 0xD2 ; 210 25240: 9e e0 ldi r25, 0x0E ; 14 25242: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 25246: 90 e0 ldi r25, 0x00 ; 0 25248: 0f 94 3f 1d call 0x23a7e ; 0x23a7e 2524c: 18 2f mov r17, r24 2524e: 09 2f mov r16, r25 25250: 8d ec ldi r24, 0xCD ; 205 25252: 9a e4 ldi r25, 0x4A ; 74 25254: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25258: ec 01 movw r28, r24 2525a: 80 e2 ldi r24, 0x20 ; 32 2525c: 9b e4 ldi r25, 0x4B ; 75 2525e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25262: cf 92 push r12 25264: df 92 push r13 25266: ef 92 push r14 25268: ff 92 push r15 2526a: 0f 93 push r16 2526c: 1f 93 push r17 2526e: df 93 push r29 25270: cf 93 push r28 25272: 9f 93 push r25 25274: 8f 93 push r24 25276: 82 e1 ldi r24, 0x12 ; 18 25278: 92 ea ldi r25, 0xA2 ; 162 2527a: 9f 93 push r25 2527c: 8f 93 push r24 2527e: 0e 94 ff 6f call 0xdffe ; 0xdffe " %-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(); 25282: 8d b7 in r24, 0x3d ; 61 25284: 9e b7 in r25, 0x3e ; 62 25286: 0c 96 adiw r24, 0x0c ; 12 25288: 0f b6 in r0, 0x3f ; 63 2528a: f8 94 cli 2528c: 9e bf out 0x3e, r25 ; 62 2528e: 0f be out 0x3f, r0 ; 63 25290: 8d bf out 0x3d, r24 ; 61 } 25292: df 91 pop r29 25294: cf 91 pop r28 25296: 1f 91 pop r17 25298: 0f 91 pop r16 2529a: ff 90 pop r15 2529c: ef 90 pop r14 2529e: df 90 pop r13 252a0: 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(); 252a2: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 000252a6 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 252a6: af 92 push r10 252a8: bf 92 push r11 252aa: cf 92 push r12 252ac: df 92 push r13 252ae: ef 92 push r14 252b0: ff 92 push r15 252b2: 0f 93 push r16 252b4: 1f 93 push r17 252b6: cf 93 push r28 252b8: df 93 push r29 252ba: 00 d0 rcall .+0 ; 0x252bc 252bc: 00 d0 rcall .+0 ; 0x252be 252be: 1f 92 push r1 252c0: cd b7 in r28, 0x3d ; 61 252c2: 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)) || 252c4: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 252c8: 81 11 cpse r24, r1 252ca: 18 c0 rjmp .+48 ; 0x252fc 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))) || 252cc: 81 ea ldi r24, 0xA1 ; 161 252ce: 9d e0 ldi r25, 0x0D ; 13 252d0: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 252d4: 18 2f mov r17, r24 252d6: 0e 94 5d 78 call 0xf0ba ; 0xf0ba 252da: 88 23 and r24, r24 252dc: 79 f0 breq .+30 ; 0x252fc (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 252de: 80 e1 ldi r24, 0x10 ; 16 252e0: 0e 94 41 f8 call 0x1f082 ; 0x1f082 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))) || 252e4: 88 23 and r24, r24 252e6: 51 f0 breq .+20 ; 0x252fc (!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))))) 252e8: 2b e0 ldi r18, 0x0B ; 11 252ea: 12 9f mul r17, r18 252ec: c0 01 movw r24, r0 252ee: 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 252f0: 80 5b subi r24, 0xB0 ; 176 252f2: 92 4f sbci r25, 0xF2 ; 242 252f4: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a } 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)) || 252f8: 89 2b or r24, r25 252fa: f1 f4 brne .+60 ; 0x25338 (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) 252fc: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 25300: 88 23 and r24, r24 25302: 71 f0 breq .+28 ; 0x25320 { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 25304: 81 ea ldi r24, 0xA1 ; 161 25306: 9d e0 ldi r25, 0x0D ; 13 25308: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2530c: 2b e0 ldi r18, 0x0B ; 11 2530e: 82 9f mul r24, r18 25310: c0 01 movw r24, r0 25312: 11 24 eor r1, r1 25314: 6f ef ldi r22, 0xFF ; 255 25316: 7f ef ldi r23, 0xFF ; 255 25318: 80 5b subi r24, 0xB0 ; 176 2531a: 92 4f sbci r25, 0xF2 ; 242 2531c: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 } // 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()); 25320: 0e 94 43 72 call 0xe486 ; 0xe486 25324: 21 e0 ldi r18, 0x01 ; 1 25326: 81 11 cpse r24, r1 25328: 20 e0 ldi r18, 0x00 ; 0 2532a: 41 e0 ldi r20, 0x01 ; 1 2532c: 70 e0 ldi r23, 0x00 ; 0 2532e: 60 e0 ldi r22, 0x00 ; 0 25330: 8e ec ldi r24, 0xCE ; 206 25332: 9a e3 ldi r25, 0x3A ; 58 25334: 0f 94 b8 ce call 0x39d70 ; 0x39d70 } if (lcd_encoder) { 25338: 20 91 34 05 lds r18, 0x0534 ; 0x800534 2533c: 30 91 35 05 lds r19, 0x0535 ; 0x800535 25340: 21 15 cp r18, r1 25342: 31 05 cpc r19, r1 25344: 59 f0 breq .+22 ; 0x2535c menuData->reset = lcd_encoder > 0; 25346: 81 e0 ldi r24, 0x01 ; 1 25348: 12 16 cp r1, r18 2534a: 13 06 cpc r1, r19 2534c: 0c f0 brlt .+2 ; 0x25350 2534e: 80 e0 ldi r24, 0x00 ; 0 25350: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 lcd_encoder = 0; // Reset 25354: 10 92 35 05 sts 0x0535, r1 ; 0x800535 25358: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } 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)); 2535c: 81 ea ldi r24, 0xA1 ; 161 2535e: 9d e0 ldi r25, 0x0D ; 13 25360: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 25364: 1b e0 ldi r17, 0x0B ; 11 25366: 81 9f mul r24, r17 25368: b0 01 movw r22, r0 2536a: 11 24 eor r1, r1 2536c: 67 5b subi r22, 0xB7 ; 183 2536e: 72 4f sbci r23, 0xF2 ; 242 25370: 47 e0 ldi r20, 0x07 ; 7 25372: 50 e0 ldi r21, 0x00 ; 0 25374: ce 01 movw r24, r28 25376: 01 96 adiw r24, 0x01 ; 1 25378: 7c 01 movw r14, r24 2537a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe lcd_home(); 2537e: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 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]; 25382: 81 ea ldi r24, 0xA1 ; 161 25384: 9d e0 ldi r25, 0x0D ; 13 25386: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2538a: 81 9f mul r24, r17 2538c: c0 01 movw r24, r0 2538e: 11 24 eor r1, r1 25390: 80 5b subi r24, 0xB0 ; 176 25392: 92 4f sbci r25, 0xF2 ; 242 25394: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 25398: bc 01 movw r22, r24 2539a: 99 0f add r25, r25 2539c: 88 0b sbc r24, r24 2539e: 99 0b sbc r25, r25 253a0: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 253a4: 20 91 77 06 lds r18, 0x0677 ; 0x800677 253a8: 30 91 78 06 lds r19, 0x0678 ; 0x800678 253ac: 40 91 79 06 lds r20, 0x0679 ; 0x800679 253b0: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 253b4: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 253b8: d6 2e mov r13, r22 253ba: c7 2e mov r12, r23 253bc: b8 2e mov r11, r24 253be: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 253c0: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 253c4: 0e e3 ldi r16, 0x3E ; 62 253c6: 10 e2 ldi r17, 0x20 ; 32 253c8: 81 11 cpse r24, r1 253ca: 02 c0 rjmp .+4 ; 0x253d0 253cc: 00 e2 ldi r16, 0x20 ; 32 253ce: 1e e3 ldi r17, 0x3E ; 62 253d0: 80 ea ldi r24, 0xA0 ; 160 253d2: 9f e4 ldi r25, 0x4F ; 79 253d4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 253d8: 1f 92 push r1 253da: 0f 93 push r16 253dc: 1f 92 push r1 253de: 1f 93 push r17 253e0: af 92 push r10 253e2: bf 92 push r11 253e4: cf 92 push r12 253e6: df 92 push r13 253e8: ff 92 push r15 253ea: ef 92 push r14 253ec: 9f 93 push r25 253ee: 8f 93 push r24 253f0: 0e 94 ff 6f call 0xdffe ; 0xdffe 253f4: 0f b6 in r0, 0x3f ; 63 253f6: f8 94 cli 253f8: de bf out 0x3e, r29 ; 62 253fa: 0f be out 0x3f, r0 ; 63 253fc: 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. } 253fe: 27 96 adiw r28, 0x07 ; 7 25400: 0f b6 in r0, 0x3f ; 63 25402: f8 94 cli 25404: de bf out 0x3e, r29 ; 62 25406: 0f be out 0x3f, r0 ; 63 25408: cd bf out 0x3d, r28 ; 61 2540a: df 91 pop r29 2540c: cf 91 pop r28 2540e: 1f 91 pop r17 25410: 0f 91 pop r16 25412: ff 90 pop r15 25414: ef 90 pop r14 25416: df 90 pop r13 25418: cf 90 pop r12 2541a: bf 90 pop r11 2541c: af 90 pop r10 2541e: 08 95 ret 00025420 : //! |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() { 25420: 2f 92 push r2 25422: 3f 92 push r3 25424: 4f 92 push r4 25426: 5f 92 push r5 25428: 6f 92 push r6 2542a: 7f 92 push r7 2542c: 8f 92 push r8 2542e: 9f 92 push r9 25430: af 92 push r10 25432: bf 92 push r11 25434: cf 92 push r12 25436: df 92 push r13 25438: ef 92 push r14 2543a: ff 92 push r15 2543c: 0f 93 push r16 2543e: 1f 93 push r17 25440: cf 93 push r28 25442: df 93 push r29 25444: cd b7 in r28, 0x3d ; 61 25446: de b7 in r29, 0x3e ; 62 25448: a8 97 sbiw r28, 0x28 ; 40 2544a: 0f b6 in r0, 0x3f ; 63 2544c: f8 94 cli 2544e: de bf out 0x3e, r29 ; 62 25450: 0f be out 0x3f, r0 ; 63 25452: 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); 25454: 48 e0 ldi r20, 0x08 ; 8 25456: 50 e0 ldi r21, 0x00 ; 0 25458: 65 ee ldi r22, 0xE5 ; 229 2545a: 7f e0 ldi r23, 0x0F ; 15 2545c: ce 01 movw r24, r28 2545e: 41 96 adiw r24, 0x11 ; 17 25460: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 25464: 48 e0 ldi r20, 0x08 ; 8 25466: 50 e0 ldi r21, 0x00 ; 0 25468: 6d ed ldi r22, 0xDD ; 221 2546a: 7f e0 ldi r23, 0x0F ; 15 2546c: ce 01 movw r24, r28 2546e: 09 96 adiw r24, 0x09 ; 9 25470: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 25474: 48 e0 ldi r20, 0x08 ; 8 25476: 50 e0 ldi r21, 0x00 ; 0 25478: 65 ed ldi r22, 0xD5 ; 213 2547a: 7f e0 ldi r23, 0x0F ; 15 2547c: ce 01 movw r24, r28 2547e: 01 96 adiw r24, 0x01 ; 1 25480: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe 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]; 25484: 8d 84 ldd r8, Y+13 ; 0x0d 25486: 9e 84 ldd r9, Y+14 ; 0x0e 25488: af 84 ldd r10, Y+15 ; 0x0f 2548a: b8 88 ldd r11, Y+16 ; 0x10 2548c: ed e3 ldi r30, 0x3D ; 61 2548e: f3 e9 ldi r31, 0x93 ; 147 25490: 25 91 lpm r18, Z+ 25492: 35 91 lpm r19, Z+ 25494: 45 91 lpm r20, Z+ 25496: 54 91 lpm r21, Z 25498: cd 80 ldd r12, Y+5 ; 0x05 2549a: de 80 ldd r13, Y+6 ; 0x06 2549c: ef 80 ldd r14, Y+7 ; 0x07 2549e: f8 84 ldd r15, Y+8 ; 0x08 254a0: e1 e4 ldi r30, 0x41 ; 65 254a2: f3 e9 ldi r31, 0x93 ; 147 254a4: 85 91 lpm r24, Z+ 254a6: 95 91 lpm r25, Z+ 254a8: a5 91 lpm r26, Z+ 254aa: b4 91 lpm r27, Z 254ac: 8d a3 std Y+37, r24 ; 0x25 254ae: 9e a3 std Y+38, r25 ; 0x26 254b0: af a3 std Y+39, r26 ; 0x27 254b2: b8 a7 std Y+40, r27 ; 0x28 254b4: 8d 89 ldd r24, Y+21 ; 0x15 254b6: 9e 89 ldd r25, Y+22 ; 0x16 254b8: af 89 ldd r26, Y+23 ; 0x17 254ba: b8 8d ldd r27, Y+24 ; 0x18 254bc: 89 a3 std Y+33, r24 ; 0x21 254be: 9a a3 std Y+34, r25 ; 0x22 254c0: ab a3 std Y+35, r26 ; 0x23 254c2: bc a3 std Y+36, r27 ; 0x24 254c4: c5 01 movw r24, r10 254c6: b4 01 movw r22, r8 254c8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 254cc: 2b 01 movw r4, r22 254ce: 3c 01 movw r6, r24 254d0: 2d a1 ldd r18, Y+37 ; 0x25 254d2: 3e a1 ldd r19, Y+38 ; 0x26 254d4: 4f a1 ldd r20, Y+39 ; 0x27 254d6: 58 a5 ldd r21, Y+40 ; 0x28 254d8: c7 01 movw r24, r14 254da: b6 01 movw r22, r12 254dc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 254e0: 9b 01 movw r18, r22 254e2: ac 01 movw r20, r24 254e4: c3 01 movw r24, r6 254e6: b2 01 movw r22, r4 254e8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 254ec: 29 a1 ldd r18, Y+33 ; 0x21 254ee: 3a a1 ldd r19, Y+34 ; 0x22 254f0: 4b a1 ldd r20, Y+35 ; 0x23 254f2: 5c a1 ldd r21, Y+36 ; 0x24 254f4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 254f8: 20 e0 ldi r18, 0x00 ; 0 254fa: 30 e0 ldi r19, 0x00 ; 0 254fc: 40 e9 ldi r20, 0x90 ; 144 254fe: 50 e4 ldi r21, 0x40 ; 64 25500: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 25504: 1b 01 movw r2, r22 25506: 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]; 25508: e5 e4 ldi r30, 0x45 ; 69 2550a: f3 e9 ldi r31, 0x93 ; 147 2550c: 25 91 lpm r18, Z+ 2550e: 35 91 lpm r19, Z+ 25510: 45 91 lpm r20, Z+ 25512: 54 91 lpm r21, Z 25514: e9 e4 ldi r30, 0x49 ; 73 25516: f3 e9 ldi r31, 0x93 ; 147 25518: 45 90 lpm r4, Z+ 2551a: 55 90 lpm r5, Z+ 2551c: 65 90 lpm r6, Z+ 2551e: 74 90 lpm r7, Z 25520: c5 01 movw r24, r10 25522: b4 01 movw r22, r8 25524: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 25528: 4b 01 movw r8, r22 2552a: 5c 01 movw r10, r24 2552c: a3 01 movw r20, r6 2552e: 92 01 movw r18, r4 25530: c7 01 movw r24, r14 25532: b6 01 movw r22, r12 25534: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 25538: 9b 01 movw r18, r22 2553a: ac 01 movw r20, r24 2553c: c5 01 movw r24, r10 2553e: b4 01 movw r22, r8 25540: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 25544: 29 a1 ldd r18, Y+33 ; 0x21 25546: 3a a1 ldd r19, Y+34 ; 0x22 25548: 4b a1 ldd r20, Y+35 ; 0x23 2554a: 5c a1 ldd r21, Y+36 ; 0x24 2554c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 25550: 20 e0 ldi r18, 0x00 ; 0 25552: 30 e0 ldi r19, 0x00 ; 0 25554: 40 e9 ldi r20, 0x90 ; 144 25556: 50 e4 ldi r21, 0x40 ; 64 25558: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2555c: 6d 8f std Y+29, r22 ; 0x1d 2555e: 7e 8f std Y+30, r23 ; 0x1e 25560: 8f 8f std Y+31, r24 ; 0x1f 25562: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 25564: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_printf_P(_N( 25568: 82 ea ldi r24, 0xA2 ; 162 2556a: 9d e4 ldi r25, 0x4D ; 77 2556c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25570: d8 2e mov r13, r24 25572: c9 2e mov r12, r25 25574: 8b e9 ldi r24, 0x9B ; 155 25576: 9d e4 ldi r25, 0x4D ; 77 25578: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2557c: f8 2e mov r15, r24 2557e: e9 2e mov r14, r25 25580: 85 e8 ldi r24, 0x85 ; 133 25582: 9d e4 ldi r25, 0x4D ; 77 25584: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25588: cf 92 push r12 2558a: df 92 push r13 2558c: ef 92 push r14 2558e: ff 92 push r15 25590: 20 e1 ldi r18, 0x10 ; 16 25592: 3d e8 ldi r19, 0x8D ; 141 25594: 3f 93 push r19 25596: 2f 93 push r18 25598: 9f 93 push r25 2559a: 8f 93 push r24 2559c: 8c eb ldi r24, 0xBC ; 188 2559e: 90 e7 ldi r25, 0x70 ; 112 255a0: 9f 93 push r25 255a2: 8f 93 push r24 255a4: 0e 94 ff 6f call 0xdffe ; 0xdffe _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 255a8: 62 e0 ldi r22, 0x02 ; 2 255aa: 8b e0 ldi r24, 0x0B ; 11 255ac: 0e 94 26 70 call 0xe04c ; 0xe04c if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 255b0: 0f b6 in r0, 0x3f ; 63 255b2: f8 94 cli 255b4: de bf out 0x3e, r29 ; 62 255b6: 0f be out 0x3f, r0 ; 63 255b8: cd bf out 0x3d, r28 ; 61 255ba: 20 e0 ldi r18, 0x00 ; 0 255bc: 30 e0 ldi r19, 0x00 ; 0 255be: 48 e4 ldi r20, 0x48 ; 72 255c0: 53 e4 ldi r21, 0x43 ; 67 255c2: 62 2d mov r22, r2 255c4: 73 2d mov r23, r3 255c6: 80 2f mov r24, r16 255c8: 91 2f mov r25, r17 255ca: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 255ce: 87 ff sbrs r24, 7 255d0: 51 c0 rjmp .+162 ; 0x25674 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 255d2: 1f 93 push r17 255d4: 0f 93 push r16 255d6: 3f 92 push r3 255d8: 2f 92 push r2 255da: 84 eb ldi r24, 0xB4 ; 180 255dc: 90 e7 ldi r25, 0x70 ; 112 255de: 9f 93 push r25 255e0: 8f 93 push r24 255e2: 0e 94 ff 6f call 0xdffe ; 0xdffe 255e6: 0f 90 pop r0 255e8: 0f 90 pop r0 255ea: 0f 90 pop r0 255ec: 0f 90 pop r0 255ee: 0f 90 pop r0 255f0: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 255f2: 63 e0 ldi r22, 0x03 ; 3 255f4: 8b e0 ldi r24, 0x0B ; 11 255f6: 0e 94 26 70 call 0xe04c ; 0xe04c if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 255fa: 1d 8d ldd r17, Y+29 ; 0x1d 255fc: 0e 8d ldd r16, Y+30 ; 0x1e 255fe: ff 8c ldd r15, Y+31 ; 0x1f 25600: e8 a0 ldd r14, Y+32 ; 0x20 25602: 20 e0 ldi r18, 0x00 ; 0 25604: 30 e0 ldi r19, 0x00 ; 0 25606: 48 e4 ldi r20, 0x48 ; 72 25608: 53 e4 ldi r21, 0x43 ; 67 2560a: d8 01 movw r26, r16 2560c: f7 01 movw r30, r14 2560e: 6b 2f mov r22, r27 25610: 7a 2f mov r23, r26 25612: 8f 2f mov r24, r31 25614: 9e 2f mov r25, r30 25616: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2561a: 87 fd sbrc r24, 7 2561c: 32 c0 rjmp .+100 ; 0x25682 2561e: 8c e4 ldi r24, 0x4C ; 76 25620: 9d e3 ldi r25, 0x3D ; 61 25622: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25626: 0e 94 11 70 call 0xe022 ; 0xe022 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 2562a: 0e 94 43 72 call 0xe486 ; 0xe486 2562e: 88 23 and r24, r24 25630: 41 f0 breq .+16 ; 0x25642 menu_goto(lcd_menu_xyz_skew, 0, true); 25632: 20 e0 ldi r18, 0x00 ; 0 25634: 41 e0 ldi r20, 0x01 ; 1 25636: 70 e0 ldi r23, 0x00 ; 0 25638: 60 e0 ldi r22, 0x00 ; 0 2563a: 80 ef ldi r24, 0xF0 ; 240 2563c: 99 e3 ldi r25, 0x39 ; 57 2563e: 0f 94 b8 ce call 0x39d70 ; 0x39d70 } 25642: a8 96 adiw r28, 0x28 ; 40 25644: 0f b6 in r0, 0x3f ; 63 25646: f8 94 cli 25648: de bf out 0x3e, r29 ; 62 2564a: 0f be out 0x3f, r0 ; 63 2564c: cd bf out 0x3d, r28 ; 61 2564e: df 91 pop r29 25650: cf 91 pop r28 25652: 1f 91 pop r17 25654: 0f 91 pop r16 25656: ff 90 pop r15 25658: ef 90 pop r14 2565a: df 90 pop r13 2565c: cf 90 pop r12 2565e: bf 90 pop r11 25660: af 90 pop r10 25662: 9f 90 pop r9 25664: 8f 90 pop r8 25666: 7f 90 pop r7 25668: 6f 90 pop r6 2566a: 5f 90 pop r5 2566c: 4f 90 pop r4 2566e: 3f 90 pop r3 25670: 2f 90 pop r2 25672: 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)); 25674: 8c e4 ldi r24, 0x4C ; 76 25676: 9d e3 ldi r25, 0x3D ; 61 25678: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2567c: 0e 94 11 70 call 0xe022 ; 0xe022 25680: b8 cf rjmp .-144 ; 0x255f2 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 25682: ef 92 push r14 25684: ff 92 push r15 25686: 0f 93 push r16 25688: 1f 93 push r17 2568a: 84 eb ldi r24, 0xB4 ; 180 2568c: 90 e7 ldi r25, 0x70 ; 112 2568e: 9f 93 push r25 25690: 8f 93 push r24 25692: 0e 94 ff 6f call 0xdffe ; 0xdffe 25696: 0f 90 pop r0 25698: 0f 90 pop r0 2569a: 0f 90 pop r0 2569c: 0f 90 pop r0 2569e: 0f 90 pop r0 256a0: 0f 90 pop r0 256a2: c3 cf rjmp .-122 ; 0x2562a 000256a4 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 256a4: 8d e1 ldi r24, 0x1D ; 29 256a6: 90 e7 ldi r25, 0x70 ; 112 256a8: 0c 94 97 7b jmp 0xf72e ; 0xf72e 000256ac : * 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) { 256ac: af 92 push r10 256ae: bf 92 push r11 256b0: cf 92 push r12 256b2: df 92 push r13 256b4: ef 92 push r14 256b6: ff 92 push r15 256b8: 0f 93 push r16 256ba: 1f 93 push r17 256bc: cf 93 push r28 256be: df 93 push r29 256c0: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 256c2: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 * @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; 256c6: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 256c8: 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; 256ca: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 256cc: 6f 2d mov r22, r15 256ce: 80 e0 ldi r24, 0x00 ; 0 256d0: 0e 94 26 70 call 0xe04c ; 0xe04c // 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) 256d4: c6 01 movw r24, r12 256d6: 0f 94 30 1d call 0x23a60 ; 0x23a60 256da: 88 23 and r24, r24 256dc: 29 f0 breq .+10 ; 0x256e8 256de: 8f ef ldi r24, 0xFF ; 255 256e0: c8 1a sub r12, r24 256e2: d8 0a sbc r13, r24 256e4: 09 f4 brne .+2 ; 0x256e8 256e6: 49 c0 rjmp .+146 ; 0x2577a 256e8: c6 01 movw r24, r12 256ea: 0f 94 cd da call 0x3b59a ; 0x3b59a <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 256ee: 84 31 cpi r24, 0x14 ; 20 256f0: 91 05 cpc r25, r1 256f2: 10 f0 brcs .+4 ; 0x256f8 256f4: 84 e1 ldi r24, 0x14 ; 20 256f6: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 256f8: e6 01 movw r28, r12 256fa: c8 0f add r28, r24 256fc: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 256fe: e3 e0 ldi r30, 0x03 ; 3 25700: fe 12 cpse r15, r30 25702: 0a c0 rjmp .+20 ; 0x25718 25704: 84 31 cpi r24, 0x14 ; 20 25706: 41 f4 brne .+16 ; 0x25718 // 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; 25708: fe 01 movw r30, r28 2570a: 84 91 lpm r24, Z 2570c: e1 2c mov r14, r1 if (multi_screen) 2570e: 88 23 and r24, r24 25710: 19 f0 breq .+6 ; 0x25718 msgend = (msgend2 -= 2); 25712: 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; 25714: ee 24 eor r14, r14 25716: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 25718: fe 01 movw r30, r28 2571a: 84 91 lpm r24, Z 2571c: 88 23 and r24, r24 2571e: 09 f4 brne .+2 ; 0x25722 25720: 40 c0 rjmp .+128 ; 0x257a2 25722: ce 01 movw r24, r28 25724: 0f 94 30 1d call 0x23a60 ; 0x23a60 25728: 81 11 cpse r24, r1 2572a: 3b c0 rjmp .+118 ; 0x257a2 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); 2572c: fe 01 movw r30, r28 2572e: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 25730: 92 ed ldi r25, 0xD2 ; 210 25732: 98 0f add r25, r24 25734: 92 30 cpi r25, 0x02 ; 2 25736: a8 f1 brcs .+106 ; 0x257a2 25738: 8c 32 cpi r24, 0x2C ; 44 2573a: 99 f1 breq .+102 ; 0x257a2 2573c: 96 ec ldi r25, 0xC6 ; 198 2573e: 98 0f add r25, r24 25740: 92 30 cpi r25, 0x02 ; 2 25742: 78 f1 brcs .+94 ; 0x257a2 25744: 8f 33 cpi r24, 0x3F ; 63 25746: 69 f1 breq .+90 ; 0x257a2 25748: 81 32 cpi r24, 0x21 ; 33 2574a: 59 f1 breq .+86 ; 0x257a2 2574c: 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)) 2574e: c0 16 cp r12, r16 25750: d1 06 cpc r13, r17 25752: 58 f4 brcc .+22 ; 0x2576a 25754: 58 01 movw r10, r16 25756: f1 e0 ldi r31, 0x01 ; 1 25758: af 1a sub r10, r31 2575a: b1 08 sbc r11, r1 2575c: c5 01 movw r24, r10 2575e: 0f 94 30 1d call 0x23a60 ; 0x23a60 25762: 81 11 cpse r24, r1 25764: 1d c0 rjmp .+58 ; 0x257a0 -- msgend; 25766: 85 01 movw r16, r10 25768: f2 cf rjmp .-28 ; 0x2574e if (msgend == msg) 2576a: c0 16 cp r12, r16 2576c: d1 06 cpc r13, r17 2576e: c9 f0 breq .+50 ; 0x257a2 25770: 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) { 25772: f3 94 inc r15 25774: 84 e0 ldi r24, 0x04 ; 4 25776: f8 12 cpse r15, r24 25778: a9 cf rjmp .-174 ; 0x256cc } lcd_print(c); } } if (multi_screen) { 2577a: ee 20 and r14, r14 2577c: f9 f0 breq .+62 ; 0x257bc // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 2577e: 48 e8 ldi r20, 0x88 ; 136 25780: 63 e0 ldi r22, 0x03 ; 3 25782: 83 e1 ldi r24, 0x13 ; 19 25784: 0e 94 46 70 call 0xe08c ; 0xe08c } return multi_screen ? msgend : NULL; } 25788: ce 01 movw r24, r28 2578a: df 91 pop r29 2578c: cf 91 pop r28 2578e: 1f 91 pop r17 25790: 0f 91 pop r16 25792: ff 90 pop r15 25794: ef 90 pop r14 25796: df 90 pop r13 25798: cf 90 pop r12 2579a: bf 90 pop r11 2579c: af 90 pop r10 2579e: 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)) 257a0: 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) { 257a2: cc 16 cp r12, r28 257a4: dd 06 cpc r13, r29 257a6: 28 f7 brcc .-54 ; 0x25772 char c = char(pgm_read_byte(msg)); 257a8: f6 01 movw r30, r12 257aa: 84 91 lpm r24, Z if (c == '\n') { 257ac: 8a 30 cpi r24, 0x0A ; 10 257ae: 09 f3 breq .-62 ; 0x25772 257b0: 0e 94 d5 70 call 0xe1aa ; 0xe1aa -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 257b4: ff ef ldi r31, 0xFF ; 255 257b6: cf 1a sub r12, r31 257b8: df 0a sbc r13, r31 257ba: f3 cf rjmp .-26 ; 0x257a2 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 257bc: d0 e0 ldi r29, 0x00 ; 0 257be: c0 e0 ldi r28, 0x00 ; 0 257c0: e3 cf rjmp .-58 ; 0x25788 000257c2 : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 257c2: 88 ed ldi r24, 0xD8 ; 216 257c4: 9c e4 ldi r25, 0x4C ; 76 257c6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 257ca: 0f 94 56 2b call 0x256ac ; 0x256ac menu_back_if_clicked(); 257ce: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 000257d2 : } _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(); 257d2: 0e 94 b4 78 call 0xf168 ; 0xf168 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 257d6: 10 92 b2 03 sts 0x03B2, r1 ; 0x8003b2 } 257da: 08 95 ret 000257dc : //! |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() { 257dc: cf 93 push r28 257de: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 257e0: 86 ed ldi r24, 0xD6 ; 214 257e2: 9d e4 ldi r25, 0x4D ; 77 257e4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 257e8: ac 01 movw r20, r24 257ea: 60 e0 ldi r22, 0x00 ; 0 257ec: 80 e0 ldi r24, 0x00 ; 0 257ee: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 1, STR_SEPARATOR); 257f2: 40 e1 ldi r20, 0x10 ; 16 257f4: 5d e8 ldi r21, 0x8D ; 141 257f6: 61 e0 ldi r22, 0x01 ; 1 257f8: 80 e0 ldi r24, 0x00 ; 0 257fa: 0e 94 3a 70 call 0xe074 ; 0xe074 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 257fe: 62 e0 ldi r22, 0x02 ; 2 25800: 80 e0 ldi r24, 0x00 ; 0 25802: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25806: 85 ee ldi r24, 0xE5 ; 229 25808: 9f e0 ldi r25, 0x0F ; 15 2580a: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 2580e: 9f 93 push r25 25810: 8f 93 push r24 25812: 7f 93 push r23 25814: 6f 93 push r22 25816: 1f 92 push r1 25818: 88 e5 ldi r24, 0x58 ; 88 2581a: 8f 93 push r24 2581c: cf eb ldi r28, 0xBF ; 191 2581e: d4 ea ldi r29, 0xA4 ; 164 25820: df 93 push r29 25822: cf 93 push r28 25824: 0e 94 ff 6f call 0xdffe ; 0xdffe { 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); 25828: 63 e0 ldi r22, 0x03 ; 3 2582a: 80 e0 ldi r24, 0x00 ; 0 2582c: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25830: 89 ee ldi r24, 0xE9 ; 233 25832: 9f e0 ldi r25, 0x0F ; 15 25834: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 25838: 9f 93 push r25 2583a: 8f 93 push r24 2583c: 7f 93 push r23 2583e: 6f 93 push r22 25840: 1f 92 push r1 25842: 89 e5 ldi r24, 0x59 ; 89 25844: 8f 93 push r24 25846: df 93 push r29 25848: cf 93 push r28 2584a: 0e 94 ff 6f call 0xdffe ; 0xdffe } menu_back_if_clicked(); 2584e: 8d b7 in r24, 0x3d ; 61 25850: 9e b7 in r25, 0x3e ; 62 25852: 40 96 adiw r24, 0x10 ; 16 25854: 0f b6 in r0, 0x3f ; 63 25856: f8 94 cli 25858: 9e bf out 0x3e, r25 ; 62 2585a: 0f be out 0x3f, r0 ; 63 2585c: 8d bf out 0x3d, r24 ; 61 } 2585e: df 91 pop r29 25860: 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(); 25862: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00025866 : //! ---------------------- //! 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() { 25866: cf 92 push r12 25868: df 92 push r13 2586a: ef 92 push r14 2586c: ff 92 push r15 2586e: 0f 93 push r16 25870: 1f 93 push r17 25872: cf 93 push r28 25874: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 25876: 80 e6 ldi r24, 0x60 ; 96 25878: 9f e0 ldi r25, 0x0F ; 15 2587a: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 2587e: 6b 01 movw r12, r22 25880: 7c 01 movw r14, r24 lcd_home(); 25882: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_printf_P(_N( 25886: 88 ec ldi r24, 0xC8 ; 200 25888: 9d e4 ldi r25, 0x4D ; 77 2588a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2588e: 18 2f mov r17, r24 25890: 09 2f mov r16, r25 25892: 8a eb ldi r24, 0xBA ; 186 25894: 9d e4 ldi r25, 0x4D ; 77 25896: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2589a: ec 01 movw r28, r24 2589c: 8a ea ldi r24, 0xAA ; 170 2589e: 9d e4 ldi r25, 0x4D ; 77 258a0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 258a4: 2e e3 ldi r18, 0x3E ; 62 258a6: 2f 93 push r18 258a8: 20 e8 ldi r18, 0x80 ; 128 258aa: 2f 93 push r18 258ac: 1f 92 push r1 258ae: 1f 92 push r1 258b0: 0f 93 push r16 258b2: 1f 93 push r17 258b4: 2d e3 ldi r18, 0x3D ; 61 258b6: 2f 93 push r18 258b8: 25 ef ldi r18, 0xF5 ; 245 258ba: 2f 93 push r18 258bc: 22 ec ldi r18, 0xC2 ; 194 258be: 2f 93 push r18 258c0: 20 e9 ldi r18, 0x90 ; 144 258c2: 2f 93 push r18 258c4: df 93 push r29 258c6: cf 93 push r28 258c8: 20 e1 ldi r18, 0x10 ; 16 258ca: 3d e8 ldi r19, 0x8D ; 141 258cc: 3f 93 push r19 258ce: 2f 93 push r18 258d0: 9f 93 push r25 258d2: 8f 93 push r24 258d4: 81 ed ldi r24, 0xD1 ; 209 258d6: 90 e7 ldi r25, 0x70 ; 112 258d8: 9f 93 push r25 258da: 8f 93 push r24 258dc: 0e 94 ff 6f call 0xdffe ; 0xdffe _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); 258e0: 60 e0 ldi r22, 0x00 ; 0 258e2: 8f e0 ldi r24, 0x0F ; 15 258e4: 0e 94 26 70 call 0xe04c ; 0xe04c if (angleDiff < 100){ 258e8: 8d b7 in r24, 0x3d ; 61 258ea: 9e b7 in r25, 0x3e ; 62 258ec: 42 96 adiw r24, 0x12 ; 18 258ee: 0f b6 in r0, 0x3f ; 63 258f0: f8 94 cli 258f2: 9e bf out 0x3e, r25 ; 62 258f4: 0f be out 0x3f, r0 ; 63 258f6: 8d bf out 0x3d, r24 ; 61 258f8: 20 e0 ldi r18, 0x00 ; 0 258fa: 30 e0 ldi r19, 0x00 ; 0 258fc: 48 ec ldi r20, 0xC8 ; 200 258fe: 52 e4 ldi r21, 0x42 ; 66 25900: c7 01 movw r24, r14 25902: b6 01 movw r22, r12 25904: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 25908: 87 ff sbrs r24, 7 2590a: 32 c0 rjmp .+100 ; 0x25970 } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 2590c: 20 e0 ldi r18, 0x00 ; 0 2590e: 30 e0 ldi r19, 0x00 ; 0 25910: 44 e3 ldi r20, 0x34 ; 52 25912: 53 e4 ldi r21, 0x43 ; 67 25914: c7 01 movw r24, r14 25916: b6 01 movw r22, r12 25918: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 2591c: 2b ed ldi r18, 0xDB ; 219 2591e: 3f e0 ldi r19, 0x0F ; 15 25920: 49 e4 ldi r20, 0x49 ; 73 25922: 50 e4 ldi r21, 0x40 ; 64 25924: 0f 94 36 df call 0x3be6c ; 0x3be6c <__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)); 25928: 9f 93 push r25 2592a: 8f 93 push r24 2592c: 7f 93 push r23 2592e: 6f 93 push r22 25930: 8a ec ldi r24, 0xCA ; 202 25932: 90 e7 ldi r25, 0x70 ; 112 25934: 9f 93 push r25 25936: 8f 93 push r24 25938: 0e 94 ff 6f call 0xdffe ; 0xdffe 2593c: 0f 90 pop r0 2593e: 0f 90 pop r0 25940: 0f 90 pop r0 25942: 0f 90 pop r0 25944: 0f 90 pop r0 25946: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 25948: 0e 94 43 72 call 0xe486 ; 0xe486 2594c: 88 23 and r24, r24 2594e: b9 f0 breq .+46 ; 0x2597e menu_goto(lcd_menu_xyz_offset, 0, true); 25950: 20 e0 ldi r18, 0x00 ; 0 25952: 41 e0 ldi r20, 0x01 ; 1 25954: 70 e0 ldi r23, 0x00 ; 0 25956: 60 e0 ldi r22, 0x00 ; 0 25958: 8e ec ldi r24, 0xCE ; 206 2595a: 99 e3 ldi r25, 0x39 ; 57 } 2595c: df 91 pop r29 2595e: cf 91 pop r28 25960: 1f 91 pop r17 25962: 0f 91 pop r16 25964: ff 90 pop r15 25966: ef 90 pop r14 25968: df 90 pop r13 2596a: 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); 2596c: 0d 94 b8 ce jmp 0x39d70 ; 0x39d70 ); 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)); 25970: 8c e4 ldi r24, 0x4C ; 76 25972: 9d e3 ldi r25, 0x3D ; 61 25974: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25978: 0e 94 11 70 call 0xe022 ; 0xe022 2597c: e5 cf rjmp .-54 ; 0x25948 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 2597e: df 91 pop r29 25980: cf 91 pop r28 25982: 1f 91 pop r17 25984: 0f 91 pop r16 25986: ff 90 pop r15 25988: ef 90 pop r14 2598a: df 90 pop r13 2598c: cf 90 pop r12 2598e: 08 95 ret 00025990 <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 25990: 2f 92 push r2 25992: 3f 92 push r3 25994: 4f 92 push r4 25996: 5f 92 push r5 25998: 6f 92 push r6 2599a: 7f 92 push r7 2599c: 9f 92 push r9 2599e: af 92 push r10 259a0: bf 92 push r11 259a2: cf 92 push r12 259a4: df 92 push r13 259a6: ef 92 push r14 259a8: ff 92 push r15 259aa: 0f 93 push r16 259ac: 1f 93 push r17 259ae: cf 93 push r28 259b0: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 259b2: 70 91 55 0e lds r23, 0x0E55 ; 0x800e55 259b6: 71 11 cpse r23, r1 259b8: 04 c0 rjmp .+8 ; 0x259c2 <_lcd_move(char const*, unsigned char, int, int)+0x32> 259ba: 70 91 56 0e lds r23, 0x0E56 ; 0x800e56 259be: 77 23 and r23, r23 259c0: 99 f0 breq .+38 ; 0x259e8 <_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(); } 259c2: df 91 pop r29 259c4: cf 91 pop r28 259c6: 1f 91 pop r17 259c8: 0f 91 pop r16 259ca: ff 90 pop r15 259cc: ef 90 pop r14 259ce: df 90 pop r13 259d0: cf 90 pop r12 259d2: bf 90 pop r11 259d4: af 90 pop r10 259d6: 9f 90 pop r9 259d8: 7f 90 pop r7 259da: 6f 90 pop r6 259dc: 5f 90 pop r5 259de: 4f 90 pop r4 259e0: 3f 90 pop r3 259e2: 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(); 259e4: 0d 94 56 d1 jmp 0x3a2ac ; 0x3a2ac 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) 259e8: 70 91 a5 03 lds r23, 0x03A5 ; 0x8003a5 259ec: 71 11 cpse r23, r1 259ee: 09 c0 rjmp .+18 ; 0x25a02 <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 259f0: 70 91 8f 02 lds r23, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 259f4: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> { _md->endstopsEnabledPrevious = enable_endstops(false); 259f8: 70 93 a6 03 sts 0x03A6, r23 ; 0x8003a6 _md->initialized = true; 259fc: 71 e0 ldi r23, 0x01 ; 1 259fe: 70 93 a5 03 sts 0x03A5, r23 ; 0x8003a5 25a02: 19 01 movw r2, r18 25a04: 6a 01 movw r12, r20 25a06: c6 2f mov r28, r22 25a08: d9 2f mov r29, r25 25a0a: 98 2e mov r9, r24 } if (lcd_encoder != 0) 25a0c: 80 91 34 05 lds r24, 0x0534 ; 0x800534 25a10: 90 91 35 05 lds r25, 0x0535 ; 0x800535 25a14: 89 2b or r24, r25 25a16: 09 f4 brne .+2 ; 0x25a1a <_lcd_move(char const*, unsigned char, int, int)+0x8a> 25a18: 71 c0 rjmp .+226 ; 0x25afc <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 25a1a: 0e 94 09 68 call 0xd012 ; 0xd012 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; 25a1e: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 if (++ next_block_index == BLOCK_BUFFER_SIZE) 25a22: 8f 5f subi r24, 0xFF ; 255 25a24: 80 31 cpi r24, 0x10 ; 16 25a26: 09 f4 brne .+2 ; 0x25a2a <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 25a28: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 25a2a: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 if (! planner_queue_full()) 25a2e: 98 17 cp r25, r24 25a30: 09 f4 brne .+2 ; 0x25a34 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 25a32: 64 c0 rjmp .+200 ; 0x25afc <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 25a34: 84 e0 ldi r24, 0x04 ; 4 25a36: c8 9f mul r28, r24 25a38: 80 01 movw r16, r0 25a3a: 11 24 eor r1, r1 25a3c: f8 01 movw r30, r16 25a3e: e0 5c subi r30, 0xC0 ; 192 25a40: f8 4f sbci r31, 0xF8 ; 248 25a42: 5f 01 movw r10, r30 25a44: 60 91 34 05 lds r22, 0x0534 ; 0x800534 25a48: 70 91 35 05 lds r23, 0x0535 ; 0x800535 25a4c: 07 2e mov r0, r23 25a4e: 00 0c add r0, r0 25a50: 88 0b sbc r24, r24 25a52: 99 0b sbc r25, r25 25a54: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 25a58: f5 01 movw r30, r10 25a5a: 20 81 ld r18, Z 25a5c: 31 81 ldd r19, Z+1 ; 0x01 25a5e: 42 81 ldd r20, Z+2 ; 0x02 25a60: 53 81 ldd r21, Z+3 ; 0x03 25a62: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 25a66: 2b 01 movw r4, r22 25a68: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25a6a: b6 01 movw r22, r12 25a6c: dd 0c add r13, r13 25a6e: 88 0b sbc r24, r24 25a70: 99 0b sbc r25, r25 25a72: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 25a76: 6b 01 movw r12, r22 25a78: 7c 01 movw r14, r24 25a7a: ac 01 movw r20, r24 25a7c: 9b 01 movw r18, r22 25a7e: c3 01 movw r24, r6 25a80: b2 01 movw r22, r4 25a82: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 25a86: f5 01 movw r30, r10 25a88: 87 fd sbrc r24, 7 25a8a: 7d c0 rjmp .+250 ; 0x25b86 <_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; 25a8c: 40 82 st Z, r4 25a8e: 51 82 std Z+1, r5 ; 0x01 25a90: 62 82 std Z+2, r6 ; 0x02 25a92: 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; 25a94: b1 01 movw r22, r2 25a96: 33 0c add r3, r3 25a98: 88 0b sbc r24, r24 25a9a: 99 0b sbc r25, r25 25a9c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 25aa0: 2b 01 movw r4, r22 25aa2: 3c 01 movw r6, r24 25aa4: c8 01 movw r24, r16 25aa6: 80 5c subi r24, 0xC0 ; 192 25aa8: 98 4f sbci r25, 0xF8 ; 248 25aaa: 7c 01 movw r14, r24 25aac: a3 01 movw r20, r6 25aae: 92 01 movw r18, r4 25ab0: fc 01 movw r30, r24 25ab2: 60 81 ld r22, Z 25ab4: 71 81 ldd r23, Z+1 ; 0x01 25ab6: 82 81 ldd r24, Z+2 ; 0x02 25ab8: 93 81 ldd r25, Z+3 ; 0x03 25aba: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 25abe: 18 16 cp r1, r24 25ac0: 2c f4 brge .+10 ; 0x25acc <_lcd_move(char const*, unsigned char, int, int)+0x13c> 25ac2: f7 01 movw r30, r14 25ac4: 40 82 st Z, r4 25ac6: 51 82 std Z+1, r5 ; 0x01 25ac8: 62 82 std Z+2, r6 ; 0x02 25aca: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 25acc: 10 92 35 05 sts 0x0535, r1 ; 0x800535 25ad0: 10 92 34 05 sts 0x0534, r1 ; 0x800534 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 25ad4: 64 e4 ldi r22, 0x44 ; 68 25ad6: 77 e0 ldi r23, 0x07 ; 7 25ad8: 80 e4 ldi r24, 0x40 ; 64 25ada: 97 e0 ldi r25, 0x07 ; 7 25adc: 0e 94 f0 6b call 0xd7e0 ; 0xd7e0 plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 25ae0: f8 01 movw r30, r16 25ae2: e8 50 subi r30, 0x08 ; 8 25ae4: fd 4f sbci r31, 0xFD ; 253 25ae6: 60 81 ld r22, Z 25ae8: 71 81 ldd r23, Z+1 ; 0x01 25aea: 82 81 ldd r24, Z+2 ; 0x02 25aec: 93 81 ldd r25, Z+3 ; 0x03 25aee: 0e 94 0d 68 call 0xd01a ; 0xd01a 25af2: 0f 94 11 ba call 0x37422 ; 0x37422 lcd_draw_update = 1; 25af6: 81 e0 ldi r24, 0x01 ; 1 25af8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 25afc: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25b00: 88 23 and r24, r24 25b02: 11 f1 breq .+68 ; 0x25b48 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 25b04: 61 e0 ldi r22, 0x01 ; 1 25b06: 80 e0 ldi r24, 0x00 ; 0 25b08: 0e 94 26 70 call 0xe04c ; 0xe04c menu_draw_float31(name, current_position[axis]); 25b0c: 84 e0 ldi r24, 0x04 ; 4 25b0e: c8 9f mul r28, r24 25b10: f0 01 movw r30, r0 25b12: 11 24 eor r1, r1 25b14: e0 5c subi r30, 0xC0 ; 192 25b16: 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); 25b18: 83 81 ldd r24, Z+3 ; 0x03 25b1a: 8f 93 push r24 25b1c: 82 81 ldd r24, Z+2 ; 0x02 25b1e: 8f 93 push r24 25b20: 81 81 ldd r24, Z+1 ; 0x01 25b22: 8f 93 push r24 25b24: 80 81 ld r24, Z 25b26: 8f 93 push r24 25b28: df 93 push r29 25b2a: 9f 92 push r9 25b2c: 86 ea ldi r24, 0xA6 ; 166 25b2e: 94 ea ldi r25, 0xA4 ; 164 25b30: 9f 93 push r25 25b32: 8f 93 push r24 25b34: 0e 94 ff 6f call 0xdffe ; 0xdffe 25b38: ed b7 in r30, 0x3d ; 61 25b3a: fe b7 in r31, 0x3e ; 62 25b3c: 38 96 adiw r30, 0x08 ; 8 25b3e: 0f b6 in r0, 0x3f ; 63 25b40: f8 94 cli 25b42: fe bf out 0x3e, r31 ; 62 25b44: 0f be out 0x3f, r0 ; 63 25b46: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 25b48: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf 25b4c: 81 11 cpse r24, r1 25b4e: 04 c0 rjmp .+8 ; 0x25b58 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 25b50: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 25b54: 88 23 and r24, r24 25b56: 21 f0 breq .+8 ; 0x25b60 <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 25b58: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 25b5c: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> menu_back_if_clicked(); } 25b60: df 91 pop r29 25b62: cf 91 pop r28 25b64: 1f 91 pop r17 25b66: 0f 91 pop r16 25b68: ff 90 pop r15 25b6a: ef 90 pop r14 25b6c: df 90 pop r13 25b6e: cf 90 pop r12 25b70: bf 90 pop r11 25b72: af 90 pop r10 25b74: 9f 90 pop r9 25b76: 7f 90 pop r7 25b78: 6f 90 pop r6 25b7a: 5f 90 pop r5 25b7c: 4f 90 pop r4 25b7e: 3f 90 pop r3 25b80: 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(); 25b82: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25b86: c0 82 st Z, r12 25b88: d1 82 std Z+1, r13 ; 0x01 25b8a: e2 82 std Z+2, r14 ; 0x02 25b8c: f3 82 std Z+3, r15 ; 0x03 25b8e: 82 cf rjmp .-252 ; 0x25a94 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00025b90 : } // 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); 25b90: 2f ef ldi r18, 0xFF ; 255 25b92: 30 e0 ldi r19, 0x00 ; 0 25b94: 50 e0 ldi r21, 0x00 ; 0 25b96: 40 e0 ldi r20, 0x00 ; 0 25b98: 60 e0 ldi r22, 0x00 ; 0 25b9a: 8a ec ldi r24, 0xCA ; 202 25b9c: 94 ea ldi r25, 0xA4 ; 164 25b9e: 0d 94 c8 2c jmp 0x25990 ; 0x25990 <_lcd_move(char const*, unsigned char, int, int)> 00025ba2 : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 25ba2: 24 ed ldi r18, 0xD4 ; 212 25ba4: 30 e0 ldi r19, 0x00 ; 0 25ba6: 4c ef ldi r20, 0xFC ; 252 25ba8: 5f ef ldi r21, 0xFF ; 255 25baa: 61 e0 ldi r22, 0x01 ; 1 25bac: 8d ec ldi r24, 0xCD ; 205 25bae: 94 ea ldi r25, 0xA4 ; 164 25bb0: 0d 94 c8 2c jmp 0x25990 ; 0x25990 <_lcd_move(char const*, unsigned char, int, int)> 00025bb4 : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 25bb4: 22 ed ldi r18, 0xD2 ; 210 25bb6: 30 e0 ldi r19, 0x00 ; 0 25bb8: 50 e0 ldi r21, 0x00 ; 0 25bba: 40 e0 ldi r20, 0x00 ; 0 25bbc: 62 e0 ldi r22, 0x02 ; 2 25bbe: 80 ed ldi r24, 0xD0 ; 208 25bc0: 94 ea ldi r25, 0xA4 ; 164 25bc2: 0d 94 c8 2c jmp 0x25990 ; 0x25990 <_lcd_move(char const*, unsigned char, int, int)> 00025bc6 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 25bc6: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 25bca: 81 11 cpse r24, r1 25bcc: 03 c0 rjmp .+6 ; 0x25bd4 25bce: 82 e0 ldi r24, 0x02 ; 2 25bd0: 0d 94 3a d1 jmp 0x3a274 ; 0x3a274 25bd4: 81 e0 ldi r24, 0x01 ; 1 25bd6: fc cf rjmp .-8 ; 0x25bd0 00025bd8 : } // 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); 25bd8: 5f 93 push r21 25bda: 4f 93 push r20 25bdc: 7f 93 push r23 25bde: 6f 93 push r22 25be0: 28 2f mov r18, r24 25be2: 08 2e mov r0, r24 25be4: 00 0c add r0, r0 25be6: 33 0b sbc r19, r19 25be8: 3f 93 push r19 25bea: 8f 93 push r24 25bec: 8f ea ldi r24, 0xAF ; 175 25bee: 9f e6 ldi r25, 0x6F ; 111 25bf0: 9f 93 push r25 25bf2: 8f 93 push r24 25bf4: 0e 94 ff 6f call 0xdffe ; 0xdffe lcd_space(9 - chars); 25bf8: 2d b7 in r18, 0x3d ; 61 25bfa: 3e b7 in r19, 0x3e ; 62 25bfc: 28 5f subi r18, 0xF8 ; 248 25bfe: 3f 4f sbci r19, 0xFF ; 255 25c00: 0f b6 in r0, 0x3f ; 63 25c02: f8 94 cli 25c04: 3e bf out 0x3e, r19 ; 62 25c06: 0f be out 0x3f, r0 ; 63 25c08: 2d bf out 0x3d, r18 ; 61 25c0a: 99 e0 ldi r25, 0x09 ; 9 25c0c: 98 1b sub r25, r24 25c0e: 89 2f mov r24, r25 25c10: 0c 94 1c 70 jmp 0xe038 ; 0xe038 00025c14 : default: return false; } } void lcd_print_target_temps_first_line() { 25c14: cf 93 push r28 25c16: df 93 push r29 lcd_home(); 25c18: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 25c1c: c0 91 6a 0e lds r28, 0x0E6A ; 0x800e6a 25c20: d0 91 6b 0e lds r29, 0x0E6B ; 0x800e6b 25c24: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 25c28: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 25c2c: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 25c30: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 25c34: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 25c38: ae 01 movw r20, r28 25c3a: 82 e8 ldi r24, 0x82 ; 130 25c3c: 0f 94 ec 2d call 0x25bd8 ; 0x25bd8 lcd_set_cursor(10, 0); 25c40: 60 e0 ldi r22, 0x00 ; 0 25c42: 8a e0 ldi r24, 0x0A ; 10 25c44: 0e 94 26 70 call 0xe04c ; 0xe04c FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 25c48: c0 91 68 0e lds r28, 0x0E68 ; 0x800e68 25c4c: d0 91 69 0e lds r29, 0x0E69 ; 0x800e69 int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 25c50: 20 97 sbiw r28, 0x00 ; 0 25c52: 81 f0 breq .+32 ; 0x25c74 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 25c54: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 25c58: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 25c5c: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 25c60: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 25c64: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 25c68: ae 01 movw r20, r28 25c6a: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 25c6c: df 91 pop r29 25c6e: 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); 25c70: 0d 94 ec 2d jmp 0x25bd8 ; 0x25bd8 } else { lcd_space(10); 25c74: 8a e0 ldi r24, 0x0A ; 10 } } 25c76: df 91 pop r29 25c78: 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); 25c7a: 0c 94 1c 70 jmp 0xe038 ; 0xe038 00025c7e : 25c7e: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 25c82: 0f 94 0a 2e call 0x25c14 ; 0x25c14 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 25c86: 83 e3 ldi r24, 0x33 ; 51 25c88: 9c e4 ldi r25, 0x4C ; 76 25c8a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25c8e: ac 01 movw r20, r24 25c90: 61 e0 ldi r22, 0x01 ; 1 25c92: 80 e0 ldi r24, 0x00 ; 0 25c94: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(0,2); 25c98: 62 e0 ldi r22, 0x02 ; 2 25c9a: 80 e0 ldi r24, 0x00 ; 0 25c9c: 0e 94 26 70 call 0xe04c ; 0xe04c switch(eFilamentAction) { 25ca0: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 25ca4: 83 30 cpi r24, 0x03 ; 3 25ca6: 81 f1 breq .+96 ; 0x25d08 25ca8: 48 f4 brcc .+18 ; 0x25cbc 25caa: 81 30 cpi r24, 0x01 ; 1 25cac: 60 f0 brcs .+24 ; 0x25cc6 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 25cae: 80 e2 ldi r24, 0x20 ; 32 25cb0: 9c e4 ldi r25, 0x4C ; 76 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 25cb2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25cb6: 0e 94 11 70 call 0xe022 ; 0xe022 25cba: 05 c0 rjmp .+10 ; 0x25cc6 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) { 25cbc: 85 30 cpi r24, 0x05 ; 5 25cbe: 21 f1 breq .+72 ; 0x25d08 25cc0: b0 f3 brcs .-20 ; 0x25cae 25cc2: 88 30 cpi r24, 0x08 ; 8 25cc4: a1 f3 breq .-24 ; 0x25cae case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 25cc6: 0e 94 43 72 call 0xe486 ; 0xe486 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 25cca: 81 11 cpse r24, r1 25ccc: 09 c0 rjmp .+18 ; 0x25ce0 25cce: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 25cd2: 81 50 subi r24, 0x01 ; 1 25cd4: 82 30 cpi r24, 0x02 ; 2 25cd6: 28 f5 brcc .+74 ; 0x25d22 25cd8: 80 91 89 17 lds r24, 0x1789 ; 0x801789 25cdc: 88 23 and r24, r24 25cde: 09 f1 breq .+66 ; 0x25d22 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 25ce0: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 25ce4: 81 11 cpse r24, r1 25ce6: 13 c0 rjmp .+38 ; 0x25d0e 25ce8: 83 e0 ldi r24, 0x03 ; 3 25cea: 0f 94 3a d1 call 0x3a274 ; 0x3a274 switch(eFilamentAction) { 25cee: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 25cf2: 82 30 cpi r24, 0x02 ; 2 25cf4: 71 f0 breq .+28 ; 0x25d12 25cf6: 83 30 cpi r24, 0x03 ; 3 25cf8: 81 f0 breq .+32 ; 0x25d1a 25cfa: 81 30 cpi r24, 0x01 ; 1 25cfc: 91 f4 brne .+36 ; 0x25d22 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 25cfe: 61 e0 ldi r22, 0x01 ; 1 25d00: 87 e6 ldi r24, 0x67 ; 103 25d02: 90 e7 ldi r25, 0x70 ; 112 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25d04: 0c 94 dc 89 jmp 0x113b8 ; 0x113b8 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)); 25d08: 8b e0 ldi r24, 0x0B ; 11 25d0a: 9c e4 ldi r25, 0x4C ; 76 25d0c: d2 cf rjmp .-92 ; 0x25cb2 #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); 25d0e: 82 e0 ldi r24, 0x02 ; 2 25d10: ec cf rjmp .-40 ; 0x25cea switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 25d12: 81 e0 ldi r24, 0x01 ; 1 25d14: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 25d18: f2 cf rjmp .-28 ; 0x25cfe [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25d1a: 61 e0 ldi r22, 0x01 ; 1 25d1c: 86 ef ldi r24, 0xF6 ; 246 25d1e: 9c e6 ldi r25, 0x6C ; 108 25d20: f1 cf rjmp .-30 ; 0x25d04 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 25d22: 08 95 ret 00025d24 : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 25d24: cf 92 push r12 25d26: df 92 push r13 25d28: ef 92 push r14 25d2a: ff 92 push r15 25d2c: 0f 93 push r16 25d2e: 1f 93 push r17 25d30: cf 93 push r28 25d32: df 93 push r29 25d34: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25d38: 60 91 56 06 lds r22, 0x0656 ; 0x800656 25d3c: 70 91 57 06 lds r23, 0x0657 ; 0x800657 25d40: 07 2e mov r0, r23 25d42: 00 0c add r0, r0 25d44: 88 0b sbc r24, r24 25d46: 99 0b sbc r25, r25 25d48: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 25d4c: 20 e0 ldi r18, 0x00 ; 0 25d4e: 30 ec ldi r19, 0xC0 ; 192 25d50: 4f e7 ldi r20, 0x7F ; 127 25d52: 56 e4 ldi r21, 0x46 ; 70 25d54: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 25d58: 20 e0 ldi r18, 0x00 ; 0 25d5a: 30 e0 ldi r19, 0x00 ; 0 25d5c: 40 ea ldi r20, 0xA0 ; 160 25d5e: 50 e4 ldi r21, 0x40 ; 64 25d60: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 25d64: 27 ed ldi r18, 0xD7 ; 215 25d66: 30 e3 ldi r19, 0x30 ; 48 25d68: 44 e4 ldi r20, 0x44 ; 68 25d6a: 5e e3 ldi r21, 0x3E ; 62 25d6c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 25d70: eb 01 movw r28, r22 25d72: 18 2f mov r17, r24 25d74: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25d76: 60 91 54 06 lds r22, 0x0654 ; 0x800654 25d7a: 70 91 55 06 lds r23, 0x0655 ; 0x800655 25d7e: 07 2e mov r0, r23 25d80: 00 0c add r0, r0 25d82: 88 0b sbc r24, r24 25d84: 99 0b sbc r25, r25 25d86: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 25d8a: 20 e0 ldi r18, 0x00 ; 0 25d8c: 30 ec ldi r19, 0xC0 ; 192 25d8e: 4f e7 ldi r20, 0x7F ; 127 25d90: 56 e4 ldi r21, 0x46 ; 70 25d92: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 25d96: 20 e0 ldi r18, 0x00 ; 0 25d98: 30 e0 ldi r19, 0x00 ; 0 25d9a: 40 ea ldi r20, 0xA0 ; 160 25d9c: 50 e4 ldi r21, 0x40 ; 64 25d9e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 25da2: 27 ed ldi r18, 0xD7 ; 215 25da4: 30 e3 ldi r19, 0x30 ; 48 25da6: 44 e4 ldi r20, 0x44 ; 68 25da8: 5e e3 ldi r21, 0x3E ; 62 25daa: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 25dae: f6 2e mov r15, r22 25db0: e7 2e mov r14, r23 25db2: d8 2e mov r13, r24 25db4: c9 2e mov r12, r25 lcd_home(); 25db6: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 25dba: cf 92 push r12 25dbc: df 92 push r13 25dbe: ef 92 push r14 25dc0: ff 92 push r15 25dc2: 0f 93 push r16 25dc4: 1f 93 push r17 25dc6: df 93 push r29 25dc8: cf 93 push r28 25dca: 81 eb ldi r24, 0xB1 ; 177 25dcc: 92 ea ldi r25, 0xA2 ; 162 25dce: 9f 93 push r25 25dd0: 8f 93 push r24 25dd2: 0e 94 ff 6f call 0xdffe ; 0xdffe #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) lcd_printf_P(PSTR("\n IR : %3.1fV"), Raw2Voltage(fsensor.getVoltRaw())); 25dd6: 0f 94 62 7b call 0x2f6c4 ; 0x2f6c4 25dda: bc 01 movw r22, r24 25ddc: 90 e0 ldi r25, 0x00 ; 0 25dde: 80 e0 ldi r24, 0x00 ; 0 25de0: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 25de4: 20 e0 ldi r18, 0x00 ; 0 25de6: 30 ec ldi r19, 0xC0 ; 192 25de8: 4f e7 ldi r20, 0x7F ; 127 25dea: 56 e4 ldi r21, 0x46 ; 70 25dec: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 25df0: 20 e0 ldi r18, 0x00 ; 0 25df2: 30 e0 ldi r19, 0x00 ; 0 25df4: 40 ea ldi r20, 0xA0 ; 160 25df6: 50 e4 ldi r21, 0x40 ; 64 25df8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 25dfc: 9f 93 push r25 25dfe: 8f 93 push r24 25e00: 7f 93 push r23 25e02: 6f 93 push r22 25e04: 8d e9 ldi r24, 0x9D ; 157 25e06: 92 ea ldi r25, 0xA2 ; 162 25e08: 9f 93 push r25 25e0a: 8f 93 push r24 25e0c: 0e 94 ff 6f call 0xdffe ; 0xdffe #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) menu_back_if_clicked(); 25e10: 8d b7 in r24, 0x3d ; 61 25e12: 9e b7 in r25, 0x3e ; 62 25e14: 40 96 adiw r24, 0x10 ; 16 25e16: 0f b6 in r0, 0x3f ; 63 25e18: f8 94 cli 25e1a: 9e bf out 0x3e, r25 ; 62 25e1c: 0f be out 0x3f, r0 ; 63 25e1e: 8d bf out 0x3d, r24 ; 61 } 25e20: df 91 pop r29 25e22: cf 91 pop r28 25e24: 1f 91 pop r17 25e26: 0f 91 pop r16 25e28: ff 90 pop r15 25e2a: ef 90 pop r14 25e2c: df 90 pop r13 25e2e: 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(); 25e30: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00025e34 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 25e34: ef 92 push r14 25e36: ff 92 push r15 25e38: 0f 93 push r16 25e3a: 1f 93 push r17 25e3c: cf 93 push r28 25e3e: 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) 25e40: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 25e44: 88 23 and r24, r24 25e46: 29 f0 breq .+10 ; 0x25e52 25e48: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 25e4c: 92 30 cpi r25, 0x02 ; 2 25e4e: 09 f0 breq .+2 ; 0x25e52 25e50: 8c c1 rjmp .+792 ; 0x2616a { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 25e52: 81 e0 ldi r24, 0x01 ; 1 25e54: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 25e58: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 25e5c: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 if (_md->is_flash_air) { 25e60: 88 23 and r24, r24 25e62: 21 f0 breq .+8 ; 0x25e6c card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 25e64: 87 ea ldi r24, 0xA7 ; 167 25e66: 93 e0 ldi r25, 0x03 ; 3 25e68: 0f 94 ff 84 call 0x309fe ; 0x309fe { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 25e6c: 0f 94 8e ce call 0x39d1c ; 0x39d1c 25e70: 10 92 12 05 sts 0x0512, r1 ; 0x800512 if (((menu_item - 1) == menu_line) && lcd_draw_update) { lcd_set_cursor(6, menu_row); MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 25e74: 85 e1 ldi r24, 0x15 ; 21 25e76: e8 2e mov r14, r24 25e78: 83 ea ldi r24, 0xA3 ; 163 25e7a: 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]); 25e7c: c4 ee ldi r28, 0xE4 ; 228 25e7e: d2 ea ldi r29, 0xA2 ; 162 25e80: 0b ea ldi r16, 0xAB ; 171 25e82: 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(); 25e84: 80 91 12 05 lds r24, 0x0512 ; 0x800512 25e88: 84 30 cpi r24, 0x04 ; 4 25e8a: 08 f0 brcs .+2 ; 0x25e8e 25e8c: 95 c1 rjmp .+810 ; 0x261b8 25e8e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 25e92: 8e e0 ldi r24, 0x0E ; 14 25e94: 9e e3 ldi r25, 0x3E ; 62 25e96: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25e9a: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR("Firmware:")); 25e9e: 89 e8 ldi r24, 0x89 ; 137 25ea0: 93 ea ldi r25, 0xA3 ; 163 25ea2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 25ea6: 8c e7 ldi r24, 0x7C ; 124 25ea8: 93 ea ldi r25, 0xA3 ; 163 25eaa: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 25eae: 8e e6 ldi r24, 0x6E ; 110 25eb0: 93 ea ldi r25, 0xA3 ; 163 25eb2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 25eb6: 8e e5 ldi r24, 0x5E ; 94 25eb8: 93 ea ldi r25, 0xA3 ; 163 25eba: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 25ebe: 8b e5 ldi r24, 0x5B ; 91 25ec0: 90 e7 ldi r25, 0x70 ; 112 25ec2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 25ec6: 89 e4 ldi r24, 0x49 ; 73 25ec8: 90 e7 ldi r25, 0x70 ; 112 25eca: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 25ece: 88 e3 ldi r24, 0x38 ; 56 25ed0: 90 e7 ldi r25, 0x70 ; 112 25ed2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(STR_SEPARATOR); 25ed6: 80 e1 ldi r24, 0x10 ; 16 25ed8: 9d e8 ldi r25, 0x8D ; 141 25eda: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 25ede: 82 e5 ldi r24, 0x52 ; 82 25ee0: 93 ea ldi r25, 0xA3 ; 163 25ee2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 25ee6: 88 e4 ldi r24, 0x48 ; 72 25ee8: 93 ea ldi r25, 0xA3 ; 163 25eea: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 25eee: 8e e3 ldi r24, 0x3E ; 62 25ef0: 93 ea ldi r25, 0xA3 ; 163 25ef2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(STR_SEPARATOR); 25ef6: 80 e1 ldi r24, 0x10 ; 16 25ef8: 9d e8 ldi r25, 0x8D ; 141 25efa: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(_T(MSG_DATE)); 25efe: 83 e0 ldi r24, 0x03 ; 3 25f00: 9c e4 ldi r25, 0x4C ; 76 25f02: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25f06: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 25f0a: 83 e3 ldi r24, 0x33 ; 51 25f0c: 93 ea ldi r25, 0xA3 ; 163 25f0e: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 25f12: 80 e1 ldi r24, 0x10 ; 16 25f14: 9d e8 ldi r25, 0x8D ; 141 25f16: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR("Fil. sensor v.:")); 25f1a: 83 e2 ldi r24, 0x23 ; 35 25f1c: 93 ea ldi r25, 0xA3 ; 163 25f1e: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(fsensor.getIRVersionText()); 25f22: 0f 94 6a 7b call 0x2f6d4 ; 0x2f6d4 25f26: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 25f2a: 80 e1 ldi r24, 0x10 ; 16 25f2c: 9d e8 ldi r25, 0x8D ; 141 25f2e: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 if (MMU2::mmu2.Enabled()) 25f32: 80 91 95 13 lds r24, 0x1395 ; 0x801395 25f36: 81 30 cpi r24, 0x01 ; 1 25f38: 09 f0 breq .+2 ; 0x25f3c 25f3a: 39 c1 rjmp .+626 ; 0x261ae { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 25f3c: 83 ef ldi r24, 0xF3 ; 243 25f3e: 9b e4 ldi r25, 0x4B ; 75 25f40: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 25f44: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 25f48: 8e e1 ldi r24, 0x1E ; 30 25f4a: 93 ea ldi r25, 0xA3 ; 163 25f4c: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 if (((menu_item - 1) == menu_line) && lcd_draw_update) 25f50: 80 91 15 05 lds r24, 0x0515 ; 0x800515 25f54: 81 50 subi r24, 0x01 ; 1 25f56: 99 0b sbc r25, r25 25f58: 20 91 14 05 lds r18, 0x0514 ; 0x800514 25f5c: 28 17 cp r18, r24 25f5e: 19 06 cpc r1, r25 25f60: 49 f5 brne .+82 ; 0x25fb4 25f62: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25f66: 88 23 and r24, r24 25f68: 29 f1 breq .+74 ; 0x25fb4 { lcd_set_cursor(6, menu_row); 25f6a: 60 91 12 05 lds r22, 0x0512 ; 0x800512 25f6e: 86 e0 ldi r24, 0x06 ; 6 25f70: 0e 94 26 70 call 0xe04c ; 0xe04c 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) { 25f74: 80 91 95 13 lds r24, 0x1395 ; 0x801395 25f78: 81 30 cpi r24, 0x01 ; 1 25f7a: 09 f0 breq .+2 ; 0x25f7e 25f7c: 11 c1 rjmp .+546 ; 0x261a0 25f7e: 80 91 75 13 lds r24, 0x1375 ; 0x801375 25f82: 90 91 76 13 lds r25, 0x1376 ; 0x801376 25f86: 20 91 77 13 lds r18, 0x1377 ; 0x801377 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 25f8a: 88 23 and r24, r24 25f8c: 09 f4 brne .+2 ; 0x25f90 25f8e: 08 c1 rjmp .+528 ; 0x261a0 lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 25f90: 1f 92 push r1 25f92: 2f 93 push r18 25f94: 1f 92 push r1 25f96: 9f 93 push r25 25f98: 1f 92 push r1 25f9a: 8f 93 push r24 25f9c: ff 92 push r15 25f9e: ef 92 push r14 25fa0: 0e 94 ff 6f call 0xdffe ; 0xdffe 25fa4: 8d b7 in r24, 0x3d ; 61 25fa6: 9e b7 in r25, 0x3e ; 62 25fa8: 08 96 adiw r24, 0x08 ; 8 25faa: 0f b6 in r0, 0x3f ; 63 25fac: f8 94 cli 25fae: 9e bf out 0x3e, r25 ; 62 25fb0: 0f be out 0x3f, r0 ; 63 25fb2: 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) { 25fb4: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 25fb8: 88 23 and r24, r24 25fba: 09 f4 brne .+2 ; 0x25fbe 25fbc: 40 c0 rjmp .+128 ; 0x2603e MENU_ITEM_BACK_P(STR_SEPARATOR); 25fbe: 80 e1 ldi r24, 0x10 ; 16 25fc0: 9d e8 ldi r25, 0x8D ; 141 25fc2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 25fc6: 84 ef ldi r24, 0xF4 ; 244 25fc8: 92 ea ldi r25, 0xA2 ; 162 25fca: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(" ")); 25fce: 82 ef ldi r24, 0xF2 ; 242 25fd0: 92 ea ldi r25, 0xA2 ; 162 25fd2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 25fd6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 25fda: 81 50 subi r24, 0x01 ; 1 25fdc: 99 0b sbc r25, r25 25fde: 20 91 14 05 lds r18, 0x0514 ; 0x800514 25fe2: 28 17 cp r18, r24 25fe4: 19 06 cpc r1, r25 25fe6: 59 f5 brne .+86 ; 0x2603e 25fe8: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25fec: 88 23 and r24, r24 25fee: 39 f1 breq .+78 ; 0x2603e lcd_set_cursor(2, menu_row); 25ff0: 60 91 12 05 lds r22, 0x0512 ; 0x800512 25ff4: 82 e0 ldi r24, 0x02 ; 2 25ff6: 0e 94 26 70 call 0xe04c ; 0xe04c 25ffa: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 25ffe: 1f 92 push r1 26000: 8f 93 push r24 26002: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 26006: 1f 92 push r1 26008: 8f 93 push r24 2600a: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 2600e: 1f 92 push r1 26010: 8f 93 push r24 26012: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 26016: 1f 92 push r1 26018: 8f 93 push r24 2601a: df 93 push r29 2601c: cf 93 push r28 2601e: 1f 93 push r17 26020: 0f 93 push r16 26022: 0f 94 26 dc call 0x3b84c ; 0x3b84c ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 26026: 8b ea ldi r24, 0xAB ; 171 26028: 93 e0 ldi r25, 0x03 ; 3 2602a: 0e 94 2d 72 call 0xe45a ; 0xe45a 2602e: 8d b7 in r24, 0x3d ; 61 26030: 9e b7 in r25, 0x3e ; 62 26032: 0c 96 adiw r24, 0x0c ; 12 26034: 0f b6 in r0, 0x3f ; 63 26036: f8 94 cli 26038: 9e bf out 0x3e, r25 ; 62 2603a: 0f be out 0x3f, r0 ; 63 2603c: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 2603e: 80 91 58 06 lds r24, 0x0658 ; 0x800658 26042: 90 91 59 06 lds r25, 0x0659 ; 0x800659 26046: a0 91 5a 06 lds r26, 0x065A ; 0x80065a 2604a: b0 91 5b 06 lds r27, 0x065B ; 0x80065b 2604e: 89 2b or r24, r25 26050: 8a 2b or r24, r26 26052: 8b 2b or r24, r27 26054: 09 f4 brne .+2 ; 0x26058 26056: 42 c0 rjmp .+132 ; 0x260dc MENU_ITEM_BACK_P(STR_SEPARATOR); 26058: 80 e1 ldi r24, 0x10 ; 16 2605a: 9d e8 ldi r25, 0x8D ; 141 2605c: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 26060: 86 ed ldi r24, 0xD6 ; 214 26062: 9b e4 ldi r25, 0x4B ; 75 26064: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26068: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_BACK_P(PSTR(" ")); 2606c: 80 ef ldi r24, 0xF0 ; 240 2606e: 92 ea ldi r25, 0xA2 ; 162 26070: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 26074: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26078: 81 50 subi r24, 0x01 ; 1 2607a: 99 0b sbc r25, r25 2607c: 20 91 14 05 lds r18, 0x0514 ; 0x800514 26080: 28 17 cp r18, r24 26082: 19 06 cpc r1, r25 26084: 59 f5 brne .+86 ; 0x260dc 26086: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2608a: 88 23 and r24, r24 2608c: 39 f1 breq .+78 ; 0x260dc lcd_set_cursor(2, menu_row); 2608e: 60 91 12 05 lds r22, 0x0512 ; 0x800512 26092: 82 e0 ldi r24, 0x02 ; 2 26094: 0e 94 26 70 call 0xe04c ; 0xe04c 26098: 80 91 5b 06 lds r24, 0x065B ; 0x80065b 2609c: 1f 92 push r1 2609e: 8f 93 push r24 260a0: 80 91 5a 06 lds r24, 0x065A ; 0x80065a 260a4: 1f 92 push r1 260a6: 8f 93 push r24 260a8: 80 91 59 06 lds r24, 0x0659 ; 0x800659 260ac: 1f 92 push r1 260ae: 8f 93 push r24 260b0: 80 91 58 06 lds r24, 0x0658 ; 0x800658 260b4: 1f 92 push r1 260b6: 8f 93 push r24 260b8: df 93 push r29 260ba: cf 93 push r28 260bc: 1f 93 push r17 260be: 0f 93 push r16 260c0: 0f 94 26 dc call 0x3b84c ; 0x3b84c ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 260c4: 8b ea ldi r24, 0xAB ; 171 260c6: 93 e0 ldi r25, 0x03 ; 3 260c8: 0e 94 2d 72 call 0xe45a ; 0xe45a 260cc: 8d b7 in r24, 0x3d ; 61 260ce: 9e b7 in r25, 0x3e ; 62 260d0: 0c 96 adiw r24, 0x0c ; 12 260d2: 0f b6 in r0, 0x3f ; 63 260d4: f8 94 cli 260d6: 9e bf out 0x3e, r25 ; 62 260d8: 0f be out 0x3f, r0 ; 63 260da: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 260dc: 80 e1 ldi r24, 0x10 ; 16 260de: 9d e8 ldi r25, 0x8D ; 141 260e0: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 260e4: 83 ec ldi r24, 0xC3 ; 195 260e6: 9b e4 ldi r25, 0x4B ; 75 260e8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 260ec: 6c e3 ldi r22, 0x3C ; 60 260ee: 7a e3 ldi r23, 0x3A ; 58 260f0: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 260f4: 83 eb ldi r24, 0xB3 ; 179 260f6: 9b e4 ldi r25, 0x4B ; 75 260f8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 260fc: 68 e6 ldi r22, 0x68 ; 104 260fe: 7a e3 ldi r23, 0x3A ; 58 26100: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 26104: 85 ea ldi r24, 0xA5 ; 165 26106: 9b e4 ldi r25, 0x4B ; 75 26108: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2610c: 60 e1 ldi r22, 0x10 ; 16 2610e: 7b e3 ldi r23, 0x3B ; 59 26110: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 26114: 87 e9 ldi r24, 0x97 ; 151 26116: 9b e4 ldi r25, 0x4B ; 75 26118: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2611c: 64 e8 ldi r22, 0x84 ; 132 2611e: 7b e3 ldi r23, 0x3B ; 59 26120: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 26124: 88 e8 ldi r24, 0x88 ; 136 26126: 9b e4 ldi r25, 0x4B ; 75 26128: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2612c: 64 e1 ldi r22, 0x14 ; 20 2612e: 7b e3 ldi r23, 0x3B ; 59 26130: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 26134: 8d e7 ldi r24, 0x7D ; 125 26136: 9b e4 ldi r25, 0x4B ; 75 26138: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2613c: 62 ea ldi r22, 0xA2 ; 162 2613e: 7b e3 ldi r23, 0x3B ; 59 26140: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 26144: 68 e6 ldi r22, 0x68 ; 104 26146: 7b e3 ldi r23, 0x3B ; 59 26148: 8c e2 ldi r24, 0x2C ; 44 2614a: 90 e7 ldi r25, 0x70 ; 112 2614c: 0f 94 0b ce call 0x39c16 ; 0x39c16 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(); 26150: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 26154: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26158: 8f 5f subi r24, 0xFF ; 255 2615a: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2615e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 26162: 8f 5f subi r24, 0xFF ; 255 26164: 80 93 14 05 sts 0x0514, r24 ; 0x800514 26168: 8d ce rjmp .-742 ; 0x25e84 _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) 2616a: 90 91 a6 03 lds r25, 0x03A6 ; 0x8003a6 2616e: 99 23 and r25, r25 26170: 09 f4 brne .+2 ; 0x26174 26172: 7c ce rjmp .-776 ; 0x25e6c 26174: 40 91 a7 03 lds r20, 0x03A7 ; 0x8003a7 26178: 50 91 a8 03 lds r21, 0x03A8 ; 0x8003a8 2617c: 60 91 a9 03 lds r22, 0x03A9 ; 0x8003a9 26180: 70 91 aa 03 lds r23, 0x03AA ; 0x8003aa 26184: 45 2b or r20, r21 26186: 46 2b or r20, r22 26188: 47 2b or r20, r23 2618a: 09 f0 breq .+2 ; 0x2618e 2618c: 6f ce rjmp .-802 ; 0x25e6c 2618e: 8f 5f subi r24, 0xFF ; 255 26190: 80 31 cpi r24, 0x10 ; 16 26192: 19 f0 breq .+6 ; 0x2619a 26194: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 26198: 69 ce rjmp .-814 ; 0x25e6c { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 2619a: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 2619e: 66 ce rjmp .-820 ; 0x25e6c 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)); 261a0: 89 ee ldi r24, 0xE9 ; 233 261a2: 9b e4 ldi r25, 0x4B ; 75 261a4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 261a8: 0e 94 11 70 call 0xe022 ; 0xe022 261ac: 03 cf rjmp .-506 ; 0x25fb4 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 261ae: 86 e0 ldi r24, 0x06 ; 6 261b0: 93 ea ldi r25, 0xA3 ; 163 261b2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 261b6: fe ce rjmp .-516 ; 0x25fb4 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 261b8: df 91 pop r29 261ba: cf 91 pop r28 261bc: 1f 91 pop r17 261be: 0f 91 pop r16 261c0: ff 90 pop r15 261c2: ef 90 pop r14 261c4: 08 95 ret 000261c6 : { 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) { 261c6: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 261ca: 81 11 cpse r24, r1 261cc: 19 c0 rjmp .+50 ; 0x26200 lcd_clear(); 261ce: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 261d2: 8c ef ldi r24, 0xFC ; 252 261d4: 9a e4 ldi r25, 0x4A ; 74 261d6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 261da: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_putc(':'); 261de: 8a e3 ldi r24, 0x3A ; 58 261e0: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_set_cursor(10, 1); 261e4: 61 e0 ldi r22, 0x01 ; 1 261e6: 8a e0 ldi r24, 0x0A ; 10 261e8: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 261ec: 88 ea ldi r24, 0xA8 ; 168 261ee: 9c e0 ldi r25, 0x0C ; 12 261f0: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 261f4: 4a e0 ldi r20, 0x0A ; 10 261f6: 0e 94 7a 71 call 0xe2f4 ; 0xe2f4 _md->initialized = true; 261fa: 81 e0 ldi r24, 0x01 ; 1 261fc: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 } menu_back_if_clicked(); 26200: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 00026204 : } 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){ 26204: 0f 93 push r16 26206: 1f 93 push r17 26208: cf 93 push r28 2620a: df 93 push r29 2620c: ec 01 movw r28, r24 2620e: cb 01 movw r24, r22 26210: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 26212: 4a 81 ldd r20, Y+2 ; 0x02 26214: 41 30 cpi r20, 0x01 ; 1 26216: 29 f0 breq .+10 ; 0x26222 26218: 88 f0 brcs .+34 ; 0x2623c 2621a: 42 30 cpi r20, 0x02 ; 2 2621c: 09 f1 breq .+66 ; 0x26260 2621e: 43 30 cpi r20, 0x03 ; 3 26220: d1 f4 brne .+52 ; 0x26256 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 ){ 26222: 8b 81 ldd r24, Y+3 ; 0x03 26224: 81 11 cpse r24, r1 26226: 25 c0 rjmp .+74 ; 0x26272 state = next_state; // advance to the next state 26228: 82 e0 ldi r24, 0x02 ; 2 2622a: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 2622c: 63 e0 ldi r22, 0x03 ; 3 2622e: 8a ef ldi r24, 0xFA ; 250 26230: 9f e9 ldi r25, 0x9F ; 159 26232: 0f 94 bd 05 call 0x20b7a ; 0x20b7a repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 26236: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 26238: 8b 83 std Y+3, r24 ; 0x03 2623a: 0d c0 rjmp .+26 ; 0x26256 //! @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 ){ 2623c: a9 01 movw r20, r18 2623e: 98 01 movw r18, r16 26240: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 26244: 18 16 cp r1, r24 26246: 3c f4 brge .+14 ; 0x26256 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 26248: 63 e0 ldi r22, 0x03 ; 3 2624a: 88 81 ld r24, Y 2624c: 99 81 ldd r25, Y+1 ; 0x01 2624e: 0f 94 bd 05 call 0x20b7a ; 0x20b7a state = States::TempAboveMintemp; 26252: 81 e0 ldi r24, 0x01 ; 1 26254: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 26256: df 91 pop r29 26258: cf 91 pop r28 2625a: 1f 91 pop r17 2625c: 0f 91 pop r16 2625e: 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 ){ 26260: 8b 81 ldd r24, Y+3 ; 0x03 26262: 81 11 cpse r24, r1 26264: 06 c0 rjmp .+12 ; 0x26272 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); 26266: 88 81 ld r24, Y 26268: 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 2626a: 23 e0 ldi r18, 0x03 ; 3 2626c: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 2626e: 63 e0 ldi r22, 0x03 ; 3 26270: e0 cf rjmp .-64 ; 0x26232 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 26272: 81 50 subi r24, 0x01 ; 1 26274: e1 cf rjmp .-62 ; 0x26238 00026276 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 26276: cf 93 push r28 if(IsStopped() == false) { 26278: 90 91 11 05 lds r25, 0x0511 ; 0x800511 2627c: 91 11 cpse r25, r1 2627e: 18 c0 rjmp .+48 ; 0x262b0 26280: c6 2f mov r28, r22 if (isPreheat) { 26282: 88 23 and r24, r24 26284: c9 f0 breq .+50 ; 0x262b8 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 26286: 8e e9 ldi r24, 0x9E ; 158 26288: 9f e9 ldi r25, 0x9F ; 159 2628a: 66 23 and r22, r22 2628c: 11 f0 breq .+4 ; 0x26292 2628e: 8c ea ldi r24, 0xAC ; 172 26290: 9f e9 ldi r25, 0x9F ; 159 26292: 63 e0 ldi r22, 0x03 ; 3 26294: 0f 94 bd 05 call 0x20b7a ; 0x20b7a SERIAL_ERROR_START; 26298: 8c ee ldi r24, 0xEC ; 236 2629a: 9a ea ldi r25, 0xAA ; 170 2629c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 262a0: 8b e7 ldi r24, 0x7B ; 123 262a2: 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) { 262a4: c1 11 cpse r28, r1 262a6: 02 c0 rjmp .+4 ; 0x262ac SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 262a8: 89 e5 ldi r24, 0x59 ; 89 262aa: 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"); 262ac: 0e 94 97 7b call 0xf72e ; 0xf72e } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 262b0: 80 e0 ldi r24, 0x00 ; 0 } 262b2: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 262b4: 0c 94 c8 7b jmp 0xf790 ; 0xf790 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); 262b8: 85 e3 ldi r24, 0x35 ; 53 262ba: 9f e9 ldi r25, 0x9F ; 159 262bc: 66 23 and r22, r22 262be: 11 f0 breq .+4 ; 0x262c4 262c0: 85 e4 ldi r24, 0x45 ; 69 262c2: 9f e9 ldi r25, 0x9F ; 159 262c4: 63 e0 ldi r22, 0x03 ; 3 262c6: 0f 94 bd 05 call 0x20b7a ; 0x20b7a SERIAL_ERROR_START; 262ca: 8c ee ldi r24, 0xEC ; 236 262cc: 9a ea ldi r25, 0xAA ; 170 262ce: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 262d2: 8c e1 ldi r24, 0x1C ; 28 262d4: 9f e9 ldi r25, 0x9F ; 159 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) { 262d6: c1 11 cpse r28, r1 262d8: e9 cf rjmp .-46 ; 0x262ac SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 262da: 84 e0 ldi r24, 0x04 ; 4 262dc: 9f e9 ldi r25, 0x9F ; 159 262de: e6 cf rjmp .-52 ; 0x262ac 000262e0 : } } static void Sound_DoSound_Prompt(void) { backlight_wake(2); 262e0: 82 e0 ldi r24, 0x02 ; 2 262e2: 0e 94 29 8c call 0x11852 ; 0x11852 WRITE(BEEPER,HIGH); 262e6: 9f b7 in r25, 0x3f ; 63 262e8: f8 94 cli 262ea: e2 e0 ldi r30, 0x02 ; 2 262ec: f1 e0 ldi r31, 0x01 ; 1 262ee: 80 81 ld r24, Z 262f0: 84 60 ori r24, 0x04 ; 4 262f2: 80 83 st Z, r24 262f4: 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); 262f6: 2f ef ldi r18, 0xFF ; 255 262f8: 89 e6 ldi r24, 0x69 ; 105 262fa: 98 e1 ldi r25, 0x18 ; 24 262fc: 21 50 subi r18, 0x01 ; 1 262fe: 80 40 sbci r24, 0x00 ; 0 26300: 90 40 sbci r25, 0x00 ; 0 26302: e1 f7 brne .-8 ; 0x262fc 26304: 00 c0 rjmp .+0 ; 0x26306 26306: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 26308: 9f b7 in r25, 0x3f ; 63 2630a: f8 94 cli 2630c: 80 81 ld r24, Z 2630e: 8b 7f andi r24, 0xFB ; 251 26310: 80 83 st Z, r24 26312: 9f bf out 0x3f, r25 ; 63 } 26314: 08 95 ret 00026316 : 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() { 26316: cf 93 push r28 26318: 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); 2631a: 80 91 38 02 lds r24, 0x0238 ; 0x800238 2631e: 88 23 and r24, r24 26320: 89 f0 breq .+34 ; 0x26344 26322: 84 e4 ldi r24, 0x44 ; 68 26324: 9e e5 ldi r25, 0x5E ; 94 26326: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2632a: ec 01 movw r28, r24 2632c: 8c e1 ldi r24, 0x1C ; 28 2632e: 98 e5 ldi r25, 0x58 ; 88 26330: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26334: 22 e0 ldi r18, 0x02 ; 2 26336: 40 ee ldi r20, 0xE0 ; 224 26338: 5a e3 ldi r21, 0x3A ; 58 2633a: be 01 movw r22, r28 } 2633c: df 91 pop r29 2633e: 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); 26340: 0d 94 1d d0 jmp 0x3a03a ; 0x3a03a 26344: 8e e3 ldi r24, 0x3E ; 62 26346: 9e e5 ldi r25, 0x5E ; 94 26348: ee cf rjmp .-36 ; 0x26326 0002634a : } #endif // TMC2130 } } static void menuitems_temperature_common() { 2634a: ef 92 push r14 2634c: ff 92 push r15 2634e: 0f 93 push r16 26350: 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); 26352: 81 e3 ldi r24, 0x31 ; 49 26354: 98 e5 ldi r25, 0x58 ; 88 26356: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2635a: 28 ec ldi r18, 0xC8 ; 200 2635c: e2 2e mov r14, r18 2635e: f1 2c mov r15, r1 26360: 07 e2 ldi r16, 0x27 ; 39 26362: 11 e0 ldi r17, 0x01 ; 1 26364: 30 e0 ldi r19, 0x00 ; 0 26366: 20 e0 ldi r18, 0x00 ; 0 26368: 40 e1 ldi r20, 0x10 ; 16 2636a: 6a e6 ldi r22, 0x6A ; 106 2636c: 7e e0 ldi r23, 0x0E ; 14 2636e: 0f 94 de ce call 0x39dbc ; 0x39dbc #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); 26372: 86 e1 ldi r24, 0x16 ; 22 26374: 98 e5 ldi r25, 0x58 ; 88 26376: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2637a: 32 e3 ldi r19, 0x32 ; 50 2637c: e3 2e mov r14, r19 2637e: f1 2c mov r15, r1 26380: 08 e7 ldi r16, 0x78 ; 120 26382: 10 e0 ldi r17, 0x00 ; 0 26384: 30 e0 ldi r19, 0x00 ; 0 26386: 20 e0 ldi r18, 0x00 ; 0 26388: 40 e1 ldi r20, 0x10 ; 16 2638a: 68 e6 ldi r22, 0x68 ; 104 2638c: 7e e0 ldi r23, 0x0E ; 14 2638e: 0f 94 de ce call 0x39dbc ; 0x39dbc #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 26392: 8a e0 ldi r24, 0x0A ; 10 26394: 98 e5 ldi r25, 0x58 ; 88 26396: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2639a: 4f e7 ldi r20, 0x7F ; 127 2639c: e4 2e mov r14, r20 2639e: f1 2c mov r15, r1 263a0: 0f ef ldi r16, 0xFF ; 255 263a2: 10 e0 ldi r17, 0x00 ; 0 263a4: 30 e0 ldi r19, 0x00 ; 0 263a6: 20 e0 ldi r18, 0x00 ; 0 263a8: 48 e0 ldi r20, 0x08 ; 8 263aa: 6f ed ldi r22, 0xDF ; 223 263ac: 73 e0 ldi r23, 0x03 ; 3 263ae: 0f 94 de ce call 0x39dbc ; 0x39dbc } 263b2: 1f 91 pop r17 263b4: 0f 91 pop r16 263b6: ff 90 pop r15 263b8: ef 90 pop r14 263ba: 08 95 ret 000263bc : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 263bc: cf 93 push r28 263be: 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); 263c0: 8f ef ldi r24, 0xFF ; 255 263c2: 9f e0 ldi r25, 0x0F ; 15 263c4: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e bool bDesync = tmc2130_mode ^ eeprom_mode; 263c8: 90 91 69 06 lds r25, 0x0669 ; 0x800669 if (eeprom_mode == SILENT_MODE_NORMAL) 263cc: 81 11 cpse r24, r1 263ce: 35 c0 rjmp .+106 ; 0x2643a { if (bDesync) 263d0: 99 23 and r25, r25 263d2: 11 f1 breq .+68 ; 0x26418 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 263d4: 81 e7 ldi r24, 0x71 ; 113 263d6: 9d e3 ldi r25, 0x3D ; 61 263d8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 263dc: 22 e0 ldi r18, 0x02 ; 2 263de: 4a e6 ldi r20, 0x6A ; 106 263e0: 5b e3 ldi r21, 0x3B ; 59 263e2: 6d e8 ldi r22, 0x8D ; 141 263e4: 75 ea ldi r23, 0xA5 ; 165 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 263e6: 0f 94 1d d0 call 0x3a03a ; 0x3a03a } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 263ea: 89 e6 ldi r24, 0x69 ; 105 263ec: 9f e0 ldi r25, 0x0F ; 15 263ee: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 263f2: 88 23 and r24, r24 263f4: f9 f0 breq .+62 ; 0x26434 263f6: 84 e4 ldi r24, 0x44 ; 68 263f8: 9e e5 ldi r25, 0x5E ; 94 263fa: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 263fe: ec 01 movw r28, r24 26400: 8d ef ldi r24, 0xFD ; 253 26402: 97 e5 ldi r25, 0x57 ; 87 26404: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26408: 22 e0 ldi r18, 0x02 ; 2 2640a: 4a e2 ldi r20, 0x2A ; 42 2640c: 5b e3 ldi r21, 0x3B ; 59 2640e: 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 } } 26410: df 91 pop r29 26412: 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); 26414: 0d 94 1d d0 jmp 0x3a03a ; 0x3a03a { 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); 26418: 88 e7 ldi r24, 0x78 ; 120 2641a: 98 e5 ldi r25, 0x58 ; 88 2641c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26420: ec 01 movw r28, r24 26422: 81 e7 ldi r24, 0x71 ; 113 26424: 9d e3 ldi r25, 0x3D ; 61 26426: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2642a: 22 e0 ldi r18, 0x02 ; 2 2642c: 4a e6 ldi r20, 0x6A ; 106 2642e: 5b e3 ldi r21, 0x3B ; 59 26430: be 01 movw r22, r28 26432: d9 cf rjmp .-78 ; 0x263e6 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 26434: 8e e3 ldi r24, 0x3E ; 62 26436: 9e e5 ldi r25, 0x5E ; 94 26438: e0 cf rjmp .-64 ; 0x263fa } else { if (bDesync) 2643a: 98 17 cp r25, r24 2643c: a9 f0 breq .+42 ; 0x26468 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 2643e: 81 e7 ldi r24, 0x71 ; 113 26440: 9d e3 ldi r25, 0x3D ; 61 26442: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26446: 22 e0 ldi r18, 0x02 ; 2 26448: 4a e6 ldi r20, 0x6A ; 106 2644a: 5b e3 ldi r21, 0x3B ; 59 2644c: 68 e8 ldi r22, 0x88 ; 136 2644e: 75 ea ldi r23, 0xA5 ; 165 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 26450: 0f 94 1d d0 call 0x3a03a ; 0x3a03a } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 26454: 8d ef ldi r24, 0xFD ; 253 26456: 97 e5 ldi r25, 0x57 ; 87 26458: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2645c: 22 e0 ldi r18, 0x02 ; 2 2645e: 46 e2 ldi r20, 0x26 ; 38 26460: 5a e3 ldi r21, 0x3A ; 58 26462: 70 e0 ldi r23, 0x00 ; 0 26464: 60 e0 ldi r22, 0x00 ; 0 26466: d4 cf rjmp .-88 ; 0x26410 { 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); 26468: 83 ef ldi r24, 0xF3 ; 243 2646a: 97 e5 ldi r25, 0x57 ; 87 2646c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26470: ec 01 movw r28, r24 26472: 81 e7 ldi r24, 0x71 ; 113 26474: 9d e3 ldi r25, 0x3D ; 61 26476: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2647a: 22 e0 ldi r18, 0x02 ; 2 2647c: 4a e6 ldi r20, 0x6A ; 106 2647e: 5b e3 ldi r21, 0x3B ; 59 26480: be 01 movw r22, r28 26482: e6 cf rjmp .-52 ; 0x26450 00026484 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 26484: cf 93 push r28 26486: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 26488: 86 ed ldi r24, 0xD6 ; 214 2648a: 9e e0 ldi r25, 0x0E ; 14 2648c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 26490: 81 30 cpi r24, 0x01 ; 1 26492: c1 f5 brne .+112 ; 0x26504 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 26494: 84 e4 ldi r24, 0x44 ; 68 26496: 9e e5 ldi r25, 0x5E ; 94 26498: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2649c: 22 e0 ldi r18, 0x02 ; 2 2649e: 40 ed ldi r20, 0xD0 ; 208 264a0: 5a e3 ldi r21, 0x3A ; 58 264a2: bc 01 movw r22, r24 264a4: 88 e2 ldi r24, 0x28 ; 40 264a6: 91 e7 ldi r25, 0x71 ; 113 264a8: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 264ac: 8e ec ldi r24, 0xCE ; 206 264ae: 9e e0 ldi r25, 0x0E ; 14 264b0: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 264b4: 81 30 cpi r24, 0x01 ; 1 264b6: 49 f5 brne .+82 ; 0x2650a { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 264b8: 84 e4 ldi r24, 0x44 ; 68 264ba: 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); 264bc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 264c0: ec 01 movw r28, r24 264c2: 8a ee ldi r24, 0xEA ; 234 264c4: 97 e5 ldi r25, 0x57 ; 87 264c6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 264ca: 22 e0 ldi r18, 0x02 ; 2 264cc: 44 ee ldi r20, 0xE4 ; 228 264ce: 5a e3 ldi r21, 0x3A ; 58 264d0: be 01 movw r22, r28 264d2: 0f 94 1d d0 call 0x3a03a ; 0x3a03a } #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); 264d6: 89 ea ldi r24, 0xA9 ; 169 264d8: 9d e0 ldi r25, 0x0D ; 13 264da: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 264de: 88 23 and r24, r24 264e0: b9 f0 breq .+46 ; 0x26510 264e2: 83 ef ldi r24, 0xF3 ; 243 264e4: 97 e5 ldi r25, 0x57 ; 87 264e6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 264ea: ec 01 movw r28, r24 264ec: 8f ed ldi r24, 0xDF ; 223 264ee: 97 e5 ldi r25, 0x57 ; 87 264f0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 264f4: 22 e0 ldi r18, 0x02 ; 2 264f6: 48 e5 ldi r20, 0x58 ; 88 264f8: 5a e3 ldi r21, 0x3A ; 58 264fa: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 264fc: df 91 pop r29 264fe: 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); 26500: 0d 94 1d d0 jmp 0x3a03a ; 0x3a03a #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); 26504: 8e e3 ldi r24, 0x3E ; 62 26506: 9e e5 ldi r25, 0x5E ; 94 26508: c7 cf rjmp .-114 ; 0x26498 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); 2650a: 8e e3 ldi r24, 0x3E ; 62 2650c: 9e e5 ldi r25, 0x5E ; 94 2650e: d6 cf rjmp .-84 ; 0x264bc } #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); 26510: 88 e7 ldi r24, 0x78 ; 120 26512: 98 e5 ldi r25, 0x58 ; 88 26514: e8 cf rjmp .-48 ; 0x264e6 00026516 : MENU_END(); } static void lcd_settings_menu() { 26516: 1f 93 push r17 26518: cf 93 push r28 2651a: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 2651c: 8f ef ldi r24, 0xFF ; 255 2651e: 9f e0 ldi r25, 0x0F ; 15 26520: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 26524: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 MENU_BEGIN(); 26528: 0f 94 8e ce call 0x39d1c ; 0x39d1c 2652c: 10 92 12 05 sts 0x0512, r1 ; 0x800512 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 26530: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 26532: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26536: 84 30 cpi r24, 0x04 ; 4 26538: 08 f0 brcs .+2 ; 0x2653c 2653a: 5c c1 rjmp .+696 ; 0x267f4 2653c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 26540: 8e e0 ldi r24, 0x0E ; 14 26542: 9e e3 ldi r25, 0x3E ; 62 26544: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26548: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 2654c: 83 ef ldi r24, 0xF3 ; 243 2654e: 98 e5 ldi r25, 0x58 ; 88 26550: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26554: 6e ef ldi r22, 0xFE ; 254 26556: 73 ed ldi r23, 0xD3 ; 211 26558: 0f 94 0c d1 call 0x3a218 ; 0x3a218 if (!printer_active() || printingIsPaused()) 2655c: 0e 94 27 69 call 0xd24e ; 0xd24e 26560: 88 23 and r24, r24 26562: 21 f0 breq .+8 ; 0x2656c 26564: 0e 94 cb 68 call 0xd196 ; 0xd196 26568: 88 23 and r24, r24 2656a: 81 f0 breq .+32 ; 0x2658c { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 2656c: 87 ee ldi r24, 0xE7 ; 231 2656e: 98 e5 ldi r25, 0x58 ; 88 26570: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26574: 68 eb ldi r22, 0xB8 ; 184 26576: 7a e3 ldi r23, 0x3A ; 58 26578: 0f 94 0c d1 call 0x3a218 ; 0x3a218 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 2657c: 84 ed ldi r24, 0xD4 ; 212 2657e: 98 e5 ldi r25, 0x58 ; 88 26580: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26584: 62 ef ldi r22, 0xF2 ; 242 26586: 7c e6 ldi r23, 0x6C ; 108 26588: 0f 94 84 cd call 0x39b08 ; 0x39b08 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 2658c: 8d e0 ldi r24, 0x0D ; 13 2658e: 9d e3 ldi r25, 0x3D ; 61 26590: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26594: 6a e9 ldi r22, 0x9A ; 154 26596: 7b e3 ldi r23, 0x3B ; 59 26598: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #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); 2659c: 8c ea ldi r24, 0xAC ; 172 2659e: 9c e0 ldi r25, 0x0C ; 12 265a0: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 265a4: 88 23 and r24, r24 265a6: 09 f4 brne .+2 ; 0x265aa 265a8: ac c0 rjmp .+344 ; 0x26702 265aa: 84 e4 ldi r24, 0x44 ; 68 265ac: 9e e5 ldi r25, 0x5E ; 94 265ae: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 265b2: 22 e0 ldi r18, 0x02 ; 2 265b4: 48 eb ldi r20, 0xB8 ; 184 265b6: 5b e3 ldi r21, 0x3B ; 59 265b8: bc 01 movw r22, r24 265ba: 8f ec ldi r24, 0xCF ; 207 265bc: 95 ea ldi r25, 0xA5 ; 165 265be: 0f 94 1d d0 call 0x3a03a ; 0x3a03a if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 265c2: 8c ea ldi r24, 0xAC ; 172 265c4: 9c e0 ldi r25, 0x0C ; 12 265c6: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 265ca: 88 23 and r24, r24 265cc: 31 f0 breq .+12 ; 0x265da { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 265ce: 6c ef ldi r22, 0xFC ; 252 265d0: 7a e3 ldi r23, 0x3A ; 58 265d2: 85 ec ldi r24, 0xC5 ; 197 265d4: 95 ea ldi r25, 0xA5 ; 165 265d6: 0f 94 0b ce call 0x39c16 ; 0x39c16 } if (MMU2::mmu2.Enabled()) 265da: 80 91 95 13 lds r24, 0x1395 ; 0x801395 265de: 81 30 cpi r24, 0x01 ; 1 265e0: 51 f4 brne .+20 ; 0x265f6 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 265e2: 0f 94 42 32 call 0x26484 ; 0x26484 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 265e6: 85 ec ldi r24, 0xC5 ; 197 265e8: 98 e5 ldi r25, 0x58 ; 88 265ea: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 265ee: 6b e2 ldi r22, 0x2B ; 43 265f0: 78 ed ldi r23, 0xD8 ; 216 265f2: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } SETTINGS_FANS_CHECK(); 265f6: 0f 94 8b 31 call 0x26316 ; 0x26316 SETTINGS_SILENT_MODE(); 265fa: 0f 94 de 31 call 0x263bc ; 0x263bc if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 265fe: 10 93 f5 03 sts 0x03F5, r17 ; 0x8003f5 MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 26602: 8a eb ldi r24, 0xBA ; 186 26604: 98 e5 ldi r25, 0x58 ; 88 26606: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2660a: 62 eb ldi r22, 0xB2 ; 178 2660c: 7a e3 ldi r23, 0x3A ; 58 2660e: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } 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); 26612: 8a ec ldi r24, 0xCA ; 202 26614: 9a e3 ldi r25, 0x3A ; 58 26616: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2661a: 67 e5 ldi r22, 0x57 ; 87 2661c: 77 ed ldi r23, 0xD7 ; 215 2661e: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 26622: 88 ea ldi r24, 0xA8 ; 168 26624: 98 e5 ldi r25, 0x58 ; 88 26626: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2662a: 60 e6 ldi r22, 0x60 ; 96 2662c: 7a e3 ldi r23, 0x3A ; 58 2662e: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 26632: 20 e0 ldi r18, 0x00 ; 0 26634: 30 e0 ldi r19, 0x00 ; 0 26636: 40 e2 ldi r20, 0x20 ; 32 26638: 51 e4 ldi r21, 0x41 ; 65 2663a: 60 91 95 03 lds r22, 0x0395 ; 0x800395 2663e: 70 91 96 03 lds r23, 0x0396 ; 0x800396 26642: 80 91 97 03 lds r24, 0x0397 ; 0x800397 26646: 90 91 98 03 lds r25, 0x0398 ; 0x800398 2664a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2664e: 87 fd sbrc r24, 7 26650: 16 c0 rjmp .+44 ; 0x2667e 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); 26652: 8f ea ldi r24, 0xAF ; 175 26654: 9f e0 ldi r25, 0x0F ; 15 26656: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2665a: 88 23 and r24, r24 2665c: 09 f4 brne .+2 ; 0x26660 2665e: 54 c0 rjmp .+168 ; 0x26708 26660: 84 e4 ldi r24, 0x44 ; 68 26662: 9e e5 ldi r25, 0x5E ; 94 26664: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26668: ec 01 movw r28, r24 2666a: 83 e8 ldi r24, 0x83 ; 131 2666c: 9a e3 ldi r25, 0x3A ; 58 2666e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26672: 22 e0 ldi r18, 0x02 ; 2 26674: 44 e9 ldi r20, 0x94 ; 148 26676: 5b e3 ldi r21, 0x3B ; 59 26678: be 01 movw r22, r28 2667a: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #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); 2667e: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 26682: 81 11 cpse r24, r1 26684: 44 c0 rjmp .+136 ; 0x2670e 26686: 8e e3 ldi r24, 0x3E ; 62 26688: 9e e5 ldi r25, 0x5E ; 94 2668a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2668e: ec 01 movw r28, r24 26690: 8d e9 ldi r24, 0x9D ; 157 26692: 98 e5 ldi r25, 0x58 ; 88 26694: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26698: 22 e0 ldi r18, 0x02 ; 2 2669a: 40 ea ldi r20, 0xA0 ; 160 2669c: 5b e3 ldi r21, 0x3B ; 59 2669e: be 01 movw r22, r28 266a0: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 266a4: 0e 94 cb 68 call 0xd196 ; 0xd196 266a8: 81 11 cpse r24, r1 266aa: 08 c0 rjmp .+16 ; 0x266bc 266ac: 80 eb ldi r24, 0xB0 ; 176 266ae: 9c e3 ldi r25, 0x3C ; 60 266b0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 266b4: 6c ec ldi r22, 0xCC ; 204 266b6: 7a e3 ldi r23, 0x3A ; 58 266b8: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 266bc: 8b e8 ldi r24, 0x8B ; 139 266be: 98 e5 ldi r25, 0x58 ; 88 266c0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 266c4: 62 e1 ldi r22, 0x12 ; 18 266c6: 7b e3 ldi r23, 0x3B ; 59 266c8: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 266cc: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 266d0: 88 23 and r24, r24 266d2: 01 f1 breq .+64 ; 0x26714 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 266d4: 81 e8 ldi r24, 0x81 ; 129 266d6: 98 e5 ldi r25, 0x58 ; 88 266d8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 266dc: 22 e0 ldi r18, 0x02 ; 2 266de: 48 ec ldi r20, 0xC8 ; 200 266e0: 5b e3 ldi r21, 0x3B ; 59 266e2: 68 e4 ldi r22, 0x48 ; 72 266e4: 71 e7 ldi r23, 0x71 ; 113 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 266e6: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 266ea: 89 e0 ldi r24, 0x09 ; 9 266ec: 9f e0 ldi r25, 0x0F ; 15 266ee: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 266f2: 88 23 and r24, r24 266f4: e9 f0 breq .+58 ; 0x26730 266f6: 81 30 cpi r24, 0x01 ; 1 266f8: 09 f4 brne .+2 ; 0x266fc 266fa: 6d c0 rjmp .+218 ; 0x267d6 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); 266fc: 86 e8 ldi r24, 0x86 ; 134 266fe: 90 e4 ldi r25, 0x40 ; 64 26700: 19 c0 rjmp .+50 ; 0x26734 #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); 26702: 8e e3 ldi r24, 0x3E ; 62 26704: 9e e5 ldi r25, 0x5E ; 94 26706: 53 cf rjmp .-346 ; 0x265ae #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); 26708: 8e e3 ldi r24, 0x3E ; 62 2670a: 9e e5 ldi r25, 0x5E ; 94 2670c: ab cf rjmp .-170 ; 0x26664 #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); 2670e: 84 e4 ldi r24, 0x44 ; 68 26710: 9e e5 ldi r25, 0x5E ; 94 26712: bb cf rjmp .-138 ; 0x2668a 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); 26714: 88 e7 ldi r24, 0x78 ; 120 26716: 98 e5 ldi r25, 0x58 ; 88 26718: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2671c: ec 01 movw r28, r24 2671e: 81 e8 ldi r24, 0x81 ; 129 26720: 98 e5 ldi r25, 0x58 ; 88 26722: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26726: 22 e0 ldi r18, 0x02 ; 2 26728: 48 ec ldi r20, 0xC8 ; 200 2672a: 5b e3 ldi r21, 0x3B ; 59 2672c: be 01 movw r22, r28 2672e: db cf rjmp .-74 ; 0x266e6 #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; 26730: 81 e7 ldi r24, 0x71 ; 113 26732: 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); 26734: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26738: ec 01 movw r28, r24 2673a: 8a e6 ldi r24, 0x6A ; 106 2673c: 98 e5 ldi r25, 0x58 ; 88 2673e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26742: 22 e0 ldi r18, 0x02 ; 2 26744: 48 e3 ldi r20, 0x38 ; 56 26746: 5b e3 ldi r21, 0x3B ; 59 26748: be 01 movw r22, r28 2674a: 0f 94 1d d0 call 0x3a03a ; 0x3a03a } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 2674e: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 26752: 82 30 cpi r24, 0x02 ; 2 26754: 09 f4 brne .+2 ; 0x26758 26756: 45 c0 rjmp .+138 ; 0x267e2 26758: 83 30 cpi r24, 0x03 ; 3 2675a: 09 f4 brne .+2 ; 0x2675e 2675c: 45 c0 rjmp .+138 ; 0x267e8 2675e: 81 30 cpi r24, 0x01 ; 1 26760: e9 f1 breq .+122 ; 0x267dc 26762: 86 e0 ldi r24, 0x06 ; 6 26764: 9d e3 ldi r25, 0x3D ; 61 26766: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2676a: ec 01 movw r28, r24 2676c: 8e ef ldi r24, 0xFE ; 254 2676e: 9c e3 ldi r25, 0x3C ; 60 26770: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26774: 22 e0 ldi r18, 0x02 ; 2 26776: 44 e0 ldi r20, 0x04 ; 4 26778: 5b e3 ldi r21, 0x3B ; 59 2677a: be 01 movw r22, r28 2677c: 0f 94 1d d0 call 0x3a03a ; 0x3a03a #ifdef LCD_BL_PIN if (backlightSupport) 26780: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 26784: 88 23 and r24, r24 26786: 41 f0 breq .+16 ; 0x26798 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 26788: 88 ed ldi r24, 0xD8 ; 216 2678a: 9c e3 ldi r25, 0x3C ; 60 2678c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26790: 6e ec ldi r22, 0xCE ; 206 26792: 76 ed ldi r23, 0xD6 ; 214 26794: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } #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 26798: 87 ea ldi r24, 0xA7 ; 167 2679a: 9c e0 ldi r25, 0x0C ; 12 2679c: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 267a0: 88 23 and r24, r24 267a2: 29 f1 breq .+74 ; 0x267ee 267a4: 87 eb ldi r24, 0xB7 ; 183 267a6: 9d e3 ldi r25, 0x3D ; 61 267a8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 267ac: 22 e0 ldi r18, 0x02 ; 2 267ae: 44 e9 ldi r20, 0x94 ; 148 267b0: 51 ed ldi r21, 0xD1 ; 209 267b2: bc 01 movw r22, r24 267b4: 8b e3 ldi r24, 0x3B ; 59 267b6: 91 e7 ldi r25, 0x71 ; 113 267b8: 0f 94 1d d0 call 0x3a03a ; 0x3a03a if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 267bc: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 267c0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 267c4: 8f 5f subi r24, 0xFF ; 255 267c6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 267ca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 267ce: 8f 5f subi r24, 0xFF ; 255 267d0: 80 93 14 05 sts 0x0514, r24 ; 0x800514 267d4: ae ce rjmp .-676 ; 0x26532 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; 267d6: 8f e5 ldi r24, 0x5F ; 95 267d8: 98 e5 ldi r25, 0x58 ; 88 267da: ac cf rjmp .-168 ; 0x26734 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 267dc: 87 ef ldi r24, 0xF7 ; 247 267de: 9c e3 ldi r25, 0x3C ; 60 267e0: c2 cf rjmp .-124 ; 0x26766 267e2: 8e ee ldi r24, 0xEE ; 238 267e4: 9c e3 ldi r25, 0x3C ; 60 267e6: bf cf rjmp .-130 ; 0x26766 267e8: 85 ee ldi r24, 0xE5 ; 229 267ea: 9c e3 ldi r25, 0x3C ; 60 267ec: bc cf rjmp .-136 ; 0x26766 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 267ee: 8d eb ldi r24, 0xBD ; 189 267f0: 9d e3 ldi r25, 0x3D ; 61 267f2: da cf rjmp .-76 ; 0x267a8 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 267f4: df 91 pop r29 267f6: cf 91 pop r28 267f8: 1f 91 pop r17 267fa: 08 95 ret 000267fc : //! @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) { 267fc: cf 92 push r12 267fe: df 92 push r13 26800: ef 92 push r14 26802: ff 92 push r15 26804: 0f 93 push r16 26806: 1f 93 push r17 26808: cf 93 push r28 2680a: df 93 push r29 2680c: d8 2f mov r29, r24 2680e: 6b 01 movw r12, r22 26810: 7a 01 movw r14, r20 26812: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 26814: 40 e2 ldi r20, 0x20 ; 32 26816: 81 11 cpse r24, r1 26818: 01 c0 rjmp .+2 ; 0x2681c 2681a: 4e e3 ldi r20, 0x3E ; 62 2681c: 63 e0 ldi r22, 0x03 ; 3 2681e: 80 e0 ldi r24, 0x00 ; 0 26820: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_puts_P(first_choice); 26824: c6 01 movw r24, r12 26826: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2682a: 40 e2 ldi r20, 0x20 ; 32 2682c: d1 30 cpi r29, 0x01 ; 1 2682e: 09 f4 brne .+2 ; 0x26832 26830: 4e e3 ldi r20, 0x3E ; 62 26832: 63 e0 ldi r22, 0x03 ; 3 26834: 8c 2f mov r24, r28 26836: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_puts_P(second_choice); 2683a: c7 01 movw r24, r14 2683c: 0e 94 11 70 call 0xe022 ; 0xe022 if (third_choice) { 26840: 01 15 cp r16, r1 26842: 11 05 cpc r17, r1 26844: 19 f1 breq .+70 ; 0x2688c 26846: c8 01 movw r24, r16 26848: 0f 94 cd da call 0x3b59a ; 0x3b59a <__strlen_P> 2684c: d8 2e mov r13, r24 2684e: c7 01 movw r24, r14 26850: 0f 94 cd da call 0x3b59a ; 0x3b59a <__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; 26854: 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;} 26856: 93 e1 ldi r25, 0x13 ; 19 26858: 9d 19 sub r25, r13 2685a: 8c 0f add r24, r28 2685c: 89 17 cp r24, r25 2685e: 08 f4 brcc .+2 ; 0x26862 26860: 89 2f mov r24, r25 26862: 83 31 cpi r24, 0x13 ; 19 26864: 08 f0 brcs .+2 ; 0x26868 26866: 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 ? '>': ' '); 26868: 40 e2 ldi r20, 0x20 ; 32 2686a: d2 30 cpi r29, 0x02 ; 2 2686c: 09 f4 brne .+2 ; 0x26870 2686e: 4e e3 ldi r20, 0x3E ; 62 26870: 63 e0 ldi r22, 0x03 ; 3 26872: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_puts_P(third_choice); 26876: c8 01 movw r24, r16 } } 26878: df 91 pop r29 2687a: cf 91 pop r28 2687c: 1f 91 pop r17 2687e: 0f 91 pop r16 26880: ff 90 pop r15 26882: ef 90 pop r14 26884: df 90 pop r13 26886: 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); 26888: 0c 94 11 70 jmp 0xe022 ; 0xe022 } } 2688c: df 91 pop r29 2688e: cf 91 pop r28 26890: 1f 91 pop r17 26892: 0f 91 pop r16 26894: ff 90 pop r15 26896: ef 90 pop r14 26898: df 90 pop r13 2689a: cf 90 pop r12 2689c: 08 95 ret 0002689e : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 2689e: cf 93 push r28 268a0: df 93 push r29 268a2: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 268a4: 80 e0 ldi r24, 0x00 ; 0 268a6: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_clear(); 268aa: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 return lcd_display_message_fullscreen_nonBlocking_P(msg); 268ae: ce 01 movw r24, r28 } 268b0: df 91 pop r29 268b2: 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); 268b4: 0d 94 56 2b jmp 0x256ac ; 0x256ac 000268b8 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 268b8: cf 92 push r12 268ba: df 92 push r13 268bc: ef 92 push r14 268be: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 268c0: 80 e0 ldi r24, 0x00 ; 0 268c2: 90 e0 ldi r25, 0x00 ; 0 268c4: a8 ec ldi r26, 0xC8 ; 200 268c6: b2 e4 ldi r27, 0x42 ; 66 268c8: 80 93 48 07 sts 0x0748, r24 ; 0x800748 268cc: 90 93 49 07 sts 0x0749, r25 ; 0x800749 268d0: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 268d4: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 268d8: 65 e5 ldi r22, 0x55 ; 85 268da: 75 e5 ldi r23, 0x55 ; 85 268dc: 85 e5 ldi r24, 0x55 ; 85 268de: 91 e4 ldi r25, 0x41 ; 65 268e0: 0f 94 11 ba call 0x37422 ; 0x37422 delay_keep_alive(2000); 268e4: 80 ed ldi r24, 0xD0 ; 208 268e6: 97 e0 ldi r25, 0x07 ; 7 268e8: 0e 94 10 8f call 0x11e20 ; 0x11e20 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 268ec: 8c e5 ldi r24, 0x5C ; 92 268ee: 90 e5 ldi r25, 0x50 ; 80 268f0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 268f4: 0f 94 4f 34 call 0x2689e ; 0x2689e return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 268f8: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 268fc: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 26900: 07 2e mov r0, r23 26902: 00 0c add r0, r0 26904: 88 0b sbc r24, r24 26906: 99 0b sbc r25, r25 26908: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2690c: 9b 01 movw r18, r22 2690e: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 26910: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 26914: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 26918: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 2691c: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 26920: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 26924: 9f 77 andi r25, 0x7F ; 127 26926: 20 e0 ldi r18, 0x00 ; 0 26928: 30 e0 ldi r19, 0x00 ; 0 2692a: 40 ea ldi r20, 0xA0 ; 160 2692c: 50 e4 ldi r21, 0x40 ; 64 2692e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 26932: 18 16 cp r1, r24 26934: b4 f5 brge .+108 ; 0x269a2 lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 26936: 8c e5 ldi r24, 0x5C ; 92 26938: 90 e5 ldi r25, 0x50 ; 80 2693a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2693e: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_set_cursor(0, 4); 26942: 64 e0 ldi r22, 0x04 ; 4 26944: 80 e0 ldi r24, 0x00 ; 0 26946: 0e 94 26 70 call 0xe04c ; 0xe04c 2694a: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 2694e: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 26952: 07 2e mov r0, r23 26954: 00 0c add r0, r0 26956: 88 0b sbc r24, r24 26958: 99 0b sbc r25, r25 2695a: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__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)); 2695e: 20 e0 ldi r18, 0x00 ; 0 26960: 30 e0 ldi r19, 0x00 ; 0 26962: 40 e0 ldi r20, 0x00 ; 0 26964: 5f e3 ldi r21, 0x3F ; 63 26966: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2696a: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 2696e: 6b 01 movw r12, r22 26970: 20 e0 ldi r18, 0x00 ; 0 26972: 30 e0 ldi r19, 0x00 ; 0 26974: 40 e0 ldi r20, 0x00 ; 0 26976: 5f e3 ldi r21, 0x3F ; 63 26978: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2697c: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 26980: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 26984: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 26988: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2698c: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 26990: a6 01 movw r20, r12 26992: 82 e8 ldi r24, 0x82 ; 130 26994: 0f 94 ec 2d call 0x25bd8 ; 0x25bd8 delay_keep_alive(1000); 26998: 88 ee ldi r24, 0xE8 ; 232 2699a: 93 e0 ldi r25, 0x03 ; 3 2699c: 0e 94 10 8f call 0x11e20 ; 0x11e20 269a0: ab cf rjmp .-170 ; 0x268f8 } } 269a2: ff 90 pop r15 269a4: ef 90 pop r14 269a6: df 90 pop r13 269a8: cf 90 pop r12 269aa: 08 95 ret 000269ac : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 269ac: cf 92 push r12 269ae: df 92 push r13 269b0: ef 92 push r14 269b2: ff 92 push r15 269b4: 0f 93 push r16 269b6: 1f 93 push r17 269b8: cf 93 push r28 269ba: df 93 push r29 269bc: d8 2e mov r13, r24 269be: 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) 269c0: 01 e0 ldi r16, 0x01 ; 1 269c2: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 269c6: 81 11 cpse r24, r1 269c8: 01 c0 rjmp .+2 ; 0x269cc 269ca: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 269cc: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 269d0: 8d 2d mov r24, r13 269d2: 9c 2d mov r25, r12 269d4: 0f 94 4f 34 call 0x2689e ; 0x2689e 269d8: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 269da: 0e 94 3e 72 call 0xe47c ; 0xe47c KEEPALIVE_STATE(PAUSED_FOR_USER); 269de: 84 e0 ldi r24, 0x04 ; 4 269e0: 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); 269e4: 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) { 269e6: 20 97 sbiw r28, 0x00 ; 0 269e8: 29 f4 brne .+10 ; 0x269f4 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 269ea: 49 e8 ldi r20, 0x89 ; 137 269ec: 63 e0 ldi r22, 0x03 ; 3 269ee: 83 e1 ldi r24, 0x13 ; 19 269f0: 0e 94 46 70 call 0xe08c ; 0xe08c * @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); 269f4: 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); 269f6: 82 e3 ldi r24, 0x32 ; 50 269f8: 90 e0 ldi r25, 0x00 ; 0 269fa: 0e 94 10 8f call 0x11e20 ; 0x11e20 if (lcd_clicked()) { 269fe: 0e 94 43 72 call 0xe486 ; 0xe486 26a02: 88 23 and r24, r24 26a04: 81 f0 breq .+32 ; 0x26a26 if (msg_next == NULL) { 26a06: 20 97 sbiw r28, 0x00 ; 0 26a08: 81 f4 brne .+32 ; 0x26a2a KEEPALIVE_STATE(IN_HANDLER); 26a0a: 82 e0 ldi r24, 0x02 ; 2 26a0c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 26a10: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 26a14: df 91 pop r29 26a16: cf 91 pop r28 26a18: 1f 91 pop r17 26a1a: 0f 91 pop r16 26a1c: ff 90 pop r15 26a1e: ef 90 pop r14 26a20: df 90 pop r13 26a22: cf 90 pop r12 26a24: 08 95 ret 26a26: 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) { 26a28: 31 f7 brne .-52 ; 0x269f6 else { break; } } } if (multi_screen) { 26a2a: e1 14 cp r14, r1 26a2c: f1 04 cpc r15, r1 26a2e: d9 f2 breq .-74 ; 0x269e6 if (msg_next == NULL) 26a30: 20 97 sbiw r28, 0x00 ; 0 26a32: 11 f4 brne .+4 ; 0x26a38 msg_next = msg; 26a34: cd 2d mov r28, r13 26a36: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 26a38: ce 01 movw r24, r28 26a3a: 0f 94 4f 34 call 0x2689e ; 0x2689e 26a3e: ec 01 movw r28, r24 26a40: d2 cf rjmp .-92 ; 0x269e6 00026a42 : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 26a42: cf 93 push r28 26a44: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 26a46: 8e e4 ldi r24, 0x4E ; 78 26a48: 92 e5 ldi r25, 0x52 ; 82 26a4a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26a4e: 0f 94 d6 34 call 0x269ac ; 0x269ac _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 26a52: 80 91 95 13 lds r24, 0x1395 ; 0x801395 26a56: 81 30 cpi r24, 0x01 ; 1 26a58: 69 f4 brne .+26 ; 0x26a74 { lcd_show_fullscreen_message_and_wait_P( 26a5a: 85 ef ldi r24, 0xF5 ; 245 26a5c: 91 e5 ldi r25, 0x51 ; 81 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 26a5e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26a62: 0f 94 d6 34 call 0x269ac ; 0x269ac _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 26a66: 83 e2 ldi r24, 0x23 ; 35 26a68: 91 e5 ldi r25, 0x51 ; 81 26a6a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 _T(MSG_WIZARD_V2_CAL_2)); } 26a6e: 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( 26a70: 0d 94 d6 34 jmp 0x269ac ; 0x269ac if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 26a74: cc 23 and r28, r28 26a76: b9 f3 breq .-18 ; 0x26a66 { lcd_show_fullscreen_message_and_wait_P( 26a78: 83 ec ldi r24, 0xC3 ; 195 26a7a: 91 e5 ldi r25, 0x51 ; 81 26a7c: f0 cf rjmp .-32 ; 0x26a5e 00026a7e : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 26a7e: 80 91 95 13 lds r24, 0x1395 ; 0x801395 26a82: 81 30 cpi r24, 0x01 ; 1 26a84: 71 f4 brne .+28 ; 0x26aa2 lcd_show_fullscreen_message_and_wait_P( 26a86: 8a ec ldi r24, 0xCA ; 202 26a88: 90 e5 ldi r25, 0x50 ; 80 26a8a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26a8e: 0f 94 d6 34 call 0x269ac ; 0x269ac _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; 26a92: 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; 26a94: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 26a98: 61 e0 ldi r22, 0x01 ; 1 26a9a: 8e e6 ldi r24, 0x6E ; 110 26a9c: 95 ea ldi r25, 0xA5 ; 165 26a9e: 0c 94 dc 89 jmp 0x113b8 ; 0x113b8 // 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( 26aa2: 8e e7 ldi r24, 0x7E ; 126 26aa4: 90 e5 ldi r25, 0x50 ; 80 26aa6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26aaa: 0f 94 d6 34 call 0x269ac ; 0x269ac _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 26aae: 80 e0 ldi r24, 0x00 ; 0 26ab0: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_clear(); 26ab4: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 26ab8: 82 e7 ldi r24, 0x72 ; 114 26aba: 9d e5 ldi r25, 0x5D ; 93 26abc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26ac0: ac 01 movw r20, r24 26ac2: 62 e0 ldi r22, 0x02 ; 2 26ac4: 80 e0 ldi r24, 0x00 ; 0 26ac6: 0e 94 3a 70 call 0xe074 ; 0xe074 eFilamentAction = FilamentAction::Load; 26aca: 81 e0 ldi r24, 0x01 ; 1 26acc: e3 cf rjmp .-58 ; 0x26a94 00026ace : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 26ace: cf 93 push r28 26ad0: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 26ad2: 10 92 72 07 sts 0x0772, r1 ; 0x800772 disable_x(); 26ad6: 17 9a sbi 0x02, 7 ; 2 26ad8: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); 26adc: 16 9a sbi 0x02, 6 ; 2 26ade: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_z(); disable_e0(); 26ae2: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 26ae4: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 26ae8: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 26aec: 68 2f mov r22, r24 26aee: 86 ea ldi r24, 0xA6 ; 166 26af0: 9f e0 ldi r25, 0x0F ; 15 26af2: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 26af6: 6c 2f mov r22, r28 26af8: 8f ea ldi r24, 0xAF ; 175 26afa: 9f e0 ldi r25, 0x0F ; 15 26afc: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 // 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) { 26b00: cc 23 and r28, r28 26b02: 89 f0 breq .+34 ; 0x26b26 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 26b04: 83 e2 ldi r24, 0x23 ; 35 26b06: 95 ea ldi r25, 0xA5 ; 165 26b08: 0e 94 97 7b call 0xf72e ; 0xf72e lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 26b0c: 8b e6 ldi r24, 0x6B ; 107 26b0e: 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)); 26b10: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26b14: 0f 94 d6 34 call 0x269ac ; 0x269ac } lcd_update_enable(true); 26b18: 81 e0 ldi r24, 0x01 ; 1 26b1a: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_update(2); 26b1e: 82 e0 ldi r24, 0x02 ; 2 } 26b20: 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); 26b22: 0c 94 ed 6f jmp 0xdfda ; 0xdfda 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."); 26b26: 88 ee ldi r24, 0xE8 ; 232 26b28: 94 ea ldi r25, 0xA4 ; 164 26b2a: 0e 94 97 7b call 0xf72e ; 0xf72e lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 26b2e: 80 e5 ldi r24, 0x50 ; 80 26b30: 9e e4 ldi r25, 0x4E ; 78 26b32: ee cf rjmp .-36 ; 0x26b10 00026b34 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 26b34: 1f 93 push r17 26b36: cf 93 push r28 26b38: 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); 26b3a: 64 e6 ldi r22, 0x64 ; 100 26b3c: 70 e0 ldi r23, 0x00 ; 0 26b3e: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 26b42: 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++) { 26b44: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 26b46: 4e e2 ldi r20, 0x2E ; 46 26b48: 63 e0 ldi r22, 0x03 ; 3 26b4a: 81 2f mov r24, r17 26b4c: 0e 94 46 70 call 0xe08c ; 0xe08c //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 26b50: ce 01 movw r24, r28 26b52: 0e 94 10 8f call 0x11e20 ; 0x11e20 26b56: ce 01 movw r24, r28 26b58: 0e 94 10 8f call 0x11e20 ; 0x11e20 26b5c: ce 01 movw r24, r28 26b5e: 0e 94 10 8f call 0x11e20 ; 0x11e20 26b62: ce 01 movw r24, r28 26b64: 0e 94 10 8f call 0x11e20 ; 0x11e20 26b68: ce 01 movw r24, r28 26b6a: 0e 94 10 8f call 0x11e20 ; 0x11e20 } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 26b6e: 1f 5f subi r17, 0xFF ; 255 26b70: 14 31 cpi r17, 0x14 ; 20 26b72: 49 f7 brne .-46 ; 0x26b46 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 26b74: df 91 pop r29 26b76: cf 91 pop r28 26b78: 1f 91 pop r17 26b7a: 08 95 ret 00026b7c : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 26b7c: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 26b80: 08 95 ret 00026b82 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 26b82: cf 93 push r28 MENU_BEGIN(); 26b84: 0f 94 8e ce call 0x39d1c ; 0x39d1c 26b88: 10 92 12 05 sts 0x0512, r1 ; 0x800512 26b8c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26b90: 84 30 cpi r24, 0x04 ; 4 26b92: 08 f0 brcs .+2 ; 0x26b96 26b94: a1 c0 rjmp .+322 ; 0x26cd8 26b96: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 26b9a: 8f e5 ldi r24, 0x5F ; 95 26b9c: 9f e0 ldi r25, 0x0F ; 15 26b9e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 26ba2: 81 11 cpse r24, r1 26ba4: 10 c0 rjmp .+32 ; 0x26bc6 { ON_MENU_LEAVE( 26ba6: 0f 94 0e cd call 0x39a1c ; 0x39a1c 26baa: 81 11 cpse r24, r1 26bac: 0f 94 be 35 call 0x26b7c ; 0x26b7c clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 26bb0: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 26bb4: 8a 30 cpi r24, 0x0A ; 10 26bb6: 09 f4 brne .+2 ; 0x26bba 26bb8: 8c c0 rjmp .+280 ; 0x26cd2 26bba: 8e e0 ldi r24, 0x0E ; 14 26bbc: 9e e3 ldi r25, 0x3E ; 62 26bbe: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26bc2: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 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(); 26bc6: 0f 94 ad 21 call 0x2435a ; 0x2435a 26bca: 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); 26bcc: 8b e8 ldi r24, 0x8B ; 139 26bce: 94 ea ldi r25, 0xA4 ; 164 26bd0: cc 23 and r28, r28 26bd2: 11 f0 breq .+4 ; 0x26bd8 26bd4: 8a e9 ldi r24, 0x9A ; 154 26bd6: 94 ea ldi r25, 0xA4 ; 164 26bd8: 62 ec ldi r22, 0xC2 ; 194 26bda: 7b e3 ldi r23, 0x3B ; 59 26bdc: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26be0: 80 e7 ldi r24, 0x70 ; 112 26be2: 94 ea ldi r25, 0xA4 ; 164 26be4: cc 23 and r28, r28 26be6: 11 f0 breq .+4 ; 0x26bec 26be8: 8f e7 ldi r24, 0x7F ; 127 26bea: 94 ea ldi r25, 0xA4 ; 164 26bec: 68 ec ldi r22, 0xC8 ; 200 26bee: 7a e3 ldi r23, 0x3A ; 58 26bf0: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26bf4: 84 e5 ldi r24, 0x54 ; 84 26bf6: 94 ea ldi r25, 0xA4 ; 164 26bf8: cc 23 and r28, r28 26bfa: 11 f0 breq .+4 ; 0x26c00 26bfc: 84 e6 ldi r24, 0x64 ; 100 26bfe: 94 ea ldi r25, 0xA4 ; 164 26c00: 66 e1 ldi r22, 0x16 ; 22 26c02: 7a e3 ldi r23, 0x3A ; 58 26c04: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26c08: 88 e3 ldi r24, 0x38 ; 56 26c0a: 94 ea ldi r25, 0xA4 ; 164 26c0c: cc 23 and r28, r28 26c0e: 11 f0 breq .+4 ; 0x26c14 26c10: 88 e4 ldi r24, 0x48 ; 72 26c12: 94 ea ldi r25, 0xA4 ; 164 26c14: 66 ee ldi r22, 0xE6 ; 230 26c16: 7b e3 ldi r23, 0x3B ; 59 26c18: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26c1c: 8d e1 ldi r24, 0x1D ; 29 26c1e: 94 ea ldi r25, 0xA4 ; 164 26c20: cc 23 and r28, r28 26c22: 11 f0 breq .+4 ; 0x26c28 26c24: 8c e2 ldi r24, 0x2C ; 44 26c26: 94 ea ldi r25, 0xA4 ; 164 26c28: 62 ed ldi r22, 0xD2 ; 210 26c2a: 79 e3 ldi r23, 0x39 ; 57 26c2c: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26c30: 82 e0 ldi r24, 0x02 ; 2 26c32: 94 ea ldi r25, 0xA4 ; 164 26c34: cc 23 and r28, r28 26c36: 11 f0 breq .+4 ; 0x26c3c 26c38: 81 e1 ldi r24, 0x11 ; 17 26c3a: 94 ea ldi r25, 0xA4 ; 164 26c3c: 6e e2 ldi r22, 0x2E ; 46 26c3e: 7a e3 ldi r23, 0x3A ; 58 26c40: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26c44: 86 ee ldi r24, 0xE6 ; 230 26c46: 93 ea ldi r25, 0xA3 ; 163 26c48: cc 23 and r28, r28 26c4a: 11 f0 breq .+4 ; 0x26c50 26c4c: 86 ef ldi r24, 0xF6 ; 246 26c4e: 93 ea ldi r25, 0xA3 ; 163 26c50: 6a e1 ldi r22, 0x1A ; 26 26c52: 7b e3 ldi r23, 0x3B ; 59 26c54: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26c58: 8a ec ldi r24, 0xCA ; 202 26c5a: 93 ea ldi r25, 0xA3 ; 163 26c5c: cc 23 and r28, r28 26c5e: 11 f0 breq .+4 ; 0x26c64 26c60: 8a ed ldi r24, 0xDA ; 218 26c62: 93 ea ldi r25, 0xA3 ; 163 26c64: 6c e0 ldi r22, 0x0C ; 12 26c66: 7b e3 ldi r23, 0x3B ; 59 26c68: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26c6c: 8e ea ldi r24, 0xAE ; 174 26c6e: 93 ea ldi r25, 0xA3 ; 163 26c70: cc 23 and r28, r28 26c72: 11 f0 breq .+4 ; 0x26c78 26c74: 8e eb ldi r24, 0xBE ; 190 26c76: 93 ea ldi r25, 0xA3 ; 163 26c78: 6a e8 ldi r22, 0x8A ; 138 26c7a: 7b e3 ldi r23, 0x3B ; 59 26c7c: 0f 94 0c d1 call 0x3a218 ; 0x3a218 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); 26c80: 83 e9 ldi r24, 0x93 ; 147 26c82: 93 ea ldi r25, 0xA3 ; 163 26c84: cc 23 and r28, r28 26c86: 11 f0 breq .+4 ; 0x26c8c 26c88: 82 ea ldi r24, 0xA2 ; 162 26c8a: 93 ea ldi r25, 0xA3 ; 163 26c8c: 66 e4 ldi r22, 0x46 ; 70 26c8e: 7b e3 ldi r23, 0x3B ; 59 26c90: 0f 94 0c d1 call 0x3a218 ; 0x3a218 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 26c94: 8f e5 ldi r24, 0x5F ; 95 26c96: 9f e0 ldi r25, 0x0F ; 15 26c98: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 26c9c: 81 11 cpse r24, r1 26c9e: 0c c0 rjmp .+24 ; 0x26cb8 26ca0: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 26ca4: 89 30 cpi r24, 0x09 ; 9 26ca6: 41 f4 brne .+16 ; 0x26cb8 26ca8: 8a e9 ldi r24, 0x9A ; 154 26caa: 9c e4 ldi r25, 0x4C ; 76 26cac: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 26cb0: 6e e5 ldi r22, 0x5E ; 94 26cb2: 7b e3 ldi r23, 0x3B ; 59 26cb4: 0f 94 0b ce call 0x39c16 ; 0x39c16 MENU_END(); 26cb8: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 26cbc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 26cc0: 8f 5f subi r24, 0xFF ; 255 26cc2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 26cc6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 26cca: 8f 5f subi r24, 0xFF ; 255 26ccc: 80 93 14 05 sts 0x0514, r24 ; 0x800514 26cd0: 5d cf rjmp .-326 ; 0x26b8c 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)); 26cd2: 8f e6 ldi r24, 0x6F ; 111 26cd4: 90 e4 ldi r25, 0x40 ; 64 26cd6: 73 cf rjmp .-282 ; 0x26bbe 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(); } 26cd8: cf 91 pop r28 26cda: 08 95 ret 00026cdc : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 26cdc: 89 e0 ldi r24, 0x09 ; 9 26cde: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 lcd_generic_preheat_menu(); 26ce2: 0d 94 c1 35 jmp 0x26b82 ; 0x26b82 00026ce6 : // 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); 26ce6: 81 e0 ldi r24, 0x01 ; 1 26ce8: 0e 94 1c 70 call 0xe038 ; 0xe038 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 26cec: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 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; 26cf0: 90 91 7d 13 lds r25, 0x137D ; 0x80137d 26cf4: 93 36 cpi r25, 0x63 ; 99 26cf6: 09 f4 brne .+2 ; 0x26cfa 26cf8: 9f ef ldi r25, 0xFF ; 255 26cfa: 89 13 cpse r24, r25 26cfc: 0e c0 rjmp .+28 ; 0x26d1a lcd_putc('F'); 26cfe: 86 e4 ldi r24, 0x46 ; 70 26d00: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26d04: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 26d08: 8f 3f cpi r24, 0xFF ; 255 26d0a: 29 f0 breq .+10 ; 0x26d16 26d0c: 8f 5c subi r24, 0xCF ; 207 26d0e: 0e 94 15 70 call 0xe02a ; 0xe02a 26d12: 83 e0 ldi r24, 0x03 ; 3 26d14: 08 95 ret 26d16: 8f e3 ldi r24, 0x3F ; 63 26d18: fa cf rjmp .-12 ; 0x26d0e chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26d1a: 8f 3f cpi r24, 0xFF ; 255 26d1c: 89 f0 breq .+34 ; 0x26d40 26d1e: 8f 5c subi r24, 0xCF ; 207 26d20: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_putc('>'); 26d24: 8e e3 ldi r24, 0x3E ; 62 26d26: 0e 94 15 70 call 0xe02a ; 0xe02a 26d2a: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 26d2e: 83 36 cpi r24, 0x63 ; 99 26d30: 49 f0 breq .+18 ; 0x26d44 lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26d32: 8f 3f cpi r24, 0xFF ; 255 26d34: 39 f0 breq .+14 ; 0x26d44 26d36: 8f 5c subi r24, 0xCF ; 207 26d38: 0e 94 15 70 call 0xe02a ; 0xe02a chars += 3; 26d3c: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 26d3e: 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'); 26d40: 8f e3 ldi r24, 0x3F ; 63 26d42: ee cf rjmp .-36 ; 0x26d20 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26d44: 8f e3 ldi r24, 0x3F ; 63 26d46: f8 cf rjmp .-16 ; 0x26d38 00026d48 <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 26d48: 1f 92 push r1 26d4a: 0f 92 push r0 26d4c: 0f b6 in r0, 0x3f ; 63 26d4e: 0f 92 push r0 26d50: 11 24 eor r1, r1 26d52: 0b b6 in r0, 0x3b ; 59 26d54: 0f 92 push r0 26d56: 2f 93 push r18 26d58: 3f 93 push r19 26d5a: 4f 93 push r20 26d5c: 5f 93 push r21 26d5e: 6f 93 push r22 26d60: 7f 93 push r23 26d62: 8f 93 push r24 26d64: 9f 93 push r25 26d66: af 93 push r26 26d68: bf 93 push r27 26d6a: ef 93 push r30 26d6c: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 26d6e: 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 26d72: 80 91 20 05 lds r24, 0x0520 ; 0x800520 uint8_t buf_r = ptr[2]; //get read index 26d76: 90 91 21 05 lds r25, 0x0521 ; 0x800521 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 26d7a: e8 2f mov r30, r24 26d7c: f0 e0 ldi r31, 0x00 ; 0 26d7e: ed 5d subi r30, 0xDD ; 221 26d80: fa 4f sbci r31, 0xFA ; 250 26d82: 20 83 st Z, r18 buf_w++; //incerment write index 26d84: 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 26d86: 20 91 1f 05 lds r18, 0x051F ; 0x80051f 26d8a: 82 17 cp r24, r18 26d8c: 08 f0 brcs .+2 ; 0x26d90 <__vector_51+0x48> 26d8e: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 26d90: 98 13 cpse r25, r24 26d92: 17 c0 rjmp .+46 ; 0x26dc2 <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 26d94: 8e eb ldi r24, 0xBE ; 190 26d96: 91 ea ldi r25, 0xA1 ; 161 26d98: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 } } 26d9c: ff 91 pop r31 26d9e: ef 91 pop r30 26da0: bf 91 pop r27 26da2: af 91 pop r26 26da4: 9f 91 pop r25 26da6: 8f 91 pop r24 26da8: 7f 91 pop r23 26daa: 6f 91 pop r22 26dac: 5f 91 pop r21 26dae: 4f 91 pop r20 26db0: 3f 91 pop r19 26db2: 2f 91 pop r18 26db4: 0f 90 pop r0 26db6: 0b be out 0x3b, r0 ; 59 26db8: 0f 90 pop r0 26dba: 0f be out 0x3f, r0 ; 63 26dbc: 0f 90 pop r0 26dbe: 1f 90 pop r1 26dc0: 18 95 reti ptr[1] = buf_w; //store write index 26dc2: 80 93 20 05 sts 0x0520, r24 ; 0x800520 26dc6: ea cf rjmp .-44 ; 0x26d9c <__vector_51+0x54> 00026dc8 <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 26dc8: 1f 92 push r1 26dca: 0f 92 push r0 26dcc: 0f b6 in r0, 0x3f ; 63 26dce: 0f 92 push r0 26dd0: 11 24 eor r1, r1 26dd2: 0b b6 in r0, 0x3b ; 59 26dd4: 0f 92 push r0 26dd6: 8f 93 push r24 26dd8: 9f 93 push r25 26dda: ef 93 push r30 26ddc: ff 93 push r31 WRITE(BEEPER, 0); 26dde: 9f b7 in r25, 0x3f ; 63 26de0: f8 94 cli 26de2: e2 e0 ldi r30, 0x02 ; 2 26de4: f1 e0 ldi r31, 0x01 ; 1 26de6: 80 81 ld r24, Z 26de8: 8b 7f andi r24, 0xFB ; 251 26dea: 80 83 st Z, r24 26dec: 9f bf out 0x3f, r25 ; 63 } 26dee: ff 91 pop r31 26df0: ef 91 pop r30 26df2: 9f 91 pop r25 26df4: 8f 91 pop r24 26df6: 0f 90 pop r0 26df8: 0b be out 0x3b, r0 ; 59 26dfa: 0f 90 pop r0 26dfc: 0f be out 0x3f, r0 ; 63 26dfe: 0f 90 pop r0 26e00: 1f 90 pop r1 26e02: 18 95 reti 00026e04 <__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) { 26e04: 1f 92 push r1 26e06: 0f 92 push r0 26e08: 0f b6 in r0, 0x3f ; 63 26e0a: 0f 92 push r0 26e0c: 11 24 eor r1, r1 26e0e: 0b b6 in r0, 0x3b ; 59 26e10: 0f 92 push r0 26e12: 8f 93 push r24 26e14: 9f 93 push r25 26e16: ef 93 push r30 26e18: ff 93 push r31 WRITE(BEEPER, 1); 26e1a: 9f b7 in r25, 0x3f ; 63 26e1c: f8 94 cli 26e1e: e2 e0 ldi r30, 0x02 ; 2 26e20: f1 e0 ldi r31, 0x01 ; 1 26e22: 80 81 ld r24, Z 26e24: 84 60 ori r24, 0x04 ; 4 26e26: 80 83 st Z, r24 26e28: 9f bf out 0x3f, r25 ; 63 } 26e2a: ff 91 pop r31 26e2c: ef 91 pop r30 26e2e: 9f 91 pop r25 26e30: 8f 91 pop r24 26e32: 0f 90 pop r0 26e34: 0b be out 0x3b, r0 ; 59 26e36: 0f 90 pop r0 26e38: 0f be out 0x3f, r0 ; 63 26e3a: 0f 90 pop r0 26e3c: 1f 90 pop r1 26e3e: 18 95 reti 00026e40 : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 26e40: 6f 92 push r6 26e42: 7f 92 push r7 26e44: 8f 92 push r8 26e46: 9f 92 push r9 26e48: af 92 push r10 26e4a: bf 92 push r11 26e4c: df 92 push r13 26e4e: ef 92 push r14 26e50: ff 92 push r15 26e52: 0f 93 push r16 26e54: 1f 93 push r17 26e56: cf 93 push r28 26e58: df 93 push r29 26e5a: cd b7 in r28, 0x3d ; 61 26e5c: de b7 in r29, 0x3e ; 62 26e5e: e0 97 sbiw r28, 0x30 ; 48 26e60: 0f b6 in r0, 0x3f ; 63 26e62: f8 94 cli 26e64: de bf out 0x3e, r29 ; 62 26e66: 0f be out 0x3f, r0 ; 63 26e68: cd bf out 0x3d, r28 ; 61 26e6a: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 26e6c: ae 01 movw r20, r28 26e6e: 4f 5f subi r20, 0xFF ; 255 26e70: 5f 4f sbci r21, 0xFF ; 255 26e72: 60 e1 ldi r22, 0x10 ; 16 26e74: 0e 94 87 7c call 0xf90e ; 0xf90e bubblesort_uint8(step, 16, 0); 26e78: 50 e0 ldi r21, 0x00 ; 0 26e7a: 40 e0 ldi r20, 0x00 ; 0 26e7c: 60 e1 ldi r22, 0x10 ; 16 26e7e: ce 01 movw r24, r28 26e80: 01 96 adiw r24, 0x01 ; 1 26e82: 0f 94 67 1d call 0x23ace ; 0x23ace puts_P(PSTR("sorted samples:")); 26e86: 8e ea ldi r24, 0xAE ; 174 26e88: 91 ea ldi r25, 0xA1 ; 161 26e8a: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 26e8e: 9e 01 movw r18, r28 26e90: 2f 5f subi r18, 0xFF ; 255 26e92: 3f 4f sbci r19, 0xFF ; 255 26e94: 59 01 movw r10, r18 26e96: 10 e0 ldi r17, 0x00 ; 0 26e98: 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]); 26e9a: 2d e9 ldi r18, 0x9D ; 157 26e9c: e2 2e mov r14, r18 26e9e: 21 ea ldi r18, 0xA1 ; 161 26ea0: f2 2e mov r15, r18 26ea2: d5 01 movw r26, r10 26ea4: 8d 91 ld r24, X+ 26ea6: 5d 01 movw r10, r26 26ea8: 1f 92 push r1 26eaa: 8f 93 push r24 26eac: 1f 93 push r17 26eae: 0f 93 push r16 26eb0: ff 92 push r15 26eb2: ef 92 push r14 26eb4: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 26eb8: 0f 5f subi r16, 0xFF ; 255 26eba: 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++) 26ebc: 0f 90 pop r0 26ebe: 0f 90 pop r0 26ec0: 0f 90 pop r0 26ec2: 0f 90 pop r0 26ec4: 0f 90 pop r0 26ec6: 0f 90 pop r0 26ec8: 00 31 cpi r16, 0x10 ; 16 26eca: 11 05 cpc r17, r1 26ecc: 51 f7 brne .-44 ; 0x26ea2 } 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]; 26ece: 09 81 ldd r16, Y+1 ; 0x01 26ed0: 10 e0 ldi r17, 0x00 ; 0 26ed2: 5e 01 movw r10, r28 26ed4: b2 e0 ldi r27, 0x02 ; 2 26ed6: ab 0e add r10, r27 26ed8: b1 1c adc r11, r1 26eda: ee 24 eor r14, r14 26edc: e3 94 inc r14 26ede: f1 2c mov r15, r1 26ee0: ec 0e add r14, r28 26ee2: fd 1e adc r15, r29 26ee4: e0 e1 ldi r30, 0x10 ; 16 26ee6: ee 0e add r14, r30 26ee8: f1 1c adc r15, r1 uint8_t cl = 0; 26eea: 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; 26eec: 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]; 26eee: d5 01 movw r26, r10 26ef0: 3d 91 ld r19, X+ 26ef2: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 26ef4: 62 2f mov r22, r18 26ef6: 70 e0 ldi r23, 0x00 ; 0 26ef8: c8 01 movw r24, r16 26efa: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 26efe: 46 2f mov r20, r22 26f00: 43 1b sub r20, r19 26f02: 36 17 cp r19, r22 26f04: 10 f0 brcs .+4 ; 0x26f0a else dif = d - val; 26f06: 43 2f mov r20, r19 26f08: 46 1b sub r20, r22 26f0a: 83 2f mov r24, r19 26f0c: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 26f0e: 42 30 cpi r20, 0x02 ; 2 26f10: 08 f0 brcs .+2 ; 0x26f14 26f12: 47 c0 rjmp .+142 ; 0x26fa2 { cnt += 1; 26f14: 2f 5f subi r18, 0xFF ; 255 sum += d; 26f16: 08 0f add r16, r24 26f18: 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++) 26f1a: ae 14 cp r10, r14 26f1c: bf 04 cpc r11, r15 26f1e: 39 f7 brne .-50 ; 0x26eee cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 26f20: ae 2e mov r10, r30 26f22: b1 2c mov r11, r1 26f24: a1 e1 ldi r26, 0x11 ; 17 26f26: b0 e0 ldi r27, 0x00 ; 0 26f28: ac 0f add r26, r28 26f2a: bd 1f adc r27, r29 26f2c: aa 0d add r26, r10 26f2e: bb 1d adc r27, r11 26f30: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 26f32: 7e 01 movw r14, r28 26f34: b1 e2 ldi r27, 0x21 ; 33 26f36: eb 0e add r14, r27 26f38: f1 1c adc r15, r1 26f3a: ae 0c add r10, r14 26f3c: bf 1c adc r11, r15 26f3e: 62 2f mov r22, r18 26f40: 70 e0 ldi r23, 0x00 ; 0 26f42: c8 01 movw r24, r16 26f44: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 26f48: d5 01 movw r26, r10 26f4a: 6c 93 st X, r22 return ++cl; 26f4c: 11 e0 ldi r17, 0x01 ; 1 26f4e: 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:")); 26f50: 83 e9 ldi r24, 0x93 ; 147 26f52: 91 ea ldi r25, 0xA1 ; 161 26f54: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 26f58: fe 01 movw r30, r28 26f5a: 71 96 adiw r30, 0x11 ; 17 26f5c: 3f 01 movw r6, r30 26f5e: 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]); 26f60: 8b e7 ldi r24, 0x7B ; 123 26f62: 88 2e mov r8, r24 26f64: 81 ea ldi r24, 0xA1 ; 161 26f66: 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++) 26f68: 8a 2d mov r24, r10 26f6a: 8e 19 sub r24, r14 26f6c: 81 17 cp r24, r17 26f6e: 70 f5 brcc .+92 ; 0x26fcc 26f70: c5 01 movw r24, r10 26f72: 8e 19 sub r24, r14 26f74: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 26f76: d5 01 movw r26, r10 26f78: 3d 91 ld r19, X+ 26f7a: 5d 01 movw r10, r26 26f7c: f3 01 movw r30, r6 26f7e: 21 91 ld r18, Z+ 26f80: 3f 01 movw r6, r30 26f82: 1f 92 push r1 26f84: 3f 93 push r19 26f86: 1f 92 push r1 26f88: 2f 93 push r18 26f8a: 9f 93 push r25 26f8c: 8f 93 push r24 26f8e: 9f 92 push r9 26f90: 8f 92 push r8 26f92: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 26f96: 0f b6 in r0, 0x3f ; 63 26f98: f8 94 cli 26f9a: de bf out 0x3e, r29 ; 62 26f9c: 0f be out 0x3f, r0 ; 63 26f9e: cd bf out 0x3d, r28 ; 61 26fa0: e3 cf rjmp .-58 ; 0x26f68 26fa2: 4e 2f mov r20, r30 26fa4: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 26fa6: a1 e1 ldi r26, 0x11 ; 17 26fa8: b0 e0 ldi r27, 0x00 ; 0 26faa: ac 0f add r26, r28 26fac: bd 1f adc r27, r29 26fae: a4 0f add r26, r20 26fb0: b5 1f adc r27, r21 26fb2: ef 5f subi r30, 0xFF ; 255 26fb4: 2c 93 st X, r18 if (cval) cval[cl] = val; 26fb6: 21 e2 ldi r18, 0x21 ; 33 26fb8: 30 e0 ldi r19, 0x00 ; 0 26fba: 2c 0f add r18, r28 26fbc: 3d 1f adc r19, r29 26fbe: 42 0f add r20, r18 26fc0: 53 1f adc r21, r19 26fc2: da 01 movw r26, r20 26fc4: 6c 93 st X, r22 cnt = 1; sum = d; 26fc6: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 26fc8: 21 e0 ldi r18, 0x01 ; 1 26fca: a7 cf rjmp .-178 ; 0x26f1a 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); 26fcc: a7 01 movw r20, r14 26fce: 61 2f mov r22, r17 26fd0: ce 01 movw r24, r28 26fd2: 41 96 adiw r24, 0x11 ; 17 26fd4: 0f 94 67 1d call 0x23ace ; 0x23ace tmc2130_home_origin[axis] = val[cl-1]; 26fd8: fe 01 movw r30, r28 26fda: e1 0f add r30, r17 26fdc: f1 1d adc r31, r1 26fde: 80 a1 ldd r24, Z+32 ; 0x20 26fe0: ed 2d mov r30, r13 26fe2: f0 e0 ldi r31, 0x00 ; 0 26fe4: ed 50 subi r30, 0x0D ; 13 26fe6: fb 4f sbci r31, 0xFB ; 251 26fe8: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 26fea: 1f 92 push r1 26fec: 8f 93 push r24 26fee: 89 e6 ldi r24, 0x69 ; 105 26ff0: 91 ea ldi r25, 0xA1 ; 161 26ff2: 9f 93 push r25 26ff4: 8f 93 push r24 26ff6: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 26ffa: 0f 90 pop r0 26ffc: 0f 90 pop r0 26ffe: 0f 90 pop r0 27000: 0f 90 pop r0 27002: 60 91 f3 04 lds r22, 0x04F3 ; 0x8004f3 27006: 8e ef ldi r24, 0xFE ; 254 27008: 9e e0 ldi r25, 0x0E ; 14 2700a: dd 20 and r13, r13 2700c: 21 f0 breq .+8 ; 0x27016 2700e: 60 91 f4 04 lds r22, 0x04F4 ; 0x8004f4 27012: 8b ef ldi r24, 0xFB ; 251 27014: 9e e0 ldi r25, 0x0E ; 14 27016: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 2701a: 81 e0 ldi r24, 0x01 ; 1 2701c: e0 96 adiw r28, 0x30 ; 48 2701e: 0f b6 in r0, 0x3f ; 63 27020: f8 94 cli 27022: de bf out 0x3e, r29 ; 62 27024: 0f be out 0x3f, r0 ; 63 27026: cd bf out 0x3d, r28 ; 61 27028: df 91 pop r29 2702a: cf 91 pop r28 2702c: 1f 91 pop r17 2702e: 0f 91 pop r16 27030: ff 90 pop r15 27032: ef 90 pop r14 27034: df 90 pop r13 27036: bf 90 pop r11 27038: af 90 pop r10 2703a: 9f 90 pop r9 2703c: 8f 90 pop r8 2703e: 7f 90 pop r7 27040: 6f 90 pop r6 27042: 08 95 ret 00027044 : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 27044: 81 30 cpi r24, 0x01 ; 1 27046: 49 f0 breq .+18 ; 0x2705a 27048: 28 f0 brcs .+10 ; 0x27054 2704a: 82 30 cpi r24, 0x02 ; 2 2704c: 41 f0 breq .+16 ; 0x2705e 2704e: 83 30 cpi r24, 0x03 ; 3 27050: 41 f0 breq .+16 ; 0x27062 27052: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 27054: 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; 27056: 86 b9 out 0x06, r24 ; 6 } } 27058: 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; 2705a: 82 e0 ldi r24, 0x02 ; 2 2705c: fc cf rjmp .-8 ; 0x27056 case Z_AXIS: _DO_STEP_Z; break; 2705e: 84 e0 ldi r24, 0x04 ; 4 27060: fa cf rjmp .-12 ; 0x27056 case E_AXIS: _DO_STEP_E; break; 27062: 88 e0 ldi r24, 0x08 ; 8 27064: f8 cf rjmp .-16 ; 0x27056 00027066 : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 27066: 81 30 cpi r24, 0x01 ; 1 27068: d1 f0 breq .+52 ; 0x2709e 2706a: 48 f0 brcs .+18 ; 0x2707e 2706c: 82 30 cpi r24, 0x02 ; 2 2706e: 21 f1 breq .+72 ; 0x270b8 27070: 83 30 cpi r24, 0x03 ; 3 27072: 79 f1 breq .+94 ; 0x270d2 27074: 8b e4 ldi r24, 0x4B ; 75 27076: 90 e0 ldi r25, 0x00 ; 0 27078: 01 97 sbiw r24, 0x01 ; 1 2707a: f1 f7 brne .-4 ; 0x27078 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); } 2707c: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 2707e: 9f b7 in r25, 0x3f ; 63 27080: 66 23 and r22, r22 27082: 41 f0 breq .+16 ; 0x27094 27084: f8 94 cli 27086: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2708a: 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; 2708c: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27090: 9f bf out 0x3f, r25 ; 63 27092: f0 cf rjmp .-32 ; 0x27074 void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 27094: f8 94 cli 27096: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2709a: 8e 7f andi r24, 0xFE ; 254 2709c: f7 cf rjmp .-18 ; 0x2708c case Y_AXIS: _SET_DIR_Y(dir); break; 2709e: 9f b7 in r25, 0x3f ; 63 270a0: 61 11 cpse r22, r1 270a2: 05 c0 rjmp .+10 ; 0x270ae 270a4: f8 94 cli 270a6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270aa: 82 60 ori r24, 0x02 ; 2 270ac: ef cf rjmp .-34 ; 0x2708c 270ae: f8 94 cli 270b0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270b4: 8d 7f andi r24, 0xFD ; 253 270b6: ea cf rjmp .-44 ; 0x2708c case Z_AXIS: _SET_DIR_Z(dir); break; 270b8: 9f b7 in r25, 0x3f ; 63 270ba: 66 23 and r22, r22 270bc: 29 f0 breq .+10 ; 0x270c8 270be: f8 94 cli 270c0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270c4: 84 60 ori r24, 0x04 ; 4 270c6: e2 cf rjmp .-60 ; 0x2708c 270c8: f8 94 cli 270ca: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270ce: 8b 7f andi r24, 0xFB ; 251 270d0: dd cf rjmp .-70 ; 0x2708c case E_AXIS: _SET_DIR_E(dir); break; 270d2: 9f b7 in r25, 0x3f ; 63 270d4: 61 11 cpse r22, r1 270d6: 05 c0 rjmp .+10 ; 0x270e2 270d8: f8 94 cli 270da: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270de: 80 64 ori r24, 0x40 ; 64 270e0: d5 cf rjmp .-86 ; 0x2708c 270e2: f8 94 cli 270e4: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 270e8: 8f 7b andi r24, 0xBF ; 191 270ea: d0 cf rjmp .-96 ; 0x2708c 000270ec : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 270ec: cf 92 push r12 270ee: df 92 push r13 270f0: ef 92 push r14 270f2: ff 92 push r15 270f4: 0f 93 push r16 270f6: 1f 93 push r17 270f8: cf 93 push r28 270fa: df 93 push r29 270fc: 18 2f mov r17, r24 270fe: f6 2e mov r15, r22 27100: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 27102: 0c e5 ldi r16, 0x5C ; 92 27104: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 27106: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27108: 0f 94 c3 1d call 0x23b86 ; 0x23b86 TMC2130_SPI_TXRX(addr); // address 2710c: 8f 2d mov r24, r15 2710e: 0f 94 de 1d call 0x23bbc ; 0x23bbc TMC2130_SPI_TXRX(0); // MSB 27112: 80 e0 ldi r24, 0x00 ; 0 27114: 0f 94 de 1d call 0x23bbc ; 0x23bbc TMC2130_SPI_TXRX(0); 27118: 80 e0 ldi r24, 0x00 ; 0 2711a: 0f 94 de 1d call 0x23bbc ; 0x23bbc TMC2130_SPI_TXRX(0); 2711e: 80 e0 ldi r24, 0x00 ; 0 27120: 0f 94 de 1d call 0x23bbc ; 0x23bbc TMC2130_SPI_TXRX(0); // LSB 27124: 80 e0 ldi r24, 0x00 ; 0 27126: 0f 94 de 1d call 0x23bbc ; 0x23bbc tmc2130_cs_high(axis); 2712a: 81 2f mov r24, r17 2712c: 0f 94 a8 1d call 0x23b50 ; 0x23b50 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 27130: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 27132: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27134: 81 2f mov r24, r17 27136: 0f 94 c3 1d call 0x23b86 ; 0x23b86 uint8_t stat = TMC2130_SPI_TXRX(0); // status 2713a: 80 e0 ldi r24, 0x00 ; 0 2713c: 0f 94 de 1d call 0x23bbc ; 0x23bbc 27140: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 27142: 80 e0 ldi r24, 0x00 ; 0 27144: 0f 94 de 1d call 0x23bbc ; 0x23bbc 27148: 90 e0 ldi r25, 0x00 ; 0 2714a: b0 e0 ldi r27, 0x00 ; 0 2714c: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 2714e: cc 24 eor r12, r12 27150: d8 2e mov r13, r24 27152: e9 2e mov r14, r25 27154: fa 2e mov r15, r26 27156: 80 e0 ldi r24, 0x00 ; 0 27158: 0f 94 de 1d call 0x23bbc ; 0x23bbc 2715c: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 2715e: fe 2c mov r15, r14 27160: ed 2c mov r14, r13 27162: dc 2c mov r13, r12 27164: cc 24 eor r12, r12 27166: 80 e0 ldi r24, 0x00 ; 0 27168: 0f 94 de 1d call 0x23bbc ; 0x23bbc 2716c: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 2716e: fe 2c mov r15, r14 27170: ed 2c mov r14, r13 27172: dc 2c mov r13, r12 27174: cc 24 eor r12, r12 27176: 80 e0 ldi r24, 0x00 ; 0 27178: 0f 94 de 1d call 0x23bbc ; 0x23bbc 2717c: c8 2a or r12, r24 tmc2130_cs_high(axis); 2717e: 81 2f mov r24, r17 27180: 0f 94 a8 1d call 0x23b50 ; 0x23b50 TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 27184: c8 82 st Y, r12 27186: d9 82 std Y+1, r13 ; 0x01 27188: ea 82 std Y+2, r14 ; 0x02 2718a: fb 82 std Y+3, r15 ; 0x03 return stat; } 2718c: 80 2f mov r24, r16 2718e: df 91 pop r29 27190: cf 91 pop r28 27192: 1f 91 pop r17 27194: 0f 91 pop r16 27196: ff 90 pop r15 27198: ef 90 pop r14 2719a: df 90 pop r13 2719c: cf 90 pop r12 2719e: 08 95 ret 000271a0 : #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) { 271a0: ef 92 push r14 271a2: ff 92 push r15 271a4: 0f 93 push r16 271a6: 1f 93 push r17 271a8: cf 93 push r28 271aa: df 93 push r29 271ac: c8 2f mov r28, r24 271ae: e6 2e mov r14, r22 271b0: d2 2f mov r29, r18 271b2: 13 2f mov r17, r19 271b4: 04 2f mov r16, r20 271b6: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 271b8: 8c e5 ldi r24, 0x5C ; 92 271ba: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 271bc: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 271be: 8c 2f mov r24, r28 271c0: 0f 94 c3 1d call 0x23b86 ; 0x23b86 TMC2130_SPI_TXRX(addr); // address 271c4: 8e 2d mov r24, r14 271c6: 0f 94 de 1d call 0x23bbc ; 0x23bbc TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 271ca: 8f 2d mov r24, r15 271cc: 0f 94 de 1d call 0x23bbc ; 0x23bbc TMC2130_SPI_TXRX((wval >> 16) & 0xff); 271d0: 80 2f mov r24, r16 271d2: 0f 94 de 1d call 0x23bbc ; 0x23bbc TMC2130_SPI_TXRX((wval >> 8) & 0xff); 271d6: 81 2f mov r24, r17 271d8: 0f 94 de 1d call 0x23bbc ; 0x23bbc TMC2130_SPI_TXRX(wval & 0xff); // LSB 271dc: 8d 2f mov r24, r29 271de: 0f 94 de 1d call 0x23bbc ; 0x23bbc tmc2130_cs_high(axis); 271e2: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 271e4: df 91 pop r29 271e6: cf 91 pop r28 271e8: 1f 91 pop r17 271ea: 0f 91 pop r16 271ec: ff 90 pop r15 271ee: 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); 271f0: 0d 94 a8 1d jmp 0x23b50 ; 0x23b50 000271f4 : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 271f4: cf 93 push r28 271f6: df 93 push r29 271f8: 00 d0 rcall .+0 ; 0x271fa 271fa: 1f 92 push r1 271fc: cd b7 in r28, 0x3d ; 61 271fe: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 27200: 19 82 std Y+1, r1 ; 0x01 27202: 1a 82 std Y+2, r1 ; 0x02 27204: 1b 82 std Y+3, r1 ; 0x03 27206: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 27208: ae 01 movw r20, r28 2720a: 4f 5f subi r20, 0xFF ; 255 2720c: 5f 4f sbci r21, 0xFF ; 255 2720e: 6a e6 ldi r22, 0x6A ; 106 27210: 0f 94 76 38 call 0x270ec ; 0x270ec return val32 & 0x3ff; 27214: 89 81 ldd r24, Y+1 ; 0x01 27216: 9a 81 ldd r25, Y+2 ; 0x02 } 27218: 93 70 andi r25, 0x03 ; 3 2721a: 0f 90 pop r0 2721c: 0f 90 pop r0 2721e: 0f 90 pop r0 27220: 0f 90 pop r0 27222: df 91 pop r29 27224: cf 91 pop r28 27226: 08 95 ret 00027228 : #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 */) { 27228: ff 92 push r15 2722a: 0f 93 push r16 2722c: 1f 93 push r17 2722e: cf 93 push r28 27230: df 93 push r29 27232: f8 2e mov r15, r24 27234: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 27236: e8 2f mov r30, r24 27238: f0 e0 ldi r31, 0x00 ; 0 2723a: 83 e0 ldi r24, 0x03 ; 3 2723c: f8 9e mul r15, r24 2723e: 80 01 movw r16, r0 27240: 11 24 eor r1, r1 27242: 03 5a subi r16, 0xA3 ; 163 27244: 1d 4f sbci r17, 0xFD ; 253 27246: d8 01 movw r26, r16 27248: 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) {} 2724a: 30 e0 ldi r19, 0x00 ; 0 2724c: 37 7f andi r19, 0xF7 ; 247 2724e: 3f 7e andi r19, 0xEF ; 239 27250: 3f 7d andi r19, 0xDF ; 223 27252: 3f 7b andi r19, 0xBF ; 191 27254: 40 e0 ldi r20, 0x00 ; 0 27256: 80 fb bst r24, 0 27258: 41 f9 bld r20, 1 2725a: 43 70 andi r20, 0x03 ; 3 2725c: 56 2f mov r21, r22 2725e: 5f 70 andi r21, 0x0F ; 15 27260: 50 62 ori r21, 0x20 ; 32 27262: 5f 7b andi r21, 0xBF ; 191 27264: 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 27266: 81 e0 ldi r24, 0x01 ; 1 27268: 61 11 cpse r22, r1 2726a: 01 c0 rjmp .+2 ; 0x2726e 2726c: 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); 2726e: 80 fb bst r24, 0 27270: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 27272: bf 01 movw r22, r30 27274: 66 0f add r22, r22 27276: 77 1f adc r23, r23 27278: fb 01 movw r30, r22 2727a: e3 58 subi r30, 0x83 ; 131 2727c: fd 4f sbci r31, 0xFD ; 253 2727e: 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 27280: 92 2f mov r25, r18 27282: 99 1f adc r25, r25 27284: 99 27 eor r25, r25 27286: 99 1f adc r25, r25 27288: 81 81 ldd r24, Z+1 ; 0x01 2728a: 87 70 andi r24, 0x07 ; 7 2728c: 88 0f add r24, r24 2728e: 89 2b or r24, r25 27290: 80 fb bst r24, 0 27292: 27 f9 bld r18, 7 27294: 86 95 lsr r24 27296: 87 70 andi r24, 0x07 ; 7 27298: 38 7f andi r19, 0xF8 ; 248 2729a: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 2729c: 62 58 subi r22, 0x82 ; 130 2729e: 7d 4f sbci r23, 0xFD ; 253 272a0: fb 01 movw r30, r22 272a2: 80 81 ld r24, Z 272a4: 86 95 lsr r24 272a6: 86 95 lsr r24 272a8: 86 95 lsr r24 272aa: 80 fb bst r24, 0 272ac: 37 f9 bld r19, 7 272ae: 81 fb bst r24, 1 272b0: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 272b2: 6c ee ldi r22, 0xEC ; 236 272b4: 8f 2d mov r24, r15 272b6: 0f 94 d0 38 call 0x271a0 ; 0x271a0 if (curr == nullptr) { 272ba: 20 97 sbiw r28, 0x00 ; 0 272bc: 09 f4 brne .+2 ; 0x272c0 curr = ¤ts[axis]; 272be: e8 01 movw r28, r16 272c0: 19 81 ldd r17, Y+1 ; 0x01 272c2: 8a 81 ldd r24, Y+2 ; 0x02 272c4: c1 2f mov r28, r17 272c6: 81 17 cp r24, r17 272c8: 08 f4 brcc .+2 ; 0x272cc 272ca: 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()) { 272cc: 18 17 cp r17, r24 272ce: 40 f4 brcc .+16 ; 0x272e0 // Let user know firmware modified the value SERIAL_ECHO_START; 272d0: 84 e1 ldi r24, 0x14 ; 20 272d2: 9b ea ldi r25, 0xAB ; 171 272d4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 272d8: 89 e8 ldi r24, 0x89 ; 137 272da: 9f e6 ldi r25, 0x6F ; 111 272dc: 0e 94 97 7b call 0xf72e ; 0xf72e struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 272e0: 2c 2f mov r18, r28 272e2: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 272e4: 31 2f mov r19, r17 272e6: 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); 272e8: 4f e0 ldi r20, 0x0F ; 15 272ea: 50 e0 ldi r21, 0x00 ; 0 272ec: 60 e9 ldi r22, 0x90 ; 144 272ee: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 272f0: df 91 pop r29 272f2: cf 91 pop r28 272f4: 1f 91 pop r17 272f6: 0f 91 pop r16 272f8: 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); 272fa: 0d 94 d0 38 jmp 0x271a0 ; 0x271a0 000272fe : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 272fe: e8 2f mov r30, r24 27300: 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--; 27302: 98 e0 ldi r25, 0x08 ; 8 27304: 76 95 lsr r23 27306: 67 95 ror r22 27308: 61 15 cp r22, r1 2730a: 71 05 cpc r23, r1 2730c: 11 f0 breq .+4 ; 0x27312 2730e: 91 50 subi r25, 0x01 ; 1 27310: f9 cf rjmp .-14 ; 0x27304 return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 27312: eb 50 subi r30, 0x0B ; 11 27314: fb 4f sbci r31, 0xFB ; 251 27316: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 27318: 50 e0 ldi r21, 0x00 ; 0 2731a: 40 e0 ldi r20, 0x00 ; 0 2731c: 69 2f mov r22, r25 2731e: 0d 94 14 39 jmp 0x27228 ; 0x27228 00027322 : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 27322: 0f 93 push r16 27324: 1f 93 push r17 27326: cf 93 push r28 27328: df 93 push r29 2732a: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 2732c: 08 2f mov r16, r24 2732e: 10 e0 ldi r17, 0x00 ; 0 27330: f8 01 movw r30, r16 27332: eb 50 subi r30, 0x0B ; 11 27334: fb 4f sbci r31, 0xFB ; 251 27336: 50 e0 ldi r21, 0x00 ; 0 27338: 40 e0 ldi r20, 0x00 ; 0 2733a: 60 81 ld r22, Z 2733c: 0f 94 14 39 call 0x27228 ; 0x27228 tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 27340: 20 e0 ldi r18, 0x00 ; 0 27342: 30 e0 ldi r19, 0x00 ; 0 27344: a9 01 movw r20, r18 27346: 61 e9 ldi r22, 0x91 ; 145 27348: 8c 2f mov r24, r28 2734a: 0f 94 d0 38 call 0x271a0 ; 0x271a0 const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 2734e: d0 91 69 06 lds r29, 0x0669 ; 0x800669 if (axis == Z_AXIS) { 27352: c2 30 cpi r28, 0x02 ; 2 27354: e1 f5 brne .+120 ; 0x273ce #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 27356: 20 e0 ldi r18, 0x00 ; 0 27358: 30 e0 ldi r19, 0x00 ; 0 2735a: 44 e0 ldi r20, 0x04 ; 4 2735c: 51 e0 ldi r21, 0x01 ; 1 2735e: 6d ee ldi r22, 0xED ; 237 27360: 82 e0 ldi r24, 0x02 ; 2 27362: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 27366: 24 ef ldi r18, 0xF4 ; 244 27368: 31 e0 ldi r19, 0x01 ; 1 2736a: 40 e0 ldi r20, 0x00 ; 0 2736c: 50 e0 ldi r21, 0x00 ; 0 2736e: d1 30 cpi r29, 0x01 ; 1 27370: 19 f4 brne .+6 ; 0x27378 27372: 20 e0 ldi r18, 0x00 ; 0 27374: 30 e0 ldi r19, 0x00 ; 0 27376: a9 01 movw r20, r18 27378: 64 e9 ldi r22, 0x94 ; 148 2737a: 82 e0 ldi r24, 0x02 ; 2 2737c: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 27380: 24 e8 ldi r18, 0x84 ; 132 27382: 31 e0 ldi r19, 0x01 ; 1 27384: 40 e0 ldi r20, 0x00 ; 0 27386: 50 e0 ldi r21, 0x00 ; 0 27388: d1 30 cpi r29, 0x01 ; 1 2738a: 21 f4 brne .+8 ; 0x27394 2738c: 24 e0 ldi r18, 0x04 ; 4 2738e: 30 e0 ldi r19, 0x00 ; 0 27390: 40 e0 ldi r20, 0x00 ; 0 27392: 50 e0 ldi r21, 0x00 ; 0 27394: 60 e8 ldi r22, 0x80 ; 128 27396: 82 e0 ldi r24, 0x02 ; 2 27398: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 2739c: 28 ec ldi r18, 0xC8 ; 200 2739e: 34 e0 ldi r19, 0x04 ; 4 273a0: 46 e0 ldi r20, 0x06 ; 6 273a2: 50 e0 ldi r21, 0x00 ; 0 273a4: 60 ef ldi r22, 0xF0 ; 240 273a6: 82 e0 ldi r24, 0x02 ; 2 273a8: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 273ac: 20 ef ldi r18, 0xF0 ; 240 273ae: 3f ef ldi r19, 0xFF ; 255 273b0: 4f e0 ldi r20, 0x0F ; 15 273b2: 50 e0 ldi r21, 0x00 ; 0 273b4: d1 30 cpi r29, 0x01 ; 1 273b6: 19 f4 brne .+6 ; 0x273be 273b8: 20 e0 ldi r18, 0x00 ; 0 273ba: 30 e0 ldi r19, 0x00 ; 0 273bc: a9 01 movw r20, r18 273be: 63 e9 ldi r22, 0x93 ; 147 273c0: 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); } } 273c2: df 91 pop r29 273c4: cf 91 pop r28 273c6: 1f 91 pop r17 273c8: 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); 273ca: 0d 94 d0 38 jmp 0x271a0 ; 0x271a0 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)); 273ce: f8 01 movw r30, r16 273d0: e8 5e subi r30, 0xE8 ; 232 273d2: fc 4f sbci r31, 0xFC ; 252 273d4: 20 81 ld r18, Z 273d6: 30 e0 ldi r19, 0x00 ; 0 273d8: 50 e0 ldi r21, 0x00 ; 0 273da: 40 e0 ldi r20, 0x00 ; 0 273dc: a9 01 movw r20, r18 273de: 33 27 eor r19, r19 273e0: 22 27 eor r18, r18 273e2: 51 60 ori r21, 0x01 ; 1 273e4: 6d ee ldi r22, 0xED ; 237 273e6: 8c 2f mov r24, r28 273e8: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 273ec: 20 e0 ldi r18, 0x00 ; 0 273ee: 30 e0 ldi r19, 0x00 ; 0 273f0: a9 01 movw r20, r18 273f2: d1 30 cpi r29, 0x01 ; 1 273f4: 61 f0 breq .+24 ; 0x2740e uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 273f6: 2e ea ldi r18, 0xAE ; 174 273f8: 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) 273fa: c2 30 cpi r28, 0x02 ; 2 273fc: 30 f0 brcs .+12 ; 0x2740a { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 273fe: 24 ef ldi r18, 0xF4 ; 244 27400: 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) 27402: c2 30 cpi r28, 0x02 ; 2 27404: 11 f0 breq .+4 ; 0x2740a { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 27406: 30 e0 ldi r19, 0x00 ; 0 27408: 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)); 2740a: 50 e0 ldi r21, 0x00 ; 0 2740c: 40 e0 ldi r20, 0x00 ; 0 2740e: 64 e9 ldi r22, 0x94 ; 148 27410: 8c 2f mov r24, r28 27412: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 27416: 20 e8 ldi r18, 0x80 ; 128 27418: 31 e0 ldi r19, 0x01 ; 1 2741a: 40 e0 ldi r20, 0x00 ; 0 2741c: 50 e0 ldi r21, 0x00 ; 0 2741e: d1 30 cpi r29, 0x01 ; 1 27420: 21 f4 brne .+8 ; 0x2742a 27422: 24 e0 ldi r18, 0x04 ; 4 27424: 30 e0 ldi r19, 0x00 ; 0 27426: 40 e0 ldi r20, 0x00 ; 0 27428: 50 e0 ldi r21, 0x00 ; 0 2742a: 60 e8 ldi r22, 0x80 ; 128 2742c: 8c 2f mov r24, r28 2742e: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 27432: 00 0f add r16, r16 27434: 11 1f adc r17, r17 27436: 00 0f add r16, r16 27438: 11 1f adc r17, r17 2743a: f8 01 movw r30, r16 2743c: e8 5f subi r30, 0xF8 ; 248 2743e: fc 4f sbci r31, 0xFC ; 252 27440: 20 81 ld r18, Z 27442: 31 81 ldd r19, Z+1 ; 0x01 27444: 42 81 ldd r20, Z+2 ; 0x02 27446: 53 81 ldd r21, Z+3 ; 0x03 27448: 60 ef ldi r22, 0xF0 ; 240 2744a: 8c 2f mov r24, r28 2744c: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 27450: 20 e0 ldi r18, 0x00 ; 0 27452: 30 e0 ldi r19, 0x00 ; 0 27454: a9 01 movw r20, r18 27456: 63 e9 ldi r22, 0x93 ; 147 27458: 8c 2f mov r24, r28 2745a: b3 cf rjmp .-154 ; 0x273c2 0002745c : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 2745c: 1f 93 push r17 2745e: cf 93 push r28 27460: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 27462: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 27466: 1f 92 push r1 27468: 8f 93 push r24 2746a: 83 e3 ldi r24, 0x33 ; 51 2746c: 91 ea ldi r25, 0xA1 ; 161 2746e: 9f 93 push r25 27470: 8f 93 push r24 27472: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 27476: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 2747a: 83 70 andi r24, 0x03 ; 3 2747c: 0f 90 pop r0 2747e: 0f 90 pop r0 27480: 0f 90 pop r0 27482: 0f 90 pop r0 27484: 11 f0 breq .+4 ; 0x2748a tmc2130_wait_standstill_xy(1000); 27486: 0f 94 68 87 call 0x30ed0 ; 0x30ed0 if (tmc2130_sg_homing_axes_mask) 2748a: 10 91 3d 06 lds r17, 0x063D ; 0x80063d 2748e: 11 23 and r17, r17 27490: 71 f0 breq .+28 ; 0x274ae { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 27492: d1 e0 ldi r29, 0x01 ; 1 27494: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 27496: 81 2f mov r24, r17 27498: 8d 23 and r24, r29 2749a: 19 f0 breq .+6 ; 0x274a2 tmc2130_XYZ_reg_init(axis); 2749c: 8c 2f mov r24, r28 2749e: 0f 94 91 39 call 0x27322 ; 0x27322 #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 274a2: cf 5f subi r28, 0xFF ; 255 274a4: dd 0f add r29, r29 274a6: c3 30 cpi r28, 0x03 ; 3 274a8: b1 f7 brne .-20 ; 0x27496 { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 274aa: 10 92 3d 06 sts 0x063D, r1 ; 0x80063d } tmc2130_sg_crash = false; 274ae: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d #endif } 274b2: df 91 pop r29 274b4: cf 91 pop r28 274b6: 1f 91 pop r17 274b8: 08 95 ret 000274ba : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 274ba: df 92 push r13 274bc: ef 92 push r14 274be: ff 92 push r15 274c0: 0f 93 push r16 274c2: 1f 93 push r17 274c4: cf 93 push r28 274c6: df 93 push r29 274c8: 00 d0 rcall .+0 ; 0x274ca 274ca: cd b7 in r28, 0x3d ; 61 274cc: de b7 in r29, 0x3e ; 62 274ce: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 274d0: 1f 92 push r1 274d2: 8f 93 push r24 274d4: 8d e0 ldi r24, 0x0D ; 13 274d6: 91 ea ldi r25, 0xA1 ; 161 274d8: 9f 93 push r25 274da: 8f 93 push r24 274dc: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 274e0: 8d 2d mov r24, r13 274e2: 83 70 andi r24, 0x03 ; 3 274e4: 0f 90 pop r0 274e6: 0f 90 pop r0 274e8: 0f 90 pop r0 274ea: 0f 90 pop r0 274ec: 11 f0 breq .+4 ; 0x274f2 tmc2130_wait_standstill_xy(1000); 274ee: 0f 94 68 87 call 0x30ed0 ; 0x30ed0 } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 274f2: 10 e0 ldi r17, 0x00 ; 0 274f4: 00 e0 ldi r16, 0x00 ; 0 274f6: ff 24 eor r15, r15 274f8: f3 94 inc r15 274fa: 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) 274fc: 8d 2d mov r24, r13 274fe: 8f 21 and r24, r15 27500: 09 f4 brne .+2 ; 0x27504 27502: 46 c0 rjmp .+140 ; 0x27590 { tmc2130_sg_homing_axes_mask |= mask; 27504: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 27508: 8f 29 or r24, r15 2750a: 80 93 3d 06 sts 0x063D, r24 ; 0x80063d //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 2750e: 20 e0 ldi r18, 0x00 ; 0 27510: 30 e0 ldi r19, 0x00 ; 0 27512: a9 01 movw r20, r18 27514: 60 e8 ldi r22, 0x80 ; 128 27516: 80 2f mov r24, r16 27518: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 2751c: f8 01 movw r30, r16 2751e: e8 5e subi r30, 0xE8 ; 232 27520: fc 4f sbci r31, 0xFC ; 252 27522: 20 81 ld r18, Z 27524: 30 e0 ldi r19, 0x00 ; 0 27526: 50 e0 ldi r21, 0x00 ; 0 27528: 40 e0 ldi r20, 0x00 ; 0 2752a: a9 01 movw r20, r18 2752c: 33 27 eor r19, r19 2752e: 22 27 eor r18, r18 27530: 6d ee ldi r22, 0xED ; 237 27532: 80 2f mov r24, r16 27534: 0f 94 d0 38 call 0x271a0 ; 0x271a0 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) 27538: 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; 2753a: 24 ef ldi r18, 0xF4 ; 244 2753c: 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) 2753e: 08 17 cp r16, r24 27540: 11 f0 breq .+4 ; 0x27546 { case X_AXIS: return TMC2130_TCOOLTHRS_X; 27542: 2e ea ldi r18, 0xAE ; 174 27544: 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)); 27546: 50 e0 ldi r21, 0x00 ; 0 27548: 40 e0 ldi r20, 0x00 ; 0 2754a: 64 e9 ldi r22, 0x94 ; 148 2754c: 8e 2d mov r24, r14 2754e: 0f 94 d0 38 call 0x271a0 ; 0x271a0 iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 27552: b8 01 movw r22, r16 27554: 66 0f add r22, r22 27556: 77 1f adc r23, r23 27558: 60 0f add r22, r16 2755a: 71 1f adc r23, r17 2755c: 6f 5f subi r22, 0xFF ; 255 2755e: 7e 45 sbci r23, 0x5E ; 94 27560: 43 e0 ldi r20, 0x03 ; 3 27562: 50 e0 ldi r21, 0x00 ; 0 27564: ce 01 movw r24, r28 27566: 01 96 adiw r24, 0x01 ; 1 27568: 0f 94 a9 da call 0x3b552 ; 0x3b552 MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 2756c: ae 01 movw r20, r28 2756e: 4f 5f subi r20, 0xFF ; 255 27570: 5f 4f sbci r21, 0xFF ; 255 27572: f8 01 movw r30, r16 27574: eb 50 subi r30, 0x0B ; 11 27576: fb 4f sbci r31, 0xFB ; 251 27578: 60 81 ld r22, Z 2757a: 8e 2d mov r24, r14 2757c: 0f 94 14 39 call 0x27228 ; 0x27228 tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 27580: 20 e8 ldi r18, 0x80 ; 128 27582: 31 e0 ldi r19, 0x01 ; 1 27584: 40 e0 ldi r20, 0x00 ; 0 27586: 50 e0 ldi r21, 0x00 ; 0 27588: 60 e8 ldi r22, 0x80 ; 128 2758a: 8e 2d mov r24, r14 2758c: 0f 94 d0 38 call 0x271a0 ; 0x271a0 { 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 27590: ff 0c add r15, r15 27592: 0f 5f subi r16, 0xFF ; 255 27594: 1f 4f sbci r17, 0xFF ; 255 27596: 03 30 cpi r16, 0x03 ; 3 27598: 11 05 cpc r17, r1 2759a: 09 f0 breq .+2 ; 0x2759e 2759c: ae cf rjmp .-164 ; 0x274fa 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 } 2759e: 0f 90 pop r0 275a0: 0f 90 pop r0 275a2: 0f 90 pop r0 275a4: df 91 pop r29 275a6: cf 91 pop r28 275a8: 1f 91 pop r17 275aa: 0f 91 pop r16 275ac: ff 90 pop r15 275ae: ef 90 pop r14 275b0: df 90 pop r13 275b2: 08 95 ret 000275b4 : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 275b4: 89 e6 ldi r24, 0x69 ; 105 275b6: 9f e0 ldi r25, 0x0F ; 15 275b8: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 275bc: 91 e0 ldi r25, 0x01 ; 1 275be: 81 11 cpse r24, r1 275c0: 01 c0 rjmp .+2 ; 0x275c4 275c2: 90 e0 ldi r25, 0x00 ; 0 275c4: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 275c8: 08 95 ret 000275ca : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 275ca: 89 e6 ldi r24, 0x69 ; 105 275cc: 9f e0 ldi r25, 0x0F ; 15 275ce: 0e 94 50 78 call 0xf0a0 ; 0xf0a0 crashdet_use_eeprom_setting(); 275d2: 0d 94 da 3a jmp 0x275b4 ; 0x275b4 000275d6 : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 275d6: cf 93 push r28 275d8: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 275da: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 275dc: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 275de: 9f b7 in r25, 0x3f ; 63 275e0: f8 94 cli 275e2: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 275e6: 80 62 ori r24, 0x20 ; 32 275e8: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 275ec: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, HIGH); 275ee: 9f b7 in r25, 0x3f ; 63 275f0: f8 94 cli 275f2: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 275f6: 80 61 ori r24, 0x10 ; 16 275f8: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 275fc: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 275fe: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 27600: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 27602: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27606: 80 62 ori r24, 0x20 ; 32 27608: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 2760c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27610: 80 61 ori r24, 0x10 ; 16 27612: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 27616: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2761a: 8b 7f andi r24, 0xFB ; 251 2761c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 27620: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27624: 8f 77 andi r24, 0x7F ; 127 27626: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 2762a: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2762e: 8f 7b andi r24, 0xBF ; 191 27630: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 27634: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27638: 87 7f andi r24, 0xF7 ; 247 2763a: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,HIGH); 2763e: 9f b7 in r25, 0x3f ; 63 27640: f8 94 cli 27642: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27646: 84 60 ori r24, 0x04 ; 4 27648: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2764c: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 2764e: 9f b7 in r25, 0x3f ; 63 27650: f8 94 cli 27652: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27656: 80 68 ori r24, 0x80 ; 128 27658: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2765c: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 2765e: 9f b7 in r25, 0x3f ; 63 27660: f8 94 cli 27662: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27666: 80 64 ori r24, 0x40 ; 64 27668: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2766c: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 2766e: 9f b7 in r25, 0x3f ; 63 27670: f8 94 cli 27672: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27676: 88 60 ori r24, 0x08 ; 8 27678: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 2767c: 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); 2767e: 80 e0 ldi r24, 0x00 ; 0 27680: 0f 94 91 39 call 0x27322 ; 0x27322 27684: 81 e0 ldi r24, 0x01 ; 1 27686: 0f 94 91 39 call 0x27322 ; 0x27322 2768a: 82 e0 ldi r24, 0x02 ; 2 2768c: 0f 94 91 39 call 0x27322 ; 0x27322 } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 27690: 50 e0 ldi r21, 0x00 ; 0 27692: 40 e0 ldi r20, 0x00 ; 0 27694: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 27698: 83 e0 ldi r24, 0x03 ; 3 2769a: 0f 94 14 39 call 0x27228 ; 0x27228 tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 2769e: 20 e0 ldi r18, 0x00 ; 0 276a0: 30 e0 ldi r19, 0x00 ; 0 276a2: a9 01 movw r20, r18 276a4: 61 e9 ldi r22, 0x91 ; 145 276a6: 83 e0 ldi r24, 0x03 ; 3 276a8: 0f 94 d0 38 call 0x271a0 ; 0x271a0 #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 276ac: c1 fd sbrc r28, 1 276ae: 1d c0 rjmp .+58 ; 0x276ea tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 276b0: 20 e8 ldi r18, 0x80 ; 128 276b2: 31 e0 ldi r19, 0x01 ; 1 276b4: 40 e0 ldi r20, 0x00 ; 0 276b6: 50 e0 ldi r21, 0x00 ; 0 276b8: 60 e8 ldi r22, 0x80 ; 128 276ba: 83 e0 ldi r24, 0x03 ; 3 276bc: 0f 94 d0 38 call 0x271a0 ; 0x271a0 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]); 276c0: 60 91 f9 04 lds r22, 0x04F9 ; 0x8004f9 276c4: 80 e0 ldi r24, 0x00 ; 0 276c6: 0f 94 dc 87 call 0x30fb8 ; 0x30fb8 tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 276ca: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 276ce: 81 e0 ldi r24, 0x01 ; 1 276d0: 0f 94 dc 87 call 0x30fb8 ; 0x30fb8 tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 276d4: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 276d8: 82 e0 ldi r24, 0x02 ; 2 276da: 0f 94 dc 87 call 0x30fb8 ; 0x30fb8 #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 276de: 60 91 fc 04 lds r22, 0x04FC ; 0x8004fc 276e2: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 276e4: 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]); 276e6: 0d 94 dc 87 jmp 0x30fb8 ; 0x30fb8 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)); 276ea: 20 e0 ldi r18, 0x00 ; 0 276ec: 30 e0 ldi r19, 0x00 ; 0 276ee: 43 e0 ldi r20, 0x03 ; 3 276f0: 50 e0 ldi r21, 0x00 ; 0 276f2: 6d ee ldi r22, 0xED ; 237 276f4: 83 e0 ldi r24, 0x03 ; 3 276f6: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 276fa: 20 e0 ldi r18, 0x00 ; 0 276fc: 30 e0 ldi r19, 0x00 ; 0 276fe: a9 01 movw r20, r18 27700: 64 e9 ldi r22, 0x94 ; 148 27702: 83 e0 ldi r24, 0x03 ; 3 27704: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 27708: 24 e0 ldi r18, 0x04 ; 4 2770a: 30 e0 ldi r19, 0x00 ; 0 2770c: 40 e0 ldi r20, 0x00 ; 0 2770e: 50 e0 ldi r21, 0x00 ; 0 27710: 60 e8 ldi r22, 0x80 ; 128 27712: 83 e0 ldi r24, 0x03 ; 3 27714: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 27718: 2b e2 ldi r18, 0x2B ; 43 2771a: 34 e5 ldi r19, 0x54 ; 84 2771c: 42 e0 ldi r20, 0x02 ; 2 2771e: 50 e0 ldi r21, 0x00 ; 0 27720: 60 ef ldi r22, 0xF0 ; 240 27722: 83 e0 ldi r24, 0x03 ; 3 27724: 0f 94 d0 38 call 0x271a0 ; 0x271a0 tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 27728: 23 e9 ldi r18, 0x93 ; 147 2772a: 31 e0 ldi r19, 0x01 ; 1 2772c: 40 e0 ldi r20, 0x00 ; 0 2772e: 50 e0 ldi r21, 0x00 ; 0 27730: 63 e9 ldi r22, 0x93 ; 147 27732: 83 e0 ldi r24, 0x03 ; 3 27734: 0f 94 d0 38 call 0x271a0 ; 0x271a0 SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 27738: 81 ee ldi r24, 0xE1 ; 225 2773a: 90 ea ldi r25, 0xA0 ; 160 2773c: 0e 94 97 7b call 0xf72e ; 0xf72e 27740: bf cf rjmp .-130 ; 0x276c0 00027742 : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 27742: df 92 push r13 27744: ef 92 push r14 27746: ff 92 push r15 27748: 0f 93 push r16 2774a: 1f 93 push r17 2774c: cf 93 push r28 2774e: df 93 push r29 MENU_BEGIN(); 27750: 0f 94 8e ce call 0x39d1c ; 0x39d1c 27754: 10 92 12 05 sts 0x0512, r1 ; 0x800512 27758: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2775c: 84 30 cpi r24, 0x04 ; 4 2775e: 08 f0 brcs .+2 ; 0x27762 27760: 66 c0 rjmp .+204 ; 0x2782e 27762: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 27766: 0f 94 0e cd call 0x39a1c ; 0x39a1c 2776a: 88 23 and r24, r24 2776c: e9 f0 breq .+58 ; 0x277a8 2776e: 09 ef ldi r16, 0xF9 ; 249 27770: 14 e0 ldi r17, 0x04 ; 4 27772: c7 ef ldi r28, 0xF7 ; 247 27774: 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) { 27776: f8 01 movw r30, r16 27778: 80 81 ld r24, Z 2777a: 8e 31 cpi r24, 0x1E ; 30 2777c: 08 f4 brcc .+2 ; 0x27780 tmc2130_wave_fac[axis] = 0; 2777e: 10 82 st Z, r1 27780: f8 01 movw r30, r16 27782: 61 91 ld r22, Z+ 27784: 8f 01 movw r16, r30 27786: ce 01 movw r24, r28 27788: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 2778c: 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++) { 2778e: c3 3f cpi r28, 0xF3 ; 243 27790: fe e0 ldi r31, 0x0E ; 14 27792: df 07 cpc r29, r31 27794: 81 f7 brne .-32 ; 0x27776 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(); 27796: 0e 94 cc f8 call 0x1f198 ; 0x1f198 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) { } 2779a: e8 94 clt 2779c: d0 f8 bld r13, 0 2779e: 80 fb bst r24, 0 277a0: 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())); 277a2: 8d 2d mov r24, r13 277a4: 0f 94 eb 3a call 0x275d6 ; 0x275d6 { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 277a8: 8c ea ldi r24, 0xAC ; 172 277aa: 9d e3 ldi r25, 0x3D ; 61 277ac: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 277b0: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 #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); 277b4: 8d e9 ldi r24, 0x9D ; 157 277b6: 97 e5 ldi r25, 0x57 ; 87 277b8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 277bc: f1 2c mov r15, r1 277be: e1 2c mov r14, r1 277c0: 08 ec ldi r16, 0xC8 ; 200 277c2: 10 e0 ldi r17, 0x00 ; 0 277c4: 2d e1 ldi r18, 0x1D ; 29 277c6: 30 e0 ldi r19, 0x00 ; 0 277c8: 48 e0 ldi r20, 0x08 ; 8 277ca: 69 ef ldi r22, 0xF9 ; 249 277cc: 74 e0 ldi r23, 0x04 ; 4 277ce: 0f 94 de ce call 0x39dbc ; 0x39dbc 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); 277d2: 81 e9 ldi r24, 0x91 ; 145 277d4: 97 e5 ldi r25, 0x57 ; 87 277d6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 277da: 2d e1 ldi r18, 0x1D ; 29 277dc: 30 e0 ldi r19, 0x00 ; 0 277de: 48 e0 ldi r20, 0x08 ; 8 277e0: 6a ef ldi r22, 0xFA ; 250 277e2: 74 e0 ldi r23, 0x04 ; 4 277e4: 0f 94 de ce call 0x39dbc ; 0x39dbc 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); 277e8: 85 e8 ldi r24, 0x85 ; 133 277ea: 97 e5 ldi r25, 0x57 ; 87 277ec: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 277f0: 2d e1 ldi r18, 0x1D ; 29 277f2: 30 e0 ldi r19, 0x00 ; 0 277f4: 48 e0 ldi r20, 0x08 ; 8 277f6: 6b ef ldi r22, 0xFB ; 251 277f8: 74 e0 ldi r23, 0x04 ; 4 277fa: 0f 94 de ce call 0x39dbc ; 0x39dbc #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); 277fe: 89 e7 ldi r24, 0x79 ; 121 27800: 97 e5 ldi r25, 0x57 ; 87 27802: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 27806: 2d e1 ldi r18, 0x1D ; 29 27808: 30 e0 ldi r19, 0x00 ; 0 2780a: 48 e0 ldi r20, 0x08 ; 8 2780c: 6c ef ldi r22, 0xFC ; 252 2780e: 74 e0 ldi r23, 0x04 ; 4 27810: 0f 94 de ce call 0x39dbc ; 0x39dbc MENU_END(); 27814: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 27818: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2781c: 8f 5f subi r24, 0xFF ; 255 2781e: 80 93 12 05 sts 0x0512, r24 ; 0x800512 27822: 80 91 14 05 lds r24, 0x0514 ; 0x800514 27826: 8f 5f subi r24, 0xFF ; 255 27828: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2782c: 95 cf rjmp .-214 ; 0x27758 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(); } 2782e: df 91 pop r29 27830: cf 91 pop r28 27832: 1f 91 pop r17 27834: 0f 91 pop r16 27836: ff 90 pop r15 27838: ef 90 pop r14 2783a: df 90 pop r13 2783c: 08 95 ret 0002783e : , 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()); } 2783e: fc 01 movw r30, r24 27840: 20 81 ld r18, Z 27842: 92 81 ldd r25, Z+2 ; 0x02 27844: 49 2f mov r20, r25 27846: 50 e0 ldi r21, 0x00 ; 0 27848: 21 11 cpse r18, r1 2784a: 02 c0 rjmp .+4 ; 0x27850 2784c: 44 0f add r20, r20 2784e: 55 1f adc r21, r21 27850: 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; } 27852: 21 11 cpse r18, r1 27854: 01 c0 rjmp .+2 ; 0x27858 27856: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 27858: 84 17 cp r24, r20 2785a: 15 06 cpc r1, r21 2785c: 31 f0 breq .+12 ; 0x2786a 2785e: 2c f0 brlt .+10 ; 0x2786a 27860: 89 2f mov r24, r25 27862: 21 11 cpse r18, r1 27864: 02 c0 rjmp .+4 ; 0x2786a 27866: 88 0f add r24, r24 27868: 08 95 ret 2786a: 08 95 ret 0002786c : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 2786c: 3f b7 in r19, 0x3f ; 63 cli(); 2786e: f8 94 cli m = timer2_overflow_count; 27870: 80 91 39 06 lds r24, 0x0639 ; 0x800639 27874: 90 91 3a 06 lds r25, 0x063A ; 0x80063a 27878: a0 91 3b 06 lds r26, 0x063B ; 0x80063b 2787c: b0 91 3c 06 lds r27, 0x063C ; 0x80063c #if defined(TCNT2) t = TCNT2; 27880: 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)) 27884: b8 9b sbis 0x17, 0 ; 23 27886: 05 c0 rjmp .+10 ; 0x27892 27888: 2f 3f cpi r18, 0xFF ; 255 2788a: 19 f0 breq .+6 ; 0x27892 m++; 2788c: 01 96 adiw r24, 0x01 ; 1 2788e: a1 1d adc r26, r1 27890: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 27892: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 27894: ba 2f mov r27, r26 27896: a9 2f mov r26, r25 27898: 98 2f mov r25, r24 2789a: 88 27 eor r24, r24 2789c: bc 01 movw r22, r24 2789e: cd 01 movw r24, r26 278a0: 62 0f add r22, r18 278a2: 71 1d adc r23, r1 278a4: 81 1d adc r24, r1 278a6: 91 1d adc r25, r1 278a8: 42 e0 ldi r20, 0x02 ; 2 278aa: 66 0f add r22, r22 278ac: 77 1f adc r23, r23 278ae: 88 1f adc r24, r24 278b0: 99 1f adc r25, r25 278b2: 4a 95 dec r20 278b4: d1 f7 brne .-12 ; 0x278aa } 278b6: 08 95 ret 000278b8 : void delay2(unsigned long ms) { 278b8: 8f 92 push r8 278ba: 9f 92 push r9 278bc: af 92 push r10 278be: bf 92 push r11 278c0: cf 92 push r12 278c2: df 92 push r13 278c4: ef 92 push r14 278c6: ff 92 push r15 278c8: 6b 01 movw r12, r22 278ca: 7c 01 movw r14, r24 uint32_t start = micros2(); 278cc: 0f 94 36 3c call 0x2786c ; 0x2786c 278d0: 4b 01 movw r8, r22 278d2: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 278d4: c1 14 cp r12, r1 278d6: d1 04 cpc r13, r1 278d8: e1 04 cpc r14, r1 278da: f1 04 cpc r15, r1 278dc: b9 f0 breq .+46 ; 0x2790c 278de: 0f 94 36 3c call 0x2786c ; 0x2786c 278e2: 68 19 sub r22, r8 278e4: 79 09 sbc r23, r9 278e6: 8a 09 sbc r24, r10 278e8: 9b 09 sbc r25, r11 278ea: 68 3e cpi r22, 0xE8 ; 232 278ec: 73 40 sbci r23, 0x03 ; 3 278ee: 81 05 cpc r24, r1 278f0: 91 05 cpc r25, r1 278f2: 80 f3 brcs .-32 ; 0x278d4 { ms--; 278f4: 21 e0 ldi r18, 0x01 ; 1 278f6: c2 1a sub r12, r18 278f8: d1 08 sbc r13, r1 278fa: e1 08 sbc r14, r1 278fc: f1 08 sbc r15, r1 start += 1000; 278fe: 88 ee ldi r24, 0xE8 ; 232 27900: 88 0e add r8, r24 27902: 83 e0 ldi r24, 0x03 ; 3 27904: 98 1e adc r9, r24 27906: a1 1c adc r10, r1 27908: b1 1c adc r11, r1 2790a: e4 cf rjmp .-56 ; 0x278d4 } } } 2790c: ff 90 pop r15 2790e: ef 90 pop r14 27910: df 90 pop r13 27912: cf 90 pop r12 27914: bf 90 pop r11 27916: af 90 pop r10 27918: 9f 90 pop r9 2791a: 8f 90 pop r8 2791c: 08 95 ret 0002791e : * @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() { 2791e: ef 92 push r14 27920: ff 92 push r15 27922: 0f 93 push r16 27924: 1f 93 push r17 27926: cf 93 push r28 27928: df 93 push r29 2792a: cd b7 in r28, 0x3d ; 61 2792c: de b7 in r29, 0x3e ; 62 2792e: 63 97 sbiw r28, 0x13 ; 19 27930: 0f b6 in r0, 0x3f ; 63 27932: f8 94 cli 27934: de bf out 0x3e, r29 ; 62 27936: 0f be out 0x3f, r0 ; 63 27938: 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) 2793a: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 2793e: 81 11 cpse r24, r1 27940: 3a c0 rjmp .+116 ; 0x279b6 { // Menu was entered. // Initialize its status. _md->status = 1; 27942: 81 e0 ldi r24, 0x01 ; 1 27944: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 check_babystep(); 27948: 0e 94 9b 7b call 0xf736 ; 0xf736 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 2794c: 81 ea ldi r24, 0xA1 ; 161 2794e: 9d e0 ldi r25, 0x0D ; 13 27950: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 27954: 18 2f mov r17, r24 27956: 0e 94 5d 78 call 0xf0ba ; 0xf0ba 2795a: 81 11 cpse r24, r1 2795c: ee c0 rjmp .+476 ; 0x27b3a _md->babystepMemZ = 0; 2795e: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 27962: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 _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)) 27966: 80 e1 ldi r24, 0x10 ; 16 27968: 0e 94 41 f8 call 0x1f082 ; 0x1f082 2796c: 81 11 cpse r24, r1 2796e: 04 c0 rjmp .+8 ; 0x27978 _md->babystepMemZ = 0; 27970: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 27974: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 27978: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 2797c: 70 91 a7 03 lds r23, 0x03A7 ; 0x8003a7 27980: 07 2e mov r0, r23 27982: 00 0c add r0, r0 27984: 88 0b sbc r24, r24 27986: 99 0b sbc r25, r25 27988: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2798c: 20 91 77 06 lds r18, 0x0677 ; 0x800677 27990: 30 91 78 06 lds r19, 0x0678 ; 0x800678 27994: 40 91 79 06 lds r20, 0x0679 ; 0x800679 27998: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 2799c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 279a0: 60 93 a8 03 sts 0x03A8, r22 ; 0x8003a8 279a4: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 279a8: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 279ac: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab lcd_draw_update = 1; 279b0: 81 e0 ldi r24, 0x01 ; 1 279b2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 279b6: 80 91 34 05 lds r24, 0x0534 ; 0x800534 279ba: 90 91 35 05 lds r25, 0x0535 ; 0x800535 279be: 00 97 sbiw r24, 0x00 ; 0 279c0: f1 f1 breq .+124 ; 0x27a3e { _md->babystepMemZ += lcd_encoder; 279c2: 20 91 a6 03 lds r18, 0x03A6 ; 0x8003a6 279c6: 30 91 a7 03 lds r19, 0x03A7 ; 0x8003a7 279ca: 28 0f add r18, r24 279cc: 39 1f adc r19, r25 279ce: 30 93 a7 03 sts 0x03A7, r19 ; 0x8003a7 279d2: 20 93 a6 03 sts 0x03A6, r18 ; 0x8003a6 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 279d6: 21 36 cpi r18, 0x61 ; 97 279d8: 40 ef ldi r20, 0xF0 ; 240 279da: 34 07 cpc r19, r20 279dc: 0c f0 brlt .+2 ; 0x279e0 279de: ba c0 rjmp .+372 ; 0x27b54 279e0: 81 e6 ldi r24, 0x61 ; 97 279e2: 90 ef ldi r25, 0xF0 ; 240 279e4: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 279e8: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 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]; 279ec: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 279f0: 70 91 a7 03 lds r23, 0x03A7 ; 0x8003a7 279f4: 07 2e mov r0, r23 279f6: 00 0c add r0, r0 279f8: 88 0b sbc r24, r24 279fa: 99 0b sbc r25, r25 279fc: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 27a00: 20 91 77 06 lds r18, 0x0677 ; 0x800677 27a04: 30 91 78 06 lds r19, 0x0678 ; 0x800678 27a08: 40 91 79 06 lds r20, 0x0679 ; 0x800679 27a0c: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 27a10: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 27a14: 60 93 a8 03 sts 0x03A8, r22 ; 0x8003a8 27a18: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 27a1c: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 27a20: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab _delay(50); 27a24: 62 e3 ldi r22, 0x32 ; 50 27a26: 70 e0 ldi r23, 0x00 ; 0 27a28: 80 e0 ldi r24, 0x00 ; 0 27a2a: 90 e0 ldi r25, 0x00 ; 0 27a2c: 0f 94 5c 3c call 0x278b8 ; 0x278b8 lcd_encoder = 0; 27a30: 10 92 35 05 sts 0x0535, r1 ; 0x800535 27a34: 10 92 34 05 sts 0x0534, r1 ; 0x800534 lcd_draw_update = 1; 27a38: 81 e0 ldi r24, 0x01 ; 1 27a3a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 27a3e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27a42: 88 23 and r24, r24 27a44: c9 f1 breq .+114 ; 0x27ab8 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 27a46: 81 ea ldi r24, 0xA1 ; 161 27a48: 9d e0 ldi r25, 0x0D ; 13 27a4a: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 27a4e: 2b e0 ldi r18, 0x0B ; 11 27a50: 82 9f mul r24, r18 27a52: c0 01 movw r24, r0 27a54: 11 24 eor r1, r1 27a56: be 01 movw r22, r28 27a58: 6f 5f subi r22, 0xFF ; 255 27a5a: 7f 4f sbci r23, 0xFF ; 255 27a5c: 87 5b subi r24, 0xB7 ; 183 27a5e: 92 4f sbci r25, 0xF2 ; 242 27a60: 0f 94 28 cd call 0x39a50 ; 0x39a50 lcd_home(); 27a64: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_print(buffer.c); 27a68: ce 01 movw r24, r28 27a6a: 01 96 adiw r24, 0x01 ; 1 27a6c: 0e 94 2d 72 call 0xe45a ; 0xe45a lcd_set_cursor(0, 1); 27a70: 61 e0 ldi r22, 0x01 ; 1 27a72: 80 e0 ldi r24, 0x00 ; 0 27a74: 0e 94 26 70 call 0xe04c ; 0xe04c menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 27a78: 10 91 a8 03 lds r17, 0x03A8 ; 0x8003a8 27a7c: 00 91 a9 03 lds r16, 0x03A9 ; 0x8003a9 27a80: f0 90 aa 03 lds r15, 0x03AA ; 0x8003aa 27a84: e0 90 ab 03 lds r14, 0x03AB ; 0x8003ab 27a88: 8b ee ldi r24, 0xEB ; 235 27a8a: 9d e4 ldi r25, 0x4D ; 77 27a8c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 //! (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); 27a90: ef 92 push r14 27a92: ff 92 push r15 27a94: 0f 93 push r16 27a96: 1f 93 push r17 27a98: 9f 93 push r25 27a9a: 8f 93 push r24 27a9c: 1f 92 push r1 27a9e: 80 e2 ldi r24, 0x20 ; 32 27aa0: 8f 93 push r24 27aa2: 83 ed ldi r24, 0xD3 ; 211 27aa4: 94 ea ldi r25, 0xA4 ; 164 27aa6: 9f 93 push r25 27aa8: 8f 93 push r24 27aaa: 0e 94 ff 6f call 0xdffe ; 0xdffe 27aae: 0f b6 in r0, 0x3f ; 63 27ab0: f8 94 cli 27ab2: de bf out 0x3e, r29 ; 62 27ab4: 0f be out 0x3f, r0 ; 63 27ab6: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 27ab8: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 27abc: 81 11 cpse r24, r1 27abe: 04 c0 rjmp .+8 ; 0x27ac8 27ac0: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf 27ac4: 88 23 and r24, r24 27ac6: 51 f1 breq .+84 ; 0x27b1c { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 27ac8: 81 ea ldi r24, 0xA1 ; 161 27aca: 9d e0 ldi r25, 0x0D ; 13 27acc: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 27ad0: 9b e0 ldi r25, 0x0B ; 11 27ad2: 89 9f mul r24, r25 27ad4: 80 01 movw r16, r0 27ad6: 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); 27ad8: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 27adc: 70 91 a7 03 lds r23, 0x03A7 ; 0x8003a7 27ae0: c8 01 movw r24, r16 27ae2: 80 5b subi r24, 0xB0 ; 176 27ae4: 92 4f sbci r25, 0xF2 ; 242 27ae6: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 27aea: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 27aee: c8 01 movw r24, r16 27af0: 8e 5a subi r24, 0xAE ; 174 27af2: 92 4f sbci r25, 0xF2 ; 242 27af4: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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); 27af8: 60 91 95 03 lds r22, 0x0395 ; 0x800395 27afc: 70 91 96 03 lds r23, 0x0396 ; 0x800396 27b00: 80 91 97 03 lds r24, 0x0397 ; 0x800397 27b04: 90 91 98 03 lds r25, 0x0398 ; 0x800398 27b08: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 27b0c: c8 01 movw r24, r16 27b0e: 8d 5a subi r24, 0xAD ; 173 27b10: 92 4f sbci r25, 0xF2 ; 242 27b12: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 27b16: 80 e1 ldi r24, 0x10 ; 16 27b18: 0e 94 5c e6 call 0x1ccb8 ; 0x1ccb8 } menu_back_if_clicked(); 27b1c: 0f 94 f8 d1 call 0x3a3f0 ; 0x3a3f0 } 27b20: 63 96 adiw r28, 0x13 ; 19 27b22: 0f b6 in r0, 0x3f ; 63 27b24: f8 94 cli 27b26: de bf out 0x3e, r29 ; 62 27b28: 0f be out 0x3f, r0 ; 63 27b2a: cd bf out 0x3d, r28 ; 61 27b2c: df 91 pop r29 27b2e: cf 91 pop r28 27b30: 1f 91 pop r17 27b32: 0f 91 pop r16 27b34: ff 90 pop r15 27b36: ef 90 pop r14 27b38: 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-> 27b3a: 2b e0 ldi r18, 0x0B ; 11 27b3c: 12 9f mul r17, r18 27b3e: c0 01 movw r24, r0 27b40: 11 24 eor r1, r1 27b42: 80 5b subi r24, 0xB0 ; 176 27b44: 92 4f sbci r25, 0xF2 ; 242 27b46: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 27b4a: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 27b4e: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 27b52: 09 cf rjmp .-494 ; 0x27966 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 27b54: 12 16 cp r1, r18 27b56: 13 06 cpc r1, r19 27b58: 2c f4 brge .+10 ; 0x27b64 27b5a: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 27b5e: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 27b62: 44 cf rjmp .-376 ; 0x279ec extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 27b64: 2f b7 in r18, 0x3f ; 63 27b66: f8 94 cli babystepsTodo[Z_AXIS] += n; 27b68: 40 91 67 06 lds r20, 0x0667 ; 0x800667 27b6c: 50 91 68 06 lds r21, 0x0668 ; 0x800668 27b70: 84 0f add r24, r20 27b72: 95 1f adc r25, r21 27b74: 90 93 68 06 sts 0x0668, r25 ; 0x800668 27b78: 80 93 67 06 sts 0x0667, r24 ; 0x800667 CRITICAL_SECTION_END 27b7c: 2f bf out 0x3f, r18 ; 63 27b7e: 36 cf rjmp .-404 ; 0x279ec 00027b80 : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 27b80: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 27b84: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 27b88: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 27b8c: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 27b90: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 27b94: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 27b98: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 27b9c: 26 17 cp r18, r22 27b9e: 37 07 cpc r19, r23 27ba0: 0c f0 brlt .+2 ; 0x27ba4 27ba2: 65 c0 rjmp .+202 ; 0x27c6e { if (lcd_encoder != 0) 27ba4: 80 91 34 05 lds r24, 0x0534 ; 0x800534 27ba8: 90 91 35 05 lds r25, 0x0535 ; 0x800535 27bac: 89 2b or r24, r25 27bae: b9 f1 breq .+110 ; 0x27c1e { refresh_cmd_timeout(); 27bb0: 0e 94 09 68 call 0xd012 ; 0xd012 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; 27bb4: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 if (++ next_block_index == BLOCK_BUFFER_SIZE) 27bb8: 8f 5f subi r24, 0xFF ; 255 27bba: 80 31 cpi r24, 0x10 ; 16 27bbc: 09 f4 brne .+2 ; 0x27bc0 next_block_index = 0; 27bbe: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 27bc0: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 if (! planner_queue_full()) 27bc4: 98 17 cp r25, r24 27bc6: 59 f1 breq .+86 ; 0x27c1e { current_position[E_AXIS] += lcd_encoder; 27bc8: 60 91 34 05 lds r22, 0x0534 ; 0x800534 27bcc: 70 91 35 05 lds r23, 0x0535 ; 0x800535 27bd0: 07 2e mov r0, r23 27bd2: 00 0c add r0, r0 27bd4: 88 0b sbc r24, r24 27bd6: 99 0b sbc r25, r25 27bd8: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 27bdc: 9b 01 movw r18, r22 27bde: ac 01 movw r20, r24 27be0: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 27be4: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 27be8: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 27bec: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 27bf0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 27bf4: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 27bf8: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 27bfc: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 27c00: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f lcd_encoder = 0; 27c04: 10 92 35 05 sts 0x0535, r1 ; 0x800535 27c08: 10 92 34 05 sts 0x0534, r1 ; 0x800534 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 27c0c: 65 e5 ldi r22, 0x55 ; 85 27c0e: 75 e5 ldi r23, 0x55 ; 85 27c10: 85 ed ldi r24, 0xD5 ; 213 27c12: 9f e3 ldi r25, 0x3F ; 63 27c14: 0f 94 11 ba call 0x37422 ; 0x37422 lcd_draw_update = 1; 27c18: 81 e0 ldi r24, 0x01 ; 1 27c1a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 27c1e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27c22: 88 23 and r24, r24 27c24: 11 f1 breq .+68 ; 0x27c6a { lcd_set_cursor(0, 1); 27c26: 61 e0 ldi r22, 0x01 ; 1 27c28: 80 e0 ldi r24, 0x00 ; 0 27c2a: 0e 94 26 70 call 0xe04c ; 0xe04c //! 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); 27c2e: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 27c32: 8f 93 push r24 27c34: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 27c38: 8f 93 push r24 27c3a: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 27c3e: 8f 93 push r24 27c40: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 27c44: 8f 93 push r24 27c46: 85 eb ldi r24, 0xB5 ; 181 27c48: 94 ea ldi r25, 0xA4 ; 164 27c4a: 9f 93 push r25 27c4c: 8f 93 push r24 27c4e: 86 ea ldi r24, 0xA6 ; 166 27c50: 94 ea ldi r25, 0xA4 ; 164 27c52: 9f 93 push r25 27c54: 8f 93 push r24 27c56: 0e 94 ff 6f call 0xdffe ; 0xdffe 27c5a: 8d b7 in r24, 0x3d ; 61 27c5c: 9e b7 in r25, 0x3e ; 62 27c5e: 08 96 adiw r24, 0x08 ; 8 27c60: 0f b6 in r0, 0x3f ; 63 27c62: f8 94 cli 27c64: 9e bf out 0x3e, r25 ; 62 27c66: 0f be out 0x3f, r0 ; 63 27c68: 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(); 27c6a: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 }; } void show_preheat_nozzle_warning() { lcd_clear(); 27c6e: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 27c72: 8c e7 ldi r24, 0x7C ; 124 27c74: 9d e4 ldi r25, 0x4D ; 77 27c76: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 27c7a: ac 01 movw r20, r24 27c7c: 60 e0 ldi r22, 0x00 ; 0 27c7e: 80 e0 ldi r24, 0x00 ; 0 27c80: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 27c84: 86 e6 ldi r24, 0x66 ; 102 27c86: 9d e4 ldi r25, 0x4D ; 77 27c88: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 27c8c: ac 01 movw r20, r24 27c8e: 62 e0 ldi r22, 0x02 ; 2 27c90: 80 e0 ldi r24, 0x00 ; 0 27c92: 0e 94 3a 70 call 0xe074 ; 0xe074 _delay(2000); 27c96: 60 ed ldi r22, 0xD0 ; 208 27c98: 77 e0 ldi r23, 0x07 ; 7 27c9a: 80 e0 ldi r24, 0x00 ; 0 27c9c: 90 e0 ldi r25, 0x00 ; 0 27c9e: 0f 94 5c 3c call 0x278b8 ; 0x278b8 lcd_clear(); 27ca2: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 27ca6: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00027caa : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 27caa: 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(); 27cac: f8 94 cli m = timer2_millis; 27cae: 60 91 35 06 lds r22, 0x0635 ; 0x800635 27cb2: 70 91 36 06 lds r23, 0x0636 ; 0x800636 27cb6: 80 91 37 06 lds r24, 0x0637 ; 0x800637 27cba: 90 91 38 06 lds r25, 0x0638 ; 0x800638 SREG = oldSREG; 27cbe: 2f bf out 0x3f, r18 ; 63 return m; } 27cc0: 08 95 ret 00027cc2 : } //! @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); 27cc2: 20 e0 ldi r18, 0x00 ; 0 27cc4: 30 e0 ldi r19, 0x00 ; 0 27cc6: 40 e8 ldi r20, 0x80 ; 128 27cc8: 5f eb ldi r21, 0xBF ; 191 27cca: 60 e0 ldi r22, 0x00 ; 0 27ccc: 70 e0 ldi r23, 0x00 ; 0 27cce: cb 01 movw r24, r22 27cd0: 0e 94 f3 8a call 0x115e6 ; 0x115e6 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 27cd4: 8d e0 ldi r24, 0x0D ; 13 27cd6: 90 e7 ldi r25, 0x70 ; 112 27cd8: 0e 94 97 7b call 0xf72e ; 0xf72e // Indicate that the printer is paused did_pause_print = true; 27cdc: 81 e0 ldi r24, 0x01 ; 1 27cde: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc } else return false; } bool Stopwatch::pause() { if (isRunning()) { 27ce2: 80 91 99 03 lds r24, 0x0399 ; 0x800399 27ce6: 81 30 cpi r24, 0x01 ; 1 27ce8: 69 f4 brne .+26 ; 0x27d04 state = PAUSED; 27cea: 82 e0 ldi r24, 0x02 ; 2 27cec: 80 93 99 03 sts 0x0399, r24 ; 0x800399 stopTimestamp = _millis(); 27cf0: 0f 94 55 3e call 0x27caa ; 0x27caa 27cf4: 60 93 4c 06 sts 0x064C, r22 ; 0x80064c 27cf8: 70 93 4d 06 sts 0x064D, r23 ; 0x80064d 27cfc: 80 93 4e 06 sts 0x064E, r24 ; 0x80064e 27d00: 90 93 4f 06 sts 0x064F, r25 ; 0x80064f print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 27d04: 82 e0 ldi r24, 0x02 ; 2 27d06: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 lcd_return_to_status(); 27d0a: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00027d0e ::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) 27d0e: ff 92 push r15 27d10: 0f 93 push r16 27d12: 1f 93 push r17 27d14: cf 93 push r28 27d16: df 93 push r29 { if (!m_isRunning) return false; 27d18: fc 01 movw r30, r24 27d1a: f0 80 ld r15, Z 27d1c: f1 10 cpse r15, r1 27d1e: 08 c0 rjmp .+16 ; 0x27d30 ::expired(unsigned short)+0x22> 27d20: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 27d22: 8f 2d mov r24, r15 27d24: df 91 pop r29 27d26: cf 91 pop r28 27d28: 1f 91 pop r17 27d2a: 0f 91 pop r16 27d2c: ff 90 pop r15 27d2e: 08 95 ret 27d30: 8b 01 movw r16, r22 27d32: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 27d34: 0f 94 55 3e call 0x27caa ; 0x27caa if (m_started <= m_started + msPeriod) 27d38: 89 81 ldd r24, Y+1 ; 0x01 27d3a: 9a 81 ldd r25, Y+2 ; 0x02 27d3c: 08 0f add r16, r24 27d3e: 19 1f adc r17, r25 27d40: 08 17 cp r16, r24 27d42: 19 07 cpc r17, r25 27d44: 40 f0 brcs .+16 ; 0x27d56 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 27d46: 60 17 cp r22, r16 27d48: 71 07 cpc r23, r17 27d4a: 18 f4 brcc .+6 ; 0x27d52 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27d4c: 68 17 cp r22, r24 27d4e: 79 07 cpc r23, r25 27d50: 38 f7 brcc .-50 ; 0x27d20 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 27d52: 18 82 st Y, r1 27d54: e6 cf rjmp .-52 ; 0x27d22 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27d56: 60 17 cp r22, r16 27d58: 71 07 cpc r23, r17 27d5a: c0 f7 brcc .-16 ; 0x27d4c ::expired(unsigned short)+0x3e> 27d5c: e1 cf rjmp .-62 ; 0x27d20 ::expired(unsigned short)+0x12> 00027d5e ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 27d5e: fc 01 movw r30, r24 27d60: 20 81 ld r18, Z 27d62: 21 11 cpse r18, r1 27d64: 0d 94 87 3e jmp 0x27d0e ; 0x27d0e ::expired(unsigned short)> } 27d68: 81 e0 ldi r24, 0x01 ; 1 27d6a: 08 95 ret 00027d6c ::start()>: /** * @brief Start timer */ template void Timer::start() 27d6c: cf 93 push r28 27d6e: df 93 push r29 27d70: ec 01 movw r28, r24 { m_started = _millis(); 27d72: 0f 94 55 3e call 0x27caa ; 0x27caa 27d76: 7a 83 std Y+2, r23 ; 0x02 27d78: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 27d7a: 81 e0 ldi r24, 0x01 ; 1 27d7c: 88 83 st Y, r24 } 27d7e: df 91 pop r29 27d80: cf 91 pop r28 27d82: 08 95 ret 00027d84 : } static uint8_t twi_wait(uint8_t status) { 27d84: 1f 93 push r17 27d86: cf 93 push r28 27d88: df 93 push r29 27d8a: 00 d0 rcall .+0 ; 0x27d8c 27d8c: cd b7 in r28, 0x3d ; 61 27d8e: de b7 in r29, 0x3e ; 62 27d90: 18 2f mov r17, r24 ShortTimer timmy; 27d92: 19 82 std Y+1, r1 ; 0x01 27d94: 1b 82 std Y+3, r1 ; 0x03 27d96: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 27d98: ce 01 movw r24, r28 27d9a: 01 96 adiw r24, 0x01 ; 1 27d9c: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> while(!(TWCR & _BV(TWINT))) { 27da0: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 27da4: 87 fd sbrc r24, 7 27da6: 0a c0 rjmp .+20 ; 0x27dbc if (timmy.expired(TWI_TIMEOUT_MS)) { 27da8: 6a e0 ldi r22, 0x0A ; 10 27daa: 70 e0 ldi r23, 0x00 ; 0 27dac: ce 01 movw r24, r28 27dae: 01 96 adiw r24, 0x01 ; 1 27db0: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 27db4: 88 23 and r24, r24 27db6: a1 f3 breq .-24 ; 0x27da0 return 2; 27db8: 82 e0 ldi r24, 0x02 ; 2 27dba: 09 c0 rjmp .+18 ; 0x27dce } } if(TW_STATUS != status) 27dbc: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 27dc0: 88 7f andi r24, 0xF8 ; 248 27dc2: 18 17 cp r17, r24 27dc4: 59 f0 breq .+22 ; 0x27ddc } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 27dc6: 84 e9 ldi r24, 0x94 ; 148 27dc8: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 27dcc: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 27dce: 0f 90 pop r0 27dd0: 0f 90 pop r0 27dd2: 0f 90 pop r0 27dd4: df 91 pop r29 27dd6: cf 91 pop r28 27dd8: 1f 91 pop r17 27dda: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 27ddc: 80 e0 ldi r24, 0x00 ; 0 27dde: f7 cf rjmp .-18 ; 0x27dce 00027de0 : } return standstill; } void tmc2130_check_overtemp() { 27de0: 1f 93 push r17 27de2: cf 93 push r28 27de4: df 93 push r29 27de6: 00 d0 rcall .+0 ; 0x27de8 27de8: 1f 92 push r1 27dea: cd b7 in r28, 0x3d ; 61 27dec: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 27dee: 68 ee ldi r22, 0xE8 ; 232 27df0: 73 e0 ldi r23, 0x03 ; 3 27df2: 8e e3 ldi r24, 0x3E ; 62 27df4: 96 e0 ldi r25, 0x06 ; 6 27df6: 0f 94 af 3e call 0x27d5e ; 0x27d5e ::expired_cont(unsigned short)> 27dfa: 88 23 and r24, r24 27dfc: 91 f1 breq .+100 ; 0x27e62 { for (uint_least8_t i = 0; i < 4; i++) 27dfe: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 27e00: 19 82 std Y+1, r1 ; 0x01 27e02: 1a 82 std Y+2, r1 ; 0x02 27e04: 1b 82 std Y+3, r1 ; 0x03 27e06: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 27e08: ae 01 movw r20, r28 27e0a: 4f 5f subi r20, 0xFF ; 255 27e0c: 5f 4f sbci r21, 0xFF ; 255 27e0e: 6f e6 ldi r22, 0x6F ; 111 27e10: 81 2f mov r24, r17 27e12: 0f 94 76 38 call 0x270ec ; 0x270ec if (drv_status & ((uint32_t)1 << 26)) 27e16: 89 81 ldd r24, Y+1 ; 0x01 27e18: 9a 81 ldd r25, Y+2 ; 0x02 27e1a: ab 81 ldd r26, Y+3 ; 0x03 27e1c: bc 81 ldd r27, Y+4 ; 0x04 27e1e: b2 ff sbrs r27, 2 27e20: 19 c0 rjmp .+50 ; 0x27e54 { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 27e22: 85 e7 ldi r24, 0x75 ; 117 27e24: 9f e6 ldi r25, 0x6F ; 111 27e26: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 27e2a: 81 2f mov r24, r17 27e2c: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 27e30: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 27e34: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 27e36: 20 e0 ldi r18, 0x00 ; 0 27e38: 30 e0 ldi r19, 0x00 ; 0 27e3a: 41 e0 ldi r20, 0x01 ; 1 27e3c: 50 e0 ldi r21, 0x00 ; 0 27e3e: 6c ee ldi r22, 0xEC ; 236 27e40: 81 2f mov r24, r17 27e42: 0f 94 d0 38 call 0x271a0 ; 0x271a0 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++) 27e46: 1f 5f subi r17, 0xFF ; 255 27e48: 14 30 cpi r17, 0x04 ; 4 27e4a: a9 f7 brne .-22 ; 0x27e36 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 27e4c: 85 e7 ldi r24, 0x75 ; 117 27e4e: 9f e6 ldi r25, 0x6F ; 111 27e50: 0e 94 26 7c call 0xf84c ; 0xf84c void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 27e54: 1f 5f subi r17, 0xFF ; 255 27e56: 14 30 cpi r17, 0x04 ; 4 27e58: 99 f6 brne .-90 ; 0x27e00 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 27e5a: 8e e3 ldi r24, 0x3E ; 62 27e5c: 96 e0 ldi r25, 0x06 ; 6 27e5e: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> } } 27e62: 0f 90 pop r0 27e64: 0f 90 pop r0 27e66: 0f 90 pop r0 27e68: 0f 90 pop r0 27e6a: df 91 pop r29 27e6c: cf 91 pop r28 27e6e: 1f 91 pop r17 27e70: 08 95 ret 00027e72 ::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) 27e72: 8f 92 push r8 27e74: 9f 92 push r9 27e76: af 92 push r10 27e78: bf 92 push r11 27e7a: cf 92 push r12 27e7c: df 92 push r13 27e7e: ef 92 push r14 27e80: ff 92 push r15 27e82: 1f 93 push r17 27e84: cf 93 push r28 27e86: df 93 push r29 { if (!m_isRunning) return false; 27e88: fc 01 movw r30, r24 27e8a: 10 81 ld r17, Z 27e8c: 11 11 cpse r17, r1 27e8e: 0e c0 rjmp .+28 ; 0x27eac ::expired(unsigned long)+0x3a> 27e90: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 27e92: 81 2f mov r24, r17 27e94: df 91 pop r29 27e96: cf 91 pop r28 27e98: 1f 91 pop r17 27e9a: ff 90 pop r15 27e9c: ef 90 pop r14 27e9e: df 90 pop r13 27ea0: cf 90 pop r12 27ea2: bf 90 pop r11 27ea4: af 90 pop r10 27ea6: 9f 90 pop r9 27ea8: 8f 90 pop r8 27eaa: 08 95 ret 27eac: 6a 01 movw r12, r20 27eae: 7b 01 movw r14, r22 27eb0: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 27eb2: 0f 94 55 3e call 0x27caa ; 0x27caa 27eb6: 4b 01 movw r8, r22 27eb8: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 27eba: 89 81 ldd r24, Y+1 ; 0x01 27ebc: 9a 81 ldd r25, Y+2 ; 0x02 27ebe: ab 81 ldd r26, Y+3 ; 0x03 27ec0: bc 81 ldd r27, Y+4 ; 0x04 27ec2: c8 0e add r12, r24 27ec4: d9 1e adc r13, r25 27ec6: ea 1e adc r14, r26 27ec8: fb 1e adc r15, r27 27eca: c8 16 cp r12, r24 27ecc: d9 06 cpc r13, r25 27ece: ea 06 cpc r14, r26 27ed0: fb 06 cpc r15, r27 27ed2: 60 f0 brcs .+24 ; 0x27eec ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 27ed4: 8c 14 cp r8, r12 27ed6: 9d 04 cpc r9, r13 27ed8: ae 04 cpc r10, r14 27eda: bf 04 cpc r11, r15 27edc: 28 f4 brcc .+10 ; 0x27ee8 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27ede: 88 16 cp r8, r24 27ee0: 99 06 cpc r9, r25 27ee2: aa 06 cpc r10, r26 27ee4: bb 06 cpc r11, r27 27ee6: a0 f6 brcc .-88 ; 0x27e90 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 27ee8: 18 82 st Y, r1 27eea: d3 cf rjmp .-90 ; 0x27e92 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27eec: 8c 14 cp r8, r12 27eee: 9d 04 cpc r9, r13 27ef0: ae 04 cpc r10, r14 27ef2: bf 04 cpc r11, r15 27ef4: a0 f7 brcc .-24 ; 0x27ede ::expired(unsigned long)+0x6c> 27ef6: cc cf rjmp .-104 ; 0x27e90 ::expired(unsigned long)+0x1e> 00027ef8 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 27ef8: 0f 93 push r16 27efa: 1f 93 push r17 27efc: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 27efe: 80 91 db 03 lds r24, 0x03DB ; 0x8003db 27f02: 88 23 and r24, r24 27f04: 09 f4 brne .+2 ; 0x27f08 27f06: 4d c0 rjmp .+154 ; 0x27fa2 heating_status_counter++; 27f08: 80 91 45 06 lds r24, 0x0645 ; 0x800645 27f0c: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 27f0e: 8e 30 cpi r24, 0x0E ; 14 27f10: b0 f4 brcc .+44 ; 0x27f3e //! @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++; 27f12: 80 93 45 06 sts 0x0645, r24 ; 0x800645 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 27f16: 63 e0 ldi r22, 0x03 ; 3 27f18: 87 e0 ldi r24, 0x07 ; 7 27f1a: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_space(13); 27f1e: 8d e0 ldi r24, 0x0D ; 13 27f20: 0e 94 1c 70 call 0xe038 ; 0xe038 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 27f24: c0 e0 ldi r28, 0x00 ; 0 27f26: 80 91 45 06 lds r24, 0x0645 ; 0x800645 27f2a: c8 17 cp r28, r24 27f2c: 58 f4 brcc .+22 ; 0x27f44 lcd_putc_at(7 + dots, 3, '.'); 27f2e: 4e e2 ldi r20, 0x2E ; 46 27f30: 63 e0 ldi r22, 0x03 ; 3 27f32: 87 e0 ldi r24, 0x07 ; 7 27f34: 8c 0f add r24, r28 27f36: 0e 94 46 70 call 0xe08c ; 0xe08c heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 27f3a: cf 5f subi r28, 0xFF ; 255 27f3c: f4 cf rjmp .-24 ; 0x27f26 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; 27f3e: 10 92 45 06 sts 0x0645, r1 ; 0x800645 27f42: e9 cf rjmp .-46 ; 0x27f16 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 27f44: 80 91 db 03 lds r24, 0x03DB ; 0x8003db 27f48: 82 30 cpi r24, 0x02 ; 2 27f4a: d1 f0 breq .+52 ; 0x27f80 27f4c: 30 f4 brcc .+12 ; 0x27f5a 27f4e: 81 30 cpi r24, 0x01 ; 1 27f50: 59 f0 breq .+22 ; 0x27f68 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 27f52: cf 91 pop r28 27f54: 1f 91 pop r17 27f56: 0f 91 pop r16 27f58: 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) { 27f5a: 83 30 cpi r24, 0x03 ; 3 27f5c: f9 f0 breq .+62 ; 0x27f9c 27f5e: 84 30 cpi r24, 0x04 ; 4 27f60: c1 f7 brne .-16 ; 0x27f52 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)); 27f62: 8a e9 ldi r24, 0x9A ; 154 27f64: 9a e4 ldi r25, 0x4A ; 74 27f66: 0e c0 rjmp .+28 ; 0x27f84 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)); 27f68: 83 ec ldi r24, 0xC3 ; 195 27f6a: 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)); 27f6c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 27f70: ac 01 movw r20, r24 27f72: 63 e0 ldi r22, 0x03 ; 3 27f74: 80 e0 ldi r24, 0x00 ; 0 break; } } } 27f76: cf 91 pop r28 27f78: 1f 91 pop r17 27f7a: 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)); 27f7c: 0c 94 3a 70 jmp 0xe074 ; 0xe074 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)); 27f80: 83 eb ldi r24, 0xB3 ; 179 27f82: 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)); 27f84: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 27f88: ac 01 movw r20, r24 27f8a: 63 e0 ldi r22, 0x03 ; 3 27f8c: 80 e0 ldi r24, 0x00 ; 0 27f8e: 0e 94 3a 70 call 0xe074 ; 0xe074 heating_status = HeatingStatus::NO_HEATING; 27f92: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db heating_status_counter = 0; 27f96: 10 92 45 06 sts 0x0645, r1 ; 0x800645 27f9a: db cf rjmp .-74 ; 0x27f52 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)); 27f9c: 85 ea ldi r24, 0xA5 ; 165 27f9e: 9a e4 ldi r25, 0x4A ; 74 27fa0: e5 cf rjmp .-54 ; 0x27f6c break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 27fa2: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 27fa6: 88 23 and r24, r24 27fa8: 61 f1 breq .+88 ; 0x28002 break; default: break; } } else if ((IS_SD_PRINTING) && 27faa: 80 91 72 07 lds r24, 0x0772 ; 0x800772 27fae: 81 11 cpse r24, r1 27fb0: 28 c0 rjmp .+80 ; 0x28002 (custom_message_type == CustomMsg::Status) && 27fb2: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> 27fb6: 82 30 cpi r24, 0x02 ; 2 27fb8: 20 f5 brcc .+72 ; 0x28002 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 27fba: 80 91 4c 05 lds r24, 0x054C ; 0x80054c <_ZL26lcd_status_message_timeout.lto_priv.464> 27fbe: 81 11 cpse r24, r1 27fc0: 16 c0 rjmp .+44 ; 0x27fee (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); 27fc2: 80 91 82 14 lds r24, 0x1482 ; 0x801482 27fc6: 88 23 and r24, r24 27fc8: 09 f4 brne .+2 ; 0x27fcc 27fca: 35 c0 rjmp .+106 ; 0x28036 27fcc: 82 e8 ldi r24, 0x82 ; 130 27fce: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 27fd0: 20 91 65 0e lds r18, 0x0E65 ; 0x800e65 27fd4: 64 e1 ldi r22, 0x14 ; 20 27fd6: 82 0f add r24, r18 27fd8: 91 1d adc r25, r1 27fda: 0e 94 15 72 call 0xe42a ; 0xe42a 27fde: 81 11 cpse r24, r1 27fe0: 2d c0 rjmp .+90 ; 0x2803c { scrollstuff++; 27fe2: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 27fe6: 8f 5f subi r24, 0xFF ; 255 27fe8: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 27fec: b2 cf rjmp .-156 ; 0x27f52 27fee: 40 e2 ldi r20, 0x20 ; 32 27ff0: 5e e4 ldi r21, 0x4E ; 78 27ff2: 60 e0 ldi r22, 0x00 ; 0 27ff4: 70 e0 ldi r23, 0x00 ; 0 27ff6: 8c e4 ldi r24, 0x4C ; 76 27ff8: 95 e0 ldi r25, 0x05 ; 5 27ffa: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 27ffe: 81 11 cpse r24, r1 28000: e0 cf rjmp .-64 ; 0x27fc2 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) 28002: 80 91 72 07 lds r24, 0x0772 ; 0x800772 28006: 81 11 cpse r24, r1 28008: 1c c0 rjmp .+56 ; 0x28042 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 2800a: e0 91 72 07 lds r30, 0x0772 ; 0x800772 2800e: ea 30 cpi r30, 0x0A ; 10 28010: 08 f0 brcs .+2 ; 0x28014 28012: 9f cf rjmp .-194 ; 0x27f52 28014: f0 e0 ldi r31, 0x00 ; 0 28016: 88 27 eor r24, r24 28018: ef 5e subi r30, 0xEF ; 239 2801a: ff 4b sbci r31, 0xBF ; 191 2801c: 8e 4f sbci r24, 0xFE ; 254 2801e: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 28022: 0e 3a cpi r16, 0xAE ; 174 28024: 3e 3b cpi r19, 0xBE ; 190 28026: 0e 3a cpi r16, 0xAE ; 174 28028: cc 39 cpi r28, 0x9C ; 156 2802a: d8 3a cpi r29, 0xA8 ; 168 2802c: 96 3b cpi r25, 0xB6 ; 182 2802e: 0e 3a cpi r16, 0xAE ; 174 28030: 0e 3a cpi r16, 0xAE ; 174 28032: cc 3b cpi r28, 0xBC ; 188 28034: 0e 3a cpi r16, 0xAE ; 174 (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT)) { // If printing from SD, show what we are printing const char* longFilenameOLD = (card.longFilename[0] ? card.longFilename : card.filename); 28036: 8d e6 ldi r24, 0x6D ; 109 28038: 94 e1 ldi r25, 0x14 ; 20 2803a: ca cf rjmp .-108 ; 0x27fd0 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 2803c: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 28040: 88 cf rjmp .-240 ; 0x27f52 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 28042: 80 91 4c 05 lds r24, 0x054C ; 0x80054c <_ZL26lcd_status_message_timeout.lto_priv.464> 28046: 88 23 and r24, r24 28048: 01 f3 breq .-64 ; 0x2800a * 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; 2804a: 0f 94 55 3e call 0x27caa ; 0x27caa 2804e: 00 91 4d 05 lds r16, 0x054D ; 0x80054d <_ZL26lcd_status_message_timeout.lto_priv.464+0x1> 28052: 10 91 4e 05 lds r17, 0x054E ; 0x80054e <_ZL26lcd_status_message_timeout.lto_priv.464+0x2> 28056: 20 91 4f 05 lds r18, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.464+0x3> 2805a: 30 91 50 05 lds r19, 0x0550 ; 0x800550 <_ZL26lcd_status_message_timeout.lto_priv.464+0x4> 2805e: 60 1b sub r22, r16 28060: 71 0b sbc r23, r17 28062: 82 0b sbc r24, r18 28064: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 28066: 60 3a cpi r22, 0xA0 ; 160 28068: 7f 40 sbci r23, 0x0F ; 15 2806a: 81 05 cpc r24, r1 2806c: 91 05 cpc r25, r1 2806e: 68 f6 brcc .-102 ; 0x2800a 28070: 70 cf rjmp .-288 ; 0x27f52 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); 28072: 63 e0 ldi r22, 0x03 ; 3 28074: 80 91 36 05 lds r24, 0x0536 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.461> 28078: 0e 94 26 70 call 0xe04c ; 0xe04c const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 2807c: 80 91 36 05 lds r24, 0x0536 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.461> 28080: c4 e1 ldi r28, 0x14 ; 20 28082: 6c 2f mov r22, r28 28084: 68 1b sub r22, r24 28086: 90 e0 ldi r25, 0x00 ; 0 28088: 89 5c subi r24, 0xC9 ; 201 2808a: 9a 4f sbci r25, 0xFA ; 250 2808c: 0e 94 15 72 call 0xe42a ; 0xe42a lcd_status_message_idx = LCD_WIDTH - padding; 28090: c8 1b sub r28, r24 28092: c0 93 36 05 sts 0x0536, r28 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.461> 28096: 5d cf rjmp .-326 ; 0x27f52 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 28098: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 2809c: 8b 30 cpi r24, 0x0B ; 11 2809e: 08 f1 brcs .+66 ; 0x280e2 lcd_set_cursor(0, 3); 280a0: 63 e0 ldi r22, 0x03 ; 3 280a2: 80 e0 ldi r24, 0x00 ; 0 280a4: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_space(LCD_WIDTH); 280a8: 84 e1 ldi r24, 0x14 ; 20 280aa: 0e 94 1c 70 call 0xe038 ; 0xe038 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 280ae: 8a e8 ldi r24, 0x8A ; 138 280b0: 9a e4 ldi r25, 0x4A ; 74 280b2: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 280b6: ac 01 movw r20, r24 280b8: 63 e0 ldi r22, 0x03 ; 3 280ba: 80 e0 ldi r24, 0x00 ; 0 280bc: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_puts_P(PSTR(" : ")); 280c0: 8a ee ldi r24, 0xEA ; 234 280c2: 91 ea ldi r25, 0xA1 ; 161 280c4: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_print(custom_message_state - 10); 280c8: 60 91 f0 03 lds r22, 0x03F0 ; 0x8003f0 280cc: 6a 50 subi r22, 0x0A ; 10 280ce: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 280d0: 07 2e mov r0, r23 280d2: 00 0c add r0, r0 280d4: 88 0b sbc r24, r24 280d6: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 280d8: cf 91 pop r28 280da: 1f 91 pop r17 280dc: 0f 91 pop r16 280de: 0c 94 df 71 jmp 0xe3be ; 0xe3be 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) { 280e2: 83 30 cpi r24, 0x03 ; 3 280e4: 31 f4 brne .+12 ; 0x280f2 lcd_setstatuspgm(MSG_WELCOME); 280e6: 81 e5 ldi r24, 0x51 ; 81 280e8: 91 e7 ldi r25, 0x71 ; 113 280ea: 0f 94 e0 0a call 0x215c0 ; 0x215c0 custom_message_type = CustomMsg::Status; 280ee: 10 92 72 07 sts 0x0772, r1 ; 0x800772 } if (custom_message_state > 3 && custom_message_state <= 10) { 280f2: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 280f6: 84 50 subi r24, 0x04 ; 4 280f8: 87 30 cpi r24, 0x07 ; 7 280fa: 08 f0 brcs .+2 ; 0x280fe 280fc: 2a cf rjmp .-428 ; 0x27f52 lcd_set_cursor(0, 3); 280fe: 63 e0 ldi r22, 0x03 ; 3 28100: 80 e0 ldi r24, 0x00 ; 0 28102: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_space(19); 28106: 83 e1 ldi r24, 0x13 ; 19 28108: 0e 94 1c 70 call 0xe038 ; 0xe038 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 2810c: 87 e7 ldi r24, 0x77 ; 119 2810e: 9a e4 ldi r25, 0x4A ; 74 28110: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 28114: ac 01 movw r20, r24 28116: 63 e0 ldi r22, 0x03 ; 3 28118: 80 e0 ldi r24, 0x00 ; 0 2811a: 0e 94 3a 70 call 0xe074 ; 0xe074 custom_message_state--; 2811e: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 28122: 81 50 subi r24, 0x01 ; 1 28124: 80 93 f0 03 sts 0x03F0, r24 ; 0x8003f0 28128: 14 cf rjmp .-472 ; 0x27f52 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 2812a: 64 e1 ldi r22, 0x14 ; 20 2812c: 87 e3 ldi r24, 0x37 ; 55 2812e: 95 e0 ldi r25, 0x05 ; 5 28130: 0e 94 15 72 call 0xe42a ; 0xe42a if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 28134: 20 91 43 06 lds r18, 0x0643 ; 0x800643 28138: 30 91 44 06 lds r19, 0x0644 ; 0x800644 2813c: 80 91 41 06 lds r24, 0x0641 ; 0x800641 28140: 90 91 42 06 lds r25, 0x0642 ; 0x800642 28144: 82 17 cp r24, r18 28146: 93 07 cpc r25, r19 28148: 0c f4 brge .+2 ; 0x2814c 2814a: 03 cf rjmp .-506 ; 0x27f52 2814c: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 28150: 88 23 and r24, r24 28152: 09 f4 brne .+2 ; 0x28156 28154: fe ce rjmp .-516 ; 0x27f52 lcd_set_cursor(10, 3); 28156: 63 e0 ldi r22, 0x03 ; 3 28158: 8a e0 ldi r24, 0x0A ; 10 2815a: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 2815e: 80 91 42 06 lds r24, 0x0642 ; 0x800642 28162: 8f 93 push r24 28164: 80 91 41 06 lds r24, 0x0641 ; 0x800641 28168: 8f 93 push r24 2816a: 80 91 44 06 lds r24, 0x0644 ; 0x800644 2816e: 8f 93 push r24 28170: 80 91 43 06 lds r24, 0x0643 ; 0x800643 28174: 8f 93 push r24 28176: 81 ee ldi r24, 0xE1 ; 225 28178: 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); 2817a: 9f 93 push r25 2817c: 8f 93 push r24 2817e: 0e 94 ff 6f call 0xdffe ; 0xdffe 28182: 0f 90 pop r0 28184: 0f 90 pop r0 28186: 0f 90 pop r0 28188: 0f 90 pop r0 2818a: 0f 90 pop r0 2818c: 0f 90 pop r0 2818e: e1 ce rjmp .-574 ; 0x27f52 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); 28190: 63 e0 ldi r22, 0x03 ; 3 28192: 80 e0 ldi r24, 0x00 ; 0 28194: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 28198: c0 91 f0 03 lds r28, 0x03F0 ; 0x8003f0 2819c: 83 e8 ldi r24, 0x83 ; 131 2819e: 9a e3 ldi r25, 0x3A ; 58 281a0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 281a4: 1f 92 push r1 281a6: cf 93 push r28 281a8: 9f 93 push r25 281aa: 8f 93 push r24 281ac: 83 ed ldi r24, 0xD3 ; 211 281ae: 91 ea ldi r25, 0xA1 ; 161 281b0: e4 cf rjmp .-56 ; 0x2817a break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 281b2: 87 e6 ldi r24, 0x67 ; 103 281b4: 9a e4 ldi r25, 0x4A ; 74 281b6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 281ba: ac 01 movw r20, r24 281bc: 63 e0 ldi r22, 0x03 ; 3 281be: 80 e0 ldi r24, 0x00 ; 0 281c0: 0e 94 3a 70 call 0xe074 ; 0xe074 if (custom_message_state <= PINDA_HEAT_T) { 281c4: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 281c8: 89 37 cpi r24, 0x79 ; 121 281ca: 08 f0 brcs .+2 ; 0x281ce 281cc: c2 ce rjmp .-636 ; 0x27f52 lcd_puts_P(PSTR(": ")); 281ce: 80 ed ldi r24, 0xD0 ; 208 281d0: 91 ea ldi r25, 0xA1 ; 161 281d2: 0e 94 11 70 call 0xe022 ; 0xe022 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 281d6: 80 91 f0 03 lds r24, 0x03F0 ; 0x8003f0 281da: 0e 94 d5 70 call 0xe1aa ; 0xe1aa } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 281de: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 281e0: cf 91 pop r28 281e2: 1f 91 pop r17 281e4: 0f 91 pop r16 281e6: 0c 94 d5 70 jmp 0xe1aa ; 0xe1aa lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 281ea: 86 e5 ldi r24, 0x56 ; 86 281ec: 9a e4 ldi r25, 0x4A ; 74 281ee: be ce rjmp .-644 ; 0x27f6c 000281f0 ::start()>: /** * @brief Start timer */ template void Timer::start() 281f0: cf 93 push r28 281f2: df 93 push r29 281f4: ec 01 movw r28, r24 { m_started = _millis(); 281f6: 0f 94 55 3e call 0x27caa ; 0x27caa 281fa: 69 83 std Y+1, r22 ; 0x01 281fc: 7a 83 std Y+2, r23 ; 0x02 281fe: 8b 83 std Y+3, r24 ; 0x03 28200: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 28202: 81 e0 ldi r24, 0x01 ; 1 28204: 88 83 st Y, r24 } 28206: df 91 pop r29 28208: cf 91 pop r28 2820a: 08 95 ret 0002820c : //! 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) { 2820c: cf 92 push r12 2820e: df 92 push r13 28210: ff 92 push r15 28212: 0f 93 push r16 28214: 1f 93 push r17 28216: cf 93 push r28 28218: df 93 push r29 2821a: cd b7 in r28, 0x3d ; 61 2821c: de b7 in r29, 0x3e ; 62 2821e: 64 97 sbiw r28, 0x14 ; 20 28220: 0f b6 in r0, 0x3f ; 63 28222: f8 94 cli 28224: de bf out 0x3e, r29 ; 62 28226: 0f be out 0x3f, r0 ; 63 28228: cd bf out 0x3d, r28 ; 61 2822a: 8c 01 movw r16, r24 2822c: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 2822e: 64 ee ldi r22, 0xE4 ; 228 28230: 7f e9 ldi r23, 0x9F ; 159 28232: ce 01 movw r24, r28 28234: 01 96 adiw r24, 0x01 ; 1 28236: 0f 94 c6 da call 0x3b58c ; 0x3b58c strcat_P(msg, type); 2823a: b8 01 movw r22, r16 2823c: ce 01 movw r24, r28 2823e: 01 96 adiw r24, 0x01 ; 1 28240: 0f 94 b2 da call 0x3b564 ; 0x3b564 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 28244: 83 e0 ldi r24, 0x03 ; 3 28246: 0f 94 a7 05 call 0x20b4e ; 0x20b4e 2824a: 88 23 and r24, r24 2824c: e1 f0 breq .+56 ; 0x28286 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 2824e: be 01 movw r22, r28 28250: 6f 5f subi r22, 0xFF ; 255 28252: 7f 4f sbci r23, 0xFF ; 255 28254: 87 e3 ldi r24, 0x37 ; 55 28256: 95 e0 ldi r25, 0x05 ; 5 28258: 0f 94 71 e3 call 0x3c6e2 ; 0x3c6e2 2825c: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 2825e: 8c e4 ldi r24, 0x4C ; 76 28260: 95 e0 ldi r25, 0x05 ; 5 28262: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> lcd_status_message_level = severity; 28266: 83 e0 ldi r24, 0x03 ; 3 28268: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> custom_message_type = CustomMsg::Status; 2826c: 10 92 72 07 sts 0x0772, r1 ; 0x800772 custom_message_state = 0; 28270: 10 92 f0 03 sts 0x03F0, r1 ; 0x8003f0 if (!same) { 28274: cd 28 or r12, r13 28276: 39 f0 breq .+14 ; 0x28286 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 28278: 60 e0 ldi r22, 0x00 ; 0 2827a: ce 01 movw r24, r28 2827c: 01 96 adiw r24, 0x01 ; 1 2827e: 0f 94 8c 05 call 0x20b18 ; 0x20b18 lcd_return_to_status(); 28282: 0f 94 1d 26 call 0x24c3a ; 0x24c3a lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 28286: 8c ee ldi r24, 0xEC ; 236 28288: 9a ea ldi r25, 0xAA ; 170 2828a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if(e != EXTRUDERS) { 2828e: 81 e0 ldi r24, 0x01 ; 1 28290: f8 16 cp r15, r24 28292: 49 f0 breq .+18 ; 0x282a6 28294: 60 e0 ldi r22, 0x00 ; 0 28296: 70 e0 ldi r23, 0x00 ; 0 28298: cb 01 movw r24, r22 2829a: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 2829e: 81 ee ldi r24, 0xE1 ; 225 282a0: 9f e9 ldi r25, 0x9F ; 159 282a2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 } SERIAL_ERRORPGM("Heaters switched off. "); 282a6: 8a ec ldi r24, 0xCA ; 202 282a8: 9f e9 ldi r25, 0x9F ; 159 282aa: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORRPGM(type); 282ae: c8 01 movw r24, r16 282b0: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORLNPGM(" triggered!"); 282b4: 8e eb ldi r24, 0xBE ; 190 282b6: 9f e9 ldi r25, 0x9F ; 159 282b8: 0e 94 97 7b call 0xf72e ; 0xf72e } 282bc: 64 96 adiw r28, 0x14 ; 20 282be: 0f b6 in r0, 0x3f ; 63 282c0: f8 94 cli 282c2: de bf out 0x3e, r29 ; 62 282c4: 0f be out 0x3f, r0 ; 63 282c6: cd bf out 0x3d, r28 ; 61 282c8: df 91 pop r29 282ca: cf 91 pop r28 282cc: 1f 91 pop r17 282ce: 0f 91 pop r16 282d0: ff 90 pop r15 282d2: df 90 pop r13 282d4: cf 90 pop r12 282d6: 08 95 ret 000282d8 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 282d8: 1f 92 push r1 282da: 0f 92 push r0 282dc: 0f b6 in r0, 0x3f ; 63 282de: 0f 92 push r0 282e0: 11 24 eor r1, r1 282e2: 2f 93 push r18 282e4: 3f 93 push r19 282e6: 8f 93 push r24 282e8: 9f 93 push r25 282ea: af 93 push r26 282ec: 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; 282ee: 80 91 35 06 lds r24, 0x0635 ; 0x800635 282f2: 90 91 36 06 lds r25, 0x0636 ; 0x800636 282f6: a0 91 37 06 lds r26, 0x0637 ; 0x800637 282fa: b0 91 38 06 lds r27, 0x0638 ; 0x800638 unsigned char f = timer2_fract; 282fe: 30 91 34 06 lds r19, 0x0634 ; 0x800634 m += MILLIS_INC; f += FRACT_INC; 28302: 23 e0 ldi r18, 0x03 ; 3 28304: 23 0f add r18, r19 if (f >= FRACT_MAX) 28306: 2d 37 cpi r18, 0x7D ; 125 28308: 58 f5 brcc .+86 ; 0x28360 <__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; 2830a: 01 96 adiw r24, 0x01 ; 1 2830c: a1 1d adc r26, r1 2830e: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 28310: 20 93 34 06 sts 0x0634, r18 ; 0x800634 timer2_millis = m; 28314: 80 93 35 06 sts 0x0635, r24 ; 0x800635 28318: 90 93 36 06 sts 0x0636, r25 ; 0x800636 2831c: a0 93 37 06 sts 0x0637, r26 ; 0x800637 28320: b0 93 38 06 sts 0x0638, r27 ; 0x800638 timer2_overflow_count++; 28324: 80 91 39 06 lds r24, 0x0639 ; 0x800639 28328: 90 91 3a 06 lds r25, 0x063A ; 0x80063a 2832c: a0 91 3b 06 lds r26, 0x063B ; 0x80063b 28330: b0 91 3c 06 lds r27, 0x063C ; 0x80063c 28334: 01 96 adiw r24, 0x01 ; 1 28336: a1 1d adc r26, r1 28338: b1 1d adc r27, r1 2833a: 80 93 39 06 sts 0x0639, r24 ; 0x800639 2833e: 90 93 3a 06 sts 0x063A, r25 ; 0x80063a 28342: a0 93 3b 06 sts 0x063B, r26 ; 0x80063b 28346: b0 93 3c 06 sts 0x063C, r27 ; 0x80063c } 2834a: bf 91 pop r27 2834c: af 91 pop r26 2834e: 9f 91 pop r25 28350: 8f 91 pop r24 28352: 3f 91 pop r19 28354: 2f 91 pop r18 28356: 0f 90 pop r0 28358: 0f be out 0x3f, r0 ; 63 2835a: 0f 90 pop r0 2835c: 1f 90 pop r1 2835e: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 28360: 26 e8 ldi r18, 0x86 ; 134 28362: 23 0f add r18, r19 m += 1; 28364: 02 96 adiw r24, 0x02 ; 2 28366: a1 1d adc r26, r1 28368: b1 1d adc r27, r1 2836a: d2 cf rjmp .-92 ; 0x28310 <__vector_15+0x38> 0002836c : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 2836c: 2f 92 push r2 2836e: 3f 92 push r3 28370: 4f 92 push r4 28372: 5f 92 push r5 28374: 6f 92 push r6 28376: 7f 92 push r7 28378: 8f 92 push r8 2837a: 9f 92 push r9 2837c: af 92 push r10 2837e: bf 92 push r11 28380: cf 92 push r12 28382: df 92 push r13 28384: ef 92 push r14 28386: ff 92 push r15 28388: 0f 93 push r16 2838a: 1f 93 push r17 2838c: cf 93 push r28 2838e: df 93 push r29 28390: 00 d0 rcall .+0 ; 0x28392 28392: 00 d0 rcall .+0 ; 0x28394 28394: 1f 92 push r1 28396: cd b7 in r28, 0x3d ; 61 28398: de b7 in r29, 0x3e ; 62 2839a: 9c 83 std Y+4, r25 ; 0x04 2839c: 8b 83 std Y+3, r24 ; 0x03 2839e: 0d 83 std Y+5, r16 ; 0x05 283a0: 26 01 movw r4, r12 283a2: 37 01 movw r6, r14 *var = v; 283a4: fb 01 movw r30, r22 283a6: 20 83 st Z, r18 283a8: 31 83 std Z+1, r19 ; 0x01 283aa: 42 83 std Z+2, r20 ; 0x02 283ac: 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); 283ae: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 283b2: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 283b6: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 283ba: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 283be: 61 e7 ldi r22, 0x71 ; 113 283c0: 7d e3 ldi r23, 0x3D ; 61 283c2: 8a e8 ldi r24, 0x8A ; 138 283c4: 9e e3 ldi r25, 0x3E ; 62 283c6: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 283ca: 60 93 18 13 sts 0x1318, r22 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8d> 283ce: 70 93 19 13 sts 0x1319, r23 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8e> 283d2: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8f> 283d6: 90 93 1b 13 sts 0x131B, r25 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.394+0x90> warn_s = warn * TEMP_MGR_INTV; 283da: 21 e7 ldi r18, 0x71 ; 113 283dc: 3d e3 ldi r19, 0x3D ; 61 283de: 4a e8 ldi r20, 0x8A ; 138 283e0: 5e e3 ldi r21, 0x3E ; 62 283e2: 60 91 0f 13 lds r22, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 283e6: 70 91 10 13 lds r23, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 283ea: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 283ee: 90 91 12 13 lds r25, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 283f2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 283f6: 60 93 1c 13 sts 0x131C, r22 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.394+0x91> 283fa: 70 93 1d 13 sts 0x131D, r23 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.394+0x92> 283fe: 80 93 1e 13 sts 0x131E, r24 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.394+0x93> 28402: 90 93 1f 13 sts 0x131F, r25 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.394+0x94> err_s = err * TEMP_MGR_INTV; 28406: 21 e7 ldi r18, 0x71 ; 113 28408: 3d e3 ldi r19, 0x3D ; 61 2840a: 4a e8 ldi r20, 0x8A ; 138 2840c: 5e e3 ldi r21, 0x3E ; 62 2840e: 60 91 13 13 lds r22, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 28412: 70 91 14 13 lds r23, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 28416: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 2841a: 90 91 16 13 lds r25, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 2841e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 28422: 60 93 20 13 sts 0x1320, r22 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.394+0x95> 28426: 70 93 21 13 sts 0x1321, r23 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.394+0x96> 2842a: 80 93 22 13 sts 0x1322, r24 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.394+0x97> 2842e: 90 93 23 13 sts 0x1323, r25 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.394+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 28432: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 28436: 90 91 ca 12 lds r25, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 2843a: 6e e0 ldi r22, 0x0E ; 14 2843c: 71 e0 ldi r23, 0x01 ; 1 2843e: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 28442: 60 93 ab 12 sts 0x12AB, r22 ; 0x8012ab <_ZN13thermal_modelL4dataE.lto_priv.394+0x20> 28446: eb e8 ldi r30, 0x8B ; 139 28448: 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; 2844a: 80 e0 ldi r24, 0x00 ; 0 2844c: 90 e0 ldi r25, 0x00 ; 0 2844e: a0 ec ldi r26, 0xC0 ; 192 28450: bf e7 ldi r27, 0x7F ; 127 28452: 81 93 st Z+, r24 28454: 91 93 st Z+, r25 28456: a1 93 st Z+, r26 28458: 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) 2845a: 22 e1 ldi r18, 0x12 ; 18 2845c: eb 3a cpi r30, 0xAB ; 171 2845e: f2 07 cpc r31, r18 28460: c1 f7 brne .-16 ; 0x28452 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 28462: 10 92 ac 12 sts 0x12AC, r1 ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.394+0x21> dT_err_prev = 0; 28466: 10 92 ad 12 sts 0x12AD, r1 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 2846a: 10 92 ae 12 sts 0x12AE, r1 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 2846e: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 28472: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> T_prev = NAN; 28476: 80 93 b1 12 sts 0x12B1, r24 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x26> 2847a: 90 93 b2 12 sts 0x12B2, r25 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x27> 2847e: a0 93 b3 12 sts 0x12B3, r26 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x28> 28482: b0 93 b4 12 sts 0x12B4, r27 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x29> // clear the initialization flag flag_bits.uninitialized = false; 28486: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 2848a: 8e 7f andi r24, 0xFE ; 254 2848c: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 28490: 83 e7 ldi r24, 0x73 ; 115 28492: 97 e0 ldi r25, 0x07 ; 7 28494: 9f 83 std Y+7, r25 ; 0x07 28496: 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) { 28498: e1 e0 ldi r30, 0x01 ; 1 2849a: f0 e0 ldi r31, 0x00 ; 0 2849c: fa 83 std Y+2, r31 ; 0x02 2849e: 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; 284a0: 31 2c mov r3, r1 284a2: 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; 284a4: 81 2c mov r8, r1 284a6: 91 2c mov r9, r1 284a8: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 284aa: 29 81 ldd r18, Y+1 ; 0x01 284ac: 3a 81 ldd r19, Y+2 ; 0x02 284ae: 8b 81 ldd r24, Y+3 ; 0x03 284b0: 9c 81 ldd r25, Y+4 ; 0x04 284b2: 28 17 cp r18, r24 284b4: 39 07 cpc r19, r25 284b6: c8 f5 brcc .+114 ; 0x2852a thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 284b8: ee 81 ldd r30, Y+6 ; 0x06 284ba: ff 81 ldd r31, Y+7 ; 0x07 284bc: 25 81 ldd r18, Z+5 ; 0x05 284be: 36 81 ldd r19, Z+6 ; 0x06 284c0: 47 81 ldd r20, Z+7 ; 0x07 284c2: 50 85 ldd r21, Z+8 ; 0x08 284c4: 83 01 movw r16, r6 284c6: 72 01 movw r14, r4 284c8: 6d 81 ldd r22, Y+5 ; 0x05 284ca: 81 85 ldd r24, Z+9 ; 0x09 284cc: 0e 94 e5 da call 0x1b5ca ; 0x1b5ca float err_v = thermal_model::data.dT_err_prev; 284d0: c0 90 ad 12 lds r12, 0x12AD ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 284d4: d0 90 ae 12 lds r13, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 284d8: e0 90 af 12 lds r14, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 284dc: f0 90 b0 12 lds r15, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> if(!isnan(err_v)) { 284e0: a7 01 movw r20, r14 284e2: 96 01 movw r18, r12 284e4: c7 01 movw r24, r14 284e6: b6 01 movw r22, r12 284e8: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 284ec: 81 11 cpse r24, r1 284ee: 11 c0 rjmp .+34 ; 0x28512 err += err_v * err_v; 284f0: a7 01 movw r20, r14 284f2: 96 01 movw r18, r12 284f4: c7 01 movw r24, r14 284f6: b6 01 movw r22, r12 284f8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 284fc: 9b 01 movw r18, r22 284fe: ac 01 movw r20, r24 28500: c5 01 movw r24, r10 28502: b4 01 movw r22, r8 28504: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 28508: 4b 01 movw r8, r22 2850a: 5c 01 movw r10, r24 ++cnt; 2850c: ff ef ldi r31, 0xFF ; 255 2850e: 2f 1a sub r2, r31 28510: 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) { 28512: 29 81 ldd r18, Y+1 ; 0x01 28514: 3a 81 ldd r19, Y+2 ; 0x02 28516: 2f 5f subi r18, 0xFF ; 255 28518: 3f 4f sbci r19, 0xFF ; 255 2851a: 3a 83 std Y+2, r19 ; 0x02 2851c: 29 83 std Y+1, r18 ; 0x01 2851e: 8e 81 ldd r24, Y+6 ; 0x06 28520: 9f 81 ldd r25, Y+7 ; 0x07 28522: 05 96 adiw r24, 0x05 ; 5 28524: 9f 83 std Y+7, r25 ; 0x07 28526: 8e 83 std Y+6, r24 ; 0x06 28528: c0 cf rjmp .-128 ; 0x284aa if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 2852a: 60 e0 ldi r22, 0x00 ; 0 2852c: 70 e0 ldi r23, 0x00 ; 0 2852e: 80 ec ldi r24, 0xC0 ; 192 28530: 9f e7 ldi r25, 0x7F ; 127 28532: 21 14 cp r2, r1 28534: 31 04 cpc r3, r1 28536: 59 f0 breq .+22 ; 0x2854e 28538: b1 01 movw r22, r2 2853a: 90 e0 ldi r25, 0x00 ; 0 2853c: 80 e0 ldi r24, 0x00 ; 0 2853e: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 28542: 9b 01 movw r18, r22 28544: ac 01 movw r20, r24 28546: c5 01 movw r24, r10 28548: b4 01 movw r22, r8 2854a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> } 2854e: 27 96 adiw r28, 0x07 ; 7 28550: 0f b6 in r0, 0x3f ; 63 28552: f8 94 cli 28554: de bf out 0x3e, r29 ; 62 28556: 0f be out 0x3f, r0 ; 63 28558: cd bf out 0x3d, r28 ; 61 2855a: df 91 pop r29 2855c: cf 91 pop r28 2855e: 1f 91 pop r17 28560: 0f 91 pop r16 28562: ff 90 pop r15 28564: ef 90 pop r14 28566: df 90 pop r13 28568: cf 90 pop r12 2856a: bf 90 pop r11 2856c: af 90 pop r10 2856e: 9f 90 pop r9 28570: 8f 90 pop r8 28572: 7f 90 pop r7 28574: 6f 90 pop r6 28576: 5f 90 pop r5 28578: 4f 90 pop r4 2857a: 3f 90 pop r3 2857c: 2f 90 pop r2 2857e: 08 95 ret 00028580 : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 28580: cf 93 push r28 28582: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 28584: 0e 94 54 76 call 0xeca8 ; 0xeca8 fanSpeed = fan_speed; 28588: c0 93 df 03 sts 0x03DF, r28 ; 0x8003df #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 2858c: c0 93 9d 04 sts 0x049D, r28 ; 0x80049d #endif } 28590: cf 91 pop r28 28592: 08 95 ret 00028594 : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 28594: cf 92 push r12 28596: df 92 push r13 28598: ef 92 push r14 2859a: ff 92 push r15 2859c: 0f 93 push r16 2859e: 1f 93 push r17 285a0: cf 93 push r28 285a2: df 93 push r29 SERIAL_ECHO_START; 285a4: 84 e1 ldi r24, 0x14 ; 20 285a6: 9b ea ldi r25, 0xAB ; 171 285a8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNPGM("Thermal Model settings:"); 285ac: 89 e8 ldi r24, 0x89 ; 137 285ae: 90 ea ldi r25, 0xA0 ; 160 285b0: 0e 94 97 7b call 0xf72e ; 0xf72e 285b4: cb ec ldi r28, 0xCB ; 203 285b6: d2 e1 ldi r29, 0x12 ; 18 285b8: 10 e0 ldi r17, 0x00 ; 0 285ba: 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]); 285bc: 84 e1 ldi r24, 0x14 ; 20 285be: e8 2e mov r14, r24 285c0: 8b ea ldi r24, 0xAB ; 171 285c2: f8 2e mov r15, r24 285c4: 95 e7 ldi r25, 0x75 ; 117 285c6: c9 2e mov r12, r25 285c8: 90 ea ldi r25, 0xA0 ; 160 285ca: d9 2e mov r13, r25 285cc: 88 81 ld r24, Y 285ce: 99 81 ldd r25, Y+1 ; 0x01 285d0: 2a 81 ldd r18, Y+2 ; 0x02 285d2: 3b 81 ldd r19, Y+3 ; 0x03 285d4: 24 96 adiw r28, 0x04 ; 4 285d6: 3f 93 push r19 285d8: 2f 93 push r18 285da: 9f 93 push r25 285dc: 8f 93 push r24 285de: 1f 93 push r17 285e0: 0f 93 push r16 285e2: ff 92 push r15 285e4: ef 92 push r14 285e6: df 92 push r13 285e8: cf 92 push r12 285ea: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 285ee: 0f 5f subi r16, 0xFF ; 255 285f0: 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) 285f2: 8d b7 in r24, 0x3d ; 61 285f4: 9e b7 in r25, 0x3e ; 62 285f6: 0a 96 adiw r24, 0x0a ; 10 285f8: 0f b6 in r0, 0x3f ; 63 285fa: f8 94 cli 285fc: 9e bf out 0x3e, r25 ; 62 285fe: 0f be out 0x3f, r0 ; 63 28600: 8d bf out 0x3d, r24 ; 61 28602: 00 31 cpi r16, 0x10 ; 16 28604: 11 05 cpc r17, r1 28606: 11 f7 brne .-60 ; 0x285cc 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"), 28608: 80 91 0e 13 lds r24, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> 2860c: 8f 93 push r24 2860e: 80 91 0d 13 lds r24, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 28612: 8f 93 push r24 28614: 80 91 0c 13 lds r24, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 28618: 8f 93 push r24 2861a: 80 91 0b 13 lds r24, 0x130B ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 2861e: 8f 93 push r24 28620: 80 91 12 13 lds r24, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 28624: 8f 93 push r24 28626: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 2862a: 8f 93 push r24 2862c: 80 91 10 13 lds r24, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 28630: 8f 93 push r24 28632: 80 91 0f 13 lds r24, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 28636: 8f 93 push r24 28638: 80 91 16 13 lds r24, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 2863c: 8f 93 push r24 2863e: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 28642: 8f 93 push r24 28644: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 28648: 8f 93 push r24 2864a: 80 91 13 13 lds r24, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 2864e: 8f 93 push r24 28650: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.467> 28654: 1f 92 push r1 28656: 8f 93 push r24 28658: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> 2865c: 1f 92 push r1 2865e: 8f 93 push r24 28660: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 28664: 8f 93 push r24 28666: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 2866a: 8f 93 push r24 2866c: 80 91 c8 12 lds r24, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> 28670: 8f 93 push r24 28672: 80 91 c7 12 lds r24, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 28676: 8f 93 push r24 28678: 80 91 c6 12 lds r24, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 2867c: 8f 93 push r24 2867e: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 28682: 8f 93 push r24 28684: 80 91 c4 12 lds r24, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 28688: 8f 93 push r24 2868a: 80 91 c3 12 lds r24, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 2868e: 8f 93 push r24 28690: 80 91 c2 12 lds r24, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 28694: 8f 93 push r24 28696: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 2869a: 8f 93 push r24 2869c: 80 91 c0 12 lds r24, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> 286a0: 8f 93 push r24 286a2: 80 91 bf 12 lds r24, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 286a6: 8f 93 push r24 286a8: 80 91 be 12 lds r24, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 286ac: 8f 93 push r24 286ae: 80 91 bd 12 lds r24, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 286b2: 8f 93 push r24 286b4: 80 91 bc 12 lds r24, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> 286b8: 8f 93 push r24 286ba: 80 91 bb 12 lds r24, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 286be: 8f 93 push r24 286c0: 80 91 ba 12 lds r24, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 286c4: 8f 93 push r24 286c6: 80 91 b9 12 lds r24, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 286ca: 8f 93 push r24 286cc: 80 91 b8 12 lds r24, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> 286d0: 8f 93 push r24 286d2: 80 91 b7 12 lds r24, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 286d6: 8f 93 push r24 286d8: 80 91 b6 12 lds r24, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 286dc: 8f 93 push r24 286de: 80 91 b5 12 lds r24, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 286e2: 8f 93 push r24 286e4: ff 92 push r15 286e6: ef 92 push r14 286e8: 8f e2 ldi r24, 0x2F ; 47 286ea: 90 ea ldi r25, 0xA0 ; 160 286ec: 9f 93 push r25 286ee: 8f 93 push r24 286f0: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 286f4: 8d b7 in r24, 0x3d ; 61 286f6: 9e b7 in r25, 0x3e ; 62 286f8: 8a 96 adiw r24, 0x2a ; 42 286fa: 0f b6 in r0, 0x3f ; 63 286fc: f8 94 cli 286fe: 9e bf out 0x3e, r25 ; 62 28700: 0f be out 0x3f, r0 ; 63 28702: 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); } 28704: df 91 pop r29 28706: cf 91 pop r28 28708: 1f 91 pop r17 2870a: 0f 91 pop r16 2870c: ff 90 pop r15 2870e: ef 90 pop r14 28710: df 90 pop r13 28712: cf 90 pop r12 28714: 08 95 ret 00028716 : // 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); 28716: 89 57 subi r24, 0x79 ; 121 28718: 9f 4f sbci r25, 0xFF ; 255 2871a: 6e e0 ldi r22, 0x0E ; 14 2871c: 71 e0 ldi r23, 0x01 ; 1 2871e: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 28722: 61 15 cp r22, r1 28724: 71 05 cpc r23, r1 28726: 99 f0 breq .+38 ; 0x2874e 28728: 69 30 cpi r22, 0x09 ; 9 2872a: 71 05 cpc r23, r1 2872c: 10 f0 brcs .+4 ; 0x28732 2872e: 68 e0 ldi r22, 0x08 ; 8 28730: 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; 28732: 2e e0 ldi r18, 0x0E ; 14 28734: 31 e0 ldi r19, 0x01 ; 1 28736: 62 9f mul r22, r18 28738: c0 01 movw r24, r0 2873a: 63 9f mul r22, r19 2873c: 90 0d add r25, r0 2873e: 72 9f mul r23, r18 28740: 90 0d add r25, r0 28742: 11 24 eor r1, r1 28744: 90 93 ca 12 sts 0x12CA, r25 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 28748: 80 93 c9 12 sts 0x12C9, r24 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> } 2874c: 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; 2874e: 61 e0 ldi r22, 0x01 ; 1 28750: 70 e0 ldi r23, 0x00 ; 0 28752: ef cf rjmp .-34 ; 0x28732 00028754 : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 28754: cf 93 push r28 28756: df 93 push r29 if(!(data.P > 0)) return false; 28758: 20 e0 ldi r18, 0x00 ; 0 2875a: 30 e0 ldi r19, 0x00 ; 0 2875c: a9 01 movw r20, r18 2875e: 60 91 b5 12 lds r22, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 28762: 70 91 b6 12 lds r23, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 28766: 80 91 b7 12 lds r24, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 2876a: 90 91 b8 12 lds r25, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> 2876e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 28772: 18 16 cp r1, r24 28774: 0c f0 brlt .+2 ; 0x28778 28776: 54 c0 rjmp .+168 ; 0x28820 if(isnan(data.U)) return false; 28778: 60 91 b9 12 lds r22, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 2877c: 70 91 ba 12 lds r23, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 28780: 80 91 bb 12 lds r24, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 28784: 90 91 bc 12 lds r25, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> 28788: 9b 01 movw r18, r22 2878a: ac 01 movw r20, r24 2878c: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 28790: 81 11 cpse r24, r1 28792: 46 c0 rjmp .+140 ; 0x28820 if(isnan(data.V)) return false; 28794: 60 91 bd 12 lds r22, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 28798: 70 91 be 12 lds r23, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 2879c: 80 91 bf 12 lds r24, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 287a0: 90 91 c0 12 lds r25, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> 287a4: 9b 01 movw r18, r22 287a6: ac 01 movw r20, r24 287a8: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 287ac: 81 11 cpse r24, r1 287ae: 38 c0 rjmp .+112 ; 0x28820 if(!(data.C > 0)) return false; 287b0: 20 e0 ldi r18, 0x00 ; 0 287b2: 30 e0 ldi r19, 0x00 ; 0 287b4: a9 01 movw r20, r18 287b6: 60 91 c1 12 lds r22, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 287ba: 70 91 c2 12 lds r23, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 287be: 80 91 c3 12 lds r24, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 287c2: 90 91 c4 12 lds r25, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 287c6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 287ca: 18 16 cp r1, r24 287cc: 4c f5 brge .+82 ; 0x28820 if(isnan(data.fS)) return false; 287ce: 60 91 c5 12 lds r22, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 287d2: 70 91 c6 12 lds r23, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 287d6: 80 91 c7 12 lds r24, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 287da: 90 91 c8 12 lds r25, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3d> 287de: 9b 01 movw r18, r22 287e0: ac 01 movw r20, r24 287e2: 0f 94 45 e2 call 0x3c48a ; 0x3c48a <__unordsf2> 287e6: 81 11 cpse r24, r1 287e8: 1b c0 rjmp .+54 ; 0x28820 if(!(data.L > 0)) return false; 287ea: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 287ee: 90 91 ca 12 lds r25, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 287f2: 89 2b or r24, r25 287f4: a9 f0 breq .+42 ; 0x28820 287f6: cb ec ldi r28, 0xCB ; 203 287f8: 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)) 287fa: 69 91 ld r22, Y+ 287fc: 79 91 ld r23, Y+ 287fe: 89 91 ld r24, Y+ 28800: 99 91 ld r25, Y+ 28802: 20 e0 ldi r18, 0x00 ; 0 28804: 30 e0 ldi r19, 0x00 ; 0 28806: a9 01 movw r20, r18 28808: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2880c: 87 fd sbrc r24, 7 2880e: 08 c0 rjmp .+16 ; 0x28820 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) { 28810: 83 e1 ldi r24, 0x13 ; 19 28812: cb 30 cpi r28, 0x0B ; 11 28814: d8 07 cpc r29, r24 28816: 89 f7 brne .-30 ; 0x287fa if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 28818: 81 e0 ldi r24, 0x01 ; 1 } 2881a: df 91 pop r29 2881c: cf 91 pop r28 2881e: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 28820: 80 e0 ldi r24, 0x00 ; 0 28822: fb cf rjmp .-10 ; 0x2881a 00028824 : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 28824: 0f 94 aa 43 call 0x28754 ; 0x28754 28828: 81 11 cpse r24, r1 2882a: 02 c0 rjmp .+4 ; 0x28830 2882c: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28830: 81 e0 ldi r24, 0x01 ; 1 28832: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> warning_state.assert = false; // explicitly clear assertions 28836: 80 91 33 06 lds r24, 0x0633 ; 0x800633 2883a: 8d 7f andi r24, 0xFD ; 253 2883c: 80 93 33 06 sts 0x0633, r24 ; 0x800633 // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; reinitialize(); } 28840: 08 95 ret 00028842 : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 28842: 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; 28844: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 28848: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2884c: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 28850: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28854: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28856: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 28858: 0f 94 a7 20 call 0x2414e ; 0x2414e temp_mgr_pid(); 2885c: 0f 94 e4 1d call 0x23bc8 ; 0x23bc8 // 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); 28860: 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; 28862: 10 92 6a 06 sts 0x066A, r1 ; 0x80066a (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28866: cf bf out 0x3f, r28 ; 63 #endif } } 28868: cf 91 pop r28 2886a: 08 95 ret 0002886c : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 2886c: 0f 94 21 44 call 0x28842 ; 0x28842 fanSpeed = 0; 28870: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df lcd_return_to_status(); 28874: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 00028878 : // 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) { 28878: 1f 93 push r17 2887a: cf 93 push r28 2887c: df 93 push r29 2887e: c8 2f mov r28, r24 28880: 16 2f mov r17, r22 28882: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 28884: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 28888: 80 fd sbrc r24, 0 2888a: 18 c0 rjmp .+48 ; 0x288bc 2888c: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 28890: 81 11 cpse r24, r1 28892: 14 c0 rjmp .+40 ; 0x288bc saved_bed_temperature = target_temperature_bed; 28894: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 28898: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_temperature = target_temperature[index]; 2889c: e6 2f mov r30, r22 2889e: f0 e0 ldi r31, 0x00 ; 0 288a0: ee 0f add r30, r30 288a2: ff 1f adc r31, r31 288a4: e6 59 subi r30, 0x96 ; 150 288a6: f1 4f sbci r31, 0xF1 ; 241 288a8: 80 81 ld r24, Z 288aa: 91 81 ldd r25, Z+1 ; 0x01 288ac: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab 288b0: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa saved_fan_speed = fanSpeed; 288b4: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 288b8: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 288bc: 0f 94 21 44 call 0x28842 ; 0x28842 void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed 288c0: 80 91 b6 04 lds r24, 0x04B6 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> 288c4: 82 60 ori r24, 0x02 ; 2 288c6: 80 93 b6 04 sts 0x04B6, r24 ; 0x8004b6 <_ZL12altfanStatus.lto_priv.485> #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 288ca: 0e 94 54 76 call 0xeca8 ; 0xeca8 setExtruderAutoFanState(3); 288ce: 83 e0 ldi r24, 0x03 ; 3 288d0: 0e 94 62 77 call 0xeec4 ; 0xeec4 SET_OUTPUT(FAN_PIN); 288d4: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 288d8: 88 60 ori r24, 0x08 ; 8 288da: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 288de: 8f ef ldi r24, 0xFF ; 255 288e0: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 288e4: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 288e8: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 288ec: 80 ff sbrs r24, 0 288ee: 07 c0 rjmp .+14 ; 0x288fe 288f0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 288f4: 82 95 swap r24 288f6: 86 95 lsr r24 288f8: 87 70 andi r24, 0x07 ; 7 288fa: d8 17 cp r29, r24 288fc: c0 f4 brcc .+48 ; 0x2892e temp_error_state.source = (uint8_t)source; 288fe: c3 70 andi r28, 0x03 ; 3 28900: cc 0f add r28, r28 28902: cc 0f add r28, r28 28904: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 28908: 83 7f andi r24, 0xF3 ; 243 2890a: 8c 2b or r24, r28 2890c: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.466> temp_error_state.index = index; 28910: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 28914: 10 fb bst r17, 0 28916: 84 f9 bld r24, 4 28918: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.466> temp_error_state.type = (uint8_t)type; 2891c: d2 95 swap r29 2891e: dd 0f add r29, r29 28920: d0 7e andi r29, 0xE0 ; 224 28922: 40 91 1b 05 lds r20, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 28926: 4f 71 andi r20, 0x1F ; 31 28928: 4d 2b or r20, r29 2892a: 40 93 1b 05 sts 0x051B, r20 ; 0x80051b <_ZL16temp_error_state.lto_priv.466> } // always set the error state temp_error_state.error = true; 2892e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 28932: 81 60 ori r24, 0x01 ; 1 28934: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.466> temp_error_state.assert = true; 28938: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 2893c: 82 60 ori r24, 0x02 ; 2 2893e: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.466> } 28942: df 91 pop r29 28944: cf 91 pop r28 28946: 1f 91 pop r17 28948: 08 95 ret 0002894a : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 2894a: 20 91 03 06 lds r18, 0x0603 ; 0x800603 2894e: 30 91 04 06 lds r19, 0x0604 ; 0x800604 28952: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.483> 28956: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.483+0x1> 2895a: 28 17 cp r18, r24 2895c: 39 07 cpc r19, r25 2895e: 2c f0 brlt .+10 ; 0x2896a #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 28960: 41 e0 ldi r20, 0x01 ; 1 28962: 60 e0 ldi r22, 0x00 ; 0 28964: 81 e0 ldi r24, 0x01 ; 1 28966: 0d 94 3c 44 jmp 0x28878 ; 0x28878 } } 2896a: 08 95 ret 0002896c : 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]) { 2896c: 20 91 05 06 lds r18, 0x0605 ; 0x800605 28970: 30 91 06 06 lds r19, 0x0606 ; 0x800606 28974: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.484> 28978: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.484+0x1> 2897c: 28 17 cp r18, r24 2897e: 39 07 cpc r19, r25 28980: 2c f0 brlt .+10 ; 0x2898c #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 28982: 41 e0 ldi r20, 0x01 ; 1 28984: 60 e0 ldi r22, 0x00 ; 0 28986: 80 e0 ldi r24, 0x00 ; 0 28988: 0d 94 3c 44 jmp 0x28878 ; 0x28878 } } 2898c: 08 95 ret 0002898e : 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) { 2898e: 2f 92 push r2 28990: 3f 92 push r3 28992: 4f 92 push r4 28994: 5f 92 push r5 28996: 6f 92 push r6 28998: 7f 92 push r7 2899a: 8f 92 push r8 2899c: 9f 92 push r9 2899e: af 92 push r10 289a0: bf 92 push r11 289a2: cf 92 push r12 289a4: df 92 push r13 289a6: ef 92 push r14 289a8: ff 92 push r15 289aa: 0f 93 push r16 289ac: 1f 93 push r17 289ae: cf 93 push r28 289b0: df 93 push r29 289b2: cd b7 in r28, 0x3d ; 61 289b4: de b7 in r29, 0x3e ; 62 289b6: 2c 97 sbiw r28, 0x0c ; 12 289b8: 0f b6 in r0, 0x3f ; 63 289ba: f8 94 cli 289bc: de bf out 0x3e, r29 ; 62 289be: 0f be out 0x3f, r0 ; 63 289c0: cd bf out 0x3d, r28 ; 61 289c2: 28 2e mov r2, r24 289c4: 49 83 std Y+1, r20 ; 0x01 289c6: 5a 83 std Y+2, r21 ; 0x02 289c8: 6b 83 std Y+3, r22 ; 0x03 289ca: 7c 83 std Y+4, r23 ; 0x04 289cc: 28 01 movw r4, r16 289ce: 39 01 movw r6, r18 289d0: 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) 289d2: 0f 94 55 3e call 0x27caa ; 0x27caa 289d6: 02 2d mov r16, r2 289d8: 10 e0 ldi r17, 0x00 ; 0 289da: 98 01 movw r18, r16 289dc: 22 0f add r18, r18 289de: 33 1f adc r19, r19 289e0: 22 0f add r18, r18 289e2: 33 1f adc r19, r19 289e4: 3c 87 std Y+12, r19 ; 0x0c 289e6: 2b 87 std Y+11, r18 ; 0x0b 289e8: f9 01 movw r30, r18 289ea: e9 53 subi r30, 0x39 ; 57 289ec: fa 4f sbci r31, 0xFA ; 250 289ee: 80 80 ld r8, Z 289f0: 91 80 ldd r9, Z+1 ; 0x01 289f2: a2 80 ldd r10, Z+2 ; 0x02 289f4: b3 80 ldd r11, Z+3 ; 0x03 289f6: 68 19 sub r22, r8 289f8: 79 09 sbc r23, r9 289fa: 8a 09 sbc r24, r10 289fc: 9b 09 sbc r25, r11 289fe: 61 3d cpi r22, 0xD1 ; 209 28a00: 77 40 sbci r23, 0x07 ; 7 28a02: 81 05 cpc r24, r1 28a04: 91 05 cpc r25, r1 28a06: 08 f4 brcc .+2 ; 0x28a0a 28a08: ea c0 rjmp .+468 ; 0x28bde { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 28a0a: 33 20 and r3, r3 28a0c: 09 f4 brne .+2 ; 0x28a10 28a0e: 75 c0 rjmp .+234 ; 0x28afa { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 28a10: 88 e6 ldi r24, 0x68 ; 104 28a12: 91 e0 ldi r25, 0x01 ; 1 28a14: 9a 87 std Y+10, r25 ; 0x0a 28a16: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 28a18: 80 e0 ldi r24, 0x00 ; 0 28a1a: 90 e0 ldi r25, 0x00 ; 0 28a1c: a0 ea ldi r26, 0xA0 ; 160 28a1e: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28a20: 8d 83 std Y+5, r24 ; 0x05 28a22: 9e 83 std Y+6, r25 ; 0x06 28a24: af 83 std Y+7, r26 ; 0x07 28a26: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 28a28: 0f 94 55 3e call 0x27caa ; 0x27caa 28a2c: eb 85 ldd r30, Y+11 ; 0x0b 28a2e: fc 85 ldd r31, Y+12 ; 0x0c 28a30: e9 53 subi r30, 0x39 ; 57 28a32: fa 4f sbci r31, 0xFA ; 250 28a34: 60 83 st Z, r22 28a36: 71 83 std Z+1, r23 ; 0x01 28a38: 82 83 std Z+2, r24 ; 0x02 28a3a: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 28a3c: 20 e0 ldi r18, 0x00 ; 0 28a3e: 30 e0 ldi r19, 0x00 ; 0 28a40: a9 01 movw r20, r18 28a42: c7 01 movw r24, r14 28a44: b6 01 movw r22, r12 28a46: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 28a4a: 81 11 cpse r24, r1 28a4c: 07 c0 rjmp .+14 ; 0x28a5c { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28a4e: f8 01 movw r30, r16 28a50: ee 0f add r30, r30 28a52: ff 1f adc r31, r31 28a54: ed 53 subi r30, 0x3D ; 61 28a56: fa 4f sbci r31, 0xFA ; 250 28a58: 11 82 std Z+1, r1 ; 0x01 28a5a: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 28a5c: ab 85 ldd r26, Y+11 ; 0x0b 28a5e: bc 85 ldd r27, Y+12 ; 0x0c 28a60: a5 54 subi r26, 0x45 ; 69 28a62: ba 4f sbci r27, 0xFA ; 250 28a64: 5d 01 movw r10, r26 28a66: 29 81 ldd r18, Y+1 ; 0x01 28a68: 3a 81 ldd r19, Y+2 ; 0x02 28a6a: 4b 81 ldd r20, Y+3 ; 0x03 28a6c: 5c 81 ldd r21, Y+4 ; 0x04 28a6e: 6d 91 ld r22, X+ 28a70: 7d 91 ld r23, X+ 28a72: 8d 91 ld r24, X+ 28a74: 9c 91 ld r25, X 28a76: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 28a7a: 88 23 and r24, r24 28a7c: 09 f4 brne .+2 ; 0x28a80 28a7e: 91 c0 rjmp .+290 ; 0x28ba2 { if (_target_temperature > 0) 28a80: 20 e0 ldi r18, 0x00 ; 0 28a82: 30 e0 ldi r19, 0x00 ; 0 28a84: a9 01 movw r20, r18 28a86: 69 81 ldd r22, Y+1 ; 0x01 28a88: 7a 81 ldd r23, Y+2 ; 0x02 28a8a: 8b 81 ldd r24, Y+3 ; 0x03 28a8c: 9c 81 ldd r25, Y+4 ; 0x04 28a8e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 28a92: f8 01 movw r30, r16 28a94: e7 54 subi r30, 0x47 ; 71 28a96: fa 4f sbci r31, 0xFA ; 250 28a98: 18 16 cp r1, r24 28a9a: c4 f5 brge .+112 ; 0x28b0c { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 28a9c: 81 e0 ldi r24, 0x01 ; 1 28a9e: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 28aa0: 89 81 ldd r24, Y+1 ; 0x01 28aa2: 9a 81 ldd r25, Y+2 ; 0x02 28aa4: ab 81 ldd r26, Y+3 ; 0x03 28aa6: bc 81 ldd r27, Y+4 ; 0x04 28aa8: f5 01 movw r30, r10 28aaa: 80 83 st Z, r24 28aac: 91 83 std Z+1, r25 ; 0x01 28aae: a2 83 std Z+2, r26 ; 0x02 28ab0: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 28ab2: eb 85 ldd r30, Y+11 ; 0x0b 28ab4: fc 85 ldd r31, Y+12 ; 0x0c 28ab6: ef 54 subi r30, 0x4F ; 79 28ab8: fa 4f sbci r31, 0xFA ; 250 28aba: 40 82 st Z, r4 28abc: 51 82 std Z+1, r5 ; 0x01 28abe: 62 82 std Z+2, r6 ; 0x02 28ac0: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 28ac2: f8 01 movw r30, r16 28ac4: e1 55 subi r30, 0x51 ; 81 28ac6: fa 4f sbci r31, 0xFA ; 250 28ac8: 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)) 28aca: a3 01 movw r20, r6 28acc: 92 01 movw r18, r4 28ace: bc 01 movw r22, r24 28ad0: cd 01 movw r24, r26 28ad2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 28ad6: 18 16 cp r1, r24 28ad8: 1c f5 brge .+70 ; 0x28b20 { __preheat_counter[_heater_id]++; 28ada: f8 01 movw r30, r16 28adc: e1 55 subi r30, 0x51 ; 81 28ade: fa 4f sbci r31, 0xFA ; 250 28ae0: 80 81 ld r24, Z 28ae2: 8f 5f subi r24, 0xFF ; 255 28ae4: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 28ae6: 31 10 cpse r3, r1 28ae8: c7 c0 rjmp .+398 ; 0x28c78 28aea: 89 30 cpi r24, 0x09 ; 9 28aec: c8 f0 brcs .+50 ; 0x28b20 { __delta=2.0; 28aee: 81 2c mov r8, r1 28af0: 91 2c mov r9, r1 28af2: a1 2c mov r10, r1 28af4: 50 e4 ldi r21, 0x40 ; 64 28af6: b5 2e mov r11, r21 28af8: e8 c0 rjmp .+464 ; 0x28cca #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 28afa: ad e2 ldi r26, 0x2D ; 45 28afc: b0 e0 ldi r27, 0x00 ; 0 28afe: ba 87 std Y+10, r27 ; 0x0a 28b00: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28b02: 80 e0 ldi r24, 0x00 ; 0 28b04: 90 e0 ldi r25, 0x00 ; 0 28b06: a0 e7 ldi r26, 0x70 ; 112 28b08: b1 e4 ldi r27, 0x41 ; 65 28b0a: 8a cf rjmp .-236 ; 0x28a20 __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 28b0c: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 28b0e: 89 81 ldd r24, Y+1 ; 0x01 28b10: 9a 81 ldd r25, Y+2 ; 0x02 28b12: ab 81 ldd r26, Y+3 ; 0x03 28b14: bc 81 ldd r27, Y+4 ; 0x04 28b16: f5 01 movw r30, r10 28b18: 80 83 st Z, r24 28b1a: 91 83 std Z+1, r25 ; 0x01 28b1c: a2 83 std Z+2, r26 ; 0x02 28b1e: 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) 28b20: 2d 81 ldd r18, Y+5 ; 0x05 28b22: 3e 81 ldd r19, Y+6 ; 0x06 28b24: 4f 81 ldd r20, Y+7 ; 0x07 28b26: 58 85 ldd r21, Y+8 ; 0x08 28b28: 69 81 ldd r22, Y+1 ; 0x01 28b2a: 7a 81 ldd r23, Y+2 ; 0x02 28b2c: 8b 81 ldd r24, Y+3 ; 0x03 28b2e: 9c 81 ldd r25, Y+4 ; 0x04 28b30: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 28b34: a3 01 movw r20, r6 28b36: 92 01 movw r18, r4 28b38: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 28b3c: 87 ff sbrs r24, 7 28b3e: 46 c0 rjmp .+140 ; 0x28bcc 28b40: f8 01 movw r30, r16 28b42: e7 54 subi r30, 0x47 ; 71 28b44: fa 4f sbci r31, 0xFA ; 250 28b46: 80 81 ld r24, Z 28b48: 81 30 cpi r24, 0x01 ; 1 28b4a: 49 f4 brne .+18 ; 0x28b5e { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 28b4c: 82 e0 ldi r24, 0x02 ; 2 28b4e: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28b50: f8 01 movw r30, r16 28b52: ee 0f add r30, r30 28b54: ff 1f adc r31, r31 28b56: ed 53 subi r30, 0x3D ; 61 28b58: fa 4f sbci r31, 0xFA ; 250 28b5a: 11 82 std Z+1, r1 ; 0x01 28b5c: 10 82 st Z, r1 } if (_output > 0) 28b5e: 20 e0 ldi r18, 0x00 ; 0 28b60: 30 e0 ldi r19, 0x00 ; 0 28b62: a9 01 movw r20, r18 28b64: c7 01 movw r24, r14 28b66: b6 01 movw r22, r12 28b68: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 28b6c: 18 16 cp r1, r24 28b6e: bc f5 brge .+110 ; 0x28bde if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 28b70: 29 81 ldd r18, Y+1 ; 0x01 28b72: 3a 81 ldd r19, Y+2 ; 0x02 28b74: 4b 81 ldd r20, Y+3 ; 0x03 28b76: 5c 81 ldd r21, Y+4 ; 0x04 28b78: 6d 81 ldd r22, Y+5 ; 0x05 28b7a: 7e 81 ldd r23, Y+6 ; 0x06 28b7c: 8f 81 ldd r24, Y+7 ; 0x07 28b7e: 98 85 ldd r25, Y+8 ; 0x08 28b80: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 28b84: a3 01 movw r20, r6 28b86: 92 01 movw r18, r4 28b88: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 28b8c: 18 16 cp r1, r24 28b8e: 0c f0 brlt .+2 ; 0x28b92 28b90: 3f c0 rjmp .+126 ; 0x28c10 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28b92: 00 0f add r16, r16 28b94: 11 1f adc r17, r17 28b96: f8 01 movw r30, r16 28b98: ed 53 subi r30, 0x3D ; 61 28b9a: fa 4f sbci r31, 0xFA ; 250 28b9c: 11 82 std Z+1, r1 ; 0x01 28b9e: 10 82 st Z, r1 28ba0: 1e c0 rjmp .+60 ; 0x28bde 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)) 28ba2: a3 01 movw r20, r6 28ba4: 92 01 movw r18, r4 28ba6: 69 81 ldd r22, Y+1 ; 0x01 28ba8: 7a 81 ldd r23, Y+2 ; 0x02 28baa: 8b 81 ldd r24, Y+3 ; 0x03 28bac: 9c 81 ldd r25, Y+4 ; 0x04 28bae: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 28bb2: 18 16 cp r1, r24 28bb4: 0c f0 brlt .+2 ; 0x28bb8 28bb6: b4 cf rjmp .-152 ; 0x28b20 28bb8: f8 01 movw r30, r16 28bba: e7 54 subi r30, 0x47 ; 71 28bbc: fa 4f sbci r31, 0xFA ; 250 28bbe: 80 81 ld r24, Z 28bc0: 81 30 cpi r24, 0x01 ; 1 28bc2: 09 f0 breq .+2 ; 0x28bc6 28bc4: ad cf rjmp .-166 ; 0x28b20 28bc6: 89 cf rjmp .-238 ; 0x28ada 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; 28bc8: 10 82 st Z, r1 28bca: 97 c0 rjmp .+302 ; 0x28cfa temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 28bcc: 20 e0 ldi r18, 0x00 ; 0 28bce: 30 e0 ldi r19, 0x00 ; 0 28bd0: a9 01 movw r20, r18 28bd2: c7 01 movw r24, r14 28bd4: b6 01 movw r22, r12 28bd6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 28bda: 18 16 cp r1, r24 28bdc: cc f0 brlt .+50 ; 0x28c10 } } } } } 28bde: 2c 96 adiw r28, 0x0c ; 12 28be0: 0f b6 in r0, 0x3f ; 63 28be2: f8 94 cli 28be4: de bf out 0x3e, r29 ; 62 28be6: 0f be out 0x3f, r0 ; 63 28be8: cd bf out 0x3d, r28 ; 61 28bea: df 91 pop r29 28bec: cf 91 pop r28 28bee: 1f 91 pop r17 28bf0: 0f 91 pop r16 28bf2: ff 90 pop r15 28bf4: ef 90 pop r14 28bf6: df 90 pop r13 28bf8: cf 90 pop r12 28bfa: bf 90 pop r11 28bfc: af 90 pop r10 28bfe: 9f 90 pop r9 28c00: 8f 90 pop r8 28c02: 7f 90 pop r7 28c04: 6f 90 pop r6 28c06: 5f 90 pop r5 28c08: 4f 90 pop r4 28c0a: 3f 90 pop r3 28c0c: 2f 90 pop r2 28c0e: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 28c10: f8 01 movw r30, r16 28c12: e7 54 subi r30, 0x47 ; 71 28c14: fa 4f sbci r31, 0xFA ; 250 28c16: 80 81 ld r24, Z 28c18: 82 30 cpi r24, 0x02 ; 2 28c1a: 08 f3 brcs .-62 ; 0x28bde { temp_runaway_error_counter[_heater_id]++; 28c1c: 00 0f add r16, r16 28c1e: 11 1f adc r17, r17 28c20: f8 01 movw r30, r16 28c22: ed 53 subi r30, 0x3D ; 61 28c24: fa 4f sbci r31, 0xFA ; 250 28c26: 80 81 ld r24, Z 28c28: 91 81 ldd r25, Z+1 ; 0x01 28c2a: 01 96 adiw r24, 0x01 ; 1 28c2c: 91 83 std Z+1, r25 ; 0x01 28c2e: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 28c30: 88 0f add r24, r24 28c32: 99 1f adc r25, r25 28c34: e9 85 ldd r30, Y+9 ; 0x09 28c36: fa 85 ldd r31, Y+10 ; 0x0a 28c38: e8 17 cp r30, r24 28c3a: f9 07 cpc r31, r25 28c3c: 80 f6 brcc .-96 ; 0x28bde set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 28c3e: 43 e0 ldi r20, 0x03 ; 3 28c40: 62 2d mov r22, r2 28c42: 83 2d mov r24, r3 } } } } } 28c44: 2c 96 adiw r28, 0x0c ; 12 28c46: 0f b6 in r0, 0x3f ; 63 28c48: f8 94 cli 28c4a: de bf out 0x3e, r29 ; 62 28c4c: 0f be out 0x3f, r0 ; 63 28c4e: cd bf out 0x3d, r28 ; 61 28c50: df 91 pop r29 28c52: cf 91 pop r28 28c54: 1f 91 pop r17 28c56: 0f 91 pop r16 28c58: ff 90 pop r15 28c5a: ef 90 pop r14 28c5c: df 90 pop r13 28c5e: cf 90 pop r12 28c60: bf 90 pop r11 28c62: af 90 pop r10 28c64: 9f 90 pop r9 28c66: 8f 90 pop r8 28c68: 7f 90 pop r7 28c6a: 6f 90 pop r6 28c6c: 5f 90 pop r5 28c6e: 4f 90 pop r4 28c70: 3f 90 pop r3 28c72: 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); 28c74: 0d 94 3c 44 jmp 0x28878 ; 0x28878 } 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 28c78: 81 31 cpi r24, 0x11 ; 17 28c7a: 08 f4 brcc .+2 ; 0x28c7e 28c7c: 51 cf rjmp .-350 ; 0x28b20 { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 28c7e: 20 e0 ldi r18, 0x00 ; 0 28c80: 30 e0 ldi r19, 0x00 ; 0 28c82: 44 eb ldi r20, 0xB4 ; 180 28c84: 52 e4 ldi r21, 0x42 ; 66 28c86: c3 01 movw r24, r6 28c88: b2 01 movw r22, r4 28c8a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 28c8e: 81 2c mov r8, r1 28c90: 91 2c mov r9, r1 28c92: e0 e4 ldi r30, 0x40 ; 64 28c94: ae 2e mov r10, r30 28c96: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 28c98: 18 16 cp r1, r24 28c9a: 2c f4 brge .+10 ; 0x28ca6 28c9c: 81 2c mov r8, r1 28c9e: 91 2c mov r9, r1 28ca0: a1 2c mov r10, r1 28ca2: 70 e4 ldi r23, 0x40 ; 64 28ca4: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 28ca6: 20 e0 ldi r18, 0x00 ; 0 28ca8: 30 e0 ldi r19, 0x00 ; 0 28caa: 42 ed ldi r20, 0xD2 ; 210 28cac: 52 e4 ldi r21, 0x42 ; 66 28cae: c3 01 movw r24, r6 28cb0: b2 01 movw r22, r4 28cb2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 28cb6: 18 16 cp r1, r24 28cb8: 44 f4 brge .+16 ; 0x28cca 28cba: 6a e9 ldi r22, 0x9A ; 154 28cbc: 86 2e mov r8, r22 28cbe: 69 e9 ldi r22, 0x99 ; 153 28cc0: 96 2e mov r9, r22 28cc2: 69 e1 ldi r22, 0x19 ; 25 28cc4: a6 2e mov r10, r22 28cc6: 6f e3 ldi r22, 0x3F ; 63 28cc8: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 28cca: eb 85 ldd r30, Y+11 ; 0x0b 28ccc: fc 85 ldd r31, Y+12 ; 0x0c 28cce: ef 54 subi r30, 0x4F ; 79 28cd0: fa 4f sbci r31, 0xFA ; 250 28cd2: 20 81 ld r18, Z 28cd4: 31 81 ldd r19, Z+1 ; 0x01 28cd6: 42 81 ldd r20, Z+2 ; 0x02 28cd8: 53 81 ldd r21, Z+3 ; 0x03 28cda: c3 01 movw r24, r6 28cdc: b2 01 movw r22, r4 28cde: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 28ce2: a5 01 movw r20, r10 28ce4: 94 01 movw r18, r8 28ce6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 28cea: f8 01 movw r30, r16 28cec: e3 55 subi r30, 0x53 ; 83 28cee: fa 4f sbci r31, 0xFA ; 250 28cf0: 87 ff sbrs r24, 7 28cf2: 6a cf rjmp .-300 ; 0x28bc8 __preheat_errors[_heater_id]++; 28cf4: 80 81 ld r24, Z 28cf6: 8f 5f subi r24, 0xFF ; 255 28cf8: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28cfa: 80 81 ld r24, Z 28cfc: 90 e0 ldi r25, 0x00 ; 0 28cfe: 31 10 cpse r3, r1 28d00: 04 c0 rjmp .+8 ; 0x28d0a 28d02: 06 97 sbiw r24, 0x06 ; 6 28d04: 4c f0 brlt .+18 ; 0x28d18 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28d06: 80 e0 ldi r24, 0x00 ; 0 28d08: 03 c0 rjmp .+6 ; 0x28d10 __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28d0a: 04 97 sbiw r24, 0x04 ; 4 28d0c: 2c f0 brlt .+10 ; 0x28d18 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28d0e: 81 e0 ldi r24, 0x01 ; 1 28d10: 42 e0 ldi r20, 0x02 ; 2 28d12: 62 2d mov r22, r2 28d14: 0f 94 3c 44 call 0x28878 ; 0x28878 __preheat_start[_heater_id] = _current_temperature; 28d18: 2b 85 ldd r18, Y+11 ; 0x0b 28d1a: 3c 85 ldd r19, Y+12 ; 0x0c 28d1c: 2f 54 subi r18, 0x4F ; 79 28d1e: 3a 4f sbci r19, 0xFA ; 250 28d20: d9 01 movw r26, r18 28d22: 4d 92 st X+, r4 28d24: 5d 92 st X+, r5 28d26: 6d 92 st X+, r6 28d28: 7c 92 st X, r7 28d2a: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 28d2c: f8 01 movw r30, r16 28d2e: e1 55 subi r30, 0x51 ; 81 28d30: fa 4f sbci r31, 0xFA ; 250 28d32: 10 82 st Z, r1 28d34: f5 ce rjmp .-534 ; 0x28b20 00028d36 : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 28d36: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28d38: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28d3a: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 28d3c: 80 81 ld r24, Z 28d3e: 88 23 and r24, r24 28d40: 29 f0 breq .+10 ; 0x28d4c 28d42: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 28d46: 82 60 ori r24, 0x02 ; 2 28d48: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28d4c: 9f bf out 0x3f, r25 ; 63 } } 28d4e: 08 95 ret 00028d50 : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 28d50: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28d52: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28d54: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 28d56: e3 e7 ldi r30, 0x73 ; 115 28d58: f0 e0 ldi r31, 0x00 ; 0 28d5a: 90 81 ld r25, Z 28d5c: 96 95 lsr r25 28d5e: 91 70 andi r25, 0x01 ; 1 28d60: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 28d62: 80 81 ld r24, Z 28d64: 8d 7f andi r24, 0xFD ; 253 28d66: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28d68: 2f bf out 0x3f, r18 ; 63 } } 28d6a: 08 95 ret 00028d6c : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 28d6c: cf 93 push r28 28d6e: df 93 push r29 28d70: 1f 92 push r1 28d72: cd b7 in r28, 0x3d ; 61 28d74: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 28d76: ce 01 movw r24, r28 28d78: 01 96 adiw r24, 0x01 ; 1 28d7a: 0f 94 a8 46 call 0x28d50 ; 0x28d50 thermal_model::data.P = THERMAL_MODEL_DEF(P); 28d7e: 80 e0 ldi r24, 0x00 ; 0 28d80: 90 e0 ldi r25, 0x00 ; 0 28d82: a8 e1 ldi r26, 0x18 ; 24 28d84: b2 e4 ldi r27, 0x42 ; 66 28d86: 80 93 b5 12 sts 0x12B5, r24 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2a> 28d8a: 90 93 b6 12 sts 0x12B6, r25 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2b> 28d8e: a0 93 b7 12 sts 0x12B7, r26 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2c> 28d92: b0 93 b8 12 sts 0x12B8, r27 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 28d96: 10 92 b9 12 sts 0x12B9, r1 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x2e> 28d9a: 10 92 ba 12 sts 0x12BA, r1 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.394+0x2f> 28d9e: 10 92 bb 12 sts 0x12BB, r1 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.394+0x30> 28da2: 10 92 bc 12 sts 0x12BC, r1 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.394+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 28da6: 80 e0 ldi r24, 0x00 ; 0 28da8: 90 e0 ldi r25, 0x00 ; 0 28daa: a0 e8 ldi r26, 0x80 ; 128 28dac: bf e3 ldi r27, 0x3F ; 63 28dae: 80 93 bd 12 sts 0x12BD, r24 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.394+0x32> 28db2: 90 93 be 12 sts 0x12BE, r25 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.394+0x33> 28db6: a0 93 bf 12 sts 0x12BF, r26 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.394+0x34> 28dba: b0 93 c0 12 sts 0x12C0, r27 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 28dbe: 8a e9 ldi r24, 0x9A ; 154 28dc0: 99 e9 ldi r25, 0x99 ; 153 28dc2: a1 e4 ldi r26, 0x41 ; 65 28dc4: b1 e4 ldi r27, 0x41 ; 65 28dc6: 80 93 c1 12 sts 0x12C1, r24 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 28dca: 90 93 c2 12 sts 0x12C2, r25 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 28dce: a0 93 c3 12 sts 0x12C3, r26 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 28dd2: b0 93 c4 12 sts 0x12C4, r27 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 28dd6: 88 eb ldi r24, 0xB8 ; 184 28dd8: 9e e1 ldi r25, 0x1E ; 30 28dda: a5 e8 ldi r26, 0x85 ; 133 28ddc: bd e3 ldi r27, 0x3D ; 61 28dde: 80 93 c5 12 sts 0x12C5, r24 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3a> 28de2: 90 93 c6 12 sts 0x12C6, r25 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3b> 28de6: a0 93 c7 12 sts 0x12C7, r26 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3c> 28dea: b0 93 c8 12 sts 0x12C8, r27 ; 0x8012c8 <_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); 28dee: 80 e7 ldi r24, 0x70 ; 112 28df0: 98 e0 ldi r25, 0x08 ; 8 28df2: 90 93 ca 12 sts 0x12CA, r25 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 28df6: 80 93 c9 12 sts 0x12C9, r24 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 28dfa: 81 ea ldi r24, 0xA1 ; 161 28dfc: 90 ea ldi r25, 0xA0 ; 160 28dfe: ab ec ldi r26, 0xCB ; 203 28e00: 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); 28e02: fc 01 movw r30, r24 28e04: 45 91 lpm r20, Z+ 28e06: 55 91 lpm r21, Z+ 28e08: 65 91 lpm r22, Z+ 28e0a: 74 91 lpm r23, Z 28e0c: 4d 93 st X+, r20 28e0e: 5d 93 st X+, r21 28e10: 6d 93 st X+, r22 28e12: 7d 93 st X+, r23 28e14: 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) 28e16: 23 e1 ldi r18, 0x13 ; 19 28e18: ab 30 cpi r26, 0x0B ; 11 28e1a: b2 07 cpc r27, r18 28e1c: 91 f7 brne .-28 ; 0x28e02 thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 28e1e: 80 e0 ldi r24, 0x00 ; 0 28e20: 90 e0 ldi r25, 0x00 ; 0 28e22: a0 ee ldi r26, 0xE0 ; 224 28e24: b0 ec ldi r27, 0xC0 ; 192 28e26: 80 93 0b 13 sts 0x130B, r24 ; 0x80130b <_ZN13thermal_modelL4dataE.lto_priv.394+0x80> 28e2a: 90 93 0c 13 sts 0x130C, r25 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.394+0x81> 28e2e: a0 93 0d 13 sts 0x130D, r26 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.394+0x82> 28e32: b0 93 0e 13 sts 0x130E, r27 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.394+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 28e36: 8a e9 ldi r24, 0x9A ; 154 28e38: 99 e9 ldi r25, 0x99 ; 153 28e3a: a9 e9 ldi r26, 0x99 ; 153 28e3c: bf e3 ldi r27, 0x3F ; 63 28e3e: 80 93 0f 13 sts 0x130F, r24 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 28e42: 90 93 10 13 sts 0x1310, r25 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 28e46: a0 93 11 13 sts 0x1311, r26 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 28e4a: b0 93 12 13 sts 0x1312, r27 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 28e4e: 82 e5 ldi r24, 0x52 ; 82 28e50: 98 eb ldi r25, 0xB8 ; 184 28e52: ae ed ldi r26, 0xDE ; 222 28e54: bf e3 ldi r27, 0x3F ; 63 28e56: 80 93 13 13 sts 0x1313, r24 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 28e5a: 90 93 14 13 sts 0x1314, r25 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 28e5e: a0 93 15 13 sts 0x1315, r26 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 28e62: b0 93 16 13 sts 0x1316, r27 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> thermal_model::warn_beep = true; 28e66: 81 e0 ldi r24, 0x01 ; 1 28e68: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.467> thermal_model::enabled = true; 28e6c: 80 93 1d 05 sts 0x051D, r24 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28e70: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> warning_state.assert = false; // explicitly clear assertions 28e74: 80 91 33 06 lds r24, 0x0633 ; 0x800633 28e78: 8d 7f andi r24, 0xFD ; 253 28e7a: 80 93 33 06 sts 0x0633, r24 ; 0x800633 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 28e7e: ce 01 movw r24, r28 28e80: 01 96 adiw r24, 0x01 ; 1 28e82: 0f 94 9b 46 call 0x28d36 ; 0x28d36 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(); } 28e86: 0f 90 pop r0 28e88: df 91 pop r29 28e8a: cf 91 pop r28 28e8c: 08 95 ret 00028e8e : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 28e8e: 1f 93 push r17 28e90: cf 93 push r28 28e92: df 93 push r29 28e94: 1f 92 push r1 28e96: cd b7 in r28, 0x3d ; 61 28e98: de b7 in r29, 0x3e ; 62 28e9a: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 28e9c: ce 01 movw r24, r28 28e9e: 01 96 adiw r24, 0x01 ; 1 28ea0: 0f 94 a8 46 call 0x28d50 ; 0x28d50 thermal_model::enabled = enabled; 28ea4: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> thermal_model::setup(); 28ea8: 0f 94 12 44 call 0x28824 ; 0x28824 void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 28eac: ce 01 movw r24, r28 28eae: 01 96 adiw r24, 0x01 ; 1 28eb0: 0f 94 9b 46 call 0x28d36 ; 0x28d36 thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 28eb4: 11 23 and r17, r17 28eb6: 41 f0 breq .+16 ; 0x28ec8 28eb8: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> 28ebc: 81 11 cpse r24, r1 28ebe: 04 c0 rjmp .+8 ; 0x28ec8 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 28ec0: 89 e0 ldi r24, 0x09 ; 9 28ec2: 90 ea ldi r25, 0xA0 ; 160 28ec4: 0e 94 97 7b call 0xf72e ; 0xf72e } 28ec8: 0f 90 pop r0 28eca: df 91 pop r29 28ecc: cf 91 pop r28 28ece: 1f 91 pop r17 28ed0: 08 95 ret 00028ed2 : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 28ed2: 1f 93 push r17 28ed4: cf 93 push r28 28ed6: df 93 push r29 28ed8: 1f 92 push r1 28eda: cd b7 in r28, 0x3d ; 61 28edc: de b7 in r29, 0x3e ; 62 28ede: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 28ee0: ce 01 movw r24, r28 28ee2: 01 96 adiw r24, 0x01 ; 1 28ee4: 0f 94 a8 46 call 0x28d50 ; 0x28d50 thermal_model::enabled = enabled; 28ee8: 10 93 1d 05 sts 0x051D, r17 ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28eec: 81 e0 ldi r24, 0x01 ; 1 28eee: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> warning_state.assert = false; // explicitly clear assertions 28ef2: e3 e3 ldi r30, 0x33 ; 51 28ef4: f6 e0 ldi r31, 0x06 ; 6 28ef6: 80 81 ld r24, Z 28ef8: 8d 7f andi r24, 0xFD ; 253 28efa: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 28efc: ce 01 movw r24, r28 28efe: 01 96 adiw r24, 0x01 ; 1 28f00: 0f 94 9b 46 call 0x28d36 ; 0x28d36 thermal_model::enabled = enabled; thermal_model::reinitialize(); } 28f04: 0f 90 pop r0 28f06: df 91 pop r29 28f08: cf 91 pop r28 28f0a: 1f 91 pop r17 28f0c: 08 95 ret 00028f0e : /* 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() { 28f0e: cf 93 push r28 28f10: df 93 push r29 28f12: 1f 92 push r1 28f14: cd b7 in r28, 0x3d ; 61 28f16: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 28f18: ce 01 movw r24, r28 28f1a: 01 96 adiw r24, 0x01 ; 1 28f1c: 0f 94 a8 46 call 0x28d50 ; 0x28d50 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 28f24: 90 91 18 05 lds r25, 0x0518 ; 0x800518 28f28: a0 91 19 05 lds r26, 0x0519 ; 0x800519 28f2c: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 28f30: 80 93 5e 0e sts 0x0E5E, r24 ; 0x800e5e 28f34: 90 93 5f 0e sts 0x0E5F, r25 ; 0x800e5f 28f38: a0 93 60 0e sts 0x0E60, r26 ; 0x800e60 28f3c: b0 93 61 0e sts 0x0E61, r27 ; 0x800e61 current_temperature_bed = current_temperature_bed_isr; 28f40: 80 91 13 06 lds r24, 0x0613 ; 0x800613 28f44: 90 91 14 06 lds r25, 0x0614 ; 0x800614 28f48: a0 91 15 06 lds r26, 0x0615 ; 0x800615 28f4c: b0 91 16 06 lds r27, 0x0616 ; 0x800616 28f50: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee 28f54: 90 93 ef 04 sts 0x04EF, r25 ; 0x8004ef 28f58: a0 93 f0 04 sts 0x04F0, r26 ; 0x8004f0 28f5c: b0 93 f1 04 sts 0x04F1, r27 ; 0x8004f1 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 28f60: 80 91 fd 05 lds r24, 0x05FD ; 0x8005fd 28f64: 90 91 fe 05 lds r25, 0x05FE ; 0x8005fe 28f68: a0 91 ff 05 lds r26, 0x05FF ; 0x8005ff 28f6c: b0 91 00 06 lds r27, 0x0600 ; 0x800600 28f70: 80 93 95 03 sts 0x0395, r24 ; 0x800395 28f74: 90 93 96 03 sts 0x0396, r25 ; 0x800396 28f78: a0 93 97 03 sts 0x0397, r26 ; 0x800397 28f7c: b0 93 98 03 sts 0x0398, r27 ; 0x800398 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 28f80: 80 91 1a 06 lds r24, 0x061A ; 0x80061a 28f84: 90 91 1b 06 lds r25, 0x061B ; 0x80061b 28f88: a0 91 1c 06 lds r26, 0x061C ; 0x80061c 28f8c: b0 91 1d 06 lds r27, 0x061D ; 0x80061d 28f90: 80 93 50 06 sts 0x0650, r24 ; 0x800650 28f94: 90 93 51 06 sts 0x0651, r25 ; 0x800651 28f98: a0 93 52 06 sts 0x0652, r26 ; 0x800652 28f9c: b0 93 53 06 sts 0x0653, r27 ; 0x800653 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 28fa0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 28fa4: 81 11 cpse r24, r1 28fa6: 02 c0 rjmp .+4 ; 0x28fac // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 28fa8: 0f 94 a7 20 call 0x2414e ; 0x2414e } temp_meas_ready = false; 28fac: 10 92 fc 05 sts 0x05FC, r1 ; 0x8005fc - 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; 28fb0: ce 01 movw r24, r28 28fb2: 01 96 adiw r24, 0x01 ; 1 28fb4: 0f 94 9b 46 call 0x28d36 ; 0x28d36 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 28fb8: 0f 90 pop r0 28fba: df 91 pop r29 28fbc: cf 91 pop r28 28fbe: 08 95 ret 00028fc0 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 28fc0: 1f 92 push r1 28fc2: 0f 92 push r0 28fc4: 0f b6 in r0, 0x3f ; 63 28fc6: 0f 92 push r0 28fc8: 11 24 eor r1, r1 28fca: 0b b6 in r0, 0x3b ; 59 28fcc: 0f 92 push r0 28fce: ff 92 push r15 28fd0: 0f 93 push r16 28fd2: 1f 93 push r17 28fd4: 2f 93 push r18 28fd6: 3f 93 push r19 28fd8: 4f 93 push r20 28fda: 5f 93 push r21 28fdc: 6f 93 push r22 28fde: 7f 93 push r23 28fe0: 8f 93 push r24 28fe2: 9f 93 push r25 28fe4: af 93 push r26 28fe6: bf 93 push r27 28fe8: cf 93 push r28 28fea: df 93 push r29 28fec: ef 93 push r30 28fee: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 28ff0: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 28ff4: 8b 7f andi r24, 0xFB ; 251 28ff6: 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(); 28ffa: 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) 28ffc: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 29000: 86 fd sbrc r24, 6 29002: c8 c0 rjmp .+400 ; 0x29194 <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 29004: 68 ec ldi r22, 0xC8 ; 200 29006: 70 e0 ldi r23, 0x00 ; 0 29008: 8d ed ldi r24, 0xDD ; 221 2900a: 95 e0 ldi r25, 0x05 ; 5 2900c: 0f 94 af 3e call 0x27d5e ; 0x27d5e ::expired_cont(unsigned short)> 29010: 88 23 and r24, r24 29012: b9 f0 breq .+46 ; 0x29042 <__vector_14+0x82> buttonBlanking.start(); 29014: 8d ed ldi r24, 0xDD ; 221 29016: 95 e0 ldi r25, 0x05 ; 5 29018: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> safetyTimer.start(); 2901c: 88 ed ldi r24, 0xD8 ; 216 2901e: 95 e0 ldi r25, 0x05 ; 5 29020: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 29024: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 29028: 81 11 cpse r24, r1 2902a: a5 c0 rjmp .+330 ; 0x29176 <__vector_14+0x1b6> 2902c: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 29030: 81 11 cpse r24, r1 29032: a1 c0 rjmp .+322 ; 0x29176 <__vector_14+0x1b6> { longPressTimer.start(); 29034: 83 ed ldi r24, 0xD3 ; 211 29036: 95 e0 ldi r25, 0x05 ; 5 29038: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> lcd_button_pressed = 1; 2903c: 81 e0 ldi r24, 0x01 ; 1 2903e: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 29042: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 29046: 82 fb bst r24, 2 29048: 88 27 eor r24, r24 2904a: 80 f9 bld r24, 0 2904c: 91 e0 ldi r25, 0x01 ; 1 2904e: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 29050: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 29054: 91 ff sbrs r25, 1 29056: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 29058: e0 91 d0 05 lds r30, 0x05D0 ; 0x8005d0 2905c: e8 17 cp r30, r24 2905e: e1 f0 breq .+56 ; 0x29098 <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 29060: 24 e0 ldi r18, 0x04 ; 4 29062: e2 9f mul r30, r18 29064: f0 01 movw r30, r0 29066: 11 24 eor r1, r1 29068: e8 2b or r30, r24 2906a: e6 51 subi r30, 0x16 ; 22 2906c: f0 46 sbci r31, 0x60 ; 96 2906e: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 29070: 90 91 cf 05 lds r25, 0x05CF ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.557> 29074: e9 0f add r30, r25 29076: e0 93 cf 05 sts 0x05CF, r30 ; 0x8005cf <_ZL16lcd_encoder_diff.lto_priv.557> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 2907a: 0e 2e mov r0, r30 2907c: 00 0c add r0, r0 2907e: ff 0b sbc r31, r31 29080: f7 ff sbrs r31, 7 29082: 03 c0 rjmp .+6 ; 0x2908a <__vector_14+0xca> 29084: f1 95 neg r31 29086: e1 95 neg r30 29088: f1 09 sbc r31, r1 2908a: 34 97 sbiw r30, 0x04 ; 4 2908c: 1c f0 brlt .+6 ; 0x29094 <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 2908e: 91 e0 ldi r25, 0x01 ; 1 29090: 90 93 d1 05 sts 0x05D1, r25 ; 0x8005d1 <_ZL26lcd_backlight_wake_trigger.lto_priv.556> } enc_bits_old = enc_bits; 29094: 80 93 d0 05 sts 0x05D0, r24 ; 0x8005d0 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 29098: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2909c: 81 11 cpse r24, r1 2909e: 08 c0 rjmp .+16 ; 0x290b0 <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 290a0: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 290a4: 80 93 e2 05 sts 0x05E2, r24 ; 0x8005e2 if(soft_pwm_0 > 0) 290a8: 88 23 and r24, r24 290aa: 09 f4 brne .+2 ; 0x290ae <__vector_14+0xee> 290ac: 87 c0 rjmp .+270 ; 0x291bc <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 290ae: 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) 290b0: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 290b4: 8f 70 andi r24, 0x0F ; 15 290b6: a9 f4 brne .+42 ; 0x290e2 <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 290b8: 80 91 9d 04 lds r24, 0x049D ; 0x80049d 290bc: 90 e0 ldi r25, 0x00 ; 0 290be: 24 e0 ldi r18, 0x04 ; 4 290c0: 95 95 asr r25 290c2: 87 95 ror r24 290c4: 2a 95 dec r18 290c6: e1 f7 brne .-8 ; 0x290c0 <__vector_14+0x100> 290c8: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c <_ZL12soft_pwm_fan.lto_priv.472> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 290cc: 89 2b or r24, r25 290ce: 09 f4 brne .+2 ; 0x290d2 <__vector_14+0x112> 290d0: 77 c0 rjmp .+238 ; 0x291c0 <__vector_14+0x200> 290d2: 9f b7 in r25, 0x3f ; 63 290d4: f8 94 cli 290d6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 290da: 88 60 ori r24, 0x08 ; 8 290dc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 290e0: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 290e2: 90 91 e2 05 lds r25, 0x05E2 ; 0x8005e2 290e6: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 290ea: 98 17 cp r25, r24 290ec: 08 f4 brcc .+2 ; 0x290f0 <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 290ee: 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); 290f0: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 290f4: 8f 70 andi r24, 0x0F ; 15 290f6: 90 91 9c 04 lds r25, 0x049C ; 0x80049c <_ZL12soft_pwm_fan.lto_priv.472> 290fa: 98 17 cp r25, r24 290fc: 40 f4 brcc .+16 ; 0x2910e <__vector_14+0x14e> 290fe: 9f b7 in r25, 0x3f ; 63 29100: f8 94 cli 29102: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29106: 87 7f andi r24, 0xF7 ; 247 29108: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2910c: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 2910e: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29112: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 29114: 8f 77 andi r24, 0x7F ; 127 29116: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2911a: 10 e0 ldi r17, 0x00 ; 0 2911c: 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 2911e: e8 01 movw r28, r16 29120: cc 0f add r28, r28 29122: dd 1f adc r29, r29 29124: cd 59 subi r28, 0x9D ; 157 29126: d9 4f sbci r29, 0xF9 ; 249 29128: 88 81 ld r24, Y 2912a: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 2912c: 18 16 cp r1, r24 2912e: 19 06 cpc r1, r25 29130: 0c f0 brlt .+2 ; 0x29134 <__vector_14+0x174> 29132: 4c c0 rjmp .+152 ; 0x291cc <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 29134: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 29136: f8 94 cli babystep(axis,/*fwd*/true); 29138: 61 e0 ldi r22, 0x01 ; 1 2913a: 80 2f mov r24, r16 2913c: 0f 94 b8 20 call 0x24170 ; 0x24170 babystepsTodo[axis]--; //less to do next time 29140: 88 81 ld r24, Y 29142: 99 81 ldd r25, Y+1 ; 0x01 29144: 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 29146: 99 83 std Y+1, r25 ; 0x01 29148: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2914a: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 2914c: 0f 5f subi r16, 0xFF ; 255 2914e: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 29150: 03 30 cpi r16, 0x03 ; 3 29152: 11 05 cpc r17, r1 29154: 21 f7 brne .-56 ; 0x2911e <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 29156: 80 91 36 18 lds r24, 0x1836 ; 0x801836 <__bss_end+0x20> 2915a: 90 91 37 18 lds r25, 0x1837 ; 0x801837 <__bss_end+0x21> 2915e: a0 91 38 18 lds r26, 0x1838 ; 0x801838 <__bss_end+0x22> 29162: b0 91 39 18 lds r27, 0x1839 ; 0x801839 <__bss_end+0x23> 29166: 82 3a cpi r24, 0xA2 ; 162 29168: 92 4a sbci r25, 0xA2 ; 162 2916a: a1 05 cpc r26, r1 2916c: b1 05 cpc r27, r1 2916e: d9 f1 breq .+118 ; 0x291e6 <__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); 29170: 81 e0 ldi r24, 0x01 ; 1 29172: 0e 94 9e 68 call 0xd13c ; 0xd13c if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 29176: 68 ee ldi r22, 0xE8 ; 232 29178: 73 e0 ldi r23, 0x03 ; 3 2917a: 83 ed ldi r24, 0xD3 ; 211 2917c: 95 e0 ldi r25, 0x05 ; 5 2917e: 0f 94 87 3e call 0x27d0e ; 0x27d0e ::expired(unsigned short)> 29182: 88 23 and r24, r24 29184: 09 f4 brne .+2 ; 0x29188 <__vector_14+0x1c8> 29186: 5d cf rjmp .-326 ; 0x29042 <__vector_14+0x82> { lcd_long_press_active = 1; 29188: 81 e0 ldi r24, 0x01 ; 1 2918a: 80 93 d6 05 sts 0x05D6, r24 ; 0x8005d6 lcd_longpress_trigger = 1; 2918e: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 29192: 57 cf rjmp .-338 ; 0x29042 <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 29194: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 29198: 88 23 and r24, r24 2919a: 09 f4 brne .+2 ; 0x2919e <__vector_14+0x1de> 2919c: 52 cf rjmp .-348 ; 0x29042 <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 2919e: 10 92 d7 05 sts 0x05D7, r1 ; 0x8005d7 if (!lcd_long_press_active) 291a2: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 291a6: 81 11 cpse r24, r1 291a8: 03 c0 rjmp .+6 ; 0x291b0 <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 291aa: 81 e0 ldi r24, 0x01 ; 1 291ac: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 291b0: 81 e0 ldi r24, 0x01 ; 1 291b2: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 <_ZL26lcd_backlight_wake_trigger.lto_priv.556> lcd_long_press_active = 0; 291b6: 10 92 d6 05 sts 0x05D6, r1 ; 0x8005d6 291ba: 43 cf rjmp .-378 ; 0x29042 <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 291bc: 75 98 cbi 0x0e, 5 ; 14 291be: 78 cf rjmp .-272 ; 0x290b0 <__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); 291c0: 9f b7 in r25, 0x3f ; 63 291c2: f8 94 cli 291c4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 291c8: 87 7f andi r24, 0xF7 ; 247 291ca: 88 cf rjmp .-240 ; 0x290dc <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 291cc: 89 2b or r24, r25 291ce: 09 f4 brne .+2 ; 0x291d2 <__vector_14+0x212> 291d0: bd cf rjmp .-134 ; 0x2914c <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 291d2: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 291d4: f8 94 cli babystep(axis,/*fwd*/false); 291d6: 60 e0 ldi r22, 0x00 ; 0 291d8: 80 2f mov r24, r16 291da: 0f 94 b8 20 call 0x24170 ; 0x24170 babystepsTodo[axis]++; //less to do next time 291de: 88 81 ld r24, Y 291e0: 99 81 ldd r25, Y+1 ; 0x01 291e2: 01 96 adiw r24, 0x01 ; 1 291e4: b0 cf rjmp .-160 ; 0x29146 <__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]) { 291e6: 9c b1 in r25, 0x0c ; 12 291e8: 80 91 e0 05 lds r24, 0x05E0 ; 0x8005e0 291ec: 96 fb bst r25, 6 291ee: 99 27 eor r25, r25 291f0: 90 f9 bld r25, 0 291f2: 98 17 cp r25, r24 291f4: 91 f0 breq .+36 ; 0x2921a <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 291f6: 90 91 33 05 lds r25, 0x0533 ; 0x800533 291fa: 99 23 and r25, r25 291fc: 51 f0 breq .+20 ; 0x29212 <__vector_14+0x252> 291fe: 20 91 b2 04 lds r18, 0x04B2 ; 0x8004b2 29202: 30 91 b3 04 lds r19, 0x04B3 ; 0x8004b3 29206: 2f 5f subi r18, 0xFF ; 255 29208: 3f 4f sbci r19, 0xFF ; 255 2920a: 30 93 b3 04 sts 0x04B3, r19 ; 0x8004b3 2920e: 20 93 b2 04 sts 0x04B2, r18 ; 0x8004b2 fan_state[0] = !fan_state[0]; 29212: 91 e0 ldi r25, 0x01 ; 1 29214: 89 27 eor r24, r25 29216: 80 93 e0 05 sts 0x05E0, r24 ; 0x8005e0 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 2921a: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 2921c: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 29220: 84 60 ori r24, 0x04 ; 4 29222: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 29226: ff 91 pop r31 29228: ef 91 pop r30 2922a: df 91 pop r29 2922c: cf 91 pop r28 2922e: bf 91 pop r27 29230: af 91 pop r26 29232: 9f 91 pop r25 29234: 8f 91 pop r24 29236: 7f 91 pop r23 29238: 6f 91 pop r22 2923a: 5f 91 pop r21 2923c: 4f 91 pop r20 2923e: 3f 91 pop r19 29240: 2f 91 pop r18 29242: 1f 91 pop r17 29244: 0f 91 pop r16 29246: ff 90 pop r15 29248: 0f 90 pop r0 2924a: 0b be out 0x3b, r0 ; 59 2924c: 0f 90 pop r0 2924e: 0f be out 0x3f, r0 ; 63 29250: 0f 90 pop r0 29252: 1f 90 pop r1 29254: 18 95 reti 00029256 : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 29256: 4f 92 push r4 29258: 5f 92 push r5 2925a: 6f 92 push r6 2925c: 7f 92 push r7 2925e: af 92 push r10 29260: bf 92 push r11 29262: cf 92 push r12 29264: df 92 push r13 29266: ef 92 push r14 29268: ff 92 push r15 2926a: 0f 93 push r16 2926c: 1f 93 push r17 2926e: cf 93 push r28 29270: df 93 push r29 29272: 24 e0 ldi r18, 0x04 ; 4 29274: 30 e0 ldi r19, 0x00 ; 0 29276: 41 e0 ldi r20, 0x01 ; 1 29278: 50 e0 ldi r21, 0x00 ; 0 2927a: d9 01 movw r26, r18 2927c: a4 58 subi r26, 0x84 ; 132 2927e: b1 46 sbci r27, 0x61 ; 97 float celsius = 0; byte i; for (i=1; i raw) 29280: fd 01 movw r30, r26 29282: 65 91 lpm r22, Z+ 29284: 74 91 lpm r23, Z 29286: 86 17 cp r24, r22 29288: 97 07 cpc r25, r23 2928a: 0c f0 brlt .+2 ; 0x2928e 2928c: 66 c0 rjmp .+204 ; 0x2935a { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 2928e: 41 50 subi r20, 0x01 ; 1 29290: 51 09 sbc r21, r1 29292: 44 0f add r20, r20 29294: 55 1f adc r21, r21 29296: 44 0f add r20, r20 29298: 55 1f adc r21, r21 2929a: ea 01 movw r28, r20 2929c: c2 58 subi r28, 0x82 ; 130 2929e: d1 46 sbci r29, 0x61 ; 97 292a0: fe 01 movw r30, r28 292a2: 05 91 lpm r16, Z+ 292a4: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 292a6: 44 58 subi r20, 0x84 ; 132 292a8: 51 46 sbci r21, 0x61 ; 97 292aa: fa 01 movw r30, r20 292ac: 65 91 lpm r22, Z+ 292ae: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 292b0: f9 01 movw r30, r18 292b2: e2 58 subi r30, 0x82 ; 130 292b4: f1 46 sbci r31, 0x61 ; 97 292b6: e5 90 lpm r14, Z+ 292b8: f4 90 lpm r15, Z 292ba: fe 01 movw r30, r28 292bc: c5 90 lpm r12, Z+ 292be: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 292c0: fd 01 movw r30, r26 292c2: c5 91 lpm r28, Z+ 292c4: d4 91 lpm r29, Z 292c6: fa 01 movw r30, r20 292c8: a5 90 lpm r10, Z+ 292ca: 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])) * 292cc: 86 1b sub r24, r22 292ce: 97 0b sbc r25, r23 292d0: bc 01 movw r22, r24 292d2: 99 0f add r25, r25 292d4: 88 0b sbc r24, r24 292d6: 99 0b sbc r25, r25 292d8: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 292dc: 2b 01 movw r4, r22 292de: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 292e0: b7 01 movw r22, r14 292e2: 6c 19 sub r22, r12 292e4: 7d 09 sbc r23, r13 292e6: 07 2e mov r0, r23 292e8: 00 0c add r0, r0 292ea: 88 0b sbc r24, r24 292ec: 99 0b sbc r25, r25 292ee: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 292f2: 9b 01 movw r18, r22 292f4: 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])) * 292f6: c3 01 movw r24, r6 292f8: b2 01 movw r22, r4 292fa: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 292fe: 6b 01 movw r12, r22 29300: 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])); 29302: be 01 movw r22, r28 29304: 6a 19 sub r22, r10 29306: 7b 09 sbc r23, r11 29308: 07 2e mov r0, r23 2930a: 00 0c add r0, r0 2930c: 88 0b sbc r24, r24 2930e: 99 0b sbc r25, r25 29310: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 29314: 9b 01 movw r18, r22 29316: 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])) / 29318: c7 01 movw r24, r14 2931a: b6 01 movw r22, r12 2931c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 29320: 6b 01 movw r12, r22 29322: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 29324: b8 01 movw r22, r16 29326: 11 0f add r17, r17 29328: 88 0b sbc r24, r24 2932a: 99 0b sbc r25, r25 2932c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 29330: 9b 01 movw r18, r22 29332: ac 01 movw r20, r24 29334: c7 01 movw r24, r14 29336: b6 01 movw r22, r12 29338: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 2933c: df 91 pop r29 2933e: cf 91 pop r28 29340: 1f 91 pop r17 29342: 0f 91 pop r16 29344: ff 90 pop r15 29346: ef 90 pop r14 29348: df 90 pop r13 2934a: cf 90 pop r12 2934c: bf 90 pop r11 2934e: af 90 pop r10 29350: 7f 90 pop r7 29352: 6f 90 pop r6 29354: 5f 90 pop r5 29356: 4f 90 pop r4 29358: 08 95 ret 2935a: 4f 5f subi r20, 0xFF ; 255 2935c: 5f 4f sbci r21, 0xFF ; 255 2935e: 2c 5f subi r18, 0xFC ; 252 29360: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 29368: 88 cf rjmp .-240 ; 0x2927a (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]); 2936a: e2 e0 ldi r30, 0x02 ; 2 2936c: ff e9 ldi r31, 0x9F ; 159 2936e: 65 91 lpm r22, Z+ 29370: 74 91 lpm r23, Z 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 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2937e: de cf rjmp .-68 ; 0x2933c 00029380 : 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) { 29380: 4f 92 push r4 29382: 5f 92 push r5 29384: 6f 92 push r6 29386: 7f 92 push r7 29388: af 92 push r10 2938a: bf 92 push r11 2938c: cf 92 push r12 2938e: df 92 push r13 29390: ef 92 push r14 29392: ff 92 push r15 29394: 0f 93 push r16 29396: 1f 93 push r17 29398: cf 93 push r28 2939a: df 93 push r29 2939c: 24 e0 ldi r18, 0x04 ; 4 2939e: 30 e0 ldi r19, 0x00 ; 0 293a0: 41 e0 ldi r20, 0x01 ; 1 293a2: 50 e0 ldi r21, 0x00 ; 0 293a4: d9 01 movw r26, r18 293a6: a8 57 subi r26, 0x78 ; 120 293a8: b2 46 sbci r27, 0x62 ; 98 float celsius = 0; byte i; for (i=1; i raw) 293aa: fd 01 movw r30, r26 293ac: 65 91 lpm r22, Z+ 293ae: 74 91 lpm r23, Z 293b0: 86 17 cp r24, r22 293b2: 97 07 cpc r25, r23 293b4: 0c f0 brlt .+2 ; 0x293b8 293b6: 80 c0 rjmp .+256 ; 0x294b8 { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 293b8: 41 50 subi r20, 0x01 ; 1 293ba: 51 09 sbc r21, r1 293bc: 44 0f add r20, r20 293be: 55 1f adc r21, r21 293c0: 44 0f add r20, r20 293c2: 55 1f adc r21, r21 293c4: 8a 01 movw r16, r20 293c6: 06 57 subi r16, 0x76 ; 118 293c8: 12 46 sbci r17, 0x62 ; 98 293ca: f8 01 movw r30, r16 293cc: c5 90 lpm r12, Z+ 293ce: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 293d0: 48 57 subi r20, 0x78 ; 120 293d2: 52 46 sbci r21, 0x62 ; 98 293d4: fa 01 movw r30, r20 293d6: 65 91 lpm r22, Z+ 293d8: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 293da: f9 01 movw r30, r18 293dc: e6 57 subi r30, 0x76 ; 118 293de: f2 46 sbci r31, 0x62 ; 98 293e0: c5 91 lpm r28, Z+ 293e2: d4 91 lpm r29, Z 293e4: f8 01 movw r30, r16 293e6: 05 91 lpm r16, Z+ 293e8: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 293ea: fd 01 movw r30, r26 293ec: e5 90 lpm r14, Z+ 293ee: f4 90 lpm r15, Z 293f0: fa 01 movw r30, r20 293f2: a5 90 lpm r10, Z+ 293f4: 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])) * 293f6: 86 1b sub r24, r22 293f8: 97 0b sbc r25, r23 293fa: bc 01 movw r22, r24 293fc: 99 0f add r25, r25 293fe: 88 0b sbc r24, r24 29400: 99 0b sbc r25, r25 29402: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 29406: 2b 01 movw r4, r22 29408: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 2940a: be 01 movw r22, r28 2940c: 60 1b sub r22, r16 2940e: 71 0b sbc r23, r17 29410: 07 2e mov r0, r23 29412: 00 0c add r0, r0 29414: 88 0b sbc r24, r24 29416: 99 0b sbc r25, r25 29418: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2941c: 9b 01 movw r18, r22 2941e: 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])) * 29420: c3 01 movw r24, r6 29422: b2 01 movw r22, r4 29424: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 29428: 2b 01 movw r4, r22 2942a: 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])); 2942c: b7 01 movw r22, r14 2942e: 6a 19 sub r22, r10 29430: 7b 09 sbc r23, r11 29432: 07 2e mov r0, r23 29434: 00 0c add r0, r0 29436: 88 0b sbc r24, r24 29438: 99 0b sbc r25, r25 2943a: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2943e: 9b 01 movw r18, r22 29440: 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])) / 29442: c3 01 movw r24, r6 29444: b2 01 movw r22, r4 29446: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 2944a: 2b 01 movw r4, r22 2944c: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 2944e: b6 01 movw r22, r12 29450: dd 0c add r13, r13 29452: 88 0b sbc r24, r24 29454: 99 0b sbc r25, r25 29456: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2945a: 9b 01 movw r18, r22 2945c: ac 01 movw r20, r24 2945e: c3 01 movw r24, r6 29460: b2 01 movw r22, r4 29462: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 29466: 6b 01 movw r12, r22 29468: 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) 2946a: 20 e0 ldi r18, 0x00 ; 0 2946c: 30 e0 ldi r19, 0x00 ; 0 2946e: 40 e2 ldi r20, 0x20 ; 32 29470: 52 e4 ldi r21, 0x42 ; 66 29472: c7 01 movw r24, r14 29474: b6 01 movw r22, r12 29476: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2947a: 87 fd sbrc r24, 7 2947c: 30 c0 rjmp .+96 ; 0x294de 2947e: 20 e0 ldi r18, 0x00 ; 0 29480: 30 e0 ldi r19, 0x00 ; 0 29482: 48 e4 ldi r20, 0x48 ; 72 29484: 52 e4 ldi r21, 0x42 ; 66 29486: c7 01 movw r24, r14 29488: b6 01 movw r22, r12 2948a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2948e: 18 16 cp r1, r24 29490: 34 f1 brlt .+76 ; 0x294de { celsius = celsius + (_first_koef * (celsius - _offset_start)); 29492: 20 e0 ldi r18, 0x00 ; 0 29494: 30 e0 ldi r19, 0x00 ; 0 29496: 40 e2 ldi r20, 0x20 ; 32 29498: 52 e4 ldi r21, 0x42 ; 66 2949a: c7 01 movw r24, r14 2949c: b6 01 movw r22, r12 2949e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 294a2: 20 e0 ldi r18, 0x00 ; 0 294a4: 30 e0 ldi r19, 0x00 ; 0 294a6: 40 e0 ldi r20, 0x00 ; 0 294a8: 5f e3 ldi r21, 0x3F ; 63 294aa: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 294ae: 9b 01 movw r18, r22 294b0: 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; 294b2: c7 01 movw r24, r14 294b4: b6 01 movw r22, r12 294b6: 43 c0 rjmp .+134 ; 0x2953e 294b8: 4f 5f subi r20, 0xFF ; 255 294ba: 5f 4f sbci r21, 0xFF ; 255 294bc: 2c 5f subi r18, 0xFC ; 252 294be: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 294c6: 6e cf rjmp .-292 ; 0x293a4 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 294c8: ea e7 ldi r30, 0x7A ; 122 294ca: fe e9 ldi r31, 0x9E ; 158 294cc: 65 91 lpm r22, Z+ 294ce: 74 91 lpm r23, Z 294d0: 07 2e mov r0, r23 294d2: 00 0c add r0, r0 294d4: 88 0b sbc r24, r24 294d6: 99 0b sbc r25, r25 294d8: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 294dc: c4 cf rjmp .-120 ; 0x29466 if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 294de: 20 e0 ldi r18, 0x00 ; 0 294e0: 30 e0 ldi r19, 0x00 ; 0 294e2: 48 e4 ldi r20, 0x48 ; 72 294e4: 52 e4 ldi r21, 0x42 ; 66 294e6: c7 01 movw r24, r14 294e8: b6 01 movw r22, r12 294ea: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 294ee: 18 16 cp r1, r24 294f0: dc f5 brge .+118 ; 0x29568 294f2: 20 e0 ldi r18, 0x00 ; 0 294f4: 30 e0 ldi r19, 0x00 ; 0 294f6: 48 ec ldi r20, 0xC8 ; 200 294f8: 52 e4 ldi r21, 0x42 ; 66 294fa: c7 01 movw r24, r14 294fc: b6 01 movw r22, r12 294fe: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 29502: 18 16 cp r1, r24 29504: 8c f1 brlt .+98 ; 0x29568 { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 29506: 20 e0 ldi r18, 0x00 ; 0 29508: 30 e0 ldi r19, 0x00 ; 0 2950a: 40 ea ldi r20, 0xA0 ; 160 2950c: 50 e4 ldi r21, 0x40 ; 64 2950e: c7 01 movw r24, r14 29510: b6 01 movw r22, r12 29512: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 29516: 2b 01 movw r4, r22 29518: 3c 01 movw r6, r24 2951a: 20 e0 ldi r18, 0x00 ; 0 2951c: 30 e0 ldi r19, 0x00 ; 0 2951e: 48 e4 ldi r20, 0x48 ; 72 29520: 52 e4 ldi r21, 0x42 ; 66 29522: c7 01 movw r24, r14 29524: b6 01 movw r22, r12 29526: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 2952a: 2d ec ldi r18, 0xCD ; 205 2952c: 3c ec ldi r19, 0xCC ; 204 2952e: 4c ec ldi r20, 0xCC ; 204 29530: 5d e3 ldi r21, 0x3D ; 61 29532: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 29536: 9b 01 movw r18, r22 29538: ac 01 movw r20, r24 2953a: c3 01 movw r24, r6 2953c: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 2953e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 29542: 6b 01 movw r12, r22 29544: 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 } 29546: c7 01 movw r24, r14 29548: b6 01 movw r22, r12 2954a: df 91 pop r29 2954c: cf 91 pop r28 2954e: 1f 91 pop r17 29550: 0f 91 pop r16 29552: ff 90 pop r15 29554: ef 90 pop r14 29556: df 90 pop r13 29558: cf 90 pop r12 2955a: bf 90 pop r11 2955c: af 90 pop r10 2955e: 7f 90 pop r7 29560: 6f 90 pop r6 29562: 5f 90 pop r5 29564: 4f 90 pop r4 29566: 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) 29568: 20 e0 ldi r18, 0x00 ; 0 2956a: 30 e0 ldi r19, 0x00 ; 0 2956c: 48 ec ldi r20, 0xC8 ; 200 2956e: 52 e4 ldi r21, 0x42 ; 66 29570: c7 01 movw r24, r14 29572: b6 01 movw r22, r12 29574: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 29578: 18 16 cp r1, r24 2957a: 2c f7 brge .-54 ; 0x29546 { celsius = celsius + _offset; 2957c: 20 e0 ldi r18, 0x00 ; 0 2957e: 30 e0 ldi r19, 0x00 ; 0 29580: 40 e2 ldi r20, 0x20 ; 32 29582: 51 e4 ldi r21, 0x41 ; 65 29584: 96 cf rjmp .-212 ; 0x294b2 00029586 : } static void check_temp_raw(); static void temp_mgr_isr() { 29586: 4f 92 push r4 29588: 5f 92 push r5 2958a: 6f 92 push r6 2958c: 7f 92 push r7 2958e: af 92 push r10 29590: cf 92 push r12 29592: df 92 push r13 29594: ef 92 push r14 29596: ff 92 push r15 29598: 0f 93 push r16 2959a: 1f 93 push r17 2959c: cf 93 push r28 2959e: 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 295a4: 90 91 06 06 lds r25, 0x0606 ; 0x800606 295a8: 0e 94 c1 d9 call 0x1b382 ; 0x1b382 295ac: 60 93 17 05 sts 0x0517, r22 ; 0x800517 295b0: 70 93 18 05 sts 0x0518, r23 ; 0x800518 295b4: 80 93 19 05 sts 0x0519, r24 ; 0x800519 295b8: 90 93 1a 05 sts 0x051A, r25 ; 0x80051a current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 295bc: 60 90 03 06 lds r6, 0x0603 ; 0x800603 295c0: 70 90 04 06 lds r7, 0x0604 ; 0x800604 295c4: c3 01 movw r24, r6 295c6: 0f 94 c0 49 call 0x29380 ; 0x29380 295ca: 6b 01 movw r12, r22 295cc: 7c 01 movw r14, r24 295ce: c0 92 13 06 sts 0x0613, r12 ; 0x800613 295d2: d0 92 14 06 sts 0x0614, r13 ; 0x800614 295d6: e0 92 15 06 sts 0x0615, r14 ; 0x800615 295da: f0 92 16 06 sts 0x0616, r15 ; 0x800616 #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 295de: 80 91 01 06 lds r24, 0x0601 ; 0x800601 295e2: 90 91 02 06 lds r25, 0x0602 ; 0x800602 295e6: 0f 94 c0 49 call 0x29380 ; 0x29380 295ea: 60 93 fd 05 sts 0x05FD, r22 ; 0x8005fd 295ee: 70 93 fe 05 sts 0x05FE, r23 ; 0x8005fe 295f2: 80 93 ff 05 sts 0x05FF, r24 ; 0x8005ff 295f6: 90 93 00 06 sts 0x0600, r25 ; 0x800600 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) 295fa: c0 91 0f 06 lds r28, 0x060F ; 0x80060f 295fe: d0 91 10 06 lds r29, 0x0610 ; 0x800610 29602: ce 01 movw r24, r28 29604: 0f 94 2b 49 call 0x29256 ; 0x29256 29608: 60 93 1a 06 sts 0x061A, r22 ; 0x80061a 2960c: 70 93 1b 06 sts 0x061B, r23 ; 0x80061b 29610: 80 93 1c 06 sts 0x061C, r24 ; 0x80061c 29614: 90 93 1d 06 sts 0x061D, r25 ; 0x80061d #endif temp_meas_ready = true; 29618: 81 e0 ldi r24, 0x01 ; 1 2961a: 80 93 fc 05 sts 0x05FC, r24 ; 0x8005fc { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 2961e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29622: 8d 7f andi r24, 0xFD ; 253 29624: 80 93 1b 05 sts 0x051B, r24 ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 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]) { 29628: 20 91 05 06 lds r18, 0x0605 ; 0x800605 2962c: 30 91 06 06 lds r19, 0x0606 ; 0x800606 29630: 80 91 98 04 lds r24, 0x0498 ; 0x800498 <_ZL12maxttemp_raw.lto_priv.475> 29634: 90 91 99 04 lds r25, 0x0499 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.475+0x1> 29638: 82 17 cp r24, r18 2963a: 93 07 cpc r25, r19 2963c: 2c f0 brlt .+10 ; 0x29648 #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 2963e: 40 e0 ldi r20, 0x00 ; 0 29640: 60 e0 ldi r22, 0x00 ; 0 29642: 80 e0 ldi r24, 0x00 ; 0 29644: 0f 94 3c 44 call 0x28878 ; 0x28878 } //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) { 29648: 80 91 96 04 lds r24, 0x0496 ; 0x800496 <_ZL16bed_maxttemp_raw.lto_priv.476> 2964c: 90 91 97 04 lds r25, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.476+0x1> 29650: 86 15 cp r24, r6 29652: 97 05 cpc r25, r7 29654: 2c f0 brlt .+10 ; 0x29660 #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 29656: 40 e0 ldi r20, 0x00 ; 0 29658: 60 e0 ldi r22, 0x00 ; 0 2965a: 81 e0 ldi r24, 0x01 ; 1 2965c: 0f 94 3c 44 call 0x28878 ; 0x28878 } #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) { 29660: 80 91 94 04 lds r24, 0x0494 ; 0x800494 <_ZL20ambient_maxttemp_raw.lto_priv.477> 29664: 90 91 95 04 lds r25, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.477+0x1> 29668: 8c 17 cp r24, r28 2966a: 9d 07 cpc r25, r29 2966c: 2c f0 brlt .+10 ; 0x29678 #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 2966e: 40 e0 ldi r20, 0x00 ; 0 29670: 60 e0 ldi r22, 0x00 ; 0 29672: 82 e0 ldi r24, 0x02 ; 2 29674: 0f 94 3c 44 call 0x28878 ; 0x28878 #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) { 29678: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.474> 2967c: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.474+0x1> 29680: c8 17 cp r28, r24 29682: d9 07 cpc r29, r25 29684: 2c f0 brlt .+10 ; 0x29690 #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 29686: 41 e0 ldi r20, 0x01 ; 1 29688: 60 e0 ldi r22, 0x00 ; 0 2968a: 82 e0 ldi r24, 0x02 ; 2 2968c: 0f 94 3c 44 call 0x28878 ; 0x28878 #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 29690: c1 3a cpi r28, 0xA1 ; 161 29692: de 43 sbci r29, 0x3E ; 62 29694: 0c f4 brge .+2 ; 0x29698 29696: cd c1 rjmp .+922 ; 0x29a32 { // 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]) { 29698: 60 91 9a 04 lds r22, 0x049A ; 0x80049a <_ZL8minttemp.lto_priv.473> 2969c: 70 91 9b 04 lds r23, 0x049B ; 0x80049b <_ZL8minttemp.lto_priv.473+0x1> 296a0: 80 91 18 06 lds r24, 0x0618 ; 0x800618 296a4: 90 91 19 06 lds r25, 0x0619 ; 0x800619 296a8: 68 17 cp r22, r24 296aa: 79 07 cpc r23, r25 296ac: 0c f0 brlt .+2 ; 0x296b0 296ae: 55 c0 rjmp .+170 ; 0x2975a // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 296b0: c0 91 0e 06 lds r28, 0x060E ; 0x80060e 296b4: c1 11 cpse r28, r1 296b6: 18 c0 rjmp .+48 ; 0x296e8 296b8: 6b 5f subi r22, 0xFB ; 251 296ba: 7f 4f sbci r23, 0xFF ; 255 296bc: 07 2e mov r0, r23 296be: 00 0c add r0, r0 296c0: 88 0b sbc r24, r24 296c2: 99 0b sbc r25, r25 296c4: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 296c8: 9b 01 movw r18, r22 296ca: ac 01 movw r20, r24 296cc: c1 e0 ldi r28, 0x01 ; 1 296ce: 60 91 17 05 lds r22, 0x0517 ; 0x800517 296d2: 70 91 18 05 lds r23, 0x0518 ; 0x800518 296d6: 80 91 19 05 lds r24, 0x0519 ; 0x800519 296da: 90 91 1a 05 lds r25, 0x051A ; 0x80051a 296de: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 296e2: 18 16 cp r1, r24 296e4: 0c f0 brlt .+2 ; 0x296e8 296e6: c0 e0 ldi r28, 0x00 ; 0 296e8: c0 93 0e 06 sts 0x060E, r28 ; 0x80060e if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 296ec: 68 e9 ldi r22, 0x98 ; 152 296ee: 7a e3 ldi r23, 0x3A ; 58 296f0: 8b e0 ldi r24, 0x0B ; 11 296f2: 96 e0 ldi r25, 0x06 ; 6 296f4: 0f 94 af 3e call 0x27d5e ; 0x27d5e ::expired_cont(unsigned short)> 296f8: 81 11 cpse r24, r1 296fa: 02 c0 rjmp .+4 ; 0x29700 296fc: cc 23 and r28, r28 296fe: 29 f0 breq .+10 ; 0x2970a bCheckingOnHeater=true; // not necessary 29700: 81 e0 ldi r24, 0x01 ; 1 29702: 80 93 0e 06 sts 0x060E, r24 ; 0x80060e check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active 29706: 0f 94 b6 44 call 0x2896c ; 0x2896c // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 2970a: 80 91 11 06 lds r24, 0x0611 ; 0x800611 2970e: 90 91 12 06 lds r25, 0x0612 ; 0x800612 29712: 0b 97 sbiw r24, 0x0b ; 11 29714: 4c f1 brlt .+82 ; 0x29768 // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 29716: c0 91 0a 06 lds r28, 0x060A ; 0x80060a 2971a: c1 11 cpse r28, r1 2971c: 0c c0 rjmp .+24 ; 0x29736 2971e: c1 e0 ldi r28, 0x01 ; 1 29720: 20 e0 ldi r18, 0x00 ; 0 29722: 30 e0 ldi r19, 0x00 ; 0 29724: 40 e7 ldi r20, 0x70 ; 112 29726: 51 e4 ldi r21, 0x41 ; 65 29728: c7 01 movw r24, r14 2972a: b6 01 movw r22, r12 2972c: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 29730: 18 16 cp r1, r24 29732: 0c f0 brlt .+2 ; 0x29736 29734: c0 e0 ldi r28, 0x00 ; 0 29736: c0 93 0a 06 sts 0x060A, r28 ; 0x80060a if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 2973a: 60 e5 ldi r22, 0x50 ; 80 2973c: 73 ec ldi r23, 0xC3 ; 195 2973e: 87 e0 ldi r24, 0x07 ; 7 29740: 96 e0 ldi r25, 0x06 ; 6 29742: 0f 94 af 3e call 0x27d5e ; 0x27d5e ::expired_cont(unsigned short)> 29746: 81 11 cpse r24, r1 29748: 02 c0 rjmp .+4 ; 0x2974e 2974a: cc 23 and r28, r28 2974c: 99 f0 breq .+38 ; 0x29774 bCheckingOnBed=true; // not necessary 2974e: 81 e0 ldi r24, 0x01 ; 1 29750: 80 93 0a 06 sts 0x060A, r24 ; 0x80060a #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 29754: 0f 94 a5 44 call 0x2894a ; 0x2894a 29758: 0d c0 rjmp .+26 ; 0x29774 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 2975a: 8b e0 ldi r24, 0x0B ; 11 2975c: 96 e0 ldi r25, 0x06 ; 6 2975e: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> bCheckingOnHeater=false; 29762: 10 92 0e 06 sts 0x060E, r1 ; 0x80060e 29766: d1 cf rjmp .-94 ; 0x2970a check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 29768: 87 e0 ldi r24, 0x07 ; 7 2976a: 96 e0 ldi r25, 0x06 ; 6 2976c: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> bCheckingOnBed=false; 29770: 10 92 0a 06 sts 0x060A, r1 ; 0x80060a 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); 29774: 60 91 16 05 lds r22, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 29778: 70 e0 ldi r23, 0x00 ; 0 2977a: 90 e0 ldi r25, 0x00 ; 0 2977c: 80 e0 ldi r24, 0x00 ; 0 2977e: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 29782: 6b 01 movw r12, r22 29784: 7c 01 movw r14, r24 29786: 40 90 17 05 lds r4, 0x0517 ; 0x800517 2978a: 50 90 18 05 lds r5, 0x0518 ; 0x800518 2978e: 60 90 19 05 lds r6, 0x0519 ; 0x800519 29792: 70 90 1a 05 lds r7, 0x051A ; 0x80051a 29796: 60 91 18 06 lds r22, 0x0618 ; 0x800618 2979a: 70 91 19 06 lds r23, 0x0619 ; 0x800619 2979e: 07 2e mov r0, r23 297a0: 00 0c add r0, r0 297a2: 88 0b sbc r24, r24 297a4: 99 0b sbc r25, r25 297a6: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 297aa: ab 01 movw r20, r22 297ac: bc 01 movw r22, r24 297ae: a1 2c mov r10, r1 297b0: 93 01 movw r18, r6 297b2: 82 01 movw r16, r4 297b4: 81 e0 ldi r24, 0x01 ; 1 297b6: 0f 94 c7 44 call 0x2898e ; 0x2898e #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 297ba: 60 91 17 06 lds r22, 0x0617 ; 0x800617 297be: 70 e0 ldi r23, 0x00 ; 0 297c0: 90 e0 ldi r25, 0x00 ; 0 297c2: 80 e0 ldi r24, 0x00 ; 0 297c4: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 297c8: 6b 01 movw r12, r22 297ca: 7c 01 movw r14, r24 297cc: 40 90 13 06 lds r4, 0x0613 ; 0x800613 297d0: 50 90 14 06 lds r5, 0x0614 ; 0x800614 297d4: 60 90 15 06 lds r6, 0x0615 ; 0x800615 297d8: 70 90 16 06 lds r7, 0x0616 ; 0x800616 297dc: 60 91 11 06 lds r22, 0x0611 ; 0x800611 297e0: 70 91 12 06 lds r23, 0x0612 ; 0x800612 297e4: 07 2e mov r0, r23 297e6: 00 0c add r0, r0 297e8: 88 0b sbc r24, r24 297ea: 99 0b sbc r25, r25 297ec: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 297f0: ab 01 movw r20, r22 297f2: bc 01 movw r22, r24 297f4: aa 24 eor r10, r10 297f6: a3 94 inc r10 297f8: 93 01 movw r18, r6 297fa: 82 01 movw r16, r4 297fc: 80 e0 ldi r24, 0x00 ; 0 297fe: 0f 94 c7 44 call 0x2898e ; 0x2898e return true; } static void check() { if(!enabled) return; 29802: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZN13thermal_modelL7enabledE.lto_priv.468> 29806: 88 23 and r24, r24 29808: 09 f4 brne .+2 ; 0x2980c 2980a: bc c0 rjmp .+376 ; 0x29984 uint8_t heater_pwm = soft_pwm[0]; 2980c: c0 91 16 05 lds r28, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> uint8_t fan_pwm = soft_pwm_fan; 29810: d0 91 9c 04 lds r29, 0x049C ; 0x80049c <_ZL12soft_pwm_fan.lto_priv.472> float heater_temp = current_temperature_isr[0]; 29814: 40 90 17 05 lds r4, 0x0517 ; 0x800517 29818: 50 90 18 05 lds r5, 0x0518 ; 0x800518 2981c: 60 90 19 05 lds r6, 0x0519 ; 0x800519 29820: 70 90 1a 05 lds r7, 0x051A ; 0x80051a float ambient_temp = current_temperature_ambient_isr; 29824: c0 90 1a 06 lds r12, 0x061A ; 0x80061a 29828: d0 90 1b 06 lds r13, 0x061B ; 0x80061b 2982c: e0 90 1c 06 lds r14, 0x061C ; 0x80061c 29830: f0 90 1d 06 lds r15, 0x061D ; 0x80061d // 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) 29834: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 29838: 80 ff sbrs r24, 0 2983a: 72 c0 rjmp .+228 ; 0x29920 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); 2983c: 20 91 c1 12 lds r18, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x36> 29840: 30 91 c2 12 lds r19, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x37> 29844: 40 91 c3 12 lds r20, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x38> 29848: 50 91 c4 12 lds r21, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x39> 2984c: 61 e7 ldi r22, 0x71 ; 113 2984e: 7d e3 ldi r23, 0x3D ; 61 29850: 8a e8 ldi r24, 0x8A ; 138 29852: 9e e3 ldi r25, 0x3E ; 62 29854: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 29858: 60 93 18 13 sts 0x1318, r22 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8d> 2985c: 70 93 19 13 sts 0x1319, r23 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8e> 29860: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.394+0x8f> 29864: 90 93 1b 13 sts 0x131B, r25 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.394+0x90> warn_s = warn * TEMP_MGR_INTV; 29868: 21 e7 ldi r18, 0x71 ; 113 2986a: 3d e3 ldi r19, 0x3D ; 61 2986c: 4a e8 ldi r20, 0x8A ; 138 2986e: 5e e3 ldi r21, 0x3E ; 62 29870: 60 91 0f 13 lds r22, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 29874: 70 91 10 13 lds r23, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 29878: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 2987c: 90 91 12 13 lds r25, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> 29880: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 29884: 60 93 1c 13 sts 0x131C, r22 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.394+0x91> 29888: 70 93 1d 13 sts 0x131D, r23 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.394+0x92> 2988c: 80 93 1e 13 sts 0x131E, r24 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.394+0x93> 29890: 90 93 1f 13 sts 0x131F, r25 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.394+0x94> err_s = err * TEMP_MGR_INTV; 29894: 21 e7 ldi r18, 0x71 ; 113 29896: 3d e3 ldi r19, 0x3D ; 61 29898: 4a e8 ldi r20, 0x8A ; 138 2989a: 5e e3 ldi r21, 0x3E ; 62 2989c: 60 91 13 13 lds r22, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.394+0x88> 298a0: 70 91 14 13 lds r23, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.394+0x89> 298a4: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8a> 298a8: 90 91 16 13 lds r25, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8b> 298ac: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 298b0: 60 93 20 13 sts 0x1320, r22 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.394+0x95> 298b4: 70 93 21 13 sts 0x1321, r23 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.394+0x96> 298b8: 80 93 22 13 sts 0x1322, r24 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.394+0x97> 298bc: 90 93 23 13 sts 0x1323, r25 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.394+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 298c0: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.394+0x3e> 298c4: 90 91 ca 12 lds r25, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.394+0x3f> 298c8: 6e e0 ldi r22, 0x0E ; 14 298ca: 71 e0 ldi r23, 0x01 ; 1 298cc: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 298d0: 60 93 ab 12 sts 0x12AB, r22 ; 0x8012ab <_ZN13thermal_modelL4dataE.lto_priv.394+0x20> 298d4: eb e8 ldi r30, 0x8B ; 139 298d6: f2 e1 ldi r31, 0x12 ; 18 298d8: 8b ea ldi r24, 0xAB ; 171 298da: 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; 298dc: 40 e0 ldi r20, 0x00 ; 0 298de: 50 e0 ldi r21, 0x00 ; 0 298e0: 60 ec ldi r22, 0xC0 ; 192 298e2: 7f e7 ldi r23, 0x7F ; 127 298e4: 41 93 st Z+, r20 298e6: 51 93 st Z+, r21 298e8: 61 93 st Z+, r22 298ea: 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) 298ec: 8e 17 cp r24, r30 298ee: 9f 07 cpc r25, r31 298f0: c9 f7 brne .-14 ; 0x298e4 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 298f2: 10 92 ac 12 sts 0x12AC, r1 ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.394+0x21> dT_err_prev = 0; 298f6: 10 92 ad 12 sts 0x12AD, r1 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 298fa: 10 92 ae 12 sts 0x12AE, r1 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 298fe: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 29902: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> T_prev = NAN; 29906: 40 93 b1 12 sts 0x12B1, r20 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.394+0x26> 2990a: 50 93 b2 12 sts 0x12B2, r21 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.394+0x27> 2990e: 60 93 b3 12 sts 0x12B3, r22 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.394+0x28> 29912: 70 93 b4 12 sts 0x12B4, r23 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.394+0x29> // clear the initialization flag flag_bits.uninitialized = false; 29916: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 2991a: 8e 7f andi r24, 0xFE ; 254 2991c: 80 93 17 13 sts 0x1317, r24 ; 0x801317 <_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); 29920: 87 01 movw r16, r14 29922: 76 01 movw r14, r12 29924: a3 01 movw r20, r6 29926: 92 01 movw r18, r4 29928: 6d 2f mov r22, r29 2992a: 8c 2f mov r24, r28 2992c: 0e 94 e5 da call 0x1b5ca ; 0x1b5ca // handle errors if(data.flag_bits.error) 29930: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 29934: 81 ff sbrs r24, 1 29936: 05 c0 rjmp .+10 ; 0x29942 set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 29938: 44 e0 ldi r20, 0x04 ; 4 2993a: 60 e0 ldi r22, 0x00 ; 0 2993c: 80 e0 ldi r24, 0x00 ; 0 2993e: 0f 94 3c 44 call 0x28878 ; 0x28878 // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 29942: 90 91 17 13 lds r25, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.394+0x8c> 29946: 80 91 33 06 lds r24, 0x0633 ; 0x800633 2994a: 92 fb bst r25, 2 2994c: 81 f9 bld r24, 1 2994e: 80 93 33 06 sts 0x0633, r24 ; 0x800633 if(warning_state.assert) { 29952: 80 91 33 06 lds r24, 0x0633 ; 0x800633 29956: 81 ff sbrs r24, 1 29958: 15 c0 rjmp .+42 ; 0x29984 warning_state.warning = true; 2995a: 80 91 33 06 lds r24, 0x0633 ; 0x800633 2995e: 81 60 ori r24, 0x01 ; 1 29960: 80 93 33 06 sts 0x0633, r24 ; 0x800633 warning_state.dT_err = thermal_model::data.dT_err_prev; 29964: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.394+0x22> 29968: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.394+0x23> 2996c: a0 91 af 12 lds r26, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.394+0x24> 29970: b0 91 b0 12 lds r27, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.394+0x25> 29974: 80 93 2f 06 sts 0x062F, r24 ; 0x80062f 29978: 90 93 30 06 sts 0x0630, r25 ; 0x800630 2997c: a0 93 31 06 sts 0x0631, r26 ; 0x800631 29980: b0 93 32 06 sts 0x0632, r27 ; 0x800632 (int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b); } static void log_isr() { if(!log_buf.enabled) return; 29984: 80 91 2e 06 lds r24, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x10> 29988: 88 23 and r24, r24 2998a: 09 f4 brne .+2 ; 0x2998e 2998c: 3f c0 rjmp .+126 ; 0x29a0c uint32_t stamp = _millis(); 2998e: 0f 94 55 3e call 0x27caa ; 0x27caa uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 29992: c0 90 1e 06 lds r12, 0x061E ; 0x80061e <_ZN13thermal_modelL7log_bufE.lto_priv.555> 29996: d0 90 1f 06 lds r13, 0x061F ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x1> 2999a: e0 90 20 06 lds r14, 0x0620 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x2> 2999e: f0 90 21 06 lds r15, 0x0621 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x3> log_buf.entry.stamp = stamp; 299a2: 60 93 1e 06 sts 0x061E, r22 ; 0x80061e <_ZN13thermal_modelL7log_bufE.lto_priv.555> 299a6: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x1> 299aa: 80 93 20 06 sts 0x0620, r24 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x2> 299ae: 90 93 21 06 sts 0x0621, r25 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x3> ++log_buf.entry.counter; 299b2: 20 91 23 06 lds r18, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x5> 299b6: 2f 5f subi r18, 0xFF ; 255 299b8: 20 93 23 06 sts 0x0623, r18 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.555+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); 299bc: 6c 19 sub r22, r12 299be: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 299c0: 60 93 22 06 sts 0x0622, r22 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 299c4: 80 91 16 05 lds r24, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 299c8: 80 93 24 06 sts 0x0624, r24 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 299cc: 80 91 17 05 lds r24, 0x0517 ; 0x800517 299d0: 90 91 18 05 lds r25, 0x0518 ; 0x800518 299d4: a0 91 19 05 lds r26, 0x0519 ; 0x800519 299d8: b0 91 1a 05 lds r27, 0x051A ; 0x80051a 299dc: 80 93 25 06 sts 0x0625, r24 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x7> 299e0: 90 93 26 06 sts 0x0626, r25 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x8> 299e4: a0 93 27 06 sts 0x0627, r26 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x9> 299e8: b0 93 28 06 sts 0x0628, r27 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 299ec: 80 91 1a 06 lds r24, 0x061A ; 0x80061a 299f0: 90 91 1b 06 lds r25, 0x061B ; 0x80061b 299f4: a0 91 1c 06 lds r26, 0x061C ; 0x80061c 299f8: b0 91 1d 06 lds r27, 0x061D ; 0x80061d 299fc: 80 93 29 06 sts 0x0629, r24 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xb> 29a00: 90 93 2a 06 sts 0x062A, r25 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xc> 29a04: a0 93 2b 06 sts 0x062B, r26 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xd> 29a08: b0 93 2c 06 sts 0x062C, r27 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xe> thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 29a0c: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.470> 29a10: 88 23 and r24, r24 29a12: 91 f0 breq .+36 ; 0x29a38 temp_mgr_pid(); } 29a14: df 91 pop r29 29a16: cf 91 pop r28 29a18: 1f 91 pop r17 29a1a: 0f 91 pop r16 29a1c: ff 90 pop r15 29a1e: ef 90 pop r14 29a20: df 90 pop r13 29a22: cf 90 pop r12 29a24: af 90 pop r10 29a26: 7f 90 pop r7 29a28: 6f 90 pop r6 29a2a: 5f 90 pop r5 29a2c: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 29a2e: 0d 94 e4 1d jmp 0x23bc8 ; 0x23bc8 // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 29a32: 0f 94 b6 44 call 0x2896c ; 0x2896c 29a36: 8e ce rjmp .-740 ; 0x29754 #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 29a38: df 91 pop r29 29a3a: cf 91 pop r28 29a3c: 1f 91 pop r17 29a3e: 0f 91 pop r16 29a40: ff 90 pop r15 29a42: ef 90 pop r14 29a44: df 90 pop r13 29a46: cf 90 pop r12 29a48: af 90 pop r10 29a4a: 7f 90 pop r7 29a4c: 6f 90 pop r6 29a4e: 5f 90 pop r5 29a50: 4f 90 pop r4 29a52: 08 95 ret 00029a54 <__vector_47>: ISR(TIMERx_COMPA_vect) { 29a54: 1f 92 push r1 29a56: 0f 92 push r0 29a58: 0f b6 in r0, 0x3f ; 63 29a5a: 0f 92 push r0 29a5c: 11 24 eor r1, r1 29a5e: 0b b6 in r0, 0x3b ; 59 29a60: 0f 92 push r0 29a62: 2f 93 push r18 29a64: 3f 93 push r19 29a66: 4f 93 push r20 29a68: 5f 93 push r21 29a6a: 6f 93 push r22 29a6c: 7f 93 push r23 29a6e: 8f 93 push r24 29a70: 9f 93 push r25 29a72: af 93 push r26 29a74: bf 93 push r27 29a76: ef 93 push r30 29a78: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 29a7a: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16adc_values_ready.lto_priv.469> 29a7e: 88 23 and r24, r24 29a80: 91 f0 breq .+36 ; 0x29aa6 <__vector_47+0x52> adc_values_ready = false; 29a82: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16adc_values_ready.lto_priv.469> adc_start_cycle(); 29a86: 0e 94 0d 90 call 0x1201a ; 0x1201a // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 29a8a: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29a8e: 8d 7f andi r24, 0xFD ; 253 29a90: 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(); 29a94: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 29a96: 0f 94 c3 4a call 0x29586 ; 0x29586 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 29a9a: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 29a9c: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29aa0: 82 60 ori r24, 0x02 ; 2 29aa2: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 29aa6: ff 91 pop r31 29aa8: ef 91 pop r30 29aaa: bf 91 pop r27 29aac: af 91 pop r26 29aae: 9f 91 pop r25 29ab0: 8f 91 pop r24 29ab2: 7f 91 pop r23 29ab4: 6f 91 pop r22 29ab6: 5f 91 pop r21 29ab8: 4f 91 pop r20 29aba: 3f 91 pop r19 29abc: 2f 91 pop r18 29abe: 0f 90 pop r0 29ac0: 0b be out 0x3b, r0 ; 59 29ac2: 0f 90 pop r0 29ac4: 0f be out 0x3f, r0 ; 63 29ac6: 0f 90 pop r0 29ac8: 1f 90 pop r1 29aca: 18 95 reti 00029acc : } void handle_temp_error(); void manage_heater() { 29acc: 6f 92 push r6 29ace: 7f 92 push r7 29ad0: 8f 92 push r8 29ad2: 9f 92 push r9 29ad4: af 92 push r10 29ad6: bf 92 push r11 29ad8: cf 92 push r12 29ada: df 92 push r13 29adc: ef 92 push r14 29ade: ff 92 push r15 29ae0: 0f 93 push r16 29ae2: 1f 93 push r17 29ae4: cf 93 push r28 29ae6: df 93 push r29 29ae8: 1f 92 push r1 29aea: cd b7 in r28, 0x3d ; 61 29aec: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 29aee: 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) 29af0: 80 91 fc 05 lds r24, 0x05FC ; 0x8005fc 29af4: 88 23 and r24, r24 29af6: 09 f4 brne .+2 ; 0x29afa 29af8: bb c0 rjmp .+374 ; 0x29c70 return; // syncronize temperatures with isr updateTemperatures(); 29afa: 0f 94 87 47 call 0x28f0e ; 0x28f0e #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 29afe: 80 91 33 06 lds r24, 0x0633 ; 0x800633 29b02: 80 ff sbrs r24, 0 29b04: 51 c0 rjmp .+162 ; 0x29ba8 } static void handle_warning() { // update values float warn = data.warn; 29b06: 10 91 0f 13 lds r17, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.394+0x84> 29b0a: 00 91 10 13 lds r16, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.394+0x85> 29b0e: b0 90 11 13 lds r11, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.394+0x86> 29b12: a0 90 12 13 lds r10, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.394+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 29b16: ce 01 movw r24, r28 29b18: 01 96 adiw r24, 0x01 ; 1 29b1a: 0f 94 a8 46 call 0x28d50 ; 0x28d50 dT_err = warning_state.dT_err; 29b1e: c0 90 2f 06 lds r12, 0x062F ; 0x80062f 29b22: d0 90 30 06 lds r13, 0x0630 ; 0x800630 29b26: e0 90 31 06 lds r14, 0x0631 ; 0x800631 29b2a: f0 90 32 06 lds r15, 0x0632 ; 0x800632 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 29b2e: ce 01 movw r24, r28 29b30: 01 96 adiw r24, 0x01 ; 1 29b32: 0f 94 9b 46 call 0x28d36 ; 0x28d36 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); 29b36: af 92 push r10 29b38: bf 92 push r11 29b3a: 0f 93 push r16 29b3c: 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 29b3e: 21 e7 ldi r18, 0x71 ; 113 29b40: 3d e3 ldi r19, 0x3D ; 61 29b42: 4a e8 ldi r20, 0x8A ; 138 29b44: 5e e3 ldi r21, 0x3E ; 62 29b46: c7 01 movw r24, r14 29b48: b6 01 movw r22, r12 29b4a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 29b4e: 9f 93 push r25 29b50: 8f 93 push r24 29b52: 7f 93 push r23 29b54: 6f 93 push r22 29b56: 85 e7 ldi r24, 0x75 ; 117 29b58: 9d e9 ldi r25, 0x9D ; 157 29b5a: 9f 93 push r25 29b5c: 8f 93 push r24 29b5e: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 static bool first = true; if(warning_state.assert) { 29b62: 90 91 33 06 lds r25, 0x0633 ; 0x800633 29b66: 0f b6 in r0, 0x3f ; 63 29b68: f8 94 cli 29b6a: de bf out 0x3e, r29 ; 62 29b6c: 0f be out 0x3f, r0 ; 63 29b6e: cd bf out 0x3d, r28 ; 61 29b70: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.467> 29b74: 91 ff sbrs r25, 1 29b76: 93 c0 rjmp .+294 ; 0x29c9e if (first) { 29b78: 90 91 7b 02 lds r25, 0x027B ; 0x80027b 29b7c: 99 23 and r25, r25 29b7e: 09 f4 brne .+2 ; 0x29b82 29b80: 87 c0 rjmp .+270 ; 0x29c90 if(warn_beep) { 29b82: 88 23 and r24, r24 29b84: 79 f0 breq .+30 ; 0x29ba4 lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 29b86: 84 e4 ldi r24, 0x44 ; 68 29b88: 9a e4 ldi r25, 0x4A ; 74 29b8a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 29b8e: 61 e0 ldi r22, 0x01 ; 1 29b90: 0f 94 bd 05 call 0x20b7a ; 0x20b7a WRITE(BEEPER, HIGH); 29b94: 9f b7 in r25, 0x3f ; 63 29b96: f8 94 cli 29b98: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29b9c: 84 60 ori r24, 0x04 ; 4 29b9e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29ba2: 9f bf out 0x3f, r25 ; 63 } first = false; 29ba4: 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) 29ba8: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29bac: 88 23 and r24, r24 29bae: 89 f0 breq .+34 ; 0x29bd2 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29bb0: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29bb4: 82 95 swap r24 29bb6: 86 95 lsr r24 29bb8: 87 70 andi r24, 0x07 ; 7 29bba: 84 30 cpi r24, 0x04 ; 4 29bbc: 08 f0 brcs .+2 ; 0x29bc0 29bbe: 82 c0 rjmp .+260 ; 0x29cc4 29bc0: 82 30 cpi r24, 0x02 ; 2 29bc2: 08 f0 brcs .+2 ; 0x29bc6 29bc4: 1d c1 rjmp .+570 ; 0x29e00 29bc6: 88 23 and r24, r24 29bc8: 09 f4 brne .+2 ; 0x29bcc 29bca: f4 c0 rjmp .+488 ; 0x29db4 29bcc: 81 30 cpi r24, 0x01 ; 1 29bce: 09 f4 brne .+2 ; 0x29bd2 29bd0: 94 c0 rjmp .+296 ; 0x29cfa // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 29bd2: 0e 94 1e 82 call 0x1043c ; 0x1043c } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 29bd6: 80 91 2e 06 lds r24, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x10> 29bda: 88 23 and r24, r24 29bdc: 09 f4 brne .+2 ; 0x29be0 29bde: 48 c0 rjmp .+144 ; 0x29c70 uint8_t counter = log_buf.entry.counter; 29be0: 80 91 23 06 lds r24, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x5> if (counter == log_buf.serial) return; 29be4: 70 90 2d 06 lds r7, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xf> 29be8: 87 15 cp r24, r7 29bea: 09 f4 brne .+2 ; 0x29bee 29bec: 41 c0 rjmp .+130 ; 0x29c70 // 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; 29bee: ce 01 movw r24, r28 29bf0: 01 96 adiw r24, 0x01 ; 1 29bf2: 0f 94 a8 46 call 0x28d50 ; 0x28d50 delta_ms = log_buf.entry.delta_ms; 29bf6: 00 91 22 06 lds r16, 0x0622 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x4> counter = log_buf.entry.counter; 29bfa: 10 91 23 06 lds r17, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x5> cur_pwm = log_buf.entry.cur_pwm; 29bfe: 60 90 24 06 lds r6, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x6> cur_temp = log_buf.entry.cur_temp; 29c02: c0 90 25 06 lds r12, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x7> 29c06: d0 90 26 06 lds r13, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x8> 29c0a: e0 90 27 06 lds r14, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0x9> 29c0e: f0 90 28 06 lds r15, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xa> cur_amb = log_buf.entry.cur_amb; 29c12: 80 90 29 06 lds r8, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xb> 29c16: 90 90 2a 06 lds r9, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xc> 29c1a: a0 90 2b 06 lds r10, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xd> 29c1e: b0 90 2c 06 lds r11, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.555+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; 29c22: ce 01 movw r24, r28 29c24: 01 96 adiw r24, 0x01 ; 1 29c26: 0f 94 9b 46 call 0x28d36 ; 0x28d36 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; 29c2a: 10 93 2d 06 sts 0x062D, r17 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.555+0xf> printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 29c2e: bf 92 push r11 29c30: af 92 push r10 29c32: 9f 92 push r9 29c34: 8f 92 push r8 29c36: ff 92 push r15 29c38: ef 92 push r14 29c3a: df 92 push r13 29c3c: cf 92 push r12 29c3e: 1f 92 push r1 29c40: 6f 92 push r6 29c42: 80 2f mov r24, r16 29c44: 00 0f add r16, r16 29c46: 99 0b sbc r25, r25 29c48: 01 96 adiw r24, 0x01 ; 1 29c4a: 9f 93 push r25 29c4c: 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; 29c4e: 81 2f mov r24, r17 29c50: 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, 29c52: 81 50 subi r24, 0x01 ; 1 29c54: 99 0b sbc r25, r25 29c56: 9f 93 push r25 29c58: 8f 93 push r24 29c5a: 88 ef ldi r24, 0xF8 ; 248 29c5c: 9c e9 ldi r25, 0x9C ; 156 29c5e: 9f 93 push r25 29c60: 8f 93 push r24 29c62: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 29c66: 0f b6 in r0, 0x3f ; 63 29c68: f8 94 cli 29c6a: de bf out 0x3e, r29 ; 62 29c6c: 0f be out 0x3f, r0 ; 63 29c6e: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 29c70: 0f 90 pop r0 29c72: df 91 pop r29 29c74: cf 91 pop r28 29c76: 1f 91 pop r17 29c78: 0f 91 pop r16 29c7a: ff 90 pop r15 29c7c: ef 90 pop r14 29c7e: df 90 pop r13 29c80: cf 90 pop r12 29c82: bf 90 pop r11 29c84: af 90 pop r10 29c86: 9f 90 pop r9 29c88: 8f 90 pop r8 29c8a: 7f 90 pop r7 29c8c: 6f 90 pop r6 29c8e: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 29c90: 88 23 and r24, r24 29c92: 09 f4 brne .+2 ; 0x29c96 29c94: 89 cf rjmp .-238 ; 0x29ba8 29c96: 84 e0 ldi r24, 0x04 ; 4 29c98: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 29c9c: 85 cf rjmp .-246 ; 0x29ba8 } } else { // warning cleared, reset state warning_state.warning = false; 29c9e: 90 91 33 06 lds r25, 0x0633 ; 0x800633 29ca2: 9e 7f andi r25, 0xFE ; 254 29ca4: 90 93 33 06 sts 0x0633, r25 ; 0x800633 if(warn_beep) WRITE(BEEPER, LOW); 29ca8: 88 23 and r24, r24 29caa: 41 f0 breq .+16 ; 0x29cbc 29cac: 9f b7 in r25, 0x3f ; 63 29cae: f8 94 cli 29cb0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cb4: 8b 7f andi r24, 0xFB ; 251 29cb6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cba: 9f bf out 0x3f, r25 ; 63 first = true; 29cbc: 81 e0 ldi r24, 0x01 ; 1 29cbe: 80 93 7b 02 sts 0x027B, r24 ; 0x80027b 29cc2: 72 cf rjmp .-284 ; 0x29ba8 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29cc4: 84 30 cpi r24, 0x04 ; 4 29cc6: 09 f0 breq .+2 ; 0x29cca 29cc8: 84 cf rjmp .-248 ; 0x29bd2 #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 29cca: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29cce: 81 ff sbrs r24, 1 29cd0: b4 c0 rjmp .+360 ; 0x29e3a if(IsStopped() == false) { 29cd2: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29cd6: 81 11 cpse r24, r1 29cd8: 04 c0 rjmp .+8 ; 0x29ce2 SERIAL_ECHOLNPGM("TM: error triggered!"); 29cda: 80 e6 ldi r24, 0x60 ; 96 29cdc: 9d e9 ldi r25, 0x9D ; 157 29cde: 0e 94 97 7b call 0xf72e ; 0xf72e } ThermalStop(true); 29ce2: 81 e0 ldi r24, 0x01 ; 1 29ce4: 0e 94 c8 7b call 0xf790 ; 0xf790 WRITE(BEEPER, HIGH); 29ce8: 9f b7 in r25, 0x3f ; 63 29cea: f8 94 cli 29cec: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cf0: 84 60 ori r24, 0x04 ; 4 29cf2: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29cf6: 9f bf out 0x3f, r25 ; 63 29cf8: 6c cf rjmp .-296 ; 0x29bd2 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 29cfa: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29cfe: 86 95 lsr r24 29d00: 86 95 lsr r24 29d02: 83 70 andi r24, 0x03 ; 3 29d04: 81 30 cpi r24, 0x01 ; 1 29d06: d9 f1 breq .+118 ; 0x29d7e 29d08: 58 f0 brcs .+22 ; 0x29d20 29d0a: 82 30 cpi r24, 0x02 ; 2 29d0c: 09 f0 breq .+2 ; 0x29d10 29d0e: 61 cf rjmp .-318 ; 0x29bd2 } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 29d10: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29d14: 81 11 cpse r24, r1 29d16: 14 c0 rjmp .+40 ; 0x29d40 temp_error_messagepgm(PSTR("MINTEMP AMB")); 29d18: 61 e0 ldi r22, 0x01 ; 1 29d1a: 82 e2 ldi r24, 0x22 ; 34 29d1c: 9d e9 ldi r25, 0x9D ; 157 29d1e: 0e c0 rjmp .+28 ; 0x29d3c // 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) { 29d20: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29d24: 81 ff sbrs r24, 1 29d26: 10 c0 rjmp .+32 ; 0x29d48 min_temp_error(temp_error_state.index); 29d28: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29d2c: 62 95 swap r22 29d2e: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 29d30: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29d34: 81 11 cpse r24, r1 29d36: 04 c0 rjmp .+8 ; 0x29d40 temp_error_messagepgm(err, e); 29d38: 8e e0 ldi r24, 0x0E ; 14 29d3a: 9d e9 ldi r25, 0x9D ; 157 29d3c: 0f 94 06 41 call 0x2820c ; 0x2820c prusa_statistics(92); } ThermalStop(); 29d40: 80 e0 ldi r24, 0x00 ; 0 29d42: 0e 94 c8 7b call 0xf790 ; 0xf790 29d46: 45 cf rjmp .-374 ; 0x29bd2 // 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); 29d48: 60 91 9a 04 lds r22, 0x049A ; 0x80049a <_ZL8minttemp.lto_priv.473> 29d4c: 70 91 9b 04 lds r23, 0x049B ; 0x80049b <_ZL8minttemp.lto_priv.473+0x1> 29d50: 6b 5f subi r22, 0xFB ; 251 29d52: 7f 4f sbci r23, 0xFF ; 255 29d54: 07 2e mov r0, r23 29d56: 00 0c add r0, r0 29d58: 88 0b sbc r24, r24 29d5a: 99 0b sbc r25, r25 29d5c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 29d60: 8b 01 movw r16, r22 29d62: 9c 01 movw r18, r24 29d64: 40 91 5e 0e lds r20, 0x0E5E ; 0x800e5e 29d68: 50 91 5f 0e lds r21, 0x0E5F ; 0x800e5f 29d6c: 60 91 60 0e lds r22, 0x0E60 ; 0x800e60 29d70: 70 91 61 0e lds r23, 0x0E61 ; 0x800e61 29d74: 87 e7 ldi r24, 0x77 ; 119 29d76: 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); 29d78: 0f 94 02 31 call 0x26204 ; 0x26204 29d7c: 2a cf rjmp .-428 ; 0x29bd2 // 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) { 29d7e: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29d82: 81 ff sbrs r24, 1 29d84: 08 c0 rjmp .+16 ; 0x29d96 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 29d86: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29d8a: 81 11 cpse r24, r1 29d8c: d9 cf rjmp .-78 ; 0x29d40 temp_error_messagepgm(err); 29d8e: 61 e0 ldi r22, 0x01 ; 1 29d90: 86 e1 ldi r24, 0x16 ; 22 29d92: 9d e9 ldi r25, 0x9D ; 157 29d94: d3 cf rjmp .-90 ; 0x29d3c 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); 29d96: 40 91 ee 04 lds r20, 0x04EE ; 0x8004ee 29d9a: 50 91 ef 04 lds r21, 0x04EF ; 0x8004ef 29d9e: 60 91 f0 04 lds r22, 0x04F0 ; 0x8004f0 29da2: 70 91 f1 04 lds r23, 0x04F1 ; 0x8004f1 29da6: 00 e0 ldi r16, 0x00 ; 0 29da8: 10 e0 ldi r17, 0x00 ; 0 29daa: 20 e7 ldi r18, 0x70 ; 112 29dac: 31 e4 ldi r19, 0x41 ; 65 29dae: 83 e7 ldi r24, 0x73 ; 115 29db0: 92 e0 ldi r25, 0x02 ; 2 29db2: e2 cf rjmp .-60 ; 0x29d78 break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 29db4: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29db8: 86 95 lsr r24 29dba: 86 95 lsr r24 29dbc: 83 70 andi r24, 0x03 ; 3 29dbe: 81 30 cpi r24, 0x01 ; 1 29dc0: b9 f0 breq .+46 ; 0x29df0 29dc2: 58 f0 brcs .+22 ; 0x29dda 29dc4: 82 30 cpi r24, 0x02 ; 2 29dc6: 09 f0 breq .+2 ; 0x29dca 29dc8: 04 cf rjmp .-504 ; 0x29bd2 } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 29dca: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29dce: 81 11 cpse r24, r1 29dd0: b7 cf rjmp .-146 ; 0x29d40 temp_error_messagepgm(PSTR("MAXTEMP AMB")); 29dd2: 61 e0 ldi r22, 0x01 ; 1 29dd4: 82 e4 ldi r24, 0x42 ; 66 29dd6: 9d e9 ldi r25, 0x9D ; 157 29dd8: b1 cf rjmp .-158 ; 0x29d3c } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 29dda: 60 91 1b 05 lds r22, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29dde: 62 95 swap r22 29de0: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 29de2: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29de6: 81 11 cpse r24, r1 29de8: ab cf rjmp .-170 ; 0x29d40 temp_error_messagepgm(PSTR("MAXTEMP"), e); 29dea: 8e e2 ldi r24, 0x2E ; 46 29dec: 9d e9 ldi r25, 0x9D ; 157 29dee: a6 cf rjmp .-180 ; 0x29d3c } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 29df0: 80 91 11 05 lds r24, 0x0511 ; 0x800511 29df4: 81 11 cpse r24, r1 29df6: a4 cf rjmp .-184 ; 0x29d40 temp_error_messagepgm(PSTR("MAXTEMP BED")); 29df8: 61 e0 ldi r22, 0x01 ; 1 29dfa: 86 e3 ldi r24, 0x36 ; 54 29dfc: 9d e9 ldi r25, 0x9D ; 157 29dfe: 9e cf rjmp .-196 ; 0x29d3c #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 29e00: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29e04: 86 95 lsr r24 29e06: 86 95 lsr r24 29e08: 83 70 andi r24, 0x03 ; 3 29e0a: 82 30 cpi r24, 0x02 ; 2 29e0c: 08 f0 brcs .+2 ; 0x29e10 29e0e: e1 ce rjmp .-574 ; 0x29bd2 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 29e10: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29e14: 86 95 lsr r24 29e16: 86 95 lsr r24 29e18: 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), 29e1a: 90 91 1b 05 lds r25, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29e1e: 92 95 swap r25 29e20: 96 95 lsr r25 29e22: 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( 29e24: 61 e0 ldi r22, 0x01 ; 1 29e26: 81 30 cpi r24, 0x01 ; 1 29e28: 09 f0 breq .+2 ; 0x29e2c 29e2a: 60 e0 ldi r22, 0x00 ; 0 29e2c: 81 e0 ldi r24, 0x01 ; 1 29e2e: 92 30 cpi r25, 0x02 ; 2 29e30: 09 f0 breq .+2 ; 0x29e34 29e32: 80 e0 ldi r24, 0x00 ; 0 29e34: 0f 94 3b 31 call 0x26276 ; 0x26276 29e38: cc ce rjmp .-616 ; 0x29bd2 SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 29e3a: 10 92 1b 05 sts 0x051B, r1 ; 0x80051b <_ZL16temp_error_state.lto_priv.466> WRITE(BEEPER, LOW); 29e3e: 9f b7 in r25, 0x3f ; 63 29e40: f8 94 cli 29e42: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e46: 8b 7f andi r24, 0xFB ; 251 29e48: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e4c: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 29e4e: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 29e52: 90 91 69 0e lds r25, 0x0E69 ; 0x800e69 29e56: 89 2b or r24, r25 29e58: 39 f4 brne .+14 ; 0x29e68 target_temperature_bed = saved_bed_temperature; 29e5a: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 29e5e: 90 e0 ldi r25, 0x00 ; 0 29e60: 90 93 69 0e sts 0x0E69, r25 ; 0x800e69 29e64: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 SERIAL_ECHOLNPGM("TM: error cleared"); 29e68: 8e e4 ldi r24, 0x4E ; 78 29e6a: 9d e9 ldi r25, 0x9D ; 157 29e6c: 0e 94 97 7b call 0xf72e ; 0xf72e 29e70: b0 ce rjmp .-672 ; 0x29bd2 00029e72 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 29e72: 4f 92 push r4 29e74: 5f 92 push r5 29e76: 6f 92 push r6 29e78: 7f 92 push r7 29e7a: 8f 92 push r8 29e7c: 9f 92 push r9 29e7e: af 92 push r10 29e80: bf 92 push r11 29e82: cf 92 push r12 29e84: df 92 push r13 29e86: ef 92 push r14 29e88: ff 92 push r15 29e8a: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 29e8c: 0f 94 55 3e call 0x27caa ; 0x27caa 29e90: 28 ee ldi r18, 0xE8 ; 232 29e92: 33 e0 ldi r19, 0x03 ; 3 29e94: 40 e0 ldi r20, 0x00 ; 0 29e96: 50 e0 ldi r21, 0x00 ; 0 29e98: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 29e9c: 29 01 movw r4, r18 29e9e: 3a 01 movw r6, r20 lcd_consume_click(); 29ea0: 0e 94 3e 72 call 0xe47c ; 0xe47c KEEPALIVE_STATE(PAUSED_FOR_USER); 29ea4: 84 e0 ldi r24, 0x04 ; 4 29ea6: 80 93 96 02 sts 0x0296, r24 ; 0x800296 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 29eaa: f1 2c mov r15, r1 29eac: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 29eae: 0f 94 66 4d call 0x29acc ; 0x29acc manage_inactivity(true); 29eb2: 81 e0 ldi r24, 0x01 ; 1 29eb4: 0e 94 6b 8c call 0x118d6 ; 0x118d6 bDelayed = ((_millis()/1000-nTime0) > nDelay); 29eb8: 0f 94 55 3e call 0x27caa ; 0x27caa 29ebc: 28 ee ldi r18, 0xE8 ; 232 29ebe: 33 e0 ldi r19, 0x03 ; 3 29ec0: 40 e0 ldi r20, 0x00 ; 0 29ec2: 50 e0 ldi r21, 0x00 ; 0 29ec4: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 29ec8: 49 01 movw r8, r18 29eca: 5a 01 movw r10, r20 29ecc: 84 18 sub r8, r4 29ece: 95 08 sbc r9, r5 29ed0: a6 08 sbc r10, r6 29ed2: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 29ed4: 0e 94 43 72 call 0xe486 ; 0xe486 29ed8: 81 11 cpse r24, r1 29eda: 07 c0 rjmp .+14 ; 0x29eea 29edc: c8 14 cp r12, r8 29ede: d9 04 cpc r13, r9 29ee0: ea 04 cpc r14, r10 29ee2: fb 04 cpc r15, r11 29ee4: 20 f7 brcc .-56 ; 0x29eae 29ee6: 81 e0 ldi r24, 0x01 ; 1 29ee8: 07 c0 rjmp .+14 ; 0x29ef8 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 29eea: 81 e0 ldi r24, 0x01 ; 1 29eec: c8 14 cp r12, r8 29eee: d9 04 cpc r13, r9 29ef0: ea 04 cpc r14, r10 29ef2: fb 04 cpc r15, r11 29ef4: 08 f0 brcs .+2 ; 0x29ef8 29ef6: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 29ef8: 92 e0 ldi r25, 0x02 ; 2 29efa: 90 93 96 02 sts 0x0296, r25 ; 0x800296 return(!bDelayed); } } } 29efe: 91 e0 ldi r25, 0x01 ; 1 29f00: 89 27 eor r24, r25 29f02: ff 90 pop r15 29f04: ef 90 pop r14 29f06: df 90 pop r13 29f08: cf 90 pop r12 29f0a: bf 90 pop r11 29f0c: af 90 pop r10 29f0e: 9f 90 pop r9 29f10: 8f 90 pop r8 29f12: 7f 90 pop r7 29f14: 6f 90 pop r6 29f16: 5f 90 pop r5 29f18: 4f 90 pop r4 29f1a: 08 95 ret 00029f1c : #endif } static void waiting_handler() { manage_heater(); 29f1c: 0f 94 66 4d call 0x29acc ; 0x29acc host_keepalive(); 29f20: 0e 94 c3 81 call 0x10386 ; 0x10386 host_autoreport(); 29f24: 0e 94 74 7b call 0xf6e8 ; 0xf6e8 checkFans(); 29f28: 0e 94 1e 82 call 0x1043c ; 0x1043c lcd_update(0); 29f2c: 80 e0 ldi r24, 0x00 ; 0 29f2e: 0c 94 ed 6f jmp 0xdfda ; 0xdfda 00029f32 : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 29f32: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 29f36: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 29f3a: 65 50 subi r22, 0x05 ; 5 29f3c: 71 09 sbc r23, r1 29f3e: 07 2e mov r0, r23 29f40: 00 0c add r0, r0 29f42: 88 0b sbc r24, r24 29f44: 99 0b sbc r25, r25 29f46: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 29f4a: 9b 01 movw r18, r22 29f4c: ac 01 movw r20, r24 29f4e: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 29f52: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 29f56: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 29f5a: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 29f5e: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 29f62: 87 ff sbrs r24, 7 29f64: 07 c0 rjmp .+14 ; 0x29f74 if(temp_error_state.v) break; 29f66: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29f6a: 81 11 cpse r24, r1 29f6c: 03 c0 rjmp .+6 ; 0x29f74 waiting_handler(); 29f6e: 0f 94 8e 4f call 0x29f1c ; 0x29f1c 29f72: df cf rjmp .-66 ; 0x29f32 } } 29f74: 08 95 ret 00029f76 : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 29f76: cf 92 push r12 29f78: df 92 push r13 29f7a: ef 92 push r14 29f7c: ff 92 push r15 29f7e: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 29f80: 0f 94 55 3e call 0x27caa ; 0x27caa 29f84: 9b 01 movw r18, r22 29f86: ac 01 movw r20, r24 29f88: 2e 0d add r18, r14 29f8a: 3f 1d adc r19, r15 29f8c: 41 1d adc r20, r1 29f8e: 51 1d adc r21, r1 29f90: 69 01 movw r12, r18 29f92: 7a 01 movw r14, r20 while(_millis() < mark) { 29f94: 0f 94 55 3e call 0x27caa ; 0x27caa 29f98: 6c 15 cp r22, r12 29f9a: 7d 05 cpc r23, r13 29f9c: 8e 05 cpc r24, r14 29f9e: 9f 05 cpc r25, r15 29fa0: 38 f4 brcc .+14 ; 0x29fb0 if(temp_error_state.v) break; 29fa2: 80 91 1b 05 lds r24, 0x051B ; 0x80051b <_ZL16temp_error_state.lto_priv.466> 29fa6: 81 11 cpse r24, r1 29fa8: 03 c0 rjmp .+6 ; 0x29fb0 waiting_handler(); 29faa: 0f 94 8e 4f call 0x29f1c ; 0x29f1c 29fae: f2 cf rjmp .-28 ; 0x29f94 } } 29fb0: ff 90 pop r15 29fb2: ef 90 pop r14 29fb4: df 90 pop r13 29fb6: cf 90 pop r12 29fb8: 08 95 ret 00029fba : 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; 29fba: 20 91 d7 06 lds r18, 0x06D7 ; 0x8006d7 29fbe: 30 91 d8 06 lds r19, 0x06D8 ; 0x8006d8 29fc2: 40 91 d9 06 lds r20, 0x06D9 ; 0x8006d9 29fc6: 50 91 da 06 lds r21, 0x06DA ; 0x8006da 29fca: 60 e0 ldi r22, 0x00 ; 0 29fcc: 70 e0 ldi r23, 0x00 ; 0 29fce: 8f e7 ldi r24, 0x7F ; 127 29fd0: 93 e4 ldi r25, 0x43 ; 67 29fd2: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 29fd6: 60 93 a6 04 sts 0x04A6, r22 ; 0x8004a6 <_ZL14iState_sum_max.lto_priv.481> 29fda: 70 93 a7 04 sts 0x04A7, r23 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.481+0x1> 29fde: 80 93 a8 04 sts 0x04A8, r24 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.481+0x2> 29fe2: 90 93 a9 04 sts 0x04A9, r25 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.481+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 29fe6: 20 91 e3 06 lds r18, 0x06E3 ; 0x8006e3 29fea: 30 91 e4 06 lds r19, 0x06E4 ; 0x8006e4 29fee: 40 91 e5 06 lds r20, 0x06E5 ; 0x8006e5 29ff2: 50 91 e6 06 lds r21, 0x06E6 ; 0x8006e6 29ff6: 60 e0 ldi r22, 0x00 ; 0 29ff8: 70 e0 ldi r23, 0x00 ; 0 29ffa: 8f e7 ldi r24, 0x7F ; 127 29ffc: 93 e4 ldi r25, 0x43 ; 67 29ffe: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 2a002: 60 93 9e 04 sts 0x049E, r22 ; 0x80049e <_ZL19temp_iState_max_bed.lto_priv.479> 2a006: 70 93 9f 04 sts 0x049F, r23 ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.479+0x1> 2a00a: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.479+0x2> 2a00e: 90 93 a1 04 sts 0x04A1, r25 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.479+0x3> #endif } 2a012: 08 95 ret 0002a014 : #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) { 2a014: 2f 92 push r2 2a016: 3f 92 push r3 2a018: 4f 92 push r4 2a01a: 5f 92 push r5 2a01c: 6f 92 push r6 2a01e: 7f 92 push r7 2a020: 8f 92 push r8 2a022: 9f 92 push r9 2a024: af 92 push r10 2a026: bf 92 push r11 2a028: cf 92 push r12 2a02a: df 92 push r13 2a02c: ef 92 push r14 2a02e: ff 92 push r15 2a030: 0f 93 push r16 2a032: 1f 93 push r17 2a034: cf 93 push r28 2a036: df 93 push r29 2a038: cd b7 in r28, 0x3d ; 61 2a03a: de b7 in r29, 0x3e ; 62 2a03c: e0 97 sbiw r28, 0x30 ; 48 2a03e: 0f b6 in r0, 0x3f ; 63 2a040: f8 94 cli 2a042: de bf out 0x3e, r29 ; 62 2a044: 0f be out 0x3f, r0 ; 63 2a046: cd bf out 0x3d, r28 ; 61 2a048: 6a 87 std Y+10, r22 ; 0x0a 2a04a: 7b 87 std Y+11, r23 ; 0x0b 2a04c: 8c 87 std Y+12, r24 ; 0x0c 2a04e: 9d 87 std Y+13, r25 ; 0x0d 2a050: 1a 01 movw r2, r20 2a052: 3a a7 std Y+42, r19 ; 0x2a 2a054: 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(); 2a056: 0f 94 21 44 call 0x28842 ; 0x28842 pid_tuning_finished = false; 2a05a: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.470> // 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; 2a05e: 29 a5 ldd r18, Y+41 ; 0x29 2a060: 3a a5 ldd r19, Y+42 ; 0x2a 2a062: 30 93 42 06 sts 0x0642, r19 ; 0x800642 2a066: 20 93 41 06 sts 0x0641, r18 ; 0x800641 float input = 0.0; pid_cycle=0; 2a06a: 10 92 44 06 sts 0x0644, r1 ; 0x800644 2a06e: 10 92 43 06 sts 0x0643, r1 ; 0x800643 bool heating = true; unsigned long temp_millis = _millis(); 2a072: 0f 94 55 3e call 0x27caa ; 0x27caa 2a076: 6e 83 std Y+6, r22 ; 0x06 2a078: 7f 83 std Y+7, r23 ; 0x07 2a07a: 88 87 std Y+8, r24 ; 0x08 2a07c: 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 2a07e: 37 fe sbrs r3, 7 2a080: ff c0 rjmp .+510 ; 0x2a280 2a082: 3d e2 ldi r19, 0x2D ; 45 2a084: 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(); 2a086: 0f 94 55 3e call 0x27caa ; 0x27caa 2a08a: 6c a3 std Y+36, r22 ; 0x24 2a08c: 7d a3 std Y+37, r23 ; 0x25 2a08e: 8e a3 std Y+38, r24 ; 0x26 2a090: 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."); 2a092: 8e ec ldi r24, 0xCE ; 206 2a094: 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) 2a096: 12 14 cp r1, r2 2a098: 13 04 cpc r1, r3 2a09a: 0c f4 brge .+2 ; 0x2a09e 2a09c: 8a c2 rjmp .+1300 ; 0x2a5b2 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 2a09e: 8b eb ldi r24, 0xBB ; 187 2a0a0: 9c e9 ldi r25, 0x9C ; 156 2a0a2: 0e 94 97 7b call 0xf72e ; 0xf72e 2a0a6: 6a 85 ldd r22, Y+10 ; 0x0a 2a0a8: 7b 85 ldd r23, Y+11 ; 0x0b 2a0aa: 8c 85 ldd r24, Y+12 ; 0x0c 2a0ac: 9d 85 ldd r25, Y+13 ; 0x0d 2a0ae: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 2a0b2: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 2a0b4: 21 14 cp r2, r1 2a0b6: 31 04 cpc r3, r1 2a0b8: 09 f4 brne .+2 ; 0x2a0bc 2a0ba: e5 c0 rjmp .+458 ; 0x2a286 { soft_pwm_bed = (MAX_BED_POWER)/2; 2a0bc: 20 93 17 06 sts 0x0617, r18 ; 0x800617 bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 2a0c0: 70 93 69 0e sts 0x0E69, r23 ; 0x800e69 2a0c4: 60 93 68 0e sts 0x0E68, r22 ; 0x800e68 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 2a0c8: 8e 81 ldd r24, Y+6 ; 0x06 2a0ca: 9f 81 ldd r25, Y+7 ; 0x07 2a0cc: a8 85 ldd r26, Y+8 ; 0x08 2a0ce: b9 85 ldd r27, Y+9 ; 0x09 2a0d0: 8e 87 std Y+14, r24 ; 0x0e 2a0d2: 9f 87 std Y+15, r25 ; 0x0f 2a0d4: a8 8b std Y+16, r26 ; 0x10 2a0d6: b9 8b std Y+17, r27 ; 0x11 2a0d8: 88 a3 std Y+32, r24 ; 0x20 2a0da: 99 a3 std Y+33, r25 ; 0x21 2a0dc: aa a3 std Y+34, r26 ; 0x22 2a0de: bb a3 std Y+35, r27 ; 0x23 2a0e0: 1a 8a std Y+18, r1 ; 0x12 2a0e2: 90 e4 ldi r25, 0x40 ; 64 2a0e4: 9b 8b std Y+19, r25 ; 0x13 2a0e6: ac e1 ldi r26, 0x1C ; 28 2a0e8: ac 8b std Y+20, r26 ; 0x14 2a0ea: b6 e4 ldi r27, 0x46 ; 70 2a0ec: bd 8b std Y+21, r27 ; 0x15 2a0ee: 1e 8a std Y+22, r1 ; 0x16 2a0f0: 1f 8a std Y+23, r1 ; 0x17 2a0f2: 18 8e std Y+24, r1 ; 0x18 2a0f4: 19 8e std Y+25, r1 ; 0x19 2a0f6: 6f e7 ldi r22, 0x7F ; 127 2a0f8: c6 2e mov r12, r22 2a0fa: d1 2c mov r13, r1 2a0fc: e1 2c mov r14, r1 2a0fe: f1 2c mov r15, r1 2a100: 00 e0 ldi r16, 0x00 ; 0 2a102: 10 e0 ldi r17, 0x00 ; 0 2a104: 18 aa std Y+48, r1 ; 0x30 2a106: 1f a6 std Y+47, r1 ; 0x2f 2a108: 1d 82 std Y+5, r1 ; 0x05 2a10a: 2f e7 ldi r18, 0x7F ; 127 2a10c: 30 e0 ldi r19, 0x00 ; 0 2a10e: 40 e0 ldi r20, 0x00 ; 0 2a110: 50 e0 ldi r21, 0x00 ; 0 2a112: 29 83 std Y+1, r18 ; 0x01 2a114: 3a 83 std Y+2, r19 ; 0x02 2a116: 4b 83 std Y+3, r20 ; 0x03 2a118: 5c 83 std Y+4, r21 ; 0x04 2a11a: 1b 8e std Y+27, r1 ; 0x1b 2a11c: 1c 8e std Y+28, r1 ; 0x1c 2a11e: 1d 8e std Y+29, r1 ; 0x1d 2a120: 1e 8e std Y+30, r1 ; 0x1e 2a122: 31 e0 ldi r19, 0x01 ; 1 2a124: 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(); 2a126: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2a128: 40 91 fc 05 lds r20, 0x05FC ; 0x8005fc 2a12c: 48 a7 std Y+40, r20 ; 0x28 2a12e: 44 23 and r20, r20 2a130: 09 f4 brne .+2 ; 0x2a134 2a132: 2c c2 rjmp .+1112 ; 0x2a58c updateTemperatures(); 2a134: 0f 94 87 47 call 0x28f0e ; 0x28f0e input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a138: 21 14 cp r2, r1 2a13a: 31 04 cpc r3, r1 2a13c: 09 f0 breq .+2 ; 0x2a140 2a13e: aa c0 rjmp .+340 ; 0x2a294 2a140: 00 91 5e 0e lds r16, 0x0E5E ; 0x800e5e 2a144: 10 91 5f 0e lds r17, 0x0E5F ; 0x800e5f 2a148: 50 91 60 0e lds r21, 0x0E60 ; 0x800e60 2a14c: 58 ab std Y+48, r21 ; 0x30 2a14e: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 2a152: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2a154: 2e 89 ldd r18, Y+22 ; 0x16 2a156: 3f 89 ldd r19, Y+23 ; 0x17 2a158: 48 8d ldd r20, Y+24 ; 0x18 2a15a: 59 8d ldd r21, Y+25 ; 0x19 2a15c: b8 01 movw r22, r16 2a15e: 88 a9 ldd r24, Y+48 ; 0x30 2a160: 9f a5 ldd r25, Y+47 ; 0x2f 2a162: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2a166: 87 fd sbrc r24, 7 2a168: 06 c0 rjmp .+12 ; 0x2a176 2a16a: 0e 8b std Y+22, r16 ; 0x16 2a16c: 1f 8b std Y+23, r17 ; 0x17 2a16e: b8 a9 ldd r27, Y+48 ; 0x30 2a170: b8 8f std Y+24, r27 ; 0x18 2a172: 2f a5 ldd r18, Y+47 ; 0x2f 2a174: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 2a176: 2a 89 ldd r18, Y+18 ; 0x12 2a178: 3b 89 ldd r19, Y+19 ; 0x13 2a17a: 4c 89 ldd r20, Y+20 ; 0x14 2a17c: 5d 89 ldd r21, Y+21 ; 0x15 2a17e: b8 01 movw r22, r16 2a180: 88 a9 ldd r24, Y+48 ; 0x30 2a182: 9f a5 ldd r25, Y+47 ; 0x2f 2a184: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2a188: 18 16 cp r1, r24 2a18a: 34 f0 brlt .+12 ; 0x2a198 2a18c: 0a 8b std Y+18, r16 ; 0x12 2a18e: 1b 8b std Y+19, r17 ; 0x13 2a190: 38 a9 ldd r19, Y+48 ; 0x30 2a192: 3c 8b std Y+20, r19 ; 0x14 2a194: 4f a5 ldd r20, Y+47 ; 0x2f 2a196: 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) { 2a198: 0f 94 55 3e call 0x27caa ; 0x27caa 2a19c: 2c a1 ldd r18, Y+36 ; 0x24 2a19e: 3d a1 ldd r19, Y+37 ; 0x25 2a1a0: 4e a1 ldd r20, Y+38 ; 0x26 2a1a2: 5f a1 ldd r21, Y+39 ; 0x27 2a1a4: 62 1b sub r22, r18 2a1a6: 73 0b sbc r23, r19 2a1a8: 84 0b sbc r24, r20 2a1aa: 95 0b sbc r25, r21 2a1ac: 65 3c cpi r22, 0xC5 ; 197 2a1ae: 79 40 sbci r23, 0x09 ; 9 2a1b0: 81 05 cpc r24, r1 2a1b2: 91 05 cpc r25, r1 2a1b4: 40 f0 brcs .+16 ; 0x2a1c6 checkExtruderAutoFans(); 2a1b6: 0e 94 c3 77 call 0xef86 ; 0xef86 extruder_autofan_last_check = _millis(); 2a1ba: 0f 94 55 3e call 0x27caa ; 0x27caa 2a1be: 6c a3 std Y+36, r22 ; 0x24 2a1c0: 7d a3 std Y+37, r23 ; 0x25 2a1c2: 8e a3 std Y+38, r24 ; 0x26 2a1c4: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 2a1c6: 4a 8d ldd r20, Y+26 ; 0x1a 2a1c8: 44 23 and r20, r20 2a1ca: 09 f4 brne .+2 ; 0x2a1ce 2a1cc: 4c c0 rjmp .+152 ; 0x2a266 2a1ce: 2a 85 ldd r18, Y+10 ; 0x0a 2a1d0: 3b 85 ldd r19, Y+11 ; 0x0b 2a1d2: 4c 85 ldd r20, Y+12 ; 0x0c 2a1d4: 5d 85 ldd r21, Y+13 ; 0x0d 2a1d6: b8 01 movw r22, r16 2a1d8: 88 a9 ldd r24, Y+48 ; 0x30 2a1da: 9f a5 ldd r25, Y+47 ; 0x2f 2a1dc: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2a1e0: 18 16 cp r1, r24 2a1e2: 0c f0 brlt .+2 ; 0x2a1e6 2a1e4: d3 c1 rjmp .+934 ; 0x2a58c if(_millis() - t2 > 5000) { 2a1e6: 0f 94 55 3e call 0x27caa ; 0x27caa 2a1ea: 2e 85 ldd r18, Y+14 ; 0x0e 2a1ec: 3f 85 ldd r19, Y+15 ; 0x0f 2a1ee: 48 89 ldd r20, Y+16 ; 0x10 2a1f0: 59 89 ldd r21, Y+17 ; 0x11 2a1f2: 62 1b sub r22, r18 2a1f4: 73 0b sbc r23, r19 2a1f6: 84 0b sbc r24, r20 2a1f8: 95 0b sbc r25, r21 2a1fa: 69 38 cpi r22, 0x89 ; 137 2a1fc: 73 41 sbci r23, 0x13 ; 19 2a1fe: 81 05 cpc r24, r1 2a200: 91 05 cpc r25, r1 2a202: 08 f4 brcc .+2 ; 0x2a206 2a204: c3 c1 rjmp .+902 ; 0x2a58c 2a206: d7 01 movw r26, r14 2a208: c6 01 movw r24, r12 2a20a: 29 81 ldd r18, Y+1 ; 0x01 2a20c: 3a 81 ldd r19, Y+2 ; 0x02 2a20e: 4b 81 ldd r20, Y+3 ; 0x03 2a210: 5c 81 ldd r21, Y+4 ; 0x04 2a212: 82 1b sub r24, r18 2a214: 93 0b sbc r25, r19 2a216: a4 0b sbc r26, r20 2a218: b5 0b sbc r27, r21 2a21a: b5 95 asr r27 2a21c: a7 95 ror r26 2a21e: 97 95 ror r25 2a220: 87 95 ror r24 heating=false; if (extruder<0) { 2a222: 21 14 cp r2, r1 2a224: 31 04 cpc r3, r1 2a226: 09 f4 brne .+2 ; 0x2a22a 2a228: 40 c0 rjmp .+128 ; 0x2a2aa soft_pwm_bed = (bias - d) >> 1; 2a22a: 80 93 17 06 sts 0x0617, r24 ; 0x800617 } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 2a22e: 0f 94 55 3e call 0x27caa ; 0x27caa 2a232: 6e 83 std Y+6, r22 ; 0x06 2a234: 7f 83 std Y+7, r23 ; 0x07 2a236: 88 87 std Y+8, r24 ; 0x08 2a238: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 2a23a: dc 01 movw r26, r24 2a23c: cb 01 movw r24, r22 2a23e: 2e 85 ldd r18, Y+14 ; 0x0e 2a240: 3f 85 ldd r19, Y+15 ; 0x0f 2a242: 48 89 ldd r20, Y+16 ; 0x10 2a244: 59 89 ldd r21, Y+17 ; 0x11 2a246: 82 1b sub r24, r18 2a248: 93 0b sbc r25, r19 2a24a: a4 0b sbc r26, r20 2a24c: b5 0b sbc r27, r21 2a24e: 8b 8f std Y+27, r24 ; 0x1b 2a250: 9c 8f std Y+28, r25 ; 0x1c 2a252: ad 8f std Y+29, r26 ; 0x1d 2a254: be 8f std Y+30, r27 ; 0x1e max=temp; 2a256: 3a 85 ldd r19, Y+10 ; 0x0a 2a258: 3e 8b std Y+22, r19 ; 0x16 2a25a: 4b 85 ldd r20, Y+11 ; 0x0b 2a25c: 4f 8b std Y+23, r20 ; 0x17 2a25e: 5c 85 ldd r21, Y+12 ; 0x0c 2a260: 58 8f std Y+24, r21 ; 0x18 2a262: 8d 85 ldd r24, Y+13 ; 0x0d 2a264: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 2a266: 2a 85 ldd r18, Y+10 ; 0x0a 2a268: 3b 85 ldd r19, Y+11 ; 0x0b 2a26a: 4c 85 ldd r20, Y+12 ; 0x0c 2a26c: 5d 85 ldd r21, Y+13 ; 0x0d 2a26e: b8 01 movw r22, r16 2a270: 88 a9 ldd r24, Y+48 ; 0x30 2a272: 9f a5 ldd r25, Y+47 ; 0x2f 2a274: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2a278: 87 fd sbrc r24, 7 2a27a: 1a c0 rjmp .+52 ; 0x2a2b0 if(_millis() - t1 > 5000) { 2a27c: 1a 8e std Y+26, r1 ; 0x1a 2a27e: 86 c1 rjmp .+780 ; 0x2a58c 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 2a280: 4a e0 ldi r20, 0x0A ; 10 2a282: 4f 8f std Y+31, r20 ; 0x1f 2a284: 00 cf rjmp .-512 ; 0x2a086 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; 2a286: 20 93 16 05 sts 0x0516, r18 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 2a28a: 70 93 6b 0e sts 0x0E6B, r23 ; 0x800e6b 2a28e: 60 93 6a 0e sts 0x0E6A, r22 ; 0x800e6a 2a292: 1a cf rjmp .-460 ; 0x2a0c8 wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a294: 00 91 ee 04 lds r16, 0x04EE ; 0x8004ee 2a298: 10 91 ef 04 lds r17, 0x04EF ; 0x8004ef 2a29c: 90 91 f0 04 lds r25, 0x04F0 ; 0x8004f0 2a2a0: 98 ab std Y+48, r25 ; 0x30 2a2a2: a0 91 f1 04 lds r26, 0x04F1 ; 0x8004f1 2a2a6: af a7 std Y+47, r26 ; 0x2f 2a2a8: 55 cf rjmp .-342 ; 0x2a154 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 2a2aa: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 2a2ae: bf cf rjmp .-130 ; 0x2a22e t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 2a2b0: 0f 94 55 3e call 0x27caa ; 0x27caa 2a2b4: 2e 81 ldd r18, Y+6 ; 0x06 2a2b6: 3f 81 ldd r19, Y+7 ; 0x07 2a2b8: 48 85 ldd r20, Y+8 ; 0x08 2a2ba: 59 85 ldd r21, Y+9 ; 0x09 2a2bc: 62 1b sub r22, r18 2a2be: 73 0b sbc r23, r19 2a2c0: 84 0b sbc r24, r20 2a2c2: 95 0b sbc r25, r21 2a2c4: 69 38 cpi r22, 0x89 ; 137 2a2c6: 73 41 sbci r23, 0x13 ; 19 2a2c8: 81 05 cpc r24, r1 2a2ca: 91 05 cpc r25, r1 2a2cc: b8 f2 brcs .-82 ; 0x2a27c heating=true; t2=_millis(); 2a2ce: 0f 94 55 3e call 0x27caa ; 0x27caa 2a2d2: 6e 87 std Y+14, r22 ; 0x0e 2a2d4: 7f 87 std Y+15, r23 ; 0x0f 2a2d6: 88 8b std Y+16, r24 ; 0x10 2a2d8: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 2a2da: 80 91 43 06 lds r24, 0x0643 ; 0x800643 2a2de: 90 91 44 06 lds r25, 0x0644 ; 0x800644 2a2e2: 18 16 cp r1, r24 2a2e4: 19 06 cpc r1, r25 2a2e6: 0c f0 brlt .+2 ; 0x2a2ea 2a2e8: 2c c1 rjmp .+600 ; 0x2a542 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 2a2ea: 8e 85 ldd r24, Y+14 ; 0x0e 2a2ec: 9f 85 ldd r25, Y+15 ; 0x0f 2a2ee: a8 89 ldd r26, Y+16 ; 0x10 2a2f0: b9 89 ldd r27, Y+17 ; 0x11 2a2f2: 2e 81 ldd r18, Y+6 ; 0x06 2a2f4: 3f 81 ldd r19, Y+7 ; 0x07 2a2f6: 48 85 ldd r20, Y+8 ; 0x08 2a2f8: 59 85 ldd r21, Y+9 ; 0x09 2a2fa: 82 1b sub r24, r18 2a2fc: 93 0b sbc r25, r19 2a2fe: a4 0b sbc r26, r20 2a300: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 2a302: 4b 8c ldd r4, Y+27 ; 0x1b 2a304: 5c 8c ldd r5, Y+28 ; 0x1c 2a306: 6d 8c ldd r6, Y+29 ; 0x1d 2a308: 7e 8c ldd r7, Y+30 ; 0x1e 2a30a: 48 0e add r4, r24 2a30c: 59 1e adc r5, r25 2a30e: 6a 1e adc r6, r26 2a310: 7b 1e adc r7, r27 2a312: 2b 8d ldd r18, Y+27 ; 0x1b 2a314: 3c 8d ldd r19, Y+28 ; 0x1c 2a316: 4d 8d ldd r20, Y+29 ; 0x1d 2a318: 5e 8d ldd r21, Y+30 ; 0x1e 2a31a: 28 1b sub r18, r24 2a31c: 39 0b sbc r19, r25 2a31e: 4a 0b sbc r20, r26 2a320: 5b 0b sbc r21, r27 2a322: 69 81 ldd r22, Y+1 ; 0x01 2a324: 7a 81 ldd r23, Y+2 ; 0x02 2a326: 8b 81 ldd r24, Y+3 ; 0x03 2a328: 9c 81 ldd r25, Y+4 ; 0x04 2a32a: 0f 94 72 dd call 0x3bae4 ; 0x3bae4 <__mulsi3> 2a32e: a3 01 movw r20, r6 2a330: 92 01 movw r18, r4 2a332: 0f 94 00 de call 0x3bc00 ; 0x3bc00 <__divmodsi4> 2a336: da 01 movw r26, r20 2a338: c9 01 movw r24, r18 2a33a: 8c 0d add r24, r12 2a33c: 9d 1d adc r25, r13 2a33e: ae 1d adc r26, r14 2a340: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 2a342: 84 31 cpi r24, 0x14 ; 20 2a344: 91 05 cpc r25, r1 2a346: a1 05 cpc r26, r1 2a348: b1 05 cpc r27, r1 2a34a: 0c f4 brge .+2 ; 0x2a34e 2a34c: 3c c1 rjmp .+632 ; 0x2a5c6 2a34e: 6c 01 movw r12, r24 2a350: 7d 01 movw r14, r26 2a352: 3c ee ldi r19, 0xEC ; 236 2a354: c3 16 cp r12, r19 2a356: d1 04 cpc r13, r1 2a358: e1 04 cpc r14, r1 2a35a: f1 04 cpc r15, r1 2a35c: 2c f0 brlt .+10 ; 0x2a368 2a35e: 4b ee ldi r20, 0xEB ; 235 2a360: c4 2e mov r12, r20 2a362: d1 2c mov r13, r1 2a364: e1 2c mov r14, r1 2a366: 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; 2a368: 80 38 cpi r24, 0x80 ; 128 2a36a: 91 05 cpc r25, r1 2a36c: a1 05 cpc r26, r1 2a36e: b1 05 cpc r27, r1 2a370: 0c f4 brge .+2 ; 0x2a374 2a372: 37 c1 rjmp .+622 ; 0x2a5e2 2a374: 8e ef ldi r24, 0xFE ; 254 2a376: 90 e0 ldi r25, 0x00 ; 0 2a378: a0 e0 ldi r26, 0x00 ; 0 2a37a: b0 e0 ldi r27, 0x00 ; 0 2a37c: 8c 19 sub r24, r12 2a37e: 9d 09 sbc r25, r13 2a380: ae 09 sbc r26, r14 2a382: bf 09 sbc r27, r15 2a384: 89 83 std Y+1, r24 ; 0x01 2a386: 9a 83 std Y+2, r25 ; 0x02 2a388: ab 83 std Y+3, r26 ; 0x03 2a38a: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 2a38c: 83 eb ldi r24, 0xB3 ; 179 2a38e: 9c e9 ldi r25, 0x9C ; 156 2a390: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a394: c7 01 movw r24, r14 2a396: b6 01 movw r22, r12 2a398: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 2a39c: 8e ea ldi r24, 0xAE ; 174 2a39e: 9c e9 ldi r25, 0x9C ; 156 2a3a0: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a3a4: 69 81 ldd r22, Y+1 ; 0x01 2a3a6: 7a 81 ldd r23, Y+2 ; 0x02 2a3a8: 8b 81 ldd r24, Y+3 ; 0x03 2a3aa: 9c 81 ldd r25, Y+4 ; 0x04 2a3ac: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 2a3b0: 87 ea ldi r24, 0xA7 ; 167 2a3b2: 9c e9 ldi r25, 0x9C ; 156 2a3b4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2a3b8: 42 e0 ldi r20, 0x02 ; 2 2a3ba: 6a 89 ldd r22, Y+18 ; 0x12 2a3bc: 7b 89 ldd r23, Y+19 ; 0x13 2a3be: 8c 89 ldd r24, Y+20 ; 0x14 2a3c0: 9d 89 ldd r25, Y+21 ; 0x15 2a3c2: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 2a3c6: 80 ea ldi r24, 0xA0 ; 160 2a3c8: 9c e9 ldi r25, 0x9C ; 156 2a3ca: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a3ce: 6e 89 ldd r22, Y+22 ; 0x16 2a3d0: 7f 89 ldd r23, Y+23 ; 0x17 2a3d2: 88 8d ldd r24, Y+24 ; 0x18 2a3d4: 99 8d ldd r25, Y+25 ; 0x19 2a3d6: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 if(pid_cycle > 2) { 2a3da: 80 91 43 06 lds r24, 0x0643 ; 0x800643 2a3de: 90 91 44 06 lds r25, 0x0644 ; 0x800644 2a3e2: 03 97 sbiw r24, 0x03 ; 3 2a3e4: 0c f4 brge .+2 ; 0x2a3e8 2a3e6: ad c0 rjmp .+346 ; 0x2a542 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 2a3e8: 69 81 ldd r22, Y+1 ; 0x01 2a3ea: 7a 81 ldd r23, Y+2 ; 0x02 2a3ec: 8b 81 ldd r24, Y+3 ; 0x03 2a3ee: 9c 81 ldd r25, Y+4 ; 0x04 2a3f0: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2a3f4: 20 e0 ldi r18, 0x00 ; 0 2a3f6: 30 e0 ldi r19, 0x00 ; 0 2a3f8: 40 e8 ldi r20, 0x80 ; 128 2a3fa: 50 e4 ldi r21, 0x40 ; 64 2a3fc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 2a400: 4b 01 movw r8, r22 2a402: 5c 01 movw r10, r24 2a404: 2a 89 ldd r18, Y+18 ; 0x12 2a406: 3b 89 ldd r19, Y+19 ; 0x13 2a408: 4c 89 ldd r20, Y+20 ; 0x14 2a40a: 5d 89 ldd r21, Y+21 ; 0x15 2a40c: 6e 89 ldd r22, Y+22 ; 0x16 2a40e: 7f 89 ldd r23, Y+23 ; 0x17 2a410: 88 8d ldd r24, Y+24 ; 0x18 2a412: 99 8d ldd r25, Y+25 ; 0x19 2a414: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 2a418: 20 ed ldi r18, 0xD0 ; 208 2a41a: 3f e0 ldi r19, 0x0F ; 15 2a41c: 49 e4 ldi r20, 0x49 ; 73 2a41e: 50 e4 ldi r21, 0x40 ; 64 2a420: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 2a424: 20 e0 ldi r18, 0x00 ; 0 2a426: 30 e0 ldi r19, 0x00 ; 0 2a428: 40 e0 ldi r20, 0x00 ; 0 2a42a: 5f e3 ldi r21, 0x3F ; 63 2a42c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 2a430: 9b 01 movw r18, r22 2a432: ac 01 movw r20, r24 2a434: c5 01 movw r24, r10 2a436: b4 01 movw r22, r8 2a438: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 2a43c: 4b 01 movw r8, r22 2a43e: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 2a440: c3 01 movw r24, r6 2a442: b2 01 movw r22, r4 2a444: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 2a448: 20 e0 ldi r18, 0x00 ; 0 2a44a: 30 e0 ldi r19, 0x00 ; 0 2a44c: 4a e7 ldi r20, 0x7A ; 122 2a44e: 54 e4 ldi r21, 0x44 ; 68 2a450: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 2a454: 2b 01 movw r4, r22 2a456: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 2a458: 8a e9 ldi r24, 0x9A ; 154 2a45a: 9c e9 ldi r25, 0x9C ; 156 2a45c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a460: 42 e0 ldi r20, 0x02 ; 2 2a462: c5 01 movw r24, r10 2a464: b4 01 movw r22, r8 2a466: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 2a46a: 84 e9 ldi r24, 0x94 ; 148 2a46c: 9c e9 ldi r25, 0x9C ; 156 2a46e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a472: c3 01 movw r24, r6 2a474: b2 01 movw r22, r4 2a476: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 _Kp = 0.6*Ku; 2a47a: 2a e9 ldi r18, 0x9A ; 154 2a47c: 39 e9 ldi r19, 0x99 ; 153 2a47e: 49 e1 ldi r20, 0x19 ; 25 2a480: 5f e3 ldi r21, 0x3F ; 63 2a482: c5 01 movw r24, r10 2a484: b4 01 movw r22, r8 2a486: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 2a48a: 4b 01 movw r8, r22 2a48c: 5c 01 movw r10, r24 2a48e: 80 92 ec 03 sts 0x03EC, r8 ; 0x8003ec <_Kp> 2a492: 90 92 ed 03 sts 0x03ED, r9 ; 0x8003ed <_Kp+0x1> 2a496: a0 92 ee 03 sts 0x03EE, r10 ; 0x8003ee <_Kp+0x2> 2a49a: b0 92 ef 03 sts 0x03EF, r11 ; 0x8003ef <_Kp+0x3> _Ki = 2*_Kp/Tu; 2a49e: ac 01 movw r20, r24 2a4a0: 9b 01 movw r18, r22 2a4a2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2a4a6: a3 01 movw r20, r6 2a4a8: 92 01 movw r18, r4 2a4aa: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 2a4ae: 60 93 e8 03 sts 0x03E8, r22 ; 0x8003e8 <_Ki> 2a4b2: 70 93 e9 03 sts 0x03E9, r23 ; 0x8003e9 <_Ki+0x1> 2a4b6: 80 93 ea 03 sts 0x03EA, r24 ; 0x8003ea <_Ki+0x2> 2a4ba: 90 93 eb 03 sts 0x03EB, r25 ; 0x8003eb <_Ki+0x3> _Kd = _Kp*Tu/8; 2a4be: a3 01 movw r20, r6 2a4c0: 92 01 movw r18, r4 2a4c2: c5 01 movw r24, r10 2a4c4: b4 01 movw r22, r8 2a4c6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 2a4ca: 20 e0 ldi r18, 0x00 ; 0 2a4cc: 30 e0 ldi r19, 0x00 ; 0 2a4ce: 40 e0 ldi r20, 0x00 ; 0 2a4d0: 5e e3 ldi r21, 0x3E ; 62 2a4d2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 2a4d6: 60 93 e4 03 sts 0x03E4, r22 ; 0x8003e4 <_Kd> 2a4da: 70 93 e5 03 sts 0x03E5, r23 ; 0x8003e5 <_Kd+0x1> 2a4de: 80 93 e6 03 sts 0x03E6, r24 ; 0x8003e6 <_Kd+0x2> 2a4e2: 90 93 e7 03 sts 0x03E7, r25 ; 0x8003e7 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 2a4e6: 86 e8 ldi r24, 0x86 ; 134 2a4e8: 9c e9 ldi r25, 0x9C ; 156 2a4ea: 0e 94 97 7b call 0xf72e ; 0xf72e SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 2a4ee: 80 e8 ldi r24, 0x80 ; 128 2a4f0: 9c e9 ldi r25, 0x9C ; 156 2a4f2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a4f6: 60 91 ec 03 lds r22, 0x03EC ; 0x8003ec <_Kp> 2a4fa: 70 91 ed 03 lds r23, 0x03ED ; 0x8003ed <_Kp+0x1> 2a4fe: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_Kp+0x2> 2a502: 90 91 ef 03 lds r25, 0x03EF ; 0x8003ef <_Kp+0x3> 2a506: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 2a50a: 8a e7 ldi r24, 0x7A ; 122 2a50c: 9c e9 ldi r25, 0x9C ; 156 2a50e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a512: 60 91 e8 03 lds r22, 0x03E8 ; 0x8003e8 <_Ki> 2a516: 70 91 e9 03 lds r23, 0x03E9 ; 0x8003e9 <_Ki+0x1> 2a51a: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Ki+0x2> 2a51e: 90 91 eb 03 lds r25, 0x03EB ; 0x8003eb <_Ki+0x3> 2a522: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 2a526: 84 e7 ldi r24, 0x74 ; 116 2a528: 9c e9 ldi r25, 0x9C ; 156 2a52a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a52e: 60 91 e4 03 lds r22, 0x03E4 ; 0x8003e4 <_Kd> 2a532: 70 91 e5 03 lds r23, 0x03E5 ; 0x8003e5 <_Kd+0x1> 2a536: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_Kd+0x2> 2a53a: 90 91 e7 03 lds r25, 0x03E7 ; 0x8003e7 <_Kd+0x3> 2a53e: 0f 94 53 75 call 0x2eaa6 ; 0x2eaa6 2a542: 89 81 ldd r24, Y+1 ; 0x01 2a544: 9a 81 ldd r25, Y+2 ; 0x02 2a546: ab 81 ldd r26, Y+3 ; 0x03 2a548: bc 81 ldd r27, Y+4 ; 0x04 2a54a: 8c 0d add r24, r12 2a54c: 9d 1d adc r25, r13 2a54e: ae 1d adc r26, r14 2a550: bf 1d adc r27, r15 2a552: b5 95 asr r27 2a554: a7 95 ror r26 2a556: 97 95 ror r25 2a558: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 2a55a: 21 14 cp r2, r1 2a55c: 31 04 cpc r3, r1 2a55e: 09 f4 brne .+2 ; 0x2a562 2a560: 45 c0 rjmp .+138 ; 0x2a5ec { soft_pwm_bed = (bias + d) >> 1; 2a562: 80 93 17 06 sts 0x0617, r24 ; 0x800617 } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 2a566: 80 91 43 06 lds r24, 0x0643 ; 0x800643 2a56a: 90 91 44 06 lds r25, 0x0644 ; 0x800644 2a56e: 01 96 adiw r24, 0x01 ; 1 2a570: 90 93 44 06 sts 0x0644, r25 ; 0x800644 2a574: 80 93 43 06 sts 0x0643, r24 ; 0x800643 min=temp; 2a578: 3a 85 ldd r19, Y+10 ; 0x0a 2a57a: 3a 8b std Y+18, r19 ; 0x12 2a57c: 4b 85 ldd r20, Y+11 ; 0x0b 2a57e: 4b 8b std Y+19, r20 ; 0x13 2a580: 5c 85 ldd r21, Y+12 ; 0x0c 2a582: 5c 8b std Y+20, r21 ; 0x14 2a584: 8d 85 ldd r24, Y+13 ; 0x0d 2a586: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 2a588: 98 a5 ldd r25, Y+40 ; 0x28 2a58a: 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)) { 2a58c: 20 e0 ldi r18, 0x00 ; 0 2a58e: 30 e0 ldi r19, 0x00 ; 0 2a590: 40 ea ldi r20, 0xA0 ; 160 2a592: 51 e4 ldi r21, 0x41 ; 65 2a594: 6a 85 ldd r22, Y+10 ; 0x0a 2a596: 7b 85 ldd r23, Y+11 ; 0x0b 2a598: 8c 85 ldd r24, Y+12 ; 0x0c 2a59a: 9d 85 ldd r25, Y+13 ; 0x0d 2a59c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2a5a0: 98 01 movw r18, r16 2a5a2: 48 a9 ldd r20, Y+48 ; 0x30 2a5a4: 5f a5 ldd r21, Y+47 ; 0x2f 2a5a6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2a5aa: 87 ff sbrs r24, 7 2a5ac: 22 c0 rjmp .+68 ; 0x2a5f2 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 2a5ae: 8a e4 ldi r24, 0x4A ; 74 2a5b0: 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"); 2a5b2: 0e 94 97 7b call 0xf72e ; 0xf72e pid_tuning_finished = true; 2a5b6: 81 e0 ldi r24, 0x01 ; 1 2a5b8: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.470> pid_cycle = 0; 2a5bc: 10 92 44 06 sts 0x0644, r1 ; 0x800644 2a5c0: 10 92 43 06 sts 0x0643, r1 ; 0x800643 2a5c4: 98 c0 rjmp .+304 ; 0x2a6f6 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); 2a5c6: 34 e1 ldi r19, 0x14 ; 20 2a5c8: c3 2e mov r12, r19 2a5ca: d1 2c mov r13, r1 2a5cc: e1 2c mov r14, r1 2a5ce: f1 2c mov r15, r1 2a5d0: 24 e1 ldi r18, 0x14 ; 20 2a5d2: 30 e0 ldi r19, 0x00 ; 0 2a5d4: 40 e0 ldi r20, 0x00 ; 0 2a5d6: 50 e0 ldi r21, 0x00 ; 0 2a5d8: 29 83 std Y+1, r18 ; 0x01 2a5da: 3a 83 std Y+2, r19 ; 0x02 2a5dc: 4b 83 std Y+3, r20 ; 0x03 2a5de: 5c 83 std Y+4, r21 ; 0x04 2a5e0: d5 ce rjmp .-598 ; 0x2a38c 2a5e2: c9 82 std Y+1, r12 ; 0x01 2a5e4: da 82 std Y+2, r13 ; 0x02 2a5e6: eb 82 std Y+3, r14 ; 0x03 2a5e8: fc 82 std Y+4, r15 ; 0x04 2a5ea: d0 ce rjmp .-608 ; 0x2a38c if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 2a5ec: 80 93 16 05 sts 0x0516, r24 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 2a5f0: ba cf rjmp .-140 ; 0x2a566 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 2a5f2: 0f 94 55 3e call 0x27caa ; 0x27caa 2a5f6: 28 a1 ldd r18, Y+32 ; 0x20 2a5f8: 39 a1 ldd r19, Y+33 ; 0x21 2a5fa: 4a a1 ldd r20, Y+34 ; 0x22 2a5fc: 5b a1 ldd r21, Y+35 ; 0x23 2a5fe: 62 1b sub r22, r18 2a600: 73 0b sbc r23, r19 2a602: 84 0b sbc r24, r20 2a604: 95 0b sbc r25, r21 2a606: 61 3d cpi r22, 0xD1 ; 209 2a608: 77 40 sbci r23, 0x07 ; 7 2a60a: 81 05 cpc r24, r1 2a60c: 91 05 cpc r25, r1 2a60e: 58 f1 brcs .+86 ; 0x2a666 int p; if (extruder<0){ p=soft_pwm_bed; 2a610: a0 90 17 06 lds r10, 0x0617 ; 0x800617 2a614: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 2a616: 87 e4 ldi r24, 0x47 ; 71 2a618: 9c e9 ldi r25, 0x9C ; 156 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 2a61a: 21 14 cp r2, r1 2a61c: 31 04 cpc r3, r1 2a61e: 29 f4 brne .+10 ; 0x2a62a p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 2a620: a0 90 16 05 lds r10, 0x0516 ; 0x800516 <_ZL8soft_pwm.lto_priv.471> 2a624: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 2a626: 84 e4 ldi r24, 0x44 ; 68 2a628: 9c e9 ldi r25, 0x9C ; 156 2a62a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2a62e: 42 e0 ldi r20, 0x02 ; 2 2a630: b8 01 movw r22, r16 2a632: 88 a9 ldd r24, Y+48 ; 0x30 2a634: 9f a5 ldd r25, Y+47 ; 0x2f 2a636: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 2a63a: 80 e4 ldi r24, 0x40 ; 64 2a63c: 9c e9 ldi r25, 0x9C ; 156 2a63e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_PROTOCOLLN(p); 2a642: c5 01 movw r24, r10 2a644: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 if (safety_check_cycles == 0) { //save ambient temp 2a648: 4d 81 ldd r20, Y+5 ; 0x05 2a64a: 44 23 and r20, r20 2a64c: 09 f4 brne .+2 ; 0x2a650 2a64e: 6c c0 rjmp .+216 ; 0x2a728 temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 2a650: 5f 8d ldd r21, Y+31 ; 0x1f 2a652: 45 17 cp r20, r21 2a654: 70 f5 brcc .+92 ; 0x2a6b2 safety_check_cycles++; 2a656: 4f 5f subi r20, 0xFF ; 255 2a658: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 2a65a: 0f 94 55 3e call 0x27caa ; 0x27caa 2a65e: 68 a3 std Y+32, r22 ; 0x20 2a660: 79 a3 std Y+33, r23 ; 0x21 2a662: 8a a3 std Y+34, r24 ; 0x22 2a664: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 2a666: 0f 94 55 3e call 0x27caa ; 0x27caa 2a66a: 4b 01 movw r8, r22 2a66c: 5c 01 movw r10, r24 2a66e: 0f 94 55 3e call 0x27caa ; 0x27caa 2a672: 4e 80 ldd r4, Y+6 ; 0x06 2a674: 5f 80 ldd r5, Y+7 ; 0x07 2a676: 68 84 ldd r6, Y+8 ; 0x08 2a678: 79 84 ldd r7, Y+9 ; 0x09 2a67a: 2e 85 ldd r18, Y+14 ; 0x0e 2a67c: 3f 85 ldd r19, Y+15 ; 0x0f 2a67e: 48 89 ldd r20, Y+16 ; 0x10 2a680: 59 89 ldd r21, Y+17 ; 0x11 2a682: 42 0e add r4, r18 2a684: 53 1e adc r5, r19 2a686: 64 1e adc r6, r20 2a688: 75 1e adc r7, r21 2a68a: 84 18 sub r8, r4 2a68c: 95 08 sbc r9, r5 2a68e: a6 08 sbc r10, r6 2a690: b7 08 sbc r11, r7 2a692: 86 0e add r8, r22 2a694: 97 1e adc r9, r23 2a696: a8 1e adc r10, r24 2a698: b9 1e adc r11, r25 2a69a: 31 e8 ldi r19, 0x81 ; 129 2a69c: 83 16 cp r8, r19 2a69e: 3f e4 ldi r19, 0x4F ; 79 2a6a0: 93 06 cpc r9, r19 2a6a2: 32 e1 ldi r19, 0x12 ; 18 2a6a4: a3 06 cpc r10, r19 2a6a6: b1 04 cpc r11, r1 2a6a8: 08 f4 brcc .+2 ; 0x2a6ac 2a6aa: 47 c0 rjmp .+142 ; 0x2a73a SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 2a6ac: 83 e2 ldi r24, 0x23 ; 35 2a6ae: 9c e9 ldi r25, 0x9C ; 156 2a6b0: 80 cf rjmp .-256 ; 0x2a5b2 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 2a6b2: 8d 81 ldd r24, Y+5 ; 0x05 2a6b4: 9f 8d ldd r25, Y+31 ; 0x1f 2a6b6: 89 13 cpse r24, r25 2a6b8: d0 cf rjmp .-96 ; 0x2a65a safety_check_cycles++; 2a6ba: 8f 5f subi r24, 0xFF ; 255 2a6bc: 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) { 2a6be: 2b a5 ldd r18, Y+43 ; 0x2b 2a6c0: 3c a5 ldd r19, Y+44 ; 0x2c 2a6c2: 4d a5 ldd r20, Y+45 ; 0x2d 2a6c4: 5e a5 ldd r21, Y+46 ; 0x2e 2a6c6: b8 01 movw r22, r16 2a6c8: 88 a9 ldd r24, Y+48 ; 0x30 2a6ca: 9f a5 ldd r25, Y+47 ; 0x2f 2a6cc: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 2a6d0: 9f 77 andi r25, 0x7F ; 127 2a6d2: 20 e0 ldi r18, 0x00 ; 0 2a6d4: 30 e0 ldi r19, 0x00 ; 0 2a6d6: 40 ea ldi r20, 0xA0 ; 160 2a6d8: 50 e4 ldi r21, 0x40 ; 64 2a6da: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2a6de: 87 ff sbrs r24, 7 2a6e0: bc cf rjmp .-136 ; 0x2a65a temp_runaway_stop(false, (extruder<0)); 2a6e2: 63 2d mov r22, r3 2a6e4: 66 1f adc r22, r22 2a6e6: 66 27 eor r22, r22 2a6e8: 66 1f adc r22, r22 2a6ea: 80 e0 ldi r24, 0x00 ; 0 2a6ec: 0f 94 3b 31 call 0x26276 ; 0x26276 pid_tuning_finished = true; 2a6f0: 81 e0 ldi r24, 0x01 ; 1 2a6f2: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.470> pid_cycle = 0; return; } lcd_update(0); } } 2a6f6: e0 96 adiw r28, 0x30 ; 48 2a6f8: 0f b6 in r0, 0x3f ; 63 2a6fa: f8 94 cli 2a6fc: de bf out 0x3e, r29 ; 62 2a6fe: 0f be out 0x3f, r0 ; 63 2a700: cd bf out 0x3d, r28 ; 61 2a702: df 91 pop r29 2a704: cf 91 pop r28 2a706: 1f 91 pop r17 2a708: 0f 91 pop r16 2a70a: ff 90 pop r15 2a70c: ef 90 pop r14 2a70e: df 90 pop r13 2a710: cf 90 pop r12 2a712: bf 90 pop r11 2a714: af 90 pop r10 2a716: 9f 90 pop r9 2a718: 8f 90 pop r8 2a71a: 7f 90 pop r7 2a71c: 6f 90 pop r6 2a71e: 5f 90 pop r5 2a720: 4f 90 pop r4 2a722: 3f 90 pop r3 2a724: 2f 90 pop r2 2a726: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 2a728: 0b a7 std Y+43, r16 ; 0x2b 2a72a: 1c a7 std Y+44, r17 ; 0x2c 2a72c: a8 a9 ldd r26, Y+48 ; 0x30 2a72e: ad a7 std Y+45, r26 ; 0x2d 2a730: bf a5 ldd r27, Y+47 ; 0x2f 2a732: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 2a734: 21 e0 ldi r18, 0x01 ; 1 2a736: 2d 83 std Y+5, r18 ; 0x05 2a738: 90 cf rjmp .-224 ; 0x2a65a SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 2a73a: 80 91 43 06 lds r24, 0x0643 ; 0x800643 2a73e: 90 91 44 06 lds r25, 0x0644 ; 0x800644 2a742: 49 a5 ldd r20, Y+41 ; 0x29 2a744: 5a a5 ldd r21, Y+42 ; 0x2a 2a746: 48 17 cp r20, r24 2a748: 59 07 cpc r21, r25 2a74a: 1c f4 brge .+6 ; 0x2a752 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 2a74c: 87 ec ldi r24, 0xC7 ; 199 2a74e: 9b e9 ldi r25, 0x9B ; 155 2a750: 30 cf rjmp .-416 ; 0x2a5b2 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 2a752: 80 e0 ldi r24, 0x00 ; 0 2a754: 0e 94 ed 6f call 0xdfda ; 0xdfda 2a758: e6 cc rjmp .-1588 ; 0x2a126 0002a75a : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 2a75a: 0f 93 push r16 2a75c: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2a75e: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2a762: 81 30 cpi r24, 0x01 ; 1 2a764: 19 f5 brne .+70 ; 0x2a7ac 2a766: 0f 94 55 3e call 0x27caa ; 0x27caa 2a76a: 00 91 a5 05 lds r16, 0x05A5 ; 0x8005a5 2a76e: 10 91 a6 05 lds r17, 0x05A6 ; 0x8005a6 2a772: 20 91 a7 05 lds r18, 0x05A7 ; 0x8005a7 2a776: 30 91 a8 05 lds r19, 0x05A8 ; 0x8005a8 2a77a: 60 1b sub r22, r16 2a77c: 71 0b sbc r23, r17 2a77e: 82 0b sbc r24, r18 2a780: 93 0b sbc r25, r19 2a782: 28 ee ldi r18, 0xE8 ; 232 2a784: 33 e0 ldi r19, 0x03 ; 3 2a786: 40 e0 ldi r20, 0x00 ; 0 2a788: 50 e0 ldi r21, 0x00 ; 0 2a78a: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 2a78e: 60 91 a1 05 lds r22, 0x05A1 ; 0x8005a1 2a792: 70 91 a2 05 lds r23, 0x05A2 ; 0x8005a2 2a796: 80 91 a3 05 lds r24, 0x05A3 ; 0x8005a3 2a79a: 90 91 a4 05 lds r25, 0x05A4 ; 0x8005a4 2a79e: 62 0f add r22, r18 2a7a0: 73 1f adc r23, r19 2a7a2: 84 1f adc r24, r20 2a7a4: 95 1f adc r25, r21 } 2a7a6: 1f 91 pop r17 2a7a8: 0f 91 pop r16 2a7aa: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2a7ac: 60 91 4c 06 lds r22, 0x064C ; 0x80064c 2a7b0: 70 91 4d 06 lds r23, 0x064D ; 0x80064d 2a7b4: 80 91 4e 06 lds r24, 0x064E ; 0x80064e 2a7b8: 90 91 4f 06 lds r25, 0x064F ; 0x80064f 2a7bc: d6 cf rjmp .-84 ; 0x2a76a 0002a7be : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 2a7be: 4f 92 push r4 2a7c0: 5f 92 push r5 2a7c2: 6f 92 push r6 2a7c4: 7f 92 push r7 2a7c6: 8f 92 push r8 2a7c8: 9f 92 push r9 2a7ca: af 92 push r10 2a7cc: bf 92 push r11 2a7ce: cf 92 push r12 2a7d0: df 92 push r13 2a7d2: ef 92 push r14 2a7d4: ff 92 push r15 2a7d6: 0f 93 push r16 2a7d8: 1f 93 push r17 2a7da: cf 93 push r28 2a7dc: df 93 push r29 2a7de: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 2a7e2: 0e 94 d6 68 call 0xd1ac ; 0xd1ac 2a7e6: 88 23 and r24, r24 2a7e8: 09 f4 brne .+2 ; 0x2a7ec 2a7ea: 6e c0 rjmp .+220 ; 0x2a8c8 { const float _met = ((float)total_filament_used) / (100000.f); 2a7ec: 60 91 5f 06 lds r22, 0x065F ; 0x80065f 2a7f0: 70 91 60 06 lds r23, 0x0660 ; 0x800660 2a7f4: 80 91 61 06 lds r24, 0x0661 ; 0x800661 2a7f8: 90 91 62 06 lds r25, 0x0662 ; 0x800662 2a7fc: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 2a800: 20 e0 ldi r18, 0x00 ; 0 2a802: 30 e5 ldi r19, 0x50 ; 80 2a804: 43 ec ldi r20, 0xC3 ; 195 2a806: 57 e4 ldi r21, 0x47 ; 71 2a808: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 2a80c: 56 2e mov r5, r22 2a80e: 47 2e mov r4, r23 2a810: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 2a812: 0f 94 ad 53 call 0x2a75a ; 0x2a75a 2a816: 6b 01 movw r12, r22 2a818: 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(); 2a81a: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_printf_P(_N( 2a81e: 89 e5 ldi r24, 0x59 ; 89 2a820: 9d e4 ldi r25, 0x4D ; 77 2a822: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2a826: 18 2f mov r17, r24 2a828: 09 2f mov r16, r25 2a82a: 89 e4 ldi r24, 0x49 ; 73 2a82c: 9d e4 ldi r25, 0x4D ; 77 2a82e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2a832: 78 2e mov r7, r24 2a834: 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; 2a836: 8c e3 ldi r24, 0x3C ; 60 2a838: 88 2e mov r8, r24 2a83a: 91 2c mov r9, r1 2a83c: a1 2c mov r10, r1 2a83e: b1 2c mov r11, r1 2a840: c7 01 movw r24, r14 2a842: b6 01 movw r22, r12 2a844: a5 01 movw r20, r10 2a846: 94 01 movw r18, r8 2a848: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2a84c: 7f 93 push r23 2a84e: 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; 2a850: ca 01 movw r24, r20 2a852: b9 01 movw r22, r18 2a854: a5 01 movw r20, r10 2a856: 94 01 movw r18, r8 2a858: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2a85c: 7f 93 push r23 2a85e: 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; 2a860: c7 01 movw r24, r14 2a862: b6 01 movw r22, r12 2a864: 20 e1 ldi r18, 0x10 ; 16 2a866: 3e e0 ldi r19, 0x0E ; 14 2a868: 40 e0 ldi r20, 0x00 ; 0 2a86a: 50 e0 ldi r21, 0x00 ; 0 2a86c: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2a870: 5f 93 push r21 2a872: 4f 93 push r20 2a874: 3f 93 push r19 2a876: 2f 93 push r18 2a878: 0f 93 push r16 2a87a: 1f 93 push r17 2a87c: df 93 push r29 2a87e: cf 93 push r28 2a880: 4f 92 push r4 2a882: 5f 92 push r5 2a884: 6f 92 push r6 2a886: 7f 92 push r7 2a888: 80 e9 ldi r24, 0x90 ; 144 2a88a: 90 e7 ldi r25, 0x70 ; 112 2a88c: 9f 93 push r25 2a88e: 8f 93 push r24 2a890: 0e 94 ff 6f call 0xdffe ; 0xdffe "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 2a894: 8d b7 in r24, 0x3d ; 61 2a896: 9e b7 in r25, 0x3e ; 62 2a898: 42 96 adiw r24, 0x12 ; 18 2a89a: 0f b6 in r0, 0x3f ; 63 2a89c: f8 94 cli 2a89e: 9e bf out 0x3e, r25 ; 62 2a8a0: 0f be out 0x3f, r0 ; 63 2a8a2: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 2a8a4: df 91 pop r29 2a8a6: cf 91 pop r28 2a8a8: 1f 91 pop r17 2a8aa: 0f 91 pop r16 2a8ac: ff 90 pop r15 2a8ae: ef 90 pop r14 2a8b0: df 90 pop r13 2a8b2: cf 90 pop r12 2a8b4: bf 90 pop r11 2a8b6: af 90 pop r10 2a8b8: 9f 90 pop r9 2a8ba: 8f 90 pop r8 2a8bc: 7f 90 pop r7 2a8be: 6f 90 pop r6 2a8c0: 5f 90 pop r5 2a8c2: 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(); 2a8c4: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 2a8c8: 81 ef ldi r24, 0xF1 ; 241 2a8ca: 9f e0 ldi r25, 0x0F ; 15 2a8cc: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 2a8d0: 2b 01 movw r4, r22 2a8d2: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 2a8d4: 8d ee ldi r24, 0xED ; 237 2a8d6: 9f e0 ldi r25, 0x0F ; 15 2a8d8: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 2a8dc: 6b 01 movw r12, r22 2a8de: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 2a8e0: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 lcd_printf_P(_N( 2a8e4: 86 e3 ldi r24, 0x36 ; 54 2a8e6: 9d e4 ldi r25, 0x4D ; 77 2a8e8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2a8ec: 98 2e mov r9, r24 2a8ee: 89 2e mov r8, r25 2a8f0: 85 e2 ldi r24, 0x25 ; 37 2a8f2: 9d e4 ldi r25, 0x4D ; 77 2a8f4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2a8f8: b8 2e mov r11, r24 2a8fa: 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; 2a8fc: c7 01 movw r24, r14 2a8fe: b6 01 movw r22, r12 2a900: 2c e3 ldi r18, 0x3C ; 60 2a902: 30 e0 ldi r19, 0x00 ; 0 2a904: 40 e0 ldi r20, 0x00 ; 0 2a906: 50 e0 ldi r21, 0x00 ; 0 2a908: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2a90c: 7f 93 push r23 2a90e: 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; 2a910: ca 01 movw r24, r20 2a912: b9 01 movw r22, r18 2a914: 28 e1 ldi r18, 0x18 ; 24 2a916: 30 e0 ldi r19, 0x00 ; 0 2a918: 40 e0 ldi r20, 0x00 ; 0 2a91a: 50 e0 ldi r21, 0x00 ; 0 2a91c: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2a920: 7f 93 push r23 2a922: 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; 2a924: c7 01 movw r24, r14 2a926: b6 01 movw r22, r12 2a928: 20 ea ldi r18, 0xA0 ; 160 2a92a: 35 e0 ldi r19, 0x05 ; 5 2a92c: 40 e0 ldi r20, 0x00 ; 0 2a92e: 50 e0 ldi r21, 0x00 ; 0 2a930: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2a934: 5f 93 push r21 2a936: 4f 93 push r20 2a938: 3f 93 push r19 2a93a: 2f 93 push r18 2a93c: 8f 92 push r8 2a93e: 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; 2a940: c3 01 movw r24, r6 2a942: b2 01 movw r22, r4 2a944: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 2a948: 20 e0 ldi r18, 0x00 ; 0 2a94a: 30 e0 ldi r19, 0x00 ; 0 2a94c: 48 ec ldi r20, 0xC8 ; 200 2a94e: 52 e4 ldi r21, 0x42 ; 66 2a950: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2a954: 9f 93 push r25 2a956: 8f 93 push r24 2a958: 7f 93 push r23 2a95a: 6f 93 push r22 2a95c: af 92 push r10 2a95e: bf 92 push r11 2a960: 8c e6 ldi r24, 0x6C ; 108 2a962: 90 e7 ldi r25, 0x70 ; 112 2a964: 9f 93 push r25 2a966: 8f 93 push r24 2a968: 0e 94 ff 6f call 0xdffe ; 0xdffe "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 2a96c: 8d b7 in r24, 0x3d ; 61 2a96e: 9e b7 in r25, 0x3e ; 62 2a970: 42 96 adiw r24, 0x12 ; 18 2a972: 0f b6 in r0, 0x3f ; 63 2a974: f8 94 cli 2a976: 9e bf out 0x3e, r25 ; 62 2a978: 0f be out 0x3f, r0 ; 63 2a97a: 8d bf out 0x3d, r24 ; 61 2a97c: 93 cf rjmp .-218 ; 0x2a8a4 0002a97e : 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()") { 2a97e: cf 92 push r12 2a980: df 92 push r13 2a982: ef 92 push r14 2a984: ff 92 push r15 2a986: 0f 93 push r16 2a988: 1f 93 push r17 2a98a: cf 93 push r28 2a98c: df 93 push r29 2a98e: 00 d0 rcall .+0 ; 0x2a990 2a990: 00 d0 rcall .+0 ; 0x2a992 2a992: 1f 92 push r1 2a994: 1f 92 push r1 2a996: cd b7 in r28, 0x3d ; 61 2a998: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 2a99a: 80 91 34 05 lds r24, 0x0534 ; 0x800534 2a99e: 90 91 35 05 lds r25, 0x0535 ; 0x800535 2a9a2: 00 97 sbiw r24, 0x00 ; 0 2a9a4: e1 f1 breq .+120 ; 0x2aa1e { const int16_t initial_feedmultiply = feedmultiply; 2a9a6: 20 91 39 02 lds r18, 0x0239 ; 0x800239 2a9aa: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2a9ae: 24 36 cpi r18, 0x64 ; 100 2a9b0: 31 05 cpc r19, r1 2a9b2: 4c f4 brge .+18 ; 0x2a9c6 2a9b4: ac 01 movw r20, r24 2a9b6: 42 0f add r20, r18 2a9b8: 53 1f adc r21, r19 2a9ba: 45 36 cpi r20, 0x65 ; 101 2a9bc: 51 05 cpc r21, r1 2a9be: 6c f4 brge .+26 ; 0x2a9da 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; 2a9c0: 82 0f add r24, r18 2a9c2: 93 1f adc r25, r19 2a9c4: 0c c0 rjmp .+24 ; 0x2a9de #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2a9c6: 24 36 cpi r18, 0x64 ; 100 2a9c8: 31 05 cpc r19, r1 2a9ca: 09 f4 brne .+2 ; 0x2a9ce 2a9cc: 55 c0 rjmp .+170 ; 0x2aa78 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 2a9ce: ac 01 movw r20, r24 2a9d0: 42 0f add r20, r18 2a9d2: 53 1f adc r21, r19 2a9d4: 44 36 cpi r20, 0x64 ; 100 2a9d6: 51 05 cpc r21, r1 2a9d8: 9c f7 brge .-26 ; 0x2a9c0 { feedmultiply = 100; 2a9da: 84 e6 ldi r24, 0x64 ; 100 2a9dc: 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; 2a9de: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2a9e2: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 2a9e6: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2a9ea: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 2a9ee: 82 17 cp r24, r18 2a9f0: 93 07 cpc r25, r19 2a9f2: a9 f0 breq .+42 ; 0x2aa1e feedmultiply = constrain(feedmultiply, 10, 999); 2a9f4: 88 3e cpi r24, 0xE8 ; 232 2a9f6: 53 e0 ldi r21, 0x03 ; 3 2a9f8: 95 07 cpc r25, r21 2a9fa: 14 f0 brlt .+4 ; 0x2aa00 2a9fc: 87 ee ldi r24, 0xE7 ; 231 2a9fe: 93 e0 ldi r25, 0x03 ; 3 2aa00: 8a 30 cpi r24, 0x0A ; 10 2aa02: 91 05 cpc r25, r1 2aa04: 14 f4 brge .+4 ; 0x2aa0a 2aa06: 8a e0 ldi r24, 0x0A ; 10 2aa08: 90 e0 ldi r25, 0x00 ; 0 2aa0a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2aa0e: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 2aa12: 10 92 35 05 sts 0x0535, r1 ; 0x800535 2aa16: 10 92 34 05 sts 0x0534, r1 ; 0x800534 refresh_saved_feedrate_multiplier_in_ram(); 2aa1a: 0e 94 29 66 call 0xcc52 ; 0xcc52 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 2aa1e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2aa22: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 2aa24: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b } if (lcd_status_update_delay) 2aa28: 10 91 4b 06 lds r17, 0x064B ; 0x80064b 2aa2c: 11 23 and r17, r17 2aa2e: 91 f1 breq .+100 ; 0x2aa94 lcd_status_update_delay--; 2aa30: 2f ef ldi r18, 0xFF ; 255 2aa32: 21 0f add r18, r17 2aa34: 20 93 4b 06 sts 0x064B, r18 ; 0x80064b if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 2aa38: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 2aa3c: 81 11 cpse r24, r1 2aa3e: 0d c0 rjmp .+26 ; 0x2aa5a 2aa40: 0e 94 43 72 call 0xe486 ; 0xe486 2aa44: 88 23 and r24, r24 2aa46: 49 f0 breq .+18 ; 0x2aa5a menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 2aa48: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 menu_submenu(lcd_main_menu); 2aa4c: 60 e0 ldi r22, 0x00 ; 0 2aa4e: 84 ef ldi r24, 0xF4 ; 244 2aa50: 93 ee ldi r25, 0xE3 ; 227 2aa52: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2aa56: 0e 94 d2 70 call 0xe1a4 ; 0xe1a4 } } 2aa5a: 28 96 adiw r28, 0x08 ; 8 2aa5c: 0f b6 in r0, 0x3f ; 63 2aa5e: f8 94 cli 2aa60: de bf out 0x3e, r29 ; 62 2aa62: 0f be out 0x3f, r0 ; 63 2aa64: cd bf out 0x3d, r28 ; 61 2aa66: df 91 pop r29 2aa68: cf 91 pop r28 2aa6a: 1f 91 pop r17 2aa6c: 0f 91 pop r16 2aa6e: ff 90 pop r15 2aa70: ef 90 pop r14 2aa72: df 90 pop r13 2aa74: cf 90 pop r12 2aa76: 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) { 2aa78: 8b 30 cpi r24, 0x0B ; 11 2aa7a: 91 05 cpc r25, r1 2aa7c: 1c f0 brlt .+6 ; 0x2aa84 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 2aa7e: 86 5a subi r24, 0xA6 ; 166 2aa80: 9f 4f sbci r25, 0xFF ; 255 2aa82: ad cf rjmp .-166 ; 0x2a9de } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 2aa84: 86 3f cpi r24, 0xF6 ; 246 2aa86: 4f ef ldi r20, 0xFF ; 255 2aa88: 94 07 cpc r25, r20 2aa8a: 0c f0 brlt .+2 ; 0x2aa8e 2aa8c: ac cf rjmp .-168 ; 0x2a9e6 feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 2aa8e: 82 59 subi r24, 0x92 ; 146 2aa90: 9f 4f sbci r25, 0xFF ; 255 2aa92: a5 cf rjmp .-182 ; 0x2a9de 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; 2aa94: 6a e0 ldi r22, 0x0A ; 10 2aa96: 60 93 4b 06 sts 0x064B, r22 ; 0x80064b ReInitLCD++; 2aa9a: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 2aa9e: 8f 5f subi r24, 0xFF ; 255 2aaa0: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a if (ReInitLCD == 30) 2aaa4: 8e 31 cpi r24, 0x1E ; 30 2aaa6: 09 f0 breq .+2 ; 0x2aaaa 2aaa8: 9f c0 rjmp .+318 ; 0x2abe8 { ReInitLCD = 0 ; 2aaaa: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2aaae: 0e 94 d2 70 call 0xe1a4 ; 0xe1a4 lcd_status_message_idx = 0; // Re-draw message from beginning 2aab2: 10 92 36 05 sts 0x0536, r1 ; 0x800536 <_ZL22lcd_status_message_idx.lto_priv.461> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 2aab6: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_home(); //line 0 2aaba: 0e 94 52 70 call 0xe0a4 ; 0xe0a4 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2aabe: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 2aac2: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 2aac6: 07 2e mov r0, r23 2aac8: 00 0c add r0, r0 2aaca: 88 0b sbc r24, r24 2aacc: 99 0b sbc r25, r25 2aace: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__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)); 2aad2: 20 e0 ldi r18, 0x00 ; 0 2aad4: 30 e0 ldi r19, 0x00 ; 0 2aad6: 40 e0 ldi r20, 0x00 ; 0 2aad8: 5f e3 ldi r21, 0x3F ; 63 2aada: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2aade: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 2aae2: 6b 01 movw r12, r22 2aae4: 20 e0 ldi r18, 0x00 ; 0 2aae6: 30 e0 ldi r19, 0x00 ; 0 2aae8: 40 e0 ldi r20, 0x00 ; 0 2aaea: 5f e3 ldi r21, 0x3F ; 63 2aaec: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2aaf0: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 2aaf4: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 2aaf8: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 2aafc: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2ab00: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 2ab04: a6 01 movw r20, r12 2ab06: 82 e8 ldi r24, 0x82 ; 130 2ab08: 0f 94 ec 2d call 0x25bd8 ; 0x25bd8 lcd_space(3); //3 spaces 2ab0c: 83 e0 ldi r24, 0x03 ; 3 2ab0e: 0e 94 1c 70 call 0xe038 ; 0xe038 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 2ab12: 80 91 72 07 lds r24, 0x0772 ; 0x800772 2ab16: 81 30 cpi r24, 0x01 ; 1 2ab18: 09 f0 breq .+2 ; 0x2ab1c 2ab1a: 6e c0 rjmp .+220 ; 0x2abf8 lcd_puts_P(_N("Z --- ")); 2ab1c: 82 ec ldi r24, 0xC2 ; 194 2ab1e: 9f e6 ldi r25, 0x6F ; 111 2ab20: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 2ab24: 61 e0 ldi r22, 0x01 ; 1 2ab26: 80 e0 ldi r24, 0x00 ; 0 2ab28: 0e 94 26 70 call 0xe04c ; 0xe04c }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 2ab2c: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 2ab30: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 2ab34: 07 2e mov r0, r23 2ab36: 00 0c add r0, r0 2ab38: 88 0b sbc r24, r24 2ab3a: 99 0b sbc r25, r25 2ab3c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 2ab40: 20 e0 ldi r18, 0x00 ; 0 2ab42: 30 e0 ldi r19, 0x00 ; 0 2ab44: 40 e0 ldi r20, 0x00 ; 0 2ab46: 5f e3 ldi r21, 0x3F ; 63 2ab48: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2ab4c: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 2ab50: 6b 01 movw r12, r22 2ab52: 20 e0 ldi r18, 0x00 ; 0 2ab54: 30 e0 ldi r19, 0x00 ; 0 2ab56: 40 e0 ldi r20, 0x00 ; 0 2ab58: 5f e3 ldi r21, 0x3F ; 63 2ab5a: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 2ab5e: 70 91 ef 04 lds r23, 0x04EF ; 0x8004ef 2ab62: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 2ab66: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 2ab6a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 2ab6e: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 2ab72: a6 01 movw r20, r12 2ab74: 80 e8 ldi r24, 0x80 ; 128 2ab76: 0f 94 ec 2d call 0x25bd8 ; 0x25bd8 lcd_space(3); //3 spaces 2ab7a: 83 e0 ldi r24, 0x03 ; 3 2ab7c: 0e 94 1c 70 call 0xe038 ; 0xe038 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 2ab80: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 2ab84: 8f 93 push r24 2ab86: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2ab8a: 8f 93 push r24 2ab8c: 8b ec ldi r24, 0xCB ; 203 2ab8e: 9f e6 ldi r25, 0x6F ; 111 2ab90: 9f 93 push r25 2ab92: 8f 93 push r24 2ab94: 0e 94 ff 6f call 0xdffe ; 0xdffe lcd_space(8 - chars); 2ab98: 98 e0 ldi r25, 0x08 ; 8 2ab9a: 98 1b sub r25, r24 2ab9c: 89 2f mov r24, r25 2ab9e: 0e 94 1c 70 call 0xe038 ; 0xe038 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 2aba2: 62 e0 ldi r22, 0x02 ; 2 2aba4: 80 e0 ldi r24, 0x00 ; 0 2aba6: 0e 94 26 70 call 0xe04c ; 0xe04c } // 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(" ")); 2abaa: 0f 90 pop r0 2abac: 0f 90 pop r0 2abae: 0f 90 pop r0 2abb0: 0f 90 pop r0 2abb2: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 2abb6: e0 90 6b 14 lds r14, 0x146B ; 0x80146b 2abba: 81 11 cpse r24, r1 2abbc: 3e c0 rjmp .+124 ; 0x2ac3a 2abbe: 2e ed ldi r18, 0xDE ; 222 2abc0: c2 2e mov r12, r18 2abc2: 2f e6 ldi r18, 0x6F ; 111 2abc4: d2 2e mov r13, r18 2abc6: e1 10 cpse r14, r1 2abc8: 3c c0 rjmp .+120 ; 0x2ac42 2abca: 82 ee ldi r24, 0xE2 ; 226 2abcc: c8 2e mov r12, r24 2abce: 8f e6 ldi r24, 0x6F ; 111 2abd0: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2abd2: 0e 94 27 69 call 0xd24e ; 0xd24e 2abd6: f8 2e mov r15, r24 2abd8: 88 23 and r24, r24 2abda: e1 f1 breq .+120 ; 0x2ac54 2abdc: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2abe0: 8f 3f cpi r24, 0xFF ; 255 2abe2: 89 f5 brne .+98 ; 0x2ac46 2abe4: f1 2c mov r15, r1 2abe6: 36 c0 rjmp .+108 ; 0x2ac54 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 2abe8: 0f 94 ca dd call 0x3bb94 ; 0x3bb94 <__divmodqi4> 2abec: 91 11 cpse r25, r1 2abee: 63 cf rjmp .-314 ; 0x2aab6 lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 2abf0: 80 e0 ldi r24, 0x00 ; 0 2abf2: 0e 94 91 70 call 0xe122 ; 0xe122 2abf6: 5d cf rjmp .-326 ; 0x2aab2 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]?' ':'?'); 2abf8: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 2abfc: 88 23 and r24, r24 2abfe: d9 f0 breq .+54 ; 0x2ac36 2ac00: 80 e2 ldi r24, 0x20 ; 32 2ac02: 1f 92 push r1 2ac04: 8f 93 push r24 2ac06: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 2ac0a: 8f 93 push r24 2ac0c: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 2ac10: 8f 93 push r24 2ac12: 80 91 49 07 lds r24, 0x0749 ; 0x800749 2ac16: 8f 93 push r24 2ac18: 80 91 48 07 lds r24, 0x0748 ; 0x800748 2ac1c: 8f 93 push r24 2ac1e: 89 eb ldi r24, 0xB9 ; 185 2ac20: 9f e6 ldi r25, 0x6F ; 111 2ac22: 9f 93 push r25 2ac24: 8f 93 push r24 2ac26: 0e 94 ff 6f call 0xdffe ; 0xdffe 2ac2a: 0f b6 in r0, 0x3f ; 63 2ac2c: f8 94 cli 2ac2e: de bf out 0x3e, r29 ; 62 2ac30: 0f be out 0x3f, r0 ; 63 2ac32: cd bf out 0x3d, r28 ; 61 2ac34: 77 cf rjmp .-274 ; 0x2ab24 2ac36: 8f e3 ldi r24, 0x3F ; 63 2ac38: e4 cf rjmp .-56 ; 0x2ac02 } // 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(" ")); 2ac3a: 96 ee ldi r25, 0xE6 ; 230 2ac3c: c9 2e mov r12, r25 2ac3e: 9f e6 ldi r25, 0x6F ; 111 2ac40: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2ac42: ee 20 and r14, r14 2ac44: 31 f2 breq .-116 ; 0x2abd2 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2ac46: 80 91 db 03 lds r24, 0x03DB ; 0x8003db // 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)); 2ac4a: ff 24 eor r15, r15 2ac4c: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2ac4e: 88 23 and r24, r24 2ac50: 09 f4 brne .+2 ; 0x2ac54 2ac52: bb c0 rjmp .+374 ; 0x2adca { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 2ac54: 81 ea ldi r24, 0xA1 ; 161 2ac56: 9d e0 ldi r25, 0x0D ; 13 2ac58: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2ac5c: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 2ac5e: 0e 94 6b 78 call 0xf0d6 ; 0xf0d6 if ((nextSheet >= 0) && (sheetNR != nextSheet)) 2ac62: 87 fd sbrc r24, 7 2ac64: b2 c0 rjmp .+356 ; 0x2adca 2ac66: 08 17 cp r16, r24 2ac68: 09 f4 brne .+2 ; 0x2ac6c 2ac6a: af c0 rjmp .+350 ; 0x2adca { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 2ac6c: 9b e0 ldi r25, 0x0B ; 11 2ac6e: 09 02 muls r16, r25 2ac70: b0 01 movw r22, r0 2ac72: 11 24 eor r1, r1 2ac74: 67 5b subi r22, 0xB7 ; 183 2ac76: 72 4f sbci r23, 0xF2 ; 242 2ac78: 47 e0 ldi r20, 0x07 ; 7 2ac7a: 50 e0 ldi r21, 0x00 ; 0 2ac7c: 8e 01 movw r16, r28 2ac7e: 0f 5f subi r16, 0xFF ; 255 2ac80: 1f 4f sbci r17, 0xFF ; 255 2ac82: c8 01 movw r24, r16 2ac84: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe sheet[7] = '\0'; 2ac88: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 2ac8a: 1f 93 push r17 2ac8c: 0f 93 push r16 2ac8e: 82 ef ldi r24, 0xF2 ; 242 2ac90: 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()); 2ac92: 9f 93 push r25 2ac94: 8f 93 push r24 2ac96: 0e 94 ff 6f call 0xdffe ; 0xdffe 2ac9a: 0f 90 pop r0 2ac9c: 0f 90 pop r0 2ac9e: 0f 90 pop r0 2aca0: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 2aca2: 80 91 95 13 lds r24, 0x1395 ; 0x801395 2aca6: 81 30 cpi r24, 0x01 ; 1 2aca8: 09 f0 breq .+2 ; 0x2acac 2acaa: e9 c0 rjmp .+466 ; 0x2ae7e // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 2acac: 0f 94 73 36 call 0x26ce6 ; 0x26ce6 2acb0: 95 e0 ldi r25, 0x05 ; 5 2acb2: 98 1b sub r25, r24 2acb4: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2acb6: 0e 94 1c 70 call 0xe038 ; 0xe038 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()) { 2acba: 0e 94 27 69 call 0xd24e ; 0xd24e 2acbe: 88 23 and r24, r24 2acc0: 09 f4 brne .+2 ; 0x2acc4 2acc2: fa c0 rjmp .+500 ; 0x2aeb8 uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 2acc4: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 2acc8: 88 23 and r24, r24 2acca: 09 f4 brne .+2 ; 0x2acce 2accc: da c0 rjmp .+436 ; 0x2ae82 if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 2acce: c0 90 8d 02 lds r12, 0x028D ; 0x80028d 2acd2: 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) 2acd6: e0 90 8b 02 lds r14, 0x028B ; 0x80028b 2acda: f0 90 8c 02 lds r15, 0x028C ; 0x80028c #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 2acde: 80 91 49 06 lds r24, 0x0649 ; 0x800649 2ace2: 8a 30 cpi r24, 0x0A ; 10 2ace4: 11 f4 brne .+4 ; 0x2acea clock_interval = 0; 2ace6: 10 92 49 06 sts 0x0649, r1 ; 0x800649 clock_interval++; 2acea: 80 91 49 06 lds r24, 0x0649 ; 0x800649 2acee: 8f 5f subi r24, 0xFF ; 255 2acf0: 80 93 49 06 sts 0x0649, r24 ; 0x800649 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 2acf4: 2f ef ldi r18, 0xFF ; 255 2acf6: e2 16 cp r14, r18 2acf8: f2 06 cpc r15, r18 2acfa: 21 f0 breq .+8 ; 0x2ad04 2acfc: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 2acfe: 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) { 2ad00: 86 30 cpi r24, 0x06 ; 6 2ad02: 70 f4 brcc .+28 ; 0x2ad20 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 2ad04: 3f ef ldi r19, 0xFF ; 255 2ad06: c3 16 cp r12, r19 2ad08: d3 06 cpc r13, r19 2ad0a: 09 f0 breq .+2 ; 0x2ad0e 2ad0c: c3 c0 rjmp .+390 ; 0x2ae94 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 2ad0e: 0f 94 ad 53 call 0x2a75a ; 0x2a75a 2ad12: 2c e3 ldi r18, 0x3C ; 60 2ad14: 30 e0 ldi r19, 0x00 ; 0 2ad16: 40 e0 ldi r20, 0x00 ; 0 2ad18: 50 e0 ldi r21, 0x00 ; 0 2ad1a: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__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 = ' '; 2ad1e: 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)) { 2ad20: 40 91 39 02 lds r20, 0x0239 ; 0x800239 2ad24: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 2ad28: 44 36 cpi r20, 0x64 ; 100 2ad2a: 51 05 cpc r21, r1 2ad2c: 09 f4 brne .+2 ; 0x2ad30 2ad2e: b5 c0 rjmp .+362 ; 0x2ae9a 2ad30: c2 16 cp r12, r18 2ad32: d3 06 cpc r13, r19 2ad34: 21 f0 breq .+8 ; 0x2ad3e 2ad36: e2 16 cp r14, r18 2ad38: f3 06 cpc r15, r19 2ad3a: 09 f0 breq .+2 ; 0x2ad3e 2ad3c: ae c0 rjmp .+348 ; 0x2ae9a 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); 2ad3e: a4 e6 ldi r26, 0x64 ; 100 2ad40: b0 e0 ldi r27, 0x00 ; 0 2ad42: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 2ad46: 9a 01 movw r18, r20 2ad48: 55 0f add r21, r21 2ad4a: 44 0b sbc r20, r20 2ad4c: 55 0b sbc r21, r21 2ad4e: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2ad52: 4f e3 ldi r20, 0x3F ; 63 2ad54: e4 2e mov r14, r20 2ad56: 04 2e mov r0, r20 2ad58: 00 0c add r0, r0 2ad5a: ff 08 sbc r15, r15 2ad5c: e1 2f mov r30, r17 2ad5e: 01 2e mov r0, r17 2ad60: 00 0c add r0, r0 2ad62: ff 0b sbc r31, r31 2ad64: c9 01 movw r24, r18 2ad66: 6c e3 ldi r22, 0x3C ; 60 2ad68: 70 e0 ldi r23, 0x00 ; 0 2ad6a: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__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 2ad6e: 20 37 cpi r18, 0x70 ; 112 2ad70: 37 41 sbci r19, 0x17 ; 23 2ad72: 08 f0 brcs .+2 ; 0x2ad76 2ad74: 94 c0 rjmp .+296 ; 0x2ae9e chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 2ad76: ff 92 push r15 2ad78: 4f 93 push r20 2ad7a: ff 93 push r31 2ad7c: 1f 93 push r17 2ad7e: 9f 93 push r25 2ad80: 8f 93 push r24 2ad82: 7f 93 push r23 2ad84: 6f 93 push r22 2ad86: 8e ef ldi r24, 0xFE ; 254 2ad88: 9f e6 ldi r25, 0x6F ; 111 2ad8a: 9f 93 push r25 2ad8c: 8f 93 push r24 2ad8e: 0e 94 ff 6f call 0xdffe ; 0xdffe else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 2ad92: 0f b6 in r0, 0x3f ; 63 2ad94: f8 94 cli 2ad96: de bf out 0x3e, r29 ; 62 2ad98: 0f be out 0x3f, r0 ; 63 2ad9a: 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); 2ad9c: 98 e0 ldi r25, 0x08 ; 8 2ad9e: 98 1b sub r25, r24 2ada0: 89 2f mov r24, r25 2ada2: 0e 94 1c 70 call 0xe038 ; 0xe038 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 2ada6: 63 e0 ldi r22, 0x03 ; 3 2ada8: 80 e0 ldi r24, 0x00 ; 0 2adaa: 0e 94 26 70 call 0xe04c ; 0xe04c #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2adae: 0f 94 7c 3f call 0x27ef8 ; 0x27ef8 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 2adb2: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 2adb6: 88 23 and r24, r24 2adb8: 09 f4 brne .+2 ; 0x2adbc 2adba: 3e ce rjmp .-900 ; 0x2aa38 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) { 2adbc: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 2adc0: 81 11 cpse r24, r1 2adc2: 3a ce rjmp .-908 ; 0x2aa38 2adc4: 0f 94 f1 0a call 0x215e2 ; 0x215e2 2adc8: 37 ce rjmp .-914 ; 0x2aa38 lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 2adca: e1 10 cpse r14, r1 2adcc: 04 c0 rjmp .+8 ; 0x2add6 2adce: 80 91 9a 03 lds r24, 0x039A ; 0x80039a <_ZL9M79_timer.lto_priv.463> 2add2: 81 11 cpse r24, r1 2add4: 4a c0 rjmp .+148 ; 0x2ae6a // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 2add6: df 92 push r13 2add8: cf 92 push r12 2adda: 8e ee ldi r24, 0xEE ; 238 2addc: 91 ea ldi r25, 0xA1 ; 161 2adde: 9f 93 push r25 2ade0: 8f 93 push r24 2ade2: 0e 94 ff 6f call 0xdffe ; 0xdffe 2ade6: 0f 90 pop r0 2ade8: 0f 90 pop r0 2adea: 0f 90 pop r0 2adec: 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) 2adee: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 2adf2: 81 11 cpse r24, r1 2adf4: 04 c0 rjmp .+8 ; 0x2adfe 2adf6: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2adfa: 85 36 cpi r24, 0x65 ; 101 2adfc: f0 f1 brcs .+124 ; 0x2ae7a { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 2adfe: 80 91 85 02 lds r24, 0x0285 ; 0x800285 2ae02: 85 36 cpi r24, 0x65 ; 101 2ae04: d0 f1 brcs .+116 ; 0x2ae7a 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;}; 2ae06: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 2ae0a: 88 23 and r24, r24 2ae0c: 19 f1 breq .+70 ; 0x2ae54 2ae0e: 80 91 78 17 lds r24, 0x1778 ; 0x801778 2ae12: 90 91 79 17 lds r25, 0x1779 ; 0x801779 2ae16: a0 91 7a 17 lds r26, 0x177A ; 0x80177a 2ae1a: b0 91 7b 17 lds r27, 0x177B ; 0x80177b 2ae1e: 00 97 sbiw r24, 0x00 ; 0 2ae20: a1 05 cpc r26, r1 2ae22: b1 05 cpc r27, r1 2ae24: b9 f0 breq .+46 ; 0x2ae54 2ae26: bc 01 movw r22, r24 2ae28: cd 01 movw r24, r26 2ae2a: 6d 59 subi r22, 0x9D ; 157 2ae2c: 7f 4f sbci r23, 0xFF ; 255 2ae2e: 8f 4f sbci r24, 0xFF ; 255 2ae30: 9f 4f sbci r25, 0xFF ; 255 2ae32: 24 e6 ldi r18, 0x64 ; 100 2ae34: 30 e0 ldi r19, 0x00 ; 0 2ae36: 40 e0 ldi r20, 0x00 ; 0 2ae38: 50 e0 ldi r21, 0x00 ; 0 2ae3a: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 2ae3e: 60 91 7f 17 lds r22, 0x177F ; 0x80177f 2ae42: 70 91 80 17 lds r23, 0x1780 ; 0x801780 2ae46: 80 91 81 17 lds r24, 0x1781 ; 0x801781 2ae4a: 90 91 82 17 lds r25, 0x1782 ; 0x801782 2ae4e: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 2ae52: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2ae54: 21 2f mov r18, r17 2ae56: 30 e0 ldi r19, 0x00 ; 0 2ae58: 88 ed ldi r24, 0xD8 ; 216 2ae5a: 9f e6 ldi r25, 0x6F ; 111 2ae5c: f1 10 cpse r15, r1 2ae5e: 02 c0 rjmp .+4 ; 0x2ae64 2ae60: 82 ed ldi r24, 0xD2 ; 210 2ae62: 9f e6 ldi r25, 0x6F ; 111 2ae64: 3f 93 push r19 2ae66: 2f 93 push r18 2ae68: 14 cf rjmp .-472 ; 0x2ac92 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 2ae6a: 81 e0 ldi r24, 0x01 ; 1 2ae6c: 0e 94 1c 70 call 0xe038 ; 0xe038 lcd_print(hostName); // Two characters 2ae70: 86 e4 ldi r24, 0x46 ; 70 2ae72: 96 e0 ldi r25, 0x06 ; 6 2ae74: 0e 94 2d 72 call 0xe45a ; 0xe45a 2ae78: ba cf rjmp .-140 ; 0x2adee 2ae7a: 18 2f mov r17, r24 2ae7c: eb cf rjmp .-42 ; 0x2ae54 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2ae7e: 85 e0 ldi r24, 0x05 ; 5 2ae80: 1a cf rjmp .-460 ; 0x2acb6 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) 2ae82: c0 90 89 02 lds r12, 0x0289 ; 0x800289 2ae86: 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) 2ae8a: e0 90 87 02 lds r14, 0x0287 ; 0x800287 2ae8e: f0 90 88 02 lds r15, 0x0288 ; 0x800288 2ae92: 25 cf rjmp .-438 ; 0x2acde 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) { 2ae94: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 2ae96: 12 e5 ldi r17, 0x52 ; 82 2ae98: 43 cf rjmp .-378 ; 0x2ad20 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 = ' '; 2ae9a: 40 e2 ldi r20, 0x20 ; 32 2ae9c: 5b cf rjmp .-330 ; 0x2ad54 } 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); 2ae9e: ff 92 push r15 2aea0: 4f 93 push r20 2aea2: ff 93 push r31 2aea4: 1f 93 push r17 2aea6: 7f 93 push r23 2aea8: 6f 93 push r22 2aeaa: 83 ef ldi r24, 0xF3 ; 243 2aeac: 9f e6 ldi r25, 0x6F ; 111 2aeae: 9f 93 push r25 2aeb0: 8f 93 push r24 2aeb2: 0e 94 ff 6f call 0xdffe ; 0xdffe 2aeb6: 6d cf rjmp .-294 ; 0x2ad92 } else { #ifdef QUICK_NOZZLE_CHANGE chars = lcd_printf_P(PSTR("Nd %4.2f "),(float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); #else chars = lcd_printf_P(_N(LCD_STR_CLOCK "--:-- ")); 2aeb8: 8a ee ldi r24, 0xEA ; 234 2aeba: 9f e6 ldi r25, 0x6F ; 111 2aebc: 9f 93 push r25 2aebe: 8f 93 push r24 2aec0: 0e 94 ff 6f call 0xdffe ; 0xdffe 2aec4: 0f 90 pop r0 2aec6: 0f 90 pop r0 2aec8: 69 cf rjmp .-302 ; 0x2ad9c 0002aeca : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 2aeca: 10 92 99 03 sts 0x0399, r1 ; 0x800399 startTimestamp = 0; 2aece: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 2aed2: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 2aed6: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 2aeda: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 stopTimestamp = 0; 2aede: 10 92 4c 06 sts 0x064C, r1 ; 0x80064c 2aee2: 10 92 4d 06 sts 0x064D, r1 ; 0x80064d 2aee6: 10 92 4e 06 sts 0x064E, r1 ; 0x80064e 2aeea: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f accumulator = 0; 2aeee: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 2aef2: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 2aef6: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 2aefa: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 } 2aefe: 08 95 ret 0002af00 : /** * @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; } 2af00: 80 91 99 03 lds r24, 0x0399 ; 0x800399 } else return false; } bool Stopwatch::start() { if (!isRunning()) { 2af04: 81 30 cpi r24, 0x01 ; 1 2af06: f1 f0 breq .+60 ; 0x2af44 if (isPaused()) accumulator = duration(); 2af08: 82 30 cpi r24, 0x02 ; 2 2af0a: c9 f4 brne .+50 ; 0x2af3e 2af0c: 0f 94 ad 53 call 0x2a75a ; 0x2a75a 2af10: 60 93 a1 05 sts 0x05A1, r22 ; 0x8005a1 2af14: 70 93 a2 05 sts 0x05A2, r23 ; 0x8005a2 2af18: 80 93 a3 05 sts 0x05A3, r24 ; 0x8005a3 2af1c: 90 93 a4 05 sts 0x05A4, r25 ; 0x8005a4 else reset(); state = RUNNING; 2af20: 81 e0 ldi r24, 0x01 ; 1 2af22: 80 93 99 03 sts 0x0399, r24 ; 0x800399 startTimestamp = _millis(); 2af26: 0f 94 55 3e call 0x27caa ; 0x27caa 2af2a: 60 93 a5 05 sts 0x05A5, r22 ; 0x8005a5 2af2e: 70 93 a6 05 sts 0x05A6, r23 ; 0x8005a6 2af32: 80 93 a7 05 sts 0x05A7, r24 ; 0x8005a7 2af36: 90 93 a8 05 sts 0x05A8, r25 ; 0x8005a8 2af3a: 81 e0 ldi r24, 0x01 ; 1 2af3c: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 2af3e: 0f 94 65 57 call 0x2aeca ; 0x2aeca 2af42: ee cf rjmp .-36 ; 0x2af20 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 2af44: 80 e0 ldi r24, 0x00 ; 0 } 2af46: 08 95 ret 0002af48 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 2af48: 80 91 99 03 lds r24, 0x0399 ; 0x800399 2af4c: 81 50 subi r24, 0x01 ; 1 2af4e: 82 30 cpi r24, 0x02 ; 2 2af50: 70 f4 brcc .+28 ; 0x2af6e state = STOPPED; 2af52: 10 92 99 03 sts 0x0399, r1 ; 0x800399 stopTimestamp = _millis(); 2af56: 0f 94 55 3e call 0x27caa ; 0x27caa 2af5a: 60 93 4c 06 sts 0x064C, r22 ; 0x80064c 2af5e: 70 93 4d 06 sts 0x064D, r23 ; 0x80064d 2af62: 80 93 4e 06 sts 0x064E, r24 ; 0x80064e 2af66: 90 93 4f 06 sts 0x064F, r25 ; 0x80064f 2af6a: 81 e0 ldi r24, 0x01 ; 1 2af6c: 08 95 ret return true; } else return false; 2af6e: 80 e0 ldi r24, 0x00 ; 0 } 2af70: 08 95 ret 0002af72 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 2af72: 2f b7 in r18, 0x3f ; 63 2af74: f8 94 cli count_pos = count_position[axis]; 2af76: 94 e0 ldi r25, 0x04 ; 4 2af78: 89 9f mul r24, r25 2af7a: f0 01 movw r30, r0 2af7c: 11 24 eor r1, r1 2af7e: ef 59 subi r30, 0x9F ; 159 2af80: f8 4f sbci r31, 0xF8 ; 248 2af82: 60 81 ld r22, Z 2af84: 71 81 ldd r23, Z+1 ; 0x01 2af86: 82 81 ldd r24, Z+2 ; 0x02 2af88: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 2af8a: 2f bf out 0x3f, r18 ; 63 return count_pos; } 2af8c: 08 95 ret 0002af8e : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 2af8e: cf 93 push r28 2af90: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 2af92: 0f 94 b9 57 call 0x2af72 ; 0x2af72 2af96: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2af9a: 24 e0 ldi r18, 0x04 ; 4 2af9c: c2 9f mul r28, r18 2af9e: f0 01 movw r30, r0 2afa0: 11 24 eor r1, r1 2afa2: e1 59 subi r30, 0x91 ; 145 2afa4: f9 4f sbci r31, 0xF9 ; 249 2afa6: 20 81 ld r18, Z 2afa8: 31 81 ldd r19, Z+1 ; 0x01 2afaa: 42 81 ldd r20, Z+2 ; 0x02 2afac: 53 81 ldd r21, Z+3 ; 0x03 2afae: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> } 2afb2: cf 91 pop r28 2afb4: 08 95 ret 0002afb6 : } // Block until all buffered steps are executed void st_synchronize() { 2afb6: cf 93 push r28 2afb8: df 93 push r29 2afba: 00 d0 rcall .+0 ; 0x2afbc 2afbc: 1f 92 push r1 2afbe: cd b7 in r28, 0x3d ; 61 2afc0: 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); 2afc2: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2afc6: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 while(blocks_queued()) 2afca: 98 17 cp r25, r24 2afcc: 09 f4 brne .+2 ; 0x2afd0 2afce: 46 c0 rjmp .+140 ; 0x2b05c { #ifdef TMC2130 manage_heater(); 2afd0: 0f 94 66 4d call 0x29acc ; 0x29acc tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 2afd4: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.486> 2afd8: 84 30 cpi r24, 0x04 ; 4 2afda: 38 f0 brcs .+14 ; 0x2afea // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 2afdc: 81 e0 ldi r24, 0x01 ; 1 2afde: 0e 94 6b 8c call 0x118d6 ; 0x118d6 lcd_update(0); 2afe2: 80 e0 ldi r24, 0x00 ; 0 2afe4: 0e 94 ed 6f call 0xdfda ; 0xdfda 2afe8: ec cf rjmp .-40 ; 0x2afc2 { uint32_t val32 = 0; 2afea: 19 82 std Y+1, r1 ; 0x01 2afec: 1a 82 std Y+2, r1 ; 0x02 2afee: 1b 82 std Y+3, r1 ; 0x03 2aff0: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 2aff2: ae 01 movw r20, r28 2aff4: 4f 5f subi r20, 0xFF ; 255 2aff6: 5f 4f sbci r21, 0xFF ; 255 2aff8: 6f e6 ldi r22, 0x6F ; 111 2affa: 0f 94 76 38 call 0x270ec ; 0x270ec tmc2130_sg_measure_val += (val32 & 0x3ff); 2affe: 89 81 ldd r24, Y+1 ; 0x01 2b000: 9a 81 ldd r25, Y+2 ; 0x02 2b002: ab 81 ldd r26, Y+3 ; 0x03 2b004: bc 81 ldd r27, Y+4 ; 0x04 2b006: 93 70 andi r25, 0x03 ; 3 2b008: aa 27 eor r26, r26 2b00a: bb 27 eor r27, r27 2b00c: 40 91 c9 03 lds r20, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_val.lto_priv.487> 2b010: 50 91 ca 03 lds r21, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x1> 2b014: 60 91 cb 03 lds r22, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x2> 2b018: 70 91 cc 03 lds r23, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x3> 2b01c: 84 0f add r24, r20 2b01e: 95 1f adc r25, r21 2b020: a6 1f adc r26, r22 2b022: b7 1f adc r27, r23 2b024: 80 93 c9 03 sts 0x03C9, r24 ; 0x8003c9 <_ZL22tmc2130_sg_measure_val.lto_priv.487> 2b028: 90 93 ca 03 sts 0x03CA, r25 ; 0x8003ca <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x1> 2b02c: a0 93 cb 03 sts 0x03CB, r26 ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x2> 2b030: b0 93 cc 03 sts 0x03CC, r27 ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.487+0x3> tmc2130_sg_measure_cnt++; 2b034: 80 91 c5 03 lds r24, 0x03C5 ; 0x8003c5 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488> 2b038: 90 91 c6 03 lds r25, 0x03C6 ; 0x8003c6 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x1> 2b03c: a0 91 c7 03 lds r26, 0x03C7 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x2> 2b040: b0 91 c8 03 lds r27, 0x03C8 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x3> 2b044: 01 96 adiw r24, 0x01 ; 1 2b046: a1 1d adc r26, r1 2b048: b1 1d adc r27, r1 2b04a: 80 93 c5 03 sts 0x03C5, r24 ; 0x8003c5 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488> 2b04e: 90 93 c6 03 sts 0x03C6, r25 ; 0x8003c6 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x1> 2b052: a0 93 c7 03 sts 0x03C7, r26 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x2> 2b056: b0 93 c8 03 sts 0x03C8, r27 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.488+0x3> 2b05a: b3 cf rjmp .-154 ; 0x2afc2 #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 2b05c: 0f 90 pop r0 2b05e: 0f 90 pop r0 2b060: 0f 90 pop r0 2b062: 0f 90 pop r0 2b064: df 91 pop r29 2b066: cf 91 pop r28 2b068: 08 95 ret 0002b06a : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 2b06a: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 2b06c: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2b070: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2b074: 80 ed ldi r24, 0xD0 ; 208 2b076: 97 e0 ldi r25, 0x07 ; 7 2b078: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b07c: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 2b080: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2b084: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b088: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> 2b08c: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2b090: 01 97 sbiw r24, 0x01 ; 1 2b092: 8e 3f cpi r24, 0xFE ; 254 2b094: 9f 4f sbci r25, 0xFF ; 255 2b096: 20 f4 brcc .+8 ; 0x2b0a0 nextAdvanceISR = 0; 2b098: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2b09c: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> #endif } 2b0a0: 08 95 ret 0002b0a2 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 2b0a2: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 2b0a6: 81 11 cpse r24, r1 2b0a8: 3c c0 rjmp .+120 ; 0x2b122 #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 2b0aa: 81 e0 ldi r24, 0x01 ; 1 2b0ac: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 2b0b0: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 2b0b4: 8f ef ldi r24, 0xFF ; 255 2b0b6: 9f e0 ldi r25, 0x0F ; 15 2b0b8: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 2b0bc: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2b0c0: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 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()) 2b0c4: 98 17 cp r25, r24 2b0c6: 41 f0 breq .+16 ; 0x2b0d8 { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 2b0c8: 88 e5 ldi r24, 0x58 ; 88 2b0ca: 9f e4 ldi r25, 0x4F ; 79 2b0cc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2b0d0: 0f 94 4f 34 call 0x2689e ; 0x2689e // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 2b0d4: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } tmc2130_wait_standstill_xy(1000); 2b0d8: 0f 94 68 87 call 0x30ed0 ; 0x30ed0 cli(); 2b0dc: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 2b0de: 81 e0 ldi r24, 0x01 ; 1 2b0e0: 90 91 a0 03 lds r25, 0x03A0 ; 0x8003a0 2b0e4: 91 11 cpse r25, r1 2b0e6: 01 c0 rjmp .+2 ; 0x2b0ea 2b0e8: 80 e0 ldi r24, 0x00 ; 0 2b0ea: 80 93 69 06 sts 0x0669, r24 ; 0x800669 update_mode_profile(); 2b0ee: 0f 94 45 aa call 0x3548a ; 0x3548a 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(); 2b0f2: 0e 94 cc f8 call 0x1f198 ; 0x1f198 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) { } 2b0f6: 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())); 2b0f8: 82 70 andi r24, 0x02 ; 2 2b0fa: 0f 94 eb 3a call 0x275d6 ; 0x275d6 // 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(); 2b0fe: 0f 94 35 58 call 0x2b06a ; 0x2b06a sei(); 2b102: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 2b104: 89 e6 ldi r24, 0x69 ; 105 2b106: 9f e0 ldi r25, 0x0F ; 15 2b108: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2b10c: 88 23 and r24, r24 2b10e: 61 f0 breq .+24 ; 0x2b128 2b110: 80 91 a0 03 lds r24, 0x03A0 ; 0x8003a0 2b114: 88 23 and r24, r24 2b116: 41 f0 breq .+16 ; 0x2b128 menu_submenu(lcd_crash_mode_info2); 2b118: 60 e0 ldi r22, 0x00 ; 0 2b11a: 80 e3 ldi r24, 0x30 ; 48 2b11c: 9a e3 ldi r25, 0x3A ; 58 2b11e: 0d 94 fb cf jmp 0x39ff6 ; 0x39ff6 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; 2b122: 10 92 a0 03 sts 0x03A0, r1 ; 0x8003a0 2b126: c4 cf rjmp .-120 ; 0x2b0b0 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 2b128: 08 95 ret 0002b12a <__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) { 2b12a: 1f 92 push r1 2b12c: 0f 92 push r0 2b12e: 0f b6 in r0, 0x3f ; 63 2b130: 0f 92 push r0 2b132: 11 24 eor r1, r1 2b134: 0b b6 in r0, 0x3b ; 59 2b136: 0f 92 push r0 2b138: 6f 92 push r6 2b13a: 7f 92 push r7 2b13c: 8f 92 push r8 2b13e: cf 92 push r12 2b140: df 92 push r13 2b142: ef 92 push r14 2b144: ff 92 push r15 2b146: 0f 93 push r16 2b148: 1f 93 push r17 2b14a: 2f 93 push r18 2b14c: 3f 93 push r19 2b14e: 4f 93 push r20 2b150: 5f 93 push r21 2b152: 6f 93 push r22 2b154: 7f 93 push r23 2b156: 8f 93 push r24 2b158: 9f 93 push r25 2b15a: af 93 push r26 2b15c: bf 93 push r27 2b15e: cf 93 push r28 2b160: df 93 push r29 2b162: ef 93 push r30 2b164: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b166: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> 2b16a: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2b16e: 9c 01 movw r18, r24 2b170: 21 50 subi r18, 0x01 ; 1 2b172: 31 09 sbc r19, r1 2b174: 2e 3f cpi r18, 0xFE ; 254 2b176: 3f 4f sbci r19, 0xFF ; 255 2b178: 90 f4 brcc .+36 ; 0x2b19e <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 2b17a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b17e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b182: 28 17 cp r18, r24 2b184: 39 07 cpc r19, r25 2b186: 08 f0 brcs .+2 ; 0x2b18a <__vector_17+0x60> 2b188: f9 c0 rjmp .+498 ; 0x2b37c <__vector_17+0x252> nextAdvanceISR -= OCR1A; 2b18a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b18e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b192: 82 1b sub r24, r18 2b194: 93 0b sbc r25, r19 2b196: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2b19a: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2b19e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b1a2: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b1a6: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> 2b1aa: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2b1ae: 28 17 cp r18, r24 2b1b0: 39 07 cpc r19, r25 2b1b2: 08 f0 brcs .+2 ; 0x2b1b6 <__vector_17+0x8c> 2b1b4: e8 c0 rjmp .+464 ; 0x2b386 <__vector_17+0x25c> nextMainISR -= OCR1A; 2b1b6: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b1ba: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b1be: 82 1b sub r24, r18 2b1c0: 93 0b sbc r25, r19 2b1c2: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2b1c6: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2b1ca: 80 91 e5 04 lds r24, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> 2b1ce: 90 91 e6 04 lds r25, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2b1d2: 89 2b or r24, r25 2b1d4: 11 f0 breq .+4 ; 0x2b1da <__vector_17+0xb0> 2b1d6: 0d 94 e5 61 jmp 0x2c3ca ; 0x2c3ca <__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) 2b1da: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b1de: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b1e2: 30 97 sbiw r30, 0x00 ; 0 2b1e4: 09 f0 breq .+2 ; 0x2b1e8 <__vector_17+0xbe> 2b1e6: 87 c1 rjmp .+782 ; 0x2b4f6 <__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) { 2b1e8: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2b1ec: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 2b1f0: 98 17 cp r25, r24 2b1f2: 09 f4 brne .+2 ; 0x2b1f6 <__vector_17+0xcc> 2b1f4: f9 c1 rjmp .+1010 ; 0x2b5e8 <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 2b1f6: c0 91 54 0e lds r28, 0x0E54 ; 0x800e54 2b1fa: 2c 2f mov r18, r28 2b1fc: 30 e0 ldi r19, 0x00 ; 0 2b1fe: 5e e6 ldi r21, 0x6E ; 110 2b200: c5 9f mul r28, r21 2b202: e0 01 movw r28, r0 2b204: 11 24 eor r1, r1 2b206: cd 58 subi r28, 0x8D ; 141 2b208: d8 4f sbci r29, 0xF8 ; 248 block->busy = true; 2b20a: fe 01 movw r30, r28 2b20c: e9 5b subi r30, 0xB9 ; 185 2b20e: ff 4f sbci r31, 0xFF ; 255 2b210: 41 e0 ldi r20, 0x01 ; 1 2b212: 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(); 2b214: d0 93 a0 05 sts 0x05A0, r29 ; 0x8005a0 2b218: c0 93 9f 05 sts 0x059F, r28 ; 0x80059f if (current_block != NULL) { 2b21c: 20 97 sbiw r28, 0x00 ; 0 2b21e: 09 f4 brne .+2 ; 0x2b222 <__vector_17+0xf8> 2b220: e3 c1 rjmp .+966 ; 0x2b5e8 <__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; 2b222: 10 92 9b 05 sts 0x059B, r1 ; 0x80059b 2b226: 10 92 9c 05 sts 0x059C, r1 ; 0x80059c 2b22a: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d 2b22e: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e // 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; 2b232: 10 92 9a 05 sts 0x059A, r1 ; 0x80059a acc_step_rate = uint16_t(current_block->initial_rate); 2b236: 8a ad ldd r24, Y+58 ; 0x3a 2b238: 9b ad ldd r25, Y+59 ; 0x3b 2b23a: 90 93 99 05 sts 0x0599, r25 ; 0x800599 2b23e: 80 93 98 05 sts 0x0598, r24 ; 0x800598 #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; 2b242: 81 34 cpi r24, 0x41 ; 65 2b244: ec e9 ldi r30, 0x9C ; 156 2b246: 9e 07 cpc r25, r30 2b248: 08 f0 brcs .+2 ; 0x2b24c <__vector_17+0x122> 2b24a: a2 c0 rjmp .+324 ; 0x2b390 <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2b24c: 81 32 cpi r24, 0x21 ; 33 2b24e: fe e4 ldi r31, 0x4E ; 78 2b250: 9f 07 cpc r25, r31 2b252: 08 f4 brcc .+2 ; 0x2b256 <__vector_17+0x12c> 2b254: a0 c0 rjmp .+320 ; 0x2b396 <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 2b256: 96 95 lsr r25 2b258: 87 95 ror r24 2b25a: 96 95 lsr r25 2b25c: 87 95 ror r24 step_loops = 4; 2b25e: 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; 2b260: 40 93 97 05 sts 0x0597, r20 ; 0x800597 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2b264: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2b266: 81 15 cp r24, r1 2b268: e8 e0 ldi r30, 0x08 ; 8 2b26a: 9e 07 cpc r25, r30 2b26c: 08 f4 brcc .+2 ; 0x2b270 <__vector_17+0x146> 2b26e: a4 c0 rjmp .+328 ; 0x2b3b8 <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2b270: e9 2f mov r30, r25 2b272: ff 27 eor r31, r31 2b274: ee 0f add r30, r30 2b276: ff 1f adc r31, r31 2b278: ee 0f add r30, r30 2b27a: ff 1f adc r31, r31 2b27c: af 01 movw r20, r30 2b27e: 49 53 subi r20, 0x39 ; 57 2b280: 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); 2b282: fa 01 movw r30, r20 2b284: 32 96 adiw r30, 0x02 ; 2 2b286: a5 91 lpm r26, Z+ 2b288: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2b28a: fa 01 movw r30, r20 2b28c: 45 91 lpm r20, Z+ 2b28e: 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. ); 2b290: b8 9f mul r27, r24 2b292: b0 01 movw r22, r0 2b294: a8 9f mul r26, r24 2b296: 00 0c add r0, r0 2b298: 61 1d adc r22, r1 2b29a: 11 24 eor r1, r1 2b29c: 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); 2b29e: ca 01 movw r24, r20 2b2a0: 86 1b sub r24, r22 2b2a2: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 2b2a4: 84 36 cpi r24, 0x64 ; 100 2b2a6: 91 05 cpc r25, r1 2b2a8: 10 f4 brcc .+4 ; 0x2b2ae <__vector_17+0x184> 2b2aa: 84 e6 ldi r24, 0x64 ; 100 2b2ac: 90 e0 ldi r25, 0x00 ; 0 2b2ae: b0 e0 ldi r27, 0x00 ; 0 2b2b0: a0 e0 ldi r26, 0x00 ; 0 2b2b2: 80 93 93 05 sts 0x0593, r24 ; 0x800593 2b2b6: 90 93 94 05 sts 0x0594, r25 ; 0x800594 2b2ba: a0 93 95 05 sts 0x0595, r26 ; 0x800595 2b2be: b0 93 96 05 sts 0x0596, r27 ; 0x800596 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2b2c2: 4e e6 ldi r20, 0x6E ; 110 2b2c4: 42 9f mul r20, r18 2b2c6: c0 01 movw r24, r0 2b2c8: 43 9f mul r20, r19 2b2ca: 90 0d add r25, r0 2b2cc: 11 24 eor r1, r1 2b2ce: 8d 58 subi r24, 0x8D ; 141 2b2d0: 98 4f sbci r25, 0xF8 ; 248 2b2d2: fc 01 movw r30, r24 2b2d4: e4 5b subi r30, 0xB4 ; 180 2b2d6: ff 4f sbci r31, 0xFF ; 255 2b2d8: 40 81 ld r20, Z 2b2da: 44 23 and r20, r20 2b2dc: 49 f0 breq .+18 ; 0x2b2f0 <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 2b2de: 81 5b subi r24, 0xB1 ; 177 2b2e0: 9f 4f sbci r25, 0xFF ; 255 2b2e2: fc 01 movw r30, r24 2b2e4: 80 81 ld r24, Z 2b2e6: 91 81 ldd r25, Z+1 ; 0x01 2b2e8: 90 93 92 05 sts 0x0592, r25 ; 0x800592 2b2ec: 80 93 91 05 sts 0x0591, r24 ; 0x800591 } e_steps = 0; 2b2f0: 10 92 90 05 sts 0x0590, r1 ; 0x800590 nextAdvanceISR = ADV_NEVER; 2b2f4: 8f ef ldi r24, 0xFF ; 255 2b2f6: 9f ef ldi r25, 0xFF ; 255 2b2f8: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2b2fc: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> LA_phase = -1; 2b300: 80 93 8f 05 sts 0x058F, r24 ; 0x80058f #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 2b304: 8e e6 ldi r24, 0x6E ; 110 2b306: 82 9f mul r24, r18 2b308: f0 01 movw r30, r0 2b30a: 83 9f mul r24, r19 2b30c: f0 0d add r31, r0 2b30e: 11 24 eor r1, r1 2b310: ed 58 subi r30, 0x8D ; 141 2b312: f8 4f sbci r31, 0xF8 ; 248 2b314: 85 a9 ldd r24, Z+53 ; 0x35 2b316: 84 ff sbrs r24, 4 2b318: 08 c0 rjmp .+16 ; 0x2b32a <__vector_17+0x200> count_position[E_AXIS] = 0; 2b31a: 10 92 6d 07 sts 0x076D, r1 ; 0x80076d 2b31e: 10 92 6e 07 sts 0x076E, r1 ; 0x80076e 2b322: 10 92 6f 07 sts 0x076F, r1 ; 0x80076f 2b326: 10 92 70 07 sts 0x0770, r1 ; 0x800770 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 2b32a: 83 ff sbrs r24, 3 2b32c: 66 c0 rjmp .+204 ; 0x2b3fa <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 2b32e: 8e e6 ldi r24, 0x6E ; 110 2b330: 82 9f mul r24, r18 2b332: f0 01 movw r30, r0 2b334: 83 9f mul r24, r19 2b336: f0 0d add r31, r0 2b338: 11 24 eor r1, r1 2b33a: ed 58 subi r30, 0x8D ; 141 2b33c: f8 4f sbci r31, 0xF8 ; 248 2b33e: 80 89 ldd r24, Z+16 ; 0x10 2b340: 91 89 ldd r25, Z+17 ; 0x11 2b342: 96 95 lsr r25 2b344: 87 95 ror r24 2b346: 91 95 neg r25 2b348: 81 95 neg r24 2b34a: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 2b34c: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b350: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f 2b354: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2b358: 80 93 83 05 sts 0x0583, r24 ; 0x800583 2b35c: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2b360: 80 93 87 05 sts 0x0587, r24 ; 0x800587 2b364: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2b368: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 2b36c: 81 e0 ldi r24, 0x01 ; 1 2b36e: 24 85 ldd r18, Z+12 ; 0x0c 2b370: 35 85 ldd r19, Z+13 ; 0x0d 2b372: 23 2b or r18, r19 2b374: 09 f0 breq .+2 ; 0x2b378 <__vector_17+0x24e> 2b376: 82 c0 rjmp .+260 ; 0x2b47c <__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; 2b378: 80 e0 ldi r24, 0x00 ; 0 2b37a: 80 c0 rjmp .+256 ; 0x2b47c <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 2b37c: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2b380: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> 2b384: 0c cf rjmp .-488 ; 0x2b19e <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 2b386: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2b38a: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> 2b38e: 1d cf rjmp .-454 ; 0x2b1ca <__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; 2b390: 80 e4 ldi r24, 0x40 ; 64 2b392: 9c e9 ldi r25, 0x9C ; 156 2b394: 60 cf rjmp .-320 ; 0x2b256 <__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 2b396: 81 31 cpi r24, 0x11 ; 17 2b398: 57 e2 ldi r21, 0x27 ; 39 2b39a: 95 07 cpc r25, r21 2b39c: 20 f0 brcs .+8 ; 0x2b3a6 <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 2b39e: 96 95 lsr r25 2b3a0: 87 95 ror r24 step_loops = 2; 2b3a2: 42 e0 ldi r20, 0x02 ; 2 2b3a4: 5d cf rjmp .-326 ; 0x2b260 <__vector_17+0x136> } else { step_loops = 1; 2b3a6: 40 93 97 05 sts 0x0597, r20 ; 0x800597 2b3aa: 80 32 cpi r24, 0x20 ; 32 2b3ac: 91 05 cpc r25, r1 2b3ae: 08 f0 brcs .+2 ; 0x2b3b2 <__vector_17+0x288> 2b3b0: 59 cf rjmp .-334 ; 0x2b264 <__vector_17+0x13a> 2b3b2: 80 e2 ldi r24, 0x20 ; 32 2b3b4: 90 e0 ldi r25, 0x00 ; 0 2b3b6: 56 cf rjmp .-340 ; 0x2b264 <__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; 2b3b8: ac 01 movw r20, r24 2b3ba: 56 95 lsr r21 2b3bc: 47 95 ror r20 2b3be: 4c 7f andi r20, 0xFC ; 252 2b3c0: 49 53 subi r20, 0x39 ; 57 2b3c2: 5c 46 sbci r21, 0x6C ; 108 timer = (unsigned short)pgm_read_word_near(table_address); 2b3c4: fa 01 movw r30, r20 2b3c6: 65 91 lpm r22, Z+ 2b3c8: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2b3ca: fa 01 movw r30, r20 2b3cc: 32 96 adiw r30, 0x02 ; 2 2b3ce: a5 91 lpm r26, Z+ 2b3d0: b4 91 lpm r27, Z 2b3d2: ac 01 movw r20, r24 2b3d4: 47 70 andi r20, 0x07 ; 7 2b3d6: 55 27 eor r21, r21 2b3d8: 4a 9f mul r20, r26 2b3da: c0 01 movw r24, r0 2b3dc: 4b 9f mul r20, r27 2b3de: 90 0d add r25, r0 2b3e0: 5a 9f mul r21, r26 2b3e2: 90 0d add r25, r0 2b3e4: 11 24 eor r1, r1 2b3e6: e3 e0 ldi r30, 0x03 ; 3 2b3e8: 96 95 lsr r25 2b3ea: 87 95 ror r24 2b3ec: ea 95 dec r30 2b3ee: e1 f7 brne .-8 ; 0x2b3e8 <__vector_17+0x2be> 2b3f0: ab 01 movw r20, r22 2b3f2: 48 1b sub r20, r24 2b3f4: 59 0b sbc r21, r25 2b3f6: ca 01 movw r24, r20 2b3f8: 55 cf rjmp .-342 ; 0x2b2a4 <__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); 2b3fa: 8e e6 ldi r24, 0x6E ; 110 2b3fc: 82 9f mul r24, r18 2b3fe: f0 01 movw r30, r0 2b400: 83 9f mul r24, r19 2b402: f0 0d add r31, r0 2b404: 11 24 eor r1, r1 2b406: ed 58 subi r30, 0x8D ; 141 2b408: f8 4f sbci r31, 0xF8 ; 248 2b40a: 80 89 ldd r24, Z+16 ; 0x10 2b40c: 91 89 ldd r25, Z+17 ; 0x11 2b40e: a2 89 ldd r26, Z+18 ; 0x12 2b410: b3 89 ldd r27, Z+19 ; 0x13 2b412: b6 95 lsr r27 2b414: a7 95 ror r26 2b416: 97 95 ror r25 2b418: 87 95 ror r24 2b41a: b0 95 com r27 2b41c: a0 95 com r26 2b41e: 90 95 com r25 2b420: 81 95 neg r24 2b422: 9f 4f sbci r25, 0xFF ; 255 2b424: af 4f sbci r26, 0xFF ; 255 2b426: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 2b428: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f 2b42c: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b430: a0 93 81 05 sts 0x0581, r26 ; 0x800581 2b434: b0 93 82 05 sts 0x0582, r27 ; 0x800582 2b438: 80 93 83 05 sts 0x0583, r24 ; 0x800583 2b43c: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2b440: a0 93 85 05 sts 0x0585, r26 ; 0x800585 2b444: b0 93 86 05 sts 0x0586, r27 ; 0x800586 2b448: 80 93 87 05 sts 0x0587, r24 ; 0x800587 2b44c: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2b450: a0 93 89 05 sts 0x0589, r26 ; 0x800589 2b454: b0 93 8a 05 sts 0x058A, r27 ; 0x80058a 2b458: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b 2b45c: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2b460: a0 93 8d 05 sts 0x058D, r26 ; 0x80058d 2b464: b0 93 8e 05 sts 0x058E, r27 ; 0x80058e } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 2b468: 81 e0 ldi r24, 0x01 ; 1 2b46a: 44 85 ldd r20, Z+12 ; 0x0c 2b46c: 55 85 ldd r21, Z+13 ; 0x0d 2b46e: 66 85 ldd r22, Z+14 ; 0x0e 2b470: 77 85 ldd r23, Z+15 ; 0x0f 2b472: 45 2b or r20, r21 2b474: 46 2b or r20, r22 2b476: 47 2b or r20, r23 2b478: 09 f4 brne .+2 ; 0x2b47c <__vector_17+0x352> 2b47a: 7e cf rjmp .-260 ; 0x2b378 <__vector_17+0x24e> 2b47c: 80 93 7e 05 sts 0x057E, r24 ; 0x80057e #endif } step_events_completed.wide = 0; 2b480: 10 92 7a 05 sts 0x057A, r1 ; 0x80057a 2b484: 10 92 7b 05 sts 0x057B, r1 ; 0x80057b 2b488: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 2b48c: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d // Set directions. out_bits = current_block->direction_bits; 2b490: 88 8d ldd r24, Y+24 ; 0x18 2b492: 80 93 79 05 sts 0x0579, r24 ; 0x800579 // 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); 2b49a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b49e: 81 60 ori r24, 0x01 ; 1 2b4a0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 2b4a4: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 2b4a6: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } if((out_bits & (1< 2b4ae: 81 ff sbrs r24, 1 2b4b0: 8b c0 rjmp .+278 ; 0x2b5c8 <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 2b4b2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b4b6: 8d 7f andi r24, 0xFD ; 253 2b4b8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2b4bc: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 2b4be: 80 93 70 02 sts 0x0270, r24 ; 0x800270 } if ((out_bits & (1< 2b4c6: 82 ff sbrs r24, 2 2b4c8: 86 c0 rjmp .+268 ; 0x2b5d6 <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 2b4ca: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b4ce: 84 60 ori r24, 0x04 ; 4 2b4d0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 2b4d4: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 2b4d6: 80 93 71 02 sts 0x0271, r24 ; 0x800271 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 2b4da: 80 91 79 05 lds r24, 0x0579 ; 0x800579 2b4de: 83 ff sbrs r24, 3 2b4e0: 81 c0 rjmp .+258 ; 0x2b5e4 <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 2b4e2: 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; 2b4e4: 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) 2b4e8: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b4ec: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b4f0: 30 97 sbiw r30, 0x00 ; 0 2b4f2: 09 f4 brne .+2 ; 0x2b4f6 <__vector_17+0x3cc> 2b4f4: 3d c7 rjmp .+3706 ; 0x2c370 <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 2b4f6: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 2b4fa: 50 91 76 05 lds r21, 0x0576 ; 0x800576 2b4fe: 88 23 and r24, r24 2b500: 09 f4 brne .+2 ; 0x2b504 <__vector_17+0x3da> 2b502: cb c0 rjmp .+406 ; 0x2b69a <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 2b504: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.493> uint8_t _endstop = endstop; 2b508: 80 91 78 05 lds r24, 0x0578 ; 0x800578 uint8_t _old_endstop = old_endstop; 2b50c: 90 91 77 05 lds r25, 0x0577 ; 0x800577 #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))); 2b514: 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))); 2b51c: 42 fd sbrc r20, 2 2b51e: 83 c0 rjmp .+262 ; 0x2b626 <__vector_17+0x4fc> 2b520: 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)) { 2b522: 49 2f mov r20, r25 2b524: 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)){ 2b526: 48 23 and r20, r24 2b528: b1 f0 breq .+44 ; 0x2b556 <__vector_17+0x42c> 2b52a: c0 80 ld r12, Z 2b52c: d1 80 ldd r13, Z+1 ; 0x01 2b52e: e2 80 ldd r14, Z+2 ; 0x02 2b530: f3 80 ldd r15, Z+3 ; 0x03 2b532: 1c 14 cp r1, r12 2b534: 1d 04 cpc r1, r13 2b536: 1e 04 cpc r1, r14 2b538: 1f 04 cpc r1, r15 2b53a: 6c f4 brge .+26 ; 0x2b556 <__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); 2b53c: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 2b53e: c0 88 ldd r12, Z+16 ; 0x10 2b540: d1 88 ldd r13, Z+17 ; 0x11 2b542: e2 88 ldd r14, Z+18 ; 0x12 2b544: f3 88 ldd r15, Z+19 ; 0x13 2b546: c0 92 7a 05 sts 0x057A, r12 ; 0x80057a 2b54a: d0 92 7b 05 sts 0x057B, r13 ; 0x80057b 2b54e: e0 92 7c 05 sts 0x057C, r14 ; 0x80057c 2b552: f0 92 7d 05 sts 0x057D, r15 ; 0x80057d #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))); 2b556: 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))); 2b55e: 47 fd sbrc r20, 7 2b560: 6c c0 rjmp .+216 ; 0x2b63a <__vector_17+0x510> 2b562: 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)) { 2b564: 49 2f mov r20, r25 2b566: 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)){ 2b568: 48 23 and r20, r24 2b56a: b1 f0 breq .+44 ; 0x2b598 <__vector_17+0x46e> 2b56c: c4 80 ldd r12, Z+4 ; 0x04 2b56e: d5 80 ldd r13, Z+5 ; 0x05 2b570: e6 80 ldd r14, Z+6 ; 0x06 2b572: f7 80 ldd r15, Z+7 ; 0x07 2b574: 1c 14 cp r1, r12 2b576: 1d 04 cpc r1, r13 2b578: 1e 04 cpc r1, r14 2b57a: 1f 04 cpc r1, r15 2b57c: 6c f4 brge .+26 ; 0x2b598 <__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); 2b57e: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 2b580: c0 88 ldd r12, Z+16 ; 0x10 2b582: d1 88 ldd r13, Z+17 ; 0x11 2b584: e2 88 ldd r14, Z+18 ; 0x12 2b586: f3 88 ldd r15, Z+19 ; 0x13 2b588: c0 92 7a 05 sts 0x057A, r12 ; 0x80057a 2b58c: d0 92 7b 05 sts 0x057B, r13 ; 0x80057b 2b590: e0 92 7c 05 sts 0x057C, r14 ; 0x80057c 2b594: f0 92 7d 05 sts 0x057D, r15 ; 0x80057d } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 2b59c: 51 11 cpse r21, r1 2b59e: 77 c0 rjmp .+238 ; 0x2b68e <__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)) 2b5a0: 30 91 69 06 lds r19, 0x0669 ; 0x800669 2b5a4: 31 30 cpi r19, 0x01 ; 1 2b5a6: 09 f0 breq .+2 ; 0x2b5aa <__vector_17+0x480> 2b5a8: 52 c0 rjmp .+164 ; 0x2b64e <__vector_17+0x524> 2b5aa: 30 91 3d 06 lds r19, 0x063D ; 0x80063d 2b5ae: 32 fd sbrc r19, 2 2b5b0: 4e c0 rjmp .+156 ; 0x2b64e <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b5b2: 1c 9b sbis 0x03, 4 ; 3 2b5b4: 52 c0 rjmp .+164 ; 0x2b65a <__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))); 2b5b6: 84 60 ori r24, 0x04 ; 4 2b5b8: 51 c0 rjmp .+162 ; 0x2b65c <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 2b5be: 8e 7f andi r24, 0xFE ; 254 2b5c0: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 2b5c4: 81 e0 ldi r24, 0x01 ; 1 2b5c6: 6f cf rjmp .-290 ; 0x2b4a6 <__vector_17+0x37c> } if((out_bits & (1< 2b5cc: 82 60 ori r24, 0x02 ; 2 2b5ce: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 2b5d2: 81 e0 ldi r24, 0x01 ; 1 2b5d4: 74 cf rjmp .-280 ; 0x2b4be <__vector_17+0x394> } if ((out_bits & (1< 2b5da: 8b 7f andi r24, 0xFB ; 251 2b5dc: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 2b5e0: 81 e0 ldi r24, 0x01 ; 1 2b5e2: 79 cf rjmp .-270 ; 0x2b4d6 <__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; 2b5e4: 81 e0 ldi r24, 0x01 ; 1 2b5e6: 7e cf rjmp .-260 ; 0x2b4e4 <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 2b5e8: 80 ed ldi r24, 0xD0 ; 208 2b5ea: 97 e0 ldi r25, 0x07 ; 7 2b5ec: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2b5f0: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> 2b5f4: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.491+0x1> 2b5f8: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.491> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 2b5fc: 8f ef ldi r24, 0xFF ; 255 2b5fe: 9f ef ldi r25, 0xFF ; 255 2b600: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2b604: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> e_steps = 0; 2b608: 10 92 90 05 sts 0x0590, r1 ; 0x800590 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 2b60c: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2b610: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2b614: 00 97 sbiw r24, 0x00 ; 0 2b616: 09 f4 brne .+2 ; 0x2b61a <__vector_17+0x4f0> 2b618: 67 cf rjmp .-306 ; 0x2b4e8 <__vector_17+0x3be> --current_adv_steps; 2b61a: 01 97 sbiw r24, 0x01 ; 1 2b61c: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2b620: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2b624: 61 cf rjmp .-318 ; 0x2b4e8 <__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))); 2b626: 8e 7f andi r24, 0xFE ; 254 2b628: 7c cf rjmp .-264 ; 0x2b522 <__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))); 2b62a: 42 fd sbrc r20, 2 2b62c: 04 c0 rjmp .+8 ; 0x2b636 <__vector_17+0x50c> 2b62e: 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)){ 2b630: 49 2f mov r20, r25 2b632: 40 71 andi r20, 0x10 ; 16 2b634: 78 cf rjmp .-272 ; 0x2b526 <__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))); 2b636: 8f 7e andi r24, 0xEF ; 239 2b638: fb cf rjmp .-10 ; 0x2b630 <__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))); 2b63a: 8d 7f andi r24, 0xFD ; 253 2b63c: 93 cf rjmp .-218 ; 0x2b564 <__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))); 2b63e: 47 fd sbrc r20, 7 2b640: 04 c0 rjmp .+8 ; 0x2b64a <__vector_17+0x520> 2b642: 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)){ 2b644: 49 2f mov r20, r25 2b646: 40 72 andi r20, 0x20 ; 32 2b648: 8f cf rjmp .-226 ; 0x2b568 <__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))); 2b64a: 8f 7d andi r24, 0xDF ; 223 2b64c: fb cf rjmp .-10 ; 0x2b644 <__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))); 2b64e: 1c 99 sbic 0x03, 4 ; 3 2b650: b2 cf rjmp .-156 ; 0x2b5b6 <__vector_17+0x48c> 2b652: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b656: 36 ff sbrs r19, 6 2b658: ae cf rjmp .-164 ; 0x2b5b6 <__vector_17+0x48c> 2b65a: 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)) { 2b65c: 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)) { 2b65e: 98 23 and r25, r24 2b660: b1 f0 breq .+44 ; 0x2b68e <__vector_17+0x564> 2b662: c0 84 ldd r12, Z+8 ; 0x08 2b664: d1 84 ldd r13, Z+9 ; 0x09 2b666: e2 84 ldd r14, Z+10 ; 0x0a 2b668: f3 84 ldd r15, Z+11 ; 0x0b 2b66a: 1c 14 cp r1, r12 2b66c: 1d 04 cpc r1, r13 2b66e: 1e 04 cpc r1, r14 2b670: 1f 04 cpc r1, r15 2b672: 6c f4 brge .+26 ; 0x2b68e <__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); 2b674: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b676: c0 88 ldd r12, Z+16 ; 0x10 2b678: d1 88 ldd r13, Z+17 ; 0x11 2b67a: e2 88 ldd r14, Z+18 ; 0x12 2b67c: f3 88 ldd r15, Z+19 ; 0x13 2b67e: c0 92 7a 05 sts 0x057A, r12 ; 0x80057a 2b682: d0 92 7b 05 sts 0x057B, r13 ; 0x80057b 2b686: e0 92 7c 05 sts 0x057C, r14 ; 0x80057c 2b68a: f0 92 7d 05 sts 0x057D, r15 ; 0x80057d } #endif } endstop = _endstop; 2b68e: 80 93 78 05 sts 0x0578, r24 ; 0x800578 old_endstop = _endstop; //apply current endstop state to the old endstop 2b692: 80 93 77 05 sts 0x0577, r24 ; 0x800577 endstop_hit = _endstop_hit; 2b696: 20 93 0b 05 sts 0x050B, r18 ; 0x80050b <_ZL11endstop_hit.lto_priv.493> } // 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) { 2b69a: 55 23 and r21, r21 2b69c: 09 f4 brne .+2 ; 0x2b6a0 <__vector_17+0x576> 2b69e: 40 c0 rjmp .+128 ; 0x2b720 <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 2b6a0: 20 91 0b 05 lds r18, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.493> uint8_t _endstop = endstop; 2b6a4: 80 91 78 05 lds r24, 0x0578 ; 0x800578 uint8_t _old_endstop = old_endstop; 2b6a8: 90 91 77 05 lds r25, 0x0577 ; 0x800577 // 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)) 2b6ac: 30 91 69 06 lds r19, 0x0669 ; 0x800669 2b6b0: 31 30 cpi r19, 0x01 ; 1 2b6b2: c9 f4 brne .+50 ; 0x2b6e6 <__vector_17+0x5bc> 2b6b4: 30 91 3d 06 lds r19, 0x063D ; 0x80063d 2b6b8: 32 fd sbrc r19, 2 2b6ba: 15 c0 rjmp .+42 ; 0x2b6e6 <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b6bc: 1c 9b sbis 0x03, 4 ; 3 2b6be: 19 c0 rjmp .+50 ; 0x2b6f2 <__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))); 2b6c0: 84 60 ori r24, 0x04 ; 4 2b6c2: 18 c0 rjmp .+48 ; 0x2b6f4 <__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)) 2b6c4: 30 91 69 06 lds r19, 0x0669 ; 0x800669 2b6c8: 31 30 cpi r19, 0x01 ; 1 2b6ca: 31 f4 brne .+12 ; 0x2b6d8 <__vector_17+0x5ae> 2b6cc: 30 91 3d 06 lds r19, 0x063D ; 0x80063d 2b6d0: 32 fd sbrc r19, 2 2b6d2: 02 c0 rjmp .+4 ; 0x2b6d8 <__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))); 2b6d4: 8f 7b andi r24, 0xBF ; 191 2b6d6: 05 c0 rjmp .+10 ; 0x2b6e2 <__vector_17+0x5b8> 2b6d8: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b6dc: 36 fd sbrc r19, 6 2b6de: fa cf rjmp .-12 ; 0x2b6d4 <__vector_17+0x5aa> 2b6e0: 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)) { 2b6e2: 90 74 andi r25, 0x40 ; 64 2b6e4: bc cf rjmp .-136 ; 0x2b65e <__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))); 2b6e6: 1c 99 sbic 0x03, 4 ; 3 2b6e8: eb cf rjmp .-42 ; 0x2b6c0 <__vector_17+0x596> 2b6ea: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b6ee: 36 ff sbrs r19, 6 2b6f0: e7 cf rjmp .-50 ; 0x2b6c0 <__vector_17+0x596> 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)) { 2b6f4: 94 70 andi r25, 0x04 ; 4 2b6f6: 98 23 and r25, r24 2b6f8: 69 f0 breq .+26 ; 0x2b714 <__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); 2b6fa: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b6fc: 40 89 ldd r20, Z+16 ; 0x10 2b6fe: 51 89 ldd r21, Z+17 ; 0x11 2b700: 62 89 ldd r22, Z+18 ; 0x12 2b702: 73 89 ldd r23, Z+19 ; 0x13 2b704: 40 93 7a 05 sts 0x057A, r20 ; 0x80057a 2b708: 50 93 7b 05 sts 0x057B, r21 ; 0x80057b 2b70c: 60 93 7c 05 sts 0x057C, r22 ; 0x80057c 2b710: 70 93 7d 05 sts 0x057D, r23 ; 0x80057d } endstop = _endstop; 2b714: 80 93 78 05 sts 0x0578, r24 ; 0x800578 old_endstop = _endstop; //apply current endstop state to the old endstop 2b718: 80 93 77 05 sts 0x0577, r24 ; 0x800577 endstop_hit = _endstop_hit; 2b71c: 20 93 0b 05 sts 0x050B, r18 ; 0x80050b <_ZL11endstop_hit.lto_priv.493> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b720: 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) 2b722: 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); 2b724: 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); 2b726: 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); 2b728: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b72a: 83 ff sbrs r24, 3 2b72c: 08 c1 rjmp .+528 ; 0x2b93e <__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) 2b72e: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2b732: c8 17 cp r28, r24 2b734: 08 f0 brcs .+2 ; 0x2b738 <__vector_17+0x60e> 2b736: 72 c2 rjmp .+1252 ; 0x2bc1c <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2b738: 0f 94 29 21 call 0x24252 ; 0x24252 // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 2b73c: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b740: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b744: 80 81 ld r24, Z 2b746: 91 81 ldd r25, Z+1 ; 0x01 2b748: 20 91 7f 05 lds r18, 0x057F ; 0x80057f 2b74c: 30 91 80 05 lds r19, 0x0580 ; 0x800580 2b750: 82 0f add r24, r18 2b752: 93 1f adc r25, r19 2b754: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b758: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f if (counter[X_AXIS].lo > 0) { 2b75c: 18 16 cp r1, r24 2b75e: 19 06 cpc r1, r25 2b760: 64 f5 brge .+88 ; 0x2b7ba <__vector_17+0x690> STEP_NC_HI(X_AXIS); 2b762: 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; 2b764: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b768: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b76c: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2b770: 90 91 80 05 lds r25, 0x0580 ; 0x800580 2b774: 20 89 ldd r18, Z+16 ; 0x10 2b776: 31 89 ldd r19, Z+17 ; 0x11 2b778: 82 1b sub r24, r18 2b77a: 93 0b sbc r25, r19 2b77c: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b780: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f count_position[X_AXIS]+=count_direction[X_AXIS]; 2b784: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2b788: 40 91 61 07 lds r20, 0x0761 ; 0x800761 2b78c: 50 91 62 07 lds r21, 0x0762 ; 0x800762 2b790: 60 91 63 07 lds r22, 0x0763 ; 0x800763 2b794: 70 91 64 07 lds r23, 0x0764 ; 0x800764 2b798: 89 2f mov r24, r25 2b79a: 99 0f add r25, r25 2b79c: 99 0b sbc r25, r25 2b79e: aa 0b sbc r26, r26 2b7a0: bb 0b sbc r27, r27 2b7a2: 84 0f add r24, r20 2b7a4: 95 1f adc r25, r21 2b7a6: a6 1f adc r26, r22 2b7a8: b7 1f adc r27, r23 2b7aa: 80 93 61 07 sts 0x0761, r24 ; 0x800761 2b7ae: 90 93 62 07 sts 0x0762, r25 ; 0x800762 2b7b2: a0 93 63 07 sts 0x0763, r26 ; 0x800763 2b7b6: b0 93 64 07 sts 0x0764, r27 ; 0x800764 #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; 2b7ba: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b7be: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b7c2: 84 81 ldd r24, Z+4 ; 0x04 2b7c4: 95 81 ldd r25, Z+5 ; 0x05 2b7c6: 20 91 83 05 lds r18, 0x0583 ; 0x800583 2b7ca: 30 91 84 05 lds r19, 0x0584 ; 0x800584 2b7ce: 82 0f add r24, r18 2b7d0: 93 1f adc r25, r19 2b7d2: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2b7d6: 80 93 83 05 sts 0x0583, r24 ; 0x800583 if (counter[Y_AXIS].lo > 0) { 2b7da: 18 16 cp r1, r24 2b7dc: 19 06 cpc r1, r25 2b7de: 44 f5 brge .+80 ; 0x2b830 <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 2b7e0: 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; 2b7e2: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b7e6: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b7ea: 20 89 ldd r18, Z+16 ; 0x10 2b7ec: 31 89 ldd r19, Z+17 ; 0x11 2b7ee: 82 1b sub r24, r18 2b7f0: 93 0b sbc r25, r19 2b7f2: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2b7f6: 80 93 83 05 sts 0x0583, r24 ; 0x800583 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2b7fa: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2b7fe: 40 91 65 07 lds r20, 0x0765 ; 0x800765 2b802: 50 91 66 07 lds r21, 0x0766 ; 0x800766 2b806: 60 91 67 07 lds r22, 0x0767 ; 0x800767 2b80a: 70 91 68 07 lds r23, 0x0768 ; 0x800768 2b80e: 89 2f mov r24, r25 2b810: 99 0f add r25, r25 2b812: 99 0b sbc r25, r25 2b814: aa 0b sbc r26, r26 2b816: bb 0b sbc r27, r27 2b818: 84 0f add r24, r20 2b81a: 95 1f adc r25, r21 2b81c: a6 1f adc r26, r22 2b81e: b7 1f adc r27, r23 2b820: 80 93 65 07 sts 0x0765, r24 ; 0x800765 2b824: 90 93 66 07 sts 0x0766, r25 ; 0x800766 2b828: a0 93 67 07 sts 0x0767, r26 ; 0x800767 2b82c: b0 93 68 07 sts 0x0768, r27 ; 0x800768 #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; 2b830: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b834: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b838: 80 85 ldd r24, Z+8 ; 0x08 2b83a: 91 85 ldd r25, Z+9 ; 0x09 2b83c: 20 91 87 05 lds r18, 0x0587 ; 0x800587 2b840: 30 91 88 05 lds r19, 0x0588 ; 0x800588 2b844: 82 0f add r24, r18 2b846: 93 1f adc r25, r19 2b848: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2b84c: 80 93 87 05 sts 0x0587, r24 ; 0x800587 if (counter[Z_AXIS].lo > 0) { 2b850: 18 16 cp r1, r24 2b852: 19 06 cpc r1, r25 2b854: 44 f5 brge .+80 ; 0x2b8a6 <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 2b856: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 2b858: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b85c: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b860: 20 89 ldd r18, Z+16 ; 0x10 2b862: 31 89 ldd r19, Z+17 ; 0x11 2b864: 82 1b sub r24, r18 2b866: 93 0b sbc r25, r19 2b868: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2b86c: 80 93 87 05 sts 0x0587, r24 ; 0x800587 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2b870: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2b874: 40 91 69 07 lds r20, 0x0769 ; 0x800769 2b878: 50 91 6a 07 lds r21, 0x076A ; 0x80076a 2b87c: 60 91 6b 07 lds r22, 0x076B ; 0x80076b 2b880: 70 91 6c 07 lds r23, 0x076C ; 0x80076c 2b884: 89 2f mov r24, r25 2b886: 99 0f add r25, r25 2b888: 99 0b sbc r25, r25 2b88a: aa 0b sbc r26, r26 2b88c: bb 0b sbc r27, r27 2b88e: 84 0f add r24, r20 2b890: 95 1f adc r25, r21 2b892: a6 1f adc r26, r22 2b894: b7 1f adc r27, r23 2b896: 80 93 69 07 sts 0x0769, r24 ; 0x800769 2b89a: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 2b89e: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 2b8a2: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 2b8a6: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b8aa: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b8ae: 80 91 8b 05 lds r24, 0x058B ; 0x80058b 2b8b2: 90 91 8c 05 lds r25, 0x058C ; 0x80058c 2b8b6: 24 85 ldd r18, Z+12 ; 0x0c 2b8b8: 35 85 ldd r19, Z+13 ; 0x0d 2b8ba: 82 0f add r24, r18 2b8bc: 93 1f adc r25, r19 2b8be: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2b8c2: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b 2b8c6: 20 89 ldd r18, Z+16 ; 0x10 2b8c8: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 2b8ca: 18 16 cp r1, r24 2b8cc: 19 06 cpc r1, r25 2b8ce: 44 f5 brge .+80 ; 0x2b920 <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 2b8d0: 82 1b sub r24, r18 2b8d2: 93 0b sbc r25, r19 2b8d4: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2b8d8: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b count_position[E_AXIS] += count_direction[E_AXIS]; 2b8dc: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2b8e0: 40 91 6d 07 lds r20, 0x076D ; 0x80076d 2b8e4: 50 91 6e 07 lds r21, 0x076E ; 0x80076e 2b8e8: 60 91 6f 07 lds r22, 0x076F ; 0x80076f 2b8ec: 70 91 70 07 lds r23, 0x0770 ; 0x800770 2b8f0: 89 2f mov r24, r25 2b8f2: 99 0f add r25, r25 2b8f4: 99 0b sbc r25, r25 2b8f6: aa 0b sbc r26, r26 2b8f8: bb 0b sbc r27, r27 2b8fa: 84 0f add r24, r20 2b8fc: 95 1f adc r25, r21 2b8fe: a6 1f adc r26, r22 2b900: b7 1f adc r27, r23 2b902: 80 93 6d 07 sts 0x076D, r24 ; 0x80076d 2b906: 90 93 6e 07 sts 0x076E, r25 ; 0x80076e 2b90a: a0 93 6f 07 sts 0x076F, r26 ; 0x80076f 2b90e: b0 93 70 07 sts 0x0770, r27 ; 0x800770 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2b912: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2b916: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2b91a: 89 0f add r24, r25 2b91c: 80 93 90 05 sts 0x0590, r24 ; 0x800590 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) 2b920: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2b924: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 2b928: 01 96 adiw r24, 0x01 ; 1 2b92a: 90 93 7b 05 sts 0x057B, r25 ; 0x80057b 2b92e: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a 2b932: 82 17 cp r24, r18 2b934: 93 07 cpc r25, r19 2b936: 08 f0 brcs .+2 ; 0x2b93a <__vector_17+0x810> 2b938: 71 c1 rjmp .+738 ; 0x2bc1c <__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) 2b93a: cf 5f subi r28, 0xFF ; 255 2b93c: f8 ce rjmp .-528 ; 0x2b72e <__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) 2b93e: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2b942: c8 17 cp r28, r24 2b944: 08 f0 brcs .+2 ; 0x2b948 <__vector_17+0x81e> 2b946: 6a c1 rjmp .+724 ; 0x2bc1c <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2b948: 0f 94 29 21 call 0x24252 ; 0x24252 // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 2b94c: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b950: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b954: 80 81 ld r24, Z 2b956: 91 81 ldd r25, Z+1 ; 0x01 2b958: a2 81 ldd r26, Z+2 ; 0x02 2b95a: b3 81 ldd r27, Z+3 ; 0x03 2b95c: 40 91 7f 05 lds r20, 0x057F ; 0x80057f 2b960: 50 91 80 05 lds r21, 0x0580 ; 0x800580 2b964: 60 91 81 05 lds r22, 0x0581 ; 0x800581 2b968: 70 91 82 05 lds r23, 0x0582 ; 0x800582 2b96c: 84 0f add r24, r20 2b96e: 95 1f adc r25, r21 2b970: a6 1f adc r26, r22 2b972: b7 1f adc r27, r23 2b974: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f 2b978: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b97c: a0 93 81 05 sts 0x0581, r26 ; 0x800581 2b980: b0 93 82 05 sts 0x0582, r27 ; 0x800582 if (counter[X_AXIS].wide > 0) { 2b984: 18 16 cp r1, r24 2b986: 19 06 cpc r1, r25 2b988: 1a 06 cpc r1, r26 2b98a: 1b 06 cpc r1, r27 2b98c: c4 f5 brge .+112 ; 0x2b9fe <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 2b98e: 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; 2b990: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2b994: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2b998: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2b99c: 90 91 80 05 lds r25, 0x0580 ; 0x800580 2b9a0: a0 91 81 05 lds r26, 0x0581 ; 0x800581 2b9a4: b0 91 82 05 lds r27, 0x0582 ; 0x800582 2b9a8: 40 89 ldd r20, Z+16 ; 0x10 2b9aa: 51 89 ldd r21, Z+17 ; 0x11 2b9ac: 62 89 ldd r22, Z+18 ; 0x12 2b9ae: 73 89 ldd r23, Z+19 ; 0x13 2b9b0: 84 1b sub r24, r20 2b9b2: 95 0b sbc r25, r21 2b9b4: a6 0b sbc r26, r22 2b9b6: b7 0b sbc r27, r23 2b9b8: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f 2b9bc: 90 93 80 05 sts 0x0580, r25 ; 0x800580 2b9c0: a0 93 81 05 sts 0x0581, r26 ; 0x800581 2b9c4: b0 93 82 05 sts 0x0582, r27 ; 0x800582 count_position[X_AXIS]+=count_direction[X_AXIS]; 2b9c8: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2b9cc: 40 91 61 07 lds r20, 0x0761 ; 0x800761 2b9d0: 50 91 62 07 lds r21, 0x0762 ; 0x800762 2b9d4: 60 91 63 07 lds r22, 0x0763 ; 0x800763 2b9d8: 70 91 64 07 lds r23, 0x0764 ; 0x800764 2b9dc: 89 2f mov r24, r25 2b9de: 99 0f add r25, r25 2b9e0: 99 0b sbc r25, r25 2b9e2: aa 0b sbc r26, r26 2b9e4: bb 0b sbc r27, r27 2b9e6: 84 0f add r24, r20 2b9e8: 95 1f adc r25, r21 2b9ea: a6 1f adc r26, r22 2b9ec: b7 1f adc r27, r23 2b9ee: 80 93 61 07 sts 0x0761, r24 ; 0x800761 2b9f2: 90 93 62 07 sts 0x0762, r25 ; 0x800762 2b9f6: a0 93 63 07 sts 0x0763, r26 ; 0x800763 2b9fa: b0 93 64 07 sts 0x0764, r27 ; 0x800764 #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; 2b9fe: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2ba02: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2ba06: 84 81 ldd r24, Z+4 ; 0x04 2ba08: 95 81 ldd r25, Z+5 ; 0x05 2ba0a: a6 81 ldd r26, Z+6 ; 0x06 2ba0c: b7 81 ldd r27, Z+7 ; 0x07 2ba0e: 40 91 83 05 lds r20, 0x0583 ; 0x800583 2ba12: 50 91 84 05 lds r21, 0x0584 ; 0x800584 2ba16: 60 91 85 05 lds r22, 0x0585 ; 0x800585 2ba1a: 70 91 86 05 lds r23, 0x0586 ; 0x800586 2ba1e: 84 0f add r24, r20 2ba20: 95 1f adc r25, r21 2ba22: a6 1f adc r26, r22 2ba24: b7 1f adc r27, r23 2ba26: 80 93 83 05 sts 0x0583, r24 ; 0x800583 2ba2a: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2ba2e: a0 93 85 05 sts 0x0585, r26 ; 0x800585 2ba32: b0 93 86 05 sts 0x0586, r27 ; 0x800586 if (counter[Y_AXIS].wide > 0) { 2ba36: 18 16 cp r1, r24 2ba38: 19 06 cpc r1, r25 2ba3a: 1a 06 cpc r1, r26 2ba3c: 1b 06 cpc r1, r27 2ba3e: 84 f5 brge .+96 ; 0x2baa0 <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 2ba40: 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; 2ba42: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2ba46: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2ba4a: 40 89 ldd r20, Z+16 ; 0x10 2ba4c: 51 89 ldd r21, Z+17 ; 0x11 2ba4e: 62 89 ldd r22, Z+18 ; 0x12 2ba50: 73 89 ldd r23, Z+19 ; 0x13 2ba52: 84 1b sub r24, r20 2ba54: 95 0b sbc r25, r21 2ba56: a6 0b sbc r26, r22 2ba58: b7 0b sbc r27, r23 2ba5a: 80 93 83 05 sts 0x0583, r24 ; 0x800583 2ba5e: 90 93 84 05 sts 0x0584, r25 ; 0x800584 2ba62: a0 93 85 05 sts 0x0585, r26 ; 0x800585 2ba66: b0 93 86 05 sts 0x0586, r27 ; 0x800586 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2ba6a: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2ba6e: 40 91 65 07 lds r20, 0x0765 ; 0x800765 2ba72: 50 91 66 07 lds r21, 0x0766 ; 0x800766 2ba76: 60 91 67 07 lds r22, 0x0767 ; 0x800767 2ba7a: 70 91 68 07 lds r23, 0x0768 ; 0x800768 2ba7e: 89 2f mov r24, r25 2ba80: 99 0f add r25, r25 2ba82: 99 0b sbc r25, r25 2ba84: aa 0b sbc r26, r26 2ba86: bb 0b sbc r27, r27 2ba88: 84 0f add r24, r20 2ba8a: 95 1f adc r25, r21 2ba8c: a6 1f adc r26, r22 2ba8e: b7 1f adc r27, r23 2ba90: 80 93 65 07 sts 0x0765, r24 ; 0x800765 2ba94: 90 93 66 07 sts 0x0766, r25 ; 0x800766 2ba98: a0 93 67 07 sts 0x0767, r26 ; 0x800767 2ba9c: b0 93 68 07 sts 0x0768, r27 ; 0x800768 #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; 2baa0: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2baa4: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2baa8: 80 85 ldd r24, Z+8 ; 0x08 2baaa: 91 85 ldd r25, Z+9 ; 0x09 2baac: a2 85 ldd r26, Z+10 ; 0x0a 2baae: b3 85 ldd r27, Z+11 ; 0x0b 2bab0: 40 91 87 05 lds r20, 0x0587 ; 0x800587 2bab4: 50 91 88 05 lds r21, 0x0588 ; 0x800588 2bab8: 60 91 89 05 lds r22, 0x0589 ; 0x800589 2babc: 70 91 8a 05 lds r23, 0x058A ; 0x80058a 2bac0: 84 0f add r24, r20 2bac2: 95 1f adc r25, r21 2bac4: a6 1f adc r26, r22 2bac6: b7 1f adc r27, r23 2bac8: 80 93 87 05 sts 0x0587, r24 ; 0x800587 2bacc: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2bad0: a0 93 89 05 sts 0x0589, r26 ; 0x800589 2bad4: b0 93 8a 05 sts 0x058A, r27 ; 0x80058a if (counter[Z_AXIS].wide > 0) { 2bad8: 18 16 cp r1, r24 2bada: 19 06 cpc r1, r25 2badc: 1a 06 cpc r1, r26 2bade: 1b 06 cpc r1, r27 2bae0: 84 f5 brge .+96 ; 0x2bb42 <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 2bae2: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 2bae4: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bae8: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2baec: 40 89 ldd r20, Z+16 ; 0x10 2baee: 51 89 ldd r21, Z+17 ; 0x11 2baf0: 62 89 ldd r22, Z+18 ; 0x12 2baf2: 73 89 ldd r23, Z+19 ; 0x13 2baf4: 84 1b sub r24, r20 2baf6: 95 0b sbc r25, r21 2baf8: a6 0b sbc r26, r22 2bafa: b7 0b sbc r27, r23 2bafc: 80 93 87 05 sts 0x0587, r24 ; 0x800587 2bb00: 90 93 88 05 sts 0x0588, r25 ; 0x800588 2bb04: a0 93 89 05 sts 0x0589, r26 ; 0x800589 2bb08: b0 93 8a 05 sts 0x058A, r27 ; 0x80058a count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2bb0c: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2bb10: 40 91 69 07 lds r20, 0x0769 ; 0x800769 2bb14: 50 91 6a 07 lds r21, 0x076A ; 0x80076a 2bb18: 60 91 6b 07 lds r22, 0x076B ; 0x80076b 2bb1c: 70 91 6c 07 lds r23, 0x076C ; 0x80076c 2bb20: 89 2f mov r24, r25 2bb22: 99 0f add r25, r25 2bb24: 99 0b sbc r25, r25 2bb26: aa 0b sbc r26, r26 2bb28: bb 0b sbc r27, r27 2bb2a: 84 0f add r24, r20 2bb2c: 95 1f adc r25, r21 2bb2e: a6 1f adc r26, r22 2bb30: b7 1f adc r27, r23 2bb32: 80 93 69 07 sts 0x0769, r24 ; 0x800769 2bb36: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 2bb3a: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 2bb3e: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 2bb42: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2bb46: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2bb4a: 80 91 8b 05 lds r24, 0x058B ; 0x80058b 2bb4e: 90 91 8c 05 lds r25, 0x058C ; 0x80058c 2bb52: a0 91 8d 05 lds r26, 0x058D ; 0x80058d 2bb56: b0 91 8e 05 lds r27, 0x058E ; 0x80058e 2bb5a: 44 85 ldd r20, Z+12 ; 0x0c 2bb5c: 55 85 ldd r21, Z+13 ; 0x0d 2bb5e: 66 85 ldd r22, Z+14 ; 0x0e 2bb60: 77 85 ldd r23, Z+15 ; 0x0f 2bb62: 84 0f add r24, r20 2bb64: 95 1f adc r25, r21 2bb66: a6 1f adc r26, r22 2bb68: b7 1f adc r27, r23 2bb6a: 80 93 8b 05 sts 0x058B, r24 ; 0x80058b 2bb6e: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2bb72: a0 93 8d 05 sts 0x058D, r26 ; 0x80058d 2bb76: b0 93 8e 05 sts 0x058E, r27 ; 0x80058e 2bb7a: 40 89 ldd r20, Z+16 ; 0x10 2bb7c: 51 89 ldd r21, Z+17 ; 0x11 2bb7e: 62 89 ldd r22, Z+18 ; 0x12 2bb80: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 2bb82: 18 16 cp r1, r24 2bb84: 19 06 cpc r1, r25 2bb86: 1a 06 cpc r1, r26 2bb88: 1b 06 cpc r1, r27 2bb8a: 74 f5 brge .+92 ; 0x2bbe8 <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 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 8b 05 sts 0x058B, r24 ; 0x80058b 2bb98: 90 93 8c 05 sts 0x058C, r25 ; 0x80058c 2bb9c: a0 93 8d 05 sts 0x058D, r26 ; 0x80058d 2bba0: b0 93 8e 05 sts 0x058E, r27 ; 0x80058e count_position[E_AXIS] += count_direction[E_AXIS]; 2bba4: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bba8: c0 90 6d 07 lds r12, 0x076D ; 0x80076d 2bbac: d0 90 6e 07 lds r13, 0x076E ; 0x80076e 2bbb0: e0 90 6f 07 lds r14, 0x076F ; 0x80076f 2bbb4: f0 90 70 07 lds r15, 0x0770 ; 0x800770 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: 8c 0d add r24, r12 2bbc4: 9d 1d adc r25, r13 2bbc6: ae 1d adc r26, r14 2bbc8: bf 1d adc r27, r15 2bbca: 80 93 6d 07 sts 0x076D, r24 ; 0x80076d 2bbce: 90 93 6e 07 sts 0x076E, r25 ; 0x80076e 2bbd2: a0 93 6f 07 sts 0x076F, r26 ; 0x80076f 2bbd6: b0 93 70 07 sts 0x0770, r27 ; 0x800770 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2bbda: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bbde: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2bbe2: 89 0f add r24, r25 2bbe4: 80 93 90 05 sts 0x0590, r24 ; 0x800590 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) 2bbe8: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2bbec: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 2bbf0: a0 91 7c 05 lds r26, 0x057C ; 0x80057c 2bbf4: b0 91 7d 05 lds r27, 0x057D ; 0x80057d 2bbf8: 01 96 adiw r24, 0x01 ; 1 2bbfa: a1 1d adc r26, r1 2bbfc: b1 1d adc r27, r1 2bbfe: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a 2bc02: 90 93 7b 05 sts 0x057B, r25 ; 0x80057b 2bc06: a0 93 7c 05 sts 0x057C, r26 ; 0x80057c 2bc0a: b0 93 7d 05 sts 0x057D, r27 ; 0x80057d 2bc0e: 84 17 cp r24, r20 2bc10: 95 07 cpc r25, r21 2bc12: a6 07 cpc r26, r22 2bc14: b7 07 cpc r27, r23 2bc16: 10 f4 brcc .+4 ; 0x2bc1c <__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) 2bc18: cf 5f subi r28, 0xFF ; 255 2bc1a: 91 ce rjmp .-734 ; 0x2b93e <__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); 2bc1c: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2bc20: 88 23 and r24, r24 2bc22: 39 f0 breq .+14 ; 0x2bc32 <__vector_17+0xb08> 2bc24: 87 fd sbrc r24, 7 2bc26: ee c0 rjmp .+476 ; 0x2be04 <__vector_17+0xcda> 2bc28: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2bc2c: 80 64 ori r24, 0x40 ; 64 2bc2e: 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) { 2bc32: 40 91 7a 05 lds r20, 0x057A ; 0x80057a 2bc36: 50 91 7b 05 lds r21, 0x057B ; 0x80057b 2bc3a: 60 91 7c 05 lds r22, 0x057C ; 0x80057c 2bc3e: 70 91 7d 05 lds r23, 0x057D ; 0x80057d 2bc42: c0 91 9f 05 lds r28, 0x059F ; 0x80059f 2bc46: d0 91 a0 05 lds r29, 0x05A0 ; 0x8005a0 2bc4a: 89 8d ldd r24, Y+25 ; 0x19 2bc4c: 9a 8d ldd r25, Y+26 ; 0x1a 2bc4e: ab 8d ldd r26, Y+27 ; 0x1b 2bc50: bc 8d ldd r27, Y+28 ; 0x1c 2bc52: 84 17 cp r24, r20 2bc54: 95 07 cpc r25, r21 2bc56: a6 07 cpc r26, r22 2bc58: b7 07 cpc r27, r23 2bc5a: 08 f4 brcc .+2 ; 0x2bc5e <__vector_17+0xb34> 2bc5c: 34 c1 rjmp .+616 ; 0x2bec6 <__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); 2bc5e: 40 91 93 05 lds r20, 0x0593 ; 0x800593 2bc62: 50 91 94 05 lds r21, 0x0594 ; 0x800594 2bc66: 60 91 95 05 lds r22, 0x0595 ; 0x800595 2bc6a: 70 91 96 05 lds r23, 0x0596 ; 0x800596 "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. ); 2bc6e: cc 88 ldd r12, Y+20 ; 0x14 2bc70: dd 88 ldd r13, Y+21 ; 0x15 2bc72: ee 88 ldd r14, Y+22 ; 0x16 2bc74: aa 27 eor r26, r26 2bc76: 4d 9d mul r20, r13 2bc78: b1 2d mov r27, r1 2bc7a: 5e 9d mul r21, r14 2bc7c: c0 01 movw r24, r0 2bc7e: 6e 9d mul r22, r14 2bc80: 90 0d add r25, r0 2bc82: 6d 9d mul r22, r13 2bc84: 80 0d add r24, r0 2bc86: 91 1d adc r25, r1 2bc88: 4e 9d mul r20, r14 2bc8a: b0 0d add r27, r0 2bc8c: 81 1d adc r24, r1 2bc8e: 9a 1f adc r25, r26 2bc90: 5d 9d mul r21, r13 2bc92: b0 0d add r27, r0 2bc94: 81 1d adc r24, r1 2bc96: 9a 1f adc r25, r26 2bc98: 6c 9d mul r22, r12 2bc9a: b0 0d add r27, r0 2bc9c: 81 1d adc r24, r1 2bc9e: 9a 1f adc r25, r26 2bca0: 5c 9d mul r21, r12 2bca2: b1 0d add r27, r1 2bca4: 8a 1f adc r24, r26 2bca6: 9a 1f adc r25, r26 2bca8: bb 0f add r27, r27 2bcaa: 8a 1f adc r24, r26 2bcac: 9a 1f adc r25, r26 2bcae: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 2bcb0: 2a ad ldd r18, Y+58 ; 0x3a 2bcb2: 3b ad ldd r19, Y+59 ; 0x3b 2bcb4: 82 0f add r24, r18 2bcb6: 93 1f adc r25, r19 2bcb8: 90 93 99 05 sts 0x0599, r25 ; 0x800599 2bcbc: 80 93 98 05 sts 0x0598, r24 ; 0x800598 // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 2bcc0: 2e a9 ldd r18, Y+54 ; 0x36 2bcc2: 3f a9 ldd r19, Y+55 ; 0x37 2bcc4: 28 17 cp r18, r24 2bcc6: 39 07 cpc r19, r25 2bcc8: 20 f4 brcc .+8 ; 0x2bcd2 <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 2bcca: 30 93 99 05 sts 0x0599, r19 ; 0x800599 2bcce: 20 93 98 05 sts 0x0598, r18 ; 0x800598 // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 2bcd2: 80 91 98 05 lds r24, 0x0598 ; 0x800598 2bcd6: 90 91 99 05 lds r25, 0x0599 ; 0x800599 #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2bcda: 81 34 cpi r24, 0x41 ; 65 2bcdc: fc e9 ldi r31, 0x9C ; 156 2bcde: 9f 07 cpc r25, r31 2bce0: 08 f0 brcs .+2 ; 0x2bce4 <__vector_17+0xbba> 2bce2: 94 c0 rjmp .+296 ; 0x2be0c <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2bce4: 81 32 cpi r24, 0x21 ; 33 2bce6: 2e e4 ldi r18, 0x4E ; 78 2bce8: 92 07 cpc r25, r18 2bcea: 08 f4 brcc .+2 ; 0x2bcee <__vector_17+0xbc4> 2bcec: 92 c0 rjmp .+292 ; 0x2be12 <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 2bcee: 96 95 lsr r25 2bcf0: 87 95 ror r24 2bcf2: 96 95 lsr r25 2bcf4: 87 95 ror r24 step_loops = 4; 2bcf6: 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; 2bcf8: 20 93 97 05 sts 0x0597, r18 ; 0x800597 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2bcfc: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2bcfe: 81 15 cp r24, r1 2bd00: f8 e0 ldi r31, 0x08 ; 8 2bd02: 9f 07 cpc r25, r31 2bd04: 08 f4 brcc .+2 ; 0x2bd08 <__vector_17+0xbde> 2bd06: 97 c0 rjmp .+302 ; 0x2be36 <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2bd08: e9 2f mov r30, r25 2bd0a: ff 27 eor r31, r31 2bd0c: ee 0f add r30, r30 2bd0e: ff 1f adc r31, r31 2bd10: ee 0f add r30, r30 2bd12: ff 1f adc r31, r31 2bd14: 9f 01 movw r18, r30 2bd16: 29 53 subi r18, 0x39 ; 57 2bd18: 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); 2bd1a: f9 01 movw r30, r18 2bd1c: 32 96 adiw r30, 0x02 ; 2 2bd1e: a5 91 lpm r26, Z+ 2bd20: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2bd22: f9 01 movw r30, r18 2bd24: 25 91 lpm r18, Z+ 2bd26: 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. ); 2bd28: b8 9f mul r27, r24 2bd2a: f0 01 movw r30, r0 2bd2c: a8 9f mul r26, r24 2bd2e: 00 0c add r0, r0 2bd30: e1 1d adc r30, r1 2bd32: 11 24 eor r1, r1 2bd34: 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); 2bd36: c9 01 movw r24, r18 2bd38: 8e 1b sub r24, r30 2bd3a: 9f 0b sbc r25, r31 2bd3c: 84 36 cpi r24, 0x64 ; 100 2bd3e: 91 05 cpc r25, r1 2bd40: 10 f4 brcc .+4 ; 0x2bd46 <__vector_17+0xc1c> 2bd42: 84 e6 ldi r24, 0x64 ; 100 2bd44: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 2bd46: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2bd4a: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> 2bd4e: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.491+0x1> 2bd52: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.491> acceleration_time += timer; 2bd56: 48 0f add r20, r24 2bd58: 59 1f adc r21, r25 2bd5a: 61 1d adc r22, r1 2bd5c: 71 1d adc r23, r1 2bd5e: 40 93 93 05 sts 0x0593, r20 ; 0x800593 2bd62: 50 93 94 05 sts 0x0594, r21 ; 0x800594 2bd66: 60 93 95 05 sts 0x0595, r22 ; 0x800595 2bd6a: 70 93 96 05 sts 0x0596, r23 ; 0x800596 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2bd6e: fe 01 movw r30, r28 2bd70: e4 5b subi r30, 0xB4 ; 180 2bd72: ff 4f sbci r31, 0xFF ; 255 2bd74: 80 81 ld r24, Z 2bd76: 81 11 cpse r24, r1 2bd78: 7d c0 rjmp .+250 ; 0x2be74 <__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; 2bd7a: 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) { 2bd7c: 80 ff sbrs r24, 0 2bd7e: 16 c0 rjmp .+44 ; 0x2bdac <__vector_17+0xc82> LA_phase = -1; 2bd80: 9f ef ldi r25, 0xFF ; 255 2bd82: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f if (current_adv_steps == target_adv_steps) { 2bd86: e0 91 df 04 lds r30, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2bd8a: f0 91 e0 04 lds r31, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2bd8e: 20 91 91 05 lds r18, 0x0591 ; 0x800591 2bd92: 30 91 92 05 lds r19, 0x0592 ; 0x800592 2bd96: e2 17 cp r30, r18 2bd98: f3 07 cpc r31, r19 2bd9a: 09 f0 breq .+2 ; 0x2bd9e <__vector_17+0xc74> 2bd9c: 24 c2 rjmp .+1096 ; 0x2c1e6 <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 2bd9e: 8f ef ldi r24, 0xFF ; 255 2bda0: 9f ef ldi r25, 0xFF ; 255 2bda2: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2bda6: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> 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; 2bdaa: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 2bdac: 80 fd sbrc r24, 0 2bdae: 07 c0 rjmp .+14 ; 0x2bdbe <__vector_17+0xc94> 2bdb0: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> 2bdb4: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2bdb8: 01 96 adiw r24, 0x01 ; 1 2bdba: 09 f4 brne .+2 ; 0x2bdbe <__vector_17+0xc94> 2bdbc: b2 c2 rjmp .+1380 ; 0x2c322 <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 2bdbe: e0 91 e1 04 lds r30, 0x04E1 ; 0x8004e1 <_ZL9main_Rate.lto_priv.491> 2bdc2: f0 91 e2 04 lds r31, 0x04E2 ; 0x8004e2 <_ZL9main_Rate.lto_priv.491+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 2bdc6: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2bdca: 90 91 71 05 lds r25, 0x0571 ; 0x800571 2bdce: a0 91 72 05 lds r26, 0x0572 ; 0x800572 2bdd2: b0 91 73 05 lds r27, 0x0573 ; 0x800573 2bdd6: 8e 0f add r24, r30 2bdd8: 9f 1f adc r25, r31 2bdda: a1 1d adc r26, r1 2bddc: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 2bdde: c3 5b subi r28, 0xB3 ; 179 2bde0: df 4f sbci r29, 0xFF ; 255 2bde2: 08 81 ld r16, Y 2bde4: 19 81 ldd r17, Y+1 ; 0x01 2bde6: 30 e0 ldi r19, 0x00 ; 0 2bde8: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 2bdea: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 2bdec: 80 17 cp r24, r16 2bdee: 91 07 cpc r25, r17 2bdf0: a2 07 cpc r26, r18 2bdf2: b3 07 cpc r27, r19 2bdf4: 08 f4 brcc .+2 ; 0x2bdf8 <__vector_17+0xcce> 2bdf6: 27 c2 rjmp .+1102 ; 0x2c246 <__vector_17+0x111c> { ++ticks; 2bdf8: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 2bdfa: 80 1b sub r24, r16 2bdfc: 91 0b sbc r25, r17 2bdfe: a2 0b sbc r26, r18 2be00: b3 0b sbc r27, r19 2be02: f4 cf rjmp .-24 ; 0x2bdec <__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); 2be04: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2be08: 8f 7b andi r24, 0xBF ; 191 2be0a: 11 cf rjmp .-478 ; 0x2bc2e <__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; 2be0c: 80 e4 ldi r24, 0x40 ; 64 2be0e: 9c e9 ldi r25, 0x9C ; 156 2be10: 6e cf rjmp .-292 ; 0x2bcee <__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 2be12: 81 31 cpi r24, 0x11 ; 17 2be14: e7 e2 ldi r30, 0x27 ; 39 2be16: 9e 07 cpc r25, r30 2be18: 20 f0 brcs .+8 ; 0x2be22 <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 2be1a: 96 95 lsr r25 2be1c: 87 95 ror r24 step_loops = 2; 2be1e: 22 e0 ldi r18, 0x02 ; 2 2be20: 6b cf rjmp .-298 ; 0x2bcf8 <__vector_17+0xbce> } else { step_loops = 1; 2be22: 21 e0 ldi r18, 0x01 ; 1 2be24: 20 93 97 05 sts 0x0597, r18 ; 0x800597 2be28: 80 32 cpi r24, 0x20 ; 32 2be2a: 91 05 cpc r25, r1 2be2c: 08 f0 brcs .+2 ; 0x2be30 <__vector_17+0xd06> 2be2e: 66 cf rjmp .-308 ; 0x2bcfc <__vector_17+0xbd2> 2be30: 80 e2 ldi r24, 0x20 ; 32 2be32: 90 e0 ldi r25, 0x00 ; 0 2be34: 63 cf rjmp .-314 ; 0x2bcfc <__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; 2be36: 9c 01 movw r18, r24 2be38: 36 95 lsr r19 2be3a: 27 95 ror r18 2be3c: 2c 7f andi r18, 0xFC ; 252 2be3e: 29 53 subi r18, 0x39 ; 57 2be40: 3c 46 sbci r19, 0x6C ; 108 timer = (unsigned short)pgm_read_word_near(table_address); 2be42: f9 01 movw r30, r18 2be44: a5 91 lpm r26, Z+ 2be46: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2be48: f9 01 movw r30, r18 2be4a: 32 96 adiw r30, 0x02 ; 2 2be4c: 05 91 lpm r16, Z+ 2be4e: 14 91 lpm r17, Z 2be50: 87 70 andi r24, 0x07 ; 7 2be52: 99 27 eor r25, r25 2be54: 80 9f mul r24, r16 2be56: 90 01 movw r18, r0 2be58: 81 9f mul r24, r17 2be5a: 30 0d add r19, r0 2be5c: 90 9f mul r25, r16 2be5e: 30 0d add r19, r0 2be60: 11 24 eor r1, r1 2be62: f3 e0 ldi r31, 0x03 ; 3 2be64: 36 95 lsr r19 2be66: 27 95 ror r18 2be68: fa 95 dec r31 2be6a: e1 f7 brne .-8 ; 0x2be64 <__vector_17+0xd3a> 2be6c: cd 01 movw r24, r26 2be6e: 82 1b sub r24, r18 2be70: 93 0b sbc r25, r19 2be72: 64 cf rjmp .-312 ; 0x2bd3c <__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) { 2be74: 40 91 7a 05 lds r20, 0x057A ; 0x80057a 2be78: 50 91 7b 05 lds r21, 0x057B ; 0x80057b 2be7c: 60 91 7c 05 lds r22, 0x057C ; 0x80057c 2be80: 70 91 7d 05 lds r23, 0x057D ; 0x80057d 2be84: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2be88: 90 e0 ldi r25, 0x00 ; 0 2be8a: b0 e0 ldi r27, 0x00 ; 0 2be8c: a0 e0 ldi r26, 0x00 ; 0 2be8e: 84 17 cp r24, r20 2be90: 95 07 cpc r25, r21 2be92: a6 07 cpc r26, r22 2be94: b7 07 cpc r27, r23 2be96: 08 f4 brcc .+2 ; 0x2be9a <__vector_17+0xd70> 2be98: 70 cf rjmp .-288 ; 0x2bd7a <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 2be9a: 80 91 7e 05 lds r24, 0x057E ; 0x80057e 2be9e: 81 11 cpse r24, r1 2bea0: 02 c0 rjmp .+4 ; 0x2bea6 <__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; 2bea2: 83 e0 ldi r24, 0x03 ; 3 2bea4: 6b cf rjmp .-298 ; 0x2bd7c <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 2bea6: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2beaa: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2beae: 20 91 91 05 lds r18, 0x0591 ; 0x800591 2beb2: 30 91 92 05 lds r19, 0x0592 ; 0x800592 2beb6: 28 17 cp r18, r24 2beb8: 39 07 cpc r19, r25 2beba: 98 f7 brcc .-26 ; 0x2bea2 <__vector_17+0xd78> target_adv_steps = current_adv_steps; 2bebc: 90 93 92 05 sts 0x0592, r25 ; 0x800592 2bec0: 80 93 91 05 sts 0x0591, r24 ; 0x800591 2bec4: ee cf rjmp .-36 ; 0x2bea2 <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 2bec6: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2beca: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 2bece: a0 91 7c 05 lds r26, 0x057C ; 0x80057c 2bed2: b0 91 7d 05 lds r27, 0x057D ; 0x80057d 2bed6: 4d 8d ldd r20, Y+29 ; 0x1d 2bed8: 5e 8d ldd r21, Y+30 ; 0x1e 2beda: 6f 8d ldd r22, Y+31 ; 0x1f 2bedc: 78 a1 ldd r23, Y+32 ; 0x20 2bede: 48 17 cp r20, r24 2bee0: 59 07 cpc r21, r25 2bee2: 6a 07 cpc r22, r26 2bee4: 7b 07 cpc r23, r27 2bee6: 08 f0 brcs .+2 ; 0x2beea <__vector_17+0xdc0> 2bee8: e3 c0 rjmp .+454 ; 0x2c0b0 <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 2beea: c0 90 9b 05 lds r12, 0x059B ; 0x80059b 2beee: d0 90 9c 05 lds r13, 0x059C ; 0x80059c 2bef2: e0 90 9d 05 lds r14, 0x059D ; 0x80059d 2bef6: f0 90 9e 05 lds r15, 0x059E ; 0x80059e "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. ); 2befa: 6c 88 ldd r6, Y+20 ; 0x14 2befc: 7d 88 ldd r7, Y+21 ; 0x15 2befe: 8e 88 ldd r8, Y+22 ; 0x16 2bf00: aa 27 eor r26, r26 2bf02: c7 9c mul r12, r7 2bf04: b1 2d mov r27, r1 2bf06: d8 9c mul r13, r8 2bf08: f0 01 movw r30, r0 2bf0a: e8 9c mul r14, r8 2bf0c: f0 0d add r31, r0 2bf0e: e7 9c mul r14, r7 2bf10: e0 0d add r30, r0 2bf12: f1 1d adc r31, r1 2bf14: c8 9c mul r12, r8 2bf16: b0 0d add r27, r0 2bf18: e1 1d adc r30, r1 2bf1a: fa 1f adc r31, r26 2bf1c: d7 9c mul r13, r7 2bf1e: b0 0d add r27, r0 2bf20: e1 1d adc r30, r1 2bf22: fa 1f adc r31, r26 2bf24: e6 9c mul r14, r6 2bf26: b0 0d add r27, r0 2bf28: e1 1d adc r30, r1 2bf2a: fa 1f adc r31, r26 2bf2c: d6 9c mul r13, r6 2bf2e: b1 0d add r27, r1 2bf30: ea 1f adc r30, r26 2bf32: fa 1f adc r31, r26 2bf34: bb 0f add r27, r27 2bf36: ea 1f adc r30, r26 2bf38: fa 1f adc r31, r26 2bf3a: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 2bf3c: 20 91 98 05 lds r18, 0x0598 ; 0x800598 2bf40: 30 91 99 05 lds r19, 0x0599 ; 0x800599 2bf44: 8e ad ldd r24, Y+62 ; 0x3e 2bf46: 9f ad ldd r25, Y+63 ; 0x3f 2bf48: 2e 17 cp r18, r30 2bf4a: 3f 07 cpc r19, r31 2bf4c: 30 f0 brcs .+12 ; 0x2bf5a <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 2bf4e: 2e 1b sub r18, r30 2bf50: 3f 0b sbc r19, r31 2bf52: 82 17 cp r24, r18 2bf54: 93 07 cpc r25, r19 2bf56: 08 f4 brcc .+2 ; 0x2bf5a <__vector_17+0xe30> 2bf58: 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; 2bf5a: 81 34 cpi r24, 0x41 ; 65 2bf5c: 2c e9 ldi r18, 0x9C ; 156 2bf5e: 92 07 cpc r25, r18 2bf60: 08 f0 brcs .+2 ; 0x2bf64 <__vector_17+0xe3a> 2bf62: 75 c0 rjmp .+234 ; 0x2c04e <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2bf64: 81 32 cpi r24, 0x21 ; 33 2bf66: ee e4 ldi r30, 0x4E ; 78 2bf68: 9e 07 cpc r25, r30 2bf6a: 08 f4 brcc .+2 ; 0x2bf6e <__vector_17+0xe44> 2bf6c: 73 c0 rjmp .+230 ; 0x2c054 <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 2bf6e: 96 95 lsr r25 2bf70: 87 95 ror r24 2bf72: 96 95 lsr r25 2bf74: 87 95 ror r24 step_loops = 4; 2bf76: 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; 2bf78: 20 93 97 05 sts 0x0597, r18 ; 0x800597 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2bf7c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2bf7e: 81 15 cp r24, r1 2bf80: 28 e0 ldi r18, 0x08 ; 8 2bf82: 92 07 cpc r25, r18 2bf84: 08 f4 brcc .+2 ; 0x2bf88 <__vector_17+0xe5e> 2bf86: 78 c0 rjmp .+240 ; 0x2c078 <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2bf88: e9 2f mov r30, r25 2bf8a: ff 27 eor r31, r31 2bf8c: ee 0f add r30, r30 2bf8e: ff 1f adc r31, r31 2bf90: ee 0f add r30, r30 2bf92: ff 1f adc r31, r31 2bf94: 9f 01 movw r18, r30 2bf96: 29 53 subi r18, 0x39 ; 57 2bf98: 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); 2bf9a: f9 01 movw r30, r18 2bf9c: 32 96 adiw r30, 0x02 ; 2 2bf9e: a5 91 lpm r26, Z+ 2bfa0: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2bfa2: f9 01 movw r30, r18 2bfa4: 25 91 lpm r18, Z+ 2bfa6: 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. ); 2bfa8: b8 9f mul r27, r24 2bfaa: f0 01 movw r30, r0 2bfac: a8 9f mul r26, r24 2bfae: 00 0c add r0, r0 2bfb0: e1 1d adc r30, r1 2bfb2: 11 24 eor r1, r1 2bfb4: 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); 2bfb6: 2e 1b sub r18, r30 2bfb8: 3f 0b sbc r19, r31 2bfba: c9 01 movw r24, r18 2bfbc: 24 36 cpi r18, 0x64 ; 100 2bfbe: 31 05 cpc r19, r1 2bfc0: 10 f4 brcc .+4 ; 0x2bfc6 <__vector_17+0xe9c> 2bfc2: 84 e6 ldi r24, 0x64 ; 100 2bfc4: 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); 2bfc6: 90 93 e6 04 sts 0x04E6, r25 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2bfca: 80 93 e5 04 sts 0x04E5, r24 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> 2bfce: 90 93 e2 04 sts 0x04E2, r25 ; 0x8004e2 <_ZL9main_Rate.lto_priv.491+0x1> 2bfd2: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 <_ZL9main_Rate.lto_priv.491> deceleration_time += timer; 2bfd6: c8 0e add r12, r24 2bfd8: d9 1e adc r13, r25 2bfda: e1 1c adc r14, r1 2bfdc: f1 1c adc r15, r1 2bfde: c0 92 9b 05 sts 0x059B, r12 ; 0x80059b 2bfe2: d0 92 9c 05 sts 0x059C, r13 ; 0x80059c 2bfe6: e0 92 9d 05 sts 0x059D, r14 ; 0x80059d 2bfea: f0 92 9e 05 sts 0x059E, r15 ; 0x80059e #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2bfee: fe 01 movw r30, r28 2bff0: e4 5b subi r30, 0xB4 ; 180 2bff2: ff 4f sbci r31, 0xFF ; 255 2bff4: 80 81 ld r24, Z 2bff6: 88 23 and r24, r24 2bff8: 09 f4 brne .+2 ; 0x2bffc <__vector_17+0xed2> 2bffa: bf ce rjmp .-642 ; 0x2bd7a <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 2bffc: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2c000: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 2c004: a0 91 7c 05 lds r26, 0x057C ; 0x80057c 2c008: b0 91 7d 05 lds r27, 0x057D ; 0x80057d 2c00c: 20 91 97 05 lds r18, 0x0597 ; 0x800597 2c010: 42 0f add r20, r18 2c012: 51 1d adc r21, r1 2c014: 61 1d adc r22, r1 2c016: 71 1d adc r23, r1 2c018: 48 17 cp r20, r24 2c01a: 59 07 cpc r21, r25 2c01c: 6a 07 cpc r22, r26 2c01e: 7b 07 cpc r23, r27 2c020: 08 f4 brcc .+2 ; 0x2c024 <__vector_17+0xefa> 2c022: ab ce rjmp .-682 ; 0x2bd7a <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 2c024: 35 96 adiw r30, 0x05 ; 5 2c026: 20 81 ld r18, Z 2c028: 31 81 ldd r19, Z+1 ; 0x01 2c02a: 30 93 92 05 sts 0x0592, r19 ; 0x800592 2c02e: 20 93 91 05 sts 0x0591, r18 ; 0x800591 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 2c032: 80 91 7e 05 lds r24, 0x057E ; 0x80057e 2c036: 88 23 and r24, r24 2c038: 09 f4 brne .+2 ; 0x2c03c <__vector_17+0xf12> 2c03a: 33 cf rjmp .-410 ; 0x2bea2 <__vector_17+0xd78> 2c03c: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2c040: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2c044: 82 17 cp r24, r18 2c046: 93 07 cpc r25, r19 2c048: 08 f0 brcs .+2 ; 0x2c04c <__vector_17+0xf22> 2c04a: 2b cf rjmp .-426 ; 0x2bea2 <__vector_17+0xd78> 2c04c: 37 cf rjmp .-402 ; 0x2bebc <__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; 2c04e: 80 e4 ldi r24, 0x40 ; 64 2c050: 9c e9 ldi r25, 0x9C ; 156 2c052: 8d cf rjmp .-230 ; 0x2bf6e <__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 2c054: 81 31 cpi r24, 0x11 ; 17 2c056: f7 e2 ldi r31, 0x27 ; 39 2c058: 9f 07 cpc r25, r31 2c05a: 20 f0 brcs .+8 ; 0x2c064 <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 2c05c: 96 95 lsr r25 2c05e: 87 95 ror r24 step_loops = 2; 2c060: 22 e0 ldi r18, 0x02 ; 2 2c062: 8a cf rjmp .-236 ; 0x2bf78 <__vector_17+0xe4e> } else { step_loops = 1; 2c064: 21 e0 ldi r18, 0x01 ; 1 2c066: 20 93 97 05 sts 0x0597, r18 ; 0x800597 2c06a: 80 32 cpi r24, 0x20 ; 32 2c06c: 91 05 cpc r25, r1 2c06e: 08 f0 brcs .+2 ; 0x2c072 <__vector_17+0xf48> 2c070: 85 cf rjmp .-246 ; 0x2bf7c <__vector_17+0xe52> 2c072: 80 e2 ldi r24, 0x20 ; 32 2c074: 90 e0 ldi r25, 0x00 ; 0 2c076: 82 cf rjmp .-252 ; 0x2bf7c <__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; 2c078: dc 01 movw r26, r24 2c07a: b6 95 lsr r27 2c07c: a7 95 ror r26 2c07e: ac 7f andi r26, 0xFC ; 252 2c080: a9 53 subi r26, 0x39 ; 57 2c082: bc 46 sbci r27, 0x6C ; 108 timer = (unsigned short)pgm_read_word_near(table_address); 2c084: fd 01 movw r30, r26 2c086: 25 91 lpm r18, Z+ 2c088: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c08a: fd 01 movw r30, r26 2c08c: 32 96 adiw r30, 0x02 ; 2 2c08e: a5 91 lpm r26, Z+ 2c090: b4 91 lpm r27, Z 2c092: 87 70 andi r24, 0x07 ; 7 2c094: 99 27 eor r25, r25 2c096: 8a 9f mul r24, r26 2c098: f0 01 movw r30, r0 2c09a: 8b 9f mul r24, r27 2c09c: f0 0d add r31, r0 2c09e: 9a 9f mul r25, r26 2c0a0: f0 0d add r31, r0 2c0a2: 11 24 eor r1, r1 2c0a4: a3 e0 ldi r26, 0x03 ; 3 2c0a6: f6 95 lsr r31 2c0a8: e7 95 ror r30 2c0aa: aa 95 dec r26 2c0ac: e1 f7 brne .-8 ; 0x2c0a6 <__vector_17+0xf7c> 2c0ae: 83 cf rjmp .-250 ; 0x2bfb6 <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 2c0b0: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2c0b4: 88 23 and r24, r24 2c0b6: 71 f0 breq .+28 ; 0x2c0d4 <__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; 2c0b8: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 2c0ba: 20 91 74 05 lds r18, 0x0574 ; 0x800574 2c0be: 30 91 75 05 lds r19, 0x0575 ; 0x800575 2c0c2: 30 93 e6 04 sts 0x04E6, r19 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2c0c6: 20 93 e5 04 sts 0x04E5, r18 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> 2c0ca: 30 93 e2 04 sts 0x04E2, r19 ; 0x8004e2 <_ZL9main_Rate.lto_priv.491+0x1> 2c0ce: 20 93 e1 04 sts 0x04E1, r18 ; 0x8004e1 <_ZL9main_Rate.lto_priv.491> 2c0d2: 54 ce rjmp .-856 ; 0x2bd7c <__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); 2c0d4: 8e a9 ldd r24, Y+54 ; 0x36 2c0d6: 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; 2c0d8: 81 34 cpi r24, 0x41 ; 65 2c0da: 4c e9 ldi r20, 0x9C ; 156 2c0dc: 94 07 cpc r25, r20 2c0de: 08 f0 brcs .+2 ; 0x2c0e2 <__vector_17+0xfb8> 2c0e0: 4e c0 rjmp .+156 ; 0x2c17e <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2c0e2: 81 32 cpi r24, 0x21 ; 33 2c0e4: 5e e4 ldi r21, 0x4E ; 78 2c0e6: 95 07 cpc r25, r21 2c0e8: 08 f4 brcc .+2 ; 0x2c0ec <__vector_17+0xfc2> 2c0ea: 4c c0 rjmp .+152 ; 0x2c184 <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 2c0ec: 96 95 lsr r25 2c0ee: 87 95 ror r24 2c0f0: 96 95 lsr r25 2c0f2: 87 95 ror r24 step_loops = 4; 2c0f4: 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; 2c0f6: 20 93 97 05 sts 0x0597, r18 ; 0x800597 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c0fa: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c0fc: 81 15 cp r24, r1 2c0fe: f8 e0 ldi r31, 0x08 ; 8 2c100: 9f 07 cpc r25, r31 2c102: 08 f4 brcc .+2 ; 0x2c106 <__vector_17+0xfdc> 2c104: 51 c0 rjmp .+162 ; 0x2c1a8 <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c106: e9 2f mov r30, r25 2c108: ff 27 eor r31, r31 2c10a: ee 0f add r30, r30 2c10c: ff 1f adc r31, r31 2c10e: ee 0f add r30, r30 2c110: ff 1f adc r31, r31 2c112: 9f 01 movw r18, r30 2c114: 29 53 subi r18, 0x39 ; 57 2c116: 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); 2c118: f9 01 movw r30, r18 2c11a: 32 96 adiw r30, 0x02 ; 2 2c11c: 65 91 lpm r22, Z+ 2c11e: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c120: f9 01 movw r30, r18 2c122: 25 91 lpm r18, Z+ 2c124: 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. ); 2c126: 78 9f mul r23, r24 2c128: a0 01 movw r20, r0 2c12a: 68 9f mul r22, r24 2c12c: 00 0c add r0, r0 2c12e: 41 1d adc r20, r1 2c130: 11 24 eor r1, r1 2c132: 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); 2c134: c9 01 movw r24, r18 2c136: 84 1b sub r24, r20 2c138: 95 0b sbc r25, r21 2c13a: 84 36 cpi r24, 0x64 ; 100 2c13c: 91 05 cpc r25, r1 2c13e: 10 f4 brcc .+4 ; 0x2c144 <__vector_17+0x101a> 2c140: 84 e6 ldi r24, 0x64 ; 100 2c142: 90 e0 ldi r25, 0x00 ; 0 2c144: 90 93 75 05 sts 0x0575, r25 ; 0x800575 2c148: 80 93 74 05 sts 0x0574, r24 ; 0x800574 step_loops_nominal = step_loops; 2c14c: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2c150: 80 93 9a 05 sts 0x059A, r24 ; 0x80059a #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 2c154: fe 01 movw r30, r28 2c156: e4 5b subi r30, 0xB4 ; 180 2c158: ff 4f sbci r31, 0xFF ; 255 2c15a: 80 81 ld r24, Z 2c15c: 88 23 and r24, r24 2c15e: 09 f4 brne .+2 ; 0x2c162 <__vector_17+0x1038> 2c160: ab cf rjmp .-170 ; 0x2c0b8 <__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) 2c162: 80 91 7e 05 lds r24, 0x057E ; 0x80057e 2c166: 88 23 and r24, r24 2c168: 41 f0 breq .+16 ; 0x2c17a <__vector_17+0x1050> target_adv_steps = current_adv_steps; 2c16a: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2c16e: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2c172: 90 93 92 05 sts 0x0592, r25 ; 0x800592 2c176: 80 93 91 05 sts 0x0591, r24 ; 0x800591 #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; 2c17a: 81 e0 ldi r24, 0x01 ; 1 2c17c: 9e cf rjmp .-196 ; 0x2c0ba <__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; 2c17e: 80 e4 ldi r24, 0x40 ; 64 2c180: 9c e9 ldi r25, 0x9C ; 156 2c182: b4 cf rjmp .-152 ; 0x2c0ec <__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 2c184: 81 31 cpi r24, 0x11 ; 17 2c186: e7 e2 ldi r30, 0x27 ; 39 2c188: 9e 07 cpc r25, r30 2c18a: 20 f0 brcs .+8 ; 0x2c194 <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 2c18c: 96 95 lsr r25 2c18e: 87 95 ror r24 step_loops = 2; 2c190: 22 e0 ldi r18, 0x02 ; 2 2c192: b1 cf rjmp .-158 ; 0x2c0f6 <__vector_17+0xfcc> } else { step_loops = 1; 2c194: 21 e0 ldi r18, 0x01 ; 1 2c196: 20 93 97 05 sts 0x0597, r18 ; 0x800597 2c19a: 80 32 cpi r24, 0x20 ; 32 2c19c: 91 05 cpc r25, r1 2c19e: 08 f0 brcs .+2 ; 0x2c1a2 <__vector_17+0x1078> 2c1a0: ac cf rjmp .-168 ; 0x2c0fa <__vector_17+0xfd0> 2c1a2: 80 e2 ldi r24, 0x20 ; 32 2c1a4: 90 e0 ldi r25, 0x00 ; 0 2c1a6: a9 cf rjmp .-174 ; 0x2c0fa <__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; 2c1a8: 9c 01 movw r18, r24 2c1aa: 36 95 lsr r19 2c1ac: 27 95 ror r18 2c1ae: 2c 7f andi r18, 0xFC ; 252 2c1b0: 29 53 subi r18, 0x39 ; 57 2c1b2: 3c 46 sbci r19, 0x6C ; 108 timer = (unsigned short)pgm_read_word_near(table_address); 2c1b4: f9 01 movw r30, r18 2c1b6: 45 91 lpm r20, Z+ 2c1b8: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c1ba: f9 01 movw r30, r18 2c1bc: 32 96 adiw r30, 0x02 ; 2 2c1be: 65 91 lpm r22, Z+ 2c1c0: 74 91 lpm r23, Z 2c1c2: 87 70 andi r24, 0x07 ; 7 2c1c4: 99 27 eor r25, r25 2c1c6: 86 9f mul r24, r22 2c1c8: 90 01 movw r18, r0 2c1ca: 87 9f mul r24, r23 2c1cc: 30 0d add r19, r0 2c1ce: 96 9f mul r25, r22 2c1d0: 30 0d add r19, r0 2c1d2: 11 24 eor r1, r1 2c1d4: a3 e0 ldi r26, 0x03 ; 3 2c1d6: 36 95 lsr r19 2c1d8: 27 95 ror r18 2c1da: aa 95 dec r26 2c1dc: e1 f7 brne .-8 ; 0x2c1d6 <__vector_17+0x10ac> 2c1de: ca 01 movw r24, r20 2c1e0: 82 1b sub r24, r18 2c1e2: 93 0b sbc r25, r19 2c1e4: aa cf rjmp .-172 ; 0x2c13a <__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; 2c1e6: de 01 movw r26, r28 2c1e8: a3 5b subi r26, 0xB3 ; 179 2c1ea: bf 4f sbci r27, 0xFF ; 255 2c1ec: 4d 91 ld r20, X+ 2c1ee: 5c 91 ld r21, X 2c1f0: 11 97 sbiw r26, 0x01 ; 1 2c1f2: 70 e0 ldi r23, 0x00 ; 0 2c1f4: 60 e0 ldi r22, 0x00 ; 0 2c1f6: 40 93 70 05 sts 0x0570, r20 ; 0x800570 2c1fa: 50 93 71 05 sts 0x0571, r21 ; 0x800571 2c1fe: 60 93 72 05 sts 0x0572, r22 ; 0x800572 2c202: 70 93 73 05 sts 0x0573, r23 ; 0x800573 e_step_loops = current_block->advance_step_loops; 2c206: 16 96 adiw r26, 0x06 ; 6 2c208: 9c 91 ld r25, X 2c20a: 90 93 6f 05 sts 0x056F, r25 ; 0x80056f if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 2c20e: 98 2f mov r25, r24 2c210: 92 70 andi r25, 0x02 ; 2 2c212: 09 f4 brne .+2 ; 0x2c216 <__vector_17+0x10ec> 2c214: cb cd rjmp .-1130 ; 0x2bdac <__vector_17+0xc82> 2c216: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2c21a: 99 23 and r25, r25 2c21c: 09 f4 brne .+2 ; 0x2c220 <__vector_17+0x10f6> 2c21e: c6 cd rjmp .-1140 ; 0x2bdac <__vector_17+0xc82> 2c220: 2e 17 cp r18, r30 2c222: 3f 07 cpc r19, r31 2c224: 08 f0 brcs .+2 ; 0x2c228 <__vector_17+0x10fe> 2c226: c2 cd rjmp .-1148 ; 0x2bdac <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2c228: 44 0f add r20, r20 2c22a: 55 1f adc r21, r21 2c22c: 66 1f adc r22, r22 2c22e: 77 1f adc r23, r23 2c230: 40 93 70 05 sts 0x0570, r20 ; 0x800570 2c234: 50 93 71 05 sts 0x0571, r21 ; 0x800571 2c238: 60 93 72 05 sts 0x0572, r22 ; 0x800572 2c23c: 70 93 73 05 sts 0x0573, r23 ; 0x800573 LA_phase = 0; 2c240: 10 92 8f 05 sts 0x058F, r1 ; 0x80058f 2c244: b3 cd rjmp .-1178 ; 0x2bdac <__vector_17+0xc82> 2c246: 80 93 70 05 sts 0x0570, r24 ; 0x800570 2c24a: 90 93 71 05 sts 0x0571, r25 ; 0x800571 2c24e: a0 93 72 05 sts 0x0572, r26 ; 0x800572 2c252: b0 93 73 05 sts 0x0573, r27 ; 0x800573 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 2c256: 61 11 cpse r22, r1 2c258: 1b c0 rjmp .+54 ; 0x2c290 <__vector_17+0x1166> { eISR_Rate = timer; 2c25a: f0 93 6e 05 sts 0x056E, r31 ; 0x80056e 2c25e: e0 93 6d 05 sts 0x056D, r30 ; 0x80056d nextAdvanceISR = timer; 2c262: f0 93 e4 04 sts 0x04E4, r31 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2c266: e0 93 e3 04 sts 0x04E3, r30 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 2c26a: 80 91 8f 05 lds r24, 0x058F ; 0x80058f 2c26e: 87 fd sbrc r24, 7 2c270: 58 c0 rjmp .+176 ; 0x2c322 <__vector_17+0x11f8> if (step_loops == e_step_loops) 2c272: 80 91 97 05 lds r24, 0x0597 ; 0x800597 2c276: 10 91 6f 05 lds r17, 0x056F ; 0x80056f 2c27a: 28 81 ld r18, Y 2c27c: 39 81 ldd r19, Y+1 ; 0x01 2c27e: 81 13 cpse r24, r17 2c280: 35 c0 rjmp .+106 ; 0x2c2ec <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 2c282: 81 e0 ldi r24, 0x01 ; 1 2c284: 2e 17 cp r18, r30 2c286: 3f 07 cpc r19, r31 2c288: 08 f4 brcc .+2 ; 0x2c28c <__vector_17+0x1162> 2c28a: 49 c0 rjmp .+146 ; 0x2c31e <__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); 2c28c: 80 e0 ldi r24, 0x00 ; 0 2c28e: 47 c0 rjmp .+142 ; 0x2c31e <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 2c290: 64 30 cpi r22, 0x04 ; 4 2c292: 28 f5 brcc .+74 ; 0x2c2de <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 2c294: 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); 2c296: 63 30 cpi r22, 0x03 ; 3 2c298: a9 f0 breq .+42 ; 0x2c2c4 <__vector_17+0x119a> 2c29a: 66 95 lsr r22 2c29c: af 01 movw r20, r30 2c29e: 02 c0 rjmp .+4 ; 0x2c2a4 <__vector_17+0x117a> 2c2a0: 56 95 lsr r21 2c2a2: 47 95 ror r20 2c2a4: 6a 95 dec r22 2c2a6: e2 f7 brpl .-8 ; 0x2c2a0 <__vector_17+0x1176> 2c2a8: 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); 2c2aa: 70 93 6e 05 sts 0x056E, r23 ; 0x80056e 2c2ae: 60 93 6d 05 sts 0x056D, r22 ; 0x80056d } nextAdvanceISR = eISR_Rate; 2c2b2: 80 91 6d 05 lds r24, 0x056D ; 0x80056d 2c2b6: 90 91 6e 05 lds r25, 0x056E ; 0x80056e 2c2ba: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2c2be: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> 2c2c2: d3 cf rjmp .-90 ; 0x2c26a <__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; 2c2c4: 9f 01 movw r18, r30 2c2c6: ab ea ldi r26, 0xAB ; 171 2c2c8: ba ea ldi r27, 0xAA ; 170 2c2ca: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 2c2ce: 41 e1 ldi r20, 0x11 ; 17 2c2d0: 96 95 lsr r25 2c2d2: 87 95 ror r24 2c2d4: 77 95 ror r23 2c2d6: 67 95 ror r22 2c2d8: 4a 95 dec r20 2c2da: d1 f7 brne .-12 ; 0x2c2d0 <__vector_17+0x11a6> 2c2dc: e6 cf rjmp .-52 ; 0x2c2aa <__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); 2c2de: 70 e0 ldi r23, 0x00 ; 0 2c2e0: 6f 5f subi r22, 0xFF ; 255 2c2e2: 7f 4f sbci r23, 0xFF ; 255 2c2e4: cf 01 movw r24, r30 2c2e6: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 2c2ea: df cf rjmp .-66 ; 0x2c2aa <__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); 2c2ec: 83 30 cpi r24, 0x03 ; 3 2c2ee: 09 f4 brne .+2 ; 0x2c2f2 <__vector_17+0x11c8> 2c2f0: cf c0 rjmp .+414 ; 0x2c490 <__vector_17+0x1366> 2c2f2: 86 95 lsr r24 2c2f4: a9 01 movw r20, r18 2c2f6: 02 c0 rjmp .+4 ; 0x2c2fc <__vector_17+0x11d2> 2c2f8: 56 95 lsr r21 2c2fa: 47 95 ror r20 2c2fc: 8a 95 dec r24 2c2fe: e2 f7 brpl .-8 ; 0x2c2f8 <__vector_17+0x11ce> 2c300: 13 30 cpi r17, 0x03 ; 3 2c302: 09 f4 brne .+2 ; 0x2c306 <__vector_17+0x11dc> 2c304: d3 c0 rjmp .+422 ; 0x2c4ac <__vector_17+0x1382> 2c306: 16 95 lsr r17 2c308: bf 01 movw r22, r30 2c30a: 02 c0 rjmp .+4 ; 0x2c310 <__vector_17+0x11e6> 2c30c: 76 95 lsr r23 2c30e: 67 95 ror r22 2c310: 1a 95 dec r17 2c312: e2 f7 brpl .-8 ; 0x2c30c <__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); 2c314: 81 e0 ldi r24, 0x01 ; 1 2c316: 46 17 cp r20, r22 2c318: 57 07 cpc r21, r23 2c31a: 08 f0 brcs .+2 ; 0x2c31e <__vector_17+0x11f4> 2c31c: b7 cf rjmp .-146 ; 0x2c28c <__vector_17+0x1162> 2c31e: 80 93 8f 05 sts 0x058F, r24 ; 0x80058f } } // 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(); 2c322: 0f 94 29 21 call 0x24252 ; 0x24252 #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 2c326: 40 91 7a 05 lds r20, 0x057A ; 0x80057a 2c32a: 50 91 7b 05 lds r21, 0x057B ; 0x80057b 2c32e: 60 91 7c 05 lds r22, 0x057C ; 0x80057c 2c332: 70 91 7d 05 lds r23, 0x057D ; 0x80057d 2c336: e0 91 9f 05 lds r30, 0x059F ; 0x80059f 2c33a: f0 91 a0 05 lds r31, 0x05A0 ; 0x8005a0 2c33e: 80 89 ldd r24, Z+16 ; 0x10 2c340: 91 89 ldd r25, Z+17 ; 0x11 2c342: a2 89 ldd r26, Z+18 ; 0x12 2c344: b3 89 ldd r27, Z+19 ; 0x13 2c346: 48 17 cp r20, r24 2c348: 59 07 cpc r21, r25 2c34a: 6a 07 cpc r22, r26 2c34c: 7b 07 cpc r23, r27 2c34e: 80 f0 brcs .+32 ; 0x2c370 <__vector_17+0x1246> current_block = NULL; 2c350: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 2c354: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f 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) { 2c358: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 2c35c: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 2c360: 98 17 cp r25, r24 2c362: 31 f0 breq .+12 ; 0x2c370 <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c364: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 2c368: 8f 5f subi r24, 0xFF ; 255 2c36a: 8f 70 andi r24, 0x0F ; 15 2c36c: 80 93 54 0e sts 0x0E54, r24 ; 0x800e54 return mask; } void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) 2c370: 80 91 69 06 lds r24, 0x0669 ; 0x800669 2c374: 81 30 cpi r24, 0x01 ; 1 2c376: 49 f1 breq .+82 ; 0x2c3ca <__vector_17+0x12a0> 2c378: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2c37c: 88 23 and r24, r24 2c37e: 29 f1 breq .+74 ; 0x2c3ca <__vector_17+0x12a0> 2c380: 80 91 3d 06 lds r24, 0x063D ; 0x80063d 2c384: 81 11 cpse r24, r1 2c386: 21 c0 rjmp .+66 ; 0x2c3ca <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 2c388: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c38c: 81 e0 ldi r24, 0x01 ; 1 2c38e: 29 2f mov r18, r25 2c390: 24 70 andi r18, 0x04 ; 4 2c392: 92 fd sbrc r25, 2 2c394: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 2c396: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c39a: 82 60 ori r24, 0x02 ; 2 2c39c: 97 ff sbrs r25, 7 2c39e: 03 c0 rjmp .+6 ; 0x2c3a6 <__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) { 2c3a0: 21 11 cpse r18, r1 2c3a2: 13 c0 rjmp .+38 ; 0x2c3ca <__vector_17+0x12a0> 2c3a4: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 2c3a6: 80 93 0d 05 sts 0x050D, r24 ; 0x80050d tmc2130_sg_stop_on_crash = false; 2c3aa: 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 2c3ae: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.494+0x8> 2c3b2: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.494+0x9> 2c3b6: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.494+0xa> 2c3ba: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.494+0xb> 2c3be: 20 e0 ldi r18, 0x00 ; 0 2c3c0: 30 e0 ldi r19, 0x00 ; 0 2c3c2: 40 e8 ldi r20, 0x80 ; 128 2c3c4: 5f eb ldi r21, 0xBF ; 191 2c3c6: 0e 94 f3 8a call 0x115e6 ; 0x115e6 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c3ca: 60 91 e3 04 lds r22, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> 2c3ce: 70 91 e4 04 lds r23, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> if (eisr) 2c3d2: 61 15 cp r22, r1 2c3d4: 71 05 cpc r23, r1 2c3d6: 09 f0 breq .+2 ; 0x2c3da <__vector_17+0x12b0> 2c3d8: 46 c0 rjmp .+140 ; 0x2c466 <__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) { 2c3da: 40 91 df 04 lds r20, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2c3de: 50 91 e0 04 lds r21, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2c3e2: 20 91 91 05 lds r18, 0x0591 ; 0x800591 2c3e6: 30 91 92 05 lds r19, 0x0592 ; 0x800592 2c3ea: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2c3ee: 24 17 cp r18, r20 2c3f0: 35 07 cpc r19, r21 2c3f2: 08 f0 brcs .+2 ; 0x2c3f6 <__vector_17+0x12cc> 2c3f4: 6c c0 rjmp .+216 ; 0x2c4ce <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 2c3f6: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c3fa: 91 30 cpi r25, 0x01 ; 1 2c3fc: 41 f0 breq .+16 ; 0x2c40e <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 2c3fe: 42 1b sub r20, r18 2c400: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 2c402: 94 17 cp r25, r20 2c404: 15 06 cpc r1, r21 2c406: 19 f0 breq .+6 ; 0x2c40e <__vector_17+0x12e4> 2c408: 10 f0 brcs .+4 ; 0x2c40e <__vector_17+0x12e4> e_step_loops = d_steps; 2c40a: 40 93 6f 05 sts 0x056F, r20 ; 0x80056f } e_steps -= e_step_loops; 2c40e: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c412: 89 1b sub r24, r25 2c414: 80 93 90 05 sts 0x0590, r24 ; 0x800590 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c418: 88 23 and r24, r24 2c41a: 39 f0 breq .+14 ; 0x2c42a <__vector_17+0x1300> 2c41c: 87 fd sbrc r24, 7 2c41e: 53 c0 rjmp .+166 ; 0x2c4c6 <__vector_17+0x139c> 2c420: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c424: 80 64 ori r24, 0x40 ; 64 2c426: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 2c42a: 20 91 6f 05 lds r18, 0x056F ; 0x80056f 2c42e: 80 91 df 04 lds r24, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2c432: 90 91 e0 04 lds r25, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2c436: 82 1b sub r24, r18 2c438: 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; 2c43a: 90 93 e0 04 sts 0x04E0, r25 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2c43e: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> } if (current_adv_steps == target_adv_steps) { 2c442: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2c446: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2c44a: 80 91 91 05 lds r24, 0x0591 ; 0x800591 2c44e: 90 91 92 05 lds r25, 0x0592 ; 0x800592 2c452: 28 17 cp r18, r24 2c454: 39 07 cpc r19, r25 2c456: 09 f0 breq .+2 ; 0x2c45a <__vector_17+0x1330> 2c458: 66 c0 rjmp .+204 ; 0x2c526 <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 2c45a: 8f ef ldi r24, 0xFF ; 255 2c45c: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c45e: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2c462: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c466: 40 91 90 05 lds r20, 0x0590 ; 0x800590 2c46a: 41 11 cpse r20, r1 2c46c: 61 c0 rjmp .+194 ; 0x2c530 <__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) 2c46e: 80 91 e3 04 lds r24, 0x04E3 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> 2c472: 90 91 e4 04 lds r25, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 2c476: 20 91 e5 04 lds r18, 0x04E5 ; 0x8004e5 <_ZL11nextMainISR.lto_priv.489> 2c47a: 30 91 e6 04 lds r19, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.489+0x1> 2c47e: 8f 3f cpi r24, 0xFF ; 255 2c480: 98 07 cpc r25, r24 2c482: 09 f0 breq .+2 ; 0x2c486 <__vector_17+0x135c> 2c484: 88 c0 rjmp .+272 ; 0x2c596 <__vector_17+0x146c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 2c486: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c48a: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c48e: 8e c0 rjmp .+284 ; 0x2c5ac <__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; 2c490: ab ea ldi r26, 0xAB ; 171 2c492: ba ea ldi r27, 0xAA ; 170 2c494: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 2c498: ab 01 movw r20, r22 2c49a: bc 01 movw r22, r24 2c49c: 31 e1 ldi r19, 0x11 ; 17 2c49e: 76 95 lsr r23 2c4a0: 67 95 ror r22 2c4a2: 57 95 ror r21 2c4a4: 47 95 ror r20 2c4a6: 3a 95 dec r19 2c4a8: d1 f7 brne .-12 ; 0x2c49e <__vector_17+0x1374> 2c4aa: 2a cf rjmp .-428 ; 0x2c300 <__vector_17+0x11d6> 2c4ac: 9f 01 movw r18, r30 2c4ae: ab ea ldi r26, 0xAB ; 171 2c4b0: ba ea ldi r27, 0xAA ; 170 2c4b2: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 2c4b6: 21 e1 ldi r18, 0x11 ; 17 2c4b8: 96 95 lsr r25 2c4ba: 87 95 ror r24 2c4bc: 77 95 ror r23 2c4be: 67 95 ror r22 2c4c0: 2a 95 dec r18 2c4c2: d1 f7 brne .-12 ; 0x2c4b8 <__vector_17+0x138e> 2c4c4: 27 cf rjmp .-434 ; 0x2c314 <__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); 2c4c6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c4ca: 8f 7b andi r24, 0xBF ; 191 2c4cc: ac cf rjmp .-168 ; 0x2c426 <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 2c4ce: 42 17 cp r20, r18 2c4d0: 53 07 cpc r21, r19 2c4d2: 08 f0 brcs .+2 ; 0x2c4d6 <__vector_17+0x13ac> 2c4d4: b6 cf rjmp .-148 ; 0x2c442 <__vector_17+0x1318> // compression if (e_step_loops != 1) { 2c4d6: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c4da: 91 30 cpi r25, 0x01 ; 1 2c4dc: 41 f0 breq .+16 ; 0x2c4ee <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 2c4de: 24 1b sub r18, r20 2c4e0: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 2c4e2: 92 17 cp r25, r18 2c4e4: 13 06 cpc r1, r19 2c4e6: 19 f0 breq .+6 ; 0x2c4ee <__vector_17+0x13c4> 2c4e8: 10 f0 brcs .+4 ; 0x2c4ee <__vector_17+0x13c4> e_step_loops = d_steps; 2c4ea: 20 93 6f 05 sts 0x056F, r18 ; 0x80056f } e_steps += e_step_loops; 2c4ee: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c4f2: 89 0f add r24, r25 2c4f4: 80 93 90 05 sts 0x0590, r24 ; 0x800590 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c4f8: 88 23 and r24, r24 2c4fa: 39 f0 breq .+14 ; 0x2c50a <__vector_17+0x13e0> 2c4fc: 87 fd sbrc r24, 7 2c4fe: 0f c0 rjmp .+30 ; 0x2c51e <__vector_17+0x13f4> 2c500: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c504: 80 64 ori r24, 0x40 ; 64 2c506: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 2c50a: 80 91 6f 05 lds r24, 0x056F ; 0x80056f 2c50e: 20 91 df 04 lds r18, 0x04DF ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> 2c512: 30 91 e0 04 lds r19, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 2c516: 82 0f add r24, r18 2c518: 93 2f mov r25, r19 2c51a: 91 1d adc r25, r1 2c51c: 8e cf rjmp .-228 ; 0x2c43a <__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); 2c51e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c522: 8f 7b andi r24, 0xBF ; 191 2c524: f0 cf rjmp .-32 ; 0x2c506 <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c526: 80 91 6d 05 lds r24, 0x056D ; 0x80056d 2c52a: 90 91 6e 05 lds r25, 0x056E ; 0x80056e 2c52e: 97 cf rjmp .-210 ; 0x2c45e <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c530: 80 91 8f 05 lds r24, 0x058F ; 0x80058f 2c534: 87 fd sbrc r24, 7 2c536: 0e c0 rjmp .+28 ; 0x2c554 <__vector_17+0x142a> 2c538: 08 2e mov r0, r24 2c53a: 00 0c add r0, r0 2c53c: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c53e: 21 e0 ldi r18, 0x01 ; 1 2c540: 30 e0 ldi r19, 0x00 ; 0 2c542: 61 15 cp r22, r1 2c544: 71 05 cpc r23, r1 2c546: 11 f0 breq .+4 ; 0x2c54c <__vector_17+0x1422> 2c548: 30 e0 ldi r19, 0x00 ; 0 2c54a: 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)) { 2c54c: 82 17 cp r24, r18 2c54e: 93 07 cpc r25, r19 2c550: 09 f0 breq .+2 ; 0x2c554 <__vector_17+0x142a> 2c552: 8d cf rjmp .-230 ; 0x2c46e <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 2c554: 20 91 6f 05 lds r18, 0x056F ; 0x80056f 2c558: 67 2b or r22, r23 2c55a: 11 f0 breq .+4 ; 0x2c560 <__vector_17+0x1436> 2c55c: 20 91 97 05 lds r18, 0x0597 ; 0x800597 max_ticks = min(abs(e_steps), max_ticks); 2c560: 84 2f mov r24, r20 2c562: 04 2e mov r0, r20 2c564: 00 0c add r0, r0 2c566: 99 0b sbc r25, r25 2c568: 97 ff sbrs r25, 7 2c56a: 03 c0 rjmp .+6 ; 0x2c572 <__vector_17+0x1448> 2c56c: 91 95 neg r25 2c56e: 81 95 neg r24 2c570: 91 09 sbc r25, r1 2c572: 30 e0 ldi r19, 0x00 ; 0 2c574: 28 17 cp r18, r24 2c576: 39 07 cpc r19, r25 2c578: 0c f4 brge .+2 ; 0x2c57c <__vector_17+0x1452> 2c57a: c9 01 movw r24, r18 2c57c: 21 e0 ldi r18, 0x01 ; 1 2c57e: 47 ff sbrs r20, 7 2c580: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 2c582: 38 e0 ldi r19, 0x08 ; 8 2c584: 36 b9 out 0x06, r19 ; 6 e_steps += (rev? 1: -1); 2c586: 90 91 90 05 lds r25, 0x0590 ; 0x800590 2c58a: 92 0f add r25, r18 2c58c: 90 93 90 05 sts 0x0590, r25 ; 0x800590 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); 2c590: 81 50 subi r24, 0x01 ; 1 2c592: c1 f7 brne .-16 ; 0x2c584 <__vector_17+0x145a> 2c594: 6c cf rjmp .-296 ; 0x2c46e <__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) 2c596: ac 01 movw r20, r24 2c598: 48 5d subi r20, 0xD8 ; 216 2c59a: 5f 4f sbci r21, 0xFF ; 255 2c59c: 42 17 cp r20, r18 2c59e: 53 07 cpc r21, r19 2c5a0: 08 f0 brcs .+2 ; 0x2c5a4 <__vector_17+0x147a> 2c5a2: 71 cf rjmp .-286 ; 0x2c486 <__vector_17+0x135c> OCR1A = nextAdvanceISR; 2c5a4: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c5a8: 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) { 2c5ac: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c5b0: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c5b4: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c5b8: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c5bc: 40 96 adiw r24, 0x10 ; 16 2c5be: 28 17 cp r18, r24 2c5c0: 39 07 cpc r19, r25 2c5c2: 48 f4 brcc .+18 ; 0x2c5d6 <__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; 2c5c4: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c5c8: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c5cc: 40 96 adiw r24, 0x10 ; 16 2c5ce: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c5d2: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 2c5d6: ff 91 pop r31 2c5d8: ef 91 pop r30 2c5da: df 91 pop r29 2c5dc: cf 91 pop r28 2c5de: bf 91 pop r27 2c5e0: af 91 pop r26 2c5e2: 9f 91 pop r25 2c5e4: 8f 91 pop r24 2c5e6: 7f 91 pop r23 2c5e8: 6f 91 pop r22 2c5ea: 5f 91 pop r21 2c5ec: 4f 91 pop r20 2c5ee: 3f 91 pop r19 2c5f0: 2f 91 pop r18 2c5f2: 1f 91 pop r17 2c5f4: 0f 91 pop r16 2c5f6: ff 90 pop r15 2c5f8: ef 90 pop r14 2c5fa: df 90 pop r13 2c5fc: cf 90 pop r12 2c5fe: 8f 90 pop r8 2c600: 7f 90 pop r7 2c602: 6f 90 pop r6 2c604: 0f 90 pop r0 2c606: 0b be out 0x3b, r0 ; 59 2c608: 0f 90 pop r0 2c60a: 0f be out 0x3f, r0 ; 63 2c60c: 0f 90 pop r0 2c60e: 1f 90 pop r1 2c610: 18 95 reti 0002c612 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 2c612: 90 91 76 05 lds r25, 0x0576 ; 0x800576 check_z_endstop = check; 2c616: 80 93 76 05 sts 0x0576, r24 ; 0x800576 CRITICAL_SECTION_START; 2c61a: 2f b7 in r18, 0x3f ; 63 2c61c: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c61e: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.493> 2c622: 8b 7f andi r24, 0xFB ; 251 2c624: 80 93 0b 05 sts 0x050B, r24 ; 0x80050b <_ZL11endstop_hit.lto_priv.493> CRITICAL_SECTION_END; 2c628: 2f bf out 0x3f, r18 ; 63 return old; } 2c62a: 89 2f mov r24, r25 2c62c: 08 95 ret 0002c62e : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 2c62e: 80 91 0b 05 lds r24, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.493> CRITICAL_SECTION_START; 2c632: 2f b7 in r18, 0x3f ; 63 2c634: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c636: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.493> 2c63a: 9b 7f andi r25, 0xFB ; 251 2c63c: 90 93 0b 05 sts 0x050B, r25 ; 0x80050b <_ZL11endstop_hit.lto_priv.493> CRITICAL_SECTION_END; 2c640: 2f bf out 0x3f, r18 ; 63 return hit; } 2c642: 82 fb bst r24, 2 2c644: 88 27 eor r24, r24 2c646: 80 f9 bld r24, 0 2c648: 08 95 ret 0002c64a : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 2c64a: 90 91 0b 05 lds r25, 0x050B ; 0x80050b <_ZL11endstop_hit.lto_priv.493> endstop_hit = 0; 2c64e: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_ZL11endstop_hit.lto_priv.493> return old; 2c652: 81 e0 ldi r24, 0x01 ; 1 2c654: 91 11 cpse r25, r1 2c656: 01 c0 rjmp .+2 ; 0x2c65a 2c658: 80 e0 ldi r24, 0x00 ; 0 } 2c65a: 08 95 ret 0002c65c : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 2c65c: 90 91 de 04 lds r25, 0x04DE ; 0x8004de 2c660: 91 30 cpi r25, 0x01 ; 1 2c662: a1 f0 breq .+40 ; 0x2c68c 2c664: 28 f0 brcs .+10 ; 0x2c670 2c666: 92 30 cpi r25, 0x02 ; 2 2c668: a9 f0 breq .+42 ; 0x2c694 2c66a: 93 30 cpi r25, 0x03 ; 3 2c66c: c1 f0 breq .+48 ; 0x2c69e 2c66e: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 2c670: 81 11 cpse r24, r1 2c672: 02 c0 rjmp .+4 ; 0x2c678 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(); 2c674: 0d 94 91 21 jmp 0x24322 ; 0x24322 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c678: 82 30 cpi r24, 0x02 ; 2 2c67a: 11 f4 brne .+4 ; 0x2c680 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 2c67c: 0d 94 70 31 jmp 0x262e0 ; 0x262e0 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) 2c680: 85 30 cpi r24, 0x05 ; 5 2c682: 09 f0 breq .+2 ; 0x2c686 2c684: 50 c0 rjmp .+160 ; 0x2c726 Sound_DoSound_Alert(false); 2c686: 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); 2c688: 0d 94 6f 21 jmp 0x242de ; 0x242de 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) 2c68c: 88 23 and r24, r24 2c68e: 91 f3 breq .-28 ; 0x2c674 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c690: 82 30 cpi r24, 0x02 ; 2 2c692: a1 f3 breq .-24 ; 0x2c67c Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c694: 85 30 cpi r24, 0x05 ; 5 2c696: 09 f0 breq .+2 ; 0x2c69a 2c698: 46 c0 rjmp .+140 ; 0x2c726 Sound_DoSound_Alert(true); 2c69a: 81 e0 ldi r24, 0x01 ; 1 2c69c: f5 cf rjmp .-22 ; 0x2c688 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) 2c69e: 88 23 and r24, r24 2c6a0: 49 f3 breq .-46 ; 0x2c674 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c6a2: 82 30 cpi r24, 0x02 ; 2 2c6a4: 59 f3 breq .-42 ; 0x2c67c Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c6a6: 85 30 cpi r24, 0x05 ; 5 2c6a8: 71 f3 breq .-36 ; 0x2c686 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 2c6aa: 86 30 cpi r24, 0x06 ; 6 2c6ac: e1 f4 brne .+56 ; 0x2c6e6 2c6ae: 85 e0 ldi r24, 0x05 ; 5 2c6b0: 27 e2 ldi r18, 0x27 ; 39 2c6b2: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 2c6b4: 4f b7 in r20, 0x3f ; 63 2c6b6: f8 94 cli 2c6b8: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c6bc: 94 60 ori r25, 0x04 ; 4 2c6be: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c6c2: 4f bf out 0x3f, r20 ; 63 2c6c4: f9 01 movw r30, r18 2c6c6: 31 97 sbiw r30, 0x01 ; 1 2c6c8: f1 f7 brne .-4 ; 0x2c6c6 delayMicroseconds(75); WRITE(BEEPER,LOW); 2c6ca: 4f b7 in r20, 0x3f ; 63 2c6cc: f8 94 cli 2c6ce: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c6d2: 9b 7f andi r25, 0xFB ; 251 2c6d4: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c6d8: 4f bf out 0x3f, r20 ; 63 2c6da: f9 01 movw r30, r18 2c6dc: 31 97 sbiw r30, 0x01 ; 1 2c6de: f1 f7 brne .-4 ; 0x2c6dc 2c6e0: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 2c6e2: 41 f7 brne .-48 ; 0x2c6b4 2c6e4: 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) 2c6e6: 87 30 cpi r24, 0x07 ; 7 2c6e8: f1 f4 brne .+60 ; 0x2c726 } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 2c6ea: 81 e0 ldi r24, 0x01 ; 1 2c6ec: 0e 94 29 8c call 0x11852 ; 0x11852 2c6f0: 84 e1 ldi r24, 0x14 ; 20 2c6f2: 23 e7 ldi r18, 0x73 ; 115 2c6f4: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 2c6f6: 4f b7 in r20, 0x3f ; 63 2c6f8: f8 94 cli 2c6fa: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c6fe: 94 60 ori r25, 0x04 ; 4 2c700: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c704: 4f bf out 0x3f, r20 ; 63 2c706: f9 01 movw r30, r18 2c708: 31 97 sbiw r30, 0x01 ; 1 2c70a: f1 f7 brne .-4 ; 0x2c708 delayMicroseconds(94); WRITE(BEEPER,LOW); 2c70c: 4f b7 in r20, 0x3f ; 63 2c70e: f8 94 cli 2c710: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c714: 9b 7f andi r25, 0xFB ; 251 2c716: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c71a: 4f bf out 0x3f, r20 ; 63 2c71c: f9 01 movw r30, r18 2c71e: 31 97 sbiw r30, 0x01 ; 1 2c720: f1 f7 brne .-4 ; 0x2c71e 2c722: 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++) 2c724: 41 f7 brne .-48 ; 0x2c6f6 Sound_DoSound_Blind_Alert(); break; default: break; } } 2c726: 08 95 ret 0002c728 : //! @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 ) { 2c728: 2f 92 push r2 2c72a: 3f 92 push r3 2c72c: 4f 92 push r4 2c72e: 5f 92 push r5 2c730: 6f 92 push r6 2c732: 7f 92 push r7 2c734: 8f 92 push r8 2c736: 9f 92 push r9 2c738: af 92 push r10 2c73a: bf 92 push r11 2c73c: cf 92 push r12 2c73e: df 92 push r13 2c740: ef 92 push r14 2c742: ff 92 push r15 2c744: 0f 93 push r16 2c746: 1f 93 push r17 2c748: cf 93 push r28 2c74a: df 93 push r29 2c74c: 00 d0 rcall .+0 ; 0x2c74e 2c74e: 00 d0 rcall .+0 ; 0x2c750 2c750: cd b7 in r28, 0x3d ; 61 2c752: de b7 in r29, 0x3e ; 62 2c754: 5c 01 movw r10, r24 2c756: 6c 83 std Y+4, r22 ; 0x04 2c758: 34 2e mov r3, r20 2c75a: 3b 83 std Y+3, r19 ; 0x03 2c75c: 2a 83 std Y+2, r18 ; 0x02 2c75e: 48 01 movw r8, r16 2c760: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 2c762: 00 97 sbiw r24, 0x00 ; 0 2c764: 09 f0 breq .+2 ; 0x2c768 2c766: 51 c0 rjmp .+162 ; 0x2c80a 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); 2c768: 87 01 movw r16, r14 2c76a: 22 2d mov r18, r2 2c76c: a4 01 movw r20, r8 2c76e: 6a 81 ldd r22, Y+2 ; 0x02 2c770: 7b 81 ldd r23, Y+3 ; 0x03 2c772: 83 2d mov r24, r3 2c774: 0f 94 fe 33 call 0x267fc ; 0x267fc 2c778: d1 2c mov r13, r1 2c77a: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 2c77c: 0f 94 55 3e call 0x27caa ; 0x27caa 2c780: 2b 01 movw r4, r22 2c782: 3c 01 movw r6, r24 lcd_consume_click(); 2c784: 0e 94 3e 72 call 0xe47c ; 0xe47c KEEPALIVE_STATE(PAUSED_FOR_USER); 2c788: 84 e0 ldi r24, 0x04 ; 4 2c78a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 2c78e: de 82 std Y+6, r13 ; 0x06 2c790: cd 82 std Y+5, r12 ; 0x05 2c792: 24 e6 ldi r18, 0x64 ; 100 2c794: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 2c796: 82 e3 ldi r24, 0x32 ; 50 2c798: 90 e0 ldi r25, 0x00 ; 0 2c79a: 0e 94 10 8f call 0x11e20 ; 0x11e20 if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 2c79e: 3c 81 ldd r19, Y+4 ; 0x04 2c7a0: 31 11 cpse r19, r1 2c7a2: 3a c0 rjmp .+116 ; 0x2c818 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 2c7a4: 80 91 34 05 lds r24, 0x0534 ; 0x800534 2c7a8: 90 91 35 05 lds r25, 0x0535 ; 0x800535 2c7ac: 00 97 sbiw r24, 0x00 ; 0 2c7ae: 09 f0 breq .+2 ; 0x2c7b2 2c7b0: 42 c0 rjmp .+132 ; 0x2c836 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 2c7b2: 0e 94 43 72 call 0xe486 ; 0xe486 2c7b6: 88 23 and r24, r24 2c7b8: 09 f4 brne .+2 ; 0x2c7bc 2c7ba: 67 c0 rjmp .+206 ; 0x2c88a if (msg_next == NULL) { 2c7bc: 8d 81 ldd r24, Y+5 ; 0x05 2c7be: 9e 81 ldd r25, Y+6 ; 0x06 2c7c0: 89 2b or r24, r25 2c7c2: 09 f0 breq .+2 ; 0x2c7c6 2c7c4: 5e c0 rjmp .+188 ; 0x2c882 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 2c7c6: 82 e0 ldi r24, 0x02 ; 2 2c7c8: 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; 2c7cc: 91 e0 ldi r25, 0x01 ; 1 2c7ce: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 2c7d2: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 2c7d6: 83 2d mov r24, r3 2c7d8: 26 96 adiw r28, 0x06 ; 6 2c7da: 0f b6 in r0, 0x3f ; 63 2c7dc: f8 94 cli 2c7de: de bf out 0x3e, r29 ; 62 2c7e0: 0f be out 0x3f, r0 ; 63 2c7e2: cd bf out 0x3d, r28 ; 61 2c7e4: df 91 pop r29 2c7e6: cf 91 pop r28 2c7e8: 1f 91 pop r17 2c7ea: 0f 91 pop r16 2c7ec: ff 90 pop r15 2c7ee: ef 90 pop r14 2c7f0: df 90 pop r13 2c7f2: cf 90 pop r12 2c7f4: bf 90 pop r11 2c7f6: af 90 pop r10 2c7f8: 9f 90 pop r9 2c7fa: 8f 90 pop r8 2c7fc: 7f 90 pop r7 2c7fe: 6f 90 pop r6 2c800: 5f 90 pop r5 2c802: 4f 90 pop r4 2c804: 3f 90 pop r3 2c806: 2f 90 pop r2 2c808: 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; 2c80a: 0f 94 4f 34 call 0x2689e ; 0x2689e 2c80e: 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) { 2c810: 89 2b or r24, r25 2c812: 09 f0 breq .+2 ; 0x2c816 2c814: b3 cf rjmp .-154 ; 0x2c77c 2c816: a8 cf rjmp .-176 ; 0x2c768 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) { 2c818: 0f 94 55 3e call 0x27caa ; 0x27caa 2c81c: 64 19 sub r22, r4 2c81e: 75 09 sbc r23, r5 2c820: 86 09 sbc r24, r6 2c822: 97 09 sbc r25, r7 2c824: 61 33 cpi r22, 0x31 ; 49 2c826: 75 47 sbci r23, 0x75 ; 117 2c828: 81 05 cpc r24, r1 2c82a: 91 05 cpc r25, r1 2c82c: 08 f4 brcc .+2 ; 0x2c830 2c82e: ba cf rjmp .-140 ; 0x2c7a4 current_selection = LCD_BUTTON_TIMEOUT; 2c830: 33 24 eor r3, r3 2c832: 3a 94 dec r3 2c834: c8 cf rjmp .-112 ; 0x2c7c6 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 2c836: 2d 81 ldd r18, Y+5 ; 0x05 2c838: 3e 81 ldd r19, Y+6 ; 0x06 2c83a: 23 2b or r18, r19 2c83c: f9 f4 brne .+62 ; 0x2c87c if (third_choice) { // third_choice is not nullptr, safe to dereference 2c83e: e1 14 cp r14, r1 2c840: f1 04 cpc r15, r1 2c842: b1 f0 breq .+44 ; 0x2c870 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2c844: 97 ff sbrs r25, 7 2c846: 0f c0 rjmp .+30 ; 0x2c866 2c848: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 2c84a: 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); 2c84c: 87 01 movw r16, r14 2c84e: 22 2d mov r18, r2 2c850: a4 01 movw r20, r8 2c852: 6a 81 ldd r22, Y+2 ; 0x02 2c854: 7b 81 ldd r23, Y+3 ; 0x03 2c856: 83 2d mov r24, r3 2c858: 0f 94 fe 33 call 0x267fc ; 0x267fc lcd_encoder = 0; 2c85c: 10 92 35 05 sts 0x0535, r1 ; 0x800535 2c860: 10 92 34 05 sts 0x0534, r1 ; 0x800534 2c864: a6 cf rjmp .-180 ; 0x2c7b2 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) { 2c866: 32 e0 ldi r19, 0x02 ; 2 2c868: 33 16 cp r3, r19 2c86a: 81 f3 breq .-32 ; 0x2c84c // Rotating knob clockwise current_selection++; 2c86c: 33 94 inc r3 2c86e: ee cf rjmp .-36 ; 0x2c84c } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2c870: 39 2e mov r3, r25 2c872: 30 94 com r3 2c874: 33 1c adc r3, r3 2c876: 33 24 eor r3, r3 2c878: 33 1c adc r3, r3 2c87a: e8 cf rjmp .-48 ; 0x2c84c } } 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); 2c87c: 87 e0 ldi r24, 0x07 ; 7 2c87e: 0f 94 2e 63 call 0x2c65c ; 0x2c65c goto exit; } else break; } } if (multi_screen) { 2c882: c1 14 cp r12, r1 2c884: d1 04 cpc r13, r1 2c886: 79 f4 brne .+30 ; 0x2c8a6 2c888: 84 cf rjmp .-248 ; 0x2c792 2c88a: 99 81 ldd r25, Y+1 ; 0x01 2c88c: 91 50 subi r25, 0x01 ; 1 2c88e: 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) { 2c890: 91 11 cpse r25, r1 2c892: 81 cf rjmp .-254 ; 0x2c796 goto exit; } else break; } } if (multi_screen) { 2c894: c1 14 cp r12, r1 2c896: d1 04 cpc r13, r1 2c898: 61 f0 breq .+24 ; 0x2c8b2 if (msg_next == NULL) { 2c89a: 2d 81 ldd r18, Y+5 ; 0x05 2c89c: 3e 81 ldd r19, Y+6 ; 0x06 2c89e: 23 2b or r18, r19 2c8a0: 11 f4 brne .+4 ; 0x2c8a6 2c8a2: be 82 std Y+6, r11 ; 0x06 2c8a4: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 2c8a6: 8d 81 ldd r24, Y+5 ; 0x05 2c8a8: 9e 81 ldd r25, Y+6 ; 0x06 2c8aa: 0f 94 4f 34 call 0x2689e ; 0x2689e 2c8ae: 9e 83 std Y+6, r25 ; 0x06 2c8b0: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 2c8b2: 8d 81 ldd r24, Y+5 ; 0x05 2c8b4: 9e 81 ldd r25, Y+6 ; 0x06 2c8b6: 89 2b or r24, r25 2c8b8: 09 f0 breq .+2 ; 0x2c8bc 2c8ba: 6b cf rjmp .-298 ; 0x2c792 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 2c8bc: 87 01 movw r16, r14 2c8be: 22 2d mov r18, r2 2c8c0: a4 01 movw r20, r8 2c8c2: 6a 81 ldd r22, Y+2 ; 0x02 2c8c4: 7b 81 ldd r23, Y+3 ; 0x03 2c8c6: 83 2d mov r24, r3 2c8c8: 0f 94 fe 33 call 0x267fc ; 0x267fc 2c8cc: 62 cf rjmp .-316 ; 0x2c792 0002c8ce : //! @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) { 2c8ce: bf 92 push r11 2c8d0: cf 92 push r12 2c8d2: df 92 push r13 2c8d4: ef 92 push r14 2c8d6: ff 92 push r15 2c8d8: 0f 93 push r16 2c8da: 1f 93 push r17 2c8dc: cf 93 push r28 2c8de: df 93 push r29 2c8e0: ec 01 movw r28, r24 2c8e2: d6 2e mov r13, r22 2c8e4: 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); 2c8e6: 8d eb ldi r24, 0xBD ; 189 2c8e8: 9d e3 ldi r25, 0x3D ; 61 2c8ea: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2c8ee: 8c 01 movw r16, r24 2c8f0: 87 eb ldi r24, 0xB7 ; 183 2c8f2: 9d e3 ldi r25, 0x3D ; 61 2c8f4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2c8f8: 2a e0 ldi r18, 0x0A ; 10 2c8fa: c2 2e mov r12, r18 2c8fc: f1 2c mov r15, r1 2c8fe: e1 2c mov r14, r1 2c900: 9c 01 movw r18, r24 2c902: 4b 2d mov r20, r11 2c904: 6d 2d mov r22, r13 2c906: ce 01 movw r24, r28 2c908: 0f 94 94 63 call 0x2c728 ; 0x2c728 } 2c90c: df 91 pop r29 2c90e: cf 91 pop r28 2c910: 1f 91 pop r17 2c912: 0f 91 pop r16 2c914: ff 90 pop r15 2c916: ef 90 pop r14 2c918: df 90 pop r13 2c91a: cf 90 pop r12 2c91c: bf 90 pop r11 2c91e: 08 95 ret 0002c920 : //! ---------------------- | ---------------- //! 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) { 2c920: af 92 push r10 2c922: bf 92 push r11 2c924: cf 92 push r12 2c926: df 92 push r13 2c928: ef 92 push r14 2c92a: ff 92 push r15 2c92c: 0f 93 push r16 2c92e: 1f 93 push r17 2c930: cf 93 push r28 2c932: 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); 2c934: 88 23 and r24, r24 2c936: 29 f0 breq .+10 ; 0x2c942 2c938: 61 e0 ldi r22, 0x01 ; 1 2c93a: 8f e5 ldi r24, 0x5F ; 95 2c93c: 9f e0 ldi r25, 0x0F ; 15 2c93e: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 FORCE_BL_ON_START; 2c942: 81 e0 ldi r24, 0x01 ; 1 2c944: 0e 94 05 8c call 0x1180a ; 0x1180a while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2c948: 86 e7 ldi r24, 0x76 ; 118 2c94a: e8 2e mov r14, r24 2c94c: 85 ea ldi r24, 0xA5 ; 165 2c94e: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2c950: 97 ed ldi r25, 0xD7 ; 215 2c952: c9 2e mov r12, r25 2c954: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2c956: 2c e3 ldi r18, 0x3C ; 60 2c958: a2 2e mov r10, r18 2c95a: b1 2c mov r11, r1 2c95c: 0c 2f mov r16, r28 2c95e: 10 e0 ldi r17, 0x00 ; 0 2c960: 1f 92 push r1 2c962: cf 93 push r28 2c964: ff 92 push r15 2c966: ef 92 push r14 2c968: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 switch (state) { 2c96c: 0f 90 pop r0 2c96e: 0f 90 pop r0 2c970: 0f 90 pop r0 2c972: 0f 90 pop r0 2c974: cf 30 cpi r28, 0x0F ; 15 2c976: a0 f7 brcc .-24 ; 0x2c960 2c978: f8 01 movw r30, r16 2c97a: 88 27 eor r24, r24 2c97c: ed 53 subi r30, 0x3D ; 61 2c97e: fb 49 sbci r31, 0x9B ; 155 2c980: 8e 4f sbci r24, 0xFE ; 254 2c982: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 2c986: 36 3a cpi r19, 0xA6 ; 166 2c988: 56 3a cpi r21, 0xA6 ; 166 2c98a: 90 3b cpi r25, 0xB0 ; 176 2c98c: d2 3b cpi r29, 0xB2 ; 178 2c98e: 3a 3b cpi r19, 0xBA ; 186 2c990: 38 3a cpi r19, 0xA8 ; 168 2c992: 2c 3a cpi r18, 0xAC ; 172 2c994: 62 3b cpi r22, 0xB2 ; 178 2c996: 82 3a cpi r24, 0xA2 ; 162 2c998: 2a 3a cpi r18, 0xAA ; 170 2c99a: e8 3b cpi r30, 0xB8 ; 184 2c99c: f4 39 cpi r31, 0x94 ; 148 2c99e: d6 39 cpi r29, 0x96 ; 150 2c9a0: fe 3a cpi r31, 0xAE ; 174 2c9a2: fe 3a cpi r31, 0xAE ; 174 // 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; 2c9a4: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 2c9a8: 8f e5 ldi r24, 0x5F ; 95 2c9aa: 9f e0 ldi r25, 0x0F ; 15 2c9ac: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2c9b0: 82 30 cpi r24, 0x02 ; 2 2c9b2: 39 f4 brne .+14 ; 0x2c9c2 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 2c9b4: 84 ed ldi r24, 0xD4 ; 212 2c9b6: 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)); 2c9b8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2c9bc: 0f 94 d6 34 call 0x269ac ; 0x269ac 2c9c0: 0f c0 rjmp .+30 ; 0x2c9e0 // 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); 2c9c2: 8f e6 ldi r24, 0x6F ; 111 2c9c4: 96 e5 ldi r25, 0x56 ; 86 2c9c6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2c9ca: 40 e0 ldi r20, 0x00 ; 0 2c9cc: 60 e0 ldi r22, 0x00 ; 0 2c9ce: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2c9d2: 81 11 cpse r24, r1 2c9d4: 07 c0 rjmp .+14 ; 0x2c9e4 2c9d6: 61 e0 ldi r22, 0x01 ; 1 2c9d8: 8f e5 ldi r24, 0x5F ; 95 2c9da: 9f e0 ldi r25, 0x0F ; 15 2c9dc: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 2c9e0: c1 e0 ldi r28, 0x01 ; 1 2c9e2: bc cf rjmp .-136 ; 0x2c95c 2c9e4: 60 e0 ldi r22, 0x00 ; 0 2c9e6: 8f e5 ldi r24, 0x5F ; 95 2c9e8: 9f e0 ldi r25, 0x0F ; 15 2c9ea: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 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); 2c9ee: 10 e0 ldi r17, 0x00 ; 0 2c9f0: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 2c9f2: 80 e0 ldi r24, 0x00 ; 0 2c9f4: 0e 94 05 8c call 0x1180a ; 0x1180a const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 2c9f8: 1f 93 push r17 2c9fa: 0f 93 push r16 2c9fc: 82 e1 ldi r24, 0x12 ; 18 2c9fe: 91 e7 ldi r25, 0x71 ; 113 2ca00: 9f 93 push r25 2ca02: 8f 93 push r24 2ca04: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 switch (state) { 2ca08: 0f 90 pop r0 2ca0a: 0f 90 pop r0 2ca0c: 0f 90 pop r0 2ca0e: 0f 90 pop r0 2ca10: cd 30 cpi r28, 0x0D ; 13 2ca12: 09 f4 brne .+2 ; 0x2ca16 2ca14: ff c0 rjmp .+510 ; 0x2cc14 2ca16: ce 30 cpi r28, 0x0E ; 14 2ca18: 09 f4 brne .+2 ; 0x2ca1c 2ca1a: 11 c1 rjmp .+546 ; 0x2cc3e case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 2ca1c: 8e e8 ldi r24, 0x8E ; 142 2ca1e: 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) { 2ca20: cc 23 and r28, r28 2ca22: 09 f4 brne .+2 ; 0x2ca26 2ca24: 0e c1 rjmp .+540 ; 0x2cc42 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 2ca26: 81 e0 ldi r24, 0x01 ; 1 2ca28: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_update(2); 2ca2c: 82 e0 ldi r24, 0x02 ; 2 } 2ca2e: cf 91 pop r28 2ca30: 1f 91 pop r17 2ca32: 0f 91 pop r16 2ca34: ff 90 pop r15 2ca36: ef 90 pop r14 2ca38: df 90 pop r13 2ca3a: cf 90 pop r12 2ca3c: bf 90 pop r11 2ca3e: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 2ca40: 0c 94 ed 6f jmp 0xdfda ; 0xdfda lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2ca44: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> 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)) { 2ca48: 81 e0 ldi r24, 0x01 ; 1 2ca4a: 0e 94 41 f8 call 0x1f082 ; 0x1f082 state = S::Selftest; 2ca4e: 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)) { 2ca50: 88 23 and r24, r24 2ca52: 09 f4 brne .+2 ; 0x2ca56 2ca54: 83 cf rjmp .-250 ; 0x2c95c state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 2ca56: 82 e0 ldi r24, 0x02 ; 2 2ca58: 0e 94 41 f8 call 0x1f082 ; 0x1f082 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 2ca5c: 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)) { 2ca5e: 88 23 and r24, r24 2ca60: 09 f4 brne .+2 ; 0x2ca64 2ca62: 7c cf rjmp .-264 ; 0x2c95c // 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)) { 2ca64: 84 e0 ldi r24, 0x04 ; 4 2ca66: 0e 94 41 f8 call 0x1f082 ; 0x1f082 state = S::Z; 2ca6a: 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)) { 2ca6c: 88 23 and r24, r24 2ca6e: 09 f4 brne .+2 ; 0x2ca72 2ca70: 75 cf rjmp .-278 ; 0x2c95c state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 2ca72: 88 e0 ldi r24, 0x08 ; 8 2ca74: 0e 94 41 f8 call 0x1f082 ; 0x1f082 state = S::ThermalModel; 2ca78: 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)) { 2ca7a: 88 23 and r24, r24 2ca7c: 09 f4 brne .+2 ; 0x2ca80 2ca7e: 6e cf rjmp .-292 ; 0x2c95c state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 2ca80: 80 e1 ldi r24, 0x10 ; 16 2ca82: 0e 94 41 f8 call 0x1f082 ; 0x1f082 state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 2ca86: 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)) { 2ca88: 81 11 cpse r24, r1 2ca8a: 68 cf rjmp .-304 ; 0x2c95c state = S::IsFil; 2ca8c: c6 e0 ldi r28, 0x06 ; 6 2ca8e: 66 cf rjmp .-308 ; 0x2c95c // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 2ca90: 86 e2 ldi r24, 0x26 ; 38 2ca92: 96 e5 ldi r25, 0x56 ; 86 2ca94: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2ca98: 0f 94 d6 34 call 0x269ac ; 0x269ac wizard_event = lcd_selftest(); 2ca9c: 0f 94 46 19 call 0x2328c ; 0x2328c 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); 2caa0: 81 11 cpse r24, r1 2caa2: 9e cf rjmp .-196 ; 0x2c9e0 } 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); 2caa4: ce e0 ldi r28, 0x0E ; 14 2caa6: 5a cf rjmp .-332 ; 0x2c95c break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 2caa8: 88 ee ldi r24, 0xE8 ; 232 2caaa: 95 e5 ldi r25, 0x55 ; 85 2caac: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cab0: 0f 94 d6 34 call 0x269ac ; 0x269ac wizard_event = gcode_M45(false, 0); 2cab4: 80 e0 ldi r24, 0x00 ; 0 2cab6: 0e 94 69 e6 call 0x1ccd2 ; 0x1ccd2 2caba: f2 cf rjmp .-28 ; 0x2caa0 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 2cabc: 80 ec ldi r24, 0xC0 ; 192 2cabe: 95 e5 ldi r25, 0x55 ; 85 2cac0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cac4: 0f 94 d6 34 call 0x269ac ; 0x269ac lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 2cac8: 82 e9 ldi r24, 0x92 ; 146 2caca: 95 e5 ldi r25, 0x55 ; 85 2cacc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cad0: 0f 94 d6 34 call 0x269ac ; 0x269ac lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 2cad4: 82 e7 ldi r24, 0x72 ; 114 2cad6: 95 e5 ldi r25, 0x55 ; 85 2cad8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cadc: 0f 94 d6 34 call 0x269ac ; 0x269ac wizard_event = gcode_M45(true, 0); 2cae0: 81 e0 ldi r24, 0x01 ; 1 2cae2: 0e 94 69 e6 call 0x1ccd2 ; 0x1ccd2 if (!wizard_event) { 2cae6: 88 23 and r24, r24 2cae8: e9 f2 breq .-70 ; 0x2caa4 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 2caea: 60 e0 ldi r22, 0x00 ; 0 2caec: 70 e0 ldi r23, 0x00 ; 0 2caee: 88 ed ldi r24, 0xD8 ; 216 2caf0: 91 e4 ldi r25, 0x41 ; 65 2caf2: 0e 94 a6 6f call 0xdf4c ; 0xdf4c if(!MMU2::mmu2.Enabled()) { 2caf6: 80 91 95 13 lds r24, 0x1395 ; 0x801395 2cafa: 81 30 cpi r24, 0x01 ; 1 2cafc: 09 f4 brne .+2 ; 0x2cb00 2cafe: 70 cf rjmp .-288 ; 0x2c9e0 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cb00: d0 92 6b 0e sts 0x0E6B, r13 ; 0x800e6b 2cb04: c0 92 6a 0e sts 0x0E6A, r12 ; 0x800e6a //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)); 2cb08: 8d e4 ldi r24, 0x4D ; 77 2cb0a: 95 e5 ldi r25, 0x55 ; 85 2cb0c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cb10: 0f 94 4f 34 call 0x2689e ; 0x2689e wait_preheat(); 2cb14: 0f 94 5c 34 call 0x268b8 ; 0x268b8 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 2cb18: 60 e0 ldi r22, 0x00 ; 0 2cb1a: 70 e0 ldi r23, 0x00 ; 0 2cb1c: cb 01 movw r24, r22 2cb1e: 0f 94 a1 15 call 0x22b42 ; 0x22b42 lcd_wizard_load(); // load filament 2cb22: 0f 94 3f 35 call 0x26a7e ; 0x26a7e 2cb26: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 2cb2a: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 2cb2e: 58 cf rjmp .-336 ; 0x2c9e0 state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 2cb30: 8d e0 ldi r24, 0x0D ; 13 2cb32: 95 e5 ldi r25, 0x55 ; 85 2cb34: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cb38: 0f 94 d6 34 call 0x269ac ; 0x269ac lcd_commands_type = LcdCommands::ThermalModel; 2cb3c: 85 e0 ldi r24, 0x05 ; 5 2cb3e: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 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); 2cb42: 05 e0 ldi r16, 0x05 ; 5 2cb44: 10 e0 ldi r17, 0x00 ; 0 2cb46: 55 cf rjmp .-342 ; 0x2c9f2 2cb48: d0 92 6b 0e sts 0x0E6B, r13 ; 0x800e6b 2cb4c: c0 92 6a 0e sts 0x0E6A, r12 ; 0x800e6a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2cb50: b0 92 69 0e sts 0x0E69, r11 ; 0x800e69 2cb54: a0 92 68 0e sts 0x0E68, r10 ; 0x800e68 #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); 2cb58: 87 ef ldi r24, 0xF7 ; 247 2cb5a: 94 e5 ldi r25, 0x54 ; 84 2cb5c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cb60: 41 e0 ldi r20, 0x01 ; 1 2cb62: 60 e0 ldi r22, 0x00 ; 0 2cb64: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2cb68: 88 23 and r24, r24 2cb6a: 09 f1 breq .+66 ; 0x2cbae state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 2cb6c: 80 91 95 13 lds r24, 0x1395 ; 0x801395 else state = S::Preheat; 2cb70: 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; 2cb72: 81 30 cpi r24, 0x01 ; 1 2cb74: 09 f0 breq .+2 ; 0x2cb78 2cb76: f2 ce rjmp .-540 ; 0x2c95c 2cb78: c8 e0 ldi r28, 0x08 ; 8 2cb7a: f0 ce rjmp .-544 ; 0x2c95c else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 2cb7c: 20 e0 ldi r18, 0x00 ; 0 2cb7e: 41 e0 ldi r20, 0x01 ; 1 2cb80: 70 e0 ldi r23, 0x00 ; 0 2cb82: 60 e0 ldi r22, 0x00 ; 0 2cb84: 84 ed ldi r24, 0xD4 ; 212 2cb86: 9a e3 ldi r25, 0x3A ; 58 2cb88: 0f 94 b8 ce call 0x39d70 ; 0x39d70 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 2cb8c: 86 eb ldi r24, 0xB6 ; 182 2cb8e: 94 e5 ldi r25, 0x54 ; 84 2cb90: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cb94: 0f 94 d6 34 call 0x269ac ; 0x269ac 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); 2cb98: 07 e0 ldi r16, 0x07 ; 7 2cb9a: 10 e0 ldi r17, 0x00 ; 0 2cb9c: 2a cf rjmp .-428 ; 0x2c9f2 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(); 2cb9e: 0f 94 5c 34 call 0x268b8 ; 0x268b8 lcd_wizard_load(); 2cba2: 0f 94 3f 35 call 0x26a7e ; 0x26a7e state = S::Lay1CalHot; 2cba6: cb e0 ldi r28, 0x0B ; 11 2cba8: d9 ce rjmp .-590 ; 0x2c95c break; case S::LoadFilCold: lcd_wizard_load(); 2cbaa: 0f 94 3f 35 call 0x26a7e ; 0x26a7e 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; 2cbae: ca e0 ldi r28, 0x0A ; 10 2cbb0: d5 ce rjmp .-598 ; 0x2c95c case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 2cbb2: 81 e0 ldi r24, 0x01 ; 1 2cbb4: 0f 94 21 35 call 0x26a42 ; 0x26a42 menu_goto(lcd_v2_calibration, 0, true); 2cbb8: 20 e0 ldi r18, 0x00 ; 0 2cbba: 41 e0 ldi r20, 0x01 ; 1 2cbbc: 70 e0 ldi r23, 0x00 ; 0 2cbbe: 60 e0 ldi r22, 0x00 ; 0 2cbc0: 8e ec ldi r24, 0xCE ; 206 2cbc2: 9a e3 ldi r25, 0x3A ; 58 2cbc4: 0f 94 b8 ce call 0x39d70 ; 0x39d70 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); 2cbc8: 0a e0 ldi r16, 0x0A ; 10 2cbca: 10 e0 ldi r17, 0x00 ; 0 2cbcc: 12 cf rjmp .-476 ; 0x2c9f2 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); 2cbce: 80 e0 ldi r24, 0x00 ; 0 2cbd0: 0f 94 21 35 call 0x26a42 ; 0x26a42 lcd_commands_type = LcdCommands::Layer1Cal; 2cbd4: 84 e0 ldi r24, 0x04 ; 4 2cbd6: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 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: 0b e0 ldi r16, 0x0B ; 11 2cbdc: 10 e0 ldi r17, 0x00 ; 0 2cbde: 09 cf rjmp .-494 ; 0x2c9f2 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); 2cbe0: 83 e6 ldi r24, 0x63 ; 99 2cbe2: 94 e5 ldi r25, 0x54 ; 84 2cbe4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cbe8: 41 e0 ldi r20, 0x01 ; 1 2cbea: 60 e0 ldi r22, 0x00 ; 0 2cbec: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 2cbf0: 81 11 cpse r24, r1 2cbf2: 07 c0 rjmp .+14 ; 0x2cc02 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 2cbf4: 83 e3 ldi r24, 0x33 ; 51 2cbf6: 94 e5 ldi r25, 0x54 ; 84 2cbf8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cbfc: 0f 94 d6 34 call 0x269ac ; 0x269ac 2cc00: d6 cf rjmp .-84 ; 0x2cbae state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 2cc02: 8d ec ldi r24, 0xCD ; 205 2cc04: 93 e5 ldi r25, 0x53 ; 83 2cc06: d8 ce rjmp .-592 ; 0x2c9b8 2cc08: 60 e0 ldi r22, 0x00 ; 0 2cc0a: 8f e5 ldi r24, 0x5F ; 95 2cc0c: 9f e0 ldi r25, 0x0F ; 15 2cc0e: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 2cc12: ef ce rjmp .-546 ; 0x2c9f2 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 2cc14: 8f e6 ldi r24, 0x6F ; 111 2cc16: 93 e5 ldi r25, 0x53 ; 83 2cc18: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cc1c: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2cc1e: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL24lcd_status_message_level.lto_priv.452> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 2cc22: 81 e5 ldi r24, 0x51 ; 81 2cc24: 91 e7 ldi r25, 0x71 ; 113 2cc26: 0f 94 e0 0a call 0x215c0 ; 0x215c0 lcd_return_to_status(); 2cc2a: 0f 94 1d 26 call 0x24c3a ; 0x24c3a default: // exiting for later re-entry break; } if (msg) { 2cc2e: 01 15 cp r16, r1 2cc30: 11 05 cpc r17, r1 2cc32: 09 f4 brne .+2 ; 0x2cc36 2cc34: f8 ce rjmp .-528 ; 0x2ca26 lcd_show_fullscreen_message_and_wait_P(msg); 2cc36: c8 01 movw r24, r16 2cc38: 0f 94 d6 34 call 0x269ac ; 0x269ac 2cc3c: f4 ce rjmp .-536 ; 0x2ca26 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 2cc3e: 8d e0 ldi r24, 0x0D ; 13 2cc40: 93 e5 ldi r25, 0x53 ; 83 2cc42: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cc46: 8c 01 movw r16, r24 2cc48: f2 cf rjmp .-28 ; 0x2cc2e 0002cc4a : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 2cc4a: cf 93 push r28 2cc4c: 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); 2cc4e: 80 ef ldi r24, 0xF0 ; 240 2cc50: 92 e5 ldi r25, 0x52 ; 82 2cc52: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cc56: 41 e0 ldi r20, 0x01 ; 1 2cc58: 4c 27 eor r20, r28 2cc5a: 60 e0 ldi r22, 0x00 ; 0 2cc5c: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce 2cc60: 91 e0 ldi r25, 0x01 ; 1 2cc62: 81 11 cpse r24, r1 2cc64: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 2cc66: c9 17 cp r28, r25 2cc68: 59 f0 breq .+22 ; 0x2cc80 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 2cc6a: 86 ec ldi r24, 0xC6 ; 198 2cc6c: 92 e5 ldi r25, 0x52 ; 82 2cc6e: cc 23 and r28, r28 2cc70: 11 f0 breq .+4 ; 0x2cc76 2cc72: 8a e4 ldi r24, 0x4A ; 74 2cc74: 98 e4 ldi r25, 0x48 ; 72 2cc76: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 } #endif //STEEL_SHEET } 2cc7a: 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)); 2cc7c: 0d 94 d6 34 jmp 0x269ac ; 0x269ac } #endif //STEEL_SHEET } 2cc80: cf 91 pop r28 2cc82: 08 95 ret 0002cc84 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 2cc84: cf 93 push r28 2cc86: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 2cc88: 8d e9 ldi r24, 0x9D ; 157 2cc8a: 92 e5 ldi r25, 0x52 ; 82 2cc8c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cc90: 40 e0 ldi r20, 0x00 ; 0 2cc92: 6c 2f mov r22, r28 2cc94: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce if (result == LCD_LEFT_BUTTON_CHOICE) { 2cc98: 81 11 cpse r24, r1 2cc9a: 03 c0 rjmp .+6 ; 0x2cca2 lcd_mesh_calibration_z(); } } 2cc9c: 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(); 2cc9e: 0d 94 5f 26 jmp 0x24cbe ; 0x24cbe } } 2cca2: cf 91 pop r28 2cca4: 08 95 ret 0002cca6 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 2cca6: 8f e1 ldi r24, 0x1F ; 31 2cca8: 0e 94 41 f8 call 0x1f082 ; 0x1f082 2ccac: 81 11 cpse r24, r1 2ccae: 06 c0 rjmp .+12 ; 0x2ccbc // 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); 2ccb0: 8f e1 ldi r24, 0x1F ; 31 2ccb2: 0e 94 07 e6 call 0x1cc0e ; 0x1cc0e lcd_wizard(WizState::Run); 2ccb6: 80 e0 ldi r24, 0x00 ; 0 2ccb8: 0d 94 90 64 jmp 0x2c920 ; 0x2c920 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); 2ccbc: 8b ef ldi r24, 0xFB ; 251 2ccbe: 9f e4 ldi r25, 0x4F ; 79 2ccc0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2ccc4: 41 e0 ldi r20, 0x01 ; 1 2ccc6: 60 e0 ldi r22, 0x00 ; 0 2ccc8: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce } if (result) { 2cccc: 88 23 and r24, r24 2ccce: 81 f3 breq .-32 ; 0x2ccb0 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 2ccd0: 0f 94 1d 26 call 0x24c3a ; 0x24c3a lcd_update_enable(true); 2ccd4: 81 e0 ldi r24, 0x01 ; 1 2ccd6: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_update(2); 2ccda: 82 e0 ldi r24, 0x02 ; 2 2ccdc: 0c 94 ed 6f jmp 0xdfda ; 0xdfda 0002cce0 : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 2cce0: cf 93 push r28 2cce2: c8 2f mov r28, r24 if (!lang_select(lang)) 2cce4: 0e 94 7a 73 call 0xe6f4 ; 0xe6f4 2cce8: 81 11 cpse r24, r1 2ccea: 37 c0 rjmp .+110 ; 0x2cd5a { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 2ccec: 85 e7 ldi r24, 0x75 ; 117 2ccee: 9f e4 ldi r25, 0x4F ; 79 2ccf0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2ccf4: 40 e0 ldi r20, 0x00 ; 0 2ccf6: 60 e0 ldi r22, 0x00 ; 0 2ccf8: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce 2ccfc: 81 11 cpse r24, r1 2ccfe: 20 c0 rjmp .+64 ; 0x2cd40 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 2cd00: 0e 94 2f 73 call 0xe65e ; 0xe65e if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 2cd04: c2 30 cpi r28, 0x02 ; 2 2cd06: e0 f0 brcs .+56 ; 0x2cd40 2cd08: 8c 17 cp r24, r28 2cd0a: d0 f0 brcs .+52 ; 0x2cd40 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 2cd0c: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 2cd0e: 8a ea ldi r24, 0xAA ; 170 2cd10: 95 e5 ldi r25, 0x55 ; 85 2cd12: dc 01 movw r26, r24 2cd14: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e6> 2cd18: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e7> 2cd1c: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e8> 2cd20: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e9> boot_app_flags = BOOT_APP_FLG_USER0; 2cd24: 80 e8 ldi r24, 0x80 ; 128 2cd26: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e5> boot_copy_size = 0; 2cd2a: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7e3> 2cd2e: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7e2> bootapp_reboot_user0(lang << 3); 2cd32: cc 0f add r28, r28 2cd34: cc 0f add r28, r28 2cd36: cc 0f add r28, r28 boot_reserved = reserved; 2cd38: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7e4> // bootapp_print_vars(); softReset(); 2cd3c: 0e 94 92 68 call 0xd124 ; 0xd124 lang_boot_update_start(lang); lcd_update_enable(true); 2cd40: 81 e0 ldi r24, 0x01 ; 1 2cd42: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 menu_goto(lcd_language_menu, 0, true, true); 2cd46: 21 e0 ldi r18, 0x01 ; 1 2cd48: 41 e0 ldi r20, 0x01 ; 1 2cd4a: 70 e0 ldi r23, 0x00 ; 0 2cd4c: 60 e0 ldi r22, 0x00 ; 0 2cd4e: 82 e1 ldi r24, 0x12 ; 18 2cd50: 9b e3 ldi r25, 0x3B ; 59 2cd52: 0f 94 b8 ce call 0x39d70 ; 0x39d70 2cd56: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 lcd_timeoutToStatus.stop(); //infinite timeout } } 2cd5a: cf 91 pop r28 2cd5c: 08 95 ret 0002cd5e : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 2cd5e: cf 93 push r28 MENU_BEGIN(); 2cd60: 0f 94 8e ce call 0x39d1c ; 0x39d1c 2cd64: 10 92 12 05 sts 0x0512, r1 ; 0x800512 2cd68: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2cd6c: 84 30 cpi r24, 0x04 ; 4 2cd6e: 08 f0 brcs .+2 ; 0x2cd72 2cd70: 4a c0 rjmp .+148 ; 0x2ce06 2cd72: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 2cd76: 0e 94 63 72 call 0xe4c6 ; 0xe4c6 2cd7a: 88 23 and r24, r24 2cd7c: 31 f0 breq .+12 ; 0x2cd8a 2cd7e: 8c ea ldi r24, 0xAC ; 172 2cd80: 9d e3 ldi r25, 0x3D ; 61 2cd82: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cd86: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 2cd8a: 8e e6 ldi r24, 0x6E ; 110 2cd8c: 95 e6 ldi r25, 0x65 ; 101 2cd8e: 0e 94 79 72 call 0xe4f2 ; 0xe4f2 2cd92: 0f 94 3c ce call 0x39c78 ; 0x39c78 2cd96: 88 23 and r24, r24 2cd98: 21 f0 breq .+8 ; 0x2cda2 { menu_setlang(0); 2cd9a: 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(); } 2cd9c: 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); 2cd9e: 0d 94 70 66 jmp 0x2cce0 ; 0x2cce0 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(); 2cda2: 0e 94 2f 73 call 0xe65e ; 0xe65e 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 2cda6: 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 2cda8: 82 30 cpi r24, 0x02 ; 2 2cdaa: 51 f4 brne .+20 ; 0x2cdc0 2cdac: 0e 94 50 72 call 0xe4a0 ; 0xe4a0 { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 2cdb0: 0e 94 79 72 call 0xe4f2 ; 0xe4f2 2cdb4: 0f 94 3c ce call 0x39c78 ; 0x39c78 2cdb8: 88 23 and r24, r24 2cdba: 81 f0 breq .+32 ; 0x2cddc { menu_setlang(1); 2cdbc: 81 e0 ldi r24, 0x01 ; 1 2cdbe: ee cf rjmp .-36 ; 0x2cd9c 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)))) 2cdc0: 8c 2f mov r24, r28 2cdc2: 0e 94 e0 72 call 0xe5c0 ; 0xe5c0 2cdc6: 0e 94 79 72 call 0xe4f2 ; 0xe4f2 2cdca: 0f 94 3c ce call 0x39c78 ; 0x39c78 2cdce: 88 23 and r24, r24 2cdd0: 11 f0 breq .+4 ; 0x2cdd6 { menu_setlang(i); 2cdd2: 8c 2f mov r24, r28 2cdd4: e3 cf rjmp .-58 ; 0x2cd9c 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 2cdd6: cf 5f subi r28, 0xFF ; 255 2cdd8: c8 30 cpi r28, 0x08 ; 8 2cdda: 91 f7 brne .-28 ; 0x2cdc0 return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 2cddc: 8f e8 ldi r24, 0x8F ; 143 2cdde: 9f e4 ldi r25, 0x4F ; 79 2cde0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cde4: 6a e0 ldi r22, 0x0A ; 10 2cde6: 7a e3 ldi r23, 0x3A ; 58 2cde8: 0f 94 0c d1 call 0x3a218 ; 0x3a218 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 2cdec: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 2cdf0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2cdf4: 8f 5f subi r24, 0xFF ; 255 2cdf6: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2cdfa: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2cdfe: 8f 5f subi r24, 0xFF ; 255 2ce00: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2ce04: b1 cf rjmp .-158 ; 0x2cd68 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 2ce06: cf 91 pop r28 2ce08: 08 95 ret 0002ce0a : } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 2ce0a: cf 93 push r28 2ce0c: df 93 push r29 MENU_BEGIN(); 2ce0e: 0f 94 8e ce call 0x39d1c ; 0x39d1c 2ce12: 10 92 12 05 sts 0x0512, r1 ; 0x800512 2ce16: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2ce1a: 84 30 cpi r24, 0x04 ; 4 2ce1c: 58 f5 brcc .+86 ; 0x2ce74 2ce1e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 uint8_t cnt = lang_get_count(); 2ce22: 0e 94 2f 73 call 0xe65e ; 0xe65e 2ce26: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 2ce28: 8b e8 ldi r24, 0x8B ; 139 2ce2a: 98 e5 ldi r25, 0x58 ; 88 2ce2c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2ce30: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 for (uint8_t i = 8; i < cnt; i++) //all community languages 2ce34: c8 e0 ldi r28, 0x08 ; 8 2ce36: cd 17 cp r28, r29 2ce38: 80 f4 brcc .+32 ; 0x2ce5a if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 2ce3a: 8c 2f mov r24, r28 2ce3c: 0e 94 e0 72 call 0xe5c0 ; 0xe5c0 2ce40: 0e 94 79 72 call 0xe4f2 ; 0xe4f2 2ce44: 0f 94 3c ce call 0x39c78 ; 0x39c78 2ce48: 88 23 and r24, r24 2ce4a: 29 f0 breq .+10 ; 0x2ce56 { menu_setlang(i); 2ce4c: 8c 2f mov r24, r28 return; } MENU_END(); } 2ce4e: df 91 pop r29 2ce50: 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); 2ce52: 0d 94 70 66 jmp 0x2cce0 ; 0x2cce0 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 2ce56: cf 5f subi r28, 0xFF ; 255 2ce58: ee cf rjmp .-36 ; 0x2ce36 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 2ce5a: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 2ce5e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2ce62: 8f 5f subi r24, 0xFF ; 255 2ce64: 80 93 12 05 sts 0x0512, r24 ; 0x800512 2ce68: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2ce6c: 8f 5f subi r24, 0xFF ; 255 2ce6e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 2ce72: d1 cf rjmp .-94 ; 0x2ce16 { menu_setlang(i); return; } MENU_END(); } 2ce74: df 91 pop r29 2ce76: cf 91 pop r28 2ce78: 08 95 ret 0002ce7a : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 2ce7a: cf 92 push r12 2ce7c: ef 92 push r14 2ce7e: ff 92 push r15 2ce80: 0f 93 push r16 2ce82: 1f 93 push r17 2ce84: cf 93 push r28 2ce86: 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); 2ce88: 80 ed ldi r24, 0xD0 ; 208 2ce8a: 9c e4 ldi r25, 0x4C ; 76 2ce8c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2ce90: 7c 01 movw r14, r24 2ce92: 8d eb ldi r24, 0xBD ; 189 2ce94: 9d e3 ldi r25, 0x3D ; 61 2ce96: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2ce9a: 8c 01 movw r16, r24 2ce9c: 87 eb ldi r24, 0xB7 ; 183 2ce9e: 9d e3 ldi r25, 0x3D ; 61 2cea0: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2cea4: ec 01 movw r28, r24 2cea6: 85 ea ldi r24, 0xA5 ; 165 2cea8: 9c e4 ldi r25, 0x4C ; 76 2ceaa: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2ceae: 28 e0 ldi r18, 0x08 ; 8 2ceb0: c2 2e mov r12, r18 2ceb2: 9e 01 movw r18, r28 2ceb4: 40 e0 ldi r20, 0x00 ; 0 2ceb6: 60 e0 ldi r22, 0x00 ; 0 2ceb8: 0f 94 94 63 call 0x2c728 ; 0x2c728 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 2cebc: 81 30 cpi r24, 0x01 ; 1 2cebe: 29 f4 brne .+10 ; 0x2ceca load_filament_final_feed(); 2cec0: 0e 94 d9 65 call 0xcbb2 ; 0xcbb2 st_synchronize(); 2cec4: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 2cec8: df cf rjmp .-66 ; 0x2ce88 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) { 2ceca: 82 30 cpi r24, 0x02 ; 2 2cecc: 61 f4 brne .+24 ; 0x2cee6 unload_filament(FILAMENTCHANGE_FINALRETRACT); 2cece: 60 e0 ldi r22, 0x00 ; 0 2ced0: 70 e0 ldi r23, 0x00 ; 0 2ced2: cb 01 movw r24, r22 } } 2ced4: df 91 pop r29 2ced6: cf 91 pop r28 2ced8: 1f 91 pop r17 2ceda: 0f 91 pop r16 2cedc: ff 90 pop r15 2cede: ef 90 pop r14 2cee0: 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); 2cee2: 0d 94 a1 15 jmp 0x22b42 ; 0x22b42 } } 2cee6: df 91 pop r29 2cee8: cf 91 pop r28 2ceea: 1f 91 pop r17 2ceec: 0f 91 pop r16 2ceee: ff 90 pop r15 2cef0: ef 90 pop r14 2cef2: cf 90 pop r12 2cef4: 08 95 ret 0002cef6 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 2cef6: 0f 93 push r16 2cef8: 1f 93 push r17 2cefa: cf 93 push r28 2cefc: df 93 push r29 2cefe: 8c 01 movw r16, r24 2cf00: 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; 2cf02: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 2cf06: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 2cf0a: 0f 94 ad 21 call 0x2435a ; 0x2435a 2cf0e: 81 11 cpse r24, r1 2cf10: 04 c0 rjmp .+8 ; 0x2cf1a resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2cf12: d0 93 69 0e sts 0x0E69, r29 ; 0x800e69 2cf16: c0 93 68 0e sts 0x0E68, r28 ; 0x800e68 { const FilamentAction action = eFilamentAction; 2cf1a: c0 91 a3 03 lds r28, 0x03A3 ; 0x8003a3 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 2cf1e: 87 ef ldi r24, 0xF7 ; 247 2cf20: 8c 0f add r24, r28 2cf22: 82 30 cpi r24, 0x02 ; 2 2cf24: f8 f4 brcc .+62 ; 0x2cf64 { lcd_return_to_status(); 2cf26: 0f 94 1d 26 call 0x24c3a ; 0x24c3a if (action == FilamentAction::Lay1Cal) 2cf2a: ca 30 cpi r28, 0x0A ; 10 2cf2c: 41 f4 brne .+16 ; 0x2cf3e { lcd_commands_type = LcdCommands::Layer1Cal; 2cf2e: 84 e0 ldi r24, 0x04 ; 4 2cf30: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 } menu_back(); clearFilamentAction(); } } } 2cf34: df 91 pop r29 2cf36: cf 91 pop r28 2cf38: 1f 91 pop r17 2cf3a: 0f 91 pop r16 2cf3c: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 2cf3e: 60 e0 ldi r22, 0x00 ; 0 2cf40: 70 e0 ldi r23, 0x00 ; 0 2cf42: 80 e2 ldi r24, 0x20 ; 32 2cf44: 91 e4 ldi r25, 0x41 ; 65 2cf46: 0e 94 a6 6f call 0xdf4c ; 0xdf4c if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2cf4a: 8f e5 ldi r24, 0x5F ; 95 2cf4c: 9f e0 ldi r25, 0x0F ; 15 2cf4e: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2cf52: 88 23 and r24, r24 2cf54: 79 f3 breq .-34 ; 0x2cf34 lcd_wizard(WizState::LoadFilHot); 2cf56: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 2cf58: df 91 pop r29 2cf5a: cf 91 pop r28 2cf5c: 1f 91 pop r17 2cf5e: 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); 2cf60: 0d 94 90 64 jmp 0x2c920 ; 0x2c920 2cf64: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 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) 2cf68: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 2cf6c: 81 11 cpse r24, r1 2cf6e: 12 c0 rjmp .+36 ; 0x2cf94 2cf70: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 2cf74: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 2cf78: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 2cf7c: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 2cf80: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 2cf84: 60 1b sub r22, r16 2cf86: 71 0b sbc r23, r17 2cf88: 6c 5f subi r22, 0xFC ; 252 2cf8a: 7f 4f sbci r23, 0xFF ; 255 2cf8c: 69 30 cpi r22, 0x09 ; 9 2cf8e: 71 05 cpc r23, r1 2cf90: 08 f0 brcs .+2 ; 0x2cf94 2cf92: 60 c0 rjmp .+192 ; 0x2d054 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 2cf94: c1 50 subi r28, 0x01 ; 1 2cf96: c8 30 cpi r28, 0x08 ; 8 2cf98: 88 f5 brcc .+98 ; 0x2cffc 2cf9a: ec 2f mov r30, r28 2cf9c: f0 e0 ldi r31, 0x00 ; 0 2cf9e: 88 27 eor r24, r24 2cfa0: eb 52 subi r30, 0x2B ; 43 2cfa2: f8 49 sbci r31, 0x98 ; 152 2cfa4: 8e 4f sbci r24, 0xFE ; 254 2cfa6: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 2cfaa: ca 3b cpi r28, 0xBA ; 186 2cfac: ca 3b cpi r28, 0xBA ; 186 2cfae: ca 3b cpi r28, 0xBA ; 186 2cfb0: d0 39 cpi r29, 0x90 ; 144 2cfb2: 70 3a cpi r23, 0xA0 ; 160 2cfb4: 40 3a cpi r20, 0xA0 ; 160 2cfb6: b0 3b cpi r27, 0xB0 ; 176 2cfb8: 6a 3a cpi r22, 0xAA ; 170 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2cfba: cd eb ldi r28, 0xBD ; 189 2cfbc: d8 ed ldi r29, 0xD8 ; 216 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2cfbe: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2cfc2: 88 23 and r24, r24 2cfc4: 29 f0 breq .+10 ; 0x2cfd0 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2cfc6: 82 e0 ldi r24, 0x02 ; 2 2cfc8: 0f 94 2e 63 call 0x2c65c ; 0x2c65c bFilamentWaitingFlag = false; 2cfcc: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c } if (filamentActionMenu) { 2cfd0: 20 97 sbiw r28, 0x00 ; 0 2cfd2: 09 f4 brne .+2 ; 0x2cfd6 2cfd4: af cf rjmp .-162 ; 0x2cf34 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2cfd6: 0f 94 e3 2d call 0x25bc6 ; 0x25bc6 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2cfda: 61 e0 ldi r22, 0x01 ; 1 2cfdc: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2cfde: df 91 pop r29 2cfe0: cf 91 pop r28 2cfe2: 1f 91 pop r17 2cfe4: 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); 2cfe6: 0d 94 fb cf jmp 0x39ff6 ; 0x39ff6 switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2cfea: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2cfee: 88 23 and r24, r24 2cff0: 41 f0 breq .+16 ; 0x2d002 2cff2: 61 e0 ldi r22, 0x01 ; 1 2cff4: 88 e1 ldi r24, 0x18 ; 24 2cff6: 9a e3 ldi r25, 0x3A ; 58 2cff8: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 // 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; 2cffc: d0 e0 ldi r29, 0x00 ; 0 2cffe: c0 e0 ldi r28, 0x00 ; 0 2d000: de cf rjmp .-68 ; 0x2cfbe case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2d002: 0f 94 e3 2d call 0x25bc6 ; 0x25bc6 if (eFilamentAction == FilamentAction::AutoLoad) { 2d006: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 2d00a: 82 30 cpi r24, 0x02 ; 2 2d00c: 19 f4 brne .+6 ; 0x2d014 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2d00e: 81 e0 ldi r24, 0x01 ; 1 2d010: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 } if (eFilamentAction == FilamentAction::Load) 2d014: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 2d018: 81 30 cpi r24, 0x01 ; 1 2d01a: 31 f4 brne .+12 ; 0x2d028 enquecommand_P(MSG_M701); // load filament 2d01c: 61 e0 ldi r22, 0x01 ; 1 2d01e: 87 e6 ldi r24, 0x67 ; 103 2d020: 90 e7 ldi r25, 0x70 ; 112 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2d022: 0e 94 dc 89 call 0x113b8 ; 0x113b8 2d026: ea cf rjmp .-44 ; 0x2cffc eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 2d028: 83 30 cpi r24, 0x03 ; 3 2d02a: 41 f7 brne .-48 ; 0x2cffc enquecommand_P(MSG_M702); // unload filament 2d02c: 61 e0 ldi r22, 0x01 ; 1 2d02e: 86 ef ldi r24, 0xF6 ; 246 2d030: 9c e6 ldi r25, 0x6C ; 108 2d032: f7 cf rjmp .-18 ; 0x2d022 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2d034: c7 e3 ldi r28, 0x37 ; 55 2d036: d8 ed ldi r29, 0xD8 ; 216 2d038: c2 cf rjmp .-124 ; 0x2cfbe break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2d03a: 0f 94 e3 2d call 0x25bc6 ; 0x25bc6 MMU2::mmu2.unload(); 2d03e: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 // 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(); 2d042: 0f 94 be 35 call 0x26b7c ; 0x26b7c 2d046: da cf rjmp .-76 ; 0x2cffc break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2d048: c5 eb ldi r28, 0xB5 ; 181 2d04a: d8 ed ldi r29, 0xD8 ; 216 2d04c: b8 cf rjmp .-144 ; 0x2cfbe break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2d04e: cd ea ldi r28, 0xAD ; 173 2d050: d8 ed ldi r29, 0xD8 ; 216 2d052: b5 cf rjmp .-150 ; 0x2cfbe menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2d054: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2d058: 88 23 and r24, r24 2d05a: 21 f0 breq .+8 ; 0x2d064 2d05c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2d060: 88 23 and r24, r24 2d062: 71 f1 breq .+92 ; 0x2d0c0 // 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; 2d064: 81 e0 ldi r24, 0x01 ; 1 2d066: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 2d06a: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2d06e: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 2d072: 81 ef ldi r24, 0xF1 ; 241 2d074: 9f e4 ldi r25, 0x4F ; 79 2d076: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2d07a: ac 01 movw r20, r24 2d07c: 63 e0 ldi r22, 0x03 ; 3 2d07e: 80 e0 ldi r24, 0x00 ; 0 2d080: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(0, 1); 2d084: 61 e0 ldi r22, 0x01 ; 1 2d086: 80 e0 ldi r24, 0x00 ; 0 2d088: 0e 94 26 70 call 0xe04c ; 0xe04c switch (eFilamentAction) 2d08c: e0 91 a3 03 lds r30, 0x03A3 ; 0x8003a3 2d090: e1 50 subi r30, 0x01 ; 1 2d092: e8 30 cpi r30, 0x08 ; 8 2d094: a8 f4 brcc .+42 ; 0x2d0c0 2d096: f0 e0 ldi r31, 0x00 ; 0 2d098: 88 27 eor r24, r24 2d09a: ee 5a subi r30, 0xAE ; 174 2d09c: f7 49 sbci r31, 0x97 ; 151 2d09e: 8e 4f sbci r24, 0xFE ; 254 2d0a0: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 2d0a4: 12 3a cpi r17, 0xA2 ; 162 2d0a6: 12 3a cpi r17, 0xA2 ; 162 2d0a8: 96 3a cpi r25, 0xA6 ; 166 2d0aa: 12 3a cpi r17, 0xA2 ; 162 2d0ac: 96 3a cpi r25, 0xA6 ; 166 2d0ae: d4 3b cpi r29, 0xB4 ; 180 2d0b0: 18 3b cpi r17, 0xB8 ; 184 2d0b2: 12 3a cpi r17, 0xA2 ; 162 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2d0b4: 85 e8 ldi r24, 0x85 ; 133 2d0b6: 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)); 2d0b8: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2d0bc: 0e 94 11 70 call 0xe022 ; 0xe022 // handled earlier break; } } if (bFilamentWaitingFlag) { 2d0c0: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 2d0c4: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2d0c6: 0f 94 0a 2e call 0x25c14 ; 0x25c14 } if (lcd_clicked()) 2d0ca: 0e 94 43 72 call 0xe486 ; 0xe486 2d0ce: 88 23 and r24, r24 2d0d0: 09 f4 brne .+2 ; 0x2d0d4 2d0d2: 30 cf rjmp .-416 ; 0x2cf34 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2d0d4: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c if (!bFilamentPreheatState) 2d0d8: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2d0dc: 81 11 cpse r24, r1 2d0de: 0e c0 rjmp .+28 ; 0x2d0fc return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2d0e0: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 2d0e4: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2d0e8: 0e 94 cb 68 call 0xd196 ; 0xd196 2d0ec: 81 11 cpse r24, r1 2d0ee: 04 c0 rjmp .+8 ; 0x2d0f8 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2d0f0: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 2d0f4: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 menu_back(); 2d0f8: 0f 94 56 d1 call 0x3a2ac ; 0x3a2ac } menu_back(); 2d0fc: 0f 94 56 d1 call 0x3a2ac ; 0x3a2ac clearFilamentAction(); } } } 2d100: df 91 pop r29 2d102: cf 91 pop r28 2d104: 1f 91 pop r17 2d106: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2d108: 0d 94 be 35 jmp 0x26b7c ; 0x26b7c 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)); 2d10c: 8e e6 ldi r24, 0x6E ; 110 2d10e: 9c e4 ldi r25, 0x4C ; 76 2d110: d3 cf rjmp .-90 ; 0x2d0b8 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2d112: 88 e5 ldi r24, 0x58 ; 88 2d114: 9c e4 ldi r25, 0x4C ; 76 2d116: d0 cf rjmp .-96 ; 0x2d0b8 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2d118: 84 e4 ldi r24, 0x44 ; 68 2d11a: 9c e4 ldi r25, 0x4C ; 76 2d11c: cd cf rjmp .-102 ; 0x2d0b8 0002d11e : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2d11e: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 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) ); 2d122: 40 91 95 13 lds r20, 0x1395 ; 0x801395 2d126: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 2d12a: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 2d12e: 41 30 cpi r20, 0x01 ; 1 2d130: 59 f0 breq .+22 ; 0x2d148 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() 2d132: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2d136: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2d13a: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2d13e: 28 17 cp r18, r24 2d140: 39 07 cpc r19, r25 2d142: 5c f4 brge .+22 ; 0x2d15a bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2d144: 0d 94 c1 35 jmp 0x26b82 ; 0x26b82 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() 2d148: 90 91 6b 13 lds r25, 0x136B ; 0x80136b 2d14c: 91 11 cpse r25, r1 2d14e: f1 cf rjmp .-30 ; 0x2d132 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2d150: 86 50 subi r24, 0x06 ; 6 2d152: 82 30 cpi r24, 0x02 ; 2 2d154: 70 f7 brcc .-36 ; 0x2d132 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() 2d156: 40 93 5e 06 sts 0x065E, r20 ; 0x80065e && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2d15a: 81 e0 ldi r24, 0x01 ; 1 2d15c: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d mFilamentItem(target_temperature[0], target_temperature_bed); 2d160: 60 91 68 0e lds r22, 0x0E68 ; 0x800e68 2d164: 70 91 69 0e lds r23, 0x0E69 ; 0x800e69 2d168: c9 01 movw r24, r18 2d16a: 0f 94 7b 67 call 0x2cef6 ; 0x2cef6 bFilamentSkipPreheat = false; // Reset flag 2d16e: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e } else { lcd_generic_preheat_menu(); } } 2d172: 08 95 ret 0002d174 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2d174: 82 e0 ldi r24, 0x02 ; 2 2d176: 0d 94 8f 68 jmp 0x2d11e ; 0x2d11e 0002d17a : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2d17a: 81 e0 ldi r24, 0x01 ; 1 2d17c: 0d 94 8f 68 jmp 0x2d11e ; 0x2d11e 0002d180 : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2d180: 83 e0 ldi r24, 0x03 ; 3 2d182: 0d 94 8f 68 jmp 0x2d11e ; 0x2d11e 0002d186 : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2d186: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2d18a: 6c e3 ldi r22, 0x3C ; 60 2d18c: 70 e0 ldi r23, 0x00 ; 0 2d18e: 87 ed ldi r24, 0xD7 ; 215 2d190: 90 e0 ldi r25, 0x00 ; 0 2d192: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d196 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2d196: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2d19a: 65 e5 ldi r22, 0x55 ; 85 2d19c: 70 e0 ldi r23, 0x00 ; 0 2d19e: 86 ee ldi r24, 0xE6 ; 230 2d1a0: 90 e0 ldi r25, 0x00 ; 0 2d1a2: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d1a6 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2d1a6: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2d1aa: 69 e6 ldi r22, 0x69 ; 105 2d1ac: 70 e0 ldi r23, 0x00 ; 0 2d1ae: 84 e0 ldi r24, 0x04 ; 4 2d1b0: 91 e0 ldi r25, 0x01 ; 1 2d1b2: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d1b6 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2d1b6: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2d1ba: 6e e6 ldi r22, 0x6E ; 110 2d1bc: 70 e0 ldi r23, 0x00 ; 0 2d1be: 83 e1 ldi r24, 0x13 ; 19 2d1c0: 91 e0 ldi r25, 0x01 ; 1 2d1c2: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d1c6 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2d1c6: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2d1ca: 6b e4 ldi r22, 0x4B ; 75 2d1cc: 70 e0 ldi r23, 0x00 ; 0 2d1ce: 87 ed ldi r24, 0xD7 ; 215 2d1d0: 90 e0 ldi r25, 0x00 ; 0 2d1d2: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d1d6 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2d1d6: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2d1da: 6a e5 ldi r22, 0x5A ; 90 2d1dc: 70 e0 ldi r23, 0x00 ; 0 2d1de: 83 e1 ldi r24, 0x13 ; 19 2d1e0: 91 e0 ldi r25, 0x01 ; 1 2d1e2: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d1e6 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2d1e6: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2d1ea: 64 e6 ldi r22, 0x64 ; 100 2d1ec: 70 e0 ldi r23, 0x00 ; 0 2d1ee: 8f ef ldi r24, 0xFF ; 255 2d1f0: 90 e0 ldi r25, 0x00 ; 0 2d1f2: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d1f6 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2d1f6: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2d1fa: 64 e6 ldi r22, 0x64 ; 100 2d1fc: 70 e0 ldi r23, 0x00 ; 0 2d1fe: 8c ed ldi r24, 0xDC ; 220 2d200: 90 e0 ldi r25, 0x00 ; 0 2d202: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d206 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2d206: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2d20a: 64 e6 ldi r22, 0x64 ; 100 2d20c: 70 e0 ldi r23, 0x00 ; 0 2d20e: 8e ef ldi r24, 0xFE ; 254 2d210: 90 e0 ldi r25, 0x00 ; 0 2d212: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d216 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2d216: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2d21a: 62 e3 ldi r22, 0x32 ; 50 2d21c: 70 e0 ldi r23, 0x00 ; 0 2d21e: 80 ef ldi r24, 0xF0 ; 240 2d220: 90 e0 ldi r25, 0x00 ; 0 2d222: 0d 94 7b 67 jmp 0x2cef6 ; 0x2cef6 0002d226 : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d226: 80 e0 ldi r24, 0x00 ; 0 2d228: 0f 94 2e 63 call 0x2c65c ; 0x2c65c #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2d22c: 0e 94 9c e3 call 0x1c738 ; 0x1c738 lcd_return_to_status(); 2d230: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 0002d234 : } 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){ 2d234: cf 92 push r12 2d236: df 92 push r13 2d238: ef 92 push r14 2d23a: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2d23c: 41 11 cpse r20, r1 2d23e: 04 c0 rjmp .+8 ; 0x2d248 2d240: 20 91 de 04 lds r18, 0x04DE ; 0x8004de 2d244: 22 30 cpi r18, 0x02 ; 2 2d246: d1 f0 breq .+52 ; 0x2d27c 2d248: 9b 01 movw r18, r22 2d24a: 6c 01 movw r12, r24 2d24c: f1 2c mov r15, r1 2d24e: e1 2c mov r14, r1 if(!tone_) { 2d250: 67 2b or r22, r23 2d252: c9 f4 brne .+50 ; 0x2d286 WRITE(BEEPER, HIGH); 2d254: 9f b7 in r25, 0x3f ; 63 2d256: f8 94 cli 2d258: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d25c: 84 60 ori r24, 0x04 ; 4 2d25e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d262: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2d264: c7 01 movw r24, r14 2d266: b6 01 movw r22, r12 2d268: 0f 94 5c 3c call 0x278b8 ; 0x278b8 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); 2d26c: 9f b7 in r25, 0x3f ; 63 2d26e: f8 94 cli 2d270: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d274: 8b 7f andi r24, 0xFB ; 251 2d276: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d27a: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2d27c: ff 90 pop r15 2d27e: ef 90 pop r14 2d280: df 90 pop r13 2d282: cf 90 pop r12 2d284: 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); 2d286: 22 0f add r18, r18 2d288: 33 1f adc r19, r19 2d28a: 50 e0 ldi r21, 0x00 ; 0 2d28c: 40 e0 ldi r20, 0x00 ; 0 2d28e: 60 e0 ldi r22, 0x00 ; 0 2d290: 74 e2 ldi r23, 0x24 ; 36 2d292: 84 ef ldi r24, 0xF4 ; 244 2d294: 90 e0 ldi r25, 0x00 ; 0 2d296: 0f 94 00 de call 0x3bc00 ; 0x3bc00 <__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; 2d29a: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2d29c: 21 15 cp r18, r1 2d29e: 31 05 cpc r19, r1 2d2a0: 81 e0 ldi r24, 0x01 ; 1 2d2a2: 48 07 cpc r20, r24 2d2a4: 51 05 cpc r21, r1 2d2a6: 44 f0 brlt .+16 ; 0x2d2b8 pwm_freq /= 64; // Increase prescaler to 64 2d2a8: 86 e0 ldi r24, 0x06 ; 6 2d2aa: 56 95 lsr r21 2d2ac: 47 95 ror r20 2d2ae: 37 95 ror r19 2d2b0: 27 95 ror r18 2d2b2: 8a 95 dec r24 2d2b4: d1 f7 brne .-12 ; 0x2d2aa prescalarbits = 0b011; 2d2b6: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2d2b8: 21 50 subi r18, 0x01 ; 1 2d2ba: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2d2bc: 4f b7 in r20, 0x3f ; 63 2d2be: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2d2c0: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d2c4: 88 7f andi r24, 0xF8 ; 248 2d2c6: 89 2b or r24, r25 2d2c8: 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); 2d2cc: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d2d0: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d2d4: 26 9f mul r18, r22 2d2d6: c0 01 movw r24, r0 2d2d8: 27 9f mul r18, r23 2d2da: 90 0d add r25, r0 2d2dc: 36 9f mul r19, r22 2d2de: 90 0d add r25, r0 2d2e0: 11 24 eor r1, r1 2d2e2: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d2e6: 6f ef ldi r22, 0xFF ; 255 2d2e8: 70 e0 ldi r23, 0x00 ; 0 2d2ea: 51 ff sbrs r21, 1 2d2ec: 04 c0 rjmp .+8 ; 0x2d2f6 2d2ee: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d2f2: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d2f6: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 2d2fa: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d2fe: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2d302: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d306: 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); 2d30a: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d30e: 83 60 ori r24, 0x03 ; 3 2d310: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d314: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2d316: c7 01 movw r24, r14 2d318: b6 01 movw r22, r12 2d31a: 0f 94 5c 3c call 0x278b8 ; 0x278b8 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2d31e: 2f b7 in r18, 0x3f ; 63 2d320: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2d322: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d326: 88 7f andi r24, 0xF8 ; 248 2d328: 85 60 ori r24, 0x05 ; 5 2d32a: 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); 2d32e: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d332: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d336: 3f ef ldi r19, 0xFF ; 255 2d338: 34 9f mul r19, r20 2d33a: c0 01 movw r24, r0 2d33c: 35 9f mul r19, r21 2d33e: 90 0d add r25, r0 2d340: 11 24 eor r1, r1 2d342: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d346: 6f ef ldi r22, 0xFF ; 255 2d348: 70 e0 ldi r23, 0x00 ; 0 2d34a: 31 ff sbrs r19, 1 2d34c: 04 c0 rjmp .+8 ; 0x2d356 2d34e: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d352: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d356: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 2d35a: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d35e: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2d362: 8f ef ldi r24, 0xFF ; 255 2d364: 90 e0 ldi r25, 0x00 ; 0 2d366: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d36a: 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)); 2d36e: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d372: 8c 7f andi r24, 0xFC ; 252 2d374: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d378: 2f bf out 0x3f, r18 ; 63 2d37a: 78 cf rjmp .-272 ; 0x2d26c 0002d37c : /// 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() { 2d37c: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2d37e: c0 91 de 04 lds r28, 0x04DE ; 0x8004de 2d382: c2 30 cpi r28, 0x02 ; 2 2d384: 59 f1 breq .+86 ; 0x2d3dc // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2d386: c1 30 cpi r28, 0x01 ; 1 2d388: 69 f4 brne .+26 ; 0x2d3a4 if (bFirst) return; 2d38a: 80 91 6c 05 lds r24, 0x056C ; 0x80056c <_ZL6bFirst.lto_priv.511> 2d38e: 81 11 cpse r24, r1 2d390: 25 c0 rjmp .+74 ; 0x2d3dc Sound_MakeCustom(80, 0, false); 2d392: 40 e0 ldi r20, 0x00 ; 0 2d394: 70 e0 ldi r23, 0x00 ; 0 2d396: 60 e0 ldi r22, 0x00 ; 0 2d398: 80 e5 ldi r24, 0x50 ; 80 2d39a: 90 e0 ldi r25, 0x00 ; 0 2d39c: 0f 94 1a 69 call 0x2d234 ; 0x2d234 bFirst = true; 2d3a0: c0 93 6c 05 sts 0x056C, r28 ; 0x80056c <_ZL6bFirst.lto_priv.511> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 2d3a4: 60 ed ldi r22, 0xD0 ; 208 2d3a6: 77 e0 ldi r23, 0x07 ; 7 2d3a8: 89 e6 ldi r24, 0x69 ; 105 2d3aa: 95 e0 ldi r25, 0x05 ; 5 2d3ac: 0f 94 af 3e call 0x27d5e ; 0x27d5e ::expired_cont(unsigned short)> 2d3b0: 88 23 and r24, r24 2d3b2: a1 f0 breq .+40 ; 0x2d3dc beep_timer.start(); 2d3b4: 89 e6 ldi r24, 0x69 ; 105 2d3b6: 95 e0 ldi r25, 0x05 ; 5 2d3b8: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2d3bc: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 2d3c0: 81 11 cpse r24, r1 2d3c2: 08 c0 rjmp .+16 ; 0x2d3d4 Sound_MakeCustom(80, 0, false); 2d3c4: 40 e0 ldi r20, 0x00 ; 0 2d3c6: 70 e0 ldi r23, 0x00 ; 0 2d3c8: 60 e0 ldi r22, 0x00 ; 0 2d3ca: 80 e5 ldi r24, 0x50 ; 80 2d3cc: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2d3ce: 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); 2d3d0: 0d 94 1a 69 jmp 0x2d234 ; 0x2d234 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d3d4: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2d3d6: 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); 2d3d8: 0d 94 2e 63 jmp 0x2c65c ; 0x2c65c } } #endif // BEEPER > 0 } 2d3dc: cf 91 pop r28 2d3de: 08 95 ret 0002d3e0 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2d3e0: 82 30 cpi r24, 0x02 ; 2 2d3e2: b9 f0 breq .+46 ; 0x2d412 2d3e4: 83 30 cpi r24, 0x03 ; 3 2d3e6: e9 f0 breq .+58 ; 0x2d422 2d3e8: 81 30 cpi r24, 0x01 ; 1 2d3ea: 59 f0 breq .+22 ; 0x2d402 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; 2d3ec: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d3f0: 61 30 cpi r22, 0x01 ; 1 2d3f2: 29 f4 brne .+10 ; 0x2d3fe 2d3f4: 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; 2d3f6: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2d3fa: 00 00 nop } 2d3fc: 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; 2d3fe: 8e 7f andi r24, 0xFE ; 254 2d400: fa cf rjmp .-12 ; 0x2d3f6 case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2d402: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d406: 61 11 cpse r22, r1 2d408: 02 c0 rjmp .+4 ; 0x2d40e 2d40a: 82 60 ori r24, 0x02 ; 2 2d40c: f4 cf rjmp .-24 ; 0x2d3f6 2d40e: 8d 7f andi r24, 0xFD ; 253 2d410: f2 cf rjmp .-28 ; 0x2d3f6 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2d412: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d416: 61 30 cpi r22, 0x01 ; 1 2d418: 11 f4 brne .+4 ; 0x2d41e 2d41a: 84 60 ori r24, 0x04 ; 4 2d41c: ec cf rjmp .-40 ; 0x2d3f6 2d41e: 8b 7f andi r24, 0xFB ; 251 2d420: ea cf rjmp .-44 ; 0x2d3f6 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2d422: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d426: 61 11 cpse r22, r1 2d428: 02 c0 rjmp .+4 ; 0x2d42e 2d42a: 80 64 ori r24, 0x40 ; 64 2d42c: e4 cf rjmp .-56 ; 0x2d3f6 2d42e: 8f 7b andi r24, 0xBF ; 191 2d430: e2 cf rjmp .-60 ; 0x2d3f6 0002d432 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2d432: cf 93 push r28 if (cacheDirty_) { 2d434: 80 91 74 0e lds r24, 0x0E74 ; 0x800e74 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2d438: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2d43a: 88 23 and r24, r24 2d43c: a1 f0 breq .+40 ; 0x2d466 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2d43e: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 2d442: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 2d446: 60 91 6e 0e lds r22, 0x0E6E ; 0x800e6e 2d44a: 70 91 6f 0e lds r23, 0x0E6F ; 0x800e6f 2d44e: 28 e7 ldi r18, 0x78 ; 120 2d450: 3e e0 ldi r19, 0x0E ; 14 2d452: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 2d456: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 2d45a: 0f 94 b6 a5 call 0x34b6c ; 0x34b6c 2d45e: c8 2f mov r28, r24 2d460: 81 11 cpse r24, r1 2d462: 04 c0 rjmp .+8 ; 0x2d46c cacheDirty_ = 0; } return true; fail: return false; 2d464: c0 e0 ldi r28, 0x00 ; 0 } 2d466: 8c 2f mov r24, r28 2d468: cf 91 pop r28 2d46a: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2d46c: 40 91 70 0e lds r20, 0x0E70 ; 0x800e70 2d470: 50 91 71 0e lds r21, 0x0E71 ; 0x800e71 2d474: 60 91 72 0e lds r22, 0x0E72 ; 0x800e72 2d478: 70 91 73 0e lds r23, 0x0E73 ; 0x800e73 2d47c: 41 15 cp r20, r1 2d47e: 51 05 cpc r21, r1 2d480: 61 05 cpc r22, r1 2d482: 71 05 cpc r23, r1 2d484: 91 f0 breq .+36 ; 0x2d4aa if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2d486: 28 e7 ldi r18, 0x78 ; 120 2d488: 3e e0 ldi r19, 0x0E ; 14 2d48a: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 2d48e: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 2d492: 0f 94 b6 a5 call 0x34b6c ; 0x34b6c 2d496: 88 23 and r24, r24 2d498: 29 f3 breq .-54 ; 0x2d464 goto fail; } cacheMirrorBlock_ = 0; 2d49a: 10 92 70 0e sts 0x0E70, r1 ; 0x800e70 2d49e: 10 92 71 0e sts 0x0E71, r1 ; 0x800e71 2d4a2: 10 92 72 0e sts 0x0E72, r1 ; 0x800e72 2d4a6: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 } cacheDirty_ = 0; 2d4aa: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 2d4ae: db cf rjmp .-74 ; 0x2d466 0002d4b0 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2d4b0: cf 92 push r12 2d4b2: df 92 push r13 2d4b4: ef 92 push r14 2d4b6: ff 92 push r15 2d4b8: cf 93 push r28 2d4ba: 6b 01 movw r12, r22 2d4bc: 7c 01 movw r14, r24 2d4be: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2d4c0: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 2d4c4: 90 91 6d 0e lds r25, 0x0E6D ; 0x800e6d 2d4c8: a0 91 6e 0e lds r26, 0x0E6E ; 0x800e6e 2d4cc: b0 91 6f 0e lds r27, 0x0E6F ; 0x800e6f 2d4d0: 8c 15 cp r24, r12 2d4d2: 9d 05 cpc r25, r13 2d4d4: ae 05 cpc r26, r14 2d4d6: bf 05 cpc r27, r15 2d4d8: 01 f1 breq .+64 ; 0x2d51a if (!cacheFlush()) goto fail; 2d4da: 0f 94 19 6a call 0x2d432 ; 0x2d432 2d4de: 81 11 cpse r24, r1 2d4e0: 08 c0 rjmp .+16 ; 0x2d4f2 } if (dirty) cacheDirty_ = true; return true; fail: return false; 2d4e2: c0 e0 ldi r28, 0x00 ; 0 } 2d4e4: 8c 2f mov r24, r28 2d4e6: cf 91 pop r28 2d4e8: ff 90 pop r15 2d4ea: ef 90 pop r14 2d4ec: df 90 pop r13 2d4ee: cf 90 pop r12 2d4f0: 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; 2d4f2: 28 e7 ldi r18, 0x78 ; 120 2d4f4: 3e e0 ldi r19, 0x0E ; 14 2d4f6: b7 01 movw r22, r14 2d4f8: a6 01 movw r20, r12 2d4fa: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 2d4fe: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 2d502: 0f 94 1a a6 call 0x34c34 ; 0x34c34 2d506: 88 23 and r24, r24 2d508: 61 f3 breq .-40 ; 0x2d4e2 cacheBlockNumber_ = blockNumber; 2d50a: c0 92 6c 0e sts 0x0E6C, r12 ; 0x800e6c 2d50e: d0 92 6d 0e sts 0x0E6D, r13 ; 0x800e6d 2d512: e0 92 6e 0e sts 0x0E6E, r14 ; 0x800e6e 2d516: f0 92 6f 0e sts 0x0E6F, r15 ; 0x800e6f } if (dirty) cacheDirty_ = true; 2d51a: cc 23 and r28, r28 2d51c: 21 f0 breq .+8 ; 0x2d526 2d51e: 81 e0 ldi r24, 0x01 ; 1 2d520: 80 93 74 0e sts 0x0E74, r24 ; 0x800e74 2d524: df cf rjmp .-66 ; 0x2d4e4 return true; 2d526: c1 e0 ldi r28, 0x01 ; 1 2d528: dd cf rjmp .-70 ; 0x2d4e4 0002d52a : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2d52a: 4f 92 push r4 2d52c: 5f 92 push r5 2d52e: 6f 92 push r6 2d530: 7f 92 push r7 2d532: 8f 92 push r8 2d534: 9f 92 push r9 2d536: af 92 push r10 2d538: bf 92 push r11 2d53a: cf 92 push r12 2d53c: df 92 push r13 2d53e: ef 92 push r14 2d540: ff 92 push r15 2d542: 0f 93 push r16 2d544: 1f 93 push r17 2d546: cf 93 push r28 2d548: df 93 push r29 2d54a: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2d54c: 42 30 cpi r20, 0x02 ; 2 2d54e: 51 05 cpc r21, r1 2d550: 61 05 cpc r22, r1 2d552: 71 05 cpc r23, r1 2d554: 90 f4 brcc .+36 ; 0x2d57a // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2d556: 80 e0 ldi r24, 0x00 ; 0 } 2d558: df 91 pop r29 2d55a: cf 91 pop r28 2d55c: 1f 91 pop r17 2d55e: 0f 91 pop r16 2d560: ff 90 pop r15 2d562: ef 90 pop r14 2d564: df 90 pop r13 2d566: cf 90 pop r12 2d568: bf 90 pop r11 2d56a: af 90 pop r10 2d56c: 9f 90 pop r9 2d56e: 8f 90 pop r8 2d570: 7f 90 pop r7 2d572: 6f 90 pop r6 2d574: 5f 90 pop r5 2d576: 4f 90 pop r4 2d578: 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; 2d57a: 89 85 ldd r24, Y+9 ; 0x09 2d57c: 9a 85 ldd r25, Y+10 ; 0x0a 2d57e: ab 85 ldd r26, Y+11 ; 0x0b 2d580: bc 85 ldd r27, Y+12 ; 0x0c 2d582: 01 96 adiw r24, 0x01 ; 1 2d584: a1 1d adc r26, r1 2d586: b1 1d adc r27, r1 2d588: 84 17 cp r24, r20 2d58a: 95 07 cpc r25, r21 2d58c: a6 07 cpc r26, r22 2d58e: b7 07 cpc r27, r23 2d590: 10 f3 brcs .-60 ; 0x2d556 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2d592: 8f 89 ldd r24, Y+23 ; 0x17 2d594: 80 31 cpi r24, 0x10 ; 16 2d596: c9 f5 brne .+114 ; 0x2d60a lba = fatStartBlock_ + (cluster >> 8); 2d598: 85 2e mov r8, r21 2d59a: 96 2e mov r9, r22 2d59c: a7 2e mov r10, r23 2d59e: bb 24 eor r11, r11 2d5a0: 8b 89 ldd r24, Y+19 ; 0x13 2d5a2: 9c 89 ldd r25, Y+20 ; 0x14 2d5a4: ad 89 ldd r26, Y+21 ; 0x15 2d5a6: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d5a8: 88 0e add r8, r24 2d5aa: 99 1e adc r9, r25 2d5ac: aa 1e adc r10, r26 2d5ae: bb 1e adc r11, r27 2d5b0: 28 01 movw r4, r16 2d5b2: 39 01 movw r6, r18 2d5b4: 6a 01 movw r12, r20 2d5b6: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2d5b8: 41 e0 ldi r20, 0x01 ; 1 2d5ba: c5 01 movw r24, r10 2d5bc: b4 01 movw r22, r8 2d5be: 0f 94 58 6a call 0x2d4b0 ; 0x2d4b0 2d5c2: 88 23 and r24, r24 2d5c4: 41 f2 breq .-112 ; 0x2d556 // store entry if (fatType_ == 16) { 2d5c6: 9f 89 ldd r25, Y+23 ; 0x17 2d5c8: 90 31 cpi r25, 0x10 ; 16 2d5ca: 81 f5 brne .+96 ; 0x2d62c cacheBuffer_.fat16[cluster & 0XFF] = value; 2d5cc: dd 24 eor r13, r13 2d5ce: ee 24 eor r14, r14 2d5d0: ff 24 eor r15, r15 2d5d2: f6 01 movw r30, r12 2d5d4: ee 0f add r30, r30 2d5d6: ff 1f adc r31, r31 2d5d8: e8 58 subi r30, 0x88 ; 136 2d5da: f1 4f sbci r31, 0xF1 ; 241 2d5dc: 11 83 std Z+1, r17 ; 0x01 2d5de: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2d5e0: 9a 89 ldd r25, Y+18 ; 0x12 2d5e2: 92 30 cpi r25, 0x02 ; 2 2d5e4: 08 f4 brcc .+2 ; 0x2d5e8 2d5e6: b8 cf rjmp .-144 ; 0x2d558 2d5e8: 4d 81 ldd r20, Y+5 ; 0x05 2d5ea: 5e 81 ldd r21, Y+6 ; 0x06 2d5ec: 6f 81 ldd r22, Y+7 ; 0x07 2d5ee: 78 85 ldd r23, Y+8 ; 0x08 2d5f0: 84 0e add r8, r20 2d5f2: 95 1e adc r9, r21 2d5f4: a6 1e adc r10, r22 2d5f6: b7 1e adc r11, r23 2d5f8: 80 92 70 0e sts 0x0E70, r8 ; 0x800e70 2d5fc: 90 92 71 0e sts 0x0E71, r9 ; 0x800e71 2d600: a0 92 72 0e sts 0x0E72, r10 ; 0x800e72 2d604: b0 92 73 0e sts 0x0E73, r11 ; 0x800e73 2d608: a7 cf rjmp .-178 ; 0x2d558 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d60a: 80 32 cpi r24, 0x20 ; 32 2d60c: 09 f0 breq .+2 ; 0x2d610 2d60e: a3 cf rjmp .-186 ; 0x2d556 lba = fatStartBlock_ + (cluster >> 7); 2d610: 8b 89 ldd r24, Y+19 ; 0x13 2d612: 9c 89 ldd r25, Y+20 ; 0x14 2d614: ad 89 ldd r26, Y+21 ; 0x15 2d616: be 89 ldd r27, Y+22 ; 0x16 2d618: 4a 01 movw r8, r20 2d61a: 5b 01 movw r10, r22 2d61c: e7 e0 ldi r30, 0x07 ; 7 2d61e: b6 94 lsr r11 2d620: a7 94 ror r10 2d622: 97 94 ror r9 2d624: 87 94 ror r8 2d626: ea 95 dec r30 2d628: d1 f7 brne .-12 ; 0x2d61e 2d62a: be cf rjmp .-132 ; 0x2d5a8 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2d62c: e8 94 clt 2d62e: c7 f8 bld r12, 7 2d630: dd 24 eor r13, r13 2d632: ee 24 eor r14, r14 2d634: ff 24 eor r15, r15 2d636: f6 01 movw r30, r12 2d638: ee 0f add r30, r30 2d63a: ff 1f adc r31, r31 2d63c: ee 0f add r30, r30 2d63e: ff 1f adc r31, r31 2d640: e8 58 subi r30, 0x88 ; 136 2d642: f1 4f sbci r31, 0xF1 ; 241 2d644: 40 82 st Z, r4 2d646: 51 82 std Z+1, r5 ; 0x01 2d648: 62 82 std Z+2, r6 ; 0x02 2d64a: 73 82 std Z+3, r7 ; 0x03 2d64c: c9 cf rjmp .-110 ; 0x2d5e0 0002d64e : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2d64e: cf 92 push r12 2d650: df 92 push r13 2d652: ef 92 push r14 2d654: ff 92 push r15 2d656: 0f 93 push r16 2d658: 1f 93 push r17 2d65a: cf 93 push r28 2d65c: df 93 push r29 2d65e: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2d660: 81 85 ldd r24, Z+9 ; 0x09 2d662: 92 85 ldd r25, Z+10 ; 0x0a 2d664: a3 85 ldd r26, Z+11 ; 0x0b 2d666: b4 85 ldd r27, Z+12 ; 0x0c 2d668: 01 96 adiw r24, 0x01 ; 1 2d66a: a1 1d adc r26, r1 2d66c: b1 1d adc r27, r1 2d66e: 84 17 cp r24, r20 2d670: 95 07 cpc r25, r21 2d672: a6 07 cpc r26, r22 2d674: b7 07 cpc r27, r23 2d676: 50 f4 brcc .+20 ; 0x2d68c *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2d678: 80 e0 ldi r24, 0x00 ; 0 } 2d67a: df 91 pop r29 2d67c: cf 91 pop r28 2d67e: 1f 91 pop r17 2d680: 0f 91 pop r16 2d682: ff 90 pop r15 2d684: ef 90 pop r14 2d686: df 90 pop r13 2d688: cf 90 pop r12 2d68a: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2d68c: 87 89 ldd r24, Z+23 ; 0x17 2d68e: 80 31 cpi r24, 0x10 ; 16 2d690: a9 f5 brne .+106 ; 0x2d6fc lba = fatStartBlock_ + (cluster >> 8); 2d692: bb 27 eor r27, r27 2d694: a7 2f mov r26, r23 2d696: 96 2f mov r25, r22 2d698: 85 2f mov r24, r21 2d69a: c3 88 ldd r12, Z+19 ; 0x13 2d69c: d4 88 ldd r13, Z+20 ; 0x14 2d69e: e5 88 ldd r14, Z+21 ; 0x15 2d6a0: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d6a2: 8c 0d add r24, r12 2d6a4: 9d 1d adc r25, r13 2d6a6: ae 1d adc r26, r14 2d6a8: bf 1d adc r27, r15 2d6aa: e9 01 movw r28, r18 2d6ac: 6a 01 movw r12, r20 2d6ae: 7b 01 movw r14, r22 2d6b0: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2d6b2: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 2d6b6: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 2d6ba: 60 91 6e 0e lds r22, 0x0E6E ; 0x800e6e 2d6be: 70 91 6f 0e lds r23, 0x0E6F ; 0x800e6f 2d6c2: 84 17 cp r24, r20 2d6c4: 95 07 cpc r25, r21 2d6c6: a6 07 cpc r26, r22 2d6c8: b7 07 cpc r27, r23 2d6ca: 49 f5 brne .+82 ; 0x2d71e if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2d6cc: f8 01 movw r30, r16 2d6ce: 87 89 ldd r24, Z+23 ; 0x17 2d6d0: 80 31 cpi r24, 0x10 ; 16 2d6d2: 69 f5 brne .+90 ; 0x2d72e *value = cacheBuffer_.fat16[cluster & 0XFF]; 2d6d4: b7 01 movw r22, r14 2d6d6: a6 01 movw r20, r12 2d6d8: 55 27 eor r21, r21 2d6da: 66 27 eor r22, r22 2d6dc: 77 27 eor r23, r23 2d6de: 44 0f add r20, r20 2d6e0: 55 1f adc r21, r21 2d6e2: 48 58 subi r20, 0x88 ; 136 2d6e4: 51 4f sbci r21, 0xF1 ; 241 2d6e6: fa 01 movw r30, r20 2d6e8: 80 81 ld r24, Z 2d6ea: 91 81 ldd r25, Z+1 ; 0x01 2d6ec: b0 e0 ldi r27, 0x00 ; 0 2d6ee: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2d6f0: 88 83 st Y, r24 2d6f2: 99 83 std Y+1, r25 ; 0x01 2d6f4: aa 83 std Y+2, r26 ; 0x02 2d6f6: bb 83 std Y+3, r27 ; 0x03 2d6f8: 81 e0 ldi r24, 0x01 ; 1 2d6fa: bf cf rjmp .-130 ; 0x2d67a *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d6fc: 80 32 cpi r24, 0x20 ; 32 2d6fe: 09 f0 breq .+2 ; 0x2d702 2d700: bb cf rjmp .-138 ; 0x2d678 lba = fatStartBlock_ + (cluster >> 7); 2d702: c3 88 ldd r12, Z+19 ; 0x13 2d704: d4 88 ldd r13, Z+20 ; 0x14 2d706: e5 88 ldd r14, Z+21 ; 0x15 2d708: f6 88 ldd r15, Z+22 ; 0x16 2d70a: db 01 movw r26, r22 2d70c: ca 01 movw r24, r20 2d70e: c7 e0 ldi r28, 0x07 ; 7 2d710: b6 95 lsr r27 2d712: a7 95 ror r26 2d714: 97 95 ror r25 2d716: 87 95 ror r24 2d718: ca 95 dec r28 2d71a: d1 f7 brne .-12 ; 0x2d710 2d71c: c2 cf rjmp .-124 ; 0x2d6a2 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2d71e: 40 e0 ldi r20, 0x00 ; 0 2d720: bc 01 movw r22, r24 2d722: cd 01 movw r24, r26 2d724: 0f 94 58 6a call 0x2d4b0 ; 0x2d4b0 2d728: 81 11 cpse r24, r1 2d72a: d0 cf rjmp .-96 ; 0x2d6cc 2d72c: a5 cf rjmp .-182 ; 0x2d678 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2d72e: b7 01 movw r22, r14 2d730: a6 01 movw r20, r12 2d732: 4f 77 andi r20, 0x7F ; 127 2d734: 55 27 eor r21, r21 2d736: 66 27 eor r22, r22 2d738: 77 27 eor r23, r23 2d73a: 44 0f add r20, r20 2d73c: 55 1f adc r21, r21 2d73e: 44 0f add r20, r20 2d740: 55 1f adc r21, r21 2d742: 48 58 subi r20, 0x88 ; 136 2d744: 51 4f sbci r21, 0xF1 ; 241 2d746: fa 01 movw r30, r20 2d748: 80 81 ld r24, Z 2d74a: 91 81 ldd r25, Z+1 ; 0x01 2d74c: a2 81 ldd r26, Z+2 ; 0x02 2d74e: b3 81 ldd r27, Z+3 ; 0x03 2d750: bf 70 andi r27, 0x0F ; 15 2d752: ce cf rjmp .-100 ; 0x2d6f0 0002d754 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2d754: 4f 92 push r4 2d756: 5f 92 push r5 2d758: 6f 92 push r6 2d75a: 7f 92 push r7 2d75c: af 92 push r10 2d75e: bf 92 push r11 2d760: cf 92 push r12 2d762: df 92 push r13 2d764: ef 92 push r14 2d766: ff 92 push r15 2d768: 0f 93 push r16 2d76a: 1f 93 push r17 2d76c: cf 93 push r28 2d76e: df 93 push r29 2d770: 00 d0 rcall .+0 ; 0x2d772 2d772: 1f 92 push r1 2d774: cd b7 in r28, 0x3d ; 61 2d776: de b7 in r29, 0x3e ; 62 2d778: 8c 01 movw r16, r24 2d77a: 49 83 std Y+1, r20 ; 0x01 2d77c: 5a 83 std Y+2, r21 ; 0x02 2d77e: 6b 83 std Y+3, r22 ; 0x03 2d780: 7c 83 std Y+4, r23 ; 0x04 2d782: 59 01 movw r10, r18 uint32_t s = 0; 2d784: c1 2c mov r12, r1 2d786: d1 2c mov r13, r1 2d788: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2d78a: 41 2c mov r4, r1 2d78c: 82 e0 ldi r24, 0x02 ; 2 2d78e: 58 2e mov r5, r24 2d790: 61 2c mov r6, r1 2d792: 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; 2d794: 49 81 ldd r20, Y+1 ; 0x01 2d796: 5a 81 ldd r21, Y+2 ; 0x02 2d798: 6b 81 ldd r22, Y+3 ; 0x03 2d79a: 7c 81 ldd r23, Y+4 ; 0x04 2d79c: 9e 01 movw r18, r28 2d79e: 2f 5f subi r18, 0xFF ; 255 2d7a0: 3f 4f sbci r19, 0xFF ; 255 2d7a2: c8 01 movw r24, r16 2d7a4: 0f 94 27 6b call 0x2d64e ; 0x2d64e 2d7a8: 88 23 and r24, r24 2d7aa: 19 f1 breq .+70 ; 0x2d7f2 s += 512UL << clusterSizeShift_; 2d7ac: f8 01 movw r30, r16 2d7ae: 85 85 ldd r24, Z+13 ; 0x0d 2d7b0: a3 01 movw r20, r6 2d7b2: 92 01 movw r18, r4 2d7b4: 04 c0 rjmp .+8 ; 0x2d7be 2d7b6: 22 0f add r18, r18 2d7b8: 33 1f adc r19, r19 2d7ba: 44 1f adc r20, r20 2d7bc: 55 1f adc r21, r21 2d7be: 8a 95 dec r24 2d7c0: d2 f7 brpl .-12 ; 0x2d7b6 2d7c2: da 01 movw r26, r20 2d7c4: c9 01 movw r24, r18 2d7c6: c8 0e add r12, r24 2d7c8: d9 1e adc r13, r25 2d7ca: ea 1e adc r14, r26 2d7cc: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2d7ce: 49 81 ldd r20, Y+1 ; 0x01 2d7d0: 5a 81 ldd r21, Y+2 ; 0x02 2d7d2: 6b 81 ldd r22, Y+3 ; 0x03 2d7d4: 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; 2d7d6: 87 89 ldd r24, Z+23 ; 0x17 2d7d8: 80 31 cpi r24, 0x10 ; 16 2d7da: f1 f4 brne .+60 ; 0x2d818 2d7dc: 81 e0 ldi r24, 0x01 ; 1 2d7de: 48 3f cpi r20, 0xF8 ; 248 2d7e0: 5f 4f sbci r21, 0xFF ; 255 2d7e2: 61 05 cpc r22, r1 2d7e4: 71 05 cpc r23, r1 2d7e6: b0 f2 brcs .-84 ; 0x2d794 *size = s; 2d7e8: f5 01 movw r30, r10 2d7ea: c0 82 st Z, r12 2d7ec: d1 82 std Z+1, r13 ; 0x01 2d7ee: e2 82 std Z+2, r14 ; 0x02 2d7f0: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2d7f2: 0f 90 pop r0 2d7f4: 0f 90 pop r0 2d7f6: 0f 90 pop r0 2d7f8: 0f 90 pop r0 2d7fa: df 91 pop r29 2d7fc: cf 91 pop r28 2d7fe: 1f 91 pop r17 2d800: 0f 91 pop r16 2d802: ff 90 pop r15 2d804: ef 90 pop r14 2d806: df 90 pop r13 2d808: cf 90 pop r12 2d80a: bf 90 pop r11 2d80c: af 90 pop r10 2d80e: 7f 90 pop r7 2d810: 6f 90 pop r6 2d812: 5f 90 pop r5 2d814: 4f 90 pop r4 2d816: 08 95 ret return cluster >= FAT32EOC_MIN; 2d818: 81 e0 ldi r24, 0x01 ; 1 2d81a: 48 3f cpi r20, 0xF8 ; 248 2d81c: 5f 4f sbci r21, 0xFF ; 255 2d81e: 6f 4f sbci r22, 0xFF ; 255 2d820: 7f 40 sbci r23, 0x0F ; 15 2d822: 08 f4 brcc .+2 ; 0x2d826 2d824: b7 cf rjmp .-146 ; 0x2d794 2d826: e0 cf rjmp .-64 ; 0x2d7e8 0002d828 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2d828: cf 92 push r12 2d82a: df 92 push r13 2d82c: ef 92 push r14 2d82e: ff 92 push r15 2d830: 1f 93 push r17 2d832: cf 93 push r28 2d834: df 93 push r29 2d836: ec 01 movw r28, r24 2d838: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2d83a: e1 11 cpse r30, r1 2d83c: 09 c0 rjmp .+18 ; 0x2d850 2d83e: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2d840: df 91 pop r29 2d842: cf 91 pop r28 2d844: 1f 91 pop r17 2d846: ff 90 pop r15 2d848: ef 90 pop r14 2d84a: df 90 pop r13 2d84c: cf 90 pop r12 2d84e: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2d850: 89 81 ldd r24, Y+1 ; 0x01 2d852: 80 ff sbrs r24, 0 2d854: f4 cf rjmp .-24 ; 0x2d83e gfOffset = curPosition_ & 0X1FF; // offset in block 2d856: 48 85 ldd r20, Y+8 ; 0x08 2d858: 59 85 ldd r21, Y+9 ; 0x09 2d85a: 6a 85 ldd r22, Y+10 ; 0x0a 2d85c: 7b 85 ldd r23, Y+11 ; 0x0b 2d85e: 9a 01 movw r18, r20 2d860: 31 70 andi r19, 0x01 ; 1 2d862: 3a a3 std Y+34, r19 ; 0x22 2d864: 29 a3 std Y+33, r18 ; 0x21 2d866: 89 8d ldd r24, Y+25 ; 0x19 2d868: 9a 8d ldd r25, Y+26 ; 0x1a 2d86a: 6a 01 movw r12, r20 2d86c: 7b 01 movw r14, r22 2d86e: f9 e0 ldi r31, 0x09 ; 9 2d870: f6 94 lsr r15 2d872: e7 94 ror r14 2d874: d7 94 ror r13 2d876: c7 94 ror r12 2d878: fa 95 dec r31 2d87a: d1 f7 brne .-12 ; 0x2d870 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2d87c: e2 30 cpi r30, 0x02 ; 2 2d87e: 79 f4 brne .+30 ; 0x2d89e // 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); 2d880: fc 01 movw r30, r24 2d882: 82 8d ldd r24, Z+26 ; 0x1a 2d884: 93 8d ldd r25, Z+27 ; 0x1b 2d886: a4 8d ldd r26, Z+28 ; 0x1c 2d888: b5 8d ldd r27, Z+29 ; 0x1d 2d88a: 8c 0d add r24, r12 2d88c: 9d 1d adc r25, r13 2d88e: ae 1d adc r26, r14 2d890: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2d892: 8d 8f std Y+29, r24 ; 0x1d 2d894: 9e 8f std Y+30, r25 ; 0x1e 2d896: af 8f std Y+31, r26 ; 0x1f 2d898: b8 a3 std Y+32, r27 ; 0x20 } return true; 2d89a: 81 e0 ldi r24, 0x01 ; 1 2d89c: d1 cf rjmp .-94 ; 0x2d840 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);} 2d89e: fc 01 movw r30, r24 2d8a0: 14 81 ldd r17, Z+4 ; 0x04 2d8a2: 11 50 subi r17, 0x01 ; 1 2d8a4: 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) { 2d8a6: 23 2b or r18, r19 2d8a8: 71 f4 brne .+28 ; 0x2d8c6 2d8aa: 11 11 cpse r17, r1 2d8ac: 0c c0 rjmp .+24 ; 0x2d8c6 // start of new cluster if (curPosition_ == 0) { 2d8ae: 45 2b or r20, r21 2d8b0: 46 2b or r20, r22 2d8b2: 47 2b or r20, r23 2d8b4: 31 f5 brne .+76 ; 0x2d902 // use first cluster in file curCluster_ = firstCluster_; 2d8b6: 8d 89 ldd r24, Y+21 ; 0x15 2d8b8: 9e 89 ldd r25, Y+22 ; 0x16 2d8ba: af 89 ldd r26, Y+23 ; 0x17 2d8bc: b8 8d ldd r27, Y+24 ; 0x18 2d8be: 8c 83 std Y+4, r24 ; 0x04 2d8c0: 9d 83 std Y+5, r25 ; 0x05 2d8c2: ae 83 std Y+6, r26 ; 0x06 2d8c4: 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; 2d8c6: e9 8d ldd r30, Y+25 ; 0x19 2d8c8: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2d8ca: 8c 81 ldd r24, Y+4 ; 0x04 2d8cc: 9d 81 ldd r25, Y+5 ; 0x05 2d8ce: ae 81 ldd r26, Y+6 ; 0x06 2d8d0: bf 81 ldd r27, Y+7 ; 0x07 2d8d2: 02 97 sbiw r24, 0x02 ; 2 2d8d4: a1 09 sbc r26, r1 2d8d6: b1 09 sbc r27, r1 2d8d8: 25 85 ldd r18, Z+13 ; 0x0d 2d8da: 04 c0 rjmp .+8 ; 0x2d8e4 2d8dc: 88 0f add r24, r24 2d8de: 99 1f adc r25, r25 2d8e0: aa 1f adc r26, r26 2d8e2: bb 1f adc r27, r27 2d8e4: 2a 95 dec r18 2d8e6: d2 f7 brpl .-12 ; 0x2d8dc 2d8e8: 46 85 ldd r20, Z+14 ; 0x0e 2d8ea: 57 85 ldd r21, Z+15 ; 0x0f 2d8ec: 60 89 ldd r22, Z+16 ; 0x10 2d8ee: 71 89 ldd r23, Z+17 ; 0x11 2d8f0: 84 0f add r24, r20 2d8f2: 95 1f adc r25, r21 2d8f4: a6 1f adc r26, r22 2d8f6: b7 1f adc r27, r23 2d8f8: 81 0f add r24, r17 2d8fa: 91 1d adc r25, r1 2d8fc: a1 1d adc r26, r1 2d8fe: b1 1d adc r27, r1 2d900: c8 cf rjmp .-112 ; 0x2d892 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2d902: 4c 81 ldd r20, Y+4 ; 0x04 2d904: 5d 81 ldd r21, Y+5 ; 0x05 2d906: 6e 81 ldd r22, Y+6 ; 0x06 2d908: 7f 81 ldd r23, Y+7 ; 0x07 2d90a: 9e 01 movw r18, r28 2d90c: 2c 5f subi r18, 0xFC ; 252 2d90e: 3f 4f sbci r19, 0xFF ; 255 2d910: 0f 94 27 6b call 0x2d64e ; 0x2d64e 2d914: 81 11 cpse r24, r1 2d916: d7 cf rjmp .-82 ; 0x2d8c6 2d918: 92 cf rjmp .-220 ; 0x2d83e 0002d91a : * 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) { 2d91a: df 92 push r13 2d91c: ef 92 push r14 2d91e: ff 92 push r15 2d920: 0f 93 push r16 2d922: 1f 93 push r17 2d924: cf 93 push r28 2d926: df 93 push r29 2d928: 8c 01 movw r16, r24 2d92a: eb 01 movw r28, r22 2d92c: 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; 2d92e: 8d e0 ldi r24, 0x0D ; 13 2d930: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2d932: 40 e2 ldi r20, 0x20 ; 32 2d934: 50 e0 ldi r21, 0x00 ; 0 2d936: be 01 movw r22, r28 2d938: c8 01 movw r24, r16 2d93a: 0f 94 d3 a6 call 0x34da6 ; 0x34da6 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2d93e: 80 32 cpi r24, 0x20 ; 32 2d940: 91 05 cpc r25, r1 2d942: 71 f0 breq .+28 ; 0x2d960 2d944: 21 e0 ldi r18, 0x01 ; 1 2d946: 89 2b or r24, r25 2d948: 09 f4 brne .+2 ; 0x2d94c 2d94a: 20 e0 ldi r18, 0x00 ; 0 2d94c: 82 2f mov r24, r18 2d94e: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2d950: df 91 pop r29 2d952: cf 91 pop r28 2d954: 1f 91 pop r17 2d956: 0f 91 pop r16 2d958: ff 90 pop r15 2d95a: ef 90 pop r14 2d95c: df 90 pop r13 2d95e: 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; 2d960: 28 81 ld r18, Y 2d962: 22 23 and r18, r18 2d964: 09 f4 brne .+2 ; 0x2d968 2d966: 3f c0 rjmp .+126 ; 0x2d9e6 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2d968: 25 3e cpi r18, 0xE5 ; 229 2d96a: 19 f3 breq .-58 ; 0x2d932 2d96c: 2e 32 cpi r18, 0x2E ; 46 2d96e: 09 f3 breq .-62 ; 0x2d932 //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) 2d970: 3b 85 ldd r19, Y+11 ; 0x0b 2d972: 3f 73 andi r19, 0x3F ; 63 2d974: 3f 30 cpi r19, 0x0F ; 15 2d976: 99 f5 brne .+102 ; 0x2d9de 2d978: e1 14 cp r14, r1 2d97a: f1 04 cpc r15, r1 2d97c: 81 f1 breq .+96 ; 0x2d9de { 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) 2d97e: 4a 8d ldd r20, Y+26 ; 0x1a 2d980: 5b 8d ldd r21, Y+27 ; 0x1b 2d982: 45 2b or r20, r21 2d984: 61 f5 brne .+88 ; 0x2d9de 2d986: 2f 71 andi r18, 0x1F ; 31 2d988: 3f ef ldi r19, 0xFF ; 255 2d98a: 32 0f add r19, r18 2d98c: 34 30 cpi r19, 0x04 ; 4 2d98e: 38 f5 brcc .+78 ; 0x2d9de { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2d990: 21 50 subi r18, 0x01 ; 1 2d992: 33 0b sbc r19, r19 2d994: d2 9e mul r13, r18 2d996: c0 01 movw r24, r0 2d998: d3 9e mul r13, r19 2d99a: 90 0d add r25, r0 2d99c: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2d99e: f7 01 movw r30, r14 2d9a0: e8 0f add r30, r24 2d9a2: f9 1f adc r31, r25 2d9a4: 29 81 ldd r18, Y+1 ; 0x01 2d9a6: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2d9a8: 2b 81 ldd r18, Y+3 ; 0x03 2d9aa: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2d9ac: 2d 81 ldd r18, Y+5 ; 0x05 2d9ae: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2d9b0: 2f 81 ldd r18, Y+7 ; 0x07 2d9b2: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2d9b4: 29 85 ldd r18, Y+9 ; 0x09 2d9b6: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2d9b8: 2e 85 ldd r18, Y+14 ; 0x0e 2d9ba: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2d9bc: 28 89 ldd r18, Y+16 ; 0x10 2d9be: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2d9c0: 2a 89 ldd r18, Y+18 ; 0x12 2d9c2: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2d9c4: 2c 89 ldd r18, Y+20 ; 0x14 2d9c6: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2d9c8: 2e 89 ldd r18, Y+22 ; 0x16 2d9ca: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2d9cc: 28 8d ldd r18, Y+24 ; 0x18 2d9ce: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2d9d0: 2c 8d ldd r18, Y+28 ; 0x1c 2d9d2: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2d9d4: 2e 8d ldd r18, Y+30 ; 0x1e 2d9d6: 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) 2d9d8: 28 81 ld r18, Y 2d9da: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2d9dc: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2d9de: 2b 85 ldd r18, Y+11 ; 0x0b 2d9e0: 23 fd sbrc r18, 3 2d9e2: a7 cf rjmp .-178 ; 0x2d932 2d9e4: b5 cf rjmp .-150 ; 0x2d950 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; 2d9e6: 80 e0 ldi r24, 0x00 ; 0 2d9e8: b3 cf rjmp .-154 ; 0x2d950 0002d9ea : * \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() { 2d9ea: cf 93 push r28 2d9ec: df 93 push r29 2d9ee: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2d9f0: 8b 81 ldd r24, Y+3 ; 0x03 2d9f2: 88 23 and r24, r24 2d9f4: 49 f1 breq .+82 ; 0x2da48 if (flags_ & F_FILE_DIR_DIRTY) { 2d9f6: 89 81 ldd r24, Y+1 ; 0x01 2d9f8: 87 ff sbrs r24, 7 2d9fa: 22 c0 rjmp .+68 ; 0x2da40 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2d9fc: 61 e0 ldi r22, 0x01 ; 1 2d9fe: ce 01 movw r24, r28 2da00: 0f 94 fb a3 call 0x347f6 ; 0x347f6 2da04: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2da06: 89 2b or r24, r25 2da08: f9 f0 breq .+62 ; 0x2da48 2da0a: 80 81 ld r24, Z 2da0c: 85 3e cpi r24, 0xE5 ; 229 2da0e: e1 f0 breq .+56 ; 0x2da48 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2da10: 8b 81 ldd r24, Y+3 ; 0x03 2da12: 82 30 cpi r24, 0x02 ; 2 2da14: 40 f4 brcc .+16 ; 0x2da26 2da16: 89 89 ldd r24, Y+17 ; 0x11 2da18: 9a 89 ldd r25, Y+18 ; 0x12 2da1a: ab 89 ldd r26, Y+19 ; 0x13 2da1c: bc 89 ldd r27, Y+20 ; 0x14 2da1e: 84 8f std Z+28, r24 ; 0x1c 2da20: 95 8f std Z+29, r25 ; 0x1d 2da22: a6 8f std Z+30, r26 ; 0x1e 2da24: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2da26: 8d 89 ldd r24, Y+21 ; 0x15 2da28: 9e 89 ldd r25, Y+22 ; 0x16 2da2a: 93 8f std Z+27, r25 ; 0x1b 2da2c: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2da2e: 8d 89 ldd r24, Y+21 ; 0x15 2da30: 9e 89 ldd r25, Y+22 ; 0x16 2da32: af 89 ldd r26, Y+23 ; 0x17 2da34: b8 8d ldd r27, Y+24 ; 0x18 2da36: b5 8b std Z+21, r27 ; 0x15 2da38: 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; 2da3a: 89 81 ldd r24, Y+1 ; 0x01 2da3c: 8f 77 andi r24, 0x7F ; 127 2da3e: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2da40: df 91 pop r29 2da42: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2da44: 0d 94 19 6a jmp 0x2d432 ; 0x2d432 fail: writeError = true; 2da48: 81 e0 ldi r24, 0x01 ; 1 2da4a: 88 83 st Y, r24 return false; } 2da4c: 80 e0 ldi r24, 0x00 ; 0 2da4e: df 91 pop r29 2da50: cf 91 pop r28 2da52: 08 95 ret 0002da54 : * \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) { 2da54: 8f 92 push r8 2da56: 9f 92 push r9 2da58: af 92 push r10 2da5a: bf 92 push r11 2da5c: cf 92 push r12 2da5e: df 92 push r13 2da60: ef 92 push r14 2da62: ff 92 push r15 2da64: 0f 93 push r16 2da66: 1f 93 push r17 2da68: cf 93 push r28 2da6a: df 93 push r29 2da6c: ec 01 movw r28, r24 2da6e: 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; 2da70: 81 11 cpse r24, r1 2da72: 0e c0 rjmp .+28 ; 0x2da90 done: return true; fail: return false; 2da74: 80 e0 ldi r24, 0x00 ; 0 } 2da76: df 91 pop r29 2da78: cf 91 pop r28 2da7a: 1f 91 pop r17 2da7c: 0f 91 pop r16 2da7e: ff 90 pop r15 2da80: ef 90 pop r14 2da82: df 90 pop r13 2da84: cf 90 pop r12 2da86: bf 90 pop r11 2da88: af 90 pop r10 2da8a: 9f 90 pop r9 2da8c: 8f 90 pop r8 2da8e: 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; 2da90: 09 89 ldd r16, Y+17 ; 0x11 2da92: 1a 89 ldd r17, Y+18 ; 0x12 2da94: 2b 89 ldd r18, Y+19 ; 0x13 2da96: 3c 89 ldd r19, Y+20 ; 0x14 2da98: 04 17 cp r16, r20 2da9a: 15 07 cpc r17, r21 2da9c: 26 07 cpc r18, r22 2da9e: 37 07 cpc r19, r23 2daa0: 48 f3 brcs .-46 ; 0x2da74 2daa2: 4a 01 movw r8, r20 2daa4: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2daa6: 82 30 cpi r24, 0x02 ; 2 2daa8: 31 f4 brne .+12 ; 0x2dab6 curPosition_ = pos; 2daaa: 88 86 std Y+8, r8 ; 0x08 2daac: 99 86 std Y+9, r9 ; 0x09 2daae: aa 86 std Y+10, r10 ; 0x0a 2dab0: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2dab2: 81 e0 ldi r24, 0x01 ; 1 2dab4: e0 cf rjmp .-64 ; 0x2da76 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2dab6: 81 14 cp r8, r1 2dab8: 91 04 cpc r9, r1 2daba: a1 04 cpc r10, r1 2dabc: b1 04 cpc r11, r1 2dabe: 49 f4 brne .+18 ; 0x2dad2 // set position to start of file curCluster_ = 0; 2dac0: 1c 82 std Y+4, r1 ; 0x04 2dac2: 1d 82 std Y+5, r1 ; 0x05 2dac4: 1e 82 std Y+6, r1 ; 0x06 2dac6: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2dac8: 18 86 std Y+8, r1 ; 0x08 2daca: 19 86 std Y+9, r1 ; 0x09 2dacc: 1a 86 std Y+10, r1 ; 0x0a 2dace: 1b 86 std Y+11, r1 ; 0x0b 2dad0: f0 cf rjmp .-32 ; 0x2dab2 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2dad2: 08 85 ldd r16, Y+8 ; 0x08 2dad4: 19 85 ldd r17, Y+9 ; 0x09 2dad6: 2a 85 ldd r18, Y+10 ; 0x0a 2dad8: 3b 85 ldd r19, Y+11 ; 0x0b 2dada: e9 8d ldd r30, Y+25 ; 0x19 2dadc: fa 8d ldd r31, Y+26 ; 0x1a 2dade: 85 85 ldd r24, Z+13 ; 0x0d 2dae0: 90 e0 ldi r25, 0x00 ; 0 2dae2: 09 96 adiw r24, 0x09 ; 9 2dae4: b9 01 movw r22, r18 2dae6: a8 01 movw r20, r16 2dae8: 41 50 subi r20, 0x01 ; 1 2daea: 51 09 sbc r21, r1 2daec: 61 09 sbc r22, r1 2daee: 71 09 sbc r23, r1 2daf0: 08 2e mov r0, r24 2daf2: 04 c0 rjmp .+8 ; 0x2dafc 2daf4: 76 95 lsr r23 2daf6: 67 95 ror r22 2daf8: 57 95 ror r21 2dafa: 47 95 ror r20 2dafc: 0a 94 dec r0 2dafe: d2 f7 brpl .-12 ; 0x2daf4 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2db00: 75 01 movw r14, r10 2db02: 64 01 movw r12, r8 2db04: e1 e0 ldi r30, 0x01 ; 1 2db06: ce 1a sub r12, r30 2db08: d1 08 sbc r13, r1 2db0a: e1 08 sbc r14, r1 2db0c: f1 08 sbc r15, r1 2db0e: 04 c0 rjmp .+8 ; 0x2db18 2db10: f6 94 lsr r15 2db12: e7 94 ror r14 2db14: d7 94 ror r13 2db16: c7 94 ror r12 2db18: 8a 95 dec r24 2db1a: d2 f7 brpl .-12 ; 0x2db10 if (nNew < nCur || curPosition_ == 0) { 2db1c: c4 16 cp r12, r20 2db1e: d5 06 cpc r13, r21 2db20: e6 06 cpc r14, r22 2db22: f7 06 cpc r15, r23 2db24: 20 f0 brcs .+8 ; 0x2db2e 2db26: 01 2b or r16, r17 2db28: 02 2b or r16, r18 2db2a: 03 2b or r16, r19 2db2c: 11 f5 brne .+68 ; 0x2db72 // must follow chain from first cluster curCluster_ = firstCluster_; 2db2e: 8d 89 ldd r24, Y+21 ; 0x15 2db30: 9e 89 ldd r25, Y+22 ; 0x16 2db32: af 89 ldd r26, Y+23 ; 0x17 2db34: b8 8d ldd r27, Y+24 ; 0x18 2db36: 8c 83 std Y+4, r24 ; 0x04 2db38: 9d 83 std Y+5, r25 ; 0x05 2db3a: ae 83 std Y+6, r26 ; 0x06 2db3c: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2db3e: 8e 01 movw r16, r28 2db40: 0c 5f subi r16, 0xFC ; 252 2db42: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2db44: c1 14 cp r12, r1 2db46: d1 04 cpc r13, r1 2db48: e1 04 cpc r14, r1 2db4a: f1 04 cpc r15, r1 2db4c: 09 f4 brne .+2 ; 0x2db50 2db4e: ad cf rjmp .-166 ; 0x2daaa if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2db50: 4c 81 ldd r20, Y+4 ; 0x04 2db52: 5d 81 ldd r21, Y+5 ; 0x05 2db54: 6e 81 ldd r22, Y+6 ; 0x06 2db56: 7f 81 ldd r23, Y+7 ; 0x07 2db58: 98 01 movw r18, r16 2db5a: 89 8d ldd r24, Y+25 ; 0x19 2db5c: 9a 8d ldd r25, Y+26 ; 0x1a 2db5e: 0f 94 27 6b call 0x2d64e ; 0x2d64e 2db62: 91 e0 ldi r25, 0x01 ; 1 2db64: c9 1a sub r12, r25 2db66: d1 08 sbc r13, r1 2db68: e1 08 sbc r14, r1 2db6a: f1 08 sbc r15, r1 2db6c: 81 11 cpse r24, r1 2db6e: ea cf rjmp .-44 ; 0x2db44 2db70: 81 cf rjmp .-254 ; 0x2da74 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2db72: c4 1a sub r12, r20 2db74: d5 0a sbc r13, r21 2db76: e6 0a sbc r14, r22 2db78: f7 0a sbc r15, r23 2db7a: e1 cf rjmp .-62 ; 0x2db3e 0002db7c : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 2db7c: 80 91 85 17 lds r24, 0x1785 ; 0x801785 2db80: 88 23 and r24, r24 2db82: 61 f0 breq .+24 ; 0x2db9c 2db84: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 2db88: 88 23 and r24, r24 2db8a: 41 f0 breq .+16 ; 0x2db9c lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 2db8c: 82 e1 ldi r24, 0x12 ; 18 2db8e: 9f e3 ldi r25, 0x3F ; 63 2db90: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2db94: 0f 94 d6 34 call 0x269ac ; 0x269ac lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 2db98: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 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; 2db9c: 86 e0 ldi r24, 0x06 ; 6 2db9e: 80 93 62 0e sts 0x0E62, r24 ; 0x800e62 2dba2: fa cf rjmp .-12 ; 0x2db98 0002dba4 : 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() { 2dba4: cf 93 push r28 2dba6: df 93 push r29 if (MMU2::mmu2.Enabled()) { 2dba8: 80 91 95 13 lds r24, 0x1395 ; 0x801395 2dbac: 81 30 cpi r24, 0x01 ; 1 2dbae: f9 f4 brne .+62 ; 0x2dbee 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 2dbb0: 81 ef ldi r24, 0xF1 ; 241 2dbb2: 9f e4 ldi r25, 0x4F ; 79 2dbb4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2dbb8: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 2dbba: 84 e7 ldi r24, 0x74 ; 116 2dbbc: 9f e3 ldi r25, 0x3F ; 63 2dbbe: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2dbc2: be 01 movw r22, r28 2dbc4: 6f 5f subi r22, 0xFF ; 255 2dbc6: 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 2dbc8: 0e 94 ed d8 call 0x1b1da ; 0x1b1da if (filament < MMU_FILAMENT_COUNT) { 2dbcc: 85 30 cpi r24, 0x05 ; 5 2dbce: a0 f5 brcc .+104 ; 0x2dc38 lay1cal_filament = filament; 2dbd0: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 <_ZL16lay1cal_filament.lto_priv.453> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 2dbd4: 8a e0 ldi r24, 0x0A ; 10 2dbd6: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 menu_goto(lcd_generic_preheat_menu, 0, true); 2dbda: 20 e0 ldi r18, 0x00 ; 0 2dbdc: 41 e0 ldi r20, 0x01 ; 1 2dbde: 70 e0 ldi r23, 0x00 ; 0 2dbe0: 60 e0 ldi r22, 0x00 ; 0 2dbe2: 88 e9 ldi r24, 0x98 ; 152 2dbe4: 9b e3 ldi r25, 0x3B ; 59 } 2dbe6: df 91 pop r29 2dbe8: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 2dbea: 0d 94 b8 ce jmp 0x39d70 ; 0x39d70 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2dbee: 8f e5 ldi r24, 0x5F ; 95 2dbf0: 9f e0 ldi r25, 0x0F ; 15 2dbf2: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2dbf6: 81 11 cpse r24, r1 2dbf8: ed cf rjmp .-38 ; 0x2dbd4 { bool loaded = false; if (fsensor.isReady()) { 2dbfa: 80 91 85 17 lds r24, 0x1785 ; 0x801785 2dbfe: 82 30 cpi r24, 0x02 ; 2 2dc00: f9 f4 brne .+62 ; 0x2dc40 loaded = fsensor.getFilamentPresent(); 2dc02: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 2dc06: 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) { 2dc08: 91 11 cpse r25, r1 2dc0a: e4 cf rjmp .-56 ; 0x2dbd4 lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 2dc0c: 83 ed ldi r24, 0xD3 ; 211 2dc0e: 9f e4 ldi r25, 0x4F ; 79 2dc10: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2dc14: 0f 94 4f 34 call 0x2689e ; 0x2689e lcd_consume_click(); 2dc18: 0e 94 3e 72 call 0xe47c ; 0xe47c 2dc1c: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 2dc1e: 84 e6 ldi r24, 0x64 ; 100 2dc20: 90 e0 ldi r25, 0x00 ; 0 2dc22: 0e 94 10 8f call 0x11e20 ; 0x11e20 if (lcd_clicked()) { 2dc26: 0e 94 43 72 call 0xe486 ; 0xe486 2dc2a: 81 11 cpse r24, r1 2dc2c: 02 c0 rjmp .+4 ; 0x2dc32 2dc2e: 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 2dc30: b1 f7 brne .-20 ; 0x2dc1e delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 2dc32: 81 e0 ldi r24, 0x01 ; 1 2dc34: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 2dc38: df 91 pop r29 2dc3a: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 2dc3c: 0d 94 56 d1 jmp 0x3a2ac ; 0x3a2ac { 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); 2dc40: 87 ef ldi r24, 0xF7 ; 247 2dc42: 94 e5 ldi r25, 0x54 ; 84 2dc44: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2dc48: 41 e0 ldi r20, 0x01 ; 1 2dc4a: 60 e0 ldi r22, 0x00 ; 0 2dc4c: 0f 94 67 64 call 0x2c8ce ; 0x2c8ce 2dc50: 91 e0 ldi r25, 0x01 ; 1 2dc52: 81 11 cpse r24, r1 2dc54: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 2dc56: 81 e0 ldi r24, 0x01 ; 1 2dc58: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 2dc5c: d5 cf rjmp .-86 ; 0x2dc08 0002dc5e : 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()") { 2dc5e: cf 93 push r28 2dc60: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 { //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); 2dc64: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 2dc66: 4c e0 ldi r20, 0x0C ; 12 2dc68: 51 e7 ldi r21, 0x71 ; 113 2dc6a: 60 e0 ldi r22, 0x00 ; 0 2dc6c: 80 e0 ldi r24, 0x00 ; 0 2dc6e: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(LCD_WIDTH - 14, 0); 2dc72: 60 e0 ldi r22, 0x00 ; 0 2dc74: 86 e0 ldi r24, 0x06 ; 6 2dc76: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print_state(pinda_state); 2dc7a: c4 fb bst r28, 4 2dc7c: 88 27 eor r24, r24 2dc7e: 80 f9 bld r24, 0 2dc80: 0f 94 0b 26 call 0x24c16 ; 0x24c16 if (MMU2::mmu2.Enabled()) { 2dc84: 80 91 95 13 lds r24, 0x1395 ; 0x801395 2dc88: 81 30 cpi r24, 0x01 ; 1 2dc8a: 99 f4 brne .+38 ; 0x2dcb2 inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 2dc8c: c1 e0 ldi r28, 0x01 ; 1 2dc8e: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 2dc92: 81 11 cpse r24, r1 2dc94: 01 c0 rjmp .+2 ; 0x2dc98 2dc96: 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 2dc98: 46 e0 ldi r20, 0x06 ; 6 2dc9a: 51 e7 ldi r21, 0x71 ; 113 2dc9c: 60 e0 ldi r22, 0x00 ; 0 2dc9e: 8a e0 ldi r24, 0x0A ; 10 2dca0: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(LCD_WIDTH - 3, 0); 2dca4: 60 e0 ldi r22, 0x00 ; 0 2dca6: 81 e1 ldi r24, 0x11 ; 17 2dca8: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print_state(finda_state); 2dcac: 8c 2f mov r24, r28 2dcae: 0f 94 0b 26 call 0x24c16 ; 0x24c16 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 2dcb2: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 2dcb6: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 2dcb8: 8d e0 ldi r24, 0x0D ; 13 2dcba: 9d e3 ldi r25, 0x3D ; 61 2dcbc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2dcc0: ac 01 movw r20, r24 2dcc2: 61 e0 ldi r22, 0x01 ; 1 2dcc4: 80 e0 ldi r24, 0x00 ; 0 2dcc6: 0e 94 3a 70 call 0xe074 ; 0xe074 lcd_set_cursor(LCD_WIDTH - 3, 1); 2dcca: 61 e0 ldi r22, 0x01 ; 1 2dccc: 81 e1 ldi r24, 0x11 ; 17 2dcce: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print_state(idler_state); 2dcd2: 8c 2f mov r24, r28 2dcd4: 0f 94 0b 26 call 0x24c16 ; 0x24c16 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(); } 2dcd8: 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(); 2dcda: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 0002dcde : 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){ 2dcde: 2f 92 push r2 2dce0: 3f 92 push r3 2dce2: 4f 92 push r4 2dce4: 5f 92 push r5 2dce6: 6f 92 push r6 2dce8: 7f 92 push r7 2dcea: 8f 92 push r8 2dcec: 9f 92 push r9 2dcee: af 92 push r10 2dcf0: bf 92 push r11 2dcf2: cf 92 push r12 2dcf4: df 92 push r13 2dcf6: ef 92 push r14 2dcf8: ff 92 push r15 2dcfa: 0f 93 push r16 2dcfc: 1f 93 push r17 2dcfe: cf 93 push r28 2dd00: df 93 push r29 2dd02: 00 d0 rcall .+0 ; 0x2dd04 2dd04: 1f 92 push r1 2dd06: 1f 92 push r1 2dd08: cd b7 in r28, 0x3d ; 61 2dd0a: de b7 in r29, 0x3e ; 62 2dd0c: 1c 01 movw r2, r24 2dd0e: 2a 01 movw r4, r20 2dd10: 3b 01 movw r6, r22 2dd12: 00 e2 ldi r16, 0x20 ; 32 2dd14: 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){ 2dd16: 19 82 std Y+1, r1 ; 0x01 2dd18: 99 81 ldd r25, Y+1 ; 0x01 2dd1a: 89 2f mov r24, r25 2dd1c: 90 e0 ldi r25, 0x00 ; 0 2dd1e: 9b 83 std Y+3, r25 ; 0x03 2dd20: 8a 83 std Y+2, r24 ; 0x02 2dd22: 80 17 cp r24, r16 2dd24: 91 07 cpc r25, r17 2dd26: 9c f5 brge .+102 ; 0x2dd8e if (points[j] > points[j + 1]) 2dd28: 88 0f add r24, r24 2dd2a: 99 1f adc r25, r25 2dd2c: 88 0f add r24, r24 2dd2e: 99 1f adc r25, r25 2dd30: 9d 83 std Y+5, r25 ; 0x05 2dd32: 8c 83 std Y+4, r24 ; 0x04 2dd34: 82 0d add r24, r2 2dd36: 93 1d adc r25, r3 2dd38: 9b 83 std Y+3, r25 ; 0x03 2dd3a: 8a 83 std Y+2, r24 ; 0x02 2dd3c: fc 01 movw r30, r24 2dd3e: c0 80 ld r12, Z 2dd40: d1 80 ldd r13, Z+1 ; 0x01 2dd42: e2 80 ldd r14, Z+2 ; 0x02 2dd44: f3 80 ldd r15, Z+3 ; 0x03 2dd46: 8c 81 ldd r24, Y+4 ; 0x04 2dd48: 9d 81 ldd r25, Y+5 ; 0x05 2dd4a: 04 96 adiw r24, 0x04 ; 4 2dd4c: 82 0d add r24, r2 2dd4e: 93 1d adc r25, r3 2dd50: 9d 83 std Y+5, r25 ; 0x05 2dd52: 8c 83 std Y+4, r24 ; 0x04 2dd54: fc 01 movw r30, r24 2dd56: 80 80 ld r8, Z 2dd58: 91 80 ldd r9, Z+1 ; 0x01 2dd5a: a2 80 ldd r10, Z+2 ; 0x02 2dd5c: b3 80 ldd r11, Z+3 ; 0x03 2dd5e: a5 01 movw r20, r10 2dd60: 94 01 movw r18, r8 2dd62: c7 01 movw r24, r14 2dd64: b6 01 movw r22, r12 2dd66: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 2dd6a: 18 16 cp r1, r24 2dd6c: 64 f4 brge .+24 ; 0x2dd86 SWAP(points[j], points[j + 1]); 2dd6e: ea 81 ldd r30, Y+2 ; 0x02 2dd70: fb 81 ldd r31, Y+3 ; 0x03 2dd72: 80 82 st Z, r8 2dd74: 91 82 std Z+1, r9 ; 0x01 2dd76: a2 82 std Z+2, r10 ; 0x02 2dd78: b3 82 std Z+3, r11 ; 0x03 2dd7a: ec 81 ldd r30, Y+4 ; 0x04 2dd7c: fd 81 ldd r31, Y+5 ; 0x05 2dd7e: c0 82 st Z, r12 2dd80: d1 82 std Z+1, r13 ; 0x01 2dd82: e2 82 std Z+2, r14 ; 0x02 2dd84: 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){ 2dd86: f9 81 ldd r31, Y+1 ; 0x01 2dd88: ff 5f subi r31, 0xFF ; 255 2dd8a: f9 83 std Y+1, r31 ; 0x01 2dd8c: c5 cf rjmp .-118 ; 0x2dd18 2dd8e: 01 50 subi r16, 0x01 ; 1 2dd90: 11 09 sbc r17, r1 2dd92: 08 f6 brcc .-126 ; 0x2dd16 /// 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]; 2dd94: f1 01 movw r30, r2 2dd96: e0 5c subi r30, 0xC0 ; 192 2dd98: 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); 2dd9a: 20 81 ld r18, Z 2dd9c: 31 81 ldd r19, Z+1 ; 0x01 2dd9e: 42 81 ldd r20, Z+2 ; 0x02 2dda0: 53 81 ldd r21, Z+3 ; 0x03 2dda2: c3 01 movw r24, r6 2dda4: b2 01 movw r22, r4 2dda6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 2ddaa: 6b 01 movw r12, r22 2ddac: 7c 01 movw r14, r24 2ddae: 20 e0 ldi r18, 0x00 ; 0 2ddb0: 30 e0 ldi r19, 0x00 ; 0 2ddb2: 40 e0 ldi r20, 0x00 ; 0 2ddb4: 5f eb ldi r21, 0xBF ; 191 2ddb6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2ddba: 87 fd sbrc r24, 7 2ddbc: 10 c0 rjmp .+32 ; 0x2ddde 2ddbe: 20 e0 ldi r18, 0x00 ; 0 2ddc0: 30 e0 ldi r19, 0x00 ; 0 2ddc2: 40 e0 ldi r20, 0x00 ; 0 2ddc4: 5f e3 ldi r21, 0x3F ; 63 2ddc6: c7 01 movw r24, r14 2ddc8: b6 01 movw r22, r12 2ddca: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 2ddce: 18 16 cp r1, r24 2ddd0: 5c f4 brge .+22 ; 0x2dde8 2ddd2: c1 2c mov r12, r1 2ddd4: d1 2c mov r13, r1 2ddd6: e1 2c mov r14, r1 2ddd8: 8f e3 ldi r24, 0x3F ; 63 2ddda: f8 2e mov r15, r24 2dddc: 05 c0 rjmp .+10 ; 0x2dde8 2ddde: c1 2c mov r12, r1 2dde0: d1 2c mov r13, r1 2dde2: e1 2c mov r14, r1 2dde4: 9f eb ldi r25, 0xBF ; 191 2dde6: f9 2e mov r15, r25 } 2dde8: c7 01 movw r24, r14 2ddea: b6 01 movw r22, r12 2ddec: 0f 90 pop r0 2ddee: 0f 90 pop r0 2ddf0: 0f 90 pop r0 2ddf2: 0f 90 pop r0 2ddf4: 0f 90 pop r0 2ddf6: df 91 pop r29 2ddf8: cf 91 pop r28 2ddfa: 1f 91 pop r17 2ddfc: 0f 91 pop r16 2ddfe: ff 90 pop r15 2de00: ef 90 pop r14 2de02: df 90 pop r13 2de04: cf 90 pop r12 2de06: bf 90 pop r11 2de08: af 90 pop r10 2de0a: 9f 90 pop r9 2de0c: 8f 90 pop r8 2de0e: 7f 90 pop r7 2de10: 6f 90 pop r6 2de12: 5f 90 pop r5 2de14: 4f 90 pop r4 2de16: 3f 90 pop r3 2de18: 2f 90 pop r2 2de1a: 08 95 ret 0002de1c : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2de1c: 0f 94 55 3e call 0x27caa ; 0x27caa 2de20: 60 93 35 13 sts 0x1335, r22 ; 0x801335 2de24: 70 93 36 13 sts 0x1336, r23 ; 0x801336 2de28: 80 93 37 13 sts 0x1337, r24 ; 0x801337 2de2c: 90 93 38 13 sts 0x1338, r25 ; 0x801338 } 2de30: 08 95 ret 0002de32 : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2de32: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 2de36: 88 23 and r24, r24 2de38: 69 f0 breq .+26 ; 0x2de54 2de3a: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 2de3e: 88 23 and r24, r24 2de40: 49 f0 breq .+18 ; 0x2de54 SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2de42: 8b e9 ldi r24, 0x9B ; 155 2de44: 9a ea ldi r25, 0xAA ; 170 2de46: 0e 94 97 7b call 0xf72e ; 0xf72e retryAttempts--; 2de4a: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 2de4e: 81 50 subi r24, 0x01 ; 1 2de50: 80 93 7a 13 sts 0x137A, r24 ; 0x80137a } } 2de54: 08 95 ret 0002de56 : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2de56: 9f 92 push r9 2de58: af 92 push r10 2de5a: bf 92 push r11 2de5c: cf 92 push r12 2de5e: df 92 push r13 2de60: ef 92 push r14 2de62: ff 92 push r15 2de64: 0f 93 push r16 2de66: 1f 93 push r17 2de68: cf 93 push r28 2de6a: df 93 push r29 2de6c: cd b7 in r28, 0x3d ; 61 2de6e: de b7 in r29, 0x3e ; 62 2de70: e0 97 sbiw r28, 0x30 ; 48 2de72: 0f b6 in r0, 0x3f ; 63 2de74: f8 94 cli 2de76: de bf out 0x3e, r29 ; 62 2de78: 0f be out 0x3f, r0 ; 63 2de7a: cd bf out 0x3d, r28 ; 61 2de7c: 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()]; 2de7e: e0 90 63 13 lds r14, 0x1363 ; 0x801363 2de82: fe 01 movw r30, r28 2de84: 31 96 adiw r30, 0x01 ; 1 2de86: 21 e0 ldi r18, 0x01 ; 1 2de88: 30 e0 ldi r19, 0x00 ; 0 2de8a: 5f 01 movw r10, r30 2de8c: f1 2c mov r15, r1 2de8e: 40 e1 ldi r20, 0x10 ; 16 2de90: c4 2e mov r12, r20 2de92: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2de94: 50 e2 ldi r21, 0x20 ; 32 2de96: 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()]; 2de98: c7 01 movw r24, r14 2de9a: 82 1b sub r24, r18 2de9c: 93 0b sbc r25, r19 2de9e: b6 01 movw r22, r12 2dea0: 0f 94 ec dd call 0x3bbd8 ; 0x3bbd8 <__divmodhi4> 2dea4: dc 01 movw r26, r24 2dea6: bb 27 eor r27, r27 2dea8: aa 5d subi r26, 0xDA ; 218 2deaa: bc 4e sbci r27, 0xEC ; 236 2deac: 9d 96 adiw r26, 0x2d ; 45 2deae: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2deb0: 48 2f mov r20, r24 2deb2: 50 e0 ldi r21, 0x00 ; 0 2deb4: 94 e0 ldi r25, 0x04 ; 4 2deb6: 55 95 asr r21 2deb8: 47 95 ror r20 2deba: 9a 95 dec r25 2debc: e1 f7 brne .-8 ; 0x2deb6 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2debe: 96 ef ldi r25, 0xF6 ; 246 2dec0: 94 0f add r25, r20 2dec2: 96 30 cpi r25, 0x06 ; 6 2dec4: a8 f1 brcs .+106 ; 0x2df30 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2dec6: 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); 2dec8: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2deca: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2decc: 96 ef ldi r25, 0xF6 ; 246 2dece: 98 0f add r25, r24 2ded0: 96 30 cpi r25, 0x06 ; 6 2ded2: 80 f1 brcs .+96 ; 0x2df34 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2ded4: 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); 2ded6: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2ded8: 92 82 std Z+2, r9 ; 0x02 2deda: 2f 5f subi r18, 0xFF ; 255 2dedc: 3f 4f sbci r19, 0xFF ; 255 2dede: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2dee0: 21 31 cpi r18, 0x11 ; 17 2dee2: 31 05 cpc r19, r1 2dee4: c9 f6 brne .-78 ; 0x2de98 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 2dee6: 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); 2dee8: 84 e1 ldi r24, 0x14 ; 20 2deea: 9b ea ldi r25, 0xAB ; 171 2deec: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2def0: 8e e0 ldi r24, 0x0E ; 14 2def2: 9b ea ldi r25, 0xAB ; 171 2def4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2def8: c8 01 movw r24, r16 2defa: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOPGM(", last bytes: "); 2defe: 86 ec ldi r24, 0xC6 ; 198 2df00: 9a ea ldi r25, 0xAA ; 170 2df02: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(lrb); 2df06: c5 01 movw r24, r10 2df08: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 } 2df0c: e0 96 adiw r28, 0x30 ; 48 2df0e: 0f b6 in r0, 0x3f ; 63 2df10: f8 94 cli 2df12: de bf out 0x3e, r29 ; 62 2df14: 0f be out 0x3f, r0 ; 63 2df16: cd bf out 0x3d, r28 ; 61 2df18: df 91 pop r29 2df1a: cf 91 pop r28 2df1c: 1f 91 pop r17 2df1e: 0f 91 pop r16 2df20: ff 90 pop r15 2df22: ef 90 pop r14 2df24: df 90 pop r13 2df26: cf 90 pop r12 2df28: bf 90 pop r11 2df2a: af 90 pop r10 2df2c: 9f 90 pop r9 2df2e: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2df30: 49 5a subi r20, 0xA9 ; 169 2df32: ca cf rjmp .-108 ; 0x2dec8 2df34: 89 5a subi r24, 0xA9 ; 169 2df36: cf cf rjmp .-98 ; 0x2ded6 0002df38 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2df38: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2df3a: 90 91 3a 13 lds r25, 0x133A ; 0x80133a 2df3e: 9a 30 cpi r25, 0x0A ; 10 2df40: 11 f4 brne .+4 ; 0x2df46 cause = ss; 2df42: 60 93 39 13 sts 0x1339, r22 ; 0x801339 } --occurrences; 2df46: 91 50 subi r25, 0x01 ; 1 2df48: 90 93 3a 13 sts 0x133A, r25 ; 0x80133a FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2df4c: 91 11 cpse r25, r1 2df4e: 0d c0 rjmp .+26 ; 0x2df6a 2df50: c9 01 movw r24, r18 LogError(msg_P); 2df52: 0f 94 2b 6f call 0x2de56 ; 0x2de56 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2df56: 87 eb ldi r24, 0xB7 ; 183 2df58: 9a ea ldi r25, 0xAA ; 170 2df5a: 0e 94 97 7b call 0xf72e ; 0xf72e /// @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; } 2df5e: 8a e0 ldi r24, 0x0A ; 10 2df60: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a 2df64: 80 91 39 13 lds r24, 0x1339 ; 0x801339 2df68: 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 2df6a: 80 e0 ldi r24, 0x00 ; 0 } } 2df6c: 08 95 ret 0002df6e : } *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) { 2df6e: cf 93 push r28 2df70: df 93 push r29 2df72: cd b7 in r28, 0x3d ; 61 2df74: de b7 in r29, 0x3e ; 62 2df76: 2e 97 sbiw r28, 0x0e ; 14 2df78: 0f b6 in r0, 0x3f ; 63 2df7a: f8 94 cli 2df7c: de bf out 0x3e, r29 ; 62 2df7e: 0f be out 0x3f, r0 ; 63 2df80: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2df82: 2e e3 ldi r18, 0x3E ; 62 2df84: 30 e0 ldi r19, 0x00 ; 0 2df86: 3a 83 std Y+2, r19 ; 0x02 2df88: 29 83 std Y+1, r18 ; 0x01 2df8a: fe 01 movw r30, r28 2df8c: 33 96 adiw r30, 0x03 ; 3 2df8e: 2c e0 ldi r18, 0x0C ; 12 2df90: df 01 movw r26, r30 2df92: 1d 92 st X+, r1 2df94: 2a 95 dec r18 2df96: e9 f7 brne .-6 ; 0x2df92 2df98: de 01 movw r26, r28 2df9a: 12 96 adiw r26, 0x02 ; 2 2df9c: 48 2f mov r20, r24 2df9e: fc 01 movw r30, r24 2dfa0: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2dfa2: 8e 2f mov r24, r30 2dfa4: 84 1b sub r24, r20 2dfa6: 86 17 cp r24, r22 2dfa8: 40 f4 brcc .+16 ; 0x2dfba uint8_t b = txbuff[i]; 2dfaa: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2dfac: 90 ee ldi r25, 0xE0 ; 224 2dfae: 98 0f add r25, r24 2dfb0: 90 36 cpi r25, 0x60 ; 96 2dfb2: 08 f0 brcs .+2 ; 0x2dfb6 b = '.'; 2dfb4: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2dfb6: 8d 93 st X+, r24 2dfb8: f4 cf rjmp .-24 ; 0x2dfa2 } tmp[size + 1] = 0; 2dfba: f9 01 movw r30, r18 2dfbc: e6 0f add r30, r22 2dfbe: f1 1d adc r31, r1 2dfc0: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2dfc2: 4e e0 ldi r20, 0x0E ; 14 2dfc4: 50 e0 ldi r21, 0x00 ; 0 2dfc6: 6a e1 ldi r22, 0x1A ; 26 2dfc8: 7b ea ldi r23, 0xAB ; 171 2dfca: ce 01 movw r24, r28 2dfcc: 01 96 adiw r24, 0x01 ; 1 2dfce: 0f 94 ee da call 0x3b5dc ; 0x3b5dc 2dfd2: 89 2b or r24, r25 2dfd4: 59 f4 brne .+22 ; 0x2dfec 2dfd6: 4e e0 ldi r20, 0x0E ; 14 2dfd8: 50 e0 ldi r21, 0x00 ; 0 2dfda: be 01 movw r22, r28 2dfdc: 6f 5f subi r22, 0xFF ; 255 2dfde: 7f 4f sbci r23, 0xFF ; 255 2dfe0: 8d e7 ldi r24, 0x7D ; 125 2dfe2: 92 e1 ldi r25, 0x12 ; 18 2dfe4: 0f 94 81 e3 call 0x3c702 ; 0x3c702 2dfe8: 89 2b or r24, r25 2dfea: 61 f0 breq .+24 ; 0x2e004 // 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); 2dfec: 84 e1 ldi r24, 0x14 ; 20 2dfee: 9b ea ldi r25, 0xAB ; 171 2dff0: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2dff4: 8e e0 ldi r24, 0x0E ; 14 2dff6: 9b ea ldi r25, 0xAB ; 171 2dff8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2dffc: ce 01 movw r24, r28 2dffe: 01 96 adiw r24, 0x01 ; 1 2e000: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 } strncpy(lastMsg, tmp, rqs); 2e004: 4e e0 ldi r20, 0x0E ; 14 2e006: 50 e0 ldi r21, 0x00 ; 0 2e008: be 01 movw r22, r28 2e00a: 6f 5f subi r22, 0xFF ; 255 2e00c: 7f 4f sbci r23, 0xFF ; 255 2e00e: 8d e7 ldi r24, 0x7D ; 125 2e010: 92 e1 ldi r25, 0x12 ; 18 2e012: 0f 94 8f e3 call 0x3c71e ; 0x3c71e } 2e016: 2e 96 adiw r28, 0x0e ; 14 2e018: 0f b6 in r0, 0x3f ; 63 2e01a: f8 94 cli 2e01c: de bf out 0x3e, r29 ; 62 2e01e: 0f be out 0x3f, r0 ; 63 2e020: cd bf out 0x3d, r28 ; 61 2e022: df 91 pop r29 2e024: cf 91 pop r28 2e026: 08 95 ret 0002e028 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2e028: cf 92 push r12 2e02a: df 92 push r13 2e02c: ef 92 push r14 2e02e: ff 92 push r15 2e030: 1f 93 push r17 2e032: cf 93 push r28 2e034: df 93 push r29 2e036: cd b7 in r28, 0x3d ; 61 2e038: de b7 in r29, 0x3e ; 62 2e03a: 62 97 sbiw r28, 0x12 ; 18 2e03c: 0f b6 in r0, 0x3f ; 63 2e03e: f8 94 cli 2e040: de bf out 0x3e, r29 ; 62 2e042: 0f be out 0x3f, r0 ; 63 2e044: cd bf out 0x3d, r28 ; 61 2e046: 4e 87 std Y+14, r20 ; 0x0e 2e048: 5f 87 std Y+15, r21 ; 0x0f 2e04a: 68 8b std Y+16, r22 ; 0x10 2e04c: 79 8b std Y+17, r23 ; 0x11 2e04e: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2e050: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2e052: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e054: 51 11 cpse r21, r1 2e056: 31 c0 rjmp .+98 ; 0x2e0ba *dst = '0'; 2e058: 80 e3 ldi r24, 0x30 ; 48 2e05a: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e05c: 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); 2e05e: e1 e0 ldi r30, 0x01 ; 1 2e060: e1 0f add r30, r17 2e062: 81 e0 ldi r24, 0x01 ; 1 2e064: 90 e0 ldi r25, 0x00 ; 0 2e066: 8c 0f add r24, r28 2e068: 9d 1f adc r25, r29 2e06a: 8e 0f add r24, r30 2e06c: 91 1d adc r25, r1 2e06e: fc 01 movw r30, r24 2e070: 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 2e072: 9a e2 ldi r25, 0x2A ; 42 2e074: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e076: 81 11 cpse r24, r1 2e078: 27 c0 rjmp .+78 ; 0x2e0c8 *dst = '0'; 2e07a: 80 e3 ldi r24, 0x30 ; 48 2e07c: 81 83 std Z+1, r24 ; 0x01 return 1; 2e07e: 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); 2e080: 1e 5f subi r17, 0xFE ; 254 2e082: 18 0f add r17, r24 txbuff[i] = '\n'; 2e084: e1 e0 ldi r30, 0x01 ; 1 2e086: f0 e0 ldi r31, 0x00 ; 0 2e088: ec 0f add r30, r28 2e08a: fd 1f adc r31, r29 2e08c: e1 0f add r30, r17 2e08e: f1 1d adc r31, r1 2e090: 8a e0 ldi r24, 0x0A ; 10 2e092: 80 83 st Z, r24 ++i; 2e094: 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); 2e096: fe 01 movw r30, r28 2e098: 31 96 adiw r30, 0x01 ; 1 2e09a: 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--){ 2e09c: 6f 01 movw r12, r30 2e09e: c1 0e add r12, r17 2e0a0: d1 1c adc r13, r1 2e0a2: ec 14 cp r14, r12 2e0a4: fd 04 cpc r15, r13 2e0a6: b1 f0 breq .+44 ; 0x2e0d4 fputc(*buffer, uart2io); 2e0a8: f7 01 movw r30, r14 2e0aa: 81 91 ld r24, Z+ 2e0ac: 7f 01 movw r14, r30 2e0ae: 6f e6 ldi r22, 0x6F ; 111 2e0b0: 72 e1 ldi r23, 0x12 ; 18 2e0b2: 90 e0 ldi r25, 0x00 ; 0 2e0b4: 0f 94 77 db call 0x3b6ee ; 0x3b6ee 2e0b8: f4 cf rjmp .-24 ; 0x2e0a2 2e0ba: be 01 movw r22, r28 2e0bc: 6e 5f subi r22, 0xFE ; 254 2e0be: 7f 4f sbci r23, 0xFF ; 255 2e0c0: 0f 94 3a c2 call 0x38474 ; 0x38474 2e0c4: 18 2f mov r17, r24 2e0c6: cb cf rjmp .-106 ; 0x2e05e 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); 2e0c8: bf 01 movw r22, r30 2e0ca: 6f 5f subi r22, 0xFF ; 255 2e0cc: 7f 4f sbci r23, 0xFF ; 255 2e0ce: 0f 94 3a c2 call 0x38474 ; 0x38474 2e0d2: d6 cf rjmp .-84 ; 0x2e080 LogRequestMsg(txbuff, len); 2e0d4: 61 2f mov r22, r17 2e0d6: ce 01 movw r24, r28 2e0d8: 01 96 adiw r24, 0x01 ; 1 2e0da: 0f 94 b7 6f call 0x2df6e ; 0x2df6e RecordUARTActivity(); 2e0de: 0f 94 0e 6f call 0x2de1c ; 0x2de1c } 2e0e2: 62 96 adiw r28, 0x12 ; 18 2e0e4: 0f b6 in r0, 0x3f ; 63 2e0e6: f8 94 cli 2e0e8: de bf out 0x3e, r29 ; 62 2e0ea: 0f be out 0x3f, r0 ; 63 2e0ec: cd bf out 0x3d, r28 ; 61 2e0ee: df 91 pop r29 2e0f0: cf 91 pop r28 2e0f2: 1f 91 pop r17 2e0f4: ff 90 pop r15 2e0f6: ef 90 pop r14 2e0f8: df 90 pop r13 2e0fa: cf 90 pop r12 2e0fc: 08 95 ret 0002e0fe : 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) { 2e0fe: 8f 92 push r8 2e100: 9f 92 push r9 2e102: af 92 push r10 2e104: bf 92 push r11 2e106: df 92 push r13 2e108: ef 92 push r14 2e10a: ff 92 push r15 2e10c: 0f 93 push r16 2e10e: 1f 93 push r17 2e110: cf 93 push r28 2e112: df 93 push r29 2e114: cd b7 in r28, 0x3d ; 61 2e116: de b7 in r29, 0x3e ; 62 2e118: 67 97 sbiw r28, 0x17 ; 23 2e11a: 0f b6 in r0, 0x3f ; 63 2e11c: f8 94 cli 2e11e: de bf out 0x3e, r29 ; 62 2e120: 0f be out 0x3f, r0 ; 63 2e122: cd bf out 0x3d, r28 ; 61 2e124: 18 2f mov r17, r24 2e126: 7b 01 movw r14, r22 2e128: d4 2e mov r13, r20 2e12a: 07 e5 ldi r16, 0x57 ; 87 2e12c: 0b 8b std Y+19, r16 ; 0x13 2e12e: 8c 8b std Y+20, r24 ; 0x14 2e130: 7e 8b std Y+22, r23 ; 0x16 2e132: 6d 8b std Y+21, r22 ; 0x15 2e134: ce 01 movw r24, r28 2e136: 43 96 adiw r24, 0x13 ; 19 2e138: 0f 94 66 c2 call 0x384cc ; 0x384cc 2e13c: 8f 8b std Y+23, r24 ; 0x17 2e13e: 0e 87 std Y+14, r16 ; 0x0e 2e140: 1f 87 std Y+15, r17 ; 0x0f 2e142: f9 8a std Y+17, r15 ; 0x11 2e144: e8 8a std Y+16, r14 ; 0x10 2e146: ce 01 movw r24, r28 2e148: 0e 96 adiw r24, 0x0e ; 14 2e14a: 0f 94 66 c2 call 0x384cc ; 0x384cc 2e14e: 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; 2e150: 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) { 2e152: 11 11 cpse r17, r1 2e154: 27 c0 rjmp .+78 ; 0x2e1a4 *dst = '0'; 2e156: 80 e3 ldi r24, 0x30 ; 48 2e158: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e15a: 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); 2e15c: e1 e0 ldi r30, 0x01 ; 1 2e15e: e8 0f add r30, r24 dst[i] = ' '; 2e160: 21 e0 ldi r18, 0x01 ; 1 2e162: 30 e0 ldi r19, 0x00 ; 0 2e164: 2c 0f add r18, r28 2e166: 3d 1f adc r19, r29 2e168: 2e 0f add r18, r30 2e16a: 31 1d adc r19, r1 2e16c: f9 01 movw r30, r18 2e16e: 90 e2 ldi r25, 0x20 ; 32 2e170: 90 83 st Z, r25 return i + 1; 2e172: 02 e0 ldi r16, 0x02 ; 2 2e174: 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); 2e176: aa 24 eor r10, r10 2e178: a3 94 inc r10 2e17a: b1 2c mov r11, r1 2e17c: ac 0e add r10, r28 2e17e: bd 1e adc r11, r29 2e180: a0 0e add r10, r16 2e182: 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) { 2e184: e1 14 cp r14, r1 2e186: f1 04 cpc r15, r1 2e188: 39 f1 breq .+78 ; 0x2e1d8 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2e18a: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2e18c: c7 01 movw r24, r14 2e18e: 88 27 eor r24, r24 2e190: 90 7f andi r25, 0xF0 ; 240 2e192: 89 2b or r24, r25 2e194: 71 f4 brne .+28 ; 0x2e1b2 value <<= 4U; 2e196: 24 e0 ldi r18, 0x04 ; 4 2e198: ee 0c add r14, r14 2e19a: ff 1c adc r15, r15 2e19c: 2a 95 dec r18 2e19e: e1 f7 brne .-8 ; 0x2e198 --charsOut; 2e1a0: 11 50 subi r17, 0x01 ; 1 2e1a2: f4 cf rjmp .-24 ; 0x2e18c 2e1a4: be 01 movw r22, r28 2e1a6: 6e 5f subi r22, 0xFE ; 254 2e1a8: 7f 4f sbci r23, 0xFF ; 255 2e1aa: 81 2f mov r24, r17 2e1ac: 0f 94 3a c2 call 0x38474 ; 0x38474 2e1b0: d5 cf rjmp .-86 ; 0x2e15c *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2e1b2: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2e1b4: 88 2d mov r24, r8 2e1b6: 8a 19 sub r24, r10 2e1b8: 81 17 cp r24, r17 2e1ba: 90 f4 brcc .+36 ; 0x2e1e0 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2e1bc: 8f 2d mov r24, r15 2e1be: 82 95 swap r24 2e1c0: 8f 70 andi r24, 0x0F ; 15 2e1c2: 94 e0 ldi r25, 0x04 ; 4 2e1c4: ee 0c add r14, r14 2e1c6: ff 1c adc r15, r15 2e1c8: 9a 95 dec r25 2e1ca: e1 f7 brne .-8 ; 0x2e1c4 2e1cc: 0f 94 30 c2 call 0x38460 ; 0x38460 2e1d0: f4 01 movw r30, r8 2e1d2: 81 93 st Z+, r24 2e1d4: 4f 01 movw r8, r30 2e1d6: ee cf rjmp .-36 ; 0x2e1b4 } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2e1d8: 80 e3 ldi r24, 0x30 ; 48 2e1da: f5 01 movw r30, r10 2e1dc: 80 83 st Z, r24 return 1; 2e1de: 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); 2e1e0: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2e1e2: e1 e0 ldi r30, 0x01 ; 1 2e1e4: f0 e0 ldi r31, 0x00 ; 0 2e1e6: ec 0f add r30, r28 2e1e8: fd 1f adc r31, r29 2e1ea: e1 0f add r30, r17 2e1ec: f1 1d adc r31, r1 2e1ee: 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 2e1f0: 9a e2 ldi r25, 0x2A ; 42 2e1f2: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e1f4: 81 11 cpse r24, r1 2e1f6: 21 c0 rjmp .+66 ; 0x2e23a *dst = '0'; 2e1f8: 80 e3 ldi r24, 0x30 ; 48 2e1fa: 81 83 std Z+1, r24 ; 0x01 return 1; 2e1fc: 81 e0 ldi r24, 0x01 ; 1 2e1fe: 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); 2e200: 18 0f add r17, r24 txbuff[i] = '\n'; 2e202: e1 e0 ldi r30, 0x01 ; 1 2e204: f0 e0 ldi r31, 0x00 ; 0 2e206: ec 0f add r30, r28 2e208: fd 1f adc r31, r29 2e20a: e1 0f add r30, r17 2e20c: f1 1d adc r31, r1 2e20e: 8a e0 ldi r24, 0x0A ; 10 2e210: 80 83 st Z, r24 ++i; 2e212: 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); 2e214: 9e 01 movw r18, r28 2e216: 2f 5f subi r18, 0xFF ; 255 2e218: 3f 4f sbci r19, 0xFF ; 255 2e21a: 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--){ 2e21c: 59 01 movw r10, r18 2e21e: a1 0e add r10, r17 2e220: b1 1c adc r11, r1 2e222: ea 14 cp r14, r10 2e224: fb 04 cpc r15, r11 2e226: 79 f0 breq .+30 ; 0x2e246 fputc(*buffer, uart2io); 2e228: f7 01 movw r30, r14 2e22a: 81 91 ld r24, Z+ 2e22c: 7f 01 movw r14, r30 2e22e: 6f e6 ldi r22, 0x6F ; 111 2e230: 72 e1 ldi r23, 0x12 ; 18 2e232: 90 e0 ldi r25, 0x00 ; 0 2e234: 0f 94 77 db call 0x3b6ee ; 0x3b6ee 2e238: f4 cf rjmp .-24 ; 0x2e222 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); 2e23a: bf 01 movw r22, r30 2e23c: 6f 5f subi r22, 0xFF ; 255 2e23e: 7f 4f sbci r23, 0xFF ; 255 2e240: 0f 94 3a c2 call 0x38474 ; 0x38474 2e244: dc cf rjmp .-72 ; 0x2e1fe LogRequestMsg(txbuff, len); 2e246: 61 2f mov r22, r17 2e248: ce 01 movw r24, r28 2e24a: 01 96 adiw r24, 0x01 ; 1 2e24c: 0f 94 b7 6f call 0x2df6e ; 0x2df6e RecordUARTActivity(); 2e250: 0f 94 0e 6f call 0x2de1c ; 0x2de1c scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2e254: d0 92 29 13 sts 0x1329, r13 ; 0x801329 } 2e258: 67 96 adiw r28, 0x17 ; 23 2e25a: 0f b6 in r0, 0x3f ; 63 2e25c: f8 94 cli 2e25e: de bf out 0x3e, r29 ; 62 2e260: 0f be out 0x3f, r0 ; 63 2e262: cd bf out 0x3d, r28 ; 61 2e264: df 91 pop r29 2e266: cf 91 pop r28 2e268: 1f 91 pop r17 2e26a: 0f 91 pop r16 2e26c: ff 90 pop r15 2e26e: ef 90 pop r14 2e270: df 90 pop r13 2e272: bf 90 pop r11 2e274: af 90 pop r10 2e276: 9f 90 pop r9 2e278: 8f 90 pop r8 2e27a: 08 95 ret 0002e27c : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2e27c: 20 91 74 13 lds r18, 0x1374 ; 0x801374 2e280: 2f 5f subi r18, 0xFF ; 255 2e282: 20 93 74 13 sts 0x1374, r18 ; 0x801374 if (regIndex >= initRegs8Count) { 2e286: 22 30 cpi r18, 0x02 ; 2 2e288: 78 f4 brcc .+30 ; 0x2e2a8 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2e28a: 30 e0 ldi r19, 0x00 ; 0 2e28c: f9 01 movw r30, r18 2e28e: eb 54 subi r30, 0x4B ; 75 2e290: f5 45 sbci r31, 0x55 ; 85 2e292: 84 91 lpm r24, Z 2e294: 2e 58 subi r18, 0x8E ; 142 2e296: 3c 4e sbci r19, 0xEC ; 236 2e298: f9 01 movw r30, r18 2e29a: 60 81 ld r22, Z 2e29c: 70 e0 ldi r23, 0x00 ; 0 2e29e: 49 e0 ldi r20, 0x09 ; 9 2e2a0: 0f 94 7f 70 call 0x2e0fe ; 0x2e0fe } return false; 2e2a4: 80 e0 ldi r24, 0x00 ; 0 2e2a6: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2e2a8: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2e2aa: 08 95 ret 0002e2ac : * \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) { 2e2ac: 8f 92 push r8 2e2ae: 9f 92 push r9 2e2b0: af 92 push r10 2e2b2: bf 92 push r11 2e2b4: cf 92 push r12 2e2b6: df 92 push r13 2e2b8: ef 92 push r14 2e2ba: ff 92 push r15 2e2bc: cf 93 push r28 2e2be: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2e2c0: 28 ed ldi r18, 0xD8 ; 216 2e2c2: 36 e1 ldi r19, 0x16 ; 22 2e2c4: 30 93 76 0e sts 0x0E76, r19 ; 0x800e76 2e2c8: 20 93 75 0e sts 0x0E75, r18 ; 0x800e75 fatType_ = 0; 2e2cc: 10 92 f4 16 sts 0x16F4, r1 ; 0x8016f4 allocSearchStart_ = 2; 2e2d0: 42 e0 ldi r20, 0x02 ; 2 2e2d2: 50 e0 ldi r21, 0x00 ; 0 2e2d4: 60 e0 ldi r22, 0x00 ; 0 2e2d6: 70 e0 ldi r23, 0x00 ; 0 2e2d8: 40 93 dd 16 sts 0x16DD, r20 ; 0x8016dd 2e2dc: 50 93 de 16 sts 0x16DE, r21 ; 0x8016de 2e2e0: 60 93 df 16 sts 0x16DF, r22 ; 0x8016df 2e2e4: 70 93 e0 16 sts 0x16E0, r23 ; 0x8016e0 cacheDirty_ = 0; // cacheFlush() will write block if true 2e2e8: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 cacheMirrorBlock_ = 0; 2e2ec: 10 92 70 0e sts 0x0E70, r1 ; 0x800e70 2e2f0: 10 92 71 0e sts 0x0E71, r1 ; 0x800e71 2e2f4: 10 92 72 0e sts 0x0E72, r1 ; 0x800e72 2e2f8: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 cacheBlockNumber_ = 0XFFFFFFFF; 2e2fc: 4f ef ldi r20, 0xFF ; 255 2e2fe: 5f ef ldi r21, 0xFF ; 255 2e300: ba 01 movw r22, r20 2e302: 40 93 6c 0e sts 0x0E6C, r20 ; 0x800e6c 2e306: 50 93 6d 0e sts 0x0E6D, r21 ; 0x800e6d 2e30a: 60 93 6e 0e sts 0x0E6E, r22 ; 0x800e6e 2e30e: 70 93 6f 0e sts 0x0E6F, r23 ; 0x800e6f // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2e312: 88 23 and r24, r24 2e314: 09 f4 brne .+2 ; 0x2e318 2e316: 70 c0 rjmp .+224 ; 0x2e3f8 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e318: 40 e0 ldi r20, 0x00 ; 0 2e31a: 60 e0 ldi r22, 0x00 ; 0 2e31c: 70 e0 ldi r23, 0x00 ; 0 2e31e: cb 01 movw r24, r22 2e320: 0f 94 58 6a call 0x2d4b0 ; 0x2d4b0 2e324: 81 11 cpse r24, r1 2e326: 0d c0 rjmp .+26 ; 0x2e342 fatType_ = 32; } return true; fail: return false; 2e328: c0 e0 ldi r28, 0x00 ; 0 } 2e32a: 8c 2f mov r24, r28 2e32c: df 91 pop r29 2e32e: cf 91 pop r28 2e330: ff 90 pop r15 2e332: ef 90 pop r14 2e334: df 90 pop r13 2e336: cf 90 pop r12 2e338: bf 90 pop r11 2e33a: af 90 pop r10 2e33c: 9f 90 pop r9 2e33e: 8f 90 pop r8 2e340: 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 || 2e342: 80 91 36 10 lds r24, 0x1036 ; 0x801036 2e346: 8f 77 andi r24, 0x7F ; 127 2e348: 79 f7 brne .-34 ; 0x2e328 2e34a: 80 91 42 10 lds r24, 0x1042 ; 0x801042 2e34e: 90 91 43 10 lds r25, 0x1043 ; 0x801043 2e352: a0 91 44 10 lds r26, 0x1044 ; 0x801044 2e356: b0 91 45 10 lds r27, 0x1045 ; 0x801045 2e35a: 84 36 cpi r24, 0x64 ; 100 2e35c: 91 05 cpc r25, r1 2e35e: a1 05 cpc r26, r1 2e360: b1 05 cpc r27, r1 2e362: 10 f3 brcs .-60 ; 0x2e328 p->totalSectors < 100 || p->firstSector == 0) { 2e364: c0 90 3e 10 lds r12, 0x103E ; 0x80103e 2e368: d0 90 3f 10 lds r13, 0x103F ; 0x80103f 2e36c: e0 90 40 10 lds r14, 0x1040 ; 0x801040 2e370: f0 90 41 10 lds r15, 0x1041 ; 0x801041 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 || 2e374: c1 14 cp r12, r1 2e376: d1 04 cpc r13, r1 2e378: e1 04 cpc r14, r1 2e37a: f1 04 cpc r15, r1 2e37c: a9 f2 breq .-86 ; 0x2e328 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e37e: 40 e0 ldi r20, 0x00 ; 0 2e380: c7 01 movw r24, r14 2e382: b6 01 movw r22, r12 2e384: 0f 94 58 6a call 0x2d4b0 ; 0x2d4b0 2e388: c8 2f mov r28, r24 2e38a: 88 23 and r24, r24 2e38c: 69 f2 breq .-102 ; 0x2e328 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e38e: 80 91 83 0e lds r24, 0x0E83 ; 0x800e83 2e392: 90 91 84 0e lds r25, 0x0E84 ; 0x800e84 2e396: 81 15 cp r24, r1 2e398: 92 40 sbci r25, 0x02 ; 2 2e39a: 31 f6 brne .-116 ; 0x2e328 fbs->fatCount == 0 || 2e39c: a0 91 88 0e lds r26, 0x0E88 ; 0x800e88 } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e3a0: aa 23 and r26, r26 2e3a2: 11 f2 breq .-124 ; 0x2e328 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e3a4: 60 91 86 0e lds r22, 0x0E86 ; 0x800e86 2e3a8: 70 91 87 0e lds r23, 0x0E87 ; 0x800e87 volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2e3ac: 61 15 cp r22, r1 2e3ae: 71 05 cpc r23, r1 2e3b0: 09 f4 brne .+2 ; 0x2e3b4 2e3b2: ba cf rjmp .-140 ; 0x2e328 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2e3b4: 20 91 85 0e lds r18, 0x0E85 ; 0x800e85 } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e3b8: 22 23 and r18, r18 2e3ba: 09 f4 brne .+2 ; 0x2e3be 2e3bc: b5 cf rjmp .-150 ; 0x2e328 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2e3be: a0 93 ef 16 sts 0x16EF, r26 ; 0x8016ef blocksPerCluster_ = fbs->sectorsPerCluster; 2e3c2: 20 93 e1 16 sts 0x16E1, r18 ; 0x8016e1 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2e3c6: 90 e0 ldi r25, 0x00 ; 0 2e3c8: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2e3ca: 30 e0 ldi r19, 0x00 ; 0 2e3cc: e1 e0 ldi r30, 0x01 ; 1 2e3ce: f0 e0 ldi r31, 0x00 ; 0 2e3d0: d8 2f mov r29, r24 2e3d2: af 01 movw r20, r30 2e3d4: 08 2e mov r0, r24 2e3d6: 02 c0 rjmp .+4 ; 0x2e3dc 2e3d8: 44 0f add r20, r20 2e3da: 55 1f adc r21, r21 2e3dc: 0a 94 dec r0 2e3de: e2 f7 brpl .-8 ; 0x2e3d8 2e3e0: 24 17 cp r18, r20 2e3e2: 35 07 cpc r19, r21 2e3e4: 69 f0 breq .+26 ; 0x2e400 2e3e6: 41 e0 ldi r20, 0x01 ; 1 2e3e8: 48 0f add r20, r24 2e3ea: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2e3ec: 89 30 cpi r24, 0x09 ; 9 2e3ee: 91 05 cpc r25, r1 2e3f0: 79 f7 brne .-34 ; 0x2e3d0 2e3f2: 40 93 ea 16 sts 0x16EA, r20 ; 0x8016ea 2e3f6: 98 cf rjmp .-208 ; 0x2e328 * 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; 2e3f8: c1 2c mov r12, r1 2e3fa: d1 2c mov r13, r1 2e3fc: 76 01 movw r14, r12 2e3fe: bf cf rjmp .-130 ; 0x2e37e 2e400: 80 93 ea 16 sts 0x16EA, r24 ; 0x8016ea clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2e404: 20 91 8e 0e lds r18, 0x0E8E ; 0x800e8e 2e408: 30 91 8f 0e lds r19, 0x0E8F ; 0x800e8f 2e40c: 50 e0 ldi r21, 0x00 ; 0 2e40e: 40 e0 ldi r20, 0x00 ; 0 2e410: 21 15 cp r18, r1 2e412: 31 05 cpc r19, r1 2e414: 41 f4 brne .+16 ; 0x2e426 2e416: 20 91 9c 0e lds r18, 0x0E9C ; 0x800e9c 2e41a: 30 91 9d 0e lds r19, 0x0E9D ; 0x800e9d 2e41e: 40 91 9e 0e lds r20, 0x0E9E ; 0x800e9e 2e422: 50 91 9f 0e lds r21, 0x0E9F ; 0x800e9f 2e426: 20 93 e2 16 sts 0x16E2, r18 ; 0x8016e2 2e42a: 30 93 e3 16 sts 0x16E3, r19 ; 0x8016e3 2e42e: 40 93 e4 16 sts 0x16E4, r20 ; 0x8016e4 2e432: 50 93 e5 16 sts 0x16E5, r21 ; 0x8016e5 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2e436: 46 01 movw r8, r12 2e438: 57 01 movw r10, r14 2e43a: 86 0e add r8, r22 2e43c: 97 1e adc r9, r23 2e43e: a1 1c adc r10, r1 2e440: b1 1c adc r11, r1 2e442: 80 92 f0 16 sts 0x16F0, r8 ; 0x8016f0 2e446: 90 92 f1 16 sts 0x16F1, r9 ; 0x8016f1 2e44a: a0 92 f2 16 sts 0x16F2, r10 ; 0x8016f2 2e44e: b0 92 f3 16 sts 0x16F3, r11 ; 0x8016f3 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2e452: e0 91 89 0e lds r30, 0x0E89 ; 0x800e89 2e456: f0 91 8a 0e lds r31, 0x0E8A ; 0x800e8a 2e45a: f0 93 f6 16 sts 0x16F6, r31 ; 0x8016f6 2e45e: e0 93 f5 16 sts 0x16F5, r30 ; 0x8016f5 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2e462: b0 e0 ldi r27, 0x00 ; 0 2e464: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 <__muluhisi3> 2e468: dc 01 movw r26, r24 2e46a: cb 01 movw r24, r22 2e46c: 88 0d add r24, r8 2e46e: 99 1d adc r25, r9 2e470: aa 1d adc r26, r10 2e472: bb 1d adc r27, r11 2e474: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 2e478: 90 93 f8 16 sts 0x16F8, r25 ; 0x8016f8 2e47c: a0 93 f9 16 sts 0x16F9, r26 ; 0x8016f9 2e480: b0 93 fa 16 sts 0x16FA, r27 ; 0x8016fa // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2e484: 25 e0 ldi r18, 0x05 ; 5 2e486: ee 0f add r30, r30 2e488: ff 1f adc r31, r31 2e48a: 2a 95 dec r18 2e48c: e1 f7 brne .-8 ; 0x2e486 2e48e: e1 50 subi r30, 0x01 ; 1 2e490: fe 4f sbci r31, 0xFE ; 254 2e492: ef 2f mov r30, r31 2e494: ff 27 eor r31, r31 2e496: e6 95 lsr r30 2e498: 8e 0f add r24, r30 2e49a: 9f 1f adc r25, r31 2e49c: a1 1d adc r26, r1 2e49e: b1 1d adc r27, r1 2e4a0: 80 93 eb 16 sts 0x16EB, r24 ; 0x8016eb 2e4a4: 90 93 ec 16 sts 0x16EC, r25 ; 0x8016ec 2e4a8: a0 93 ed 16 sts 0x16ED, r26 ; 0x8016ed 2e4ac: b0 93 ee 16 sts 0x16EE, r27 ; 0x8016ee // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2e4b0: 80 90 8b 0e lds r8, 0x0E8B ; 0x800e8b 2e4b4: 90 90 8c 0e lds r9, 0x0E8C ; 0x800e8c 2e4b8: b1 2c mov r11, r1 2e4ba: a1 2c mov r10, r1 2e4bc: 81 14 cp r8, r1 2e4be: 91 04 cpc r9, r1 2e4c0: 41 f4 brne .+16 ; 0x2e4d2 2e4c2: 80 90 98 0e lds r8, 0x0E98 ; 0x800e98 2e4c6: 90 90 99 0e lds r9, 0x0E99 ; 0x800e99 2e4ca: a0 90 9a 0e lds r10, 0x0E9A ; 0x800e9a 2e4ce: b0 90 9b 0e lds r11, 0x0E9B ; 0x800e9b fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2e4d2: c8 1a sub r12, r24 2e4d4: d9 0a sbc r13, r25 2e4d6: ea 0a sbc r14, r26 2e4d8: fb 0a sbc r15, r27 2e4da: c8 0c add r12, r8 2e4dc: d9 1c adc r13, r9 2e4de: ea 1c adc r14, r10 2e4e0: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2e4e2: 04 c0 rjmp .+8 ; 0x2e4ec 2e4e4: f6 94 lsr r15 2e4e6: e7 94 ror r14 2e4e8: d7 94 ror r13 2e4ea: c7 94 ror r12 2e4ec: da 95 dec r29 2e4ee: d2 f7 brpl .-12 ; 0x2e4e4 2e4f0: c0 92 e6 16 sts 0x16E6, r12 ; 0x8016e6 2e4f4: d0 92 e7 16 sts 0x16E7, r13 ; 0x8016e7 2e4f8: e0 92 e8 16 sts 0x16E8, r14 ; 0x8016e8 2e4fc: f0 92 e9 16 sts 0x16E9, r15 ; 0x8016e9 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2e500: 85 ef ldi r24, 0xF5 ; 245 2e502: c8 16 cp r12, r24 2e504: 8f e0 ldi r24, 0x0F ; 15 2e506: d8 06 cpc r13, r24 2e508: e1 04 cpc r14, r1 2e50a: f1 04 cpc r15, r1 2e50c: 20 f4 brcc .+8 ; 0x2e516 fatType_ = 12; 2e50e: 8c e0 ldi r24, 0x0C ; 12 2e510: 80 93 f4 16 sts 0x16F4, r24 ; 0x8016f4 2e514: 09 cf rjmp .-494 ; 0x2e328 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2e516: 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) { 2e518: 25 ef ldi r18, 0xF5 ; 245 2e51a: c2 16 cp r12, r18 2e51c: 2f ef ldi r18, 0xFF ; 255 2e51e: d2 06 cpc r13, r18 2e520: e1 04 cpc r14, r1 2e522: f1 04 cpc r15, r1 2e524: 88 f0 brcs .+34 ; 0x2e548 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2e526: 80 91 a4 0e lds r24, 0x0EA4 ; 0x800ea4 2e52a: 90 91 a5 0e lds r25, 0x0EA5 ; 0x800ea5 2e52e: a0 91 a6 0e lds r26, 0x0EA6 ; 0x800ea6 2e532: b0 91 a7 0e lds r27, 0x0EA7 ; 0x800ea7 2e536: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 2e53a: 90 93 f8 16 sts 0x16F8, r25 ; 0x8016f8 2e53e: a0 93 f9 16 sts 0x16F9, r26 ; 0x8016f9 2e542: b0 93 fa 16 sts 0x16FA, r27 ; 0x8016fa fatType_ = 32; 2e546: 80 e2 ldi r24, 0x20 ; 32 2e548: 80 93 f4 16 sts 0x16F4, r24 ; 0x8016f4 2e54c: ee ce rjmp .-548 ; 0x2e32a 0002e54e : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2e54e: 20 e0 ldi r18, 0x00 ; 0 2e550: 30 e0 ldi r19, 0x00 ; 0 2e552: 40 ea ldi r20, 0xA0 ; 160 2e554: 52 e4 ldi r21, 0x42 ; 66 2e556: 60 e0 ldi r22, 0x00 ; 0 2e558: 70 e0 ldi r23, 0x00 ; 0 2e55a: 80 ea ldi r24, 0xA0 ; 160 2e55c: 92 ec ldi r25, 0xC2 ; 194 2e55e: 0d 94 ae c2 jmp 0x3855c ; 0x3855c 0002e562 : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2e562: 90 91 96 13 lds r25, 0x1396 ; 0x801396 2e566: 91 fd sbrc r25, 1 2e568: 17 c0 rjmp .+46 ; 0x2e598 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2e56a: 88 23 and r24, r24 2e56c: a9 f0 breq .+42 ; 0x2e598 2e56e: 92 fd sbrc r25, 2 2e570: 13 c0 rjmp .+38 ; 0x2e598 Disable_E0(); 2e572: 0f 94 ac c2 call 0x38558 ; 0x38558 resume_hotend_temp = thermal_degTargetHotend(); 2e576: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 2e57a: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 2e57e: 90 93 8b 13 sts 0x138B, r25 ; 0x80138b 2e582: 80 93 8a 13 sts 0x138A, r24 ; 0x80138a mmu_print_saved |= SavedState::CooldownPending; 2e586: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2e58a: 84 60 ori r24, 0x04 ; 4 2e58c: 80 93 96 13 sts 0x1396, r24 ; 0x801396 LogEchoEvent_P(PSTR("Heater cooldown pending")); 2e590: 85 e8 ldi r24, 0x85 ; 133 2e592: 97 ea ldi r25, 0xA7 ; 167 2e594: 0d 94 d2 c2 jmp 0x385a4 ; 0x385a4 } } 2e598: 08 95 ret 0002e59a : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2e59a: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2e59e: 80 ff sbrs r24, 0 2e5a0: 47 c0 rjmp .+142 ; 0x2e630 LogEchoEvent_P(PSTR("Resuming XYZ")); 2e5a2: 8d e9 ldi r24, 0x9D ; 157 2e5a4: 97 ea ldi r25, 0xA7 ; 167 2e5a6: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 // 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)); 2e5aa: 80 91 82 13 lds r24, 0x1382 ; 0x801382 2e5ae: 90 91 83 13 lds r25, 0x1383 ; 0x801383 2e5b2: a0 91 84 13 lds r26, 0x1384 ; 0x801384 2e5b6: b0 91 85 13 lds r27, 0x1385 ; 0x801385 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; 2e5ba: 40 91 7e 13 lds r20, 0x137E ; 0x80137e 2e5be: 50 91 7f 13 lds r21, 0x137F ; 0x80137f 2e5c2: 60 91 80 13 lds r22, 0x1380 ; 0x801380 2e5c6: 70 91 81 13 lds r23, 0x1381 ; 0x801381 2e5ca: 40 93 40 07 sts 0x0740, r20 ; 0x800740 2e5ce: 50 93 41 07 sts 0x0741, r21 ; 0x800741 2e5d2: 60 93 42 07 sts 0x0742, r22 ; 0x800742 2e5d6: 70 93 43 07 sts 0x0743, r23 ; 0x800743 current_position[Y_AXIS] = ry; 2e5da: 80 93 44 07 sts 0x0744, r24 ; 0x800744 2e5de: 90 93 45 07 sts 0x0745, r25 ; 0x800745 2e5e2: a0 93 46 07 sts 0x0746, r26 ; 0x800746 2e5e6: b0 93 47 07 sts 0x0747, r27 ; 0x800747 planner_line_to_current_position_sync(feedRate_mm_s); 2e5ea: 60 e0 ldi r22, 0x00 ; 0 2e5ec: 70 e0 ldi r23, 0x00 ; 0 2e5ee: 88 e4 ldi r24, 0x48 ; 72 2e5f0: 92 e4 ldi r25, 0x42 ; 66 2e5f2: 0f 94 ce c2 call 0x3859c ; 0x3859c } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2e5f6: 80 91 86 13 lds r24, 0x1386 ; 0x801386 2e5fa: 90 91 87 13 lds r25, 0x1387 ; 0x801387 2e5fe: a0 91 88 13 lds r26, 0x1388 ; 0x801388 2e602: b0 91 89 13 lds r27, 0x1389 ; 0x801389 2e606: 80 93 48 07 sts 0x0748, r24 ; 0x800748 2e60a: 90 93 49 07 sts 0x0749, r25 ; 0x800749 2e60e: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 2e612: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b planner_line_to_current_position_sync(feedRate_mm_s); 2e616: 60 e0 ldi r22, 0x00 ; 0 2e618: 70 e0 ldi r23, 0x00 ; 0 2e61a: 80 e7 ldi r24, 0x70 ; 112 2e61c: 91 e4 ldi r25, 0x41 ; 65 2e61e: 0f 94 ce c2 call 0x3859c ; 0x3859c void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2e622: 10 92 50 07 sts 0x0750, r1 ; 0x800750 // 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); 2e626: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2e62a: 8e 7f andi r24, 0xFE ; 254 2e62c: 80 93 96 13 sts 0x1396, r24 ; 0x801396 } } 2e630: 08 95 ret 0002e632 : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2e632: 0f 93 push r16 2e634: 1f 93 push r17 2e636: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2e638: 90 91 96 13 lds r25, 0x1396 ; 0x801396 2e63c: 91 11 cpse r25, r1 2e63e: 72 c0 rjmp .+228 ; 0x2e724 2e640: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2e642: 82 e7 ldi r24, 0x72 ; 114 2e644: 97 ea ldi r25, 0xA7 ; 167 2e646: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 Disable_E0(); 2e64a: 0f 94 ac c2 call 0x38558 ; 0x38558 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2e64e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 /// 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; 2e652: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 2e656: 81 11 cpse r24, r1 2e658: 02 c0 rjmp .+4 ; 0x2e65e 2e65a: 0e 94 8f 65 call 0xcb1e ; 0xcb1e // 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) { 2e65e: cc 23 and r28, r28 2e660: 09 f4 brne .+2 ; 0x2e664 2e662: 60 c0 rjmp .+192 ; 0x2e724 mmu_print_saved |= SavedState::ParkExtruder; 2e664: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2e668: 81 60 ori r24, 0x01 ; 1 2e66a: 80 93 96 13 sts 0x1396, r24 ; 0x801396 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]); 2e66e: 80 91 48 07 lds r24, 0x0748 ; 0x800748 2e672: 90 91 49 07 lds r25, 0x0749 ; 0x800749 2e676: a0 91 4a 07 lds r26, 0x074A ; 0x80074a 2e67a: b0 91 4b 07 lds r27, 0x074B ; 0x80074b 2e67e: 40 91 44 07 lds r20, 0x0744 ; 0x800744 2e682: 50 91 45 07 lds r21, 0x0745 ; 0x800745 2e686: 60 91 46 07 lds r22, 0x0746 ; 0x800746 2e68a: 70 91 47 07 lds r23, 0x0747 ; 0x800747 resume_position = planner_current_position(); // save current pos 2e68e: 00 91 40 07 lds r16, 0x0740 ; 0x800740 2e692: 10 91 41 07 lds r17, 0x0741 ; 0x800741 2e696: 20 91 42 07 lds r18, 0x0742 ; 0x800742 2e69a: 30 91 43 07 lds r19, 0x0743 ; 0x800743 2e69e: 00 93 7e 13 sts 0x137E, r16 ; 0x80137e 2e6a2: 10 93 7f 13 sts 0x137F, r17 ; 0x80137f 2e6a6: 20 93 80 13 sts 0x1380, r18 ; 0x801380 2e6aa: 30 93 81 13 sts 0x1381, r19 ; 0x801381 2e6ae: 40 93 82 13 sts 0x1382, r20 ; 0x801382 2e6b2: 50 93 83 13 sts 0x1383, r21 ; 0x801383 2e6b6: 60 93 84 13 sts 0x1384, r22 ; 0x801384 2e6ba: 70 93 85 13 sts 0x1385, r23 ; 0x801385 2e6be: 80 93 86 13 sts 0x1386, r24 ; 0x801386 2e6c2: 90 93 87 13 sts 0x1387, r25 ; 0x801387 2e6c6: a0 93 88 13 sts 0x1388, r26 ; 0x801388 2e6ca: b0 93 89 13 sts 0x1389, r27 ; 0x801389 current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2e6ce: 60 e0 ldi r22, 0x00 ; 0 2e6d0: 70 e0 ldi r23, 0x00 ; 0 2e6d2: 80 ea ldi r24, 0xA0 ; 160 2e6d4: 91 e4 ldi r25, 0x41 ; 65 2e6d6: 0e 94 27 6f call 0xde4e ; 0xde4e void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2e6da: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 2e6de: 88 23 and r24, r24 2e6e0: 09 f1 breq .+66 ; 0x2e724 2e6e2: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 2e6e6: 88 23 and r24, r24 2e6e8: e9 f0 breq .+58 ; 0x2e724 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; 2e6ea: 80 e0 ldi r24, 0x00 ; 0 2e6ec: 90 e0 ldi r25, 0x00 ; 0 2e6ee: aa ef ldi r26, 0xFA ; 250 2e6f0: b2 e4 ldi r27, 0x42 ; 66 2e6f2: 80 93 40 07 sts 0x0740, r24 ; 0x800740 2e6f6: 90 93 41 07 sts 0x0741, r25 ; 0x800741 2e6fa: a0 93 42 07 sts 0x0742, r26 ; 0x800742 2e6fe: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2e702: 10 92 44 07 sts 0x0744, r1 ; 0x800744 2e706: 10 92 45 07 sts 0x0745, r1 ; 0x800745 2e70a: 10 92 46 07 sts 0x0746, r1 ; 0x800746 2e70e: 10 92 47 07 sts 0x0747, r1 ; 0x800747 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2e712: 60 e0 ldi r22, 0x00 ; 0 2e714: 70 e0 ldi r23, 0x00 ; 0 2e716: 88 e4 ldi r24, 0x48 ; 72 2e718: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2e71a: cf 91 pop r28 2e71c: 1f 91 pop r17 2e71e: 0f 91 pop r16 2e720: 0d 94 ce c2 jmp 0x3859c ; 0x3859c 2e724: cf 91 pop r28 2e726: 1f 91 pop r17 2e728: 0f 91 pop r16 2e72a: 08 95 ret 0002e72c : 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){ 2e72c: ef 92 push r14 2e72e: ff 92 push r15 2e730: 0f 93 push r16 2e732: 1f 93 push r17 2e734: cf 93 push r28 2e736: df 93 push r29 2e738: 1f 92 push r1 2e73a: 1f 92 push r1 2e73c: cd b7 in r28, 0x3d ; 61 2e73e: de b7 in r29, 0x3e ; 62 2e740: f8 2e mov r15, r24 2e742: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2e744: 80 e1 ldi r24, 0x10 ; 16 2e746: 97 e2 ldi r25, 0x27 ; 39 2e748: 9a 83 std Y+2, r25 ; 0x02 2e74a: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2e74c: 8a 01 movw r16, r20 2e74e: 16 95 lsr r17 2e750: 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); 2e752: 8f 2d mov r24, r15 2e754: 0e 94 ce e0 call 0x1c19c ; 0x1c19c while (steps--){ 2e758: 01 50 subi r16, 0x01 ; 1 2e75a: 11 09 sbc r17, r1 2e75c: 78 f0 brcs .+30 ; 0x2e77c accelerate_1_step(axes, acc, delay_us, min_delay_us); 2e75e: 28 ec ldi r18, 0xC8 ; 200 2e760: 30 e0 ldi r19, 0x00 ; 0 2e762: ae 01 movw r20, r28 2e764: 4f 5f subi r20, 0xFF ; 255 2e766: 5f 4f sbci r21, 0xFF ; 255 2e768: 68 ee ldi r22, 0xE8 ; 232 2e76a: 73 e0 ldi r23, 0x03 ; 3 2e76c: 8f 2d mov r24, r15 2e76e: 0e 94 9f df call 0x1bf3e ; 0x1bf3e update_position_1_step(axes, dir); 2e772: 6e 2d mov r22, r14 2e774: 8f 2d mov r24, r15 2e776: 0e 94 e7 e0 call 0x1c1ce ; 0x1c1ce 2e77a: ee cf rjmp .-36 ; 0x2e758 } /// \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); 2e77c: 6e 2d mov r22, r14 2e77e: 8f 2d mov r24, r15 2e780: 0e 94 ce e0 call 0x1c19c ; 0x1c19c 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); } 2e784: 0f 90 pop r0 2e786: 0f 90 pop r0 2e788: df 91 pop r29 2e78a: cf 91 pop r28 2e78c: 1f 91 pop r17 2e78e: 0f 91 pop r16 2e790: ff 90 pop r15 2e792: ef 90 pop r14 2e794: 08 95 ret 0002e796 : 2e796: ef 92 push r14 2e798: ff 92 push r15 2e79a: 0f 93 push r16 2e79c: 1f 93 push r17 2e79e: cf 93 push r28 2e7a0: df 93 push r29 2e7a2: cd b7 in r28, 0x3d ; 61 2e7a4: de b7 in r29, 0x3e ; 62 2e7a6: 2f 97 sbiw r28, 0x0f ; 15 2e7a8: 0f b6 in r0, 0x3f ; 63 2e7aa: f8 94 cli 2e7ac: de bf out 0x3e, r29 ; 62 2e7ae: 0f be out 0x3f, r0 ; 63 2e7b0: cd bf out 0x3d, r28 ; 61 2e7b2: eb e8 ldi r30, 0x8B ; 139 2e7b4: f2 e1 ldi r31, 0x12 ; 18 2e7b6: 10 a2 std Z+32, r1 ; 0x20 2e7b8: 11 a2 std Z+33, r1 ; 0x21 2e7ba: 12 a2 std Z+34, r1 ; 0x22 2e7bc: 13 a2 std Z+35, r1 ; 0x23 2e7be: 14 a2 std Z+36, r1 ; 0x24 2e7c0: 15 a2 std Z+37, r1 ; 0x25 2e7c2: 16 a2 std Z+38, r1 ; 0x26 2e7c4: 17 a2 std Z+39, r1 ; 0x27 2e7c6: 10 a6 std Z+40, r1 ; 0x28 2e7c8: 11 a6 std Z+41, r1 ; 0x29 2e7ca: 10 92 24 13 sts 0x1324, r1 ; 0x801324 2e7ce: 06 e2 ldi r16, 0x26 ; 38 2e7d0: 13 e1 ldi r17, 0x13 ; 19 2e7d2: ee 24 eor r14, r14 2e7d4: e3 94 inc r14 2e7d6: f1 2c mov r15, r1 2e7d8: d8 01 movw r26, r16 2e7da: 11 96 adiw r26, 0x01 ; 1 2e7dc: fc 92 st X, r15 2e7de: ee 92 st -X, r14 2e7e0: 12 96 adiw r26, 0x02 ; 2 2e7e2: 1c 92 st X, r1 2e7e4: 12 97 sbiw r26, 0x02 ; 2 2e7e6: 82 e8 ldi r24, 0x82 ; 130 2e7e8: 13 96 adiw r26, 0x03 ; 3 2e7ea: 8c 93 st X, r24 2e7ec: 40 e0 ldi r20, 0x00 ; 0 2e7ee: 60 e0 ldi r22, 0x00 ; 0 2e7f0: 8b e2 ldi r24, 0x2B ; 43 2e7f2: 93 e1 ldi r25, 0x13 ; 19 2e7f4: 0f 94 8a c2 call 0x38514 ; 0x38514 2e7f8: 40 e0 ldi r20, 0x00 ; 0 2e7fa: 60 e0 ldi r22, 0x00 ; 0 2e7fc: 80 e3 ldi r24, 0x30 ; 48 2e7fe: 93 e1 ldi r25, 0x13 ; 19 2e800: 0f 94 8a c2 call 0x38514 ; 0x38514 2e804: f8 01 movw r30, r16 2e806: 17 86 std Z+15, r1 ; 0x0f 2e808: 10 8a std Z+16, r1 ; 0x10 2e80a: 11 8a std Z+17, r1 ; 0x11 2e80c: 12 8a std Z+18, r1 ; 0x12 2e80e: 13 8a std Z+19, r1 ; 0x13 2e810: 8a e0 ldi r24, 0x0A ; 10 2e812: 84 8b std Z+20, r24 ; 0x14 2e814: 40 e0 ldi r20, 0x00 ; 0 2e816: 60 e0 ldi r22, 0x00 ; 0 2e818: ce 01 movw r24, r28 2e81a: 01 96 adiw r24, 0x01 ; 1 2e81c: 0f 94 8a c2 call 0x38514 ; 0x38514 2e820: 85 e0 ldi r24, 0x05 ; 5 2e822: fe 01 movw r30, r28 2e824: 31 96 adiw r30, 0x01 ; 1 2e826: de 01 movw r26, r28 2e828: 16 96 adiw r26, 0x06 ; 6 2e82a: 01 90 ld r0, Z+ 2e82c: 0d 92 st X+, r0 2e82e: 8a 95 dec r24 2e830: e1 f7 brne .-8 ; 0x2e82a 2e832: 85 e0 ldi r24, 0x05 ; 5 2e834: fe 01 movw r30, r28 2e836: 36 96 adiw r30, 0x06 ; 6 2e838: ab e3 ldi r26, 0x3B ; 59 2e83a: b3 e1 ldi r27, 0x13 ; 19 2e83c: 01 90 ld r0, Z+ 2e83e: 0d 92 st X+, r0 2e840: 8a 95 dec r24 2e842: e1 f7 brne .-8 ; 0x2e83c 2e844: d8 01 movw r26, r16 2e846: 5a 96 adiw r26, 0x1a ; 26 2e848: 1c 92 st X, r1 2e84a: 5a 97 sbiw r26, 0x1a ; 26 2e84c: 5c 96 adiw r26, 0x1c ; 28 2e84e: 1c 92 st X, r1 2e850: 1e 92 st -X, r1 2e852: 5b 97 sbiw r26, 0x1b ; 27 2e854: 8b e3 ldi r24, 0x3B ; 59 2e856: 93 e1 ldi r25, 0x13 ; 19 2e858: 0f 94 79 c2 call 0x384f2 ; 0x384f2 2e85c: f8 01 movw r30, r16 2e85e: 81 8f std Z+25, r24 ; 0x19 2e860: 15 8e std Z+29, r1 ; 0x1d 2e862: 16 8e std Z+30, r1 ; 0x1e 2e864: 40 e0 ldi r20, 0x00 ; 0 2e866: 60 e0 ldi r22, 0x00 ; 0 2e868: 85 e4 ldi r24, 0x45 ; 69 2e86a: 93 e1 ldi r25, 0x13 ; 19 2e86c: 0f 94 8a c2 call 0x38514 ; 0x38514 2e870: d8 01 movw r26, r16 2e872: 94 96 adiw r26, 0x24 ; 36 2e874: 1c 92 st X, r1 2e876: 40 e0 ldi r20, 0x00 ; 0 2e878: 60 e0 ldi r22, 0x00 ; 0 2e87a: ce 01 movw r24, r28 2e87c: 0b 96 adiw r24, 0x0b ; 11 2e87e: 0f 94 8a c2 call 0x38514 ; 0x38514 2e882: 85 e0 ldi r24, 0x05 ; 5 2e884: fe 01 movw r30, r28 2e886: 3b 96 adiw r30, 0x0b ; 11 2e888: de 01 movw r26, r28 2e88a: 11 96 adiw r26, 0x01 ; 1 2e88c: 01 90 ld r0, Z+ 2e88e: 0d 92 st X+, r0 2e890: 8a 95 dec r24 2e892: e1 f7 brne .-8 ; 0x2e88c 2e894: 85 e0 ldi r24, 0x05 ; 5 2e896: fe 01 movw r30, r28 2e898: 31 96 adiw r30, 0x01 ; 1 2e89a: ab e4 ldi r26, 0x4B ; 75 2e89c: b3 e1 ldi r27, 0x13 ; 19 2e89e: 01 90 ld r0, Z+ 2e8a0: 0d 92 st X+, r0 2e8a2: 8a 95 dec r24 2e8a4: e1 f7 brne .-8 ; 0x2e89e 2e8a6: f8 01 movw r30, r16 2e8a8: 12 a6 std Z+42, r1 ; 0x2a 2e8aa: 14 a6 std Z+44, r1 ; 0x2c 2e8ac: 13 a6 std Z+43, r1 ; 0x2b 2e8ae: 8b e4 ldi r24, 0x4B ; 75 2e8b0: 93 e1 ldi r25, 0x13 ; 19 2e8b2: 0f 94 79 c2 call 0x384f2 ; 0x384f2 2e8b6: d8 01 movw r26, r16 2e8b8: 99 96 adiw r26, 0x29 ; 41 2e8ba: 8c 93 st X, r24 2e8bc: 99 97 sbiw r26, 0x29 ; 41 2e8be: dd 96 adiw r26, 0x3d ; 61 2e8c0: 1c 92 st X, r1 2e8c2: dd 97 sbiw r26, 0x3d ; 61 2e8c4: 85 e2 ldi r24, 0x25 ; 37 2e8c6: 93 e1 ldi r25, 0x13 ; 19 2e8c8: df 96 adiw r26, 0x3f ; 63 2e8ca: 9c 93 st X, r25 2e8cc: 8e 93 st -X, r24 2e8ce: de 97 sbiw r26, 0x3e ; 62 2e8d0: f0 92 67 13 sts 0x1367, r15 ; 0x801367 2e8d4: e0 92 66 13 sts 0x1366, r14 ; 0x801366 2e8d8: 10 92 68 13 sts 0x1368, r1 ; 0x801368 2e8dc: 1f ef ldi r17, 0xFF ; 255 2e8de: 10 93 69 13 sts 0x1369, r17 ; 0x801369 2e8e2: 0f 94 e2 c2 call 0x385c4 ; 0x385c4 2e8e6: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 2e8ea: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b 2e8ee: 10 92 6c 13 sts 0x136C, r1 ; 0x80136c 2e8f2: 10 92 6d 13 sts 0x136D, r1 ; 0x80136d 2e8f6: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f 2e8fa: 10 92 6e 13 sts 0x136E, r1 ; 0x80136e 2e8fe: 10 92 71 13 sts 0x1371, r1 ; 0x801371 2e902: 10 92 70 13 sts 0x1370, r1 ; 0x801370 2e906: 10 92 74 13 sts 0x1374, r1 ; 0x801374 2e90a: 10 92 75 13 sts 0x1375, r1 ; 0x801375 2e90e: 10 92 76 13 sts 0x1376, r1 ; 0x801376 2e912: 10 92 77 13 sts 0x1377, r1 ; 0x801377 2e916: 83 e0 ldi r24, 0x03 ; 3 2e918: 80 93 7a 13 sts 0x137A, r24 ; 0x80137a 2e91c: 10 92 7b 13 sts 0x137B, r1 ; 0x80137b 2e920: 85 e0 ldi r24, 0x05 ; 5 2e922: 80 93 72 13 sts 0x1372, r24 ; 0x801372 2e926: 84 e1 ldi r24, 0x14 ; 20 2e928: 80 93 73 13 sts 0x1373, r24 ; 0x801373 2e92c: 83 e6 ldi r24, 0x63 ; 99 2e92e: 80 93 7c 13 sts 0x137C, r24 ; 0x80137c 2e932: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 2e936: 10 92 7e 13 sts 0x137E, r1 ; 0x80137e 2e93a: 10 92 7f 13 sts 0x137F, r1 ; 0x80137f 2e93e: 10 92 80 13 sts 0x1380, r1 ; 0x801380 2e942: 10 92 81 13 sts 0x1381, r1 ; 0x801381 2e946: 10 92 82 13 sts 0x1382, r1 ; 0x801382 2e94a: 10 92 83 13 sts 0x1383, r1 ; 0x801383 2e94e: 10 92 84 13 sts 0x1384, r1 ; 0x801384 2e952: 10 92 85 13 sts 0x1385, r1 ; 0x801385 2e956: 10 92 86 13 sts 0x1386, r1 ; 0x801386 2e95a: 10 92 87 13 sts 0x1387, r1 ; 0x801387 2e95e: 10 92 88 13 sts 0x1388, r1 ; 0x801388 2e962: 10 92 89 13 sts 0x1389, r1 ; 0x801389 2e966: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b 2e96a: 10 92 8a 13 sts 0x138A, r1 ; 0x80138a 2e96e: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 2e972: 8e e2 ldi r24, 0x2E ; 46 2e974: 90 e8 ldi r25, 0x80 ; 128 2e976: 90 93 8e 13 sts 0x138E, r25 ; 0x80138e 2e97a: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d 2e97e: 10 93 8f 13 sts 0x138F, r17 ; 0x80138f 2e982: 10 93 90 13 sts 0x1390, r17 ; 0x801390 2e986: 10 92 92 13 sts 0x1392, r1 ; 0x801392 2e98a: 10 92 91 13 sts 0x1391, r1 ; 0x801391 2e98e: 10 93 93 13 sts 0x1393, r17 ; 0x801393 2e992: 82 e0 ldi r24, 0x02 ; 2 2e994: 80 93 94 13 sts 0x1394, r24 ; 0x801394 2e998: 10 92 95 13 sts 0x1395, r1 ; 0x801395 2e99c: 10 92 96 13 sts 0x1396, r1 ; 0x801396 2e9a0: 10 92 97 13 sts 0x1397, r1 ; 0x801397 2e9a4: 10 92 98 13 sts 0x1398, r1 ; 0x801398 2e9a8: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2e9ac: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2e9b0: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c 2e9b4: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2e9b8: 0f 94 9d 8b call 0x3173a ; 0x3173a 2e9bc: e9 e6 ldi r30, 0x69 ; 105 2e9be: f4 e1 ldi r31, 0x14 ; 20 2e9c0: 10 92 f1 14 sts 0x14F1, r1 ; 0x8014f1 2e9c4: 10 92 f4 14 sts 0x14F4, r1 ; 0x8014f4 2e9c8: 10 92 16 15 sts 0x1516, r1 ; 0x801516 2e9cc: 10 92 19 15 sts 0x1519, r1 ; 0x801519 2e9d0: 89 e1 ldi r24, 0x19 ; 25 2e9d2: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 2e9d6: 10 92 db 16 sts 0x16DB, r1 ; 0x8016db 2e9da: 10 92 dc 16 sts 0x16DC, r1 ; 0x8016dc 2e9de: 10 92 f4 16 sts 0x16F4, r1 ; 0x8016f4 2e9e2: 10 92 fb 16 sts 0x16FB, r1 ; 0x8016fb 2e9e6: 10 92 fe 16 sts 0x16FE, r1 ; 0x8016fe 2e9ea: 10 92 7c 17 sts 0x177C, r1 ; 0x80177c 2e9ee: 10 92 7e 17 sts 0x177E, r1 ; 0x80177e 2e9f2: 10 92 7d 17 sts 0x177D, r1 ; 0x80177d 2e9f6: 10 92 0d 16 sts 0x160D, r1 ; 0x80160d 2e9fa: 10 92 0c 16 sts 0x160C, r1 ; 0x80160c 2e9fe: 10 92 78 17 sts 0x1778, r1 ; 0x801778 2ea02: 10 92 79 17 sts 0x1779, r1 ; 0x801779 2ea06: 10 92 7a 17 sts 0x177A, r1 ; 0x80177a 2ea0a: 10 92 7b 17 sts 0x177B, r1 ; 0x80177b 2ea0e: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 2ea12: 10 92 80 17 sts 0x1780, r1 ; 0x801780 2ea16: 10 92 81 17 sts 0x1781, r1 ; 0x801781 2ea1a: 10 92 82 17 sts 0x1782, r1 ; 0x801782 2ea1e: 12 82 std Z+2, r1 ; 0x02 2ea20: 13 82 std Z+3, r1 ; 0x03 2ea22: 10 82 st Z, r1 2ea24: 11 82 std Z+1, r1 ; 0x01 2ea26: 10 92 0b 16 sts 0x160B, r1 ; 0x80160b 2ea2a: 10 92 1e 17 sts 0x171E, r1 ; 0x80171e 2ea2e: e9 e3 ldi r30, 0x39 ; 57 2ea30: f5 e1 ldi r31, 0x15 ; 21 2ea32: 82 ed ldi r24, 0xD2 ; 210 2ea34: df 01 movw r26, r30 2ea36: 1d 92 st X+, r1 2ea38: 8a 95 dec r24 2ea3a: e9 f7 brne .-6 ; 0x2ea36 2ea3c: 10 92 ba 14 sts 0x14BA, r1 ; 0x8014ba 2ea40: 10 92 b9 14 sts 0x14B9, r1 ; 0x8014b9 2ea44: 10 92 b8 14 sts 0x14B8, r1 ; 0x8014b8 2ea48: 8c e7 ldi r24, 0x7C ; 124 2ea4a: 97 e1 ldi r25, 0x17 ; 23 2ea4c: 0f 94 b6 3e call 0x27d6c ; 0x27d6c ::start()> 2ea50: e2 e6 ldi r30, 0x62 ; 98 2ea52: f4 e1 ldi r31, 0x14 ; 20 2ea54: 11 82 std Z+1, r1 ; 0x01 2ea56: 12 82 std Z+2, r1 ; 0x02 2ea58: 13 82 std Z+3, r1 ; 0x03 2ea5a: 14 82 std Z+4, r1 ; 0x04 2ea5c: 15 82 std Z+5, r1 ; 0x05 2ea5e: 16 82 std Z+6, r1 ; 0x06 2ea60: 10 83 st Z, r17 2ea62: e5 e8 ldi r30, 0x85 ; 133 2ea64: f7 e1 ldi r31, 0x17 ; 23 2ea66: 15 82 std Z+5, r1 ; 0x05 2ea68: 17 82 std Z+7, r1 ; 0x07 2ea6a: 16 82 std Z+6, r1 ; 0x06 2ea6c: 8a eb ldi r24, 0xBA ; 186 2ea6e: 9c e4 ldi r25, 0x4C ; 76 2ea70: 96 87 std Z+14, r25 ; 0x0e 2ea72: 85 87 std Z+13, r24 ; 0x0d 2ea74: 10 8a std Z+16, r1 ; 0x10 2ea76: 17 86 std Z+15, r1 ; 0x0f 2ea78: 0f 94 55 3e call 0x27caa ; 0x27caa 2ea7c: 60 93 99 17 sts 0x1799, r22 ; 0x801799 2ea80: 70 93 9a 17 sts 0x179A, r23 ; 0x80179a 2ea84: 80 93 9b 17 sts 0x179B, r24 ; 0x80179b 2ea88: 90 93 9c 17 sts 0x179C, r25 ; 0x80179c 2ea8c: 2f 96 adiw r28, 0x0f ; 15 2ea8e: 0f b6 in r0, 0x3f ; 63 2ea90: f8 94 cli 2ea92: de bf out 0x3e, r29 ; 62 2ea94: 0f be out 0x3f, r0 ; 63 2ea96: cd bf out 0x3d, r28 ; 61 2ea98: df 91 pop r29 2ea9a: cf 91 pop r28 2ea9c: 1f 91 pop r17 2ea9e: 0f 91 pop r16 2eaa0: ff 90 pop r15 2eaa2: ef 90 pop r14 2eaa4: 08 95 ret 0002eaa6 : 2eaa6: 42 e0 ldi r20, 0x02 ; 2 2eaa8: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2eaac: 0d 94 11 d6 jmp 0x3ac22 ; 0x3ac22 0002eab0 : 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; 2eab0: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 2eab4: 83 36 cpi r24, 0x63 ; 99 2eab6: 09 f4 brne .+2 ; 0x2eaba 2eab8: 8f ef ldi r24, 0xFF ; 255 } 2eaba: 08 95 ret 0002eabc : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2eabc: 9f b7 in r25, 0x3f ; 63 2eabe: f8 94 cli 2eac0: e5 e0 ldi r30, 0x05 ; 5 2eac2: f1 e0 ldi r31, 0x01 ; 1 2eac4: 80 81 ld r24, Z 2eac6: 80 64 ori r24, 0x40 ; 64 2eac8: 80 83 st Z, r24 2eaca: 9f bf out 0x3f, r25 ; 63 } 2eacc: 08 95 ret 0002eace : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2eace: 0f 93 push r16 2ead0: 1f 93 push r17 2ead2: cf 93 push r28 2ead4: df 93 push r29 2ead6: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2ead8: 0f 94 55 3e call 0x27caa ; 0x27caa 2eadc: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2eade: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 2eae2: 8f 3f cpi r24, 0xFF ; 255 2eae4: 69 f0 breq .+26 ; 0x2eb00 if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2eae6: 0f 94 55 3e call 0x27caa ; 0x27caa 2eaea: 60 1b sub r22, r16 2eaec: 71 0b sbc r23, r17 2eaee: 6c 17 cp r22, r28 2eaf0: 7d 07 cpc r23, r29 2eaf2: a8 f3 brcs .-22 ; 0x2eade } return true; fail: return false; 2eaf4: 80 e0 ldi r24, 0x00 ; 0 } 2eaf6: df 91 pop r29 2eaf8: cf 91 pop r28 2eafa: 1f 91 pop r17 2eafc: 0f 91 pop r16 2eafe: 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; 2eb00: 81 e0 ldi r24, 0x01 ; 1 2eb02: f9 cf rjmp .-14 ; 0x2eaf6 0002eb04 : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2eb04: 82 e2 ldi r24, 0x22 ; 34 2eb06: 9b ea ldi r25, 0xAB ; 171 2eb08: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2eb0c: 60 e0 ldi r22, 0x00 ; 0 2eb0e: 8c ea ldi r24, 0xAC ; 172 2eb10: 9c e0 ldi r25, 0x0C ; 12 2eb12: 0e 94 25 78 call 0xf04a ; 0xf04a if (status == 1) { 2eb16: 81 30 cpi r24, 0x01 ; 1 2eb18: 21 f4 brne .+8 ; 0x2eb22 SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2eb1a: 86 e4 ldi r24, 0x46 ; 70 2eb1c: 9e e5 ldi r25, 0x5E ; 94 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2eb1e: 0c 94 97 7b jmp 0xf72e ; 0xf72e 2eb22: 80 e4 ldi r24, 0x40 ; 64 2eb24: 9e e5 ldi r25, 0x5E ; 94 2eb26: fb cf rjmp .-10 ; 0x2eb1e 0002eb28 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2eb28: bc 01 movw r22, r24 2eb2a: 99 0f add r25, r25 2eb2c: 88 0b sbc r24, r24 2eb2e: 99 0b sbc r25, r25 2eb30: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2eb34: 0d 94 11 d6 jmp 0x3ac22 ; 0x3ac22 0002eb38 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2eb38: 0f 93 push r16 2eb3a: 1f 93 push r17 2eb3c: cf 93 push r28 2eb3e: df 93 push r29 2eb40: ec 01 movw r28, r24 2eb42: 0f 94 cd da call 0x3b59a ; 0x3b59a <__strlen_P> 2eb46: 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) 2eb48: 80 36 cpi r24, 0x60 ; 96 2eb4a: 91 05 cpc r25, r1 2eb4c: 08 f0 brcs .+2 ; 0x2eb50 2eb4e: 85 c0 rjmp .+266 ; 0x2ec5a return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2eb50: 80 91 7d 10 lds r24, 0x107D ; 0x80107d 2eb54: 81 11 cpse r24, r1 2eb56: 05 c0 rjmp .+10 ; 0x2eb62 cmdqueue_pop_front(); 2eb58: 0e 94 d8 78 call 0xf1b0 ; 0xf1b0 cmdbuffer_front_already_processed = true; 2eb5c: 81 e0 ldi r24, 0x01 ; 1 2eb5e: 80 93 7d 10 sts 0x107D, r24 ; 0x80107d } if (bufindr == bufindw && buflen > 0) 2eb62: 40 91 6d 12 lds r20, 0x126D ; 0x80126d 2eb66: 50 91 6e 12 lds r21, 0x126E ; 0x80126e 2eb6a: 80 91 7b 10 lds r24, 0x107B ; 0x80107b <_ZL7bufindw.lto_priv.568> 2eb6e: 90 91 7c 10 lds r25, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.568+0x1> 2eb72: 48 17 cp r20, r24 2eb74: 59 07 cpc r21, r25 2eb76: 41 f4 brne .+16 ; 0x2eb88 2eb78: 20 91 7e 10 lds r18, 0x107E ; 0x80107e 2eb7c: 30 91 7f 10 lds r19, 0x107F ; 0x80107f 2eb80: 12 16 cp r1, r18 2eb82: 13 06 cpc r1, r19 2eb84: 0c f4 brge .+2 ; 0x2eb88 2eb86: 69 c0 rjmp .+210 ; 0x2ec5a // 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; 2eb88: 20 91 79 10 lds r18, 0x1079 ; 0x801079 2eb8c: 30 91 7a 10 lds r19, 0x107A ; 0x80107a 2eb90: 12 16 cp r1, r18 2eb92: 13 06 cpc r1, r19 2eb94: 0c f0 brlt .+2 ; 0x2eb98 2eb96: 41 c0 rjmp .+130 ; 0x2ec1a 2eb98: 9c 01 movw r18, r24 2eb9a: 2f 59 subi r18, 0x9F ; 159 2eb9c: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2eb9e: 84 17 cp r24, r20 2eba0: 95 07 cpc r25, r21 2eba2: e8 f5 brcc .+122 ; 0x2ec1e int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2eba4: 44 50 subi r20, 0x04 ; 4 2eba6: 51 09 sbc r21, r1 2eba8: 40 1b sub r20, r16 2ebaa: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2ebac: 42 17 cp r20, r18 2ebae: 53 07 cpc r21, r19 2ebb0: 0c f4 brge .+2 ; 0x2ebb4 2ebb2: 53 c0 rjmp .+166 ; 0x2ec5a } } 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); 2ebb4: 50 93 6e 12 sts 0x126E, r21 ; 0x80126e 2ebb8: 40 93 6d 12 sts 0x126D, r20 ; 0x80126d 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; 2ebbc: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 2ebc0: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 2ebc4: fc 01 movw r30, r24 2ebc6: e0 58 subi r30, 0x80 ; 128 2ebc8: ff 4e sbci r31, 0xEF ; 239 2ebca: 23 e0 ldi r18, 0x03 ; 3 2ebcc: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2ebce: be 01 movw r22, r28 2ebd0: 8d 57 subi r24, 0x7D ; 125 2ebd2: 9f 4e sbci r25, 0xEF ; 239 2ebd4: 0f 94 c6 da call 0x3b58c ; 0x3b58c else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2ebd8: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 2ebdc: 90 91 7f 10 lds r25, 0x107F ; 0x80107f 2ebe0: 01 96 adiw r24, 0x01 ; 1 2ebe2: 90 93 7f 10 sts 0x107F, r25 ; 0x80107f 2ebe6: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e SERIAL_ECHO_START; 2ebea: 84 e1 ldi r24, 0x14 ; 20 2ebec: 9b ea ldi r25, 0xAB ; 171 2ebee: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(enqueingFront); 2ebf2: 85 ef ldi r24, 0xF5 ; 245 2ebf4: 9a ea ldi r25, 0xAA ; 170 2ebf6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2ebfa: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 2ebfe: 90 91 6e 12 lds r25, 0x126E ; 0x80126e } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2ec02: 8d 57 subi r24, 0x7D ; 125 2ec04: 9f 4e sbci r25, 0xEF ; 239 2ec06: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_ECHOLNPGM("\""); 2ec0a: 83 ef ldi r24, 0xF3 ; 243 2ec0c: 9a ea ldi r25, 0xAA ; 170 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2ec0e: df 91 pop r29 2ec10: cf 91 pop r28 2ec12: 1f 91 pop r17 2ec14: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ec16: 0c 94 97 7b jmp 0xf72e ; 0xf72e // 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) 2ec1a: 9c 01 movw r18, r24 2ec1c: c0 cf rjmp .-128 ; 0x2eb9e bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2ec1e: c8 01 movw r24, r16 2ec20: 04 96 adiw r24, 0x04 ; 4 2ec22: 48 17 cp r20, r24 2ec24: 59 07 cpc r21, r25 2ec26: 28 f0 brcs .+10 ; 0x2ec32 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2ec28: 44 50 subi r20, 0x04 ; 4 2ec2a: 51 09 sbc r21, r1 2ec2c: 40 1b sub r20, r16 2ec2e: 51 0b sbc r21, r17 2ec30: c1 cf rjmp .-126 ; 0x2ebb4 return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2ec32: 89 ee ldi r24, 0xE9 ; 233 2ec34: 91 e0 ldi r25, 0x01 ; 1 2ec36: bc 01 movw r22, r24 2ec38: 60 1b sub r22, r16 2ec3a: 71 0b sbc r23, r17 2ec3c: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2ec3e: 62 17 cp r22, r18 2ec40: 73 07 cpc r23, r19 2ec42: 5c f0 brlt .+22 ; 0x2ec5a memset(cmdbuffer, 0, bufindr); 2ec44: 70 e0 ldi r23, 0x00 ; 0 2ec46: 60 e0 ldi r22, 0x00 ; 0 2ec48: 80 e8 ldi r24, 0x80 ; 128 2ec4a: 90 e1 ldi r25, 0x10 ; 16 2ec4c: 0f 94 41 e3 call 0x3c682 ; 0x3c682 bufindr = bufindr_new; 2ec50: 10 93 6e 12 sts 0x126E, r17 ; 0x80126e 2ec54: 00 93 6d 12 sts 0x126D, r16 ; 0x80126d 2ec58: b1 cf rjmp .-158 ; 0x2ebbc SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2ec5a: 8c ee ldi r24, 0xEC ; 236 2ec5c: 9a ea ldi r25, 0xAA ; 170 2ec5e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(enqueingFront); 2ec62: 85 ef ldi r24, 0xF5 ; 245 2ec64: 9a ea ldi r25, 0xAA ; 170 2ec66: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2ec6a: ce 01 movw r24, r28 2ec6c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ec70: 85 ed ldi r24, 0xD5 ; 213 2ec72: 9a ea ldi r25, 0xAA ; 170 2ec74: cc cf rjmp .-104 ; 0x2ec0e 0002ec76 : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2ec76: ab 01 movw r20, r22 2ec78: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2ec7a: 8b ef ldi r24, 0xFB ; 251 2ec7c: 96 e1 ldi r25, 0x16 ; 22 2ec7e: 0f 94 2a 6d call 0x2da54 ; 0x2da54 2ec82: 81 11 cpse r24, r1 2ec84: 02 c0 rjmp .+4 ; 0x2ec8a 2ec86: 80 e0 ldi r24, 0x00 ; 0 2ec88: 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() ) 2ec8a: 8b ef ldi r24, 0xFB ; 251 2ec8c: 96 e1 ldi r25, 0x16 ; 22 2ec8e: 0f 94 14 6c call 0x2d828 ; 0x2d828 2ec92: 88 23 and r24, r24 2ec94: c1 f3 breq .-16 ; 0x2ec86 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; 2ec96: 20 91 1c 17 lds r18, 0x171C ; 0x80171c 2ec9a: 30 91 1d 17 lds r19, 0x171D ; 0x80171d 2ec9e: 28 58 subi r18, 0x88 ; 136 2eca0: 31 4f sbci r19, 0xF1 ; 241 2eca2: 30 93 17 17 sts 0x1717, r19 ; 0x801717 2eca6: 20 93 16 17 sts 0x1716, r18 ; 0x801716 bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2ecaa: 08 95 ret 0002ecac : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2ecac: 8f 92 push r8 2ecae: 9f 92 push r9 2ecb0: af 92 push r10 2ecb2: bf 92 push r11 2ecb4: cf 92 push r12 2ecb6: df 92 push r13 2ecb8: ef 92 push r14 2ecba: ff 92 push r15 2ecbc: 0f 93 push r16 2ecbe: 1f 93 push r17 2ecc0: cf 93 push r28 2ecc2: df 93 push r29 2ecc4: cd b7 in r28, 0x3d ; 61 2ecc6: de b7 in r29, 0x3e ; 62 2ecc8: ee 97 sbiw r28, 0x3e ; 62 2ecca: 0f b6 in r0, 0x3f ; 63 2eccc: f8 94 cli 2ecce: de bf out 0x3e, r29 ; 62 2ecd0: 0f be out 0x3f, r0 ; 63 2ecd2: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2ecd4: 80 91 b9 14 lds r24, 0x14B9 ; 0x8014b9 2ecd8: 8f 93 push r24 2ecda: 80 91 b8 14 lds r24, 0x14B8 ; 0x8014b8 2ecde: 8f 93 push r24 2ece0: 80 e9 ldi r24, 0x90 ; 144 2ece2: 9a ea ldi r25, 0xAA ; 170 2ece4: 9f 93 push r25 2ece6: 8f 93 push r24 2ece8: 8e 01 movw r16, r28 2ecea: 0f 5d subi r16, 0xDF ; 223 2ecec: 1f 4f sbci r17, 0xFF ; 255 2ecee: 1f 93 push r17 2ecf0: 0f 93 push r16 2ecf2: 0f 94 26 dc call 0x3b84c ; 0x3b84c 2ecf6: 0f 90 pop r0 2ecf8: 0f 90 pop r0 2ecfa: 0f 90 pop r0 2ecfc: 0f 90 pop r0 2ecfe: 0f 90 pop r0 2ed00: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2ed02: f1 2c mov r15, r1 2ed04: f8 01 movw r30, r16 2ed06: 01 90 ld r0, Z+ 2ed08: 00 20 and r0, r0 2ed0a: e9 f7 brne .-6 ; 0x2ed06 2ed0c: 31 97 sbiw r30, 0x01 ; 1 2ed0e: e0 1b sub r30, r16 2ed10: f1 0b sbc r31, r17 2ed12: fe 16 cp r15, r30 2ed14: 84 f4 brge .+32 ; 0x2ed36 autoname[i]=tolower(autoname[i]); 2ed16: 68 01 movw r12, r16 2ed18: cf 0c add r12, r15 2ed1a: d1 1c adc r13, r1 2ed1c: f7 fc sbrc r15, 7 2ed1e: da 94 dec r13 2ed20: f6 01 movw r30, r12 2ed22: 80 81 ld r24, Z 2ed24: 08 2e mov r0, r24 2ed26: 00 0c add r0, r0 2ed28: 99 0b sbc r25, r25 2ed2a: 0f 94 23 e3 call 0x3c646 ; 0x3c646 2ed2e: f6 01 movw r30, r12 2ed30: 80 83 st Z, r24 2ed32: f3 94 inc r15 2ed34: e7 cf rjmp .-50 ; 0x2ed04 dir_t p; root.rewind(); 2ed36: 81 ef ldi r24, 0xF1 ; 241 2ed38: 94 e1 ldi r25, 0x14 ; 20 2ed3a: 0e 94 48 79 call 0xf290 ; 0xf290 bool found=false; 2ed3e: a1 2c mov r10, r1 2ed40: ce 01 movw r24, r28 2ed42: 01 96 adiw r24, 0x01 ; 1 2ed44: 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); 2ed46: 81 ed ldi r24, 0xD1 ; 209 2ed48: c8 2e mov r12, r24 2ed4a: 81 e7 ldi r24, 0x71 ; 113 2ed4c: 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; 2ed4e: 80 91 f4 14 lds r24, 0x14F4 ; 0x8014f4 2ed52: 82 30 cpi r24, 0x02 ; 2 2ed54: 08 f4 brcc .+2 ; 0x2ed58 2ed56: 50 c0 rjmp .+160 ; 0x2edf8 2ed58: 80 91 f9 14 lds r24, 0x14F9 ; 0x8014f9 2ed5c: 90 91 fa 14 lds r25, 0x14FA ; 0x8014fa 2ed60: a0 91 fb 14 lds r26, 0x14FB ; 0x8014fb 2ed64: b0 91 fc 14 lds r27, 0x14FC ; 0x8014fc 2ed68: 8f 71 andi r24, 0x1F ; 31 2ed6a: 99 27 eor r25, r25 2ed6c: aa 27 eor r26, r26 2ed6e: bb 27 eor r27, r27 2ed70: 89 2b or r24, r25 2ed72: 8a 2b or r24, r26 2ed74: 8b 2b or r24, r27 2ed76: 09 f0 breq .+2 ; 0x2ed7a 2ed78: 3f c0 rjmp .+126 ; 0x2edf8 2ed7a: 50 e0 ldi r21, 0x00 ; 0 2ed7c: 40 e0 ldi r20, 0x00 ; 0 2ed7e: b7 01 movw r22, r14 2ed80: 81 ef ldi r24, 0xF1 ; 241 2ed82: 94 e1 ldi r25, 0x14 ; 20 2ed84: 0f 94 8d 6c call 0x2d91a ; 0x2d91a dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2ed88: 18 16 cp r1, r24 2ed8a: b4 f5 brge .+108 ; 0x2edf8 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2ed8c: b1 2c mov r11, r1 2ed8e: f7 01 movw r30, r14 2ed90: 01 90 ld r0, Z+ 2ed92: 00 20 and r0, r0 2ed94: e9 f7 brne .-6 ; 0x2ed90 2ed96: 31 97 sbiw r30, 0x01 ; 1 2ed98: ee 19 sub r30, r14 2ed9a: ff 09 sbc r31, r15 2ed9c: be 16 cp r11, r30 2ed9e: 74 f4 brge .+28 ; 0x2edbc p.name[i]=tolower(p.name[i]); 2eda0: 47 01 movw r8, r14 2eda2: 8b 0c add r8, r11 2eda4: 91 1c adc r9, r1 2eda6: b7 fc sbrc r11, 7 2eda8: 9a 94 dec r9 2edaa: f4 01 movw r30, r8 2edac: 80 81 ld r24, Z 2edae: 90 e0 ldi r25, 0x00 ; 0 2edb0: 0f 94 23 e3 call 0x3c646 ; 0x3c646 2edb4: f4 01 movw r30, r8 2edb6: 80 83 st Z, r24 2edb8: b3 94 inc r11 2edba: e9 cf rjmp .-46 ; 0x2ed8e //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2edbc: 8a 85 ldd r24, Y+10 ; 0x0a 2edbe: 8e 37 cpi r24, 0x7E ; 126 2edc0: 31 f2 breq .-116 ; 0x2ed4e if(strncmp((char*)p.name,autoname,5)==0) 2edc2: 45 e0 ldi r20, 0x05 ; 5 2edc4: 50 e0 ldi r21, 0x00 ; 0 2edc6: b8 01 movw r22, r16 2edc8: c7 01 movw r24, r14 2edca: 0f 94 81 e3 call 0x3c702 ; 0x3c702 2edce: 89 2b or r24, r25 2edd0: 09 f0 breq .+2 ; 0x2edd4 2edd2: bd cf rjmp .-134 ; 0x2ed4e { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2edd4: 1f 93 push r17 2edd6: 0f 93 push r16 2edd8: df 92 push r13 2edda: cf 92 push r12 2eddc: 0e 94 72 8a call 0x114e4 ; 0x114e4 // M24: Start/resume SD print enquecommand_P(MSG_M24); 2ede0: 61 e0 ldi r22, 0x01 ; 1 2ede2: 8d ec ldi r24, 0xCD ; 205 2ede4: 91 e7 ldi r25, 0x71 ; 113 2ede6: 0e 94 dc 89 call 0x113b8 ; 0x113b8 2edea: 0f 90 pop r0 2edec: 0f 90 pop r0 2edee: 0f 90 pop r0 2edf0: 0f 90 pop r0 found=true; 2edf2: aa 24 eor r10, r10 2edf4: a3 94 inc r10 2edf6: ab cf rjmp .-170 ; 0x2ed4e } } if(!found) lastnr=-1; 2edf8: 8f ef ldi r24, 0xFF ; 255 2edfa: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2edfc: aa 20 and r10, r10 2edfe: 29 f0 breq .+10 ; 0x2ee0a lastnr=-1; else lastnr++; 2ee00: 80 91 b8 14 lds r24, 0x14B8 ; 0x8014b8 2ee04: 90 91 b9 14 lds r25, 0x14B9 ; 0x8014b9 2ee08: 01 96 adiw r24, 0x01 ; 1 2ee0a: 90 93 b9 14 sts 0x14B9, r25 ; 0x8014b9 2ee0e: 80 93 b8 14 sts 0x14B8, r24 ; 0x8014b8 } 2ee12: ee 96 adiw r28, 0x3e ; 62 2ee14: 0f b6 in r0, 0x3f ; 63 2ee16: f8 94 cli 2ee18: de bf out 0x3e, r29 ; 62 2ee1a: 0f be out 0x3f, r0 ; 63 2ee1c: cd bf out 0x3d, r28 ; 61 2ee1e: df 91 pop r29 2ee20: cf 91 pop r28 2ee22: 1f 91 pop r17 2ee24: 0f 91 pop r16 2ee26: ff 90 pop r15 2ee28: ef 90 pop r14 2ee2a: df 90 pop r13 2ee2c: cf 90 pop r12 2ee2e: bf 90 pop r11 2ee30: af 90 pop r10 2ee32: 9f 90 pop r9 2ee34: 8f 90 pop r8 2ee36: 08 95 ret 0002ee38 : * \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) { 2ee38: 8f 92 push r8 2ee3a: 9f 92 push r9 2ee3c: af 92 push r10 2ee3e: bf 92 push r11 2ee40: cf 92 push r12 2ee42: df 92 push r13 2ee44: ef 92 push r14 2ee46: ff 92 push r15 2ee48: 0f 93 push r16 2ee4a: 1f 93 push r17 2ee4c: cf 93 push r28 2ee4e: df 93 push r29 2ee50: 00 d0 rcall .+0 ; 0x2ee52 2ee52: 1f 92 push r1 2ee54: cd b7 in r28, 0x3d ; 61 2ee56: de b7 in r29, 0x3e ; 62 2ee58: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2ee5a: 83 81 ldd r24, Z+3 ; 0x03 2ee5c: 81 30 cpi r24, 0x01 ; 1 2ee5e: 11 f0 breq .+4 ; 0x2ee64 // set file to correct position return seekSet(newPos); fail: return false; 2ee60: 80 e0 ldi r24, 0x00 ; 0 2ee62: 60 c0 rjmp .+192 ; 0x2ef24 * \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; 2ee64: 81 81 ldd r24, Z+1 ; 0x01 2ee66: 81 ff sbrs r24, 1 2ee68: fb cf rjmp .-10 ; 0x2ee60 // 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; 2ee6a: 81 89 ldd r24, Z+17 ; 0x11 2ee6c: 92 89 ldd r25, Z+18 ; 0x12 2ee6e: a3 89 ldd r26, Z+19 ; 0x13 2ee70: b4 89 ldd r27, Z+20 ; 0x14 2ee72: 89 2b or r24, r25 2ee74: 8a 2b or r24, r26 2ee76: 8b 2b or r24, r27 2ee78: 09 f4 brne .+2 ; 0x2ee7c 2ee7a: 6e c0 rjmp .+220 ; 0x2ef58 2ee7c: 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; 2ee7e: 40 e0 ldi r20, 0x00 ; 0 2ee80: 50 e0 ldi r21, 0x00 ; 0 2ee82: ba 01 movw r22, r20 2ee84: cf 01 movw r24, r30 2ee86: 0f 94 2a 6d call 0x2da54 ; 0x2da54 2ee8a: 88 23 and r24, r24 2ee8c: 49 f3 breq .-46 ; 0x2ee60 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2ee8e: f7 01 movw r30, r14 2ee90: c1 8c ldd r12, Z+25 ; 0x19 2ee92: d2 8c ldd r13, Z+26 ; 0x1a 2ee94: 85 88 ldd r8, Z+21 ; 0x15 2ee96: 96 88 ldd r9, Z+22 ; 0x16 2ee98: a7 88 ldd r10, Z+23 ; 0x17 2ee9a: 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; 2ee9c: 82 e0 ldi r24, 0x02 ; 2 2ee9e: 90 e0 ldi r25, 0x00 ; 0 2eea0: a0 e0 ldi r26, 0x00 ; 0 2eea2: b0 e0 ldi r27, 0x00 ; 0 2eea4: f6 01 movw r30, r12 2eea6: 80 83 st Z, r24 2eea8: 91 83 std Z+1, r25 ; 0x01 2eeaa: a2 83 std Z+2, r26 ; 0x02 2eeac: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2eeae: 9e 01 movw r18, r28 2eeb0: 2f 5f subi r18, 0xFF ; 255 2eeb2: 3f 4f sbci r19, 0xFF ; 255 2eeb4: b5 01 movw r22, r10 2eeb6: a4 01 movw r20, r8 2eeb8: c6 01 movw r24, r12 2eeba: 0f 94 27 6b call 0x2d64e ; 0x2d64e 2eebe: 88 23 and r24, r24 2eec0: 79 f2 breq .-98 ; 0x2ee60 // free cluster if (!fatPut(cluster, 0)) goto fail; 2eec2: 00 e0 ldi r16, 0x00 ; 0 2eec4: 10 e0 ldi r17, 0x00 ; 0 2eec6: 98 01 movw r18, r16 2eec8: b5 01 movw r22, r10 2eeca: a4 01 movw r20, r8 2eecc: c6 01 movw r24, r12 2eece: 0f 94 95 6a call 0x2d52a ; 0x2d52a 2eed2: 88 23 and r24, r24 2eed4: 29 f2 breq .-118 ; 0x2ee60 cluster = next; 2eed6: 89 80 ldd r8, Y+1 ; 0x01 2eed8: 9a 80 ldd r9, Y+2 ; 0x02 2eeda: ab 80 ldd r10, Y+3 ; 0x03 2eedc: 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; 2eede: f6 01 movw r30, r12 2eee0: 87 89 ldd r24, Z+23 ; 0x17 2eee2: 80 31 cpi r24, 0x10 ; 16 2eee4: 81 f5 brne .+96 ; 0x2ef46 2eee6: f8 ef ldi r31, 0xF8 ; 248 2eee8: 8f 16 cp r8, r31 2eeea: ff ef ldi r31, 0xFF ; 255 2eeec: 9f 06 cpc r9, r31 2eeee: a1 04 cpc r10, r1 2eef0: b1 04 cpc r11, r1 2eef2: e8 f2 brcs .-70 ; 0x2eeae firstCluster_ = 0; 2eef4: f7 01 movw r30, r14 2eef6: 15 8a std Z+21, r1 ; 0x15 2eef8: 16 8a std Z+22, r1 ; 0x16 2eefa: 17 8a std Z+23, r1 ; 0x17 2eefc: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2eefe: 11 8a std Z+17, r1 ; 0x11 2ef00: 12 8a std Z+18, r1 ; 0x12 2ef02: 13 8a std Z+19, r1 ; 0x13 2ef04: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2ef06: 81 81 ldd r24, Z+1 ; 0x01 2ef08: 80 68 ori r24, 0x80 ; 128 2ef0a: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2ef0c: c7 01 movw r24, r14 2ef0e: 0f 94 f5 6c call 0x2d9ea ; 0x2d9ea 2ef12: 88 23 and r24, r24 2ef14: 09 f4 brne .+2 ; 0x2ef18 2ef16: a4 cf rjmp .-184 ; 0x2ee60 // set file to correct position return seekSet(newPos); 2ef18: 40 e0 ldi r20, 0x00 ; 0 2ef1a: 50 e0 ldi r21, 0x00 ; 0 2ef1c: ba 01 movw r22, r20 2ef1e: c7 01 movw r24, r14 2ef20: 0f 94 2a 6d call 0x2da54 ; 0x2da54 fail: return false; } 2ef24: 0f 90 pop r0 2ef26: 0f 90 pop r0 2ef28: 0f 90 pop r0 2ef2a: 0f 90 pop r0 2ef2c: df 91 pop r29 2ef2e: cf 91 pop r28 2ef30: 1f 91 pop r17 2ef32: 0f 91 pop r16 2ef34: ff 90 pop r15 2ef36: ef 90 pop r14 2ef38: df 90 pop r13 2ef3a: cf 90 pop r12 2ef3c: bf 90 pop r11 2ef3e: af 90 pop r10 2ef40: 9f 90 pop r9 2ef42: 8f 90 pop r8 2ef44: 08 95 ret return cluster >= FAT32EOC_MIN; 2ef46: 88 ef ldi r24, 0xF8 ; 248 2ef48: 88 16 cp r8, r24 2ef4a: 8f ef ldi r24, 0xFF ; 255 2ef4c: 98 06 cpc r9, r24 2ef4e: a8 06 cpc r10, r24 2ef50: 8f e0 ldi r24, 0x0F ; 15 2ef52: b8 06 cpc r11, r24 2ef54: 78 f6 brcc .-98 ; 0x2eef4 2ef56: ab cf rjmp .-170 ; 0x2eeae // 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; 2ef58: 81 e0 ldi r24, 0x01 ; 1 2ef5a: e4 cf rjmp .-56 ; 0x2ef24 0002ef5c : +* 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) { 2ef5c: 2f 92 push r2 2ef5e: 3f 92 push r3 2ef60: 4f 92 push r4 2ef62: 5f 92 push r5 2ef64: 6f 92 push r6 2ef66: 7f 92 push r7 2ef68: 8f 92 push r8 2ef6a: 9f 92 push r9 2ef6c: af 92 push r10 2ef6e: bf 92 push r11 2ef70: cf 92 push r12 2ef72: df 92 push r13 2ef74: ef 92 push r14 2ef76: ff 92 push r15 2ef78: 0f 93 push r16 2ef7a: 1f 93 push r17 2ef7c: cf 93 push r28 2ef7e: df 93 push r29 2ef80: cd b7 in r28, 0x3d ; 61 2ef82: de b7 in r29, 0x3e ; 62 2ef84: c6 57 subi r28, 0x76 ; 118 2ef86: d1 09 sbc r29, r1 2ef88: 0f b6 in r0, 0x3f ; 63 2ef8a: f8 94 cli 2ef8c: de bf out 0x3e, r29 ; 62 2ef8e: 0f be out 0x3f, r0 ; 63 2ef90: cd bf out 0x3d, r28 ; 61 2ef92: 4c 01 movw r8, r24 2ef94: 6b 01 movw r12, r22 2ef96: 3a 01 movw r6, r20 2ef98: e5 96 adiw r28, 0x35 ; 53 2ef9a: 2f af std Y+63, r18 ; 0x3f 2ef9c: e5 97 sbiw r28, 0x35 ; 53 2ef9e: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2efa0: 2d b6 in r2, 0x3d ; 61 2efa2: 3e b6 in r3, 0x3e ; 62 2efa4: 10 2f mov r17, r16 2efa6: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2efa8: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 2efac: 8f 5f subi r24, 0xFF ; 255 2efae: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 } 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()) { 2efb2: fb 01 movw r30, r22 2efb4: 80 85 ldd r24, Z+8 ; 0x08 2efb6: 91 85 ldd r25, Z+9 ; 0x09 2efb8: a2 85 ldd r26, Z+10 ; 0x0a 2efba: b3 85 ldd r27, Z+11 ; 0x0b 2efbc: 80 93 7e 14 sts 0x147E, r24 ; 0x80147e 2efc0: 90 93 7f 14 sts 0x147F, r25 ; 0x80147f 2efc4: a0 93 80 14 sts 0x1480, r26 ; 0x801480 2efc8: b0 93 81 14 sts 0x1481, r27 ; 0x801481 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2efcc: 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); 2efce: 5e 01 movw r10, r28 2efd0: f7 e6 ldi r31, 0x67 ; 103 2efd2: af 0e add r10, r31 2efd4: 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; 2efd6: f6 01 movw r30, r12 2efd8: 83 81 ldd r24, Z+3 ; 0x03 2efda: 82 30 cpi r24, 0x02 ; 2 2efdc: 08 f4 brcc .+2 ; 0x2efe0 2efde: c0 c1 rjmp .+896 ; 0x2f360 2efe0: 80 85 ldd r24, Z+8 ; 0x08 2efe2: 91 85 ldd r25, Z+9 ; 0x09 2efe4: a2 85 ldd r26, Z+10 ; 0x0a 2efe6: b3 85 ldd r27, Z+11 ; 0x0b 2efe8: 8f 71 andi r24, 0x1F ; 31 2efea: 99 27 eor r25, r25 2efec: aa 27 eor r26, r26 2efee: bb 27 eor r27, r27 2eff0: 89 2b or r24, r25 2eff2: 8a 2b or r24, r26 2eff4: 8b 2b or r24, r27 2eff6: 09 f0 breq .+2 ; 0x2effa 2eff8: b3 c1 rjmp .+870 ; 0x2f360 //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'; 2effa: 10 92 82 14 sts 0x1482, r1 ; 0x801482 2effe: 42 e8 ldi r20, 0x82 ; 130 2f000: 54 e1 ldi r21, 0x14 ; 20 2f002: be 01 movw r22, r28 2f004: 69 5b subi r22, 0xB9 ; 185 2f006: 7f 4f sbci r23, 0xFF ; 255 2f008: c6 01 movw r24, r12 2f00a: 0f 94 8d 6c call 0x2d91a ; 0x2d91a } 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()) { 2f00e: 18 16 cp r1, r24 2f010: 0c f0 brlt .+2 ; 0x2f014 2f012: a6 c1 rjmp .+844 ; 0x2f360 if (recursionCnt > MAX_DIR_DEPTH) 2f014: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 2f018: 87 30 cpi r24, 0x07 ; 7 2f01a: 08 f0 brcs .+2 ; 0x2f01e 2f01c: a1 c1 rjmp .+834 ; 0x2f360 return; uint8_t pn0 = p.name[0]; 2f01e: 28 96 adiw r28, 0x08 ; 8 2f020: 8f ad ldd r24, Y+63 ; 0x3f 2f022: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2f024: 88 23 and r24, r24 2f026: 09 f4 brne .+2 ; 0x2f02a 2f028: 9b c1 rjmp .+822 ; 0x2f360 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2f02a: 85 3e cpi r24, 0xE5 ; 229 2f02c: 09 f4 brne .+2 ; 0x2f030 2f02e: 39 c1 rjmp .+626 ; 0x2f2a2 2f030: 8e 32 cpi r24, 0x2E ; 46 2f032: 09 f4 brne .+2 ; 0x2f036 2f034: 36 c1 rjmp .+620 ; 0x2f2a2 if (longFilename[0] == '.') continue; 2f036: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f03a: 8e 32 cpi r24, 0x2E ; 46 2f03c: 09 f4 brne .+2 ; 0x2f040 2f03e: 31 c1 rjmp .+610 ; 0x2f2a2 2f040: 63 96 adiw r28, 0x13 ; 19 2f042: 8f ad ldd r24, Y+63 ; 0x3f 2f044: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2f046: 98 2f mov r25, r24 2f048: 9a 70 andi r25, 0x0A ; 10 2f04a: 09 f0 breq .+2 ; 0x2f04e 2f04c: 2a c1 rjmp .+596 ; 0x2f2a2 2f04e: 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; 2f050: 91 e0 ldi r25, 0x01 ; 1 2f052: 80 31 cpi r24, 0x10 ; 16 2f054: 19 f0 breq .+6 ; 0x2f05c 2f056: 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 2f058: 80 31 cpi r24, 0x10 ; 16 2f05a: 31 f4 brne .+12 ; 0x2f068 2f05c: e5 96 adiw r28, 0x35 ; 53 2f05e: ff ad ldd r31, Y+63 ; 0x3f 2f060: e5 97 sbiw r28, 0x35 ; 53 2f062: ff 23 and r31, r31 2f064: 09 f4 brne .+2 ; 0x2f068 2f066: 94 c0 rjmp .+296 ; 0x2f190 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2f068: 90 93 b7 14 sts 0x14B7, r25 ; 0x8014b7 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2f06c: 80 31 cpi r24, 0x10 ; 16 2f06e: 61 f0 breq .+24 ; 0x2f088 2f070: 60 96 adiw r28, 0x10 ; 16 2f072: 8f ad ldd r24, Y+63 ; 0x3f 2f074: 60 97 sbiw r28, 0x10 ; 16 2f076: 87 34 cpi r24, 0x47 ; 71 2f078: 09 f0 breq .+2 ; 0x2f07c 2f07a: 13 c1 rjmp .+550 ; 0x2f2a2 2f07c: 61 96 adiw r28, 0x11 ; 17 2f07e: 8f ad ldd r24, Y+63 ; 0x3f 2f080: 61 97 sbiw r28, 0x11 ; 17 2f082: 8e 37 cpi r24, 0x7E ; 126 2f084: 09 f4 brne .+2 ; 0x2f088 2f086: 0d c1 rjmp .+538 ; 0x2f2a2 switch (lsAction) { 2f088: e5 96 adiw r28, 0x35 ; 53 2f08a: ff ad ldd r31, Y+63 ; 0x3f 2f08c: e5 97 sbiw r28, 0x35 ; 53 2f08e: f1 30 cpi r31, 0x01 ; 1 2f090: 09 f4 brne .+2 ; 0x2f094 2f092: 1b c1 rjmp .+566 ; 0x2f2ca 2f094: f2 30 cpi r31, 0x02 ; 2 2f096: 09 f4 brne .+2 ; 0x2f09a 2f098: 25 c1 rjmp .+586 ; 0x2f2e4 case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2f09a: be 01 movw r22, r28 2f09c: 69 5b subi r22, 0xB9 ; 185 2f09e: 7f 4f sbci r23, 0xFF ; 255 2f0a0: 8d e6 ldi r24, 0x6D ; 109 2f0a2: 94 e1 ldi r25, 0x14 ; 20 2f0a4: 0e 94 32 79 call 0xf264 ; 0xf264 2f0a8: c4 01 movw r24, r8 2f0aa: 0e 94 d0 89 call 0x113a0 ; 0x113a0 2f0ae: 8d e6 ldi r24, 0x6D ; 109 2f0b0: 94 e1 ldi r25, 0x14 ; 20 2f0b2: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2f0b6: 80 e2 ldi r24, 0x20 ; 32 2f0b8: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2f0bc: a7 96 adiw r28, 0x27 ; 39 2f0be: 6c ad ldd r22, Y+60 ; 0x3c 2f0c0: 7d ad ldd r23, Y+61 ; 0x3d 2f0c2: 8e ad ldd r24, Y+62 ; 0x3e 2f0c4: 9f ad ldd r25, Y+63 ; 0x3f 2f0c6: a7 97 sbiw r28, 0x27 ; 39 2f0c8: 4a e0 ldi r20, 0x0A ; 10 2f0ca: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2f0ce: 51 fe sbrs r5, 1 2f0d0: 45 c0 rjmp .+138 ; 0x2f15c { crmodDate = p.lastWriteDate; 2f0d2: a1 96 adiw r28, 0x21 ; 33 2f0d4: 2e ad ldd r18, Y+62 ; 0x3e 2f0d6: 3f ad ldd r19, Y+63 ; 0x3f 2f0d8: a1 97 sbiw r28, 0x21 ; 33 2f0da: 30 93 7d 14 sts 0x147D, r19 ; 0x80147d 2f0de: 20 93 7c 14 sts 0x147C, r18 ; 0x80147c crmodTime = p.lastWriteTime; 2f0e2: 6f 96 adiw r28, 0x1f ; 31 2f0e4: 4e ad ldd r20, Y+62 ; 0x3e 2f0e6: 5f ad ldd r21, Y+63 ; 0x3f 2f0e8: 6f 97 sbiw r28, 0x1f ; 31 2f0ea: 50 93 7b 14 sts 0x147B, r21 ; 0x80147b 2f0ee: 40 93 7a 14 sts 0x147A, r20 ; 0x80147a if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2f0f2: 69 96 adiw r28, 0x19 ; 25 2f0f4: 8e ad ldd r24, Y+62 ; 0x3e 2f0f6: 9f ad ldd r25, Y+63 ; 0x3f 2f0f8: 69 97 sbiw r28, 0x19 ; 25 2f0fa: 28 17 cp r18, r24 2f0fc: 39 07 cpc r19, r25 2f0fe: 50 f0 brcs .+20 ; 0x2f114 2f100: 28 17 cp r18, r24 2f102: 39 07 cpc r19, r25 2f104: 99 f4 brne .+38 ; 0x2f12c 2f106: 67 96 adiw r28, 0x17 ; 23 2f108: 2e ad ldd r18, Y+62 ; 0x3e 2f10a: 3f ad ldd r19, Y+63 ; 0x3f 2f10c: 67 97 sbiw r28, 0x17 ; 23 2f10e: 42 17 cp r20, r18 2f110: 53 07 cpc r21, r19 2f112: 60 f4 brcc .+24 ; 0x2f12c crmodDate = p.creationDate; 2f114: 90 93 7d 14 sts 0x147D, r25 ; 0x80147d 2f118: 80 93 7c 14 sts 0x147C, r24 ; 0x80147c crmodTime = p.creationTime; 2f11c: 67 96 adiw r28, 0x17 ; 23 2f11e: 8e ad ldd r24, Y+62 ; 0x3e 2f120: 9f ad ldd r25, Y+63 ; 0x3f 2f122: 67 97 sbiw r28, 0x17 ; 23 2f124: 90 93 7b 14 sts 0x147B, r25 ; 0x80147b 2f128: 80 93 7a 14 sts 0x147A, r24 ; 0x80147a } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2f12c: 80 91 7d 14 lds r24, 0x147D ; 0x80147d 2f130: 8f 93 push r24 2f132: 80 91 7c 14 lds r24, 0x147C ; 0x80147c 2f136: 8f 93 push r24 2f138: 80 91 7b 14 lds r24, 0x147B ; 0x80147b 2f13c: 8f 93 push r24 2f13e: 80 91 7a 14 lds r24, 0x147A ; 0x80147a 2f142: 8f 93 push r24 2f144: 2d e6 ldi r18, 0x6D ; 109 2f146: 3a ea ldi r19, 0xAA ; 170 2f148: 3f 93 push r19 2f14a: 2f 93 push r18 2f14c: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 2f150: 0f 90 pop r0 2f152: 0f 90 pop r0 2f154: 0f 90 pop r0 2f156: 0f 90 pop r0 2f158: 0f 90 pop r0 2f15a: 0f 90 pop r0 } if (lsParams.LFN) 2f15c: 11 23 and r17, r17 2f15e: 99 f0 breq .+38 ; 0x2f186 printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f160: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f164: 88 23 and r24, r24 2f166: 09 f4 brne .+2 ; 0x2f16a 2f168: ba c0 rjmp .+372 ; 0x2f2de 2f16a: 82 e8 ldi r24, 0x82 ; 130 2f16c: 94 e1 ldi r25, 0x14 ; 20 2f16e: 9f 93 push r25 2f170: 8f 93 push r24 2f172: e7 e6 ldi r30, 0x67 ; 103 2f174: fa ea ldi r31, 0xAA ; 170 2f176: ff 93 push r31 2f178: ef 93 push r30 2f17a: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 2f17e: 0f 90 pop r0 2f180: 0f 90 pop r0 2f182: 0f 90 pop r0 2f184: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2f186: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 manage_heater(); 2f18a: 0f 94 66 4d call 0x29acc ; 0x29acc 2f18e: 89 c0 rjmp .+274 ; 0x2f2a2 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2f190: 2d b7 in r18, 0x3d ; 61 2f192: 3e b7 in r19, 0x3e ; 62 2f194: e7 96 adiw r28, 0x37 ; 55 2f196: 3f af std Y+63, r19 ; 0x3f 2f198: 2e af std Y+62, r18 ; 0x3e 2f19a: 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); 2f19c: be 01 movw r22, r28 2f19e: 69 5b subi r22, 0xB9 ; 185 2f1a0: 7f 4f sbci r23, 0xFF ; 255 2f1a2: c5 01 movw r24, r10 2f1a4: 0e 94 32 79 call 0xf264 ; 0xf264 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2f1a8: f4 01 movw r30, r8 2f1aa: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2f1ac: 88 23 and r24, r24 2f1ae: 09 f4 brne .+2 ; 0x2f1b2 2f1b0: 86 c0 rjmp .+268 ; 0x2f2be 2f1b2: 01 90 ld r0, Z+ 2f1b4: 00 20 and r0, r0 2f1b6: e9 f7 brne .-6 ; 0x2f1b2 2f1b8: 31 97 sbiw r30, 0x01 ; 1 2f1ba: e8 19 sub r30, r8 2f1bc: f9 09 sbc r31, r9 2f1be: d5 01 movw r26, r10 2f1c0: 0d 90 ld r0, X+ 2f1c2: 00 20 and r0, r0 2f1c4: e9 f7 brne .-6 ; 0x2f1c0 2f1c6: ea 19 sub r30, r10 2f1c8: fb 09 sbc r31, r11 char path[len]; 2f1ca: ea 0f add r30, r26 2f1cc: fb 1f adc r31, r27 2f1ce: 31 96 adiw r30, 0x01 ; 1 2f1d0: 2d b7 in r18, 0x3d ; 61 2f1d2: 3e b7 in r19, 0x3e ; 62 2f1d4: 2e 1b sub r18, r30 2f1d6: 3f 0b sbc r19, r31 2f1d8: 0f b6 in r0, 0x3f ; 63 2f1da: f8 94 cli 2f1dc: 3e bf out 0x3e, r19 ; 62 2f1de: 0f be out 0x3f, r0 ; 63 2f1e0: 2d bf out 0x3d, r18 ; 61 2f1e2: ed b7 in r30, 0x3d ; 61 2f1e4: fe b7 in r31, 0x3e ; 62 2f1e6: 31 96 adiw r30, 0x01 ; 1 2f1e8: 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 2f1ea: 6c e1 ldi r22, 0x1C ; 28 2f1ec: 73 e0 ldi r23, 0x03 ; 3 2f1ee: 81 11 cpse r24, r1 2f1f0: b4 01 movw r22, r8 2f1f2: c7 01 movw r24, r14 2f1f4: 0f 94 7a e3 call 0x3c6f4 ; 0x3c6f4 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f1f8: b5 01 movw r22, r10 2f1fa: c7 01 movw r24, r14 2f1fc: 0f 94 5b e3 call 0x3c6b6 ; 0x3c6b6 strcat(path, "/"); // 1 character 2f200: 6c e1 ldi r22, 0x1C ; 28 2f202: 73 e0 ldi r23, 0x03 ; 3 2f204: c7 01 movw r24, r14 2f206: 0f 94 5b e3 call 0x3c6b6 ; 0x3c6b6 // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f20a: 11 23 and r17, r17 2f20c: a9 f0 breq .+42 ; 0x2f238 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f20e: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f212: 81 11 cpse r24, r1 2f214: 57 c0 rjmp .+174 ; 0x2f2c4 2f216: c5 01 movw r24, r10 2f218: 9f 93 push r25 2f21a: 8f 93 push r24 2f21c: ff 92 push r15 2f21e: ef 92 push r14 2f220: 2c e7 ldi r18, 0x7C ; 124 2f222: 3a ea ldi r19, 0xAA ; 170 2f224: 3f 93 push r19 2f226: 2f 93 push r18 2f228: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 2f22c: 0f 90 pop r0 2f22e: 0f 90 pop r0 2f230: 0f 90 pop r0 2f232: 0f 90 pop r0 2f234: 0f 90 pop r0 2f236: 0f 90 pop r0 2f238: 1c a2 std Y+36, r1 ; 0x24 2f23a: 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); 2f23c: 21 e0 ldi r18, 0x01 ; 1 2f23e: a5 01 movw r20, r10 2f240: b6 01 movw r22, r12 2f242: ce 01 movw r24, r28 2f244: 84 96 adiw r24, 0x24 ; 36 2f246: 0f 94 bc d6 call 0x3ad78 ; 0x3ad78 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); 2f24a: 83 e2 ldi r24, 0x23 ; 35 2f24c: fe 01 movw r30, r28 2f24e: b4 96 adiw r30, 0x24 ; 36 2f250: de 01 movw r26, r28 2f252: 11 96 adiw r26, 0x01 ; 1 2f254: 01 90 ld r0, Z+ 2f256: 0d 92 st X+, r0 2f258: 8a 95 dec r24 2f25a: e1 f7 brne .-8 ; 0x2f254 2f25c: 10 fb bst r17, 0 2f25e: 50 f8 bld r5, 0 2f260: 05 2d mov r16, r5 2f262: 20 e0 ldi r18, 0x00 ; 0 2f264: 50 e0 ldi r21, 0x00 ; 0 2f266: 40 e0 ldi r20, 0x00 ; 0 2f268: be 01 movw r22, r28 2f26a: 6f 5f subi r22, 0xFF ; 255 2f26c: 7f 4f sbci r23, 0xFF ; 255 2f26e: c7 01 movw r24, r14 2f270: 0f 94 ae 77 call 0x2ef5c ; 0x2ef5c 2f274: ce 01 movw r24, r28 2f276: 01 96 adiw r24, 0x01 ; 1 2f278: 0e 94 4d 79 call 0xf29a ; 0xf29a // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f27c: 11 23 and r17, r17 2f27e: 21 f0 breq .+8 ; 0x2f288 puts_P(PSTR("DIR_EXIT")); 2f280: 83 e7 ldi r24, 0x73 ; 115 2f282: 9a ea ldi r25, 0xAA ; 170 2f284: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 2f288: ce 01 movw r24, r28 2f28a: 84 96 adiw r24, 0x24 ; 36 2f28c: 0e 94 4d 79 call 0xf29a ; 0xf29a 2f290: e7 96 adiw r28, 0x37 ; 55 2f292: ee ad ldd r30, Y+62 ; 0x3e 2f294: ff ad ldd r31, Y+63 ; 0x3f 2f296: e7 97 sbiw r28, 0x37 ; 55 2f298: 0f b6 in r0, 0x3f ; 63 2f29a: f8 94 cli 2f29c: fe bf out 0x3e, r31 ; 62 2f29e: 0f be out 0x3f, r0 ; 63 2f2a0: 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()) { 2f2a2: f6 01 movw r30, r12 2f2a4: 80 85 ldd r24, Z+8 ; 0x08 2f2a6: 91 85 ldd r25, Z+9 ; 0x09 2f2a8: a2 85 ldd r26, Z+10 ; 0x0a 2f2aa: b3 85 ldd r27, Z+11 ; 0x0b 2f2ac: 80 93 7e 14 sts 0x147E, r24 ; 0x80147e 2f2b0: 90 93 7f 14 sts 0x147F, r25 ; 0x80147f 2f2b4: a0 93 80 14 sts 0x1480, r26 ; 0x801480 2f2b8: b0 93 81 14 sts 0x1481, r27 ; 0x801481 2f2bc: 8c ce rjmp .-744 ; 0x2efd6 // 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; 2f2be: e1 e0 ldi r30, 0x01 ; 1 2f2c0: f0 e0 ldi r31, 0x00 ; 0 2f2c2: 7d cf rjmp .-262 ; 0x2f1be // 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); 2f2c4: 82 e8 ldi r24, 0x82 ; 130 2f2c6: 94 e1 ldi r25, 0x14 ; 20 2f2c8: a7 cf rjmp .-178 ; 0x2f218 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f2ca: 80 91 83 17 lds r24, 0x1783 ; 0x801783 2f2ce: 90 91 84 17 lds r25, 0x1784 ; 0x801784 2f2d2: 01 96 adiw r24, 0x01 ; 1 2f2d4: 90 93 84 17 sts 0x1784, r25 ; 0x801784 2f2d8: 80 93 83 17 sts 0x1783, r24 ; 0x801783 2f2dc: e2 cf rjmp .-60 ; 0x2f2a2 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f2de: 8d e6 ldi r24, 0x6D ; 109 2f2e0: 94 e1 ldi r25, 0x14 ; 20 2f2e2: 45 cf rjmp .-374 ; 0x2f16e manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f2e4: be 01 movw r22, r28 2f2e6: 69 5b subi r22, 0xB9 ; 185 2f2e8: 7f 4f sbci r23, 0xFF ; 255 2f2ea: 8d e6 ldi r24, 0x6D ; 109 2f2ec: 94 e1 ldi r25, 0x14 ; 20 2f2ee: 0e 94 32 79 call 0xf264 ; 0xf264 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f2f2: a1 96 adiw r28, 0x21 ; 33 2f2f4: 2e ad ldd r18, Y+62 ; 0x3e 2f2f6: 3f ad ldd r19, Y+63 ; 0x3f 2f2f8: a1 97 sbiw r28, 0x21 ; 33 2f2fa: 30 93 7d 14 sts 0x147D, r19 ; 0x80147d 2f2fe: 20 93 7c 14 sts 0x147C, r18 ; 0x80147c crmodTime = p.lastWriteTime; 2f302: 6f 96 adiw r28, 0x1f ; 31 2f304: 4e ad ldd r20, Y+62 ; 0x3e 2f306: 5f ad ldd r21, Y+63 ; 0x3f 2f308: 6f 97 sbiw r28, 0x1f ; 31 2f30a: 50 93 7b 14 sts 0x147B, r21 ; 0x80147b 2f30e: 40 93 7a 14 sts 0x147A, r20 ; 0x80147a // 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 ) ){ 2f312: 69 96 adiw r28, 0x19 ; 25 2f314: 8e ad ldd r24, Y+62 ; 0x3e 2f316: 9f ad ldd r25, Y+63 ; 0x3f 2f318: 69 97 sbiw r28, 0x19 ; 25 2f31a: 28 17 cp r18, r24 2f31c: 39 07 cpc r19, r25 2f31e: 50 f0 brcs .+20 ; 0x2f334 2f320: 28 17 cp r18, r24 2f322: 39 07 cpc r19, r25 2f324: 99 f4 brne .+38 ; 0x2f34c 2f326: 67 96 adiw r28, 0x17 ; 23 2f328: 2e ad ldd r18, Y+62 ; 0x3e 2f32a: 3f ad ldd r19, Y+63 ; 0x3f 2f32c: 67 97 sbiw r28, 0x17 ; 23 2f32e: 42 17 cp r20, r18 2f330: 53 07 cpc r21, r19 2f332: 60 f4 brcc .+24 ; 0x2f34c crmodDate = p.creationDate; 2f334: 90 93 7d 14 sts 0x147D, r25 ; 0x80147d 2f338: 80 93 7c 14 sts 0x147C, r24 ; 0x80147c crmodTime = p.creationTime; 2f33c: 67 96 adiw r28, 0x17 ; 23 2f33e: 8e ad ldd r24, Y+62 ; 0x3e 2f340: 9f ad ldd r25, Y+63 ; 0x3f 2f342: 67 97 sbiw r28, 0x17 ; 23 2f344: 90 93 7b 14 sts 0x147B, r25 ; 0x80147b 2f348: 80 93 7a 14 sts 0x147A, r24 ; 0x80147a } //writeDate = p.lastAccessDate; if (match != NULL) { 2f34c: 61 14 cp r6, r1 2f34e: 71 04 cpc r7, r1 2f350: 59 f1 breq .+86 ; 0x2f3a8 if (strcasecmp(match, filename) == 0) return; 2f352: 6d e6 ldi r22, 0x6D ; 109 2f354: 74 e1 ldi r23, 0x14 ; 20 2f356: c3 01 movw r24, r6 2f358: 0f 94 48 e3 call 0x3c690 ; 0x3c690 2f35c: 89 2b or r24, r25 2f35e: 59 f5 brne .+86 ; 0x2f3b6 // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f360: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 2f364: 81 50 subi r24, 0x01 ; 1 2f366: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 cnt++; break; } } } // while readDir } 2f36a: 0f b6 in r0, 0x3f ; 63 2f36c: f8 94 cli 2f36e: 3e be out 0x3e, r3 ; 62 2f370: 0f be out 0x3f, r0 ; 63 2f372: 2d be out 0x3d, r2 ; 61 2f374: ca 58 subi r28, 0x8A ; 138 2f376: df 4f sbci r29, 0xFF ; 255 2f378: 0f b6 in r0, 0x3f ; 63 2f37a: f8 94 cli 2f37c: de bf out 0x3e, r29 ; 62 2f37e: 0f be out 0x3f, r0 ; 63 2f380: cd bf out 0x3d, r28 ; 61 2f382: df 91 pop r29 2f384: cf 91 pop r28 2f386: 1f 91 pop r17 2f388: 0f 91 pop r16 2f38a: ff 90 pop r15 2f38c: ef 90 pop r14 2f38e: df 90 pop r13 2f390: cf 90 pop r12 2f392: bf 90 pop r11 2f394: af 90 pop r10 2f396: 9f 90 pop r9 2f398: 8f 90 pop r8 2f39a: 7f 90 pop r7 2f39c: 6f 90 pop r6 2f39e: 5f 90 pop r5 2f3a0: 4f 90 pop r4 2f3a2: 3f 90 pop r3 2f3a4: 2f 90 pop r2 2f3a6: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f3a8: 80 91 83 17 lds r24, 0x1783 ; 0x801783 2f3ac: 90 91 84 17 lds r25, 0x1784 ; 0x801784 2f3b0: 48 16 cp r4, r24 2f3b2: 19 06 cpc r1, r25 2f3b4: a9 f2 breq .-86 ; 0x2f360 cnt++; 2f3b6: 43 94 inc r4 2f3b8: 74 cf rjmp .-280 ; 0x2f2a2 0002f3ba : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f3ba: cf 92 push r12 2f3bc: df 92 push r13 2f3be: ef 92 push r14 2f3c0: ff 92 push r15 2f3c2: 0f 93 push r16 2f3c4: cf 93 push r28 2f3c6: df 93 push r29 2f3c8: cd b7 in r28, 0x3d ; 61 2f3ca: de b7 in r29, 0x3e ; 62 2f3cc: a3 97 sbiw r28, 0x23 ; 35 2f3ce: 0f b6 in r0, 0x3f ; 63 2f3d0: f8 94 cli 2f3d2: de bf out 0x3e, r29 ; 62 2f3d4: 0f be out 0x3f, r0 ; 63 2f3d6: cd bf out 0x3d, r28 ; 61 2f3d8: 6c 01 movw r12, r24 { curDir=&workDir; 2f3da: 84 e1 ldi r24, 0x14 ; 20 2f3dc: e8 2e mov r14, r24 2f3de: 85 e1 ldi r24, 0x15 ; 21 2f3e0: f8 2e mov r15, r24 2f3e2: 86 e1 ldi r24, 0x16 ; 22 2f3e4: 95 e1 ldi r25, 0x15 ; 21 2f3e6: d7 01 movw r26, r14 2f3e8: 8d 93 st X+, r24 2f3ea: 9c 93 st X, r25 nrFiles=nr; 2f3ec: 10 92 84 17 sts 0x1784, r1 ; 0x801784 2f3f0: 10 92 83 17 sts 0x1783, r1 ; 0x801783 curDir->rewind(); 2f3f4: 0e 94 48 79 call 0xf290 ; 0xf290 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f3f8: 00 e0 ldi r16, 0x00 ; 0 2f3fa: 0e 7f andi r16, 0xFE ; 254 2f3fc: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f3fe: d7 01 movw r26, r14 2f400: ed 91 ld r30, X+ 2f402: fc 91 ld r31, X 2f404: 83 e2 ldi r24, 0x23 ; 35 2f406: de 01 movw r26, r28 2f408: 11 96 adiw r26, 0x01 ; 1 2f40a: 01 90 ld r0, Z+ 2f40c: 0d 92 st X+, r0 2f40e: 8a 95 dec r24 2f410: e1 f7 brne .-8 ; 0x2f40a 2f412: 22 e0 ldi r18, 0x02 ; 2 2f414: a6 01 movw r20, r12 2f416: be 01 movw r22, r28 2f418: 6f 5f subi r22, 0xFF ; 255 2f41a: 7f 4f sbci r23, 0xFF ; 255 2f41c: 81 ef ldi r24, 0xF1 ; 241 2f41e: 92 e0 ldi r25, 0x02 ; 2 2f420: 0f 94 ae 77 call 0x2ef5c ; 0x2ef5c 2f424: ce 01 movw r24, r28 2f426: 01 96 adiw r24, 0x01 ; 1 2f428: 0e 94 4d 79 call 0xf29a ; 0xf29a } 2f42c: a3 96 adiw r28, 0x23 ; 35 2f42e: 0f b6 in r0, 0x3f ; 63 2f430: f8 94 cli 2f432: de bf out 0x3e, r29 ; 62 2f434: 0f be out 0x3f, r0 ; 63 2f436: cd bf out 0x3d, r28 ; 61 2f438: df 91 pop r29 2f43a: cf 91 pop r28 2f43c: 0f 91 pop r16 2f43e: ff 90 pop r15 2f440: ef 90 pop r14 2f442: df 90 pop r13 2f444: cf 90 pop r12 2f446: 08 95 ret 0002f448 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f448: ef 92 push r14 2f44a: ff 92 push r15 2f44c: 0f 93 push r16 2f44e: cf 93 push r28 2f450: df 93 push r29 2f452: cd b7 in r28, 0x3d ; 61 2f454: de b7 in r29, 0x3e ; 62 2f456: a3 97 sbiw r28, 0x23 ; 35 2f458: 0f b6 in r0, 0x3f ; 63 2f45a: f8 94 cli 2f45c: de bf out 0x3e, r29 ; 62 2f45e: 0f be out 0x3f, r0 ; 63 2f460: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f462: 24 e1 ldi r18, 0x14 ; 20 2f464: e2 2e mov r14, r18 2f466: 25 e1 ldi r18, 0x15 ; 21 2f468: f2 2e mov r15, r18 2f46a: 26 e1 ldi r18, 0x16 ; 22 2f46c: 35 e1 ldi r19, 0x15 ; 21 2f46e: d7 01 movw r26, r14 2f470: 2d 93 st X+, r18 2f472: 3c 93 st X, r19 nrFiles = 0; 2f474: 10 92 84 17 sts 0x1784, r1 ; 0x801784 2f478: 10 92 83 17 sts 0x1783, r1 ; 0x801783 curDir->seekSet((uint32_t)entry << 5); 2f47c: b0 e0 ldi r27, 0x00 ; 0 2f47e: a0 e0 ldi r26, 0x00 ; 0 2f480: ac 01 movw r20, r24 2f482: bd 01 movw r22, r26 2f484: e5 e0 ldi r30, 0x05 ; 5 2f486: 44 0f add r20, r20 2f488: 55 1f adc r21, r21 2f48a: 66 1f adc r22, r22 2f48c: 77 1f adc r23, r23 2f48e: ea 95 dec r30 2f490: d1 f7 brne .-12 ; 0x2f486 2f492: c9 01 movw r24, r18 2f494: 0f 94 2a 6d call 0x2da54 ; 0x2da54 2f498: 00 e0 ldi r16, 0x00 ; 0 2f49a: 0e 7f andi r16, 0xFE ; 254 2f49c: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f49e: d7 01 movw r26, r14 2f4a0: ed 91 ld r30, X+ 2f4a2: fc 91 ld r31, X 2f4a4: 83 e2 ldi r24, 0x23 ; 35 2f4a6: de 01 movw r26, r28 2f4a8: 11 96 adiw r26, 0x01 ; 1 2f4aa: 01 90 ld r0, Z+ 2f4ac: 0d 92 st X+, r0 2f4ae: 8a 95 dec r24 2f4b0: e1 f7 brne .-8 ; 0x2f4aa 2f4b2: 22 e0 ldi r18, 0x02 ; 2 2f4b4: 50 e0 ldi r21, 0x00 ; 0 2f4b6: 40 e0 ldi r20, 0x00 ; 0 2f4b8: be 01 movw r22, r28 2f4ba: 6f 5f subi r22, 0xFF ; 255 2f4bc: 7f 4f sbci r23, 0xFF ; 255 2f4be: 81 ef ldi r24, 0xF1 ; 241 2f4c0: 92 e0 ldi r25, 0x02 ; 2 2f4c2: 0f 94 ae 77 call 0x2ef5c ; 0x2ef5c 2f4c6: ce 01 movw r24, r28 2f4c8: 01 96 adiw r24, 0x01 ; 1 2f4ca: 0e 94 4d 79 call 0xf29a ; 0xf29a } 2f4ce: a3 96 adiw r28, 0x23 ; 35 2f4d0: 0f b6 in r0, 0x3f ; 63 2f4d2: f8 94 cli 2f4d4: de bf out 0x3e, r29 ; 62 2f4d6: 0f be out 0x3f, r0 ; 63 2f4d8: cd bf out 0x3d, r28 ; 61 2f4da: df 91 pop r29 2f4dc: cf 91 pop r28 2f4de: 0f 91 pop r16 2f4e0: ff 90 pop r15 2f4e2: ef 90 pop r14 2f4e4: 08 95 ret 0002f4e6 : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f4e6: cf 92 push r12 2f4e8: df 92 push r13 2f4ea: ef 92 push r14 2f4ec: ff 92 push r15 2f4ee: 0f 93 push r16 2f4f0: cf 93 push r28 2f4f2: df 93 push r29 2f4f4: cd b7 in r28, 0x3d ; 61 2f4f6: de b7 in r29, 0x3e ; 62 2f4f8: a3 97 sbiw r28, 0x23 ; 35 2f4fa: 0f b6 in r0, 0x3f ; 63 2f4fc: f8 94 cli 2f4fe: de bf out 0x3e, r29 ; 62 2f500: 0f be out 0x3f, r0 ; 63 2f502: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f504: 84 e1 ldi r24, 0x14 ; 20 2f506: c8 2e mov r12, r24 2f508: 85 e1 ldi r24, 0x15 ; 21 2f50a: d8 2e mov r13, r24 2f50c: 86 e1 ldi r24, 0x16 ; 22 2f50e: 95 e1 ldi r25, 0x15 ; 21 2f510: d6 01 movw r26, r12 2f512: 8d 93 st X+, r24 2f514: 9c 93 st X, r25 nrFiles=0; 2f516: 23 e8 ldi r18, 0x83 ; 131 2f518: e2 2e mov r14, r18 2f51a: 27 e1 ldi r18, 0x17 ; 23 2f51c: f2 2e mov r15, r18 2f51e: f7 01 movw r30, r14 2f520: 11 82 std Z+1, r1 ; 0x01 2f522: 10 82 st Z, r1 curDir->rewind(); 2f524: 0e 94 48 79 call 0xf290 ; 0xf290 2f528: 00 e0 ldi r16, 0x00 ; 0 2f52a: 0e 7f andi r16, 0xFE ; 254 2f52c: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f52e: d6 01 movw r26, r12 2f530: ed 91 ld r30, X+ 2f532: fc 91 ld r31, X 2f534: 83 e2 ldi r24, 0x23 ; 35 2f536: de 01 movw r26, r28 2f538: 11 96 adiw r26, 0x01 ; 1 2f53a: 01 90 ld r0, Z+ 2f53c: 0d 92 st X+, r0 2f53e: 8a 95 dec r24 2f540: e1 f7 brne .-8 ; 0x2f53a 2f542: 21 e0 ldi r18, 0x01 ; 1 2f544: 50 e0 ldi r21, 0x00 ; 0 2f546: 40 e0 ldi r20, 0x00 ; 0 2f548: be 01 movw r22, r28 2f54a: 6f 5f subi r22, 0xFF ; 255 2f54c: 7f 4f sbci r23, 0xFF ; 255 2f54e: 81 ef ldi r24, 0xF1 ; 241 2f550: 92 e0 ldi r25, 0x02 ; 2 2f552: 0f 94 ae 77 call 0x2ef5c ; 0x2ef5c 2f556: ce 01 movw r24, r28 2f558: 01 96 adiw r24, 0x01 ; 1 2f55a: 0e 94 4d 79 call 0xf29a ; 0xf29a //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f55e: f7 01 movw r30, r14 2f560: 80 81 ld r24, Z 2f562: 91 81 ldd r25, Z+1 ; 0x01 2f564: a3 96 adiw r28, 0x23 ; 35 2f566: 0f b6 in r0, 0x3f ; 63 2f568: f8 94 cli 2f56a: de bf out 0x3e, r29 ; 62 2f56c: 0f be out 0x3f, r0 ; 63 2f56e: cd bf out 0x3d, r28 ; 61 2f570: df 91 pop r29 2f572: cf 91 pop r28 2f574: 0f 91 pop r16 2f576: ff 90 pop r15 2f578: ef 90 pop r14 2f57a: df 90 pop r13 2f57c: cf 90 pop r12 2f57e: 08 95 ret 0002f580 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f580: cf 93 push r28 2f582: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f584: 8f e2 ldi r24, 0x2F ; 47 2f586: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f58a: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f58c: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f58e: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2f592: c8 17 cp r28, r24 2f594: 60 f4 brcc .+24 ; 0x2f5ae { SERIAL_PROTOCOL(dir_names[i]); 2f596: cd 9f mul r28, r29 2f598: c0 01 movw r24, r0 2f59a: 11 24 eor r1, r1 2f59c: 85 54 subi r24, 0x45 ; 69 2f59e: 9b 4e sbci r25, 0xEB ; 235 2f5a0: 0e 94 d0 89 call 0x113a0 ; 0x113a0 2f5a4: 8f e2 ldi r24, 0x2F ; 47 2f5a6: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f5aa: cf 5f subi r28, 0xFF ; 255 2f5ac: f0 cf rjmp .-32 ; 0x2f58e { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f5ae: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f5b2: 81 11 cpse r24, r1 2f5b4: 06 c0 rjmp .+12 ; 0x2f5c2 2f5b6: 8d e6 ldi r24, 0x6D ; 109 2f5b8: 94 e1 ldi r25, 0x14 ; 20 } 2f5ba: df 91 pop r29 2f5bc: cf 91 pop r28 2f5be: 0c 94 d0 89 jmp 0x113a0 ; 0x113a0 for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f5c2: 82 e8 ldi r24, 0x82 ; 130 2f5c4: 94 e1 ldi r25, 0x14 ; 20 2f5c6: f9 cf rjmp .-14 ; 0x2f5ba 0002f5c8 : 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) { 2f5c8: cf 92 push r12 2f5ca: df 92 push r13 2f5cc: ef 92 push r14 2f5ce: ff 92 push r15 2f5d0: 6b 01 movw r12, r22 2f5d2: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f5d4: 88 ea ldi r24, 0xA8 ; 168 2f5d6: 9c e0 ldi r25, 0x0C ; 12 2f5d8: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 2f5dc: ab 01 movw r20, r22 2f5de: bc 01 movw r22, r24 2f5e0: 4c 0d add r20, r12 2f5e2: 5d 1d adc r21, r13 2f5e4: 6e 1d adc r22, r14 2f5e6: 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); 2f5e8: 88 ea ldi r24, 0xA8 ; 168 2f5ea: 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); } 2f5ec: ff 90 pop r15 2f5ee: ef 90 pop r14 2f5f0: df 90 pop r13 2f5f2: 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); 2f5f4: 0d 94 65 dd jmp 0x3baca ; 0x3baca 0002f5f8 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f5f8: cf 93 push r28 2f5fa: df 93 push r29 2f5fc: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f5fe: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e if (val == EEPROM_EMPTY_VALUE32) { 2f602: 6f 3f cpi r22, 0xFF ; 255 2f604: 2f ef ldi r18, 0xFF ; 255 2f606: 72 07 cpc r23, r18 2f608: 82 07 cpc r24, r18 2f60a: 92 07 cpc r25, r18 2f60c: 49 f4 brne .+18 ; 0x2f620 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); 2f60e: 40 e0 ldi r20, 0x00 ; 0 2f610: 50 e0 ldi r21, 0x00 ; 0 2f612: ba 01 movw r22, r20 2f614: ce 01 movw r24, r28 2f616: 0f 94 65 dd call 0x3baca ; 0x3baca 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; 2f61a: 60 e0 ldi r22, 0x00 ; 0 2f61c: 70 e0 ldi r23, 0x00 ; 0 2f61e: cb 01 movw r24, r22 } return val; } 2f620: df 91 pop r29 2f622: cf 91 pop r28 2f624: 08 95 ret 0002f626 : } // 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; 2f626: e3 e0 ldi r30, 0x03 ; 3 2f628: f7 e1 ldi r31, 0x17 ; 23 2f62a: 40 81 ld r20, Z 2f62c: 51 81 ldd r21, Z+1 ; 0x01 2f62e: 62 81 ldd r22, Z+2 ; 0x02 2f630: 73 81 ldd r23, Z+3 ; 0x03 2f632: 48 0f add r20, r24 2f634: 59 1f adc r21, r25 2f636: 61 1d adc r22, r1 2f638: 71 1d adc r23, r1 2f63a: 40 83 st Z, r20 2f63c: 51 83 std Z+1, r21 ; 0x01 2f63e: 62 83 std Z+2, r22 ; 0x02 2f640: 73 83 std Z+3, r23 ; 0x03 } 2f642: 08 95 ret 0002f644 : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f644: 0f 93 push r16 2f646: 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_ ){ 2f648: 60 91 18 17 lds r22, 0x1718 ; 0x801718 2f64c: 70 91 19 17 lds r23, 0x1719 ; 0x801719 2f650: 80 91 1a 17 lds r24, 0x171A ; 0x80171a 2f654: 90 91 1b 17 lds r25, 0x171B ; 0x80171b 2f658: 00 91 6c 0e lds r16, 0x0E6C ; 0x800e6c 2f65c: 10 91 6d 0e lds r17, 0x0E6D ; 0x800e6d 2f660: 20 91 6e 0e lds r18, 0x0E6E ; 0x800e6e 2f664: 30 91 6f 0e lds r19, 0x0E6F ; 0x800e6f 2f668: 60 17 cp r22, r16 2f66a: 71 07 cpc r23, r17 2f66c: 82 07 cpc r24, r18 2f66e: 93 07 cpc r25, r19 2f670: 39 f1 breq .+78 ; 0x2f6c0 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f672: 40 e0 ldi r20, 0x00 ; 0 2f674: 0f 94 58 6a call 0x2d4b0 ; 0x2d4b0 2f678: 88 23 and r24, r24 2f67a: f9 f0 breq .+62 ; 0x2f6ba return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f67c: 20 91 1c 17 lds r18, 0x171C ; 0x80171c 2f680: 30 91 1d 17 lds r19, 0x171D ; 0x80171d 2f684: 40 91 0c 17 lds r20, 0x170C ; 0x80170c 2f688: 50 91 0d 17 lds r21, 0x170D ; 0x80170d 2f68c: 60 91 0e 17 lds r22, 0x170E ; 0x80170e 2f690: 70 91 0f 17 lds r23, 0x170F ; 0x80170f 2f694: 42 1b sub r20, r18 2f696: 53 0b sbc r21, r19 2f698: 61 09 sbc r22, r1 2f69a: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f69c: 41 30 cpi r20, 0x01 ; 1 2f69e: 92 e0 ldi r25, 0x02 ; 2 2f6a0: 59 07 cpc r21, r25 2f6a2: 61 05 cpc r22, r1 2f6a4: 71 05 cpc r23, r1 2f6a6: 20 f0 brcs .+8 ; 0x2f6b0 2f6a8: 40 e0 ldi r20, 0x00 ; 0 2f6aa: 52 e0 ldi r21, 0x02 ; 2 2f6ac: 60 e0 ldi r22, 0x00 ; 0 2f6ae: 70 e0 ldi r23, 0x00 ; 0 2f6b0: 48 58 subi r20, 0x88 ; 136 2f6b2: 51 4f sbci r21, 0xF1 ; 241 2f6b4: 9a e0 ldi r25, 0x0A ; 10 2f6b6: fa 01 movw r30, r20 2f6b8: 90 83 st Z, r25 } return true; } 2f6ba: 1f 91 pop r17 2f6bc: 0f 91 pop r16 2f6be: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f6c0: 81 e0 ldi r24, 0x01 ; 1 2f6c2: fb cf rjmp .-10 ; 0x2f6ba 0002f6c4 : voltReady = true; } uint16_t IR_sensor_analog::getVoltRaw() { uint16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = voltRaw; } 2f6c4: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f6c6: f8 94 cli 2f6c8: 80 91 90 17 lds r24, 0x1790 ; 0x801790 2f6cc: 90 91 91 17 lds r25, 0x1791 ; 0x801791 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f6d0: 2f bf out 0x3f, r18 ; 63 return ret; } 2f6d2: 08 95 ret 0002f6d4 : const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { 2f6d4: 80 91 8e 17 lds r24, 0x178E ; 0x80178e 2f6d8: 88 23 and r24, r24 2f6da: 29 f0 breq .+10 ; 0x2f6e6 2f6dc: 81 30 cpi r24, 0x01 ; 1 2f6de: 39 f0 breq .+14 ; 0x2f6ee 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); 2f6e0: 8e e0 ldi r24, 0x0E ; 14 2f6e2: 9e e5 ldi r25, 0x5E ; 94 2f6e4: 02 c0 rjmp .+4 ; 0x2f6ea } const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { case SensorRevision::_Old: return _T(MSG_IR_03_OR_OLDER); 2f6e6: 8e e2 ldi r24, 0x2E ; 46 2f6e8: 9e e5 ldi r25, 0x5E ; 94 case SensorRevision::_Rev04: return _T(MSG_IR_04_OR_NEWER); default: return _T(MSG_IR_UNKNOWN); 2f6ea: 0c 94 f2 73 jmp 0xe7e4 ; 0xe7e4 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); 2f6ee: 8e e1 ldi r24, 0x1E ; 30 2f6f0: 9e e5 ldi r25, 0x5E ; 94 2f6f2: fb cf rjmp .-10 ; 0x2f6ea 0002f6f4 : void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } } void IR_sensor_analog::IR_ANALOG_Check(SensorRevision isVersion, SensorRevision switchTo) { 2f6f4: cf 93 push r28 bool bTemp = (!CHECK_ALL_HEATERS); 2f6f6: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 2f6fa: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 2f6fe: 23 2b or r18, r19 2f700: b9 f4 brne .+46 ; 0x2f730 2f702: 20 91 68 0e lds r18, 0x0E68 ; 0x800e68 2f706: 30 91 69 0e lds r19, 0x0E69 ; 0x800e69 2f70a: 23 2b or r18, r19 2f70c: 89 f4 brne .+34 ; 0x2f730 bTemp = bTemp && (menu_menu == lcd_status_screen); 2f70e: 20 91 66 0e lds r18, 0x0E66 ; 0x800e66 2f712: 30 91 67 0e lds r19, 0x0E67 ; 0x800e67 2f716: 22 5b subi r18, 0xB2 ; 178 2f718: 3b 43 sbci r19, 0x3B ; 59 2f71a: 51 f4 brne .+20 ; 0x2f730 bTemp = bTemp && ((sensorRevision == isVersion) || (sensorRevision == SensorRevision::_Undef)); 2f71c: 90 91 8e 17 lds r25, 0x178E ; 0x80178e 2f720: 98 17 cp r25, r24 2f722: 11 f0 breq .+4 ; 0x2f728 2f724: 9f 3f cpi r25, 0xFF ; 255 2f726: 21 f4 brne .+8 ; 0x2f730 bTemp = bTemp && (state == State::ready); 2f728: 80 91 85 17 lds r24, 0x1785 ; 0x801785 2f72c: 82 30 cpi r24, 0x02 ; 2 2f72e: 31 f0 breq .+12 ; 0x2f73c default: break; } } } else { nFSCheckCount = 0; 2f730: 10 92 97 17 sts 0x1797, r1 ; 0x801797 2f734: 10 92 96 17 sts 0x1796, r1 ; 0x801796 } } 2f738: cf 91 pop r28 2f73a: 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++; 2f73c: 80 91 96 17 lds r24, 0x1796 ; 0x801796 2f740: 90 91 97 17 lds r25, 0x1797 ; 0x801797 2f744: 01 96 adiw r24, 0x01 ; 1 if (nFSCheckCount > FS_CHECK_COUNT) { 2f746: 85 30 cpi r24, 0x05 ; 5 2f748: 91 05 cpc r25, r1 2f74a: 28 f4 brcc .+10 ; 0x2f756 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++; 2f74c: 90 93 97 17 sts 0x1797, r25 ; 0x801797 2f750: 80 93 96 17 sts 0x1796, r24 ; 0x801796 2f754: f1 cf rjmp .-30 ; 0x2f738 2f756: c6 2f mov r28, r22 if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary 2f758: 10 92 97 17 sts 0x1797, r1 ; 0x801797 2f75c: 10 92 96 17 sts 0x1796, r1 ; 0x801796 return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 2f760: 60 93 8e 17 sts 0x178E, r22 ; 0x80178e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2f764: 88 e4 ldi r24, 0x48 ; 72 2f766: 9d e0 ldi r25, 0x0D ; 13 2f768: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 if (bTemp) { nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); 2f76c: 0f 94 31 14 call 0x22862 ; 0x22862 switch (switchTo) { case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); 2f770: 8e e2 ldi r24, 0x2E ; 46 2f772: 9e e5 ldi r25, 0x5E ; 94 nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); switch (switchTo) { 2f774: c1 30 cpi r28, 0x01 ; 1 2f776: 11 f4 brne .+4 ; 0x2f77c case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); break; case SensorRevision::_Rev04: lcd_setstatuspgm(_T(MSG_IR_04_OR_NEWER)); 2f778: 8e e1 ldi r24, 0x1E ; 30 2f77a: 9e e5 ldi r25, 0x5E ; 94 2f77c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 } } } else { nFSCheckCount = 0; } } 2f780: 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)); 2f782: 0d 94 e0 0a jmp 0x215c0 ; 0x215c0 0002f786 : * 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() { 2f786: 2f 92 push r2 2f788: 3f 92 push r3 2f78a: 4f 92 push r4 2f78c: 5f 92 push r5 2f78e: 6f 92 push r6 2f790: 7f 92 push r7 2f792: 8f 92 push r8 2f794: 9f 92 push r9 2f796: af 92 push r10 2f798: bf 92 push r11 2f79a: cf 92 push r12 2f79c: df 92 push r13 2f79e: ef 92 push r14 2f7a0: ff 92 push r15 2f7a2: 0f 93 push r16 2f7a4: 1f 93 push r17 2f7a6: cf 93 push r28 2f7a8: df 93 push r29 2f7aa: cd b7 in r28, 0x3d ; 61 2f7ac: de b7 in r29, 0x3e ; 62 2f7ae: ed 97 sbiw r28, 0x3d ; 61 2f7b0: 0f b6 in r0, 0x3f ; 63 2f7b2: f8 94 cli 2f7b4: de bf out 0x3e, r29 ; 62 2f7b6: 0f be out 0x3f, r0 ; 63 2f7b8: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2f7ba: 10 92 0d 16 sts 0x160D, r1 ; 0x80160d 2f7be: 10 92 0c 16 sts 0x160C, r1 ; 0x80160c lastSortedFilePosition = 0; 2f7c2: 10 92 d7 16 sts 0x16D7, r1 ; 0x8016d7 2f7c6: 10 92 d6 16 sts 0x16D6, r1 ; 0x8016d6 */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2f7ca: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f7ce: 80 fd sbrc r24, 0 2f7d0: ef c0 rjmp .+478 ; 0x2f9b0 uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2f7d2: 89 e0 ldi r24, 0x09 ; 9 2f7d4: 9f e0 ldi r25, 0x0F ; 15 2f7d6: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 2f7da: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2f7dc: 82 e0 ldi r24, 0x02 ; 2 2f7de: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2f7e2: 0f 94 73 7a call 0x2f4e6 ; 0x2f4e6 2f7e6: 6c 01 movw r12, r24 if (fileCnt > 0) { 2f7e8: 00 97 sbiw r24, 0x00 ; 0 2f7ea: 09 f4 brne .+2 ; 0x2f7ee 2f7ec: de c0 rjmp .+444 ; 0x2f9aa // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2f7ee: 85 36 cpi r24, 0x65 ; 101 2f7f0: 91 05 cpc r25, r1 2f7f2: 60 f0 brcs .+24 ; 0x2f80c if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2f7f4: 32 e0 ldi r19, 0x02 ; 2 2f7f6: 33 16 cp r3, r19 2f7f8: 31 f0 breq .+12 ; 0x2f806 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2f7fa: 8b eb ldi r24, 0xBB ; 187 2f7fc: 9d e5 ldi r25, 0x5D ; 93 2f7fe: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2f802: 0f 94 d6 34 call 0x269ac ; 0x269ac } fileCnt = SDSORT_LIMIT; 2f806: f4 e6 ldi r31, 0x64 ; 100 2f808: cf 2e mov r12, r31 2f80a: d1 2c mov r13, r1 } sort_count = fileCnt; 2f80c: d0 92 0d 16 sts 0x160D, r13 ; 0x80160d 2f810: c0 92 0c 16 sts 0x160C, r12 ; 0x80160c 2f814: 6e e0 ldi r22, 0x0E ; 14 2f816: 66 2e mov r6, r22 2f818: 66 e1 ldi r22, 0x16 ; 22 2f81a: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2f81c: f1 2c mov r15, r1 2f81e: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2f820: 76 e1 ldi r23, 0x16 ; 22 2f822: a7 2e mov r10, r23 2f824: 75 e1 ldi r23, 0x15 ; 21 2f826: b7 2e mov r11, r23 nrFiles = 1; 2f828: 88 24 eor r8, r8 2f82a: 83 94 inc r8 2f82c: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2f82e: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f832: 80 fd sbrc r24, 0 2f834: bd c0 rjmp .+378 ; 0x2f9b0 manage_heater(); 2f836: 0f 94 66 4d call 0x29acc ; 0x29acc if (i == 0) 2f83a: e1 14 cp r14, r1 2f83c: f1 04 cpc r15, r1 2f83e: 09 f0 breq .+2 ; 0x2f842 2f840: d0 c0 rjmp .+416 ; 0x2f9e2 getfilename(0); 2f842: 90 e0 ldi r25, 0x00 ; 0 2f844: 80 e0 ldi r24, 0x00 ; 0 2f846: 0f 94 dd 79 call 0x2f3ba ; 0x2f3ba else getfilename_next(position); sort_entries[i] = position >> 5; 2f84a: 80 91 7e 14 lds r24, 0x147E ; 0x80147e 2f84e: 90 91 7f 14 lds r25, 0x147F ; 0x80147f 2f852: a0 91 80 14 lds r26, 0x1480 ; 0x801480 2f856: b0 91 81 14 lds r27, 0x1481 ; 0x801481 2f85a: 55 e0 ldi r21, 0x05 ; 5 2f85c: b6 95 lsr r27 2f85e: a7 95 ror r26 2f860: 97 95 ror r25 2f862: 87 95 ror r24 2f864: 5a 95 dec r21 2f866: d1 f7 brne .-12 ; 0x2f85c 2f868: f3 01 movw r30, r6 2f86a: 81 93 st Z+, r24 2f86c: 91 93 st Z+, r25 2f86e: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2f870: ff ef ldi r31, 0xFF ; 255 2f872: ef 1a sub r14, r31 2f874: ff 0a sbc r15, r31 2f876: ce 14 cp r12, r14 2f878: df 04 cpc r13, r15 2f87a: c9 f6 brne .-78 ; 0x2f82e else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2f87c: 21 e0 ldi r18, 0x01 ; 1 2f87e: e2 16 cp r14, r18 2f880: f1 04 cpc r15, r1 2f882: 09 f4 brne .+2 ; 0x2f886 2f884: 92 c0 rjmp .+292 ; 0x2f9aa 2f886: 32 e0 ldi r19, 0x02 ; 2 2f888: 33 16 cp r3, r19 2f88a: 09 f4 brne .+2 ; 0x2f88e 2f88c: 8e c0 rjmp .+284 ; 0x2f9aa #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2f88e: 90 93 d7 16 sts 0x16D7, r25 ; 0x8016d7 2f892: 80 93 d6 16 sts 0x16D6, r24 ; 0x8016d6 #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)); 2f896: 8b ea ldi r24, 0xAB ; 171 2f898: 9d e5 ldi r25, 0x5D ; 93 2f89a: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 2f89e: ee 9c mul r14, r14 2f8a0: 90 01 movw r18, r0 2f8a2: ef 9c mul r14, r15 2f8a4: 30 0d add r19, r0 2f8a6: 30 0d add r19, r0 2f8a8: 11 24 eor r1, r1 2f8aa: bc 01 movw r22, r24 2f8ac: c9 01 movw r24, r18 2f8ae: 96 95 lsr r25 2f8b0: 87 95 ror r24 2f8b2: 0f 94 f0 cc call 0x399e0 ; 0x399e0 2f8b6: 30 e1 ldi r19, 0x10 ; 16 2f8b8: a3 2e mov r10, r19 2f8ba: 36 e1 ldi r19, 0x16 ; 22 2f8bc: 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; 2f8be: 91 2c mov r9, r1 2f8c0: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2f8c2: cc 24 eor r12, r12 2f8c4: c3 94 inc r12 2f8c6: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2f8c8: c4 01 movw r24, r8 2f8ca: 0f 94 c1 cc call 0x39982 ; 0x39982 counter += i; 2f8ce: 8c 0c add r8, r12 2f8d0: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2f8d2: f5 01 movw r30, r10 2f8d4: 01 90 ld r0, Z+ 2f8d6: f0 81 ld r31, Z 2f8d8: e0 2d mov r30, r0 2f8da: f9 af std Y+57, r31 ; 0x39 2f8dc: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2f8de: cf 01 movw r24, r30 2f8e0: 0f 94 24 7a call 0x2f448 ; 0x2f448 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2f8e4: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f8e8: 6d e6 ldi r22, 0x6D ; 109 2f8ea: 74 e1 ldi r23, 0x14 ; 20 2f8ec: 88 23 and r24, r24 2f8ee: 11 f0 breq .+4 ; 0x2f8f4 2f8f0: 62 e8 ldi r22, 0x82 ; 130 2f8f2: 74 e1 ldi r23, 0x14 ; 20 2f8f4: ce 01 movw r24, r28 2f8f6: 01 96 adiw r24, 0x01 ; 1 2f8f8: 0f 94 7a e3 call 0x3c6f4 ; 0x3c6f4 crmod_date_bckp = crmodDate; 2f8fc: 60 90 7c 14 lds r6, 0x147C ; 0x80147c 2f900: 70 90 7d 14 lds r7, 0x147D ; 0x80147d crmod_time_bckp = crmodTime; 2f904: 20 91 7a 14 lds r18, 0x147A ; 0x80147a 2f908: 30 91 7b 14 lds r19, 0x147B ; 0x80147b 2f90c: 3b af std Y+59, r19 ; 0x3b 2f90e: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2f910: 20 90 b7 14 lds r2, 0x14B7 ; 0x8014b7 2f914: bf aa std Y+55, r11 ; 0x37 2f916: ae aa std Y+54, r10 ; 0x36 2f918: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2f91a: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2f91e: 80 fd sbrc r24, 0 2f920: 47 c0 rjmp .+142 ; 0x2f9b0 printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2f922: 0f 94 66 4d call 0x29acc ; 0x29acc const uint16_t o2 = sort_entries[j - 1]; 2f926: c8 01 movw r24, r16 2f928: 01 97 sbiw r24, 0x01 ; 1 2f92a: 9d af std Y+61, r25 ; 0x3d 2f92c: 8c af std Y+60, r24 ; 0x3c 2f92e: ee a9 ldd r30, Y+54 ; 0x36 2f930: ff a9 ldd r31, Y+55 ; 0x37 2f932: 52 90 ld r5, -Z 2f934: 42 90 ld r4, -Z 2f936: ff ab std Y+55, r31 ; 0x37 2f938: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2f93a: c2 01 movw r24, r4 2f93c: 0f 94 24 7a call 0x2f448 ; 0x2f448 char *name2 = LONGEST_FILENAME; // use the string in-place 2f940: 80 91 82 14 lds r24, 0x1482 ; 0x801482 2f944: 6d e6 ldi r22, 0x6D ; 109 2f946: 74 e1 ldi r23, 0x14 ; 20 2f948: 88 23 and r24, r24 2f94a: 11 f0 breq .+4 ; 0x2f950 2f94c: 62 e8 ldi r22, 0x82 ; 130 2f94e: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2f950: 31 10 cpse r3, r1 2f952: 8a c0 rjmp .+276 ; 0x2fa68 2f954: 80 91 b7 14 lds r24, 0x14B7 ; 0x8014b7 2f958: 28 12 cpse r2, r24 2f95a: 83 c0 rjmp .+262 ; 0x2fa62 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2f95c: 80 91 7c 14 lds r24, 0x147C ; 0x80147c 2f960: 90 91 7d 14 lds r25, 0x147D ; 0x80147d 2f964: 68 16 cp r6, r24 2f966: 79 06 cpc r7, r25 2f968: 09 f0 breq .+2 ; 0x2f96c 2f96a: 6c c0 rjmp .+216 ; 0x2fa44 2f96c: 80 91 7a 14 lds r24, 0x147A ; 0x80147a 2f970: 90 91 7b 14 lds r25, 0x147B ; 0x80147b 2f974: 2a ad ldd r18, Y+58 ; 0x3a 2f976: 3b ad ldd r19, Y+59 ; 0x3b 2f978: 82 17 cp r24, r18 2f97a: 93 07 cpc r25, r19 2f97c: 08 f0 brcs .+2 ; 0x2f980 2f97e: 66 c0 rjmp .+204 ; 0x2fa4c #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2f980: 00 0f add r16, r16 2f982: 11 1f adc r17, r17 2f984: f8 01 movw r30, r16 2f986: e2 5f subi r30, 0xF2 ; 242 2f988: f9 4e sbci r31, 0xE9 ; 233 2f98a: 28 ad ldd r18, Y+56 ; 0x38 2f98c: 39 ad ldd r19, Y+57 ; 0x39 2f98e: 31 83 std Z+1, r19 ; 0x01 2f990: 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){ 2f992: 3f ef ldi r19, 0xFF ; 255 2f994: c3 1a sub r12, r19 2f996: d3 0a sbc r13, r19 2f998: 82 e0 ldi r24, 0x02 ; 2 2f99a: a8 0e add r10, r24 2f99c: b1 1c adc r11, r1 2f99e: ec 14 cp r14, r12 2f9a0: fd 04 cpc r15, r13 2f9a2: 09 f0 breq .+2 ; 0x2f9a6 2f9a4: 91 cf rjmp .-222 ; 0x2f8c8 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2f9a6: 0f 94 e2 cc call 0x399c4 ; 0x399c4 } } KEEPALIVE_STATE(NOT_BUSY); 2f9aa: 81 e0 ldi r24, 0x01 ; 1 2f9ac: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } 2f9b0: ed 96 adiw r28, 0x3d ; 61 2f9b2: 0f b6 in r0, 0x3f ; 63 2f9b4: f8 94 cli 2f9b6: de bf out 0x3e, r29 ; 62 2f9b8: 0f be out 0x3f, r0 ; 63 2f9ba: cd bf out 0x3d, r28 ; 61 2f9bc: df 91 pop r29 2f9be: cf 91 pop r28 2f9c0: 1f 91 pop r17 2f9c2: 0f 91 pop r16 2f9c4: ff 90 pop r15 2f9c6: ef 90 pop r14 2f9c8: df 90 pop r13 2f9ca: cf 90 pop r12 2f9cc: bf 90 pop r11 2f9ce: af 90 pop r10 2f9d0: 9f 90 pop r9 2f9d2: 8f 90 pop r8 2f9d4: 7f 90 pop r7 2f9d6: 6f 90 pop r6 2f9d8: 5f 90 pop r5 2f9da: 4f 90 pop r4 2f9dc: 3f 90 pop r3 2f9de: 2f 90 pop r2 2f9e0: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2f9e2: 40 91 7e 14 lds r20, 0x147E ; 0x80147e 2f9e6: 50 91 7f 14 lds r21, 0x147F ; 0x80147f 2f9ea: 60 91 80 14 lds r22, 0x1480 ; 0x801480 2f9ee: 70 91 81 14 lds r23, 0x1481 ; 0x801481 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2f9f2: b0 92 15 15 sts 0x1515, r11 ; 0x801515 2f9f6: a0 92 14 15 sts 0x1514, r10 ; 0x801514 nrFiles = 1; 2f9fa: 90 92 84 17 sts 0x1784, r9 ; 0x801784 2f9fe: 80 92 83 17 sts 0x1783, r8 ; 0x801783 curDir->seekSet(position); 2fa02: 86 e1 ldi r24, 0x16 ; 22 2fa04: 95 e1 ldi r25, 0x15 ; 21 2fa06: 0f 94 2a 6d call 0x2da54 ; 0x2da54 2fa0a: 1e 7f andi r17, 0xFE ; 254 2fa0c: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2fa0e: e0 91 14 15 lds r30, 0x1514 ; 0x801514 2fa12: f0 91 15 15 lds r31, 0x1515 ; 0x801515 2fa16: 83 e2 ldi r24, 0x23 ; 35 2fa18: de 01 movw r26, r28 2fa1a: 11 96 adiw r26, 0x01 ; 1 2fa1c: 01 90 ld r0, Z+ 2fa1e: 0d 92 st X+, r0 2fa20: 8a 95 dec r24 2fa22: e1 f7 brne .-8 ; 0x2fa1c 2fa24: 01 2f mov r16, r17 2fa26: 22 e0 ldi r18, 0x02 ; 2 2fa28: 50 e0 ldi r21, 0x00 ; 0 2fa2a: 40 e0 ldi r20, 0x00 ; 0 2fa2c: be 01 movw r22, r28 2fa2e: 6f 5f subi r22, 0xFF ; 255 2fa30: 7f 4f sbci r23, 0xFF ; 255 2fa32: 81 ef ldi r24, 0xF1 ; 241 2fa34: 92 e0 ldi r25, 0x02 ; 2 2fa36: 0f 94 ae 77 call 0x2ef5c ; 0x2ef5c 2fa3a: ce 01 movw r24, r28 2fa3c: 01 96 adiw r24, 0x01 ; 1 2fa3e: 0e 94 4d 79 call 0xf29a ; 0xf29a 2fa42: 03 cf rjmp .-506 ; 0x2f84a 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)) 2fa44: 86 15 cp r24, r6 2fa46: 97 05 cpc r25, r7 2fa48: 08 f4 brcc .+2 ; 0x2fa4c 2fa4a: 9a cf rjmp .-204 ; 0x2f980 break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fa4c: ee a9 ldd r30, Y+54 ; 0x36 2fa4e: ff a9 ldd r31, Y+55 ; 0x37 2fa50: 53 82 std Z+3, r5 ; 0x03 2fa52: 42 82 std Z+2, r4 ; 0x02 2fa54: 0c ad ldd r16, Y+60 ; 0x3c 2fa56: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2fa58: 01 15 cp r16, r1 2fa5a: 11 05 cpc r17, r1 2fa5c: 09 f0 breq .+2 ; 0x2fa60 2fa5e: 5d cf rjmp .-326 ; 0x2f91a 2fa60: 8f cf rjmp .-226 ; 0x2f980 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)) 2fa62: 22 20 and r2, r2 2fa64: 99 f3 breq .-26 ; 0x2fa4c 2fa66: 8c cf rjmp .-232 ; 0x2f980 2fa68: 31 e0 ldi r19, 0x01 ; 1 2fa6a: 33 12 cpse r3, r19 2fa6c: ef cf rjmp .-34 ; 0x2fa4c getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fa6e: 80 91 b7 14 lds r24, 0x14B7 ; 0x8014b7 2fa72: 28 12 cpse r2, r24 2fa74: 07 c0 rjmp .+14 ; 0x2fa84 #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fa76: ce 01 movw r24, r28 2fa78: 01 96 adiw r24, 0x01 ; 1 2fa7a: 0f 94 48 e3 call 0x3c690 ; 0x3c690 2fa7e: 97 fd sbrc r25, 7 2fa80: e5 cf rjmp .-54 ; 0x2fa4c 2fa82: 7e cf rjmp .-260 ; 0x2f980 2fa84: 21 10 cpse r2, r1 2fa86: e2 cf rjmp .-60 ; 0x2fa4c 2fa88: 7b cf rjmp .-266 ; 0x2f980 0002fa8a : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fa8a: cf 92 push r12 2fa8c: df 92 push r13 2fa8e: ef 92 push r14 2fa90: ff 92 push r15 2fa92: 0f 93 push r16 2fa94: 1f 93 push r17 2fa96: cf 93 push r28 2fa98: df 93 push r29 2fa9a: cd b7 in r28, 0x3d ; 61 2fa9c: de b7 in r29, 0x3e ; 62 2fa9e: a3 97 sbiw r28, 0x23 ; 35 2faa0: 0f b6 in r0, 0x3f ; 63 2faa2: f8 94 cli 2faa4: de bf out 0x3e, r29 ; 62 2faa6: 0f be out 0x3f, r0 ; 63 2faa8: cd bf out 0x3d, r28 ; 61 2faaa: 7c 01 movw r14, r24 2faac: 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) {} 2faae: 19 82 std Y+1, r1 ; 0x01 2fab0: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fab2: 80 91 19 15 lds r24, 0x1519 ; 0x801519 parent=&workDir; 2fab6: 96 e1 ldi r25, 0x16 ; 22 2fab8: c9 2e mov r12, r25 2faba: 95 e1 ldi r25, 0x15 ; 21 2fabc: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fabe: 81 11 cpse r24, r1 2fac0: 04 c0 rjmp .+8 ; 0x2faca } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fac2: 81 ef ldi r24, 0xF1 ; 241 2fac4: c8 2e mov r12, r24 2fac6: 84 e1 ldi r24, 0x14 ; 20 2fac8: 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); 2faca: 21 e0 ldi r18, 0x01 ; 1 2facc: a7 01 movw r20, r14 2face: b6 01 movw r22, r12 2fad0: ce 01 movw r24, r28 2fad2: 01 96 adiw r24, 0x01 ; 1 2fad4: 0f 94 bc d6 call 0x3ad78 ; 0x3ad78 2fad8: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2fada: 88 23 and r24, r24 2fadc: 21 f1 breq .+72 ; 0x2fb26 2fade: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2fae2: 85 30 cpi r24, 0x05 ; 5 2fae4: 00 f5 brcc .+64 ; 0x2fb26 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fae6: 29 e0 ldi r18, 0x09 ; 9 2fae8: 82 9f mul r24, r18 2faea: c0 01 movw r24, r0 2faec: 11 24 eor r1, r1 2faee: b7 01 movw r22, r14 2faf0: 85 54 subi r24, 0x45 ; 69 2faf2: 9b 4e sbci r25, 0xEB ; 235 2faf4: 0f 94 7a e3 call 0x3c6f4 ; 0x3c6f4 puts(relpath); 2faf8: c7 01 movw r24, r14 2fafa: 0f 94 9e e3 call 0x3c73c ; 0x3c73c if (workDirDepth < MAX_DIR_DEPTH) { 2fafe: 80 91 0b 16 lds r24, 0x160B ; 0x80160b 2fb02: 86 30 cpi r24, 0x06 ; 6 2fb04: 80 f1 brcs .+96 ; 0x2fb66 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2fb06: 83 e2 ldi r24, 0x23 ; 35 2fb08: fe 01 movw r30, r28 2fb0a: 31 96 adiw r30, 0x01 ; 1 2fb0c: a6 e1 ldi r26, 0x16 ; 22 2fb0e: b5 e1 ldi r27, 0x15 ; 21 2fb10: 01 90 ld r0, Z+ 2fb12: 0d 92 st X+, r0 2fb14: 8a 95 dec r24 2fb16: e1 f7 brne .-8 ; 0x2fb10 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fb18: 00 23 and r16, r16 2fb1a: 09 f4 brne .+2 ; 0x2fb1e 2fb1c: 4c c0 rjmp .+152 ; 0x2fbb6 presort(); 2fb1e: 0f 94 c3 7b call 0x2f786 ; 0x2f786 else presort_flag = true; #endif return 1; 2fb22: 10 2f mov r17, r16 2fb24: 0c c0 rjmp .+24 ; 0x2fb3e if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2fb26: 84 e1 ldi r24, 0x14 ; 20 2fb28: 9b ea ldi r25, 0xAB ; 171 2fb2a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2fb2e: 87 eb ldi r24, 0xB7 ; 183 2fb30: 91 e7 ldi r25, 0x71 ; 113 2fb32: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(relpath); 2fb36: c7 01 movw r24, r14 2fb38: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 return 0; 2fb3c: 10 e0 ldi r17, 0x00 ; 0 2fb3e: ce 01 movw r24, r28 2fb40: 01 96 adiw r24, 0x01 ; 1 2fb42: 0e 94 4d 79 call 0xf29a ; 0xf29a else presort_flag = true; #endif return 1; } } 2fb46: 81 2f mov r24, r17 2fb48: a3 96 adiw r28, 0x23 ; 35 2fb4a: 0f b6 in r0, 0x3f ; 63 2fb4c: f8 94 cli 2fb4e: de bf out 0x3e, r29 ; 62 2fb50: 0f be out 0x3f, r0 ; 63 2fb52: cd bf out 0x3d, r28 ; 61 2fb54: df 91 pop r29 2fb56: cf 91 pop r28 2fb58: 1f 91 pop r17 2fb5a: 0f 91 pop r16 2fb5c: ff 90 pop r15 2fb5e: ef 90 pop r14 2fb60: df 90 pop r13 2fb62: cf 90 pop r12 2fb64: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fb66: 8f 5f subi r24, 0xFF ; 255 2fb68: 80 93 0b 16 sts 0x160B, r24 ; 0x80160b workDirParents[d+1] = workDirParents[d]; 2fb6c: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fb6e: 81 50 subi r24, 0x01 ; 1 2fb70: c8 f0 brcs .+50 ; 0x2fba4 workDirParents[d+1] = workDirParents[d]; 2fb72: 28 2f mov r18, r24 2fb74: 30 e0 ldi r19, 0x00 ; 0 2fb76: a9 01 movw r20, r18 2fb78: 4f 5f subi r20, 0xFF ; 255 2fb7a: 5f 4f sbci r21, 0xFF ; 255 2fb7c: 94 9f mul r25, r20 2fb7e: d0 01 movw r26, r0 2fb80: 95 9f mul r25, r21 2fb82: b0 0d add r27, r0 2fb84: 11 24 eor r1, r1 2fb86: a7 5c subi r26, 0xC7 ; 199 2fb88: ba 4e sbci r27, 0xEA ; 234 2fb8a: 92 9f mul r25, r18 2fb8c: f0 01 movw r30, r0 2fb8e: 93 9f mul r25, r19 2fb90: f0 0d add r31, r0 2fb92: 11 24 eor r1, r1 2fb94: e7 5c subi r30, 0xC7 ; 199 2fb96: fa 4e sbci r31, 0xEA ; 234 2fb98: 29 2f mov r18, r25 2fb9a: 01 90 ld r0, Z+ 2fb9c: 0d 92 st X+, r0 2fb9e: 2a 95 dec r18 2fba0: e1 f7 brne .-8 ; 0x2fb9a 2fba2: e5 cf rjmp .-54 ; 0x2fb6e workDirParents[0]=*parent; 2fba4: 83 e2 ldi r24, 0x23 ; 35 2fba6: f6 01 movw r30, r12 2fba8: a9 e3 ldi r26, 0x39 ; 57 2fbaa: b5 e1 ldi r27, 0x15 ; 21 2fbac: 01 90 ld r0, Z+ 2fbae: 0d 92 st X+, r0 2fbb0: 8a 95 dec r24 2fbb2: e1 f7 brne .-8 ; 0x2fbac 2fbb4: a8 cf rjmp .-176 ; 0x2fb06 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2fbb6: 81 e0 ldi r24, 0x01 ; 1 2fbb8: 80 93 ba 14 sts 0x14BA, r24 ; 0x8014ba 2fbbc: c0 cf rjmp .-128 ; 0x2fb3e 0002fbbe : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2fbbe: 93 e2 ldi r25, 0x23 ; 35 2fbc0: e1 ef ldi r30, 0xF1 ; 241 2fbc2: f4 e1 ldi r31, 0x14 ; 20 2fbc4: a6 e1 ldi r26, 0x16 ; 22 2fbc6: b5 e1 ldi r27, 0x15 ; 21 2fbc8: 01 90 ld r0, Z+ 2fbca: 0d 92 st X+, r0 2fbcc: 9a 95 dec r25 2fbce: e1 f7 brne .-8 ; 0x2fbc8 workDirDepth = 0; 2fbd0: 10 92 0b 16 sts 0x160B, r1 ; 0x80160b curDir=&workDir; 2fbd4: 26 e1 ldi r18, 0x16 ; 22 2fbd6: 35 e1 ldi r19, 0x15 ; 21 2fbd8: 30 93 15 15 sts 0x1515, r19 ; 0x801515 2fbdc: 20 93 14 15 sts 0x1514, r18 ; 0x801514 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fbe0: 81 11 cpse r24, r1 presort(); 2fbe2: 0d 94 c3 7b jmp 0x2f786 ; 0x2f786 else presort_flag = true; 2fbe6: 81 e0 ldi r24, 0x01 ; 1 2fbe8: 80 93 ba 14 sts 0x14BA, r24 ; 0x8014ba #endif } 2fbec: 08 95 ret 0002fbee : * * @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) 2fbee: 8f 92 push r8 2fbf0: 9f 92 push r9 2fbf2: af 92 push r10 2fbf4: bf 92 push r11 2fbf6: cf 92 push r12 2fbf8: df 92 push r13 2fbfa: ef 92 push r14 2fbfc: ff 92 push r15 2fbfe: 0f 93 push r16 2fc00: 1f 93 push r17 2fc02: cf 93 push r28 2fc04: df 93 push r29 2fc06: cd b7 in r28, 0x3d ; 61 2fc08: de b7 in r29, 0x3e ; 62 2fc0a: 2d 97 sbiw r28, 0x0d ; 13 2fc0c: 0f b6 in r0, 0x3f ; 63 2fc0e: f8 94 cli 2fc10: de bf out 0x3e, r29 ; 62 2fc12: 0f be out 0x3f, r0 ; 63 2fc14: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2fc16: 21 ef ldi r18, 0xF1 ; 241 2fc18: 34 e1 ldi r19, 0x14 ; 20 2fc1a: 30 93 15 15 sts 0x1515, r19 ; 0x801515 2fc1e: 20 93 14 15 sts 0x1514, r18 ; 0x801514 if (!fileName) 2fc22: dc 01 movw r26, r24 2fc24: ed 91 ld r30, X+ 2fc26: fc 91 ld r31, X 2fc28: 30 97 sbiw r30, 0x00 ; 0 2fc2a: a1 f4 brne .+40 ; 0x2fc54 } else //relative path { curDir = &workDir; } return 1; 2fc2c: 81 e0 ldi r24, 0x01 ; 1 } 2fc2e: 2d 96 adiw r28, 0x0d ; 13 2fc30: 0f b6 in r0, 0x3f ; 63 2fc32: f8 94 cli 2fc34: de bf out 0x3e, r29 ; 62 2fc36: 0f be out 0x3f, r0 ; 63 2fc38: cd bf out 0x3d, r28 ; 61 2fc3a: df 91 pop r29 2fc3c: cf 91 pop r28 2fc3e: 1f 91 pop r17 2fc40: 0f 91 pop r16 2fc42: ff 90 pop r15 2fc44: ef 90 pop r14 2fc46: df 90 pop r13 2fc48: cf 90 pop r12 2fc4a: bf 90 pop r11 2fc4c: af 90 pop r10 2fc4e: 9f 90 pop r9 2fc50: 8f 90 pop r8 2fc52: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2fc54: 20 81 ld r18, Z 2fc56: 2f 32 cpi r18, 0x2F ; 47 2fc58: 09 f0 breq .+2 ; 0x2fc5c 2fc5a: 47 c0 rjmp .+142 ; 0x2fcea 2fc5c: 6c 01 movw r12, r24 { cdroot(false); 2fc5e: 80 e0 ldi r24, 0x00 ; 0 2fc60: 0f 94 df 7d call 0x2fbbe ; 0x2fbbe dirname_start = fileName + 1; 2fc64: f6 01 movw r30, r12 2fc66: 00 81 ld r16, Z 2fc68: 11 81 ldd r17, Z+1 ; 0x01 2fc6a: 0f 5f subi r16, 0xFF ; 255 2fc6c: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2fc6e: 96 e1 ldi r25, 0x16 ; 22 2fc70: 89 2e mov r8, r25 2fc72: 95 e1 ldi r25, 0x15 ; 21 2fc74: 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) 2fc76: d8 01 movw r26, r16 2fc78: 8c 91 ld r24, X 2fc7a: 88 23 and r24, r24 2fc7c: b9 f2 breq .-82 ; 0x2fc2c { dirname_end = strchr(dirname_start, '/'); 2fc7e: 6f e2 ldi r22, 0x2F ; 47 2fc80: 70 e0 ldi r23, 0x00 ; 0 2fc82: c8 01 movw r24, r16 2fc84: 0f 94 66 e3 call 0x3c6cc ; 0x3c6cc 2fc88: 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) 2fc8a: 00 97 sbiw r24, 0x00 ; 0 2fc8c: 51 f1 breq .+84 ; 0x2fce2 2fc8e: 08 17 cp r16, r24 2fc90: 19 07 cpc r17, r25 2fc92: 38 f5 brcc .+78 ; 0x2fce2 { 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); 2fc94: 7c 01 movw r14, r24 2fc96: e0 1a sub r14, r16 2fc98: f1 0a sbc r15, r17 2fc9a: bd e0 ldi r27, 0x0D ; 13 2fc9c: eb 16 cp r14, r27 2fc9e: f1 04 cpc r15, r1 2fca0: 18 f0 brcs .+6 ; 0x2fca8 2fca2: 8c e0 ldi r24, 0x0C ; 12 2fca4: e8 2e mov r14, r24 2fca6: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2fca8: a7 01 movw r20, r14 2fcaa: b8 01 movw r22, r16 2fcac: ce 01 movw r24, r28 2fcae: 01 96 adiw r24, 0x01 ; 1 2fcb0: 0f 94 8f e3 call 0x3c71e ; 0x3c71e subdirname[len] = 0; 2fcb4: e1 e0 ldi r30, 0x01 ; 1 2fcb6: f0 e0 ldi r31, 0x00 ; 0 2fcb8: ec 0f add r30, r28 2fcba: fd 1f adc r31, r29 2fcbc: ee 0d add r30, r14 2fcbe: ff 1d adc r31, r15 2fcc0: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2fcc2: 60 e0 ldi r22, 0x00 ; 0 2fcc4: ce 01 movw r24, r28 2fcc6: 01 96 adiw r24, 0x01 ; 1 2fcc8: 0f 94 45 7d call 0x2fa8a ; 0x2fa8a 2fccc: 88 23 and r24, r24 2fcce: 09 f4 brne .+2 ; 0x2fcd2 2fcd0: ae cf rjmp .-164 ; 0x2fc2e return 0; curDir = &workDir; 2fcd2: 90 92 15 15 sts 0x1515, r9 ; 0x801515 2fcd6: 80 92 14 15 sts 0x1514, r8 ; 0x801514 dirname_start = dirname_end + 1; 2fcda: 85 01 movw r16, r10 2fcdc: 0f 5f subi r16, 0xFF ; 255 2fcde: 1f 4f sbci r17, 0xFF ; 255 2fce0: ca cf rjmp .-108 ; 0x2fc76 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2fce2: f6 01 movw r30, r12 2fce4: 11 83 std Z+1, r17 ; 0x01 2fce6: 00 83 st Z, r16 2fce8: a1 cf rjmp .-190 ; 0x2fc2c } } else //relative path { curDir = &workDir; 2fcea: 86 e1 ldi r24, 0x16 ; 22 2fcec: 95 e1 ldi r25, 0x15 ; 21 2fcee: 90 93 15 15 sts 0x1515, r25 ; 0x801515 2fcf2: 80 93 14 15 sts 0x1514, r24 ; 0x801514 2fcf6: 9a cf rjmp .-204 ; 0x2fc2c 0002fcf8 : 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*/){ 2fcf8: bf 92 push r11 2fcfa: cf 92 push r12 2fcfc: df 92 push r13 2fcfe: ef 92 push r14 2fd00: ff 92 push r15 2fd02: 0f 93 push r16 2fd04: 1f 93 push r17 2fd06: cf 93 push r28 2fd08: df 93 push r29 2fd0a: 1f 92 push r1 2fd0c: 1f 92 push r1 2fd0e: cd b7 in r28, 0x3d ; 61 2fd10: de b7 in r29, 0x3e ; 62 if(!mounted) 2fd12: 20 91 6c 14 lds r18, 0x146C ; 0x80146c 2fd16: 22 23 and r18, r18 2fd18: 09 f4 brne .+2 ; 0x2fd1c 2fd1a: ef c0 rjmp .+478 ; 0x2fefa 2fd1c: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2fd1e: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 2fd22: 88 23 and r24, r24 2fd24: 09 f4 brne .+2 ; 0x2fd28 2fd26: 04 c1 rjmp .+520 ; 0x2ff30 if(!replace_current){ 2fd28: 61 11 cpse r22, r1 2fd2a: f6 c0 rjmp .+492 ; 0x2ff18 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2fd2c: d0 90 1e 17 lds r13, 0x171E ; 0x80171e 2fd30: dd 20 and r13, r13 2fd32: 21 f0 breq .+8 ; 0x2fd3c // 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); 2fd34: 82 e3 ldi r24, 0x32 ; 50 2fd36: 9a ea ldi r25, 0xAA ; 170 2fd38: 0e 94 26 7c call 0xf84c ; 0xf84c return; } SERIAL_ECHO_START; 2fd3c: 84 e1 ldi r24, 0x14 ; 20 2fd3e: 9b ea ldi r25, 0xAB ; 171 2fd40: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(ofSubroutineCallTgt); 2fd44: 89 e1 ldi r24, 0x19 ; 25 2fd46: 9a ea ldi r25, 0xAA ; 170 2fd48: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2fd4c: c7 01 movw r24, r14 2fd4e: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2fd52: 8e e0 ldi r24, 0x0E ; 14 2fd54: 9a ea ldi r25, 0xAA ; 170 2fd56: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2fd5a: 00 91 1e 17 lds r16, 0x171E ; 0x80171e 2fd5e: 25 e5 ldi r18, 0x55 ; 85 2fd60: 02 9f mul r16, r18 2fd62: 80 01 movw r16, r0 2fd64: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2fd66: 0d 5d subi r16, 0xDD ; 221 2fd68: 18 4e sbci r17, 0xE8 ; 232 2fd6a: 8f e2 ldi r24, 0x2F ; 47 2fd6c: f8 01 movw r30, r16 2fd6e: 81 93 st Z+, r24 2fd70: 8f 01 movw r16, r30 2fd72: cc 24 eor r12, r12 2fd74: c3 94 inc r12 for(uint8_t i=0;i 2fd7e: d8 16 cp r13, r24 2fd80: b0 f4 brcc .+44 ; 0x2fdae { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2fd82: db 9c mul r13, r11 2fd84: c0 01 movw r24, r0 2fd86: 11 24 eor r1, r1 2fd88: b8 01 movw r22, r16 2fd8a: 87 5c subi r24, 0xC7 ; 199 2fd8c: 9a 4e sbci r25, 0xEA ; 234 2fd8e: 0f 94 15 a4 call 0x3482a ; 0x3482a 2fd92: c8 01 movw r24, r16 2fd94: 8c 01 movw r16, r24 2fd96: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 2fd98: f8 01 movw r30, r16 2fd9a: 20 81 ld r18, Z 2fd9c: 22 23 and r18, r18 2fd9e: 29 f0 breq .+10 ; 0x2fdaa 2fda0: f4 e5 ldi r31, 0x54 ; 84 2fda2: fc 15 cp r31, r12 2fda4: 10 f0 brcs .+4 ; 0x2fdaa {t++;cnt++;} //crawl counter forward. 2fda6: c3 94 inc r12 2fda8: f5 cf rjmp .-22 ; 0x2fd94 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) 2fdae: 27 e4 ldi r18, 0x47 ; 71 2fdb0: 2c 15 cp r18, r12 2fdb2: 08 f4 brcc .+2 ; 0x2fdb6 2fdb4: ae c0 rjmp .+348 ; 0x2ff12 file.getFilename(t); 2fdb6: b8 01 movw r22, r16 2fdb8: 8b ef ldi r24, 0xFB ; 251 2fdba: 96 e1 ldi r25, 0x16 ; 22 2fdbc: 0f 94 15 a4 call 0x3482a ; 0x3482a SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2fdc0: 80 91 1e 17 lds r24, 0x171E ; 0x80171e 2fdc4: f5 e5 ldi r31, 0x55 ; 85 2fdc6: 8f 9f mul r24, r31 2fdc8: c0 01 movw r24, r0 2fdca: 11 24 eor r1, r1 2fdcc: 8d 5d subi r24, 0xDD ; 221 2fdce: 98 4e sbci r25, 0xE8 ; 232 2fdd0: 0e 94 d0 89 call 0x113a0 ; 0x113a0 SERIAL_ECHORPGM(ofPos); 2fdd4: 88 e0 ldi r24, 0x08 ; 8 2fdd6: 9a ea ldi r25, 0xAA ; 170 2fdd8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2fddc: 60 91 7f 17 lds r22, 0x177F ; 0x80177f 2fde0: 70 91 80 17 lds r23, 0x1780 ; 0x801780 2fde4: 80 91 81 17 lds r24, 0x1781 ; 0x801781 2fde8: 90 91 82 17 lds r25, 0x1782 ; 0x801782 2fdec: 4a e0 ldi r20, 0x0A ; 10 2fdee: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2fdf2: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2fdf6: 80 91 1e 17 lds r24, 0x171E ; 0x80171e 2fdfa: 24 e0 ldi r18, 0x04 ; 4 2fdfc: 82 9f mul r24, r18 2fdfe: f0 01 movw r30, r0 2fe00: 11 24 eor r1, r1 2fe02: e1 5e subi r30, 0xE1 ; 225 2fe04: f8 4e sbci r31, 0xE8 ; 232 2fe06: 40 91 7f 17 lds r20, 0x177F ; 0x80177f 2fe0a: 50 91 80 17 lds r21, 0x1780 ; 0x801780 2fe0e: 60 91 81 17 lds r22, 0x1781 ; 0x801781 2fe12: 70 91 82 17 lds r23, 0x1782 ; 0x801782 2fe16: 40 83 st Z, r20 2fe18: 51 83 std Z+1, r21 ; 0x01 2fe1a: 62 83 std Z+2, r22 ; 0x02 2fe1c: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2fe1e: 8f 5f subi r24, 0xFF ; 255 2fe20: 80 93 1e 17 sts 0x171E, r24 ; 0x80171e } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 2fe24: 8b ef ldi r24, 0xFB ; 251 2fe26: 96 e1 ldi r25, 0x16 ; 22 2fe28: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 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; 2fe2c: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b const char *fname=name; 2fe30: fa 82 std Y+2, r15 ; 0x02 2fe32: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 2fe34: ce 01 movw r24, r28 2fe36: 01 96 adiw r24, 0x01 ; 1 2fe38: 0f 94 f7 7d call 0x2fbee ; 0x2fbee 2fe3c: 88 23 and r24, r24 2fe3e: 09 f4 brne .+2 ; 0x2fe42 2fe40: 5c c0 rjmp .+184 ; 0x2fefa */ 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) ){ 2fe42: 49 81 ldd r20, Y+1 ; 0x01 2fe44: 5a 81 ldd r21, Y+2 ; 0x02 2fe46: 60 91 14 15 lds r22, 0x1514 ; 0x801514 2fe4a: 70 91 15 15 lds r23, 0x1515 ; 0x801515 2fe4e: 21 e0 ldi r18, 0x01 ; 1 2fe50: 8b ef ldi r24, 0xFB ; 251 2fe52: 96 e1 ldi r25, 0x16 ; 22 2fe54: 0f 94 bc d6 call 0x3ad78 ; 0x3ad78 2fe58: 88 23 and r24, r24 2fe5a: 09 f4 brne .+2 ; 0x2fe5e 2fe5c: 77 c0 rjmp .+238 ; 0x2ff4c // compute the block to start with if( ! gfComputeNextFileBlock() ) 2fe5e: 8b ef ldi r24, 0xFB ; 251 2fe60: 96 e1 ldi r25, 0x16 ; 22 2fe62: 0f 94 14 6c call 0x2d828 ; 0x2d828 2fe66: 88 23 and r24, r24 2fe68: 09 f4 brne .+2 ; 0x2fe6c 2fe6a: 70 c0 rjmp .+224 ; 0x2ff4c 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; 2fe6c: 80 91 1c 17 lds r24, 0x171C ; 0x80171c 2fe70: 90 91 1d 17 lds r25, 0x171D ; 0x80171d 2fe74: 88 58 subi r24, 0x88 ; 136 2fe76: 91 4f sbci r25, 0xF1 ; 241 2fe78: 90 93 17 17 sts 0x1717, r25 ; 0x801717 2fe7c: 80 93 16 17 sts 0x1716, r24 ; 0x801716 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 2fe80: 89 81 ldd r24, Y+1 ; 0x01 2fe82: 9a 81 ldd r25, Y+2 ; 0x02 2fe84: 0f 94 dd 79 call 0x2f3ba ; 0x2f3ba filesize = file.fileSize(); 2fe88: 80 91 0c 17 lds r24, 0x170C ; 0x80170c 2fe8c: 90 91 0d 17 lds r25, 0x170D ; 0x80170d 2fe90: a0 91 0e 17 lds r26, 0x170E ; 0x80170e 2fe94: b0 91 0f 17 lds r27, 0x170F ; 0x80170f 2fe98: 80 93 78 17 sts 0x1778, r24 ; 0x801778 2fe9c: 90 93 79 17 sts 0x1779, r25 ; 0x801779 2fea0: a0 93 7a 17 sts 0x177A, r26 ; 0x80177a 2fea4: b0 93 7b 17 sts 0x177B, r27 ; 0x80177b SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 2fea8: 88 ed ldi r24, 0xD8 ; 216 2feaa: 99 ea ldi r25, 0xA9 ; 169 2feac: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 printAbsFilenameFast(); 2feb0: 0f 94 c0 7a call 0x2f580 ; 0x2f580 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 2feb4: 80 ed ldi r24, 0xD0 ; 208 2feb6: 99 ea ldi r25, 0xA9 ; 169 2feb8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2febc: 60 91 78 17 lds r22, 0x1778 ; 0x801778 2fec0: 70 91 79 17 lds r23, 0x1779 ; 0x801779 2fec4: 80 91 7a 17 lds r24, 0x177A ; 0x80177a 2fec8: 90 91 7b 17 lds r25, 0x177B ; 0x80177b 2fecc: 4a e0 ldi r20, 0x0A ; 10 2fece: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2fed2: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 2fed6: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 2feda: 10 92 80 17 sts 0x1780, r1 ; 0x801780 2fede: 10 92 81 17 sts 0x1781, r1 ; 0x801781 2fee2: 10 92 82 17 sts 0x1782, r1 ; 0x801782 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2fee6: 82 ec ldi r24, 0xC2 ; 194 2fee8: 99 ea ldi r25, 0xA9 ; 169 2feea: 0e 94 97 7b call 0xf72e ; 0xf72e lcd_setstatuspgm(ofFileSelected); 2feee: 82 ec ldi r24, 0xC2 ; 194 2fef0: 99 ea ldi r25, 0xA9 ; 169 2fef2: 0f 94 e0 0a call 0x215c0 ; 0x215c0 scrollstuff = 0; 2fef6: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 2fefa: 0f 90 pop r0 2fefc: 0f 90 pop r0 2fefe: df 91 pop r29 2ff00: cf 91 pop r28 2ff02: 1f 91 pop r17 2ff04: 0f 91 pop r16 2ff06: ff 90 pop r15 2ff08: ef 90 pop r14 2ff0a: df 90 pop r13 2ff0c: cf 90 pop r12 2ff0e: bf 90 pop r11 2ff10: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 2ff12: f8 01 movw r30, r16 2ff14: 10 82 st Z, r1 2ff16: 54 cf rjmp .-344 ; 0x2fdc0 SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 2ff18: 84 e1 ldi r24, 0x14 ; 20 2ff1a: 9b ea ldi r25, 0xAB ; 171 2ff1c: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(ofNowDoingFile); 2ff20: 87 ef ldi r24, 0xF7 ; 247 2ff22: 99 ea ldi r25, 0xA9 ; 169 2ff24: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(name); 2ff28: c7 01 movw r24, r14 2ff2a: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 2ff2e: 7a cf rjmp .-268 ; 0x2fe24 } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 2ff30: 10 92 1e 17 sts 0x171E, r1 ; 0x80171e SERIAL_ECHO_START; 2ff34: 84 e1 ldi r24, 0x14 ; 20 2ff36: 9b ea ldi r25, 0xAB ; 171 2ff38: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(ofNowFreshFile); 2ff3c: 86 ee ldi r24, 0xE6 ; 230 2ff3e: 99 ea ldi r25, 0xA9 ; 169 2ff40: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(name); 2ff44: c7 01 movw r24, r14 2ff46: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 2ff4a: 70 cf rjmp .-288 ; 0x2fe2c SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2ff4c: 83 ea ldi r24, 0xA3 ; 163 2ff4e: 91 e7 ldi r25, 0x71 ; 113 2ff50: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 2ff54: 89 81 ldd r24, Y+1 ; 0x01 2ff56: 9a 81 ldd r25, Y+2 ; 0x02 2ff58: 0e 94 d0 89 call 0x113a0 ; 0x113a0 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2ff5c: 8e e2 ldi r24, 0x2E ; 46 2ff5e: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2ff62: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 2ff66: c9 cf rjmp .-110 ; 0x2fefa 0002ff68 : void CardReader::printingHasFinished() { st_synchronize(); 2ff68: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 file.close(); 2ff6c: 8b ef ldi r24, 0xFB ; 251 2ff6e: 96 e1 ldi r25, 0x16 ; 22 2ff70: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 2ff74: 80 91 1e 17 lds r24, 0x171E ; 0x80171e 2ff78: 88 23 and r24, r24 2ff7a: 69 f1 breq .+90 ; 0x2ffd6 { file_subcall_ctr--; 2ff7c: 81 50 subi r24, 0x01 ; 1 2ff7e: 80 93 1e 17 sts 0x171E, r24 ; 0x80171e openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 2ff82: 25 e5 ldi r18, 0x55 ; 85 2ff84: 82 9f mul r24, r18 2ff86: c0 01 movw r24, r0 2ff88: 11 24 eor r1, r1 2ff8a: 61 e0 ldi r22, 0x01 ; 1 2ff8c: 8d 5d subi r24, 0xDD ; 221 2ff8e: 98 4e sbci r25, 0xE8 ; 232 2ff90: 0f 94 7c 7e call 0x2fcf8 ; 0x2fcf8 setIndex(filespos[file_subcall_ctr]); 2ff94: e0 91 1e 17 lds r30, 0x171E ; 0x80171e 2ff98: 84 e0 ldi r24, 0x04 ; 4 2ff9a: e8 9f mul r30, r24 2ff9c: f0 01 movw r30, r0 2ff9e: 11 24 eor r1, r1 2ffa0: e1 5e subi r30, 0xE1 ; 225 2ffa2: f8 4e sbci r31, 0xE8 ; 232 2ffa4: 60 81 ld r22, Z 2ffa6: 71 81 ldd r23, Z+1 ; 0x01 2ffa8: 82 81 ldd r24, Z+2 ; 0x02 2ffaa: 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);}; 2ffac: 60 93 7f 17 sts 0x177F, r22 ; 0x80177f 2ffb0: 70 93 80 17 sts 0x1780, r23 ; 0x801780 2ffb4: 80 93 81 17 sts 0x1781, r24 ; 0x801781 2ffb8: 90 93 82 17 sts 0x1782, r25 ; 0x801782 2ffbc: 0f 94 3b 76 call 0x2ec76 ; 0x2ec76 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 2ffc0: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 2ffc4: 88 23 and r24, r24 2ffc6: 71 f0 breq .+28 ; 0x2ffe4 { sdprinting = true; 2ffc8: 81 e0 ldi r24, 0x01 ; 1 2ffca: 80 93 6b 14 sts 0x146B, r24 ; 0x80146b 2ffce: 85 e0 ldi r24, 0x05 ; 5 2ffd0: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> 2ffd4: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 2ffd6: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b 2ffda: 83 e0 ldi r24, 0x03 ; 3 2ffdc: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13printer_state.lto_priv.395> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 2ffe0: 0c 94 24 84 jmp 0x10848 ; 0x10848 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 2ffe4: 08 95 ret 0002ffe6 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 2ffe6: cf 92 push r12 2ffe8: df 92 push r13 2ffea: ef 92 push r14 2ffec: ff 92 push r15 2ffee: 0f 93 push r16 2fff0: 1f 93 push r17 2fff2: cf 93 push r28 2fff4: df 93 push r29 2fff6: 08 2f mov r16, r24 { mounted = false; 2fff8: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c if(root.isOpen()) 2fffc: 80 91 f4 14 lds r24, 0x14F4 ; 0x8014f4 30000: 88 23 and r24, r24 30002: 21 f0 breq .+8 ; 0x3000c root.close(); 30004: 81 ef ldi r24, 0xF1 ; 241 30006: 94 e1 ldi r25, 0x14 ; 20 30008: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 * \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; 3000c: 10 92 db 16 sts 0x16DB, r1 ; 0x8016db 30010: 10 92 d8 16 sts 0x16D8, r1 ; 0x8016d8 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 30014: 0f 94 55 3e call 0x27caa ; 0x27caa 30018: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 3001a: 0f 94 5e 75 call 0x2eabc ; 0x2eabc SET_OUTPUT(SDSS); 3001e: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 30022: 80 64 ori r24, 0x40 ; 64 30024: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 30028: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 3002a: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 3002c: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 3002e: 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); 30030: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 30032: 85 e0 ldi r24, 0x05 ; 5 30034: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 * 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); 30038: 82 e5 ldi r24, 0x52 ; 82 3003a: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 3003c: 1d bc out 0x2d, r1 ; 45 3003e: 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); 30040: 8f ef ldi r24, 0xFF ; 255 30042: 0f 94 4a a5 call 0x34a94 ; 0x34a94 30046: 11 50 subi r17, 0x01 ; 1 30048: d9 f7 brne .-10 ; 0x30040 WRITE(MISO, 1); // temporarily enable the MISO line pullup 3004a: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 3004c: 20 e0 ldi r18, 0x00 ; 0 3004e: 30 e0 ldi r19, 0x00 ; 0 30050: a9 01 movw r20, r18 30052: 60 e0 ldi r22, 0x00 ; 0 30054: 88 ed ldi r24, 0xD8 ; 216 30056: 96 e1 ldi r25, 0x16 ; 22 30058: 0f 94 56 a5 call 0x34aac ; 0x34aac 3005c: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 30060: 81 30 cpi r24, 0x01 ; 1 30062: 61 f0 breq .+24 ; 0x3007c if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30064: 0f 94 55 3e call 0x27caa ; 0x27caa 30068: 6c 1b sub r22, r28 3006a: 7d 0b sbc r23, r29 3006c: 61 3d cpi r22, 0xD1 ; 209 3006e: 77 40 sbci r23, 0x07 ; 7 30070: 68 f3 brcs .-38 ; 0x3004c WRITE(MISO, 0); // disable the MISO line pullup 30072: 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;} 30074: 81 e0 ldi r24, 0x01 ; 1 30076: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 3007a: 22 c0 rjmp .+68 ; 0x300c0 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 3007c: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 3007e: 0f 94 55 3e call 0x27caa ; 0x27caa 30082: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 30084: 85 eb ldi r24, 0xB5 ; 181 30086: 99 ea ldi r25, 0xA9 ; 169 30088: 0e 94 97 7b call 0xf72e ; 0xf72e spiSend(0XFF); 3008c: 8f ef ldi r24, 0xFF ; 255 3008e: 0f 94 4a a5 call 0x34a94 ; 0x34a94 while ((status_ = spiRec()) != 0xFF) 30092: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 30096: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 3009a: 8f 3f cpi r24, 0xFF ; 255 3009c: 59 f1 breq .+86 ; 0x300f4 { spiSend(0XFF); 3009e: 8f ef ldi r24, 0xFF ; 255 300a0: 0f 94 4a a5 call 0x34a94 ; 0x34a94 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 300a4: 0f 94 55 3e call 0x27caa ; 0x27caa 300a8: 6c 1b sub r22, r28 300aa: 7d 0b sbc r23, r29 300ac: 62 32 cpi r22, 0x22 ; 34 300ae: 71 05 cpc r23, r1 300b0: 80 f3 brcs .-32 ; 0x30092 300b2: 82 e0 ldi r24, 0x02 ; 2 300b4: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 300b8: 84 ea ldi r24, 0xA4 ; 164 300ba: 99 ea ldi r25, 0xA9 ; 169 300bc: 0e 94 97 7b call 0xf72e ; 0xf72e #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 300c0: 0f 94 5e 75 call 0x2eabc ; 0x2eabc #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 300c4: 84 e1 ldi r24, 0x14 ; 20 300c6: 9b ea ldi r25, 0xAB ; 171 300c8: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 300cc: 86 e9 ldi r24, 0x96 ; 150 300ce: 91 e7 ldi r25, 0x71 ; 113 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 300d0: 0e 94 97 7b call 0xf72e ; 0xf72e } if (mounted) 300d4: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 300d8: 88 23 and r24, r24 300da: 09 f4 brne .+2 ; 0x300de 300dc: 9a c0 rjmp .+308 ; 0x30212 { cdroot(doPresort); 300de: 80 2f mov r24, r16 } } 300e0: df 91 pop r29 300e2: cf 91 pop r28 300e4: 1f 91 pop r17 300e6: 0f 91 pop r16 300e8: ff 90 pop r15 300ea: ef 90 pop r14 300ec: df 90 pop r13 300ee: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 300f0: 0d 94 df 7d jmp 0x2fbbe ; 0x2fbbe goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 300f4: 2a ea ldi r18, 0xAA ; 170 300f6: 31 e0 ldi r19, 0x01 ; 1 300f8: 40 e0 ldi r20, 0x00 ; 0 300fa: 50 e0 ldi r21, 0x00 ; 0 300fc: 68 e0 ldi r22, 0x08 ; 8 300fe: 88 ed ldi r24, 0xD8 ; 216 30100: 96 e1 ldi r25, 0x16 ; 22 30102: 0f 94 56 a5 call 0x34aac ; 0x34aac 30106: 82 ff sbrs r24, 2 30108: 2b c0 rjmp .+86 ; 0x30160 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;} 3010a: 81 e0 ldi r24, 0x01 ; 1 3010c: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 30110: 80 91 db 16 lds r24, 0x16DB ; 0x8016db 30114: c1 2c mov r12, r1 30116: d1 2c mov r13, r1 30118: 76 01 movw r14, r12 3011a: 82 30 cpi r24, 0x02 ; 2 3011c: 29 f4 brne .+10 ; 0x30128 3011e: c1 2c mov r12, r1 30120: d1 2c mov r13, r1 30122: e1 2c mov r14, r1 30124: 80 e4 ldi r24, 0x40 ; 64 30126: 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); 30128: 20 e0 ldi r18, 0x00 ; 0 3012a: 30 e0 ldi r19, 0x00 ; 0 3012c: a9 01 movw r20, r18 3012e: 67 e3 ldi r22, 0x37 ; 55 30130: 88 ed ldi r24, 0xD8 ; 216 30132: 96 e1 ldi r25, 0x16 ; 22 30134: 0f 94 56 a5 call 0x34aac ; 0x34aac return cardCommand(cmd, arg); 30138: a7 01 movw r20, r14 3013a: 96 01 movw r18, r12 3013c: 69 e2 ldi r22, 0x29 ; 41 3013e: 88 ed ldi r24, 0xD8 ; 216 30140: 96 e1 ldi r25, 0x16 ; 22 30142: 0f 94 56 a5 call 0x34aac ; 0x34aac while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 30146: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 3014a: 88 23 and r24, r24 3014c: b1 f0 breq .+44 ; 0x3017a // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 3014e: 0f 94 55 3e call 0x27caa ; 0x27caa 30152: 6c 1b sub r22, r28 30154: 7d 0b sbc r23, r29 30156: 61 3d cpi r22, 0xD1 ; 209 30158: 77 40 sbci r23, 0x07 ; 7 3015a: 30 f3 brcs .-52 ; 0x30128 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 3015c: 8a e0 ldi r24, 0x0A ; 10 3015e: 8b cf rjmp .-234 ; 0x30076 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 30160: 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(); 30162: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 30166: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 3016a: 11 50 subi r17, 0x01 ; 1 3016c: d1 f7 brne .-12 ; 0x30162 if (status_ != 0XAA) { 3016e: 8a 3a cpi r24, 0xAA ; 170 30170: 11 f0 breq .+4 ; 0x30176 30172: 82 e0 ldi r24, 0x02 ; 2 30174: 80 cf rjmp .-256 ; 0x30076 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;} 30176: 82 e0 ldi r24, 0x02 ; 2 30178: c9 cf rjmp .-110 ; 0x3010c error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 3017a: 80 91 db 16 lds r24, 0x16DB ; 0x8016db 3017e: 82 30 cpi r24, 0x02 ; 2 30180: d1 f4 brne .+52 ; 0x301b6 if (cardCommand(CMD58, 0)) { 30182: 20 e0 ldi r18, 0x00 ; 0 30184: 30 e0 ldi r19, 0x00 ; 0 30186: a9 01 movw r20, r18 30188: 6a e3 ldi r22, 0x3A ; 58 3018a: 88 ed ldi r24, 0xD8 ; 216 3018c: 96 e1 ldi r25, 0x16 ; 22 3018e: 0f 94 56 a5 call 0x34aac ; 0x34aac 30192: 88 23 and r24, r24 30194: 11 f0 breq .+4 ; 0x3019a bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30196: 88 e0 ldi r24, 0x08 ; 8 30198: 6e cf rjmp .-292 ; 0x30076 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 3019a: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 3019e: 80 7c andi r24, 0xC0 ; 192 301a0: 80 3c cpi r24, 0xC0 ; 192 301a2: 19 f4 brne .+6 ; 0x301aa 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;} 301a4: 83 e0 ldi r24, 0x03 ; 3 301a6: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 301aa: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 301ae: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 301b2: 0f 94 4f a5 call 0x34a9e ; 0x34a9e } chipSelectHigh(); 301b6: 0f 94 5e 75 call 0x2eabc ; 0x2eabc bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 301ba: 10 92 d9 16 sts 0x16D9, r1 ; 0x8016d9 * \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);} 301be: 81 e0 ldi r24, 0x01 ; 1 301c0: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac 301c4: 81 11 cpse r24, r1 301c6: 0c c0 rjmp .+24 ; 0x301e0 301c8: 80 e0 ldi r24, 0x00 ; 0 301ca: 0f 94 56 71 call 0x2e2ac ; 0x2e2ac #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 301ce: 81 11 cpse r24, r1 301d0: 07 c0 rjmp .+14 ; 0x301e0 { SERIAL_ERROR_START; 301d2: 8c ee ldi r24, 0xEC ; 236 301d4: 9a ea ldi r25, 0xAA ; 170 301d6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 301da: 83 e8 ldi r24, 0x83 ; 131 301dc: 91 e7 ldi r25, 0x71 ; 113 301de: 78 cf rjmp .-272 ; 0x300d0 } else if (!root.openRoot(&volume)) 301e0: 6d ed ldi r22, 0xDD ; 221 301e2: 76 e1 ldi r23, 0x16 ; 22 301e4: 81 ef ldi r24, 0xF1 ; 241 301e6: 94 e1 ldi r25, 0x14 ; 20 301e8: 0f 94 a2 a3 call 0x34744 ; 0x34744 301ec: 81 11 cpse r24, r1 301ee: 07 c0 rjmp .+14 ; 0x301fe { SERIAL_ERROR_START; 301f0: 8c ee ldi r24, 0xEC ; 236 301f2: 9a ea ldi r25, 0xAA ; 170 301f4: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 301f8: 83 e7 ldi r24, 0x73 ; 115 301fa: 91 e7 ldi r25, 0x71 ; 113 301fc: 69 cf rjmp .-302 ; 0x300d0 } else { mounted = true; 301fe: 81 e0 ldi r24, 0x01 ; 1 30200: 80 93 6c 14 sts 0x146C, r24 ; 0x80146c SERIAL_ECHO_START; 30204: 84 e1 ldi r24, 0x14 ; 20 30206: 9b ea ldi r25, 0xAB ; 171 30208: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 3020c: 88 e6 ldi r24, 0x68 ; 104 3020e: 91 e7 ldi r25, 0x71 ; 113 30210: 5f cf rjmp .-322 ; 0x300d0 if (mounted) { cdroot(doPresort); } } 30212: df 91 pop r29 30214: cf 91 pop r28 30216: 1f 91 pop r17 30218: 0f 91 pop r16 3021a: ff 90 pop r15 3021c: ef 90 pop r14 3021e: df 90 pop r13 30220: cf 90 pop r12 30222: 08 95 ret 00030224 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 30224: 4f 92 push r4 30226: 5f 92 push r5 30228: 6f 92 push r6 3022a: 7f 92 push r7 3022c: 8f 92 push r8 3022e: 9f 92 push r9 30230: af 92 push r10 30232: bf 92 push r11 30234: cf 92 push r12 30236: df 92 push r13 30238: ef 92 push r14 3023a: ff 92 push r15 3023c: 4b 01 movw r8, r22 3023e: 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]; 30240: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 30244: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 30248: 07 2e mov r0, r23 3024a: 00 0c add r0, r0 3024c: 88 0b sbc r24, r24 3024e: 99 0b sbc r25, r25 30250: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> if (!degTargetHotend(extruder)) 30254: 20 e0 ldi r18, 0x00 ; 0 30256: 30 e0 ldi r19, 0x00 ; 0 30258: a9 01 movw r20, r18 3025a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 3025e: 88 23 and r24, r24 30260: d1 f0 breq .+52 ; 0x30296 #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; 30262: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.402> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 30266: cc 24 eor r12, r12 30268: ca 94 dec r12 3026a: dc 2c mov r13, r12 3026c: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 3026e: 98 ee ldi r25, 0xE8 ; 232 30270: 49 2e mov r4, r25 30272: 93 e0 ldi r25, 0x03 ; 3 30274: 59 2e mov r5, r25 30276: 61 2c mov r6, r1 30278: 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) || 3027a: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 <_ZL13cancel_heatup.lto_priv.402> 3027e: 81 11 cpse r24, r1 30280: 0a c0 rjmp .+20 ; 0x30296 30282: 2f ef ldi r18, 0xFF ; 255 30284: c2 16 cp r12, r18 30286: d2 06 cpc r13, r18 30288: e2 06 cpc r14, r18 3028a: f2 06 cpc r15, r18 3028c: 89 f4 brne .+34 ; 0x302b0 (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) { 3028e: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 30292: 82 30 cpi r24, 0x02 ; 2 30294: b9 f4 brne .+46 ; 0x302c4 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 30296: ff 90 pop r15 30298: ef 90 pop r14 3029a: df 90 pop r13 3029c: cf 90 pop r12 3029e: bf 90 pop r11 302a0: af 90 pop r10 302a2: 9f 90 pop r9 302a4: 8f 90 pop r8 302a6: 7f 90 pop r7 302a8: 6f 90 pop r6 302aa: 5f 90 pop r5 302ac: 4f 90 pop r4 302ae: 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) || 302b0: f7 fc sbrc r15, 7 302b2: f1 cf rjmp .-30 ; 0x30296 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 302b4: 0f 94 55 3e call 0x27caa ; 0x27caa 302b8: 6c 19 sub r22, r12 302ba: 7d 09 sbc r23, r13 302bc: 68 3b cpi r22, 0xB8 ; 184 302be: 7b 40 sbci r23, 0x0B ; 11 302c0: 30 f3 brcs .-52 ; 0x3028e 302c2: e9 cf rjmp .-46 ; 0x30296 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) 302c4: 0f 94 55 3e call 0x27caa ; 0x27caa 302c8: 68 19 sub r22, r8 302ca: 79 09 sbc r23, r9 302cc: 8a 09 sbc r24, r10 302ce: 9b 09 sbc r25, r11 302d0: 69 3e cpi r22, 0xE9 ; 233 302d2: 73 40 sbci r23, 0x03 ; 3 302d4: 81 05 cpc r24, r1 302d6: 91 05 cpc r25, r1 302d8: f0 f1 brcs .+124 ; 0x30356 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 302da: 81 ea ldi r24, 0xA1 ; 161 302dc: 99 ea ldi r25, 0xA9 ; 169 302de: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 302e2: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 302e6: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 302ea: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 302ee: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 302f2: 41 e0 ldi r20, 0x01 ; 1 302f4: 0f 94 9b d5 call 0x3ab36 ; 0x3ab36 SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 302f8: 8d e9 ldi r24, 0x9D ; 157 302fa: 99 ea ldi r25, 0xA9 ; 169 302fc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 30300: 60 e0 ldi r22, 0x00 ; 0 30302: 70 e0 ldi r23, 0x00 ; 0 30304: cb 01 movw r24, r22 30306: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 3030a: 89 e9 ldi r24, 0x99 ; 153 3030c: 99 ea ldi r25, 0xA9 ; 169 3030e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 if (residencyStart > -1) 30312: f7 fc sbrc r15, 7 30314: 52 c0 rjmp .+164 ; 0x303ba { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 30316: 0f 94 55 3e call 0x27caa ; 0x27caa 3031a: 46 01 movw r8, r12 3031c: 57 01 movw r10, r14 3031e: 58 eb ldi r21, 0xB8 ; 184 30320: 85 0e add r8, r21 30322: 5b e0 ldi r21, 0x0B ; 11 30324: 95 1e adc r9, r21 30326: a1 1c adc r10, r1 30328: b1 1c adc r11, r1 3032a: a5 01 movw r20, r10 3032c: 94 01 movw r18, r8 3032e: 26 1b sub r18, r22 30330: 37 0b sbc r19, r23 30332: 48 0b sbc r20, r24 30334: 59 0b sbc r21, r25 30336: ca 01 movw r24, r20 30338: b9 01 movw r22, r18 3033a: a3 01 movw r20, r6 3033c: 92 01 movw r18, r4 3033e: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 30342: ca 01 movw r24, r20 30344: b9 01 movw r22, r18 30346: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 3034a: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 3034e: 0f 94 55 3e call 0x27caa ; 0x27caa 30352: 4b 01 movw r8, r22 30354: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 30356: 90 e0 ldi r25, 0x00 ; 0 30358: 80 e0 ldi r24, 0x00 ; 0 3035a: 0e 94 10 8f call 0x11e20 ; 0x11e20 #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))) || 3035e: 3f ef ldi r19, 0xFF ; 255 30360: c3 16 cp r12, r19 30362: d3 06 cpc r13, r19 30364: e3 06 cpc r14, r19 30366: f3 06 cpc r15, r19 30368: 09 f0 breq .+2 ; 0x3036c 3036a: 46 c0 rjmp .+140 ; 0x303f8 } 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))) || 3036c: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZL16target_direction.lto_priv.550> 30370: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 30374: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 30378: 88 23 and r24, r24 3037a: 19 f1 breq .+70 ; 0x303c2 3037c: 07 2e mov r0, r23 3037e: 00 0c add r0, r0 30380: 88 0b sbc r24, r24 30382: 99 0b sbc r25, r25 30384: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 30388: 20 e0 ldi r18, 0x00 ; 0 3038a: 30 e0 ldi r19, 0x00 ; 0 3038c: 40 e8 ldi r20, 0x80 ; 128 3038e: 5f e3 ldi r21, 0x3F ; 63 30390: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 30394: 9b 01 movw r18, r22 30396: ac 01 movw r20, r24 30398: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 3039c: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 303a0: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 303a4: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 303a8: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 303ac: 87 fd sbrc r24, 7 303ae: 65 cf rjmp .-310 ; 0x3027a (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 303b0: 0f 94 55 3e call 0x27caa ; 0x27caa 303b4: 6b 01 movw r12, r22 303b6: 7c 01 movw r14, r24 303b8: 60 cf rjmp .-320 ; 0x3027a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 303ba: 8f e3 ldi r24, 0x3F ; 63 303bc: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 303c0: c4 cf rjmp .-120 ; 0x3034a 303c2: 07 2e mov r0, r23 303c4: 00 0c add r0, r0 303c6: 88 0b sbc r24, r24 303c8: 99 0b sbc r25, r25 303ca: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__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))) || 303ce: 20 e0 ldi r18, 0x00 ; 0 303d0: 30 e0 ldi r19, 0x00 ; 0 303d2: 40 e8 ldi r20, 0x80 ; 128 303d4: 5f e3 ldi r21, 0x3F ; 63 303d6: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 303da: 9b 01 movw r18, r22 303dc: ac 01 movw r20, r24 303de: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 303e2: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 303e6: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 303ea: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 303ee: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 303f2: 18 16 cp r1, r24 303f4: ec f6 brge .-70 ; 0x303b0 303f6: 41 cf rjmp .-382 ; 0x3027a 303f8: f7 fc sbrc r15, 7 303fa: 3f cf rjmp .-386 ; 0x3027a 303fc: 60 91 6a 0e lds r22, 0x0E6A ; 0x800e6a 30400: 70 91 6b 0e lds r23, 0x0E6B ; 0x800e6b 30404: 07 2e mov r0, r23 30406: 00 0c add r0, r0 30408: 88 0b sbc r24, r24 3040a: 99 0b sbc r25, r25 3040c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 30410: 9b 01 movw r18, r22 30412: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 30414: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 30418: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 3041c: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 30420: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 30424: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 30428: 9f 77 andi r25, 0x7F ; 127 3042a: 20 e0 ldi r18, 0x00 ; 0 3042c: 30 e0 ldi r19, 0x00 ; 0 3042e: 40 ea ldi r20, 0xA0 ; 160 30430: 50 e4 ldi r21, 0x40 ; 64 30432: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 30436: 18 16 cp r1, r24 30438: 0c f0 brlt .+2 ; 0x3043c 3043a: 1f cf rjmp .-450 ; 0x3027a 3043c: b9 cf rjmp .-142 ; 0x303b0 0003043e : // 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) { 3043e: 1f 93 push r17 30440: cf 93 push r28 30442: df 93 push r29 30444: ec 01 movw r28, r24 30446: 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()) { 30448: 80 91 68 13 lds r24, 0x1368 ; 0x801368 3044c: 83 30 cpi r24, 0x03 ; 3 3044e: 09 f4 brne .+2 ; 0x30452 30450: 4e c0 rjmp .+156 ; 0x304ee 30452: 8c 31 cpi r24, 0x1C ; 28 30454: 09 f4 brne .+2 ; 0x30458 30456: 52 c0 rjmp .+164 ; 0x304fc break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 30458: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 3045c: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 30460: 8c 17 cp r24, r28 30462: 9d 07 cpc r25, r29 30464: 79 f1 breq .+94 ; 0x304c4 lastErrorCode = ec; 30466: d0 93 8e 13 sts 0x138E, r29 ; 0x80138e 3046a: c0 93 8d 13 sts 0x138D, r28 ; 0x80138d lastErrorSource = res; 3046e: 10 93 8f 13 sts 0x138F, r17 ; 0x80138f LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 30472: ce 01 movw r24, r28 30474: 0f 94 e4 c2 call 0x385c8 ; 0x385c8 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); 30478: e8 2f mov r30, r24 3047a: f0 e0 ldi r31, 0x00 ; 0 3047c: ee 0f add r30, r30 3047e: ff 1f adc r31, r31 30480: e3 53 subi r30, 0x33 ; 51 30482: f7 45 sbci r31, 0x57 ; 87 30484: 85 91 lpm r24, Z+ 30486: 94 91 lpm r25, Z 30488: 02 96 adiw r24, 0x02 ; 2 3048a: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 3048e: c1 30 cpi r28, 0x01 ; 1 30490: d1 05 cpc r29, r1 30492: c1 f0 breq .+48 ; 0x304c4 30494: cc 30 cpi r28, 0x0C ; 12 30496: 80 e8 ldi r24, 0x80 ; 128 30498: d8 07 cpc r29, r24 3049a: a1 f0 breq .+40 ; 0x304c4 3049c: c9 32 cpi r28, 0x29 ; 41 3049e: 80 e8 ldi r24, 0x80 ; 128 304a0: d8 07 cpc r29, r24 304a2: 81 f0 breq .+32 ; 0x304c4 IncrementMMUFails(); 304a4: 0f 94 ee c1 call 0x383dc ; 0x383dc | (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 304a8: ce 01 movw r24, r28 304aa: 88 27 eor r24, r24 304ac: 9e 77 andi r25, 0x7E ; 126 304ae: 89 2b or r24, r25 304b0: 49 f0 breq .+18 ; 0x304c4 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 304b2: 80 91 9b 13 lds r24, 0x139B ; 0x80139b 304b6: 90 91 9c 13 lds r25, 0x139C ; 0x80139c 304ba: 01 96 adiw r24, 0x01 ; 1 304bc: 90 93 9c 13 sts 0x139C, r25 ; 0x80139c 304c0: 80 93 9b 13 sts 0x139B, r24 ; 0x80139b return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 304c4: 80 91 7a 13 lds r24, 0x137A ; 0x80137a 304c8: 88 23 and r24, r24 304ca: d9 f0 breq .+54 ; 0x30502 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 304cc: 11 e0 ldi r17, 0x01 ; 1 304ce: 10 93 5c 0e sts 0x0E5C, r17 ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 304d2: ce 01 movw r24, r28 304d4: 0f 94 6f c5 call 0x38ade ; 0x38ade 304d8: 8f 3f cpi r24, 0xFF ; 255 304da: 99 f0 breq .+38 ; 0x30502 void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 304dc: 10 93 7b 13 sts 0x137B, r17 ; 0x80137b logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 304e0: 8a eb ldi r24, 0xBA ; 186 304e2: 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"); } 304e4: df 91 pop r29 304e6: cf 91 pop r28 304e8: 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"); 304ea: 0c 94 97 7b jmp 0xf72e ; 0xf72e // 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; 304ee: 10 92 98 13 sts 0x1398, r1 ; 0x801398 float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 304f2: 0f 94 8b bb call 0x37716 ; 0x37716 // 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; 304f6: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a 304fa: ae cf rjmp .-164 ; 0x30458 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; 304fc: 10 92 97 13 sts 0x1397, r1 ; 0x801397 30500: f8 cf rjmp .-16 ; 0x304f2 30502: 10 92 7b 13 sts 0x137B, r1 ; 0x80137b bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 30506: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.512> 3050a: 81 11 cpse r24, r1 3050c: 06 c0 rjmp .+12 ; 0x3051a 3050e: 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"); } 30510: df 91 pop r29 30512: cf 91 pop r28 30514: 1f 91 pop r17 30516: 0d 94 35 c4 jmp 0x3886a ; 0x3886a 3051a: df 91 pop r29 3051c: cf 91 pop r28 3051e: 1f 91 pop r17 30520: 08 95 ret 00030522 : * \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) { 30522: 2f 92 push r2 30524: 3f 92 push r3 30526: 4f 92 push r4 30528: 5f 92 push r5 3052a: 6f 92 push r6 3052c: 7f 92 push r7 3052e: 8f 92 push r8 30530: 9f 92 push r9 30532: af 92 push r10 30534: bf 92 push r11 30536: cf 92 push r12 30538: df 92 push r13 3053a: ef 92 push r14 3053c: ff 92 push r15 3053e: 0f 93 push r16 30540: 1f 93 push r17 30542: cf 93 push r28 30544: df 93 push r29 30546: 00 d0 rcall .+0 ; 0x30548 30548: 1f 92 push r1 3054a: cd b7 in r28, 0x3d ; 61 3054c: de b7 in r29, 0x3e ; 62 3054e: 5c 01 movw r10, r24 30550: 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; 30552: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 30556: 81 30 cpi r24, 0x01 ; 1 30558: 09 f0 breq .+2 ; 0x3055c 3055a: de c0 rjmp .+444 ; 0x30718 3055c: 80 91 fc 16 lds r24, 0x16FC ; 0x8016fc 30560: 81 ff sbrs r24, 1 30562: da c0 rjmp .+436 ; 0x30718 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 30564: 82 fd sbrc r24, 2 30566: bc c0 rjmp .+376 ; 0x306e0 * \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) { 30568: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 3056a: 21 2c mov r2, r1 3056c: 32 e0 ldi r19, 0x02 ; 2 3056e: 33 2e mov r3, r19 30570: 00 91 03 17 lds r16, 0x1703 ; 0x801703 30574: 10 91 04 17 lds r17, 0x1704 ; 0x801704 30578: 20 91 05 17 lds r18, 0x1705 ; 0x801705 3057c: 30 91 06 17 lds r19, 0x1706 ; 0x801706 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 30580: e1 14 cp r14, r1 30582: f1 04 cpc r15, r1 30584: 09 f4 brne .+2 ; 0x30588 30586: 30 c1 rjmp .+608 ; 0x307e8 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 30588: 80 91 14 17 lds r24, 0x1714 ; 0x801714 3058c: 90 91 15 17 lds r25, 0x1715 ; 0x801715 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);} 30590: dc 01 movw r26, r24 30592: 14 96 adiw r26, 0x04 ; 4 30594: 7c 90 ld r7, X 30596: 7a 94 dec r7 30598: b9 01 movw r22, r18 3059a: a8 01 movw r20, r16 3059c: 29 e0 ldi r18, 0x09 ; 9 3059e: 76 95 lsr r23 305a0: 67 95 ror r22 305a2: 57 95 ror r21 305a4: 47 95 ror r20 305a6: 2a 95 dec r18 305a8: d1 f7 brne .-12 ; 0x3059e 305aa: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 305ac: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 305ae: 71 10 cpse r7, r1 305b0: 25 c0 rjmp .+74 ; 0x305fc 305b2: 01 15 cp r16, r1 305b4: 11 05 cpc r17, r1 305b6: 11 f5 brne .+68 ; 0x305fc 305b8: 40 91 ff 16 lds r20, 0x16FF ; 0x8016ff 305bc: 50 91 00 17 lds r21, 0x1700 ; 0x801700 305c0: 60 91 01 17 lds r22, 0x1701 ; 0x801701 305c4: 70 91 02 17 lds r23, 0x1702 ; 0x801702 // start of new cluster if (curCluster_ == 0) { 305c8: 41 15 cp r20, r1 305ca: 51 05 cpc r21, r1 305cc: 61 05 cpc r22, r1 305ce: 71 05 cpc r23, r1 305d0: 09 f0 breq .+2 ; 0x305d4 305d2: a8 c0 rjmp .+336 ; 0x30724 if (firstCluster_ == 0) { 305d4: 80 91 10 17 lds r24, 0x1710 ; 0x801710 305d8: 90 91 11 17 lds r25, 0x1711 ; 0x801711 305dc: a0 91 12 17 lds r26, 0x1712 ; 0x801712 305e0: b0 91 13 17 lds r27, 0x1713 ; 0x801713 305e4: 00 97 sbiw r24, 0x00 ; 0 305e6: a1 05 cpc r26, r1 305e8: b1 05 cpc r27, r1 305ea: 09 f0 breq .+2 ; 0x305ee 305ec: b4 c0 rjmp .+360 ; 0x30756 } 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; 305ee: 8b ef ldi r24, 0xFB ; 251 305f0: 96 e1 ldi r25, 0x16 ; 22 305f2: 0f 94 4f a4 call 0x3489e ; 0x3489e 305f6: 88 23 and r24, r24 305f8: 09 f4 brne .+2 ; 0x305fc 305fa: 8e c0 rjmp .+284 ; 0x30718 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 305fc: c1 01 movw r24, r2 305fe: 80 1b sub r24, r16 30600: 91 0b sbc r25, r17 30602: 67 01 movw r12, r14 30604: 8e 15 cp r24, r14 30606: 9f 05 cpc r25, r15 30608: 08 f4 brcc .+2 ; 0x3060c 3060a: 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; 3060c: e0 91 14 17 lds r30, 0x1714 ; 0x801714 30610: f0 91 15 17 lds r31, 0x1715 ; 0x801715 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 30614: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 30618: 90 91 00 17 lds r25, 0x1700 ; 0x801700 3061c: a0 91 01 17 lds r26, 0x1701 ; 0x801701 30620: b0 91 02 17 lds r27, 0x1702 ; 0x801702 30624: 02 97 sbiw r24, 0x02 ; 2 30626: a1 09 sbc r26, r1 30628: b1 09 sbc r27, r1 3062a: 25 85 ldd r18, Z+13 ; 0x0d 3062c: 04 c0 rjmp .+8 ; 0x30636 3062e: 88 0f add r24, r24 30630: 99 1f adc r25, r25 30632: aa 1f adc r26, r26 30634: bb 1f adc r27, r27 30636: 2a 95 dec r18 30638: d2 f7 brpl .-12 ; 0x3062e 3063a: 46 85 ldd r20, Z+14 ; 0x0e 3063c: 57 85 ldd r21, Z+15 ; 0x0f 3063e: 60 89 ldd r22, Z+16 ; 0x10 30640: 71 89 ldd r23, Z+17 ; 0x11 30642: 84 0f add r24, r20 30644: 95 1f adc r25, r21 30646: a6 1f adc r26, r22 30648: b7 1f adc r27, r23 3064a: 9c 01 movw r18, r24 3064c: ad 01 movw r20, r26 3064e: 27 0d add r18, r7 30650: 31 1d adc r19, r1 30652: 41 1d adc r20, r1 30654: 51 1d adc r21, r1 30656: 29 01 movw r4, r18 30658: 3a 01 movw r6, r20 if (n == 512) { 3065a: c1 14 cp r12, r1 3065c: 32 e0 ldi r19, 0x02 ; 2 3065e: d3 06 cpc r13, r19 30660: 09 f0 breq .+2 ; 0x30664 30662: 8a c0 rjmp .+276 ; 0x30778 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 30664: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 30668: 90 91 6d 0e lds r25, 0x0E6D ; 0x800e6d 3066c: a0 91 6e 0e lds r26, 0x0E6E ; 0x800e6e 30670: b0 91 6f 0e lds r27, 0x0E6F ; 0x800e6f 30674: 48 16 cp r4, r24 30676: 59 06 cpc r5, r25 30678: 6a 06 cpc r6, r26 3067a: 7b 06 cpc r7, r27 3067c: 69 f4 brne .+26 ; 0x30698 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; 3067e: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 cacheBlockNumber_ = blockNumber; 30682: 8f ef ldi r24, 0xFF ; 255 30684: 9f ef ldi r25, 0xFF ; 255 30686: dc 01 movw r26, r24 30688: 80 93 6c 0e sts 0x0E6C, r24 ; 0x800e6c 3068c: 90 93 6d 0e sts 0x0E6D, r25 ; 0x800e6d 30690: a0 93 6e 0e sts 0x0E6E, r26 ; 0x800e6e 30694: b0 93 6f 0e sts 0x0E6F, r27 ; 0x800e6f 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); 30698: 95 01 movw r18, r10 3069a: b3 01 movw r22, r6 3069c: a2 01 movw r20, r4 3069e: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 306a2: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 306a6: 0f 94 b6 a5 call 0x34b6c ; 0x34b6c // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 306aa: 88 23 and r24, r24 306ac: a9 f1 breq .+106 ; 0x30718 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 306ae: 80 91 03 17 lds r24, 0x1703 ; 0x801703 306b2: 90 91 04 17 lds r25, 0x1704 ; 0x801704 306b6: a0 91 05 17 lds r26, 0x1705 ; 0x801705 306ba: b0 91 06 17 lds r27, 0x1706 ; 0x801706 306be: 8c 0d add r24, r12 306c0: 9d 1d adc r25, r13 306c2: a1 1d adc r26, r1 306c4: b1 1d adc r27, r1 306c6: 80 93 03 17 sts 0x1703, r24 ; 0x801703 306ca: 90 93 04 17 sts 0x1704, r25 ; 0x801704 306ce: a0 93 05 17 sts 0x1705, r26 ; 0x801705 306d2: b0 93 06 17 sts 0x1706, r27 ; 0x801706 src += n; 306d6: ac 0c add r10, r12 306d8: bd 1c adc r11, r13 nToWrite -= n; 306da: ec 18 sub r14, r12 306dc: fd 08 sbc r15, r13 306de: 48 cf rjmp .-368 ; 0x30570 // 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_) { 306e0: 40 91 0c 17 lds r20, 0x170C ; 0x80170c 306e4: 50 91 0d 17 lds r21, 0x170D ; 0x80170d 306e8: 60 91 0e 17 lds r22, 0x170E ; 0x80170e 306ec: 70 91 0f 17 lds r23, 0x170F ; 0x80170f 306f0: 80 91 03 17 lds r24, 0x1703 ; 0x801703 306f4: 90 91 04 17 lds r25, 0x1704 ; 0x801704 306f8: a0 91 05 17 lds r26, 0x1705 ; 0x801705 306fc: b0 91 06 17 lds r27, 0x1706 ; 0x801706 30700: 48 17 cp r20, r24 30702: 59 07 cpc r21, r25 30704: 6a 07 cpc r22, r26 30706: 7b 07 cpc r23, r27 30708: 09 f4 brne .+2 ; 0x3070c 3070a: 2e cf rjmp .-420 ; 0x30568 } /** 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);} 3070c: 8b ef ldi r24, 0xFB ; 251 3070e: 96 e1 ldi r25, 0x16 ; 22 30710: 0f 94 2a 6d call 0x2da54 ; 0x2da54 if (!seekEnd()) goto fail; 30714: 81 11 cpse r24, r1 30716: 28 cf rjmp .-432 ; 0x30568 } return nbyte; fail: // return for write error writeError = true; 30718: 81 e0 ldi r24, 0x01 ; 1 3071a: 80 93 fb 16 sts 0x16FB, r24 ; 0x8016fb return -1; 3071e: 8f ef ldi r24, 0xFF ; 255 30720: 9f ef ldi r25, 0xFF ; 255 30722: 81 c0 rjmp .+258 ; 0x30826 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 30724: 9e 01 movw r18, r28 30726: 2f 5f subi r18, 0xFF ; 255 30728: 3f 4f sbci r19, 0xFF ; 255 3072a: 0f 94 27 6b call 0x2d64e ; 0x2d64e 3072e: 88 23 and r24, r24 30730: 99 f3 breq .-26 ; 0x30718 if (vol_->isEOC(next)) { 30732: 89 81 ldd r24, Y+1 ; 0x01 30734: 9a 81 ldd r25, Y+2 ; 0x02 30736: ab 81 ldd r26, Y+3 ; 0x03 30738: 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; 3073a: e0 91 14 17 lds r30, 0x1714 ; 0x801714 3073e: f0 91 15 17 lds r31, 0x1715 ; 0x801715 30742: 27 89 ldd r18, Z+23 ; 0x17 30744: 20 31 cpi r18, 0x10 ; 16 30746: 81 f4 brne .+32 ; 0x30768 30748: 88 3f cpi r24, 0xF8 ; 248 3074a: ef ef ldi r30, 0xFF ; 255 3074c: 9e 07 cpc r25, r30 3074e: a1 05 cpc r26, r1 30750: b1 05 cpc r27, r1 30752: 08 f0 brcs .+2 ; 0x30756 30754: 4c cf rjmp .-360 ; 0x305ee // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 30756: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff 3075a: 90 93 00 17 sts 0x1700, r25 ; 0x801700 3075e: a0 93 01 17 sts 0x1701, r26 ; 0x801701 30762: b0 93 02 17 sts 0x1702, r27 ; 0x801702 30766: 4a cf rjmp .-364 ; 0x305fc return cluster >= FAT32EOC_MIN; 30768: 88 3f cpi r24, 0xF8 ; 248 3076a: ff ef ldi r31, 0xFF ; 255 3076c: 9f 07 cpc r25, r31 3076e: af 07 cpc r26, r31 30770: ff e0 ldi r31, 0x0F ; 15 30772: bf 07 cpc r27, r31 30774: 80 f3 brcs .-32 ; 0x30756 30776: 3b cf rjmp .-394 ; 0x305ee // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 30778: 01 15 cp r16, r1 3077a: 11 05 cpc r17, r1 3077c: 69 f5 brne .+90 ; 0x307d8 3077e: 40 91 03 17 lds r20, 0x1703 ; 0x801703 30782: 50 91 04 17 lds r21, 0x1704 ; 0x801704 30786: 60 91 05 17 lds r22, 0x1705 ; 0x801705 3078a: 70 91 06 17 lds r23, 0x1706 ; 0x801706 3078e: 80 91 0c 17 lds r24, 0x170C ; 0x80170c 30792: 90 91 0d 17 lds r25, 0x170D ; 0x80170d 30796: a0 91 0e 17 lds r26, 0x170E ; 0x80170e 3079a: b0 91 0f 17 lds r27, 0x170F ; 0x80170f 3079e: 48 17 cp r20, r24 307a0: 59 07 cpc r21, r25 307a2: 6a 07 cpc r22, r26 307a4: 7b 07 cpc r23, r27 307a6: c0 f0 brcs .+48 ; 0x307d8 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 307a8: 0f 94 19 6a call 0x2d432 ; 0x2d432 307ac: 88 23 and r24, r24 307ae: 09 f4 brne .+2 ; 0x307b2 307b0: b3 cf rjmp .-154 ; 0x30718 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; 307b2: 81 e0 ldi r24, 0x01 ; 1 307b4: 80 93 74 0e sts 0x0E74, r24 ; 0x800e74 cacheBlockNumber_ = blockNumber; 307b8: 40 92 6c 0e sts 0x0E6C, r4 ; 0x800e6c 307bc: 50 92 6d 0e sts 0x0E6D, r5 ; 0x800e6d 307c0: 60 92 6e 0e sts 0x0E6E, r6 ; 0x800e6e 307c4: 70 92 6f 0e sts 0x0E6F, r7 ; 0x800e6f } 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); 307c8: a6 01 movw r20, r12 307ca: b5 01 movw r22, r10 307cc: c8 01 movw r24, r16 307ce: 88 58 subi r24, 0x88 ; 136 307d0: 91 4f sbci r25, 0xF1 ; 241 307d2: 0f 94 38 e3 call 0x3c670 ; 0x3c670 307d6: 6b cf rjmp .-298 ; 0x306ae 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; 307d8: 41 e0 ldi r20, 0x01 ; 1 307da: c3 01 movw r24, r6 307dc: b2 01 movw r22, r4 307de: 0f 94 58 6a call 0x2d4b0 ; 0x2d4b0 307e2: 81 11 cpse r24, r1 307e4: f1 cf rjmp .-30 ; 0x307c8 307e6: 98 cf rjmp .-208 ; 0x30718 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 307e8: 80 91 0c 17 lds r24, 0x170C ; 0x80170c 307ec: 90 91 0d 17 lds r25, 0x170D ; 0x80170d 307f0: a0 91 0e 17 lds r26, 0x170E ; 0x80170e 307f4: b0 91 0f 17 lds r27, 0x170F ; 0x80170f 307f8: 80 17 cp r24, r16 307fa: 91 07 cpc r25, r17 307fc: a2 07 cpc r26, r18 307fe: b3 07 cpc r27, r19 30800: 68 f4 brcc .+26 ; 0x3081c 30802: 80 91 fc 16 lds r24, 0x16FC ; 0x8016fc // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 30806: 00 93 0c 17 sts 0x170C, r16 ; 0x80170c 3080a: 10 93 0d 17 sts 0x170D, r17 ; 0x80170d 3080e: 20 93 0e 17 sts 0x170E, r18 ; 0x80170e 30812: 30 93 0f 17 sts 0x170F, r19 ; 0x80170f flags_ |= F_FILE_DIR_DIRTY; 30816: 80 68 ori r24, 0x80 ; 128 30818: 80 93 fc 16 sts 0x16FC, r24 ; 0x8016fc } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 3081c: 80 91 fc 16 lds r24, 0x16FC ; 0x8016fc 30820: 83 fd sbrc r24, 3 30822: 18 c0 rjmp .+48 ; 0x30854 if (!sync()) goto fail; } return nbyte; 30824: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 30826: 0f 90 pop r0 30828: 0f 90 pop r0 3082a: 0f 90 pop r0 3082c: 0f 90 pop r0 3082e: df 91 pop r29 30830: cf 91 pop r28 30832: 1f 91 pop r17 30834: 0f 91 pop r16 30836: ff 90 pop r15 30838: ef 90 pop r14 3083a: df 90 pop r13 3083c: cf 90 pop r12 3083e: bf 90 pop r11 30840: af 90 pop r10 30842: 9f 90 pop r9 30844: 8f 90 pop r8 30846: 7f 90 pop r7 30848: 6f 90 pop r6 3084a: 5f 90 pop r5 3084c: 4f 90 pop r4 3084e: 3f 90 pop r3 30850: 2f 90 pop r2 30852: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 30854: 8b ef ldi r24, 0xFB ; 251 30856: 96 e1 ldi r25, 0x16 ; 22 30858: 0f 94 f5 6c call 0x2d9ea ; 0x2d9ea 3085c: 81 11 cpse r24, r1 3085e: e2 cf rjmp .-60 ; 0x30824 30860: 5b cf rjmp .-330 ; 0x30718 00030862 : #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) { 30862: 0f 93 push r16 30864: cf 93 push r28 30866: df 93 push r29 30868: cd b7 in r28, 0x3d ; 61 3086a: de b7 in r29, 0x3e ; 62 3086c: a3 97 sbiw r28, 0x23 ; 35 3086e: 0f b6 in r0, 0x3f ; 63 30870: f8 94 cli 30872: de bf out 0x3e, r29 ; 62 30874: 0f be out 0x3f, r0 ; 63 30876: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 30878: 20 91 0c 16 lds r18, 0x160C ; 0x80160c 3087c: 30 91 0d 16 lds r19, 0x160D ; 0x80160d 30880: 82 17 cp r24, r18 30882: 93 07 cpc r25, r19 30884: d8 f4 brcc .+54 ; 0x308bc getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 30886: 61 30 cpi r22, 0x01 ; 1 30888: 31 f4 brne .+12 ; 0x30896 3088a: 21 50 subi r18, 0x01 ; 1 3088c: 31 09 sbc r19, r1 3088e: a9 01 movw r20, r18 30890: 48 1b sub r20, r24 30892: 59 0b sbc r21, r25 30894: ca 01 movw r24, r20 30896: 88 0f add r24, r24 30898: 99 1f adc r25, r25 3089a: fc 01 movw r30, r24 3089c: e2 5f subi r30, 0xF2 ; 242 3089e: f9 4e sbci r31, 0xE9 ; 233 308a0: 80 81 ld r24, Z 308a2: 91 81 ldd r25, Z+1 ; 0x01 308a4: 0f 94 24 7a call 0x2f448 ; 0x2f448 else getfilename_afterMaxSorting(nr); } 308a8: a3 96 adiw r28, 0x23 ; 35 308aa: 0f b6 in r0, 0x3f ; 63 308ac: f8 94 cli 308ae: de bf out 0x3e, r29 ; 62 308b0: 0f be out 0x3f, r0 ; 63 308b2: cd bf out 0x3d, r28 ; 61 308b4: df 91 pop r29 308b6: cf 91 pop r28 308b8: 0f 91 pop r16 308ba: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 308bc: 46 e1 ldi r20, 0x16 ; 22 308be: 55 e1 ldi r21, 0x15 ; 21 308c0: 50 93 15 15 sts 0x1515, r21 ; 0x801515 308c4: 40 93 14 15 sts 0x1514, r20 ; 0x801514 nrFiles = entry - sort_count + 1; 308c8: 82 1b sub r24, r18 308ca: 93 0b sbc r25, r19 308cc: 01 96 adiw r24, 0x01 ; 1 308ce: 90 93 84 17 sts 0x1784, r25 ; 0x801784 308d2: 80 93 83 17 sts 0x1783, r24 ; 0x801783 curDir->seekSet(lastSortedFilePosition << 5); 308d6: 40 91 d6 16 lds r20, 0x16D6 ; 0x8016d6 308da: 50 91 d7 16 lds r21, 0x16D7 ; 0x8016d7 308de: 85 e0 ldi r24, 0x05 ; 5 308e0: 44 0f add r20, r20 308e2: 55 1f adc r21, r21 308e4: 8a 95 dec r24 308e6: e1 f7 brne .-8 ; 0x308e0 308e8: 70 e0 ldi r23, 0x00 ; 0 308ea: 60 e0 ldi r22, 0x00 ; 0 308ec: 86 e1 ldi r24, 0x16 ; 22 308ee: 95 e1 ldi r25, 0x15 ; 21 308f0: 0f 94 2a 6d call 0x2da54 ; 0x2da54 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 308f4: 00 e0 ldi r16, 0x00 ; 0 308f6: 0e 7f andi r16, 0xFE ; 254 308f8: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 308fa: e0 91 14 15 lds r30, 0x1514 ; 0x801514 308fe: f0 91 15 15 lds r31, 0x1515 ; 0x801515 30902: 83 e2 ldi r24, 0x23 ; 35 30904: de 01 movw r26, r28 30906: 11 96 adiw r26, 0x01 ; 1 30908: 01 90 ld r0, Z+ 3090a: 0d 92 st X+, r0 3090c: 8a 95 dec r24 3090e: e1 f7 brne .-8 ; 0x30908 30910: 22 e0 ldi r18, 0x02 ; 2 30912: 50 e0 ldi r21, 0x00 ; 0 30914: 40 e0 ldi r20, 0x00 ; 0 30916: be 01 movw r22, r28 30918: 6f 5f subi r22, 0xFF ; 255 3091a: 7f 4f sbci r23, 0xFF ; 255 3091c: 81 ef ldi r24, 0xF1 ; 241 3091e: 92 e0 ldi r25, 0x02 ; 2 30920: 0f 94 ae 77 call 0x2ef5c ; 0x2ef5c 30924: ce 01 movw r24, r28 30926: 01 96 adiw r24, 0x01 ; 1 30928: 0e 94 4d 79 call 0xf29a ; 0xf29a 3092c: bd cf rjmp .-134 ; 0x308a8 0003092e : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 3092e: 0f 93 push r16 30930: 1f 93 push r17 30932: cf 93 push r28 30934: df 93 push r29 30936: 1f 92 push r1 30938: 1f 92 push r1 3093a: cd b7 in r28, 0x3d ; 61 3093c: de b7 in r29, 0x3e ; 62 { if(!mounted) 3093e: 20 91 6c 14 lds r18, 0x146C ; 0x80146c 30942: 22 23 and r18, r18 30944: 69 f1 breq .+90 ; 0x309a0 30946: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30948: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 3094c: 88 23 and r24, r24 3094e: 79 f1 breq .+94 ; 0x309ae SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 30950: 81 ee ldi r24, 0xE1 ; 225 30952: 97 ea ldi r25, 0xA7 ; 167 30954: 0e 94 97 7b call 0xf72e ; 0xf72e 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; 30958: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b const char *fname=name; 3095c: 1a 83 std Y+2, r17 ; 0x02 3095e: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 30960: ce 01 movw r24, r28 30962: 01 96 adiw r24, 0x01 ; 1 30964: 0f 94 f7 7d call 0x2fbee ; 0x2fbee 30968: 88 23 and r24, r24 3096a: d1 f0 breq .+52 ; 0x309a0 return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 3096c: 49 81 ldd r20, Y+1 ; 0x01 3096e: 5a 81 ldd r21, Y+2 ; 0x02 30970: 60 91 14 15 lds r22, 0x1514 ; 0x801514 30974: 70 91 15 15 lds r23, 0x1515 ; 0x801515 30978: 26 e5 ldi r18, 0x56 ; 86 3097a: 8b ef ldi r24, 0xFB ; 251 3097c: 96 e1 ldi r25, 0x16 ; 22 3097e: 0f 94 bc d6 call 0x3ad78 ; 0x3ad78 30982: 81 11 cpse r24, r1 30984: 22 c0 rjmp .+68 ; 0x309ca SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30986: 83 ea ldi r24, 0xA3 ; 163 30988: 91 e7 ldi r25, 0x71 ; 113 3098a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 3098e: 89 81 ldd r24, Y+1 ; 0x01 30990: 9a 81 ldd r25, Y+2 ; 0x02 30992: 0e 94 d0 89 call 0x113a0 ; 0x113a0 30996: 8e e2 ldi r24, 0x2E ; 46 30998: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 3099c: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 309a0: 0f 90 pop r0 309a2: 0f 90 pop r0 309a4: df 91 pop r29 309a6: cf 91 pop r28 309a8: 1f 91 pop r17 309aa: 0f 91 pop r16 309ac: 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 309ae: 10 92 1e 17 sts 0x171E, r1 ; 0x80171e SERIAL_ECHO_START; 309b2: 84 e1 ldi r24, 0x14 ; 20 309b4: 9b ea ldi r25, 0xAB ; 171 309b6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHORPGM(ofNowFreshFile); 309ba: 86 ee ldi r24, 0xE6 ; 230 309bc: 99 ea ldi r25, 0xA9 ; 169 309be: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN(name); 309c2: c8 01 movw r24, r16 309c4: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 309c8: c7 cf rjmp .-114 ; 0x30958 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; 309ca: 81 e0 ldi r24, 0x01 ; 1 309cc: 80 93 69 14 sts 0x1469, r24 ; 0x801469 getfilename(0, fname); 309d0: 89 81 ldd r24, Y+1 ; 0x01 309d2: 9a 81 ldd r25, Y+2 ; 0x02 309d4: 0f 94 dd 79 call 0x2f3ba ; 0x2f3ba SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 309d8: 8f ec ldi r24, 0xCF ; 207 309da: 97 ea ldi r25, 0xA7 ; 167 309dc: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 printAbsFilenameFast(); 309e0: 0f 94 c0 7a call 0x2f580 ; 0x2f580 SERIAL_PROTOCOLLN(); 309e4: 0f 94 11 d6 call 0x3ac22 ; 0x3ac22 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 309e8: 82 ec ldi r24, 0xC2 ; 194 309ea: 99 ea ldi r25, 0xA9 ; 169 309ec: 0e 94 97 7b call 0xf72e ; 0xf72e lcd_setstatuspgm(ofFileSelected); 309f0: 82 ec ldi r24, 0xC2 ; 194 309f2: 99 ea ldi r25, 0xA9 ; 169 309f4: 0f 94 e0 0a call 0x215c0 ; 0x215c0 scrollstuff = 0; 309f8: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 309fc: d1 cf rjmp .-94 ; 0x309a0 000309fe : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 309fe: 0f 93 push r16 30a00: 1f 93 push r17 30a02: cf 93 push r28 30a04: df 93 push r29 30a06: ec 01 movw r28, r24 { memset(ip, 0, 4); 30a08: 84 e0 ldi r24, 0x04 ; 4 30a0a: fe 01 movw r30, r28 30a0c: 11 92 st Z+, r1 30a0e: 8a 95 dec r24 30a10: e9 f7 brne .-6 ; 0x30a0c /** 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 30a12: 23 e0 ldi r18, 0x03 ; 3 30a14: 30 ea ldi r19, 0xA0 ; 160 30a16: 4a e0 ldi r20, 0x0A ; 10 30a18: 50 e9 ldi r21, 0x90 ; 144 30a1a: 60 e3 ldi r22, 0x30 ; 48 30a1c: 88 ed ldi r24, 0xD8 ; 216 30a1e: 96 e1 ldi r25, 0x16 ; 22 30a20: 0f 94 56 a5 call 0x34aac ; 0x34aac 30a24: 88 23 and r24, r24 30a26: 91 f0 breq .+36 ; 0x30a4c 30a28: 23 e0 ldi r18, 0x03 ; 3 30a2a: 30 ea ldi r19, 0xA0 ; 160 30a2c: 4a e0 ldi r20, 0x0A ; 10 30a2e: 50 e9 ldi r21, 0x90 ; 144 30a30: 61 e1 ldi r22, 0x11 ; 17 30a32: 88 ed ldi r24, 0xD8 ; 216 30a34: 96 e1 ldi r25, 0x16 ; 22 30a36: 0f 94 56 a5 call 0x34aac ; 0x34aac 30a3a: 88 23 and r24, r24 30a3c: 39 f0 breq .+14 ; 0x30a4c bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30a3e: 80 e8 ldi r24, 0x80 ; 128 30a40: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30a44: 0f 94 5e 75 call 0x2eabc ; 0x2eabc return false; 30a48: 80 e0 ldi r24, 0x00 ; 0 30a4a: 2f c0 rjmp .+94 ; 0x30aaa //------------------------------------------------------------------------------ /** 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(); 30a4c: 0f 94 55 3e call 0x27caa ; 0x27caa 30a50: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30a52: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 30a56: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da 30a5a: 8f 3f cpi r24, 0xFF ; 255 30a5c: 69 f4 brne .+26 ; 0x30a78 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30a5e: 0f 94 55 3e call 0x27caa ; 0x27caa 30a62: 60 1b sub r22, r16 30a64: 71 0b sbc r23, r17 30a66: 6d 32 cpi r22, 0x2D ; 45 30a68: 71 40 sbci r23, 0x01 ; 1 30a6a: 98 f3 brcs .-26 ; 0x30a52 30a6c: 81 e1 ldi r24, 0x11 ; 17 30a6e: 80 93 d8 16 sts 0x16D8, r24 ; 0x8016d8 goto fail; } return true; fail: chipSelectHigh(); 30a72: 0f 94 5e 75 call 0x2eabc ; 0x2eabc 30a76: e6 cf rjmp .-52 ; 0x30a44 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30a78: 8e 3f cpi r24, 0xFE ; 254 30a7a: 11 f0 breq .+4 ; 0x30a80 30a7c: 8f e0 ldi r24, 0x0F ; 15 30a7e: f7 cf rjmp .-18 ; 0x30a6e 30a80: 8e 01 movw r16, r28 30a82: 0c 5f subi r16, 0xFC ; 252 30a84: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30a86: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 30a8a: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30a8c: c0 17 cp r28, r16 30a8e: d1 07 cpc r29, r17 30a90: d1 f7 brne .-12 ; 0x30a86 30a92: ce ef ldi r28, 0xFE ; 254 30a94: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30a96: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 30a9a: 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) { 30a9c: e1 f7 brne .-8 ; 0x30a96 spiRec(); } chipSelectHigh(); 30a9e: 0f 94 5e 75 call 0x2eabc ; 0x2eabc spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30aa2: 8f ef ldi r24, 0xFF ; 255 30aa4: 0f 94 4a a5 call 0x34a94 ; 0x34a94 30aa8: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30aaa: df 91 pop r29 30aac: cf 91 pop r28 30aae: 1f 91 pop r17 30ab0: 0f 91 pop r16 30ab2: 08 95 ret 00030ab4 : } 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) 30ab4: 8f 92 push r8 30ab6: 9f 92 push r9 30ab8: af 92 push r10 30aba: bf 92 push r11 30abc: cf 92 push r12 30abe: df 92 push r13 30ac0: ef 92 push r14 30ac2: ff 92 push r15 30ac4: 0f 93 push r16 30ac6: 1f 93 push r17 30ac8: cf 93 push r28 30aca: df 93 push r29 30acc: 1f 92 push r1 30ace: cd b7 in r28, 0x3d ; 61 30ad0: de b7 in r29, 0x3e ; 62 30ad2: 6b 01 movw r12, r22 30ad4: 7c 01 movw r14, r24 30ad6: 49 01 movw r8, r18 30ad8: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30ada: 03 30 cpi r16, 0x03 ; 3 30adc: 19 f4 brne .+6 ; 0x30ae4 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30ade: 8c e5 ldi r24, 0x5C ; 92 30ae0: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30ae2: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30ae4: 81 14 cp r8, r1 30ae6: 91 04 cpc r9, r1 30ae8: a1 04 cpc r10, r1 30aea: b1 04 cpc r11, r1 30aec: 09 f4 brne .+2 ; 0x30af0 30aee: 59 c0 rjmp .+178 ; 0x30ba2 #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30af0: 8e 2d mov r24, r14 30af2: 0e 94 cd 78 call 0xf19a ; 0xf19a #endif print_hex_byte((val >> 8) & 0xFF); 30af6: 8d 2d mov r24, r13 30af8: 0e 94 cd 78 call 0xf19a ; 0xf19a print_hex_byte(val & 0xFF); 30afc: 8c 2d mov r24, r12 30afe: 0e 94 cd 78 call 0xf19a ; 0xf19a XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30b02: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 30b06: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 30b0a: 80 e2 ldi r24, 0x20 ; 32 30b0c: 90 e0 ldi r25, 0x00 ; 0 30b0e: 0f 94 77 db call 0x3b6ee ; 0x3b6ee uint8_t count_line = countperline; 30b12: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30b14: 19 82 std Y+1, r1 ; 0x01 switch (type) 30b16: 01 30 cpi r16, 0x01 ; 1 30b18: b1 f1 breq .+108 ; 0x30b86 30b1a: 88 f1 brcs .+98 ; 0x30b7e 30b1c: 03 30 cpi r16, 0x03 ; 3 30b1e: b9 f1 breq .+110 ; 0x30b8e case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30b20: 8f ef ldi r24, 0xFF ; 255 30b22: c8 1a sub r12, r24 30b24: d8 0a sbc r13, r24 30b26: e8 0a sbc r14, r24 30b28: f8 0a sbc r15, r24 putchar(' '); 30b2a: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 30b2e: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 30b32: 80 e2 ldi r24, 0x20 ; 32 30b34: 90 e0 ldi r25, 0x00 ; 0 30b36: 0f 94 77 db call 0x3b6ee ; 0x3b6ee print_hex_byte(data); 30b3a: 89 81 ldd r24, Y+1 ; 0x01 30b3c: 0e 94 cd 78 call 0xf19a ; 0xf19a count_line--; 30b40: 11 50 subi r17, 0x01 ; 1 count--; 30b42: 81 e0 ldi r24, 0x01 ; 1 30b44: 88 1a sub r8, r24 30b46: 91 08 sbc r9, r1 30b48: a1 08 sbc r10, r1 30b4a: 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)) 30b4c: 0f b6 in r0, 0x3f ; 63 30b4e: 07 fe sbrs r0, 7 30b50: 06 c0 rjmp .+12 ; 0x30b5e 30b52: c4 01 movw r24, r8 30b54: 9f 71 andi r25, 0x1F ; 31 30b56: 89 2b or r24, r25 30b58: 11 f4 brne .+4 ; 0x30b5e manage_heater(); 30b5a: 0f 94 66 4d call 0x29acc ; 0x29acc while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30b5e: 81 14 cp r8, r1 30b60: 91 04 cpc r9, r1 30b62: a1 04 cpc r10, r1 30b64: b1 04 cpc r11, r1 30b66: 11 f0 breq .+4 ; 0x30b6c 30b68: 11 11 cpse r17, r1 30b6a: d4 cf rjmp .-88 ; 0x30b14 // 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'); 30b6c: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 30b70: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 30b74: 8a e0 ldi r24, 0x0A ; 10 30b76: 90 e0 ldi r25, 0x00 ; 0 30b78: 0f 94 77 db call 0x3b6ee ; 0x3b6ee 30b7c: b3 cf rjmp .-154 ; 0x30ae4 while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30b7e: f6 01 movw r30, r12 30b80: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30b82: 89 83 std Y+1, r24 ; 0x01 30b84: cd cf rjmp .-102 ; 0x30b20 30b86: c6 01 movw r24, r12 30b88: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 30b8c: fa cf rjmp .-12 ; 0x30b82 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; 30b8e: 21 e0 ldi r18, 0x01 ; 1 30b90: 30 e0 ldi r19, 0x00 ; 0 30b92: ae 01 movw r20, r28 30b94: 4f 5f subi r20, 0xFF ; 255 30b96: 5f 4f sbci r21, 0xFF ; 255 30b98: c7 01 movw r24, r14 30b9a: b6 01 movw r22, r12 30b9c: 0e 94 99 e2 call 0x1c532 ; 0x1c532 30ba0: bf cf rjmp .-130 ; 0x30b20 if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30ba2: 0f 90 pop r0 30ba4: df 91 pop r29 30ba6: cf 91 pop r28 30ba8: 1f 91 pop r17 30baa: 0f 91 pop r16 30bac: ff 90 pop r15 30bae: ef 90 pop r14 30bb0: df 90 pop r13 30bb2: cf 90 pop r12 30bb4: bf 90 pop r11 30bb6: af 90 pop r10 30bb8: 9f 90 pop r9 30bba: 8f 90 pop r8 30bbc: 08 95 ret 00030bbe : 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 30bbe: e7 e0 ldi r30, 0x07 ; 7 30bc0: f1 e0 ldi r31, 0x01 ; 1 30bc2: 80 81 ld r24, Z 30bc4: 8e 7f andi r24, 0xFE ; 254 30bc6: 80 83 st Z, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup 30bc8: 9f b7 in r25, 0x3f ; 63 30bca: f8 94 cli 30bcc: e8 e0 ldi r30, 0x08 ; 8 30bce: f1 e0 ldi r31, 0x01 ; 1 30bd0: 80 81 ld r24, Z 30bd2: 8e 7f andi r24, 0xFE ; 254 30bd4: 80 83 st Z, r24 30bd6: 9f bf out 0x3f, r25 ; 63 state = State::disabled; 30bd8: 10 92 85 17 sts 0x1785, r1 ; 0x801785 } 30bdc: 08 95 ret 00030bde : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 30bde: 80 91 85 17 lds r24, 0x1785 ; 0x801785 30be2: 83 30 cpi r24, 0x03 ; 3 30be4: 11 f4 brne .+4 ; 0x30bea fsensor.deinit(); // deinit first if there was an error. 30be6: 0f 94 df 85 call 0x30bbe ; 0x30bbe } // puts_P(PSTR("fsensor::init()")); SET_INPUT(IR_SENSOR_PIN); // input mode 30bea: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 30bee: 8e 7f andi r24, 0xFE ; 254 30bf0: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 30bf4: 9f b7 in r25, 0x3f ; 63 30bf6: f8 94 cli 30bf8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30bfc: 81 60 ori r24, 0x01 ; 1 30bfe: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30c02: 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(); } 30c04: 85 e8 ldi r24, 0x85 ; 133 30c06: 97 e1 ldi r25, 0x17 ; 23 30c08: 0e 94 15 76 call 0xec2a ; 0xec2a 30c0c: 85 e8 ldi r24, 0x85 ; 133 30c0e: 97 e1 ldi r25, 0x17 ; 23 30c10: 0e 94 15 76 call 0xec2a ; 0xec2a #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); 30c14: 88 e4 ldi r24, 0x48 ; 72 30c16: 9d e0 ldi r25, 0x0D ; 13 30c18: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 30c1c: 80 93 8e 17 sts 0x178E, r24 ; 0x80178e } 30c20: 08 95 ret 00030c22 : //! //! @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) 30c22: cf 92 push r12 30c24: df 92 push r13 30c26: ef 92 push r14 30c28: ff 92 push r15 30c2a: 69 01 movw r12, r18 30c2c: 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); 30c2e: 2d ec ldi r18, 0xCD ; 205 30c30: 3c ec ldi r19, 0xCC ; 204 30c32: 4c e4 ldi r20, 0x4C ; 76 30c34: 5e e3 ldi r21, 0x3E ; 62 30c36: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 30c3a: 2d ec ldi r18, 0xCD ; 205 30c3c: 3c ec ldi r19, 0xCC ; 204 30c3e: 4c e4 ldi r20, 0x4C ; 76 30c40: 5e e3 ldi r21, 0x3E ; 62 30c42: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 30c46: 2d ef ldi r18, 0xFD ; 253 30c48: 3d ea ldi r19, 0xAD ; 173 30c4a: 40 e0 ldi r20, 0x00 ; 0 30c4c: 5d e3 ldi r21, 0x3D ; 61 30c4e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 30c52: a7 01 movw r20, r14 30c54: 96 01 movw r18, r12 30c56: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 30c5a: 24 e2 ldi r18, 0x24 ; 36 30c5c: 30 ef ldi r19, 0xF0 ; 240 30c5e: 49 e1 ldi r20, 0x19 ; 25 30c60: 50 e4 ldi r21, 0x40 ; 64 30c62: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> } 30c66: ff 90 pop r15 30c68: ef 90 pop r14 30c6a: df 90 pop r13 30c6c: cf 90 pop r12 30c6e: 08 95 ret 00030c70 : //! //! 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) 30c70: 2f 92 push r2 30c72: 3f 92 push r3 30c74: 4f 92 push r4 30c76: 5f 92 push r5 30c78: 6f 92 push r6 30c7a: 7f 92 push r7 30c7c: 8f 92 push r8 30c7e: 9f 92 push r9 30c80: af 92 push r10 30c82: bf 92 push r11 30c84: cf 92 push r12 30c86: df 92 push r13 30c88: ef 92 push r14 30c8a: ff 92 push r15 30c8c: 0f 93 push r16 30c8e: 1f 93 push r17 30c90: cf 93 push r28 30c92: df 93 push r29 30c94: 00 d0 rcall .+0 ; 0x30c96 30c96: 1f 92 push r1 30c98: 1f 92 push r1 30c9a: cd b7 in r28, 0x3d ; 61 30c9c: de b7 in r29, 0x3e ; 62 30c9e: 8c 83 std Y+4, r24 ; 0x04 30ca0: 4a 01 movw r8, r20 30ca2: 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); 30ca4: 23 e4 ldi r18, 0x43 ; 67 30ca6: 3d ec ldi r19, 0xCD ; 205 30ca8: 4f e2 ldi r20, 0x2F ; 47 30caa: 5d e3 ldi r21, 0x3D ; 61 30cac: cb 01 movw r24, r22 30cae: b4 01 movw r22, r8 30cb0: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 30cb4: 6b 01 movw r12, r22 30cb6: 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); 30cb8: 20 e0 ldi r18, 0x00 ; 0 30cba: 30 e0 ldi r19, 0x00 ; 0 30cbc: 40 ea ldi r20, 0xA0 ; 160 30cbe: 51 e4 ldi r21, 0x41 ; 65 30cc0: c5 01 movw r24, r10 30cc2: b4 01 movw r22, r8 30cc4: 0f 94 11 86 call 0x30c22 ; 0x30c22 30cc8: 56 2e mov r5, r22 30cca: 47 2e mov r4, r23 30ccc: 38 2e mov r3, r24 30cce: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 30cd0: a7 01 movw r20, r14 30cd2: 96 01 movw r18, r12 30cd4: c5 01 movw r24, r10 30cd6: b4 01 movw r22, r8 30cd8: 0f 94 11 86 call 0x30c22 ; 0x30c22 30cdc: 69 83 std Y+1, r22 ; 0x01 30cde: 7a 83 std Y+2, r23 ; 0x02 30ce0: 8b 83 std Y+3, r24 ; 0x03 30ce2: 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) 30ce4: bc 80 ldd r11, Y+4 ; 0x04 30ce6: 8b 2d mov r24, r11 30ce8: 90 e0 ldi r25, 0x00 ; 0 30cea: 9c 01 movw r18, r24 30cec: 2d 5f subi r18, 0xFD ; 253 30cee: 3f 4f sbci r19, 0xFF ; 255 30cf0: 3d 83 std Y+5, r19 ; 0x05 30cf2: 2c 83 std Y+4, r18 ; 0x04 30cf4: 0b 2d mov r16, r11 30cf6: 10 e0 ldi r17, 0x00 ; 0 30cf8: 8c 81 ldd r24, Y+4 ; 0x04 30cfa: 9d 81 ldd r25, Y+5 ; 0x05 30cfc: 80 17 cp r24, r16 30cfe: 91 07 cpc r25, r17 30d00: 0c f4 brge .+2 ; 0x30d04 30d02: a1 c0 rjmp .+322 ; 0x30e46 { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 30d04: 2f 92 push r2 30d06: 3f 92 push r3 30d08: 4f 92 push r4 30d0a: 5f 92 push r5 30d0c: b8 01 movw r22, r16 30d0e: 01 2e mov r0, r17 30d10: 00 0c add r0, r0 30d12: 88 0b sbc r24, r24 30d14: 99 0b sbc r25, r25 30d16: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 30d1a: a7 01 movw r20, r14 30d1c: 96 01 movw r18, r12 30d1e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 30d22: 9b 01 movw r18, r22 30d24: ac 01 movw r20, r24 30d26: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 30d2a: 9b 01 movw r18, r22 30d2c: ac 01 movw r20, r24 30d2e: 60 e0 ldi r22, 0x00 ; 0 30d30: 70 e0 ldi r23, 0x00 ; 0 30d32: 8c e0 ldi r24, 0x0C ; 12 30d34: 92 e4 ldi r25, 0x42 ; 66 30d36: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 30d3a: 9f 93 push r25 30d3c: 8f 93 push r24 30d3e: 7f 93 push r23 30d40: 6f 93 push r22 30d42: 1f 92 push r1 30d44: 96 e4 ldi r25, 0x46 ; 70 30d46: 9f 93 push r25 30d48: 2a eb ldi r18, 0xBA ; 186 30d4a: 37 ea ldi r19, 0xA7 ; 167 30d4c: 3f 93 push r19 30d4e: 2f 93 push r18 30d50: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 30d54: b8 01 movw r22, r16 30d56: 66 0f add r22, r22 30d58: 77 1f adc r23, r23 30d5a: 6f 5f subi r22, 0xFF ; 255 30d5c: 7f 4f sbci r23, 0xFF ; 255 30d5e: 07 2e mov r0, r23 30d60: 00 0c add r0, r0 30d62: 88 0b sbc r24, r24 30d64: 99 0b sbc r25, r25 30d66: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 30d6a: a7 01 movw r20, r14 30d6c: 96 01 movw r18, r12 30d6e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 30d72: 9b 01 movw r18, r22 30d74: ac 01 movw r20, r24 30d76: 60 e0 ldi r22, 0x00 ; 0 30d78: 70 e0 ldi r23, 0x00 ; 0 30d7a: 8c e0 ldi r24, 0x0C ; 12 30d7c: 92 e4 ldi r25, 0x42 ; 66 30d7e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 30d82: 96 2e mov r9, r22 30d84: 87 2e mov r8, r23 30d86: 78 2e mov r7, r24 30d88: 69 2e mov r6, r25 30d8a: af 92 push r10 30d8c: 9b 81 ldd r25, Y+3 ; 0x03 30d8e: 9f 93 push r25 30d90: 2a 81 ldd r18, Y+2 ; 0x02 30d92: 2f 93 push r18 30d94: 39 81 ldd r19, Y+1 ; 0x01 30d96: 3f 93 push r19 30d98: 6f 92 push r6 30d9a: 7f 92 push r7 30d9c: 8f 92 push r8 30d9e: 9f 92 push r9 30da0: 1f 92 push r1 30da2: 86 e4 ldi r24, 0x46 ; 70 30da4: 8f 93 push r24 30da6: 2a eb ldi r18, 0xBA ; 186 30da8: 37 ea ldi r19, 0xA7 ; 167 30daa: 3f 93 push r19 30dac: 2f 93 push r18 30dae: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 30db2: 2f 92 push r2 30db4: 3f 92 push r3 30db6: 4f 92 push r4 30db8: 5f 92 push r5 30dba: 6f 92 push r6 30dbc: 7f 92 push r7 30dbe: 8f 92 push r8 30dc0: 9f 92 push r9 30dc2: 1f 92 push r1 30dc4: 92 e3 ldi r25, 0x32 ; 50 30dc6: 9f 93 push r25 30dc8: 2a eb ldi r18, 0xBA ; 186 30dca: 37 ea ldi r19, 0xA7 ; 167 30dcc: 3f 93 push r19 30dce: 2f 93 push r18 30dd0: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 30dd4: 0f b6 in r0, 0x3f ; 63 30dd6: f8 94 cli 30dd8: de bf out 0x3e, r29 ; 62 30dda: 0f be out 0x3f, r0 ; 63 30ddc: cd bf out 0x3d, r28 ; 61 30dde: af 92 push r10 30de0: 3b 81 ldd r19, Y+3 ; 0x03 30de2: 3f 93 push r19 30de4: 8a 81 ldd r24, Y+2 ; 0x02 30de6: 8f 93 push r24 30de8: 99 81 ldd r25, Y+1 ; 0x01 30dea: 9f 93 push r25 30dec: b8 01 movw r22, r16 30dee: 6f 5f subi r22, 0xFF ; 255 30df0: 7f 4f sbci r23, 0xFF ; 255 30df2: 07 2e mov r0, r23 30df4: 00 0c add r0, r0 30df6: 88 0b sbc r24, r24 30df8: 99 0b sbc r25, r25 30dfa: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 30dfe: a7 01 movw r20, r14 30e00: 96 01 movw r18, r12 30e02: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 30e06: 9b 01 movw r18, r22 30e08: ac 01 movw r20, r24 30e0a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 30e0e: 9b 01 movw r18, r22 30e10: ac 01 movw r20, r24 30e12: 60 e0 ldi r22, 0x00 ; 0 30e14: 70 e0 ldi r23, 0x00 ; 0 30e16: 8c e0 ldi r24, 0x0C ; 12 30e18: 92 e4 ldi r25, 0x42 ; 66 30e1a: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 30e1e: 9f 93 push r25 30e20: 8f 93 push r24 30e22: 7f 93 push r23 30e24: 6f 93 push r22 30e26: 1f 92 push r1 30e28: 22 e3 ldi r18, 0x32 ; 50 30e2a: 2f 93 push r18 30e2c: 8a eb ldi r24, 0xBA ; 186 30e2e: 97 ea ldi r25, 0xA7 ; 167 30e30: 9f 93 push r25 30e32: 8f 93 push r24 30e34: 0e 94 72 8a call 0x114e4 ; 0x114e4 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) 30e38: b3 94 inc r11 30e3a: 0f b6 in r0, 0x3f ; 63 30e3c: f8 94 cli 30e3e: de bf out 0x3e, r29 ; 62 30e40: 0f be out 0x3f, r0 ; 63 30e42: cd bf out 0x3d, r28 ; 61 30e44: 57 cf rjmp .-338 ; 0x30cf4 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); } } 30e46: 0f 90 pop r0 30e48: 0f 90 pop r0 30e4a: 0f 90 pop r0 30e4c: 0f 90 pop r0 30e4e: 0f 90 pop r0 30e50: df 91 pop r29 30e52: cf 91 pop r28 30e54: 1f 91 pop r17 30e56: 0f 91 pop r16 30e58: ff 90 pop r15 30e5a: ef 90 pop r14 30e5c: df 90 pop r13 30e5e: cf 90 pop r12 30e60: bf 90 pop r11 30e62: af 90 pop r10 30e64: 9f 90 pop r9 30e66: 8f 90 pop r8 30e68: 7f 90 pop r7 30e6a: 6f 90 pop r6 30e6c: 5f 90 pop r5 30e6e: 4f 90 pop r4 30e70: 3f 90 pop r3 30e72: 2f 90 pop r2 30e74: 08 95 ret 00030e76 : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 30e76: 9f b7 in r25, 0x3f ; 63 30e78: 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)); 30e7a: 80 e1 ldi r24, 0x10 ; 16 30e7c: e1 e5 ldi r30, 0x51 ; 81 30e7e: f7 e0 ldi r31, 0x07 ; 7 30e80: a1 e6 ldi r26, 0x61 ; 97 30e82: b7 e0 ldi r27, 0x07 ; 7 30e84: 01 90 ld r0, Z+ 30e86: 0d 92 st X+, r0 30e88: 8a 95 dec r24 30e8a: e1 f7 brne .-8 ; 0x30e84 CRITICAL_SECTION_END; 30e8c: 9f bf out 0x3f, r25 ; 63 } 30e8e: 08 95 ret 00030e90 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 30e90: 89 e0 ldi r24, 0x09 ; 9 30e92: 80 93 72 07 sts 0x0772, r24 ; 0x800772 }; 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])) 30e96: e7 ef ldi r30, 0xF7 ; 247 30e98: f7 ea ldi r31, 0xA7 ; 167 30e9a: 85 91 lpm r24, Z+ 30e9c: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 30e9e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 30ea2: 0d 94 e0 0a jmp 0x215c0 ; 0x215c0 00030ea6 : 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){ 30ea6: cf 93 push r28 30ea8: c8 2f mov r28, r24 extruder = ex; 30eaa: 80 93 7c 13 sts 0x137C, r24 ; 0x80137c MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 30eae: 84 e1 ldi r24, 0x14 ; 20 30eb0: 9b ea ldi r25, 0xAB ; 171 30eb2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 30eb6: 84 eb ldi r24, 0xB4 ; 180 30eb8: 97 ea ldi r25, 0xA7 ; 167 30eba: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 30ebe: 8a ea ldi r24, 0xAA ; 170 30ec0: 97 ea ldi r25, 0xA7 ; 167 30ec2: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN((int)ex); 30ec6: 8c 2f mov r24, r28 30ec8: 90 e0 ldi r25, 0x00 ; 0 } 30eca: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 30ecc: 0d 94 94 75 jmp 0x2eb28 ; 0x2eb28 00030ed0 : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 30ed0: 0f 93 push r16 30ed2: 1f 93 push r17 30ed4: cf 93 push r28 30ed6: df 93 push r29 30ed8: 00 d0 rcall .+0 ; 0x30eda 30eda: 00 d0 rcall .+0 ; 0x30edc 30edc: 1f 92 push r1 30ede: 1f 92 push r1 30ee0: cd b7 in r28, 0x3d ; 61 30ee2: de b7 in r29, 0x3e ; 62 30ee4: 08 ee ldi r16, 0xE8 ; 232 30ee6: 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; 30ee8: 1d 82 std Y+5, r1 ; 0x05 30eea: 1e 82 std Y+6, r1 ; 0x06 30eec: 1f 82 std Y+7, r1 ; 0x07 30eee: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 30ef0: 19 82 std Y+1, r1 ; 0x01 30ef2: 1a 82 std Y+2, r1 ; 0x02 30ef4: 1b 82 std Y+3, r1 ; 0x03 30ef6: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 30ef8: ae 01 movw r20, r28 30efa: 4b 5f subi r20, 0xFB ; 251 30efc: 5f 4f sbci r21, 0xFF ; 255 30efe: 6f e6 ldi r22, 0x6F ; 111 30f00: 80 e0 ldi r24, 0x00 ; 0 30f02: 0f 94 76 38 call 0x270ec ; 0x270ec tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 30f06: ae 01 movw r20, r28 30f08: 4f 5f subi r20, 0xFF ; 255 30f0a: 5f 4f sbci r21, 0xFF ; 255 30f0c: 6f e6 ldi r22, 0x6F ; 111 30f0e: 81 e0 ldi r24, 0x01 ; 1 30f10: 0f 94 76 38 call 0x270ec ; 0x270ec // 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); 30f14: 8d 81 ldd r24, Y+5 ; 0x05 30f16: 9e 81 ldd r25, Y+6 ; 0x06 30f18: af 81 ldd r26, Y+7 ; 0x07 30f1a: b8 85 ldd r27, Y+8 ; 0x08 30f1c: b7 fd sbrc r27, 7 30f1e: 07 c0 rjmp .+14 ; 0x30f2e tmc2130_check_overtemp(); 30f20: 0f 94 f0 3e call 0x27de0 ; 0x27de0 30f24: 01 50 subi r16, 0x01 ; 1 30f26: 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)) 30f28: f9 f6 brne .-66 ; 0x30ee8 30f2a: 80 e0 ldi r24, 0x00 ; 0 30f2c: 09 c0 rjmp .+18 ; 0x30f40 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); 30f2e: 89 81 ldd r24, Y+1 ; 0x01 30f30: 9a 81 ldd r25, Y+2 ; 0x02 30f32: ab 81 ldd r26, Y+3 ; 0x03 30f34: bc 81 ldd r27, Y+4 ; 0x04 30f36: b7 ff sbrs r27, 7 30f38: f3 cf rjmp .-26 ; 0x30f20 tmc2130_check_overtemp(); 30f3a: 0f 94 f0 3e call 0x27de0 ; 0x27de0 30f3e: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 30f40: 28 96 adiw r28, 0x08 ; 8 30f42: 0f b6 in r0, 0x3f ; 63 30f44: f8 94 cli 30f46: de bf out 0x3e, r29 ; 62 30f48: 0f be out 0x3f, r0 ; 63 30f4a: cd bf out 0x3d, r28 ; 61 30f4c: df 91 pop r29 30f4e: cf 91 pop r28 30f50: 1f 91 pop r17 30f52: 0f 91 pop r16 30f54: 08 95 ret 00030f56 : 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) { 30f56: 1f 93 push r17 30f58: cf 93 push r28 30f5a: df 93 push r29 30f5c: ec 01 movw r28, r24 30f5e: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 30f60: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 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))); 30f64: fe 01 movw r30, r28 30f66: 34 96 adiw r30, 0x04 ; 4 30f68: 25 91 lpm r18, Z+ 30f6a: 35 91 lpm r19, Z+ 30f6c: 45 91 lpm r20, Z+ 30f6e: 54 91 lpm r21, Z 30f70: fe 01 movw r30, r28 30f72: 65 91 lpm r22, Z+ 30f74: 75 91 lpm r23, Z+ 30f76: 85 91 lpm r24, Z+ 30f78: 94 91 lpm r25, Z 30f7a: 0f 94 ae c2 call 0x3855c ; 0x3855c step++; 30f7e: 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) { 30f80: 11 50 subi r17, 0x01 ; 1 30f82: 81 f7 brne .-32 ; 0x30f64 30f84: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // 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(); } 30f88: df 91 pop r29 30f8a: cf 91 pop r28 30f8c: 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(); 30f8e: 0d 94 ac c2 jmp 0x38558 ; 0x38558 00030f92 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 30f92: 0e 94 d6 68 call 0xd1ac ; 0xd1ac 30f96: 81 11 cpse r24, r1 30f98: 04 c0 rjmp .+8 ; 0x30fa2 lcd_setstatuspgm(MSG_WELCOME); 30f9a: 81 e5 ldi r24, 0x51 ; 81 30f9c: 91 e7 ldi r25, 0x71 ; 113 30f9e: 0f 94 e0 0a call 0x215c0 ; 0x215c0 } custom_message_type = CustomMsg::Status; 30fa2: 10 92 72 07 sts 0x0772, r1 ; 0x800772 } 30fa6: 08 95 ret 00030fa8 : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 30fa8: 80 91 95 13 lds r24, 0x1395 ; 0x801395 30fac: 88 23 and r24, r24 30fae: 11 f0 breq .+4 ; 0x30fb4 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; 30fb0: 81 e0 ldi r24, 0x01 ; 1 30fb2: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 30fb4: 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; } } 30fb6: 08 95 ret 00030fb8 : } 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) 30fb8: 2f 92 push r2 30fba: 3f 92 push r3 30fbc: 4f 92 push r4 30fbe: 5f 92 push r5 30fc0: 6f 92 push r6 30fc2: 7f 92 push r7 30fc4: 8f 92 push r8 30fc6: 9f 92 push r9 30fc8: af 92 push r10 30fca: bf 92 push r11 30fcc: cf 92 push r12 30fce: df 92 push r13 30fd0: ef 92 push r14 30fd2: ff 92 push r15 30fd4: 0f 93 push r16 30fd6: 1f 93 push r17 30fd8: cf 93 push r28 30fda: df 93 push r29 30fdc: cd b7 in r28, 0x3d ; 61 30fde: de b7 in r29, 0x3e ; 62 30fe0: 2d 97 sbiw r28, 0x0d ; 13 30fe2: 0f b6 in r0, 0x3f ; 63 30fe4: f8 94 cli 30fe6: de bf out 0x3e, r29 ; 62 30fe8: 0f be out 0x3f, r0 ; 63 30fea: cd bf out 0x3d, r28 ; 61 30fec: 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; 30fee: 41 2c mov r4, r1 30ff0: 51 2c mov r5, r1 30ff2: 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; 30ff4: 6e 31 cpi r22, 0x1E ; 30 30ff6: 90 f0 brcs .+36 ; 0x3101c 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 30ff8: 69 3c cpi r22, 0xC9 ; 201 30ffa: 08 f0 brcs .+2 ; 0x30ffe 30ffc: 68 ec ldi r22, 0xC8 ; 200 30ffe: 70 e0 ldi r23, 0x00 ; 0 31000: 68 51 subi r22, 0x18 ; 24 31002: 7c 4f sbci r23, 0xFC ; 252 31004: 90 e0 ldi r25, 0x00 ; 0 31006: 80 e0 ldi r24, 0x00 ; 0 31008: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 3100c: 20 e0 ldi r18, 0x00 ; 0 3100e: 30 e0 ldi r19, 0x00 ; 0 31010: 4a e7 ldi r20, 0x7A ; 122 31012: 54 e4 ldi r21, 0x44 ; 68 31014: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 31018: 2b 01 movw r4, r22 3101a: 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) 3101c: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 31020: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 31024: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 31028: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 3102c: 89 83 std Y+1, r24 ; 0x01 3102e: 9a 83 std Y+2, r25 ; 0x02 31030: ab 83 std Y+3, r26 ; 0x03 31032: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 31034: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 31038: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 3103c: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 31040: 8d 83 std Y+5, r24 ; 0x05 31042: 9e 83 std Y+6, r25 ; 0x06 31044: 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); 31046: 20 e0 ldi r18, 0x00 ; 0 31048: 30 e0 ldi r19, 0x00 ; 0 3104a: 47 ef ldi r20, 0xF7 ; 247 3104c: 50 e0 ldi r21, 0x00 ; 0 3104e: 69 ee ldi r22, 0xE9 ; 233 31050: 8e 2d mov r24, r14 31052: 0f 94 d0 38 call 0x271a0 ; 0x271a0 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 31056: 81 2c mov r8, r1 31058: 91 2c mov r9, r1 3105a: 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 3105c: 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 3105e: 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 31060: 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 31062: 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 31064: 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) 31066: 2f 2c mov r2, r15 31068: 31 2c mov r3, r1 3106a: 8f 2d mov r24, r15 3106c: 8f 71 andi r24, 0x1F ; 31 3106e: 88 87 std Y+8, r24 ; 0x08 31070: 81 11 cpse r24, r1 31072: 03 c0 rjmp .+6 ; 0x3107a reg = 0; 31074: 81 2c mov r8, r1 31076: 91 2c mov r9, r1 31078: 54 01 movw r10, r8 3107a: b1 01 movw r22, r2 3107c: 03 2c mov r0, r3 3107e: 00 0c add r0, r0 31080: 88 0b sbc r24, r24 31082: 99 0b sbc r25, r25 31084: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 31088: 2b ed ldi r18, 0xDB ; 219 3108a: 3f e0 ldi r19, 0x0F ; 15 3108c: 49 ec ldi r20, 0xC9 ; 201 3108e: 50 e4 ldi r21, 0x40 ; 64 31090: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31094: 6a 87 std Y+10, r22 ; 0x0a 31096: 7b 87 std Y+11, r23 ; 0x0b 31098: 8c 87 std Y+12, r24 ; 0x0c 3109a: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 3109c: 20 e0 ldi r18, 0x00 ; 0 3109e: 30 e0 ldi r19, 0x00 ; 0 310a0: a9 01 movw r20, r18 310a2: c3 01 movw r24, r6 310a4: b2 01 movw r22, r4 310a6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 310aa: 81 11 cpse r24, r1 310ac: 4d c0 rjmp .+154 ; 0x31148 vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 310ae: 2b ed ldi r18, 0xDB ; 219 310b0: 3f e0 ldi r19, 0x0F ; 15 310b2: 49 e4 ldi r20, 0x49 ; 73 310b4: 50 e4 ldi r21, 0x40 ; 64 310b6: 6a 85 ldd r22, Y+10 ; 0x0a 310b8: 7b 85 ldd r23, Y+11 ; 0x0b 310ba: 8c 85 ldd r24, Y+12 ; 0x0c 310bc: 9d 85 ldd r25, Y+13 ; 0x0d 310be: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 310c2: 20 e0 ldi r18, 0x00 ; 0 310c4: 30 e0 ldi r19, 0x00 ; 0 310c6: 40 e8 ldi r20, 0x80 ; 128 310c8: 5a e3 ldi r21, 0x3A ; 58 310ca: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 310ce: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 310d2: 20 e0 ldi r18, 0x00 ; 0 310d4: 30 e0 ldi r19, 0x00 ; 0 310d6: 48 e7 ldi r20, 0x78 ; 120 310d8: 53 e4 ldi r21, 0x43 ; 67 310da: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 310de: 20 e0 ldi r18, 0x00 ; 0 310e0: 30 e0 ldi r19, 0x00 ; 0 310e2: 40 e0 ldi r20, 0x00 ; 0 310e4: 5f e3 ldi r21, 0x3F ; 63 310e6: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 310ea: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 310ee: cc 24 eor r12, r12 310f0: ca 94 dec r12 310f2: 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 310f4: 8c 2d mov r24, r12 310f6: 99 85 ldd r25, Y+9 ; 0x09 310f8: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 310fa: 8d 15 cp r24, r13 310fc: f9 f0 breq .+62 ; 0x3113c else if (dA == d1) b = 1; //delta == delta1 => bit=1 310fe: 80 17 cp r24, r16 31100: 09 f4 brne .+2 ; 0x31104 31102: 71 c0 rjmp .+226 ; 0x311e6 else { if (dA < d0) // delta < delta0 => switch wbit down 31104: 8d 15 cp r24, r13 31106: 0c f0 brlt .+2 ; 0x3110a 31108: 53 c0 rjmp .+166 ; 0x311b0 { //printf("dn\n"); b = 0; switch (dA) 3110a: 88 23 and r24, r24 3110c: e9 f1 breq .+122 ; 0x31188 3110e: 81 30 cpi r24, 0x01 ; 1 31110: 09 f4 brne .+2 ; 0x31114 31112: 44 c0 rjmp .+136 ; 0x3119c 31114: 8f 3f cpi r24, 0xFF ; 255 31116: 09 f0 breq .+2 ; 0x3111a 31118: 81 c0 rjmp .+258 ; 0x3121c { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 3111a: e2 e0 ldi r30, 0x02 ; 2 3111c: f0 e0 ldi r31, 0x00 ; 0 3111e: ec 0f add r30, r28 31120: fd 1f adc r31, r29 31122: e1 0f add r30, r17 31124: f1 1d adc r31, r1 31126: 10 82 st Z, r1 31128: 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++; } 3112a: e5 e0 ldi r30, 0x05 ; 5 3112c: f0 e0 ldi r31, 0x00 ; 0 3112e: ec 0f add r30, r28 31130: fd 1f adc r31, r29 31132: e1 0f add r30, r17 31134: f1 1d adc r31, r1 31136: f0 82 st Z, r15 31138: 1f 5f subi r17, 0xFF ; 255 3113a: 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) 3113c: 14 30 cpi r17, 0x04 ; 4 3113e: 08 f4 brcc .+2 ; 0x31142 31140: 56 c0 rjmp .+172 ; 0x311ee 31142: 6c c0 rjmp .+216 ; 0x3121c 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); 31144: f8 2e mov r15, r24 31146: 8f cf rjmp .-226 ; 0x31066 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); 31148: 20 e0 ldi r18, 0x00 ; 0 3114a: 30 e0 ldi r19, 0x00 ; 0 3114c: 40 e8 ldi r20, 0x80 ; 128 3114e: 5a e3 ldi r21, 0x3A ; 58 31150: 6a 85 ldd r22, Y+10 ; 0x0a 31152: 7b 85 ldd r23, Y+11 ; 0x0b 31154: 8c 85 ldd r24, Y+12 ; 0x0c 31156: 9d 85 ldd r25, Y+13 ; 0x0d 31158: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3115c: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 31160: a3 01 movw r20, r6 31162: 92 01 movw r18, r4 31164: 0f 94 a7 e1 call 0x3c34e ; 0x3c34e 31168: 20 e0 ldi r18, 0x00 ; 0 3116a: 30 e0 ldi r19, 0x00 ; 0 3116c: 47 e7 ldi r20, 0x77 ; 119 3116e: 53 e4 ldi r21, 0x43 ; 67 31170: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31174: 20 e0 ldi r18, 0x00 ; 0 31176: 30 e0 ldi r19, 0x00 ; 0 31178: 40 e0 ldi r20, 0x00 ; 0 3117a: 5f e3 ldi r21, 0x3F ; 63 3117c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 31180: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 31184: c6 2e mov r12, r22 31186: b6 cf rjmp .-148 ; 0x310f4 //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; 31188: e2 e0 ldi r30, 0x02 ; 2 3118a: f0 e0 ldi r31, 0x00 ; 0 3118c: ec 0f add r30, r28 3118e: fd 1f adc r31, r29 31190: e1 0f add r30, r17 31192: f1 1d adc r31, r1 31194: 91 e0 ldi r25, 0x01 ; 1 31196: 90 83 st Z, r25 31198: 01 e0 ldi r16, 0x01 ; 1 3119a: c7 cf rjmp .-114 ; 0x3112a case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 3119c: e2 e0 ldi r30, 0x02 ; 2 3119e: f0 e0 ldi r31, 0x00 ; 0 311a0: ec 0f add r30, r28 311a2: fd 1f adc r31, r29 311a4: e1 0f add r30, r17 311a6: f1 1d adc r31, r1 311a8: 92 e0 ldi r25, 0x02 ; 2 311aa: 90 83 st Z, r25 311ac: 02 e0 ldi r16, 0x02 ; 2 311ae: bd cf rjmp .-134 ; 0x3112a default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 311b0: 08 17 cp r16, r24 311b2: a4 f5 brge .+104 ; 0x3121c { //printf("up\n"); b = 1; switch (dA) 311b4: 82 30 cpi r24, 0x02 ; 2 311b6: 09 f4 brne .+2 ; 0x311ba 311b8: 80 c0 rjmp .+256 ; 0x312ba 311ba: 83 30 cpi r24, 0x03 ; 3 311bc: 09 f4 brne .+2 ; 0x311c0 311be: 88 c0 rjmp .+272 ; 0x312d0 311c0: 81 30 cpi r24, 0x01 ; 1 311c2: 61 f5 brne .+88 ; 0x3121c { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 311c4: e2 e0 ldi r30, 0x02 ; 2 311c6: f0 e0 ldi r31, 0x00 ; 0 311c8: ec 0f add r30, r28 311ca: fd 1f adc r31, r29 311cc: e1 0f add r30, r17 311ce: f1 1d adc r31, r1 311d0: 80 83 st Z, r24 311d2: 01 e0 ldi r16, 0x01 ; 1 311d4: 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++; } 311d6: e5 e0 ldi r30, 0x05 ; 5 311d8: f0 e0 ldi r31, 0x00 ; 0 311da: ec 0f add r30, r28 311dc: fd 1f adc r31, r29 311de: e1 0f add r30, r17 311e0: f1 1d adc r31, r1 311e2: f0 82 st Z, r15 311e4: 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) 311e6: 14 30 cpi r17, 0x04 ; 4 311e8: c8 f4 brcc .+50 ; 0x3121c //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 311ea: 68 94 set 311ec: b7 f8 bld r11, 7 if ((i & 31) == 31) 311ee: 88 85 ldd r24, Y+8 ; 0x08 311f0: 8f 31 cpi r24, 0x1F ; 31 311f2: 09 f0 breq .+2 ; 0x311f6 311f4: 78 c0 rjmp .+240 ; 0x312e6 tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 311f6: b1 01 movw r22, r2 311f8: e5 e0 ldi r30, 0x05 ; 5 311fa: 75 95 asr r23 311fc: 67 95 ror r22 311fe: ea 95 dec r30 31200: e1 f7 brne .-8 ; 0x311fa //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); 31202: 60 5a subi r22, 0xA0 ; 160 31204: 60 68 ori r22, 0x80 ; 128 31206: a5 01 movw r20, r10 31208: 94 01 movw r18, r8 3120a: 8e 2d mov r24, r14 3120c: 0f 94 d0 38 call 0x271a0 ; 0x271a0 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); 31210: 81 e0 ldi r24, 0x01 ; 1 31212: 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; 31214: 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); 31216: 9f ef ldi r25, 0xFF ; 255 31218: f9 12 cpse r15, r25 3121a: 94 cf rjmp .-216 ; 0x31144 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; 3121c: 2a 81 ldd r18, Y+2 ; 0x02 3121e: 30 e0 ldi r19, 0x00 ; 0 31220: 50 e0 ldi r21, 0x00 ; 0 31222: 40 e0 ldi r20, 0x00 ; 0 31224: 82 e0 ldi r24, 0x02 ; 2 31226: 22 0f add r18, r18 31228: 33 1f adc r19, r19 3122a: 44 1f adc r20, r20 3122c: 55 1f adc r21, r21 3122e: 8a 95 dec r24 31230: d1 f7 brne .-12 ; 0x31226 val |= ((uint32_t)w2) << 4; 31232: 8b 80 ldd r8, Y+3 ; 0x03 31234: 91 2c mov r9, r1 31236: b1 2c mov r11, r1 31238: a1 2c mov r10, r1 3123a: 94 e0 ldi r25, 0x04 ; 4 3123c: 88 0c add r8, r8 3123e: 99 1c adc r9, r9 31240: aa 1c adc r10, r10 31242: bb 1c adc r11, r11 31244: 9a 95 dec r25 31246: d1 f7 brne .-12 ; 0x3123c 31248: 82 2a or r8, r18 3124a: 93 2a or r9, r19 3124c: a4 2a or r10, r20 3124e: 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); 31250: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 31252: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 31254: 8c 81 ldd r24, Y+4 ; 0x04 31256: 90 e0 ldi r25, 0x00 ; 0 31258: b0 e0 ldi r27, 0x00 ; 0 3125a: a0 e0 ldi r26, 0x00 ; 0 3125c: 9c 01 movw r18, r24 3125e: ad 01 movw r20, r26 31260: 66 e0 ldi r22, 0x06 ; 6 31262: 22 0f add r18, r18 31264: 33 1f adc r19, r19 31266: 44 1f adc r20, r20 31268: 55 1f adc r21, r21 3126a: 6a 95 dec r22 3126c: d1 f7 brne .-12 ; 0x31262 3126e: 28 29 or r18, r8 31270: 39 29 or r19, r9 31272: 4a 29 or r20, r10 31274: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 31276: 8d 81 ldd r24, Y+5 ; 0x05 31278: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 3127a: 8e 81 ldd r24, Y+6 ; 0x06 3127c: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 3127e: 8f 81 ldd r24, Y+7 ; 0x07 31280: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 31282: 68 ee ldi r22, 0xE8 ; 232 31284: 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]); } 31286: 2d 96 adiw r28, 0x0d ; 13 31288: 0f b6 in r0, 0x3f ; 63 3128a: f8 94 cli 3128c: de bf out 0x3e, r29 ; 62 3128e: 0f be out 0x3f, r0 ; 63 31290: cd bf out 0x3d, r28 ; 61 31292: df 91 pop r29 31294: cf 91 pop r28 31296: 1f 91 pop r17 31298: 0f 91 pop r16 3129a: ff 90 pop r15 3129c: ef 90 pop r14 3129e: df 90 pop r13 312a0: cf 90 pop r12 312a2: bf 90 pop r11 312a4: af 90 pop r10 312a6: 9f 90 pop r9 312a8: 8f 90 pop r8 312aa: 7f 90 pop r7 312ac: 6f 90 pop r6 312ae: 5f 90 pop r5 312b0: 4f 90 pop r4 312b2: 3f 90 pop r3 312b4: 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); 312b6: 0d 94 d0 38 jmp 0x271a0 ; 0x271a0 //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; 312ba: e2 e0 ldi r30, 0x02 ; 2 312bc: f0 e0 ldi r31, 0x00 ; 0 312be: ec 0f add r30, r28 312c0: fd 1f adc r31, r29 312c2: e1 0f add r30, r17 312c4: f1 1d adc r31, r1 312c6: 80 83 st Z, r24 312c8: 02 e0 ldi r16, 0x02 ; 2 312ca: dd 24 eor r13, r13 312cc: d3 94 inc r13 312ce: 83 cf rjmp .-250 ; 0x311d6 case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 312d0: e2 e0 ldi r30, 0x02 ; 2 312d2: f0 e0 ldi r31, 0x00 ; 0 312d4: ec 0f add r30, r28 312d6: fd 1f adc r31, r29 312d8: e1 0f add r30, r17 312da: f1 1d adc r31, r1 312dc: 80 83 st Z, r24 312de: 03 e0 ldi r16, 0x03 ; 3 312e0: f2 e0 ldi r31, 0x02 ; 2 312e2: df 2e mov r13, r31 312e4: 78 cf rjmp .-272 ; 0x311d6 //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; 312e6: b6 94 lsr r11 312e8: a7 94 ror r10 312ea: 97 94 ror r9 312ec: 87 94 ror r8 312ee: 90 cf rjmp .-224 ; 0x31210 000312f0 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 312f0: 8f 92 push r8 312f2: 9f 92 push r9 312f4: af 92 push r10 312f6: bf 92 push r11 312f8: cf 92 push r12 312fa: df 92 push r13 312fc: ef 92 push r14 312fe: ff 92 push r15 31300: 90 91 3c 07 lds r25, 0x073C ; 0x80073c // 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]) { 31304: 88 23 and r24, r24 31306: 09 f4 brne .+2 ; 0x3130a 31308: 9d c0 rjmp .+314 ; 0x31444 3130a: 91 11 cpse r25, r1 3130c: 92 c0 rjmp .+292 ; 0x31432 st_synchronize(); 3130e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 set_destination_to_current(); 31312: 0e 94 80 69 call 0xd300 ; 0xd300 current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 31316: 60 91 94 02 lds r22, 0x0294 ; 0x800294 3131a: 70 91 95 02 lds r23, 0x0295 ; 0x800295 3131e: 07 2e mov r0, r23 31320: 00 0c add r0, r0 31322: 88 0b sbc r24, r24 31324: 99 0b sbc r25, r25 31326: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 3132a: 20 91 ee 06 lds r18, 0x06EE ; 0x8006ee 3132e: 30 91 ef 06 lds r19, 0x06EF ; 0x8006ef 31332: 40 91 f0 06 lds r20, 0x06F0 ; 0x8006f0 31336: 50 91 f1 06 lds r21, 0x06F1 ; 0x8006f1 3133a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3133e: 2a e0 ldi r18, 0x0A ; 10 31340: 37 ed ldi r19, 0xD7 ; 215 31342: 43 e2 ldi r20, 0x23 ; 35 31344: 5c e3 ldi r21, 0x3C ; 60 31346: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3134a: 20 91 4c 07 lds r18, 0x074C ; 0x80074c 3134e: 30 91 4d 07 lds r19, 0x074D ; 0x80074d 31352: 40 91 4e 07 lds r20, 0x074E ; 0x80074e 31356: 50 91 4f 07 lds r21, 0x074F ; 0x80074f 3135a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3135e: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 31362: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 31366: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 3136a: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_set_e_position(current_position[E_AXIS]); 3136e: 8c e4 ldi r24, 0x4C ; 76 31370: 97 e0 ldi r25, 0x07 ; 7 31372: 0f 94 62 aa call 0x354c4 ; 0x354c4 float oldFeedrate = feedrate; 31376: c0 90 90 02 lds r12, 0x0290 ; 0x800290 3137a: d0 90 91 02 lds r13, 0x0291 ; 0x800291 3137e: e0 90 92 02 lds r14, 0x0292 ; 0x800292 31382: f0 90 93 02 lds r15, 0x0293 ; 0x800293 feedrate=cs.retract_feedrate*60; 31386: 20 e0 ldi r18, 0x00 ; 0 31388: 30 e0 ldi r19, 0x00 ; 0 3138a: 40 e7 ldi r20, 0x70 ; 112 3138c: 52 e4 ldi r21, 0x42 ; 66 3138e: 60 91 f2 06 lds r22, 0x06F2 ; 0x8006f2 31392: 70 91 f3 06 lds r23, 0x06F3 ; 0x8006f3 31396: 80 91 f4 06 lds r24, 0x06F4 ; 0x8006f4 3139a: 90 91 f5 06 lds r25, 0x06F5 ; 0x8006f5 3139e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 313a2: 60 93 90 02 sts 0x0290, r22 ; 0x800290 313a6: 70 93 91 02 sts 0x0291, r23 ; 0x800291 313aa: 80 93 92 02 sts 0x0292, r24 ; 0x800292 313ae: 90 93 93 02 sts 0x0293, r25 ; 0x800293 retracted[active_extruder]=true; 313b2: 81 e0 ldi r24, 0x01 ; 1 313b4: 80 93 3c 07 sts 0x073C, r24 ; 0x80073c prepare_move(); 313b8: 90 e0 ldi r25, 0x00 ; 0 313ba: 80 e0 ldi r24, 0x00 ; 0 313bc: 0e 94 4e 6d call 0xda9c ; 0xda9c if(cs.retract_zlift) { 313c0: 20 e0 ldi r18, 0x00 ; 0 313c2: 30 e0 ldi r19, 0x00 ; 0 313c4: a9 01 movw r20, r18 313c6: 60 91 f6 06 lds r22, 0x06F6 ; 0x8006f6 313ca: 70 91 f7 06 lds r23, 0x06F7 ; 0x8006f7 313ce: 80 91 f8 06 lds r24, 0x06F8 ; 0x8006f8 313d2: 90 91 f9 06 lds r25, 0x06F9 ; 0x8006f9 313d6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 313da: 88 23 and r24, r24 313dc: 11 f1 breq .+68 ; 0x31422 st_synchronize(); 313de: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position[Z_AXIS]-=cs.retract_zlift; 313e2: 20 91 f6 06 lds r18, 0x06F6 ; 0x8006f6 313e6: 30 91 f7 06 lds r19, 0x06F7 ; 0x8006f7 313ea: 40 91 f8 06 lds r20, 0x06F8 ; 0x8006f8 313ee: 50 91 f9 06 lds r21, 0x06F9 ; 0x8006f9 313f2: 60 91 48 07 lds r22, 0x0748 ; 0x800748 313f6: 70 91 49 07 lds r23, 0x0749 ; 0x800749 313fa: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 313fe: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 31402: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31406: 60 93 48 07 sts 0x0748, r22 ; 0x800748 3140a: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3140e: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 31412: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_set_position_curposXYZE(); 31416: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 prepare_move(); 3141a: 90 e0 ldi r25, 0x00 ; 0 3141c: 80 e0 ldi r24, 0x00 ; 0 3141e: 0e 94 4e 6d call 0xda9c ; 0xda9c } feedrate = oldFeedrate; 31422: c0 92 90 02 sts 0x0290, r12 ; 0x800290 31426: d0 92 91 02 sts 0x0291, r13 ; 0x800291 3142a: e0 92 92 02 sts 0x0292, r14 ; 0x800292 3142e: 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 31432: ff 90 pop r15 31434: ef 90 pop r14 31436: df 90 pop r13 31438: cf 90 pop r12 3143a: bf 90 pop r11 3143c: af 90 pop r10 3143e: 9f 90 pop r9 31440: 8f 90 pop r8 31442: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 31444: 99 23 and r25, r25 31446: a9 f3 breq .-22 ; 0x31432 st_synchronize(); 31448: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 set_destination_to_current(); 3144c: 0e 94 80 69 call 0xd300 ; 0xd300 float oldFeedrate = feedrate; 31450: 80 90 90 02 lds r8, 0x0290 ; 0x800290 31454: 90 90 91 02 lds r9, 0x0291 ; 0x800291 31458: a0 90 92 02 lds r10, 0x0292 ; 0x800292 3145c: b0 90 93 02 lds r11, 0x0293 ; 0x800293 feedrate=cs.retract_recover_feedrate*60; 31460: 20 e0 ldi r18, 0x00 ; 0 31462: 30 e0 ldi r19, 0x00 ; 0 31464: 40 e7 ldi r20, 0x70 ; 112 31466: 52 e4 ldi r21, 0x42 ; 66 31468: 60 91 fe 06 lds r22, 0x06FE ; 0x8006fe 3146c: 70 91 ff 06 lds r23, 0x06FF ; 0x8006ff 31470: 80 91 00 07 lds r24, 0x0700 ; 0x800700 31474: 90 91 01 07 lds r25, 0x0701 ; 0x800701 31478: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3147c: 60 93 90 02 sts 0x0290, r22 ; 0x800290 31480: 70 93 91 02 sts 0x0291, r23 ; 0x800291 31484: 80 93 92 02 sts 0x0292, r24 ; 0x800292 31488: 90 93 93 02 sts 0x0293, r25 ; 0x800293 if(cs.retract_zlift) { 3148c: c0 90 f6 06 lds r12, 0x06F6 ; 0x8006f6 31490: d0 90 f7 06 lds r13, 0x06F7 ; 0x8006f7 31494: e0 90 f8 06 lds r14, 0x06F8 ; 0x8006f8 31498: f0 90 f9 06 lds r15, 0x06F9 ; 0x8006f9 3149c: 20 e0 ldi r18, 0x00 ; 0 3149e: 30 e0 ldi r19, 0x00 ; 0 314a0: a9 01 movw r20, r18 314a2: c7 01 movw r24, r14 314a4: b6 01 movw r22, r12 314a6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 314aa: 88 23 and r24, r24 314ac: e1 f0 breq .+56 ; 0x314e6 current_position[Z_AXIS]+=cs.retract_zlift; 314ae: a7 01 movw r20, r14 314b0: 96 01 movw r18, r12 314b2: 60 91 48 07 lds r22, 0x0748 ; 0x800748 314b6: 70 91 49 07 lds r23, 0x0749 ; 0x800749 314ba: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 314be: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 314c2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 314c6: 60 93 48 07 sts 0x0748, r22 ; 0x800748 314ca: 70 93 49 07 sts 0x0749, r23 ; 0x800749 314ce: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 314d2: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_set_position_curposXYZE(); 314d6: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 prepare_move(); 314da: 90 e0 ldi r25, 0x00 ; 0 314dc: 80 e0 ldi r24, 0x00 ; 0 314de: 0e 94 4e 6d call 0xda9c ; 0xda9c st_synchronize(); 314e2: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 314e6: 20 91 fa 06 lds r18, 0x06FA ; 0x8006fa 314ea: 30 91 fb 06 lds r19, 0x06FB ; 0x8006fb 314ee: 40 91 fc 06 lds r20, 0x06FC ; 0x8006fc 314f2: 50 91 fd 06 lds r21, 0x06FD ; 0x8006fd 314f6: 60 91 ee 06 lds r22, 0x06EE ; 0x8006ee 314fa: 70 91 ef 06 lds r23, 0x06EF ; 0x8006ef 314fe: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 31502: 90 91 f1 06 lds r25, 0x06F1 ; 0x8006f1 31506: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3150a: 6b 01 movw r12, r22 3150c: 7c 01 movw r14, r24 3150e: 60 91 94 02 lds r22, 0x0294 ; 0x800294 31512: 70 91 95 02 lds r23, 0x0295 ; 0x800295 31516: 07 2e mov r0, r23 31518: 00 0c add r0, r0 3151a: 88 0b sbc r24, r24 3151c: 99 0b sbc r25, r25 3151e: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 31522: 9b 01 movw r18, r22 31524: ac 01 movw r20, r24 31526: c7 01 movw r24, r14 31528: b6 01 movw r22, r12 3152a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3152e: 2a e0 ldi r18, 0x0A ; 10 31530: 37 ed ldi r19, 0xD7 ; 215 31532: 43 e2 ldi r20, 0x23 ; 35 31534: 5c e3 ldi r21, 0x3C ; 60 31536: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3153a: 9b 01 movw r18, r22 3153c: ac 01 movw r20, r24 3153e: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 31542: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 31546: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 3154a: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 3154e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31552: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 31556: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 3155a: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 3155e: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_set_e_position(current_position[E_AXIS]); 31562: 8c e4 ldi r24, 0x4C ; 76 31564: 97 e0 ldi r25, 0x07 ; 7 31566: 0f 94 62 aa call 0x354c4 ; 0x354c4 retracted[active_extruder]=false; 3156a: 10 92 3c 07 sts 0x073C, r1 ; 0x80073c prepare_move(); 3156e: 90 e0 ldi r25, 0x00 ; 0 31570: 80 e0 ldi r24, 0x00 ; 0 31572: 0e 94 4e 6d call 0xda9c ; 0xda9c feedrate = oldFeedrate; 31576: 80 92 90 02 sts 0x0290, r8 ; 0x800290 3157a: 90 92 91 02 sts 0x0291, r9 ; 0x800291 3157e: a0 92 92 02 sts 0x0292, r10 ; 0x800292 31582: b0 92 93 02 sts 0x0293, r11 ; 0x800293 31586: 55 cf rjmp .-342 ; 0x31432 00031588 : 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) 31588: ef 92 push r14 3158a: ff 92 push r15 3158c: 0f 93 push r16 3158e: 1f 93 push r17 31590: cf 93 push r28 31592: c8 2f mov r28, r24 31594: 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; 31596: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 3159a: c1 30 cpi r28, 0x01 ; 1 3159c: b9 f0 breq .+46 ; 0x315cc 3159e: c2 30 cpi r28, 0x02 ; 2 315a0: c1 f0 breq .+48 ; 0x315d2 { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 315a2: 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) 315a4: 48 17 cp r20, r24 315a6: 21 f0 breq .+8 ; 0x315b0 tmc2130_set_dir(axis, dir); 315a8: 64 2f mov r22, r20 315aa: 8c 2f mov r24, r28 315ac: 0f 94 33 38 call 0x27066 ; 0x27066 315b0: 8b e9 ldi r24, 0x9B ; 155 315b2: e8 2e mov r14, r24 315b4: 8f e0 ldi r24, 0x0F ; 15 315b6: f8 2e mov r15, r24 while (steps--) 315b8: 01 50 subi r16, 0x01 ; 1 315ba: 11 09 sbc r17, r1 315bc: 70 f0 brcs .+28 ; 0x315da { tmc2130_do_step(axis); 315be: 8c 2f mov r24, r28 315c0: 0f 94 22 38 call 0x27044 ; 0x27044 315c4: c7 01 movw r24, r14 315c6: 01 97 sbiw r24, 0x01 ; 1 315c8: f1 f7 brne .-4 ; 0x315c6 315ca: f6 cf rjmp .-20 ; 0x315b8 uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 315cc: 86 95 lsr r24 315ce: 8c 27 eor r24, r28 315d0: e8 cf rjmp .-48 ; 0x315a2 case Z_AXIS: return _GET_DIR_Z; 315d2: 82 fb bst r24, 2 315d4: 88 27 eor r24, r24 315d6: 80 f9 bld r24, 0 315d8: e5 cf rjmp .-54 ; 0x315a4 while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 315da: cf 91 pop r28 315dc: 1f 91 pop r17 315de: 0f 91 pop r16 315e0: ff 90 pop r15 315e2: ef 90 pop r14 315e4: 08 95 ret 000315e6 : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 315e6: 8f 92 push r8 315e8: 9f 92 push r9 315ea: af 92 push r10 315ec: bf 92 push r11 315ee: cf 92 push r12 315f0: df 92 push r13 315f2: ef 92 push r14 315f4: ff 92 push r15 315f6: 0f 93 push r16 315f8: 1f 93 push r17 315fa: cf 93 push r28 315fc: c8 2f mov r28, r24 315fe: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 31600: c6 2e mov r12, r22 31602: d1 2c mov r13, r1 31604: 1f 93 push r17 31606: 4f 93 push r20 31608: 83 e0 ldi r24, 0x03 ; 3 3160a: 8f 93 push r24 3160c: 88 ee ldi r24, 0xE8 ; 232 3160e: 8f 93 push r24 31610: 1f 92 push r1 31612: 82 e0 ldi r24, 0x02 ; 2 31614: 8f 93 push r24 31616: 1f 92 push r1 31618: 6f 93 push r22 3161a: 1f 92 push r1 3161c: cf 93 push r28 3161e: 81 e7 ldi r24, 0x71 ; 113 31620: 96 ea ldi r25, 0xA6 ; 166 31622: 9f 93 push r25 31624: 8f 93 push r24 31626: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 3162a: 8d b7 in r24, 0x3d ; 61 3162c: 9e b7 in r25, 0x3e ; 62 3162e: 0c 96 adiw r24, 0x0c ; 12 31630: 0f b6 in r0, 0x3f ; 63 31632: f8 94 cli 31634: 9e bf out 0x3e, r25 ; 62 31636: 0f be out 0x3f, r0 ; 63 31638: 8d bf out 0x3d, r24 ; 61 3163a: 90 e0 ldi r25, 0x00 ; 0 3163c: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 3163e: 40 e0 ldi r20, 0x00 ; 0 31640: 51 e0 ldi r21, 0x01 ; 1 31642: 28 2f mov r18, r24 31644: ba 01 movw r22, r20 31646: 08 2e mov r0, r24 31648: 02 c0 rjmp .+4 ; 0x3164e 3164a: 76 95 lsr r23 3164c: 67 95 ror r22 3164e: 0a 94 dec r0 31650: e2 f7 brpl .-8 ; 0x3164a 31652: 06 17 cp r16, r22 31654: 17 07 cpc r17, r23 31656: 29 f0 breq .+10 ; 0x31662 31658: 01 96 adiw r24, 0x01 ; 1 3165a: 88 30 cpi r24, 0x08 ; 8 3165c: 91 05 cpc r25, r1 3165e: 89 f7 brne .-30 ; 0x31642 31660: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 31662: e2 2e mov r14, r18 31664: f1 2c mov r15, r1 31666: 88 e0 ldi r24, 0x08 ; 8 31668: 90 e0 ldi r25, 0x00 ; 0 3166a: 8e 19 sub r24, r14 3166c: 9f 09 sbc r25, r15 3166e: 24 e0 ldi r18, 0x04 ; 4 31670: 30 e0 ldi r19, 0x00 ; 0 31672: 59 01 movw r10, r18 31674: 02 c0 rjmp .+4 ; 0x3167a 31676: aa 0c add r10, r10 31678: bb 1c adc r11, r11 3167a: 8a 95 dec r24 3167c: e2 f7 brpl .-8 ; 0x31676 uint16_t mscnt = tmc2130_rd_MSCNT(axis); 3167e: 8c 2f mov r24, r28 31680: 0f 94 fa 38 call 0x271f4 ; 0x271f4 31684: 9c 01 movw r18, r24 31686: 90 e0 ldi r25, 0x00 ; 0 31688: c4 30 cpi r28, 0x04 ; 4 3168a: 28 f4 brcc .+10 ; 0x31696 3168c: ec 2f mov r30, r28 3168e: f0 e0 ldi r31, 0x00 ; 0 31690: e2 5e subi r30, 0xE2 ; 226 31692: fc 4f sbci r31, 0xFC ; 252 31694: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 31696: 0e 2c mov r0, r14 31698: 02 c0 rjmp .+4 ; 0x3169e 3169a: 36 95 lsr r19 3169c: 27 95 ror r18 3169e: 0a 94 dec r0 316a0: e2 f7 brpl .-8 ; 0x3169a 316a2: 86 01 movw r16, r12 316a4: 02 1b sub r16, r18 316a6: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 316a8: 95 01 movw r18, r10 316aa: 36 95 lsr r19 316ac: 27 95 ror r18 { dir ^= 1; 316ae: 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)) 316b0: 20 17 cp r18, r16 316b2: 31 07 cpc r19, r17 316b4: 74 f1 brlt .+92 ; 0x31712 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; 316b6: 91 11 cpse r25, r1 316b8: 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) 316ba: 17 ff sbrs r17, 7 316bc: 05 c0 rjmp .+10 ; 0x316c8 { dir ^= 1; 316be: 81 e0 ldi r24, 0x01 ; 1 316c0: 68 27 eor r22, r24 steps = -steps; 316c2: 11 95 neg r17 316c4: 01 95 neg r16 316c6: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 316c8: 8c 2f mov r24, r28 316ca: 0f 94 33 38 call 0x27066 ; 0x27066 mscnt = tmc2130_rd_MSCNT(axis); 316ce: 8c 2f mov r24, r28 316d0: 0f 94 fa 38 call 0x271f4 ; 0x271f4 316d4: b1 2c mov r11, r1 316d6: a1 2c mov r10, r1 316d8: 2b e9 ldi r18, 0x9B ; 155 316da: 82 2e mov r8, r18 316dc: 2f e0 ldi r18, 0x0F ; 15 316de: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 316e0: 0a 15 cp r16, r10 316e2: 1b 05 cpc r17, r11 316e4: f1 f0 breq .+60 ; 0x31722 316e6: 2f ef ldi r18, 0xFF ; 255 316e8: a2 1a sub r10, r18 316ea: b2 0a sbc r11, r18 316ec: 0e 2c mov r0, r14 316ee: 02 c0 rjmp .+4 ; 0x316f4 316f0: 96 95 lsr r25 316f2: 87 95 ror r24 316f4: 0a 94 dec r0 316f6: e2 f7 brpl .-8 ; 0x316f0 316f8: 8c 15 cp r24, r12 316fa: 9d 05 cpc r25, r13 316fc: 91 f0 breq .+36 ; 0x31722 { tmc2130_do_step(axis); 316fe: 8c 2f mov r24, r28 31700: 0f 94 22 38 call 0x27044 ; 0x27044 31704: c4 01 movw r24, r8 31706: 01 97 sbiw r24, 0x01 ; 1 31708: f1 f7 brne .-4 ; 0x31706 delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 3170a: 8c 2f mov r24, r28 3170c: 0f 94 fa 38 call 0x271f4 ; 0x271f4 31710: e7 cf rjmp .-50 ; 0x316e0 { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 31712: 91 11 cpse r25, r1 31714: 01 c0 rjmp .+2 ; 0x31718 31716: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 31718: c5 01 movw r24, r10 3171a: 80 1b sub r24, r16 3171c: 91 0b sbc r25, r17 3171e: 8c 01 movw r16, r24 31720: cc cf rjmp .-104 ; 0x316ba { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 31722: cf 91 pop r28 31724: 1f 91 pop r17 31726: 0f 91 pop r16 31728: ff 90 pop r15 3172a: ef 90 pop r14 3172c: df 90 pop r13 3172e: cf 90 pop r12 31730: bf 90 pop r11 31732: af 90 pop r10 31734: 9f 90 pop r9 31736: 8f 90 pop r8 31738: 08 95 ret 0003173a : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 3173a: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d memset(z_values, 0, sizeof(z_values)); 3173e: ee e9 ldi r30, 0x9E ; 158 31740: f3 e1 ldi r31, 0x13 ; 19 31742: 84 ec ldi r24, 0xC4 ; 196 31744: df 01 movw r26, r30 31746: 1d 92 st X+, r1 31748: 8a 95 dec r24 3174a: e9 f7 brne .-6 ; 0x31746 } 3174c: 08 95 ret 0003174e : 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 3174e: 2f 92 push r2 31750: 3f 92 push r3 31752: 4f 92 push r4 31754: 5f 92 push r5 31756: 6f 92 push r6 31758: 7f 92 push r7 3175a: 8f 92 push r8 3175c: 9f 92 push r9 3175e: af 92 push r10 31760: bf 92 push r11 31762: cf 92 push r12 31764: df 92 push r13 31766: ef 92 push r14 31768: ff 92 push r15 3176a: 0f 93 push r16 3176c: 1f 93 push r17 3176e: cf 93 push r28 31770: df 93 push r29 31772: 00 d0 rcall .+0 ; 0x31774 31774: 1f 92 push r1 31776: cd b7 in r28, 0x3d ; 61 31778: de b7 in r29, 0x3e ; 62 3177a: 4b 01 movw r8, r22 3177c: 5c 01 movw r10, r24 3177e: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 31780: 81 e0 ldi r24, 0x01 ; 1 31782: 80 93 6a 06 sts 0x066A, r24 ; 0x80066a #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 31786: 80 91 69 06 lds r24, 0x0669 ; 0x800669 ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 3178a: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 3178c: 81 30 cpi r24, 0x01 ; 1 3178e: 19 f4 brne .+6 ; 0x31796 { FORCE_HIGH_POWER_START; 31790: 0e 94 f6 67 call 0xcfec ; 0xcfec bHighPowerForced = true; 31794: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 31796: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 3179a: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 3179c: 81 e0 ldi r24, 0x01 ; 1 3179e: 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); 317a2: 80 e0 ldi r24, 0x00 ; 0 317a4: 0f 94 09 63 call 0x2c612 ; 0x2c612 317a8: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 317aa: 0f 94 17 63 call 0x2c62e ; 0x2c62e // move down until you find the bed current_position[Z_AXIS] = minimum_z; 317ae: 80 92 48 07 sts 0x0748, r8 ; 0x800748 317b2: 90 92 49 07 sts 0x0749, r9 ; 0x800749 317b6: a0 92 4a 07 sts 0x074A, r10 ; 0x80074a 317ba: b0 92 4b 07 sts 0x074B, r11 ; 0x80074b go_to_current(homing_feedrate[Z_AXIS]/60); 317be: 65 e5 ldi r22, 0x55 ; 85 317c0: 75 e5 ldi r23, 0x55 ; 85 317c2: 85 e5 ldi r24, 0x55 ; 85 317c4: 91 e4 ldi r25, 0x41 ; 65 317c6: 0f 94 ce c2 call 0x3859c ; 0x3859c // 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(); 317ca: 0f 94 22 c9 call 0x39244 ; 0x39244 if (! endstop_z_hit_on_purpose()) 317ce: 0f 94 17 63 call 0x2c62e ; 0x2c62e 317d2: 8c 83 std Y+4, r24 ; 0x04 317d4: 88 23 and r24, r24 317d6: 09 f4 brne .+2 ; 0x317da 317d8: f9 c0 rjmp .+498 ; 0x319cc { //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)) 317da: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 317de: 86 ff sbrs r24, 6 317e0: f5 c0 rjmp .+490 ; 0x319cc { //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) 317e2: 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; 317e4: c1 2c mov r12, r1 317e6: d1 2c mov r13, r1 317e8: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 317ea: 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) 317ec: 8b 81 ldd r24, Y+3 ; 0x03 317ee: 80 17 cp r24, r16 317f0: 08 f0 brcs .+2 ; 0x317f4 317f2: a8 c0 rjmp .+336 ; 0x31944 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 317f4: 60 91 48 07 lds r22, 0x0748 ; 0x800748 317f8: 70 91 49 07 lds r23, 0x0749 ; 0x800749 317fc: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 31800: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 31804: 20 e0 ldi r18, 0x00 ; 0 31806: 30 e0 ldi r19, 0x00 ; 0 31808: 40 e0 ldi r20, 0x00 ; 0 3180a: 5f e3 ldi r21, 0x3F ; 63 3180c: 31 10 cpse r3, r1 3180e: 04 c0 rjmp .+8 ; 0x31818 31810: 2d ec ldi r18, 0xCD ; 205 31812: 3c ec ldi r19, 0xCC ; 204 31814: 4c e4 ldi r20, 0x4C ; 76 31816: 5e e3 ldi r21, 0x3E ; 62 31818: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3181c: 2b 01 movw r4, r22 3181e: 3c 01 movw r6, r24 31820: 40 92 48 07 sts 0x0748, r4 ; 0x800748 31824: 50 92 49 07 sts 0x0749, r5 ; 0x800749 31828: 60 92 4a 07 sts 0x074A, r6 ; 0x80074a 3182c: 70 92 4b 07 sts 0x074B, r7 ; 0x80074b float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 31830: 65 e5 ldi r22, 0x55 ; 85 31832: 75 e5 ldi r23, 0x55 ; 85 31834: 85 e5 ldi r24, 0x55 ; 85 31836: 91 e4 ldi r25, 0x41 ; 65 31838: 0f 94 ce c2 call 0x3859c ; 0x3859c // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 3183c: 80 92 48 07 sts 0x0748, r8 ; 0x800748 31840: 90 92 49 07 sts 0x0749, r9 ; 0x800749 31844: a0 92 4a 07 sts 0x074A, r10 ; 0x80074a 31848: b0 92 4b 07 sts 0x074B, r11 ; 0x80074b //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)); 3184c: 65 e5 ldi r22, 0x55 ; 85 3184e: 75 e5 ldi r23, 0x55 ; 85 31850: 85 e5 ldi r24, 0x55 ; 85 31852: 90 e4 ldi r25, 0x40 ; 64 31854: 0f 94 ce c2 call 0x3859c ; 0x3859c // 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(); 31858: 0f 94 22 c9 call 0x39244 ; 0x39244 //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) { 3185c: a3 01 movw r20, r6 3185e: 92 01 movw r18, r4 31860: 60 91 48 07 lds r22, 0x0748 ; 0x800748 31864: 70 91 49 07 lds r23, 0x0749 ; 0x800749 31868: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3186c: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 31870: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31874: 9f 77 andi r25, 0x7F ; 127 31876: 2d ec ldi r18, 0xCD ; 205 31878: 3c ec ldi r19, 0xCC ; 204 3187a: 4c ec ldi r20, 0xCC ; 204 3187c: 5c e3 ldi r21, 0x3C ; 60 3187e: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 31882: 87 ff sbrs r24, 7 31884: 16 c0 rjmp .+44 ; 0x318b2 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 31886: 60 e0 ldi r22, 0x00 ; 0 31888: 70 e0 ldi r23, 0x00 ; 0 3188a: 80 e0 ldi r24, 0x00 ; 0 3188c: 9f e3 ldi r25, 0x3F ; 63 3188e: 0e 94 27 6f call 0xde4e ; 0xde4e current_position[Z_AXIS] = minimum_z; 31892: 80 92 48 07 sts 0x0748, r8 ; 0x800748 31896: 90 92 49 07 sts 0x0749, r9 ; 0x800749 3189a: a0 92 4a 07 sts 0x074A, r10 ; 0x80074a 3189e: b0 92 4b 07 sts 0x074B, r11 ; 0x80074b go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 318a2: 65 e5 ldi r22, 0x55 ; 85 318a4: 75 e5 ldi r23, 0x55 ; 85 318a6: 85 e5 ldi r24, 0x55 ; 85 318a8: 90 e4 ldi r25, 0x40 ; 64 318aa: 0f 94 ce c2 call 0x3859c ; 0x3859c // 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(); 318ae: 0f 94 22 c9 call 0x39244 ; 0x39244 } if (!endstop_z_hit_on_purpose()) 318b2: 0f 94 17 63 call 0x2c62e ; 0x2c62e 318b6: 28 2e mov r2, r24 318b8: 88 23 and r24, r24 318ba: 09 f4 brne .+2 ; 0x318be 318bc: 87 c0 rjmp .+270 ; 0x319cc { //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)) { 318be: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 318c2: 86 ff sbrs r24, 6 318c4: 83 c0 rjmp .+262 ; 0x319cc 318c6: 40 90 48 07 lds r4, 0x0748 ; 0x800748 318ca: 50 90 49 07 lds r5, 0x0749 ; 0x800749 318ce: 60 90 4a 07 lds r6, 0x074A ; 0x80074a 318d2: 70 90 4b 07 lds r7, 0x074B ; 0x80074b } #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; 318d6: 2b 81 ldd r18, Y+3 ; 0x03 318d8: 22 23 and r18, r18 318da: d9 f0 breq .+54 ; 0x31912 318dc: 62 2f mov r22, r18 318de: 70 e0 ldi r23, 0x00 ; 0 318e0: 90 e0 ldi r25, 0x00 ; 0 318e2: 80 e0 ldi r24, 0x00 ; 0 318e4: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 318e8: 9b 01 movw r18, r22 318ea: ac 01 movw r20, r24 318ec: c7 01 movw r24, r14 318ee: b6 01 movw r22, r12 318f0: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 318f4: 9b 01 movw r18, r22 318f6: ac 01 movw r20, r24 318f8: c3 01 movw r24, r6 318fa: b2 01 movw r22, r4 318fc: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31900: 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 31902: 2d ec ldi r18, 0xCD ; 205 31904: 3c ec ldi r19, 0xCC ; 204 31906: 4c e4 ldi r20, 0x4C ; 76 31908: 5d e3 ldi r21, 0x3D ; 61 3190a: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 3190e: 18 16 cp r1, r24 31910: 64 f0 brlt .+24 ; 0x3192a #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]; 31912: a3 01 movw r20, r6 31914: 92 01 movw r18, r4 31916: c7 01 movw r24, r14 31918: b6 01 movw r22, r12 3191a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3191e: 6b 01 movw r12, r22 31920: 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) 31922: 2b 81 ldd r18, Y+3 ; 0x03 31924: 2f 5f subi r18, 0xFF ; 255 31926: 2b 83 std Y+3, r18 ; 0x03 31928: 61 cf rjmp .-318 ; 0x317ec 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 3192a: 31 10 cpse r3, r1 3192c: 4f c0 rjmp .+158 ; 0x319cc //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 3192e: 84 ef ldi r24, 0xF4 ; 244 31930: 91 e0 ldi r25, 0x01 ; 1 31932: 0e 94 10 8f call 0x11e20 ; 0x11e20 //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; 31936: 32 2c mov r3, r2 i = -1; 31938: 8f ef ldi r24, 0xFF ; 255 3193a: 8b 83 std Y+3, r24 ; 0x03 z = 0; 3193c: c1 2c mov r12, r1 3193e: d1 2c mov r13, r1 31940: 76 01 movw r14, r12 31942: ef cf rjmp .-34 ; 0x31922 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 31944: 02 30 cpi r16, 0x02 ; 2 31946: 68 f5 brcc .+90 ; 0x319a2 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 31948: c0 92 48 07 sts 0x0748, r12 ; 0x800748 3194c: d0 92 49 07 sts 0x0749, r13 ; 0x800749 31950: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 31954: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b 31958: 8a 81 ldd r24, Y+2 ; 0x02 3195a: 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); 3195e: 89 81 ldd r24, Y+1 ; 0x01 31960: 0f 94 09 63 call 0x2c612 ; 0x2c612 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31964: 11 23 and r17, r17 31966: 19 f0 breq .+6 ; 0x3196e 31968: 80 e0 ldi r24, 0x00 ; 0 3196a: 0e 94 f6 67 call 0xcfec ; 0xcfec #endif bedPWMDisabled = 0; 3196e: 10 92 6a 06 sts 0x066A, r1 ; 0x80066a #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 31972: 8c 81 ldd r24, Y+4 ; 0x04 31974: 0f 90 pop r0 31976: 0f 90 pop r0 31978: 0f 90 pop r0 3197a: 0f 90 pop r0 3197c: df 91 pop r29 3197e: cf 91 pop r28 31980: 1f 91 pop r17 31982: 0f 91 pop r16 31984: ff 90 pop r15 31986: ef 90 pop r14 31988: df 90 pop r13 3198a: cf 90 pop r12 3198c: bf 90 pop r11 3198e: af 90 pop r10 31990: 9f 90 pop r9 31992: 8f 90 pop r8 31994: 7f 90 pop r7 31996: 6f 90 pop r6 31998: 5f 90 pop r5 3199a: 4f 90 pop r4 3199c: 3f 90 pop r3 3199e: 2f 90 pop r2 319a0: 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); 319a2: 60 2f mov r22, r16 319a4: 70 e0 ldi r23, 0x00 ; 0 319a6: 90 e0 ldi r25, 0x00 ; 0 319a8: 80 e0 ldi r24, 0x00 ; 0 319aa: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 319ae: 9b 01 movw r18, r22 319b0: ac 01 movw r20, r24 319b2: c7 01 movw r24, r14 319b4: b6 01 movw r22, r12 319b6: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 319ba: 60 93 48 07 sts 0x0748, r22 ; 0x800748 319be: 70 93 49 07 sts 0x0749, r23 ; 0x800749 319c2: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 319c6: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b 319ca: c6 cf rjmp .-116 ; 0x31958 319cc: 2a 81 ldd r18, Y+2 ; 0x02 319ce: 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); 319d2: 89 81 ldd r24, Y+1 ; 0x01 319d4: 0f 94 09 63 call 0x2c612 ; 0x2c612 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 319d8: 11 23 and r17, r17 319da: 19 f0 breq .+6 ; 0x319e2 319dc: 80 e0 ldi r24, 0x00 ; 0 319de: 0e 94 f6 67 call 0xcfec ; 0xcfec #endif bedPWMDisabled = 0; 319e2: 10 92 6a 06 sts 0x066A, r1 ; 0x80066a return false; 319e6: 1c 82 std Y+4, r1 ; 0x04 319e8: c4 cf rjmp .-120 ; 0x31972 000319ea : /// 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){ 319ea: 2f 92 push r2 319ec: 3f 92 push r3 319ee: 4f 92 push r4 319f0: 5f 92 push r5 319f2: 6f 92 push r6 319f4: 7f 92 push r7 319f6: 8f 92 push r8 319f8: 9f 92 push r9 319fa: af 92 push r10 319fc: bf 92 push r11 319fe: cf 92 push r12 31a00: df 92 push r13 31a02: ef 92 push r14 31a04: ff 92 push r15 31a06: 0f 93 push r16 31a08: 1f 93 push r17 31a0a: cf 93 push r28 31a0c: df 93 push r29 31a0e: cd b7 in r28, 0x3d ; 61 31a10: de b7 in r29, 0x3e ; 62 31a12: cd 5b subi r28, 0xBD ; 189 31a14: d1 40 sbci r29, 0x01 ; 1 31a16: 0f b6 in r0, 0x3f ; 63 31a18: f8 94 cli 31a1a: de bf out 0x3e, r29 ; 62 31a1c: 0f be out 0x3f, r0 ; 63 31a1e: cd bf out 0x3d, r28 ; 61 31a20: c3 57 subi r28, 0x73 ; 115 31a22: de 4f sbci r29, 0xFE ; 254 31a24: 99 83 std Y+1, r25 ; 0x01 31a26: 88 83 st Y, r24 31a28: cd 58 subi r28, 0x8D ; 141 31a2a: d1 40 sbci r29, 0x01 ; 1 31a2c: c1 57 subi r28, 0x71 ; 113 31a2e: de 4f sbci r29, 0xFE ; 254 31a30: 79 83 std Y+1, r23 ; 0x01 31a32: 68 83 st Y, r22 31a34: cf 58 subi r28, 0x8F ; 143 31a36: d1 40 sbci r29, 0x01 ; 1 31a38: ce 56 subi r28, 0x6E ; 110 31a3a: de 4f sbci r29, 0xFE ; 254 31a3c: 59 83 std Y+1, r21 ; 0x01 31a3e: 48 83 st Y, r20 31a40: c2 59 subi r28, 0x92 ; 146 31a42: d1 40 sbci r29, 0x01 ; 1 31a44: 84 e1 ldi r24, 0x14 ; 20 31a46: cf 56 subi r28, 0x6F ; 111 31a48: de 4f sbci r29, 0xFE ; 254 31a4a: 88 83 st Y, r24 31a4c: c1 59 subi r28, 0x91 ; 145 31a4e: 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; 31a50: ce 56 subi r28, 0x6E ; 110 31a52: de 4f sbci r29, 0xFE ; 254 31a54: a8 81 ld r26, Y 31a56: b9 81 ldd r27, Y+1 ; 0x01 31a58: c2 59 subi r28, 0x92 ; 146 31a5a: d1 40 sbci r29, 0x01 ; 1 31a5c: 8d 91 ld r24, X+ 31a5e: 9d 91 ld r25, X+ 31a60: 0d 90 ld r0, X+ 31a62: bc 91 ld r27, X 31a64: a0 2d mov r26, r0 31a66: c6 56 subi r28, 0x66 ; 102 31a68: de 4f sbci r29, 0xFE ; 254 31a6a: 88 83 st Y, r24 31a6c: 99 83 std Y+1, r25 ; 0x01 31a6e: aa 83 std Y+2, r26 ; 0x02 31a70: bb 83 std Y+3, r27 ; 0x03 31a72: ca 59 subi r28, 0x9A ; 154 31a74: d1 40 sbci r29, 0x01 ; 1 31a76: c1 57 subi r28, 0x71 ; 113 31a78: de 4f sbci r29, 0xFE ; 254 31a7a: a8 81 ld r26, Y 31a7c: b9 81 ldd r27, Y+1 ; 0x01 31a7e: cf 58 subi r28, 0x8F ; 143 31a80: d1 40 sbci r29, 0x01 ; 1 31a82: 8d 91 ld r24, X+ 31a84: 9d 91 ld r25, X+ 31a86: 0d 90 ld r0, X+ 31a88: bc 91 ld r27, X 31a8a: a0 2d mov r26, r0 31a8c: ca 54 subi r28, 0x4A ; 74 31a8e: de 4f sbci r29, 0xFE ; 254 31a90: 88 83 st Y, r24 31a92: 99 83 std Y+1, r25 ; 0x01 31a94: aa 83 std Y+2, r26 ; 0x02 31a96: bb 83 std Y+3, r27 ; 0x03 31a98: c6 5b subi r28, 0xB6 ; 182 31a9a: d1 40 sbci r29, 0x01 ; 1 31a9c: c3 57 subi r28, 0x73 ; 115 31a9e: de 4f sbci r29, 0xFE ; 254 31aa0: a8 81 ld r26, Y 31aa2: b9 81 ldd r27, Y+1 ; 0x01 31aa4: cd 58 subi r28, 0x8D ; 141 31aa6: d1 40 sbci r29, 0x01 ; 1 31aa8: 8d 91 ld r24, X+ 31aaa: 9d 91 ld r25, X+ 31aac: 0d 90 ld r0, X+ 31aae: bc 91 ld r27, X 31ab0: a0 2d mov r26, r0 31ab2: c6 54 subi r28, 0x46 ; 70 31ab4: de 4f sbci r29, 0xFE ; 254 31ab6: 88 83 st Y, r24 31ab8: 99 83 std Y+1, r25 ; 0x01 31aba: aa 83 std Y+2, r26 ; 0x02 31abc: bb 83 std Y+3, r27 ; 0x03 31abe: ca 5b subi r28, 0xBA ; 186 31ac0: d1 40 sbci r29, 0x01 ; 1 31ac2: fe 01 movw r30, r28 31ac4: e7 5f subi r30, 0xF7 ; 247 31ac6: fe 4f sbci r31, 0xFE ; 254 31ac8: c8 55 subi r28, 0x58 ; 88 31aca: de 4f sbci r29, 0xFE ; 254 31acc: f9 83 std Y+1, r31 ; 0x01 31ace: e8 83 st Y, r30 31ad0: c8 5a subi r28, 0xA8 ; 168 31ad2: d1 40 sbci r29, 0x01 ; 1 31ad4: ce 01 movw r24, r28 31ad6: 8b 57 subi r24, 0x7B ; 123 31ad8: 9f 4f sbci r25, 0xFF ; 255 31ada: ca 55 subi r28, 0x5A ; 90 31adc: de 4f sbci r29, 0xFE ; 254 31ade: 99 83 std Y+1, r25 ; 0x01 31ae0: 88 83 st Y, r24 31ae2: c6 5a subi r28, 0xA6 ; 166 31ae4: d1 40 sbci r29, 0x01 ; 1 31ae6: de 01 movw r26, r28 31ae8: 11 96 adiw r26, 0x01 ; 1 31aea: c8 56 subi r28, 0x68 ; 104 31aec: de 4f sbci r29, 0xFE ; 254 31aee: b9 83 std Y+1, r27 ; 0x01 31af0: a8 83 st Y, r26 31af2: c8 59 subi r28, 0x98 ; 152 31af4: d1 40 sbci r29, 0x01 ; 1 31af6: 31 2c mov r3, r1 31af8: 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; 31afa: b1 01 movw r22, r2 31afc: 03 2c mov r0, r3 31afe: 00 0c add r0, r0 31b00: 88 0b sbc r24, r24 31b02: 99 0b sbc r25, r25 31b04: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 31b08: 2a e1 ldi r18, 0x1A ; 26 31b0a: 38 ef ldi r19, 0xF8 ; 248 31b0c: 42 e4 ldi r20, 0x42 ; 66 31b0e: 5e e3 ldi r21, 0x3E ; 62 31b10: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31b14: 6b 01 movw r12, r22 31b16: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 31b18: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 31b1c: c2 56 subi r28, 0x62 ; 98 31b1e: de 4f sbci r29, 0xFE ; 254 31b20: 68 83 st Y, r22 31b22: 79 83 std Y+1, r23 ; 0x01 31b24: 8a 83 std Y+2, r24 ; 0x02 31b26: 9b 83 std Y+3, r25 ; 0x03 31b28: ce 59 subi r28, 0x9E ; 158 31b2a: d1 40 sbci r29, 0x01 ; 1 31b2c: c7 01 movw r24, r14 31b2e: b6 01 movw r22, r12 31b30: 0f 94 31 df call 0x3be62 ; 0x3be62 31b34: ce 55 subi r28, 0x5E ; 94 31b36: de 4f sbci r29, 0xFE ; 254 31b38: 68 83 st Y, r22 31b3a: 79 83 std Y+1, r23 ; 0x01 31b3c: 8a 83 std Y+2, r24 ; 0x02 31b3e: 9b 83 std Y+3, r25 ; 0x03 31b40: c2 5a subi r28, 0xA2 ; 162 31b42: d1 40 sbci r29, 0x01 ; 1 31b44: 9b 01 movw r18, r22 31b46: ac 01 movw r20, r24 31b48: c6 56 subi r28, 0x66 ; 102 31b4a: de 4f sbci r29, 0xFE ; 254 31b4c: 68 81 ld r22, Y 31b4e: 79 81 ldd r23, Y+1 ; 0x01 31b50: 8a 81 ldd r24, Y+2 ; 0x02 31b52: 9b 81 ldd r25, Y+3 ; 0x03 31b54: ca 59 subi r28, 0x9A ; 154 31b56: d1 40 sbci r29, 0x01 ; 1 31b58: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31b5c: c6 54 subi r28, 0x46 ; 70 31b5e: de 4f sbci r29, 0xFE ; 254 31b60: 28 81 ld r18, Y 31b62: 39 81 ldd r19, Y+1 ; 0x01 31b64: 4a 81 ldd r20, Y+2 ; 0x02 31b66: 5b 81 ldd r21, Y+3 ; 0x03 31b68: ca 5b subi r28, 0xBA ; 186 31b6a: d1 40 sbci r29, 0x01 ; 1 31b6c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 31b70: 6b 01 movw r12, r22 31b72: 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) 31b74: 20 e0 ldi r18, 0x00 ; 0 31b76: 30 e0 ldi r19, 0x00 ; 0 31b78: a9 01 movw r20, r18 31b7a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 31b7e: 18 16 cp r1, r24 31b80: 0c f0 brlt .+2 ; 0x31b84 31b82: 7a c2 rjmp .+1268 ; 0x32078 // 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; 31b84: c2 56 subi r28, 0x62 ; 98 31b86: de 4f sbci r29, 0xFE ; 254 31b88: 28 81 ld r18, Y 31b8a: 39 81 ldd r19, Y+1 ; 0x01 31b8c: 4a 81 ldd r20, Y+2 ; 0x02 31b8e: 5b 81 ldd r21, Y+3 ; 0x03 31b90: ce 59 subi r28, 0x9E ; 158 31b92: d1 40 sbci r29, 0x01 ; 1 31b94: c6 56 subi r28, 0x66 ; 102 31b96: de 4f sbci r29, 0xFE ; 254 31b98: 68 81 ld r22, Y 31b9a: 79 81 ldd r23, Y+1 ; 0x01 31b9c: 8a 81 ldd r24, Y+2 ; 0x02 31b9e: 9b 81 ldd r25, Y+3 ; 0x03 31ba0: ca 59 subi r28, 0x9A ; 154 31ba2: d1 40 sbci r29, 0x01 ; 1 31ba4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31ba8: ca 54 subi r28, 0x4A ; 74 31baa: de 4f sbci r29, 0xFE ; 254 31bac: 28 81 ld r18, Y 31bae: 39 81 ldd r19, Y+1 ; 0x01 31bb0: 4a 81 ldd r20, Y+2 ; 0x02 31bb2: 5b 81 ldd r21, Y+3 ; 0x03 31bb4: c6 5b subi r28, 0xB6 ; 182 31bb6: d1 40 sbci r29, 0x01 ; 1 31bb8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 31bbc: 4b 01 movw r8, r22 31bbe: 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) 31bc0: 20 e0 ldi r18, 0x00 ; 0 31bc2: 30 e0 ldi r19, 0x00 ; 0 31bc4: a9 01 movw r20, r18 31bc6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 31bca: 18 16 cp r1, r24 31bcc: 0c f0 brlt .+2 ; 0x31bd0 31bce: 54 c2 rjmp .+1192 ; 0x32078 31bd0: 20 e0 ldi r18, 0x00 ; 0 31bd2: 30 e0 ldi r19, 0x00 ; 0 31bd4: 48 ef ldi r20, 0xF8 ; 248 31bd6: 51 e4 ldi r21, 0x41 ; 65 31bd8: c7 01 movw r24, r14 31bda: b6 01 movw r22, r12 31bdc: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 31be0: 87 ff sbrs r24, 7 31be2: 4a c2 rjmp .+1172 ; 0x32078 31be4: 20 e0 ldi r18, 0x00 ; 0 31be6: 30 e0 ldi r19, 0x00 ; 0 31be8: 48 ef ldi r20, 0xF8 ; 248 31bea: 51 e4 ldi r21, 0x41 ; 65 31bec: c5 01 movw r24, r10 31bee: b4 01 movw r22, r8 31bf0: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 31bf4: 87 ff sbrs r24, 7 31bf6: 40 c2 rjmp .+1152 ; 0x32078 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 31bf8: c7 01 movw r24, r14 31bfa: b6 01 movw r22, r12 31bfc: 0f 94 de df call 0x3bfbc ; 0x3bfbc 31c00: 9b 01 movw r18, r22 31c02: ac 01 movw r20, r24 31c04: c7 01 movw r24, r14 31c06: b6 01 movw r22, r12 31c08: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31c0c: 2b 01 movw r4, r22 31c0e: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 31c10: c5 01 movw r24, r10 31c12: b4 01 movw r22, r8 31c14: 0f 94 de df call 0x3bfbc ; 0x3bfbc 31c18: 9b 01 movw r18, r22 31c1a: ac 01 movw r20, r24 31c1c: c5 01 movw r24, r10 31c1e: b4 01 movw r22, r8 31c20: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31c24: cc 56 subi r28, 0x6C ; 108 31c26: de 4f sbci r29, 0xFE ; 254 31c28: 68 83 st Y, r22 31c2a: 79 83 std Y+1, r23 ; 0x01 31c2c: 8a 83 std Y+2, r24 ; 0x02 31c2e: 9b 83 std Y+3, r25 ; 0x03 31c30: c4 59 subi r28, 0x94 ; 148 31c32: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 31c34: a3 01 movw r20, r6 31c36: 92 01 movw r18, r4 31c38: 60 e0 ldi r22, 0x00 ; 0 31c3a: 70 e0 ldi r23, 0x00 ; 0 31c3c: 80 e8 ldi r24, 0x80 ; 128 31c3e: 9f e3 ldi r25, 0x3F ; 63 31c40: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31c44: c2 55 subi r28, 0x52 ; 82 31c46: de 4f sbci r29, 0xFE ; 254 31c48: 68 83 st Y, r22 31c4a: 79 83 std Y+1, r23 ; 0x01 31c4c: 8a 83 std Y+2, r24 ; 0x02 31c4e: 9b 83 std Y+3, r25 ; 0x03 31c50: ce 5a subi r28, 0xAE ; 174 31c52: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 31c54: cc 56 subi r28, 0x6C ; 108 31c56: de 4f sbci r29, 0xFE ; 254 31c58: 28 81 ld r18, Y 31c5a: 39 81 ldd r19, Y+1 ; 0x01 31c5c: 4a 81 ldd r20, Y+2 ; 0x02 31c5e: 5b 81 ldd r21, Y+3 ; 0x03 31c60: c4 59 subi r28, 0x94 ; 148 31c62: d1 40 sbci r29, 0x01 ; 1 31c64: 60 e0 ldi r22, 0x00 ; 0 31c66: 70 e0 ldi r23, 0x00 ; 0 31c68: 80 e8 ldi r24, 0x80 ; 128 31c6a: 9f e3 ldi r25, 0x3F ; 63 31c6c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31c70: ce 54 subi r28, 0x4E ; 78 31c72: de 4f sbci r29, 0xFE ; 254 31c74: 68 83 st Y, r22 31c76: 79 83 std Y+1, r23 ; 0x01 31c78: 8a 83 std Y+2, r24 ; 0x02 31c7a: 9b 83 std Y+3, r25 ; 0x03 31c7c: c2 5b subi r28, 0xB2 ; 178 31c7e: 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; 31c80: c7 01 movw r24, r14 31c82: b6 01 movw r22, r12 31c84: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 31c88: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 31c8a: fb 01 movw r30, r22 31c8c: 31 96 adiw r30, 0x01 ; 1 31c8e: c6 55 subi r28, 0x56 ; 86 31c90: de 4f sbci r29, 0xFE ; 254 31c92: f9 83 std Y+1, r31 ; 0x01 31c94: e8 83 st Y, r30 31c96: ca 5a subi r28, 0xAA ; 170 31c98: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 31c9a: c5 01 movw r24, r10 31c9c: b4 01 movw r22, r8 31c9e: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 31ca2: 8b 01 movw r16, r22 31ca4: 95 e0 ldi r25, 0x05 ; 5 31ca6: 00 0f add r16, r16 31ca8: 11 1f adc r17, r17 31caa: 9a 95 dec r25 31cac: e1 f7 brne .-8 ; 0x31ca6 const uint16_t idx01 = c0 + 32 * r1; 31cae: c8 01 movw r24, r16 31cb0: 80 96 adiw r24, 0x20 ; 32 31cb2: c4 55 subi r28, 0x54 ; 84 31cb4: de 4f sbci r29, 0xFE ; 254 31cb6: 99 83 std Y+1, r25 ; 0x01 31cb8: 88 83 st Y, r24 31cba: cc 5a subi r28, 0xAC ; 172 31cbc: 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]; 31cbe: f8 01 movw r30, r16 31cc0: ec 0d add r30, r12 31cc2: fd 1d adc r31, r13 31cc4: ed 58 subi r30, 0x8D ; 141 31cc6: f8 4f sbci r31, 0xF8 ; 248 31cc8: 60 81 ld r22, Z 31cca: 70 e0 ldi r23, 0x00 ; 0 31ccc: 90 e0 ldi r25, 0x00 ; 0 31cce: 80 e0 ldi r24, 0x00 ; 0 31cd0: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 31cd4: 4b 01 movw r8, r22 31cd6: 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; 31cd8: ce 54 subi r28, 0x4E ; 78 31cda: de 4f sbci r29, 0xFE ; 254 31cdc: 28 81 ld r18, Y 31cde: 39 81 ldd r19, Y+1 ; 0x01 31ce0: 4a 81 ldd r20, Y+2 ; 0x02 31ce2: 5b 81 ldd r21, Y+3 ; 0x03 31ce4: c2 5b subi r28, 0xB2 ; 178 31ce6: d1 40 sbci r29, 0x01 ; 1 31ce8: c2 55 subi r28, 0x52 ; 82 31cea: de 4f sbci r29, 0xFE ; 254 31cec: 68 81 ld r22, Y 31cee: 79 81 ldd r23, Y+1 ; 0x01 31cf0: 8a 81 ldd r24, Y+2 ; 0x02 31cf2: 9b 81 ldd r25, Y+3 ; 0x03 31cf4: ce 5a subi r28, 0xAE ; 174 31cf6: d1 40 sbci r29, 0x01 ; 1 31cf8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31cfc: 9b 01 movw r18, r22 31cfe: 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]; 31d00: c5 01 movw r24, r10 31d02: b4 01 movw r22, r8 31d04: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31d08: 4b 01 movw r8, r22 31d0a: 5c 01 movw r10, r24 31d0c: c4 55 subi r28, 0x54 ; 84 31d0e: de 4f sbci r29, 0xFE ; 254 31d10: e8 81 ld r30, Y 31d12: f9 81 ldd r31, Y+1 ; 0x01 31d14: cc 5a subi r28, 0xAC ; 172 31d16: d1 40 sbci r29, 0x01 ; 1 31d18: ec 0d add r30, r12 31d1a: fd 1d adc r31, r13 31d1c: ed 58 subi r30, 0x8D ; 141 31d1e: f8 4f sbci r31, 0xF8 ; 248 31d20: 60 81 ld r22, Z 31d22: 70 e0 ldi r23, 0x00 ; 0 31d24: 90 e0 ldi r25, 0x00 ; 0 31d26: 80 e0 ldi r24, 0x00 ; 0 31d28: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 31d2c: 6b 01 movw r12, r22 31d2e: 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; 31d30: c2 55 subi r28, 0x52 ; 82 31d32: de 4f sbci r29, 0xFE ; 254 31d34: 28 81 ld r18, Y 31d36: 39 81 ldd r19, Y+1 ; 0x01 31d38: 4a 81 ldd r20, Y+2 ; 0x02 31d3a: 5b 81 ldd r21, Y+3 ; 0x03 31d3c: ce 5a subi r28, 0xAE ; 174 31d3e: d1 40 sbci r29, 0x01 ; 1 31d40: cc 56 subi r28, 0x6C ; 108 31d42: de 4f sbci r29, 0xFE ; 254 31d44: 68 81 ld r22, Y 31d46: 79 81 ldd r23, Y+1 ; 0x01 31d48: 8a 81 ldd r24, Y+2 ; 0x02 31d4a: 9b 81 ldd r25, Y+3 ; 0x03 31d4c: c4 59 subi r28, 0x94 ; 148 31d4e: d1 40 sbci r29, 0x01 ; 1 31d50: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31d54: 9b 01 movw r18, r22 31d56: 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]; 31d58: c7 01 movw r24, r14 31d5a: b6 01 movw r22, r12 31d5c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31d60: 9b 01 movw r18, r22 31d62: ac 01 movw r20, r24 31d64: c5 01 movw r24, r10 31d66: b4 01 movw r22, r8 31d68: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 31d6c: 6b 01 movw r12, r22 31d6e: 7c 01 movw r14, r24 31d70: c6 55 subi r28, 0x56 ; 86 31d72: de 4f sbci r29, 0xFE ; 254 31d74: a8 81 ld r26, Y 31d76: b9 81 ldd r27, Y+1 ; 0x01 31d78: ca 5a subi r28, 0xAA ; 170 31d7a: d1 40 sbci r29, 0x01 ; 1 31d7c: 0a 0f add r16, r26 31d7e: 1b 1f adc r17, r27 31d80: f8 01 movw r30, r16 31d82: ed 58 subi r30, 0x8D ; 141 31d84: f8 4f sbci r31, 0xF8 ; 248 31d86: 60 81 ld r22, Z 31d88: 70 e0 ldi r23, 0x00 ; 0 31d8a: 90 e0 ldi r25, 0x00 ; 0 31d8c: 80 e0 ldi r24, 0x00 ; 0 31d8e: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 31d92: 4b 01 movw r8, r22 31d94: 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; 31d96: ce 54 subi r28, 0x4E ; 78 31d98: de 4f sbci r29, 0xFE ; 254 31d9a: 28 81 ld r18, Y 31d9c: 39 81 ldd r19, Y+1 ; 0x01 31d9e: 4a 81 ldd r20, Y+2 ; 0x02 31da0: 5b 81 ldd r21, Y+3 ; 0x03 31da2: c2 5b subi r28, 0xB2 ; 178 31da4: d1 40 sbci r29, 0x01 ; 1 31da6: c3 01 movw r24, r6 31da8: b2 01 movw r22, r4 31daa: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31dae: 9b 01 movw r18, r22 31db0: 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]; 31db2: c5 01 movw r24, r10 31db4: b4 01 movw r22, r8 31db6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31dba: 9b 01 movw r18, r22 31dbc: ac 01 movw r20, r24 31dbe: c7 01 movw r24, r14 31dc0: b6 01 movw r22, r12 31dc2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 31dc6: 6b 01 movw r12, r22 31dc8: 7c 01 movw r14, r24 31dca: c6 55 subi r28, 0x56 ; 86 31dcc: de 4f sbci r29, 0xFE ; 254 31dce: e8 81 ld r30, Y 31dd0: f9 81 ldd r31, Y+1 ; 0x01 31dd2: ca 5a subi r28, 0xAA ; 170 31dd4: d1 40 sbci r29, 0x01 ; 1 31dd6: c4 55 subi r28, 0x54 ; 84 31dd8: de 4f sbci r29, 0xFE ; 254 31dda: 88 81 ld r24, Y 31ddc: 99 81 ldd r25, Y+1 ; 0x01 31dde: cc 5a subi r28, 0xAC ; 172 31de0: d1 40 sbci r29, 0x01 ; 1 31de2: e8 0f add r30, r24 31de4: f9 1f adc r31, r25 31de6: ed 58 subi r30, 0x8D ; 141 31de8: f8 4f sbci r31, 0xF8 ; 248 31dea: 60 81 ld r22, Z 31dec: 70 e0 ldi r23, 0x00 ; 0 31dee: 90 e0 ldi r25, 0x00 ; 0 31df0: 80 e0 ldi r24, 0x00 ; 0 31df2: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 31df6: 4b 01 movw r8, r22 31df8: 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; 31dfa: cc 56 subi r28, 0x6C ; 108 31dfc: de 4f sbci r29, 0xFE ; 254 31dfe: 28 81 ld r18, Y 31e00: 39 81 ldd r19, Y+1 ; 0x01 31e02: 4a 81 ldd r20, Y+2 ; 0x02 31e04: 5b 81 ldd r21, Y+3 ; 0x03 31e06: c4 59 subi r28, 0x94 ; 148 31e08: d1 40 sbci r29, 0x01 ; 1 31e0a: c3 01 movw r24, r6 31e0c: b2 01 movw r22, r4 31e0e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31e12: 9b 01 movw r18, r22 31e14: 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]; 31e16: c5 01 movw r24, r10 31e18: b4 01 movw r22, r8 31e1a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31e1e: 9b 01 movw r18, r22 31e20: ac 01 movw r20, r24 31e22: c7 01 movw r24, r14 31e24: b6 01 movw r22, r12 31e26: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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; 31e2a: 20 e0 ldi r18, 0x00 ; 0 31e2c: 30 e0 ldi r19, 0x00 ; 0 31e2e: 40 e0 ldi r20, 0x00 ; 0 31e30: 52 e4 ldi r21, 0x42 ; 66 31e32: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 31e36: 6b 01 movw r12, r22 31e38: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 31e3a: ac 01 movw r20, r24 31e3c: 9b 01 movw r18, r22 31e3e: ce 55 subi r28, 0x5E ; 94 31e40: de 4f sbci r29, 0xFE ; 254 31e42: 68 81 ld r22, Y 31e44: 79 81 ldd r23, Y+1 ; 0x01 31e46: 8a 81 ldd r24, Y+2 ; 0x02 31e48: 9b 81 ldd r25, Y+3 ; 0x03 31e4a: c2 5a subi r28, 0xA2 ; 162 31e4c: d1 40 sbci r29, 0x01 ; 1 31e4e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31e52: c8 55 subi r28, 0x58 ; 88 31e54: de 4f sbci r29, 0xFE ; 254 31e56: a8 81 ld r26, Y 31e58: b9 81 ldd r27, Y+1 ; 0x01 31e5a: c8 5a subi r28, 0xA8 ; 168 31e5c: d1 40 sbci r29, 0x01 ; 1 31e5e: 6d 93 st X+, r22 31e60: 7d 93 st X+, r23 31e62: 8d 93 st X+, r24 31e64: 9d 93 st X+, r25 31e66: c8 55 subi r28, 0x58 ; 88 31e68: de 4f sbci r29, 0xFE ; 254 31e6a: b9 83 std Y+1, r27 ; 0x01 31e6c: a8 83 st Y, r26 31e6e: c8 5a subi r28, 0xA8 ; 168 31e70: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 31e72: a7 01 movw r20, r14 31e74: 96 01 movw r18, r12 31e76: c2 56 subi r28, 0x62 ; 98 31e78: de 4f sbci r29, 0xFE ; 254 31e7a: 68 81 ld r22, Y 31e7c: 79 81 ldd r23, Y+1 ; 0x01 31e7e: 8a 81 ldd r24, Y+2 ; 0x02 31e80: 9b 81 ldd r25, Y+3 ; 0x03 31e82: ce 59 subi r28, 0x9E ; 158 31e84: d1 40 sbci r29, 0x01 ; 1 31e86: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 31e8a: ca 55 subi r28, 0x5A ; 90 31e8c: de 4f sbci r29, 0xFE ; 254 31e8e: e8 81 ld r30, Y 31e90: f9 81 ldd r31, Y+1 ; 0x01 31e92: c6 5a subi r28, 0xA6 ; 166 31e94: d1 40 sbci r29, 0x01 ; 1 31e96: 61 93 st Z+, r22 31e98: 71 93 st Z+, r23 31e9a: 81 93 st Z+, r24 31e9c: 91 93 st Z+, r25 31e9e: ca 55 subi r28, 0x5A ; 90 31ea0: de 4f sbci r29, 0xFE ; 254 31ea2: f9 83 std Y+1, r31 ; 0x01 31ea4: e8 83 st Y, r30 31ea6: c6 5a subi r28, 0xA6 ; 166 31ea8: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 31eaa: c8 56 subi r28, 0x68 ; 104 31eac: de 4f sbci r29, 0xFE ; 254 31eae: a8 81 ld r26, Y 31eb0: b9 81 ldd r27, Y+1 ; 0x01 31eb2: c8 59 subi r28, 0x98 ; 152 31eb4: d1 40 sbci r29, 0x01 ; 1 31eb6: cd 92 st X+, r12 31eb8: dd 92 st X+, r13 31eba: ed 92 st X+, r14 31ebc: fd 92 st X+, r15 31ebe: c8 56 subi r28, 0x68 ; 104 31ec0: de 4f sbci r29, 0xFE ; 254 31ec2: b9 83 std Y+1, r27 ; 0x01 31ec4: a8 83 st Y, r26 31ec6: c8 59 subi r28, 0x98 ; 152 31ec8: d1 40 sbci r29, 0x01 ; 1 31eca: bf ef ldi r27, 0xFF ; 255 31ecc: 2b 1a sub r2, r27 31ece: 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){ 31ed0: e1 e2 ldi r30, 0x21 ; 33 31ed2: 2e 16 cp r2, r30 31ed4: 31 04 cpc r3, r1 31ed6: 09 f0 breq .+2 ; 0x31eda 31ed8: 10 ce rjmp .-992 ; 0x31afa 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); 31eda: 40 e0 ldi r20, 0x00 ; 0 31edc: 50 e0 ldi r21, 0x00 ; 0 31ede: 60 e0 ldi r22, 0x00 ; 0 31ee0: 7d e3 ldi r23, 0x3D ; 61 31ee2: ce 01 movw r24, r28 31ee4: 87 5f subi r24, 0xF7 ; 247 31ee6: 9e 4f sbci r25, 0xFE ; 254 31ee8: 0f 94 6f 6e call 0x2dcde ; 0x2dcde 31eec: 9b 01 movw r18, r22 31eee: ac 01 movw r20, r24 31ef0: c3 57 subi r28, 0x73 ; 115 31ef2: de 4f sbci r29, 0xFE ; 254 31ef4: a8 81 ld r26, Y 31ef6: b9 81 ldd r27, Y+1 ; 0x01 31ef8: cd 58 subi r28, 0x8D ; 141 31efa: d1 40 sbci r29, 0x01 ; 1 31efc: 6d 91 ld r22, X+ 31efe: 7d 91 ld r23, X+ 31f00: 8d 91 ld r24, X+ 31f02: 9c 91 ld r25, X 31f04: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 31f08: c3 57 subi r28, 0x73 ; 115 31f0a: de 4f sbci r29, 0xFE ; 254 31f0c: e8 81 ld r30, Y 31f0e: f9 81 ldd r31, Y+1 ; 0x01 31f10: cd 58 subi r28, 0x8D ; 141 31f12: d1 40 sbci r29, 0x01 ; 1 31f14: 60 83 st Z, r22 31f16: 71 83 std Z+1, r23 ; 0x01 31f18: 82 83 std Z+2, r24 ; 0x02 31f1a: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 31f1c: 40 e0 ldi r20, 0x00 ; 0 31f1e: 50 e0 ldi r21, 0x00 ; 0 31f20: 60 e0 ldi r22, 0x00 ; 0 31f22: 7d e3 ldi r23, 0x3D ; 61 31f24: ce 01 movw r24, r28 31f26: 8b 57 subi r24, 0x7B ; 123 31f28: 9f 4f sbci r25, 0xFF ; 255 31f2a: 0f 94 6f 6e call 0x2dcde ; 0x2dcde 31f2e: 9b 01 movw r18, r22 31f30: ac 01 movw r20, r24 31f32: c1 57 subi r28, 0x71 ; 113 31f34: de 4f sbci r29, 0xFE ; 254 31f36: a8 81 ld r26, Y 31f38: b9 81 ldd r27, Y+1 ; 0x01 31f3a: cf 58 subi r28, 0x8F ; 143 31f3c: d1 40 sbci r29, 0x01 ; 1 31f3e: 6d 91 ld r22, X+ 31f40: 7d 91 ld r23, X+ 31f42: 8d 91 ld r24, X+ 31f44: 9c 91 ld r25, X 31f46: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 31f4a: c1 57 subi r28, 0x71 ; 113 31f4c: de 4f sbci r29, 0xFE ; 254 31f4e: e8 81 ld r30, Y 31f50: f9 81 ldd r31, Y+1 ; 0x01 31f52: cf 58 subi r28, 0x8F ; 143 31f54: d1 40 sbci r29, 0x01 ; 1 31f56: 60 83 st Z, r22 31f58: 71 83 std Z+1, r23 ; 0x01 31f5a: 82 83 std Z+2, r24 ; 0x02 31f5c: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 31f5e: 40 e0 ldi r20, 0x00 ; 0 31f60: 50 e0 ldi r21, 0x00 ; 0 31f62: 60 e8 ldi r22, 0x80 ; 128 31f64: 7c e3 ldi r23, 0x3C ; 60 31f66: ce 01 movw r24, r28 31f68: 01 96 adiw r24, 0x01 ; 1 31f6a: 0f 94 6f 6e call 0x2dcde ; 0x2dcde 31f6e: ce 56 subi r28, 0x6E ; 110 31f70: de 4f sbci r29, 0xFE ; 254 31f72: a8 81 ld r26, Y 31f74: b9 81 ldd r27, Y+1 ; 0x01 31f76: c2 59 subi r28, 0x92 ; 146 31f78: d1 40 sbci r29, 0x01 ; 1 31f7a: 2d 91 ld r18, X+ 31f7c: 3d 91 ld r19, X+ 31f7e: 4d 91 ld r20, X+ 31f80: 5c 91 ld r21, X 31f82: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 31f86: 16 2f mov r17, r22 31f88: 07 2f mov r16, r23 31f8a: f8 2e mov r15, r24 31f8c: e9 2e mov r14, r25 r = MAX(2, r); 31f8e: 20 e0 ldi r18, 0x00 ; 0 31f90: 30 e0 ldi r19, 0x00 ; 0 31f92: 40 e0 ldi r20, 0x00 ; 0 31f94: 50 e4 ldi r21, 0x40 ; 64 31f96: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 31f9a: 18 16 cp r1, r24 31f9c: 2c f0 brlt .+10 ; 0x31fa8 31f9e: 10 e0 ldi r17, 0x00 ; 0 31fa0: 00 e0 ldi r16, 0x00 ; 0 31fa2: f1 2c mov r15, r1 31fa4: 80 e4 ldi r24, 0x40 ; 64 31fa6: e8 2e mov r14, r24 31fa8: a8 01 movw r20, r16 31faa: 97 01 movw r18, r14 31fac: 85 2f mov r24, r21 31fae: 90 2f mov r25, r16 31fb0: a3 2f mov r26, r19 31fb2: be 2d mov r27, r14 31fb4: ce 56 subi r28, 0x6E ; 110 31fb6: de 4f sbci r29, 0xFE ; 254 31fb8: e8 81 ld r30, Y 31fba: f9 81 ldd r31, Y+1 ; 0x01 31fbc: c2 59 subi r28, 0x92 ; 146 31fbe: d1 40 sbci r29, 0x01 ; 1 31fc0: 80 83 st Z, r24 31fc2: 91 83 std Z+1, r25 ; 0x01 31fc4: a2 83 std Z+2, r26 ; 0x02 31fc6: b3 83 std Z+3, r27 ; 0x03 31fc8: cf 56 subi r28, 0x6F ; 111 31fca: de 4f sbci r29, 0xFE ; 254 31fcc: f8 81 ld r31, Y 31fce: c1 59 subi r28, 0x91 ; 145 31fd0: d1 40 sbci r29, 0x01 ; 1 31fd2: f1 50 subi r31, 0x01 ; 1 31fd4: cf 56 subi r28, 0x6F ; 111 31fd6: de 4f sbci r29, 0xFE ; 254 31fd8: f8 83 st Y, r31 31fda: c1 59 subi r28, 0x91 ; 145 31fdc: 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){ 31fde: f1 11 cpse r31, r1 31fe0: 37 cd rjmp .-1426 ; 0x31a50 r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 31fe2: ef 92 push r14 31fe4: ff 92 push r15 31fe6: 0f 93 push r16 31fe8: 1f 93 push r17 31fea: c1 57 subi r28, 0x71 ; 113 31fec: de 4f sbci r29, 0xFE ; 254 31fee: a8 81 ld r26, Y 31ff0: b9 81 ldd r27, Y+1 ; 0x01 31ff2: cf 58 subi r28, 0x8F ; 143 31ff4: d1 40 sbci r29, 0x01 ; 1 31ff6: 13 96 adiw r26, 0x03 ; 3 31ff8: 8c 91 ld r24, X 31ffa: 13 97 sbiw r26, 0x03 ; 3 31ffc: 8f 93 push r24 31ffe: 12 96 adiw r26, 0x02 ; 2 32000: 8c 91 ld r24, X 32002: 12 97 sbiw r26, 0x02 ; 2 32004: 8f 93 push r24 32006: 11 96 adiw r26, 0x01 ; 1 32008: 8c 91 ld r24, X 3200a: 11 97 sbiw r26, 0x01 ; 1 3200c: 8f 93 push r24 3200e: 8c 91 ld r24, X 32010: 8f 93 push r24 32012: c3 57 subi r28, 0x73 ; 115 32014: de 4f sbci r29, 0xFE ; 254 32016: e8 81 ld r30, Y 32018: f9 81 ldd r31, Y+1 ; 0x01 3201a: cd 58 subi r28, 0x8D ; 141 3201c: d1 40 sbci r29, 0x01 ; 1 3201e: 83 81 ldd r24, Z+3 ; 0x03 32020: 8f 93 push r24 32022: 82 81 ldd r24, Z+2 ; 0x02 32024: 8f 93 push r24 32026: 81 81 ldd r24, Z+1 ; 0x01 32028: 8f 93 push r24 3202a: 80 81 ld r24, Z 3202c: 8f 93 push r24 3202e: 85 e5 ldi r24, 0x55 ; 85 32030: 96 ea ldi r25, 0xA6 ; 166 32032: 9f 93 push r25 32034: 8f 93 push r24 32036: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 3203a: 0f b6 in r0, 0x3f ; 63 3203c: f8 94 cli 3203e: de bf out 0x3e, r29 ; 62 32040: 0f be out 0x3f, r0 ; 63 32042: cd bf out 0x3d, r28 ; 61 } 32044: c3 54 subi r28, 0x43 ; 67 32046: de 4f sbci r29, 0xFE ; 254 32048: 0f b6 in r0, 0x3f ; 63 3204a: f8 94 cli 3204c: de bf out 0x3e, r29 ; 62 3204e: 0f be out 0x3f, r0 ; 63 32050: cd bf out 0x3d, r28 ; 61 32052: df 91 pop r29 32054: cf 91 pop r28 32056: 1f 91 pop r17 32058: 0f 91 pop r16 3205a: ff 90 pop r15 3205c: ef 90 pop r14 3205e: df 90 pop r13 32060: cf 90 pop r12 32062: bf 90 pop r11 32064: af 90 pop r10 32066: 9f 90 pop r9 32068: 8f 90 pop r8 3206a: 7f 90 pop r7 3206c: 6f 90 pop r6 3206e: 5f 90 pop r5 32070: 4f 90 pop r4 32072: 3f 90 pop r3 32074: 2f 90 pop r2 32076: 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; 32078: 60 e0 ldi r22, 0x00 ; 0 3207a: 70 e0 ldi r23, 0x00 ; 0 3207c: cb 01 movw r24, r22 3207e: d5 ce rjmp .-598 ; 0x31e2a 00032080 : } /// 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){ 32080: 2f 92 push r2 32082: 3f 92 push r3 32084: 4f 92 push r4 32086: 5f 92 push r5 32088: 6f 92 push r6 3208a: 7f 92 push r7 3208c: 8f 92 push r8 3208e: 9f 92 push r9 32090: af 92 push r10 32092: bf 92 push r11 32094: cf 92 push r12 32096: df 92 push r13 32098: ef 92 push r14 3209a: ff 92 push r15 3209c: 0f 93 push r16 3209e: 1f 93 push r17 320a0: cf 93 push r28 320a2: df 93 push r29 320a4: 00 d0 rcall .+0 ; 0x320a6 320a6: 1f 92 push r1 320a8: 1f 92 push r1 320aa: cd b7 in r28, 0x3d ; 61 320ac: de b7 in r29, 0x3e ; 62 320ae: 2b 01 movw r4, r22 320b0: 1a 01 movw r2, r20 320b2: f1 2c mov r15, r1 320b4: 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; 320b6: 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; 320b8: 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; 320ba: 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){ 320bc: 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); 320be: 66 24 eor r6, r6 320c0: 63 94 inc r6 320c2: 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){ 320c4: 70 e0 ldi r23, 0x00 ; 0 320c6: 60 e0 ldi r22, 0x00 ; 0 320c8: 97 01 movw r18, r14 320ca: 2d 58 subi r18, 0x8D ; 141 320cc: 38 4f sbci r19, 0xF8 ; 248 320ce: 3a 83 std Y+2, r19 ; 0x02 320d0: 29 83 std Y+1, r18 ; 0x01 320d2: 86 2e mov r8, r22 320d4: c9 80 ldd r12, Y+1 ; 0x01 320d6: da 80 ldd r13, Y+2 ; 0x02 320d8: c6 0e add r12, r22 320da: d7 1e adc r13, r23 320dc: 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; 320de: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 320e0: 40 e0 ldi r20, 0x00 ; 0 320e2: 30 e0 ldi r19, 0x00 ; 0 320e4: 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; 320e6: ae ef ldi r26, 0xFE ; 254 320e8: a4 0f add r26, r20 320ea: 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; 320ec: 44 23 and r20, r20 320ee: 19 f0 breq .+6 ; 0x320f6 320f0: 4b 30 cpi r20, 0x0B ; 11 320f2: 09 f0 breq .+2 ; 0x320f6 320f4: 7d c0 rjmp .+250 ; 0x321f0 320f6: ae ef ldi r26, 0xFE ; 254 320f8: a2 0f add r26, r18 320fa: a8 30 cpi r26, 0x08 ; 8 320fc: 08 f4 brcc .+2 ; 0x32100 320fe: 7a c0 rjmp .+244 ; 0x321f4 32100: 2f 5f subi r18, 0xFF ; 255 32102: 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){ 32104: 2c 30 cpi r18, 0x0C ; 12 32106: 31 05 cpc r19, r1 32108: 89 f7 brne .-30 ; 0x320ec /// 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){ 3210a: 4f 5f subi r20, 0xFF ; 255 3210c: 20 e2 ldi r18, 0x20 ; 32 3210e: c2 0e add r12, r18 32110: d1 1c adc r13, r1 32112: 32 96 adiw r30, 0x02 ; 2 32114: 4c 30 cpi r20, 0x0C ; 12 32116: 29 f7 brne .-54 ; 0x320e2 // 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){ 32118: 3c 81 ldd r19, Y+4 ; 0x04 3211a: 30 17 cp r19, r16 3211c: 18 f4 brcc .+6 ; 0x32124 3211e: 0c 83 std Y+4, r16 ; 0x04 32120: 5d 83 std Y+5, r21 ; 0x05 32122: 18 2d mov r17, r8 32124: 6f 5f subi r22, 0xFF ; 255 32126: 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){ 32128: 64 31 cpi r22, 0x14 ; 20 3212a: 71 05 cpc r23, r1 3212c: 91 f6 brne .-92 ; 0x320d2 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){ 3212e: 5f 5f subi r21, 0xFF ; 255 32130: a0 e2 ldi r26, 0x20 ; 32 32132: ea 0e add r14, r26 32134: f1 1c adc r15, r1 32136: 54 31 cpi r21, 0x14 ; 20 32138: 29 f6 brne .-118 ; 0x320c4 // 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); 3213a: ec 81 ldd r30, Y+4 ; 0x04 3213c: 6e 2f mov r22, r30 3213e: 70 e0 ldi r23, 0x00 ; 0 32140: 90 e0 ldi r25, 0x00 ; 0 32142: 80 e0 ldi r24, 0x00 ; 0 32144: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 32148: 23 ec ldi r18, 0xC3 ; 195 3214a: 35 ef ldi r19, 0xF5 ; 245 3214c: 48 ea ldi r20, 0xA8 ; 168 3214e: 5f e3 ldi r21, 0x3F ; 63 32150: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 32154: 9f 93 push r25 32156: 8f 93 push r24 32158: 7f 93 push r23 3215a: 6f 93 push r22 3215c: fd 81 ldd r31, Y+5 ; 0x05 3215e: 6f 2f mov r22, r31 32160: 70 e0 ldi r23, 0x00 ; 0 32162: 90 e0 ldi r25, 0x00 ; 0 32164: 80 e0 ldi r24, 0x00 ; 0 32166: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 3216a: 20 e0 ldi r18, 0x00 ; 0 3216c: 30 e0 ldi r19, 0x00 ; 0 3216e: 40 eb ldi r20, 0xB0 ; 176 32170: 50 e4 ldi r21, 0x40 ; 64 32172: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 32176: 9f 93 push r25 32178: 8f 93 push r24 3217a: 7f 93 push r23 3217c: 6f 93 push r22 3217e: 61 2f mov r22, r17 32180: 70 e0 ldi r23, 0x00 ; 0 32182: 90 e0 ldi r25, 0x00 ; 0 32184: 80 e0 ldi r24, 0x00 ; 0 32186: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 3218a: 20 e0 ldi r18, 0x00 ; 0 3218c: 30 e0 ldi r19, 0x00 ; 0 3218e: 40 eb ldi r20, 0xB0 ; 176 32190: 50 e4 ldi r21, 0x40 ; 64 32192: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 32196: 9f 93 push r25 32198: 8f 93 push r24 3219a: 7f 93 push r23 3219c: 6f 93 push r22 3219e: 81 e3 ldi r24, 0x31 ; 49 321a0: 96 ea ldi r25, 0xA6 ; 166 321a2: 9f 93 push r25 321a4: 8f 93 push r24 321a6: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 *pc = max_c; 321aa: f2 01 movw r30, r4 321ac: 10 83 st Z, r17 *pr = max_r; 321ae: 2d 81 ldd r18, Y+5 ; 0x05 321b0: f1 01 movw r30, r2 321b2: 20 83 st Z, r18 321b4: 0f b6 in r0, 0x3f ; 63 321b6: f8 94 cli 321b8: de bf out 0x3e, r29 ; 62 321ba: 0f be out 0x3f, r0 ; 63 321bc: cd bf out 0x3d, r28 ; 61 return max_match; } 321be: 8c 81 ldd r24, Y+4 ; 0x04 321c0: 0f 90 pop r0 321c2: 0f 90 pop r0 321c4: 0f 90 pop r0 321c6: 0f 90 pop r0 321c8: 0f 90 pop r0 321ca: df 91 pop r29 321cc: cf 91 pop r28 321ce: 1f 91 pop r17 321d0: 0f 91 pop r16 321d2: ff 90 pop r15 321d4: ef 90 pop r14 321d6: df 90 pop r13 321d8: cf 90 pop r12 321da: bf 90 pop r11 321dc: af 90 pop r10 321de: 9f 90 pop r9 321e0: 8f 90 pop r8 321e2: 7f 90 pop r7 321e4: 6f 90 pop r6 321e6: 5f 90 pop r5 321e8: 4f 90 pop r4 321ea: 3f 90 pop r3 321ec: 2f 90 pop r2 321ee: 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; 321f0: 22 23 and r18, r18 321f2: 11 f0 breq .+4 ; 0x321f8 321f4: 2b 30 cpi r18, 0x0B ; 11 321f6: 21 f4 brne .+8 ; 0x32200 321f8: ab 81 ldd r26, Y+3 ; 0x03 321fa: a8 30 cpi r26, 0x08 ; 8 321fc: 08 f0 brcs .+2 ; 0x32200 321fe: 80 cf rjmp .-256 ; 0x32100 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 32200: 99 24 eor r9, r9 32202: 93 94 inc r9 32204: d6 01 movw r26, r12 32206: a2 0f add r26, r18 32208: b3 1f adc r27, r19 3220a: ac 91 ld r26, X 3220c: a1 31 cpi r26, 0x11 ; 17 3220e: 08 f4 brcc .+2 ; 0x32212 32210: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 32212: a0 80 ld r10, Z 32214: b1 80 ldd r11, Z+1 ; 0x01 32216: d3 01 movw r26, r6 32218: 02 2e mov r0, r18 3221a: 02 c0 rjmp .+4 ; 0x32220 3221c: aa 0f add r26, r26 3221e: bb 1f adc r27, r27 32220: 0a 94 dec r0 32222: e2 f7 brpl .-8 ; 0x3221c 32224: aa 21 and r26, r10 32226: bb 21 and r27, r11 32228: bb 24 eor r11, r11 3222a: b3 94 inc r11 3222c: ab 2b or r26, r27 3222e: 09 f4 brne .+2 ; 0x32232 32230: b1 2c mov r11, r1 if (high_pix == high_pat) 32232: 9b 10 cpse r9, r11 32234: 65 cf rjmp .-310 ; 0x32100 match++; 32236: 0f 5f subi r16, 0xFF ; 255 32238: 63 cf rjmp .-314 ; 0x32100 0003223a : 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){ 3223a: 2f 92 push r2 3223c: 3f 92 push r3 3223e: 4f 92 push r4 32240: 5f 92 push r5 32242: 6f 92 push r6 32244: 7f 92 push r7 32246: 8f 92 push r8 32248: 9f 92 push r9 3224a: af 92 push r10 3224c: bf 92 push r11 3224e: cf 92 push r12 32250: df 92 push r13 32252: ef 92 push r14 32254: ff 92 push r15 32256: 0f 93 push r16 32258: 1f 93 push r17 3225a: cf 93 push r28 3225c: df 93 push r29 3225e: cd b7 in r28, 0x3d ; 61 32260: de b7 in r29, 0x3e ; 62 32262: ca 55 subi r28, 0x5A ; 90 32264: d1 09 sbc r29, r1 32266: 0f b6 in r0, 0x3f ; 63 32268: f8 94 cli 3226a: de bf out 0x3e, r29 ; 62 3226c: 0f be out 0x3f, r0 ; 63 3226e: cd bf out 0x3d, r28 ; 61 32270: 63 96 adiw r28, 0x13 ; 19 32272: 9f af std Y+63, r25 ; 0x3f 32274: 8e af std Y+62, r24 ; 0x3e 32276: 63 97 sbiw r28, 0x13 ; 19 32278: 8b 01 movw r16, r22 3227a: 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 3227c: 7e 01 movw r14, r28 3227e: 25 e4 ldi r18, 0x45 ; 69 32280: e2 0e add r14, r18 32282: f1 1c adc r15, r1 32284: 80 e1 ldi r24, 0x10 ; 16 32286: 97 e2 ldi r25, 0x27 ; 39 32288: f7 01 movw r30, r14 3228a: 91 83 std Z+1, r25 ; 0x01 3228c: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 3228e: 80 e2 ldi r24, 0x20 ; 32 32290: 96 ea ldi r25, 0xA6 ; 166 32292: 9f 93 push r25 32294: 8f 93 push r24 32296: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 3229a: 23 e7 ldi r18, 0x73 ; 115 3229c: 37 e0 ldi r19, 0x07 ; 7 3229e: 61 96 adiw r28, 0x11 ; 17 322a0: 3f af std Y+63, r19 ; 0x3f 322a2: 2e af std Y+62, r18 ; 0x3e 322a4: 61 97 sbiw r28, 0x11 ; 17 322a6: c8 01 movw r24, r16 322a8: 80 5e subi r24, 0xE0 ; 224 322aa: 93 40 sbci r25, 0x03 ; 3 322ac: 2b 96 adiw r28, 0x0b ; 11 322ae: 9f af std Y+63, r25 ; 0x3f 322b0: 8e af std Y+62, r24 ; 0x3e 322b2: 2b 97 sbiw r28, 0x0b ; 11 322b4: 0f 90 pop r0 322b6: 0f 90 pop r0 322b8: e0 e4 ldi r30, 0x40 ; 64 322ba: f0 e0 ldi r31, 0x00 ; 0 322bc: 29 96 adiw r28, 0x09 ; 9 322be: ff af std Y+63, r31 ; 0x3f 322c0: ee af std Y+62, r30 ; 0x3e 322c2: 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); 322c4: 63 96 adiw r28, 0x13 ; 19 322c6: 2e ad ldd r18, Y+62 ; 0x3e 322c8: 3f ad ldd r19, Y+63 ; 0x3f 322ca: 63 97 sbiw r28, 0x13 ; 19 322cc: 20 5e subi r18, 0xE0 ; 224 322ce: 33 40 sbci r19, 0x03 ; 3 322d0: 69 96 adiw r28, 0x19 ; 25 322d2: 3f af std Y+63, r19 ; 0x3f 322d4: 2e af std Y+62, r18 ; 0x3e 322d6: 69 97 sbiw r28, 0x19 ; 25 322d8: 29 96 adiw r28, 0x09 ; 9 322da: 4e ac ldd r4, Y+62 ; 0x3e 322dc: 5f ac ldd r5, Y+63 ; 0x3f 322de: 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){ 322e0: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 322e2: 63 96 adiw r28, 0x13 ; 19 322e4: 8e ad ldd r24, Y+62 ; 0x3e 322e6: 9f ad ldd r25, Y+63 ; 0x3f 322e8: 63 97 sbiw r28, 0x13 ; 19 322ea: 80 52 subi r24, 0x20 ; 32 322ec: 9c 4f sbci r25, 0xFC ; 252 322ee: 6b 96 adiw r28, 0x1b ; 27 322f0: 9f af std Y+63, r25 ; 0x3f 322f2: 8e af std Y+62, r24 ; 0x3e 322f4: 6b 97 sbiw r28, 0x1b ; 27 322f6: 60 90 69 07 lds r6, 0x0769 ; 0x800769 322fa: 70 90 6a 07 lds r7, 0x076A ; 0x80076a 322fe: 80 90 6b 07 lds r8, 0x076B ; 0x80076b 32302: 90 90 6c 07 lds r9, 0x076C ; 0x80076c 32306: 6b 96 adiw r28, 0x1b ; 27 32308: ae ac ldd r10, Y+62 ; 0x3e 3230a: bf ac ldd r11, Y+63 ; 0x3f 3230c: 6b 97 sbiw r28, 0x1b ; 27 3230e: 31 10 cpse r3, r1 32310: 04 c0 rjmp .+8 ; 0x3231a 32312: 69 96 adiw r28, 0x19 ; 25 32314: ae ac ldd r10, Y+62 ; 0x3e 32316: bf ac ldd r11, Y+63 ; 0x3f 32318: 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; 3231a: 80 91 61 07 lds r24, 0x0761 ; 0x800761 3231e: 90 91 62 07 lds r25, 0x0762 ; 0x800762 32322: a0 91 63 07 lds r26, 0x0763 ; 0x800763 32326: b0 91 64 07 lds r27, 0x0764 ; 0x800764 3232a: f5 01 movw r30, r10 3232c: e8 1b sub r30, r24 3232e: f9 0b sbc r31, r25 32330: 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) 32332: 71 f0 breq .+28 ; 0x32350 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)); 32334: af 01 movw r20, r30 32336: f7 ff sbrs r31, 7 32338: 04 c0 rjmp .+8 ; 0x32342 3233a: 44 27 eor r20, r20 3233c: 55 27 eor r21, r21 3233e: 4e 1b sub r20, r30 32340: 5f 0b sbc r21, r31 32342: 69 2f mov r22, r25 32344: 66 1f adc r22, r22 32346: 66 27 eor r22, r22 32348: 66 1f adc r22, r22 3234a: 81 e0 ldi r24, 0x01 ; 1 3234c: 0f 94 96 73 call 0x2e72c ; 0x2e72c // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 32350: 80 91 65 07 lds r24, 0x0765 ; 0x800765 32354: 90 91 66 07 lds r25, 0x0766 ; 0x800766 32358: a0 91 67 07 lds r26, 0x0767 ; 0x800767 3235c: b0 91 68 07 lds r27, 0x0768 ; 0x800768 32360: 2b 96 adiw r28, 0x0b ; 11 32362: 4e ad ldd r20, Y+62 ; 0x3e 32364: 5f ad ldd r21, Y+63 ; 0x3f 32366: 2b 97 sbiw r28, 0x0b ; 11 32368: 48 1b sub r20, r24 3236a: 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)); 3236c: 57 fd sbrc r21, 7 3236e: b2 c0 rjmp .+356 ; 0x324d4 32370: 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) 32372: 41 15 cp r20, r1 32374: 51 05 cpc r21, r1 32376: 09 f0 breq .+2 ; 0x3237a 32378: ae c0 rjmp .+348 ; 0x324d6 // 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; 3237a: 80 91 69 07 lds r24, 0x0769 ; 0x800769 3237e: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32382: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32386: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 3238a: 68 1a sub r6, r24 3238c: 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)); 3238e: 77 fc sbrc r7, 7 32390: ab c0 rjmp .+342 ; 0x324e8 32392: 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) 32394: 61 14 cp r6, r1 32396: 71 04 cpc r7, r1 32398: 09 f0 breq .+2 ; 0x3239c 3239a: a7 c0 rjmp .+334 ; 0x324ea 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); 3239c: 40 91 69 07 lds r20, 0x0769 ; 0x800769 323a0: 50 91 6a 07 lds r21, 0x076A ; 0x80076a 323a4: 60 91 6b 07 lds r22, 0x076B ; 0x80076b 323a8: 70 91 6c 07 lds r23, 0x076C ; 0x80076c 323ac: 00 e0 ldi r16, 0x00 ; 0 323ae: 28 ec ldi r18, 0xC8 ; 200 323b0: 30 e0 ldi r19, 0x00 ; 0 323b2: 2b 96 adiw r28, 0x0b ; 11 323b4: 6e ad ldd r22, Y+62 ; 0x3e 323b6: 7f ad ldd r23, Y+63 ; 0x3f 323b8: 2b 97 sbiw r28, 0x0b ; 11 323ba: c5 01 movw r24, r10 323bc: 0e 94 27 e1 call 0x1c24e ; 0x1c24e sm4_set_dir(X_AXIS, d); 323c0: 63 2d mov r22, r3 323c2: 80 e0 ldi r24, 0x00 ; 0 323c4: 0f 94 f0 69 call 0x2d3e0 ; 0x2d3e0 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 323c8: 5f 92 push r5 323ca: 4f 92 push r4 323cc: 8c e1 ldi r24, 0x1C ; 28 323ce: 96 ea ldi r25, 0xA6 ; 166 323d0: 9f 93 push r25 323d2: 8f 93 push r24 323d4: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 lcd_set_cursor(4,3); 323d8: 63 e0 ldi r22, 0x03 ; 3 323da: 84 e0 ldi r24, 0x04 ; 4 323dc: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 323e0: 5f 92 push r5 323e2: 4f 92 push r4 323e4: 8d e0 ldi r24, 0x0D ; 13 323e6: 96 ea ldi r25, 0xA6 ; 166 323e8: 9f 93 push r25 323ea: 8f 93 push r24 323ec: 0e 94 ff 6f call 0xdffe ; 0xdffe 323f0: 0f b6 in r0, 0x3f ; 63 323f2: f8 94 cli 323f4: de bf out 0x3e, r29 ; 62 323f6: 0f be out 0x3f, r0 ; 63 323f8: cd bf out 0x3d, r28 ; 61 323fa: 21 e0 ldi r18, 0x01 ; 1 323fc: 30 e0 ldi r19, 0x00 ; 0 323fe: 31 10 cpse r3, r1 32400: 02 c0 rjmp .+4 ; 0x32406 32402: 2f ef ldi r18, 0xFF ; 255 32404: 3f ef ldi r19, 0xFF ; 255 32406: 40 ec ldi r20, 0xC0 ; 192 32408: 42 03 mulsu r20, r18 3240a: c0 01 movw r24, r0 3240c: 43 9f mul r20, r19 3240e: 90 0d add r25, r0 32410: 11 24 eor r1, r1 32412: 67 96 adiw r28, 0x17 ; 23 32414: 9f af std Y+63, r25 ; 0x3f 32416: 8e af std Y+62, r24 ; 0x3e 32418: 67 97 sbiw r28, 0x17 ; 23 3241a: 40 ee ldi r20, 0xE0 ; 224 3241c: 53 e0 ldi r21, 0x03 ; 3 3241e: 24 9f mul r18, r20 32420: 40 01 movw r8, r0 32422: 25 9f mul r18, r21 32424: 90 0c add r9, r0 32426: 34 9f mul r19, r20 32428: 90 0c add r9, r0 3242a: 11 24 eor r1, r1 3242c: 63 96 adiw r28, 0x13 ; 19 3242e: ee ad ldd r30, Y+62 ; 0x3e 32430: ff ad ldd r31, Y+63 ; 0x3f 32432: 63 97 sbiw r28, 0x13 ; 19 32434: 8e 0e add r8, r30 32436: 9f 1e adc r9, r31 32438: 9e 01 movw r18, r28 3243a: 2f 5f subi r18, 0xFF ; 255 3243c: 3f 4f sbci r19, 0xFF ; 255 3243e: 2d 96 adiw r28, 0x0d ; 13 32440: 3f af std Y+63, r19 ; 0x3f 32442: 2e af std Y+62, r18 ; 0x3e 32444: 2d 97 sbiw r28, 0x0d ; 13 32446: 61 96 adiw r28, 0x11 ; 17 32448: 8e ad ldd r24, Y+62 ; 0x3e 3244a: 9f ad ldd r25, Y+63 ; 0x3f 3244c: 61 97 sbiw r28, 0x11 ; 17 3244e: 2f 96 adiw r28, 0x0f ; 15 32450: 9f af std Y+63, r25 ; 0x3f 32452: 8e af std Y+62, r24 ; 0x3e 32454: 2f 97 sbiw r28, 0x0f ; 15 32456: 71 2c mov r7, r1 32458: 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; 3245a: e0 e1 ldi r30, 0x10 ; 16 3245c: f7 e2 ldi r31, 0x27 ; 39 3245e: 27 96 adiw r28, 0x07 ; 7 32460: ff af std Y+63, r31 ; 0x3f 32462: ee af std Y+62, r30 ; 0x3e 32464: 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); 32466: 80 91 61 07 lds r24, 0x0761 ; 0x800761 3246a: 90 91 62 07 lds r25, 0x0762 ; 0x800762 3246e: a0 91 63 07 lds r26, 0x0763 ; 0x800763 32472: b0 91 64 07 lds r27, 0x0764 ; 0x800764 32476: 84 01 movw r16, r8 32478: 08 1b sub r16, r24 3247a: 19 0b sbc r17, r25 3247c: 17 ff sbrs r17, 7 3247e: 03 c0 rjmp .+6 ; 0x32486 32480: 11 95 neg r17 32482: 01 95 neg r16 32484: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 32486: 98 01 movw r18, r16 32488: 35 95 asr r19 3248a: 27 95 ror r18 3248c: 65 96 adiw r28, 0x15 ; 21 3248e: 3f af std Y+63, r19 ; 0x3f 32490: 2e af std Y+62, r18 ; 0x3e 32492: 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; 32494: 1c 9b sbis 0x03, 4 ; 3 32496: 33 c0 rjmp .+102 ; 0x324fe 32498: 45 e0 ldi r20, 0x05 ; 5 3249a: 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); 3249c: 65 96 adiw r28, 0x15 ; 21 3249e: ae ac ldd r10, Y+62 ; 0x3e 324a0: bf ac ldd r11, Y+63 ; 0x3f 324a2: 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); 324a4: 63 2d mov r22, r3 324a6: 82 2d mov r24, r2 324a8: 0e 94 ce e0 call 0x1c19c ; 0x1c19c while (steps--){ 324ac: 31 e0 ldi r19, 0x01 ; 1 324ae: a3 1a sub r10, r19 324b0: b1 08 sbc r11, r1 324b2: 40 f1 brcs .+80 ; 0x32504 accelerate_1_step(axes, acc, delay_us, min_delay_us); 324b4: 28 ec ldi r18, 0xC8 ; 200 324b6: 30 e0 ldi r19, 0x00 ; 0 324b8: a7 01 movw r20, r14 324ba: 68 ee ldi r22, 0xE8 ; 232 324bc: 73 e0 ldi r23, 0x03 ; 3 324be: 82 2d mov r24, r2 324c0: 0e 94 9f df call 0x1bf3e ; 0x1bf3e update_position_1_step(axes, dir); 324c4: 63 2d mov r22, r3 324c6: 82 2d mov r24, r2 324c8: 0e 94 e7 e0 call 0x1c1ce ; 0x1c1ce 324cc: ef cf rjmp .-34 ; 0x324ac 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){ 324ce: 33 24 eor r3, r3 324d0: 33 94 inc r3 324d2: 11 cf rjmp .-478 ; 0x322f6 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)); 324d4: 62 e0 ldi r22, 0x02 ; 2 324d6: 57 ff sbrs r21, 7 324d8: 03 c0 rjmp .+6 ; 0x324e0 324da: 51 95 neg r21 324dc: 41 95 neg r20 324de: 51 09 sbc r21, r1 324e0: 82 e0 ldi r24, 0x02 ; 2 324e2: 0f 94 96 73 call 0x2e72c ; 0x2e72c 324e6: 49 cf rjmp .-366 ; 0x3237a // 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)); 324e8: 64 e0 ldi r22, 0x04 ; 4 324ea: a3 01 movw r20, r6 324ec: 77 fe sbrs r7, 7 324ee: 03 c0 rjmp .+6 ; 0x324f6 324f0: 51 95 neg r21 324f2: 41 95 neg r20 324f4: 51 09 sbc r21, r1 324f6: 84 e0 ldi r24, 0x04 ; 4 324f8: 0f 94 96 73 call 0x2e72c ; 0x2e72c 324fc: 4f cf rjmp .-354 ; 0x3239c 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; 324fe: 22 24 eor r2, r2 32500: 23 94 inc r2 32502: cc cf rjmp .-104 ; 0x3249c 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); 32504: 65 96 adiw r28, 0x15 ; 21 32506: ee ad ldd r30, Y+62 ; 0x3e 32508: ff ad ldd r31, Y+63 ; 0x3f 3250a: 65 97 sbiw r28, 0x15 ; 21 3250c: 0e 1b sub r16, r30 3250e: 1f 0b sbc r17, r31 32510: 23 96 adiw r28, 0x03 ; 3 32512: 1f af std Y+63, r17 ; 0x3f 32514: 0e af std Y+62, r16 ; 0x3e 32516: 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); 32518: 63 2d mov r22, r3 3251a: 82 2d mov r24, r2 3251c: 0e 94 ce e0 call 0x1c19c ; 0x1c19c while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 32520: 9e 01 movw r18, r28 32522: 2f 5b subi r18, 0xBF ; 191 32524: 3f 4f sbci r19, 0xFF ; 255 32526: a7 01 movw r20, r14 32528: 68 ee ldi r22, 0xE8 ; 232 3252a: 73 e0 ldi r23, 0x03 ; 3 3252c: 82 2d mov r24, r2 3252e: 0e 94 45 e0 call 0x1c08a ; 0x1c08a 32532: 88 23 and r24, r24 32534: 29 f0 breq .+10 ; 0x32540 update_position_1_step(axes, dir); 32536: 63 2d mov r22, r3 32538: 82 2d mov r24, r2 3253a: 0e 94 e7 e0 call 0x1c1ce ; 0x1c1ce 3253e: f0 cf rjmp .-32 ; 0x32520 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 32540: 60 e0 ldi r22, 0x00 ; 0 32542: 82 e0 ldi r24, 0x02 ; 2 32544: 0f 94 f0 69 call 0x2d3e0 ; 0x2d3e0 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 32548: 20 e1 ldi r18, 0x10 ; 16 3254a: 37 e2 ldi r19, 0x27 ; 39 3254c: 27 96 adiw r28, 0x07 ; 7 3254e: 3f af std Y+63, r19 ; 0x3f 32550: 2e af std Y+62, r18 ; 0x3e 32552: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 32554: 00 91 69 07 lds r16, 0x0769 ; 0x800769 32558: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 3255c: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 32560: 30 91 6c 07 lds r19, 0x076C ; 0x80076c 32564: 00 5a subi r16, 0xA0 ; 160 32566: 16 4f sbci r17, 0xF6 ; 246 32568: 17 ff sbrs r17, 7 3256a: 02 c0 rjmp .+4 ; 0x32570 3256c: 0f 5f subi r16, 0xFF ; 255 3256e: 1f 4f sbci r17, 0xFF ; 255 32570: 15 95 asr r17 32572: 07 95 ror r16 32574: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32578: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 3257c: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32580: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32584: 80 17 cp r24, r16 32586: 91 07 cpc r25, r17 32588: f4 f4 brge .+60 ; 0x325c6 if (!_PINDA){ 3258a: 1c 9b sbis 0x03, 4 ; 3 3258c: 1c c0 rjmp .+56 ; 0x325c6 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 3258e: 28 ec ldi r18, 0xC8 ; 200 32590: 30 e0 ldi r19, 0x00 ; 0 32592: a7 01 movw r20, r14 32594: 68 ee ldi r22, 0xE8 ; 232 32596: 73 e0 ldi r23, 0x03 ; 3 32598: 84 e0 ldi r24, 0x04 ; 4 3259a: 0e 94 9f df call 0x1bf3e ; 0x1bf3e /// 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_){ 3259e: 80 91 69 07 lds r24, 0x0769 ; 0x800769 325a2: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 325a6: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 325aa: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 325ae: 01 96 adiw r24, 0x01 ; 1 325b0: a1 1d adc r26, r1 325b2: b1 1d adc r27, r1 325b4: 80 93 69 07 sts 0x0769, r24 ; 0x800769 325b8: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 325bc: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 325c0: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 325c4: d7 cf rjmp .-82 ; 0x32574 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 325c6: 1c 9b sbis 0x03, 4 ; 3 325c8: 3f c0 rjmp .+126 ; 0x32648 steps_to_go = MAX(0, max_z - _Z); 325ca: 80 91 69 07 lds r24, 0x0769 ; 0x800769 325ce: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 325d2: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 325d6: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 325da: e0 e6 ldi r30, 0x60 ; 96 325dc: f9 e0 ldi r31, 0x09 ; 9 325de: e8 1b sub r30, r24 325e0: f9 0b sbc r31, r25 325e2: cf 01 movw r24, r30 325e4: f7 ff sbrs r31, 7 325e6: 02 c0 rjmp .+4 ; 0x325ec 325e8: 90 e0 ldi r25, 0x00 ; 0 325ea: 80 e0 ldi r24, 0x00 ; 0 325ec: 25 96 adiw r28, 0x05 ; 5 325ee: 9f af std Y+63, r25 ; 0x3f 325f0: 8e af std Y+62, r24 ; 0x3e 325f2: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 325f4: 1c 9b sbis 0x03, 4 ; 3 325f6: 28 c0 rjmp .+80 ; 0x32648 325f8: 80 91 69 07 lds r24, 0x0769 ; 0x800769 325fc: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32600: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32604: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32608: 80 36 cpi r24, 0x60 ; 96 3260a: 99 40 sbci r25, 0x09 ; 9 3260c: ec f4 brge .+58 ; 0x32648 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 3260e: 9e 01 movw r18, r28 32610: 2d 5b subi r18, 0xBD ; 189 32612: 3f 4f sbci r19, 0xFF ; 255 32614: a7 01 movw r20, r14 32616: 68 ee ldi r22, 0xE8 ; 232 32618: 73 e0 ldi r23, 0x03 ; 3 3261a: 84 e0 ldi r24, 0x04 ; 4 3261c: 0e 94 45 e0 call 0x1c08a ; 0x1c08a ++_Z_; 32620: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32624: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32628: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 3262c: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32630: 01 96 adiw r24, 0x01 ; 1 32632: a1 1d adc r26, r1 32634: b1 1d adc r27, r1 32636: 80 93 69 07 sts 0x0769, r24 ; 0x800769 3263a: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 3263e: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 32642: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 32646: d6 cf rjmp .-84 ; 0x325f4 /// \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); 32648: 60 e0 ldi r22, 0x00 ; 0 3264a: 84 e0 ldi r24, 0x04 ; 4 3264c: 0e 94 ce e0 call 0x1c19c ; 0x1c19c while (delay_us < MAX_DELAY){ 32650: f7 01 movw r30, r14 32652: 20 81 ld r18, Z 32654: 31 81 ldd r19, Z+1 ; 0x01 32656: 20 31 cpi r18, 0x10 ; 16 32658: f7 e2 ldi r31, 0x27 ; 39 3265a: 3f 07 cpc r19, r31 3265c: 58 f4 brcc .+22 ; 0x32674 accelerate_1_step(axes, -dec, delay_us, delay_us); 3265e: a7 01 movw r20, r14 32660: 68 e1 ldi r22, 0x18 ; 24 32662: 7c ef ldi r23, 0xFC ; 252 32664: 84 e0 ldi r24, 0x04 ; 4 32666: 0e 94 9f df call 0x1bf3e ; 0x1bf3e update_position_1_step(axes, dir); 3266a: 60 e0 ldi r22, 0x00 ; 0 3266c: 84 e0 ldi r24, 0x04 ; 4 3266e: 0e 94 e7 e0 call 0x1c1ce ; 0x1c1ce 32672: ee cf rjmp .-36 ; 0x32650 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 32674: 61 e0 ldi r22, 0x01 ; 1 32676: 82 e0 ldi r24, 0x02 ; 2 32678: 0f 94 f0 69 call 0x2d3e0 ; 0x2d3e0 /// speed up current_delay_us = MAX_DELAY; 3267c: 20 e1 ldi r18, 0x10 ; 16 3267e: 37 e2 ldi r19, 0x27 ; 39 32680: f7 01 movw r30, r14 32682: 31 83 std Z+1, r19 ; 0x01 32684: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 32686: 00 91 69 07 lds r16, 0x0769 ; 0x800769 3268a: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 3268e: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 32692: 30 91 6c 07 lds r19, 0x076C ; 0x80076c 32696: 0c 0d add r16, r12 32698: 1d 1d adc r17, r13 3269a: 17 ff sbrs r17, 7 3269c: 02 c0 rjmp .+4 ; 0x326a2 3269e: 0f 5f subi r16, 0xFF ; 255 326a0: 1f 4f sbci r17, 0xFF ; 255 326a2: 15 95 asr r17 326a4: 07 95 ror r16 326a6: 80 91 69 07 lds r24, 0x0769 ; 0x800769 326aa: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 326ae: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 326b2: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 326b6: 08 17 cp r16, r24 326b8: 19 07 cpc r17, r25 326ba: 0c f0 brlt .+2 ; 0x326be 326bc: d9 c0 rjmp .+434 ; 0x32870 if (_PINDA){ 326be: 1c 9b sbis 0x03, 4 ; 3 326c0: bb c0 rjmp .+374 ; 0x32838 z_trig = _Z; 326c2: 00 91 69 07 lds r16, 0x0769 ; 0x800769 326c6: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 326ca: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 326ce: 30 91 6c 07 lds r19, 0x076C ; 0x80076c break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 326d2: 1c 99 sbic 0x03, 4 ; 3 326d4: 28 c0 rjmp .+80 ; 0x32726 steps_to_go = MAX(0, _Z - min_z); 326d6: 80 91 69 07 lds r24, 0x0769 ; 0x800769 326da: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 326de: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 326e2: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 326e6: 8c 19 sub r24, r12 326e8: 9d 09 sbc r25, r13 326ea: 97 ff sbrs r25, 7 326ec: 02 c0 rjmp .+4 ; 0x326f2 326ee: 90 e0 ldi r25, 0x00 ; 0 326f0: 80 e0 ldi r24, 0x00 ; 0 326f2: 25 96 adiw r28, 0x05 ; 5 326f4: 9f af std Y+63, r25 ; 0x3f 326f6: 8e af std Y+62, r24 ; 0x3e 326f8: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 326fa: 1c 99 sbic 0x03, 4 ; 3 326fc: 0c c0 rjmp .+24 ; 0x32716 326fe: 80 91 69 07 lds r24, 0x0769 ; 0x800769 32702: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32706: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 3270a: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 3270e: c8 16 cp r12, r24 32710: d9 06 cpc r13, r25 32712: 0c f4 brge .+2 ; 0x32716 32714: af c0 rjmp .+350 ; 0x32874 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 32716: 00 91 69 07 lds r16, 0x0769 ; 0x800769 3271a: 10 91 6a 07 lds r17, 0x076A ; 0x80076a 3271e: 20 91 6b 07 lds r18, 0x076B ; 0x80076b 32722: 30 91 6c 07 lds r19, 0x076C ; 0x80076c } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 32726: 80 91 69 07 lds r24, 0x0769 ; 0x800769 3272a: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 3272e: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32732: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32736: c8 16 cp r12, r24 32738: d9 06 cpc r13, r25 3273a: 3c f4 brge .+14 ; 0x3274a 3273c: f7 01 movw r30, r14 3273e: 80 81 ld r24, Z 32740: 91 81 ldd r25, Z+1 ; 0x01 32742: 80 31 cpi r24, 0x10 ; 16 32744: 97 42 sbci r25, 0x27 ; 39 32746: 08 f4 brcc .+2 ; 0x3274a 32748: b2 c0 rjmp .+356 ; 0x328ae 3274a: 0c 19 sub r16, r12 3274c: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 3274e: 31 10 cpse r3, r1 32750: ca c0 rjmp .+404 ; 0x328e6 line_buffer[c] = (uint16_t)(z_trig - min_z); 32752: f3 01 movw r30, r6 32754: ee 0f add r30, r30 32756: ff 1f adc r31, r31 32758: 21 e0 ldi r18, 0x01 ; 1 3275a: 30 e0 ldi r19, 0x00 ; 0 3275c: 2c 0f add r18, r28 3275e: 3d 1f adc r19, r29 32760: e2 0f add r30, r18 32762: f3 1f adc r31, r19 32764: 11 83 std Z+1, r17 ; 0x01 32766: 00 83 st Z, r16 32768: ff ef ldi r31, 0xFF ; 255 3276a: 6f 1a sub r6, r31 3276c: 7f 0a sbc r7, r31 3276e: 67 96 adiw r28, 0x17 ; 23 32770: 2e ad ldd r18, Y+62 ; 0x3e 32772: 3f ad ldd r19, Y+63 ; 0x3f 32774: 67 97 sbiw r28, 0x17 ; 23 32776: 82 0e add r8, r18 32778: 93 1e adc r9, r19 3277a: 2d 96 adiw r28, 0x0d ; 13 3277c: 8e ad ldd r24, Y+62 ; 0x3e 3277e: 9f ad ldd r25, Y+63 ; 0x3f 32780: 2d 97 sbiw r28, 0x0d ; 13 32782: 02 97 sbiw r24, 0x02 ; 2 32784: 2d 96 adiw r28, 0x0d ; 13 32786: 9f af std Y+63, r25 ; 0x3f 32788: 8e af std Y+62, r24 ; 0x3e 3278a: 2d 97 sbiw r28, 0x0d ; 13 3278c: 2f 96 adiw r28, 0x0f ; 15 3278e: ee ad ldd r30, Y+62 ; 0x3e 32790: ff ad ldd r31, Y+63 ; 0x3f 32792: 2f 97 sbiw r28, 0x0f ; 15 32794: 31 97 sbiw r30, 0x01 ; 1 32796: 2f 96 adiw r28, 0x0f ; 15 32798: ff af std Y+63, r31 ; 0x3f 3279a: ee af std Y+62, r30 ; 0x3e 3279c: 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 3279e: f0 e2 ldi r31, 0x20 ; 32 327a0: 6f 16 cp r6, r31 327a2: 71 04 cpc r7, r1 327a4: 09 f0 breq .+2 ; 0x327a8 327a6: 59 ce rjmp .-846 ; 0x3245a 327a8: 21 e0 ldi r18, 0x01 ; 1 327aa: 42 1a sub r4, r18 327ac: 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){ 327ae: 31 e0 ldi r19, 0x01 ; 1 327b0: 33 12 cpse r3, r19 327b2: 8d ce rjmp .-742 ; 0x324ce 327b4: 61 96 adiw r28, 0x11 ; 17 327b6: 8e ad ldd r24, Y+62 ; 0x3e 327b8: 9f ad ldd r25, Y+63 ; 0x3f 327ba: 61 97 sbiw r28, 0x11 ; 17 327bc: 80 96 adiw r24, 0x20 ; 32 327be: 61 96 adiw r28, 0x11 ; 17 327c0: 9f af std Y+63, r25 ; 0x3f 327c2: 8e af std Y+62, r24 ; 0x3e 327c4: 61 97 sbiw r28, 0x11 ; 17 327c6: 2b 96 adiw r28, 0x0b ; 11 327c8: ee ad ldd r30, Y+62 ; 0x3e 327ca: ff ad ldd r31, Y+63 ; 0x3f 327cc: 2b 97 sbiw r28, 0x0b ; 11 327ce: e0 5c subi r30, 0xC0 ; 192 327d0: ff 4f sbci r31, 0xFF ; 255 327d2: 2b 96 adiw r28, 0x0b ; 11 327d4: ff af std Y+63, r31 ; 0x3f 327d6: ee af std Y+62, r30 ; 0x3e 327d8: 2b 97 sbiw r28, 0x0b ; 11 327da: 29 96 adiw r28, 0x09 ; 9 327dc: 2e ad ldd r18, Y+62 ; 0x3e 327de: 3f ad ldd r19, Y+63 ; 0x3f 327e0: 29 97 sbiw r28, 0x09 ; 9 327e2: 22 50 subi r18, 0x02 ; 2 327e4: 31 09 sbc r19, r1 327e6: 29 96 adiw r28, 0x09 ; 9 327e8: 3f af std Y+63, r19 ; 0x3f 327ea: 2e af std Y+62, r18 ; 0x3e 327ec: 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 327ee: 23 2b or r18, r19 327f0: 09 f0 breq .+2 ; 0x327f4 327f2: 72 cd rjmp .-1308 ; 0x322d8 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); 327f4: 8b e0 ldi r24, 0x0B ; 11 327f6: 96 ea ldi r25, 0xA6 ; 166 327f8: 9f 93 push r25 327fa: 8f 93 push r24 327fc: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 32800: 0f 90 pop r0 32802: 0f 90 pop r0 } 32804: c6 5a subi r28, 0xA6 ; 166 32806: df 4f sbci r29, 0xFF ; 255 32808: 0f b6 in r0, 0x3f ; 63 3280a: f8 94 cli 3280c: de bf out 0x3e, r29 ; 62 3280e: 0f be out 0x3f, r0 ; 63 32810: cd bf out 0x3d, r28 ; 61 32812: df 91 pop r29 32814: cf 91 pop r28 32816: 1f 91 pop r17 32818: 0f 91 pop r16 3281a: ff 90 pop r15 3281c: ef 90 pop r14 3281e: df 90 pop r13 32820: cf 90 pop r12 32822: bf 90 pop r11 32824: af 90 pop r10 32826: 9f 90 pop r9 32828: 8f 90 pop r8 3282a: 7f 90 pop r7 3282c: 6f 90 pop r6 3282e: 5f 90 pop r5 32830: 4f 90 pop r4 32832: 3f 90 pop r3 32834: 2f 90 pop r2 32836: 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); 32838: 28 ec ldi r18, 0xC8 ; 200 3283a: 30 e0 ldi r19, 0x00 ; 0 3283c: a7 01 movw r20, r14 3283e: 68 ee ldi r22, 0xE8 ; 232 32840: 73 e0 ldi r23, 0x03 ; 3 32842: 84 e0 ldi r24, 0x04 ; 4 32844: 0e 94 9f df call 0x1bf3e ; 0x1bf3e /// 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_){ 32848: 80 91 69 07 lds r24, 0x0769 ; 0x800769 3284c: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 32850: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32854: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32858: 01 97 sbiw r24, 0x01 ; 1 3285a: a1 09 sbc r26, r1 3285c: b1 09 sbc r27, r1 3285e: 80 93 69 07 sts 0x0769, r24 ; 0x800769 32862: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 32866: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 3286a: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 3286e: 1b cf rjmp .-458 ; 0x326a6 32870: 86 01 movw r16, r12 32872: 2f cf rjmp .-418 ; 0x326d2 } /// 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); 32874: 9e 01 movw r18, r28 32876: 2d 5b subi r18, 0xBD ; 189 32878: 3f 4f sbci r19, 0xFF ; 255 3287a: a7 01 movw r20, r14 3287c: 68 ee ldi r22, 0xE8 ; 232 3287e: 73 e0 ldi r23, 0x03 ; 3 32880: 84 e0 ldi r24, 0x04 ; 4 32882: 0e 94 45 e0 call 0x1c08a ; 0x1c08a --_Z_; 32886: 80 91 69 07 lds r24, 0x0769 ; 0x800769 3288a: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 3288e: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 32892: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 32896: 01 97 sbiw r24, 0x01 ; 1 32898: a1 09 sbc r26, r1 3289a: b1 09 sbc r27, r1 3289c: 80 93 69 07 sts 0x0769, r24 ; 0x800769 328a0: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 328a4: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 328a8: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 328ac: 26 cf rjmp .-436 ; 0x326fa } 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); 328ae: 28 ec ldi r18, 0xC8 ; 200 328b0: 30 e0 ldi r19, 0x00 ; 0 328b2: a7 01 movw r20, r14 328b4: 68 e1 ldi r22, 0x18 ; 24 328b6: 7c ef ldi r23, 0xFC ; 252 328b8: 84 e0 ldi r24, 0x04 ; 4 328ba: 0e 94 9f df call 0x1bf3e ; 0x1bf3e --_Z_; 328be: 80 91 69 07 lds r24, 0x0769 ; 0x800769 328c2: 90 91 6a 07 lds r25, 0x076A ; 0x80076a 328c6: a0 91 6b 07 lds r26, 0x076B ; 0x80076b 328ca: b0 91 6c 07 lds r27, 0x076C ; 0x80076c 328ce: 01 97 sbiw r24, 0x01 ; 1 328d0: a1 09 sbc r26, r1 328d2: b1 09 sbc r27, r1 328d4: 80 93 69 07 sts 0x0769, r24 ; 0x800769 328d8: 90 93 6a 07 sts 0x076A, r25 ; 0x80076a 328dc: a0 93 6b 07 sts 0x076B, r26 ; 0x80076b 328e0: b0 93 6c 07 sts 0x076C, r27 ; 0x80076c 328e4: 20 cf rjmp .-448 ; 0x32726 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); 328e6: 2d 96 adiw r28, 0x0d ; 13 328e8: ee ad ldd r30, Y+62 ; 0x3e 328ea: ff ad ldd r31, Y+63 ; 0x3f 328ec: 2d 97 sbiw r28, 0x0d ; 13 328ee: 86 ad ldd r24, Z+62 ; 0x3e 328f0: 97 ad ldd r25, Z+63 ; 0x3f 328f2: 01 2e mov r0, r17 328f4: 00 0c add r0, r0 328f6: 22 0b sbc r18, r18 328f8: 33 0b sbc r19, r19 328fa: 08 0f add r16, r24 328fc: 19 1f adc r17, r25 328fe: 21 1d adc r18, r1 32900: 31 1d adc r19, r1 32902: 36 95 lsr r19 32904: 27 95 ror r18 32906: 17 95 ror r17 32908: 07 95 ror r16 3290a: 0f 3f cpi r16, 0xFF ; 255 3290c: 11 05 cpc r17, r1 3290e: 21 05 cpc r18, r1 32910: 31 05 cpc r19, r1 32912: 29 f0 breq .+10 ; 0x3291e 32914: 20 f0 brcs .+8 ; 0x3291e 32916: 0f ef ldi r16, 0xFF ; 255 32918: 10 e0 ldi r17, 0x00 ; 0 3291a: 20 e0 ldi r18, 0x00 ; 0 3291c: 30 e0 ldi r19, 0x00 ; 0 3291e: 2f 96 adiw r28, 0x0f ; 15 32920: ee ad ldd r30, Y+62 ; 0x3e 32922: ff ad ldd r31, Y+63 ; 0x3f 32924: 2f 97 sbiw r28, 0x0f ; 15 32926: 07 8f std Z+31, r16 ; 0x1f 32928: 1f cf rjmp .-450 ; 0x32768 0003292a : /// 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) 3292a: 2f 92 push r2 3292c: 3f 92 push r3 3292e: 4f 92 push r4 32930: 5f 92 push r5 32932: 6f 92 push r6 32934: 7f 92 push r7 32936: 8f 92 push r8 32938: 9f 92 push r9 3293a: af 92 push r10 3293c: bf 92 push r11 3293e: cf 92 push r12 32940: df 92 push r13 32942: ef 92 push r14 32944: ff 92 push r15 32946: 0f 93 push r16 32948: 1f 93 push r17 3294a: cf 93 push r28 3294c: df 93 push r29 3294e: cd b7 in r28, 0x3d ; 61 32950: de b7 in r29, 0x3e ; 62 32952: 6c 97 sbiw r28, 0x1c ; 28 32954: 0f b6 in r0, 0x3f ; 63 32956: f8 94 cli 32958: de bf out 0x3e, r29 ; 62 3295a: 0f be out 0x3f, r0 ; 63 3295c: cd bf out 0x3d, r28 ; 61 3295e: 6c 01 movw r12, r24 32960: 5b 01 movw r10, r22 32962: 4a 01 movw r8, r20 32964: 19 01 movw r2, r18 32966: 18 87 std Y+8, r17 ; 0x08 32968: 0f 83 std Y+7, r16 ; 0x07 3296a: fa 82 std Y+2, r15 ; 0x02 3296c: 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; 3296e: d7 01 movw r26, r14 32970: 8d 91 ld r24, X+ 32972: 9c 91 ld r25, X 32974: 60 ed ldi r22, 0xD0 ; 208 32976: 72 e0 ldi r23, 0x02 ; 2 32978: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 3297c: 9c 8f std Y+28, r25 ; 0x1c 3297e: 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); 32980: 9f 93 push r25 32982: 8f 93 push r24 32984: 3f 92 push r3 32986: 2f 93 push r18 32988: 1f 92 push r1 3298a: 84 e6 ldi r24, 0x64 ; 100 3298c: 8f 93 push r24 3298e: 9f 92 push r9 32990: 8f 92 push r8 32992: bf 92 push r11 32994: af 92 push r10 32996: df 92 push r13 32998: cf 92 push r12 3299a: 83 ed ldi r24, 0xD3 ; 211 3299c: 95 ea ldi r25, 0xA5 ; 165 3299e: 9f 93 push r25 329a0: 8f 93 push r24 329a2: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 329a6: 0f b6 in r0, 0x3f ; 63 329a8: f8 94 cli 329aa: de bf out 0x3e, r29 ; 62 329ac: 0f be out 0x3f, r0 ; 63 329ae: 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; 329b0: 22 27 eor r18, r18 329b2: 33 27 eor r19, r19 329b4: 22 19 sub r18, r2 329b6: 33 09 sbc r19, r3 329b8: 3a 8f std Y+26, r19 ; 0x1a 329ba: 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)); 329bc: c4 01 movw r24, r8 329be: 99 0c add r9, r9 329c0: aa 0b sbc r26, r26 329c2: bb 0b sbc r27, r27 329c4: 89 87 std Y+9, r24 ; 0x09 329c6: 9a 87 std Y+10, r25 ; 0x0a 329c8: ab 87 std Y+11, r26 ; 0x0b 329ca: 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)); 329cc: 95 01 movw r18, r10 329ce: bb 0c add r11, r11 329d0: 44 0b sbc r20, r20 329d2: 55 0b sbc r21, r21 329d4: 29 8b std Y+17, r18 ; 0x11 329d6: 3a 8b std Y+18, r19 ; 0x12 329d8: 4b 8b std Y+19, r20 ; 0x13 329da: 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)); 329dc: c6 01 movw r24, r12 329de: dd 0c add r13, r13 329e0: aa 0b sbc r26, r26 329e2: bb 0b sbc r27, r27 329e4: 8d 8b std Y+21, r24 ; 0x15 329e6: 9e 8b std Y+22, r25 ; 0x16 329e8: af 8b std Y+23, r26 ; 0x17 329ea: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 329ec: 12 14 cp r1, r2 329ee: 13 04 cpc r1, r3 329f0: 0c f0 brlt .+2 ; 0x329f4 329f2: ba c0 rjmp .+372 ; 0x32b68 { dad = dad_max - (ad / k); 329f4: 8b 8d ldd r24, Y+27 ; 0x1b 329f6: 9c 8d ldd r25, Y+28 ; 0x1c 329f8: 6c e3 ldi r22, 0x3C ; 60 329fa: 70 e0 ldi r23, 0x00 ; 0 329fc: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 32a00: 10 e1 ldi r17, 0x10 ; 16 32a02: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 32a04: 2b 8d ldd r18, Y+27 ; 0x1b 32a06: 3c 8d ldd r19, Y+28 ; 0x1c 32a08: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32a0a: 0f 94 2f de call 0x3bc5e ; 0x3bc5e <__usmulhisi3> 32a0e: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 32a12: 20 e0 ldi r18, 0x00 ; 0 32a14: 30 e0 ldi r19, 0x00 ; 0 32a16: 44 e3 ldi r20, 0x34 ; 52 32a18: 54 e4 ldi r21, 0x44 ; 68 32a1a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 32a1e: 6b 01 movw r12, r22 32a20: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 32a22: 6f 81 ldd r22, Y+7 ; 0x07 32a24: 78 85 ldd r23, Y+8 ; 0x08 32a26: eb 8d ldd r30, Y+27 ; 0x1b 32a28: fc 8d ldd r31, Y+28 ; 0x1c 32a2a: 6e 0f add r22, r30 32a2c: 7f 1f adc r23, r31 32a2e: 90 e0 ldi r25, 0x00 ; 0 32a30: 80 e0 ldi r24, 0x00 ; 0 32a32: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 32a36: 25 e3 ldi r18, 0x35 ; 53 32a38: 3a ef ldi r19, 0xFA ; 250 32a3a: 4e e8 ldi r20, 0x8E ; 142 32a3c: 5c e3 ldi r21, 0x3C ; 60 32a3e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32a42: 4b 01 movw r8, r22 32a44: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 32a46: 0f 94 31 df call 0x3be62 ; 0x3be62 32a4a: 6b 83 std Y+3, r22 ; 0x03 32a4c: 7c 83 std Y+4, r23 ; 0x04 32a4e: 8d 83 std Y+5, r24 ; 0x05 32a50: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 32a52: c5 01 movw r24, r10 32a54: b4 01 movw r22, r8 32a56: 0f 94 f7 e1 call 0x3c3ee ; 0x3c3ee 32a5a: 2b 01 movw r4, r22 32a5c: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 32a5e: 69 85 ldd r22, Y+9 ; 0x09 32a60: 7a 85 ldd r23, Y+10 ; 0x0a 32a62: 8b 85 ldd r24, Y+11 ; 0x0b 32a64: 9c 85 ldd r25, Y+12 ; 0x0c 32a66: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 32a6a: 4b 01 movw r8, r22 32a6c: 5c 01 movw r10, r24 32a6e: 2b 8d ldd r18, Y+27 ; 0x1b 32a70: 3c 8d ldd r19, Y+28 ; 0x1c 32a72: a4 e6 ldi r26, 0x64 ; 100 32a74: b0 e0 ldi r27, 0x00 ; 0 32a76: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 32a7a: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 32a7e: 20 e0 ldi r18, 0x00 ; 0 32a80: 30 e0 ldi r19, 0x00 ; 0 32a82: 44 e3 ldi r20, 0x34 ; 52 32a84: 54 e4 ldi r21, 0x44 ; 68 32a86: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 32a8a: 9b 01 movw r18, r22 32a8c: ac 01 movw r20, r24 32a8e: c5 01 movw r24, r10 32a90: b4 01 movw r22, r8 32a92: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 32a96: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 32a9a: 6d 87 std Y+13, r22 ; 0x0d 32a9c: 7e 87 std Y+14, r23 ; 0x0e 32a9e: 8f 87 std Y+15, r24 ; 0x0f 32aa0: 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)); 32aa2: 69 89 ldd r22, Y+17 ; 0x11 32aa4: 7a 89 ldd r23, Y+18 ; 0x12 32aa6: 8b 89 ldd r24, Y+19 ; 0x13 32aa8: 9c 89 ldd r25, Y+20 ; 0x14 32aaa: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 32aae: 4b 01 movw r8, r22 32ab0: 5c 01 movw r10, r24 32ab2: a3 01 movw r20, r6 32ab4: 92 01 movw r18, r4 32ab6: c7 01 movw r24, r14 32ab8: b6 01 movw r22, r12 32aba: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32abe: 9b 01 movw r18, r22 32ac0: ac 01 movw r20, r24 32ac2: c5 01 movw r24, r10 32ac4: b4 01 movw r22, r8 32ac6: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 32aca: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 32ace: 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)); 32ad0: 6d 89 ldd r22, Y+21 ; 0x15 32ad2: 7e 89 ldd r23, Y+22 ; 0x16 32ad4: 8f 89 ldd r24, Y+23 ; 0x17 32ad6: 98 8d ldd r25, Y+24 ; 0x18 32ad8: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 32adc: 2b 01 movw r4, r22 32ade: 3c 01 movw r6, r24 32ae0: a7 01 movw r20, r14 32ae2: 96 01 movw r18, r12 32ae4: 6b 81 ldd r22, Y+3 ; 0x03 32ae6: 7c 81 ldd r23, Y+4 ; 0x04 32ae8: 8d 81 ldd r24, Y+5 ; 0x05 32aea: 9e 81 ldd r25, Y+6 ; 0x06 32aec: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32af0: 9b 01 movw r18, r22 32af2: ac 01 movw r20, r24 32af4: c3 01 movw r24, r6 32af6: b2 01 movw r22, r4 32af8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 32afc: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 32b00: 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)) 32b02: 01 e0 ldi r16, 0x01 ; 1 32b04: 20 e4 ldi r18, 0x40 ; 64 32b06: 31 e0 ldi r19, 0x01 ; 1 32b08: 4d 85 ldd r20, Y+13 ; 0x0d 32b0a: 5e 85 ldd r21, Y+14 ; 0x0e 32b0c: b4 01 movw r22, r8 32b0e: 0e 94 27 e1 call 0x1c24e ; 0x1c24e 32b12: 21 2f mov r18, r17 32b14: 30 e0 ldi r19, 0x00 ; 0 32b16: 88 23 and r24, r24 32b18: b9 f1 breq .+110 ; 0x32b88 32b1a: 4b 8d ldd r20, Y+27 ; 0x1b 32b1c: 5c 8d ldd r21, Y+28 ; 0x1c 32b1e: 42 0f add r20, r18 32b20: 53 1f adc r21, r19 { ad += dad + 1; 32b22: 4f 5f subi r20, 0xFF ; 255 32b24: 5f 4f sbci r21, 0xFF ; 255 32b26: 5c 8f std Y+28, r21 ; 0x1c 32b28: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 32b2a: eb 8d ldd r30, Y+27 ; 0x1b 32b2c: fc 8d ldd r31, Y+28 ; 0x1c 32b2e: a9 81 ldd r26, Y+1 ; 0x01 32b30: ba 81 ldd r27, Y+2 ; 0x02 32b32: ed 93 st X+, r30 32b34: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 32b36: 6c 96 adiw r28, 0x1c ; 28 32b38: 0f b6 in r0, 0x3f ; 63 32b3a: f8 94 cli 32b3c: de bf out 0x3e, r29 ; 62 32b3e: 0f be out 0x3f, r0 ; 63 32b40: cd bf out 0x3d, r28 ; 61 32b42: df 91 pop r29 32b44: cf 91 pop r28 32b46: 1f 91 pop r17 32b48: 0f 91 pop r16 32b4a: ff 90 pop r15 32b4c: ef 90 pop r14 32b4e: df 90 pop r13 32b50: cf 90 pop r12 32b52: bf 90 pop r11 32b54: af 90 pop r10 32b56: 9f 90 pop r9 32b58: 8f 90 pop r8 32b5a: 7f 90 pop r7 32b5c: 6f 90 pop r6 32b5e: 5f 90 pop r5 32b60: 4f 90 pop r4 32b62: 3f 90 pop r3 32b64: 2f 90 pop r2 32b66: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 32b68: 2f ec ldi r18, 0xCF ; 207 32b6a: 32 e0 ldi r19, 0x02 ; 2 32b6c: ab 8d ldd r26, Y+27 ; 0x1b 32b6e: bc 8d ldd r27, Y+28 ; 0x1c 32b70: 2a 1b sub r18, r26 32b72: 3b 0b sbc r19, r27 32b74: c9 01 movw r24, r18 32b76: 6c e3 ldi r22, 0x3C ; 60 32b78: 70 e0 ldi r23, 0x00 ; 0 32b7a: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 32b7e: 10 e1 ldi r17, 0x10 ; 16 32b80: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32b82: a9 8d ldd r26, Y+25 ; 0x19 32b84: ba 8d ldd r27, Y+26 ; 0x1a 32b86: 41 cf rjmp .-382 ; 0x32a0a // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 32b88: 2f 5f subi r18, 0xFF ; 255 32b8a: 3f 4f sbci r19, 0xFF ; 255 32b8c: ab 8d ldd r26, Y+27 ; 0x1b 32b8e: bc 8d ldd r27, Y+28 ; 0x1c 32b90: a2 0f add r26, r18 32b92: b3 1f adc r27, r19 32b94: bc 8f std Y+28, r27 ; 0x1c 32b96: ab 8f std Y+27, r26 ; 0x1b 32b98: a0 3d cpi r26, 0xD0 ; 208 32b9a: b2 40 sbci r27, 0x02 ; 2 32b9c: 08 f4 brcc .+2 ; 0x32ba0 32b9e: 26 cf rjmp .-436 ; 0x329ec 32ba0: c4 cf rjmp .-120 ; 0x32b2a 00032ba2 : float mesh_bed_leveling::get_z(float x, float y) { 32ba2: 2f 92 push r2 32ba4: 3f 92 push r3 32ba6: 4f 92 push r4 32ba8: 5f 92 push r5 32baa: 6f 92 push r6 32bac: 7f 92 push r7 32bae: 8f 92 push r8 32bb0: 9f 92 push r9 32bb2: af 92 push r10 32bb4: bf 92 push r11 32bb6: cf 92 push r12 32bb8: df 92 push r13 32bba: ef 92 push r14 32bbc: ff 92 push r15 32bbe: 0f 93 push r16 32bc0: 1f 93 push r17 32bc2: cf 93 push r28 32bc4: df 93 push r29 32bc6: 00 d0 rcall .+0 ; 0x32bc8 32bc8: 00 d0 rcall .+0 ; 0x32bca 32bca: 00 d0 rcall .+0 ; 0x32bcc 32bcc: 1f 92 push r1 32bce: cd b7 in r28, 0x3d ; 61 32bd0: de b7 in r29, 0x3e ; 62 32bd2: 2b 01 movw r4, r22 32bd4: 3c 01 movw r6, r24 32bd6: 49 01 movw r8, r18 32bd8: 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)); 32bda: 20 e0 ldi r18, 0x00 ; 0 32bdc: 30 e0 ldi r19, 0x00 ; 0 32bde: 40 ec ldi r20, 0xC0 ; 192 32be0: 51 e4 ldi r21, 0x41 ; 65 32be2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 32be6: 20 e0 ldi r18, 0x00 ; 0 32be8: 30 e0 ldi r19, 0x00 ; 0 32bea: 48 e0 ldi r20, 0x08 ; 8 32bec: 52 e4 ldi r21, 0x42 ; 66 32bee: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 32bf2: 6b 01 movw r12, r22 32bf4: 7c 01 movw r14, r24 32bf6: 0f 94 de df call 0x3bfbc ; 0x3bfbc 32bfa: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> if (i < 0) { i = 0; 32bfe: 31 2c mov r3, r1 32c00: 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) { 32c02: 77 fd sbrc r23, 7 32c04: 1e c0 rjmp .+60 ; 0x32c42 32c06: 1b 01 movw r2, r22 32c08: 66 30 cpi r22, 0x06 ; 6 32c0a: 71 05 cpc r23, r1 32c0c: 1c f0 brlt .+6 ; 0x32c14 32c0e: 45 e0 ldi r20, 0x05 ; 5 32c10: 24 2e mov r2, r20 32c12: 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; } 32c14: 82 2d mov r24, r2 32c16: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 32c1a: 20 e0 ldi r18, 0x00 ; 0 32c1c: 30 e0 ldi r19, 0x00 ; 0 32c1e: 48 eb ldi r20, 0xB8 ; 184 32c20: 51 e4 ldi r21, 0x41 ; 65 32c22: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 32c26: 9b 01 movw r18, r22 32c28: 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; 32c2a: c3 01 movw r24, r6 32c2c: b2 01 movw r22, r4 32c2e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 32c32: 20 e0 ldi r18, 0x00 ; 0 32c34: 30 e0 ldi r19, 0x00 ; 0 32c36: 48 e0 ldi r20, 0x08 ; 8 32c38: 52 e4 ldi r21, 0x42 ; 66 32c3a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 32c3e: 6b 01 movw r12, r22 32c40: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 32c42: 20 e0 ldi r18, 0x00 ; 0 32c44: 30 e0 ldi r19, 0x00 ; 0 32c46: 40 ec ldi r20, 0xC0 ; 192 32c48: 50 e4 ldi r21, 0x40 ; 64 32c4a: c5 01 movw r24, r10 32c4c: b4 01 movw r22, r8 32c4e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 32c52: 20 e0 ldi r18, 0x00 ; 0 32c54: 30 e0 ldi r19, 0x00 ; 0 32c56: 48 e0 ldi r20, 0x08 ; 8 32c58: 52 e4 ldi r21, 0x42 ; 66 32c5a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 32c5e: 69 83 std Y+1, r22 ; 0x01 32c60: 7a 83 std Y+2, r23 ; 0x02 32c62: 8b 83 std Y+3, r24 ; 0x03 32c64: 9c 83 std Y+4, r25 ; 0x04 32c66: 0f 94 de df call 0x3bfbc ; 0x3bfbc 32c6a: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> if (j < 0) { 32c6e: 77 fd sbrc r23, 7 32c70: da c0 rjmp .+436 ; 0x32e26 32c72: 7a 87 std Y+10, r23 ; 0x0a 32c74: 69 87 std Y+9, r22 ; 0x09 32c76: 66 30 cpi r22, 0x06 ; 6 32c78: 71 05 cpc r23, r1 32c7a: 24 f0 brlt .+8 ; 0x32c84 32c7c: e5 e0 ldi r30, 0x05 ; 5 32c7e: f0 e0 ldi r31, 0x00 ; 0 32c80: fa 87 std Y+10, r31 ; 0x0a 32c82: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 32c84: 89 85 ldd r24, Y+9 ; 0x09 32c86: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 32c8a: 20 e0 ldi r18, 0x00 ; 0 32c8c: 30 e0 ldi r19, 0x00 ; 0 32c8e: 40 ea ldi r20, 0xA0 ; 160 32c90: 50 e4 ldi r21, 0x40 ; 64 32c92: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 32c96: 9b 01 movw r18, r22 32c98: 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; 32c9a: c5 01 movw r24, r10 32c9c: b4 01 movw r22, r8 32c9e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 32ca2: 20 e0 ldi r18, 0x00 ; 0 32ca4: 30 e0 ldi r19, 0x00 ; 0 32ca6: 48 e0 ldi r20, 0x08 ; 8 32ca8: 52 e4 ldi r21, 0x42 ; 66 32caa: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 32cae: 69 83 std Y+1, r22 ; 0x01 32cb0: 7a 83 std Y+2, r23 ; 0x02 32cb2: 8b 83 std Y+3, r24 ; 0x03 32cb4: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 32cb6: a7 01 movw r20, r14 32cb8: 96 01 movw r18, r12 32cba: 60 e0 ldi r22, 0x00 ; 0 32cbc: 70 e0 ldi r23, 0x00 ; 0 32cbe: 80 e8 ldi r24, 0x80 ; 128 32cc0: 9f e3 ldi r25, 0x3F ; 63 32cc2: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 32cc6: 2b 01 movw r4, r22 32cc8: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 32cca: 91 01 movw r18, r2 32ccc: 2f 5f subi r18, 0xFF ; 255 32cce: 3f 4f sbci r19, 0xFF ; 255 32cd0: 3e 83 std Y+6, r19 ; 0x06 32cd2: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 32cd4: 89 85 ldd r24, Y+9 ; 0x09 32cd6: 9a 85 ldd r25, Y+10 ; 0x0a 32cd8: 01 96 adiw r24, 0x01 ; 1 32cda: 98 87 std Y+8, r25 ; 0x08 32cdc: 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]; 32cde: 27 e0 ldi r18, 0x07 ; 7 32ce0: e9 85 ldd r30, Y+9 ; 0x09 32ce2: fa 85 ldd r31, Y+10 ; 0x0a 32ce4: 2e 9f mul r18, r30 32ce6: 80 01 movw r16, r0 32ce8: 2f 9f mul r18, r31 32cea: 10 0d add r17, r0 32cec: 11 24 eor r1, r1 32cee: f8 01 movw r30, r16 32cf0: e2 0d add r30, r2 32cf2: f3 1d adc r31, r3 32cf4: ee 0f add r30, r30 32cf6: ff 1f adc r31, r31 32cf8: ee 0f add r30, r30 32cfa: ff 1f adc r31, r31 32cfc: e3 56 subi r30, 0x63 ; 99 32cfe: fc 4e sbci r31, 0xEC ; 236 32d00: 21 81 ldd r18, Z+1 ; 0x01 32d02: 32 81 ldd r19, Z+2 ; 0x02 32d04: 43 81 ldd r20, Z+3 ; 0x03 32d06: 54 81 ldd r21, Z+4 ; 0x04 32d08: c3 01 movw r24, r6 32d0a: b2 01 movw r22, r4 32d0c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32d10: 4b 01 movw r8, r22 32d12: 5c 01 movw r10, r24 32d14: ed 81 ldd r30, Y+5 ; 0x05 32d16: fe 81 ldd r31, Y+6 ; 0x06 32d18: e0 0f add r30, r16 32d1a: f1 1f adc r31, r17 32d1c: ee 0f add r30, r30 32d1e: ff 1f adc r31, r31 32d20: ee 0f add r30, r30 32d22: ff 1f adc r31, r31 32d24: e3 56 subi r30, 0x63 ; 99 32d26: fc 4e sbci r31, 0xEC ; 236 32d28: 21 81 ldd r18, Z+1 ; 0x01 32d2a: 32 81 ldd r19, Z+2 ; 0x02 32d2c: 43 81 ldd r20, Z+3 ; 0x03 32d2e: 54 81 ldd r21, Z+4 ; 0x04 32d30: c7 01 movw r24, r14 32d32: b6 01 movw r22, r12 32d34: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32d38: 9b 01 movw r18, r22 32d3a: ac 01 movw r20, r24 32d3c: c5 01 movw r24, r10 32d3e: b4 01 movw r22, r8 32d40: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 32d44: 4b 01 movw r8, r22 32d46: 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; 32d48: 29 81 ldd r18, Y+1 ; 0x01 32d4a: 3a 81 ldd r19, Y+2 ; 0x02 32d4c: 4b 81 ldd r20, Y+3 ; 0x03 32d4e: 5c 81 ldd r21, Y+4 ; 0x04 32d50: 60 e0 ldi r22, 0x00 ; 0 32d52: 70 e0 ldi r23, 0x00 ; 0 32d54: 80 e8 ldi r24, 0x80 ; 128 32d56: 9f e3 ldi r25, 0x3F ; 63 32d58: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 32d5c: 9b 01 movw r18, r22 32d5e: ac 01 movw r20, r24 32d60: c5 01 movw r24, r10 32d62: b4 01 movw r22, r8 32d64: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32d68: 4b 01 movw r8, r22 32d6a: 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]; 32d6c: 27 e0 ldi r18, 0x07 ; 7 32d6e: ef 81 ldd r30, Y+7 ; 0x07 32d70: f8 85 ldd r31, Y+8 ; 0x08 32d72: 2e 9f mul r18, r30 32d74: c0 01 movw r24, r0 32d76: 2f 9f mul r18, r31 32d78: 90 0d add r25, r0 32d7a: 11 24 eor r1, r1 32d7c: 9a 87 std Y+10, r25 ; 0x0a 32d7e: 89 87 std Y+9, r24 ; 0x09 32d80: fc 01 movw r30, r24 32d82: e2 0d add r30, r2 32d84: f3 1d adc r31, r3 32d86: ee 0f add r30, r30 32d88: ff 1f adc r31, r31 32d8a: ee 0f add r30, r30 32d8c: ff 1f adc r31, r31 32d8e: e3 56 subi r30, 0x63 ; 99 32d90: fc 4e sbci r31, 0xEC ; 236 32d92: 21 81 ldd r18, Z+1 ; 0x01 32d94: 32 81 ldd r19, Z+2 ; 0x02 32d96: 43 81 ldd r20, Z+3 ; 0x03 32d98: 54 81 ldd r21, Z+4 ; 0x04 32d9a: c3 01 movw r24, r6 32d9c: b2 01 movw r22, r4 32d9e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32da2: 2b 01 movw r4, r22 32da4: 3c 01 movw r6, r24 32da6: 89 85 ldd r24, Y+9 ; 0x09 32da8: 9a 85 ldd r25, Y+10 ; 0x0a 32daa: ed 81 ldd r30, Y+5 ; 0x05 32dac: fe 81 ldd r31, Y+6 ; 0x06 32dae: 8e 0f add r24, r30 32db0: 9f 1f adc r25, r31 32db2: 88 0f add r24, r24 32db4: 99 1f adc r25, r25 32db6: 88 0f add r24, r24 32db8: 99 1f adc r25, r25 32dba: 83 56 subi r24, 0x63 ; 99 32dbc: 9c 4e sbci r25, 0xEC ; 236 32dbe: fc 01 movw r30, r24 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 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32dd0: 9b 01 movw r18, r22 32dd2: ac 01 movw r20, r24 32dd4: c3 01 movw r24, r6 32dd6: b2 01 movw r22, r4 32dd8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> return (1.f-t) * z0 + t * z1; 32ddc: 29 81 ldd r18, Y+1 ; 0x01 32dde: 3a 81 ldd r19, Y+2 ; 0x02 32de0: 4b 81 ldd r20, Y+3 ; 0x03 32de2: 5c 81 ldd r21, Y+4 ; 0x04 32de4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 32de8: 9b 01 movw r18, r22 32dea: ac 01 movw r20, r24 32dec: c5 01 movw r24, r10 32dee: b4 01 movw r22, r8 32df0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> } 32df4: 2a 96 adiw r28, 0x0a ; 10 32df6: 0f b6 in r0, 0x3f ; 63 32df8: f8 94 cli 32dfa: de bf out 0x3e, r29 ; 62 32dfc: 0f be out 0x3f, r0 ; 63 32dfe: cd bf out 0x3d, r28 ; 61 32e00: df 91 pop r29 32e02: cf 91 pop r28 32e04: 1f 91 pop r17 32e06: 0f 91 pop r16 32e08: ff 90 pop r15 32e0a: ef 90 pop r14 32e0c: df 90 pop r13 32e0e: cf 90 pop r12 32e10: bf 90 pop r11 32e12: af 90 pop r10 32e14: 9f 90 pop r9 32e16: 8f 90 pop r8 32e18: 7f 90 pop r7 32e1a: 6f 90 pop r6 32e1c: 5f 90 pop r5 32e1e: 4f 90 pop r4 32e20: 3f 90 pop r3 32e22: 2f 90 pop r2 32e24: 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; 32e26: 1a 86 std Y+10, r1 ; 0x0a 32e28: 19 86 std Y+9, r1 ; 0x09 32e2a: 45 cf rjmp .-374 ; 0x32cb6 00032e2c : 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) { 32e2c: 1f 93 push r17 32e2e: cf 93 push r28 32e30: df 93 push r29 32e32: 00 d0 rcall .+0 ; 0x32e34 32e34: 1f 92 push r1 32e36: 1f 92 push r1 32e38: cd b7 in r28, 0x3d ; 61 32e3a: de b7 in r29, 0x3e ; 62 32e3c: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 32e3e: 48 2f mov r20, r24 32e40: 62 e5 ldi r22, 0x52 ; 82 32e42: ce 01 movw r24, r28 32e44: 01 96 adiw r24, 0x01 ; 1 32e46: 0f 94 8a c2 call 0x38514 ; 0x38514 32e4a: 49 81 ldd r20, Y+1 ; 0x01 32e4c: 5a 81 ldd r21, Y+2 ; 0x02 32e4e: 6b 81 ldd r22, Y+3 ; 0x03 32e50: 7c 81 ldd r23, Y+4 ; 0x04 32e52: 8d 81 ldd r24, Y+5 ; 0x05 32e54: 0f 94 14 70 call 0x2e028 ; 0x2e028 scopeState = nextState; 32e58: 10 93 29 13 sts 0x1329, r17 ; 0x801329 } 32e5c: 0f 90 pop r0 32e5e: 0f 90 pop r0 32e60: 0f 90 pop r0 32e62: 0f 90 pop r0 32e64: 0f 90 pop r0 32e66: df 91 pop r29 32e68: cf 91 pop r28 32e6a: 1f 91 pop r17 32e6c: 08 95 ret 00032e6e : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 32e6e: 10 92 74 13 sts 0x1374, r1 ; 0x801374 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 32e72: e2 eb ldi r30, 0xB2 ; 178 32e74: fa ea ldi r31, 0xAA ; 170 32e76: 84 91 lpm r24, Z 32e78: 67 e0 ldi r22, 0x07 ; 7 32e7a: 0d 94 16 97 jmp 0x32e2c ; 0x32e2c 00032e7e : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 32e7e: e0 91 74 13 lds r30, 0x1374 ; 0x801374 32e82: ae 2f mov r26, r30 32e84: b0 e0 ldi r27, 0x00 ; 0 32e86: aa 0f add r26, r26 32e88: bb 1f adc r27, r27 32e8a: a2 59 subi r26, 0x92 ; 146 32e8c: bc 4e sbci r27, 0xEC ; 236 32e8e: 20 91 41 13 lds r18, 0x1341 ; 0x801341 32e92: 30 91 42 13 lds r19, 0x1342 ; 0x801342 32e96: 2d 93 st X+, r18 32e98: 3c 93 st X, r19 ++regIndex; 32e9a: ef 5f subi r30, 0xFF ; 255 32e9c: e0 93 74 13 sts 0x1374, r30 ; 0x801374 if (regIndex >= regs16Count) { 32ea0: e2 30 cpi r30, 0x02 ; 2 32ea2: 40 f4 brcc .+16 ; 0x32eb4 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32ea4: f0 e0 ldi r31, 0x00 ; 0 32ea6: e7 56 subi r30, 0x67 ; 103 32ea8: f5 45 sbci r31, 0x55 ; 85 32eaa: 84 91 lpm r24, Z 32eac: 68 e0 ldi r22, 0x08 ; 8 32eae: 0f 94 16 97 call 0x32e2c ; 0x32e2c } return ScopeState::Reading16bitRegisters; 32eb2: 88 e0 ldi r24, 0x08 ; 8 } 32eb4: 08 95 ret 00032eb6 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 32eb6: e0 91 74 13 lds r30, 0x1374 ; 0x801374 32eba: ae 2f mov r26, r30 32ebc: b0 e0 ldi r27, 0x00 ; 0 32ebe: a5 59 subi r26, 0x95 ; 149 32ec0: bc 4e sbci r27, 0xEC ; 236 32ec2: 80 91 41 13 lds r24, 0x1341 ; 0x801341 32ec6: 8c 93 st X, r24 ++regIndex; 32ec8: ef 5f subi r30, 0xFF ; 255 32eca: e0 93 74 13 sts 0x1374, r30 ; 0x801374 if (regIndex >= regs8Count) { 32ece: e3 30 cpi r30, 0x03 ; 3 32ed0: 40 f0 brcs .+16 ; 0x32ee2 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 32ed2: 10 92 74 13 sts 0x1374, r1 ; 0x801374 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32ed6: e9 e9 ldi r30, 0x99 ; 153 32ed8: fa ea ldi r31, 0xAA ; 170 32eda: 84 91 lpm r24, Z 32edc: 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); 32ede: 0d 94 16 97 jmp 0x32e2c ; 0x32e2c 32ee2: f0 e0 ldi r31, 0x00 ; 0 32ee4: ee 54 subi r30, 0x4E ; 78 32ee6: f5 45 sbci r31, 0x55 ; 85 32ee8: 84 91 lpm r24, Z 32eea: 67 e0 ldi r22, 0x07 ; 7 32eec: f8 cf rjmp .-16 ; 0x32ede 00032eee : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 32eee: cf 93 push r28 32ef0: df 93 push r29 32ef2: 00 d0 rcall .+0 ; 0x32ef4 32ef4: 00 d0 rcall .+0 ; 0x32ef6 32ef6: 00 d0 rcall .+0 ; 0x32ef8 32ef8: 1f 92 push r1 32efa: cd b7 in r28, 0x3d ; 61 32efc: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 32efe: 80 91 30 13 lds r24, 0x1330 ; 0x801330 32f02: 82 34 cpi r24, 0x42 ; 66 32f04: 09 f4 brne .+2 ; 0x32f08 32f06: 46 c0 rjmp .+140 ; 0x32f94 32f08: b8 f5 brcc .+110 ; 0x32f78 32f0a: 88 23 and r24, r24 32f0c: 09 f4 brne .+2 ; 0x32f10 32f0e: 72 c0 rjmp .+228 ; 0x32ff4 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 32f10: 84 e0 ldi r24, 0x04 ; 4 32f12: 80 93 28 13 sts 0x1328, r24 ; 0x801328 32f16: 85 e0 ldi r24, 0x05 ; 5 32f18: e0 e3 ldi r30, 0x30 ; 48 32f1a: f3 e1 ldi r31, 0x13 ; 19 32f1c: de 01 movw r26, r28 32f1e: 16 96 adiw r26, 0x06 ; 6 32f20: 01 90 ld r0, Z+ 32f22: 0d 92 st X+, r0 32f24: 8a 95 dec r24 32f26: e1 f7 brne .-8 ; 0x32f20 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 32f28: 85 e0 ldi r24, 0x05 ; 5 32f2a: fe 01 movw r30, r28 32f2c: 36 96 adiw r30, 0x06 ; 6 32f2e: ab e2 ldi r26, 0x2B ; 43 32f30: b3 e1 ldi r27, 0x13 ; 19 32f32: 01 90 ld r0, Z+ 32f34: 0d 92 st X+, r0 32f36: 8a 95 dec r24 32f38: e1 f7 brne .-8 ; 0x32f32 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 32f3a: 40 e0 ldi r20, 0x00 ; 0 32f3c: 60 e0 ldi r22, 0x00 ; 0 32f3e: ce 01 movw r24, r28 32f40: 01 96 adiw r24, 0x01 ; 1 32f42: 0f 94 8a c2 call 0x38514 ; 0x38514 32f46: 85 e0 ldi r24, 0x05 ; 5 32f48: fe 01 movw r30, r28 32f4a: 31 96 adiw r30, 0x01 ; 1 32f4c: a0 e3 ldi r26, 0x30 ; 48 32f4e: b3 e1 ldi r27, 0x13 ; 19 32f50: 01 90 ld r0, Z+ 32f52: 0d 92 st X+, r0 32f54: 8a 95 dec r24 32f56: e1 f7 brne .-8 ; 0x32f50 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 32f58: 85 e0 ldi r24, 0x05 ; 5 32f5a: 80 93 29 13 sts 0x1329, r24 ; 0x801329 SendMsg(rq); 32f5e: 40 91 2b 13 lds r20, 0x132B ; 0x80132b 32f62: 50 91 2c 13 lds r21, 0x132C ; 0x80132c 32f66: 60 91 2d 13 lds r22, 0x132D ; 0x80132d 32f6a: 70 91 2e 13 lds r23, 0x132E ; 0x80132e 32f6e: 80 91 2f 13 lds r24, 0x132F ; 0x80132f 32f72: 0f 94 14 70 call 0x2e028 ; 0x2e028 32f76: 2e c0 rjmp .+92 ; 0x32fd4 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 32f78: 82 35 cpi r24, 0x52 ; 82 32f7a: b1 f1 breq .+108 ; 0x32fe8 32f7c: 87 35 cpi r24, 0x57 ; 87 32f7e: 41 f6 brne .-112 ; 0x32f10 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); 32f80: 60 91 32 13 lds r22, 0x1332 ; 0x801332 32f84: 70 91 33 13 lds r23, 0x1333 ; 0x801333 32f88: 4c e0 ldi r20, 0x0C ; 12 32f8a: 80 91 31 13 lds r24, 0x1331 ; 0x801331 32f8e: 0f 94 7f 70 call 0x2e0fe ; 0x2e0fe 32f92: 11 c0 rjmp .+34 ; 0x32fb6 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 32f94: 40 91 31 13 lds r20, 0x1331 ; 0x801331 32f98: 62 e4 ldi r22, 0x42 ; 66 32f9a: ce 01 movw r24, r28 32f9c: 01 96 adiw r24, 0x01 ; 1 32f9e: 0f 94 8a c2 call 0x38514 ; 0x38514 32fa2: 49 81 ldd r20, Y+1 ; 0x01 32fa4: 5a 81 ldd r21, Y+2 ; 0x02 32fa6: 6b 81 ldd r22, Y+3 ; 0x03 32fa8: 7c 81 ldd r23, Y+4 ; 0x04 32faa: 8d 81 ldd r24, Y+5 ; 0x05 32fac: 0f 94 14 70 call 0x2e028 ; 0x2e028 scopeState = ScopeState::ButtonSent; 32fb0: 8a e0 ldi r24, 0x0A ; 10 32fb2: 80 93 29 13 sts 0x1329, r24 ; 0x801329 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); 32fb6: 40 e0 ldi r20, 0x00 ; 0 32fb8: 60 e0 ldi r22, 0x00 ; 0 32fba: ce 01 movw r24, r28 32fbc: 01 96 adiw r24, 0x01 ; 1 32fbe: 0f 94 8a c2 call 0x38514 ; 0x38514 32fc2: 85 e0 ldi r24, 0x05 ; 5 32fc4: fe 01 movw r30, r28 32fc6: 31 96 adiw r30, 0x01 ; 1 32fc8: a0 e3 ldi r26, 0x30 ; 48 32fca: b3 e1 ldi r27, 0x13 ; 19 32fcc: 01 90 ld r0, Z+ 32fce: 0d 92 st X+, r0 32fd0: 8a 95 dec r24 32fd2: e1 f7 brne .-8 ; 0x32fcc default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 32fd4: 81 e0 ldi r24, 0x01 ; 1 } } 32fd6: 2a 96 adiw r28, 0x0a ; 10 32fd8: 0f b6 in r0, 0x3f ; 63 32fda: f8 94 cli 32fdc: de bf out 0x3e, r29 ; 62 32fde: 0f be out 0x3f, r0 ; 63 32fe0: cd bf out 0x3d, r28 ; 61 32fe2: df 91 pop r29 32fe4: cf 91 pop r28 32fe6: 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); 32fe8: 6b e0 ldi r22, 0x0B ; 11 32fea: 80 91 31 13 lds r24, 0x1331 ; 0x801331 32fee: 0f 94 16 97 call 0x32e2c ; 0x32e2c 32ff2: e1 cf rjmp .-62 ; 0x32fb6 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 32ff4: 80 e0 ldi r24, 0x00 ; 0 32ff6: ef cf rjmp .-34 ; 0x32fd6 00032ff8 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 32ff8: cf 93 push r28 32ffa: df 93 push r29 32ffc: 00 d0 rcall .+0 ; 0x32ffe 32ffe: 1f 92 push r1 33000: 1f 92 push r1 33002: cd b7 in r28, 0x3d ; 61 33004: de b7 in r29, 0x3e ; 62 33006: 49 83 std Y+1, r20 ; 0x01 33008: 5a 83 std Y+2, r21 ; 0x02 3300a: 6b 83 std Y+3, r22 ; 0x03 3300c: 7c 83 std Y+4, r23 ; 0x04 3300e: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 33010: 85 e0 ldi r24, 0x05 ; 5 33012: fe 01 movw r30, r28 33014: 31 96 adiw r30, 0x01 ; 1 33016: a0 e3 ldi r26, 0x30 ; 48 33018: b3 e1 ldi r27, 0x13 ; 19 3301a: 01 90 ld r0, Z+ 3301c: 0d 92 st X+, r0 3301e: 8a 95 dec r24 33020: e1 f7 brne .-8 ; 0x3301a if (!ExpectsResponse()) { 33022: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33026: 87 ff sbrs r24, 7 33028: 09 c0 rjmp .+18 ; 0x3303c ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 3302a: 0f 90 pop r0 3302c: 0f 90 pop r0 3302e: 0f 90 pop r0 33030: 0f 90 pop r0 33032: 0f 90 pop r0 33034: df 91 pop r29 33036: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 33038: 0d 94 77 97 jmp 0x32eee ; 0x32eee } // otherwise wait for an empty window to activate the request } 3303c: 0f 90 pop r0 3303e: 0f 90 pop r0 33040: 0f 90 pop r0 33042: 0f 90 pop r0 33044: 0f 90 pop r0 33046: df 91 pop r29 33048: cf 91 pop r28 3304a: 08 95 ret 0003304c : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 3304c: 1f 93 push r17 3304e: cf 93 push r28 33050: df 93 push r29 33052: 00 d0 rcall .+0 ; 0x33054 33054: 1f 92 push r1 33056: 1f 92 push r1 33058: cd b7 in r28, 0x3d ; 61 3305a: de b7 in r29, 0x3e ; 62 3305c: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 3305e: 48 2f mov r20, r24 33060: 63 e5 ldi r22, 0x53 ; 83 33062: ce 01 movw r24, r28 33064: 01 96 adiw r24, 0x01 ; 1 33066: 0f 94 8a c2 call 0x38514 ; 0x38514 3306a: 49 81 ldd r20, Y+1 ; 0x01 3306c: 5a 81 ldd r21, Y+2 ; 0x02 3306e: 6b 81 ldd r22, Y+3 ; 0x03 33070: 7c 81 ldd r23, Y+4 ; 0x04 33072: 8d 81 ldd r24, Y+5 ; 0x05 33074: 0f 94 14 70 call 0x2e028 ; 0x2e028 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 33078: 10 93 29 13 sts 0x1329, r17 ; 0x801329 } 3307c: 0f 90 pop r0 3307e: 0f 90 pop r0 33080: 0f 90 pop r0 33082: 0f 90 pop r0 33084: 0f 90 pop r0 33086: df 91 pop r29 33088: cf 91 pop r28 3308a: 1f 91 pop r17 3308c: 08 95 ret 0003308e : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 3308e: cf 93 push r28 33090: df 93 push r29 33092: 00 d0 rcall .+0 ; 0x33094 33094: 1f 92 push r1 33096: 1f 92 push r1 33098: cd b7 in r28, 0x3d ; 61 3309a: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 3309c: 40 e0 ldi r20, 0x00 ; 0 3309e: 61 e5 ldi r22, 0x51 ; 81 330a0: ce 01 movw r24, r28 330a2: 01 96 adiw r24, 0x01 ; 1 330a4: 0f 94 8a c2 call 0x38514 ; 0x38514 330a8: 49 81 ldd r20, Y+1 ; 0x01 330aa: 5a 81 ldd r21, Y+2 ; 0x02 330ac: 6b 81 ldd r22, Y+3 ; 0x03 330ae: 7c 81 ldd r23, Y+4 ; 0x04 330b0: 8d 81 ldd r24, Y+5 ; 0x05 330b2: 0f 94 14 70 call 0x2e028 ; 0x2e028 scopeState = ScopeState::QuerySent; 330b6: 84 e0 ldi r24, 0x04 ; 4 330b8: 80 93 29 13 sts 0x1329, r24 ; 0x801329 } 330bc: 0f 90 pop r0 330be: 0f 90 pop r0 330c0: 0f 90 pop r0 330c2: 0f 90 pop r0 330c4: 0f 90 pop r0 330c6: df 91 pop r29 330c8: cf 91 pop r28 330ca: 08 95 ret 000330cc : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 330cc: cf 93 push r28 330ce: df 93 push r29 330d0: 00 d0 rcall .+0 ; 0x330d2 330d2: 1f 92 push r1 330d4: 1f 92 push r1 330d6: cd b7 in r28, 0x3d ; 61 330d8: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 330da: 0f 94 e2 c2 call 0x385c4 ; 0x385c4 330de: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a 330e2: 48 2f mov r20, r24 330e4: 66 e6 ldi r22, 0x66 ; 102 330e6: ce 01 movw r24, r28 330e8: 01 96 adiw r24, 0x01 ; 1 330ea: 0f 94 8a c2 call 0x38514 ; 0x38514 330ee: 49 81 ldd r20, Y+1 ; 0x01 330f0: 5a 81 ldd r21, Y+2 ; 0x02 330f2: 6b 81 ldd r22, Y+3 ; 0x03 330f4: 7c 81 ldd r23, Y+4 ; 0x04 330f6: 8d 81 ldd r24, Y+5 ; 0x05 330f8: 0f 94 14 70 call 0x2e028 ; 0x2e028 scopeState = ScopeState::FilamentSensorStateSent; 330fc: 86 e0 ldi r24, 0x06 ; 6 330fe: 80 93 29 13 sts 0x1329, r24 ; 0x801329 } 33102: 0f 90 pop r0 33104: 0f 90 pop r0 33106: 0f 90 pop r0 33108: 0f 90 pop r0 3310a: 0f 90 pop r0 3310c: df 91 pop r29 3310e: cf 91 pop r28 33110: 08 95 ret 00033112 : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 33112: cf 93 push r28 33114: df 93 push r29 33116: 00 d0 rcall .+0 ; 0x33118 33118: 1f 92 push r1 3311a: 1f 92 push r1 3311c: cd b7 in r28, 0x3d ; 61 3311e: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 33120: 80 91 40 13 lds r24, 0x1340 ; 0x801340 33124: 85 34 cpi r24, 0x45 ; 69 33126: f1 f0 breq .+60 ; 0x33164 33128: 20 f4 brcc .+8 ; 0x33132 3312a: 82 34 cpi r24, 0x42 ; 66 3312c: 51 f1 breq .+84 ; 0x33182 } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 3312e: 85 e0 ldi r24, 0x05 ; 5 33130: 11 c0 rjmp .+34 ; 0x33154 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 33132: 86 34 cpi r24, 0x46 ; 70 33134: 71 f1 breq .+92 ; 0x33192 33136: 80 35 cpi r24, 0x50 ; 80 33138: d1 f7 brne .-12 ; 0x3312e case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 3313a: 80 91 41 13 lds r24, 0x1341 ; 0x801341 3313e: 80 93 68 13 sts 0x1368, r24 ; 0x801368 errorCode = ErrorCode::OK; 33142: 81 e0 ldi r24, 0x01 ; 1 33144: 90 e0 ldi r25, 0x00 ; 0 33146: 90 93 67 13 sts 0x1367, r25 ; 0x801367 3314a: 80 93 66 13 sts 0x1366, r24 ; 0x801366 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 3314e: 0f 94 66 98 call 0x330cc ; 0x330cc return Processing; 33152: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 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 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; 33164: 8c e0 ldi r24, 0x0C ; 12 33166: 80 93 68 13 sts 0x1368, r24 ; 0x801368 errorCode = static_cast(rsp.paramValue); 3316a: 80 91 41 13 lds r24, 0x1341 ; 0x801341 3316e: 90 91 42 13 lds r25, 0x1342 ; 0x801342 33172: 90 93 67 13 sts 0x1367, r25 ; 0x801367 33176: 80 93 66 13 sts 0x1366, r24 ; 0x801366 // 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(); 3317a: 0f 94 66 98 call 0x330cc ; 0x330cc return CommandError; 3317e: 87 e0 ldi r24, 0x07 ; 7 33180: e9 cf rjmp .-46 ; 0x33154 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); 33182: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33186: 80 93 69 13 sts 0x1369, r24 ; 0x801369 SendAndUpdateFilamentSensor(); 3318a: 0f 94 66 98 call 0x330cc ; 0x330cc return ButtonPushed; 3318e: 8b e0 ldi r24, 0x0B ; 11 33190: e1 cf rjmp .-62 ; 0x33154 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) { 33192: 90 91 2b 13 lds r25, 0x132B ; 0x80132b 33196: 80 91 3b 13 lds r24, 0x133B ; 0x80133b 3319a: 98 13 cpse r25, r24 3319c: 22 c0 rjmp .+68 ; 0x331e2 3319e: 90 91 2c 13 lds r25, 0x132C ; 0x80132c 331a2: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 331a6: 98 13 cpse r25, r24 331a8: 1c c0 rjmp .+56 ; 0x331e2 progressCode = ProgressCode::OK; 331aa: 10 92 68 13 sts 0x1368, r1 ; 0x801368 errorCode = ErrorCode::OK; 331ae: 81 e0 ldi r24, 0x01 ; 1 331b0: 90 e0 ldi r25, 0x00 ; 0 331b2: 90 93 67 13 sts 0x1367, r25 ; 0x801367 331b6: 80 93 66 13 sts 0x1366, r24 ; 0x801366 scopeState = ScopeState::Ready; 331ba: 82 e8 ldi r24, 0x82 ; 130 331bc: 80 93 29 13 sts 0x1329, r24 ; 0x801329 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 331c0: 40 e0 ldi r20, 0x00 ; 0 331c2: 60 e0 ldi r22, 0x00 ; 0 331c4: ce 01 movw r24, r28 331c6: 01 96 adiw r24, 0x01 ; 1 331c8: 0f 94 8a c2 call 0x38514 ; 0x38514 331cc: 85 e0 ldi r24, 0x05 ; 5 331ce: fe 01 movw r30, r28 331d0: 31 96 adiw r30, 0x01 ; 1 331d2: ab e2 ldi r26, 0x2B ; 43 331d4: b3 e1 ldi r27, 0x13 ; 19 331d6: 01 90 ld r0, Z+ 331d8: 0d 92 st X+, r0 331da: 8a 95 dec r24 331dc: e1 f7 brne .-8 ; 0x331d6 331de: 82 e0 ldi r24, 0x02 ; 2 331e0: b9 cf rjmp .-142 ; 0x33154 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 331e2: 83 e0 ldi r24, 0x03 ; 3 331e4: b7 cf rjmp .-146 ; 0x33154 000331e6 : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 331e6: 1f 93 push r17 331e8: cf 93 push r28 331ea: df 93 push r29 331ec: 00 d0 rcall .+0 ; 0x331ee 331ee: 1f 92 push r1 331f0: 1f 92 push r1 331f2: cd b7 in r28, 0x3d ; 61 331f4: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 331f6: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 331fa: 81 11 cpse r24, r1 331fc: 2a c0 rjmp .+84 ; 0x33252 auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 331fe: 10 91 90 13 lds r17, 0x1390 ; 0x801390 33202: 1f 3f cpi r17, 0xFF ; 255 33204: 91 f5 brne .+100 ; 0x3326a btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 33206: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 3320a: 81 11 cpse r24, r1 3320c: 60 c0 rjmp .+192 ; 0x332ce 3320e: 1f 3f cpi r17, 0xFF ; 255 33210: b9 f0 breq .+46 ; 0x33240 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 33212: 81 e0 ldi r24, 0x01 ; 1 33214: 90 e0 ldi r25, 0x00 ; 0 33216: 90 93 27 13 sts 0x1327, r25 ; 0x801327 3321a: 80 93 26 13 sts 0x1326, r24 ; 0x801326 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 3321e: 90 93 8e 13 sts 0x138E, r25 ; 0x80138e 33222: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d lastErrorSource = ErrorSource::ErrorSourceNone; 33226: 8f ef ldi r24, 0xFF ; 255 33228: 80 93 8f 13 sts 0x138F, r24 ; 0x80138f // 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) { 3322c: 13 30 cpi r17, 0x03 ; 3 3322e: 09 f4 brne .+2 ; 0x33232 33230: 82 c0 rjmp .+260 ; 0x33336 33232: f8 f0 brcs .+62 ; 0x33272 33234: 16 30 cpi r17, 0x06 ; 6 33236: 08 f4 brcc .+2 ; 0x3323a 33238: 7b c0 rjmp .+246 ; 0x33330 3323a: 17 30 cpi r17, 0x07 ; 7 3323c: 09 f4 brne .+2 ; 0x33240 3323e: 7e c0 rjmp .+252 ; 0x3333c // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 33240: 0f 90 pop r0 33242: 0f 90 pop r0 33244: 0f 90 pop r0 33246: 0f 90 pop r0 33248: 0f 90 pop r0 3324a: df 91 pop r29 3324c: cf 91 pop r28 3324e: 1f 91 pop r17 33250: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 33252: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33256: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 3325a: 0f 94 6f c5 call 0x38ade ; 0x38ade 3325e: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 33260: 10 92 5c 0e sts 0x0E5C, r1 ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 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) { 33264: 8f 3f cpi r24, 0xFF ; 255 33266: 79 f6 brne .-98 ; 0x33206 33268: ca cf rjmp .-108 ; 0x331fe btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 3326a: 8f ef ldi r24, 0xFF ; 255 3326c: 80 93 90 13 sts 0x1390, r24 ; 0x801390 33270: ca cf rjmp .-108 ; 0x33206 switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 33272: 8e e2 ldi r24, 0x2E ; 46 33274: 99 ea ldi r25, 0xA9 ; 169 33276: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 3327a: 81 2f mov r24, r17 3327c: 90 e0 ldi r25, 0x00 ; 0 3327e: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 33282: 0f 94 be 9e call 0x33d7c ; 0x33d7c if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 33286: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 3328a: 81 30 cpi r24, 0x01 ; 1 3328c: 89 f4 brne .+34 ; 0x332b0 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 3328e: 87 e2 ldi r24, 0x27 ; 39 33290: 99 ea ldi r25, 0xA9 ; 169 33292: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 33296: 41 2f mov r20, r17 33298: 62 e4 ldi r22, 0x42 ; 66 3329a: ce 01 movw r24, r28 3329c: 01 96 adiw r24, 0x01 ; 1 3329e: 0f 94 8a c2 call 0x38514 ; 0x38514 332a2: 49 81 ldd r20, Y+1 ; 0x01 332a4: 5a 81 ldd r21, Y+2 ; 0x02 332a6: 6b 81 ldd r22, Y+3 ; 0x03 332a8: 7c 81 ldd r23, Y+4 ; 0x04 332aa: 8d 81 ldd r24, Y+5 ; 0x05 332ac: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 } // 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) { 332b0: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 332b4: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 332b8: 84 30 cpi r24, 0x04 ; 4 332ba: 20 e8 ldi r18, 0x80 ; 128 332bc: 92 07 cpc r25, r18 332be: 21 f0 breq .+8 ; 0x332c8 332c0: 89 30 cpi r24, 0x09 ; 9 332c2: 90 48 sbci r25, 0x80 ; 128 332c4: 09 f0 breq .+2 ; 0x332c8 332c6: bc cf rjmp .-136 ; 0x33240 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 332c8: 0f 94 a7 72 call 0x2e54e ; 0x2e54e 332cc: b9 cf rjmp .-142 ; 0x33240 // 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) { 332ce: 19 30 cpi r17, 0x09 ; 9 332d0: 08 f0 brcs .+2 ; 0x332d4 332d2: b6 cf rjmp .-148 ; 0x33240 332d4: e1 2f mov r30, r17 332d6: f0 e0 ldi r31, 0x00 ; 0 332d8: 88 27 eor r24, r24 332da: ee 58 subi r30, 0x8E ; 142 332dc: f6 46 sbci r31, 0x66 ; 102 332de: 8e 4f sbci r24, 0xFE ; 254 332e0: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 332e4: ea 3a cpi r30, 0xAA ; 170 332e6: ea 3a cpi r30, 0xAA ; 170 332e8: ea 3a cpi r30, 0xAA ; 170 332ea: 92 3b cpi r25, 0xB2 ; 178 332ec: a6 3b cpi r26, 0xB6 ; 182 332ee: a6 3b cpi r26, 0xB6 ; 182 332f0: 54 3b cpi r21, 0xB4 ; 180 332f2: 48 3a cpi r20, 0xA8 ; 168 332f4: 42 3b cpi r20, 0xB2 ; 178 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 332f6: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 332fa: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 332fe: 87 38 cpi r24, 0x87 ; 135 33300: 20 e8 ldi r18, 0x80 ; 128 33302: 92 07 cpc r25, r18 33304: 21 f0 breq .+8 ; 0x3330e 33306: 87 30 cpi r24, 0x07 ; 7 33308: 91 48 sbci r25, 0x81 ; 129 3330a: 09 f0 breq .+2 ; 0x3330e 3330c: 99 cf rjmp .-206 ; 0x33240 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 3330e: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33312: 84 30 cpi r24, 0x04 ; 4 33314: 21 f4 brne .+8 ; 0x3331e ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 33316: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 3331a: 81 11 cpse r24, r1 3331c: 91 cf rjmp .-222 ; 0x33240 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 3331e: 81 e0 ldi r24, 0x01 ; 1 33320: 80 93 5b 0e sts 0x0E5B, r24 ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.512> menu_submenu(tuneIdlerStallguardThresholdMenu); 33324: 60 e0 ldi r22, 0x00 ; 0 33326: 8e eb ldi r24, 0xBE ; 190 33328: 9a e3 ldi r25, 0x3A ; 58 3332a: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 3332e: 88 cf rjmp .-240 ; 0x33240 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 33330: 10 93 93 13 sts 0x1393, r17 ; 0x801393 33334: 85 cf rjmp .-246 ; 0x33240 void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 33336: 0f 94 97 c2 call 0x3852e ; 0x3852e 3333a: 82 cf rjmp .-252 ; 0x33240 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 3333c: 10 92 95 13 sts 0x1395, r1 ; 0x801395 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33340: 10 92 43 13 sts 0x1343, r1 ; 0x801343 currentScope = Scope::Stopped; 33344: 10 92 28 13 sts 0x1328, r1 ; 0x801328 33348: 60 e0 ldi r22, 0x00 ; 0 3334a: 8c ea ldi r24, 0xAC ; 172 3334c: 9c e0 ldi r25, 0x0C ; 12 3334e: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 33352: 0f 94 82 75 call 0x2eb04 ; 0x2eb04 33356: 74 cf rjmp .-280 ; 0x33240 00033358 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 33358: 4f 92 push r4 3335a: 5f 92 push r5 3335c: 6f 92 push r6 3335e: 7f 92 push r7 33360: 8f 92 push r8 33362: 9f 92 push r9 33364: af 92 push r10 33366: bf 92 push r11 33368: cf 92 push r12 3336a: df 92 push r13 3336c: ef 92 push r14 3336e: ff 92 push r15 33370: 0f 93 push r16 33372: 1f 93 push r17 33374: cf 93 push r28 33376: df 93 push r29 33378: cd b7 in r28, 0x3d ; 61 3337a: de b7 in r29, 0x3e ; 62 3337c: a0 97 sbiw r28, 0x20 ; 32 3337e: 0f b6 in r0, 0x3f ; 63 33380: f8 94 cli 33382: de bf out 0x3e, r29 ; 62 33384: 0f be out 0x3f, r0 ; 63 33386: cd bf out 0x3d, r28 ; 61 33388: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 3338a: 0f 94 f3 98 call 0x331e6 ; 0x331e6 DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 3338e: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33392: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 33394: 0f 94 77 97 call 0x32eee ; 0x32eee 33398: 90 91 29 13 lds r25, 0x1329 ; 0x801329 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 3339c: 97 ff sbrs r25, 7 3339e: 7d c0 rjmp .+250 ; 0x3349a // we are waiting for something switch (currentScope) { 333a0: 80 91 28 13 lds r24, 0x1328 ; 0x801328 333a4: 82 30 cpi r24, 0x02 ; 2 333a6: b1 f0 breq .+44 ; 0x333d4 333a8: 08 f4 brcc .+2 ; 0x333ac 333aa: 75 c0 rjmp .+234 ; 0x33496 333ac: 83 30 cpi r24, 0x03 ; 3 333ae: e1 f1 breq .+120 ; 0x33428 333b0: 84 30 cpi r24, 0x04 ; 4 333b2: 09 f4 brne .+2 ; 0x333b6 333b4: 54 c0 rjmp .+168 ; 0x3345e 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 333b6: 0f 94 77 97 call 0x32eee ; 0x32eee 333ba: 81 11 cpse r24, r1 333bc: 6b c3 rjmp .+1750 ; 0x33a94 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 333be: 82 e0 ldi r24, 0x02 ; 2 333c0: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::Idle; 333c4: 83 e0 ldi r24, 0x03 ; 3 333c6: 80 93 28 13 sts 0x1328, r24 ; 0x801328 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 333ca: 82 e8 ldi r24, 0x82 ; 130 333cc: 80 93 29 13 sts 0x1329, r24 ; 0x801329 // 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()) { 333d0: 12 e0 ldi r17, 0x02 ; 2 333d2: db c2 rjmp .+1462 ; 0x3398a IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 333d4: 0f 94 55 3e call 0x27caa ; 0x27caa 333d8: ab 01 movw r20, r22 333da: bc 01 movw r22, r24 333dc: 80 91 35 13 lds r24, 0x1335 ; 0x801335 333e0: 90 91 36 13 lds r25, 0x1336 ; 0x801336 333e4: a0 91 37 13 lds r26, 0x1337 ; 0x801337 333e8: b0 91 38 13 lds r27, 0x1338 ; 0x801338 333ec: 88 51 subi r24, 0x18 ; 24 333ee: 9c 4f sbci r25, 0xFC ; 252 333f0: af 4f sbci r26, 0xFF ; 255 333f2: 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 333f4: 48 17 cp r20, r24 333f6: 59 07 cpc r21, r25 333f8: 6a 07 cpc r22, r26 333fa: 7b 07 cpc r23, r27 333fc: 08 f4 brcc .+2 ; 0x33400 333fe: 4b c0 rjmp .+150 ; 0x33496 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 33400: 8f e6 ldi r24, 0x6F ; 111 33402: 92 e1 ldi r25, 0x12 ; 18 33404: 0f 94 3b db call 0x3b676 ; 0x3b676 while (uart->read() != -1) 33408: 01 96 adiw r24, 0x01 ; 1 3340a: d1 f7 brne .-12 ; 0x33400 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 3340c: 81 e0 ldi r24, 0x01 ; 1 3340e: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::StartSeq; 33412: 80 93 28 13 sts 0x1328, r24 ; 0x801328 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 33416: 10 92 4a 13 sts 0x134A, r1 ; 0x80134a LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 3341a: 86 e0 ldi r24, 0x06 ; 6 3341c: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a SendVersion(0); 33420: 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); 33422: 0f 94 26 98 call 0x3304c ; 0x3304c 33426: 37 c0 rjmp .+110 ; 0x33496 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 33428: 92 38 cpi r25, 0x82 ; 130 3342a: 29 f6 brne .-118 ; 0x333b6 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3342c: 0f 94 55 3e call 0x27caa ; 0x27caa 33430: ab 01 movw r20, r22 33432: bc 01 movw r22, r24 33434: 80 91 35 13 lds r24, 0x1335 ; 0x801335 33438: 90 91 36 13 lds r25, 0x1336 ; 0x801336 3343c: a0 91 37 13 lds r26, 0x1337 ; 0x801337 33440: b0 91 38 13 lds r27, 0x1338 ; 0x801338 33444: 88 51 subi r24, 0x18 ; 24 33446: 9c 4f sbci r25, 0xFC ; 252 33448: af 4f sbci r26, 0xFF ; 255 3344a: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 3344c: 48 17 cp r20, r24 3344e: 59 07 cpc r21, r25 33450: 6a 07 cpc r22, r26 33452: 7b 07 cpc r23, r27 33454: 08 f4 brcc .+2 ; 0x33458 33456: af cf rjmp .-162 ; 0x333b6 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 33458: 0f 94 47 98 call 0x3308e ; 0x3308e 3345c: 1c c0 rjmp .+56 ; 0x33496 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3345e: 0f 94 55 3e call 0x27caa ; 0x27caa 33462: ab 01 movw r20, r22 33464: bc 01 movw r22, r24 33466: 80 91 35 13 lds r24, 0x1335 ; 0x801335 3346a: 90 91 36 13 lds r25, 0x1336 ; 0x801336 3346e: a0 91 37 13 lds r26, 0x1337 ; 0x801337 33472: b0 91 38 13 lds r27, 0x1338 ; 0x801338 33476: 88 51 subi r24, 0x18 ; 24 33478: 9c 4f sbci r25, 0xFC ; 252 3347a: af 4f sbci r26, 0xFF ; 255 3347c: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 3347e: 48 17 cp r20, r24 33480: 59 07 cpc r21, r25 33482: 6a 07 cpc r22, r26 33484: 7b 07 cpc r23, r27 33486: 40 f7 brcc .-48 ; 0x33458 }; 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(); 33488: 0f 94 e2 c2 call 0x385c4 ; 0x385c4 if (fs != lastFSensor) { 3348c: 90 91 6a 13 lds r25, 0x136A ; 0x80136a 33490: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 33492: 0f 94 66 98 call 0x330cc ; 0x330cc // 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; 33496: 10 e0 ldi r17, 0x00 ; 0 33498: 78 c2 rjmp .+1264 ; 0x3398a StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 3349a: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 3349c: d1 2c mov r13, r1 3349e: 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; 334a0: 99 24 eor r9, r9 334a2: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 334a4: 55 e0 ldi r21, 0x05 ; 5 334a6: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 334a8: 63 e0 ldi r22, 0x03 ; 3 334aa: 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; 334ac: 74 e0 ldi r23, 0x04 ; 4 334ae: 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; 334b0: e2 e0 ldi r30, 0x02 ; 2 334b2: 6e 2e mov r6, r30 334b4: 66 c0 rjmp .+204 ; 0x33582 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 334b6: 23 30 cpi r18, 0x03 ; 3 334b8: 09 f4 brne .+2 ; 0x334bc 334ba: e0 c0 rjmp .+448 ; 0x3367c 334bc: 24 30 cpi r18, 0x04 ; 4 334be: 09 f0 breq .+2 ; 0x334c2 334c0: 83 c0 rjmp .+262 ; 0x335c8 } 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'); 334c2: 20 ed ldi r18, 0xD0 ; 208 334c4: 28 0f add r18, r24 334c6: 2a 30 cpi r18, 0x0A ; 10 334c8: 08 f4 brcc .+2 ; 0x334cc 334ca: f8 c0 rjmp .+496 ; 0x336bc 334cc: 2f e9 ldi r18, 0x9F ; 159 334ce: 28 0f add r18, r24 334d0: 26 30 cpi r18, 0x06 ; 6 334d2: 08 f4 brcc .+2 ; 0x334d6 334d4: f3 c0 rjmp .+486 ; 0x336bc ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 334d6: 8a 30 cpi r24, 0x0A ; 10 334d8: 09 f0 breq .+2 ; 0x334dc 334da: fa c0 rjmp .+500 ; 0x336d0 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()) { 334dc: 40 90 4f 13 lds r4, 0x134F ; 0x80134f 334e0: 8b e4 ldi r24, 0x4B ; 75 334e2: 93 e1 ldi r25, 0x13 ; 19 334e4: 0f 94 79 c2 call 0x384f2 ; 0x384f2 334e8: 48 12 cpse r4, r24 334ea: b8 c0 rjmp .+368 ; 0x3365c // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 334ec: 10 92 4a 13 sts 0x134A, r1 ; 0x80134a /// @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; } 334f0: 88 e0 ldi r24, 0x08 ; 8 334f2: eb e4 ldi r30, 0x4B ; 75 334f4: f3 e1 ldi r31, 0x13 ; 19 334f6: de 01 movw r26, r28 334f8: 51 96 adiw r26, 0x11 ; 17 334fa: 01 90 ld r0, Z+ 334fc: 0d 92 st X+, r0 334fe: 8a 95 dec r24 33500: e1 f7 brne .-8 ; 0x334fa 33502: 88 e0 ldi r24, 0x08 ; 8 33504: fe 01 movw r30, r28 33506: 71 96 adiw r30, 0x11 ; 17 33508: de 01 movw r26, r28 3350a: 59 96 adiw r26, 0x19 ; 25 3350c: 01 90 ld r0, Z+ 3350e: 0d 92 st X+, r0 33510: 8a 95 dec r24 33512: e1 f7 brne .-8 ; 0x3350c while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 33514: 88 e0 ldi r24, 0x08 ; 8 33516: fe 01 movw r30, r28 33518: 79 96 adiw r30, 0x19 ; 25 3351a: ab e3 ldi r26, 0x3B ; 59 3351c: b3 e1 ldi r27, 0x13 ; 19 3351e: 01 90 ld r0, Z+ 33520: 0d 92 st X+, r0 33522: 8a 95 dec r24 33524: e1 f7 brne .-8 ; 0x3351e } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 33526: 8c e3 ldi r24, 0x3C ; 60 33528: 89 83 std Y+1, r24 ; 0x01 3352a: fe 01 movw r30, r28 3352c: 32 96 adiw r30, 0x02 ; 2 3352e: a3 e5 ldi r26, 0x53 ; 83 33530: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 33532: 20 e0 ldi r18, 0x00 ; 0 33534: cf 01 movw r24, r30 33536: 52 16 cp r5, r18 33538: 09 f4 brne .+2 ; 0x3353c 3353a: cd c0 rjmp .+410 ; 0x336d6 uint8_t b = lastReceivedBytes[i]; 3353c: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 3353e: 40 ee ldi r20, 0xE0 ; 224 33540: 43 0f add r20, r19 33542: 40 36 cpi r20, 0x60 ; 96 33544: 08 f0 brcs .+2 ; 0x33548 b = '.'; 33546: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 33548: 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) { 3354a: 2f 5f subi r18, 0xFF ; 255 3354c: f4 cf rjmp .-24 ; 0x33536 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 3354e: 8e 34 cpi r24, 0x4E ; 78 33550: 08 f0 brcs .+2 ; 0x33554 33552: 56 c0 rjmp .+172 ; 0x33600 33554: 8b 34 cpi r24, 0x4B ; 75 33556: 08 f0 brcs .+2 ; 0x3355a 33558: 46 c0 rjmp .+140 ; 0x335e6 3355a: 82 34 cpi r24, 0x42 ; 66 3355c: 09 f4 brne .+2 ; 0x33560 3355e: 43 c0 rjmp .+134 ; 0x335e6 33560: e0 f5 brcc .+120 ; 0x335da 33562: 8a 30 cpi r24, 0x0A ; 10 33564: 59 f0 breq .+22 ; 0x3357c 33566: 8d 30 cpi r24, 0x0D ; 13 33568: 49 f0 breq .+18 ; 0x3357c } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 3356a: b0 92 4a 13 sts 0x134A, r11 ; 0x80134a 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') { 3356e: a1 10 cpse r10, r1 33570: 05 c1 rjmp .+522 ; 0x3377c 33572: 1f 36 cpi r17, 0x6F ; 111 33574: 09 f0 breq .+2 ; 0x33578 33576: fc c3 rjmp .+2040 ; 0x33d70 ++ok; 33578: aa 24 eor r10, r10 3357a: 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; 3357c: 4f ef ldi r20, 0xFF ; 255 3357e: c4 1a sub r12, r20 33580: d4 0a sbc r13, r20 33582: 8f e6 ldi r24, 0x6F ; 111 33584: 92 e1 ldi r25, 0x12 ; 18 33586: 0f 94 3b db call 0x3b676 ; 0x3b676 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) { 3358a: 97 fd sbrc r25, 7 3358c: 00 c1 rjmp .+512 ; 0x3378e ++bytesConsumed; RecordReceivedByte(c); 3358e: 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]; 33590: 20 91 63 13 lds r18, 0x1363 ; 0x801363 33594: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 33596: f9 01 movw r30, r18 33598: ea 5d subi r30, 0xDA ; 218 3359a: fc 4e sbci r31, 0xEC ; 236 3359c: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 3359e: 79 01 movw r14, r18 335a0: ef ef ldi r30, 0xFF ; 255 335a2: ee 1a sub r14, r30 335a4: fe 0a sbc r15, r30 335a6: ff e0 ldi r31, 0x0F ; 15 335a8: ef 22 and r14, r31 335aa: ff 24 eor r15, r15 335ac: 5e 2c mov r5, r14 335ae: e0 92 63 13 sts 0x1363, r14 ; 0x801363 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 335b2: 20 91 4a 13 lds r18, 0x134A ; 0x80134a 335b6: 22 30 cpi r18, 0x02 ; 2 335b8: 09 f4 brne .+2 ; 0x335bc 335ba: 48 c0 rjmp .+144 ; 0x3364c 335bc: 08 f0 brcs .+2 ; 0x335c0 335be: 7b cf rjmp .-266 ; 0x334b6 335c0: 22 23 and r18, r18 335c2: 29 f2 breq .-118 ; 0x3354e 335c4: 21 30 cpi r18, 0x01 ; 1 335c6: 51 f1 breq .+84 ; 0x3361c ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 335c8: 1a 30 cpi r17, 0x0A ; 10 335ca: 09 f4 brne .+2 ; 0x335ce 335cc: 8f cf rjmp .-226 ; 0x334ec 335ce: 1d 30 cpi r17, 0x0D ; 13 335d0: 09 f4 brne .+2 ; 0x335d4 335d2: 8c cf rjmp .-232 ; 0x334ec default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 335d4: 10 92 50 13 sts 0x1350, r1 ; 0x801350 335d8: ca cf rjmp .-108 ; 0x3356e } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 335da: 85 34 cpi r24, 0x45 ; 69 335dc: 30 f2 brcs .-116 ; 0x3356a 335de: 87 34 cpi r24, 0x47 ; 71 335e0: 10 f0 brcs .+4 ; 0x335e6 335e2: 88 34 cpi r24, 0x48 ; 72 335e4: 11 f6 brne .-124 ; 0x3356a case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 335e6: 80 93 4b 13 sts 0x134B, r24 ; 0x80134b responseMsg.request.value = 0; 335ea: 10 92 4c 13 sts 0x134C, r1 ; 0x80134c responseMsg.request.value2 = 0; 335ee: 10 92 4e 13 sts 0x134E, r1 ; 0x80134e 335f2: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d responseMsg.request.crc8 = 0; 335f6: 10 92 4f 13 sts 0x134F, r1 ; 0x80134f rspState = ResponseStates::RequestValue; 335fa: 90 92 4a 13 sts 0x134A, r9 ; 0x80134a 335fe: be cf rjmp .-132 ; 0x3357c } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33600: 89 35 cpi r24, 0x59 ; 89 33602: 40 f4 brcc .+16 ; 0x33614 33604: 87 35 cpi r24, 0x57 ; 87 33606: 78 f7 brcc .-34 ; 0x335e6 33608: 20 eb ldi r18, 0xB0 ; 176 3360a: 28 0f add r18, r24 3360c: 26 30 cpi r18, 0x06 ; 6 3360e: 08 f0 brcs .+2 ; 0x33612 33610: ac cf rjmp .-168 ; 0x3356a 33612: e9 cf rjmp .-46 ; 0x335e6 33614: 86 36 cpi r24, 0x66 ; 102 33616: 09 f0 breq .+2 ; 0x3361a 33618: a8 cf rjmp .-176 ; 0x3356a 3361a: e5 cf rjmp .-54 ; 0x335e6 } 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'); 3361c: 20 ed ldi r18, 0xD0 ; 208 3361e: 28 0f add r18, r24 33620: 2a 30 cpi r18, 0x0A ; 10 33622: 50 f0 brcs .+20 ; 0x33638 33624: 2f e9 ldi r18, 0x9F ; 159 33626: 28 0f add r18, r24 33628: 26 30 cpi r18, 0x06 ; 6 3362a: 30 f0 brcs .+12 ; 0x33638 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 3362c: 80 32 cpi r24, 0x20 ; 32 3362e: 09 f0 breq .+2 ; 0x33632 33630: 9c cf rjmp .-200 ; 0x3356a rspState = ResponseStates::ParamCode; 33632: 60 92 4a 13 sts 0x134A, r6 ; 0x80134a 33636: a2 cf rjmp .-188 ; 0x3357c return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 33638: 0f 94 58 c2 call 0x384b0 ; 0x384b0 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 3363c: 90 91 4c 13 lds r25, 0x134C ; 0x80134c 33640: 92 95 swap r25 33642: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 33644: 89 0f add r24, r25 33646: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c 3364a: 98 cf rjmp .-208 ; 0x3357c } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 3364c: 87 34 cpi r24, 0x47 ; 71 3364e: 48 f4 brcc .+18 ; 0x33662 33650: 85 34 cpi r24, 0x45 ; 69 33652: 58 f4 brcc .+22 ; 0x3366a 33654: 2f eb ldi r18, 0xBF ; 191 33656: 28 0f add r18, r24 33658: 22 30 cpi r18, 0x02 ; 2 3365a: 38 f0 brcs .+14 ; 0x3366a return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 3365c: 10 92 50 13 sts 0x1350, r1 ; 0x801350 33660: 84 cf rjmp .-248 ; 0x3356a } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 33662: 80 35 cpi r24, 0x50 ; 80 33664: 11 f0 breq .+4 ; 0x3366a 33666: 82 35 cpi r24, 0x52 ; 82 33668: c9 f7 brne .-14 ; 0x3365c case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 3366a: 80 92 4a 13 sts 0x134A, r8 ; 0x80134a responseMsg.paramCode = (ResponseMsgParamCodes)c; 3366e: 80 93 50 13 sts 0x1350, r24 ; 0x801350 responseMsg.paramValue = 0; 33672: 10 92 52 13 sts 0x1352, r1 ; 0x801352 33676: 10 92 51 13 sts 0x1351, r1 ; 0x801351 3367a: 80 cf rjmp .-256 ; 0x3357c 3367c: 20 ed ldi r18, 0xD0 ; 208 3367e: 28 0f add r18, r24 33680: 2a 30 cpi r18, 0x0A ; 10 33682: 48 f0 brcs .+18 ; 0x33696 33684: 2f e9 ldi r18, 0x9F ; 159 33686: 28 0f add r18, r24 33688: 26 30 cpi r18, 0x06 ; 6 3368a: 28 f0 brcs .+10 ; 0x33696 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 3368c: 8a 32 cpi r24, 0x2A ; 42 3368e: 31 f7 brne .-52 ; 0x3365c rspState = ResponseStates::CRC; 33690: 70 92 4a 13 sts 0x134A, r7 ; 0x80134a 33694: 73 cf rjmp .-282 ; 0x3357c return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 33696: 0f 94 58 c2 call 0x384b0 ; 0x384b0 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 3369a: 20 91 51 13 lds r18, 0x1351 ; 0x801351 3369e: 30 91 52 13 lds r19, 0x1352 ; 0x801352 336a2: 44 e0 ldi r20, 0x04 ; 4 336a4: 22 0f add r18, r18 336a6: 33 1f adc r19, r19 336a8: 4a 95 dec r20 336aa: e1 f7 brne .-8 ; 0x336a4 responseMsg.paramValue += Char2Nibble(c); 336ac: 82 0f add r24, r18 336ae: 93 2f mov r25, r19 336b0: 91 1d adc r25, r1 336b2: 90 93 52 13 sts 0x1352, r25 ; 0x801352 336b6: 80 93 51 13 sts 0x1351, r24 ; 0x801351 336ba: 60 cf rjmp .-320 ; 0x3357c return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 336bc: 0f 94 58 c2 call 0x384b0 ; 0x384b0 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 336c0: 90 91 4f 13 lds r25, 0x134F ; 0x80134f 336c4: 92 95 swap r25 336c6: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 336c8: 89 0f add r24, r25 336ca: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f 336ce: 56 cf rjmp .-340 ; 0x3357c ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 336d0: 8d 30 cpi r24, 0x0D ; 13 336d2: 21 f6 brne .-120 ; 0x3365c 336d4: 03 cf rjmp .-506 ; 0x334dc if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 336d6: e8 0e add r14, r24 336d8: f9 1e adc r15, r25 336da: f7 01 movw r30, r14 336dc: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 336de: 10 92 63 13 sts 0x1363, r1 ; 0x801363 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 336e2: 84 e1 ldi r24, 0x14 ; 20 336e4: 9b ea ldi r25, 0xAB ; 171 336e6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 336ea: 8e e0 ldi r24, 0x0E ; 14 336ec: 9b ea ldi r25, 0xAB ; 171 336ee: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 336f2: ce 01 movw r24, r28 336f4: 01 96 adiw r24, 0x01 ; 1 336f6: 0f 94 14 d6 call 0x3ac28 ; 0x3ac28 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 336fa: 0f 94 0e 6f call 0x2de1c ; 0x2de1c if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 336fe: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33702: 81 30 cpi r24, 0x01 ; 1 33704: 09 f4 brne .+2 ; 0x33708 33706: 74 c0 rjmp .+232 ; 0x337f0 33708: 08 f4 brcc .+2 ; 0x3370c 3370a: c5 ce rjmp .-630 ; 0x33496 3370c: 83 30 cpi r24, 0x03 ; 3 3370e: 09 f4 brne .+2 ; 0x33712 33710: d1 c0 rjmp .+418 ; 0x338b4 33712: 84 30 cpi r24, 0x04 ; 4 33714: 09 f0 breq .+2 ; 0x33718 33716: 4f ce rjmp .-866 ; 0x333b6 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33718: 80 91 29 13 lds r24, 0x1329 ; 0x801329 3371c: 86 30 cpi r24, 0x06 ; 6 3371e: 09 f4 brne .+2 ; 0x33722 33720: 6c c1 rjmp .+728 ; 0x339fa 33722: 08 f0 brcs .+2 ; 0x33726 33724: 93 c1 rjmp .+806 ; 0x33a4c 33726: 84 30 cpi r24, 0x04 ; 4 33728: 09 f4 brne .+2 ; 0x3372c 3372a: 09 c1 rjmp .+530 ; 0x3393e 3372c: 85 30 cpi r24, 0x05 ; 5 3372e: 09 f0 breq .+2 ; 0x33732 33730: cc c0 rjmp .+408 ; 0x338ca case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 33732: 80 91 40 13 lds r24, 0x1340 ; 0x801340 33736: 81 34 cpi r24, 0x41 ; 65 33738: 09 f4 brne .+2 ; 0x3373c 3373a: 96 c1 rjmp .+812 ; 0x33a68 3373c: 82 35 cpi r24, 0x52 ; 82 3373e: 09 f0 breq .+2 ; 0x33742 33740: c4 c0 rjmp .+392 ; 0x338ca errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 33742: 10 92 68 13 sts 0x1368, r1 ; 0x801368 errorCode = ErrorCode::PROTOCOL_ERROR; 33746: 8d e2 ldi r24, 0x2D ; 45 33748: 90 e8 ldi r25, 0x80 ; 128 3374a: 90 93 67 13 sts 0x1367, r25 ; 0x801367 3374e: 80 93 66 13 sts 0x1366, r24 ; 0x801366 } 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")); 33752: 87 e9 ldi r24, 0x97 ; 151 33754: 98 ea ldi r25, 0xA8 ; 168 33756: 0f 94 2b 6f call 0x2de56 ; 0x2de56 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3375a: 85 e0 ldi r24, 0x05 ; 5 3375c: 80 93 29 13 sts 0x1329, r24 ; 0x801329 SendMsg(rq); 33760: 40 91 2b 13 lds r20, 0x132B ; 0x80132b 33764: 50 91 2c 13 lds r21, 0x132C ; 0x80132c 33768: 60 91 2d 13 lds r22, 0x132D ; 0x80132d 3376c: 70 91 2e 13 lds r23, 0x132E ; 0x80132e 33770: 80 91 2f 13 lds r24, 0x132F ; 0x80132f 33774: 0f 94 14 70 call 0x2e028 ; 0x2e028 33778: 16 e0 ldi r17, 0x06 ; 6 3377a: 07 c1 rjmp .+526 ; 0x3398a 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') { 3377c: 1b 36 cpi r17, 0x6B ; 107 3377e: 09 f0 breq .+2 ; 0x33782 33780: f7 c2 rjmp .+1518 ; 0x33d70 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")); 33782: 88 e7 ldi r24, 0x78 ; 120 33784: 98 ea ldi r25, 0xA8 ; 168 33786: 0f 94 2b 6f call 0x2de56 ; 0x2de56 3378a: 18 e0 ldi r17, 0x08 ; 8 3378c: fe c0 rjmp .+508 ; 0x3398a default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 3378e: cd 28 or r12, r13 33790: 19 f0 breq .+6 ; 0x33798 RecordUARTActivity(); // something has happened on the UART, update the timeout record 33792: 0f 94 0e 6f call 0x2de1c ; 0x2de1c 33796: 7f ce rjmp .-770 ; 0x33496 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33798: 0f 94 55 3e call 0x27caa ; 0x27caa 3379c: ab 01 movw r20, r22 3379e: bc 01 movw r22, r24 337a0: 80 91 35 13 lds r24, 0x1335 ; 0x801335 337a4: 90 91 36 13 lds r25, 0x1336 ; 0x801336 337a8: a0 91 37 13 lds r26, 0x1337 ; 0x801337 337ac: b0 91 38 13 lds r27, 0x1338 ; 0x801338 337b0: 80 53 subi r24, 0x30 ; 48 337b2: 98 4f sbci r25, 0xF8 ; 248 337b4: af 4f sbci r26, 0xFF ; 255 337b6: 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) { 337b8: 48 17 cp r20, r24 337ba: 59 07 cpc r21, r25 337bc: 6a 07 cpc r22, r26 337be: 7b 07 cpc r23, r27 337c0: 08 f4 brcc .+2 ; 0x337c4 337c2: 69 ce rjmp .-814 ; 0x33496 337c4: 80 91 28 13 lds r24, 0x1328 ; 0x801328 337c8: 88 23 and r24, r24 337ca: 09 f4 brne .+2 ; 0x337ce 337cc: 64 ce rjmp .-824 ; 0x33496 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 337ce: 10 92 4a 13 sts 0x134A, r1 ; 0x80134a initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 337d2: 81 e0 ldi r24, 0x01 ; 1 337d4: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::StartSeq; 337d8: 80 93 28 13 sts 0x1328, r24 ; 0x801328 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 337dc: 86 e0 ldi r24, 0x06 ; 6 337de: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a SendVersion(0); 337e2: 80 e0 ldi r24, 0x00 ; 0 337e4: 0f 94 26 98 call 0x3304c ; 0x3304c StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 337e8: 64 e0 ldi r22, 0x04 ; 4 337ea: 80 e5 ldi r24, 0x50 ; 80 337ec: 98 ea ldi r25, 0xA8 ; 168 337ee: 79 c0 rjmp .+242 ; 0x338e2 return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 337f0: 10 91 29 13 lds r17, 0x1329 ; 0x801329 337f4: 13 30 cpi r17, 0x03 ; 3 337f6: b1 f1 breq .+108 ; 0x33864 337f8: 60 f0 brcs .+24 ; 0x33812 337fa: 16 30 cpi r17, 0x06 ; 6 337fc: 09 f4 brne .+2 ; 0x33800 337fe: 50 c0 rjmp .+160 ; 0x338a0 33800: 19 30 cpi r17, 0x09 ; 9 33802: 09 f0 breq .+2 ; 0x33806 33804: be cf rjmp .-132 ; 0x33782 // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 33806: 0f 94 3e 71 call 0x2e27c ; 0x2e27c 3380a: 88 23 and r24, r24 3380c: 09 f4 brne .+2 ; 0x33810 3380e: 43 ce rjmp .-890 ; 0x33496 33810: 40 ce rjmp .-896 ; 0x33492 void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 33812: 80 91 3b 13 lds r24, 0x133B ; 0x80133b 33816: 83 35 cpi r24, 0x53 ; 83 33818: 21 f4 brne .+8 ; 0x33822 3381a: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 3381e: 18 17 cp r17, r24 33820: 11 f0 breq .+4 ; 0x33826 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 33822: 81 2f mov r24, r17 33824: fe cd rjmp .-1028 ; 0x33422 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; 33826: 80 91 41 13 lds r24, 0x1341 ; 0x801341 3382a: e1 2f mov r30, r17 3382c: f0 e0 ldi r31, 0x00 ; 0 3382e: df 01 movw r26, r30 33830: ab 58 subi r26, 0x8B ; 139 33832: bc 4e sbci r27, 0xEC ; 236 33834: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 33836: eb 58 subi r30, 0x8B ; 139 33838: f7 45 sbci r31, 0x57 ; 87 3383a: e4 91 lpm r30, Z 3383c: 8e 17 cp r24, r30 3383e: 41 f0 breq .+16 ; 0x33850 if (--retries == 0) { 33840: 80 91 2a 13 lds r24, 0x132A ; 0x80132a 33844: 81 50 subi r24, 0x01 ; 1 33846: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a 3384a: 81 11 cpse r24, r1 3384c: ea cf rjmp .-44 ; 0x33822 3384e: 99 cf rjmp .-206 ; 0x33782 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 33850: 87 eb ldi r24, 0xB7 ; 183 33852: 9a ea ldi r25, 0xAA ; 170 33854: 0e 94 97 7b call 0xf72e ; 0xf72e /// @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; } 33858: 8a e0 ldi r24, 0x0A ; 10 3385a: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 3385e: 81 e0 ldi r24, 0x01 ; 1 33860: 81 0f add r24, r17 33862: df cd rjmp .-1090 ; 0x33422 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) { 33864: 80 91 3b 13 lds r24, 0x133B ; 0x80133b 33868: 83 35 cpi r24, 0x53 ; 83 3386a: 21 f4 brne .+8 ; 0x33874 3386c: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 33870: 83 30 cpi r24, 0x03 ; 3 33872: 11 f0 breq .+4 ; 0x33878 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 33874: 83 e0 ldi r24, 0x03 ; 3 33876: d5 cd rjmp .-1110 ; 0x33422 } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 33878: 80 91 41 13 lds r24, 0x1341 ; 0x801341 3387c: 90 91 42 13 lds r25, 0x1342 ; 0x801342 33880: 90 93 79 13 sts 0x1379, r25 ; 0x801379 33884: 80 93 78 13 sts 0x1378, r24 ; 0x801378 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 33888: 10 92 74 13 sts 0x1374, r1 ; 0x801374 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 3388c: e5 eb ldi r30, 0xB5 ; 181 3388e: fa ea ldi r31, 0xAA ; 170 33890: 84 91 lpm r24, Z 33892: 60 91 72 13 lds r22, 0x1372 ; 0x801372 33896: 70 e0 ldi r23, 0x00 ; 0 33898: 49 e0 ldi r20, 0x09 ; 9 3389a: 0f 94 7f 70 call 0x2e0fe ; 0x2e0fe 3389e: fb cd rjmp .-1034 ; 0x33496 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 338a0: 82 e0 ldi r24, 0x02 ; 2 338a2: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::Idle; 338a6: 83 e0 ldi r24, 0x03 ; 3 338a8: 80 93 28 13 sts 0x1328, r24 ; 0x801328 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 338ac: 82 e8 ldi r24, 0x82 ; 130 338ae: 80 93 29 13 sts 0x1329, r24 ; 0x801329 338b2: d2 cd rjmp .-1116 ; 0x33458 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 338b4: 80 91 29 13 lds r24, 0x1329 ; 0x801329 338b8: 88 30 cpi r24, 0x08 ; 8 338ba: 09 f4 brne .+2 ; 0x338be 338bc: b7 c0 rjmp .+366 ; 0x33a2c 338be: a8 f4 brcc .+42 ; 0x338ea 338c0: 84 30 cpi r24, 0x04 ; 4 338c2: d9 f0 breq .+54 ; 0x338fa 338c4: 87 30 cpi r24, 0x07 ; 7 338c6: 09 f4 brne .+2 ; 0x338ca 338c8: ae c0 rjmp .+348 ; 0x33a26 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 338ca: 81 e0 ldi r24, 0x01 ; 1 338cc: 80 93 43 13 sts 0x1343, r24 ; 0x801343 currentScope = Scope::DelayedRestart; 338d0: 82 e0 ldi r24, 0x02 ; 2 338d2: 80 93 28 13 sts 0x1328, r24 ; 0x801328 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 338d6: 83 e8 ldi r24, 0x83 ; 131 338d8: 80 93 29 13 sts 0x1329, r24 ; 0x801329 StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 338dc: 65 e0 ldi r22, 0x05 ; 5 338de: 86 e6 ldi r24, 0x66 ; 102 338e0: 98 ea ldi r25, 0xA8 ; 168 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 338e2: 0f 94 9c 6f call 0x2df38 ; 0x2df38 338e6: 18 2f mov r17, r24 338e8: 50 c0 rjmp .+160 ; 0x3398a } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 338ea: 8a 30 cpi r24, 0x0A ; 10 338ec: 09 f4 brne .+2 ; 0x338f0 338ee: a7 c0 rjmp .+334 ; 0x33a3e 338f0: 60 f3 brcs .-40 ; 0x338ca 338f2: 8d 30 cpi r24, 0x0D ; 13 338f4: 08 f4 brcc .+2 ; 0x338f8 338f6: 5f cd rjmp .-1346 ; 0x333b6 338f8: e8 cf rjmp .-48 ; 0x338ca 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) { 338fa: 80 91 3b 13 lds r24, 0x133B ; 0x80133b 338fe: 8e 34 cpi r24, 0x4E ; 78 33900: 60 f5 brcc .+88 ; 0x3395a 33902: 8b 34 cpi r24, 0x4B ; 75 33904: 10 f4 brcc .+4 ; 0x3390a 33906: 85 34 cpi r24, 0x45 ; 69 33908: 01 f7 brne .-64 ; 0x338ca case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 3390a: 80 91 40 13 lds r24, 0x1340 ; 0x801340 3390e: 86 34 cpi r24, 0x46 ; 70 33910: 09 f4 brne .+2 ; 0x33914 33912: 73 c0 rjmp .+230 ; 0x339fa return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 33914: 84 e0 ldi r24, 0x04 ; 4 33916: 80 93 28 13 sts 0x1328, r24 ; 0x801328 3391a: 85 e0 ldi r24, 0x05 ; 5 3391c: eb e3 ldi r30, 0x3B ; 59 3391e: f3 e1 ldi r31, 0x13 ; 19 33920: de 01 movw r26, r28 33922: 11 96 adiw r26, 0x01 ; 1 33924: 01 90 ld r0, Z+ 33926: 0d 92 st X+, r0 33928: 8a 95 dec r24 3392a: e1 f7 brne .-8 ; 0x33924 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 3392c: 85 e0 ldi r24, 0x05 ; 5 3392e: fe 01 movw r30, r28 33930: 31 96 adiw r30, 0x01 ; 1 33932: ab e2 ldi r26, 0x2B ; 43 33934: b3 e1 ldi r27, 0x13 ; 19 33936: 01 90 ld r0, Z+ 33938: 0d 92 st X+, r0 3393a: 8a 95 dec r24 3393c: e1 f7 brne .-8 ; 0x33936 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 3393e: 0f 94 89 98 call 0x33112 ; 0x33112 33942: 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) { 33944: 85 30 cpi r24, 0x05 ; 5 33946: 09 f2 breq .-126 ; 0x338ca 33948: 08 f0 brcs .+2 ; 0x3394c 3394a: 9c c0 rjmp .+312 ; 0x33a84 3394c: 82 30 cpi r24, 0x02 ; 2 3394e: 09 f4 brne .+2 ; 0x33952 33950: 32 cd rjmp .-1436 ; 0x333b6 33952: 84 30 cpi r24, 0x04 ; 4 33954: 09 f4 brne .+2 ; 0x33958 33956: 3b cf rjmp .-394 ; 0x337ce 33958: 18 c0 rjmp .+48 ; 0x3398a 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) { 3395a: 84 35 cpi r24, 0x54 ; 84 3395c: 08 f4 brcc .+2 ; 0x33960 3395e: b5 cf rjmp .-150 ; 0x338ca 33960: 86 35 cpi r24, 0x56 ; 86 33962: 98 f2 brcs .-90 ; 0x3390a 33964: 88 35 cpi r24, 0x58 ; 88 33966: 09 f0 breq .+2 ; 0x3396a 33968: b0 cf rjmp .-160 ; 0x338ca 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) { 3396a: 80 91 40 13 lds r24, 0x1340 ; 0x801340 3396e: 86 34 cpi r24, 0x46 ; 70 33970: 89 f1 breq .+98 ; 0x339d4 33972: 80 35 cpi r24, 0x50 ; 80 33974: c1 f1 breq .+112 ; 0x339e6 33976: 82 34 cpi r24, 0x42 ; 66 33978: 09 f0 breq .+2 ; 0x3397c 3397a: 42 c0 rjmp .+132 ; 0x33a00 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); 3397c: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33980: 80 93 69 13 sts 0x1369, r24 ; 0x801369 StartReading8bitRegisters(); 33984: 0f 94 37 97 call 0x32e6e ; 0x32e6e return ButtonPushed; 33988: 1b e0 ldi r17, 0x0B ; 11 3398a: 80 91 26 13 lds r24, 0x1326 ; 0x801326 3398e: 90 91 27 13 lds r25, 0x1327 ; 0x801327 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 33992: 81 30 cpi r24, 0x01 ; 1 33994: 91 05 cpc r25, r1 33996: 09 f0 breq .+2 ; 0x3399a 33998: ee c1 rjmp .+988 ; 0x33d76 const StepStatus ss = logic.Step(); switch (ss) { 3399a: 12 30 cpi r17, 0x02 ; 2 3399c: 09 f4 brne .+2 ; 0x339a0 3399e: 90 c0 rjmp .+288 ; 0x33ac0 339a0: 08 f0 brcs .+2 ; 0x339a4 339a2: 7d c0 rjmp .+250 ; 0x33a9e 339a4: 11 23 and r17, r17 339a6: 09 f4 brne .+2 ; 0x339aa 339a8: 18 c1 rjmp .+560 ; 0x33bda case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 339aa: 00 23 and r16, r16 339ac: 09 f4 brne .+2 ; 0x339b0 339ae: e4 c0 rjmp .+456 ; 0x33b78 switch (ss) { 339b0: 17 30 cpi r17, 0x07 ; 7 339b2: 09 f4 brne .+2 ; 0x339b6 339b4: c4 c1 rjmp .+904 ; 0x33d3e 339b6: 08 f0 brcs .+2 ; 0x339ba 339b8: b8 c1 rjmp .+880 ; 0x33d2a 339ba: 14 30 cpi r17, 0x04 ; 4 339bc: 09 f4 brne .+2 ; 0x339c0 339be: c7 c1 rjmp .+910 ; 0x33d4e 339c0: 15 30 cpi r17, 0x05 ; 5 339c2: 09 f0 breq .+2 ; 0x339c6 339c4: d9 c0 rjmp .+434 ; 0x33b78 state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 339c6: 82 e0 ldi r24, 0x02 ; 2 339c8: 80 93 95 13 sts 0x1395, r24 ; 0x801395 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 339cc: 60 e0 ldi r22, 0x00 ; 0 339ce: 8d e2 ldi r24, 0x2D ; 45 339d0: 90 e8 ldi r25, 0x80 ; 128 339d2: ba c1 rjmp .+884 ; 0x33d48 // 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) { 339d4: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 339d8: 88 23 and r24, r24 339da: 29 f0 breq .+10 ; 0x339e6 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 339dc: 82 e8 ldi r24, 0x82 ; 130 339de: 80 93 29 13 sts 0x1329, r24 ; 0x801329 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; 339e2: 13 e0 ldi r17, 0x03 ; 3 339e4: d2 cf rjmp .-92 ; 0x3398a } [[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); 339e6: 80 91 41 13 lds r24, 0x1341 ; 0x801341 339ea: 80 93 68 13 sts 0x1368, r24 ; 0x801368 errorCode = ErrorCode::OK; 339ee: 81 e0 ldi r24, 0x01 ; 1 339f0: 90 e0 ldi r25, 0x00 ; 0 339f2: 90 93 67 13 sts 0x1367, r25 ; 0x801367 339f6: 80 93 66 13 sts 0x1366, r24 ; 0x801366 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 339fa: 0f 94 37 97 call 0x32e6e ; 0x32e6e 339fe: 4b cd rjmp .-1386 ; 0x33496 // 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; 33a00: 8c e0 ldi r24, 0x0C ; 12 33a02: 80 93 68 13 sts 0x1368, r24 ; 0x801368 errorCode = static_cast(rsp.paramValue); 33a06: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33a0a: 90 91 42 13 lds r25, 0x1342 ; 0x801342 33a0e: 90 93 67 13 sts 0x1367, r25 ; 0x801367 33a12: 80 93 66 13 sts 0x1366, r24 ; 0x801366 StartReading8bitRegisters(); // continue Idle state without restarting the communication 33a16: 0f 94 37 97 call 0x32e6e ; 0x32e6e // @@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")); 33a1a: 89 e8 ldi r24, 0x89 ; 137 33a1c: 98 ea ldi r25, 0xA8 ; 168 33a1e: 0f 94 2b 6f call 0x2de56 ; 0x2de56 33a22: 17 e0 ldi r17, 0x07 ; 7 33a24: b2 cf rjmp .-156 ; 0x3398a return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 33a26: 0f 94 5b 97 call 0x32eb6 ; 0x32eb6 33a2a: 35 cd rjmp .-1430 ; 0x33496 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 33a2c: 82 e8 ldi r24, 0x82 ; 130 33a2e: 0f 94 3f 97 call 0x32e7e ; 0x32e7e 33a32: 80 93 29 13 sts 0x1329, r24 ; 0x801329 return scopeState == ScopeState::Ready ? Finished : Processing; 33a36: 82 38 cpi r24, 0x82 ; 130 33a38: 09 f0 breq .+2 ; 0x33a3c 33a3a: 2d cd rjmp .-1446 ; 0x33496 33a3c: bc cc rjmp .-1672 ; 0x333b6 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33a3e: 80 91 40 13 lds r24, 0x1340 ; 0x801340 33a42: 81 34 cpi r24, 0x41 ; 65 33a44: d1 f6 brne .-76 ; 0x339fa // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33a46: 0f 94 19 6f call 0x2de32 ; 0x2de32 33a4a: d7 cf rjmp .-82 ; 0x339fa return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33a4c: 88 30 cpi r24, 0x08 ; 8 33a4e: b1 f0 breq .+44 ; 0x33a7c 33a50: 50 f3 brcs .-44 ; 0x33a26 33a52: 8a 30 cpi r24, 0x0A ; 10 33a54: 09 f0 breq .+2 ; 0x33a58 33a56: 39 cf rjmp .-398 ; 0x338ca return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33a58: 80 91 40 13 lds r24, 0x1340 ; 0x801340 33a5c: 81 34 cpi r24, 0x41 ; 65 33a5e: 09 f0 breq .+2 ; 0x33a62 33a60: 18 cd rjmp .-1488 ; 0x33492 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33a62: 0f 94 19 6f call 0x2de32 ; 0x2de32 33a66: 15 cd rjmp .-1494 ; 0x33492 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; 33a68: 10 92 68 13 sts 0x1368, r1 ; 0x801368 errorCode = ErrorCode::RUNNING; 33a6c: 10 92 67 13 sts 0x1367, r1 ; 0x801367 33a70: 10 92 66 13 sts 0x1366, r1 ; 0x801366 scopeState = ScopeState::Wait; 33a74: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 33a76: 80 93 29 13 sts 0x1329, r24 ; 0x801329 33a7a: 0d cd rjmp .-1510 ; 0x33496 33a7c: 81 e8 ldi r24, 0x81 ; 129 33a7e: 0f 94 3f 97 call 0x32e7e ; 0x32e7e 33a82: f9 cf rjmp .-14 ; 0x33a76 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 33a84: 87 30 cpi r24, 0x07 ; 7 33a86: 49 f2 breq .-110 ; 0x33a1a 33a88: 08 f4 brcc .+2 ; 0x33a8c 33a8a: 63 ce rjmp .-826 ; 0x33752 33a8c: 88 30 cpi r24, 0x08 ; 8 33a8e: 09 f4 brne .+2 ; 0x33a92 33a90: 78 ce rjmp .-784 ; 0x33782 33a92: 7b cf rjmp .-266 ; 0x3398a // 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()) { 33a94: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33a98: 87 fd sbrc r24, 7 33a9a: 9a cc rjmp .-1740 ; 0x333d0 33a9c: fc cc rjmp .-1544 ; 0x33496 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 33a9e: 13 30 cpi r17, 0x03 ; 3 33aa0: 09 f4 brne .+2 ; 0x33aa4 33aa2: 6a c0 rjmp .+212 ; 0x33b78 33aa4: 1b 30 cpi r17, 0x0B ; 11 33aa6: 09 f0 breq .+2 ; 0x33aaa 33aa8: 80 cf rjmp .-256 ; 0x339aa case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 33aaa: 80 91 69 13 lds r24, 0x1369 ; 0x801369 33aae: 80 93 90 13 sts 0x1390, r24 ; 0x801390 LogEchoEvent_P(PSTR("MMU Button pushed")); 33ab2: 88 ea ldi r24, 0xA8 ; 168 33ab4: 98 ea ldi r25, 0xA8 ; 168 33ab6: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 CheckUserInput(); // Process the button immediately 33aba: 0f 94 f3 98 call 0x331e6 ; 0x331e6 33abe: 5c c0 rjmp .+184 ; 0x33b78 CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 33ac0: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 33ac4: 81 11 cpse r24, r1 33ac6: 58 c0 rjmp .+176 ; 0x33b78 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() 33ac8: 0e 94 d6 68 call 0xd1ac ; 0xd1ac && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 33acc: 88 23 and r24, r24 33ace: 09 f4 brne .+2 ; 0x33ad2 33ad0: 53 c0 rjmp .+166 ; 0x33b78 } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 33ad2: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 <_ZL17mcode_in_progress.lto_priv.548> 33ad6: 90 91 59 0e lds r25, 0x0E59 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.548+0x1> 33ada: 88 35 cpi r24, 0x58 ; 88 33adc: 92 40 sbci r25, 0x02 ; 2 33ade: 09 f4 brne .+2 ; 0x33ae2 33ae0: 4b c0 rjmp .+150 ; 0x33b78 && !saved_printing 33ae2: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 33ae6: 81 11 cpse r24, r1 33ae8: 47 c0 rjmp .+142 ; 0x33b78 && !mesh_bed_leveling_flag 33aea: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 33aee: 81 11 cpse r24, r1 33af0: 43 c0 rjmp .+134 ; 0x33b78 && !homing_flag 33af2: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 33af6: 81 11 cpse r24, r1 33af8: 3f c0 rjmp .+126 ; 0x33b78 bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 33afa: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 33afe: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 33b02: 98 17 cp r25, r24 33b04: c9 f1 breq .+114 ; 0x33b78 { uint8_t block_index = block_buffer_tail; 33b06: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 } #endif bool e_active() { unsigned char e_active = 0; 33b0a: 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++; 33b0c: 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) 33b0e: 30 91 53 0e lds r19, 0x0E53 ; 0x800e53 33b12: 38 17 cp r19, r24 33b14: 89 f0 breq .+34 ; 0x33b38 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 33b16: 28 9f mul r18, r24 33b18: f0 01 movw r30, r0 33b1a: 11 24 eor r1, r1 33b1c: ed 58 subi r30, 0x8D ; 141 33b1e: f8 4f sbci r31, 0xF8 ; 248 33b20: 44 85 ldd r20, Z+12 ; 0x0c 33b22: 55 85 ldd r21, Z+13 ; 0x0d 33b24: 66 85 ldd r22, Z+14 ; 0x0e 33b26: 77 85 ldd r23, Z+15 ; 0x0f 33b28: 45 2b or r20, r21 33b2a: 46 2b or r20, r22 33b2c: 47 2b or r20, r23 33b2e: 09 f0 breq .+2 ; 0x33b32 33b30: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 33b32: 8f 5f subi r24, 0xFF ; 255 33b34: 8f 70 andi r24, 0x0F ; 15 33b36: eb cf rjmp .-42 ; 0x33b0e && e_active(); 33b38: 99 23 and r25, r25 33b3a: f1 f0 breq .+60 ; 0x33b78 SERIAL_ECHOLNPGM("FINDA filament runout!"); 33b3c: 89 e3 ldi r24, 0x39 ; 57 33b3e: 98 ea ldi r25, 0xA8 ; 168 33b40: 0e 94 97 7b call 0xf72e ; 0xf72e 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); 33b44: 20 e0 ldi r18, 0x00 ; 0 33b46: 30 e0 ldi r19, 0x00 ; 0 33b48: a9 01 movw r20, r18 33b4a: ca 01 movw r24, r20 33b4c: b9 01 movw r22, r18 33b4e: 0e 94 f3 8a call 0x115e6 ; 0x115e6 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 33b52: 60 e0 ldi r22, 0x00 ; 0 33b54: 70 e0 ldi r23, 0x00 ; 0 33b56: cb 01 movw r24, r22 33b58: 0e 94 8a 69 call 0xd314 ; 0xd314 33b5c: 86 ed ldi r24, 0xD6 ; 214 33b5e: 9e e0 ldi r25, 0x0E ; 14 33b60: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 33b64: 81 30 cpi r24, 0x01 ; 1 33b66: 21 f4 brne .+8 ; 0x33b70 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 33b68: 0f 94 58 75 call 0x2eab0 ; 0x2eab0 33b6c: 8f 3f cpi r24, 0xFF ; 255 33b6e: 91 f5 brne .+100 ; 0x33bd4 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 33b70: 83 e6 ldi r24, 0x63 ; 99 33b72: 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 33b74: 0f 94 9c 75 call 0x2eb38 ; 0x2eb38 break; } } } if (logic.Running()) { 33b78: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33b7c: 82 30 cpi r24, 0x02 ; 2 33b7e: 19 f4 brne .+6 ; 0x33b86 state = xState::Active; 33b80: 81 e0 ldi r24, 0x01 ; 1 33b82: 80 93 95 13 sts 0x1395, r24 ; 0x801395 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 33b86: 10 93 94 13 sts 0x1394, r17 ; 0x801394 // 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) { 33b8a: 80 91 71 07 lds r24, 0x0771 ; 0x800771 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.506> 33b8e: 88 23 and r24, r24 33b90: 51 f0 breq .+20 ; 0x33ba6 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 33b92: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.512> 33b96: 81 11 cpse r24, r1 33b98: 06 c0 rjmp .+12 ; 0x33ba6 33b9a: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33b9e: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33ba2: 0f 94 35 c4 call 0x3886a ; 0x3886a CheckErrorScreenUserInput(); } 33ba6: a0 96 adiw r28, 0x20 ; 32 33ba8: 0f b6 in r0, 0x3f ; 63 33baa: f8 94 cli 33bac: de bf out 0x3e, r29 ; 62 33bae: 0f be out 0x3f, r0 ; 63 33bb0: cd bf out 0x3d, r28 ; 61 33bb2: df 91 pop r29 33bb4: cf 91 pop r28 33bb6: 1f 91 pop r17 33bb8: 0f 91 pop r16 33bba: ff 90 pop r15 33bbc: ef 90 pop r14 33bbe: df 90 pop r13 33bc0: cf 90 pop r12 33bc2: bf 90 pop r11 33bc4: af 90 pop r10 33bc6: 9f 90 pop r9 33bc8: 8f 90 pop r8 33bca: 7f 90 pop r7 33bcc: 6f 90 pop r6 33bce: 5f 90 pop r5 33bd0: 4f 90 pop r4 33bd2: 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 33bd4: 8f e2 ldi r24, 0x2F ; 47 33bd6: 98 ea ldi r25, 0xA8 ; 168 33bd8: cd cf rjmp .-102 ; 0x33b74 33bda: 00 91 68 13 lds r16, 0x1368 ; 0x801368 ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 33bde: 80 91 8c 13 lds r24, 0x138C ; 0x80138c 33be2: 08 17 cp r16, r24 33be4: 09 f4 brne .+2 ; 0x33be8 33be6: 49 c0 rjmp .+146 ; 0x33c7a // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 33be8: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33bec: 84 30 cpi r24, 0x04 ; 4 33bee: b9 f4 brne .+46 ; 0x33c1e break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 33bf0: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33bf4: 88 23 and r24, r24 33bf6: 99 f0 breq .+38 ; 0x33c1e custom_message_type = CustomMsg::MMUProgress; 33bf8: 89 e0 ldi r24, 0x09 ; 9 33bfa: 80 93 72 07 sts 0x0772, r24 ; 0x800772 : static_cast(pgm_read_ptr(&progressTexts[0])); 33bfe: e5 ef ldi r30, 0xF5 ; 245 33c00: 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])) 33c02: 0e 31 cpi r16, 0x1E ; 30 33c04: 30 f4 brcc .+12 ; 0x33c12 33c06: e0 2f mov r30, r16 33c08: f0 e0 ldi r31, 0x00 ; 0 33c0a: ee 0f add r30, r30 33c0c: ff 1f adc r31, r31 33c0e: eb 50 subi r30, 0x0B ; 11 33c10: f8 45 sbci r31, 0x58 ; 88 : static_cast(pgm_read_ptr(&progressTexts[0])); 33c12: 85 91 lpm r24, Z+ 33c14: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 33c16: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 33c1a: 0f 94 e0 0a call 0x215c0 ; 0x215c0 33c1e: e5 ef ldi r30, 0xF5 ; 245 33c20: 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])) 33c22: 0e 31 cpi r16, 0x1E ; 30 33c24: 30 f4 brcc .+12 ; 0x33c32 33c26: e0 2f mov r30, r16 33c28: f0 e0 ldi r31, 0x00 ; 0 33c2a: ee 0f add r30, r30 33c2c: ff 1f adc r31, r31 33c2e: eb 50 subi r30, 0x0B ; 11 33c30: f8 45 sbci r31, 0x58 ; 88 : static_cast(pgm_read_ptr(&progressTexts[0])); 33c32: 85 91 lpm r24, Z+ 33c34: 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))); 33c36: 02 96 adiw r24, 0x02 ; 2 33c38: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 33c3c: 00 93 8c 13 sts 0x138C, r16 ; 0x80138c switch (pc) { 33c40: 03 30 cpi r16, 0x03 ; 3 33c42: 49 f0 breq .+18 ; 0x33c56 33c44: 0c 31 cpi r16, 0x1C ; 28 33c46: 09 f0 breq .+2 ; 0x33c4a 33c48: 97 cf rjmp .-210 ; 0x33b78 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33c4a: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 33c4e: 81 e0 ldi r24, 0x01 ; 1 33c50: 80 93 97 13 sts 0x1397, r24 ; 0x801397 33c54: 91 cf rjmp .-222 ; 0x33b78 33c56: 80 91 28 13 lds r24, 0x1328 ; 0x801328 33c5a: 84 30 cpi r24, 0x04 ; 4 33c5c: 31 f4 brne .+12 ; 0x33c6a ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 33c5e: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33c62: 84 55 subi r24, 0x54 ; 84 33c64: 82 30 cpi r24, 0x02 ; 2 33c66: 08 f4 brcc .+2 ; 0x33c6a 33c68: 87 cf rjmp .-242 ; 0x33b78 33c6a: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 // 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; 33c6e: 81 e0 ldi r24, 0x01 ; 1 33c70: 80 93 98 13 sts 0x1398, r24 ; 0x801398 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(); 33c74: 0f 94 a7 72 call 0x2e54e ; 0x2e54e 33c78: 7f cf rjmp .-258 ; 0x33b78 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) { 33c7a: 03 30 cpi r16, 0x03 ; 3 33c7c: 71 f1 breq .+92 ; 0x33cda 33c7e: 0c 31 cpi r16, 0x1C ; 28 33c80: 09 f0 breq .+2 ; 0x33c84 33c82: 7a cf rjmp .-268 ; 0x33b78 unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 33c84: 80 91 97 13 lds r24, 0x1397 ; 0x801397 33c88: 88 23 and r24, r24 33c8a: 09 f4 brne .+2 ; 0x33c8e 33c8c: 75 cf rjmp .-278 ; 0x33b78 switch (WhereIsFilament()) { 33c8e: 0f 94 e2 c2 call 0x385c4 ; 0x385c4 33c92: 88 23 and r24, r24 33c94: b1 f1 breq .+108 ; 0x33d02 33c96: 81 30 cpi r24, 0x01 ; 1 33c98: 09 f0 breq .+2 ; 0x33c9c 33c9a: 6e cf rjmp .-292 ; 0x33b78 case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 33c9c: 10 92 97 13 sts 0x1397, r1 ; 0x801397 float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 33ca0: 0f 94 8b bb call 0x37716 ; 0x37716 // 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; 33ca4: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 33ca8: 60 91 73 13 lds r22, 0x1373 ; 0x801373 33cac: 70 e0 ldi r23, 0x00 ; 0 33cae: 90 e0 ldi r25, 0x00 ; 0 33cb0: 80 e0 ldi r24, 0x00 ; 0 33cb2: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 33cb6: 6b 01 movw r12, r22 33cb8: 7c 01 movw r14, r24 33cba: 60 91 72 13 lds r22, 0x1372 ; 0x801372 33cbe: 70 e0 ldi r23, 0x00 ; 0 33cc0: 6e 5f subi r22, 0xFE ; 254 33cc2: 7f 4f sbci r23, 0xFF ; 255 33cc4: 07 2e mov r0, r23 33cc6: 00 0c add r0, r0 33cc8: 88 0b sbc r24, r24 33cca: 99 0b sbc r25, r25 33ccc: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 33cd0: a7 01 movw r20, r14 33cd2: 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()); 33cd4: 0f 94 ae c2 call 0x3855c ; 0x3855c 33cd8: 4f cf rjmp .-354 ; 0x33b78 } 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 33cda: 80 91 98 13 lds r24, 0x1398 ; 0x801398 33cde: 88 23 and r24, r24 33ce0: 09 f4 brne .+2 ; 0x33ce4 33ce2: 4a cf rjmp .-364 ; 0x33b78 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); 33ce4: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 33ce8: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 33cec: 98 13 cpse r25, r24 33cee: 44 cf rjmp .-376 ; 0x33b78 switch (WhereIsFilament()) { 33cf0: 0f 94 e2 c2 call 0x385c4 ; 0x385c4 33cf4: 81 50 subi r24, 0x01 ; 1 33cf6: 83 30 cpi r24, 0x03 ; 3 33cf8: 08 f4 brcc .+2 ; 0x33cfc 33cfa: bc cf rjmp .-136 ; 0x33c74 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; 33cfc: 10 92 98 13 sts 0x1398, r1 ; 0x801398 33d00: 3b cf rjmp .-394 ; 0x33b78 33d02: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 33d06: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 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 33d0a: 98 13 cpse r25, r24 33d0c: 35 cf rjmp .-406 ; 0x33b78 // 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()); 33d0e: 60 91 73 13 lds r22, 0x1373 ; 0x801373 33d12: 70 e0 ldi r23, 0x00 ; 0 33d14: 90 e0 ldi r25, 0x00 ; 0 33d16: 80 e0 ldi r24, 0x00 ; 0 33d18: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 33d1c: 9b 01 movw r18, r22 33d1e: ac 01 movw r20, r24 33d20: 60 e0 ldi r22, 0x00 ; 0 33d22: 70 e0 ldi r23, 0x00 ; 0 33d24: 8f ea ldi r24, 0xAF ; 175 33d26: 93 e4 ldi r25, 0x43 ; 67 33d28: d5 cf rjmp .-86 ; 0x33cd4 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 33d2a: 18 30 cpi r17, 0x08 ; 8 33d2c: b9 f0 breq .+46 ; 0x33d5c 33d2e: 19 30 cpi r17, 0x09 ; 9 33d30: 09 f0 breq .+2 ; 0x33d34 33d32: 22 cf rjmp .-444 ; 0x33b78 StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 33d34: 60 e0 ldi r22, 0x00 ; 0 33d36: 0f 94 1f 82 call 0x3043e ; 0x3043e 33d3a: 19 e0 ldi r17, 0x09 ; 9 33d3c: 1d cf rjmp .-454 ; 0x33b78 default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 33d3e: 61 e0 ldi r22, 0x01 ; 1 33d40: 80 91 66 13 lds r24, 0x1366 ; 0x801366 33d44: 90 91 67 13 lds r25, 0x1367 ; 0x801367 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33d48: 0f 94 1f 82 call 0x3043e ; 0x3043e 33d4c: 15 cf rjmp .-470 ; 0x33b78 case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 33d4e: 82 e0 ldi r24, 0x02 ; 2 33d50: 80 93 95 13 sts 0x1395, r24 ; 0x801395 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 33d54: 60 e0 ldi r22, 0x00 ; 0 33d56: 8e e2 ldi r24, 0x2E ; 46 33d58: 90 e8 ldi r25, 0x80 ; 128 33d5a: f6 cf rjmp .-20 ; 0x33d48 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 33d5c: 10 92 95 13 sts 0x1395, r1 ; 0x801395 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33d60: 10 92 43 13 sts 0x1343, r1 ; 0x801343 currentScope = Scope::Stopped; 33d64: 10 92 28 13 sts 0x1328, r1 ; 0x801328 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33d68: 60 e0 ldi r22, 0x00 ; 0 33d6a: 8c e2 ldi r24, 0x2C ; 44 33d6c: 90 e8 ldi r25, 0x80 ; 128 33d6e: ec cf rjmp .-40 ; 0x33d48 break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 33d70: 0f 94 0e 6f call 0x2de1c ; 0x2de1c 33d74: aa cd rjmp .-1196 ; 0x338ca case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33d76: 00 23 and r16, r16 33d78: 01 f3 breq .-64 ; 0x33d3a 33d7a: dc cf rjmp .-72 ; 0x33d34 00033d7c : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 33d7c: 80 91 96 13 lds r24, 0x1396 ; 0x801396 33d80: 82 ff sbrs r24, 2 33d82: 07 c0 rjmp .+14 ; 0x33d92 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 33d84: 8b 7f andi r24, 0xFB ; 251 33d86: 80 93 96 13 sts 0x1396, r24 ; 0x801396 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 33d8a: 83 e8 ldi r24, 0x83 ; 131 33d8c: 99 ea ldi r25, 0xA9 ; 169 33d8e: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 33d92: 80 91 96 13 lds r24, 0x1396 ; 0x801396 33d96: 81 ff sbrs r24, 1 33d98: 52 c0 rjmp .+164 ; 0x33e3e 33d9a: 80 91 8a 13 lds r24, 0x138A ; 0x80138a 33d9e: 90 91 8b 13 lds r25, 0x138B ; 0x80138b 33da2: 89 2b or r24, r25 33da4: 09 f4 brne .+2 ; 0x33da8 33da6: 4b c0 rjmp .+150 ; 0x33e3e LogEchoEvent_P(PSTR("Resuming Temp")); 33da8: 85 e7 ldi r24, 0x75 ; 117 33daa: 99 ea ldi r25, 0xA9 ; 169 33dac: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 33db0: 80 91 8a 13 lds r24, 0x138A ; 0x80138a 33db4: 90 91 8b 13 lds r25, 0x138B ; 0x80138b 33db8: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 mmu_print_saved &= ~(SavedState::Cooldown); 33dbc: 80 91 96 13 lds r24, 0x1396 ; 0x801396 33dc0: 8d 7f andi r24, 0xFD ; 253 33dc2: 80 93 96 13 sts 0x1396, r24 ; 0x801396 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 33dc6: 80 91 8a 13 lds r24, 0x138A ; 0x80138a 33dca: 90 91 8b 13 lds r25, 0x138B ; 0x80138b 33dce: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 33dd2: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 33dd6: 85 e8 ldi r24, 0x85 ; 133 33dd8: 9d e5 ldi r25, 0x5D ; 93 33dda: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 33dde: 0f 94 4f 34 call 0x2689e ; 0x2689e 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)); 33de2: 45 e4 ldi r20, 0x45 ; 69 33de4: 59 ea ldi r21, 0xA9 ; 169 33de6: 62 e0 ldi r22, 0x02 ; 2 33de8: 80 e0 ldi r24, 0x00 ; 0 33dea: 0e 94 3a 70 call 0xe074 ; 0xe074 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 33dee: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 33df2: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 33df6: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 33dfa: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 33dfe: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 33e02: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 33e06: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 33e0a: c9 01 movw r24, r18 33e0c: 86 1b sub r24, r22 33e0e: 97 0b sbc r25, r23 33e10: 06 97 sbiw r24, 0x06 ; 6 33e12: 6c f0 brlt .+26 ; 0x33e2e void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 33e14: 81 e0 ldi r24, 0x01 ; 1 33e16: 0e 94 6b 8c call 0x118d6 ; 0x118d6 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); 33e1a: 80 e0 ldi r24, 0x00 ; 0 33e1c: 0f 94 ac 99 call 0x33358 ; 0x33358 ReportErrorHookDynamicRender(); 33e20: 0f 94 f6 c1 call 0x383ec ; 0x383ec void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 33e24: 84 e6 ldi r24, 0x64 ; 100 33e26: 90 e0 ldi r25, 0x00 ; 0 33e28: 0e 94 10 8f call 0x11e20 ; 0x11e20 33e2c: e0 cf rjmp .-64 ; 0x33dee }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 33e2e: 0f 94 cc c1 call 0x38398 ; 0x38398 LogEchoEvent_P(PSTR("Hotend temperature reached")); 33e32: 8a e5 ldi r24, 0x5A ; 90 33e34: 99 ea ldi r25, 0xA9 ; 169 33e36: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 33e3a: 0c 94 59 70 jmp 0xe0b2 ; 0xe0b2 ScreenClear(); } } 33e3e: 08 95 ret 00033e40 : /// 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) { 33e40: 0f 93 push r16 33e42: 1f 93 push r17 33e44: cf 93 push r28 33e46: df 93 push r29 33e48: 00 d0 rcall .+0 ; 0x33e4a 33e4a: 1f 92 push r1 33e4c: 1f 92 push r1 33e4e: cd b7 in r28, 0x3d ; 61 33e50: de b7 in r29, 0x3e ; 62 33e52: 18 2f mov r17, r24 33e54: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 33e56: 10 92 96 13 sts 0x1396, r1 ; 0x801396 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 33e5a: 83 e0 ldi r24, 0x03 ; 3 33e5c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 LongTimer nozzleTimeout; 33e60: 19 82 std Y+1, r1 ; 0x01 33e62: 1a 82 std Y+2, r1 ; 0x02 33e64: 1b 82 std Y+3, r1 ; 0x03 33e66: 1c 82 std Y+4, r1 ; 0x04 33e68: 1d 82 std Y+5, r1 ; 0x05 33e6a: 90 e0 ldi r25, 0x00 ; 0 33e6c: 80 e0 ldi r24, 0x00 ; 0 33e6e: 0e 94 10 8f call 0x11e20 ; 0x11e20 // - 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) { 33e72: 90 91 96 13 lds r25, 0x1396 ; 0x801396 33e76: 89 81 ldd r24, Y+1 ; 0x01 33e78: 92 ff sbrs r25, 2 33e7a: 37 c0 rjmp .+110 ; 0x33eea if (!nozzleTimeout.running()) { 33e7c: 81 11 cpse r24, r1 33e7e: 1e c0 rjmp .+60 ; 0x33ebc nozzleTimeout.start(); 33e80: ce 01 movw r24, r28 33e82: 01 96 adiw r24, 0x01 ; 1 33e84: 0f 94 f8 40 call 0x281f0 ; 0x281f0 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 33e88: 8a e5 ldi r24, 0x5A ; 90 33e8a: 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")); 33e8c: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 } switch (logicStepLastStatus) { 33e90: e0 91 94 13 lds r30, 0x1394 ; 0x801394 33e94: e2 50 subi r30, 0x02 ; 2 33e96: ea 30 cpi r30, 0x0A ; 10 33e98: 40 f7 brcc .-48 ; 0x33e6a 33e9a: f0 e0 ldi r31, 0x00 ; 0 33e9c: 88 27 eor r24, r24 33e9e: ec 5a subi r30, 0xAC ; 172 33ea0: f0 46 sbci r31, 0x60 ; 96 33ea2: 8e 4f sbci r24, 0xFE ; 254 33ea4: 0d 94 1f de jmp 0x3bc3e ; 0x3bc3e <__tablejump2__> 33ea8: 1e 3b cpi r17, 0xBE ; 190 33eaa: da 3b cpi r29, 0xBA ; 186 33eac: bc 3a cpi r27, 0xAC ; 172 33eae: bc 3a cpi r27, 0xAC ; 172 33eb0: 20 3b cpi r18, 0xB0 ; 176 33eb2: bc 3a cpi r27, 0xAC ; 172 33eb4: 24 3b cpi r18, 0xB4 ; 180 33eb6: 04 3a cpi r16, 0xA4 ; 164 33eb8: 80 3b cpi r24, 0xB0 ; 176 33eba: bc 3a cpi r27, 0xAC ; 172 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. 33ebc: 40 e4 ldi r20, 0x40 ; 64 33ebe: 57 e7 ldi r21, 0x77 ; 119 33ec0: 6b e1 ldi r22, 0x1B ; 27 33ec2: 70 e0 ldi r23, 0x00 ; 0 33ec4: ce 01 movw r24, r28 33ec6: 01 96 adiw r24, 0x01 ; 1 33ec8: 0f 94 39 3f call 0x27e72 ; 0x27e72 ::expired(unsigned long)> 33ecc: 88 23 and r24, r24 33ece: 01 f3 breq .-64 ; 0x33e90 mmu_print_saved &= ~(SavedState::CooldownPending); 33ed0: 80 91 96 13 lds r24, 0x1396 ; 0x801396 33ed4: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 33ed6: 82 60 ori r24, 0x02 ; 2 33ed8: 80 93 96 13 sts 0x1396, r24 ; 0x801396 33edc: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 33ee0: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 33ee4: 8a e4 ldi r24, 0x4A ; 74 33ee6: 97 ea ldi r25, 0xA7 ; 167 33ee8: d1 cf rjmp .-94 ; 0x33e8c } } else if (nozzleTimeout.running()) { 33eea: 88 23 and r24, r24 33eec: 89 f2 breq .-94 ; 0x33e90 33eee: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33ef0: 84 e3 ldi r24, 0x34 ; 52 33ef2: 97 ea ldi r25, 0xA7 ; 167 33ef4: cb cf rjmp .-106 ; 0x33e8c 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(); 33ef6: 0f 94 be 9e call 0x33d7c ; 0x33d7c ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 33efa: 0f 94 cd 72 call 0x2e59a ; 0x2e59a if (!TuneMenuEntered()) { 33efe: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.512> 33f02: 81 11 cpse r24, r1 33f04: 07 c0 rjmp .+14 ; 0x33f14 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 33f06: 81 e2 ldi r24, 0x21 ; 33 33f08: 97 ea ldi r25, 0xA7 ; 167 33f0a: 0e 94 97 7b call 0xf72e ; 0xf72e retryAttempts = MAX_RETRIES; 33f0e: 83 e0 ldi r24, 0x03 ; 3 33f10: 80 93 7a 13 sts 0x137A, r24 ; 0x80137a bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33f14: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 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; 33f18: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 33f1a: 0f 90 pop r0 33f1c: 0f 90 pop r0 33f1e: 0f 90 pop r0 33f20: 0f 90 pop r0 33f22: 0f 90 pop r0 33f24: df 91 pop r29 33f26: cf 91 pop r28 33f28: 1f 91 pop r17 33f2a: 0f 91 pop r16 33f2c: 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(); 33f2e: 0f 94 f3 98 call 0x331e6 ; 0x331e6 33f32: f2 cf rjmp .-28 ; 0x33f18 break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 33f34: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 33f38: 81 11 cpse r24, r1 33f3a: 97 cf rjmp .-210 ; 0x33e6a // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 33f3c: 81 2f mov r24, r17 33f3e: 0f 94 19 73 call 0x2e632 ; 0x2e632 SaveHotendTemp(turn_off_nozzle); 33f42: 80 2f mov r24, r16 33f44: 0f 94 b1 72 call 0x2e562 ; 0x2e562 CheckUserInput(); 33f48: 0f 94 f3 98 call 0x331e6 ; 0x331e6 33f4c: 8e cf rjmp .-228 ; 0x33e6a } 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(); 33f4e: 0f 94 be 9e call 0x33d7c ; 0x33d7c ResumeUnpark(); 33f52: 0f 94 cd 72 call 0x2e59a ; 0x2e59a 33f56: 89 cf rjmp .-238 ; 0x33e6a } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 33f58: 80 e0 ldi r24, 0x00 ; 0 33f5a: df cf rjmp .-66 ; 0x33f1a 00033f5c : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 33f5c: cf 93 push r28 33f5e: df 93 push r29 33f60: 00 d0 rcall .+0 ; 0x33f62 33f62: 1f 92 push r1 33f64: 1f 92 push r1 33f66: cd b7 in r28, 0x3d ; 61 33f68: 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; 33f6a: 10 92 87 17 sts 0x1787, r1 ; 0x801787 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 33f6e: 10 92 86 17 sts 0x1786, r1 ; 0x801786 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 33f72: 62 e1 ldi r22, 0x12 ; 18 33f74: 81 e9 ldi r24, 0x91 ; 145 33f76: 96 ea ldi r25, 0xA6 ; 166 33f78: 0f 94 ab 87 call 0x30f56 ; 0x30f56 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(); 33f7c: 0f 94 ac c2 call 0x38558 ; 0x38558 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 33f80: 40 e0 ldi r20, 0x00 ; 0 33f82: 65 e5 ldi r22, 0x55 ; 85 33f84: ce 01 movw r24, r28 33f86: 01 96 adiw r24, 0x01 ; 1 33f88: 0f 94 8a c2 call 0x38514 ; 0x38514 33f8c: 49 81 ldd r20, Y+1 ; 0x01 33f8e: 5a 81 ldd r21, Y+2 ; 0x02 33f90: 6b 81 ldd r22, Y+3 ; 0x03 33f92: 7c 81 ldd r23, Y+4 ; 0x04 33f94: 8d 81 ldd r24, Y+5 ; 0x05 33f96: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 logic.UnloadFilament(); if (manage_response(false, true)) { 33f9a: 61 e0 ldi r22, 0x01 ; 1 33f9c: 80 e0 ldi r24, 0x00 ; 0 33f9e: 0f 94 20 9f call 0x33e40 ; 0x33e40 33fa2: 81 11 cpse r24, r1 33fa4: 03 c0 rjmp .+6 ; 0x33fac break; } IncrementMMUFails(); 33fa6: 0f 94 ee c1 call 0x383dc ; 0x383dc 33faa: e8 cf rjmp .-48 ; 0x33f7c 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); 33fac: 83 e0 ldi r24, 0x03 ; 3 33fae: 0f 94 2e 63 call 0x2c65c ; 0x2c65c } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 33fb2: 83 e6 ldi r24, 0x63 ; 99 33fb4: 0f 94 53 87 call 0x30ea6 ; 0x30ea6 tool_change_extruder = MMU2_NO_TOOL; 33fb8: 83 e6 ldi r24, 0x63 ; 99 33fba: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 33fbe: 85 e8 ldi r24, 0x85 ; 133 33fc0: 97 e1 ldi r25, 0x17 ; 23 33fc2: 0e 94 15 76 call 0xec2a ; 0xec2a } 33fc6: 0f 90 pop r0 33fc8: 0f 90 pop r0 33fca: 0f 90 pop r0 33fcc: 0f 90 pop r0 33fce: 0f 90 pop r0 33fd0: df 91 pop r29 33fd2: cf 91 pop r28 33fd4: 08 95 ret 00033fd6 : bool MMU2::unload() { 33fd6: cf 93 push r28 if (!WaitForMMUReady()) { 33fd8: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 33fdc: c8 2f mov r28, r24 33fde: 88 23 and r24, r24 33fe0: 79 f0 breq .+30 ; 0x34000 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 33fe2: 88 ec ldi r24, 0xC8 ; 200 33fe4: 90 e0 ldi r25, 0x00 ; 0 33fe6: 0f 94 2b c6 call 0x38c56 ; 0x38c56 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> 33fea: 82 e0 ldi r24, 0x02 ; 2 33fec: 0f 94 2e 63 call 0x2c65c ; 0x2c65c struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33ff0: 0f 94 48 87 call 0x30e90 ; 0x30e90 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 33ff4: 0f 94 ae 9f call 0x33f5c ; 0x33f5c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33ff8: 0f 94 c9 87 call 0x30f92 ; 0x30f92 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 33ffc: 0f 94 cc c1 call 0x38398 ; 0x38398 return true; } 34000: 8c 2f mov r24, r28 34002: cf 91 pop r28 34004: 08 95 ret 00034006 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 34006: 0f 93 push r16 34008: 1f 93 push r17 3400a: cf 93 push r28 3400c: df 93 push r29 3400e: 00 d0 rcall .+0 ; 0x34010 34010: 1f 92 push r1 34012: 1f 92 push r1 34014: cd b7 in r28, 0x3d ; 61 34016: de b7 in r29, 0x3e ; 62 34018: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 3401a: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 3401e: 18 2f mov r17, r24 34020: 88 23 and r24, r24 34022: 49 f1 breq .+82 ; 0x34076 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 34024: 82 e7 ldi r24, 0x72 ; 114 34026: 9d e5 ldi r25, 0x5D ; 93 34028: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 3402c: 60 2f mov r22, r16 3402e: 0f 94 cf c1 call 0x3839e ; 0x3839e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 34032: 0f 94 48 87 call 0x30e90 ; 0x30e90 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 34036: 0f 94 ac c2 call 0x38558 ; 0x38558 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 3403a: 40 2f mov r20, r16 3403c: 6c e4 ldi r22, 0x4C ; 76 3403e: ce 01 movw r24, r28 34040: 01 96 adiw r24, 0x01 ; 1 34042: 0f 94 8a c2 call 0x38514 ; 0x38514 34046: 49 81 ldd r20, Y+1 ; 0x01 34048: 5a 81 ldd r21, Y+2 ; 0x02 3404a: 6b 81 ldd r22, Y+3 ; 0x03 3404c: 7c 81 ldd r23, Y+4 ; 0x04 3404e: 8d 81 ldd r24, Y+5 ; 0x05 34050: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 logic.LoadFilament(slot); if (manage_response(false, false)) { 34054: 60 e0 ldi r22, 0x00 ; 0 34056: 80 e0 ldi r24, 0x00 ; 0 34058: 0f 94 20 9f call 0x33e40 ; 0x33e40 3405c: 18 2f mov r17, r24 3405e: 81 11 cpse r24, r1 34060: 03 c0 rjmp .+6 ; 0x34068 break; } IncrementMMUFails(); 34062: 0f 94 ee c1 call 0x383dc ; 0x383dc 34066: e7 cf rjmp .-50 ; 0x34036 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); 34068: 83 e0 ldi r24, 0x03 ; 3 3406a: 0f 94 2e 63 call 0x2c65c ; 0x2c65c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 3406e: 0f 94 c9 87 call 0x30f92 ; 0x30f92 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 34072: 0f 94 cc c1 call 0x38398 ; 0x38398 return true; } 34076: 81 2f mov r24, r17 34078: 0f 90 pop r0 3407a: 0f 90 pop r0 3407c: 0f 90 pop r0 3407e: 0f 90 pop r0 34080: 0f 90 pop r0 34082: df 91 pop r29 34084: cf 91 pop r28 34086: 1f 91 pop r17 34088: 0f 91 pop r16 3408a: 08 95 ret 0003408c : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 3408c: ff 92 push r15 3408e: 0f 93 push r16 34090: 1f 93 push r17 34092: cf 93 push r28 34094: df 93 push r29 34096: 00 d0 rcall .+0 ; 0x34098 34098: 1f 92 push r1 3409a: 1f 92 push r1 3409c: cd b7 in r28, 0x3d ; 61 3409e: de b7 in r29, 0x3e ; 62 340a0: 08 2f mov r16, r24 340a2: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 340a4: 0f 94 d4 87 call 0x30fa8 ; 0x30fa8 340a8: 18 2f mov r17, r24 340aa: 88 23 and r24, r24 340ac: b1 f1 breq .+108 ; 0x3411a return false; } if (enableFullScreenMsg) { 340ae: ff 20 and r15, r15 340b0: 39 f0 breq .+14 ; 0x340c0 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 340b2: 81 e6 ldi r24, 0x61 ; 97 340b4: 9d e5 ldi r25, 0x5D ; 93 340b6: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 340ba: 60 2f mov r22, r16 340bc: 0f 94 cf c1 call 0x3839e ; 0x3839e FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 340c0: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 340c4: 81 11 cpse r24, r1 unload(); 340c6: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 340ca: 0f 94 48 87 call 0x30e90 ; 0x30e90 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 340ce: 0f 94 ac c2 call 0x38558 ; 0x38558 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 340d2: 40 2f mov r20, r16 340d4: 65 e4 ldi r22, 0x45 ; 69 340d6: ce 01 movw r24, r28 340d8: 01 96 adiw r24, 0x01 ; 1 340da: 0f 94 8a c2 call 0x38514 ; 0x38514 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 fc 97 call 0x32ff8 ; 0x32ff8 logic.EjectFilament(slot); if (manage_response(false, true)) { 340ec: 61 e0 ldi r22, 0x01 ; 1 340ee: 80 e0 ldi r24, 0x00 ; 0 340f0: 0f 94 20 9f call 0x33e40 ; 0x33e40 340f4: 18 2f mov r17, r24 340f6: 81 11 cpse r24, r1 340f8: 03 c0 rjmp .+6 ; 0x34100 break; } IncrementMMUFails(); 340fa: 0f 94 ee c1 call 0x383dc ; 0x383dc 340fe: e7 cf rjmp .-50 ; 0x340ce } SetCurrentTool(MMU2_NO_TOOL); 34100: 83 e6 ldi r24, 0x63 ; 99 34102: 0f 94 53 87 call 0x30ea6 ; 0x30ea6 tool_change_extruder = MMU2_NO_TOOL; 34106: 83 e6 ldi r24, 0x63 ; 99 34108: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 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); 3410c: 83 e0 ldi r24, 0x03 ; 3 3410e: 0f 94 2e 63 call 0x2c65c ; 0x2c65c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34112: 0f 94 c9 87 call 0x30f92 ; 0x30f92 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 34116: 0f 94 cc c1 call 0x38398 ; 0x38398 return true; } 3411a: 81 2f mov r24, r17 3411c: 0f 90 pop r0 3411e: 0f 90 pop r0 34120: 0f 90 pop r0 34122: 0f 90 pop r0 34124: 0f 90 pop r0 34126: df 91 pop r29 34128: cf 91 pop r28 3412a: 1f 91 pop r17 3412c: 0f 91 pop r16 3412e: ff 90 pop r15 34130: 08 95 ret 00034132 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 34132: 1f 93 push r17 34134: cf 93 push r28 34136: df 93 push r29 34138: 00 d0 rcall .+0 ; 0x3413a 3413a: 1f 92 push r1 3413c: 1f 92 push r1 3413e: cd b7 in r28, 0x3d ; 61 34140: de b7 in r29, 0x3e ; 62 34142: 18 2f mov r17, r24 for (;;) { Disable_E0(); 34144: 0f 94 ac c2 call 0x38558 ; 0x38558 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 34148: 41 2f mov r20, r17 3414a: 6b e4 ldi r22, 0x4B ; 75 3414c: ce 01 movw r24, r28 3414e: 01 96 adiw r24, 0x01 ; 1 34150: 0f 94 8a c2 call 0x38514 ; 0x38514 34154: 49 81 ldd r20, Y+1 ; 0x01 34156: 5a 81 ldd r21, Y+2 ; 0x02 34158: 6b 81 ldd r22, Y+3 ; 0x03 3415a: 7c 81 ldd r23, Y+4 ; 0x04 3415c: 8d 81 ldd r24, Y+5 ; 0x05 3415e: 0f 94 fc 97 call 0x32ff8 ; 0x32ff8 logic.CutFilament(slot); if (manage_response(false, true)) { 34162: 61 e0 ldi r22, 0x01 ; 1 34164: 80 e0 ldi r24, 0x00 ; 0 34166: 0f 94 20 9f call 0x33e40 ; 0x33e40 3416a: 81 11 cpse r24, r1 3416c: 03 c0 rjmp .+6 ; 0x34174 break; } IncrementMMUFails(); 3416e: 0f 94 ee c1 call 0x383dc ; 0x383dc 34172: e8 cf rjmp .-48 ; 0x34144 } } 34174: 0f 90 pop r0 34176: 0f 90 pop r0 34178: 0f 90 pop r0 3417a: 0f 90 pop r0 3417c: 0f 90 pop r0 3417e: df 91 pop r29 34180: cf 91 pop r28 34182: 1f 91 pop r17 34184: 08 95 ret 00034186 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 34186: cf 93 push r28 34188: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 3418a: 82 e5 ldi r24, 0x52 ; 82 3418c: 9d e5 ldi r25, 0x5D ; 93 3418e: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 34192: 6c 2f mov r22, r28 34194: 0f 94 cf c1 call 0x3839e ; 0x3839e if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 34198: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 3419c: 81 11 cpse r24, r1 unload(); 3419e: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 341a2: 0f 94 48 87 call 0x30e90 ; 0x30e90 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 341a6: 8c 2f mov r24, r28 341a8: 0f 94 99 a0 call 0x34132 ; 0x34132 SetCurrentTool(MMU2_NO_TOOL); 341ac: 83 e6 ldi r24, 0x63 ; 99 341ae: 0f 94 53 87 call 0x30ea6 ; 0x30ea6 tool_change_extruder = MMU2_NO_TOOL; 341b2: 83 e6 ldi r24, 0x63 ; 99 341b4: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 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); 341b8: 83 e0 ldi r24, 0x03 ; 3 341ba: 0f 94 2e 63 call 0x2c65c ; 0x2c65c explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 341be: 0f 94 c9 87 call 0x30f92 ; 0x30f92 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 341c2: 0f 94 cc c1 call 0x38398 ; 0x38398 return true; } 341c6: 81 e0 ldi r24, 0x01 ; 1 341c8: cf 91 pop r28 341ca: 08 95 ret 000341cc : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 341cc: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 341d0: 95 ff sbrs r25, 5 341d2: fc cf rjmp .-8 ; 0x341cc UDR0 = ch; 341d4: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 341d8: 08 95 ret 000341da : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 341da: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 341de: 87 ff sbrs r24, 7 341e0: fc cf rjmp .-8 ; 0x341da if (!(UCSR0A & _BV(FE0))) { 341e2: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 341e6: 84 fd sbrc r24, 4 341e8: 01 c0 rjmp .+2 ; 0x341ec * 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(); 341ea: a8 95 wdr } ch = UDR0; 341ec: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 341f0: 08 95 ret 000341f2 : /// 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; 341f2: 86 27 eor r24, r22 341f4: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 341f6: 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) { 341f8: 38 2f mov r19, r24 341fa: 88 0f add r24, r24 341fc: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 341fe: 82 27 eor r24, r18 34200: 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++) { 34202: d1 f7 brne .-12 ; 0x341f8 } else { data <<= 1U; } } return data; } 34204: 08 95 ret 00034206 : // 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) { 34206: 2f 92 push r2 34208: 3f 92 push r3 3420a: 4f 92 push r4 3420c: 5f 92 push r5 3420e: 6f 92 push r6 34210: 7f 92 push r7 34212: 8f 92 push r8 34214: 9f 92 push r9 34216: af 92 push r10 34218: bf 92 push r11 3421a: cf 92 push r12 3421c: df 92 push r13 3421e: ef 92 push r14 34220: ff 92 push r15 34222: 0f 93 push r16 34224: 1f 93 push r17 34226: cf 93 push r28 34228: df 93 push r29 3422a: cd b7 in r28, 0x3d ; 61 3422c: de b7 in r29, 0x3e ; 62 3422e: a1 97 sbiw r28, 0x21 ; 33 34230: 0f b6 in r0, 0x3f ; 63 34232: f8 94 cli 34234: de bf out 0x3e, r29 ; 62 34236: 0f be out 0x3f, r0 ; 63 34238: cd bf out 0x3d, r28 ; 61 3423a: 1c 01 movw r2, r24 3423c: 48 01 movw r8, r16 3423e: 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) 34240: fc 01 movw r30, r24 34242: e8 5b subi r30, 0xB8 ; 184 34244: ff 4f sbci r31, 0xFF ; 255 34246: c0 80 ld r12, Z 34248: d1 80 ldd r13, Z+1 ; 0x01 3424a: e2 80 ldd r14, Z+2 ; 0x02 3424c: f3 80 ldd r15, Z+3 ; 0x03 3424e: 9a 01 movw r18, r20 34250: ab 01 movw r20, r22 34252: c7 01 movw r24, r14 34254: b6 01 movw r22, r12 34256: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3425a: 0f 94 15 df call 0x3be2a ; 0x3be2a 3425e: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 34262: 8b 01 movw r16, r22 34264: 8d 83 std Y+5, r24 ; 0x05 34266: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 34268: a5 01 movw r20, r10 3426a: 94 01 movw r18, r8 3426c: c7 01 movw r24, r14 3426e: b6 01 movw r22, r12 34270: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 34274: 0f 94 15 df call 0x3be2a ; 0x3be2a 34278: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3427c: 36 2f mov r19, r22 3427e: 27 2f mov r18, r23 34280: a8 01 movw r20, r16 34282: 6d 81 ldd r22, Y+5 ; 0x05 34284: 79 81 ldd r23, Y+1 ; 0x01 34286: 48 37 cpi r20, 0x78 ; 120 34288: 51 05 cpc r21, r1 3428a: 61 05 cpc r22, r1 3428c: 71 05 cpc r23, r1 3428e: 20 f4 brcc .+8 ; 0x34298 34290: 48 e7 ldi r20, 0x78 ; 120 34292: 50 e0 ldi r21, 0x00 ; 0 34294: 60 e0 ldi r22, 0x00 ; 0 34296: 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) 34298: d1 01 movw r26, r2 3429a: d6 96 adiw r26, 0x36 ; 54 3429c: 8d 90 ld r8, X+ 3429e: 9d 90 ld r9, X+ 342a0: ad 90 ld r10, X+ 342a2: bc 90 ld r11, X 342a4: d9 97 sbiw r26, 0x39 ; 57 342a6: 8f 8a std Y+23, r8 ; 0x17 342a8: 98 8e std Y+24, r9 ; 0x18 342aa: a9 8e std Y+25, r10 ; 0x19 342ac: ba 8e std Y+26, r11 ; 0x1a 342ae: 48 15 cp r20, r8 342b0: 59 05 cpc r21, r9 342b2: 6a 05 cpc r22, r10 342b4: 7b 05 cpc r23, r11 342b6: 20 f4 brcc .+8 ; 0x342c0 342b8: 4f 8b std Y+23, r20 ; 0x17 342ba: 58 8f std Y+24, r21 ; 0x18 342bc: 69 8f std Y+25, r22 ; 0x19 342be: 7a 8f std Y+26, r23 ; 0x1a 342c0: 43 2f mov r20, r19 342c2: 52 2f mov r21, r18 342c4: bc 01 movw r22, r24 342c6: 48 37 cpi r20, 0x78 ; 120 342c8: 51 05 cpc r21, r1 342ca: 61 05 cpc r22, r1 342cc: 71 05 cpc r23, r1 342ce: 20 f4 brcc .+8 ; 0x342d8 342d0: 48 e7 ldi r20, 0x78 ; 120 342d2: 50 e0 ldi r21, 0x00 ; 0 342d4: 60 e0 ldi r22, 0x00 ; 0 342d6: 70 e0 ldi r23, 0x00 ; 0 342d8: 18 2d mov r17, r8 342da: 09 2d mov r16, r9 342dc: a9 a2 std Y+33, r10 ; 0x21 342de: b8 a2 std Y+32, r11 ; 0x20 342e0: 48 15 cp r20, r8 342e2: 59 05 cpc r21, r9 342e4: 6a 05 cpc r22, r10 342e6: 7b 05 cpc r23, r11 342e8: 20 f4 brcc .+8 ; 0x342f2 342ea: 14 2f mov r17, r20 342ec: 05 2f mov r16, r21 342ee: 69 a3 std Y+33, r22 ; 0x21 342f0: 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; 342f2: f1 01 movw r30, r2 342f4: ee 5b subi r30, 0xBE ; 190 342f6: ff 4f sbci r31, 0xFF ; 255 342f8: c0 80 ld r12, Z 342fa: d1 80 ldd r13, Z+1 ; 0x01 342fc: e2 80 ldd r14, Z+2 ; 0x02 342fe: f3 80 ldd r15, Z+3 ; 0x03 34300: cd 82 std Y+5, r12 ; 0x05 34302: de 82 std Y+6, r13 ; 0x06 34304: ef 82 std Y+7, r14 ; 0x07 34306: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 34308: cd 28 or r12, r13 3430a: ce 28 or r12, r14 3430c: cf 28 or r12, r15 3430e: 41 f4 brne .+16 ; 0x34320 // Don't allow zero acceleration. acceleration = 1; 34310: c1 2c mov r12, r1 34312: d1 2c mov r13, r1 34314: 76 01 movw r14, r12 34316: c3 94 inc r12 34318: cd 82 std Y+5, r12 ; 0x05 3431a: de 82 std Y+6, r13 ; 0x06 3431c: ef 82 std Y+7, r14 ; 0x07 3431e: 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; 34320: 2f 89 ldd r18, Y+23 ; 0x17 34322: 38 8d ldd r19, Y+24 ; 0x18 34324: 49 8d ldd r20, Y+25 ; 0x19 34326: 5a 8d ldd r21, Y+26 ; 0x1a 34328: b9 01 movw r22, r18 3432a: ca 01 movw r24, r20 3432c: 0f 94 72 dd call 0x3bae4 ; 0x3bae4 <__mulsi3> 34330: 6d 87 std Y+13, r22 ; 0x0d 34332: 7e 87 std Y+14, r23 ; 0x0e 34334: 8f 87 std Y+15, r24 ; 0x0f 34336: 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; 34338: a5 01 movw r20, r10 3433a: 94 01 movw r18, r8 3433c: c5 01 movw r24, r10 3433e: b4 01 movw r22, r8 34340: 0f 94 72 dd call 0x3bae4 ; 0x3bae4 <__mulsi3> 34344: 2b 01 movw r4, r22 34346: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 34348: 21 2f mov r18, r17 3434a: 30 2f mov r19, r16 3434c: 49 a1 ldd r20, Y+33 ; 0x21 3434e: 58 a1 ldd r21, Y+32 ; 0x20 34350: 61 2f mov r22, r17 34352: 70 2f mov r23, r16 34354: ca 01 movw r24, r20 34356: 0f 94 72 dd call 0x3bae4 ; 0x3bae4 <__mulsi3> 3435a: 69 8b std Y+17, r22 ; 0x11 3435c: 7a 8b std Y+18, r23 ; 0x12 3435e: 8b 8b std Y+19, r24 ; 0x13 34360: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 34362: cd 80 ldd r12, Y+5 ; 0x05 34364: de 80 ldd r13, Y+6 ; 0x06 34366: ef 80 ldd r14, Y+7 ; 0x07 34368: f8 84 ldd r15, Y+8 ; 0x08 3436a: cc 0c add r12, r12 3436c: dd 1c adc r13, r13 3436e: ee 1c adc r14, r14 34370: ff 1c adc r15, r15 34372: c9 86 std Y+9, r12 ; 0x09 34374: da 86 std Y+10, r13 ; 0x0a 34376: eb 86 std Y+11, r14 ; 0x0b 34378: 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; 3437a: c3 01 movw r24, r6 3437c: b2 01 movw r22, r4 3437e: 61 50 subi r22, 0x01 ; 1 34380: 71 09 sbc r23, r1 34382: 81 09 sbc r24, r1 34384: 91 09 sbc r25, r1 34386: cd 84 ldd r12, Y+13 ; 0x0d 34388: de 84 ldd r13, Y+14 ; 0x0e 3438a: ef 84 ldd r14, Y+15 ; 0x0f 3438c: f8 88 ldd r15, Y+16 ; 0x10 3438e: 6c 19 sub r22, r12 34390: 7d 09 sbc r23, r13 34392: 8e 09 sbc r24, r14 34394: 9f 09 sbc r25, r15 34396: c9 84 ldd r12, Y+9 ; 0x09 34398: da 84 ldd r13, Y+10 ; 0x0a 3439a: eb 84 ldd r14, Y+11 ; 0x0b 3439c: fc 84 ldd r15, Y+12 ; 0x0c 3439e: 6c 0d add r22, r12 343a0: 7d 1d adc r23, r13 343a2: 8e 1d adc r24, r14 343a4: 9f 1d adc r25, r15 343a6: a7 01 movw r20, r14 343a8: 96 01 movw r18, r12 343aa: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 343ae: 69 01 movw r12, r18 343b0: 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; 343b2: c3 01 movw r24, r6 343b4: b2 01 movw r22, r4 343b6: 29 89 ldd r18, Y+17 ; 0x11 343b8: 3a 89 ldd r19, Y+18 ; 0x12 343ba: 4b 89 ldd r20, Y+19 ; 0x13 343bc: 5c 89 ldd r21, Y+20 ; 0x14 343be: 62 1b sub r22, r18 343c0: 73 0b sbc r23, r19 343c2: 84 0b sbc r24, r20 343c4: 95 0b sbc r25, r21 343c6: 29 85 ldd r18, Y+9 ; 0x09 343c8: 3a 85 ldd r19, Y+10 ; 0x0a 343ca: 4b 85 ldd r20, Y+11 ; 0x0b 343cc: 5c 85 ldd r21, Y+12 ; 0x0c 343ce: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 343d2: 29 01 movw r4, r18 343d4: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 343d6: d7 01 movw r26, r14 343d8: c6 01 movw r24, r12 343da: 84 0d add r24, r4 343dc: 95 1d adc r25, r5 343de: a6 1d adc r26, r6 343e0: b7 1d adc r27, r7 343e2: 8c 8f std Y+28, r24 ; 0x1c 343e4: 9d 8f std Y+29, r25 ; 0x1d 343e6: ae 8f std Y+30, r26 ; 0x1e 343e8: 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) { 343ea: f1 01 movw r30, r2 343ec: e4 5b subi r30, 0xB4 ; 180 343ee: ff 4f sbci r31, 0xFF ; 255 343f0: 90 81 ld r25, Z 343f2: 9b 8f std Y+27, r25 ; 0x1b 343f4: 99 23 and r25, r25 343f6: 09 f4 brne .+2 ; 0x343fa 343f8: 8d c0 rjmp .+282 ; 0x34514 final_adv_steps = final_rate * block->adv_comp; 343fa: 61 2f mov r22, r17 343fc: 70 2f mov r23, r16 343fe: 89 a1 ldd r24, Y+33 ; 0x21 34400: 98 a1 ldd r25, Y+32 ; 0x20 34402: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 34406: f1 01 movw r30, r2 34408: ec 5a subi r30, 0xAC ; 172 3440a: ff 4f sbci r31, 0xFF ; 255 3440c: 20 81 ld r18, Z 3440e: 31 81 ldd r19, Z+1 ; 0x01 34410: 42 81 ldd r20, Z+2 ; 0x02 34412: 53 81 ldd r21, Z+3 ; 0x03 34414: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 34418: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3441c: 6d 8b std Y+21, r22 ; 0x15 3441e: 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) { 34420: d1 01 movw r26, r2 34422: 50 96 adiw r26, 0x10 ; 16 34424: 2d 91 ld r18, X+ 34426: 3d 91 ld r19, X+ 34428: 4d 91 ld r20, X+ 3442a: 5c 91 ld r21, X 3442c: 53 97 sbiw r26, 0x13 ; 19 3442e: 29 83 std Y+1, r18 ; 0x01 34430: 3a 83 std Y+2, r19 ; 0x02 34432: 4b 83 std Y+3, r20 ; 0x03 34434: 5c 83 std Y+4, r21 ; 0x04 34436: 8c 8d ldd r24, Y+28 ; 0x1c 34438: 9d 8d ldd r25, Y+29 ; 0x1d 3443a: ae 8d ldd r26, Y+30 ; 0x1e 3443c: bf 8d ldd r27, Y+31 ; 0x1f 3443e: 82 17 cp r24, r18 34440: 93 07 cpc r25, r19 34442: a4 07 cpc r26, r20 34444: b5 07 cpc r27, r21 34446: 08 f0 brcs .+2 ; 0x3444a 34448: 68 c0 rjmp .+208 ; 0x3451a plateau_steps = block->step_event_count.wide - accel_decel_steps; 3444a: 29 01 movw r4, r18 3444c: 3a 01 movw r6, r20 3444e: 48 1a sub r4, r24 34450: 59 0a sbc r5, r25 34452: 6a 0a sbc r6, r26 34454: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 34456: 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; 34458: 40 e0 ldi r20, 0x00 ; 0 3445a: 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) 3445c: 99 23 and r25, r25 3445e: 89 f0 breq .+34 ; 0x34482 max_adv_steps = block->nominal_rate * block->adv_comp; 34460: c5 01 movw r24, r10 34462: b4 01 movw r22, r8 34464: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 34468: f1 01 movw r30, r2 3446a: ec 5a subi r30, 0xAC ; 172 3446c: ff 4f sbci r31, 0xFF ; 255 3446e: 20 81 ld r18, Z 34470: 31 81 ldd r19, Z+1 ; 0x01 34472: 42 81 ldd r20, Z+2 ; 0x02 34474: 53 81 ldd r21, Z+3 ; 0x03 34476: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3447a: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3447e: 46 2f mov r20, r22 34480: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 34482: 3f b7 in r19, 0x3f ; 63 34484: 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. 34486: f1 01 movw r30, r2 34488: e9 5b subi r30, 0xB9 ; 185 3448a: ff 4f sbci r31, 0xFF ; 255 3448c: 20 81 ld r18, Z 3448e: 21 11 cpse r18, r1 34490: 27 c0 rjmp .+78 ; 0x344e0 block->accelerate_until = accelerate_steps; 34492: d1 01 movw r26, r2 34494: 59 96 adiw r26, 0x19 ; 25 34496: cd 92 st X+, r12 34498: dd 92 st X+, r13 3449a: ed 92 st X+, r14 3449c: fc 92 st X, r15 3449e: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 344a0: c4 0c add r12, r4 344a2: d5 1c adc r13, r5 344a4: e6 1c adc r14, r6 344a6: f7 1c adc r15, r7 344a8: f1 01 movw r30, r2 344aa: c5 8e std Z+29, r12 ; 0x1d 344ac: d6 8e std Z+30, r13 ; 0x1e 344ae: e7 8e std Z+31, r14 ; 0x1f 344b0: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 344b2: cf 88 ldd r12, Y+23 ; 0x17 344b4: c2 ae std Z+58, r12 ; 0x3a 344b6: d8 8c ldd r13, Y+24 ; 0x18 344b8: d3 ae std Z+59, r13 ; 0x3b 344ba: e9 8c ldd r14, Y+25 ; 0x19 344bc: e4 ae std Z+60, r14 ; 0x3c 344be: fa 8c ldd r15, Y+26 ; 0x1a 344c0: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 344c2: fe 96 adiw r30, 0x3e ; 62 344c4: 10 83 st Z, r17 344c6: 01 83 std Z+1, r16 ; 0x01 344c8: c9 a0 ldd r12, Y+33 ; 0x21 344ca: c2 82 std Z+2, r12 ; 0x02 344cc: d8 a0 ldd r13, Y+32 ; 0x20 344ce: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 344d0: 73 96 adiw r30, 0x13 ; 19 344d2: ed 88 ldd r14, Y+21 ; 0x15 344d4: e0 82 st Z, r14 344d6: fe 88 ldd r15, Y+22 ; 0x16 344d8: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 344da: 32 97 sbiw r30, 0x02 ; 2 344dc: 40 83 st Z, r20 344de: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 344e0: 3f bf out 0x3f, r19 ; 63 } 344e2: a1 96 adiw r28, 0x21 ; 33 344e4: 0f b6 in r0, 0x3f ; 63 344e6: f8 94 cli 344e8: de bf out 0x3e, r29 ; 62 344ea: 0f be out 0x3f, r0 ; 63 344ec: cd bf out 0x3d, r28 ; 61 344ee: df 91 pop r29 344f0: cf 91 pop r28 344f2: 1f 91 pop r17 344f4: 0f 91 pop r16 344f6: ff 90 pop r15 344f8: ef 90 pop r14 344fa: df 90 pop r13 344fc: cf 90 pop r12 344fe: bf 90 pop r11 34500: af 90 pop r10 34502: 9f 90 pop r9 34504: 8f 90 pop r8 34506: 7f 90 pop r7 34508: 6f 90 pop r6 3450a: 5f 90 pop r5 3450c: 4f 90 pop r4 3450e: 3f 90 pop r3 34510: 2f 90 pop r2 34512: 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; 34514: 1d 8a std Y+21, r1 ; 0x15 34516: 1e 8a std Y+22, r1 ; 0x16 34518: 83 cf rjmp .-250 ; 0x34420 #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; 3451a: 2d 81 ldd r18, Y+5 ; 0x05 3451c: 3e 81 ldd r19, Y+6 ; 0x06 3451e: 4f 81 ldd r20, Y+7 ; 0x07 34520: 58 85 ldd r21, Y+8 ; 0x08 34522: 82 e0 ldi r24, 0x02 ; 2 34524: 22 0f add r18, r18 34526: 33 1f adc r19, r19 34528: 44 1f adc r20, r20 3452a: 55 1f adc r21, r21 3452c: 8a 95 dec r24 3452e: d1 f7 brne .-12 ; 0x34524 34530: 89 81 ldd r24, Y+1 ; 0x01 34532: 9a 81 ldd r25, Y+2 ; 0x02 34534: ab 81 ldd r26, Y+3 ; 0x03 34536: bc 81 ldd r27, Y+4 ; 0x04 34538: 81 70 andi r24, 0x01 ; 1 3453a: 99 27 eor r25, r25 3453c: aa 27 eor r26, r26 3453e: bb 27 eor r27, r27 34540: 8d 83 std Y+5, r24 ; 0x05 34542: 9e 83 std Y+6, r25 ; 0x06 34544: af 83 std Y+7, r26 ; 0x07 34546: b8 87 std Y+8, r27 ; 0x08 34548: 89 80 ldd r8, Y+1 ; 0x01 3454a: 9a 80 ldd r9, Y+2 ; 0x02 3454c: ab 80 ldd r10, Y+3 ; 0x03 3454e: bc 80 ldd r11, Y+4 ; 0x04 34550: b6 94 lsr r11 34552: a7 94 ror r10 34554: 97 94 ror r9 34556: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 34558: cd 84 ldd r12, Y+13 ; 0x0d 3455a: de 84 ldd r13, Y+14 ; 0x0e 3455c: ef 84 ldd r14, Y+15 ; 0x0f 3455e: f8 88 ldd r15, Y+16 ; 0x10 34560: 89 89 ldd r24, Y+17 ; 0x11 34562: 9a 89 ldd r25, Y+18 ; 0x12 34564: ab 89 ldd r26, Y+19 ; 0x13 34566: bc 89 ldd r27, Y+20 ; 0x14 34568: 8c 15 cp r24, r12 3456a: 9d 05 cpc r25, r13 3456c: ae 05 cpc r26, r14 3456e: bf 05 cpc r27, r15 34570: 08 f4 brcc .+2 ; 0x34574 34572: 6f c0 rjmp .+222 ; 0x34652 // 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; 34574: 6c 01 movw r12, r24 34576: 7d 01 movw r14, r26 34578: 91 e0 ldi r25, 0x01 ; 1 3457a: c9 1a sub r12, r25 3457c: d1 08 sbc r13, r1 3457e: e1 08 sbc r14, r1 34580: f1 08 sbc r15, r1 34582: 8d 85 ldd r24, Y+13 ; 0x0d 34584: 9e 85 ldd r25, Y+14 ; 0x0e 34586: af 85 ldd r26, Y+15 ; 0x0f 34588: b8 89 ldd r27, Y+16 ; 0x10 3458a: c8 1a sub r12, r24 3458c: d9 0a sbc r13, r25 3458e: ea 0a sbc r14, r26 34590: fb 0a sbc r15, r27 34592: c7 01 movw r24, r14 34594: b6 01 movw r22, r12 34596: 62 0f add r22, r18 34598: 73 1f adc r23, r19 3459a: 84 1f adc r24, r20 3459c: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 3459e: cd 80 ldd r12, Y+5 ; 0x05 345a0: de 80 ldd r13, Y+6 ; 0x06 345a2: ef 80 ldd r14, Y+7 ; 0x07 345a4: f8 84 ldd r15, Y+8 ; 0x08 345a6: cd 28 or r12, r13 345a8: ce 28 or r12, r14 345aa: cf 28 or r12, r15 345ac: 41 f0 breq .+16 ; 0x345be accelerate_steps += acceleration_x2; 345ae: c9 84 ldd r12, Y+9 ; 0x09 345b0: da 84 ldd r13, Y+10 ; 0x0a 345b2: eb 84 ldd r14, Y+11 ; 0x0b 345b4: fc 84 ldd r15, Y+12 ; 0x0c 345b6: 6c 0d add r22, r12 345b8: 7d 1d adc r23, r13 345ba: 8e 1d adc r24, r14 345bc: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 345be: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 345c2: 75 01 movw r14, r10 345c4: 64 01 movw r12, r8 345c6: c2 0e add r12, r18 345c8: d3 1e adc r13, r19 345ca: e4 1e adc r14, r20 345cc: f5 1e adc r15, r21 345ce: 29 81 ldd r18, Y+1 ; 0x01 345d0: 3a 81 ldd r19, Y+2 ; 0x02 345d2: 4b 81 ldd r20, Y+3 ; 0x03 345d4: 5c 81 ldd r21, Y+4 ; 0x04 345d6: 2c 15 cp r18, r12 345d8: 3d 05 cpc r19, r13 345da: 4e 05 cpc r20, r14 345dc: 5f 05 cpc r21, r15 345de: 10 f4 brcc .+4 ; 0x345e4 345e0: 69 01 movw r12, r18 345e2: 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) { 345e4: 2b 8d ldd r18, Y+27 ; 0x1b 345e6: 22 23 and r18, r18 345e8: 09 f4 brne .+2 ; 0x345ec 345ea: 69 c0 rjmp .+210 ; 0x346be if(!accelerate_steps || !decelerate_steps) { 345ec: c1 14 cp r12, r1 345ee: d1 04 cpc r13, r1 345f0: e1 04 cpc r14, r1 345f2: f1 04 cpc r15, r1 345f4: 09 f4 brne .+2 ; 0x345f8 345f6: 66 c0 rjmp .+204 ; 0x346c4 // 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; 345f8: 4d 89 ldd r20, Y+21 ; 0x15 345fa: 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) { 345fc: 41 14 cp r4, r1 345fe: 51 04 cpc r5, r1 34600: 61 04 cpc r6, r1 34602: 71 04 cpc r7, r1 34604: 09 f4 brne .+2 ; 0x34608 34606: 3d cf rjmp .-390 ; 0x34482 // 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); 34608: a7 01 movw r20, r14 3460a: 96 01 movw r18, r12 3460c: 69 85 ldd r22, Y+9 ; 0x09 3460e: 7a 85 ldd r23, Y+10 ; 0x0a 34610: 8b 85 ldd r24, Y+11 ; 0x0b 34612: 9c 85 ldd r25, Y+12 ; 0x0c 34614: 0f 94 72 dd call 0x3bae4 ; 0x3bae4 <__mulsi3> 34618: 2d 85 ldd r18, Y+13 ; 0x0d 3461a: 3e 85 ldd r19, Y+14 ; 0x0e 3461c: 4f 85 ldd r20, Y+15 ; 0x0f 3461e: 58 89 ldd r21, Y+16 ; 0x10 34620: 62 0f add r22, r18 34622: 73 1f adc r23, r19 34624: 84 1f adc r24, r20 34626: 95 1f adc r25, r21 34628: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 3462c: 0f 94 05 e2 call 0x3c40a ; 0x3c40a max_adv_steps = max_rate * block->adv_comp; 34630: f1 01 movw r30, r2 34632: ec 5a subi r30, 0xAC ; 172 34634: ff 4f sbci r31, 0xFF ; 255 34636: 20 81 ld r18, Z 34638: 31 81 ldd r19, Z+1 ; 0x01 3463a: 42 81 ldd r20, Z+2 ; 0x02 3463c: 53 81 ldd r21, Z+3 ; 0x03 3463e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 34642: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 34646: 46 2f mov r20, r22 34648: 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; 3464a: 41 2c mov r4, r1 3464c: 51 2c mov r5, r1 3464e: 32 01 movw r6, r4 34650: 18 cf rjmp .-464 ; 0x34482 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; 34652: 6d 85 ldd r22, Y+13 ; 0x0d 34654: 7e 85 ldd r23, Y+14 ; 0x0e 34656: 8f 85 ldd r24, Y+15 ; 0x0f 34658: 98 89 ldd r25, Y+16 ; 0x10 3465a: c9 88 ldd r12, Y+17 ; 0x11 3465c: da 88 ldd r13, Y+18 ; 0x12 3465e: eb 88 ldd r14, Y+19 ; 0x13 34660: fc 88 ldd r15, Y+20 ; 0x14 34662: 6c 19 sub r22, r12 34664: 7d 09 sbc r23, r13 34666: 8e 09 sbc r24, r14 34668: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 3466a: cd 80 ldd r12, Y+5 ; 0x05 3466c: de 80 ldd r13, Y+6 ; 0x06 3466e: ef 80 ldd r14, Y+7 ; 0x07 34670: f8 84 ldd r15, Y+8 ; 0x08 34672: cd 28 or r12, r13 34674: ce 28 or r12, r14 34676: cf 28 or r12, r15 34678: 41 f0 breq .+16 ; 0x3468a decelerate_steps += acceleration_x2; 3467a: c9 84 ldd r12, Y+9 ; 0x09 3467c: da 84 ldd r13, Y+10 ; 0x0a 3467e: eb 84 ldd r14, Y+11 ; 0x0b 34680: fc 84 ldd r15, Y+12 ; 0x0c 34682: 6c 0d add r22, r12 34684: 7d 1d adc r23, r13 34686: 8e 1d adc r24, r14 34688: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 3468a: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 3468e: 82 0e add r8, r18 34690: 93 1e adc r9, r19 34692: a4 1e adc r10, r20 34694: b5 1e adc r11, r21 34696: 49 80 ldd r4, Y+1 ; 0x01 34698: 5a 80 ldd r5, Y+2 ; 0x02 3469a: 6b 80 ldd r6, Y+3 ; 0x03 3469c: 7c 80 ldd r7, Y+4 ; 0x04 3469e: 84 14 cp r8, r4 346a0: 95 04 cpc r9, r5 346a2: a6 04 cpc r10, r6 346a4: b7 04 cpc r11, r7 346a6: 10 f4 brcc .+4 ; 0x346ac 346a8: 24 01 movw r4, r8 346aa: 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; 346ac: c9 80 ldd r12, Y+1 ; 0x01 346ae: da 80 ldd r13, Y+2 ; 0x02 346b0: eb 80 ldd r14, Y+3 ; 0x03 346b2: fc 80 ldd r15, Y+4 ; 0x04 346b4: c4 18 sub r12, r4 346b6: d5 08 sbc r13, r5 346b8: e6 08 sbc r14, r6 346ba: f7 08 sbc r15, r7 346bc: 93 cf rjmp .-218 ; 0x345e4 // 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; 346be: 40 e0 ldi r20, 0x00 ; 0 346c0: 80 e0 ldi r24, 0x00 ; 0 346c2: c3 cf rjmp .-122 ; 0x3464a #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; 346c4: 4d 89 ldd r20, Y+21 ; 0x15 346c6: 8e 89 ldd r24, Y+22 ; 0x16 346c8: c0 cf rjmp .-128 ; 0x3464a 000346ca : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 346ca: 0f 94 ed a0 call 0x341da ; 0x341da 346ce: 80 32 cpi r24, 0x20 ; 32 346d0: 29 f0 breq .+10 ; 0x346dc putch(STK_FAILED); 346d2: 81 e1 ldi r24, 0x11 ; 17 346d4: 0f 94 e6 a0 call 0x341cc ; 0x341cc softReset(); 346d8: 0e 94 92 68 call 0xd124 ; 0xd124 } putch(STK_INSYNC); 346dc: 84 e1 ldi r24, 0x14 ; 20 346de: 0d 94 e6 a0 jmp 0x341cc ; 0x341cc 000346e2 : } static void getNch(uint8_t count) { 346e2: cf 93 push r28 346e4: c8 2f mov r28, r24 do getch(); while (--count); 346e6: 0f 94 ed a0 call 0x341da ; 0x341da 346ea: c1 50 subi r28, 0x01 ; 1 346ec: e1 f7 brne .-8 ; 0x346e6 verifySpace(); } 346ee: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 346f0: 0d 94 65 a3 jmp 0x346ca ; 0x346ca 000346f4 : /// @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) { 346f4: 0f 93 push r16 346f6: 1f 93 push r17 346f8: cf 93 push r28 346fa: df 93 push r29 346fc: eb 01 movw r28, r22 346fe: 14 2f mov r17, r20 34700: 05 2f mov r16, r21 lcd_putc(chr); 34702: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_puts_P(str); 34706: ce 01 movw r24, r28 34708: 0e 94 11 70 call 0xe022 ; 0xe022 lcd_putc(':'); 3470c: 8a e3 ldi r24, 0x3A ; 58 3470e: 0e 94 15 70 call 0xe02a ; 0xe02a 34712: ce 01 movw r24, r28 34714: 0f 94 cd da call 0x3b59a ; 0x3b59a <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 34718: 9e e0 ldi r25, 0x0E ; 14 3471a: 98 1b sub r25, r24 3471c: 89 2f mov r24, r25 3471e: 0e 94 1c 70 call 0xe038 ; 0xe038 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 34722: 0f 93 push r16 34724: 1f 93 push r17 34726: 81 e3 ldi r24, 0x31 ; 49 34728: 9b ea ldi r25, 0xAB ; 171 3472a: 9f 93 push r25 3472c: 8f 93 push r24 3472e: 0e 94 ff 6f call 0xdffe ; 0xdffe 34732: 0f 90 pop r0 34734: 0f 90 pop r0 34736: 0f 90 pop r0 34738: 0f 90 pop r0 } 3473a: df 91 pop r29 3473c: cf 91 pop r28 3473e: 1f 91 pop r17 34740: 0f 91 pop r16 34742: 08 95 ret 00034744 : * \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) { 34744: 0f 93 push r16 34746: 1f 93 push r17 34748: cf 93 push r28 3474a: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 3474c: fc 01 movw r30, r24 3474e: 23 81 ldd r18, Z+3 ; 0x03 34750: 22 23 and r18, r18 34752: 31 f0 breq .+12 ; 0x34760 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 34754: 80 e0 ldi r24, 0x00 ; 0 } 34756: df 91 pop r29 34758: cf 91 pop r28 3475a: 1f 91 pop r17 3475c: 0f 91 pop r16 3475e: 08 95 ret 34760: 8b 01 movw r16, r22 34762: ec 01 movw r28, r24 34764: fb 01 movw r30, r22 34766: 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)) { 34768: 80 31 cpi r24, 0x10 ; 16 3476a: 39 f5 brne .+78 ; 0x347ba type_ = FAT_FILE_TYPE_ROOT_FIXED; 3476c: 82 e0 ldi r24, 0x02 ; 2 3476e: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 34770: 1d 8a std Y+21, r1 ; 0x15 34772: 1e 8a std Y+22, r1 ; 0x16 34774: 1f 8a std Y+23, r1 ; 0x17 34776: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 34778: 80 8d ldd r24, Z+24 ; 0x18 3477a: 91 8d ldd r25, Z+25 ; 0x19 3477c: b0 e0 ldi r27, 0x00 ; 0 3477e: a0 e0 ldi r26, 0x00 ; 0 34780: 25 e0 ldi r18, 0x05 ; 5 34782: 88 0f add r24, r24 34784: 99 1f adc r25, r25 34786: aa 1f adc r26, r26 34788: bb 1f adc r27, r27 3478a: 2a 95 dec r18 3478c: d1 f7 brne .-12 ; 0x34782 3478e: 89 8b std Y+17, r24 ; 0x11 34790: 9a 8b std Y+18, r25 ; 0x12 34792: ab 8b std Y+19, r26 ; 0x13 34794: 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; 34796: 1a 8f std Y+26, r17 ; 0x1a 34798: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 3479a: 81 e0 ldi r24, 0x01 ; 1 3479c: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 3479e: 1c 82 std Y+4, r1 ; 0x04 347a0: 1d 82 std Y+5, r1 ; 0x05 347a2: 1e 82 std Y+6, r1 ; 0x06 347a4: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 347a6: 18 86 std Y+8, r1 ; 0x08 347a8: 19 86 std Y+9, r1 ; 0x09 347aa: 1a 86 std Y+10, r1 ; 0x0a 347ac: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 347ae: 1c 86 std Y+12, r1 ; 0x0c 347b0: 1d 86 std Y+13, r1 ; 0x0d 347b2: 1e 86 std Y+14, r1 ; 0x0e 347b4: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 347b6: 18 8a std Y+16, r1 ; 0x10 347b8: ce cf rjmp .-100 ; 0x34756 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) { 347ba: 80 32 cpi r24, 0x20 ; 32 347bc: 59 f6 brne .-106 ; 0x34754 type_ = FAT_FILE_TYPE_ROOT32; 347be: 83 e0 ldi r24, 0x03 ; 3 347c0: 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_;} 347c2: 42 8d ldd r20, Z+26 ; 0x1a 347c4: 53 8d ldd r21, Z+27 ; 0x1b 347c6: 64 8d ldd r22, Z+28 ; 0x1c 347c8: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 347ca: 4d 8b std Y+21, r20 ; 0x15 347cc: 5e 8b std Y+22, r21 ; 0x16 347ce: 6f 8b std Y+23, r22 ; 0x17 347d0: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 347d2: 9e 01 movw r18, r28 347d4: 2f 5e subi r18, 0xEF ; 239 347d6: 3f 4f sbci r19, 0xFF ; 255 347d8: c8 01 movw r24, r16 347da: 0f 94 aa 6b call 0x2d754 ; 0x2d754 347de: 81 11 cpse r24, r1 347e0: da cf rjmp .-76 ; 0x34796 347e2: b8 cf rjmp .-144 ; 0x34754 000347e4 : * * \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() { 347e4: cf 93 push r28 347e6: df 93 push r29 347e8: ec 01 movw r28, r24 bool rtn = sync(); 347ea: 0f 94 f5 6c call 0x2d9ea ; 0x2d9ea type_ = FAT_FILE_TYPE_CLOSED; 347ee: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 347f0: df 91 pop r29 347f2: cf 91 pop r28 347f4: 08 95 ret 000347f6 : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 347f6: cf 93 push r28 347f8: df 93 push r29 347fa: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 347fc: 46 2f mov r20, r22 347fe: 41 70 andi r20, 0x01 ; 1 34800: 6c 85 ldd r22, Y+12 ; 0x0c 34802: 7d 85 ldd r23, Y+13 ; 0x0d 34804: 8e 85 ldd r24, Y+14 ; 0x0e 34806: 9f 85 ldd r25, Y+15 ; 0x0f 34808: 0f 94 58 6a call 0x2d4b0 ; 0x2d4b0 3480c: 88 23 and r24, r24 3480e: 51 f0 breq .+20 ; 0x34824 return vol_->cache()->dir + dirIndex_; 34810: 88 89 ldd r24, Y+16 ; 0x10 34812: 20 e2 ldi r18, 0x20 ; 32 34814: 82 9f mul r24, r18 34816: c0 01 movw r24, r0 34818: 11 24 eor r1, r1 3481a: 88 58 subi r24, 0x88 ; 136 3481c: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 3481e: df 91 pop r29 34820: cf 91 pop r28 34822: 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; 34824: 90 e0 ldi r25, 0x00 ; 0 34826: 80 e0 ldi r24, 0x00 ; 0 34828: fa cf rjmp .-12 ; 0x3481e 0003482a : * \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) { 3482a: cf 93 push r28 3482c: df 93 push r29 3482e: eb 01 movw r28, r22 34830: fc 01 movw r30, r24 34832: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 34834: 21 11 cpse r18, r1 34836: 04 c0 rjmp .+8 ; 0x34840 34838: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 3483a: df 91 pop r29 3483c: cf 91 pop r28 3483e: 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; 34840: 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()) { 34842: 22 30 cpi r18, 0x02 ; 2 34844: 28 f4 brcc .+10 ; 0x34850 name[0] = '/'; 34846: 8f e2 ldi r24, 0x2F ; 47 34848: 88 83 st Y, r24 name[1] = '\0'; 3484a: 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; 3484c: 81 e0 ldi r24, 0x01 ; 1 3484e: f5 cf rjmp .-22 ; 0x3483a name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 34850: 60 e0 ldi r22, 0x00 ; 0 34852: 0f 94 fb a3 call 0x347f6 ; 0x347f6 if (!p) return false; 34856: 00 97 sbiw r24, 0x00 ; 0 34858: 79 f3 breq .-34 ; 0x34838 3485a: 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; 3485c: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 3485e: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 34860: 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; 34862: 2d 91 ld r18, X+ 34864: 20 32 cpi r18, 0x20 ; 32 34866: 99 f0 breq .+38 ; 0x3488e if (i == 8) name[j++] = '.'; 34868: 88 30 cpi r24, 0x08 ; 8 3486a: 31 f4 brne .+12 ; 0x34878 3486c: 9e 01 movw r18, r28 3486e: 26 0f add r18, r22 34870: 31 1d adc r19, r1 34872: f9 01 movw r30, r18 34874: 90 83 st Z, r25 34876: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 34878: 9e 01 movw r18, r28 3487a: 26 0f add r18, r22 3487c: 31 1d adc r19, r1 3487e: ad 01 movw r20, r26 34880: 41 50 subi r20, 0x01 ; 1 34882: 51 09 sbc r21, r1 34884: fa 01 movw r30, r20 34886: 40 81 ld r20, Z 34888: f9 01 movw r30, r18 3488a: 40 83 st Z, r20 3488c: 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++) { 3488e: 8f 5f subi r24, 0xFF ; 255 34890: 8b 30 cpi r24, 0x0B ; 11 34892: 39 f7 brne .-50 ; 0x34862 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 34894: fe 01 movw r30, r28 34896: e6 0f add r30, r22 34898: f1 1d adc r31, r1 3489a: 10 82 st Z, r1 3489c: d7 cf rjmp .-82 ; 0x3484c 0003489e : 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() { 3489e: 3f 92 push r3 348a0: 4f 92 push r4 348a2: 5f 92 push r5 348a4: 6f 92 push r6 348a6: 7f 92 push r7 348a8: 8f 92 push r8 348aa: 9f 92 push r9 348ac: af 92 push r10 348ae: bf 92 push r11 348b0: cf 92 push r12 348b2: df 92 push r13 348b4: ef 92 push r14 348b6: ff 92 push r15 348b8: 0f 93 push r16 348ba: 1f 93 push r17 348bc: cf 93 push r28 348be: df 93 push r29 348c0: cd b7 in r28, 0x3d ; 61 348c2: de b7 in r29, 0x3e ; 62 348c4: 2c 97 sbiw r28, 0x0c ; 12 348c6: 0f b6 in r0, 0x3f ; 63 348c8: f8 94 cli 348ca: de bf out 0x3e, r29 ; 62 348cc: 0f be out 0x3f, r0 ; 63 348ce: cd bf out 0x3d, r28 ; 61 348d0: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 348d2: dc 01 movw r26, r24 348d4: 59 96 adiw r26, 0x19 ; 25 348d6: 8d 90 ld r8, X+ 348d8: 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; 348da: f4 01 movw r30, r8 348dc: 81 85 ldd r24, Z+9 ; 0x09 348de: 92 85 ldd r25, Z+10 ; 0x0a 348e0: a3 85 ldd r26, Z+11 ; 0x0b 348e2: b4 85 ldd r27, Z+12 ; 0x0c 348e4: 9c 01 movw r18, r24 348e6: ad 01 movw r20, r26 348e8: 2f 5f subi r18, 0xFF ; 255 348ea: 3f 4f sbci r19, 0xFF ; 255 348ec: 4f 4f sbci r20, 0xFF ; 255 348ee: 5f 4f sbci r21, 0xFF ; 255 348f0: 29 87 std Y+9, r18 ; 0x09 348f2: 3a 87 std Y+10, r19 ; 0x0a 348f4: 4b 87 std Y+11, r20 ; 0x0b 348f6: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 348f8: d5 01 movw r26, r10 348fa: 14 96 adiw r26, 0x04 ; 4 348fc: 4d 90 ld r4, X+ 348fe: 5d 90 ld r5, X+ 34900: 6d 90 ld r6, X+ 34902: 7c 90 ld r7, X 34904: 17 97 sbiw r26, 0x07 ; 7 34906: 41 14 cp r4, r1 34908: 51 04 cpc r5, r1 3490a: 61 04 cpc r6, r1 3490c: 71 04 cpc r7, r1 3490e: 09 f4 brne .+2 ; 0x34912 34910: 59 c0 rjmp .+178 ; 0x349c4 // try to make file contiguous bgnCluster = *curCluster + 1; 34912: bf ef ldi r27, 0xFF ; 255 34914: 4b 1a sub r4, r27 34916: 5b 0a sbc r5, r27 34918: 6b 0a sbc r6, r27 3491a: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 3491c: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 3491e: 73 01 movw r14, r6 34920: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 34922: 1d 82 std Y+5, r1 ; 0x05 34924: 1e 82 std Y+6, r1 ; 0x06 34926: 1f 82 std Y+7, r1 ; 0x07 34928: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 3492a: f4 01 movw r30, r8 3492c: 81 85 ldd r24, Z+9 ; 0x09 3492e: 92 85 ldd r25, Z+10 ; 0x0a 34930: a3 85 ldd r26, Z+11 ; 0x0b 34932: b4 85 ldd r27, Z+12 ; 0x0c 34934: 2d 81 ldd r18, Y+5 ; 0x05 34936: 3e 81 ldd r19, Y+6 ; 0x06 34938: 4f 81 ldd r20, Y+7 ; 0x07 3493a: 58 85 ldd r21, Y+8 ; 0x08 3493c: 28 17 cp r18, r24 3493e: 39 07 cpc r19, r25 34940: 4a 07 cpc r20, r26 34942: 5b 07 cpc r21, r27 34944: 08 f0 brcs .+2 ; 0x34948 34946: 56 c0 rjmp .+172 ; 0x349f4 // past end - start from beginning of FAT if (endCluster > fatEnd) { 34948: 89 85 ldd r24, Y+9 ; 0x09 3494a: 9a 85 ldd r25, Y+10 ; 0x0a 3494c: ab 85 ldd r26, Y+11 ; 0x0b 3494e: bc 85 ldd r27, Y+12 ; 0x0c 34950: 8c 15 cp r24, r12 34952: 9d 05 cpc r25, r13 34954: ae 05 cpc r26, r14 34956: bf 05 cpc r27, r15 34958: 50 f4 brcc .+20 ; 0x3496e bgnCluster = endCluster = 2; 3495a: 82 e0 ldi r24, 0x02 ; 2 3495c: c8 2e mov r12, r24 3495e: d1 2c mov r13, r1 34960: e1 2c mov r14, r1 34962: f1 2c mov r15, r1 34964: 92 e0 ldi r25, 0x02 ; 2 34966: 49 2e mov r4, r25 34968: 51 2c mov r5, r1 3496a: 61 2c mov r6, r1 3496c: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 3496e: 9e 01 movw r18, r28 34970: 2f 5f subi r18, 0xFF ; 255 34972: 3f 4f sbci r19, 0xFF ; 255 34974: b7 01 movw r22, r14 34976: a6 01 movw r20, r12 34978: c4 01 movw r24, r8 3497a: 0f 94 27 6b call 0x2d64e ; 0x2d64e 3497e: 88 23 and r24, r24 34980: c9 f1 breq .+114 ; 0x349f4 if (f != 0) { 34982: 89 81 ldd r24, Y+1 ; 0x01 34984: 9a 81 ldd r25, Y+2 ; 0x02 34986: ab 81 ldd r26, Y+3 ; 0x03 34988: bc 81 ldd r27, Y+4 ; 0x04 3498a: 89 2b or r24, r25 3498c: 8a 2b or r24, r26 3498e: 8b 2b or r24, r27 34990: 01 f1 breq .+64 ; 0x349d2 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 34992: 26 01 movw r4, r12 34994: 37 01 movw r6, r14 34996: 9f ef ldi r25, 0xFF ; 255 34998: 49 1a sub r4, r25 3499a: 59 0a sbc r5, r25 3499c: 69 0a sbc r6, r25 3499e: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 349a0: 2d 81 ldd r18, Y+5 ; 0x05 349a2: 3e 81 ldd r19, Y+6 ; 0x06 349a4: 4f 81 ldd r20, Y+7 ; 0x07 349a6: 58 85 ldd r21, Y+8 ; 0x08 349a8: 2f 5f subi r18, 0xFF ; 255 349aa: 3f 4f sbci r19, 0xFF ; 255 349ac: 4f 4f sbci r20, 0xFF ; 255 349ae: 5f 4f sbci r21, 0xFF ; 255 349b0: 2d 83 std Y+5, r18 ; 0x05 349b2: 3e 83 std Y+6, r19 ; 0x06 349b4: 4f 83 std Y+7, r20 ; 0x07 349b6: 58 87 std Y+8, r21 ; 0x08 349b8: 3f ef ldi r19, 0xFF ; 255 349ba: c3 1a sub r12, r19 349bc: d3 0a sbc r13, r19 349be: e3 0a sbc r14, r19 349c0: f3 0a sbc r15, r19 349c2: b3 cf rjmp .-154 ; 0x3492a // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 349c4: 40 80 ld r4, Z 349c6: 51 80 ldd r5, Z+1 ; 0x01 349c8: 62 80 ldd r6, Z+2 ; 0x02 349ca: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 349cc: 33 24 eor r3, r3 349ce: 33 94 inc r3 349d0: a6 cf rjmp .-180 ; 0x3491e 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) { 349d2: c4 14 cp r12, r4 349d4: d5 04 cpc r13, r5 349d6: e6 04 cpc r14, r6 349d8: f7 04 cpc r15, r7 349da: 11 f7 brne .-60 ; 0x349a0 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); 349dc: 0f ef ldi r16, 0xFF ; 255 349de: 1f ef ldi r17, 0xFF ; 255 349e0: 2f ef ldi r18, 0xFF ; 255 349e2: 3f e0 ldi r19, 0x0F ; 15 349e4: b7 01 movw r22, r14 349e6: a6 01 movw r20, r12 349e8: c4 01 movw r24, r8 349ea: 0f 94 95 6a call 0x2d52a ; 0x2d52a 349ee: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 349f0: 81 11 cpse r24, r1 349f2: 1a c0 rjmp .+52 ; 0x34a28 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 349f4: 71 2c mov r7, r1 } 349f6: 87 2d mov r24, r7 349f8: 2c 96 adiw r28, 0x0c ; 12 349fa: 0f b6 in r0, 0x3f ; 63 349fc: f8 94 cli 349fe: de bf out 0x3e, r29 ; 62 34a00: 0f be out 0x3f, r0 ; 63 34a02: cd bf out 0x3d, r28 ; 61 34a04: df 91 pop r29 34a06: cf 91 pop r28 34a08: 1f 91 pop r17 34a0a: 0f 91 pop r16 34a0c: ff 90 pop r15 34a0e: ef 90 pop r14 34a10: df 90 pop r13 34a12: cf 90 pop r12 34a14: bf 90 pop r11 34a16: af 90 pop r10 34a18: 9f 90 pop r9 34a1a: 8f 90 pop r8 34a1c: 7f 90 pop r7 34a1e: 6f 90 pop r6 34a20: 5f 90 pop r5 34a22: 4f 90 pop r4 34a24: 3f 90 pop r3 34a26: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 34a28: f5 01 movw r30, r10 34a2a: 44 81 ldd r20, Z+4 ; 0x04 34a2c: 55 81 ldd r21, Z+5 ; 0x05 34a2e: 66 81 ldd r22, Z+6 ; 0x06 34a30: 77 81 ldd r23, Z+7 ; 0x07 34a32: 41 15 cp r20, r1 34a34: 51 05 cpc r21, r1 34a36: 61 05 cpc r22, r1 34a38: 71 05 cpc r23, r1 34a3a: 39 f0 breq .+14 ; 0x34a4a // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 34a3c: 97 01 movw r18, r14 34a3e: 86 01 movw r16, r12 34a40: c4 01 movw r24, r8 34a42: 0f 94 95 6a call 0x2d52a ; 0x2d52a 34a46: 88 23 and r24, r24 34a48: a9 f2 breq .-86 ; 0x349f4 } // return first cluster number to caller *curCluster = bgnCluster; 34a4a: d5 01 movw r26, r10 34a4c: 14 96 adiw r26, 0x04 ; 4 34a4e: cd 92 st X+, r12 34a50: dd 92 st X+, r13 34a52: ed 92 st X+, r14 34a54: fc 92 st X, r15 34a56: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 34a58: 33 20 and r3, r3 34a5a: 51 f0 breq .+20 ; 0x34a70 34a5c: d7 01 movw r26, r14 34a5e: c6 01 movw r24, r12 34a60: 01 96 adiw r24, 0x01 ; 1 34a62: a1 1d adc r26, r1 34a64: b1 1d adc r27, r1 34a66: f4 01 movw r30, r8 34a68: 80 83 st Z, r24 34a6a: 91 83 std Z+1, r25 ; 0x01 34a6c: a2 83 std Z+2, r26 ; 0x02 34a6e: 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) { 34a70: f5 01 movw r30, r10 34a72: 85 89 ldd r24, Z+21 ; 0x15 34a74: 96 89 ldd r25, Z+22 ; 0x16 34a76: a7 89 ldd r26, Z+23 ; 0x17 34a78: b0 8d ldd r27, Z+24 ; 0x18 34a7a: 89 2b or r24, r25 34a7c: 8a 2b or r24, r26 34a7e: 8b 2b or r24, r27 34a80: 09 f0 breq .+2 ; 0x34a84 34a82: b9 cf rjmp .-142 ; 0x349f6 firstCluster_ = curCluster_; 34a84: c5 8a std Z+21, r12 ; 0x15 34a86: d6 8a std Z+22, r13 ; 0x16 34a88: e7 8a std Z+23, r14 ; 0x17 34a8a: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 34a8c: 81 81 ldd r24, Z+1 ; 0x01 34a8e: 80 68 ori r24, 0x80 ; 128 34a90: 81 83 std Z+1, r24 ; 0x01 34a92: b1 cf rjmp .-158 ; 0x349f6 00034a94 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 34a94: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34a96: 0d b4 in r0, 0x2d ; 45 34a98: 07 fe sbrs r0, 7 34a9a: fd cf rjmp .-6 ; 0x34a96 } 34a9c: 08 95 ret 00034a9e : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 34a9e: 8f ef ldi r24, 0xFF ; 255 34aa0: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34aa2: 0d b4 in r0, 0x2d ; 45 34aa4: 07 fe sbrs r0, 7 34aa6: fd cf rjmp .-6 ; 0x34aa2 return SPDR; 34aa8: 8e b5 in r24, 0x2e ; 46 } 34aaa: 08 95 ret 00034aac : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 34aac: 8f 92 push r8 34aae: 9f 92 push r9 34ab0: af 92 push r10 34ab2: bf 92 push r11 34ab4: ef 92 push r14 34ab6: ff 92 push r15 34ab8: 0f 93 push r16 34aba: 1f 93 push r17 34abc: cf 93 push r28 34abe: 7c 01 movw r14, r24 34ac0: c6 2f mov r28, r22 34ac2: 49 01 movw r8, r18 34ac4: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 34ac6: fc 01 movw r30, r24 34ac8: 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); 34aca: 89 2f mov r24, r25 34acc: 80 6a ori r24, 0xA0 ; 160 34ace: 86 95 lsr r24 34ad0: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 34ad2: 90 fd sbrc r25, 0 34ad4: 03 c0 rjmp .+6 ; 0x34adc 34ad6: 81 e0 ldi r24, 0x01 ; 1 34ad8: 96 30 cpi r25, 0x06 ; 6 34ada: 09 f4 brne .+2 ; 0x34ade 34adc: 80 e0 ldi r24, 0x00 ; 0 34ade: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 34ae0: 9f b7 in r25, 0x3f ; 63 34ae2: f8 94 cli 34ae4: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34ae8: 8f 7b andi r24, 0xBF ; 191 34aea: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34aee: 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); 34af0: 8c e2 ldi r24, 0x2C ; 44 34af2: 91 e0 ldi r25, 0x01 ; 1 34af4: 0f 94 67 75 call 0x2eace ; 0x2eace // send command spiSend(cmd | 0x40); 34af8: 8c 2f mov r24, r28 34afa: 80 64 ori r24, 0x40 ; 64 34afc: 0f 94 4a a5 call 0x34a94 ; 0x34a94 34b00: 08 e1 ldi r16, 0x18 ; 24 34b02: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 34b04: d5 01 movw r26, r10 34b06: c4 01 movw r24, r8 34b08: 00 2e mov r0, r16 34b0a: 04 c0 rjmp .+8 ; 0x34b14 34b0c: b6 95 lsr r27 34b0e: a7 95 ror r26 34b10: 97 95 ror r25 34b12: 87 95 ror r24 34b14: 0a 94 dec r0 34b16: d2 f7 brpl .-12 ; 0x34b0c 34b18: 0f 94 4a a5 call 0x34a94 ; 0x34a94 34b1c: 08 50 subi r16, 0x08 ; 8 34b1e: 11 09 sbc r17, r1 34b20: 08 3f cpi r16, 0xF8 ; 248 34b22: ff ef ldi r31, 0xFF ; 255 34b24: 1f 07 cpc r17, r31 34b26: 71 f7 brne .-36 ; 0x34b04 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 34b28: 85 e9 ldi r24, 0x95 ; 149 34b2a: cc 23 and r28, r28 34b2c: 21 f0 breq .+8 ; 0x34b36 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 34b2e: 87 e8 ldi r24, 0x87 ; 135 34b30: c8 30 cpi r28, 0x08 ; 8 34b32: 09 f0 breq .+2 ; 0x34b36 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34b34: 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); 34b36: 0f 94 4a a5 call 0x34a94 ; 0x34a94 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 34b3a: cc 30 cpi r28, 0x0C ; 12 34b3c: 11 f4 brne .+4 ; 0x34b42 34b3e: 0f 94 4f a5 call 0x34a9e ; 0x34a9e // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34b42: 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 */ } 34b44: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 34b48: f7 01 movw r30, r14 34b4a: 82 83 std Z+2, r24 ; 0x02 34b4c: 87 ff sbrs r24, 7 34b4e: 04 c0 rjmp .+8 ; 0x34b58 34b50: cf 3f cpi r28, 0xFF ; 255 34b52: 11 f0 breq .+4 ; 0x34b58 34b54: cf 5f subi r28, 0xFF ; 255 34b56: f6 cf rjmp .-20 ; 0x34b44 return status_; } 34b58: cf 91 pop r28 34b5a: 1f 91 pop r17 34b5c: 0f 91 pop r16 34b5e: ff 90 pop r15 34b60: ef 90 pop r14 34b62: bf 90 pop r11 34b64: af 90 pop r10 34b66: 9f 90 pop r9 34b68: 8f 90 pop r8 34b6a: 08 95 ret 00034b6c : * \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) { 34b6c: 0f 93 push r16 34b6e: 1f 93 push r17 34b70: cf 93 push r28 34b72: df 93 push r29 34b74: ec 01 movw r28, r24 34b76: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 34b78: 8b 81 ldd r24, Y+3 ; 0x03 34b7a: 83 30 cpi r24, 0x03 ; 3 34b7c: 39 f0 breq .+14 ; 0x34b8c 34b7e: 89 e0 ldi r24, 0x09 ; 9 34b80: 44 0f add r20, r20 34b82: 55 1f adc r21, r21 34b84: 66 1f adc r22, r22 34b86: 77 1f adc r23, r23 34b88: 8a 95 dec r24 34b8a: d1 f7 brne .-12 ; 0x34b80 if (cardCommand(CMD24, blockNumber)) { 34b8c: 9a 01 movw r18, r20 34b8e: ab 01 movw r20, r22 34b90: 68 e1 ldi r22, 0x18 ; 24 34b92: ce 01 movw r24, r28 34b94: 0f 94 56 a5 call 0x34aac ; 0x34aac 34b98: 88 23 and r24, r24 34b9a: 19 f0 breq .+6 ; 0x34ba2 34b9c: 86 e0 ldi r24, 0x06 ; 6 34b9e: 88 83 st Y, r24 34ba0: 39 c0 rjmp .+114 ; 0x34c14 } //------------------------------------------------------------------------------ /** 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; 34ba2: 8e ef ldi r24, 0xFE ; 254 34ba4: 8e bd out 0x2e, r24 ; 46 34ba6: f8 01 movw r30, r16 34ba8: c8 01 movw r24, r16 34baa: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34bac: 0d b4 in r0, 0x2d ; 45 34bae: 07 fe sbrs r0, 7 34bb0: fd cf rjmp .-6 ; 0x34bac SPDR = buf[i]; 34bb2: 20 81 ld r18, Z 34bb4: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34bb6: 0d b4 in r0, 0x2d ; 45 34bb8: 07 fe sbrs r0, 7 34bba: fd cf rjmp .-6 ; 0x34bb6 SPDR = buf[i + 1]; 34bbc: 21 81 ldd r18, Z+1 ; 0x01 34bbe: 2e bd out 0x2e, r18 ; 46 34bc0: 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) { 34bc2: e8 17 cp r30, r24 34bc4: f9 07 cpc r31, r25 34bc6: 91 f7 brne .-28 ; 0x34bac 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 */ } 34bc8: 0d b4 in r0, 0x2d ; 45 34bca: 07 fe sbrs r0, 7 34bcc: fd cf rjmp .-6 ; 0x34bc8 //------------------------------------------------------------------------------ // 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 34bce: 8f ef ldi r24, 0xFF ; 255 34bd0: 0f 94 4a a5 call 0x34a94 ; 0x34a94 spiSend(0xff); // dummy crc 34bd4: 8f ef ldi r24, 0xFF ; 255 34bd6: 0f 94 4a a5 call 0x34a94 ; 0x34a94 status_ = spiRec(); 34bda: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 34bde: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 34be0: 8f 71 andi r24, 0x1F ; 31 34be2: 85 30 cpi r24, 0x05 ; 5 34be4: 99 f4 brne .+38 ; 0x34c0c goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 34be6: 88 e5 ldi r24, 0x58 ; 88 34be8: 92 e0 ldi r25, 0x02 ; 2 34bea: 0f 94 67 75 call 0x2eace ; 0x2eace 34bee: 18 2f mov r17, r24 34bf0: 87 e1 ldi r24, 0x17 ; 23 34bf2: 11 23 and r17, r17 34bf4: a1 f2 breq .-88 ; 0x34b9e error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 34bf6: 20 e0 ldi r18, 0x00 ; 0 34bf8: 30 e0 ldi r19, 0x00 ; 0 34bfa: a9 01 movw r20, r18 34bfc: 6d e0 ldi r22, 0x0D ; 13 34bfe: ce 01 movw r24, r28 34c00: 0f 94 56 a5 call 0x34aac ; 0x34aac 34c04: 88 23 and r24, r24 34c06: 51 f0 breq .+20 ; 0x34c1c 34c08: 86 e1 ldi r24, 0x16 ; 22 34c0a: c9 cf rjmp .-110 ; 0x34b9e 34c0c: 83 e1 ldi r24, 0x13 ; 19 34c0e: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 34c10: 0f 94 5e 75 call 0x2eabc ; 0x2eabc } chipSelectHigh(); return true; fail: chipSelectHigh(); 34c14: 0f 94 5e 75 call 0x2eabc ; 0x2eabc return false; 34c18: 10 e0 ldi r17, 0x00 ; 0 34c1a: 06 c0 rjmp .+12 ; 0x34c28 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()) { 34c1c: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 34c20: 81 11 cpse r24, r1 34c22: f2 cf rjmp .-28 ; 0x34c08 error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 34c24: 0f 94 5e 75 call 0x2eabc ; 0x2eabc return true; fail: chipSelectHigh(); return false; } 34c28: 81 2f mov r24, r17 34c2a: df 91 pop r29 34c2c: cf 91 pop r28 34c2e: 1f 91 pop r17 34c30: 0f 91 pop r16 34c32: 08 95 ret 00034c34 : * \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) { 34c34: 2f 92 push r2 34c36: 3f 92 push r3 34c38: 4f 92 push r4 34c3a: 5f 92 push r5 34c3c: 6f 92 push r6 34c3e: 7f 92 push r7 34c40: 8f 92 push r8 34c42: 9f 92 push r9 34c44: af 92 push r10 34c46: bf 92 push r11 34c48: cf 92 push r12 34c4a: df 92 push r13 34c4c: ef 92 push r14 34c4e: ff 92 push r15 34c50: 0f 93 push r16 34c52: 1f 93 push r17 34c54: cf 93 push r28 34c56: df 93 push r29 34c58: ec 01 movw r28, r24 34c5a: 2a 01 movw r4, r20 34c5c: 3b 01 movw r6, r22 34c5e: 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; 34c60: 8b 81 ldd r24, Y+3 ; 0x03 34c62: 83 30 cpi r24, 0x03 ; 3 34c64: 39 f0 breq .+14 ; 0x34c74 34c66: 69 e0 ldi r22, 0x09 ; 9 34c68: 44 0c add r4, r4 34c6a: 55 1c adc r5, r5 34c6c: 66 1c adc r6, r6 34c6e: 77 1c adc r7, r7 34c70: 6a 95 dec r22 34c72: d1 f7 brne .-12 ; 0x34c68 retry2: 34c74: 43 e0 ldi r20, 0x03 ; 3 34c76: 94 2e mov r9, r20 34c78: 56 01 movw r10, r12 34c7a: 81 e0 ldi r24, 0x01 ; 1 34c7c: a8 1a sub r10, r24 34c7e: 8e ef ldi r24, 0xFE ; 254 34c80: b8 0a sbc r11, r24 34c82: 16 01 movw r2, r12 34c84: ee ef ldi r30, 0xFE ; 254 34c86: 3e 1a sub r3, r30 34c88: 54 e0 ldi r21, 0x04 ; 4 34c8a: 85 2e mov r8, r21 retryCnt --; 34c8c: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 34c8e: a3 01 movw r20, r6 34c90: 92 01 movw r18, r4 34c92: 61 e1 ldi r22, 0x11 ; 17 34c94: ce 01 movw r24, r28 34c96: 0f 94 56 a5 call 0x34aac ; 0x34aac 34c9a: 88 23 and r24, r24 34c9c: 79 f0 breq .+30 ; 0x34cbc 34c9e: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 34ca0: 99 20 and r9, r9 34ca2: 09 f4 brne .+2 ; 0x34ca6 34ca4: 7a c0 rjmp .+244 ; 0x34d9a if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 34ca6: 0f 94 5e 75 call 0x2eabc ; 0x2eabc cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 34caa: 20 e0 ldi r18, 0x00 ; 0 34cac: 30 e0 ldi r19, 0x00 ; 0 34cae: a9 01 movw r20, r18 34cb0: 6c e0 ldi r22, 0x0C ; 12 34cb2: ce 01 movw r24, r28 34cb4: 0f 94 56 a5 call 0x34aac ; 0x34aac errorCode_ = 0; 34cb8: 18 82 st Y, r1 34cba: e8 cf rjmp .-48 ; 0x34c8c #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 34cbc: 0f 94 55 3e call 0x27caa ; 0x27caa 34cc0: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 34cc2: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 34cc6: 8a 83 std Y+2, r24 ; 0x02 34cc8: 8f 3f cpi r24, 0xFF ; 255 34cca: 91 f4 brne .+36 ; 0x34cf0 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 34ccc: 0f 94 55 3e call 0x27caa ; 0x27caa 34cd0: 60 1b sub r22, r16 34cd2: 71 0b sbc r23, r17 34cd4: 6d 32 cpi r22, 0x2D ; 45 34cd6: 71 40 sbci r23, 0x01 ; 1 34cd8: a0 f3 brcs .-24 ; 0x34cc2 34cda: 81 e1 ldi r24, 0x11 ; 17 34cdc: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 34cde: 0f 94 5e 75 call 0x2eabc ; 0x2eabc // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34ce2: 8c 81 ldd r24, Y+4 ; 0x04 34ce4: 88 23 and r24, r24 34ce6: e1 f2 breq .-72 ; 0x34ca0 spiSend(0XFF); 34ce8: 8f ef ldi r24, 0xFF ; 255 34cea: 0f 94 4a a5 call 0x34a94 ; 0x34a94 34cee: d8 cf rjmp .-80 ; 0x34ca0 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 34cf0: 8e 3f cpi r24, 0xFE ; 254 34cf2: 11 f0 breq .+4 ; 0x34cf8 34cf4: 8f e0 ldi r24, 0x0F ; 15 34cf6: f2 cf rjmp .-28 ; 0x34cdc //------------------------------------------------------------------------------ /** 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; 34cf8: 8f ef ldi r24, 0xFF ; 255 34cfa: 8e bd out 0x2e, r24 ; 46 34cfc: d6 01 movw r26, r12 34cfe: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34d00: 0d b4 in r0, 0x2d ; 45 34d02: 07 fe sbrs r0, 7 34d04: fd cf rjmp .-6 ; 0x34d00 buf[i] = SPDR; 34d06: 9e b5 in r25, 0x2e ; 46 34d08: 91 93 st Z+, r25 SPDR = 0XFF; 34d0a: 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++) { 34d0c: ea 15 cp r30, r10 34d0e: fb 05 cpc r31, r11 34d10: b9 f7 brne .-18 ; 0x34d00 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34d12: 0d b4 in r0, 0x2d ; 45 34d14: 07 fe sbrs r0, 7 34d16: fd cf rjmp .-6 ; 0x34d12 buf[nbyte] = SPDR; 34d18: 8e b5 in r24, 0x2e ; 46 34d1a: f5 01 movw r30, r10 34d1c: 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; 34d1e: f1 2c mov r15, r1 34d20: 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); 34d22: 8d 91 ld r24, X+ 34d24: ef 2d mov r30, r15 34d26: ff 27 eor r31, r31 34d28: e8 27 eor r30, r24 34d2a: ee 0f add r30, r30 34d2c: ff 1f adc r31, r31 34d2e: e3 53 subi r30, 0x33 ; 51 34d30: f2 45 sbci r31, 0x52 ; 82 34d32: 85 91 lpm r24, Z+ 34d34: 94 91 lpm r25, Z 34d36: fe 2c mov r15, r14 34d38: ee 24 eor r14, r14 34d3a: e8 26 eor r14, r24 34d3c: 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++) { 34d3e: 2a 16 cp r2, r26 34d40: 3b 06 cpc r3, r27 34d42: 79 f7 brne .-34 ; 0x34d22 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 34d44: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 34d48: 08 2f mov r16, r24 34d4a: 10 e0 ldi r17, 0x00 ; 0 34d4c: 10 2f mov r17, r16 34d4e: 00 27 eor r16, r16 recvCrc |= spiRec(); 34d50: 0f 94 4f a5 call 0x34a9e ; 0x34a9e 34d54: 08 2b or r16, r24 if (calcCrc != recvCrc) 34d56: 0e 15 cp r16, r14 34d58: 1f 05 cpc r17, r15 34d5a: 19 f0 breq .+6 ; 0x34d62 34d5c: f0 e2 ldi r31, 0x20 ; 32 34d5e: f8 83 st Y, r31 34d60: be cf rjmp .-132 ; 0x34cde #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 34d62: 0f 94 5e 75 call 0x2eabc ; 0x2eabc // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34d66: cc 81 ldd r28, Y+4 ; 0x04 34d68: cc 23 and r28, r28 34d6a: d9 f0 breq .+54 ; 0x34da2 spiSend(0XFF); 34d6c: 8f ef ldi r24, 0xFF ; 255 34d6e: 0f 94 4a a5 call 0x34a94 ; 0x34a94 #endif fail: chipSelectHigh(); return false; } 34d72: 8c 2f mov r24, r28 34d74: df 91 pop r29 34d76: cf 91 pop r28 34d78: 1f 91 pop r17 34d7a: 0f 91 pop r16 34d7c: ff 90 pop r15 34d7e: ef 90 pop r14 34d80: df 90 pop r13 34d82: cf 90 pop r12 34d84: bf 90 pop r11 34d86: af 90 pop r10 34d88: 9f 90 pop r9 34d8a: 8f 90 pop r8 34d8c: 7f 90 pop r7 34d8e: 6f 90 pop r6 34d90: 5f 90 pop r5 34d92: 4f 90 pop r4 34d94: 3f 90 pop r3 34d96: 2f 90 pop r2 34d98: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 34d9a: 0f 94 5e 75 call 0x2eabc ; 0x2eabc return false; 34d9e: c0 e0 ldi r28, 0x00 ; 0 34da0: e8 cf rjmp .-48 ; 0x34d72 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 34da2: c1 e0 ldi r28, 0x01 ; 1 34da4: e6 cf rjmp .-52 ; 0x34d72 00034da6 : * 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) { 34da6: 2f 92 push r2 34da8: 3f 92 push r3 34daa: 4f 92 push r4 34dac: 5f 92 push r5 34dae: 6f 92 push r6 34db0: 7f 92 push r7 34db2: 8f 92 push r8 34db4: 9f 92 push r9 34db6: af 92 push r10 34db8: bf 92 push r11 34dba: cf 92 push r12 34dbc: df 92 push r13 34dbe: ef 92 push r14 34dc0: ff 92 push r15 34dc2: 0f 93 push r16 34dc4: 1f 93 push r17 34dc6: cf 93 push r28 34dc8: df 93 push r29 34dca: 00 d0 rcall .+0 ; 0x34dcc 34dcc: 1f 92 push r1 34dce: cd b7 in r28, 0x3d ; 61 34dd0: de b7 in r29, 0x3e ; 62 34dd2: 9c 83 std Y+4, r25 ; 0x04 34dd4: 8b 83 std Y+3, r24 ; 0x03 34dd6: 4b 01 movw r8, r22 34dd8: 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; 34dda: dc 01 movw r26, r24 34ddc: 13 96 adiw r26, 0x03 ; 3 34dde: 8c 91 ld r24, X 34de0: 81 11 cpse r24, r1 34de2: 19 c0 rjmp .+50 ; 0x34e16 toRead -= n; } return nbyte; fail: return -1; 34de4: 8f ef ldi r24, 0xFF ; 255 34de6: 9f ef ldi r25, 0xFF ; 255 } 34de8: 0f 90 pop r0 34dea: 0f 90 pop r0 34dec: 0f 90 pop r0 34dee: 0f 90 pop r0 34df0: df 91 pop r29 34df2: cf 91 pop r28 34df4: 1f 91 pop r17 34df6: 0f 91 pop r16 34df8: ff 90 pop r15 34dfa: ef 90 pop r14 34dfc: df 90 pop r13 34dfe: cf 90 pop r12 34e00: bf 90 pop r11 34e02: af 90 pop r10 34e04: 9f 90 pop r9 34e06: 8f 90 pop r8 34e08: 7f 90 pop r7 34e0a: 6f 90 pop r6 34e0c: 5f 90 pop r5 34e0e: 4f 90 pop r4 34e10: 3f 90 pop r3 34e12: 2f 90 pop r2 34e14: 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; 34e16: eb 81 ldd r30, Y+3 ; 0x03 34e18: fc 81 ldd r31, Y+4 ; 0x04 34e1a: 81 81 ldd r24, Z+1 ; 0x01 34e1c: 80 ff sbrs r24, 0 34e1e: e2 cf rjmp .-60 ; 0x34de4 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 34e20: 01 89 ldd r16, Z+17 ; 0x11 34e22: 12 89 ldd r17, Z+18 ; 0x12 34e24: 23 89 ldd r18, Z+19 ; 0x13 34e26: 34 89 ldd r19, Z+20 ; 0x14 34e28: 40 85 ldd r20, Z+8 ; 0x08 34e2a: 51 85 ldd r21, Z+9 ; 0x09 34e2c: 62 85 ldd r22, Z+10 ; 0x0a 34e2e: 73 85 ldd r23, Z+11 ; 0x0b 34e30: c7 01 movw r24, r14 34e32: b0 e0 ldi r27, 0x00 ; 0 34e34: a0 e0 ldi r26, 0x00 ; 0 34e36: 28 01 movw r4, r16 34e38: 39 01 movw r6, r18 34e3a: 44 1a sub r4, r20 34e3c: 55 0a sbc r5, r21 34e3e: 66 0a sbc r6, r22 34e40: 77 0a sbc r7, r23 34e42: 84 15 cp r24, r4 34e44: 95 05 cpc r25, r5 34e46: a6 05 cpc r26, r6 34e48: b7 05 cpc r27, r7 34e4a: 18 f0 brcs .+6 ; 0x34e52 nbyte = fileSize_ - curPosition_; 34e4c: 78 01 movw r14, r16 34e4e: e4 1a sub r14, r20 34e50: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 34e52: 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; 34e54: 8b 81 ldd r24, Y+3 ; 0x03 34e56: 9c 81 ldd r25, Y+4 ; 0x04 34e58: 04 96 adiw r24, 0x04 ; 4 34e5a: 9a 83 std Y+2, r25 ; 0x02 34e5c: 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; 34e5e: 61 2c mov r6, r1 34e60: 32 e0 ldi r19, 0x02 ; 2 34e62: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 34e64: c1 14 cp r12, r1 34e66: d1 04 cpc r13, r1 34e68: 09 f4 brne .+2 ; 0x34e6c 34e6a: b7 c0 rjmp .+366 ; 0x34fda offset = curPosition_ & 0X1FF; // offset in block 34e6c: ab 81 ldd r26, Y+3 ; 0x03 34e6e: bc 81 ldd r27, Y+4 ; 0x04 34e70: 18 96 adiw r26, 0x08 ; 8 34e72: 4d 91 ld r20, X+ 34e74: 5d 91 ld r21, X+ 34e76: 6d 91 ld r22, X+ 34e78: 7c 91 ld r23, X 34e7a: 1b 97 sbiw r26, 0x0b ; 11 34e7c: 5a 01 movw r10, r20 34e7e: b1 e0 ldi r27, 0x01 ; 1 34e80: bb 22 and r11, r27 34e82: eb 81 ldd r30, Y+3 ; 0x03 34e84: fc 81 ldd r31, Y+4 ; 0x04 34e86: 81 8d ldd r24, Z+25 ; 0x19 34e88: 92 8d ldd r25, Z+26 ; 0x1a 34e8a: 1a 01 movw r2, r20 34e8c: 2b 01 movw r4, r22 34e8e: 29 e0 ldi r18, 0x09 ; 9 34e90: 56 94 lsr r5 34e92: 47 94 ror r4 34e94: 37 94 ror r3 34e96: 27 94 ror r2 34e98: 2a 95 dec r18 34e9a: d1 f7 brne .-12 ; 0x34e90 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 34e9c: 23 81 ldd r18, Z+3 ; 0x03 34e9e: 22 30 cpi r18, 0x02 ; 2 34ea0: 91 f5 brne .+100 ; 0x34f06 block = vol_->rootDirStart() + (curPosition_ >> 9); 34ea2: dc 01 movw r26, r24 34ea4: 5a 96 adiw r26, 0x1a ; 26 34ea6: 6d 91 ld r22, X+ 34ea8: 7d 91 ld r23, X+ 34eaa: 8d 91 ld r24, X+ 34eac: 9c 91 ld r25, X 34eae: 5d 97 sbiw r26, 0x1d ; 29 34eb0: 62 0d add r22, r2 34eb2: 73 1d adc r23, r3 34eb4: 84 1d adc r24, r4 34eb6: 95 1d adc r25, r5 34eb8: 83 01 movw r16, r6 34eba: 0a 19 sub r16, r10 34ebc: 1b 09 sbc r17, r11 34ebe: c0 16 cp r12, r16 34ec0: d1 06 cpc r13, r17 34ec2: 08 f4 brcc .+2 ; 0x34ec6 34ec4: 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()) { 34ec6: 01 15 cp r16, r1 34ec8: b2 e0 ldi r27, 0x02 ; 2 34eca: 1b 07 cpc r17, r27 34ecc: 71 f4 brne .+28 ; 0x34eea 34ece: 20 91 6c 0e lds r18, 0x0E6C ; 0x800e6c 34ed2: 30 91 6d 0e lds r19, 0x0E6D ; 0x800e6d 34ed6: 40 91 6e 0e lds r20, 0x0E6E ; 0x800e6e 34eda: 50 91 6f 0e lds r21, 0x0E6F ; 0x800e6f 34ede: 62 17 cp r22, r18 34ee0: 73 07 cpc r23, r19 34ee2: 84 07 cpc r24, r20 34ee4: 95 07 cpc r25, r21 34ee6: 09 f0 breq .+2 ; 0x34eea 34ee8: 59 c0 rjmp .+178 ; 0x34f9c 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; 34eea: 40 e0 ldi r20, 0x00 ; 0 34eec: 0f 94 58 6a call 0x2d4b0 ; 0x2d4b0 34ef0: 88 23 and r24, r24 34ef2: 09 f4 brne .+2 ; 0x34ef6 34ef4: 77 cf rjmp .-274 ; 0x34de4 uint8_t* src = vol_->cache()->data + offset; 34ef6: b5 01 movw r22, r10 34ef8: 68 58 subi r22, 0x88 ; 136 34efa: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 34efc: a8 01 movw r20, r16 34efe: c4 01 movw r24, r8 34f00: 0f 94 38 e3 call 0x3c670 ; 0x3c670 34f04: 57 c0 rjmp .+174 ; 0x34fb4 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);} 34f06: fc 01 movw r30, r24 34f08: 14 81 ldd r17, Z+4 ; 0x04 34f0a: 11 50 subi r17, 0x01 ; 1 34f0c: 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) { 34f0e: a1 14 cp r10, r1 34f10: b1 04 cpc r11, r1 34f12: 81 f4 brne .+32 ; 0x34f34 34f14: 11 11 cpse r17, r1 34f16: 0e c0 rjmp .+28 ; 0x34f34 // start of new cluster if (curPosition_ == 0) { 34f18: 45 2b or r20, r21 34f1a: 46 2b or r20, r22 34f1c: 47 2b or r20, r23 34f1e: 79 f5 brne .+94 ; 0x34f7e // use first cluster in file curCluster_ = firstCluster_; 34f20: eb 81 ldd r30, Y+3 ; 0x03 34f22: fc 81 ldd r31, Y+4 ; 0x04 34f24: 85 89 ldd r24, Z+21 ; 0x15 34f26: 96 89 ldd r25, Z+22 ; 0x16 34f28: a7 89 ldd r26, Z+23 ; 0x17 34f2a: b0 8d ldd r27, Z+24 ; 0x18 34f2c: 84 83 std Z+4, r24 ; 0x04 34f2e: 95 83 std Z+5, r25 ; 0x05 34f30: a6 83 std Z+6, r26 ; 0x06 34f32: 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; 34f34: ab 81 ldd r26, Y+3 ; 0x03 34f36: bc 81 ldd r27, Y+4 ; 0x04 34f38: 59 96 adiw r26, 0x19 ; 25 34f3a: ed 91 ld r30, X+ 34f3c: fc 91 ld r31, X 34f3e: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 34f40: 14 96 adiw r26, 0x04 ; 4 34f42: 6d 91 ld r22, X+ 34f44: 7d 91 ld r23, X+ 34f46: 8d 91 ld r24, X+ 34f48: 9c 91 ld r25, X 34f4a: 17 97 sbiw r26, 0x07 ; 7 34f4c: 62 50 subi r22, 0x02 ; 2 34f4e: 71 09 sbc r23, r1 34f50: 81 09 sbc r24, r1 34f52: 91 09 sbc r25, r1 34f54: 25 85 ldd r18, Z+13 ; 0x0d 34f56: 04 c0 rjmp .+8 ; 0x34f60 34f58: 66 0f add r22, r22 34f5a: 77 1f adc r23, r23 34f5c: 88 1f adc r24, r24 34f5e: 99 1f adc r25, r25 34f60: 2a 95 dec r18 34f62: d2 f7 brpl .-12 ; 0x34f58 34f64: 26 85 ldd r18, Z+14 ; 0x0e 34f66: 37 85 ldd r19, Z+15 ; 0x0f 34f68: 40 89 ldd r20, Z+16 ; 0x10 34f6a: 51 89 ldd r21, Z+17 ; 0x11 34f6c: 62 0f add r22, r18 34f6e: 73 1f adc r23, r19 34f70: 84 1f adc r24, r20 34f72: 95 1f adc r25, r21 34f74: 61 0f add r22, r17 34f76: 71 1d adc r23, r1 34f78: 81 1d adc r24, r1 34f7a: 91 1d adc r25, r1 34f7c: 9d cf rjmp .-198 ; 0x34eb8 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 34f7e: ab 81 ldd r26, Y+3 ; 0x03 34f80: bc 81 ldd r27, Y+4 ; 0x04 34f82: 14 96 adiw r26, 0x04 ; 4 34f84: 4d 91 ld r20, X+ 34f86: 5d 91 ld r21, X+ 34f88: 6d 91 ld r22, X+ 34f8a: 7c 91 ld r23, X 34f8c: 17 97 sbiw r26, 0x07 ; 7 34f8e: 29 81 ldd r18, Y+1 ; 0x01 34f90: 3a 81 ldd r19, Y+2 ; 0x02 34f92: 0f 94 27 6b call 0x2d64e ; 0x2d64e 34f96: 81 11 cpse r24, r1 34f98: cd cf rjmp .-102 ; 0x34f34 34f9a: 24 cf rjmp .-440 ; 0x34de4 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);} 34f9c: 94 01 movw r18, r8 34f9e: ab 01 movw r20, r22 34fa0: bc 01 movw r22, r24 34fa2: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 34fa6: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 34faa: 0f 94 1a a6 call 0x34c34 ; 0x34c34 // 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; 34fae: 88 23 and r24, r24 34fb0: 09 f4 brne .+2 ; 0x34fb4 34fb2: 18 cf rjmp .-464 ; 0x34de4 // 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; 34fb4: 80 0e add r8, r16 34fb6: 91 1e adc r9, r17 curPosition_ += n; 34fb8: eb 81 ldd r30, Y+3 ; 0x03 34fba: fc 81 ldd r31, Y+4 ; 0x04 34fbc: 80 85 ldd r24, Z+8 ; 0x08 34fbe: 91 85 ldd r25, Z+9 ; 0x09 34fc0: a2 85 ldd r26, Z+10 ; 0x0a 34fc2: b3 85 ldd r27, Z+11 ; 0x0b 34fc4: 80 0f add r24, r16 34fc6: 91 1f adc r25, r17 34fc8: a1 1d adc r26, r1 34fca: b1 1d adc r27, r1 34fcc: 80 87 std Z+8, r24 ; 0x08 34fce: 91 87 std Z+9, r25 ; 0x09 34fd0: a2 87 std Z+10, r26 ; 0x0a 34fd2: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 34fd4: c0 1a sub r12, r16 34fd6: d1 0a sbc r13, r17 34fd8: 45 cf rjmp .-374 ; 0x34e64 } return nbyte; 34fda: c7 01 movw r24, r14 34fdc: 05 cf rjmp .-502 ; 0x34de8 00034fde : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 34fde: 4f 92 push r4 34fe0: 5f 92 push r5 34fe2: 6f 92 push r6 34fe4: 7f 92 push r7 34fe6: af 92 push r10 34fe8: bf 92 push r11 34fea: cf 92 push r12 34fec: df 92 push r13 34fee: ef 92 push r14 34ff0: ff 92 push r15 34ff2: 0f 93 push r16 34ff4: 1f 93 push r17 34ff6: cf 93 push r28 34ff8: df 93 push r29 34ffa: 1f 92 push r1 34ffc: cd b7 in r28, 0x3d ; 61 34ffe: de b7 in r29, 0x3e ; 62 35000: 8c 01 movw r16, r24 35002: 7b 01 movw r14, r22 35004: 5a 01 movw r10, r20 35006: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 35008: db 01 movw r26, r22 3500a: 59 96 adiw r26, 0x19 ; 25 3500c: 8d 91 ld r24, X+ 3500e: 9c 91 ld r25, X 35010: f8 01 movw r30, r16 35012: 92 8f std Z+26, r25 ; 0x1a 35014: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 35016: cb 01 movw r24, r22 35018: 0e 94 48 79 call 0xf290 ; 0xf290 } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 3501c: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 3501e: f7 01 movw r30, r14 35020: 80 85 ldd r24, Z+8 ; 0x08 35022: 91 85 ldd r25, Z+9 ; 0x09 35024: a2 85 ldd r26, Z+10 ; 0x0a 35026: b3 85 ldd r27, Z+11 ; 0x0b 35028: 41 89 ldd r20, Z+17 ; 0x11 3502a: 52 89 ldd r21, Z+18 ; 0x12 3502c: 63 89 ldd r22, Z+19 ; 0x13 3502e: 74 89 ldd r23, Z+20 ; 0x14 35030: 84 17 cp r24, r20 35032: 95 07 cpc r25, r21 35034: a6 07 cpc r26, r22 35036: b7 07 cpc r27, r23 35038: 08 f0 brcs .+2 ; 0x3503c 3503a: 52 c0 rjmp .+164 ; 0x350e0 index = 0XF & (dirFile->curPosition_ >> 5); 3503c: 55 e0 ldi r21, 0x05 ; 5 3503e: b6 95 lsr r27 35040: a7 95 ror r26 35042: 97 95 ror r25 35044: 87 95 ror r24 35046: 5a 95 dec r21 35048: d1 f7 brne .-12 ; 0x3503e 3504a: f8 2f mov r31, r24 3504c: ff 70 andi r31, 0x0F ; 15 3504e: 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; 35050: d7 01 movw r26, r14 35052: 13 96 adiw r26, 0x03 ; 3 35054: 8c 91 ld r24, X 35056: 82 30 cpi r24, 0x02 ; 2 35058: 10 f4 brcc .+4 ; 0x3505e if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 3505a: 80 e0 ldi r24, 0x00 ; 0 3505c: db c0 rjmp .+438 ; 0x35214 * \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; 3505e: 41 e0 ldi r20, 0x01 ; 1 35060: 50 e0 ldi r21, 0x00 ; 0 35062: be 01 movw r22, r28 35064: 6f 5f subi r22, 0xFF ; 255 35066: 7f 4f sbci r23, 0xFF ; 255 35068: c7 01 movw r24, r14 3506a: 0f 94 d3 a6 call 0x34da6 ; 0x34da6 3506e: 01 97 sbiw r24, 0x01 ; 1 35070: a1 f7 brne .-24 ; 0x3505a // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 35072: f7 01 movw r30, r14 35074: 80 85 ldd r24, Z+8 ; 0x08 35076: 91 85 ldd r25, Z+9 ; 0x09 35078: a2 85 ldd r26, Z+10 ; 0x0a 3507a: b3 85 ldd r27, Z+11 ; 0x0b 3507c: 4f 96 adiw r24, 0x1f ; 31 3507e: a1 1d adc r26, r1 35080: b1 1d adc r27, r1 35082: 80 87 std Z+8, r24 ; 0x08 35084: 91 87 std Z+9, r25 ; 0x09 35086: a2 87 std Z+10, r26 ; 0x0a 35088: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 3508a: f0 e2 ldi r31, 0x20 ; 32 3508c: df 9e mul r13, r31 3508e: b0 01 movw r22, r0 35090: 11 24 eor r1, r1 35092: 68 58 subi r22, 0x88 ; 136 35094: 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; 35096: 61 15 cp r22, r1 35098: 71 05 cpc r23, r1 3509a: f9 f2 breq .-66 ; 0x3505a if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 3509c: db 01 movw r26, r22 3509e: 8c 91 ld r24, X 350a0: 88 23 and r24, r24 350a2: 41 f0 breq .+16 ; 0x350b4 350a4: 85 3e cpi r24, 0xE5 ; 229 350a6: 09 f0 breq .+2 ; 0x350aa 350a8: 4c c0 rjmp .+152 ; 0x35142 // remember first empty slot if (!emptyFound) { 350aa: 77 20 and r7, r7 350ac: 29 f0 breq .+10 ; 0x350b8 return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 350ae: 77 24 eor r7, r7 350b0: 73 94 inc r7 350b2: b5 cf rjmp .-150 ; 0x3501e 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) { 350b4: 71 10 cpse r7, r1 350b6: 0e c0 rjmp .+28 ; 0x350d4 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 350b8: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 350bc: 90 91 6d 0e lds r25, 0x0E6D ; 0x800e6d 350c0: a0 91 6e 0e lds r26, 0x0E6E ; 0x800e6e 350c4: b0 91 6f 0e lds r27, 0x0E6F ; 0x800e6f 350c8: f8 01 movw r30, r16 350ca: 84 87 std Z+12, r24 ; 0x0c 350cc: 95 87 std Z+13, r25 ; 0x0d 350ce: a6 87 std Z+14, r26 ; 0x0e 350d0: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 350d2: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 350d4: db 01 movw r26, r22 350d6: 8c 91 ld r24, X 350d8: 81 11 cpse r24, r1 350da: e9 cf rjmp .-46 ; 0x350ae 350dc: 77 24 eor r7, r7 350de: 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; 350e0: 8c 2d mov r24, r12 350e2: 82 74 andi r24, 0x42 ; 66 350e4: 82 34 cpi r24, 0x42 ; 66 350e6: 09 f0 breq .+2 ; 0x350ea 350e8: b8 cf rjmp .-144 ; 0x3505a if (emptyFound) { 350ea: 77 20 and r7, r7 350ec: 09 f4 brne .+2 ; 0x350f0 350ee: a2 c0 rjmp .+324 ; 0x35234 index = dirIndex_; 350f0: f8 01 movw r30, r16 350f2: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 350f4: 61 e0 ldi r22, 0x01 ; 1 350f6: c8 01 movw r24, r16 350f8: 0f 94 fb a3 call 0x347f6 ; 0x347f6 if (!p) goto fail; 350fc: 00 97 sbiw r24, 0x00 ; 0 350fe: 09 f4 brne .+2 ; 0x35102 35100: ac cf rjmp .-168 ; 0x3505a // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 35102: 20 e2 ldi r18, 0x20 ; 32 35104: dc 01 movw r26, r24 35106: 1d 92 st X+, r1 35108: 2a 95 dec r18 3510a: e9 f7 brne .-6 ; 0x35106 memcpy(p->name, dname, 11); 3510c: 2b e0 ldi r18, 0x0B ; 11 3510e: f5 01 movw r30, r10 35110: dc 01 movw r26, r24 35112: 01 90 ld r0, Z+ 35114: 0d 92 st X+, r0 35116: 2a 95 dec r18 35118: e1 f7 brne .-8 ; 0x35112 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 3511a: 21 e2 ldi r18, 0x21 ; 33 3511c: 38 e2 ldi r19, 0x28 ; 40 3511e: fc 01 movw r30, r24 35120: 31 8b std Z+17, r19 ; 0x11 35122: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 35124: 40 e0 ldi r20, 0x00 ; 0 35126: 58 e0 ldi r21, 0x08 ; 8 35128: 57 87 std Z+15, r21 ; 0x0f 3512a: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 3512c: 33 8b std Z+19, r19 ; 0x13 3512e: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 35130: 31 8f std Z+25, r19 ; 0x19 35132: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 35134: 57 8b std Z+23, r21 ; 0x17 35136: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 35138: 0f 94 19 6a call 0x2d432 ; 0x2d432 3513c: 81 11 cpse r24, r1 3513e: 09 c0 rjmp .+18 ; 0x35152 35140: 8c cf rjmp .-232 ; 0x3505a dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 35142: 4b e0 ldi r20, 0x0B ; 11 35144: 50 e0 ldi r21, 0x00 ; 0 35146: c5 01 movw r24, r10 35148: 0f 94 2b e3 call 0x3c656 ; 0x3c656 3514c: 89 2b or r24, r25 3514e: 09 f0 breq .+2 ; 0x35152 35150: 66 cf rjmp .-308 ; 0x3501e } //------------------------------------------------------------------------------ // 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]; 35152: f0 e2 ldi r31, 0x20 ; 32 35154: df 9e mul r13, r31 35156: d0 01 movw r26, r0 35158: 11 24 eor r1, r1 3515a: 9d 01 movw r18, r26 3515c: 28 58 subi r18, 0x88 ; 136 3515e: 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)) { 35160: f9 01 movw r30, r18 35162: 83 85 ldd r24, Z+11 ; 0x0b 35164: 81 71 andi r24, 0x11 ; 17 35166: 21 f0 breq .+8 ; 0x35170 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 35168: 8c 2d mov r24, r12 3516a: 82 71 andi r24, 0x12 ; 18 3516c: 09 f0 breq .+2 ; 0x35170 3516e: fc c0 rjmp .+504 ; 0x35368 } //------------------------------------------------------------------------------ // 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]; 35170: f8 01 movw r30, r16 35172: 81 8d ldd r24, Z+25 ; 0x19 35174: 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(); 35176: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 3517a: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 3517e: 60 91 6e 0e lds r22, 0x0E6E ; 0x800e6e 35182: 70 91 6f 0e lds r23, 0x0E6F ; 0x800e6f 35186: 44 87 std Z+12, r20 ; 0x0c 35188: 55 87 std Z+13, r21 ; 0x0d 3518a: 66 87 std Z+14, r22 ; 0x0e 3518c: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 3518e: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 35190: fd 01 movw r30, r26 35192: e8 58 subi r30, 0x88 ; 136 35194: f1 4f sbci r31, 0xF1 ; 241 35196: 44 88 ldd r4, Z+20 ; 0x14 35198: 55 88 ldd r5, Z+21 ; 0x15 3519a: 71 2c mov r7, r1 3519c: 61 2c mov r6, r1 3519e: 32 01 movw r6, r4 351a0: 55 24 eor r5, r5 351a2: 44 24 eor r4, r4 351a4: d8 01 movw r26, r16 351a6: 55 96 adiw r26, 0x15 ; 21 351a8: 4d 92 st X+, r4 351aa: 5d 92 st X+, r5 351ac: 6d 92 st X+, r6 351ae: 7c 92 st X, r7 351b0: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 351b2: 42 8d ldd r20, Z+26 ; 0x1a 351b4: 53 8d ldd r21, Z+27 ; 0x1b 351b6: 70 e0 ldi r23, 0x00 ; 0 351b8: 60 e0 ldi r22, 0x00 ; 0 351ba: 44 29 or r20, r4 351bc: 55 29 or r21, r5 351be: 66 29 or r22, r6 351c0: 77 29 or r23, r7 351c2: 55 96 adiw r26, 0x15 ; 21 351c4: 4d 93 st X+, r20 351c6: 5d 93 st X+, r21 351c8: 6d 93 st X+, r22 351ca: 7c 93 st X, r23 351cc: 58 97 sbiw r26, 0x18 ; 24 351ce: d9 01 movw r26, r18 351d0: 1b 96 adiw r26, 0x0b ; 11 351d2: 2c 91 ld r18, X 351d4: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 351d6: 09 f0 breq .+2 ; 0x351da 351d8: b9 c0 rjmp .+370 ; 0x3534c fileSize_ = p->fileSize; 351da: 84 8d ldd r24, Z+28 ; 0x1c 351dc: 95 8d ldd r25, Z+29 ; 0x1d 351de: a6 8d ldd r26, Z+30 ; 0x1e 351e0: b7 8d ldd r27, Z+31 ; 0x1f 351e2: f8 01 movw r30, r16 351e4: 81 8b std Z+17, r24 ; 0x11 351e6: 92 8b std Z+18, r25 ; 0x12 351e8: a3 8b std Z+19, r26 ; 0x13 351ea: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 351ec: 81 e0 ldi r24, 0x01 ; 1 351ee: 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; 351f0: 8c 2d mov r24, r12 351f2: 8f 70 andi r24, 0x0F ; 15 351f4: f8 01 movw r30, r16 351f6: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 351f8: 14 82 std Z+4, r1 ; 0x04 351fa: 15 82 std Z+5, r1 ; 0x05 351fc: 16 82 std Z+6, r1 ; 0x06 351fe: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 35200: 10 86 std Z+8, r1 ; 0x08 35202: 11 86 std Z+9, r1 ; 0x09 35204: 12 86 std Z+10, r1 ; 0x0a 35206: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 35208: 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; 3520a: c4 fe sbrs r12, 4 3520c: 03 c0 rjmp .+6 ; 0x35214 3520e: c8 01 movw r24, r16 35210: 0f 94 1c 77 call 0x2ee38 ; 0x2ee38 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 35214: 0f 90 pop r0 35216: df 91 pop r29 35218: cf 91 pop r28 3521a: 1f 91 pop r17 3521c: 0f 91 pop r16 3521e: ff 90 pop r15 35220: ef 90 pop r14 35222: df 90 pop r13 35224: cf 90 pop r12 35226: bf 90 pop r11 35228: af 90 pop r10 3522a: 7f 90 pop r7 3522c: 6f 90 pop r6 3522e: 5f 90 pop r5 35230: 4f 90 pop r4 35232: 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; 35234: d7 01 movw r26, r14 35236: 13 96 adiw r26, 0x03 ; 3 35238: 8c 91 ld r24, X 3523a: 13 97 sbiw r26, 0x03 ; 3 3523c: 82 30 cpi r24, 0x02 ; 2 3523e: 09 f4 brne .+2 ; 0x35242 35240: 0c cf rjmp .-488 ; 0x3505a // 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; 35242: 51 96 adiw r26, 0x11 ; 17 35244: 8d 91 ld r24, X+ 35246: 9d 91 ld r25, X+ 35248: 0d 90 ld r0, X+ 3524a: bc 91 ld r27, X 3524c: a0 2d mov r26, r0 3524e: 80 3e cpi r24, 0xE0 ; 224 35250: 9f 4f sbci r25, 0xFF ; 255 35252: af 41 sbci r26, 0x1F ; 31 35254: b1 05 cpc r27, r1 35256: 08 f0 brcs .+2 ; 0x3525a 35258: 00 cf rjmp .-512 ; 0x3505a if (!addCluster()) goto fail; 3525a: c7 01 movw r24, r14 3525c: 0f 94 4f a4 call 0x3489e ; 0x3489e 35260: 88 23 and r24, r24 35262: 09 f4 brne .+2 ; 0x35266 35264: fa ce rjmp .-524 ; 0x3505a if (!vol_->cacheFlush()) goto fail; 35266: 0f 94 19 6a call 0x2d432 ; 0x2d432 3526a: 88 23 and r24, r24 3526c: 09 f4 brne .+2 ; 0x35270 3526e: f5 ce rjmp .-534 ; 0x3505a block = vol_->clusterStartBlock(curCluster_); 35270: d7 01 movw r26, r14 35272: 59 96 adiw r26, 0x19 ; 25 35274: ed 91 ld r30, X+ 35276: fc 91 ld r31, X 35278: 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_);} 3527a: 14 96 adiw r26, 0x04 ; 4 3527c: 4d 90 ld r4, X+ 3527e: 5d 90 ld r5, X+ 35280: 6d 90 ld r6, X+ 35282: 7c 90 ld r7, X 35284: 17 97 sbiw r26, 0x07 ; 7 35286: b2 e0 ldi r27, 0x02 ; 2 35288: 4b 1a sub r4, r27 3528a: 51 08 sbc r5, r1 3528c: 61 08 sbc r6, r1 3528e: 71 08 sbc r7, r1 35290: 85 85 ldd r24, Z+13 ; 0x0d 35292: 04 c0 rjmp .+8 ; 0x3529c 35294: 44 0c add r4, r4 35296: 55 1c adc r5, r5 35298: 66 1c adc r6, r6 3529a: 77 1c adc r7, r7 3529c: 8a 95 dec r24 3529e: d2 f7 brpl .-12 ; 0x35294 352a0: 86 85 ldd r24, Z+14 ; 0x0e 352a2: 97 85 ldd r25, Z+15 ; 0x0f 352a4: a0 89 ldd r26, Z+16 ; 0x10 352a6: b1 89 ldd r27, Z+17 ; 0x11 352a8: 48 0e add r4, r24 352aa: 59 1e adc r5, r25 352ac: 6a 1e adc r6, r26 352ae: 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; 352b0: 81 e0 ldi r24, 0x01 ; 1 352b2: 80 93 74 0e sts 0x0E74, r24 ; 0x800e74 cacheBlockNumber_ = blockNumber; 352b6: 40 92 6c 0e sts 0x0E6C, r4 ; 0x800e6c 352ba: 50 92 6d 0e sts 0x0E6D, r5 ; 0x800e6d 352be: 60 92 6e 0e sts 0x0E6E, r6 ; 0x800e6e 352c2: 70 92 6f 0e sts 0x0E6F, r7 ; 0x800e6f // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 352c6: e8 e7 ldi r30, 0x78 ; 120 352c8: fe e0 ldi r31, 0x0E ; 14 352ca: 80 e0 ldi r24, 0x00 ; 0 352cc: 92 e0 ldi r25, 0x02 ; 2 352ce: df 01 movw r26, r30 352d0: 9c 01 movw r18, r24 352d2: 1d 92 st X+, r1 352d4: 21 50 subi r18, 0x01 ; 1 352d6: 30 40 sbci r19, 0x00 ; 0 352d8: e1 f7 brne .-8 ; 0x352d2 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 352da: dd 24 eor r13, r13 352dc: d3 94 inc r13 352de: d7 01 movw r26, r14 352e0: 59 96 adiw r26, 0x19 ; 25 352e2: ed 91 ld r30, X+ 352e4: fc 91 ld r31, X 352e6: 84 81 ldd r24, Z+4 ; 0x04 352e8: d8 16 cp r13, r24 352ea: 98 f4 brcc .+38 ; 0x35312 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); 352ec: 28 e7 ldi r18, 0x78 ; 120 352ee: 3e e0 ldi r19, 0x0E ; 14 352f0: b3 01 movw r22, r6 352f2: a2 01 movw r20, r4 352f4: 4d 0d add r20, r13 352f6: 51 1d adc r21, r1 352f8: 61 1d adc r22, r1 352fa: 71 1d adc r23, r1 352fc: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 35300: 90 91 76 0e lds r25, 0x0E76 ; 0x800e76 35304: 0f 94 b6 a5 call 0x34b6c ; 0x34b6c if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 35308: 88 23 and r24, r24 3530a: 09 f4 brne .+2 ; 0x3530e 3530c: a6 ce rjmp .-692 ; 0x3505a // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 3530e: d3 94 inc r13 35310: e6 cf rjmp .-52 ; 0x352de if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 35312: 25 85 ldd r18, Z+13 ; 0x0d 35314: 80 e0 ldi r24, 0x00 ; 0 35316: 92 e0 ldi r25, 0x02 ; 2 35318: a0 e0 ldi r26, 0x00 ; 0 3531a: b0 e0 ldi r27, 0x00 ; 0 3531c: 04 c0 rjmp .+8 ; 0x35326 3531e: 88 0f add r24, r24 35320: 99 1f adc r25, r25 35322: aa 1f adc r26, r26 35324: bb 1f adc r27, r27 35326: 2a 95 dec r18 35328: d2 f7 brpl .-12 ; 0x3531e 3532a: f7 01 movw r30, r14 3532c: 41 89 ldd r20, Z+17 ; 0x11 3532e: 52 89 ldd r21, Z+18 ; 0x12 35330: 63 89 ldd r22, Z+19 ; 0x13 35332: 74 89 ldd r23, Z+20 ; 0x14 35334: 84 0f add r24, r20 35336: 95 1f adc r25, r21 35338: a6 1f adc r26, r22 3533a: b7 1f adc r27, r23 3533c: 81 8b std Z+17, r24 ; 0x11 3533e: 92 8b std Z+18, r25 ; 0x12 35340: a3 8b std Z+19, r26 ; 0x13 35342: 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; 35344: 88 e7 ldi r24, 0x78 ; 120 35346: 9e e0 ldi r25, 0x0E ; 14 index = 0; 35348: d1 2c mov r13, r1 3534a: db ce rjmp .-586 ; 0x35102 // 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)) { 3534c: 20 31 cpi r18, 0x10 ; 16 3534e: 61 f4 brne .+24 ; 0x35368 if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 35350: 98 01 movw r18, r16 35352: 2f 5e subi r18, 0xEF ; 239 35354: 3f 4f sbci r19, 0xFF ; 255 35356: 0f 94 aa 6b call 0x2d754 ; 0x2d754 3535a: 88 23 and r24, r24 3535c: 29 f0 breq .+10 ; 0x35368 type_ = FAT_FILE_TYPE_SUBDIR; 3535e: 84 e0 ldi r24, 0x04 ; 4 35360: d8 01 movw r26, r16 35362: 13 96 adiw r26, 0x03 ; 3 35364: 8c 93 st X, r24 35366: 44 cf rjmp .-376 ; 0x351f0 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 35368: d8 01 movw r26, r16 3536a: 13 96 adiw r26, 0x03 ; 3 3536c: 1c 92 st X, r1 3536e: 75 ce rjmp .-790 ; 0x3505a 00035370 : 35370: 88 e1 ldi r24, 0x18 ; 24 35372: 9e e0 ldi r25, 0x0E ; 14 35374: 0f b6 in r0, 0x3f ; 63 35376: f8 94 cli 35378: a8 95 wdr 3537a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3537e: 0f be out 0x3f, r0 ; 63 35380: 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); 35384: 9f b7 in r25, 0x3f ; 63 35386: f8 94 cli 35388: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 3538c: 84 60 ori r24, 0x04 ; 4 3538e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 35392: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 35394: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 35398: 43 e2 ldi r20, 0x23 ; 35 3539a: 52 e7 ldi r21, 0x72 ; 114 3539c: 61 e0 ldi r22, 0x01 ; 1 3539e: 80 e0 ldi r24, 0x00 ; 0 353a0: 0e 94 3a 70 call 0xe074 ; 0xe074 353a4: ff cf rjmp .-2 ; 0x353a4 000353a6 : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 353a6: 60 91 53 0e lds r22, 0x0E53 ; 0x800e53 uint8_t _block_buffer_tail = block_buffer_tail; 353aa: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 uint16_t sdlen = 0; 353ae: 30 e0 ldi r19, 0x00 ; 0 353b0: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 353b2: 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) 353b4: 96 17 cp r25, r22 353b6: 61 f0 breq .+24 ; 0x353d0 { sdlen += block_buffer[_block_buffer_tail].sdlen; 353b8: 89 9f mul r24, r25 353ba: f0 01 movw r30, r0 353bc: 11 24 eor r1, r1 353be: e1 52 subi r30, 0x21 ; 33 353c0: f8 4f sbci r31, 0xF8 ; 248 353c2: 40 81 ld r20, Z 353c4: 51 81 ldd r21, Z+1 ; 0x01 353c6: 24 0f add r18, r20 353c8: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 353ca: 9f 5f subi r25, 0xFF ; 255 353cc: 9f 70 andi r25, 0x0F ; 15 353ce: f2 cf rjmp .-28 ; 0x353b4 } return sdlen; } 353d0: c9 01 movw r24, r18 353d2: 08 95 ret 000353d4 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 353d4: 30 91 53 0e lds r19, 0x0E53 ; 0x800e53 353d8: 20 91 54 0e lds r18, 0x0E54 ; 0x800e54 353dc: 32 17 cp r19, r18 353de: 91 f0 breq .+36 ; 0x35404 // 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; 353e0: e0 91 53 0e lds r30, 0x0E53 ; 0x800e53 } // 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) 353e4: e1 11 cpse r30, r1 353e6: 01 c0 rjmp .+2 ; 0x353ea block_index = BLOCK_BUFFER_SIZE; 353e8: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 353ea: 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; 353ec: 2e e6 ldi r18, 0x6E ; 110 353ee: e2 9f mul r30, r18 353f0: f0 01 movw r30, r0 353f2: 11 24 eor r1, r1 353f4: e1 52 subi r30, 0x21 ; 33 353f6: f8 4f sbci r31, 0xF8 ; 248 353f8: 20 81 ld r18, Z 353fa: 31 81 ldd r19, Z+1 ; 0x01 353fc: 82 0f add r24, r18 353fe: 93 1f adc r25, r19 35400: 91 83 std Z+1, r25 ; 0x01 35402: 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. } } 35404: 08 95 ret 00035406 : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 35406: 8f 92 push r8 35408: 9f 92 push r9 3540a: af 92 push r10 3540c: bf 92 push r11 3540e: cf 92 push r12 35410: df 92 push r13 35412: ef 92 push r14 35414: ff 92 push r15 35416: 0f 93 push r16 35418: 1f 93 push r17 3541a: cf 93 push r28 3541c: df 93 push r29 3541e: c0 91 97 02 lds r28, 0x0297 ; 0x800297 35422: d0 91 98 02 lds r29, 0x0298 ; 0x800298 35426: 8f e6 ldi r24, 0x6F ; 111 35428: e8 2e mov r14, r24 3542a: 86 e0 ldi r24, 0x06 ; 6 3542c: f8 2e mov r15, r24 3542e: 0d ee ldi r16, 0xED ; 237 35430: 17 e1 ldi r17, 0x17 ; 23 35432: 6e 01 movw r12, r28 35434: 80 e1 ldi r24, 0x10 ; 16 35436: c8 0e add r12, r24 35438: 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]; 3543a: 69 91 ld r22, Y+ 3543c: 79 91 ld r23, Y+ 3543e: 89 91 ld r24, Y+ 35440: 99 91 ld r25, Y+ 35442: f7 01 movw r30, r14 35444: 81 90 ld r8, Z+ 35446: 91 90 ld r9, Z+ 35448: a1 90 ld r10, Z+ 3544a: b1 90 ld r11, Z+ 3544c: 7f 01 movw r14, r30 3544e: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 35452: a5 01 movw r20, r10 35454: 94 01 movw r18, r8 35456: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3545a: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3545e: f8 01 movw r30, r16 35460: 61 93 st Z+, r22 35462: 71 93 st Z+, r23 35464: 81 93 st Z+, r24 35466: 91 93 st Z+, r25 35468: 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++) 3546a: cc 15 cp r28, r12 3546c: dd 05 cpc r29, r13 3546e: 29 f7 brne .-54 ; 0x3543a max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 35470: df 91 pop r29 35472: cf 91 pop r28 35474: 1f 91 pop r17 35476: 0f 91 pop r16 35478: ff 90 pop r15 3547a: ef 90 pop r14 3547c: df 90 pop r13 3547e: cf 90 pop r12 35480: bf 90 pop r11 35482: af 90 pop r10 35484: 9f 90 pop r9 35486: 8f 90 pop r8 35488: 08 95 ret 0003548a : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 3548a: 80 91 69 06 lds r24, 0x0669 ; 0x800669 3548e: 81 11 cpse r24, r1 35490: 0e c0 rjmp .+28 ; 0x354ae { max_feedrate = cs.max_feedrate_normal; 35492: 8f e7 ldi r24, 0x7F ; 127 35494: 96 e0 ldi r25, 0x06 ; 6 35496: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 3549a: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 3549e: 8f e8 ldi r24, 0x8F ; 143 354a0: 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; 354a2: 90 93 98 02 sts 0x0298, r25 ; 0x800298 354a6: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } reset_acceleration_rates(); 354aa: 0d 94 03 aa jmp 0x35406 ; 0x35406 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) 354ae: 81 30 cpi r24, 0x01 ; 1 354b0: e1 f7 brne .-8 ; 0x354aa { max_feedrate = cs.max_feedrate_silent; 354b2: 87 e0 ldi r24, 0x07 ; 7 354b4: 97 e0 ldi r25, 0x07 ; 7 354b6: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 354ba: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 354be: 87 e1 ldi r24, 0x17 ; 23 354c0: 97 e0 ldi r25, 0x07 ; 7 354c2: ef cf rjmp .-34 ; 0x354a2 000354c4 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 354c4: fc 01 movw r30, r24 354c6: 40 81 ld r20, Z 354c8: 51 81 ldd r21, Z+1 ; 0x01 354ca: 62 81 ldd r22, Z+2 ; 0x02 354cc: 73 81 ldd r23, Z+3 ; 0x03 354ce: 40 93 d9 04 sts 0x04D9, r20 ; 0x8004d9 354d2: 50 93 da 04 sts 0x04DA, r21 ; 0x8004da 354d6: 60 93 db 04 sts 0x04DB, r22 ; 0x8004db 354da: 70 93 dc 04 sts 0x04DC, r23 ; 0x8004dc #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 354de: 20 91 7b 06 lds r18, 0x067B ; 0x80067b 354e2: 30 91 7c 06 lds r19, 0x067C ; 0x80067c 354e6: 40 91 7d 06 lds r20, 0x067D ; 0x80067d 354ea: 50 91 7e 06 lds r21, 0x067E ; 0x80067e 354ee: 60 81 ld r22, Z 354f0: 71 81 ldd r23, Z+1 ; 0x01 354f2: 82 81 ldd r24, Z+2 ; 0x02 354f4: 93 81 ldd r25, Z+3 ; 0x03 354f6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 354fa: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 354fe: e1 e5 ldi r30, 0x51 ; 81 35500: f7 e0 ldi r31, 0x07 ; 7 35502: 64 87 std Z+12, r22 ; 0x0c 35504: 75 87 std Z+13, r23 ; 0x0d 35506: 86 87 std Z+14, r24 ; 0x0e 35508: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 3550a: 8f b7 in r24, 0x3f ; 63 3550c: f8 94 cli count_position[E_AXIS] = e; 3550e: 44 85 ldd r20, Z+12 ; 0x0c 35510: 55 85 ldd r21, Z+13 ; 0x0d 35512: 66 85 ldd r22, Z+14 ; 0x0e 35514: 77 85 ldd r23, Z+15 ; 0x0f 35516: 40 93 6d 07 sts 0x076D, r20 ; 0x80076d 3551a: 50 93 6e 07 sts 0x076E, r21 ; 0x80076e 3551e: 60 93 6f 07 sts 0x076F, r22 ; 0x80076f 35522: 70 93 70 07 sts 0x0770, r23 ; 0x800770 CRITICAL_SECTION_END; 35526: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 35528: 08 95 ret 0003552a : // 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; 3552a: fc 01 movw r30, r24 3552c: 40 81 ld r20, Z 3552e: 51 81 ldd r21, Z+1 ; 0x01 35530: 62 81 ldd r22, Z+2 ; 0x02 35532: 73 81 ldd r23, Z+3 ; 0x03 35534: 40 93 d5 04 sts 0x04D5, r20 ; 0x8004d5 35538: 50 93 d6 04 sts 0x04D6, r21 ; 0x8004d6 3553c: 60 93 d7 04 sts 0x04D7, r22 ; 0x8004d7 35540: 70 93 d8 04 sts 0x04D8, r23 ; 0x8004d8 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 35544: 20 91 77 06 lds r18, 0x0677 ; 0x800677 35548: 30 91 78 06 lds r19, 0x0678 ; 0x800678 3554c: 40 91 79 06 lds r20, 0x0679 ; 0x800679 35550: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 35554: 60 81 ld r22, Z 35556: 71 81 ldd r23, Z+1 ; 0x01 35558: 82 81 ldd r24, Z+2 ; 0x02 3555a: 93 81 ldd r25, Z+3 ; 0x03 3555c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35560: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 35564: 60 93 59 07 sts 0x0759, r22 ; 0x800759 35568: 70 93 5a 07 sts 0x075A, r23 ; 0x80075a 3556c: 80 93 5b 07 sts 0x075B, r24 ; 0x80075b 35570: 90 93 5c 07 sts 0x075C, r25 ; 0x80075c st_set_position(position); 35574: 0d 94 3b 87 jmp 0x30e76 ; 0x30e76 00035578 : // 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) { 35578: 2f 92 push r2 3557a: 3f 92 push r3 3557c: 4f 92 push r4 3557e: 5f 92 push r5 35580: 6f 92 push r6 35582: 7f 92 push r7 35584: 8f 92 push r8 35586: 9f 92 push r9 35588: af 92 push r10 3558a: bf 92 push r11 3558c: cf 92 push r12 3558e: df 92 push r13 35590: ef 92 push r14 35592: ff 92 push r15 35594: 0f 93 push r16 35596: 1f 93 push r17 35598: cf 93 push r28 3559a: df 93 push r29 3559c: cd b7 in r28, 0x3d ; 61 3559e: de b7 in r29, 0x3e ; 62 355a0: c5 58 subi r28, 0x85 ; 133 355a2: d1 09 sbc r29, r1 355a4: 0f b6 in r0, 0x3f ; 63 355a6: f8 94 cli 355a8: de bf out 0x3e, r29 ; 62 355aa: 0f be out 0x3f, r0 ; 63 355ac: cd bf out 0x3d, r28 ; 61 355ae: 69 a3 std Y+33, r22 ; 0x21 355b0: 7a a3 std Y+34, r23 ; 0x22 355b2: 8b a3 std Y+35, r24 ; 0x23 355b4: 9c a3 std Y+36, r25 ; 0x24 355b6: 2d a3 std Y+37, r18 ; 0x25 355b8: 3e a3 std Y+38, r19 ; 0x26 355ba: 4f a3 std Y+39, r20 ; 0x27 355bc: 58 a7 std Y+40, r21 ; 0x28 355be: a8 96 adiw r28, 0x28 ; 40 355c0: ec ae std Y+60, r14 ; 0x3c 355c2: fd ae std Y+61, r15 ; 0x3d 355c4: 0e af std Y+62, r16 ; 0x3e 355c6: 1f af std Y+63, r17 ; 0x3f 355c8: a8 97 sbiw r28, 0x28 ; 40 355ca: aa 96 adiw r28, 0x2a ; 42 355cc: df ae std Y+63, r13 ; 0x3f 355ce: ce ae std Y+62, r12 ; 0x3e 355d0: aa 97 sbiw r28, 0x2a ; 42 355d2: 89 aa std Y+49, r8 ; 0x31 355d4: 99 ae std Y+57, r9 ; 0x39 355d6: ad ae std Y+61, r10 ; 0x3d 355d8: bd aa std Y+53, r11 ; 0x35 355da: c5 56 subi r28, 0x65 ; 101 355dc: df 4f sbci r29, 0xFF ; 255 355de: 08 81 ld r16, Y 355e0: 19 81 ldd r17, Y+1 ; 0x01 355e2: cb 59 subi r28, 0x9B ; 155 355e4: 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); 355e6: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 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) 355ea: 8f 5f subi r24, 0xFF ; 255 355ec: a1 96 adiw r28, 0x21 ; 33 355ee: 8f af std Y+63, r24 ; 0x3f 355f0: a1 97 sbiw r28, 0x21 ; 33 355f2: 80 31 cpi r24, 0x10 ; 16 355f4: 19 f4 brne .+6 ; 0x355fc block_index = 0; 355f6: a1 96 adiw r28, 0x21 ; 33 355f8: 1f ae std Y+63, r1 ; 0x3f 355fa: 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) { 355fc: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 35600: a1 96 adiw r28, 0x21 ; 33 35602: 2f ad ldd r18, Y+63 ; 0x3f 35604: a1 97 sbiw r28, 0x21 ; 33 35606: 82 13 cpse r24, r18 35608: 0f c0 rjmp .+30 ; 0x35628 do { manage_heater(); 3560a: 0f 94 66 4d call 0x29acc ; 0x29acc // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 3560e: 80 e0 ldi r24, 0x00 ; 0 35610: 0e 94 6b 8c call 0x118d6 ; 0x118d6 lcd_update(0); 35614: 80 e0 ldi r24, 0x00 ; 0 35616: 0e 94 ed 6f call 0xdfda ; 0xdfda } while (block_buffer_tail == next_buffer_head); 3561a: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 3561e: a1 96 adiw r28, 0x21 ; 33 35620: 3f ad ldd r19, Y+63 ; 0x3f 35622: a1 97 sbiw r28, 0x21 ; 33 35624: 83 17 cp r24, r19 35626: 89 f3 breq .-30 ; 0x3560a } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 35628: 40 91 5a 0e lds r20, 0x0E5A ; 0x800e5a 3562c: a2 96 adiw r28, 0x22 ; 34 3562e: 4f af std Y+63, r20 ; 0x3f 35630: a2 97 sbiw r28, 0x22 ; 34 35632: 44 23 and r20, r20 35634: 11 f1 breq .+68 ; 0x3567a // avoid planning the block early if aborted SERIAL_ECHO_START; 35636: 84 e1 ldi r24, 0x14 ; 20 35638: 9b ea ldi r25, 0xAB ; 171 3563a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(_n("Move aborted")); 3563e: 86 e1 ldi r24, 0x16 ; 22 35640: 92 e7 ldi r25, 0x72 ; 114 35642: 0e 94 97 7b call 0xf72e ; 0xf72e // 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(); } 35646: cb 57 subi r28, 0x7B ; 123 35648: df 4f sbci r29, 0xFF ; 255 3564a: 0f b6 in r0, 0x3f ; 63 3564c: f8 94 cli 3564e: de bf out 0x3e, r29 ; 62 35650: 0f be out 0x3f, r0 ; 63 35652: cd bf out 0x3d, r28 ; 61 35654: df 91 pop r29 35656: cf 91 pop r28 35658: 1f 91 pop r17 3565a: 0f 91 pop r16 3565c: ff 90 pop r15 3565e: ef 90 pop r14 35660: df 90 pop r13 35662: cf 90 pop r12 35664: bf 90 pop r11 35666: af 90 pop r10 35668: 9f 90 pop r9 3566a: 8f 90 pop r8 3566c: 7f 90 pop r7 3566e: 6f 90 pop r6 35670: 5f 90 pop r5 35672: 4f 90 pop r4 35674: 3f 90 pop r3 35676: 2f 90 pop r2 35678: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 3567a: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 3567e: 29 2e mov r2, r25 35680: 31 2c mov r3, r1 35682: 8e e6 ldi r24, 0x6E ; 110 35684: 98 9f mul r25, r24 35686: d0 01 movw r26, r0 35688: 11 24 eor r1, r1 3568a: a4 96 adiw r28, 0x24 ; 36 3568c: bf af std Y+63, r27 ; 0x3f 3568e: ae af std Y+62, r26 ; 0x3e 35690: 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; 35692: cd 01 movw r24, r26 35694: 8d 58 subi r24, 0x8D ; 141 35696: 98 4f sbci r25, 0xF8 ; 248 35698: fc 01 movw r30, r24 3569a: e9 5b subi r30, 0xB9 ; 185 3569c: ff 4f sbci r31, 0xFF ; 255 3569e: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 356a0: 84 59 subi r24, 0x94 ; 148 356a2: 9f 4f sbci r25, 0xFF ; 255 356a4: fc 01 movw r30, r24 356a6: 11 82 std Z+1, r1 ; 0x01 356a8: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 356aa: 01 15 cp r16, r1 356ac: 11 05 cpc r17, r1 356ae: 11 f4 brne .+4 ; 0x356b4 356b0: 0d 94 b0 b5 jmp 0x36b60 ; 0x36b60 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 356b4: 80 e1 ldi r24, 0x10 ; 16 356b6: f8 01 movw r30, r16 356b8: a5 53 subi r26, 0x35 ; 53 356ba: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 356bc: 01 90 ld r0, Z+ 356be: 0d 92 st X+, r0 356c0: 8a 95 dec r24 356c2: e1 f7 brne .-8 ; 0x356bc // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 356c4: 8e e6 ldi r24, 0x6E ; 110 356c6: 82 9d mul r24, r2 356c8: 80 01 movw r16, r0 356ca: 83 9d mul r24, r3 356cc: 10 0d add r17, r0 356ce: 11 24 eor r1, r1 356d0: 0d 58 subi r16, 0x8D ; 141 356d2: 18 4f sbci r17, 0xF8 ; 248 356d4: f8 01 movw r30, r16 356d6: e8 59 subi r30, 0x98 ; 152 356d8: ff 4f sbci r31, 0xFF ; 255 356da: c3 56 subi r28, 0x63 ; 99 356dc: df 4f sbci r29, 0xFF ; 255 356de: 88 81 ld r24, Y 356e0: 99 81 ldd r25, Y+1 ; 0x01 356e2: cd 59 subi r28, 0x9D ; 157 356e4: d0 40 sbci r29, 0x00 ; 0 356e6: 91 83 std Z+1, r25 ; 0x01 356e8: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 356ea: 06 59 subi r16, 0x96 ; 150 356ec: 1f 4f sbci r17, 0xFF ; 255 356ee: 60 91 90 02 lds r22, 0x0290 ; 0x800290 356f2: 70 91 91 02 lds r23, 0x0291 ; 0x800291 356f6: 80 91 92 02 lds r24, 0x0292 ; 0x800292 356fa: 90 91 93 02 lds r25, 0x0293 ; 0x800293 356fe: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 35702: d8 01 movw r26, r16 35704: 6d 93 st X+, r22 35706: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 35708: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.502> 3570c: 88 23 and r24, r24 3570e: a9 f0 breq .+42 ; 0x3573a { position[E_AXIS] = 0; 35710: 10 92 5d 07 sts 0x075D, r1 ; 0x80075d 35714: 10 92 5e 07 sts 0x075E, r1 ; 0x80075e 35718: 10 92 5f 07 sts 0x075F, r1 ; 0x80075f 3571c: 10 92 60 07 sts 0x0760, r1 ; 0x800760 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 35720: 10 92 d9 04 sts 0x04D9, r1 ; 0x8004d9 35724: 10 92 da 04 sts 0x04DA, r1 ; 0x8004da 35728: 10 92 db 04 sts 0x04DB, r1 ; 0x8004db 3572c: 10 92 dc 04 sts 0x04DC, r1 ; 0x8004dc #endif // the block might still be discarded later, but we need to ensure the lower-level // count_position is also reset correctly for consistent results! plan_reset_next_e_queue = false; 35730: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.502> plan_reset_next_e_sched = true; 35734: 81 e0 ldi r24, 0x01 ; 1 35736: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.503> } // Apply the machine correction matrix. world2machine(x, y); 3573a: be 01 movw r22, r28 3573c: 6b 5d subi r22, 0xDB ; 219 3573e: 7f 4f sbci r23, 0xFF ; 255 35740: ce 01 movw r24, r28 35742: 81 96 adiw r24, 0x21 ; 33 35744: 0e 94 48 6b call 0xd690 ; 0xd690 // 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]); 35748: c9 a0 ldd r12, Y+33 ; 0x21 3574a: da a0 ldd r13, Y+34 ; 0x22 3574c: eb a0 ldd r14, Y+35 ; 0x23 3574e: fc a0 ldd r15, Y+36 ; 0x24 35750: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 35754: 30 91 70 06 lds r19, 0x0670 ; 0x800670 35758: 40 91 71 06 lds r20, 0x0671 ; 0x800671 3575c: 50 91 72 06 lds r21, 0x0672 ; 0x800672 35760: c7 01 movw r24, r14 35762: b6 01 movw r22, r12 35764: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35768: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 3576c: c2 58 subi r28, 0x82 ; 130 3576e: df 4f sbci r29, 0xFF ; 255 35770: 68 83 st Y, r22 35772: 79 83 std Y+1, r23 ; 0x01 35774: 8a 83 std Y+2, r24 ; 0x02 35776: 9b 83 std Y+3, r25 ; 0x03 35778: ce 57 subi r28, 0x7E ; 126 3577a: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 3577c: 8d a0 ldd r8, Y+37 ; 0x25 3577e: 9e a0 ldd r9, Y+38 ; 0x26 35780: af a0 ldd r10, Y+39 ; 0x27 35782: b8 a4 ldd r11, Y+40 ; 0x28 35784: 20 91 73 06 lds r18, 0x0673 ; 0x800673 35788: 30 91 74 06 lds r19, 0x0674 ; 0x800674 3578c: 40 91 75 06 lds r20, 0x0675 ; 0x800675 35790: 50 91 76 06 lds r21, 0x0676 ; 0x800676 35794: c5 01 movw r24, r10 35796: b4 01 movw r22, r8 35798: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3579c: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 357a0: ce 57 subi r28, 0x7E ; 126 357a2: df 4f sbci r29, 0xFF ; 255 357a4: 68 83 st Y, r22 357a6: 79 83 std Y+1, r23 ; 0x01 357a8: 8a 83 std Y+2, r24 ; 0x02 357aa: 9b 83 std Y+3, r25 ; 0x03 357ac: c2 58 subi r28, 0x82 ; 130 357ae: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 357b0: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 357b4: 88 23 and r24, r24 357b6: 11 f4 brne .+4 ; 0x357bc 357b8: 0d 94 b7 b5 jmp 0x36b6e ; 0x36b6e target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 357bc: a5 01 movw r20, r10 357be: 94 01 movw r18, r8 357c0: c7 01 movw r24, r14 357c2: b6 01 movw r22, r12 357c4: 0f 94 d1 95 call 0x32ba2 ; 0x32ba2 357c8: a8 96 adiw r28, 0x28 ; 40 357ca: 2c ad ldd r18, Y+60 ; 0x3c 357cc: 3d ad ldd r19, Y+61 ; 0x3d 357ce: 4e ad ldd r20, Y+62 ; 0x3e 357d0: 5f ad ldd r21, Y+63 ; 0x3f 357d2: a8 97 sbiw r28, 0x28 ; 40 357d4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 357d8: 20 91 77 06 lds r18, 0x0677 ; 0x800677 357dc: 30 91 78 06 lds r19, 0x0678 ; 0x800678 357e0: 40 91 79 06 lds r20, 0x0679 ; 0x800679 357e4: 50 91 7a 06 lds r21, 0x067A ; 0x80067a }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 357e8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 357ec: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 357f0: e6 96 adiw r28, 0x36 ; 54 357f2: 6c af std Y+60, r22 ; 0x3c 357f4: 7d af std Y+61, r23 ; 0x3d 357f6: 8e af std Y+62, r24 ; 0x3e 357f8: 9f af std Y+63, r25 ; 0x3f 357fa: 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]); 357fc: aa 96 adiw r28, 0x2a ; 42 357fe: ee ad ldd r30, Y+62 ; 0x3e 35800: ff ad ldd r31, Y+63 ; 0x3f 35802: aa 97 sbiw r28, 0x2a ; 42 35804: 80 80 ld r8, Z 35806: 91 80 ldd r9, Z+1 ; 0x01 35808: a2 80 ldd r10, Z+2 ; 0x02 3580a: b3 80 ldd r11, Z+3 ; 0x03 3580c: 20 91 7b 06 lds r18, 0x067B ; 0x80067b 35810: 30 91 7c 06 lds r19, 0x067C ; 0x80067c 35814: 40 91 7d 06 lds r20, 0x067D ; 0x80067d 35818: 50 91 7e 06 lds r21, 0x067E ; 0x80067e 3581c: c5 01 movw r24, r10 3581e: b4 01 movw r22, r8 35820: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35824: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 35828: ae 96 adiw r28, 0x2e ; 46 3582a: 6c af std Y+60, r22 ; 0x3c 3582c: 7d af std Y+61, r23 ; 0x3d 3582e: 8e af std Y+62, r24 ; 0x3e 35830: 9f af std Y+63, r25 ; 0x3f 35832: 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]; 35834: 80 91 5d 07 lds r24, 0x075D ; 0x80075d 35838: 90 91 5e 07 lds r25, 0x075E ; 0x80075e 3583c: a0 91 5f 07 lds r26, 0x075F ; 0x80075f 35840: b0 91 60 07 lds r27, 0x0760 ; 0x800760 35844: ae 96 adiw r28, 0x2e ; 46 35846: 4c ac ldd r4, Y+60 ; 0x3c 35848: 5d ac ldd r5, Y+61 ; 0x3d 3584a: 6e ac ldd r6, Y+62 ; 0x3e 3584c: 7f ac ldd r7, Y+63 ; 0x3f 3584e: ae 97 sbiw r28, 0x2e ; 46 35850: 48 1a sub r4, r24 35852: 59 0a sbc r5, r25 35854: 6a 0a sbc r6, r26 35856: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 35858: 80 91 51 07 lds r24, 0x0751 ; 0x800751 3585c: 90 91 52 07 lds r25, 0x0752 ; 0x800752 35860: a0 91 53 07 lds r26, 0x0753 ; 0x800753 35864: b0 91 54 07 lds r27, 0x0754 ; 0x800754 35868: c2 58 subi r28, 0x82 ; 130 3586a: df 4f sbci r29, 0xFF ; 255 3586c: c8 80 ld r12, Y 3586e: d9 80 ldd r13, Y+1 ; 0x01 35870: ea 80 ldd r14, Y+2 ; 0x02 35872: fb 80 ldd r15, Y+3 ; 0x03 35874: ce 57 subi r28, 0x7E ; 126 35876: d0 40 sbci r29, 0x00 ; 0 35878: c8 1a sub r12, r24 3587a: d9 0a sbc r13, r25 3587c: ea 0a sbc r14, r26 3587e: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 35880: 80 91 55 07 lds r24, 0x0755 ; 0x800755 35884: 90 91 56 07 lds r25, 0x0756 ; 0x800756 35888: a0 91 57 07 lds r26, 0x0757 ; 0x800757 3588c: b0 91 58 07 lds r27, 0x0758 ; 0x800758 35890: ce 57 subi r28, 0x7E ; 126 35892: df 4f sbci r29, 0xFF ; 255 35894: 28 81 ld r18, Y 35896: 39 81 ldd r19, Y+1 ; 0x01 35898: 4a 81 ldd r20, Y+2 ; 0x02 3589a: 5b 81 ldd r21, Y+3 ; 0x03 3589c: c2 58 subi r28, 0x82 ; 130 3589e: d0 40 sbci r29, 0x00 ; 0 358a0: 28 1b sub r18, r24 358a2: 39 0b sbc r19, r25 358a4: 4a 0b sbc r20, r26 358a6: 5b 0b sbc r21, r27 358a8: 29 a7 std Y+41, r18 ; 0x29 358aa: 3a a7 std Y+42, r19 ; 0x2a 358ac: 4b a7 std Y+43, r20 ; 0x2b 358ae: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 358b0: 80 91 59 07 lds r24, 0x0759 ; 0x800759 358b4: 90 91 5a 07 lds r25, 0x075A ; 0x80075a 358b8: a0 91 5b 07 lds r26, 0x075B ; 0x80075b 358bc: b0 91 5c 07 lds r27, 0x075C ; 0x80075c 358c0: e6 96 adiw r28, 0x36 ; 54 358c2: 2c ad ldd r18, Y+60 ; 0x3c 358c4: 3d ad ldd r19, Y+61 ; 0x3d 358c6: 4e ad ldd r20, Y+62 ; 0x3e 358c8: 5f ad ldd r21, Y+63 ; 0x3f 358ca: e6 97 sbiw r28, 0x36 ; 54 358cc: 28 1b sub r18, r24 358ce: 39 0b sbc r19, r25 358d0: 4a 0b sbc r20, r26 358d2: 5b 0b sbc r21, r27 358d4: 2d a7 std Y+45, r18 ; 0x2d 358d6: 3e a7 std Y+46, r19 ; 0x2e 358d8: 4f a7 std Y+47, r20 ; 0x2f 358da: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 358dc: 41 14 cp r4, r1 358de: 51 04 cpc r5, r1 358e0: 61 04 cpc r6, r1 358e2: 71 04 cpc r7, r1 358e4: 09 f4 brne .+2 ; 0x358e8 358e6: 80 c0 rjmp .+256 ; 0x359e8 { if((int)degHotend(active_extruder) 358ec: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 358f0: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 358f4: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 358f8: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 358fc: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 35900: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 35904: 62 17 cp r22, r18 35906: 73 07 cpc r23, r19 35908: 0c f5 brge .+66 ; 0x3594c { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 3590a: ae 96 adiw r28, 0x2e ; 46 3590c: 8c ad ldd r24, Y+60 ; 0x3c 3590e: 9d ad ldd r25, Y+61 ; 0x3d 35910: ae ad ldd r26, Y+62 ; 0x3e 35912: bf ad ldd r27, Y+63 ; 0x3f 35914: ae 97 sbiw r28, 0x2e ; 46 35916: 80 93 5d 07 sts 0x075D, r24 ; 0x80075d 3591a: 90 93 5e 07 sts 0x075E, r25 ; 0x80075e 3591e: a0 93 5f 07 sts 0x075F, r26 ; 0x80075f 35922: b0 93 60 07 sts 0x0760, r27 ; 0x800760 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35926: 80 92 d9 04 sts 0x04D9, r8 ; 0x8004d9 3592a: 90 92 da 04 sts 0x04DA, r9 ; 0x8004da 3592e: a0 92 db 04 sts 0x04DB, r10 ; 0x8004db 35932: b0 92 dc 04 sts 0x04DC, r11 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 35936: 84 e1 ldi r24, 0x14 ; 20 35938: 9b ea ldi r25, 0xAB ; 171 3593a: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 3593e: 8c ef ldi r24, 0xFC ; 252 35940: 91 e7 ldi r25, 0x71 ; 113 35942: 0e 94 97 7b call 0xf72e ; 0xf72e { 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 35946: 41 2c mov r4, r1 35948: 51 2c mov r5, r1 3594a: 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) 3594c: c3 01 movw r24, r6 3594e: b2 01 movw r22, r4 35950: 77 fe sbrs r7, 7 35952: 07 c0 rjmp .+14 ; 0x35962 35954: 66 27 eor r22, r22 35956: 77 27 eor r23, r23 35958: cb 01 movw r24, r22 3595a: 64 19 sub r22, r4 3595c: 75 09 sbc r23, r5 3595e: 86 09 sbc r24, r6 35960: 97 09 sbc r25, r7 35962: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 35966: 4b 01 movw r8, r22 35968: 5c 01 movw r10, r24 3596a: 20 e0 ldi r18, 0x00 ; 0 3596c: 30 ec ldi r19, 0xC0 ; 192 3596e: 4b ee ldi r20, 0xEB ; 235 35970: 53 e4 ldi r21, 0x43 ; 67 35972: 60 91 7b 06 lds r22, 0x067B ; 0x80067b 35976: 70 91 7c 06 lds r23, 0x067C ; 0x80067c 3597a: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 3597e: 90 91 7e 06 lds r25, 0x067E ; 0x80067e 35982: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35986: 9b 01 movw r18, r22 35988: ac 01 movw r20, r24 3598a: c5 01 movw r24, r10 3598c: b4 01 movw r22, r8 3598e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 35992: 18 16 cp r1, r24 35994: 4c f5 brge .+82 ; 0x359e8 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 35996: ae 96 adiw r28, 0x2e ; 46 35998: 2c ad ldd r18, Y+60 ; 0x3c 3599a: 3d ad ldd r19, Y+61 ; 0x3d 3599c: 4e ad ldd r20, Y+62 ; 0x3e 3599e: 5f ad ldd r21, Y+63 ; 0x3f 359a0: ae 97 sbiw r28, 0x2e ; 46 359a2: 20 93 5d 07 sts 0x075D, r18 ; 0x80075d 359a6: 30 93 5e 07 sts 0x075E, r19 ; 0x80075e 359aa: 40 93 5f 07 sts 0x075F, r20 ; 0x80075f 359ae: 50 93 60 07 sts 0x0760, r21 ; 0x800760 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 359b2: aa 96 adiw r28, 0x2a ; 42 359b4: ee ad ldd r30, Y+62 ; 0x3e 359b6: ff ad ldd r31, Y+63 ; 0x3f 359b8: aa 97 sbiw r28, 0x2a ; 42 359ba: 80 81 ld r24, Z 359bc: 91 81 ldd r25, Z+1 ; 0x01 359be: a2 81 ldd r26, Z+2 ; 0x02 359c0: b3 81 ldd r27, Z+3 ; 0x03 359c2: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 359c6: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 359ca: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 359ce: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif de = 0; // no difference SERIAL_ECHO_START; 359d2: 84 e1 ldi r24, 0x14 ; 20 359d4: 9b ea ldi r25, 0xAB ; 171 359d6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 359da: 8e ed ldi r24, 0xDE ; 222 359dc: 91 e7 ldi r25, 0x71 ; 113 359de: 0e 94 97 7b call 0xf72e ; 0xf72e { 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 359e2: 41 2c mov r4, r1 359e4: 51 2c mov r5, r1 359e6: 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); 359e8: 8e e6 ldi r24, 0x6E ; 110 359ea: 82 9d mul r24, r2 359ec: f0 01 movw r30, r0 359ee: 83 9d mul r24, r3 359f0: f0 0d add r31, r0 359f2: 11 24 eor r1, r1 359f4: ed 58 subi r30, 0x8D ; 141 359f6: f8 4f sbci r31, 0xF8 ; 248 359f8: d7 01 movw r26, r14 359fa: c6 01 movw r24, r12 359fc: f7 fe sbrs r15, 7 359fe: 07 c0 rjmp .+14 ; 0x35a0e 35a00: 88 27 eor r24, r24 35a02: 99 27 eor r25, r25 35a04: dc 01 movw r26, r24 35a06: 8c 19 sub r24, r12 35a08: 9d 09 sbc r25, r13 35a0a: ae 09 sbc r26, r14 35a0c: bf 09 sbc r27, r15 35a0e: 80 83 st Z, r24 35a10: 91 83 std Z+1, r25 ; 0x01 35a12: a2 83 std Z+2, r26 ; 0x02 35a14: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 35a16: 8e e6 ldi r24, 0x6E ; 110 35a18: 82 9d mul r24, r2 35a1a: f0 01 movw r30, r0 35a1c: 83 9d mul r24, r3 35a1e: f0 0d add r31, r0 35a20: 11 24 eor r1, r1 35a22: ed 58 subi r30, 0x8D ; 141 35a24: f8 4f sbci r31, 0xF8 ; 248 35a26: 89 a5 ldd r24, Y+41 ; 0x29 35a28: 9a a5 ldd r25, Y+42 ; 0x2a 35a2a: ab a5 ldd r26, Y+43 ; 0x2b 35a2c: bc a5 ldd r27, Y+44 ; 0x2c 35a2e: b7 ff sbrs r27, 7 35a30: 07 c0 rjmp .+14 ; 0x35a40 35a32: b0 95 com r27 35a34: a0 95 com r26 35a36: 90 95 com r25 35a38: 81 95 neg r24 35a3a: 9f 4f sbci r25, 0xFF ; 255 35a3c: af 4f sbci r26, 0xFF ; 255 35a3e: bf 4f sbci r27, 0xFF ; 255 35a40: 84 83 std Z+4, r24 ; 0x04 35a42: 95 83 std Z+5, r25 ; 0x05 35a44: a6 83 std Z+6, r26 ; 0x06 35a46: 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); 35a48: 8e e6 ldi r24, 0x6E ; 110 35a4a: 82 9d mul r24, r2 35a4c: f0 01 movw r30, r0 35a4e: 83 9d mul r24, r3 35a50: f0 0d add r31, r0 35a52: 11 24 eor r1, r1 35a54: ed 58 subi r30, 0x8D ; 141 35a56: f8 4f sbci r31, 0xF8 ; 248 35a58: 8d a5 ldd r24, Y+45 ; 0x2d 35a5a: 9e a5 ldd r25, Y+46 ; 0x2e 35a5c: af a5 ldd r26, Y+47 ; 0x2f 35a5e: b8 a9 ldd r27, Y+48 ; 0x30 35a60: b7 ff sbrs r27, 7 35a62: 07 c0 rjmp .+14 ; 0x35a72 35a64: b0 95 com r27 35a66: a0 95 com r26 35a68: 90 95 com r25 35a6a: 81 95 neg r24 35a6c: 9f 4f sbci r25, 0xFF ; 255 35a6e: af 4f sbci r26, 0xFF ; 255 35a70: bf 4f sbci r27, 0xFF ; 255 35a72: 80 87 std Z+8, r24 ; 0x08 35a74: 91 87 std Z+9, r25 ; 0x09 35a76: a2 87 std Z+10, r26 ; 0x0a 35a78: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 35a7a: b3 01 movw r22, r6 35a7c: a2 01 movw r20, r4 35a7e: 77 fe sbrs r7, 7 35a80: 07 c0 rjmp .+14 ; 0x35a90 35a82: 44 27 eor r20, r20 35a84: 55 27 eor r21, r21 35a86: ba 01 movw r22, r20 35a88: 44 19 sub r20, r4 35a8a: 55 09 sbc r21, r5 35a8c: 66 09 sbc r22, r6 35a8e: 77 09 sbc r23, r7 35a90: 8e e6 ldi r24, 0x6E ; 110 35a92: 82 9d mul r24, r2 35a94: f0 01 movw r30, r0 35a96: 83 9d mul r24, r3 35a98: f0 0d add r31, r0 35a9a: 11 24 eor r1, r1 35a9c: ed 58 subi r30, 0x8D ; 141 35a9e: f8 4f sbci r31, 0xF8 ; 248 35aa0: 44 87 std Z+12, r20 ; 0x0c 35aa2: 55 87 std Z+13, r21 ; 0x0d 35aa4: 66 87 std Z+14, r22 ; 0x0e 35aa6: 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))); 35aa8: 00 81 ld r16, Z 35aaa: 11 81 ldd r17, Z+1 ; 0x01 35aac: 22 81 ldd r18, Z+2 ; 0x02 35aae: 33 81 ldd r19, Z+3 ; 0x03 35ab0: 84 81 ldd r24, Z+4 ; 0x04 35ab2: 95 81 ldd r25, Z+5 ; 0x05 35ab4: a6 81 ldd r26, Z+6 ; 0x06 35ab6: b7 81 ldd r27, Z+7 ; 0x07 35ab8: 80 17 cp r24, r16 35aba: 91 07 cpc r25, r17 35abc: a2 07 cpc r26, r18 35abe: b3 07 cpc r27, r19 35ac0: 14 f4 brge .+4 ; 0x35ac6 35ac2: d9 01 movw r26, r18 35ac4: c8 01 movw r24, r16 35ac6: ee e6 ldi r30, 0x6E ; 110 35ac8: be 2e mov r11, r30 35aca: b2 9c mul r11, r2 35acc: f0 01 movw r30, r0 35ace: b3 9c mul r11, r3 35ad0: f0 0d add r31, r0 35ad2: 11 24 eor r1, r1 35ad4: ed 58 subi r30, 0x8D ; 141 35ad6: f8 4f sbci r31, 0xF8 ; 248 35ad8: 80 84 ldd r8, Z+8 ; 0x08 35ada: 91 84 ldd r9, Z+9 ; 0x09 35adc: a2 84 ldd r10, Z+10 ; 0x0a 35ade: b3 84 ldd r11, Z+11 ; 0x0b 35ae0: 88 15 cp r24, r8 35ae2: 99 05 cpc r25, r9 35ae4: aa 05 cpc r26, r10 35ae6: bb 05 cpc r27, r11 35ae8: 14 f4 brge .+4 ; 0x35aee 35aea: d5 01 movw r26, r10 35aec: c4 01 movw r24, r8 35aee: 84 17 cp r24, r20 35af0: 95 07 cpc r25, r21 35af2: a6 07 cpc r26, r22 35af4: b7 07 cpc r27, r23 35af6: 14 f4 brge .+4 ; 0x35afc 35af8: db 01 movw r26, r22 35afa: ca 01 movw r24, r20 35afc: 4e e6 ldi r20, 0x6E ; 110 35afe: 42 9d mul r20, r2 35b00: f0 01 movw r30, r0 35b02: 43 9d mul r20, r3 35b04: f0 0d add r31, r0 35b06: 11 24 eor r1, r1 35b08: ed 58 subi r30, 0x8D ; 141 35b0a: f8 4f sbci r31, 0xF8 ; 248 35b0c: 80 8b std Z+16, r24 ; 0x10 35b0e: 91 8b std Z+17, r25 ; 0x11 35b10: a2 8b std Z+18, r26 ; 0x12 35b12: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 35b14: 06 97 sbiw r24, 0x06 ; 6 35b16: a1 05 cpc r26, r1 35b18: b1 05 cpc r27, r1 35b1a: 0c f4 brge .+2 ; 0x35b1e 35b1c: 94 cd rjmp .-1240 ; 0x35646 planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 35b1e: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 35b22: df 01 movw r26, r30 35b24: aa 5b subi r26, 0xBA ; 186 35b26: bf 4f sbci r27, 0xFF ; 255 35b28: 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); 35b2a: f7 fe sbrs r15, 7 35b2c: 02 c0 rjmp .+4 ; 0x35b32 35b2e: 0d 94 c7 b5 jmp 0x36b8e ; 0x36b8e } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 35b32: 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); 35b34: 89 a5 ldd r24, Y+41 ; 0x29 35b36: 9a a5 ldd r25, Y+42 ; 0x2a 35b38: ab a5 ldd r26, Y+43 ; 0x2b 35b3a: bc a5 ldd r27, Y+44 ; 0x2c 35b3c: b7 ff sbrs r27, 7 35b3e: 0b c0 rjmp .+22 ; 0x35b56 35b40: 8e e6 ldi r24, 0x6E ; 110 35b42: 82 9d mul r24, r2 35b44: f0 01 movw r30, r0 35b46: 83 9d mul r24, r3 35b48: f0 0d add r31, r0 35b4a: 11 24 eor r1, r1 35b4c: ed 58 subi r30, 0x8D ; 141 35b4e: f8 4f sbci r31, 0xF8 ; 248 35b50: 80 8d ldd r24, Z+24 ; 0x18 35b52: 82 60 ori r24, 0x02 ; 2 35b54: 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); 35b56: 8d a5 ldd r24, Y+45 ; 0x2d 35b58: 9e a5 ldd r25, Y+46 ; 0x2e 35b5a: af a5 ldd r26, Y+47 ; 0x2f 35b5c: b8 a9 ldd r27, Y+48 ; 0x30 35b5e: b7 ff sbrs r27, 7 35b60: 0b c0 rjmp .+22 ; 0x35b78 35b62: 8e e6 ldi r24, 0x6E ; 110 35b64: 82 9d mul r24, r2 35b66: f0 01 movw r30, r0 35b68: 83 9d mul r24, r3 35b6a: f0 0d add r31, r0 35b6c: 11 24 eor r1, r1 35b6e: ed 58 subi r30, 0x8D ; 141 35b70: f8 4f sbci r31, 0xF8 ; 248 35b72: 80 8d ldd r24, Z+24 ; 0x18 35b74: 84 60 ori r24, 0x04 ; 4 35b76: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 35b78: 77 fe sbrs r7, 7 35b7a: 0b c0 rjmp .+22 ; 0x35b92 35b7c: 8e e6 ldi r24, 0x6E ; 110 35b7e: 82 9d mul r24, r2 35b80: f0 01 movw r30, r0 35b82: 83 9d mul r24, r3 35b84: f0 0d add r31, r0 35b86: 11 24 eor r1, r1 35b88: ed 58 subi r30, 0x8D ; 141 35b8a: f8 4f sbci r31, 0xF8 ; 248 35b8c: 80 8d ldd r24, Z+24 ; 0x18 35b8e: 88 60 ori r24, 0x08 ; 8 35b90: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 35b92: 01 2b or r16, r17 35b94: 02 2b or r16, r18 35b96: 03 2b or r16, r19 35b98: 09 f0 breq .+2 ; 0x35b9c 35b9a: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 35b9c: 8e e6 ldi r24, 0x6E ; 110 35b9e: 82 9d mul r24, r2 35ba0: f0 01 movw r30, r0 35ba2: 83 9d mul r24, r3 35ba4: f0 0d add r31, r0 35ba6: 11 24 eor r1, r1 35ba8: ed 58 subi r30, 0x8D ; 141 35baa: f8 4f sbci r31, 0xF8 ; 248 35bac: 84 81 ldd r24, Z+4 ; 0x04 35bae: 95 81 ldd r25, Z+5 ; 0x05 35bb0: a6 81 ldd r26, Z+6 ; 0x06 35bb2: b7 81 ldd r27, Z+7 ; 0x07 35bb4: 89 2b or r24, r25 35bb6: 8a 2b or r24, r26 35bb8: 8b 2b or r24, r27 35bba: 09 f0 breq .+2 ; 0x35bbe 35bbc: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 35bbe: 8e e6 ldi r24, 0x6E ; 110 35bc0: 82 9d mul r24, r2 35bc2: f0 01 movw r30, r0 35bc4: 83 9d mul r24, r3 35bc6: f0 0d add r31, r0 35bc8: 11 24 eor r1, r1 35bca: ed 58 subi r30, 0x8D ; 141 35bcc: f8 4f sbci r31, 0xF8 ; 248 35bce: 80 85 ldd r24, Z+8 ; 0x08 35bd0: 91 85 ldd r25, Z+9 ; 0x09 35bd2: a2 85 ldd r26, Z+10 ; 0x0a 35bd4: b3 85 ldd r27, Z+11 ; 0x0b 35bd6: 89 2b or r24, r25 35bd8: 8a 2b or r24, r26 35bda: 8b 2b or r24, r27 35bdc: 09 f0 breq .+2 ; 0x35be0 35bde: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 35be0: 8e e6 ldi r24, 0x6E ; 110 35be2: 82 9d mul r24, r2 35be4: f0 01 movw r30, r0 35be6: 83 9d mul r24, r3 35be8: f0 0d add r31, r0 35bea: 11 24 eor r1, r1 35bec: ed 58 subi r30, 0x8D ; 141 35bee: f8 4f sbci r31, 0xF8 ; 248 35bf0: 84 85 ldd r24, Z+12 ; 0x0c 35bf2: 95 85 ldd r25, Z+13 ; 0x0d 35bf4: a6 85 ldd r26, Z+14 ; 0x0e 35bf6: b7 85 ldd r27, Z+15 ; 0x0f 35bf8: 89 2b or r24, r25 35bfa: 8a 2b or r24, r26 35bfc: 8b 2b or r24, r27 35bfe: 09 f0 breq .+2 ; 0x35c02 35c00: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 35c02: 8e e6 ldi r24, 0x6E ; 110 35c04: 82 9d mul r24, r2 35c06: f0 01 movw r30, r0 35c08: 83 9d mul r24, r3 35c0a: f0 0d add r31, r0 35c0c: 11 24 eor r1, r1 35c0e: ed 58 subi r30, 0x8D ; 141 35c10: f8 4f sbci r31, 0xF8 ; 248 35c12: 24 85 ldd r18, Z+12 ; 0x0c 35c14: 35 85 ldd r19, Z+13 ; 0x0d 35c16: 46 85 ldd r20, Z+14 ; 0x0e 35c18: 57 85 ldd r21, Z+15 ; 0x0f 35c1a: 2a 96 adiw r28, 0x0a ; 10 35c1c: 2c af std Y+60, r18 ; 0x3c 35c1e: 3d af std Y+61, r19 ; 0x3d 35c20: 4e af std Y+62, r20 ; 0x3e 35c22: 5f af std Y+63, r21 ; 0x3f 35c24: 2a 97 sbiw r28, 0x0a ; 10 35c26: 23 2b or r18, r19 35c28: 24 2b or r18, r20 35c2a: 25 2b or r18, r21 35c2c: 09 f0 breq .+2 ; 0x35c30 35c2e: b3 c7 rjmp .+3942 ; 0x36b96 { if(feed_rate 35c34: b0 90 ac 06 lds r11, 0x06AC ; 0x8006ac 35c38: 00 91 ad 06 lds r16, 0x06AD ; 0x8006ad 35c3c: 10 91 ae 06 lds r17, 0x06AE ; 0x8006ae } else { if(feed_rate 35c50: 18 16 cp r1, r24 35c52: 24 f4 brge .+8 ; 0x35c5c 35c54: a9 aa std Y+49, r10 ; 0x31 35c56: b9 ae std Y+57, r11 ; 0x39 35c58: 0d af std Y+61, r16 ; 0x3d 35c5a: 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]; 35c5c: c7 01 movw r24, r14 35c5e: b6 01 movw r22, r12 35c60: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 35c64: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 35c68: 30 91 70 06 lds r19, 0x0670 ; 0x800670 35c6c: 40 91 71 06 lds r20, 0x0671 ; 0x800671 35c70: 50 91 72 06 lds r21, 0x0672 ; 0x800672 35c74: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 35c78: 4b 01 movw r8, r22 35c7a: 5c 01 movw r10, r24 35c7c: 89 82 std Y+1, r8 ; 0x01 35c7e: 9a 82 std Y+2, r9 ; 0x02 35c80: ab 82 std Y+3, r10 ; 0x03 35c82: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 35c84: 69 a5 ldd r22, Y+41 ; 0x29 35c86: 7a a5 ldd r23, Y+42 ; 0x2a 35c88: 8b a5 ldd r24, Y+43 ; 0x2b 35c8a: 9c a5 ldd r25, Y+44 ; 0x2c 35c8c: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 35c90: 20 91 73 06 lds r18, 0x0673 ; 0x800673 35c94: 30 91 74 06 lds r19, 0x0674 ; 0x800674 35c98: 40 91 75 06 lds r20, 0x0675 ; 0x800675 35c9c: 50 91 76 06 lds r21, 0x0676 ; 0x800676 35ca0: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 35ca4: 6b 01 movw r12, r22 35ca6: 7c 01 movw r14, r24 35ca8: cd 82 std Y+5, r12 ; 0x05 35caa: de 82 std Y+6, r13 ; 0x06 35cac: ef 82 std Y+7, r14 ; 0x07 35cae: 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]; 35cb0: 6d a5 ldd r22, Y+45 ; 0x2d 35cb2: 7e a5 ldd r23, Y+46 ; 0x2e 35cb4: 8f a5 ldd r24, Y+47 ; 0x2f 35cb6: 98 a9 ldd r25, Y+48 ; 0x30 35cb8: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 35cbc: 20 91 77 06 lds r18, 0x0677 ; 0x800677 35cc0: 30 91 78 06 lds r19, 0x0678 ; 0x800678 35cc4: 40 91 79 06 lds r20, 0x0679 ; 0x800679 35cc8: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 35ccc: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 35cd0: 22 96 adiw r28, 0x02 ; 2 35cd2: 6c af std Y+60, r22 ; 0x3c 35cd4: 7d af std Y+61, r23 ; 0x3d 35cd6: 8e af std Y+62, r24 ; 0x3e 35cd8: 9f af std Y+63, r25 ; 0x3f 35cda: 22 97 sbiw r28, 0x02 ; 2 35cdc: 69 87 std Y+9, r22 ; 0x09 35cde: 7a 87 std Y+10, r23 ; 0x0a 35ce0: 8b 87 std Y+11, r24 ; 0x0b 35ce2: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 35ce4: c3 01 movw r24, r6 35ce6: b2 01 movw r22, r4 35ce8: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 35cec: 20 91 7b 06 lds r18, 0x067B ; 0x80067b 35cf0: 30 91 7c 06 lds r19, 0x067C ; 0x80067c 35cf4: 40 91 7d 06 lds r20, 0x067D ; 0x80067d 35cf8: 50 91 7e 06 lds r21, 0x067E ; 0x80067e 35cfc: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 35d00: 26 96 adiw r28, 0x06 ; 6 35d02: 6c af std Y+60, r22 ; 0x3c 35d04: 7d af std Y+61, r23 ; 0x3d 35d06: 8e af std Y+62, r24 ; 0x3e 35d08: 9f af std Y+63, r25 ; 0x3f 35d0a: 26 97 sbiw r28, 0x06 ; 6 35d0c: 6d 87 std Y+13, r22 ; 0x0d 35d0e: 7e 87 std Y+14, r23 ; 0x0e 35d10: 8f 87 std Y+15, r24 ; 0x0f 35d12: 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 ) 35d14: 8e e6 ldi r24, 0x6E ; 110 35d16: 82 9d mul r24, r2 35d18: f0 01 movw r30, r0 35d1a: 83 9d mul r24, r3 35d1c: f0 0d add r31, r0 35d1e: 11 24 eor r1, r1 35d20: ed 58 subi r30, 0x8D ; 141 35d22: f8 4f sbci r31, 0xF8 ; 248 35d24: 80 81 ld r24, Z 35d26: 91 81 ldd r25, Z+1 ; 0x01 35d28: a2 81 ldd r26, Z+2 ; 0x02 35d2a: b3 81 ldd r27, Z+3 ; 0x03 35d2c: 2e 96 adiw r28, 0x0e ; 14 35d2e: 8c af std Y+60, r24 ; 0x3c 35d30: 9d af std Y+61, r25 ; 0x3d 35d32: ae af std Y+62, r26 ; 0x3e 35d34: bf af std Y+63, r27 ; 0x3f 35d36: 2e 97 sbiw r28, 0x0e ; 14 35d38: 06 97 sbiw r24, 0x06 ; 6 35d3a: a1 05 cpc r26, r1 35d3c: b1 05 cpc r27, r1 35d3e: 0c f0 brlt .+2 ; 0x35d42 35d40: 33 c7 rjmp .+3686 ; 0x36ba8 35d42: 84 81 ldd r24, Z+4 ; 0x04 35d44: 95 81 ldd r25, Z+5 ; 0x05 35d46: a6 81 ldd r26, Z+6 ; 0x06 35d48: b7 81 ldd r27, Z+7 ; 0x07 35d4a: 06 97 sbiw r24, 0x06 ; 6 35d4c: a1 05 cpc r26, r1 35d4e: b1 05 cpc r27, r1 35d50: 0c f0 brlt .+2 ; 0x35d54 35d52: 2a c7 rjmp .+3668 ; 0x36ba8 35d54: 80 85 ldd r24, Z+8 ; 0x08 35d56: 91 85 ldd r25, Z+9 ; 0x09 35d58: a2 85 ldd r26, Z+10 ; 0x0a 35d5a: b3 85 ldd r27, Z+11 ; 0x0b 35d5c: 06 97 sbiw r24, 0x06 ; 6 35d5e: a1 05 cpc r26, r1 35d60: b1 05 cpc r27, r1 35d62: 0c f0 brlt .+2 ; 0x35d66 35d64: 21 c7 rjmp .+3650 ; 0x36ba8 { block->millimeters = fabs(delta_mm[E_AXIS]); 35d66: 26 96 adiw r28, 0x06 ; 6 35d68: 8c ad ldd r24, Y+60 ; 0x3c 35d6a: 9d ad ldd r25, Y+61 ; 0x3d 35d6c: ae ad ldd r26, Y+62 ; 0x3e 35d6e: bf ad ldd r27, Y+63 ; 0x3f 35d70: 26 97 sbiw r28, 0x06 ; 6 35d72: bf 77 andi r27, 0x7F ; 127 35d74: 85 a7 std Z+45, r24 ; 0x2d 35d76: 96 a7 std Z+46, r25 ; 0x2e 35d78: a7 a7 std Z+47, r26 ; 0x2f 35d7a: 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 35d7c: 8e e6 ldi r24, 0x6E ; 110 35d7e: 82 9d mul r24, r2 35d80: f0 01 movw r30, r0 35d82: 83 9d mul r24, r3 35d84: f0 0d add r31, r0 35d86: 11 24 eor r1, r1 35d88: ed 58 subi r30, 0x8D ; 141 35d8a: f8 4f sbci r31, 0xF8 ; 248 35d8c: 45 a4 ldd r4, Z+45 ; 0x2d 35d8e: 56 a4 ldd r5, Z+46 ; 0x2e 35d90: 67 a4 ldd r6, Z+47 ; 0x2f 35d92: 70 a8 ldd r7, Z+48 ; 0x30 35d94: a3 01 movw r20, r6 35d96: 92 01 movw r18, r4 35d98: 60 e0 ldi r22, 0x00 ; 0 35d9a: 70 e0 ldi r23, 0x00 ; 0 35d9c: 80 e8 ldi r24, 0x80 ; 128 35d9e: 9f e3 ldi r25, 0x3F ; 63 35da0: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 35da4: 29 a9 ldd r18, Y+49 ; 0x31 35da6: 39 ad ldd r19, Y+57 ; 0x39 35da8: 4d ad ldd r20, Y+61 ; 0x3d 35daa: 5d a9 ldd r21, Y+53 ; 0x35 35dac: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35db0: 6b 01 movw r12, r22 35db2: 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); 35db4: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 35db8: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 35dbc: 89 1b sub r24, r25 35dbe: 8f 70 andi r24, 0x0F ; 15 35dc0: 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)) { 35dc2: 82 50 subi r24, 0x02 ; 2 35dc4: 86 30 cpi r24, 0x06 ; 6 35dc6: 08 f0 brcs .+2 ; 0x35dca 35dc8: 40 c0 rjmp .+128 ; 0x35e4a // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 35dca: a7 01 movw r20, r14 35dcc: 96 01 movw r18, r12 35dce: 60 e0 ldi r22, 0x00 ; 0 35dd0: 74 e2 ldi r23, 0x24 ; 36 35dd2: 84 e7 ldi r24, 0x74 ; 116 35dd4: 99 e4 ldi r25, 0x49 ; 73 35dd6: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 35dda: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 35dde: 4b 01 movw r8, r22 35de0: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 35de2: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 35de6: 90 91 b0 06 lds r25, 0x06B0 ; 0x8006b0 35dea: a0 91 b1 06 lds r26, 0x06B1 ; 0x8006b1 35dee: b0 91 b2 06 lds r27, 0x06B2 ; 0x8006b2 35df2: 88 16 cp r8, r24 35df4: 99 06 cpc r9, r25 35df6: aa 06 cpc r10, r26 35df8: bb 06 cpc r11, r27 35dfa: 38 f5 brcc .+78 ; 0x35e4a // 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)); 35dfc: bc 01 movw r22, r24 35dfe: cd 01 movw r24, r26 35e00: 68 19 sub r22, r8 35e02: 79 09 sbc r23, r9 35e04: 8a 09 sbc r24, r10 35e06: 9b 09 sbc r25, r11 35e08: 66 0f add r22, r22 35e0a: 77 1f adc r23, r23 35e0c: 88 1f adc r24, r24 35e0e: 99 1f adc r25, r25 35e10: ad ad ldd r26, Y+61 ; 0x3d 35e12: 2a 2f mov r18, r26 35e14: 30 e0 ldi r19, 0x00 ; 0 35e16: 50 e0 ldi r21, 0x00 ; 0 35e18: 40 e0 ldi r20, 0x00 ; 0 35e1a: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 35e1e: ca 01 movw r24, r20 35e20: b9 01 movw r22, r18 35e22: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 35e26: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 35e2a: 68 0d add r22, r8 35e2c: 79 1d adc r23, r9 35e2e: 8a 1d adc r24, r10 35e30: 9b 1d adc r25, r11 35e32: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 35e36: 9b 01 movw r18, r22 35e38: ac 01 movw r20, r24 35e3a: 60 e0 ldi r22, 0x00 ; 0 35e3c: 74 e2 ldi r23, 0x24 ; 36 35e3e: 84 e7 ldi r24, 0x74 ; 116 35e40: 99 e4 ldi r25, 0x49 ; 73 35e42: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 35e46: 6b 01 movw r12, r22 35e48: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 35e4a: a3 01 movw r20, r6 35e4c: 92 01 movw r18, r4 35e4e: c7 01 movw r24, r14 35e50: b6 01 movw r22, r12 35e52: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35e56: 6d ab std Y+53, r22 ; 0x35 35e58: 7e ab std Y+54, r23 ; 0x36 35e5a: 8f ab std Y+55, r24 ; 0x37 35e5c: 98 af std Y+56, r25 ; 0x38 35e5e: 8e e6 ldi r24, 0x6E ; 110 35e60: 82 9d mul r24, r2 35e62: 80 01 movw r16, r0 35e64: 83 9d mul r24, r3 35e66: 10 0d add r17, r0 35e68: 11 24 eor r1, r1 35e6a: 0d 58 subi r16, 0x8D ; 141 35e6c: 18 4f sbci r17, 0xF8 ; 248 35e6e: 2d a9 ldd r18, Y+53 ; 0x35 35e70: 3e a9 ldd r19, Y+54 ; 0x36 35e72: 4f a9 ldd r20, Y+55 ; 0x37 35e74: 58 ad ldd r21, Y+56 ; 0x38 35e76: d8 01 movw r26, r16 35e78: 91 96 adiw r26, 0x21 ; 33 35e7a: 2d 93 st X+, r18 35e7c: 3d 93 st X+, r19 35e7e: 4d 93 st X+, r20 35e80: 5c 93 st X, r21 35e82: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 35e84: 50 96 adiw r26, 0x10 ; 16 35e86: 6d 91 ld r22, X+ 35e88: 7d 91 ld r23, X+ 35e8a: 8d 91 ld r24, X+ 35e8c: 9c 91 ld r25, X 35e8e: 53 97 sbiw r26, 0x13 ; 19 35e90: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 35e94: 69 af std Y+57, r22 ; 0x39 35e96: 7a af std Y+58, r23 ; 0x3a 35e98: 8b af std Y+59, r24 ; 0x3b 35e9a: 9c af std Y+60, r25 ; 0x3c 35e9c: 9b 01 movw r18, r22 35e9e: ac 01 movw r20, r24 35ea0: c7 01 movw r24, r14 35ea2: b6 01 movw r22, r12 35ea4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35ea8: 0f 94 15 df call 0x3be2a ; 0x3be2a 35eac: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 35eb0: 62 96 adiw r28, 0x12 ; 18 35eb2: 6c af std Y+60, r22 ; 0x3c 35eb4: 7d af std Y+61, r23 ; 0x3d 35eb6: 8e af std Y+62, r24 ; 0x3e 35eb8: 9f af std Y+63, r25 ; 0x3f 35eba: 62 97 sbiw r28, 0x12 ; 18 35ebc: f8 01 movw r30, r16 35ebe: 66 ab std Z+54, r22 ; 0x36 35ec0: 77 ab std Z+55, r23 ; 0x37 35ec2: 80 af std Z+56, r24 ; 0x38 35ec4: 91 af std Z+57, r25 ; 0x39 35ec6: 9e 01 movw r18, r28 35ec8: 2f 5f subi r18, 0xFF ; 255 35eca: 3f 4f sbci r19, 0xFF ; 255 35ecc: 6c 96 adiw r28, 0x1c ; 28 35ece: 3f af std Y+63, r19 ; 0x3f 35ed0: 2e af std Y+62, r18 ; 0x3e 35ed2: 6c 97 sbiw r28, 0x1c ; 28 35ed4: ae 01 movw r20, r28 35ed6: 4f 5e subi r20, 0xEF ; 239 35ed8: 5f 4f sbci r21, 0xFF ; 255 35eda: a0 96 adiw r28, 0x20 ; 32 35edc: 5f af std Y+63, r21 ; 0x3f 35ede: 4e af std Y+62, r20 ; 0x3e 35ee0: a0 97 sbiw r28, 0x20 ; 32 35ee2: 80 91 99 02 lds r24, 0x0299 ; 0x800299 35ee6: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 35eea: 9a ab std Y+50, r25 ; 0x32 35eec: 89 ab std Y+49, r24 ; 0x31 35eee: 40 96 adiw r24, 0x10 ; 16 35ef0: 6e 96 adiw r28, 0x1e ; 30 35ef2: 9f af std Y+63, r25 ; 0x3f 35ef4: 8e af std Y+62, r24 ; 0x3e 35ef6: 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]) 35ef8: 68 96 adiw r28, 0x18 ; 24 35efa: 5f af std Y+63, r21 ; 0x3f 35efc: 4e af std Y+62, r20 ; 0x3e 35efe: 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 35f00: 19 a6 std Y+41, r1 ; 0x29 35f02: 1d a6 std Y+45, r1 ; 0x2d 35f04: 00 e8 ldi r16, 0x80 ; 128 35f06: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 35f08: 6c 96 adiw r28, 0x1c ; 28 35f0a: ae ad ldd r26, Y+62 ; 0x3e 35f0c: bf ad ldd r27, Y+63 ; 0x3f 35f0e: 6c 97 sbiw r28, 0x1c ; 28 35f10: 2d 91 ld r18, X+ 35f12: 3d 91 ld r19, X+ 35f14: 4d 91 ld r20, X+ 35f16: 5d 91 ld r21, X+ 35f18: 6c 96 adiw r28, 0x1c ; 28 35f1a: bf af std Y+63, r27 ; 0x3f 35f1c: ae af std Y+62, r26 ; 0x3e 35f1e: 6c 97 sbiw r28, 0x1c ; 28 35f20: c7 01 movw r24, r14 35f22: b6 01 movw r22, r12 35f24: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35f28: 68 96 adiw r28, 0x18 ; 24 35f2a: ee ad ldd r30, Y+62 ; 0x3e 35f2c: ff ad ldd r31, Y+63 ; 0x3f 35f2e: 68 97 sbiw r28, 0x18 ; 24 35f30: 61 93 st Z+, r22 35f32: 71 93 st Z+, r23 35f34: 81 93 st Z+, r24 35f36: 91 93 st Z+, r25 35f38: 68 96 adiw r28, 0x18 ; 24 35f3a: ff af std Y+63, r31 ; 0x3f 35f3c: ee af std Y+62, r30 ; 0x3e 35f3e: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 35f40: 4b 01 movw r8, r22 35f42: 5c 01 movw r10, r24 35f44: e8 94 clt 35f46: b7 f8 bld r11, 7 35f48: a9 a9 ldd r26, Y+49 ; 0x31 35f4a: ba a9 ldd r27, Y+50 ; 0x32 35f4c: 2d 91 ld r18, X+ 35f4e: 3d 91 ld r19, X+ 35f50: 4d 91 ld r20, X+ 35f52: 5d 91 ld r21, X+ 35f54: ba ab std Y+50, r27 ; 0x32 35f56: a9 ab std Y+49, r26 ; 0x31 35f58: 66 96 adiw r28, 0x16 ; 22 35f5a: 2c af std Y+60, r18 ; 0x3c 35f5c: 3d af std Y+61, r19 ; 0x3d 35f5e: 4e af std Y+62, r20 ; 0x3e 35f60: 5f af std Y+63, r21 ; 0x3f 35f62: 66 97 sbiw r28, 0x16 ; 22 35f64: c5 01 movw r24, r10 35f66: b4 01 movw r22, r8 35f68: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 35f6c: 18 16 cp r1, r24 35f6e: b4 f4 brge .+44 ; 0x35f9c { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 35f70: a5 01 movw r20, r10 35f72: 94 01 movw r18, r8 35f74: 66 96 adiw r28, 0x16 ; 22 35f76: 6c ad ldd r22, Y+60 ; 0x3c 35f78: 7d ad ldd r23, Y+61 ; 0x3d 35f7a: 8e ad ldd r24, Y+62 ; 0x3e 35f7c: 9f ad ldd r25, Y+63 ; 0x3f 35f7e: 66 97 sbiw r28, 0x16 ; 22 35f80: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 35f84: 4b 01 movw r8, r22 35f86: 5c 01 movw r10, r24 35f88: 29 a5 ldd r18, Y+41 ; 0x29 35f8a: 3d a5 ldd r19, Y+45 ; 0x2d 35f8c: a8 01 movw r20, r16 35f8e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 35f92: 18 16 cp r1, r24 35f94: 1c f0 brlt .+6 ; 0x35f9c 35f96: 89 a6 std Y+41, r8 ; 0x29 35f98: 9d a6 std Y+45, r9 ; 0x2d 35f9a: 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++) 35f9c: 6e 96 adiw r28, 0x1e ; 30 35f9e: ee ad ldd r30, Y+62 ; 0x3e 35fa0: ff ad ldd r31, Y+63 ; 0x3f 35fa2: 6e 97 sbiw r28, 0x1e ; 30 35fa4: 29 a9 ldd r18, Y+49 ; 0x31 35fa6: 3a a9 ldd r19, Y+50 ; 0x32 35fa8: e2 17 cp r30, r18 35faa: f3 07 cpc r31, r19 35fac: 09 f0 breq .+2 ; 0x35fb0 35fae: ac cf rjmp .-168 ; 0x35f08 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 35fb0: 20 e0 ldi r18, 0x00 ; 0 35fb2: 30 e0 ldi r19, 0x00 ; 0 35fb4: 40 e8 ldi r20, 0x80 ; 128 35fb6: 5f e3 ldi r21, 0x3F ; 63 35fb8: 69 a5 ldd r22, Y+41 ; 0x29 35fba: 7d a5 ldd r23, Y+45 ; 0x2d 35fbc: c8 01 movw r24, r16 35fbe: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 35fc2: 87 ff sbrs r24, 7 35fc4: 50 c0 rjmp .+160 ; 0x36066 35fc6: a0 96 adiw r28, 0x20 ; 32 35fc8: ae ac ldd r10, Y+62 ; 0x3e 35fca: bf ac ldd r11, Y+63 ; 0x3f 35fcc: a0 97 sbiw r28, 0x20 ; 32 35fce: 30 e1 ldi r19, 0x10 ; 16 35fd0: a3 0e add r10, r19 35fd2: b1 1c adc r11, r1 35fd4: a0 96 adiw r28, 0x20 ; 32 35fd6: ce ac ldd r12, Y+62 ; 0x3e 35fd8: df ac ldd r13, Y+63 ; 0x3f 35fda: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 35fdc: d6 01 movw r26, r12 35fde: 6d 91 ld r22, X+ 35fe0: 7d 91 ld r23, X+ 35fe2: 8d 91 ld r24, X+ 35fe4: 9d 91 ld r25, X+ 35fe6: 6d 01 movw r12, r26 35fe8: 7d 01 movw r14, r26 35fea: b4 e0 ldi r27, 0x04 ; 4 35fec: eb 1a sub r14, r27 35fee: f1 08 sbc r15, r1 35ff0: 29 a5 ldd r18, Y+41 ; 0x29 35ff2: 3d a5 ldd r19, Y+45 ; 0x2d 35ff4: a8 01 movw r20, r16 35ff6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 35ffa: f7 01 movw r30, r14 35ffc: 60 83 st Z, r22 35ffe: 71 83 std Z+1, r23 ; 0x01 36000: 82 83 std Z+2, r24 ; 0x02 36002: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 36004: ac 14 cp r10, r12 36006: bd 04 cpc r11, r13 36008: 49 f7 brne .-46 ; 0x35fdc { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 3600a: 2e e6 ldi r18, 0x6E ; 110 3600c: 22 9d mul r18, r2 3600e: c0 01 movw r24, r0 36010: 23 9d mul r18, r3 36012: 90 0d add r25, r0 36014: 11 24 eor r1, r1 36016: 9c 01 movw r18, r24 36018: 2d 58 subi r18, 0x8D ; 141 3601a: 38 4f sbci r19, 0xF8 ; 248 3601c: 79 01 movw r14, r18 3601e: 29 a5 ldd r18, Y+41 ; 0x29 36020: 3d a5 ldd r19, Y+45 ; 0x2d 36022: a8 01 movw r20, r16 36024: 6d a9 ldd r22, Y+53 ; 0x35 36026: 7e a9 ldd r23, Y+54 ; 0x36 36028: 8f a9 ldd r24, Y+55 ; 0x37 3602a: 98 ad ldd r25, Y+56 ; 0x38 3602c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36030: d7 01 movw r26, r14 36032: 91 96 adiw r26, 0x21 ; 33 36034: 6d 93 st X+, r22 36036: 7d 93 st X+, r23 36038: 8d 93 st X+, r24 3603a: 9c 93 st X, r25 3603c: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 3603e: 62 96 adiw r28, 0x12 ; 18 36040: 6c ad ldd r22, Y+60 ; 0x3c 36042: 7d ad ldd r23, Y+61 ; 0x3d 36044: 8e ad ldd r24, Y+62 ; 0x3e 36046: 9f ad ldd r25, Y+63 ; 0x3f 36048: 62 97 sbiw r28, 0x12 ; 18 3604a: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 3604e: 29 a5 ldd r18, Y+41 ; 0x29 36050: 3d a5 ldd r19, Y+45 ; 0x2d 36052: a8 01 movw r20, r16 36054: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36058: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3605c: f7 01 movw r30, r14 3605e: 66 ab std Z+54, r22 ; 0x36 36060: 77 ab std Z+55, r23 ; 0x37 36062: 80 af std Z+56, r24 ; 0x38 36064: 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; 36066: a3 01 movw r20, r6 36068: 92 01 movw r18, r4 3606a: 69 ad ldd r22, Y+57 ; 0x39 3606c: 7a ad ldd r23, Y+58 ; 0x3a 3606e: 8b ad ldd r24, Y+59 ; 0x3b 36070: 9c ad ldd r25, Y+60 ; 0x3c 36072: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 36076: 69 a7 std Y+41, r22 ; 0x29 36078: 7a a7 std Y+42, r23 ; 0x2a 3607a: 8b a7 std Y+43, r24 ; 0x2b 3607c: 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) 3607e: 2e 96 adiw r28, 0x0e ; 14 36080: 2c ad ldd r18, Y+60 ; 0x3c 36082: 3d ad ldd r19, Y+61 ; 0x3d 36084: 4e ad ldd r20, Y+62 ; 0x3e 36086: 5f ad ldd r21, Y+63 ; 0x3f 36088: 2e 97 sbiw r28, 0x0e ; 14 3608a: 23 2b or r18, r19 3608c: 24 2b or r18, r20 3608e: 25 2b or r18, r21 36090: 09 f0 breq .+2 ; 0x36094 36092: b9 c5 rjmp .+2930 ; 0x36c06 36094: 8e e6 ldi r24, 0x6E ; 110 36096: 82 9d mul r24, r2 36098: 80 01 movw r16, r0 3609a: 83 9d mul r24, r3 3609c: 10 0d add r17, r0 3609e: 11 24 eor r1, r1 360a0: 0d 58 subi r16, 0x8D ; 141 360a2: 18 4f sbci r17, 0xF8 ; 248 360a4: f8 01 movw r30, r16 360a6: 84 81 ldd r24, Z+4 ; 0x04 360a8: 95 81 ldd r25, Z+5 ; 0x05 360aa: a6 81 ldd r26, Z+6 ; 0x06 360ac: b7 81 ldd r27, Z+7 ; 0x07 360ae: 89 2b or r24, r25 360b0: 8a 2b or r24, r26 360b2: 8b 2b or r24, r27 360b4: 09 f0 breq .+2 ; 0x360b8 360b6: a7 c5 rjmp .+2894 ; 0x36c06 360b8: 80 85 ldd r24, Z+8 ; 0x08 360ba: 91 85 ldd r25, Z+9 ; 0x09 360bc: a2 85 ldd r26, Z+10 ; 0x0a 360be: b3 85 ldd r27, Z+11 ; 0x0b 360c0: 89 2b or r24, r25 360c2: 8a 2b or r24, r26 360c4: 8b 2b or r24, r27 360c6: 09 f0 breq .+2 ; 0x360ca 360c8: 9e c5 rjmp .+2876 ; 0x36c06 { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 360ca: 20 91 a3 06 lds r18, 0x06A3 ; 0x8006a3 360ce: 30 91 a4 06 lds r19, 0x06A4 ; 0x8006a4 360d2: 40 91 a5 06 lds r20, 0x06A5 ; 0x8006a5 360d6: 50 91 a6 06 lds r21, 0x06A6 ; 0x8006a6 360da: 69 a5 ldd r22, Y+41 ; 0x29 360dc: 7a a5 ldd r23, Y+42 ; 0x2a 360de: 8b a5 ldd r24, Y+43 ; 0x2b 360e0: 9c a5 ldd r25, Y+44 ; 0x2c 360e2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 360e6: 0f 94 15 df call 0x3be2a ; 0x3be2a 360ea: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 360ee: 2b 01 movw r4, r22 360f0: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 360f2: f8 01 movw r30, r16 360f4: e4 5b subi r30, 0xB4 ; 180 360f6: ff 4f sbci r31, 0xFF ; 255 360f8: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 360fa: 6a 96 adiw r28, 0x1a ; 26 360fc: 1c ae std Y+60, r1 ; 0x3c 360fe: 1d ae std Y+61, r1 ; 0x3d 36100: 1e ae std Y+62, r1 ; 0x3e 36102: 1f ae std Y+63, r1 ; 0x3f 36104: 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; 36106: 8e e6 ldi r24, 0x6E ; 110 36108: 82 9d mul r24, r2 3610a: 80 01 movw r16, r0 3610c: 83 9d mul r24, r3 3610e: 10 0d add r17, r0 36110: 11 24 eor r1, r1 36112: 0d 58 subi r16, 0x8D ; 141 36114: 18 4f sbci r17, 0xF8 ; 248 36116: f8 01 movw r30, r16 36118: ee 5b subi r30, 0xBE ; 190 3611a: ff 4f sbci r31, 0xFF ; 255 3611c: 40 82 st Z, r4 3611e: 51 82 std Z+1, r5 ; 0x01 36120: 62 82 std Z+2, r6 ; 0x02 36122: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 36124: c3 01 movw r24, r6 36126: b2 01 movw r22, r4 36128: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 3612c: 6b 01 movw r12, r22 3612e: 7c 01 movw r14, r24 36130: 29 a5 ldd r18, Y+41 ; 0x29 36132: 3a a5 ldd r19, Y+42 ; 0x2a 36134: 4b a5 ldd r20, Y+43 ; 0x2b 36136: 5c a5 ldd r21, Y+44 ; 0x2c 36138: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 3613c: e2 96 adiw r28, 0x32 ; 50 3613e: 6c af std Y+60, r22 ; 0x3c 36140: 7d af std Y+61, r23 ; 0x3d 36142: 8e af std Y+62, r24 ; 0x3e 36144: 9f af std Y+63, r25 ; 0x3f 36146: e2 97 sbiw r28, 0x32 ; 50 36148: f8 01 movw r30, r16 3614a: 61 ab std Z+49, r22 ; 0x31 3614c: 72 ab std Z+50, r23 ; 0x32 3614e: 83 ab std Z+51, r24 ; 0x33 36150: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 36152: 2d eb ldi r18, 0xBD ; 189 36154: 37 e3 ldi r19, 0x37 ; 55 36156: 46 e0 ldi r20, 0x06 ; 6 36158: 51 e4 ldi r21, 0x41 ; 65 3615a: c7 01 movw r24, r14 3615c: b6 01 movw r22, r12 3615e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36162: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 36166: d8 01 movw r26, r16 36168: 54 96 adiw r26, 0x14 ; 20 3616a: 6d 93 st X+, r22 3616c: 7d 93 st X+, r23 3616e: 8d 93 st X+, r24 36170: 9c 93 st X, r25 36172: 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; 36174: 91 96 adiw r26, 0x21 ; 33 36176: bc 91 ld r27, X 36178: 27 96 adiw r28, 0x07 ; 7 3617a: bf af std Y+63, r27 ; 0x3f 3617c: 27 97 sbiw r28, 0x07 ; 7 3617e: f8 01 movw r30, r16 36180: f2 a1 ldd r31, Z+34 ; 0x22 36182: 2b 96 adiw r28, 0x0b ; 11 36184: ff af std Y+63, r31 ; 0x3f 36186: 2b 97 sbiw r28, 0x0b ; 11 36188: d8 01 movw r26, r16 3618a: 93 96 adiw r26, 0x23 ; 35 3618c: bc 91 ld r27, X 3618e: 2f 96 adiw r28, 0x0f ; 15 36190: bf af std Y+63, r27 ; 0x3f 36192: 2f 97 sbiw r28, 0x0f ; 15 36194: f8 01 movw r30, r16 36196: f4 a1 ldd r31, Z+36 ; 0x24 36198: 63 96 adiw r28, 0x13 ; 19 3619a: ff af std Y+63, r31 ; 0x3f 3619c: 63 97 sbiw r28, 0x13 ; 19 3619e: 23 eb ldi r18, 0xB3 ; 179 361a0: 36 e0 ldi r19, 0x06 ; 6 361a2: ee 96 adiw r28, 0x3e ; 62 361a4: 3f af std Y+63, r19 ; 0x3f 361a6: 2e af std Y+62, r18 ; 0x3e 361a8: ee 97 sbiw r28, 0x3e ; 62 361aa: a0 96 adiw r28, 0x20 ; 32 361ac: 4e ac ldd r4, Y+62 ; 0x3e 361ae: 5f ac ldd r5, Y+63 ; 0x3f 361b0: a0 97 sbiw r28, 0x20 ; 32 361b2: 30 e1 ldi r19, 0x10 ; 16 361b4: 43 0e add r4, r19 361b6: 51 1c adc r5, r1 361b8: 03 eb ldi r16, 0xB3 ; 179 361ba: 16 e0 ldi r17, 0x06 ; 6 361bc: a0 96 adiw r28, 0x20 ; 32 361be: 6e ac ldd r6, Y+62 ; 0x3e 361c0: 7f ac ldd r7, Y+63 ; 0x3f 361c2: a0 97 sbiw r28, 0x20 ; 32 361c4: 27 96 adiw r28, 0x07 ; 7 361c6: 4f ad ldd r20, Y+63 ; 0x3f 361c8: 27 97 sbiw r28, 0x07 ; 7 361ca: 49 a7 std Y+41, r20 ; 0x29 361cc: 2b 96 adiw r28, 0x0b ; 11 361ce: 5f ad ldd r21, Y+63 ; 0x3f 361d0: 2b 97 sbiw r28, 0x0b ; 11 361d2: 5d a7 std Y+45, r21 ; 0x2d 361d4: b9 ab std Y+49, r27 ; 0x31 361d6: f9 af std Y+57, r31 ; 0x39 bool limited = false; 361d8: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 361da: d3 01 movw r26, r6 361dc: 8d 90 ld r8, X+ 361de: 9d 90 ld r9, X+ 361e0: ad 90 ld r10, X+ 361e2: bd 90 ld r11, X+ 361e4: 3d 01 movw r6, r26 361e6: e8 94 clt 361e8: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 361ea: f8 01 movw r30, r16 361ec: c1 90 ld r12, Z+ 361ee: d1 90 ld r13, Z+ 361f0: e1 90 ld r14, Z+ 361f2: f1 90 ld r15, Z+ 361f4: 8f 01 movw r16, r30 361f6: a5 01 movw r20, r10 361f8: 94 01 movw r18, r8 361fa: c7 01 movw r24, r14 361fc: b6 01 movw r22, r12 361fe: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36202: 87 ff sbrs r24, 7 36204: 3a c0 rjmp .+116 ; 0x3627a // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 36206: fd a9 ldd r31, Y+53 ; 0x35 36208: ff 23 and r31, r31 3620a: 09 f4 brne .+2 ; 0x3620e 3620c: 7e c6 rjmp .+3324 ; 0x36f0a // 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; 3620e: 29 a5 ldd r18, Y+41 ; 0x29 36210: 3d a5 ldd r19, Y+45 ; 0x2d 36212: 49 a9 ldd r20, Y+49 ; 0x31 36214: 59 ad ldd r21, Y+57 ; 0x39 36216: c5 01 movw r24, r10 36218: b4 01 movw r22, r8 3621a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3621e: 4b 01 movw r8, r22 36220: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 36222: a7 01 movw r20, r14 36224: 96 01 movw r18, r12 36226: 27 96 adiw r28, 0x07 ; 7 36228: 6f ad ldd r22, Y+63 ; 0x3f 3622a: 27 97 sbiw r28, 0x07 ; 7 3622c: 2b 96 adiw r28, 0x0b ; 11 3622e: 7f ad ldd r23, Y+63 ; 0x3f 36230: 2b 97 sbiw r28, 0x0b ; 11 36232: 2f 96 adiw r28, 0x0f ; 15 36234: 8f ad ldd r24, Y+63 ; 0x3f 36236: 2f 97 sbiw r28, 0x0f ; 15 36238: 63 96 adiw r28, 0x13 ; 19 3623a: 9f ad ldd r25, Y+63 ; 0x3f 3623c: 63 97 sbiw r28, 0x13 ; 19 3623e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36242: 6b 01 movw r12, r22 36244: 7c 01 movw r14, r24 if (jerk > mjerk) { 36246: ac 01 movw r20, r24 36248: 9b 01 movw r18, r22 3624a: c5 01 movw r24, r10 3624c: b4 01 movw r22, r8 3624e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36252: 18 16 cp r1, r24 36254: 94 f4 brge .+36 ; 0x3627a safe_speed *= mjerk / jerk; 36256: a5 01 movw r20, r10 36258: 94 01 movw r18, r8 3625a: c7 01 movw r24, r14 3625c: b6 01 movw r22, r12 3625e: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 36262: 9b 01 movw r18, r22 36264: ac 01 movw r20, r24 36266: 69 a5 ldd r22, Y+41 ; 0x29 36268: 7d a5 ldd r23, Y+45 ; 0x2d 3626a: 89 a9 ldd r24, Y+49 ; 0x31 3626c: 99 ad ldd r25, Y+57 ; 0x39 3626e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36272: 69 a7 std Y+41, r22 ; 0x29 36274: 7d a7 std Y+45, r23 ; 0x2d 36276: 89 ab std Y+49, r24 ; 0x31 36278: 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) { 3627a: 46 14 cp r4, r6 3627c: 57 04 cpc r5, r7 3627e: 09 f0 breq .+2 ; 0x36282 36280: ac cf rjmp .-168 ; 0x361da } } } // Reset the block flag. block->flag = 0; 36282: 8e e6 ldi r24, 0x6E ; 110 36284: 82 9d mul r24, r2 36286: f0 01 movw r30, r0 36288: 83 9d mul r24, r3 3628a: f0 0d add r31, r0 3628c: 11 24 eor r1, r1 3628e: ed 58 subi r30, 0x8D ; 141 36290: f8 4f sbci r31, 0xF8 ; 248 36292: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 36294: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.503> 36298: 88 23 and r24, r24 3629a: 21 f0 breq .+8 ; 0x362a4 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 3629c: 80 e1 ldi r24, 0x10 ; 16 3629e: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 362a0: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.503> 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) { 362a4: 3d ad ldd r19, Y+61 ; 0x3d 362a6: 32 30 cpi r19, 0x02 ; 2 362a8: 08 f4 brcc .+2 ; 0x362ac 362aa: 8f c6 rjmp .+3358 ; 0x36fca 362ac: 40 91 b9 04 lds r20, 0x04B9 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.504> 362b0: 6b 96 adiw r28, 0x1b ; 27 362b2: 4f af std Y+63, r20 ; 0x3f 362b4: 6b 97 sbiw r28, 0x1b ; 27 362b6: 50 91 ba 04 lds r21, 0x04BA ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.504+0x1> 362ba: 6d 96 adiw r28, 0x1d ; 29 362bc: 5f af std Y+63, r21 ; 0x3f 362be: 6d 97 sbiw r28, 0x1d ; 29 362c0: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.504+0x2> 362c4: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.504+0x3> 362c8: 27 e1 ldi r18, 0x17 ; 23 362ca: 37 eb ldi r19, 0xB7 ; 183 362cc: 41 ed ldi r20, 0xD1 ; 209 362ce: 58 e3 ldi r21, 0x38 ; 56 362d0: 6b 96 adiw r28, 0x1b ; 27 362d2: 6f ad ldd r22, Y+63 ; 0x3f 362d4: 6b 97 sbiw r28, 0x1b ; 27 362d6: 6d 96 adiw r28, 0x1d ; 29 362d8: 7f ad ldd r23, Y+63 ; 0x3f 362da: 6d 97 sbiw r28, 0x1d ; 29 362dc: c8 01 movw r24, r16 362de: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 362e2: 18 16 cp r1, r24 362e4: 0c f0 brlt .+2 ; 0x362e8 362e6: 71 c6 rjmp .+3298 ; 0x36fca // 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); 362e8: 6b 96 adiw r28, 0x1b ; 27 362ea: 2f ad ldd r18, Y+63 ; 0x3f 362ec: 6b 97 sbiw r28, 0x1b ; 27 362ee: 6d 96 adiw r28, 0x1d ; 29 362f0: 3f ad ldd r19, Y+63 ; 0x3f 362f2: 6d 97 sbiw r28, 0x1d ; 29 362f4: a8 01 movw r20, r16 362f6: 27 96 adiw r28, 0x07 ; 7 362f8: 6f ad ldd r22, Y+63 ; 0x3f 362fa: 27 97 sbiw r28, 0x07 ; 7 362fc: 2b 96 adiw r28, 0x0b ; 11 362fe: 7f ad ldd r23, Y+63 ; 0x3f 36300: 2b 97 sbiw r28, 0x0b ; 11 36302: 2f 96 adiw r28, 0x0f ; 15 36304: 8f ad ldd r24, Y+63 ; 0x3f 36306: 2f 97 sbiw r28, 0x0f ; 15 36308: 63 96 adiw r28, 0x13 ; 19 3630a: 9f ad ldd r25, Y+63 ; 0x3f 3630c: 63 97 sbiw r28, 0x13 ; 19 3630e: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36312: 87 ff sbrs r24, 7 36314: 01 c6 rjmp .+3074 ; 0x36f18 36316: 6b 96 adiw r28, 0x1b ; 27 36318: 2f ad ldd r18, Y+63 ; 0x3f 3631a: 6b 97 sbiw r28, 0x1b ; 27 3631c: 6d 96 adiw r28, 0x1d ; 29 3631e: 3f ad ldd r19, Y+63 ; 0x3f 36320: 6d 97 sbiw r28, 0x1d ; 29 36322: a8 01 movw r20, r16 36324: 27 96 adiw r28, 0x07 ; 7 36326: 6f ad ldd r22, Y+63 ; 0x3f 36328: 27 97 sbiw r28, 0x07 ; 7 3632a: 2b 96 adiw r28, 0x0b ; 11 3632c: 7f ad ldd r23, Y+63 ; 0x3f 3632e: 2b 97 sbiw r28, 0x0b ; 11 36330: 2f 96 adiw r28, 0x0f ; 15 36332: 8f ad ldd r24, Y+63 ; 0x3f 36334: 2f 97 sbiw r28, 0x0f ; 15 36336: 63 96 adiw r28, 0x13 ; 19 36338: 9f ad ldd r25, Y+63 ; 0x3f 3633a: 63 97 sbiw r28, 0x13 ; 19 3633c: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 36340: ec 96 adiw r28, 0x3c ; 60 36342: 6c af std Y+60, r22 ; 0x3c 36344: 7d af std Y+61, r23 ; 0x3d 36346: 8e af std Y+62, r24 ; 0x3e 36348: 9f af std Y+63, r25 ; 0x3f 3634a: 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; 3634c: 27 96 adiw r28, 0x07 ; 7 3634e: 8f ad ldd r24, Y+63 ; 0x3f 36350: 27 97 sbiw r28, 0x07 ; 7 36352: 8d af std Y+61, r24 ; 0x3d 36354: 2b 96 adiw r28, 0x0b ; 11 36356: 9f ad ldd r25, Y+63 ; 0x3f 36358: 2b 97 sbiw r28, 0x0b ; 11 3635a: 9d ab std Y+53, r25 ; 0x35 3635c: 2f 96 adiw r28, 0x0f ; 15 3635e: af ad ldd r26, Y+63 ; 0x3f 36360: 2f 97 sbiw r28, 0x0f ; 15 36362: ae af std Y+62, r26 ; 0x3e 36364: 63 96 adiw r28, 0x13 ; 19 36366: bf ad ldd r27, Y+63 ; 0x3f 36368: 63 97 sbiw r28, 0x13 ; 19 3636a: 23 96 adiw r28, 0x03 ; 3 3636c: bf af std Y+63, r27 ; 0x3f 3636e: 23 97 sbiw r28, 0x03 ; 3 36370: 2d eb ldi r18, 0xBD ; 189 36372: 34 e0 ldi r19, 0x04 ; 4 36374: e8 96 adiw r28, 0x38 ; 56 36376: 3f af std Y+63, r19 ; 0x3f 36378: 2e af std Y+62, r18 ; 0x3e 3637a: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 3637c: 41 2c mov r4, r1 3637e: 51 2c mov r5, r1 36380: 30 e8 ldi r19, 0x80 ; 128 36382: 63 2e mov r6, r19 36384: 3f e3 ldi r19, 0x3F ; 63 36386: 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]; 36388: e8 96 adiw r28, 0x38 ; 56 3638a: ae ad ldd r26, Y+62 ; 0x3e 3638c: bf ad ldd r27, Y+63 ; 0x3f 3638e: e8 97 sbiw r28, 0x38 ; 56 36390: 8d 90 ld r8, X+ 36392: 9d 90 ld r9, X+ 36394: ad 90 ld r10, X+ 36396: bd 90 ld r11, X+ 36398: e8 96 adiw r28, 0x38 ; 56 3639a: bf af std Y+63, r27 ; 0x3f 3639c: ae af std Y+62, r26 ; 0x3e 3639e: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 363a0: a0 96 adiw r28, 0x20 ; 32 363a2: ee ad ldd r30, Y+62 ; 0x3e 363a4: ff ad ldd r31, Y+63 ; 0x3f 363a6: a0 97 sbiw r28, 0x20 ; 32 363a8: c1 90 ld r12, Z+ 363aa: d1 90 ld r13, Z+ 363ac: e1 90 ld r14, Z+ 363ae: f1 90 ld r15, Z+ 363b0: a0 96 adiw r28, 0x20 ; 32 363b2: ff af std Y+63, r31 ; 0x3f 363b4: ee af std Y+62, r30 ; 0x3e 363b6: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 363b8: 6b 96 adiw r28, 0x1b ; 27 363ba: 2f ad ldd r18, Y+63 ; 0x3f 363bc: 6b 97 sbiw r28, 0x1b ; 27 363be: 6d 96 adiw r28, 0x1d ; 29 363c0: 3f ad ldd r19, Y+63 ; 0x3f 363c2: 6d 97 sbiw r28, 0x1d ; 29 363c4: a8 01 movw r20, r16 363c6: 27 96 adiw r28, 0x07 ; 7 363c8: 6f ad ldd r22, Y+63 ; 0x3f 363ca: 27 97 sbiw r28, 0x07 ; 7 363cc: 2b 96 adiw r28, 0x0b ; 11 363ce: 7f ad ldd r23, Y+63 ; 0x3f 363d0: 2b 97 sbiw r28, 0x0b ; 11 363d2: 2f 96 adiw r28, 0x0f ; 15 363d4: 8f ad ldd r24, Y+63 ; 0x3f 363d6: 2f 97 sbiw r28, 0x0f ; 15 363d8: 63 96 adiw r28, 0x13 ; 19 363da: 9f ad ldd r25, Y+63 ; 0x3f 363dc: 63 97 sbiw r28, 0x13 ; 19 363de: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 363e2: 87 ff sbrs r24, 7 363e4: 0c c0 rjmp .+24 ; 0x363fe v_exit *= smaller_speed_factor; 363e6: ec 96 adiw r28, 0x3c ; 60 363e8: 2c ad ldd r18, Y+60 ; 0x3c 363ea: 3d ad ldd r19, Y+61 ; 0x3d 363ec: 4e ad ldd r20, Y+62 ; 0x3e 363ee: 5f ad ldd r21, Y+63 ; 0x3f 363f0: ec 97 sbiw r28, 0x3c ; 60 363f2: c5 01 movw r24, r10 363f4: b4 01 movw r22, r8 363f6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 363fa: 4b 01 movw r8, r22 363fc: 5c 01 movw r10, r24 if (limited) { 363fe: a2 96 adiw r28, 0x22 ; 34 36400: ff ad ldd r31, Y+63 ; 0x3f 36402: a2 97 sbiw r28, 0x22 ; 34 36404: ff 23 and r31, r31 36406: 81 f0 breq .+32 ; 0x36428 v_exit *= v_factor; 36408: a3 01 movw r20, r6 3640a: 92 01 movw r18, r4 3640c: c5 01 movw r24, r10 3640e: b4 01 movw r22, r8 36410: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36414: 4b 01 movw r8, r22 36416: 5c 01 movw r10, r24 v_entry *= v_factor; 36418: a3 01 movw r20, r6 3641a: 92 01 movw r18, r4 3641c: c7 01 movw r24, r14 3641e: b6 01 movw r22, r12 36420: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36424: 6b 01 movw r12, r22 36426: 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) ? 36428: a7 01 movw r20, r14 3642a: 96 01 movw r18, r12 3642c: c5 01 movw r24, r10 3642e: b4 01 movw r22, r8 36430: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 36434: 20 e0 ldi r18, 0x00 ; 0 36436: 30 e0 ldi r19, 0x00 ; 0 36438: 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) ? 3643a: 18 16 cp r1, r24 3643c: 0c f0 brlt .+2 ; 0x36440 3643e: a3 c5 rjmp .+2886 ; 0x36f86 ((v_entry > 0.f || v_exit < 0.f) ? 36440: c7 01 movw r24, r14 36442: b6 01 movw r22, r12 36444: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36448: 18 16 cp r1, r24 3644a: 4c f0 brlt .+18 ; 0x3645e 3644c: 20 e0 ldi r18, 0x00 ; 0 3644e: 30 e0 ldi r19, 0x00 ; 0 36450: a9 01 movw r20, r18 36452: c5 01 movw r24, r10 36454: b4 01 movw r22, r8 36456: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 3645a: 87 ff sbrs r24, 7 3645c: 85 c5 rjmp .+2826 ; 0x36f68 3645e: a7 01 movw r20, r14 36460: 96 01 movw r18, r12 36462: c5 01 movw r24, r10 36464: 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) ? 36466: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 3646a: 6b 01 movw r12, r22 3646c: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 3646e: ee 96 adiw r28, 0x3e ; 62 36470: ae ad ldd r26, Y+62 ; 0x3e 36472: bf ad ldd r27, Y+63 ; 0x3f 36474: ee 97 sbiw r28, 0x3e ; 62 36476: 8d 90 ld r8, X+ 36478: 9d 90 ld r9, X+ 3647a: ad 90 ld r10, X+ 3647c: bd 90 ld r11, X+ 3647e: ee 96 adiw r28, 0x3e ; 62 36480: bf af std Y+63, r27 ; 0x3f 36482: ae af std Y+62, r26 ; 0x3e 36484: ee 97 sbiw r28, 0x3e ; 62 36486: a5 01 movw r20, r10 36488: 94 01 movw r18, r8 3648a: c7 01 movw r24, r14 3648c: b6 01 movw r22, r12 3648e: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36492: 18 16 cp r1, r24 36494: 94 f4 brge .+36 ; 0x364ba v_factor *= cs.max_jerk[axis] / jerk; 36496: a7 01 movw r20, r14 36498: 96 01 movw r18, r12 3649a: c5 01 movw r24, r10 3649c: b4 01 movw r22, r8 3649e: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 364a2: 9b 01 movw r18, r22 364a4: ac 01 movw r20, r24 364a6: c3 01 movw r24, r6 364a8: b2 01 movw r22, r4 364aa: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 364ae: 2b 01 movw r4, r22 364b0: 3c 01 movw r6, r24 limited = true; 364b2: b1 e0 ldi r27, 0x01 ; 1 364b4: a2 96 adiw r28, 0x22 ; 34 364b6: bf af std Y+63, r27 ; 0x3f 364b8: 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) { 364ba: ed ec ldi r30, 0xCD ; 205 364bc: f4 e0 ldi r31, 0x04 ; 4 364be: e8 96 adiw r28, 0x38 ; 56 364c0: 2e ad ldd r18, Y+62 ; 0x3e 364c2: 3f ad ldd r19, Y+63 ; 0x3f 364c4: e8 97 sbiw r28, 0x38 ; 56 364c6: e2 17 cp r30, r18 364c8: f3 07 cpc r31, r19 364ca: 09 f0 breq .+2 ; 0x364ce 364cc: 5d cf rjmp .-326 ; 0x36388 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 364ce: a2 96 adiw r28, 0x22 ; 34 364d0: 3f ad ldd r19, Y+63 ; 0x3f 364d2: a2 97 sbiw r28, 0x22 ; 34 364d4: 33 23 and r19, r19 364d6: 81 f0 breq .+32 ; 0x364f8 vmax_junction *= v_factor; 364d8: a3 01 movw r20, r6 364da: 92 01 movw r18, r4 364dc: 6d ad ldd r22, Y+61 ; 0x3d 364de: 7d a9 ldd r23, Y+53 ; 0x35 364e0: 8e ad ldd r24, Y+62 ; 0x3e 364e2: 23 96 adiw r28, 0x03 ; 3 364e4: 9f ad ldd r25, Y+63 ; 0x3f 364e6: 23 97 sbiw r28, 0x03 ; 3 364e8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 364ec: 6d af std Y+61, r22 ; 0x3d 364ee: 7d ab std Y+53, r23 ; 0x35 364f0: 8e af std Y+62, r24 ; 0x3e 364f2: 23 96 adiw r28, 0x03 ; 3 364f4: 9f af std Y+63, r25 ; 0x3f 364f6: 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; 364f8: 24 ea ldi r18, 0xA4 ; 164 364fa: 30 e7 ldi r19, 0x70 ; 112 364fc: 4d e7 ldi r20, 0x7D ; 125 364fe: 5f e3 ldi r21, 0x3F ; 63 36500: 6d ad ldd r22, Y+61 ; 0x3d 36502: 7d a9 ldd r23, Y+53 ; 0x35 36504: 8e ad ldd r24, Y+62 ; 0x3e 36506: 23 96 adiw r28, 0x03 ; 3 36508: 9f ad ldd r25, Y+63 ; 0x3f 3650a: 23 97 sbiw r28, 0x03 ; 3 3650c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36510: 6b 01 movw r12, r22 36512: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 36514: ac 01 movw r20, r24 36516: 9b 01 movw r18, r22 36518: 60 91 e9 17 lds r22, 0x17E9 ; 0x8017e9 3651c: 70 91 ea 17 lds r23, 0x17EA ; 0x8017ea 36520: 80 91 eb 17 lds r24, 0x17EB ; 0x8017eb 36524: 90 91 ec 17 lds r25, 0x17EC ; 0x8017ec 36528: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 3652c: 18 16 cp r1, r24 3652e: fc f4 brge .+62 ; 0x3656e 36530: 29 a5 ldd r18, Y+41 ; 0x29 36532: 3d a5 ldd r19, Y+45 ; 0x2d 36534: 49 a9 ldd r20, Y+49 ; 0x31 36536: 59 ad ldd r21, Y+57 ; 0x39 36538: c7 01 movw r24, r14 3653a: b6 01 movw r22, r12 3653c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36540: 87 ff sbrs r24, 7 36542: 15 c0 rjmp .+42 ; 0x3656e // 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; 36544: 8e e6 ldi r24, 0x6E ; 110 36546: 82 9d mul r24, r2 36548: f0 01 movw r30, r0 3654a: 83 9d mul r24, r3 3654c: f0 0d add r31, r0 3654e: 11 24 eor r1, r1 36550: ed 58 subi r30, 0x8D ; 141 36552: f8 4f sbci r31, 0xF8 ; 248 36554: 85 a9 ldd r24, Z+53 ; 0x35 36556: 84 60 ori r24, 0x04 ; 4 36558: 85 ab std Z+53, r24 ; 0x35 3655a: 49 a5 ldd r20, Y+41 ; 0x29 3655c: 4d af std Y+61, r20 ; 0x3d 3655e: 5d a5 ldd r21, Y+45 ; 0x2d 36560: 5d ab std Y+53, r21 ; 0x35 36562: 89 a9 ldd r24, Y+49 ; 0x31 36564: 8e af std Y+62, r24 ; 0x3e 36566: 99 ad ldd r25, Y+57 ; 0x39 36568: 23 96 adiw r28, 0x03 ; 3 3656a: 9f af std Y+63, r25 ; 0x3f 3656c: 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; 3656e: 8e e6 ldi r24, 0x6E ; 110 36570: 82 9d mul r24, r2 36572: 80 01 movw r16, r0 36574: 83 9d mul r24, r3 36576: 10 0d add r17, r0 36578: 11 24 eor r1, r1 3657a: 0d 58 subi r16, 0x8D ; 141 3657c: 18 4f sbci r17, 0xF8 ; 248 3657e: 8d ad ldd r24, Y+61 ; 0x3d 36580: 9d a9 ldd r25, Y+53 ; 0x35 36582: ae ad ldd r26, Y+62 ; 0x3e 36584: 23 96 adiw r28, 0x03 ; 3 36586: bf ad ldd r27, Y+63 ; 0x3f 36588: 23 97 sbiw r28, 0x03 ; 3 3658a: f8 01 movw r30, r16 3658c: 81 a7 std Z+41, r24 ; 0x29 3658e: 92 a7 std Z+42, r25 ; 0x2a 36590: a3 a7 std Z+43, r26 ; 0x2b 36592: 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); 36594: 29 a5 ldd r18, Y+41 ; 0x29 36596: 3d a5 ldd r19, Y+45 ; 0x2d 36598: 49 a9 ldd r20, Y+49 ; 0x31 3659a: 59 ad ldd r21, Y+57 ; 0x39 3659c: 69 a5 ldd r22, Y+41 ; 0x29 3659e: 7d a5 ldd r23, Y+45 ; 0x2d 365a0: 89 a9 ldd r24, Y+49 ; 0x31 365a2: 99 ad ldd r25, Y+57 ; 0x39 365a4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 365a8: 6b 01 movw r12, r22 365aa: 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); 365ac: e2 96 adiw r28, 0x32 ; 50 365ae: 6c ad ldd r22, Y+60 ; 0x3c 365b0: 7d ad ldd r23, Y+61 ; 0x3d 365b2: 8e ad ldd r24, Y+62 ; 0x3e 365b4: 9f ad ldd r25, Y+63 ; 0x3f 365b6: e2 97 sbiw r28, 0x32 ; 50 365b8: 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); 365ba: 9b 01 movw r18, r22 365bc: ac 01 movw r20, r24 365be: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 365c2: d8 01 movw r26, r16 365c4: 9d 96 adiw r26, 0x2d ; 45 365c6: 2d 91 ld r18, X+ 365c8: 3d 91 ld r19, X+ 365ca: 4d 91 ld r20, X+ 365cc: 5c 91 ld r21, X 365ce: d0 97 sbiw r26, 0x30 ; 48 365d0: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 365d4: 9b 01 movw r18, r22 365d6: ac 01 movw r20, r24 365d8: c7 01 movw r24, r14 365da: b6 01 movw r22, r12 365dc: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 365e0: 0f 94 05 e2 call 0x3c40a ; 0x3c40a 365e4: d6 2e mov r13, r22 365e6: e7 2e mov r14, r23 365e8: 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); 365ea: 2d ad ldd r18, Y+61 ; 0x3d 365ec: 3d a9 ldd r19, Y+53 ; 0x35 365ee: 4e ad ldd r20, Y+62 ; 0x3e 365f0: 23 96 adiw r28, 0x03 ; 3 365f2: 5f ad ldd r21, Y+63 ; 0x3f 365f4: 23 97 sbiw r28, 0x03 ; 3 365f6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 365fa: 18 16 cp r1, r24 365fc: 34 f0 brlt .+12 ; 0x3660a 365fe: dd ae std Y+61, r13 ; 0x3d 36600: ed aa std Y+53, r14 ; 0x35 36602: 0e af std Y+62, r16 ; 0x3e 36604: 23 96 adiw r28, 0x03 ; 3 36606: 1f af std Y+63, r17 ; 0x3f 36608: 23 97 sbiw r28, 0x03 ; 3 3660a: 8e e6 ldi r24, 0x6E ; 110 3660c: 82 9d mul r24, r2 3660e: f0 01 movw r30, r0 36610: 83 9d mul r24, r3 36612: f0 0d add r31, r0 36614: 11 24 eor r1, r1 36616: ed 58 subi r30, 0x8D ; 141 36618: f8 4f sbci r31, 0xF8 ; 248 3661a: 8d ad ldd r24, Y+61 ; 0x3d 3661c: 9d a9 ldd r25, Y+53 ; 0x35 3661e: ae ad ldd r26, Y+62 ; 0x3e 36620: 23 96 adiw r28, 0x03 ; 3 36622: bf ad ldd r27, Y+63 ; 0x3f 36624: 23 97 sbiw r28, 0x03 ; 3 36626: 85 a3 std Z+37, r24 ; 0x25 36628: 96 a3 std Z+38, r25 ; 0x26 3662a: a7 a3 std Z+39, r26 ; 0x27 3662c: 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; 3662e: f5 a8 ldd r15, Z+53 ; 0x35 36630: 2d 2d mov r18, r13 36632: 3e 2d mov r19, r14 36634: a8 01 movw r20, r16 36636: 27 96 adiw r28, 0x07 ; 7 36638: 6f ad ldd r22, Y+63 ; 0x3f 3663a: 27 97 sbiw r28, 0x07 ; 7 3663c: 2b 96 adiw r28, 0x0b ; 11 3663e: 7f ad ldd r23, Y+63 ; 0x3f 36640: 2b 97 sbiw r28, 0x0b ; 11 36642: 2f 96 adiw r28, 0x0f ; 15 36644: 8f ad ldd r24, Y+63 ; 0x3f 36646: 2f 97 sbiw r28, 0x0f ; 15 36648: 63 96 adiw r28, 0x13 ; 19 3664a: 9f ad ldd r25, Y+63 ; 0x3f 3664c: 63 97 sbiw r28, 0x13 ; 19 3664e: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36652: 18 16 cp r1, r24 36654: 0c f4 brge .+2 ; 0x36658 36656: cf c4 rjmp .+2462 ; 0x36ff6 36658: 83 e0 ldi r24, 0x03 ; 3 3665a: 9e e6 ldi r25, 0x6E ; 110 3665c: 92 9d mul r25, r2 3665e: 80 01 movw r16, r0 36660: 93 9d mul r25, r3 36662: 10 0d add r17, r0 36664: 11 24 eor r1, r1 36666: 0d 58 subi r16, 0x8D ; 141 36668: 18 4f sbci r17, 0xF8 ; 248 3666a: f8 2a or r15, r24 3666c: f8 01 movw r30, r16 3666e: 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[] 36670: 80 e1 ldi r24, 0x10 ; 16 36672: fe 01 movw r30, r28 36674: 71 96 adiw r30, 0x11 ; 17 36676: ad eb ldi r26, 0xBD ; 189 36678: b4 e0 ldi r27, 0x04 ; 4 3667a: 01 90 ld r0, Z+ 3667c: 0d 92 st X+, r0 3667e: 8a 95 dec r24 36680: e1 f7 brne .-8 ; 0x3667a previous_nominal_speed = block->nominal_speed; 36682: 27 96 adiw r28, 0x07 ; 7 36684: 8f ad ldd r24, Y+63 ; 0x3f 36686: 27 97 sbiw r28, 0x07 ; 7 36688: 2b 96 adiw r28, 0x0b ; 11 3668a: 9f ad ldd r25, Y+63 ; 0x3f 3668c: 2b 97 sbiw r28, 0x0b ; 11 3668e: 2f 96 adiw r28, 0x0f ; 15 36690: af ad ldd r26, Y+63 ; 0x3f 36692: 2f 97 sbiw r28, 0x0f ; 15 36694: 63 96 adiw r28, 0x13 ; 19 36696: bf ad ldd r27, Y+63 ; 0x3f 36698: 63 97 sbiw r28, 0x13 ; 19 3669a: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.504> 3669e: 90 93 ba 04 sts 0x04BA, r25 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.504+0x1> 366a2: a0 93 bb 04 sts 0x04BB, r26 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.504+0x2> 366a6: b0 93 bc 04 sts 0x04BC, r27 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.504+0x3> previous_safe_speed = safe_speed; 366aa: 89 a5 ldd r24, Y+41 ; 0x29 366ac: 9d a5 ldd r25, Y+45 ; 0x2d 366ae: a9 a9 ldd r26, Y+49 ; 0x31 366b0: b9 ad ldd r27, Y+57 ; 0x39 366b2: 80 93 e9 17 sts 0x17E9, r24 ; 0x8017e9 366b6: 90 93 ea 17 sts 0x17EA, r25 ; 0x8017ea 366ba: a0 93 eb 17 sts 0x17EB, r26 ; 0x8017eb 366be: b0 93 ec 17 sts 0x17EC, r27 ; 0x8017ec // 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; 366c2: d8 01 movw r26, r16 366c4: d6 96 adiw r26, 0x36 ; 54 366c6: 6d 91 ld r22, X+ 366c8: 7d 91 ld r23, X+ 366ca: 8d 91 ld r24, X+ 366cc: 9c 91 ld r25, X 366ce: d9 97 sbiw r26, 0x39 ; 57 366d0: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 366d4: 27 96 adiw r28, 0x07 ; 7 366d6: 2f ad ldd r18, Y+63 ; 0x3f 366d8: 27 97 sbiw r28, 0x07 ; 7 366da: 2b 96 adiw r28, 0x0b ; 11 366dc: 3f ad ldd r19, Y+63 ; 0x3f 366de: 2b 97 sbiw r28, 0x0b ; 11 366e0: 2f 96 adiw r28, 0x0f ; 15 366e2: 4f ad ldd r20, Y+63 ; 0x3f 366e4: 2f 97 sbiw r28, 0x0f ; 15 366e6: 63 96 adiw r28, 0x13 ; 19 366e8: 5f ad ldd r21, Y+63 ; 0x3f 366ea: 63 97 sbiw r28, 0x13 ; 19 366ec: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 366f0: 2b 01 movw r4, r22 366f2: 3c 01 movw r6, r24 366f4: f8 01 movw r30, r16 366f6: e8 5b subi r30, 0xB8 ; 184 366f8: ff 4f sbci r31, 0xFF ; 255 366fa: 40 82 st Z, r4 366fc: 51 82 std Z+1, r5 ; 0x01 366fe: 62 82 std Z+2, r6 ; 0x02 36700: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 36702: 34 96 adiw r30, 0x04 ; 4 36704: 80 81 ld r24, Z 36706: 88 23 and r24, r24 36708: 09 f4 brne .+2 ; 0x3670c 3670a: 89 c0 rjmp .+274 ; 0x3681e // 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)) 3670c: 20 91 04 18 lds r18, 0x1804 ; 0x801804 36710: 30 91 05 18 lds r19, 0x1805 ; 0x801805 36714: 40 91 06 18 lds r20, 0x1806 ; 0x801806 36718: 50 91 07 18 lds r21, 0x1807 ; 0x801807 3671c: 6a 96 adiw r28, 0x1a ; 26 3671e: 6c ad ldd r22, Y+60 ; 0x3c 36720: 7d ad ldd r23, Y+61 ; 0x3d 36722: 8e ad ldd r24, Y+62 ; 0x3e 36724: 9f ad ldd r25, Y+63 ; 0x3f 36726: 6a 97 sbiw r28, 0x1a ; 26 36728: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3672c: 4b 01 movw r8, r22 3672e: 5c 01 movw r10, r24 36730: c0 90 7b 06 lds r12, 0x067B ; 0x80067b 36734: d0 90 7c 06 lds r13, 0x067C ; 0x80067c 36738: e0 90 7d 06 lds r14, 0x067D ; 0x80067d 3673c: f0 90 7e 06 lds r15, 0x067E ; 0x80067e block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 36740: 0c 5a subi r16, 0xAC ; 172 36742: 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)) 36744: a7 01 movw r20, r14 36746: 96 01 movw r18, r12 36748: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 3674c: a3 01 movw r20, r6 3674e: 92 01 movw r18, r4 36750: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 36754: f8 01 movw r30, r16 36756: 60 83 st Z, r22 36758: 71 83 std Z+1, r23 ; 0x01 3675a: 82 83 std Z+2, r24 ; 0x02 3675c: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 3675e: 20 e0 ldi r18, 0x00 ; 0 36760: 30 e0 ldi r19, 0x00 ; 0 36762: a9 01 movw r20, r18 36764: 6a 96 adiw r28, 0x1a ; 26 36766: 6c ad ldd r22, Y+60 ; 0x3c 36768: 7d ad ldd r23, Y+61 ; 0x3d 3676a: 8e ad ldd r24, Y+62 ; 0x3e 3676c: 9f ad ldd r25, Y+63 ; 0x3f 3676e: 6a 97 sbiw r28, 0x1a ; 26 36770: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36774: 18 16 cp r1, r24 36776: 0c f0 brlt .+2 ; 0x3677a 36778: 40 c4 rjmp .+2176 ; 0x36ffa advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 3677a: a5 01 movw r20, r10 3677c: 94 01 movw r18, r8 3677e: e2 96 adiw r28, 0x32 ; 50 36780: 6c ad ldd r22, Y+60 ; 0x3c 36782: 7d ad ldd r23, Y+61 ; 0x3d 36784: 8e ad ldd r24, Y+62 ; 0x3e 36786: 9f ad ldd r25, Y+63 ; 0x3f 36788: e2 97 sbiw r28, 0x32 ; 50 3678a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3678e: a7 01 movw r20, r14 36790: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 36792: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36796: 6b 01 movw r12, r22 36798: 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; 3679a: 20 e0 ldi r18, 0x00 ; 0 3679c: 30 e4 ldi r19, 0x40 ; 64 3679e: 4c e1 ldi r20, 0x1C ; 28 367a0: 57 e4 ldi r21, 0x47 ; 71 367a2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 367a6: 18 16 cp r1, r24 367a8: 3c f4 brge .+14 ; 0x367b8 367aa: c1 2c mov r12, r1 367ac: 20 e4 ldi r18, 0x40 ; 64 367ae: d2 2e mov r13, r18 367b0: 2c e1 ldi r18, 0x1C ; 28 367b2: e2 2e mov r14, r18 367b4: 27 e4 ldi r18, 0x47 ; 71 367b6: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 367b8: a7 01 movw r20, r14 367ba: 96 01 movw r18, r12 367bc: 60 e0 ldi r22, 0x00 ; 0 367be: 74 e2 ldi r23, 0x24 ; 36 367c0: 84 ef ldi r24, 0xF4 ; 244 367c2: 99 e4 ldi r25, 0x49 ; 73 367c4: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 367c8: 4b 01 movw r8, r22 367ca: 5c 01 movw r10, r24 if (advance_speed > 20000) { 367cc: 20 e0 ldi r18, 0x00 ; 0 367ce: 30 e4 ldi r19, 0x40 ; 64 367d0: 4c e9 ldi r20, 0x9C ; 156 367d2: 56 e4 ldi r21, 0x46 ; 70 367d4: c7 01 movw r24, r14 367d6: b6 01 movw r22, r12 367d8: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 367dc: 18 16 cp r1, r24 367de: 0c f0 brlt .+2 ; 0x367e2 367e0: 17 c4 rjmp .+2094 ; 0x37010 block->advance_rate = advance_rate * 4; 367e2: 8e e6 ldi r24, 0x6E ; 110 367e4: 82 9d mul r24, r2 367e6: 80 01 movw r16, r0 367e8: 83 9d mul r24, r3 367ea: 10 0d add r17, r0 367ec: 11 24 eor r1, r1 367ee: 0d 58 subi r16, 0x8D ; 141 367f0: 18 4f sbci r17, 0xF8 ; 248 367f2: 78 01 movw r14, r16 367f4: fd e4 ldi r31, 0x4D ; 77 367f6: ef 0e add r14, r31 367f8: f1 1c adc r15, r1 367fa: 20 e0 ldi r18, 0x00 ; 0 367fc: 30 e0 ldi r19, 0x00 ; 0 367fe: 40 e8 ldi r20, 0x80 ; 128 36800: 50 e4 ldi r21, 0x40 ; 64 36802: c5 01 movw r24, r10 36804: b4 01 movw r22, r8 36806: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3680a: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3680e: d7 01 movw r26, r14 36810: 6d 93 st X+, r22 36812: 7c 93 st X, r23 block->advance_step_loops = 4; 36814: f8 01 movw r30, r16 36816: ed 5a subi r30, 0xAD ; 173 36818: ff 4f sbci r31, 0xFF ; 255 3681a: 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; 3681c: 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); 3681e: 09 a5 ldd r16, Y+41 ; 0x29 36820: 1d a5 ldd r17, Y+45 ; 0x2d 36822: 29 a9 ldd r18, Y+49 ; 0x31 36824: 39 ad ldd r19, Y+57 ; 0x39 36826: 4d ad ldd r20, Y+61 ; 0x3d 36828: 5d a9 ldd r21, Y+53 ; 0x35 3682a: 6e ad ldd r22, Y+62 ; 0x3e 3682c: 23 96 adiw r28, 0x03 ; 3 3682e: 7f ad ldd r23, Y+63 ; 0x3f 36830: 23 97 sbiw r28, 0x03 ; 3 36832: a4 96 adiw r28, 0x24 ; 36 36834: 8e ad ldd r24, Y+62 ; 0x3e 36836: 9f ad ldd r25, Y+63 ; 0x3f 36838: a4 97 sbiw r28, 0x24 ; 36 3683a: 8d 58 subi r24, 0x8D ; 141 3683c: 98 4f sbci r25, 0xF8 ; 248 3683e: 0f 94 03 a1 call 0x34206 ; 0x34206 if (block->step_event_count.wide <= 32767) 36842: 8e e6 ldi r24, 0x6E ; 110 36844: 82 9d mul r24, r2 36846: f0 01 movw r30, r0 36848: 83 9d mul r24, r3 3684a: f0 0d add r31, r0 3684c: 11 24 eor r1, r1 3684e: ed 58 subi r30, 0x8D ; 141 36850: f8 4f sbci r31, 0xF8 ; 248 36852: 80 89 ldd r24, Z+16 ; 0x10 36854: 91 89 ldd r25, Z+17 ; 0x11 36856: a2 89 ldd r26, Z+18 ; 0x12 36858: b3 89 ldd r27, Z+19 ; 0x13 3685a: 81 15 cp r24, r1 3685c: 90 48 sbci r25, 0x80 ; 128 3685e: a1 05 cpc r26, r1 36860: b1 05 cpc r27, r1 36862: 18 f4 brcc .+6 ; 0x3686a block->flag |= BLOCK_FLAG_DDA_LOWRES; 36864: 85 a9 ldd r24, Z+53 ; 0x35 36866: 88 60 ori r24, 0x08 ; 8 36868: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 3686a: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 3686c: 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; 3686e: 90 91 5a 0e lds r25, 0x0E5A ; 0x800e5a 36872: 91 11 cpse r25, r1 36874: 93 c4 rjmp .+2342 ; 0x3719c block_buffer_head = next_buffer_head; 36876: a1 96 adiw r28, 0x21 ; 33 36878: 3f ad ldd r19, Y+63 ; 0x3f 3687a: a1 97 sbiw r28, 0x21 ; 33 3687c: 30 93 53 0e sts 0x0E53, r19 ; 0x800e53 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 36880: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 36882: c2 58 subi r28, 0x82 ; 130 36884: df 4f sbci r29, 0xFF ; 255 36886: 88 81 ld r24, Y 36888: 99 81 ldd r25, Y+1 ; 0x01 3688a: aa 81 ldd r26, Y+2 ; 0x02 3688c: bb 81 ldd r27, Y+3 ; 0x03 3688e: ce 57 subi r28, 0x7E ; 126 36890: d0 40 sbci r29, 0x00 ; 0 36892: 80 93 51 07 sts 0x0751, r24 ; 0x800751 36896: 90 93 52 07 sts 0x0752, r25 ; 0x800752 3689a: a0 93 53 07 sts 0x0753, r26 ; 0x800753 3689e: b0 93 54 07 sts 0x0754, r27 ; 0x800754 368a2: ce 57 subi r28, 0x7E ; 126 368a4: df 4f sbci r29, 0xFF ; 255 368a6: 28 81 ld r18, Y 368a8: 39 81 ldd r19, Y+1 ; 0x01 368aa: 4a 81 ldd r20, Y+2 ; 0x02 368ac: 5b 81 ldd r21, Y+3 ; 0x03 368ae: c2 58 subi r28, 0x82 ; 130 368b0: d0 40 sbci r29, 0x00 ; 0 368b2: 20 93 55 07 sts 0x0755, r18 ; 0x800755 368b6: 30 93 56 07 sts 0x0756, r19 ; 0x800756 368ba: 40 93 57 07 sts 0x0757, r20 ; 0x800757 368be: 50 93 58 07 sts 0x0758, r21 ; 0x800758 368c2: e6 96 adiw r28, 0x36 ; 54 368c4: 8c ad ldd r24, Y+60 ; 0x3c 368c6: 9d ad ldd r25, Y+61 ; 0x3d 368c8: ae ad ldd r26, Y+62 ; 0x3e 368ca: bf ad ldd r27, Y+63 ; 0x3f 368cc: e6 97 sbiw r28, 0x36 ; 54 368ce: 80 93 59 07 sts 0x0759, r24 ; 0x800759 368d2: 90 93 5a 07 sts 0x075A, r25 ; 0x80075a 368d6: a0 93 5b 07 sts 0x075B, r26 ; 0x80075b 368da: b0 93 5c 07 sts 0x075C, r27 ; 0x80075c 368de: ae 96 adiw r28, 0x2e ; 46 368e0: 2c ad ldd r18, Y+60 ; 0x3c 368e2: 3d ad ldd r19, Y+61 ; 0x3d 368e4: 4e ad ldd r20, Y+62 ; 0x3e 368e6: 5f ad ldd r21, Y+63 ; 0x3f 368e8: ae 97 sbiw r28, 0x2e ; 46 368ea: 20 93 5d 07 sts 0x075D, r18 ; 0x80075d 368ee: 30 93 5e 07 sts 0x075E, r19 ; 0x80075e 368f2: 40 93 5f 07 sts 0x075F, r20 ; 0x80075f 368f6: 50 93 60 07 sts 0x0760, r21 ; 0x800760 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 368fa: 89 a1 ldd r24, Y+33 ; 0x21 368fc: 9a a1 ldd r25, Y+34 ; 0x22 368fe: ab a1 ldd r26, Y+35 ; 0x23 36900: bc a1 ldd r27, Y+36 ; 0x24 36902: 80 93 cd 04 sts 0x04CD, r24 ; 0x8004cd 36906: 90 93 ce 04 sts 0x04CE, r25 ; 0x8004ce 3690a: a0 93 cf 04 sts 0x04CF, r26 ; 0x8004cf 3690e: b0 93 d0 04 sts 0x04D0, r27 ; 0x8004d0 position_float[Y_AXIS] = y; 36912: 8d a1 ldd r24, Y+37 ; 0x25 36914: 9e a1 ldd r25, Y+38 ; 0x26 36916: af a1 ldd r26, Y+39 ; 0x27 36918: b8 a5 ldd r27, Y+40 ; 0x28 3691a: 80 93 d1 04 sts 0x04D1, r24 ; 0x8004d1 3691e: 90 93 d2 04 sts 0x04D2, r25 ; 0x8004d2 36922: a0 93 d3 04 sts 0x04D3, r26 ; 0x8004d3 36926: b0 93 d4 04 sts 0x04D4, r27 ; 0x8004d4 position_float[Z_AXIS] = z; 3692a: a8 96 adiw r28, 0x28 ; 40 3692c: 8c ad ldd r24, Y+60 ; 0x3c 3692e: 9d ad ldd r25, Y+61 ; 0x3d 36930: ae ad ldd r26, Y+62 ; 0x3e 36932: bf ad ldd r27, Y+63 ; 0x3f 36934: a8 97 sbiw r28, 0x28 ; 40 36936: 80 93 d5 04 sts 0x04D5, r24 ; 0x8004d5 3693a: 90 93 d6 04 sts 0x04D6, r25 ; 0x8004d6 3693e: a0 93 d7 04 sts 0x04D7, r26 ; 0x8004d7 36942: b0 93 d8 04 sts 0x04D8, r27 ; 0x8004d8 position_float[E_AXIS] = e; 36946: aa 96 adiw r28, 0x2a ; 42 36948: ee ad ldd r30, Y+62 ; 0x3e 3694a: ff ad ldd r31, Y+63 ; 0x3f 3694c: aa 97 sbiw r28, 0x2a ; 42 3694e: 80 81 ld r24, Z 36950: 91 81 ldd r25, Z+1 ; 0x01 36952: a2 81 ldd r26, Z+2 ; 0x02 36954: b3 81 ldd r27, Z+3 ; 0x03 36956: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 3695a: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 3695e: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 36962: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc void planner_recalculate(const float &safe_final_speed) { // Reverse pass // Make a local copy of block_buffer_tail, because the interrupt can alter it // by consuming the blocks, therefore shortening the queue. uint8_t tail = block_buffer_tail; 36966: f0 90 54 0e lds r15, 0x0E54 ; 0x800e54 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); 3696a: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 3696e: 8f 19 sub r24, r15 36970: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 36972: 83 30 cpi r24, 0x03 ; 3 36974: 40 f1 brcs .+80 ; 0x369c6 // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 36976: 10 91 53 0e lds r17, 0x0E53 ; 0x800e53 } // 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) 3697a: 11 11 cpse r17, r1 3697c: 01 c0 rjmp .+2 ; 0x36980 block_index = BLOCK_BUFFER_SIZE; 3697e: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36980: 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; 36982: fe e6 ldi r31, 0x6E ; 110 36984: 1f 9f mul r17, r31 36986: c0 01 movw r24, r0 36988: 11 24 eor r1, r1 3698a: 9c 01 movw r18, r24 3698c: 2d 58 subi r18, 0x8D ; 141 3698e: 38 4f sbci r19, 0xF8 ; 248 36990: 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) 36992: 11 11 cpse r17, r1 36994: 01 c0 rjmp .+2 ; 0x36998 block_index = BLOCK_BUFFER_SIZE; 36996: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36998: 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)); 3699a: 3e e6 ldi r19, 0x6E ; 110 3699c: 13 9f mul r17, r19 3699e: c0 01 movw r24, r0 369a0: 11 24 eor r1, r1 369a2: ac 01 movw r20, r24 369a4: 4d 58 subi r20, 0x8D ; 141 369a6: 58 4f sbci r21, 0xF8 ; 248 369a8: 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)); 369aa: 9e e6 ldi r25, 0x6E ; 110 369ac: 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) { 369ae: f1 16 cp r15, r17 369b0: 69 f0 breq .+26 ; 0x369cc if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 369b2: d6 01 movw r26, r12 369b4: d5 96 adiw r26, 0x35 ; 53 369b6: 0c 91 ld r16, X 369b8: 02 ff sbrs r16, 2 369ba: 7e c3 rjmp .+1788 ; 0x370b8 // 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); 369bc: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 369c0: 81 1b sub r24, r17 369c2: 8f 70 andi r24, 0x0F ; 15 369c4: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 369c6: 82 30 cpi r24, 0x02 ; 2 369c8: 08 f4 brcc .+2 ; 0x369cc 369ca: a3 c0 rjmp .+326 ; 0x36b12 // 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; 369cc: 3e e6 ldi r19, 0x6E ; 110 369ce: f3 9e mul r15, r19 369d0: c0 01 movw r24, r0 369d2: 11 24 eor r1, r1 369d4: ac 01 movw r20, r24 369d6: 4d 58 subi r20, 0x8D ; 141 369d8: 58 4f sbci r21, 0xF8 ; 248 369da: 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) 369dc: f3 94 inc r15 369de: 50 e1 ldi r21, 0x10 ; 16 369e0: f5 12 cpse r15, r21 369e2: 01 c0 rjmp .+2 ; 0x369e6 block_index = 0; 369e4: 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)); 369e6: ae e6 ldi r26, 0x6E ; 110 369e8: fa 9e mul r15, r26 369ea: c0 01 movw r24, r0 369ec: 11 24 eor r1, r1 369ee: fc 01 movw r30, r24 369f0: ed 58 subi r30, 0x8D ; 141 369f2: f8 4f sbci r31, 0xF8 ; 248 369f4: 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)); 369f6: 8e e6 ldi r24, 0x6E ; 110 369f8: 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) { 369fa: d5 01 movw r26, r10 369fc: d5 96 adiw r26, 0x35 ; 53 369fe: 8c 91 ld r24, X 36a00: d5 97 sbiw r26, 0x35 ; 53 36a02: 81 fd sbrc r24, 1 36a04: 5a c0 rjmp .+180 ; 0x36aba 36a06: 95 96 adiw r26, 0x25 ; 37 36a08: 4d 90 ld r4, X+ 36a0a: 5d 90 ld r5, X+ 36a0c: 6d 90 ld r6, X+ 36a0e: 7c 90 ld r7, X 36a10: 98 97 sbiw r26, 0x28 ; 40 36a12: f6 01 movw r30, r12 36a14: 95 a0 ldd r9, Z+37 ; 0x25 36a16: e6 a0 ldd r14, Z+38 ; 0x26 36a18: 07 a1 ldd r16, Z+39 ; 0x27 36a1a: 10 a5 ldd r17, Z+40 ; 0x28 36a1c: 29 2d mov r18, r9 36a1e: 3e 2d mov r19, r14 36a20: a8 01 movw r20, r16 36a22: c3 01 movw r24, r6 36a24: b2 01 movw r22, r4 36a26: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36a2a: 87 ff sbrs r24, 7 36a2c: 46 c0 rjmp .+140 ; 0x36aba // 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); 36a2e: a3 01 movw r20, r6 36a30: 92 01 movw r18, r4 36a32: c3 01 movw r24, r6 36a34: b2 01 movw r22, r4 36a36: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36a3a: 2b 01 movw r4, r22 36a3c: 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)); 36a3e: d5 01 movw r26, r10 36a40: d1 96 adiw r26, 0x31 ; 49 36a42: 6d 91 ld r22, X+ 36a44: 7d 91 ld r23, X+ 36a46: 8d 91 ld r24, X+ 36a48: 9c 91 ld r25, X 36a4a: d4 97 sbiw r26, 0x34 ; 52 36a4c: 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); 36a4e: 9b 01 movw r18, r22 36a50: ac 01 movw r20, r24 36a52: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 36a56: f5 01 movw r30, r10 36a58: 25 a5 ldd r18, Z+45 ; 0x2d 36a5a: 36 a5 ldd r19, Z+46 ; 0x2e 36a5c: 47 a5 ldd r20, Z+47 ; 0x2f 36a5e: 50 a9 ldd r21, Z+48 ; 0x30 36a60: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36a64: 9b 01 movw r18, r22 36a66: ac 01 movw r20, r24 36a68: c3 01 movw r24, r6 36a6a: b2 01 movw r22, r4 36a6c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 36a70: 0f 94 05 e2 call 0x3c40a ; 0x3c40a 36a74: 2b 01 movw r4, r22 36a76: 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)); 36a78: 9b 01 movw r18, r22 36a7a: ac 01 movw r20, r24 36a7c: 69 2d mov r22, r9 36a7e: 7e 2d mov r23, r14 36a80: c8 01 movw r24, r16 36a82: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36a86: 87 ff sbrs r24, 7 36a88: 03 c0 rjmp .+6 ; 0x36a90 36a8a: 49 2c mov r4, r9 36a8c: 5e 2c mov r5, r14 36a8e: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 36a90: 92 01 movw r18, r4 36a92: a3 01 movw r20, r6 36a94: 69 2d mov r22, r9 36a96: 7e 2d mov r23, r14 36a98: c8 01 movw r24, r16 36a9a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36a9e: 88 23 and r24, r24 36aa0: 61 f0 breq .+24 ; 0x36aba 36aa2: d6 01 movw r26, r12 36aa4: d5 96 adiw r26, 0x35 ; 53 36aa6: 2c 91 ld r18, X current->entry_speed = entry_speed; 36aa8: c2 01 movw r24, r4 36aaa: d3 01 movw r26, r6 36aac: f6 01 movw r30, r12 36aae: 85 a3 std Z+37, r24 ; 0x25 36ab0: 96 a3 std Z+38, r25 ; 0x26 36ab2: a7 a3 std Z+39, r26 ; 0x27 36ab4: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 36ab6: 21 60 ori r18, 0x01 ; 1 36ab8: 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) { 36aba: d5 01 movw r26, r10 36abc: d5 96 adiw r26, 0x35 ; 53 36abe: 8c 91 ld r24, X 36ac0: d5 97 sbiw r26, 0x35 ; 53 36ac2: f6 01 movw r30, r12 36ac4: 95 a9 ldd r25, Z+53 ; 0x35 36ac6: 89 2b or r24, r25 36ac8: 80 ff sbrs r24, 0 36aca: 14 c0 rjmp .+40 ; 0x36af4 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 36acc: 05 a1 ldd r16, Z+37 ; 0x25 36ace: 16 a1 ldd r17, Z+38 ; 0x26 36ad0: 27 a1 ldd r18, Z+39 ; 0x27 36ad2: 30 a5 ldd r19, Z+40 ; 0x28 36ad4: 95 96 adiw r26, 0x25 ; 37 36ad6: 4d 91 ld r20, X+ 36ad8: 5d 91 ld r21, X+ 36ada: 6d 91 ld r22, X+ 36adc: 7c 91 ld r23, X 36ade: 98 97 sbiw r26, 0x28 ; 40 36ae0: c5 01 movw r24, r10 36ae2: 0f 94 03 a1 call 0x34206 ; 0x34206 // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 36ae6: d5 01 movw r26, r10 36ae8: d5 96 adiw r26, 0x35 ; 53 36aea: 8c 91 ld r24, X 36aec: d5 97 sbiw r26, 0x35 ; 53 36aee: 8e 7f andi r24, 0xFE ; 254 36af0: d5 96 adiw r26, 0x35 ; 53 36af2: 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) 36af4: f3 94 inc r15 36af6: b0 e1 ldi r27, 0x10 ; 16 36af8: fb 12 cpse r15, r27 36afa: 01 c0 rjmp .+2 ; 0x36afe block_index = 0; 36afc: 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)); 36afe: f8 9c mul r15, r8 36b00: c0 01 movw r24, r0 36b02: 11 24 eor r1, r1 36b04: 8d 58 subi r24, 0x8D ; 141 36b06: 98 4f sbci r25, 0xF8 ; 248 } while (block_index != block_buffer_head); 36b08: 20 91 53 0e lds r18, 0x0E53 ; 0x800e53 // 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; 36b0c: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 36b0e: f2 12 cpse r15, r18 36b10: 43 c3 rjmp .+1670 ; 0x37198 } // 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); 36b12: 80 91 53 0e lds r24, 0x0E53 ; 0x800e53 } // 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) 36b16: 81 11 cpse r24, r1 36b18: 01 c0 rjmp .+2 ; 0x36b1c block_index = BLOCK_BUFFER_SIZE; 36b1a: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 36b1c: 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); 36b1e: ee e6 ldi r30, 0x6E ; 110 36b20: 8e 9f mul r24, r30 36b22: c0 01 movw r24, r0 36b24: 11 24 eor r1, r1 36b26: 9c 01 movw r18, r24 36b28: 2d 58 subi r18, 0x8D ; 141 36b2a: 38 4f sbci r19, 0xF8 ; 248 36b2c: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 36b2e: d9 01 movw r26, r18 36b30: 95 96 adiw r26, 0x25 ; 37 36b32: 4d 91 ld r20, X+ 36b34: 5d 91 ld r21, X+ 36b36: 6d 91 ld r22, X+ 36b38: 7c 91 ld r23, X 36b3a: 98 97 sbiw r26, 0x28 ; 40 36b3c: 09 a5 ldd r16, Y+41 ; 0x29 36b3e: 1d a5 ldd r17, Y+45 ; 0x2d 36b40: 29 a9 ldd r18, Y+49 ; 0x31 36b42: 39 ad ldd r19, Y+57 ; 0x39 36b44: c7 01 movw r24, r14 36b46: 0f 94 03 a1 call 0x34206 ; 0x34206 current->flag &= ~BLOCK_FLAG_RECALCULATE; 36b4a: f7 01 movw r30, r14 36b4c: 85 a9 ldd r24, Z+53 ; 0x35 36b4e: 8e 7f andi r24, 0xFE ; 254 36b50: 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(); 36b52: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36b56: 82 60 ori r24, 0x02 ; 2 36b58: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36b5c: 0d 94 23 ab jmp 0x35646 ; 0x35646 // 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)); 36b60: a5 53 subi r26, 0x35 ; 53 36b62: b8 4f sbci r27, 0xF8 ; 248 36b64: 80 e1 ldi r24, 0x10 ; 16 36b66: e0 e4 ldi r30, 0x40 ; 64 36b68: f7 e0 ldi r31, 0x07 ; 7 36b6a: 0d 94 5e ab jmp 0x356bc ; 0x356bc 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]); 36b6e: 20 91 77 06 lds r18, 0x0677 ; 0x800677 36b72: 30 91 78 06 lds r19, 0x0678 ; 0x800678 36b76: 40 91 79 06 lds r20, 0x0679 ; 0x800679 36b7a: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 36b7e: a8 96 adiw r28, 0x28 ; 40 36b80: 6c ad ldd r22, Y+60 ; 0x3c 36b82: 7d ad ldd r23, Y+61 ; 0x3d 36b84: 8e ad ldd r24, Y+62 ; 0x3e 36b86: 9f ad ldd r25, Y+63 ; 0x3f 36b88: a8 97 sbiw r28, 0x28 ; 40 36b8a: 0d 94 f4 ab jmp 0x357e8 ; 0x357e8 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); 36b8e: 81 e0 ldi r24, 0x01 ; 1 36b90: 80 8f std Z+24, r24 ; 0x18 36b92: 0d 94 9a ad jmp 0x35b34 ; 0x35b34 { if(feed_rate 36b9a: b0 90 a8 06 lds r11, 0x06A8 ; 0x8006a8 36b9e: 00 91 a9 06 lds r16, 0x06A9 ; 0x8006a9 36ba2: 10 91 aa 06 lds r17, 0x06AA ; 0x8006aa 36ba6: 4c c8 rjmp .-3944 ; 0x35c40 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])); 36ba8: c5 01 movw r24, r10 36baa: b4 01 movw r22, r8 36bac: 0f 94 d8 d7 call 0x3afb0 ; 0x3afb0 36bb0: 4b 01 movw r8, r22 36bb2: 5c 01 movw r10, r24 36bb4: c7 01 movw r24, r14 36bb6: b6 01 movw r22, r12 36bb8: 0f 94 d8 d7 call 0x3afb0 ; 0x3afb0 36bbc: 9b 01 movw r18, r22 36bbe: ac 01 movw r20, r24 36bc0: c5 01 movw r24, r10 36bc2: b4 01 movw r22, r8 36bc4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 36bc8: 6b 01 movw r12, r22 36bca: 7c 01 movw r14, r24 36bcc: 22 96 adiw r28, 0x02 ; 2 36bce: 6c ad ldd r22, Y+60 ; 0x3c 36bd0: 7d ad ldd r23, Y+61 ; 0x3d 36bd2: 8e ad ldd r24, Y+62 ; 0x3e 36bd4: 9f ad ldd r25, Y+63 ; 0x3f 36bd6: 22 97 sbiw r28, 0x02 ; 2 36bd8: 0f 94 d8 d7 call 0x3afb0 ; 0x3afb0 36bdc: 9b 01 movw r18, r22 36bde: ac 01 movw r20, r24 36be0: c7 01 movw r24, r14 36be2: b6 01 movw r22, r12 36be4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 36be8: 0f 94 05 e2 call 0x3c40a ; 0x3c40a 36bec: 2e e6 ldi r18, 0x6E ; 110 36bee: 22 9d mul r18, r2 36bf0: f0 01 movw r30, r0 36bf2: 23 9d mul r18, r3 36bf4: f0 0d add r31, r0 36bf6: 11 24 eor r1, r1 36bf8: ed 58 subi r30, 0x8D ; 141 36bfa: f8 4f sbci r31, 0xF8 ; 248 36bfc: 65 a7 std Z+45, r22 ; 0x2d 36bfe: 76 a7 std Z+46, r23 ; 0x2e 36c00: 87 a7 std Z+47, r24 ; 0x2f 36c02: 90 ab std Z+48, r25 ; 0x30 36c04: bb c8 rjmp .-3722 ; 0x35d7c 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 36c06: 2a 96 adiw r28, 0x0a ; 10 36c08: 2c ad ldd r18, Y+60 ; 0x3c 36c0a: 3d ad ldd r19, Y+61 ; 0x3d 36c0c: 4e ad ldd r20, Y+62 ; 0x3e 36c0e: 5f ad ldd r21, Y+63 ; 0x3f 36c10: 2a 97 sbiw r28, 0x0a ; 10 36c12: 23 2b or r18, r19 36c14: 24 2b or r18, r20 36c16: 25 2b or r18, r21 36c18: 09 f4 brne .+2 ; 0x36c1c 36c1a: 0e c1 rjmp .+540 ; 0x36e38 36c1c: 60 91 9f 06 lds r22, 0x069F ; 0x80069f 36c20: 70 91 a0 06 lds r23, 0x06A0 ; 0x8006a0 36c24: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 36c28: 90 91 a2 06 lds r25, 0x06A2 ; 0x8006a2 36c2c: 29 a5 ldd r18, Y+41 ; 0x29 36c2e: 3a a5 ldd r19, Y+42 ; 0x2a 36c30: 4b a5 ldd r20, Y+43 ; 0x2b 36c32: 5c a5 ldd r21, Y+44 ; 0x2c 36c34: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36c38: 0f 94 15 df call 0x3be2a ; 0x3be2a 36c3c: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 36c40: 2b 01 movw r4, r22 36c42: 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 36c44: 80 91 04 18 lds r24, 0x1804 ; 0x801804 36c48: 90 91 05 18 lds r25, 0x1805 ; 0x801805 36c4c: a0 91 06 18 lds r26, 0x1806 ; 0x801806 36c50: b0 91 07 18 lds r27, 0x1807 ; 0x801807 36c54: 8d a7 std Y+45, r24 ; 0x2d 36c56: 9e a7 std Y+46, r25 ; 0x2e 36c58: af a7 std Y+47, r26 ; 0x2f 36c5a: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 36c5c: 20 e0 ldi r18, 0x00 ; 0 36c5e: 30 e0 ldi r19, 0x00 ; 0 36c60: a9 01 movw r20, r18 36c62: bc 01 movw r22, r24 36c64: cd 01 movw r24, r26 36c66: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36c6a: 18 16 cp r1, r24 36c6c: 0c f0 brlt .+2 ; 0x36c70 36c6e: ed c0 rjmp .+474 ; 0x36e4a * 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 36c70: 20 e0 ldi r18, 0x00 ; 0 36c72: 30 e0 ldi r19, 0x00 ; 0 36c74: a9 01 movw r20, r18 36c76: 26 96 adiw r28, 0x06 ; 6 36c78: 6c ad ldd r22, Y+60 ; 0x3c 36c7a: 7d ad ldd r23, Y+61 ; 0x3d 36c7c: 8e ad ldd r24, Y+62 ; 0x3e 36c7e: 9f ad ldd r25, Y+63 ; 0x3f 36c80: 26 97 sbiw r28, 0x06 ; 6 36c82: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36c86: 87 fd sbrc r24, 7 36c88: e0 c0 rjmp .+448 ; 0x36e4a && fabs(delta_mm[Z_AXIS]) < 0.5; 36c8a: 22 96 adiw r28, 0x02 ; 2 36c8c: 6c ad ldd r22, Y+60 ; 0x3c 36c8e: 7d ad ldd r23, Y+61 ; 0x3d 36c90: 8e ad ldd r24, Y+62 ; 0x3e 36c92: 9f ad ldd r25, Y+63 ; 0x3f 36c94: 22 97 sbiw r28, 0x02 ; 2 36c96: 9f 77 andi r25, 0x7F ; 127 36c98: 20 e0 ldi r18, 0x00 ; 0 36c9a: 30 e0 ldi r19, 0x00 ; 0 36c9c: 40 e0 ldi r20, 0x00 ; 0 36c9e: 5f e3 ldi r21, 0x3F ; 63 36ca0: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36ca4: 87 ff sbrs r24, 7 36ca6: d1 c0 rjmp .+418 ; 0x36e4a * * 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 36ca8: 8e e6 ldi r24, 0x6E ; 110 36caa: 82 9d mul r24, r2 36cac: 80 01 movw r16, r0 36cae: 83 9d mul r24, r3 36cb0: 10 0d add r17, r0 36cb2: 11 24 eor r1, r1 36cb4: 01 54 subi r16, 0x41 ; 65 36cb6: 18 4f sbci r17, 0xF8 ; 248 36cb8: 81 e0 ldi r24, 0x01 ; 1 36cba: d8 01 movw r26, r16 36cbc: 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]) 36cbe: 20 91 cd 04 lds r18, 0x04CD ; 0x8004cd 36cc2: 30 91 ce 04 lds r19, 0x04CE ; 0x8004ce 36cc6: 40 91 cf 04 lds r20, 0x04CF ; 0x8004cf 36cca: 50 91 d0 04 lds r21, 0x04D0 ; 0x8004d0 36cce: 69 a1 ldd r22, Y+33 ; 0x21 36cd0: 7a a1 ldd r23, Y+34 ; 0x22 36cd2: 8b a1 ldd r24, Y+35 ; 0x23 36cd4: 9c a1 ldd r25, Y+36 ; 0x24 36cd6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 36cda: 69 ab std Y+49, r22 ; 0x31 36cdc: 7a ab std Y+50, r23 ; 0x32 36cde: 8b ab std Y+51, r24 ; 0x33 36ce0: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36ce2: 20 91 d1 04 lds r18, 0x04D1 ; 0x8004d1 36ce6: 30 91 d2 04 lds r19, 0x04D2 ; 0x8004d2 36cea: 40 91 d3 04 lds r20, 0x04D3 ; 0x8004d3 36cee: 50 91 d4 04 lds r21, 0x04D4 ; 0x8004d4 36cf2: 6d a1 ldd r22, Y+37 ; 0x25 36cf4: 7e a1 ldd r23, Y+38 ; 0x26 36cf6: 8f a1 ldd r24, Y+39 ; 0x27 36cf8: 98 a5 ldd r25, Y+40 ; 0x28 36cfa: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 36cfe: 4b 01 movw r8, r22 36d00: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36d02: 20 91 d5 04 lds r18, 0x04D5 ; 0x8004d5 36d06: 30 91 d6 04 lds r19, 0x04D6 ; 0x8004d6 36d0a: 40 91 d7 04 lds r20, 0x04D7 ; 0x8004d7 36d0e: 50 91 d8 04 lds r21, 0x04D8 ; 0x8004d8 36d12: a8 96 adiw r28, 0x28 ; 40 36d14: 6c ad ldd r22, Y+60 ; 0x3c 36d16: 7d ad ldd r23, Y+61 ; 0x3d 36d18: 8e ad ldd r24, Y+62 ; 0x3e 36d1a: 9f ad ldd r25, Y+63 ; 0x3f 36d1c: a8 97 sbiw r28, 0x28 ; 40 36d1e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 36d22: 6b 01 movw r12, r22 36d24: 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]) 36d26: 29 a9 ldd r18, Y+49 ; 0x31 36d28: 3a a9 ldd r19, Y+50 ; 0x32 36d2a: 4b a9 ldd r20, Y+51 ; 0x33 36d2c: 5c a9 ldd r21, Y+52 ; 0x34 36d2e: ca 01 movw r24, r20 36d30: b9 01 movw r22, r18 36d32: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36d36: 69 ab std Y+49, r22 ; 0x31 36d38: 7a ab std Y+50, r23 ; 0x32 36d3a: 8b ab std Y+51, r24 ; 0x33 36d3c: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36d3e: a5 01 movw r20, r10 36d40: 94 01 movw r18, r8 36d42: c5 01 movw r24, r10 36d44: b4 01 movw r22, r8 36d46: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36d4a: 9b 01 movw r18, r22 36d4c: ac 01 movw r20, r24 36d4e: 69 a9 ldd r22, Y+49 ; 0x31 36d50: 7a a9 ldd r23, Y+50 ; 0x32 36d52: 8b a9 ldd r24, Y+51 ; 0x33 36d54: 9c a9 ldd r25, Y+52 ; 0x34 36d56: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 36d5a: 4b 01 movw r8, r22 36d5c: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36d5e: a7 01 movw r20, r14 36d60: 96 01 movw r18, r12 36d62: c7 01 movw r24, r14 36d64: b6 01 movw r22, r12 36d66: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36d6a: 9b 01 movw r18, r22 36d6c: ac 01 movw r20, r24 36d6e: c5 01 movw r24, r10 36d70: b4 01 movw r22, r8 36d72: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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]) 36d76: 0f 94 05 e2 call 0x3c40a ; 0x3c40a 36d7a: 6b 01 movw r12, r22 36d7c: 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]); 36d7e: 20 91 d9 04 lds r18, 0x04D9 ; 0x8004d9 36d82: 30 91 da 04 lds r19, 0x04DA ; 0x8004da 36d86: 40 91 db 04 lds r20, 0x04DB ; 0x8004db 36d8a: 50 91 dc 04 lds r21, 0x04DC ; 0x8004dc 36d8e: aa 96 adiw r28, 0x2a ; 42 36d90: ee ad ldd r30, Y+62 ; 0x3e 36d92: ff ad ldd r31, Y+63 ; 0x3f 36d94: aa 97 sbiw r28, 0x2a ; 42 36d96: 60 81 ld r22, Z 36d98: 71 81 ldd r23, Z+1 ; 0x01 36d9a: 82 81 ldd r24, Z+2 ; 0x02 36d9c: 93 81 ldd r25, Z+3 ; 0x03 36d9e: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__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; 36da2: a7 01 movw r20, r14 36da4: 96 01 movw r18, r12 36da6: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 36daa: 6a 96 adiw r28, 0x1a ; 26 36dac: 6c af std Y+60, r22 ; 0x3c 36dae: 7d af std Y+61, r23 ; 0x3d 36db0: 8e af std Y+62, r24 ; 0x3e 36db2: 9f af std Y+63, r25 ; 0x3f 36db4: 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) 36db6: 20 e0 ldi r18, 0x00 ; 0 36db8: 30 e0 ldi r19, 0x00 ; 0 36dba: 40 e4 ldi r20, 0x40 ; 64 36dbc: 50 e4 ldi r21, 0x40 ; 64 36dbe: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36dc2: 18 16 cp r1, r24 36dc4: 0c f4 brge .+2 ; 0x36dc8 36dc6: 9e c0 rjmp .+316 ; 0x36f04 block->use_advance_lead = false; else if (e_D_ratio > 0) { 36dc8: 20 e0 ldi r18, 0x00 ; 0 36dca: 30 e0 ldi r19, 0x00 ; 0 36dcc: a9 01 movw r20, r18 36dce: 6a 96 adiw r28, 0x1a ; 26 36dd0: 6c ad ldd r22, Y+60 ; 0x3c 36dd2: 7d ad ldd r23, Y+61 ; 0x3d 36dd4: 8e ad ldd r24, Y+62 ; 0x3e 36dd6: 9f ad ldd r25, Y+63 ; 0x3f 36dd8: 6a 97 sbiw r28, 0x1a ; 26 36dda: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36dde: 18 16 cp r1, r24 36de0: 0c f0 brlt .+2 ; 0x36de4 36de2: 42 c0 rjmp .+132 ; 0x36e68 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 36de4: 6a 96 adiw r28, 0x1a ; 26 36de6: 2c ad ldd r18, Y+60 ; 0x3c 36de8: 3d ad ldd r19, Y+61 ; 0x3d 36dea: 4e ad ldd r20, Y+62 ; 0x3e 36dec: 5f ad ldd r21, Y+63 ; 0x3f 36dee: 6a 97 sbiw r28, 0x1a ; 26 36df0: 6d a5 ldd r22, Y+45 ; 0x2d 36df2: 7e a5 ldd r23, Y+46 ; 0x2e 36df4: 8f a5 ldd r24, Y+47 ; 0x2f 36df6: 98 a9 ldd r25, Y+48 ; 0x30 36df8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36dfc: 9b 01 movw r18, r22 36dfe: ac 01 movw r20, r24 36e00: 60 91 bf 06 lds r22, 0x06BF ; 0x8006bf 36e04: 70 91 c0 06 lds r23, 0x06C0 ; 0x8006c0 36e08: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 36e0c: 90 91 c2 06 lds r25, 0x06C2 ; 0x8006c2 36e10: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 36e14: 29 a5 ldd r18, Y+41 ; 0x29 36e16: 3a a5 ldd r19, Y+42 ; 0x2a 36e18: 4b a5 ldd r20, Y+43 ; 0x2b 36e1a: 5c a5 ldd r21, Y+44 ; 0x2c 36e1c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36e20: 0f 94 15 df call 0x3be2a ; 0x3be2a 36e24: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 36e28: 64 15 cp r22, r4 36e2a: 75 05 cpc r23, r5 36e2c: 86 05 cpc r24, r6 36e2e: 97 05 cpc r25, r7 36e30: d8 f4 brcc .+54 ; 0x36e68 36e32: 2b 01 movw r4, r22 36e34: 3c 01 movw r6, r24 36e36: 18 c0 rjmp .+48 ; 0x36e68 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 36e38: 60 91 2b 07 lds r22, 0x072B ; 0x80072b 36e3c: 70 91 2c 07 lds r23, 0x072C ; 0x80072c 36e40: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 36e44: 90 91 2e 07 lds r25, 0x072E ; 0x80072e 36e48: f1 ce rjmp .-542 ; 0x36c2c * * 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 36e4a: 8e e6 ldi r24, 0x6E ; 110 36e4c: 82 9d mul r24, r2 36e4e: f0 01 movw r30, r0 36e50: 83 9d mul r24, r3 36e52: f0 0d add r31, r0 36e54: 11 24 eor r1, r1 36e56: e1 54 subi r30, 0x41 ; 65 36e58: f8 4f sbci r31, 0xF8 ; 248 36e5a: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36e5c: 6a 96 adiw r28, 0x1a ; 26 36e5e: 1c ae std Y+60, r1 ; 0x3c 36e60: 1d ae std Y+61, r1 ; 0x3d 36e62: 1e ae std Y+62, r1 ; 0x3e 36e64: 1f ae std Y+63, r1 ; 0x3f 36e66: 6a 97 sbiw r28, 0x1a ; 26 36e68: 10 e0 ldi r17, 0x00 ; 0 36e6a: 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) 36e6c: a4 96 adiw r28, 0x24 ; 36 36e6e: ee ad ldd r30, Y+62 ; 0x3e 36e70: ff ad ldd r31, Y+63 ; 0x3f 36e72: a4 97 sbiw r28, 0x24 ; 36 36e74: e0 0f add r30, r16 36e76: f1 1f adc r31, r17 36e78: ed 58 subi r30, 0x8D ; 141 36e7a: f8 4f sbci r31, 0xF8 ; 248 36e7c: c0 80 ld r12, Z 36e7e: d1 80 ldd r13, Z+1 ; 0x01 36e80: e2 80 ldd r14, Z+2 ; 0x02 36e82: f3 80 ldd r15, Z+3 ; 0x03 36e84: c1 14 cp r12, r1 36e86: d1 04 cpc r13, r1 36e88: e1 04 cpc r14, r1 36e8a: f1 04 cpc r15, r1 36e8c: a1 f1 breq .+104 ; 0x36ef6 36e8e: f8 01 movw r30, r16 36e90: e3 51 subi r30, 0x13 ; 19 36e92: f8 4e sbci r31, 0xE8 ; 232 36e94: 60 81 ld r22, Z 36e96: 71 81 ldd r23, Z+1 ; 0x01 36e98: 82 81 ldd r24, Z+2 ; 0x02 36e9a: 93 81 ldd r25, Z+3 ; 0x03 36e9c: 64 15 cp r22, r4 36e9e: 75 05 cpc r23, r5 36ea0: 86 05 cpc r24, r6 36ea2: 97 05 cpc r25, r7 36ea4: 40 f5 brcc .+80 ; 0x36ef6 { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 36ea6: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 36eaa: 29 ad ldd r18, Y+57 ; 0x39 36eac: 3a ad ldd r19, Y+58 ; 0x3a 36eae: 4b ad ldd r20, Y+59 ; 0x3b 36eb0: 5c ad ldd r21, Y+60 ; 0x3c 36eb2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 36eb6: 4b 01 movw r8, r22 36eb8: 5c 01 movw r10, r24 36eba: c7 01 movw r24, r14 36ebc: b6 01 movw r22, r12 36ebe: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 36ec2: 9b 01 movw r18, r22 36ec4: ac 01 movw r20, r24 36ec6: c5 01 movw r24, r10 36ec8: b4 01 movw r22, r8 36eca: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 36ece: 6b 01 movw r12, r22 36ed0: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 36ed2: c3 01 movw r24, r6 36ed4: b2 01 movw r22, r4 36ed6: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 36eda: 9b 01 movw r18, r22 36edc: ac 01 movw r20, r24 36ede: c7 01 movw r24, r14 36ee0: b6 01 movw r22, r12 36ee2: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36ee6: 87 ff sbrs r24, 7 36ee8: 06 c0 rjmp .+12 ; 0x36ef6 36eea: c7 01 movw r24, r14 36eec: b6 01 movw r22, r12 36eee: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 36ef2: 2b 01 movw r4, r22 36ef4: 3c 01 movw r6, r24 36ef6: 0c 5f subi r16, 0xFC ; 252 36ef8: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 36efa: 00 31 cpi r16, 0x10 ; 16 36efc: 11 05 cpc r17, r1 36efe: 09 f0 breq .+2 ; 0x36f02 36f00: b5 cf rjmp .-150 ; 0x36e6c 36f02: 01 c9 rjmp .-3582 ; 0x36106 // 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; 36f04: d8 01 movw r26, r16 36f06: 1c 92 st X, r1 36f08: af cf rjmp .-162 ; 0x36e68 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 36f0a: c9 a6 std Y+41, r12 ; 0x29 36f0c: dd a6 std Y+45, r13 ; 0x2d 36f0e: e9 aa std Y+49, r14 ; 0x31 36f10: f9 ae std Y+57, r15 ; 0x39 limited = true; 36f12: 21 e0 ldi r18, 0x01 ; 1 36f14: 2d ab std Y+53, r18 ; 0x35 36f16: b1 c9 rjmp .-3230 ; 0x3627a // 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); 36f18: 27 96 adiw r28, 0x07 ; 7 36f1a: 2f ad ldd r18, Y+63 ; 0x3f 36f1c: 27 97 sbiw r28, 0x07 ; 7 36f1e: 2b 96 adiw r28, 0x0b ; 11 36f20: 3f ad ldd r19, Y+63 ; 0x3f 36f22: 2b 97 sbiw r28, 0x0b ; 11 36f24: 2f 96 adiw r28, 0x0f ; 15 36f26: 4f ad ldd r20, Y+63 ; 0x3f 36f28: 2f 97 sbiw r28, 0x0f ; 15 36f2a: 63 96 adiw r28, 0x13 ; 19 36f2c: 5f ad ldd r21, Y+63 ; 0x3f 36f2e: 63 97 sbiw r28, 0x13 ; 19 36f30: 6b 96 adiw r28, 0x1b ; 27 36f32: 6f ad ldd r22, Y+63 ; 0x3f 36f34: 6b 97 sbiw r28, 0x1b ; 27 36f36: 6d 96 adiw r28, 0x1d ; 29 36f38: 7f ad ldd r23, Y+63 ; 0x3f 36f3a: 6d 97 sbiw r28, 0x1d ; 29 36f3c: c8 01 movw r24, r16 36f3e: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 36f42: ec 96 adiw r28, 0x3c ; 60 36f44: 6c af std Y+60, r22 ; 0x3c 36f46: 7d af std Y+61, r23 ; 0x3d 36f48: 8e af std Y+62, r24 ; 0x3e 36f4a: 9f af std Y+63, r25 ; 0x3f 36f4c: 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; 36f4e: 6b 96 adiw r28, 0x1b ; 27 36f50: ef ad ldd r30, Y+63 ; 0x3f 36f52: 6b 97 sbiw r28, 0x1b ; 27 36f54: ed af std Y+61, r30 ; 0x3d 36f56: 6d 96 adiw r28, 0x1d ; 29 36f58: ff ad ldd r31, Y+63 ; 0x3f 36f5a: 6d 97 sbiw r28, 0x1d ; 29 36f5c: fd ab std Y+53, r31 ; 0x35 36f5e: 0e af std Y+62, r16 ; 0x3e 36f60: 23 96 adiw r28, 0x03 ; 3 36f62: 1f af std Y+63, r17 ; 0x3f 36f64: 23 97 sbiw r28, 0x03 ; 3 36f66: 04 ca rjmp .-3064 ; 0x36370 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 36f68: f7 fa bst r15, 7 36f6a: f0 94 com r15 36f6c: f7 f8 bld r15, 7 36f6e: f0 94 com r15 36f70: a5 01 movw r20, r10 36f72: 94 01 movw r18, r8 36f74: c7 01 movw r24, r14 36f76: b6 01 movw r22, r12 36f78: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36f7c: 87 ff sbrs r24, 7 36f7e: 77 ca rjmp .-2834 ; 0x3646e // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 36f80: 75 01 movw r14, r10 36f82: 64 01 movw r12, r8 36f84: 74 ca rjmp .-2840 ; 0x3646e // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 36f86: c7 01 movw r24, r14 36f88: b6 01 movw r22, r12 36f8a: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 36f8e: 87 fd sbrc r24, 7 36f90: 09 c0 rjmp .+18 ; 0x36fa4 36f92: 20 e0 ldi r18, 0x00 ; 0 36f94: 30 e0 ldi r19, 0x00 ; 0 36f96: a9 01 movw r20, r18 36f98: c5 01 movw r24, r10 36f9a: b4 01 movw r22, r8 36f9c: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36fa0: 18 16 cp r1, r24 36fa2: 2c f4 brge .+10 ; 0x36fae 36fa4: a5 01 movw r20, r10 36fa6: 94 01 movw r18, r8 36fa8: c7 01 movw r24, r14 36faa: b6 01 movw r22, r12 36fac: 5c ca rjmp .-2888 ; 0x36466 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 36fae: b7 fa bst r11, 7 36fb0: b0 94 com r11 36fb2: b7 f8 bld r11, 7 36fb4: b0 94 com r11 36fb6: a7 01 movw r20, r14 36fb8: 96 01 movw r18, r12 36fba: c5 01 movw r24, r10 36fbc: b4 01 movw r22, r8 36fbe: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 36fc2: 18 16 cp r1, r24 36fc4: 0c f0 brlt .+2 ; 0x36fc8 36fc6: 53 ca rjmp .-2906 ; 0x3646e 36fc8: db cf rjmp .-74 ; 0x36f80 // 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; 36fca: 8e e6 ldi r24, 0x6E ; 110 36fcc: 82 9d mul r24, r2 36fce: f0 01 movw r30, r0 36fd0: 83 9d mul r24, r3 36fd2: f0 0d add r31, r0 36fd4: 11 24 eor r1, r1 36fd6: ed 58 subi r30, 0x8D ; 141 36fd8: f8 4f sbci r31, 0xF8 ; 248 36fda: 85 a9 ldd r24, Z+53 ; 0x35 36fdc: 84 60 ori r24, 0x04 ; 4 36fde: 85 ab std Z+53, r24 ; 0x35 36fe0: a9 a5 ldd r26, Y+41 ; 0x29 36fe2: ad af std Y+61, r26 ; 0x3d 36fe4: bd a5 ldd r27, Y+45 ; 0x2d 36fe6: bd ab std Y+53, r27 ; 0x35 36fe8: e9 a9 ldd r30, Y+49 ; 0x31 36fea: ee af std Y+62, r30 ; 0x3e 36fec: f9 ad ldd r31, Y+57 ; 0x39 36fee: 23 96 adiw r28, 0x03 ; 3 36ff0: ff af std Y+63, r31 ; 0x3f 36ff2: 23 97 sbiw r28, 0x03 ; 3 36ff4: bc ca rjmp .-2696 ; 0x3656e // 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; 36ff6: 81 e0 ldi r24, 0x01 ; 1 36ff8: 30 cb rjmp .-2464 ; 0x3665a 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]; 36ffa: 20 91 bf 06 lds r18, 0x06BF ; 0x8006bf 36ffe: 30 91 c0 06 lds r19, 0x06C0 ; 0x8006c0 37002: 40 91 c1 06 lds r20, 0x06C1 ; 0x8006c1 37006: 50 91 c2 06 lds r21, 0x06C2 ; 0x8006c2 3700a: c7 01 movw r24, r14 3700c: b6 01 movw r22, r12 3700e: c1 cb rjmp .-2174 ; 0x36792 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) { 37010: 20 e0 ldi r18, 0x00 ; 0 37012: 30 e4 ldi r19, 0x40 ; 64 37014: 4c e1 ldi r20, 0x1C ; 28 37016: 56 e4 ldi r21, 0x46 ; 70 37018: c7 01 movw r24, r14 3701a: b6 01 movw r22, r12 3701c: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 37020: 18 16 cp r1, r24 37022: d4 f4 brge .+52 ; 0x37058 block->advance_rate = advance_rate * 2; 37024: 8e e6 ldi r24, 0x6E ; 110 37026: 82 9d mul r24, r2 37028: 80 01 movw r16, r0 3702a: 83 9d mul r24, r3 3702c: 10 0d add r17, r0 3702e: 11 24 eor r1, r1 37030: 0d 58 subi r16, 0x8D ; 141 37032: 18 4f sbci r17, 0xF8 ; 248 37034: 78 01 movw r14, r16 37036: bd e4 ldi r27, 0x4D ; 77 37038: eb 0e add r14, r27 3703a: f1 1c adc r15, r1 3703c: a5 01 movw r20, r10 3703e: 94 01 movw r18, r8 37040: c5 01 movw r24, r10 37042: b4 01 movw r22, r8 37044: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 37048: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3704c: f7 01 movw r30, r14 3704e: 71 83 std Z+1, r23 ; 0x01 37050: 60 83 st Z, r22 block->advance_step_loops = 2; 37052: 36 96 adiw r30, 0x06 ; 6 37054: 82 e0 ldi r24, 0x02 ; 2 37056: e2 cb rjmp .-2108 ; 0x3681c } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 37058: 20 e0 ldi r18, 0x00 ; 0 3705a: 3f ef ldi r19, 0xFF ; 255 3705c: 4f e7 ldi r20, 0x7F ; 127 3705e: 57 e4 ldi r21, 0x47 ; 71 37060: c5 01 movw r24, r10 37062: b4 01 movw r22, r8 37064: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 37068: 87 ff sbrs r24, 7 3706a: 19 c0 rjmp .+50 ; 0x3709e block->advance_rate = advance_rate; 3706c: 8e e6 ldi r24, 0x6E ; 110 3706e: 82 9d mul r24, r2 37070: 80 01 movw r16, r0 37072: 83 9d mul r24, r3 37074: 10 0d add r17, r0 37076: 11 24 eor r1, r1 37078: 00 54 subi r16, 0x40 ; 64 3707a: 18 4f sbci r17, 0xF8 ; 248 3707c: c5 01 movw r24, r10 3707e: b4 01 movw r22, r8 37080: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 37084: d8 01 movw r26, r16 37086: 6d 93 st X+, r22 37088: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 3708a: 8e e6 ldi r24, 0x6E ; 110 3708c: 82 9d mul r24, r2 3708e: f0 01 movw r30, r0 37090: 83 9d mul r24, r3 37092: f0 0d add r31, r0 37094: 11 24 eor r1, r1 37096: ea 53 subi r30, 0x3A ; 58 37098: f8 4f sbci r31, 0xF8 ; 248 3709a: 81 e0 ldi r24, 0x01 ; 1 3709c: bf cb rjmp .-2178 ; 0x3681c { // 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; 3709e: 8e e6 ldi r24, 0x6E ; 110 370a0: 82 9d mul r24, r2 370a2: f0 01 movw r30, r0 370a4: 83 9d mul r24, r3 370a6: f0 0d add r31, r0 370a8: 11 24 eor r1, r1 370aa: e0 54 subi r30, 0x40 ; 64 370ac: f8 4f sbci r31, 0xF8 ; 248 370ae: 8f ef ldi r24, 0xFF ; 255 370b0: 9f ef ldi r25, 0xFF ; 255 370b2: 91 83 std Z+1, r25 ; 0x01 370b4: 80 83 st Z, r24 370b6: e9 cf rjmp .-46 ; 0x3708a 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) { 370b8: f6 01 movw r30, r12 370ba: 71 a4 ldd r7, Z+41 ; 0x29 370bc: 82 a4 ldd r8, Z+42 ; 0x2a 370be: 93 a4 ldd r9, Z+43 ; 0x2b 370c0: e4 a4 ldd r14, Z+44 ; 0x2c 370c2: 27 2d mov r18, r7 370c4: 38 2d mov r19, r8 370c6: 49 2d mov r20, r9 370c8: 5e 2d mov r21, r14 370ca: 65 a1 ldd r22, Z+37 ; 0x25 370cc: 76 a1 ldd r23, Z+38 ; 0x26 370ce: 87 a1 ldd r24, Z+39 ; 0x27 370d0: 90 a5 ldd r25, Z+40 ; 0x28 370d2: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 370d6: 88 23 and r24, r24 370d8: 09 f4 brne .+2 ; 0x370dc 370da: 51 c0 rjmp .+162 ; 0x3717e // 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) ? 370dc: 01 fd sbrc r16, 1 370de: 44 c0 rjmp .+136 ; 0x37168 370e0: d5 01 movw r26, r10 370e2: 95 96 adiw r26, 0x25 ; 37 370e4: 2d 90 ld r2, X+ 370e6: 3d 90 ld r3, X+ 370e8: 4d 90 ld r4, X+ 370ea: 5c 90 ld r5, X 370ec: 98 97 sbiw r26, 0x28 ; 40 370ee: a2 01 movw r20, r4 370f0: 91 01 movw r18, r2 370f2: 67 2d mov r22, r7 370f4: 78 2d mov r23, r8 370f6: 89 2d mov r24, r9 370f8: 9e 2d mov r25, r14 370fa: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 370fe: 18 16 cp r1, r24 37100: 9c f5 brge .+102 ; 0x37168 // 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); 37102: a2 01 movw r20, r4 37104: 91 01 movw r18, r2 37106: c2 01 movw r24, r4 37108: b1 01 movw r22, r2 3710a: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3710e: 1b 01 movw r2, r22 37110: 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)); 37112: f6 01 movw r30, r12 37114: 61 a9 ldd r22, Z+49 ; 0x31 37116: 72 a9 ldd r23, Z+50 ; 0x32 37118: 83 a9 ldd r24, Z+51 ; 0x33 3711a: 94 a9 ldd r25, Z+52 ; 0x34 3711c: 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); 3711e: 9b 01 movw r18, r22 37120: ac 01 movw r20, r24 37122: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 37126: d6 01 movw r26, r12 37128: 9d 96 adiw r26, 0x2d ; 45 3712a: 2d 91 ld r18, X+ 3712c: 3d 91 ld r19, X+ 3712e: 4d 91 ld r20, X+ 37130: 5c 91 ld r21, X 37132: d0 97 sbiw r26, 0x30 ; 48 37134: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 37138: 9b 01 movw r18, r22 3713a: ac 01 movw r20, r24 3713c: c2 01 movw r24, r4 3713e: b1 01 movw r22, r2 37140: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 37144: 0f 94 05 e2 call 0x3c40a ; 0x3c40a 37148: 2b 01 movw r4, r22 3714a: 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)); 3714c: 9b 01 movw r18, r22 3714e: ac 01 movw r20, r24 37150: 67 2d mov r22, r7 37152: 78 2d mov r23, r8 37154: 89 2d mov r24, r9 37156: 9e 2d mov r25, r14 37158: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 3715c: 87 fd sbrc r24, 7 3715e: 04 c0 rjmp .+8 ; 0x37168 37160: 74 2c mov r7, r4 37162: 85 2c mov r8, r5 37164: 9a 2c mov r9, r10 37166: 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) ? 37168: 87 2d mov r24, r7 3716a: 98 2d mov r25, r8 3716c: a9 2d mov r26, r9 3716e: be 2d mov r27, r14 37170: f6 01 movw r30, r12 37172: 85 a3 std Z+37, r24 ; 0x25 37174: 96 a3 std Z+38, r25 ; 0x26 37176: a7 a3 std Z+39, r26 ; 0x27 37178: 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; 3717a: 01 60 ori r16, 0x01 ; 1 3717c: 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) 3717e: 11 11 cpse r17, r1 37180: 01 c0 rjmp .+2 ; 0x37184 block_index = BLOCK_BUFFER_SIZE; 37182: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37184: 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)); 37186: 16 9d mul r17, r6 37188: c0 01 movw r24, r0 3718a: 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; 3718c: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 3718e: 9c 01 movw r18, r24 37190: 2d 58 subi r18, 0x8D ; 141 37192: 38 4f sbci r19, 0xF8 ; 248 37194: 69 01 movw r12, r18 37196: 0b cc rjmp .-2026 ; 0x369ae 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)); 37198: 6c 01 movw r12, r24 3719a: 2f cc rjmp .-1954 ; 0x369fa 3719c: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 3719e: 0d 94 23 ab jmp 0x35646 ; 0x35646 000371a2 : 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(){ 371a2: 4f 92 push r4 371a4: 5f 92 push r5 371a6: 6f 92 push r6 371a8: 7f 92 push r7 371aa: 8f 92 push r8 371ac: 9f 92 push r9 371ae: af 92 push r10 371b0: bf 92 push r11 371b2: cf 92 push r12 371b4: df 92 push r13 371b6: ef 92 push r14 371b8: ff 92 push r15 371ba: cf 93 push r28 371bc: df 93 push r29 371be: cd b7 in r28, 0x3d ; 61 371c0: de b7 in r29, 0x3e ; 62 371c2: 2c 97 sbiw r28, 0x0c ; 12 371c4: 0f b6 in r0, 0x3f ; 63 371c6: f8 94 cli 371c8: de bf out 0x3e, r29 ; 62 371ca: 0f be out 0x3f, r0 ; 63 371cc: 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]); 371ce: c0 90 48 07 lds r12, 0x0748 ; 0x800748 371d2: d0 90 49 07 lds r13, 0x0749 ; 0x800749 371d6: e0 90 4a 07 lds r14, 0x074A ; 0x80074a 371da: f0 90 4b 07 lds r15, 0x074B ; 0x80074b 371de: 80 91 44 07 lds r24, 0x0744 ; 0x800744 371e2: 90 91 45 07 lds r25, 0x0745 ; 0x800745 371e6: a0 91 46 07 lds r26, 0x0746 ; 0x800746 371ea: b0 91 47 07 lds r27, 0x0747 ; 0x800747 371ee: 40 91 40 07 lds r20, 0x0740 ; 0x800740 371f2: 50 91 41 07 lds r21, 0x0741 ; 0x800741 371f6: 60 91 42 07 lds r22, 0x0742 ; 0x800742 371fa: 70 91 43 07 lds r23, 0x0743 ; 0x800743 371fe: 4d 83 std Y+5, r20 ; 0x05 37200: 5e 83 std Y+6, r21 ; 0x06 37202: 6f 83 std Y+7, r22 ; 0x07 37204: 78 87 std Y+8, r23 ; 0x08 37206: 89 83 std Y+1, r24 ; 0x01 37208: 9a 83 std Y+2, r25 ; 0x02 3720a: ab 83 std Y+3, r26 ; 0x03 3720c: 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); 3720e: be 01 movw r22, r28 37210: 6f 5f subi r22, 0xFF ; 255 37212: 7f 4f sbci r23, 0xFF ; 255 37214: ce 01 movw r24, r28 37216: 05 96 adiw r24, 0x05 ; 5 37218: 0e 94 48 6b call 0xd690 ; 0xd690 position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 3721c: 4d 80 ldd r4, Y+5 ; 0x05 3721e: 5e 80 ldd r5, Y+6 ; 0x06 37220: 6f 80 ldd r6, Y+7 ; 0x07 37222: 78 84 ldd r7, Y+8 ; 0x08 37224: 20 91 6f 06 lds r18, 0x066F ; 0x80066f 37228: 30 91 70 06 lds r19, 0x0670 ; 0x800670 3722c: 40 91 71 06 lds r20, 0x0671 ; 0x800671 37230: 50 91 72 06 lds r21, 0x0672 ; 0x800672 37234: c3 01 movw r24, r6 37236: b2 01 movw r22, r4 37238: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3723c: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 37240: 60 93 51 07 sts 0x0751, r22 ; 0x800751 37244: 70 93 52 07 sts 0x0752, r23 ; 0x800752 37248: 80 93 53 07 sts 0x0753, r24 ; 0x800753 3724c: 90 93 54 07 sts 0x0754, r25 ; 0x800754 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 37250: 89 80 ldd r8, Y+1 ; 0x01 37252: 9a 80 ldd r9, Y+2 ; 0x02 37254: ab 80 ldd r10, Y+3 ; 0x03 37256: bc 80 ldd r11, Y+4 ; 0x04 37258: 20 91 73 06 lds r18, 0x0673 ; 0x800673 3725c: 30 91 74 06 lds r19, 0x0674 ; 0x800674 37260: 40 91 75 06 lds r20, 0x0675 ; 0x800675 37264: 50 91 76 06 lds r21, 0x0676 ; 0x800676 37268: c5 01 movw r24, r10 3726a: b4 01 movw r22, r8 3726c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 37270: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 37274: 60 93 55 07 sts 0x0755, r22 ; 0x800755 37278: 70 93 56 07 sts 0x0756, r23 ; 0x800756 3727c: 80 93 57 07 sts 0x0757, r24 ; 0x800757 37280: 90 93 58 07 sts 0x0758, r25 ; 0x800758 #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 37284: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 37288: 88 23 and r24, r24 3728a: 09 f4 brne .+2 ; 0x3728e 3728c: 8c c0 rjmp .+280 ; 0x373a6 lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 3728e: a5 01 movw r20, r10 37290: 94 01 movw r18, r8 37292: c3 01 movw r24, r6 37294: b2 01 movw r22, r4 37296: 0f 94 d1 95 call 0x32ba2 ; 0x32ba2 3729a: 9b 01 movw r18, r22 3729c: ac 01 movw r20, r24 3729e: c7 01 movw r24, r14 372a0: b6 01 movw r22, r12 372a2: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 372a6: 20 91 77 06 lds r18, 0x0677 ; 0x800677 372aa: 30 91 78 06 lds r19, 0x0678 ; 0x800678 372ae: 40 91 79 06 lds r20, 0x0679 ; 0x800679 372b2: 50 91 7a 06 lds r21, 0x067A ; 0x80067a lround(z*cs.axis_steps_per_mm[Z_AXIS]); 372b6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__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 ? 372ba: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 372be: 60 93 59 07 sts 0x0759, r22 ; 0x800759 372c2: 70 93 5a 07 sts 0x075A, r23 ; 0x80075a 372c6: 80 93 5b 07 sts 0x075B, r24 ; 0x80075b 372ca: 90 93 5c 07 sts 0x075C, r25 ; 0x80075c 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]); 372ce: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 372d2: 90 91 4d 07 lds r25, 0x074D ; 0x80074d 372d6: a0 91 4e 07 lds r26, 0x074E ; 0x80074e 372da: b0 91 4f 07 lds r27, 0x074F ; 0x80074f 372de: 89 87 std Y+9, r24 ; 0x09 372e0: 9a 87 std Y+10, r25 ; 0x0a 372e2: ab 87 std Y+11, r26 ; 0x0b 372e4: bc 87 std Y+12, r27 ; 0x0c 372e6: 20 91 7b 06 lds r18, 0x067B ; 0x80067b 372ea: 30 91 7c 06 lds r19, 0x067C ; 0x80067c 372ee: 40 91 7d 06 lds r20, 0x067D ; 0x80067d 372f2: 50 91 7e 06 lds r21, 0x067E ; 0x80067e 372f6: bc 01 movw r22, r24 372f8: cd 01 movw r24, r26 372fa: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 372fe: 0f 94 74 e1 call 0x3c2e8 ; 0x3c2e8 37302: 60 93 5d 07 sts 0x075D, r22 ; 0x80075d 37306: 70 93 5e 07 sts 0x075E, r23 ; 0x80075e 3730a: 80 93 5f 07 sts 0x075F, r24 ; 0x80075f 3730e: 90 93 60 07 sts 0x0760, r25 ; 0x800760 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37312: 40 92 cd 04 sts 0x04CD, r4 ; 0x8004cd 37316: 50 92 ce 04 sts 0x04CE, r5 ; 0x8004ce 3731a: 60 92 cf 04 sts 0x04CF, r6 ; 0x8004cf 3731e: 70 92 d0 04 sts 0x04D0, r7 ; 0x8004d0 position_float[Y_AXIS] = y; 37322: 80 92 d1 04 sts 0x04D1, r8 ; 0x8004d1 37326: 90 92 d2 04 sts 0x04D2, r9 ; 0x8004d2 3732a: a0 92 d3 04 sts 0x04D3, r10 ; 0x8004d3 3732e: b0 92 d4 04 sts 0x04D4, r11 ; 0x8004d4 position_float[Z_AXIS] = z; 37332: c0 92 d5 04 sts 0x04D5, r12 ; 0x8004d5 37336: d0 92 d6 04 sts 0x04D6, r13 ; 0x8004d6 3733a: e0 92 d7 04 sts 0x04D7, r14 ; 0x8004d7 3733e: f0 92 d8 04 sts 0x04D8, r15 ; 0x8004d8 position_float[E_AXIS] = e; 37342: 89 85 ldd r24, Y+9 ; 0x09 37344: 9a 85 ldd r25, Y+10 ; 0x0a 37346: ab 85 ldd r26, Y+11 ; 0x0b 37348: bc 85 ldd r27, Y+12 ; 0x0c 3734a: 80 93 d9 04 sts 0x04D9, r24 ; 0x8004d9 3734e: 90 93 da 04 sts 0x04DA, r25 ; 0x8004da 37352: a0 93 db 04 sts 0x04DB, r26 ; 0x8004db 37356: b0 93 dc 04 sts 0x04DC, r27 ; 0x8004dc #endif st_set_position(position); 3735a: 0f 94 3b 87 call 0x30e76 ; 0x30e76 previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 3735e: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.504> 37362: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.504+0x1> 37366: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.504+0x2> 3736a: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.504+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 3736e: ed eb ldi r30, 0xBD ; 189 37370: f4 e0 ldi r31, 0x04 ; 4 37372: 80 e1 ldi r24, 0x10 ; 16 37374: df 01 movw r26, r30 37376: 1d 92 st X+, r1 37378: 8a 95 dec r24 3737a: e9 f7 brne .-6 ; 0x37376 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]); } 3737c: 2c 96 adiw r28, 0x0c ; 12 3737e: 0f b6 in r0, 0x3f ; 63 37380: f8 94 cli 37382: de bf out 0x3e, r29 ; 62 37384: 0f be out 0x3f, r0 ; 63 37386: cd bf out 0x3d, r28 ; 61 37388: df 91 pop r29 3738a: cf 91 pop r28 3738c: ff 90 pop r15 3738e: ef 90 pop r14 37390: df 90 pop r13 37392: cf 90 pop r12 37394: bf 90 pop r11 37396: af 90 pop r10 37398: 9f 90 pop r9 3739a: 8f 90 pop r8 3739c: 7f 90 pop r7 3739e: 6f 90 pop r6 373a0: 5f 90 pop r5 373a2: 4f 90 pop r4 373a4: 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]); 373a6: 20 91 77 06 lds r18, 0x0677 ; 0x800677 373aa: 30 91 78 06 lds r19, 0x0678 ; 0x800678 373ae: 40 91 79 06 lds r20, 0x0679 ; 0x800679 373b2: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 373b6: c7 01 movw r24, r14 373b8: b6 01 movw r22, r12 373ba: 7d cf rjmp .-262 ; 0x372b6 000373bc : 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) { 373bc: 8f 92 push r8 373be: 9f 92 push r9 373c0: af 92 push r10 373c2: bf 92 push r11 373c4: cf 92 push r12 373c6: df 92 push r13 373c8: ef 92 push r14 373ca: ff 92 push r15 373cc: 0f 93 push r16 373ce: 1f 93 push r17 373d0: 4b 01 movw r8, r22 373d2: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 373d4: e1 e5 ldi r30, 0x51 ; 81 373d6: f5 e0 ldi r31, 0x05 ; 5 373d8: e0 84 ldd r14, Z+8 ; 0x08 373da: f1 84 ldd r15, Z+9 ; 0x09 373dc: 02 85 ldd r16, Z+10 ; 0x0a 373de: 13 85 ldd r17, Z+11 ; 0x0b 373e0: 24 81 ldd r18, Z+4 ; 0x04 373e2: 35 81 ldd r19, Z+5 ; 0x05 373e4: 46 81 ldd r20, Z+6 ; 0x06 373e6: 57 81 ldd r21, Z+7 ; 0x07 373e8: 60 81 ld r22, Z 373ea: 71 81 ldd r23, Z+1 ; 0x01 373ec: 82 81 ldd r24, Z+2 ; 0x02 373ee: 93 81 ldd r25, Z+3 ; 0x03 373f0: 1f 92 push r1 373f2: 1f 92 push r1 373f4: 1f 92 push r1 373f6: 1f 92 push r1 373f8: ed e5 ldi r30, 0x5D ; 93 373fa: ce 2e mov r12, r30 373fc: e5 e0 ldi r30, 0x05 ; 5 373fe: de 2e mov r13, r30 37400: 0f 94 bc aa call 0x35578 ; 0x35578 37404: 0f 90 pop r0 37406: 0f 90 pop r0 37408: 0f 90 pop r0 3740a: 0f 90 pop r0 } 3740c: 1f 91 pop r17 3740e: 0f 91 pop r16 37410: ff 90 pop r15 37412: ef 90 pop r14 37414: df 90 pop r13 37416: cf 90 pop r12 37418: bf 90 pop r11 3741a: af 90 pop r10 3741c: 9f 90 pop r9 3741e: 8f 90 pop r8 37420: 08 95 ret 00037422 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 37422: 8f 92 push r8 37424: 9f 92 push r9 37426: af 92 push r10 37428: bf 92 push r11 3742a: cf 92 push r12 3742c: df 92 push r13 3742e: ef 92 push r14 37430: ff 92 push r15 37432: 0f 93 push r16 37434: 1f 93 push r17 37436: 4b 01 movw r8, r22 37438: 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); 3743a: e0 e4 ldi r30, 0x40 ; 64 3743c: f7 e0 ldi r31, 0x07 ; 7 3743e: e0 84 ldd r14, Z+8 ; 0x08 37440: f1 84 ldd r15, Z+9 ; 0x09 37442: 02 85 ldd r16, Z+10 ; 0x0a 37444: 13 85 ldd r17, Z+11 ; 0x0b 37446: 24 81 ldd r18, Z+4 ; 0x04 37448: 35 81 ldd r19, Z+5 ; 0x05 3744a: 46 81 ldd r20, Z+6 ; 0x06 3744c: 57 81 ldd r21, Z+7 ; 0x07 3744e: 60 81 ld r22, Z 37450: 71 81 ldd r23, Z+1 ; 0x01 37452: 82 81 ldd r24, Z+2 ; 0x02 37454: 93 81 ldd r25, Z+3 ; 0x03 37456: 1f 92 push r1 37458: 1f 92 push r1 3745a: 1f 92 push r1 3745c: 1f 92 push r1 3745e: ec e4 ldi r30, 0x4C ; 76 37460: ce 2e mov r12, r30 37462: e7 e0 ldi r30, 0x07 ; 7 37464: de 2e mov r13, r30 37466: 0f 94 bc aa call 0x35578 ; 0x35578 3746a: 0f 90 pop r0 3746c: 0f 90 pop r0 3746e: 0f 90 pop r0 37470: 0f 90 pop r0 } 37472: 1f 91 pop r17 37474: 0f 91 pop r16 37476: ff 90 pop r15 37478: ef 90 pop r14 3747a: df 90 pop r13 3747c: cf 90 pop r12 3747e: bf 90 pop r11 37480: af 90 pop r10 37482: 9f 90 pop r9 37484: 8f 90 pop r8 37486: 08 95 ret 00037488 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 37488: 4f 92 push r4 3748a: 5f 92 push r5 3748c: 6f 92 push r6 3748e: 7f 92 push r7 37490: 8f 92 push r8 37492: 9f 92 push r9 37494: af 92 push r10 37496: bf 92 push r11 37498: cf 92 push r12 3749a: df 92 push r13 3749c: ef 92 push r14 3749e: ff 92 push r15 374a0: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 374a2: 80 e0 ldi r24, 0x00 ; 0 374a4: 0f 94 b9 57 call 0x2af72 ; 0x2af72 374a8: 60 93 51 07 sts 0x0751, r22 ; 0x800751 374ac: 70 93 52 07 sts 0x0752, r23 ; 0x800752 374b0: 80 93 53 07 sts 0x0753, r24 ; 0x800753 374b4: 90 93 54 07 sts 0x0754, r25 ; 0x800754 position[Y_AXIS] = st_get_position(Y_AXIS); 374b8: 81 e0 ldi r24, 0x01 ; 1 374ba: 0f 94 b9 57 call 0x2af72 ; 0x2af72 374be: 60 93 55 07 sts 0x0755, r22 ; 0x800755 374c2: 70 93 56 07 sts 0x0756, r23 ; 0x800756 374c6: 80 93 57 07 sts 0x0757, r24 ; 0x800757 374ca: 90 93 58 07 sts 0x0758, r25 ; 0x800758 position[Z_AXIS] = st_get_position(Z_AXIS); 374ce: 82 e0 ldi r24, 0x02 ; 2 374d0: 0f 94 b9 57 call 0x2af72 ; 0x2af72 374d4: 60 93 59 07 sts 0x0759, r22 ; 0x800759 374d8: 70 93 5a 07 sts 0x075A, r23 ; 0x80075a 374dc: 80 93 5b 07 sts 0x075B, r24 ; 0x80075b 374e0: 90 93 5c 07 sts 0x075C, r25 ; 0x80075c position[E_AXIS] = st_get_position(E_AXIS); 374e4: 83 e0 ldi r24, 0x03 ; 3 374e6: 0f 94 b9 57 call 0x2af72 ; 0x2af72 374ea: 60 93 5d 07 sts 0x075D, r22 ; 0x80075d 374ee: 70 93 5e 07 sts 0x075E, r23 ; 0x80075e 374f2: 80 93 5f 07 sts 0x075F, r24 ; 0x80075f 374f6: 90 93 60 07 sts 0x0760, r25 ; 0x800760 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 374fa: 80 e0 ldi r24, 0x00 ; 0 374fc: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 37500: 60 93 40 07 sts 0x0740, r22 ; 0x800740 37504: 70 93 41 07 sts 0x0741, r23 ; 0x800741 37508: 80 93 42 07 sts 0x0742, r24 ; 0x800742 3750c: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 37510: 81 e0 ldi r24, 0x01 ; 1 37512: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 37516: 60 93 44 07 sts 0x0744, r22 ; 0x800744 3751a: 70 93 45 07 sts 0x0745, r23 ; 0x800745 3751e: 80 93 46 07 sts 0x0746, r24 ; 0x800746 37522: 90 93 47 07 sts 0x0747, r25 ; 0x800747 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 37526: 82 e0 ldi r24, 0x02 ; 2 37528: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 3752c: 60 93 48 07 sts 0x0748, r22 ; 0x800748 37530: 70 93 49 07 sts 0x0749, r23 ; 0x800749 37534: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 37538: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b current_position[E_AXIS] = st_get_position_mm(E_AXIS); 3753c: 83 e0 ldi r24, 0x03 ; 3 3753e: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 37542: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 37546: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 3754a: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 3754e: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 37552: 80 91 9d 13 lds r24, 0x139D ; 0x80139d 37556: 88 23 and r24, r24 37558: 31 f1 breq .+76 ; 0x375a6 #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]); 3755a: 20 91 44 07 lds r18, 0x0744 ; 0x800744 3755e: 30 91 45 07 lds r19, 0x0745 ; 0x800745 37562: 40 91 46 07 lds r20, 0x0746 ; 0x800746 37566: 50 91 47 07 lds r21, 0x0747 ; 0x800747 3756a: 60 91 40 07 lds r22, 0x0740 ; 0x800740 3756e: 70 91 41 07 lds r23, 0x0741 ; 0x800741 37572: 80 91 42 07 lds r24, 0x0742 ; 0x800742 37576: 90 91 43 07 lds r25, 0x0743 ; 0x800743 3757a: 0f 94 d1 95 call 0x32ba2 ; 0x32ba2 3757e: 9b 01 movw r18, r22 37580: ac 01 movw r20, r24 37582: 60 91 48 07 lds r22, 0x0748 ; 0x800748 37586: 70 91 49 07 lds r23, 0x0749 ; 0x800749 3758a: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3758e: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 37592: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 37596: 60 93 48 07 sts 0x0748, r22 ; 0x800748 3759a: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3759e: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 375a2: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 375a6: c0 91 e8 17 lds r28, 0x17E8 ; 0x8017e8 375aa: cc 23 and r28, r28 375ac: 09 f4 brne .+2 ; 0x375b0 375ae: 9a c0 rjmp .+308 ; 0x376e4 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 375b0: c0 ff sbrs r28, 0 375b2: 34 c0 rjmp .+104 ; 0x3761c // Then add the offset. x -= world2machine_shift[0]; 375b4: 20 91 e0 17 lds r18, 0x17E0 ; 0x8017e0 375b8: 30 91 e1 17 lds r19, 0x17E1 ; 0x8017e1 375bc: 40 91 e2 17 lds r20, 0x17E2 ; 0x8017e2 375c0: 50 91 e3 17 lds r21, 0x17E3 ; 0x8017e3 375c4: 60 91 40 07 lds r22, 0x0740 ; 0x800740 375c8: 70 91 41 07 lds r23, 0x0741 ; 0x800741 375cc: 80 91 42 07 lds r24, 0x0742 ; 0x800742 375d0: 90 91 43 07 lds r25, 0x0743 ; 0x800743 375d4: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 375d8: 60 93 40 07 sts 0x0740, r22 ; 0x800740 375dc: 70 93 41 07 sts 0x0741, r23 ; 0x800741 375e0: 80 93 42 07 sts 0x0742, r24 ; 0x800742 375e4: 90 93 43 07 sts 0x0743, r25 ; 0x800743 y -= world2machine_shift[1]; 375e8: 20 91 e4 17 lds r18, 0x17E4 ; 0x8017e4 375ec: 30 91 e5 17 lds r19, 0x17E5 ; 0x8017e5 375f0: 40 91 e6 17 lds r20, 0x17E6 ; 0x8017e6 375f4: 50 91 e7 17 lds r21, 0x17E7 ; 0x8017e7 375f8: 60 91 44 07 lds r22, 0x0744 ; 0x800744 375fc: 70 91 45 07 lds r23, 0x0745 ; 0x800745 37600: 80 91 46 07 lds r24, 0x0746 ; 0x800746 37604: 90 91 47 07 lds r25, 0x0747 ; 0x800747 37608: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 3760c: 60 93 44 07 sts 0x0744, r22 ; 0x800744 37610: 70 93 45 07 sts 0x0745, r23 ; 0x800745 37614: 80 93 46 07 sts 0x0746, r24 ; 0x800746 37618: 90 93 47 07 sts 0x0747, r25 ; 0x800747 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 3761c: c1 ff sbrs r28, 1 3761e: 62 c0 rjmp .+196 ; 0x376e4 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 37620: 80 90 40 07 lds r8, 0x0740 ; 0x800740 37624: 90 90 41 07 lds r9, 0x0741 ; 0x800741 37628: a0 90 42 07 lds r10, 0x0742 ; 0x800742 3762c: b0 90 43 07 lds r11, 0x0743 ; 0x800743 37630: c0 90 44 07 lds r12, 0x0744 ; 0x800744 37634: d0 90 45 07 lds r13, 0x0745 ; 0x800745 37638: e0 90 46 07 lds r14, 0x0746 ; 0x800746 3763c: f0 90 47 07 lds r15, 0x0747 ; 0x800747 float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 37640: 20 91 d8 17 lds r18, 0x17D8 ; 0x8017d8 37644: 30 91 d9 17 lds r19, 0x17D9 ; 0x8017d9 37648: 40 91 da 17 lds r20, 0x17DA ; 0x8017da 3764c: 50 91 db 17 lds r21, 0x17DB ; 0x8017db 37650: c5 01 movw r24, r10 37652: b4 01 movw r22, r8 37654: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 37658: 2b 01 movw r4, r22 3765a: 3c 01 movw r6, r24 3765c: 20 91 dc 17 lds r18, 0x17DC ; 0x8017dc 37660: 30 91 dd 17 lds r19, 0x17DD ; 0x8017dd 37664: 40 91 de 17 lds r20, 0x17DE ; 0x8017de 37668: 50 91 df 17 lds r21, 0x17DF ; 0x8017df 3766c: c7 01 movw r24, r14 3766e: b6 01 movw r22, r12 37670: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 37674: 9b 01 movw r18, r22 37676: ac 01 movw r20, r24 37678: c3 01 movw r24, r6 3767a: b2 01 movw r22, r4 3767c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 37680: 2b 01 movw r4, r22 37682: 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; 37684: 20 91 d0 17 lds r18, 0x17D0 ; 0x8017d0 37688: 30 91 d1 17 lds r19, 0x17D1 ; 0x8017d1 3768c: 40 91 d2 17 lds r20, 0x17D2 ; 0x8017d2 37690: 50 91 d3 17 lds r21, 0x17D3 ; 0x8017d3 37694: c5 01 movw r24, r10 37696: b4 01 movw r22, r8 37698: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3769c: 4b 01 movw r8, r22 3769e: 5c 01 movw r10, r24 376a0: 20 91 d4 17 lds r18, 0x17D4 ; 0x8017d4 376a4: 30 91 d5 17 lds r19, 0x17D5 ; 0x8017d5 376a8: 40 91 d6 17 lds r20, 0x17D6 ; 0x8017d6 376ac: 50 91 d7 17 lds r21, 0x17D7 ; 0x8017d7 376b0: c7 01 movw r24, r14 376b2: b6 01 movw r22, r12 376b4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 376b8: 9b 01 movw r18, r22 376ba: ac 01 movw r20, r24 376bc: c5 01 movw r24, r10 376be: b4 01 movw r22, r8 376c0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 376c4: 60 93 40 07 sts 0x0740, r22 ; 0x800740 376c8: 70 93 41 07 sts 0x0741, r23 ; 0x800741 376cc: 80 93 42 07 sts 0x0742, r24 ; 0x800742 376d0: 90 93 43 07 sts 0x0743, r25 ; 0x800743 y = out_y; 376d4: 40 92 44 07 sts 0x0744, r4 ; 0x800744 376d8: 50 92 45 07 sts 0x0745, r5 ; 0x800745 376dc: 60 92 46 07 sts 0x0746, r6 ; 0x800746 376e0: 70 92 47 07 sts 0x0747, r7 ; 0x800747 } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 376e4: 0e 94 80 69 call 0xd300 ; 0xd300 #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 376e8: 80 e1 ldi r24, 0x10 ; 16 376ea: e0 e4 ldi r30, 0x40 ; 64 376ec: f7 e0 ldi r31, 0x07 ; 7 376ee: ad ec ldi r26, 0xCD ; 205 376f0: b4 e0 ldi r27, 0x04 ; 4 376f2: 01 90 ld r0, Z+ 376f4: 0d 92 st X+, r0 376f6: 8a 95 dec r24 376f8: e1 f7 brne .-8 ; 0x376f2 #endif } 376fa: cf 91 pop r28 376fc: ff 90 pop r15 376fe: ef 90 pop r14 37700: df 90 pop r13 37702: cf 90 pop r12 37704: bf 90 pop r11 37706: af 90 pop r10 37708: 9f 90 pop r9 3770a: 8f 90 pop r8 3770c: 7f 90 pop r7 3770e: 6f 90 pop r6 37710: 5f 90 pop r5 37712: 4f 90 pop r4 37714: 08 95 ret 00037716 : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 37716: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3771a: 8d 7f andi r24, 0xFD ; 253 3771c: 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(); 37720: 0f 94 44 ba call 0x37488 ; 0x37488 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 37724: 81 e0 ldi r24, 0x01 ; 1 37726: 80 93 5a 0e sts 0x0E5A, r24 ; 0x800e5a } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 3772a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3772e: 8d 7f andi r24, 0xFD ; 253 37730: 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); 37734: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 37738: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 while (blocks_queued()) plan_discard_current_block(); 3773c: 98 17 cp r25, r24 3773e: 69 f0 breq .+26 ; 0x3775a 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) { 37740: 90 91 53 0e lds r25, 0x0E53 ; 0x800e53 37744: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 37748: 98 17 cp r25, r24 3774a: a1 f3 breq .-24 ; 0x37734 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 3774c: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 37750: 8f 5f subi r24, 0xFF ; 255 37752: 8f 70 andi r24, 0x0F ; 15 37754: 80 93 54 0e sts 0x0E54, r24 ; 0x800e54 37758: ed cf rjmp .-38 ; 0x37734 current_block = NULL; 3775a: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 3775e: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 37762: 8f ef ldi r24, 0xFF ; 255 37764: 9f ef ldi r25, 0xFF ; 255 37766: 90 93 e4 04 sts 0x04E4, r25 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.490+0x1> 3776a: 80 93 e3 04 sts 0x04E3, r24 ; 0x8004e3 <_ZL14nextAdvanceISR.lto_priv.490> current_adv_steps = 0; 3776e: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.492+0x1> 37772: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df <_ZL17current_adv_steps.lto_priv.492> #endif st_reset_timer(); 37776: 0f 94 35 58 call 0x2b06a ; 0x2b06a ENABLE_STEPPER_DRIVER_INTERRUPT(); 3777a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3777e: 82 60 ori r24, 0x02 ; 2 37780: 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; 37784: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL22previous_nominal_speed.lto_priv.504> 37788: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.504+0x1> 3778c: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.504+0x2> 37790: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.504+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37794: ed eb ldi r30, 0xBD ; 189 37796: f4 e0 ldi r31, 0x04 ; 4 37798: 80 e1 ldi r24, 0x10 ; 16 3779a: df 01 movw r26, r30 3779c: 1d 92 st X+, r1 3779e: 8a 95 dec r24 377a0: e9 f7 brne .-6 ; 0x3779c // Reset position sync requests plan_reset_next_e_queue = false; 377a2: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_queue.lto_priv.502> plan_reset_next_e_sched = false; 377a6: 10 92 b7 04 sts 0x04B7, r1 ; 0x8004b7 <_ZL23plan_reset_next_e_sched.lto_priv.503> } 377aa: 08 95 ret 000377ac <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 377ac: 1f 92 push r1 377ae: 0f 92 push r0 377b0: 0f b6 in r0, 0x3f ; 63 377b2: 0f 92 push r0 377b4: 11 24 eor r1, r1 377b6: 0b b6 in r0, 0x3b ; 59 377b8: 0f 92 push r0 377ba: 8f 92 push r8 377bc: 9f 92 push r9 377be: af 92 push r10 377c0: bf 92 push r11 377c2: cf 92 push r12 377c4: df 92 push r13 377c6: ef 92 push r14 377c8: ff 92 push r15 377ca: 0f 93 push r16 377cc: 1f 93 push r17 377ce: 2f 93 push r18 377d0: 3f 93 push r19 377d2: 4f 93 push r20 377d4: 5f 93 push r21 377d6: 6f 93 push r22 377d8: 7f 93 push r23 377da: 8f 93 push r24 377dc: 9f 93 push r25 377de: af 93 push r26 377e0: bf 93 push r27 377e2: cf 93 push r28 377e4: df 93 push r29 377e6: ef 93 push r30 377e8: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 377ea: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 377ec: 82 ea ldi r24, 0xA2 ; 162 377ee: 90 e9 ldi r25, 0x90 ; 144 377f0: 0e 94 97 7b call 0xf72e ; 0xf72e if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 377f4: 85 ea ldi r24, 0xA5 ; 165 377f6: 9f e0 ldi r25, 0x0F ; 15 377f8: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 377fc: 18 2f mov r17, r24 377fe: 81 11 cpse r24, r1 37800: de c2 rjmp .+1468 ; 0x37dbe <__vector_5+0x612> { if(printer_active()) { 37802: 0e 94 27 69 call 0xd24e ; 0xd24e 37806: 88 23 and r24, r24 37808: 09 f4 brne .+2 ; 0x3780c <__vector_5+0x60> 3780a: a9 c3 rjmp .+1874 ; 0x37f5e <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 3780c: 0f 94 55 3e call 0x27caa ; 0x27caa 37810: 6b 01 movw r12, r22 37812: 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); 37814: c0 91 57 0e lds r28, 0x0E57 ; 0x800e57 37818: cc 23 and r28, r28 3781a: 31 f0 breq .+12 ; 0x37828 <__vector_5+0x7c> 3781c: c1 e0 ldi r28, 0x01 ; 1 3781e: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 37822: 82 30 cpi r24, 0x02 ; 2 37824: 09 f4 brne .+2 ; 0x37828 <__vector_5+0x7c> 37826: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 37828: d0 91 56 0e lds r29, 0x0E56 ; 0x800e56 3782c: d1 11 cpse r29, r1 3782e: 02 c0 rjmp .+4 ; 0x37834 <__vector_5+0x88> 37830: d0 91 55 0e lds r29, 0x0E55 ; 0x800e55 // Conserve as much power as soon as possible // Turn off the LCD backlight #ifdef LCD_BL_PIN backlightMode = BACKLIGHT_MODE_DIM; 37834: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 37838: 10 92 f9 03 sts 0x03F9, r1 ; 0x8003f9 backlight_update(); 3783c: 0e 94 c2 8b call 0x11784 ; 0x11784 #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 37840: 17 9a sbi 0x02, 7 ; 2 37842: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); 37846: 16 9a sbi 0x02, 6 ; 2 37848: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 3784c: 64 e1 ldi r22, 0x14 ; 20 3784e: 83 e6 ldi r24, 0x63 ; 99 37850: 92 e0 ldi r25, 0x02 ; 2 37852: 0e 94 44 69 call 0xd288 ; 0xd288 currents[Z_AXIS].setiRun(20); 37856: 64 e1 ldi r22, 0x14 ; 20 37858: 83 e6 ldi r24, 0x63 ; 99 3785a: 92 e0 ldi r25, 0x02 ; 2 3785c: 0e 94 4c 69 call 0xd298 ; 0xd298 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 37860: 50 e0 ldi r21, 0x00 ; 0 37862: 40 e0 ldi r20, 0x00 ; 0 37864: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 37868: 82 e0 ldi r24, 0x02 ; 2 3786a: 0f 94 14 39 call 0x27228 ; 0x27228 currents[E_AXIS].setiHold(20); 3786e: 64 e1 ldi r22, 0x14 ; 20 37870: 86 e6 ldi r24, 0x66 ; 102 37872: 92 e0 ldi r25, 0x02 ; 2 37874: 0e 94 44 69 call 0xd288 ; 0xd288 currents[E_AXIS].setiRun(20); 37878: 64 e1 ldi r22, 0x14 ; 20 3787a: 86 e6 ldi r24, 0x66 ; 102 3787c: 92 e0 ldi r25, 0x02 ; 2 3787e: 0e 94 4c 69 call 0xd298 ; 0xd298 tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 37882: 50 e0 ldi r21, 0x00 ; 0 37884: 40 e0 ldi r20, 0x00 ; 0 37886: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 3788a: 83 e0 ldi r24, 0x03 ; 3 3788c: 0f 94 14 39 call 0x27228 ; 0x27228 #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 37890: c1 11 cpse r28, r1 37892: 1b c0 rjmp .+54 ; 0x378ca <__vector_5+0x11e> 37894: 80 91 50 07 lds r24, 0x0750 ; 0x800750 37898: 81 11 cpse r24, r1 3789a: 17 c0 rjmp .+46 ; 0x378ca <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 3789c: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 378a0: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac saved_extruder_temperature = target_temperature[active_extruder]; 378a4: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 378a8: 90 91 6b 0e lds r25, 0x0E6B ; 0x800e6b 378ac: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab 378b0: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 378b4: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 378b8: 83 fb bst r24, 3 378ba: 88 27 eor r24, r24 378bc: 80 f9 bld r24, 0 378be: 80 93 03 18 sts 0x1803, r24 ; 0x801803 saved_fan_speed = fanSpeed; 378c2: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 378c6: 80 93 a9 05 sts 0x05A9, r24 ; 0x8005a9 } // Stop all heaters before continuing disable_heater(); 378ca: 0f 94 21 44 call 0x28842 ; 0x28842 // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 378ce: c1 11 cpse r28, r1 378d0: 04 c0 rjmp .+8 ; 0x378da <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 378d2: 0e 94 80 66 call 0xcd00 ; 0xcd00 // save the global state at planning time save_planner_global_state(); 378d6: 0e 94 36 66 call 0xcc6c ; 0xcc6c } // 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; 378da: 00 91 9d 13 lds r16, 0x139D ; 0x80139d mbl.active = false; 378de: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d // 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(); 378e2: 0f 94 8b bb call 0x37716 ; 0x37716 // 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) 378e6: c1 11 cpse r28, r1 378e8: 1b c0 rjmp .+54 ; 0x37920 <__vector_5+0x174> 378ea: 80 91 50 07 lds r24, 0x0750 ; 0x800750 378ee: 81 11 cpse r24, r1 378f0: 17 c0 rjmp .+46 ; 0x37920 <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 378f2: 80 e1 ldi r24, 0x10 ; 16 378f4: e0 e4 ldi r30, 0x40 ; 64 378f6: f7 e0 ldi r31, 0x07 ; 7 378f8: ab e9 ldi r26, 0x9B ; 155 378fa: b2 e0 ldi r27, 0x02 ; 2 378fc: 01 90 ld r0, Z+ 378fe: 0d 92 st X+, r0 37900: 8a 95 dec r24 37902: e1 f7 brne .-8 ; 0x378fc <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 37904: dd 23 and r29, r29 37906: 61 f0 breq .+24 ; 0x37920 <__vector_5+0x174> 37908: 80 e0 ldi r24, 0x00 ; 0 3790a: 90 e0 ldi r25, 0x00 ; 0 3790c: a0 e8 ldi r26, 0x80 ; 128 3790e: bf eb ldi r27, 0xBF ; 191 37910: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 37914: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 37918: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 3791c: 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]; 37920: 80 90 a3 02 lds r8, 0x02A3 ; 0x8002a3 37924: 90 90 a4 02 lds r9, 0x02A4 ; 0x8002a4 37928: a0 90 a5 02 lds r10, 0x02A5 ; 0x8002a5 3792c: b0 90 a6 02 lds r11, 0x02A6 ; 0x8002a6 if(mbl_was_active) { 37930: 00 23 and r16, r16 37932: d1 f0 breq .+52 ; 0x37968 <__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]); 37934: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 37938: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 3793c: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 37940: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 37944: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 37948: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 3794c: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 37950: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 37954: 0f 94 d1 95 call 0x32ba2 ; 0x32ba2 37958: 9b 01 movw r18, r22 3795a: ac 01 movw r20, r24 3795c: c5 01 movw r24, r10 3795e: b4 01 movw r22, r8 37960: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 37964: 4b 01 movw r8, r22 37966: 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); 37968: b5 01 movw r22, r10 3796a: a4 01 movw r20, r8 3796c: 8d e8 ldi r24, 0x8D ; 141 3796e: 9f e0 ldi r25, 0x0F ; 15 37970: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 37974: 40 91 a7 02 lds r20, 0x02A7 ; 0x8002a7 37978: 50 91 a8 02 lds r21, 0x02A8 ; 0x8002a8 3797c: 60 91 a9 02 lds r22, 0x02A9 ; 0x8002a9 37980: 70 91 aa 02 lds r23, 0x02AA ; 0x8002aa 37984: 8e e6 ldi r24, 0x6E ; 110 37986: 9f e0 ldi r25, 0x0F ; 15 37988: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a } 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); 3798c: 60 91 03 18 lds r22, 0x1803 ; 0x801803 37990: c1 e0 ldi r28, 0x01 ; 1 37992: 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); 37994: 82 e7 ldi r24, 0x72 ; 114 37996: 9f e0 ldi r25, 0x0F ; 15 37998: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 3799c: 0e 94 60 81 call 0x102c0 ; 0x102c0 card.sdprinting = false; 379a0: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b saved_printing = true; 379a4: c0 93 57 0e sts 0x0E57, r28 ; 0x800e57 // 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; 379a8: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a sei(); 379ac: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 379ae: 20 e0 ldi r18, 0x00 ; 0 379b0: 30 e0 ldi r19, 0x00 ; 0 379b2: 40 e8 ldi r20, 0x80 ; 128 379b4: 5f e3 ldi r21, 0x3F ; 63 379b6: 60 91 4c 07 lds r22, 0x074C ; 0x80074c 379ba: 70 91 4d 07 lds r23, 0x074D ; 0x80074d 379be: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 379c2: 90 91 4f 07 lds r25, 0x074F ; 0x80074f 379c6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 379ca: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 379ce: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 379d2: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 379d6: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f plan_buffer_line_curposXYZE(95); 379da: 60 e0 ldi r22, 0x00 ; 0 379dc: 70 e0 ldi r23, 0x00 ; 0 379de: 8e eb ldi r24, 0xBE ; 190 379e0: 92 e4 ldi r25, 0x42 ; 66 379e2: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 379e6: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 disable_e0(); 379ea: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 379ec: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 379f0: c0 e0 ldi r28, 0x00 ; 0 379f2: d1 e0 ldi r29, 0x01 ; 1 379f4: 02 c0 rjmp .+4 ; 0x379fa <__vector_5+0x24e> 379f6: d6 95 lsr r29 379f8: c7 95 ror r28 379fa: 8a 95 dec r24 379fc: e2 f7 brpl .-8 ; 0x379f6 <__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); 379fe: 82 e0 ldi r24, 0x02 ; 2 37a00: 0f 94 fa 38 call 0x271f4 ; 0x271f4 current_position[Z_AXIS] += float(1024 - z_microsteps) 37a04: 60 e0 ldi r22, 0x00 ; 0 37a06: 74 e0 ldi r23, 0x04 ; 4 37a08: 68 1b sub r22, r24 37a0a: 79 0b sbc r23, r25 37a0c: 90 e0 ldi r25, 0x00 ; 0 37a0e: 80 e0 ldi r24, 0x00 ; 0 37a10: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 37a14: 4b 01 movw r8, r22 37a16: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37a18: be 01 movw r22, r28 37a1a: 90 e0 ldi r25, 0x00 ; 0 37a1c: 80 e0 ldi r24, 0x00 ; 0 37a1e: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 37a22: 20 91 77 06 lds r18, 0x0677 ; 0x800677 37a26: 30 91 78 06 lds r19, 0x0678 ; 0x800678 37a2a: 40 91 79 06 lds r20, 0x0679 ; 0x800679 37a2e: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 37a32: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 37a36: 9b 01 movw r18, r22 37a38: ac 01 movw r20, r24 37a3a: c5 01 movw r24, r10 37a3c: b4 01 movw r22, r8 37a3e: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> + UVLO_Z_AXIS_SHIFT; 37a42: 2a e0 ldi r18, 0x0A ; 10 37a44: 37 ed ldi r19, 0xD7 ; 215 37a46: 43 e2 ldi r20, 0x23 ; 35 37a48: 5f e3 ldi r21, 0x3F ; 63 37a4a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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) 37a4e: 20 91 48 07 lds r18, 0x0748 ; 0x800748 37a52: 30 91 49 07 lds r19, 0x0749 ; 0x800749 37a56: 40 91 4a 07 lds r20, 0x074A ; 0x80074a 37a5a: 50 91 4b 07 lds r21, 0x074B ; 0x80074b 37a5e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 37a62: 60 93 48 07 sts 0x0748, r22 ; 0x800748 37a66: 70 93 49 07 sts 0x0749, r23 ; 0x800749 37a6a: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 37a6e: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37a72: 65 e5 ldi r22, 0x55 ; 85 37a74: 75 e5 ldi r23, 0x55 ; 85 37a76: 85 e5 ldi r24, 0x55 ; 85 37a78: 91 e4 ldi r25, 0x41 ; 65 37a7a: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 37a7e: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37a82: 40 91 ff 17 lds r20, 0x17FF ; 0x8017ff 37a86: 50 91 00 18 lds r21, 0x1800 ; 0x801800 37a8a: 60 91 01 18 lds r22, 0x1801 ; 0x801801 37a8e: 70 91 02 18 lds r23, 0x1802 ; 0x801802 37a92: 81 e9 ldi r24, 0x91 ; 145 37a94: 9f e0 ldi r25, 0x0F ; 15 37a96: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 37a9a: ce ea ldi r28, 0xAE ; 174 37a9c: 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; 37a9e: 97 e0 ldi r25, 0x07 ; 7 37aa0: 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; 37aa2: 70 e0 ldi r23, 0x00 ; 0 37aa4: 60 e0 ldi r22, 0x00 ; 0 37aa6: 00 23 and r16, r16 37aa8: 19 f1 breq .+70 ; 0x37af0 <__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; 37aaa: 81 2f mov r24, r17 37aac: 6b 2d mov r22, r11 37aae: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__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; 37ab2: b8 9e mul r11, r24 37ab4: f0 01 movw r30, r0 37ab6: 11 24 eor r1, r1 37ab8: e9 0f add r30, r25 37aba: f1 1d adc r31, r1 37abc: ee 0f add r30, r30 37abe: ff 1f adc r31, r31 37ac0: ee 0f add r30, r30 37ac2: ff 1f adc r31, r31 37ac4: e3 56 subi r30, 0x63 ; 99 37ac6: fc 4e sbci r31, 0xEC ; 236 37ac8: 20 e0 ldi r18, 0x00 ; 0 37aca: 30 e0 ldi r19, 0x00 ; 0 37acc: 4a e7 ldi r20, 0x7A ; 122 37ace: 54 e4 ldi r21, 0x44 ; 68 37ad0: 61 81 ldd r22, Z+1 ; 0x01 37ad2: 72 81 ldd r23, Z+2 ; 0x02 37ad4: 83 81 ldd r24, Z+3 ; 0x03 37ad6: 94 81 ldd r25, Z+4 ; 0x04 37ad8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 37adc: 20 e0 ldi r18, 0x00 ; 0 37ade: 30 e0 ldi r19, 0x00 ; 0 37ae0: 40 e0 ldi r20, 0x00 ; 0 37ae2: 5f e3 ldi r21, 0x3F ; 63 37ae4: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 37ae8: 0f 94 de df call 0x3bfbc ; 0x3bfbc 37aec: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37af0: ce 01 movw r24, r28 37af2: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 // 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) 37af6: 1f 5f subi r17, 0xFF ; 255 37af8: 22 96 adiw r28, 0x02 ; 2 37afa: 11 33 cpi r17, 0x31 ; 49 37afc: 91 f6 brne .-92 ; 0x37aa2 <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37afe: 40 91 48 07 lds r20, 0x0748 ; 0x800748 37b02: 50 91 49 07 lds r21, 0x0749 ; 0x800749 37b06: 60 91 4a 07 lds r22, 0x074A ; 0x80074a 37b0a: 70 91 4b 07 lds r23, 0x074B ; 0x80074b 37b0e: 8a ed ldi r24, 0xDA ; 218 37b10: 9e e0 ldi r25, 0x0E ; 14 37b12: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 37b16: 40 91 9b 02 lds r20, 0x029B ; 0x80029b 37b1a: 50 91 9c 02 lds r21, 0x029C ; 0x80029c 37b1e: 60 91 9d 02 lds r22, 0x029D ; 0x80029d 37b22: 70 91 9e 02 lds r23, 0x029E ; 0x80029e 37b26: 8d e9 ldi r24, 0x9D ; 157 37b28: 9f e0 ldi r25, 0x0F ; 15 37b2a: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 37b2e: 40 91 9f 02 lds r20, 0x029F ; 0x80029f 37b32: 50 91 a0 02 lds r21, 0x02A0 ; 0x8002a0 37b36: 60 91 a1 02 lds r22, 0x02A1 ; 0x8002a1 37b3a: 70 91 a2 02 lds r23, 0x02A2 ; 0x8002a2 37b3e: 81 ea ldi r24, 0xA1 ; 161 37b40: 9f e0 ldi r25, 0x0F ; 15 37b42: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37b46: 60 91 fd 17 lds r22, 0x17FD ; 0x8017fd 37b4a: 70 91 fe 17 lds r23, 0x17FE ; 0x8017fe 37b4e: 89 e8 ldi r24, 0x89 ; 137 37b50: 9f e0 ldi r25, 0x0F ; 15 37b52: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 37b56: 60 91 39 02 lds r22, 0x0239 ; 0x800239 37b5a: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 37b5e: 85 e3 ldi r24, 0x35 ; 53 37b60: 9d e0 ldi r25, 0x0D ; 13 37b62: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 37b66: 60 91 aa 05 lds r22, 0x05AA ; 0x8005aa 37b6a: 70 91 ab 05 lds r23, 0x05AB ; 0x8005ab 37b6e: 88 ed ldi r24, 0xD8 ; 216 37b70: 9e e0 ldi r25, 0x0E ; 14 37b72: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37b76: 60 91 ac 05 lds r22, 0x05AC ; 0x8005ac 37b7a: 8b e8 ldi r24, 0x8B ; 139 37b7c: 9f e0 ldi r25, 0x0F ; 15 37b7e: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 37b82: 60 91 a9 05 lds r22, 0x05A9 ; 0x8005a9 37b86: 88 e8 ldi r24, 0x88 ; 136 37b88: 9f e0 ldi r25, 0x0F ; 15 37b8a: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37b8e: 40 91 bb 02 lds r20, 0x02BB ; 0x8002bb 37b92: 50 91 bc 02 lds r21, 0x02BC ; 0x8002bc 37b96: 60 91 bd 02 lds r22, 0x02BD ; 0x8002bd 37b9a: 70 91 be 02 lds r23, 0x02BE ; 0x8002be 37b9e: 88 ee ldi r24, 0xE8 ; 232 37ba0: 9e e0 ldi r25, 0x0E ; 14 37ba2: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37ba6: 60 91 94 02 lds r22, 0x0294 ; 0x800294 37baa: 70 91 95 02 lds r23, 0x0295 ; 0x800295 37bae: 8e ed ldi r24, 0xDE ; 222 37bb0: 9e e0 ldi r25, 0x0E ; 14 37bb2: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37bb6: 40 91 9f 06 lds r20, 0x069F ; 0x80069f 37bba: 50 91 a0 06 lds r21, 0x06A0 ; 0x8006a0 37bbe: 60 91 a1 06 lds r22, 0x06A1 ; 0x8006a1 37bc2: 70 91 a2 06 lds r23, 0x06A2 ; 0x8006a2 37bc6: 81 e1 ldi r24, 0x11 ; 17 37bc8: 9d e0 ldi r25, 0x0D ; 13 37bca: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 37bce: 40 91 a3 06 lds r20, 0x06A3 ; 0x8006a3 37bd2: 50 91 a4 06 lds r21, 0x06A4 ; 0x8006a4 37bd6: 60 91 a5 06 lds r22, 0x06A5 ; 0x8006a5 37bda: 70 91 a6 06 lds r23, 0x06A6 ; 0x8006a6 37bde: 8d e0 ldi r24, 0x0D ; 13 37be0: 9d e0 ldi r25, 0x0D ; 13 37be2: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 37be6: 40 91 2b 07 lds r20, 0x072B ; 0x80072b 37bea: 50 91 2c 07 lds r21, 0x072C ; 0x80072c 37bee: 60 91 2d 07 lds r22, 0x072D ; 0x80072d 37bf2: 70 91 2e 07 lds r23, 0x072E ; 0x80072e 37bf6: 89 e0 ldi r24, 0x09 ; 9 37bf8: 9d e0 ldi r25, 0x0D ; 13 37bfa: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a #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); 37bfe: 40 e1 ldi r20, 0x10 ; 16 37c00: 50 e0 ldi r21, 0x00 ; 0 37c02: 67 e3 ldi r22, 0x37 ; 55 37c04: 7d e0 ldi r23, 0x0D ; 13 37c06: 8b ea ldi r24, 0xAB ; 171 37c08: 92 e0 ldi r25, 0x02 ; 2 37c0a: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37c0e: 60 91 08 18 lds r22, 0x1808 ; 0x801808 37c12: 70 91 09 18 lds r23, 0x1809 ; 0x801809 37c16: 8c e6 ldi r24, 0x6C ; 108 37c18: 9f e0 ldi r25, 0x0F ; 15 37c1a: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37c1e: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 37c22: 8c e8 ldi r24, 0x8C ; 140 37c24: 9f e0 ldi r25, 0x0F ; 15 37c26: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c2a: 40 91 04 18 lds r20, 0x1804 ; 0x801804 37c2e: 50 91 05 18 lds r21, 0x1805 ; 0x801805 37c32: 60 91 06 18 lds r22, 0x1806 ; 0x801806 37c36: 70 91 07 18 lds r23, 0x1807 ; 0x801807 37c3a: 8c e2 ldi r24, 0x2C ; 44 37c3c: 9d e0 ldi r25, 0x0D ; 13 37c3e: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37c42: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 37c46: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 37c4a: 8d e7 ldi r24, 0x7D ; 125 37c4c: 9c e0 ldi r25, 0x0C ; 12 37c4e: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 #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); 37c52: 40 e1 ldi r20, 0x10 ; 16 37c54: 50 e0 ldi r21, 0x00 ; 0 37c56: 6d e6 ldi r22, 0x6D ; 109 37c58: 7c e0 ldi r23, 0x0C ; 12 37c5a: 8f e8 ldi r24, 0x8F ; 143 37c5c: 96 e0 ldi r25, 0x06 ; 6 37c5e: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 37c62: 40 e1 ldi r20, 0x10 ; 16 37c64: 50 e0 ldi r21, 0x00 ; 0 37c66: 6d e5 ldi r22, 0x5D ; 93 37c68: 7c e0 ldi r23, 0x0C ; 12 37c6a: 87 e1 ldi r24, 0x17 ; 23 37c6c: 97 e0 ldi r25, 0x07 ; 7 37c6e: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 37c72: 40 e1 ldi r20, 0x10 ; 16 37c74: 50 e0 ldi r21, 0x00 ; 0 37c76: 6d e4 ldi r22, 0x4D ; 77 37c78: 7c e0 ldi r23, 0x0C ; 12 37c7a: 8f e7 ldi r24, 0x7F ; 127 37c7c: 96 e0 ldi r25, 0x06 ; 6 37c7e: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 37c82: 40 e1 ldi r20, 0x10 ; 16 37c84: 50 e0 ldi r21, 0x00 ; 0 37c86: 6d e3 ldi r22, 0x3D ; 61 37c88: 7c e0 ldi r23, 0x0C ; 12 37c8a: 87 e0 ldi r24, 0x07 ; 7 37c8c: 97 e0 ldi r25, 0x07 ; 7 37c8e: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c92: 40 91 a7 06 lds r20, 0x06A7 ; 0x8006a7 37c96: 50 91 a8 06 lds r21, 0x06A8 ; 0x8006a8 37c9a: 60 91 a9 06 lds r22, 0x06A9 ; 0x8006a9 37c9e: 70 91 aa 06 lds r23, 0x06AA ; 0x8006aa 37ca2: 89 e3 ldi r24, 0x39 ; 57 37ca4: 9c e0 ldi r25, 0x0C ; 12 37ca6: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 37caa: 40 91 ab 06 lds r20, 0x06AB ; 0x8006ab 37cae: 50 91 ac 06 lds r21, 0x06AC ; 0x8006ac 37cb2: 60 91 ad 06 lds r22, 0x06AD ; 0x8006ad 37cb6: 70 91 ae 06 lds r23, 0x06AE ; 0x8006ae 37cba: 85 e3 ldi r24, 0x35 ; 53 37cbc: 9c e0 ldi r25, 0x0C ; 12 37cbe: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37cc2: 40 91 af 06 lds r20, 0x06AF ; 0x8006af 37cc6: 50 91 b0 06 lds r21, 0x06B0 ; 0x8006b0 37cca: 60 91 b1 06 lds r22, 0x06B1 ; 0x8006b1 37cce: 70 91 b2 06 lds r23, 0x06B2 ; 0x8006b2 37cd2: 81 e3 ldi r24, 0x31 ; 49 37cd4: 9c e0 ldi r25, 0x0C ; 12 37cd6: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a #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); 37cda: 40 e1 ldi r20, 0x10 ; 16 37cdc: 50 e0 ldi r21, 0x00 ; 0 37cde: 61 e2 ldi r22, 0x21 ; 33 37ce0: 7c e0 ldi r23, 0x0C ; 12 37ce2: 83 eb ldi r24, 0xB3 ; 179 37ce4: 96 e0 ldi r25, 0x06 ; 6 37ce6: 0f 94 23 dd call 0x3ba46 ; 0x3ba46 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) { 37cea: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc 37cee: 88 23 and r24, r24 37cf0: 29 f0 breq .+10 ; 0x37cfc <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37cf2: 61 e0 ldi r22, 0x01 ; 1 37cf4: 8f e7 ldi r24, 0x7F ; 127 37cf6: 9c e0 ldi r25, 0x0C ; 12 37cf8: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 37cfc: 61 e0 ldi r22, 0x01 ; 1 37cfe: 85 ea ldi r24, 0xA5 ; 165 37d00: 9f e0 ldi r25, 0x0F ; 15 37d02: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 37d06: 84 e6 ldi r24, 0x64 ; 100 37d08: 9f e0 ldi r25, 0x0F ; 15 37d0a: 0e 94 44 78 call 0xf088 ; 0xf088 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 37d0e: 8f ef ldi r24, 0xFF ; 255 37d10: 9e e0 ldi r25, 0x0E ; 14 37d12: 0e 94 37 78 call 0xf06e ; 0xf06e printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 37d16: 0f 94 55 3e call 0x27caa ; 0x27caa 37d1a: dc 01 movw r26, r24 37d1c: cb 01 movw r24, r22 37d1e: 8c 19 sub r24, r12 37d20: 9d 09 sbc r25, r13 37d22: ae 09 sbc r26, r14 37d24: bf 09 sbc r27, r15 37d26: bf 93 push r27 37d28: af 93 push r26 37d2a: 9f 93 push r25 37d2c: 8f 93 push r24 37d2e: 88 e3 ldi r24, 0x38 ; 56 37d30: 92 e7 ldi r25, 0x72 ; 114 37d32: 9f 93 push r25 37d34: 8f 93 push r24 37d36: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 WRITE(BEEPER,HIGH); 37d3a: 9f b7 in r25, 0x3f ; 63 37d3c: f8 94 cli 37d3e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37d42: 84 60 ori r24, 0x04 ; 4 37d44: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37d48: 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(); 37d4a: 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; 37d4c: 0f 90 pop r0 37d4e: 0f 90 pop r0 37d50: 0f 90 pop r0 37d52: 0f 90 pop r0 37d54: 0f 90 pop r0 37d56: 0f 90 pop r0 37d58: 20 e0 ldi r18, 0x00 ; 0 37d5a: 30 e0 ldi r19, 0x00 ; 0 37d5c: 4f ef ldi r20, 0xFF ; 255 37d5e: 52 e4 ldi r21, 0x42 ; 66 37d60: 60 91 40 07 lds r22, 0x0740 ; 0x800740 37d64: 70 91 41 07 lds r23, 0x0741 ; 0x800741 37d68: 80 91 42 07 lds r24, 0x0742 ; 0x800742 37d6c: 90 91 43 07 lds r25, 0x0743 ; 0x800743 37d70: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 37d74: 87 fd sbrc r24, 7 37d76: 1f c0 rjmp .+62 ; 0x37db6 <__vector_5+0x60a> 37d78: 80 e0 ldi r24, 0x00 ; 0 37d7a: 90 e0 ldi r25, 0x00 ; 0 37d7c: af e7 ldi r26, 0x7F ; 127 37d7e: b3 e4 ldi r27, 0x43 ; 67 37d80: 80 93 40 07 sts 0x0740, r24 ; 0x800740 37d84: 90 93 41 07 sts 0x0741, r25 ; 0x800741 37d88: a0 93 42 07 sts 0x0742, r26 ; 0x800742 37d8c: b0 93 43 07 sts 0x0743, r27 ; 0x800743 plan_buffer_line_curposXYZE(500); 37d90: 60 e0 ldi r22, 0x00 ; 0 37d92: 70 e0 ldi r23, 0x00 ; 0 37d94: 8a ef ldi r24, 0xFA ; 250 37d96: 93 e4 ldi r25, 0x43 ; 67 37d98: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 37d9c: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 37da0: 88 e1 ldi r24, 0x18 ; 24 37da2: 9e e0 ldi r25, 0x0E ; 14 37da4: 0f b6 in r0, 0x3f ; 63 37da6: f8 94 cli 37da8: a8 95 wdr 37daa: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37dae: 0f be out 0x3f, r0 ; 63 37db0: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37db4: ff cf rjmp .-2 ; 0x37db4 <__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; 37db6: 80 e0 ldi r24, 0x00 ; 0 37db8: 90 e0 ldi r25, 0x00 ; 0 37dba: dc 01 movw r26, r24 37dbc: e1 cf rjmp .-62 ; 0x37d80 <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 37dbe: 0f 94 55 3e call 0x27caa ; 0x27caa 37dc2: 6b 01 movw r12, r22 37dc4: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 37dc6: 17 9a sbi 0x02, 7 ; 2 37dc8: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d disable_y(); 37dcc: 16 9a sbi 0x02, 6 ; 2 37dce: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_e0(); 37dd2: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 37dd4: 64 e1 ldi r22, 0x14 ; 20 37dd6: 83 e6 ldi r24, 0x63 ; 99 37dd8: 92 e0 ldi r25, 0x02 ; 2 37dda: 0e 94 44 69 call 0xd288 ; 0xd288 currents[Z_AXIS].setiRun(20); 37dde: 64 e1 ldi r22, 0x14 ; 20 37de0: 83 e6 ldi r24, 0x63 ; 99 37de2: 92 e0 ldi r25, 0x02 ; 2 37de4: 0e 94 4c 69 call 0xd298 ; 0xd298 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 37de8: 50 e0 ldi r21, 0x00 ; 0 37dea: 40 e0 ldi r20, 0x00 ; 0 37dec: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 37df0: 82 e0 ldi r24, 0x02 ; 2 37df2: 0f 94 14 39 call 0x27228 ; 0x27228 #endif //TMC2130 // Stop all heaters disable_heater(); 37df6: 0f 94 21 44 call 0x28842 ; 0x28842 // 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; 37dfa: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d planner_abort_hard(); 37dfe: 0f 94 8b bb call 0x37716 ; 0x37716 // 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]) 37e02: 80 90 48 07 lds r8, 0x0748 ; 0x800748 37e06: 90 90 49 07 lds r9, 0x0749 ; 0x800749 37e0a: a0 90 4a 07 lds r10, 0x074A ; 0x80074a 37e0e: b0 90 4b 07 lds r11, 0x074B ; 0x80074b 37e12: 8a ed ldi r24, 0xDA ; 218 37e14: 9e e0 ldi r25, 0x0E ; 14 37e16: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 37e1a: 9b 01 movw r18, r22 37e1c: ac 01 movw r20, r24 37e1e: c5 01 movw r24, r10 37e20: b4 01 movw r22, r8 37e22: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 37e26: 4b 01 movw r8, r22 37e28: 5c 01 movw r10, r24 37e2a: e8 94 clt 37e2c: b7 f8 bld r11, 7 37e2e: 20 91 77 06 lds r18, 0x0677 ; 0x800677 37e32: 30 91 78 06 lds r19, 0x0678 ; 0x800678 37e36: 40 91 79 06 lds r20, 0x0679 ; 0x800679 37e3a: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 37e3e: 60 e0 ldi r22, 0x00 ; 0 37e40: 70 e0 ldi r23, 0x00 ; 0 37e42: 80 e8 ldi r24, 0x80 ; 128 37e44: 9f e3 ldi r25, 0x3F ; 63 37e46: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 37e4a: 9b 01 movw r18, r22 37e4c: ac 01 movw r20, r24 37e4e: c5 01 movw r24, r10 37e50: b4 01 movw r22, r8 37e52: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 37e56: 87 fd sbrc r24, 7 37e58: 61 c0 rjmp .+194 ; 0x37f1c <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37e5a: 0e 94 60 81 call 0x102c0 ; 0x102c0 card.sdprinting = false; 37e5e: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b saved_printing = true; 37e62: 81 e0 ldi r24, 0x01 ; 1 37e64: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 // 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; 37e68: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a sei(); 37e6c: 78 94 sei 37e6e: 80 91 f7 04 lds r24, 0x04F7 ; 0x8004f7 37e72: c0 e0 ldi r28, 0x00 ; 0 37e74: d1 e0 ldi r29, 0x01 ; 1 37e76: 02 c0 rjmp .+4 ; 0x37e7c <__vector_5+0x6d0> 37e78: d6 95 lsr r29 37e7a: c7 95 ror r28 37e7c: 8a 95 dec r24 37e7e: e2 f7 brpl .-8 ; 0x37e78 <__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); 37e80: 82 e0 ldi r24, 0x02 ; 2 37e82: 0f 94 fa 38 call 0x271f4 ; 0x271f4 current_position[Z_AXIS] += float(1024 - z_microsteps) 37e86: 60 e0 ldi r22, 0x00 ; 0 37e88: 74 e0 ldi r23, 0x04 ; 4 37e8a: 68 1b sub r22, r24 37e8c: 79 0b sbc r23, r25 37e8e: 90 e0 ldi r25, 0x00 ; 0 37e90: 80 e0 ldi r24, 0x00 ; 0 37e92: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 37e96: 4b 01 movw r8, r22 37e98: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37e9a: be 01 movw r22, r28 37e9c: 90 e0 ldi r25, 0x00 ; 0 37e9e: 80 e0 ldi r24, 0x00 ; 0 37ea0: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 37ea4: 20 91 77 06 lds r18, 0x0677 ; 0x800677 37ea8: 30 91 78 06 lds r19, 0x0678 ; 0x800678 37eac: 40 91 79 06 lds r20, 0x0679 ; 0x800679 37eb0: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 37eb4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 37eb8: 9b 01 movw r18, r22 37eba: ac 01 movw r20, r24 37ebc: c5 01 movw r24, r10 37ebe: b4 01 movw r22, r8 37ec0: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 37ec4: 2a e0 ldi r18, 0x0A ; 10 37ec6: 37 ed ldi r19, 0xD7 ; 215 37ec8: 43 e2 ldi r20, 0x23 ; 35 37eca: 5e e3 ldi r21, 0x3E ; 62 37ecc: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__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) 37ed0: 20 91 48 07 lds r18, 0x0748 ; 0x800748 37ed4: 30 91 49 07 lds r19, 0x0749 ; 0x800749 37ed8: 40 91 4a 07 lds r20, 0x074A ; 0x80074a 37edc: 50 91 4b 07 lds r21, 0x074B ; 0x80074b 37ee0: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 37ee4: 60 93 48 07 sts 0x0748, r22 ; 0x800748 37ee8: 70 93 49 07 sts 0x0749, r23 ; 0x800749 37eec: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 37ef0: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_TINY_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37ef4: 65 e5 ldi r22, 0x55 ; 85 37ef6: 75 e5 ldi r23, 0x55 ; 85 37ef8: 85 e5 ldi r24, 0x55 ; 85 37efa: 91 e4 ldi r25, 0x41 ; 65 37efc: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 37f00: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37f04: 40 91 48 07 lds r20, 0x0748 ; 0x800748 37f08: 50 91 49 07 lds r21, 0x0749 ; 0x800749 37f0c: 60 91 4a 07 lds r22, 0x074A ; 0x80074a 37f10: 70 91 4b 07 lds r23, 0x074B ; 0x80074b 37f14: 8a ed ldi r24, 0xDA ; 218 37f16: 9e e0 ldi r25, 0x0E ; 14 37f18: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37f1c: 62 e0 ldi r22, 0x02 ; 2 37f1e: 85 ea ldi r24, 0xA5 ; 165 37f20: 9f e0 ldi r25, 0x0F ; 15 37f22: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 // 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); 37f26: 84 e6 ldi r24, 0x64 ; 100 37f28: 9f e0 ldi r25, 0x0F ; 15 37f2a: 0e 94 44 78 call 0xf088 ; 0xf088 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 37f2e: 8f ef ldi r24, 0xFF ; 255 37f30: 9e e0 ldi r25, 0x0E ; 14 37f32: 0e 94 37 78 call 0xf06e ; 0xf06e printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 37f36: 0f 94 55 3e call 0x27caa ; 0x27caa 37f3a: dc 01 movw r26, r24 37f3c: cb 01 movw r24, r22 37f3e: 8c 19 sub r24, r12 37f40: 9d 09 sbc r25, r13 37f42: ae 09 sbc r26, r14 37f44: bf 09 sbc r27, r15 37f46: bf 93 push r27 37f48: af 93 push r26 37f4a: 9f 93 push r25 37f4c: 8f 93 push r24 37f4e: 87 e4 ldi r24, 0x47 ; 71 37f50: 92 e7 ldi r25, 0x72 ; 114 37f52: 9f 93 push r25 37f54: 8f 93 push r24 37f56: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 uvlo_drain_reset(); 37f5a: 0f 94 b8 a9 call 0x35370 ; 0x35370 // 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(); } } 37f5e: ff 91 pop r31 37f60: ef 91 pop r30 37f62: df 91 pop r29 37f64: cf 91 pop r28 37f66: bf 91 pop r27 37f68: af 91 pop r26 37f6a: 9f 91 pop r25 37f6c: 8f 91 pop r24 37f6e: 7f 91 pop r23 37f70: 6f 91 pop r22 37f72: 5f 91 pop r21 37f74: 4f 91 pop r20 37f76: 3f 91 pop r19 37f78: 2f 91 pop r18 37f7a: 1f 91 pop r17 37f7c: 0f 91 pop r16 37f7e: ff 90 pop r15 37f80: ef 90 pop r14 37f82: df 90 pop r13 37f84: cf 90 pop r12 37f86: bf 90 pop r11 37f88: af 90 pop r10 37f8a: 9f 90 pop r9 37f8c: 8f 90 pop r8 37f8e: 0f 90 pop r0 37f90: 0b be out 0x3b, r0 ; 59 37f92: 0f 90 pop r0 37f94: 0f be out 0x3f, r0 ; 63 37f96: 0f 90 pop r0 37f98: 1f 90 pop r1 37f9a: 18 95 reti 00037f9c : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 37f9c: 84 b1 in r24, 0x04 ; 4 37f9e: 81 7f andi r24, 0xF1 ; 241 37fa0: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 37fa2: 84 b1 in r24, 0x04 ; 4 37fa4: 87 60 ori r24, 0x07 ; 7 37fa6: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 37fa8: 85 b1 in r24, 0x05 ; 5 37faa: 81 7f andi r24, 0xF1 ; 241 37fac: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 37fae: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 37fb0: 80 e5 ldi r24, 0x50 ; 80 37fb2: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 37fb4: 1d bc out 0x2d, r1 ; 45 } 37fb6: 08 95 ret 00037fb8 : //! @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() { 37fb8: 2f 92 push r2 37fba: 3f 92 push r3 37fbc: 4f 92 push r4 37fbe: 5f 92 push r5 37fc0: 6f 92 push r6 37fc2: 7f 92 push r7 37fc4: 8f 92 push r8 37fc6: 9f 92 push r9 37fc8: af 92 push r10 37fca: bf 92 push r11 37fcc: cf 92 push r12 37fce: df 92 push r13 37fd0: ef 92 push r14 37fd2: ff 92 push r15 37fd4: 0f 93 push r16 37fd6: 1f 93 push r17 37fd8: cf 93 push r28 37fda: df 93 push r29 37fdc: cd b7 in r28, 0x3d ; 61 37fde: de b7 in r29, 0x3e ; 62 37fe0: c6 50 subi r28, 0x06 ; 6 37fe2: d1 40 sbci r29, 0x01 ; 1 37fe4: 0f b6 in r0, 0x3f ; 63 37fe6: f8 94 cli 37fe8: de bf out 0x3e, r29 ; 62 37fea: 0f be out 0x3f, r0 ; 63 37fec: 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; 37fee: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e6> 37ff2: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e7> 37ff6: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e8> 37ffa: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e9> 37ffe: 8a 3a cpi r24, 0xAA ; 170 38000: 95 45 sbci r25, 0x55 ; 85 38002: aa 4a sbci r26, 0xAA ; 170 38004: b5 45 sbci r27, 0x55 ; 85 38006: 21 f4 brne .+8 ; 0x38010 38008: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e5> 3800c: 87 fd sbrc r24, 7 3800e: c2 c1 rjmp .+900 ; 0x38394 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(); 38010: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 38012: d0 90 1e 05 lds r13, 0x051E ; 0x80051e // Flush the serial line. while (RECV_READY) { 38016: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 3801a: 87 ff sbrs r24, 7 3801c: 04 c0 rjmp .+8 ; 0x38026 wdt_reset(); 3801e: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 38020: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 38024: f8 cf rjmp .-16 ; 0x38016 } selectedSerialPort = 0; //switch to Serial0 38026: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e // 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; 3802a: 00 91 92 04 lds r16, 0x0492 ; 0x800492 3802e: 10 91 93 04 lds r17, 0x0493 ; 0x800493 38032: 10 93 91 04 sts 0x0491, r17 ; 0x800491 38036: 00 93 90 04 sts 0x0490, r16 ; 0x800490 3803a: 53 eb ldi r21, 0xB3 ; 179 3803c: e5 2e mov r14, r21 3803e: 5c ea ldi r21, 0xAC ; 172 38040: f5 2e mov r15, r21 38042: 69 eb ldi r22, 0xB9 ; 185 38044: a6 2e mov r10, r22 38046: 6c ea ldi r22, 0xAC ; 172 38048: 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 ++)); 3804a: f7 01 movw r30, r14 3804c: 84 91 lpm r24, Z 3804e: 0f 94 e6 a0 call 0x341cc ; 0x341cc 38052: ff ef ldi r31, 0xFF ; 255 38054: ef 1a sub r14, r31 38056: 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) 38058: ae 14 cp r10, r14 3805a: bf 04 cpc r11, r15 3805c: b1 f7 brne .-20 ; 0x3804a putch(pgm_read_byte(ptr ++)); wdt_reset(); 3805e: a8 95 wdr 38060: 8f e0 ldi r24, 0x0F ; 15 38062: 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) 38064: 22 eb ldi r18, 0xB2 ; 178 38066: 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(); 38068: 40 e8 ldi r20, 0x80 ; 128 3806a: 54 e8 ldi r21, 0x84 ; 132 3806c: 6e e1 ldi r22, 0x1E ; 30 3806e: 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) { 38070: e0 91 90 04 lds r30, 0x0490 ; 0x800490 38074: f0 91 91 04 lds r31, 0x0491 ; 0x800491 38078: e0 17 cp r30, r16 3807a: f1 07 cpc r31, r17 3807c: 19 f5 brne .+70 ; 0x380c4 wdt_reset(); 3807e: a8 95 wdr 38080: 41 50 subi r20, 0x01 ; 1 38082: 51 09 sbc r21, r1 38084: 61 09 sbc r22, r1 38086: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 38088: 99 f7 brne .-26 ; 0x38070 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 3808a: d0 92 1e 05 sts 0x051E, r13 ; 0x80051e return 0; 3808e: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 38090: ca 5f subi r28, 0xFA ; 250 38092: de 4f sbci r29, 0xFE ; 254 38094: 0f b6 in r0, 0x3f ; 63 38096: f8 94 cli 38098: de bf out 0x3e, r29 ; 62 3809a: 0f be out 0x3f, r0 ; 63 3809c: cd bf out 0x3d, r28 ; 61 3809e: df 91 pop r29 380a0: cf 91 pop r28 380a2: 1f 91 pop r17 380a4: 0f 91 pop r16 380a6: ff 90 pop r15 380a8: ef 90 pop r14 380aa: df 90 pop r13 380ac: cf 90 pop r12 380ae: bf 90 pop r11 380b0: af 90 pop r10 380b2: 9f 90 pop r9 380b4: 8f 90 pop r8 380b6: 7f 90 pop r7 380b8: 6f 90 pop r6 380ba: 5f 90 pop r5 380bc: 4f 90 pop r4 380be: 3f 90 pop r3 380c0: 2f 90 pop r2 380c2: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 380c4: f8 01 movw r30, r16 380c6: e0 5f subi r30, 0xF0 ; 240 380c8: fb 4f sbci r31, 0xFB ; 251 380ca: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 380cc: 0f 5f subi r16, 0xFF ; 255 380ce: 1f 4f sbci r17, 0xFF ; 255 380d0: 0f 77 andi r16, 0x7F ; 127 380d2: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 380d4: f9 01 movw r30, r18 380d6: e8 1b sub r30, r24 380d8: f9 0b sbc r31, r25 380da: e4 91 lpm r30, Z 380dc: 4e 13 cpse r20, r30 380de: d5 cf rjmp .-86 ; 0x3808a { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 380e0: a8 95 wdr 380e2: 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) { 380e4: 09 f0 breq .+2 ; 0x380e8 380e6: c0 cf rjmp .-128 ; 0x38068 selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 380e8: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 380ec: 8f 77 andi r24, 0x7F ; 127 380ee: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 380f2: 05 e9 ldi r16, 0x95 ; 149 380f4: 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 ++)); 380f6: f8 01 movw r30, r16 380f8: 84 91 lpm r24, Z 380fa: 0f 94 e6 a0 call 0x341cc ; 0x341cc 380fe: 0f 5f subi r16, 0xFF ; 255 38100: 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) 38102: fc ea ldi r31, 0xAC ; 172 38104: 02 3a cpi r16, 0xA2 ; 162 38106: 1f 07 cpc r17, r31 38108: b1 f7 brne .-20 ; 0x380f6 putch(pgm_read_byte(ptr ++)); } spi_init(); 3810a: 0f 94 ce bf call 0x37f9c ; 0x37f9c xflash_init(); 3810e: 0e 94 c9 e3 call 0x1c792 ; 0x1c792 "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" ); 38112: 0f b6 in r0, 0x3f ; 63 38114: f8 94 cli 38116: a8 95 wdr 38118: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3811c: 88 61 ori r24, 0x18 ; 24 3811e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38122: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38126: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 38128: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 3812c: 4f e6 ldi r20, 0x6F ; 111 3812e: 5c ea ldi r21, 0xAC ; 172 38130: 61 e0 ldi r22, 0x01 ; 1 38132: 80 e0 ldi r24, 0x00 ; 0 38134: 0e 94 3a 70 call 0xe074 ; 0xe074 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 38138: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e6> 3813c: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e7> 38140: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e8> 38144: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e9> 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; 38148: cb 5f subi r28, 0xFB ; 251 3814a: de 4f sbci r29, 0xFE ; 254 3814c: 18 82 st Y, r1 3814e: c5 50 subi r28, 0x05 ; 5 38150: 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; 38152: 10 e0 ldi r17, 0x00 ; 0 38154: 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; 38156: 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); 38158: ae 01 movw r20, r28 3815a: 4f 5f subi r20, 0xFF ; 255 3815c: 5f 4f sbci r21, 0xFF ; 255 3815e: 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(); 38160: 0f 94 ed a0 call 0x341da ; 0x341da if(ch == STK_GET_PARAMETER) { 38164: 81 34 cpi r24, 0x41 ; 65 38166: a9 f4 brne .+42 ; 0x38192 unsigned char which = getch(); 38168: 0f 94 ed a0 call 0x341da ; 0x341da 3816c: e8 2e mov r14, r24 verifySpace(); 3816e: 0f 94 65 a3 call 0x346ca ; 0x346ca /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 38172: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 38174: 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) { 38176: e5 16 cp r14, r21 38178: 21 f0 breq .+8 ; 0x38182 putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 3817a: 81 e8 ldi r24, 0x81 ; 129 3817c: e8 12 cpse r14, r24 3817e: 07 c0 rjmp .+14 ; 0x3818e putch(optiboot_version >> 8); 38180: 86 e0 ldi r24, 0x06 ; 6 38182: 0f 94 e6 a0 call 0x341cc ; 0x341cc } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 38186: 80 e1 ldi r24, 0x10 ; 16 38188: 0f 94 e6 a0 call 0x341cc ; 0x341cc 3818c: e9 cf rjmp .-46 ; 0x38160 } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 3818e: 83 e0 ldi r24, 0x03 ; 3 38190: f8 cf rjmp .-16 ; 0x38182 } } else if(ch == STK_SET_DEVICE) { 38192: 82 34 cpi r24, 0x42 ; 66 38194: 21 f4 brne .+8 ; 0x3819e // SET DEVICE is ignored getNch(20); 38196: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 38198: 0f 94 71 a3 call 0x346e2 ; 0x346e2 3819c: f4 cf rjmp .-24 ; 0x38186 } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 3819e: 85 34 cpi r24, 0x45 ; 69 381a0: 11 f4 brne .+4 ; 0x381a6 // SET DEVICE EXT is ignored getNch(5); 381a2: 85 e0 ldi r24, 0x05 ; 5 381a4: f9 cf rjmp .-14 ; 0x38198 } else if(ch == STK_LOAD_ADDRESS) { 381a6: 85 35 cpi r24, 0x55 ; 85 381a8: c9 f4 brne .+50 ; 0x381dc // 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(); 381aa: 0f 94 ed a0 call 0x341da ; 0x341da 381ae: 08 2f mov r16, r24 newAddress |= getch(); 381b0: 0f 94 ed a0 call 0x341da ; 0x341da 381b4: 08 2b or r16, r24 381b6: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 381b8: 0f 94 ed a0 call 0x341da ; 0x341da 381bc: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 381be: 0f 94 ed a0 call 0x341da ; 0x341da 381c2: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 381c4: 17 ff sbrs r17, 7 381c6: 07 c0 rjmp .+14 ; 0x381d6 rampz |= 0x01; 381c8: 68 94 set 381ca: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 381cc: 00 0f add r16, r16 381ce: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 381d0: 0f 94 65 a3 call 0x346ca ; 0x346ca 381d4: d8 cf rjmp .-80 ; 0x38186 newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 381d6: e8 94 clt 381d8: f0 f8 bld r15, 0 381da: f8 cf rjmp .-16 ; 0x381cc newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 381dc: 86 35 cpi r24, 0x56 ; 86 381de: a1 f4 brne .+40 ; 0x38208 // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 381e0: 0f 94 ed a0 call 0x341da ; 0x341da 381e4: 8d 34 cpi r24, 0x4D ; 77 381e6: 71 f4 brne .+28 ; 0x38204 // get address getch(); // get '0' 381e8: 0f 94 ed a0 call 0x341da ; 0x341da rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 381ec: 0f 94 ed a0 call 0x341da ; 0x341da 381f0: 9f 2d mov r25, r15 381f2: 91 70 andi r25, 0x01 ; 1 381f4: f9 2e mov r15, r25 381f6: 88 0f add r24, r24 381f8: f8 2a or r15, r24 getNch(1); // get last '0' 381fa: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 381fc: 0f 94 71 a3 call 0x346e2 ; 0x346e2 putch(0x00); 38200: 80 e0 ldi r24, 0x00 ; 0 38202: bf cf rjmp .-130 ; 0x38182 // response putch(0x00); } else { // everything else is ignored getNch(3); 38204: 83 e0 ldi r24, 0x03 ; 3 38206: fa cf rjmp .-12 ; 0x381fc putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 38208: 84 36 cpi r24, 0x64 ; 100 3820a: 09 f0 breq .+2 ; 0x3820e 3820c: 77 c0 rjmp .+238 ; 0x382fc 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; 3820e: 0f 94 ed a0 call 0x341da ; 0x341da 38212: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 38214: 0f 94 ed a0 call 0x341da ; 0x341da 38218: c8 2e mov r12, r24 length |= getch(); 3821a: 0f 94 ed a0 call 0x341da ; 0x341da 3821e: e8 2e mov r14, r24 length |= getch(); 38220: 0f 94 ed a0 call 0x341da ; 0x341da 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; 38224: d1 2c mov r13, r1 38226: dc 2c mov r13, r12 38228: cc 24 eor r12, r12 3822a: db 28 or r13, r11 length |= getch(); length |= getch(); 3822c: 8e 29 or r24, r14 3822e: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 38230: 0f 94 ed a0 call 0x341da ; 0x341da 38234: 58 2e mov r5, r24 38236: fe 01 movw r30, r28 38238: 31 96 adiw r30, 0x01 ; 1 3823a: 5f 01 movw r10, r30 3823c: 46 01 movw r8, r12 3823e: 8e 0e add r8, r30 38240: 9f 1e adc r9, r31 38242: ee 2e mov r14, r30 38244: ca 5f subi r28, 0xFA ; 250 38246: de 4f sbci r29, 0xFE ; 254 38248: b8 82 st Y, r11 3824a: c6 50 subi r28, 0x06 ; 6 3824c: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 3824e: 0f 94 ed a0 call 0x341da ; 0x341da 38252: f5 01 movw r30, r10 38254: 81 93 st Z+, r24 38256: 5f 01 movw r10, r30 while (--length); 38258: 8e 16 cp r8, r30 3825a: 9f 06 cpc r9, r31 3825c: c1 f7 brne .-16 ; 0x3824e // Read command terminator, start reply verifySpace(); 3825e: 0f 94 65 a3 call 0x346ca ; 0x346ca if (desttype == 'E') { 38262: f5 e4 ldi r31, 0x45 ; 69 38264: 5f 12 cpse r5, r31 38266: 01 c0 rjmp .+2 ; 0x3826a 38268: ff cf rjmp .-2 ; 0x38268 while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 3826a: 18 01 movw r2, r16 3826c: 51 2c mov r5, r1 3826e: 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) { 38270: 01 15 cp r16, r1 38272: 11 05 cpc r17, r1 38274: 61 f5 brne .+88 ; 0x382ce 38276: 42 01 movw r8, r4 38278: aa 24 eor r10, r10 3827a: bb 24 eor r11, r11 3827c: cb 5f subi r28, 0xFB ; 251 3827e: de 4f sbci r29, 0xFE ; 254 38280: 28 81 ld r18, Y 38282: c5 50 subi r28, 0x05 ; 5 38284: d1 40 sbci r29, 0x01 ; 1 38286: 82 2f mov r24, r18 38288: 90 e0 ldi r25, 0x00 ; 0 3828a: 08 2c mov r0, r8 3828c: 02 c0 rjmp .+4 ; 0x38292 3828e: 95 95 asr r25 38290: 87 95 ror r24 38292: 0a 94 dec r0 38294: e2 f7 brpl .-8 ; 0x3828e 38296: 80 fd sbrc r24, 0 38298: 1a c0 rjmp .+52 ; 0x382ce xflash_wait_busy(); 3829a: 0e 94 56 e2 call 0x1c4ac ; 0x1c4ac xflash_enable_wr(); 3829e: 0e 94 f2 e2 call 0x1c5e4 ; 0x1c5e4 return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 382a2: b2 01 movw r22, r4 382a4: a8 01 movw r20, r16 382a6: 88 ed ldi r24, 0xD8 ; 216 382a8: 0e 94 74 e2 call 0x1c4e8 ; 0x1c4e8 xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 382ac: 81 e0 ldi r24, 0x01 ; 1 382ae: 90 e0 ldi r25, 0x00 ; 0 382b0: 01 c0 rjmp .+2 ; 0x382b4 382b2: 88 0f add r24, r24 382b4: 8a 94 dec r8 382b6: ea f7 brpl .-6 ; 0x382b2 382b8: cb 5f subi r28, 0xFB ; 251 382ba: de 4f sbci r29, 0xFE ; 254 382bc: 48 81 ld r20, Y 382be: c5 50 subi r28, 0x05 ; 5 382c0: d1 40 sbci r29, 0x01 ; 1 382c2: 48 2b or r20, r24 382c4: cb 5f subi r28, 0xFB ; 251 382c6: de 4f sbci r29, 0xFE ; 254 382c8: 48 83 st Y, r20 382ca: c5 50 subi r28, 0x05 ; 5 382cc: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 382ce: 0e 94 56 e2 call 0x1c4ac ; 0x1c4ac xflash_enable_wr(); 382d2: 0e 94 f2 e2 call 0x1c5e4 ; 0x1c5e4 xflash_page_program(addr, buff, savelength); 382d6: 96 01 movw r18, r12 382d8: 4e 2d mov r20, r14 382da: ca 5f subi r28, 0xFA ; 250 382dc: de 4f sbci r29, 0xFE ; 254 382de: 58 81 ld r21, Y 382e0: c6 50 subi r28, 0x06 ; 6 382e2: d1 40 sbci r29, 0x01 ; 1 382e4: c2 01 movw r24, r4 382e6: b1 01 movw r22, r2 382e8: 0e 94 79 e2 call 0x1c4f2 ; 0x1c4f2 xflash_wait_busy(); 382ec: 0e 94 56 e2 call 0x1c4ac ; 0x1c4ac _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 382f0: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 382f2: 84 e0 ldi r24, 0x04 ; 4 382f4: 0e 94 50 e2 call 0x1c4a0 ; 0x1c4a0 _CS_HIGH(); 382f8: 45 9a sbi 0x08, 5 ; 8 382fa: 45 cf rjmp .-374 ; 0x38186 xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 382fc: 84 37 cpi r24, 0x74 ; 116 382fe: 81 f5 brne .+96 ; 0x38360 uint32_t addr = (((uint32_t)rampz) << 16) | address; 38300: b1 2c mov r11, r1 38302: 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; 38304: 0f 94 ed a0 call 0x341da ; 0x341da 38308: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 3830a: 0f 94 ed a0 call 0x341da ; 0x341da 3830e: c8 2e mov r12, r24 length |= getch(); 38310: 0f 94 ed a0 call 0x341da ; 0x341da 38314: e8 2e mov r14, r24 length |= getch(); 38316: 0f 94 ed a0 call 0x341da ; 0x341da 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; 3831a: 2c 2d mov r18, r12 3831c: 30 e0 ldi r19, 0x00 ; 0 3831e: 32 2f mov r19, r18 38320: 22 27 eor r18, r18 38322: f9 01 movw r30, r18 38324: fd 29 or r31, r13 38326: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 38328: 8e 29 or r24, r14 3832a: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 3832c: 0f 94 ed a0 call 0x341da ; 0x341da verifySpace(); 38330: 0f 94 65 a3 call 0x346ca ; 0x346ca xflash_wait_busy(); 38334: 0e 94 56 e2 call 0x1c4ac ; 0x1c4ac xflash_rd_data(addr, buff, length); 38338: 96 01 movw r18, r12 3833a: a3 01 movw r20, r6 3833c: c5 01 movw r24, r10 3833e: b8 01 movw r22, r16 38340: 0e 94 99 e2 call 0x1c532 ; 0x1c532 38344: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 38346: c5 01 movw r24, r10 38348: 86 19 sub r24, r6 3834a: 97 09 sbc r25, r7 3834c: 8c 15 cp r24, r12 3834e: 9d 05 cpc r25, r13 38350: 08 f0 brcs .+2 ; 0x38354 38352: 19 cf rjmp .-462 ; 0x38186 putch(buff[i]); 38354: f5 01 movw r30, r10 38356: 81 91 ld r24, Z+ 38358: 5f 01 movw r10, r30 3835a: 0f 94 e6 a0 call 0x341cc ; 0x341cc 3835e: f3 cf rjmp .-26 ; 0x38346 } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 38360: 85 37 cpi r24, 0x75 ; 117 38362: 51 f4 brne .+20 ; 0x38378 // READ SIGN - return what Avrdude wants to hear verifySpace(); 38364: 0f 94 65 a3 call 0x346ca ; 0x346ca putch(XFLASH_SIGNATURE_0); 38368: 8e e1 ldi r24, 0x1E ; 30 3836a: 0f 94 e6 a0 call 0x341cc ; 0x341cc putch(XFLASH_SIGNATURE_1); 3836e: 88 e9 ldi r24, 0x98 ; 152 38370: 0f 94 e6 a0 call 0x341cc ; 0x341cc putch(XFLASH_SIGNATURE_2); 38374: 81 e0 ldi r24, 0x01 ; 1 38376: 05 cf rjmp .-502 ; 0x38182 } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 38378: 81 35 cpi r24, 0x51 ; 81 3837a: 09 f0 breq .+2 ; 0x3837e 3837c: 29 cf rjmp .-430 ; 0x381d0 : "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" ); 3837e: f8 e1 ldi r31, 0x18 ; 24 38380: 28 e0 ldi r18, 0x08 ; 8 38382: 0f b6 in r0, 0x3f ; 63 38384: f8 94 cli 38386: a8 95 wdr 38388: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3838c: 0f be out 0x3f, r0 ; 63 3838e: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38392: 1e cf rjmp .-452 ; 0x381d0 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; 38394: 81 e0 ldi r24, 0x01 ; 1 38396: 7c ce rjmp .-776 ; 0x38090 00038398 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 38398: 81 e0 ldi r24, 0x01 ; 1 3839a: 0c 94 6b 70 jmp 0xe0d6 ; 0xe0d6 0003839e : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 3839e: 0f 93 push r16 383a0: 1f 93 push r17 383a2: cf 93 push r28 383a4: 8c 01 movw r16, r24 383a6: c6 2f mov r28, r22 lcd_update_enable(false); 383a8: 80 e0 ldi r24, 0x00 ; 0 383aa: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_clear(); 383ae: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 lcd_puts_at_P(0, 1, pgmS); 383b2: a8 01 movw r20, r16 383b4: 61 e0 ldi r22, 0x01 ; 1 383b6: 80 e0 ldi r24, 0x00 ; 0 383b8: 0e 94 3a 70 call 0xe074 ; 0xe074 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 383bc: 80 e2 ldi r24, 0x20 ; 32 383be: 0e 94 d5 70 call 0xe1aa ; 0xe1aa lcd_print(' '); lcd_print(slot + 1); 383c2: 6c 2f mov r22, r28 383c4: 70 e0 ldi r23, 0x00 ; 0 383c6: 6f 5f subi r22, 0xFF ; 255 383c8: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 383ca: 07 2e mov r0, r23 383cc: 00 0c add r0, r0 383ce: 88 0b sbc r24, r24 383d0: 99 0b sbc r25, r25 } 383d2: cf 91 pop r28 383d4: 1f 91 pop r17 383d6: 0f 91 pop r16 383d8: 0c 94 df 71 jmp 0xe3be ; 0xe3be 000383dc : 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); 383dc: 82 ed ldi r24, 0xD2 ; 210 383de: 9e e0 ldi r25, 0x0E ; 14 383e0: 0e 94 44 78 call 0xf088 ; 0xf088 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 383e4: 83 ed ldi r24, 0xD3 ; 211 383e6: 9e e0 ldi r25, 0x0E ; 14 383e8: 0c 94 37 78 jmp 0xf06e ; 0xf06e 000383ec : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 383ec: 41 e0 ldi r20, 0x01 ; 1 383ee: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 383f2: 81 11 cpse r24, r1 383f4: 01 c0 rjmp .+2 ; 0x383f8 383f6: 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'); 383f8: 40 5d subi r20, 0xD0 ; 208 383fa: 62 e0 ldi r22, 0x02 ; 2 383fc: 83 e0 ldi r24, 0x03 ; 3 383fe: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 38402: 0e 94 ef e3 call 0x1c7de ; 0x1c7de 38406: 40 e3 ldi r20, 0x30 ; 48 38408: 48 0f add r20, r24 3840a: 62 e0 ldi r22, 0x02 ; 2 3840c: 88 e0 ldi r24, 0x08 ; 8 3840e: 0e 94 46 70 call 0xe08c ; 0xe08c // print active/changing filament slot lcd_set_cursor(10, 2); 38412: 62 e0 ldi r22, 0x02 ; 2 38414: 8a e0 ldi r24, 0x0A ; 10 38416: 0e 94 26 70 call 0xe04c ; 0xe04c lcdui_print_extruder(); 3841a: 0f 94 73 36 call 0x26ce6 ; 0x26ce6 // Print active extruder temperature lcd_set_cursor(16, 2); 3841e: 62 e0 ldi r22, 0x02 ; 2 38420: 80 e1 ldi r24, 0x10 ; 16 38422: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 38426: 20 e0 ldi r18, 0x00 ; 0 38428: 30 e0 ldi r19, 0x00 ; 0 3842a: 40 e0 ldi r20, 0x00 ; 0 3842c: 5f e3 ldi r21, 0x3F ; 63 3842e: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 38432: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 38436: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 3843a: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 3843e: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 38442: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> 38446: 7f 93 push r23 38448: 6f 93 push r22 3844a: 8d e5 ldi r24, 0x5D ; 93 3844c: 9b ea ldi r25, 0xAB ; 171 3844e: 9f 93 push r25 38450: 8f 93 push r24 38452: 0e 94 ff 6f call 0xdffe ; 0xdffe 38456: 0f 90 pop r0 38458: 0f 90 pop r0 3845a: 0f 90 pop r0 3845c: 0f 90 pop r0 } 3845e: 08 95 ret 00038460 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 38460: 8a 30 cpi r24, 0x0A ; 10 38462: 20 f0 brcs .+8 ; 0x3846c 38464: 80 31 cpi r24, 0x10 ; 16 38466: 20 f4 brcc .+8 ; 0x38470 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 38468: 89 5a subi r24, 0xA9 ; 169 3846a: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 3846c: 80 5d subi r24, 0xD0 ; 208 3846e: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 38470: 80 e0 ldi r24, 0x00 ; 0 } } 38472: 08 95 ret 00038474 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 38474: 0f 93 push r16 38476: 1f 93 push r17 38478: cf 93 push r28 3847a: df 93 push r29 3847c: 08 2f mov r16, r24 3847e: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 38480: 90 e0 ldi r25, 0x00 ; 0 38482: 24 e0 ldi r18, 0x04 ; 4 38484: 95 95 asr r25 38486: 87 95 ror r24 38488: 2a 95 dec r18 3848a: e1 f7 brne .-8 ; 0x38484 uint8_t charsOut = 1; 3848c: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 3848e: 00 97 sbiw r24, 0x00 ; 0 38490: 21 f0 breq .+8 ; 0x3849a *dst = Nibble2Char(v); 38492: 0f 94 30 c2 call 0x38460 ; 0x38460 38496: 89 93 st Y+, r24 ++dst; charsOut = 2; 38498: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 3849a: 80 2f mov r24, r16 3849c: 8f 70 andi r24, 0x0F ; 15 3849e: 0f 94 30 c2 call 0x38460 ; 0x38460 384a2: 88 83 st Y, r24 return charsOut; } 384a4: 81 2f mov r24, r17 384a6: df 91 pop r29 384a8: cf 91 pop r28 384aa: 1f 91 pop r17 384ac: 0f 91 pop r16 384ae: 08 95 ret 000384b0 : } 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) { 384b0: 80 33 cpi r24, 0x30 ; 48 384b2: 30 f0 brcs .+12 ; 0x384c0 384b4: 8a 33 cpi r24, 0x3A ; 58 384b6: 30 f0 brcs .+12 ; 0x384c4 384b8: 9f e9 ldi r25, 0x9F ; 159 384ba: 98 0f add r25, r24 384bc: 96 30 cpi r25, 0x06 ; 6 384be: 20 f0 brcs .+8 ; 0x384c8 case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 384c0: 80 e0 ldi r24, 0x00 ; 0 } } 384c2: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 384c4: 80 53 subi r24, 0x30 ; 48 384c6: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 384c8: 87 55 subi r24, 0x57 ; 87 384ca: 08 95 ret 000384cc : /// 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 { 384cc: cf 93 push r28 384ce: df 93 push r29 384d0: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 384d2: 68 81 ld r22, Y 384d4: 80 e0 ldi r24, 0x00 ; 0 384d6: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 384da: 69 81 ldd r22, Y+1 ; 0x01 384dc: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 384e0: 6a 81 ldd r22, Y+2 ; 0x02 384e2: 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]); 384e4: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 384e8: 6c 2f mov r22, r28 return crc; } 384ea: df 91 pop r29 384ec: cf 91 pop r28 384ee: 0d 94 f9 a0 jmp 0x341f2 ; 0x341f2 000384f2 : 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 { 384f2: cf 93 push r28 384f4: df 93 push r29 384f6: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 384f8: 0f 94 66 c2 call 0x384cc ; 0x384cc crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 384fc: 6d 81 ldd r22, Y+5 ; 0x05 384fe: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 38502: 6e 81 ldd r22, Y+6 ; 0x06 38504: cf 81 ldd r28, Y+7 ; 0x07 38506: 0f 94 f9 a0 call 0x341f2 ; 0x341f2 3850a: 6c 2f mov r22, r28 return crc; } 3850c: df 91 pop r29 3850e: cf 91 pop r28 38510: 0d 94 f9 a0 jmp 0x341f2 ; 0x341f2 00038514 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 38514: cf 93 push r28 38516: df 93 push r29 38518: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 3851a: 68 83 st Y, r22 3851c: 49 83 std Y+1, r20 ; 0x01 3851e: 1b 82 std Y+3, r1 ; 0x03 38520: 1a 82 std Y+2, r1 ; 0x02 38522: 0f 94 66 c2 call 0x384cc ; 0x384cc 38526: 8c 83 std Y+4, r24 ; 0x04 } 38528: df 91 pop r29 3852a: cf 91 pop r28 3852c: 08 95 ret 0003852e : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 3852e: 9f b7 in r25, 0x3f ; 63 38530: f8 94 cli 38532: e5 e0 ldi r30, 0x05 ; 5 38534: f1 e0 ldi r31, 0x01 ; 1 38536: 80 81 ld r24, Z 38538: 8f 7d andi r24, 0xDF ; 223 3853a: 80 83 st Z, r24 3853c: 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); 3853e: 8f e8 ldi r24, 0x8F ; 143 38540: 91 e0 ldi r25, 0x01 ; 1 38542: 01 97 sbiw r24, 0x01 ; 1 38544: f1 f7 brne .-4 ; 0x38542 38546: 00 c0 rjmp .+0 ; 0x38548 38548: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 3854a: 9f b7 in r25, 0x3f ; 63 3854c: f8 94 cli 3854e: 80 81 ld r24, Z 38550: 80 62 ori r24, 0x20 ; 32 38552: 80 83 st Z, r24 38554: 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 } 38556: 08 95 ret 00038558 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 38558: 14 9a sbi 0x02, 4 ; 2 } 3855a: 08 95 ret 0003855c : 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) { 3855c: cf 92 push r12 3855e: df 92 push r13 38560: ef 92 push r14 38562: ff 92 push r15 38564: cf 93 push r28 38566: df 93 push r29 38568: 69 01 movw r12, r18 3856a: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 3856c: c0 e4 ldi r28, 0x40 ; 64 3856e: d7 e0 ldi r29, 0x07 ; 7 38570: 9b 01 movw r18, r22 38572: ac 01 movw r20, r24 38574: 6c 85 ldd r22, Y+12 ; 0x0c 38576: 7d 85 ldd r23, Y+13 ; 0x0d 38578: 8e 85 ldd r24, Y+14 ; 0x0e 3857a: 9f 85 ldd r25, Y+15 ; 0x0f 3857c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 38580: 6c 87 std Y+12, r22 ; 0x0c 38582: 7d 87 std Y+13, r23 ; 0x0d 38584: 8e 87 std Y+14, r24 ; 0x0e 38586: 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); 38588: c7 01 movw r24, r14 3858a: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 3858c: df 91 pop r29 3858e: cf 91 pop r28 38590: ff 90 pop r15 38592: ef 90 pop r14 38594: df 90 pop r13 38596: 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); 38598: 0d 94 11 ba jmp 0x37422 ; 0x37422 0003859c : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 3859c: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 385a0: 0d 94 db 57 jmp 0x2afb6 ; 0x2afb6 000385a4 : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 385a4: cf 93 push r28 385a6: df 93 push r29 385a8: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 385aa: 84 e1 ldi r24, 0x14 ; 20 385ac: 9b ea ldi r25, 0xAB ; 171 385ae: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_MMU2(); 385b2: 87 e5 ldi r24, 0x57 ; 87 385b4: 9b ea ldi r25, 0xAB ; 171 385b6: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 SERIAL_ECHOLNRPGM(msg); 385ba: ce 01 movw r24, r28 } 385bc: df 91 pop r29 385be: 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); 385c0: 0c 94 97 7b jmp 0xf72e ; 0xf72e 000385c4 : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 385c4: 0c 94 ef e3 jmp 0x1c7de ; 0x1c7de 000385c8 : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 385c8: 89 32 cpi r24, 0x29 ; 41 385ca: 20 e8 ldi r18, 0x80 ; 128 385cc: 92 07 cpc r25, r18 385ce: 09 f4 brne .+2 ; 0x385d2 385d0: 97 c0 rjmp .+302 ; 0x38700 385d2: 08 f0 brcs .+2 ; 0x385d6 385d4: 48 c0 rjmp .+144 ; 0x38666 385d6: 86 30 cpi r24, 0x06 ; 6 385d8: 60 e8 ldi r22, 0x80 ; 128 385da: 96 07 cpc r25, r22 385dc: 09 f4 brne .+2 ; 0x385e0 385de: 9a c0 rjmp .+308 ; 0x38714 385e0: 30 f5 brcc .+76 ; 0x3862e 385e2: 83 30 cpi r24, 0x03 ; 3 385e4: 40 e8 ldi r20, 0x80 ; 128 385e6: 94 07 cpc r25, r20 385e8: 09 f4 brne .+2 ; 0x385ec 385ea: 80 c0 rjmp .+256 ; 0x386ec 385ec: a8 f4 brcc .+42 ; 0x38618 385ee: 81 30 cpi r24, 0x01 ; 1 385f0: 20 e8 ldi r18, 0x80 ; 128 385f2: 92 07 cpc r25, r18 385f4: 09 f4 brne .+2 ; 0x385f8 385f6: 17 c1 rjmp .+558 ; 0x38826 385f8: 82 30 cpi r24, 0x02 ; 2 385fa: 40 e8 ldi r20, 0x80 ; 128 385fc: 94 07 cpc r25, r20 385fe: 09 f4 brne .+2 ; 0x38602 38600: 73 c0 rjmp .+230 ; 0x386e8 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); 38602: 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)) { 38604: 86 ff sbrs r24, 6 38606: 8e c0 rjmp .+284 ; 0x38724 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); 38608: 22 27 eor r18, r18 3860a: 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) { 3860c: 21 15 cp r18, r1 3860e: 32 4c sbci r19, 0xC2 ; 194 38610: 09 f0 breq .+2 ; 0x38614 38612: 9e c0 rjmp .+316 ; 0x38750 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 38614: 8e e1 ldi r24, 0x1E ; 30 38616: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38618: 84 30 cpi r24, 0x04 ; 4 3861a: 60 e8 ldi r22, 0x80 ; 128 3861c: 96 07 cpc r25, r22 3861e: 09 f4 brne .+2 ; 0x38622 38620: 67 c0 rjmp .+206 ; 0x386f0 38622: 85 30 cpi r24, 0x05 ; 5 38624: 20 e8 ldi r18, 0x80 ; 128 38626: 92 07 cpc r25, r18 38628: 61 f7 brne .-40 ; 0x38602 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); 3862a: 84 e2 ldi r24, 0x24 ; 36 3862c: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3862e: 8a 30 cpi r24, 0x0A ; 10 38630: 40 e8 ldi r20, 0x80 ; 128 38632: 94 07 cpc r25, r20 38634: 09 f4 brne .+2 ; 0x38638 38636: 5e c0 rjmp .+188 ; 0x386f4 38638: 58 f4 brcc .+22 ; 0x38650 3863a: 88 30 cpi r24, 0x08 ; 8 3863c: 20 e8 ldi r18, 0x80 ; 128 3863e: 92 07 cpc r25, r18 38640: 09 f4 brne .+2 ; 0x38644 38642: 6e c0 rjmp .+220 ; 0x38720 38644: 89 30 cpi r24, 0x09 ; 9 38646: 40 e8 ldi r20, 0x80 ; 128 38648: 94 07 cpc r25, r20 3864a: d9 f6 brne .-74 ; 0x38602 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); 3864c: 85 e0 ldi r24, 0x05 ; 5 3864e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38650: 8c 30 cpi r24, 0x0C ; 12 38652: 60 e8 ldi r22, 0x80 ; 128 38654: 96 07 cpc r25, r22 38656: 09 f4 brne .+2 ; 0x3865a 38658: 51 c0 rjmp .+162 ; 0x386fc 3865a: 8d 30 cpi r24, 0x0D ; 13 3865c: 20 e8 ldi r18, 0x80 ; 128 3865e: 92 07 cpc r25, r18 38660: 81 f6 brne .-96 ; 0x38602 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); 38662: 81 e2 ldi r24, 0x21 ; 33 38664: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38666: 8f 32 cpi r24, 0x2F ; 47 38668: 40 e8 ldi r20, 0x80 ; 128 3866a: 94 07 cpc r25, r20 3866c: 09 f4 brne .+2 ; 0x38670 3866e: 56 c0 rjmp .+172 ; 0x3871c 38670: e0 f4 brcc .+56 ; 0x386aa 38672: 8c 32 cpi r24, 0x2C ; 44 38674: 20 e8 ldi r18, 0x80 ; 128 38676: 92 07 cpc r25, r18 38678: 09 f4 brne .+2 ; 0x3867c 3867a: 4e c0 rjmp .+156 ; 0x38718 3867c: 58 f4 brcc .+22 ; 0x38694 3867e: 8a 32 cpi r24, 0x2A ; 42 38680: 60 e8 ldi r22, 0x80 ; 128 38682: 96 07 cpc r25, r22 38684: c9 f1 breq .+114 ; 0x386f8 38686: 8b 32 cpi r24, 0x2B ; 43 38688: 20 e8 ldi r18, 0x80 ; 128 3868a: 92 07 cpc r25, r18 3868c: 09 f0 breq .+2 ; 0x38690 3868e: b9 cf rjmp .-142 ; 0x38602 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); 38690: 86 e2 ldi r24, 0x26 ; 38 38692: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38694: 8d 32 cpi r24, 0x2D ; 45 38696: 40 e8 ldi r20, 0x80 ; 128 38698: 94 07 cpc r25, r20 3869a: d1 f1 breq .+116 ; 0x38710 3869c: 8e 32 cpi r24, 0x2E ; 46 3869e: 60 e8 ldi r22, 0x80 ; 128 386a0: 96 07 cpc r25, r22 386a2: 09 f0 breq .+2 ; 0x386a6 386a4: ae cf rjmp .-164 ; 0x38602 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); 386a6: 82 e2 ldi r24, 0x22 ; 34 386a8: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386aa: 87 38 cpi r24, 0x87 ; 135 386ac: 20 e8 ldi r18, 0x80 ; 128 386ae: 92 07 cpc r25, r18 386b0: 49 f1 breq .+82 ; 0x38704 386b2: 58 f4 brcc .+22 ; 0x386ca 386b4: 87 34 cpi r24, 0x47 ; 71 386b6: 60 e8 ldi r22, 0x80 ; 128 386b8: 96 07 cpc r25, r22 386ba: 29 f0 breq .+10 ; 0x386c6 386bc: 8b 34 cpi r24, 0x4B ; 75 386be: 20 e8 ldi r18, 0x80 ; 128 386c0: 92 07 cpc r25, r18 386c2: 09 f0 breq .+2 ; 0x386c6 386c4: 9e cf rjmp .-196 ; 0x38602 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); 386c6: 84 e0 ldi r24, 0x04 ; 4 386c8: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386ca: 87 30 cpi r24, 0x07 ; 7 386cc: 41 e8 ldi r20, 0x81 ; 129 386ce: 94 07 cpc r25, r20 386d0: d9 f0 breq .+54 ; 0x38708 386d2: 8b 30 cpi r24, 0x0B ; 11 386d4: 61 e8 ldi r22, 0x81 ; 129 386d6: 96 07 cpc r25, r22 386d8: c9 f0 breq .+50 ; 0x3870c 386da: 8b 38 cpi r24, 0x8B ; 139 386dc: 20 e8 ldi r18, 0x80 ; 128 386de: 92 07 cpc r25, r18 386e0: 09 f0 breq .+2 ; 0x386e4 386e2: 8f cf rjmp .-226 ; 0x38602 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); 386e4: 89 e0 ldi r24, 0x09 ; 9 386e6: 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); 386e8: 81 e0 ldi r24, 0x01 ; 1 386ea: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 386ec: 82 e0 ldi r24, 0x02 ; 2 386ee: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 386f0: 83 e0 ldi r24, 0x03 ; 3 386f2: 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); 386f4: 86 e0 ldi r24, 0x06 ; 6 386f6: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 386f8: 87 e0 ldi r24, 0x07 ; 7 386fa: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 386fc: 8a e2 ldi r24, 0x2A ; 42 386fe: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 38700: 8b e2 ldi r24, 0x2B ; 43 38702: 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); 38704: 88 e0 ldi r24, 0x08 ; 8 38706: 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); 38708: 8a e0 ldi r24, 0x0A ; 10 3870a: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 3870c: 8b e0 ldi r24, 0x0B ; 11 3870e: 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); 38710: 83 e2 ldi r24, 0x23 ; 35 38712: 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); 38714: 85 e2 ldi r24, 0x25 ; 37 38716: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 38718: 87 e2 ldi r24, 0x27 ; 39 3871a: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 3871c: 88 e2 ldi r24, 0x28 ; 40 3871e: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 38720: 89 e2 ldi r24, 0x29 ; 41 38722: 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)) { 38724: 87 ff sbrs r24, 7 38726: 07 c0 rjmp .+14 ; 0x38736 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); 38728: 22 27 eor r18, r18 3872a: 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) { 3872c: 21 15 cp r18, r1 3872e: 32 4c sbci r19, 0xC2 ; 194 38730: a1 f5 brne .+104 ; 0x3879a return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 38732: 8f e1 ldi r24, 0x1F ; 31 38734: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 38736: 22 27 eor r18, r18 38738: 31 70 andi r19, 0x01 ; 1 3873a: 90 ff sbrs r25, 0 3873c: 52 c0 rjmp .+164 ; 0x387e2 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); 3873e: ac 01 movw r20, r24 38740: 44 27 eor r20, r20 38742: 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) { 38744: 41 15 cp r20, r1 38746: 52 4c sbci r21, 0xC2 ; 194 38748: 09 f0 breq .+2 ; 0x3874c 3874a: 4b c0 rjmp .+150 ; 0x387e2 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 3874c: 80 e2 ldi r24, 0x20 ; 32 3874e: 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; 38750: 9c 01 movw r18, r24 38752: 22 27 eor r18, r18 38754: 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)) { 38756: 23 2b or r18, r19 38758: 09 f0 breq .+2 ; 0x3875c 3875a: 67 c0 rjmp .+206 ; 0x3882a 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; 3875c: 9c 01 movw r18, r24 3875e: 22 27 eor r18, r18 38760: 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)) { 38762: 23 2b or r18, r19 38764: 09 f0 breq .+2 ; 0x38768 38766: 63 c0 rjmp .+198 ; 0x3882e 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; 38768: 9c 01 movw r18, r24 3876a: 22 27 eor r18, r18 3876c: 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)) { 3876e: 23 2b or r18, r19 38770: 09 f0 breq .+2 ; 0x38774 38772: 5f c0 rjmp .+190 ; 0x38832 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; 38774: 9c 01 movw r18, r24 38776: 22 27 eor r18, r18 38778: 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)) { 3877a: 23 2b or r18, r19 3877c: 09 f0 breq .+2 ; 0x38780 3877e: 5b c0 rjmp .+182 ; 0x38836 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; 38780: 9c 01 movw r18, r24 38782: 22 27 eor r18, r18 38784: 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)) { 38786: 23 2b or r18, r19 38788: 09 f0 breq .+2 ; 0x3878c 3878a: 57 c0 rjmp .+174 ; 0x3883a 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; 3878c: 88 27 eor r24, r24 3878e: 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)) { 38790: 89 2b or r24, r25 38792: 09 f4 brne .+2 ; 0x38796 38794: 68 c0 rjmp .+208 ; 0x38866 return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 38796: 8f e0 ldi r24, 0x0F ; 15 38798: 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; 3879a: 9c 01 movw r18, r24 3879c: 22 27 eor r18, r18 3879e: 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)) { 387a0: 23 2b or r18, r19 387a2: 09 f0 breq .+2 ; 0x387a6 387a4: 4c c0 rjmp .+152 ; 0x3883e 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; 387a6: 9c 01 movw r18, r24 387a8: 22 27 eor r18, r18 387aa: 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)) { 387ac: 23 2b or r18, r19 387ae: 09 f0 breq .+2 ; 0x387b2 387b0: 48 c0 rjmp .+144 ; 0x38842 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; 387b2: 9c 01 movw r18, r24 387b4: 22 27 eor r18, r18 387b6: 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)) { 387b8: 23 2b or r18, r19 387ba: 09 f0 breq .+2 ; 0x387be 387bc: 44 c0 rjmp .+136 ; 0x38846 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; 387be: 9c 01 movw r18, r24 387c0: 22 27 eor r18, r18 387c2: 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)) { 387c4: 23 2b or r18, r19 387c6: 09 f0 breq .+2 ; 0x387ca 387c8: 40 c0 rjmp .+128 ; 0x3884a 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; 387ca: 9c 01 movw r18, r24 387cc: 22 27 eor r18, r18 387ce: 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)) { 387d0: 23 2b or r18, r19 387d2: e9 f5 brne .+122 ; 0x3884e 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; 387d4: 88 27 eor r24, r24 387d6: 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)) { 387d8: 89 2b or r24, r25 387da: 09 f4 brne .+2 ; 0x387de 387dc: 44 c0 rjmp .+136 ; 0x38866 return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 387de: 80 e1 ldi r24, 0x10 ; 16 387e0: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 387e2: 23 2b or r18, r19 387e4: 09 f4 brne .+2 ; 0x387e8 387e6: 3f c0 rjmp .+126 ; 0x38866 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 } 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)) { 387ee: 23 2b or r18, r19 387f0: 81 f5 brne .+96 ; 0x38852 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; 387f2: 9c 01 movw r18, r24 387f4: 22 27 eor r18, r18 387f6: 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)) { 387f8: 23 2b or r18, r19 387fa: 69 f5 brne .+90 ; 0x38856 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; 387fc: 9c 01 movw r18, r24 387fe: 22 27 eor r18, r18 38800: 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)) { 38802: 23 2b or r18, r19 38804: 51 f5 brne .+84 ; 0x3885a 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; 38806: 9c 01 movw r18, r24 38808: 22 27 eor r18, r18 3880a: 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)) { 3880c: 23 2b or r18, r19 3880e: 39 f5 brne .+78 ; 0x3885e 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; 38810: 9c 01 movw r18, r24 38812: 22 27 eor r18, r18 38814: 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)) { 38816: 23 2b or r18, r19 38818: 21 f5 brne .+72 ; 0x38862 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; 3881a: 88 27 eor r24, r24 3881c: 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)) { 3881e: 89 2b or r24, r25 38820: 11 f1 breq .+68 ; 0x38866 return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 38822: 81 e1 ldi r24, 0x11 ; 17 38824: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 38826: 80 e0 ldi r24, 0x00 ; 0 38828: 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); 3882a: 82 e1 ldi r24, 0x12 ; 18 3882c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 3882e: 85 e1 ldi r24, 0x15 ; 21 38830: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 38832: 88 e1 ldi r24, 0x18 ; 24 38834: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 38836: 8b e1 ldi r24, 0x1B ; 27 38838: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 3883a: 8c e0 ldi r24, 0x0C ; 12 3883c: 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); 3883e: 83 e1 ldi r24, 0x13 ; 19 38840: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 38842: 86 e1 ldi r24, 0x16 ; 22 38844: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 38846: 89 e1 ldi r24, 0x19 ; 25 38848: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 3884a: 8c e1 ldi r24, 0x1C ; 28 3884c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 3884e: 8d e0 ldi r24, 0x0D ; 13 38850: 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); 38852: 84 e1 ldi r24, 0x14 ; 20 38854: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 38856: 87 e1 ldi r24, 0x17 ; 23 38858: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 3885a: 8a e1 ldi r24, 0x1A ; 26 3885c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 3885e: 8d e1 ldi r24, 0x1D ; 29 38860: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 38862: 8e e0 ldi r24, 0x0E ; 14 38864: 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); 38866: 8c e2 ldi r24, 0x2C ; 44 } 38868: 08 95 ret 0003886a : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 3886a: cf 92 push r12 3886c: df 92 push r13 3886e: ef 92 push r14 38870: ff 92 push r15 38872: 0f 93 push r16 38874: 1f 93 push r17 38876: cf 93 push r28 38878: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 3887a: 20 91 66 13 lds r18, 0x1366 ; 0x801366 3887e: 30 91 67 13 lds r19, 0x1367 ; 0x801367 38882: 21 30 cpi r18, 0x01 ; 1 38884: 31 05 cpc r19, r1 38886: 39 f4 brne .+14 ; 0x38896 38888: 20 91 8f 13 lds r18, 0x138F ; 0x80138f 3888c: 21 30 cpi r18, 0x01 ; 1 3888e: 19 f4 brne .+6 ; 0x38896 // 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; 38890: 22 e0 ldi r18, 0x02 ; 2 38892: 20 93 cf 17 sts 0x17CF, r18 ; 0x8017cf } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 38896: 0f 94 e4 c2 call 0x385c8 ; 0x385c8 3889a: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 3889c: 80 91 cf 17 lds r24, 0x17CF ; 0x8017cf 388a0: 81 30 cpi r24, 0x01 ; 1 388a2: 09 f4 brne .+2 ; 0x388a6 388a4: 64 c0 rjmp .+200 ; 0x3896e 388a6: 60 f0 brcs .+24 ; 0x388c0 388a8: 82 30 cpi r24, 0x02 ; 2 388aa: 09 f4 brne .+2 ; 0x388ae 388ac: f4 c0 rjmp .+488 ; 0x38a96 ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 388ae: df 91 pop r29 388b0: cf 91 pop r28 388b2: 1f 91 pop r17 388b4: 0f 91 pop r16 388b6: ff 90 pop r15 388b8: ef 90 pop r14 388ba: df 90 pop r13 388bc: cf 90 pop r12 388be: 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); 388c0: 84 e0 ldi r24, 0x04 ; 4 388c2: 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); 388c6: 0d 2f mov r16, r29 388c8: 10 e0 ldi r17, 0x00 ; 0 388ca: f8 01 movw r30, r16 388cc: ef 53 subi r30, 0x3F ; 63 388ce: f4 45 sbci r31, 0x54 ; 84 388d0: 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); 388d2: fc 2e mov r15, r28 388d4: f2 94 swap r15 388d6: 6f e0 ldi r22, 0x0F ; 15 388d8: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 388da: 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); 388dc: 80 e0 ldi r24, 0x00 ; 0 388de: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_clear(); 388e2: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 // 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); 388e6: 00 0f add r16, r16 388e8: 11 1f adc r17, r17 388ea: f8 01 movw r30, r16 388ec: e2 51 subi r30, 0x12 ; 18 388ee: f4 45 sbci r31, 0x54 ; 84 388f0: c5 90 lpm r12, Z+ 388f2: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 388f4: 03 53 subi r16, 0x33 ; 51 388f6: 17 45 sbci r17, 0x57 ; 87 388f8: f8 01 movw r30, r16 388fa: 85 91 lpm r24, Z+ 388fc: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 388fe: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 38902: df 92 push r13 38904: cf 92 push r12 38906: 9f 93 push r25 38908: 8f 93 push r24 3890a: 8a e5 ldi r24, 0x5A ; 90 3890c: 9c ea ldi r25, 0xAC ; 172 3890e: 9f 93 push r25 38910: 8f 93 push r24 38912: 0e 94 ff 6f call 0xdffe ; 0xdffe 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)); 38916: 45 e4 ldi r20, 0x45 ; 69 38918: 59 ea ldi r21, 0xA9 ; 169 3891a: 62 e0 ldi r22, 0x02 ; 2 3891c: 80 e0 ldi r24, 0x00 ; 0 3891e: 0e 94 3a 70 call 0xe074 ; 0xe074 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()); 38922: 0f 90 pop r0 38924: 0f 90 pop r0 38926: 0f 90 pop r0 38928: 0f 90 pop r0 3892a: 0f 90 pop r0 3892c: 0f 90 pop r0 3892e: f1 10 cpse r15, r1 38930: c6 c0 rjmp .+396 ; 0x38abe 38932: 10 e0 ldi r17, 0x00 ; 0 38934: 00 e0 ldi r16, 0x00 ; 0 38936: 42 e1 ldi r20, 0x12 ; 18 38938: e4 2e mov r14, r20 3893a: 5c ed ldi r21, 0xDC ; 220 3893c: c5 2e mov r12, r21 3893e: 51 e7 ldi r21, 0x71 ; 113 38940: 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); 38942: ec 2f mov r30, r28 38944: f0 e0 ldi r31, 0x00 ; 0 38946: ee 0f add r30, r30 38948: ff 1f adc r31, r31 3894a: ea 5b subi r30, 0xBA ; 186 3894c: f3 45 sbci r31, 0x53 ; 83 3894e: 85 91 lpm r24, Z+ 38950: 94 91 lpm r25, Z 38952: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 38956: bc 01 movw r22, r24 38958: 81 e0 ldi r24, 0x01 ; 1 3895a: f1 10 cpse r15, r1 3895c: 01 c0 rjmp .+2 ; 0x38960 3895e: 80 e0 ldi r24, 0x00 ; 0 38960: 2e 2d mov r18, r14 38962: a6 01 movw r20, r12 38964: 0f 94 fe 33 call 0x267fc ; 0x267fc switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 38968: 81 e0 ldi r24, 0x01 ; 1 3896a: 80 93 cf 17 sts 0x17CF, r24 ; 0x8017cf [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 3896e: 81 e0 ldi r24, 0x01 ; 1 38970: 80 93 71 07 sts 0x0771, r24 ; 0x800771 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.506> ReportErrorHookDynamicRender(); // Render dynamic characters 38974: 0f 94 f6 c1 call 0x383ec ; 0x383ec sound_wait_for_user(); 38978: 0f 94 be 69 call 0x2d37c ; 0x2d37c 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); 3897c: 0d 2f mov r16, r29 3897e: 10 e0 ldi r17, 0x00 ; 0 38980: f8 01 movw r30, r16 38982: ef 53 subi r30, 0x3F ; 63 38984: f4 45 sbci r31, 0x54 ; 84 38986: 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); 38988: dc 2f mov r29, r28 3898a: d2 95 swap r29 3898c: 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; 3898e: 80 91 c7 17 lds r24, 0x17C7 ; 0x8017c7 38992: 81 11 cpse r24, r1 38994: 09 c0 rjmp .+18 ; 0x389a8 38996: 81 e0 ldi r24, 0x01 ; 1 38998: d1 11 cpse r29, r1 3899a: 01 c0 rjmp .+2 ; 0x3899e 3899c: 80 e0 ldi r24, 0x00 ; 0 3899e: 80 93 c6 17 sts 0x17C6, r24 ; 0x8017c6 389a2: 81 e0 ldi r24, 0x01 ; 1 389a4: 80 93 c7 17 sts 0x17C7, r24 ; 0x8017c7 static int8_t choice_selected = -1; if (reset_button_selection) { 389a8: 80 91 c5 17 lds r24, 0x17C5 ; 0x8017c5 389ac: 88 23 and r24, r24 389ae: 41 f0 breq .+16 ; 0x389c0 // 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; 389b0: 81 e0 ldi r24, 0x01 ; 1 389b2: d1 11 cpse r29, r1 389b4: 01 c0 rjmp .+2 ; 0x389b8 389b6: 80 e0 ldi r24, 0x00 ; 0 389b8: 80 93 c6 17 sts 0x17C6, r24 ; 0x8017c6 choice_selected = -1; reset_button_selection = 0; 389bc: 10 92 c5 17 sts 0x17C5, r1 ; 0x8017c5 } // Check if knob was rotated if (lcd_encoder) { 389c0: 20 91 34 05 lds r18, 0x0534 ; 0x800534 389c4: 30 91 35 05 lds r19, 0x0535 ; 0x800535 389c8: 21 15 cp r18, r1 389ca: 31 05 cpc r19, r1 389cc: b9 f1 breq .+110 ; 0x38a3c 389ce: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 if (two_choices == false) { // third_choice is not nullptr, safe to dereference 389d2: dd 23 and r29, r29 389d4: 61 f0 breq .+24 ; 0x389ee if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 389d6: 37 ff sbrs r19, 7 389d8: 06 c0 rjmp .+12 ; 0x389e6 389da: 88 23 and r24, r24 389dc: 69 f0 breq .+26 ; 0x389f8 // Rotating knob counter clockwise current_selection--; 389de: 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; 389e0: 80 93 c6 17 sts 0x17C6, r24 ; 0x8017c6 389e4: 09 c0 rjmp .+18 ; 0x389f8 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) { 389e6: 82 30 cpi r24, 0x02 ; 2 389e8: 39 f0 breq .+14 ; 0x389f8 // Rotating knob clockwise current_selection++; 389ea: 8f 5f subi r24, 0xFF ; 255 389ec: f9 cf rjmp .-14 ; 0x389e0 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 389ee: 37 ff sbrs r19, 7 389f0: 41 c0 rjmp .+130 ; 0x38a74 389f2: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 389f4: 10 92 c6 17 sts 0x17C6, r1 ; 0x8017c6 //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 389f8: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 389fc: 4e e3 ldi r20, 0x3E ; 62 389fe: 81 11 cpse r24, r1 38a00: 40 e2 ldi r20, 0x20 ; 32 38a02: 63 e0 ldi r22, 0x03 ; 3 38a04: 80 e0 ldi r24, 0x00 ; 0 38a06: 0e 94 46 70 call 0xe08c ; 0xe08c 38a0a: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 if (two_choices == false) 38a0e: dd 23 and r29, r29 38a10: b1 f1 breq .+108 ; 0x38a7e { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38a12: 4e e3 ldi r20, 0x3E ; 62 38a14: 81 30 cpi r24, 0x01 ; 1 38a16: 09 f0 breq .+2 ; 0x38a1a 38a18: 40 e2 ldi r20, 0x20 ; 32 38a1a: 63 e0 ldi r22, 0x03 ; 3 38a1c: 89 e0 ldi r24, 0x09 ; 9 38a1e: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 38a22: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 38a26: 82 30 cpi r24, 0x02 ; 2 38a28: 61 f5 brne .+88 ; 0x38a82 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38a2a: 4e e3 ldi r20, 0x3E ; 62 38a2c: 63 e0 ldi r22, 0x03 ; 3 38a2e: 82 e1 ldi r24, 0x12 ; 18 38a30: 0e 94 46 70 call 0xe08c ; 0xe08c } // Consume rotation event lcd_encoder = 0; 38a34: 10 92 35 05 sts 0x0535, r1 ; 0x800535 38a38: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 38a3c: 0e 94 43 72 call 0xe486 ; 0xe486 38a40: 88 23 and r24, r24 38a42: 09 f4 brne .+2 ; 0x38a46 38a44: 34 cf rjmp .-408 ; 0x388ae choice_selected = current_selection; 38a46: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 38a4a: d1 11 cpse r29, r1 38a4c: 1c c0 rjmp .+56 ; 0x38a86 38a4e: 81 30 cpi r24, 0x01 ; 1 38a50: 89 f5 brne .+98 ; 0x38ab4 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); 38a52: f8 01 movw r30, r16 38a54: ee 0f add r30, r30 38a56: ff 1f adc r31, r31 38a58: e9 59 subi r30, 0x99 ; 153 38a5a: f4 45 sbci r31, 0x54 ; 84 38a5c: 85 91 lpm r24, Z+ 38a5e: 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))); 38a60: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 38a64: 0f 94 d6 34 call 0x269ac ; 0x269ac SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38a68: 81 e0 ldi r24, 0x01 ; 1 38a6a: 80 93 c5 17 sts 0x17C5, r24 ; 0x8017c5 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; 38a6e: 10 92 cf 17 sts 0x17CF, r1 ; 0x8017cf 38a72: 1d cf rjmp .-454 ; 0x388ae } } 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) { 38a74: 81 30 cpi r24, 0x01 ; 1 38a76: 09 f4 brne .+2 ; 0x38a7a 38a78: bf cf rjmp .-130 ; 0x389f8 // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 38a7a: 81 e0 ldi r24, 0x01 ; 1 38a7c: b1 cf rjmp .-158 ; 0x389e0 { 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 ? '>': ' '); 38a7e: 81 30 cpi r24, 0x01 ; 1 38a80: a1 f2 breq .-88 ; 0x38a2a 38a82: 40 e2 ldi r20, 0x20 ; 32 38a84: d3 cf rjmp .-90 ; 0x38a2c // 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 38a86: 82 30 cpi r24, 0x02 ; 2 38a88: 21 f3 breq .-56 ; 0x38a52 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 38a8a: 81 30 cpi r24, 0x01 ; 1 38a8c: 99 f4 brne .+38 ; 0x38ab4 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 38a8e: d0 93 5c 0e sts 0x0E5C, r29 ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38a92: 80 93 c5 17 sts 0x17C5, r24 ; 0x8017c5 // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 38a96: 81 e0 ldi r24, 0x01 ; 1 38a98: 0e 94 6b 70 call 0xe0d6 ; 0xe0d6 lcd_return_to_status(); 38a9c: 0f 94 1d 26 call 0x24c3a ; 0x24c3a 38aa0: 10 92 69 05 sts 0x0569, r1 ; 0x800569 <_ZL10beep_timer.lto_priv.510> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 38aa4: 10 92 6c 05 sts 0x056C, r1 ; 0x80056c <_ZL6bFirst.lto_priv.511> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 38aa8: 10 92 71 07 sts 0x0771, r1 ; 0x800771 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.506> KEEPALIVE_STATE(IN_HANDLER); 38aac: 82 e0 ldi r24, 0x02 ; 2 38aae: 80 93 96 02 sts 0x0296, r24 ; 0x800296 38ab2: dd cf rjmp .-70 ; 0x38a6e 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); 38ab4: cf 70 andi r28, 0x0F ; 15 38ab6: c0 93 5c 0e sts 0x0E5C, r28 ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38aba: 81 e0 ldi r24, 0x01 ; 1 38abc: ea cf rjmp .-44 ; 0x38a92 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); 38abe: ef 2d mov r30, r15 38ac0: f0 e0 ldi r31, 0x00 ; 0 38ac2: ee 0f add r30, r30 38ac4: ff 1f adc r31, r31 38ac6: ea 5b subi r30, 0xBA ; 186 38ac8: f3 45 sbci r31, 0x53 ; 83 38aca: 85 91 lpm r24, Z+ 38acc: 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()); 38ace: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 38ad2: 6c 01 movw r12, r24 38ad4: 0c ed ldi r16, 0xDC ; 220 38ad6: 11 e7 ldi r17, 0x71 ; 113 38ad8: 99 e0 ldi r25, 0x09 ; 9 38ada: e9 2e mov r14, r25 38adc: 32 cf rjmp .-412 ; 0x38942 00038ade : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 38ade: 0f 94 e4 c2 call 0x385c8 ; 0x385c8 // 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); 38ae2: e8 2f mov r30, r24 38ae4: f0 e0 ldi r31, 0x00 ; 0 38ae6: ee 0f add r30, r30 38ae8: ff 1f adc r31, r31 38aea: e2 51 subi r30, 0x12 ; 18 38aec: f4 45 sbci r31, 0x54 ; 84 38aee: 25 91 lpm r18, Z+ 38af0: 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) ) { 38af2: 23 33 cpi r18, 0x33 ; 51 38af4: 81 e0 ldi r24, 0x01 ; 1 38af6: 38 07 cpc r19, r24 38af8: 08 f0 brcs .+2 ; 0x38afc 38afa: 41 c0 rjmp .+130 ; 0x38b7e 38afc: 2d 32 cpi r18, 0x2D ; 45 38afe: 81 e0 ldi r24, 0x01 ; 1 38b00: 38 07 cpc r19, r24 38b02: 78 f5 brcc .+94 ; 0x38b62 38b04: 2e 37 cpi r18, 0x7E ; 126 38b06: 31 05 cpc r19, r1 38b08: 09 f4 brne .+2 ; 0x38b0c 38b0a: 83 c0 rjmp .+262 ; 0x38c12 38b0c: f0 f4 brcc .+60 ; 0x38b4a 38b0e: 2c 36 cpi r18, 0x6C ; 108 38b10: 31 05 cpc r19, r1 38b12: 09 f4 brne .+2 ; 0x38b16 38b14: 85 c0 rjmp .+266 ; 0x38c20 38b16: 30 f4 brcc .+12 ; 0x38b24 38b18: 25 36 cpi r18, 0x65 ; 101 38b1a: 31 05 cpc r19, r1 38b1c: 08 f0 brcs .+2 ; 0x38b20 38b1e: 79 c0 rjmp .+242 ; 0x38c12 default: break; } return Buttons::NoButton; 38b20: 8f ef ldi r24, 0xFF ; 255 38b22: 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) ) { 38b24: 24 37 cpi r18, 0x74 ; 116 38b26: 31 05 cpc r19, r1 38b28: 09 f4 brne .+2 ; 0x38b2c 38b2a: 73 c0 rjmp .+230 ; 0x38c12 38b2c: 2d 37 cpi r18, 0x7D ; 125 38b2e: 31 05 cpc r19, r1 38b30: 19 f0 breq .+6 ; 0x38b38 38b32: 23 37 cpi r18, 0x73 ; 115 38b34: 31 05 cpc r19, r1 38b36: a1 f7 brne .-24 ; 0x38b20 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 38b38: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38b3c: 81 30 cpi r24, 0x01 ; 1 38b3e: 09 f4 brne .+2 ; 0x38b42 38b40: 6d c0 rjmp .+218 ; 0x38c1c 38b42: 87 30 cpi r24, 0x07 ; 7 38b44: 69 f7 brne .-38 ; 0x38b20 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 38b46: 88 e0 ldi r24, 0x08 ; 8 38b48: 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) ) { 38b4a: 23 3d cpi r18, 0xD3 ; 211 38b4c: 31 05 cpc r19, r1 38b4e: 09 f4 brne .+2 ; 0x38b52 38b50: 6e c0 rjmp .+220 ; 0x38c2e 38b52: 50 f4 brcc .+20 ; 0x38b68 38b54: 29 3c cpi r18, 0xC9 ; 201 38b56: 31 05 cpc r19, r1 38b58: 09 f4 brne .+2 ; 0x38b5c 38b5a: 69 c0 rjmp .+210 ; 0x38c2e 38b5c: 2a 3c cpi r18, 0xCA ; 202 38b5e: 31 05 cpc r19, r1 38b60: f9 f6 brne .-66 ; 0x38b20 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) { 38b62: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38b66: 67 c0 rjmp .+206 ; 0x38c36 // 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) ) { 38b68: 2d 3d cpi r18, 0xDD ; 221 38b6a: 31 05 cpc r19, r1 38b6c: 09 f4 brne .+2 ; 0x38b70 38b6e: 5f c0 rjmp .+190 ; 0x38c2e 38b70: 2e 3d cpi r18, 0xDE ; 222 38b72: 31 05 cpc r19, r1 38b74: b1 f3 breq .-20 ; 0x38b62 38b76: 24 3d cpi r18, 0xD4 ; 212 38b78: 31 05 cpc r19, r1 38b7a: 91 f6 brne .-92 ; 0x38b20 38b7c: f2 cf rjmp .-28 ; 0x38b62 38b7e: 25 3f cpi r18, 0xF5 ; 245 38b80: 81 e0 ldi r24, 0x01 ; 1 38b82: 38 07 cpc r19, r24 38b84: 09 f4 brne .+2 ; 0x38b88 38b86: 5c c0 rjmp .+184 ; 0x38c40 38b88: f8 f4 brcc .+62 ; 0x38bc8 38b8a: 26 34 cpi r18, 0x46 ; 70 38b8c: 81 e0 ldi r24, 0x01 ; 1 38b8e: 38 07 cpc r19, r24 38b90: 58 f4 brcc .+22 ; 0x38ba8 38b92: 21 34 cpi r18, 0x41 ; 65 38b94: 81 e0 ldi r24, 0x01 ; 1 38b96: 38 07 cpc r19, r24 38b98: 20 f7 brcc .-56 ; 0x38b62 38b9a: 27 53 subi r18, 0x37 ; 55 38b9c: 31 40 sbci r19, 0x01 ; 1 38b9e: 25 30 cpi r18, 0x05 ; 5 38ba0: 31 05 cpc r19, r1 38ba2: 08 f0 brcs .+2 ; 0x38ba6 38ba4: bd cf rjmp .-134 ; 0x38b20 38ba6: dd cf rjmp .-70 ; 0x38b62 38ba8: 21 59 subi r18, 0x91 ; 145 38baa: 31 40 sbci r19, 0x01 ; 1 38bac: 22 30 cpi r18, 0x02 ; 2 38bae: 31 05 cpc r19, r1 38bb0: 08 f0 brcs .+2 ; 0x38bb4 38bb2: b6 cf rjmp .-148 ; 0x38b20 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 38bb4: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38bb8: 83 30 cpi r24, 0x03 ; 3 38bba: 09 f4 brne .+2 ; 0x38bbe 38bbc: 3f c0 rjmp .+126 ; 0x38c3c 38bbe: 89 30 cpi r24, 0x09 ; 9 38bc0: 09 f0 breq .+2 ; 0x38bc4 38bc2: ae cf rjmp .-164 ; 0x38b20 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 38bc4: 87 e0 ldi r24, 0x07 ; 7 38bc6: 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) ) { 38bc8: 29 3f cpi r18, 0xF9 ; 249 38bca: 81 e0 ldi r24, 0x01 ; 1 38bcc: 38 07 cpc r19, r24 38bce: 49 f2 breq .-110 ; 0x38b62 38bd0: 70 f4 brcc .+28 ; 0x38bee 38bd2: 27 3f cpi r18, 0xF7 ; 247 38bd4: 81 e0 ldi r24, 0x01 ; 1 38bd6: 38 07 cpc r19, r24 38bd8: 21 f2 breq .-120 ; 0x38b62 38bda: 60 f7 brcc .-40 ; 0x38bb4 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 38bdc: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38be0: 83 30 cpi r24, 0x03 ; 3 38be2: 61 f1 breq .+88 ; 0x38c3c 38be4: 88 30 cpi r24, 0x08 ; 8 38be6: 09 f0 breq .+2 ; 0x38bea 38be8: 9b cf rjmp .-202 ; 0x38b20 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 38bea: 86 e0 ldi r24, 0x06 ; 6 38bec: 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) ) { 38bee: 2b 3f cpi r18, 0xFB ; 251 38bf0: 81 e0 ldi r24, 0x01 ; 1 38bf2: 38 07 cpc r19, r24 38bf4: a9 f0 breq .+42 ; 0x38c20 38bf6: 68 f0 brcs .+26 ; 0x38c12 38bf8: 2c 3f cpi r18, 0xFC ; 252 38bfa: 31 40 sbci r19, 0x01 ; 1 38bfc: 09 f0 breq .+2 ; 0x38c00 38bfe: 90 cf rjmp .-224 ; 0x38b20 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 38c00: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38c04: 85 30 cpi r24, 0x05 ; 5 38c06: 89 f0 breq .+34 ; 0x38c2a 38c08: 86 30 cpi r24, 0x06 ; 6 38c0a: 09 f0 breq .+2 ; 0x38c0e 38c0c: 89 cf rjmp .-238 ; 0x38b20 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 38c0e: 85 e0 ldi r24, 0x05 ; 5 38c10: 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) { 38c12: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38c16: 81 30 cpi r24, 0x01 ; 1 38c18: 09 f0 breq .+2 ; 0x38c1c 38c1a: 82 cf rjmp .-252 ; 0x38b20 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; 38c1c: 81 e0 ldi r24, 0x01 ; 1 38c1e: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 38c20: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38c24: 82 30 cpi r24, 0x02 ; 2 38c26: d1 f3 breq .-12 ; 0x38c1c 38c28: 7b cf rjmp .-266 ; 0x38b20 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 38c2a: 84 e0 ldi r24, 0x04 ; 4 38c2c: 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) { 38c2e: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38c32: 82 30 cpi r24, 0x02 ; 2 38c34: 61 f0 breq .+24 ; 0x38c4e 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) { 38c36: 83 30 cpi r24, 0x03 ; 3 38c38: 09 f0 breq .+2 ; 0x38c3c 38c3a: 72 cf rjmp .-284 ; 0x38b20 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; 38c3c: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 38c3e: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 38c40: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.509> 38c44: 82 30 cpi r24, 0x02 ; 2 38c46: 29 f0 breq .+10 ; 0x38c52 38c48: 84 30 cpi r24, 0x04 ; 4 38c4a: 09 f0 breq .+2 ; 0x38c4e 38c4c: 69 cf rjmp .-302 ; 0x38b20 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; 38c4e: 82 e0 ldi r24, 0x02 ; 2 38c50: 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; 38c52: 80 e0 ldi r24, 0x00 ; 0 38c54: 08 95 ret 00038c56 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 38c56: cf 93 push r28 38c58: df 93 push r29 38c5a: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 38c5c: 60 91 5e 0e lds r22, 0x0E5E ; 0x800e5e 38c60: 70 91 5f 0e lds r23, 0x0E5F ; 0x800e5f 38c64: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 38c68: 90 91 61 0e lds r25, 0x0E61 ; 0x800e61 38c6c: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 38c70: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 38c74: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 38c78: c9 01 movw r24, r18 38c7a: 86 1b sub r24, r22 38c7c: 97 0b sbc r25, r23 38c7e: 06 97 sbiw r24, 0x06 ; 6 38c80: 24 f0 brlt .+8 ; 0x38c8a (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); 38c82: ce 01 movw r24, r28 38c84: 0e 94 10 8f call 0x11e20 ; 0x11e20 38c88: e9 cf rjmp .-46 ; 0x38c5c (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]+0x6> f(); safe_delay_keep_alive(delay); } } 38c8a: df 91 pop r29 38c8c: cf 91 pop r28 38c8e: 08 95 ret 00038c90 : } //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) { 38c90: cf 93 push r28 38c92: df 93 push r29 38c94: 00 d0 rcall .+0 ; 0x38c96 38c96: 00 d0 rcall .+0 ; 0x38c98 38c98: 1f 92 push r1 38c9a: cd b7 in r28, 0x3d ; 61 38c9c: 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)) 38c9e: 87 30 cpi r24, 0x07 ; 7 38ca0: 50 f5 brcc .+84 ; 0x38cf6 38ca2: 67 30 cpi r22, 0x07 ; 7 38ca4: 40 f5 brcc .+80 ; 0x38cf6 return false; uint8_t valid_points_mask[7] = { 38ca6: 97 e0 ldi r25, 0x07 ; 7 38ca8: e6 ec ldi r30, 0xC6 ; 198 38caa: f2 e0 ldi r31, 0x02 ; 2 38cac: de 01 movw r26, r28 38cae: 11 96 adiw r26, 0x01 ; 1 38cb0: 01 90 ld r0, Z+ 38cb2: 0d 92 st X+, r0 38cb4: 9a 95 dec r25 38cb6: e1 f7 brne .-8 ; 0x38cb0 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 38cb8: 46 e0 ldi r20, 0x06 ; 6 38cba: 50 e0 ldi r21, 0x00 ; 0 38cbc: fa 01 movw r30, r20 38cbe: e6 1b sub r30, r22 38cc0: f1 09 sbc r31, r1 38cc2: 21 e0 ldi r18, 0x01 ; 1 38cc4: 30 e0 ldi r19, 0x00 ; 0 38cc6: 2c 0f add r18, r28 38cc8: 3d 1f adc r19, r29 38cca: e2 0f add r30, r18 38ccc: f3 1f adc r31, r19 38cce: 20 81 ld r18, Z 38cd0: 30 e0 ldi r19, 0x00 ; 0 38cd2: 48 1b sub r20, r24 38cd4: 51 09 sbc r21, r1 38cd6: c9 01 movw r24, r18 38cd8: 02 c0 rjmp .+4 ; 0x38cde 38cda: 95 95 asr r25 38cdc: 87 95 ror r24 38cde: 4a 95 dec r20 38ce0: e2 f7 brpl .-8 ; 0x38cda 38ce2: 81 70 andi r24, 0x01 ; 1 } 38ce4: 27 96 adiw r28, 0x07 ; 7 38ce6: 0f b6 in r0, 0x3f ; 63 38ce8: f8 94 cli 38cea: de bf out 0x3e, r29 ; 62 38cec: 0f be out 0x3f, r0 ; 63 38cee: cd bf out 0x3d, r28 ; 61 38cf0: df 91 pop r29 38cf2: cf 91 pop r28 38cf4: 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; 38cf6: 80 e0 ldi r24, 0x00 ; 0 38cf8: f5 cf rjmp .-22 ; 0x38ce4 00038cfa : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 38cfa: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.513+0x1> 38cfe: 10 92 67 05 sts 0x0567, r1 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.513> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 38d02: 80 e1 ldi r24, 0x10 ; 16 38d04: 0e 94 41 f8 call 0x1f082 ; 0x1f082 38d08: 88 23 and r24, r24 38d0a: 91 f0 breq .+36 ; 0x38d30 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 38d0c: 0e 94 9b 7b call 0xf736 ; 0xf736 // 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))); 38d10: 81 ea ldi r24, 0xA1 ; 161 38d12: 9d e0 ldi r25, 0x0D ; 13 38d14: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 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-> 38d18: 2b e0 ldi r18, 0x0B ; 11 38d1a: 82 9f mul r24, r18 38d1c: c0 01 movw r24, r0 38d1e: 11 24 eor r1, r1 38d20: 80 5b subi r24, 0xB0 ; 176 38d22: 92 4f sbci r25, 0xF2 ; 242 38d24: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 38d28: 90 93 68 05 sts 0x0568, r25 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.513+0x1> 38d2c: 80 93 67 05 sts 0x0567, r24 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.513> SERIAL_ECHO("correction: "); SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_mm[Z_AXIS])); SERIAL_ECHOLN(""); #endif } } 38d30: 08 95 ret 00038d32 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 38d32: 0f 93 push r16 38d34: 1f 93 push r17 38d36: cf 93 push r28 38d38: df 93 push r29 38d3a: 00 d0 rcall .+0 ; 0x38d3c 38d3c: 1f 92 push r1 38d3e: cd b7 in r28, 0x3d ; 61 38d40: de b7 in r29, 0x3e ; 62 38d42: 9b 01 movw r18, r22 38d44: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 38d46: 00 e4 ldi r16, 0x40 ; 64 38d48: 17 e0 ldi r17, 0x07 ; 7 38d4a: f8 01 movw r30, r16 38d4c: 60 85 ldd r22, Z+8 ; 0x08 38d4e: 71 85 ldd r23, Z+9 ; 0x09 38d50: 82 85 ldd r24, Z+10 ; 0x0a 38d52: 93 85 ldd r25, Z+11 ; 0x0b 38d54: 69 83 std Y+1, r22 ; 0x01 38d56: 7a 83 std Y+2, r23 ; 0x02 38d58: 8b 83 std Y+3, r24 ; 0x03 38d5a: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 38d5c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 38d60: f8 01 movw r30, r16 38d62: 60 87 std Z+8, r22 ; 0x08 38d64: 71 87 std Z+9, r23 ; 0x09 38d66: 82 87 std Z+10, r24 ; 0x0a 38d68: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 38d6a: 65 e5 ldi r22, 0x55 ; 85 38d6c: 75 e5 ldi r23, 0x55 ; 85 38d6e: 85 e5 ldi r24, 0x55 ; 85 38d70: 91 e4 ldi r25, 0x41 ; 65 38d72: 0f 94 11 ba call 0x37422 ; 0x37422 st_synchronize(); 38d76: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position[Z_AXIS] = curpos_z; 38d7a: 89 81 ldd r24, Y+1 ; 0x01 38d7c: 9a 81 ldd r25, Y+2 ; 0x02 38d7e: ab 81 ldd r26, Y+3 ; 0x03 38d80: bc 81 ldd r27, Y+4 ; 0x04 38d82: f8 01 movw r30, r16 38d84: 80 87 std Z+8, r24 ; 0x08 38d86: 91 87 std Z+9, r25 ; 0x09 38d88: a2 87 std Z+10, r26 ; 0x0a 38d8a: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 38d8c: ce 01 movw r24, r28 38d8e: 01 96 adiw r24, 0x01 ; 1 38d90: 0f 94 95 aa call 0x3552a ; 0x3552a } 38d94: 0f 90 pop r0 38d96: 0f 90 pop r0 38d98: 0f 90 pop r0 38d9a: 0f 90 pop r0 38d9c: df 91 pop r29 38d9e: cf 91 pop r28 38da0: 1f 91 pop r17 38da2: 0f 91 pop r16 38da4: 08 95 ret 00038da6 : 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])); 38da6: 60 91 67 05 lds r22, 0x0567 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.513> 38daa: 70 91 68 05 lds r23, 0x0568 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.513+0x1> 38dae: 07 2e mov r0, r23 38db0: 00 0c add r0, r0 38db2: 88 0b sbc r24, r24 38db4: 99 0b sbc r25, r25 38db6: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 38dba: 20 91 77 06 lds r18, 0x0677 ; 0x800677 38dbe: 30 91 78 06 lds r19, 0x0678 ; 0x800678 38dc2: 40 91 79 06 lds r20, 0x0679 ; 0x800679 38dc6: 50 91 7a 06 lds r21, 0x067A ; 0x80067a 38dca: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 38dce: 0f 94 99 c6 call 0x38d32 ; 0x38d32 babystepLoadZ = 0; 38dd2: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.513+0x1> 38dd6: 10 92 67 05 sts 0x0567, r1 ; 0x800567 <_ZL13babystepLoadZ.lto_priv.513> } 38dda: 08 95 ret 00038ddc : return sampled; } void go_home_with_z_lift() { 38ddc: cf 93 push r28 38dde: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38de0: 0e 94 09 68 call 0xd012 ; 0xd012 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 38de4: c0 e4 ldi r28, 0x40 ; 64 38de6: d7 e0 ldi r29, 0x07 ; 7 38de8: 80 e0 ldi r24, 0x00 ; 0 38dea: 90 e0 ldi r25, 0x00 ; 0 38dec: a0 ea ldi r26, 0xA0 ; 160 38dee: b0 e4 ldi r27, 0x40 ; 64 38df0: 88 87 std Y+8, r24 ; 0x08 38df2: 99 87 std Y+9, r25 ; 0x09 38df4: aa 87 std Y+10, r26 ; 0x0a 38df6: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38df8: 65 e5 ldi r22, 0x55 ; 85 38dfa: 75 e5 ldi r23, 0x55 ; 85 38dfc: 85 e5 ldi r24, 0x55 ; 85 38dfe: 91 e4 ldi r25, 0x41 ; 65 38e00: 0f 94 ce c2 call 0x3859c ; 0x3859c // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 38e04: 8d ec ldi r24, 0xCD ; 205 38e06: 9c ec ldi r25, 0xCC ; 204 38e08: ac e4 ldi r26, 0x4C ; 76 38e0a: be e3 ldi r27, 0x3E ; 62 38e0c: 88 83 st Y, r24 38e0e: 99 83 std Y+1, r25 ; 0x01 38e10: aa 83 std Y+2, r26 ; 0x02 38e12: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 38e14: 83 e3 ldi r24, 0x33 ; 51 38e16: 93 e3 ldi r25, 0x33 ; 51 38e18: a3 e7 ldi r26, 0x73 ; 115 38e1a: b0 ec ldi r27, 0xC0 ; 192 38e1c: 8c 83 std Y+4, r24 ; 0x04 38e1e: 9d 83 std Y+5, r25 ; 0x05 38e20: ae 83 std Y+6, r26 ; 0x06 38e22: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 38e24: 64 e4 ldi r22, 0x44 ; 68 38e26: 77 e0 ldi r23, 0x07 ; 7 38e28: ce 01 movw r24, r28 38e2a: 0e 94 f0 6b call 0xd7e0 ; 0xd7e0 go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 38e2e: 60 e0 ldi r22, 0x00 ; 0 38e30: 70 e0 ldi r23, 0x00 ; 0 38e32: 86 e1 ldi r24, 0x16 ; 22 38e34: 93 e4 ldi r25, 0x43 ; 67 38e36: 0f 94 ce c2 call 0x3859c ; 0x3859c // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 38e3a: 8a e9 ldi r24, 0x9A ; 154 38e3c: 99 e9 ldi r25, 0x99 ; 153 38e3e: a9 e1 ldi r26, 0x19 ; 25 38e40: be e3 ldi r27, 0x3E ; 62 38e42: 88 87 std Y+8, r24 ; 0x08 38e44: 99 87 std Y+9, r25 ; 0x09 38e46: aa 87 std Y+10, r26 ; 0x0a 38e48: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38e4a: 65 e5 ldi r22, 0x55 ; 85 38e4c: 75 e5 ldi r23, 0x55 ; 85 38e4e: 85 e5 ldi r24, 0x55 ; 85 38e50: 91 e4 ldi r25, 0x41 ; 65 } 38e52: df 91 pop r29 38e54: 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); 38e56: 0d 94 ce c2 jmp 0x3859c ; 0x3859c 00038e5a : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 38e5a: 68 2f mov r22, r24 38e5c: 70 e0 ldi r23, 0x00 ; 0 38e5e: 90 e0 ldi r25, 0x00 ; 0 38e60: 80 e0 ldi r24, 0x00 ; 0 38e62: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 38e66: 20 e0 ldi r18, 0x00 ; 0 38e68: 30 e0 ldi r19, 0x00 ; 0 38e6a: 48 e0 ldi r20, 0x08 ; 8 38e6c: 52 e4 ldi r21, 0x42 ; 66 38e6e: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 38e72: 20 e0 ldi r18, 0x00 ; 0 38e74: 30 e0 ldi r19, 0x00 ; 0 38e76: 40 e8 ldi r20, 0x80 ; 128 38e78: 5f e3 ldi r21, 0x3F ; 63 38e7a: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> } 38e7e: 08 95 ret 00038e80 : // 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() { 38e80: 2f 92 push r2 38e82: 3f 92 push r3 38e84: 4f 92 push r4 38e86: 5f 92 push r5 38e88: 6f 92 push r6 38e8a: 7f 92 push r7 38e8c: 8f 92 push r8 38e8e: 9f 92 push r9 38e90: af 92 push r10 38e92: bf 92 push r11 38e94: cf 92 push r12 38e96: df 92 push r13 38e98: ef 92 push r14 38e9a: ff 92 push r15 38e9c: 0f 93 push r16 38e9e: 1f 93 push r17 38ea0: cf 93 push r28 38ea2: df 93 push r29 38ea4: 00 d0 rcall .+0 ; 0x38ea6 38ea6: 00 d0 rcall .+0 ; 0x38ea8 38ea8: cd b7 in r28, 0x3d ; 61 38eaa: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 38eac: 84 e0 ldi r24, 0x04 ; 4 38eae: 0f 94 5d 3a call 0x274ba ; 0x274ba return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 38eb2: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 38eb6: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 38eb8: 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); 38ebc: 80 e0 ldi r24, 0x00 ; 0 38ebe: 0f 94 09 63 call 0x2c612 ; 0x2c612 38ec2: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38ec4: 0e 94 09 68 call 0xd012 ; 0xd012 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 38ec8: 8a ec ldi r24, 0xCA ; 202 38eca: 99 e4 ldi r25, 0x49 ; 73 38ecc: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 38ed0: 0f 94 4f 34 call 0x2689e ; 0x2689e // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 38ed4: 48 ed ldi r20, 0xD8 ; 216 38ed6: 51 e7 ldi r21, 0x71 ; 113 38ed8: 63 e0 ldi r22, 0x03 ; 3 38eda: 80 e0 ldi r24, 0x00 ; 0 38edc: 0e 94 3a 70 call 0xe074 ; 0xe074 38ee0: 81 e0 ldi r24, 0x01 ; 1 38ee2: 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; 38ee6: 80 e0 ldi r24, 0x00 ; 0 38ee8: 90 e0 ldi r25, 0x00 ; 0 38eea: a0 ea ldi r26, 0xA0 ; 160 38eec: b0 e4 ldi r27, 0x40 ; 64 38eee: 80 93 48 07 sts 0x0748, r24 ; 0x800748 38ef2: 90 93 49 07 sts 0x0749, r25 ; 0x800749 38ef6: a0 93 4a 07 sts 0x074A, r26 ; 0x80074a 38efa: b0 93 4b 07 sts 0x074B, r27 ; 0x80074b go_to_current(homing_feedrate[Z_AXIS]/60); 38efe: 65 e5 ldi r22, 0x55 ; 85 38f00: 75 e5 ldi r23, 0x55 ; 85 38f02: 85 e5 ldi r24, 0x55 ; 85 38f04: 91 e4 ldi r25, 0x41 ; 65 38f06: 0f 94 ce c2 call 0x3859c ; 0x3859c #ifdef TMC2130 check_Z_crash(); 38f0a: 0e 94 4d 7c call 0xf89a ; 0xf89a 38f0e: 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; 38f12: 80 e0 ldi r24, 0x00 ; 0 38f14: 90 e0 ldi r25, 0x00 ; 0 38f16: a0 e8 ldi r26, 0x80 ; 128 38f18: bf e3 ldi r27, 0x3F ; 63 38f1a: 80 93 40 07 sts 0x0740, r24 ; 0x800740 38f1e: 90 93 41 07 sts 0x0741, r25 ; 0x800741 38f22: a0 93 42 07 sts 0x0742, r26 ; 0x800742 38f26: b0 93 43 07 sts 0x0743, r27 ; 0x800743 current_position[Y_AXIS] = BED_Y0; 38f2a: 80 93 44 07 sts 0x0744, r24 ; 0x800744 38f2e: 90 93 45 07 sts 0x0745, r25 ; 0x800745 38f32: a0 93 46 07 sts 0x0746, r26 ; 0x800746 38f36: b0 93 47 07 sts 0x0747, r27 ; 0x800747 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 38f3a: 64 e4 ldi r22, 0x44 ; 68 38f3c: 77 e0 ldi r23, 0x07 ; 7 38f3e: 80 e4 ldi r24, 0x40 ; 64 38f40: 97 e0 ldi r25, 0x07 ; 7 38f42: 0e 94 f0 6b call 0xd7e0 ; 0xd7e0 go_to_current(homing_feedrate[X_AXIS]/60); 38f46: 60 e0 ldi r22, 0x00 ; 0 38f48: 70 e0 ldi r23, 0x00 ; 0 38f4a: 88 e4 ldi r24, 0x48 ; 72 38f4c: 92 e4 ldi r25, 0x42 ; 66 38f4e: 0f 94 ce c2 call 0x3859c ; 0x3859c set_destination_to_current(); 38f52: 0e 94 80 69 call 0xd300 ; 0xd300 homeaxis(Z_AXIS); 38f56: 50 e0 ldi r21, 0x00 ; 0 38f58: 40 e0 ldi r20, 0x00 ; 0 38f5a: 61 e0 ldi r22, 0x01 ; 1 38f5c: 82 e0 ldi r24, 0x02 ; 2 38f5e: 0e 94 87 7c call 0xf90e ; 0xf90e if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 38f62: 43 e0 ldi r20, 0x03 ; 3 38f64: 60 e0 ldi r22, 0x00 ; 0 38f66: 70 e0 ldi r23, 0x00 ; 0 38f68: 80 e2 ldi r24, 0x20 ; 32 38f6a: 91 ec ldi r25, 0xC1 ; 193 38f6c: 0f 94 a7 8b call 0x3174e ; 0x3174e 38f70: 81 11 cpse r24, r1 38f72: 06 c0 rjmp .+12 ; 0x38f80 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)); 38f74: 8c eb ldi r24, 0xBC ; 188 38f76: 95 e6 ldi r25, 0x65 ; 101 38f78: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 38f7c: 0e 94 26 7c call 0xf84c ; 0xf84c float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 38f80: 80 91 48 07 lds r24, 0x0748 ; 0x800748 38f84: 90 91 49 07 lds r25, 0x0749 ; 0x800749 38f88: a0 91 4a 07 lds r26, 0x074A ; 0x80074a 38f8c: b0 91 4b 07 lds r27, 0x074B ; 0x80074b 38f90: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e 38f94: 90 93 9f 13 sts 0x139F, r25 ; 0x80139f 38f98: a0 93 a0 13 sts 0x13A0, r26 ; 0x8013a0 38f9c: b0 93 a1 13 sts 0x13A1, r27 ; 0x8013a1 38fa0: e2 e0 ldi r30, 0x02 ; 2 38fa2: f0 e0 ldi r31, 0x00 ; 0 38fa4: fa 83 std Y+2, r31 ; 0x02 38fa6: 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; 38fa8: c1 2c mov r12, r1 38faa: d1 2c mov r13, r1 38fac: 30 ea ldi r19, 0xA0 ; 160 38fae: e3 2e mov r14, r19 38fb0: 30 e4 ldi r19, 0x40 ; 64 38fb2: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 38fb4: 43 e0 ldi r20, 0x03 ; 3 38fb6: 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 38fb8: 52 e0 ldi r21, 0x02 ; 2 38fba: 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); 38fbc: 02 e5 ldi r16, 0x52 ; 82 38fbe: 1b ea ldi r17, 0xAB ; 171 38fc0: 67 e0 ldi r22, 0x07 ; 7 38fc2: 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(); 38fc4: 0e 94 09 68 call 0xd012 ; 0xd012 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 38fc8: c0 92 48 07 sts 0x0748, r12 ; 0x800748 38fcc: d0 92 49 07 sts 0x0749, r13 ; 0x800749 38fd0: e0 92 4a 07 sts 0x074A, r14 ; 0x80074a 38fd4: f0 92 4b 07 sts 0x074B, r15 ; 0x80074b go_to_current(homing_feedrate[Z_AXIS]/60); 38fd8: 65 e5 ldi r22, 0x55 ; 85 38fda: 75 e5 ldi r23, 0x55 ; 85 38fdc: 85 e5 ldi r24, 0x55 ; 85 38fde: 91 e4 ldi r25, 0x41 ; 65 38fe0: 0f 94 ce c2 call 0x3859c ; 0x3859c uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 38fe4: 29 81 ldd r18, Y+1 ; 0x01 38fe6: 21 50 subi r18, 0x01 ; 1 38fe8: 82 2f mov r24, r18 38fea: 6b 2d mov r22, r11 38fec: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__udivmodqi4> 38ff0: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 38ff2: 82 2f mov r24, r18 38ff4: 0f 94 ca dd call 0x3bb94 ; 0x3bb94 <__divmodqi4> 38ff8: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 38ffa: 80 ff sbrs r24, 0 38ffc: 03 c0 rjmp .+6 ; 0x39004 38ffe: f9 2d mov r31, r9 39000: f8 19 sub r31, r8 39002: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 39004: 88 2d mov r24, r8 39006: 88 0f add r24, r24 39008: 88 0d add r24, r8 3900a: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 3900e: 60 93 40 07 sts 0x0740, r22 ; 0x800740 39012: 70 93 41 07 sts 0x0741, r23 ; 0x800741 39016: 80 93 42 07 sts 0x0742, r24 ; 0x800742 3901a: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] = BED_Y(iy * 3); 3901e: 87 2d mov r24, r7 39020: 88 0f add r24, r24 39022: 87 0d add r24, r7 39024: 0f 94 2d c7 call 0x38e5a ; 0x38e5a 39028: 60 93 44 07 sts 0x0744, r22 ; 0x800744 3902c: 70 93 45 07 sts 0x0745, r23 ; 0x800745 39030: 80 93 46 07 sts 0x0746, r24 ; 0x800746 39034: 90 93 47 07 sts 0x0747, r25 ; 0x800747 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 39038: 64 e4 ldi r22, 0x44 ; 68 3903a: 77 e0 ldi r23, 0x07 ; 7 3903c: 80 e4 ldi r24, 0x40 ; 64 3903e: 97 e0 ldi r25, 0x07 ; 7 39040: 0e 94 f0 6b call 0xd7e0 ; 0xd7e0 go_to_current(homing_feedrate[X_AXIS]/60); 39044: 60 e0 ldi r22, 0x00 ; 0 39046: 70 e0 ldi r23, 0x00 ; 0 39048: 88 e4 ldi r24, 0x48 ; 72 3904a: 92 e4 ldi r25, 0x42 ; 66 3904c: 0f 94 ce c2 call 0x3859c ; 0x3859c #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 39050: 63 e0 ldi r22, 0x03 ; 3 39052: 80 e0 ldi r24, 0x00 ; 0 39054: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_printf_P(PSTR("%d/9"),mesh_point+1); 39058: 8a 81 ldd r24, Y+2 ; 0x02 3905a: 8f 93 push r24 3905c: 99 81 ldd r25, Y+1 ; 0x01 3905e: 9f 93 push r25 39060: 1f 93 push r17 39062: 0f 93 push r16 39064: 0e 94 ff 6f call 0xdffe ; 0xdffe #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 39068: 43 e0 ldi r20, 0x03 ; 3 3906a: 60 e0 ldi r22, 0x00 ; 0 3906c: 70 e0 ldi r23, 0x00 ; 0 3906e: 80 e2 ldi r24, 0x20 ; 32 39070: 91 ec ldi r25, 0xC1 ; 193 39072: 0f 94 a7 8b call 0x3174e ; 0x3174e 39076: 58 2e mov r5, r24 39078: 0f 90 pop r0 3907a: 0f 90 pop r0 3907c: 0f 90 pop r0 3907e: 0f 90 pop r0 39080: 88 23 and r24, r24 39082: 09 f4 brne .+2 ; 0x39086 39084: 77 cf rjmp .-274 ; 0x38f74 39086: a7 9c mul r10, r7 39088: f0 01 movw r30, r0 3908a: 11 24 eor r1, r1 3908c: e8 0d add r30, r8 3908e: f1 1d adc r31, r1 39090: ee 0f add r30, r30 39092: ff 1f adc r31, r31 39094: ee 0f add r30, r30 39096: ff 1f adc r31, r31 39098: e3 56 subi r30, 0x63 ; 99 3909a: fc 4e sbci r31, 0xEC ; 236 3909c: 80 91 48 07 lds r24, 0x0748 ; 0x800748 390a0: 90 91 49 07 lds r25, 0x0749 ; 0x800749 390a4: a0 91 4a 07 lds r26, 0x074A ; 0x80074a 390a8: b0 91 4b 07 lds r27, 0x074B ; 0x80074b 390ac: 81 83 std Z+1, r24 ; 0x01 390ae: 92 83 std Z+2, r25 ; 0x02 390b0: a3 83 std Z+3, r26 ; 0x03 390b2: b4 83 std Z+4, r27 ; 0x04 390b4: e9 81 ldd r30, Y+1 ; 0x01 390b6: fa 81 ldd r31, Y+2 ; 0x02 390b8: 31 96 adiw r30, 0x01 ; 1 390ba: fa 83 std Y+2, r31 ; 0x02 390bc: 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) { 390be: 3a 97 sbiw r30, 0x0a ; 10 390c0: 09 f0 breq .+2 ; 0x390c4 390c2: 80 cf rjmp .-256 ; 0x38fc4 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 390c4: 60 90 9e 13 lds r6, 0x139E ; 0x80139e 390c8: 70 90 9f 13 lds r7, 0x139F ; 0x80139f 390cc: 80 90 a0 13 lds r8, 0x13A0 ; 0x8013a0 390d0: 90 90 a1 13 lds r9, 0x13A1 ; 0x8013a1 float zmax = zmin; 390d4: 46 2c mov r4, r6 390d6: a7 2c mov r10, r7 390d8: b8 2c mov r11, r8 390da: 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]; 390dc: 1e 82 std Y+6, r1 ; 0x06 390de: 1d 82 std Y+5, r1 ; 0x05 390e0: 0d e9 ldi r16, 0x9D ; 157 390e2: 13 e1 ldi r17, 0x13 ; 19 390e4: 8d 81 ldd r24, Y+5 ; 0x05 390e6: 9e 81 ldd r25, Y+6 ; 0x06 390e8: 82 56 subi r24, 0x62 ; 98 390ea: 9c 4e sbci r25, 0xEC ; 236 390ec: 9a 83 std Y+2, r25 ; 0x02 390ee: 89 83 std Y+1, r24 ; 0x01 390f0: 93 e0 ldi r25, 0x03 ; 3 390f2: 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]); 390f4: e9 81 ldd r30, Y+1 ; 0x01 390f6: fa 81 ldd r31, Y+2 ; 0x02 390f8: c1 90 ld r12, Z+ 390fa: d1 90 ld r13, Z+ 390fc: e1 90 ld r14, Z+ 390fe: f1 90 ld r15, Z+ 39100: fa 83 std Y+2, r31 ; 0x02 39102: e9 83 std Y+1, r30 ; 0x01 39104: 93 01 movw r18, r6 39106: a4 01 movw r20, r8 39108: c7 01 movw r24, r14 3910a: b6 01 movw r22, r12 3910c: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 39110: 18 16 cp r1, r24 39112: 14 f0 brlt .+4 ; 0x39118 39114: 36 01 movw r6, r12 39116: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 39118: 24 2d mov r18, r4 3911a: 3a 2d mov r19, r10 3911c: 4b 2d mov r20, r11 3911e: 52 2d mov r21, r2 39120: c7 01 movw r24, r14 39122: b6 01 movw r22, r12 39124: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 39128: 87 fd sbrc r24, 7 3912a: 04 c0 rjmp .+8 ; 0x39134 3912c: 4c 2c mov r4, r12 3912e: ad 2c mov r10, r13 39130: be 2c mov r11, r14 39132: 2f 2c mov r2, r15 39134: 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) { 39136: 31 10 cpse r3, r1 39138: dd cf rjmp .-70 ; 0x390f4 3913a: 8d 81 ldd r24, Y+5 ; 0x05 3913c: 9e 81 ldd r25, Y+6 ; 0x06 3913e: 4c 96 adiw r24, 0x1c ; 28 39140: 9e 83 std Y+6, r25 ; 0x06 39142: 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) 39144: 84 35 cpi r24, 0x54 ; 84 39146: 91 05 cpc r25, r1 39148: 59 f6 brne .-106 ; 0x390e0 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) { 3914a: 93 01 movw r18, r6 3914c: a4 01 movw r20, r8 3914e: 64 2d mov r22, r4 39150: 7a 2d mov r23, r10 39152: 8b 2d mov r24, r11 39154: 92 2d mov r25, r2 39156: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 3915a: 20 e0 ldi r18, 0x00 ; 0 3915c: 30 e0 ldi r19, 0x00 ; 0 3915e: 40 e4 ldi r20, 0x40 ; 64 39160: 50 e4 ldi r21, 0x40 ; 64 39162: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 39166: 18 16 cp r1, r24 39168: 3c f5 brge .+78 ; 0x391b8 // 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!"); 3916a: 85 e3 ldi r24, 0x35 ; 53 3916c: 9b ea ldi r25, 0xAB ; 171 3916e: 0e 94 97 7b call 0xf72e ; 0xf72e // 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; 39172: 51 2c mov r5, r1 39174: fc 81 ldd r31, Y+4 ; 0x04 39176: 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); 3917a: 8b 81 ldd r24, Y+3 ; 0x03 3917c: 0f 94 09 63 call 0x2c612 ; 0x2c612 #ifdef TMC2130 tmc2130_home_exit(); 39180: 0f 94 2e 3a call 0x2745c ; 0x2745c #endif return result; } 39184: 85 2d mov r24, r5 39186: 26 96 adiw r28, 0x06 ; 6 39188: 0f b6 in r0, 0x3f ; 63 3918a: f8 94 cli 3918c: de bf out 0x3e, r29 ; 62 3918e: 0f be out 0x3f, r0 ; 63 39190: cd bf out 0x3d, r28 ; 61 39192: df 91 pop r29 39194: cf 91 pop r28 39196: 1f 91 pop r17 39198: 0f 91 pop r16 3919a: ff 90 pop r15 3919c: ef 90 pop r14 3919e: df 90 pop r13 391a0: cf 90 pop r12 391a2: bf 90 pop r11 391a4: af 90 pop r10 391a6: 9f 90 pop r9 391a8: 8f 90 pop r8 391aa: 7f 90 pop r7 391ac: 6f 90 pop r6 391ae: 5f 90 pop r5 391b0: 4f 90 pop r4 391b2: 3f 90 pop r3 391b4: 2f 90 pop r2 391b6: 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) 391b8: 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; 391ba: 85 ec ldi r24, 0xC5 ; 197 391bc: e8 2e mov r14, r24 391be: 8f e0 ldi r24, 0x0F ; 15 391c0: f8 2e mov r15, r24 391c2: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 391c4: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 391c6: 9d 81 ldd r25, Y+5 ; 0x05 391c8: 91 11 cpse r25, r1 391ca: 03 c0 rjmp .+6 ; 0x391d2 391cc: e9 81 ldd r30, Y+1 ; 0x01 391ce: ee 23 and r30, r30 391d0: 29 f1 breq .+74 ; 0x3921c continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 391d2: 20 91 9e 13 lds r18, 0x139E ; 0x80139e 391d6: 30 91 9f 13 lds r19, 0x139F ; 0x80139f 391da: 40 91 a0 13 lds r20, 0x13A0 ; 0x8013a0 391de: 50 91 a1 13 lds r21, 0x13A1 ; 0x8013a1 391e2: f6 01 movw r30, r12 391e4: 61 81 ldd r22, Z+1 ; 0x01 391e6: 72 81 ldd r23, Z+2 ; 0x02 391e8: 83 81 ldd r24, Z+3 ; 0x03 391ea: 94 81 ldd r25, Z+4 ; 0x04 391ec: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 391f0: 20 e0 ldi r18, 0x00 ; 0 391f2: 30 e0 ldi r19, 0x00 ; 0 391f4: 48 ec ldi r20, 0xC8 ; 200 391f6: 52 e4 ldi r21, 0x42 ; 66 391f8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 391fc: 20 e0 ldi r18, 0x00 ; 0 391fe: 30 e0 ldi r19, 0x00 ; 0 39200: 40 e0 ldi r20, 0x00 ; 0 39202: 5f e3 ldi r21, 0x3F ; 63 39204: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 39208: 0f 94 de df call 0x3bfbc ; 0x3bfbc 3920c: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 39210: c7 01 movw r24, r14 39212: 0f 94 51 dd call 0x3baa2 ; 0x3baa2 SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 39216: f2 e0 ldi r31, 0x02 ; 2 39218: ef 0e add r14, r31 3921a: f1 1c adc r15, r1 3921c: 84 e0 ldi r24, 0x04 ; 4 3921e: c8 0e add r12, r24 39220: d1 1c adc r13, r1 39222: 9d 81 ldd r25, Y+5 ; 0x05 39224: 9f 5f subi r25, 0xFF ; 255 39226: 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) { 39228: 93 30 cpi r25, 0x03 ; 3 3922a: 69 f6 brne .-102 ; 0x391c6 3922c: 04 5e subi r16, 0xE4 ; 228 3922e: 1f 4f sbci r17, 0xFF ; 255 39230: e9 81 ldd r30, Y+1 ; 0x01 39232: ef 5f subi r30, 0xFF ; 255 39234: 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) 39236: e3 30 cpi r30, 0x03 ; 3 39238: 21 f6 brne .-120 ; 0x391c2 #endif addr += 2; } } mbl.reset(); 3923a: 0f 94 9d 8b call 0x3173a ; 0x3173a go_home_with_z_lift(); 3923e: 0f 94 ee c6 call 0x38ddc ; 0x38ddc 39242: 98 cf rjmp .-208 ; 0x39174 00039244 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 39244: 82 e0 ldi r24, 0x02 ; 2 39246: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 3924a: 60 93 48 07 sts 0x0748, r22 ; 0x800748 3924e: 70 93 49 07 sts 0x0749, r23 ; 0x800749 39252: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 39256: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b plan_set_z_position(current_position[Z_AXIS]); 3925a: 88 e4 ldi r24, 0x48 ; 72 3925c: 97 e0 ldi r25, 0x07 ; 7 3925e: 0d 94 95 aa jmp 0x3552a ; 0x3552a 00039262 : * 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() { 39262: 4f 92 push r4 39264: 5f 92 push r5 39266: 6f 92 push r6 39268: 7f 92 push r7 3926a: 8f 92 push r8 3926c: 9f 92 push r9 3926e: af 92 push r10 39270: bf 92 push r11 39272: cf 92 push r12 39274: df 92 push r13 39276: ef 92 push r14 39278: ff 92 push r15 3927a: 0f 93 push r16 3927c: 1f 93 push r17 3927e: cf 93 push r28 39280: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 39282: 00 e4 ldi r16, 0x40 ; 64 39284: 17 e0 ldi r17, 0x07 ; 7 39286: c0 ee ldi r28, 0xE0 ; 224 39288: d7 e1 ldi r29, 0x17 ; 23 3928a: 28 81 ld r18, Y 3928c: 39 81 ldd r19, Y+1 ; 0x01 3928e: 4a 81 ldd r20, Y+2 ; 0x02 39290: 5b 81 ldd r21, Y+3 ; 0x03 39292: f8 01 movw r30, r16 39294: 60 81 ld r22, Z 39296: 71 81 ldd r23, Z+1 ; 0x01 39298: 82 81 ldd r24, Z+2 ; 0x02 3929a: 93 81 ldd r25, Z+3 ; 0x03 3929c: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 392a0: 4b 01 movw r8, r22 392a2: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 392a4: 2c 81 ldd r18, Y+4 ; 0x04 392a6: 3d 81 ldd r19, Y+5 ; 0x05 392a8: 4e 81 ldd r20, Y+6 ; 0x06 392aa: 5f 81 ldd r21, Y+7 ; 0x07 392ac: f8 01 movw r30, r16 392ae: 64 81 ldd r22, Z+4 ; 0x04 392b0: 75 81 ldd r23, Z+5 ; 0x05 392b2: 86 81 ldd r24, Z+6 ; 0x06 392b4: 97 81 ldd r25, Z+7 ; 0x07 392b6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 392ba: 6b 01 movw r12, r22 392bc: 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; 392be: c0 ed ldi r28, 0xD0 ; 208 392c0: d7 e1 ldi r29, 0x17 ; 23 392c2: 28 81 ld r18, Y 392c4: 39 81 ldd r19, Y+1 ; 0x01 392c6: 4a 81 ldd r20, Y+2 ; 0x02 392c8: 5b 81 ldd r21, Y+3 ; 0x03 392ca: c5 01 movw r24, r10 392cc: b4 01 movw r22, r8 392ce: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 392d2: 2b 01 movw r4, r22 392d4: 3c 01 movw r6, r24 392d6: 2c 81 ldd r18, Y+4 ; 0x04 392d8: 3d 81 ldd r19, Y+5 ; 0x05 392da: 4e 81 ldd r20, Y+6 ; 0x06 392dc: 5f 81 ldd r21, Y+7 ; 0x07 392de: c7 01 movw r24, r14 392e0: b6 01 movw r22, r12 392e2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 392e6: 9b 01 movw r18, r22 392e8: ac 01 movw r20, r24 392ea: c3 01 movw r24, r6 392ec: b2 01 movw r22, r4 392ee: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 392f2: f8 01 movw r30, r16 392f4: 60 83 st Z, r22 392f6: 71 83 std Z+1, r23 ; 0x01 392f8: 82 83 std Z+2, r24 ; 0x02 392fa: 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; 392fc: 28 85 ldd r18, Y+8 ; 0x08 392fe: 39 85 ldd r19, Y+9 ; 0x09 39300: 4a 85 ldd r20, Y+10 ; 0x0a 39302: 5b 85 ldd r21, Y+11 ; 0x0b 39304: c5 01 movw r24, r10 39306: b4 01 movw r22, r8 39308: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3930c: 4b 01 movw r8, r22 3930e: 5c 01 movw r10, r24 39310: 2c 85 ldd r18, Y+12 ; 0x0c 39312: 3d 85 ldd r19, Y+13 ; 0x0d 39314: 4e 85 ldd r20, Y+14 ; 0x0e 39316: 5f 85 ldd r21, Y+15 ; 0x0f 39318: c7 01 movw r24, r14 3931a: b6 01 movw r22, r12 3931c: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 39320: 9b 01 movw r18, r22 39322: ac 01 movw r20, r24 39324: c5 01 movw r24, r10 39326: b4 01 movw r22, r8 39328: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3932c: f8 01 movw r30, r16 3932e: 64 83 std Z+4, r22 ; 0x04 39330: 75 83 std Z+5, r23 ; 0x05 39332: 86 83 std Z+6, r24 ; 0x06 39334: 97 83 std Z+7, r25 ; 0x07 } 39336: df 91 pop r29 39338: cf 91 pop r28 3933a: 1f 91 pop r17 3933c: 0f 91 pop r16 3933e: ff 90 pop r15 39340: ef 90 pop r14 39342: df 90 pop r13 39344: cf 90 pop r12 39346: bf 90 pop r11 39348: af 90 pop r10 3934a: 9f 90 pop r9 3934c: 8f 90 pop r8 3934e: 7f 90 pop r7 39350: 6f 90 pop r6 39352: 5f 90 pop r5 39354: 4f 90 pop r4 39356: 08 95 ret 00039358 : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 39358: 4f 92 push r4 3935a: 5f 92 push r5 3935c: 6f 92 push r6 3935e: 7f 92 push r7 39360: 8f 92 push r8 39362: 9f 92 push r9 39364: af 92 push r10 39366: bf 92 push r11 39368: cf 92 push r12 3936a: df 92 push r13 3936c: ef 92 push r14 3936e: ff 92 push r15 39370: 0f 93 push r16 39372: 1f 93 push r17 39374: cf 93 push r28 39376: df 93 push r29 39378: 00 d0 rcall .+0 ; 0x3937a 3937a: 00 d0 rcall .+0 ; 0x3937c 3937c: 1f 92 push r1 3937e: 1f 92 push r1 39380: cd b7 in r28, 0x3d ; 61 39382: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 39384: dc 01 movw r26, r24 39386: cd 90 ld r12, X+ 39388: dd 90 ld r13, X+ 3938a: ed 90 ld r14, X+ 3938c: fc 90 ld r15, X 3938e: 13 97 sbiw r26, 0x03 ; 3 39390: c0 92 b5 17 sts 0x17B5, r12 ; 0x8017b5 39394: d0 92 b6 17 sts 0x17B6, r13 ; 0x8017b6 39398: e0 92 b7 17 sts 0x17B7, r14 ; 0x8017b7 3939c: f0 92 b8 17 sts 0x17B8, r15 ; 0x8017b8 world2machine_rotation_and_skew[1][0] = vec_x[1]; 393a0: 14 96 adiw r26, 0x04 ; 4 393a2: 0d 91 ld r16, X+ 393a4: 1d 91 ld r17, X+ 393a6: 2d 91 ld r18, X+ 393a8: 3c 91 ld r19, X 393aa: 17 97 sbiw r26, 0x07 ; 7 393ac: 09 83 std Y+1, r16 ; 0x01 393ae: 1a 83 std Y+2, r17 ; 0x02 393b0: 2b 83 std Y+3, r18 ; 0x03 393b2: 3c 83 std Y+4, r19 ; 0x04 393b4: 00 93 bd 17 sts 0x17BD, r16 ; 0x8017bd 393b8: 10 93 be 17 sts 0x17BE, r17 ; 0x8017be 393bc: 20 93 bf 17 sts 0x17BF, r18 ; 0x8017bf 393c0: 30 93 c0 17 sts 0x17C0, r19 ; 0x8017c0 world2machine_rotation_and_skew[0][1] = vec_y[0]; 393c4: db 01 movw r26, r22 393c6: 0d 91 ld r16, X+ 393c8: 1d 91 ld r17, X+ 393ca: 2d 91 ld r18, X+ 393cc: 3c 91 ld r19, X 393ce: 13 97 sbiw r26, 0x03 ; 3 393d0: 0d 83 std Y+5, r16 ; 0x05 393d2: 1e 83 std Y+6, r17 ; 0x06 393d4: 2f 83 std Y+7, r18 ; 0x07 393d6: 38 87 std Y+8, r19 ; 0x08 393d8: 00 93 b9 17 sts 0x17B9, r16 ; 0x8017b9 393dc: 10 93 ba 17 sts 0x17BA, r17 ; 0x8017ba 393e0: 20 93 bb 17 sts 0x17BB, r18 ; 0x8017bb 393e4: 30 93 bc 17 sts 0x17BC, r19 ; 0x8017bc world2machine_rotation_and_skew[1][1] = vec_y[1]; 393e8: 14 96 adiw r26, 0x04 ; 4 393ea: 4d 90 ld r4, X+ 393ec: 5d 90 ld r5, X+ 393ee: 6d 90 ld r6, X+ 393f0: 7c 90 ld r7, X 393f2: 17 97 sbiw r26, 0x07 ; 7 393f4: 40 92 c1 17 sts 0x17C1, r4 ; 0x8017c1 393f8: 50 92 c2 17 sts 0x17C2, r5 ; 0x8017c2 393fc: 60 92 c3 17 sts 0x17C3, r6 ; 0x8017c3 39400: 70 92 c4 17 sts 0x17C4, r7 ; 0x8017c4 world2machine_shift[0] = cntr[0]; 39404: fa 01 movw r30, r20 39406: 60 81 ld r22, Z 39408: 71 81 ldd r23, Z+1 ; 0x01 3940a: 82 81 ldd r24, Z+2 ; 0x02 3940c: 93 81 ldd r25, Z+3 ; 0x03 3940e: 60 93 e0 17 sts 0x17E0, r22 ; 0x8017e0 39412: 70 93 e1 17 sts 0x17E1, r23 ; 0x8017e1 39416: 80 93 e2 17 sts 0x17E2, r24 ; 0x8017e2 3941a: 90 93 e3 17 sts 0x17E3, r25 ; 0x8017e3 world2machine_shift[1] = cntr[1]; 3941e: 84 80 ldd r8, Z+4 ; 0x04 39420: 95 80 ldd r9, Z+5 ; 0x05 39422: a6 80 ldd r10, Z+6 ; 0x06 39424: b7 80 ldd r11, Z+7 ; 0x07 39426: 80 92 e4 17 sts 0x17E4, r8 ; 0x8017e4 3942a: 90 92 e5 17 sts 0x17E5, r9 ; 0x8017e5 3942e: a0 92 e6 17 sts 0x17E6, r10 ; 0x8017e6 39432: b0 92 e7 17 sts 0x17E7, r11 ; 0x8017e7 // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 39436: 20 e0 ldi r18, 0x00 ; 0 39438: 30 e0 ldi r19, 0x00 ; 0 3943a: a9 01 movw r20, r18 3943c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 39440: 81 11 cpse r24, r1 39442: aa c0 rjmp .+340 ; 0x39598 39444: 20 e0 ldi r18, 0x00 ; 0 39446: 30 e0 ldi r19, 0x00 ; 0 39448: a9 01 movw r20, r18 3944a: c5 01 movw r24, r10 3944c: b4 01 movw r22, r8 3944e: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 39452: 81 11 cpse r24, r1 39454: a1 c0 rjmp .+322 ; 0x39598 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; 39456: 10 92 e8 17 sts 0x17E8, r1 ; 0x8017e8 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 || 3945a: 20 e0 ldi r18, 0x00 ; 0 3945c: 30 e0 ldi r19, 0x00 ; 0 3945e: 40 e8 ldi r20, 0x80 ; 128 39460: 5f e3 ldi r21, 0x3F ; 63 39462: c7 01 movw r24, r14 39464: b6 01 movw r22, r12 39466: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 3946a: 81 11 cpse r24, r1 3946c: 21 c0 rjmp .+66 ; 0x394b0 3946e: 20 e0 ldi r18, 0x00 ; 0 39470: 30 e0 ldi r19, 0x00 ; 0 39472: a9 01 movw r20, r18 39474: 6d 81 ldd r22, Y+5 ; 0x05 39476: 7e 81 ldd r23, Y+6 ; 0x06 39478: 8f 81 ldd r24, Y+7 ; 0x07 3947a: 98 85 ldd r25, Y+8 ; 0x08 3947c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 39480: 81 11 cpse r24, r1 39482: 16 c0 rjmp .+44 ; 0x394b0 39484: 20 e0 ldi r18, 0x00 ; 0 39486: 30 e0 ldi r19, 0x00 ; 0 39488: a9 01 movw r20, r18 3948a: 69 81 ldd r22, Y+1 ; 0x01 3948c: 7a 81 ldd r23, Y+2 ; 0x02 3948e: 8b 81 ldd r24, Y+3 ; 0x03 39490: 9c 81 ldd r25, Y+4 ; 0x04 39492: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 39496: 81 11 cpse r24, r1 39498: 0b c0 rjmp .+22 ; 0x394b0 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 3949a: 20 e0 ldi r18, 0x00 ; 0 3949c: 30 e0 ldi r19, 0x00 ; 0 3949e: 40 e8 ldi r20, 0x80 ; 128 394a0: 5f e3 ldi r21, 0x3F ; 63 394a2: c3 01 movw r24, r6 394a4: b2 01 movw r22, r4 394a6: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 394aa: 88 23 and r24, r24 394ac: 09 f4 brne .+2 ; 0x394b0 394ae: 78 c0 rjmp .+240 ; 0x395a0 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 394b0: 80 91 e8 17 lds r24, 0x17E8 ; 0x8017e8 394b4: 82 60 ori r24, 0x02 ; 2 394b6: 80 93 e8 17 sts 0x17E8, r24 ; 0x8017e8 // 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]; 394ba: a3 01 movw r20, r6 394bc: 92 01 movw r18, r4 394be: c7 01 movw r24, r14 394c0: b6 01 movw r22, r12 394c2: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 394c6: 4b 01 movw r8, r22 394c8: 5c 01 movw r10, r24 394ca: 2d 81 ldd r18, Y+5 ; 0x05 394cc: 3e 81 ldd r19, Y+6 ; 0x06 394ce: 4f 81 ldd r20, Y+7 ; 0x07 394d0: 58 85 ldd r21, Y+8 ; 0x08 394d2: 69 81 ldd r22, Y+1 ; 0x01 394d4: 7a 81 ldd r23, Y+2 ; 0x02 394d6: 8b 81 ldd r24, Y+3 ; 0x03 394d8: 9c 81 ldd r25, Y+4 ; 0x04 394da: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 394de: 9b 01 movw r18, r22 394e0: ac 01 movw r20, r24 394e2: c5 01 movw r24, r10 394e4: b4 01 movw r22, r8 394e6: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 394ea: 4b 01 movw r8, r22 394ec: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 394ee: ac 01 movw r20, r24 394f0: 9b 01 movw r18, r22 394f2: c3 01 movw r24, r6 394f4: b2 01 movw r22, r4 394f6: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 394fa: 60 93 d0 17 sts 0x17D0, r22 ; 0x8017d0 394fe: 70 93 d1 17 sts 0x17D1, r23 ; 0x8017d1 39502: 80 93 d2 17 sts 0x17D2, r24 ; 0x8017d2 39506: 90 93 d3 17 sts 0x17D3, r25 ; 0x8017d3 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 3950a: 6d 81 ldd r22, Y+5 ; 0x05 3950c: 7e 81 ldd r23, Y+6 ; 0x06 3950e: 8f 81 ldd r24, Y+7 ; 0x07 39510: 98 85 ldd r25, Y+8 ; 0x08 39512: 90 58 subi r25, 0x80 ; 128 39514: a5 01 movw r20, r10 39516: 94 01 movw r18, r8 39518: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 3951c: 60 93 d4 17 sts 0x17D4, r22 ; 0x8017d4 39520: 70 93 d5 17 sts 0x17D5, r23 ; 0x8017d5 39524: 80 93 d6 17 sts 0x17D6, r24 ; 0x8017d6 39528: 90 93 d7 17 sts 0x17D7, r25 ; 0x8017d7 world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 3952c: 69 81 ldd r22, Y+1 ; 0x01 3952e: 7a 81 ldd r23, Y+2 ; 0x02 39530: 8b 81 ldd r24, Y+3 ; 0x03 39532: 9c 81 ldd r25, Y+4 ; 0x04 39534: 90 58 subi r25, 0x80 ; 128 39536: a5 01 movw r20, r10 39538: 94 01 movw r18, r8 3953a: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 3953e: 60 93 d8 17 sts 0x17D8, r22 ; 0x8017d8 39542: 70 93 d9 17 sts 0x17D9, r23 ; 0x8017d9 39546: 80 93 da 17 sts 0x17DA, r24 ; 0x8017da 3954a: 90 93 db 17 sts 0x17DB, r25 ; 0x8017db world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 3954e: a5 01 movw r20, r10 39550: 94 01 movw r18, r8 39552: c7 01 movw r24, r14 39554: b6 01 movw r22, r12 39556: 0f 94 36 df call 0x3be6c ; 0x3be6c <__divsf3> 3955a: 60 93 dc 17 sts 0x17DC, r22 ; 0x8017dc 3955e: 70 93 dd 17 sts 0x17DD, r23 ; 0x8017dd 39562: 80 93 de 17 sts 0x17DE, r24 ; 0x8017de 39566: 90 93 df 17 sts 0x17DF, r25 ; 0x8017df 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; } } 3956a: 28 96 adiw r28, 0x08 ; 8 3956c: 0f b6 in r0, 0x3f ; 63 3956e: f8 94 cli 39570: de bf out 0x3e, r29 ; 62 39572: 0f be out 0x3f, r0 ; 63 39574: cd bf out 0x3d, r28 ; 61 39576: df 91 pop r29 39578: cf 91 pop r28 3957a: 1f 91 pop r17 3957c: 0f 91 pop r16 3957e: ff 90 pop r15 39580: ef 90 pop r14 39582: df 90 pop r13 39584: cf 90 pop r12 39586: bf 90 pop r11 39588: af 90 pop r10 3958a: 9f 90 pop r9 3958c: 8f 90 pop r8 3958e: 7f 90 pop r7 39590: 6f 90 pop r6 39592: 5f 90 pop r5 39594: 4f 90 pop r4 39596: 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; 39598: 81 e0 ldi r24, 0x01 ; 1 3959a: 80 93 e8 17 sts 0x17E8, r24 ; 0x8017e8 3959e: 5d cf rjmp .-326 ; 0x3945a 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; 395a0: 80 e0 ldi r24, 0x00 ; 0 395a2: 90 e0 ldi r25, 0x00 ; 0 395a4: a0 e8 ldi r26, 0x80 ; 128 395a6: bf e3 ldi r27, 0x3F ; 63 395a8: 80 93 d0 17 sts 0x17D0, r24 ; 0x8017d0 395ac: 90 93 d1 17 sts 0x17D1, r25 ; 0x8017d1 395b0: a0 93 d2 17 sts 0x17D2, r26 ; 0x8017d2 395b4: b0 93 d3 17 sts 0x17D3, r27 ; 0x8017d3 world2machine_rotation_and_skew_inv[0][1] = 0.f; 395b8: 10 92 d4 17 sts 0x17D4, r1 ; 0x8017d4 395bc: 10 92 d5 17 sts 0x17D5, r1 ; 0x8017d5 395c0: 10 92 d6 17 sts 0x17D6, r1 ; 0x8017d6 395c4: 10 92 d7 17 sts 0x17D7, r1 ; 0x8017d7 world2machine_rotation_and_skew_inv[1][0] = 0.f; 395c8: 10 92 d8 17 sts 0x17D8, r1 ; 0x8017d8 395cc: 10 92 d9 17 sts 0x17D9, r1 ; 0x8017d9 395d0: 10 92 da 17 sts 0x17DA, r1 ; 0x8017da 395d4: 10 92 db 17 sts 0x17DB, r1 ; 0x8017db world2machine_rotation_and_skew_inv[1][1] = 1.f; 395d8: 80 93 dc 17 sts 0x17DC, r24 ; 0x8017dc 395dc: 90 93 dd 17 sts 0x17DD, r25 ; 0x8017dd 395e0: a0 93 de 17 sts 0x17DE, r26 ; 0x8017de 395e4: b0 93 df 17 sts 0x17DF, r27 ; 0x8017df 395e8: c0 cf rjmp .-128 ; 0x3956a 000395ea : * * 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() { 395ea: cf 93 push r28 395ec: df 93 push r29 395ee: cd b7 in r28, 0x3d ; 61 395f0: de b7 in r29, 0x3e ; 62 395f2: 68 97 sbiw r28, 0x18 ; 24 395f4: 0f b6 in r0, 0x3f ; 63 395f6: f8 94 cli 395f8: de bf out 0x3e, r29 ; 62 395fa: 0f be out 0x3f, r0 ; 63 395fc: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 395fe: 80 e0 ldi r24, 0x00 ; 0 39600: 90 e0 ldi r25, 0x00 ; 0 39602: a0 e8 ldi r26, 0x80 ; 128 39604: bf e3 ldi r27, 0x3F ; 63 39606: 89 83 std Y+1, r24 ; 0x01 39608: 9a 83 std Y+2, r25 ; 0x02 3960a: ab 83 std Y+3, r26 ; 0x03 3960c: bc 83 std Y+4, r27 ; 0x04 3960e: 1d 82 std Y+5, r1 ; 0x05 39610: 1e 82 std Y+6, r1 ; 0x06 39612: 1f 82 std Y+7, r1 ; 0x07 39614: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 39616: 19 86 std Y+9, r1 ; 0x09 39618: 1a 86 std Y+10, r1 ; 0x0a 3961a: 1b 86 std Y+11, r1 ; 0x0b 3961c: 1c 86 std Y+12, r1 ; 0x0c 3961e: 8d 87 std Y+13, r24 ; 0x0d 39620: 9e 87 std Y+14, r25 ; 0x0e 39622: af 87 std Y+15, r26 ; 0x0f 39624: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 39626: 19 8a std Y+17, r1 ; 0x11 39628: 1a 8a std Y+18, r1 ; 0x12 3962a: 1b 8a std Y+19, r1 ; 0x13 3962c: 1c 8a std Y+20, r1 ; 0x14 3962e: 1d 8a std Y+21, r1 ; 0x15 39630: 1e 8a std Y+22, r1 ; 0x16 39632: 1f 8a std Y+23, r1 ; 0x17 39634: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 39636: ae 01 movw r20, r28 39638: 4f 5e subi r20, 0xEF ; 239 3963a: 5f 4f sbci r21, 0xFF ; 255 3963c: be 01 movw r22, r28 3963e: 67 5f subi r22, 0xF7 ; 247 39640: 7f 4f sbci r23, 0xFF ; 255 39642: ce 01 movw r24, r28 39644: 01 96 adiw r24, 0x01 ; 1 39646: 0f 94 ac c9 call 0x39358 ; 0x39358 } 3964a: 68 96 adiw r28, 0x18 ; 24 3964c: 0f b6 in r0, 0x3f ; 63 3964e: f8 94 cli 39650: de bf out 0x3e, r29 ; 62 39652: 0f be out 0x3f, r0 ; 63 39654: cd bf out 0x3d, r28 ; 61 39656: df 91 pop r29 39658: cf 91 pop r28 3965a: 08 95 ret 0003965c : * * 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) { 3965c: 80 91 e8 17 lds r24, 0x17E8 ; 0x8017e8 39660: 88 23 and r24, r24 39662: d1 f0 breq .+52 ; 0x39698 world2machine_reset(); 39664: 0f 94 f5 ca call 0x395ea ; 0x395ea st_synchronize(); 39668: 0f 94 db 57 call 0x2afb6 ; 0x2afb6 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 3966c: 80 e0 ldi r24, 0x00 ; 0 3966e: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 39672: 60 93 40 07 sts 0x0740, r22 ; 0x800740 39676: 70 93 41 07 sts 0x0741, r23 ; 0x800741 3967a: 80 93 42 07 sts 0x0742, r24 ; 0x800742 3967e: 90 93 43 07 sts 0x0743, r25 ; 0x800743 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 39682: 81 e0 ldi r24, 0x01 ; 1 39684: 0f 94 c7 57 call 0x2af8e ; 0x2af8e 39688: 60 93 44 07 sts 0x0744, r22 ; 0x800744 3968c: 70 93 45 07 sts 0x0745, r23 ; 0x800745 39690: 80 93 46 07 sts 0x0746, r24 ; 0x800746 39694: 90 93 47 07 sts 0x0747, r25 ; 0x800747 } } 39698: 08 95 ret 0003969a : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 3969a: 4f ef ldi r20, 0xFF ; 255 3969c: 5f ef ldi r21, 0xFF ; 255 3969e: ba 01 movw r22, r20 396a0: 85 ee ldi r24, 0xE5 ; 229 396a2: 9f e0 ldi r25, 0x0F ; 15 396a4: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 396a8: 4f ef ldi r20, 0xFF ; 255 396aa: 5f ef ldi r21, 0xFF ; 255 396ac: ba 01 movw r22, r20 396ae: 89 ee ldi r24, 0xE9 ; 233 396b0: 9f e0 ldi r25, 0x0F ; 15 396b2: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 396b6: 4f ef ldi r20, 0xFF ; 255 396b8: 5f ef ldi r21, 0xFF ; 255 396ba: ba 01 movw r22, r20 396bc: 8d ed ldi r24, 0xDD ; 221 396be: 9f e0 ldi r25, 0x0F ; 15 396c0: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 396c4: 4f ef ldi r20, 0xFF ; 255 396c6: 5f ef ldi r21, 0xFF ; 255 396c8: ba 01 movw r22, r20 396ca: 81 ee ldi r24, 0xE1 ; 225 396cc: 9f e0 ldi r25, 0x0F ; 15 396ce: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 396d2: 4f ef ldi r20, 0xFF ; 255 396d4: 5f ef ldi r21, 0xFF ; 255 396d6: ba 01 movw r22, r20 396d8: 85 ed ldi r24, 0xD5 ; 213 396da: 9f e0 ldi r25, 0x0F ; 15 396dc: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 396e0: 4f ef ldi r20, 0xFF ; 255 396e2: 5f ef ldi r21, 0xFF ; 255 396e4: ba 01 movw r22, r20 396e6: 89 ed ldi r24, 0xD9 ; 217 396e8: 9f e0 ldi r25, 0x0F ; 15 396ea: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 396ee: 4f ef ldi r20, 0xFF ; 255 396f0: 5f ef ldi r21, 0xFF ; 255 396f2: ba 01 movw r22, r20 396f4: 85 ec ldi r24, 0xC5 ; 197 396f6: 9f e0 ldi r25, 0x0F ; 15 396f8: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 396fc: 4f ef ldi r20, 0xFF ; 255 396fe: 5f ef ldi r21, 0xFF ; 255 39700: ba 01 movw r22, r20 39702: 89 ec ldi r24, 0xC9 ; 201 39704: 9f e0 ldi r25, 0x0F ; 15 39706: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 3970a: 4f ef ldi r20, 0xFF ; 255 3970c: 5f ef ldi r21, 0xFF ; 255 3970e: ba 01 movw r22, r20 39710: 8d ec ldi r24, 0xCD ; 205 39712: 9f e0 ldi r25, 0x0F ; 15 39714: 0f 94 45 dd call 0x3ba8a ; 0x3ba8a 39718: 4f ef ldi r20, 0xFF ; 255 3971a: 5f ef ldi r21, 0xFF ; 255 3971c: ba 01 movw r22, r20 3971e: 81 ed ldi r24, 0xD1 ; 209 39720: 9f e0 ldi r25, 0x0F ; 15 39722: 0d 94 45 dd jmp 0x3ba8a ; 0x3ba8a 00039726 : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 39726: 4f 92 push r4 39728: 5f 92 push r5 3972a: 6f 92 push r6 3972c: 7f 92 push r7 3972e: 8f 92 push r8 39730: 9f 92 push r9 39732: af 92 push r10 39734: bf 92 push r11 39736: cf 92 push r12 39738: df 92 push r13 3973a: ef 92 push r14 3973c: ff 92 push r15 3973e: 1f 93 push r17 39740: cf 93 push r28 39742: df 93 push r29 39744: cd b7 in r28, 0x3d ; 61 39746: de b7 in r29, 0x3e ; 62 39748: a8 97 sbiw r28, 0x28 ; 40 3974a: 0f b6 in r0, 0x3f ; 63 3974c: f8 94 cli 3974e: de bf out 0x3e, r29 ; 62 39750: 0f be out 0x3f, r0 ; 63 39752: 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); 39754: 48 e0 ldi r20, 0x08 ; 8 39756: 50 e0 ldi r21, 0x00 ; 0 39758: 6d ed ldi r22, 0xDD ; 221 3975a: 7f e0 ldi r23, 0x0F ; 15 3975c: ce 01 movw r24, r28 3975e: 01 96 adiw r24, 0x01 ; 1 39760: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 39764: 48 e0 ldi r20, 0x08 ; 8 39766: 50 e0 ldi r21, 0x00 ; 0 39768: 65 ed ldi r22, 0xD5 ; 213 3976a: 7f e0 ldi r23, 0x0F ; 15 3976c: ce 01 movw r24, r28 3976e: 09 96 adiw r24, 0x09 ; 9 39770: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 39774: 48 e0 ldi r20, 0x08 ; 8 39776: 50 e0 ldi r21, 0x00 ; 0 39778: 65 ee ldi r22, 0xE5 ; 229 3977a: 7f e0 ldi r23, 0x0F ; 15 3977c: ce 01 movw r24, r28 3977e: 41 96 adiw r24, 0x11 ; 17 39780: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 39784: 89 89 ldd r24, Y+17 ; 0x11 39786: 9a 89 ldd r25, Y+18 ; 0x12 39788: ab 89 ldd r26, Y+19 ; 0x13 3978a: bc 89 ldd r27, Y+20 ; 0x14 3978c: 89 a3 std Y+33, r24 ; 0x21 3978e: 9a a3 std Y+34, r25 ; 0x22 39790: ab a3 std Y+35, r26 ; 0x23 39792: bc a3 std Y+36, r27 ; 0x24 39794: 8f 3f cpi r24, 0xFF ; 255 39796: 9f 4f sbci r25, 0xFF ; 255 39798: af 4f sbci r26, 0xFF ; 255 3979a: bf 4f sbci r27, 0xFF ; 255 3979c: 09 f4 brne .+2 ; 0x397a0 3979e: b1 c0 rjmp .+354 ; 0x39902 397a0: 8d 89 ldd r24, Y+21 ; 0x15 397a2: 9e 89 ldd r25, Y+22 ; 0x16 397a4: af 89 ldd r26, Y+23 ; 0x17 397a6: b8 8d ldd r27, Y+24 ; 0x18 397a8: 8d a3 std Y+37, r24 ; 0x25 397aa: 9e a3 std Y+38, r25 ; 0x26 397ac: af a3 std Y+39, r26 ; 0x27 397ae: b8 a7 std Y+40, r27 ; 0x28 397b0: 8f 3f cpi r24, 0xFF ; 255 397b2: 9f 4f sbci r25, 0xFF ; 255 397b4: af 4f sbci r26, 0xFF ; 255 397b6: bf 4f sbci r27, 0xFF ; 255 397b8: 09 f4 brne .+2 ; 0x397bc 397ba: a3 c0 rjmp .+326 ; 0x39902 397bc: 89 80 ldd r8, Y+1 ; 0x01 397be: 9a 80 ldd r9, Y+2 ; 0x02 397c0: ab 80 ldd r10, Y+3 ; 0x03 397c2: bc 80 ldd r11, Y+4 ; 0x04 397c4: 8f ef ldi r24, 0xFF ; 255 397c6: 88 16 cp r8, r24 397c8: 98 06 cpc r9, r24 397ca: a8 06 cpc r10, r24 397cc: b8 06 cpc r11, r24 397ce: 09 f4 brne .+2 ; 0x397d2 397d0: 98 c0 rjmp .+304 ; 0x39902 397d2: 8d 81 ldd r24, Y+5 ; 0x05 397d4: 9e 81 ldd r25, Y+6 ; 0x06 397d6: af 81 ldd r26, Y+7 ; 0x07 397d8: b8 85 ldd r27, Y+8 ; 0x08 397da: 89 8f std Y+25, r24 ; 0x19 397dc: 9a 8f std Y+26, r25 ; 0x1a 397de: ab 8f std Y+27, r26 ; 0x1b 397e0: bc 8f std Y+28, r27 ; 0x1c 397e2: 8f 3f cpi r24, 0xFF ; 255 397e4: 9f 4f sbci r25, 0xFF ; 255 397e6: af 4f sbci r26, 0xFF ; 255 397e8: bf 4f sbci r27, 0xFF ; 255 397ea: 09 f4 brne .+2 ; 0x397ee 397ec: 8a c0 rjmp .+276 ; 0x39902 397ee: c9 84 ldd r12, Y+9 ; 0x09 397f0: da 84 ldd r13, Y+10 ; 0x0a 397f2: eb 84 ldd r14, Y+11 ; 0x0b 397f4: fc 84 ldd r15, Y+12 ; 0x0c 397f6: 8f ef ldi r24, 0xFF ; 255 397f8: c8 16 cp r12, r24 397fa: d8 06 cpc r13, r24 397fc: e8 06 cpc r14, r24 397fe: f8 06 cpc r15, r24 39800: 09 f4 brne .+2 ; 0x39804 39802: 7f c0 rjmp .+254 ; 0x39902 39804: 8d 85 ldd r24, Y+13 ; 0x0d 39806: 9e 85 ldd r25, Y+14 ; 0x0e 39808: af 85 ldd r26, Y+15 ; 0x0f 3980a: b8 89 ldd r27, Y+16 ; 0x10 3980c: 8d 8f std Y+29, r24 ; 0x1d 3980e: 9e 8f std Y+30, r25 ; 0x1e 39810: af 8f std Y+31, r26 ; 0x1f 39812: b8 a3 std Y+32, r27 ; 0x20 39814: 8f 3f cpi r24, 0xFF ; 255 39816: 9f 4f sbci r25, 0xFF ; 255 39818: af 4f sbci r26, 0xFF ; 255 3981a: bf 4f sbci r27, 0xFF ; 255 3981c: 09 f4 brne .+2 ; 0x39820 3981e: 71 c0 rjmp .+226 ; 0x39902 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 39820: 29 8d ldd r18, Y+25 ; 0x19 39822: 3a 8d ldd r19, Y+26 ; 0x1a 39824: 4b 8d ldd r20, Y+27 ; 0x1b 39826: 5c 8d ldd r21, Y+28 ; 0x1c 39828: c5 01 movw r24, r10 3982a: b4 01 movw r22, r8 3982c: 0f 94 d3 e0 call 0x3c1a6 ; 0x3c1a6 39830: 2b 01 movw r4, r22 39832: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39834: 26 e6 ldi r18, 0x66 ; 102 39836: 36 e6 ldi r19, 0x66 ; 102 39838: 46 e6 ldi r20, 0x66 ; 102 3983a: 5f e3 ldi r21, 0x3F ; 63 3983c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__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; 39840: 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) 39842: 87 fd sbrc r24, 7 39844: 0b c0 rjmp .+22 ; 0x3985c 39846: 2d ec ldi r18, 0xCD ; 205 39848: 3c ec ldi r19, 0xCC ; 204 3984a: 4c e8 ldi r20, 0x8C ; 140 3984c: 5f e3 ldi r21, 0x3F ; 63 3984e: c3 01 movw r24, r6 39850: b2 01 movw r22, r4 39852: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 39856: 18 16 cp r1, r24 39858: 0c f0 brlt .+2 ; 0x3985c 3985a: 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]); 3985c: 2d 8d ldd r18, Y+29 ; 0x1d 3985e: 3e 8d ldd r19, Y+30 ; 0x1e 39860: 4f 8d ldd r20, Y+31 ; 0x1f 39862: 58 a1 ldd r21, Y+32 ; 0x20 39864: c7 01 movw r24, r14 39866: b6 01 movw r22, r12 39868: 0f 94 d3 e0 call 0x3c1a6 ; 0x3c1a6 3986c: 2b 01 movw r4, r22 3986e: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39870: 26 e6 ldi r18, 0x66 ; 102 39872: 36 e6 ldi r19, 0x66 ; 102 39874: 46 e6 ldi r20, 0x66 ; 102 39876: 5f e3 ldi r21, 0x3F ; 63 39878: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 3987c: 87 fd sbrc r24, 7 3987e: 7f c0 rjmp .+254 ; 0x3997e 39880: 2d ec ldi r18, 0xCD ; 205 39882: 3c ec ldi r19, 0xCC ; 204 39884: 4c e8 ldi r20, 0x8C ; 140 39886: 5f e3 ldi r21, 0x3F ; 63 39888: c3 01 movw r24, r6 3988a: b2 01 movw r22, r4 3988c: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 39890: 18 16 cp r1, r24 39892: 0c f4 brge .+2 ; 0x39896 39894: 74 c0 rjmp .+232 ; 0x3997e 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]); 39896: 2d a1 ldd r18, Y+37 ; 0x25 39898: 3e a1 ldd r19, Y+38 ; 0x26 3989a: 4f a1 ldd r20, Y+39 ; 0x27 3989c: 58 a5 ldd r21, Y+40 ; 0x28 3989e: 69 a1 ldd r22, Y+33 ; 0x21 398a0: 7a a1 ldd r23, Y+34 ; 0x22 398a2: 8b a1 ldd r24, Y+35 ; 0x23 398a4: 9c a1 ldd r25, Y+36 ; 0x24 398a6: 0f 94 d3 e0 call 0x3c1a6 ; 0x3c1a6 if (l > 15.f) 398aa: 20 e0 ldi r18, 0x00 ; 0 398ac: 30 e0 ldi r19, 0x00 ; 0 398ae: 40 e7 ldi r20, 0x70 ; 112 398b0: 51 e4 ldi r21, 0x41 ; 65 398b2: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 398b6: 18 16 cp r1, r24 398b8: 0c f4 brge .+2 ; 0x398bc #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 398ba: 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]; 398bc: a5 01 movw r20, r10 398be: 94 01 movw r18, r8 398c0: c7 01 movw r24, r14 398c2: b6 01 movw r22, r12 398c4: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 398c8: 6b 01 movw r12, r22 398ca: 7c 01 movw r14, r24 398cc: 2d 8d ldd r18, Y+29 ; 0x1d 398ce: 3e 8d ldd r19, Y+30 ; 0x1e 398d0: 4f 8d ldd r20, Y+31 ; 0x1f 398d2: 58 a1 ldd r21, Y+32 ; 0x20 398d4: 69 8d ldd r22, Y+25 ; 0x19 398d6: 7a 8d ldd r23, Y+26 ; 0x1a 398d8: 8b 8d ldd r24, Y+27 ; 0x1b 398da: 9c 8d ldd r25, Y+28 ; 0x1c 398dc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 398e0: 9b 01 movw r18, r22 398e2: ac 01 movw r20, r24 398e4: c7 01 movw r24, r14 398e6: b6 01 movw r22, r12 398e8: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> if (fabs(l) > 0.1f) 398ec: 9f 77 andi r25, 0x7F ; 127 398ee: 2d ec ldi r18, 0xCD ; 205 398f0: 3c ec ldi r19, 0xCC ; 204 398f2: 4c ec ldi r20, 0xCC ; 204 398f4: 5d e3 ldi r21, 0x3D ; 61 398f6: 0f 94 c0 e0 call 0x3c180 ; 0x3c180 <__gesf2> 398fa: 18 16 cp r1, r24 398fc: 14 f0 brlt .+4 ; 0x39902 #endif reset = true; } } if (reset) 398fe: 11 23 and r17, r17 39900: f1 f0 breq .+60 ; 0x3993e { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 39902: 0f 94 4d cb call 0x3969a ; 0x3969a * @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; 39906: 80 e0 ldi r24, 0x00 ; 0 39908: 90 e0 ldi r25, 0x00 ; 0 3990a: a0 e8 ldi r26, 0x80 ; 128 3990c: bf e3 ldi r27, 0x3F ; 63 3990e: 89 83 std Y+1, r24 ; 0x01 39910: 9a 83 std Y+2, r25 ; 0x02 39912: ab 83 std Y+3, r26 ; 0x03 39914: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 39916: 1d 82 std Y+5, r1 ; 0x05 39918: 1e 82 std Y+6, r1 ; 0x06 3991a: 1f 82 std Y+7, r1 ; 0x07 3991c: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 3991e: 19 86 std Y+9, r1 ; 0x09 39920: 1a 86 std Y+10, r1 ; 0x0a 39922: 1b 86 std Y+11, r1 ; 0x0b 39924: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 39926: 8d 87 std Y+13, r24 ; 0x0d 39928: 9e 87 std Y+14, r25 ; 0x0e 3992a: af 87 std Y+15, r26 ; 0x0f 3992c: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 3992e: 19 8a std Y+17, r1 ; 0x11 39930: 1a 8a std Y+18, r1 ; 0x12 39932: 1b 8a std Y+19, r1 ; 0x13 39934: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 39936: 1d 8a std Y+21, r1 ; 0x15 39938: 1e 8a std Y+22, r1 ; 0x16 3993a: 1f 8a std Y+23, r1 ; 0x17 3993c: 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); 3993e: ae 01 movw r20, r28 39940: 4f 5e subi r20, 0xEF ; 239 39942: 5f 4f sbci r21, 0xFF ; 255 39944: be 01 movw r22, r28 39946: 67 5f subi r22, 0xF7 ; 247 39948: 7f 4f sbci r23, 0xFF ; 255 3994a: ce 01 movw r24, r28 3994c: 01 96 adiw r24, 0x01 ; 1 3994e: 0f 94 ac c9 call 0x39358 ; 0x39358 MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 39952: a8 96 adiw r28, 0x28 ; 40 39954: 0f b6 in r0, 0x3f ; 63 39956: f8 94 cli 39958: de bf out 0x3e, r29 ; 62 3995a: 0f be out 0x3f, r0 ; 63 3995c: cd bf out 0x3d, r28 ; 61 3995e: df 91 pop r29 39960: cf 91 pop r28 39962: 1f 91 pop r17 39964: ff 90 pop r15 39966: ef 90 pop r14 39968: df 90 pop r13 3996a: cf 90 pop r12 3996c: bf 90 pop r11 3996e: af 90 pop r10 39970: 9f 90 pop r9 39972: 8f 90 pop r8 39974: 7f 90 pop r7 39976: 6f 90 pop r6 39978: 5f 90 pop r5 3997a: 4f 90 pop r4 3997c: 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; 3997e: 11 e0 ldi r17, 0x01 ; 1 39980: 8a cf rjmp .-236 ; 0x39896 00039982 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 39982: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 39984: 24 e1 ldi r18, 0x14 ; 20 39986: ac 01 movw r20, r24 39988: 24 9f mul r18, r20 3998a: c0 01 movw r24, r0 3998c: 25 9f mul r18, r21 3998e: 90 0d add r25, r0 39990: 11 24 eor r1, r1 39992: 60 91 b3 17 lds r22, 0x17B3 ; 0x8017b3 39996: 70 91 b4 17 lds r23, 0x17B4 ; 0x8017b4 3999a: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 3999e: c6 2f mov r28, r22 399a0: 65 31 cpi r22, 0x15 ; 21 399a2: 08 f0 brcs .+2 ; 0x399a6 399a4: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 399a6: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 399aa: 8c 17 cp r24, r28 399ac: 48 f4 brcc .+18 ; 0x399c0 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 399ae: 8f ef ldi r24, 0xFF ; 255 399b0: 0e 94 d5 70 call 0xe1aa ; 0xe1aa { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 399b4: 80 91 b2 17 lds r24, 0x17B2 ; 0x8017b2 399b8: 8f 5f subi r24, 0xFF ; 255 399ba: 80 93 b2 17 sts 0x17B2, r24 ; 0x8017b2 399be: f3 cf rjmp .-26 ; 0x399a6 } } 399c0: cf 91 pop r28 399c2: 08 95 ret 000399c4 : void menu_progressbar_finish(void) { progressbar_total = 1; 399c4: 81 e0 ldi r24, 0x01 ; 1 399c6: 90 e0 ldi r25, 0x00 ; 0 399c8: 90 93 b4 17 sts 0x17B4, r25 ; 0x8017b4 399cc: 80 93 b3 17 sts 0x17B3, r24 ; 0x8017b3 menu_progressbar_update(1); 399d0: 0f 94 c1 cc call 0x39982 ; 0x39982 _delay(300); 399d4: 6c e2 ldi r22, 0x2C ; 44 399d6: 71 e0 ldi r23, 0x01 ; 1 399d8: 80 e0 ldi r24, 0x00 ; 0 399da: 90 e0 ldi r25, 0x00 ; 0 399dc: 0d 94 5c 3c jmp 0x278b8 ; 0x278b8 000399e0 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 399e0: 0f 93 push r16 399e2: 1f 93 push r17 399e4: cf 93 push r28 399e6: df 93 push r29 399e8: 8c 01 movw r16, r24 399ea: eb 01 movw r28, r22 lcd_clear(); 399ec: 0e 94 59 70 call 0xe0b2 ; 0xe0b2 progressbar_block_count = 0; 399f0: 10 92 b2 17 sts 0x17B2, r1 ; 0x8017b2 progressbar_total = total; 399f4: 10 93 b4 17 sts 0x17B4, r17 ; 0x8017b4 399f8: 00 93 b3 17 sts 0x17B3, r16 ; 0x8017b3 lcd_set_cursor(0, 1); 399fc: 61 e0 ldi r22, 0x01 ; 1 399fe: 80 e0 ldi r24, 0x00 ; 0 39a00: 0e 94 26 70 call 0xe04c ; 0xe04c lcd_print_pad_P(title, LCD_WIDTH); 39a04: 64 e1 ldi r22, 0x14 ; 20 39a06: ce 01 movw r24, r28 39a08: 0e 94 fb 71 call 0xe3f6 ; 0xe3f6 lcd_set_cursor(0, 2); 39a0c: 62 e0 ldi r22, 0x02 ; 2 39a0e: 80 e0 ldi r24, 0x00 ; 0 } 39a10: df 91 pop r29 39a12: cf 91 pop r28 39a14: 1f 91 pop r17 39a16: 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); 39a18: 0c 94 26 70 jmp 0xe04c ; 0xe04c 00039a1c : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 39a1c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39a20: 90 91 14 05 lds r25, 0x0514 ; 0x800514 39a24: 89 13 cpse r24, r25 39a26: 0b c0 rjmp .+22 ; 0x39a3e 39a28: 90 91 13 05 lds r25, 0x0513 ; 0x800513 39a2c: 99 23 and r25, r25 39a2e: 39 f0 breq .+14 ; 0x39a3e 39a30: 20 91 34 05 lds r18, 0x0534 ; 0x800534 39a34: 30 91 35 05 lds r19, 0x0535 ; 0x800535 39a38: 82 17 cp r24, r18 39a3a: 13 06 cpc r1, r19 39a3c: 39 f0 breq .+14 ; 0x39a4c 39a3e: 81 e0 ldi r24, 0x01 ; 1 39a40: 90 91 cf 03 lds r25, 0x03CF ; 0x8003cf 39a44: 91 11 cpse r25, r1 39a46: 03 c0 rjmp .+6 ; 0x39a4e 39a48: 80 e0 ldi r24, 0x00 ; 0 39a4a: 08 95 ret 39a4c: 81 e0 ldi r24, 0x01 ; 1 } 39a4e: 08 95 ret 00039a50 : //! @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) { 39a50: 0f 93 push r16 39a52: 1f 93 push r17 39a54: cf 93 push r28 39a56: df 93 push r29 39a58: 8c 01 movw r16, r24 39a5a: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 39a5c: 80 e8 ldi r24, 0x80 ; 128 39a5e: 94 e4 ldi r25, 0x44 ; 68 39a60: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 39a64: 9f 93 push r25 39a66: 8f 93 push r24 39a68: 8a e2 ldi r24, 0x2A ; 42 39a6a: 9b ea ldi r25, 0xAB ; 171 39a6c: 9f 93 push r25 39a6e: 8f 93 push r24 39a70: df 93 push r29 39a72: cf 93 push r28 39a74: 0f 94 26 dc call 0x3b84c ; 0x3b84c eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 39a78: c8 0f add r28, r24 39a7a: d1 1d adc r29, r1 39a7c: 47 e0 ldi r20, 0x07 ; 7 39a7e: 50 e0 ldi r21, 0x00 ; 0 39a80: b8 01 movw r22, r16 39a82: ce 01 movw r24, r28 39a84: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe //index += 7; buffer.c[index + 7] = '\0'; 39a88: 1f 82 std Y+7, r1 ; 0x07 39a8a: 0f 90 pop r0 39a8c: 0f 90 pop r0 39a8e: 0f 90 pop r0 39a90: 0f 90 pop r0 39a92: 0f 90 pop r0 39a94: 0f 90 pop r0 } 39a96: df 91 pop r29 39a98: cf 91 pop r28 39a9a: 1f 91 pop r17 39a9c: 0f 91 pop r16 39a9e: 08 95 ret 00039aa0 : 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)?'>':' '; 39aa0: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39aa4: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39aa8: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39aac: 28 17 cp r18, r24 39aae: 19 06 cpc r1, r25 39ab0: 11 f0 breq .+4 ; 0x39ab6 39ab2: 80 e2 ldi r24, 0x20 ; 32 39ab4: 08 95 ret 39ab6: 8e e3 ldi r24, 0x3E ; 62 } 39ab8: 08 95 ret 00039aba : static void menu_draw_item_puts_P(char type_char, const char* str) { 39aba: 0f 93 push r16 39abc: 1f 93 push r17 39abe: cf 93 push r28 39ac0: c8 2f mov r28, r24 39ac2: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 39ac4: 0f 94 50 cd call 0x39aa0 ; 0x39aa0 39ac8: 48 2f mov r20, r24 39aca: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39ace: 80 e0 ldi r24, 0x00 ; 0 39ad0: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_print_pad_P(str, LCD_WIDTH - 2); 39ad4: 62 e1 ldi r22, 0x12 ; 18 39ad6: c8 01 movw r24, r16 39ad8: 0e 94 fb 71 call 0xe3f6 ; 0xe3f6 lcd_putc(type_char); 39adc: 8c 2f mov r24, r28 } 39ade: cf 91 pop r28 39ae0: 1f 91 pop r17 39ae2: 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); 39ae4: 0c 94 15 70 jmp 0xe02a ; 0xe02a 00039ae8 : } } void menu_item_ret(void) { lcd_draw_update = 2; 39ae8: 82 e0 ldi r24, 0x02 ; 2 39aea: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 39aee: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39af2: 8f 5f subi r24, 0xFF ; 255 39af4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 //prevent the rest of the menu items from rendering or getting clicked menu_row = LCD_HEIGHT; // early exit from the MENU_BEGIN() for loop at the end of the current cycle 39af8: 84 e0 ldi r24, 0x04 ; 4 39afa: 80 93 12 05 sts 0x0512, r24 ; 0x800512 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 39afe: 10 92 14 05 sts 0x0514, r1 ; 0x800514 menu_clicked = 0; // prevent subsequent items from being able to be clicked in case the current menu or position was changed by the clicked menu item 39b02: 10 92 13 05 sts 0x0513, r1 ; 0x800513 } 39b06: 08 95 ret 00039b08 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 39b08: cf 93 push r28 39b0a: df 93 push r29 if (menu_item == menu_line) 39b0c: 30 91 15 05 lds r19, 0x0515 ; 0x800515 39b10: 20 91 14 05 lds r18, 0x0514 ; 0x800514 39b14: 32 13 cpse r19, r18 39b16: 20 c0 rjmp .+64 ; 0x39b58 39b18: eb 01 movw r28, r22 39b1a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39b1c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39b20: 88 23 and r24, r24 39b22: 19 f0 breq .+6 ; 0x39b2a 39b24: 80 e2 ldi r24, 0x20 ; 32 39b26: 0f 94 5d cd call 0x39aba ; 0x39aba if (menu_clicked && (lcd_encoder == menu_item)) 39b2a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39b2e: 88 23 and r24, r24 39b30: 99 f0 breq .+38 ; 0x39b58 39b32: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39b36: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39b3a: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39b3e: 28 17 cp r18, r24 39b40: 19 06 cpc r1, r25 39b42: 51 f4 brne .+20 ; 0x39b58 { if (str_gcode) enquecommand_P(str_gcode); 39b44: 20 97 sbiw r28, 0x00 ; 0 39b46: 21 f0 breq .+8 ; 0x39b50 39b48: 61 e0 ldi r22, 0x01 ; 1 39b4a: ce 01 movw r24, r28 39b4c: 0e 94 dc 89 call 0x113b8 ; 0x113b8 menu_item_ret(); return; } } menu_item++; } 39b50: df 91 pop r29 39b52: 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(); 39b54: 0d 94 74 cd jmp 0x39ae8 ; 0x39ae8 return; } } menu_item++; 39b58: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39b5c: 8f 5f subi r24, 0xFF ; 255 39b5e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 39b62: df 91 pop r29 39b64: cf 91 pop r28 39b66: 08 95 ret 00039b68 : //! @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) { 39b68: ef 92 push r14 39b6a: ff 92 push r15 39b6c: 0f 93 push r16 39b6e: 1f 93 push r17 39b70: cf 93 push r28 39b72: df 93 push r29 if (menu_item == menu_line) 39b74: 70 91 15 05 lds r23, 0x0515 ; 0x800515 39b78: 30 91 14 05 lds r19, 0x0514 ; 0x800514 39b7c: 73 13 cpse r23, r19 39b7e: 3f c0 rjmp .+126 ; 0x39bfe 39b80: 12 2f mov r17, r18 39b82: ea 01 movw r28, r20 39b84: 06 2f mov r16, r22 39b86: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 39b88: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39b8c: 88 23 and r24, r24 39b8e: d1 f0 breq .+52 ; 0x39bc4 } 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()); 39b90: 0f 94 50 cd call 0x39aa0 ; 0x39aa0 39b94: 48 2f mov r20, r24 39b96: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39b9a: 80 e0 ldi r24, 0x00 ; 0 39b9c: 0e 94 46 70 call 0xe08c ; 0xe08c uint8_t len = lcd_print_pad_P(str, max_strlen); 39ba0: 61 e1 ldi r22, 0x11 ; 17 39ba2: c7 01 movw r24, r14 39ba4: 0e 94 fb 71 call 0xe3f6 ; 0xe3f6 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 39ba8: 40 2f mov r20, r16 39baa: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39bae: 93 e1 ldi r25, 0x13 ; 19 39bb0: 98 1b sub r25, r24 39bb2: 89 2f mov r24, r25 39bb4: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 39bb8: 40 e2 ldi r20, 0x20 ; 32 39bba: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39bbe: 83 e1 ldi r24, 0x13 ; 19 39bc0: 0e 94 46 70 call 0xe08c ; 0xe08c 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)) 39bc4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39bc8: 88 23 and r24, r24 39bca: c9 f0 breq .+50 ; 0x39bfe 39bcc: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39bd0: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39bd4: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39bd8: 28 17 cp r18, r24 39bda: 19 06 cpc r1, r25 39bdc: 81 f4 brne .+32 ; 0x39bfe { lcd_update_enabled = 0; 39bde: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 39be2: 81 2f mov r24, r17 39be4: fe 01 movw r30, r28 39be6: 19 95 eicall lcd_update_enabled = 1; 39be8: 81 e0 ldi r24, 0x01 ; 1 39bea: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39bee: df 91 pop r29 39bf0: cf 91 pop r28 39bf2: 1f 91 pop r17 39bf4: 0f 91 pop r16 39bf6: ff 90 pop r15 39bf8: 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(); 39bfa: 0d 94 74 cd jmp 0x39ae8 ; 0x39ae8 return; } } menu_item++; 39bfe: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39c02: 8f 5f subi r24, 0xFF ; 255 39c04: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 39c08: df 91 pop r29 39c0a: cf 91 pop r28 39c0c: 1f 91 pop r17 39c0e: 0f 91 pop r16 39c10: ff 90 pop r15 39c12: ef 90 pop r14 39c14: 08 95 ret 00039c16 : 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) { 39c16: cf 93 push r28 39c18: df 93 push r29 if (menu_item == menu_line) 39c1a: 30 91 15 05 lds r19, 0x0515 ; 0x800515 39c1e: 20 91 14 05 lds r18, 0x0514 ; 0x800514 39c22: 32 13 cpse r19, r18 39c24: 21 c0 rjmp .+66 ; 0x39c68 39c26: eb 01 movw r28, r22 39c28: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39c2a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39c2e: 88 23 and r24, r24 39c30: 19 f0 breq .+6 ; 0x39c38 39c32: 80 e2 ldi r24, 0x20 ; 32 39c34: 0f 94 5d cd call 0x39aba ; 0x39aba if (menu_clicked && (lcd_encoder == menu_item)) 39c38: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39c3c: 88 23 and r24, r24 39c3e: a1 f0 breq .+40 ; 0x39c68 39c40: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39c44: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39c48: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39c4c: 28 17 cp r18, r24 39c4e: 19 06 cpc r1, r25 39c50: 59 f4 brne .+22 ; 0x39c68 { lcd_update_enabled = 0; 39c52: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 39c56: fe 01 movw r30, r28 39c58: 19 95 eicall lcd_update_enabled = 1; 39c5a: 81 e0 ldi r24, 0x01 ; 1 39c5c: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39c60: df 91 pop r29 39c62: 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(); 39c64: 0d 94 74 cd jmp 0x39ae8 ; 0x39ae8 return; } } menu_item++; 39c68: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39c6c: 8f 5f subi r24, 0xFF ; 255 39c6e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 39c72: df 91 pop r29 39c74: cf 91 pop r28 39c76: 08 95 ret 00039c78 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 39c78: 30 91 15 05 lds r19, 0x0515 ; 0x800515 39c7c: 20 91 14 05 lds r18, 0x0514 ; 0x800514 39c80: 32 13 cpse r19, r18 39c82: 19 c0 rjmp .+50 ; 0x39cb6 39c84: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39c86: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39c8a: 88 23 and r24, r24 39c8c: 19 f0 breq .+6 ; 0x39c94 39c8e: 80 e2 ldi r24, 0x20 ; 32 39c90: 0f 94 5d cd call 0x39aba ; 0x39aba if (menu_clicked && (lcd_encoder == menu_item)) 39c94: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39c98: 88 23 and r24, r24 39c9a: 69 f0 breq .+26 ; 0x39cb6 39c9c: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39ca0: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39ca4: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39ca8: 28 17 cp r18, r24 39caa: 19 06 cpc r1, r25 39cac: 21 f4 brne .+8 ; 0x39cb6 { menu_item_ret(); 39cae: 0f 94 74 cd call 0x39ae8 ; 0x39ae8 return 1; 39cb2: 81 e0 ldi r24, 0x01 ; 1 39cb4: 08 95 ret } } menu_item++; 39cb6: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39cba: 8f 5f subi r24, 0xFF ; 255 39cbc: 80 93 15 05 sts 0x0515, r24 ; 0x800515 return 0; 39cc0: 80 e0 ldi r24, 0x00 ; 0 } 39cc2: 08 95 ret 00039cc4 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 39cc4: 80 91 12 05 lds r24, 0x0512 ; 0x800512 39cc8: 84 30 cpi r24, 0x04 ; 4 39cca: 38 f5 brcc .+78 ; 0x39d1a { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 39ccc: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39cd0: 90 e0 ldi r25, 0x00 ; 0 39cd2: 20 91 34 05 lds r18, 0x0534 ; 0x800534 39cd6: 30 91 35 05 lds r19, 0x0535 ; 0x800535 39cda: 28 17 cp r18, r24 39cdc: 39 07 cpc r19, r25 39cde: 44 f0 brlt .+16 ; 0x39cf0 { lcd_encoder = menu_item - 1; 39ce0: 01 97 sbiw r24, 0x01 ; 1 39ce2: 90 93 35 05 sts 0x0535, r25 ; 0x800535 39ce6: 80 93 34 05 sts 0x0534, r24 ; 0x800534 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39cea: 87 e0 ldi r24, 0x07 ; 7 39cec: 0f 94 2e 63 call 0x2c65c ; 0x2c65c } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 39cf0: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39cf4: 20 91 a1 03 lds r18, 0x03A1 ; 0x8003a1 39cf8: 30 e0 ldi r19, 0x00 ; 0 39cfa: 2d 5f subi r18, 0xFD ; 253 39cfc: 3f 4f sbci r19, 0xFF ; 255 39cfe: 82 17 cp r24, r18 39d00: 13 06 cpc r1, r19 39d02: 59 f0 breq .+22 ; 0x39d1a 39d04: 54 f0 brlt .+20 ; 0x39d1a { menu_top = lcd_encoder - LCD_HEIGHT + 1; 39d06: 9d ef ldi r25, 0xFD ; 253 39d08: 98 0f add r25, r24 39d0a: 90 93 a1 03 sts 0x03A1, r25 ; 0x8003a1 menu_line = menu_top - 1; 39d0e: 84 50 subi r24, 0x04 ; 4 39d10: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_row = -1; 39d14: 8f ef ldi r24, 0xFF ; 255 39d16: 80 93 12 05 sts 0x0512, r24 ; 0x800512 } } 39d1a: 08 95 ret 00039d1c : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 39d1c: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39d20: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39d24: 97 ff sbrs r25, 7 39d26: 07 c0 rjmp .+14 ; 0x39d36 { lcd_encoder = 0; 39d28: 10 92 35 05 sts 0x0535, r1 ; 0x800535 39d2c: 10 92 34 05 sts 0x0534, r1 ; 0x800534 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39d30: 87 e0 ldi r24, 0x07 ; 7 39d32: 0f 94 2e 63 call 0x2c65c ; 0x2c65c } if (lcd_encoder < menu_top) 39d36: 80 91 34 05 lds r24, 0x0534 ; 0x800534 39d3a: 90 91 35 05 lds r25, 0x0535 ; 0x800535 39d3e: 20 91 a1 03 lds r18, 0x03A1 ; 0x8003a1 39d42: 28 17 cp r18, r24 39d44: 19 06 cpc r1, r25 39d46: 19 f0 breq .+6 ; 0x39d4e 39d48: 14 f0 brlt .+4 ; 0x39d4e menu_top = lcd_encoder; 39d4a: 80 93 a1 03 sts 0x03A1, r24 ; 0x8003a1 menu_line = menu_top; 39d4e: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 39d52: 80 93 14 05 sts 0x0514, r24 ; 0x800514 menu_clicked = lcd_clicked(); // Consume click event 39d56: 0e 94 43 72 call 0xe486 ; 0xe486 39d5a: 80 93 13 05 sts 0x0513, r24 ; 0x800513 } 39d5e: 08 95 ret 00039d60 : 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)); 39d60: e5 ea ldi r30, 0xA5 ; 165 39d62: f3 e0 ldi r31, 0x03 ; 3 39d64: 80 e2 ldi r24, 0x20 ; 32 39d66: df 01 movw r26, r30 39d68: 1d 92 st X+, r1 39d6a: 8a 95 dec r24 39d6c: e9 f7 brne .-6 ; 0x39d68 } 39d6e: 08 95 ret 00039d70 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 39d70: cf 93 push r28 CRITICAL_SECTION_START; 39d72: 3f b7 in r19, 0x3f ; 63 39d74: f8 94 cli if (menu_menu != menu) 39d76: e0 91 66 0e lds r30, 0x0E66 ; 0x800e66 39d7a: f0 91 67 0e lds r31, 0x0E67 ; 0x800e67 39d7e: e8 17 cp r30, r24 39d80: f9 07 cpc r31, r25 39d82: c9 f0 breq .+50 ; 0x39db6 39d84: c4 2f mov r28, r20 { menu_menu = menu; 39d86: 90 93 67 0e sts 0x0E67, r25 ; 0x800e67 39d8a: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 lcd_encoder = encoder; 39d8e: 70 93 35 05 sts 0x0535, r23 ; 0x800535 39d92: 60 93 34 05 sts 0x0534, r22 ; 0x800534 menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 39d96: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 lcd_draw_update = 2; // Full LCD re-draw 39d9a: 82 e0 ldi r24, 0x02 ; 2 39d9c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 39da0: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 39da2: 22 23 and r18, r18 39da4: 19 f0 breq .+6 ; 0x39dac } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 39da6: 80 e0 ldi r24, 0x00 ; 0 39da8: 0f 94 2e 63 call 0x2c65c ; 0x2c65c if (reset_menu_state) menu_data_reset(); 39dac: cc 23 and r28, r28 39dae: 21 f0 breq .+8 ; 0x39db8 } else CRITICAL_SECTION_END; } 39db0: 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(); 39db2: 0d 94 b0 ce jmp 0x39d60 ; 0x39d60 } else CRITICAL_SECTION_END; 39db6: 3f bf out 0x3f, r19 ; 63 } 39db8: cf 91 pop r28 39dba: 08 95 ret 00039dbc : 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) { 39dbc: 7f 92 push r7 39dbe: 8f 92 push r8 39dc0: 9f 92 push r9 39dc2: af 92 push r10 39dc4: bf 92 push r11 39dc6: cf 92 push r12 39dc8: df 92 push r13 39dca: ef 92 push r14 39dcc: ff 92 push r15 39dce: 0f 93 push r16 39dd0: 1f 93 push r17 39dd2: cf 93 push r28 39dd4: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 39dd6: e0 91 15 05 lds r30, 0x0515 ; 0x800515 39dda: 50 91 14 05 lds r21, 0x0514 ; 0x800514 39dde: e5 13 cpse r30, r21 39de0: 73 c0 rjmp .+230 ; 0x39ec8 { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 39de2: fb 01 movw r30, r22 39de4: 48 30 cpi r20, 0x08 ; 8 39de6: 09 f0 breq .+2 ; 0x39dea 39de8: 6c c0 rjmp .+216 ; 0x39ec2 39dea: c0 81 ld r28, Z 39dec: d0 e0 ldi r29, 0x00 ; 0 39dee: 49 01 movw r8, r18 39df0: 74 2e mov r7, r20 39df2: 6b 01 movw r12, r22 39df4: 5c 01 movw r10, r24 if (lcd_draw_update) 39df6: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39dfa: 88 23 and r24, r24 39dfc: 59 f0 breq .+22 ; 0x39e14 { lcd_set_cursor(0, menu_row); 39dfe: 60 91 12 05 lds r22, 0x0512 ; 0x800512 39e02: 80 e0 ldi r24, 0x00 ; 0 39e04: 0e 94 26 70 call 0xe04c ; 0xe04c menu_draw_P(menu_selection_mark(), str, cur_val); 39e08: 0f 94 50 cd call 0x39aa0 ; 0x39aa0 39e0c: ae 01 movw r20, r28 39e0e: b5 01 movw r22, r10 39e10: 0f 94 7a a3 call 0x346f4 ; 0x346f4 } if (menu_clicked && (lcd_encoder == menu_item)) 39e14: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39e18: 88 23 and r24, r24 39e1a: 09 f4 brne .+2 ; 0x39e1e 39e1c: 55 c0 rjmp .+170 ; 0x39ec8 39e1e: 90 91 15 05 lds r25, 0x0515 ; 0x800515 39e22: 20 91 34 05 lds r18, 0x0534 ; 0x800534 39e26: 30 91 35 05 lds r19, 0x0535 ; 0x800535 39e2a: 92 17 cp r25, r18 39e2c: 13 06 cpc r1, r19 39e2e: 09 f0 breq .+2 ; 0x39e32 39e30: 4b c0 rjmp .+150 ; 0x39ec8 } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 39e32: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 39e36: 87 30 cpi r24, 0x07 ; 7 39e38: d8 f4 brcc .+54 ; 0x39e70 { menu_stack[menu_depth].menu = menu_menu; 39e3a: 28 2f mov r18, r24 39e3c: 30 e0 ldi r19, 0x00 ; 0 39e3e: f9 01 movw r30, r18 39e40: ee 0f add r30, r30 39e42: ff 1f adc r31, r31 39e44: e2 0f add r30, r18 39e46: f3 1f adc r31, r19 39e48: e3 56 subi r30, 0x63 ; 99 39e4a: f8 4e sbci r31, 0xE8 ; 232 39e4c: 20 91 66 0e lds r18, 0x0E66 ; 0x800e66 39e50: 30 91 67 0e lds r19, 0x0E67 ; 0x800e67 39e54: 31 83 std Z+1, r19 ; 0x01 39e56: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 39e58: 8f 5f subi r24, 0xFF ; 255 39e5a: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 39e5e: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 39e60: 20 e0 ldi r18, 0x00 ; 0 39e62: 40 e0 ldi r20, 0x00 ; 0 39e64: 70 e0 ldi r23, 0x00 ; 0 39e66: 60 e0 ldi r22, 0x00 ; 0 39e68: 82 e2 ldi r24, 0x22 ; 34 39e6a: 9b e3 ldi r25, 0x3B ; 59 39e6c: 0f 94 b8 ce call 0x39d70 ; 0x39d70 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; 39e70: b0 92 a6 03 sts 0x03A6, r11 ; 0x8003a6 39e74: a0 92 a5 03 sts 0x03A5, r10 ; 0x8003a5 _md->editValuePtr = pval; 39e78: d0 92 a9 03 sts 0x03A9, r13 ; 0x8003a9 39e7c: c0 92 a8 03 sts 0x03A8, r12 ; 0x8003a8 _md->editValueBits = pbits; 39e80: 70 92 a7 03 sts 0x03A7, r7 ; 0x8003a7 _md->currentValue = cur_val; 39e84: d0 93 ab 03 sts 0x03AB, r29 ; 0x8003ab 39e88: c0 93 aa 03 sts 0x03AA, r28 ; 0x8003aa _md->minEditValue = min_val; 39e8c: 90 92 ad 03 sts 0x03AD, r9 ; 0x8003ad 39e90: 80 92 ac 03 sts 0x03AC, r8 ; 0x8003ac _md->maxEditValue = max_val; 39e94: 10 93 af 03 sts 0x03AF, r17 ; 0x8003af 39e98: 00 93 ae 03 sts 0x03AE, r16 ; 0x8003ae _md->minJumpValue = jmp_val; 39e9c: f0 92 b1 03 sts 0x03B1, r15 ; 0x8003b1 39ea0: e0 92 b0 03 sts 0x03B0, r14 ; 0x8003b0 menu_item_ret(); return; } } menu_item++; } 39ea4: df 91 pop r29 39ea6: cf 91 pop r28 39ea8: 1f 91 pop r17 39eaa: 0f 91 pop r16 39eac: ff 90 pop r15 39eae: ef 90 pop r14 39eb0: df 90 pop r13 39eb2: cf 90 pop r12 39eb4: bf 90 pop r11 39eb6: af 90 pop r10 39eb8: 9f 90 pop r9 39eba: 8f 90 pop r8 39ebc: 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(); 39ebe: 0d 94 74 cd jmp 0x39ae8 ; 0x39ae8 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)); 39ec2: c0 81 ld r28, Z 39ec4: d1 81 ldd r29, Z+1 ; 0x01 39ec6: 93 cf rjmp .-218 ; 0x39dee _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 39ec8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39ecc: 8f 5f subi r24, 0xFF ; 255 39ece: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 39ed2: df 91 pop r29 39ed4: cf 91 pop r28 39ed6: 1f 91 pop r17 39ed8: 0f 91 pop r16 39eda: ff 90 pop r15 39edc: ef 90 pop r14 39ede: df 90 pop r13 39ee0: cf 90 pop r12 39ee2: bf 90 pop r11 39ee4: af 90 pop r10 39ee6: 9f 90 pop r9 39ee8: 8f 90 pop r8 39eea: 7f 90 pop r7 39eec: 08 95 ret 00039eee <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 39eee: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39ef2: 88 23 and r24, r24 39ef4: 09 f4 brne .+2 ; 0x39ef8 <_menu_edit_P()+0xa> 39ef6: 52 c0 rjmp .+164 ; 0x39f9c <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 39ef8: 20 91 b0 03 lds r18, 0x03B0 ; 0x8003b0 39efc: 30 91 b1 03 lds r19, 0x03B1 ; 0x8003b1 39f00: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 39f04: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 39f08: 21 15 cp r18, r1 39f0a: 31 05 cpc r19, r1 39f0c: d9 f0 breq .+54 ; 0x39f44 <_menu_edit_P()+0x56> 39f0e: 40 91 34 05 lds r20, 0x0534 ; 0x800534 39f12: 50 91 35 05 lds r21, 0x0535 ; 0x800535 39f16: 41 15 cp r20, r1 39f18: 51 05 cpc r21, r1 39f1a: a1 f0 breq .+40 ; 0x39f44 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 39f1c: 7c f0 brlt .+30 ; 0x39f3c <_menu_edit_P()+0x4e> 39f1e: 40 91 aa 03 lds r20, 0x03AA ; 0x8003aa 39f22: 50 91 ab 03 lds r21, 0x03AB ; 0x8003ab 39f26: 48 17 cp r20, r24 39f28: 59 07 cpc r21, r25 39f2a: 41 f4 brne .+16 ; 0x39f3c <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 39f2c: 30 93 ab 03 sts 0x03AB, r19 ; 0x8003ab 39f30: 20 93 aa 03 sts 0x03AA, r18 ; 0x8003aa lcd_encoder = 0; 39f34: 10 92 35 05 sts 0x0535, r1 ; 0x800535 39f38: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 39f3c: 10 92 b1 03 sts 0x03B1, r1 ; 0x8003b1 39f40: 10 92 b0 03 sts 0x03B0, r1 ; 0x8003b0 } _md->currentValue += lcd_encoder; 39f44: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 39f48: 30 91 ab 03 lds r19, 0x03AB ; 0x8003ab 39f4c: 40 91 34 05 lds r20, 0x0534 ; 0x800534 39f50: 50 91 35 05 lds r21, 0x0535 ; 0x800535 39f54: 24 0f add r18, r20 39f56: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 39f58: 10 92 35 05 sts 0x0535, r1 ; 0x800535 39f5c: 10 92 34 05 sts 0x0534, r1 ; 0x800534 // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 39f60: 28 17 cp r18, r24 39f62: 39 07 cpc r19, r25 39f64: 44 f0 brlt .+16 ; 0x39f76 <_menu_edit_P()+0x88> 39f66: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 39f6a: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 39f6e: 28 17 cp r18, r24 39f70: 39 07 cpc r19, r25 39f72: 0c f4 brge .+2 ; 0x39f76 <_menu_edit_P()+0x88> 39f74: c9 01 movw r24, r18 39f76: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 39f7a: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa lcd_set_cursor(0, 1); 39f7e: 61 e0 ldi r22, 0x01 ; 1 39f80: 80 e0 ldi r24, 0x00 ; 0 39f82: 0e 94 26 70 call 0xe04c ; 0xe04c menu_draw_P(' ', _md->editLabel, _md->currentValue); 39f86: 40 91 aa 03 lds r20, 0x03AA ; 0x8003aa 39f8a: 50 91 ab 03 lds r21, 0x03AB ; 0x8003ab 39f8e: 60 91 a5 03 lds r22, 0x03A5 ; 0x8003a5 39f92: 70 91 a6 03 lds r23, 0x03A6 ; 0x8003a6 39f96: 80 e2 ldi r24, 0x20 ; 32 39f98: 0f 94 7a a3 call 0x346f4 ; 0x346f4 } if (lcd_clicked()) 39f9c: 0e 94 43 72 call 0xe486 ; 0xe486 39fa0: 88 23 and r24, r24 39fa2: 41 f1 breq .+80 ; 0x39ff4 <_menu_edit_P()+0x106> 39fa4: e0 91 a8 03 lds r30, 0x03A8 ; 0x8003a8 39fa8: f0 91 a9 03 lds r31, 0x03A9 ; 0x8003a9 39fac: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 39fb0: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab { if (_md->editValueBits == 8) 39fb4: 20 91 a7 03 lds r18, 0x03A7 ; 0x8003a7 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 39fb8: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 39fba: 28 30 cpi r18, 0x08 ; 8 39fbc: c9 f4 brne .+50 ; 0x39ff0 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 39fbe: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 39fc2: 88 23 and r24, r24 39fc4: b9 f0 breq .+46 ; 0x39ff4 <_menu_edit_P()+0x106> { menu_depth--; 39fc6: 81 50 subi r24, 0x01 ; 1 39fc8: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 39fcc: 90 e0 ldi r25, 0x00 ; 0 39fce: fc 01 movw r30, r24 39fd0: ee 0f add r30, r30 39fd2: ff 1f adc r31, r31 39fd4: e8 0f add r30, r24 39fd6: f9 1f adc r31, r25 39fd8: e3 56 subi r30, 0x63 ; 99 39fda: f8 4e sbci r31, 0xE8 ; 232 39fdc: 62 81 ldd r22, Z+2 ; 0x02 39fde: 06 2e mov r0, r22 39fe0: 00 0c add r0, r0 39fe2: 77 0b sbc r23, r23 39fe4: 20 e0 ldi r18, 0x00 ; 0 39fe6: 40 e0 ldi r20, 0x00 ; 0 39fe8: 80 81 ld r24, Z 39fea: 91 81 ldd r25, Z+1 ; 0x01 39fec: 0d 94 b8 ce jmp 0x39d70 ; 0x39d70 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 39ff0: 91 83 std Z+1, r25 ; 0x01 39ff2: e5 cf rjmp .-54 ; 0x39fbe <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 39ff4: 08 95 ret 00039ff6 : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 39ff6: dc 01 movw r26, r24 39ff8: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 39ffa: 90 91 f1 03 lds r25, 0x03F1 ; 0x8003f1 39ffe: 97 30 cpi r25, 0x07 ; 7 3a000: d8 f4 brcc .+54 ; 0x3a038 { menu_stack[menu_depth].menu = menu_menu; 3a002: 49 2f mov r20, r25 3a004: 50 e0 ldi r21, 0x00 ; 0 3a006: fa 01 movw r30, r20 3a008: ee 0f add r30, r30 3a00a: ff 1f adc r31, r31 3a00c: e4 0f add r30, r20 3a00e: f5 1f adc r31, r21 3a010: e3 56 subi r30, 0x63 ; 99 3a012: f8 4e sbci r31, 0xE8 ; 232 3a014: 40 91 66 0e lds r20, 0x0E66 ; 0x800e66 3a018: 50 91 67 0e lds r21, 0x0E67 ; 0x800e67 3a01c: 51 83 std Z+1, r21 ; 0x01 3a01e: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a020: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a024: 9f 5f subi r25, 0xFF ; 255 3a026: 90 93 f1 03 sts 0x03F1, r25 ; 0x8003f1 3a02a: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a02c: 41 e0 ldi r20, 0x01 ; 1 3a02e: 70 e0 ldi r23, 0x00 ; 0 3a030: 60 e0 ldi r22, 0x00 ; 0 3a032: cd 01 movw r24, r26 3a034: 0d 94 b8 ce jmp 0x39d70 ; 0x39d70 } } 3a038: 08 95 ret 0003a03a : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a03a: 8f 92 push r8 3a03c: 9f 92 push r9 3a03e: af 92 push r10 3a040: bf 92 push r11 3a042: cf 92 push r12 3a044: df 92 push r13 3a046: ef 92 push r14 3a048: ff 92 push r15 3a04a: 0f 93 push r16 3a04c: 1f 93 push r17 3a04e: cf 93 push r28 3a050: df 93 push r29 if (menu_item == menu_line) 3a052: e0 91 15 05 lds r30, 0x0515 ; 0x800515 3a056: 30 91 14 05 lds r19, 0x0514 ; 0x800514 3a05a: e3 13 cpse r30, r19 3a05c: 73 c0 rjmp .+230 ; 0x3a144 3a05e: c2 2f mov r28, r18 3a060: 6a 01 movw r12, r20 3a062: 7b 01 movw r14, r22 3a064: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a066: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a06a: 88 23 and r24, r24 3a06c: a1 f1 breq .+104 ; 0x3a0d6 3a06e: 0f 94 50 cd call 0x39aa0 ; 0x39aa0 3a072: 01 e0 ldi r16, 0x01 ; 1 3a074: 8e 33 cpi r24, 0x3E ; 62 3a076: 09 f0 breq .+2 ; 0x3a07a 3a078: 00 e0 ldi r16, 0x00 ; 0 3a07a: 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; 3a07c: 80 2f mov r24, r16 3a07e: 82 70 andi r24, 0x02 ; 2 3a080: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a082: e1 14 cp r14, r1 3a084: f1 04 cpc r15, r1 3a086: 09 f4 brne .+2 ; 0x3a08a 3a088: 6f c0 rjmp .+222 ; 0x3a168 3a08a: e7 01 movw r28, r14 3a08c: 90 e2 ldi r25, 0x20 ; 32 3a08e: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a090: 88 20 and r8, r8 3a092: 09 f4 brne .+2 ; 0x3a096 3a094: 41 c0 rjmp .+130 ; 0x3a118 3a096: ce 01 movw r24, r28 3a098: 0f 94 cd da call 0x3b59a ; 0x3b59a <__strlen_P> 3a09c: 14 e0 ldi r17, 0x04 ; 4 3a09e: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a0a0: 4e e3 ldi r20, 0x3E ; 62 3a0a2: 00 ff sbrs r16, 0 3a0a4: 40 e2 ldi r20, 0x20 ; 32 3a0a6: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a0aa: 80 e0 ldi r24, 0x00 ; 0 3a0ac: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_print_pad_P(str, LCD_WIDTH - len); 3a0b0: 64 e1 ldi r22, 0x14 ; 20 3a0b2: 61 1b sub r22, r17 3a0b4: c5 01 movw r24, r10 3a0b6: 0e 94 fb 71 call 0xe3f6 ; 0xe3f6 lcd_putc('['); 3a0ba: 8b e5 ldi r24, 0x5B ; 91 3a0bc: 0e 94 15 70 call 0xe02a ; 0xe02a if (is_progmem) { lcd_puts_P(toggle); 3a0c0: 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) 3a0c2: 88 20 and r8, r8 3a0c4: 89 f1 breq .+98 ; 0x3a128 { lcd_puts_P(toggle); 3a0c6: 0e 94 11 70 call 0xe022 ; 0xe022 } else { lcd_print(toggle); } lcd_putc(']'); 3a0ca: 8d e5 ldi r24, 0x5D ; 93 3a0cc: 0e 94 15 70 call 0xe02a ; 0xe02a lcd_putc(eol); 3a0d0: 89 2d mov r24, r9 3a0d2: 0e 94 15 70 call 0xe02a ; 0xe02a 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)) 3a0d6: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a0da: 88 23 and r24, r24 3a0dc: 99 f1 breq .+102 ; 0x3a144 3a0de: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a0e2: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a0e6: 90 91 35 05 lds r25, 0x0535 ; 0x800535 3a0ea: 28 17 cp r18, r24 3a0ec: 19 06 cpc r1, r25 3a0ee: 51 f5 brne .+84 ; 0x3a144 { if (toggle == NULL) // print N/A warning message 3a0f0: ef 28 or r14, r15 3a0f2: e9 f4 brne .+58 ; 0x3a12e { menu_submenu(func); 3a0f4: 60 e0 ldi r22, 0x00 ; 0 3a0f6: c6 01 movw r24, r12 3a0f8: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 menu_item_ret(); return; } } menu_item++; } 3a0fc: df 91 pop r29 3a0fe: cf 91 pop r28 3a100: 1f 91 pop r17 3a102: 0f 91 pop r16 3a104: ff 90 pop r15 3a106: ef 90 pop r14 3a108: df 90 pop r13 3a10a: cf 90 pop r12 3a10c: bf 90 pop r11 3a10e: af 90 pop r10 3a110: 9f 90 pop r9 3a112: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a114: 0d 94 74 cd jmp 0x39ae8 ; 0x39ae8 //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)); 3a118: fe 01 movw r30, r28 3a11a: 01 90 ld r0, Z+ 3a11c: 00 20 and r0, r0 3a11e: e9 f7 brne .-6 ; 0x3a11a 3a120: ec 1b sub r30, r28 3a122: 13 e0 ldi r17, 0x03 ; 3 3a124: 1e 0f add r17, r30 3a126: bc cf rjmp .-136 ; 0x3a0a0 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a128: 0e 94 2d 72 call 0xe45a ; 0xe45a 3a12c: ce cf rjmp .-100 ; 0x3a0ca { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a12e: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a132: c1 14 cp r12, r1 3a134: d1 04 cpc r13, r1 3a136: 11 f0 breq .+4 ; 0x3a13c 3a138: f6 01 movw r30, r12 3a13a: 19 95 eicall lcd_update_enabled = 1; 3a13c: 81 e0 ldi r24, 0x01 ; 1 3a13e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a142: dc cf rjmp .-72 ; 0x3a0fc } menu_item_ret(); return; } } menu_item++; 3a144: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a148: 8f 5f subi r24, 0xFF ; 255 3a14a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a14e: df 91 pop r29 3a150: cf 91 pop r28 3a152: 1f 91 pop r17 3a154: 0f 91 pop r16 3a156: ff 90 pop r15 3a158: ef 90 pop r14 3a15a: df 90 pop r13 3a15c: cf 90 pop r12 3a15e: bf 90 pop r11 3a160: af 90 pop r10 3a162: 9f 90 pop r9 3a164: 8f 90 pop r8 3a166: 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); 3a168: 8c e4 ldi r24, 0x4C ; 76 3a16a: 9d e3 ldi r25, 0x3D ; 61 3a16c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 3a170: 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] : ' '; 3a172: 8e e7 ldi r24, 0x7E ; 126 3a174: 98 2e mov r9, r24 3a176: 8c cf rjmp .-232 ; 0x3a090 0003a178 : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a178: 0f 93 push r16 3a17a: 1f 93 push r17 3a17c: cf 93 push r28 3a17e: df 93 push r29 3a180: cd b7 in r28, 0x3d ; 61 3a182: de b7 in r29, 0x3e ; 62 3a184: 63 97 sbiw r28, 0x13 ; 19 3a186: 0f b6 in r0, 0x3f ; 63 3a188: f8 94 cli 3a18a: de bf out 0x3e, r29 ; 62 3a18c: 0f be out 0x3f, r0 ; 63 3a18e: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a190: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a194: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a198: 32 13 cpse r19, r18 3a19a: 38 c0 rjmp .+112 ; 0x3a20c 3a19c: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a19e: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a1a2: 22 23 and r18, r18 3a1a4: a9 f0 breq .+42 ; 0x3a1d0 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a1a6: be 01 movw r22, r28 3a1a8: 6f 5f subi r22, 0xFF ; 255 3a1aa: 7f 4f sbci r23, 0xFF ; 255 3a1ac: 0f 94 28 cd call 0x39a50 ; 0x39a50 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a1b0: 0f 94 50 cd call 0x39aa0 ; 0x39aa0 3a1b4: 48 2f mov r20, r24 3a1b6: 60 91 12 05 lds r22, 0x0512 ; 0x800512 3a1ba: 80 e0 ldi r24, 0x00 ; 0 3a1bc: 0e 94 46 70 call 0xe08c ; 0xe08c lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a1c0: 62 e1 ldi r22, 0x12 ; 18 3a1c2: ce 01 movw r24, r28 3a1c4: 01 96 adiw r24, 0x01 ; 1 3a1c6: 0e 94 15 72 call 0xe42a ; 0xe42a lcd_putc(type_char); 3a1ca: 8e e7 ldi r24, 0x7E ; 126 3a1cc: 0e 94 15 70 call 0xe02a ; 0xe02a 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)) 3a1d0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a1d4: 88 23 and r24, r24 3a1d6: d1 f0 breq .+52 ; 0x3a20c 3a1d8: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a1dc: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a1e0: 90 91 35 05 lds r25, 0x0535 ; 0x800535 3a1e4: 28 17 cp r18, r24 3a1e6: 19 06 cpc r1, r25 3a1e8: 89 f4 brne .+34 ; 0x3a20c 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); 3a1ea: 60 e0 ldi r22, 0x00 ; 0 3a1ec: c8 01 movw r24, r16 3a1ee: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 menu_item_ret(); 3a1f2: 0f 94 74 cd call 0x39ae8 ; 0x39ae8 menu_item_ret(); return; } } menu_item++; } 3a1f6: 63 96 adiw r28, 0x13 ; 19 3a1f8: 0f b6 in r0, 0x3f ; 63 3a1fa: f8 94 cli 3a1fc: de bf out 0x3e, r29 ; 62 3a1fe: 0f be out 0x3f, r0 ; 63 3a200: cd bf out 0x3d, r28 ; 61 3a202: df 91 pop r29 3a204: cf 91 pop r28 3a206: 1f 91 pop r17 3a208: 0f 91 pop r16 3a20a: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a20c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a210: 8f 5f subi r24, 0xFF ; 255 3a212: 80 93 15 05 sts 0x0515, r24 ; 0x800515 3a216: ef cf rjmp .-34 ; 0x3a1f6 0003a218 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a218: cf 93 push r28 3a21a: df 93 push r29 if (menu_item == menu_line) 3a21c: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a220: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a224: 32 13 cpse r19, r18 3a226: 1e c0 rjmp .+60 ; 0x3a264 3a228: eb 01 movw r28, r22 3a22a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a22c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a230: 88 23 and r24, r24 3a232: 19 f0 breq .+6 ; 0x3a23a 3a234: 8e e7 ldi r24, 0x7E ; 126 3a236: 0f 94 5d cd call 0x39aba ; 0x39aba if (menu_clicked && (lcd_encoder == menu_item)) 3a23a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a23e: 88 23 and r24, r24 3a240: 89 f0 breq .+34 ; 0x3a264 3a242: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a246: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a24a: 90 91 35 05 lds r25, 0x0535 ; 0x800535 3a24e: 28 17 cp r18, r24 3a250: 19 06 cpc r1, r25 3a252: 41 f4 brne .+16 ; 0x3a264 { menu_submenu(submenu); 3a254: 60 e0 ldi r22, 0x00 ; 0 3a256: ce 01 movw r24, r28 3a258: 0f 94 fb cf call 0x39ff6 ; 0x39ff6 menu_item_ret(); return; } } menu_item++; } 3a25c: df 91 pop r29 3a25e: 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(); 3a260: 0d 94 74 cd jmp 0x39ae8 ; 0x39ae8 return; } } menu_item++; 3a264: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a268: 8f 5f subi r24, 0xFF ; 255 3a26a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a26e: df 91 pop r29 3a270: cf 91 pop r28 3a272: 08 95 ret 0003a274 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a274: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a276: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 3a27a: 98 17 cp r25, r24 3a27c: a8 f4 brcc .+42 ; 0x3a2a8 3a27e: 89 1b sub r24, r25 3a280: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a284: 90 e0 ldi r25, 0x00 ; 0 3a286: fc 01 movw r30, r24 3a288: ee 0f add r30, r30 3a28a: ff 1f adc r31, r31 3a28c: e8 0f add r30, r24 3a28e: f9 1f adc r31, r25 3a290: e3 56 subi r30, 0x63 ; 99 3a292: f8 4e sbci r31, 0xE8 ; 232 3a294: 62 81 ldd r22, Z+2 ; 0x02 3a296: 06 2e mov r0, r22 3a298: 00 0c add r0, r0 3a29a: 77 0b sbc r23, r23 3a29c: 20 e0 ldi r18, 0x00 ; 0 3a29e: 41 e0 ldi r20, 0x01 ; 1 3a2a0: 80 81 ld r24, Z 3a2a2: 91 81 ldd r25, Z+1 ; 0x01 3a2a4: 0d 94 b8 ce jmp 0x39d70 ; 0x39d70 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a2a8: 80 e0 ldi r24, 0x00 ; 0 3a2aa: ea cf rjmp .-44 ; 0x3a280 0003a2ac : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a2ac: 81 e0 ldi r24, 0x01 ; 1 3a2ae: 0d 94 3a d1 jmp 0x3a274 ; 0x3a274 0003a2b2 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a2b2: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a2b6: 20 91 14 05 lds r18, 0x0514 ; 0x800514 3a2ba: 32 13 cpse r19, r18 3a2bc: 19 c0 rjmp .+50 ; 0x3a2f0 3a2be: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a2c0: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a2c4: 88 23 and r24, r24 3a2c6: 19 f0 breq .+6 ; 0x3a2ce 3a2c8: 83 e8 ldi r24, 0x83 ; 131 3a2ca: 0f 94 5d cd call 0x39aba ; 0x39aba if (menu_clicked && (lcd_encoder == menu_item)) 3a2ce: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a2d2: 88 23 and r24, r24 3a2d4: 69 f0 breq .+26 ; 0x3a2f0 3a2d6: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a2da: 80 91 34 05 lds r24, 0x0534 ; 0x800534 3a2de: 90 91 35 05 lds r25, 0x0535 ; 0x800535 3a2e2: 28 17 cp r18, r24 3a2e4: 19 06 cpc r1, r25 3a2e6: 21 f4 brne .+8 ; 0x3a2f0 { menu_back(); 3a2e8: 0f 94 56 d1 call 0x3a2ac ; 0x3a2ac menu_item_ret(); 3a2ec: 0d 94 74 cd jmp 0x39ae8 ; 0x39ae8 return; } } menu_item++; 3a2f0: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a2f4: 8f 5f subi r24, 0xFF ; 255 3a2f6: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } 3a2fa: 08 95 ret 0003a2fc : }; 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() { 3a2fc: ef 92 push r14 3a2fe: ff 92 push r15 3a300: 0f 93 push r16 3a302: 1f 93 push r17 3a304: cf 93 push r28 3a306: df 93 push r29 3a308: 10 92 d4 03 sts 0x03D4, r1 ; 0x8003d4 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) 3a30c: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 3a310: 81 11 cpse r24, r1 3a312: 23 c0 rjmp .+70 ; 0x3a35a { _md->status = 1; // Menu entered for the first time 3a314: 81 e0 ldi r24, 0x01 ; 1 3a316: 80 93 b2 03 sts 0x03B2, r24 ; 0x8003b2 // Fetch the TuneItem from PROGMEM const uint8_t offset = (mmu2.MMUCurrentErrorCode() == ErrorCode::HOMING_IDLER_FAILED) ? 1 : 0; 3a31a: 81 e0 ldi r24, 0x01 ; 1 3a31c: 90 e0 ldi r25, 0x00 ; 0 3a31e: 20 91 66 13 lds r18, 0x1366 ; 0x801366 3a322: 30 91 67 13 lds r19, 0x1367 ; 0x801367 3a326: 27 30 cpi r18, 0x07 ; 7 3a328: 31 48 sbci r19, 0x81 ; 129 3a32a: 11 f0 breq .+4 ; 0x3a330 3a32c: 90 e0 ldi r25, 0x00 ; 0 3a32e: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a330: bc 01 movw r22, r24 3a332: 66 0f add r22, r22 3a334: 77 1f adc r23, r23 3a336: 68 0f add r22, r24 3a338: 79 1f adc r23, r25 3a33a: 6f 59 subi r22, 0x9F ; 159 3a33c: 74 45 sbci r23, 0x54 ; 84 3a33e: 43 e0 ldi r20, 0x03 ; 3 3a340: 50 e0 ldi r21, 0x00 ; 0 3a342: 84 eb ldi r24, 0xB4 ; 180 3a344: 93 e0 ldi r25, 0x03 ; 3 3a346: 0f 94 a9 da call 0x3b552 ; 0x3b552 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a34a: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 3a34e: 0f 94 a2 1c call 0x23944 ; 0x23944 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a352: 80 91 91 13 lds r24, 0x1391 ; 0x801391 3a356: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 } MENU_BEGIN(); 3a35a: 0f 94 8e ce call 0x39d1c ; 0x39d1c 3a35e: 10 92 12 05 sts 0x0512, r1 ; 0x800512 3a362: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a366: 84 30 cpi r24, 0x04 ; 4 3a368: e0 f5 brcc .+120 ; 0x3a3e2 3a36a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 ON_MENU_LEAVE( 3a36e: 0f 94 0e cd call 0x39a1c ; 0x39a1c 3a372: 88 23 and r24, r24 3a374: 89 f0 breq .+34 ; 0x3a398 3a376: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 3a37a: 70 e0 ldi r23, 0x00 ; 0 3a37c: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 3a380: 0e 94 f6 dd call 0x1bbec ; 0x1bbec 3a384: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.512> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a388: df 91 pop r29 3a38a: cf 91 pop r28 3a38c: 1f 91 pop r17 3a38e: 0f 91 pop r16 3a390: ff 90 pop r15 3a392: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3a394: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3a398: 8d e1 ldi r24, 0x1D ; 29 3a39a: 96 e6 ldi r25, 0x66 ; 102 3a39c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 3a3a0: 0f 94 59 d1 call 0x3a2b2 ; 0x3a2b2 MENU_ITEM_EDIT_int3_P( 3a3a4: 00 91 b6 03 lds r16, 0x03B6 ; 0x8003b6 3a3a8: 10 e0 ldi r17, 0x00 ; 0 3a3aa: c0 91 b5 03 lds r28, 0x03B5 ; 0x8003b5 3a3ae: d0 e0 ldi r29, 0x00 ; 0 3a3b0: 8f e0 ldi r24, 0x0F ; 15 3a3b2: 96 e6 ldi r25, 0x66 ; 102 3a3b4: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 3a3b8: f1 2c mov r15, r1 3a3ba: e1 2c mov r14, r1 3a3bc: 9e 01 movw r18, r28 3a3be: 48 e0 ldi r20, 0x08 ; 8 3a3c0: 63 eb ldi r22, 0xB3 ; 179 3a3c2: 73 e0 ldi r23, 0x03 ; 3 3a3c4: 0f 94 de ce call 0x39dbc ; 0x39dbc _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3a3c8: 0f 94 62 ce call 0x39cc4 ; 0x39cc4 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3a3cc: 80 91 12 05 lds r24, 0x0512 ; 0x800512 3a3d0: 8f 5f subi r24, 0xFF ; 255 3a3d2: 80 93 12 05 sts 0x0512, r24 ; 0x800512 3a3d6: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a3da: 8f 5f subi r24, 0xFF ; 255 3a3dc: 80 93 14 05 sts 0x0514, r24 ; 0x800514 3a3e0: c0 cf rjmp .-128 ; 0x3a362 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a3e2: df 91 pop r29 3a3e4: cf 91 pop r28 3a3e6: 1f 91 pop r17 3a3e8: 0f 91 pop r16 3a3ea: ff 90 pop r15 3a3ec: ef 90 pop r14 3a3ee: 08 95 ret 0003a3f0 : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3a3f0: 0e 94 43 72 call 0xe486 ; 0xe486 3a3f4: 81 11 cpse r24, r1 menu_back(); 3a3f6: 0d 94 56 d1 jmp 0x3a2ac ; 0x3a2ac } 3a3fa: 08 95 ret 0003a3fc : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3a3fc: 8f 92 push r8 3a3fe: 9f 92 push r9 3a400: af 92 push r10 3a402: bf 92 push r11 3a404: ef 92 push r14 3a406: ff 92 push r15 3a408: 0f 93 push r16 3a40a: 1f 93 push r17 3a40c: cf 93 push r28 3a40e: df 93 push r29 3a410: cd b7 in r28, 0x3d ; 61 3a412: de b7 in r29, 0x3e ; 62 3a414: a0 97 sbiw r28, 0x20 ; 32 3a416: 0f b6 in r0, 0x3f ; 63 3a418: f8 94 cli 3a41a: de bf out 0x3e, r29 ; 62 3a41c: 0f be out 0x3f, r0 ; 63 3a41e: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3a420: 61 15 cp r22, r1 3a422: 71 05 cpc r23, r1 3a424: 81 05 cpc r24, r1 3a426: 91 05 cpc r25, r1 3a428: 99 f4 brne .+38 ; 0x3a450 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a42a: 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)); } 3a42c: a0 96 adiw r28, 0x20 ; 32 3a42e: 0f b6 in r0, 0x3f ; 63 3a430: f8 94 cli 3a432: de bf out 0x3e, r29 ; 62 3a434: 0f be out 0x3f, r0 ; 63 3a436: cd bf out 0x3d, r28 ; 61 3a438: df 91 pop r29 3a43a: cf 91 pop r28 3a43c: 1f 91 pop r17 3a43e: 0f 91 pop r16 3a440: ff 90 pop r15 3a442: ef 90 pop r14 3a444: bf 90 pop r11 3a446: af 90 pop r10 3a448: 9f 90 pop r9 3a44a: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a44c: 0c 94 53 79 jmp 0xf2a6 ; 0xf2a6 // 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; 3a450: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a452: 84 2e mov r8, r20 3a454: 91 2c mov r9, r1 3a456: b1 2c mov r11, r1 3a458: a1 2c mov r10, r1 3a45a: 9e 01 movw r18, r28 3a45c: 2f 5f subi r18, 0xFF ; 255 3a45e: 3f 4f sbci r19, 0xFF ; 255 3a460: 79 01 movw r14, r18 3a462: a5 01 movw r20, r10 3a464: 94 01 movw r18, r8 3a466: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 3a46a: f7 01 movw r30, r14 3a46c: e0 0f add r30, r16 3a46e: f1 1d adc r31, r1 3a470: 60 83 st Z, r22 n /= base; 3a472: b9 01 movw r22, r18 3a474: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a476: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3a478: 61 15 cp r22, r1 3a47a: 71 05 cpc r23, r1 3a47c: 81 05 cpc r24, r1 3a47e: 91 05 cpc r25, r1 3a480: 81 f7 brne .-32 ; 0x3a462 3a482: 0e 0d add r16, r14 3a484: 1f 2d mov r17, r15 3a486: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3a488: e0 16 cp r14, r16 3a48a: f1 06 cpc r15, r17 3a48c: 59 f0 breq .+22 ; 0x3a4a4 print((char) (buf[i - 1] < 10 ? 3a48e: f8 01 movw r30, r16 3a490: 82 91 ld r24, -Z 3a492: 8f 01 movw r16, r30 3a494: 8a 30 cpi r24, 0x0A ; 10 3a496: 20 f4 brcc .+8 ; 0x3a4a0 '0' + buf[i - 1] : 3a498: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a49a: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 3a49e: f4 cf rjmp .-24 ; 0x3a488 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3a4a0: 89 5c subi r24, 0xC9 ; 201 3a4a2: fb cf rjmp .-10 ; 0x3a49a } 3a4a4: a0 96 adiw r28, 0x20 ; 32 3a4a6: 0f b6 in r0, 0x3f ; 63 3a4a8: f8 94 cli 3a4aa: de bf out 0x3e, r29 ; 62 3a4ac: 0f be out 0x3f, r0 ; 63 3a4ae: cd bf out 0x3d, r28 ; 61 3a4b0: df 91 pop r29 3a4b2: cf 91 pop r28 3a4b4: 1f 91 pop r17 3a4b6: 0f 91 pop r16 3a4b8: ff 90 pop r15 3a4ba: ef 90 pop r14 3a4bc: bf 90 pop r11 3a4be: af 90 pop r10 3a4c0: 9f 90 pop r9 3a4c2: 8f 90 pop r8 3a4c4: 08 95 ret 0003a4c6 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3a4c6: cf 92 push r12 3a4c8: df 92 push r13 3a4ca: ef 92 push r14 3a4cc: ff 92 push r15 3a4ce: 6b 01 movw r12, r22 3a4d0: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3a4d2: f7 fe sbrs r15, 7 3a4d4: 0b c0 rjmp .+22 ; 0x3a4ec } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a4d6: 8d e2 ldi r24, 0x2D ; 45 3a4d8: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3a4dc: f0 94 com r15 3a4de: e0 94 com r14 3a4e0: d0 94 com r13 3a4e2: c0 94 com r12 3a4e4: c1 1c adc r12, r1 3a4e6: d1 1c adc r13, r1 3a4e8: e1 1c adc r14, r1 3a4ea: f1 1c adc r15, r1 } printNumber(n, 10); 3a4ec: 4a e0 ldi r20, 0x0A ; 10 3a4ee: c7 01 movw r24, r14 3a4f0: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3a4f2: ff 90 pop r15 3a4f4: ef 90 pop r14 3a4f6: df 90 pop r13 3a4f8: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3a4fa: 0d 94 fe d1 jmp 0x3a3fc ; 0x3a3fc 0003a4fe : void recover_print(uint8_t automatic) { 3a4fe: 4f 92 push r4 3a500: 5f 92 push r5 3a502: 6f 92 push r6 3a504: 7f 92 push r7 3a506: 8f 92 push r8 3a508: 9f 92 push r9 3a50a: af 92 push r10 3a50c: bf 92 push r11 3a50e: cf 92 push r12 3a510: df 92 push r13 3a512: ef 92 push r14 3a514: ff 92 push r15 3a516: 0f 93 push r16 3a518: 1f 93 push r17 3a51a: cf 93 push r28 3a51c: df 93 push r29 3a51e: 1f 92 push r1 3a520: 1f 92 push r1 3a522: cd b7 in r28, 0x3d ; 61 3a524: de b7 in r29, 0x3e ; 62 3a526: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 3a528: 84 e2 ldi r24, 0x24 ; 36 3a52a: 96 e6 ldi r25, 0x66 ; 102 3a52c: 0e 94 f2 73 call 0xe7e4 ; 0xe7e4 3a530: 0f 94 e0 0a call 0x215c0 ; 0x215c0 gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 3a534: 10 92 40 07 sts 0x0740, r1 ; 0x800740 3a538: 10 92 41 07 sts 0x0741, r1 ; 0x800741 3a53c: 10 92 42 07 sts 0x0742, r1 ; 0x800742 3a540: 10 92 43 07 sts 0x0743, r1 ; 0x800743 current_position[Y_AXIS] = 0; 3a544: 10 92 44 07 sts 0x0744, r1 ; 0x800744 3a548: 10 92 45 07 sts 0x0745, r1 ; 0x800745 3a54c: 10 92 46 07 sts 0x0746, r1 ; 0x800746 3a550: 10 92 47 07 sts 0x0747, r1 ; 0x800747 3a554: 9e ea ldi r25, 0xAE ; 174 3a556: e9 2e mov r14, r25 3a558: 9d e0 ldi r25, 0x0D ; 13 3a55a: 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; 3a55c: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 3a55e: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 3a560: 27 e0 ldi r18, 0x07 ; 7 3a562: b2 2e mov r11, r18 3a564: 8c 2d mov r24, r12 3a566: 6b 2d mov r22, r11 3a568: 0f 94 ca dd call 0x3bb94 ; 0x3bb94 <__divmodqi4> 3a56c: 08 2f mov r16, r24 3a56e: 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); 3a570: 42 e0 ldi r20, 0x02 ; 2 3a572: 50 e0 ldi r21, 0x00 ; 0 3a574: b7 01 movw r22, r14 3a576: ce 01 movw r24, r28 3a578: 01 96 adiw r24, 0x01 ; 1 3a57a: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe if (v != 0) 3a57e: 69 81 ldd r22, Y+1 ; 0x01 3a580: 7a 81 ldd r23, Y+2 ; 0x02 3a582: 61 15 cp r22, r1 3a584: 71 05 cpc r23, r1 3a586: 11 f0 breq .+4 ; 0x3a58c mbl_was_active = true; 3a588: dd 24 eor r13, r13 3a58a: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 3a58c: 2b 2d mov r18, r11 3a58e: 02 03 mulsu r16, r18 3a590: 80 01 movw r16, r0 3a592: 11 24 eor r1, r1 3a594: 09 0d add r16, r9 3a596: 11 1d adc r17, r1 3a598: 97 fc sbrc r9, 7 3a59a: 1a 95 dec r17 3a59c: 00 0f add r16, r16 3a59e: 11 1f adc r17, r17 3a5a0: 00 0f add r16, r16 3a5a2: 11 1f adc r17, r17 3a5a4: 03 56 subi r16, 0x63 ; 99 3a5a6: 1c 4e sbci r17, 0xEC ; 236 3a5a8: 07 2e mov r0, r23 3a5aa: 00 0c add r0, r0 3a5ac: 88 0b sbc r24, r24 3a5ae: 99 0b sbc r25, r25 3a5b0: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 3a5b4: 2f e6 ldi r18, 0x6F ; 111 3a5b6: 32 e1 ldi r19, 0x12 ; 18 3a5b8: 43 e8 ldi r20, 0x83 ; 131 3a5ba: 5a e3 ldi r21, 0x3A ; 58 3a5bc: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3a5c0: f8 01 movw r30, r16 3a5c2: 61 83 std Z+1, r22 ; 0x01 3a5c4: 72 83 std Z+2, r23 ; 0x02 3a5c6: 83 83 std Z+3, r24 ; 0x03 3a5c8: 94 83 std Z+4, r25 ; 0x04 3a5ca: f2 e0 ldi r31, 0x02 ; 2 3a5cc: ef 0e add r14, r31 3a5ce: f1 1c adc r15, r1 3a5d0: 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) { 3a5d2: 21 e3 ldi r18, 0x31 ; 49 3a5d4: c2 12 cpse r12, r18 3a5d6: c6 cf rjmp .-116 ; 0x3a564 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)); 3a5d8: 8a ed ldi r24, 0xDA ; 218 3a5da: 9e e0 ldi r25, 0x0E ; 14 3a5dc: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a5e0: 60 93 48 07 sts 0x0748, r22 ; 0x800748 3a5e4: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3a5e8: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 3a5ec: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b // Recover last E axis position current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3a5f0: 8e e6 ldi r24, 0x6E ; 110 3a5f2: 9f e0 ldi r25, 0x0F ; 15 3a5f4: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a5f8: 60 93 4c 07 sts 0x074C, r22 ; 0x80074c 3a5fc: 70 93 4d 07 sts 0x074D, r23 ; 0x80074d 3a600: 80 93 4e 07 sts 0x074E, r24 ; 0x80074e 3a604: 90 93 4f 07 sts 0x074F, r25 ; 0x80074f // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 3a608: 0f 94 93 cb call 0x39726 ; 0x39726 // 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(); 3a60c: 0f 94 7d c6 call 0x38cfa ; 0x38cfa // 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); 3a610: 80 e4 ldi r24, 0x40 ; 64 3a612: 97 e0 ldi r25, 0x07 ; 7 3a614: 0e 94 0f 6d call 0xda1e ; 0xda1e set_destination_to_current(); 3a618: 0e 94 80 69 call 0xd300 ; 0xd300 plan_set_position_curposXYZE(); 3a61c: 0f 94 d1 b8 call 0x371a2 ; 0x371a2 SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 3a620: 8a eb ldi r24, 0xBA ; 186 3a622: 9c ea ldi r25, 0xAC ; 172 3a624: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 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]); 3a628: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 3a62c: 8f 93 push r24 3a62e: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a632: 8f 93 push r24 3a634: 80 91 49 07 lds r24, 0x0749 ; 0x800749 3a638: 8f 93 push r24 3a63a: 80 91 48 07 lds r24, 0x0748 ; 0x800748 3a63e: 8f 93 push r24 3a640: 80 91 47 07 lds r24, 0x0747 ; 0x800747 3a644: 8f 93 push r24 3a646: 80 91 46 07 lds r24, 0x0746 ; 0x800746 3a64a: 8f 93 push r24 3a64c: 80 91 45 07 lds r24, 0x0745 ; 0x800745 3a650: 8f 93 push r24 3a652: 80 91 44 07 lds r24, 0x0744 ; 0x800744 3a656: 8f 93 push r24 3a658: 80 91 43 07 lds r24, 0x0743 ; 0x800743 3a65c: 8f 93 push r24 3a65e: 80 91 42 07 lds r24, 0x0742 ; 0x800742 3a662: 8f 93 push r24 3a664: 80 91 41 07 lds r24, 0x0741 ; 0x800741 3a668: 8f 93 push r24 3a66a: 80 91 40 07 lds r24, 0x0740 ; 0x800740 3a66e: 8f 93 push r24 3a670: 8b e5 ldi r24, 0x5B ; 91 3a672: 92 e7 ldi r25, 0x72 ; 114 3a674: 9f 93 push r25 3a676: 8f 93 push r24 3a678: 0f 94 d1 db call 0x3b7a2 ; 0x3b7a2 print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 3a67c: 81 e0 ldi r24, 0x01 ; 1 3a67e: 80 93 3f 07 sts 0x073F, r24 ; 0x80073f enable_z(); 3a682: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 3a684: 88 ed ldi r24, 0xD8 ; 216 3a686: 9e e0 ldi r25, 0x0E ; 14 3a688: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 3a68c: 90 93 6b 0e sts 0x0E6B, r25 ; 0x800e6b 3a690: 80 93 6a 0e sts 0x0E6A, r24 ; 0x800e6a target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 3a694: 8b e8 ldi r24, 0x8B ; 139 3a696: 9f e0 ldi r25, 0x0F ; 15 3a698: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 3a69c: 90 e0 ldi r25, 0x00 ; 0 3a69e: 90 93 69 0e sts 0x0E69, r25 ; 0x800e69 3a6a2: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 3a6a6: 88 ee ldi r24, 0xE8 ; 232 3a6a8: 9e e0 ldi r25, 0x0E ; 14 3a6aa: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a6ae: 60 93 bb 02 sts 0x02BB, r22 ; 0x8002bb 3a6b2: 70 93 bc 02 sts 0x02BC, r23 ; 0x8002bc 3a6b6: 80 93 bd 02 sts 0x02BD, r24 ; 0x8002bd 3a6ba: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 3a6be: 8e ed ldi r24, 0xDE ; 222 3a6c0: 9e e0 ldi r25, 0x0E ; 14 3a6c2: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 3a6c6: 90 93 95 02 sts 0x0295, r25 ; 0x800295 3a6ca: 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)); 3a6ce: 40 e1 ldi r20, 0x10 ; 16 3a6d0: 50 e0 ldi r21, 0x00 ; 0 3a6d2: 67 e3 ldi r22, 0x37 ; 55 3a6d4: 7d e0 ldi r23, 0x0D ; 13 3a6d6: 8b ea ldi r24, 0xAB ; 171 3a6d8: 92 e0 ldi r25, 0x02 ; 2 3a6da: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 3a6de: 8c e6 ldi r24, 0x6C ; 108 3a6e0: 9f e0 ldi r25, 0x0F ; 15 3a6e2: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 3a6e6: 90 93 09 18 sts 0x1809, r25 ; 0x801809 3a6ea: 80 93 08 18 sts 0x1808, r24 ; 0x801808 #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 3a6ee: 8c e2 ldi r24, 0x2C ; 44 3a6f0: 9d e0 ldi r25, 0x0D ; 13 3a6f2: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a6f6: 60 93 04 18 sts 0x1804, r22 ; 0x801804 3a6fa: 70 93 05 18 sts 0x1805, r23 ; 0x801805 3a6fe: 80 93 06 18 sts 0x1806, r24 ; 0x801806 3a702: 90 93 07 18 sts 0x1807, r25 ; 0x801807 #endif #ifdef PREVENT_DANGEROUS_EXTRUDE extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP); 3a706: 8d e7 ldi r24, 0x7D ; 125 3a708: 9c e0 ldi r25, 0x0C ; 12 3a70a: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 3a70e: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 3a712: 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)); 3a716: 40 e1 ldi r20, 0x10 ; 16 3a718: 50 e0 ldi r21, 0x00 ; 0 3a71a: 6d e6 ldi r22, 0x6D ; 109 3a71c: 7c e0 ldi r23, 0x0C ; 12 3a71e: 8f e8 ldi r24, 0x8F ; 143 3a720: 96 e0 ldi r25, 0x06 ; 6 3a722: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe 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)); 3a726: 40 e1 ldi r20, 0x10 ; 16 3a728: 50 e0 ldi r21, 0x00 ; 0 3a72a: 6d e5 ldi r22, 0x5D ; 93 3a72c: 7c e0 ldi r23, 0x0C ; 12 3a72e: 87 e1 ldi r24, 0x17 ; 23 3a730: 97 e0 ldi r25, 0x07 ; 7 3a732: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 3a736: 40 e1 ldi r20, 0x10 ; 16 3a738: 50 e0 ldi r21, 0x00 ; 0 3a73a: 6d e4 ldi r22, 0x4D ; 77 3a73c: 7c e0 ldi r23, 0x0C ; 12 3a73e: 8f e7 ldi r24, 0x7F ; 127 3a740: 96 e0 ldi r25, 0x06 ; 6 3a742: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 3a746: 40 e1 ldi r20, 0x10 ; 16 3a748: 50 e0 ldi r21, 0x00 ; 0 3a74a: 6d e3 ldi r22, 0x3D ; 61 3a74c: 7c e0 ldi r23, 0x0C ; 12 3a74e: 87 e0 ldi r24, 0x07 ; 7 3a750: 97 e0 ldi r25, 0x07 ; 7 3a752: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 3a756: 89 e3 ldi r24, 0x39 ; 57 3a758: 9c e0 ldi r25, 0x0C ; 12 3a75a: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a75e: 60 93 a7 06 sts 0x06A7, r22 ; 0x8006a7 3a762: 70 93 a8 06 sts 0x06A8, r23 ; 0x8006a8 3a766: 80 93 a9 06 sts 0x06A9, r24 ; 0x8006a9 3a76a: 90 93 aa 06 sts 0x06AA, r25 ; 0x8006aa cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 3a76e: 85 e3 ldi r24, 0x35 ; 53 3a770: 9c e0 ldi r25, 0x0C ; 12 3a772: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a776: 60 93 ab 06 sts 0x06AB, r22 ; 0x8006ab 3a77a: 70 93 ac 06 sts 0x06AC, r23 ; 0x8006ac 3a77e: 80 93 ad 06 sts 0x06AD, r24 ; 0x8006ad 3a782: 90 93 ae 06 sts 0x06AE, r25 ; 0x8006ae cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 3a786: 81 e3 ldi r24, 0x31 ; 49 3a788: 9c e0 ldi r25, 0x0C ; 12 3a78a: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a78e: 60 93 af 06 sts 0x06AF, r22 ; 0x8006af 3a792: 70 93 b0 06 sts 0x06B0, r23 ; 0x8006b0 3a796: 80 93 b1 06 sts 0x06B1, r24 ; 0x8006b1 3a79a: 90 93 b2 06 sts 0x06B2, r25 ; 0x8006b2 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 3a79e: 40 e1 ldi r20, 0x10 ; 16 3a7a0: 50 e0 ldi r21, 0x00 ; 0 3a7a2: 61 e2 ldi r22, 0x21 ; 33 3a7a4: 7c e0 ldi r23, 0x0C ; 12 3a7a6: 83 eb ldi r24, 0xB3 ; 179 3a7a8: 96 e0 ldi r25, 0x06 ; 6 3a7aa: 0f 94 ff dc call 0x3b9fe ; 0x3b9fe 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 ) { 3a7ae: 8f e7 ldi r24, 0x7F ; 127 3a7b0: 9c e0 ldi r25, 0x0C ; 12 3a7b2: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 3a7b6: 0f b6 in r0, 0x3f ; 63 3a7b8: f8 94 cli 3a7ba: de bf out 0x3e, r29 ; 62 3a7bc: 0f be out 0x3f, r0 ; 63 3a7be: cd bf out 0x3d, r28 ; 61 3a7c0: 81 30 cpi r24, 0x01 ; 1 3a7c2: b1 f4 brne .+44 ; 0x3a7f0 current_position[Z_AXIS] += Z_PAUSE_LIFT; 3a7c4: 20 e0 ldi r18, 0x00 ; 0 3a7c6: 30 e0 ldi r19, 0x00 ; 0 3a7c8: 40 ea ldi r20, 0xA0 ; 160 3a7ca: 51 e4 ldi r21, 0x41 ; 65 3a7cc: 60 91 48 07 lds r22, 0x0748 ; 0x800748 3a7d0: 70 91 49 07 lds r23, 0x0749 ; 0x800749 3a7d4: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a7d8: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 3a7dc: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3a7e0: 60 93 48 07 sts 0x0748, r22 ; 0x800748 3a7e4: 70 93 49 07 sts 0x0749, r23 ; 0x800749 3a7e8: 80 93 4a 07 sts 0x074A, r24 ; 0x80074a 3a7ec: 90 93 4b 07 sts 0x074B, r25 ; 0x80074b } // 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) { 3a7f0: 8f e7 ldi r24, 0x7F ; 127 3a7f2: 9c e0 ldi r25, 0x0C ; 12 3a7f4: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 3a7f8: 81 11 cpse r24, r1 3a7fa: 23 c0 rjmp .+70 ; 0x3a842 enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 3a7fc: 20 e0 ldi r18, 0x00 ; 0 3a7fe: 30 e0 ldi r19, 0x00 ; 0 3a800: 40 ea ldi r20, 0xA0 ; 160 3a802: 51 e4 ldi r21, 0x41 ; 65 3a804: 60 91 48 07 lds r22, 0x0748 ; 0x800748 3a808: 70 91 49 07 lds r23, 0x0749 ; 0x800749 3a80c: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a810: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 3a814: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3a818: 9f 93 push r25 3a81a: 8f 93 push r24 3a81c: 7f 93 push r23 3a81e: 6f 93 push r22 3a820: 8f eb ldi r24, 0xBF ; 191 3a822: 9d ea ldi r25, 0xAD ; 173 3a824: 9f 93 push r25 3a826: 8f 93 push r24 3a828: 0e 94 72 8a call 0x114e4 ; 0x114e4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 3a82c: 61 e0 ldi r22, 0x01 ; 1 3a82e: 8f e7 ldi r24, 0x7F ; 127 3a830: 9c e0 ldi r25, 0x0C ; 12 3a832: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 3a836: 0f 90 pop r0 3a838: 0f 90 pop r0 3a83a: 0f 90 pop r0 3a83c: 0f 90 pop r0 3a83e: 0f 90 pop r0 3a840: 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")); 3a842: 61 e0 ldi r22, 0x01 ; 1 3a844: 87 eb ldi r24, 0xB7 ; 183 3a846: 9d ea ldi r25, 0xAD ; 173 3a848: 0e 94 dc 89 call 0x113b8 ; 0x113b8 // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 3a84c: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3a850: 8f 93 push r24 3a852: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 3a856: 8f 93 push r24 3a858: 8e ea ldi r24, 0xAE ; 174 3a85a: 9d ea ldi r25, 0xAD ; 173 3a85c: 9f 93 push r25 3a85e: 8f 93 push r24 3a860: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 3a864: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 3a868: 8f 93 push r24 3a86a: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 3a86e: 8f 93 push r24 3a870: 85 ea ldi r24, 0xA5 ; 165 3a872: 9d ea ldi r25, 0xAD ; 173 3a874: 9f 93 push r25 3a876: 8f 93 push r24 3a878: 0e 94 72 8a call 0x114e4 ; 0x114e4 //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) { 3a87c: 8c e8 ldi r24, 0x8C ; 140 3a87e: 9f e0 ldi r25, 0x0F ; 15 3a880: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 3a884: 0f b6 in r0, 0x3f ; 63 3a886: f8 94 cli 3a888: de bf out 0x3e, r29 ; 62 3a88a: 0f be out 0x3f, r0 ; 63 3a88c: cd bf out 0x3d, r28 ; 61 3a88e: 81 11 cpse r24, r1 3a890: 10 c0 rjmp .+32 ; 0x3a8b2 enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 3a892: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3a896: 8f 93 push r24 3a898: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 3a89c: 8f 93 push r24 3a89e: 8c e9 ldi r24, 0x9C ; 156 3a8a0: 9d ea ldi r25, 0xAD ; 173 3a8a2: 9f 93 push r25 3a8a4: 8f 93 push r24 3a8a6: 0e 94 72 8a call 0x114e4 ; 0x114e4 3a8aa: 0f 90 pop r0 3a8ac: 0f 90 pop r0 3a8ae: 0f 90 pop r0 3a8b0: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 3a8b2: 61 e0 ldi r22, 0x01 ; 1 3a8b4: 8b ef ldi r24, 0xFB ; 251 3a8b6: 9c e6 ldi r25, 0x6C ; 108 3a8b8: 0e 94 dc 89 call 0x113b8 ; 0x113b8 // If not automatically recoreverd (long power loss) if(automatic == 0){ 3a8bc: a1 10 cpse r10, r1 3a8be: 17 c0 rjmp .+46 ; 0x3a8ee //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 3a8c0: 61 e0 ldi r22, 0x01 ; 1 3a8c2: 81 e9 ldi r24, 0x91 ; 145 3a8c4: 9d ea ldi r25, 0xAD ; 173 3a8c6: 0e 94 dc 89 call 0x113b8 ; 0x113b8 // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 3a8ca: 8f e3 ldi r24, 0x3F ; 63 3a8cc: 8f 93 push r24 3a8ce: 80 e8 ldi r24, 0x80 ; 128 3a8d0: 8f 93 push r24 3a8d2: 1f 92 push r1 3a8d4: 1f 92 push r1 3a8d6: 86 eb ldi r24, 0xB6 ; 182 3a8d8: 92 e7 ldi r25, 0x72 ; 114 3a8da: 9f 93 push r25 3a8dc: 8f 93 push r24 3a8de: 0e 94 72 8a call 0x114e4 ; 0x114e4 3a8e2: 0f 90 pop r0 3a8e4: 0f 90 pop r0 3a8e6: 0f 90 pop r0 3a8e8: 0f 90 pop r0 3a8ea: 0f 90 pop r0 3a8ec: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 3a8ee: 80 ea ldi r24, 0xA0 ; 160 3a8f0: 92 e7 ldi r25, 0x72 ; 114 3a8f2: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 gcode_M114(); 3a8f6: 0e 94 63 7a call 0xf4c6 ; 0xf4c6 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); 3a8fa: 88 e8 ldi r24, 0x88 ; 136 3a8fc: 9f e0 ldi r25, 0x0F ; 15 3a8fe: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 3a902: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 3a904: 89 e8 ldi r24, 0x89 ; 137 3a906: 9f e0 ldi r25, 0x0F ; 15 3a908: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 3a90c: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 3a90e: 85 e3 ldi r24, 0x35 ; 53 3a910: 9d e0 ldi r25, 0x0D ; 13 3a912: 0f 94 1d dd call 0x3ba3a ; 0x3ba3a 3a916: f8 2e mov r15, r24 3a918: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 3a91a: 87 e8 ldi r24, 0x87 ; 135 3a91c: 9d ea ldi r25, 0xAD ; 173 3a91e: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3a922: b8 01 movw r22, r16 3a924: 01 2e mov r0, r17 3a926: 00 0c add r0, r0 3a928: 88 0b sbc r24, r24 3a92a: 99 0b sbc r25, r25 3a92c: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 3a930: 87 e7 ldi r24, 0x77 ; 119 3a932: 9d ea ldi r25, 0xAD ; 173 3a934: 0e 94 6c 79 call 0xf2d8 ; 0xf2d8 MYSERIAL.println(feedmultiply_rec); 3a938: 8f 2d mov r24, r15 3a93a: 9e 2d mov r25, r14 3a93c: 0f 94 94 75 call 0x2eb28 ; 0x2eb28 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3a940: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 3a944: 81 11 cpse r24, r1 3a946: 02 c0 rjmp .+4 ; 0x3a94c { // M23 restore_file_from_sd(); 3a948: 0e 94 97 8a call 0x1152e ; 0x1152e } // 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)); 3a94c: 8d e9 ldi r24, 0x9D ; 157 3a94e: 9f e0 ldi r25, 0x0F ; 15 3a950: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a954: c6 2e mov r12, r22 3a956: b7 2e mov r11, r23 3a958: a8 2e mov r10, r24 3a95a: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 3a95c: 81 ea ldi r24, 0xA1 ; 161 3a95e: 9f e0 ldi r25, 0x0F ; 15 3a960: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a964: 76 2e mov r7, r22 3a966: 67 2e mov r6, r23 3a968: 58 2e mov r5, r24 3a96a: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 3a96c: 20 e0 ldi r18, 0x00 ; 0 3a96e: 30 e0 ldi r19, 0x00 ; 0 3a970: 40 e8 ldi r20, 0x80 ; 128 3a972: 5f eb ldi r21, 0xBF ; 191 3a974: 6c 2d mov r22, r12 3a976: 7b 2d mov r23, r11 3a978: 8a 2d mov r24, r10 3a97a: 99 2d mov r25, r9 3a97c: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 3a980: 88 23 and r24, r24 3a982: 99 f0 breq .+38 ; 0x3a9aa enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 3a984: 4f 92 push r4 3a986: 5f 92 push r5 3a988: 6f 92 push r6 3a98a: 7f 92 push r7 3a98c: 9f 92 push r9 3a98e: af 92 push r10 3a990: bf 92 push r11 3a992: cf 92 push r12 3a994: 80 e6 ldi r24, 0x60 ; 96 3a996: 9d ea ldi r25, 0xAD ; 173 3a998: 9f 93 push r25 3a99a: 8f 93 push r24 3a99c: 0e 94 72 8a call 0x114e4 ; 0x114e4 3a9a0: 0f b6 in r0, 0x3f ; 63 3a9a2: f8 94 cli 3a9a4: de bf out 0x3e, r29 ; 62 3a9a6: 0f be out 0x3f, r0 ; 63 3a9a8: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 3a9aa: dd 20 and r13, r13 3a9ac: 29 f0 breq .+10 ; 0x3a9b8 enquecommand_P(PSTR("PRUSA MBL V1")); 3a9ae: 61 e0 ldi r22, 0x01 ; 1 3a9b0: 83 e5 ldi r24, 0x53 ; 83 3a9b2: 9d ea ldi r25, 0xAD ; 173 3a9b4: 0e 94 dc 89 call 0x113b8 ; 0x113b8 // 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))); 3a9b8: 8d e8 ldi r24, 0x8D ; 141 3a9ba: 9f e0 ldi r25, 0x0F ; 15 3a9bc: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a9c0: 9f 93 push r25 3a9c2: 8f 93 push r24 3a9c4: 7f 93 push r23 3a9c6: 6f 93 push r22 3a9c8: 89 e4 ldi r24, 0x49 ; 73 3a9ca: 9d ea ldi r25, 0xAD ; 173 3a9cc: 9f 93 push r25 3a9ce: 8f 93 push r24 3a9d0: 0e 94 72 8a call 0x114e4 ; 0x114e4 // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 3a9d4: 81 e1 ldi r24, 0x11 ; 17 3a9d6: 9d e0 ldi r25, 0x0D ; 13 3a9d8: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a9dc: d6 2e mov r13, r22 3a9de: c7 2e mov r12, r23 3a9e0: b8 2e mov r11, r24 3a9e2: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 3a9e4: 8d e0 ldi r24, 0x0D ; 13 3a9e6: 9d e0 ldi r25, 0x0D ; 13 3a9e8: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e 3a9ec: 96 2e mov r9, r22 3a9ee: 77 2e mov r7, r23 3a9f0: 68 2e mov r6, r24 3a9f2: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 3a9f4: 89 e0 ldi r24, 0x09 ; 9 3a9f6: 9d e0 ldi r25, 0x0D ; 13 3a9f8: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e // 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); 3a9fc: 9f 93 push r25 3a9fe: 8f 93 push r24 3aa00: 7f 93 push r23 3aa02: 6f 93 push r22 3aa04: 5f 92 push r5 3aa06: 6f 92 push r6 3aa08: 7f 92 push r7 3aa0a: 9f 92 push r9 3aa0c: af 92 push r10 3aa0e: bf 92 push r11 3aa10: cf 92 push r12 3aa12: df 92 push r13 3aa14: 8f e2 ldi r24, 0x2F ; 47 3aa16: 9d ea ldi r25, 0xAD ; 173 3aa18: 9f 93 push r25 3aa1a: 8f 93 push r24 3aa1c: 0e 94 72 8a call 0x114e4 ; 0x114e4 // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 3aa20: 8f e3 ldi r24, 0x3F ; 63 3aa22: 8f 93 push r24 3aa24: 80 e8 ldi r24, 0x80 ; 128 3aa26: 8f 93 push r24 3aa28: 1f 92 push r1 3aa2a: 1f 92 push r1 3aa2c: 86 eb ldi r24, 0xB6 ; 182 3aa2e: 92 e7 ldi r25, 0x72 ; 114 3aa30: 9f 93 push r25 3aa32: 8f 93 push r24 3aa34: 0e 94 72 8a call 0x114e4 ; 0x114e4 // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3aa38: 8e e6 ldi r24, 0x6E ; 110 3aa3a: 9f e0 ldi r25, 0x0F ; 15 3aa3c: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 3aa40: 9f 93 push r25 3aa42: 8f 93 push r24 3aa44: 7f 93 push r23 3aa46: 6f 93 push r22 3aa48: 84 e2 ldi r24, 0x24 ; 36 3aa4a: 9d ea ldi r25, 0xAD ; 173 3aa4c: 9f 93 push r25 3aa4e: 8f 93 push r24 3aa50: 0e 94 72 8a call 0x114e4 ; 0x114e4 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 3aa54: 0f b6 in r0, 0x3f ; 63 3aa56: f8 94 cli 3aa58: de bf out 0x3e, r29 ; 62 3aa5a: 0f be out 0x3f, r0 ; 63 3aa5c: cd bf out 0x3d, r28 ; 61 3aa5e: 82 e7 ldi r24, 0x72 ; 114 3aa60: 9f e0 ldi r25, 0x0F ; 15 3aa62: 0f 94 0f dd call 0x3ba1e ; 0x3ba1e 3aa66: 88 23 and r24, r24 3aa68: 29 f0 breq .+10 ; 0x3aa74 enquecommand_P(PSTR("M82")); //E axis abslute mode 3aa6a: 61 e0 ldi r22, 0x01 ; 1 3aa6c: 80 e2 ldi r24, 0x20 ; 32 3aa6e: 9d ea ldi r25, 0xAD ; 173 3aa70: 0e 94 dc 89 call 0x113b8 ; 0x113b8 // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 3aa74: 1f 93 push r17 3aa76: 0f 93 push r16 3aa78: 89 e1 ldi r24, 0x19 ; 25 3aa7a: 9d ea ldi r25, 0xAD ; 173 3aa7c: 9f 93 push r25 3aa7e: 8f 93 push r24 3aa80: 0e 94 72 8a call 0x114e4 ; 0x114e4 enquecommandf_P(MSG_M220, feedmultiply_rec); 3aa84: ef 92 push r14 3aa86: ff 92 push r15 3aa88: 82 e8 ldi r24, 0x82 ; 130 3aa8a: 92 e7 ldi r25, 0x72 ; 114 3aa8c: 9f 93 push r25 3aa8e: 8f 93 push r24 3aa90: 0e 94 72 8a call 0x114e4 ; 0x114e4 // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 3aa94: 1f 92 push r1 3aa96: 8f 92 push r8 3aa98: 80 e1 ldi r24, 0x10 ; 16 3aa9a: 9d ea ldi r25, 0xAD ; 173 3aa9c: 9f 93 push r25 3aa9e: 8f 93 push r24 3aaa0: 0e 94 72 8a call 0x114e4 ; 0x114e4 // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 3aaa4: 81 e9 ldi r24, 0x91 ; 145 3aaa6: 9f e0 ldi r25, 0x0F ; 15 3aaa8: 0f 94 17 dd call 0x3ba2e ; 0x3ba2e if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3aaac: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 3aab0: 0f b6 in r0, 0x3f ; 63 3aab2: f8 94 cli 3aab4: de bf out 0x3e, r29 ; 62 3aab6: 0f be out 0x3f, r0 ; 63 3aab8: cd bf out 0x3d, r28 ; 61 3aaba: 21 11 cpse r18, r1 3aabc: 33 c0 rjmp .+102 ; 0x3ab24 { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 3aabe: 9f 93 push r25 3aac0: 8f 93 push r24 3aac2: 7f 93 push r23 3aac4: 6f 93 push r22 3aac6: 87 e0 ldi r24, 0x07 ; 7 3aac8: 9d ea ldi r25, 0xAD ; 173 } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3aaca: 9f 93 push r25 3aacc: 8f 93 push r24 3aace: 0e 94 72 8a call 0x114e4 ; 0x114e4 3aad2: 0f 90 pop r0 3aad4: 0f 90 pop r0 3aad6: 0f 90 pop r0 3aad8: 0f 90 pop r0 3aada: 0f 90 pop r0 3aadc: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 3aade: 61 e0 ldi r22, 0x01 ; 1 3aae0: 87 ef ldi r24, 0xF7 ; 247 3aae2: 9c ea ldi r25, 0xAC ; 172 3aae4: 0e 94 dc 89 call 0x113b8 ; 0x113b8 enquecommand_P(PSTR("PRUSA uvlo")); 3aae8: 61 e0 ldi r22, 0x01 ; 1 3aaea: 8c ee ldi r24, 0xEC ; 236 3aaec: 9c ea ldi r25, 0xAC ; 172 3aaee: 0e 94 dc 89 call 0x113b8 ; 0x113b8 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")); 3aaf2: 8b e8 ldi r24, 0x8B ; 139 3aaf4: 92 e7 ldi r25, 0x72 ; 114 3aaf6: 0f 94 f8 db call 0x3b7f0 ; 0x3b7f0 gcode_M114(); 3aafa: 0e 94 63 7a call 0xf4c6 ; 0xf4c6 } 3aafe: 0f 90 pop r0 3ab00: 0f 90 pop r0 3ab02: df 91 pop r29 3ab04: cf 91 pop r28 3ab06: 1f 91 pop r17 3ab08: 0f 91 pop r16 3ab0a: ff 90 pop r15 3ab0c: ef 90 pop r14 3ab0e: df 90 pop r13 3ab10: cf 90 pop r12 3ab12: bf 90 pop r11 3ab14: af 90 pop r10 3ab16: 9f 90 pop r9 3ab18: 8f 90 pop r8 3ab1a: 7f 90 pop r7 3ab1c: 6f 90 pop r6 3ab1e: 5f 90 pop r5 3ab20: 4f 90 pop r4 3ab22: 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) 3ab24: 21 30 cpi r18, 0x01 ; 1 3ab26: d9 f6 brne .-74 ; 0x3aade { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3ab28: 9f 93 push r25 3ab2a: 8f 93 push r24 3ab2c: 7f 93 push r23 3ab2e: 6f 93 push r22 3ab30: 8d ef ldi r24, 0xFD ; 253 3ab32: 9c ea ldi r25, 0xAC ; 172 3ab34: ca cf rjmp .-108 ; 0x3aaca 0003ab36 : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3ab36: 8f 92 push r8 3ab38: 9f 92 push r9 3ab3a: af 92 push r10 3ab3c: bf 92 push r11 3ab3e: cf 92 push r12 3ab40: df 92 push r13 3ab42: ef 92 push r14 3ab44: ff 92 push r15 3ab46: cf 93 push r28 3ab48: 6b 01 movw r12, r22 3ab4a: 7c 01 movw r14, r24 3ab4c: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3ab4e: 20 e0 ldi r18, 0x00 ; 0 3ab50: 30 e0 ldi r19, 0x00 ; 0 3ab52: a9 01 movw r20, r18 3ab54: 0f 94 2c df call 0x3be58 ; 0x3be58 <__cmpsf2> 3ab58: 87 ff sbrs r24, 7 3ab5a: 07 c0 rjmp .+14 ; 0x3ab6a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ab5c: 8d e2 ldi r24, 0x2D ; 45 3ab5e: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3ab62: f7 fa bst r15, 7 3ab64: f0 94 com r15 3ab66: f7 f8 bld r15, 7 3ab68: 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; 3ab78: 20 e0 ldi r18, 0x00 ; 0 3ab7a: 30 e0 ldi r19, 0x00 ; 0 3ab7c: 40 e2 ldi r20, 0x20 ; 32 3ab7e: 51 e4 ldi r21, 0x41 ; 65 3ab80: 0f 94 36 df call 0x3be6c ; 0x3be6c <__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; 3ab88: 9b 01 movw r18, r22 3ab8a: ac 01 movw r20, r24 3ab8c: c7 01 movw r24, r14 3ab8e: b6 01 movw r22, r12 3ab90: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3ab94: 6b 01 movw r12, r22 3ab96: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3ab98: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3ab9c: 4b 01 movw r8, r22 3ab9e: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3aba0: 4a e0 ldi r20, 0x0A ; 10 3aba2: 0f 94 fe d1 call 0x3a3fc ; 0x3a3fc 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) 3aba6: cc 23 and r28, r28 3aba8: 91 f1 breq .+100 ; 0x3ac0e 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; 3abaa: c5 01 movw r24, r10 3abac: b4 01 movw r22, r8 3abae: 0f 94 9b d7 call 0x3af36 ; 0x3af36 <__floatunsisf> 3abb2: 9b 01 movw r18, r22 3abb4: ac 01 movw r20, r24 3abb6: c7 01 movw r24, r14 3abb8: b6 01 movw r22, r12 3abba: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 3abbe: 6b 01 movw r12, r22 3abc0: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3abc2: 8e e2 ldi r24, 0x2E ; 46 3abc4: 0e 94 53 79 call 0xf2a6 ; 0xf2a6 // 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) 3abc8: c1 50 subi r28, 0x01 ; 1 3abca: 08 f1 brcs .+66 ; 0x3ac0e { remainder *= 10.0; 3abcc: 20 e0 ldi r18, 0x00 ; 0 3abce: 30 e0 ldi r19, 0x00 ; 0 3abd0: 40 e2 ldi r20, 0x20 ; 32 3abd2: 51 e4 ldi r21, 0x41 ; 65 3abd4: c7 01 movw r24, r14 3abd6: b6 01 movw r22, r12 3abd8: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3abdc: 4b 01 movw r8, r22 3abde: 5c 01 movw r10, r24 int toPrint = int(remainder); 3abe0: 0f 94 a8 df call 0x3bf50 ; 0x3bf50 <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3abe4: 6b 01 movw r12, r22 3abe6: 77 0f add r23, r23 3abe8: ee 08 sbc r14, r14 3abea: ff 08 sbc r15, r15 3abec: c7 01 movw r24, r14 3abee: b6 01 movw r22, r12 3abf0: 0f 94 63 d2 call 0x3a4c6 ; 0x3a4c6 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3abf4: c7 01 movw r24, r14 3abf6: b6 01 movw r22, r12 3abf8: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 3abfc: 9b 01 movw r18, r22 3abfe: ac 01 movw r20, r24 3ac00: c5 01 movw r24, r10 3ac02: b4 01 movw r22, r8 3ac04: 0f 94 36 de call 0x3bc6c ; 0x3bc6c <__subsf3> 3ac08: 6b 01 movw r12, r22 3ac0a: 7c 01 movw r14, r24 3ac0c: dd cf rjmp .-70 ; 0x3abc8 } } 3ac0e: cf 91 pop r28 3ac10: ff 90 pop r15 3ac12: ef 90 pop r14 3ac14: df 90 pop r13 3ac16: cf 90 pop r12 3ac18: bf 90 pop r11 3ac1a: af 90 pop r10 3ac1c: 9f 90 pop r9 3ac1e: 8f 90 pop r8 3ac20: 08 95 ret 0003ac22 : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac22: 8a e0 ldi r24, 0x0A ; 10 3ac24: 0c 94 53 79 jmp 0xf2a6 ; 0xf2a6 0003ac28 : 3ac28: 0e 94 d0 89 call 0x113a0 ; 0x113a0 }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3ac2c: 0d 94 11 d6 jmp 0x3ac22 ; 0x3ac22 0003ac30 : } 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) { 3ac30: 20 91 92 04 lds r18, 0x0492 ; 0x800492 3ac34: 30 91 93 04 lds r19, 0x0493 ; 0x800493 3ac38: 80 91 90 04 lds r24, 0x0490 ; 0x800490 3ac3c: 90 91 91 04 lds r25, 0x0491 ; 0x800491 3ac40: 82 17 cp r24, r18 3ac42: 93 07 cpc r25, r19 3ac44: 71 f0 breq .+28 ; 0x3ac62 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3ac46: f9 01 movw r30, r18 3ac48: e0 5f subi r30, 0xF0 ; 240 3ac4a: fb 4f sbci r31, 0xFB ; 251 3ac4c: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3ac4e: 2f 5f subi r18, 0xFF ; 255 3ac50: 3f 4f sbci r19, 0xFF ; 255 3ac52: 2f 77 andi r18, 0x7F ; 127 3ac54: 33 27 eor r19, r19 3ac56: 30 93 93 04 sts 0x0493, r19 ; 0x800493 3ac5a: 20 93 92 04 sts 0x0492, r18 ; 0x800492 return c; 3ac5e: 90 e0 ldi r25, 0x00 ; 0 3ac60: 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; 3ac62: 8f ef ldi r24, 0xFF ; 255 3ac64: 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; } } 3ac66: 08 95 ret 0003ac68 <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3ac68: 1f 92 push r1 3ac6a: 0f 92 push r0 3ac6c: 0f b6 in r0, 0x3f ; 63 3ac6e: 0f 92 push r0 3ac70: 11 24 eor r1, r1 3ac72: 0b b6 in r0, 0x3b ; 59 3ac74: 0f 92 push r0 3ac76: 2f 93 push r18 3ac78: 3f 93 push r19 3ac7a: 4f 93 push r20 3ac7c: 6f 93 push r22 3ac7e: 7f 93 push r23 3ac80: 8f 93 push r24 3ac82: 9f 93 push r25 3ac84: ef 93 push r30 3ac86: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3ac8c: 84 ff sbrs r24, 4 3ac8e: 12 c0 rjmp .+36 ; 0x3acb4 <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3ac90: 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 } } 3ac94: ff 91 pop r31 3ac96: ef 91 pop r30 3ac98: 9f 91 pop r25 3ac9a: 8f 91 pop r24 3ac9c: 7f 91 pop r23 3ac9e: 6f 91 pop r22 3aca0: 4f 91 pop r20 3aca2: 3f 91 pop r19 3aca4: 2f 91 pop r18 3aca6: 0f 90 pop r0 3aca8: 0b be out 0x3b, r0 ; 59 3acaa: 0f 90 pop r0 3acac: 0f be out 0x3f, r0 ; 63 3acae: 0f 90 pop r0 3acb0: 1f 90 pop r1 3acb2: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3acb4: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3acb8: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 3acbc: 81 30 cpi r24, 0x01 ; 1 3acbe: 51 f7 brne .-44 ; 0x3ac94 <__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; 3acc0: 20 91 90 04 lds r18, 0x0490 ; 0x800490 3acc4: 30 91 91 04 lds r19, 0x0491 ; 0x800491 3acc8: c9 01 movw r24, r18 3acca: 01 96 adiw r24, 0x01 ; 1 3accc: 8f 77 andi r24, 0x7F ; 127 3acce: 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) { 3acd0: 60 91 92 04 lds r22, 0x0492 ; 0x800492 3acd4: 70 91 93 04 lds r23, 0x0493 ; 0x800493 3acd8: 86 17 cp r24, r22 3acda: 97 07 cpc r25, r23 3acdc: d9 f2 breq .-74 ; 0x3ac94 <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3acde: 20 5f subi r18, 0xF0 ; 240 3ace0: 3b 4f sbci r19, 0xFB ; 251 3ace2: f9 01 movw r30, r18 3ace4: 40 83 st Z, r20 rx_buffer.head = i; 3ace6: 90 93 91 04 sts 0x0491, r25 ; 0x800491 3acea: 80 93 90 04 sts 0x0490, r24 ; 0x800490 3acee: d2 cf rjmp .-92 ; 0x3ac94 <__vector_36+0x2c> 0003acf0 <__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) { 3acf0: 1f 92 push r1 3acf2: 0f 92 push r0 3acf4: 0f b6 in r0, 0x3f ; 63 3acf6: 0f 92 push r0 3acf8: 11 24 eor r1, r1 3acfa: 0b b6 in r0, 0x3b ; 59 3acfc: 0f 92 push r0 3acfe: 2f 93 push r18 3ad00: 3f 93 push r19 3ad02: 4f 93 push r20 3ad04: 6f 93 push r22 3ad06: 7f 93 push r23 3ad08: 8f 93 push r24 3ad0a: 9f 93 push r25 3ad0c: ef 93 push r30 3ad0e: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3ad14: 84 ff sbrs r24, 4 3ad16: 12 c0 rjmp .+36 ; 0x3ad3c <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3ad18: 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 } } 3ad1c: ff 91 pop r31 3ad1e: ef 91 pop r30 3ad20: 9f 91 pop r25 3ad22: 8f 91 pop r24 3ad24: 7f 91 pop r23 3ad26: 6f 91 pop r22 3ad28: 4f 91 pop r20 3ad2a: 3f 91 pop r19 3ad2c: 2f 91 pop r18 3ad2e: 0f 90 pop r0 3ad30: 0b be out 0x3b, r0 ; 59 3ad32: 0f 90 pop r0 3ad34: 0f be out 0x3f, r0 ; 63 3ad36: 0f 90 pop r0 3ad38: 1f 90 pop r1 3ad3a: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3ad3c: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3ad40: 80 91 1e 05 lds r24, 0x051E ; 0x80051e 3ad44: 81 11 cpse r24, r1 3ad46: ea cf rjmp .-44 ; 0x3ad1c <__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; 3ad48: 20 91 90 04 lds r18, 0x0490 ; 0x800490 3ad4c: 30 91 91 04 lds r19, 0x0491 ; 0x800491 3ad50: c9 01 movw r24, r18 3ad52: 01 96 adiw r24, 0x01 ; 1 3ad54: 8f 77 andi r24, 0x7F ; 127 3ad56: 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) { 3ad58: 60 91 92 04 lds r22, 0x0492 ; 0x800492 3ad5c: 70 91 93 04 lds r23, 0x0493 ; 0x800493 3ad60: 86 17 cp r24, r22 3ad62: 97 07 cpc r25, r23 3ad64: d9 f2 breq .-74 ; 0x3ad1c <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ad66: 20 5f subi r18, 0xF0 ; 240 3ad68: 3b 4f sbci r19, 0xFB ; 251 3ad6a: f9 01 movw r30, r18 3ad6c: 40 83 st Z, r20 rx_buffer.head = i; 3ad6e: 90 93 91 04 sts 0x0491, r25 ; 0x800491 3ad72: 80 93 90 04 sts 0x0490, r24 ; 0x800490 3ad76: d2 cf rjmp .-92 ; 0x3ad1c <__vector_25+0x2c> 0003ad78 : * 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) { 3ad78: 2f 92 push r2 3ad7a: 3f 92 push r3 3ad7c: 4f 92 push r4 3ad7e: 5f 92 push r5 3ad80: 6f 92 push r6 3ad82: 7f 92 push r7 3ad84: 8f 92 push r8 3ad86: 9f 92 push r9 3ad88: af 92 push r10 3ad8a: bf 92 push r11 3ad8c: cf 92 push r12 3ad8e: df 92 push r13 3ad90: ef 92 push r14 3ad92: ff 92 push r15 3ad94: 0f 93 push r16 3ad96: 1f 93 push r17 3ad98: cf 93 push r28 3ad9a: df 93 push r29 3ad9c: cd b7 in r28, 0x3d ; 61 3ad9e: de b7 in r29, 0x3e ; 62 3ada0: c2 54 subi r28, 0x42 ; 66 3ada2: d1 09 sbc r29, r1 3ada4: 0f b6 in r0, 0x3f ; 63 3ada6: f8 94 cli 3ada8: de bf out 0x3e, r29 ; 62 3adaa: 0f be out 0x3f, r0 ; 63 3adac: cd bf out 0x3d, r28 ; 61 3adae: 4c 01 movw r8, r24 3adb0: 5b 01 movw r10, r22 3adb2: 6a 01 movw r12, r20 3adb4: 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) {} 3adb6: 19 82 std Y+1, r1 ; 0x01 3adb8: 1c 82 std Y+4, r1 ; 0x04 3adba: 1c 8e std Y+28, r1 ; 0x1c 3adbc: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 3adbe: 67 2b or r22, r23 3adc0: 21 f5 brne .+72 ; 0x3ae0a sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 3adc2: 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; 3adc4: ce 01 movw r24, r28 3adc6: 4c 96 adiw r24, 0x1c ; 28 3adc8: 0e 94 4d 79 call 0xf29a ; 0xf29a 3adcc: ce 01 movw r24, r28 3adce: 01 96 adiw r24, 0x01 ; 1 3add0: 0e 94 4d 79 call 0xf29a ; 0xf29a } return open(parent, dname, oflag); fail: return false; } 3add4: 81 2f mov r24, r17 3add6: ce 5b subi r28, 0xBE ; 190 3add8: df 4f sbci r29, 0xFF ; 255 3adda: 0f b6 in r0, 0x3f ; 63 3addc: f8 94 cli 3adde: de bf out 0x3e, r29 ; 62 3ade0: 0f be out 0x3f, r0 ; 63 3ade2: cd bf out 0x3d, r28 ; 61 3ade4: df 91 pop r29 3ade6: cf 91 pop r28 3ade8: 1f 91 pop r17 3adea: 0f 91 pop r16 3adec: ff 90 pop r15 3adee: ef 90 pop r14 3adf0: df 90 pop r13 3adf2: cf 90 pop r12 3adf4: bf 90 pop r11 3adf6: af 90 pop r10 3adf8: 9f 90 pop r9 3adfa: 8f 90 pop r8 3adfc: 7f 90 pop r7 3adfe: 6f 90 pop r6 3ae00: 5f 90 pop r5 3ae02: 4f 90 pop r4 3ae04: 3f 90 pop r3 3ae06: 2f 90 pop r2 3ae08: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 3ae0a: fc 01 movw r30, r24 3ae0c: 83 81 ldd r24, Z+3 ; 0x03 3ae0e: 81 11 cpse r24, r1 3ae10: d8 cf rjmp .-80 ; 0x3adc2 if (*path == '/') { 3ae12: fa 01 movw r30, r20 3ae14: 80 81 ld r24, Z 3ae16: 8f 32 cpi r24, 0x2F ; 47 3ae18: c1 f4 brne .+48 ; 0x3ae4a 3ae1a: ca 01 movw r24, r20 3ae1c: 6c 01 movw r12, r24 3ae1e: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 3ae20: f6 01 movw r30, r12 3ae22: 20 81 ld r18, Z 3ae24: 2f 32 cpi r18, 0x2F ; 47 3ae26: d1 f3 breq .-12 ; 0x3ae1c 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; 3ae28: f5 01 movw r30, r10 3ae2a: 83 81 ldd r24, Z+3 ; 0x03 3ae2c: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 3ae2e: 82 30 cpi r24, 0x02 ; 2 3ae30: 60 f0 brcs .+24 ; 0x3ae4a if (!dir2.openRoot(dirFile->vol_)) goto fail; 3ae32: 61 8d ldd r22, Z+25 ; 0x19 3ae34: 72 8d ldd r23, Z+26 ; 0x1a 3ae36: ce 01 movw r24, r28 3ae38: 4c 96 adiw r24, 0x1c ; 28 3ae3a: 0f 94 a2 a3 call 0x34744 ; 0x34744 parent = &dir2; 3ae3e: 8e 01 movw r16, r28 3ae40: 04 5e subi r16, 0xE4 ; 228 3ae42: 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; 3ae44: 81 11 cpse r24, r1 3ae46: 02 c0 rjmp .+4 ; 0x3ae4c 3ae48: bc cf rjmp .-136 ; 0x3adc2 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 3ae4a: 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; 3ae4c: ce 01 movw r24, r28 3ae4e: 01 96 adiw r24, 0x01 ; 1 3ae50: 7c 01 movw r14, r24 3ae52: 3c 01 movw r6, r24 3ae54: 2e 01 movw r4, r28 3ae56: 9c e1 ldi r25, 0x1C ; 28 3ae58: 49 0e add r4, r25 3ae5a: 51 1c adc r5, r1 3ae5c: 23 96 adiw r28, 0x03 ; 3 3ae5e: ef ae std Y+63, r14 ; 0x3f 3ae60: 23 97 sbiw r28, 0x03 ; 3 3ae62: 2f 2c mov r2, r15 3ae64: fe 01 movw r30, r28 3ae66: f7 96 adiw r30, 0x37 ; 55 3ae68: cf 01 movw r24, r30 3ae6a: 0b 96 adiw r24, 0x0b ; 11 3ae6c: 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++] = ' '; 3ae6e: 20 e2 ldi r18, 0x20 ; 32 3ae70: 21 93 st Z+, r18 3ae72: e8 17 cp r30, r24 3ae74: f9 07 cpc r31, r25 3ae76: d9 f7 brne .-10 ; 0x3ae6e 3ae78: 96 01 movw r18, r12 i = 0; 3ae7a: 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 3ae7c: 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 != '/') { 3ae7e: d9 01 movw r26, r18 3ae80: 8d 91 ld r24, X+ 3ae82: 88 23 and r24, r24 3ae84: 49 f1 breq .+82 ; 0x3aed8 3ae86: 8f 32 cpi r24, 0x2F ; 47 3ae88: 39 f1 breq .+78 ; 0x3aed8 c = *str++; 3ae8a: 28 2f mov r18, r24 if (c == '.') { 3ae8c: 8e 32 cpi r24, 0x2E ; 46 3ae8e: 39 f4 brne .+14 ; 0x3ae9e if (n == 10) goto fail; // only one dot allowed 3ae90: 6a 30 cpi r22, 0x0A ; 10 3ae92: 09 f4 brne .+2 ; 0x3ae96 3ae94: 96 cf rjmp .-212 ; 0x3adc2 n = 10; // max index for full 8.3 name i = 8; // place for extension 3ae96: 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 3ae98: 6a e0 ldi r22, 0x0A ; 10 3ae9a: 9d 01 movw r18, r26 3ae9c: f0 cf rjmp .-32 ; 0x3ae7e 3ae9e: ed ec ldi r30, 0xCD ; 205 3aea0: 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; 3aea2: 34 91 lpm r19, Z 3aea4: 33 23 and r19, r19 3aea6: 21 f0 breq .+8 ; 0x3aeb0 3aea8: 31 96 adiw r30, 0x01 ; 1 3aeaa: 83 13 cpse r24, r19 3aeac: fa cf rjmp .-12 ; 0x3aea2 3aeae: 89 cf rjmp .-238 ; 0x3adc2 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 3aeb0: 69 17 cp r22, r25 3aeb2: 08 f4 brcc .+2 ; 0x3aeb6 3aeb4: 86 cf rjmp .-244 ; 0x3adc2 3aeb6: 3f ed ldi r19, 0xDF ; 223 3aeb8: 38 0f add r19, r24 3aeba: 3e 35 cpi r19, 0x5E ; 94 3aebc: 08 f0 brcs .+2 ; 0x3aec0 3aebe: 81 cf rjmp .-254 ; 0x3adc2 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 3aec0: 3f e9 ldi r19, 0x9F ; 159 3aec2: 38 0f add r19, r24 3aec4: 3a 31 cpi r19, 0x1A ; 26 3aec6: 10 f4 brcc .+4 ; 0x3aecc 3aec8: 20 ee ldi r18, 0xE0 ; 224 3aeca: 28 0f add r18, r24 3aecc: fa 01 movw r30, r20 3aece: e9 0f add r30, r25 3aed0: f1 1d adc r31, r1 3aed2: 20 83 st Z, r18 3aed4: 9f 5f subi r25, 0xFF ; 255 3aed6: e1 cf rjmp .-62 ; 0x3ae9a if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 3aed8: 8f a9 ldd r24, Y+55 ; 0x37 3aeda: 80 32 cpi r24, 0x20 ; 32 3aedc: 09 f4 brne .+2 ; 0x3aee0 3aede: 71 cf rjmp .-286 ; 0x3adc2 3aee0: 69 01 movw r12, r18 while (*path == '/') path++; 3aee2: f9 01 movw r30, r18 3aee4: 80 81 ld r24, Z 3aee6: 2f 5f subi r18, 0xFF ; 255 3aee8: 3f 4f sbci r19, 0xFF ; 255 3aeea: 8f 32 cpi r24, 0x2F ; 47 3aeec: c9 f3 breq .-14 ; 0x3aee0 if (!*path) break; 3aeee: 88 23 and r24, r24 3aef0: d9 f0 breq .+54 ; 0x3af28 if (!sub->open(parent, dname, O_READ)) goto fail; 3aef2: 21 e0 ldi r18, 0x01 ; 1 3aef4: b8 01 movw r22, r16 3aef6: c7 01 movw r24, r14 3aef8: 0f 94 ef a7 call 0x34fde ; 0x34fde 3aefc: 88 23 and r24, r24 3aefe: 09 f4 brne .+2 ; 0x3af02 3af00: 60 cf rjmp .-320 ; 0x3adc2 if (parent != dirFile) parent->close(); 3af02: 0a 15 cp r16, r10 3af04: 1b 05 cpc r17, r11 3af06: 19 f0 breq .+6 ; 0x3af0e 3af08: c8 01 movw r24, r16 3af0a: 0f 94 f2 a3 call 0x347e4 ; 0x347e4 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 3af0e: 94 2d mov r25, r4 3af10: 85 2d mov r24, r5 3af12: 6e 14 cp r6, r14 3af14: 7f 04 cpc r7, r15 3af16: 21 f0 breq .+8 ; 0x3af20 3af18: 23 96 adiw r28, 0x03 ; 3 3af1a: 9f ad ldd r25, Y+63 ; 0x3f 3af1c: 23 97 sbiw r28, 0x03 ; 3 3af1e: 82 2d mov r24, r2 3af20: 87 01 movw r16, r14 3af22: e9 2e mov r14, r25 3af24: f8 2e mov r15, r24 3af26: 9e cf rjmp .-196 ; 0x3ae64 } return open(parent, dname, oflag); 3af28: 23 2d mov r18, r3 3af2a: b8 01 movw r22, r16 3af2c: c4 01 movw r24, r8 3af2e: 0f 94 ef a7 call 0x34fde ; 0x34fde 3af32: 18 2f mov r17, r24 3af34: 47 cf rjmp .-370 ; 0x3adc4 0003af36 <__floatunsisf>: 3af36: e8 94 clt 3af38: 09 c0 rjmp .+18 ; 0x3af4c <__floatsisf+0x12> 0003af3a <__floatsisf>: 3af3a: 97 fb bst r25, 7 3af3c: 3e f4 brtc .+14 ; 0x3af4c <__floatsisf+0x12> 3af3e: 90 95 com r25 3af40: 80 95 com r24 3af42: 70 95 com r23 3af44: 61 95 neg r22 3af46: 7f 4f sbci r23, 0xFF ; 255 3af48: 8f 4f sbci r24, 0xFF ; 255 3af4a: 9f 4f sbci r25, 0xFF ; 255 3af4c: 99 23 and r25, r25 3af4e: a9 f0 breq .+42 ; 0x3af7a <__floatsisf+0x40> 3af50: f9 2f mov r31, r25 3af52: 96 e9 ldi r25, 0x96 ; 150 3af54: bb 27 eor r27, r27 3af56: 93 95 inc r25 3af58: f6 95 lsr r31 3af5a: 87 95 ror r24 3af5c: 77 95 ror r23 3af5e: 67 95 ror r22 3af60: b7 95 ror r27 3af62: f1 11 cpse r31, r1 3af64: f8 cf rjmp .-16 ; 0x3af56 <__floatsisf+0x1c> 3af66: fa f4 brpl .+62 ; 0x3afa6 <__floatsisf+0x6c> 3af68: bb 0f add r27, r27 3af6a: 11 f4 brne .+4 ; 0x3af70 <__floatsisf+0x36> 3af6c: 60 ff sbrs r22, 0 3af6e: 1b c0 rjmp .+54 ; 0x3afa6 <__floatsisf+0x6c> 3af70: 6f 5f subi r22, 0xFF ; 255 3af72: 7f 4f sbci r23, 0xFF ; 255 3af74: 8f 4f sbci r24, 0xFF ; 255 3af76: 9f 4f sbci r25, 0xFF ; 255 3af78: 16 c0 rjmp .+44 ; 0x3afa6 <__floatsisf+0x6c> 3af7a: 88 23 and r24, r24 3af7c: 11 f0 breq .+4 ; 0x3af82 <__floatsisf+0x48> 3af7e: 96 e9 ldi r25, 0x96 ; 150 3af80: 11 c0 rjmp .+34 ; 0x3afa4 <__floatsisf+0x6a> 3af82: 77 23 and r23, r23 3af84: 21 f0 breq .+8 ; 0x3af8e <__floatsisf+0x54> 3af86: 9e e8 ldi r25, 0x8E ; 142 3af88: 87 2f mov r24, r23 3af8a: 76 2f mov r23, r22 3af8c: 05 c0 rjmp .+10 ; 0x3af98 <__floatsisf+0x5e> 3af8e: 66 23 and r22, r22 3af90: 71 f0 breq .+28 ; 0x3afae <__floatsisf+0x74> 3af92: 96 e8 ldi r25, 0x86 ; 134 3af94: 86 2f mov r24, r22 3af96: 70 e0 ldi r23, 0x00 ; 0 3af98: 60 e0 ldi r22, 0x00 ; 0 3af9a: 2a f0 brmi .+10 ; 0x3afa6 <__floatsisf+0x6c> 3af9c: 9a 95 dec r25 3af9e: 66 0f add r22, r22 3afa0: 77 1f adc r23, r23 3afa2: 88 1f adc r24, r24 3afa4: da f7 brpl .-10 ; 0x3af9c <__floatsisf+0x62> 3afa6: 88 0f add r24, r24 3afa8: 96 95 lsr r25 3afaa: 87 95 ror r24 3afac: 97 f9 bld r25, 7 3afae: 08 95 ret 0003afb0 : 3afb0: 9b 01 movw r18, r22 3afb2: ac 01 movw r20, r24 3afb4: 0d 94 dc d7 jmp 0x3afb8 ; 0x3afb8 <__mulsf3> 0003afb8 <__mulsf3>: 3afb8: 0f 94 ef d7 call 0x3afde ; 0x3afde <__mulsf3x> 3afbc: 0d 94 60 d8 jmp 0x3b0c0 ; 0x3b0c0 <__fp_round> 3afc0: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 <__fp_pscA> 3afc4: 38 f0 brcs .+14 ; 0x3afd4 <__mulsf3+0x1c> 3afc6: 0f 94 59 d8 call 0x3b0b2 ; 0x3b0b2 <__fp_pscB> 3afca: 20 f0 brcs .+8 ; 0x3afd4 <__mulsf3+0x1c> 3afcc: 95 23 and r25, r21 3afce: 11 f0 breq .+4 ; 0x3afd4 <__mulsf3+0x1c> 3afd0: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 3afd4: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 3afd8: 11 24 eor r1, r1 3afda: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 0003afde <__mulsf3x>: 3afde: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__fp_split3> 3afe2: 70 f3 brcs .-36 ; 0x3afc0 <__mulsf3+0x8> 0003afe4 <__mulsf3_pse>: 3afe4: 95 9f mul r25, r21 3afe6: c1 f3 breq .-16 ; 0x3afd8 <__mulsf3+0x20> 3afe8: 95 0f add r25, r21 3afea: 50 e0 ldi r21, 0x00 ; 0 3afec: 55 1f adc r21, r21 3afee: 62 9f mul r22, r18 3aff0: f0 01 movw r30, r0 3aff2: 72 9f mul r23, r18 3aff4: bb 27 eor r27, r27 3aff6: f0 0d add r31, r0 3aff8: b1 1d adc r27, r1 3affa: 63 9f mul r22, r19 3affc: aa 27 eor r26, r26 3affe: f0 0d add r31, r0 3b000: b1 1d adc r27, r1 3b002: aa 1f adc r26, r26 3b004: 64 9f mul r22, r20 3b006: 66 27 eor r22, r22 3b008: b0 0d add r27, r0 3b00a: a1 1d adc r26, r1 3b00c: 66 1f adc r22, r22 3b00e: 82 9f mul r24, r18 3b010: 22 27 eor r18, r18 3b012: b0 0d add r27, r0 3b014: a1 1d adc r26, r1 3b016: 62 1f adc r22, r18 3b018: 73 9f mul r23, r19 3b01a: b0 0d add r27, r0 3b01c: a1 1d adc r26, r1 3b01e: 62 1f adc r22, r18 3b020: 83 9f mul r24, r19 3b022: a0 0d add r26, r0 3b024: 61 1d adc r22, r1 3b026: 22 1f adc r18, r18 3b028: 74 9f mul r23, r20 3b02a: 33 27 eor r19, r19 3b02c: a0 0d add r26, r0 3b02e: 61 1d adc r22, r1 3b030: 23 1f adc r18, r19 3b032: 84 9f mul r24, r20 3b034: 60 0d add r22, r0 3b036: 21 1d adc r18, r1 3b038: 82 2f mov r24, r18 3b03a: 76 2f mov r23, r22 3b03c: 6a 2f mov r22, r26 3b03e: 11 24 eor r1, r1 3b040: 9f 57 subi r25, 0x7F ; 127 3b042: 50 40 sbci r21, 0x00 ; 0 3b044: 9a f0 brmi .+38 ; 0x3b06c <__mulsf3_pse+0x88> 3b046: f1 f0 breq .+60 ; 0x3b084 <__mulsf3_pse+0xa0> 3b048: 88 23 and r24, r24 3b04a: 4a f0 brmi .+18 ; 0x3b05e <__mulsf3_pse+0x7a> 3b04c: ee 0f add r30, r30 3b04e: ff 1f adc r31, r31 3b050: bb 1f adc r27, r27 3b052: 66 1f adc r22, r22 3b054: 77 1f adc r23, r23 3b056: 88 1f adc r24, r24 3b058: 91 50 subi r25, 0x01 ; 1 3b05a: 50 40 sbci r21, 0x00 ; 0 3b05c: a9 f7 brne .-22 ; 0x3b048 <__mulsf3_pse+0x64> 3b05e: 9e 3f cpi r25, 0xFE ; 254 3b060: 51 05 cpc r21, r1 3b062: 80 f0 brcs .+32 ; 0x3b084 <__mulsf3_pse+0xa0> 3b064: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 3b068: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 3b06c: 5f 3f cpi r21, 0xFF ; 255 3b06e: e4 f3 brlt .-8 ; 0x3b068 <__mulsf3_pse+0x84> 3b070: 98 3e cpi r25, 0xE8 ; 232 3b072: d4 f3 brlt .-12 ; 0x3b068 <__mulsf3_pse+0x84> 3b074: 86 95 lsr r24 3b076: 77 95 ror r23 3b078: 67 95 ror r22 3b07a: b7 95 ror r27 3b07c: f7 95 ror r31 3b07e: e7 95 ror r30 3b080: 9f 5f subi r25, 0xFF ; 255 3b082: c1 f7 brne .-16 ; 0x3b074 <__mulsf3_pse+0x90> 3b084: fe 2b or r31, r30 3b086: 88 0f add r24, r24 3b088: 91 1d adc r25, r1 3b08a: 96 95 lsr r25 3b08c: 87 95 ror r24 3b08e: 97 f9 bld r25, 7 3b090: 08 95 ret 0003b092 <__fp_inf>: 3b092: 97 f9 bld r25, 7 3b094: 9f 67 ori r25, 0x7F ; 127 3b096: 80 e8 ldi r24, 0x80 ; 128 3b098: 70 e0 ldi r23, 0x00 ; 0 3b09a: 60 e0 ldi r22, 0x00 ; 0 3b09c: 08 95 ret 0003b09e <__fp_nan>: 3b09e: 9f ef ldi r25, 0xFF ; 255 3b0a0: 80 ec ldi r24, 0xC0 ; 192 3b0a2: 08 95 ret 0003b0a4 <__fp_pscA>: 3b0a4: 00 24 eor r0, r0 3b0a6: 0a 94 dec r0 3b0a8: 16 16 cp r1, r22 3b0aa: 17 06 cpc r1, r23 3b0ac: 18 06 cpc r1, r24 3b0ae: 09 06 cpc r0, r25 3b0b0: 08 95 ret 0003b0b2 <__fp_pscB>: 3b0b2: 00 24 eor r0, r0 3b0b4: 0a 94 dec r0 3b0b6: 12 16 cp r1, r18 3b0b8: 13 06 cpc r1, r19 3b0ba: 14 06 cpc r1, r20 3b0bc: 05 06 cpc r0, r21 3b0be: 08 95 ret 0003b0c0 <__fp_round>: 3b0c0: 09 2e mov r0, r25 3b0c2: 03 94 inc r0 3b0c4: 00 0c add r0, r0 3b0c6: 11 f4 brne .+4 ; 0x3b0cc <__fp_round+0xc> 3b0c8: 88 23 and r24, r24 3b0ca: 52 f0 brmi .+20 ; 0x3b0e0 <__fp_round+0x20> 3b0cc: bb 0f add r27, r27 3b0ce: 40 f4 brcc .+16 ; 0x3b0e0 <__fp_round+0x20> 3b0d0: bf 2b or r27, r31 3b0d2: 11 f4 brne .+4 ; 0x3b0d8 <__fp_round+0x18> 3b0d4: 60 ff sbrs r22, 0 3b0d6: 04 c0 rjmp .+8 ; 0x3b0e0 <__fp_round+0x20> 3b0d8: 6f 5f subi r22, 0xFF ; 255 3b0da: 7f 4f sbci r23, 0xFF ; 255 3b0dc: 8f 4f sbci r24, 0xFF ; 255 3b0de: 9f 4f sbci r25, 0xFF ; 255 3b0e0: 08 95 ret 0003b0e2 <__fp_split3>: 3b0e2: 57 fd sbrc r21, 7 3b0e4: 90 58 subi r25, 0x80 ; 128 3b0e6: 44 0f add r20, r20 3b0e8: 55 1f adc r21, r21 3b0ea: 59 f0 breq .+22 ; 0x3b102 <__fp_splitA+0x10> 3b0ec: 5f 3f cpi r21, 0xFF ; 255 3b0ee: 71 f0 breq .+28 ; 0x3b10c <__fp_splitA+0x1a> 3b0f0: 47 95 ror r20 0003b0f2 <__fp_splitA>: 3b0f2: 88 0f add r24, r24 3b0f4: 97 fb bst r25, 7 3b0f6: 99 1f adc r25, r25 3b0f8: 61 f0 breq .+24 ; 0x3b112 <__fp_splitA+0x20> 3b0fa: 9f 3f cpi r25, 0xFF ; 255 3b0fc: 79 f0 breq .+30 ; 0x3b11c <__fp_splitA+0x2a> 3b0fe: 87 95 ror r24 3b100: 08 95 ret 3b102: 12 16 cp r1, r18 3b104: 13 06 cpc r1, r19 3b106: 14 06 cpc r1, r20 3b108: 55 1f adc r21, r21 3b10a: f2 cf rjmp .-28 ; 0x3b0f0 <__fp_split3+0xe> 3b10c: 46 95 lsr r20 3b10e: f1 df rcall .-30 ; 0x3b0f2 <__fp_splitA> 3b110: 08 c0 rjmp .+16 ; 0x3b122 <__fp_splitA+0x30> 3b112: 16 16 cp r1, r22 3b114: 17 06 cpc r1, r23 3b116: 18 06 cpc r1, r24 3b118: 99 1f adc r25, r25 3b11a: f1 cf rjmp .-30 ; 0x3b0fe <__fp_splitA+0xc> 3b11c: 86 95 lsr r24 3b11e: 71 05 cpc r23, r1 3b120: 61 05 cpc r22, r1 3b122: 08 94 sec 3b124: 08 95 ret 0003b126 <__fp_zero>: 3b126: e8 94 clt 0003b128 <__fp_szero>: 3b128: bb 27 eor r27, r27 3b12a: 66 27 eor r22, r22 3b12c: 77 27 eor r23, r23 3b12e: cb 01 movw r24, r22 3b130: 97 f9 bld r25, 7 3b132: 08 95 ret 0003b134 : 3b134: 3f 92 push r3 3b136: 4f 92 push r4 3b138: 5f 92 push r5 3b13a: 6f 92 push r6 3b13c: 7f 92 push r7 3b13e: 8f 92 push r8 3b140: 9f 92 push r9 3b142: af 92 push r10 3b144: bf 92 push r11 3b146: cf 92 push r12 3b148: df 92 push r13 3b14a: ef 92 push r14 3b14c: ff 92 push r15 3b14e: 0f 93 push r16 3b150: 1f 93 push r17 3b152: cf 93 push r28 3b154: df 93 push r29 3b156: 5c 01 movw r10, r24 3b158: 6b 01 movw r12, r22 3b15a: 7a 01 movw r14, r20 3b15c: 61 15 cp r22, r1 3b15e: 71 05 cpc r23, r1 3b160: 19 f0 breq .+6 ; 0x3b168 3b162: fb 01 movw r30, r22 3b164: 91 83 std Z+1, r25 ; 0x01 3b166: 80 83 st Z, r24 3b168: e1 14 cp r14, r1 3b16a: f1 04 cpc r15, r1 3b16c: 51 f0 breq .+20 ; 0x3b182 3b16e: c7 01 movw r24, r14 3b170: 02 97 sbiw r24, 0x02 ; 2 3b172: 83 97 sbiw r24, 0x23 ; 35 3b174: 30 f0 brcs .+12 ; 0x3b182 3b176: 40 e0 ldi r20, 0x00 ; 0 3b178: 30 e0 ldi r19, 0x00 ; 0 3b17a: 20 e0 ldi r18, 0x00 ; 0 3b17c: 90 e0 ldi r25, 0x00 ; 0 3b17e: 6b c0 rjmp .+214 ; 0x3b256 3b180: 5e 01 movw r10, r28 3b182: e5 01 movw r28, r10 3b184: 21 96 adiw r28, 0x01 ; 1 3b186: f5 01 movw r30, r10 3b188: 10 81 ld r17, Z 3b18a: 81 2f mov r24, r17 3b18c: 90 e0 ldi r25, 0x00 ; 0 3b18e: 0f 94 a0 da call 0x3b540 ; 0x3b540 3b192: 89 2b or r24, r25 3b194: a9 f7 brne .-22 ; 0x3b180 3b196: 1d 32 cpi r17, 0x2D ; 45 3b198: 01 f5 brne .+64 ; 0x3b1da 3b19a: 21 96 adiw r28, 0x01 ; 1 3b19c: f5 01 movw r30, r10 3b19e: 11 81 ldd r17, Z+1 ; 0x01 3b1a0: 01 e0 ldi r16, 0x01 ; 1 3b1a2: e1 14 cp r14, r1 3b1a4: f1 04 cpc r15, r1 3b1a6: 09 f4 brne .+2 ; 0x3b1aa 3b1a8: e6 c0 rjmp .+460 ; 0x3b376 3b1aa: f0 e1 ldi r31, 0x10 ; 16 3b1ac: ef 16 cp r14, r31 3b1ae: f1 04 cpc r15, r1 3b1b0: 09 f0 breq .+2 ; 0x3b1b4 3b1b2: 88 c0 rjmp .+272 ; 0x3b2c4 3b1b4: 10 33 cpi r17, 0x30 ; 48 3b1b6: 59 f4 brne .+22 ; 0x3b1ce 3b1b8: 88 81 ld r24, Y 3b1ba: 8f 7d andi r24, 0xDF ; 223 3b1bc: 88 35 cpi r24, 0x58 ; 88 3b1be: 09 f0 breq .+2 ; 0x3b1c2 3b1c0: 7c c0 rjmp .+248 ; 0x3b2ba 3b1c2: 19 81 ldd r17, Y+1 ; 0x01 3b1c4: 22 96 adiw r28, 0x02 ; 2 3b1c6: 02 60 ori r16, 0x02 ; 2 3b1c8: f0 e1 ldi r31, 0x10 ; 16 3b1ca: ef 2e mov r14, r31 3b1cc: f1 2c mov r15, r1 3b1ce: 81 2c mov r8, r1 3b1d0: 91 2c mov r9, r1 3b1d2: a1 2c mov r10, r1 3b1d4: 88 e0 ldi r24, 0x08 ; 8 3b1d6: b8 2e mov r11, r24 3b1d8: 92 c0 rjmp .+292 ; 0x3b2fe 3b1da: 1b 32 cpi r17, 0x2B ; 43 3b1dc: 21 f4 brne .+8 ; 0x3b1e6 3b1de: e5 01 movw r28, r10 3b1e0: 22 96 adiw r28, 0x02 ; 2 3b1e2: f5 01 movw r30, r10 3b1e4: 11 81 ldd r17, Z+1 ; 0x01 3b1e6: 00 e0 ldi r16, 0x00 ; 0 3b1e8: dc cf rjmp .-72 ; 0x3b1a2 3b1ea: ea e0 ldi r30, 0x0A ; 10 3b1ec: ee 16 cp r14, r30 3b1ee: f1 04 cpc r15, r1 3b1f0: 09 f4 brne .+2 ; 0x3b1f4 3b1f2: c7 c0 rjmp .+398 ; 0x3b382 3b1f4: f0 e1 ldi r31, 0x10 ; 16 3b1f6: ef 16 cp r14, r31 3b1f8: f1 04 cpc r15, r1 3b1fa: 09 f0 breq .+2 ; 0x3b1fe 3b1fc: 73 c0 rjmp .+230 ; 0x3b2e4 3b1fe: e7 cf rjmp .-50 ; 0x3b1ce 3b200: 78 e0 ldi r23, 0x08 ; 8 3b202: e7 2e mov r14, r23 3b204: f1 2c mov r15, r1 3b206: 81 2c mov r8, r1 3b208: 91 2c mov r9, r1 3b20a: a1 2c mov r10, r1 3b20c: 60 e1 ldi r22, 0x10 ; 16 3b20e: b6 2e mov r11, r22 3b210: 76 c0 rjmp .+236 ; 0x3b2fe 3b212: 21 e0 ldi r18, 0x01 ; 1 3b214: ad c0 rjmp .+346 ; 0x3b370 3b216: 30 2f mov r19, r16 3b218: 31 70 andi r19, 0x01 ; 1 3b21a: c1 14 cp r12, r1 3b21c: d1 04 cpc r13, r1 3b21e: 31 f0 breq .+12 ; 0x3b22c 3b220: 22 23 and r18, r18 3b222: 71 f1 breq .+92 ; 0x3b280 3b224: 21 97 sbiw r28, 0x01 ; 1 3b226: f6 01 movw r30, r12 3b228: d1 83 std Z+1, r29 ; 0x01 3b22a: c0 83 st Z, r28 3b22c: 27 ff sbrs r18, 7 3b22e: 2e c0 rjmp .+92 ; 0x3b28c 3b230: 60 e0 ldi r22, 0x00 ; 0 3b232: 70 e0 ldi r23, 0x00 ; 0 3b234: 80 e0 ldi r24, 0x00 ; 0 3b236: 90 e8 ldi r25, 0x80 ; 128 3b238: 31 11 cpse r19, r1 3b23a: 04 c0 rjmp .+8 ; 0x3b244 3b23c: 6f ef ldi r22, 0xFF ; 255 3b23e: 7f ef ldi r23, 0xFF ; 255 3b240: 8f ef ldi r24, 0xFF ; 255 3b242: 9f e7 ldi r25, 0x7F ; 127 3b244: 22 e2 ldi r18, 0x22 ; 34 3b246: 30 e0 ldi r19, 0x00 ; 0 3b248: 30 93 0b 18 sts 0x180B, r19 ; 0x80180b 3b24c: 20 93 0a 18 sts 0x180A, r18 ; 0x80180a 3b250: 46 2f mov r20, r22 3b252: 37 2f mov r19, r23 3b254: 28 2f mov r18, r24 3b256: 64 2f mov r22, r20 3b258: 73 2f mov r23, r19 3b25a: 82 2f mov r24, r18 3b25c: df 91 pop r29 3b25e: cf 91 pop r28 3b260: 1f 91 pop r17 3b262: 0f 91 pop r16 3b264: ff 90 pop r15 3b266: ef 90 pop r14 3b268: df 90 pop r13 3b26a: cf 90 pop r12 3b26c: bf 90 pop r11 3b26e: af 90 pop r10 3b270: 9f 90 pop r9 3b272: 8f 90 pop r8 3b274: 7f 90 pop r7 3b276: 6f 90 pop r6 3b278: 5f 90 pop r5 3b27a: 4f 90 pop r4 3b27c: 3f 90 pop r3 3b27e: 08 95 ret 3b280: 01 ff sbrs r16, 1 3b282: 04 c0 rjmp .+8 ; 0x3b28c 3b284: 22 97 sbiw r28, 0x02 ; 2 3b286: f6 01 movw r30, r12 3b288: d1 83 std Z+1, r29 ; 0x01 3b28a: c0 83 st Z, r28 3b28c: 33 23 and r19, r19 3b28e: 41 f0 breq .+16 ; 0x3b2a0 3b290: 90 95 com r25 3b292: 80 95 com r24 3b294: 70 95 com r23 3b296: 61 95 neg r22 3b298: 7f 4f sbci r23, 0xFF ; 255 3b29a: 8f 4f sbci r24, 0xFF ; 255 3b29c: 9f 4f sbci r25, 0xFF ; 255 3b29e: d8 cf rjmp .-80 ; 0x3b250 3b2a0: 97 ff sbrs r25, 7 3b2a2: d6 cf rjmp .-84 ; 0x3b250 3b2a4: 82 e2 ldi r24, 0x22 ; 34 3b2a6: 90 e0 ldi r25, 0x00 ; 0 3b2a8: 90 93 0b 18 sts 0x180B, r25 ; 0x80180b 3b2ac: 80 93 0a 18 sts 0x180A, r24 ; 0x80180a 3b2b0: 6f ef ldi r22, 0xFF ; 255 3b2b2: 7f ef ldi r23, 0xFF ; 255 3b2b4: 8f ef ldi r24, 0xFF ; 255 3b2b6: 9f e7 ldi r25, 0x7F ; 127 3b2b8: cb cf rjmp .-106 ; 0x3b250 3b2ba: 10 e3 ldi r17, 0x30 ; 48 3b2bc: e1 14 cp r14, r1 3b2be: f1 04 cpc r15, r1 3b2c0: 09 f4 brne .+2 ; 0x3b2c4 3b2c2: 9e cf rjmp .-196 ; 0x3b200 3b2c4: 28 e0 ldi r18, 0x08 ; 8 3b2c6: e2 16 cp r14, r18 3b2c8: f1 04 cpc r15, r1 3b2ca: 09 f4 brne .+2 ; 0x3b2ce 3b2cc: 9c cf rjmp .-200 ; 0x3b206 3b2ce: 0c f0 brlt .+2 ; 0x3b2d2 3b2d0: 8c cf rjmp .-232 ; 0x3b1ea 3b2d2: 81 2c mov r8, r1 3b2d4: 91 2c mov r9, r1 3b2d6: a1 2c mov r10, r1 3b2d8: e0 e4 ldi r30, 0x40 ; 64 3b2da: be 2e mov r11, r30 3b2dc: 82 e0 ldi r24, 0x02 ; 2 3b2de: e8 16 cp r14, r24 3b2e0: f1 04 cpc r15, r1 3b2e2: 69 f0 breq .+26 ; 0x3b2fe 3b2e4: 60 e0 ldi r22, 0x00 ; 0 3b2e6: 70 e0 ldi r23, 0x00 ; 0 3b2e8: 80 e0 ldi r24, 0x00 ; 0 3b2ea: 90 e8 ldi r25, 0x80 ; 128 3b2ec: 97 01 movw r18, r14 3b2ee: 0f 2c mov r0, r15 3b2f0: 00 0c add r0, r0 3b2f2: 44 0b sbc r20, r20 3b2f4: 55 0b sbc r21, r21 3b2f6: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 3b2fa: 49 01 movw r8, r18 3b2fc: 5a 01 movw r10, r20 3b2fe: 20 e0 ldi r18, 0x00 ; 0 3b300: 60 e0 ldi r22, 0x00 ; 0 3b302: 70 e0 ldi r23, 0x00 ; 0 3b304: cb 01 movw r24, r22 3b306: 27 01 movw r4, r14 3b308: 0f 2c mov r0, r15 3b30a: 00 0c add r0, r0 3b30c: 66 08 sbc r6, r6 3b30e: 77 08 sbc r7, r7 3b310: fe 01 movw r30, r28 3b312: 50 ed ldi r21, 0xD0 ; 208 3b314: 35 2e mov r3, r21 3b316: 31 0e add r3, r17 3b318: 39 e0 ldi r19, 0x09 ; 9 3b31a: 33 15 cp r19, r3 3b31c: 70 f4 brcc .+28 ; 0x3b33a 3b31e: 3f eb ldi r19, 0xBF ; 191 3b320: 31 0f add r19, r17 3b322: 49 ec ldi r20, 0xC9 ; 201 3b324: 34 2e mov r3, r20 3b326: 3a 31 cpi r19, 0x1A ; 26 3b328: 38 f0 brcs .+14 ; 0x3b338 3b32a: 3f e9 ldi r19, 0x9F ; 159 3b32c: 31 0f add r19, r17 3b32e: 3a 31 cpi r19, 0x1A ; 26 3b330: 08 f0 brcs .+2 ; 0x3b334 3b332: 71 cf rjmp .-286 ; 0x3b216 3b334: 39 ea ldi r19, 0xA9 ; 169 3b336: 33 2e mov r3, r19 3b338: 31 0e add r3, r17 3b33a: 3e 14 cp r3, r14 3b33c: 1f 04 cpc r1, r15 3b33e: 0c f0 brlt .+2 ; 0x3b342 3b340: 6a cf rjmp .-300 ; 0x3b216 3b342: 27 fd sbrc r18, 7 3b344: 15 c0 rjmp .+42 ; 0x3b370 3b346: 86 16 cp r8, r22 3b348: 97 06 cpc r9, r23 3b34a: a8 06 cpc r10, r24 3b34c: b9 06 cpc r11, r25 3b34e: 78 f0 brcs .+30 ; 0x3b36e 3b350: a3 01 movw r20, r6 3b352: 92 01 movw r18, r4 3b354: 0f 94 72 dd call 0x3bae4 ; 0x3bae4 <__mulsi3> 3b358: 63 0d add r22, r3 3b35a: 71 1d adc r23, r1 3b35c: 81 1d adc r24, r1 3b35e: 91 1d adc r25, r1 3b360: 61 30 cpi r22, 0x01 ; 1 3b362: 71 05 cpc r23, r1 3b364: 81 05 cpc r24, r1 3b366: 20 e8 ldi r18, 0x80 ; 128 3b368: 92 07 cpc r25, r18 3b36a: 08 f4 brcc .+2 ; 0x3b36e 3b36c: 52 cf rjmp .-348 ; 0x3b212 3b36e: 2f ef ldi r18, 0xFF ; 255 3b370: 21 96 adiw r28, 0x01 ; 1 3b372: 10 81 ld r17, Z 3b374: cd cf rjmp .-102 ; 0x3b310 3b376: 10 33 cpi r17, 0x30 ; 48 3b378: 09 f4 brne .+2 ; 0x3b37c 3b37a: 1e cf rjmp .-452 ; 0x3b1b8 3b37c: 2a e0 ldi r18, 0x0A ; 10 3b37e: e2 2e mov r14, r18 3b380: f1 2c mov r15, r1 3b382: 9c ec ldi r25, 0xCC ; 204 3b384: 89 2e mov r8, r25 3b386: 98 2c mov r9, r8 3b388: a8 2c mov r10, r8 3b38a: 9c e0 ldi r25, 0x0C ; 12 3b38c: b9 2e mov r11, r25 3b38e: b7 cf rjmp .-146 ; 0x3b2fe 0003b390 <__ftoa_engine>: 3b390: 28 30 cpi r18, 0x08 ; 8 3b392: 08 f0 brcs .+2 ; 0x3b396 <__ftoa_engine+0x6> 3b394: 27 e0 ldi r18, 0x07 ; 7 3b396: 33 27 eor r19, r19 3b398: da 01 movw r26, r20 3b39a: 99 0f add r25, r25 3b39c: 31 1d adc r19, r1 3b39e: 87 fd sbrc r24, 7 3b3a0: 91 60 ori r25, 0x01 ; 1 3b3a2: 00 96 adiw r24, 0x00 ; 0 3b3a4: 61 05 cpc r22, r1 3b3a6: 71 05 cpc r23, r1 3b3a8: 39 f4 brne .+14 ; 0x3b3b8 <__ftoa_engine+0x28> 3b3aa: 32 60 ori r19, 0x02 ; 2 3b3ac: 2e 5f subi r18, 0xFE ; 254 3b3ae: 3d 93 st X+, r19 3b3b0: 30 e3 ldi r19, 0x30 ; 48 3b3b2: 2a 95 dec r18 3b3b4: e1 f7 brne .-8 ; 0x3b3ae <__ftoa_engine+0x1e> 3b3b6: 08 95 ret 3b3b8: 9f 3f cpi r25, 0xFF ; 255 3b3ba: 30 f0 brcs .+12 ; 0x3b3c8 <__ftoa_engine+0x38> 3b3bc: 80 38 cpi r24, 0x80 ; 128 3b3be: 71 05 cpc r23, r1 3b3c0: 61 05 cpc r22, r1 3b3c2: 09 f0 breq .+2 ; 0x3b3c6 <__ftoa_engine+0x36> 3b3c4: 3c 5f subi r19, 0xFC ; 252 3b3c6: 3c 5f subi r19, 0xFC ; 252 3b3c8: 3d 93 st X+, r19 3b3ca: 91 30 cpi r25, 0x01 ; 1 3b3cc: 08 f0 brcs .+2 ; 0x3b3d0 <__ftoa_engine+0x40> 3b3ce: 80 68 ori r24, 0x80 ; 128 3b3d0: 91 1d adc r25, r1 3b3d2: df 93 push r29 3b3d4: cf 93 push r28 3b3d6: 1f 93 push r17 3b3d8: 0f 93 push r16 3b3da: ff 92 push r15 3b3dc: ef 92 push r14 3b3de: 19 2f mov r17, r25 3b3e0: 98 7f andi r25, 0xF8 ; 248 3b3e2: 96 95 lsr r25 3b3e4: e9 2f mov r30, r25 3b3e6: 96 95 lsr r25 3b3e8: 96 95 lsr r25 3b3ea: e9 0f add r30, r25 3b3ec: ff 27 eor r31, r31 3b3ee: e6 5c subi r30, 0xC6 ; 198 3b3f0: f7 48 sbci r31, 0x87 ; 135 3b3f2: 99 27 eor r25, r25 3b3f4: 33 27 eor r19, r19 3b3f6: ee 24 eor r14, r14 3b3f8: ff 24 eor r15, r15 3b3fa: a7 01 movw r20, r14 3b3fc: e7 01 movw r28, r14 3b3fe: 05 90 lpm r0, Z+ 3b400: 08 94 sec 3b402: 07 94 ror r0 3b404: 28 f4 brcc .+10 ; 0x3b410 <__ftoa_engine+0x80> 3b406: 36 0f add r19, r22 3b408: e7 1e adc r14, r23 3b40a: f8 1e adc r15, r24 3b40c: 49 1f adc r20, r25 3b40e: 51 1d adc r21, r1 3b410: 66 0f add r22, r22 3b412: 77 1f adc r23, r23 3b414: 88 1f adc r24, r24 3b416: 99 1f adc r25, r25 3b418: 06 94 lsr r0 3b41a: a1 f7 brne .-24 ; 0x3b404 <__ftoa_engine+0x74> 3b41c: 05 90 lpm r0, Z+ 3b41e: 07 94 ror r0 3b420: 28 f4 brcc .+10 ; 0x3b42c <__ftoa_engine+0x9c> 3b422: e7 0e add r14, r23 3b424: f8 1e adc r15, r24 3b426: 49 1f adc r20, r25 3b428: 56 1f adc r21, r22 3b42a: c1 1d adc r28, r1 3b42c: 77 0f add r23, r23 3b42e: 88 1f adc r24, r24 3b430: 99 1f adc r25, r25 3b432: 66 1f adc r22, r22 3b434: 06 94 lsr r0 3b436: a1 f7 brne .-24 ; 0x3b420 <__ftoa_engine+0x90> 3b438: 05 90 lpm r0, Z+ 3b43a: 07 94 ror r0 3b43c: 28 f4 brcc .+10 ; 0x3b448 <__ftoa_engine+0xb8> 3b43e: f8 0e add r15, r24 3b440: 49 1f adc r20, r25 3b442: 56 1f adc r21, r22 3b444: c7 1f adc r28, r23 3b446: d1 1d adc r29, r1 3b448: 88 0f add r24, r24 3b44a: 99 1f adc r25, r25 3b44c: 66 1f adc r22, r22 3b44e: 77 1f adc r23, r23 3b450: 06 94 lsr r0 3b452: a1 f7 brne .-24 ; 0x3b43c <__ftoa_engine+0xac> 3b454: 05 90 lpm r0, Z+ 3b456: 07 94 ror r0 3b458: 20 f4 brcc .+8 ; 0x3b462 <__ftoa_engine+0xd2> 3b45a: 49 0f add r20, r25 3b45c: 56 1f adc r21, r22 3b45e: c7 1f adc r28, r23 3b460: d8 1f adc r29, r24 3b462: 99 0f add r25, r25 3b464: 66 1f adc r22, r22 3b466: 77 1f adc r23, r23 3b468: 88 1f adc r24, r24 3b46a: 06 94 lsr r0 3b46c: a9 f7 brne .-22 ; 0x3b458 <__ftoa_engine+0xc8> 3b46e: 84 91 lpm r24, Z 3b470: 10 95 com r17 3b472: 17 70 andi r17, 0x07 ; 7 3b474: 41 f0 breq .+16 ; 0x3b486 <__ftoa_engine+0xf6> 3b476: d6 95 lsr r29 3b478: c7 95 ror r28 3b47a: 57 95 ror r21 3b47c: 47 95 ror r20 3b47e: f7 94 ror r15 3b480: e7 94 ror r14 3b482: 1a 95 dec r17 3b484: c1 f7 brne .-16 ; 0x3b476 <__ftoa_engine+0xe6> 3b486: e0 ee ldi r30, 0xE0 ; 224 3b488: f7 e7 ldi r31, 0x77 ; 119 3b48a: 68 94 set 3b48c: 15 90 lpm r1, Z+ 3b48e: 15 91 lpm r17, Z+ 3b490: 35 91 lpm r19, Z+ 3b492: 65 91 lpm r22, Z+ 3b494: 95 91 lpm r25, Z+ 3b496: 05 90 lpm r0, Z+ 3b498: 7f e2 ldi r23, 0x2F ; 47 3b49a: 73 95 inc r23 3b49c: e1 18 sub r14, r1 3b49e: f1 0a sbc r15, r17 3b4a0: 43 0b sbc r20, r19 3b4a2: 56 0b sbc r21, r22 3b4a4: c9 0b sbc r28, r25 3b4a6: d0 09 sbc r29, r0 3b4a8: c0 f7 brcc .-16 ; 0x3b49a <__ftoa_engine+0x10a> 3b4aa: e1 0c add r14, r1 3b4ac: f1 1e adc r15, r17 3b4ae: 43 1f adc r20, r19 3b4b0: 56 1f adc r21, r22 3b4b2: c9 1f adc r28, r25 3b4b4: d0 1d adc r29, r0 3b4b6: 7e f4 brtc .+30 ; 0x3b4d6 <__ftoa_engine+0x146> 3b4b8: 70 33 cpi r23, 0x30 ; 48 3b4ba: 11 f4 brne .+4 ; 0x3b4c0 <__ftoa_engine+0x130> 3b4bc: 8a 95 dec r24 3b4be: e6 cf rjmp .-52 ; 0x3b48c <__ftoa_engine+0xfc> 3b4c0: e8 94 clt 3b4c2: 01 50 subi r16, 0x01 ; 1 3b4c4: 30 f0 brcs .+12 ; 0x3b4d2 <__ftoa_engine+0x142> 3b4c6: 08 0f add r16, r24 3b4c8: 0a f4 brpl .+2 ; 0x3b4cc <__ftoa_engine+0x13c> 3b4ca: 00 27 eor r16, r16 3b4cc: 02 17 cp r16, r18 3b4ce: 08 f4 brcc .+2 ; 0x3b4d2 <__ftoa_engine+0x142> 3b4d0: 20 2f mov r18, r16 3b4d2: 23 95 inc r18 3b4d4: 02 2f mov r16, r18 3b4d6: 7a 33 cpi r23, 0x3A ; 58 3b4d8: 28 f0 brcs .+10 ; 0x3b4e4 <__ftoa_engine+0x154> 3b4da: 79 e3 ldi r23, 0x39 ; 57 3b4dc: 7d 93 st X+, r23 3b4de: 2a 95 dec r18 3b4e0: e9 f7 brne .-6 ; 0x3b4dc <__ftoa_engine+0x14c> 3b4e2: 10 c0 rjmp .+32 ; 0x3b504 <__ftoa_engine+0x174> 3b4e4: 7d 93 st X+, r23 3b4e6: 2a 95 dec r18 3b4e8: 89 f6 brne .-94 ; 0x3b48c <__ftoa_engine+0xfc> 3b4ea: 06 94 lsr r0 3b4ec: 97 95 ror r25 3b4ee: 67 95 ror r22 3b4f0: 37 95 ror r19 3b4f2: 17 95 ror r17 3b4f4: 17 94 ror r1 3b4f6: e1 18 sub r14, r1 3b4f8: f1 0a sbc r15, r17 3b4fa: 43 0b sbc r20, r19 3b4fc: 56 0b sbc r21, r22 3b4fe: c9 0b sbc r28, r25 3b500: d0 09 sbc r29, r0 3b502: 98 f0 brcs .+38 ; 0x3b52a <__ftoa_engine+0x19a> 3b504: 23 95 inc r18 3b506: 7e 91 ld r23, -X 3b508: 73 95 inc r23 3b50a: 7a 33 cpi r23, 0x3A ; 58 3b50c: 08 f0 brcs .+2 ; 0x3b510 <__ftoa_engine+0x180> 3b50e: 70 e3 ldi r23, 0x30 ; 48 3b510: 7c 93 st X, r23 3b512: 20 13 cpse r18, r16 3b514: b8 f7 brcc .-18 ; 0x3b504 <__ftoa_engine+0x174> 3b516: 7e 91 ld r23, -X 3b518: 70 61 ori r23, 0x10 ; 16 3b51a: 7d 93 st X+, r23 3b51c: 30 f0 brcs .+12 ; 0x3b52a <__ftoa_engine+0x19a> 3b51e: 83 95 inc r24 3b520: 71 e3 ldi r23, 0x31 ; 49 3b522: 7d 93 st X+, r23 3b524: 70 e3 ldi r23, 0x30 ; 48 3b526: 2a 95 dec r18 3b528: e1 f7 brne .-8 ; 0x3b522 <__ftoa_engine+0x192> 3b52a: 11 24 eor r1, r1 3b52c: ef 90 pop r14 3b52e: ff 90 pop r15 3b530: 0f 91 pop r16 3b532: 1f 91 pop r17 3b534: cf 91 pop r28 3b536: df 91 pop r29 3b538: 99 27 eor r25, r25 3b53a: 87 fd sbrc r24, 7 3b53c: 90 95 com r25 3b53e: 08 95 ret 0003b540 : 3b540: 91 11 cpse r25, r1 3b542: 0d 94 fc dc jmp 0x3b9f8 ; 0x3b9f8 <__ctype_isfalse> 3b546: 80 32 cpi r24, 0x20 ; 32 3b548: 19 f0 breq .+6 ; 0x3b550 3b54a: 89 50 subi r24, 0x09 ; 9 3b54c: 85 50 subi r24, 0x05 ; 5 3b54e: c8 f7 brcc .-14 ; 0x3b542 3b550: 08 95 ret 0003b552 : 3b552: fb 01 movw r30, r22 3b554: dc 01 movw r26, r24 3b556: 02 c0 rjmp .+4 ; 0x3b55c 3b558: 05 90 lpm r0, Z+ 3b55a: 0d 92 st X+, r0 3b55c: 41 50 subi r20, 0x01 ; 1 3b55e: 50 40 sbci r21, 0x00 ; 0 3b560: d8 f7 brcc .-10 ; 0x3b558 3b562: 08 95 ret 0003b564 : 3b564: fb 01 movw r30, r22 3b566: dc 01 movw r26, r24 3b568: 0d 90 ld r0, X+ 3b56a: 00 20 and r0, r0 3b56c: e9 f7 brne .-6 ; 0x3b568 3b56e: 11 97 sbiw r26, 0x01 ; 1 3b570: 05 90 lpm r0, Z+ 3b572: 0d 92 st X+, r0 3b574: 00 20 and r0, r0 3b576: e1 f7 brne .-8 ; 0x3b570 3b578: 08 95 ret 0003b57a : 3b57a: fb 01 movw r30, r22 3b57c: dc 01 movw r26, r24 3b57e: 8d 91 ld r24, X+ 3b580: 05 90 lpm r0, Z+ 3b582: 80 19 sub r24, r0 3b584: 01 10 cpse r0, r1 3b586: d9 f3 breq .-10 ; 0x3b57e 3b588: 99 0b sbc r25, r25 3b58a: 08 95 ret 0003b58c : 3b58c: fb 01 movw r30, r22 3b58e: dc 01 movw r26, r24 3b590: 05 90 lpm r0, Z+ 3b592: 0d 92 st X+, r0 3b594: 00 20 and r0, r0 3b596: e1 f7 brne .-8 ; 0x3b590 3b598: 08 95 ret 0003b59a <__strlen_P>: 3b59a: fc 01 movw r30, r24 3b59c: 05 90 lpm r0, Z+ 3b59e: 00 20 and r0, r0 3b5a0: e9 f7 brne .-6 ; 0x3b59c <__strlen_P+0x2> 3b5a2: 80 95 com r24 3b5a4: 90 95 com r25 3b5a6: 8e 0f add r24, r30 3b5a8: 9f 1f adc r25, r31 3b5aa: 08 95 ret 0003b5ac : 3b5ac: fb 01 movw r30, r22 3b5ae: dc 01 movw r26, r24 3b5b0: 41 50 subi r20, 0x01 ; 1 3b5b2: 50 40 sbci r21, 0x00 ; 0 3b5b4: 88 f0 brcs .+34 ; 0x3b5d8 3b5b6: 8d 91 ld r24, X+ 3b5b8: 81 34 cpi r24, 0x41 ; 65 3b5ba: 1c f0 brlt .+6 ; 0x3b5c2 3b5bc: 8b 35 cpi r24, 0x5B ; 91 3b5be: 0c f4 brge .+2 ; 0x3b5c2 3b5c0: 80 5e subi r24, 0xE0 ; 224 3b5c2: 65 91 lpm r22, Z+ 3b5c4: 61 34 cpi r22, 0x41 ; 65 3b5c6: 1c f0 brlt .+6 ; 0x3b5ce 3b5c8: 6b 35 cpi r22, 0x5B ; 91 3b5ca: 0c f4 brge .+2 ; 0x3b5ce 3b5cc: 60 5e subi r22, 0xE0 ; 224 3b5ce: 86 1b sub r24, r22 3b5d0: 61 11 cpse r22, r1 3b5d2: 71 f3 breq .-36 ; 0x3b5b0 3b5d4: 99 0b sbc r25, r25 3b5d6: 08 95 ret 3b5d8: 88 1b sub r24, r24 3b5da: fc cf rjmp .-8 ; 0x3b5d4 0003b5dc : 3b5dc: fb 01 movw r30, r22 3b5de: dc 01 movw r26, r24 3b5e0: 41 50 subi r20, 0x01 ; 1 3b5e2: 50 40 sbci r21, 0x00 ; 0 3b5e4: 30 f0 brcs .+12 ; 0x3b5f2 3b5e6: 8d 91 ld r24, X+ 3b5e8: 05 90 lpm r0, Z+ 3b5ea: 80 19 sub r24, r0 3b5ec: 19 f4 brne .+6 ; 0x3b5f4 3b5ee: 00 20 and r0, r0 3b5f0: b9 f7 brne .-18 ; 0x3b5e0 3b5f2: 88 1b sub r24, r24 3b5f4: 99 0b sbc r25, r25 3b5f6: 08 95 ret 0003b5f8 : 3b5f8: fb 01 movw r30, r22 3b5fa: dc 01 movw r26, r24 3b5fc: 41 50 subi r20, 0x01 ; 1 3b5fe: 50 40 sbci r21, 0x00 ; 0 3b600: 48 f0 brcs .+18 ; 0x3b614 3b602: 05 90 lpm r0, Z+ 3b604: 0d 92 st X+, r0 3b606: 00 20 and r0, r0 3b608: c9 f7 brne .-14 ; 0x3b5fc 3b60a: 01 c0 rjmp .+2 ; 0x3b60e 3b60c: 1d 92 st X+, r1 3b60e: 41 50 subi r20, 0x01 ; 1 3b610: 50 40 sbci r21, 0x00 ; 0 3b612: e0 f7 brcc .-8 ; 0x3b60c 3b614: 08 95 ret 0003b616 : 3b616: fc 01 movw r30, r24 3b618: 05 90 lpm r0, Z+ 3b61a: 61 50 subi r22, 0x01 ; 1 3b61c: 70 40 sbci r23, 0x00 ; 0 3b61e: 01 10 cpse r0, r1 3b620: d8 f7 brcc .-10 ; 0x3b618 3b622: 80 95 com r24 3b624: 90 95 com r25 3b626: 8e 0f add r24, r30 3b628: 9f 1f adc r25, r31 3b62a: 08 95 ret 0003b62c : 3b62c: fb 01 movw r30, r22 3b62e: 55 91 lpm r21, Z+ 3b630: 55 23 and r21, r21 3b632: a9 f0 breq .+42 ; 0x3b65e 3b634: bf 01 movw r22, r30 3b636: dc 01 movw r26, r24 3b638: 4d 91 ld r20, X+ 3b63a: 45 17 cp r20, r21 3b63c: 41 11 cpse r20, r1 3b63e: e1 f7 brne .-8 ; 0x3b638 3b640: 59 f4 brne .+22 ; 0x3b658 3b642: cd 01 movw r24, r26 3b644: 05 90 lpm r0, Z+ 3b646: 00 20 and r0, r0 3b648: 49 f0 breq .+18 ; 0x3b65c 3b64a: 4d 91 ld r20, X+ 3b64c: 40 15 cp r20, r0 3b64e: 41 11 cpse r20, r1 3b650: c9 f3 breq .-14 ; 0x3b644 3b652: fb 01 movw r30, r22 3b654: 41 11 cpse r20, r1 3b656: ef cf rjmp .-34 ; 0x3b636 3b658: 81 e0 ldi r24, 0x01 ; 1 3b65a: 90 e0 ldi r25, 0x00 ; 0 3b65c: 01 97 sbiw r24, 0x01 ; 1 3b65e: 08 95 ret 0003b660 : 3b660: fc 01 movw r30, r24 3b662: 61 50 subi r22, 0x01 ; 1 3b664: 70 40 sbci r23, 0x00 ; 0 3b666: 01 90 ld r0, Z+ 3b668: 01 10 cpse r0, r1 3b66a: d8 f7 brcc .-10 ; 0x3b662 3b66c: 80 95 com r24 3b66e: 90 95 com r25 3b670: 8e 0f add r24, r30 3b672: 9f 1f adc r25, r31 3b674: 08 95 ret 0003b676 : 3b676: cf 93 push r28 3b678: df 93 push r29 3b67a: ec 01 movw r28, r24 3b67c: 2b 81 ldd r18, Y+3 ; 0x03 3b67e: 20 ff sbrs r18, 0 3b680: 1a c0 rjmp .+52 ; 0x3b6b6 3b682: 26 ff sbrs r18, 6 3b684: 0c c0 rjmp .+24 ; 0x3b69e 3b686: 2f 7b andi r18, 0xBF ; 191 3b688: 2b 83 std Y+3, r18 ; 0x03 3b68a: 8e 81 ldd r24, Y+6 ; 0x06 3b68c: 9f 81 ldd r25, Y+7 ; 0x07 3b68e: 01 96 adiw r24, 0x01 ; 1 3b690: 9f 83 std Y+7, r25 ; 0x07 3b692: 8e 83 std Y+6, r24 ; 0x06 3b694: 8a 81 ldd r24, Y+2 ; 0x02 3b696: 90 e0 ldi r25, 0x00 ; 0 3b698: df 91 pop r29 3b69a: cf 91 pop r28 3b69c: 08 95 ret 3b69e: 22 ff sbrs r18, 2 3b6a0: 18 c0 rjmp .+48 ; 0x3b6d2 3b6a2: e8 81 ld r30, Y 3b6a4: f9 81 ldd r31, Y+1 ; 0x01 3b6a6: 80 81 ld r24, Z 3b6a8: 08 2e mov r0, r24 3b6aa: 00 0c add r0, r0 3b6ac: 99 0b sbc r25, r25 3b6ae: 00 97 sbiw r24, 0x00 ; 0 3b6b0: 29 f4 brne .+10 ; 0x3b6bc 3b6b2: 20 62 ori r18, 0x20 ; 32 3b6b4: 2b 83 std Y+3, r18 ; 0x03 3b6b6: 8f ef ldi r24, 0xFF ; 255 3b6b8: 9f ef ldi r25, 0xFF ; 255 3b6ba: ee cf rjmp .-36 ; 0x3b698 3b6bc: 31 96 adiw r30, 0x01 ; 1 3b6be: f9 83 std Y+1, r31 ; 0x01 3b6c0: e8 83 st Y, r30 3b6c2: 2e 81 ldd r18, Y+6 ; 0x06 3b6c4: 3f 81 ldd r19, Y+7 ; 0x07 3b6c6: 2f 5f subi r18, 0xFF ; 255 3b6c8: 3f 4f sbci r19, 0xFF ; 255 3b6ca: 3f 83 std Y+7, r19 ; 0x07 3b6cc: 2e 83 std Y+6, r18 ; 0x06 3b6ce: 99 27 eor r25, r25 3b6d0: e3 cf rjmp .-58 ; 0x3b698 3b6d2: ea 85 ldd r30, Y+10 ; 0x0a 3b6d4: fb 85 ldd r31, Y+11 ; 0x0b 3b6d6: 19 95 eicall 3b6d8: 97 ff sbrs r25, 7 3b6da: f3 cf rjmp .-26 ; 0x3b6c2 3b6dc: 2b 81 ldd r18, Y+3 ; 0x03 3b6de: 01 96 adiw r24, 0x01 ; 1 3b6e0: 21 f0 breq .+8 ; 0x3b6ea 3b6e2: 80 e2 ldi r24, 0x20 ; 32 3b6e4: 82 2b or r24, r18 3b6e6: 8b 83 std Y+3, r24 ; 0x03 3b6e8: e6 cf rjmp .-52 ; 0x3b6b6 3b6ea: 80 e1 ldi r24, 0x10 ; 16 3b6ec: fb cf rjmp .-10 ; 0x3b6e4 0003b6ee : 3b6ee: 0f 93 push r16 3b6f0: 1f 93 push r17 3b6f2: cf 93 push r28 3b6f4: df 93 push r29 3b6f6: 18 2f mov r17, r24 3b6f8: 09 2f mov r16, r25 3b6fa: eb 01 movw r28, r22 3b6fc: 8b 81 ldd r24, Y+3 ; 0x03 3b6fe: 81 fd sbrc r24, 1 3b700: 09 c0 rjmp .+18 ; 0x3b714 3b702: 1f ef ldi r17, 0xFF ; 255 3b704: 0f ef ldi r16, 0xFF ; 255 3b706: 81 2f mov r24, r17 3b708: 90 2f mov r25, r16 3b70a: df 91 pop r29 3b70c: cf 91 pop r28 3b70e: 1f 91 pop r17 3b710: 0f 91 pop r16 3b712: 08 95 ret 3b714: 82 ff sbrs r24, 2 3b716: 14 c0 rjmp .+40 ; 0x3b740 3b718: 2e 81 ldd r18, Y+6 ; 0x06 3b71a: 3f 81 ldd r19, Y+7 ; 0x07 3b71c: 8c 81 ldd r24, Y+4 ; 0x04 3b71e: 9d 81 ldd r25, Y+5 ; 0x05 3b720: 28 17 cp r18, r24 3b722: 39 07 cpc r19, r25 3b724: 3c f4 brge .+14 ; 0x3b734 3b726: e8 81 ld r30, Y 3b728: f9 81 ldd r31, Y+1 ; 0x01 3b72a: cf 01 movw r24, r30 3b72c: 01 96 adiw r24, 0x01 ; 1 3b72e: 99 83 std Y+1, r25 ; 0x01 3b730: 88 83 st Y, r24 3b732: 10 83 st Z, r17 3b734: 8e 81 ldd r24, Y+6 ; 0x06 3b736: 9f 81 ldd r25, Y+7 ; 0x07 3b738: 01 96 adiw r24, 0x01 ; 1 3b73a: 9f 83 std Y+7, r25 ; 0x07 3b73c: 8e 83 std Y+6, r24 ; 0x06 3b73e: e3 cf rjmp .-58 ; 0x3b706 3b740: e8 85 ldd r30, Y+8 ; 0x08 3b742: f9 85 ldd r31, Y+9 ; 0x09 3b744: 81 2f mov r24, r17 3b746: 19 95 eicall 3b748: 89 2b or r24, r25 3b74a: a1 f3 breq .-24 ; 0x3b734 3b74c: da cf rjmp .-76 ; 0x3b702 0003b74e : 3b74e: ef 92 push r14 3b750: ff 92 push r15 3b752: 0f 93 push r16 3b754: 1f 93 push r17 3b756: cf 93 push r28 3b758: df 93 push r29 3b75a: 8c 01 movw r16, r24 3b75c: 7b 01 movw r14, r22 3b75e: db 01 movw r26, r22 3b760: 13 96 adiw r26, 0x03 ; 3 3b762: 8c 91 ld r24, X 3b764: d0 e0 ldi r29, 0x00 ; 0 3b766: c0 e0 ldi r28, 0x00 ; 0 3b768: 81 fd sbrc r24, 1 3b76a: 0f c0 rjmp .+30 ; 0x3b78a 3b76c: cf ef ldi r28, 0xFF ; 255 3b76e: df ef ldi r29, 0xFF ; 255 3b770: 10 c0 rjmp .+32 ; 0x3b792 3b772: d7 01 movw r26, r14 3b774: 18 96 adiw r26, 0x08 ; 8 3b776: ed 91 ld r30, X+ 3b778: fc 91 ld r31, X 3b77a: b7 01 movw r22, r14 3b77c: 19 95 eicall 3b77e: 89 2b or r24, r25 3b780: 11 f0 breq .+4 ; 0x3b786 3b782: cf ef ldi r28, 0xFF ; 255 3b784: df ef ldi r29, 0xFF ; 255 3b786: 0f 5f subi r16, 0xFF ; 255 3b788: 1f 4f sbci r17, 0xFF ; 255 3b78a: f8 01 movw r30, r16 3b78c: 84 91 lpm r24, Z 3b78e: 81 11 cpse r24, r1 3b790: f0 cf rjmp .-32 ; 0x3b772 3b792: ce 01 movw r24, r28 3b794: df 91 pop r29 3b796: cf 91 pop r28 3b798: 1f 91 pop r17 3b79a: 0f 91 pop r16 3b79c: ff 90 pop r15 3b79e: ef 90 pop r14 3b7a0: 08 95 ret 0003b7a2 : 3b7a2: 0f 93 push r16 3b7a4: 1f 93 push r17 3b7a6: cf 93 push r28 3b7a8: df 93 push r29 3b7aa: cd b7 in r28, 0x3d ; 61 3b7ac: de b7 in r29, 0x3e ; 62 3b7ae: ae 01 movw r20, r28 3b7b0: 48 5f subi r20, 0xF8 ; 248 3b7b2: 5f 4f sbci r21, 0xFF ; 255 3b7b4: da 01 movw r26, r20 3b7b6: 6d 91 ld r22, X+ 3b7b8: 7d 91 ld r23, X+ 3b7ba: ad 01 movw r20, r26 3b7bc: 00 e1 ldi r16, 0x10 ; 16 3b7be: 18 e1 ldi r17, 0x18 ; 24 3b7c0: f8 01 movw r30, r16 3b7c2: 82 81 ldd r24, Z+2 ; 0x02 3b7c4: 93 81 ldd r25, Z+3 ; 0x03 3b7c6: dc 01 movw r26, r24 3b7c8: 13 96 adiw r26, 0x03 ; 3 3b7ca: 2c 91 ld r18, X 3b7cc: 13 97 sbiw r26, 0x03 ; 3 3b7ce: 28 60 ori r18, 0x08 ; 8 3b7d0: 13 96 adiw r26, 0x03 ; 3 3b7d2: 2c 93 st X, r18 3b7d4: 0e 94 20 58 call 0xb040 ; 0xb040 3b7d8: d8 01 movw r26, r16 3b7da: 12 96 adiw r26, 0x02 ; 2 3b7dc: ed 91 ld r30, X+ 3b7de: fc 91 ld r31, X 3b7e0: 23 81 ldd r18, Z+3 ; 0x03 3b7e2: 27 7f andi r18, 0xF7 ; 247 3b7e4: 23 83 std Z+3, r18 ; 0x03 3b7e6: df 91 pop r29 3b7e8: cf 91 pop r28 3b7ea: 1f 91 pop r17 3b7ec: 0f 91 pop r16 3b7ee: 08 95 ret 0003b7f0 : 3b7f0: 0f 93 push r16 3b7f2: 1f 93 push r17 3b7f4: cf 93 push r28 3b7f6: df 93 push r29 3b7f8: 8c 01 movw r16, r24 3b7fa: e0 91 12 18 lds r30, 0x1812 ; 0x801812 <__iob+0x2> 3b7fe: f0 91 13 18 lds r31, 0x1813 ; 0x801813 <__iob+0x3> 3b802: 83 81 ldd r24, Z+3 ; 0x03 3b804: d0 e0 ldi r29, 0x00 ; 0 3b806: c0 e0 ldi r28, 0x00 ; 0 3b808: 81 fd sbrc r24, 1 3b80a: 0a c0 rjmp .+20 ; 0x3b820 3b80c: cf ef ldi r28, 0xFF ; 255 3b80e: df ef ldi r29, 0xFF ; 255 3b810: 17 c0 rjmp .+46 ; 0x3b840 3b812: 19 95 eicall 3b814: 89 2b or r24, r25 3b816: 11 f0 breq .+4 ; 0x3b81c 3b818: cf ef ldi r28, 0xFF ; 255 3b81a: df ef ldi r29, 0xFF ; 255 3b81c: 0f 5f subi r16, 0xFF ; 255 3b81e: 1f 4f sbci r17, 0xFF ; 255 3b820: f8 01 movw r30, r16 3b822: 84 91 lpm r24, Z 3b824: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 3b828: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 3b82c: db 01 movw r26, r22 3b82e: 18 96 adiw r26, 0x08 ; 8 3b830: ed 91 ld r30, X+ 3b832: fc 91 ld r31, X 3b834: 81 11 cpse r24, r1 3b836: ed cf rjmp .-38 ; 0x3b812 3b838: 8a e0 ldi r24, 0x0A ; 10 3b83a: 19 95 eicall 3b83c: 89 2b or r24, r25 3b83e: 31 f7 brne .-52 ; 0x3b80c 3b840: ce 01 movw r24, r28 3b842: df 91 pop r29 3b844: cf 91 pop r28 3b846: 1f 91 pop r17 3b848: 0f 91 pop r16 3b84a: 08 95 ret 0003b84c : 3b84c: 0f 93 push r16 3b84e: 1f 93 push r17 3b850: cf 93 push r28 3b852: df 93 push r29 3b854: cd b7 in r28, 0x3d ; 61 3b856: de b7 in r29, 0x3e ; 62 3b858: 2e 97 sbiw r28, 0x0e ; 14 3b85a: 0f b6 in r0, 0x3f ; 63 3b85c: f8 94 cli 3b85e: de bf out 0x3e, r29 ; 62 3b860: 0f be out 0x3f, r0 ; 63 3b862: cd bf out 0x3d, r28 ; 61 3b864: 0e 89 ldd r16, Y+22 ; 0x16 3b866: 1f 89 ldd r17, Y+23 ; 0x17 3b868: 8e e0 ldi r24, 0x0E ; 14 3b86a: 8c 83 std Y+4, r24 ; 0x04 3b86c: 1a 83 std Y+2, r17 ; 0x02 3b86e: 09 83 std Y+1, r16 ; 0x01 3b870: 8f ef ldi r24, 0xFF ; 255 3b872: 9f e7 ldi r25, 0x7F ; 127 3b874: 9e 83 std Y+6, r25 ; 0x06 3b876: 8d 83 std Y+5, r24 ; 0x05 3b878: ae 01 movw r20, r28 3b87a: 46 5e subi r20, 0xE6 ; 230 3b87c: 5f 4f sbci r21, 0xFF ; 255 3b87e: 68 8d ldd r22, Y+24 ; 0x18 3b880: 79 8d ldd r23, Y+25 ; 0x19 3b882: ce 01 movw r24, r28 3b884: 01 96 adiw r24, 0x01 ; 1 3b886: 0e 94 20 58 call 0xb040 ; 0xb040 3b88a: 2f 81 ldd r18, Y+7 ; 0x07 3b88c: 38 85 ldd r19, Y+8 ; 0x08 3b88e: 02 0f add r16, r18 3b890: 13 1f adc r17, r19 3b892: f8 01 movw r30, r16 3b894: 10 82 st Z, r1 3b896: 2e 96 adiw r28, 0x0e ; 14 3b898: 0f b6 in r0, 0x3f ; 63 3b89a: f8 94 cli 3b89c: de bf out 0x3e, r29 ; 62 3b89e: 0f be out 0x3f, r0 ; 63 3b8a0: cd bf out 0x3d, r28 ; 61 3b8a2: df 91 pop r29 3b8a4: cf 91 pop r28 3b8a6: 1f 91 pop r17 3b8a8: 0f 91 pop r16 3b8aa: 08 95 ret 0003b8ac : 3b8ac: cf 93 push r28 3b8ae: df 93 push r29 3b8b0: ec 01 movw r28, r24 3b8b2: 8b 81 ldd r24, Y+3 ; 0x03 3b8b4: 88 60 ori r24, 0x08 ; 8 3b8b6: 8b 83 std Y+3, r24 ; 0x03 3b8b8: ce 01 movw r24, r28 3b8ba: 0e 94 20 58 call 0xb040 ; 0xb040 3b8be: 2b 81 ldd r18, Y+3 ; 0x03 3b8c0: 27 7f andi r18, 0xF7 ; 247 3b8c2: 2b 83 std Y+3, r18 ; 0x03 3b8c4: df 91 pop r29 3b8c6: cf 91 pop r28 3b8c8: 08 95 ret 0003b8ca : 3b8ca: 0f 93 push r16 3b8cc: 1f 93 push r17 3b8ce: cf 93 push r28 3b8d0: df 93 push r29 3b8d2: cd b7 in r28, 0x3d ; 61 3b8d4: de b7 in r29, 0x3e ; 62 3b8d6: 2e 97 sbiw r28, 0x0e ; 14 3b8d8: 0f b6 in r0, 0x3f ; 63 3b8da: f8 94 cli 3b8dc: de bf out 0x3e, r29 ; 62 3b8de: 0f be out 0x3f, r0 ; 63 3b8e0: cd bf out 0x3d, r28 ; 61 3b8e2: 8c 01 movw r16, r24 3b8e4: fa 01 movw r30, r20 3b8e6: 8e e0 ldi r24, 0x0E ; 14 3b8e8: 8c 83 std Y+4, r24 ; 0x04 3b8ea: 1a 83 std Y+2, r17 ; 0x02 3b8ec: 09 83 std Y+1, r16 ; 0x01 3b8ee: 77 ff sbrs r23, 7 3b8f0: 02 c0 rjmp .+4 ; 0x3b8f6 3b8f2: 60 e0 ldi r22, 0x00 ; 0 3b8f4: 70 e8 ldi r23, 0x80 ; 128 3b8f6: 61 50 subi r22, 0x01 ; 1 3b8f8: 71 09 sbc r23, r1 3b8fa: 7e 83 std Y+6, r23 ; 0x06 3b8fc: 6d 83 std Y+5, r22 ; 0x05 3b8fe: a9 01 movw r20, r18 3b900: bf 01 movw r22, r30 3b902: ce 01 movw r24, r28 3b904: 01 96 adiw r24, 0x01 ; 1 3b906: 0e 94 20 58 call 0xb040 ; 0xb040 3b90a: 4d 81 ldd r20, Y+5 ; 0x05 3b90c: 5e 81 ldd r21, Y+6 ; 0x06 3b90e: 57 fd sbrc r21, 7 3b910: 0a c0 rjmp .+20 ; 0x3b926 3b912: 2f 81 ldd r18, Y+7 ; 0x07 3b914: 38 85 ldd r19, Y+8 ; 0x08 3b916: 42 17 cp r20, r18 3b918: 53 07 cpc r21, r19 3b91a: 0c f4 brge .+2 ; 0x3b91e 3b91c: 9a 01 movw r18, r20 3b91e: 02 0f add r16, r18 3b920: 13 1f adc r17, r19 3b922: f8 01 movw r30, r16 3b924: 10 82 st Z, r1 3b926: 2e 96 adiw r28, 0x0e ; 14 3b928: 0f b6 in r0, 0x3f ; 63 3b92a: f8 94 cli 3b92c: de bf out 0x3e, r29 ; 62 3b92e: 0f be out 0x3f, r0 ; 63 3b930: cd bf out 0x3d, r28 ; 61 3b932: df 91 pop r29 3b934: cf 91 pop r28 3b936: 1f 91 pop r17 3b938: 0f 91 pop r16 3b93a: 08 95 ret 0003b93c <__ultoa_invert>: 3b93c: fa 01 movw r30, r20 3b93e: aa 27 eor r26, r26 3b940: 28 30 cpi r18, 0x08 ; 8 3b942: 51 f1 breq .+84 ; 0x3b998 <__ultoa_invert+0x5c> 3b944: 20 31 cpi r18, 0x10 ; 16 3b946: 81 f1 breq .+96 ; 0x3b9a8 <__ultoa_invert+0x6c> 3b948: e8 94 clt 3b94a: 6f 93 push r22 3b94c: 6e 7f andi r22, 0xFE ; 254 3b94e: 6e 5f subi r22, 0xFE ; 254 3b950: 7f 4f sbci r23, 0xFF ; 255 3b952: 8f 4f sbci r24, 0xFF ; 255 3b954: 9f 4f sbci r25, 0xFF ; 255 3b956: af 4f sbci r26, 0xFF ; 255 3b958: b1 e0 ldi r27, 0x01 ; 1 3b95a: 3e d0 rcall .+124 ; 0x3b9d8 <__ultoa_invert+0x9c> 3b95c: b4 e0 ldi r27, 0x04 ; 4 3b95e: 3c d0 rcall .+120 ; 0x3b9d8 <__ultoa_invert+0x9c> 3b960: 67 0f add r22, r23 3b962: 78 1f adc r23, r24 3b964: 89 1f adc r24, r25 3b966: 9a 1f adc r25, r26 3b968: a1 1d adc r26, r1 3b96a: 68 0f add r22, r24 3b96c: 79 1f adc r23, r25 3b96e: 8a 1f adc r24, r26 3b970: 91 1d adc r25, r1 3b972: a1 1d adc r26, r1 3b974: 6a 0f add r22, r26 3b976: 71 1d adc r23, r1 3b978: 81 1d adc r24, r1 3b97a: 91 1d adc r25, r1 3b97c: a1 1d adc r26, r1 3b97e: 20 d0 rcall .+64 ; 0x3b9c0 <__ultoa_invert+0x84> 3b980: 09 f4 brne .+2 ; 0x3b984 <__ultoa_invert+0x48> 3b982: 68 94 set 3b984: 3f 91 pop r19 3b986: 2a e0 ldi r18, 0x0A ; 10 3b988: 26 9f mul r18, r22 3b98a: 11 24 eor r1, r1 3b98c: 30 19 sub r19, r0 3b98e: 30 5d subi r19, 0xD0 ; 208 3b990: 31 93 st Z+, r19 3b992: de f6 brtc .-74 ; 0x3b94a <__ultoa_invert+0xe> 3b994: cf 01 movw r24, r30 3b996: 08 95 ret 3b998: 46 2f mov r20, r22 3b99a: 47 70 andi r20, 0x07 ; 7 3b99c: 40 5d subi r20, 0xD0 ; 208 3b99e: 41 93 st Z+, r20 3b9a0: b3 e0 ldi r27, 0x03 ; 3 3b9a2: 0f d0 rcall .+30 ; 0x3b9c2 <__ultoa_invert+0x86> 3b9a4: c9 f7 brne .-14 ; 0x3b998 <__ultoa_invert+0x5c> 3b9a6: f6 cf rjmp .-20 ; 0x3b994 <__ultoa_invert+0x58> 3b9a8: 46 2f mov r20, r22 3b9aa: 4f 70 andi r20, 0x0F ; 15 3b9ac: 40 5d subi r20, 0xD0 ; 208 3b9ae: 4a 33 cpi r20, 0x3A ; 58 3b9b0: 18 f0 brcs .+6 ; 0x3b9b8 <__ultoa_invert+0x7c> 3b9b2: 49 5d subi r20, 0xD9 ; 217 3b9b4: 31 fd sbrc r19, 1 3b9b6: 40 52 subi r20, 0x20 ; 32 3b9b8: 41 93 st Z+, r20 3b9ba: 02 d0 rcall .+4 ; 0x3b9c0 <__ultoa_invert+0x84> 3b9bc: a9 f7 brne .-22 ; 0x3b9a8 <__ultoa_invert+0x6c> 3b9be: ea cf rjmp .-44 ; 0x3b994 <__ultoa_invert+0x58> 3b9c0: b4 e0 ldi r27, 0x04 ; 4 3b9c2: a6 95 lsr r26 3b9c4: 97 95 ror r25 3b9c6: 87 95 ror r24 3b9c8: 77 95 ror r23 3b9ca: 67 95 ror r22 3b9cc: ba 95 dec r27 3b9ce: c9 f7 brne .-14 ; 0x3b9c2 <__ultoa_invert+0x86> 3b9d0: 00 97 sbiw r24, 0x00 ; 0 3b9d2: 61 05 cpc r22, r1 3b9d4: 71 05 cpc r23, r1 3b9d6: 08 95 ret 3b9d8: 9b 01 movw r18, r22 3b9da: ac 01 movw r20, r24 3b9dc: 0a 2e mov r0, r26 3b9de: 06 94 lsr r0 3b9e0: 57 95 ror r21 3b9e2: 47 95 ror r20 3b9e4: 37 95 ror r19 3b9e6: 27 95 ror r18 3b9e8: ba 95 dec r27 3b9ea: c9 f7 brne .-14 ; 0x3b9de <__ultoa_invert+0xa2> 3b9ec: 62 0f add r22, r18 3b9ee: 73 1f adc r23, r19 3b9f0: 84 1f adc r24, r20 3b9f2: 95 1f adc r25, r21 3b9f4: a0 1d adc r26, r0 3b9f6: 08 95 ret 0003b9f8 <__ctype_isfalse>: 3b9f8: 99 27 eor r25, r25 3b9fa: 88 27 eor r24, r24 0003b9fc <__ctype_istrue>: 3b9fc: 08 95 ret 0003b9fe : 3b9fe: dc 01 movw r26, r24 3ba00: cb 01 movw r24, r22 0003ba02 : 3ba02: fc 01 movw r30, r24 3ba04: f9 99 sbic 0x1f, 1 ; 31 3ba06: fe cf rjmp .-4 ; 0x3ba04 3ba08: 06 c0 rjmp .+12 ; 0x3ba16 3ba0a: f2 bd out 0x22, r31 ; 34 3ba0c: e1 bd out 0x21, r30 ; 33 3ba0e: f8 9a sbi 0x1f, 0 ; 31 3ba10: 31 96 adiw r30, 0x01 ; 1 3ba12: 00 b4 in r0, 0x20 ; 32 3ba14: 0d 92 st X+, r0 3ba16: 41 50 subi r20, 0x01 ; 1 3ba18: 50 40 sbci r21, 0x00 ; 0 3ba1a: b8 f7 brcc .-18 ; 0x3ba0a 3ba1c: 08 95 ret 0003ba1e : 3ba1e: f9 99 sbic 0x1f, 1 ; 31 3ba20: fe cf rjmp .-4 ; 0x3ba1e 3ba22: 92 bd out 0x22, r25 ; 34 3ba24: 81 bd out 0x21, r24 ; 33 3ba26: f8 9a sbi 0x1f, 0 ; 31 3ba28: 99 27 eor r25, r25 3ba2a: 80 b5 in r24, 0x20 ; 32 3ba2c: 08 95 ret 0003ba2e : 3ba2e: a6 e1 ldi r26, 0x16 ; 22 3ba30: b0 e0 ldi r27, 0x00 ; 0 3ba32: 44 e0 ldi r20, 0x04 ; 4 3ba34: 50 e0 ldi r21, 0x00 ; 0 3ba36: 0d 94 01 dd jmp 0x3ba02 ; 0x3ba02 0003ba3a : 3ba3a: a8 e1 ldi r26, 0x18 ; 24 3ba3c: b0 e0 ldi r27, 0x00 ; 0 3ba3e: 42 e0 ldi r20, 0x02 ; 2 3ba40: 50 e0 ldi r21, 0x00 ; 0 3ba42: 0d 94 01 dd jmp 0x3ba02 ; 0x3ba02 0003ba46 : 3ba46: dc 01 movw r26, r24 3ba48: a4 0f add r26, r20 3ba4a: b5 1f adc r27, r21 3ba4c: 41 50 subi r20, 0x01 ; 1 3ba4e: 50 40 sbci r21, 0x00 ; 0 3ba50: 48 f0 brcs .+18 ; 0x3ba64 3ba52: cb 01 movw r24, r22 3ba54: 84 0f add r24, r20 3ba56: 95 1f adc r25, r21 3ba58: 2e 91 ld r18, -X 3ba5a: 0f 94 34 dd call 0x3ba68 ; 0x3ba68 3ba5e: 41 50 subi r20, 0x01 ; 1 3ba60: 50 40 sbci r21, 0x00 ; 0 3ba62: d0 f7 brcc .-12 ; 0x3ba58 3ba64: 08 95 ret 0003ba66 : 3ba66: 26 2f mov r18, r22 0003ba68 : 3ba68: f9 99 sbic 0x1f, 1 ; 31 3ba6a: fe cf rjmp .-4 ; 0x3ba68 3ba6c: 92 bd out 0x22, r25 ; 34 3ba6e: 81 bd out 0x21, r24 ; 33 3ba70: f8 9a sbi 0x1f, 0 ; 31 3ba72: 01 97 sbiw r24, 0x01 ; 1 3ba74: 00 b4 in r0, 0x20 ; 32 3ba76: 02 16 cp r0, r18 3ba78: 39 f0 breq .+14 ; 0x3ba88 3ba7a: 1f ba out 0x1f, r1 ; 31 3ba7c: 20 bd out 0x20, r18 ; 32 3ba7e: 0f b6 in r0, 0x3f ; 63 3ba80: f8 94 cli 3ba82: fa 9a sbi 0x1f, 2 ; 31 3ba84: f9 9a sbi 0x1f, 1 ; 31 3ba86: 0f be out 0x3f, r0 ; 63 3ba88: 08 95 ret 0003ba8a : 3ba8a: 03 96 adiw r24, 0x03 ; 3 3ba8c: 27 2f mov r18, r23 3ba8e: 0f 94 34 dd call 0x3ba68 ; 0x3ba68 3ba92: 0f 94 33 dd call 0x3ba66 ; 0x3ba66 3ba96: 25 2f mov r18, r21 3ba98: 0f 94 34 dd call 0x3ba68 ; 0x3ba68 3ba9c: 24 2f mov r18, r20 3ba9e: 0d 94 34 dd jmp 0x3ba68 ; 0x3ba68 0003baa2 : 3baa2: 01 96 adiw r24, 0x01 ; 1 3baa4: 27 2f mov r18, r23 3baa6: 0f 94 34 dd call 0x3ba68 ; 0x3ba68 3baaa: 0d 94 33 dd jmp 0x3ba66 ; 0x3ba66 0003baae : 3baae: 26 2f mov r18, r22 0003bab0 : 3bab0: f9 99 sbic 0x1f, 1 ; 31 3bab2: fe cf rjmp .-4 ; 0x3bab0 3bab4: 1f ba out 0x1f, r1 ; 31 3bab6: 92 bd out 0x22, r25 ; 34 3bab8: 81 bd out 0x21, r24 ; 33 3baba: 20 bd out 0x20, r18 ; 32 3babc: 0f b6 in r0, 0x3f ; 63 3babe: f8 94 cli 3bac0: fa 9a sbi 0x1f, 2 ; 31 3bac2: f9 9a sbi 0x1f, 1 ; 31 3bac4: 0f be out 0x3f, r0 ; 63 3bac6: 01 96 adiw r24, 0x01 ; 1 3bac8: 08 95 ret 0003baca : 3baca: 24 2f mov r18, r20 3bacc: 0f 94 58 dd call 0x3bab0 ; 0x3bab0 3bad0: 25 2f mov r18, r21 3bad2: 0f 94 58 dd call 0x3bab0 ; 0x3bab0 3bad6: 0d 94 6d dd jmp 0x3bada ; 0x3bada 0003bada : 3bada: 0f 94 57 dd call 0x3baae ; 0x3baae 3bade: 27 2f mov r18, r23 3bae0: 0d 94 58 dd jmp 0x3bab0 ; 0x3bab0 0003bae4 <__mulsi3>: 3bae4: db 01 movw r26, r22 3bae6: 8f 93 push r24 3bae8: 9f 93 push r25 3baea: 0f 94 a4 dd call 0x3bb48 ; 0x3bb48 <__muluhisi3> 3baee: bf 91 pop r27 3baf0: af 91 pop r26 3baf2: a2 9f mul r26, r18 3baf4: 80 0d add r24, r0 3baf6: 91 1d adc r25, r1 3baf8: a3 9f mul r26, r19 3bafa: 90 0d add r25, r0 3bafc: b2 9f mul r27, r18 3bafe: 90 0d add r25, r0 3bb00: 11 24 eor r1, r1 3bb02: 08 95 ret 0003bb04 <__udivmodsi4>: 3bb04: a1 e2 ldi r26, 0x21 ; 33 3bb06: 1a 2e mov r1, r26 3bb08: aa 1b sub r26, r26 3bb0a: bb 1b sub r27, r27 3bb0c: fd 01 movw r30, r26 3bb0e: 0d c0 rjmp .+26 ; 0x3bb2a <__udivmodsi4_ep> 0003bb10 <__udivmodsi4_loop>: 3bb10: aa 1f adc r26, r26 3bb12: bb 1f adc r27, r27 3bb14: ee 1f adc r30, r30 3bb16: ff 1f adc r31, r31 3bb18: a2 17 cp r26, r18 3bb1a: b3 07 cpc r27, r19 3bb1c: e4 07 cpc r30, r20 3bb1e: f5 07 cpc r31, r21 3bb20: 20 f0 brcs .+8 ; 0x3bb2a <__udivmodsi4_ep> 3bb22: a2 1b sub r26, r18 3bb24: b3 0b sbc r27, r19 3bb26: e4 0b sbc r30, r20 3bb28: f5 0b sbc r31, r21 0003bb2a <__udivmodsi4_ep>: 3bb2a: 66 1f adc r22, r22 3bb2c: 77 1f adc r23, r23 3bb2e: 88 1f adc r24, r24 3bb30: 99 1f adc r25, r25 3bb32: 1a 94 dec r1 3bb34: 69 f7 brne .-38 ; 0x3bb10 <__udivmodsi4_loop> 3bb36: 60 95 com r22 3bb38: 70 95 com r23 3bb3a: 80 95 com r24 3bb3c: 90 95 com r25 3bb3e: 9b 01 movw r18, r22 3bb40: ac 01 movw r20, r24 3bb42: bd 01 movw r22, r26 3bb44: cf 01 movw r24, r30 3bb46: 08 95 ret 0003bb48 <__muluhisi3>: 3bb48: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 3bb4c: a5 9f mul r26, r21 3bb4e: 90 0d add r25, r0 3bb50: b4 9f mul r27, r20 3bb52: 90 0d add r25, r0 3bb54: a4 9f mul r26, r20 3bb56: 80 0d add r24, r0 3bb58: 91 1d adc r25, r1 3bb5a: 11 24 eor r1, r1 3bb5c: 08 95 ret 0003bb5e <__umulhisi3>: 3bb5e: a2 9f mul r26, r18 3bb60: b0 01 movw r22, r0 3bb62: b3 9f mul r27, r19 3bb64: c0 01 movw r24, r0 3bb66: a3 9f mul r26, r19 3bb68: 70 0d add r23, r0 3bb6a: 81 1d adc r24, r1 3bb6c: 11 24 eor r1, r1 3bb6e: 91 1d adc r25, r1 3bb70: b2 9f mul r27, r18 3bb72: 70 0d add r23, r0 3bb74: 81 1d adc r24, r1 3bb76: 11 24 eor r1, r1 3bb78: 91 1d adc r25, r1 3bb7a: 08 95 ret 0003bb7c <__udivmodqi4>: 3bb7c: 99 1b sub r25, r25 3bb7e: 79 e0 ldi r23, 0x09 ; 9 3bb80: 04 c0 rjmp .+8 ; 0x3bb8a <__udivmodqi4_ep> 0003bb82 <__udivmodqi4_loop>: 3bb82: 99 1f adc r25, r25 3bb84: 96 17 cp r25, r22 3bb86: 08 f0 brcs .+2 ; 0x3bb8a <__udivmodqi4_ep> 3bb88: 96 1b sub r25, r22 0003bb8a <__udivmodqi4_ep>: 3bb8a: 88 1f adc r24, r24 3bb8c: 7a 95 dec r23 3bb8e: c9 f7 brne .-14 ; 0x3bb82 <__udivmodqi4_loop> 3bb90: 80 95 com r24 3bb92: 08 95 ret 0003bb94 <__divmodqi4>: 3bb94: 87 fb bst r24, 7 3bb96: 08 2e mov r0, r24 3bb98: 06 26 eor r0, r22 3bb9a: 87 fd sbrc r24, 7 3bb9c: 81 95 neg r24 3bb9e: 67 fd sbrc r22, 7 3bba0: 61 95 neg r22 3bba2: 0f 94 be dd call 0x3bb7c ; 0x3bb7c <__udivmodqi4> 3bba6: 0e f4 brtc .+2 ; 0x3bbaa <__divmodqi4_1> 3bba8: 91 95 neg r25 0003bbaa <__divmodqi4_1>: 3bbaa: 07 fc sbrc r0, 7 3bbac: 81 95 neg r24 0003bbae <__divmodqi4_exit>: 3bbae: 08 95 ret 0003bbb0 <__udivmodhi4>: 3bbb0: aa 1b sub r26, r26 3bbb2: bb 1b sub r27, r27 3bbb4: 51 e1 ldi r21, 0x11 ; 17 3bbb6: 07 c0 rjmp .+14 ; 0x3bbc6 <__udivmodhi4_ep> 0003bbb8 <__udivmodhi4_loop>: 3bbb8: aa 1f adc r26, r26 3bbba: bb 1f adc r27, r27 3bbbc: a6 17 cp r26, r22 3bbbe: b7 07 cpc r27, r23 3bbc0: 10 f0 brcs .+4 ; 0x3bbc6 <__udivmodhi4_ep> 3bbc2: a6 1b sub r26, r22 3bbc4: b7 0b sbc r27, r23 0003bbc6 <__udivmodhi4_ep>: 3bbc6: 88 1f adc r24, r24 3bbc8: 99 1f adc r25, r25 3bbca: 5a 95 dec r21 3bbcc: a9 f7 brne .-22 ; 0x3bbb8 <__udivmodhi4_loop> 3bbce: 80 95 com r24 3bbd0: 90 95 com r25 3bbd2: bc 01 movw r22, r24 3bbd4: cd 01 movw r24, r26 3bbd6: 08 95 ret 0003bbd8 <__divmodhi4>: 3bbd8: 97 fb bst r25, 7 3bbda: 07 2e mov r0, r23 3bbdc: 16 f4 brtc .+4 ; 0x3bbe2 <__divmodhi4+0xa> 3bbde: 00 94 com r0 3bbe0: 07 d0 rcall .+14 ; 0x3bbf0 <__divmodhi4_neg1> 3bbe2: 77 fd sbrc r23, 7 3bbe4: 09 d0 rcall .+18 ; 0x3bbf8 <__divmodhi4_neg2> 3bbe6: 0f 94 d8 dd call 0x3bbb0 ; 0x3bbb0 <__udivmodhi4> 3bbea: 07 fc sbrc r0, 7 3bbec: 05 d0 rcall .+10 ; 0x3bbf8 <__divmodhi4_neg2> 3bbee: 3e f4 brtc .+14 ; 0x3bbfe <__divmodhi4_exit> 0003bbf0 <__divmodhi4_neg1>: 3bbf0: 90 95 com r25 3bbf2: 81 95 neg r24 3bbf4: 9f 4f sbci r25, 0xFF ; 255 3bbf6: 08 95 ret 0003bbf8 <__divmodhi4_neg2>: 3bbf8: 70 95 com r23 3bbfa: 61 95 neg r22 3bbfc: 7f 4f sbci r23, 0xFF ; 255 0003bbfe <__divmodhi4_exit>: 3bbfe: 08 95 ret 0003bc00 <__divmodsi4>: 3bc00: 05 2e mov r0, r21 3bc02: 97 fb bst r25, 7 3bc04: 1e f4 brtc .+6 ; 0x3bc0c <__divmodsi4+0xc> 3bc06: 00 94 com r0 3bc08: 0f 94 17 de call 0x3bc2e ; 0x3bc2e <__negsi2> 3bc0c: 57 fd sbrc r21, 7 3bc0e: 07 d0 rcall .+14 ; 0x3bc1e <__divmodsi4_neg2> 3bc10: 0f 94 82 dd call 0x3bb04 ; 0x3bb04 <__udivmodsi4> 3bc14: 07 fc sbrc r0, 7 3bc16: 03 d0 rcall .+6 ; 0x3bc1e <__divmodsi4_neg2> 3bc18: 4e f4 brtc .+18 ; 0x3bc2c <__divmodsi4_exit> 3bc1a: 0d 94 17 de jmp 0x3bc2e ; 0x3bc2e <__negsi2> 0003bc1e <__divmodsi4_neg2>: 3bc1e: 50 95 com r21 3bc20: 40 95 com r20 3bc22: 30 95 com r19 3bc24: 21 95 neg r18 3bc26: 3f 4f sbci r19, 0xFF ; 255 3bc28: 4f 4f sbci r20, 0xFF ; 255 3bc2a: 5f 4f sbci r21, 0xFF ; 255 0003bc2c <__divmodsi4_exit>: 3bc2c: 08 95 ret 0003bc2e <__negsi2>: 3bc2e: 90 95 com r25 3bc30: 80 95 com r24 3bc32: 70 95 com r23 3bc34: 61 95 neg r22 3bc36: 7f 4f sbci r23, 0xFF ; 255 3bc38: 8f 4f sbci r24, 0xFF ; 255 3bc3a: 9f 4f sbci r25, 0xFF ; 255 3bc3c: 08 95 ret 0003bc3e <__tablejump2__>: 3bc3e: ee 0f add r30, r30 3bc40: ff 1f adc r31, r31 3bc42: 88 1f adc r24, r24 3bc44: 8b bf out 0x3b, r24 ; 59 3bc46: 07 90 elpm r0, Z+ 3bc48: f6 91 elpm r31, Z 3bc4a: e0 2d mov r30, r0 3bc4c: 19 94 eijmp 0003bc4e <__mulhisi3>: 3bc4e: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 3bc52: 33 23 and r19, r19 3bc54: 12 f4 brpl .+4 ; 0x3bc5a <__mulhisi3+0xc> 3bc56: 8a 1b sub r24, r26 3bc58: 9b 0b sbc r25, r27 3bc5a: 0d 94 31 de jmp 0x3bc62 ; 0x3bc62 <__usmulhisi3_tail> 0003bc5e <__usmulhisi3>: 3bc5e: 0f 94 af dd call 0x3bb5e ; 0x3bb5e <__umulhisi3> 0003bc62 <__usmulhisi3_tail>: 3bc62: b7 ff sbrs r27, 7 3bc64: 08 95 ret 3bc66: 82 1b sub r24, r18 3bc68: 93 0b sbc r25, r19 3bc6a: 08 95 ret 0003bc6c <__subsf3>: 3bc6c: 50 58 subi r21, 0x80 ; 128 0003bc6e <__addsf3>: 3bc6e: bb 27 eor r27, r27 3bc70: aa 27 eor r26, r26 3bc72: 0f 94 4e de call 0x3bc9c ; 0x3bc9c <__addsf3x> 3bc76: 0d 94 60 d8 jmp 0x3b0c0 ; 0x3b0c0 <__fp_round> 3bc7a: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 <__fp_pscA> 3bc7e: 38 f0 brcs .+14 ; 0x3bc8e <__addsf3+0x20> 3bc80: 0f 94 59 d8 call 0x3b0b2 ; 0x3b0b2 <__fp_pscB> 3bc84: 20 f0 brcs .+8 ; 0x3bc8e <__addsf3+0x20> 3bc86: 39 f4 brne .+14 ; 0x3bc96 <__addsf3+0x28> 3bc88: 9f 3f cpi r25, 0xFF ; 255 3bc8a: 19 f4 brne .+6 ; 0x3bc92 <__addsf3+0x24> 3bc8c: 26 f4 brtc .+8 ; 0x3bc96 <__addsf3+0x28> 3bc8e: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 3bc92: 0e f4 brtc .+2 ; 0x3bc96 <__addsf3+0x28> 3bc94: e0 95 com r30 3bc96: e7 fb bst r30, 7 3bc98: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 0003bc9c <__addsf3x>: 3bc9c: e9 2f mov r30, r25 3bc9e: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__fp_split3> 3bca2: 58 f3 brcs .-42 ; 0x3bc7a <__addsf3+0xc> 3bca4: ba 17 cp r27, r26 3bca6: 62 07 cpc r22, r18 3bca8: 73 07 cpc r23, r19 3bcaa: 84 07 cpc r24, r20 3bcac: 95 07 cpc r25, r21 3bcae: 20 f0 brcs .+8 ; 0x3bcb8 <__addsf3x+0x1c> 3bcb0: 79 f4 brne .+30 ; 0x3bcd0 <__addsf3x+0x34> 3bcb2: a6 f5 brtc .+104 ; 0x3bd1c <__addsf3x+0x80> 3bcb4: 0d 94 93 d8 jmp 0x3b126 ; 0x3b126 <__fp_zero> 3bcb8: 0e f4 brtc .+2 ; 0x3bcbc <__addsf3x+0x20> 3bcba: e0 95 com r30 3bcbc: 0b 2e mov r0, r27 3bcbe: ba 2f mov r27, r26 3bcc0: a0 2d mov r26, r0 3bcc2: 0b 01 movw r0, r22 3bcc4: b9 01 movw r22, r18 3bcc6: 90 01 movw r18, r0 3bcc8: 0c 01 movw r0, r24 3bcca: ca 01 movw r24, r20 3bccc: a0 01 movw r20, r0 3bcce: 11 24 eor r1, r1 3bcd0: ff 27 eor r31, r31 3bcd2: 59 1b sub r21, r25 3bcd4: 99 f0 breq .+38 ; 0x3bcfc <__addsf3x+0x60> 3bcd6: 59 3f cpi r21, 0xF9 ; 249 3bcd8: 50 f4 brcc .+20 ; 0x3bcee <__addsf3x+0x52> 3bcda: 50 3e cpi r21, 0xE0 ; 224 3bcdc: 68 f1 brcs .+90 ; 0x3bd38 <__addsf3x+0x9c> 3bcde: 1a 16 cp r1, r26 3bce0: f0 40 sbci r31, 0x00 ; 0 3bce2: a2 2f mov r26, r18 3bce4: 23 2f mov r18, r19 3bce6: 34 2f mov r19, r20 3bce8: 44 27 eor r20, r20 3bcea: 58 5f subi r21, 0xF8 ; 248 3bcec: f3 cf rjmp .-26 ; 0x3bcd4 <__addsf3x+0x38> 3bcee: 46 95 lsr r20 3bcf0: 37 95 ror r19 3bcf2: 27 95 ror r18 3bcf4: a7 95 ror r26 3bcf6: f0 40 sbci r31, 0x00 ; 0 3bcf8: 53 95 inc r21 3bcfa: c9 f7 brne .-14 ; 0x3bcee <__addsf3x+0x52> 3bcfc: 7e f4 brtc .+30 ; 0x3bd1c <__addsf3x+0x80> 3bcfe: 1f 16 cp r1, r31 3bd00: ba 0b sbc r27, r26 3bd02: 62 0b sbc r22, r18 3bd04: 73 0b sbc r23, r19 3bd06: 84 0b sbc r24, r20 3bd08: ba f0 brmi .+46 ; 0x3bd38 <__addsf3x+0x9c> 3bd0a: 91 50 subi r25, 0x01 ; 1 3bd0c: a1 f0 breq .+40 ; 0x3bd36 <__addsf3x+0x9a> 3bd0e: ff 0f add r31, r31 3bd10: bb 1f adc r27, r27 3bd12: 66 1f adc r22, r22 3bd14: 77 1f adc r23, r23 3bd16: 88 1f adc r24, r24 3bd18: c2 f7 brpl .-16 ; 0x3bd0a <__addsf3x+0x6e> 3bd1a: 0e c0 rjmp .+28 ; 0x3bd38 <__addsf3x+0x9c> 3bd1c: ba 0f add r27, r26 3bd1e: 62 1f adc r22, r18 3bd20: 73 1f adc r23, r19 3bd22: 84 1f adc r24, r20 3bd24: 48 f4 brcc .+18 ; 0x3bd38 <__addsf3x+0x9c> 3bd26: 87 95 ror r24 3bd28: 77 95 ror r23 3bd2a: 67 95 ror r22 3bd2c: b7 95 ror r27 3bd2e: f7 95 ror r31 3bd30: 9e 3f cpi r25, 0xFE ; 254 3bd32: 08 f0 brcs .+2 ; 0x3bd36 <__addsf3x+0x9a> 3bd34: b0 cf rjmp .-160 ; 0x3bc96 <__addsf3+0x28> 3bd36: 93 95 inc r25 3bd38: 88 0f add r24, r24 3bd3a: 08 f0 brcs .+2 ; 0x3bd3e <__addsf3x+0xa2> 3bd3c: 99 27 eor r25, r25 3bd3e: ee 0f add r30, r30 3bd40: 97 95 ror r25 3bd42: 87 95 ror r24 3bd44: 08 95 ret 3bd46: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 <__fp_pscA> 3bd4a: 60 f0 brcs .+24 ; 0x3bd64 <__addsf3x+0xc8> 3bd4c: 80 e8 ldi r24, 0x80 ; 128 3bd4e: 91 e0 ldi r25, 0x01 ; 1 3bd50: 09 f4 brne .+2 ; 0x3bd54 <__addsf3x+0xb8> 3bd52: 9e ef ldi r25, 0xFE ; 254 3bd54: 0f 94 59 d8 call 0x3b0b2 ; 0x3b0b2 <__fp_pscB> 3bd58: 28 f0 brcs .+10 ; 0x3bd64 <__addsf3x+0xc8> 3bd5a: 40 e8 ldi r20, 0x80 ; 128 3bd5c: 51 e0 ldi r21, 0x01 ; 1 3bd5e: 71 f4 brne .+28 ; 0x3bd7c 3bd60: 5e ef ldi r21, 0xFE ; 254 3bd62: 0c c0 rjmp .+24 ; 0x3bd7c 3bd64: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 3bd68: 0d 94 93 d8 jmp 0x3b126 ; 0x3b126 <__fp_zero> 0003bd6c : 3bd6c: e9 2f mov r30, r25 3bd6e: e0 78 andi r30, 0x80 ; 128 3bd70: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__fp_split3> 3bd74: 40 f3 brcs .-48 ; 0x3bd46 <__addsf3x+0xaa> 3bd76: 09 2e mov r0, r25 3bd78: 05 2a or r0, r21 3bd7a: b1 f3 breq .-20 ; 0x3bd68 <__addsf3x+0xcc> 3bd7c: 26 17 cp r18, r22 3bd7e: 37 07 cpc r19, r23 3bd80: 48 07 cpc r20, r24 3bd82: 59 07 cpc r21, r25 3bd84: 38 f0 brcs .+14 ; 0x3bd94 3bd86: 0e 2e mov r0, r30 3bd88: 07 f8 bld r0, 7 3bd8a: e0 25 eor r30, r0 3bd8c: 69 f0 breq .+26 ; 0x3bda8 3bd8e: e0 25 eor r30, r0 3bd90: e0 64 ori r30, 0x40 ; 64 3bd92: 0a c0 rjmp .+20 ; 0x3bda8 3bd94: ef 63 ori r30, 0x3F ; 63 3bd96: 07 f8 bld r0, 7 3bd98: 00 94 com r0 3bd9a: 07 fa bst r0, 7 3bd9c: db 01 movw r26, r22 3bd9e: b9 01 movw r22, r18 3bda0: 9d 01 movw r18, r26 3bda2: dc 01 movw r26, r24 3bda4: ca 01 movw r24, r20 3bda6: ad 01 movw r20, r26 3bda8: ef 93 push r30 3bdaa: 0f 94 4d df call 0x3be9a ; 0x3be9a <__divsf3_pse> 3bdae: 0f 94 60 d8 call 0x3b0c0 ; 0x3b0c0 <__fp_round> 3bdb2: 0f 94 e6 de call 0x3bdcc ; 0x3bdcc 3bdb6: 5f 91 pop r21 3bdb8: 55 23 and r21, r21 3bdba: 39 f0 breq .+14 ; 0x3bdca 3bdbc: 2b ed ldi r18, 0xDB ; 219 3bdbe: 3f e0 ldi r19, 0x0F ; 15 3bdc0: 49 e4 ldi r20, 0x49 ; 73 3bdc2: 50 fd sbrc r21, 0 3bdc4: 49 ec ldi r20, 0xC9 ; 201 3bdc6: 0d 94 37 de jmp 0x3bc6e ; 0x3bc6e <__addsf3> 3bdca: 08 95 ret 0003bdcc : 3bdcc: df 93 push r29 3bdce: dd 27 eor r29, r29 3bdd0: b9 2f mov r27, r25 3bdd2: bf 77 andi r27, 0x7F ; 127 3bdd4: 40 e8 ldi r20, 0x80 ; 128 3bdd6: 5f e3 ldi r21, 0x3F ; 63 3bdd8: 16 16 cp r1, r22 3bdda: 17 06 cpc r1, r23 3bddc: 48 07 cpc r20, r24 3bdde: 5b 07 cpc r21, r27 3bde0: 18 f4 brcc .+6 ; 0x3bde8 3bde2: d9 2f mov r29, r25 3bde4: 0f 94 32 e1 call 0x3c264 ; 0x3c264 3bde8: 9f 93 push r25 3bdea: 8f 93 push r24 3bdec: 7f 93 push r23 3bdee: 6f 93 push r22 3bdf0: 0f 94 d8 d7 call 0x3afb0 ; 0x3afb0 3bdf4: e6 ec ldi r30, 0xC6 ; 198 3bdf6: f2 e7 ldi r31, 0x72 ; 114 3bdf8: 0f 94 42 e0 call 0x3c084 ; 0x3c084 <__fp_powser> 3bdfc: 0f 94 60 d8 call 0x3b0c0 ; 0x3b0c0 <__fp_round> 3be00: 2f 91 pop r18 3be02: 3f 91 pop r19 3be04: 4f 91 pop r20 3be06: 5f 91 pop r21 3be08: 0f 94 ef d7 call 0x3afde ; 0x3afde <__mulsf3x> 3be0c: dd 23 and r29, r29 3be0e: 51 f0 breq .+20 ; 0x3be24 3be10: 90 58 subi r25, 0x80 ; 128 3be12: a2 ea ldi r26, 0xA2 ; 162 3be14: 2a ed ldi r18, 0xDA ; 218 3be16: 3f e0 ldi r19, 0x0F ; 15 3be18: 49 ec ldi r20, 0xC9 ; 201 3be1a: 5f e3 ldi r21, 0x3F ; 63 3be1c: d0 78 andi r29, 0x80 ; 128 3be1e: 5d 27 eor r21, r29 3be20: 0f 94 4e de call 0x3bc9c ; 0x3bc9c <__addsf3x> 3be24: df 91 pop r29 3be26: 0d 94 60 d8 jmp 0x3b0c0 ; 0x3b0c0 <__fp_round> 0003be2a : 3be2a: 0f 94 a8 e0 call 0x3c150 ; 0x3c150 <__fp_trunc> 3be2e: 90 f0 brcs .+36 ; 0x3be54 3be30: 9f 37 cpi r25, 0x7F ; 127 3be32: 48 f4 brcc .+18 ; 0x3be46 3be34: 91 11 cpse r25, r1 3be36: 16 f4 brtc .+4 ; 0x3be3c 3be38: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 3be3c: 60 e0 ldi r22, 0x00 ; 0 3be3e: 70 e0 ldi r23, 0x00 ; 0 3be40: 80 e8 ldi r24, 0x80 ; 128 3be42: 9f e3 ldi r25, 0x3F ; 63 3be44: 08 95 ret 3be46: 26 f0 brts .+8 ; 0x3be50 3be48: 1b 16 cp r1, r27 3be4a: 61 1d adc r22, r1 3be4c: 71 1d adc r23, r1 3be4e: 81 1d adc r24, r1 3be50: 0d 94 19 e0 jmp 0x3c032 ; 0x3c032 <__fp_mintl> 3be54: 0d 94 34 e0 jmp 0x3c068 ; 0x3c068 <__fp_mpack> 0003be58 <__cmpsf2>: 3be58: 0f 94 f5 df call 0x3bfea ; 0x3bfea <__fp_cmp> 3be5c: 08 f4 brcc .+2 ; 0x3be60 <__cmpsf2+0x8> 3be5e: 81 e0 ldi r24, 0x01 ; 1 3be60: 08 95 ret 0003be62 : 3be62: 0f 94 6b e0 call 0x3c0d6 ; 0x3c0d6 <__fp_rempio2> 3be66: e3 95 inc r30 3be68: 0d 94 94 e0 jmp 0x3c128 ; 0x3c128 <__fp_sinus> 0003be6c <__divsf3>: 3be6c: 0f 94 4a df call 0x3be94 ; 0x3be94 <__divsf3x> 3be70: 0d 94 60 d8 jmp 0x3b0c0 ; 0x3b0c0 <__fp_round> 3be74: 0f 94 59 d8 call 0x3b0b2 ; 0x3b0b2 <__fp_pscB> 3be78: 58 f0 brcs .+22 ; 0x3be90 <__divsf3+0x24> 3be7a: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 <__fp_pscA> 3be7e: 40 f0 brcs .+16 ; 0x3be90 <__divsf3+0x24> 3be80: 29 f4 brne .+10 ; 0x3be8c <__divsf3+0x20> 3be82: 5f 3f cpi r21, 0xFF ; 255 3be84: 29 f0 breq .+10 ; 0x3be90 <__divsf3+0x24> 3be86: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 3be8a: 51 11 cpse r21, r1 3be8c: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 3be90: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 0003be94 <__divsf3x>: 3be94: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__fp_split3> 3be98: 68 f3 brcs .-38 ; 0x3be74 <__divsf3+0x8> 0003be9a <__divsf3_pse>: 3be9a: 99 23 and r25, r25 3be9c: b1 f3 breq .-20 ; 0x3be8a <__divsf3+0x1e> 3be9e: 55 23 and r21, r21 3bea0: 91 f3 breq .-28 ; 0x3be86 <__divsf3+0x1a> 3bea2: 95 1b sub r25, r21 3bea4: 55 0b sbc r21, r21 3bea6: bb 27 eor r27, r27 3bea8: aa 27 eor r26, r26 3beaa: 62 17 cp r22, r18 3beac: 73 07 cpc r23, r19 3beae: 84 07 cpc r24, r20 3beb0: 38 f0 brcs .+14 ; 0x3bec0 <__divsf3_pse+0x26> 3beb2: 9f 5f subi r25, 0xFF ; 255 3beb4: 5f 4f sbci r21, 0xFF ; 255 3beb6: 22 0f add r18, r18 3beb8: 33 1f adc r19, r19 3beba: 44 1f adc r20, r20 3bebc: aa 1f adc r26, r26 3bebe: a9 f3 breq .-22 ; 0x3beaa <__divsf3_pse+0x10> 3bec0: 35 d0 rcall .+106 ; 0x3bf2c <__divsf3_pse+0x92> 3bec2: 0e 2e mov r0, r30 3bec4: 3a f0 brmi .+14 ; 0x3bed4 <__divsf3_pse+0x3a> 3bec6: e0 e8 ldi r30, 0x80 ; 128 3bec8: 32 d0 rcall .+100 ; 0x3bf2e <__divsf3_pse+0x94> 3beca: 91 50 subi r25, 0x01 ; 1 3becc: 50 40 sbci r21, 0x00 ; 0 3bece: e6 95 lsr r30 3bed0: 00 1c adc r0, r0 3bed2: ca f7 brpl .-14 ; 0x3bec6 <__divsf3_pse+0x2c> 3bed4: 2b d0 rcall .+86 ; 0x3bf2c <__divsf3_pse+0x92> 3bed6: fe 2f mov r31, r30 3bed8: 29 d0 rcall .+82 ; 0x3bf2c <__divsf3_pse+0x92> 3beda: 66 0f add r22, r22 3bedc: 77 1f adc r23, r23 3bede: 88 1f adc r24, r24 3bee0: bb 1f adc r27, r27 3bee2: 26 17 cp r18, r22 3bee4: 37 07 cpc r19, r23 3bee6: 48 07 cpc r20, r24 3bee8: ab 07 cpc r26, r27 3beea: b0 e8 ldi r27, 0x80 ; 128 3beec: 09 f0 breq .+2 ; 0x3bef0 <__divsf3_pse+0x56> 3beee: bb 0b sbc r27, r27 3bef0: 80 2d mov r24, r0 3bef2: bf 01 movw r22, r30 3bef4: ff 27 eor r31, r31 3bef6: 93 58 subi r25, 0x83 ; 131 3bef8: 5f 4f sbci r21, 0xFF ; 255 3befa: 3a f0 brmi .+14 ; 0x3bf0a <__divsf3_pse+0x70> 3befc: 9e 3f cpi r25, 0xFE ; 254 3befe: 51 05 cpc r21, r1 3bf00: 78 f0 brcs .+30 ; 0x3bf20 <__divsf3_pse+0x86> 3bf02: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 3bf06: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 3bf0a: 5f 3f cpi r21, 0xFF ; 255 3bf0c: e4 f3 brlt .-8 ; 0x3bf06 <__divsf3_pse+0x6c> 3bf0e: 98 3e cpi r25, 0xE8 ; 232 3bf10: d4 f3 brlt .-12 ; 0x3bf06 <__divsf3_pse+0x6c> 3bf12: 86 95 lsr r24 3bf14: 77 95 ror r23 3bf16: 67 95 ror r22 3bf18: b7 95 ror r27 3bf1a: f7 95 ror r31 3bf1c: 9f 5f subi r25, 0xFF ; 255 3bf1e: c9 f7 brne .-14 ; 0x3bf12 <__divsf3_pse+0x78> 3bf20: 88 0f add r24, r24 3bf22: 91 1d adc r25, r1 3bf24: 96 95 lsr r25 3bf26: 87 95 ror r24 3bf28: 97 f9 bld r25, 7 3bf2a: 08 95 ret 3bf2c: e1 e0 ldi r30, 0x01 ; 1 3bf2e: 66 0f add r22, r22 3bf30: 77 1f adc r23, r23 3bf32: 88 1f adc r24, r24 3bf34: bb 1f adc r27, r27 3bf36: 62 17 cp r22, r18 3bf38: 73 07 cpc r23, r19 3bf3a: 84 07 cpc r24, r20 3bf3c: ba 07 cpc r27, r26 3bf3e: 20 f0 brcs .+8 ; 0x3bf48 <__divsf3_pse+0xae> 3bf40: 62 1b sub r22, r18 3bf42: 73 0b sbc r23, r19 3bf44: 84 0b sbc r24, r20 3bf46: ba 0b sbc r27, r26 3bf48: ee 1f adc r30, r30 3bf4a: 88 f7 brcc .-30 ; 0x3bf2e <__divsf3_pse+0x94> 3bf4c: e0 95 com r30 3bf4e: 08 95 ret 0003bf50 <__fixsfsi>: 3bf50: 0f 94 af df call 0x3bf5e ; 0x3bf5e <__fixunssfsi> 3bf54: 68 94 set 3bf56: b1 11 cpse r27, r1 3bf58: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 3bf5c: 08 95 ret 0003bf5e <__fixunssfsi>: 3bf5e: 0f 94 79 d8 call 0x3b0f2 ; 0x3b0f2 <__fp_splitA> 3bf62: 88 f0 brcs .+34 ; 0x3bf86 <__fixunssfsi+0x28> 3bf64: 9f 57 subi r25, 0x7F ; 127 3bf66: 98 f0 brcs .+38 ; 0x3bf8e <__fixunssfsi+0x30> 3bf68: b9 2f mov r27, r25 3bf6a: 99 27 eor r25, r25 3bf6c: b7 51 subi r27, 0x17 ; 23 3bf6e: b0 f0 brcs .+44 ; 0x3bf9c <__fixunssfsi+0x3e> 3bf70: e1 f0 breq .+56 ; 0x3bfaa <__fixunssfsi+0x4c> 3bf72: 66 0f add r22, r22 3bf74: 77 1f adc r23, r23 3bf76: 88 1f adc r24, r24 3bf78: 99 1f adc r25, r25 3bf7a: 1a f0 brmi .+6 ; 0x3bf82 <__fixunssfsi+0x24> 3bf7c: ba 95 dec r27 3bf7e: c9 f7 brne .-14 ; 0x3bf72 <__fixunssfsi+0x14> 3bf80: 14 c0 rjmp .+40 ; 0x3bfaa <__fixunssfsi+0x4c> 3bf82: b1 30 cpi r27, 0x01 ; 1 3bf84: 91 f0 breq .+36 ; 0x3bfaa <__fixunssfsi+0x4c> 3bf86: 0f 94 93 d8 call 0x3b126 ; 0x3b126 <__fp_zero> 3bf8a: b1 e0 ldi r27, 0x01 ; 1 3bf8c: 08 95 ret 3bf8e: 0d 94 93 d8 jmp 0x3b126 ; 0x3b126 <__fp_zero> 3bf92: 67 2f mov r22, r23 3bf94: 78 2f mov r23, r24 3bf96: 88 27 eor r24, r24 3bf98: b8 5f subi r27, 0xF8 ; 248 3bf9a: 39 f0 breq .+14 ; 0x3bfaa <__fixunssfsi+0x4c> 3bf9c: b9 3f cpi r27, 0xF9 ; 249 3bf9e: cc f3 brlt .-14 ; 0x3bf92 <__fixunssfsi+0x34> 3bfa0: 86 95 lsr r24 3bfa2: 77 95 ror r23 3bfa4: 67 95 ror r22 3bfa6: b3 95 inc r27 3bfa8: d9 f7 brne .-10 ; 0x3bfa0 <__fixunssfsi+0x42> 3bfaa: 3e f4 brtc .+14 ; 0x3bfba <__fixunssfsi+0x5c> 3bfac: 90 95 com r25 3bfae: 80 95 com r24 3bfb0: 70 95 com r23 3bfb2: 61 95 neg r22 3bfb4: 7f 4f sbci r23, 0xFF ; 255 3bfb6: 8f 4f sbci r24, 0xFF ; 255 3bfb8: 9f 4f sbci r25, 0xFF ; 255 3bfba: 08 95 ret 0003bfbc : 3bfbc: 0f 94 a8 e0 call 0x3c150 ; 0x3c150 <__fp_trunc> 3bfc0: 90 f0 brcs .+36 ; 0x3bfe6 3bfc2: 9f 37 cpi r25, 0x7F ; 127 3bfc4: 48 f4 brcc .+18 ; 0x3bfd8 3bfc6: 91 11 cpse r25, r1 3bfc8: 16 f0 brts .+4 ; 0x3bfce 3bfca: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 3bfce: 60 e0 ldi r22, 0x00 ; 0 3bfd0: 70 e0 ldi r23, 0x00 ; 0 3bfd2: 80 e8 ldi r24, 0x80 ; 128 3bfd4: 9f eb ldi r25, 0xBF ; 191 3bfd6: 08 95 ret 3bfd8: 26 f4 brtc .+8 ; 0x3bfe2 3bfda: 1b 16 cp r1, r27 3bfdc: 61 1d adc r22, r1 3bfde: 71 1d adc r23, r1 3bfe0: 81 1d adc r24, r1 3bfe2: 0d 94 19 e0 jmp 0x3c032 ; 0x3c032 <__fp_mintl> 3bfe6: 0d 94 34 e0 jmp 0x3c068 ; 0x3c068 <__fp_mpack> 0003bfea <__fp_cmp>: 3bfea: 99 0f add r25, r25 3bfec: 00 08 sbc r0, r0 3bfee: 55 0f add r21, r21 3bff0: aa 0b sbc r26, r26 3bff2: e0 e8 ldi r30, 0x80 ; 128 3bff4: fe ef ldi r31, 0xFE ; 254 3bff6: 16 16 cp r1, r22 3bff8: 17 06 cpc r1, r23 3bffa: e8 07 cpc r30, r24 3bffc: f9 07 cpc r31, r25 3bffe: c0 f0 brcs .+48 ; 0x3c030 <__fp_cmp+0x46> 3c000: 12 16 cp r1, r18 3c002: 13 06 cpc r1, r19 3c004: e4 07 cpc r30, r20 3c006: f5 07 cpc r31, r21 3c008: 98 f0 brcs .+38 ; 0x3c030 <__fp_cmp+0x46> 3c00a: 62 1b sub r22, r18 3c00c: 73 0b sbc r23, r19 3c00e: 84 0b sbc r24, r20 3c010: 95 0b sbc r25, r21 3c012: 39 f4 brne .+14 ; 0x3c022 <__fp_cmp+0x38> 3c014: 0a 26 eor r0, r26 3c016: 61 f0 breq .+24 ; 0x3c030 <__fp_cmp+0x46> 3c018: 23 2b or r18, r19 3c01a: 24 2b or r18, r20 3c01c: 25 2b or r18, r21 3c01e: 21 f4 brne .+8 ; 0x3c028 <__fp_cmp+0x3e> 3c020: 08 95 ret 3c022: 0a 26 eor r0, r26 3c024: 09 f4 brne .+2 ; 0x3c028 <__fp_cmp+0x3e> 3c026: a1 40 sbci r26, 0x01 ; 1 3c028: a6 95 lsr r26 3c02a: 8f ef ldi r24, 0xFF ; 255 3c02c: 81 1d adc r24, r1 3c02e: 81 1d adc r24, r1 3c030: 08 95 ret 0003c032 <__fp_mintl>: 3c032: 88 23 and r24, r24 3c034: 71 f4 brne .+28 ; 0x3c052 <__fp_mintl+0x20> 3c036: 77 23 and r23, r23 3c038: 21 f0 breq .+8 ; 0x3c042 <__fp_mintl+0x10> 3c03a: 98 50 subi r25, 0x08 ; 8 3c03c: 87 2b or r24, r23 3c03e: 76 2f mov r23, r22 3c040: 07 c0 rjmp .+14 ; 0x3c050 <__fp_mintl+0x1e> 3c042: 66 23 and r22, r22 3c044: 11 f4 brne .+4 ; 0x3c04a <__fp_mintl+0x18> 3c046: 99 27 eor r25, r25 3c048: 0d c0 rjmp .+26 ; 0x3c064 <__fp_mintl+0x32> 3c04a: 90 51 subi r25, 0x10 ; 16 3c04c: 86 2b or r24, r22 3c04e: 70 e0 ldi r23, 0x00 ; 0 3c050: 60 e0 ldi r22, 0x00 ; 0 3c052: 2a f0 brmi .+10 ; 0x3c05e <__fp_mintl+0x2c> 3c054: 9a 95 dec r25 3c056: 66 0f add r22, r22 3c058: 77 1f adc r23, r23 3c05a: 88 1f adc r24, r24 3c05c: da f7 brpl .-10 ; 0x3c054 <__fp_mintl+0x22> 3c05e: 88 0f add r24, r24 3c060: 96 95 lsr r25 3c062: 87 95 ror r24 3c064: 97 f9 bld r25, 7 3c066: 08 95 ret 0003c068 <__fp_mpack>: 3c068: 9f 3f cpi r25, 0xFF ; 255 3c06a: 31 f0 breq .+12 ; 0x3c078 <__fp_mpack_finite+0xc> 0003c06c <__fp_mpack_finite>: 3c06c: 91 50 subi r25, 0x01 ; 1 3c06e: 20 f4 brcc .+8 ; 0x3c078 <__fp_mpack_finite+0xc> 3c070: 87 95 ror r24 3c072: 77 95 ror r23 3c074: 67 95 ror r22 3c076: b7 95 ror r27 3c078: 88 0f add r24, r24 3c07a: 91 1d adc r25, r1 3c07c: 96 95 lsr r25 3c07e: 87 95 ror r24 3c080: 97 f9 bld r25, 7 3c082: 08 95 ret 0003c084 <__fp_powser>: 3c084: df 93 push r29 3c086: cf 93 push r28 3c088: 1f 93 push r17 3c08a: 0f 93 push r16 3c08c: ff 92 push r15 3c08e: ef 92 push r14 3c090: df 92 push r13 3c092: 7b 01 movw r14, r22 3c094: 8c 01 movw r16, r24 3c096: 68 94 set 3c098: 06 c0 rjmp .+12 ; 0x3c0a6 <__fp_powser+0x22> 3c09a: da 2e mov r13, r26 3c09c: ef 01 movw r28, r30 3c09e: 0f 94 ef d7 call 0x3afde ; 0x3afde <__mulsf3x> 3c0a2: fe 01 movw r30, r28 3c0a4: e8 94 clt 3c0a6: a5 91 lpm r26, Z+ 3c0a8: 25 91 lpm r18, Z+ 3c0aa: 35 91 lpm r19, Z+ 3c0ac: 45 91 lpm r20, Z+ 3c0ae: 55 91 lpm r21, Z+ 3c0b0: a6 f3 brts .-24 ; 0x3c09a <__fp_powser+0x16> 3c0b2: ef 01 movw r28, r30 3c0b4: 0f 94 4e de call 0x3bc9c ; 0x3bc9c <__addsf3x> 3c0b8: fe 01 movw r30, r28 3c0ba: 97 01 movw r18, r14 3c0bc: a8 01 movw r20, r16 3c0be: da 94 dec r13 3c0c0: 69 f7 brne .-38 ; 0x3c09c <__fp_powser+0x18> 3c0c2: df 90 pop r13 3c0c4: ef 90 pop r14 3c0c6: ff 90 pop r15 3c0c8: 0f 91 pop r16 3c0ca: 1f 91 pop r17 3c0cc: cf 91 pop r28 3c0ce: df 91 pop r29 3c0d0: 08 95 ret 3c0d2: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 0003c0d6 <__fp_rempio2>: 3c0d6: 0f 94 79 d8 call 0x3b0f2 ; 0x3b0f2 <__fp_splitA> 3c0da: d8 f3 brcs .-10 ; 0x3c0d2 <__fp_powser+0x4e> 3c0dc: e8 94 clt 3c0de: e0 e0 ldi r30, 0x00 ; 0 3c0e0: bb 27 eor r27, r27 3c0e2: 9f 57 subi r25, 0x7F ; 127 3c0e4: f0 f0 brcs .+60 ; 0x3c122 <__fp_rempio2+0x4c> 3c0e6: 2a ed ldi r18, 0xDA ; 218 3c0e8: 3f e0 ldi r19, 0x0F ; 15 3c0ea: 49 ec ldi r20, 0xC9 ; 201 3c0ec: 06 c0 rjmp .+12 ; 0x3c0fa <__fp_rempio2+0x24> 3c0ee: ee 0f add r30, r30 3c0f0: bb 0f add r27, r27 3c0f2: 66 1f adc r22, r22 3c0f4: 77 1f adc r23, r23 3c0f6: 88 1f adc r24, r24 3c0f8: 28 f0 brcs .+10 ; 0x3c104 <__fp_rempio2+0x2e> 3c0fa: b2 3a cpi r27, 0xA2 ; 162 3c0fc: 62 07 cpc r22, r18 3c0fe: 73 07 cpc r23, r19 3c100: 84 07 cpc r24, r20 3c102: 28 f0 brcs .+10 ; 0x3c10e <__fp_rempio2+0x38> 3c104: b2 5a subi r27, 0xA2 ; 162 3c106: 62 0b sbc r22, r18 3c108: 73 0b sbc r23, r19 3c10a: 84 0b sbc r24, r20 3c10c: e3 95 inc r30 3c10e: 9a 95 dec r25 3c110: 72 f7 brpl .-36 ; 0x3c0ee <__fp_rempio2+0x18> 3c112: 80 38 cpi r24, 0x80 ; 128 3c114: 30 f4 brcc .+12 ; 0x3c122 <__fp_rempio2+0x4c> 3c116: 9a 95 dec r25 3c118: bb 0f add r27, r27 3c11a: 66 1f adc r22, r22 3c11c: 77 1f adc r23, r23 3c11e: 88 1f adc r24, r24 3c120: d2 f7 brpl .-12 ; 0x3c116 <__fp_rempio2+0x40> 3c122: 90 48 sbci r25, 0x80 ; 128 3c124: 0d 94 36 e0 jmp 0x3c06c ; 0x3c06c <__fp_mpack_finite> 0003c128 <__fp_sinus>: 3c128: ef 93 push r30 3c12a: e0 ff sbrs r30, 0 3c12c: 07 c0 rjmp .+14 ; 0x3c13c <__fp_sinus+0x14> 3c12e: a2 ea ldi r26, 0xA2 ; 162 3c130: 2a ed ldi r18, 0xDA ; 218 3c132: 3f e0 ldi r19, 0x0F ; 15 3c134: 49 ec ldi r20, 0xC9 ; 201 3c136: 5f eb ldi r21, 0xBF ; 191 3c138: 0f 94 4e de call 0x3bc9c ; 0x3bc9c <__addsf3x> 3c13c: 0f 94 60 d8 call 0x3b0c0 ; 0x3b0c0 <__fp_round> 3c140: 0f 90 pop r0 3c142: 03 94 inc r0 3c144: 01 fc sbrc r0, 1 3c146: 90 58 subi r25, 0x80 ; 128 3c148: e3 ef ldi r30, 0xF3 ; 243 3c14a: f2 e7 ldi r31, 0x72 ; 114 3c14c: 0d 94 8b e2 jmp 0x3c516 ; 0x3c516 <__fp_powsodd> 0003c150 <__fp_trunc>: 3c150: 0f 94 79 d8 call 0x3b0f2 ; 0x3b0f2 <__fp_splitA> 3c154: a0 f0 brcs .+40 ; 0x3c17e <__fp_trunc+0x2e> 3c156: be e7 ldi r27, 0x7E ; 126 3c158: b9 17 cp r27, r25 3c15a: 88 f4 brcc .+34 ; 0x3c17e <__fp_trunc+0x2e> 3c15c: bb 27 eor r27, r27 3c15e: 9f 38 cpi r25, 0x8F ; 143 3c160: 60 f4 brcc .+24 ; 0x3c17a <__fp_trunc+0x2a> 3c162: 16 16 cp r1, r22 3c164: b1 1d adc r27, r1 3c166: 67 2f mov r22, r23 3c168: 78 2f mov r23, r24 3c16a: 88 27 eor r24, r24 3c16c: 98 5f subi r25, 0xF8 ; 248 3c16e: f7 cf rjmp .-18 ; 0x3c15e <__fp_trunc+0xe> 3c170: 86 95 lsr r24 3c172: 77 95 ror r23 3c174: 67 95 ror r22 3c176: b1 1d adc r27, r1 3c178: 93 95 inc r25 3c17a: 96 39 cpi r25, 0x96 ; 150 3c17c: c8 f3 brcs .-14 ; 0x3c170 <__fp_trunc+0x20> 3c17e: 08 95 ret 0003c180 <__gesf2>: 3c180: 0f 94 f5 df call 0x3bfea ; 0x3bfea <__fp_cmp> 3c184: 08 f4 brcc .+2 ; 0x3c188 <__gesf2+0x8> 3c186: 8f ef ldi r24, 0xFF ; 255 3c188: 08 95 ret 3c18a: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 <__fp_pscA> 3c18e: 29 f0 breq .+10 ; 0x3c19a <__gesf2+0x1a> 3c190: 0f 94 59 d8 call 0x3b0b2 ; 0x3b0b2 <__fp_pscB> 3c194: 11 f0 breq .+4 ; 0x3c19a <__gesf2+0x1a> 3c196: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 3c19a: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 3c19e: b9 01 movw r22, r18 3c1a0: ca 01 movw r24, r20 3c1a2: 0d 94 34 e0 jmp 0x3c068 ; 0x3c068 <__fp_mpack> 0003c1a6 : 3c1a6: 9f 77 andi r25, 0x7F ; 127 3c1a8: 5f 77 andi r21, 0x7F ; 127 3c1aa: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__fp_split3> 3c1ae: 68 f3 brcs .-38 ; 0x3c18a <__gesf2+0xa> 3c1b0: 99 23 and r25, r25 3c1b2: a9 f3 breq .-22 ; 0x3c19e <__gesf2+0x1e> 3c1b4: 55 23 and r21, r21 3c1b6: a9 f3 breq .-22 ; 0x3c1a2 <__gesf2+0x22> 3c1b8: ff 27 eor r31, r31 3c1ba: 95 17 cp r25, r21 3c1bc: 58 f4 brcc .+22 ; 0x3c1d4 3c1be: e5 2f mov r30, r21 3c1c0: e9 1b sub r30, r25 3c1c2: ed 30 cpi r30, 0x0D ; 13 3c1c4: 60 f7 brcc .-40 ; 0x3c19e <__gesf2+0x1e> 3c1c6: 5e 3b cpi r21, 0xBE ; 190 3c1c8: 10 f0 brcs .+4 ; 0x3c1ce 3c1ca: f1 e4 ldi r31, 0x41 ; 65 3c1cc: 1c c0 rjmp .+56 ; 0x3c206 3c1ce: 90 34 cpi r25, 0x40 ; 64 3c1d0: e0 f4 brcc .+56 ; 0x3c20a 3c1d2: 0a c0 rjmp .+20 ; 0x3c1e8 3c1d4: e9 2f mov r30, r25 3c1d6: e5 1b sub r30, r21 3c1d8: ed 30 cpi r30, 0x0D ; 13 3c1da: 18 f7 brcc .-58 ; 0x3c1a2 <__gesf2+0x22> 3c1dc: 9e 3b cpi r25, 0xBE ; 190 3c1de: 10 f0 brcs .+4 ; 0x3c1e4 3c1e0: f1 e4 ldi r31, 0x41 ; 65 3c1e2: 11 c0 rjmp .+34 ; 0x3c206 3c1e4: 50 34 cpi r21, 0x40 ; 64 3c1e6: 88 f4 brcc .+34 ; 0x3c20a 3c1e8: f9 ea ldi r31, 0xA9 ; 169 3c1ea: 88 23 and r24, r24 3c1ec: 2a f0 brmi .+10 ; 0x3c1f8 3c1ee: 9a 95 dec r25 3c1f0: 66 0f add r22, r22 3c1f2: 77 1f adc r23, r23 3c1f4: 88 1f adc r24, r24 3c1f6: da f7 brpl .-10 ; 0x3c1ee 3c1f8: 44 23 and r20, r20 3c1fa: 2a f0 brmi .+10 ; 0x3c206 3c1fc: 5a 95 dec r21 3c1fe: 22 0f add r18, r18 3c200: 33 1f adc r19, r19 3c202: 44 1f adc r20, r20 3c204: da f7 brpl .-10 ; 0x3c1fc 3c206: 9f 1b sub r25, r31 3c208: 5f 1b sub r21, r31 3c20a: ff 93 push r31 3c20c: 1f 93 push r17 3c20e: 0f 93 push r16 3c210: ff 92 push r15 3c212: ef 92 push r14 3c214: 79 01 movw r14, r18 3c216: 8a 01 movw r16, r20 3c218: bb 27 eor r27, r27 3c21a: ab 2f mov r26, r27 3c21c: 9b 01 movw r18, r22 3c21e: ac 01 movw r20, r24 3c220: 0f 94 f2 d7 call 0x3afe4 ; 0x3afe4 <__mulsf3_pse> 3c224: 97 01 movw r18, r14 3c226: a8 01 movw r20, r16 3c228: bf 93 push r27 3c22a: 7b 01 movw r14, r22 3c22c: 8c 01 movw r16, r24 3c22e: aa 27 eor r26, r26 3c230: ba 2f mov r27, r26 3c232: b9 01 movw r22, r18 3c234: ca 01 movw r24, r20 3c236: 0f 94 f2 d7 call 0x3afe4 ; 0x3afe4 <__mulsf3_pse> 3c23a: af 91 pop r26 3c23c: 97 01 movw r18, r14 3c23e: a8 01 movw r20, r16 3c240: ef 90 pop r14 3c242: ff 90 pop r15 3c244: 0f 91 pop r16 3c246: 1f 91 pop r17 3c248: 0f 94 4e de call 0x3bc9c ; 0x3bc9c <__addsf3x> 3c24c: 0f 94 60 d8 call 0x3b0c0 ; 0x3b0c0 <__fp_round> 3c250: 0f 94 05 e2 call 0x3c40a ; 0x3c40a 3c254: 4f 91 pop r20 3c256: 40 ff sbrs r20, 0 3c258: 08 95 ret 3c25a: 55 27 eor r21, r21 3c25c: 47 fd sbrc r20, 7 3c25e: 50 95 com r21 3c260: 0d 94 3e e1 jmp 0x3c27c ; 0x3c27c 0003c264 : 3c264: 9b 01 movw r18, r22 3c266: ac 01 movw r20, r24 3c268: 60 e0 ldi r22, 0x00 ; 0 3c26a: 70 e0 ldi r23, 0x00 ; 0 3c26c: 80 e8 ldi r24, 0x80 ; 128 3c26e: 9f e3 ldi r25, 0x3F ; 63 3c270: 0d 94 36 df jmp 0x3be6c ; 0x3be6c <__divsf3> 3c274: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 3c278: 0d 94 34 e0 jmp 0x3c068 ; 0x3c068 <__fp_mpack> 0003c27c : 3c27c: 0f 94 79 d8 call 0x3b0f2 ; 0x3b0f2 <__fp_splitA> 3c280: d8 f3 brcs .-10 ; 0x3c278 3c282: 99 23 and r25, r25 3c284: c9 f3 breq .-14 ; 0x3c278 3c286: 94 0f add r25, r20 3c288: 51 1d adc r21, r1 3c28a: a3 f3 brvs .-24 ; 0x3c274 3c28c: 91 50 subi r25, 0x01 ; 1 3c28e: 50 40 sbci r21, 0x00 ; 0 3c290: 94 f0 brlt .+36 ; 0x3c2b6 3c292: 59 f0 breq .+22 ; 0x3c2aa 3c294: 88 23 and r24, r24 3c296: 32 f0 brmi .+12 ; 0x3c2a4 3c298: 66 0f add r22, r22 3c29a: 77 1f adc r23, r23 3c29c: 88 1f adc r24, r24 3c29e: 91 50 subi r25, 0x01 ; 1 3c2a0: 50 40 sbci r21, 0x00 ; 0 3c2a2: c1 f7 brne .-16 ; 0x3c294 3c2a4: 9e 3f cpi r25, 0xFE ; 254 3c2a6: 51 05 cpc r21, r1 3c2a8: 2c f7 brge .-54 ; 0x3c274 3c2aa: 88 0f add r24, r24 3c2ac: 91 1d adc r25, r1 3c2ae: 96 95 lsr r25 3c2b0: 87 95 ror r24 3c2b2: 97 f9 bld r25, 7 3c2b4: 08 95 ret 3c2b6: 5f 3f cpi r21, 0xFF ; 255 3c2b8: ac f0 brlt .+42 ; 0x3c2e4 3c2ba: 98 3e cpi r25, 0xE8 ; 232 3c2bc: 9c f0 brlt .+38 ; 0x3c2e4 3c2be: bb 27 eor r27, r27 3c2c0: 86 95 lsr r24 3c2c2: 77 95 ror r23 3c2c4: 67 95 ror r22 3c2c6: b7 95 ror r27 3c2c8: 08 f4 brcc .+2 ; 0x3c2cc 3c2ca: b1 60 ori r27, 0x01 ; 1 3c2cc: 93 95 inc r25 3c2ce: c1 f7 brne .-16 ; 0x3c2c0 3c2d0: bb 0f add r27, r27 3c2d2: 58 f7 brcc .-42 ; 0x3c2aa 3c2d4: 11 f4 brne .+4 ; 0x3c2da 3c2d6: 60 ff sbrs r22, 0 3c2d8: e8 cf rjmp .-48 ; 0x3c2aa 3c2da: 6f 5f subi r22, 0xFF ; 255 3c2dc: 7f 4f sbci r23, 0xFF ; 255 3c2de: 8f 4f sbci r24, 0xFF ; 255 3c2e0: 9f 4f sbci r25, 0xFF ; 255 3c2e2: e3 cf rjmp .-58 ; 0x3c2aa 3c2e4: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 0003c2e8 : 3c2e8: 0f 94 79 d8 call 0x3b0f2 ; 0x3b0f2 <__fp_splitA> 3c2ec: 58 f1 brcs .+86 ; 0x3c344 3c2ee: 9e 57 subi r25, 0x7E ; 126 3c2f0: 60 f1 brcs .+88 ; 0x3c34a 3c2f2: 98 51 subi r25, 0x18 ; 24 3c2f4: a0 f0 brcs .+40 ; 0x3c31e 3c2f6: e9 f0 breq .+58 ; 0x3c332 3c2f8: 98 30 cpi r25, 0x08 ; 8 3c2fa: 20 f5 brcc .+72 ; 0x3c344 3c2fc: 09 2e mov r0, r25 3c2fe: 99 27 eor r25, r25 3c300: 66 0f add r22, r22 3c302: 77 1f adc r23, r23 3c304: 88 1f adc r24, r24 3c306: 99 1f adc r25, r25 3c308: 0a 94 dec r0 3c30a: d1 f7 brne .-12 ; 0x3c300 3c30c: 12 c0 rjmp .+36 ; 0x3c332 3c30e: 06 2e mov r0, r22 3c310: 67 2f mov r22, r23 3c312: 78 2f mov r23, r24 3c314: 88 27 eor r24, r24 3c316: 98 5f subi r25, 0xF8 ; 248 3c318: 11 f4 brne .+4 ; 0x3c31e 3c31a: 00 0c add r0, r0 3c31c: 07 c0 rjmp .+14 ; 0x3c32c 3c31e: 99 3f cpi r25, 0xF9 ; 249 3c320: b4 f3 brlt .-20 ; 0x3c30e 3c322: 86 95 lsr r24 3c324: 77 95 ror r23 3c326: 67 95 ror r22 3c328: 93 95 inc r25 3c32a: d9 f7 brne .-10 ; 0x3c322 3c32c: 61 1d adc r22, r1 3c32e: 71 1d adc r23, r1 3c330: 81 1d adc r24, r1 3c332: 3e f4 brtc .+14 ; 0x3c342 3c334: 90 95 com r25 3c336: 80 95 com r24 3c338: 70 95 com r23 3c33a: 61 95 neg r22 3c33c: 7f 4f sbci r23, 0xFF ; 255 3c33e: 8f 4f sbci r24, 0xFF ; 255 3c340: 9f 4f sbci r25, 0xFF ; 255 3c342: 08 95 ret 3c344: 68 94 set 3c346: 0d 94 94 d8 jmp 0x3b128 ; 0x3b128 <__fp_szero> 3c34a: 0d 94 93 d8 jmp 0x3b126 ; 0x3b126 <__fp_zero> 0003c34e : 3c34e: fa 01 movw r30, r20 3c350: ee 0f add r30, r30 3c352: ff 1f adc r31, r31 3c354: 30 96 adiw r30, 0x00 ; 0 3c356: 21 05 cpc r18, r1 3c358: 31 05 cpc r19, r1 3c35a: a1 f1 breq .+104 ; 0x3c3c4 3c35c: 61 15 cp r22, r1 3c35e: 71 05 cpc r23, r1 3c360: 61 f4 brne .+24 ; 0x3c37a 3c362: 80 38 cpi r24, 0x80 ; 128 3c364: bf e3 ldi r27, 0x3F ; 63 3c366: 9b 07 cpc r25, r27 3c368: 49 f1 breq .+82 ; 0x3c3bc 3c36a: 68 94 set 3c36c: 90 38 cpi r25, 0x80 ; 128 3c36e: 81 05 cpc r24, r1 3c370: 61 f0 breq .+24 ; 0x3c38a 3c372: 80 38 cpi r24, 0x80 ; 128 3c374: bf ef ldi r27, 0xFF ; 255 3c376: 9b 07 cpc r25, r27 3c378: 41 f0 breq .+16 ; 0x3c38a 3c37a: 99 23 and r25, r25 3c37c: 4a f5 brpl .+82 ; 0x3c3d0 3c37e: ff 3f cpi r31, 0xFF ; 255 3c380: e1 05 cpc r30, r1 3c382: 31 05 cpc r19, r1 3c384: 21 05 cpc r18, r1 3c386: 19 f1 breq .+70 ; 0x3c3ce 3c388: e8 94 clt 3c38a: 08 94 sec 3c38c: e7 95 ror r30 3c38e: d9 01 movw r26, r18 3c390: aa 23 and r26, r26 3c392: 29 f4 brne .+10 ; 0x3c39e 3c394: ab 2f mov r26, r27 3c396: be 2f mov r27, r30 3c398: f8 5f subi r31, 0xF8 ; 248 3c39a: d0 f3 brcs .-12 ; 0x3c390 3c39c: 10 c0 rjmp .+32 ; 0x3c3be 3c39e: ff 5f subi r31, 0xFF ; 255 3c3a0: 70 f4 brcc .+28 ; 0x3c3be 3c3a2: a6 95 lsr r26 3c3a4: e0 f7 brcc .-8 ; 0x3c39e 3c3a6: f7 39 cpi r31, 0x97 ; 151 3c3a8: 50 f0 brcs .+20 ; 0x3c3be 3c3aa: 19 f0 breq .+6 ; 0x3c3b2 3c3ac: ff 3a cpi r31, 0xAF ; 175 3c3ae: 38 f4 brcc .+14 ; 0x3c3be 3c3b0: 9f 77 andi r25, 0x7F ; 127 3c3b2: 9f 93 push r25 3c3b4: 0d d0 rcall .+26 ; 0x3c3d0 3c3b6: 0f 90 pop r0 3c3b8: 07 fc sbrc r0, 7 3c3ba: 90 58 subi r25, 0x80 ; 128 3c3bc: 08 95 ret 3c3be: 46 f0 brts .+16 ; 0x3c3d0 3c3c0: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 3c3c4: 60 e0 ldi r22, 0x00 ; 0 3c3c6: 70 e0 ldi r23, 0x00 ; 0 3c3c8: 80 e8 ldi r24, 0x80 ; 128 3c3ca: 9f e3 ldi r25, 0x3F ; 63 3c3cc: 08 95 ret 3c3ce: 4f e7 ldi r20, 0x7F ; 127 3c3d0: 9f 77 andi r25, 0x7F ; 127 3c3d2: 5f 93 push r21 3c3d4: 4f 93 push r20 3c3d6: 3f 93 push r19 3c3d8: 2f 93 push r18 3c3da: 0f 94 a7 e2 call 0x3c54e ; 0x3c54e 3c3de: 2f 91 pop r18 3c3e0: 3f 91 pop r19 3c3e2: 4f 91 pop r20 3c3e4: 5f 91 pop r21 3c3e6: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3c3ea: 0d 94 52 e2 jmp 0x3c4a4 ; 0x3c4a4 0003c3ee : 3c3ee: 9f 93 push r25 3c3f0: 0f 94 6b e0 call 0x3c0d6 ; 0x3c0d6 <__fp_rempio2> 3c3f4: 0f 90 pop r0 3c3f6: 07 fc sbrc r0, 7 3c3f8: ee 5f subi r30, 0xFE ; 254 3c3fa: 0d 94 94 e0 jmp 0x3c128 ; 0x3c128 <__fp_sinus> 3c3fe: 19 f4 brne .+6 ; 0x3c406 3c400: 16 f4 brtc .+4 ; 0x3c406 3c402: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 3c406: 0d 94 34 e0 jmp 0x3c068 ; 0x3c068 <__fp_mpack> 0003c40a : 3c40a: 0f 94 79 d8 call 0x3b0f2 ; 0x3b0f2 <__fp_splitA> 3c40e: b8 f3 brcs .-18 ; 0x3c3fe 3c410: 99 23 and r25, r25 3c412: c9 f3 breq .-14 ; 0x3c406 3c414: b6 f3 brts .-20 ; 0x3c402 3c416: 9f 57 subi r25, 0x7F ; 127 3c418: 55 0b sbc r21, r21 3c41a: 87 ff sbrs r24, 7 3c41c: 0f 94 84 e2 call 0x3c508 ; 0x3c508 <__fp_norm2> 3c420: 00 24 eor r0, r0 3c422: a0 e6 ldi r26, 0x60 ; 96 3c424: 40 ea ldi r20, 0xA0 ; 160 3c426: 90 01 movw r18, r0 3c428: 80 58 subi r24, 0x80 ; 128 3c42a: 56 95 lsr r21 3c42c: 97 95 ror r25 3c42e: 28 f4 brcc .+10 ; 0x3c43a 3c430: 80 5c subi r24, 0xC0 ; 192 3c432: 66 0f add r22, r22 3c434: 77 1f adc r23, r23 3c436: 88 1f adc r24, r24 3c438: 20 f0 brcs .+8 ; 0x3c442 3c43a: 26 17 cp r18, r22 3c43c: 37 07 cpc r19, r23 3c43e: 48 07 cpc r20, r24 3c440: 30 f4 brcc .+12 ; 0x3c44e 3c442: 62 1b sub r22, r18 3c444: 73 0b sbc r23, r19 3c446: 84 0b sbc r24, r20 3c448: 20 29 or r18, r0 3c44a: 31 29 or r19, r1 3c44c: 4a 2b or r20, r26 3c44e: a6 95 lsr r26 3c450: 17 94 ror r1 3c452: 07 94 ror r0 3c454: 20 25 eor r18, r0 3c456: 31 25 eor r19, r1 3c458: 4a 27 eor r20, r26 3c45a: 58 f7 brcc .-42 ; 0x3c432 3c45c: 66 0f add r22, r22 3c45e: 77 1f adc r23, r23 3c460: 88 1f adc r24, r24 3c462: 20 f0 brcs .+8 ; 0x3c46c 3c464: 26 17 cp r18, r22 3c466: 37 07 cpc r19, r23 3c468: 48 07 cpc r20, r24 3c46a: 30 f4 brcc .+12 ; 0x3c478 3c46c: 62 0b sbc r22, r18 3c46e: 73 0b sbc r23, r19 3c470: 84 0b sbc r24, r20 3c472: 20 0d add r18, r0 3c474: 31 1d adc r19, r1 3c476: 41 1d adc r20, r1 3c478: a0 95 com r26 3c47a: 81 f7 brne .-32 ; 0x3c45c 3c47c: b9 01 movw r22, r18 3c47e: 84 2f mov r24, r20 3c480: 91 58 subi r25, 0x81 ; 129 3c482: 88 0f add r24, r24 3c484: 96 95 lsr r25 3c486: 87 95 ror r24 3c488: 08 95 ret 0003c48a <__unordsf2>: 3c48a: 0f 94 f5 df call 0x3bfea ; 0x3bfea <__fp_cmp> 3c48e: 88 0b sbc r24, r24 3c490: 99 0b sbc r25, r25 3c492: 08 95 ret 3c494: 29 f4 brne .+10 ; 0x3c4a0 <__unordsf2+0x16> 3c496: 16 f0 brts .+4 ; 0x3c49c <__unordsf2+0x12> 3c498: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 3c49c: 0d 94 93 d8 jmp 0x3b126 ; 0x3b126 <__fp_zero> 3c4a0: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 0003c4a4 : 3c4a4: 0f 94 79 d8 call 0x3b0f2 ; 0x3b0f2 <__fp_splitA> 3c4a8: a8 f3 brcs .-22 ; 0x3c494 <__unordsf2+0xa> 3c4aa: 96 38 cpi r25, 0x86 ; 134 3c4ac: a0 f7 brcc .-24 ; 0x3c496 <__unordsf2+0xc> 3c4ae: 07 f8 bld r0, 7 3c4b0: 0f 92 push r0 3c4b2: e8 94 clt 3c4b4: 2b e3 ldi r18, 0x3B ; 59 3c4b6: 3a ea ldi r19, 0xAA ; 170 3c4b8: 48 eb ldi r20, 0xB8 ; 184 3c4ba: 5f e7 ldi r21, 0x7F ; 127 3c4bc: 0f 94 f2 d7 call 0x3afe4 ; 0x3afe4 <__mulsf3_pse> 3c4c0: 0f 92 push r0 3c4c2: 0f 92 push r0 3c4c4: 0f 92 push r0 3c4c6: 4d b7 in r20, 0x3d ; 61 3c4c8: 5e b7 in r21, 0x3e ; 62 3c4ca: 0f 92 push r0 3c4cc: 0f 94 ef e2 call 0x3c5de ; 0x3c5de 3c4d0: e1 e1 ldi r30, 0x11 ; 17 3c4d2: f3 e7 ldi r31, 0x73 ; 115 3c4d4: 0f 94 42 e0 call 0x3c084 ; 0x3c084 <__fp_powser> 3c4d8: 4f 91 pop r20 3c4da: 5f 91 pop r21 3c4dc: ef 91 pop r30 3c4de: ff 91 pop r31 3c4e0: e5 95 asr r30 3c4e2: ee 1f adc r30, r30 3c4e4: ff 1f adc r31, r31 3c4e6: 49 f0 breq .+18 ; 0x3c4fa 3c4e8: fe 57 subi r31, 0x7E ; 126 3c4ea: e0 68 ori r30, 0x80 ; 128 3c4ec: 44 27 eor r20, r20 3c4ee: ee 0f add r30, r30 3c4f0: 44 1f adc r20, r20 3c4f2: fa 95 dec r31 3c4f4: e1 f7 brne .-8 ; 0x3c4ee 3c4f6: 41 95 neg r20 3c4f8: 55 0b sbc r21, r21 3c4fa: 0f 94 3e e1 call 0x3c27c ; 0x3c27c 3c4fe: 0f 90 pop r0 3c500: 07 fe sbrs r0, 7 3c502: 0d 94 32 e1 jmp 0x3c264 ; 0x3c264 3c506: 08 95 ret 0003c508 <__fp_norm2>: 3c508: 91 50 subi r25, 0x01 ; 1 3c50a: 50 40 sbci r21, 0x00 ; 0 3c50c: 66 0f add r22, r22 3c50e: 77 1f adc r23, r23 3c510: 88 1f adc r24, r24 3c512: d2 f7 brpl .-12 ; 0x3c508 <__fp_norm2> 3c514: 08 95 ret 0003c516 <__fp_powsodd>: 3c516: 9f 93 push r25 3c518: 8f 93 push r24 3c51a: 7f 93 push r23 3c51c: 6f 93 push r22 3c51e: ff 93 push r31 3c520: ef 93 push r30 3c522: 9b 01 movw r18, r22 3c524: ac 01 movw r20, r24 3c526: 0f 94 dc d7 call 0x3afb8 ; 0x3afb8 <__mulsf3> 3c52a: ef 91 pop r30 3c52c: ff 91 pop r31 3c52e: 0f 94 42 e0 call 0x3c084 ; 0x3c084 <__fp_powser> 3c532: 2f 91 pop r18 3c534: 3f 91 pop r19 3c536: 4f 91 pop r20 3c538: 5f 91 pop r21 3c53a: 0d 94 dc d7 jmp 0x3afb8 ; 0x3afb8 <__mulsf3> 3c53e: 16 f0 brts .+4 ; 0x3c544 <__fp_powsodd+0x2e> 3c540: 0d 94 34 e0 jmp 0x3c068 ; 0x3c068 <__fp_mpack> 3c544: 0d 94 4f d8 jmp 0x3b09e ; 0x3b09e <__fp_nan> 3c548: 68 94 set 3c54a: 0d 94 49 d8 jmp 0x3b092 ; 0x3b092 <__fp_inf> 0003c54e : 3c54e: 0f 94 79 d8 call 0x3b0f2 ; 0x3b0f2 <__fp_splitA> 3c552: a8 f3 brcs .-22 ; 0x3c53e <__fp_powsodd+0x28> 3c554: 99 23 and r25, r25 3c556: c1 f3 breq .-16 ; 0x3c548 <__fp_powsodd+0x32> 3c558: ae f3 brts .-22 ; 0x3c544 <__fp_powsodd+0x2e> 3c55a: df 93 push r29 3c55c: cf 93 push r28 3c55e: 1f 93 push r17 3c560: 0f 93 push r16 3c562: ff 92 push r15 3c564: c9 2f mov r28, r25 3c566: dd 27 eor r29, r29 3c568: 88 23 and r24, r24 3c56a: 2a f0 brmi .+10 ; 0x3c576 3c56c: 21 97 sbiw r28, 0x01 ; 1 3c56e: 66 0f add r22, r22 3c570: 77 1f adc r23, r23 3c572: 88 1f adc r24, r24 3c574: da f7 brpl .-10 ; 0x3c56c 3c576: 20 e0 ldi r18, 0x00 ; 0 3c578: 30 e0 ldi r19, 0x00 ; 0 3c57a: 40 e8 ldi r20, 0x80 ; 128 3c57c: 5f eb ldi r21, 0xBF ; 191 3c57e: 9f e3 ldi r25, 0x3F ; 63 3c580: 88 39 cpi r24, 0x98 ; 152 3c582: 20 f0 brcs .+8 ; 0x3c58c 3c584: 80 3e cpi r24, 0xE0 ; 224 3c586: 38 f0 brcs .+14 ; 0x3c596 3c588: 21 96 adiw r28, 0x01 ; 1 3c58a: 8f 77 andi r24, 0x7F ; 127 3c58c: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3c590: e9 e3 ldi r30, 0x39 ; 57 3c592: f3 e7 ldi r31, 0x73 ; 115 3c594: 04 c0 rjmp .+8 ; 0x3c59e 3c596: 0f 94 37 de call 0x3bc6e ; 0x3bc6e <__addsf3> 3c59a: e6 e6 ldi r30, 0x66 ; 102 3c59c: f3 e7 ldi r31, 0x73 ; 115 3c59e: 0f 94 42 e0 call 0x3c084 ; 0x3c084 <__fp_powser> 3c5a2: 8b 01 movw r16, r22 3c5a4: be 01 movw r22, r28 3c5a6: ec 01 movw r28, r24 3c5a8: fb 2e mov r15, r27 3c5aa: 6f 57 subi r22, 0x7F ; 127 3c5ac: 71 09 sbc r23, r1 3c5ae: 75 95 asr r23 3c5b0: 77 1f adc r23, r23 3c5b2: 88 0b sbc r24, r24 3c5b4: 99 0b sbc r25, r25 3c5b6: 0f 94 9d d7 call 0x3af3a ; 0x3af3a <__floatsisf> 3c5ba: 28 e1 ldi r18, 0x18 ; 24 3c5bc: 32 e7 ldi r19, 0x72 ; 114 3c5be: 41 e3 ldi r20, 0x31 ; 49 3c5c0: 5f e3 ldi r21, 0x3F ; 63 3c5c2: 0f 94 ef d7 call 0x3afde ; 0x3afde <__mulsf3x> 3c5c6: af 2d mov r26, r15 3c5c8: 98 01 movw r18, r16 3c5ca: ae 01 movw r20, r28 3c5cc: ff 90 pop r15 3c5ce: 0f 91 pop r16 3c5d0: 1f 91 pop r17 3c5d2: cf 91 pop r28 3c5d4: df 91 pop r29 3c5d6: 0f 94 4e de call 0x3bc9c ; 0x3bc9c <__addsf3x> 3c5da: 0d 94 60 d8 jmp 0x3b0c0 ; 0x3b0c0 <__fp_round> 0003c5de : 3c5de: fa 01 movw r30, r20 3c5e0: dc 01 movw r26, r24 3c5e2: aa 0f add r26, r26 3c5e4: bb 1f adc r27, r27 3c5e6: 9b 01 movw r18, r22 3c5e8: ac 01 movw r20, r24 3c5ea: bf 57 subi r27, 0x7F ; 127 3c5ec: 28 f4 brcc .+10 ; 0x3c5f8 3c5ee: 22 27 eor r18, r18 3c5f0: 33 27 eor r19, r19 3c5f2: 44 27 eor r20, r20 3c5f4: 50 78 andi r21, 0x80 ; 128 3c5f6: 20 c0 rjmp .+64 ; 0x3c638 3c5f8: b7 51 subi r27, 0x17 ; 23 3c5fa: 90 f4 brcc .+36 ; 0x3c620 3c5fc: ab 2f mov r26, r27 3c5fe: 00 24 eor r0, r0 3c600: 46 95 lsr r20 3c602: 37 95 ror r19 3c604: 27 95 ror r18 3c606: 01 1c adc r0, r1 3c608: a3 95 inc r26 3c60a: d2 f3 brmi .-12 ; 0x3c600 3c60c: 00 20 and r0, r0 3c60e: 71 f0 breq .+28 ; 0x3c62c 3c610: 22 0f add r18, r18 3c612: 33 1f adc r19, r19 3c614: 44 1f adc r20, r20 3c616: b3 95 inc r27 3c618: da f3 brmi .-10 ; 0x3c610 3c61a: 0e d0 rcall .+28 ; 0x3c638 3c61c: 0d 94 36 de jmp 0x3bc6c ; 0x3bc6c <__subsf3> 3c620: 61 30 cpi r22, 0x01 ; 1 3c622: 71 05 cpc r23, r1 3c624: a0 e8 ldi r26, 0x80 ; 128 3c626: 8a 07 cpc r24, r26 3c628: b9 46 sbci r27, 0x69 ; 105 3c62a: 30 f4 brcc .+12 ; 0x3c638 3c62c: 9b 01 movw r18, r22 3c62e: ac 01 movw r20, r24 3c630: 66 27 eor r22, r22 3c632: 77 27 eor r23, r23 3c634: 88 27 eor r24, r24 3c636: 90 78 andi r25, 0x80 ; 128 3c638: 30 96 adiw r30, 0x00 ; 0 3c63a: 21 f0 breq .+8 ; 0x3c644 3c63c: 20 83 st Z, r18 3c63e: 31 83 std Z+1, r19 ; 0x01 3c640: 42 83 std Z+2, r20 ; 0x02 3c642: 53 83 std Z+3, r21 ; 0x03 3c644: 08 95 ret 0003c646 : 3c646: 91 11 cpse r25, r1 3c648: 08 95 ret 3c64a: 81 54 subi r24, 0x41 ; 65 3c64c: 8a 51 subi r24, 0x1A ; 26 3c64e: 08 f4 brcc .+2 ; 0x3c652 3c650: 80 5e subi r24, 0xE0 ; 224 3c652: 85 5a subi r24, 0xA5 ; 165 3c654: 08 95 ret 0003c656 : 3c656: fb 01 movw r30, r22 3c658: dc 01 movw r26, r24 3c65a: 04 c0 rjmp .+8 ; 0x3c664 3c65c: 8d 91 ld r24, X+ 3c65e: 01 90 ld r0, Z+ 3c660: 80 19 sub r24, r0 3c662: 21 f4 brne .+8 ; 0x3c66c 3c664: 41 50 subi r20, 0x01 ; 1 3c666: 50 40 sbci r21, 0x00 ; 0 3c668: c8 f7 brcc .-14 ; 0x3c65c 3c66a: 88 1b sub r24, r24 3c66c: 99 0b sbc r25, r25 3c66e: 08 95 ret 0003c670 : 3c670: fb 01 movw r30, r22 3c672: dc 01 movw r26, r24 3c674: 02 c0 rjmp .+4 ; 0x3c67a 3c676: 01 90 ld r0, Z+ 3c678: 0d 92 st X+, r0 3c67a: 41 50 subi r20, 0x01 ; 1 3c67c: 50 40 sbci r21, 0x00 ; 0 3c67e: d8 f7 brcc .-10 ; 0x3c676 3c680: 08 95 ret 0003c682 : 3c682: dc 01 movw r26, r24 3c684: 01 c0 rjmp .+2 ; 0x3c688 3c686: 6d 93 st X+, r22 3c688: 41 50 subi r20, 0x01 ; 1 3c68a: 50 40 sbci r21, 0x00 ; 0 3c68c: e0 f7 brcc .-8 ; 0x3c686 3c68e: 08 95 ret 0003c690 : 3c690: fb 01 movw r30, r22 3c692: dc 01 movw r26, r24 3c694: 8d 91 ld r24, X+ 3c696: 81 34 cpi r24, 0x41 ; 65 3c698: 1c f0 brlt .+6 ; 0x3c6a0 3c69a: 8b 35 cpi r24, 0x5B ; 91 3c69c: 0c f4 brge .+2 ; 0x3c6a0 3c69e: 80 5e subi r24, 0xE0 ; 224 3c6a0: 61 91 ld r22, Z+ 3c6a2: 61 34 cpi r22, 0x41 ; 65 3c6a4: 1c f0 brlt .+6 ; 0x3c6ac 3c6a6: 6b 35 cpi r22, 0x5B ; 91 3c6a8: 0c f4 brge .+2 ; 0x3c6ac 3c6aa: 60 5e subi r22, 0xE0 ; 224 3c6ac: 86 1b sub r24, r22 3c6ae: 61 11 cpse r22, r1 3c6b0: 89 f3 breq .-30 ; 0x3c694 3c6b2: 99 0b sbc r25, r25 3c6b4: 08 95 ret 0003c6b6 : 3c6b6: fb 01 movw r30, r22 3c6b8: dc 01 movw r26, r24 3c6ba: 0d 90 ld r0, X+ 3c6bc: 00 20 and r0, r0 3c6be: e9 f7 brne .-6 ; 0x3c6ba 3c6c0: 11 97 sbiw r26, 0x01 ; 1 3c6c2: 01 90 ld r0, Z+ 3c6c4: 0d 92 st X+, r0 3c6c6: 00 20 and r0, r0 3c6c8: e1 f7 brne .-8 ; 0x3c6c2 3c6ca: 08 95 ret 0003c6cc : 3c6cc: fc 01 movw r30, r24 3c6ce: 81 91 ld r24, Z+ 3c6d0: 86 17 cp r24, r22 3c6d2: 21 f0 breq .+8 ; 0x3c6dc 3c6d4: 88 23 and r24, r24 3c6d6: d9 f7 brne .-10 ; 0x3c6ce 3c6d8: 99 27 eor r25, r25 3c6da: 08 95 ret 3c6dc: 31 97 sbiw r30, 0x01 ; 1 3c6de: cf 01 movw r24, r30 3c6e0: 08 95 ret 0003c6e2 : 3c6e2: fb 01 movw r30, r22 3c6e4: dc 01 movw r26, r24 3c6e6: 8d 91 ld r24, X+ 3c6e8: 01 90 ld r0, Z+ 3c6ea: 80 19 sub r24, r0 3c6ec: 01 10 cpse r0, r1 3c6ee: d9 f3 breq .-10 ; 0x3c6e6 3c6f0: 99 0b sbc r25, r25 3c6f2: 08 95 ret 0003c6f4 : 3c6f4: fb 01 movw r30, r22 3c6f6: dc 01 movw r26, r24 3c6f8: 01 90 ld r0, Z+ 3c6fa: 0d 92 st X+, r0 3c6fc: 00 20 and r0, r0 3c6fe: e1 f7 brne .-8 ; 0x3c6f8 3c700: 08 95 ret 0003c702 : 3c702: fb 01 movw r30, r22 3c704: dc 01 movw r26, r24 3c706: 41 50 subi r20, 0x01 ; 1 3c708: 50 40 sbci r21, 0x00 ; 0 3c70a: 30 f0 brcs .+12 ; 0x3c718 3c70c: 8d 91 ld r24, X+ 3c70e: 01 90 ld r0, Z+ 3c710: 80 19 sub r24, r0 3c712: 19 f4 brne .+6 ; 0x3c71a 3c714: 00 20 and r0, r0 3c716: b9 f7 brne .-18 ; 0x3c706 3c718: 88 1b sub r24, r24 3c71a: 99 0b sbc r25, r25 3c71c: 08 95 ret 0003c71e : 3c71e: fb 01 movw r30, r22 3c720: dc 01 movw r26, r24 3c722: 41 50 subi r20, 0x01 ; 1 3c724: 50 40 sbci r21, 0x00 ; 0 3c726: 48 f0 brcs .+18 ; 0x3c73a 3c728: 01 90 ld r0, Z+ 3c72a: 0d 92 st X+, r0 3c72c: 00 20 and r0, r0 3c72e: c9 f7 brne .-14 ; 0x3c722 3c730: 01 c0 rjmp .+2 ; 0x3c734 3c732: 1d 92 st X+, r1 3c734: 41 50 subi r20, 0x01 ; 1 3c736: 50 40 sbci r21, 0x00 ; 0 3c738: e0 f7 brcc .-8 ; 0x3c732 3c73a: 08 95 ret 0003c73c : 3c73c: 0f 93 push r16 3c73e: 1f 93 push r17 3c740: cf 93 push r28 3c742: df 93 push r29 3c744: e0 91 12 18 lds r30, 0x1812 ; 0x801812 <__iob+0x2> 3c748: f0 91 13 18 lds r31, 0x1813 ; 0x801813 <__iob+0x3> 3c74c: 23 81 ldd r18, Z+3 ; 0x03 3c74e: ec 01 movw r28, r24 3c750: 10 e0 ldi r17, 0x00 ; 0 3c752: 00 e0 ldi r16, 0x00 ; 0 3c754: 21 fd sbrc r18, 1 3c756: 08 c0 rjmp .+16 ; 0x3c768 3c758: 0f ef ldi r16, 0xFF ; 255 3c75a: 1f ef ldi r17, 0xFF ; 255 3c75c: 14 c0 rjmp .+40 ; 0x3c786 3c75e: 19 95 eicall 3c760: 89 2b or r24, r25 3c762: 11 f0 breq .+4 ; 0x3c768 3c764: 0f ef ldi r16, 0xFF ; 255 3c766: 1f ef ldi r17, 0xFF ; 255 3c768: 89 91 ld r24, Y+ 3c76a: 60 91 12 18 lds r22, 0x1812 ; 0x801812 <__iob+0x2> 3c76e: 70 91 13 18 lds r23, 0x1813 ; 0x801813 <__iob+0x3> 3c772: db 01 movw r26, r22 3c774: 18 96 adiw r26, 0x08 ; 8 3c776: ed 91 ld r30, X+ 3c778: fc 91 ld r31, X 3c77a: 81 11 cpse r24, r1 3c77c: f0 cf rjmp .-32 ; 0x3c75e 3c77e: 8a e0 ldi r24, 0x0A ; 10 3c780: 19 95 eicall 3c782: 89 2b or r24, r25 3c784: 49 f7 brne .-46 ; 0x3c758 3c786: c8 01 movw r24, r16 3c788: df 91 pop r29 3c78a: cf 91 pop r28 3c78c: 1f 91 pop r17 3c78e: 0f 91 pop r16 3c790: 08 95 ret 0003c792 <__do_global_dtors>: 3c792: 17 e5 ldi r17, 0x57 ; 87 3c794: cc ee ldi r28, 0xEC ; 236 3c796: d7 e5 ldi r29, 0x57 ; 87 3c798: 00 e0 ldi r16, 0x00 ; 0 3c79a: 06 c0 rjmp .+12 ; 0x3c7a8 <__do_global_dtors+0x16> 3c79c: 80 2f mov r24, r16 3c79e: fe 01 movw r30, r28 3c7a0: 0f 94 1f de call 0x3bc3e ; 0x3bc3e <__tablejump2__> 3c7a4: 21 96 adiw r28, 0x01 ; 1 3c7a6: 01 1d adc r16, r1 3c7a8: cd 3e cpi r28, 0xED ; 237 3c7aa: d1 07 cpc r29, r17 3c7ac: 80 e0 ldi r24, 0x00 ; 0 3c7ae: 08 07 cpc r16, r24 3c7b0: a9 f7 brne .-22 ; 0x3c79c <__do_global_dtors+0xa> 3c7b2: f8 94 cli 0003c7b4 <__stop_program>: 3c7b4: ff cf rjmp .-2 ; 0x3c7b4 <__stop_program>