MK3S-E3DREVO_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 54 57 jmp 0xaea8 ; 0xaea8 <__dtors_end> 4: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 8: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> c: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 10: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 14: 0d 94 50 bc jmp 0x378a0 ; 0x378a0 <__vector_5> 18: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 1c: 0c 94 c8 75 jmp 0xeb90 ; 0xeb90 <__vector_7> 20: 0c 94 e5 75 jmp 0xebca ; 0xebca <__vector_8> 24: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 28: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 2c: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 30: 0c 94 20 68 jmp 0xd040 ; 0xd040 <__vector_12> 34: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 38: 0d 94 12 49 jmp 0x29224 ; 0x29224 <__vector_14> 3c: 0d 94 9a 42 jmp 0x28534 ; 0x28534 <__vector_15> 40: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 44: 0d 94 de 59 jmp 0x2b3bc ; 0x2b3bc <__vector_17> 48: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 4c: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 50: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 54: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 58: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 5c: 0c 94 cf 74 jmp 0xe99e ; 0xe99e <__vector_23> 60: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 64: 0d 94 f2 d6 jmp 0x3ade4 ; 0x3ade4 <__vector_25> 68: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 6c: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 70: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 74: 0c 94 da 8e jmp 0x11db4 ; 0x11db4 <__vector_29> 78: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 7c: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 80: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 84: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 88: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 8c: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 90: 0d 94 ae d6 jmp 0x3ad5c ; 0x3ad5c <__vector_36> 94: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 98: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> 9c: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> a0: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> a4: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> a8: 0d 94 30 38 jmp 0x27060 ; 0x27060 <__vector_42> ac: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> b0: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> b4: 0d 94 12 38 jmp 0x27024 ; 0x27024 <__vector_45> b8: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> bc: 0d 94 5c 4e jmp 0x29cb8 ; 0x29cb8 <__vector_47> c0: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> c4: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> c8: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> cc: 0d 94 d2 37 jmp 0x26fa4 ; 0x26fa4 <__vector_51> d0: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> d4: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> d8: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> dc: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__bad_interrupt> e0: 0c 94 85 57 jmp 0xaf0a ; 0xaf0a <__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 00 level.. 000036df : 36df: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36ef: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36ff: 6c 65 76 65 6c 2e 20 50 6c 65 61 73 65 20 72 65 level. Please re 370f: 2d 73 6c 69 63 65 20 74 68 65 20 6d 6f 64 65 6c -slice the model 371f: 20 61 67 61 69 6e 2e 00 again.. 00003727 : 3727: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3737: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 3747: 77 61 72 65 2e 00 ware.. 0000374d : 374d: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 375d: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 376d: 77 61 72 65 2e 20 50 6c 65 61 73 65 20 75 70 64 ware. Please upd 377d: 61 74 65 20 74 68 65 20 66 69 72 6d 77 61 72 65 ate the firmware 378d: 2e 00 .. 0000378f : 378f: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 379f: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37af: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 00 printer type.. 000037bd : 37bd: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 37cd: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37dd: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 50 6c printer type. Pl 37ed: 65 61 73 65 20 72 65 2d 73 6c 69 63 65 20 74 68 ease re-slice th 37fd: 65 20 6d 6f 64 65 6c 20 61 67 61 69 6e 2e 00 e model again.. 0000380c : 380c: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob 381c: 20 74 6f 20 70 72 65 68 65 61 74 20 6e 6f 7a 7a to preheat nozz 382c: 6c 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 2e le and continue. ... 0000383d : 383d: ff ff 50 6c 65 61 73 65 20 70 72 65 73 73 20 74 ..Please press t 384d: 68 65 20 6b 6e 6f 62 20 74 6f 20 75 6e 6c 6f 61 he knob to unloa 385d: 64 20 66 69 6c 61 6d 65 6e 74 00 d filament. 00003868 : 3868: ff ff 61 6e 64 20 70 72 65 73 73 20 74 68 65 20 ..and press the 3878: 6b 6e 6f 62 00 knob. 0000387d : 387d: ff ff 49 6e 73 65 72 74 20 66 69 6c 61 6d 65 6e ..Insert filamen 388d: 74 00 t. 0000388f : 388f: ff ff 43 6f 6c 6f 72 20 6e 6f 74 20 63 6f 72 72 ..Color not corr 389f: 65 63 74 00 ect. 000038a3 : 38a3: ff ff 46 69 6c 61 6d 65 6e 74 20 6e 6f 74 20 6c ..Filament not l 38b3: 6f 61 64 65 64 00 oaded. 000038b9 : 38b9: ff ff 43 68 61 6e 67 65 64 20 63 6f 72 72 65 63 ..Changed correc 38c9: 74 6c 79 00 tly. 000038cd : 38cd: ff ff 4c 6f 61 64 69 6e 67 20 63 6f 6c 6f 72 00 ..Loading color. 000038dd : 38dd: ff ff 43 68 61 6e 67 65 20 73 75 63 63 65 73 73 ..Change success 38ed: 21 00 !. 000038ef : 38ef: ff ff 50 6c 65 61 73 65 20 6f 70 65 6e 20 69 64 ..Please open id 38ff: 6c 65 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 66 ler and remove f 390f: 69 6c 61 6d 65 6e 74 20 6d 61 6e 75 61 6c 6c 79 ilament manually 391f: 2e 00 .. 00003921 : 3921: ff ff 57 61 73 20 66 69 6c 61 6d 65 6e 74 20 75 ..Was filament u 3931: 6e 6c 6f 61 64 20 73 75 63 63 65 73 73 66 75 6c nload successful 3941: 3f 00 ?. 00003943 : 3943: ff ff 50 6c 65 61 73 65 20 75 70 67 72 61 64 65 ..Please upgrade 3953: 2e 00 .. 00003955 : 3955: ff ff 4e 65 77 20 66 69 72 6d 77 61 72 65 20 76 ..New firmware v 3965: 65 72 73 69 6f 6e 20 61 76 61 69 6c 61 62 6c 65 ersion available 3975: 3a 00 :. 00003977 : 3977: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 50 49 ..Waiting for PI 3987: 4e 44 41 20 70 72 6f 62 65 20 63 6f 6f 6c 69 6e NDA probe coolin 3997: 67 00 g. 00003999 : 3999: ff ff 50 6c 65 61 73 65 20 77 61 69 74 00 ..Please wait. 000039a7 : 39a7: ff ff 4e 6f 20 6d 6f 76 65 2e 00 ..No move.. 000039b2 : 39b2: ff ff 57 61 69 74 20 66 6f 72 20 75 73 65 72 2e ..Wait for user. 39c2: 2e 2e 00 ... 000039c5 : 39c5: ff ff 53 74 61 62 6c 65 20 61 6d 62 69 65 6e 74 ..Stable ambient 39d5: 20 74 65 6d 70 65 72 61 74 75 72 65 20 32 31 2d temperature 21- 39e5: 32 36 43 20 69 73 20 6e 65 65 64 65 64 20 61 20 26C is needed a 39f5: 72 69 67 69 64 20 73 74 61 6e 64 20 69 73 20 72 rigid stand is r 3a05: 65 71 75 69 72 65 64 2e 00 equired.. 00003a0e : 3a0e: ff ff 50 6c 65 61 73 65 20 72 75 6e 20 58 59 5a ..Please run XYZ 3a1e: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 69 72 calibration fir 3a2e: 73 74 2e 00 st.. 00003a32 : 3a32: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 00003a3f : 3a3f: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 3a4f: 62 72 2e 00 br.. 00003a53 : 3a53: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 3a63: 6e 00 n. 00003a65 : 3a65: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 3a75: 65 63 74 00 ect. 00003a79 : 3a79: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 3a89: 69 6e 67 00 ing. 00003a8d : 3a8d: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 00003a9b : 3a9b: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 00003aab : 3aab: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 00003ab6 : 3ab6: ff ff 42 65 6c 74 20 74 65 73 74 00 ..Belt test. 00003ac2 : 3ac2: ff ff 57 69 7a 61 72 64 00 ..Wizard. 00003acb : 3acb: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 3adb: 6e 74 00 nt. 00003ade : 3ade: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 00003ae9 : 3ae9: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 3af9: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 3b09: 69 61 74 65 6c 79 00 iately. 00003b10 : 3b10: ff ff 52 65 73 65 74 00 ..Reset. 00003b18 : 3b18: ff ff 52 65 6e 61 6d 65 00 ..Rename. 00003b21 : 3b21: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 3b31: 6c 2e 00 l.. 00003b34 : 3b34: ff ff 53 65 6c 65 63 74 00 ..Select. 00003b3d : 3b3d: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 00003b4c : 3b4c: ff ff 53 75 70 70 6f 72 74 00 ..Support. 00003b56 : 3b56: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 00003b67 : 3b67: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 00003b74 : 3b74: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 00003b81 : 3b81: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 00003b8f : 3b8f: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 3b9f: 65 6e 74 00 ent. 00003ba3 : 3ba3: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 00003bb3 : 3bb3: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 3bc3: 74 00 t. 00003bc5 : 3bc5: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 00003bd6 : 3bd6: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 00003be7 : 3be7: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 00003bf3 : 3bf3: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 00003c00 : 3c00: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00003c10 : 3c10: ff ff 43 6c 65 61 72 20 54 4d 20 65 72 72 6f 72 ..Clear TM error ... 00003c21 : 3c21: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 00003c30 : 3c30: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 00003c3e : 3c3e: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00003c4a : 3c4a: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00003c5a : 3c5a: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00003c64 : 3c64: ff ff 54 75 6e 65 00 ..Tune. 00003c6b : 3c6b: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 00003c7b : 3c7b: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00003c85 : 3c85: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00003c93 : 3c93: ff ff 42 72 69 67 68 74 6e 65 73 73 00 ..Brightness. 00003ca0 : 3ca0: ff ff 41 73 73 69 73 74 00 ..Assist. 00003ca9 : 3ca9: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00003cb2 : 3cb2: ff ff 4f 6e 63 65 00 ..Once. 00003cb9 : 3cb9: ff ff 53 6f 75 6e 64 00 ..Sound. 00003cc1 : 3cc1: ff ff 4c 6f 75 64 00 ..Loud. 00003cc8 : 3cc8: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 00003cd6 : 3cd6: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 3ce6: 74 00 t. 00003ce8 : 3ce8: ff ff 46 6c 6f 77 00 ..Flow. 00003cef : 3cef: ff ff 53 70 65 65 64 00 ..Speed. 00003cf7 : 3cf7: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 00003d07 : 3d07: ff ff 4e 2f 41 00 ..N/A. 00003d0d : 3d0d: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00003d1b : 3d1b: ff ff 4d 65 73 68 00 ..Mesh. 00003d22 : 3d22: ff ff 54 69 6d 65 6f 75 74 00 ..Timeout. 00003d2c : 3d2c: ff ff 4d 6f 64 65 00 ..Mode. 00003d33 : 3d33: ff ff 41 75 74 6f 00 ..Auto. 00003d3a : 3d3a: ff ff 44 69 6d 00 ..Dim. 00003d40 : 3d40: ff ff 42 72 69 67 68 74 00 ..Bright. 00003d49 : 3d49: ff ff 4c 65 76 65 6c 20 44 69 6d 6d 65 64 00 ..Level Dimmed. 00003d58 : 3d58: ff ff 4c 65 76 65 6c 20 42 72 69 67 68 74 00 ..Level Bright. 00003d67 : 3d67: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00003d72 : 3d72: ff ff 59 65 73 00 ..Yes. 00003d78 : 3d78: ff ff 4e 6f 00 ..No. 00003d7d : 3d7d: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 00003d8a : 3d8a: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 00003d9a : 3d9a: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 3daa: 65 2e 00 e.. 00003dad : 3dad: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 00003db8 : 3db8: ff ff 4d 61 69 6e 00 ..Main. 00003dbf : 3dbf: ff ff 49 6e 73 65 72 74 20 74 68 65 20 66 69 6c ..Insert the fil 3dcf: 61 6d 65 6e 74 20 28 64 6f 20 6e 6f 74 20 6c 6f ament (do not lo 3ddf: 61 64 20 69 74 29 20 69 6e 74 6f 20 74 68 65 20 ad it) into the 3def: 65 78 74 72 75 64 65 72 20 61 6e 64 20 74 68 65 extruder and the 3dff: 6e 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 n press the knob 3e0f: 2e 00 .. 00003e11 : 3e11: ff ff 53 65 6e 73 6f 72 20 76 65 72 69 66 69 65 ..Sensor verifie 3e21: 64 2c 20 72 65 6d 6f 76 65 20 74 68 65 20 66 69 d, remove the fi 3e31: 6c 61 6d 65 6e 74 20 6e 6f 77 2e 00 lament now.. 00003e3d : 3e3d: ff ff 56 65 72 69 66 69 63 61 74 69 6f 6e 20 66 ..Verification f 3e4d: 61 69 6c 65 64 2c 20 72 65 6d 6f 76 65 20 74 68 ailed, remove th 3e5d: 65 20 66 69 6c 61 6d 65 6e 74 20 61 6e 64 20 74 e filament and t 3e6d: 72 79 20 61 67 61 69 6e 2e 00 ry again.. 00003e77 : 3e77: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 74 ..Please check t 3e87: 68 65 20 49 52 20 73 65 6e 73 6f 72 20 63 6f 6e he IR sensor con 3e97: 6e 65 63 74 69 6f 6e 2c 20 75 6e 6c 6f 61 64 20 nection, unload 3ea7: 66 69 6c 61 6d 65 6e 74 20 69 66 20 70 72 65 73 filament if pres 3eb7: 65 6e 74 2e 00 ent.. 00003ebc : 3ebc: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 3ecc: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 3edc: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 3eec: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 00003ef9 : 3ef9: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 3f09: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 3f19: 6c 69 6e 67 00 ling. 00003f1e : 3f1e: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3f2e: 74 3a 00 t:. 00003f31 : 3f31: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00003f3f : 3f3f: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00003f50 : 3f50: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00003f5d : 3f5d: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 00003f6b : 3f6b: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 3f7b: 6d 65 00 me. 00003f7e : 3f7e: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00003f8c : 3f8c: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 3f9c: 72 73 00 rs. 00003f9f : 3f9f: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 3faf: 64 00 d. 00003fb1 : 3fb1: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00003fc0 : 3fc0: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 3fd0: 73 00 s. 00003fd2 : 3fd2: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 3fe2: 73 00 s. 00003fe4 : 3fe4: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 3ff4: 73 00 s. 00003ff6 : 3ff6: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 4006: 6f 70 73 00 ops. 0000400a : 400a: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 00004019 : 4019: ff ff 42 61 63 6b 00 ..Back. 00004020 : 4020: ff ff 53 74 72 69 63 74 00 ..Strict. 00004029 : 4029: ff ff 57 61 72 6e 00 ..Warn. 00004030 : 4030: ff ff 4e 6f 6e 65 00 ..None. 00004037 : 4037: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ..Nozzle changed 4047: 3f 00 ?. 00004049 : 4049: ff ff 4e 6f 7a 7a 6c 65 20 69 73 20 68 6f 74 21 ..Nozzle is hot! 4059: 20 57 61 69 74 20 66 6f 72 20 63 6f 6f 6c 64 6f Wait for cooldo 4069: 77 6e 2e 00 wn.. 0000406d : 406d: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 407d: 68 65 64 00 hed. 00004081 : 4081: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 0000408c : 408c: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 0000409b : 409b: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 000040ab : 40ab: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 40bb: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 40cb: 68 65 20 47 2d 63 6f 64 65 2e 00 he G-code.. 000040d6 : 40d6: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 40e6: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 40f6: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4106: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4116: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 00 e in settings.. 00004125 : 4125: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4135: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 00 lament loaded.. 00004144 : 4144: ff ff 4d 4b 33 53 20 66 69 72 6d 77 61 72 65 20 ..MK3S firmware 4154: 64 65 74 65 63 74 65 64 20 6f 6e 20 4d 4b 33 20 detected on MK3 4164: 70 72 69 6e 74 65 72 00 printer. 0000416c : 416c: ff ff 42 6c 61 63 6b 6f 75 74 20 6f 63 63 75 72 ..Blackout occur 417c: 72 65 64 2e 20 52 65 63 6f 76 65 72 20 70 72 69 red. Recover pri 418c: 6e 74 3f 00 nt?. 00004190 : 4190: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 41a0: 6e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 20 79 not calibrated y 41b0: 65 74 2e 00 et.. 000041b4 : 41b4: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 41c4: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 41d4: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 41e4: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 41f4: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 4204: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 4214: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4224: 6e 20 66 6c 6f 77 2e 00 n flow.. 0000422c : 422c: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 423c: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 424c: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 425c: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 426c: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 427c: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 428c: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 0000429c : 429c: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 42ac: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 42bc: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 42cc: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 42dc: 2e 00 .. 000042de : 42de: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 42ee: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 42fe: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 430e: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 0000431a : 431a: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 432a: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 433a: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 434a: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004355 : 4355: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4365: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 00004376 : 4376: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 4386: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 4396: 67 65 64 2e 00 ged.. 0000439b : 439b: ff ff 53 68 65 65 74 00 ..Sheet. 000043a3 : 43a3: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 000043b2 : 43b2: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 000043bd : 43bd: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000043c8 : 43c8: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 43d8: 64 00 d. 000043da : 43da: ff ff 25 73 20 6c 65 76 65 6c 20 65 78 70 65 63 ..%s level expec 43ea: 74 65 64 00 ted. 000043ee : 43ee: ff ff 46 61 6c 73 65 20 74 72 69 67 67 65 72 69 ..False triggeri 43fe: 6e 67 00 ng. 00004401 : 4401: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 4411: 72 00 r. 00004413 : 4413: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 0000441d : 441d: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 442d: 73 00 s. 0000442f : 442f: ff ff 41 78 69 73 00 ..Axis. 00004436 : 4436: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00004444 : 4444: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00004453 : 4453: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 4463: 6e 3f 00 n?. 00004466 : 4466: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 4476: 6e 3f 00 n?. 00004479 : 4479: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 4489: 74 00 t. 0000448b : 448b: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 00004495 : 4495: ff ff 4d 6f 74 6f 72 00 ..Motor. 0000449d : 449d: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 000044a8 : 44a8: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 000044b7 : 44b7: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 000044c4 : 44c4: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 000044d4 : 44d4: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 44e4: 74 6f 72 00 tor. 000044e8 : 44e8: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 000044f8 : 44f8: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 4508: 21 00 !. 0000450a : 450a: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 451a: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 452a: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 453a: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 454a: 79 2e 00 y.. 0000454d : 454d: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 455d: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 456d: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 457d: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 458d: 6a 6f 62 21 00 job!. 00004592 : 4592: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45a2: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 45b2: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 45c2: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 45d2: 73 21 00 s!. 000045d5 : 45d5: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45e5: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 45f5: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 4605: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 4615: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 00004621 : 4621: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4631: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 4641: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 4651: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 4661: 68 61 62 6c 65 2e 00 hable.. 00004668 : 4668: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4678: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 4688: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 4698: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 46a8: 68 61 62 6c 65 2e 00 hable.. 000046af : 46af: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 46bf: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 46cf: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 46df: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 46ef: 2e 00 .. 000046f1 : 46f1: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4701: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 4711: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 4721: 75 61 6c 2e 00 ual.. 00004726 : 4726: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4736: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 4746: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 4756: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00004765 : 4765: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 4775: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 4785: 61 74 62 65 64 2e 00 atbed.. 0000478c : 478c: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 479c: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 47ac: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 47bc: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 47cc: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 47dc: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 47ec: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 47fc: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 480c: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 481c: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 0000482b : 482b: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 483b: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 484b: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 485b: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 486b: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 487b: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 488b: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 489b: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 48ab: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 48bb: 69 61 74 65 6c 79 2e 00 iately.. 000048c3 : 48c3: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 48d3: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 48e3: 74 00 t. 000048e5 : 48e5: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 48f5: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 4905: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 4915: 74 00 t. 00004917 : 4917: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 4927: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 4937: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 4947: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00004953 : 4953: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 0000495f : 495f: ff ff 54 48 45 52 4d 41 4c 20 41 4e 4f 4d 41 4c ..THERMAL ANOMAL 496f: 59 00 Y. 00004971 : 4971: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00004982 : 4982: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00004992 : 4992: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 49a2: 6e 65 00 ne. 000049a5 : 49a5: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 000049b5 : 49b5: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 000049c0 : 49c0: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 000049ce : 49ce: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 000049de : 49de: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 000049e8 : 49e8: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 000049f4 : 49f4: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00004a05 : 4a05: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4a15: 73 00 s. 00004a17 : 4a17: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4a27: 65 73 00 es. 00004a2a : 4a2a: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004a3b : 4a3b: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 4a4b: 6c 75 72 65 73 00 lures. 00004a51 : 4a51: ff ff 50 6f 77 65 72 20 66 61 69 6c 75 72 65 73 ..Power failures ... 00004a62 : 4a62: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004a71 : 4a71: ff ff 43 72 61 73 68 00 ..Crash. 00004a79 : 4a79: ff ff 54 6f 74 61 6c 00 ..Total. 00004a81 : 4a81: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00004a8e : 4a8e: ff ff 41 6d 62 69 65 6e 74 00 ..Ambient. 00004a98 : 4a98: ff ff 56 6f 6c 74 61 67 65 73 00 ..Voltages. 00004aa3 : 4aa3: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004ab2 : 4ab2: ff ff 42 65 6c 74 20 73 74 61 74 75 73 00 ..Belt status. 00004ac0 : 4ac0: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004ace : 4ace: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004ade : 4ade: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4aee: 6c 73 00 ls. 00004af1 : 4af1: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4b01: 72 3a 00 r:. 00004b04 : 4b04: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004b0e : 4b0e: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004b1e : 4b1e: ff ff 44 61 74 65 3a 00 ..Date:. 00004b26 : 4b26: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4b36: 6d 65 6e 74 00 ment. 00004b3b : 4b3b: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4b4b: 6e 74 00 nt. 00004b4e : 4b4e: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004b5f : 4b5f: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4b6f: 63 75 74 00 cut. 00004b73 : 4b73: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4b83: 65 6a 65 63 74 00 eject. 00004b89 : 4b89: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4b99: 75 6e 6c 6f 61 64 00 unload. 00004ba0 : 4ba0: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4bb0: 6c 6f 61 64 00 load. 00004bb5 : 4bb5: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00004bc0 : 4bc0: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 4bd0: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 4be0: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00004beb : 4beb: ff ff 45 6a 65 63 74 00 ..Eject. 00004bf3 : 4bf3: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 4c03: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 4c13: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 4c23: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 4c33: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 00004c40 : 4c40: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 00004c51 : 4c51: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 4c61: 6d 65 00 me. 00004c64 : 4c64: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00004c74 : 4c74: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 00004c81 : 4c81: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 4c91: 7a 7a 6c 65 21 00 zzle!. 00004c97 : 4c97: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00004ca0 : 4ca0: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 4cb0: 6d 20 6d 69 6e 00 m min. 00004cb6 : 4cb6: ff ff 4c 65 66 74 00 ..Left. 00004cbd : 4cbd: ff ff 52 69 67 68 74 00 ..Right. 00004cc5 : 4cc5: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00004cd5 : 4cd5: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00004ce3 : 4ce3: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00004cf1 : 4cf1: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 4d01: 66 73 65 74 00 fset. 00004d06 : 4d06: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00004d14 : 4d14: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00004d25 : 4d25: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00004d36 : 4d36: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00004d47 : 4d47: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00004d58 : 4d58: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 4d68: 65 3a 00 e:. 00004d6b : 4d6b: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4d7b: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00004d86 : 4d86: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4d96: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 4da6: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 4db6: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 4dc6: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 4dd6: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00004de2 : 4de2: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00004ded : 4ded: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00004df6 : 4df6: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00004dff : 4dff: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00004e08 : 4e08: ff ff 43 72 61 73 68 20 64 65 74 65 63 74 69 6f ..Crash detectio 4e18: 6e 20 63 61 6e 0a 62 65 20 74 75 72 6e 65 64 20 n can.be turned 4e28: 6f 6e 20 6f 6e 6c 79 20 69 6e 0a 4e 6f 72 6d 61 on only in.Norma 4e38: 6c 20 6d 6f 64 65 00 l mode. 00004e3f : 4e3f: ff ff 57 41 52 4e 49 4e 47 3a 0a 43 72 61 73 68 ..WARNING:.Crash 4e4f: 20 64 65 74 65 63 74 69 6f 6e 0a 64 69 73 61 62 detection.disab 4e5f: 6c 65 64 20 69 6e 0a 53 74 65 61 6c 74 68 20 6d led in.Stealth m 4e6f: 6f 64 65 00 ode. 00004e73 : 4e73: ff ff 4d 6f 64 65 20 63 68 61 6e 67 65 20 69 6e ..Mode change in 4e83: 20 70 72 6f 67 72 65 73 73 2e 2e 2e 00 progress.... 00004e90 : 4e90: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 4ea0: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004eaa : 4eaa: ff ff 43 6f 6d 6d 75 6e 69 74 79 20 6d 61 64 65 ..Community made ... 00004ebb : 4ebb: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 4ecb: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 4edb: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 4eeb: 65 74 00 et. 00004eee : 4eee: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 4efe: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00004f0c : 4f0c: ff ff 43 61 6e 63 65 6c 00 ..Cancel. 00004f15 : 4f15: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 4f25: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 4f35: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 4f45: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 4f55: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 4f65: 6e 6e 69 6e 67 2e 00 nning.. 00004f6c : 4f6c: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 4f7c: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 4f8c: 2e 00 .. 00004f8e : 4f8e: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4f9e: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4fae: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 4fbe: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 4fce: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00004fda : 4fda: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4fea: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4ffa: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 500a: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 501a: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 502a: 6c 6f 61 64 20 69 74 2e 00 load it.. 00005033 : 5033: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 5043: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 5053: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 5063: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 5073: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 5083: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 5093: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 50a3: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 50b3: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 50c3: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 000050d3 : 50d3: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 50e3: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 50f3: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 5103: 2e 00 .. 00005105 : 5105: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 5115: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 5125: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 5135: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 5145: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 5155: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 0000515e : 515e: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 516e: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 517e: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 518e: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 519e: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 000051ad : 51ad: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 51bd: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 51cd: 20 69 74 20 6e 6f 77 3f 00 it now?. 000051d6 : 51d6: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 51e6: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 51f6: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 00005200 : 5200: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 5210: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 0000521d : 521d: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 522d: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 523d: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 524d: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 525d: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 526d: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 527d: 2e 00 .. 0000527f : 527f: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 528f: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 0000529e : 529e: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 52ae: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 52be: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 52ce: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 000052dd : 52dd: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 52ed: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 52fd: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 530d: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 531d: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 532d: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 533d: 65 65 74 73 2e 00 eets.. 00005343 : 5343: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 5353: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 5363: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 00005373 : 5373: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 5383: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 5393: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 53a3: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 53b3: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 53c3: 64 3f 00 d?. 000053c6 : 53c6: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 53d6: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 53e6: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 53f6: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 00005407 : 5407: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 5417: 61 64 65 64 3f 00 aded?. 0000541d : 541d: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 542d: 63 61 6c 2e 20 74 61 6b 65 73 20 61 70 70 72 6f cal. takes appro 543d: 78 2e 20 31 32 20 6d 69 6e 73 2e 20 53 65 65 0a x. 12 mins. See. 544d: 70 72 75 73 61 2e 69 6f 2f 74 6d 2d 63 61 6c 00 prusa.io/tm-cal. 0000545d : 545d: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 546d: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 547d: 50 4c 41 2e 00 PLA.. 00005482 : 5482: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 5492: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 000054a2 : 54a2: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 54b2: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 54c2: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 000054d0 : 54d0: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 54e0: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 54f0: 20 66 69 72 73 74 2e 00 first.. 000054f8 : 54f8: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 5508: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 5518: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 5528: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 00005536 : 5536: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 5546: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 5556: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 5566: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 5576: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 0000557f : 557f: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 558f: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 559f: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 55af: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 55bf: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 55cf: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 55df: 65 73 73 3f 00 ess?. 000055e4 : 55e4: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 55f4: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 5604: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 5614: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 5624: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 5634: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 5644: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 5654: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 5664: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 5674: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 5684: 69 6e 74 2e 00 int.. 00005689 : 5689: ff ff 45 2d 63 6f 72 72 65 63 74 00 ..E-correct. 00005695 : 5695: ff ff 5a 2d 63 6f 72 72 65 63 74 00 ..Z-correct. 000056a1 : 56a1: ff ff 59 2d 63 6f 72 72 65 63 74 00 ..Y-correct. 000056ad : 56ad: ff ff 58 2d 63 6f 72 72 65 63 74 00 ..X-correct. 000056b9 : 56b9: ff ff 50 61 75 73 65 00 ..Pause. 000056c1 : 56c1: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 000056cd : 56cd: ff ff 43 6f 6e 74 2e 00 ..Cont.. 000056d5 : 56d5: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 000056e3 : 56e3: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 000056ef : 56ef: ff ff 4d 4d 55 20 4d 6f 64 65 00 ..MMU Mode. 000056fa : 56fa: ff ff 43 75 74 74 65 72 00 ..Cutter. 00005703 : 5703: ff ff 53 74 65 61 6c 74 68 00 ..Stealth. 0000570d : 570d: ff ff 43 72 61 73 68 20 64 65 74 2e 00 ..Crash det.. 0000571a : 571a: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 00005726 : 5726: ff ff 42 65 64 00 ..Bed. 0000572c : 572c: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 00005739 : 5739: ff ff 4d 6f 64 65 6c 00 ..Model. 00005741 : 5741: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 0000574a : 574a: ff ff 43 68 65 63 6b 73 00 ..Checks. 00005753 : 5753: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00005763 : 5763: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 0000576e : 576e: ff ff 53 6f 72 74 00 ..Sort. 00005775 : 5775: ff ff 54 69 6d 65 00 ..Time. 0000577c : 577c: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00005785 : 5785: ff ff 53 44 20 63 61 72 64 00 ..SD card. 0000578f : 578f: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 579f: 65 00 e. 000057a1 : 57a1: ff ff 52 50 69 20 70 6f 72 74 00 ..RPi port. 000057ac : 57ac: ff ff 4c 69 6e 2e 20 63 6f 72 72 65 63 74 69 6f ..Lin. correctio 57bc: 6e 00 n. 000057be : 57be: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 000057c9 : 57c9: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 000057d8 : 57d8: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 57e8: 72 73 00 rs. 000057eb : 57eb: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 000057f7 : 57f7: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 00005805 : 5805: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 5815: 6e 73 6f 72 00 nsor. 0000581a : 581a: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 582a: 72 00 r. 0000582c : 582c: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 00005835 : 5835: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 5845: 49 4e 44 41 00 INDA. 0000584a : 584a: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 585a: 65 6e 74 00 ent. 0000585e : 585e: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 586e: 6f 72 00 or. 00005871 : 5871: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 5881: 63 74 6f 72 00 ctor. 00005886 : 5886: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 00005897 : 5897: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 58a7: 6e 74 00 nt. 000058aa : 58aa: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 58ba: 65 00 e. 000058bc : 58bc: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 58cc: 20 73 6c 6f 74 00 slot. 000058d2 : 58d2: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 58e2: 6d 65 6e 74 00 ment. 000058e7 : 58e7: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 000058f8 : 58f8: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5908: 65 6e 74 00 ent. 0000590c : 590c: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 0000591b : 591b: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 592b: 73 65 72 00 ser. 0000592f : 592f: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 593f: 6d 65 6e 74 73 00 ments. 00005945 : 5945: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 00005956 : 5956: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 5966: 7a 6c 65 00 zle. 0000596a : 596a: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 597a: 72 75 64 65 72 00 ruder. 00005980 : 5980: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 5990: 44 41 00 DA. 00005993 : 5993: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 59a3: 75 6c 6c 65 79 00 ulley. 000059a9 : 59a9: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 59b9: 49 4e 44 41 00 INDA. 000059be : 59be: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 59ce: 6c 65 72 00 ler. 000059d2 : 59d2: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 000059e3 : 59e3: ff ff 4f 4b 00 ..OK. 000059e8 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.547>: 59e8: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 000059f8 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.546>: 59f8: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5a08: 45 00 E. 00005a0a <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.545>: 5a0a: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5a1a: 45 44 00 ED. 00005a1d <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.544>: 5a1d: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5a2d: 59 00 Y. 00005a2f <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.543>: 5a2f: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 5a3f: 4f 52 00 OR. 00005a42 <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.542>: 5a42: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 5a52: 4e 45 45 44 45 44 00 NEEDED. 00005a59 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.541>: 5a59: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005a66 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.540>: 5a66: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 00005a75 <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.539>: 5a75: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 5a85: 4f 41 44 45 44 00 OADED. 00005a8b <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.538>: 5a8b: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5a9b: 45 52 52 4f 52 00 ERROR. 00005aa1 <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.537>: 5aa1: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 5ab1: 44 49 4e 47 00 DING. 00005ab6 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.536>: 5ab6: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005ac6 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.535>: 5ac6: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5ad6: 41 49 4c 45 44 00 AILED. 00005adc <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.534>: 5adc: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5aec: 52 54 45 44 00 RTED. 00005af1 <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.533>: 5af1: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 5b01: 47 45 20 45 52 52 00 GE ERR. 00005b08 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.532>: 5b08: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5b18: 45 54 00 ET. 00005b1b <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.531>: 5b1b: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5b2b: 4f 52 00 OR. 00005b2e <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.530>: 5b2e: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 5b3e: 52 52 4f 52 00 RROR. 00005b43 <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.529>: 5b43: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 5b53: 4f 20 48 4f 54 00 O HOT. 00005b59 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.528>: 5b59: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 5b69: 4f 56 45 00 OVE. 00005b6d <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.527>: 5b6d: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 5b7d: 4f 4d 45 00 OME. 00005b81 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.526>: 5b81: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5b91: 54 20 4d 4f 56 45 00 T MOVE. 00005b98 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.525>: 5b98: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5ba8: 54 20 48 4f 4d 45 00 T HOME. 00005baf <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.524>: 5baf: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5bbf: 46 41 49 4c 45 44 00 FAILED. 00005bc6 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.523>: 5bc6: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005bd6 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.522>: 5bd6: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5be6: 52 4c 59 00 RLY. 00005bea <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.521>: 5bea: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5bfa: 4d 4f 56 45 00 MOVE. 00005bff <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.520>: 5bff: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5c0f: 54 55 43 4b 00 TUCK. 00005c14 <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.519>: 5c14: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5c24: 54 52 49 47 47 2e 00 TRIGG.. 00005c2b <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.518>: 5c2b: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5c3b: 54 55 43 4b 00 TUCK. 00005c40 <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.517>: 5c40: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 5c50: 49 47 47 45 52 00 IGGER. 00005c56 : 5c56: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005c65 : 5c65: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005c76 : 5c76: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5c86: 6e 74 00 nt. 00005c89 : 5c89: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5c99: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5ca9: 72 65 2e 2e 2e 00 re.... 00005caf : 5caf: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005cbf : 5cbf: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5ccf: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5cdf: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5cef: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5cff: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5d0f: 30 2e 00 0.. 00005d12 : 5d12: ff ff 75 6e 6b 6e 6f 77 6e 20 73 74 61 74 65 00 ..unknown state. 00005d22 : 5d22: ff ff 20 30 2e 34 20 6f 72 20 6e 65 77 65 72 00 .. 0.4 or newer. 00005d32 : 5d32: ff ff 20 30 2e 33 20 6f 72 20 6f 6c 64 65 72 00 .. 0.3 or older. 00005d42 : 5d42: ff ff 4f 66 66 00 ..Off. 00005d48 : 5d48: ff ff 4f 6e 00 ..On. 00005d4d : 5d4d: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5d5d: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005d6a : 5d6a: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5d7a: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5d8a: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5d9a: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5daa: 2e 00 .. 00005dac : 5dac: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5dbc: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5dcc: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5ddc: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005de5 : 5de5: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5df5: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5e05: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5e15: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5e25: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5e35: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005e43 : 5e43: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5e53: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5e63: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5e73: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5e83: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005e8d : 5e8d: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5e9d: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5ead: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5ebd: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5ecd: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005ed7 : 5ed7: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5ee7: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5ef7: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5f07: 4d 4d 55 2e 00 MMU.. 00005f0c : 5f0c: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5f1c: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5f2c: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5f3c: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 5f4c: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 5f5c: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 5f6c: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 5f7c: 29 2e 00 ).. 00005f7f : 5f7f: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5f8f: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5f9f: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5faf: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5fbf: 69 74 20 66 69 72 73 74 2e 00 it first.. 00005fc9 : 5fc9: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5fd9: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 5fe9: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 5ff9: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 0000600a : 600a: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 601a: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 602a: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 603a: 63 74 6f 72 73 2e 00 ctors.. 00006041 : 6041: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 6051: 6e 6c 69 6e 65 2e 00 nline.. 00006058 : 6058: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 6068: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 6078: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 6088: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 6098: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 000060a4 : 60a4: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 60b4: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 000060c4 : 60c4: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 60d4: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 60e4: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 60f4: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 6104: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 00006113 : 6113: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 6123: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 6133: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 6143: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 6153: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 6163: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 6173: 6e 65 65 64 65 64 2e 00 needed.. 0000617b : 617b: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 618b: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 619b: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 61ab: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 61bb: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 61cb: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 61db: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 61eb: 6f 70 65 72 6c 79 2e 00 operly.. 000061f3 : 61f3: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6203: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 6213: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 6223: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 6233: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 6243: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 6253: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 6263: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 6273: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 6283: 2e 00 .. 00006285 : 6285: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 6295: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 62a5: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 62b5: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 62c5: 20 77 69 72 69 6e 67 2e 00 wiring.. 000062ce : 62ce: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 62de: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 62ee: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 62fe: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 630e: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 631e: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 632e: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 0000633b : 633b: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 634b: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 635b: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 636b: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 637b: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 638b: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 639b: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 63ab: 61 63 68 65 64 20 69 74 2e 00 ached it.. 000063b5 : 63b5: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 63c5: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 63d5: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 63e5: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 63f5: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 6405: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 6415: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 6425: 6f 72 6b 73 2e 00 orks.. 0000642b : 642b: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 643b: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 644b: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 645b: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 646b: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 647b: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 0000648c : 648c: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00006496 : 6496: ff ff 53 74 6f 70 00 ..Stop. 0000649d : 649d: ff ff 4c 6f 61 64 00 ..Load. 000064a4 : 64a4: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 000064ad : 64ad: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 000064b8 : 64b8: ff ff 52 65 74 72 79 00 ..Retry. 000064c0 : 64c0: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 64d0: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 64e0: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 64f0: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 6500: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 6510: 74 2e 00 t.. 00006513 : 6513: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 00006521 : 6521: ff ff 44 6f 6e 65 00 ..Done. 00006528 : 6528: ff ff 52 65 63 6f 76 65 72 69 6e 67 20 70 72 69 ..Recovering pri 6538: 6e 74 00 nt. 0000653b <__loc_pri_end>: 653b: 65 6e ori r22, 0xE5 ; 229 653d: 71 75 andi r23, 0x51 ; 81 653f: 65 69 ori r22, 0x95 ; 149 6541: 6e 67 ori r22, 0x7E ; 126 6543: 20 22 and r2, r16 ... 00006546 : 6546: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 6556: 6c 65 00 le. 00006559 : 6559: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 6569: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 6579: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006583 : 6583: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 6593: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 65a3: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000065ad : 65ad: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 65bd: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 000065cc : 65cc: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 65dc: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 65ec: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 65fc: 3a 20 00 : . 000065ff : 65ff: 25 6c 75 20 62 79 74 65 73 20 77 72 69 74 74 65 %lu bytes writte 660f: 6e 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 n to %S at addre 661f: 73 73 20 30 78 25 30 34 6c 78 0a 00 ss 0x%04lx.. 0000662b : 662b: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 663b: 20 25 53 0a 00 %S.. 00006640 <__c.2368>: 6640: 3f 3f 00 ??. 00006643 <__c.2366>: 6643: 52 6f 6d 61 6e 61 00 Romana. 0000664a <__c.2363>: 664a: 48 72 76 61 74 73 6b 69 00 Hrvatski. 00006653 <__c.2360>: 6653: 4d 61 67 79 61 72 00 Magyar. 0000665a <__c.2357>: 665a: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 00006665 <__c.2354>: 6665: 4e 6f 72 73 6b 00 Norsk. 0000666b <__c.2351>: 666b: 53 76 65 6e 73 6b 61 00 Svenska. 00006673 <__c.2348>: 6673: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 0000667e <__c.2345>: 667e: 50 6f 6c 73 6b 69 00 Polski. 00006685 <__c.2342>: 6685: 49 74 61 6c 69 61 6e 6f 00 Italiano. 0000668e <__c.2339>: 668e: 46 72 61 6e 63 61 69 73 00 Francais. 00006697 <__c.2336>: 6697: 45 73 70 61 6e 6f 6c 00 Espanol. 0000669f <__c.2333>: 669f: 44 65 75 74 73 63 68 00 Deutsch. 000066a7 <__c.2330>: 66a7: 43 65 73 74 69 6e 61 00 Cestina. 000066af <__c.2327>: 66af: 45 6e 67 6c 69 73 68 00 English. 000066b7 : 66b7: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 000066c2 : 66c2: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 66d2: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 66e2: 31 40 3a 25 75 0a 00 1@:%u.. 000066e9 : 66e9: 52 65 73 65 6e 64 00 Resend. 000066f0 : 66f0: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 000066fc : 66fc: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 670c: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 00006716 : 6716: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 6726: 64 65 74 65 63 74 65 64 21 00 detected!. 00006730 : 6730: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 6740: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 6750: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 6760: 72 65 64 2e 00 red.. 00006765 : 6765: 64 75 6d 70 20 63 6c 65 61 72 65 64 0a 00 dump cleared.. 00006773 : 6773: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 6783: 65 0a 00 e.. 00006786 : 6786: 44 32 31 20 2d 20 72 65 61 64 20 63 72 61 73 68 D21 - read crash 6796: 20 64 75 6d 70 0a 00 dump.. 0000679d : 679d: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 67ad: 65 0a 00 e.. 000067b0 : 67b0: 64 75 6d 70 20 63 6f 6d 70 6c 65 74 65 64 20 69 dump completed i 67c0: 6e 20 25 6c 75 6d 73 0a 00 n %lums.. 000067c9 : 67c9: 58 46 4c 41 53 48 00 XFLASH. 000067d0 : 67d0: 45 45 50 52 4f 4d 00 EEPROM. 000067d7 : 67d7: 53 52 41 4d 00 SRAM. 000067dc : 67dc: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 67ec: 6f 70 0a 00 op.. 000067f0 : 67f0: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 6800: 20 30 00 0. 00006803 : 6803: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 00006814 : 6814: 74 6d 63 32 31 33 30 5f 70 72 69 6e 74 5f 63 75 tmc2130_print_cu 6824: 72 72 65 6e 74 73 28 29 0a 09 48 09 52 0a 58 09 rrents()..H.R.X. 6834: 25 64 09 25 64 0a 59 09 25 64 09 25 64 0a 5a 09 %d.%d.Y.%d.%d.Z. 6844: 25 64 09 25 64 0a 45 09 25 64 09 25 64 0a 00 %d.%d.E.%d.%d.. 00006853 : 6853: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 6863: 20 00 . 00006865 : 6865: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 6875: 20 22 00 ". 00006878 <_ZZ16process_commandsvE3__c__65_>: 6878: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 6888: 72 75 64 65 72 20 00 ruder . 0000688f : 688f: 7a 5f 6d 61 78 3a 20 00 z_max: . 00006897 : 6897: 7a 5f 6d 69 6e 3a 20 00 z_min: . 0000689f <_ZZ16process_commandsvE3__c__64_>: 689f: 79 5f 6d 61 78 3a 20 00 y_max: . 000068a7 <_ZZ16process_commandsvE3__c__63_>: 68a7: 79 5f 6d 69 6e 3a 20 00 y_min: . 000068af <_ZZ16process_commandsvE3__c__62_>: 68af: 78 5f 6d 61 78 3a 20 00 x_max: . 000068b7 : 68b7: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 000068c1 : 68c1: 6f 70 65 6e 00 open. 000068c6 <_ZZ16process_commandsvE3__c__61_>: 68c6: 78 5f 6d 69 6e 3a 20 00 x_min: . 000068ce <_ZZ16process_commandsvE3__c__60_>: 68ce: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 68de: 70 20 73 74 61 74 75 73 00 p status. 000068e7 : 68e7: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 68f7: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 00006904 : 6904: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 6914: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 00006921 : 6921: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 61 75 //action:uvlo_au 6931: 74 6f 5f 72 65 63 6f 76 65 72 79 5f 72 65 61 64 to_recovery_read 6941: 79 00 y. 00006943 <_ZZ16process_commandsvE3__c__46_>: 6943: 25 53 3a 25 6c 75 20 63 6d 0a 25 53 3a 25 6c 75 %S:%lu cm.%S:%lu 6953: 20 6d 69 6e 0a 00 min.. 00006959 <_ZZ16process_commandsvE3__c__45_>: 6959: 53 49 4c 45 4e 54 00 SILENT. 00006960 <_ZZ16process_commandsvE3__c__44_>: 6960: 4e 4f 52 4d 41 4c 00 NORMAL. 00006967 <_ZZ16process_commandsvE3__c__43_>: 6967: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 6977: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 6987: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 6997: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 69a7: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 69b7: 64 0a 00 d.. 000069ba <_ZZ16process_commandsvE3__c__42_>: 69ba: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 69ca: 0a 00 .. 000069cc <_ZZ16process_commandsvE3__c__38_>: 69cc: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 000069da <_ZZ16process_commandsvE3__c__37_>: 69da: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 000069ea : 69ea: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 69fa: 20 25 73 0a 00 %s.. 000069ff <_ZZ16process_commandsvE3__c__35_>: 69ff: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 6a0f: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 6a1f: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006a2b <_ZZ16process_commandsvE3__c__34_>: 6a2b: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 00006a38 <_ZZ16process_commandsvE3__c__33_>: 6a38: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 6a48: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 6a58: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6a68: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 00006a74 <_ZZ16process_commandsvE3__c__32_>: 6a74: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 00006a81 <_ZZ16process_commandsvE3__c__31_>: 6a81: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 6a91: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006a9a <_ZZ16process_commandsvE3__c__28_>: 6a9a: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006aa3 <_ZZ16process_commandsvE3__c__27_>: 6aa3: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6ab3: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 00006abf <_ZZ16process_commandsvE3__c__26_>: 6abf: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006ac8 <_ZZ16process_commandsvE3__c__10_>: 6ac8: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6ad8: 64 20 52 50 4d 0a 00 d RPM.. 00006adf : 6adf: 47 39 30 00 G90. 00006ae3 : 6ae3: 4d 31 30 37 00 M107. 00006ae8 : 6ae8: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 63 61 Thermal Model ca 6af8: 6c 2e 00 l.. 00006afb : 6afb: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6b0b: 52 4f 52 00 ROR. 00006b0f : 6b0f: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6b1f: 52 52 4f 52 00 RROR. 00006b24 : 6b24: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006b35 : 6b35: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006b45 : 6b45: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006b54 : 6b54: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6b64: 64 79 00 dy. 00006b67 : 6b67: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006b77 : 6b77: 4d 38 34 00 M84. 00006b7b : 6b7b: 41 78 69 73 20 6c 65 6e 67 74 68 20 64 69 66 66 Axis length diff 6b8b: 65 72 65 6e 63 65 3a 25 2e 33 66 0a 00 erence:%.3f.. 00006b98 : 6b98: 4d 65 61 73 75 72 65 64 20 61 78 69 73 20 6c 65 Measured axis le 6ba8: 6e 67 74 68 3a 25 2e 33 66 0a 00 ngth:%.3f.. 00006bb3 : 6bb3: 4f 4b 00 OK. 00006bb6 : 6bb6: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6bc6: 65 64 00 ed. 00006bc9 <_ZZN10CardReader7releaseEvE3__c.lto_priv.555>: 6bc9: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006bda : 6bda: 46 61 6b 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 Fake serial numb 6bea: 65 72 00 er. 00006bed : 6bed: 45 2d 63 6f 6f 6c 20 6d 6f 64 65 00 E-cool mode. 00006bf9 : 6bf9: 41 4c 54 46 41 4e 20 64 65 74 2e 00 ALTFAN det.. 00006c05 : 6c05: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006c14 : 6c14: 47 39 31 00 G91. 00006c18 : 6c18: 4d 37 30 32 00 M702. 00006c1d : 6c1d: 4d 38 33 00 M83. 00006c21 : 6c21: 47 32 38 20 57 00 G28 W. 00006c27 : 6c27: 4d 35 30 30 00 M500. 00006c2c : 6c2c: 45 78 74 65 72 6e 61 6c 20 53 50 49 20 66 6c 61 External SPI fla 6c3c: 73 68 0a 58 46 4c 41 53 48 20 69 73 20 6e 6f 74 sh.XFLASH is not 6c4c: 20 72 65 73 2d 0a 70 6f 6e 64 69 6e 67 2e 20 4c res-.ponding. L 6c5c: 61 6e 67 75 61 67 65 0a 73 77 69 74 63 68 20 75 anguage.switch u 6c6c: 6e 61 76 61 69 6c 61 62 6c 65 2e 00 navailable.. 00006c78 : 6c78: 58 46 4c 41 53 48 20 6e 6f 74 20 72 65 73 70 6f XFLASH not respo 6c88: 6e 64 69 6e 67 2e 00 nding.. 00006c8f : 6c8f: 46 57 20 63 72 61 73 68 20 64 65 74 65 63 74 65 FW crash detecte 6c9f: 64 21 20 59 6f 75 20 63 61 6e 20 63 6f 6e 74 69 d! You can conti 6caf: 6e 75 65 20 70 72 69 6e 74 69 6e 67 2e 20 44 65 nue printing. De 6cbf: 62 75 67 20 64 61 74 61 20 61 76 61 69 6c 61 62 bug data availab 6ccf: 6c 65 20 66 6f 72 20 61 6e 61 6c 79 73 69 73 2e le for analysis. 6cdf: 20 43 6f 6e 74 61 63 74 20 73 75 70 70 6f 72 74 Contact support 6cef: 20 74 6f 20 73 75 62 6d 69 74 20 64 65 74 61 69 to submit detai 6cff: 6c 73 2e 00 ls.. 00006d03 : 6d03: 2f 2f 61 63 74 69 6f 6e 3a 64 75 6d 70 5f 61 76 //action:dump_av 6d13: 61 69 6c 61 62 6c 65 00 ailable. 00006d1b <_ZZ5setupE3__c__14_>: 6d1b: 43 72 61 73 68 44 65 74 65 63 74 20 44 49 53 41 CrashDetect DISA 6d2b: 42 4c 45 44 00 BLED. 00006d30 <_ZZ5setupE3__c__13_>: 6d30: 43 72 61 73 68 44 65 74 65 63 74 20 45 4e 41 42 CrashDetect ENAB 6d40: 4c 45 44 21 00 LED!. 00006d45 <_ZZ5setupE3__c__10_>: 6d45: 48 6f 74 65 6e 64 20 66 61 6e 20 74 79 70 65 3a Hotend fan type: 6d55: 20 00 . 00006d57 : 6d57: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6d67: 79 74 65 73 3a 20 00 ytes: . 00006d6e : 6d6e: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006d7d : 6d7d: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006d89 : 6d89: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006d99 : 6d99: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006da9 : 6da9: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006db9 : 6db9: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006dca : 6dca: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006dda : 6dda: 50 6f 77 65 72 55 70 00 PowerUp. 00006de2 : 6de2: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6df2: 20 66 69 6c 65 00 file. 00006df8 : 6df8: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6e08: 2e 00 .. 00006e0a : 6e0a: 6f 6b 00 ok. 00006e0d : 6e0d: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006e16 : 6e16: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 6e26: 25 66 20 25 66 0a 00 %f %f.. 00006e2d : 6e2d: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6e3d: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6e4d: 69 6c 65 64 2e 0a 00 iled... 00006e54 : 6e54: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6e64: 65 73 73 2e 0a 00 ess... 00006e6a : 6e6a: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6e7a: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006e8b : 6e8b: 31 2f 34 00 1/4. 00006e8f : 6e8f: 31 2f 34 00 1/4. 00006e93 : 6e93: 31 2f 39 00 1/9. 00006e97 : 6e97: 54 4d 43 20 44 52 49 56 45 52 20 4f 56 45 52 54 TMC DRIVER OVERT 6ea7: 45 4d 50 00 EMP. 00006eab : 6eab: 48 6f 6c 64 20 63 75 72 72 65 6e 74 20 74 72 75 Hold current tru 6ebb: 6e 63 61 74 65 64 20 74 6f 20 52 75 6e 20 63 75 ncated to Run cu 6ecb: 72 72 65 6e 74 00 rrent. 00006ed1 : 6ed1: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006edb : 6edb: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006ee4 : 6ee4: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006eed : 6eed: 86 25 33 64 25 25 00 .%3d%%. 00006ef4 : 6ef4: 2d 2d 2d 25 25 00 ---%%. 00006efa : 6efa: 25 33 64 25 25 00 %3d%%. 00006f00 : 6f00: 20 53 44 00 SD. 00006f04 : 6f04: 20 20 20 00 . 00006f08 : 6f08: 20 48 4f 00 HO. 00006f0c : 6f0c: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006f17 : 6f17: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006f26 : 6f26: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006f36 : 6f36: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006f45 <_ZZL16lcd_support_menuvE3__c__17_>: 6f45: 44 75 6d 70 20 6d 65 6d 6f 72 79 00 Dump memory. 00006f51 : 6f51: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006f62 : 6f62: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6f72: 6d 00 m. 00006f74 : 6f74: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006f80 : 6f80: 4d 37 30 31 00 M701. 00006f85 : 6f85: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6f95: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6fa5: 32 64 6d 00 2dm. 00006fa9 : 6fa9: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6fb9: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6fc9: 32 64 73 00 2ds. 00006fcd : 6fcd: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00006fd5 : 6fd5: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00006fe3 : 6fe3: 25 33 2e 32 66 81 00 %3.2f.. 00006fea : 6fea: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 6ffa: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 700a: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 00007017 : 7017: 20 20 30 00 0. 0000701b : 701b: 20 20 31 00 1. 0000701f : 701f: 46 49 4e 44 41 00 FINDA. 00007025 : 7025: 50 49 4e 44 41 00 PINDA. 0000702b : 702b: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 703b: 3a 20 25 64 0a 00 : %d.. 00007041 : 7041: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 0000704b : 704b: 46 69 72 6d 77 61 72 65 00 Firmware. 00007054 : 7054: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00007061 : 7061: 46 6c 61 73 68 41 69 72 00 FlashAir. 0000706a : 706a: 50 72 75 73 61 20 69 33 20 4d 4b 33 53 2b 52 20 Prusa i3 MK3S+R 707a: 4f 4b 2e 00 OK.. 0000707e : 707e: 4d 36 30 30 00 M600. 00007083 : 7083: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 0000708e : 708e: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 0000709e : 709e: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 70ae: 65 64 00 ed. 000070b1 : 70b1: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 000070be : 70be: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 70ce: 65 3a 20 00 e: . 000070d2 : 70d2: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 70e2: 64 69 72 3a 20 00 dir: . 000070e8 : 70e8: 4d 32 34 00 M24. 000070ec : 70ec: 4d 32 33 20 25 73 00 M23 %s. 000070f3 : 70f3: 31 2f 39 00 1/9. 000070f7 : 70f7: 88 00 .. 000070f9 : 70f9: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 7109: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00007117 : 7117: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 7127: 70 72 65 76 65 6e 74 65 64 00 prevented. 00007131 : 7131: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 0000713e : 713e: 50 4f 57 45 52 20 50 41 4e 49 43 20 44 45 54 45 POWER PANIC DETE 714e: 43 54 45 44 00 CTED. 00007153 : 7153: 55 56 4c 4f 20 2d 20 65 6e 64 20 25 64 0a 00 UVLO - end %d.. 00007162 : 7162: 55 56 4c 4f 5f 54 49 4e 59 20 2d 20 65 6e 64 20 UVLO_TINY - end 7172: 25 64 0a 00 %d.. 00007176 : 7176: 77 6f 72 6c 64 20 63 6f 6f 72 64 69 6e 61 74 65 world coordinate 7186: 73 3a 20 28 25 2e 33 66 2c 20 25 2e 33 66 2c 20 s: (%.3f, %.3f, 7196: 25 2e 33 66 29 0a 00 %.3f).. 0000719d : 719d: 4d 32 32 30 20 53 25 64 00 M220 S%d. 000071a6 : 71a6: 44 6f 6e 65 20 72 65 61 64 69 6e 67 20 45 45 50 Done reading EEP 71b6: 52 4f 4d 0a 00 ROM.. 000071bb : 71bb: 54 65 6d 70 65 72 61 74 75 72 65 20 52 65 73 74 Temperature Rest 71cb: 6f 72 65 64 0a 00 ored.. 000071d1 : 71d1: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 000071e1 <__noloc_end>: 71e1: 08 4a sbci r16, 0xA8 ; 168 71e3: d7 3b cpi r29, 0xB7 ; 183 71e5: 3b ce rjmp .-906 ; 0x6e5d 71e7: 01 6e ori r16, 0xE1 ; 225 71e9: 84 bc out 0x24, r8 ; 36 71eb: bf fd .word 0xfdbf ; ???? 71ed: c1 2f mov r28, r17 71ef: 3d 6c ori r19, 0xCD ; 205 71f1: 74 31 cpi r23, 0x14 ; 20 71f3: 9a bd out 0x2a, r25 ; 42 71f5: 56 83 std Z+6, r21 ; 0x06 71f7: 3d da rcall .-2950 ; 0x6673 <__c.2348> 71f9: 3d 00 .word 0x003d ; ???? 71fb: c7 7f andi r28, 0xF7 ; 247 71fd: 11 be out 0x31, r1 ; 49 71ff: d9 e4 ldi r29, 0x49 ; 73 7201: bb 4c sbci r27, 0xCB ; 203 7203: 3e 91 ld r19, -X 7205: 6b aa std Y+51, r6 ; 0x33 7207: aa be out 0x3a, r10 ; 58 7209: 00 00 nop 720b: 00 80 ld r0, Z 720d: 3f 05 cpc r19, r15 720f: a8 4c sbci r26, 0xC8 ; 200 7211: cd b2 in r12, 0x1d ; 29 7213: d4 4e sbci r29, 0xE4 ; 228 7215: b9 38 cpi r27, 0x89 ; 137 7217: 36 a9 ldd r19, Z+54 ; 0x36 7219: 02 0c add r0, r2 721b: 50 b9 out 0x00, r21 ; 0 721d: 91 86 std Z+9, r9 ; 0x09 721f: 88 08 sbc r8, r8 7221: 3c a6 std Y+44, r3 ; 0x2c 7223: aa aa std Y+50, r10 ; 0x32 7225: 2a be out 0x3a, r2 ; 58 7227: 00 00 nop 7229: 00 80 ld r0, Z 722b: 3f 07 cpc r19, r31 722d: 63 42 sbci r22, 0x23 ; 35 722f: 36 b7 in r19, 0x36 ; 54 7231: 9b d8 rcall .-3786 ; 0x6369 7233: a7 1a sub r10, r23 7235: 39 68 ori r19, 0x89 ; 137 7237: 56 18 sub r5, r6 7239: ae ba out 0x1e, r10 ; 30 723b: ab 55 subi r26, 0x5B ; 91 723d: 8c 1d adc r24, r12 723f: 3c b7 in r19, 0x3c ; 60 7241: cc 57 subi r28, 0x7C ; 124 7243: 63 bd out 0x23, r22 ; 35 7245: 6d ed ldi r22, 0xDD ; 221 7247: fd 75 andi r31, 0x5D ; 93 7249: 3e f6 brtc .-114 ; 0x71d9 724b: 17 72 andi r17, 0x27 ; 39 724d: 31 bf out 0x31, r19 ; 49 724f: 00 00 nop 7251: 00 80 ld r0, Z 7253: 3f 08 sbc r3, r15 7255: 00 00 nop 7257: 00 be out 0x30, r0 ; 48 7259: 92 24 eor r9, r2 725b: 49 12 cpse r4, r25 725d: 3e ab std Y+54, r19 ; 0x36 725f: aa aa std Y+50, r10 ; 0x32 7261: 2a be out 0x3a, r2 ; 58 7263: cd cc rjmp .-1638 ; 0x6bff 7265: cc 4c sbci r28, 0xCC ; 204 7267: 3e 00 .word 0x003e ; ???? 7269: 00 00 nop 726b: 80 be out 0x30, r8 ; 48 726d: ab aa std Y+51, r10 ; 0x33 726f: aa aa std Y+50, r10 ; 0x32 7271: 3e 00 .word 0x003e ; ???? 7273: 00 00 nop 7275: 00 bf out 0x30, r16 ; 48 7277: 00 00 nop 7279: 00 80 ld r0, Z 727b: 3f 00 .word 0x003f ; ???? 727d: 00 00 nop 727f: 00 00 nop 7281: 08 41 sbci r16, 0x18 ; 24 7283: 78 d3 rcall .+1776 ; 0x7975 7285: bb 43 sbci r27, 0x3B ; 59 7287: 87 d1 rcall .+782 ; 0x7597 <__trampolines_start+0x2e9> 7289: 13 3d cpi r17, 0xD3 ; 211 728b: 19 0e add r1, r25 728d: 3c c3 rjmp .+1656 ; 0x7907 728f: bd 42 sbci r27, 0x2D ; 45 7291: 82 ad ldd r24, Z+58 ; 0x3a 7293: 2b 3e cpi r18, 0xEB ; 235 7295: 68 ec ldi r22, 0xC8 ; 200 7297: 82 76 andi r24, 0x62 ; 98 7299: be d9 rcall .-3204 ; 0x6617 729b: 8f e1 ldi r24, 0x1F ; 31 729d: a9 3e cpi r26, 0xE9 ; 233 729f: 4c 80 ldd r4, Y+4 ; 0x04 72a1: ef ff .word 0xffef ; ???? 72a3: be 01 movw r22, r28 72a5: c4 ff sbrs r28, 4 72a7: 7f 3f cpi r23, 0xFF ; 255 72a9: 00 00 nop 72ab: 00 00 nop ... 000072ae <__trampolines_start>: 72ae: 0c 94 a8 cf jmp 0x19f50 ; 0x19f50 72b2: 0c 94 df cf jmp 0x19fbe ; 0x19fbe 72b6: 0d 94 f8 d1 jmp 0x3a3f0 ; 0x3a3f0 72ba: 0d 94 ff 2e jmp 0x25dfe ; 0x25dfe 72be: 0d 94 74 1e jmp 0x23ce8 ; 0x23ce8 72c2: 0d 94 7a 6a jmp 0x2d4f4 ; 0x2d4f4 72c6: 0c 94 b5 cf jmp 0x19f6a ; 0x19f6a 72ca: 0d 94 eb 25 jmp 0x24bd6 ; 0x24bd6 72ce: 0d 94 f5 99 jmp 0x333ea ; 0x333ea 72d2: 0c 94 f3 d8 jmp 0x1b1e6 ; 0x1b1e6 72d6: 0d 94 07 12 jmp 0x2240e ; 0x2240e 72da: 0d 94 a3 28 jmp 0x25146 ; 0x25146 72de: 0d 94 e9 07 jmp 0x20fd2 ; 0x20fd2 72e2: 0d 94 22 15 jmp 0x22a44 ; 0x22a44 72e6: 0d 94 67 41 jmp 0x282ce ; 0x282ce 72ea: 0d 94 44 07 jmp 0x20e88 ; 0x20e88 72ee: 0d 94 8f 3f jmp 0x27f1e ; 0x27f1e 72f2: 0d 94 4b 67 jmp 0x2ce96 ; 0x2ce96 72f6: 0d 94 6e 69 jmp 0x2d2dc ; 0x2d2dc 72fa: 0c 94 78 d2 jmp 0x1a4f0 ; 0x1a4f0 72fe: 0d 94 08 2f jmp 0x25e10 ; 0x25e10 7302: 0c 94 83 d0 jmp 0x1a106 ; 0x1a106 7306: 0d 94 ba 66 jmp 0x2cd74 ; 0x2cd74 730a: 0d 94 0a 67 jmp 0x2ce14 ; 0x2ce14 730e: 0c 94 26 d4 jmp 0x1a84c ; 0x1a84c () [clone .lto_priv.447]> 7312: 0d 94 f6 24 jmp 0x249ec ; 0x249ec 7316: 0d 94 f1 cf jmp 0x39fe2 ; 0x39fe2 <_menu_edit_P()> 731a: 0d 94 48 30 jmp 0x26090 ; 0x26090 731e: 0d 94 b9 07 jmp 0x20f72 ; 0x20f72 7322: 0c 94 1c d8 jmp 0x1b038 ; 0x1b038 7326: 0d 94 9a 59 jmp 0x2b334 ; 0x2b334 732a: 0c 94 b6 d6 jmp 0x1ad6c ; 0x1ad6c 732e: 0c 94 4b e0 jmp 0x1c096 ; 0x1c096 7332: 0d 94 bc 07 jmp 0x20f78 ; 0x20f78 7336: 0d 94 51 6f jmp 0x2dea2 ; 0x2dea2 733a: 0c 94 59 d2 jmp 0x1a4b2 ; 0x1a4b2 733e: 0d 94 28 23 jmp 0x24650 ; 0x24650 7342: 0c 94 1e e0 jmp 0x1c03c ; 0x1c03c 7346: 0d 94 18 9a jmp 0x33430 ; 0x33430 734a: 0d 94 b9 33 jmp 0x26772 ; 0x26772 734e: 0d 94 ec 24 jmp 0x249d8 ; 0x249d8 7352: 0d 94 94 66 jmp 0x2cd28 ; 0x2cd28 7356: 0d 94 6a 6a jmp 0x2d4d4 ; 0x2d4d4 735a: 0d 94 ea 22 jmp 0x245d4 ; 0x245d4 735e: 0c 94 7d d0 jmp 0x1a0fa ; 0x1a0fa 7362: 0d 94 a0 69 jmp 0x2d340 ; 0x2d340 7366: 0c 94 12 d4 jmp 0x1a824 ; 0x1a824 () [clone .lto_priv.451]> 736a: 0d 94 3f 6a jmp 0x2d47e ; 0x2d47e 736e: 0d 94 f6 41 jmp 0x283ec ; 0x283ec 7372: 0c 94 68 d7 jmp 0x1aed0 ; 0x1aed0 7376: 0c 94 f5 d2 jmp 0x1a5ea ; 0x1a5ea 737a: 0d 94 49 27 jmp 0x24e92 ; 0x24e92 737e: 0d 94 82 6a jmp 0x2d504 ; 0x2d504 7382: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 7386: 0d 94 da 07 jmp 0x20fb4 ; 0x20fb4 738a: 0d 94 81 2a jmp 0x25502 ; 0x25502 738e: 0d 94 c6 66 jmp 0x2cd8c ; 0x2cd8c 7392: 0d 94 ff 0f jmp 0x21ffe ; 0x21ffe 7396: 0c 94 dc df jmp 0x1bfb8 ; 0x1bfb8 739a: 0d 94 17 2d jmp 0x25a2e ; 0x25a2e 739e: 0d 94 97 67 jmp 0x2cf2e ; 0x2cf2e 73a2: 0c 94 cd df jmp 0x1bf9a ; 0x1bf9a 73a6: 0d 94 bf 07 jmp 0x20f7e ; 0x20f7e 73aa: 0d 94 86 27 jmp 0x24f0c ; 0x24f0c 73ae: 0c 94 ad d8 jmp 0x1b15a ; 0x1b15a 73b2: 0d 94 17 0f jmp 0x21e2e ; 0x21e2e 73b6: 0d 94 0e 15 jmp 0x22a1c ; 0x22a1c 73ba: 0d 94 e0 25 jmp 0x24bc0 ; 0x24bc0 73be: 0d 94 45 24 jmp 0x2488a ; 0x2488a 73c2: 0c 94 5f e0 jmp 0x1c0be ; 0x1c0be 73c6: 0d 94 bd 3d jmp 0x27b7a ; 0x27b7a 73ca: 0d 94 f5 28 jmp 0x251ea ; 0x251ea 73ce: 0c 94 b9 cf jmp 0x19f72 ; 0x19f72 73d2: 0d 94 47 67 jmp 0x2ce8e ; 0x2ce8e 73d6: 0d 94 c3 41 jmp 0x28386 ; 0x28386 73da: 0d 94 68 07 jmp 0x20ed0 ; 0x20ed0 73de: 0d 94 18 a0 jmp 0x34030 ; 0x34030 73e2: 0c 94 21 75 jmp 0xea42 ; 0xea42 <__vector_23+0xa4> 73e6: 0d 94 59 67 jmp 0x2ceb2 ; 0x2ceb2 73ea: 0d 94 61 2d jmp 0x25ac2 ; 0x25ac2 73ee: 0c 94 da cf jmp 0x19fb4 ; 0x19fb4 73f2: 0c 94 0d d4 jmp 0x1a81a ; 0x1a81a () [clone .lto_priv.452]> 73f6: 0c 94 e6 77 jmp 0xefcc ; 0xefcc 73fa: 0d 94 9b 27 jmp 0x24f36 ; 0x24f36 73fe: 0d 94 ac 6f jmp 0x2df58 ; 0x2df58 7402: 0d 94 32 28 jmp 0x25064 ; 0x25064 7406: 0d 94 d0 66 jmp 0x2cda0 ; 0x2cda0 740a: 0c 94 c7 cf jmp 0x19f8e ; 0x19f8e 740e: 0d 94 5c 27 jmp 0x24eb8 ; 0x24eb8 7412: 0c 94 03 d4 jmp 0x1a806 ; 0x1a806 () [clone .lto_priv.454]> 7416: 0d 94 9c 37 jmp 0x26f38 ; 0x26f38 741a: 0d 94 50 07 jmp 0x20ea0 ; 0x20ea0 741e: 0c 94 a0 71 jmp 0xe340 ; 0xe340 7422: 0d 94 8c 23 jmp 0x24718 ; 0x24718 7426: 0d 94 42 6a jmp 0x2d484 ; 0x2d484 742a: 0d 94 9a 99 jmp 0x33334 ; 0x33334 742e: 0d 94 00 25 jmp 0x24a00 ; 0x24a00 7432: 0c 94 a1 d9 jmp 0x1b342 ; 0x1b342 7436: 0c 94 ec d2 jmp 0x1a5d8 ; 0x1a5d8 743a: 0d 94 52 6a jmp 0x2d4a4 ; 0x2d4a4 743e: 0c 94 2a d4 jmp 0x1a854 ; 0x1a854 7442: 0d 94 a8 0f jmp 0x21f50 ; 0x21f50 7446: 0d 94 12 9a jmp 0x33424 ; 0x33424 744a: 0c 94 1c d4 jmp 0x1a838 ; 0x1a838 () [clone .lto_priv.449]> 744e: 0d 94 6e 15 jmp 0x22adc ; 0x22adc 7452: 0c 94 37 e0 jmp 0x1c06e ; 0x1c06e 7456: 0c 94 14 e0 jmp 0x1c028 ; 0x1c028 745a: 0c 94 f0 df jmp 0x1bfe0 ; 0x1bfe0 745e: 0c 94 5e d7 jmp 0x1aebc ; 0x1aebc 7462: 0d 94 b3 99 jmp 0x33366 ; 0x33366 7466: 0d 94 b0 25 jmp 0x24b60 ; 0x24b60 746a: 0d 94 c8 0b jmp 0x21790 ; 0x21790 746e: 0c 94 8a d9 jmp 0x1b314 ; 0x1b314 7472: 0d 94 39 6a jmp 0x2d472 ; 0x2d472 7476: 0d 94 f1 55 jmp 0x2abe2 ; 0x2abe2 747a: 0d 94 31 06 jmp 0x20c62 ; 0x20c62 747e: 0c 94 17 d4 jmp 0x1a82e ; 0x1a82e () [clone .lto_priv.450]> 7482: 0c 94 82 d9 jmp 0x1b304 ; 0x1b304 7486: 0d 94 ce 07 jmp 0x20f9c ; 0x20f9c 748a: 0c 94 21 d4 jmp 0x1a842 ; 0x1a842 () [clone .lto_priv.448]> 748e: 0d 94 d8 24 jmp 0x249b0 ; 0x249b0 7492: 0d 94 ec 27 jmp 0x24fd8 ; 0x24fd8 7496: 0c 94 e4 d8 jmp 0x1b1c8 ; 0x1b1c8 749a: 0c 94 d1 cf jmp 0x19fa2 ; 0x19fa2 749e: 0d 94 90 23 jmp 0x24720 ; 0x24720 74a2: 0d 94 15 9a jmp 0x3342a ; 0x3342a 74a6: 0d 94 62 6a jmp 0x2d4c4 ; 0x2d4c4 74aa: 0d 94 56 69 jmp 0x2d2ac ; 0x2d2ac 74ae: 0d 94 56 23 jmp 0x246ac ; 0x246ac 74b2: 0d 94 14 a0 jmp 0x34028 ; 0x34028 74b6: 0d 94 a2 27 jmp 0x24f44 ; 0x24f44 74ba: 0d 94 0b 6a jmp 0x2d416 ; 0x2d416 74be: 0d 94 26 a0 jmp 0x3404c ; 0x3404c 74c2: 0c 94 78 d0 jmp 0x1a0f0 ; 0x1a0f0 74c6: 0d 94 2f 27 jmp 0x24e5e ; 0x24e5e 74ca: 0c 94 77 cf jmp 0x19eee ; 0x19eee 74ce: 0c 94 e7 d8 jmp 0x1b1ce ; 0x1b1ce 74d2: 0c 94 cd cf jmp 0x19f9a ; 0x19f9a 74d6: 0d 94 25 27 jmp 0x24e4a ; 0x24e4a 74da: 0d 94 41 67 jmp 0x2ce82 ; 0x2ce82 74de: 0d 94 8d 27 jmp 0x24f1a ; 0x24f1a 74e2: 0d 94 30 67 jmp 0x2ce60 ; 0x2ce60 74e6: 0c 94 ea d8 jmp 0x1b1d4 ; 0x1b1d4 74ea: 0d 94 44 66 jmp 0x2cc88 ; 0x2cc88 74ee: 0d 94 42 24 jmp 0x24884 ; 0x24884 74f2: 0c 94 0a e0 jmp 0x1c014 ; 0x1c014 74f6: 0d 94 c4 25 jmp 0x24b88 ; 0x24b88 74fa: 0c 94 db cf jmp 0x19fb6 ; 0x19fb6 74fe: 0c 94 e3 d4 jmp 0x1a9c6 ; 0x1a9c6 7502: 0c 94 c3 d4 jmp 0x1a986 ; 0x1a986 7506: 0d 94 e2 24 jmp 0x249c4 ; 0x249c4 750a: 0c 94 bf cf jmp 0x19f7e ; 0x19f7e 750e: 0c 94 f8 df jmp 0x1bff0 ; 0x1bff0 7512: 0d 94 8c 1e jmp 0x23d18 ; 0x23d18 7516: 0c 94 e7 cf jmp 0x19fce ; 0x19fce 751a: 0d 94 76 67 jmp 0x2ceec ; 0x2ceec 751e: 0d 94 7a 41 jmp 0x282f4 ; 0x282f4 7522: 0d 94 1c 2d jmp 0x25a38 ; 0x25a38 7526: 0d 94 da 26 jmp 0x24db4 ; 0x24db4 752a: 0d 94 ef 36 jmp 0x26dde ; 0x26dde 752e: 0d 94 92 6a jmp 0x2d524 ; 0x2d524 7532: 0c 94 22 65 jmp 0xca44 ; 0xca44 <_GLOBAL__sub_D_card> 7536: 0d 94 9d 69 jmp 0x2d33a ; 0x2d33a 753a: 0d 94 32 2a jmp 0x25464 ; 0x25464 753e: 0d 94 94 27 jmp 0x24f28 ; 0x24f28 7542: 0d 94 7c 06 jmp 0x20cf8 ; 0x20cf8 7546: 0c 94 32 d3 jmp 0x1a664 ; 0x1a664 754a: 0d 94 01 1d jmp 0x23a02 ; 0x23a02 754e: 0d 94 62 16 jmp 0x22cc4 ; 0x22cc4 7552: 0d 94 8a 6a jmp 0x2d514 ; 0x2d514 7556: 0c 94 96 d9 jmp 0x1b32c ; 0x1b32c 755a: 0c 94 17 e7 jmp 0x1ce2e ; 0x1ce2e 755e: 0c 94 a4 cf jmp 0x19f48 ; 0x19f48 7562: 0c 94 63 75 jmp 0xeac6 ; 0xeac6 <__vector_23+0x128> 7566: 0d 94 11 a0 jmp 0x34022 ; 0x34022 756a: 0d 94 d9 69 jmp 0x2d3b2 ; 0x2d3b2 756e: 0d 94 ad 07 jmp 0x20f5a ; 0x20f5a 7572: 0c 94 08 75 jmp 0xea10 ; 0xea10 <__vector_23+0x72> 7576: 0d 94 64 45 jmp 0x28ac8 ; 0x28ac8 757a: 0c 94 00 e0 jmp 0x1c000 ; 0x1c000 757e: 0d 94 18 1d jmp 0x23a30 ; 0x23a30 7582: 0d 94 22 11 jmp 0x22244 ; 0x22244 7586: 0c 94 ac cf jmp 0x19f58 ; 0x19f58 758a: 0d 94 c2 07 jmp 0x20f84 ; 0x20f84 758e: 0c 94 13 75 jmp 0xea26 ; 0xea26 <__vector_23+0x88> 7592: 0d 94 cb 29 jmp 0x25396 ; 0x25396 7596: 0d 94 3e 2b jmp 0x2567c ; 0x2567c 759a: 0d 94 ee 3e jmp 0x27ddc ; 0x27ddc 759e: 0c 94 0c d8 jmp 0x1b018 ; 0x1b018 75a2: 0c 94 b0 d9 jmp 0x1b360 ; 0x1b360 75a6: 0c 94 ee 74 jmp 0xe9dc ; 0xe9dc <__vector_23+0x3e> 75aa: 0d 94 eb 26 jmp 0x24dd6 ; 0x24dd6 75ae: 0d 94 f6 2e jmp 0x25dec ; 0x25dec 75b2: 0d 94 0c 25 jmp 0x24a18 ; 0x24a18 75b6: 0d 94 69 10 jmp 0x220d2 ; 0x220d2 75ba: 0c 94 e3 cf jmp 0x19fc6 ; 0x19fc6 75be: 0d 94 05 6a jmp 0x2d40a ; 0x2d40a 75c2: 0d 94 08 6a jmp 0x2d410 ; 0x2d410 75c6: 0c 94 af cf jmp 0x19f5e ; 0x19f5e 75ca: 0d 94 6d 10 jmp 0x220da ; 0x220da 75ce: 0d 94 11 55 jmp 0x2aa22 ; 0x2aa22 75d2: 0d 94 13 3c jmp 0x27826 ; 0x27826 75d6: 0c 94 f0 d8 jmp 0x1b1e0 ; 0x1b1e0 75da: 0d 94 77 68 jmp 0x2d0ee ; 0x2d0ee 75de: 0d 94 fe 0a jmp 0x215fc ; 0x215fc 75e2: 0d 94 23 42 jmp 0x28446 ; 0x28446 75e6: 0d 94 dd 07 jmp 0x20fba ; 0x20fba 75ea: 0c 94 e6 df jmp 0x1bfcc ; 0x1bfcc 75ee: 0c 94 d5 cf jmp 0x19faa ; 0x19faa 75f2: 0d 94 13 0f jmp 0x21e26 ; 0x21e26 75f6: 0d 94 cf 3c jmp 0x2799e ; 0x2799e 75fa: 0c 94 08 d4 jmp 0x1a810 ; 0x1a810 () [clone .lto_priv.453]> 75fe: 0d 94 93 69 jmp 0x2d326 ; 0x2d326 7602: 0c 94 fc d8 jmp 0x1b1f8 ; 0x1b1f8 7606: 0d 94 21 a0 jmp 0x34042 ; 0x34042 760a: 0d 94 80 2c jmp 0x25900 ; 0x25900 760e: 0c 94 7a d9 jmp 0x1b2f4 ; 0x1b2f4 7612: 0d 94 56 29 jmp 0x252ac ; 0x252ac 7616: 0d 94 a5 23 jmp 0x2474a ; 0x2474a 761a: 0c 94 b9 e4 jmp 0x1c972 ; 0x1c972 761e: 0c 94 40 75 jmp 0xea80 ; 0xea80 <__vector_23+0xe2> 7622: 0c 94 d2 df jmp 0x1bfa4 ; 0x1bfa4 7626: 0d 94 96 69 jmp 0x2d32c ; 0x2d32c 762a: 0c 94 a0 cf jmp 0x19f40 ; 0x19f40 762e: 0d 94 ce 26 jmp 0x24d9c ; 0x24d9c 7632: 0d 94 03 1d jmp 0x23a06 ; 0x23a06 7636: 0d 94 a6 0e jmp 0x21d4c ; 0x21d4c 763a: 0d 94 ce 25 jmp 0x24b9c ; 0x24b9c 763e: 0d 94 6d 2f jmp 0x25eda ; 0x25eda 7642: 0c 94 ce 78 jmp 0xf19c ; 0xf19c 7646: 0d 94 4e 0d jmp 0x21a9c ; 0x21a9c 764a: 0d 94 15 26 jmp 0x24c2a ; 0x24c2a 764e: 0d 94 21 68 jmp 0x2d042 ; 0x2d042 7652: 0c 94 72 d9 jmp 0x1b2e4 ; 0x1b2e4 7656: 0d 94 4a 6a jmp 0x2d494 ; 0x2d494 765a: 0c 94 65 d2 jmp 0x1a4ca ; 0x1a4ca 765e: 0d 94 48 75 jmp 0x2ea90 ; 0x2ea90 7662: 0d 94 94 24 jmp 0x24928 ; 0x24928 7666: 0c 94 37 75 jmp 0xea6e ; 0xea6e <__vector_23+0xd0> 766a: 0d 94 42 27 jmp 0x24e84 ; 0x24e84 766e: 0d 94 0f 2d jmp 0x25a1e ; 0x25a1e 7672: 0d 94 5a 6a jmp 0x2d4b4 ; 0x2d4b4 7676: 0c 94 9a cf jmp 0x19f34 ; 0x19f34 767a: 0c 94 55 e0 jmp 0x1c0aa ; 0x1c0aa 767e: 0c 94 93 d2 jmp 0x1a526 ; 0x1a526 7682: 0c 94 75 75 jmp 0xeaea ; 0xeaea <__vector_23+0x14c> 7686: 0d 94 02 26 jmp 0x24c04 ; 0x24c04 768a: 0c 94 93 d7 jmp 0x1af26 ; 0x1af26 768e: 0d 94 3d 6f jmp 0x2de7a ; 0x2de7a 7692: 0d 94 f5 9f jmp 0x33fea ; 0x33fea 7696: 0d 94 ba 25 jmp 0x24b74 ; 0x24b74 769a: 0c 94 41 e0 jmp 0x1c082 ; 0x1c082 769e: 0d 94 a2 1d jmp 0x23b44 ; 0x23b44 76a2: 0d 94 af 9f jmp 0x33f5e ; 0x33f5e 76a6: 0d 94 54 0d jmp 0x21aa8 ; 0x21aa8 76aa: 0c 94 87 d2 jmp 0x1a50e ; 0x1a50e 76ae: 0c 94 c5 df jmp 0x1bf8a ; 0x1bf8a 76b2: 0c 94 c3 cf jmp 0x19f86 ; 0x19f86 76b6: 0c 94 e0 5c jmp 0xb9c0 ; 0xb9c0 76ba: 0c 94 2d e0 jmp 0x1c05a ; 0x1c05a 76be: 0d 94 62 67 jmp 0x2cec4 ; 0x2cec4 76c2: 0d 94 f7 26 jmp 0x24dee ; 0x24dee 76c6: 0d 94 07 42 jmp 0x2840e ; 0x2840e 76ca: 0c 94 ed d8 jmp 0x1b1da ; 0x1b1da 76ce: 0d 94 72 6a jmp 0x2d4e4 ; 0x2d4e4 76d2: 0d 94 3c 6a jmp 0x2d478 ; 0x2d478 76d6: 0d 94 c0 2f jmp 0x25f80 ; 0x25f80 76da: 0d 94 16 67 jmp 0x2ce2c ; 0x2ce2c 76de: 0c 94 9e d2 jmp 0x1a53c ; 0x1a53c 76e2: 0d 94 11 32 jmp 0x26422 ; 0x26422 000076e6 <__trampolines_end>: 76e6: 6e 61 ori r22, 0x1E ; 30 76e8: 6e 00 .word 0x006e ; ???? 000076ea <__c.2228>: 76ea: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 76fa: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 770a: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 771a: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 772a: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 773a: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 774a: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 775a: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 776a: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 777a: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 778a: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 779a: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 77aa: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 77ba: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 77ca: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 77da: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 000077e8 : 77e8: 22 00 ". 000077ea : ... 000077eb : 77eb: 20 45 53 50 00 ESP. 000077f0 : 77f0: 20 4e 53 50 00 NSP. 000077f5 : 77f5: 20 4f 46 46 00 OFF. 000077fa : 77fa: 20 4f 4e 00 ON. 000077fe : 77fe: 50 56 30 31 00 PV01. 00007803 : 7803: 20 5b 4d 50 5d 20 00 [MP] . 0000780a : 780a: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 781a: 74 65 73 00 tes. 0000781e : 781e: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 00007829 : 7829: 4d 33 31 30 00 M310. 0000782e : 782e: 4d 31 31 32 00 M112. 00007833 : 7833: 4d 31 31 30 00 M110. 00007838 : 7838: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 00007847 : 7847: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 00007857 : 7857: 54 4d 3a 20 73 74 6f 72 65 64 20 63 61 6c 69 62 TM: stored calib 7867: 72 61 74 69 6f 6e 20 69 6e 76 61 6c 69 64 2c 20 ration invalid, 7877: 72 65 73 65 74 74 69 6e 67 00 resetting. 00007881 : 7881: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 7891: 72 65 74 72 69 65 76 65 64 00 retrieved. 0000789b : 789b: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 78ab: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 78bb: 64 00 d. 000078bd : 78bd: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 78cd: 00 00 8c 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 78dd: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 78ed: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 78fd: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 790d: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 791d: 00 00 00 00 cd cc cc 3e 00 00 c8 41 9c 53 49 3f .......>...A.SI? 792d: 80 f9 46 43 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 ..FC.B.B.Z4?Lb.E 793d: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 794d: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 c8 42 ......A....?...B 795d: 00 00 c8 42 00 00 40 41 00 00 f0 42 c0 03 00 00 ...B..@A...B.... 796d: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 20 ............... 797d: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 0000798e : 798e: 43 75 73 74 6f 6d 00 Custom. 00007995 : 7995: 4e 79 6c 6f 6e 50 41 00 NylonPA. 0000799d : 799d: 53 61 74 69 6e 20 20 00 Satin . 000079a5 : 79a5: 54 65 78 74 75 72 00 Textur. 000079ac : 79ac: 53 6d 6f 6f 74 68 00 Smooth. 000079b3 : 79b3: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 79c3: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 79d3: 78 70 65 63 74 65 64 00 xpected. 000079db : 79db: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 79eb: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 79fb: 70 65 63 74 65 64 00 pected. 00007a02 : 7a02: 31 2e 30 00 1.0. 00007a06 : 7a06: 31 2e 35 00 1.5. 00007a0a : 7a0a: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 00007a12 : 7a12: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 7a22: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 00007a2f : 7a2f: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 7a3f: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 00007a48 <_PRI_LANG_SIGNATURE>: 7a48: ff ff ff ff .... 00007a4c : 7a4c: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7a5c: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7a6c: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7a7c: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7a8c: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7a9c: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7aac: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7abc: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7acc: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7adc: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 7aec: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7afc: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7b0c: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7b1c: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7b2c: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7b3c: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7b4c: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7b5c: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7b6c: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7b7c: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7b8c: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7b9c: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7bac: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7bbc: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7bcc: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7c08: 00 40 14 54 .@.T 00007c0c : 7c0c: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7c1c: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007c24 : 7c24: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7c34: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007c3c : 7c3c: 4e 41 4e NAN 00007c3f : 7c3f: 49 4e 46 INF 00007c42 : 7c42: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7c52: 20 69 6e 70 75 74 00 input. 00007c59 : 7c59: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7c69: 20 75 73 65 72 00 user. 00007c6f : 7c6f: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007c80 : 7c80: 00 00 7f 43 00 80 54 43 00 00 52 43 ...C..TC..RC 00007c8c : 7c8c: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007c98 : 7c98: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007ca4 : 7ca4: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00007cb0 : 7cb0: 25 33 64 20 73 74 65 70 3d 25 32 64 20 6d 73 63 %3d step=%2d msc 7cc0: 6e 74 3d 25 34 64 0a 00 nt=%4d.. 00007cc8 : 7cc8: 00 00 7f 43 00 80 58 43 9a d9 51 43 ...C..XC..QC 00007cd4 : 7cd4: ff ff ff ... 00007cd7 : 7cd7: 20 41 3a 00 A:. 00007cdb : 7cdb: 20 50 3a 00 P:. 00007cdf : 7cdf: 20 42 40 3a 00 B@:. 00007ce4 : 7ce4: 20 40 3a 00 @:. 00007ce8 : 7ce8: 20 2f 00 /. 00007ceb : 7ceb: 20 54 30 3a 00 T0:. 00007cf0 : 7cf0: 20 2f 00 /. 00007cf3 : 7cf3: 20 42 3a 00 B:. 00007cf7 : 7cf7: 20 2f 00 /. 00007cfa : 7cfa: 54 3a 00 T:. 00007cfd : 7cfd: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7d0d: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7d1d: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007d2e : 7d2e: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7d3e: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7d4e: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 7d5e: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007d67 : 7d67: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7d77: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7d87: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007d96 : 7d96: 20 20 00 . 00007d99 : 7d99: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007daa : 7daa: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7dba: 20 35 2e 30 66 00 5.0f. 00007dc0 : 7dc0: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007dcd : 7dcd: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7ddd: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007deb : 7deb: 20 45 3a 00 E:. 00007def : 7def: 20 5a 3a 00 Z:. 00007df3 : 7df3: 20 59 3a 00 Y:. 00007df7 : 7df7: 20 45 3a 00 E:. 00007dfb : 7dfb: 20 5a 3a 00 Z:. 00007dff : 7dff: 20 59 3a 00 Y:. 00007e03 : 7e03: 58 3a 00 X:. 00007e06 : 7e06: 20 2d 3e 20 00 -> . 00007e0b : 7e0b: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007e17 : 7e17: 2c 20 00 , . 00007e1a : 7e1a: 66 73 65 6e 73 6f 72 20 76 30 2e 34 20 69 6e 20 fsensor v0.4 in 7e2a: 66 61 75 6c 74 20 72 61 6e 67 65 20 34 2e 36 2d fault range 4.6- 7e3a: 35 56 20 2d 20 75 6e 63 6f 6e 6e 65 63 74 65 64 5V - unconnected ... 00007e4b : 7e4b: 66 73 65 6e 73 6f 72 20 69 6e 20 66 6f 72 62 69 fsensor in forbi 7e5b: 64 64 65 6e 20 72 61 6e 67 65 20 31 2e 35 2d 33 dden range 1.5-3 7e6b: 56 20 2d 20 63 68 65 63 6b 20 73 65 6e 73 6f 72 V - check sensor ... 00007e7c : 7e7c: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7e8c: 6f 77 6e 00 own. 00007e90 : 7e90: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007e98 : 7e98: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7ea8: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007eb7 : 7eb7: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7ec7: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7ed7: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7ee7: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007ef4 : 7ef4: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7f04: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7f14: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007f1d : 7f1d: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007f25 : 7f25: 54 3a 00 T:. 00007f28 : 7f28: 47 31 20 5a 25 2d 2e 33 66 20 46 25 2d 2e 33 66 G1 Z%-.3f F%-.3f ... 00007f39 : 7f39: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 00007f49 : 7f49: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 7f59: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00007f63 : 7f63: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00007f6e : 7f6e: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 7f7e: 20 72 61 6e 67 65 21 00 range!. 00007f86 <_sPrinterName>: 7f86: 4d 4b 33 53 00 MK3S. 00007f8b <_sPrinterMmuName>: 7f8b: 4d 4b 33 53 4d 4d 55 33 00 MK3SMMU3. 00007f94 <_nPrinterMmuType>: 7f94: 5e 76 ^v 00007f96 <_nPrinterType>: 7f96: 2e 01 .. 00007f98 : 7f98: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007fa0 : 7fa0: 25 33 64 00 %3d. 00007fa4 : 7fa4: 20 0a 20 0a 20 0a 20 00 . . . . 00007fac : 7fac: 25 53 53 74 61 74 69 73 74 69 63 73 3a 0a 25 53 %SStatistics:.%S 7fbc: 20 20 4d 37 38 20 53 25 6c 75 20 54 25 6c 75 0a M78 S%lu T%lu. ... 00007fcd : 7fcd: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 7fdd: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 7fed: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 7ffd: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 800d: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 801d: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 802d: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 803d: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 804d: 0a 00 .. 0000804f : 804f: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 805f: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 0000806e : 806e: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 807e: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 808e: 25 2e 32 66 0a 00 %.2f.. 00008094 : 8094: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 80a4: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 80b4: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 80c4: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 80d4: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 80e4: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 80f4: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 8104: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 8114: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 8124: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 8134: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 8144: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 8154: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 8164: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 8174: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 8184: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00008195 : 8195: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 81a5: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 81b5: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 81c5: 2e 32 66 0a 00 .2f.. 000081ca : 81ca: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 81da: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 81ea: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 000081f7 : 81f7: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 8207: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 8217: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 8227: 66 0a 25 53 55 53 74 65 70 20 72 65 73 6f 6c 75 f.%SUStep resolu 8237: 74 69 6f 6e 3a 20 0a 25 53 20 4d 33 35 30 20 58 tion: .%S M350 X 8247: 25 64 20 59 25 64 20 5a 25 64 20 45 25 64 0a 25 %d Y%d Z%d E%d.% 8257: 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 72 61 74 SMaximum feedrat 8267: 65 73 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f es - normal (mm/ 8277: 73 29 3a 0a 25 53 20 20 4d 32 30 33 20 58 25 2e s):.%S M203 X%. 8287: 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 2f Y%.2f Z%.2f E 8297: 25 2e 32 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 %.2f.%SMaximum f 82a7: 65 65 64 72 61 74 65 73 20 2d 20 73 74 65 61 6c eedrates - steal 82b7: 74 68 20 28 6d 6d 2f 73 29 3a 0a 25 53 20 20 4d th (mm/s):.%S M 82c7: 32 30 33 20 58 25 2e 32 66 20 59 25 2e 32 66 20 203 X%.2f Y%.2f 82d7: 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 4d 61 Z%.2f E%.2f.%SMa 82e7: 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 61 74 69 ximum accelerati 82f7: 6f 6e 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f on - normal (mm/ 8307: 73 32 29 3a 0a 25 53 20 20 4d 32 30 31 20 58 25 s2):.%S M201 X% 8317: 6c 75 20 59 25 6c 75 20 5a 25 6c 75 20 45 25 6c lu Y%lu Z%lu E%l 8327: 75 0a 25 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 u.%SMaximum acce 8337: 6c 65 72 61 74 69 6f 6e 20 2d 20 73 74 65 61 6c leration - steal 8347: 74 68 20 28 6d 6d 2f 73 32 29 3a 0a 25 53 20 20 th (mm/s2):.%S 8357: 4d 32 30 31 20 58 25 6c 75 20 59 25 6c 75 20 5a M201 X%lu Y%lu Z 8367: 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 63 65 6c %lu E%lu.%SAccel 8377: 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 69 6e 74 eration: P=print 8387: 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 54 3d 74 , R=retract, T=t 8397: 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 34 20 50 ravel.%S M204 P 83a7: 25 2e 32 66 20 52 25 2e 32 66 20 54 25 2e 32 66 %.2f R%.2f T%.2f 83b7: 0a 25 53 41 64 76 61 6e 63 65 64 20 76 61 72 69 .%SAdvanced vari 83c7: 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 66 65 65 ables: S=Min fee 83d7: 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 54 3d drate (mm/s), T= 83e7: 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 65 64 72 Min travel feedr 83f7: 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 3d 6d 69 ate (mm/s), B=mi 8407: 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 20 74 69 nimum segment ti 8417: 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 78 69 6d me (us), X=maxim 8427: 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d 6d 2f 73 um XY jerk (mm/s 8437: 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d 20 5a 20 ), Z=maximum Z 8447: 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 20 45 3d jerk (mm/s), E= 8457: 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 6b 20 28 maximum E jerk ( 8467: 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 35 20 53 mm/s).%S M205 S 8477: 25 2e 32 66 20 54 25 2e 32 66 20 42 25 6c 75 20 %.2f T%.2f B%lu 8487: 58 25 2e 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 X%.2f Y%.2f Z%.2 8497: 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d 65 20 6f f E%.2f.%SHome o 84a7: 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 53 20 20 ffset (mm):.%S 84b7: 4d 32 30 36 20 58 25 2e 32 66 20 59 25 2e 32 66 M206 X%.2f Y%.2f 84c7: 20 5a 25 2e 32 66 0a 00 Z%.2f.. 000084cf : 84cf: 54 4d 3a 20 52 5b 25 75 5d 20 65 73 74 69 6d 61 TM: R[%u] estima 84df: 74 65 2e 00 te.. 000084e3 : 84e3: 54 4d 3a 20 25 53 20 52 20 25 64 43 00 TM: %S R %dC. 000084f0 : 84f0: 54 4d 3a 20 25 53 20 43 20 65 73 74 2e 00 TM: %S C est.. 000084fe : 84fe: 54 4d 3a 20 63 6f 6f 6c 20 64 6f 77 6e 20 3c 25 TM: cool down <% 850e: 64 43 00 dC. 00008511 : 8511: 72 65 66 69 6e 65 00 refine. 00008518 : 8518: 69 6e 69 74 69 61 6c 00 initial. 00008520 : 8520: 54 4d 3a 20 63 61 6c 69 62 72 2e 20 66 61 69 6c TM: calibr. fail 8530: 65 64 21 00 ed!. 00008534 : 8534: 54 4d 3a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 TM: calibration 8544: 73 74 61 72 74 00 start. 0000854a : 854a: 54 4d 3a 20 43 61 6c 2e 20 4e 4f 54 20 49 44 4c TM: Cal. NOT IDL 855a: 45 00 E. 0000855c : 855c: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00008567 : 8567: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00008572 : 8572: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 0000857f : 857f: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 858f: 49 4f 4e 00 ION. 00008593 : 8593: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 000085a3 : 85a3: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 000085b3 : ... 000085b4 : 85b4: 33 2e 31 34 2e 31 00 3.14.1. 000085bb : 85bb: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 85cb: 20 46 69 6c 65 3a 20 00 File: . 000085d3 : 85d3: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 000085e1 : 85e1: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 000085f1 : 85f1: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 000085fd : 85fd: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 0000860d : 860d: 25 33 64 2f 25 33 64 00 %3d/%3d. 00008615 : 8615: 4f 4b 00 OK. 00008618 : 8618: 42 41 44 00 BAD. 0000861c : 861c: 52 41 4d 42 6f 20 46 41 4e 20 00 RAMBo FAN . 00008627 : 8627: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008634 : 8634: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008642 : 8642: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008650 <_ZZ16process_commandsvE3__c__97_>: 8650: 22 28 32 29 00 "(2). 00008655 <_ZZ16process_commandsvE3__c__96_>: 8655: 25 53 3a 20 25 53 0a 00 %S: %S.. 0000865d <_ZZ16process_commandsvE3__c__95_>: 865d: 2c 20 4d 39 30 37 20 45 20 69 67 6e 6f 72 65 64 , M907 E ignored ... 0000866e <_ZZ16process_commandsvE3__c__94_>: 866e: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 0000867f <_ZZ16process_commandsvE3__c__93_>: 867f: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 00008689 <_ZZ16process_commandsvE3__c__92_>: 8689: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 0000869a <_ZZ16process_commandsvE3__c__90_>: 869a: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 86aa: 65 70 2c 20 75 6d 00 ep, um. 000086b1 <_ZZ16process_commandsvE3__c__91_>: 86b1: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 86c1: 3a 20 00 : . 000086c4 <_ZZ16process_commandsvE3__c__89_>: 86c4: 50 3a 00 P:. 000086c7 <_ZZ16process_commandsvE3__c__88_>: 86c7: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 86d7: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 86e7: 65 3a 00 e:. 000086ea <_ZZ16process_commandsvE3__c__87_>: 86ea: 20 41 00 A. 000086ed <_ZZ16process_commandsvE3__c__86_>: 86ed: 20 50 00 P. 000086f0 <_ZZ16process_commandsvE3__c__85_>: 86f0: 20 42 00 B. 000086f3 <_ZZ16process_commandsvE3__c__84_>: 86f3: 20 4c 00 L. 000086f6 <_ZZ16process_commandsvE3__c__83_>: 86f6: 20 52 00 R. 000086f9 <_ZZ16process_commandsvE3__c__82_>: 86f9: 20 5a 00 Z. 000086fc <_ZZ16process_commandsvE3__c__81_>: 86fc: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 0000870d <_ZZ16process_commandsvE3__c__80_>: 870d: 53 68 65 65 74 20 00 Sheet . 00008714 <_ZZ16process_commandsvE3__c__79_>: 8714: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 8724: 52 41 4e 47 45 00 RANGE. 0000872a <_ZZ16process_commandsvE3__c__78_>: 872a: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 873a: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 00008749 <_ZZ16process_commandsvE3__c__77_>: 8749: 41 55 54 4f 00 AUTO. 0000874e <_ZZ16process_commandsvE3__c__76_>: 874e: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 0000875e <_ZZ16process_commandsvE3__c__75_>: 875e: 4d 32 35 36 20 42 25 64 20 44 25 64 20 53 25 64 M256 B%d D%d S%d 876e: 20 54 25 75 0a 00 T%u.. 00008774 <_ZZ16process_commandsvE3__c__74_>: 8774: 20 64 3a 00 d:. 00008778 <_ZZ16process_commandsvE3__c__73_>: 8778: 20 69 3a 00 i:. 0000877c <_ZZ16process_commandsvE3__c__72_>: 877c: 20 70 3a 00 p:. 00008780 <_ZZ16process_commandsvE3__c__71_>: 8780: 20 64 3a 00 d:. 00008784 <_ZZ16process_commandsvE3__c__70_>: 8784: 20 69 3a 00 i:. 00008788 <_ZZ16process_commandsvE3__c__69_>: 8788: 20 70 3a 00 p:. 0000878c <_ZZ16process_commandsvE3__c__68_>: 878c: 25 69 25 25 0a 00 %i%%.. 00008792 <_ZZ16process_commandsvE3__c__67_>: 8792: 25 69 25 25 0a 00 %i%%.. 00008798 <_ZZ16process_commandsvE3__c__66_>: 8798: 22 28 31 29 00 "(1). 0000879d <_ZZ16process_commandsvE3__c__59_>: 879d: 2f 2f 00 //. 000087a0 <_ZZ16process_commandsvE3__c__58_>: ... 000087a1 <_ZZ16process_commandsvE3__c__57_>: 87a1: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 87b1: 31 00 1. 000087b3 <_ZZ16process_commandsvE3__c__56_>: 87b3: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 000087c2 <_ZZ16process_commandsvE3__c__55_>: 87c2: 31 2e 30 00 1.0. 000087c6 <_ZZ16process_commandsvE3__c__54_>: 87c6: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 87d6: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 87e6: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 87f6: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 8806: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 8816: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 00008820 <_ZZ16process_commandsvE3__c__53_>: 8820: 37 37 33 31 30 32 34 65 64 00 7731024ed. 0000882a <_ZZ16process_commandsvE3__c__52_>: 882a: 5f 00 _. 0000882c <_ZZ16process_commandsvE3__c__51_>: 882c: 38 32 37 39 00 8279. 00008831 <_ZZ16process_commandsvE3__c__50_>: 8831: 2b 00 +. 00008833 <_ZZ16process_commandsvE3__c__49_>: 8833: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 8843: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 00008851 <_ZZ16process_commandsvE3__c__48_>: 8851: 4d 31 31 33 20 53 00 M113 S. 00008858 <_ZZ16process_commandsvE3__c__47_>: 8858: 6f 6b 20 00 ok . 0000885c <_ZZ16process_commandsvE3__c__41_>: 885c: 6e 2f 61 00 n/a. 00008860 <_ZZ16process_commandsvE3__c__40_>: 8860: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 8870: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 00008880 : 8880: 00 01 25 31 1d 0c 40 24 30 1c 0b 45 23 2f 1b 0a ..%1..@$0..E#/.. 8890: 17 ff 04 06 22 2b 1a 03 36 37 35 38 ...."+..6758 0000889c <_ZZ16process_commandsvE3__c__39_>: 889c: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 000088ab <_ZZ16process_commandsvE3__c__36_>: 88ab: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 88bb: 25 73 0a 00 %s.. 000088bf <_ZZ16process_commandsvE3__c__30_>: 88bf: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 88cf: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 000088dd <_ZZ16process_commandsvE3__c__29_>: 88dd: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 88ed: 74 6f 72 00 tor. 000088f1 <_ZZ16process_commandsvE3__c__25_>: 88f1: 73 65 74 00 set. 000088f5 <_ZZ16process_commandsvE3__c__24_>: 88f5: 6e 6f 7a 7a 6c 65 00 nozzle. 000088fc <_ZZ16process_commandsvE3__c__23_>: 88fc: 4d 42 4c 00 MBL. 00008900 <_ZZ16process_commandsvE3__c__22_>: 8900: 46 52 00 FR. 00008903 <_ZZ16process_commandsvE3__c__21_>: 8903: 4c 7a 00 Lz. 00008906 <_ZZ16process_commandsvE3__c__20_>: 8906: 4c 61 6e 67 00 Lang. 0000890b <_ZZ16process_commandsvE3__c__19_>: 890b: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 2d 45 49 4e 53 1_75mm_MK3S-EINS 891b: 79 5f 31 30 61 2d 45 33 44 52 45 56 4f 00 y_10a-E3DREVO. 00008929 <_ZZ16process_commandsvE3__c__18_>: 8929: 52 65 76 00 Rev. 0000892d <_ZZ16process_commandsvE3__c__17_>: 892d: 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 00008939 <_ZZ16process_commandsvE3__c__16_>: 8939: 46 69 72 00 Fir. 0000893d <_ZZ16process_commandsvE3__c__15_>: 893d: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 00008948 <_ZZ16process_commandsvE3__c__14_>: 8948: 53 4e 00 SN. 0000894b <_ZZ16process_commandsvE3__c__13_>: 894b: 52 45 53 45 54 00 RESET. 00008951 <_ZZ16process_commandsvE3__c__12_>: 8951: 4d 4d 55 52 45 53 00 MMURES. 00008958 <_ZZ16process_commandsvE3__c__11_>: 8958: 75 76 6c 6f 00 uvlo. 0000895d : 895d: 46 41 4e 00 FAN. 00008961 : 8961: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 0000896b : 896b: 50 52 55 53 41 00 PRUSA. 00008971 : 8971: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 0000897b : 897b: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 00008985 : 8985: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 0000898f : 898f: 54 4d 43 5f 00 TMC_. 00008994 : 8994: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 000089a1 : 89a1: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 000089af : 89af: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 000089be : 89be: 43 52 41 53 48 5f 00 CRASH_. 000089c5 : 89c5: 4d 31 30 34 53 30 00 M104S0. 000089cc : 89cc: 47 31 58 31 30 59 31 38 30 46 34 30 30 30 00 G1X10Y180F4000. 000089db : 89db: 47 31 5a 31 30 46 31 33 30 30 00 G1Z10F1300. 000089e6 : 89e6: 4d 31 34 30 53 30 00 M140S0. 000089ed : 89ed: 47 31 45 2d 30 2e 30 37 35 46 32 31 30 30 00 G1E-0.075F2100. 000089fc : 89fc: 4d 32 30 34 53 31 30 30 30 00 M204S1000. 00008a06 : 8a06: 47 31 5a 35 46 37 32 30 30 00 G1Z5F7200. 00008a10 : 8a10: 47 31 45 2d 31 2e 35 46 32 31 30 30 00 G1E-1.5F2100. 00008a1d : 8a1d: 47 31 5a 30 2e 32 00 G1Z0.2. 00008a24 : 8a24: 47 31 58 32 30 32 2e 35 45 38 46 31 34 30 30 00 G1X202.5E8F1400. 00008a34 : 8a34: 47 31 59 2d 32 46 31 30 30 30 00 G1Y-2F1000. 00008a3f : 8a3f: 47 31 58 32 34 30 45 32 35 46 32 32 30 30 00 G1X240E25F2200. 00008a4e : 8a4e: 47 31 5a 30 2e 33 46 31 30 30 30 00 G1Z0.3F1000. 00008a5a : 8a5a: 47 31 58 35 35 45 38 46 32 30 30 30 00 G1X55E8F2000. 00008a67 : 8a67: 47 31 58 35 45 32 39 46 31 38 30 30 00 G1X5E29F1800. 00008a74 : 8a74: 47 31 58 35 35 45 32 39 46 31 30 37 33 00 G1X55E29F1073. 00008a82 : 8a82: 47 39 32 45 30 00 G92E0. 00008a88 : 8a88: 47 32 38 00 G28. 00008a8c : 8a8c: 4d 31 30 39 00 M109. 00008a91 : 8a91: 4d 31 39 30 00 M190. 00008a96 : 8a96: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 8aa6: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 8ab6: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 8ac6: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 8ad6: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 8ae6: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 8af6: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 8b06: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 00008b16 : 8b16: 4d 34 34 00 M44. 00008b1a : 8b1a: 30 2e 38 30 00 0.80. 00008b1f : 8b1f: 30 2e 36 30 00 0.60. 00008b24 : 8b24: 30 2e 34 30 00 0.40. 00008b29 : 8b29: 30 2e 32 35 00 0.25. 00008b2e : 8b2e: 47 32 38 20 58 59 00 G28 XY. 00008b35 : 8b35: 4d 20 38 34 00 M 84. 00008b3a : 8b3a: 85 2e 2e 00 .... 00008b3e : 8b3e: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008b4b : 8b4b: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 00008b58 : 8b58: 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f 72 20 Filament sensor 8b68: 62 6f 61 72 64 20 63 68 61 6e 67 65 20 64 65 74 board change det 8b78: 65 63 74 65 64 3a 20 72 65 76 69 73 69 6f 6e 25 ected: revision% 8b88: 53 0a 00 S.. 00008b8b : 8b8b: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8b9b: 74 20 73 65 6e 73 6f 72 20 6c 6f 77 20 6c 65 76 t sensor low lev 8bab: 65 6c 3a 20 25 34 2e 32 66 56 0a 00 el: %4.2fV.. 00008bb7 : 8bb7: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8bc7: 74 20 73 65 6e 73 6f 72 20 68 69 67 68 20 6c 65 t sensor high le 8bd7: 76 65 6c 3a 20 25 34 2e 32 66 56 0a 00 vel: %4.2fV.. 00008be4 : 8be4: 25 33 64 2f 30 00 %3d/0. 00008bea : 8bea: 25 33 64 2f 30 00 %3d/0. 00008bf0 : 8bf0: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 00008c00 : 8c00: 48 6f 74 65 6e 64 00 Hotend. 00008c07 : 8c07: 42 65 64 00 Bed. 00008c0b : 8c0b: 5a 00 Z. 00008c0d : 8c0d: 59 00 Y. 00008c0f : 8c0f: 58 00 X. 00008c11 <_ZL13STR_SEPARATOR.lto_priv.458>: 8c11: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8c21: 2d 2d 2d 2d 00 ----. 00008c26 : 8c26: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 8c36: 6c 4e 72 00 lNr. 00008c3a : 8c3a: df 6a e3 6a ed 89 e6 89 db 89 cc 89 18 6c c5 89 .j.j.........l.. 8c4a: 77 6b wk 00008c4c : 8c4c: 47 31 59 25 2e 34 66 45 25 2e 34 66 00 G1Y%.4fE%.4f. 00008c59 : 8c59: 47 31 5a 25 2e 32 66 00 G1Z%.2f. 00008c61 : 8c61: 47 31 58 35 30 59 31 35 35 00 G1X50Y155. 00008c6b : 8c6b: 82 8a df 6a 1d 6c 10 8a 06 8a fc 89 ...j.l...... 00008c77 : 8c77: 47 31 58 25 2e 34 66 45 25 2e 34 66 00 G1X%.4fE%.4f. 00008c84 : 8c84: 47 31 46 31 30 38 30 00 G1F1080. 00008c8c : 8c8c: 74 8a 67 8a 5a 8a 4e 8a 82 8a 3f 8a 34 8a 24 8a t.g.Z.N...?.4.$. 8c9c: 1d 8a .. 00008c9e : 8c9e: 54 25 64 00 T%d. 00008ca2 : 8ca2: 47 31 5a 30 2e 34 00 G1Z0.4. 00008ca9 : 8ca9: 47 31 59 2d 33 46 31 30 30 30 00 G1Y-3F1000. 00008cb4 : 8cb4: e3 6a 91 8a 8c 8a 88 8a 82 8a .j........ 00008cbe : 8cbe: 4d 38 34 20 58 59 00 M84 XY. 00008cc5 : 8cc5: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8cd5: 30 30 00 00. 00008cd8 : 8cd8: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008ce2 : 8ce2: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8cf2: 46 38 30 30 30 00 F8000. 00008cf8 : 8cf8: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8d08: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8d18: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008d28 : 8d28: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8d38: 20 44 25 2e 32 66 00 D%.2f. 00008d3f : 8d3f: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008d4c : 8d4c: 52 43 00 RC. 00008d4f : 8d4f: 44 45 56 00 DEV. 00008d53 : 8d53: 42 45 54 41 00 BETA. 00008d58 : 8d58: 41 4c 50 48 41 00 ALPHA. 00008d5e : 8d5e: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8d6e: 01 01 00 00 04 01 07 01 0a 01 .......... 00008d78 : 8d78: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8d88: 02 01 00 00 05 01 08 01 0b 01 .......... 00008d92 : 8d92: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8da2: 00 01 00 00 03 01 06 01 09 01 .......... 00008dac : 8dac: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8dbc: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8dcc: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8ddc: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8dec: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8dfc: 05 04 04 04 08 08 ...... 00008e02 : 8e02: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8e12: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8e22: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8e32: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8e42: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8e52: 80 10 20 40 04 80 .. @.. 00008e58 : 8e58: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8e84: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008eae : 8eae: 33 2e 31 34 2e 31 00 3.14.1. 00008eb5 : 8eb5: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8ec5: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8ed5: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008ee3 : 8ee3: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 00008ef3 : 8ef3: 43 5a 50 58 00 CZPX. 00008ef8 : 8ef8: 3b 53 00 ;S. 00008efb : 8efb: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00008f09 : 8f09: 61 64 63 5f 69 6e 69 74 00 adc_init. 00008f12 : 8f12: 20 0a 20 0a 20 0a 20 00 . . . . 00008f1a : 8f1a: 41 6c 6c 20 44 61 74 61 00 All Data. 00008f23 : 8f23: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008f30 : 8f30: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008f3e : 8f3e: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00008f49 : 8f49: 4c 61 6e 67 75 61 67 65 00 Language. 00008f52 <_ZZL13factory_resetcE3__c.lto_priv.554>: 8f52: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00008f63 : 8f63: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008f71 : 8f71: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008f7b <_ZL8MSG_INT4.lto_priv.504>: 8f7b: 49 4e 54 34 00 INT4. 00008f80 : 8f80: 03 00 0e 00 01 00 40 00 ......@. 00008f88 : 8f88: 03 00 02 00 00 00 04 00 ........ 00008f90 <_ZZ5setupE3__c__12_>: 8f90: 4e 4f 43 54 55 41 00 NOCTUA. 00008f97 <_ZZ5setupE3__c__11_>: 8f97: 41 4c 54 46 41 4e 00 ALTFAN. 00008f9e : 8f9e: 70 72 75 73 61 33 64 00 prusa3d. 00008fa6 : 8fa6: 32 30 32 35 2d 30 34 2d 32 32 20 32 32 3a 30 33 2025-04-22 22:03 8fb6: 3a 35 33 00 :53. 00008fba : 8fba: 20 33 2e 31 34 2e 31 2d 38 32 37 39 5f 37 37 33 3.14.1-8279_773 8fca: 31 30 32 34 65 64 00 1024ed. 00008fd1 : 8fd1: 73 74 61 72 74 00 start. 00008fd7 : 8fd7: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 00008fe8 : 8fe8: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 00008ff3 : 8ff3: 43 5a 50 58 00 CZPX. 00008ff8 : 8ff8: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 00009009 : 9009: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 00009019 : 9019: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 00009029 : 9029: 4d 32 39 00 M29. 0000902d : 902d: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 00009035 : 9035: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 9045: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 00009054 : 9054: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 9064: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 0000906e : 906e: 33 33 29 42 00 00 58 41 9a 99 8d 41 33 33 53 40 33)B..XA...A33S@ 0000907e : 907e: 20 0a 20 0a 20 00 . . . 00009084 : 9084: 4d 4d 55 32 3a 00 MMU2:. 0000908a : 908a: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 0000909b : 909b: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 90ab: 6e 74 65 72 0a 00 nter.. 000090b1 : 90b1: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 90c1: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 90d1: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 90e1: 20 61 64 3d 25 64 0a 00 ad=%d.. 000090e9 : 90e9: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 90f9: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 9109: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 00009116 : 9116: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 9126: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 9136: 25 64 0a 00 %d.. 0000913a : 913a: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 914a: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 915a: 0a 00 .. 0000915c : 915c: 25 30 32 78 00 %02x. 00009161 : 9161: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 9171: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 0000917d : 917d: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 918d: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 00009199 : 9199: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 91a9: fc 03 f8 01 f0 00 00 00 ........ 000091b1 : 91b1: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 91c1: f8 01 f0 00 00 00 00 00 ........ 000091c9 : 91c9: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 91d9: 65 61 76 65 0a 00 eave.. 000091df : 91df: 20 3c 20 00 < . 000091e3 : 91e3: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 91f3: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 9203: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 9213: 3a 00 :. 00009215 : ... 00009216 : 9216: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ 9226: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 00009236 : 9236: 25 64 2f 34 00 %d/4. 0000923b : 923b: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 00009247 : 9247: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 9257: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 9267: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 9277: 2e 00 .. 00009279 : 9279: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 9289: 64 00 d. 0000928b : 928b: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 929b: 69 78 65 64 00 ixed. 000092a0 : 92a0: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 92b0: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 92c0: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 92d0: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 92e0: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 92f0: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 9300: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 9310: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 9320: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 9330: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 9340: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 9350: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 9360: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 9370: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 9380: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 9390: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 93a0: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 93b0: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 93c0: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 93d0: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 93e0: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 93f0: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 9400: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 9410: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 9420: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 9430: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 9440: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 9450: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 9460: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 9470: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 9480: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 9490: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 94a0: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 94b0: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 94c0: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 94d0: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 94e0: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 94f0: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 9500: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 9510: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 9520: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 9530: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 9540: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 9550: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 9560: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 9570: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 9580: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 9590: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 95a0: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 95b0: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 95c0: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 95d0: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 95e0: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 95f0: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 9600: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 9610: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 9620: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 9630: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 9640: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 9650: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 9660: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 9670: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 9680: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 9690: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 000096a0 : 96a0: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 96b0: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 96c0: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 96d0: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 96e0: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 96f0: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 9700: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 9710: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 9720: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 9730: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 9740: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 9750: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 9760: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 9770: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 9780: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 9790: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 97a0: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 97b0: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 97c0: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 97d0: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 97e0: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 97f0: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 9800: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 9810: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 9820: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 9830: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 9840: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 9850: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 9860: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 9870: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 9880: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 9890: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 98a0: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 98b0: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 98c0: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 98d0: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 98e0: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 98f0: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 9900: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 9910: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 9920: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 9930: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 9940: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9950: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9960: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 9970: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 9980: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 9990: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 99a0: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 99b0: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 99c0: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 99d0: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 99e0: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 99f0: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 9a00: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9a10: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9a20: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9a30: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9a40: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9a50: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9a60: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9a70: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9a80: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9a90: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009aa0 <_ZZ12PID_autotunefiiE3__c__16_>: 9aa0: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9ab0: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9ac0: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9ad0: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9ae0: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9af0: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009afc <_ZZ12PID_autotunefiiE3__c__15_>: 9afc: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b0c: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009b19 <_ZZ12PID_autotunefiiE3__c__14_>: 9b19: 20 40 3a 00 @:. 00009b1d <_ZZ12PID_autotunefiiE3__c__13_>: 9b1d: 54 3a 00 T:. 00009b20 <_ZZ12PID_autotunefiiE3__c__12_>: 9b20: 42 3a 00 B:. 00009b23 <_ZZ12PID_autotunefiiE3__c__11_>: 9b23: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b33: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9b43: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009b4d <_ZZ12PID_autotunefiiE3__c__10_>: 9b4d: 20 4b 64 3a 20 00 Kd: . 00009b53 : 9b53: 20 4b 69 3a 20 00 Ki: . 00009b59 : 9b59: 20 4b 70 3a 20 00 Kp: . 00009b5f : 9b5f: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009b6d : 9b6d: 20 54 75 3a 20 00 Tu: . 00009b73 : 9b73: 20 4b 75 3a 20 00 Ku: . 00009b79 : 9b79: 20 6d 61 78 3a 20 00 max: . 00009b80 : 9b80: 20 6d 69 6e 3a 20 00 min: . 00009b87 : 9b87: 20 64 3a 20 00 d: . 00009b8c : 9b8c: 20 62 69 61 73 3a 20 00 bias: . 00009b94 : 9b94: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9ba4: 72 74 00 rt. 00009ba7 : 9ba7: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9bb7: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9bc7: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009bd1 : 9bd1: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9be1: 20 25 6c 78 0a 00 %lx.. 00009be7 : 9be7: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009bef : 9bef: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009bfb : 9bfb: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009c07 : 9c07: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009c0f : 9c0f: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009c1b : 9c1b: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009c27 : 9c27: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9c37: 64 00 d. 00009c39 : 9c39: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9c49: 72 65 64 21 00 red!. 00009c4e : 9c4e: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9c5e: 66 0a 00 f.. 00009c61 : 9c61: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9c71: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9c81: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9c91: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9ca1: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9cb1: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9cc1: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9cd1: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9ce1: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9cf1: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9d01: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9d11: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9d21: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9d31: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9d41: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9d51: 00 3f 00 00 .?.. 00009d55 : 9d55: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9d65: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9d75: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9d85: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9d95: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9da5: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9db5: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9dc5: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9dd5: f0 3f dd ff f0 3f d8 ff .?...?.. 00009ddd : 9ddd: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9ded: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009df5 : 9df5: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9e05: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009e0e : 9e0e: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009e1e : 9e1e: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9e2e: 57 41 59 00 WAY. 00009e32 : 9e32: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e42: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9e52: 29 00 ). 00009e54 : 9e54: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e64: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9e74: 44 29 00 D). 00009e77 : 9e77: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009e85 : 9e85: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9e95: 52 00 R. 00009e97 : 9e97: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009ea3 : 9ea3: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9eb3: 20 6f 66 66 2e 20 00 off. . 00009eba : 9eba: 3a 20 00 : . 00009ebd : 9ebd: 45 72 72 3a 20 00 Err: . 00009ec3 : 9ec3: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009ed3 : 9ed3: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009ee2 : 9ee2: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para 9ef2: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e 9f02: 6e 61 62 6c 65 00 nable. 00009f08 : 9f08: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U 9f18: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f 9f28: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B 9f38: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T 9f48: 25 2e 32 66 0a 00 %.2f.. 00009f4e : 9f4e: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. 9f5e: 32 66 0a 00 2f.. 00009f62 : 9f62: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se 9f72: 74 74 69 6e 67 73 3a 00 ttings:. 00009f7a : 9f7a: 66 66 ca 41 33 33 bf 41 00 00 b4 41 cd cc 9c 41 ff.A33.A...A...A 9f8a: 00 00 98 41 66 66 92 41 9a 99 8d 41 cd cc 88 41 ...Aff.A...A...A 9f9a: 66 66 86 41 00 00 84 41 66 66 82 41 00 00 80 41 ff.A...Aff.A...A 9faa: 66 66 7e 41 33 33 7b 41 9a 99 79 41 66 66 76 41 ff~A33{A..yAffvA 00009fba : 9fba: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current 9fca: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 00009fda : 9fda: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 00009fe6 : 9fe6: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent 9ff6: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% a006: 30 32 78 29 0a 00 02x).. 0000a00c : a00c: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi a01c: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom a02c: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x a03c: 25 30 32 78 0a 00 %02x.. 0000a042 : a042: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d a052: 0a 00 .. 0000a054 : a054: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v a064: 61 6c 3d 25 32 64 0a 00 al=%2d.. 0000a06c : a06c: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 0000a076 : a076: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 0000a087 : a087: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 0000a097 <__vector_51::__c>: a097: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! a0a7: 21 00 !. 0000a0a9 : a0a9: 3a 20 00 : . 0000a0ac : a0ac: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 0000a0ba : a0ba: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000a0c3 : a0c3: 20 3a 20 00 : . 0000a0c7 : a0c7: 25 33 53 00 %3S. 0000a0cb : a0cb: 25 2d 37 73 00 %-7s. 0000a0d0 : a0d0: 4e 64 20 25 34 2e 32 66 20 00 Nd %4.2f . 0000a0da : a0da: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 a0ea: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 0000a0f5 : a0f5: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a105: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000a114 : a114: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a124: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a134: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a141 : a141: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a151: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a161: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a171: 25 2d 33 64 00 %-3d. 0000a176 : a176: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a180 : a180: 0a 20 49 52 20 3a 20 20 20 20 20 20 20 25 33 2e . IR : %3. a190: 31 66 56 00 1fV. 0000a194 : a194: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a1a4: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a1b4: 31 66 56 00 1fV. 0000a1b8 : a1b8: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a1c7 : a1c7: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a1d3 <_ZZL16lcd_support_menuvE3__c__16_>: a1d3: 20 00 . 0000a1d5 <_ZZL16lcd_support_menuvE3__c__15_>: a1d5: 20 00 . 0000a1d7 <_ZZL16lcd_support_menuvE3__c__14_>: a1d7: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a1e7: 3a 00 :. 0000a1e9 <_ZZL16lcd_support_menuvE3__c__13_>: a1e9: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a1f8 <_ZZL16lcd_support_menuvE3__c__12_>: a1f8: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a201 <_ZZL16lcd_support_menuvE3__c__11_>: a201: 20 46 57 3a 00 FW:. 0000a206 <_ZZL16lcd_support_menuvE3__c__10_>: a206: 46 69 6c 2e 20 73 65 6e 73 6f 72 20 76 2e 3a 00 Fil. sensor v.:. 0000a216 : a216: 32 30 32 35 2d 30 34 2d 32 32 00 2025-04-22. 0000a221 : a221: 45 33 44 52 45 56 4f 00 E3DREVO. 0000a229 : a229: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a233 : a233: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 00 1_75mm_MK3S. 0000a23f : a23f: 20 48 61 73 68 3a 37 37 33 31 30 32 34 65 64 00 Hash:7731024ed. 0000a24f : a24f: 20 52 65 70 6f 3a 70 72 75 73 61 33 64 00 Repo:prusa3d. 0000a25d : a25d: 20 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 0000a26a : a26a: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a274 : a274: 3e 00 >. 0000a276 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a276: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a285 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a285: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a291 <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a291: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a2a1 <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a2a1: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a2ad <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a2ad: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a2bd <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a2bd: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a2c9 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a2c9: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a2d9 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a2d9: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a2e5 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a2e5: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a2f4 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a2f4: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a300 <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a300: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a30f : a30f: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a31b : a31b: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a32b : a32b: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a337 : a337: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a347 : a347: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a353 : a353: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a362 : a362: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a36e : a36e: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a37d : a37d: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a389 : a389: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a398 : a398: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a3a2 : a3a2: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a3ad : a3ad: 58 3a 00 X:. 0000a3b0 : a3b0: 59 3a 00 Y:. 0000a3b3 : a3b3: 5a 3a 00 Z:. 0000a3b6 : a3b6: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a3c7 : a3c7: 25 33 75 00 %3u. 0000a3cb : a3cb: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a3db: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a3eb: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a3fb: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a406 : a406: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a416: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a426: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a436: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a43f : a43f: 47 38 30 00 G80. 0000a443 : a443: 4d 34 35 00 M45. 0000a447 : a447: 4d 34 35 20 5a 00 M45 Z. 0000a44d : a44d: 47 37 36 00 G76. 0000a451 : a451: 4d 37 30 31 20 50 30 00 M701 P0. 0000a459 : a459: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d a469: 0a 00 .. 0000a46b : a46b: 4d 39 31 34 00 M914. 0000a470 : a470: 4d 39 31 35 00 M915. 0000a475 : a475: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 0000a482 : a482: 46 73 65 6e 73 6f 72 20 44 65 74 65 63 74 69 6f Fsensor Detectio a492: 6e 00 n. 0000a494 : a494: 30 2e 38 30 00 0.80. 0000a499 : a499: 30 2e 36 30 00 0.60. 0000a49e : a49e: 30 2e 34 30 00 0.40. 0000a4a3 : a4a3: 30 2e 32 35 00 0.25. 0000a4a8 : a4a8: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 0000a4b2 : a4b2: 4d 4d 55 00 MMU. 0000a4b6 : a4b6: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a4c6: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a4d6: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a4e6: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a4ee <_ZL4endl.lto_priv.390>: a4ee: 0a 00 .. 0000a4f0 : a4f0: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a4ff : a4ff: 25 64 0a 00 %d.. 0000a503 : a503: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a514 : a514: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a524: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a534: 25 25 0a 00 %%.. 0000a538 : a538: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a548: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a554 : a554: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a564: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a574 <_ZL16ramming_sequence.lto_priv.395>: a574: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a584: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a594: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a5a4: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a5b4: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a5c4: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a5d4: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a5e4: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a5f4: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a604 <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.393>: a604: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a614: 74 73 00 ts. 0000a617 : a617: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a627: 6f 70 70 65 64 00 opped. 0000a62d : a62d: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a63d : a63d: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a64d: 73 74 61 72 74 65 64 00 started. 0000a655 : a655: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a665: 6e 67 00 ng. 0000a668 : a668: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a678: 70 65 6e 64 69 6e 67 00 pending. 0000a680 : a680: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a68d : a68d: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a697 <_ZL9mmu2Magic.lto_priv.374>: a697: 4d 4d 55 32 3a 00 MMU2:. 0000a69d : a69d: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a6ad: 20 00 . 0000a6af : a6af: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a6bf: 6e 65 64 00 ned. 0000a6c3 : a6c3: e3 59 d2 59 be 59 a9 59 93 59 80 59 6a 59 56 59 .Y.Y.Y.Y.Y.YjYVY a6d3: 45 59 2f 59 be 59 d2 59 1b 59 0c 59 f8 58 e7 58 EY/Y.Y.Y.Y.Y.X.X a6e3: d2 58 76 5c bc 58 aa 58 97 58 86 58 71 58 5e 58 .Xv\.X.X.X.XqX^X a6f3: 4a 58 35 58 2c 58 1a 58 05 58 JX5X,X.X.X 0000a6fd : a6fd: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a707 : a707: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a717: 75 6e 6f 75 74 21 00 unout!. 0000a71e : a71e: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a72e: 6d 65 6f 75 74 00 meout. 0000a734 : a734: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a743 : a743: 03 00 03 ... 0000a746 : a746: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a757 : a757: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a765 : a765: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a776 : a776: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a786: 64 00 d. 0000a788 : a788: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a798: 65 64 00 ed. 0000a79b <_ZN4MMU2L11errorTitlesE.lto_priv.511>: a79b: 40 5c 2b 5c 14 5c ff 5b ea 5b d6 5b c6 5b af 5b @\+\.\.[.[.[.[.[ a7ab: 98 5b 81 5b 6d 5b 59 5b 43 5b 43 5b 43 5b 2e 5b .[.[m[Y[C[C[C[.[ a7bb: 2e 5b 2e 5b 1b 5b 1b 5b 1b 5b 08 5b 08 5b 08 5b .[.[.[.[.[.[.[.[ a7cb: f1 5a f1 5a f1 5a dc 5a dc 5a dc 5a c6 5a c6 5a .Z.Z.Z.Z.Z.Z.Z.Z a7db: c6 5a b6 5a a1 5a 8b 5a 75 5a 66 5a 59 5a 42 5a .Z.Z.Z.ZuZfZYZBZ a7eb: 2f 5a 1d 5a 0a 5a f8 59 e8 59 /Z.Z.Z.Y.Y 0000a7f5 : a7f5: 42 75 74 74 6f 6e 00 Button. 0000a7fc : a7fc: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a80c: 74 6e 4c 4d 52 20 00 tnLMR . 0000a813 <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.510>: a813: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a823: 20 20 20 81 00 .. 0000a828 : a828: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a838: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a843 : a843: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a851 : a851: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl a861: 65 61 72 65 64 00 eared. 0000a867 : a867: 20 57 3a 00 W:. 0000a86b : a86b: 20 45 3a 00 E:. 0000a86f : a86f: 54 3a 00 T:. 0000a872 : a872: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000a883 : a883: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000a890 : a890: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000a89e : a89e: 20 53 69 7a 65 3a 20 00 Size: . 0000a8a6 : a8a6: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000a8b4 : a8b4: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000a8c5 : a8c5: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000a8d6 : a8d6: 22 20 70 6f 73 00 " pos. 0000a8dc : a8dc: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000a8e7 : a8e7: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL a8f7: 74 61 72 67 65 74 3a 22 00 target:". 0000a900 : a900: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s a910: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w a920: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev a930: 65 6c 73 2e 00 els.. 0000a935 : a935: 20 22 25 73 22 00 "%s". 0000a93b : a93b: 20 25 23 6c 78 00 %#lx. 0000a941 : a941: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000a94a : a94a: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% a95a: 73 22 0a 00 s".. 0000a95e : a95e: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000a967 : a967: 04 1a .. 0000a969 : a969: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt a979: 74 65 6d 70 74 73 00 tempts. 0000a980 : a980: 08 1b 1c ... 0000a983 : a983: 0b 14 .. 0000a985 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.394>: a985: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000a994 : a994: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000a9a3 <_ZL10bufferFull.lto_priv.573>: a9a3: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer a9b3: 20 66 75 6c 6c 21 00 full!. 0000a9ba : a9ba: 45 72 72 6f 72 3a 00 Error:. 0000a9c1 : a9c1: 22 00 ". 0000a9c3 : a9c3: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the a9d3: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000a9dc <_ZL9mmu2Magic.lto_priv.375>: a9dc: 4d 4d 55 32 3a 00 MMU2:. 0000a9e2 : a9e2: 65 63 68 6f 3a 00 echo:. 0000a9e8 : a9e8: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000a9f0 : a9f0: 4d 4d 55 20 69 73 20 00 MMU is . 0000a9f8 : a9f8: 25 2e 31 30 53 20 00 %.10S . 0000a9ff : a9ff: 25 34 64 00 %4d. 0000aa03 : aa03: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t aa13: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000aa20 : aa20: 25 64 2f 39 00 %d/9. 0000aa25 : aa25: 4d 4d 55 32 3a 00 MMU2:. 0000aa2b : aa2b: 25 33 64 00 %3d. 0000aa2f : aa2f: 18 01 04 19 02 0a ...... 0000aa35 : aa35: 2b 64 b5 63 3b 63 ce 62 85 62 f3 61 7b 61 13 61 +d.c;c.b.b.a{a.a aa45: c4 60 a4 60 58 60 a4 60 41 60 41 60 41 60 41 60 .`.`X`.`A`A`A`A` aa55: 41 60 41 60 41 60 41 60 41 60 41 60 41 60 41 60 A`A`A`A`A`A`A`A` aa65: 41 60 41 60 41 60 41 60 41 60 41 60 41 60 41 60 A`A`A`A`A`A`A`A` aa75: 41 60 41 60 0a 60 c9 5f 7f 5f 0c 5f d7 5e 8d 5e A`A`.`._._._.^.^ aa85: 43 5e e5 5d ac 5d 6a 5d 4d 5d C^.].]j]M] 0000aa8f : aa8f: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. aa9f: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ aaaf: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000aabc : aabc: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. aacc: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... aadc: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. aaec: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. aafc: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. ab0c: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000ab16 : ab16: b8 64 21 65 ad 64 a4 64 9d 64 eb 4b 64 3c 96 64 .d!e.d.d.d.Kd<.d ab26: 8c 64 .d 0000ab28 : ab28: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ab38: 34 25 68 75 00 4%hu. 0000ab3d : ab3d: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ab4d: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ab5d: 6e 65 63 74 21 00 nect!. 0000ab63 : ab63: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000ab71 : ab71: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000ab81 : ab81: 73 74 61 72 74 0a 00 start.. 0000ab88 : ab88: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ ab98: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe aba8: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial abb8: 20 00 . 0000abba <_ZZL25restore_print_from_eeprombE3__c__12_>: abba: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 0000abc5 <_ZZL25restore_print_from_eeprombE3__c__11_>: abc5: 47 34 20 53 30 00 G4 S0. 0000abcb <_ZZL25restore_print_from_eeprombE3__c__10_>: abcb: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 0000abd5 : abd5: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 0000abde : abde: 4d 31 30 36 20 53 25 75 00 M106 S%u. 0000abe7 : abe7: 47 31 20 46 25 64 00 G1 F%d. 0000abee : abee: 4d 38 32 00 M82. 0000abf2 : abf2: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 0000abfd : abfd: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. ac0d: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 0000ac17 : ac17: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 0000ac21 : ac21: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 0000ac2e : ac2e: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f ac3e: 20 46 33 30 30 30 00 F3000. 0000ac45 : ac45: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 0000ac55 : ac55: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 0000ac5f : ac5f: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 0000ac6a : ac6a: 4d 31 30 39 20 53 25 64 00 M109 S%d. 0000ac73 : ac73: 4d 31 34 30 20 53 25 64 00 M140 S%d. 0000ac7c : ac7c: 4d 31 30 34 20 53 25 64 00 M104 S%d. 0000ac85 : ac85: 47 32 38 20 58 20 59 00 G28 X Y. 0000ac8d : ac8d: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 0000ac9b : ac9b: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p acab: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... acbb: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b accb: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... acdb: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T aceb: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... acfb: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F ad0b: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... ad1b: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 ad2b: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. ad3b: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* ad4b: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... ad5b: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. ad6b: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. ad7b: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. ad8b: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. ad9b: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. adab: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` adbb: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. adcb: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr addb: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... adeb: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D adfb: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. ae0b: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V ae1b: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... ae2b: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( ae3b: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... ae4b: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: ae5b: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... ae6b: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... ae7b: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... ae8b: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 0000ae9b : ae9b: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 0000aea4 <__ctors_start>: aea4: 2f 3b cpi r18, 0xBF ; 191 0000aea6 <__ctors_end>: aea6: 22 65 ori r18, 0x52 ; 82 0000aea8 <__dtors_end>: aea8: 11 24 eor r1, r1 aeaa: 1f be out 0x3f, r1 ; 63 aeac: cf ef ldi r28, 0xFF ; 255 aeae: d1 e2 ldi r29, 0x21 ; 33 aeb0: de bf out 0x3e, r29 ; 62 aeb2: cd bf out 0x3d, r28 ; 61 aeb4: 00 e0 ldi r16, 0x00 ; 0 aeb6: 0c bf out 0x3c, r16 ; 60 0000aeb8 <__do_copy_data>: aeb8: 13 e0 ldi r17, 0x03 ; 3 aeba: a0 e0 ldi r26, 0x00 ; 0 aebc: b2 e0 ldi r27, 0x02 ; 2 aebe: ea ea ldi r30, 0xAA ; 170 aec0: f8 ec ldi r31, 0xC8 ; 200 aec2: 03 e0 ldi r16, 0x03 ; 3 aec4: 0b bf out 0x3b, r16 ; 59 aec6: 02 c0 rjmp .+4 ; 0xaecc <__do_copy_data+0x14> aec8: 07 90 elpm r0, Z+ aeca: 0d 92 st X+, r0 aecc: a4 32 cpi r26, 0x24 ; 36 aece: b1 07 cpc r27, r17 aed0: d9 f7 brne .-10 ; 0xaec8 <__do_copy_data+0x10> 0000aed2 <__do_clear_bss>: aed2: 28 e1 ldi r18, 0x18 ; 24 aed4: a4 e2 ldi r26, 0x24 ; 36 aed6: b3 e0 ldi r27, 0x03 ; 3 aed8: 01 c0 rjmp .+2 ; 0xaedc <.do_clear_bss_start> 0000aeda <.do_clear_bss_loop>: aeda: 1d 92 st X+, r1 0000aedc <.do_clear_bss_start>: aedc: a7 31 cpi r26, 0x17 ; 23 aede: b2 07 cpc r27, r18 aee0: e1 f7 brne .-8 ; 0xaeda <.do_clear_bss_loop> 0000aee2 <__do_global_ctors>: aee2: 17 e5 ldi r17, 0x57 ; 87 aee4: c3 e5 ldi r28, 0x53 ; 83 aee6: d7 e5 ldi r29, 0x57 ; 87 aee8: 00 e0 ldi r16, 0x00 ; 0 aeea: 06 c0 rjmp .+12 ; 0xaef8 <__do_global_ctors+0x16> aeec: 21 97 sbiw r28, 0x01 ; 1 aeee: 01 09 sbc r16, r1 aef0: 80 2f mov r24, r16 aef2: fe 01 movw r30, r28 aef4: 0f 94 99 de call 0x3bd32 ; 0x3bd32 <__tablejump2__> aef8: c2 35 cpi r28, 0x52 ; 82 aefa: d1 07 cpc r29, r17 aefc: 80 e0 ldi r24, 0x00 ; 0 aefe: 08 07 cpc r16, r24 af00: a9 f7 brne .-22 ; 0xaeec <__do_global_ctors+0xa> af02: 0e 94 de f9 call 0x1f3bc ; 0x1f3bc
af06: 0d 94 43 e4 jmp 0x3c886 ; 0x3c886 <__do_global_dtors> 0000af0a <__bad_interrupt>: af0a: 0c 94 18 68 jmp 0xd030 ; 0xd030 <__vector_default> 0000af0e : af0e: 2f 92 push r2 af10: 3f 92 push r3 af12: 4f 92 push r4 af14: 5f 92 push r5 af16: 6f 92 push r6 af18: 7f 92 push r7 af1a: 8f 92 push r8 af1c: 9f 92 push r9 af1e: af 92 push r10 af20: bf 92 push r11 af22: cf 92 push r12 af24: df 92 push r13 af26: ef 92 push r14 af28: ff 92 push r15 af2a: 0f 93 push r16 af2c: 1f 93 push r17 af2e: cf 93 push r28 af30: df 93 push r29 af32: cd b7 in r28, 0x3d ; 61 af34: de b7 in r29, 0x3e ; 62 af36: 2f 97 sbiw r28, 0x0f ; 15 af38: 0f b6 in r0, 0x3f ; 63 af3a: f8 94 cli af3c: de bf out 0x3e, r29 ; 62 af3e: 0f be out 0x3f, r0 ; 63 af40: cd bf out 0x3d, r28 ; 61 af42: 6c 01 movw r12, r24 af44: 1b 01 movw r2, r22 af46: 5a 01 movw r10, r20 af48: fc 01 movw r30, r24 af4a: 17 82 std Z+7, r1 ; 0x07 af4c: 16 82 std Z+6, r1 ; 0x06 af4e: 83 81 ldd r24, Z+3 ; 0x03 af50: 9e 01 movw r18, r28 af52: 2f 5f subi r18, 0xFF ; 255 af54: 3f 4f sbci r19, 0xFF ; 255 af56: 49 01 movw r8, r18 af58: 81 fd sbrc r24, 1 af5a: d2 c0 rjmp .+420 ; 0xb100 af5c: 8f ef ldi r24, 0xFF ; 255 af5e: 9f ef ldi r25, 0xFF ; 255 af60: ee c2 rjmp .+1500 ; 0xb53e af62: f1 2c mov r15, r1 af64: 51 2c mov r5, r1 af66: 00 e0 ldi r16, 0x00 ; 0 af68: 00 32 cpi r16, 0x20 ; 32 af6a: 38 f4 brcc .+14 ; 0xaf7a af6c: 8b 32 cpi r24, 0x2B ; 43 af6e: 09 f1 breq .+66 ; 0xafb2 af70: 90 f4 brcc .+36 ; 0xaf96 af72: 80 32 cpi r24, 0x20 ; 32 af74: f9 f0 breq .+62 ; 0xafb4 af76: 83 32 cpi r24, 0x23 ; 35 af78: 09 f1 breq .+66 ; 0xafbc af7a: 07 fd sbrc r16, 7 af7c: 34 c0 rjmp .+104 ; 0xafe6 af7e: 20 ed ldi r18, 0xD0 ; 208 af80: 28 0f add r18, r24 af82: 2a 30 cpi r18, 0x0A ; 10 af84: 20 f5 brcc .+72 ; 0xafce af86: 06 ff sbrs r16, 6 af88: 1b c0 rjmp .+54 ; 0xafc0 af8a: fa e0 ldi r31, 0x0A ; 10 af8c: ff 9e mul r15, r31 af8e: 20 0d add r18, r0 af90: 11 24 eor r1, r1 af92: f2 2e mov r15, r18 af94: 05 c0 rjmp .+10 ; 0xafa0 af96: 8d 32 cpi r24, 0x2D ; 45 af98: 79 f0 breq .+30 ; 0xafb8 af9a: 80 33 cpi r24, 0x30 ; 48 af9c: 71 f7 brne .-36 ; 0xaf7a af9e: 01 60 ori r16, 0x01 ; 1 afa0: f1 01 movw r30, r2 afa2: 93 fd sbrc r25, 3 afa4: 85 91 lpm r24, Z+ afa6: 93 ff sbrs r25, 3 afa8: 81 91 ld r24, Z+ afaa: 1f 01 movw r2, r30 afac: 81 11 cpse r24, r1 afae: dc cf rjmp .-72 ; 0xaf68 afb0: 1a c0 rjmp .+52 ; 0xafe6 afb2: 02 60 ori r16, 0x02 ; 2 afb4: 04 60 ori r16, 0x04 ; 4 afb6: f4 cf rjmp .-24 ; 0xafa0 afb8: 08 60 ori r16, 0x08 ; 8 afba: f2 cf rjmp .-28 ; 0xafa0 afbc: 00 61 ori r16, 0x10 ; 16 afbe: f0 cf rjmp .-32 ; 0xafa0 afc0: 3a e0 ldi r19, 0x0A ; 10 afc2: 53 9e mul r5, r19 afc4: 20 0d add r18, r0 afc6: 11 24 eor r1, r1 afc8: 52 2e mov r5, r18 afca: 00 62 ori r16, 0x20 ; 32 afcc: e9 cf rjmp .-46 ; 0xafa0 afce: 8e 32 cpi r24, 0x2E ; 46 afd0: 21 f4 brne .+8 ; 0xafda afd2: 06 fd sbrc r16, 6 afd4: b1 c2 rjmp .+1378 ; 0xb538 afd6: 00 64 ori r16, 0x40 ; 64 afd8: e3 cf rjmp .-58 ; 0xafa0 afda: 8c 36 cpi r24, 0x6C ; 108 afdc: 11 f4 brne .+4 ; 0xafe2 afde: 00 68 ori r16, 0x80 ; 128 afe0: df cf rjmp .-66 ; 0xafa0 afe2: 88 36 cpi r24, 0x68 ; 104 afe4: e9 f2 breq .-70 ; 0xafa0 afe6: 9b eb ldi r25, 0xBB ; 187 afe8: 98 0f add r25, r24 afea: 93 30 cpi r25, 0x03 ; 3 afec: 08 f0 brcs .+2 ; 0xaff0 afee: 5f c0 rjmp .+190 ; 0xb0ae aff0: 00 61 ori r16, 0x10 ; 16 aff2: 80 5e subi r24, 0xE0 ; 224 aff4: 06 fd sbrc r16, 6 aff6: 02 c0 rjmp .+4 ; 0xaffc aff8: 46 e0 ldi r20, 0x06 ; 6 affa: f4 2e mov r15, r20 affc: 10 2f mov r17, r16 affe: 1f 73 andi r17, 0x3F ; 63 b000: 85 36 cpi r24, 0x65 ; 101 b002: 09 f0 breq .+2 ; 0xb006 b004: 5b c0 rjmp .+182 ; 0xb0bc b006: 10 64 ori r17, 0x40 ; 64 b008: 17 ff sbrs r17, 7 b00a: 61 c0 rjmp .+194 ; 0xb0ce b00c: 8f 2d mov r24, r15 b00e: 9b e3 ldi r25, 0x3B ; 59 b010: 9f 15 cp r25, r15 b012: 08 f4 brcc .+2 ; 0xb016 b014: 8b e3 ldi r24, 0x3B ; 59 b016: 44 24 eor r4, r4 b018: 43 94 inc r4 b01a: 48 0e add r4, r24 b01c: 27 e0 ldi r18, 0x07 ; 7 b01e: 35 01 movw r6, r10 b020: f4 e0 ldi r31, 0x04 ; 4 b022: 6f 0e add r6, r31 b024: 71 1c adc r7, r1 b026: f5 01 movw r30, r10 b028: 60 81 ld r22, Z b02a: 71 81 ldd r23, Z+1 ; 0x01 b02c: 82 81 ldd r24, Z+2 ; 0x02 b02e: 93 81 ldd r25, Z+3 ; 0x03 b030: 04 2d mov r16, r4 b032: a4 01 movw r20, r8 b034: 0f 94 42 da call 0x3b484 ; 0x3b484 <__ftoa_engine> b038: 5c 01 movw r10, r24 b03a: f9 81 ldd r31, Y+1 ; 0x01 b03c: fc 87 std Y+12, r31 ; 0x0c b03e: f0 ff sbrs r31, 0 b040: 03 c0 rjmp .+6 ; 0xb048 b042: 0d e2 ldi r16, 0x2D ; 45 b044: f3 ff sbrs r31, 3 b046: 07 c0 rjmp .+14 ; 0xb056 b048: 0b e2 ldi r16, 0x2B ; 43 b04a: 11 fd sbrc r17, 1 b04c: 04 c0 rjmp .+8 ; 0xb056 b04e: 01 2f mov r16, r17 b050: 04 70 andi r16, 0x04 ; 4 b052: 12 fd sbrc r17, 2 b054: 00 e2 ldi r16, 0x20 ; 32 b056: 2c 85 ldd r18, Y+12 ; 0x0c b058: 2c 70 andi r18, 0x0C ; 12 b05a: e2 2e mov r14, r18 b05c: 09 f4 brne .+2 ; 0xb060 b05e: 6b c0 rjmp .+214 ; 0xb136 b060: 01 11 cpse r16, r1 b062: d8 c2 rjmp .+1456 ; 0xb614 b064: f3 e0 ldi r31, 0x03 ; 3 b066: e1 2c mov r14, r1 b068: f5 15 cp r31, r5 b06a: a0 f4 brcc .+40 ; 0xb094 b06c: 83 e0 ldi r24, 0x03 ; 3 b06e: e5 2c mov r14, r5 b070: e8 1a sub r14, r24 b072: 13 fd sbrc r17, 3 b074: 08 c0 rjmp .+16 ; 0xb086 b076: b6 01 movw r22, r12 b078: 80 e2 ldi r24, 0x20 ; 32 b07a: 90 e0 ldi r25, 0x00 ; 0 b07c: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b080: ea 94 dec r14 b082: e1 10 cpse r14, r1 b084: f8 cf rjmp .-16 ; 0xb076 b086: 00 23 and r16, r16 b088: 29 f0 breq .+10 ; 0xb094 b08a: b6 01 movw r22, r12 b08c: 80 2f mov r24, r16 b08e: 90 e0 ldi r25, 0x00 ; 0 b090: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b094: 3c 85 ldd r19, Y+12 ; 0x0c b096: 26 ee ldi r18, 0xE6 ; 230 b098: a2 2e mov r10, r18 b09a: 26 e7 ldi r18, 0x76 ; 118 b09c: b2 2e mov r11, r18 b09e: 33 fd sbrc r19, 3 b0a0: 04 c0 rjmp .+8 ; 0xb0aa b0a2: 9a ee ldi r25, 0xEA ; 234 b0a4: a9 2e mov r10, r25 b0a6: 96 e7 ldi r25, 0x76 ; 118 b0a8: b9 2e mov r11, r25 b0aa: 10 71 andi r17, 0x10 ; 16 b0ac: 22 c0 rjmp .+68 ; 0xb0f2 b0ae: 9b e9 ldi r25, 0x9B ; 155 b0b0: 98 0f add r25, r24 b0b2: 93 30 cpi r25, 0x03 ; 3 b0b4: 08 f0 brcs .+2 ; 0xb0b8 b0b6: 47 c1 rjmp .+654 ; 0xb346 b0b8: 0f 7e andi r16, 0xEF ; 239 b0ba: 9c cf rjmp .-200 ; 0xaff4 b0bc: 86 36 cpi r24, 0x66 ; 102 b0be: 11 f4 brne .+4 ; 0xb0c4 b0c0: 10 68 ori r17, 0x80 ; 128 b0c2: a2 cf rjmp .-188 ; 0xb008 b0c4: ff 20 and r15, r15 b0c6: 09 f4 brne .+2 ; 0xb0ca b0c8: 9f cf rjmp .-194 ; 0xb008 b0ca: fa 94 dec r15 b0cc: 9d cf rjmp .-198 ; 0xb008 b0ce: e7 e0 ldi r30, 0x07 ; 7 b0d0: 2f 2d mov r18, r15 b0d2: ef 15 cp r30, r15 b0d4: 18 f4 brcc .+6 ; 0xb0dc b0d6: 27 e0 ldi r18, 0x07 ; 7 b0d8: 37 e0 ldi r19, 0x07 ; 7 b0da: f3 2e mov r15, r19 b0dc: 41 2c mov r4, r1 b0de: 9f cf rjmp .-194 ; 0xb01e b0e0: 11 11 cpse r17, r1 b0e2: 80 52 subi r24, 0x20 ; 32 b0e4: b6 01 movw r22, r12 b0e6: 90 e0 ldi r25, 0x00 ; 0 b0e8: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b0ec: 8f ef ldi r24, 0xFF ; 255 b0ee: a8 1a sub r10, r24 b0f0: b8 0a sbc r11, r24 b0f2: f5 01 movw r30, r10 b0f4: 84 91 lpm r24, Z b0f6: 81 11 cpse r24, r1 b0f8: f3 cf rjmp .-26 ; 0xb0e0 b0fa: e1 10 cpse r14, r1 b0fc: 84 c2 rjmp .+1288 ; 0xb606 b0fe: 53 01 movw r10, r6 b100: f6 01 movw r30, r12 b102: 93 81 ldd r25, Z+3 ; 0x03 b104: f1 01 movw r30, r2 b106: 93 fd sbrc r25, 3 b108: 85 91 lpm r24, Z+ b10a: 93 ff sbrs r25, 3 b10c: 81 91 ld r24, Z+ b10e: 1f 01 movw r2, r30 b110: 88 23 and r24, r24 b112: 09 f4 brne .+2 ; 0xb116 b114: 11 c2 rjmp .+1058 ; 0xb538 b116: 85 32 cpi r24, 0x25 ; 37 b118: 41 f4 brne .+16 ; 0xb12a b11a: 93 fd sbrc r25, 3 b11c: 85 91 lpm r24, Z+ b11e: 93 ff sbrs r25, 3 b120: 81 91 ld r24, Z+ b122: 1f 01 movw r2, r30 b124: 85 32 cpi r24, 0x25 ; 37 b126: 09 f0 breq .+2 ; 0xb12a b128: 1c cf rjmp .-456 ; 0xaf62 b12a: b6 01 movw r22, r12 b12c: 90 e0 ldi r25, 0x00 ; 0 b12e: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b132: 35 01 movw r6, r10 b134: e4 cf rjmp .-56 ; 0xb0fe b136: 17 ff sbrs r17, 7 b138: 6f c0 rjmp .+222 ; 0xb218 b13a: 4a 0c add r4, r10 b13c: fc 85 ldd r31, Y+12 ; 0x0c b13e: f4 ff sbrs r31, 4 b140: 04 c0 rjmp .+8 ; 0xb14a b142: 8a 81 ldd r24, Y+2 ; 0x02 b144: 81 33 cpi r24, 0x31 ; 49 b146: 09 f4 brne .+2 ; 0xb14a b148: 4a 94 dec r4 b14a: 14 14 cp r1, r4 b14c: 0c f0 brlt .+2 ; 0xb150 b14e: 86 c0 rjmp .+268 ; 0xb25c b150: 28 e0 ldi r18, 0x08 ; 8 b152: 24 15 cp r18, r4 b154: 10 f4 brcc .+4 ; 0xb15a b156: 88 e0 ldi r24, 0x08 ; 8 b158: 48 2e mov r4, r24 b15a: 85 e0 ldi r24, 0x05 ; 5 b15c: 90 e0 ldi r25, 0x00 ; 0 b15e: 17 ff sbrs r17, 7 b160: 06 c0 rjmp .+12 ; 0xb16e b162: c5 01 movw r24, r10 b164: b7 fe sbrs r11, 7 b166: 02 c0 rjmp .+4 ; 0xb16c b168: 90 e0 ldi r25, 0x00 ; 0 b16a: 80 e0 ldi r24, 0x00 ; 0 b16c: 01 96 adiw r24, 0x01 ; 1 b16e: 01 11 cpse r16, r1 b170: 01 96 adiw r24, 0x01 ; 1 b172: ff 20 and r15, r15 b174: 31 f0 breq .+12 ; 0xb182 b176: 2f 2d mov r18, r15 b178: 30 e0 ldi r19, 0x00 ; 0 b17a: 2f 5f subi r18, 0xFF ; 255 b17c: 3f 4f sbci r19, 0xFF ; 255 b17e: 82 0f add r24, r18 b180: 93 1f adc r25, r19 b182: 58 16 cp r5, r24 b184: 19 06 cpc r1, r25 b186: 19 f0 breq .+6 ; 0xb18e b188: 14 f0 brlt .+4 ; 0xb18e b18a: e5 2c mov r14, r5 b18c: e8 1a sub r14, r24 b18e: 81 2f mov r24, r17 b190: 89 70 andi r24, 0x09 ; 9 b192: 11 f4 brne .+4 ; 0xb198 b194: e1 10 cpse r14, r1 b196: 67 c0 rjmp .+206 ; 0xb266 b198: 00 23 and r16, r16 b19a: 29 f0 breq .+10 ; 0xb1a6 b19c: b6 01 movw r22, r12 b19e: 80 2f mov r24, r16 b1a0: 90 e0 ldi r25, 0x00 ; 0 b1a2: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b1a6: 13 fd sbrc r17, 3 b1a8: 02 c0 rjmp .+4 ; 0xb1ae b1aa: e1 10 cpse r14, r1 b1ac: 63 c0 rjmp .+198 ; 0xb274 b1ae: 17 ff sbrs r17, 7 b1b0: 7c c0 rjmp .+248 ; 0xb2aa b1b2: 85 01 movw r16, r10 b1b4: b7 fe sbrs r11, 7 b1b6: 02 c0 rjmp .+4 ; 0xb1bc b1b8: 10 e0 ldi r17, 0x00 ; 0 b1ba: 00 e0 ldi r16, 0x00 ; 0 b1bc: c5 01 movw r24, r10 b1be: 84 19 sub r24, r4 b1c0: 91 09 sbc r25, r1 b1c2: 2c 01 movw r4, r24 b1c4: 6f 2d mov r22, r15 b1c6: 70 e0 ldi r23, 0x00 ; 0 b1c8: ee 27 eor r30, r30 b1ca: ff 27 eor r31, r31 b1cc: e6 1b sub r30, r22 b1ce: f7 0b sbc r31, r23 b1d0: ff 87 std Y+15, r31 ; 0x0f b1d2: ee 87 std Y+14, r30 ; 0x0e b1d4: 0f 3f cpi r16, 0xFF ; 255 b1d6: 10 07 cpc r17, r16 b1d8: 29 f4 brne .+10 ; 0xb1e4 b1da: b6 01 movw r22, r12 b1dc: 8e e2 ldi r24, 0x2E ; 46 b1de: 90 e0 ldi r25, 0x00 ; 0 b1e0: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b1e4: a0 16 cp r10, r16 b1e6: b1 06 cpc r11, r17 b1e8: 0c f4 brge .+2 ; 0xb1ec b1ea: 4b c0 rjmp .+150 ; 0xb282 b1ec: 40 16 cp r4, r16 b1ee: 51 06 cpc r5, r17 b1f0: 0c f0 brlt .+2 ; 0xb1f4 b1f2: 47 c0 rjmp .+142 ; 0xb282 b1f4: f5 01 movw r30, r10 b1f6: e0 1b sub r30, r16 b1f8: f1 0b sbc r31, r17 b1fa: e8 0d add r30, r8 b1fc: f9 1d adc r31, r9 b1fe: 81 81 ldd r24, Z+1 ; 0x01 b200: 01 50 subi r16, 0x01 ; 1 b202: 11 09 sbc r17, r1 b204: 2e 85 ldd r18, Y+14 ; 0x0e b206: 3f 85 ldd r19, Y+15 ; 0x0f b208: 02 17 cp r16, r18 b20a: 13 07 cpc r17, r19 b20c: e4 f1 brlt .+120 ; 0xb286 b20e: b6 01 movw r22, r12 b210: 90 e0 ldi r25, 0x00 ; 0 b212: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b216: de cf rjmp .-68 ; 0xb1d4 b218: 16 fd sbrc r17, 6 b21a: 9f cf rjmp .-194 ; 0xb15a b21c: ef 2d mov r30, r15 b21e: f0 e0 ldi r31, 0x00 ; 0 b220: ea 15 cp r30, r10 b222: fb 05 cpc r31, r11 b224: 34 f0 brlt .+12 ; 0xb232 b226: 3c ef ldi r19, 0xFC ; 252 b228: a3 16 cp r10, r19 b22a: 3f ef ldi r19, 0xFF ; 255 b22c: b3 06 cpc r11, r19 b22e: 0c f0 brlt .+2 ; 0xb232 b230: 10 68 ori r17, 0x80 ; 128 b232: 32 96 adiw r30, 0x02 ; 2 b234: e8 0d add r30, r8 b236: f9 1d adc r31, r9 b238: 01 c0 rjmp .+2 ; 0xb23c b23a: fa 94 dec r15 b23c: ff 20 and r15, r15 b23e: 19 f0 breq .+6 ; 0xb246 b240: 82 91 ld r24, -Z b242: 80 33 cpi r24, 0x30 ; 48 b244: d1 f3 breq .-12 ; 0xb23a b246: 17 ff sbrs r17, 7 b248: 88 cf rjmp .-240 ; 0xb15a b24a: 44 24 eor r4, r4 b24c: 43 94 inc r4 b24e: 4f 0c add r4, r15 b250: fa 14 cp r15, r10 b252: 1b 04 cpc r1, r11 b254: 31 f0 breq .+12 ; 0xb262 b256: 2c f0 brlt .+10 ; 0xb262 b258: fa 18 sub r15, r10 b25a: 7f cf rjmp .-258 ; 0xb15a b25c: 44 24 eor r4, r4 b25e: 43 94 inc r4 b260: 7c cf rjmp .-264 ; 0xb15a b262: f1 2c mov r15, r1 b264: 7a cf rjmp .-268 ; 0xb15a b266: b6 01 movw r22, r12 b268: 80 e2 ldi r24, 0x20 ; 32 b26a: 90 e0 ldi r25, 0x00 ; 0 b26c: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b270: ea 94 dec r14 b272: 90 cf rjmp .-224 ; 0xb194 b274: b6 01 movw r22, r12 b276: 80 e3 ldi r24, 0x30 ; 48 b278: 90 e0 ldi r25, 0x00 ; 0 b27a: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b27e: ea 94 dec r14 b280: 94 cf rjmp .-216 ; 0xb1aa b282: 80 e3 ldi r24, 0x30 ; 48 b284: bd cf rjmp .-134 ; 0xb200 b286: a0 16 cp r10, r16 b288: b1 06 cpc r11, r17 b28a: 41 f4 brne .+16 ; 0xb29c b28c: 9a 81 ldd r25, Y+2 ; 0x02 b28e: 96 33 cpi r25, 0x36 ; 54 b290: 50 f4 brcc .+20 ; 0xb2a6 b292: 95 33 cpi r25, 0x35 ; 53 b294: 19 f4 brne .+6 ; 0xb29c b296: 3c 85 ldd r19, Y+12 ; 0x0c b298: 34 ff sbrs r19, 4 b29a: 05 c0 rjmp .+10 ; 0xb2a6 b29c: b6 01 movw r22, r12 b29e: 90 e0 ldi r25, 0x00 ; 0 b2a0: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b2a4: 2a cf rjmp .-428 ; 0xb0fa b2a6: 81 e3 ldi r24, 0x31 ; 49 b2a8: f9 cf rjmp .-14 ; 0xb29c b2aa: 8a 81 ldd r24, Y+2 ; 0x02 b2ac: 81 33 cpi r24, 0x31 ; 49 b2ae: 19 f0 breq .+6 ; 0xb2b6 b2b0: 9c 85 ldd r25, Y+12 ; 0x0c b2b2: 9f 7e andi r25, 0xEF ; 239 b2b4: 9c 87 std Y+12, r25 ; 0x0c b2b6: b6 01 movw r22, r12 b2b8: 90 e0 ldi r25, 0x00 ; 0 b2ba: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b2be: ff 20 and r15, r15 b2c0: a9 f0 breq .+42 ; 0xb2ec b2c2: b6 01 movw r22, r12 b2c4: 8e e2 ldi r24, 0x2E ; 46 b2c6: 90 e0 ldi r25, 0x00 ; 0 b2c8: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b2cc: f3 94 inc r15 b2ce: f3 94 inc r15 b2d0: e2 e0 ldi r30, 0x02 ; 2 b2d2: 01 e0 ldi r16, 0x01 ; 1 b2d4: 0e 0f add r16, r30 b2d6: e8 0d add r30, r8 b2d8: f9 2d mov r31, r9 b2da: f1 1d adc r31, r1 b2dc: 80 81 ld r24, Z b2de: b6 01 movw r22, r12 b2e0: 90 e0 ldi r25, 0x00 ; 0 b2e2: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b2e6: e0 2f mov r30, r16 b2e8: 0f 11 cpse r16, r15 b2ea: f3 cf rjmp .-26 ; 0xb2d2 b2ec: 85 e6 ldi r24, 0x65 ; 101 b2ee: 90 e0 ldi r25, 0x00 ; 0 b2f0: 14 ff sbrs r17, 4 b2f2: 02 c0 rjmp .+4 ; 0xb2f8 b2f4: 85 e4 ldi r24, 0x45 ; 69 b2f6: 90 e0 ldi r25, 0x00 ; 0 b2f8: b6 01 movw r22, r12 b2fa: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b2fe: b7 fc sbrc r11, 7 b300: 06 c0 rjmp .+12 ; 0xb30e b302: a1 14 cp r10, r1 b304: b1 04 cpc r11, r1 b306: c1 f4 brne .+48 ; 0xb338 b308: ec 85 ldd r30, Y+12 ; 0x0c b30a: e4 ff sbrs r30, 4 b30c: 15 c0 rjmp .+42 ; 0xb338 b30e: b1 94 neg r11 b310: a1 94 neg r10 b312: b1 08 sbc r11, r1 b314: 8d e2 ldi r24, 0x2D ; 45 b316: b6 01 movw r22, r12 b318: 90 e0 ldi r25, 0x00 ; 0 b31a: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b31e: 80 e3 ldi r24, 0x30 ; 48 b320: 2a e0 ldi r18, 0x0A ; 10 b322: a2 16 cp r10, r18 b324: b1 04 cpc r11, r1 b326: 54 f4 brge .+20 ; 0xb33c b328: b6 01 movw r22, r12 b32a: 90 e0 ldi r25, 0x00 ; 0 b32c: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b330: b6 01 movw r22, r12 b332: c5 01 movw r24, r10 b334: c0 96 adiw r24, 0x30 ; 48 b336: b4 cf rjmp .-152 ; 0xb2a0 b338: 8b e2 ldi r24, 0x2B ; 43 b33a: ed cf rjmp .-38 ; 0xb316 b33c: 8f 5f subi r24, 0xFF ; 255 b33e: fa e0 ldi r31, 0x0A ; 10 b340: af 1a sub r10, r31 b342: b1 08 sbc r11, r1 b344: ed cf rjmp .-38 ; 0xb320 b346: 83 36 cpi r24, 0x63 ; 99 b348: c9 f0 breq .+50 ; 0xb37c b34a: 83 37 cpi r24, 0x73 ; 115 b34c: 71 f1 breq .+92 ; 0xb3aa b34e: 83 35 cpi r24, 0x53 ; 83 b350: 09 f0 breq .+2 ; 0xb354 b352: 5b c0 rjmp .+182 ; 0xb40a b354: 35 01 movw r6, r10 b356: f2 e0 ldi r31, 0x02 ; 2 b358: 6f 0e add r6, r31 b35a: 71 1c adc r7, r1 b35c: f5 01 movw r30, r10 b35e: a0 80 ld r10, Z b360: b1 80 ldd r11, Z+1 ; 0x01 b362: 6f 2d mov r22, r15 b364: 70 e0 ldi r23, 0x00 ; 0 b366: 06 fd sbrc r16, 6 b368: 02 c0 rjmp .+4 ; 0xb36e b36a: 6f ef ldi r22, 0xFF ; 255 b36c: 7f ef ldi r23, 0xFF ; 255 b36e: c5 01 movw r24, r10 b370: 0f 94 85 db call 0x3b70a ; 0x3b70a b374: 9d 87 std Y+13, r25 ; 0x0d b376: 8c 87 std Y+12, r24 ; 0x0c b378: 00 68 ori r16, 0x80 ; 128 b37a: 0d c0 rjmp .+26 ; 0xb396 b37c: 35 01 movw r6, r10 b37e: 32 e0 ldi r19, 0x02 ; 2 b380: 63 0e add r6, r19 b382: 71 1c adc r7, r1 b384: f5 01 movw r30, r10 b386: 80 81 ld r24, Z b388: 89 83 std Y+1, r24 ; 0x01 b38a: 21 e0 ldi r18, 0x01 ; 1 b38c: 30 e0 ldi r19, 0x00 ; 0 b38e: 3d 87 std Y+13, r19 ; 0x0d b390: 2c 87 std Y+12, r18 ; 0x0c b392: 54 01 movw r10, r8 b394: 0f 77 andi r16, 0x7F ; 127 b396: 03 fd sbrc r16, 3 b398: 06 c0 rjmp .+12 ; 0xb3a6 b39a: 2c 85 ldd r18, Y+12 ; 0x0c b39c: 3d 85 ldd r19, Y+13 ; 0x0d b39e: 52 16 cp r5, r18 b3a0: 13 06 cpc r1, r19 b3a2: 09 f0 breq .+2 ; 0xb3a6 b3a4: a8 f4 brcc .+42 ; 0xb3d0 b3a6: e5 2c mov r14, r5 b3a8: 2b c0 rjmp .+86 ; 0xb400 b3aa: 35 01 movw r6, r10 b3ac: 32 e0 ldi r19, 0x02 ; 2 b3ae: 63 0e add r6, r19 b3b0: 71 1c adc r7, r1 b3b2: f5 01 movw r30, r10 b3b4: a0 80 ld r10, Z b3b6: b1 80 ldd r11, Z+1 ; 0x01 b3b8: 6f 2d mov r22, r15 b3ba: 70 e0 ldi r23, 0x00 ; 0 b3bc: 06 fd sbrc r16, 6 b3be: 02 c0 rjmp .+4 ; 0xb3c4 b3c0: 6f ef ldi r22, 0xFF ; 255 b3c2: 7f ef ldi r23, 0xFF ; 255 b3c4: c5 01 movw r24, r10 b3c6: 0f 94 aa db call 0x3b754 ; 0x3b754 b3ca: 9d 87 std Y+13, r25 ; 0x0d b3cc: 8c 87 std Y+12, r24 ; 0x0c b3ce: e2 cf rjmp .-60 ; 0xb394 b3d0: b6 01 movw r22, r12 b3d2: 80 e2 ldi r24, 0x20 ; 32 b3d4: 90 e0 ldi r25, 0x00 ; 0 b3d6: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b3da: 5a 94 dec r5 b3dc: de cf rjmp .-68 ; 0xb39a b3de: f5 01 movw r30, r10 b3e0: 07 fd sbrc r16, 7 b3e2: 85 91 lpm r24, Z+ b3e4: 07 ff sbrs r16, 7 b3e6: 81 91 ld r24, Z+ b3e8: 5f 01 movw r10, r30 b3ea: b6 01 movw r22, r12 b3ec: 90 e0 ldi r25, 0x00 ; 0 b3ee: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b3f2: e1 10 cpse r14, r1 b3f4: ea 94 dec r14 b3f6: 8c 85 ldd r24, Y+12 ; 0x0c b3f8: 9d 85 ldd r25, Y+13 ; 0x0d b3fa: 01 97 sbiw r24, 0x01 ; 1 b3fc: 9d 87 std Y+13, r25 ; 0x0d b3fe: 8c 87 std Y+12, r24 ; 0x0c b400: ec 85 ldd r30, Y+12 ; 0x0c b402: fd 85 ldd r31, Y+13 ; 0x0d b404: ef 2b or r30, r31 b406: 59 f7 brne .-42 ; 0xb3de b408: 78 ce rjmp .-784 ; 0xb0fa b40a: 84 36 cpi r24, 0x64 ; 100 b40c: 19 f0 breq .+6 ; 0xb414 b40e: 89 36 cpi r24, 0x69 ; 105 b410: 09 f0 breq .+2 ; 0xb414 b412: 74 c0 rjmp .+232 ; 0xb4fc b414: 35 01 movw r6, r10 b416: 07 ff sbrs r16, 7 b418: 66 c0 rjmp .+204 ; 0xb4e6 b41a: f4 e0 ldi r31, 0x04 ; 4 b41c: 6f 0e add r6, r31 b41e: 71 1c adc r7, r1 b420: f5 01 movw r30, r10 b422: 60 81 ld r22, Z b424: 71 81 ldd r23, Z+1 ; 0x01 b426: 82 81 ldd r24, Z+2 ; 0x02 b428: 93 81 ldd r25, Z+3 ; 0x03 b42a: 10 2f mov r17, r16 b42c: 1f 76 andi r17, 0x6F ; 111 b42e: 97 ff sbrs r25, 7 b430: 08 c0 rjmp .+16 ; 0xb442 b432: 90 95 com r25 b434: 80 95 com r24 b436: 70 95 com r23 b438: 61 95 neg r22 b43a: 7f 4f sbci r23, 0xFF ; 255 b43c: 8f 4f sbci r24, 0xFF ; 255 b43e: 9f 4f sbci r25, 0xFF ; 255 b440: 10 68 ori r17, 0x80 ; 128 b442: 2a e0 ldi r18, 0x0A ; 10 b444: 30 e0 ldi r19, 0x00 ; 0 b446: a4 01 movw r20, r8 b448: 0f 94 18 dd call 0x3ba30 ; 0x3ba30 <__ultoa_invert> b44c: a8 2e mov r10, r24 b44e: a8 18 sub r10, r8 b450: ba 2c mov r11, r10 b452: 01 2f mov r16, r17 b454: 16 ff sbrs r17, 6 b456: 0a c0 rjmp .+20 ; 0xb46c b458: 0e 7f andi r16, 0xFE ; 254 b45a: af 14 cp r10, r15 b45c: 38 f4 brcc .+14 ; 0xb46c b45e: 14 ff sbrs r17, 4 b460: 04 c0 rjmp .+8 ; 0xb46a b462: 12 fd sbrc r17, 2 b464: 02 c0 rjmp .+4 ; 0xb46a b466: 01 2f mov r16, r17 b468: 0e 7e andi r16, 0xEE ; 238 b46a: bf 2c mov r11, r15 b46c: 04 ff sbrs r16, 4 b46e: a3 c0 rjmp .+326 ; 0xb5b6 b470: fe 01 movw r30, r28 b472: ea 0d add r30, r10 b474: f1 1d adc r31, r1 b476: 80 81 ld r24, Z b478: 80 33 cpi r24, 0x30 ; 48 b47a: 09 f0 breq .+2 ; 0xb47e b47c: 95 c0 rjmp .+298 ; 0xb5a8 b47e: 09 7e andi r16, 0xE9 ; 233 b480: f0 2f mov r31, r16 b482: f8 70 andi r31, 0x08 ; 8 b484: ef 2e mov r14, r31 b486: 03 fd sbrc r16, 3 b488: a5 c0 rjmp .+330 ; 0xb5d4 b48a: 00 ff sbrs r16, 0 b48c: 9f c0 rjmp .+318 ; 0xb5cc b48e: fa 2c mov r15, r10 b490: b5 14 cp r11, r5 b492: 10 f4 brcc .+4 ; 0xb498 b494: f5 0c add r15, r5 b496: fb 18 sub r15, r11 b498: 04 ff sbrs r16, 4 b49a: a2 c0 rjmp .+324 ; 0xb5e0 b49c: b6 01 movw r22, r12 b49e: 80 e3 ldi r24, 0x30 ; 48 b4a0: 90 e0 ldi r25, 0x00 ; 0 b4a2: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b4a6: 02 ff sbrs r16, 2 b4a8: 09 c0 rjmp .+18 ; 0xb4bc b4aa: 88 e7 ldi r24, 0x78 ; 120 b4ac: 90 e0 ldi r25, 0x00 ; 0 b4ae: 01 ff sbrs r16, 1 b4b0: 02 c0 rjmp .+4 ; 0xb4b6 b4b2: 88 e5 ldi r24, 0x58 ; 88 b4b4: 90 e0 ldi r25, 0x00 ; 0 b4b6: b6 01 movw r22, r12 b4b8: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b4bc: af 14 cp r10, r15 b4be: 08 f4 brcc .+2 ; 0xb4c2 b4c0: 9b c0 rjmp .+310 ; 0xb5f8 b4c2: aa 94 dec r10 b4c4: 0a 2d mov r16, r10 b4c6: 10 e0 ldi r17, 0x00 ; 0 b4c8: 0f 5f subi r16, 0xFF ; 255 b4ca: 1f 4f sbci r17, 0xFF ; 255 b4cc: 08 0d add r16, r8 b4ce: 19 1d adc r17, r9 b4d0: f8 01 movw r30, r16 b4d2: 82 91 ld r24, -Z b4d4: 8f 01 movw r16, r30 b4d6: b6 01 movw r22, r12 b4d8: 90 e0 ldi r25, 0x00 ; 0 b4da: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b4de: 80 16 cp r8, r16 b4e0: 91 06 cpc r9, r17 b4e2: b1 f7 brne .-20 ; 0xb4d0 b4e4: 0a ce rjmp .-1004 ; 0xb0fa b4e6: f2 e0 ldi r31, 0x02 ; 2 b4e8: 6f 0e add r6, r31 b4ea: 71 1c adc r7, r1 b4ec: f5 01 movw r30, r10 b4ee: 60 81 ld r22, Z b4f0: 71 81 ldd r23, Z+1 ; 0x01 b4f2: 07 2e mov r0, r23 b4f4: 00 0c add r0, r0 b4f6: 88 0b sbc r24, r24 b4f8: 99 0b sbc r25, r25 b4fa: 97 cf rjmp .-210 ; 0xb42a b4fc: 10 2f mov r17, r16 b4fe: 85 37 cpi r24, 0x75 ; 117 b500: a9 f4 brne .+42 ; 0xb52c b502: 1f 7e andi r17, 0xEF ; 239 b504: 2a e0 ldi r18, 0x0A ; 10 b506: 30 e0 ldi r19, 0x00 ; 0 b508: 35 01 movw r6, r10 b50a: 17 ff sbrs r17, 7 b50c: 44 c0 rjmp .+136 ; 0xb596 b50e: f4 e0 ldi r31, 0x04 ; 4 b510: 6f 0e add r6, r31 b512: 71 1c adc r7, r1 b514: f5 01 movw r30, r10 b516: 60 81 ld r22, Z b518: 71 81 ldd r23, Z+1 ; 0x01 b51a: 82 81 ldd r24, Z+2 ; 0x02 b51c: 93 81 ldd r25, Z+3 ; 0x03 b51e: a4 01 movw r20, r8 b520: 0f 94 18 dd call 0x3ba30 ; 0x3ba30 <__ultoa_invert> b524: a8 2e mov r10, r24 b526: a8 18 sub r10, r8 b528: 1f 77 andi r17, 0x7F ; 127 b52a: 92 cf rjmp .-220 ; 0xb450 b52c: 19 7f andi r17, 0xF9 ; 249 b52e: 8f 36 cpi r24, 0x6F ; 111 b530: 79 f1 breq .+94 ; 0xb590 b532: f0 f4 brcc .+60 ; 0xb570 b534: 88 35 cpi r24, 0x58 ; 88 b536: 39 f1 breq .+78 ; 0xb586 b538: f6 01 movw r30, r12 b53a: 86 81 ldd r24, Z+6 ; 0x06 b53c: 97 81 ldd r25, Z+7 ; 0x07 b53e: 2f 96 adiw r28, 0x0f ; 15 b540: 0f b6 in r0, 0x3f ; 63 b542: f8 94 cli b544: de bf out 0x3e, r29 ; 62 b546: 0f be out 0x3f, r0 ; 63 b548: cd bf out 0x3d, r28 ; 61 b54a: df 91 pop r29 b54c: cf 91 pop r28 b54e: 1f 91 pop r17 b550: 0f 91 pop r16 b552: ff 90 pop r15 b554: ef 90 pop r14 b556: df 90 pop r13 b558: cf 90 pop r12 b55a: bf 90 pop r11 b55c: af 90 pop r10 b55e: 9f 90 pop r9 b560: 8f 90 pop r8 b562: 7f 90 pop r7 b564: 6f 90 pop r6 b566: 5f 90 pop r5 b568: 4f 90 pop r4 b56a: 3f 90 pop r3 b56c: 2f 90 pop r2 b56e: 08 95 ret b570: 80 37 cpi r24, 0x70 ; 112 b572: 39 f0 breq .+14 ; 0xb582 b574: 88 37 cpi r24, 0x78 ; 120 b576: 01 f7 brne .-64 ; 0xb538 b578: 14 fd sbrc r17, 4 b57a: 14 60 ori r17, 0x04 ; 4 b57c: 20 e1 ldi r18, 0x10 ; 16 b57e: 30 e0 ldi r19, 0x00 ; 0 b580: c3 cf rjmp .-122 ; 0xb508 b582: 10 61 ori r17, 0x10 ; 16 b584: f9 cf rjmp .-14 ; 0xb578 b586: 04 fd sbrc r16, 4 b588: 16 60 ori r17, 0x06 ; 6 b58a: 20 e1 ldi r18, 0x10 ; 16 b58c: 32 e0 ldi r19, 0x02 ; 2 b58e: bc cf rjmp .-136 ; 0xb508 b590: 28 e0 ldi r18, 0x08 ; 8 b592: 30 e0 ldi r19, 0x00 ; 0 b594: b9 cf rjmp .-142 ; 0xb508 b596: f2 e0 ldi r31, 0x02 ; 2 b598: 6f 0e add r6, r31 b59a: 71 1c adc r7, r1 b59c: f5 01 movw r30, r10 b59e: 60 81 ld r22, Z b5a0: 71 81 ldd r23, Z+1 ; 0x01 b5a2: 90 e0 ldi r25, 0x00 ; 0 b5a4: 80 e0 ldi r24, 0x00 ; 0 b5a6: bb cf rjmp .-138 ; 0xb51e b5a8: 02 fd sbrc r16, 2 b5aa: 02 c0 rjmp .+4 ; 0xb5b0 b5ac: b3 94 inc r11 b5ae: 68 cf rjmp .-304 ; 0xb480 b5b0: b3 94 inc r11 b5b2: b3 94 inc r11 b5b4: 65 cf rjmp .-310 ; 0xb480 b5b6: 80 2f mov r24, r16 b5b8: 86 78 andi r24, 0x86 ; 134 b5ba: 09 f4 brne .+2 ; 0xb5be b5bc: 61 cf rjmp .-318 ; 0xb480 b5be: f6 cf rjmp .-20 ; 0xb5ac b5c0: b6 01 movw r22, r12 b5c2: 80 e2 ldi r24, 0x20 ; 32 b5c4: 90 e0 ldi r25, 0x00 ; 0 b5c6: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b5ca: b3 94 inc r11 b5cc: b5 14 cp r11, r5 b5ce: c0 f3 brcs .-16 ; 0xb5c0 b5d0: e1 2c mov r14, r1 b5d2: 62 cf rjmp .-316 ; 0xb498 b5d4: e5 2c mov r14, r5 b5d6: eb 18 sub r14, r11 b5d8: b5 14 cp r11, r5 b5da: 08 f4 brcc .+2 ; 0xb5de b5dc: 5d cf rjmp .-326 ; 0xb498 b5de: f8 cf rjmp .-16 ; 0xb5d0 b5e0: 80 2f mov r24, r16 b5e2: 86 78 andi r24, 0x86 ; 134 b5e4: 09 f4 brne .+2 ; 0xb5e8 b5e6: 6a cf rjmp .-300 ; 0xb4bc b5e8: 8b e2 ldi r24, 0x2B ; 43 b5ea: 01 ff sbrs r16, 1 b5ec: 80 e2 ldi r24, 0x20 ; 32 b5ee: 07 fd sbrc r16, 7 b5f0: 8d e2 ldi r24, 0x2D ; 45 b5f2: b6 01 movw r22, r12 b5f4: 90 e0 ldi r25, 0x00 ; 0 b5f6: 60 cf rjmp .-320 ; 0xb4b8 b5f8: b6 01 movw r22, r12 b5fa: 80 e3 ldi r24, 0x30 ; 48 b5fc: 90 e0 ldi r25, 0x00 ; 0 b5fe: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b602: fa 94 dec r15 b604: 5b cf rjmp .-330 ; 0xb4bc b606: b6 01 movw r22, r12 b608: 80 e2 ldi r24, 0x20 ; 32 b60a: 90 e0 ldi r25, 0x00 ; 0 b60c: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 b610: ea 94 dec r14 b612: 73 cd rjmp .-1306 ; 0xb0fa b614: 24 e0 ldi r18, 0x04 ; 4 b616: e1 2c mov r14, r1 b618: 25 15 cp r18, r5 b61a: 08 f0 brcs .+2 ; 0xb61e b61c: 36 cd rjmp .-1428 ; 0xb08a b61e: 84 e0 ldi r24, 0x04 ; 4 b620: 26 cd rjmp .-1460 ; 0xb06e 0000b622 : 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 ( b622: 20 e0 ldi r18, 0x00 ; 0 b624: 30 e0 ldi r19, 0x00 ; 0 b626: 40 e8 ldi r20, 0x80 ; 128 b628: 5f eb ldi r21, 0xBF ; 191 b62a: 60 91 ab 02 lds r22, 0x02AB ; 0x8002ab b62e: 70 91 ac 02 lds r23, 0x02AC ; 0x8002ac b632: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad b636: 90 91 ae 02 lds r25, 0x02AE ; 0x8002ae b63a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> b63e: 88 23 and r24, r24 b640: 21 f1 breq .+72 ; 0xb68a (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b642: e0 91 6e 12 lds r30, 0x126E ; 0x80126e b646: f0 91 6f 12 lds r31, 0x126F ; 0x80126f b64a: ef 57 subi r30, 0x7F ; 127 b64c: 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) && ( b64e: 80 81 ld r24, Z b650: 8b 7f andi r24, 0xFB ; 251 b652: 82 30 cpi r24, 0x02 ; 2 b654: d1 f4 brne .+52 ; 0xb68a (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)); b656: 80 e1 ldi r24, 0x10 ; 16 b658: eb ea ldi r30, 0xAB ; 171 b65a: f2 e0 ldi r31, 0x02 ; 2 b65c: a1 e4 ldi r26, 0x41 ; 65 b65e: b7 e0 ldi r27, 0x07 ; 7 b660: 01 90 ld r0, Z+ b662: 0d 92 st X+, r0 b664: 8a 95 dec r24 b666: e1 f7 brne .-8 ; 0xb660 saved_start_position[0] = SAVED_START_POSITION_UNSET; b668: 80 e0 ldi r24, 0x00 ; 0 b66a: 90 e0 ldi r25, 0x00 ; 0 b66c: a0 e8 ldi r26, 0x80 ; 128 b66e: bf eb ldi r27, 0xBF ; 191 b670: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab b674: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac b678: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad b67c: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae return saved_segment_idx; b680: 80 91 09 18 lds r24, 0x1809 ; 0x801809 b684: 90 91 0a 18 lds r25, 0x180A ; 0x80180a b688: 08 95 ret } else return 1; //begin with the first segment b68a: 81 e0 ldi r24, 0x01 ; 1 b68c: 90 e0 ldi r25, 0x00 ; 0 } b68e: 08 95 ret 0000b690 : 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) { b690: cf 92 push r12 b692: df 92 push r13 b694: ef 92 push r14 b696: ff 92 push r15 b698: 0f 93 push r16 b69a: 1f 93 push r17 b69c: cf 93 push r28 b69e: 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); b6a0: 90 e0 ldi r25, 0x00 ; 0 b6a2: ec 01 movw r28, r24 b6a4: cc 0f add r28, r28 b6a6: dd 1f adc r29, r29 b6a8: cc 0f add r28, r28 b6aa: dd 1f adc r29, r29 b6ac: fe 01 movw r30, r28 b6ae: e8 56 subi r30, 0x68 ; 104 b6b0: f3 48 sbci r31, 0x83 ; 131 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); b6b2: 25 91 lpm r18, Z+ b6b4: 35 91 lpm r19, Z+ b6b6: 45 91 lpm r20, Z+ b6b8: 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]; b6ba: fe 01 movw r30, r28 b6bc: ec 53 subi r30, 0x3C ; 60 b6be: f9 4f sbci r31, 0xF9 ; 249 b6c0: c0 80 ld r12, Z b6c2: d1 80 ldd r13, Z+1 ; 0x01 b6c4: e2 80 ldd r14, Z+2 ; 0x02 b6c6: f3 80 ldd r15, Z+3 ; 0x03 b6c8: 8e 01 movw r16, r28 b6ca: 0f 5b subi r16, 0xBF ; 191 b6cc: 18 4f sbci r17, 0xF8 ; 248 b6ce: c7 01 movw r24, r14 b6d0: b6 01 movw r22, r12 b6d2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> b6d6: f8 01 movw r30, r16 b6d8: 60 83 st Z, r22 b6da: 71 83 std Z+1, r23 ; 0x01 b6dc: 82 83 std Z+2, r24 ; 0x02 b6de: 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); b6e0: fe 01 movw r30, r28 b6e2: e4 57 subi r30, 0x74 ; 116 b6e4: f3 48 sbci r31, 0x83 ; 131 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); b6e6: 25 91 lpm r18, Z+ b6e8: 35 91 lpm r19, Z+ b6ea: 45 91 lpm r20, Z+ b6ec: 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]; b6ee: 8e 01 movw r16, r28 b6f0: 0f 5d subi r16, 0xDF ; 223 b6f2: 1d 4f sbci r17, 0xFD ; 253 b6f4: c7 01 movw r24, r14 b6f6: b6 01 movw r22, r12 b6f8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> b6fc: f8 01 movw r30, r16 b6fe: 60 83 st Z, r22 b700: 71 83 std Z+1, r23 ; 0x01 b702: 82 83 std Z+2, r24 ; 0x02 b704: 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); b706: fe 01 movw r30, r28 b708: e0 58 subi r30, 0x80 ; 128 b70a: f3 48 sbci r31, 0x83 ; 131 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); b70c: 25 91 lpm r18, Z+ b70e: 35 91 lpm r19, Z+ b710: 45 91 lpm r20, Z+ b712: 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]; b714: cb 5e subi r28, 0xEB ; 235 b716: dd 4f sbci r29, 0xFD ; 253 b718: c7 01 movw r24, r14 b71a: b6 01 movw r22, r12 b71c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> b720: 68 83 st Y, r22 b722: 79 83 std Y+1, r23 ; 0x01 b724: 8a 83 std Y+2, r24 ; 0x02 b726: 9b 83 std Y+3, r25 ; 0x03 } b728: df 91 pop r29 b72a: cf 91 pop r28 b72c: 1f 91 pop r17 b72e: 0f 91 pop r16 b730: ff 90 pop r15 b732: ef 90 pop r14 b734: df 90 pop r13 b736: cf 90 pop r12 b738: 08 95 ret 0000b73a : 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)); } b73a: 80 e1 ldi r24, 0x10 ; 16 b73c: e2 e5 ldi r30, 0x52 ; 82 b73e: f5 e0 ldi r31, 0x05 ; 5 b740: a1 e4 ldi r26, 0x41 ; 65 b742: b7 e0 ldi r27, 0x07 ; 7 b744: 01 90 ld r0, Z+ b746: 0d 92 st X+, r0 b748: 8a 95 dec r24 b74a: e1 f7 brne .-8 ; 0xb744 b74c: 08 95 ret 0000b74e : /// @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)); b74e: eb e0 ldi r30, 0x0B ; 11 b750: fc e7 ldi r31, 0x7C ; 124 b752: 83 30 cpi r24, 0x03 ; 3 b754: 21 f0 breq .+8 ; 0xb75e b756: e8 2f mov r30, r24 b758: f0 e0 ldi r31, 0x00 ; 0 b75a: e8 5f subi r30, 0xF8 ; 248 b75c: f3 48 sbci r31, 0x83 ; 131 b75e: 84 91 lpm r24, Z } b760: 08 95 ret 0000b762 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b762: 40 91 7f 10 lds r20, 0x107F ; 0x80107f b766: 50 91 80 10 lds r21, 0x1080 ; 0x801080 return 0; b76a: 90 e0 ldi r25, 0x00 ; 0 b76c: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b76e: 41 15 cp r20, r1 b770: 51 05 cpc r21, r1 b772: b1 f1 breq .+108 ; 0xb7e0 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b774: 20 91 6e 12 lds r18, 0x126E ; 0x80126e b778: 30 91 6f 12 lds r19, 0x126F ; 0x80126f char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b77c: 90 e0 ldi r25, 0x00 ; 0 b77e: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b780: f9 01 movw r30, r18 b782: ef 57 subi r30, 0x7F ; 127 b784: ff 4e sbci r31, 0xEF ; 239 b786: a0 81 ld r26, Z b788: a2 30 cpi r26, 0x02 ; 2 b78a: 21 f4 brne .+8 ; 0xb794 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b78c: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b78e: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b790: 86 0f add r24, r22 b792: 97 1f adc r25, r23 } if (-- _buflen == 0) b794: 41 50 subi r20, 0x01 ; 1 b796: 51 09 sbc r21, r1 b798: 19 f1 breq .+70 ; 0xb7e0 b79a: f9 01 movw r30, r18 b79c: ec 57 subi r30, 0x7C ; 124 b79e: 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) ; b7a0: a1 91 ld r26, Z+ b7a2: 9f 01 movw r18, r30 b7a4: 21 58 subi r18, 0x81 ; 129 b7a6: 30 41 sbci r19, 0x10 ; 16 b7a8: a1 11 cpse r26, r1 b7aa: fa cf rjmp .-12 ; 0xb7a0 b7ac: f9 01 movw r30, r18 b7ae: ef 57 subi r30, 0x7F ; 127 b7b0: 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) ; b7b2: 2d 3e cpi r18, 0xED ; 237 b7b4: a1 e0 ldi r26, 0x01 ; 1 b7b6: 3a 07 cpc r19, r26 b7b8: 30 f4 brcc .+12 ; 0xb7c6 b7ba: a1 91 ld r26, Z+ b7bc: a1 11 cpse r26, r1 b7be: e0 cf rjmp .-64 ; 0xb780 b7c0: 2f 5f subi r18, 0xFF ; 255 b7c2: 3f 4f sbci r19, 0xFF ; 255 b7c4: f6 cf rjmp .-20 ; 0xb7b2 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b7c6: 2d 3e cpi r18, 0xED ; 237 b7c8: e1 e0 ldi r30, 0x01 ; 1 b7ca: 3e 07 cpc r19, r30 b7cc: c9 f6 brne .-78 ; 0xb780 b7ce: e1 e8 ldi r30, 0x81 ; 129 b7d0: f0 e1 ldi r31, 0x10 ; 16 b7d2: 9f 01 movw r18, r30 b7d4: 21 58 subi r18, 0x81 ; 129 b7d6: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b7d8: a1 91 ld r26, Z+ b7da: aa 23 and r26, r26 b7dc: d1 f3 breq .-12 ; 0xb7d2 b7de: d0 cf rjmp .-96 ; 0xb780 } } return sdlen; } b7e0: 08 95 ret 0000b7e2 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b7e2: 98 2f mov r25, r24 b7e4: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b7e6: 83 ff sbrs r24, 3 b7e8: 0d c0 rjmp .+26 ; 0xb804 b7ea: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b7ee: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b7f0: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b7f4: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b7f8: 88 7f andi r24, 0xF8 ; 248 b7fa: 97 70 andi r25, 0x07 ; 7 b7fc: 89 2b or r24, r25 b7fe: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b802: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b804: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b808: 87 7f andi r24, 0xF7 ; 247 b80a: f2 cf rjmp .-28 ; 0xb7f0 0000b80c : 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)); }; b80c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b810: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b814: 4a e0 ldi r20, 0x0A ; 10 b816: 50 e0 ldi r21, 0x00 ; 0 b818: 70 e0 ldi r23, 0x00 ; 0 b81a: 60 e0 ldi r22, 0x00 ; 0 b81c: 01 96 adiw r24, 0x01 ; 1 b81e: 0f 94 14 d9 call 0x3b228 ; 0x3b228 b822: 86 2f mov r24, r22 b824: 08 95 ret 0000b826 : // 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)); }; b826: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b82a: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b82e: 4a e0 ldi r20, 0x0A ; 10 b830: 50 e0 ldi r21, 0x00 ; 0 b832: 70 e0 ldi r23, 0x00 ; 0 b834: 60 e0 ldi r22, 0x00 ; 0 b836: 01 96 adiw r24, 0x01 ; 1 b838: 0f 94 14 d9 call 0x3b228 ; 0x3b228 b83c: cb 01 movw r24, r22 b83e: 08 95 ret 0000b840 : // 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); } b840: 80 91 95 03 lds r24, 0x0395 ; 0x800395 b844: 90 91 96 03 lds r25, 0x0396 ; 0x800396 b848: 4a e0 ldi r20, 0x0A ; 10 b84a: 50 e0 ldi r21, 0x00 ; 0 b84c: 70 e0 ldi r23, 0x00 ; 0 b84e: 60 e0 ldi r22, 0x00 ; 0 b850: 01 96 adiw r24, 0x01 ; 1 b852: 0d 94 14 d9 jmp 0x3b228 ; 0x3b228 0000b856 : // 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; b856: 80 91 93 04 lds r24, 0x0493 ; 0x800493 b85a: 90 91 94 04 lds r25, 0x0494 ; 0x800494 b85e: 90 93 92 04 sts 0x0492, r25 ; 0x800492 b862: 80 93 91 04 sts 0x0491, r24 ; 0x800491 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); b866: 8a e0 ldi r24, 0x0A ; 10 b868: 9e e6 ldi r25, 0x6E ; 110 b86a: 9f 93 push r25 b86c: 8f 93 push r24 b86e: 80 91 7a 03 lds r24, 0x037A ; 0x80037a b872: 90 91 7b 03 lds r25, 0x037B ; 0x80037b b876: a0 91 7c 03 lds r26, 0x037C ; 0x80037c b87a: b0 91 7d 03 lds r27, 0x037D ; 0x80037d b87e: 01 96 adiw r24, 0x01 ; 1 b880: a1 1d adc r26, r1 b882: b1 1d adc r27, r1 b884: bf 93 push r27 b886: af 93 push r26 b888: 9f 93 push r25 b88a: 8f 93 push r24 b88c: 89 ee ldi r24, 0xE9 ; 233 b88e: 96 e6 ldi r25, 0x66 ; 102 b890: 9f 93 push r25 b892: 8f 93 push r24 b894: 80 ef ldi r24, 0xF0 ; 240 b896: 96 e6 ldi r25, 0x66 ; 102 b898: 9f 93 push r25 b89a: 8f 93 push r24 b89c: 0f 94 4b dc call 0x3b896 ; 0x3b896 b8a0: 8d b7 in r24, 0x3d ; 61 b8a2: 9e b7 in r25, 0x3e ; 62 b8a4: 0a 96 adiw r24, 0x0a ; 10 b8a6: 0f b6 in r0, 0x3f ; 63 b8a8: f8 94 cli b8aa: 9e bf out 0x3e, r25 ; 62 b8ac: 0f be out 0x3f, r0 ; 63 b8ae: 8d bf out 0x3d, r24 ; 61 } b8b0: 08 95 ret 0000b8b2 : 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) { b8b2: 0f 93 push r16 b8b4: 1f 93 push r17 b8b6: cf 93 push r28 b8b8: df 93 push r29 b8ba: ec 01 movw r28, r24 b8bc: c6 0f add r28, r22 b8be: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b8c0: 8c 17 cp r24, r28 b8c2: 9d 07 cpc r25, r29 b8c4: 79 f0 breq .+30 ; 0xb8e4 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b8c6: 8c 01 movw r16, r24 b8c8: 0f 5f subi r16, 0xFF ; 255 b8ca: 1f 4f sbci r17, 0xFF ; 255 b8cc: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 b8d0: 8f 3f cpi r24, 0xFF ; 255 b8d2: 31 f0 breq .+12 ; 0xb8e0 return true; b8d4: 81 e0 ldi r24, 0x01 ; 1 } return false; } b8d6: df 91 pop r29 b8d8: cf 91 pop r28 b8da: 1f 91 pop r17 b8dc: 0f 91 pop r16 b8de: 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) b8e0: c8 01 movw r24, r16 b8e2: ee cf rjmp .-36 ; 0xb8c0 return true; } return false; b8e4: 80 e0 ldi r24, 0x00 ; 0 b8e6: f7 cf rjmp .-18 ; 0xb8d6 0000b8e8 : #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; } b8e8: 68 2f mov r22, r24 b8ea: 88 0f add r24, r24 b8ec: 77 0b sbc r23, r23 b8ee: 80 91 6e 12 lds r24, 0x126E ; 0x80126e b8f2: 90 91 6f 12 lds r25, 0x126F ; 0x80126f b8f6: 8c 57 subi r24, 0x7C ; 124 b8f8: 9f 4e sbci r25, 0xEF ; 239 b8fa: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 b8fe: 9c 01 movw r18, r24 b900: 90 93 96 03 sts 0x0396, r25 ; 0x800396 b904: 80 93 95 03 sts 0x0395, r24 ; 0x800395 b908: 81 e0 ldi r24, 0x01 ; 1 b90a: 23 2b or r18, r19 b90c: 09 f4 brne .+2 ; 0xb910 b90e: 80 e0 ldi r24, 0x00 ; 0 b910: 08 95 ret 0000b912 : #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 { b912: 0f 93 push r16 b914: 1f 93 push r17 b916: cf 93 push r28 b918: df 93 push r29 b91a: 8c 01 movw r16, r24 b91c: 86 2f mov r24, r22 b91e: ea 01 movw r28, r20 if (code_seen(code)) { b920: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 b924: 88 23 and r24, r24 b926: 19 f1 breq .+70 ; 0xb96e // Verify value is within allowed range int16_t temp = code_value_short(); b928: 0e 94 13 5c call 0xb826 ; 0xb826 if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { b92c: 9c 01 movw r18, r24 b92e: 97 ff sbrs r25, 7 b930: 03 c0 rjmp .+6 ; 0xb938 b932: 31 95 neg r19 b934: 21 95 neg r18 b936: 31 09 sbc r19, r1 b938: 25 36 cpi r18, 0x65 ; 101 b93a: 31 05 cpc r19, r1 b93c: 9c f0 brlt .+38 ; 0xb964 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); b93e: 9f 93 push r25 b940: 8f 93 push r24 b942: 8a eb ldi r24, 0xBA ; 186 b944: 99 ea ldi r25, 0xA9 ; 169 b946: 9f 93 push r25 b948: 8f 93 push r24 b94a: 8d ef ldi r24, 0xFD ; 253 b94c: 9c e7 ldi r25, 0x7C ; 124 b94e: 9f 93 push r25 b950: 8f 93 push r24 b952: 0f 94 4b dc call 0x3b896 ; 0x3b896 b956: 0f 90 pop r0 b958: 0f 90 pop r0 b95a: 0f 90 pop r0 b95c: 0f 90 pop r0 b95e: 0f 90 pop r0 b960: 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; b962: 80 e0 ldi r24, 0x00 ; 0 }; b964: df 91 pop r29 b966: cf 91 pop r28 b968: 1f 91 pop r17 b96a: 0f 91 pop r16 b96c: 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) { b96e: f8 01 movw r30, r16 b970: 80 81 ld r24, Z b972: 88 23 and r24, r24 b974: b1 f3 breq .-20 ; 0xb962 return (int8_t)eeprom_read_byte(eep_address); b976: ce 01 movw r24, r28 } return 0; }; b978: df 91 pop r29 b97a: cf 91 pop r28 b97c: 1f 91 pop r17 b97e: 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); b980: 0d 94 89 dd jmp 0x3bb12 ; 0x3bb12 0000b984 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); b984: 60 e0 ldi r22, 0x00 ; 0 b986: 86 e6 ldi r24, 0x66 ; 102 b988: 9f e0 ldi r25, 0x0F ; 15 b98a: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a b98e: 60 e0 ldi r22, 0x00 ; 0 b990: 88 e6 ldi r24, 0x68 ; 104 b992: 9f e0 ldi r25, 0x0F ; 15 b994: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a b998: 60 e0 ldi r22, 0x00 ; 0 b99a: 85 e6 ldi r24, 0x65 ; 101 b99c: 9f e0 ldi r25, 0x0F ; 15 b99e: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a b9a2: 60 e0 ldi r22, 0x00 ; 0 b9a4: 84 e6 ldi r24, 0x64 ; 100 b9a6: 9f e0 ldi r25, 0x0F ; 15 b9a8: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a b9ac: 60 e0 ldi r22, 0x00 ; 0 b9ae: 82 ed ldi r24, 0xD2 ; 210 b9b0: 9e e0 ldi r25, 0x0E ; 14 b9b2: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a b9b6: 60 e0 ldi r22, 0x00 ; 0 b9b8: 8f ec ldi r24, 0xCF ; 207 b9ba: 9e e0 ldi r25, 0x0E ; 14 b9bc: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0000b9c0 : return altfanStatus.isAltfan; } void altfanOverride_toggle() { altfanStatus.altfanOverride = !altfanStatus.altfanOverride; b9c0: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> b9c4: 81 fb bst r24, 1 b9c6: 66 27 eor r22, r22 b9c8: 60 f9 bld r22, 0 b9ca: 91 e0 ldi r25, 0x01 ; 1 b9cc: 69 27 eor r22, r25 b9ce: 60 fb bst r22, 0 b9d0: 81 f9 bld r24, 1 b9d2: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> b9d6: 8b e2 ldi r24, 0x2B ; 43 b9d8: 9d e0 ldi r25, 0x0D ; 13 b9da: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0000b9de : // 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) b9de: 80 36 cpi r24, 0x60 ; 96 b9e0: 91 05 cpc r25, r1 b9e2: f8 f4 brcc .+62 ; 0xba22 return false; if (bufindr == bufindw && buflen > 0) b9e4: 40 91 6e 12 lds r20, 0x126E ; 0x80126e b9e8: 50 91 6f 12 lds r21, 0x126F ; 0x80126f b9ec: 20 91 7c 10 lds r18, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> b9f0: 30 91 7d 10 lds r19, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> b9f4: 42 17 cp r20, r18 b9f6: 53 07 cpc r21, r19 b9f8: 39 f4 brne .+14 ; 0xba08 b9fa: 60 91 7f 10 lds r22, 0x107F ; 0x80107f b9fe: 70 91 80 10 lds r23, 0x1080 ; 0x801080 ba02: 16 16 cp r1, r22 ba04: 17 06 cpc r1, r23 ba06: 6c f0 brlt .+26 ; 0xba22 // 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); ba08: b9 01 movw r22, r18 ba0a: 68 0f add r22, r24 ba0c: 79 1f adc r23, r25 ba0e: fb 01 movw r30, r22 ba10: e3 59 subi r30, 0x93 ; 147 ba12: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) ba14: 24 17 cp r18, r20 ba16: 35 07 cpc r19, r21 ba18: 30 f4 brcc .+12 ; 0xba26 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; ba1a: 81 e0 ldi r24, 0x01 ; 1 ba1c: 4e 17 cp r20, r30 ba1e: 5f 07 cpc r21, r31 ba20: 08 f4 brcc .+2 ; 0xba24 // 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; ba22: 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; } ba24: 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? ba26: ee 3e cpi r30, 0xEE ; 238 ba28: f1 40 sbci r31, 0x01 ; 1 ba2a: f8 f0 brcs .+62 ; 0xba6a // 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); ba2c: 6c 5f subi r22, 0xFC ; 252 ba2e: 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) || ba30: 6e 3e cpi r22, 0xEE ; 238 ba32: 71 40 sbci r23, 0x01 ; 1 ba34: 18 f4 brcc .+6 ; 0xba3c // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) ba36: 49 36 cpi r20, 0x69 ; 105 ba38: 51 05 cpc r21, r1 ba3a: b8 f4 brcc .+46 ; 0xba6a return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { ba3c: 83 59 subi r24, 0x93 ; 147 ba3e: 9f 4f sbci r25, 0xFF ; 255 ba40: 48 17 cp r20, r24 ba42: 59 07 cpc r21, r25 ba44: 70 f3 brcs .-36 ; 0xba22 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); ba46: 4d ee ldi r20, 0xED ; 237 ba48: 51 e0 ldi r21, 0x01 ; 1 ba4a: 42 1b sub r20, r18 ba4c: 53 0b sbc r21, r19 ba4e: 70 e0 ldi r23, 0x00 ; 0 ba50: 60 e0 ldi r22, 0x00 ; 0 ba52: c9 01 movw r24, r18 ba54: 8f 57 subi r24, 0x7F ; 127 ba56: 9f 4e sbci r25, 0xEF ; 239 ba58: 0f 94 bb e3 call 0x3c776 ; 0x3c776 // 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; } ba5c: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); ba5e: f8 94 cli ba60: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> ba64: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.571> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; ba68: 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; ba6a: 81 e0 ldi r24, 0x01 ; 1 ba6c: 08 95 ret 0000ba6e : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { ba6e: 2f 92 push r2 ba70: 3f 92 push r3 ba72: 4f 92 push r4 ba74: 5f 92 push r5 ba76: 6f 92 push r6 ba78: 7f 92 push r7 ba7a: 8f 92 push r8 ba7c: 9f 92 push r9 ba7e: af 92 push r10 ba80: bf 92 push r11 ba82: cf 92 push r12 ba84: df 92 push r13 ba86: ef 92 push r14 ba88: ff 92 push r15 ba8a: 0f 93 push r16 ba8c: 1f 93 push r17 ba8e: cf 93 push r28 ba90: df 93 push r29 ba92: cd b7 in r28, 0x3d ; 61 ba94: de b7 in r29, 0x3e ; 62 ba96: cc 58 subi r28, 0x8C ; 140 ba98: d2 40 sbci r29, 0x02 ; 2 ba9a: 0f b6 in r0, 0x3f ; 63 ba9c: f8 94 cli ba9e: de bf out 0x3e, r29 ; 62 baa0: 0f be out 0x3f, r0 ; 63 baa2: cd bf out 0x3d, r28 ; 61 baa4: cb 58 subi r28, 0x8B ; 139 baa6: dd 4f sbci r29, 0xFD ; 253 baa8: 68 83 st Y, r22 baaa: 79 83 std Y+1, r23 ; 0x01 baac: 8a 83 std Y+2, r24 ; 0x02 baae: 9b 83 std Y+3, r25 ; 0x03 bab0: c5 57 subi r28, 0x75 ; 117 bab2: 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; bab4: fe 01 movw r30, r28 bab6: e7 54 subi r30, 0x47 ; 71 bab8: fe 4f sbci r31, 0xFE ; 254 baba: 88 e2 ldi r24, 0x28 ; 40 babc: df 01 movw r26, r30 babe: 1d 92 st X+, r1 bac0: 8a 95 dec r24 bac2: e9 f7 brne .-6 ; 0xbabe bac4: e8 5b subi r30, 0xB8 ; 184 bac6: f1 40 sbci r31, 0x01 ; 1 bac8: 1f 01 movw r2, r30 baca: 80 e9 ldi r24, 0x90 ; 144 bacc: 91 e0 ldi r25, 0x01 ; 1 bace: df 01 movw r26, r30 bad0: fc 01 movw r30, r24 bad2: 1d 92 st X+, r1 bad4: 31 97 sbiw r30, 0x01 ; 1 bad6: e9 f7 brne .-6 ; 0xbad2 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; bad8: c7 5a subi r28, 0xA7 ; 167 bada: dd 4f sbci r29, 0xFD ; 253 badc: 19 82 std Y+1, r1 ; 0x01 bade: 18 82 st Y, r1 bae0: c9 55 subi r28, 0x59 ; 89 bae2: d2 40 sbci r29, 0x02 ; 2 bae4: 9e 01 movw r18, r28 bae6: 2f 51 subi r18, 0x1F ; 31 bae8: 3e 4f sbci r19, 0xFE ; 254 baea: c1 59 subi r28, 0x91 ; 145 baec: dd 4f sbci r29, 0xFD ; 253 baee: 39 83 std Y+1, r19 ; 0x01 baf0: 28 83 st Y, r18 baf2: cf 56 subi r28, 0x6F ; 111 baf4: d2 40 sbci r29, 0x02 ; 2 baf6: 8e 01 movw r16, r28 baf8: 07 5a subi r16, 0xA7 ; 167 bafa: 1d 4f sbci r17, 0xFD ; 253 bafc: ce 01 movw r24, r28 bafe: 8f 5c subi r24, 0xCF ; 207 bb00: 9d 4f sbci r25, 0xFD ; 253 bb02: c3 59 subi r28, 0x93 ; 147 bb04: dd 4f sbci r29, 0xFD ; 253 bb06: 99 83 std Y+1, r25 ; 0x01 bb08: 88 83 st Y, r24 bb0a: cd 56 subi r28, 0x6D ; 109 bb0c: d2 40 sbci r29, 0x02 ; 2 bb0e: 3c 01 movw r6, r24 bb10: 49 01 movw r8, r18 bb12: 40 eb ldi r20, 0xB0 ; 176 bb14: a4 2e mov r10, r20 bb16: 4f e0 ldi r20, 0x0F ; 15 bb18: b4 2e mov r11, r20 bb1a: 53 e2 ldi r21, 0x23 ; 35 bb1c: c5 2e mov r12, r21 bb1e: d1 2c mov r13, r1 for (i = 0; i < n; i++) { bb20: f1 2c mov r15, r1 bb22: 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]; bb24: b6 01 movw r22, r12 bb26: 0d 2c mov r0, r13 bb28: 00 0c add r0, r0 bb2a: 88 0b sbc r24, r24 bb2c: 99 0b sbc r25, r25 bb2e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> bb32: d4 01 movw r26, r8 bb34: 6d 93 st X+, r22 bb36: 7d 93 st X+, r23 bb38: 8d 93 st X+, r24 bb3a: 9d 93 st X+, r25 bb3c: 4d 01 movw r8, r26 f[i] = (float)shift[i]; bb3e: f8 01 movw r30, r16 bb40: 61 91 ld r22, Z+ bb42: 71 91 ld r23, Z+ bb44: 8f 01 movw r16, r30 bb46: 07 2e mov r0, r23 bb48: 00 0c add r0, r0 bb4a: 88 0b sbc r24, r24 bb4c: 99 0b sbc r25, r25 bb4e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> bb52: d3 01 movw r26, r6 bb54: 6d 93 st X+, r22 bb56: 7d 93 st X+, r23 bb58: 8d 93 st X+, r24 bb5a: 9d 93 st X+, r25 bb5c: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { bb5e: bf ef ldi r27, 0xFF ; 255 bb60: eb 1a sub r14, r27 bb62: fb 0a sbc r15, r27 bb64: e6 e0 ldi r30, 0x06 ; 6 bb66: ee 16 cp r14, r30 bb68: f1 04 cpc r15, r1 bb6a: 09 f0 breq .+2 ; 0xbb6e bb6c: 38 c3 rjmp .+1648 ; 0xc1de 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; bb6e: cb 58 subi r28, 0x8B ; 139 bb70: dd 4f sbci r29, 0xFD ; 253 bb72: 28 81 ld r18, Y bb74: 39 81 ldd r19, Y+1 ; 0x01 bb76: 4a 81 ldd r20, Y+2 ; 0x02 bb78: 5b 81 ldd r21, Y+3 ; 0x03 bb7a: c5 57 subi r28, 0x75 ; 117 bb7c: d2 40 sbci r29, 0x02 ; 2 bb7e: c1 59 subi r28, 0x91 ; 145 bb80: dd 4f sbci r29, 0xFD ; 253 bb82: a8 81 ld r26, Y bb84: b9 81 ldd r27, Y+1 ; 0x01 bb86: cf 56 subi r28, 0x6F ; 111 bb88: d2 40 sbci r29, 0x02 ; 2 bb8a: 6d 91 ld r22, X+ bb8c: 7d 91 ld r23, X+ bb8e: 8d 91 ld r24, X+ bb90: 9c 91 ld r25, X bb92: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> bb96: 41 2c mov r4, r1 bb98: 51 2c mov r5, r1 bb9a: 32 01 movw r6, r4 bb9c: 18 16 cp r1, r24 bb9e: 0c f4 brge .+2 ; 0xbba2 bba0: 02 c3 rjmp .+1540 ; 0xc1a6 bba2: c3 59 subi r28, 0x93 ; 147 bba4: dd 4f sbci r29, 0xFD ; 253 bba6: 08 81 ld r16, Y bba8: 19 81 ldd r17, Y+1 ; 0x01 bbaa: cd 56 subi r28, 0x6D ; 109 bbac: d2 40 sbci r29, 0x02 ; 2 bbae: 0c 5e subi r16, 0xEC ; 236 bbb0: 1f 4f sbci r17, 0xFF ; 255 bbb2: c1 59 subi r28, 0x91 ; 145 bbb4: dd 4f sbci r29, 0xFD ; 253 bbb6: e8 80 ld r14, Y bbb8: f9 80 ldd r15, Y+1 ; 0x01 bbba: cf 56 subi r28, 0x6F ; 111 bbbc: d2 40 sbci r29, 0x02 ; 2 bbbe: b4 e1 ldi r27, 0x14 ; 20 bbc0: eb 0e add r14, r27 bbc2: f1 1c adc r15, r1 bbc4: 6e 01 movw r12, r28 bbc6: ef ed ldi r30, 0xDF ; 223 bbc8: ce 1a sub r12, r30 bbca: ed ef ldi r30, 0xFD ; 253 bbcc: de 0a sbc r13, r30 bbce: 9e 01 movw r18, r28 bbd0: 2b 55 subi r18, 0x5B ; 91 bbd2: 3e 4f sbci r19, 0xFE ; 254 bbd4: cf 58 subi r28, 0x8F ; 143 bbd6: dd 4f sbci r29, 0xFD ; 253 bbd8: 39 83 std Y+1, r19 ; 0x01 bbda: 28 83 st Y, r18 bbdc: c1 57 subi r28, 0x71 ; 113 bbde: 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]); bbe0: d8 01 movw r26, r16 bbe2: 4d 90 ld r4, X+ bbe4: 5d 90 ld r5, X+ bbe6: 6d 90 ld r6, X+ bbe8: 7c 90 ld r7, X bbea: f7 01 movw r30, r14 bbec: 60 81 ld r22, Z bbee: 71 81 ldd r23, Z+1 ; 0x01 bbf0: 82 81 ldd r24, Z+2 ; 0x02 bbf2: 93 81 ldd r25, Z+3 ; 0x03 bbf4: d7 01 movw r26, r14 bbf6: 5e 91 ld r21, -X bbf8: 4e 91 ld r20, -X bbfa: 3e 91 ld r19, -X bbfc: 2e 91 ld r18, -X bbfe: 7d 01 movw r14, r26 bc00: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> bc04: 4b 01 movw r8, r22 bc06: 5c 01 movw r10, r24 bc08: f8 01 movw r30, r16 bc0a: 52 91 ld r21, -Z bc0c: 42 91 ld r20, -Z bc0e: 32 91 ld r19, -Z bc10: 22 91 ld r18, -Z bc12: 8f 01 movw r16, r30 bc14: c3 01 movw r24, r6 bc16: b2 01 movw r22, r4 bc18: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> bc1c: a5 01 movw r20, r10 bc1e: 94 01 movw r18, r8 bc20: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> bc24: d6 01 movw r26, r12 bc26: 9e 93 st -X, r25 bc28: 8e 93 st -X, r24 bc2a: 7e 93 st -X, r23 bc2c: 6e 93 st -X, r22 bc2e: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; bc30: cf 58 subi r28, 0x8F ; 143 bc32: dd 4f sbci r29, 0xFD ; 253 bc34: e8 81 ld r30, Y bc36: f9 81 ldd r31, Y+1 ; 0x01 bc38: c1 57 subi r28, 0x71 ; 113 bc3a: d2 40 sbci r29, 0x02 ; 2 bc3c: b2 92 st -Z, r11 bc3e: a2 92 st -Z, r10 bc40: 92 92 st -Z, r9 bc42: 82 92 st -Z, r8 bc44: cf 58 subi r28, 0x8F ; 143 bc46: dd 4f sbci r29, 0xFD ; 253 bc48: f9 83 std Y+1, r31 ; 0x01 bc4a: e8 83 st Y, r30 bc4c: c1 57 subi r28, 0x71 ; 113 bc4e: 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--) { bc50: c3 59 subi r28, 0x93 ; 147 bc52: dd 4f sbci r29, 0xFD ; 253 bc54: 28 81 ld r18, Y bc56: 39 81 ldd r19, Y+1 ; 0x01 bc58: cd 56 subi r28, 0x6D ; 109 bc5a: d2 40 sbci r29, 0x02 ; 2 bc5c: 02 17 cp r16, r18 bc5e: 13 07 cpc r17, r19 bc60: 09 f0 breq .+2 ; 0xbc64 bc62: be cf rjmp .-132 ; 0xbbe0 bc64: 4e 01 movw r8, r28 bc66: 3f e6 ldi r19, 0x6F ; 111 bc68: 83 1a sub r8, r19 bc6a: 3e ef ldi r19, 0xFE ; 254 bc6c: 93 0a sbc r9, r19 bc6e: 5e 01 movw r10, r28 bc70: 83 ef ldi r24, 0xF3 ; 243 bc72: a8 1a sub r10, r24 bc74: 8d ef ldi r24, 0xFD ; 253 bc76: b8 0a sbc r11, r24 bc78: 61 01 movw r12, r2 bc7a: 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 bc9e: 9b 01 movw r18, r22 bca0: ac 01 movw r20, r24 bca2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> bca6: f8 01 movw r30, r16 bca8: 64 a7 std Z+44, r22 ; 0x2c bcaa: 75 a7 std Z+45, r23 ; 0x2d bcac: 86 a7 std Z+46, r24 ; 0x2e bcae: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { bcb0: f1 e0 ldi r31, 0x01 ; 1 bcb2: ef 16 cp r14, r31 bcb4: f1 04 cpc r15, r1 bcb6: 61 f0 breq .+24 ; 0xbcd0 m[i][i - 1] = h[i - 1]; bcb8: d8 01 movw r26, r16 bcba: 98 96 adiw r26, 0x28 ; 40 bcbc: 4d 92 st X+, r4 bcbe: 5d 92 st X+, r5 bcc0: 6d 92 st X+, r6 bcc2: 7c 92 st X, r7 bcc4: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; bcc6: f8 01 movw r30, r16 bcc8: 44 82 std Z+4, r4 ; 0x04 bcca: 55 82 std Z+5, r5 ; 0x05 bccc: 66 82 std Z+6, r6 ; 0x06 bcce: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); bcd0: ff ef ldi r31, 0xFF ; 255 bcd2: ef 1a sub r14, r31 bcd4: ff 0a sbc r15, r31 bcd6: f5 01 movw r30, r10 bcd8: 20 81 ld r18, Z bcda: 31 81 ldd r19, Z+1 ; 0x01 bcdc: 42 81 ldd r20, Z+2 ; 0x02 bcde: 53 81 ldd r21, Z+3 ; 0x03 bce0: 84 e0 ldi r24, 0x04 ; 4 bce2: a8 0e add r10, r24 bce4: b1 1c adc r11, r1 bce6: 64 81 ldd r22, Z+4 ; 0x04 bce8: 75 81 ldd r23, Z+5 ; 0x05 bcea: 86 81 ldd r24, Z+6 ; 0x06 bcec: 97 81 ldd r25, Z+7 ; 0x07 bcee: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> bcf2: 20 e0 ldi r18, 0x00 ; 0 bcf4: 30 e0 ldi r19, 0x00 ; 0 bcf6: 40 ec ldi r20, 0xC0 ; 192 bcf8: 50 e4 ldi r21, 0x40 ; 64 bcfa: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> bcfe: d6 01 movw r26, r12 bd00: dc 96 adiw r26, 0x3c ; 60 bd02: 6d 93 st X+, r22 bd04: 7d 93 st X+, r23 bd06: 8d 93 st X+, r24 bd08: 9c 93 st X, r25 bd0a: df 97 sbiw r26, 0x3f ; 63 bd0c: 04 5d subi r16, 0xD4 ; 212 bd0e: 1f 4f sbci r17, 0xFF ; 255 bd10: b8 e2 ldi r27, 0x28 ; 40 bd12: cb 0e add r12, r27 bd14: 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 bd1e: b1 cf rjmp .-158 ; 0xbc82 bd20: 7e 01 movw r14, r28 bd22: fd e2 ldi r31, 0x2D ; 45 bd24: ef 0e add r14, r31 bd26: f1 1c adc r15, r1 bd28: 28 e2 ldi r18, 0x28 ; 40 bd2a: a2 2e mov r10, r18 bd2c: b1 2c mov r11, r1 bd2e: 00 eb ldi r16, 0xB0 ; 176 bd30: 1f ef ldi r17, 0xFF ; 255 bd32: 24 e0 ldi r18, 0x04 ; 4 bd34: 22 0e add r2, r18 bd36: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bd54: 2b 01 movw r4, r22 bd56: 3c 01 movw r6, r24 bd58: 61 01 movw r12, r2 bd5a: c0 1a sub r12, r16 bd5c: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) bd5e: 88 24 eor r8, r8 bd60: 83 94 inc r8 bd62: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; bd64: f6 01 movw r30, r12 bd66: e0 0f add r30, r16 bd68: f1 1f adc r31, r17 bd6a: ea 0d add r30, r10 bd6c: fb 1d adc r31, r11 bd6e: 20 81 ld r18, Z bd70: 31 81 ldd r19, Z+1 ; 0x01 bd72: 42 81 ldd r20, Z+2 ; 0x02 bd74: 53 81 ldd r21, Z+3 ; 0x03 bd76: c3 01 movw r24, r6 bd78: b2 01 movw r22, r4 bd7a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> bd7e: 9b 01 movw r18, r22 bd80: ac 01 movw r20, r24 bd82: f6 01 movw r30, r12 bd84: 60 81 ld r22, Z bd86: 71 81 ldd r23, Z+1 ; 0x01 bd88: 82 81 ldd r24, Z+2 ; 0x02 bd8a: 93 81 ldd r25, Z+3 ; 0x03 bd8c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> bd90: d6 01 movw r26, r12 bd92: 6d 93 st X+, r22 bd94: 7d 93 st X+, r23 bd96: 8d 93 st X+, r24 bd98: 9d 93 st X+, r25 bd9a: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bdaa: 3c e2 ldi r19, 0x2C ; 44 bdac: e3 0e add r14, r19 bdae: f1 1c adc r15, r1 bdb0: 08 52 subi r16, 0x28 ; 40 bdb2: 11 09 sbc r17, r1 bdb4: 88 e2 ldi r24, 0x28 ; 40 bdb6: a8 0e add r10, r24 bdb8: 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 bdc2: ba cf rjmp .-140 ; 0xbd38 bdc4: 1e 01 movw r2, r28 bdc6: f5 eb ldi r31, 0xB5 ; 181 bdc8: 2f 0e add r2, r31 bdca: 31 1c adc r3, r1 bdcc: 6e 01 movw r12, r28 bdce: 21 eb ldi r18, 0xB1 ; 177 bdd0: c2 0e add r12, r18 bdd2: d1 1c adc r13, r1 bdd4: 7e 01 movw r14, r28 bdd6: 37 e3 ldi r19, 0x37 ; 55 bdd8: e3 1a sub r14, r19 bdda: 3e ef ldi r19, 0xFE ; 254 bddc: 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--) { bdde: 04 e0 ldi r16, 0x04 ; 4 bde0: 10 e0 ldi r17, 0x00 ; 0 bde2: 48 01 movw r8, r16 bde4: b1 2c mov r11, r1 bde6: a1 2c mov r10, r1 sum = 0; bde8: 41 2c mov r4, r1 bdea: 51 2c mov r5, r1 bdec: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; bdee: f6 01 movw r30, r12 bdf0: ea 0d add r30, r10 bdf2: fb 1d adc r31, r11 bdf4: d7 01 movw r26, r14 bdf6: aa 0d add r26, r10 bdf8: bb 1d adc r27, r11 bdfa: 2d 91 ld r18, X+ bdfc: 3d 91 ld r19, X+ bdfe: 4d 91 ld r20, X+ be00: 5c 91 ld r21, X be02: 60 81 ld r22, Z be04: 71 81 ldd r23, Z+1 ; 0x01 be06: 82 81 ldd r24, Z+2 ; 0x02 be08: 93 81 ldd r25, Z+3 ; 0x03 be0a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> be0e: 9b 01 movw r18, r22 be10: ac 01 movw r20, r24 be12: c3 01 movw r24, r6 be14: b2 01 movw r22, r4 be16: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> be1a: 2b 01 movw r4, r22 be1c: 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++) be1e: 8f ef ldi r24, 0xFF ; 255 be20: 88 1a sub r8, r24 be22: 98 0a sbc r9, r24 be24: 94 e0 ldi r25, 0x04 ; 4 be26: a9 0e add r10, r25 be28: b1 1c adc r11, r1 be2a: a5 e0 ldi r26, 0x05 ; 5 be2c: 8a 16 cp r8, r26 be2e: 91 04 cpc r9, r1 be30: f1 f6 brne .-68 ; 0xbdee sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; be32: a3 01 movw r20, r6 be34: 92 01 movw r18, r4 be36: f1 01 movw r30, r2 be38: 60 81 ld r22, Z be3a: 71 81 ldd r23, Z+1 ; 0x01 be3c: 82 81 ldd r24, Z+2 ; 0x02 be3e: 93 81 ldd r25, Z+3 ; 0x03 be40: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> be44: d6 01 movw r26, r12 be46: 2d 91 ld r18, X+ be48: 3d 91 ld r19, X+ be4a: 4d 91 ld r20, X+ be4c: 5c 91 ld r21, X be4e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> be52: f7 01 movw r30, r14 be54: 60 83 st Z, r22 be56: 71 83 std Z+1, r23 ; 0x01 be58: 82 83 std Z+2, r24 ; 0x02 be5a: 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--) { be5c: 01 50 subi r16, 0x01 ; 1 be5e: 11 09 sbc r17, r1 be60: f8 e2 ldi r31, 0x28 ; 40 be62: 2f 1a sub r2, r31 be64: 31 08 sbc r3, r1 be66: 2c e2 ldi r18, 0x2C ; 44 be68: c2 1a sub r12, r18 be6a: d1 08 sbc r13, r1 be6c: 34 e0 ldi r19, 0x04 ; 4 be6e: e3 1a sub r14, r19 be70: f1 08 sbc r15, r1 be72: 01 15 cp r16, r1 be74: 11 05 cpc r17, r1 be76: 09 f0 breq .+2 ; 0xbe7a be78: b4 cf rjmp .-152 ; 0xbde2 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { be7a: cb 50 subi r28, 0x0B ; 11 be7c: de 4f sbci r29, 0xFE ; 254 be7e: 88 81 ld r24, Y be80: 99 81 ldd r25, Y+1 ; 0x01 be82: aa 81 ldd r26, Y+2 ; 0x02 be84: bb 81 ldd r27, Y+3 ; 0x03 be86: c5 5f subi r28, 0xF5 ; 245 be88: d1 40 sbci r29, 0x01 ; 1 be8a: cf 57 subi r28, 0x7F ; 127 be8c: dd 4f sbci r29, 0xFD ; 253 be8e: 88 83 st Y, r24 be90: 99 83 std Y+1, r25 ; 0x01 be92: aa 83 std Y+2, r26 ; 0x02 be94: bb 83 std Y+3, r27 ; 0x03 be96: c1 58 subi r28, 0x81 ; 129 be98: d2 40 sbci r29, 0x02 ; 2 be9a: 1e 01 movw r2, r28 be9c: 97 e4 ldi r25, 0x47 ; 71 be9e: 29 1a sub r2, r25 bea0: 9e ef ldi r25, 0xFE ; 254 bea2: 39 0a sbc r3, r25 bea4: 10 e0 ldi r17, 0x00 ; 0 bea6: 00 e0 ldi r16, 0x00 ; 0 bea8: c1 59 subi r28, 0x91 ; 145 beaa: dd 4f sbci r29, 0xFD ; 253 beac: a8 81 ld r26, Y beae: b9 81 ldd r27, Y+1 ; 0x01 beb0: cf 56 subi r28, 0x6F ; 111 beb2: d2 40 sbci r29, 0x02 ; 2 beb4: cd 90 ld r12, X+ beb6: dd 90 ld r13, X+ beb8: ed 90 ld r14, X+ beba: fd 90 ld r15, X+ bebc: c1 59 subi r28, 0x91 ; 145 bebe: dd 4f sbci r29, 0xFD ; 253 bec0: b9 83 std Y+1, r27 ; 0x01 bec2: a8 83 st Y, r26 bec4: cf 56 subi r28, 0x6F ; 111 bec6: d2 40 sbci r29, 0x02 ; 2 bec8: cb 58 subi r28, 0x8B ; 139 beca: dd 4f sbci r29, 0xFD ; 253 becc: 28 81 ld r18, Y bece: 39 81 ldd r19, Y+1 ; 0x01 bed0: 4a 81 ldd r20, Y+2 ; 0x02 bed2: 5b 81 ldd r21, Y+3 ; 0x03 bed4: c5 57 subi r28, 0x75 ; 117 bed6: d2 40 sbci r29, 0x02 ; 2 bed8: c7 01 movw r24, r14 beda: b6 01 movw r22, r12 bedc: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> bee0: 18 16 cp r1, r24 bee2: b4 f0 brlt .+44 ; 0xbf10 bee4: cb 58 subi r28, 0x8B ; 139 bee6: dd 4f sbci r29, 0xFD ; 253 bee8: 28 81 ld r18, Y beea: 39 81 ldd r19, Y+1 ; 0x01 beec: 4a 81 ldd r20, Y+2 ; 0x02 beee: 5b 81 ldd r21, Y+3 ; 0x03 bef0: c5 57 subi r28, 0x75 ; 117 bef2: d2 40 sbci r29, 0x02 ; 2 bef4: c1 59 subi r28, 0x91 ; 145 bef6: dd 4f sbci r29, 0xFD ; 253 bef8: e8 81 ld r30, Y befa: f9 81 ldd r31, Y+1 ; 0x01 befc: cf 56 subi r28, 0x6F ; 111 befe: d2 40 sbci r29, 0x02 ; 2 bf00: 60 81 ld r22, Z bf02: 71 81 ldd r23, Z+1 ; 0x01 bf04: 82 81 ldd r24, Z+2 ; 0x02 bf06: 93 81 ldd r25, Z+3 ; 0x03 bf08: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> bf0c: 87 ff sbrs r24, 7 bf0e: 18 c0 rjmp .+48 ; 0xbf40 bf10: 04 30 cpi r16, 0x04 ; 4 bf12: 11 05 cpc r17, r1 bf14: 09 f0 breq .+2 ; 0xbf18 bf16: 30 c1 rjmp .+608 ; 0xc178 bf18: cb 58 subi r28, 0x8B ; 139 bf1a: dd 4f sbci r29, 0xFD ; 253 bf1c: 28 81 ld r18, Y bf1e: 39 81 ldd r19, Y+1 ; 0x01 bf20: 4a 81 ldd r20, Y+2 ; 0x02 bf22: 5b 81 ldd r21, Y+3 ; 0x03 bf24: c5 57 subi r28, 0x75 ; 117 bf26: d2 40 sbci r29, 0x02 ; 2 bf28: cf 57 subi r28, 0x7F ; 127 bf2a: dd 4f sbci r29, 0xFD ; 253 bf2c: 68 81 ld r22, Y bf2e: 79 81 ldd r23, Y+1 ; 0x01 bf30: 8a 81 ldd r24, Y+2 ; 0x02 bf32: 9b 81 ldd r25, Y+3 ; 0x03 bf34: c1 58 subi r28, 0x81 ; 129 bf36: d2 40 sbci r29, 0x02 ; 2 bf38: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> bf3c: 87 ff sbrs r24, 7 bf3e: 1c c1 rjmp .+568 ; 0xc178 a = (s[i + 1] - s[i]) / (6 * h[i]); bf40: d1 01 movw r26, r2 bf42: 14 96 adiw r26, 0x04 ; 4 bf44: 8d 90 ld r8, X+ bf46: 9d 90 ld r9, X+ bf48: ad 90 ld r10, X+ bf4a: bc 90 ld r11, X bf4c: 17 97 sbiw r26, 0x07 ; 7 bf4e: 8d 91 ld r24, X+ bf50: 9d 91 ld r25, X+ bf52: 0d 90 ld r0, X+ bf54: bc 91 ld r27, X bf56: a0 2d mov r26, r0 bf58: cf 58 subi r28, 0x8F ; 143 bf5a: dd 4f sbci r29, 0xFD ; 253 bf5c: 88 83 st Y, r24 bf5e: 99 83 std Y+1, r25 ; 0x01 bf60: aa 83 std Y+2, r26 ; 0x02 bf62: bb 83 std Y+3, r27 ; 0x03 bf64: c1 57 subi r28, 0x71 ; 113 bf66: d2 40 sbci r29, 0x02 ; 2 bf68: f8 01 movw r30, r16 bf6a: ee 0f add r30, r30 bf6c: ff 1f adc r31, r31 bf6e: ee 0f add r30, r30 bf70: ff 1f adc r31, r31 bf72: 21 e9 ldi r18, 0x91 ; 145 bf74: 31 e0 ldi r19, 0x01 ; 1 bf76: 2c 0f add r18, r28 bf78: 3d 1f adc r19, r29 bf7a: e2 0f add r30, r18 bf7c: f3 1f adc r31, r19 bf7e: 40 80 ld r4, Z bf80: 51 80 ldd r5, Z+1 ; 0x01 bf82: 62 80 ldd r6, Z+2 ; 0x02 bf84: 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; bf86: c3 59 subi r28, 0x93 ; 147 bf88: dd 4f sbci r29, 0xFD ; 253 bf8a: a8 81 ld r26, Y bf8c: b9 81 ldd r27, Y+1 ; 0x01 bf8e: cd 56 subi r28, 0x6D ; 109 bf90: d2 40 sbci r29, 0x02 ; 2 bf92: 8d 91 ld r24, X+ bf94: 9d 91 ld r25, X+ bf96: 0d 90 ld r0, X+ bf98: bc 91 ld r27, X bf9a: a0 2d mov r26, r0 bf9c: c3 58 subi r28, 0x83 ; 131 bf9e: dd 4f sbci r29, 0xFD ; 253 bfa0: 88 83 st Y, r24 bfa2: 99 83 std Y+1, r25 ; 0x01 bfa4: aa 83 std Y+2, r26 ; 0x02 bfa6: bb 83 std Y+3, r27 ; 0x03 bfa8: cd 57 subi r28, 0x7D ; 125 bfaa: 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; bfac: a7 01 movw r20, r14 bfae: 96 01 movw r18, r12 bfb0: cb 58 subi r28, 0x8B ; 139 bfb2: dd 4f sbci r29, 0xFD ; 253 bfb4: 68 81 ld r22, Y bfb6: 79 81 ldd r23, Y+1 ; 0x01 bfb8: 8a 81 ldd r24, Y+2 ; 0x02 bfba: 9b 81 ldd r25, Y+3 ; 0x03 bfbc: c5 57 subi r28, 0x75 ; 117 bfbe: d2 40 sbci r29, 0x02 ; 2 bfc0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> bfc4: 6b 01 movw r12, r22 bfc6: 7c 01 movw r14, r24 bfc8: 20 e0 ldi r18, 0x00 ; 0 bfca: 30 e0 ldi r19, 0x00 ; 0 bfcc: 40 e4 ldi r20, 0x40 ; 64 bfce: 50 e4 ldi r21, 0x40 ; 64 bfd0: 0f 94 21 e2 call 0x3c442 ; 0x3c442 bfd4: cb 57 subi r28, 0x7B ; 123 bfd6: dd 4f sbci r29, 0xFD ; 253 bfd8: 68 83 st Y, r22 bfda: 79 83 std Y+1, r23 ; 0x01 bfdc: 8a 83 std Y+2, r24 ; 0x02 bfde: 9b 83 std Y+3, r25 ; 0x03 bfe0: c5 58 subi r28, 0x85 ; 133 bfe2: 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; bfe4: c3 58 subi r28, 0x83 ; 131 bfe6: dd 4f sbci r29, 0xFD ; 253 bfe8: 28 81 ld r18, Y bfea: 39 81 ldd r19, Y+1 ; 0x01 bfec: 4a 81 ldd r20, Y+2 ; 0x02 bfee: 5b 81 ldd r21, Y+3 ; 0x03 bff0: cd 57 subi r28, 0x7D ; 125 bff2: d2 40 sbci r29, 0x02 ; 2 bff4: c3 59 subi r28, 0x93 ; 147 bff6: dd 4f sbci r29, 0xFD ; 253 bff8: e8 81 ld r30, Y bffa: f9 81 ldd r31, Y+1 ; 0x01 bffc: cd 56 subi r28, 0x6D ; 109 bffe: d2 40 sbci r29, 0x02 ; 2 c000: 64 81 ldd r22, Z+4 ; 0x04 c002: 75 81 ldd r23, Z+5 ; 0x05 c004: 86 81 ldd r24, Z+6 ; 0x06 c006: 97 81 ldd r25, Z+7 ; 0x07 c008: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> c00c: a3 01 movw r20, r6 c00e: 92 01 movw r18, r4 c010: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> c014: c7 58 subi r28, 0x87 ; 135 c016: dd 4f sbci r29, 0xFD ; 253 c018: 68 83 st Y, r22 c01a: 79 83 std Y+1, r23 ; 0x01 c01c: 8a 83 std Y+2, r24 ; 0x02 c01e: 9b 83 std Y+3, r25 ; 0x03 c020: c9 57 subi r28, 0x79 ; 121 c022: d2 40 sbci r29, 0x02 ; 2 c024: a3 01 movw r20, r6 c026: 92 01 movw r18, r4 c028: c3 01 movw r24, r6 c02a: b2 01 movw r22, r4 c02c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> c030: cf 58 subi r28, 0x8F ; 143 c032: dd 4f sbci r29, 0xFD ; 253 c034: 28 81 ld r18, Y c036: 39 81 ldd r19, Y+1 ; 0x01 c038: 4a 81 ldd r20, Y+2 ; 0x02 c03a: 5b 81 ldd r21, Y+3 ; 0x03 c03c: c1 57 subi r28, 0x71 ; 113 c03e: d2 40 sbci r29, 0x02 ; 2 c040: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c044: c7 57 subi r28, 0x77 ; 119 c046: dd 4f sbci r29, 0xFD ; 253 c048: 68 83 st Y, r22 c04a: 79 83 std Y+1, r23 ; 0x01 c04c: 8a 83 std Y+2, r24 ; 0x02 c04e: 9b 83 std Y+3, r25 ; 0x03 c050: c9 58 subi r28, 0x89 ; 137 c052: d2 40 sbci r29, 0x02 ; 2 c054: a3 01 movw r20, r6 c056: 92 01 movw r18, r4 c058: c5 01 movw r24, r10 c05a: b4 01 movw r22, r8 c05c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c060: 9b 01 movw r18, r22 c062: ac 01 movw r20, r24 c064: c7 57 subi r28, 0x77 ; 119 c066: dd 4f sbci r29, 0xFD ; 253 c068: 68 81 ld r22, Y c06a: 79 81 ldd r23, Y+1 ; 0x01 c06c: 8a 81 ldd r24, Y+2 ; 0x02 c06e: 9b 81 ldd r25, Y+3 ; 0x03 c070: c9 58 subi r28, 0x89 ; 137 c072: d2 40 sbci r29, 0x02 ; 2 c074: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> c078: 20 e0 ldi r18, 0x00 ; 0 c07a: 30 e0 ldi r19, 0x00 ; 0 c07c: 40 ec ldi r20, 0xC0 ; 192 c07e: 50 e4 ldi r21, 0x40 ; 64 c080: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> c084: 9b 01 movw r18, r22 c086: ac 01 movw r20, r24 c088: c7 58 subi r28, 0x87 ; 135 c08a: dd 4f sbci r29, 0xFD ; 253 c08c: 68 81 ld r22, Y c08e: 79 81 ldd r23, Y+1 ; 0x01 c090: 8a 81 ldd r24, Y+2 ; 0x02 c092: 9b 81 ldd r25, Y+3 ; 0x03 c094: c9 57 subi r28, 0x79 ; 121 c096: d2 40 sbci r29, 0x02 ; 2 c098: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__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; c09c: a7 01 movw r20, r14 c09e: 96 01 movw r18, r12 c0a0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c0a4: c7 58 subi r28, 0x87 ; 135 c0a6: dd 4f sbci r29, 0xFD ; 253 c0a8: 68 83 st Y, r22 c0aa: 79 83 std Y+1, r23 ; 0x01 c0ac: 8a 83 std Y+2, r24 ; 0x02 c0ae: 9b 83 std Y+3, r25 ; 0x03 c0b0: c9 57 subi r28, 0x79 ; 121 c0b2: 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]); c0b4: cf 58 subi r28, 0x8F ; 143 c0b6: dd 4f sbci r29, 0xFD ; 253 c0b8: 28 81 ld r18, Y c0ba: 39 81 ldd r19, Y+1 ; 0x01 c0bc: 4a 81 ldd r20, Y+2 ; 0x02 c0be: 5b 81 ldd r21, Y+3 ; 0x03 c0c0: c1 57 subi r28, 0x71 ; 113 c0c2: d2 40 sbci r29, 0x02 ; 2 c0c4: c5 01 movw r24, r10 c0c6: b4 01 movw r22, r8 c0c8: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> c0cc: 4b 01 movw r8, r22 c0ce: 5c 01 movw r10, r24 c0d0: 20 e0 ldi r18, 0x00 ; 0 c0d2: 30 e0 ldi r19, 0x00 ; 0 c0d4: 40 ec ldi r20, 0xC0 ; 192 c0d6: 50 e4 ldi r21, 0x40 ; 64 c0d8: c3 01 movw r24, r6 c0da: b2 01 movw r22, r4 c0dc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c0e0: 9b 01 movw r18, r22 c0e2: ac 01 movw r20, r24 c0e4: c5 01 movw r24, r10 c0e6: b4 01 movw r22, r8 c0e8: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__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; c0ec: cb 57 subi r28, 0x7B ; 123 c0ee: dd 4f sbci r29, 0xFD ; 253 c0f0: 28 81 ld r18, Y c0f2: 39 81 ldd r19, Y+1 ; 0x01 c0f4: 4a 81 ldd r20, Y+2 ; 0x02 c0f6: 5b 81 ldd r21, Y+3 ; 0x03 c0f8: c5 58 subi r28, 0x85 ; 133 c0fa: d2 40 sbci r29, 0x02 ; 2 c0fc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c100: 4b 01 movw r8, r22 c102: 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; c104: 20 e0 ldi r18, 0x00 ; 0 c106: 30 e0 ldi r19, 0x00 ; 0 c108: 40 e0 ldi r20, 0x00 ; 0 c10a: 5f e3 ldi r21, 0x3F ; 63 c10c: cf 58 subi r28, 0x8F ; 143 c10e: dd 4f sbci r29, 0xFD ; 253 c110: 68 81 ld r22, Y c112: 79 81 ldd r23, Y+1 ; 0x01 c114: 8a 81 ldd r24, Y+2 ; 0x02 c116: 9b 81 ldd r25, Y+3 ; 0x03 c118: c1 57 subi r28, 0x71 ; 113 c11a: d2 40 sbci r29, 0x02 ; 2 c11c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c120: 2b 01 movw r4, r22 c122: 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; c124: a7 01 movw r20, r14 c126: 96 01 movw r18, r12 c128: c7 01 movw r24, r14 c12a: b6 01 movw r22, r12 c12c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c130: 9b 01 movw r18, r22 c132: ac 01 movw r20, r24 c134: c3 01 movw r24, r6 c136: b2 01 movw r22, r4 c138: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c13c: 9b 01 movw r18, r22 c13e: ac 01 movw r20, r24 c140: c5 01 movw r24, r10 c142: b4 01 movw r22, r8 c144: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> c148: 9b 01 movw r18, r22 c14a: ac 01 movw r20, r24 c14c: c7 58 subi r28, 0x87 ; 135 c14e: dd 4f sbci r29, 0xFD ; 253 c150: 68 81 ld r22, Y c152: 79 81 ldd r23, Y+1 ; 0x01 c154: 8a 81 ldd r24, Y+2 ; 0x02 c156: 9b 81 ldd r25, Y+3 ; 0x03 c158: c9 57 subi r28, 0x79 ; 121 c15a: d2 40 sbci r29, 0x02 ; 2 c15c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> c160: c3 58 subi r28, 0x83 ; 131 c162: dd 4f sbci r29, 0xFD ; 253 c164: 28 81 ld r18, Y c166: 39 81 ldd r19, Y+1 ; 0x01 c168: 4a 81 ldd r20, Y+2 ; 0x02 c16a: 5b 81 ldd r21, Y+3 ; 0x03 c16c: cd 57 subi r28, 0x7D ; 125 c16e: d2 40 sbci r29, 0x02 ; 2 c170: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> c174: 2b 01 movw r4, r22 c176: 3c 01 movw r6, r24 c178: 0f 5f subi r16, 0xFF ; 255 c17a: 1f 4f sbci r17, 0xFF ; 255 c17c: f4 e0 ldi r31, 0x04 ; 4 c17e: 2f 0e add r2, r31 c180: 31 1c adc r3, r1 c182: c3 59 subi r28, 0x93 ; 147 c184: dd 4f sbci r29, 0xFD ; 253 c186: 28 81 ld r18, Y c188: 39 81 ldd r19, Y+1 ; 0x01 c18a: cd 56 subi r28, 0x6D ; 109 c18c: d2 40 sbci r29, 0x02 ; 2 c18e: 2c 5f subi r18, 0xFC ; 252 c190: 3f 4f sbci r19, 0xFF ; 255 c192: c3 59 subi r28, 0x93 ; 147 c194: dd 4f sbci r29, 0xFD ; 253 c196: 39 83 std Y+1, r19 ; 0x01 c198: 28 83 st Y, r18 c19a: cd 56 subi r28, 0x6D ; 109 c19c: 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 c1a4: 81 ce rjmp .-766 ; 0xbea8 sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } c1a6: c3 01 movw r24, r6 c1a8: b2 01 movw r22, r4 c1aa: c4 57 subi r28, 0x74 ; 116 c1ac: dd 4f sbci r29, 0xFD ; 253 c1ae: 0f b6 in r0, 0x3f ; 63 c1b0: f8 94 cli c1b2: de bf out 0x3e, r29 ; 62 c1b4: 0f be out 0x3f, r0 ; 63 c1b6: cd bf out 0x3d, r28 ; 61 c1b8: df 91 pop r29 c1ba: cf 91 pop r28 c1bc: 1f 91 pop r17 c1be: 0f 91 pop r16 c1c0: ff 90 pop r15 c1c2: ef 90 pop r14 c1c4: df 90 pop r13 c1c6: cf 90 pop r12 c1c8: bf 90 pop r11 c1ca: af 90 pop r10 c1cc: 9f 90 pop r9 c1ce: 8f 90 pop r8 c1d0: 7f 90 pop r7 c1d2: 6f 90 pop r6 c1d4: 5f 90 pop r5 c1d6: 4f 90 pop r4 c1d8: 3f 90 pop r3 c1da: 2f 90 pop r2 c1dc: 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)); c1de: c5 01 movw r24, r10 c1e0: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e c1e4: d8 01 movw r26, r16 c1e6: 8d 93 st X+, r24 c1e8: 9c 93 st X, r25 c1ea: b5 e0 ldi r27, 0x05 ; 5 c1ec: cb 0e add r12, r27 c1ee: d1 1c adc r13, r1 c1f0: e2 e0 ldi r30, 0x02 ; 2 c1f2: ae 0e add r10, r30 c1f4: b1 1c adc r11, r1 c1f6: 96 cc rjmp .-1748 ; 0xbb24 0000c1f8 : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { c1f8: 0f 93 push r16 c1fa: 1f 93 push r17 c1fc: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) c1fe: 20 91 96 13 lds r18, 0x1396 ; 0x801396 c202: 21 30 cpi r18, 0x01 ; 1 c204: 79 f5 brne .+94 ; 0xc264 c206: 8c 01 movw r16, r24 c208: 80 e5 ldi r24, 0x50 ; 80 c20a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 c20e: 88 23 and r24, r24 c210: 49 f1 breq .+82 ; 0xc264 { mmuSlotIndex = code_value_uint8(); c212: 0e 94 06 5c call 0xb80c ; 0xb80c c216: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { c218: 85 30 cpi r24, 0x05 ; 5 c21a: 20 f5 brcc .+72 ; 0xc264 switch (gcode) c21c: 01 3c cpi r16, 0xC1 ; 193 c21e: 82 e0 ldi r24, 0x02 ; 2 c220: 18 07 cpc r17, r24 c222: 49 f0 breq .+18 ; 0xc236 c224: 02 3c cpi r16, 0xC2 ; 194 c226: 12 40 sbci r17, 0x02 ; 2 c228: 69 f0 breq .+26 ; 0xc244 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c22a: 8c 2f mov r24, r28 default: break; } } } } c22c: cf 91 pop r28 c22e: 1f 91 pop r17 c230: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c232: 0d 94 7d a0 jmp 0x340fa ; 0x340fa break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c236: 60 e0 ldi r22, 0x00 ; 0 c238: 8c 2f mov r24, r28 default: break; } } } } c23a: cf 91 pop r28 c23c: 1f 91 pop r17 c23e: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c240: 0d 94 c0 a0 jmp 0x34180 ; 0x34180 break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ c244: 8e ec ldi r24, 0xCE ; 206 c246: 9e e0 ldi r25, 0x0E ; 14 c248: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 c24c: 88 23 and r24, r24 c24e: 51 f0 breq .+20 ; 0xc264 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { c250: 0f 94 4e 88 call 0x3109c ; 0x3109c c254: 88 23 and r24, r24 c256: 31 f0 breq .+12 ; 0xc264 c258: 8c 2f mov r24, r28 default: break; } } } } c25a: cf 91 pop r28 c25c: 1f 91 pop r17 c25e: 0f 91 pop r16 c260: 0d 94 3d a1 jmp 0x3427a ; 0x3427a c264: cf 91 pop r28 c266: 1f 91 pop r17 c268: 0f 91 pop r16 c26a: 08 95 ret 0000c26c : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c26c: cf 93 push r28 c26e: 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(); c270: 0f 94 24 59 call 0x2b248 ; 0x2b248 cli(); c274: f8 94 cli tmc2130_mode = mode; c276: c0 93 6a 06 sts 0x066A, r28 ; 0x80066a update_mode_profile(); c27a: 0f 94 bf aa call 0x3557e ; 0x3557e 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(); c27e: 0e 94 ce f9 call 0x1f39c ; 0x1f39c 1 #else 0 #endif ) , enableECool(enableECool) { } c282: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c284: 82 70 andi r24, 0x02 ; 2 c286: 0f 94 19 3c call 0x27832 ; 0x27832 // 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(); c28a: 0f 94 7e 59 call 0x2b2fc ; 0x2b2fc sei(); c28e: 78 94 sei } c290: cf 91 pop r28 c292: 08 95 ret 0000c294 : 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);} c294: 8f 92 push r8 c296: 9f 92 push r9 c298: af 92 push r10 c29a: bf 92 push r11 c29c: cf 92 push r12 c29e: df 92 push r13 c2a0: ef 92 push r14 c2a2: ff 92 push r15 c2a4: 0f 93 push r16 c2a6: 1f 93 push r17 c2a8: cf 93 push r28 c2aa: df 93 push r29 c2ac: 00 91 95 03 lds r16, 0x0395 ; 0x800395 c2b0: 10 91 96 03 lds r17, 0x0396 ; 0x800396 c2b4: 0f 5f subi r16, 0xFF ; 255 c2b6: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c2b8: 68 01 movw r12, r16 c2ba: 8f ef ldi r24, 0xFF ; 255 c2bc: c8 1a sub r12, r24 c2be: d8 0a sbc r13, r24 c2c0: d8 01 movw r26, r16 c2c2: dc 91 ld r29, X } while (isspace(c)); c2c4: 8d 2f mov r24, r29 c2c6: 90 e0 ldi r25, 0x00 ; 0 c2c8: 0f 94 1a db call 0x3b634 ; 0x3b634 c2cc: 7c 01 movw r14, r24 c2ce: 89 2b or r24, r25 c2d0: 01 f5 brne .+64 ; 0xc312 flag = 0; if (c == '-') { c2d2: dd 32 cpi r29, 0x2D ; 45 c2d4: 01 f5 brne .+64 ; 0xc316 flag = FL_MINUS; c = *nptr++; c2d6: 68 01 movw r12, r16 c2d8: b2 e0 ldi r27, 0x02 ; 2 c2da: cb 0e add r12, r27 c2dc: d1 1c adc r13, r1 c2de: f8 01 movw r30, r16 c2e0: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c2e2: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c2e4: 86 01 movw r16, r12 c2e6: 01 50 subi r16, 0x01 ; 1 c2e8: 11 09 sbc r17, r1 c2ea: 43 e0 ldi r20, 0x03 ; 3 c2ec: 50 e0 ldi r21, 0x00 ; 0 c2ee: 6f e3 ldi r22, 0x3F ; 63 c2f0: 7c e7 ldi r23, 0x7C ; 124 c2f2: c8 01 movw r24, r16 c2f4: 0f 94 50 db call 0x3b6a0 ; 0x3b6a0 c2f8: 89 2b or r24, r25 c2fa: c1 f4 brne .+48 ; 0xc32c nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c2fc: 60 e0 ldi r22, 0x00 ; 0 c2fe: 70 e0 ldi r23, 0x00 ; 0 c300: 80 e8 ldi r24, 0x80 ; 128 c302: 9f ef ldi r25, 0xFF ; 255 c304: c1 11 cpse r28, r1 c306: db c0 rjmp .+438 ; 0xc4be c308: 60 e0 ldi r22, 0x00 ; 0 c30a: 70 e0 ldi r23, 0x00 ; 0 c30c: 80 e8 ldi r24, 0x80 ; 128 c30e: 9f e7 ldi r25, 0x7F ; 127 c310: d6 c0 rjmp .+428 ; 0xc4be if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c312: 86 01 movw r16, r12 c314: d1 cf rjmp .-94 ; 0xc2b8 flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c316: db 32 cpi r29, 0x2B ; 43 c318: 39 f4 brne .+14 ; 0xc328 c = *nptr++; c31a: 68 01 movw r12, r16 c31c: f2 e0 ldi r31, 0x02 ; 2 c31e: cf 0e add r12, r31 c320: d1 1c adc r13, r1 c322: d8 01 movw r26, r16 c324: 11 96 adiw r26, 0x01 ; 1 c326: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c328: c0 e0 ldi r28, 0x00 ; 0 c32a: dc cf rjmp .-72 ; 0xc2e4 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)) { c32c: 43 e0 ldi r20, 0x03 ; 3 c32e: 50 e0 ldi r21, 0x00 ; 0 c330: 6c e3 ldi r22, 0x3C ; 60 c332: 7c e7 ldi r23, 0x7C ; 124 c334: c8 01 movw r24, r16 c336: 0f 94 50 db call 0x3b6a0 ; 0x3b6a0 c33a: 89 2b or r24, r25 c33c: 09 f4 brne .+2 ; 0xc340 c33e: cc c0 rjmp .+408 ; 0xc4d8 c340: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c342: 10 e0 ldi r17, 0x00 ; 0 c344: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c346: 20 e0 ldi r18, 0x00 ; 0 c348: 30 e0 ldi r19, 0x00 ; 0 c34a: a9 01 movw r20, r18 c34c: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c34e: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c350: da 30 cpi r29, 0x0A ; 10 c352: 60 f5 brcc .+88 ; 0xc3ac flag |= FL_ANY; c354: bc 2e mov r11, r28 c356: 68 94 set c358: b1 f8 bld r11, 1 c35a: 8c 2f mov r24, r28 c35c: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c35e: c2 ff sbrs r28, 2 c360: 09 c0 rjmp .+18 ; 0xc374 if (!(flag & FL_DOT)) c362: 81 11 cpse r24, r1 c364: 02 c0 rjmp .+4 ; 0xc36a exp += 1; c366: 0f 5f subi r16, 0xFF ; 255 c368: 1f 4f sbci r17, 0xFF ; 255 c36a: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c36c: d6 01 movw r26, r12 c36e: dc 91 ld r29, X c370: cb 2d mov r28, r11 c372: ec cf rjmp .-40 ; 0xc34c if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c374: 88 23 and r24, r24 c376: 11 f0 breq .+4 ; 0xc37c exp -= 1; c378: 01 50 subi r16, 0x01 ; 1 c37a: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c37c: a5 e0 ldi r26, 0x05 ; 5 c37e: b0 e0 ldi r27, 0x00 ; 0 c380: 0f 94 1e de call 0x3bc3c ; 0x3bc3c <__muluhisi3> c384: 9b 01 movw r18, r22 c386: ac 01 movw r20, r24 c388: 22 0f add r18, r18 c38a: 33 1f adc r19, r19 c38c: 44 1f adc r20, r20 c38e: 55 1f adc r21, r21 c390: 2d 0f add r18, r29 c392: 31 1d adc r19, r1 c394: 41 1d adc r20, r1 c396: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c398: 28 39 cpi r18, 0x98 ; 152 c39a: b9 e9 ldi r27, 0x99 ; 153 c39c: 3b 07 cpc r19, r27 c39e: 4b 07 cpc r20, r27 c3a0: b9 e1 ldi r27, 0x19 ; 25 c3a2: 5b 07 cpc r21, r27 c3a4: 10 f3 brcs .-60 ; 0xc36a flag |= FL_OVFL; c3a6: c6 60 ori r28, 0x06 ; 6 c3a8: bc 2e mov r11, r28 c3aa: df cf rjmp .-66 ; 0xc36a } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c3ac: de 3f cpi r29, 0xFE ; 254 c3ae: 31 f4 brne .+12 ; 0xc3bc c3b0: c3 fd sbrc r28, 3 c3b2: 33 c0 rjmp .+102 ; 0xc41a flag |= FL_DOT; c3b4: bc 2e mov r11, r28 c3b6: 68 94 set c3b8: b3 f8 bld r11, 3 c3ba: d7 cf rjmp .-82 ; 0xc36a } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c3bc: d5 33 cpi r29, 0x35 ; 53 c3be: 69 f5 brne .+90 ; 0xc41a { int i; c = *nptr++; c3c0: 80 81 ld r24, Z i = 2; if (c == '-') { c3c2: 8d 32 cpi r24, 0x2D ; 45 c3c4: 31 f4 brne .+12 ; 0xc3d2 flag |= FL_MEXP; c3c6: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c3c8: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c3ca: 6e 5f subi r22, 0xFE ; 254 c3cc: 7f 4f sbci r23, 0xFF ; 255 c3ce: 81 81 ldd r24, Z+1 ; 0x01 c3d0: 05 c0 rjmp .+10 ; 0xc3dc c3d2: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c3d4: 8b 32 cpi r24, 0x2B ; 43 c3d6: c9 f3 breq .-14 ; 0xc3ca // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c3d8: 6f 5f subi r22, 0xFF ; 255 c3da: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c3dc: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c3de: 8a 30 cpi r24, 0x0A ; 10 c3e0: e0 f4 brcc .+56 ; 0xc41a c3e2: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c3e4: b0 e8 ldi r27, 0x80 ; 128 c3e6: eb 16 cp r14, r27 c3e8: bc e0 ldi r27, 0x0C ; 12 c3ea: fb 06 cpc r15, r27 c3ec: 5c f4 brge .+22 ; 0xc404 i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c3ee: b7 01 movw r22, r14 c3f0: 66 0f add r22, r22 c3f2: 77 1f adc r23, r23 c3f4: 66 0f add r22, r22 c3f6: 77 1f adc r23, r23 c3f8: e6 0e add r14, r22 c3fa: f7 1e adc r15, r23 c3fc: ee 0c add r14, r14 c3fe: ff 1c adc r15, r15 c400: e8 0e add r14, r24 c402: f1 1c adc r15, r1 c = *nptr++ - '0'; c404: 81 91 ld r24, Z+ c406: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c408: 8a 30 cpi r24, 0x0A ; 10 c40a: 60 f3 brcs .-40 ; 0xc3e4 if (flag & FL_MEXP) c40c: c4 ff sbrs r28, 4 c40e: 03 c0 rjmp .+6 ; 0xc416 i = -i; c410: f1 94 neg r15 c412: e1 94 neg r14 c414: f1 08 sbc r15, r1 exp += i; c416: 0e 0d add r16, r14 c418: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c41a: ca 01 movw r24, r20 c41c: b9 01 movw r22, r18 c41e: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c422: c3 70 andi r28, 0x03 ; 3 c424: c3 30 cpi r28, 0x03 ; 3 c426: 09 f4 brne .+2 ; 0xc42a x.flt = -x.flt; c428: 90 58 subi r25, 0x80 ; 128 c42a: 4b 01 movw r8, r22 c42c: 5c 01 movw r10, r24 if (x.flt != 0) { c42e: 20 e0 ldi r18, 0x00 ; 0 c430: 30 e0 ldi r19, 0x00 ; 0 c432: a9 01 movw r20, r18 c434: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> c438: 88 23 and r24, r24 c43a: 09 f4 brne .+2 ; 0xc43e c43c: 3e c0 rjmp .+124 ; 0xc4ba if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c43e: c8 e3 ldi r28, 0x38 ; 56 c440: dc e7 ldi r29, 0x7C ; 124 if ((flag & FL_MINUS) && (flag & FL_ANY)) x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { c442: 17 ff sbrs r17, 7 c444: 05 c0 rjmp .+10 ; 0xc450 nptr = (void*)(pwr_m10 + 5); exp = -exp; c446: 11 95 neg r17 c448: 01 95 neg r16 c44a: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c44c: c0 e2 ldi r28, 0x20 ; 32 c44e: dc e7 ldi r29, 0x7C ; 124 c450: 6e 01 movw r12, r28 c452: e8 e1 ldi r30, 0x18 ; 24 c454: ce 1a sub r12, r30 c456: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c458: 80 e2 ldi r24, 0x20 ; 32 c45a: e8 2e mov r14, r24 c45c: f1 2c mov r15, r1 c45e: 0d c0 rjmp .+26 ; 0xc47a for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c460: fe 01 movw r30, r28 c462: 25 91 lpm r18, Z+ c464: 35 91 lpm r19, Z+ c466: 45 91 lpm r20, Z+ c468: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c46a: 0e 19 sub r16, r14 c46c: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c46e: c5 01 movw r24, r10 c470: b4 01 movw r22, r8 c472: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c476: 4b 01 movw r8, r22 c478: 5c 01 movw r10, r24 c47a: d5 01 movw r26, r10 c47c: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c47e: 0e 15 cp r16, r14 c480: 1f 05 cpc r17, r15 c482: 74 f7 brge .-36 ; 0xc460 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c484: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c486: f5 94 asr r15 c488: e7 94 ror r14 c48a: cc 16 cp r12, r28 c48c: dd 06 cpc r13, r29 c48e: a9 f7 brne .-22 ; 0xc47a not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c490: 8a 2f mov r24, r26 c492: 88 0f add r24, r24 c494: 8b 2f mov r24, r27 c496: 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) c498: 8f 3f cpi r24, 0xFF ; 255 c49a: 49 f0 breq .+18 ; 0xc4ae c49c: 20 e0 ldi r18, 0x00 ; 0 c49e: 30 e0 ldi r19, 0x00 ; 0 c4a0: a9 01 movw r20, r18 c4a2: c5 01 movw r24, r10 c4a4: b4 01 movw r22, r8 c4a6: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> c4aa: 81 11 cpse r24, r1 c4ac: 06 c0 rjmp .+12 ; 0xc4ba errno = ERANGE; c4ae: 82 e2 ldi r24, 0x22 ; 34 c4b0: 90 e0 ldi r25, 0x00 ; 0 c4b2: 90 93 0c 18 sts 0x180C, r25 ; 0x80180c c4b6: 80 93 0b 18 sts 0x180B, r24 ; 0x80180b } return x.flt; c4ba: c5 01 movw r24, r10 c4bc: b4 01 movw r22, r8 c4be: df 91 pop r29 c4c0: cf 91 pop r28 c4c2: 1f 91 pop r17 c4c4: 0f 91 pop r16 c4c6: ff 90 pop r15 c4c8: ef 90 pop r14 c4ca: df 90 pop r13 c4cc: cf 90 pop r12 c4ce: bf 90 pop r11 c4d0: af 90 pop r10 c4d2: 9f 90 pop r9 c4d4: 8f 90 pop r8 c4d6: 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; c4d8: 60 e0 ldi r22, 0x00 ; 0 c4da: 70 e0 ldi r23, 0x00 ; 0 c4dc: 80 ec ldi r24, 0xC0 ; 192 c4de: 9f e7 ldi r25, 0x7F ; 127 c4e0: ee cf rjmp .-36 ; 0xc4be 0000c4e2 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c4e2: 2f 92 push r2 c4e4: 3f 92 push r3 c4e6: 4f 92 push r4 c4e8: 5f 92 push r5 c4ea: 6f 92 push r6 c4ec: 7f 92 push r7 c4ee: 8f 92 push r8 c4f0: 9f 92 push r9 c4f2: af 92 push r10 c4f4: bf 92 push r11 c4f6: cf 92 push r12 c4f8: df 92 push r13 c4fa: ef 92 push r14 c4fc: ff 92 push r15 c4fe: 0f 93 push r16 c500: 1f 93 push r17 c502: cf 93 push r28 c504: df 93 push r29 c506: 00 d0 rcall .+0 ; 0xc508 c508: cd b7 in r28, 0x3d ; 61 c50a: de b7 in r29, 0x3e ; 62 c50c: 8d ed ldi r24, 0xDD ; 221 c50e: c8 2e mov r12, r24 c510: 82 e0 ldi r24, 0x02 ; 2 c512: d8 2e mov r13, r24 c514: 82 e5 ldi r24, 0x52 ; 82 c516: 95 e0 ldi r25, 0x05 ; 5 c518: 9b 83 std Y+3, r25 ; 0x03 c51a: 8a 83 std Y+2, r24 ; 0x02 c51c: 91 e4 ldi r25, 0x41 ; 65 c51e: e9 2e mov r14, r25 c520: 97 e0 ldi r25, 0x07 ; 7 c522: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c524: 33 24 eor r3, r3 c526: 33 94 inc r3 c528: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c52a: f6 01 movw r30, r12 c52c: 81 91 ld r24, Z+ c52e: 6f 01 movw r12, r30 c530: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 c534: 28 2e mov r2, r24 c536: 88 23 and r24, r24 c538: 09 f4 brne .+2 ; 0xc53c c53a: a6 c0 rjmp .+332 ; 0xc688 { bool relative = axis_relative_modes & mask; c53c: 10 91 df 03 lds r17, 0x03DF ; 0x8003df c540: 13 21 and r17, r3 destination[i] = code_value(); c542: 0e 94 4a 61 call 0xc294 ; 0xc294 c546: 2b 01 movw r4, r22 c548: 3c 01 movw r6, r24 c54a: ea 81 ldd r30, Y+2 ; 0x02 c54c: fb 81 ldd r31, Y+3 ; 0x03 c54e: 40 82 st Z, r4 c550: 51 82 std Z+1, r5 ; 0x01 c552: 62 82 std Z+2, r6 ; 0x02 c554: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c556: 03 30 cpi r16, 0x03 ; 3 c558: 09 f0 breq .+2 ; 0xc55c c55a: 46 c0 rjmp .+140 ; 0xc5e8 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; c55c: f1 e0 ldi r31, 0x01 ; 1 c55e: f9 83 std Y+1, r31 ; 0x01 c560: 11 11 cpse r17, r1 c562: 01 c0 rjmp .+2 ; 0xc566 c564: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c566: 80 90 bb 02 lds r8, 0x02BB ; 0x8002bb c56a: 90 90 bc 02 lds r9, 0x02BC ; 0x8002bc c56e: a0 90 bd 02 lds r10, 0x02BD ; 0x8002bd c572: b0 90 be 02 lds r11, 0x02BE ; 0x8002be if (emult != 1.) { c576: 20 e0 ldi r18, 0x00 ; 0 c578: 30 e0 ldi r19, 0x00 ; 0 c57a: 40 e8 ldi r20, 0x80 ; 128 c57c: 5f e3 ldi r21, 0x3F ; 63 c57e: c5 01 movw r24, r10 c580: b4 01 movw r22, r8 c582: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> c586: 88 23 and r24, r24 c588: 59 f1 breq .+86 ; 0xc5e0 if (! relative) { c58a: 11 11 cpse r17, r1 c58c: 15 c0 rjmp .+42 ; 0xc5b8 destination[i] -= current_position[i]; c58e: 20 91 4d 07 lds r18, 0x074D ; 0x80074d c592: 30 91 4e 07 lds r19, 0x074E ; 0x80074e c596: 40 91 4f 07 lds r20, 0x074F ; 0x80074f c59a: 50 91 50 07 lds r21, 0x0750 ; 0x800750 c59e: c3 01 movw r24, r6 c5a0: b2 01 movw r22, r4 c5a2: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> c5a6: 60 93 5e 05 sts 0x055E, r22 ; 0x80055e c5aa: 70 93 5f 05 sts 0x055F, r23 ; 0x80055f c5ae: 80 93 60 05 sts 0x0560, r24 ; 0x800560 c5b2: 90 93 61 05 sts 0x0561, r25 ; 0x800561 relative = true; c5b6: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c5b8: a5 01 movw r20, r10 c5ba: 94 01 movw r18, r8 c5bc: 60 91 5e 05 lds r22, 0x055E ; 0x80055e c5c0: 70 91 5f 05 lds r23, 0x055F ; 0x80055f c5c4: 80 91 60 05 lds r24, 0x0560 ; 0x800560 c5c8: 90 91 61 05 lds r25, 0x0561 ; 0x800561 c5cc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> c5d0: 60 93 5e 05 sts 0x055E, r22 ; 0x80055e c5d4: 70 93 5f 05 sts 0x055F, r23 ; 0x80055f c5d8: 80 93 60 05 sts 0x0560, r24 ; 0x800560 c5dc: 90 93 61 05 sts 0x0561, r25 ; 0x800561 } } if (relative) c5e0: e9 81 ldd r30, Y+1 ; 0x01 c5e2: e1 11 cpse r30, r1 c5e4: 03 c0 rjmp .+6 ; 0xc5ec c5e6: 22 c0 rjmp .+68 ; 0xc62c c5e8: 11 23 and r17, r17 c5ea: 99 f0 breq .+38 ; 0xc612 destination[i] += current_position[i]; c5ec: f7 01 movw r30, r14 c5ee: 20 81 ld r18, Z c5f0: 31 81 ldd r19, Z+1 ; 0x01 c5f2: 42 81 ldd r20, Z+2 ; 0x02 c5f4: 53 81 ldd r21, Z+3 ; 0x03 c5f6: ea 81 ldd r30, Y+2 ; 0x02 c5f8: fb 81 ldd r31, Y+3 ; 0x03 c5fa: 60 81 ld r22, Z c5fc: 71 81 ldd r23, Z+1 ; 0x01 c5fe: 82 81 ldd r24, Z+2 ; 0x02 c600: 93 81 ldd r25, Z+3 ; 0x03 c602: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> c606: ea 81 ldd r30, Y+2 ; 0x02 c608: fb 81 ldd r31, Y+3 ; 0x03 c60a: 60 83 st Z, r22 c60c: 71 83 std Z+1, r23 ; 0x01 c60e: 82 83 std Z+2, r24 ; 0x02 c610: 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) { c612: 0f 5f subi r16, 0xFF ; 255 c614: 33 0c add r3, r3 c616: 8a 81 ldd r24, Y+2 ; 0x02 c618: 9b 81 ldd r25, Y+3 ; 0x03 c61a: 04 96 adiw r24, 0x04 ; 4 c61c: 9b 83 std Y+3, r25 ; 0x03 c61e: 8a 83 std Y+2, r24 ; 0x02 c620: 94 e0 ldi r25, 0x04 ; 4 c622: e9 0e add r14, r25 c624: f1 1c adc r15, r1 c626: 04 30 cpi r16, 0x04 ; 4 c628: 09 f0 breq .+2 ; 0xc62c c62a: 7f cf rjmp .-258 ; 0xc52a 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')) { c62c: 86 e4 ldi r24, 0x46 ; 70 c62e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 c632: 88 23 and r24, r24 c634: 99 f0 breq .+38 ; 0xc65c const float next_feedrate = code_value(); c636: 0e 94 4a 61 call 0xc294 ; 0xc294 c63a: 6b 01 movw r12, r22 c63c: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c63e: 20 e0 ldi r18, 0x00 ; 0 c640: 30 e0 ldi r19, 0x00 ; 0 c642: a9 01 movw r20, r18 c644: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> c648: 18 16 cp r1, r24 c64a: 44 f4 brge .+16 ; 0xc65c c64c: c0 92 90 02 sts 0x0290, r12 ; 0x800290 c650: d0 92 91 02 sts 0x0291, r13 ; 0x800291 c654: e0 92 92 02 sts 0x0292, r14 ; 0x800292 c658: f0 92 93 02 sts 0x0293, r15 ; 0x800293 } } c65c: 0f 90 pop r0 c65e: 0f 90 pop r0 c660: 0f 90 pop r0 c662: df 91 pop r29 c664: cf 91 pop r28 c666: 1f 91 pop r17 c668: 0f 91 pop r16 c66a: ff 90 pop r15 c66c: ef 90 pop r14 c66e: df 90 pop r13 c670: cf 90 pop r12 c672: bf 90 pop r11 c674: af 90 pop r10 c676: 9f 90 pop r9 c678: 8f 90 pop r8 c67a: 7f 90 pop r7 c67c: 6f 90 pop r6 c67e: 5f 90 pop r5 c680: 4f 90 pop r4 c682: 3f 90 pop r3 c684: 2f 90 pop r2 c686: 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? c688: f7 01 movw r30, r14 c68a: 80 81 ld r24, Z c68c: 91 81 ldd r25, Z+1 ; 0x01 c68e: a2 81 ldd r26, Z+2 ; 0x02 c690: b3 81 ldd r27, Z+3 ; 0x03 c692: ea 81 ldd r30, Y+2 ; 0x02 c694: fb 81 ldd r31, Y+3 ; 0x03 c696: 80 83 st Z, r24 c698: 91 83 std Z+1, r25 ; 0x01 c69a: a2 83 std Z+2, r26 ; 0x02 c69c: b3 83 std Z+3, r27 ; 0x03 c69e: b9 cf rjmp .-142 ; 0xc612 0000c6a0 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c6a0: 2f 92 push r2 c6a2: 3f 92 push r3 c6a4: 4f 92 push r4 c6a6: 5f 92 push r5 c6a8: 6f 92 push r6 c6aa: 7f 92 push r7 c6ac: 8f 92 push r8 c6ae: 9f 92 push r9 c6b0: af 92 push r10 c6b2: bf 92 push r11 c6b4: cf 92 push r12 c6b6: df 92 push r13 c6b8: ef 92 push r14 c6ba: ff 92 push r15 c6bc: 0f 93 push r16 c6be: 1f 93 push r17 c6c0: cf 93 push r28 c6c2: df 93 push r29 c6c4: cd b7 in r28, 0x3d ; 61 c6c6: de b7 in r29, 0x3e ; 62 c6c8: 65 97 sbiw r28, 0x15 ; 21 c6ca: 0f b6 in r0, 0x3f ; 63 c6cc: f8 94 cli c6ce: de bf out 0x3e, r29 ; 62 c6d0: 0f be out 0x3f, r0 ; 63 c6d2: cd bf out 0x3d, r28 ; 61 c6d4: 69 8b std Y+17, r22 ; 0x11 c6d6: 7a 8b std Y+18, r23 ; 0x12 c6d8: 8b 8b std Y+19, r24 ; 0x13 c6da: 9c 8b std Y+20, r25 ; 0x14 c6dc: 49 01 movw r8, r18 c6de: 5a 01 movw r10, r20 c6e0: 30 2e mov r3, r16 c6e2: cd 8a std Y+21, r12 ; 0x15 c6e4: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c6e6: 81 e0 ldi r24, 0x01 ; 1 c6e8: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c6ec: df 92 push r13 c6ee: 2d 89 ldd r18, Y+21 ; 0x15 c6f0: 2f 93 push r18 c6f2: 1f 92 push r1 c6f4: ef 92 push r14 c6f6: 8b e2 ldi r24, 0x2B ; 43 c6f8: 96 e6 ldi r25, 0x66 ; 102 c6fa: 9f 93 push r25 c6fc: 8f 93 push r24 c6fe: 0f 94 4b dc call 0x3b896 ; 0x3b896 daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c702: 81 e4 ldi r24, 0x41 ; 65 c704: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 c708: 0f 90 pop r0 c70a: 0f 90 pop r0 c70c: 0f 90 pop r0 c70e: 0f 90 pop r0 c710: 0f 90 pop r0 c712: 0f 90 pop r0 c714: 88 23 and r24, r24 c716: a1 f0 breq .+40 ; 0xc740 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c718: 80 91 95 03 lds r24, 0x0395 ; 0x800395 c71c: 90 91 96 03 lds r25, 0x0396 ; 0x800396 c720: fc 01 movw r30, r24 c722: 21 81 ldd r18, Z+1 ; 0x01 c724: 28 37 cpi r18, 0x78 ; 120 c726: 09 f0 breq .+2 ; 0xc72a c728: 69 c0 rjmp .+210 ; 0xc7fc c72a: 40 e1 ldi r20, 0x10 ; 16 c72c: 50 e0 ldi r21, 0x00 ; 0 c72e: 70 e0 ldi r23, 0x00 ; 0 c730: 60 e0 ldi r22, 0x00 ; 0 c732: 02 96 adiw r24, 0x02 ; 2 c734: 0f 94 14 d9 call 0x3b228 ; 0x3b228 c738: 69 8b std Y+17, r22 ; 0x11 c73a: 7a 8b std Y+18, r23 ; 0x12 c73c: 8b 8b std Y+19, r24 ; 0x13 c73e: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c740: 83 e4 ldi r24, 0x43 ; 67 c742: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 c746: 88 23 and r24, r24 c748: 09 f4 brne .+2 ; 0xc74c c74a: 65 c0 rjmp .+202 ; 0xc816 count = code_value_long(); c74c: 0e 94 20 5c call 0xb840 ; 0xb840 c750: 2b 01 movw r4, r22 c752: 3c 01 movw r6, r24 c754: c9 88 ldd r12, Y+17 ; 0x11 c756: da 88 ldd r13, Y+18 ; 0x12 c758: eb 88 ldd r14, Y+19 ; 0x13 c75a: fc 88 ldd r15, Y+20 ; 0x14 c75c: 8c 14 cp r8, r12 c75e: 9d 04 cpc r9, r13 c760: ae 04 cpc r10, r14 c762: bf 04 cpc r11, r15 c764: 10 f4 brcc .+4 ; 0xc76a c766: 75 01 movw r14, r10 c768: 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) c76a: d3 01 movw r26, r6 c76c: c2 01 movw r24, r4 c76e: 8c 0d add r24, r12 c770: 9d 1d adc r25, r13 c772: ae 1d adc r26, r14 c774: bf 1d adc r27, r15 c776: 88 16 cp r8, r24 c778: 99 06 cpc r9, r25 c77a: aa 06 cpc r10, r26 c77c: bb 06 cpc r11, r27 c77e: 28 f0 brcs .+10 ; 0xc78a c780: 8c 15 cp r24, r12 c782: 9d 05 cpc r25, r13 c784: ae 05 cpc r26, r14 c786: bf 05 cpc r27, r15 c788: 30 f4 brcc .+12 ; 0xc796 count = addr_end - addr_start; c78a: 24 01 movw r4, r8 c78c: 35 01 movw r6, r10 c78e: 4c 18 sub r4, r12 c790: 5d 08 sbc r5, r13 c792: 6e 08 sbc r6, r14 c794: 7f 08 sbc r7, r15 if (code_seen('X')) c796: 88 e5 ldi r24, 0x58 ; 88 c798: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 c79c: 88 23 and r24, r24 c79e: 09 f4 brne .+2 ; 0xc7a2 c7a0: 91 c0 rjmp .+290 ; 0xc8c4 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c7a2: 20 91 95 03 lds r18, 0x0395 ; 0x800395 c7a6: 30 91 96 03 lds r19, 0x0396 ; 0x800396 c7aa: 2f 5f subi r18, 0xFF ; 255 c7ac: 3f 4f sbci r19, 0xFF ; 255 c7ae: fe 01 movw r30, r28 c7b0: 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; c7b2: 10 e0 ldi r17, 0x00 ; 0 c7b4: 00 e0 ldi r16, 0x00 ; 0 c7b6: 4f 01 movw r8, r30 c7b8: d9 01 movw r26, r18 while (*hex) c7ba: 8c 91 ld r24, X c7bc: 2f 5f subi r18, 0xFF ; 255 c7be: 3f 4f sbci r19, 0xFF ; 255 c7c0: 88 23 and r24, r24 c7c2: 09 f4 brne .+2 ; 0xc7c6 c7c4: 3f c0 rjmp .+126 ; 0xc844 { if (count && (parsed >= count)) break; c7c6: 00 31 cpi r16, 0x10 ; 16 c7c8: 11 05 cpc r17, r1 c7ca: e1 f1 breq .+120 ; 0xc844 char c = *(hex++); if (c == ' ') continue; c7cc: 80 32 cpi r24, 0x20 ; 32 c7ce: a1 f3 breq .-24 ; 0xc7b8 if (c == '\n') break; c7d0: 8a 30 cpi r24, 0x0A ; 10 c7d2: c1 f1 breq .+112 ; 0xc844 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c7d4: 90 ed ldi r25, 0xD0 ; 208 c7d6: 98 0f add r25, r24 c7d8: 9a 30 cpi r25, 0x0A ; 10 c7da: 10 f5 brcc .+68 ; 0xc820 c7dc: 82 95 swap r24 c7de: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c7e0: 9d 01 movw r18, r26 c7e2: 2e 5f subi r18, 0xFE ; 254 c7e4: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c7e6: 11 96 adiw r26, 0x01 ; 1 c7e8: 9c 91 ld r25, X c7ea: 40 ed ldi r20, 0xD0 ; 208 c7ec: 49 0f add r20, r25 c7ee: 4a 30 cpi r20, 0x0A ; 10 c7f0: f8 f4 brcc .+62 ; 0xc830 c7f2: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c7f4: 81 93 st Z+, r24 parsed++; c7f6: 0f 5f subi r16, 0xFF ; 255 c7f8: 1f 4f sbci r17, 0xFF ; 255 c7fa: de cf rjmp .-68 ; 0xc7b8 { 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(); c7fc: 0e 94 4a 61 call 0xc294 ; 0xc294 c800: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> c804: 9b 01 movw r18, r22 c806: 77 0f add r23, r23 c808: 44 0b sbc r20, r20 c80a: 55 0b sbc r21, r21 c80c: 29 8b std Y+17, r18 ; 0x11 c80e: 3a 8b std Y+18, r19 ; 0x12 c810: 4b 8b std Y+19, r20 ; 0x13 c812: 5c 8b std Y+20, r21 ; 0x14 c814: 95 cf rjmp .-214 ; 0xc740 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 c816: 44 24 eor r4, r4 c818: 4a 94 dec r4 c81a: 54 2c mov r5, r4 c81c: 32 01 movw r6, r4 c81e: 9a cf rjmp .-204 ; 0xc754 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); c820: 9f e9 ldi r25, 0x9F ; 159 c822: 98 0f add r25, r24 c824: 96 30 cpi r25, 0x06 ; 6 c826: 58 f4 brcc .+22 ; 0xc83e c828: 82 95 swap r24 c82a: 80 7f andi r24, 0xF0 ; 240 c82c: 80 57 subi r24, 0x70 ; 112 c82e: d8 cf rjmp .-80 ; 0xc7e0 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c830: 4f e9 ldi r20, 0x9F ; 159 c832: 49 0f add r20, r25 c834: 46 30 cpi r20, 0x06 ; 6 c836: 18 f4 brcc .+6 ; 0xc83e c838: 97 55 subi r25, 0x57 ; 87 c83a: 89 2b or r24, r25 c83c: db cf rjmp .-74 ; 0xc7f4 else return -parsed; c83e: 11 95 neg r17 c840: 01 95 neg r16 c842: 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); c844: 28 01 movw r4, r16 c846: 01 2e mov r0, r17 c848: 00 0c add r0, r0 c84a: 66 08 sbc r6, r6 c84c: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c84e: da 8a std Y+18, r13 ; 0x12 c850: 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++) c852: b1 2c mov r11, r1 c854: a1 2c mov r10, r1 c856: 0a 15 cp r16, r10 c858: 1b 05 cpc r17, r11 c85a: f1 f0 breq .+60 ; 0xc898 { switch (type) c85c: 33 20 and r3, r3 c85e: 39 f0 breq .+14 ; 0xc86e c860: 31 e0 ldi r19, 0x01 ; 1 c862: 33 16 cp r3, r19 c864: 71 f0 breq .+28 ; 0xc882 } // 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++) c866: 4f ef ldi r20, 0xFF ; 255 c868: a4 1a sub r10, r20 c86a: b4 0a sbc r11, r20 c86c: f4 cf rjmp .-24 ; 0xc856 { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c86e: f4 01 movw r30, r8 c870: ea 0d add r30, r10 c872: fb 1d adc r31, r11 c874: 80 81 ld r24, Z c876: e9 89 ldd r30, Y+17 ; 0x11 c878: fa 89 ldd r31, Y+18 ; 0x12 c87a: ea 0d add r30, r10 c87c: fb 1d adc r31, r11 c87e: 80 83 st Z, r24 c880: f2 cf rjmp .-28 ; 0xc866 case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c882: f4 01 movw r30, r8 c884: ea 0d add r30, r10 c886: 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); c888: 60 81 ld r22, Z c88a: 89 89 ldd r24, Y+17 ; 0x11 c88c: 9a 89 ldd r25, Y+18 ; 0x12 c88e: 8a 0d add r24, r10 c890: 9b 1d adc r25, r11 c892: 0f 94 d1 dd call 0x3bba2 ; 0x3bba2 c896: e7 cf rjmp .-50 ; 0xc866 { 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); c898: ff 92 push r15 c89a: ef 92 push r14 c89c: df 92 push r13 c89e: cf 92 push r12 c8a0: 2f 92 push r2 c8a2: 5d 89 ldd r21, Y+21 ; 0x15 c8a4: 5f 93 push r21 c8a6: 7f 92 push r7 c8a8: 6f 92 push r6 c8aa: 5f 92 push r5 c8ac: 4f 92 push r4 c8ae: 8f ef ldi r24, 0xFF ; 255 c8b0: 95 e6 ldi r25, 0x65 ; 101 c8b2: 9f 93 push r25 c8b4: 8f 93 push r24 c8b6: 0f 94 4b dc call 0x3b896 ; 0x3b896 c8ba: 0f b6 in r0, 0x3f ; 63 c8bc: f8 94 cli c8be: de bf out 0x3e, r29 ; 62 c8c0: 0f be out 0x3f, r0 ; 63 c8c2: 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); c8c4: 03 2d mov r16, r3 c8c6: a3 01 movw r20, r6 c8c8: 92 01 movw r18, r4 c8ca: c7 01 movw r24, r14 c8cc: b6 01 movw r22, r12 c8ce: 0f 94 d7 86 call 0x30dae ; 0x30dae } c8d2: 65 96 adiw r28, 0x15 ; 21 c8d4: 0f b6 in r0, 0x3f ; 63 c8d6: f8 94 cli c8d8: de bf out 0x3e, r29 ; 62 c8da: 0f be out 0x3f, r0 ; 63 c8dc: cd bf out 0x3d, r28 ; 61 c8de: df 91 pop r29 c8e0: cf 91 pop r28 c8e2: 1f 91 pop r17 c8e4: 0f 91 pop r16 c8e6: ff 90 pop r15 c8e8: ef 90 pop r14 c8ea: df 90 pop r13 c8ec: cf 90 pop r12 c8ee: bf 90 pop r11 c8f0: af 90 pop r10 c8f2: 9f 90 pop r9 c8f4: 8f 90 pop r8 c8f6: 7f 90 pop r7 c8f8: 6f 90 pop r6 c8fa: 5f 90 pop r5 c8fc: 4f 90 pop r4 c8fe: 3f 90 pop r3 c900: 2f 90 pop r2 c902: 08 95 ret 0000c904 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); c904: 60 91 13 18 lds r22, 0x1813 ; 0x801813 <__iob+0x2> c908: 70 91 14 18 lds r23, 0x1814 ; 0x801814 <__iob+0x3> c90c: 90 e0 ldi r25, 0x00 ; 0 c90e: 8a 30 cpi r24, 0x0A ; 10 c910: 20 f0 brcs .+8 ; 0xc91a c912: 89 5a subi r24, 0xA9 ; 169 c914: 9f 4f sbci r25, 0xFF ; 255 c916: 0d 94 f1 db jmp 0x3b7e2 ; 0x3b7e2 c91a: c0 96 adiw r24, 0x30 ; 48 c91c: fc cf rjmp .-8 ; 0xc916 0000c91e : 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); c91e: 84 ff sbrs r24, 4 c920: 18 c0 rjmp .+48 ; 0xc952 c922: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); c924: 85 ff sbrs r24, 5 c926: 17 c0 rjmp .+46 ; 0xc956 c928: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); c92a: 2f b7 in r18, 0x3f ; 63 c92c: 86 ff sbrs r24, 6 c92e: 15 c0 rjmp .+42 ; 0xc95a c930: f8 94 cli c932: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c936: 90 68 ori r25, 0x80 ; 128 c938: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c93c: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); c93e: 87 ff sbrs r24, 7 c940: 11 c0 rjmp .+34 ; 0xc964 c942: 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); c944: 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); c946: 85 e0 ldi r24, 0x05 ; 5 c948: 8a 95 dec r24 c94a: f1 f7 brne .-4 ; 0xc948 c94c: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); c94e: 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(); } c950: 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); c952: 8d 98 cbi 0x11, 5 ; 17 c954: e7 cf rjmp .-50 ; 0xc924 WRITE(LCD_PINS_D5, value & 0x20); c956: a4 98 cbi 0x14, 4 ; 20 c958: e8 cf rjmp .-48 ; 0xc92a WRITE(LCD_PINS_D6, value & 0x40); c95a: f8 94 cli c95c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c960: 9f 77 andi r25, 0x7F ; 127 c962: ea cf rjmp .-44 ; 0xc938 WRITE(LCD_PINS_D7, value & 0x80); c964: a3 98 cbi 0x14, 3 ; 20 c966: ee cf rjmp .-36 ; 0xc944 0000c968 : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { c968: 0f 93 push r16 c96a: 1f 93 push r17 c96c: cf 93 push r28 c96e: df 93 push r29 c970: c8 2f mov r28, r24 c972: d6 2f mov r29, r22 c974: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); c976: 60 ff sbrs r22, 0 c978: 15 c0 rjmp .+42 ; 0xc9a4 c97a: 5d 9a sbi 0x0b, 5 ; 11 c97c: 8a e1 ldi r24, 0x1A ; 26 c97e: 8a 95 dec r24 c980: f1 f7 brne .-4 ; 0xc97e c982: 00 c0 rjmp .+0 ; 0xc984 _delay_us(5); lcd_writebits(data); c984: 8c 2f mov r24, r28 c986: 0e 94 8f 64 call 0xc91e ; 0xc91e #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { c98a: d1 fd sbrc r29, 1 c98c: 04 c0 rjmp .+8 ; 0xc996 // _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 c98e: 8c 2f mov r24, r28 c990: 82 95 swap r24 c992: 0e 94 8f 64 call 0xc91e ; 0xc91e } #endif delayMicroseconds(duration); c996: c8 01 movw r24, r16 } c998: df 91 pop r29 c99a: cf 91 pop r28 c99c: 1f 91 pop r17 c99e: 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); c9a0: 0c 94 fa de jmp 0x1bdf4 ; 0x1bdf4 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); c9a4: 5d 98 cbi 0x0b, 5 ; 11 c9a6: ea cf rjmp .-44 ; 0xc97c 0000c9a8 : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { c9a8: cf 92 push r12 c9aa: df 92 push r13 c9ac: ef 92 push r14 c9ae: ff 92 push r15 c9b0: cf 93 push r28 c9b2: df 93 push r29 c9b4: ec 01 movw r28, r24 c9b6: 6a 01 movw r12, r20 c9b8: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) c9ba: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 c9be: 6f 3f cpi r22, 0xFF ; 255 c9c0: 7f 4f sbci r23, 0xFF ; 255 c9c2: 8f 4f sbci r24, 0xFF ; 255 c9c4: 9f 4f sbci r25, 0xFF ; 255 c9c6: 59 f4 brne .+22 ; 0xc9de 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); c9c8: b7 01 movw r22, r14 c9ca: a6 01 movw r20, r12 c9cc: 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); } c9ce: df 91 pop r29 c9d0: cf 91 pop r28 c9d2: ff 90 pop r15 c9d4: ef 90 pop r14 c9d6: df 90 pop r13 c9d8: 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); c9da: 0d 94 df dd jmp 0x3bbbe ; 0x3bbbe } 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); } c9de: df 91 pop r29 c9e0: cf 91 pop r28 c9e2: ff 90 pop r15 c9e4: ef 90 pop r14 c9e6: df 90 pop r13 c9e8: cf 90 pop r12 c9ea: 08 95 ret 0000c9ec : /// 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)); c9ec: 80 e1 ldi r24, 0x10 ; 16 c9ee: e1 e4 ldi r30, 0x41 ; 65 c9f0: f7 e0 ldi r31, 0x07 ; 7 c9f2: ab e9 ldi r26, 0x9B ; 155 c9f4: b2 e0 ldi r27, 0x02 ; 2 c9f6: 01 90 ld r0, Z+ c9f8: 0d 92 st X+, r0 c9fa: 8a 95 dec r24 c9fc: e1 f7 brne .-8 ; 0xc9f6 saved_feedmultiply2 = feedmultiply; //save feedmultiply c9fe: 80 91 39 02 lds r24, 0x0239 ; 0x800239 ca02: 90 91 3a 02 lds r25, 0x023A ; 0x80023a ca06: 90 93 72 03 sts 0x0372, r25 ; 0x800372 ca0a: 80 93 71 03 sts 0x0371, r24 ; 0x800371 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); ca0e: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b ca12: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c ca16: 90 93 ac 05 sts 0x05AC, r25 ; 0x8005ac ca1a: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab saved_bed_temperature = (uint8_t)degTargetBed(); ca1e: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 ca22: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; ca26: 80 91 df 03 lds r24, 0x03DF ; 0x8003df ca2a: 83 fb bst r24, 3 ca2c: 88 27 eor r24, r24 ca2e: 80 f9 bld r24, 0 ca30: 80 93 04 18 sts 0x1804, r24 ; 0x801804 saved_fan_speed = fanSpeed; ca34: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 ca38: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa isPartialBackupAvailable = true; ca3c: 81 e0 ldi r24, 0x01 ; 1 ca3e: 80 93 51 07 sts 0x0751, r24 ; 0x800751 } ca42: 08 95 ret 0000ca44 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } ca44: cf 93 push r28 ca46: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { ca48: 8c ef ldi r24, 0xFC ; 252 ca4a: 96 e1 ldi r25, 0x16 ; 22 ca4c: 0e 94 b4 78 call 0xf168 ; 0xf168 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader ca50: 8a e3 ldi r24, 0x3A ; 58 ca52: 95 e1 ldi r25, 0x15 ; 21 ca54: 89 2b or r24, r25 ca56: 51 f0 breq .+20 ; 0xca6c <_GLOBAL__sub_D_card+0x28> ca58: cc e0 ldi r28, 0x0C ; 12 ca5a: d6 e1 ldi r29, 0x16 ; 22 ca5c: a3 97 sbiw r28, 0x23 ; 35 ca5e: ce 01 movw r24, r28 ca60: 0e 94 b4 78 call 0xf168 ; 0xf168 ca64: 85 e1 ldi r24, 0x15 ; 21 ca66: ca 33 cpi r28, 0x3A ; 58 ca68: d8 07 cpc r29, r24 ca6a: c1 f7 brne .-16 ; 0xca5c <_GLOBAL__sub_D_card+0x18> ca6c: 87 e1 ldi r24, 0x17 ; 23 ca6e: 95 e1 ldi r25, 0x15 ; 21 ca70: 0e 94 b4 78 call 0xf168 ; 0xf168 ca74: 82 ef ldi r24, 0xF2 ; 242 ca76: 94 e1 ldi r25, 0x14 ; 20 ca78: df 91 pop r29 ca7a: cf 91 pop r28 ca7c: 0c 94 b4 78 jmp 0xf168 ; 0xf168 0000ca80 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { ca80: cf 93 push r28 ca82: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; ca84: c1 e4 ldi r28, 0x41 ; 65 ca86: d7 e0 ldi r29, 0x07 ; 7 ca88: 20 e0 ldi r18, 0x00 ; 0 ca8a: 30 e0 ldi r19, 0x00 ; 0 ca8c: 48 ec ldi r20, 0xC8 ; 200 ca8e: 51 e4 ldi r21, 0x41 ; 65 ca90: 6c 85 ldd r22, Y+12 ; 0x0c ca92: 7d 85 ldd r23, Y+13 ; 0x0d ca94: 8e 85 ldd r24, Y+14 ; 0x0e ca96: 9f 85 ldd r25, Y+15 ; 0x0f ca98: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> ca9c: 6c 87 std Y+12, r22 ; 0x0c ca9e: 7d 87 std Y+13, r23 ; 0x0d caa0: 8e 87 std Y+14, r24 ; 0x0e caa2: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); caa4: 63 e3 ldi r22, 0x33 ; 51 caa6: 73 e3 ldi r23, 0x33 ; 51 caa8: 83 e5 ldi r24, 0x53 ; 83 caaa: 90 e4 ldi r25, 0x40 ; 64 } caac: df 91 pop r29 caae: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cab0: 0d 94 8b ba jmp 0x37516 ; 0x37516 0000cab4 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); cab4: 60 e0 ldi r22, 0x00 ; 0 cab6: 85 ea ldi r24, 0xA5 ; 165 cab8: 9f e0 ldi r25, 0x0F ; 15 caba: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a cabe: 60 e0 ldi r22, 0x00 ; 0 cac0: 8f e7 ldi r24, 0x7F ; 127 cac2: 9c e0 ldi r25, 0x0C ; 12 cac4: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a // 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; cac8: 80 e0 ldi r24, 0x00 ; 0 caca: 90 e0 ldi r25, 0x00 ; 0 cacc: a0 e8 ldi r26, 0x80 ; 128 cace: bf eb ldi r27, 0xBF ; 191 cad0: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab cad4: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac cad8: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad cadc: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_printing_type = PowerPanic::PRINT_TYPE_NONE; cae0: 82 e0 ldi r24, 0x02 ; 2 cae2: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; cae6: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 } caea: 08 95 ret 0000caec : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) caec: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab caf0: 90 91 ac 05 lds r25, 0x05AC ; 0x8005ac caf4: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b caf8: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c cafc: 28 17 cp r18, r24 cafe: 39 07 cpc r19, r25 cb00: 71 f0 breq .+28 ; 0xcb1e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; cb02: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c cb06: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; cb0a: 81 e0 ldi r24, 0x01 ; 1 cb0c: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd wait_for_heater(_millis(), active_extruder); cb10: 0f 94 83 3f call 0x27f06 ; 0x27f06 cb14: 0f 94 8f 82 call 0x3051e ; 0x3051e heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; cb18: 82 e0 ldi r24, 0x02 ; 2 cb1a: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd } } cb1e: 08 95 ret 0000cb20 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { cb20: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 cb24: 88 23 and r24, r24 cb26: 41 f0 breq .+16 ; 0xcb38 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; cb28: 80 91 39 02 lds r24, 0x0239 ; 0x800239 cb2c: 90 91 3a 02 lds r25, 0x023A ; 0x80023a cb30: 90 93 72 03 sts 0x0372, r25 ; 0x800372 cb34: 80 93 71 03 sts 0x0371, r24 ; 0x800371 } cb38: 08 95 ret 0000cb3a : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) cb3a: 80 91 a0 05 lds r24, 0x05A0 ; 0x8005a0 cb3e: 90 91 a1 05 lds r25, 0x05A1 ; 0x8005a1 cb42: 00 97 sbiw r24, 0x00 ; 0 cb44: 29 f1 breq .+74 ; 0xcb90 cb46: 20 91 57 0e lds r18, 0x0E57 ; 0x800e57 cb4a: 21 11 cpse r18, r1 cb4c: 21 c0 rjmp .+66 ; 0xcb90 cb4e: 20 91 56 0e lds r18, 0x0E56 ; 0x800e56 cb52: 21 11 cpse r18, r1 cb54: 1d c0 rjmp .+58 ; 0xcb90 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); cb56: fc 01 movw r30, r24 cb58: e8 5a subi r30, 0xA8 ; 168 cb5a: ff 4f sbci r31, 0xFF ; 255 cb5c: 20 e1 ldi r18, 0x10 ; 16 cb5e: ab ea ldi r26, 0xAB ; 171 cb60: b2 e0 ldi r27, 0x02 ; 2 cb62: 01 90 ld r0, Z+ cb64: 0d 92 st X+, r0 cb66: 2a 95 dec r18 cb68: e1 f7 brne .-8 ; 0xcb62 saved_feedrate2 = current_block->gcode_feedrate; cb6a: fc 01 movw r30, r24 cb6c: e6 59 subi r30, 0x96 ; 150 cb6e: ff 4f sbci r31, 0xFF ; 255 cb70: 20 81 ld r18, Z cb72: 31 81 ldd r19, Z+1 ; 0x01 cb74: 30 93 ff 17 sts 0x17FF, r19 ; 0x8017ff cb78: 20 93 fe 17 sts 0x17FE, r18 ; 0x8017fe saved_segment_idx = current_block->segment_idx; cb7c: 88 59 subi r24, 0x98 ; 152 cb7e: 9f 4f sbci r25, 0xFF ; 255 cb80: fc 01 movw r30, r24 cb82: 80 81 ld r24, Z cb84: 91 81 ldd r25, Z+1 ; 0x01 cb86: 90 93 0a 18 sts 0x180A, r25 ; 0x80180a cb8a: 80 93 09 18 sts 0x1809, r24 ; 0x801809 cb8e: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; cb90: 80 e0 ldi r24, 0x00 ; 0 cb92: 90 e0 ldi r25, 0x00 ; 0 cb94: a0 e8 ldi r26, 0x80 ; 128 cb96: bf eb ldi r27, 0xBF ; 191 cb98: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab cb9c: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac cba0: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad cba4: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_feedrate2 = feedrate; cba8: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cbac: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cbb0: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cbb4: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cbb8: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> cbbc: 70 93 ff 17 sts 0x17FF, r23 ; 0x8017ff cbc0: 60 93 fe 17 sts 0x17FE, r22 ; 0x8017fe saved_segment_idx = 0; cbc4: 10 92 0a 18 sts 0x180A, r1 ; 0x80180a cbc8: 10 92 09 18 sts 0x1809, r1 ; 0x801809 } } cbcc: 08 95 ret 0000cbce : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { cbce: cf 92 push r12 cbd0: df 92 push r13 cbd2: ef 92 push r14 cbd4: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { cbd6: 80 91 6c 14 lds r24, 0x146C ; 0x80146c cbda: 88 23 and r24, r24 cbdc: d9 f1 breq .+118 ; 0xcc54 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue cbde: 80 91 82 03 lds r24, 0x0382 ; 0x800382 cbe2: 90 91 83 03 lds r25, 0x0383 ; 0x800383 cbe6: a0 91 84 03 lds r26, 0x0384 ; 0x800384 cbea: b0 91 85 03 lds r27, 0x0385 ; 0x800385 cbee: 80 93 00 18 sts 0x1800, r24 ; 0x801800 cbf2: 90 93 01 18 sts 0x1801, r25 ; 0x801801 cbf6: a0 93 02 18 sts 0x1802, r26 ; 0x801802 cbfa: b0 93 03 18 sts 0x1803, r27 ; 0x801803 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner cbfe: 0f 94 4d aa call 0x3549a ; 0x3549a saved_sdpos -= sdlen_planner; cc02: c0 90 00 18 lds r12, 0x1800 ; 0x801800 cc06: d0 90 01 18 lds r13, 0x1801 ; 0x801801 cc0a: e0 90 02 18 lds r14, 0x1802 ; 0x801802 cc0e: f0 90 03 18 lds r15, 0x1803 ; 0x801803 cc12: c8 1a sub r12, r24 cc14: d9 0a sbc r13, r25 cc16: e1 08 sbc r14, r1 cc18: f1 08 sbc r15, r1 cc1a: c0 92 00 18 sts 0x1800, r12 ; 0x801800 cc1e: d0 92 01 18 sts 0x1801, r13 ; 0x801801 cc22: e0 92 02 18 sts 0x1802, r14 ; 0x801802 cc26: f0 92 03 18 sts 0x1803, r15 ; 0x801803 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue cc2a: 0e 94 b1 5b call 0xb762 ; 0xb762 saved_sdpos -= sdlen_cmdqueue; cc2e: c8 1a sub r12, r24 cc30: d9 0a sbc r13, r25 cc32: e1 08 sbc r14, r1 cc34: f1 08 sbc r15, r1 cc36: c0 92 00 18 sts 0x1800, r12 ; 0x801800 cc3a: d0 92 01 18 sts 0x1801, r13 ; 0x801801 cc3e: e0 92 02 18 sts 0x1802, r14 ; 0x801802 cc42: f0 92 03 18 sts 0x1803, r15 ; 0x801803 saved_printing_type = PowerPanic::PRINT_TYPE_SD; cc46: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } cc4a: ff 90 pop r15 cc4c: ef 90 pop r14 cc4e: df 90 pop r13 cc50: cf 90 pop r12 cc52: 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 cc54: 80 91 0f 05 lds r24, 0x050F ; 0x80050f cc58: 88 23 and r24, r24 cc5a: b1 f1 breq .+108 ; 0xccc8 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue cc5c: 80 91 7a 03 lds r24, 0x037A ; 0x80037a cc60: 90 91 7b 03 lds r25, 0x037B ; 0x80037b cc64: a0 91 7c 03 lds r26, 0x037C ; 0x80037c cc68: b0 91 7d 03 lds r27, 0x037D ; 0x80037d cc6c: 80 93 00 18 sts 0x1800, r24 ; 0x801800 cc70: 90 93 01 18 sts 0x1801, r25 ; 0x801801 cc74: a0 93 02 18 sts 0x1802, r26 ; 0x801802 cc78: b0 93 03 18 sts 0x1803, r27 ; 0x801803 //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 cc7c: 0f 94 4d aa call 0x3549a ; 0x3549a saved_sdpos -= nlines; cc80: 40 91 00 18 lds r20, 0x1800 ; 0x801800 cc84: 50 91 01 18 lds r21, 0x1801 ; 0x801801 cc88: 60 91 02 18 lds r22, 0x1802 ; 0x801802 cc8c: 70 91 03 18 lds r23, 0x1803 ; 0x801803 cc90: 48 1b sub r20, r24 cc92: 51 09 sbc r21, r1 cc94: 61 09 sbc r22, r1 cc96: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer cc98: 80 91 7f 10 lds r24, 0x107F ; 0x80107f cc9c: 90 91 80 10 lds r25, 0x1080 ; 0x801080 cca0: 09 2e mov r0, r25 cca2: 00 0c add r0, r0 cca4: aa 0b sbc r26, r26 cca6: bb 0b sbc r27, r27 cca8: 48 1b sub r20, r24 ccaa: 59 0b sbc r21, r25 ccac: 6a 0b sbc r22, r26 ccae: 7b 0b sbc r23, r27 ccb0: 40 93 00 18 sts 0x1800, r20 ; 0x801800 ccb4: 50 93 01 18 sts 0x1801, r21 ; 0x801801 ccb8: 60 93 02 18 sts 0x1802, r22 ; 0x801802 ccbc: 70 93 03 18 sts 0x1803, r23 ; 0x801803 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; ccc0: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; ccc2: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a ccc6: c1 cf rjmp .-126 ; 0xcc4a ccc8: 82 e0 ldi r24, 0x02 ; 2 ccca: fb cf rjmp .-10 ; 0xccc2 0000cccc : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { cccc: cf 92 push r12 ccce: df 92 push r13 ccd0: ef 92 push r14 ccd2: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); ccd4: c0 90 04 07 lds r12, 0x0704 ; 0x800704 ccd8: d0 90 05 07 lds r13, 0x0705 ; 0x800705 ccdc: e0 90 06 07 lds r14, 0x0706 ; 0x800706 cce0: f0 90 07 07 lds r15, 0x0707 ; 0x800707 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { cce4: 80 91 03 07 lds r24, 0x0703 ; 0x800703 cce8: 88 23 and r24, r24 ccea: 09 f4 brne .+2 ; 0xccee ccec: 4e c0 rjmp .+156 ; 0xcd8a ccee: 20 e0 ldi r18, 0x00 ; 0 ccf0: 30 e0 ldi r19, 0x00 ; 0 ccf2: a9 01 movw r20, r18 ccf4: c7 01 movw r24, r14 ccf6: b6 01 movw r22, r12 ccf8: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> ccfc: 18 16 cp r1, r24 ccfe: 0c f0 brlt .+2 ; 0xcd02 cd00: 44 c0 rjmp .+136 ; 0xcd8a float area = M_PI * diameter * diameter * 0.25; cd02: 2b ed ldi r18, 0xDB ; 219 cd04: 3f e0 ldi r19, 0x0F ; 15 cd06: 49 e4 ldi r20, 0x49 ; 73 cd08: 50 e4 ldi r21, 0x40 ; 64 cd0a: c7 01 movw r24, r14 cd0c: b6 01 movw r22, r12 cd0e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> cd12: a7 01 movw r20, r14 cd14: 96 01 movw r18, r12 cd16: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> cd1a: 20 e0 ldi r18, 0x00 ; 0 cd1c: 30 e0 ldi r19, 0x00 ; 0 cd1e: 40 e8 ldi r20, 0x80 ; 128 cd20: 5e e3 ldi r21, 0x3E ; 62 cd22: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> cd26: 9b 01 movw r18, r22 cd28: ac 01 movw r20, r24 out = 1.f / area; cd2a: 60 e0 ldi r22, 0x00 ; 0 cd2c: 70 e0 ldi r23, 0x00 ; 0 cd2e: 80 e8 ldi r24, 0x80 ; 128 cd30: 9f e3 ldi r25, 0x3F ; 63 cd32: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> cd36: 6b 01 movw r12, r22 cd38: 7c 01 movw r14, r24 } if (extrudemultiply != 100) cd3a: 60 91 94 02 lds r22, 0x0294 ; 0x800294 cd3e: 70 91 95 02 lds r23, 0x0295 ; 0x800295 cd42: 64 36 cpi r22, 0x64 ; 100 cd44: 71 05 cpc r23, r1 cd46: a1 f0 breq .+40 ; 0xcd70 out *= float(extrudemultiply) * 0.01f; cd48: 07 2e mov r0, r23 cd4a: 00 0c add r0, r0 cd4c: 88 0b sbc r24, r24 cd4e: 99 0b sbc r25, r25 cd50: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> cd54: 2a e0 ldi r18, 0x0A ; 10 cd56: 37 ed ldi r19, 0xD7 ; 215 cd58: 43 e2 ldi r20, 0x23 ; 35 cd5a: 5c e3 ldi r21, 0x3C ; 60 cd5c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> cd60: 9b 01 movw r18, r22 cd62: ac 01 movw r20, r24 cd64: c7 01 movw r24, r14 cd66: b6 01 movw r22, r12 cd68: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> cd6c: 6b 01 movw r12, r22 cd6e: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cd70: c0 92 bb 02 sts 0x02BB, r12 ; 0x8002bb cd74: d0 92 bc 02 sts 0x02BC, r13 ; 0x8002bc cd78: e0 92 bd 02 sts 0x02BD, r14 ; 0x8002bd cd7c: 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 } cd80: ff 90 pop r15 cd82: ef 90 pop r14 cd84: df 90 pop r13 cd86: cf 90 pop r12 cd88: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; cd8a: c1 2c mov r12, r1 cd8c: d1 2c mov r13, r1 cd8e: 80 e8 ldi r24, 0x80 ; 128 cd90: e8 2e mov r14, r24 cd92: 8f e3 ldi r24, 0x3F ; 63 cd94: f8 2e mov r15, r24 cd96: d1 cf rjmp .-94 ; 0xcd3a 0000cd98 : } } #endif //FAST_PWM_FAN void save_statistics() { cd98: 8f 92 push r8 cd9a: 9f 92 push r9 cd9c: af 92 push r10 cd9e: bf 92 push r11 cda0: cf 92 push r12 cda2: df 92 push r13 cda4: ef 92 push r14 cda6: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: centimeter cda8: 81 ef ldi r24, 0xF1 ; 241 cdaa: 9f e0 ldi r25, 0x0F ; 15 cdac: 0f 94 79 7c call 0x2f8f2 ; 0x2f8f2 cdb0: 6b 01 movw r12, r22 cdb2: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cdb4: 8d ee ldi r24, 0xED ; 237 cdb6: 9f e0 ldi r25, 0x0F ; 15 cdb8: 0f 94 79 7c call 0x2f8f2 ; 0x2f8f2 cdbc: 4b 01 movw r8, r22 cdbe: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; cdc0: 0f 94 df 54 call 0x2a9be ; 0x2a9be cdc4: 2c e3 ldi r18, 0x3C ; 60 cdc6: 30 e0 ldi r19, 0x00 ; 0 cdc8: 40 e0 ldi r20, 0x00 ; 0 cdca: 50 e0 ldi r21, 0x00 ; 0 cdcc: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min cdd0: ba 01 movw r22, r20 cdd2: a9 01 movw r20, r18 cdd4: 48 0d add r20, r8 cdd6: 59 1d adc r21, r9 cdd8: 6a 1d adc r22, r10 cdda: 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); cddc: 8d ee ldi r24, 0xED ; 237 cdde: 9f e0 ldi r25, 0x0F ; 15 cde0: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); cde4: 60 91 60 06 lds r22, 0x0660 ; 0x800660 cde8: 70 91 61 06 lds r23, 0x0661 ; 0x800661 cdec: 80 91 62 06 lds r24, 0x0662 ; 0x800662 cdf0: 90 91 63 06 lds r25, 0x0663 ; 0x800663 cdf4: 28 ee ldi r18, 0xE8 ; 232 cdf6: 33 e0 ldi r19, 0x03 ; 3 cdf8: 40 e0 ldi r20, 0x00 ; 0 cdfa: 50 e0 ldi r21, 0x00 ; 0 cdfc: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> ce00: ba 01 movw r22, r20 ce02: a9 01 movw r20, r18 ce04: 4c 0d add r20, r12 ce06: 5d 1d adc r21, r13 ce08: 6e 1d adc r22, r14 ce0a: 7f 1d adc r23, r15 ce0c: 81 ef ldi r24, 0xF1 ; 241 ce0e: 9f e0 ldi r25, 0x0F ; 15 ce10: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e print_job_timer.reset(); ce14: 0f 94 ae 58 call 0x2b15c ; 0x2b15c total_filament_used = 0; ce18: 10 92 60 06 sts 0x0660, r1 ; 0x800660 ce1c: 10 92 61 06 sts 0x0661, r1 ; 0x800661 ce20: 10 92 62 06 sts 0x0662, r1 ; 0x800662 ce24: 10 92 63 06 sts 0x0663, r1 ; 0x800663 if (MMU2::mmu2.Enabled()) { ce28: 80 91 96 13 lds r24, 0x1396 ; 0x801396 ce2c: 81 30 cpi r24, 0x01 ; 1 ce2e: 81 f4 brne .+32 ; 0xce50 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); ce30: 60 91 9a 13 lds r22, 0x139A ; 0x80139a ce34: 70 91 9b 13 lds r23, 0x139B ; 0x80139b ce38: 90 e0 ldi r25, 0x00 ; 0 ce3a: 80 e0 ldi r24, 0x00 ; 0 ce3c: 0f 94 61 7c call 0x2f8c2 ; 0x2f8c2 /// @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; }; ce40: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b ce44: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } ce48: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d ce4c: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c // @@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 } } ce50: ff 90 pop r15 ce52: ef 90 pop r14 ce54: df 90 pop r13 ce56: cf 90 pop r12 ce58: bf 90 pop r11 ce5a: af 90 pop r10 ce5c: 9f 90 pop r9 ce5e: 8f 90 pop r8 ce60: 08 95 ret 0000ce62 : } #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); ce62: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 ce66: 1f 92 push r1 ce68: 8f 93 push r24 ce6a: 80 91 6b 03 lds r24, 0x036B ; 0x80036b ce6e: 1f 92 push r1 ce70: 8f 93 push r24 ce72: ef ea ldi r30, 0xAF ; 175 ce74: f4 e0 ldi r31, 0x04 ; 4 ce76: 42 81 ldd r20, Z+2 ; 0x02 ce78: 53 81 ldd r21, Z+3 ; 0x03 ce7a: 2c e3 ldi r18, 0x3C ; 60 ce7c: 24 9f mul r18, r20 ce7e: c0 01 movw r24, r0 ce80: 25 9f mul r18, r21 ce82: 90 0d add r25, r0 ce84: 11 24 eor r1, r1 ce86: 9f 93 push r25 ce88: 8f 93 push r24 ce8a: 40 81 ld r20, Z ce8c: 51 81 ldd r21, Z+1 ; 0x01 ce8e: 24 9f mul r18, r20 ce90: c0 01 movw r24, r0 ce92: 25 9f mul r18, r21 ce94: 90 0d add r25, r0 ce96: 11 24 eor r1, r1 ce98: 9f 93 push r25 ce9a: 8f 93 push r24 ce9c: 82 ec ldi r24, 0xC2 ; 194 ce9e: 96 e6 ldi r25, 0x66 ; 102 cea0: 9f 93 push r25 cea2: 8f 93 push r24 cea4: 0f 94 4b dc call 0x3b896 ; 0x3b896 cea8: 8d b7 in r24, 0x3d ; 61 ceaa: 9e b7 in r25, 0x3e ; 62 ceac: 0a 96 adiw r24, 0x0a ; 10 ceae: 0f b6 in r0, 0x3f ; 63 ceb0: f8 94 cli ceb2: 9e bf out 0x3e, r25 ; 62 ceb4: 0f be out 0x3f, r0 ; 63 ceb6: 8d bf out 0x3d, r24 ; 61 } ceb8: 08 95 ret 0000ceba : // 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) { ceba: cf 93 push r28 cebc: 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); cebe: 8f ef ldi r24, 0xFF ; 255 cec0: 9f e0 ldi r25, 0x0F ; 15 cec2: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { cec6: 81 30 cpi r24, 0x01 ; 1 cec8: 21 f0 breq .+8 ; 0xced2 ceca: 80 91 6a 06 lds r24, 0x066A ; 0x80066a cece: 81 30 cpi r24, 0x01 ; 1 ced0: 29 f4 brne .+10 ; 0xcedc //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); ced2: 81 e0 ldi r24, 0x01 ; 1 ced4: 8c 27 eor r24, r28 } } ced6: 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); ced8: 0c 94 36 61 jmp 0xc26c ; 0xc26c } } cedc: cf 91 pop r28 cede: 08 95 ret 0000cee0 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cee0: 86 e8 ldi r24, 0x86 ; 134 cee2: 93 e0 ldi r25, 0x03 ; 3 cee4: 0d 94 26 42 jmp 0x2844c ; 0x2844c ::start()> 0000cee8 : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cee8: 20 e0 ldi r18, 0x00 ; 0 ceea: 30 e0 ldi r19, 0x00 ; 0 ceec: 40 e7 ldi r20, 0x70 ; 112 ceee: 52 e4 ldi r21, 0x42 ; 66 cef0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> } cef4: 08 95 ret 0000cef6 : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cef6: 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; cefa: 40 91 66 03 lds r20, 0x0366 ; 0x800366 cefe: 50 91 67 03 lds r21, 0x0367 ; 0x800367 cf02: 60 91 68 03 lds r22, 0x0368 ; 0x800368 cf06: 70 91 69 03 lds r23, 0x0369 ; 0x800369 cf0a: 40 93 90 02 sts 0x0290, r20 ; 0x800290 cf0e: 50 93 91 02 sts 0x0291, r21 ; 0x800291 cf12: 60 93 92 02 sts 0x0292, r22 ; 0x800292 cf16: 70 93 93 02 sts 0x0293, r23 ; 0x800293 feedmultiply = original_feedmultiply; cf1a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cf1e: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cf22: 86 e8 ldi r24, 0x86 ; 134 cf24: 93 e0 ldi r25, 0x03 ; 3 cf26: 0d 94 26 42 jmp 0x2844c ; 0x2844c ::start()> 0000cf2a : 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) { cf2a: 1f 93 push r17 cf2c: cf 93 push r28 cf2e: df 93 push r29 cf30: 18 2f mov r17, r24 saved_feedrate = feedrate; cf32: 80 91 90 02 lds r24, 0x0290 ; 0x800290 cf36: 90 91 91 02 lds r25, 0x0291 ; 0x800291 cf3a: a0 91 92 02 lds r26, 0x0292 ; 0x800292 cf3e: b0 91 93 02 lds r27, 0x0293 ; 0x800293 cf42: 80 93 66 03 sts 0x0366, r24 ; 0x800366 cf46: 90 93 67 03 sts 0x0367, r25 ; 0x800367 cf4a: a0 93 68 03 sts 0x0368, r26 ; 0x800368 cf4e: b0 93 69 03 sts 0x0369, r27 ; 0x800369 int l_feedmultiply = feedmultiply; cf52: c0 91 39 02 lds r28, 0x0239 ; 0x800239 cf56: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; cf5a: 84 e6 ldi r24, 0x64 ; 100 cf5c: 90 e0 ldi r25, 0x00 ; 0 cf5e: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cf62: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cf66: 86 e8 ldi r24, 0x86 ; 134 cf68: 93 e0 ldi r25, 0x03 ; 3 cf6a: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> cf6e: 10 93 8f 02 sts 0x028F, r17 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(enable_endstops_now); return l_feedmultiply; } cf72: ce 01 movw r24, r28 cf74: df 91 pop r29 cf76: cf 91 pop r28 cf78: 1f 91 pop r17 cf7a: 08 95 ret 0000cf7c : cf7c: 40 e0 ldi r20, 0x00 ; 0 cf7e: 50 e0 ldi r21, 0x00 ; 0 cf80: ba 01 movw r22, r20 cf82: 8d ee ldi r24, 0xED ; 237 cf84: 9f e0 ldi r25, 0x0F ; 15 cf86: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e cf8a: 40 e0 ldi r20, 0x00 ; 0 cf8c: 50 e0 ldi r21, 0x00 ; 0 cf8e: ba 01 movw r22, r20 cf90: 81 ef ldi r24, 0xF1 ; 241 cf92: 9f e0 ldi r25, 0x0F ; 15 cf94: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 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(); cf98: 0e 94 c2 5c call 0xb984 ; 0xb984 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); cf9c: 70 e0 ldi r23, 0x00 ; 0 cf9e: 60 e0 ldi r22, 0x00 ; 0 cfa0: 85 e0 ldi r24, 0x05 ; 5 cfa2: 9f e0 ldi r25, 0x0F ; 15 cfa4: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 cfa8: 70 e0 ldi r23, 0x00 ; 0 cfaa: 60 e0 ldi r22, 0x00 ; 0 cfac: 83 e0 ldi r24, 0x03 ; 3 cfae: 9f e0 ldi r25, 0x0F ; 15 cfb0: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 cfb4: 70 e0 ldi r23, 0x00 ; 0 cfb6: 60 e0 ldi r22, 0x00 ; 0 cfb8: 81 e0 ldi r24, 0x01 ; 1 cfba: 9f e0 ldi r25, 0x0F ; 15 cfbc: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 cfc0: 70 e0 ldi r23, 0x00 ; 0 cfc2: 60 e0 ldi r22, 0x00 ; 0 cfc4: 8f ef ldi r24, 0xFF ; 255 cfc6: 9e e0 ldi r25, 0x0E ; 14 cfc8: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 cfcc: 70 e0 ldi r23, 0x00 ; 0 cfce: 60 e0 ldi r22, 0x00 ; 0 cfd0: 83 ed ldi r24, 0xD3 ; 211 cfd2: 9e e0 ldi r25, 0x0E ; 14 cfd4: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 cfd8: 70 e0 ldi r23, 0x00 ; 0 cfda: 60 e0 ldi r22, 0x00 ; 0 cfdc: 80 ed ldi r24, 0xD0 ; 208 cfde: 9e e0 ldi r25, 0x0E ; 14 cfe0: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); cfe4: 40 e0 ldi r20, 0x00 ; 0 cfe6: 50 e0 ldi r21, 0x00 ; 0 cfe8: ba 01 movw r22, r20 cfea: 88 ea ldi r24, 0xA8 ; 168 cfec: 9c e0 ldi r25, 0x0C ; 12 cfee: 0d 94 bf dd jmp 0x3bb7e ; 0x3bb7e 0000cff2 : wdt_disable(); } } void softReset(void) { cli(); cff2: 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" ); cff4: 88 e1 ldi r24, 0x18 ; 24 cff6: 98 e0 ldi r25, 0x08 ; 8 cff8: 0f b6 in r0, 0x3f ; 63 cffa: f8 94 cli cffc: a8 95 wdr cffe: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d002: 0f be out 0x3f, r0 ; 63 d004: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d008: ff cf rjmp .-2 ; 0xd008 0000d00a : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { d00a: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); d00c: 9f b7 in r25, 0x3f ; 63 d00e: f8 94 cli d010: e2 e0 ldi r30, 0x02 ; 2 d012: f1 e0 ldi r31, 0x01 ; 1 d014: 80 81 ld r24, Z d016: 84 60 ori r24, 0x04 ; 4 d018: 80 83 st Z, r24 d01a: 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); d01c: 6c 2f mov r22, r28 d01e: 83 e0 ldi r24, 0x03 ; 3 d020: 9d e0 ldi r25, 0x0D ; 13 d022: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); d026: 8c 2f mov r24, r28 d028: 0e 94 33 e4 call 0x1c866 ; 0x1c866 #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); d02c: 0e 94 f9 67 call 0xcff2 ; 0xcff2 0000d030 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { d030: 1f 92 push r1 d032: 0f 92 push r0 d034: 0f b6 in r0, 0x3f ; 63 d036: 0f 92 push r0 d038: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); d03a: 83 e0 ldi r24, 0x03 ; 3 d03c: 0e 94 05 68 call 0xd00a ; 0xd00a 0000d040 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { d040: 1f 92 push r1 d042: 0f 92 push r0 d044: 0f b6 in r0, 0x3f ; 63 d046: 0f 92 push r0 d048: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); d04a: 82 e0 ldi r24, 0x02 ; 2 d04c: 0e 94 05 68 call 0xd00a ; 0xd00a 0000d050 : } #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); d050: 85 ea ldi r24, 0xA5 ; 165 d052: 9f e0 ldi r25, 0x0F ; 15 d054: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 d058: 91 e0 ldi r25, 0x01 ; 1 d05a: 81 11 cpse r24, r1 d05c: 01 c0 rjmp .+2 ; 0xd060 d05e: 90 e0 ldi r25, 0x00 ; 0 } d060: 89 2f mov r24, r25 d062: 08 95 ret 0000d064 : 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(); d064: 80 91 de 03 lds r24, 0x03DE ; 0x8003de d068: 81 11 cpse r24, r1 d06a: 06 c0 rjmp .+12 ; 0xd078 d06c: 81 e0 ldi r24, 0x01 ; 1 d06e: 90 91 9b 03 lds r25, 0x039B ; 0x80039b d072: 92 30 cpi r25, 0x02 ; 2 d074: 09 f0 breq .+2 ; 0xd078 d076: 80 e0 ldi r24, 0x00 ; 0 } d078: 08 95 ret 0000d07a : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); d07a: 80 91 6c 14 lds r24, 0x146C ; 0x80146c d07e: 81 11 cpse r24, r1 d080: 0a c0 rjmp .+20 ; 0xd096 d082: 80 91 0f 05 lds r24, 0x050F ; 0x80050f d086: 81 11 cpse r24, r1 d088: 06 c0 rjmp .+12 ; 0xd096 d08a: 81 e0 ldi r24, 0x01 ; 1 d08c: 90 91 9b 03 lds r25, 0x039B ; 0x80039b d090: 91 30 cpi r25, 0x01 ; 1 d092: 09 f0 breq .+2 ; 0xd096 d094: 80 e0 ldi r24, 0x00 ; 0 } d096: 08 95 ret 0000d098 : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { d098: cf 93 push r28 d09a: df 93 push r29 return ( !homing_flag d09c: c0 91 56 0e lds r28, 0x0E56 ; 0x800e56 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d0a0: c1 11 cpse r28, r1 d0a2: 1f c0 rjmp .+62 ; 0xd0e2 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag d0a4: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 d0a8: 81 11 cpse r24, r1 d0aa: 1c c0 rjmp .+56 ; 0xd0e4 && !printingIsPaused() d0ac: 0e 94 32 68 call 0xd064 ; 0xd064 d0b0: 81 11 cpse r24, r1 d0b2: 18 c0 rjmp .+48 ; 0xd0e4 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d0b4: d0 91 63 0e lds r29, 0x0E63 ; 0x800e63 d0b8: d4 30 cpi r29, 0x04 ; 4 d0ba: 61 f4 brne .+24 ; 0xd0d4 d0bc: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b d0c0: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c d0c4: 89 2b or r24, r25 d0c6: 91 f4 brne .+36 ; 0xd0ec d0c8: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 d0cc: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a d0d0: 89 2b or r24, r25 d0d2: 61 f4 brne .+24 ; 0xd0ec || printJobOngoing() d0d4: 0e 94 3d 68 call 0xd07a ; 0xd07a d0d8: c8 2f mov r28, r24 d0da: 81 11 cpse r24, r1 d0dc: 03 c0 rjmp .+6 ; 0xd0e4 || lcd_commands_type == LcdCommands::Idle d0de: c1 e0 ldi r28, 0x01 ; 1 d0e0: 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) d0e2: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } d0e4: 8c 2f mov r24, r28 d0e6: df 91 pop r29 d0e8: cf 91 pop r28 d0ea: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d0ec: c1 e0 ldi r28, 0x01 ; 1 d0ee: fa cf rjmp .-12 ; 0xd0e4 0000d0f0 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); d0f0: 0e 94 4c 68 call 0xd098 ; 0xd098 d0f4: 88 23 and r24, r24 d0f6: 89 f0 breq .+34 ; 0xd11a d0f8: 20 e0 ldi r18, 0x00 ; 0 d0fa: 30 e0 ldi r19, 0x00 ; 0 d0fc: 40 e0 ldi r20, 0x00 ; 0 d0fe: 50 e4 ldi r21, 0x40 ; 64 d100: 60 91 49 07 lds r22, 0x0749 ; 0x800749 d104: 70 91 4a 07 lds r23, 0x074A ; 0x80074a d108: 80 91 4b 07 lds r24, 0x074B ; 0x80074b d10c: 90 91 4c 07 lds r25, 0x074C ; 0x80074c d110: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> d114: 88 1f adc r24, r24 d116: 88 27 eor r24, r24 d118: 88 1f adc r24, r24 } d11a: 08 95 ret 0000d11c : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() d11c: 0e 94 3d 68 call 0xd07a ; 0xd07a || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; d120: 81 11 cpse r24, r1 d122: 18 c0 rjmp .+48 ; 0xd154 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() d124: 0e 94 32 68 call 0xd064 ; 0xd064 d128: 81 11 cpse r24, r1 d12a: 14 c0 rjmp .+40 ; 0xd154 || saved_printing d12c: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 d130: 81 11 cpse r24, r1 d132: 10 c0 rjmp .+32 ; 0xd154 || (lcd_commands_type != LcdCommands::Idle) d134: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 d138: 81 11 cpse r24, r1 d13a: 0b c0 rjmp .+22 ; 0xd152 || MMU2::mmu2.MMU_PRINT_SAVED() d13c: 80 91 97 13 lds r24, 0x1397 ; 0x801397 d140: 81 11 cpse r24, r1 d142: 07 c0 rjmp .+14 ; 0xd152 || homing_flag d144: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 d148: 81 11 cpse r24, r1 d14a: 04 c0 rjmp .+8 ; 0xd154 || mesh_bed_leveling_flag; d14c: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 d150: 08 95 ret d152: 81 e0 ldi r24, 0x01 ; 1 } d154: 08 95 ret 0000d156 : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; d156: fc 01 movw r30, r24 d158: 20 81 ld r18, Z d15a: 21 11 cpse r18, r1 d15c: 01 c0 rjmp .+2 ; 0xd160 d15e: 66 95 lsr r22 d160: fc 01 movw r30, r24 d162: 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() } d164: 08 95 ret 0000d166 : 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) { d166: fc 01 movw r30, r24 iRun = ir; d168: 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); d16a: 21 e0 ldi r18, 0x01 ; 1 d16c: 60 32 cpi r22, 0x20 ; 32 d16e: 08 f0 brcs .+2 ; 0xd172 d170: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { d172: 90 81 ld r25, Z d174: 29 17 cp r18, r25 d176: 81 f0 breq .+32 ; 0xd198 d178: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { d17a: 99 23 and r25, r25 d17c: 51 f0 breq .+20 ; 0xd192 // 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; d17e: 90 e0 ldi r25, 0x00 ; 0 d180: 95 95 asr r25 d182: 87 95 ror r24 d184: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; d186: 70 e0 ldi r23, 0x00 ; 0 d188: 75 95 asr r23 d18a: 67 95 ror r22 d18c: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; d18e: 20 83 st Z, r18 d190: 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; d192: 88 0f add r24, r24 d194: 82 83 std Z+2, r24 ; 0x02 d196: fb cf rjmp .-10 ; 0xd18e } // Update vSense vSense = newvSense; } else if (!vSense) { d198: 21 11 cpse r18, r1 d19a: 04 c0 rjmp .+8 ; 0xd1a4 // 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; d19c: 70 e0 ldi r23, 0x00 ; 0 d19e: 75 95 asr r23 d1a0: 67 95 ror r22 d1a2: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } d1a4: 08 95 ret 0000d1a6 : } #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; } d1a6: 20 91 6e 12 lds r18, 0x126E ; 0x80126e d1aa: 30 91 6f 12 lds r19, 0x126F ; 0x80126f d1ae: bc 01 movw r22, r24 d1b0: c9 01 movw r24, r18 d1b2: 8c 57 subi r24, 0x7C ; 124 d1b4: 9f 4e sbci r25, 0xEF ; 239 d1b6: 0f 94 90 db call 0x3b720 ; 0x3b720 d1ba: 9c 01 movw r18, r24 d1bc: 90 93 96 03 sts 0x0396, r25 ; 0x800396 d1c0: 80 93 95 03 sts 0x0395, r24 ; 0x800395 d1c4: 81 e0 ldi r24, 0x01 ; 1 d1c6: 23 2b or r18, r19 d1c8: 09 f4 brne .+2 ; 0xd1cc d1ca: 80 e0 ldi r24, 0x00 ; 0 d1cc: 08 95 ret 0000d1ce : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } d1ce: 80 e1 ldi r24, 0x10 ; 16 d1d0: e1 e4 ldi r30, 0x41 ; 65 d1d2: f7 e0 ldi r31, 0x07 ; 7 d1d4: a2 e5 ldi r26, 0x52 ; 82 d1d6: b5 e0 ldi r27, 0x05 ; 5 d1d8: 01 90 ld r0, Z+ d1da: 0d 92 st X+, r0 d1dc: 8a 95 dec r24 d1de: e1 f7 brne .-8 ; 0xd1d8 d1e0: 08 95 ret 0000d1e2 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { d1e2: 4f 92 push r4 d1e4: 5f 92 push r5 d1e6: 6f 92 push r6 d1e8: 7f 92 push r7 d1ea: 8f 92 push r8 d1ec: 9f 92 push r9 d1ee: af 92 push r10 d1f0: bf 92 push r11 d1f2: cf 92 push r12 d1f4: df 92 push r13 d1f6: ef 92 push r14 d1f8: ff 92 push r15 d1fa: 0f 93 push r16 d1fc: 1f 93 push r17 d1fe: cf 93 push r28 d200: df 93 push r29 d202: 00 d0 rcall .+0 ; 0xd204 d204: 00 d0 rcall .+0 ; 0xd206 d206: 1f 92 push r1 d208: 1f 92 push r1 d20a: cd b7 in r28, 0x3d ; 61 d20c: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; d20e: 20 91 58 0e lds r18, 0x0E58 ; 0x800e58 d212: 22 23 and r18, r18 d214: 09 f4 brne .+2 ; 0xd218 d216: 73 c1 rjmp .+742 ; 0xd4fe #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; d218: 20 91 e0 03 lds r18, 0x03E0 ; 0x8003e0 d21c: 22 30 cpi r18, 0x02 ; 2 d21e: 09 f4 brne .+2 ; 0xd222 d220: 6e c1 rjmp .+732 ; 0xd4fe if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb d222: 20 91 e0 03 lds r18, 0x03E0 ; 0x8003e0 d226: 21 30 cpi r18, 0x01 ; 1 d228: 11 f4 brne .+4 ; 0xd22e d22a: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 d22e: 2b 01 movw r4, r22 d230: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; d232: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) d236: 10 91 ad 05 lds r17, 0x05AD ; 0x8005ad d23a: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef d23e: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 d242: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 d246: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 d24a: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> d24e: 61 17 cp r22, r17 d250: 31 f0 breq .+12 ; 0xd25e resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; d252: 81 2f mov r24, r17 d254: 90 e0 ldi r25, 0x00 ; 0 d256: 90 93 6a 0e sts 0x0E6A, r25 ; 0x800e6a d25a: 80 93 69 0e sts 0x0E69, r24 ; 0x800e69 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d25e: 0e 94 76 65 call 0xcaec ; 0xcaec // Restore saved fan speed fanSpeed = saved_fan_speed; d262: 80 91 aa 05 lds r24, 0x05AA ; 0x8005aa d266: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d26a: 90 91 df 03 lds r25, 0x03DF ; 0x8003df d26e: 80 91 04 18 lds r24, 0x1804 ; 0x801804 d272: 81 95 neg r24 d274: 89 27 eor r24, r25 d276: 88 70 andi r24, 0x08 ; 8 d278: 89 27 eor r24, r25 d27a: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df float e = saved_pos[E_AXIS] - e_move; d27e: a3 01 movw r20, r6 d280: 92 01 movw r18, r4 d282: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d286: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d28a: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d28e: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d292: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> d296: 6d 83 std Y+5, r22 ; 0x05 d298: 7e 83 std Y+6, r23 ; 0x06 d29a: 8f 83 std Y+7, r24 ; 0x07 d29c: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d29e: ce 01 movw r24, r28 d2a0: 05 96 adiw r24, 0x05 ; 5 d2a2: 0f 94 dc aa call 0x355b8 ; 0x355b8 #ifdef FANCHECK fans_check_enabled = false; d2a6: 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) d2aa: 20 e0 ldi r18, 0x00 ; 0 d2ac: 30 e0 ldi r19, 0x00 ; 0 d2ae: 40 e8 ldi r20, 0x80 ; 128 d2b0: 5f eb ldi r21, 0xBF ; 191 d2b2: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d2b6: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d2ba: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d2be: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d2c2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> d2c6: 81 11 cpse r24, r1 d2c8: 20 c0 rjmp .+64 ; 0xd30a { saved_pos[X_AXIS] = current_position[X_AXIS]; d2ca: 80 91 41 07 lds r24, 0x0741 ; 0x800741 d2ce: 90 91 42 07 lds r25, 0x0742 ; 0x800742 d2d2: a0 91 43 07 lds r26, 0x0743 ; 0x800743 d2d6: b0 91 44 07 lds r27, 0x0744 ; 0x800744 d2da: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b d2de: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c d2e2: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d d2e6: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_pos[Y_AXIS] = current_position[Y_AXIS]; d2ea: 80 91 45 07 lds r24, 0x0745 ; 0x800745 d2ee: 90 91 46 07 lds r25, 0x0746 ; 0x800746 d2f2: a0 91 47 07 lds r26, 0x0747 ; 0x800747 d2f6: b0 91 48 07 lds r27, 0x0748 ; 0x800748 d2fa: 80 93 9f 02 sts 0x029F, r24 ; 0x80029f d2fe: 90 93 a0 02 sts 0x02A0, r25 ; 0x8002a0 d302: a0 93 a1 02 sts 0x02A1, r26 ; 0x8002a1 d306: 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); d30a: a3 01 movw r20, r6 d30c: 92 01 movw r18, r4 d30e: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d312: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d316: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d31a: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d31e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> d322: 69 83 std Y+1, r22 ; 0x01 d324: 7a 83 std Y+2, r23 ; 0x02 d326: 8b 83 std Y+3, r24 ; 0x03 d328: 9c 83 std Y+4, r25 ; 0x04 d32a: e0 90 49 07 lds r14, 0x0749 ; 0x800749 d32e: f0 90 4a 07 lds r15, 0x074A ; 0x80074a d332: 00 91 4b 07 lds r16, 0x074B ; 0x80074b d336: 10 91 4c 07 lds r17, 0x074C ; 0x80074c d33a: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d33e: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d342: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d346: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d34a: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d34e: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d352: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d356: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d35a: 1f 92 push r1 d35c: 1f 92 push r1 d35e: 1f 92 push r1 d360: 1f 92 push r1 d362: e2 e6 ldi r30, 0x62 ; 98 d364: 8e 2e mov r8, r30 d366: e7 e2 ldi r30, 0x27 ; 39 d368: 9e 2e mov r9, r30 d36a: e6 e7 ldi r30, 0x76 ; 118 d36c: ae 2e mov r10, r30 d36e: e2 e4 ldi r30, 0x42 ; 66 d370: be 2e mov r11, r30 d372: fe 01 movw r30, r28 d374: 31 96 adiw r30, 0x01 ; 1 d376: 6f 01 movw r12, r30 d378: 0f 94 36 ab call 0x3566c ; 0x3566c //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); d37c: a3 01 movw r20, r6 d37e: 92 01 movw r18, r4 d380: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d384: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d388: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d38c: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d390: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> d394: 69 83 std Y+1, r22 ; 0x01 d396: 7a 83 std Y+2, r23 ; 0x02 d398: 8b 83 std Y+3, r24 ; 0x03 d39a: 9c 83 std Y+4, r25 ; 0x04 d39c: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d3a0: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d3a4: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d3a8: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d3ac: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d3b0: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d3b4: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d3b8: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d3bc: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d3c0: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d3c4: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d3c8: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d3cc: 1f 92 push r1 d3ce: 1f 92 push r1 d3d0: 1f 92 push r1 d3d2: 1f 92 push r1 d3d4: 0f 94 36 ab call 0x3566c ; 0x3566c //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); d3d8: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d3dc: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d3e0: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d3e4: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d3e8: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d3ec: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d3f0: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d3f4: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d3f8: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d3fc: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d400: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d404: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d408: 1f 92 push r1 d40a: 1f 92 push r1 d40c: 1f 92 push r1 d40e: 1f 92 push r1 d410: 81 2c mov r8, r1 d412: 91 2c mov r9, r1 d414: f8 ee ldi r31, 0xE8 ; 232 d416: af 2e mov r10, r31 d418: f2 e4 ldi r31, 0x42 ; 66 d41a: bf 2e mov r11, r31 d41c: a7 ea ldi r26, 0xA7 ; 167 d41e: ca 2e mov r12, r26 d420: a2 e0 ldi r26, 0x02 ; 2 d422: da 2e mov r13, r26 d424: 0f 94 36 ab call 0x3566c ; 0x3566c st_synchronize(); d428: 0f 94 24 59 call 0x2b248 ; 0x2b248 #ifdef FANCHECK fans_check_enabled = true; d42c: 11 e0 ldi r17, 0x01 ; 1 d42e: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d432: 60 91 fe 17 lds r22, 0x17FE ; 0x8017fe d436: 70 91 ff 17 lds r23, 0x17FF ; 0x8017ff d43a: 90 e0 ldi r25, 0x00 ; 0 d43c: 80 e0 ldi r24, 0x00 ; 0 d43e: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> d442: 60 93 90 02 sts 0x0290, r22 ; 0x800290 d446: 70 93 91 02 sts 0x0291, r23 ; 0x800291 d44a: 80 93 92 02 sts 0x0292, r24 ; 0x800292 d44e: 90 93 93 02 sts 0x0293, r25 ; 0x800293 feedmultiply = saved_feedmultiply2; d452: 80 91 71 03 lds r24, 0x0371 ; 0x800371 d456: 90 91 72 03 lds r25, 0x0372 ; 0x800372 d45a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d45e: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d462: 80 e1 ldi r24, 0x10 ; 16 d464: eb e9 ldi r30, 0x9B ; 155 d466: f2 e0 ldi r31, 0x02 ; 2 d468: a1 e4 ldi r26, 0x41 ; 65 d46a: b7 e0 ldi r27, 0x07 ; 7 d46c: 01 90 ld r0, Z+ d46e: 0d 92 st X+, r0 d470: 8a 95 dec r24 d472: e1 f7 brne .-8 ; 0xd46c set_destination_to_current(); d474: 0e 94 e7 68 call 0xd1ce ; 0xd1ce //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d478: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d47c: 0f b6 in r0, 0x3f ; 63 d47e: f8 94 cli d480: de bf out 0x3e, r29 ; 62 d482: 0f be out 0x3f, r0 ; 63 d484: cd bf out 0x3d, r28 ; 61 d486: 81 11 cpse r24, r1 d488: 51 c0 rjmp .+162 ; 0xd52c card.setIndex(saved_sdpos); d48a: 60 91 00 18 lds r22, 0x1800 ; 0x801800 d48e: 70 91 01 18 lds r23, 0x1801 ; 0x801801 d492: 80 91 02 18 lds r24, 0x1802 ; 0x801802 d496: 90 91 03 18 lds r25, 0x1803 ; 0x801803 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; d49a: 60 93 80 17 sts 0x1780, r22 ; 0x801780 d49e: 70 93 81 17 sts 0x1781, r23 ; 0x801781 d4a2: 80 93 82 17 sts 0x1782, r24 ; 0x801782 d4a6: 90 93 83 17 sts 0x1783, r25 ; 0x801783 d4aa: 0f 94 b8 77 call 0x2ef70 ; 0x2ef70 sdpos_atomic = saved_sdpos; d4ae: 80 91 00 18 lds r24, 0x1800 ; 0x801800 d4b2: 90 91 01 18 lds r25, 0x1801 ; 0x801801 d4b6: a0 91 02 18 lds r26, 0x1802 ; 0x801802 d4ba: b0 91 03 18 lds r27, 0x1803 ; 0x801803 d4be: 80 93 82 03 sts 0x0382, r24 ; 0x800382 d4c2: 90 93 83 03 sts 0x0383, r25 ; 0x800383 d4c6: a0 93 84 03 sts 0x0384, r26 ; 0x800384 d4ca: b0 93 85 03 sts 0x0385, r27 ; 0x800385 card.sdprinting = true; d4ce: 10 93 6c 14 sts 0x146C, r17 ; 0x80146c d4d2: 60 e0 ldi r22, 0x00 ; 0 d4d4: 85 ea ldi r24, 0xA5 ; 165 d4d6: 9f e0 ldi r25, 0x0F ; 15 d4d8: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a d4dc: 60 e0 ldi r22, 0x00 ; 0 d4de: 8f e7 ldi r24, 0x7F ; 127 d4e0: 9c e0 ldi r25, 0x0C ; 12 d4e2: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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); d4e6: 8a e6 ldi r24, 0x6A ; 106 d4e8: 90 e7 ldi r25, 0x70 ; 112 d4ea: 0f 94 e2 0b call 0x217c4 ; 0x217c4 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d4ee: 82 e0 ldi r24, 0x02 ; 2 d4f0: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d4f4: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 planner_aborted = true; // unroll the stack d4f8: 81 e0 ldi r24, 0x01 ; 1 d4fa: 80 93 5b 0e sts 0x0E5B, r24 ; 0x800e5b } d4fe: 28 96 adiw r28, 0x08 ; 8 d500: 0f b6 in r0, 0x3f ; 63 d502: f8 94 cli d504: de bf out 0x3e, r29 ; 62 d506: 0f be out 0x3f, r0 ; 63 d508: cd bf out 0x3d, r28 ; 61 d50a: df 91 pop r29 d50c: cf 91 pop r28 d50e: 1f 91 pop r17 d510: 0f 91 pop r16 d512: ff 90 pop r15 d514: ef 90 pop r14 d516: df 90 pop r13 d518: cf 90 pop r12 d51a: bf 90 pop r11 d51c: af 90 pop r10 d51e: 9f 90 pop r9 d520: 8f 90 pop r8 d522: 7f 90 pop r7 d524: 6f 90 pop r6 d526: 5f 90 pop r5 d528: 4f 90 pop r4 d52a: 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 d52c: 81 30 cpi r24, 0x01 ; 1 d52e: 89 f6 brne .-94 ; 0xd4d2 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d530: 80 91 00 18 lds r24, 0x1800 ; 0x801800 d534: 90 91 01 18 lds r25, 0x1801 ; 0x801801 d538: a0 91 02 18 lds r26, 0x1802 ; 0x801802 d53c: b0 91 03 18 lds r27, 0x1803 ; 0x801803 d540: 80 93 7a 03 sts 0x037A, r24 ; 0x80037a d544: 90 93 7b 03 sts 0x037B, r25 ; 0x80037b d548: a0 93 7c 03 sts 0x037C, r26 ; 0x80037c d54c: b0 93 7d 03 sts 0x037D, r27 ; 0x80037d serial_count = 0; d550: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b d554: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a FlushSerialRequestResend(); d558: 0e 94 2b 5c call 0xb856 ; 0xb856 d55c: ba cf rjmp .-140 ; 0xd4d2 0000d55e : 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) { d55e: 3f 92 push r3 d560: 4f 92 push r4 d562: 5f 92 push r5 d564: 6f 92 push r6 d566: 7f 92 push r7 d568: 8f 92 push r8 d56a: 9f 92 push r9 d56c: af 92 push r10 d56e: bf 92 push r11 d570: cf 92 push r12 d572: df 92 push r13 d574: ef 92 push r14 d576: ff 92 push r15 d578: 0f 93 push r16 d57a: 1f 93 push r17 d57c: cf 93 push r28 d57e: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d580: 30 90 e9 17 lds r3, 0x17E9 ; 0x8017e9 d584: 33 20 and r3, r3 d586: 09 f4 brne .+2 ; 0xd58a d588: 80 c0 rjmp .+256 ; 0xd68a d58a: 8b 01 movw r16, r22 d58c: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d58e: 31 fe sbrs r3, 1 d590: 54 c0 rjmp .+168 ; 0xd63a // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d592: 88 80 ld r8, Y d594: 99 80 ldd r9, Y+1 ; 0x01 d596: aa 80 ldd r10, Y+2 ; 0x02 d598: bb 80 ldd r11, Y+3 ; 0x03 d59a: fb 01 movw r30, r22 d59c: c0 80 ld r12, Z d59e: d1 80 ldd r13, Z+1 ; 0x01 d5a0: e2 80 ldd r14, Z+2 ; 0x02 d5a2: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d5a4: 20 91 be 17 lds r18, 0x17BE ; 0x8017be d5a8: 30 91 bf 17 lds r19, 0x17BF ; 0x8017bf d5ac: 40 91 c0 17 lds r20, 0x17C0 ; 0x8017c0 d5b0: 50 91 c1 17 lds r21, 0x17C1 ; 0x8017c1 d5b4: c5 01 movw r24, r10 d5b6: b4 01 movw r22, r8 d5b8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> d5bc: 2b 01 movw r4, r22 d5be: 3c 01 movw r6, r24 d5c0: 20 91 c2 17 lds r18, 0x17C2 ; 0x8017c2 d5c4: 30 91 c3 17 lds r19, 0x17C3 ; 0x8017c3 d5c8: 40 91 c4 17 lds r20, 0x17C4 ; 0x8017c4 d5cc: 50 91 c5 17 lds r21, 0x17C5 ; 0x8017c5 d5d0: c7 01 movw r24, r14 d5d2: b6 01 movw r22, r12 d5d4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> d5d8: 9b 01 movw r18, r22 d5da: ac 01 movw r20, r24 d5dc: c3 01 movw r24, r6 d5de: b2 01 movw r22, r4 d5e0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> d5e4: 2b 01 movw r4, r22 d5e6: 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; d5e8: 20 91 b6 17 lds r18, 0x17B6 ; 0x8017b6 d5ec: 30 91 b7 17 lds r19, 0x17B7 ; 0x8017b7 d5f0: 40 91 b8 17 lds r20, 0x17B8 ; 0x8017b8 d5f4: 50 91 b9 17 lds r21, 0x17B9 ; 0x8017b9 d5f8: c5 01 movw r24, r10 d5fa: b4 01 movw r22, r8 d5fc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> d600: 4b 01 movw r8, r22 d602: 5c 01 movw r10, r24 d604: 20 91 ba 17 lds r18, 0x17BA ; 0x8017ba d608: 30 91 bb 17 lds r19, 0x17BB ; 0x8017bb d60c: 40 91 bc 17 lds r20, 0x17BC ; 0x8017bc d610: 50 91 bd 17 lds r21, 0x17BD ; 0x8017bd d614: c7 01 movw r24, r14 d616: b6 01 movw r22, r12 d618: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> d61c: 9b 01 movw r18, r22 d61e: ac 01 movw r20, r24 d620: c5 01 movw r24, r10 d622: b4 01 movw r22, r8 d624: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d628: 68 83 st Y, r22 d62a: 79 83 std Y+1, r23 ; 0x01 d62c: 8a 83 std Y+2, r24 ; 0x02 d62e: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d630: f8 01 movw r30, r16 d632: 40 82 st Z, r4 d634: 51 82 std Z+1, r5 ; 0x01 d636: 62 82 std Z+2, r6 ; 0x02 d638: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d63a: 30 fe sbrs r3, 0 d63c: 26 c0 rjmp .+76 ; 0xd68a // Then add the offset. x += world2machine_shift[0]; d63e: 20 91 e1 17 lds r18, 0x17E1 ; 0x8017e1 d642: 30 91 e2 17 lds r19, 0x17E2 ; 0x8017e2 d646: 40 91 e3 17 lds r20, 0x17E3 ; 0x8017e3 d64a: 50 91 e4 17 lds r21, 0x17E4 ; 0x8017e4 d64e: 68 81 ld r22, Y d650: 79 81 ldd r23, Y+1 ; 0x01 d652: 8a 81 ldd r24, Y+2 ; 0x02 d654: 9b 81 ldd r25, Y+3 ; 0x03 d656: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> d65a: 68 83 st Y, r22 d65c: 79 83 std Y+1, r23 ; 0x01 d65e: 8a 83 std Y+2, r24 ; 0x02 d660: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d662: 20 91 e5 17 lds r18, 0x17E5 ; 0x8017e5 d666: 30 91 e6 17 lds r19, 0x17E6 ; 0x8017e6 d66a: 40 91 e7 17 lds r20, 0x17E7 ; 0x8017e7 d66e: 50 91 e8 17 lds r21, 0x17E8 ; 0x8017e8 d672: f8 01 movw r30, r16 d674: 60 81 ld r22, Z d676: 71 81 ldd r23, Z+1 ; 0x01 d678: 82 81 ldd r24, Z+2 ; 0x02 d67a: 93 81 ldd r25, Z+3 ; 0x03 d67c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> d680: f8 01 movw r30, r16 d682: 60 83 st Z, r22 d684: 71 83 std Z+1, r23 ; 0x01 d686: 82 83 std Z+2, r24 ; 0x02 d688: 93 83 std Z+3, r25 ; 0x03 } } } d68a: df 91 pop r29 d68c: cf 91 pop r28 d68e: 1f 91 pop r17 d690: 0f 91 pop r16 d692: ff 90 pop r15 d694: ef 90 pop r14 d696: df 90 pop r13 d698: cf 90 pop r12 d69a: bf 90 pop r11 d69c: af 90 pop r10 d69e: 9f 90 pop r9 d6a0: 8f 90 pop r8 d6a2: 7f 90 pop r7 d6a4: 6f 90 pop r6 d6a6: 5f 90 pop r5 d6a8: 4f 90 pop r4 d6aa: 3f 90 pop r3 d6ac: 08 95 ret 0000d6ae : } } } inline bool world2machine_clamp(float &x, float &y) { d6ae: 2f 92 push r2 d6b0: 3f 92 push r3 d6b2: 4f 92 push r4 d6b4: 5f 92 push r5 d6b6: 6f 92 push r6 d6b8: 7f 92 push r7 d6ba: 8f 92 push r8 d6bc: 9f 92 push r9 d6be: af 92 push r10 d6c0: bf 92 push r11 d6c2: cf 92 push r12 d6c4: df 92 push r13 d6c6: ef 92 push r14 d6c8: ff 92 push r15 d6ca: 0f 93 push r16 d6cc: 1f 93 push r17 d6ce: cf 93 push r28 d6d0: df 93 push r29 d6d2: 00 d0 rcall .+0 ; 0xd6d4 d6d4: 00 d0 rcall .+0 ; 0xd6d6 d6d6: 1f 92 push r1 d6d8: 1f 92 push r1 d6da: cd b7 in r28, 0x3d ; 61 d6dc: de b7 in r29, 0x3e ; 62 d6de: 8c 01 movw r16, r24 d6e0: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d6e2: fc 01 movw r30, r24 d6e4: 80 81 ld r24, Z d6e6: 91 81 ldd r25, Z+1 ; 0x01 d6e8: a2 81 ldd r26, Z+2 ; 0x02 d6ea: b3 81 ldd r27, Z+3 ; 0x03 d6ec: 89 83 std Y+1, r24 ; 0x01 d6ee: 9a 83 std Y+2, r25 ; 0x02 d6f0: ab 83 std Y+3, r26 ; 0x03 d6f2: bc 83 std Y+4, r27 ; 0x04 out_y = y; d6f4: fb 01 movw r30, r22 d6f6: 80 81 ld r24, Z d6f8: 91 81 ldd r25, Z+1 ; 0x01 d6fa: a2 81 ldd r26, Z+2 ; 0x02 d6fc: b3 81 ldd r27, Z+3 ; 0x03 d6fe: 8d 83 std Y+5, r24 ; 0x05 d700: 9e 83 std Y+6, r25 ; 0x06 d702: af 83 std Y+7, r26 ; 0x07 d704: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d706: be 01 movw r22, r28 d708: 6b 5f subi r22, 0xFB ; 251 d70a: 7f 4f sbci r23, 0xFF ; 255 d70c: ce 01 movw r24, r28 d70e: 01 96 adiw r24, 0x01 ; 1 d710: 0e 94 af 6a call 0xd55e ; 0xd55e inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d714: c9 80 ldd r12, Y+1 ; 0x01 d716: da 80 ldd r13, Y+2 ; 0x02 d718: eb 80 ldd r14, Y+3 ; 0x03 d71a: fc 80 ldd r15, Y+4 ; 0x04 d71c: 20 e0 ldi r18, 0x00 ; 0 d71e: 30 e0 ldi r19, 0x00 ; 0 d720: a9 01 movw r20, r18 d722: c7 01 movw r24, r14 d724: b6 01 movw r22, r12 d726: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> d72a: 87 ff sbrs r24, 7 d72c: 35 c0 rjmp .+106 ; 0xd798 tmpx = X_MIN_POS; d72e: 19 82 std Y+1, r1 ; 0x01 d730: 1a 82 std Y+2, r1 ; 0x02 d732: 1b 82 std Y+3, r1 ; 0x03 d734: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d736: ff 24 eor r15, r15 d738: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d73a: 8d 80 ldd r8, Y+5 ; 0x05 d73c: 9e 80 ldd r9, Y+6 ; 0x06 d73e: af 80 ldd r10, Y+7 ; 0x07 d740: b8 84 ldd r11, Y+8 ; 0x08 d742: 20 e0 ldi r18, 0x00 ; 0 d744: 30 e0 ldi r19, 0x00 ; 0 d746: 40 e8 ldi r20, 0x80 ; 128 d748: 50 ec ldi r21, 0xC0 ; 192 d74a: c5 01 movw r24, r10 d74c: b4 01 movw r22, r8 d74e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> d752: 87 ff sbrs r24, 7 d754: 35 c0 rjmp .+106 ; 0xd7c0 tmpy = Y_MIN_POS; d756: 80 e0 ldi r24, 0x00 ; 0 d758: 90 e0 ldi r25, 0x00 ; 0 d75a: a0 e8 ldi r26, 0x80 ; 128 d75c: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d75e: 8d 83 std Y+5, r24 ; 0x05 d760: 9e 83 std Y+6, r25 ; 0x06 d762: af 83 std Y+7, r26 ; 0x07 d764: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d766: cd 80 ldd r12, Y+5 ; 0x05 d768: de 80 ldd r13, Y+6 ; 0x06 d76a: ef 80 ldd r14, Y+7 ; 0x07 d76c: f8 84 ldd r15, Y+8 ; 0x08 d76e: 89 80 ldd r8, Y+1 ; 0x01 d770: 9a 80 ldd r9, Y+2 ; 0x02 d772: ab 80 ldd r10, Y+3 ; 0x03 d774: 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) { d776: 70 90 e9 17 lds r7, 0x17E9 ; 0x8017e9 d77a: 71 10 cpse r7, r1 d77c: 4c c0 rjmp .+152 ; 0xd816 // No correction. out_x = x; d77e: f8 01 movw r30, r16 d780: 80 82 st Z, r8 d782: 91 82 std Z+1, r9 ; 0x01 d784: a2 82 std Z+2, r10 ; 0x02 d786: b3 82 std Z+3, r11 ; 0x03 out_y = y; d788: f1 01 movw r30, r2 d78a: c0 82 st Z, r12 d78c: d1 82 std Z+1, r13 ; 0x01 d78e: e2 82 std Z+2, r14 ; 0x02 d790: 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) { d792: ff 24 eor r15, r15 d794: f3 94 inc r15 d796: 25 c0 rjmp .+74 ; 0xd7e2 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) { d798: 20 e0 ldi r18, 0x00 ; 0 d79a: 30 e0 ldi r19, 0x00 ; 0 d79c: 4f e7 ldi r20, 0x7F ; 127 d79e: 53 e4 ldi r21, 0x43 ; 67 d7a0: c7 01 movw r24, r14 d7a2: b6 01 movw r22, r12 d7a4: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d7a8: 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) { d7aa: 18 16 cp r1, r24 d7ac: 34 f6 brge .-116 ; 0xd73a tmpx = X_MAX_POS; d7ae: 80 e0 ldi r24, 0x00 ; 0 d7b0: 90 e0 ldi r25, 0x00 ; 0 d7b2: af e7 ldi r26, 0x7F ; 127 d7b4: b3 e4 ldi r27, 0x43 ; 67 d7b6: 89 83 std Y+1, r24 ; 0x01 d7b8: 9a 83 std Y+2, r25 ; 0x02 d7ba: ab 83 std Y+3, r26 ; 0x03 d7bc: bc 83 std Y+4, r27 ; 0x04 d7be: bb cf rjmp .-138 ; 0xd736 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d7c0: 20 e0 ldi r18, 0x00 ; 0 d7c2: 30 e8 ldi r19, 0x80 ; 128 d7c4: 44 e5 ldi r20, 0x54 ; 84 d7c6: 53 e4 ldi r21, 0x43 ; 67 d7c8: c5 01 movw r24, r10 d7ca: b4 01 movw r22, r8 d7cc: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> d7d0: 18 16 cp r1, r24 d7d2: 2c f4 brge .+10 ; 0xd7de tmpy = Y_MAX_POS; d7d4: 80 e0 ldi r24, 0x00 ; 0 d7d6: 90 e8 ldi r25, 0x80 ; 128 d7d8: a4 e5 ldi r26, 0x54 ; 84 d7da: b3 e4 ldi r27, 0x43 ; 67 d7dc: c0 cf rjmp .-128 ; 0xd75e clamped = true; } if (clamped) d7de: f1 10 cpse r15, r1 d7e0: c2 cf rjmp .-124 ; 0xd766 machine2world(tmpx, tmpy, x, y); return clamped; } d7e2: 8f 2d mov r24, r15 d7e4: 28 96 adiw r28, 0x08 ; 8 d7e6: 0f b6 in r0, 0x3f ; 63 d7e8: f8 94 cli d7ea: de bf out 0x3e, r29 ; 62 d7ec: 0f be out 0x3f, r0 ; 63 d7ee: cd bf out 0x3d, r28 ; 61 d7f0: df 91 pop r29 d7f2: cf 91 pop r28 d7f4: 1f 91 pop r17 d7f6: 0f 91 pop r16 d7f8: ff 90 pop r15 d7fa: ef 90 pop r14 d7fc: df 90 pop r13 d7fe: cf 90 pop r12 d800: bf 90 pop r11 d802: af 90 pop r10 d804: 9f 90 pop r9 d806: 8f 90 pop r8 d808: 7f 90 pop r7 d80a: 6f 90 pop r6 d80c: 5f 90 pop r5 d80e: 4f 90 pop r4 d810: 3f 90 pop r3 d812: 2f 90 pop r2 d814: 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) { d816: 70 fe sbrs r7, 0 d818: 1c c0 rjmp .+56 ; 0xd852 // Then add the offset. x -= world2machine_shift[0]; d81a: 20 91 e1 17 lds r18, 0x17E1 ; 0x8017e1 d81e: 30 91 e2 17 lds r19, 0x17E2 ; 0x8017e2 d822: 40 91 e3 17 lds r20, 0x17E3 ; 0x8017e3 d826: 50 91 e4 17 lds r21, 0x17E4 ; 0x8017e4 d82a: c5 01 movw r24, r10 d82c: b4 01 movw r22, r8 d82e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> d832: 4b 01 movw r8, r22 d834: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d836: 20 91 e5 17 lds r18, 0x17E5 ; 0x8017e5 d83a: 30 91 e6 17 lds r19, 0x17E6 ; 0x8017e6 d83e: 40 91 e7 17 lds r20, 0x17E7 ; 0x8017e7 d842: 50 91 e8 17 lds r21, 0x17E8 ; 0x8017e8 d846: c7 01 movw r24, r14 d848: b6 01 movw r22, r12 d84a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> d84e: 6b 01 movw r12, r22 d850: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d852: 71 fe sbrs r7, 1 d854: 9e cf rjmp .-196 ; 0xd792 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d856: 20 91 d1 17 lds r18, 0x17D1 ; 0x8017d1 d85a: 30 91 d2 17 lds r19, 0x17D2 ; 0x8017d2 d85e: 40 91 d3 17 lds r20, 0x17D3 ; 0x8017d3 d862: 50 91 d4 17 lds r21, 0x17D4 ; 0x8017d4 d866: c5 01 movw r24, r10 d868: b4 01 movw r22, r8 d86a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> d86e: 2b 01 movw r4, r22 d870: 3c 01 movw r6, r24 d872: 20 91 d5 17 lds r18, 0x17D5 ; 0x8017d5 d876: 30 91 d6 17 lds r19, 0x17D6 ; 0x8017d6 d87a: 40 91 d7 17 lds r20, 0x17D7 ; 0x8017d7 d87e: 50 91 d8 17 lds r21, 0x17D8 ; 0x8017d8 d882: c7 01 movw r24, r14 d884: b6 01 movw r22, r12 d886: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> d88a: 9b 01 movw r18, r22 d88c: ac 01 movw r20, r24 d88e: c3 01 movw r24, r6 d890: b2 01 movw r22, r4 d892: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> d896: f8 01 movw r30, r16 d898: 60 83 st Z, r22 d89a: 71 83 std Z+1, r23 ; 0x01 d89c: 82 83 std Z+2, r24 ; 0x02 d89e: 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; d8a0: 20 91 d9 17 lds r18, 0x17D9 ; 0x8017d9 d8a4: 30 91 da 17 lds r19, 0x17DA ; 0x8017da d8a8: 40 91 db 17 lds r20, 0x17DB ; 0x8017db d8ac: 50 91 dc 17 lds r21, 0x17DC ; 0x8017dc d8b0: c5 01 movw r24, r10 d8b2: b4 01 movw r22, r8 d8b4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> d8b8: 4b 01 movw r8, r22 d8ba: 5c 01 movw r10, r24 d8bc: 20 91 dd 17 lds r18, 0x17DD ; 0x8017dd d8c0: 30 91 de 17 lds r19, 0x17DE ; 0x8017de d8c4: 40 91 df 17 lds r20, 0x17DF ; 0x8017df d8c8: 50 91 e0 17 lds r21, 0x17E0 ; 0x8017e0 d8cc: c7 01 movw r24, r14 d8ce: b6 01 movw r22, r12 d8d0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> d8d4: 9b 01 movw r18, r22 d8d6: ac 01 movw r20, r24 d8d8: c5 01 movw r24, r10 d8da: b4 01 movw r22, r8 d8dc: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> d8e0: f1 01 movw r30, r2 d8e2: 60 83 st Z, r22 d8e4: 71 83 std Z+1, r23 ; 0x01 d8e6: 82 83 std Z+2, r24 ; 0x02 d8e8: 93 83 std Z+3, r25 ; 0x03 d8ea: 53 cf rjmp .-346 ; 0xd792 0000d8ec : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d8ec: cf 92 push r12 d8ee: df 92 push r13 d8f0: ef 92 push r14 d8f2: ff 92 push r15 d8f4: cf 93 push r28 d8f6: df 93 push r29 d8f8: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d8fa: bc 01 movw r22, r24 d8fc: 6c 5f subi r22, 0xFC ; 252 d8fe: 7f 4f sbci r23, 0xFF ; 255 d900: 0e 94 57 6b call 0xd6ae ; 0xd6ae // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d904: c0 90 29 02 lds r12, 0x0229 ; 0x800229 d908: d0 90 2a 02 lds r13, 0x022A ; 0x80022a d90c: e0 90 2b 02 lds r14, 0x022B ; 0x80022b d910: f0 90 2c 02 lds r15, 0x022C ; 0x80022c d914: a7 01 movw r20, r14 d916: 96 01 movw r18, r12 d918: 68 85 ldd r22, Y+8 ; 0x08 d91a: 79 85 ldd r23, Y+9 ; 0x09 d91c: 8a 85 ldd r24, Y+10 ; 0x0a d91e: 9b 85 ldd r25, Y+11 ; 0x0b d920: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> d924: 87 ff sbrs r24, 7 d926: 04 c0 rjmp .+8 ; 0xd930 d928: c8 86 std Y+8, r12 ; 0x08 d92a: d9 86 std Y+9, r13 ; 0x09 d92c: ea 86 std Y+10, r14 ; 0x0a d92e: 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]; d930: c0 90 1d 02 lds r12, 0x021D ; 0x80021d d934: d0 90 1e 02 lds r13, 0x021E ; 0x80021e d938: e0 90 1f 02 lds r14, 0x021F ; 0x80021f d93c: f0 90 20 02 lds r15, 0x0220 ; 0x800220 d940: a7 01 movw r20, r14 d942: 96 01 movw r18, r12 d944: 68 85 ldd r22, Y+8 ; 0x08 d946: 79 85 ldd r23, Y+9 ; 0x09 d948: 8a 85 ldd r24, Y+10 ; 0x0a d94a: 9b 85 ldd r25, Y+11 ; 0x0b d94c: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> d950: 18 16 cp r1, r24 d952: 24 f4 brge .+8 ; 0xd95c d954: c8 86 std Y+8, r12 ; 0x08 d956: d9 86 std Y+9, r13 ; 0x09 d958: ea 86 std Y+10, r14 ; 0x0a d95a: fb 86 std Y+11, r15 ; 0x0b } } d95c: df 91 pop r29 d95e: cf 91 pop r28 d960: ff 90 pop r15 d962: ef 90 pop r14 d964: df 90 pop r13 d966: cf 90 pop r12 d968: 08 95 ret 0000d96a : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d96a: 2f 92 push r2 d96c: 3f 92 push r3 d96e: 4f 92 push r4 d970: 5f 92 push r5 d972: 6f 92 push r6 d974: 7f 92 push r7 d976: 8f 92 push r8 d978: 9f 92 push r9 d97a: af 92 push r10 d97c: bf 92 push r11 d97e: cf 92 push r12 d980: df 92 push r13 d982: ef 92 push r14 d984: ff 92 push r15 d986: 0f 93 push r16 d988: 1f 93 push r17 d98a: cf 93 push r28 d98c: df 93 push r29 d98e: cd b7 in r28, 0x3d ; 61 d990: de b7 in r29, 0x3e ; 62 d992: a2 97 sbiw r28, 0x22 ; 34 d994: 0f b6 in r0, 0x3f ; 63 d996: f8 94 cli d998: de bf out 0x3e, r29 ; 62 d99a: 0f be out 0x3f, r0 ; 63 d99c: cd bf out 0x3d, r28 ; 61 d99e: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d9a0: 82 e5 ldi r24, 0x52 ; 82 d9a2: 95 e0 ldi r25, 0x05 ; 5 d9a4: 0e 94 76 6c call 0xd8ec ; 0xd8ec previous_millis_cmd.start(); d9a8: 86 e8 ldi r24, 0x86 ; 134 d9aa: 93 e0 ldi r25, 0x03 ; 3 d9ac: 0f 94 26 42 call 0x2844c ; 0x2844c ::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])) { d9b0: 40 90 41 07 lds r4, 0x0741 ; 0x800741 d9b4: 50 90 42 07 lds r5, 0x0742 ; 0x800742 d9b8: 60 90 43 07 lds r6, 0x0743 ; 0x800743 d9bc: 70 90 44 07 lds r7, 0x0744 ; 0x800744 d9c0: c0 90 52 05 lds r12, 0x0552 ; 0x800552 d9c4: d0 90 53 05 lds r13, 0x0553 ; 0x800553 d9c8: e0 90 54 05 lds r14, 0x0554 ; 0x800554 d9cc: f0 90 55 05 lds r15, 0x0555 ; 0x800555 d9d0: a7 01 movw r20, r14 d9d2: 96 01 movw r18, r12 d9d4: c3 01 movw r24, r6 d9d6: b2 01 movw r22, r4 d9d8: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> d9dc: 81 11 cpse r24, r1 d9de: 3f c0 rjmp .+126 ; 0xda5e d9e0: 20 91 56 05 lds r18, 0x0556 ; 0x800556 d9e4: 30 91 57 05 lds r19, 0x0557 ; 0x800557 d9e8: 40 91 58 05 lds r20, 0x0558 ; 0x800558 d9ec: 50 91 59 05 lds r21, 0x0559 ; 0x800559 d9f0: 60 91 45 07 lds r22, 0x0745 ; 0x800745 d9f4: 70 91 46 07 lds r23, 0x0746 ; 0x800746 d9f8: 80 91 47 07 lds r24, 0x0747 ; 0x800747 d9fc: 90 91 48 07 lds r25, 0x0748 ; 0x800748 da00: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> da04: 81 11 cpse r24, r1 da06: 2b c0 rjmp .+86 ; 0xda5e plan_buffer_line_destinationXYZE(feedrate/60); da08: 20 e0 ldi r18, 0x00 ; 0 da0a: 30 e0 ldi r19, 0x00 ; 0 da0c: 40 e7 ldi r20, 0x70 ; 112 da0e: 52 e4 ldi r21, 0x42 ; 66 da10: 60 91 90 02 lds r22, 0x0290 ; 0x800290 da14: 70 91 91 02 lds r23, 0x0291 ; 0x800291 da18: 80 91 92 02 lds r24, 0x0292 ; 0x800292 da1c: 90 91 93 02 lds r25, 0x0293 ; 0x800293 da20: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> da24: 0f 94 58 ba call 0x374b0 ; 0x374b0 #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); da28: 0e 94 9d 5b call 0xb73a ; 0xb73a } da2c: a2 96 adiw r28, 0x22 ; 34 da2e: 0f b6 in r0, 0x3f ; 63 da30: f8 94 cli da32: de bf out 0x3e, r29 ; 62 da34: 0f be out 0x3f, r0 ; 63 da36: cd bf out 0x3d, r28 ; 61 da38: df 91 pop r29 da3a: cf 91 pop r28 da3c: 1f 91 pop r17 da3e: 0f 91 pop r16 da40: ff 90 pop r15 da42: ef 90 pop r14 da44: df 90 pop r13 da46: cf 90 pop r12 da48: bf 90 pop r11 da4a: af 90 pop r10 da4c: 9f 90 pop r9 da4e: 8f 90 pop r8 da50: 7f 90 pop r7 da52: 6f 90 pop r6 da54: 5f 90 pop r5 da56: 4f 90 pop r4 da58: 3f 90 pop r3 da5a: 2f 90 pop r2 da5c: 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); da5e: 60 91 39 02 lds r22, 0x0239 ; 0x800239 da62: 70 91 3a 02 lds r23, 0x023A ; 0x80023a da66: 07 2e mov r0, r23 da68: 00 0c add r0, r0 da6a: 88 0b sbc r24, r24 da6c: 99 0b sbc r25, r25 da6e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> da72: 20 91 90 02 lds r18, 0x0290 ; 0x800290 da76: 30 91 91 02 lds r19, 0x0291 ; 0x800291 da7a: 40 91 92 02 lds r20, 0x0292 ; 0x800292 da7e: 50 91 93 02 lds r21, 0x0293 ; 0x800293 da82: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> da86: 2e e3 ldi r18, 0x3E ; 62 da88: 33 ec ldi r19, 0xC3 ; 195 da8a: 4e e2 ldi r20, 0x2E ; 46 da8c: 59 e3 ldi r21, 0x39 ; 57 da8e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> da92: 6f 83 std Y+7, r22 ; 0x07 da94: 78 87 std Y+8, r23 ; 0x08 da96: 89 87 std Y+9, r24 ; 0x09 da98: 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) { da9a: 80 91 9e 13 lds r24, 0x139E ; 0x80139e da9e: 88 23 and r24, r24 daa0: 09 f4 brne .+2 ; 0xdaa4 daa2: 0f c1 rjmp .+542 ; 0xdcc2 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]; daa4: a3 01 movw r20, r6 daa6: 92 01 movw r18, r4 daa8: c7 01 movw r24, r14 daaa: b6 01 movw r22, r12 daac: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> dab0: 2b 01 movw r4, r22 dab2: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; dab4: 20 91 45 07 lds r18, 0x0745 ; 0x800745 dab8: 30 91 46 07 lds r19, 0x0746 ; 0x800746 dabc: 40 91 47 07 lds r20, 0x0747 ; 0x800747 dac0: 50 91 48 07 lds r21, 0x0748 ; 0x800748 dac4: 60 91 56 05 lds r22, 0x0556 ; 0x800556 dac8: 70 91 57 05 lds r23, 0x0557 ; 0x800557 dacc: 80 91 58 05 lds r24, 0x0558 ; 0x800558 dad0: 90 91 59 05 lds r25, 0x0559 ; 0x800559 dad4: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> dad8: 6b 87 std Y+11, r22 ; 0x0b dada: 7c 87 std Y+12, r23 ; 0x0c dadc: 8d 87 std Y+13, r24 ; 0x0d dade: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); dae0: c3 01 movw r24, r6 dae2: b2 01 movw r22, r4 dae4: 9f 77 andi r25, 0x7F ; 127 dae6: 2b 85 ldd r18, Y+11 ; 0x0b dae8: 3c 85 ldd r19, Y+12 ; 0x0c daea: 4d 85 ldd r20, Y+13 ; 0x0d daec: 5e 85 ldd r21, Y+14 ; 0x0e daee: 5f 77 andi r21, 0x7F ; 127 daf0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> daf4: 6b 01 movw r12, r22 daf6: 7c 01 movw r14, r24 if (len > 0) daf8: 20 e0 ldi r18, 0x00 ; 0 dafa: 30 e0 ldi r19, 0x00 ; 0 dafc: a9 01 movw r20, r18 dafe: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> db02: 18 16 cp r1, r24 db04: 0c f0 brlt .+2 ; 0xdb08 db06: dd c0 rjmp .+442 ; 0xdcc2 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); db08: 20 e0 ldi r18, 0x00 ; 0 db0a: 30 e0 ldi r19, 0x00 ; 0 db0c: 40 ef ldi r20, 0xF0 ; 240 db0e: 51 e4 ldi r21, 0x41 ; 65 db10: c7 01 movw r24, r14 db12: b6 01 movw r22, r12 db14: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> db18: 0f 94 8f df call 0x3bf1e ; 0x3bf1e db1c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> db20: 7e 83 std Y+6, r23 ; 0x06 db22: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { db24: 62 30 cpi r22, 0x02 ; 2 db26: 71 05 cpc r23, r1 db28: 08 f4 brcc .+2 ; 0xdb2c db2a: cb c0 rjmp .+406 ; 0xdcc2 db2c: 21 14 cp r2, r1 db2e: 31 04 cpc r3, r1 db30: 09 f4 brne .+2 ; 0xdb34 db32: c7 c0 rjmp .+398 ; 0xdcc2 float dz = z - current_position[Z_AXIS]; db34: 20 91 49 07 lds r18, 0x0749 ; 0x800749 db38: 30 91 4a 07 lds r19, 0x074A ; 0x80074a db3c: 40 91 4b 07 lds r20, 0x074B ; 0x80074b db40: 50 91 4c 07 lds r21, 0x074C ; 0x80074c db44: 60 91 5a 05 lds r22, 0x055A ; 0x80055a db48: 70 91 5b 05 lds r23, 0x055B ; 0x80055b db4c: 80 91 5c 05 lds r24, 0x055C ; 0x80055c db50: 90 91 5d 05 lds r25, 0x055D ; 0x80055d db54: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> db58: 6f 87 std Y+15, r22 ; 0x0f db5a: 78 8b std Y+16, r23 ; 0x10 db5c: 89 8b std Y+17, r24 ; 0x11 db5e: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; db60: 20 91 4d 07 lds r18, 0x074D ; 0x80074d db64: 30 91 4e 07 lds r19, 0x074E ; 0x80074e db68: 40 91 4f 07 lds r20, 0x074F ; 0x80074f db6c: 50 91 50 07 lds r21, 0x0750 ; 0x800750 db70: 60 91 5e 05 lds r22, 0x055E ; 0x80055e db74: 70 91 5f 05 lds r23, 0x055F ; 0x80055f db78: 80 91 60 05 lds r24, 0x0560 ; 0x800560 db7c: 90 91 61 05 lds r25, 0x0561 ; 0x800561 db80: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> db84: 6b 8b std Y+19, r22 ; 0x13 db86: 7c 8b std Y+20, r23 ; 0x14 db88: 8d 8b std Y+21, r24 ; 0x15 db8a: 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); db8c: ad 81 ldd r26, Y+5 ; 0x05 db8e: be 81 ldd r27, Y+6 ; 0x06 db90: cd 01 movw r24, r26 db92: b0 e0 ldi r27, 0x00 ; 0 db94: a0 e0 ldi r26, 0x00 ; 0 db96: 8f 8f std Y+31, r24 ; 0x1f db98: 98 a3 std Y+32, r25 ; 0x20 db9a: a9 a3 std Y+33, r26 ; 0x21 db9c: 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) { db9e: 2d 81 ldd r18, Y+5 ; 0x05 dba0: 3e 81 ldd r19, Y+6 ; 0x06 dba2: 22 16 cp r2, r18 dba4: 33 06 cpc r3, r19 dba6: 08 f0 brcs .+2 ; 0xdbaa dba8: 8c c0 rjmp .+280 ; 0xdcc2 float t = float(i) / float(n_segments); dbaa: b1 01 movw r22, r2 dbac: 90 e0 ldi r25, 0x00 ; 0 dbae: 80 e0 ldi r24, 0x00 ; 0 dbb0: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> dbb4: 6b 01 movw r12, r22 dbb6: 7c 01 movw r14, r24 dbb8: 6f 8d ldd r22, Y+31 ; 0x1f dbba: 78 a1 ldd r23, Y+32 ; 0x20 dbbc: 89 a1 ldd r24, Y+33 ; 0x21 dbbe: 9a a1 ldd r25, Y+34 ; 0x22 dbc0: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> dbc4: 9b 01 movw r18, r22 dbc6: ac 01 movw r20, r24 dbc8: c7 01 movw r24, r14 dbca: b6 01 movw r22, r12 dbcc: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> dbd0: 6b 01 movw r12, r22 dbd2: 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, dbd4: ac 01 movw r20, r24 dbd6: 9b 01 movw r18, r22 dbd8: 6b 89 ldd r22, Y+19 ; 0x13 dbda: 7c 89 ldd r23, Y+20 ; 0x14 dbdc: 8d 89 ldd r24, Y+21 ; 0x15 dbde: 9e 89 ldd r25, Y+22 ; 0x16 dbe0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> dbe4: 9b 01 movw r18, r22 dbe6: ac 01 movw r20, r24 dbe8: 60 91 4d 07 lds r22, 0x074D ; 0x80074d dbec: 70 91 4e 07 lds r23, 0x074E ; 0x80074e dbf0: 80 91 4f 07 lds r24, 0x074F ; 0x80074f dbf4: 90 91 50 07 lds r25, 0x0750 ; 0x800750 dbf8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> dbfc: 69 83 std Y+1, r22 ; 0x01 dbfe: 7a 83 std Y+2, r23 ; 0x02 dc00: 8b 83 std Y+3, r24 ; 0x03 dc02: 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, dc04: a7 01 movw r20, r14 dc06: 96 01 movw r18, r12 dc08: 6f 85 ldd r22, Y+15 ; 0x0f dc0a: 78 89 ldd r23, Y+16 ; 0x10 dc0c: 89 89 ldd r24, Y+17 ; 0x11 dc0e: 9a 89 ldd r25, Y+18 ; 0x12 dc10: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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, dc14: 20 91 49 07 lds r18, 0x0749 ; 0x800749 dc18: 30 91 4a 07 lds r19, 0x074A ; 0x80074a dc1c: 40 91 4b 07 lds r20, 0x074B ; 0x80074b dc20: 50 91 4c 07 lds r21, 0x074C ; 0x80074c dc24: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> dc28: 6f 8b std Y+23, r22 ; 0x17 dc2a: 78 8f std Y+24, r23 ; 0x18 dc2c: 89 8f std Y+25, r24 ; 0x19 dc2e: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, dc30: a7 01 movw r20, r14 dc32: 96 01 movw r18, r12 dc34: 6b 85 ldd r22, Y+11 ; 0x0b dc36: 7c 85 ldd r23, Y+12 ; 0x0c dc38: 8d 85 ldd r24, Y+13 ; 0x0d dc3a: 9e 85 ldd r25, Y+14 ; 0x0e dc3c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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, dc40: 20 91 45 07 lds r18, 0x0745 ; 0x800745 dc44: 30 91 46 07 lds r19, 0x0746 ; 0x800746 dc48: 40 91 47 07 lds r20, 0x0747 ; 0x800747 dc4c: 50 91 48 07 lds r21, 0x0748 ; 0x800748 dc50: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> dc54: 6b 8f std Y+27, r22 ; 0x1b dc56: 7c 8f std Y+28, r23 ; 0x1c dc58: 8d 8f std Y+29, r24 ; 0x1d dc5a: 9e 8f std Y+30, r25 ; 0x1e dc5c: a7 01 movw r20, r14 dc5e: 96 01 movw r18, r12 dc60: c3 01 movw r24, r6 dc62: b2 01 movw r22, r4 dc64: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> dc68: 20 91 41 07 lds r18, 0x0741 ; 0x800741 dc6c: 30 91 42 07 lds r19, 0x0742 ; 0x800742 dc70: 40 91 43 07 lds r20, 0x0743 ; 0x800743 dc74: 50 91 44 07 lds r21, 0x0744 ; 0x800744 dc78: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> dc7c: 3f 92 push r3 dc7e: 2f 92 push r2 dc80: a1 e4 ldi r26, 0x41 ; 65 dc82: b7 e0 ldi r27, 0x07 ; 7 dc84: bf 93 push r27 dc86: af 93 push r26 dc88: 8f 80 ldd r8, Y+7 ; 0x07 dc8a: 98 84 ldd r9, Y+8 ; 0x08 dc8c: a9 84 ldd r10, Y+9 ; 0x09 dc8e: ba 84 ldd r11, Y+10 ; 0x0a dc90: de 01 movw r26, r28 dc92: 11 96 adiw r26, 0x01 ; 1 dc94: 6d 01 movw r12, r26 dc96: ef 88 ldd r14, Y+23 ; 0x17 dc98: f8 8c ldd r15, Y+24 ; 0x18 dc9a: 09 8d ldd r16, Y+25 ; 0x19 dc9c: 1a 8d ldd r17, Y+26 ; 0x1a dc9e: 2b 8d ldd r18, Y+27 ; 0x1b dca0: 3c 8d ldd r19, Y+28 ; 0x1c dca2: 4d 8d ldd r20, Y+29 ; 0x1d dca4: 5e 8d ldd r21, Y+30 ; 0x1e dca6: 0f 94 36 ab call 0x3566c ; 0x3566c 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) dcaa: 0f 90 pop r0 dcac: 0f 90 pop r0 dcae: 0f 90 pop r0 dcb0: 0f 90 pop r0 dcb2: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b dcb6: 81 11 cpse r24, r1 dcb8: b7 ce rjmp .-658 ; 0xda28 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) { dcba: bf ef ldi r27, 0xFF ; 255 dcbc: 2b 1a sub r2, r27 dcbe: 3b 0a sbc r3, r27 dcc0: 6e cf rjmp .-292 ; 0xdb9e if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); dcc2: e0 90 5a 05 lds r14, 0x055A ; 0x80055a dcc6: f0 90 5b 05 lds r15, 0x055B ; 0x80055b dcca: 00 91 5c 05 lds r16, 0x055C ; 0x80055c dcce: 10 91 5d 05 lds r17, 0x055D ; 0x80055d dcd2: 20 91 56 05 lds r18, 0x0556 ; 0x800556 dcd6: 30 91 57 05 lds r19, 0x0557 ; 0x800557 dcda: 40 91 58 05 lds r20, 0x0558 ; 0x800558 dcde: 50 91 59 05 lds r21, 0x0559 ; 0x800559 dce2: 60 91 52 05 lds r22, 0x0552 ; 0x800552 dce6: 70 91 53 05 lds r23, 0x0553 ; 0x800553 dcea: 80 91 54 05 lds r24, 0x0554 ; 0x800554 dcee: 90 91 55 05 lds r25, 0x0555 ; 0x800555 dcf2: 1f 92 push r1 dcf4: 1f 92 push r1 dcf6: e1 e4 ldi r30, 0x41 ; 65 dcf8: f7 e0 ldi r31, 0x07 ; 7 dcfa: ff 93 push r31 dcfc: ef 93 push r30 dcfe: 8f 80 ldd r8, Y+7 ; 0x07 dd00: 98 84 ldd r9, Y+8 ; 0x08 dd02: a9 84 ldd r10, Y+9 ; 0x09 dd04: ba 84 ldd r11, Y+10 ; 0x0a dd06: ee e5 ldi r30, 0x5E ; 94 dd08: ce 2e mov r12, r30 dd0a: e5 e0 ldi r30, 0x05 ; 5 dd0c: de 2e mov r13, r30 dd0e: 0f 94 36 ab call 0x3566c ; 0x3566c dd12: 0f 90 pop r0 dd14: 0f 90 pop r0 dd16: 0f 90 pop r0 dd18: 0f 90 pop r0 dd1a: 86 ce rjmp .-756 ; 0xda28 0000dd1c : /// @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) { dd1c: cf 92 push r12 dd1e: df 92 push r13 dd20: ef 92 push r14 dd22: ff 92 push r15 dd24: cf 93 push r28 dd26: 9b 01 movw r18, r22 dd28: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; dd2a: c0 90 49 07 lds r12, 0x0749 ; 0x800749 dd2e: d0 90 4a 07 lds r13, 0x074A ; 0x80074a dd32: e0 90 4b 07 lds r14, 0x074B ; 0x80074b dd36: f0 90 4c 07 lds r15, 0x074C ; 0x80074c // Prepare to move Z axis current_position[Z_AXIS] += delta; dd3a: c7 01 movw r24, r14 dd3c: b6 01 movw r22, r12 dd3e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> dd42: 60 93 49 07 sts 0x0749, r22 ; 0x800749 dd46: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a dd4a: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b dd4e: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c #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); dd52: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) dd54: 90 91 40 07 lds r25, 0x0740 ; 0x800740 dd58: 91 11 cpse r25, r1 dd5a: 02 c0 rjmp .+4 ; 0xdd60 dd5c: 84 ff sbrs r24, 4 dd5e: 26 c0 rjmp .+76 ; 0xddac { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); dd60: 81 e4 ldi r24, 0x41 ; 65 dd62: 97 e0 ldi r25, 0x07 ; 7 dd64: 0e 94 76 6c call 0xd8ec ; 0xd8ec plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); dd68: e0 91 99 02 lds r30, 0x0299 ; 0x800299 dd6c: f0 91 9a 02 lds r31, 0x029A ; 0x80029a dd70: 60 85 ldd r22, Z+8 ; 0x08 dd72: 71 85 ldd r23, Z+9 ; 0x09 dd74: 82 85 ldd r24, Z+10 ; 0x0a dd76: 93 85 ldd r25, Z+11 ; 0x0b dd78: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); dd7c: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; dd80: a7 01 movw r20, r14 dd82: 96 01 movw r18, r12 dd84: 60 91 49 07 lds r22, 0x0749 ; 0x800749 dd88: 70 91 4a 07 lds r23, 0x074A ; 0x80074a dd8c: 80 91 4b 07 lds r24, 0x074B ; 0x80074b dd90: 90 91 4c 07 lds r25, 0x074C ; 0x80074c dd94: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> dd98: 6b 01 movw r12, r22 dd9a: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } dd9c: c7 01 movw r24, r14 dd9e: b6 01 movw r22, r12 dda0: cf 91 pop r28 dda2: ff 90 pop r15 dda4: ef 90 pop r14 dda6: df 90 pop r13 dda8: cf 90 pop r12 ddaa: 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(); ddac: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); ddae: 0f 94 24 59 call 0x2b248 ; 0x2b248 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); ddb2: 81 e0 ldi r24, 0x01 ; 1 ddb4: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 ddb8: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); ddba: 84 e0 ldi r24, 0x04 ; 4 ddbc: 0f 94 8b 3b call 0x27716 ; 0x27716 #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); ddc0: 65 e5 ldi r22, 0x55 ; 85 ddc2: 75 e5 ldi r23, 0x55 ; 85 ddc4: 85 e5 ldi r24, 0x55 ; 85 ddc6: 91 e4 ldi r25, 0x41 ; 65 ddc8: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); ddcc: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; ddd0: 82 e0 ldi r24, 0x02 ; 2 ddd2: 0f 94 10 59 call 0x2b220 ; 0x2b220 ddd6: a7 01 movw r20, r14 ddd8: 96 01 movw r18, r12 ddda: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> ddde: 6b 01 movw r12, r22 dde0: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) dde2: 0f 94 60 64 call 0x2c8c0 ; 0x2c8c0 dde6: 88 23 and r24, r24 dde8: 91 f0 breq .+36 ; 0xde0e { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; ddea: 80 91 1d 02 lds r24, 0x021D ; 0x80021d ddee: 90 91 1e 02 lds r25, 0x021E ; 0x80021e ddf2: a0 91 1f 02 lds r26, 0x021F ; 0x80021f ddf6: b0 91 20 02 lds r27, 0x0220 ; 0x800220 ddfa: 80 93 49 07 sts 0x0749, r24 ; 0x800749 ddfe: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a de02: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b de06: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_set_position_curposXYZE(); de0a: 0f 94 4b b9 call 0x37296 ; 0x37296 } tmc2130_home_exit(); de0e: 0f 94 5c 3b call 0x276b8 ; 0x276b8 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); de12: 8c 2f mov r24, r28 de14: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 de18: c1 cf rjmp .-126 ; 0xdd9c 0000de1a : // // 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) { de1a: 8f 92 push r8 de1c: 9f 92 push r9 de1e: af 92 push r10 de20: bf 92 push r11 de22: cf 92 push r12 de24: df 92 push r13 de26: ef 92 push r14 de28: ff 92 push r15 de2a: 4b 01 movw r8, r22 de2c: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) de2e: c0 90 49 07 lds r12, 0x0749 ; 0x800749 de32: d0 90 4a 07 lds r13, 0x074A ; 0x80074a de36: e0 90 4b 07 lds r14, 0x074B ; 0x80074b de3a: f0 90 4c 07 lds r15, 0x074C ; 0x80074c de3e: ac 01 movw r20, r24 de40: 9b 01 movw r18, r22 de42: c7 01 movw r24, r14 de44: b6 01 movw r22, r12 de46: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> de4a: 87 ff sbrs r24, 7 de4c: 11 c0 rjmp .+34 ; 0xde70 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); de4e: a5 01 movw r20, r10 de50: 94 01 movw r18, r8 de52: c7 01 movw r24, r14 de54: b6 01 movw r22, r12 de56: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> de5a: 9f 77 andi r25, 0x7F ; 127 } de5c: ff 90 pop r15 de5e: ef 90 pop r14 de60: df 90 pop r13 de62: cf 90 pop r12 de64: bf 90 pop r11 de66: af 90 pop r10 de68: 9f 90 pop r9 de6a: 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)); de6c: 0c 94 8e 6e jmp 0xdd1c ; 0xdd1c } de70: ff 90 pop r15 de72: ef 90 pop r14 de74: df 90 pop r13 de76: cf 90 pop r12 de78: bf 90 pop r11 de7a: af 90 pop r10 de7c: 9f 90 pop r9 de7e: 8f 90 pop r8 de80: 08 95 ret 0000de82 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { de82: ee e5 ldi r30, 0x5E ; 94 de84: 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; de86: 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]; de88: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty de8a: 8f 37 cpi r24, 0x7F ; 127 de8c: 31 f0 breq .+12 ; 0xde9a de8e: df 01 movw r26, r30 de90: 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 de92: 87 ff sbrs r24, 7 de94: 07 c0 rjmp .+14 ; 0xdea4 lcd_custom_characters[i] = c & 0x7F; de96: 8f 77 andi r24, 0x7F ; 127 de98: 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++) { de9a: 83 e0 ldi r24, 0x03 ; 3 de9c: e6 36 cpi r30, 0x66 ; 102 de9e: f8 07 cpc r31, r24 dea0: 99 f7 brne .-26 ; 0xde88 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } dea2: 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; dea4: 9c 93 st X, r25 dea6: f9 cf rjmp .-14 ; 0xde9a 0000dea8 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) dea8: 90 91 6d 02 lds r25, 0x026D ; 0x80026d deac: 98 17 cp r25, r24 deae: 10 f4 brcc .+4 ; 0xdeb4 lcd_draw_update = lcdDrawUpdateOverride; deb0: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; deb4: 80 91 6e 02 lds r24, 0x026E ; 0x80026e deb8: 88 23 and r24, r24 deba: 39 f0 breq .+14 ; 0xdeca if (lcd_lcdupdate_func) debc: e0 91 0d 04 lds r30, 0x040D ; 0x80040d dec0: f0 91 0e 04 lds r31, 0x040E ; 0x80040e dec4: 30 97 sbiw r30, 0x00 ; 0 dec6: 09 f0 breq .+2 ; 0xdeca lcd_lcdupdate_func(); dec8: 19 94 eijmp } deca: 08 95 ret 0000decc : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { decc: cf 93 push r28 dece: df 93 push r29 ded0: cd b7 in r28, 0x3d ; 61 ded2: de b7 in r29, 0x3e ; 62 ded4: ae 01 movw r20, r28 ded6: 4a 5f subi r20, 0xFA ; 250 ded8: 5f 4f sbci r21, 0xFF ; 255 deda: fa 01 movw r30, r20 dedc: 61 91 ld r22, Z+ dede: 71 91 ld r23, Z+ dee0: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); dee2: 8d ef ldi r24, 0xFD ; 253 dee4: 93 e0 ldi r25, 0x03 ; 3 dee6: 0f 94 d0 dc call 0x3b9a0 ; 0x3b9a0 va_end(args); return ret; } deea: df 91 pop r29 deec: cf 91 pop r28 deee: 08 95 ret 0000def0 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); def0: 6d ef ldi r22, 0xFD ; 253 def2: 73 e0 ldi r23, 0x03 ; 3 def4: 0d 94 21 dc jmp 0x3b842 ; 0x3b842 0000def8 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); def8: 6d ef ldi r22, 0xFD ; 253 defa: 73 e0 ldi r23, 0x03 ; 3 defc: 08 2e mov r0, r24 defe: 00 0c add r0, r0 df00: 99 0b sbc r25, r25 df02: 0d 94 f1 db jmp 0x3b7e2 ; 0x3b7e2 0000df06 : va_end(args); return ret; } void lcd_space(uint8_t n) { df06: cf 93 push r28 df08: c8 2f mov r28, r24 while (n--) lcd_putc(' '); df0a: c1 50 subi r28, 0x01 ; 1 df0c: 20 f0 brcs .+8 ; 0xdf16 df0e: 80 e2 ldi r24, 0x20 ; 32 df10: 0e 94 7c 6f call 0xdef8 ; 0xdef8 df14: fa cf rjmp .-12 ; 0xdf0a } df16: cf 91 pop r28 df18: 08 95 ret 0000df1a : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { df1a: cf 93 push r28 df1c: c8 2f mov r28, r24 df1e: 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); df20: 64 30 cpi r22, 0x04 ; 4 df22: 08 f0 brcs .+2 ; 0xdf26 df24: 83 e0 ldi r24, 0x03 ; 3 df26: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d } void lcd_set_cursor(uint8_t col, uint8_t row) { lcd_set_current_row(row); uint8_t addr = col + lcd_get_row_offset(lcd_currline); df2a: 0e 94 a7 5b call 0xb74e ; 0xb74e df2e: 8c 0f add r24, r28 lcd_ddram_address = addr; df30: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df34: 44 e6 ldi r20, 0x64 ; 100 df36: 50 e0 ldi r21, 0x00 ; 0 df38: 60 e0 ldi r22, 0x00 ; 0 df3a: 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); } df3c: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df3e: 0c 94 b4 64 jmp 0xc968 ; 0xc968 0000df42 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { df42: cf 93 push r28 df44: df 93 push r29 df46: ea 01 movw r28, r20 lcd_set_cursor(c, r); df48: 0e 94 8d 6f call 0xdf1a ; 0xdf1a return fputs_P(str, lcdout); df4c: 6d ef ldi r22, 0xFD ; 253 df4e: 73 e0 ldi r23, 0x03 ; 3 df50: ce 01 movw r24, r28 } df52: df 91 pop r29 df54: 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); df56: 0d 94 21 dc jmp 0x3b842 ; 0x3b842 0000df5a : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { df5a: cf 93 push r28 df5c: c4 2f mov r28, r20 lcd_set_cursor(c, r); df5e: 0e 94 8d 6f call 0xdf1a ; 0xdf1a return fputc(ch, lcdout); df62: 6d ef ldi r22, 0xFD ; 253 df64: 73 e0 ldi r23, 0x03 ; 3 df66: 8c 2f mov r24, r28 df68: cc 0f add r28, r28 df6a: 99 0b sbc r25, r25 } df6c: 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); df6e: 0d 94 f1 db jmp 0x3b7e2 ; 0x3b7e2 0000df72 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); df72: 60 e0 ldi r22, 0x00 ; 0 df74: 80 e0 ldi r24, 0x00 ; 0 df76: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_ddram_address = 0; df7a: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c } df7e: 08 95 ret 0000df80 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df80: 40 e4 ldi r20, 0x40 ; 64 df82: 56 e0 ldi r21, 0x06 ; 6 df84: 60 e0 ldi r22, 0x00 ; 0 df86: 81 e0 ldi r24, 0x01 ; 1 df88: 0e 94 b4 64 call 0xc968 ; 0xc968 // 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; df8c: 10 92 5d 03 sts 0x035D, r1 ; 0x80035d lcd_ddram_address = 0; df90: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); df94: 48 e0 ldi r20, 0x08 ; 8 df96: 50 e0 ldi r21, 0x00 ; 0 df98: 6f e7 ldi r22, 0x7F ; 127 df9a: 70 e0 ldi r23, 0x00 ; 0 df9c: 8e e5 ldi r24, 0x5E ; 94 df9e: 93 e0 ldi r25, 0x03 ; 3 dfa0: 0d 94 bb e3 jmp 0x3c776 ; 0x3c776 0000dfa4 : } 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) dfa4: 90 91 6e 02 lds r25, 0x026E ; 0x80026e dfa8: 98 17 cp r25, r24 dfaa: 09 f1 breq .+66 ; 0xdfee { lcd_update_enabled = enabled; dfac: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) dfb0: 88 23 and r24, r24 dfb2: e9 f0 breq .+58 ; 0xdfee { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; dfb4: 10 92 36 05 sts 0x0536, r1 ; 0x800536 dfb8: 10 92 35 05 sts 0x0535, r1 ; 0x800535 lcd_encoder_diff = 0; dfbc: 10 92 d0 05 sts 0x05D0, r1 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.560> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); dfc0: 86 ed ldi r24, 0xD6 ; 214 dfc2: 93 e0 ldi r25, 0x03 ; 3 dfc4: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; dfc8: 0f 94 83 3f call 0x27f06 ; 0x27f06 dfcc: 61 50 subi r22, 0x01 ; 1 dfce: 71 09 sbc r23, r1 dfd0: 81 09 sbc r24, r1 dfd2: 91 09 sbc r25, r1 dfd4: 60 93 d2 03 sts 0x03D2, r22 ; 0x8003d2 dfd8: 70 93 d3 03 sts 0x03D3, r23 ; 0x8003d3 dfdc: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 dfe0: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 // Full update. lcd_clear(); dfe4: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_update(2); dfe8: 82 e0 ldi r24, 0x02 ; 2 dfea: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 } else { // Clear the LCD always, or let it to the caller? } } } dfee: 08 95 ret 0000dff0 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { dff0: cf 93 push r28 dff2: c8 2f mov r28, r24 lcd_currline = 0; dff4: 10 92 5d 03 sts 0x035D, r1 ; 0x80035d lcd_ddram_address = 0; dff8: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); dffc: 48 e0 ldi r20, 0x08 ; 8 dffe: 50 e0 ldi r21, 0x00 ; 0 e000: 6f e7 ldi r22, 0x7F ; 127 e002: 70 e0 ldi r23, 0x00 ; 0 e004: 8e e5 ldi r24, 0x5E ; 94 e006: 93 e0 ldi r25, 0x03 ; 3 e008: 0f 94 bb e3 call 0x3c776 ; 0x3c776 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 e00c: 44 e9 ldi r20, 0x94 ; 148 e00e: 51 e1 ldi r21, 0x11 ; 17 e010: 62 e0 ldi r22, 0x02 ; 2 e012: 80 e3 ldi r24, 0x30 ; 48 e014: 0e 94 b4 64 call 0xc968 ; 0xc968 // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e018: 46 e9 ldi r20, 0x96 ; 150 e01a: 50 e0 ldi r21, 0x00 ; 0 e01c: 62 e0 ldi r22, 0x02 ; 2 e01e: 80 e3 ldi r24, 0x30 ; 48 e020: 0e 94 b4 64 call 0xc968 ; 0xc968 // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e024: 46 e9 ldi r20, 0x96 ; 150 e026: 50 e0 ldi r21, 0x00 ; 0 e028: 62 e0 ldi r22, 0x02 ; 2 e02a: 80 e3 ldi r24, 0x30 ; 48 e02c: 0e 94 b4 64 call 0xc968 ; 0xc968 #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); e030: 46 e9 ldi r20, 0x96 ; 150 e032: 50 e0 ldi r21, 0x00 ; 0 e034: 62 e0 ldi r22, 0x02 ; 2 e036: 80 e2 ldi r24, 0x20 ; 32 e038: 0e 94 b4 64 call 0xc968 ; 0xc968 #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); e03c: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL19lcd_displayfunction.lto_priv.570> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e040: 44 e6 ldi r20, 0x64 ; 100 e042: 50 e0 ldi r21, 0x00 ; 0 e044: 60 e0 ldi r22, 0x00 ; 0 e046: 80 62 ori r24, 0x20 ; 32 e048: 0e 94 b4 64 call 0xc968 ; 0xc968 } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; e04c: 84 e0 ldi r24, 0x04 ; 4 e04e: 80 93 5b 03 sts 0x035B, r24 ; 0x80035b delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e052: 44 e6 ldi r20, 0x64 ; 100 e054: 50 e0 ldi r21, 0x00 ; 0 e056: 60 e0 ldi r22, 0x00 ; 0 e058: 8c e0 ldi r24, 0x0C ; 12 e05a: 0e 94 b4 64 call 0xc968 ; 0xc968 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(); e05e: c1 11 cpse r28, r1 e060: 0e 94 c0 6f call 0xdf80 ; 0xdf80 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e064: 44 e6 ldi r20, 0x64 ; 100 e066: 50 e0 ldi r21, 0x00 ; 0 e068: 60 e0 ldi r22, 0x00 ; 0 e06a: 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); } e06c: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e06e: 0c 94 b4 64 jmp 0xc968 ; 0xc968 0000e072 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); e072: 81 e0 ldi r24, 0x01 ; 1 e074: 0c 94 f8 6f jmp 0xdff0 ; 0xdff0 0000e078 : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { e078: cf 92 push r12 e07a: df 92 push r13 e07c: ff 92 push r15 e07e: 0f 93 push r16 e080: 1f 93 push r17 e082: cf 93 push r28 e084: df 93 push r29 e086: 00 d0 rcall .+0 ; 0xe088 e088: 00 d0 rcall .+0 ; 0xe08a e08a: 1f 92 push r1 e08c: 1f 92 push r1 e08e: cd b7 in r28, 0x3d ; 61 e090: de b7 in r29, 0x3e ; 62 if (value == '\n') { e092: 8a 30 cpi r24, 0x0A ; 10 e094: d9 f4 brne .+54 ; 0xe0cc if (lcd_currline > 3) lcd_currline = -1; e096: 80 91 5d 03 lds r24, 0x035D ; 0x80035d e09a: 84 30 cpi r24, 0x04 ; 4 e09c: 18 f0 brcs .+6 ; 0xe0a4 e09e: 8f ef ldi r24, 0xFF ; 255 e0a0: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d lcd_set_cursor(0, lcd_currline + 1); // LF e0a4: 60 91 5d 03 lds r22, 0x035D ; 0x80035d e0a8: 6f 5f subi r22, 0xFF ; 255 e0aa: 80 e0 ldi r24, 0x00 ; 0 e0ac: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } e0b0: 28 96 adiw r28, 0x08 ; 8 e0b2: 0f b6 in r0, 0x3f ; 63 e0b4: f8 94 cli e0b6: de bf out 0x3e, r29 ; 62 e0b8: 0f be out 0x3f, r0 ; 63 e0ba: cd bf out 0x3d, r28 ; 61 e0bc: df 91 pop r29 e0be: cf 91 pop r28 e0c0: 1f 91 pop r17 e0c2: 0f 91 pop r16 e0c4: ff 90 pop r15 e0c6: df 90 pop r13 e0c8: cf 90 pop r12 e0ca: 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))) { e0cc: 90 e8 ldi r25, 0x80 ; 128 e0ce: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); e0d0: 44 e6 ldi r20, 0x64 ; 100 e0d2: 50 e0 ldi r21, 0x00 ; 0 e0d4: 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))) { e0d6: 9a 34 cpi r25, 0x4A ; 74 e0d8: 08 f5 brcc .+66 ; 0xe11c // 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. e0da: 48 2f mov r20, r24 e0dc: 40 58 subi r20, 0x80 ; 128 e0de: 55 0b sbc r21, r21 e0e0: 9a 01 movw r18, r20 e0e2: 96 e0 ldi r25, 0x06 ; 6 e0e4: 92 9f mul r25, r18 e0e6: a0 01 movw r20, r0 e0e8: 93 9f mul r25, r19 e0ea: 50 0d add r21, r0 e0ec: 11 24 eor r1, r1 e0ee: fa 01 movw r30, r20 e0f0: ef 5a subi r30, 0xAF ; 175 e0f2: f5 48 sbci r31, 0x85 ; 133 e0f4: f4 90 lpm r15, Z e0f6: ee e5 ldi r30, 0x5E ; 94 e0f8: f3 e0 ldi r31, 0x03 ; 3 e0fa: 30 e0 ldi r19, 0x00 ; 0 e0fc: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; e0fe: 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)) { e100: 61 91 ld r22, Z+ e102: 78 2f mov r23, r24 e104: 76 27 eor r23, r22 e106: 7f 77 andi r23, 0x7F ; 127 e108: 89 f4 brne .+34 ; 0xe12c lcd_custom_characters[i] = c; // mark the custom character as used e10a: f9 01 movw r30, r18 e10c: e2 5a subi r30, 0xA2 ; 162 e10e: fc 4f sbci r31, 0xFC ; 252 e110: 80 83 st Z, r24 e112: 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); e114: 44 e6 ldi r20, 0x64 ; 100 e116: 50 e0 ldi r21, 0x00 ; 0 e118: 61 e0 ldi r22, 0x01 ; 1 e11a: 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); e11c: 0e 94 b4 64 call 0xc968 ; 0xc968 lcd_ddram_address++; // no need for preventing ddram overflow e120: 80 91 5c 03 lds r24, 0x035C ; 0x80035c e124: 8f 5f subi r24, 0xFF ; 255 e126: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c e12a: c2 cf rjmp .-124 ; 0xe0b0 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 e12c: 6f 37 cpi r22, 0x7F ; 127 e12e: 09 f0 breq .+2 ; 0xe132 e130: 3c c0 rjmp .+120 ; 0xe1aa lcd_custom_characters[i] = c; // mark the custom character as used e132: f9 01 movw r30, r18 e134: e2 5a subi r30, 0xA2 ; 162 e136: fc 4f sbci r31, 0xFC ; 252 e138: 80 83 st Z, r24 slotToUse = i; e13a: 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; e13c: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e13e: fa 01 movw r30, r20 e140: e4 5b subi r30, 0xB4 ; 180 e142: f5 48 sbci r31, 0x85 ; 133 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e144: 8e 01 movw r16, r28 e146: 0f 5f subi r16, 0xFF ; 255 e148: 1f 4f sbci r17, 0xFF ; 255 e14a: d8 01 movw r26, r16 e14c: 95 91 lpm r25, Z+ e14e: 88 e0 ldi r24, 0x08 ; 8 e150: 18 2e mov r1, r24 0000e152 : e152: 10 fe sbrs r1, 0 e154: 05 90 lpm r0, Z+ e156: 02 94 swap r0 e158: 80 2d mov r24, r0 e15a: 97 95 ror r25 e15c: 88 1f adc r24, r24 e15e: 8d 93 st X+, r24 e160: 1a 94 dec r1 e162: b9 f7 brne .-18 ; 0xe152 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e164: bf 2d mov r27, r15 e166: e8 e0 ldi r30, 0x08 ; 8 e168: be 02 muls r27, r30 e16a: c0 01 movw r24, r0 e16c: 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); e16e: 44 e6 ldi r20, 0x64 ; 100 e170: 50 e0 ldi r21, 0x00 ; 0 e172: 60 e0 ldi r22, 0x00 ; 0 e174: 80 64 ori r24, 0x40 ; 64 e176: 0e 94 b4 64 call 0xc968 ; 0xc968 e17a: 6e 01 movw r12, r28 e17c: f9 e0 ldi r31, 0x09 ; 9 e17e: cf 0e add r12, r31 e180: 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); e182: 44 e6 ldi r20, 0x64 ; 100 e184: 50 e0 ldi r21, 0x00 ; 0 e186: 61 e0 ldi r22, 0x01 ; 1 e188: d8 01 movw r26, r16 e18a: 8d 91 ld r24, X+ e18c: 8d 01 movw r16, r26 e18e: 0e 94 b4 64 call 0xc968 ; 0xc968 : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e192: c0 16 cp r12, r16 e194: d1 06 cpc r13, r17 e196: a9 f7 brne .-22 ; 0xe182 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e198: 80 91 5c 03 lds r24, 0x035C ; 0x80035c delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e19c: 44 e6 ldi r20, 0x64 ; 100 e19e: 50 e0 ldi r21, 0x00 ; 0 e1a0: 60 e0 ldi r22, 0x00 ; 0 e1a2: 80 68 ori r24, 0x80 ; 128 e1a4: 0e 94 b4 64 call 0xc968 ; 0xc968 e1a8: b5 cf rjmp .-150 ; 0xe114 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 e1aa: 67 ff sbrs r22, 7 slotToUse = i; e1ac: 92 2f mov r25, r18 e1ae: 2f 5f subi r18, 0xFF ; 255 e1b0: 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++) { e1b2: 28 30 cpi r18, 0x08 ; 8 e1b4: 31 05 cpc r19, r1 e1b6: 09 f0 breq .+2 ; 0xe1ba e1b8: a3 cf rjmp .-186 ; 0xe100 } // 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) { e1ba: 9f 3f cpi r25, 0xFF ; 255 e1bc: 09 f0 breq .+2 ; 0xe1c0 e1be: be cf rjmp .-132 ; 0xe13c e1c0: a9 cf rjmp .-174 ; 0xe114 0000e1c2 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e1c2: 8f 92 push r8 e1c4: 9f 92 push r9 e1c6: af 92 push r10 e1c8: bf 92 push r11 e1ca: ef 92 push r14 e1cc: ff 92 push r15 e1ce: 0f 93 push r16 e1d0: 1f 93 push r17 e1d2: cf 93 push r28 e1d4: df 93 push r29 e1d6: cd b7 in r28, 0x3d ; 61 e1d8: de b7 in r29, 0x3e ; 62 e1da: a0 97 sbiw r28, 0x20 ; 32 e1dc: 0f b6 in r0, 0x3f ; 63 e1de: f8 94 cli e1e0: de bf out 0x3e, r29 ; 62 e1e2: 0f be out 0x3f, r0 ; 63 e1e4: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e1e6: 61 15 cp r22, r1 e1e8: 71 05 cpc r23, r1 e1ea: 81 05 cpc r24, r1 e1ec: 91 05 cpc r25, r1 e1ee: 99 f4 brne .+38 ; 0xe216 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e1f0: 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)); } e1f2: a0 96 adiw r28, 0x20 ; 32 e1f4: 0f b6 in r0, 0x3f ; 63 e1f6: f8 94 cli e1f8: de bf out 0x3e, r29 ; 62 e1fa: 0f be out 0x3f, r0 ; 63 e1fc: cd bf out 0x3d, r28 ; 61 e1fe: df 91 pop r29 e200: cf 91 pop r28 e202: 1f 91 pop r17 e204: 0f 91 pop r16 e206: ff 90 pop r15 e208: ef 90 pop r14 e20a: bf 90 pop r11 e20c: af 90 pop r10 e20e: 9f 90 pop r9 e210: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e212: 0c 94 3c 70 jmp 0xe078 ; 0xe078 } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e216: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e218: 84 2e mov r8, r20 e21a: 91 2c mov r9, r1 e21c: b1 2c mov r11, r1 e21e: a1 2c mov r10, r1 e220: 9e 01 movw r18, r28 e222: 2f 5f subi r18, 0xFF ; 255 e224: 3f 4f sbci r19, 0xFF ; 255 e226: 79 01 movw r14, r18 e228: a5 01 movw r20, r10 e22a: 94 01 movw r18, r8 e22c: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> e230: f7 01 movw r30, r14 e232: e0 0f add r30, r16 e234: f1 1d adc r31, r1 e236: 60 83 st Z, r22 n /= base; e238: b9 01 movw r22, r18 e23a: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e23c: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e23e: 61 15 cp r22, r1 e240: 71 05 cpc r23, r1 e242: 81 05 cpc r24, r1 e244: 91 05 cpc r25, r1 e246: 81 f7 brne .-32 ; 0xe228 e248: 0e 0d add r16, r14 e24a: 1f 2d mov r17, r15 e24c: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e24e: e0 16 cp r14, r16 e250: f1 06 cpc r15, r17 e252: 59 f0 breq .+22 ; 0xe26a lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e254: f8 01 movw r30, r16 e256: 82 91 ld r24, -Z e258: 8f 01 movw r16, r30 e25a: 8a 30 cpi r24, 0x0A ; 10 e25c: 20 f4 brcc .+8 ; 0xe266 e25e: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e260: 0e 94 3c 70 call 0xe078 ; 0xe078 e264: f4 cf rjmp .-24 ; 0xe24e { 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)); e266: 89 5c subi r24, 0xC9 ; 201 e268: fb cf rjmp .-10 ; 0xe260 } e26a: a0 96 adiw r28, 0x20 ; 32 e26c: 0f b6 in r0, 0x3f ; 63 e26e: f8 94 cli e270: de bf out 0x3e, r29 ; 62 e272: 0f be out 0x3f, r0 ; 63 e274: cd bf out 0x3d, r28 ; 61 e276: df 91 pop r29 e278: cf 91 pop r28 e27a: 1f 91 pop r17 e27c: 0f 91 pop r16 e27e: ff 90 pop r15 e280: ef 90 pop r14 e282: bf 90 pop r11 e284: af 90 pop r10 e286: 9f 90 pop r9 e288: 8f 90 pop r8 e28a: 08 95 ret 0000e28c : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e28c: cf 92 push r12 e28e: df 92 push r13 e290: ef 92 push r14 e292: ff 92 push r15 e294: 6b 01 movw r12, r22 e296: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e298: f7 fe sbrs r15, 7 e29a: 0b c0 rjmp .+22 ; 0xe2b2 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e29c: 8d e2 ldi r24, 0x2D ; 45 e29e: 0e 94 3c 70 call 0xe078 ; 0xe078 else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e2a2: f0 94 com r15 e2a4: e0 94 com r14 e2a6: d0 94 com r13 e2a8: c0 94 com r12 e2aa: c1 1c adc r12, r1 e2ac: d1 1c adc r13, r1 e2ae: e1 1c adc r14, r1 e2b0: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e2b2: 4a e0 ldi r20, 0x0A ; 10 e2b4: c7 01 movw r24, r14 e2b6: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e2b8: ff 90 pop r15 e2ba: ef 90 pop r14 e2bc: df 90 pop r13 e2be: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e2c0: 0c 94 e1 70 jmp 0xe1c2 ; 0xe1c2 0000e2c4 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e2c4: 0f 93 push r16 e2c6: 1f 93 push r17 e2c8: cf 93 push r28 e2ca: 8c 01 movw r16, r24 e2cc: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e2ce: cc 23 and r28, r28 e2d0: 59 f0 breq .+22 ; 0xe2e8 e2d2: f8 01 movw r30, r16 e2d4: 24 91 lpm r18, Z e2d6: 22 23 and r18, r18 e2d8: 39 f0 breq .+14 ; 0xe2e8 lcd_write(pgm_read_byte(s++)); e2da: 0f 5f subi r16, 0xFF ; 255 e2dc: 1f 4f sbci r17, 0xFF ; 255 e2de: 84 91 lpm r24, Z e2e0: 0e 94 3c 70 call 0xe078 ; 0xe078 --len; e2e4: c1 50 subi r28, 0x01 ; 1 e2e6: f3 cf rjmp .-26 ; 0xe2ce } lcd_space(len); e2e8: 8c 2f mov r24, r28 e2ea: 0e 94 83 6f call 0xdf06 ; 0xdf06 return len; } e2ee: 8c 2f mov r24, r28 e2f0: cf 91 pop r28 e2f2: 1f 91 pop r17 e2f4: 0f 91 pop r16 e2f6: 08 95 ret 0000e2f8 : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e2f8: 0f 93 push r16 e2fa: 1f 93 push r17 e2fc: cf 93 push r28 e2fe: 8c 01 movw r16, r24 e300: c6 2f mov r28, r22 while (len && *s) { e302: cc 23 and r28, r28 e304: 49 f0 breq .+18 ; 0xe318 e306: f8 01 movw r30, r16 e308: 81 91 ld r24, Z+ e30a: 8f 01 movw r16, r30 e30c: 88 23 and r24, r24 e30e: 21 f0 breq .+8 ; 0xe318 lcd_write(*(s++)); e310: 0e 94 3c 70 call 0xe078 ; 0xe078 --len; e314: c1 50 subi r28, 0x01 ; 1 e316: f5 cf rjmp .-22 ; 0xe302 } lcd_space(len); e318: 8c 2f mov r24, r28 e31a: 0e 94 83 6f call 0xdf06 ; 0xdf06 return len; } e31e: 8c 2f mov r24, r28 e320: cf 91 pop r28 e322: 1f 91 pop r17 e324: 0f 91 pop r16 e326: 08 95 ret 0000e328 : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e328: cf 93 push r28 e32a: df 93 push r29 e32c: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e32e: 89 91 ld r24, Y+ e330: 88 23 and r24, r24 e332: 19 f0 breq .+6 ; 0xe33a e334: 0e 94 3c 70 call 0xe078 ; 0xe078 e338: fa cf rjmp .-12 ; 0xe32e } e33a: df 91 pop r29 e33c: cf 91 pop r28 e33e: 08 95 ret 0000e340 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e340: 0e 94 3c 70 call 0xe078 ; 0xe078 return 0; } e344: 90 e0 ldi r25, 0x00 ; 0 e346: 80 e0 ldi r24, 0x00 ; 0 e348: 08 95 ret 0000e34a : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e34a: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 lcd_longpress_trigger = 0; e34e: 10 92 d3 05 sts 0x05D3, r1 ; 0x8005d3 } e352: 08 95 ret 0000e354 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e354: cf 93 push r28 bool clicked = LCD_CLICKED; e356: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 e35a: c1 e0 ldi r28, 0x01 ; 1 e35c: 81 11 cpse r24, r1 e35e: 04 c0 rjmp .+8 ; 0xe368 e360: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e362: 8c 2f mov r24, r28 e364: cf 91 pop r28 e366: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e368: 0e 94 a5 71 call 0xe34a ; 0xe34a e36c: fa cf rjmp .-12 ; 0xe362 0000e36e : 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 e36e: e0 e0 ldi r30, 0x00 ; 0 e370: f1 e0 ldi r31, 0x01 ; 1 e372: 85 91 lpm r24, Z+ e374: 95 91 lpm r25, Z+ e376: a5 91 lpm r26, Z+ e378: b4 91 lpm r27, Z e37a: 85 3a cpi r24, 0xA5 ; 165 e37c: 9a 45 sbci r25, 0x5A ; 90 e37e: a4 4b sbci r26, 0xB4 ; 180 e380: bb 44 sbci r27, 0x4B ; 75 e382: 29 f4 brne .+10 ; 0xe38e return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e384: ea e0 ldi r30, 0x0A ; 10 e386: f1 e0 ldi r31, 0x01 ; 1 e388: 85 91 lpm r24, Z+ e38a: 94 91 lpm r25, Z e38c: 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 e38e: 8f e3 ldi r24, 0x3F ; 63 e390: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e392: 08 95 ret 0000e394 : 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); e394: 8e ef ldi r24, 0xFE ; 254 e396: 9f e0 ldi r25, 0x0F ; 15 e398: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e39c: 8e 3f cpi r24, 0xFE ; 254 e39e: 39 f0 breq .+14 ; 0xe3ae e3a0: 91 e0 ldi r25, 0x01 ; 1 e3a2: 20 91 5a 03 lds r18, 0x035A ; 0x80035a e3a6: 28 13 cpse r18, r24 e3a8: 90 e0 ldi r25, 0x00 ; 0 e3aa: 89 2f mov r24, r25 e3ac: 08 95 ret e3ae: 80 e0 ldi r24, 0x00 ; 0 } e3b0: 08 95 ret 0000e3b2 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e3b2: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e3b6: 6e ef ldi r22, 0xFE ; 254 e3b8: 8e ef ldi r24, 0xFE ; 254 e3ba: 9f e0 ldi r25, 0x0F ; 15 e3bc: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0000e3c0 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e3c0: 85 37 cpi r24, 0x75 ; 117 e3c2: 28 e6 ldi r18, 0x68 ; 104 e3c4: 92 07 cpc r25, r18 e3c6: 09 f4 brne .+2 ; 0xe3ca e3c8: 59 c0 rjmp .+178 ; 0xe47c e3ca: f8 f4 brcc .+62 ; 0xe40a e3cc: 8e 36 cpi r24, 0x6E ; 110 e3ce: 25 e6 ldi r18, 0x65 ; 101 e3d0: 92 07 cpc r25, r18 e3d2: 09 f4 brne .+2 ; 0xe3d6 e3d4: 59 c0 rjmp .+178 ; 0xe488 e3d6: 50 f4 brcc .+20 ; 0xe3ec e3d8: 83 37 cpi r24, 0x73 ; 115 e3da: 23 e6 ldi r18, 0x63 ; 99 e3dc: 92 07 cpc r25, r18 e3de: b1 f1 breq .+108 ; 0xe44c e3e0: 85 36 cpi r24, 0x65 ; 101 e3e2: 94 46 sbci r25, 0x64 ; 100 e3e4: b1 f1 breq .+108 ; 0xe452 //#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("??"); e3e6: 80 e4 ldi r24, 0x40 ; 64 e3e8: 96 e6 ldi r25, 0x66 ; 102 e3ea: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e3ec: 82 37 cpi r24, 0x72 ; 114 e3ee: 26 e6 ldi r18, 0x66 ; 102 e3f0: 92 07 cpc r25, r18 e3f2: 91 f1 breq .+100 ; 0xe458 e3f4: 82 37 cpi r24, 0x72 ; 114 e3f6: 28 e6 ldi r18, 0x68 ; 104 e3f8: 92 07 cpc r25, r18 e3fa: 09 f4 brne .+2 ; 0xe3fe e3fc: 42 c0 rjmp .+132 ; 0xe482 e3fe: 83 37 cpi r24, 0x73 ; 115 e400: 95 46 sbci r25, 0x65 ; 101 e402: 89 f7 brne .-30 ; 0xe3e6 { 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"); e404: 87 e9 ldi r24, 0x97 ; 151 e406: 96 e6 ldi r25, 0x66 ; 102 e408: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e40a: 8c 36 cpi r24, 0x6C ; 108 e40c: 20 e7 ldi r18, 0x70 ; 112 e40e: 92 07 cpc r25, r18 e410: 31 f1 breq .+76 ; 0xe45e e412: 70 f4 brcc .+28 ; 0xe430 e414: 8c 36 cpi r24, 0x6C ; 108 e416: 2e e6 ldi r18, 0x6E ; 110 e418: 92 07 cpc r25, r18 e41a: 21 f1 breq .+72 ; 0xe464 e41c: 8f 36 cpi r24, 0x6F ; 111 e41e: 2e e6 ldi r18, 0x6E ; 110 e420: 92 07 cpc r25, r18 e422: 31 f1 breq .+76 ; 0xe470 e424: 84 37 cpi r24, 0x74 ; 116 e426: 99 46 sbci r25, 0x69 ; 105 e428: f1 f6 brne .-68 ; 0xe3e6 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"); e42a: 85 e8 ldi r24, 0x85 ; 133 e42c: 96 e6 ldi r25, 0x66 ; 102 e42e: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e430: 8b 36 cpi r24, 0x6B ; 107 e432: 23 e7 ldi r18, 0x73 ; 115 e434: 92 07 cpc r25, r18 e436: f9 f0 breq .+62 ; 0xe476 e438: 86 37 cpi r24, 0x76 ; 118 e43a: 23 e7 ldi r18, 0x73 ; 115 e43c: 92 07 cpc r25, r18 e43e: a9 f0 breq .+42 ; 0xe46a e440: 8f 36 cpi r24, 0x6F ; 111 e442: 92 47 sbci r25, 0x72 ; 114 e444: 81 f6 brne .-96 ; 0xe3e6 #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 e446: 83 e4 ldi r24, 0x43 ; 67 e448: 96 e6 ldi r25, 0x66 ; 102 e44a: 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"); e44c: 87 ea ldi r24, 0xA7 ; 167 e44e: 96 e6 ldi r25, 0x66 ; 102 e450: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e452: 8f e9 ldi r24, 0x9F ; 159 e454: 96 e6 ldi r25, 0x66 ; 102 e456: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e458: 8e e8 ldi r24, 0x8E ; 142 e45a: 96 e6 ldi r25, 0x66 ; 102 e45c: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e45e: 8e e7 ldi r24, 0x7E ; 126 e460: 96 e6 ldi r25, 0x66 ; 102 e462: 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 e464: 83 e7 ldi r24, 0x73 ; 115 e466: 96 e6 ldi r25, 0x66 ; 102 e468: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e46a: 8b e6 ldi r24, 0x6B ; 107 e46c: 96 e6 ldi r25, 0x66 ; 102 e46e: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e470: 85 e6 ldi r24, 0x65 ; 101 e472: 96 e6 ldi r25, 0x66 ; 102 e474: 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 e476: 8a e5 ldi r24, 0x5A ; 90 e478: 96 e6 ldi r25, 0x66 ; 102 e47a: 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 e47c: 83 e5 ldi r24, 0x53 ; 83 e47e: 96 e6 ldi r25, 0x66 ; 102 e480: 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 e482: 8a e4 ldi r24, 0x4A ; 74 e484: 96 e6 ldi r25, 0x66 ; 102 e486: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e488: 8f ea ldi r24, 0xAF ; 175 e48a: 96 e6 ldi r25, 0x66 ; 102 // case LANG_CODE_QR: return _n("New language"); //community contribution //#endif // COMMUNITY_LANG_GROUP1_QR #endif // COMMUNITY_LANGUAGE_SUPPORT } return _n("??"); } e48c: 08 95 ret 0000e48e : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e48e: cf 92 push r12 e490: df 92 push r13 e492: ef 92 push r14 e494: ff 92 push r15 e496: 1f 93 push r17 e498: cf 93 push r28 e49a: df 93 push r29 e49c: cd b7 in r28, 0x3d ; 61 e49e: de b7 in r29, 0x3e ; 62 e4a0: 60 97 sbiw r28, 0x10 ; 16 e4a2: 0f b6 in r0, 0x3f ; 63 e4a4: f8 94 cli e4a6: de bf out 0x3e, r29 ; 62 e4a8: 0f be out 0x3f, r0 ; 63 e4aa: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e4ac: 88 23 and r24, r24 e4ae: c1 f1 breq .+112 ; 0xe520 e4b0: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e4b2: 81 30 cpi r24, 0x01 ; 1 e4b4: 81 f4 brne .+32 ; 0xe4d6 e4b6: 0e 94 b7 71 call 0xe36e ; 0xe36e table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e4ba: 60 96 adiw r28, 0x10 ; 16 e4bc: 0f b6 in r0, 0x3f ; 63 e4be: f8 94 cli e4c0: de bf out 0x3e, r29 ; 62 e4c2: 0f be out 0x3f, r0 ; 63 e4c4: cd bf out 0x3d, r28 ; 61 e4c6: df 91 pop r29 e4c8: cf 91 pop r28 e4ca: 1f 91 pop r17 e4cc: ff 90 pop r15 e4ce: ef 90 pop r14 e4d0: df 90 pop r13 e4d2: cf 90 pop r12 e4d4: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e4d6: 8c e5 ldi r24, 0x5C ; 92 e4d8: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e4da: 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--; e4dc: 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; e4de: c1 2c mov r12, r1 e4e0: d1 2c mov r13, r1 e4e2: 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 e4e4: 20 e1 ldi r18, 0x10 ; 16 e4e6: 30 e0 ldi r19, 0x00 ; 0 e4e8: ae 01 movw r20, r28 e4ea: 4f 5f subi r20, 0xFF ; 255 e4ec: 5f 4f sbci r21, 0xFF ; 255 e4ee: c7 01 movw r24, r14 e4f0: b6 01 movw r22, r12 e4f2: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc if (header.magic != LANG_MAGIC) break; //break if not valid e4f6: 89 81 ldd r24, Y+1 ; 0x01 e4f8: 9a 81 ldd r25, Y+2 ; 0x02 e4fa: ab 81 ldd r26, Y+3 ; 0x03 e4fc: bc 81 ldd r27, Y+4 ; 0x04 e4fe: 85 3a cpi r24, 0xA5 ; 165 e500: 9a 45 sbci r25, 0x5A ; 90 e502: a4 4b sbci r26, 0xB4 ; 180 e504: bb 44 sbci r27, 0x4B ; 75 e506: 79 f4 brne .+30 ; 0xe526 if (--lang == 0) return header.code; e508: 11 50 subi r17, 0x01 ; 1 e50a: 19 f4 brne .+6 ; 0xe512 e50c: 8b 85 ldd r24, Y+11 ; 0x0b e50e: 9c 85 ldd r25, Y+12 ; 0x0c e510: d4 cf rjmp .-88 ; 0xe4ba addr += header.size; //calc address of next table e512: 8d 81 ldd r24, Y+5 ; 0x05 e514: 9e 81 ldd r25, Y+6 ; 0x06 e516: c8 0e add r12, r24 e518: d9 1e adc r13, r25 e51a: e1 1c adc r14, r1 e51c: f1 1c adc r15, r1 e51e: e2 cf rjmp .-60 ; 0xe4e4 return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e520: 8e e6 ldi r24, 0x6E ; 110 e522: 95 e6 ldi r25, 0x65 ; 101 e524: ca cf rjmp .-108 ; 0xe4ba 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; e526: 8f e3 ldi r24, 0x3F ; 63 e528: 9f e3 ldi r25, 0x3F ; 63 e52a: c7 cf rjmp .-114 ; 0xe4ba 0000e52c : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e52c: cf 92 push r12 e52e: df 92 push r13 e530: ef 92 push r14 e532: ff 92 push r15 e534: 1f 93 push r17 e536: cf 93 push r28 e538: df 93 push r29 e53a: cd b7 in r28, 0x3d ; 61 e53c: de b7 in r29, 0x3e ; 62 e53e: 60 97 sbiw r28, 0x10 ; 16 e540: 0f b6 in r0, 0x3f ; 63 e542: f8 94 cli e544: de bf out 0x3e, r29 ; 62 e546: 0f be out 0x3f, r0 ; 63 e548: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e54a: e8 e4 ldi r30, 0x48 ; 72 e54c: fa e7 ldi r31, 0x7A ; 122 e54e: 85 91 lpm r24, Z+ e550: 95 91 lpm r25, Z+ e552: a5 91 lpm r26, Z+ e554: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e556: 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) e558: 8f 3f cpi r24, 0xFF ; 255 e55a: 9f 4f sbci r25, 0xFF ; 255 e55c: af 4f sbci r26, 0xFF ; 255 e55e: bf 4f sbci r27, 0xFF ; 255 e560: 09 f1 breq .+66 ; 0xe5a4 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e562: 8c e5 ldi r24, 0x5C ; 92 e564: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e566: 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; e568: c1 2c mov r12, r1 e56a: d1 2c mov r13, r1 e56c: 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) e56e: 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 e570: 20 e1 ldi r18, 0x10 ; 16 e572: 30 e0 ldi r19, 0x00 ; 0 e574: ae 01 movw r20, r28 e576: 4f 5f subi r20, 0xFF ; 255 e578: 5f 4f sbci r21, 0xFF ; 255 e57a: c7 01 movw r24, r14 e57c: b6 01 movw r22, r12 e57e: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc if (header.magic != LANG_MAGIC) break; //break if magic not valid e582: 89 81 ldd r24, Y+1 ; 0x01 e584: 9a 81 ldd r25, Y+2 ; 0x02 e586: ab 81 ldd r26, Y+3 ; 0x03 e588: bc 81 ldd r27, Y+4 ; 0x04 e58a: 85 3a cpi r24, 0xA5 ; 165 e58c: 9a 45 sbci r25, 0x5A ; 90 e58e: a4 4b sbci r26, 0xB4 ; 180 e590: bb 44 sbci r27, 0x4B ; 75 e592: 41 f4 brne .+16 ; 0xe5a4 addr += header.size; //calc address of next table e594: 8d 81 ldd r24, Y+5 ; 0x05 e596: 9e 81 ldd r25, Y+6 ; 0x06 e598: c8 0e add r12, r24 e59a: d9 1e adc r13, r25 e59c: e1 1c adc r14, r1 e59e: f1 1c adc r15, r1 count++; //inc counter e5a0: 1f 5f subi r17, 0xFF ; 255 e5a2: e6 cf rjmp .-52 ; 0xe570 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e5a4: 81 2f mov r24, r17 e5a6: 60 96 adiw r28, 0x10 ; 16 e5a8: 0f b6 in r0, 0x3f ; 63 e5aa: f8 94 cli e5ac: de bf out 0x3e, r29 ; 62 e5ae: 0f be out 0x3f, r0 ; 63 e5b0: cd bf out 0x3d, r28 ; 61 e5b2: df 91 pop r29 e5b4: cf 91 pop r28 e5b6: 1f 91 pop r17 e5b8: ff 90 pop r15 e5ba: ef 90 pop r14 e5bc: df 90 pop r13 e5be: cf 90 pop r12 e5c0: 08 95 ret 0000e5c2 : 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) { e5c2: 0f 93 push r16 e5c4: 1f 93 push r17 e5c6: cf 93 push r28 e5c8: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e5ca: 81 11 cpse r24, r1 e5cc: 06 c0 rjmp .+12 ; 0xe5da { lang_table = 0; e5ce: 10 92 59 03 sts 0x0359, r1 ; 0x800359 e5d2: 10 92 58 03 sts 0x0358, r1 ; 0x800358 lang_selected = lang; e5d6: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a } #ifdef XFLASH if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; e5da: 8c 2f mov r24, r28 e5dc: 0e 94 47 72 call 0xe48e ; 0xe48e e5e0: 8c 01 movw r16, r24 e5e2: 0e 94 b7 71 call 0xe36e ; 0xe36e e5e6: 08 17 cp r16, r24 e5e8: 19 07 cpc r17, r25 e5ea: 19 f0 breq .+6 ; 0xe5f2 if (lang == LANG_ID_SEC) //current secondary language e5ec: c1 30 cpi r28, 0x01 ; 1 e5ee: 09 f0 breq .+2 ; 0xe5f2 e5f0: 3e c0 rjmp .+124 ; 0xe66e { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e5f2: e0 e0 ldi r30, 0x00 ; 0 e5f4: f1 e0 ldi r31, 0x01 ; 1 e5f6: 85 91 lpm r24, Z+ e5f8: 95 91 lpm r25, Z+ e5fa: a5 91 lpm r26, Z+ e5fc: b4 91 lpm r27, Z e5fe: 85 3a cpi r24, 0xA5 ; 165 e600: 9a 45 sbci r25, 0x5A ; 90 e602: a4 4b sbci r26, 0xB4 ; 180 e604: bb 44 sbci r27, 0x4B ; 75 e606: 09 f0 breq .+2 ; 0xe60a e608: 31 c0 rjmp .+98 ; 0xe66c } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e60a: e4 e0 ldi r30, 0x04 ; 4 e60c: f1 e0 ldi r31, 0x01 ; 1 e60e: 65 91 lpm r22, Z+ e610: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e612: e8 e0 ldi r30, 0x08 ; 8 e614: f1 e0 ldi r31, 0x01 ; 1 e616: 45 91 lpm r20, Z+ e618: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e61a: 30 e0 ldi r19, 0x00 ; 0 e61c: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e61e: 90 e0 ldi r25, 0x00 ; 0 e620: 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++) e622: 62 17 cp r22, r18 e624: 73 07 cpc r23, r19 e626: 89 f5 brne .+98 ; 0xe68a sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e628: 84 1b sub r24, r20 e62a: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e62c: 98 27 eor r25, r24 e62e: 89 27 eor r24, r25 e630: 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)) e632: 48 17 cp r20, r24 e634: 59 07 cpc r21, r25 e636: d1 f4 brne .+52 ; 0xe66c if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e638: ec e0 ldi r30, 0x0C ; 12 e63a: f1 e0 ldi r31, 0x01 ; 1 e63c: 45 91 lpm r20, Z+ e63e: 55 91 lpm r21, Z+ e640: 65 91 lpm r22, Z+ e642: 74 91 lpm r23, Z e644: e8 e4 ldi r30, 0x48 ; 72 e646: fa e7 ldi r31, 0x7A ; 122 e648: 85 91 lpm r24, Z+ e64a: 95 91 lpm r25, Z+ e64c: a5 91 lpm r26, Z+ e64e: b4 91 lpm r27, Z e650: 48 17 cp r20, r24 e652: 59 07 cpc r21, r25 e654: 6a 07 cpc r22, r26 e656: 7b 07 cpc r23, r27 e658: 49 f4 brne .+18 ; 0xe66c { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e65a: 80 e0 ldi r24, 0x00 ; 0 e65c: 91 e0 ldi r25, 0x01 ; 1 e65e: 90 93 59 03 sts 0x0359, r25 ; 0x800359 e662: 80 93 58 03 sts 0x0358, r24 ; 0x800358 lang_selected = lang; // set language id e666: 81 e0 ldi r24, 0x01 ; 1 e668: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a if (lang == LANG_ID_SEC) //current secondary language { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid { if (lang_check(_SEC_LANG_TABLE)) if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e66c: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e66e: 80 91 5a 03 lds r24, 0x035A ; 0x80035a e672: 8c 13 cpse r24, r28 e674: 1c c0 rjmp .+56 ; 0xe6ae { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e676: 6c 2f mov r22, r28 e678: 8e ef ldi r24, 0xFE ; 254 e67a: 9f e0 ldi r25, 0x0F ; 15 e67c: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a return 1; e680: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e682: cf 91 pop r28 e684: 1f 91 pop r17 e686: 0f 91 pop r16 e688: 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); e68a: f9 01 movw r30, r18 e68c: e0 50 subi r30, 0x00 ; 0 e68e: ff 4f sbci r31, 0xFF ; 255 e690: e4 91 lpm r30, Z e692: f0 e0 ldi r31, 0x00 ; 0 e694: a8 e0 ldi r26, 0x08 ; 8 e696: 20 fd sbrc r18, 0 e698: a0 e0 ldi r26, 0x00 ; 0 e69a: 02 c0 rjmp .+4 ; 0xe6a0 e69c: ee 0f add r30, r30 e69e: ff 1f adc r31, r31 e6a0: aa 95 dec r26 e6a2: e2 f7 brpl .-8 ; 0xe69c e6a4: 8e 0f add r24, r30 e6a6: 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++) e6a8: 2f 5f subi r18, 0xFF ; 255 e6aa: 3f 4f sbci r19, 0xFF ; 255 e6ac: ba cf rjmp .-140 ; 0xe622 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e6ae: 80 e0 ldi r24, 0x00 ; 0 e6b0: e8 cf rjmp .-48 ; 0xe682 0000e6b2 : //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. e6b2: 20 91 5a 03 lds r18, 0x035A ; 0x80035a e6b6: 21 11 cpse r18, r1 e6b8: 04 c0 rjmp .+8 ; 0xe6c2 e6ba: fc 01 movw r30, r24 e6bc: 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 } e6be: cf 01 movw r24, r30 e6c0: 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. e6c2: 40 91 58 03 lds r20, 0x0358 ; 0x800358 e6c6: 50 91 59 03 lds r21, 0x0359 ; 0x800359 e6ca: 41 15 cp r20, r1 e6cc: 51 05 cpc r21, r1 e6ce: a9 f3 breq .-22 ; 0xe6ba uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e6d0: fc 01 movw r30, r24 e6d2: 25 91 lpm r18, Z+ e6d4: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e6d6: 2f 3f cpi r18, 0xFF ; 255 e6d8: 32 07 cpc r19, r18 e6da: 79 f3 breq .-34 ; 0xe6ba ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e6dc: f9 01 movw r30, r18 e6de: 38 96 adiw r30, 0x08 ; 8 e6e0: ee 0f add r30, r30 e6e2: ff 1f adc r31, r31 e6e4: e4 0f add r30, r20 e6e6: f5 1f adc r31, r21 e6e8: 25 91 lpm r18, Z+ e6ea: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e6ec: fa 01 movw r30, r20 e6ee: e2 0f add r30, r18 e6f0: f3 1f adc r31, r19 e6f2: 24 91 lpm r18, Z e6f4: 22 23 and r18, r18 e6f6: 09 f3 breq .-62 ; 0xe6ba e6f8: e2 cf rjmp .-60 ; 0xe6be 0000e6fa : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e6fa: cf 93 push r28 e6fc: df 93 push r29 e6fe: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e700: 20 e0 ldi r18, 0x00 ; 0 e702: 30 e0 ldi r19, 0x00 ; 0 e704: 4c e8 ldi r20, 0x8C ; 140 e706: 52 e4 ldi r21, 0x42 ; 66 e708: 60 91 4d 07 lds r22, 0x074D ; 0x80074d e70c: 70 91 4e 07 lds r23, 0x074E ; 0x80074e e710: 80 91 4f 07 lds r24, 0x074F ; 0x80074f e714: 90 91 50 07 lds r25, 0x0750 ; 0x800750 e718: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> e71c: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d e720: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e e724: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f e728: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e72c: 60 e0 ldi r22, 0x00 ; 0 e72e: 70 e0 ldi r23, 0x00 ; 0 e730: 80 ea ldi r24, 0xA0 ; 160 e732: 91 e4 ldi r25, 0x41 ; 65 e734: 0f 94 8b ba call 0x37516 ; 0x37516 load_filament_final_feed(); e738: 0e 94 40 65 call 0xca80 ; 0xca80 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e73c: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e740: 86 e7 ldi r24, 0x76 ; 118 e742: 9c e5 ldi r25, 0x5C ; 92 e744: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 e748: ac 01 movw r20, r24 e74a: 60 e0 ldi r22, 0x00 ; 0 e74c: 80 e0 ldi r24, 0x00 ; 0 e74e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 if (filament_name[0]) { e752: 88 81 ld r24, Y e754: 88 23 and r24, r24 e756: 39 f0 breq .+14 ; 0xe766 lcd_set_cursor(0, 1); e758: 61 e0 ldi r22, 0x01 ; 1 e75a: 80 e0 ldi r24, 0x00 ; 0 e75c: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print(filament_name); e760: ce 01 movw r24, r28 e762: 0e 94 94 71 call 0xe328 ; 0xe328 } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e766: 89 e9 ldi r24, 0x99 ; 153 e768: 99 e3 ldi r25, 0x39 ; 57 e76a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 e76e: ac 01 movw r20, r24 e770: 62 e0 ldi r22, 0x02 ; 2 e772: 80 e0 ldi r24, 0x00 ; 0 e774: 0e 94 a1 6f call 0xdf42 ; 0xdf42 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 e778: 83 e4 ldi r24, 0x43 ; 67 e77a: 9b e2 ldi r25, 0x2B ; 43 e77c: 0f 94 c8 36 call 0x26d90 ; 0x26d90 lcd_loading_filament(filament_name); st_synchronize(); } e780: df 91 pop r29 e782: 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(); e784: 0d 94 24 59 jmp 0x2b248 ; 0x2b248 0000e788 : * 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; e788: 0f 94 d5 76 call 0x2edaa ; 0x2edaa e78c: 8f 3f cpi r24, 0xFF ; 255 e78e: 11 f1 breq .+68 ; 0xe7d4 lcd_update_enable(false); e790: 80 e0 ldi r24, 0x00 ; 0 e792: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_clear(); e796: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e79a: 82 ed ldi r24, 0xD2 ; 210 e79c: 98 e5 ldi r25, 0x58 ; 88 e79e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 e7a2: ac 01 movw r20, r24 e7a4: 61 e0 ldi r22, 0x01 ; 1 e7a6: 80 e0 ldi r24, 0x00 ; 0 e7a8: 0e 94 a1 6f call 0xdf42 ; 0xdf42 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e7ac: 80 e2 ldi r24, 0x20 ; 32 e7ae: 0e 94 3c 70 call 0xe078 ; 0xe078 lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e7b2: 0f 94 d5 76 call 0x2edaa ; 0x2edaa e7b6: 68 2f mov r22, r24 e7b8: 70 e0 ldi r23, 0x00 ; 0 e7ba: 6f 5f subi r22, 0xFF ; 255 e7bc: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e7be: 07 2e mov r0, r23 e7c0: 00 0c add r0, r0 e7c2: 88 0b sbc r24, r24 e7c4: 99 0b sbc r25, r25 e7c6: 0e 94 46 71 call 0xe28c ; 0xe28c // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e7ca: 0f 94 65 a0 call 0x340ca ; 0x340ca lcd_update_enable(true); e7ce: 81 e0 ldi r24, 0x01 ; 1 e7d0: 0c 94 d2 6f jmp 0xdfa4 ; 0xdfa4 } e7d4: 08 95 ret 0000e7d6 : } #ifdef TMC2130 bool calibrate_z_auto() { e7d6: 4f 92 push r4 e7d8: 5f 92 push r5 e7da: 6f 92 push r6 e7dc: 7f 92 push r7 e7de: 8f 92 push r8 e7e0: 9f 92 push r9 e7e2: af 92 push r10 e7e4: bf 92 push r11 e7e6: ef 92 push r14 e7e8: ff 92 push r15 e7ea: 0f 93 push r16 e7ec: 1f 93 push r17 e7ee: cf 93 push r28 e7f0: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e7f2: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e7f6: 85 ea ldi r24, 0xA5 ; 165 e7f8: 99 e4 ldi r25, 0x49 ; 73 e7fa: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 e7fe: ac 01 movw r20, r24 e800: 61 e0 ldi r22, 0x01 ; 1 e802: 80 e0 ldi r24, 0x00 ; 0 e804: 0e 94 a1 6f call 0xdf42 ; 0xdf42 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e808: d0 91 8f 02 lds r29, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; e80c: 81 e0 ldi r24, 0x01 ; 1 e80e: 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); e812: e6 ed ldi r30, 0xD6 ; 214 e814: fc e7 ldi r31, 0x7C ; 124 e816: 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); e818: 84 e0 ldi r24, 0x04 ; 4 e81a: 0f 94 8b 3b call 0x27716 ; 0x27716 current_position[Z_AXIS] = 0; e81e: 81 e4 ldi r24, 0x41 ; 65 e820: e8 2e mov r14, r24 e822: 87 e0 ldi r24, 0x07 ; 7 e824: f8 2e mov r15, r24 e826: f7 01 movw r30, r14 e828: 10 86 std Z+8, r1 ; 0x08 e82a: 11 86 std Z+9, r1 ; 0x09 e82c: 12 86 std Z+10, r1 ; 0x0a e82e: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e830: 0f 94 4b b9 call 0x37296 ; 0x37296 set_destination_to_current(); e834: 0e 94 e7 68 call 0xd1ce ; 0xd1ce #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); e838: e0 ed ldi r30, 0xD0 ; 208 e83a: fc e7 ldi r31, 0x7C ; 124 e83c: 85 90 lpm r8, Z+ e83e: 95 90 lpm r9, Z+ e840: a5 90 lpm r10, Z+ e842: 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); e844: 02 e5 ldi r16, 0x52 ; 82 e846: 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); e848: 8c 2f mov r24, r28 e84a: 99 27 eor r25, r25 e84c: 81 95 neg r24 e84e: 0c f4 brge .+2 ; 0xe852 e850: 90 95 com r25 e852: 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); e854: 07 2e mov r0, r23 e856: 00 0c add r0, r0 e858: 88 0b sbc r24, r24 e85a: 99 0b sbc r25, r25 e85c: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> e860: 2b 01 movw r4, r22 e862: 3c 01 movw r6, r24 e864: 2d ec ldi r18, 0xCD ; 205 e866: 3c ec ldi r19, 0xCC ; 204 e868: 4c e8 ldi r20, 0x8C ; 140 e86a: 5f e3 ldi r21, 0x3F ; 63 e86c: c5 01 movw r24, r10 e86e: b4 01 movw r22, r8 e870: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> e874: 9b 01 movw r18, r22 e876: ac 01 movw r20, r24 e878: c3 01 movw r24, r6 e87a: b2 01 movw r22, r4 e87c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> e880: f8 01 movw r30, r16 e882: 20 85 ldd r18, Z+8 ; 0x08 e884: 31 85 ldd r19, Z+9 ; 0x09 e886: 42 85 ldd r20, Z+10 ; 0x0a e888: 53 85 ldd r21, Z+11 ; 0x0b e88a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> e88e: f8 01 movw r30, r16 e890: 60 87 std Z+8, r22 ; 0x08 e892: 71 87 std Z+9, r23 ; 0x09 e894: 82 87 std Z+10, r24 ; 0x0a e896: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e898: 80 e0 ldi r24, 0x00 ; 0 e89a: 90 e0 ldi r25, 0x00 ; 0 e89c: a8 e4 ldi r26, 0x48 ; 72 e89e: b4 e4 ldi r27, 0x44 ; 68 e8a0: 80 93 90 02 sts 0x0290, r24 ; 0x800290 e8a4: 90 93 91 02 sts 0x0291, r25 ; 0x800291 e8a8: a0 93 92 02 sts 0x0292, r26 ; 0x800292 e8ac: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); e8b0: 65 e5 ldi r22, 0x55 ; 85 e8b2: 75 e5 ldi r23, 0x55 ; 85 e8b4: 85 e5 ldi r24, 0x55 ; 85 e8b6: 91 e4 ldi r25, 0x41 ; 65 e8b8: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); e8bc: 0f 94 24 59 call 0x2b248 ; 0x2b248 // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e8c0: 0f 94 5c 3b call 0x276b8 ; 0x276b8 e8c4: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[Z_AXIS] = 0; e8c8: f7 01 movw r30, r14 e8ca: 10 86 std Z+8, r1 ; 0x08 e8cc: 11 86 std Z+9, r1 ; 0x09 e8ce: 12 86 std Z+10, r1 ; 0x0a e8d0: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e8d2: 0f 94 4b b9 call 0x37296 ; 0x37296 set_destination_to_current(); e8d6: 0e 94 e7 68 call 0xd1ce ; 0xd1ce destination[Z_AXIS] += 10 * axis_up_dir; //10mm up e8da: f6 ef ldi r31, 0xF6 ; 246 e8dc: cf 02 muls r28, r31 e8de: b0 01 movw r22, r0 e8e0: 11 24 eor r1, r1 e8e2: 07 2e mov r0, r23 e8e4: 00 0c add r0, r0 e8e6: 88 0b sbc r24, r24 e8e8: 99 0b sbc r25, r25 e8ea: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> e8ee: 9b 01 movw r18, r22 e8f0: ac 01 movw r20, r24 e8f2: f8 01 movw r30, r16 e8f4: 60 85 ldd r22, Z+8 ; 0x08 e8f6: 71 85 ldd r23, Z+9 ; 0x09 e8f8: 82 85 ldd r24, Z+10 ; 0x0a e8fa: 93 85 ldd r25, Z+11 ; 0x0b e8fc: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> e900: f8 01 movw r30, r16 e902: 60 87 std Z+8, r22 ; 0x08 e904: 71 87 std Z+9, r23 ; 0x09 e906: 82 87 std Z+10, r24 ; 0x0a e908: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; e90a: 80 e0 ldi r24, 0x00 ; 0 e90c: 90 e0 ldi r25, 0x00 ; 0 e90e: a8 ec ldi r26, 0xC8 ; 200 e910: b3 e4 ldi r27, 0x43 ; 67 e912: 80 93 90 02 sts 0x0290, r24 ; 0x800290 e916: 90 93 91 02 sts 0x0291, r25 ; 0x800291 e91a: a0 93 92 02 sts 0x0292, r26 ; 0x800292 e91e: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); e922: 65 e5 ldi r22, 0x55 ; 85 e924: 75 e5 ldi r23, 0x55 ; 85 e926: 85 ed ldi r24, 0xD5 ; 213 e928: 90 e4 ldi r25, 0x40 ; 64 e92a: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); e92e: 0f 94 24 59 call 0x2b248 ; 0x2b248 e932: 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; e936: 80 e0 ldi r24, 0x00 ; 0 e938: 90 e0 ldi r25, 0x00 ; 0 e93a: ab e5 ldi r26, 0x5B ; 91 e93c: b3 e4 ldi r27, 0x43 ; 67 e93e: f7 01 movw r30, r14 e940: 80 87 std Z+8, r24 ; 0x08 e942: 91 87 std Z+9, r25 ; 0x09 e944: a2 87 std Z+10, r26 ; 0x0a e946: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); e948: 0f 94 4b b9 call 0x37296 ; 0x37296 return true; } e94c: 81 e0 ldi r24, 0x01 ; 1 e94e: df 91 pop r29 e950: cf 91 pop r28 e952: 1f 91 pop r17 e954: 0f 91 pop r16 e956: ff 90 pop r15 e958: ef 90 pop r14 e95a: bf 90 pop r11 e95c: af 90 pop r10 e95e: 9f 90 pop r9 e960: 8f 90 pop r8 e962: 7f 90 pop r7 e964: 6f 90 pop r6 e966: 5f 90 pop r5 e968: 4f 90 pop r4 e96a: 08 95 ret 0000e96c : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { e96c: cf 93 push r28 e96e: df 93 push r29 e970: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; e972: 60 ff sbrs r22, 0 e974: 03 c0 rjmp .+6 ; 0xe97c e976: 28 e5 ldi r18, 0x58 ; 88 e978: 28 83 st Y, r18 e97a: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; e97c: 61 ff sbrs r22, 1 e97e: 03 c0 rjmp .+6 ; 0xe986 e980: 29 e5 ldi r18, 0x59 ; 89 e982: 28 83 st Y, r18 e984: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; e986: 80 e2 ldi r24, 0x20 ; 32 e988: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); e98a: 80 e0 ldi r24, 0x00 ; 0 e98c: 96 e3 ldi r25, 0x36 ; 54 e98e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 e992: bc 01 movw r22, r24 e994: ce 01 movw r24, r28 } e996: df 91 pop r29 e998: 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)); e99a: 0d 94 40 db jmp 0x3b680 ; 0x3b680 0000e99e <__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 { e99e: 1f 92 push r1 e9a0: 0f 92 push r0 e9a2: 0f b6 in r0, 0x3f ; 63 e9a4: 0f 92 push r0 e9a6: 11 24 eor r1, r1 e9a8: 0b b6 in r0, 0x3b ; 59 e9aa: 0f 92 push r0 e9ac: 2f 93 push r18 e9ae: 8f 93 push r24 e9b0: 9f 93 push r25 e9b2: ef 93 push r30 e9b4: ff 93 push r31 switch(state){ e9b6: e0 91 53 03 lds r30, 0x0353 ; 0x800353 e9ba: e8 30 cpi r30, 0x08 ; 8 e9bc: e8 f4 brcc .+58 ; 0xe9f8 <__vector_23+0x5a> e9be: f0 e0 ldi r31, 0x00 ; 0 e9c0: 88 27 eor r24, r24 e9c2: ea 51 subi r30, 0x1A ; 26 e9c4: fb 48 sbci r31, 0x8B ; 139 e9c6: 8f 4f sbci r24, 0xFF ; 255 e9c8: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> e9cc: ee 74 andi r30, 0x4E ; 78 e9ce: 08 75 andi r16, 0x58 ; 88 e9d0: 13 75 andi r17, 0x53 ; 83 e9d2: 21 75 andi r18, 0x51 ; 81 e9d4: 37 75 andi r19, 0x57 ; 87 e9d6: 40 75 andi r20, 0x50 ; 80 e9d8: 63 75 andi r22, 0x53 ; 83 e9da: 75 75 andi r23, 0x55 ; 85 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin e9dc: 80 91 6b 06 lds r24, 0x066B ; 0x80066b e9e0: 81 11 cpse r24, r1 e9e2: 0a c0 rjmp .+20 ; 0xe9f8 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! e9e4: 80 91 18 06 lds r24, 0x0618 ; 0x800618 e9e8: 88 0f add r24, r24 e9ea: 80 93 52 03 sts 0x0352, r24 ; 0x800352 if( pwm != 0 ){ e9ee: 88 23 and r24, r24 e9f0: 19 f0 breq .+6 ; 0xe9f8 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period e9f2: 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 e9f4: 80 93 53 03 sts 0x0353, r24 ; 0x800353 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } e9f8: ff 91 pop r31 e9fa: ef 91 pop r30 e9fc: 9f 91 pop r25 e9fe: 8f 91 pop r24 ea00: 2f 91 pop r18 ea02: 0f 90 pop r0 ea04: 0b be out 0x3b, r0 ; 59 ea06: 0f 90 pop r0 ea08: 0f be out 0x3f, r0 ; 63 ea0a: 0f 90 pop r0 ea0c: 1f 90 pop r1 ea0e: 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) ea10: 80 91 51 03 lds r24, 0x0351 ; 0x800351 ea14: 8f 5f subi r24, 0xFF ; 255 ea16: 80 93 51 03 sts 0x0351, r24 ; 0x800351 if( slowCounter > pwm ){ ea1a: 90 91 52 03 lds r25, 0x0352 ; 0x800352 ea1e: 98 17 cp r25, r24 ea20: 58 f3 brcs .-42 ; 0xe9f8 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 ea22: 82 e0 ldi r24, 0x02 ; 2 ea24: e7 cf rjmp .-50 ; 0xe9f4 <__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 ea26: 83 e0 ldi r24, 0x03 ; 3 ea28: 80 93 53 03 sts 0x0353, r24 ; 0x800353 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ea2c: 8f e0 ldi r24, 0x0F ; 15 ea2e: 80 93 50 03 sts 0x0350, r24 ; 0x800350 TCNT0 = 255; // force overflow on the next clock cycle ea32: 8f ef ldi r24, 0xFF ; 255 ea34: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ea36: 81 e0 ldi r24, 0x01 ; 1 ea38: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) ea3a: 84 b5 in r24, 0x24 ; 36 ea3c: 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 ea3e: 84 bd out 0x24, r24 ; 36 ea40: db cf rjmp .-74 ; 0xe9f8 <__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; ea42: 80 91 50 03 lds r24, 0x0350 ; 0x800350 ea46: 82 95 swap r24 ea48: 80 7f andi r24, 0xF0 ; 240 ea4a: 81 95 neg r24 ea4c: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ ea4e: 80 91 50 03 lds r24, 0x0350 ; 0x800350 ea52: 88 23 and r24, r24 ea54: 21 f0 breq .+8 ; 0xea5e <__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; ea56: 81 50 subi r24, 0x01 ; 1 ea58: 80 93 50 03 sts 0x0350, r24 ; 0x800350 ea5c: cd cf rjmp .-102 ; 0xe9f8 <__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; ea5e: 84 e0 ldi r24, 0x04 ; 4 ea60: 80 93 53 03 sts 0x0353, r24 ; 0x800353 OCR0B = 255; // full duty ea64: 8f ef ldi r24, 0xFF ; 255 ea66: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle ea68: 8e ef ldi r24, 0xFE ; 254 ea6a: 86 bd out 0x26, r24 ; 38 ea6c: c5 cf rjmp .-118 ; 0xe9f8 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; ea6e: 85 e0 ldi r24, 0x05 ; 5 ea70: 80 93 53 03 sts 0x0353, r24 ; 0x800353 OCR0B = 255; // full duty ea74: 8f ef ldi r24, 0xFF ; 255 ea76: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle ea78: 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 ea7a: 82 e0 ldi r24, 0x02 ; 2 ea7c: 85 bd out 0x25, r24 ; 37 ea7e: bc cf rjmp .-136 ; 0xe9f8 <__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; ea80: 2f ef ldi r18, 0xFF ; 255 ea82: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin ea84: 80 91 6b 06 lds r24, 0x066B ; 0x80066b ea88: 81 11 cpse r24, r1 ea8a: b6 cf rjmp .-148 ; 0xe9f8 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less ea8c: 80 91 51 03 lds r24, 0x0351 ; 0x800351 ea90: 8f 5f subi r24, 0xFF ; 255 ea92: 80 93 51 03 sts 0x0351, r24 ; 0x800351 if( slowCounter < pwm ){ ea96: 90 91 52 03 lds r25, 0x0352 ; 0x800352 ea9a: 89 17 cp r24, r25 ea9c: 08 f4 brcc .+2 ; 0xeaa0 <__vector_23+0x102> ea9e: ac cf rjmp .-168 ; 0xe9f8 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain eaa0: 80 91 18 06 lds r24, 0x0618 ; 0x800618 eaa4: 90 e0 ldi r25, 0x00 ; 0 eaa6: 8f 37 cpi r24, 0x7F ; 127 eaa8: 91 05 cpc r25, r1 eaaa: 0c f0 brlt .+2 ; 0xeaae <__vector_23+0x110> eaac: a5 cf rjmp .-182 ; 0xe9f8 <__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; eaae: 86 e0 ldi r24, 0x06 ; 6 eab0: 80 93 53 03 sts 0x0353, r24 ; 0x800353 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE eab4: 8f e0 ldi r24, 0x0F ; 15 eab6: 80 93 50 03 sts 0x0350, r24 ; 0x800350 TCNT0 = 255; // force overflow on the next clock cycle eaba: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz eabc: 81 e0 ldi r24, 0x01 ; 1 eabe: 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 eac0: 84 b5 in r24, 0x24 ; 36 eac2: 80 61 ori r24, 0x10 ; 16 eac4: bc cf rjmp .-136 ; 0xea3e <__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 eac6: 80 91 50 03 lds r24, 0x0350 ; 0x800350 eaca: 82 95 swap r24 eacc: 80 7f andi r24, 0xF0 ; 240 eace: 81 95 neg r24 ead0: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ ead2: 80 91 50 03 lds r24, 0x0350 ; 0x800350 ead6: 81 11 cpse r24, r1 ead8: be cf rjmp .-132 ; 0xea56 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; eada: 87 e0 ldi r24, 0x07 ; 7 eadc: 80 93 53 03 sts 0x0353, r24 ; 0x800353 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes eae0: 80 e8 ldi r24, 0x80 ; 128 eae2: 86 bd out 0x26, r24 ; 38 OCR0B = 255; eae4: 8f ef ldi r24, 0xFF ; 255 eae6: 88 bd out 0x28, r24 ; 40 eae8: 87 cf rjmp .-242 ; 0xe9f8 <__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 eaea: 10 92 53 03 sts 0x0353, r1 ; 0x800353 TCNT0 = 128; eaee: 80 e8 ldi r24, 0x80 ; 128 eaf0: 86 bd out 0x26, r24 ; 38 OCR0B = 255; eaf2: 8f ef ldi r24, 0xFF ; 255 eaf4: 88 bd out 0x28, r24 ; 40 eaf6: c1 cf rjmp .-126 ; 0xea7a <__vector_23+0xdc> 0000eaf8 : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { eaf8: cf 93 push r28 eafa: df 93 push r29 eafc: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); eafe: 87 e6 ldi r24, 0x67 ; 103 eb00: 9f e0 ldi r25, 0x0F ; 15 eb02: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 eb06: 91 e0 ldi r25, 0x01 ; 1 eb08: 81 11 cpse r24, r1 eb0a: 01 c0 rjmp .+2 ; 0xeb0e eb0c: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { eb0e: 81 e0 ldi r24, 0x01 ; 1 eb10: 28 81 ld r18, Y eb12: 21 11 cpse r18, r1 eb14: 01 c0 rjmp .+2 ; 0xeb18 eb16: 80 e0 ldi r24, 0x00 ; 0 eb18: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; eb1a: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); eb1c: 87 e0 ldi r24, 0x07 ; 7 eb1e: 9f e0 ldi r25, 0x0F ; 15 eb20: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 eb24: 91 e0 ldi r25, 0x01 ; 1 eb26: 81 11 cpse r24, r1 eb28: 01 c0 rjmp .+2 ; 0xeb2c eb2a: 90 e0 ldi r25, 0x00 ; 0 eb2c: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); eb2e: 85 ed ldi r24, 0xD5 ; 213 eb30: 9e e0 ldi r25, 0x0E ; 14 eb32: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 eb36: 91 e0 ldi r25, 0x01 ; 1 eb38: 81 11 cpse r24, r1 eb3a: 01 c0 rjmp .+2 ; 0xeb3e eb3c: 90 e0 ldi r25, 0x00 ; 0 eb3e: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); eb40: 87 e4 ldi r24, 0x47 ; 71 eb42: 9d e0 ldi r25, 0x0D ; 13 eb44: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 if (sensorActionOnError == SensorActionOnError::_Undef) { eb48: 8f 3f cpi r24, 0xFF ; 255 eb4a: 21 f0 breq .+8 ; 0xeb54 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); eb4c: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } eb4e: df 91 pop r29 eb50: cf 91 pop r28 eb52: 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; eb54: 18 86 std Y+8, r1 ; 0x08 eb56: fb cf rjmp .-10 ; 0xeb4e 0000eb58 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { eb58: cf 93 push r28 eb5a: c8 2f mov r28, r24 eb5c: 68 2f mov r22, r24 eb5e: 87 e6 ldi r24, 0x67 ; 103 eb60: 9f e0 ldi r25, 0x0F ; 15 eb62: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { eb66: cc 23 and r28, r28 eb68: 19 f0 breq .+6 ; 0xeb70 fsensor.init(); } else { fsensor.deinit(); } } eb6a: 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(); eb6c: 0d 94 6c 87 jmp 0x30ed8 ; 0x30ed8 } else { fsensor.deinit(); } } eb70: 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(); eb72: 0d 94 5c 87 jmp 0x30eb8 ; 0x30eb8 0000eb76 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; eb76: 10 92 34 05 sts 0x0534, r1 ; 0x800534 extruder_autofan_last_check = _millis(); eb7a: 0f 94 83 3f call 0x27f06 ; 0x27f06 eb7e: 60 93 9a 17 sts 0x179A, r22 ; 0x80179a eb82: 70 93 9b 17 sts 0x179B, r23 ; 0x80179b eb86: 80 93 9c 17 sts 0x179C, r24 ; 0x80179c eb8a: 90 93 9d 17 sts 0x179D, r25 ; 0x80179d } eb8e: 08 95 ret 0000eb90 <__vector_7>: EICRB ^= (1 << 6); //change edge } #endif //(defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) #ifdef EXTRUDER_ALTFAN_DETECT ISR(INT6_vect) { eb90: 1f 92 push r1 eb92: 0f 92 push r0 eb94: 0f b6 in r0, 0x3f ; 63 eb96: 0f 92 push r0 eb98: 11 24 eor r1, r1 eb9a: 0b b6 in r0, 0x3b ; 59 eb9c: 0f 92 push r0 eb9e: 8f 93 push r24 eba0: 9f 93 push r25 eba2: ef 93 push r30 eba4: ff 93 push r31 fan_edge_counter[0]++; eba6: e3 eb ldi r30, 0xB3 ; 179 eba8: f4 e0 ldi r31, 0x04 ; 4 ebaa: 80 81 ld r24, Z ebac: 91 81 ldd r25, Z+1 ; 0x01 ebae: 01 96 adiw r24, 0x01 ; 1 ebb0: 91 83 std Z+1, r25 ; 0x01 ebb2: 80 83 st Z, r24 } ebb4: ff 91 pop r31 ebb6: ef 91 pop r30 ebb8: 9f 91 pop r25 ebba: 8f 91 pop r24 ebbc: 0f 90 pop r0 ebbe: 0b be out 0x3b, r0 ; 59 ebc0: 0f 90 pop r0 ebc2: 0f be out 0x3f, r0 ; 63 ebc4: 0f 90 pop r0 ebc6: 1f 90 pop r1 ebc8: 18 95 reti 0000ebca <__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) { ebca: 1f 92 push r1 ebcc: 0f 92 push r0 ebce: 0f b6 in r0, 0x3f ; 63 ebd0: 0f 92 push r0 ebd2: 11 24 eor r1, r1 ebd4: 2f 93 push r18 ebd6: 4f 93 push r20 ebd8: 5f 93 push r21 ebda: 6f 93 push r22 ebdc: 7f 93 push r23 ebde: 8f 93 push r24 ebe0: 9f 93 push r25 ebe2: af 93 push r26 ebe4: 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; ebe6: 80 91 34 05 lds r24, 0x0534 ; 0x800534 ebea: 88 23 and r24, r24 ebec: f1 f0 breq .+60 ; 0xec2a <__vector_8+0x60> ebee: 80 91 9e 04 lds r24, 0x049E ; 0x80049e ebf2: 8b 34 cpi r24, 0x4B ; 75 ebf4: d0 f0 brcs .+52 ; 0xec2a <__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 ebf6: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ebfa: 86 ff sbrs r24, 6 ebfc: 24 c0 rjmp .+72 ; 0xec46 <__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; ebfe: 80 91 36 06 lds r24, 0x0636 ; 0x800636 ec02: 90 91 37 06 lds r25, 0x0637 ; 0x800637 ec06: a0 91 38 06 lds r26, 0x0638 ; 0x800638 ec0a: b0 91 39 06 lds r27, 0x0639 ; 0x800639 t_fan_rising_edge = millis_nc(); ec0e: 80 93 49 03 sts 0x0349, r24 ; 0x800349 ec12: 90 93 4a 03 sts 0x034A, r25 ; 0x80034a ec16: a0 93 4b 03 sts 0x034B, r26 ; 0x80034b ec1a: b0 93 4c 03 sts 0x034C, r27 ; 0x80034c else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse } } EICRB ^= (1 << 6); //change edge ec1e: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ec22: 90 e4 ldi r25, 0x40 ; 64 ec24: 89 27 eor r24, r25 ec26: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } ec2a: bf 91 pop r27 ec2c: af 91 pop r26 ec2e: 9f 91 pop r25 ec30: 8f 91 pop r24 ec32: 7f 91 pop r23 ec34: 6f 91 pop r22 ec36: 5f 91 pop r21 ec38: 4f 91 pop r20 ec3a: 2f 91 pop r18 ec3c: 0f 90 pop r0 ec3e: 0f be out 0x3f, r0 ; 63 ec40: 0f 90 pop r0 ec42: 1f 90 pop r1 ec44: 18 95 reti ec46: 80 91 36 06 lds r24, 0x0636 ; 0x800636 ec4a: 90 91 37 06 lds r25, 0x0637 ; 0x800637 ec4e: a0 91 38 06 lds r26, 0x0638 ; 0x800638 ec52: b0 91 39 06 lds r27, 0x0639 ; 0x800639 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 ec56: 40 91 49 03 lds r20, 0x0349 ; 0x800349 ec5a: 50 91 4a 03 lds r21, 0x034A ; 0x80034a ec5e: 60 91 4b 03 lds r22, 0x034B ; 0x80034b ec62: 70 91 4c 03 lds r23, 0x034C ; 0x80034c ec66: 84 1b sub r24, r20 ec68: 95 0b sbc r25, r21 ec6a: a6 0b sbc r26, r22 ec6c: b7 0b sbc r27, r23 ec6e: 20 91 e1 03 lds r18, 0x03E1 ; 0x8003e1 ec72: 44 e0 ldi r20, 0x04 ; 4 ec74: 50 e0 ldi r21, 0x00 ; 0 ec76: 60 e0 ldi r22, 0x00 ; 0 ec78: 70 e0 ldi r23, 0x00 ; 0 ec7a: 25 36 cpi r18, 0x65 ; 101 ec7c: 20 f0 brcs .+8 ; 0xec86 <__vector_8+0xbc> ec7e: 43 e0 ldi r20, 0x03 ; 3 ec80: 50 e0 ldi r21, 0x00 ; 0 ec82: 60 e0 ldi r22, 0x00 ; 0 ec84: 70 e0 ldi r23, 0x00 ; 0 ec86: 84 17 cp r24, r20 ec88: 95 07 cpc r25, r21 ec8a: a6 07 cpc r26, r22 ec8c: b7 07 cpc r27, r23 ec8e: 38 f2 brcs .-114 ; 0xec1e <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse ec90: 80 91 b5 04 lds r24, 0x04B5 ; 0x8004b5 ec94: 90 91 b6 04 lds r25, 0x04B6 ; 0x8004b6 ec98: 02 96 adiw r24, 0x02 ; 2 ec9a: 90 93 b6 04 sts 0x04B6, r25 ; 0x8004b6 ec9e: 80 93 b5 04 sts 0x04B5, r24 ; 0x8004b5 eca2: bd cf rjmp .-134 ; 0xec1e <__vector_8+0x54> 0000eca4 : } #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) void countFanSpeed() { eca4: 8f 92 push r8 eca6: 9f 92 push r9 eca8: af 92 push r10 ecaa: bf 92 push r11 ecac: cf 92 push r12 ecae: df 92 push r13 ecb0: ef 92 push r14 ecb2: ff 92 push r15 ecb4: 0f 93 push r16 ecb6: 1f 93 push r17 ecb8: cf 93 push r28 ecba: 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))); ecbc: c3 eb ldi r28, 0xB3 ; 179 ecbe: d4 e0 ldi r29, 0x04 ; 4 ecc0: 68 81 ld r22, Y ecc2: 79 81 ldd r23, Y+1 ; 0x01 ecc4: 07 2e mov r0, r23 ecc6: 00 0c add r0, r0 ecc8: 88 0b sbc r24, r24 ecca: 99 0b sbc r25, r25 eccc: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> ecd0: 6b 01 movw r12, r22 ecd2: 7c 01 movw r14, r24 ecd4: 0f 94 83 3f call 0x27f06 ; 0x27f06 ecd8: 0f ea ldi r16, 0xAF ; 175 ecda: 14 e0 ldi r17, 0x04 ; 4 ecdc: 80 90 9a 17 lds r8, 0x179A ; 0x80179a ece0: 90 90 9b 17 lds r9, 0x179B ; 0x80179b ece4: a0 90 9c 17 lds r10, 0x179C ; 0x80179c ece8: b0 90 9d 17 lds r11, 0x179D ; 0x80179d ecec: 68 19 sub r22, r8 ecee: 79 09 sbc r23, r9 ecf0: 8a 09 sbc r24, r10 ecf2: 9b 09 sbc r25, r11 ecf4: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> ecf8: 9b 01 movw r18, r22 ecfa: ac 01 movw r20, r24 ecfc: 60 e0 ldi r22, 0x00 ; 0 ecfe: 70 e0 ldi r23, 0x00 ; 0 ed00: 8a e7 ldi r24, 0x7A ; 122 ed02: 93 e4 ldi r25, 0x43 ; 67 ed04: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> ed08: a7 01 movw r20, r14 ed0a: 96 01 movw r18, r12 ed0c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> ed10: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> ed14: f8 01 movw r30, r16 ed16: 71 83 std Z+1, r23 ; 0x01 ed18: 60 83 st Z, r22 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); ed1a: 6a 81 ldd r22, Y+2 ; 0x02 ed1c: 7b 81 ldd r23, Y+3 ; 0x03 ed1e: 07 2e mov r0, r23 ed20: 00 0c add r0, r0 ed22: 88 0b sbc r24, r24 ed24: 99 0b sbc r25, r25 ed26: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> ed2a: 6b 01 movw r12, r22 ed2c: 7c 01 movw r14, r24 ed2e: 0f 94 83 3f call 0x27f06 ; 0x27f06 ed32: 80 90 9a 17 lds r8, 0x179A ; 0x80179a ed36: 90 90 9b 17 lds r9, 0x179B ; 0x80179b ed3a: a0 90 9c 17 lds r10, 0x179C ; 0x80179c ed3e: b0 90 9d 17 lds r11, 0x179D ; 0x80179d ed42: 68 19 sub r22, r8 ed44: 79 09 sbc r23, r9 ed46: 8a 09 sbc r24, r10 ed48: 9b 09 sbc r25, r11 ed4a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> ed4e: 9b 01 movw r18, r22 ed50: ac 01 movw r20, r24 ed52: 60 e0 ldi r22, 0x00 ; 0 ed54: 70 e0 ldi r23, 0x00 ; 0 ed56: 8a e7 ldi r24, 0x7A ; 122 ed58: 93 e4 ldi r25, 0x43 ; 67 ed5a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> ed5e: a7 01 movw r20, r14 ed60: 96 01 movw r18, r12 ed62: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> ed66: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> ed6a: f8 01 movw r30, r16 ed6c: 73 83 std Z+3, r23 ; 0x03 ed6e: 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; ed70: 19 82 std Y+1, r1 ; 0x01 ed72: 18 82 st Y, r1 fan_edge_counter[1] = 0; ed74: 1b 82 std Y+3, r1 ; 0x03 ed76: 1a 82 std Y+2, r1 ; 0x02 } ed78: df 91 pop r29 ed7a: cf 91 pop r28 ed7c: 1f 91 pop r17 ed7e: 0f 91 pop r16 ed80: ff 90 pop r15 ed82: ef 90 pop r14 ed84: df 90 pop r13 ed86: cf 90 pop r12 ed88: bf 90 pop r11 ed8a: af 90 pop r10 ed8c: 9f 90 pop r9 ed8e: 8f 90 pop r8 ed90: 08 95 ret 0000ed92 : 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; ed92: 80 93 4d 03 sts 0x034D, r24 ; 0x80034d newFanSpeed = 0; ed96: 10 92 6b 03 sts 0x036B, r1 ; 0x80036b if (fanState & 0x01) ed9a: 80 ff sbrs r24, 0 ed9c: 08 c0 rjmp .+16 ; 0xedae { #ifdef EXTRUDER_ALTFAN_DETECT if (altfanStatus.isAltfan && !altfanStatus.altfanOverride) newFanSpeed = EXTRUDER_ALTFAN_SPEED_SILENT; ed9e: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> eda2: 83 70 andi r24, 0x03 ; 3 eda4: 81 30 cpi r24, 0x01 ; 1 eda6: e9 f4 brne .+58 ; 0xede2 eda8: 80 e8 ldi r24, 0x80 ; 128 else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; edaa: 80 93 6b 03 sts 0x036B, r24 ; 0x80036b #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); edae: 20 91 6b 03 lds r18, 0x036B ; 0x80036b } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) edb2: 8f ef ldi r24, 0xFF ; 255 edb4: 82 0f add r24, r18 edb6: 8e 3f cpi r24, 0xFE ; 254 edb8: d8 f0 brcs .+54 ; 0xedf0 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); edba: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> edbe: 87 7f andi r24, 0xF7 ; 247 edc0: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; edc4: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> edc8: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); edcc: 9f b7 in r25, 0x3f ; 63 edce: 22 23 and r18, r18 edd0: 51 f0 breq .+20 ; 0xede6 edd2: f8 94 cli edd4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> edd8: 80 62 ori r24, 0x20 ; 32 edda: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> edde: 9f bf out 0x3f, r25 ; 63 ede0: 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; ede2: 8f ef ldi r24, 0xFF ; 255 ede4: e2 cf rjmp .-60 ; 0xedaa ede6: f8 94 cli ede8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> edec: 8f 7d andi r24, 0xDF ; 223 edee: f5 cf rjmp .-22 ; 0xedda 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; edf0: ef b7 in r30, 0x3f ; 63 edf2: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); edf4: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> edf8: 88 60 ori r24, 0x08 ; 8 edfa: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; edfe: 30 e0 ldi r19, 0x00 ; 0 ee00: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> ee04: 4f ef ldi r20, 0xFF ; 255 ee06: 50 e0 ldi r21, 0x00 ; 0 ee08: 81 ff sbrs r24, 1 ee0a: 04 c0 rjmp .+8 ; 0xee14 ee0c: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> ee10: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> ee14: 24 9f mul r18, r20 ee16: c0 01 movw r24, r0 ee18: 25 9f mul r18, r21 ee1a: 90 0d add r25, r0 ee1c: 34 9f mul r19, r20 ee1e: 90 0d add r25, r0 ee20: 11 24 eor r1, r1 ee22: 6f ef ldi r22, 0xFF ; 255 ee24: 70 e0 ldi r23, 0x00 ; 0 ee26: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> ee2a: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ee2e: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; ee32: ef bf out 0x3f, r30 ; 63 #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } ee34: 08 95 ret 0000ee36 : 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); ee36: 8b e2 ldi r24, 0x2B ; 43 ee38: 9d e0 ldi r25, 0x0D ; 13 ee3a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 ee3e: 90 91 b7 04 lds r25, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> ee42: 80 fb bst r24, 0 ee44: 91 f9 bld r25, 1 ee46: 90 93 b7 04 sts 0x04B7, r25 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> #endif resetFanCheck(); ee4a: 0e 94 bb 75 call 0xeb76 ; 0xeb76 setExtruderAutoFanState(1); ee4e: 81 e0 ldi r24, 0x01 ; 1 ee50: 0c 94 c9 76 jmp 0xed92 ; 0xed92 0000ee54 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { ee54: 1f 93 push r17 ee56: cf 93 push r28 ee58: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) ee5a: d0 91 4d 03 lds r29, 0x034D ; 0x80034d ee5e: d1 fd sbrc r29, 1 ee60: 1d c0 rjmp .+58 ; 0xee9c temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; ee62: 10 91 1c 05 lds r17, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ee66: c1 e0 ldi r28, 0x01 ; 1 ee68: 20 e0 ldi r18, 0x00 ; 0 ee6a: 30 e0 ldi r19, 0x00 ; 0 ee6c: 48 e4 ldi r20, 0x48 ; 72 ee6e: 52 e4 ldi r21, 0x42 ; 66 ee70: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f ee74: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 ee78: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 ee7c: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 ee80: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> ee84: 18 16 cp r1, r24 ee86: 0c f0 brlt .+2 ; 0xee8a ee88: 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; ee8a: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ee8c: cd 2b or r28, r29 ee8e: 81 e0 ldi r24, 0x01 ; 1 ee90: 11 11 cpse r17, r1 ee92: 01 c0 rjmp .+2 ; 0xee96 ee94: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); ee96: c8 2b or r28, r24 ee98: c0 93 4d 03 sts 0x034D, r28 ; 0x80034d } setExtruderAutoFanState(fanState); ee9c: 80 91 4d 03 lds r24, 0x034D ; 0x80034d #endif } eea0: df 91 pop r29 eea2: cf 91 pop r28 eea4: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); eea6: 0c 94 c9 76 jmp 0xed92 ; 0xed92 0000eeaa : 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) { eeaa: ef 92 push r14 eeac: ff 92 push r15 eeae: 0f 93 push r16 eeb0: 1f 93 push r17 eeb2: cf 93 push r28 eeb4: df 93 push r29 eeb6: ec 01 movw r28, r24 eeb8: 8b 01 movw r16, r22 eeba: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) eebc: 0e 94 59 5c call 0xb8b2 ; 0xb8b2 eec0: 81 11 cpse r24, r1 eec2: 0b c0 rjmp .+22 ; 0xeeda #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); eec4: a8 01 movw r20, r16 eec6: be 01 movw r22, r28 eec8: 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); } eeca: df 91 pop r29 eecc: cf 91 pop r28 eece: 1f 91 pop r17 eed0: 0f 91 pop r16 eed2: ff 90 pop r15 eed4: 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); eed6: 0d 94 9d dd jmp 0x3bb3a ; 0x3bb3a } 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); } eeda: df 91 pop r29 eedc: cf 91 pop r28 eede: 1f 91 pop r17 eee0: 0f 91 pop r16 eee2: ff 90 pop r15 eee4: ef 90 pop r14 eee6: 08 95 ret 0000eee8 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { eee8: 0f 93 push r16 eeea: 1f 93 push r17 eeec: cf 93 push r28 eeee: df 93 push r29 eef0: 8c 01 movw r16, r24 eef2: d6 2f mov r29, r22 eef4: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); eef6: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e if (val == EEPROM_EMPTY_VALUE16) { eefa: 8f 3f cpi r24, 0xFF ; 255 eefc: 98 07 cpc r25, r24 eefe: 39 f4 brne .+14 ; 0xef0e 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); ef00: 6d 2f mov r22, r29 ef02: 7c 2f mov r23, r28 ef04: c8 01 movw r24, r16 ef06: 0f 94 e7 dd call 0x3bbce ; 0x3bbce 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; ef0a: 8d 2f mov r24, r29 ef0c: 9c 2f mov r25, r28 } return val; } ef0e: df 91 pop r29 ef10: cf 91 pop r28 ef12: 1f 91 pop r17 ef14: 0f 91 pop r16 ef16: 08 95 ret 0000ef18 : 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) { ef18: 0f 93 push r16 ef1a: 1f 93 push r17 ef1c: cf 93 push r28 ef1e: 8c 01 movw r16, r24 ef20: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); ef22: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 if (val == EEPROM_EMPTY_VALUE) { ef26: 8f 3f cpi r24, 0xFF ; 255 ef28: 29 f4 brne .+10 ; 0xef34 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); ef2a: 6c 2f mov r22, r28 ef2c: c8 01 movw r24, r16 ef2e: 0f 94 d1 dd call 0x3bba2 ; 0x3bba2 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; ef32: 8c 2f mov r24, r28 } return val; } ef34: cf 91 pop r28 ef36: 1f 91 pop r17 ef38: 0f 91 pop r16 ef3a: 08 95 ret 0000ef3c : 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) { ef3c: cf 93 push r28 ef3e: df 93 push r29 ef40: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); ef42: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e ef46: bc 01 movw r22, r24 ef48: 6f 5f subi r22, 0xFF ; 255 ef4a: 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); ef4c: 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); } ef4e: df 91 pop r29 ef50: 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); ef52: 0d 94 e7 dd jmp 0x3bbce ; 0x3bbce 0000ef56 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { ef56: cf 93 push r28 ef58: df 93 push r29 ef5a: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); ef5c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 ef60: 61 e0 ldi r22, 0x01 ; 1 ef62: 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); ef64: 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); } ef66: df 91 pop r29 ef68: 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); ef6a: 0d 94 d1 dd jmp 0x3bba2 ; 0x3bba2 0000ef6e : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { ef6e: cf 93 push r28 ef70: df 93 push r29 ef72: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); ef74: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 ef78: 61 e0 ldi r22, 0x01 ; 1 ef7a: 81 11 cpse r24, r1 ef7c: 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); ef7e: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } ef80: df 91 pop r29 ef82: 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); ef84: 0d 94 d1 dd jmp 0x3bba2 ; 0x3bba2 0000ef88 : 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); ef88: 2b e0 ldi r18, 0x0B ; 11 ef8a: 82 9f mul r24, r18 ef8c: c0 01 movw r24, r0 ef8e: 11 24 eor r1, r1 ef90: 80 5b subi r24, 0xB0 ; 176 ef92: 92 4f sbci r25, 0xF2 ; 242 ef94: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e ef98: 21 e0 ldi r18, 0x01 ; 1 ef9a: 01 96 adiw r24, 0x01 ; 1 ef9c: 09 f4 brne .+2 ; 0xefa0 ef9e: 20 e0 ldi r18, 0x00 ; 0 } efa0: 82 2f mov r24, r18 efa2: 08 95 ret 0000efa4 : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { efa4: cf 93 push r28 efa6: df 93 push r29 efa8: c8 2f mov r28, r24 efaa: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; efac: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; efae: c8 30 cpi r28, 0x08 ; 8 efb0: 0c f0 brlt .+2 ; 0xefb4 efb2: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; efb4: 8c 2f mov r24, r28 efb6: 0e 94 c4 77 call 0xef88 ; 0xef88 efba: 81 11 cpse r24, r1 efbc: 03 c0 rjmp .+6 ; 0xefc4 efbe: 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) efc0: a9 f7 brne .-22 ; 0xefac { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; efc2: cf ef ldi r28, 0xFF ; 255 } efc4: 8c 2f mov r24, r28 efc6: df 91 pop r29 efc8: cf 91 pop r28 efca: 08 95 ret 0000efcc : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); efcc: 81 ea ldi r24, 0xA1 ; 161 efce: 9d e0 ldi r25, 0x0D ; 13 efd0: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 sheet = eeprom_next_initialized_sheet(sheet); efd4: 0e 94 d2 77 call 0xefa4 ; 0xefa4 if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); efd8: 87 fd sbrc r24, 7 efda: 05 c0 rjmp .+10 ; 0xefe6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); efdc: 68 2f mov r22, r24 efde: 81 ea ldi r24, 0xA1 ; 161 efe0: 9d e0 ldi r25, 0x0D ; 13 efe2: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a { 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); } efe6: 08 95 ret 0000efe8 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { efe8: 0f 93 push r16 efea: 1f 93 push r17 efec: cf 93 push r28 efee: c8 2f mov r28, r24 eff0: 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")); eff2: 6c ea ldi r22, 0xAC ; 172 eff4: 79 e7 ldi r23, 0x79 ; 121 //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { static_assert(8 == sizeof(SheetName),"Default sheet name needs to be adjusted."); if (index < 2) eff6: 82 30 cpi r24, 0x02 ; 2 eff8: 70 f0 brcs .+28 ; 0xf016 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); effa: 65 ea ldi r22, 0xA5 ; 165 effc: 79 e7 ldi r23, 0x79 ; 121 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) effe: 84 30 cpi r24, 0x04 ; 4 f000: 50 f0 brcs .+20 ; 0xf016 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); f002: 6d e9 ldi r22, 0x9D ; 157 f004: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) f006: 84 30 cpi r24, 0x04 ; 4 f008: 31 f0 breq .+12 ; 0xf016 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); f00a: 65 e9 ldi r22, 0x95 ; 149 f00c: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) f00e: 85 30 cpi r24, 0x05 ; 5 f010: 11 f0 breq .+4 ; 0xf016 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); f012: 6e e8 ldi r22, 0x8E ; 142 f014: 79 e7 ldi r23, 0x79 ; 121 f016: c8 01 movw r24, r16 f018: 0f 94 40 db call 0x3b680 ; 0x3b680 } if (index <4 || index >5) f01c: 8c ef ldi r24, 0xFC ; 252 f01e: 8c 0f add r24, r28 f020: 82 30 cpi r24, 0x02 ; 2 f022: 28 f0 brcs .+10 ; 0xf02e { sheetName.c[6] = '0' + ((index % 2)+1); f024: c1 70 andi r28, 0x01 ; 1 f026: cf 5c subi r28, 0xCF ; 207 f028: f8 01 movw r30, r16 f02a: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; f02c: 17 82 std Z+7, r1 ; 0x07 } } f02e: cf 91 pop r28 f030: 1f 91 pop r17 f032: 0f 91 pop r16 f034: 08 95 ret 0000f036 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f036: 61 e0 ldi r22, 0x01 ; 1 f038: 80 ec ldi r24, 0xC0 ; 192 f03a: 9f e0 ldi r25, 0x0F ; 15 f03c: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a f040: 60 e0 ldi r22, 0x00 ; 0 f042: 8f eb ldi r24, 0xBF ; 191 f044: 9f e0 ldi r25, 0x0F ; 15 f046: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a f04a: 60 e0 ldi r22, 0x00 ; 0 f04c: 8e eb ldi r24, 0xBE ; 190 f04e: 9f e0 ldi r25, 0x0F ; 15 f050: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a f054: 60 e0 ldi r22, 0x00 ; 0 f056: 8d eb ldi r24, 0xBD ; 189 f058: 9f e0 ldi r25, 0x0F ; 15 f05a: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a f05e: 60 e0 ldi r22, 0x00 ; 0 f060: 8c eb ldi r24, 0xBC ; 188 f062: 9f e0 ldi r25, 0x0F ; 15 f064: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0000f068 : } void print_hex_byte(uint8_t val) { f068: cf 93 push r28 f06a: c8 2f mov r28, r24 print_hex_nibble(val >> 4); f06c: 82 95 swap r24 f06e: 8f 70 andi r24, 0x0F ; 15 f070: 0e 94 82 64 call 0xc904 ; 0xc904 print_hex_nibble(val & 15); f074: 8c 2f mov r24, r28 f076: 8f 70 andi r24, 0x0F ; 15 } f078: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); f07a: 0c 94 82 64 jmp 0xc904 ; 0xc904 0000f07e : // 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) { f07e: 80 91 7f 10 lds r24, 0x107F ; 0x80107f f082: 90 91 80 10 lds r25, 0x1080 ; 0x801080 f086: 18 16 cp r1, r24 f088: 19 06 cpc r1, r25 f08a: 0c f0 brlt .+2 ; 0xf08e f08c: 43 c0 rjmp .+134 ; 0xf114 SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { f08e: 01 97 sbiw r24, 0x01 ; 1 f090: 90 93 80 10 sts 0x1080, r25 ; 0x801080 f094: 80 93 7f 10 sts 0x107F, r24 ; 0x80107f f098: 89 2b or r24, r25 f09a: a1 f4 brne .+40 ; 0xf0c4 // Empty buffer. if (serial_count == 0) f09c: 80 91 7a 10 lds r24, 0x107A ; 0x80107a f0a0: 90 91 7b 10 lds r25, 0x107B ; 0x80107b f0a4: 89 2b or r24, r25 f0a6: 21 f4 brne .+8 ; 0xf0b0 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; f0a8: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> f0ac: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.571> bufindr = bufindw; f0b0: 80 91 7c 10 lds r24, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> f0b4: 90 91 7d 10 lds r25, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> f0b8: 90 93 6f 12 sts 0x126F, r25 ; 0x80126f f0bc: 80 93 6e 12 sts 0x126E, r24 ; 0x80126e SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; f0c0: 81 e0 ldi r24, 0x01 ; 1 f0c2: 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) ; f0c4: 80 91 6e 12 lds r24, 0x126E ; 0x80126e f0c8: 90 91 6f 12 lds r25, 0x126F ; 0x80126f f0cc: 03 96 adiw r24, 0x03 ; 3 f0ce: fc 01 movw r30, r24 f0d0: ef 57 subi r30, 0x7F ; 127 f0d2: ff 4e sbci r31, 0xEF ; 239 f0d4: 20 81 ld r18, Z f0d6: 01 96 adiw r24, 0x01 ; 1 f0d8: 21 11 cpse r18, r1 f0da: f9 cf rjmp .-14 ; 0xf0ce f0dc: fc 01 movw r30, r24 f0de: ef 57 subi r30, 0x7F ; 127 f0e0: 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) ; f0e2: 8d 3e cpi r24, 0xED ; 237 f0e4: 21 e0 ldi r18, 0x01 ; 1 f0e6: 92 07 cpc r25, r18 f0e8: 40 f4 brcc .+16 ; 0xf0fa f0ea: 41 91 ld r20, Z+ f0ec: 9c 01 movw r18, r24 f0ee: 2f 5f subi r18, 0xFF ; 255 f0f0: 3f 4f sbci r19, 0xFF ; 255 f0f2: 41 11 cpse r20, r1 f0f4: e1 cf rjmp .-62 ; 0xf0b8 f0f6: c9 01 movw r24, r18 f0f8: f4 cf rjmp .-24 ; 0xf0e2 // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { f0fa: e1 e8 ldi r30, 0x81 ; 129 f0fc: f0 e1 ldi r31, 0x10 ; 16 f0fe: 8d 3e cpi r24, 0xED ; 237 f100: 21 e0 ldi r18, 0x01 ; 1 f102: 92 07 cpc r25, r18 f104: c9 f6 brne .-78 ; 0xf0b8 f106: cf 01 movw r24, r30 f108: 81 58 subi r24, 0x81 ; 129 f10a: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; f10c: 21 91 ld r18, Z+ f10e: 22 23 and r18, r18 f110: d1 f3 breq .-12 ; 0xf106 f112: d2 cf rjmp .-92 ; 0xf0b8 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; f114: 80 e0 ldi r24, 0x00 ; 0 } f116: 08 95 ret 0000f118 : 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; f118: 80 91 91 04 lds r24, 0x0491 ; 0x800491 f11c: 90 91 92 04 lds r25, 0x0492 ; 0x800492 f120: 20 91 93 04 lds r18, 0x0493 ; 0x800493 f124: 30 91 94 04 lds r19, 0x0494 ; 0x800494 f128: 82 1b sub r24, r18 f12a: 93 0b sbc r25, r19 } f12c: 8f 77 andi r24, 0x7F ; 127 f12e: 99 27 eor r25, r25 f130: 08 95 ret 0000f132 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; f132: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) f134: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; f136: 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; f138: db 01 movw r26, r22 f13a: 4d 91 ld r20, X+ f13c: bd 01 movw r22, r26 f13e: 40 32 cpi r20, 0x20 ; 32 f140: 49 f0 breq .+18 ; 0xf154 if (i == 8) f142: 28 30 cpi r18, 0x08 ; 8 f144: 11 f4 brne .+4 ; 0xf14a { *pos++='.'; f146: 30 83 st Z, r19 f148: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; f14a: db 01 movw r26, r22 f14c: 11 97 sbiw r26, 0x01 ; 1 f14e: 4c 91 ld r20, X f150: 40 83 st Z, r20 f152: 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++) f154: 2f 5f subi r18, 0xFF ; 255 f156: 2b 30 cpi r18, 0x0B ; 11 f158: 79 f7 brne .-34 ; 0xf138 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; f15a: 10 82 st Z, r1 return buffer; } f15c: 08 95 ret 0000f15e : 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);} f15e: 40 e0 ldi r20, 0x00 ; 0 f160: 50 e0 ldi r21, 0x00 ; 0 f162: ba 01 movw r22, r20 f164: 0d 94 a9 6e jmp 0x2dd52 ; 0x2dd52 0000f168 : 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();} f168: fc 01 movw r30, r24 f16a: 23 81 ldd r18, Z+3 ; 0x03 f16c: 21 11 cpse r18, r1 f16e: 0d 94 6c a4 jmp 0x348d8 ; 0x348d8 f172: 08 95 ret 0000f174 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) f174: 90 91 1f 05 lds r25, 0x051F ; 0x80051f f178: 91 11 cpse r25, r1 f17a: 07 c0 rjmp .+14 ; 0xf18a { while (!((M_UCSRxA) & (1 << M_UDREx))); f17c: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> f180: 95 ff sbrs r25, 5 f182: fc cf rjmp .-8 ; 0xf17c M_UDRx = c; f184: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> f188: 08 95 ret } else if (selectedSerialPort == 1) f18a: 91 30 cpi r25, 0x01 ; 1 f18c: 31 f4 brne .+12 ; 0xf19a { while (!((UCSR1A) & (1 << UDRE1))); f18e: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> f192: 95 ff sbrs r25, 5 f194: fc cf rjmp .-8 ; 0xf18e UDR1 = c; f196: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } f19a: 08 95 ret 0000f19c : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); f19c: 0e 94 ba 78 call 0xf174 ; 0xf174 return 0; } f1a0: 90 e0 ldi r25, 0x00 ; 0 f1a2: 80 e0 ldi r24, 0x00 ; 0 f1a4: 08 95 ret 0000f1a6 : 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) { f1a6: cf 93 push r28 f1a8: df 93 push r29 f1aa: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { f1ac: fe 01 movw r30, r28 f1ae: 84 91 lpm r24, Z f1b0: 88 23 and r24, r24 f1b2: 21 f0 breq .+8 ; 0xf1bc MYSERIAL.write((char)ch); f1b4: 0e 94 ba 78 call 0xf174 ; 0xf174 ++str; f1b8: 21 96 adiw r28, 0x01 ; 1 f1ba: f8 cf rjmp .-16 ; 0xf1ac } } f1bc: df 91 pop r29 f1be: cf 91 pop r28 f1c0: 08 95 ret 0000f1c2 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { f1c2: cf 92 push r12 f1c4: df 92 push r13 f1c6: ef 92 push r14 f1c8: 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]; f1ca: c0 90 5f 0e lds r12, 0x0E5F ; 0x800e5f f1ce: d0 90 60 0e lds r13, 0x0E60 ; 0x800e60 f1d2: e0 90 61 0e lds r14, 0x0E61 ; 0x800e61 f1d6: f0 90 62 0e lds r15, 0x0E62 ; 0x800e62 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); f1da: 85 e2 ldi r24, 0x25 ; 37 f1dc: 9f e7 ldi r25, 0x7F ; 127 f1de: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f1e2: 42 e0 ldi r20, 0x02 ; 2 f1e4: c7 01 movw r24, r14 f1e6: b6 01 movw r22, r12 f1e8: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); f1ec: 8d e1 ldi r24, 0x1D ; 29 f1ee: 9f e7 ldi r25, 0x7F ; 127 f1f0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f1f4: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef f1f8: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 f1fc: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 f200: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 f204: 41 e0 ldi r20, 0x01 ; 1 f206: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } f20a: ff 90 pop r15 f20c: ef 90 pop r14 f20e: df 90 pop r13 f210: 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(); f212: 0d 94 8b d6 jmp 0x3ad16 ; 0x3ad16 0000f216 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { f216: 4f 92 push r4 f218: 5f 92 push r5 f21a: 6f 92 push r6 f21c: 7f 92 push r7 f21e: 8f 92 push r8 f220: 9f 92 push r9 f222: af 92 push r10 f224: bf 92 push r11 f226: cf 92 push r12 f228: df 92 push r13 f22a: ef 92 push r14 f22c: ff 92 push r15 f22e: 0f 93 push r16 f230: 1f 93 push r17 f232: cf 93 push r28 f234: df 93 push r29 f236: cc 24 eor r12, r12 f238: ca 94 dec r12 f23a: dc 2c mov r13, r12 f23c: 76 01 movw r14, r12 f23e: 0e ea ldi r16, 0xAE ; 174 f240: 1f e0 ldi r17, 0x0F ; 15 f242: 93 e2 ldi r25, 0x23 ; 35 f244: 89 2e mov r8, r25 f246: 91 2c mov r9, r1 f248: a1 2c mov r10, r1 f24a: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; f24c: 41 2c mov r4, r1 f24e: 51 2c mov r5, r1 f250: 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; f252: d0 e0 ldi r29, 0x00 ; 0 f254: 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) { f256: 8f ef ldi r24, 0xFF ; 255 f258: c8 16 cp r12, r24 f25a: 09 f4 brne .+2 ; 0xf25e f25c: 5d c0 rjmp .+186 ; 0xf318 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); f25e: c8 01 movw r24, r16 f260: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e f264: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; f266: bc 01 movw r22, r24 f268: 99 0f add r25, r25 f26a: 88 0b sbc r24, r24 f26c: 99 0b sbc r25, r25 f26e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f272: 20 91 78 06 lds r18, 0x0678 ; 0x800678 f276: 30 91 79 06 lds r19, 0x0679 ; 0x800679 f27a: 40 91 7a 06 lds r20, 0x067A ; 0x80067a f27e: 50 91 7b 06 lds r21, 0x067B ; 0x80067b f282: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> f286: 2b 01 movw r4, r22 f288: 3c 01 movw r6, r24 f28a: c7 01 movw r24, r14 f28c: b6 01 movw r22, r12 f28e: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); f292: 87 e1 ldi r24, 0x17 ; 23 f294: 9e e7 ldi r25, 0x7E ; 126 f296: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f29a: c5 01 movw r24, r10 f29c: b4 01 movw r22, r8 f29e: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); f2a2: 87 e1 ldi r24, 0x17 ; 23 f2a4: 9e e7 ldi r25, 0x7E ; 126 f2a6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f2aa: be 01 movw r22, r28 f2ac: 0d 2e mov r0, r29 f2ae: 00 0c add r0, r0 f2b0: 88 0b sbc r24, r24 f2b2: 99 0b sbc r25, r25 f2b4: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); f2b8: 87 e1 ldi r24, 0x17 ; 23 f2ba: 9e e7 ldi r25, 0x7E ; 126 f2bc: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLLN(mm * 1000); f2c0: 20 e0 ldi r18, 0x00 ; 0 f2c2: 30 e0 ldi r19, 0x00 ; 0 f2c4: 4a e7 ldi r20, 0x7A ; 122 f2c6: 54 e4 ldi r21, 0x44 ; 68 f2c8: c3 01 movw r24, r6 f2ca: b2 01 movw r22, r4 f2cc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> f2d0: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 f2d4: 85 e0 ldi r24, 0x05 ; 5 f2d6: 88 0e add r8, r24 f2d8: 91 1c adc r9, r1 f2da: a1 1c adc r10, r1 f2dc: b1 1c adc r11, r1 f2de: 0e 5f subi r16, 0xFE ; 254 f2e0: 1f 4f sbci r17, 0xFF ; 255 f2e2: 8f ef ldi r24, 0xFF ; 255 f2e4: c8 1a sub r12, r24 f2e6: d8 0a sbc r13, r24 f2e8: e8 0a sbc r14, r24 f2ea: 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++) { f2ec: 0a 3b cpi r16, 0xBA ; 186 f2ee: 8f e0 ldi r24, 0x0F ; 15 f2f0: 18 07 cpc r17, r24 f2f2: 09 f0 breq .+2 ; 0xf2f6 f2f4: b0 cf rjmp .-160 ; 0xf256 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f2f6: df 91 pop r29 f2f8: cf 91 pop r28 f2fa: 1f 91 pop r17 f2fc: 0f 91 pop r16 f2fe: ff 90 pop r15 f300: ef 90 pop r14 f302: df 90 pop r13 f304: cf 90 pop r12 f306: bf 90 pop r11 f308: af 90 pop r10 f30a: 9f 90 pop r9 f30c: 8f 90 pop r8 f30e: 7f 90 pop r7 f310: 6f 90 pop r6 f312: 5f 90 pop r5 f314: 4f 90 pop r4 f316: 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); f318: 87 e0 ldi r24, 0x07 ; 7 f31a: 9d e3 ldi r25, 0x3D ; 61 f31c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f320: b8 cf rjmp .-144 ; 0xf292 0000f322 : /// @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) { f322: 88 23 and r24, r24 f324: 71 f1 breq .+92 ; 0xf382 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f326: 8b e0 ldi r24, 0x0B ; 11 f328: 9e e7 ldi r25, 0x7E ; 126 f32a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f32e: 60 91 25 13 lds r22, 0x1325 ; 0x801325 f332: 70 e0 ldi r23, 0x00 ; 0 f334: 90 e0 ldi r25, 0x00 ; 0 f336: 80 e0 ldi r24, 0x00 ; 0 f338: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; f33c: 80 91 25 13 lds r24, 0x1325 ; 0x801325 f340: 84 30 cpi r24, 0x04 ; 4 f342: d8 f0 brcs .+54 ; 0xf37a f344: 10 92 25 13 sts 0x1325, r1 ; 0x801325 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f348: 86 e0 ldi r24, 0x06 ; 6 f34a: 9e e7 ldi r25, 0x7E ; 126 f34c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN((int)currentMMUSlot); f350: 80 91 25 13 lds r24, 0x1325 ; 0x801325 f354: 90 e0 ldi r25, 0x00 ; 0 f356: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 return currentMMUSlot; f35a: 80 91 25 13 lds r24, 0x1325 ; 0x801325 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; f35e: 20 91 ab 05 lds r18, 0x05AB ; 0x8005ab f362: 30 91 ac 05 lds r19, 0x05AC ; 0x8005ac f366: 30 93 6c 0e sts 0x0E6C, r19 ; 0x800e6c f36a: 20 93 6b 0e sts 0x0E6B, r18 ; 0x800e6b slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); f36e: 0f 94 30 1d call 0x23a60 ; 0x23a60 load_filament_final_feed(); // @@TODO verify f372: 0e 94 40 65 call 0xca80 ; 0xca80 st_synchronize(); f376: 0d 94 24 59 jmp 0x2b248 ; 0x2b248 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; else currentMMUSlot++; f37a: 8f 5f subi r24, 0xFF ; 255 f37c: 80 93 25 13 sts 0x1325, r24 ; 0x801325 f380: e3 cf rjmp .-58 ; 0xf348 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); f382: 8e e1 ldi r24, 0x1E ; 30 f384: 9f e3 ldi r25, 0x3F ; 63 f386: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 f38a: 70 e0 ldi r23, 0x00 ; 0 f38c: 60 e0 ldi r22, 0x00 ; 0 f38e: 0e 94 b2 d9 call 0x1b364 ; 0x1b364 f392: e5 cf rjmp .-54 ; 0xf35e 0000f394 : return final_result; } void gcode_M114() { f394: cf 93 push r28 f396: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f398: 83 e0 ldi r24, 0x03 ; 3 f39a: 9e e7 ldi r25, 0x7E ; 126 f39c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOL(current_position[X_AXIS]); f3a0: c1 e4 ldi r28, 0x41 ; 65 f3a2: d7 e0 ldi r29, 0x07 ; 7 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f3a4: 68 81 ld r22, Y f3a6: 79 81 ldd r23, Y+1 ; 0x01 f3a8: 8a 81 ldd r24, Y+2 ; 0x02 f3aa: 9b 81 ldd r25, Y+3 ; 0x03 f3ac: 42 e0 ldi r20, 0x02 ; 2 f3ae: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOLPGM(" Y:"); f3b2: 8f ef ldi r24, 0xFF ; 255 f3b4: 9d e7 ldi r25, 0x7D ; 125 f3b6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f3ba: 6c 81 ldd r22, Y+4 ; 0x04 f3bc: 7d 81 ldd r23, Y+5 ; 0x05 f3be: 8e 81 ldd r24, Y+6 ; 0x06 f3c0: 9f 81 ldd r25, Y+7 ; 0x07 f3c2: 42 e0 ldi r20, 0x02 ; 2 f3c4: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f3c8: 8b ef ldi r24, 0xFB ; 251 f3ca: 9d e7 ldi r25, 0x7D ; 125 f3cc: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f3d0: 68 85 ldd r22, Y+8 ; 0x08 f3d2: 79 85 ldd r23, Y+9 ; 0x09 f3d4: 8a 85 ldd r24, Y+10 ; 0x0a f3d6: 9b 85 ldd r25, Y+11 ; 0x0b f3d8: 42 e0 ldi r20, 0x02 ; 2 f3da: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f3de: 87 ef ldi r24, 0xF7 ; 247 f3e0: 9d e7 ldi r25, 0x7D ; 125 f3e2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f3e6: 6c 85 ldd r22, Y+12 ; 0x0c f3e8: 7d 85 ldd r23, Y+13 ; 0x0d f3ea: 8e 85 ldd r24, Y+14 ; 0x0e f3ec: 9f 85 ldd r25, Y+15 ; 0x0f f3ee: 42 e0 ldi r20, 0x02 ; 2 f3f0: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f3f4: 87 eb ldi r24, 0xB7 ; 183 f3f6: 96 e6 ldi r25, 0x66 ; 102 f3f8: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f3fc: 80 e0 ldi r24, 0x00 ; 0 f3fe: 0f 94 02 59 call 0x2b204 ; 0x2b204 f402: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f406: cc e6 ldi r28, 0x6C ; 108 f408: d6 e0 ldi r29, 0x06 ; 6 f40a: 2c 81 ldd r18, Y+4 ; 0x04 f40c: 3d 81 ldd r19, Y+5 ; 0x05 f40e: 4e 81 ldd r20, Y+6 ; 0x06 f410: 5f 81 ldd r21, Y+7 ; 0x07 f412: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> f416: 42 e0 ldi r20, 0x02 ; 2 f418: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOLPGM(" Y:"); f41c: 83 ef ldi r24, 0xF3 ; 243 f41e: 9d e7 ldi r25, 0x7D ; 125 f420: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f424: 81 e0 ldi r24, 0x01 ; 1 f426: 0f 94 02 59 call 0x2b204 ; 0x2b204 f42a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f42e: 28 85 ldd r18, Y+8 ; 0x08 f430: 39 85 ldd r19, Y+9 ; 0x09 f432: 4a 85 ldd r20, Y+10 ; 0x0a f434: 5b 85 ldd r21, Y+11 ; 0x0b f436: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> f43a: 42 e0 ldi r20, 0x02 ; 2 f43c: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOLPGM(" Z:"); f440: 8f ee ldi r24, 0xEF ; 239 f442: 9d e7 ldi r25, 0x7D ; 125 f444: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f448: 82 e0 ldi r24, 0x02 ; 2 f44a: 0f 94 02 59 call 0x2b204 ; 0x2b204 f44e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f452: 2c 85 ldd r18, Y+12 ; 0x0c f454: 3d 85 ldd r19, Y+13 ; 0x0d f456: 4e 85 ldd r20, Y+14 ; 0x0e f458: 5f 85 ldd r21, Y+15 ; 0x0f f45a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> f45e: 42 e0 ldi r20, 0x02 ; 2 f460: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOLPGM(" E:"); f464: 8b ee ldi r24, 0xEB ; 235 f466: 9d e7 ldi r25, 0x7D ; 125 f468: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f46c: 83 e0 ldi r24, 0x03 ; 3 f46e: 0f 94 02 59 call 0x2b204 ; 0x2b204 f472: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f476: 28 89 ldd r18, Y+16 ; 0x10 f478: 39 89 ldd r19, Y+17 ; 0x11 f47a: 4a 89 ldd r20, Y+18 ; 0x12 f47c: 5b 89 ldd r21, Y+19 ; 0x13 f47e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> } f482: df 91 pop r29 f484: 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]); f486: 0d 94 d0 76 jmp 0x2eda0 ; 0x2eda0 0000f48a : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f48a: 8a ef ldi r24, 0xFA ; 250 f48c: 9c e7 ldi r25, 0x7C ; 124 f48e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f492: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f f496: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 f49a: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 f49e: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 f4a2: 41 e0 ldi r20, 0x01 ; 1 f4a4: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f4a8: 87 ef ldi r24, 0xF7 ; 247 f4aa: 9c e7 ldi r25, 0x7C ; 124 f4ac: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f4b0: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b f4b4: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c f4b8: 07 2e mov r0, r23 f4ba: 00 0c add r0, r0 f4bc: 88 0b sbc r24, r24 f4be: 99 0b sbc r25, r25 f4c0: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f4c4: 41 e0 ldi r20, 0x01 ; 1 f4c6: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f4ca: 83 ef ldi r24, 0xF3 ; 243 f4cc: 9c e7 ldi r25, 0x7C ; 124 f4ce: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f4d2: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef f4d6: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 f4da: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 f4de: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 f4e2: 41 e0 ldi r20, 0x01 ; 1 f4e4: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f4e8: 80 ef ldi r24, 0xF0 ; 240 f4ea: 9c e7 ldi r25, 0x7C ; 124 f4ec: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f4f0: 60 91 69 0e lds r22, 0x0E69 ; 0x800e69 f4f4: 70 91 6a 0e lds r23, 0x0E6A ; 0x800e6a f4f8: 07 2e mov r0, r23 f4fa: 00 0c add r0, r0 f4fc: 88 0b sbc r24, r24 f4fe: 99 0b sbc r25, r25 f500: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f504: 41 e0 ldi r20, 0x01 ; 1 f506: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f50a: 8b ee ldi r24, 0xEB ; 235 f50c: 9c e7 ldi r25, 0x7C ; 124 f50e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f512: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f f516: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 f51a: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 f51e: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 f522: 41 e0 ldi r20, 0x01 ; 1 f524: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f528: 88 ee ldi r24, 0xE8 ; 232 f52a: 9c e7 ldi r25, 0x7C ; 124 f52c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f530: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b f534: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c f538: 07 2e mov r0, r23 f53a: 00 0c add r0, r0 f53c: 88 0b sbc r24, r24 f53e: 99 0b sbc r25, r25 f540: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f544: 41 e0 ldi r20, 0x01 ; 1 f546: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f54a: 84 ee ldi r24, 0xE4 ; 228 f54c: 9c e7 ldi r25, 0x7C ; 124 f54e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f552: 60 91 17 05 lds r22, 0x0517 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> f556: 70 e0 ldi r23, 0x00 ; 0 f558: 90 e0 ldi r25, 0x00 ; 0 f55a: 80 e0 ldi r24, 0x00 ; 0 f55c: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f560: 8f ed ldi r24, 0xDF ; 223 f562: 9c e7 ldi r25, 0x7C ; 124 f564: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f568: 60 91 18 06 lds r22, 0x0618 ; 0x800618 f56c: 70 e0 ldi r23, 0x00 ; 0 f56e: 90 e0 ldi r25, 0x00 ; 0 f570: 80 e0 ldi r24, 0x00 ; 0 f572: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f576: 8b ed ldi r24, 0xDB ; 219 f578: 9c e7 ldi r25, 0x7C ; 124 f57a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f57e: 60 91 97 03 lds r22, 0x0397 ; 0x800397 f582: 70 91 98 03 lds r23, 0x0398 ; 0x800398 f586: 80 91 99 03 lds r24, 0x0399 ; 0x800399 f58a: 90 91 9a 03 lds r25, 0x039A ; 0x80039a f58e: 41 e0 ldi r20, 0x01 ; 1 f590: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f594: 87 ed ldi r24, 0xD7 ; 215 f596: 9c e7 ldi r25, 0x7C ; 124 f598: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 f59c: 60 91 51 06 lds r22, 0x0651 ; 0x800651 f5a0: 70 91 52 06 lds r23, 0x0652 ; 0x800652 f5a4: 80 91 53 06 lds r24, 0x0653 ; 0x800653 f5a8: 90 91 54 06 lds r25, 0x0654 ; 0x800654 f5ac: 41 e0 ldi r20, 0x01 ; 1 f5ae: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f5b2: 0d 94 8b d6 jmp 0x3ad16 ; 0x3ad16 0000f5b6 : } } 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); } f5b6: 20 91 64 14 lds r18, 0x1464 ; 0x801464 f5ba: 30 e0 ldi r19, 0x00 ; 0 f5bc: a8 ee ldi r26, 0xE8 ; 232 f5be: b3 e0 ldi r27, 0x03 ; 3 f5c0: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> f5c4: ab 01 movw r20, r22 f5c6: bc 01 movw r22, r24 f5c8: 85 e6 ldi r24, 0x65 ; 101 f5ca: 94 e1 ldi r25, 0x14 ; 20 f5cc: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f5d0: 88 23 and r24, r24 f5d2: 99 f0 breq .+38 ; 0xf5fa f5d4: 80 91 63 14 lds r24, 0x1463 ; 0x801463 { if(autoReportFeatures.Temp()){ f5d8: 80 fd sbrc r24, 0 gcode_M105(); f5da: 0e 94 45 7a call 0xf48a ; 0xf48a f5de: 80 91 63 14 lds r24, 0x1463 ; 0x801463 } if(autoReportFeatures.Pos()){ f5e2: 82 fd sbrc r24, 2 gcode_M114(); f5e4: 0e 94 ca 79 call 0xf394 ; 0xf394 f5e8: 80 91 63 14 lds r24, 0x1463 ; 0x801463 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f5ec: 81 fd sbrc r24, 1 gcode_M123(); f5ee: 0e 94 31 67 call 0xce62 ; 0xce62 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f5f2: 85 e6 ldi r24, 0x65 ; 101 f5f4: 94 e1 ldi r25, 0x14 ; 20 f5f6: 0d 94 26 42 jmp 0x2844c ; 0x2844c ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f5fa: 08 95 ret 0000f5fc : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f5fc: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 MYSERIAL.println(); f600: 0d 94 8b d6 jmp 0x3ad16 ; 0x3ad16 0000f604 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f604: 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))); f606: 81 ea ldi r24, 0xA1 ; 161 f608: 9d e0 ldi r25, 0x0D ; 13 f60a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f60e: cb e0 ldi r28, 0x0B ; 11 f610: 8c 9f mul r24, r28 f612: c0 01 movw r24, r0 f614: 11 24 eor r1, r1 f616: 80 5b subi r24, 0xB0 ; 176 f618: 92 4f sbci r25, 0xF2 ; 242 f61a: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f61e: 81 56 subi r24, 0x61 ; 97 f620: 90 4f sbci r25, 0xF0 ; 240 f622: 80 3a cpi r24, 0xA0 ; 160 f624: 9f 40 sbci r25, 0x0F ; 15 f626: c8 f0 brcs .+50 ; 0xf65a 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"); f628: 84 ef ldi r24, 0xF4 ; 244 f62a: 9e e7 ldi r25, 0x7E ; 126 f62c: 0e 94 fe 7a call 0xf5fc ; 0xf5fc eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f630: 81 ea ldi r24, 0xA1 ; 161 f632: 9d e0 ldi r25, 0x0D ; 13 f634: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 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-> f638: 8c 9f mul r24, r28 f63a: c0 01 movw r24, r0 f63c: 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); f63e: 70 e0 ldi r23, 0x00 ; 0 f640: 60 e0 ldi r22, 0x00 ; 0 f642: 80 5b subi r24, 0xB0 ; 176 f644: 92 4f sbci r25, 0xF2 ; 242 f646: 0f 94 e7 dd call 0x3bbce ; 0x3bbce 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.")); f64a: 87 eb ldi r24, 0xB7 ; 183 f64c: 9e e7 ldi r25, 0x7E ; 126 f64e: 0f 94 04 36 call 0x26c08 ; 0x26c08 lcd_update_enable(true); f652: 81 e0 ldi r24, 0x01 ; 1 } } f654: 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); f656: 0c 94 d2 6f jmp 0xdfa4 ; 0xdfa4 } } f65a: cf 91 pop r28 f65c: 08 95 ret 0000f65e : // 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) { f65e: ff 92 push r15 f660: 0f 93 push r16 f662: 1f 93 push r17 f664: cf 93 push r28 f666: df 93 push r29 if(Stopped == false) { f668: 90 91 12 05 lds r25, 0x0512 ; 0x800512 f66c: 91 11 cpse r25, r1 f66e: 4f c0 rjmp .+158 ; 0xf70e f670: c8 2f mov r28, r24 Stopped = true; f672: 81 e0 ldi r24, 0x01 ; 1 f674: 80 93 12 05 sts 0x0512, r24 ; 0x800512 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f678: cc 23 and r28, r28 f67a: 11 f1 breq .+68 ; 0xf6c0 f67c: 0e 94 3d 68 call 0xd07a ; 0xd07a f680: 88 23 and r24, r24 f682: f1 f0 breq .+60 ; 0xf6c0 if (!printingIsPaused()) { f684: 0e 94 32 68 call 0xd064 ; 0xd064 f688: 81 11 cpse r24, r1 f68a: 22 c0 rjmp .+68 ; 0xf6d0 lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f68c: 81 ea ldi r24, 0xA1 ; 161 f68e: 96 e3 ldi r25, 0x36 ; 54 f690: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 f694: 63 e0 ldi r22, 0x03 ; 3 f696: 0f 94 bf 06 call 0x20d7e ; 0x20d7e // 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; f69a: f0 90 ad 05 lds r15, 0x05AD ; 0x8005ad uint16_t ext_temp = saved_extruder_temperature; f69e: 00 91 ab 05 lds r16, 0x05AB ; 0x8005ab f6a2: 10 91 ac 05 lds r17, 0x05AC ; 0x8005ac uint8_t fan_speed = saved_fan_speed; f6a6: d0 91 aa 05 lds r29, 0x05AA ; 0x8005aa lcd_pause_print(); f6aa: 0f 94 8f 3f call 0x27f1e ; 0x27f1e saved_bed_temperature = bed_temp; f6ae: f0 92 ad 05 sts 0x05AD, r15 ; 0x8005ad saved_extruder_temperature = ext_temp; f6b2: 10 93 ac 05 sts 0x05AC, r17 ; 0x8005ac f6b6: 00 93 ab 05 sts 0x05AB, r16 ; 0x8005ab saved_fan_speed = fan_speed; f6ba: d0 93 aa 05 sts 0x05AA, r29 ; 0x8005aa f6be: 08 c0 rjmp .+16 ; 0xf6d0 } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f6c0: 61 e0 ldi r22, 0x01 ; 1 f6c2: 80 e0 ldi r24, 0x00 ; 0 f6c4: 0f 94 0f 16 call 0x22c1e ; 0x22c1e } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f6c8: 8a eb ldi r24, 0xBA ; 186 f6ca: 99 ea ldi r25, 0xA9 ; 169 f6cc: cc 23 and r28, r28 f6ce: 11 f0 breq .+4 ; 0xf6d4 f6d0: 82 ee ldi r24, 0xE2 ; 226 f6d2: 99 ea ldi r25, 0xA9 ; 169 f6d4: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f6d8: 80 e3 ldi r24, 0x30 ; 48 f6da: 97 e6 ldi r25, 0x67 ; 103 f6dc: 0e 94 fe 7a call 0xf5fc ; 0xf5fc // 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)); f6e0: 86 e9 ldi r24, 0x96 ; 150 f6e2: 96 e3 ldi r25, 0x36 ; 54 f6e4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 f6e8: 0f 94 e2 0b call 0x217c4 ; 0x217c4 // 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); f6ec: 9f b7 in r25, 0x3f ; 63 f6ee: f8 94 cli f6f0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f6f4: 84 60 ori r24, 0x04 ; 4 f6f6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f6fa: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f6fc: 0f 94 4b 27 call 0x24e96 ; 0x24e96 if(!allow_recovery) { f700: c1 11 cpse r28, r1 f702: 05 c0 rjmp .+10 ; 0xf70e // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f704: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 f708: 81 60 ori r24, 0x01 ; 1 f70a: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 } } } f70e: df 91 pop r29 f710: cf 91 pop r28 f712: 1f 91 pop r17 f714: 0f 91 pop r16 f716: ff 90 pop r15 f718: 08 95 ret 0000f71a : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f71a: ec 01 movw r28, r24 cli(); // Stop interrupts f71c: f8 94 cli disable_heater(); f71e: 0f 94 4f 45 call 0x28a9e ; 0x28a9e disable_x(); f722: 17 9a sbi 0x02, 7 ; 2 f724: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_y(); f728: 16 9a sbi 0x02, 6 ; 2 f72a: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f poweroff_z(); disable_e0(); f72e: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f730: 8a eb ldi r24, 0xBA ; 186 f732: 99 ea ldi r25, 0xA9 ; 169 f734: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f738: 88 e9 ldi r24, 0x98 ; 152 f73a: 9e e7 ldi r25, 0x7E ; 126 f73c: 0e 94 fe 7a call 0xf5fc ; 0xf5fc if (full_screen_message != NULL) { f740: 20 97 sbiw r28, 0x00 ; 0 f742: 79 f0 breq .+30 ; 0xf762 SERIAL_ERRORLNRPGM(full_screen_message); f744: ce 01 movw r24, r28 f746: 0e 94 fe 7a call 0xf5fc ; 0xf5fc f74a: be 01 movw r22, r28 f74c: 85 e9 ldi r24, 0x95 ; 149 f74e: 9c e0 ldi r25, 0x0C ; 12 f750: 0f 94 e7 dd call 0x3bbce ; 0x3bbce 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); f754: 62 e4 ldi r22, 0x42 ; 66 f756: 84 e9 ldi r24, 0x94 ; 148 f758: 9c e0 ldi r25, 0x0C ; 12 f75a: 0f 94 d1 dd call 0x3bba2 ; 0x3bba2 // 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(); f75e: 0e 94 f9 67 call 0xcff2 ; 0xcff2 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f762: c0 e9 ldi r28, 0x90 ; 144 f764: de e7 ldi r29, 0x7E ; 126 f766: f1 cf rjmp .-30 ; 0xf74a 0000f768 : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f768: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f76c: 86 fd sbrc r24, 6 f76e: 35 c0 rjmp .+106 ; 0xf7da FORCE_HIGH_POWER_END; f770: 80 e0 ldi r24, 0x00 ; 0 f772: 0e 94 5d 67 call 0xceba ; 0xceba current_position[Z_AXIS] = 0; f776: 10 92 49 07 sts 0x0749, r1 ; 0x800749 f77a: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a f77e: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b f782: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c plan_set_position_curposXYZE(); f786: 0f 94 4b b9 call 0x37296 ; 0x37296 current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f78a: 20 e0 ldi r18, 0x00 ; 0 f78c: 30 e0 ldi r19, 0x00 ; 0 f78e: 40 ea ldi r20, 0xA0 ; 160 f790: 50 e4 ldi r21, 0x40 ; 64 f792: 60 91 49 07 lds r22, 0x0749 ; 0x800749 f796: 70 91 4a 07 lds r23, 0x074A ; 0x80074a f79a: 80 91 4b 07 lds r24, 0x074B ; 0x80074b f79e: 90 91 4c 07 lds r25, 0x074C ; 0x80074c f7a2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> f7a6: 60 93 49 07 sts 0x0749, r22 ; 0x800749 f7aa: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a f7ae: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b f7b2: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f7b6: e0 91 99 02 lds r30, 0x0299 ; 0x800299 f7ba: f0 91 9a 02 lds r31, 0x029A ; 0x80029a f7be: 60 85 ldd r22, Z+8 ; 0x08 f7c0: 71 85 ldd r23, Z+9 ; 0x09 f7c2: 82 85 ldd r24, Z+10 ; 0x0a f7c4: 93 85 ldd r25, Z+11 ; 0x0b f7c6: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); f7ca: 0f 94 24 59 call 0x2b248 ; 0x2b248 kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f7ce: 80 ec ldi r24, 0xC0 ; 192 f7d0: 94 e6 ldi r25, 0x64 ; 100 f7d2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 f7d6: 0e 94 8d 7b call 0xf71a ; 0xf71a } } f7da: 08 95 ret 0000f7dc : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f7dc: 2f 92 push r2 f7de: 3f 92 push r3 f7e0: 4f 92 push r4 f7e2: 5f 92 push r5 f7e4: 6f 92 push r6 f7e6: 7f 92 push r7 f7e8: 8f 92 push r8 f7ea: 9f 92 push r9 f7ec: af 92 push r10 f7ee: bf 92 push r11 f7f0: cf 92 push r12 f7f2: df 92 push r13 f7f4: ef 92 push r14 f7f6: ff 92 push r15 f7f8: 0f 93 push r16 f7fa: 1f 93 push r17 f7fc: cf 93 push r28 f7fe: df 93 push r29 f800: cd b7 in r28, 0x3d ; 61 f802: de b7 in r29, 0x3e ; 62 f804: 60 97 sbiw r28, 0x10 ; 16 f806: 0f b6 in r0, 0x3f ; 63 f808: f8 94 cli f80a: de bf out 0x3e, r29 ; 62 f80c: 0f be out 0x3f, r0 ; 63 f80e: cd bf out 0x3d, r28 ; 61 f810: 28 2e mov r2, r24 f812: 6e 87 std Y+14, r22 ; 0x0e f814: 5a 87 std Y+10, r21 ; 0x0a f816: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f818: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> f81c: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f81e: 77 24 eor r7, r7 f820: 73 94 inc r7 f822: 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) f826: 42 e0 ldi r20, 0x02 ; 2 f828: 84 17 cp r24, r20 f82a: 09 f4 brne .+2 ; 0xf82e f82c: d4 c1 rjmp .+936 ; 0xfbd6 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); f82e: 08 2f mov r16, r24 f830: 10 e0 ldi r17, 0x00 ; 0 f832: f8 01 movw r30, r16 f834: ec 52 subi r30, 0x2C ; 44 f836: f3 48 sbci r31, 0x83 ; 131 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); DEFINE_PGM_READ_ANY(signed char, byte); f838: 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); f83a: 83 2d mov r24, r3 f83c: 03 2c mov r0, r3 f83e: 00 0c add r0, r0 f840: 99 0b sbc r25, r25 f842: 9c 87 std Y+12, r25 ; 0x0c f844: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f846: d8 01 movw r26, r16 f848: aa 0f add r26, r26 f84a: bb 1f adc r27, r27 f84c: aa 0f add r26, r26 f84e: bb 1f adc r27, r27 f850: ba 83 std Y+2, r27 ; 0x02 f852: a9 83 std Y+1, r26 ; 0x01 f854: fd 01 movw r30, r26 f856: e3 53 subi r30, 0x33 ; 51 f858: fd 4f sbci r31, 0xFD ; 253 f85a: 80 81 ld r24, Z f85c: 91 81 ldd r25, Z+1 ; 0x01 f85e: a2 81 ldd r26, Z+2 ; 0x02 f860: b3 81 ldd r27, Z+3 ; 0x03 f862: 8b 83 std Y+3, r24 ; 0x03 f864: 9c 83 std Y+4, r25 ; 0x04 f866: ad 83 std Y+5, r26 ; 0x05 f868: be 83 std Y+6, r27 ; 0x06 f86a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 f86e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 f872: a0 93 92 02 sts 0x0292, r26 ; 0x800292 f876: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); f87a: bc 01 movw r22, r24 f87c: cd 01 movw r24, r26 f87e: 0e 94 74 67 call 0xcee8 ; 0xcee8 f882: 6b 01 movw r12, r22 f884: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f886: 81 e0 ldi r24, 0x01 ; 1 f888: 02 2c mov r0, r2 f88a: 01 c0 rjmp .+2 ; 0xf88e f88c: 88 0f add r24, r24 f88e: 0a 94 dec r0 f890: ea f7 brpl .-6 ; 0xf88c f892: 0f 94 8b 3b call 0x27716 ; 0x27716 // 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; f896: a9 81 ldd r26, Y+1 ; 0x01 f898: ba 81 ldd r27, Y+2 ; 0x02 f89a: af 5b subi r26, 0xBF ; 191 f89c: b8 4f sbci r27, 0xF8 ; 248 f89e: b8 87 std Y+8, r27 ; 0x08 f8a0: af 83 std Y+7, r26 ; 0x07 f8a2: fd 01 movw r30, r26 f8a4: 10 82 st Z, r1 f8a6: 11 82 std Z+1, r1 ; 0x01 f8a8: 12 82 std Z+2, r1 ; 0x02 f8aa: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f8ac: 0f 94 4b b9 call 0x37296 ; 0x37296 set_destination_to_current(); f8b0: 0e 94 e7 68 call 0xd1ce ; 0xd1ce // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f8b4: 63 2d mov r22, r3 f8b6: 03 2c mov r0, r3 f8b8: 00 0c add r0, r0 f8ba: 77 0b sbc r23, r23 f8bc: 88 0b sbc r24, r24 f8be: 99 0b sbc r25, r25 f8c0: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> f8c4: 4b 01 movw r8, r22 f8c6: 5c 01 movw r10, r24 f8c8: 49 81 ldd r20, Y+1 ; 0x01 f8ca: 5a 81 ldd r21, Y+2 ; 0x02 f8cc: 4e 5a subi r20, 0xAE ; 174 f8ce: 5a 4f sbci r21, 0xFA ; 250 f8d0: 58 8b std Y+16, r21 ; 0x10 f8d2: 4f 87 std Y+15, r20 ; 0x0f f8d4: 20 e0 ldi r18, 0x00 ; 0 f8d6: 30 e0 ldi r19, 0x00 ; 0 f8d8: 40 e4 ldi r20, 0x40 ; 64 f8da: 50 ec ldi r21, 0xC0 ; 192 f8dc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> f8e0: af 85 ldd r26, Y+15 ; 0x0f f8e2: b8 89 ldd r27, Y+16 ; 0x10 f8e4: 6d 93 st X+, r22 f8e6: 7d 93 st X+, r23 f8e8: 8d 93 st X+, r24 f8ea: 9c 93 st X, r25 f8ec: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f8ee: c7 01 movw r24, r14 f8f0: b6 01 movw r22, r12 f8f2: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); f8f6: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); f8fa: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc f8fe: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; f902: ef 81 ldd r30, Y+7 ; 0x07 f904: f8 85 ldd r31, Y+8 ; 0x08 f906: 10 82 st Z, r1 f908: 11 82 std Z+1, r1 ; 0x01 f90a: 12 82 std Z+2, r1 ; 0x02 f90c: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f90e: 0f 94 4b b9 call 0x37296 ; 0x37296 destination[axis] = 1. * axis_home_dir; f912: af 85 ldd r26, Y+15 ; 0x0f f914: b8 89 ldd r27, Y+16 ; 0x10 f916: 8d 92 st X+, r8 f918: 9d 92 st X+, r9 f91a: ad 92 st X+, r10 f91c: bc 92 st X, r11 f91e: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f920: c7 01 movw r24, r14 f922: b6 01 movw r22, r12 f924: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); f928: 0f 94 24 59 call 0x2b248 ; 0x2b248 f92c: 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); f930: e9 81 ldd r30, Y+1 ; 0x01 f932: fa 81 ldd r31, Y+2 ; 0x02 f934: e8 53 subi r30, 0x38 ; 56 f936: f3 48 sbci r31, 0x83 ; 131 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); f938: 45 90 lpm r4, Z+ f93a: 55 90 lpm r5, Z+ f93c: 65 90 lpm r6, Z+ f93e: 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); f940: 2d ec ldi r18, 0xCD ; 205 f942: 3c ec ldi r19, 0xCC ; 204 f944: 4c e8 ldi r20, 0x8C ; 140 f946: 5f e3 ldi r21, 0x3F ; 63 f948: c5 01 movw r24, r10 f94a: b4 01 movw r22, r8 f94c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> f950: a3 01 movw r20, r6 f952: 92 01 movw r18, r4 f954: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> f958: ef 85 ldd r30, Y+15 ; 0x0f f95a: f8 89 ldd r31, Y+16 ; 0x10 f95c: 60 83 st Z, r22 f95e: 71 83 std Z+1, r23 ; 0x01 f960: 82 83 std Z+2, r24 ; 0x02 f962: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f964: c7 01 movw r24, r14 f966: b6 01 movw r22, r12 f968: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); f96c: 0f 94 24 59 call 0x2b248 ; 0x2b248 f970: 71 2c mov r7, r1 f972: 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; f974: 4f 80 ldd r4, Y+7 ; 0x07 f976: 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(); f978: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc f97c: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; f980: d2 01 movw r26, r4 f982: 1d 92 st X+, r1 f984: 1d 92 st X+, r1 f986: 1d 92 st X+, r1 f988: 1c 92 st X, r1 f98a: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f98c: 0f 94 4b b9 call 0x37296 ; 0x37296 destination[axis] = -10.f * axis_home_dir; f990: 20 e0 ldi r18, 0x00 ; 0 f992: 30 e0 ldi r19, 0x00 ; 0 f994: 40 e2 ldi r20, 0x20 ; 32 f996: 51 ec ldi r21, 0xC1 ; 193 f998: c5 01 movw r24, r10 f99a: b4 01 movw r22, r8 f99c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> f9a0: ef 85 ldd r30, Y+15 ; 0x0f f9a2: f8 89 ldd r31, Y+16 ; 0x10 f9a4: 60 83 st Z, r22 f9a6: 71 83 std Z+1, r23 ; 0x01 f9a8: 82 83 std Z+2, r24 ; 0x02 f9aa: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f9ac: c7 01 movw r24, r14 f9ae: b6 01 movw r22, r12 f9b0: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); f9b4: 0f 94 24 59 call 0x2b248 ; 0x2b248 endstops_hit_on_purpose(); f9b8: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc f9bc: f1 e0 ldi r31, 0x01 ; 1 f9be: 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; f9c2: 20 e0 ldi r18, 0x00 ; 0 f9c4: 30 e0 ldi r19, 0x00 ; 0 f9c6: 40 e3 ldi r20, 0x30 ; 48 f9c8: 51 e4 ldi r21, 0x41 ; 65 f9ca: c5 01 movw r24, r10 f9cc: b4 01 movw r22, r8 f9ce: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> f9d2: af 85 ldd r26, Y+15 ; 0x0f f9d4: b8 89 ldd r27, Y+16 ; 0x10 f9d6: 6d 93 st X+, r22 f9d8: 7d 93 st X+, r23 f9da: 8d 93 st X+, r24 f9dc: 9c 93 st X, r25 f9de: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; f9e0: 8b 81 ldd r24, Y+3 ; 0x03 f9e2: 9c 81 ldd r25, Y+4 ; 0x04 f9e4: ad 81 ldd r26, Y+5 ; 0x05 f9e6: be 81 ldd r27, Y+6 ; 0x06 f9e8: 80 93 90 02 sts 0x0290, r24 ; 0x800290 f9ec: 90 93 91 02 sts 0x0291, r25 ; 0x800291 f9f0: a0 93 92 02 sts 0x0292, r26 ; 0x800292 f9f4: 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); f9f8: c7 01 movw r24, r14 f9fa: b6 01 movw r22, r12 f9fc: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); fa00: 0f 94 24 59 call 0x2b248 ; 0x2b248 #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); fa04: 82 2d mov r24, r2 fa06: 0f 94 28 3a call 0x27450 ; 0x27450 fa0a: 9c 01 movw r18, r24 fa0c: 44 e0 ldi r20, 0x04 ; 4 fa0e: 36 95 lsr r19 fa10: 27 95 ror r18 fa12: 4a 95 dec r20 fa14: e1 f7 brne .-8 ; 0xfa0e if (pstep) pstep[i] = mscnt >> 4; fa16: a9 85 ldd r26, Y+9 ; 0x09 fa18: ba 85 ldd r27, Y+10 ; 0x0a fa1a: 10 97 sbiw r26, 0x00 ; 0 fa1c: 21 f0 breq .+8 ; 0xfa26 fa1e: fd 01 movw r30, r26 fa20: e6 0d add r30, r6 fa22: f7 1d adc r31, r7 fa24: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); fa26: 9f 93 push r25 fa28: 8f 93 push r24 fa2a: 3f 93 push r19 fa2c: 2f 93 push r18 fa2e: 7f 92 push r7 fa30: 6f 92 push r6 fa32: e0 eb ldi r30, 0xB0 ; 176 fa34: fc e7 ldi r31, 0x7C ; 124 fa36: ff 93 push r31 fa38: ef 93 push r30 fa3a: 0f 94 4b dc call 0x3b896 ; 0x3b896 fa3e: 4f ef ldi r20, 0xFF ; 255 fa40: 64 1a sub r6, r20 fa42: 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++) fa44: 0f b6 in r0, 0x3f ; 63 fa46: f8 94 cli fa48: de bf out 0x3e, r29 ; 62 fa4a: 0f be out 0x3f, r0 ; 63 fa4c: cd bf out 0x3d, r28 ; 61 fa4e: 9e 85 ldd r25, Y+14 ; 0x0e fa50: 69 16 cp r6, r25 fa52: 08 f4 brcc .+2 ; 0xfa56 fa54: 91 cf rjmp .-222 ; 0xf978 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(); fa56: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc fa5a: 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)) fa5e: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 fa62: 88 23 and r24, r24 fa64: 09 f4 brne .+2 ; 0xfa68 fa66: b2 c0 rjmp .+356 ; 0xfbcc } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; fa68: f8 01 movw r30, r16 fa6a: ec 50 subi r30, 0x0C ; 12 fa6c: fb 4f sbci r31, 0xFB ; 251 fa6e: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) fa70: 60 34 cpi r22, 0x40 ; 64 fa72: 08 f0 brcs .+2 ; 0xfa76 fa74: ab c0 rjmp .+342 ; 0xfbcc endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; fa76: f8 01 movw r30, r16 fa78: e6 5a subi r30, 0xA6 ; 166 fa7a: fd 4f sbci r31, 0xFD ; 253 fa7c: a0 81 ld r26, Z fa7e: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); fa80: f8 01 movw r30, r16 fa82: ea 50 subi r30, 0x0A ; 10 fa84: fb 4f sbci r31, 0xFB ; 251 fa86: 80 81 ld r24, Z fa88: 40 e0 ldi r20, 0x00 ; 0 fa8a: 51 e0 ldi r21, 0x01 ; 1 fa8c: 02 c0 rjmp .+4 ; 0xfa92 fa8e: 56 95 lsr r21 fa90: 47 95 ror r20 fa92: 8a 95 dec r24 fa94: e2 f7 brpl .-8 ; 0xfa8e if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); fa96: 82 2d mov r24, r2 fa98: 0f 94 6d 8b call 0x316da ; 0x316da if (back > 0) fa9c: bb 81 ldd r27, Y+3 ; 0x03 fa9e: bb 23 and r27, r27 faa0: 39 f0 breq .+14 ; 0xfab0 tmc2130_do_steps(axis, back, -axis_home_dir, 1000); faa2: 43 2d mov r20, r3 faa4: 41 95 neg r20 faa6: 6b 2f mov r22, r27 faa8: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); faaa: 82 2d mov r24, r2 faac: 0f 94 3e 8b call 0x3167c ; 0x3167c tmc2130_home_exit(); fab0: 0f 94 5c 3b call 0x276b8 ; 0x276b8 #endif //TMC2130 axis_is_at_home(axis); fab4: 82 2d mov r24, r2 fab6: 0e 94 48 5b call 0xb690 ; 0xb690 axis_known_position[axis] = true; faba: f8 01 movw r30, r16 fabc: e2 5c subi r30, 0xC2 ; 194 fabe: f8 4f sbci r31, 0xF8 ; 248 fac0: 81 e0 ldi r24, 0x01 ; 1 fac2: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; fac4: 6b 85 ldd r22, Y+11 ; 0x0b fac6: 7c 85 ldd r23, Y+12 ; 0x0c fac8: 71 95 neg r23 faca: 61 95 neg r22 facc: 71 09 sbc r23, r1 face: 07 2e mov r0, r23 fad0: 00 0c add r0, r0 fad2: 88 0b sbc r24, r24 fad4: 99 0b sbc r25, r25 fad6: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> fada: 2a e0 ldi r18, 0x0A ; 10 fadc: 37 ed ldi r19, 0xD7 ; 215 fade: 43 e2 ldi r20, 0x23 ; 35 fae0: 5c e3 ldi r21, 0x3C ; 60 fae2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> fae6: 4b 01 movw r8, r22 fae8: 5c 01 movw r10, r24 faea: f8 01 movw r30, r16 faec: e8 5a subi r30, 0xA8 ; 168 faee: fd 4f sbci r31, 0xFD ; 253 faf0: 60 81 ld r22, Z faf2: 70 e0 ldi r23, 0x00 ; 0 faf4: 90 e0 ldi r25, 0x00 ; 0 faf6: 80 e0 ldi r24, 0x00 ; 0 faf8: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> fafc: 9b 01 movw r18, r22 fafe: ac 01 movw r20, r24 fb00: c5 01 movw r24, r10 fb02: b4 01 movw r22, r8 fb04: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> fb08: 4b 01 movw r8, r22 fb0a: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; fb0c: e9 81 ldd r30, Y+1 ; 0x01 fb0e: fa 81 ldd r31, Y+2 ; 0x02 fb10: ef 5b subi r30, 0xBF ; 191 fb12: f8 4f sbci r31, 0xF8 ; 248 fb14: fc 83 std Y+4, r31 ; 0x04 fb16: eb 83 std Y+3, r30 ; 0x03 fb18: ac 01 movw r20, r24 fb1a: 9b 01 movw r18, r22 fb1c: 60 81 ld r22, Z fb1e: 71 81 ldd r23, Z+1 ; 0x01 fb20: 82 81 ldd r24, Z+2 ; 0x02 fb22: 93 81 ldd r25, Z+3 ; 0x03 fb24: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> fb28: ab 81 ldd r26, Y+3 ; 0x03 fb2a: bc 81 ldd r27, Y+4 ; 0x04 fb2c: 6d 93 st X+, r22 fb2e: 7d 93 st X+, r23 fb30: 8d 93 st X+, r24 fb32: 9c 93 st X, r25 fb34: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); fb36: 0f 94 4b b9 call 0x37296 ; 0x37296 current_position[axis] += dist; fb3a: eb 81 ldd r30, Y+3 ; 0x03 fb3c: fc 81 ldd r31, Y+4 ; 0x04 fb3e: 20 81 ld r18, Z fb40: 31 81 ldd r19, Z+1 ; 0x01 fb42: 42 81 ldd r20, Z+2 ; 0x02 fb44: 53 81 ldd r21, Z+3 ; 0x03 fb46: c5 01 movw r24, r10 fb48: b4 01 movw r22, r8 fb4a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> fb4e: ab 81 ldd r26, Y+3 ; 0x03 fb50: bc 81 ldd r27, Y+4 ; 0x04 fb52: 6d 93 st X+, r22 fb54: 7d 93 st X+, r23 fb56: 8d 93 st X+, r24 fb58: 9c 93 st X, r25 fb5a: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; fb5c: e9 81 ldd r30, Y+1 ; 0x01 fb5e: fa 81 ldd r31, Y+2 ; 0x02 fb60: ee 5a subi r30, 0xAE ; 174 fb62: fa 4f sbci r31, 0xFA ; 250 fb64: 60 83 st Z, r22 fb66: 71 83 std Z+1, r23 ; 0x01 fb68: 82 83 std Z+2, r24 ; 0x02 fb6a: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); fb6c: 20 e0 ldi r18, 0x00 ; 0 fb6e: 30 e0 ldi r19, 0x00 ; 0 fb70: 40 e0 ldi r20, 0x00 ; 0 fb72: 5f e3 ldi r21, 0x3F ; 63 fb74: c7 01 movw r24, r14 fb76: b6 01 movw r22, r12 fb78: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> fb7c: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); fb80: 0f 94 24 59 call 0x2b248 ; 0x2b248 feedrate = 0.0; fb84: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fb88: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fb8c: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fb90: 10 92 93 02 sts 0x0293, r1 ; 0x800293 fb94: fd 85 ldd r31, Y+13 ; 0x0d fb96: f0 93 8f 02 sts 0x028F, r31 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } fb9a: 60 96 adiw r28, 0x10 ; 16 fb9c: 0f b6 in r0, 0x3f ; 63 fb9e: f8 94 cli fba0: de bf out 0x3e, r29 ; 62 fba2: 0f be out 0x3f, r0 ; 63 fba4: cd bf out 0x3d, r28 ; 61 fba6: df 91 pop r29 fba8: cf 91 pop r28 fbaa: 1f 91 pop r17 fbac: 0f 91 pop r16 fbae: ff 90 pop r15 fbb0: ef 90 pop r14 fbb2: df 90 pop r13 fbb4: cf 90 pop r12 fbb6: bf 90 pop r11 fbb8: af 90 pop r10 fbba: 9f 90 pop r9 fbbc: 8f 90 pop r8 fbbe: 7f 90 pop r7 fbc0: 6f 90 pop r6 fbc2: 5f 90 pop r5 fbc4: 4f 90 pop r4 fbc6: 3f 90 pop r3 fbc8: 2f 90 pop r2 fbca: 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); fbcc: 43 2d mov r20, r3 fbce: 41 95 neg r20 fbd0: 68 e0 ldi r22, 0x08 ; 8 fbd2: 70 e0 ldi r23, 0x00 ; 0 fbd4: 6a cf rjmp .-300 ; 0xfaaa feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; fbd6: 81 e0 ldi r24, 0x01 ; 1 fbd8: 0e 94 5d 67 call 0xceba ; 0xceba #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); fbdc: e6 ed ldi r30, 0xD6 ; 214 fbde: fc e7 ldi r31, 0x7C ; 124 fbe0: b4 91 lpm r27, Z fbe2: 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; fbe4: 10 92 49 07 sts 0x0749, r1 ; 0x800749 fbe8: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a fbec: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b fbf0: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c plan_set_position_curposXYZE(); fbf4: 0f 94 4b b9 call 0x37296 ; 0x37296 #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); fbf8: e0 ed ldi r30, 0xD0 ; 208 fbfa: fc e7 ldi r31, 0x7C ; 124 fbfc: 85 90 lpm r8, Z+ fbfe: 95 90 lpm r9, Z+ fc00: a5 90 lpm r10, Z+ fc02: 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; fc04: e9 81 ldd r30, Y+1 ; 0x01 fc06: 6e 2f mov r22, r30 fc08: ee 0f add r30, r30 fc0a: 77 0b sbc r23, r23 fc0c: 88 0b sbc r24, r24 fc0e: 99 0b sbc r25, r25 fc10: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> fc14: 6b 01 movw r12, r22 fc16: 7c 01 movw r14, r24 fc18: 20 e0 ldi r18, 0x00 ; 0 fc1a: 30 e0 ldi r19, 0x00 ; 0 fc1c: 40 ec ldi r20, 0xC0 ; 192 fc1e: 5f e3 ldi r21, 0x3F ; 63 fc20: c5 01 movw r24, r10 fc22: b4 01 movw r22, r8 fc24: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> fc28: a7 01 movw r20, r14 fc2a: 96 01 movw r18, r12 fc2c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> fc30: 60 93 5a 05 sts 0x055A, r22 ; 0x80055a fc34: 70 93 5b 05 sts 0x055B, r23 ; 0x80055b fc38: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c fc3c: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d feedrate = homing_feedrate[axis]; fc40: 80 e0 ldi r24, 0x00 ; 0 fc42: 90 e0 ldi r25, 0x00 ; 0 fc44: a8 e4 ldi r26, 0x48 ; 72 fc46: b4 e4 ldi r27, 0x44 ; 68 fc48: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fc4c: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fc50: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fc54: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); fc58: bc 01 movw r22, r24 fc5a: cd 01 movw r24, r26 fc5c: 0e 94 74 67 call 0xcee8 ; 0xcee8 fc60: 4b 01 movw r8, r22 fc62: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); fc64: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); fc68: 0f 94 24 59 call 0x2b248 ; 0x2b248 #ifdef TMC2130 check_Z_crash(); fc6c: 0e 94 b4 7b call 0xf768 ; 0xf768 #endif //TMC2130 current_position[axis] = 0; fc70: 10 92 49 07 sts 0x0749, r1 ; 0x800749 fc74: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a fc78: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b fc7c: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c plan_set_position_curposXYZE(); fc80: 0f 94 4b b9 call 0x37296 ; 0x37296 #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); fc84: ec ea ldi r30, 0xAC ; 172 fc86: fc e7 ldi r31, 0x7C ; 124 fc88: 65 91 lpm r22, Z+ fc8a: 75 91 lpm r23, Z+ fc8c: 85 91 lpm r24, Z+ fc8e: 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; fc90: 90 58 subi r25, 0x80 ; 128 fc92: a7 01 movw r20, r14 fc94: 96 01 movw r18, r12 fc96: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> fc9a: 60 93 5a 05 sts 0x055A, r22 ; 0x80055a fc9e: 70 93 5b 05 sts 0x055B, r23 ; 0x80055b fca2: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c fca6: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d plan_buffer_line_destinationXYZE(feedrate_mm_s); fcaa: c5 01 movw r24, r10 fcac: b4 01 movw r22, r8 fcae: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); fcb2: 0f 94 24 59 call 0x2b248 ; 0x2b248 #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); fcb6: ec ea ldi r30, 0xAC ; 172 fcb8: fc e7 ldi r31, 0x7C ; 124 fcba: 65 91 lpm r22, Z+ fcbc: 75 91 lpm r23, Z+ fcbe: 85 91 lpm r24, Z+ fcc0: 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; fcc2: 9b 01 movw r18, r22 fcc4: ac 01 movw r20, r24 fcc6: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> fcca: a7 01 movw r20, r14 fccc: 96 01 movw r18, r12 fcce: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> fcd2: 60 93 5a 05 sts 0x055A, r22 ; 0x80055a fcd6: 70 93 5b 05 sts 0x055B, r23 ; 0x80055b fcda: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c fcde: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d feedrate = homing_feedrate[axis] / 2; fce2: 80 e0 ldi r24, 0x00 ; 0 fce4: 90 e0 ldi r25, 0x00 ; 0 fce6: a8 ec ldi r26, 0xC8 ; 200 fce8: b3 e4 ldi r27, 0x43 ; 67 fcea: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fcee: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fcf2: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fcf6: b0 93 93 02 sts 0x0293, r27 ; 0x800293 feedrate_mm_s = get_feedrate_mm_s(feedrate); fcfa: bc 01 movw r22, r24 fcfc: cd 01 movw r24, r26 fcfe: 0e 94 74 67 call 0xcee8 ; 0xcee8 plan_buffer_line_destinationXYZE(feedrate_mm_s); fd02: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); fd06: 0f 94 24 59 call 0x2b248 ; 0x2b248 #ifdef TMC2130 check_Z_crash(); fd0a: 0e 94 b4 7b call 0xf768 ; 0xf768 #endif //TMC2130 axis_is_at_home(axis); fd0e: 82 e0 ldi r24, 0x02 ; 2 fd10: 0e 94 48 5b call 0xb690 ; 0xb690 destination[axis] = current_position[axis]; fd14: 80 91 49 07 lds r24, 0x0749 ; 0x800749 fd18: 90 91 4a 07 lds r25, 0x074A ; 0x80074a fd1c: a0 91 4b 07 lds r26, 0x074B ; 0x80074b fd20: b0 91 4c 07 lds r27, 0x074C ; 0x80074c fd24: 80 93 5a 05 sts 0x055A, r24 ; 0x80055a fd28: 90 93 5b 05 sts 0x055B, r25 ; 0x80055b fd2c: a0 93 5c 05 sts 0x055C, r26 ; 0x80055c fd30: b0 93 5d 05 sts 0x055D, r27 ; 0x80055d feedrate = 0.0; fd34: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fd38: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fd3c: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fd40: 10 92 93 02 sts 0x0293, r1 ; 0x800293 endstops_hit_on_purpose(); fd44: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc axis_known_position[axis] = true; fd48: 70 92 40 07 sts 0x0740, r7 ; 0x800740 #ifdef TMC2130 FORCE_HIGH_POWER_END; fd4c: 80 e0 ldi r24, 0x00 ; 0 fd4e: 0e 94 5d 67 call 0xceba ; 0xceba fd52: 20 cf rjmp .-448 ; 0xfb94 0000fd54 : #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 { fd54: 2f 92 push r2 fd56: 3f 92 push r3 fd58: 4f 92 push r4 fd5a: 5f 92 push r5 fd5c: 6f 92 push r6 fd5e: 7f 92 push r7 fd60: 8f 92 push r8 fd62: 9f 92 push r9 fd64: af 92 push r10 fd66: bf 92 push r11 fd68: cf 92 push r12 fd6a: df 92 push r13 fd6c: ef 92 push r14 fd6e: ff 92 push r15 fd70: 0f 93 push r16 fd72: 1f 93 push r17 fd74: cf 93 push r28 fd76: df 93 push r29 fd78: 00 d0 rcall .+0 ; 0xfd7a fd7a: 1f 92 push r1 fd7c: 1f 92 push r1 fd7e: cd b7 in r28, 0x3d ; 61 fd80: de b7 in r29, 0x3e ; 62 fd82: d8 2e mov r13, r24 fd84: 2a 01 movw r4, r20 fd86: 3b 01 movw r6, r22 fd88: 32 2e mov r3, r18 fd8a: e9 82 std Y+1, r14 ; 0x01 fd8c: fa 82 std Y+2, r15 ; 0x02 fd8e: 0b 83 std Y+3, r16 ; 0x03 fd90: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); fd92: 0f 94 24 59 call 0x2b248 ; 0x2b248 homing_flag = true; fd96: 81 e0 ldi r24, 0x01 ; 1 fd98: 80 93 56 0e sts 0x0E56, r24 ; 0x800e56 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; fd9c: fc 2c mov r15, r12 fd9e: e3 2c mov r14, r3 fda0: d3 10 cpse r13, r3 fda2: 10 c0 rjmp .+32 ; 0xfdc4 fda4: ed 2c mov r14, r13 fda6: dc 10 cpse r13, r12 fda8: 0d c0 rjmp .+26 ; 0xfdc4 // 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); fdaa: 60 e0 ldi r22, 0x00 ; 0 fdac: 70 e0 ldi r23, 0x00 ; 0 fdae: 80 ea ldi r24, 0xA0 ; 160 fdb0: 90 e4 ldi r25, 0x40 ; 64 fdb2: 0e 94 0d 6f call 0xde1a ; 0xde1a // 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; fdb6: ff 24 eor r15, r15 fdb8: f3 94 inc r15 fdba: ee 24 eor r14, r14 fdbc: e3 94 inc r14 fdbe: 22 24 eor r2, r2 fdc0: 23 94 inc r2 fdc2: 01 c0 rjmp .+2 ; 0xfdc6 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; fdc4: 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(); fdc6: 0f 94 a8 cb call 0x39750 ; 0x39750 // 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; fdca: 80 91 9e 13 lds r24, 0x139E ; 0x80139e fdce: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; fdd0: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); fdd4: 82 e0 ldi r24, 0x02 ; 2 fdd6: 0f 94 10 59 call 0x2b220 ; 0x2b220 fdda: 60 93 49 07 sts 0x0749, r22 ; 0x800749 fdde: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a fde2: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b fde6: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) fdea: f1 10 cpse r15, r1 babystep_undo(); fdec: 0f 94 4d c7 call 0x38e9a ; 0x38e9a int l_feedmultiply = setup_for_endstop_move(); fdf0: 81 e0 ldi r24, 0x01 ; 1 fdf2: 0e 94 95 67 call 0xcf2a ; 0xcf2a fdf6: 8c 01 movw r16, r24 set_destination_to_current(); fdf8: 0e 94 e7 68 call 0xd1ce ; 0xd1ce feedrate = 0.0; fdfc: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fe00: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fe04: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fe08: 10 92 93 02 sts 0x0293, r1 ; 0x800293 current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) fe0c: 22 20 and r2, r2 fe0e: 09 f4 brne .+2 ; 0xfe12 fe10: 77 c1 rjmp .+750 ; 0x10100 { if (!calib) fe12: 9b 8d ldd r25, Y+27 ; 0x1b fe14: 91 11 cpse r25, r1 fe16: 6a c1 rjmp .+724 ; 0x100ec homeaxis(X_AXIS); fe18: 50 e0 ldi r21, 0x00 ; 0 fe1a: 40 e0 ldi r20, 0x00 ; 0 fe1c: 61 e0 ldi r22, 0x01 ; 1 fe1e: 80 e0 ldi r24, 0x00 ; 0 fe20: 0e 94 ee 7b call 0xf7dc ; 0xf7dc else tmc2130_home_calibrate(X_AXIS); } if(home_y) fe24: ee 20 and r14, r14 fe26: 31 f0 breq .+12 ; 0xfe34 { if (!calib) homeaxis(Y_AXIS); fe28: 50 e0 ldi r21, 0x00 ; 0 fe2a: 40 e0 ldi r20, 0x00 ; 0 fe2c: 61 e0 ldi r22, 0x01 ; 1 fe2e: 81 e0 ldi r24, 0x01 ; 1 fe30: 0e 94 ee 7b call 0xf7dc ; 0xf7dc if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) fe34: dd 20 and r13, r13 fe36: e9 f0 breq .+58 ; 0xfe72 fe38: 41 14 cp r4, r1 fe3a: 51 04 cpc r5, r1 fe3c: 61 04 cpc r6, r1 fe3e: 71 04 cpc r7, r1 fe40: c1 f0 breq .+48 ; 0xfe72 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; fe42: c3 01 movw r24, r6 fe44: b2 01 movw r22, r4 fe46: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> fe4a: 9b 01 movw r18, r22 fe4c: ac 01 movw r20, r24 fe4e: 60 91 c4 06 lds r22, 0x06C4 ; 0x8006c4 fe52: 70 91 c5 06 lds r23, 0x06C5 ; 0x8006c5 fe56: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 fe5a: 90 91 c7 06 lds r25, 0x06C7 ; 0x8006c7 fe5e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> fe62: 60 93 41 07 sts 0x0741, r22 ; 0x800741 fe66: 70 93 42 07 sts 0x0742, r23 ; 0x800742 fe6a: 80 93 43 07 sts 0x0743, r24 ; 0x800743 fe6e: 90 93 44 07 sts 0x0744, r25 ; 0x800744 if(home_y_axis && home_y_value != 0) fe72: 33 20 and r3, r3 fe74: 01 f1 breq .+64 ; 0xfeb6 fe76: 89 81 ldd r24, Y+1 ; 0x01 fe78: 9a 81 ldd r25, Y+2 ; 0x02 fe7a: ab 81 ldd r26, Y+3 ; 0x03 fe7c: bc 81 ldd r27, Y+4 ; 0x04 fe7e: 00 97 sbiw r24, 0x00 ; 0 fe80: a1 05 cpc r26, r1 fe82: b1 05 cpc r27, r1 fe84: c1 f0 breq .+48 ; 0xfeb6 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; fe86: bc 01 movw r22, r24 fe88: cd 01 movw r24, r26 fe8a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> fe8e: 9b 01 movw r18, r22 fe90: ac 01 movw r20, r24 fe92: 60 91 c8 06 lds r22, 0x06C8 ; 0x8006c8 fe96: 70 91 c9 06 lds r23, 0x06C9 ; 0x8006c9 fe9a: 80 91 ca 06 lds r24, 0x06CA ; 0x8006ca fe9e: 90 91 cb 06 lds r25, 0x06CB ; 0x8006cb fea2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> fea6: 60 93 45 07 sts 0x0745, r22 ; 0x800745 feaa: 70 93 46 07 sts 0x0746, r23 ; 0x800746 feae: 80 93 47 07 sts 0x0747, r24 ; 0x800747 feb2: 90 93 48 07 sts 0x0748, r25 ; 0x800748 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { feb6: ff 20 and r15, r15 feb8: 09 f4 brne .+2 ; 0xfebc feba: a2 c0 rjmp .+324 ; 0x10000 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); febc: 60 e0 ldi r22, 0x00 ; 0 febe: 70 e0 ldi r23, 0x00 ; 0 fec0: 80 ea ldi r24, 0xA0 ; 160 fec2: 90 e4 ldi r25, 0x40 ; 64 fec4: 0e 94 0d 6f call 0xde1a ; 0xde1a if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); fec8: 80 91 3e 07 lds r24, 0x073E ; 0x80073e fecc: 81 11 cpse r24, r1 fece: 05 c0 rjmp .+10 ; 0xfeda fed0: 50 e0 ldi r21, 0x00 ; 0 fed2: 40 e0 ldi r20, 0x00 ; 0 fed4: 61 e0 ldi r22, 0x01 ; 1 fed6: 0e 94 ee 7b call 0xf7dc ; 0xf7dc if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); feda: 80 91 3f 07 lds r24, 0x073F ; 0x80073f fede: 81 11 cpse r24, r1 fee0: 06 c0 rjmp .+12 ; 0xfeee fee2: 50 e0 ldi r21, 0x00 ; 0 fee4: 40 e0 ldi r20, 0x00 ; 0 fee6: 61 e0 ldi r22, 0x01 ; 1 fee8: 81 e0 ldi r24, 0x01 ; 1 feea: 0e 94 ee 7b call 0xf7dc ; 0xf7dc // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); feee: 0f 94 0d cc call 0x3981a ; 0x3981a world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); fef2: ea e1 ldi r30, 0x1A ; 26 fef4: f2 e9 ldi r31, 0x92 ; 146 fef6: 85 91 lpm r24, Z+ fef8: 95 91 lpm r25, Z+ fefa: a5 91 lpm r26, Z+ fefc: b4 91 lpm r27, Z fefe: e6 e1 ldi r30, 0x16 ; 22 ff00: f2 e9 ldi r31, 0x92 ; 146 ff02: 45 91 lpm r20, Z+ ff04: 55 91 lpm r21, Z+ ff06: 65 91 lpm r22, Z+ ff08: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; ff0a: 40 93 52 05 sts 0x0552, r20 ; 0x800552 ff0e: 50 93 53 05 sts 0x0553, r21 ; 0x800553 ff12: 60 93 54 05 sts 0x0554, r22 ; 0x800554 ff16: 70 93 55 05 sts 0x0555, r23 ; 0x800555 out_y = y; ff1a: 80 93 56 05 sts 0x0556, r24 ; 0x800556 ff1e: 90 93 57 05 sts 0x0557, r25 ; 0x800557 ff22: a0 93 58 05 sts 0x0558, r26 ; 0x800558 ff26: b0 93 59 05 sts 0x0559, r27 ; 0x800559 world2machine(out_x, out_y); ff2a: 66 e5 ldi r22, 0x56 ; 86 ff2c: 75 e0 ldi r23, 0x05 ; 5 ff2e: 82 e5 ldi r24, 0x52 ; 82 ff30: 95 e0 ldi r25, 0x05 ; 5 ff32: 0e 94 af 6a call 0xd55e ; 0xd55e world2machine_reset(); ff36: 0f 94 6f cb call 0x396de ; 0x396de if (destination[Y_AXIS] < Y_MIN_POS) ff3a: 20 e0 ldi r18, 0x00 ; 0 ff3c: 30 e0 ldi r19, 0x00 ; 0 ff3e: 40 e8 ldi r20, 0x80 ; 128 ff40: 50 ec ldi r21, 0xC0 ; 192 ff42: 60 91 56 05 lds r22, 0x0556 ; 0x800556 ff46: 70 91 57 05 lds r23, 0x0557 ; 0x800557 ff4a: 80 91 58 05 lds r24, 0x0558 ; 0x800558 ff4e: 90 91 59 05 lds r25, 0x0559 ; 0x800559 ff52: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> ff56: 87 ff sbrs r24, 7 ff58: 0c c0 rjmp .+24 ; 0xff72 destination[Y_AXIS] = Y_MIN_POS; ff5a: 80 e0 ldi r24, 0x00 ; 0 ff5c: 90 e0 ldi r25, 0x00 ; 0 ff5e: a0 e8 ldi r26, 0x80 ; 128 ff60: b0 ec ldi r27, 0xC0 ; 192 ff62: 80 93 56 05 sts 0x0556, r24 ; 0x800556 ff66: 90 93 57 05 sts 0x0557, r25 ; 0x800557 ff6a: a0 93 58 05 sts 0x0558, r26 ; 0x800558 ff6e: b0 93 59 05 sts 0x0559, r27 ; 0x800559 feedrate = homing_feedrate[X_AXIS] / 20; ff72: 80 e0 ldi r24, 0x00 ; 0 ff74: 90 e0 ldi r25, 0x00 ; 0 ff76: a6 e1 ldi r26, 0x16 ; 22 ff78: b3 e4 ldi r27, 0x43 ; 67 ff7a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 ff7e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 ff82: a0 93 92 02 sts 0x0292, r26 ; 0x800292 ff86: b0 93 93 02 sts 0x0293, r27 ; 0x800293 ff8a: 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(); ff8e: 0f 94 4b b9 call 0x37296 ; 0x37296 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); ff92: 60 91 90 02 lds r22, 0x0290 ; 0x800290 ff96: 70 91 91 02 lds r23, 0x0291 ; 0x800291 ff9a: 80 91 92 02 lds r24, 0x0292 ; 0x800292 ff9e: 90 91 93 02 lds r25, 0x0293 ; 0x800293 ffa2: 0f 94 58 ba call 0x374b0 ; 0x374b0 st_synchronize(); ffa6: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position[X_AXIS] = destination[X_AXIS]; ffaa: 80 91 52 05 lds r24, 0x0552 ; 0x800552 ffae: 90 91 53 05 lds r25, 0x0553 ; 0x800553 ffb2: a0 91 54 05 lds r26, 0x0554 ; 0x800554 ffb6: b0 91 55 05 lds r27, 0x0555 ; 0x800555 ffba: 80 93 41 07 sts 0x0741, r24 ; 0x800741 ffbe: 90 93 42 07 sts 0x0742, r25 ; 0x800742 ffc2: a0 93 43 07 sts 0x0743, r26 ; 0x800743 ffc6: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = destination[Y_AXIS]; ffca: 80 91 56 05 lds r24, 0x0556 ; 0x800556 ffce: 90 91 57 05 lds r25, 0x0557 ; 0x800557 ffd2: a0 91 58 05 lds r26, 0x0558 ; 0x800558 ffd6: b0 91 59 05 lds r27, 0x0559 ; 0x800559 ffda: 80 93 45 07 sts 0x0745, r24 ; 0x800745 ffde: 90 93 46 07 sts 0x0746, r25 ; 0x800746 ffe2: a0 93 47 07 sts 0x0747, r26 ; 0x800747 ffe6: b0 93 48 07 sts 0x0748, r27 ; 0x800748 ffea: 81 e0 ldi r24, 0x01 ; 1 ffec: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); endstops_hit_on_purpose(); fff0: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc homeaxis(Z_AXIS); fff4: 50 e0 ldi r21, 0x00 ; 0 fff6: 40 e0 ldi r20, 0x00 ; 0 fff8: 61 e0 ldi r22, 0x01 ; 1 fffa: 82 e0 ldi r24, 0x02 ; 2 fffc: 0e 94 ee 7b call 0xf7dc ; 0xf7dc homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) 10000: cc 20 and r12, r12 10002: e9 f0 breq .+58 ; 0x1003e 10004: 81 14 cp r8, r1 10006: 91 04 cpc r9, r1 10008: a1 04 cpc r10, r1 1000a: b1 04 cpc r11, r1 1000c: c1 f0 breq .+48 ; 0x1003e current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; 1000e: c5 01 movw r24, r10 10010: b4 01 movw r22, r8 10012: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 10016: 9b 01 movw r18, r22 10018: ac 01 movw r20, r24 1001a: 60 91 cc 06 lds r22, 0x06CC ; 0x8006cc 1001e: 70 91 cd 06 lds r23, 0x06CD ; 0x8006cd 10022: 80 91 ce 06 lds r24, 0x06CE ; 0x8006ce 10026: 90 91 cf 06 lds r25, 0x06CF ; 0x8006cf 1002a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1002e: 60 93 49 07 sts 0x0749, r22 ; 0x800749 10032: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 10036: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 1003a: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c // 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(); 1003e: 0f 94 4b b9 call 0x37296 ; 0x37296 clean_up_after_endstop_move(l_feedmultiply); 10042: c8 01 movw r24, r16 10044: 0e 94 7b 67 call 0xcef6 ; 0xcef6 endstops_hit_on_purpose(); 10048: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc // Load the machine correction matrix world2machine_initialize(); 1004c: 0f 94 0d cc call 0x3981a ; 0x3981a // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); 10050: 0f 94 ab c9 call 0x39356 ; 0x39356 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) 10054: d1 10 cpse r13, r1 10056: 07 c0 rjmp .+14 ; 0x10066 10058: 31 10 cpse r3, r1 1005a: 05 c0 rjmp .+10 ; 0x10066 1005c: 8c 8d ldd r24, Y+28 ; 0x1c 1005e: 81 11 cpse r24, r1 10060: 02 c0 rjmp .+4 ; 0x10066 10062: cc 20 and r12, r12 10064: 39 f1 breq .+78 ; 0x100b4 { if (! home_z && mbl_was_active) { 10066: f1 10 cpse r15, r1 10068: 25 c0 rjmp .+74 ; 0x100b4 1006a: 9d 81 ldd r25, Y+5 ; 0x05 1006c: 99 23 and r25, r25 1006e: 11 f1 breq .+68 ; 0x100b4 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; 10070: 81 e0 ldi r24, 0x01 ; 1 10072: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e // 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)); 10076: 0f 94 10 59 call 0x2b220 ; 0x2b220 1007a: 6b 01 movw r12, r22 1007c: 7c 01 movw r14, r24 1007e: 80 e0 ldi r24, 0x00 ; 0 10080: 0f 94 10 59 call 0x2b220 ; 0x2b220 10084: a7 01 movw r20, r14 10086: 96 01 movw r18, r12 10088: 0f 94 4b 96 call 0x32c96 ; 0x32c96 1008c: 9b 01 movw r18, r22 1008e: ac 01 movw r20, r24 10090: 60 91 49 07 lds r22, 0x0749 ; 0x800749 10094: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 10098: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 1009c: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 100a0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 100a4: 60 93 49 07 sts 0x0749, r22 ; 0x800749 100a8: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 100ac: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 100b0: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c } #endif prusa_statistics(20); st_synchronize(); 100b4: 0f 94 24 59 call 0x2b248 ; 0x2b248 homing_flag = false; 100b8: 10 92 56 0e sts 0x0E56, r1 ; 0x800e56 #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 } 100bc: 0f 90 pop r0 100be: 0f 90 pop r0 100c0: 0f 90 pop r0 100c2: 0f 90 pop r0 100c4: 0f 90 pop r0 100c6: df 91 pop r29 100c8: cf 91 pop r28 100ca: 1f 91 pop r17 100cc: 0f 91 pop r16 100ce: ff 90 pop r15 100d0: ef 90 pop r14 100d2: df 90 pop r13 100d4: cf 90 pop r12 100d6: bf 90 pop r11 100d8: af 90 pop r10 100da: 9f 90 pop r9 100dc: 8f 90 pop r8 100de: 7f 90 pop r7 100e0: 6f 90 pop r6 100e2: 5f 90 pop r5 100e4: 4f 90 pop r4 100e6: 3f 90 pop r3 100e8: 2f 90 pop r2 100ea: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); 100ec: 80 e0 ldi r24, 0x00 ; 0 100ee: 0f 94 4e 38 call 0x2709c ; 0x2709c } if(home_y) 100f2: ee 20 and r14, r14 100f4: 09 f4 brne .+2 ; 0x100f8 100f6: 9e ce rjmp .-708 ; 0xfe34 { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); 100f8: 81 e0 ldi r24, 0x01 ; 1 100fa: 0f 94 4e 38 call 0x2709c ; 0x2709c 100fe: 9a ce rjmp .-716 ; 0xfe34 homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) 10100: ee 20 and r14, r14 10102: 09 f4 brne .+2 ; 0x10106 10104: 97 ce rjmp .-722 ; 0xfe34 { if (!calib) 10106: ab 8d ldd r26, Y+27 ; 0x1b 10108: aa 23 and r26, r26 1010a: 09 f4 brne .+2 ; 0x1010e 1010c: 8d ce rjmp .-742 ; 0xfe28 1010e: f4 cf rjmp .-24 ; 0x100f8 00010110 : 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) { 10110: 8f 92 push r8 10112: 9f 92 push r9 10114: af 92 push r10 10116: bf 92 push r11 10118: cf 92 push r12 1011a: ef 92 push r14 1011c: ff 92 push r15 1011e: 0f 93 push r16 10120: 1f 93 push r17 10122: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); 10124: 91 e0 ldi r25, 0x01 ; 1 10126: 9f 93 push r25 10128: 1f 92 push r1 1012a: 81 2c mov r8, r1 1012c: 91 2c mov r9, r1 1012e: 54 01 movw r10, r8 10130: c4 2e mov r12, r20 10132: e1 2c mov r14, r1 10134: f1 2c mov r15, r1 10136: 87 01 movw r16, r14 10138: 40 e0 ldi r20, 0x00 ; 0 1013a: 50 e0 ldi r21, 0x00 ; 0 1013c: ba 01 movw r22, r20 1013e: 0e 94 aa 7e call 0xfd54 ; 0xfd54 10142: 0f 90 pop r0 10144: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } 10146: 1f 91 pop r17 10148: 0f 91 pop r16 1014a: ff 90 pop r15 1014c: ef 90 pop r14 1014e: cf 90 pop r12 10150: bf 90 pop r11 10152: af 90 pop r10 10154: 9f 90 pop r9 10156: 8f 90 pop r8 10158: 08 95 ret 0001015a : // 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(); 1015a: 86 e8 ldi r24, 0x86 ; 134 1015c: 93 e0 ldi r25, 0x03 ; 3 1015e: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) 10162: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 10166: 90 91 80 10 lds r25, 0x1080 ; 0x801080 1016a: 89 2b or r24, r25 1016c: 79 f0 breq .+30 ; 0x1018c 1016e: e0 91 6e 12 lds r30, 0x126E ; 0x80126e 10172: f0 91 6f 12 lds r31, 0x126F ; 0x80126f 10176: ef 57 subi r30, 0x7F ; 127 10178: ff 4e sbci r31, 0xEF ; 239 1017a: 80 81 ld r24, Z 1017c: 81 30 cpi r24, 0x01 ; 1 1017e: 11 f0 breq .+4 ; 0x10184 10180: 86 30 cpi r24, 0x06 ; 6 10182: 21 f4 brne .+8 ; 0x1018c SERIAL_PROTOCOLLNRPGM(MSG_OK); 10184: 8a e0 ldi r24, 0x0A ; 10 10186: 9e e6 ldi r25, 0x6E ; 110 10188: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc } 1018c: 08 95 ret 0001018e : void cmdqueue_reset() { while (buflen) 1018e: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 10192: 90 91 80 10 lds r25, 0x1080 ; 0x801080 10196: 89 2b or r24, r25 10198: 29 f0 breq .+10 ; 0x101a4 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); 1019a: 0e 94 ad 80 call 0x1015a ; 0x1015a cmdqueue_pop_front(); 1019e: 0e 94 3f 78 call 0xf07e ; 0xf07e 101a2: f5 cf rjmp .-22 ; 0x1018e } bufindr = 0; 101a4: 10 92 6f 12 sts 0x126F, r1 ; 0x80126f 101a8: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e bufindw = 0; 101ac: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 101b0: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.571> //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; 101b4: 81 e0 ldi r24, 0x01 ; 1 101b6: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e } 101ba: 08 95 ret 000101bc : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { 101bc: ef 92 push r14 101be: ff 92 push r15 101c0: 0f 93 push r16 101c2: 1f 93 push r17 101c4: cf 93 push r28 101c6: df 93 push r29 if (mbl.active) { 101c8: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 101cc: 88 23 and r24, r24 101ce: 89 f1 breq .+98 ; 0x10232 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); 101d0: 80 ec ldi r24, 0xC0 ; 192 101d2: 9d e7 ldi r25, 0x7D ; 125 101d4: 0e 94 fe 7a call 0xf5fc ; 0xf5fc SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); 101d8: 8a ea ldi r24, 0xAA ; 170 101da: 9d e7 ldi r25, 0x7D ; 125 101dc: 0e 94 fe 7a call 0xf5fc ; 0xf5fc SERIAL_PROTOCOLLNPGM("Measured points:"); 101e0: 89 e9 ldi r24, 0x99 ; 153 101e2: 9d e7 ldi r25, 0x7D ; 125 101e4: 0e 94 fe 7a call 0xf5fc ; 0xf5fc for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { 101e8: c7 e0 ldi r28, 0x07 ; 7 101ea: dc e1 ldi r29, 0x1C ; 28 101ec: c1 50 subi r28, 0x01 ; 1 101ee: 58 f1 brcs .+86 ; 0x10246 101f0: cd 9f mul r28, r29 101f2: 70 01 movw r14, r0 101f4: 11 24 eor r1, r1 101f6: 01 e0 ldi r16, 0x01 ; 1 101f8: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); 101fa: 86 e9 ldi r24, 0x96 ; 150 101fc: 9d e7 ldi r25, 0x7D ; 125 101fe: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOL_F(z_values[y][x], 5); 10202: f8 01 movw r30, r16 10204: ee 0f add r30, r30 10206: ff 1f adc r31, r31 10208: ee 0f add r30, r30 1020a: ff 1f adc r31, r31 1020c: ee 0d add r30, r14 1020e: ff 1d adc r31, r15 10210: e5 56 subi r30, 0x65 ; 101 10212: fc 4e sbci r31, 0xEC ; 236 10214: 60 81 ld r22, Z 10216: 71 81 ldd r23, Z+1 ; 0x01 10218: 82 81 ldd r24, Z+2 ; 0x02 1021a: 93 81 ldd r25, Z+3 ; 0x03 1021c: 45 e0 ldi r20, 0x05 ; 5 1021e: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a 10222: 0f 5f subi r16, 0xFF ; 255 10224: 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++) { 10226: 08 30 cpi r16, 0x08 ; 8 10228: 11 05 cpc r17, r1 1022a: 39 f7 brne .-50 ; 0x101fa SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); 1022c: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 10230: dd cf rjmp .-70 ; 0x101ec mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10232: 8d ec ldi r24, 0xCD ; 205 10234: 9d e7 ldi r25, 0x7D ; 125 return; } 10236: df 91 pop r29 10238: cf 91 pop r28 1023a: 1f 91 pop r17 1023c: 0f 91 pop r16 1023e: ff 90 pop r15 10240: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10242: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc return; } 10246: df 91 pop r29 10248: cf 91 pop r28 1024a: 1f 91 pop r17 1024c: 0f 91 pop r16 1024e: ff 90 pop r15 10250: ef 90 pop r14 10252: 08 95 ret 00010254 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { 10254: 8f 92 push r8 10256: 9f 92 push r9 10258: af 92 push r10 1025a: bf 92 push r11 1025c: cf 92 push r12 1025e: df 92 push r13 10260: ef 92 push r14 10262: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); 10264: 0f 94 83 3f call 0x27f06 ; 0x27f06 10268: 6b 01 movw r12, r22 1026a: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { 1026c: 20 91 2f 02 lds r18, 0x022F ; 0x80022f 10270: 22 23 and r18, r18 10272: 09 f1 breq .+66 ; 0x102b6 10274: 40 91 96 02 lds r20, 0x0296 ; 0x800296 10278: 41 30 cpi r20, 0x01 ; 1 1027a: e9 f0 breq .+58 ; 0x102b6 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; 1027c: 80 91 10 02 lds r24, 0x0210 ; 0x800210 10280: 90 91 11 02 lds r25, 0x0211 ; 0x800211 10284: a0 91 12 02 lds r26, 0x0212 ; 0x800212 10288: b0 91 13 02 lds r27, 0x0213 ; 0x800213 1028c: 46 01 movw r8, r12 1028e: 57 01 movw r10, r14 10290: 88 1a sub r8, r24 10292: 99 0a sbc r9, r25 10294: aa 0a sbc r10, r26 10296: bb 0a sbc r11, r27 10298: 30 e0 ldi r19, 0x00 ; 0 1029a: a8 ee ldi r26, 0xE8 ; 232 1029c: b3 e0 ldi r27, 0x03 ; 3 1029e: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 102a2: 86 16 cp r8, r22 102a4: 97 06 cpc r9, r23 102a6: a8 06 cpc r10, r24 102a8: b9 06 cpc r11, r25 102aa: 6c f0 brlt .+26 ; 0x102c6 switch (busy_state) { 102ac: 44 30 cpi r20, 0x04 ; 4 102ae: 31 f1 breq .+76 ; 0x102fc 102b0: 9c f4 brge .+38 ; 0x102d8 102b2: 42 30 cpi r20, 0x02 ; 2 102b4: d4 f4 brge .+52 ; 0x102ea break; default: break; } } prev_busy_signal_ms = ms; 102b6: c0 92 10 02 sts 0x0210, r12 ; 0x800210 102ba: d0 92 11 02 sts 0x0211, r13 ; 0x800211 102be: e0 92 12 02 sts 0x0212, r14 ; 0x800212 102c2: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } 102c6: ff 90 pop r15 102c8: ef 90 pop r14 102ca: df 90 pop r13 102cc: cf 90 pop r12 102ce: bf 90 pop r11 102d0: af 90 pop r10 102d2: 9f 90 pop r9 102d4: 8f 90 pop r8 102d6: 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) { 102d8: 45 30 cpi r20, 0x05 ; 5 102da: 69 f7 brne .-38 ; 0x102b6 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; 102dc: 82 ee ldi r24, 0xE2 ; 226 102de: 99 ea ldi r25, 0xA9 ; 169 102e0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM("busy: paused for input"); 102e4: 82 e4 ldi r24, 0x42 ; 66 102e6: 9c e7 ldi r25, 0x7C ; 124 102e8: 06 c0 rjmp .+12 ; 0x102f6 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; 102ea: 82 ee ldi r24, 0xE2 ; 226 102ec: 99 ea ldi r25, 0xA9 ; 169 102ee: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM("busy: processing"); 102f2: 8f e6 ldi r24, 0x6F ; 111 102f4: 9c e7 ldi r25, 0x7C ; 124 SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for input"); 102f6: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 102fa: dd cf rjmp .-70 ; 0x102b6 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; 102fc: 82 ee ldi r24, 0xE2 ; 226 102fe: 99 ea ldi r25, 0xA9 ; 169 10300: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM("busy: paused for user"); 10304: 89 e5 ldi r24, 0x59 ; 89 10306: 9c e7 ldi r25, 0x7C ; 124 10308: f6 cf rjmp .-20 ; 0x102f6 0001030a : //} } #endif //TACH_0 void checkFans() { 1030a: cf 92 push r12 1030c: df 92 push r13 1030e: ef 92 push r14 10310: ff 92 push r15 10312: 0f 93 push r16 10314: 1f 93 push r17 10316: cf 93 push r28 10318: df 93 push r29 1031a: 1f 92 push r1 1031c: 1f 92 push r1 1031e: cd b7 in r28, 0x3d ; 61 10320: 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)) { 10322: 0f 94 83 3f call 0x27f06 ; 0x27f06 10326: 00 91 9a 17 lds r16, 0x179A ; 0x80179a 1032a: 10 91 9b 17 lds r17, 0x179B ; 0x80179b 1032e: 20 91 9c 17 lds r18, 0x179C ; 0x80179c 10332: 30 91 9d 17 lds r19, 0x179D ; 0x80179d 10336: 60 1b sub r22, r16 10338: 71 0b sbc r23, r17 1033a: 82 0b sbc r24, r18 1033c: 93 0b sbc r25, r19 1033e: 69 38 cpi r22, 0x89 ; 137 10340: 73 41 sbci r23, 0x13 ; 19 10342: 81 05 cpc r24, r1 10344: 91 05 cpc r25, r1 10346: d0 f0 brcs .+52 ; 0x1037c 10348: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1034c: 81 11 cpse r24, r1 1034e: 16 c0 rjmp .+44 ; 0x1037c extruder_autofan_last_check = _millis(); 10350: 0f 94 83 3f call 0x27f06 ; 0x27f06 10354: 60 93 9a 17 sts 0x179A, r22 ; 0x80179a 10358: 70 93 9b 17 sts 0x179B, r23 ; 0x80179b 1035c: 80 93 9c 17 sts 0x179C, r24 ; 0x80179c 10360: 90 93 9d 17 sts 0x179D, r25 ; 0x80179d fanSpeedBckp = fanSpeedSoftPwm; 10364: 80 91 9e 04 lds r24, 0x049E ; 0x80049e 10368: 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 1036c: 8b 34 cpi r24, 0x4B ; 75 1036e: 18 f0 brcs .+6 ; 0x10376 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 10370: 8f ef ldi r24, 0xFF ; 255 10372: 80 93 9e 04 sts 0x049E, r24 ; 0x80049e } fan_measuring = true; 10376: 81 e0 ldi r24, 0x01 ; 1 10378: 80 93 34 05 sts 0x0534, r24 ; 0x800534 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 1037c: 0f 94 83 3f call 0x27f06 ; 0x27f06 10380: 00 91 9a 17 lds r16, 0x179A ; 0x80179a 10384: 10 91 9b 17 lds r17, 0x179B ; 0x80179b 10388: 20 91 9c 17 lds r18, 0x179C ; 0x80179c 1038c: 30 91 9d 17 lds r19, 0x179D ; 0x80179d 10390: 60 1b sub r22, r16 10392: 71 0b sbc r23, r17 10394: 82 0b sbc r24, r18 10396: 93 0b sbc r25, r19 10398: 65 36 cpi r22, 0x65 ; 101 1039a: 71 05 cpc r23, r1 1039c: 81 05 cpc r24, r1 1039e: 91 05 cpc r25, r1 103a0: 08 f4 brcc .+2 ; 0x103a4 103a2: f7 c0 rjmp .+494 ; 0x10592 103a4: 80 91 34 05 lds r24, 0x0534 ; 0x800534 103a8: 88 23 and r24, r24 103aa: 09 f4 brne .+2 ; 0x103ae 103ac: f2 c0 rjmp .+484 ; 0x10592 countFanSpeed(); 103ae: 0e 94 52 76 call 0xeca4 ; 0xeca4 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 103b2: 83 e0 ldi r24, 0x03 ; 3 103b4: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 103b6: 82 e0 ldi r24, 0x02 ; 2 103b8: 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) 103ba: 80 91 38 02 lds r24, 0x0238 ; 0x800238 103be: 88 23 and r24, r24 103c0: 51 f0 breq .+20 ; 0x103d6 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 103c2: 87 e8 ldi r24, 0x87 ; 135 103c4: 9f e0 ldi r25, 0x0F ; 15 103c6: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 103ca: 91 e0 ldi r25, 0x01 ; 1 103cc: 81 11 cpse r24, r1 103ce: 01 c0 rjmp .+2 ; 0x103d2 103d0: 90 e0 ldi r25, 0x00 ; 0 103d2: 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]++;} 103d6: 80 91 af 04 lds r24, 0x04AF ; 0x8004af 103da: 90 91 b0 04 lds r25, 0x04B0 ; 0x8004b0 103de: 44 97 sbiw r24, 0x14 ; 20 103e0: 0c f0 brlt .+2 ; 0x103e4 103e2: a0 c0 rjmp .+320 ; 0x10524 103e4: 20 e0 ldi r18, 0x00 ; 0 103e6: 30 e0 ldi r19, 0x00 ; 0 103e8: 48 e4 ldi r20, 0x48 ; 72 103ea: 52 e4 ldi r21, 0x42 ; 66 103ec: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 103f0: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 103f4: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 103f8: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 103fc: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 10400: 18 16 cp r1, r24 10402: 0c f0 brlt .+2 ; 0x10406 10404: 8f c0 rjmp .+286 ; 0x10524 10406: 80 91 4e 03 lds r24, 0x034E ; 0x80034e 1040a: 8f 5f subi r24, 0xFF ; 255 1040c: 80 93 4e 03 sts 0x034E, r24 ; 0x80034e else fan_speed_errors[0] = 0; #endif #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; 10410: 80 91 b1 04 lds r24, 0x04B1 ; 0x8004b1 10414: 90 91 b2 04 lds r25, 0x04B2 ; 0x8004b2 10418: 05 97 sbiw r24, 0x05 ; 5 1041a: 0c f0 brlt .+2 ; 0x1041e 1041c: 89 c0 rjmp .+274 ; 0x10530 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); 1041e: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 10422: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 10426: 98 17 cp r25, r24 10428: 09 f4 brne .+2 ; 0x1042c 1042a: 7f c0 rjmp .+254 ; 0x1052a 1042c: e0 91 55 0e lds r30, 0x0E55 ; 0x800e55 10430: 8e e6 ldi r24, 0x6E ; 110 10432: e8 9f mul r30, r24 10434: f0 01 movw r30, r0 10436: 11 24 eor r1, r1 10438: e6 54 subi r30, 0x46 ; 70 1043a: f8 4f sbci r31, 0xF8 ; 248 1043c: 80 81 ld r24, Z 1043e: 8c 34 cpi r24, 0x4C ; 76 10440: 08 f4 brcc .+2 ; 0x10444 10442: 76 c0 rjmp .+236 ; 0x10530 10444: 80 91 4f 03 lds r24, 0x034F ; 0x80034f 10448: 8f 5f subi r24, 0xFF ; 255 1044a: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f else fan_speed_errors[1] = 0; #endif // drop the fan_check_error flag when both fans are ok if( fan_speed_errors[0] == 0 && fan_speed_errors[1] == 0 && fan_check_error == EFCE_REPORTED){ 1044e: 80 91 4e 03 lds r24, 0x034E ; 0x80034e 10452: 81 11 cpse r24, r1 10454: 0b c0 rjmp .+22 ; 0x1046c 10456: 80 91 4f 03 lds r24, 0x034F ; 0x80034f 1045a: 81 11 cpse r24, r1 1045c: 07 c0 rjmp .+14 ; 0x1046c 1045e: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 10462: 82 30 cpi r24, 0x02 ; 2 10464: 19 f4 brne .+6 ; 0x1046c // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 10466: 81 e0 ldi r24, 0x01 ; 1 10468: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 1046c: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 10470: 81 30 cpi r24, 0x01 ; 1 10472: 61 f4 brne .+24 ; 0x1048c 10474: 0e 94 8e 68 call 0xd11c ; 0xd11c 10478: 81 11 cpse r24, r1 1047a: 08 c0 rjmp .+16 ; 0x1048c fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 1047c: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 10480: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> 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 10484: 8a e6 ldi r24, 0x6A ; 106 10486: 90 e7 ldi r25, 0x70 ; 112 10488: 0f 94 e2 0b call 0x217c4 ; 0x217c4 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 1048c: 80 91 38 02 lds r24, 0x0238 ; 0x800238 10490: 88 23 and r24, r24 10492: 09 f4 brne .+2 ; 0x10496 10494: 6e c0 rjmp .+220 ; 0x10572 10496: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1049a: 82 30 cpi r24, 0x02 ; 2 1049c: 09 f4 brne .+2 ; 0x104a0 1049e: 69 c0 rjmp .+210 ; 0x10572 104a0: 8e e4 ldi r24, 0x4E ; 78 104a2: e8 2e mov r14, r24 104a4: 83 e0 ldi r24, 0x03 ; 3 104a6: f8 2e mov r15, r24 104a8: fe 01 movw r30, r28 104aa: 31 96 adiw r30, 0x01 ; 1 104ac: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 104ae: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 104b0: 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]) 104b2: f7 01 movw r30, r14 104b4: 91 91 ld r25, Z+ 104b6: 7f 01 movw r14, r30 104b8: f6 01 movw r30, r12 104ba: 81 91 ld r24, Z+ 104bc: 6f 01 movw r12, r30 104be: 89 17 cp r24, r25 104c0: 68 f5 brcc .+90 ; 0x1051c { fan_speed_errors[fan] = 0; 104c2: f7 01 movw r30, r14 104c4: 31 97 sbiw r30, 0x01 ; 1 104c6: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 104c8: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 104cc: 82 30 cpi r24, 0x02 ; 2 104ce: 31 f1 breq .+76 ; 0x1051c fan_check_error = EFCE_REPORTED; 104d0: 00 93 e0 03 sts 0x03E0, r16 ; 0x8003e0 if (printJobOngoing()) { 104d4: 0e 94 3d 68 call 0xd07a ; 0xd07a 104d8: 88 23 and r24, r24 104da: 81 f1 breq .+96 ; 0x1053c // A print is ongoing, pause the print normally if(!printingIsPaused()) { 104dc: 0e 94 32 68 call 0xd064 ; 0xd064 104e0: 81 11 cpse r24, r1 104e2: 06 c0 rjmp .+12 ; 0x104f0 if (usb_timer.running()) 104e4: 80 91 0f 05 lds r24, 0x050F ; 0x80050f 104e8: 88 23 and r24, r24 104ea: 29 f1 breq .+74 ; 0x10536 lcd_pause_usb_print(); 104ec: 0f 94 80 2c call 0x25900 ; 0x25900 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 104f0: 11 30 cpi r17, 0x01 ; 1 104f2: 59 f1 breq .+86 ; 0x1054a //! 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); 104f4: 83 eb ldi r24, 0xB3 ; 179 104f6: 99 e7 ldi r25, 0x79 ; 121 104f8: 0e 94 fe 7a call 0xf5fc ; 0xf5fc if (get_message_level() == 0) { 104fc: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> 10500: 81 11 cpse r24, r1 10502: 0c c0 rjmp .+24 ; 0x1051c Sound_MakeCustom(200,0,true); 10504: 41 e0 ldi r20, 0x01 ; 1 10506: 70 e0 ldi r23, 0x00 ; 0 10508: 60 e0 ldi r22, 0x00 ; 0 1050a: 88 ec ldi r24, 0xC8 ; 200 1050c: 90 e0 ldi r25, 0x00 ; 0 1050e: 0f 94 99 6a call 0x2d532 ; 0x2d532 LCD_ALERTMESSAGERPGM(lcdMsg); 10512: 62 e0 ldi r22, 0x02 ; 2 10514: 8f e0 ldi r24, 0x0F ; 15 10516: 9b e6 ldi r25, 0x6B ; 107 10518: 0f 94 bf 06 call 0x20d7e ; 0x20d7e 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++) 1051c: 11 30 cpi r17, 0x01 ; 1 1051e: 49 f1 breq .+82 ; 0x10572 10520: 11 e0 ldi r17, 0x01 ; 1 10522: c7 cf rjmp .-114 ; 0x104b2 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; 10524: 10 92 4e 03 sts 0x034E, r1 ; 0x80034e 10528: 73 cf rjmp .-282 ; 0x10410 #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]++; 1052a: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1052e: 87 cf rjmp .-242 ; 0x1043e else fan_speed_errors[1] = 0; 10530: 10 92 4f 03 sts 0x034F, r1 ; 0x80034f 10534: 8c cf rjmp .-232 ; 0x1044e // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 10536: 0f 94 8f 3f call 0x27f1e ; 0x27f1e 1053a: da cf rjmp .-76 ; 0x104f0 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1053c: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 10540: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 10544: 10 92 dd 03 sts 0x03DD, r1 ; 0x8003dd 10548: d3 cf rjmp .-90 ; 0x104f0 //! 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); 1054a: 8b ed ldi r24, 0xDB ; 219 1054c: 99 e7 ldi r25, 0x79 ; 121 1054e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc if (get_message_level() == 0) { 10552: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> 10556: 81 11 cpse r24, r1 10558: 0c c0 rjmp .+24 ; 0x10572 Sound_MakeCustom(200,0,true); 1055a: 41 e0 ldi r20, 0x01 ; 1 1055c: 70 e0 ldi r23, 0x00 ; 0 1055e: 60 e0 ldi r22, 0x00 ; 0 10560: 88 ec ldi r24, 0xC8 ; 200 10562: 90 e0 ldi r25, 0x00 ; 0 10564: 0f 94 99 6a call 0x2d532 ; 0x2d532 LCD_ALERTMESSAGERPGM(lcdMsg); 10568: 62 e0 ldi r22, 0x02 ; 2 1056a: 8b ef ldi r24, 0xFB ; 251 1056c: 9a e6 ldi r25, 0x6A ; 106 1056e: 0f 94 bf 06 call 0x20d7e ; 0x20d7e } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 10572: 80 91 14 02 lds r24, 0x0214 ; 0x800214 10576: 80 93 9e 04 sts 0x049E, r24 ; 0x80049e //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(); 1057a: 0f 94 83 3f call 0x27f06 ; 0x27f06 1057e: 60 93 9a 17 sts 0x179A, r22 ; 0x80179a 10582: 70 93 9b 17 sts 0x179B, r23 ; 0x80179b 10586: 80 93 9c 17 sts 0x179C, r24 ; 0x80179c 1058a: 90 93 9d 17 sts 0x179D, r25 ; 0x80179d fan_measuring = false; 1058e: 10 92 34 05 sts 0x0534, r1 ; 0x800534 } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 10592: 0f 90 pop r0 10594: 0f 90 pop r0 10596: df 91 pop r29 10598: cf 91 pop r28 1059a: 1f 91 pop r17 1059c: 0f 91 pop r16 1059e: ff 90 pop r15 105a0: ef 90 pop r14 105a2: df 90 pop r13 105a4: 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(); 105a6: 0c 94 2a 77 jmp 0xee54 ; 0xee54 000105aa : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 105aa: cf 92 push r12 105ac: df 92 push r13 105ae: ef 92 push r14 105b0: ff 92 push r15 105b2: 6b 01 movw r12, r22 105b4: 7c 01 movw r14, r24 la10c_orig_jerk = j; 105b6: c0 92 54 03 sts 0x0354, r12 ; 0x800354 105ba: d0 92 55 03 sts 0x0355, r13 ; 0x800355 105be: e0 92 56 03 sts 0x0356, r14 ; 0x800356 105c2: f0 92 57 03 sts 0x0357, r15 ; 0x800357 if(la10c_mode != LA10C_LA10) 105c6: 80 91 70 03 lds r24, 0x0370 ; 0x800370 105ca: 82 30 cpi r24, 0x02 ; 2 105cc: b1 f4 brne .+44 ; 0x105fa 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) 105ce: 20 e0 ldi r18, 0x00 ; 0 105d0: 30 e0 ldi r19, 0x00 ; 0 105d2: 40 e9 ldi r20, 0x90 ; 144 105d4: 50 e4 ldi r21, 0x40 ; 64 105d6: c7 01 movw r24, r14 105d8: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 105dc: 87 ff sbrs r24, 7 105de: 14 c0 rjmp .+40 ; 0x10608 105e0: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 105e4: 90 91 9d 06 lds r25, 0x069D ; 0x80069d 105e8: a0 91 9e 06 lds r26, 0x069E ; 0x80069e 105ec: b0 91 9f 06 lds r27, 0x069F ; 0x80069f 105f0: 80 3d cpi r24, 0xD0 ; 208 105f2: 97 40 sbci r25, 0x07 ; 7 105f4: a1 05 cpc r26, r1 105f6: b1 05 cpc r27, r1 105f8: 20 f5 brcc .+72 ; 0x10642 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 105fa: c7 01 movw r24, r14 105fc: b6 01 movw r22, r12 105fe: ff 90 pop r15 10600: ef 90 pop r14 10602: df 90 pop r13 10604: cf 90 pop r12 10606: 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: 10608: 2a e9 ldi r18, 0x9A ; 154 1060a: 39 e9 ldi r19, 0x99 ; 153 1060c: 49 e9 ldi r20, 0x99 ; 153 1060e: 5e e3 ldi r21, 0x3E ; 62 10610: c7 01 movw r24, r14 10612: b6 01 movw r22, r12 10614: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 10618: 87 ff sbrs r24, 7 1061a: 0a c0 rjmp .+20 ; 0x10630 1061c: 20 e0 ldi r18, 0x00 ; 0 1061e: 30 e0 ldi r19, 0x00 ; 0 10620: 48 e3 ldi r20, 0x38 ; 56 10622: 51 e4 ldi r21, 0x41 ; 65 10624: c7 01 movw r24, r14 10626: b6 01 movw r22, r12 10628: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1062c: 6b 01 movw r12, r22 1062e: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 10630: 8f e2 ldi r24, 0x2F ; 47 10632: 9a e7 ldi r25, 0x7A ; 122 10634: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(j); 10638: c7 01 movw r24, r14 1063a: b6 01 movw r22, r12 1063c: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 10640: dc cf rjmp .-72 ; 0x105fa // 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: 10642: 2a e9 ldi r18, 0x9A ; 154 10644: 39 e9 ldi r19, 0x99 ; 153 10646: 49 e9 ldi r20, 0x99 ; 153 10648: 5e e3 ldi r21, 0x3E ; 62 1064a: c7 01 movw r24, r14 1064c: b6 01 movw r22, r12 1064e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 10652: 87 fd sbrc r24, 7 10654: e3 cf rjmp .-58 ; 0x1061c j < 4.5? j * 0.25 + 3.375: 10656: 20 e0 ldi r18, 0x00 ; 0 10658: 30 e0 ldi r19, 0x00 ; 0 1065a: 40 e8 ldi r20, 0x80 ; 128 1065c: 5e e3 ldi r21, 0x3E ; 62 1065e: c7 01 movw r24, r14 10660: b6 01 movw r22, r12 10662: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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: 10666: 20 e0 ldi r18, 0x00 ; 0 10668: 30 e0 ldi r19, 0x00 ; 0 1066a: 48 e5 ldi r20, 0x58 ; 88 1066c: 50 e4 ldi r21, 0x40 ; 64 1066e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 10672: dc cf rjmp .-72 ; 0x1062c 00010674 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 10674: cf 92 push r12 10676: df 92 push r13 10678: ef 92 push r14 1067a: ff 92 push r15 1067c: cf 93 push r28 if(mode == la10c_mode) return; 1067e: 90 91 70 03 lds r25, 0x0370 ; 0x800370 10682: 98 17 cp r25, r24 10684: b9 f1 breq .+110 ; 0x106f4 10686: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 10688: c0 90 54 03 lds r12, 0x0354 ; 0x800354 1068c: d0 90 55 03 lds r13, 0x0355 ; 0x800355 10690: e0 90 56 03 lds r14, 0x0356 ; 0x800356 10694: f0 90 57 03 lds r15, 0x0357 ; 0x800357 10698: 20 e0 ldi r18, 0x00 ; 0 1069a: 30 e0 ldi r19, 0x00 ; 0 1069c: a9 01 movw r20, r18 1069e: c7 01 movw r24, r14 106a0: b6 01 movw r22, r12 106a2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 106a6: 88 23 and r24, r24 106a8: 41 f0 breq .+16 ; 0x106ba cs.max_jerk[E_AXIS] = la10c_orig_jerk; 106aa: c0 92 c0 06 sts 0x06C0, r12 ; 0x8006c0 106ae: d0 92 c1 06 sts 0x06C1, r13 ; 0x8006c1 106b2: e0 92 c2 06 sts 0x06C2, r14 ; 0x8006c2 106b6: f0 92 c3 06 sts 0x06C3, r15 ; 0x8006c3 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 106ba: 82 e1 ldi r24, 0x12 ; 18 106bc: 9a e7 ldi r25, 0x7A ; 122 106be: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 switch(mode) 106c2: c1 30 cpi r28, 0x01 ; 1 106c4: 11 f1 breq .+68 ; 0x1070a 106c6: e0 f0 brcs .+56 ; 0x10700 106c8: c2 30 cpi r28, 0x02 ; 2 106ca: 11 f1 breq .+68 ; 0x10710 { 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; 106cc: c0 93 70 03 sts 0x0370, r28 ; 0x800370 // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 106d0: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 106d4: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 106d8: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 106dc: 90 91 c3 06 lds r25, 0x06C3 ; 0x8006c3 106e0: 0e 94 d5 82 call 0x105aa ; 0x105aa 106e4: 60 93 c0 06 sts 0x06C0, r22 ; 0x8006c0 106e8: 70 93 c1 06 sts 0x06C1, r23 ; 0x8006c1 106ec: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 106f0: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 } 106f4: cf 91 pop r28 106f6: ff 90 pop r15 106f8: ef 90 pop r14 106fa: df 90 pop r13 106fc: cf 90 pop r12 106fe: 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; 10700: 8a e0 ldi r24, 0x0A ; 10 10702: 9a e7 ldi r25, 0x7A ; 122 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10704: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 10708: e1 cf rjmp .-62 ; 0x106cc SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 1070a: 86 e0 ldi r24, 0x06 ; 6 1070c: 9a e7 ldi r25, 0x7A ; 122 1070e: fa cf rjmp .-12 ; 0x10704 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10710: 82 e0 ldi r24, 0x02 ; 2 10712: 9a e7 ldi r25, 0x7A ; 122 10714: f7 cf rjmp .-18 ; 0x10704 00010716 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 10716: 0f 94 24 59 call 0x2b248 ; 0x2b248 disable_x(); 1071a: 17 9a sbi 0x02, 7 ; 2 1071c: ee e3 ldi r30, 0x3E ; 62 1071e: f7 e0 ldi r31, 0x07 ; 7 10720: 10 82 st Z, r1 disable_y(); 10722: 16 9a sbi 0x02, 6 ; 2 10724: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 10726: 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); } 10728: 80 e0 ldi r24, 0x00 ; 0 1072a: 0e 94 3a 83 call 0x10674 ; 0x10674 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 1072e: 8f ef ldi r24, 0xFF ; 255 10730: 9f ef ldi r25, 0xFF ; 255 10732: 90 93 8a 02 sts 0x028A, r25 ; 0x80028a 10736: 80 93 89 02 sts 0x0289, r24 ; 0x800289 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 1073a: 2f ef ldi r18, 0xFF ; 255 1073c: 20 93 86 02 sts 0x0286, r18 ; 0x800286 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 10740: 90 93 8e 02 sts 0x028E, r25 ; 0x80028e 10744: 80 93 8d 02 sts 0x028D, r24 ; 0x80028d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 10748: 20 93 85 02 sts 0x0285, r18 ; 0x800285 print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 1074c: 90 93 88 02 sts 0x0288, r25 ; 0x800288 10750: 80 93 87 02 sts 0x0287, r24 ; 0x800287 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 10754: 90 93 8c 02 sts 0x028C, r25 ; 0x80028c 10758: 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(); } 1075c: 08 95 ret 0001075e : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 1075e: 41 ed ldi r20, 0xD1 ; 209 10760: 50 e0 ldi r21, 0x00 ; 0 10762: 6d eb ldi r22, 0xBD ; 189 10764: 78 e7 ldi r23, 0x78 ; 120 10766: 8c e6 ldi r24, 0x6C ; 108 10768: 96 e0 ldi r25, 0x06 ; 6 1076a: 0f 94 23 db call 0x3b646 ; 0x3b646 // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 1076e: 0f 94 7d aa call 0x354fa ; 0x354fa #ifdef PIDTEMP updatePID(); 10772: 0f 94 0f 51 call 0x2a21e ; 0x2a21e #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 10776: 0f 94 e4 47 call 0x28fc8 ; 0x28fc8 #endif calculate_extruder_multipliers(); 1077a: 0e 94 66 66 call 0xcccc ; 0xcccc SERIAL_ECHO_START; 1077e: 82 ee ldi r24, 0xE2 ; 226 10780: 99 ea ldi r25, 0xA9 ; 169 10782: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 10786: 8b e9 ldi r24, 0x9B ; 155 10788: 98 e7 ldi r25, 0x78 ; 120 1078a: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc 0001078e : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 1078e: cf 93 push r28 10790: df 93 push r29 strcpy_P(cs.version, default_conf.version); 10792: 6d eb ldi r22, 0xBD ; 189 10794: 78 e7 ldi r23, 0x78 ; 120 10796: 8c e6 ldi r24, 0x6C ; 108 10798: 96 e0 ldi r25, 0x06 ; 6 1079a: 0f 94 40 db call 0x3b680 ; 0x3b680 #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); 1079e: 41 ed ldi r20, 0xD1 ; 209 107a0: 50 e0 ldi r21, 0x00 ; 0 107a2: 64 e1 ldi r22, 0x14 ; 20 107a4: 70 e0 ldi r23, 0x00 ; 0 107a6: 8c e6 ldi r24, 0x6C ; 108 107a8: 96 e0 ldi r25, 0x06 ; 6 107aa: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 107ae: 60 91 1e 05 lds r22, 0x051E ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> 107b2: 82 e0 ldi r24, 0x02 ; 2 107b4: 9d e0 ldi r25, 0x0D ; 13 107b6: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a } 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); 107ba: cc e8 ldi r28, 0x8C ; 140 107bc: 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); 107be: 4a a5 ldd r20, Y+42 ; 0x2a 107c0: 5b a5 ldd r21, Y+43 ; 0x2b 107c2: 6c a5 ldd r22, Y+44 ; 0x2c 107c4: 7d a5 ldd r23, Y+45 ; 0x2d 107c6: 8e ef ldi r24, 0xFE ; 254 107c8: 9c e0 ldi r25, 0x0C ; 12 107ca: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 107ce: 4e a5 ldd r20, Y+46 ; 0x2e 107d0: 5f a5 ldd r21, Y+47 ; 0x2f 107d2: 68 a9 ldd r22, Y+48 ; 0x30 107d4: 79 a9 ldd r23, Y+49 ; 0x31 107d6: 82 ea ldi r24, 0xA2 ; 162 107d8: 9c e0 ldi r25, 0x0C ; 12 107da: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 107de: 4a a9 ldd r20, Y+50 ; 0x32 107e0: 5b a9 ldd r21, Y+51 ; 0x33 107e2: 6c a9 ldd r22, Y+52 ; 0x34 107e4: 7d a9 ldd r23, Y+53 ; 0x35 107e6: 8e e9 ldi r24, 0x9E ; 158 107e8: 9c e0 ldi r25, 0x0C ; 12 107ea: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 107ee: 4e a9 ldd r20, Y+54 ; 0x36 107f0: 5f a9 ldd r21, Y+55 ; 0x37 107f2: 68 ad ldd r22, Y+56 ; 0x38 107f4: 79 ad ldd r23, Y+57 ; 0x39 107f6: 8a ef ldi r24, 0xFA ; 250 107f8: 9c e0 ldi r25, 0x0C ; 12 107fa: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 107fe: 4a ad ldd r20, Y+58 ; 0x3a 10800: 5b ad ldd r21, Y+59 ; 0x3b 10802: 6c ad ldd r22, Y+60 ; 0x3c 10804: 7d ad ldd r23, Y+61 ; 0x3d 10806: 8a e9 ldi r24, 0x9A ; 154 10808: 9c e0 ldi r25, 0x0C ; 12 1080a: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1080e: 6e ad ldd r22, Y+62 ; 0x3e 10810: 7f ad ldd r23, Y+63 ; 0x3f 10812: 88 e9 ldi r24, 0x98 ; 152 10814: 9c e0 ldi r25, 0x0C ; 12 10816: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 #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); 1081a: 40 e4 ldi r20, 0x40 ; 64 1081c: 50 e0 ldi r21, 0x00 ; 0 1081e: 6a eb ldi r22, 0xBA ; 186 10820: 7c e0 ldi r23, 0x0C ; 12 10822: 8c ec ldi r24, 0xCC ; 204 10824: 92 e1 ldi r25, 0x12 ; 18 10826: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1082a: 40 91 0c 13 lds r20, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 1082e: 50 91 0d 13 lds r21, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 10832: 60 91 0e 13 lds r22, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 10836: 70 91 0f 13 lds r23, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1083a: 86 eb ldi r24, 0xB6 ; 182 1083c: 9c e0 ldi r25, 0x0C ; 12 1083e: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 10842: 40 91 10 13 lds r20, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 10846: 50 91 11 13 lds r21, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 1084a: 60 91 12 13 lds r22, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 1084e: 70 91 13 13 lds r23, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 10852: 82 eb ldi r24, 0xB2 ; 178 10854: 9c e0 ldi r25, 0x0C ; 12 10856: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 1085a: 40 91 14 13 lds r20, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 1085e: 50 91 15 13 lds r21, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 10862: 60 91 16 13 lds r22, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 10866: 70 91 17 13 lds r23, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 1086a: 8e ea ldi r24, 0xAE ; 174 1086c: 9c e0 ldi r25, 0x0C ; 12 1086e: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 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; 10872: 82 ee ldi r24, 0xE2 ; 226 10874: 99 ea ldi r25, 0xA9 ; 169 10876: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM("Settings Stored"); 1087a: 87 e4 ldi r24, 0x47 ; 71 1087c: 98 e7 ldi r25, 0x78 ; 120 } 1087e: df 91 pop r29 10880: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 10882: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc 00010886 : { cmdbuffer_front_already_processed = true; } void get_command() { 10886: 2f 92 push r2 10888: 3f 92 push r3 1088a: 4f 92 push r4 1088c: 5f 92 push r5 1088e: 6f 92 push r6 10890: 7f 92 push r7 10892: 8f 92 push r8 10894: 9f 92 push r9 10896: af 92 push r10 10898: bf 92 push r11 1089a: cf 92 push r12 1089c: df 92 push r13 1089e: ef 92 push r14 108a0: ff 92 push r15 108a2: 0f 93 push r16 108a4: 1f 93 push r17 108a6: cf 93 push r28 108a8: df 93 push r29 108aa: cd b7 in r28, 0x3d ; 61 108ac: de b7 in r29, 0x3e ; 62 108ae: a2 97 sbiw r28, 0x22 ; 34 108b0: 0f b6 in r0, 0x3f ; 63 108b2: f8 94 cli 108b4: de bf out 0x3e, r29 ; 62 108b6: 0f be out 0x3f, r0 ; 63 108b8: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 108ba: 8f e5 ldi r24, 0x5F ; 95 108bc: 90 e0 ldi r25, 0x00 ; 0 108be: 0e 94 ef 5c call 0xb9de ; 0xb9de 108c2: 88 23 and r24, r24 108c4: 09 f4 brne .+2 ; 0x108c8 108c6: 91 c0 rjmp .+290 ; 0x109ea return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 108c8: 0e 94 8c 78 call 0xf118 ; 0xf118 108cc: 8f 37 cpi r24, 0x7F ; 127 108ce: 91 05 cpc r25, r1 108d0: 61 f4 brne .+24 ; 0x108ea // 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; 108d2: 80 91 93 04 lds r24, 0x0493 ; 0x800493 108d6: 90 91 94 04 lds r25, 0x0494 ; 0x800494 108da: 90 93 92 04 sts 0x0492, r25 ; 0x800492 108de: 80 93 91 04 sts 0x0491, r24 ; 0x800491 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 108e2: 88 e3 ldi r24, 0x38 ; 56 108e4: 98 e7 ldi r25, 0x78 ; 120 108e6: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 108ea: 1e 01 movw r2, r28 108ec: 2f e1 ldi r18, 0x1F ; 31 108ee: 22 0e add r2, r18 108f0: 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; 108f2: dd 24 eor r13, r13 108f4: 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 108f6: 0e 94 8c 78 call 0xf118 ; 0xf118 108fa: 18 16 cp r1, r24 108fc: 19 06 cpc r1, r25 108fe: 0c f0 brlt .+2 ; 0x10902 10900: 68 c0 rjmp .+208 ; 0x109d2 10902: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 10906: 88 23 and r24, r24 10908: 29 f0 breq .+10 ; 0x10914 1090a: 0e 94 32 68 call 0xd064 ; 0xd064 1090e: 88 23 and r24, r24 10910: 09 f4 brne .+2 ; 0x10914 10912: 5f c0 rjmp .+190 ; 0x109d2 10914: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 10918: 81 11 cpse r24, r1 1091a: 5b c0 rjmp .+182 ; 0x109d2 #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 1091c: 0f 94 92 d6 call 0x3ad24 ; 0x3ad24 if (rec < 0) continue; 10920: 97 fd sbrc r25, 7 10922: e9 cf rjmp .-46 ; 0x108f6 mp_handle_rx_char((uint8_t)rec); 10924: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 10926: 8f 3f cpi r24, 0xFF ; 255 10928: 09 f0 breq .+2 ; 0x1092c 1092a: 7b c0 rjmp .+246 ; 0x10a22 if (mp_cmd_count > 0) { 1092c: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10930: 88 23 and r24, r24 10932: 09 f4 brne .+2 ; 0x10936 10934: 73 c0 rjmp .+230 ; 0x10a1c mp_cmd_active = 1; 10936: d0 92 3f 03 sts 0x033F, r13 ; 0x80033f mp_cmd_count = 0; 1093a: 10 92 40 03 sts 0x0340, r1 ; 0x800340 char c_res[2] = {0, 0}; 1093e: 1f 8e std Y+31, r1 ; 0x1f 10940: 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) { 10942: c0 90 43 03 lds r12, 0x0343 ; 0x800343 10946: cc 20 and r12, r12 10948: b1 f2 breq .-84 ; 0x108f6 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]; 1094a: 80 91 41 03 lds r24, 0x0341 ; 0x800341 1094e: 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) 10950: 91 e0 ldi r25, 0x01 ; 1 10952: 9c 15 cp r25, r12 10954: 18 f4 brcc .+6 ; 0x1095c out[i] = (char)mp_char_out_buf[i]; 10956: 80 91 42 03 lds r24, 0x0342 ; 0x800342 1095a: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 1095c: 10 92 43 03 sts 0x0343, r1 ; 0x800343 10960: 3a a2 std Y+34, r3 ; 0x22 10962: 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]; 10964: 89 a1 ldd r24, Y+33 ; 0x21 10966: 82 19 sub r24, r2 10968: 8c 15 cp r24, r12 1096a: 28 f6 brcc .-118 ; 0x108f6 1096c: e9 a1 ldd r30, Y+33 ; 0x21 1096e: fa a1 ldd r31, Y+34 ; 0x22 10970: 11 91 ld r17, Z+ 10972: fa a3 std Y+34, r31 ; 0x22 10974: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10976: 86 e4 ldi r24, 0x46 ; 70 10978: 93 e0 ldi r25, 0x03 ; 3 1097a: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> if (serial_char < 0) 1097e: 17 fd sbrc r17, 7 10980: f1 cf rjmp .-30 ; 0x10964 10982: 80 91 7a 10 lds r24, 0x107A ; 0x80107a 10986: 90 91 7b 10 lds r25, 0x107B ; 0x80107b // 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' || 1098a: 1a 30 cpi r17, 0x0A ; 10 1098c: 09 f4 brne .+2 ; 0x10990 1098e: 4a c1 rjmp .+660 ; 0x10c24 10990: 1d 30 cpi r17, 0x0D ; 13 10992: 09 f4 brne .+2 ; 0x10996 10994: 47 c1 rjmp .+654 ; 0x10c24 serial_char == '\r' || 10996: 8f 35 cpi r24, 0x5F ; 95 10998: 91 05 cpc r25, r1 1099a: 0c f0 brlt .+2 ; 0x1099e 1099c: 48 c1 rjmp .+656 ; 0x10c2e 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; 1099e: 1b 33 cpi r17, 0x3B ; 59 109a0: 11 f4 brne .+4 ; 0x109a6 109a2: d0 92 45 03 sts 0x0345, r13 ; 0x800345 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 109a6: 20 91 45 03 lds r18, 0x0345 ; 0x800345 109aa: 21 11 cpse r18, r1 109ac: db cf rjmp .-74 ; 0x10964 109ae: 9c 01 movw r18, r24 109b0: 2f 5f subi r18, 0xFF ; 255 109b2: 3f 4f sbci r19, 0xFF ; 255 109b4: 30 93 7b 10 sts 0x107B, r19 ; 0x80107b 109b8: 20 93 7a 10 sts 0x107A, r18 ; 0x80107a 109bc: 20 91 7c 10 lds r18, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 109c0: 30 91 7d 10 lds r19, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 109c4: 2f 57 subi r18, 0x7F ; 127 109c6: 3f 4e sbci r19, 0xEF ; 239 109c8: 82 0f add r24, r18 109ca: 93 1f adc r25, r19 109cc: fc 01 movw r30, r24 109ce: 13 83 std Z+3, r17 ; 0x03 109d0: c9 cf rjmp .-110 ; 0x10964 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 109d2: 80 91 7a 10 lds r24, 0x107A ; 0x80107a 109d6: 90 91 7b 10 lds r25, 0x107B ; 0x80107b 109da: 18 16 cp r1, r24 109dc: 19 06 cpc r1, r25 109de: 0c f4 brge .+2 ; 0x109e2 109e0: 56 c2 rjmp .+1196 ; 0x10e8e SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 109e2: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 109e6: 81 11 cpse r24, r1 109e8: 66 c2 rjmp .+1228 ; 0x10eb6 prusa_statistics(6); } } #endif //SDSUPPORT } 109ea: a2 96 adiw r28, 0x22 ; 34 109ec: 0f b6 in r0, 0x3f ; 63 109ee: f8 94 cli 109f0: de bf out 0x3e, r29 ; 62 109f2: 0f be out 0x3f, r0 ; 63 109f4: cd bf out 0x3d, r28 ; 61 109f6: df 91 pop r29 109f8: cf 91 pop r28 109fa: 1f 91 pop r17 109fc: 0f 91 pop r16 109fe: ff 90 pop r15 10a00: ef 90 pop r14 10a02: df 90 pop r13 10a04: cf 90 pop r12 10a06: bf 90 pop r11 10a08: af 90 pop r10 10a0a: 9f 90 pop r9 10a0c: 8f 90 pop r8 10a0e: 7f 90 pop r7 10a10: 6f 90 pop r6 10a12: 5f 90 pop r5 10a14: 4f 90 pop r4 10a16: 3f 90 pop r3 10a18: 2f 90 pop r2 10a1a: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10a1c: d0 92 40 03 sts 0x0340, r13 ; 0x800340 10a20: 8e cf rjmp .-228 ; 0x1093e return; } if (mp_cmd_active > 0) { 10a22: 30 91 3f 03 lds r19, 0x033F ; 0x80033f 10a26: 33 23 and r19, r19 10a28: 09 f4 brne .+2 ; 0x10a2c 10a2a: 57 c0 rjmp .+174 ; 0x10ada } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10a2c: 89 3f cpi r24, 0xF9 ; 249 10a2e: 09 f4 brne .+2 ; 0x10a32 10a30: 3f c0 rjmp .+126 ; 0x10ab0 10a32: 80 f5 brcc .+96 ; 0x10a94 10a34: 86 3f cpi r24, 0xF6 ; 246 10a36: 09 f4 brne .+2 ; 0x10a3a 10a38: 48 c0 rjmp .+144 ; 0x10aca #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10a3a: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10a3e: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10a40: 27 3f cpi r18, 0xF7 ; 247 10a42: 79 f1 breq .+94 ; 0x10aa2 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. 10a44: 83 e0 ldi r24, 0x03 ; 3 10a46: 98 e7 ldi r25, 0x78 ; 120 10a48: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 // 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); 10a4c: 8e ef ldi r24, 0xFE ; 254 10a4e: 97 e7 ldi r25, 0x77 ; 119 10a50: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 // Echo current state if (mp_config & MPConfig_Active) 10a54: 10 91 3e 03 lds r17, 0x033E ; 0x80033e SERIAL_ECHOPGM(" ON"); 10a58: 8a ef ldi r24, 0xFA ; 250 10a5a: 97 e7 ldi r25, 0x77 ; 119 // NOTE: if any configuration vars are added below, the outgoing sync text for host plugin // should not contain the "PV' substring, as this is used to indicate protocol version SERIAL_ECHOPGM(MeatPack_ProtocolVersion); // Echo current state if (mp_config & MPConfig_Active) 10a5c: 10 fd sbrc r17, 0 10a5e: 02 c0 rjmp .+4 ; 0x10a64 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10a60: 85 ef ldi r24, 0xF5 ; 245 10a62: 97 e7 ldi r25, 0x77 ; 119 10a64: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if (mp_config & MPConfig_NoSpaces) 10a68: 01 2f mov r16, r17 10a6a: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10a6c: 80 ef ldi r24, 0xF0 ; 240 10a6e: 97 e7 ldi r25, 0x77 ; 119 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10a70: 11 fd sbrc r17, 1 10a72: 02 c0 rjmp .+4 ; 0x10a78 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 10a74: 8b ee ldi r24, 0xEB ; 235 10a76: 97 e7 ldi r25, 0x77 ; 119 10a78: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM(""); 10a7c: 8a ee ldi r24, 0xEA ; 234 10a7e: 97 e7 ldi r25, 0x77 ; 119 10a80: 0e 94 fe 7a call 0xf5fc ; 0xf5fc // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 10a84: 00 23 and r16, r16 10a86: 29 f1 breq .+74 ; 0x10ad2 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10a88: 45 e4 ldi r20, 0x45 ; 69 10a8a: 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; 10a8e: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f 10a92: 55 cf rjmp .-342 ; 0x1093e } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10a94: 8a 3f cpi r24, 0xFA ; 250 10a96: 41 f0 breq .+16 ; 0x10aa8 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10a98: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10a9c: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10a9e: 2b 3f cpi r18, 0xFB ; 251 10aa0: 89 f6 brne .-94 ; 0x10a44 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10aa2: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e 10aa6: ce cf rjmp .-100 ; 0x10a44 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10aa8: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10aac: 8e 7f andi r24, 0xFE ; 254 10aae: f9 cf rjmp .-14 ; 0x10aa2 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10ab0: 10 92 43 03 sts 0x0343, r1 ; 0x800343 mp_cmd_active = MPCommand_None; 10ab4: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f mp_config = MPConfig_None; 10ab8: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e mp_char_buf = 0; 10abc: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d mp_cmd_count = 0; 10ac0: 10 92 40 03 sts 0x0340, r1 ; 0x800340 mp_cmd_active = 0; mp_full_char_queue = 0; 10ac4: 10 92 3c 03 sts 0x033C, r1 ; 0x80033c 10ac8: bd cf rjmp .-134 ; 0x10a44 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10aca: 80 91 3e 03 lds r24, 0x033E ; 0x80033e 10ace: 8d 7f andi r24, 0xFD ; 253 10ad0: e8 cf rjmp .-48 ; 0x10aa2 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 10ad2: 50 e2 ldi r21, 0x20 ; 32 10ad4: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10ad8: da cf rjmp .-76 ; 0x10a8e mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10ada: 20 91 40 03 lds r18, 0x0340 ; 0x800340 10ade: 40 91 3e 03 lds r20, 0x033E ; 0x80033e 10ae2: 22 23 and r18, r18 10ae4: 31 f1 breq .+76 ; 0x10b32 10ae6: e0 91 43 03 lds r30, 0x0343 ; 0x800343 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 10aea: 40 ff sbrs r20, 0 10aec: 49 c0 rjmp .+146 ; 0x10b80 if (mp_full_char_queue > 0) { 10aee: 30 91 3c 03 lds r19, 0x033C ; 0x80033c 10af2: 33 23 and r19, r19 10af4: 09 f4 brne .+2 ; 0x10af8 10af6: 40 c0 rjmp .+128 ; 0x10b78 #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; 10af8: 21 e0 ldi r18, 0x01 ; 1 10afa: 2e 0f add r18, r30 10afc: 20 93 43 03 sts 0x0343, r18 ; 0x800343 10b00: ae 2f mov r26, r30 10b02: b0 e0 ldi r27, 0x00 ; 0 10b04: af 5b subi r26, 0xBF ; 191 10b06: bc 4f sbci r27, 0xFC ; 252 10b08: ff ef ldi r31, 0xFF ; 255 10b0a: 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) { 10b0c: 50 91 3d 03 lds r21, 0x033D ; 0x80033d 10b10: 55 23 and r21, r21 10b12: 51 f0 breq .+20 ; 0x10b28 #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; 10b14: ee 5f subi r30, 0xFE ; 254 10b16: e0 93 43 03 sts 0x0343, r30 ; 0x800343 10b1a: e2 2f mov r30, r18 10b1c: f0 e0 ldi r31, 0x00 ; 0 10b1e: ef 5b subi r30, 0xBF ; 191 10b20: fc 4f sbci r31, 0xFC ; 252 10b22: 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; 10b24: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d } --mp_full_char_queue; 10b28: 31 50 subi r19, 0x01 ; 1 10b2a: 30 93 3c 03 sts 0x033C, r19 ; 0x80033c return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 10b2e: 10 92 40 03 sts 0x0340, r1 ; 0x800340 10b32: e0 91 43 03 lds r30, 0x0343 ; 0x800343 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 10b36: 40 ff sbrs r20, 0 10b38: 6c c0 rjmp .+216 ; 0x10c12 if (mp_full_char_queue > 0) { 10b3a: 20 91 3c 03 lds r18, 0x033C ; 0x80033c 10b3e: 22 23 and r18, r18 10b40: 49 f1 breq .+82 ; 0x10b94 #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; 10b42: 91 e0 ldi r25, 0x01 ; 1 10b44: 9e 0f add r25, r30 10b46: 90 93 43 03 sts 0x0343, r25 ; 0x800343 10b4a: ae 2f mov r26, r30 10b4c: b0 e0 ldi r27, 0x00 ; 0 10b4e: af 5b subi r26, 0xBF ; 191 10b50: bc 4f sbci r27, 0xFC ; 252 10b52: 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) { 10b54: 80 91 3d 03 lds r24, 0x033D ; 0x80033d 10b58: 88 23 and r24, r24 10b5a: 51 f0 breq .+20 ; 0x10b70 #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; 10b5c: ee 5f subi r30, 0xFE ; 254 10b5e: e0 93 43 03 sts 0x0343, r30 ; 0x800343 10b62: e9 2f mov r30, r25 10b64: f0 e0 ldi r31, 0x00 ; 0 10b66: ef 5b subi r30, 0xBF ; 191 10b68: fc 4f sbci r31, 0xFC ; 252 10b6a: 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; 10b6c: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d } --mp_full_char_queue; 10b70: 21 50 subi r18, 0x01 ; 1 10b72: 20 93 3c 03 sts 0x033C, r18 ; 0x80033c 10b76: e3 ce rjmp .-570 ; 0x1093e 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; 10b78: 22 e0 ldi r18, 0x02 ; 2 10b7a: 20 93 3c 03 sts 0x033C, r18 ; 0x80033c 10b7e: d7 cf rjmp .-82 ; 0x10b2e #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; 10b80: 21 e0 ldi r18, 0x01 ; 1 10b82: 2e 0f add r18, r30 10b84: 20 93 43 03 sts 0x0343, r18 ; 0x800343 10b88: f0 e0 ldi r31, 0x00 ; 0 10b8a: ef 5b subi r30, 0xBF ; 191 10b8c: fc 4f sbci r31, 0xFC ; 252 10b8e: 5f ef ldi r21, 0xFF ; 255 10b90: 50 83 st Z, r21 10b92: cd cf rjmp .-102 ; 0x10b2e 10b94: a8 2f mov r26, r24 10b96: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10b98: 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; 10b9a: 31 e0 ldi r19, 0x01 ; 1 10b9c: af 30 cpi r26, 0x0F ; 15 10b9e: 29 f0 breq .+10 ; 0x10baa 10ba0: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 10ba2: a0 50 subi r26, 0x00 ; 0 10ba4: be 4f sbci r27, 0xFE ; 254 10ba6: 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; 10ba8: 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; 10baa: 58 2f mov r21, r24 10bac: 50 7f andi r21, 0xF0 ; 240 10bae: 50 3f cpi r21, 0xF0 ; 240 10bb0: 59 f4 brne .+22 ; 0x10bc8 10bb2: 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) { 10bb4: 30 ff sbrs r19, 0 10bb6: 13 c0 rjmp .+38 ; 0x10bde ++mp_full_char_queue; 10bb8: d0 92 3c 03 sts 0x033C, r13 ; 0x80033c if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10bbc: 31 ff sbrs r19, 1 10bbe: 0c c0 rjmp .+24 ; 0x10bd8 10bc0: 82 e0 ldi r24, 0x02 ; 2 10bc2: 80 93 3c 03 sts 0x033C, r24 ; 0x80033c 10bc6: bb ce rjmp .-650 ; 0x1093e 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 10bc8: 82 95 swap r24 10bca: 8f 70 andi r24, 0x0F ; 15 10bcc: a8 2f mov r26, r24 10bce: b0 e0 ldi r27, 0x00 ; 0 10bd0: a0 50 subi r26, 0x00 ; 0 10bd2: be 4f sbci r27, 0xFE ; 254 10bd4: 2c 91 ld r18, X 10bd6: ee cf rjmp .-36 ; 0x10bb4 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]; 10bd8: 20 93 3d 03 sts 0x033D, r18 ; 0x80033d 10bdc: b0 ce rjmp .-672 ; 0x1093e #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; 10bde: 81 e0 ldi r24, 0x01 ; 1 10be0: 8e 0f add r24, r30 10be2: 80 93 43 03 sts 0x0343, r24 ; 0x800343 10be6: ae 2f mov r26, r30 10be8: b0 e0 ldi r27, 0x00 ; 0 10bea: af 5b subi r26, 0xBF ; 191 10bec: bc 4f sbci r27, 0xFC ; 252 10bee: 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') { 10bf0: 4a 30 cpi r20, 0x0A ; 10 10bf2: 09 f4 brne .+2 ; 0x10bf6 10bf4: a4 ce rjmp .-696 ; 0x1093e if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10bf6: 31 ff sbrs r19, 1 10bf8: 03 c0 rjmp .+6 ; 0x10c00 10bfa: d0 92 3c 03 sts 0x033C, r13 ; 0x80033c 10bfe: 9f ce rjmp .-706 ; 0x1093e #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; 10c00: ee 5f subi r30, 0xFE ; 254 10c02: e0 93 43 03 sts 0x0343, r30 ; 0x800343 10c06: e8 2f mov r30, r24 10c08: f0 e0 ldi r31, 0x00 ; 0 10c0a: ef 5b subi r30, 0xBF ; 191 10c0c: fc 4f sbci r31, 0xFC ; 252 10c0e: 20 83 st Z, r18 10c10: 96 ce rjmp .-724 ; 0x1093e 10c12: 91 e0 ldi r25, 0x01 ; 1 10c14: 9e 0f add r25, r30 10c16: 90 93 43 03 sts 0x0343, r25 ; 0x800343 10c1a: f0 e0 ldi r31, 0x00 ; 0 10c1c: ef 5b subi r30, 0xBF ; 191 10c1e: fc 4f sbci r31, 0xFC ; 252 10c20: 80 83 st Z, r24 10c22: 8d ce rjmp .-742 ; 0x1093e continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 10c24: 00 97 sbiw r24, 0x00 ; 0 10c26: 19 f4 brne .+6 ; 0x10c2e comment_mode = false; //for new command 10c28: 10 92 45 03 sts 0x0345, r1 ; 0x800345 10c2c: de ce rjmp .-580 ; 0x109ea 10c2e: 00 91 7c 10 lds r16, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 10c32: 10 91 7d 10 lds r17, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 10c36: 0c 57 subi r16, 0x7C ; 124 10c38: 1f 4e sbci r17, 0xEF ; 239 10c3a: 80 0f add r24, r16 10c3c: 91 1f adc r25, r17 10c3e: fc 01 movw r30, r24 10c40: 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) 10c42: 1a 83 std Y+2, r17 ; 0x02 10c44: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10c46: 80 91 45 03 lds r24, 0x0345 ; 0x800345 10c4a: 81 11 cpse r24, r1 10c4c: 03 c1 rjmp .+518 ; 0x10e54 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10c4e: f8 01 movw r30, r16 10c50: 80 81 ld r24, Z 10c52: 8e 34 cpi r24, 0x4E ; 78 10c54: 09 f0 breq .+2 ; 0x10c58 10c56: 8a c0 rjmp .+276 ; 0x10d6c // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10c58: 4a e0 ldi r20, 0x0A ; 10 10c5a: 50 e0 ldi r21, 0x00 ; 0 10c5c: be 01 movw r22, r28 10c5e: 6f 5f subi r22, 0xFF ; 255 10c60: 7f 4f sbci r23, 0xFF ; 255 10c62: c8 01 movw r24, r16 10c64: 01 96 adiw r24, 0x01 ; 1 10c66: 0f 94 14 d9 call 0x3b228 ; 0x3b228 10c6a: 2b 01 movw r4, r22 10c6c: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10c6e: e9 80 ldd r14, Y+1 ; 0x01 10c70: fa 80 ldd r15, Y+2 ; 0x02 10c72: f7 01 movw r30, r14 10c74: 80 81 ld r24, Z 10c76: 80 32 cpi r24, 0x20 ; 32 10c78: 31 f4 brne .+12 ; 0x10c86 10c7a: ff ef ldi r31, 0xFF ; 255 10c7c: ef 1a sub r14, r31 10c7e: ff 0a sbc r15, r31 10c80: fa 82 std Y+2, r15 ; 0x02 10c82: e9 82 std Y+1, r14 ; 0x01 10c84: f4 cf rjmp .-24 ; 0x10c6e // 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)) { 10c86: 80 90 7a 03 lds r8, 0x037A ; 0x80037a 10c8a: 90 90 7b 03 lds r9, 0x037B ; 0x80037b 10c8e: a0 90 7c 03 lds r10, 0x037C ; 0x80037c 10c92: b0 90 7d 03 lds r11, 0x037D ; 0x80037d 10c96: d5 01 movw r26, r10 10c98: c4 01 movw r24, r8 10c9a: 01 96 adiw r24, 0x01 ; 1 10c9c: a1 1d adc r26, r1 10c9e: b1 1d adc r27, r1 10ca0: 84 15 cp r24, r4 10ca2: 95 05 cpc r25, r5 10ca4: a6 05 cpc r26, r6 10ca6: b7 05 cpc r27, r7 10ca8: 49 f0 breq .+18 ; 0x10cbc 10caa: 44 e0 ldi r20, 0x04 ; 4 10cac: 50 e0 ldi r21, 0x00 ; 0 10cae: 63 e3 ldi r22, 0x33 ; 51 10cb0: 78 e7 ldi r23, 0x78 ; 120 10cb2: c7 01 movw r24, r14 10cb4: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 10cb8: 89 2b or r24, r25 10cba: a1 f4 brne .+40 ; 0x10ce4 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10cbc: 6a e2 ldi r22, 0x2A ; 42 10cbe: 70 e0 ldi r23, 0x00 ; 0 10cc0: c7 01 movw r24, r14 10cc2: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 10cc6: 90 93 96 03 sts 0x0396, r25 ; 0x800396 10cca: 80 93 95 03 sts 0x0395, r24 ; 0x800395 10cce: 00 97 sbiw r24, 0x00 ; 0 10cd0: 09 f4 brne .+2 ; 0x10cd4 10cd2: 45 c0 rjmp .+138 ; 0x10d5e 10cd4: f8 01 movw r30, r16 { byte checksum = 0; 10cd6: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10cd8: e8 17 cp r30, r24 10cda: f9 07 cpc r31, r25 10cdc: 71 f0 breq .+28 ; 0x10cfa checksum = checksum^(*p++); 10cde: 21 91 ld r18, Z+ 10ce0: f2 26 eor r15, r18 10ce2: fa cf rjmp .-12 ; 0x10cd8 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; 10ce4: 8a eb ldi r24, 0xBA ; 186 10ce6: 99 ea ldi r25, 0xA9 ; 169 10ce8: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10cec: 8c ec ldi r24, 0xCC ; 204 10cee: 95 e6 ldi r25, 0x65 ; 101 *strchr_pointer = 0; } else { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10cf0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 10cf4: c5 01 movw r24, r10 10cf6: b4 01 movw r22, r8 10cf8: 15 c0 rjmp .+42 ; 0x10d24 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10cfa: 0e 94 13 5c call 0xb826 ; 0xb826 10cfe: f8 16 cp r15, r24 10d00: 19 06 cpc r1, r25 10d02: d9 f0 breq .+54 ; 0x10d3a SERIAL_ERROR_START; 10d04: 8a eb ldi r24, 0xBA ; 186 10d06: 99 ea ldi r25, 0xA9 ; 169 10d08: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10d0c: 8d ea ldi r24, 0xAD ; 173 10d0e: 95 e6 ldi r25, 0x65 ; 101 10d10: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 10d14: 60 91 7a 03 lds r22, 0x037A ; 0x80037a 10d18: 70 91 7b 03 lds r23, 0x037B ; 0x80037b 10d1c: 80 91 7c 03 lds r24, 0x037C ; 0x80037c 10d20: 90 91 7d 03 lds r25, 0x037D ; 0x80037d 10d24: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10d28: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10d2c: 0e 94 2b 5c call 0xb856 ; 0xb856 serial_count = 0; 10d30: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b 10d34: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a 10d38: 58 ce rjmp .-848 ; 0x109ea return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10d3a: e0 91 95 03 lds r30, 0x0395 ; 0x800395 10d3e: f0 91 96 03 lds r31, 0x0396 ; 0x800396 10d42: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 10d44: e9 80 ldd r14, Y+1 ; 0x01 10d46: fa 80 ldd r15, Y+2 ; 0x02 10d48: 6e e2 ldi r22, 0x2E ; 46 10d4a: 78 e7 ldi r23, 0x78 ; 120 10d4c: c7 01 movw r24, r14 10d4e: 0f 94 37 db call 0x3b66e ; 0x3b66e 10d52: 89 2b or r24, r25 10d54: 39 f5 brne .+78 ; 0x10da4 kill(MSG_M112_KILL); 10d56: 87 ee ldi r24, 0xE7 ; 231 10d58: 98 e6 ldi r25, 0x68 ; 104 10d5a: 0e 94 8d 7b call 0xf71a ; 0xf71a // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10d5e: 8a eb ldi r24, 0xBA ; 186 10d60: 99 ea ldi r25, 0xA9 ; 169 10d62: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10d66: 83 e8 ldi r24, 0x83 ; 131 10d68: 95 e6 ldi r25, 0x65 ; 101 10d6a: c2 cf rjmp .-124 ; 0x10cf0 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10d6c: 89 81 ldd r24, Y+1 ; 0x01 10d6e: 9a 81 ldd r25, Y+2 ; 0x02 10d70: fc 01 movw r30, r24 10d72: 20 81 ld r18, Z 10d74: 20 32 cpi r18, 0x20 ; 32 10d76: 21 f4 brne .+8 ; 0x10d80 10d78: 01 96 adiw r24, 0x01 ; 1 10d7a: 9a 83 std Y+2, r25 ; 0x02 10d7c: 89 83 std Y+1, r24 ; 0x01 10d7e: f6 cf rjmp .-20 ; 0x10d6c // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10d80: 6a e2 ldi r22, 0x2A ; 42 10d82: 70 e0 ldi r23, 0x00 ; 0 10d84: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 10d88: 89 2b or r24, r25 10d8a: 39 f0 breq .+14 ; 0x10d9a { SERIAL_ERROR_START; 10d8c: 8a eb ldi r24, 0xBA ; 186 10d8e: 99 ea ldi r25, 0xA9 ; 169 10d90: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10d94: 89 e5 ldi r24, 0x59 ; 89 10d96: 95 e6 ldi r25, 0x65 ; 101 10d98: bb cf rjmp .-138 ; 0x10d10 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 10d9a: 44 24 eor r4, r4 10d9c: 4a 94 dec r4 10d9e: 54 2c mov r5, r4 10da0: 32 01 movw r6, r4 10da2: d0 cf rjmp .-96 ; 0x10d44 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) 10da4: 44 e0 ldi r20, 0x04 ; 4 10da6: 50 e0 ldi r21, 0x00 ; 0 10da8: 69 e2 ldi r22, 0x29 ; 41 10daa: 78 e7 ldi r23, 0x78 ; 120 10dac: c7 01 movw r24, r14 10dae: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 10db2: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10db4: f7 01 movw r30, r14 10db6: 80 81 ld r24, Z 10db8: 87 34 cpi r24, 0x47 ; 71 10dba: 81 f4 brne .+32 ; 0x10ddc 10dbc: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 10dc0: 85 30 cpi r24, 0x05 ; 5 10dc2: 61 f0 breq .+24 ; 0x10ddc usb_timer.start(); 10dc4: 8f e0 ldi r24, 0x0F ; 15 10dc6: 95 e0 ldi r25, 0x05 ; 5 10dc8: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10dcc: f6 e0 ldi r31, 0x06 ; 6 10dce: f0 93 65 0e sts 0x0E65, r31 ; 0x800e65 <_ZL13printer_state.lto_priv.397> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10dd2: 60 e0 ldi r22, 0x00 ; 0 10dd4: 85 ea ldi r24, 0xA5 ; 165 10dd6: 9f e0 ldi r25, 0x0F ; 15 10dd8: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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) { 10ddc: ab 28 or r10, r11 10dde: 21 f0 breq .+8 ; 0x10de8 10de0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 10de4: 81 11 cpse r24, r1 10de6: a4 cf rjmp .-184 ; 0x10d30 } // 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; 10de8: 26 e0 ldi r18, 0x06 ; 6 10dea: 77 fc sbrc r7, 7 10dec: 21 e0 ldi r18, 0x01 ; 1 10dee: 80 91 7c 10 lds r24, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 10df2: 90 91 7d 10 lds r25, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 10df6: fc 01 movw r30, r24 10df8: ef 57 subi r30, 0x7F ; 127 10dfa: ff 4e sbci r31, 0xEF ; 239 10dfc: 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) 10dfe: 49 81 ldd r20, Y+1 ; 0x01 10e00: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10e02: 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) 10e04: da 01 movw r26, r20 10e06: 40 17 cp r20, r16 10e08: 51 07 cpc r21, r17 10e0a: a1 f5 brne .+104 ; 0x10e74 cmd_len = strlen(cmd_start) + 1; 10e0c: 01 90 ld r0, Z+ 10e0e: 00 20 and r0, r0 10e10: e9 f7 brne .-6 ; 0x10e0c 10e12: 9f 01 movw r18, r30 10e14: 20 1b sub r18, r16 10e16: 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; 10e18: 03 96 adiw r24, 0x03 ; 3 10e1a: 28 0f add r18, r24 10e1c: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10e1e: 2d 3e cpi r18, 0xED ; 237 10e20: f1 e0 ldi r31, 0x01 ; 1 10e22: 3f 07 cpc r19, r31 10e24: 79 f1 breq .+94 ; 0x10e84 // 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; 10e26: 30 93 7d 10 sts 0x107D, r19 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 10e2a: 20 93 7c 10 sts 0x107C, r18 ; 0x80107c <_ZL7bufindw.lto_priv.571> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10e2e: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 10e32: 90 91 80 10 lds r25, 0x1080 ; 0x801080 10e36: 01 96 adiw r24, 0x01 ; 1 10e38: 90 93 80 10 sts 0x1080, r25 ; 0x801080 10e3c: 80 93 7f 10 sts 0x107F, r24 ; 0x80107f // Update the processed gcode line if (gcode_N >= 0) 10e40: 77 fc sbrc r7, 7 10e42: 08 c0 rjmp .+16 ; 0x10e54 gcode_LastN = gcode_N; 10e44: 40 92 7a 03 sts 0x037A, r4 ; 0x80037a 10e48: 50 92 7b 03 sts 0x037B, r5 ; 0x80037b 10e4c: 60 92 7c 03 sts 0x037C, r6 ; 0x80037c 10e50: 70 92 7d 03 sts 0x037D, r7 ; 0x80037d SERIAL_ECHOPGM("Number of commands in the buffer: "); SERIAL_ECHO(buflen); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } // end of 'not comment mode' serial_count = 0; //clear buffer 10e54: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b 10e58: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a // 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)) 10e5c: 0e 94 8c 78 call 0xf118 ; 0xf118 10e60: 89 2b or r24, r25 10e62: 09 f4 brne .+2 ; 0x10e66 10e64: c2 cd rjmp .-1148 ; 0x109ea 10e66: 8f e5 ldi r24, 0x5F ; 95 10e68: 90 e0 ldi r25, 0x00 ; 0 10e6a: 0e 94 ef 5c call 0xb9de ; 0xb9de 10e6e: 81 11 cpse r24, r1 10e70: 79 cd rjmp .-1294 ; 0x10964 10e72: bb cd rjmp .-1162 ; 0x109ea 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]; } 10e74: 6d 91 ld r22, X+ 10e76: 61 93 st Z+, r22 10e78: 9d 01 movw r18, r26 10e7a: 24 1b sub r18, r20 10e7c: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10e7e: 61 11 cpse r22, r1 10e80: f9 cf rjmp .-14 ; 0x10e74 10e82: ca cf rjmp .-108 ; 0x10e18 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10e84: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 10e88: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.571> 10e8c: d0 cf rjmp .-96 ; 0x10e2e #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10e8e: 60 ed ldi r22, 0xD0 ; 208 10e90: 77 e0 ldi r23, 0x07 ; 7 10e92: 86 e4 ldi r24, 0x46 ; 70 10e94: 93 e0 ldi r25, 0x03 ; 3 10e96: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 10e9a: 88 23 and r24, r24 10e9c: 09 f4 brne .+2 ; 0x10ea0 10e9e: a1 cd rjmp .-1214 ; 0x109e2 comment_mode = false; 10ea0: 10 92 45 03 sts 0x0345, r1 ; 0x800345 serial_count = 0; 10ea4: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b 10ea8: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a SERIAL_ECHOLNPGM("RX timeout"); 10eac: 8e e1 ldi r24, 0x1E ; 30 10eae: 98 e7 ldi r25, 0x78 ; 120 10eb0: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 10eb4: 9a cd rjmp .-1228 ; 0x109ea return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10eb6: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 10eba: 88 23 and r24, r24 10ebc: 09 f4 brne .+2 ; 0x10ec0 10ebe: 95 cd rjmp .-1238 ; 0x109ea 10ec0: 80 91 7a 10 lds r24, 0x107A ; 0x80107a 10ec4: 90 91 7b 10 lds r25, 0x107B ; 0x80107b 10ec8: 89 2b or r24, r25 10eca: 09 f0 breq .+2 ; 0x10ece 10ecc: 8e cd rjmp .-1252 ; 0x109ea //'#' 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; 10ece: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 10ed2: 90 91 80 10 lds r25, 0x1080 ; 0x801080 10ed6: 89 2b or r24, r25 10ed8: 11 f4 brne .+4 ; 0x10ede 10eda: 10 92 44 03 sts 0x0344, r1 ; 0x800344 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10ede: 29 e7 ldi r18, 0x79 ; 121 10ee0: e2 2e mov r14, r18 10ee2: 20 e1 ldi r18, 0x10 ; 16 10ee4: 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; 10ee6: 32 e0 ldi r19, 0x02 ; 2 10ee8: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10eea: cc 24 eor r12, r12 10eec: 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) { 10eee: 40 91 80 17 lds r20, 0x1780 ; 0x801780 10ef2: 50 91 81 17 lds r21, 0x1781 ; 0x801781 10ef6: 60 91 82 17 lds r22, 0x1782 ; 0x801782 10efa: 70 91 83 17 lds r23, 0x1783 ; 0x801783 10efe: 80 91 79 17 lds r24, 0x1779 ; 0x801779 10f02: 90 91 7a 17 lds r25, 0x177A ; 0x80177a 10f06: a0 91 7b 17 lds r26, 0x177B ; 0x80177b 10f0a: b0 91 7c 17 lds r27, 0x177C ; 0x80177c 10f0e: 48 17 cp r20, r24 10f10: 59 07 cpc r21, r25 10f12: 6a 07 cpc r22, r26 10f14: 7b 07 cpc r23, r27 10f16: 08 f0 brcs .+2 ; 0x10f1a 10f18: 2f c1 rjmp .+606 ; 0x11178 10f1a: 80 91 44 03 lds r24, 0x0344 ; 0x800344 10f1e: 81 11 cpse r24, r1 10f20: 2b c1 rjmp .+598 ; 0x11178 : "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() ){ 10f22: 0f 94 9f 7c call 0x2f93e ; 0x2f93e 10f26: 88 23 and r24, r24 10f28: 49 f1 breq .+82 ; 0x10f7c 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; 10f2a: 20 91 17 17 lds r18, 0x1717 ; 0x801717 10f2e: 30 91 18 17 lds r19, 0x1718 ; 0x801718 // 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; 10f32: 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; 10f34: 9b ef ldi r25, 0xFB ; 251 10f36: 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 == ';' ){ 10f38: f8 01 movw r30, r16 10f3a: 80 81 ld r24, Z 10f3c: 8b 33 cpi r24, 0x3B ; 59 10f3e: 51 f5 brne .+84 ; 0x10f94 // 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); 10f40: f8 01 movw r30, r16 00010f42 : 10f42: 61 91 ld r22, Z+ 10f44: 6a 30 cpi r22, 0x0A ; 10 10f46: e9 f7 brne .-6 ; 0x10f42 10f48: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 10f4a: cf 01 movw r24, r30 10f4c: 89 57 subi r24, 0x79 ; 121 10f4e: 9e 40 sbci r25, 0x0E ; 14 10f50: 81 30 cpi r24, 0x01 ; 1 10f52: 92 40 sbci r25, 0x02 ; 2 10f54: d4 f0 brlt .+52 ; 0x10f8a // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 10f56: c8 01 movw r24, r16 10f58: 82 1b sub r24, r18 10f5a: 93 0b sbc r25, r19 10f5c: 01 97 sbiw r24, 0x01 ; 1 10f5e: 0f 94 90 7c call 0x2f920 ; 0x2f920 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10f62: 8c ef ldi r24, 0xFC ; 252 10f64: 96 e1 ldi r25, 0x16 ; 22 10f66: 0f 94 93 6d call 0x2db26 ; 0x2db26 10f6a: 88 23 and r24, r24 10f6c: 39 f0 breq .+14 ; 0x10f7c if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 10f6e: 0f 94 9f 7c call 0x2f93e ; 0x2f93e rdPtr = start = blockBuffBegin; 10f72: 29 e7 ldi r18, 0x79 ; 121 10f74: 3e e0 ldi r19, 0x0E ; 14 10f76: 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 10f78: 81 11 cpse r24, r1 10f7a: e2 cf rjmp .-60 ; 0x10f40 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10f7c: f0 92 18 17 sts 0x1718, r15 ; 0x801718 10f80: e0 92 17 17 sts 0x1717, r14 ; 0x801717 return -1; 10f84: 0f ef ldi r16, 0xFF ; 255 10f86: 1f ef ldi r17, 0xFF ; 255 10f88: 37 c0 rjmp .+110 ; 0x10ff8 10f8a: 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){ 10f8c: b1 10 cpse r11, r1 10f8e: d5 c0 rjmp .+426 ; 0x1113a // 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 10f90: 01 50 subi r16, 0x01 ; 1 10f92: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 10f94: c8 01 movw r24, r16 10f96: 82 1b sub r24, r18 10f98: 93 0b sbc r25, r19 10f9a: 01 96 adiw r24, 0x01 ; 1 10f9c: 0f 94 90 7c call 0x2f920 ; 0x2f920 int16_t rv = *rdPtr++; 10fa0: c8 01 movw r24, r16 10fa2: 01 96 adiw r24, 0x01 ; 1 10fa4: f8 01 movw r30, r16 10fa6: 00 81 ld r16, Z 10fa8: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 10faa: 80 90 04 17 lds r8, 0x1704 ; 0x801704 10fae: 90 90 05 17 lds r9, 0x1705 ; 0x801705 10fb2: a0 90 06 17 lds r10, 0x1706 ; 0x801706 10fb6: b0 90 07 17 lds r11, 0x1707 ; 0x801707 10fba: 40 91 0d 17 lds r20, 0x170D ; 0x80170d 10fbe: 50 91 0e 17 lds r21, 0x170E ; 0x80170e 10fc2: 60 91 0f 17 lds r22, 0x170F ; 0x80170f 10fc6: 70 91 10 17 lds r23, 0x1710 ; 0x801710 10fca: 84 16 cp r8, r20 10fcc: 95 06 cpc r9, r21 10fce: a6 06 cpc r10, r22 10fd0: b7 06 cpc r11, r23 10fd2: a0 f6 brcc .-88 ; 0x10f7c // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 10fd4: 9c 01 movw r18, r24 10fd6: 29 57 subi r18, 0x79 ; 121 10fd8: 3e 40 sbci r19, 0x0E ; 14 10fda: 21 15 cp r18, r1 10fdc: 32 40 sbci r19, 0x02 ; 2 10fde: 44 f0 brlt .+16 ; 0x10ff0 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10fe0: 8c ef ldi r24, 0xFC ; 252 10fe2: 96 e1 ldi r25, 0x16 ; 22 10fe4: 0f 94 93 6d call 0x2db26 ; 0x2db26 10fe8: 88 23 and r24, r24 10fea: 41 f2 breq .-112 ; 0x10f7c // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 10fec: 89 e7 ldi r24, 0x79 ; 121 10fee: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 10ff0: 90 93 18 17 sts 0x1718, r25 ; 0x801718 10ff4: 80 93 17 17 sts 0x1717, r24 ; 0x801717 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_;} 10ff8: 40 91 04 17 lds r20, 0x1704 ; 0x801704 10ffc: 50 91 05 17 lds r21, 0x1705 ; 0x801705 11000: 60 91 06 17 lds r22, 0x1706 ; 0x801706 11004: 70 91 07 17 lds r23, 0x1707 ; 0x801707 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(); 11008: 40 93 80 17 sts 0x1780, r20 ; 0x801780 1100c: 50 93 81 17 sts 0x1781, r21 ; 0x801781 11010: 60 93 82 17 sts 0x1782, r22 ; 0x801782 11014: 70 93 83 17 sts 0x1783, r23 ; 0x801783 11018: 80 91 7a 10 lds r24, 0x107A ; 0x80107a 1101c: 90 91 7b 10 lds r25, 0x107B ; 0x80107b int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 11020: 0a 30 cpi r16, 0x0A ; 10 11022: 61 f0 breq .+24 ; 0x1103c || serial_char == '\r' 11024: 0d 30 cpi r16, 0x0D ; 13 11026: 51 f0 breq .+20 ; 0x1103c || serial_char == '#' 11028: 03 32 cpi r16, 0x23 ; 35 1102a: 09 f4 brne .+2 ; 0x1102e 1102c: 8c c0 rjmp .+280 ; 0x11146 || serial_count >= (MAX_CMD_SIZE - 1) 1102e: 8f 35 cpi r24, 0x5F ; 95 11030: 91 05 cpc r25, r1 11032: 3c f4 brge .+14 ; 0x11042 || n==-1 11034: 0f 3f cpi r16, 0xFF ; 255 11036: 10 07 cpc r17, r16 11038: 09 f0 breq .+2 ; 0x1103c 1103a: 8c c0 rjmp .+280 ; 0x11154 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 1103c: 00 97 sbiw r24, 0x00 ; 0 1103e: 09 f4 brne .+2 ; 0x11042 11040: d4 cc rjmp .-1624 ; 0x109ea 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); }; 11042: 20 91 ff 16 lds r18, 0x16FF ; 0x8016ff 11046: 21 11 cpse r18, r1 11048: 03 c0 rjmp .+6 ; 0x11050 1104a: 40 e0 ldi r20, 0x00 ; 0 1104c: 50 e0 ldi r21, 0x00 ; 0 1104e: 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; 11050: 20 91 82 03 lds r18, 0x0382 ; 0x800382 11054: 30 91 83 03 lds r19, 0x0383 ; 0x800383 11058: 42 1b sub r20, r18 1105a: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 1105c: a0 91 7c 10 lds r26, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 11060: b0 91 7d 10 lds r27, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 11064: fd 01 movw r30, r26 11066: ef 57 subi r30, 0x7F ; 127 11068: ff 4e sbci r31, 0xEF ; 239 1106a: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 1106c: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 1106e: 52 83 std Z+2, r21 ; 0x02 11070: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 11072: 8f 57 subi r24, 0x7F ; 127 11074: 9f 4e sbci r25, 0xEF ; 239 11076: fc 01 movw r30, r24 11078: ea 0f add r30, r26 1107a: fb 1f adc r31, r27 1107c: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 1107e: af 57 subi r26, 0x7F ; 127 11080: bf 4e sbci r27, 0xEF ; 239 11082: fd 01 movw r30, r26 11084: 01 90 ld r0, Z+ 11086: 00 20 and r0, r0 11088: e9 f7 brne .-6 ; 0x11084 1108a: 31 97 sbiw r30, 0x01 ; 1 1108c: ea 1b sub r30, r26 1108e: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 11090: 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; 11092: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 11096: 90 91 80 10 lds r25, 0x1080 ; 0x801080 1109a: 01 96 adiw r24, 0x01 ; 1 1109c: 90 93 80 10 sts 0x1080, r25 ; 0x801080 110a0: 80 93 7f 10 sts 0x107F, r24 ; 0x80107f 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); 110a4: 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; 110a6: 80 91 7c 10 lds r24, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 110aa: 90 91 7d 10 lds r25, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 110ae: e8 0f add r30, r24 110b0: f9 2f mov r31, r25 110b2: f1 1d adc r31, r1 110b4: f0 93 7d 10 sts 0x107D, r31 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 110b8: e0 93 7c 10 sts 0x107C, r30 ; 0x80107c <_ZL7bufindw.lto_priv.571> 110bc: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 110c0: 88 23 and r24, r24 110c2: 09 f4 brne .+2 ; 0x110c6 110c4: 43 c0 rjmp .+134 ; 0x1114c 110c6: 80 91 80 17 lds r24, 0x1780 ; 0x801780 110ca: 90 91 81 17 lds r25, 0x1781 ; 0x801781 110ce: a0 91 82 17 lds r26, 0x1782 ; 0x801782 110d2: b0 91 83 17 lds r27, 0x1783 ; 0x801783 sdpos_atomic = card.get_sdpos(); 110d6: 80 93 82 03 sts 0x0382, r24 ; 0x800382 110da: 90 93 83 03 sts 0x0383, r25 ; 0x800383 110de: a0 93 84 03 sts 0x0384, r26 ; 0x800384 110e2: b0 93 85 03 sts 0x0385, r27 ; 0x800385 if (bufindw == sizeof(cmdbuffer)) 110e6: ed 3e cpi r30, 0xED ; 237 110e8: f1 40 sbci r31, 0x01 ; 1 110ea: 21 f4 brne .+8 ; 0x110f4 bufindw = 0; 110ec: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 110f0: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.571> sei(); 110f4: 78 94 sei comment_mode = false; //for new command 110f6: 10 92 45 03 sts 0x0345, r1 ; 0x800345 serial_count = 0; //clear buffer 110fa: 10 92 7b 10 sts 0x107B, r1 ; 0x80107b 110fe: 10 92 7a 10 sts 0x107A, r1 ; 0x80107a if(card.eof()) break; 11102: 40 91 80 17 lds r20, 0x1780 ; 0x801780 11106: 50 91 81 17 lds r21, 0x1781 ; 0x801781 1110a: 60 91 82 17 lds r22, 0x1782 ; 0x801782 1110e: 70 91 83 17 lds r23, 0x1783 ; 0x801783 11112: 80 91 79 17 lds r24, 0x1779 ; 0x801779 11116: 90 91 7a 17 lds r25, 0x177A ; 0x80177a 1111a: a0 91 7b 17 lds r26, 0x177B ; 0x80177b 1111e: b0 91 7c 17 lds r27, 0x177C ; 0x80177c 11122: 48 17 cp r20, r24 11124: 59 07 cpc r21, r25 11126: 6a 07 cpc r22, r26 11128: 7b 07 cpc r23, r27 1112a: 30 f5 brcc .+76 ; 0x11178 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 1112c: 8f e5 ldi r24, 0x5F ; 95 1112e: 90 e0 ldi r25, 0x00 ; 0 11130: 0e 94 ef 5c call 0xb9de ; 0xb9de 11134: 81 11 cpse r24, r1 11136: db ce rjmp .-586 ; 0x10eee 11138: 58 cc rjmp .-1872 ; 0x109ea 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 == ';' ){ 1113a: f8 01 movw r30, r16 1113c: 80 81 ld r24, Z 1113e: 8b 33 cpi r24, 0x3B ; 59 11140: 09 f4 brne .+2 ; 0x11144 11142: fa ce rjmp .-524 ; 0x10f38 11144: 25 cf rjmp .-438 ; 0x10f90 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 11146: c0 92 44 03 sts 0x0344, r12 ; 0x800344 1114a: 78 cf rjmp .-272 ; 0x1103c 1114c: 80 e0 ldi r24, 0x00 ; 0 1114e: 90 e0 ldi r25, 0x00 ; 0 11150: dc 01 movw r26, r24 11152: c1 cf rjmp .-126 ; 0x110d6 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 11154: 9c 01 movw r18, r24 11156: 2f 5f subi r18, 0xFF ; 255 11158: 3f 4f sbci r19, 0xFF ; 255 1115a: 30 93 7b 10 sts 0x107B, r19 ; 0x80107b 1115e: 20 93 7a 10 sts 0x107A, r18 ; 0x80107a 11162: 20 91 7c 10 lds r18, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 11166: 30 91 7d 10 lds r19, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 1116a: 2f 57 subi r18, 0x7F ; 127 1116c: 3f 4e sbci r19, 0xEF ; 239 1116e: 82 0f add r24, r18 11170: 93 1f adc r25, r19 11172: fc 01 movw r30, r24 11174: 03 83 std Z+3, r16 ; 0x03 11176: bb ce rjmp .-650 ; 0x10eee } } if(card.eof()) 11178: 40 91 80 17 lds r20, 0x1780 ; 0x801780 1117c: 50 91 81 17 lds r21, 0x1781 ; 0x801781 11180: 60 91 82 17 lds r22, 0x1782 ; 0x801782 11184: 70 91 83 17 lds r23, 0x1783 ; 0x801783 11188: 80 91 79 17 lds r24, 0x1779 ; 0x801779 1118c: 90 91 7a 17 lds r25, 0x177A ; 0x80177a 11190: a0 91 7b 17 lds r26, 0x177B ; 0x80177b 11194: b0 91 7c 17 lds r27, 0x177C ; 0x80177c 11198: 48 17 cp r20, r24 1119a: 59 07 cpc r21, r25 1119c: 6a 07 cpc r22, r26 1119e: 7b 07 cpc r23, r27 111a0: 08 f4 brcc .+2 ; 0x111a4 111a2: 23 cc rjmp .-1978 ; 0x109ea { // 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()) 111a4: 0e 94 b1 5b call 0xb762 ; 0xb762 111a8: 89 2b or r24, r25 111aa: 09 f0 breq .+2 ; 0x111ae 111ac: 1e cc rjmp .-1988 ; 0x109ea lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 111ae: 8c ef ldi r24, 0xFC ; 252 111b0: 96 e1 ldi r25, 0x16 ; 22 111b2: 0f 94 74 6e call 0x2dce8 ; 0x2dce8 file.close(); 111b6: 8c ef ldi r24, 0xFC ; 252 111b8: 96 e1 ldi r25, 0x16 ; 22 111ba: 0f 94 6c a4 call 0x348d8 ; 0x348d8 saving = false; 111be: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a logging = false; 111c2: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b { // 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 111c6: 86 e4 ldi r24, 0x46 ; 70 111c8: 95 e6 ldi r25, 0x65 ; 101 111ca: 0e 94 fe 7a call 0xf5fc ; 0xf5fc char time[30]; uint32_t t = print_job_timer.duration() / 60; 111ce: 0f 94 df 54 call 0x2a9be ; 0x2a9be 111d2: 6b 01 movw r12, r22 111d4: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 111d6: 0e 94 cc 66 call 0xcd98 ; 0xcd98 // 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; 111da: 8c e3 ldi r24, 0x3C ; 60 111dc: 88 2e mov r8, r24 111de: 91 2c mov r9, r1 111e0: a1 2c mov r10, r1 111e2: b1 2c mov r11, r1 111e4: c7 01 movw r24, r14 111e6: b6 01 movw r22, r12 111e8: a5 01 movw r20, r10 111ea: 94 01 movw r18, r8 111ec: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> int hours, minutes; minutes = t % 60; 111f0: ca 01 movw r24, r20 111f2: b9 01 movw r22, r18 111f4: a5 01 movw r20, r10 111f6: 94 01 movw r18, r8 111f8: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 111fc: 7f 93 push r23 111fe: 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; 11200: c7 01 movw r24, r14 11202: b6 01 movw r22, r12 11204: 20 e1 ldi r18, 0x10 ; 16 11206: 3e e0 ldi r19, 0x0E ; 14 11208: 40 e0 ldi r20, 0x00 ; 0 1120a: 50 e0 ldi r21, 0x00 ; 0 1120c: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 11210: 3f 93 push r19 11212: 2f 93 push r18 11214: 8a e0 ldi r24, 0x0A ; 10 11216: 98 e7 ldi r25, 0x78 ; 120 11218: 9f 93 push r25 1121a: 8f 93 push r24 1121c: 8e 01 movw r16, r28 1121e: 0f 5f subi r16, 0xFF ; 255 11220: 1f 4f sbci r17, 0xFF ; 255 11222: 1f 93 push r17 11224: 0f 93 push r16 11226: 0f 94 a0 dc call 0x3b940 ; 0x3b940 SERIAL_ECHO_START; 1122a: 82 ee ldi r24, 0xE2 ; 226 1122c: 99 ea ldi r25, 0xA9 ; 169 1122e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(time); 11232: c8 01 movw r24, r16 11234: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c #ifndef SHOW_FILENAME_AFTER_FINISH lcd_setstatus(time); 11238: c8 01 movw r24, r16 1123a: 0f 94 4e 15 call 0x22a9c ; 0x22a9c #endif //SHOW_FILENAME_AFTER_FINISH card.printingHasFinished(); 1123e: 0f 94 31 81 call 0x30262 ; 0x30262 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 11242: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.572> if(!mounted) 11246: 0f b6 in r0, 0x3f ; 63 11248: f8 94 cli 1124a: de bf out 0x3e, r29 ; 62 1124c: 0f be out 0x3f, r0 ; 63 1124e: cd bf out 0x3d, r28 ; 61 11250: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 11254: 88 23 and r24, r24 11256: 19 f0 breq .+6 ; 0x1125e 11258: 0f 94 d3 77 call 0x2efa6 ; 0x2efa6 1125c: c6 cb rjmp .-2164 ; 0x109ea { mount(); 1125e: 81 e0 ldi r24, 0x01 ; 1 11260: 0f 94 70 81 call 0x302e0 ; 0x302e0 if(!mounted) //fail 11264: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 11268: 81 11 cpse r24, r1 1126a: f6 cf rjmp .-20 ; 0x11258 1126c: be cb rjmp .-2180 ; 0x109ea 0001126e : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 1126e: cf 93 push r28 11270: df 93 push r29 11272: ec 01 movw r28, r24 { while (*str) 11274: 89 91 ld r24, Y+ 11276: 88 23 and r24, r24 11278: 19 f0 breq .+6 ; 0x11280 write(*str++); 1127a: 0e 94 ba 78 call 0xf174 ; 0xf174 1127e: fa cf rjmp .-12 ; 0x11274 } 11280: df 91 pop r29 11282: cf 91 pop r28 11284: 08 95 ret 00011286 : //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) { 11286: ff 92 push r15 11288: 0f 93 push r16 1128a: 1f 93 push r17 1128c: cf 93 push r28 1128e: df 93 push r29 11290: ec 01 movw r28, r24 11292: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 11294: 66 23 and r22, r22 11296: 09 f4 brne .+2 ; 0x1129a 11298: 4b c0 rjmp .+150 ; 0x11330 #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); 1129a: 0f 94 47 db call 0x3b68e ; 0x3b68e <__strlen_P> 1129e: 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)) { 112a0: c8 01 movw r24, r16 112a2: 0e 94 ef 5c call 0xb9de ; 0xb9de 112a6: 88 23 and r24, r24 112a8: 09 f4 brne .+2 ; 0x112ac 112aa: 53 c0 rjmp .+166 ; 0x11352 // 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; 112ac: 80 91 7c 10 lds r24, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 112b0: 90 91 7d 10 lds r25, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 112b4: fc 01 movw r30, r24 112b6: ef 57 subi r30, 0x7F ; 127 112b8: ff 4e sbci r31, 0xEF ; 239 112ba: 23 e0 ldi r18, 0x03 ; 3 112bc: 20 83 st Z, r18 112be: 8c 57 subi r24, 0x7C ; 124 112c0: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 112c2: 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) 112c4: ff 20 and r15, r15 112c6: e9 f1 breq .+122 ; 0x11342 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 112c8: 0f 94 40 db call 0x3b680 ; 0x3b680 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 112cc: 82 ee ldi r24, 0xE2 ; 226 112ce: 99 ea ldi r25, 0xA9 ; 169 112d0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(MSG_Enqueing); 112d4: 8b e3 ldi r24, 0x3B ; 59 112d6: 95 e6 ldi r25, 0x65 ; 101 112d8: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 112dc: 80 91 7c 10 lds r24, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 112e0: 90 91 7d 10 lds r25, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 112e4: 8c 57 subi r24, 0x7C ; 124 112e6: 9f 4e sbci r25, 0xEF ; 239 112e8: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_ECHOLNPGM("\""); 112ec: 88 ee ldi r24, 0xE8 ; 232 112ee: 97 e7 ldi r25, 0x77 ; 119 112f0: 0e 94 fe 7a call 0xf5fc ; 0xf5fc bufindw += len + (CMDHDRSIZE + 1); 112f4: 80 91 7c 10 lds r24, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 112f8: 90 91 7d 10 lds r25, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 112fc: 04 96 adiw r24, 0x04 ; 4 112fe: 08 0f add r16, r24 11300: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 11302: 0d 3e cpi r16, 0xED ; 237 11304: 81 e0 ldi r24, 0x01 ; 1 11306: 18 07 cpc r17, r24 11308: f9 f0 breq .+62 ; 0x11348 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 1130a: 10 93 7d 10 sts 0x107D, r17 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 1130e: 00 93 7c 10 sts 0x107C, r16 ; 0x80107c <_ZL7bufindw.lto_priv.571> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11312: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 11316: 90 91 80 10 lds r25, 0x1080 ; 0x801080 1131a: 01 96 adiw r24, 0x01 ; 1 1131c: 90 93 80 10 sts 0x1080, r25 ; 0x801080 11320: 80 93 7f 10 sts 0x107F, r24 ; 0x80107f SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11324: df 91 pop r29 11326: cf 91 pop r28 11328: 1f 91 pop r17 1132a: 0f 91 pop r16 1132c: ff 90 pop r15 1132e: 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); 11330: fc 01 movw r30, r24 11332: 01 90 ld r0, Z+ 11334: 00 20 and r0, r0 11336: e9 f7 brne .-6 ; 0x11332 11338: 31 97 sbiw r30, 0x01 ; 1 1133a: 8f 01 movw r16, r30 1133c: 08 1b sub r16, r24 1133e: 19 0b sbc r17, r25 11340: af cf rjmp .-162 ; 0x112a0 // 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); 11342: 0f 94 f4 e3 call 0x3c7e8 ; 0x3c7e8 11346: c2 cf rjmp .-124 ; 0x112cc SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11348: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 1134c: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c <_ZL7bufindw.lto_priv.571> 11350: e0 cf rjmp .-64 ; 0x11312 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 11352: 8a eb ldi r24, 0xBA ; 186 11354: 99 ea ldi r25, 0xA9 ; 169 11356: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(MSG_Enqueing); 1135a: 8b e3 ldi r24, 0x3B ; 59 1135c: 95 e6 ldi r25, 0x65 ; 101 1135e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 11362: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 11364: ff 20 and r15, r15 11366: 59 f0 breq .+22 ; 0x1137e SERIAL_PROTOCOLRPGM(cmd); 11368: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 1136c: 83 ea ldi r24, 0xA3 ; 163 1136e: 99 ea ldi r25, 0xA9 ; 169 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11370: df 91 pop r29 11372: cf 91 pop r28 11374: 1f 91 pop r17 11376: 0f 91 pop r16 11378: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 1137a: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc 1137e: 0e 94 37 89 call 0x1126e ; 0x1126e 11382: f4 cf rjmp .-24 ; 0x1136c 00011384 : { 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) { 11384: 0f 93 push r16 11386: 1f 93 push r17 11388: cf 93 push r28 1138a: df 93 push r29 1138c: d6 2f mov r29, r22 1138e: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 11390: c0 e0 ldi r28, 0x00 ; 0 { void * const pgm_ptr = pgm_read_ptr(cmd_sequence + i); 11392: f8 01 movw r30, r16 11394: 85 91 lpm r24, Z+ 11396: 94 91 lpm r25, Z // M702 is currently only used with MMU enabled if (pgm_ptr == MSG_M702 && !MMU2::mmu2.Enabled()) { 11398: 2c e6 ldi r18, 0x6C ; 108 1139a: 88 31 cpi r24, 0x18 ; 24 1139c: 92 07 cpc r25, r18 1139e: 21 f4 brne .+8 ; 0x113a8 113a0: 20 91 96 13 lds r18, 0x1396 ; 0x801396 113a4: 21 30 cpi r18, 0x01 ; 1 113a6: 19 f4 brne .+6 ; 0x113ae continue; } enquecommand_P(static_cast(pgm_ptr)); 113a8: 61 e0 ldi r22, 0x01 ; 1 113aa: 0e 94 43 89 call 0x11286 ; 0x11286 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) 113ae: cf 5f subi r28, 0xFF ; 255 113b0: 0e 5f subi r16, 0xFE ; 254 113b2: 1f 4f sbci r17, 0xFF ; 255 113b4: dc 13 cpse r29, r28 113b6: ed cf rjmp .-38 ; 0x11392 continue; } enquecommand_P(static_cast(pgm_ptr)); } } 113b8: df 91 pop r29 113ba: cf 91 pop r28 113bc: 1f 91 pop r17 113be: 0f 91 pop r16 113c0: 08 95 ret 000113c2 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 113c2: cf 93 push r28 113c4: df 93 push r29 113c6: cd b7 in r28, 0x3d ; 61 113c8: de b7 in r29, 0x3e ; 62 113ca: 6e 97 sbiw r28, 0x1e ; 30 113cc: 0f b6 in r0, 0x3f ; 63 113ce: f8 94 cli 113d0: de bf out 0x3e, r29 ; 62 113d2: 0f be out 0x3f, r0 ; 63 113d4: cd bf out 0x3d, r28 ; 61 113d6: 9e 01 movw r18, r28 113d8: 2c 5d subi r18, 0xDC ; 220 113da: 3f 4f sbci r19, 0xFF ; 255 113dc: f9 01 movw r30, r18 113de: 41 91 ld r20, Z+ 113e0: 51 91 ld r21, Z+ 113e2: 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); 113e4: 6e e1 ldi r22, 0x1E ; 30 113e6: 70 e0 ldi r23, 0x00 ; 0 113e8: ce 01 movw r24, r28 113ea: 01 96 adiw r24, 0x01 ; 1 113ec: 0f 94 df dc call 0x3b9be ; 0x3b9be va_end(ap); enquecommand(cmd_buffer, false); 113f0: 60 e0 ldi r22, 0x00 ; 0 113f2: ce 01 movw r24, r28 113f4: 01 96 adiw r24, 0x01 ; 1 113f6: 0e 94 43 89 call 0x11286 ; 0x11286 } 113fa: 6e 96 adiw r28, 0x1e ; 30 113fc: 0f b6 in r0, 0x3f ; 63 113fe: f8 94 cli 11400: de bf out 0x3e, r29 ; 62 11402: 0f be out 0x3f, r0 ; 63 11404: cd bf out 0x3d, r28 ; 61 11406: df 91 pop r29 11408: cf 91 pop r28 1140a: 08 95 ret 0001140c : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 1140c: ef 92 push r14 1140e: ff 92 push r15 11410: 0f 93 push r16 11412: 1f 93 push r17 11414: cf 93 push r28 11416: df 93 push r29 11418: cd b7 in r28, 0x3d ; 61 1141a: de b7 in r29, 0x3e ; 62 1141c: 6b 97 sbiw r28, 0x1b ; 27 1141e: 0f b6 in r0, 0x3f ; 63 11420: f8 94 cli 11422: de bf out 0x3e, r29 ; 62 11424: 0f be out 0x3f, r0 ; 63 11426: 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); 11428: 8a e5 ldi r24, 0x5A ; 90 1142a: 9f e0 ldi r25, 0x0F ; 15 1142c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 11430: e8 2e mov r14, r24 11432: 0a e0 ldi r16, 0x0A ; 10 11434: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 11436: 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); 11438: 48 e0 ldi r20, 0x08 ; 8 1143a: 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++) { 1143c: fe 14 cp r15, r14 1143e: 79 f0 breq .+30 ; 0x1145e eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 11440: b8 01 movw r22, r16 11442: ce 01 movw r24, r28 11444: 0e 96 adiw r24, 0x0e ; 14 11446: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 dir_name[8] = '\0'; 1144a: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 1144c: 60 e0 ldi r22, 0x00 ; 0 1144e: ce 01 movw r24, r28 11450: 0e 96 adiw r24, 0x0e ; 14 11452: 0f 94 c2 7e call 0x2fd84 ; 0x2fd84 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++) { 11456: f3 94 inc r15 11458: 08 5f subi r16, 0xF8 ; 248 1145a: 1f 4f sbci r17, 0xFF ; 255 1145c: ed cf rjmp .-38 ; 0x11438 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); 1145e: 65 e9 ldi r22, 0x95 ; 149 11460: 7f e0 ldi r23, 0x0F ; 15 11462: 8e 01 movw r16, r28 11464: 0f 5f subi r16, 0xFF ; 255 11466: 1f 4f sbci r17, 0xFF ; 255 11468: c8 01 movw r24, r16 1146a: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 1146e: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 11470: 8e e2 ldi r24, 0x2E ; 46 11472: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 11474: 43 e0 ldi r20, 0x03 ; 3 11476: 50 e0 ldi r21, 0x00 ; 0 11478: 61 e9 ldi r22, 0x91 ; 145 1147a: 7c e0 ldi r23, 0x0C ; 12 1147c: ce 01 movw r24, r28 1147e: 48 96 adiw r24, 0x18 ; 24 11480: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 extension_ptr[4] = '\0'; 11484: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 11486: be 01 movw r22, r28 11488: 69 5e subi r22, 0xE9 ; 233 1148a: 7f 4f sbci r23, 0xFF ; 255 1148c: c8 01 movw r24, r16 1148e: 0f 94 d5 e3 call 0x3c7aa ; 0x3c7aa enquecommandf_P(MSG_M23, filename); 11492: 1f 93 push r17 11494: 0f 93 push r16 11496: 8c ee ldi r24, 0xEC ; 236 11498: 90 e7 ldi r25, 0x70 ; 112 1149a: 9f 93 push r25 1149c: 8f 93 push r24 1149e: 0e 94 e1 89 call 0x113c2 ; 0x113c2 114a2: 0f 90 pop r0 114a4: 0f 90 pop r0 114a6: 0f 90 pop r0 114a8: 0f 90 pop r0 } 114aa: 6b 96 adiw r28, 0x1b ; 27 114ac: 0f b6 in r0, 0x3f ; 63 114ae: f8 94 cli 114b0: de bf out 0x3e, r29 ; 62 114b2: 0f be out 0x3f, r0 ; 63 114b4: cd bf out 0x3d, r28 ; 61 114b6: df 91 pop r29 114b8: cf 91 pop r28 114ba: 1f 91 pop r17 114bc: 0f 91 pop r16 114be: ff 90 pop r15 114c0: ef 90 pop r14 114c2: 08 95 ret 000114c4 : //! 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) { 114c4: bf 92 push r11 114c6: cf 92 push r12 114c8: df 92 push r13 114ca: ef 92 push r14 114cc: ff 92 push r15 114ce: 0f 93 push r16 114d0: 1f 93 push r17 114d2: cf 93 push r28 114d4: df 93 push r29 if (saved_printing) return; 114d6: e0 91 58 0e lds r30, 0x0E58 ; 0x800e58 114da: e1 11 cpse r30, r1 114dc: b1 c0 rjmp .+354 ; 0x11640 114de: 05 2f mov r16, r21 114e0: 14 2f mov r17, r20 114e2: e9 01 movw r28, r18 114e4: 6b 01 movw r12, r22 114e6: 7c 01 movw r14, r24 cli(); 114e8: f8 94 cli save_print_file_state(); 114ea: 0e 94 e7 65 call 0xcbce ; 0xcbce // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 114ee: b0 90 57 0e lds r11, 0x0E57 ; 0x800e57 114f2: b1 10 cpse r11, r1 114f4: 02 c0 rjmp .+4 ; 0x114fa 114f6: b0 90 56 0e lds r11, 0x0E56 ; 0x800e56 save_planner_global_state(); 114fa: 0e 94 9d 65 call 0xcb3a ; 0xcb3a planner_abort_hard(); //abort printing 114fe: 0f 94 05 bc call 0x3780a ; 0x3780a memcpy(saved_pos, current_position, sizeof(saved_pos)); 11502: 80 e1 ldi r24, 0x10 ; 16 11504: e1 e4 ldi r30, 0x41 ; 65 11506: f7 e0 ldi r31, 0x07 ; 7 11508: ab e9 ldi r26, 0x9B ; 155 1150a: b2 e0 ldi r27, 0x02 ; 2 1150c: 01 90 ld r0, Z+ 1150e: 0d 92 st X+, r0 11510: 8a 95 dec r24 11512: e1 f7 brne .-8 ; 0x1150c if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 11514: bb 20 and r11, r11 11516: 61 f0 breq .+24 ; 0x11530 11518: 80 e0 ldi r24, 0x00 ; 0 1151a: 90 e0 ldi r25, 0x00 ; 0 1151c: a0 e8 ldi r26, 0x80 ; 128 1151e: bf eb ldi r27, 0xBF ; 191 11520: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 11524: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 11528: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 1152c: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_feedmultiply2 = feedmultiply; //save feedmultiply 11530: 80 91 39 02 lds r24, 0x0239 ; 0x800239 11534: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 11538: 90 93 72 03 sts 0x0372, r25 ; 0x800372 1153c: 80 93 71 03 sts 0x0371, r24 ; 0x800371 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 11540: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 11544: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 11548: 90 93 ac 05 sts 0x05AC, r25 ; 0x8005ac 1154c: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab saved_bed_temperature = (uint8_t)degTargetBed(); 11550: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 11554: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 11558: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 1155c: 83 fb bst r24, 3 1155e: 88 27 eor r24, r24 11560: 80 f9 bld r24, 0 11562: 80 93 04 18 sts 0x1804, r24 ; 0x801804 saved_fan_speed = fanSpeed; 11566: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1156a: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa cmdqueue_reset(); //empty cmdqueue 1156e: 0e 94 c7 80 call 0x1018e ; 0x1018e card.sdprinting = false; 11572: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c // card.closefile(); saved_printing = true; 11576: 81 e0 ldi r24, 0x01 ; 1 11578: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 1157c: 0f 94 7e 59 call 0x2b2fc ; 0x2b2fc sei(); 11580: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 11582: 20 e0 ldi r18, 0x00 ; 0 11584: 30 e0 ldi r19, 0x00 ; 0 11586: a9 01 movw r20, r18 11588: c7 01 movw r24, r14 1158a: b6 01 movw r22, r12 1158c: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__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) 11590: 20 e0 ldi r18, 0x00 ; 0 11592: 30 e0 ldi r19, 0x00 ; 0 11594: a9 01 movw r20, r18 11596: f8 01 movw r30, r16 11598: 6c 2f mov r22, r28 1159a: 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 1159c: 81 11 cpse r24, r1 1159e: 5a c0 rjmp .+180 ; 0x11654 115a0: 8f 2f mov r24, r31 115a2: 90 2f mov r25, r16 115a4: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 115a8: 88 23 and r24, r24 115aa: 09 f4 brne .+2 ; 0x115ae 115ac: 49 c0 rjmp .+146 ; 0x11640 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 115ae: 80 91 04 18 lds r24, 0x1804 ; 0x801804 115b2: 81 11 cpse r24, r1 115b4: 05 c0 rjmp .+10 ; 0x115c0 enquecommand_P(MSG_M83); 115b6: 61 e0 ldi r22, 0x01 ; 1 115b8: 8d e1 ldi r24, 0x1D ; 29 115ba: 9c e6 ldi r25, 0x6C ; 108 115bc: 0e 94 43 89 call 0x11286 ; 0x11286 // 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); 115c0: 0f 93 push r16 115c2: 1f 93 push r17 115c4: df 93 push r29 115c6: cf 93 push r28 115c8: 81 ed ldi r24, 0xD1 ; 209 115ca: 91 e7 ldi r25, 0x71 ; 113 115cc: 9f 93 push r25 115ce: 8f 93 push r24 115d0: 0e 94 e1 89 call 0x113c2 ; 0x113c2 } if(z_move) 115d4: 0f 90 pop r0 115d6: 0f 90 pop r0 115d8: 0f 90 pop r0 115da: 0f 90 pop r0 115dc: 0f 90 pop r0 115de: 0f 90 pop r0 115e0: 20 e0 ldi r18, 0x00 ; 0 115e2: 30 e0 ldi r19, 0x00 ; 0 115e4: a9 01 movw r20, r18 115e6: c7 01 movw r24, r14 115e8: b6 01 movw r22, r12 115ea: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 115ee: 88 23 and r24, r24 115f0: 21 f1 breq .+72 ; 0x1163a { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 115f2: 84 e4 ldi r24, 0x44 ; 68 115f4: 8f 93 push r24 115f6: 88 e4 ldi r24, 0x48 ; 72 115f8: 8f 93 push r24 115fa: 1f 92 push r1 115fc: 1f 92 push r1 115fe: 20 91 a3 02 lds r18, 0x02A3 ; 0x8002a3 11602: 30 91 a4 02 lds r19, 0x02A4 ; 0x8002a4 11606: 40 91 a5 02 lds r20, 0x02A5 ; 0x8002a5 1160a: 50 91 a6 02 lds r21, 0x02A6 ; 0x8002a6 1160e: c7 01 movw r24, r14 11610: b6 01 movw r22, r12 11612: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 11616: 9f 93 push r25 11618: 8f 93 push r24 1161a: 7f 93 push r23 1161c: 6f 93 push r22 1161e: 88 e2 ldi r24, 0x28 ; 40 11620: 9f e7 ldi r25, 0x7F ; 127 11622: 9f 93 push r25 11624: 8f 93 push r24 11626: 0e 94 e1 89 call 0x113c2 ; 0x113c2 1162a: 8d b7 in r24, 0x3d ; 61 1162c: 9e b7 in r25, 0x3e ; 62 1162e: 0a 96 adiw r24, 0x0a ; 10 11630: 0f b6 in r0, 0x3f ; 63 11632: f8 94 cli 11634: 9e bf out 0x3e, r25 ; 62 11636: 0f be out 0x3f, r0 ; 63 11638: 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; 1163a: 81 e0 ldi r24, 0x01 ; 1 1163c: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e // 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(); } } 11640: df 91 pop r29 11642: cf 91 pop r28 11644: 1f 91 pop r17 11646: 0f 91 pop r16 11648: ff 90 pop r15 1164a: ef 90 pop r14 1164c: df 90 pop r13 1164e: cf 90 pop r12 11650: bf 90 pop r11 11652: 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) 11654: 8f 2f mov r24, r31 11656: 90 2f mov r25, r16 11658: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1165c: 88 23 and r24, r24 1165e: 49 f2 breq .-110 ; 0x115f2 11660: a6 cf rjmp .-180 ; 0x115ae 00011662 : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 11662: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 11666: 88 23 and r24, r24 11668: 21 f1 breq .+72 ; 0x116b2 if (backlightMode == BACKLIGHT_MODE_AUTO) 1166a: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1166e: 82 30 cpi r24, 0x02 ; 2 11670: e9 f4 brne .+58 ; 0x116ac { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 11672: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 11676: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 1167a: 28 ee ldi r18, 0xE8 ; 232 1167c: 33 e0 ldi r19, 0x03 ; 3 1167e: 0f 94 a9 de call 0x3bd52 ; 0x3bd52 <__usmulhisi3> 11682: ab 01 movw r20, r22 11684: bc 01 movw r22, r24 11686: 87 e3 ldi r24, 0x37 ; 55 11688: 93 e0 ldi r25, 0x03 ; 3 1168a: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 1168e: 88 23 and r24, r24 11690: 31 f0 breq .+12 ; 0x1169e 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); 11692: 60 91 fa 03 lds r22, 0x03FA ; 0x8003fa else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 11696: 70 e0 ldi r23, 0x00 ; 0 11698: 85 e0 ldi r24, 0x05 ; 5 1169a: 0c 94 8d df jmp 0x1bf1a ; 0x1bf1a 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); 1169e: 80 91 37 03 lds r24, 0x0337 ; 0x800337 116a2: 88 23 and r24, r24 116a4: 31 f0 breq .+12 ; 0x116b2 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); 116a6: 60 91 fb 03 lds r22, 0x03FB ; 0x8003fb 116aa: f5 cf rjmp .-22 ; 0x11696 { 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); 116ac: 81 11 cpse r24, r1 116ae: fb cf rjmp .-10 ; 0x116a6 116b0: f0 cf rjmp .-32 ; 0x11692 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 116b2: 08 95 ret 000116b4 : 116b4: 60 91 fb 03 lds r22, 0x03FB ; 0x8003fb 116b8: 84 e3 ldi r24, 0x34 ; 52 116ba: 9d e0 ldi r25, 0x0D ; 13 116bc: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 116c0: 60 91 fa 03 lds r22, 0x03FA ; 0x8003fa 116c4: 83 e3 ldi r24, 0x33 ; 51 116c6: 9d e0 ldi r25, 0x0D ; 13 116c8: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 116cc: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 116d0: 82 e3 ldi r24, 0x32 ; 50 116d2: 9d e0 ldi r25, 0x0D ; 13 116d4: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 116d8: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 116dc: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 116e0: 80 e3 ldi r24, 0x30 ; 48 116e2: 9d e0 ldi r25, 0x0D ; 13 116e4: 0d 94 cb dd jmp 0x3bb96 ; 0x3bb96 000116e8 : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 116e8: 88 23 and r24, r24 116ea: 61 f0 breq .+24 ; 0x11704 { backlightMode = BACKLIGHT_MODE_BRIGHT; 116ec: 81 e0 ldi r24, 0x01 ; 1 116ee: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < LCD_BACKLIGHT_FORCE_ON) backlightLevel_HIGH = LCD_BACKLIGHT_FORCE_ON; 116f2: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 116f6: 8e 31 cpi r24, 0x1E ; 30 116f8: 18 f4 brcc .+6 ; 0x11700 116fa: 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); 116fc: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb } backlight_update(); 11700: 0c 94 31 8b jmp 0x11662 ; 0x11662 backlightMode = BACKLIGHT_MODE_BRIGHT; if (backlightLevel_HIGH < LCD_BACKLIGHT_FORCE_ON) backlightLevel_HIGH = LCD_BACKLIGHT_FORCE_ON; } else { backlightMode = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_MODE); 11704: 82 e3 ldi r24, 0x32 ; 50 11706: 9d e0 ldi r25, 0x0D ; 13 11708: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1170c: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 11710: 84 e3 ldi r24, 0x34 ; 52 11712: 9d e0 ldi r25, 0x0D ; 13 11714: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 11718: f1 cf rjmp .-30 ; 0x116fc 0001171a : int16_t backlightTimer_period = LCD_BACKLIGHT_TIMEOUT; LongTimer backlightTimer; static void backlightTimer_reset() //used for resetting the timer and waking the display. Triggered on user interactions. { if (!backlightSupport) return; 1171a: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 1171e: 88 23 and r24, r24 11720: 31 f0 breq .+12 ; 0x1172e backlightTimer.start(); 11722: 87 e3 ldi r24, 0x37 ; 55 11724: 93 e0 ldi r25, 0x03 ; 3 11726: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> backlight_update(); 1172a: 0c 94 31 8b jmp 0x11662 ; 0x11662 } 1172e: 08 95 ret 00011730 : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 11730: ff 92 push r15 11732: 0f 93 push r16 11734: 1f 93 push r17 11736: cf 93 push r28 11738: df 93 push r29 if (!backlightSupport) return; 1173a: 90 91 fc 03 lds r25, 0x03FC ; 0x8003fc 1173e: 99 23 and r25, r25 11740: 99 f1 breq .+102 ; 0x117a8 if (flashNo) 11742: 88 23 and r24, r24 11744: 51 f1 breq .+84 ; 0x1179a { uint8_t backlightMode_bck = backlightMode; 11746: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 1174a: c8 2f mov r28, r24 1174c: d0 e0 ldi r29, 0x00 ; 0 1174e: cc 0f add r28, r28 11750: dd 1f adc r29, r29 11752: 10 e0 ldi r17, 0x00 ; 0 11754: ff 24 eor r15, r15 11756: f3 94 inc r15 11758: 21 2f mov r18, r17 1175a: 30 e0 ldi r19, 0x00 ; 0 1175c: 80 91 37 03 lds r24, 0x0337 ; 0x800337 11760: 8f 25 eor r24, r15 11762: 02 30 cpi r16, 0x02 ; 2 11764: 09 f0 breq .+2 ; 0x11768 11766: 80 e0 ldi r24, 0x00 ; 0 11768: 8c 0f add r24, r28 1176a: 9d 2f mov r25, r29 1176c: 91 1d adc r25, r1 1176e: 28 17 cp r18, r24 11770: 39 07 cpc r19, r25 11772: 8c f4 brge .+34 ; 0x11796 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 11774: 81 e0 ldi r24, 0x01 ; 1 11776: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 1177a: 91 11 cpse r25, r1 1177c: 80 e0 ldi r24, 0x00 ; 0 1177e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 11782: 0e 94 31 8b call 0x11662 ; 0x11662 _delay(BL_FLASH_DELAY_MS); 11786: 69 e1 ldi r22, 0x19 ; 25 11788: 70 e0 ldi r23, 0x00 ; 0 1178a: 80 e0 ldi r24, 0x00 ; 0 1178c: 90 e0 ldi r25, 0x00 ; 0 1178e: 0f 94 8a 3d call 0x27b14 ; 0x27b14 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++) 11792: 1f 5f subi r17, 0xFF ; 255 11794: e1 cf rjmp .-62 ; 0x11758 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 11796: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 1179a: df 91 pop r29 1179c: cf 91 pop r28 1179e: 1f 91 pop r17 117a0: 0f 91 pop r16 117a2: ff 90 pop r15 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 117a4: 0c 94 8d 8b jmp 0x1171a ; 0x1171a } 117a8: df 91 pop r29 117aa: cf 91 pop r28 117ac: 1f 91 pop r17 117ae: 0f 91 pop r16 117b0: ff 90 pop r15 117b2: 08 95 ret 000117b4 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 117b4: 0f 93 push r16 117b6: 1f 93 push r17 117b8: cf 93 push r28 117ba: df 93 push r29 117bc: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { 117be: 80 91 86 17 lds r24, 0x1786 ; 0x801786 117c2: 81 30 cpi r24, 0x01 ; 1 117c4: 21 f0 breq .+8 ; 0x117ce 117c6: 82 30 cpi r24, 0x02 ; 2 117c8: 49 f0 breq .+18 ; 0x117dc return checkFilamentEvents(); } break; case State::disabled: case State::error: default: return false; 117ca: c0 e0 ldi r28, 0x00 ; 0 117cc: 4b c0 rjmp .+150 ; 0x11864 } 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. 117ce: 82 e0 ldi r24, 0x02 ; 2 117d0: 80 93 86 17 sts 0x1786, r24 ; 0x801786 // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldFilamentPresent = fsensor.getFilamentPresent(); 117d4: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 117d8: 80 93 89 17 sts 0x1789, r24 ; 0x801789 [[fallthrough]]; case State::ready: { postponedLoadEvent = false; 117dc: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 117e0: 80 91 86 17 lds r24, 0x1786 ; 0x801786 117e4: 82 30 cpi r24, 0x02 ; 2 117e6: 09 f0 breq .+2 ; 0x117ea 117e8: 92 c0 rjmp .+292 ; 0x1190e return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 117ea: 80 91 8b 17 lds r24, 0x178B ; 0x80178b 117ee: 81 11 cpse r24, r1 117f0: cc c0 rjmp .+408 ; 0x1198a return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); 117f2: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 117f6: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { 117f8: 80 91 89 17 lds r24, 0x1789 ; 0x801789 117fc: c8 17 cp r28, r24 117fe: 29 f3 breq .-54 ; 0x117ca oldFilamentPresent = newFilamentPresent; 11800: c0 93 89 17 sts 0x1789, r28 ; 0x801789 eventBlankingTimer.start(); 11804: 8b e8 ldi r24, 0x8B ; 139 11806: 97 e1 ldi r25, 0x17 ; 23 11808: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> if (newFilamentPresent) { // filament insertion 1180c: cc 23 and r28, r28 1180e: 09 f4 brne .+2 ; 0x11812 11810: c5 c0 rjmp .+394 ; 0x1199c } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11812: 80 91 87 17 lds r24, 0x1787 ; 0x801787 11816: 88 23 and r24, r24 11818: 11 f1 breq .+68 ; 0x1185e return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1181a: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 1181e: 81 11 cpse r24, r1 11820: 1e c0 rjmp .+60 ; 0x1185e && !( 11822: 80 91 96 13 lds r24, 0x1396 ; 0x801396 11826: 81 30 cpi r24, 0x01 ; 1 11828: d1 f0 breq .+52 ; 0x1185e } //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); 1182a: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 1182e: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 11832: 89 1b sub r24, r25 11834: 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 11836: 99 f4 brne .+38 ; 0x1185e || printJobOngoing() 11838: 0e 94 3d 68 call 0xd07a ; 0xd07a 1183c: 81 11 cpse r24, r1 1183e: 0f c0 rjmp .+30 ; 0x1185e || (lcd_commands_type == LcdCommands::Layer1Cal) 11840: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 11844: 84 30 cpi r24, 0x04 ; 4 11846: 59 f0 breq .+22 ; 0x1185e || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11848: 8f e5 ldi r24, 0x5F ; 95 1184a: 9f e0 ldi r25, 0x0F ; 15 1184c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11850: 81 11 cpse r24, r1 11852: 05 c0 rjmp .+10 ; 0x1185e || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 11854: 61 e0 ldi r22, 0x01 ; 1 11856: 89 e3 ldi r24, 0x39 ; 57 11858: 9a e3 ldi r25, 0x3A ; 58 1185a: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 1185e: 81 e0 ldi r24, 0x01 ; 1 11860: 80 93 8a 17 sts 0x178A, r24 ; 0x80178a sensorRevision = (SensorRevision)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_PCB); } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { 11864: 80 91 86 17 lds r24, 0x1786 ; 0x801786 11868: 82 30 cpi r24, 0x02 ; 2 1186a: 09 f0 breq .+2 ; 0x1186e 1186c: 4b c0 rjmp .+150 ; 0x11904 return true; } bool IR_sensor_analog::getVoltReady() const { bool ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } 1186e: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11870: f8 94 cli 11872: 80 91 90 17 lds r24, 0x1790 ; 0x801790 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11876: 9f bf out 0x3f, r25 ; 63 } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { if (getVoltReady()) { 11878: 88 23 and r24, r24 1187a: 09 f4 brne .+2 ; 0x1187e 1187c: 43 c0 rjmp .+134 ; 0x11904 ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } return ret; } void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } 1187e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11880: f8 94 cli 11882: 10 92 90 17 sts 0x1790, r1 ; 0x801790 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11886: 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(); 11888: 0f 94 df 7c call 0x2f9be ; 0x2f9be 1188c: 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) { 1188e: 80 91 95 17 lds r24, 0x1795 ; 0x801795 11892: 90 91 96 17 lds r25, 0x1796 ; 0x801796 11896: 80 17 cp r24, r16 11898: 91 07 cpc r25, r17 1189a: 08 f0 brcs .+2 ; 0x1189e 1189c: d7 c0 rjmp .+430 ; 0x11a4c maxVolt = volt; 1189e: 10 93 96 17 sts 0x1796, r17 ; 0x801796 118a2: 00 93 95 17 sts 0x1795, r16 ; 0x801795 //! 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 && 118a6: 80 91 93 17 lds r24, 0x1793 ; 0x801793 118aa: 90 91 94 17 lds r25, 0x1794 ; 0x801794 118ae: 9c 01 movw r18, r24 118b0: 26 5d subi r18, 0xD6 ; 214 118b2: 33 40 sbci r19, 0x03 ; 3 118b4: 29 35 cpi r18, 0x59 ; 89 118b6: 3f 40 sbci r19, 0x0F ; 15 118b8: 08 f0 brcs .+2 ; 0x118bc 118ba: d5 c0 rjmp .+426 ; 0x11a66 118bc: 80 91 95 17 lds r24, 0x1795 ; 0x801795 118c0: 90 91 96 17 lds r25, 0x1796 ; 0x801796 118c4: 8d 55 subi r24, 0x5D ; 93 118c6: 96 42 sbci r25, 0x26 ; 38 118c8: 87 37 cpi r24, 0x77 ; 119 118ca: 94 41 sbci r25, 0x14 ; 20 118cc: 20 f4 brcc .+8 ; 0x118d6 maxVolt <= IRsensor_Hopen_TRESHOLD) { IR_ANALOG_Check(SensorRevision::_Old, SensorRevision::_Rev04); 118ce: 61 e0 ldi r22, 0x01 ; 1 118d0: 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); 118d2: 0f 94 f7 7c call 0x2f9ee ; 0x2f9ee 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) { 118d6: c8 01 movw r24, r16 118d8: 8e 52 subi r24, 0x2E ; 46 118da: 93 41 sbci r25, 0x13 ; 19 118dc: 80 33 cpi r24, 0x30 ; 48 118de: 93 41 sbci r25, 0x13 ; 19 118e0: 08 f0 brcs .+2 ; 0x118e4 118e2: d2 c0 rjmp .+420 ; 0x11a88 /// 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) { 118e4: 80 91 99 17 lds r24, 0x1799 ; 0x801799 118e8: 91 e0 ldi r25, 0x01 ; 1 118ea: 98 0f add r25, r24 118ec: 90 93 99 17 sts 0x1799, r25 ; 0x801799 118f0: 85 30 cpi r24, 0x05 ; 5 118f2: 08 f4 brcc .+2 ; 0x118f6 118f4: cb c0 rjmp .+406 ; 0x11a8c puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); 118f6: 8b e4 ldi r24, 0x4B ; 75 118f8: 9e e7 ldi r25, 0x7E ; 126 voltageErrorCnt = 0; } if (sensorRevision == SensorRevision::_Rev04) { /// newer IR sensor cannot normally produce 4.6-5V, this is considered a failure/bad mount if (IRsensor_Hopen_TRESHOLD <= raw && raw <= IRsensor_VMax_TRESHOLD) { puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected")); 118fa: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 118fe: 83 e0 ldi r24, 0x03 ; 3 11900: 80 93 86 17 sts 0x1786, r24 ; 0x801786 #ifdef FILAMENT_SENSOR if (fsensor.update()) { 11904: cc 23 and r28, r28 11906: 19 f0 breq .+6 ; 0x1190e lcd_draw_update = 1; //cause lcd update so that fsensor event polling can be done from the lcd draw routine. 11908: 81 e0 ldi r24, 0x01 ; 1 1190a: 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) 1190e: 0e 94 8e 68 call 0xd11c ; 0xd11c 11912: 81 11 cpse r24, r1 11914: c9 c0 rjmp .+402 ; 0x11aa8 11916: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 1191a: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 1191e: 00 97 sbiw r24, 0x00 ; 0 11920: 39 f4 brne .+14 ; 0x11930 11922: 20 91 69 0e lds r18, 0x0E69 ; 0x800e69 11926: 30 91 6a 0e lds r19, 0x0E6A ; 0x800e6a 1192a: 23 2b or r18, r19 1192c: 09 f4 brne .+2 ; 0x11930 1192e: bc c0 rjmp .+376 ; 0x11aa8 11930: 40 91 30 02 lds r20, 0x0230 ; 0x800230 11934: 50 91 31 02 lds r21, 0x0231 ; 0x800231 11938: 60 91 32 02 lds r22, 0x0232 ; 0x800232 1193c: 70 91 33 02 lds r23, 0x0233 ; 0x800233 11940: 41 15 cp r20, r1 11942: 51 05 cpc r21, r1 11944: 61 05 cpc r22, r1 11946: 71 05 cpc r23, r1 11948: 09 f4 brne .+2 ; 0x1194c 1194a: ae c0 rjmp .+348 ; 0x11aa8 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 1194c: 89 2b or r24, r25 1194e: 31 f4 brne .+12 ; 0x1195c 11950: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 11954: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a 11958: 89 2b or r24, r25 1195a: 29 f0 breq .+10 ; 0x11966 1195c: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 11960: 88 23 and r24, r24 11962: 09 f4 brne .+2 ; 0x11966 11964: 09 c1 rjmp .+530 ; 0x11b78 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 11966: 89 ed ldi r24, 0xD9 ; 217 11968: 95 e0 ldi r25, 0x05 ; 5 1196a: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 1196e: 88 23 and r24, r24 11970: 09 f4 brne .+2 ; 0x11974 11972: 9c c0 rjmp .+312 ; 0x11aac { disable_heater(); 11974: 0f 94 4f 45 call 0x28a9e ; 0x28a9e lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 11978: 82 e7 ldi r24, 0x72 ; 114 1197a: 96 e3 ldi r25, 0x36 ; 54 1197c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 11980: 0f 94 04 36 call 0x26c08 ; 0x26c08 lcd_return_to_status(); 11984: 0f 94 4b 27 call 0x24e96 ; 0x24e96 11988: 91 c0 rjmp .+290 ; 0x11aac } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 1198a: 64 e6 ldi r22, 0x64 ; 100 1198c: 70 e0 ldi r23, 0x00 ; 0 1198e: 8b e8 ldi r24, 0x8B ; 139 11990: 97 e1 ldi r25, 0x17 ; 23 11992: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 11996: 81 11 cpse r24, r1 11998: 2c cf rjmp .-424 ; 0x117f2 1199a: 17 cf rjmp .-466 ; 0x117ca } } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled 1199c: c0 91 88 17 lds r28, 0x1788 ; 0x801788 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 119a0: cc 23 and r28, r28 119a2: 09 f4 brne .+2 ; 0x119a6 119a4: 4f c0 rjmp .+158 ; 0x11a44 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 119a6: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 119aa: 81 11 cpse r24, r1 119ac: 5b cf rjmp .-330 ; 0x11864 119ae: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 119b2: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 119b6: 89 1b sub r24, r25 119b8: 8f 70 andi r24, 0x0F ; 15 && ( 119ba: 29 f4 brne .+10 ; 0x119c6 moves_planned() != 0 || printJobOngoing() 119bc: 0e 94 3d 68 call 0xd07a ; 0xd07a 119c0: 88 23 and r24, r24 119c2: 09 f4 brne .+2 ; 0x119c6 119c4: 4f cf rjmp .-354 ; 0x11864 ) && !( saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 119c6: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 119ca: 81 11 cpse r24, r1 119cc: 3d c0 rjmp .+122 ; 0x11a48 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 119ce: 80 91 96 13 lds r24, 0x1396 ; 0x801396 119d2: 81 30 cpi r24, 0x01 ; 1 119d4: 09 f4 brne .+2 ; 0x119d8 119d6: 46 cf rjmp .-372 ; 0x11864 || (lcd_commands_type == LcdCommands::Layer1Cal) 119d8: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 119dc: 84 30 cpi r24, 0x04 ; 4 119de: 09 f4 brne .+2 ; 0x119e2 119e0: 41 cf rjmp .-382 ; 0x11864 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 119e2: 8f e5 ldi r24, 0x5F ; 95 119e4: 9f e0 ldi r25, 0x0F ; 15 119e6: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 119ea: 81 11 cpse r24, r1 119ec: 3b cf rjmp .-394 ; 0x11864 } //! @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); 119ee: 86 e1 ldi r24, 0x16 ; 22 119f0: 97 e6 ldi r25, 0x67 ; 103 119f2: 9f 93 push r25 119f4: 8f 93 push r24 119f6: 8c ef ldi r24, 0xFC ; 252 119f8: 96 e6 ldi r25, 0x66 ; 102 119fa: 9f 93 push r25 119fc: 8f 93 push r24 119fe: 0f 94 4b dc call 0x3b896 ; 0x3b896 void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11a02: 10 92 88 17 sts 0x1788, r1 ; 0x801788 autoLoadEnabled = false; 11a06: 10 92 87 17 sts 0x1787, r1 ; 0x801787 stop_and_save_print_to_ram(0, 0); 11a0a: 20 e0 ldi r18, 0x00 ; 0 11a0c: 30 e0 ldi r19, 0x00 ; 0 11a0e: a9 01 movw r20, r18 11a10: ca 01 movw r24, r20 11a12: b9 01 movw r22, r18 11a14: 0e 94 62 8a call 0x114c4 ; 0x114c4 restore_print_from_ram_and_continue(0); 11a18: 60 e0 ldi r22, 0x00 ; 0 11a1a: 70 e0 ldi r23, 0x00 ; 0 11a1c: cb 01 movw r24, r22 11a1e: 0e 94 f1 68 call 0xd1e2 ; 0xd1e2 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11a22: 85 e6 ldi r24, 0x65 ; 101 11a24: 9f e0 ldi r25, 0x0F ; 15 11a26: 0e 94 ab 77 call 0xef56 ; 0xef56 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11a2a: 81 e0 ldi r24, 0x01 ; 1 11a2c: 9f e0 ldi r25, 0x0F ; 15 11a2e: 0e 94 9e 77 call 0xef3c ; 0xef3c enquecommand_front_P(MSG_M600); 11a32: 8e e7 ldi r24, 0x7E ; 126 11a34: 90 e7 ldi r25, 0x70 ; 112 11a36: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 11a3a: 0f 90 pop r0 11a3c: 0f 90 pop r0 11a3e: 0f 90 pop r0 11a40: 0f 90 pop r0 11a42: 10 cf rjmp .-480 ; 0x11864 postponedLoadEvent = true; } else { // filament removal // puts_P(PSTR("filament removed")); triggerFilamentRemoved(); } return true; 11a44: c1 e0 ldi r28, 0x01 ; 1 11a46: 0e cf rjmp .-484 ; 0x11864 11a48: c8 2f mov r28, r24 11a4a: 0c cf rjmp .-488 ; 0x11864 // 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) { 11a4c: 80 91 93 17 lds r24, 0x1793 ; 0x801793 11a50: 90 91 94 17 lds r25, 0x1794 ; 0x801794 11a54: 08 17 cp r16, r24 11a56: 19 07 cpc r17, r25 11a58: 08 f0 brcs .+2 ; 0x11a5c 11a5a: 25 cf rjmp .-438 ; 0x118a6 minVolt = volt; 11a5c: 10 93 94 17 sts 0x1794, r17 ; 0x801794 11a60: 00 93 93 17 sts 0x1793, r16 ; 0x801793 11a64: 20 cf rjmp .-448 ; 0x118a6 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) { 11a66: 86 3d cpi r24, 0xD6 ; 214 11a68: 93 40 sbci r25, 0x03 ; 3 11a6a: 08 f0 brcs .+2 ; 0x11a6e 11a6c: 34 cf rjmp .-408 ; 0x118d6 11a6e: 80 91 95 17 lds r24, 0x1795 ; 0x801795 11a72: 90 91 96 17 lds r25, 0x1796 ; 0x801796 11a76: 84 5d subi r24, 0xD4 ; 212 11a78: 9a 43 sbci r25, 0x3A ; 58 11a7a: 8d 31 cpi r24, 0x1D ; 29 11a7c: 95 40 sbci r25, 0x05 ; 5 11a7e: 08 f0 brcs .+2 ; 0x11a82 11a80: 2a cf rjmp .-428 ; 0x118d6 IR_ANALOG_Check(SensorRevision::_Rev04, SensorRevision::_Old); 11a82: 60 e0 ldi r22, 0x00 ; 0 11a84: 81 e0 ldi r24, 0x01 ; 1 11a86: 25 cf rjmp .-438 ; 0x118d2 if (voltageErrorCnt++ > 4) { puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); return false; } } else { voltageErrorCnt = 0; 11a88: 10 92 99 17 sts 0x1799, r1 ; 0x801799 } if (sensorRevision == SensorRevision::_Rev04) { 11a8c: 80 91 8f 17 lds r24, 0x178F ; 0x80178f 11a90: 81 30 cpi r24, 0x01 ; 1 11a92: 09 f0 breq .+2 ; 0x11a96 11a94: 37 cf rjmp .-402 ; 0x11904 /// 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) { 11a96: 03 5d subi r16, 0xD3 ; 211 11a98: 1a 43 sbci r17, 0x3A ; 58 11a9a: 0e 31 cpi r16, 0x1E ; 30 11a9c: 15 40 sbci r17, 0x05 ; 5 11a9e: 08 f0 brcs .+2 ; 0x11aa2 11aa0: 31 cf rjmp .-414 ; 0x11904 puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected")); 11aa2: 8a e1 ldi r24, 0x1A ; 26 11aa4: 9e e7 ldi r25, 0x7E ; 126 11aa6: 29 cf rjmp .-430 ; 0x118fa inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11aa8: 10 92 d9 05 sts 0x05D9, r1 ; 0x8005d9 #if defined(KILL_PIN) && KILL_PIN > -1 static int killCount = 0; // make the inactivity button a bit less responsive const int KILL_DELAY = 10000; #endif if(buflen < (BUFSIZE-1)){ 11aac: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 11ab0: 90 91 80 10 lds r25, 0x1080 ; 0x801080 11ab4: 03 97 sbiw r24, 0x03 ; 3 11ab6: 14 f4 brge .+4 ; 0x11abc get_command(); 11ab8: 0e 94 43 84 call 0x10886 ; 0x10886 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); 11abc: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 11ac0: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 11ac4: 98 17 cp r25, r24 11ac6: 81 f0 breq .+32 ; 0x11ae8 11ac8: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 11acc: 86 30 cpi r24, 0x06 ; 6 11ace: 61 f4 brne .+24 ; 0x11ae8 11ad0: 68 e8 ldi r22, 0x88 ; 136 11ad2: 73 e1 ldi r23, 0x13 ; 19 11ad4: 8f e0 ldi r24, 0x0F ; 15 11ad6: 95 e0 ldi r25, 0x05 ; 5 11ad8: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 11adc: 88 23 and r24, r24 11ade: 21 f0 breq .+8 ; 0x11ae8 { // 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(); 11ae0: 8f e0 ldi r24, 0x0F ; 15 11ae2: 95 e0 ldi r25, 0x05 ; 5 11ae4: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 11ae8: 40 91 7e 03 lds r20, 0x037E ; 0x80037e 11aec: 50 91 7f 03 lds r21, 0x037F ; 0x80037f 11af0: 60 91 80 03 lds r22, 0x0380 ; 0x800380 11af4: 70 91 81 03 lds r23, 0x0381 ; 0x800381 11af8: 41 15 cp r20, r1 11afa: 51 05 cpc r21, r1 11afc: 61 05 cpc r22, r1 11afe: 71 05 cpc r23, r1 11b00: 09 f0 breq .+2 ; 0x11b04 11b02: 3f c0 rjmp .+126 ; 0x11b82 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 11b04: 40 91 34 02 lds r20, 0x0234 ; 0x800234 11b08: 50 91 35 02 lds r21, 0x0235 ; 0x800235 11b0c: 60 91 36 02 lds r22, 0x0236 ; 0x800236 11b10: 70 91 37 02 lds r23, 0x0237 ; 0x800237 11b14: 41 15 cp r20, r1 11b16: 51 05 cpc r21, r1 11b18: 61 05 cpc r22, r1 11b1a: 71 05 cpc r23, r1 11b1c: a9 f0 breq .+42 ; 0x11b48 11b1e: 86 e8 ldi r24, 0x86 ; 134 11b20: 93 e0 ldi r25, 0x03 ; 3 11b22: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 11b26: 88 23 and r24, r24 11b28: 79 f0 breq .+30 ; 0x11b48 11b2a: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 11b2e: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 if(blocks_queued() == false && ignore_stepper_queue == false) { 11b32: 98 13 cpse r25, r24 11b34: 09 c0 rjmp .+18 ; 0x11b48 11b36: d1 11 cpse r29, r1 11b38: 07 c0 rjmp .+14 ; 0x11b48 disable_x(); 11b3a: 17 9a sbi 0x02, 7 ; 2 11b3c: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_y(); 11b40: 16 9a sbi 0x02, 6 ; 2 11b42: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f disable_z(); disable_e0(); 11b46: 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; 11b48: c0 91 e1 03 lds r28, 0x03E1 ; 0x8003e1 block_t *block; if(block_buffer_tail != block_buffer_head) 11b4c: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 11b50: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 11b54: 98 17 cp r25, r24 11b56: 01 f1 breq .+64 ; 0x11b98 { uint8_t block_index = block_buffer_tail; 11b58: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 tail_fan_speed = block_buffer[block_index].fan_speed; 11b5c: 9e e6 ldi r25, 0x6E ; 110 11b5e: 89 9f mul r24, r25 11b60: f0 01 movw r30, r0 11b62: 11 24 eor r1, r1 11b64: e6 54 subi r30, 0x46 ; 70 11b66: f8 4f sbci r31, 0xF8 ; 248 11b68: c0 81 ld r28, Z while(block_index != block_buffer_head) 11b6a: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 11b6e: 98 17 cp r25, r24 11b70: 99 f0 breq .+38 ; 0x11b98 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); 11b72: 8f 5f subi r24, 0xFF ; 255 11b74: 8f 70 andi r24, 0x0F ; 15 11b76: f9 cf rjmp .-14 ; 0x11b6a { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11b78: 89 ed ldi r24, 0xD9 ; 217 11b7a: 95 e0 ldi r25, 0x05 ; 5 11b7c: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> 11b80: 95 cf rjmp .-214 ; 0x11aac // 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)) 11b82: 86 e8 ldi r24, 0x86 ; 134 11b84: 93 e0 ldi r25, 0x03 ; 3 11b86: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 11b8a: 88 23 and r24, r24 11b8c: 09 f4 brne .+2 ; 0x11b90 11b8e: ba cf rjmp .-140 ; 0x11b04 kill(PSTR("Inactivity Shutdown")); 11b90: 8c e7 ldi r24, 0x7C ; 124 11b92: 9e e7 ldi r25, 0x7E ; 126 11b94: 0e 94 8d 7b call 0xf71a ; 0xf71a 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) { 11b98: cc 23 and r28, r28 11b9a: 09 f4 brne .+2 ; 0x11b9e 11b9c: 9f c0 rjmp .+318 ; 0x11cdc if (fan_kick_end == 0) { 11b9e: 80 91 6c 03 lds r24, 0x036C ; 0x80036c 11ba2: 90 91 6d 03 lds r25, 0x036D ; 0x80036d 11ba6: a0 91 6e 03 lds r26, 0x036E ; 0x80036e 11baa: b0 91 6f 03 lds r27, 0x036F ; 0x80036f 11bae: 89 2b or r24, r25 11bb0: 8a 2b or r24, r26 11bb2: 8b 2b or r24, r27 11bb4: 81 f4 brne .+32 ; 0x11bd6 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11bb6: 0f 94 83 3f call 0x27f06 ; 0x27f06 11bba: 60 5e subi r22, 0xE0 ; 224 11bbc: 7c 4f sbci r23, 0xFC ; 252 11bbe: 8f 4f sbci r24, 0xFF ; 255 11bc0: 9f 4f sbci r25, 0xFF ; 255 11bc2: 60 93 6c 03 sts 0x036C, r22 ; 0x80036c 11bc6: 70 93 6d 03 sts 0x036D, r23 ; 0x80036d 11bca: 80 93 6e 03 sts 0x036E, r24 ; 0x80036e 11bce: 90 93 6f 03 sts 0x036F, r25 ; 0x80036f tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 11bd2: cf ef ldi r28, 0xFF ; 255 11bd4: 0f c0 rjmp .+30 ; 0x11bf4 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()) 11bd6: 0f 94 83 3f call 0x27f06 ; 0x27f06 11bda: 00 91 6c 03 lds r16, 0x036C ; 0x80036c 11bde: 10 91 6d 03 lds r17, 0x036D ; 0x80036d 11be2: 20 91 6e 03 lds r18, 0x036E ; 0x80036e 11be6: 30 91 6f 03 lds r19, 0x036F ; 0x80036f 11bea: 60 17 cp r22, r16 11bec: 71 07 cpc r23, r17 11bee: 82 07 cpc r24, r18 11bf0: 93 07 cpc r25, r19 11bf2: 78 f3 brcs .-34 ; 0x11bd2 } 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 11bf4: 80 91 34 05 lds r24, 0x0534 ; 0x800534 11bf8: 88 23 and r24, r24 11bfa: 09 f4 brne .+2 ; 0x11bfe 11bfc: 78 c0 rjmp .+240 ; 0x11cee fanSpeedBckp = tail_fan_speed; 11bfe: 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) { 11c02: 80 91 0d 05 lds r24, 0x050D ; 0x80050d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> 11c06: 81 11 cpse r24, r1 11c08: 07 c0 rjmp .+14 ; 0x11c18 return; } avoidRecursion = true; 11c0a: 81 e0 ldi r24, 0x01 ; 1 11c0c: 80 93 0d 05 sts 0x050D, r24 ; 0x80050d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> mmu_loop_inner(true); 11c10: 0f 94 26 9a call 0x3344c ; 0x3344c avoidRecursion = false; 11c14: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 11c18: 80 91 d2 05 lds r24, 0x05D2 ; 0x8005d2 <_ZL26lcd_backlight_wake_trigger.lto_priv.559> 11c1c: 88 23 and r24, r24 11c1e: e1 f1 breq .+120 ; 0x11c98 lcd_backlight_wake_trigger = false; 11c20: 10 92 d2 05 sts 0x05D2, r1 ; 0x8005d2 <_ZL26lcd_backlight_wake_trigger.lto_priv.559> backlight_wake(); 11c24: 80 e0 ldi r24, 0x00 ; 0 11c26: 0e 94 98 8b call 0x11730 ; 0x11730 bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 11c2a: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11c2c: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11c2e: 80 91 d0 05 lds r24, 0x05D0 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.560> 11c32: 28 2f mov r18, r24 11c34: 08 2e mov r0, r24 11c36: 00 0c add r0, r0 11c38: 33 0b sbc r19, r19 11c3a: 37 ff sbrs r19, 7 11c3c: 03 c0 rjmp .+6 ; 0x11c44 11c3e: 31 95 neg r19 11c40: 21 95 neg r18 11c42: 31 09 sbc r19, r1 11c44: 24 30 cpi r18, 0x04 ; 4 11c46: 31 05 cpc r19, r1 11c48: 0c f4 brge .+2 ; 0x11c4c 11c4a: 54 c0 rjmp .+168 ; 0x11cf4 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11c4c: 98 2f mov r25, r24 11c4e: 87 ff sbrs r24, 7 11c50: 02 c0 rjmp .+4 ; 0x11c56 11c52: 93 e0 ldi r25, 0x03 ; 3 11c54: 98 0f add r25, r24 11c56: 95 95 asr r25 11c58: 95 95 asr r25 11c5a: 20 91 35 05 lds r18, 0x0535 ; 0x800535 11c5e: 30 91 36 05 lds r19, 0x0536 ; 0x800536 11c62: 29 0f add r18, r25 11c64: 31 1d adc r19, r1 11c66: 97 fd sbrc r25, 7 11c68: 3a 95 dec r19 11c6a: 30 93 36 05 sts 0x0536, r19 ; 0x800536 11c6e: 20 93 35 05 sts 0x0535, r18 ; 0x800535 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 11c72: 83 78 andi r24, 0x83 ; 131 11c74: 87 ff sbrs r24, 7 11c76: 03 c0 rjmp .+6 ; 0x11c7e 11c78: 81 50 subi r24, 0x01 ; 1 11c7a: 8c 6f ori r24, 0xFC ; 252 11c7c: 8f 5f subi r24, 0xFF ; 255 11c7e: 80 93 d0 05 sts 0x05D0, r24 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.560> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11c82: 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); 11c84: 86 e0 ldi r24, 0x06 ; 6 11c86: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee if (lcd_draw_update == 0) { 11c8a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11c8e: 81 11 cpse r24, r1 11c90: 03 c0 rjmp .+6 ; 0x11c98 // Update LCD rendering at minimum lcd_draw_update = 1; 11c92: 81 e0 ldi r24, 0x01 ; 1 11c94: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11c98: 0e 94 31 8b call 0x11662 ; 0x11662 // handle longpress if(lcd_longpress_trigger) 11c9c: 80 91 d3 05 lds r24, 0x05D3 ; 0x8005d3 11ca0: 88 23 and r24, r24 11ca2: 61 f0 breq .+24 ; 0x11cbc { lcd_consume_click(); // Reset trigger to prevent recursion 11ca4: 0e 94 a5 71 call 0xe34a ; 0xe34a // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11ca8: e0 91 0f 04 lds r30, 0x040F ; 0x80040f 11cac: f0 91 10 04 lds r31, 0x0410 ; 0x800410 11cb0: 30 97 sbiw r30, 0x00 ; 0 11cb2: 21 f0 breq .+8 ; 0x11cbc 11cb4: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 11cb8: 81 11 cpse r24, r1 { lcd_longpress_func(); 11cba: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 11cbc: 0e 94 db 7a call 0xf5b6 ; 0xf5b6 #endif //AUTO_REPORT host_keepalive(); 11cc0: 0e 94 2a 81 call 0x10254 ; 0x10254 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 11cc4: 40 e3 ldi r20, 0x30 ; 48 11cc6: 55 e7 ldi r21, 0x75 ; 117 11cc8: 60 e0 ldi r22, 0x00 ; 0 11cca: 70 e0 ldi r23, 0x00 ; 0 11ccc: 8c e9 ldi r24, 0x9C ; 156 11cce: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 11cd0: df 91 pop r29 11cd2: cf 91 pop r28 11cd4: 1f 91 pop r17 11cd6: 0f 91 pop r16 11cd8: 0d 94 67 40 jmp 0x280ce ; 0x280ce ::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; 11cdc: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c 11ce0: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d 11ce4: 10 92 6e 03 sts 0x036E, r1 ; 0x80036e 11ce8: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 11cec: 83 cf rjmp .-250 ; 0x11bf4 #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; 11cee: c0 93 9e 04 sts 0x049E, r28 ; 0x80049e 11cf2: 87 cf rjmp .-242 ; 0x11c02 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; 11cf4: 10 92 d0 05 sts 0x05D0, r1 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.560> 11cf8: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 11cfa: 80 e0 ldi r24, 0x00 ; 0 11cfc: c4 cf rjmp .-120 ; 0x11c86 00011cfe : #endif #endif } void delay_keep_alive(unsigned int ms) { 11cfe: cf 93 push r28 11d00: df 93 push r29 11d02: ec 01 movw r28, r24 for (;;) { manage_heater(); 11d04: 0f 94 98 4e call 0x29d30 ; 0x29d30 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11d08: 81 e0 ldi r24, 0x01 ; 1 11d0a: 0e 94 da 8b call 0x117b4 ; 0x117b4 lcd_update(0); 11d0e: 80 e0 ldi r24, 0x00 ; 0 11d10: 0e 94 54 6f call 0xdea8 ; 0xdea8 if (ms == 0) 11d14: 20 97 sbiw r28, 0x00 ; 0 11d16: 99 f0 breq .+38 ; 0x11d3e break; else if (ms >= 50) { 11d18: c2 33 cpi r28, 0x32 ; 50 11d1a: d1 05 cpc r29, r1 11d1c: 40 f0 brcs .+16 ; 0x11d2e _delay(50); 11d1e: 62 e3 ldi r22, 0x32 ; 50 11d20: 70 e0 ldi r23, 0x00 ; 0 11d22: 80 e0 ldi r24, 0x00 ; 0 11d24: 90 e0 ldi r25, 0x00 ; 0 11d26: 0f 94 8a 3d call 0x27b14 ; 0x27b14 ms -= 50; 11d2a: e2 97 sbiw r28, 0x32 ; 50 11d2c: eb cf rjmp .-42 ; 0x11d04 } else { _delay(ms); 11d2e: be 01 movw r22, r28 11d30: 90 e0 ldi r25, 0x00 ; 0 11d32: 80 e0 ldi r24, 0x00 ; 0 11d34: 0f 94 8a 3d call 0x27b14 ; 0x27b14 ms = 0; 11d38: d0 e0 ldi r29, 0x00 ; 0 11d3a: c0 e0 ldi r28, 0x00 ; 0 11d3c: e3 cf rjmp .-58 ; 0x11d04 } } } 11d3e: df 91 pop r29 11d40: cf 91 pop r28 11d42: 08 95 ret 00011d44 : /// @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) { 11d44: cf 93 push r28 11d46: df 93 push r29 11d48: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11d4a: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11d4c: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 11d50: 81 e0 ldi r24, 0x01 ; 1 11d52: 0e 94 da 8b call 0x117b4 ; 0x117b4 11d56: 80 91 94 13 lds r24, 0x1394 ; 0x801394 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11d5a: 8f 3f cpi r24, 0xFF ; 255 11d5c: d9 f4 brne .+54 ; 0x11d94 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11d5e: 80 91 29 13 lds r24, 0x1329 ; 0x801329 11d62: 84 30 cpi r24, 0x04 ; 4 11d64: 21 f4 brne .+8 ; 0x11d6e }; 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 11d66: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 11d6a: 81 11 cpse r24, r1 11d6c: ef cf rjmp .-34 ; 0x11d4c 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 11d6e: 80 91 67 13 lds r24, 0x1367 ; 0x801367 11d72: 90 91 68 13 lds r25, 0x1368 ; 0x801368 11d76: 01 97 sbiw r24, 0x01 ; 1 11d78: 49 f7 brne .-46 ; 0x11d4c && lastErrorCode != ec) // The error code is not a duplicate 11d7a: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 11d7e: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 11d82: 89 32 cpi r24, 0x29 ; 41 11d84: 90 48 sbci r25, 0x80 ; 128 11d86: 11 f3 breq .-60 ; 0x11d4c { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11d88: 60 e0 ldi r22, 0x00 ; 0 11d8a: 89 e2 ldi r24, 0x29 ; 41 11d8c: 90 e8 ldi r25, 0x80 ; 128 11d8e: 0f 94 9c 83 call 0x30738 ; 0x30738 11d92: dc cf rjmp .-72 ; 0x11d4c inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11d94: d0 93 94 13 sts 0x1394, r29 ; 0x801394 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11d98: 85 30 cpi r24, 0x05 ; 5 11d9a: 39 f4 brne .+14 ; 0x11daa if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11d9c: cf 3f cpi r28, 0xFF ; 255 11d9e: f9 f2 breq .-66 ; 0x11d5e MMU2::mmu2.eject_filament(eject_slot, true); 11da0: 61 e0 ldi r22, 0x01 ; 1 11da2: 8c 2f mov r24, r28 11da4: 0f 94 c0 a0 call 0x34180 ; 0x34180 11da8: d1 cf rjmp .-94 ; 0x11d4c // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11daa: 84 30 cpi r24, 0x04 ; 4 11dac: c1 f6 brne .-80 ; 0x11d5e } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11dae: df 91 pop r29 11db0: cf 91 pop r28 11db2: 08 95 ret 00011db4 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 11db4: 1f 92 push r1 11db6: 0f 92 push r0 11db8: 0f b6 in r0, 0x3f ; 63 11dba: 0f 92 push r0 11dbc: 11 24 eor r1, r1 11dbe: 0b b6 in r0, 0x3b ; 59 11dc0: 0f 92 push r0 11dc2: 2f 93 push r18 11dc4: 3f 93 push r19 11dc6: 4f 93 push r20 11dc8: 5f 93 push r21 11dca: 6f 93 push r22 11dcc: 7f 93 push r23 11dce: 8f 93 push r24 11dd0: 9f 93 push r25 11dd2: af 93 push r26 11dd4: bf 93 push r27 11dd6: ef 93 push r30 11dd8: ff 93 push r31 adc_values[adc_channel] += ADC; 11dda: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 11dde: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 11de2: e0 91 36 03 lds r30, 0x0336 ; 0x800336 11de6: f0 e0 ldi r31, 0x00 ; 0 11de8: ee 0f add r30, r30 11dea: ff 1f adc r31, r31 11dec: ea 5d subi r30, 0xDA ; 218 11dee: fc 4f sbci r31, 0xFC ; 252 11df0: 80 81 ld r24, Z 11df2: 91 81 ldd r25, Z+1 ; 0x01 11df4: 82 0f add r24, r18 11df6: 93 1f adc r25, r19 11df8: 91 83 std Z+1, r25 ; 0x01 11dfa: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 11dfc: 80 91 25 03 lds r24, 0x0325 ; 0x800325 11e00: 8f 5f subi r24, 0xFF ; 255 11e02: 80 93 25 03 sts 0x0325, r24 ; 0x800325 11e06: 80 31 cpi r24, 0x10 ; 16 11e08: 09 f0 breq .+2 ; 0x11e0c <__vector_29+0x58> 11e0a: 60 c0 rjmp .+192 ; 0x11ecc <__vector_29+0x118> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 11e0c: 80 91 36 03 lds r24, 0x0336 ; 0x800336 11e10: 8f 5f subi r24, 0xFF ; 255 11e12: 80 93 36 03 sts 0x0336, r24 ; 0x800336 11e16: 88 30 cpi r24, 0x08 ; 8 11e18: 09 f0 breq .+2 ; 0x11e1c <__vector_29+0x68> 11e1a: 50 c0 rjmp .+160 ; 0x11ebc <__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 11e1c: 80 91 26 03 lds r24, 0x0326 ; 0x800326 11e20: 90 91 27 03 lds r25, 0x0327 ; 0x800327 11e24: 90 93 07 06 sts 0x0607, r25 ; 0x800607 11e28: 80 93 06 06 sts 0x0606, r24 ; 0x800606 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11e2c: 80 91 2a 03 lds r24, 0x032A ; 0x80032a 11e30: 90 91 2b 03 lds r25, 0x032B ; 0x80032b 11e34: 90 93 05 06 sts 0x0605, r25 ; 0x800605 11e38: 80 93 04 06 sts 0x0604, r24 ; 0x800604 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11e3c: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11e40: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11e44: 90 93 03 06 sts 0x0603, r25 ; 0x800603 11e48: 80 93 02 06 sts 0x0602, r24 ; 0x800602 #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR current_temperature_raw_ambient = adc_values[ADC_PIN_IDX(TEMP_AMBIENT_PIN)]; // 5->6 11e4c: 80 91 30 03 lds r24, 0x0330 ; 0x800330 11e50: 90 91 31 03 lds r25, 0x0331 ; 0x800331 11e54: 90 93 11 06 sts 0x0611, r25 ; 0x800611 11e58: 80 93 10 06 sts 0x0610, r24 ; 0x800610 #endif //AMBIENT_THERMISTOR #ifdef VOLT_PWR_PIN current_voltage_raw_pwr = adc_values[ADC_PIN_IDX(VOLT_PWR_PIN)]; 11e5c: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11e60: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11e64: 90 93 58 06 sts 0x0658, r25 ; 0x800658 11e68: 80 93 57 06 sts 0x0657, r24 ; 0x800657 #endif #ifdef VOLT_BED_PIN current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 11e6c: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11e70: 90 91 35 03 lds r25, 0x0335 ; 0x800335 11e74: 90 93 56 06 sts 0x0656, r25 ; 0x800656 11e78: 80 93 55 06 sts 0x0655, r24 ; 0x800655 #endif #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) fsensor.voltUpdate(adc_values[ADC_PIN_IDX(VOLT_IR_PIN)]); 11e7c: 80 91 32 03 lds r24, 0x0332 ; 0x800332 11e80: 90 91 33 03 lds r25, 0x0333 ; 0x800333 return event; } void IR_sensor_analog::voltUpdate(uint16_t raw) { // to be called from the ADC ISR when a cycle is finished voltRaw = raw; 11e84: 90 93 92 17 sts 0x1792, r25 ; 0x801792 11e88: 80 93 91 17 sts 0x1791, r24 ; 0x801791 voltReady = true; 11e8c: 81 e0 ldi r24, 0x01 ; 1 11e8e: 80 93 90 17 sts 0x1790, r24 ; 0x801790 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) adc_values_ready = true; 11e92: 80 93 1d 05 sts 0x051D, r24 ; 0x80051d <_ZL16adc_values_ready.lto_priv.472> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11e96: ff 91 pop r31 11e98: ef 91 pop r30 11e9a: bf 91 pop r27 11e9c: af 91 pop r26 11e9e: 9f 91 pop r25 11ea0: 8f 91 pop r24 11ea2: 7f 91 pop r23 11ea4: 6f 91 pop r22 11ea6: 5f 91 pop r21 11ea8: 4f 91 pop r20 11eaa: 3f 91 pop r19 11eac: 2f 91 pop r18 11eae: 0f 90 pop r0 11eb0: 0b be out 0x3b, r0 ; 59 11eb2: 0f 90 pop r0 11eb4: 0f be out 0x3f, r0 ; 63 11eb6: 0f 90 pop r0 11eb8: 1f 90 pop r1 11eba: 18 95 reti 11ebc: 80 91 24 03 lds r24, 0x0324 ; 0x800324 <__data_end> return; // do not start the next measurement since there are no channels remaining } // find the next channel while (++adc_channel_idx) { if (ADC_CHAN_MSK & (1 << adc_channel_idx)) { 11ec0: 4f e5 ldi r20, 0x5F ; 95 11ec2: 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) { 11ec4: 8f 5f subi r24, 0xFF ; 255 11ec6: 41 f4 brne .+16 ; 0x11ed8 <__vector_29+0x124> 11ec8: 10 92 24 03 sts 0x0324, r1 ; 0x800324 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11ecc: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11ed0: 80 64 ori r24, 0x40 ; 64 11ed2: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11ed6: df cf rjmp .-66 ; 0x11e96 <__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)) { 11ed8: 9a 01 movw r18, r20 11eda: 08 2e mov r0, r24 11edc: 02 c0 rjmp .+4 ; 0x11ee2 <__vector_29+0x12e> 11ede: 35 95 asr r19 11ee0: 27 95 ror r18 11ee2: 0a 94 dec r0 11ee4: e2 f7 brpl .-8 ; 0x11ede <__vector_29+0x12a> 11ee6: 20 ff sbrs r18, 0 11ee8: ed cf rjmp .-38 ; 0x11ec4 <__vector_29+0x110> 11eea: 80 93 24 03 sts 0x0324, r24 ; 0x800324 <__data_end> adc_setmux(adc_channel_idx); 11eee: 0e 94 f1 5b call 0xb7e2 ; 0xb7e2 adc_count = 0; 11ef2: 10 92 25 03 sts 0x0325, r1 ; 0x800325 11ef6: ea cf rjmp .-44 ; 0x11ecc <__vector_29+0x118> 00011ef8 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 11ef8: cf 93 push r28 11efa: 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 11efc: ca e7 ldi r28, 0x7A ; 122 11efe: d0 e0 ldi r29, 0x00 ; 0 11f00: 88 81 ld r24, Y 11f02: 8f 7b andi r24, 0xBF ; 191 11f04: 88 83 st Y, r24 adc_count = 0; 11f06: 10 92 25 03 sts 0x0325, r1 ; 0x800325 adc_channel = 0; 11f0a: 10 92 36 03 sts 0x0336, r1 ; 0x800336 adc_channel_idx = first_channel_idx; 11f0e: 10 92 24 03 sts 0x0324, r1 ; 0x800324 <__data_end> adc_setmux(adc_channel_idx); 11f12: 80 e0 ldi r24, 0x00 ; 0 11f14: 0e 94 f1 5b call 0xb7e2 ; 0xb7e2 memset((void*)adc_values, 0, sizeof(adc_values)); 11f18: e6 e2 ldi r30, 0x26 ; 38 11f1a: f3 e0 ldi r31, 0x03 ; 3 11f1c: 80 e1 ldi r24, 0x10 ; 16 11f1e: df 01 movw r26, r30 11f20: 1d 92 st X+, r1 11f22: 8a 95 dec r24 11f24: e9 f7 brne .-6 ; 0x11f20 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 11f26: 88 81 ld r24, Y 11f28: 80 64 ori r24, 0x40 ; 64 11f2a: 88 83 st Y, r24 } 11f2c: df 91 pop r29 11f2e: cf 91 pop r28 11f30: 08 95 ret 00011f32 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 11f32: 2f 92 push r2 11f34: 3f 92 push r3 11f36: 4f 92 push r4 11f38: 5f 92 push r5 11f3a: 6f 92 push r6 11f3c: 7f 92 push r7 11f3e: 8f 92 push r8 11f40: 9f 92 push r9 11f42: af 92 push r10 11f44: bf 92 push r11 11f46: cf 92 push r12 11f48: df 92 push r13 11f4a: ef 92 push r14 11f4c: ff 92 push r15 11f4e: 0f 93 push r16 11f50: 1f 93 push r17 11f52: cf 93 push r28 11f54: df 93 push r29 11f56: cd b7 in r28, 0x3d ; 61 11f58: de b7 in r29, 0x3e ; 62 11f5a: a4 97 sbiw r28, 0x24 ; 36 11f5c: 0f b6 in r0, 0x3f ; 63 11f5e: f8 94 cli 11f60: de bf out 0x3e, r29 ; 62 11f62: 0f be out 0x3f, r0 ; 63 11f64: 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(); 11f66: 0f 94 24 59 call 0x2b248 ; 0x2b248 if (planner_aborted) 11f6a: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 11f6e: 81 11 cpse r24, r1 11f70: 17 c0 rjmp .+46 ; 0x11fa0 return; mesh_bed_leveling_flag = true; 11f72: 81 e0 ldi r24, 0x01 ; 1 11f74: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { 11f78: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 11f7c: 88 23 and r24, r24 11f7e: 49 f0 breq .+18 ; 0x11f92 11f80: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 11f84: 88 23 and r24, r24 11f86: 29 f0 breq .+10 ; 0x11f92 11f88: 20 91 40 07 lds r18, 0x0740 ; 0x800740 11f8c: 2f 83 std Y+7, r18 ; 0x07 11f8e: 21 11 cpse r18, r1 11f90: 20 c0 rjmp .+64 ; 0x11fd2 11f92: 81 e0 ldi r24, 0x01 ; 1 11f94: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e // 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); 11f98: 81 e2 ldi r24, 0x21 ; 33 11f9a: 9c e6 ldi r25, 0x6C ; 108 11f9c: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 11fa0: a4 96 adiw r28, 0x24 ; 36 11fa2: 0f b6 in r0, 0x3f ; 63 11fa4: f8 94 cli 11fa6: de bf out 0x3e, r29 ; 62 11fa8: 0f be out 0x3f, r0 ; 63 11faa: cd bf out 0x3d, r28 ; 61 11fac: df 91 pop r29 11fae: cf 91 pop r28 11fb0: 1f 91 pop r17 11fb2: 0f 91 pop r16 11fb4: ff 90 pop r15 11fb6: ef 90 pop r14 11fb8: df 90 pop r13 11fba: cf 90 pop r12 11fbc: bf 90 pop r11 11fbe: af 90 pop r10 11fc0: 9f 90 pop r9 11fc2: 8f 90 pop r8 11fc4: 7f 90 pop r7 11fc6: 6f 90 pop r6 11fc8: 5f 90 pop r5 11fca: 4f 90 pop r4 11fcc: 3f 90 pop r3 11fce: 2f 90 pop r2 11fd0: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 11fd2: 8b ea ldi r24, 0xAB ; 171 11fd4: 9d e0 ldi r25, 0x0D ; 13 11fd6: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 11fda: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 11fdc: 8e e4 ldi r24, 0x4E ; 78 11fde: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 11fe2: 08 2f mov r16, r24 11fe4: 0e 94 06 5c call 0xb80c ; 0xb80c 11fe8: 8e 83 std Y+6, r24 ; 0x06 11fea: 00 23 and r16, r16 11fec: 29 f0 breq .+10 ; 0x11ff8 11fee: 87 30 cpi r24, 0x07 ; 7 11ff0: 09 f4 brne .+2 ; 0x11ff4 11ff2: c9 c0 rjmp .+402 ; 0x12186 11ff4: 83 30 cpi r24, 0x03 ; 3 11ff6: 29 f0 breq .+10 ; 0x12002 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; 11ff8: 13 30 cpi r17, 0x03 ; 3 11ffa: 09 f0 breq .+2 ; 0x11ffe 11ffc: c3 c0 rjmp .+390 ; 0x12184 11ffe: 63 e0 ldi r22, 0x03 ; 3 12000: 6e 83 std Y+6, r22 ; 0x06 12002: 80 e0 ldi r24, 0x00 ; 0 12004: 90 e0 ldi r25, 0x00 ; 0 12006: a0 e8 ldi r26, 0x80 ; 128 12008: bf e3 ldi r27, 0x3F ; 63 1200a: 8a 83 std Y+2, r24 ; 0x02 1200c: 9b 83 std Y+3, r25 ; 0x03 1200e: ac 83 std Y+4, r26 ; 0x04 12010: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 12012: 8a ea ldi r24, 0xAA ; 170 12014: 9d e0 ldi r25, 0x0D ; 13 12016: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1201a: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 1201c: 83 e4 ldi r24, 0x43 ; 67 1201e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 12022: 18 2f mov r17, r24 12024: 0e 94 06 5c call 0xb80c ; 0xb80c 12028: 11 23 and r17, r17 1202a: 29 f0 breq .+10 ; 0x12036 1202c: 88 23 and r24, r24 1202e: 19 f0 breq .+6 ; 0x12036 12030: 8b 30 cpi r24, 0x0B ; 11 12032: 08 f4 brcc .+2 ; 0x12036 12034: 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; 12036: 88 e5 ldi r24, 0x58 ; 88 12038: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1203c: 88 23 and r24, r24 1203e: 09 f4 brne .+2 ; 0x12042 12040: ab c0 rjmp .+342 ; 0x12198 12042: 0e 94 4a 61 call 0xc294 ; 0xc294 12046: 20 e0 ldi r18, 0x00 ; 0 12048: 30 e0 ldi r19, 0x00 ; 0 1204a: 48 e0 ldi r20, 0x08 ; 8 1204c: 52 e4 ldi r21, 0x42 ; 66 1204e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 12052: 20 e0 ldi r18, 0x00 ; 0 12054: 30 e0 ldi r19, 0x00 ; 0 12056: 48 eb ldi r20, 0xB8 ; 184 12058: 51 e4 ldi r21, 0x41 ; 65 1205a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1205e: 6a 87 std Y+10, r22 ; 0x0a 12060: 7b 87 std Y+11, r23 ; 0x0b 12062: 8c 87 std Y+12, r24 ; 0x0c 12064: 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; 12066: 89 e5 ldi r24, 0x59 ; 89 12068: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1206c: 88 23 and r24, r24 1206e: 09 f4 brne .+2 ; 0x12072 12070: 9c c0 rjmp .+312 ; 0x121aa 12072: 0e 94 4a 61 call 0xc294 ; 0xc294 12076: 20 e0 ldi r18, 0x00 ; 0 12078: 30 e0 ldi r19, 0x00 ; 0 1207a: 48 e0 ldi r20, 0x08 ; 8 1207c: 52 e4 ldi r21, 0x42 ; 66 1207e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 12082: 20 e0 ldi r18, 0x00 ; 0 12084: 30 e0 ldi r19, 0x00 ; 0 12086: 40 ea ldi r20, 0xA0 ; 160 12088: 50 e4 ldi r21, 0x40 ; 64 1208a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1208e: 6c 8b std Y+20, r22 ; 0x14 12090: 7d 8b std Y+21, r23 ; 0x15 12092: 8e 8b std Y+22, r24 ; 0x16 12094: 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; 12096: 87 e5 ldi r24, 0x57 ; 87 12098: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1209c: 88 23 and r24, r24 1209e: 09 f4 brne .+2 ; 0x120a2 120a0: 89 c0 rjmp .+274 ; 0x121b4 120a2: 0e 94 4a 61 call 0xc294 ; 0xc294 120a6: 2a 85 ldd r18, Y+10 ; 0x0a 120a8: 3b 85 ldd r19, Y+11 ; 0x0b 120aa: 4c 85 ldd r20, Y+12 ; 0x0c 120ac: 5d 85 ldd r21, Y+13 ; 0x0d 120ae: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 120b2: 20 e0 ldi r18, 0x00 ; 0 120b4: 30 e0 ldi r19, 0x00 ; 0 120b6: 48 e8 ldi r20, 0x88 ; 136 120b8: 52 e4 ldi r21, 0x42 ; 66 120ba: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 120be: 69 8f std Y+25, r22 ; 0x19 120c0: 7a 8f std Y+26, r23 ; 0x1a 120c2: 8b 8f std Y+27, r24 ; 0x1b 120c4: 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; 120c6: 88 e4 ldi r24, 0x48 ; 72 120c8: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 120cc: 88 23 and r24, r24 120ce: 09 f4 brne .+2 ; 0x120d2 120d0: 7a c0 rjmp .+244 ; 0x121c6 120d2: 0e 94 4a 61 call 0xc294 ; 0xc294 120d6: 2c 89 ldd r18, Y+20 ; 0x14 120d8: 3d 89 ldd r19, Y+21 ; 0x15 120da: 4e 89 ldd r20, Y+22 ; 0x16 120dc: 5f 89 ldd r21, Y+23 ; 0x17 120de: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 120e2: 20 e0 ldi r18, 0x00 ; 0 120e4: 30 e0 ldi r19, 0x00 ; 0 120e6: 48 e8 ldi r20, 0x88 ; 136 120e8: 52 e4 ldi r21, 0x42 ; 66 120ea: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 120ee: 6d 8f std Y+29, r22 ; 0x1d 120f0: 7e 8f std Y+30, r23 ; 0x1e 120f2: 8f 8f std Y+31, r24 ; 0x1f 120f4: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 120f6: 0f 94 17 8c call 0x3182e ; 0x3182e mbl.z_values[0][0] = min_pos[Z_AXIS]; 120fa: 80 91 29 02 lds r24, 0x0229 ; 0x800229 120fe: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 12102: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 12106: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 1210a: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f 1210e: 90 93 a0 13 sts 0x13A0, r25 ; 0x8013a0 12112: a0 93 a1 13 sts 0x13A1, r26 ; 0x8013a1 12116: b0 93 a2 13 sts 0x13A2, r27 ; 0x8013a2 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 1211a: 0f 94 4d c7 call 0x38e9a ; 0x38e9a 1211e: 05 ec ldi r16, 0xC5 ; 197 12120: 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) 12122: c8 01 movw r24, r16 12124: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 12128: 01 96 adiw r24, 0x01 ; 1 1212a: 09 f0 breq .+2 ; 0x1212e 1212c: 51 c0 rjmp .+162 ; 0x121d0 1212e: 0e 5f subi r16, 0xFE ; 254 12130: 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) { 12132: 05 3d cpi r16, 0xD5 ; 213 12134: 8f e0 ldi r24, 0x0F ; 15 12136: 18 07 cpc r17, r24 12138: a1 f7 brne .-24 ; 0x12122 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 1213a: 21 2c mov r2, r1 1213c: ae e9 ldi r26, 0x9E ; 158 1213e: b3 e1 ldi r27, 0x13 ; 19 12140: ba a3 std Y+34, r27 ; 0x22 12142: 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; 12144: b9 87 std Y+9, r27 ; 0x09 12146: a8 87 std Y+8, r26 ; 0x08 12148: 51 2c mov r5, r1 1214a: 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; 1214c: 31 2c mov r3, r1 1214e: 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)); 12150: 84 2d mov r24, r4 12152: 63 e0 ldi r22, 0x03 ; 3 12154: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__udivmodqi4> 12158: 98 8b std Y+16, r25 ; 0x10 1215a: 68 84 ldd r6, Y+8 ; 0x08 1215c: 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++) { 1215e: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 12160: f8 89 ldd r31, Y+16 ; 0x10 12162: f1 11 cpse r31, r1 12164: 37 c0 rjmp .+110 ; 0x121d4 12166: 81 2f mov r24, r17 12168: 63 e0 ldi r22, 0x03 ; 3 1216a: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__udivmodqi4> 1216e: 91 11 cpse r25, r1 12170: 31 c0 rjmp .+98 ; 0x121d4 if (isOn3x3Mesh) { if (has_z && (row || col)) { 12172: 21 10 cpse r2, r1 12174: 3f c1 rjmp .+638 ; 0x123f4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 12176: 7e 81 ldd r23, Y+6 ; 0x06 12178: 73 30 cpi r23, 0x03 ; 3 1217a: 09 f4 brne .+2 ; 0x1217e 1217c: 70 c0 rjmp .+224 ; 0x1225e 1217e: 8f 81 ldd r24, Y+7 ; 0x07 12180: 8e 87 std Y+14, r24 ; 0x0e 12182: 37 c0 rjmp .+110 ; 0x121f2 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; 12184: 1e 83 std Y+6, r17 ; 0x06 12186: 6a e9 ldi r22, 0x9A ; 154 12188: 79 e9 ldi r23, 0x99 ; 153 1218a: 89 e1 ldi r24, 0x19 ; 25 1218c: 9f e3 ldi r25, 0x3F ; 63 1218e: 6a 83 std Y+2, r22 ; 0x02 12190: 7b 83 std Y+3, r23 ; 0x03 12192: 8c 83 std Y+4, r24 ; 0x04 12194: 9d 83 std Y+5, r25 ; 0x05 12196: 3d cf rjmp .-390 ; 0x12012 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; 12198: 80 e0 ldi r24, 0x00 ; 0 1219a: 90 e0 ldi r25, 0x00 ; 0 1219c: a0 e8 ldi r26, 0x80 ; 128 1219e: bf ef ldi r27, 0xFF ; 255 121a0: 8a 87 std Y+10, r24 ; 0x0a 121a2: 9b 87 std Y+11, r25 ; 0x0b 121a4: ac 87 std Y+12, r26 ; 0x0c 121a6: bd 87 std Y+13, r27 ; 0x0d 121a8: 5e cf rjmp .-324 ; 0x12066 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 121aa: 60 e0 ldi r22, 0x00 ; 0 121ac: 70 e0 ldi r23, 0x00 ; 0 121ae: 80 e8 ldi r24, 0x80 ; 128 121b0: 9f ef ldi r25, 0xFF ; 255 121b2: 6d cf rjmp .-294 ; 0x1208e const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 121b4: 80 e0 ldi r24, 0x00 ; 0 121b6: 90 e0 ldi r25, 0x00 ; 0 121b8: a0 e8 ldi r26, 0x80 ; 128 121ba: bf e7 ldi r27, 0x7F ; 127 121bc: 89 8f std Y+25, r24 ; 0x19 121be: 9a 8f std Y+26, r25 ; 0x1a 121c0: ab 8f std Y+27, r26 ; 0x1b 121c2: bc 8f std Y+28, r27 ; 0x1c 121c4: 80 cf rjmp .-256 ; 0x120c6 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 121c6: 60 e0 ldi r22, 0x00 ; 0 121c8: 70 e0 ldi r23, 0x00 ; 0 121ca: 80 e8 ldi r24, 0x80 ; 128 121cc: 9f e7 ldi r25, 0x7F ; 127 121ce: 8f cf rjmp .-226 ; 0x120ee 121d0: 2f 80 ldd r2, Y+7 ; 0x07 121d2: b4 cf rjmp .-152 ; 0x1213c 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; } 121d4: 60 e0 ldi r22, 0x00 ; 0 121d6: 70 e0 ldi r23, 0x00 ; 0 121d8: 80 ec ldi r24, 0xC0 ; 192 121da: 9f e7 ldi r25, 0x7F ; 127 121dc: d3 01 movw r26, r6 121de: 11 96 adiw r26, 0x01 ; 1 121e0: 6d 93 st X+, r22 121e2: 7d 93 st X+, r23 121e4: 8d 93 st X+, r24 121e6: 9c 93 st X, r25 121e8: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 121ea: be 81 ldd r27, Y+6 ; 0x06 121ec: b3 30 cpi r27, 0x03 ; 3 121ee: c1 f1 breq .+112 ; 0x12260 121f0: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 121f2: 81 2f mov r24, r17 121f4: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 121f8: 4b 01 movw r8, r22 121fa: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 121fc: 80 2f mov r24, r16 121fe: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 12202: 6b 01 movw r12, r22 12204: 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)) { 12206: a5 01 movw r20, r10 12208: 94 01 movw r18, r8 1220a: 6a 85 ldd r22, Y+10 ; 0x0a 1220c: 7b 85 ldd r23, Y+11 ; 0x0b 1220e: 8c 85 ldd r24, Y+12 ; 0x0c 12210: 9d 85 ldd r25, Y+13 ; 0x0d 12212: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 12216: 18 16 cp r1, r24 12218: 0c f4 brge .+2 ; 0x1221c 1221a: 1c c1 rjmp .+568 ; 0x12454 1221c: 29 8d ldd r18, Y+25 ; 0x19 1221e: 3a 8d ldd r19, Y+26 ; 0x1a 12220: 4b 8d ldd r20, Y+27 ; 0x1b 12222: 5c 8d ldd r21, Y+28 ; 0x1c 12224: c5 01 movw r24, r10 12226: b4 01 movw r22, r8 12228: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1222c: 18 16 cp r1, r24 1222e: 0c f4 brge .+2 ; 0x12232 12230: 11 c1 rjmp .+546 ; 0x12454 12232: a7 01 movw r20, r14 12234: 96 01 movw r18, r12 12236: 6c 89 ldd r22, Y+20 ; 0x14 12238: 7d 89 ldd r23, Y+21 ; 0x15 1223a: 8e 89 ldd r24, Y+22 ; 0x16 1223c: 9f 89 ldd r25, Y+23 ; 0x17 1223e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 12242: 18 16 cp r1, r24 12244: 0c f4 brge .+2 ; 0x12248 12246: 06 c1 rjmp .+524 ; 0x12454 12248: 2d 8d ldd r18, Y+29 ; 0x1d 1224a: 3e 8d ldd r19, Y+30 ; 0x1e 1224c: 4f 8d ldd r20, Y+31 ; 0x1f 1224e: 58 a1 ldd r21, Y+32 ; 0x20 12250: c7 01 movw r24, r14 12252: b6 01 movw r22, r12 12254: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 12258: 18 16 cp r1, r24 1225a: 0c f4 brge .+2 ; 0x1225e 1225c: fb c0 rjmp .+502 ; 0x12454 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 1225e: 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++) { 12260: 1f 5f subi r17, 0xFF ; 255 12262: 24 e0 ldi r18, 0x04 ; 4 12264: 62 0e add r6, r18 12266: 71 1c adc r7, r1 12268: 17 30 cpi r17, 0x07 ; 7 1226a: 09 f0 breq .+2 ; 0x1226e 1226c: 79 cf rjmp .-270 ; 0x12160 1226e: 6f ef ldi r22, 0xFF ; 255 12270: 46 1a sub r4, r22 12272: 56 0a sbc r5, r22 12274: 88 85 ldd r24, Y+8 ; 0x08 12276: 99 85 ldd r25, Y+9 ; 0x09 12278: 4c 96 adiw r24, 0x1c ; 28 1227a: 99 87 std Y+9, r25 ; 0x09 1227c: 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++) { 1227e: 97 e0 ldi r25, 0x07 ; 7 12280: 49 16 cp r4, r25 12282: 51 04 cpc r5, r1 12284: 09 f0 breq .+2 ; 0x12288 12286: 63 cf rjmp .-314 ; 0x1214e // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 12288: 0f 94 7f 17 call 0x22efe ; 0x22efe // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 1228c: a0 91 73 07 lds r26, 0x0773 ; 0x800773 12290: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 12292: b0 91 f1 03 lds r27, 0x03F1 ; 0x8003f1 12296: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 12298: 81 e0 ldi r24, 0x01 ; 1 1229a: 80 93 73 07 sts 0x0773, r24 ; 0x800773 custom_message_state = meshPointsToProbe + 10; 1229e: 8a e0 ldi r24, 0x0A ; 10 122a0: 83 0d add r24, r3 122a2: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 lcd_update(1); 122a6: 81 e0 ldi r24, 0x01 ; 1 122a8: 0e 94 54 6f call 0xdea8 ; 0xdea8 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 122ac: 80 e0 ldi r24, 0x00 ; 0 122ae: 90 e0 ldi r25, 0x00 ; 0 122b0: a0 ea ldi r26, 0xA0 ; 160 122b2: b0 e4 ldi r27, 0x40 ; 64 122b4: 80 93 49 07 sts 0x0749, r24 ; 0x800749 122b8: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 122bc: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 122c0: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 122c4: 65 e5 ldi r22, 0x55 ; 85 122c6: 75 e5 ldi r23, 0x55 ; 85 122c8: 85 e5 ldi r24, 0x55 ; 85 122ca: 91 e4 ldi r25, 0x41 ; 65 122cc: 0f 94 8b ba call 0x37516 ; 0x37516 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 122d0: 80 e0 ldi r24, 0x00 ; 0 122d2: 0e 94 95 67 call 0xcf2a ; 0xcf2a 122d6: 9c a3 std Y+36, r25 ; 0x24 122d8: 8b a3 std Y+35, r24 ; 0x23 122da: 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 122dc: 83 2d mov r24, r3 122de: 67 e0 ldi r22, 0x07 ; 7 122e0: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__udivmodqi4> 122e4: f8 2e mov r15, r24 122e6: 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 122e8: 68 2f mov r22, r24 122ea: 70 e0 ldi r23, 0x00 ; 0 122ec: 7f 87 std Y+15, r23 ; 0x0f 122ee: 6e 87 std Y+14, r22 ; 0x0e 122f0: 80 ff sbrs r24, 0 122f2: 03 c0 rjmp .+6 ; 0x122fa 122f4: 76 e0 ldi r23, 0x06 ; 6 122f6: 79 1b sub r23, r25 122f8: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 122fa: 80 2f mov r24, r16 122fc: 63 e0 ldi r22, 0x03 ; 3 122fe: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__udivmodqi4> 12302: 91 11 cpse r25, r1 12304: 05 c0 rjmp .+10 ; 0x12310 12306: 8f 2d mov r24, r15 12308: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__udivmodqi4> 1230c: 11 e0 ldi r17, 0x01 ; 1 1230e: 91 11 cpse r25, r1 12310: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 12312: 80 2f mov r24, r16 12314: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 12318: 68 8b std Y+16, r22 ; 0x10 1231a: 79 8b std Y+17, r23 ; 0x11 1231c: 8a 8b std Y+18, r24 ; 0x12 1231e: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 12320: 8f 2d mov r24, r15 12322: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 12326: 4b 01 movw r8, r22 12328: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 1232a: 8e 81 ldd r24, Y+6 ; 0x06 1232c: 83 30 cpi r24, 0x03 ; 3 1232e: 09 f0 breq .+2 ; 0x12332 12330: 99 c0 rjmp .+306 ; 0x12464 if (!isOn3x3Mesh) { 12332: 11 11 cpse r17, r1 12334: c8 c0 rjmp .+400 ; 0x124c6 12336: 27 e0 ldi r18, 0x07 ; 7 12338: ae 85 ldd r26, Y+14 ; 0x0e 1233a: bf 85 ldd r27, Y+15 ; 0x0f 1233c: 2a 9f mul r18, r26 1233e: f0 01 movw r30, r0 12340: 2b 9f mul r18, r27 12342: f0 0d add r31, r0 12344: 11 24 eor r1, r1 12346: e0 0f add r30, r16 12348: f1 1d adc r31, r1 1234a: ee 0f add r30, r30 1234c: ff 1f adc r31, r31 1234e: ee 0f add r30, r30 12350: ff 1f adc r31, r31 12352: e2 56 subi r30, 0x62 ; 98 12354: fc 4e sbci r31, 0xEC ; 236 12356: 60 e0 ldi r22, 0x00 ; 0 12358: 70 e0 ldi r23, 0x00 ; 0 1235a: 80 ec ldi r24, 0xC0 ; 192 1235c: 9f e7 ldi r25, 0x7F ; 127 1235e: 61 83 std Z+1, r22 ; 0x01 12360: 72 83 std Z+2, r23 ; 0x02 12362: 83 83 std Z+3, r24 ; 0x03 12364: 94 83 std Z+4, r25 ; 0x04 12366: 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) { 12368: e1 e3 ldi r30, 0x31 ; 49 1236a: 3e 12 cpse r3, r30 1236c: b7 cf rjmp .-146 ; 0x122dc custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1236e: 80 e0 ldi r24, 0x00 ; 0 12370: 90 e0 ldi r25, 0x00 ; 0 12372: a0 ea ldi r26, 0xA0 ; 160 12374: b0 e4 ldi r27, 0x40 ; 64 12376: 80 93 49 07 sts 0x0749, r24 ; 0x800749 1237a: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 1237e: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 12382: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12386: 65 e5 ldi r22, 0x55 ; 85 12388: 75 e5 ldi r23, 0x55 ; 85 1238a: 85 e5 ldi r24, 0x55 ; 85 1238c: 91 e4 ldi r25, 0x41 ; 65 1238e: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 12392: 0f 94 24 59 call 0x2b248 ; 0x2b248 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 12396: b1 e3 ldi r27, 0x31 ; 49 12398: 3b 16 cp r3, r27 1239a: 09 f4 brne .+2 ; 0x1239e 1239c: 33 c2 rjmp .+1126 ; 0x12804 if (g80_fail_cnt++ >= 1) { 1239e: 80 91 6a 03 lds r24, 0x036A ; 0x80036a 123a2: 91 e0 ldi r25, 0x01 ; 1 123a4: 98 0f add r25, r24 123a6: 90 93 6a 03 sts 0x036A, r25 ; 0x80036a 123aa: 88 23 and r24, r24 123ac: 09 f4 brne .+2 ; 0x123b0 123ae: d3 c1 rjmp .+934 ; 0x12756 print_stop(); 123b0: 60 e0 ldi r22, 0x00 ; 0 123b2: 80 e0 ldi r24, 0x00 ; 0 123b4: 0f 94 0f 16 call 0x22c1e ; 0x22c1e lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 123b8: 86 e4 ldi r24, 0x46 ; 70 123ba: 96 e3 ldi r25, 0x36 ; 54 123bc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 123c0: 0f 94 04 36 call 0x26c08 ; 0x26c08 lcd_z_calibration_prompt(false); 123c4: 80 e0 ldi r24, 0x00 ; 0 123c6: 0f 94 d1 67 call 0x2cfa2 ; 0x2cfa2 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 123ca: 81 e0 ldi r24, 0x01 ; 1 123cc: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 123d0: 8a e6 ldi r24, 0x6A ; 106 123d2: 90 e7 ldi r25, 0x70 ; 112 123d4: 0f 94 e2 0b call 0x217c4 ; 0x217c4 custom_message_type = custom_message_type_old; 123d8: 2f 81 ldd r18, Y+7 ; 0x07 123da: 20 93 73 07 sts 0x0773, r18 ; 0x800773 custom_message_state = custom_message_state_old; 123de: 68 85 ldd r22, Y+8 ; 0x08 123e0: 60 93 f1 03 sts 0x03F1, r22 ; 0x8003f1 lcd_update(2); 123e4: 82 e0 ldi r24, 0x02 ; 2 123e6: 0e 94 54 6f call 0xdea8 ; 0xdea8 st_synchronize(); 123ea: 0f 94 24 59 call 0x2b248 ; 0x2b248 mesh_bed_leveling_flag = false; 123ee: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 123f2: d6 cd rjmp .-1108 ; 0x11fa0 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)) { 123f4: 01 11 cpse r16, r1 123f6: 03 c0 rjmp .+6 ; 0x123fe 123f8: 11 23 and r17, r17 123fa: 09 f4 brne .+2 ; 0x123fe 123fc: bc ce rjmp .-648 ; 0x12176 // 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))); 123fe: 81 2f mov r24, r17 12400: 63 e0 ldi r22, 0x03 ; 3 12402: 0f 94 44 de call 0x3bc88 ; 0x3bc88 <__divmodqi4> 12406: 84 0d add r24, r4 12408: 95 2d mov r25, r5 1240a: 91 1d adc r25, r1 1240c: 88 0f add r24, r24 1240e: 99 1f adc r25, r25 12410: 8d 53 subi r24, 0x3D ; 61 12412: 90 4f sbci r25, 0xF0 ; 240 12414: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 12418: bc 01 movw r22, r24 1241a: 99 0f add r25, r25 1241c: 88 0b sbc r24, r24 1241e: 99 0b sbc r25, r25 12420: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 12424: 2a e0 ldi r18, 0x0A ; 10 12426: 37 ed ldi r19, 0xD7 ; 215 12428: 43 e2 ldi r20, 0x23 ; 35 1242a: 5c e3 ldi r21, 0x3C ; 60 1242c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 12430: 9b 01 movw r18, r22 12432: ac 01 movw r20, r24 12434: 60 91 9f 13 lds r22, 0x139F ; 0x80139f 12438: 70 91 a0 13 lds r23, 0x13A0 ; 0x8013a0 1243c: 80 91 a1 13 lds r24, 0x13A1 ; 0x8013a1 12440: 90 91 a2 13 lds r25, 0x13A2 ; 0x8013a2 12444: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 12448: f3 01 movw r30, r6 1244a: 61 83 std Z+1, r22 ; 0x01 1244c: 72 83 std Z+2, r23 ; 0x02 1244e: 83 83 std Z+3, r24 ; 0x03 12450: 94 83 std Z+4, r25 ; 0x04 12452: 91 ce rjmp .-734 ; 0x12176 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)) { 12454: fe 85 ldd r31, Y+14 ; 0x0e 12456: ff 23 and r31, r31 12458: 09 f4 brne .+2 ; 0x1245c 1245a: 02 cf rjmp .-508 ; 0x12260 1245c: 22 20 and r2, r2 1245e: 09 f4 brne .+2 ; 0x12462 12460: fe ce rjmp .-516 ; 0x1225e 12462: fe ce rjmp .-516 ; 0x12260 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)) { 12464: 28 89 ldd r18, Y+16 ; 0x10 12466: 39 89 ldd r19, Y+17 ; 0x11 12468: 4a 89 ldd r20, Y+18 ; 0x12 1246a: 5b 89 ldd r21, Y+19 ; 0x13 1246c: 6a 85 ldd r22, Y+10 ; 0x0a 1246e: 7b 85 ldd r23, Y+11 ; 0x0b 12470: 8c 85 ldd r24, Y+12 ; 0x0c 12472: 9d 85 ldd r25, Y+13 ; 0x0d 12474: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 12478: 18 16 cp r1, r24 1247a: 04 f1 brlt .+64 ; 0x124bc 1247c: 28 89 ldd r18, Y+16 ; 0x10 1247e: 39 89 ldd r19, Y+17 ; 0x11 12480: 4a 89 ldd r20, Y+18 ; 0x12 12482: 5b 89 ldd r21, Y+19 ; 0x13 12484: 69 8d ldd r22, Y+25 ; 0x19 12486: 7a 8d ldd r23, Y+26 ; 0x1a 12488: 8b 8d ldd r24, Y+27 ; 0x1b 1248a: 9c 8d ldd r25, Y+28 ; 0x1c 1248c: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 12490: 87 fd sbrc r24, 7 12492: 14 c0 rjmp .+40 ; 0x124bc 12494: a5 01 movw r20, r10 12496: 94 01 movw r18, r8 12498: 6c 89 ldd r22, Y+20 ; 0x14 1249a: 7d 89 ldd r23, Y+21 ; 0x15 1249c: 8e 89 ldd r24, Y+22 ; 0x16 1249e: 9f 89 ldd r25, Y+23 ; 0x17 124a0: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 124a4: 18 16 cp r1, r24 124a6: 54 f0 brlt .+20 ; 0x124bc 124a8: a5 01 movw r20, r10 124aa: 94 01 movw r18, r8 124ac: 6d 8d ldd r22, Y+29 ; 0x1d 124ae: 7e 8d ldd r23, Y+30 ; 0x1e 124b0: 8f 8d ldd r24, Y+31 ; 0x1f 124b2: 98 a1 ldd r25, Y+32 ; 0x20 124b4: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 124b8: 87 ff sbrs r24, 7 124ba: 05 c0 rjmp .+10 ; 0x124c6 124bc: 11 23 and r17, r17 124be: 09 f4 brne .+2 ; 0x124c2 124c0: 52 cf rjmp .-348 ; 0x12366 124c2: 21 10 cpse r2, r1 124c4: 50 cf rjmp .-352 ; 0x12366 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 124c6: 10 e0 ldi r17, 0x00 ; 0 124c8: a7 e0 ldi r26, 0x07 ; 7 124ca: 8e 85 ldd r24, Y+14 ; 0x0e 124cc: 9f 85 ldd r25, Y+15 ; 0x0f 124ce: a8 9f mul r26, r24 124d0: f0 01 movw r30, r0 124d2: a9 9f mul r26, r25 124d4: f0 0d add r31, r0 124d6: 11 24 eor r1, r1 124d8: e0 0f add r30, r16 124da: f1 1f adc r31, r17 124dc: ee 0f add r30, r30 124de: ff 1f adc r31, r31 124e0: ee 0f add r30, r30 124e2: ff 1f adc r31, r31 124e4: e2 56 subi r30, 0x62 ; 98 124e6: fc 4e sbci r31, 0xEC ; 236 124e8: 41 80 ldd r4, Z+1 ; 0x01 124ea: 52 80 ldd r5, Z+2 ; 0x02 124ec: 63 80 ldd r6, Z+3 ; 0x03 124ee: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 124f0: c1 2c mov r12, r1 124f2: d1 2c mov r13, r1 124f4: e0 ea ldi r30, 0xA0 ; 160 124f6: ee 2e mov r14, r30 124f8: e0 e4 ldi r30, 0x40 ; 64 124fa: fe 2e mov r15, r30 124fc: 22 20 and r2, r2 124fe: 51 f0 breq .+20 ; 0x12514 12500: 23 e3 ldi r18, 0x33 ; 51 12502: 33 e3 ldi r19, 0x33 ; 51 12504: 43 eb ldi r20, 0xB3 ; 179 12506: 5e e3 ldi r21, 0x3E ; 62 12508: c3 01 movw r24, r6 1250a: b2 01 movw r22, r4 1250c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 12510: 6b 01 movw r12, r22 12512: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 12514: a7 01 movw r20, r14 12516: 96 01 movw r18, r12 12518: 60 91 49 07 lds r22, 0x0749 ; 0x800749 1251c: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 12520: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 12524: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 12528: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1252c: 87 ff sbrs r24, 7 1252e: 10 c0 rjmp .+32 ; 0x12550 current_position[Z_AXIS] = init_z_bckp; 12530: c0 92 49 07 sts 0x0749, r12 ; 0x800749 12534: d0 92 4a 07 sts 0x074A, r13 ; 0x80074a 12538: e0 92 4b 07 sts 0x074B, r14 ; 0x80074b 1253c: f0 92 4c 07 sts 0x074C, r15 ; 0x80074c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12540: 65 e5 ldi r22, 0x55 ; 85 12542: 75 e5 ldi r23, 0x55 ; 85 12544: 85 e5 ldi r24, 0x55 ; 85 12546: 91 e4 ldi r25, 0x41 ; 65 12548: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 1254c: 0f 94 24 59 call 0x2b248 ; 0x2b248 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12550: 68 89 ldd r22, Y+16 ; 0x10 12552: 79 89 ldd r23, Y+17 ; 0x11 12554: 8a 89 ldd r24, Y+18 ; 0x12 12556: 9b 89 ldd r25, Y+19 ; 0x13 12558: 60 93 41 07 sts 0x0741, r22 ; 0x800741 1255c: 70 93 42 07 sts 0x0742, r23 ; 0x800742 12560: 80 93 43 07 sts 0x0743, r24 ; 0x800743 12564: 90 93 44 07 sts 0x0744, r25 ; 0x800744 current_position[Y_AXIS] = y_pos; 12568: 80 92 45 07 sts 0x0745, r8 ; 0x800745 1256c: 90 92 46 07 sts 0x0746, r9 ; 0x800746 12570: a0 92 47 07 sts 0x0747, r10 ; 0x800747 12574: b0 92 48 07 sts 0x0748, r11 ; 0x800748 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 12578: 65 e4 ldi r22, 0x45 ; 69 1257a: 77 e0 ldi r23, 0x07 ; 7 1257c: 81 e4 ldi r24, 0x41 ; 65 1257e: 97 e0 ldi r25, 0x07 ; 7 12580: 0e 94 57 6b call 0xd6ae ; 0xd6ae plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 12584: 60 e0 ldi r22, 0x00 ; 0 12586: 70 e0 ldi r23, 0x00 ; 0 12588: 86 e1 ldi r24, 0x16 ; 22 1258a: 93 e4 ldi r25, 0x43 ; 67 1258c: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 12590: 0f 94 24 59 call 0x2b248 ; 0x2b248 if (planner_aborted) 12594: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 12598: 88 23 and r24, r24 1259a: 39 f0 breq .+14 ; 0x125aa { custom_message_type = custom_message_type_old; 1259c: 7f 81 ldd r23, Y+7 ; 0x07 1259e: 70 93 73 07 sts 0x0773, r23 ; 0x800773 custom_message_state = custom_message_state_old; 125a2: 88 85 ldd r24, Y+8 ; 0x08 125a4: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 125a8: fb cc rjmp .-1546 ; 0x11fa0 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 125aa: 81 2c mov r8, r1 125ac: 91 2c mov r9, r1 125ae: 70 e2 ldi r23, 0x20 ; 32 125b0: a7 2e mov r10, r23 125b2: 71 ec ldi r23, 0xC1 ; 193 125b4: b7 2e mov r11, r23 125b6: 22 20 and r2, r2 125b8: 51 f0 breq .+20 ; 0x125ce 125ba: 2a 81 ldd r18, Y+2 ; 0x02 125bc: 3b 81 ldd r19, Y+3 ; 0x03 125be: 4c 81 ldd r20, Y+4 ; 0x04 125c0: 5d 81 ldd r21, Y+5 ; 0x05 125c2: c3 01 movw r24, r6 125c4: b2 01 movw r22, r4 125c6: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 125ca: 4b 01 movw r8, r22 125cc: 5c 01 movw r10, r24 125ce: 48 8d ldd r20, Y+24 ; 0x18 125d0: c5 01 movw r24, r10 125d2: b4 01 movw r22, r8 125d4: 0f 94 21 8c call 0x31842 ; 0x31842 125d8: 81 11 cpse r24, r1 125da: 0b c0 rjmp .+22 ; 0x125f2 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)); 125dc: 80 ec ldi r24, 0xC0 ; 192 125de: 94 e6 ldi r25, 0x64 ; 100 125e0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 125e4: 9f 93 push r25 125e6: 8f 93 push r24 125e8: 0f 94 4b dc call 0x3b896 ; 0x3b896 125ec: 0f 90 pop r0 125ee: 0f 90 pop r0 125f0: be ce rjmp .-644 ; 0x1236e // 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. 125f2: 20 91 49 07 lds r18, 0x0749 ; 0x800749 125f6: 30 91 4a 07 lds r19, 0x074A ; 0x80074a 125fa: 40 91 4b 07 lds r20, 0x074B ; 0x80074b 125fe: 50 91 4c 07 lds r21, 0x074C ; 0x80074c 12602: c7 01 movw r24, r14 12604: b6 01 movw r22, r12 12606: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1260a: 20 e0 ldi r18, 0x00 ; 0 1260c: 30 e0 ldi r19, 0x00 ; 0 1260e: a9 01 movw r20, r18 12610: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 12614: 87 ff sbrs r24, 7 12616: 36 c0 rjmp .+108 ; 0x12684 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12618: 60 e0 ldi r22, 0x00 ; 0 1261a: 70 e0 ldi r23, 0x00 ; 0 1261c: 80 ea ldi r24, 0xA0 ; 160 1261e: 90 e4 ldi r25, 0x40 ; 64 12620: 60 93 49 07 sts 0x0749, r22 ; 0x800749 12624: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 12628: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 1262c: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12630: 65 e5 ldi r22, 0x55 ; 85 12632: 75 e5 ldi r23, 0x55 ; 85 12634: 85 e5 ldi r24, 0x55 ; 85 12636: 91 e4 ldi r25, 0x41 ; 65 12638: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 1263c: 0f 94 24 59 call 0x2b248 ; 0x2b248 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 12640: 48 8d ldd r20, Y+24 ; 0x18 12642: c5 01 movw r24, r10 12644: b4 01 movw r22, r8 12646: 0f 94 21 8c call 0x31842 ; 0x31842 1264a: 88 23 and r24, r24 1264c: 39 f2 breq .-114 ; 0x125dc printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 1264e: 20 91 49 07 lds r18, 0x0749 ; 0x800749 12652: 30 91 4a 07 lds r19, 0x074A ; 0x80074a 12656: 40 91 4b 07 lds r20, 0x074B ; 0x80074b 1265a: 50 91 4c 07 lds r21, 0x074C ; 0x80074c 1265e: 60 e0 ldi r22, 0x00 ; 0 12660: 70 e0 ldi r23, 0x00 ; 0 12662: 80 ea ldi r24, 0xA0 ; 160 12664: 90 e4 ldi r25, 0x40 ; 64 12666: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1266a: 2d ec ldi r18, 0xCD ; 205 1266c: 3c ec ldi r19, 0xCC ; 204 1266e: 4c ec ldi r20, 0xCC ; 204 12670: 5d e3 ldi r21, 0x3D ; 61 12672: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 12676: 87 ff sbrs r24, 7 12678: 05 c0 rjmp .+10 ; 0x12684 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 1267a: 87 e6 ldi r24, 0x67 ; 103 1267c: 9d e7 ldi r25, 0x7D ; 125 break; } } if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 1267e: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 12682: 75 ce rjmp .-790 ; 0x1236e 12684: c0 90 49 07 lds r12, 0x0749 ; 0x800749 12688: d0 90 4a 07 lds r13, 0x074A ; 0x80074a 1268c: e0 90 4b 07 lds r14, 0x074B ; 0x80074b 12690: f0 90 4c 07 lds r15, 0x074C ; 0x80074c 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 12694: 22 20 and r2, r2 12696: a1 f0 breq .+40 ; 0x126c0 12698: a7 01 movw r20, r14 1269a: 96 01 movw r18, r12 1269c: c3 01 movw r24, r6 1269e: b2 01 movw r22, r4 126a0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 126a4: 9b 01 movw r18, r22 126a6: ac 01 movw r20, r24 126a8: 5f 77 andi r21, 0x7F ; 127 126aa: 6a 81 ldd r22, Y+2 ; 0x02 126ac: 7b 81 ldd r23, Y+3 ; 0x03 126ae: 8c 81 ldd r24, Y+4 ; 0x04 126b0: 9d 81 ldd r25, Y+5 ; 0x05 126b2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 126b6: 87 ff sbrs r24, 7 126b8: 03 c0 rjmp .+6 ; 0x126c0 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 126ba: 8e e2 ldi r24, 0x2E ; 46 126bc: 9d e7 ldi r25, 0x7D ; 125 126be: df cf rjmp .-66 ; 0x1267e } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 126c0: 8f ea ldi r24, 0xAF ; 175 126c2: 9f e0 ldi r25, 0x0F ; 15 126c4: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 126c8: 88 23 and r24, r24 126ca: 09 f4 brne .+2 ; 0x126ce 126cc: 40 c0 rjmp .+128 ; 0x1274e 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); } 126ce: 86 ea ldi r24, 0xA6 ; 166 126d0: 9f e0 ldi r25, 0x0F ; 15 126d2: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 if (!calibration_status_pinda()) return 0; 126d6: 88 23 and r24, r24 126d8: d1 f1 breq .+116 ; 0x1274e return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 126da: 60 91 97 03 lds r22, 0x0397 ; 0x800397 126de: 70 91 98 03 lds r23, 0x0398 ; 0x800398 126e2: 80 91 99 03 lds r24, 0x0399 ; 0x800399 126e6: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 126ea: 0e 94 37 5d call 0xba6e ; 0xba6e 126ee: 20 91 78 06 lds r18, 0x0678 ; 0x800678 126f2: 30 91 79 06 lds r19, 0x0679 ; 0x800679 126f6: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 126fa: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 126fe: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 12702: 9b 01 movw r18, r22 12704: ac 01 movw r20, r24 12706: e7 e0 ldi r30, 0x07 ; 7 12708: ae 85 ldd r26, Y+14 ; 0x0e 1270a: bf 85 ldd r27, Y+15 ; 0x0f 1270c: ea 9f mul r30, r26 1270e: c0 01 movw r24, r0 12710: eb 9f mul r30, r27 12712: 90 0d add r25, r0 12714: 11 24 eor r1, r1 12716: 08 0f add r16, r24 12718: 19 1f adc r17, r25 1271a: 00 0f add r16, r16 1271c: 11 1f adc r17, r17 1271e: 00 0f add r16, r16 12720: 11 1f adc r17, r17 12722: 02 56 subi r16, 0x62 ; 98 12724: 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; 12726: c7 01 movw r24, r14 12728: b6 01 movw r22, r12 1272a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1272e: d8 01 movw r26, r16 12730: 11 96 adiw r26, 0x01 ; 1 12732: 6d 93 st X+, r22 12734: 7d 93 st X+, r23 12736: 8d 93 st X+, r24 12738: 9c 93 st X, r25 1273a: 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--; 1273c: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 12740: 81 50 subi r24, 0x01 ; 1 12742: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 mesh_point++; lcd_update(1); 12746: 81 e0 ldi r24, 0x01 ; 1 12748: 0e 94 54 6f call 0xdea8 ; 0xdea8 1274c: 0c ce rjmp .-1000 ; 0x12366 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 1274e: 20 e0 ldi r18, 0x00 ; 0 12750: 30 e0 ldi r19, 0x00 ; 0 12752: a9 01 movw r20, r18 12754: d8 cf rjmp .-80 ; 0x12706 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); 12756: 85 e0 ldi r24, 0x05 ; 5 12758: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee 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; 1275c: c1 2c mov r12, r1 1275e: d1 2c mov r13, r1 12760: 90 ea ldi r25, 0xA0 ; 160 12762: e9 2e mov r14, r25 12764: 90 e4 ldi r25, 0x40 ; 64 12766: 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)); 12768: 82 e1 ldi r24, 0x12 ; 18 1276a: 96 e3 ldi r25, 0x36 ; 54 1276c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 12770: 0f 94 7d 35 call 0x26afa ; 0x26afa #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 12774: 8e e1 ldi r24, 0x1E ; 30 12776: 90 e0 ldi r25, 0x00 ; 0 12778: 0f 94 6b 50 call 0x2a0d6 ; 0x2a0d6 calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 1277c: 0e 94 eb 73 call 0xe7d6 ; 0xe7d6 #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); 12780: 80 e0 ldi r24, 0x00 ; 0 12782: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 12786: 18 2f mov r17, r24 raise_z(-1); 12788: 60 e0 ldi r22, 0x00 ; 0 1278a: 70 e0 ldi r23, 0x00 ; 0 1278c: 80 e8 ldi r24, 0x80 ; 128 1278e: 9f eb ldi r25, 0xBF ; 191 12790: 0e 94 8e 6e call 0xdd1c ; 0xdd1c enable_z_endstop(true); 12794: 81 e0 ldi r24, 0x01 ; 1 12796: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 1279a: 84 e0 ldi r24, 0x04 ; 4 1279c: 0f 94 8b 3b call 0x27716 ; 0x27716 #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 127a0: c0 92 49 07 sts 0x0749, r12 ; 0x800749 127a4: d0 92 4a 07 sts 0x074A, r13 ; 0x80074a 127a8: e0 92 4b 07 sts 0x074B, r14 ; 0x80074b 127ac: f0 92 4c 07 sts 0x074C, r15 ; 0x80074c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 127b0: 65 e5 ldi r22, 0x55 ; 85 127b2: 75 e5 ldi r23, 0x55 ; 85 127b4: 85 e5 ldi r24, 0x55 ; 85 127b6: 91 e4 ldi r25, 0x41 ; 65 127b8: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 127bc: 0f 94 24 59 call 0x2b248 ; 0x2b248 #ifdef TMC2130 tmc2130_home_exit(); 127c0: 0f 94 5c 3b call 0x276b8 ; 0x276b8 #endif // TMC2130 enable_z_endstop(bState); 127c4: 81 2f mov r24, r17 127c6: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 127ca: 82 e0 ldi r24, 0x02 ; 2 127cc: 0f 94 10 59 call 0x2b220 ; 0x2b220 127d0: 20 e0 ldi r18, 0x00 ; 0 127d2: 30 e0 ldi r19, 0x00 ; 0 127d4: 40 ea ldi r20, 0xA0 ; 160 127d6: 50 e4 ldi r21, 0x40 ; 64 127d8: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 127dc: 18 16 cp r1, r24 127de: 24 f2 brlt .-120 ; 0x12768 custom_message_type = custom_message_type_old; 127e0: ef 81 ldd r30, Y+7 ; 0x07 127e2: e0 93 73 07 sts 0x0773, r30 ; 0x800773 custom_message_state = custom_message_state_old; 127e6: f8 85 ldd r31, Y+8 ; 0x08 127e8: f0 93 f1 03 sts 0x03F1, r31 ; 0x8003f1 lcd_update_enable(true); // display / status-line recovery 127ec: 81 e0 ldi r24, 0x01 ; 1 127ee: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 127f2: 41 e0 ldi r20, 0x01 ; 1 127f4: 61 e0 ldi r22, 0x01 ; 1 127f6: 81 e0 ldi r24, 0x01 ; 1 127f8: 0e 94 88 80 call 0x10110 ; 0x10110 127fc: 81 e0 ldi r24, 0x01 ; 1 127fe: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e 12802: ce cb rjmp .-2148 ; 0x11fa0 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 12804: 10 92 6a 03 sts 0x036A, r1 ; 0x80036a clean_up_after_endstop_move(l_feedmultiply); 12808: 8b a1 ldd r24, Y+35 ; 0x23 1280a: 9c a1 ldd r25, Y+36 ; 0x24 1280c: 0e 94 7b 67 call 0xcef6 ; 0xcef6 } } void babystep_apply() { babystep_load(); 12810: 0f 94 f7 c6 call 0x38dee ; 0x38dee shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 12814: 60 91 68 05 lds r22, 0x0568 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.516> 12818: 70 91 69 05 lds r23, 0x0569 ; 0x800569 <_ZL13babystepLoadZ.lto_priv.516+0x1> 1281c: 07 2e mov r0, r23 1281e: 00 0c add r0, r0 12820: 88 0b sbc r24, r24 12822: 99 0b sbc r25, r25 12824: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 12828: 90 58 subi r25, 0x80 ; 128 1282a: 20 91 78 06 lds r18, 0x0678 ; 0x800678 1282e: 30 91 79 06 lds r19, 0x0679 ; 0x800679 12832: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 12836: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 1283a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1283e: 0f 94 13 c7 call 0x38e26 ; 0x38e26 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; 12842: 80 ec ldi r24, 0xC0 ; 192 12844: 9f e0 ldi r25, 0x0F ; 15 12846: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1284a: 91 e0 ldi r25, 0x01 ; 1 1284c: 81 30 cpi r24, 0x01 ; 1 1284e: 09 f0 breq .+2 ; 0x12852 12850: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12852: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 12854: 4f eb ldi r20, 0xBF ; 191 12856: 5f e0 ldi r21, 0x0F ; 15 12858: 6c e4 ldi r22, 0x4C ; 76 1285a: ce 01 movw r24, r28 1285c: 01 96 adiw r24, 0x01 ; 1 1285e: 0e 94 89 5c call 0xb912 ; 0xb912 12862: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 12864: 4e eb ldi r20, 0xBE ; 190 12866: 5f e0 ldi r21, 0x0F ; 15 12868: 62 e5 ldi r22, 0x52 ; 82 1286a: ce 01 movw r24, r28 1286c: 01 96 adiw r24, 0x01 ; 1 1286e: 0e 94 89 5c call 0xb912 ; 0xb912 12872: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 12874: 4d eb ldi r20, 0xBD ; 189 12876: 5f e0 ldi r21, 0x0F ; 15 12878: 66 e4 ldi r22, 0x46 ; 70 1287a: ce 01 movw r24, r28 1287c: 01 96 adiw r24, 0x01 ; 1 1287e: 0e 94 89 5c call 0xb912 ; 0xb912 12882: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 12884: 4c eb ldi r20, 0xBC ; 188 12886: 5f e0 ldi r21, 0x0F ; 15 12888: 62 e4 ldi r22, 0x42 ; 66 1288a: ce 01 movw r24, r28 1288c: 01 96 adiw r24, 0x01 ; 1 1288e: 0e 94 89 5c call 0xb912 ; 0xb912 12892: 21 2f mov r18, r17 12894: 11 0f add r17, r17 12896: 33 0b sbc r19, r19 12898: 08 2e mov r0, r24 1289a: 00 0c add r0, r0 1289c: 99 0b sbc r25, r25 1289e: 5c 01 movw r10, r24 128a0: a2 1a sub r10, r18 128a2: b3 0a sbc r11, r19 128a4: 8f 2d mov r24, r15 128a6: ff 0c add r15, r15 128a8: 99 0b sbc r25, r25 128aa: 28 0f add r18, r24 128ac: 39 1f adc r19, r25 128ae: 46 e0 ldi r20, 0x06 ; 6 128b0: 42 9f mul r20, r18 128b2: 60 01 movw r12, r0 128b4: 43 9f mul r20, r19 128b6: d0 0c add r13, r0 128b8: 11 24 eor r1, r1 128ba: f1 2c mov r15, r1 128bc: e1 2c mov r14, r1 128be: 00 2e mov r0, r16 128c0: 00 0c add r0, r0 128c2: 11 0b sbc r17, r17 128c4: 08 1b sub r16, r24 128c6: 19 0b sbc r17, r25 128c8: b7 01 movw r22, r14 128ca: 61 56 subi r22, 0x61 ; 97 128cc: 7c 4e sbci r23, 0xEC ; 236 128ce: 3b 01 movw r6, r22 128d0: 46 01 movw r8, r12 128d2: 77 e0 ldi r23, 0x07 ; 7 128d4: 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 * ( 128d6: d3 01 movw r26, r6 128d8: 2d 90 ld r2, X+ 128da: 3d 90 ld r3, X+ 128dc: 4d 90 ld r4, X+ 128de: 5d 90 ld r5, X+ 128e0: 3d 01 movw r6, r26 128e2: fd 01 movw r30, r26 128e4: 34 97 sbiw r30, 0x04 ; 4 128e6: fb 87 std Y+11, r31 ; 0x0b 128e8: ea 87 std Y+10, r30 ; 0x0a 128ea: b4 01 movw r22, r8 128ec: 09 2c mov r0, r9 128ee: 00 0c add r0, r0 128f0: 88 0b sbc r24, r24 128f2: 99 0b sbc r25, r25 128f4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 128f8: 2f e3 ldi r18, 0x3F ; 63 128fa: 33 ec ldi r19, 0xC3 ; 195 128fc: 4e e2 ldi r20, 0x2E ; 46 128fe: 59 e3 ldi r21, 0x39 ; 57 12900: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 12904: a2 01 movw r20, r4 12906: 91 01 movw r18, r2 12908: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1290c: aa 85 ldd r26, Y+10 ; 0x0a 1290e: bb 85 ldd r27, Y+11 ; 0x0b 12910: 6d 93 st X+, r22 12912: 7d 93 st X+, r23 12914: 8d 93 st X+, r24 12916: 9c 93 st X, r25 12918: 13 97 sbiw r26, 0x03 ; 3 1291a: ba 81 ldd r27, Y+2 ; 0x02 1291c: b1 50 subi r27, 0x01 ; 1 1291e: ba 83 std Y+2, r27 ; 0x02 12920: 80 0e add r8, r16 12922: 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++) { 12924: b1 11 cpse r27, r1 12926: d7 cf rjmp .-82 ; 0x128d6 12928: ca 0c add r12, r10 1292a: db 1c adc r13, r11 1292c: ec e1 ldi r30, 0x1C ; 28 1292e: ee 0e add r14, r30 12930: 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++) { 12932: f4 ec ldi r31, 0xC4 ; 196 12934: ef 16 cp r14, r31 12936: f1 04 cpc r15, r1 12938: 39 f6 brne .-114 ; 0x128c8 + 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) 1293a: 0f 94 7f 17 call 0x22efe ; 0x22efe { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 1293e: 8d e4 ldi r24, 0x4D ; 77 12940: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 12944: 88 23 and r24, r24 12946: 09 f4 brne .+2 ; 0x1294a 12948: 84 c0 rjmp .+264 ; 0x12a52 1294a: 0e 94 06 5c call 0xb80c ; 0xb80c if (nMeasPoints == 7 && useMagnetCompensation) { 1294e: 2e 81 ldd r18, Y+6 ; 0x06 12950: 27 30 cpi r18, 0x07 ; 7 12952: 09 f0 breq .+2 ; 0x12956 12954: 94 c0 rjmp .+296 ; 0x12a7e 12956: 88 23 and r24, r24 12958: 09 f4 brne .+2 ; 0x1295c 1295a: 91 c0 rjmp .+290 ; 0x12a7e 1295c: bb 24 eor r11, r11 1295e: b3 94 inc r11 12960: aa 24 eor r10, r10 12962: aa 94 dec r10 12964: ab 0c add r10, r11 12966: 09 a1 ldd r16, Y+33 ; 0x21 12968: 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++) { 1296a: 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++; } 1296c: 8e ef ldi r24, 0xFE ; 254 1296e: 88 2e mov r8, r24 12970: 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)) { 12972: 6a 2d mov r22, r10 12974: 86 2d mov r24, r6 12976: 0f 94 c2 c6 call 0x38d84 ; 0x38d84 1297a: 99 24 eor r9, r9 1297c: 93 94 inc r9 1297e: 96 0c add r9, r6 12980: 81 11 cpse r24, r1 12982: 6e c0 rjmp .+220 ; 0x12a60 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++; } 12984: 6b 2d mov r22, r11 12986: 86 2d mov r24, r6 12988: 0f 94 c2 c6 call 0x38d84 ; 0x38d84 } 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; 1298c: c1 2c mov r12, r1 1298e: d1 2c mov r13, r1 12990: 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; 12992: 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++; } 12994: 88 23 and r24, r24 12996: 81 f0 breq .+32 ; 0x129b8 12998: 20 e0 ldi r18, 0x00 ; 0 1299a: 30 e0 ldi r19, 0x00 ; 0 1299c: a9 01 movw r20, r18 1299e: d8 01 movw r26, r16 129a0: 5d 96 adiw r26, 0x1d ; 29 129a2: 6d 91 ld r22, X+ 129a4: 7d 91 ld r23, X+ 129a6: 8d 91 ld r24, X+ 129a8: 9c 91 ld r25, X 129aa: 90 97 sbiw r26, 0x20 ; 32 129ac: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 129b0: 6b 01 movw r12, r22 129b2: 7c 01 movw r14, r24 129b4: 77 24 eor r7, r7 129b6: 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++; } 129b8: 68 2d mov r22, r8 129ba: 86 2d mov r24, r6 129bc: 0f 94 c2 c6 call 0x38d84 ; 0x38d84 129c0: 88 23 and r24, r24 129c2: 69 f0 breq .+26 ; 0x129de 129c4: f8 01 movw r30, r16 129c6: 7b 97 sbiw r30, 0x1b ; 27 129c8: 20 81 ld r18, Z 129ca: 31 81 ldd r19, Z+1 ; 0x01 129cc: 42 81 ldd r20, Z+2 ; 0x02 129ce: 53 81 ldd r21, Z+3 ; 0x03 129d0: c7 01 movw r24, r14 129d2: b6 01 movw r22, r12 129d4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 129d8: 6b 01 movw r12, r22 129da: 7c 01 movw r14, r24 129dc: 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++; } 129de: 6a 2d mov r22, r10 129e0: 89 2d mov r24, r9 129e2: 0f 94 c2 c6 call 0x38d84 ; 0x38d84 129e6: 88 23 and r24, r24 129e8: 61 f0 breq .+24 ; 0x12a02 129ea: f8 01 movw r30, r16 129ec: 25 81 ldd r18, Z+5 ; 0x05 129ee: 36 81 ldd r19, Z+6 ; 0x06 129f0: 47 81 ldd r20, Z+7 ; 0x07 129f2: 50 85 ldd r21, Z+8 ; 0x08 129f4: c7 01 movw r24, r14 129f6: b6 01 movw r22, r12 129f8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 129fc: 6b 01 movw r12, r22 129fe: 7c 01 movw r14, r24 12a00: 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++; } 12a02: 6a 2d mov r22, r10 12a04: 8f ef ldi r24, 0xFF ; 255 12a06: 86 0d add r24, r6 12a08: 0f 94 c2 c6 call 0x38d84 ; 0x38d84 12a0c: 88 23 and r24, r24 12a0e: 31 f1 breq .+76 ; 0x12a5c 12a10: f8 01 movw r30, r16 12a12: 33 97 sbiw r30, 0x03 ; 3 12a14: 20 81 ld r18, Z 12a16: 31 81 ldd r19, Z+1 ; 0x01 12a18: 42 81 ldd r20, Z+2 ; 0x02 12a1a: 53 81 ldd r21, Z+3 ; 0x03 12a1c: c7 01 movw r24, r14 12a1e: b6 01 movw r22, r12 12a20: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 12a24: 6b 01 movw r12, r22 12a26: 7c 01 movw r14, r24 12a28: 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 12a2a: 67 2d mov r22, r7 12a2c: 70 e0 ldi r23, 0x00 ; 0 12a2e: 90 e0 ldi r25, 0x00 ; 0 12a30: 80 e0 ldi r24, 0x00 ; 0 12a32: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 12a36: 9b 01 movw r18, r22 12a38: ac 01 movw r20, r24 12a3a: c7 01 movw r24, r14 12a3c: b6 01 movw r22, r12 12a3e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 12a42: d8 01 movw r26, r16 12a44: 11 96 adiw r26, 0x01 ; 1 12a46: 6d 93 st X+, r22 12a48: 7d 93 st X+, r23 12a4a: 8d 93 st X+, r24 12a4c: 9c 93 st X, r25 12a4e: 14 97 sbiw r26, 0x04 ; 4 12a50: 07 c0 rjmp .+14 ; 0x12a60 } 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); 12a52: 8c ea ldi r24, 0xAC ; 172 12a54: 9d e0 ldi r25, 0x0D ; 13 12a56: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 12a5a: 79 cf rjmp .-270 ; 0x1294e 12a5c: 71 10 cpse r7, r1 12a5e: e5 cf rjmp .-54 ; 0x12a2a //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++) { 12a60: 69 2c mov r6, r9 12a62: 0c 5f subi r16, 0xFC ; 252 12a64: 1f 4f sbci r17, 0xFF ; 255 12a66: b7 e0 ldi r27, 0x07 ; 7 12a68: 9b 12 cpse r9, r27 12a6a: 83 cf rjmp .-250 ; 0x12972 12a6c: b3 94 inc r11 12a6e: e9 a1 ldd r30, Y+33 ; 0x21 12a70: fa a1 ldd r31, Y+34 ; 0x22 12a72: 7c 96 adiw r30, 0x1c ; 28 12a74: fa a3 std Y+34, r31 ; 0x22 12a76: 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++) { 12a78: f8 e0 ldi r31, 0x08 ; 8 12a7a: bf 12 cpse r11, r31 12a7c: 71 cf rjmp .-286 ; 0x12960 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12a7e: 81 e0 ldi r24, 0x01 ; 1 12a80: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e if (code_seen('O') && !code_value_uint8()) { 12a84: 8f e4 ldi r24, 0x4F ; 79 12a86: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 12a8a: 81 11 cpse r24, r1 12a8c: 03 c0 rjmp .+6 ; 0x12a94 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12a8e: 0f 94 68 c7 call 0x38ed0 ; 0x38ed0 12a92: 9b cc rjmp .-1738 ; 0x123ca } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 12a94: 0e 94 06 5c call 0xb80c ; 0xb80c 12a98: 81 11 cpse r24, r1 12a9a: f9 cf rjmp .-14 ; 0x12a8e // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12a9c: 0e 94 70 67 call 0xcee0 ; 0xcee0 12aa0: 94 cc rjmp .-1752 ; 0x123ca 00012aa2 : //! @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() { 12aa2: 4f 92 push r4 12aa4: 5f 92 push r5 12aa6: 6f 92 push r6 12aa8: 7f 92 push r7 12aaa: 8f 92 push r8 12aac: 9f 92 push r9 12aae: af 92 push r10 12ab0: bf 92 push r11 12ab2: ef 92 push r14 12ab4: ff 92 push r15 12ab6: 0f 93 push r16 12ab8: 1f 93 push r17 12aba: cf 93 push r28 12abc: df 93 push r29 12abe: 1f 92 push r1 12ac0: cd b7 in r28, 0x3d ; 61 12ac2: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 12ac4: 44 e0 ldi r20, 0x04 ; 4 12ac6: 50 e0 ldi r21, 0x00 ; 0 12ac8: 64 e1 ldi r22, 0x14 ; 20 12aca: 70 e0 ldi r23, 0x00 ; 0 12acc: 8c e6 ldi r24, 0x6C ; 108 12ace: 96 e0 ldi r25, 0x06 ; 6 12ad0: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 12ad4: 43 e0 ldi r20, 0x03 ; 3 12ad6: 50 e0 ldi r21, 0x00 ; 0 12ad8: 6d eb ldi r22, 0xBD ; 189 12ada: 78 e7 ldi r23, 0x78 ; 120 12adc: 8c e6 ldi r24, 0x6C ; 108 12ade: 96 e0 ldi r25, 0x06 ; 6 12ae0: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 12ae4: 89 2b or r24, r25 12ae6: 09 f0 breq .+2 ; 0x12aea 12ae8: a0 c1 rjmp .+832 ; 0x12e2a { // 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)); 12aea: e1 e8 ldi r30, 0x81 ; 129 12aec: f9 e7 ldi r31, 0x79 ; 121 12aee: 45 91 lpm r20, Z+ 12af0: 55 91 lpm r21, Z+ 12af2: 65 91 lpm r22, Z+ 12af4: 74 91 lpm r23, Z 12af6: 88 ed ldi r24, 0xD8 ; 216 12af8: 90 e0 ldi r25, 0x00 ; 0 12afa: 0e 94 d4 64 call 0xc9a8 ; 0xc9a8 eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 12afe: e5 e8 ldi r30, 0x85 ; 133 12b00: f9 e7 ldi r31, 0x79 ; 121 12b02: 45 91 lpm r20, Z+ 12b04: 55 91 lpm r21, Z+ 12b06: 65 91 lpm r22, Z+ 12b08: 74 91 lpm r23, Z 12b0a: 8c ed ldi r24, 0xDC ; 220 12b0c: 90 e0 ldi r25, 0x00 ; 0 12b0e: 0e 94 d4 64 call 0xc9a8 ; 0xc9a8 eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 12b12: e9 e8 ldi r30, 0x89 ; 137 12b14: f9 e7 ldi r31, 0x79 ; 121 12b16: 64 91 lpm r22, Z 12b18: 80 ee ldi r24, 0xE0 ; 224 12b1a: 90 e0 ldi r25, 0x00 ; 0 12b1c: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 12b20: ea e8 ldi r30, 0x8A ; 138 12b22: f9 e7 ldi r31, 0x79 ; 121 12b24: 65 91 lpm r22, Z+ 12b26: 74 91 lpm r23, Z 12b28: 81 ee ldi r24, 0xE1 ; 225 12b2a: 90 e0 ldi r25, 0x00 ; 0 12b2c: 0e 94 74 77 call 0xeee8 ; 0xeee8 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 12b30: ec e8 ldi r30, 0x8C ; 140 12b32: f9 e7 ldi r31, 0x79 ; 121 12b34: 65 91 lpm r22, Z+ 12b36: 74 91 lpm r23, Z 12b38: 83 ee ldi r24, 0xE3 ; 227 12b3a: 90 e0 ldi r25, 0x00 ; 0 12b3c: 0e 94 74 77 call 0xeee8 ; 0xeee8 // 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)); 12b40: ed e7 ldi r30, 0x7D ; 125 12b42: f9 e7 ldi r31, 0x79 ; 121 12b44: 45 91 lpm r20, Z+ 12b46: 55 91 lpm r21, Z+ 12b48: 65 91 lpm r22, Z+ 12b4a: 74 91 lpm r23, Z 12b4c: 84 ed ldi r24, 0xD4 ; 212 12b4e: 90 e0 ldi r25, 0x00 ; 0 12b50: 0e 94 d4 64 call 0xc9a8 ; 0xc9a8 // 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); 12b54: 49 e5 ldi r20, 0x59 ; 89 12b56: 59 e7 ldi r21, 0x79 ; 121 12b58: 60 e1 ldi r22, 0x10 ; 16 12b5a: 70 e0 ldi r23, 0x00 ; 0 12b5c: 80 eb ldi r24, 0xB0 ; 176 12b5e: 90 e0 ldi r25, 0x00 ; 0 12b60: 0e 94 55 77 call 0xeeaa ; 0xeeaa 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); 12b64: 49 e6 ldi r20, 0x69 ; 105 12b66: 59 e7 ldi r21, 0x79 ; 121 12b68: 60 e1 ldi r22, 0x10 ; 16 12b6a: 70 e0 ldi r23, 0x00 ; 0 12b6c: 80 ec ldi r24, 0xC0 ; 192 12b6e: 90 e0 ldi r25, 0x00 ; 0 12b70: 0e 94 55 77 call 0xeeaa ; 0xeeaa #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 12b74: 49 e7 ldi r20, 0x79 ; 121 12b76: 59 e7 ldi r21, 0x79 ; 121 12b78: 64 e0 ldi r22, 0x04 ; 4 12b7a: 70 e0 ldi r23, 0x00 ; 0 12b7c: 80 ed ldi r24, 0xD0 ; 208 12b7e: 90 e0 ldi r25, 0x00 ; 0 12b80: 0e 94 55 77 call 0xeeaa ; 0xeeaa #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 12b84: 41 ed ldi r20, 0xD1 ; 209 12b86: 50 e0 ldi r21, 0x00 ; 0 12b88: 64 e1 ldi r22, 0x14 ; 20 12b8a: 70 e0 ldi r23, 0x00 ; 0 12b8c: 8c e6 ldi r24, 0x6C ; 108 12b8e: 96 e0 ldi r25, 0x06 ; 6 12b90: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 calculate_extruder_multipliers(); 12b94: 0e 94 66 66 call 0xcccc ; 0xcccc 12b98: 0c e6 ldi r16, 0x6C ; 108 12b9a: 16 e0 ldi r17, 0x06 ; 6 12b9c: 88 e0 ldi r24, 0x08 ; 8 12b9e: e8 2e mov r14, r24 12ba0: 87 e0 ldi r24, 0x07 ; 7 12ba2: 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; 12ba4: 94 ec ldi r25, 0xC4 ; 196 12ba6: 89 2e mov r8, r25 12ba8: 99 e0 ldi r25, 0x09 ; 9 12baa: 99 2e mov r9, r25 12bac: a1 2c mov r10, r1 12bae: 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; 12bb0: 20 ec ldi r18, 0xC0 ; 192 12bb2: 42 2e mov r4, r18 12bb4: 23 e0 ldi r18, 0x03 ; 3 12bb6: 52 2e mov r5, r18 12bb8: 61 2c mov r6, r1 12bba: 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) 12bbc: 20 e0 ldi r18, 0x00 ; 0 12bbe: 30 e0 ldi r19, 0x00 ; 0 12bc0: 48 e4 ldi r20, 0x48 ; 72 12bc2: 53 e4 ldi r21, 0x43 ; 67 12bc4: f8 01 movw r30, r16 12bc6: 64 89 ldd r22, Z+20 ; 0x14 12bc8: 75 89 ldd r23, Z+21 ; 0x15 12bca: 86 89 ldd r24, Z+22 ; 0x16 12bcc: 97 89 ldd r25, Z+23 ; 0x17 12bce: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 12bd2: 18 16 cp r1, r24 12bd4: 4c f4 brge .+18 ; 0x12be8 cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 12bd6: 80 e0 ldi r24, 0x00 ; 0 12bd8: 90 e0 ldi r25, 0x00 ; 0 12bda: a8 e4 ldi r26, 0x48 ; 72 12bdc: b3 e4 ldi r27, 0x43 ; 67 12bde: f8 01 movw r30, r16 12be0: 84 8b std Z+20, r24 ; 0x14 12be2: 95 8b std Z+21, r25 ; 0x15 12be4: a6 8b std Z+22, r26 ; 0x16 12be6: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 12be8: f7 01 movw r30, r14 12bea: 61 91 ld r22, Z+ 12bec: 71 91 ld r23, Z+ 12bee: 81 91 ld r24, Z+ 12bf0: 91 91 ld r25, Z+ 12bf2: 7f 01 movw r14, r30 12bf4: 20 e0 ldi r18, 0x00 ; 0 12bf6: 30 e0 ldi r19, 0x00 ; 0 12bf8: 48 ec ldi r20, 0xC8 ; 200 12bfa: 52 e4 ldi r21, 0x42 ; 66 12bfc: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 12c00: 18 16 cp r1, r24 12c02: 54 f4 brge .+20 ; 0x12c18 cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 12c04: 80 e0 ldi r24, 0x00 ; 0 12c06: 90 e0 ldi r25, 0x00 ; 0 12c08: a8 ec ldi r26, 0xC8 ; 200 12c0a: b2 e4 ldi r27, 0x42 ; 66 12c0c: f7 01 movw r30, r14 12c0e: 34 97 sbiw r30, 0x04 ; 4 12c10: 80 83 st Z, r24 12c12: 91 83 std Z+1, r25 ; 0x01 12c14: a2 83 std Z+2, r26 ; 0x02 12c16: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 12c18: f8 01 movw r30, r16 12c1a: 84 a1 ldd r24, Z+36 ; 0x24 12c1c: 95 a1 ldd r25, Z+37 ; 0x25 12c1e: a6 a1 ldd r26, Z+38 ; 0x26 12c20: b7 a1 ldd r27, Z+39 ; 0x27 12c22: 85 3c cpi r24, 0xC5 ; 197 12c24: 99 40 sbci r25, 0x09 ; 9 12c26: a1 05 cpc r26, r1 12c28: b1 05 cpc r27, r1 12c2a: 28 f0 brcs .+10 ; 0x12c36 cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 12c2c: f8 01 movw r30, r16 12c2e: 84 a2 std Z+36, r8 ; 0x24 12c30: 95 a2 std Z+37, r9 ; 0x25 12c32: a6 a2 std Z+38, r10 ; 0x26 12c34: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 12c36: f7 01 movw r30, r14 12c38: 84 85 ldd r24, Z+12 ; 0x0c 12c3a: 95 85 ldd r25, Z+13 ; 0x0d 12c3c: a6 85 ldd r26, Z+14 ; 0x0e 12c3e: b7 85 ldd r27, Z+15 ; 0x0f 12c40: 81 3c cpi r24, 0xC1 ; 193 12c42: 93 40 sbci r25, 0x03 ; 3 12c44: a1 05 cpc r26, r1 12c46: b1 05 cpc r27, r1 12c48: 28 f0 brcs .+10 ; 0x12c54 cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12c4a: f7 01 movw r30, r14 12c4c: 44 86 std Z+12, r4 ; 0x0c 12c4e: 55 86 std Z+13, r5 ; 0x0d 12c50: 66 86 std Z+14, r6 ; 0x0e 12c52: 77 86 std Z+15, r7 ; 0x0f 12c54: 0c 5f subi r16, 0xFC ; 252 12c56: 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++) 12c58: f6 e0 ldi r31, 0x06 ; 6 12c5a: 04 37 cpi r16, 0x74 ; 116 12c5c: 1f 07 cpc r17, r31 12c5e: 09 f0 breq .+2 ; 0x12c62 12c60: ad cf rjmp .-166 ; 0x12bbc 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]); 12c62: 60 91 28 07 lds r22, 0x0728 ; 0x800728 12c66: 70 e0 ldi r23, 0x00 ; 0 12c68: 80 e0 ldi r24, 0x00 ; 0 12c6a: 0f 94 ad 3a call 0x2755a ; 0x2755a tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12c6e: 60 91 29 07 lds r22, 0x0729 ; 0x800729 12c72: 70 e0 ldi r23, 0x00 ; 0 12c74: 81 e0 ldi r24, 0x01 ; 1 12c76: 0f 94 ad 3a call 0x2755a ; 0x2755a tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 12c7a: 60 91 2a 07 lds r22, 0x072A ; 0x80072a 12c7e: 70 e0 ldi r23, 0x00 ; 0 12c80: 82 e0 ldi r24, 0x02 ; 2 12c82: 0f 94 ad 3a call 0x2755a ; 0x2755a tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 12c86: 60 91 2b 07 lds r22, 0x072B ; 0x80072b 12c8a: 70 e0 ldi r23, 0x00 ; 0 12c8c: 83 e0 ldi r24, 0x03 ; 3 12c8e: 0f 94 ad 3a call 0x2755a ; 0x2755a #endif //TMC2130 reset_acceleration_rates(); 12c92: 0f 94 7d aa call 0x354fa ; 0x354fa // Call updatePID (similar to when we have processed M301) updatePID(); 12c96: 0f 94 0f 51 call 0x2a21e ; 0x2a21e } 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; 12c9a: ce 01 movw r24, r28 12c9c: 01 96 adiw r24, 0x01 ; 1 12c9e: 0f 94 d6 47 call 0x28fac ; 0x28fac // 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)); 12ca2: 44 e3 ldi r20, 0x34 ; 52 12ca4: 50 e8 ldi r21, 0x80 ; 128 12ca6: 67 eb ldi r22, 0xB7 ; 183 12ca8: 7a eb ldi r23, 0xBA ; 186 12caa: 82 ea ldi r24, 0xA2 ; 162 12cac: 9c e0 ldi r25, 0x0C ; 12 12cae: 0e 94 d4 64 call 0xc9a8 ; 0xc9a8 eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12cb2: 46 e6 ldi r20, 0x66 ; 102 12cb4: 56 e6 ldi r21, 0x66 ; 102 12cb6: 66 e8 ldi r22, 0x86 ; 134 12cb8: 7f e3 ldi r23, 0x3F ; 63 12cba: 8e e9 ldi r24, 0x9E ; 158 12cbc: 9c e0 ldi r25, 0x0C ; 12 12cbe: 0e 94 d4 64 call 0xc9a8 ; 0xc9a8 eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 12cc2: 4a e9 ldi r20, 0x9A ; 154 12cc4: 59 e9 ldi r21, 0x99 ; 153 12cc6: 69 e1 ldi r22, 0x19 ; 25 12cc8: 7e e3 ldi r23, 0x3E ; 62 12cca: 8a e9 ldi r24, 0x9A ; 154 12ccc: 9c e0 ldi r25, 0x0C ; 12 12cce: 0e 94 d4 64 call 0xc9a8 ; 0xc9a8 eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 12cd2: 6e e0 ldi r22, 0x0E ; 14 12cd4: 71 e0 ldi r23, 0x01 ; 1 12cd6: 88 e9 ldi r24, 0x98 ; 152 12cd8: 9c e0 ldi r25, 0x0C ; 12 12cda: 0e 94 74 77 call 0xeee8 ; 0xeee8 eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 12cde: 61 e0 ldi r22, 0x01 ; 1 12ce0: 87 e9 ldi r24, 0x97 ; 151 12ce2: 9c e0 ldi r25, 0x0C ; 12 12ce4: 0e 94 8c 77 call 0xef18 ; 0xef18 thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 12ce8: 82 e0 ldi r24, 0x02 ; 2 12cea: 9d e0 ldi r25, 0x0D ; 13 12cec: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 12cf0: 91 e0 ldi r25, 0x01 ; 1 12cf2: 81 11 cpse r24, r1 12cf4: 01 c0 rjmp .+2 ; 0x12cf8 12cf6: 90 e0 ldi r25, 0x00 ; 0 12cf8: 90 93 1e 05 sts 0x051E, r25 ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> thermal_model::data.P = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_P); 12cfc: 8e ef ldi r24, 0xFE ; 254 12cfe: 9c e0 ldi r25, 0x0C ; 12 12d00: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12d04: 60 93 b6 12 sts 0x12B6, r22 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 12d08: 70 93 b7 12 sts 0x12B7, r23 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 12d0c: 80 93 b8 12 sts 0x12B8, r24 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 12d10: 90 93 b9 12 sts 0x12B9, r25 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> thermal_model::data.U = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_U); 12d14: 82 ea ldi r24, 0xA2 ; 162 12d16: 9c e0 ldi r25, 0x0C ; 12 12d18: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12d1c: 60 93 ba 12 sts 0x12BA, r22 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 12d20: 70 93 bb 12 sts 0x12BB, r23 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 12d24: 80 93 bc 12 sts 0x12BC, r24 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 12d28: 90 93 bd 12 sts 0x12BD, r25 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> thermal_model::data.V = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_V); 12d2c: 8e e9 ldi r24, 0x9E ; 158 12d2e: 9c e0 ldi r25, 0x0C ; 12 12d30: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12d34: 60 93 be 12 sts 0x12BE, r22 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 12d38: 70 93 bf 12 sts 0x12BF, r23 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 12d3c: 80 93 c0 12 sts 0x12C0, r24 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 12d40: 90 93 c1 12 sts 0x12C1, r25 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> thermal_model::data.C = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_C); 12d44: 8a ef ldi r24, 0xFA ; 250 12d46: 9c e0 ldi r25, 0x0C ; 12 12d48: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12d4c: 60 93 c2 12 sts 0x12C2, r22 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 12d50: 70 93 c3 12 sts 0x12C3, r23 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 12d54: 80 93 c4 12 sts 0x12C4, r24 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 12d58: 90 93 c5 12 sts 0x12C5, r25 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> thermal_model::data.fS = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_D); 12d5c: 8a e9 ldi r24, 0x9A ; 154 12d5e: 9c e0 ldi r25, 0x0C ; 12 12d60: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12d64: 60 93 c6 12 sts 0x12C6, r22 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 12d68: 70 93 c7 12 sts 0x12C7, r23 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 12d6c: 80 93 c8 12 sts 0x12C8, r24 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 12d70: 90 93 c9 12 sts 0x12C9, r25 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> thermal_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_THERMAL_MODEL_L)); 12d74: 88 e9 ldi r24, 0x98 ; 152 12d76: 9c e0 ldi r25, 0x0C ; 12 12d78: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 12d7c: 0f 94 b9 44 call 0x28972 ; 0x28972 eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12d80: 40 e4 ldi r20, 0x40 ; 64 12d82: 50 e0 ldi r21, 0x00 ; 0 12d84: 6a eb ldi r22, 0xBA ; 186 12d86: 7c e0 ldi r23, 0x0C ; 12 12d88: 8c ec ldi r24, 0xCC ; 204 12d8a: 92 e1 ldi r25, 0x12 ; 18 12d8c: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12d90: 86 eb ldi r24, 0xB6 ; 182 12d92: 9c e0 ldi r25, 0x0C ; 12 12d94: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12d98: 60 93 0c 13 sts 0x130C, r22 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 12d9c: 70 93 0d 13 sts 0x130D, r23 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 12da0: 80 93 0e 13 sts 0x130E, r24 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 12da4: 90 93 0f 13 sts 0x130F, r25 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> thermal_model::data.warn = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_W); 12da8: 82 eb ldi r24, 0xB2 ; 178 12daa: 9c e0 ldi r25, 0x0C ; 12 12dac: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12db0: 60 93 10 13 sts 0x1310, r22 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 12db4: 70 93 11 13 sts 0x1311, r23 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 12db8: 80 93 12 13 sts 0x1312, r24 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 12dbc: 90 93 13 13 sts 0x1313, r25 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::data.err = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_E); 12dc0: 8e ea ldi r24, 0xAE ; 174 12dc2: 9c e0 ldi r25, 0x0C ; 12 12dc4: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12dc8: 60 93 14 13 sts 0x1314, r22 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 12dcc: 70 93 15 13 sts 0x1315, r23 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 12dd0: 80 93 16 13 sts 0x1316, r24 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 12dd4: 90 93 17 13 sts 0x1317, r25 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> if(!thermal_model::calibrated()) { 12dd8: 0f 94 d8 44 call 0x289b0 ; 0x289b0 12ddc: 81 11 cpse r24, r1 12dde: 06 c0 rjmp .+12 ; 0x12dec SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 12de0: 87 e5 ldi r24, 0x57 ; 87 12de2: 98 e7 ldi r25, 0x78 ; 120 12de4: 0e 94 fe 7a call 0xf5fc ; 0xf5fc thermal_model_reset_settings(); 12de8: 0f 94 e4 47 call 0x28fc8 ; 0x28fc8 } thermal_model::setup(); 12dec: 0f 94 40 45 call 0x28a80 ; 0x28a80 } 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; 12df0: ce 01 movw r24, r28 12df2: 01 96 adiw r24, 0x01 ; 1 12df4: 0f 94 c9 47 call 0x28f92 ; 0x28f92 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 12df8: 82 ee ldi r24, 0xE2 ; 226 12dfa: 99 ea ldi r25, 0xA9 ; 169 12dfc: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM("Stored settings retrieved"); 12e00: 81 e8 ldi r24, 0x81 ; 129 12e02: 98 e7 ldi r25, 0x78 ; 120 12e04: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 12e08: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 12e0a: 0f 90 pop r0 12e0c: df 91 pop r29 12e0e: cf 91 pop r28 12e10: 1f 91 pop r17 12e12: 0f 91 pop r16 12e14: ff 90 pop r15 12e16: ef 90 pop r14 12e18: bf 90 pop r11 12e1a: af 90 pop r10 12e1c: 9f 90 pop r9 12e1e: 8f 90 pop r8 12e20: 7f 90 pop r7 12e22: 6f 90 pop r6 12e24: 5f 90 pop r5 12e26: 4f 90 pop r4 12e28: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 12e2a: 0e 94 af 83 call 0x1075e ; 0x1075e //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))) { 12e2e: 64 e0 ldi r22, 0x04 ; 4 12e30: 70 e0 ldi r23, 0x00 ; 0 12e32: 84 e1 ldi r24, 0x14 ; 20 12e34: 90 e0 ldi r25, 0x00 ; 0 12e36: 0e 94 59 5c call 0xb8b2 ; 0xb8b2 12e3a: 91 e0 ldi r25, 0x01 ; 1 12e3c: 89 27 eor r24, r25 12e3e: e5 cf rjmp .-54 ; 0x12e0a 00012e40 : 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() 12e40: 2f 92 push r2 12e42: 3f 92 push r3 12e44: 4f 92 push r4 12e46: 5f 92 push r5 12e48: 6f 92 push r6 12e4a: 7f 92 push r7 12e4c: 8f 92 push r8 12e4e: 9f 92 push r9 12e50: af 92 push r10 12e52: bf 92 push r11 12e54: cf 92 push r12 12e56: df 92 push r13 12e58: ef 92 push r14 12e5a: ff 92 push r15 12e5c: 0f 93 push r16 12e5e: 1f 93 push r17 12e60: cf 93 push r28 12e62: df 93 push r29 12e64: cd b7 in r28, 0x3d ; 61 12e66: de b7 in r29, 0x3e ; 62 12e68: cf 58 subi r28, 0x8F ; 143 12e6a: d1 09 sbc r29, r1 12e6c: 0f b6 in r0, 0x3f ; 63 12e6e: f8 94 cli 12e70: de bf out 0x3e, r29 ; 62 12e72: 0f be out 0x3f, r0 ; 63 12e74: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12e76: 82 e0 ldi r24, 0x02 ; 2 12e78: 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) 12e7c: a0 90 6e 12 lds r10, 0x126E ; 0x80126e 12e80: b0 90 6f 12 lds r11, 0x126F ; 0x80126f 12e84: 85 01 movw r16, r10 12e86: 0c 57 subi r16, 0x7C ; 124 12e88: 1f 4e sbci r17, 0xEF ; 239 12e8a: 46 e0 ldi r20, 0x06 ; 6 12e8c: 50 e0 ldi r21, 0x00 ; 0 12e8e: 6e eb ldi r22, 0xBE ; 190 12e90: 79 e8 ldi r23, 0x89 ; 137 12e92: c8 01 movw r24, r16 12e94: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 12e98: 89 2b or r24, r25 12e9a: 09 f0 breq .+2 ; 0x12e9e 12e9c: b8 c0 rjmp .+368 ; 0x1300e { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12e9e: 8f ea ldi r24, 0xAF ; 175 12ea0: 99 e8 ldi r25, 0x89 ; 137 12ea2: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 12ea6: 88 23 and r24, r24 12ea8: 09 f4 brne .+2 ; 0x12eac 12eaa: 91 c0 rjmp .+290 ; 0x12fce { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12eac: 88 e5 ldi r24, 0x58 ; 88 12eae: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 12eb2: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12eb4: 89 e5 ldi r24, 0x59 ; 89 12eb6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 12eba: 81 11 cpse r24, r1 12ebc: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12ebe: 0f 94 24 59 call 0x2b248 ; 0x2b248 static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12ec2: 1a 82 std Y+2, r1 ; 0x02 12ec4: 19 82 std Y+1, r1 ; 0x01 12ec6: fe 01 movw r30, r28 12ec8: 33 96 adiw r30, 0x03 ; 3 12eca: 83 e1 ldi r24, 0x13 ; 19 12ecc: df 01 movw r26, r30 12ece: 1d 92 st X+, r1 12ed0: 8a 95 dec r24 12ed2: e9 f7 brne .-6 ; 0x12ece if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12ed4: 48 ec ldi r20, 0xC8 ; 200 12ed6: 5f ea ldi r21, 0xAF ; 175 12ed8: 60 e0 ldi r22, 0x00 ; 0 12eda: 70 e0 ldi r23, 0x00 ; 0 12edc: 85 e7 ldi r24, 0x75 ; 117 12ede: 93 e0 ldi r25, 0x03 ; 3 12ee0: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 12ee4: 81 11 cpse r24, r1 crashDet_counter = 0; 12ee6: 10 92 74 03 sts 0x0374, r1 ; 0x800374 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 12eea: 00 91 74 03 lds r16, 0x0374 ; 0x800374 12eee: 0f 5f subi r16, 0xFF ; 255 12ef0: 00 93 74 03 sts 0x0374, r16 ; 0x800374 automatic_recovery_after_crash = false; } crashDetTimer.start(); 12ef4: 85 e7 ldi r24, 0x75 ; 117 12ef6: 93 e0 ldi r25, 0x03 ; 3 12ef8: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> crashDet_axes |= mask; 12efc: 80 91 73 03 lds r24, 0x0373 ; 0x800373 12f00: 81 2b or r24, r17 12f02: 80 93 73 03 sts 0x0373, r24 ; 0x800373 if (mask & X_AXIS_MASK) { 12f06: 10 ff sbrs r17, 0 12f08: 08 c0 rjmp .+16 ; 0x12f1a eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 12f0a: 86 e6 ldi r24, 0x66 ; 102 12f0c: 9f e0 ldi r25, 0x0F ; 15 12f0e: 0e 94 ab 77 call 0xef56 ; 0xef56 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 12f12: 85 e0 ldi r24, 0x05 ; 5 12f14: 9f e0 ldi r25, 0x0F ; 15 12f16: 0e 94 9e 77 call 0xef3c ; 0xef3c } if (mask & Y_AXIS_MASK) { 12f1a: 11 ff sbrs r17, 1 12f1c: 08 c0 rjmp .+16 ; 0x12f2e eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 12f1e: 88 e6 ldi r24, 0x68 ; 104 12f20: 9f e0 ldi r25, 0x0F ; 15 12f22: 0e 94 ab 77 call 0xef56 ; 0xef56 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 12f26: 83 e0 ldi r24, 0x03 ; 3 12f28: 9f e0 ldi r25, 0x0F ; 15 12f2a: 0e 94 9e 77 call 0xef3c ; 0xef3c } lcd_update_enable(true); 12f2e: 81 e0 ldi r24, 0x01 ; 1 12f30: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_update(2); 12f34: 82 e0 ldi r24, 0x02 ; 2 12f36: 0e 94 54 6f call 0xdea8 ; 0xdea8 // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 12f3a: 61 2f mov r22, r17 12f3c: ce 01 movw r24, r28 12f3e: 01 96 adiw r24, 0x01 ; 1 12f40: 0e 94 b6 74 call 0xe96c ; 0xe96c lcd_setstatus(msg); 12f44: ce 01 movw r24, r28 12f46: 01 96 adiw r24, 0x01 ; 1 12f48: 0f 94 4e 15 call 0x22a9c ; 0x22a9c gcode_G28(true, true, false); //home X and Y 12f4c: 40 e0 ldi r20, 0x00 ; 0 12f4e: 61 e0 ldi r22, 0x01 ; 1 12f50: 81 e0 ldi r24, 0x01 ; 1 12f52: 0e 94 88 80 call 0x10110 ; 0x10110 if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 12f56: 61 e0 ldi r22, 0x01 ; 1 12f58: 82 e4 ldi r24, 0x42 ; 66 12f5a: 96 e8 ldi r25, 0x86 ; 134 crashdet_fmt_error(msg, mask); lcd_setstatus(msg); gcode_G28(true, true, false); //home X and Y if (automatic_recovery_after_crash) { 12f5c: 03 30 cpi r16, 0x03 ; 3 12f5e: 60 f1 brcs .+88 ; 0x12fb8 12f60: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 12f64: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 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); 12f68: 80 e0 ldi r24, 0x00 ; 0 12f6a: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_clear(); 12f6e: 0e 94 c0 6f call 0xdf80 ; 0xdf80 crashdet_fmt_error(msg, crashDet_axes); 12f72: 60 91 73 03 lds r22, 0x0373 ; 0x800373 12f76: ce 01 movw r24, r28 12f78: 01 96 adiw r24, 0x01 ; 1 12f7a: 0e 94 b6 74 call 0xe96c ; 0xe96c crashDet_axes = 0; 12f7e: 10 92 73 03 sts 0x0373, r1 ; 0x800373 lcd_print(msg); 12f82: ce 01 movw r24, r28 12f84: 01 96 adiw r24, 0x01 ; 1 12f86: 0e 94 94 71 call 0xe328 ; 0xe328 // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 12f8a: 81 e2 ldi r24, 0x21 ; 33 12f8c: 9c e3 ldi r25, 0x3C ; 60 12f8e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 12f92: ac 01 movw r20, r24 12f94: 61 e0 ldi r22, 0x01 ; 1 12f96: 80 e0 ldi r24, 0x00 ; 0 12f98: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_putc('?'); 12f9c: 8f e3 ldi r24, 0x3F ; 63 12f9e: 0e 94 7c 6f call 0xdef8 ; 0xdef8 //! @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); 12fa2: 40 e0 ldi r20, 0x00 ; 0 12fa4: 60 e0 ldi r22, 0x00 ; 0 12fa6: 90 e0 ldi r25, 0x00 ; 0 12fa8: 80 e0 ldi r24, 0x00 ; 0 12faa: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 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")); 12fae: 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) 12fb0: 81 11 cpse r24, r1 12fb2: 0a c0 rjmp .+20 ; 0x12fc8 { enquecommand_P(PSTR("CRASH_RECOVER")); 12fb4: 84 e3 ldi r24, 0x34 ; 52 12fb6: 96 e8 ldi r25, 0x86 ; 134 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12fb8: 0e 94 43 89 call 0x11286 ; 0x11286 SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 12fbc: 81 e0 ldi r24, 0x01 ; 1 12fbe: 80 93 96 02 sts 0x0296, r24 ; 0x800296 ClearToSend(); 12fc2: 0e 94 ad 80 call 0x1015a ; 0x1015a 12fc6: 5e c3 rjmp .+1724 ; 0x13684 { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12fc8: 87 e2 ldi r24, 0x27 ; 39 12fca: 96 e8 ldi r25, 0x86 ; 134 12fcc: f5 cf rjmp .-22 ; 0x12fb8 crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 12fce: 81 ea ldi r24, 0xA1 ; 161 12fd0: 99 e8 ldi r25, 0x89 ; 137 12fd2: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 12fd6: 88 23 and r24, r24 12fd8: 69 f0 breq .+26 ; 0x12ff4 } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 12fda: 0e 94 32 68 call 0xd064 ; 0xd064 12fde: 81 11 cpse r24, r1 12fe0: 06 c0 rjmp .+12 ; 0x12fee 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 12fe2: 60 e0 ldi r22, 0x00 ; 0 12fe4: 70 e0 ldi r23, 0x00 ; 0 12fe6: 80 e8 ldi r24, 0x80 ; 128 12fe8: 9f e3 ldi r25, 0x3F ; 63 12fea: 0e 94 f1 68 call 0xd1e2 ; 0xd1e2 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 12fee: 0f 94 08 3c call 0x27810 ; 0x27810 12ff2: e4 cf rjmp .-56 ; 0x12fbc else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 12ff4: 84 e9 ldi r24, 0x94 ; 148 12ff6: 99 e8 ldi r25, 0x89 ; 137 12ff8: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 12ffc: 88 23 and r24, r24 12ffe: f1 f2 breq .-68 ; 0x12fbc } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 13000: 0f 94 08 3c call 0x27810 ; 0x27810 // Abort the print print_stop(); 13004: 60 e0 ldi r22, 0x00 ; 0 13006: 80 e0 ldi r24, 0x00 ; 0 13008: 0f 94 0f 16 call 0x22c1e ; 0x22c1e 1300c: d7 cf rjmp .-82 ; 0x12fbc // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 1300e: 44 e0 ldi r20, 0x04 ; 4 13010: 50 e0 ldi r21, 0x00 ; 0 13012: 6f e8 ldi r22, 0x8F ; 143 13014: 79 e8 ldi r23, 0x89 ; 137 13016: c8 01 movw r24, r16 13018: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 1301c: 89 2b or r24, r25 1301e: 09 f0 breq .+2 ; 0x13022 13020: fc c0 rjmp .+504 ; 0x1321a { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 13022: 85 01 movw r16, r10 13024: 08 57 subi r16, 0x78 ; 120 13026: 1f 4e sbci r17, 0xEF ; 239 13028: 49 e0 ldi r20, 0x09 ; 9 1302a: 50 e0 ldi r21, 0x00 ; 0 1302c: 65 e8 ldi r22, 0x85 ; 133 1302e: 79 e8 ldi r23, 0x89 ; 137 13030: c8 01 movw r24, r16 13032: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 13036: 89 2b or r24, r25 13038: c9 f4 brne .+50 ; 0x1306c { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1303a: f5 01 movw r30, r10 1303c: ef 56 subi r30, 0x6F ; 111 1303e: ff 4e sbci r31, 0xEF ; 239 13040: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 13042: 15 34 cpi r17, 0x45 ; 69 13044: 89 f0 breq .+34 ; 0x13068 13046: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 13048: 14 30 cpi r17, 0x04 ; 4 1304a: 08 f0 brcs .+2 ; 0x1304e 1304c: b7 cf rjmp .-146 ; 0x12fbc { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 1304e: 4a e0 ldi r20, 0x0A ; 10 13050: 50 e0 ldi r21, 0x00 ; 0 13052: 70 e0 ldi r23, 0x00 ; 0 13054: 60 e0 ldi r22, 0x00 ; 0 13056: c5 01 movw r24, r10 13058: 8e 56 subi r24, 0x6E ; 110 1305a: 9f 4e sbci r25, 0xEF ; 239 1305c: 0f 94 14 d9 call 0x3b228 ; 0x3b228 tmc2130_set_wave(axis, 247, fac); 13060: 81 2f mov r24, r17 13062: 0f 94 56 88 call 0x310ac ; 0x310ac 13066: aa cf rjmp .-172 ; 0x12fbc // ### 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'); 13068: 13 e0 ldi r17, 0x03 ; 3 1306a: f1 cf rjmp .-30 ; 0x1304e } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 1306c: 49 e0 ldi r20, 0x09 ; 9 1306e: 50 e0 ldi r21, 0x00 ; 0 13070: 6b e7 ldi r22, 0x7B ; 123 13072: 79 e8 ldi r23, 0x89 ; 137 13074: c8 01 movw r24, r16 13076: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 1307a: 89 2b or r24, r25 1307c: 51 f5 brne .+84 ; 0x130d2 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1307e: f5 01 movw r30, r10 13080: ef 56 subi r30, 0x6F ; 111 13082: ff 4e sbci r31, 0xEF ; 239 13084: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 13086: 15 34 cpi r17, 0x45 ; 69 13088: 11 f1 breq .+68 ; 0x130ce 1308a: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 1308c: 14 30 cpi r17, 0x04 ; 4 1308e: 08 f0 brcs .+2 ; 0x13092 13090: 95 cf rjmp .-214 ; 0x12fbc { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 13092: 4a e0 ldi r20, 0x0A ; 10 13094: 50 e0 ldi r21, 0x00 ; 0 13096: 70 e0 ldi r23, 0x00 ; 0 13098: 60 e0 ldi r22, 0x00 ; 0 1309a: c5 01 movw r24, r10 1309c: 8e 56 subi r24, 0x6E ; 110 1309e: 9f 4e sbci r25, 0xEF ; 239 130a0: 0f 94 14 d9 call 0x3b228 ; 0x3b228 130a4: e1 2f mov r30, r17 130a6: f0 e0 ldi r31, 0x00 ; 0 130a8: ea 50 subi r30, 0x0A ; 10 130aa: fb 4f sbci r31, 0xFB ; 251 130ac: 80 81 ld r24, Z 130ae: 40 e0 ldi r20, 0x00 ; 0 130b0: 51 e0 ldi r21, 0x01 ; 1 130b2: 02 c0 rjmp .+4 ; 0x130b8 130b4: 56 95 lsr r21 130b6: 47 95 ror r20 130b8: 8a 95 dec r24 130ba: e2 f7 brpl .-8 ; 0x130b4 uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 130bc: 84 2f mov r24, r20 130be: 88 0f add r24, r24 130c0: 88 0f add r24, r24 130c2: 81 50 subi r24, 0x01 ; 1 130c4: 68 23 and r22, r24 130c6: 81 2f mov r24, r17 130c8: 0f 94 6d 8b call 0x316da ; 0x316da 130cc: 77 cf rjmp .-274 ; 0x12fbc // ### 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'); 130ce: 13 e0 ldi r17, 0x03 ; 3 130d0: e0 cf rjmp .-64 ; 0x13092 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 130d2: 49 e0 ldi r20, 0x09 ; 9 130d4: 50 e0 ldi r21, 0x00 ; 0 130d6: 61 e7 ldi r22, 0x71 ; 113 130d8: 79 e8 ldi r23, 0x89 ; 137 130da: c8 01 movw r24, r16 130dc: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 130e0: 89 2b or r24, r25 130e2: 09 f0 breq .+2 ; 0x130e6 130e4: 6b cf rjmp .-298 ; 0x12fbc { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 130e6: f5 01 movw r30, r10 130e8: ef 56 subi r30, 0x6F ; 111 130ea: ff 4e sbci r31, 0xEF ; 239 130ec: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 130ee: 85 34 cpi r24, 0x45 ; 69 130f0: 09 f4 brne .+2 ; 0x130f4 130f2: 90 c0 rjmp .+288 ; 0x13214 130f4: 18 ea ldi r17, 0xA8 ; 168 130f6: c1 2e mov r12, r17 130f8: c8 0e add r12, r24 if (axis < 4) 130fa: b3 e0 ldi r27, 0x03 ; 3 130fc: bc 15 cp r27, r12 130fe: 08 f4 brcc .+2 ; 0x13102 13100: 5d cf rjmp .-326 ; 0x12fbc { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 13102: ec 2c mov r14, r12 13104: f1 2c mov r15, r1 13106: 47 01 movw r8, r14 13108: 88 0c add r8, r8 1310a: 99 1c adc r9, r9 1310c: f4 01 movw r30, r8 1310e: e3 58 subi r30, 0x83 ; 131 13110: fd 4f sbci r31, 0xFD ; 253 13112: 00 81 ld r16, Z 13114: 20 2f mov r18, r16 13116: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 13118: 10 2f mov r17, r16 1311a: 12 95 swap r17 1311c: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 1311e: 00 1f adc r16, r16 13120: 00 27 eor r16, r16 13122: 00 1f adc r16, r16 13124: 61 81 ldd r22, Z+1 ; 0x01 13126: 67 70 andi r22, 0x07 ; 7 13128: 66 0f add r22, r22 1312a: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 1312c: f4 01 movw r30, r8 1312e: e2 58 subi r30, 0x82 ; 130 13130: fd 4f sbci r31, 0xFD ; 253 13132: d0 80 ld r13, Z 13134: d6 94 lsr r13 13136: d6 94 lsr r13 13138: d6 94 lsr r13 1313a: ed 2d mov r30, r13 1313c: e3 70 andi r30, 0x03 ; 3 1313e: de 2e mov r13, r30 char* str_end = 0; 13140: 1a 82 std Y+2, r1 ; 0x02 13142: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 13144: c5 01 movw r24, r10 13146: 8e 56 subi r24, 0x6E ; 110 13148: 9f 4e sbci r25, 0xEF ; 239 1314a: dc 01 movw r26, r24 1314c: 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; 1314e: 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]) 13150: 33 23 and r19, r19 13152: e1 f1 breq .+120 ; 0x131cc { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 13154: 4a e0 ldi r20, 0x0A ; 10 13156: 50 e0 ldi r21, 0x00 ; 0 13158: be 01 movw r22, r28 1315a: 6f 5f subi r22, 0xFF ; 255 1315c: 7f 4f sbci r23, 0xFF ; 255 1315e: 0f 94 14 d9 call 0x3b228 ; 0x3b228 13162: 6f 70 andi r22, 0x0F ; 15 13164: b6 2e mov r11, r22 if (str_end && *str_end) 13166: 89 81 ldd r24, Y+1 ; 0x01 13168: 9a 81 ldd r25, Y+2 ; 0x02 1316a: 00 97 sbiw r24, 0x00 ; 0 1316c: 79 f1 breq .+94 ; 0x131cc 1316e: fc 01 movw r30, r24 13170: 20 81 ld r18, Z 13172: 22 23 and r18, r18 13174: 59 f1 breq .+86 ; 0x131cc { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 13176: 4a e0 ldi r20, 0x0A ; 10 13178: 50 e0 ldi r21, 0x00 ; 0 1317a: be 01 movw r22, r28 1317c: 6f 5f subi r22, 0xFF ; 255 1317e: 7f 4f sbci r23, 0xFF ; 255 13180: 0f 94 14 d9 call 0x3b228 ; 0x3b228 13184: 16 2f mov r17, r22 13186: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 13188: 89 81 ldd r24, Y+1 ; 0x01 1318a: 9a 81 ldd r25, Y+2 ; 0x02 1318c: 00 97 sbiw r24, 0x00 ; 0 1318e: f1 f0 breq .+60 ; 0x131cc 13190: dc 01 movw r26, r24 13192: 2c 91 ld r18, X 13194: 22 23 and r18, r18 13196: d1 f0 breq .+52 ; 0x131cc { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 13198: 4a e0 ldi r20, 0x0A ; 10 1319a: 50 e0 ldi r21, 0x00 ; 0 1319c: be 01 movw r22, r28 1319e: 6f 5f subi r22, 0xFF ; 255 131a0: 7f 4f sbci r23, 0xFF ; 255 131a2: 0f 94 14 d9 call 0x3b228 ; 0x3b228 131a6: 06 2f mov r16, r22 131a8: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 131aa: 89 81 ldd r24, Y+1 ; 0x01 131ac: 9a 81 ldd r25, Y+2 ; 0x02 131ae: 00 97 sbiw r24, 0x00 ; 0 131b0: 69 f0 breq .+26 ; 0x131cc 131b2: fc 01 movw r30, r24 131b4: 20 81 ld r18, Z 131b6: 22 23 and r18, r18 131b8: 49 f0 breq .+18 ; 0x131cc chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 131ba: 4a e0 ldi r20, 0x0A ; 10 131bc: 50 e0 ldi r21, 0x00 ; 0 131be: be 01 movw r22, r28 131c0: 6f 5f subi r22, 0xFF ; 255 131c2: 7f 4f sbci r23, 0xFF ; 255 131c4: 0f 94 14 d9 call 0x3b228 ; 0x3b228 131c8: 63 70 andi r22, 0x03 ; 3 131ca: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 131cc: f4 01 movw r30, r8 131ce: e3 58 subi r30, 0x83 ; 131 131d0: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 131d2: 17 70 andi r17, 0x07 ; 7 131d4: 12 95 swap r17 131d6: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 131d8: 60 2f mov r22, r16 131da: 67 95 ror r22 131dc: 66 27 eor r22, r22 131de: 67 95 ror r22 131e0: 1b 29 or r17, r11 131e2: 16 2b or r17, r22 131e4: 10 83 st Z, r17 131e6: 60 2f mov r22, r16 131e8: 66 95 lsr r22 131ea: 01 81 ldd r16, Z+1 ; 0x01 131ec: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 131ee: 2d 2d mov r18, r13 131f0: 23 70 andi r18, 0x03 ; 3 131f2: d2 2e mov r13, r18 131f4: dd 0c add r13, r13 131f6: dd 0c add r13, r13 131f8: dd 0c add r13, r13 131fa: 06 2b or r16, r22 131fc: d0 2a or r13, r16 131fe: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 13200: f7 01 movw r30, r14 13202: ea 50 subi r30, 0x0A ; 10 13204: fb 4f sbci r31, 0xFB ; 251 13206: 50 e0 ldi r21, 0x00 ; 0 13208: 40 e0 ldi r20, 0x00 ; 0 1320a: 60 81 ld r22, Z 1320c: 8c 2d mov r24, r12 1320e: 0f 94 42 3a call 0x27484 ; 0x27484 13212: d4 ce rjmp .-600 ; 0x12fbc // ### 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'); 13214: b3 e0 ldi r27, 0x03 ; 3 13216: cb 2e mov r12, r27 13218: 74 cf rjmp .-280 ; 0x13102 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) { 1321a: 45 e0 ldi r20, 0x05 ; 5 1321c: 50 e0 ldi r21, 0x00 ; 0 1321e: 6b e6 ldi r22, 0x6B ; 107 13220: 79 e8 ldi r23, 0x89 ; 137 13222: c8 01 movw r24, r16 13224: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 13228: 89 2b or r24, r25 1322a: 09 f0 breq .+2 ; 0x1322e 1322c: 64 c1 rjmp .+712 ; 0x134f6 - `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"))) { 1322e: 81 e6 ldi r24, 0x61 ; 97 13230: 99 e8 ldi r25, 0x89 ; 137 13232: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 13236: 88 23 and r24, r24 13238: 09 f4 brne .+2 ; 0x1323c 1323a: 3c c0 rjmp .+120 ; 0x132b4 //! 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 1323c: 10 92 34 05 sts 0x0534, r1 ; 0x800534 13240: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 13242: c1 2c mov r12, r1 13244: d1 2c mov r13, r1 13246: 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); 13248: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 1324a: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 1324c: 64 e1 ldi r22, 0x14 ; 20 1324e: 70 e0 ldi r23, 0x00 ; 0 13250: 80 e0 ldi r24, 0x00 ; 0 13252: 90 e0 ldi r25, 0x00 ; 0 13254: 0f 94 8a 3d call 0x27b14 ; 0x27b14 unsigned long tachMeasure = _micros(); 13258: 0f 94 64 3d call 0x27ac8 ; 0x27ac8 1325c: 4b 01 movw r8, r22 1325e: 5c 01 movw r10, r24 cli(); 13260: f8 94 cli SET_INPUT(TACH_1); 13262: 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 ) ; 13264: 67 9b sbis 0x0c, 7 ; 12 13266: fe cf rjmp .-4 ; 0x13264 sei(); 13268: 78 94 sei tachMeasure = _micros() - tachMeasure; 1326a: 0f 94 64 3d call 0x27ac8 ; 0x27ac8 1326e: dc 01 movw r26, r24 13270: cb 01 movw r24, r22 13272: 88 19 sub r24, r8 13274: 99 09 sbc r25, r9 13276: aa 09 sbc r26, r10 13278: bb 09 sbc r27, r11 1327a: c8 16 cp r12, r24 1327c: d9 06 cpc r13, r25 1327e: ea 06 cpc r14, r26 13280: fb 06 cpc r15, r27 13282: 10 f4 brcc .+4 ; 0x13288 13284: 6c 01 movw r12, r24 13286: 7d 01 movw r14, r26 13288: 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){ 1328a: f1 f6 brne .-68 ; 0x13248 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 "); 1328c: 8c e1 ldi r24, 0x1C ; 28 1328e: 96 e8 ldi r25, 0x86 ; 134 13290: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 13294: 88 e1 ldi r24, 0x18 ; 24 13296: 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 ){ 13298: 35 ef ldi r19, 0xF5 ; 245 1329a: c3 16 cp r12, r19 1329c: 31 e0 ldi r19, 0x01 ; 1 1329e: d3 06 cpc r13, r19 132a0: e1 04 cpc r14, r1 132a2: f1 04 cpc r15, r1 132a4: 10 f4 brcc .+4 ; 0x132aa // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 132a6: 85 e1 ldi r24, 0x15 ; 21 132a8: 96 e8 ldi r25, 0x86 ; 134 132aa: 0e 94 fe 7a call 0xf5fc ; 0xf5fc } // cleanup after the test function SET_INPUT(TACH_1); 132ae: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 132b0: 77 9a sbi 0x0e, 7 ; 14 132b2: 84 ce rjmp .-760 ; 0x12fbc */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 132b4: 8d e5 ldi r24, 0x5D ; 93 132b6: 99 e8 ldi r25, 0x89 ; 137 132b8: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 132bc: 88 23 and r24, r24 132be: 21 f1 breq .+72 ; 0x13308 printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 132c0: 40 91 b1 04 lds r20, 0x04B1 ; 0x8004b1 132c4: 50 91 b2 04 lds r21, 0x04B2 ; 0x8004b2 132c8: 2c e3 ldi r18, 0x3C ; 60 132ca: 24 9f mul r18, r20 132cc: c0 01 movw r24, r0 132ce: 25 9f mul r18, r21 132d0: 90 0d add r25, r0 132d2: 11 24 eor r1, r1 132d4: 9f 93 push r25 132d6: 8f 93 push r24 132d8: 40 91 af 04 lds r20, 0x04AF ; 0x8004af 132dc: 50 91 b0 04 lds r21, 0x04B0 ; 0x8004b0 132e0: 24 9f mul r18, r20 132e2: c0 01 movw r24, r0 132e4: 25 9f mul r18, r21 132e6: 90 0d add r25, r0 132e8: 11 24 eor r1, r1 132ea: 9f 93 push r25 132ec: 8f 93 push r24 132ee: 88 ec ldi r24, 0xC8 ; 200 132f0: 9a e6 ldi r25, 0x6A ; 106 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 132f2: 9f 93 push r25 132f4: 8f 93 push r24 132f6: 0f 94 4b dc call 0x3b896 ; 0x3b896 132fa: 0f 90 pop r0 132fc: 0f 90 pop r0 132fe: 0f 90 pop r0 13300: 0f 90 pop r0 13302: 0f 90 pop r0 13304: 0f 90 pop r0 13306: 5a ce rjmp .-844 ; 0x12fbc 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 13308: 88 e5 ldi r24, 0x58 ; 88 1330a: 99 e8 ldi r25, 0x89 ; 137 1330c: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 13310: 88 23 and r24, r24 13312: 11 f1 breq .+68 ; 0x13358 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 13314: 8c e8 ldi r24, 0x8C ; 140 13316: 9f e0 ldi r25, 0x0F ; 15 13318: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1331c: 81 11 cpse r24, r1 1331e: 10 c0 rjmp .+32 ; 0x13340 // M24 - Start SD print enquecommand_P(MSG_M24); 13320: 61 e0 ldi r22, 0x01 ; 1 13322: 88 ee ldi r24, 0xE8 ; 232 13324: 90 e7 ldi r25, 0x70 ; 112 13326: 0e 94 43 89 call 0x11286 ; 0x11286 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1332a: 60 e0 ldi r22, 0x00 ; 0 1332c: 85 ea ldi r24, 0xA5 ; 165 1332e: 9f e0 ldi r25, 0x0F ; 15 13330: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 13334: 60 e0 ldi r22, 0x00 ; 0 13336: 8f e7 ldi r24, 0x7F ; 127 13338: 9c e0 ldi r25, 0x0C ; 12 1333a: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 1333e: 3e ce rjmp .-900 ; 0x12fbc // 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) { 13340: 81 30 cpi r24, 0x01 ; 1 13342: 09 f0 breq .+2 ; 0x13346 13344: 3b ce rjmp .-906 ; 0x12fbc // 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(); 13346: 0f 94 c9 58 call 0x2b192 ; 0x2b192 usb_timer.start(); 1334a: 8f e0 ldi r24, 0x0F ; 15 1334c: 95 e0 ldi r25, 0x05 ; 5 1334e: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::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(); 13352: 0f 94 8f 3f call 0x27f1e ; 0x27f1e 13356: 32 ce rjmp .-924 ; 0x12fbc } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 13358: 81 e5 ldi r24, 0x51 ; 81 1335a: 99 e8 ldi r25, 0x89 ; 137 1335c: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 13360: 88 23 and r24, r24 13362: 21 f0 breq .+8 ; 0x1336c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 13364: 80 e0 ldi r24, 0x00 ; 0 13366: 0f 94 b4 1d call 0x23b68 ; 0x23b68 1336a: 28 ce rjmp .-944 ; 0x12fbc MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 1336c: 8b e4 ldi r24, 0x4B ; 75 1336e: 99 e8 ldi r25, 0x89 ; 137 13370: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 13374: 88 23 and r24, r24 13376: 51 f0 breq .+20 ; 0x1338c #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 13378: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e5> 1337c: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e6> 13380: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e7> 13384: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e8> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 13388: 0e 94 f9 67 call 0xcff2 ; 0xcff2 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 1338c: 88 e4 ldi r24, 0x48 ; 72 1338e: 99 e8 ldi r25, 0x89 ; 137 13390: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 13394: 88 23 and r24, r24 13396: a9 f0 breq .+42 ; 0x133c2 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 13398: 44 e1 ldi r20, 0x14 ; 20 1339a: 50 e0 ldi r21, 0x00 ; 0 1339c: 65 e1 ldi r22, 0x15 ; 21 1339e: 7d e0 ldi r23, 0x0D ; 13 133a0: ce 01 movw r24, r28 133a2: 01 96 adiw r24, 0x01 ; 1 133a4: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 if (SN[19]) 133a8: 8c 89 ldd r24, Y+20 ; 0x14 133aa: 88 23 and r24, r24 133ac: 29 f0 breq .+10 ; 0x133b8 puts_P(PSTR("SN invalid")); 133ae: 8d e3 ldi r24, 0x3D ; 61 133b0: 99 e8 ldi r25, 0x89 ; 137 133b2: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 133b6: 02 ce rjmp .-1020 ; 0x12fbc else puts(SN); 133b8: ce 01 movw r24, r28 133ba: 01 96 adiw r24, 0x01 ; 1 133bc: 0f 94 18 e4 call 0x3c830 ; 0x3c830 133c0: fd cd rjmp .-1030 ; 0x12fbc } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 133c2: 89 e3 ldi r24, 0x39 ; 57 133c4: 99 e8 ldi r25, 0x89 ; 137 133c6: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 133ca: 88 23 and r24, r24 133cc: 29 f0 breq .+10 ; 0x133d8 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 133ce: 8d e2 ldi r24, 0x2D ; 45 133d0: 99 e8 ldi r25, 0x89 ; 137 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 133d2: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 133d6: f2 cd rjmp .-1052 ; 0x12fbc 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 133d8: 89 e2 ldi r24, 0x29 ; 41 133da: 99 e8 ldi r25, 0x89 ; 137 133dc: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 133e0: 88 23 and r24, r24 133e2: 19 f0 breq .+6 ; 0x133ea SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 133e4: 8b e0 ldi r24, 0x0B ; 11 133e6: 99 e8 ldi r25, 0x89 ; 137 133e8: f4 cf rjmp .-24 ; 0x133d2 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 133ea: 86 e0 ldi r24, 0x06 ; 6 133ec: 99 e8 ldi r25, 0x89 ; 137 133ee: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 133f2: 88 23 and r24, r24 133f4: 19 f0 breq .+6 ; 0x133fc lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 133f6: 0e 94 d9 71 call 0xe3b2 ; 0xe3b2 133fa: e0 cd rjmp .-1088 ; 0x12fbc 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 133fc: 83 e0 ldi r24, 0x03 ; 3 133fe: 99 e8 ldi r25, 0x89 ; 137 13400: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 13404: 88 23 and r24, r24 13406: 79 f0 breq .+30 ; 0x13426 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 13408: 81 ea ldi r24, 0xA1 ; 161 1340a: 9d e0 ldi r25, 0x0D ; 13 1340c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 13410: 4b e0 ldi r20, 0x0B ; 11 13412: 84 9f mul r24, r20 13414: c0 01 movw r24, r0 13416: 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); 13418: 70 e0 ldi r23, 0x00 ; 0 1341a: 60 e0 ldi r22, 0x00 ; 0 1341c: 80 5b subi r24, 0xB0 ; 176 1341e: 92 4f sbci r25, 0xF2 ; 242 13420: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 13424: cb cd rjmp .-1130 ; 0x12fbc } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 13426: 80 e0 ldi r24, 0x00 ; 0 13428: 99 e8 ldi r25, 0x89 ; 137 1342a: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 1342e: 88 23 and r24, r24 13430: 51 f0 breq .+20 ; 0x13446 // 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(); 13432: 0e 94 c0 6f call 0xdf80 ; 0xdf80 Sound_MakeCustom(100,0,false); 13436: 40 e0 ldi r20, 0x00 ; 0 13438: 70 e0 ldi r23, 0x00 ; 0 1343a: 60 e0 ldi r22, 0x00 ; 0 1343c: 84 e6 ldi r24, 0x64 ; 100 1343e: 90 e0 ldi r25, 0x00 ; 0 13440: 0f 94 99 6a call 0x2d532 ; 0x2d532 13444: d8 cf rjmp .-80 ; 0x133f6 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 13446: 8c ef ldi r24, 0xFC ; 252 13448: 98 e8 ldi r25, 0x88 ; 136 1344a: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 1344e: 88 23 and r24, r24 13450: e1 f0 breq .+56 ; 0x1348a // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13452: 86 e5 ldi r24, 0x56 ; 86 13454: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 13458: 88 23 and r24, r24 1345a: 09 f4 brne .+2 ; 0x1345e 1345c: af cd rjmp .-1186 ; 0x12fbc bool value = code_value_short(); 1345e: 0e 94 13 5c call 0xb826 ; 0xb826 13462: 11 e0 ldi r17, 0x01 ; 1 13464: 89 2b or r24, r25 13466: 09 f4 brne .+2 ; 0x1346a 13468: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 1346a: 0f 94 24 59 call 0x2b248 ; 0x2b248 if(value != mbl.active) { 1346e: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 13472: 90 e0 ldi r25, 0x00 ; 0 13474: 18 17 cp r17, r24 13476: 19 06 cpc r1, r25 13478: 09 f4 brne .+2 ; 0x1347c 1347a: a0 cd rjmp .-1216 ; 0x12fbc mbl.active = value; 1347c: 10 93 9e 13 sts 0x139E, r17 ; 0x80139e // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 13480: 89 e4 ldi r24, 0x49 ; 73 13482: 97 e0 ldi r25, 0x07 ; 7 13484: 0f 94 0f ab call 0x3561e ; 0x3561e 13488: 99 cd rjmp .-1230 ; 0x12fbc } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 1348a: 85 ef ldi r24, 0xF5 ; 245 1348c: 98 e8 ldi r25, 0x88 ; 136 1348e: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 13492: 88 23 and r24, r24 13494: 09 f4 brne .+2 ; 0x13498 13496: 92 cd rjmp .-1244 ; 0x12fbc uint16_t nDiameter; if(code_seen('D')) { 13498: 84 e4 ldi r24, 0x44 ; 68 1349a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1349e: 88 23 and r24, r24 134a0: a1 f0 breq .+40 ; 0x134ca nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 134a2: 0e 94 4a 61 call 0xc294 ; 0xc294 134a6: 20 e0 ldi r18, 0x00 ; 0 134a8: 30 e0 ldi r19, 0x00 ; 0 134aa: 4a e7 ldi r20, 0x7A ; 122 134ac: 54 e4 ldi r21, 0x44 ; 68 134ae: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 134b2: 20 e0 ldi r18, 0x00 ; 0 134b4: 30 e0 ldi r19, 0x00 ; 0 134b6: 40 e0 ldi r20, 0x00 ; 0 134b8: 5f e3 ldi r21, 0x3F ; 63 134ba: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 134be: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> nozzle_diameter_check(nDiameter); 134c2: cb 01 movw r24, r22 134c4: 0f 94 a5 16 call 0x22d4a ; 0x22d4a 134c8: 79 cd rjmp .-1294 ; 0x12fbc } else if(code_seen_P(PSTR("set")) && farm_mode) { 134ca: 81 ef ldi r24, 0xF1 ; 241 134cc: 98 e8 ldi r25, 0x88 ; 136 134ce: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 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); 134d2: 85 ea ldi r24, 0xA5 ; 165 134d4: 9d e0 ldi r25, 0x0D ; 13 134d6: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 134da: bc 01 movw r22, r24 134dc: 90 e0 ldi r25, 0x00 ; 0 134de: 80 e0 ldi r24, 0x00 ; 0 134e0: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 134e4: 20 e0 ldi r18, 0x00 ; 0 134e6: 30 e0 ldi r19, 0x00 ; 0 134e8: 4a e7 ldi r20, 0x7A ; 122 134ea: 54 e4 ldi r21, 0x44 ; 68 134ec: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 134f0: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 134f4: 63 cd rjmp .-1338 ; 0x12fbc } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 134f6: d8 01 movw r26, r16 134f8: 8c 91 ld r24, X 134fa: 87 34 cpi r24, 0x47 ; 71 134fc: 11 f0 breq .+4 ; 0x13502 134fe: 0c 94 16 a6 jmp 0x14c2c ; 0x14c2c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 13502: 10 93 96 03 sts 0x0396, r17 ; 0x800396 13506: 00 93 95 03 sts 0x0395, r16 ; 0x800395 gcode_in_progress = code_value_short(); 1350a: 0e 94 13 5c call 0xb826 ; 0xb826 1350e: 90 93 94 03 sts 0x0394, r25 ; 0x800394 13512: 80 93 93 03 sts 0x0393, r24 ; 0x800393 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 13516: 8e 31 cpi r24, 0x1E ; 30 13518: 91 05 cpc r25, r1 1351a: 09 f4 brne .+2 ; 0x1351e 1351c: da c6 rjmp .+3508 ; 0x142d2 1351e: 0c f0 brlt .+2 ; 0x13522 13520: 45 c1 rjmp .+650 ; 0x137ac 13522: 84 30 cpi r24, 0x04 ; 4 13524: 91 05 cpc r25, r1 13526: 09 f4 brne .+2 ; 0x1352a 13528: 7e c6 rjmp .+3324 ; 0x14226 1352a: 0c f0 brlt .+2 ; 0x1352e 1352c: c5 c0 rjmp .+394 ; 0x136b8 1352e: 97 fd sbrc r25, 7 13530: cb c0 rjmp .+406 ; 0x136c8 13532: 02 97 sbiw r24, 0x02 ; 2 13534: 0c f0 brlt .+2 ; 0x13538 13536: fc c1 rjmp .+1016 ; 0x13930 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 13538: 0e 94 11 5b call 0xb622 ; 0xb622 1353c: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 1353e: 0e 94 71 62 call 0xc4e2 ; 0xc4e2 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 13542: 60 91 60 06 lds r22, 0x0660 ; 0x800660 13546: 70 91 61 06 lds r23, 0x0661 ; 0x800661 1354a: 80 91 62 06 lds r24, 0x0662 ; 0x800662 1354e: 90 91 63 06 lds r25, 0x0663 ; 0x800663 13552: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 13556: 6b 01 movw r12, r22 13558: 7c 01 movw r14, r24 1355a: 40 90 4d 07 lds r4, 0x074D ; 0x80074d 1355e: 50 90 4e 07 lds r5, 0x074E ; 0x80074e 13562: 60 90 4f 07 lds r6, 0x074F ; 0x80074f 13566: 70 90 50 07 lds r7, 0x0750 ; 0x800750 1356a: 80 90 5e 05 lds r8, 0x055E ; 0x80055e 1356e: 90 90 5f 05 lds r9, 0x055F ; 0x80055f 13572: a0 90 60 05 lds r10, 0x0560 ; 0x800560 13576: b0 90 61 05 lds r11, 0x0561 ; 0x800561 1357a: a5 01 movw r20, r10 1357c: 94 01 movw r18, r8 1357e: c3 01 movw r24, r6 13580: b2 01 movw r22, r4 13582: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13586: 20 e0 ldi r18, 0x00 ; 0 13588: 30 e0 ldi r19, 0x00 ; 0 1358a: 48 ec ldi r20, 0xC8 ; 200 1358c: 52 e4 ldi r21, 0x42 ; 66 1358e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13592: 9b 01 movw r18, r22 13594: ac 01 movw r20, r24 13596: c7 01 movw r24, r14 13598: b6 01 movw r22, r12 1359a: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1359e: 18 16 cp r1, r24 135a0: d4 f4 brge .+52 ; 0x135d6 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 135a2: a3 01 movw r20, r6 135a4: 92 01 movw r18, r4 135a6: c5 01 movw r24, r10 135a8: b4 01 movw r22, r8 135aa: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 135ae: 20 e0 ldi r18, 0x00 ; 0 135b0: 30 e0 ldi r19, 0x00 ; 0 135b2: 48 ec ldi r20, 0xC8 ; 200 135b4: 52 e4 ldi r21, 0x42 ; 66 135b6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 135ba: a7 01 movw r20, r14 135bc: 96 01 movw r18, r12 135be: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 135c2: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 135c6: 60 93 60 06 sts 0x0660, r22 ; 0x800660 135ca: 70 93 61 06 sts 0x0661, r23 ; 0x800661 135ce: 80 93 62 06 sts 0x0662, r24 ; 0x800662 135d2: 90 93 63 06 sts 0x0663, r25 ; 0x800663 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 135d6: 80 91 ee 06 lds r24, 0x06EE ; 0x8006ee 135da: 88 23 and r24, r24 135dc: 09 f4 brne .+2 ; 0x135e0 135de: a4 c1 rjmp .+840 ; 0x13928 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 135e0: 88 e5 ldi r24, 0x58 ; 88 135e2: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 135e6: 81 11 cpse r24, r1 135e8: 9f c1 rjmp .+830 ; 0x13928 135ea: 89 e5 ldi r24, 0x59 ; 89 135ec: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 135f0: 81 11 cpse r24, r1 135f2: 9a c1 rjmp .+820 ; 0x13928 135f4: 8a e5 ldi r24, 0x5A ; 90 135f6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 135fa: 81 11 cpse r24, r1 135fc: 95 c1 rjmp .+810 ; 0x13928 135fe: 85 e4 ldi r24, 0x45 ; 69 13600: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 13604: 88 23 and r24, r24 13606: 09 f4 brne .+2 ; 0x1360a 13608: 8f c1 rjmp .+798 ; 0x13928 float echange=destination[E_AXIS]-current_position[E_AXIS]; 1360a: 20 91 4d 07 lds r18, 0x074D ; 0x80074d 1360e: 30 91 4e 07 lds r19, 0x074E ; 0x80074e 13612: 40 91 4f 07 lds r20, 0x074F ; 0x80074f 13616: 50 91 50 07 lds r21, 0x0750 ; 0x800750 1361a: 60 91 5e 05 lds r22, 0x055E ; 0x80055e 1361e: 70 91 5f 05 lds r23, 0x055F ; 0x80055f 13622: 80 91 60 05 lds r24, 0x0560 ; 0x800560 13626: 90 91 61 05 lds r25, 0x0561 ; 0x800561 1362a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1362e: 6b 01 movw r12, r22 13630: 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 13632: 2d ec ldi r18, 0xCD ; 205 13634: 3c ec ldi r19, 0xCC ; 204 13636: 4c ec ldi r20, 0xCC ; 204 13638: 5d eb ldi r21, 0xBD ; 189 1363a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1363e: 87 ff sbrs r24, 7 13640: 65 c1 rjmp .+714 ; 0x1390c 13642: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 13646: 81 11 cpse r24, r1 13648: 0c 94 20 cf jmp 0x19e40 ; 0x19e40 st_synchronize(); 1364c: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13650: 80 91 5e 05 lds r24, 0x055E ; 0x80055e 13654: 90 91 5f 05 lds r25, 0x055F ; 0x80055f 13658: a0 91 60 05 lds r26, 0x0560 ; 0x800560 1365c: b0 91 61 05 lds r27, 0x0561 ; 0x800561 13660: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 13664: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e 13668: a0 93 4f 07 sts 0x074F, r26 ; 0x80074f 1366c: b0 93 50 07 sts 0x0750, r27 ; 0x800750 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 13670: 8d e4 ldi r24, 0x4D ; 77 13672: 97 e0 ldi r25, 0x07 ; 7 13674: 0f 94 dc aa call 0x355b8 ; 0x355b8 retract(!retracted[active_extruder]); 13678: 90 91 3d 07 lds r25, 0x073D ; 0x80073d 1367c: 81 e0 ldi r24, 0x01 ; 1 1367e: 89 27 eor r24, r25 13680: 0f 94 f2 89 call 0x313e4 ; 0x313e4 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 13684: c1 57 subi r28, 0x71 ; 113 13686: df 4f sbci r29, 0xFF ; 255 13688: 0f b6 in r0, 0x3f ; 63 1368a: f8 94 cli 1368c: de bf out 0x3e, r29 ; 62 1368e: 0f be out 0x3f, r0 ; 63 13690: cd bf out 0x3d, r28 ; 61 13692: df 91 pop r29 13694: cf 91 pop r28 13696: 1f 91 pop r17 13698: 0f 91 pop r16 1369a: ff 90 pop r15 1369c: ef 90 pop r14 1369e: df 90 pop r13 136a0: cf 90 pop r12 136a2: bf 90 pop r11 136a4: af 90 pop r10 136a6: 9f 90 pop r9 136a8: 8f 90 pop r8 136aa: 7f 90 pop r7 136ac: 6f 90 pop r6 136ae: 5f 90 pop r5 136b0: 4f 90 pop r4 136b2: 3f 90 pop r3 136b4: 2f 90 pop r2 136b6: 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) 136b8: 8b 30 cpi r24, 0x0B ; 11 136ba: 91 05 cpc r25, r1 136bc: 09 f4 brne .+2 ; 0x136c0 136be: 00 c6 rjmp .+3072 ; 0x142c0 136c0: dc f4 brge .+54 ; 0x136f8 136c2: 0a 97 sbiw r24, 0x0a ; 10 136c4: 09 f4 brne .+2 ; 0x136c8 136c6: f8 c5 rjmp .+3056 ; 0x142b8 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 136c8: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 136cc: 90 91 6f 12 lds r25, 0x126F ; 0x80126f 136d0: 8c 57 subi r24, 0x7C ; 124 136d2: 9f 4e sbci r25, 0xEF ; 239 136d4: 9f 93 push r25 136d6: 8f 93 push r24 136d8: 1f 92 push r1 136da: 87 e4 ldi r24, 0x47 ; 71 136dc: 8f 93 push r24 136de: 8a ee ldi r24, 0xEA ; 234 136e0: 99 e6 ldi r25, 0x69 ; 105 136e2: 9f 93 push r25 136e4: 8f 93 push r24 136e6: 0f 94 4b dc call 0x3b896 ; 0x3b896 136ea: 0f 90 pop r0 136ec: 0f 90 pop r0 136ee: 0f 90 pop r0 136f0: 0f 90 pop r0 136f2: 0f 90 pop r0 136f4: 0f 90 pop r0 136f6: a5 c0 rjmp .+330 ; 0x13842 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) 136f8: 85 31 cpi r24, 0x15 ; 21 136fa: 91 05 cpc r25, r1 136fc: 09 f4 brne .+2 ; 0x13700 136fe: a1 c0 rjmp .+322 ; 0x13842 13700: 4c 97 sbiw r24, 0x1c ; 28 13702: 11 f7 brne .-60 ; 0x136c8 { 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]); 13704: 88 e5 ldi r24, 0x58 ; 88 13706: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1370a: 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; 1370c: 41 2c mov r4, r1 1370e: 51 2c mov r5, r1 13710: 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(); 13712: 88 23 and r24, r24 13714: 21 f0 breq .+8 ; 0x1371e 13716: 0e 94 20 5c call 0xb840 ; 0xb840 1371a: 2b 01 movw r4, r22 1371c: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 1371e: 89 e5 ldi r24, 0x59 ; 89 13720: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 13724: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 13726: 88 23 and r24, r24 13728: 09 f4 brne .+2 ; 0x1372c 1372a: cc c5 rjmp .+2968 ; 0x142c4 1372c: 0e 94 20 5c call 0xb840 ; 0xb840 13730: 6e 96 adiw r28, 0x1e ; 30 13732: 6c af std Y+60, r22 ; 0x3c 13734: 7d af std Y+61, r23 ; 0x3d 13736: 8e af std Y+62, r24 ; 0x3e 13738: 9f af std Y+63, r25 ; 0x3f 1373a: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 1373c: 8a e5 ldi r24, 0x5A ; 90 1373e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 13742: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 13744: 81 2c mov r8, r1 13746: 91 2c mov r9, r1 13748: 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(); 1374a: 88 23 and r24, r24 1374c: 21 f0 breq .+8 ; 0x13756 1374e: 0e 94 20 5c call 0xb840 ; 0xb840 13752: 4b 01 movw r8, r22 13754: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 13756: 87 e5 ldi r24, 0x57 ; 87 13758: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1375c: 67 96 adiw r28, 0x17 ; 23 1375e: 8f af std Y+63, r24 ; 0x3f 13760: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13762: 83 e4 ldi r24, 0x43 ; 67 13764: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 13768: 67 96 adiw r28, 0x17 ; 23 1376a: ff ad ldd r31, Y+63 ; 0x3f 1376c: 67 97 sbiw r28, 0x17 ; 23 1376e: ff 93 push r31 13770: 8f 93 push r24 13772: cd 2c mov r12, r13 13774: 6e 96 adiw r28, 0x1e ; 30 13776: ec ac ldd r14, Y+60 ; 0x3c 13778: fd ac ldd r15, Y+61 ; 0x3d 1377a: 0e ad ldd r16, Y+62 ; 0x3e 1377c: 1f ad ldd r17, Y+63 ; 0x3f 1377e: 6e 97 sbiw r28, 0x1e ; 30 13780: 22 2d mov r18, r2 13782: b3 01 movw r22, r6 13784: a2 01 movw r20, r4 13786: 83 2d mov r24, r3 13788: 0e 94 aa 7e call 0xfd54 ; 0xfd54 #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) { 1378c: 0f 90 pop r0 1378e: 0f 90 pop r0 13790: 31 10 cpse r3, r1 13792: 57 c0 rjmp .+174 ; 0x13842 13794: 21 10 cpse r2, r1 13796: 55 c0 rjmp .+170 ; 0x13842 13798: 67 96 adiw r28, 0x17 ; 23 1379a: 2f ad ldd r18, Y+63 ; 0x3f 1379c: 67 97 sbiw r28, 0x17 ; 23 1379e: 21 11 cpse r18, r1 137a0: 50 c0 rjmp .+160 ; 0x13842 137a2: d1 10 cpse r13, r1 137a4: 4e c0 rjmp .+156 ; 0x13842 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 137a6: 0e 94 99 8f call 0x11f32 ; 0x11f32 137aa: 4b c0 rjmp .+150 ; 0x13842 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) 137ac: 86 35 cpi r24, 0x56 ; 86 137ae: 91 05 cpc r25, r1 137b0: 11 f4 brne .+4 ; 0x137b6 137b2: 0c 94 c5 a5 jmp 0x14b8a ; 0x14b8a 137b6: b4 f5 brge .+108 ; 0x13824 137b8: 8c 34 cpi r24, 0x4C ; 76 137ba: 91 05 cpc r25, r1 137bc: 09 f4 brne .+2 ; 0x137c0 137be: df c5 rjmp .+3006 ; 0x1437e 137c0: 3c f5 brge .+78 ; 0x13810 137c2: 08 e2 ldi r16, 0x28 ; 40 137c4: 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)); 137c6: 2a e9 ldi r18, 0x9A ; 154 137c8: e2 2e mov r14, r18 137ca: 2a e6 ldi r18, 0x6A ; 106 137cc: f2 2e mov r15, r18 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) 137ce: 8b 34 cpi r24, 0x4B ; 75 137d0: 91 05 cpc r25, r1 137d2: 09 f0 breq .+2 ; 0x137d6 137d4: 79 cf rjmp .-270 ; 0x136c8 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)); 137d6: 60 2f mov r22, r16 137d8: 70 e0 ldi r23, 0x00 ; 0 137da: 90 e0 ldi r25, 0x00 ; 0 137dc: 80 e0 ldi r24, 0x00 ; 0 137de: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 137e2: 0e 94 37 5d call 0xba6e ; 0xba6e 137e6: 9f 93 push r25 137e8: 8f 93 push r24 137ea: 7f 93 push r23 137ec: 6f 93 push r22 137ee: 1f 93 push r17 137f0: 0f 93 push r16 137f2: ff 92 push r15 137f4: ef 92 push r14 137f6: 0f 94 4b dc call 0x3b896 ; 0x3b896 137fa: 0f 5f subi r16, 0xFF ; 255 137fc: 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++) 137fe: 0f b6 in r0, 0x3f ; 63 13800: f8 94 cli 13802: de bf out 0x3e, r29 ; 62 13804: 0f be out 0x3f, r0 ; 63 13806: cd bf out 0x3d, r28 ; 61 13808: 0f 36 cpi r16, 0x6F ; 111 1380a: 11 05 cpc r17, r1 1380c: 21 f7 brne .-56 ; 0x137d6 1380e: 19 c0 rjmp .+50 ; 0x13842 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) 13810: 80 35 cpi r24, 0x50 ; 80 13812: 91 05 cpc r25, r1 13814: 41 f2 breq .-112 ; 0x137a6 13816: 81 35 cpi r24, 0x51 ; 81 13818: 91 05 cpc r25, r1 1381a: 09 f0 breq .+2 ; 0x1381e 1381c: 55 cf rjmp .-342 ; 0x136c8 /*! ### 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(); 1381e: 0e 94 de 80 call 0x101bc ; 0x101bc 13822: 0f c0 rjmp .+30 ; 0x13842 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) 13824: 8a 35 cpi r24, 0x5A ; 90 13826: 91 05 cpc r25, r1 13828: 11 f4 brne .+4 ; 0x1382e 1382a: 0c 94 cf a5 jmp 0x14b9e ; 0x14b9e 1382e: 74 f4 brge .+28 ; 0x1384c 13830: 87 35 cpi r24, 0x57 ; 87 13832: 91 05 cpc r25, r1 13834: 11 f4 brne .+4 ; 0x1383a 13836: 0c 94 ca a5 jmp 0x14b94 ; 0x14b94 1383a: 88 35 cpi r24, 0x58 ; 88 1383c: 91 05 cpc r25, r1 1383e: 09 f0 breq .+2 ; 0x13842 13840: 43 cf rjmp .-378 ; 0x136c8 #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; 13842: 10 92 94 03 sts 0x0394, r1 ; 0x800394 13846: 10 92 93 03 sts 0x0393, r1 ; 0x800393 1384a: b8 cb rjmp .-2192 ; 0x12fbc 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) 1384c: 8b 35 cpi r24, 0x5B ; 91 1384e: 91 05 cpc r25, r1 13850: 11 f4 brne .+4 ; 0x13856 13852: 0c 94 d6 a5 jmp 0x14bac ; 0x14bac 13856: 8c 35 cpi r24, 0x5C ; 92 13858: 91 05 cpc r25, r1 1385a: 09 f0 breq .+2 ; 0x1385e 1385c: 35 cf rjmp .-406 ; 0x136c8 1385e: 6d ed ldi r22, 0xDD ; 221 13860: c6 2e mov r12, r22 13862: 62 e0 ldi r22, 0x02 ; 2 13864: d6 2e mov r13, r22 13866: 8e 01 movw r16, r28 13868: 0f 5b subi r16, 0xBF ; 191 1386a: 1f 4f sbci r17, 0xFF ; 255 1386c: 9e 01 movw r18, r28 1386e: 2f 5f subi r18, 0xFF ; 255 13870: 3f 4f sbci r19, 0xFF ; 255 13872: 79 01 movw r14, r18 13874: 71 ee ldi r23, 0xE1 ; 225 13876: 87 2e mov r8, r23 13878: 72 e0 ldi r23, 0x02 ; 2 1387a: 97 2e mov r9, r23 1387c: 58 01 movw r10, r16 1387e: 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]); 13880: d6 01 movw r26, r12 13882: 8d 91 ld r24, X+ 13884: 6d 01 movw r12, r26 13886: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1388a: f5 01 movw r30, r10 1388c: 81 93 st Z+, r24 1388e: 5f 01 movw r10, r30 if(codes[i]) 13890: 88 23 and r24, r24 13892: 41 f0 breq .+16 ; 0x138a4 values[i] = code_value(); 13894: 0e 94 4a 61 call 0xc294 ; 0xc294 13898: d7 01 movw r26, r14 1389a: 6d 93 st X+, r22 1389c: 7d 93 st X+, r23 1389e: 8d 93 st X+, r24 138a0: 9c 93 st X, r25 138a2: 13 97 sbiw r26, 0x03 ; 3 138a4: b4 e0 ldi r27, 0x04 ; 4 138a6: eb 0e add r14, r27 138a8: 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) 138aa: 8c 14 cp r8, r12 138ac: 9d 04 cpc r9, r13 138ae: 41 f7 brne .-48 ; 0x13880 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 138b0: f8 01 movw r30, r16 138b2: d3 80 ldd r13, Z+3 ; 0x03 138b4: dd 20 and r13, r13 138b6: 11 f4 brne .+4 ; 0x138bc 138b8: 0c 94 da a5 jmp 0x14bb4 ; 0x14bb4 138bc: 20 e0 ldi r18, 0x00 ; 0 138be: 30 e0 ldi r19, 0x00 ; 0 138c0: a9 01 movw r20, r18 138c2: 6d 85 ldd r22, Y+13 ; 0x0d 138c4: 7e 85 ldd r23, Y+14 ; 0x0e 138c6: 8f 85 ldd r24, Y+15 ; 0x0f 138c8: 98 89 ldd r25, Y+16 ; 0x10 138ca: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 138ce: 81 11 cpse r24, r1 138d0: 0c 94 da a5 jmp 0x14bb4 ; 0x14bb4 138d4: d8 01 movw r26, r16 138d6: 8c 91 ld r24, X 138d8: 81 11 cpse r24, r1 138da: 0c 94 da a5 jmp 0x14bb4 ; 0x14bb4 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 138de: 11 96 adiw r26, 0x01 ; 1 138e0: 8c 91 ld r24, X 138e2: 11 97 sbiw r26, 0x01 ; 1 138e4: 81 11 cpse r24, r1 138e6: 0c 94 da a5 jmp 0x14bb4 ; 0x14bb4 138ea: 12 96 adiw r26, 0x02 ; 2 138ec: 8c 91 ld r24, X 138ee: 81 11 cpse r24, r1 138f0: 0c 94 da a5 jmp 0x14bb4 ; 0x14bb4 { // 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; 138f4: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d 138f8: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e 138fc: 10 92 4f 07 sts 0x074F, r1 ; 0x80074f 13900: 10 92 50 07 sts 0x0750, r1 ; 0x800750 st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 13904: 81 e0 ldi r24, 0x01 ; 1 13906: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL23plan_reset_next_e_queue.lto_priv.505> 1390a: 9b cf rjmp .-202 ; 0x13842 #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 1390c: 2d ec ldi r18, 0xCD ; 205 1390e: 3c ec ldi r19, 0xCC ; 204 13910: 4c ec ldi r20, 0xCC ; 204 13912: 5d e3 ldi r21, 0x3D ; 61 13914: c7 01 movw r24, r14 13916: b6 01 movw r22, r12 13918: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1391c: 18 16 cp r1, r24 1391e: 24 f4 brge .+8 ; 0x13928 13920: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 13924: 81 11 cpse r24, r1 13926: 92 ce rjmp .-732 ; 0x1364c } } } #endif //FWRETRACT prepare_move(start_segment_idx); 13928: c8 01 movw r24, r16 1392a: 0e 94 b5 6c call 0xd96a ; 0xd96a 1392e: 89 cf rjmp .-238 ; 0x13842 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 13930: 0e 94 11 5b call 0xb622 ; 0xb622 13934: e0 96 adiw r28, 0x30 ; 48 13936: 9f af std Y+63, r25 ; 0x3f 13938: 8e af std Y+62, r24 ; 0x3e 1393a: 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 1393c: 0e 94 71 62 call 0xc4e2 ; 0xc4e2 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 13940: 89 e4 ldi r24, 0x49 ; 73 13942: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 13946: 88 23 and r24, r24 13948: 09 f4 brne .+2 ; 0x1394c 1394a: 00 c4 rjmp .+2048 ; 0x1414c 1394c: 0e 94 4a 61 call 0xc294 ; 0xc294 13950: 60 93 8b 03 sts 0x038B, r22 ; 0x80038b 13954: 70 93 8c 03 sts 0x038C, r23 ; 0x80038c 13958: 80 93 8d 03 sts 0x038D, r24 ; 0x80038d 1395c: 90 93 8e 03 sts 0x038E, r25 ; 0x80038e offset[1] = code_seen('J') ? code_value() : 0.f; 13960: 8a e4 ldi r24, 0x4A ; 74 13962: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 13966: c1 2c mov r12, r1 13968: d1 2c mov r13, r1 1396a: 76 01 movw r14, r12 1396c: 88 23 and r24, r24 1396e: 21 f0 breq .+8 ; 0x13978 13970: 0e 94 4a 61 call 0xc294 ; 0xc294 13974: 6b 01 movw r12, r22 13976: 7c 01 movw r14, r24 13978: c0 92 8f 03 sts 0x038F, r12 ; 0x80038f 1397c: d0 92 90 03 sts 0x0390, r13 ; 0x800390 13980: e0 92 91 03 sts 0x0391, r14 ; 0x800391 13984: f0 92 92 03 sts 0x0392, r15 ; 0x800392 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 13988: e0 91 93 03 lds r30, 0x0393 ; 0x800393 1398c: f0 91 94 03 lds r31, 0x0394 ; 0x800394 13990: c2 57 subi r28, 0x72 ; 114 13992: df 4f sbci r29, 0xFF ; 255 13994: f9 83 std Y+1, r31 ; 0x01 13996: e8 83 st Y, r30 13998: ce 58 subi r28, 0x8E ; 142 1399a: 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 1399c: 80 90 8b 03 lds r8, 0x038B ; 0x80038b 139a0: 90 90 8c 03 lds r9, 0x038C ; 0x80038c 139a4: a0 90 8d 03 lds r10, 0x038D ; 0x80038d 139a8: b0 90 8e 03 lds r11, 0x038E ; 0x80038e 139ac: a7 01 movw r20, r14 139ae: 96 01 movw r18, r12 139b0: c5 01 movw r24, r10 139b2: b4 01 movw r22, r8 139b4: 0f 94 4d e1 call 0x3c29a ; 0x3c29a 139b8: ae 96 adiw r28, 0x2e ; 46 139ba: 6c af std Y+60, r22 ; 0x3c 139bc: 7d af std Y+61, r23 ; 0x3d 139be: 8e af std Y+62, r24 ; 0x3e 139c0: 9f af std Y+63, r25 ; 0x3f 139c2: 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); 139c4: 60 91 39 02 lds r22, 0x0239 ; 0x800239 139c8: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 139cc: 07 2e mov r0, r23 139ce: 00 0c add r0, r0 139d0: 88 0b sbc r24, r24 139d2: 99 0b sbc r25, r25 139d4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 139d8: 20 91 90 02 lds r18, 0x0290 ; 0x800290 139dc: 30 91 91 02 lds r19, 0x0291 ; 0x800291 139e0: 40 91 92 02 lds r20, 0x0292 ; 0x800292 139e4: 50 91 93 02 lds r21, 0x0293 ; 0x800293 139e8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 139ec: 2e e3 ldi r18, 0x3E ; 62 139ee: 33 ec ldi r19, 0xC3 ; 195 139f0: 4e e2 ldi r20, 0x2E ; 46 139f2: 59 e3 ldi r21, 0x39 ; 57 139f4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 139f8: aa 96 adiw r28, 0x2a ; 42 139fa: 6c af std Y+60, r22 ; 0x3c 139fc: 7d af std Y+61, r23 ; 0x3d 139fe: 8e af std Y+62, r24 ; 0x3e 13a00: 9f af std Y+63, r25 ; 0x3f 13a02: 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)); 13a04: 80 e1 ldi r24, 0x10 ; 16 13a06: e1 e4 ldi r30, 0x41 ; 65 13a08: f7 e0 ldi r31, 0x07 ; 7 13a0a: de 01 movw r26, r28 13a0c: 11 96 adiw r26, 0x01 ; 1 13a0e: 01 90 ld r0, Z+ 13a10: 0d 92 st X+, r0 13a12: 8a 95 dec r24 13a14: e1 f7 brne .-8 ; 0x13a0e float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 13a16: a5 01 movw r20, r10 13a18: 94 01 movw r18, r8 13a1a: 50 58 subi r21, 0x80 ; 128 13a1c: 6a 96 adiw r28, 0x1a ; 26 13a1e: 2c af std Y+60, r18 ; 0x3c 13a20: 3d af std Y+61, r19 ; 0x3d 13a22: 4e af std Y+62, r20 ; 0x3e 13a24: 5f af std Y+63, r21 ; 0x3f 13a26: 6a 97 sbiw r28, 0x1a ; 26 float r_axis_y = -offset[Y_AXIS]; 13a28: d7 01 movw r26, r14 13a2a: c6 01 movw r24, r12 13a2c: b0 58 subi r27, 0x80 ; 128 13a2e: 6e 96 adiw r28, 0x1e ; 30 13a30: 8c af std Y+60, r24 ; 0x3c 13a32: 9d af std Y+61, r25 ; 0x3d 13a34: ae af std Y+62, r26 ; 0x3e 13a36: bf af std Y+63, r27 ; 0x3f 13a38: 6e 97 sbiw r28, 0x1e ; 30 float center_axis_x = start_position[X_AXIS] - r_axis_x; 13a3a: 29 81 ldd r18, Y+1 ; 0x01 13a3c: 3a 81 ldd r19, Y+2 ; 0x02 13a3e: 4b 81 ldd r20, Y+3 ; 0x03 13a40: 5c 81 ldd r21, Y+4 ; 0x04 13a42: e6 96 adiw r28, 0x36 ; 54 13a44: 2c af std Y+60, r18 ; 0x3c 13a46: 3d af std Y+61, r19 ; 0x3d 13a48: 4e af std Y+62, r20 ; 0x3e 13a4a: 5f af std Y+63, r21 ; 0x3f 13a4c: e6 97 sbiw r28, 0x36 ; 54 13a4e: c5 01 movw r24, r10 13a50: b4 01 movw r22, r8 13a52: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 13a56: ea 96 adiw r28, 0x3a ; 58 13a58: 6c af std Y+60, r22 ; 0x3c 13a5a: 7d af std Y+61, r23 ; 0x3d 13a5c: 8e af std Y+62, r24 ; 0x3e 13a5e: 9f af std Y+63, r25 ; 0x3f 13a60: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13a62: 8d 81 ldd r24, Y+5 ; 0x05 13a64: 9e 81 ldd r25, Y+6 ; 0x06 13a66: af 81 ldd r26, Y+7 ; 0x07 13a68: b8 85 ldd r27, Y+8 ; 0x08 13a6a: ee 96 adiw r28, 0x3e ; 62 13a6c: 8c af std Y+60, r24 ; 0x3c 13a6e: 9d af std Y+61, r25 ; 0x3d 13a70: ae af std Y+62, r26 ; 0x3e 13a72: bf af std Y+63, r27 ; 0x3f 13a74: ee 97 sbiw r28, 0x3e ; 62 13a76: 9c 01 movw r18, r24 13a78: ad 01 movw r20, r26 13a7a: c7 01 movw r24, r14 13a7c: b6 01 movw r22, r12 13a7e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 13a82: ce 57 subi r28, 0x7E ; 126 13a84: df 4f sbci r29, 0xFF ; 255 13a86: 68 83 st Y, r22 13a88: 79 83 std Y+1, r23 ; 0x01 13a8a: 8a 83 std Y+2, r24 ; 0x02 13a8c: 9b 83 std Y+3, r25 ; 0x03 13a8e: c2 58 subi r28, 0x82 ; 130 13a90: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13a92: 29 85 ldd r18, Y+9 ; 0x09 13a94: 3a 85 ldd r19, Y+10 ; 0x0a 13a96: 4b 85 ldd r20, Y+11 ; 0x0b 13a98: 5c 85 ldd r21, Y+12 ; 0x0c 13a9a: 60 91 5a 05 lds r22, 0x055A ; 0x80055a 13a9e: 70 91 5b 05 lds r23, 0x055B ; 0x80055b 13aa2: 80 91 5c 05 lds r24, 0x055C ; 0x80055c 13aa6: 90 91 5d 05 lds r25, 0x055D ; 0x80055d 13aaa: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13aae: c2 58 subi r28, 0x82 ; 130 13ab0: df 4f sbci r29, 0xFF ; 255 13ab2: 68 83 st Y, r22 13ab4: 79 83 std Y+1, r23 ; 0x01 13ab6: 8a 83 std Y+2, r24 ; 0x02 13ab8: 9b 83 std Y+3, r25 ; 0x03 13aba: ce 57 subi r28, 0x7E ; 126 13abc: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 13abe: 20 91 52 05 lds r18, 0x0552 ; 0x800552 13ac2: 30 91 53 05 lds r19, 0x0553 ; 0x800553 13ac6: 40 91 54 05 lds r20, 0x0554 ; 0x800554 13aca: 50 91 55 05 lds r21, 0x0555 ; 0x800555 13ace: ca 57 subi r28, 0x7A ; 122 13ad0: df 4f sbci r29, 0xFF ; 255 13ad2: 28 83 st Y, r18 13ad4: 39 83 std Y+1, r19 ; 0x01 13ad6: 4a 83 std Y+2, r20 ; 0x02 13ad8: 5b 83 std Y+3, r21 ; 0x03 13ada: c6 58 subi r28, 0x86 ; 134 13adc: d0 40 sbci r29, 0x00 ; 0 13ade: ea 96 adiw r28, 0x3a ; 58 13ae0: 2c ad ldd r18, Y+60 ; 0x3c 13ae2: 3d ad ldd r19, Y+61 ; 0x3d 13ae4: 4e ad ldd r20, Y+62 ; 0x3e 13ae6: 5f ad ldd r21, Y+63 ; 0x3f 13ae8: ea 97 sbiw r28, 0x3a ; 58 13aea: ca 57 subi r28, 0x7A ; 122 13aec: df 4f sbci r29, 0xFF ; 255 13aee: 68 81 ld r22, Y 13af0: 79 81 ldd r23, Y+1 ; 0x01 13af2: 8a 81 ldd r24, Y+2 ; 0x02 13af4: 9b 81 ldd r25, Y+3 ; 0x03 13af6: c6 58 subi r28, 0x86 ; 134 13af8: d0 40 sbci r29, 0x00 ; 0 13afa: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13afe: 6b 01 movw r12, r22 13b00: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 13b02: 80 91 56 05 lds r24, 0x0556 ; 0x800556 13b06: 90 91 57 05 lds r25, 0x0557 ; 0x800557 13b0a: a0 91 58 05 lds r26, 0x0558 ; 0x800558 13b0e: b0 91 59 05 lds r27, 0x0559 ; 0x800559 13b12: c6 57 subi r28, 0x76 ; 118 13b14: df 4f sbci r29, 0xFF ; 255 13b16: 88 83 st Y, r24 13b18: 99 83 std Y+1, r25 ; 0x01 13b1a: aa 83 std Y+2, r26 ; 0x02 13b1c: bb 83 std Y+3, r27 ; 0x03 13b1e: ca 58 subi r28, 0x8A ; 138 13b20: d0 40 sbci r29, 0x00 ; 0 13b22: ce 57 subi r28, 0x7E ; 126 13b24: df 4f sbci r29, 0xFF ; 255 13b26: 28 81 ld r18, Y 13b28: 39 81 ldd r19, Y+1 ; 0x01 13b2a: 4a 81 ldd r20, Y+2 ; 0x02 13b2c: 5b 81 ldd r21, Y+3 ; 0x03 13b2e: c2 58 subi r28, 0x82 ; 130 13b30: d0 40 sbci r29, 0x00 ; 0 13b32: bc 01 movw r22, r24 13b34: cd 01 movw r24, r26 13b36: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13b3a: 4b 01 movw r8, r22 13b3c: 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; 13b3e: 30 90 30 07 lds r3, 0x0730 ; 0x800730 13b42: 20 90 31 07 lds r2, 0x0731 ; 0x800731 13b46: 90 91 32 07 lds r25, 0x0732 ; 0x800732 13b4a: 6f 96 adiw r28, 0x1f ; 31 13b4c: 9f af std Y+63, r25 ; 0x3f 13b4e: 6f 97 sbiw r28, 0x1f ; 31 13b50: a0 91 33 07 lds r26, 0x0733 ; 0x800733 13b54: a3 96 adiw r28, 0x23 ; 35 13b56: af af std Y+63, r26 ; 0x3f 13b58: 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); 13b5a: a7 01 movw r20, r14 13b5c: 96 01 movw r18, r12 13b5e: 6a 96 adiw r28, 0x1a ; 26 13b60: 6c ad ldd r22, Y+60 ; 0x3c 13b62: 7d ad ldd r23, Y+61 ; 0x3d 13b64: 8e ad ldd r24, Y+62 ; 0x3e 13b66: 9f ad ldd r25, Y+63 ; 0x3f 13b68: 6a 97 sbiw r28, 0x1a ; 26 13b6a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13b6e: 2b 01 movw r4, r22 13b70: 3c 01 movw r6, r24 13b72: a5 01 movw r20, r10 13b74: 94 01 movw r18, r8 13b76: 6e 96 adiw r28, 0x1e ; 30 13b78: 6c ad ldd r22, Y+60 ; 0x3c 13b7a: 7d ad ldd r23, Y+61 ; 0x3d 13b7c: 8e ad ldd r24, Y+62 ; 0x3e 13b7e: 9f ad ldd r25, Y+63 ; 0x3f 13b80: 6e 97 sbiw r28, 0x1e ; 30 13b82: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13b86: 9b 01 movw r18, r22 13b88: ac 01 movw r20, r24 13b8a: c3 01 movw r24, r6 13b8c: b2 01 movw r22, r4 13b8e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 13b92: 2b 01 movw r4, r22 13b94: 3c 01 movw r6, r24 13b96: a5 01 movw r20, r10 13b98: 94 01 movw r18, r8 13b9a: 6a 96 adiw r28, 0x1a ; 26 13b9c: 6c ad ldd r22, Y+60 ; 0x3c 13b9e: 7d ad ldd r23, Y+61 ; 0x3d 13ba0: 8e ad ldd r24, Y+62 ; 0x3e 13ba2: 9f ad ldd r25, Y+63 ; 0x3f 13ba4: 6a 97 sbiw r28, 0x1a ; 26 13ba6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13baa: 4b 01 movw r8, r22 13bac: 5c 01 movw r10, r24 13bae: a7 01 movw r20, r14 13bb0: 96 01 movw r18, r12 13bb2: 6e 96 adiw r28, 0x1e ; 30 13bb4: 6c ad ldd r22, Y+60 ; 0x3c 13bb6: 7d ad ldd r23, Y+61 ; 0x3d 13bb8: 8e ad ldd r24, Y+62 ; 0x3e 13bba: 9f ad ldd r25, Y+63 ; 0x3f 13bbc: 6e 97 sbiw r28, 0x1e ; 30 13bbe: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13bc2: 9b 01 movw r18, r22 13bc4: ac 01 movw r20, r24 13bc6: c5 01 movw r24, r10 13bc8: b4 01 movw r22, r8 13bca: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13bce: a3 01 movw r20, r6 13bd0: 92 01 movw r18, r4 13bd2: 0f 94 30 df call 0x3be60 ; 0x3be60 13bd6: 6b 01 movw r12, r22 13bd8: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 13bda: 20 e0 ldi r18, 0x00 ; 0 13bdc: 30 e0 ldi r19, 0x00 ; 0 13bde: a9 01 movw r20, r18 13be0: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 13be4: 87 ff sbrs r24, 7 13be6: 0a c0 rjmp .+20 ; 0x13bfc 13be8: 2b ed ldi r18, 0xDB ; 219 13bea: 3f e0 ldi r19, 0x0F ; 15 13bec: 49 ec ldi r20, 0xC9 ; 201 13bee: 50 e4 ldi r21, 0x40 ; 64 13bf0: c7 01 movw r24, r14 13bf2: b6 01 movw r22, r12 13bf4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 13bf8: 6b 01 movw r12, r22 13bfa: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 13bfc: 60 91 39 07 lds r22, 0x0739 ; 0x800739 13c00: 70 91 3a 07 lds r23, 0x073A ; 0x80073a 13c04: 61 15 cp r22, r1 13c06: 71 05 cpc r23, r1 13c08: 09 f4 brne .+2 ; 0x13c0c 13c0a: a4 c2 rjmp .+1352 ; 0x14154 { // 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); 13c0c: 90 e0 ldi r25, 0x00 ; 0 13c0e: 80 e0 ldi r24, 0x00 ; 0 13c10: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 13c14: 9b 01 movw r18, r22 13c16: ac 01 movw r20, r24 13c18: 6b ed ldi r22, 0xDB ; 219 13c1a: 7f e0 ldi r23, 0x0F ; 15 13c1c: 89 ec ldi r24, 0xC9 ; 201 13c1e: 90 e4 ldi r25, 0x40 ; 64 13c20: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 13c24: ae 96 adiw r28, 0x2e ; 46 13c26: 2c ad ldd r18, Y+60 ; 0x3c 13c28: 3d ad ldd r19, Y+61 ; 0x3d 13c2a: 4e ad ldd r20, Y+62 ; 0x3e 13c2c: 5f ad ldd r21, Y+63 ; 0x3f 13c2e: ae 97 sbiw r28, 0x2e ; 46 13c30: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13c34: 5b 01 movw r10, r22 13c36: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 13c38: 60 91 3b 07 lds r22, 0x073B ; 0x80073b 13c3c: 70 91 3c 07 lds r23, 0x073C ; 0x80073c 13c40: 61 15 cp r22, r1 13c42: 71 05 cpc r23, r1 13c44: f1 f0 breq .+60 ; 0x13c82 { // 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)); 13c46: 90 e0 ldi r25, 0x00 ; 0 13c48: 80 e0 ldi r24, 0x00 ; 0 13c4a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 13c4e: 20 e0 ldi r18, 0x00 ; 0 13c50: 30 e0 ldi r19, 0x00 ; 0 13c52: 40 e7 ldi r20, 0x70 ; 112 13c54: 52 e4 ldi r21, 0x42 ; 66 13c56: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13c5a: 9b 01 movw r18, r22 13c5c: ac 01 movw r20, r24 13c5e: aa 96 adiw r28, 0x2a ; 42 13c60: 6c ad ldd r22, Y+60 ; 0x3c 13c62: 7d ad ldd r23, Y+61 ; 0x3d 13c64: 8e ad ldd r24, Y+62 ; 0x3e 13c66: 9f ad ldd r25, Y+63 ; 0x3f 13c68: aa 97 sbiw r28, 0x2a ; 42 13c6a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 13c6e: 3b 01 movw r6, r22 13c70: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13c72: 95 01 movw r18, r10 13c74: a8 01 movw r20, r16 13c76: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 13c7a: 87 ff sbrs r24, 7 13c7c: 02 c0 rjmp .+4 ; 0x13c82 mm_per_arc_segment = mm_per_arc_segment_sec; 13c7e: 53 01 movw r10, r6 13c80: 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) 13c82: 40 90 34 07 lds r4, 0x0734 ; 0x800734 13c86: 50 90 35 07 lds r5, 0x0735 ; 0x800735 13c8a: 60 90 36 07 lds r6, 0x0736 ; 0x800736 13c8e: 70 90 37 07 lds r7, 0x0737 ; 0x800737 13c92: 95 01 movw r18, r10 13c94: a8 01 movw r20, r16 13c96: b2 01 movw r22, r4 13c98: c3 01 movw r24, r6 13c9a: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 13c9e: 18 16 cp r1, r24 13ca0: c4 f0 brlt .+48 ; 0x13cd2 { // 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) { 13ca2: 95 01 movw r18, r10 13ca4: a8 01 movw r20, r16 13ca6: 63 2d mov r22, r3 13ca8: 72 2d mov r23, r2 13caa: 6f 96 adiw r28, 0x1f ; 31 13cac: 8f ad ldd r24, Y+63 ; 0x3f 13cae: 6f 97 sbiw r28, 0x1f ; 31 13cb0: a3 96 adiw r28, 0x23 ; 35 13cb2: 9f ad ldd r25, Y+63 ; 0x3f 13cb4: a3 97 sbiw r28, 0x23 ; 35 13cb6: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 13cba: 25 01 movw r4, r10 13cbc: 38 01 movw r6, r16 13cbe: 87 ff sbrs r24, 7 13cc0: 08 c0 rjmp .+16 ; 0x13cd2 // 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; 13cc2: 43 2c mov r4, r3 13cc4: 52 2c mov r5, r2 13cc6: 6f 96 adiw r28, 0x1f ; 31 13cc8: 6f ac ldd r6, Y+63 ; 0x3f 13cca: 6f 97 sbiw r28, 0x1f ; 31 13ccc: a3 96 adiw r28, 0x23 ; 35 13cce: 7f ac ldd r7, Y+63 ; 0x3f 13cd0: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 13cd2: c2 57 subi r28, 0x72 ; 114 13cd4: df 4f sbci r29, 0xFF ; 255 13cd6: e8 81 ld r30, Y 13cd8: f9 81 ldd r31, Y+1 ; 0x01 13cda: ce 58 subi r28, 0x8E ; 142 13cdc: d0 40 sbci r29, 0x00 ; 0 13cde: 32 97 sbiw r30, 0x02 ; 2 13ce0: 51 f4 brne .+20 ; 0x13cf6 13ce2: 2b ed ldi r18, 0xDB ; 219 13ce4: 3f e0 ldi r19, 0x0F ; 15 13ce6: 49 ec ldi r20, 0xC9 ; 201 13ce8: 50 e4 ldi r21, 0x40 ; 64 13cea: c7 01 movw r24, r14 13cec: b6 01 movw r22, r12 13cee: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13cf2: 6b 01 movw r12, r22 13cf4: 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) 13cf6: ca 57 subi r28, 0x7A ; 122 13cf8: df 4f sbci r29, 0xFF ; 255 13cfa: 28 81 ld r18, Y 13cfc: 39 81 ldd r19, Y+1 ; 0x01 13cfe: 4a 81 ldd r20, Y+2 ; 0x02 13d00: 5b 81 ldd r21, Y+3 ; 0x03 13d02: c6 58 subi r28, 0x86 ; 134 13d04: d0 40 sbci r29, 0x00 ; 0 13d06: e6 96 adiw r28, 0x36 ; 54 13d08: 6c ad ldd r22, Y+60 ; 0x3c 13d0a: 7d ad ldd r23, Y+61 ; 0x3d 13d0c: 8e ad ldd r24, Y+62 ; 0x3e 13d0e: 9f ad ldd r25, Y+63 ; 0x3f 13d10: e6 97 sbiw r28, 0x36 ; 54 13d12: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 13d16: 81 11 cpse r24, r1 13d18: 25 c0 rjmp .+74 ; 0x13d64 13d1a: c6 57 subi r28, 0x76 ; 118 13d1c: df 4f sbci r29, 0xFF ; 255 13d1e: 28 81 ld r18, Y 13d20: 39 81 ldd r19, Y+1 ; 0x01 13d22: 4a 81 ldd r20, Y+2 ; 0x02 13d24: 5b 81 ldd r21, Y+3 ; 0x03 13d26: ca 58 subi r28, 0x8A ; 138 13d28: d0 40 sbci r29, 0x00 ; 0 13d2a: ee 96 adiw r28, 0x3e ; 62 13d2c: 6c ad ldd r22, Y+60 ; 0x3c 13d2e: 7d ad ldd r23, Y+61 ; 0x3d 13d30: 8e ad ldd r24, Y+62 ; 0x3e 13d32: 9f ad ldd r25, Y+63 ; 0x3f 13d34: ee 97 sbiw r28, 0x3e ; 62 13d36: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 13d3a: 81 11 cpse r24, r1 13d3c: 13 c0 rjmp .+38 ; 0x13d64 13d3e: 20 e0 ldi r18, 0x00 ; 0 13d40: 30 e0 ldi r19, 0x00 ; 0 13d42: a9 01 movw r20, r18 13d44: c7 01 movw r24, r14 13d46: b6 01 movw r22, r12 13d48: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 13d4c: 81 11 cpse r24, r1 13d4e: 0a c0 rjmp .+20 ; 0x13d64 { angular_travel_total += 2 * M_PI; 13d50: 2b ed ldi r18, 0xDB ; 219 13d52: 3f e0 ldi r19, 0x0F ; 15 13d54: 49 ec ldi r20, 0xC9 ; 201 13d56: 50 e4 ldi r21, 0x40 ; 64 13d58: c7 01 movw r24, r14 13d5a: b6 01 movw r22, r12 13d5c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 13d60: 6b 01 movw r12, r22 13d62: 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)); 13d64: a7 01 movw r20, r14 13d66: 96 01 movw r18, r12 13d68: ae 96 adiw r28, 0x2e ; 46 13d6a: 6c ad ldd r22, Y+60 ; 0x3c 13d6c: 7d ad ldd r23, Y+61 ; 0x3d 13d6e: 8e ad ldd r24, Y+62 ; 0x3e 13d70: 9f ad ldd r25, Y+63 ; 0x3f 13d72: ae 97 sbiw r28, 0x2e ; 46 13d74: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13d78: c2 58 subi r28, 0x82 ; 130 13d7a: df 4f sbci r29, 0xFF ; 255 13d7c: 28 81 ld r18, Y 13d7e: 39 81 ldd r19, Y+1 ; 0x01 13d80: 4a 81 ldd r20, Y+2 ; 0x02 13d82: 5b 81 ldd r21, Y+3 ; 0x03 13d84: ce 57 subi r28, 0x7E ; 126 13d86: d0 40 sbci r29, 0x00 ; 0 13d88: 0f 94 4d e1 call 0x3c29a ; 0x3c29a 13d8c: 4b 01 movw r8, r22 13d8e: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13d90: 2f e6 ldi r18, 0x6F ; 111 13d92: 32 e1 ldi r19, 0x12 ; 18 13d94: 43 e8 ldi r20, 0x83 ; 131 13d96: 5a e3 ldi r21, 0x3A ; 58 13d98: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 13d9c: 87 fd sbrc r24, 7 13d9e: cf c1 rjmp .+926 ; 0x1413e // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13da0: 92 01 movw r18, r4 13da2: a3 01 movw r20, r6 13da4: c5 01 movw r24, r10 13da6: b4 01 movw r22, r8 13da8: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 13dac: 0f 94 8f df call 0x3bf1e ; 0x3bf1e 13db0: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 13db4: a4 96 adiw r28, 0x24 ; 36 13db6: 7f af std Y+63, r23 ; 0x3f 13db8: 6e af std Y+62, r22 ; 0x3e 13dba: 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) 13dbc: 62 30 cpi r22, 0x02 ; 2 13dbe: 71 05 cpc r23, r1 13dc0: 08 f4 brcc .+2 ; 0x13dc4 13dc2: 8b c1 rjmp .+790 ; 0x140da 13dc4: e0 96 adiw r28, 0x30 ; 48 13dc6: 4e ad ldd r20, Y+62 ; 0x3e 13dc8: 5f ad ldd r21, Y+63 ; 0x3f 13dca: e0 97 sbiw r28, 0x30 ; 48 13dcc: 45 2b or r20, r21 13dce: 09 f4 brne .+2 ; 0x13dd2 13dd0: 84 c1 rjmp .+776 ; 0x140da 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; 13dd2: 50 91 38 07 lds r21, 0x0738 ; 0x800738 13dd6: 6f 96 adiw r28, 0x1f ; 31 13dd8: 5f af std Y+63, r21 ; 0x3f 13dda: 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, 13ddc: 90 e0 ldi r25, 0x00 ; 0 13dde: 80 e0 ldi r24, 0x00 ; 0 13de0: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 13de4: 4b 01 movw r8, r22 13de6: 5c 01 movw r10, r24 13de8: ac 01 movw r20, r24 13dea: 9b 01 movw r18, r22 13dec: c7 01 movw r24, r14 13dee: b6 01 movw r22, r12 13df0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 13df4: 2b 01 movw r4, r22 13df6: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 13df8: a5 01 movw r20, r10 13dfa: 94 01 movw r18, r8 13dfc: c2 58 subi r28, 0x82 ; 130 13dfe: df 4f sbci r29, 0xFF ; 255 13e00: 68 81 ld r22, Y 13e02: 79 81 ldd r23, Y+1 ; 0x01 13e04: 8a 81 ldd r24, Y+2 ; 0x02 13e06: 9b 81 ldd r25, Y+3 ; 0x03 13e08: ce 57 subi r28, 0x7E ; 126 13e0a: d0 40 sbci r29, 0x00 ; 0 13e0c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 13e10: ee 96 adiw r28, 0x3e ; 62 13e12: 6c af std Y+60, r22 ; 0x3c 13e14: 7d af std Y+61, r23 ; 0x3d 13e16: 8e af std Y+62, r24 ; 0x3e 13e18: 9f af std Y+63, r25 ; 0x3f 13e1a: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 13e1c: 2d 85 ldd r18, Y+13 ; 0x0d 13e1e: 3e 85 ldd r19, Y+14 ; 0x0e 13e20: 4f 85 ldd r20, Y+15 ; 0x0f 13e22: 58 89 ldd r21, Y+16 ; 0x10 13e24: 60 91 5e 05 lds r22, 0x055E ; 0x80055e 13e28: 70 91 5f 05 lds r23, 0x055F ; 0x80055f 13e2c: 80 91 60 05 lds r24, 0x0560 ; 0x800560 13e30: 90 91 61 05 lds r25, 0x0561 ; 0x800561 13e34: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13e38: a5 01 movw r20, r10 13e3a: 94 01 movw r18, r8 13e3c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 13e40: c2 58 subi r28, 0x82 ; 130 13e42: df 4f sbci r29, 0xFF ; 255 13e44: 68 83 st Y, r22 13e46: 79 83 std Y+1, r23 ; 0x01 13e48: 8a 83 std Y+2, r24 ; 0x02 13e4a: 9b 83 std Y+3, r25 ; 0x03 13e4c: ce 57 subi r28, 0x7E ; 126 13e4e: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13e50: a3 01 movw r20, r6 13e52: 92 01 movw r18, r4 13e54: c3 01 movw r24, r6 13e56: b2 01 movw r22, r4 13e58: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13e5c: 6b 01 movw r12, r22 13e5e: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13e60: ac 01 movw r20, r24 13e62: 9b 01 movw r18, r22 13e64: c3 01 movw r24, r6 13e66: b2 01 movw r22, r4 13e68: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13e6c: 20 e0 ldi r18, 0x00 ; 0 13e6e: 30 e0 ldi r19, 0x00 ; 0 13e70: 40 ec ldi r20, 0xC0 ; 192 13e72: 50 e4 ldi r21, 0x40 ; 64 13e74: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 13e78: 9b 01 movw r18, r22 13e7a: ac 01 movw r20, r24 13e7c: c3 01 movw r24, r6 13e7e: b2 01 movw r22, r4 13e80: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13e84: ae 96 adiw r28, 0x2e ; 46 13e86: 6c af std Y+60, r22 ; 0x3c 13e88: 7d af std Y+61, r23 ; 0x3d 13e8a: 8e af std Y+62, r24 ; 0x3e 13e8c: 9f af std Y+63, r25 ; 0x3f 13e8e: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13e90: 20 e0 ldi r18, 0x00 ; 0 13e92: 30 e0 ldi r19, 0x00 ; 0 13e94: 40 e0 ldi r20, 0x00 ; 0 13e96: 5f e3 ldi r21, 0x3F ; 63 13e98: c7 01 movw r24, r14 13e9a: b6 01 movw r22, r12 13e9c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13ea0: 9b 01 movw r18, r22 13ea2: ac 01 movw r20, r24 13ea4: 60 e0 ldi r22, 0x00 ; 0 13ea6: 70 e0 ldi r23, 0x00 ; 0 13ea8: 80 e8 ldi r24, 0x80 ; 128 13eaa: 9f e3 ldi r25, 0x3F ; 63 13eac: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13eb0: e6 96 adiw r28, 0x36 ; 54 13eb2: 6c af std Y+60, r22 ; 0x3c 13eb4: 7d af std Y+61, r23 ; 0x3d 13eb6: 8e af std Y+62, r24 ; 0x3e 13eb8: 9f af std Y+63, r25 ; 0x3f 13eba: 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++) { 13ebc: 22 24 eor r2, r2 13ebe: 23 94 inc r2 13ec0: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13ec2: 6f 96 adiw r28, 0x1f ; 31 13ec4: 8f ad ldd r24, Y+63 ; 0x3f 13ec6: 6f 97 sbiw r28, 0x1f ; 31 13ec8: 81 11 cpse r24, r1 13eca: 4d c1 rjmp .+666 ; 0x14166 // 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); 13ecc: b1 01 movw r22, r2 13ece: 90 e0 ldi r25, 0x00 ; 0 13ed0: 80 e0 ldi r24, 0x00 ; 0 13ed2: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 13ed6: a3 01 movw r20, r6 13ed8: 92 01 movw r18, r4 13eda: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13ede: 6b 01 movw r12, r22 13ee0: 7c 01 movw r14, r24 13ee2: 0f 94 ab df call 0x3bf56 ; 0x3bf56 13ee6: 6e 96 adiw r28, 0x1e ; 30 13ee8: 6c af std Y+60, r22 ; 0x3c 13eea: 7d af std Y+61, r23 ; 0x3d 13eec: 8e af std Y+62, r24 ; 0x3e 13eee: 9f af std Y+63, r25 ; 0x3f 13ef0: 6e 97 sbiw r28, 0x1e ; 30 13ef2: c7 01 movw r24, r14 13ef4: b6 01 movw r22, r12 13ef6: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 13efa: 4b 01 movw r8, r22 13efc: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 13efe: c0 90 8b 03 lds r12, 0x038B ; 0x80038b 13f02: d0 90 8c 03 lds r13, 0x038C ; 0x80038c 13f06: e0 90 8d 03 lds r14, 0x038D ; 0x80038d 13f0a: f0 90 8e 03 lds r15, 0x038E ; 0x80038e 13f0e: f7 fa bst r15, 7 13f10: f0 94 com r15 13f12: f7 f8 bld r15, 7 13f14: f0 94 com r15 13f16: 20 91 8f 03 lds r18, 0x038F ; 0x80038f 13f1a: 30 91 90 03 lds r19, 0x0390 ; 0x800390 13f1e: 40 91 91 03 lds r20, 0x0391 ; 0x800391 13f22: 50 91 92 03 lds r21, 0x0392 ; 0x800392 13f26: a2 96 adiw r28, 0x22 ; 34 13f28: 2c af std Y+60, r18 ; 0x3c 13f2a: 3d af std Y+61, r19 ; 0x3d 13f2c: 4e af std Y+62, r20 ; 0x3e 13f2e: 5f af std Y+63, r21 ; 0x3f 13f30: a2 97 sbiw r28, 0x22 ; 34 13f32: a7 01 movw r20, r14 13f34: 96 01 movw r18, r12 13f36: 6e 96 adiw r28, 0x1e ; 30 13f38: 6c ad ldd r22, Y+60 ; 0x3c 13f3a: 7d ad ldd r23, Y+61 ; 0x3d 13f3c: 8e ad ldd r24, Y+62 ; 0x3e 13f3e: 9f ad ldd r25, Y+63 ; 0x3f 13f40: 6e 97 sbiw r28, 0x1e ; 30 13f42: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13f46: 6a 96 adiw r28, 0x1a ; 26 13f48: 6c af std Y+60, r22 ; 0x3c 13f4a: 7d af std Y+61, r23 ; 0x3d 13f4c: 8e af std Y+62, r24 ; 0x3e 13f4e: 9f af std Y+63, r25 ; 0x3f 13f50: 6a 97 sbiw r28, 0x1a ; 26 13f52: a2 96 adiw r28, 0x22 ; 34 13f54: 2c ad ldd r18, Y+60 ; 0x3c 13f56: 3d ad ldd r19, Y+61 ; 0x3d 13f58: 4e ad ldd r20, Y+62 ; 0x3e 13f5a: 5f ad ldd r21, Y+63 ; 0x3f 13f5c: a2 97 sbiw r28, 0x22 ; 34 13f5e: c5 01 movw r24, r10 13f60: b4 01 movw r22, r8 13f62: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13f66: 9b 01 movw r18, r22 13f68: ac 01 movw r20, r24 13f6a: 6a 96 adiw r28, 0x1a ; 26 13f6c: 6c ad ldd r22, Y+60 ; 0x3c 13f6e: 7d ad ldd r23, Y+61 ; 0x3d 13f70: 8e ad ldd r24, Y+62 ; 0x3e 13f72: 9f ad ldd r25, Y+63 ; 0x3f 13f74: 6a 97 sbiw r28, 0x1a ; 26 13f76: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 13f7a: 6a 96 adiw r28, 0x1a ; 26 13f7c: 6c af std Y+60, r22 ; 0x3c 13f7e: 7d af std Y+61, r23 ; 0x3d 13f80: 8e af std Y+62, r24 ; 0x3e 13f82: 9f af std Y+63, r25 ; 0x3f 13f84: 6a 97 sbiw r28, 0x1a ; 26 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 13f86: a7 01 movw r20, r14 13f88: 96 01 movw r18, r12 13f8a: c5 01 movw r24, r10 13f8c: b4 01 movw r22, r8 13f8e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13f92: 6b 01 movw r12, r22 13f94: 7c 01 movw r14, r24 13f96: a2 96 adiw r28, 0x22 ; 34 13f98: 2c ad ldd r18, Y+60 ; 0x3c 13f9a: 3d ad ldd r19, Y+61 ; 0x3d 13f9c: 4e ad ldd r20, Y+62 ; 0x3e 13f9e: 5f ad ldd r21, Y+63 ; 0x3f 13fa0: a2 97 sbiw r28, 0x22 ; 34 13fa2: 6e 96 adiw r28, 0x1e ; 30 13fa4: 6c ad ldd r22, Y+60 ; 0x3c 13fa6: 7d ad ldd r23, Y+61 ; 0x3d 13fa8: 8e ad ldd r24, Y+62 ; 0x3e 13faa: 9f ad ldd r25, Y+63 ; 0x3f 13fac: 6e 97 sbiw r28, 0x1e ; 30 13fae: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 13fb2: 9b 01 movw r18, r22 13fb4: ac 01 movw r20, r24 13fb6: c7 01 movw r24, r14 13fb8: b6 01 movw r22, r12 13fba: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 13fbe: 6e 96 adiw r28, 0x1e ; 30 13fc0: 6c af std Y+60, r22 ; 0x3c 13fc2: 7d af std Y+61, r23 ; 0x3d 13fc4: 8e af std Y+62, r24 ; 0x3e 13fc6: 9f af std Y+63, r25 ; 0x3f 13fc8: 6e 97 sbiw r28, 0x1e ; 30 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 13fca: 30 91 38 07 lds r19, 0x0738 ; 0x800738 13fce: 6f 96 adiw r28, 0x1f ; 31 13fd0: 3f af std Y+63, r19 ; 0x3f 13fd2: 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; 13fd4: 6a 96 adiw r28, 0x1a ; 26 13fd6: 2c ad ldd r18, Y+60 ; 0x3c 13fd8: 3d ad ldd r19, Y+61 ; 0x3d 13fda: 4e ad ldd r20, Y+62 ; 0x3e 13fdc: 5f ad ldd r21, Y+63 ; 0x3f 13fde: 6a 97 sbiw r28, 0x1a ; 26 13fe0: ea 96 adiw r28, 0x3a ; 58 13fe2: 6c ad ldd r22, Y+60 ; 0x3c 13fe4: 7d ad ldd r23, Y+61 ; 0x3d 13fe6: 8e ad ldd r24, Y+62 ; 0x3e 13fe8: 9f ad ldd r25, Y+63 ; 0x3f 13fea: ea 97 sbiw r28, 0x3a ; 58 13fec: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 13ff0: 69 83 std Y+1, r22 ; 0x01 13ff2: 7a 83 std Y+2, r23 ; 0x02 13ff4: 8b 83 std Y+3, r24 ; 0x03 13ff6: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 13ff8: 6e 96 adiw r28, 0x1e ; 30 13ffa: 2c ad ldd r18, Y+60 ; 0x3c 13ffc: 3d ad ldd r19, Y+61 ; 0x3d 13ffe: 4e ad ldd r20, Y+62 ; 0x3e 14000: 5f ad ldd r21, Y+63 ; 0x3f 14002: 6e 97 sbiw r28, 0x1e ; 30 14004: ce 57 subi r28, 0x7E ; 126 14006: df 4f sbci r29, 0xFF ; 255 14008: 68 81 ld r22, Y 1400a: 79 81 ldd r23, Y+1 ; 0x01 1400c: 8a 81 ldd r24, Y+2 ; 0x02 1400e: 9b 81 ldd r25, Y+3 ; 0x03 14010: c2 58 subi r28, 0x82 ; 130 14012: d0 40 sbci r29, 0x00 ; 0 14014: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 14018: 6d 83 std Y+5, r22 ; 0x05 1401a: 7e 83 std Y+6, r23 ; 0x06 1401c: 8f 83 std Y+7, r24 ; 0x07 1401e: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 14020: ee 96 adiw r28, 0x3e ; 62 14022: 2c ad ldd r18, Y+60 ; 0x3c 14024: 3d ad ldd r19, Y+61 ; 0x3d 14026: 4e ad ldd r20, Y+62 ; 0x3e 14028: 5f ad ldd r21, Y+63 ; 0x3f 1402a: ee 97 sbiw r28, 0x3e ; 62 1402c: 69 85 ldd r22, Y+9 ; 0x09 1402e: 7a 85 ldd r23, Y+10 ; 0x0a 14030: 8b 85 ldd r24, Y+11 ; 0x0b 14032: 9c 85 ldd r25, Y+12 ; 0x0c 14034: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 14038: 69 87 std Y+9, r22 ; 0x09 1403a: 7a 87 std Y+10, r23 ; 0x0a 1403c: 8b 87 std Y+11, r24 ; 0x0b 1403e: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 14040: c2 58 subi r28, 0x82 ; 130 14042: df 4f sbci r29, 0xFF ; 255 14044: 28 81 ld r18, Y 14046: 39 81 ldd r19, Y+1 ; 0x01 14048: 4a 81 ldd r20, Y+2 ; 0x02 1404a: 5b 81 ldd r21, Y+3 ; 0x03 1404c: ce 57 subi r28, 0x7E ; 126 1404e: d0 40 sbci r29, 0x00 ; 0 14050: 6d 85 ldd r22, Y+13 ; 0x0d 14052: 7e 85 ldd r23, Y+14 ; 0x0e 14054: 8f 85 ldd r24, Y+15 ; 0x0f 14056: 98 89 ldd r25, Y+16 ; 0x10 14058: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1405c: 6d 87 std Y+13, r22 ; 0x0d 1405e: 7e 87 std Y+14, r23 ; 0x0e 14060: 8f 87 std Y+15, r24 ; 0x0f 14062: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 14064: ce 01 movw r24, r28 14066: 01 96 adiw r24, 0x01 ; 1 14068: 0e 94 76 6c call 0xd8ec ; 0xd8ec // Insert the segment into the buffer if (i >= start_segment_idx) 1406c: e0 96 adiw r28, 0x30 ; 48 1406e: 8e ad ldd r24, Y+62 ; 0x3e 14070: 9f ad ldd r25, Y+63 ; 0x3f 14072: e0 97 sbiw r28, 0x30 ; 48 14074: 28 16 cp r2, r24 14076: 39 06 cpc r3, r25 14078: 08 f1 brcs .+66 ; 0x140bc plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 1407a: e9 84 ldd r14, Y+9 ; 0x09 1407c: fa 84 ldd r15, Y+10 ; 0x0a 1407e: 0b 85 ldd r16, Y+11 ; 0x0b 14080: 1c 85 ldd r17, Y+12 ; 0x0c 14082: 2d 81 ldd r18, Y+5 ; 0x05 14084: 3e 81 ldd r19, Y+6 ; 0x06 14086: 4f 81 ldd r20, Y+7 ; 0x07 14088: 58 85 ldd r21, Y+8 ; 0x08 1408a: 69 81 ldd r22, Y+1 ; 0x01 1408c: 7a 81 ldd r23, Y+2 ; 0x02 1408e: 8b 81 ldd r24, Y+3 ; 0x03 14090: 9c 81 ldd r25, Y+4 ; 0x04 14092: 3f 92 push r3 14094: 2f 92 push r2 14096: a1 e4 ldi r26, 0x41 ; 65 14098: b7 e0 ldi r27, 0x07 ; 7 1409a: bf 93 push r27 1409c: af 93 push r26 1409e: aa 96 adiw r28, 0x2a ; 42 140a0: 8c ac ldd r8, Y+60 ; 0x3c 140a2: 9d ac ldd r9, Y+61 ; 0x3d 140a4: ae ac ldd r10, Y+62 ; 0x3e 140a6: bf ac ldd r11, Y+63 ; 0x3f 140a8: aa 97 sbiw r28, 0x2a ; 42 140aa: de 01 movw r26, r28 140ac: 1d 96 adiw r26, 0x0d ; 13 140ae: 6d 01 movw r12, r26 140b0: 0f 94 36 ab call 0x3566c ; 0x3566c 140b4: 0f 90 pop r0 140b6: 0f 90 pop r0 140b8: 0f 90 pop r0 140ba: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 140bc: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 140c0: 81 11 cpse r24, r1 140c2: 3d c0 rjmp .+122 ; 0x1413e 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++) { 140c4: bf ef ldi r27, 0xFF ; 255 140c6: 2b 1a sub r2, r27 140c8: 3b 0a sbc r3, r27 140ca: a4 96 adiw r28, 0x24 ; 36 140cc: ee ad ldd r30, Y+62 ; 0x3e 140ce: ff ad ldd r31, Y+63 ; 0x3f 140d0: a4 97 sbiw r28, 0x24 ; 36 140d2: e2 15 cp r30, r2 140d4: f3 05 cpc r31, r3 140d6: 09 f0 breq .+2 ; 0x140da 140d8: f4 ce rjmp .-536 ; 0x13ec2 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 140da: 82 e5 ldi r24, 0x52 ; 82 140dc: 95 e0 ldi r25, 0x05 ; 5 140de: 0e 94 76 6c call 0xd8ec ; 0xd8ec // 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); 140e2: e0 90 5a 05 lds r14, 0x055A ; 0x80055a 140e6: f0 90 5b 05 lds r15, 0x055B ; 0x80055b 140ea: 00 91 5c 05 lds r16, 0x055C ; 0x80055c 140ee: 10 91 5d 05 lds r17, 0x055D ; 0x80055d 140f2: 20 91 56 05 lds r18, 0x0556 ; 0x800556 140f6: 30 91 57 05 lds r19, 0x0557 ; 0x800557 140fa: 40 91 58 05 lds r20, 0x0558 ; 0x800558 140fe: 50 91 59 05 lds r21, 0x0559 ; 0x800559 14102: 60 91 52 05 lds r22, 0x0552 ; 0x800552 14106: 70 91 53 05 lds r23, 0x0553 ; 0x800553 1410a: 80 91 54 05 lds r24, 0x0554 ; 0x800554 1410e: 90 91 55 05 lds r25, 0x0555 ; 0x800555 14112: 1f 92 push r1 14114: 1f 92 push r1 14116: e1 e4 ldi r30, 0x41 ; 65 14118: f7 e0 ldi r31, 0x07 ; 7 1411a: ff 93 push r31 1411c: ef 93 push r30 1411e: aa 96 adiw r28, 0x2a ; 42 14120: 8c ac ldd r8, Y+60 ; 0x3c 14122: 9d ac ldd r9, Y+61 ; 0x3d 14124: ae ac ldd r10, Y+62 ; 0x3e 14126: bf ac ldd r11, Y+63 ; 0x3f 14128: aa 97 sbiw r28, 0x2a ; 42 1412a: ee e5 ldi r30, 0x5E ; 94 1412c: ce 2e mov r12, r30 1412e: e5 e0 ldi r30, 0x05 ; 5 14130: de 2e mov r13, r30 14132: 0f 94 36 ab call 0x3566c ; 0x3566c 14136: 0f 90 pop r0 14138: 0f 90 pop r0 1413a: 0f 90 pop r0 1413c: 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(); 1413e: 0e 94 9d 5b call 0xb73a ; 0xb73a previous_millis_cmd.start(); 14142: 86 e8 ldi r24, 0x86 ; 134 14144: 93 e0 ldi r25, 0x03 ; 3 14146: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> 1414a: 7b cb rjmp .-2314 ; 0x13842 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; 1414c: 60 e0 ldi r22, 0x00 ; 0 1414e: 70 e0 ldi r23, 0x00 ; 0 14150: cb 01 movw r24, r22 14152: fe cb rjmp .-2052 ; 0x13950 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; 14154: a3 2c mov r10, r3 14156: b2 2c mov r11, r2 14158: 6f 96 adiw r28, 0x1f ; 31 1415a: 0f ad ldd r16, Y+63 ; 0x3f 1415c: 6f 97 sbiw r28, 0x1f ; 31 1415e: a3 96 adiw r28, 0x23 ; 35 14160: 1f ad ldd r17, Y+63 ; 0x3f 14162: a3 97 sbiw r28, 0x23 ; 35 14164: 69 cd rjmp .-1326 ; 0x13c38 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) { 14166: 6f 96 adiw r28, 0x1f ; 31 14168: 4f ad ldd r20, Y+63 ; 0x3f 1416a: 6f 97 sbiw r28, 0x1f ; 31 1416c: 41 50 subi r20, 0x01 ; 1 1416e: 6f 96 adiw r28, 0x1f ; 31 14170: 4f af std Y+63, r20 ; 0x3f 14172: 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; 14174: ae 96 adiw r28, 0x2e ; 46 14176: 2c ad ldd r18, Y+60 ; 0x3c 14178: 3d ad ldd r19, Y+61 ; 0x3d 1417a: 4e ad ldd r20, Y+62 ; 0x3e 1417c: 5f ad ldd r21, Y+63 ; 0x3f 1417e: ae 97 sbiw r28, 0x2e ; 46 14180: 6a 96 adiw r28, 0x1a ; 26 14182: 6c ad ldd r22, Y+60 ; 0x3c 14184: 7d ad ldd r23, Y+61 ; 0x3d 14186: 8e ad ldd r24, Y+62 ; 0x3e 14188: 9f ad ldd r25, Y+63 ; 0x3f 1418a: 6a 97 sbiw r28, 0x1a ; 26 1418c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 14190: 6b 01 movw r12, r22 14192: 7c 01 movw r14, r24 14194: e6 96 adiw r28, 0x36 ; 54 14196: 2c ad ldd r18, Y+60 ; 0x3c 14198: 3d ad ldd r19, Y+61 ; 0x3d 1419a: 4e ad ldd r20, Y+62 ; 0x3e 1419c: 5f ad ldd r21, Y+63 ; 0x3f 1419e: e6 97 sbiw r28, 0x36 ; 54 141a0: 6e 96 adiw r28, 0x1e ; 30 141a2: 6c ad ldd r22, Y+60 ; 0x3c 141a4: 7d ad ldd r23, Y+61 ; 0x3d 141a6: 8e ad ldd r24, Y+62 ; 0x3e 141a8: 9f ad ldd r25, Y+63 ; 0x3f 141aa: 6e 97 sbiw r28, 0x1e ; 30 141ac: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 141b0: 9b 01 movw r18, r22 141b2: ac 01 movw r20, r24 141b4: c7 01 movw r24, r14 141b6: b6 01 movw r22, r12 141b8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 141bc: 7b 01 movw r14, r22 141be: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 141c0: e6 96 adiw r28, 0x36 ; 54 141c2: 2c ad ldd r18, Y+60 ; 0x3c 141c4: 3d ad ldd r19, Y+61 ; 0x3d 141c6: 4e ad ldd r20, Y+62 ; 0x3e 141c8: 5f ad ldd r21, Y+63 ; 0x3f 141ca: e6 97 sbiw r28, 0x36 ; 54 141cc: 6a 96 adiw r28, 0x1a ; 26 141ce: 6c ad ldd r22, Y+60 ; 0x3c 141d0: 7d ad ldd r23, Y+61 ; 0x3d 141d2: 8e ad ldd r24, Y+62 ; 0x3e 141d4: 9f ad ldd r25, Y+63 ; 0x3f 141d6: 6a 97 sbiw r28, 0x1a ; 26 141d8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 141dc: 4b 01 movw r8, r22 141de: 5c 01 movw r10, r24 141e0: ae 96 adiw r28, 0x2e ; 46 141e2: 2c ad ldd r18, Y+60 ; 0x3c 141e4: 3d ad ldd r19, Y+61 ; 0x3d 141e6: 4e ad ldd r20, Y+62 ; 0x3e 141e8: 5f ad ldd r21, Y+63 ; 0x3f 141ea: ae 97 sbiw r28, 0x2e ; 46 141ec: 6e 96 adiw r28, 0x1e ; 30 141ee: 6c ad ldd r22, Y+60 ; 0x3c 141f0: 7d ad ldd r23, Y+61 ; 0x3d 141f2: 8e ad ldd r24, Y+62 ; 0x3e 141f4: 9f ad ldd r25, Y+63 ; 0x3f 141f6: 6e 97 sbiw r28, 0x1e ; 30 141f8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 141fc: 9b 01 movw r18, r22 141fe: ac 01 movw r20, r24 14200: c5 01 movw r24, r10 14202: b4 01 movw r22, r8 14204: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 14208: 6a 96 adiw r28, 0x1a ; 26 1420a: 6c af std Y+60, r22 ; 0x3c 1420c: 7d af std Y+61, r23 ; 0x3d 1420e: 8e af std Y+62, r24 ; 0x3e 14210: 9f af std Y+63, r25 ; 0x3f 14212: 6a 97 sbiw r28, 0x1a ; 26 r_axis_y = r_axisi; 14214: c7 01 movw r24, r14 14216: d8 01 movw r26, r16 14218: 6e 96 adiw r28, 0x1e ; 30 1421a: 8c af std Y+60, r24 ; 0x3c 1421c: 9d af std Y+61, r25 ; 0x3d 1421e: ae af std Y+62, r26 ; 0x3e 14220: bf af std Y+63, r27 ; 0x3f 14222: 6e 97 sbiw r28, 0x1e ; 30 14224: d7 ce rjmp .-594 ; 0x13fd4 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14226: 80 e5 ldi r24, 0x50 ; 80 14228: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 1422c: c1 2c mov r12, r1 1422e: d1 2c mov r13, r1 14230: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14232: 88 23 and r24, r24 14234: 31 f0 breq .+12 ; 0x14242 14236: 0e 94 4a 61 call 0xc294 ; 0xc294 1423a: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 1423e: 6b 01 movw r12, r22 14240: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 14242: 83 e5 ldi r24, 0x53 ; 83 14244: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 14248: 88 23 and r24, r24 1424a: 61 f0 breq .+24 ; 0x14264 1424c: 0e 94 4a 61 call 0xc294 ; 0xc294 14250: 20 e0 ldi r18, 0x00 ; 0 14252: 30 e0 ldi r19, 0x00 ; 0 14254: 4a e7 ldi r20, 0x7A ; 122 14256: 54 e4 ldi r21, 0x44 ; 68 14258: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1425c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 14260: 6b 01 movw r12, r22 14262: 7c 01 movw r14, r24 if(codenum != 0) 14264: c1 14 cp r12, r1 14266: d1 04 cpc r13, r1 14268: e1 04 cpc r14, r1 1426a: f1 04 cpc r15, r1 1426c: 41 f0 breq .+16 ; 0x1427e { if(custom_message_type != CustomMsg::M117) 1426e: 80 91 73 07 lds r24, 0x0773 ; 0x800773 14272: 87 30 cpi r24, 0x07 ; 7 14274: 21 f0 breq .+8 ; 0x1427e { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 14276: 8f eb ldi r24, 0xBF ; 191 14278: 9a e6 ldi r25, 0x6A ; 106 1427a: 0f 94 e2 0b call 0x217c4 ; 0x217c4 } } st_synchronize(); 1427e: 0f 94 24 59 call 0x2b248 ; 0x2b248 codenum += _millis(); // keep track of when we started waiting 14282: 0f 94 83 3f call 0x27f06 ; 0x27f06 14286: c6 0e add r12, r22 14288: d7 1e adc r13, r23 1428a: e8 1e adc r14, r24 1428c: f9 1e adc r15, r25 previous_millis_cmd.start(); 1428e: 86 e8 ldi r24, 0x86 ; 134 14290: 93 e0 ldi r25, 0x03 ; 3 14292: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> while(_millis() < codenum) { 14296: 0f 94 83 3f call 0x27f06 ; 0x27f06 1429a: 6c 15 cp r22, r12 1429c: 7d 05 cpc r23, r13 1429e: 8e 05 cpc r24, r14 142a0: 9f 05 cpc r25, r15 142a2: 08 f0 brcs .+2 ; 0x142a6 142a4: ce ca rjmp .-2660 ; 0x13842 manage_heater(); 142a6: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(); 142aa: 80 e0 ldi r24, 0x00 ; 0 142ac: 0e 94 da 8b call 0x117b4 ; 0x117b4 lcd_update(0); 142b0: 80 e0 ldi r24, 0x00 ; 0 142b2: 0e 94 54 6f call 0xdea8 ; 0xdea8 142b6: ef cf rjmp .-34 ; 0x14296 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); 142b8: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 142ba: 0f 94 f2 89 call 0x313e4 ; 0x313e4 142be: c1 ca rjmp .-2686 ; 0x13842 142c0: 80 e0 ldi r24, 0x00 ; 0 142c2: fb cf rjmp .-10 ; 0x142ba - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 142c4: 6e 96 adiw r28, 0x1e ; 30 142c6: 1c ae std Y+60, r1 ; 0x3c 142c8: 1d ae std Y+61, r1 ; 0x3d 142ca: 1e ae std Y+62, r1 ; 0x3e 142cc: 1f ae std Y+63, r1 ; 0x3f 142ce: 6e 97 sbiw r28, 0x1e ; 30 142d0: 35 ca rjmp .-2966 ; 0x1373c Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 142d2: 0f 94 24 59 call 0x2b248 ; 0x2b248 homing_flag = true; 142d6: 81 e0 ldi r24, 0x01 ; 1 142d8: 80 93 56 0e sts 0x0E56, r24 ; 0x800e56 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 142dc: 0e 94 95 67 call 0xcf2a ; 0xcf2a 142e0: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 142e2: 80 e0 ldi r24, 0x00 ; 0 142e4: 90 e0 ldi r25, 0x00 ; 0 142e6: a8 e4 ldi r26, 0x48 ; 72 142e8: b4 e4 ldi r27, 0x44 ; 68 142ea: 80 93 90 02 sts 0x0290, r24 ; 0x800290 142ee: 90 93 91 02 sts 0x0291, r25 ; 0x800291 142f2: a0 93 92 02 sts 0x0292, r26 ; 0x800292 142f6: b0 93 93 02 sts 0x0293, r27 ; 0x800293 find_bed_induction_sensor_point_z(-10.f, 3); 142fa: 43 e0 ldi r20, 0x03 ; 3 142fc: 60 e0 ldi r22, 0x00 ; 0 142fe: 70 e0 ldi r23, 0x00 ; 0 14300: 80 e2 ldi r24, 0x20 ; 32 14302: 91 ec ldi r25, 0xC1 ; 193 14304: 0f 94 21 8c call 0x31842 ; 0x31842 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 14308: 70 90 49 07 lds r7, 0x0749 ; 0x800749 1430c: 60 90 4a 07 lds r6, 0x074A ; 0x80074a 14310: 50 90 4b 07 lds r5, 0x074B ; 0x80074b 14314: 40 90 4c 07 lds r4, 0x074C ; 0x80074c 14318: b0 90 45 07 lds r11, 0x0745 ; 0x800745 1431c: a0 90 46 07 lds r10, 0x0746 ; 0x800746 14320: 90 90 47 07 lds r9, 0x0747 ; 0x800747 14324: 80 90 48 07 lds r8, 0x0748 ; 0x800748 14328: f0 90 41 07 lds r15, 0x0741 ; 0x800741 1432c: e0 90 42 07 lds r14, 0x0742 ; 0x800742 14330: d0 90 43 07 lds r13, 0x0743 ; 0x800743 14334: c0 90 44 07 lds r12, 0x0744 ; 0x800744 14338: 86 e2 ldi r24, 0x26 ; 38 1433a: 97 e5 ldi r25, 0x57 ; 87 1433c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 14340: 4f 92 push r4 14342: 5f 92 push r5 14344: 6f 92 push r6 14346: 7f 92 push r7 14348: 8f 92 push r8 1434a: 9f 92 push r9 1434c: af 92 push r10 1434e: bf 92 push r11 14350: cf 92 push r12 14352: df 92 push r13 14354: ef 92 push r14 14356: ff 92 push r15 14358: 9f 93 push r25 1435a: 8f 93 push r24 1435c: 83 ea ldi r24, 0xA3 ; 163 1435e: 9a e6 ldi r25, 0x6A ; 106 14360: 9f 93 push r25 14362: 8f 93 push r24 14364: 0f 94 4b dc call 0x3b896 ; 0x3b896 clean_up_after_endstop_move(l_feedmultiply); 14368: c8 01 movw r24, r16 1436a: 0e 94 7b 67 call 0xcef6 ; 0xcef6 homing_flag = false; 1436e: 10 92 56 0e sts 0x0E56, r1 ; 0x800e56 14372: 0f b6 in r0, 0x3f ; 63 14374: f8 94 cli 14376: de bf out 0x3e, r29 ; 62 14378: 0f be out 0x3f, r0 ; 63 1437a: cd bf out 0x3d, r28 ; 61 1437c: 62 ca rjmp .-2876 ; 0x13842 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 1437e: 20 e0 ldi r18, 0x00 ; 0 14380: 30 e0 ldi r19, 0x00 ; 0 14382: 40 e2 ldi r20, 0x20 ; 32 14384: 51 e4 ldi r21, 0x41 ; 65 14386: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1438a: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1438e: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14392: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 14396: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1439a: 87 ff sbrs r24, 7 1439c: 05 c0 rjmp .+10 ; 0x143a8 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 1439e: 8d ed ldi r24, 0xDD ; 221 143a0: 98 e8 ldi r25, 0x88 ; 136 143a2: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 143a6: 4d ca rjmp .-2918 ; 0x13842 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 143a8: 82 e0 ldi r24, 0x02 ; 2 143aa: 0e 94 43 f9 call 0x1f286 ; 0x1f286 143ae: 81 11 cpse r24, r1 143b0: 07 c0 rjmp .+14 ; 0x143c0 //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)); 143b2: 8e e0 ldi r24, 0x0E ; 14 143b4: 9a e3 ldi r25, 0x3A ; 58 143b6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 143ba: 0f 94 04 36 call 0x26c08 ; 0x26c08 143be: 41 ca rjmp .-2942 ; 0x13842 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 143c0: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 143c4: 88 23 and r24, r24 143c6: 41 f0 breq .+16 ; 0x143d8 143c8: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 143cc: 88 23 and r24, r24 143ce: 21 f0 breq .+8 ; 0x143d8 143d0: 10 91 40 07 lds r17, 0x0740 ; 0x800740 143d4: 11 11 cpse r17, r1 143d6: 08 c0 rjmp .+16 ; 0x143e8 143d8: 81 e0 ldi r24, 0x01 ; 1 143da: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e { // 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); 143de: 81 e2 ldi r24, 0x21 ; 33 143e0: 9c e6 ldi r25, 0x6C ; 108 143e2: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 143e6: 2d ca rjmp .-2982 ; 0x13842 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 143e8: 85 ec ldi r24, 0xC5 ; 197 143ea: 99 e3 ldi r25, 0x39 ; 57 143ec: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 143f0: 0f 94 04 36 call 0x26c08 ; 0x26c08 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 143f4: 80 e0 ldi r24, 0x00 ; 0 143f6: 92 e5 ldi r25, 0x52 ; 82 143f8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 143fc: 41 e0 ldi r20, 0x01 ; 1 143fe: 60 e0 ldi r22, 0x00 ; 0 14400: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 if (result == LCD_LEFT_BUTTON_CHOICE) 14404: 81 11 cpse r24, r1 14406: 61 c0 rjmp .+194 ; 0x144ca { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14408: 80 e0 ldi r24, 0x00 ; 0 1440a: 90 e0 ldi r25, 0x00 ; 0 1440c: a0 ea ldi r26, 0xA0 ; 160 1440e: b0 e4 ldi r27, 0x40 ; 64 14410: 80 93 49 07 sts 0x0749, r24 ; 0x800749 14414: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 14418: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 1441c: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(3000 / 60); 14420: 60 e0 ldi r22, 0x00 ; 0 14422: 70 e0 ldi r23, 0x00 ; 0 14424: 88 e4 ldi r24, 0x48 ; 72 14426: 92 e4 ldi r25, 0x42 ; 66 14428: 0f 94 8b ba call 0x37516 ; 0x37516 current_position[Z_AXIS] = 50; 1442c: 80 e0 ldi r24, 0x00 ; 0 1442e: 90 e0 ldi r25, 0x00 ; 0 14430: a8 e4 ldi r26, 0x48 ; 72 14432: b2 e4 ldi r27, 0x42 ; 66 14434: 80 93 49 07 sts 0x0749, r24 ; 0x800749 14438: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 1443c: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 14440: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c current_position[Y_AXIS] = 180; 14444: 80 e0 ldi r24, 0x00 ; 0 14446: 90 e0 ldi r25, 0x00 ; 0 14448: a4 e3 ldi r26, 0x34 ; 52 1444a: b3 e4 ldi r27, 0x43 ; 67 1444c: 80 93 45 07 sts 0x0745, r24 ; 0x800745 14450: 90 93 46 07 sts 0x0746, r25 ; 0x800746 14454: a0 93 47 07 sts 0x0747, r26 ; 0x800747 14458: b0 93 48 07 sts 0x0748, r27 ; 0x800748 plan_buffer_line_curposXYZE(3000 / 60); 1445c: 60 e0 ldi r22, 0x00 ; 0 1445e: 70 e0 ldi r23, 0x00 ; 0 14460: 88 e4 ldi r24, 0x48 ; 72 14462: 92 e4 ldi r25, 0x42 ; 66 14464: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 14468: 0f 94 24 59 call 0x2b248 ; 0x2b248 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 1446c: 86 ed ldi r24, 0xD6 ; 214 1446e: 91 e5 ldi r25, 0x51 ; 81 14470: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 14474: 0f 94 04 36 call 0x26c08 ; 0x26c08 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14478: ea e1 ldi r30, 0x1A ; 26 1447a: f2 e9 ldi r31, 0x92 ; 146 1447c: 85 91 lpm r24, Z+ 1447e: 95 91 lpm r25, Z+ 14480: a5 91 lpm r26, Z+ 14482: b4 91 lpm r27, Z 14484: 80 93 45 07 sts 0x0745, r24 ; 0x800745 14488: 90 93 46 07 sts 0x0746, r25 ; 0x800746 1448c: a0 93 47 07 sts 0x0747, r26 ; 0x800747 14490: b0 93 48 07 sts 0x0748, r27 ; 0x800748 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14494: e6 e1 ldi r30, 0x16 ; 22 14496: f2 e9 ldi r31, 0x92 ; 146 14498: 85 91 lpm r24, Z+ 1449a: 95 91 lpm r25, Z+ 1449c: a5 91 lpm r26, Z+ 1449e: b4 91 lpm r27, Z 144a0: 80 93 41 07 sts 0x0741, r24 ; 0x800741 144a4: 90 93 42 07 sts 0x0742, r25 ; 0x800742 144a8: a0 93 43 07 sts 0x0743, r26 ; 0x800743 144ac: b0 93 44 07 sts 0x0744, r27 ; 0x800744 plan_buffer_line_curposXYZE(3000 / 60); 144b0: 60 e0 ldi r22, 0x00 ; 0 144b2: 70 e0 ldi r23, 0x00 ; 0 144b4: 88 e4 ldi r24, 0x48 ; 72 144b6: 92 e4 ldi r25, 0x42 ; 66 144b8: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 144bc: 0f 94 24 59 call 0x2b248 ; 0x2b248 gcode_G28(false, false, true); 144c0: 41 e0 ldi r20, 0x01 ; 1 144c2: 60 e0 ldi r22, 0x00 ; 0 144c4: 80 e0 ldi r24, 0x00 ; 0 144c6: 0e 94 88 80 call 0x10110 ; 0x10110 } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 144ca: 20 e0 ldi r18, 0x00 ; 0 144cc: 30 e0 ldi r19, 0x00 ; 0 144ce: 4c e0 ldi r20, 0x0C ; 12 144d0: 52 e4 ldi r21, 0x42 ; 66 144d2: 60 91 97 03 lds r22, 0x0397 ; 0x800397 144d6: 70 91 98 03 lds r23, 0x0398 ; 0x800398 144da: 80 91 99 03 lds r24, 0x0399 ; 0x800399 144de: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 144e2: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 144e6: 18 16 cp r1, r24 144e8: 0c f0 brlt .+2 ; 0x144ec 144ea: 73 c0 rjmp .+230 ; 0x145d2 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 144ec: 80 e0 ldi r24, 0x00 ; 0 144ee: 90 e0 ldi r25, 0x00 ; 0 144f0: a8 ec ldi r26, 0xC8 ; 200 144f2: b2 e4 ldi r27, 0x42 ; 66 144f4: 80 93 49 07 sts 0x0749, r24 ; 0x800749 144f8: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 144fc: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 14500: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(3000 / 60); 14504: 60 e0 ldi r22, 0x00 ; 0 14506: 70 e0 ldi r23, 0x00 ; 0 14508: 88 e4 ldi r24, 0x48 ; 72 1450a: 92 e4 ldi r25, 0x42 ; 66 1450c: 0f 94 8b ba call 0x37516 ; 0x37516 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 14510: 0f 94 4f 45 call 0x28a9e ; 0x28a9e LongTimer pinda_timeout; 14514: 19 82 std Y+1, r1 ; 0x01 14516: 1a 82 std Y+2, r1 ; 0x02 14518: 1b 82 std Y+3, r1 ; 0x03 1451a: 1c 82 std Y+4, r1 ; 0x04 1451c: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 1451e: ce 01 movw r24, r28 14520: 01 96 adiw r24, 0x01 ; 1 14522: 0f 94 26 42 call 0x2844c ; 0x2844c ::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); 14526: 03 e2 ldi r16, 0x23 ; 35 14528: 9d e0 ldi r25, 0x0D ; 13 1452a: e9 2e mov r14, r25 1452c: 96 e8 ldi r25, 0x86 ; 134 1452e: f9 2e mov r15, r25 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 14530: 20 e0 ldi r18, 0x00 ; 0 14532: 30 e0 ldi r19, 0x00 ; 0 14534: 4c e0 ldi r20, 0x0C ; 12 14536: 52 e4 ldi r21, 0x42 ; 66 14538: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1453c: 70 91 98 03 lds r23, 0x0398 ; 0x800398 14540: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14544: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 14548: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1454c: 18 16 cp r1, r24 1454e: c4 f5 brge .+112 ; 0x145c0 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14550: 87 e7 ldi r24, 0x77 ; 119 14552: 99 e3 ldi r25, 0x39 ; 57 14554: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 14558: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1455c: 42 e8 ldi r20, 0x82 ; 130 1455e: 64 e0 ldi r22, 0x04 ; 4 14560: 80 e0 ldi r24, 0x00 ; 0 14562: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 14566: 1f 92 push r1 14568: 0f 93 push r16 1456a: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1456e: 70 91 98 03 lds r23, 0x0398 ; 0x800398 14572: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14576: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1457a: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 1457e: 7f 93 push r23 14580: 6f 93 push r22 14582: ff 92 push r15 14584: ef 92 push r14 14586: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_putc(LCD_STR_DEGREE[0]); 1458a: 81 e8 ldi r24, 0x81 ; 129 1458c: 0e 94 7c 6f call 0xdef8 ; 0xdef8 delay_keep_alive(1000); 14590: 88 ee ldi r24, 0xE8 ; 232 14592: 93 e0 ldi r25, 0x03 ; 3 14594: 0e 94 7f 8e call 0x11cfe ; 0x11cfe serialecho_temperatures(); 14598: 0e 94 e1 78 call 0xf1c2 ; 0xf1c2 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 1459c: 40 e0 ldi r20, 0x00 ; 0 1459e: 53 e5 ldi r21, 0x53 ; 83 145a0: 67 e0 ldi r22, 0x07 ; 7 145a2: 70 e0 ldi r23, 0x00 ; 0 145a4: ce 01 movw r24, r28 145a6: 01 96 adiw r24, 0x01 ; 1 145a8: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 145ac: 0f 90 pop r0 145ae: 0f 90 pop r0 145b0: 0f 90 pop r0 145b2: 0f 90 pop r0 145b4: 0f 90 pop r0 145b6: 0f 90 pop r0 145b8: 88 23 and r24, r24 145ba: 09 f4 brne .+2 ; 0x145be 145bc: b9 cf rjmp .-142 ; 0x14530 target_temp_reached = false; 145be: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 145c0: 81 e0 ldi r24, 0x01 ; 1 145c2: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 145c6: 11 11 cpse r17, r1 145c8: 04 c0 rjmp .+8 ; 0x145d2 lcd_temp_cal_show_result(false); 145ca: 80 e0 ldi r24, 0x00 ; 0 145cc: 0f 94 95 36 call 0x26d2a ; 0x26d2a 145d0: 38 c9 rjmp .-3472 ; 0x13842 break; } } st_synchronize(); 145d2: 0f 94 24 59 call 0x2b248 ; 0x2b248 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 145d6: 81 e0 ldi r24, 0x01 ; 1 145d8: 80 93 56 0e sts 0x0E56, r24 ; 0x800e56 lcd_update_enable(true); 145dc: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 145e0: 8f eb ldi r24, 0xBF ; 191 145e2: 98 e8 ldi r25, 0x88 ; 136 145e4: 0e 94 fe 7a call 0xf5fc ; 0xf5fc float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 145e8: 80 90 97 03 lds r8, 0x0397 ; 0x800397 145ec: 90 90 98 03 lds r9, 0x0398 ; 0x800398 145f0: a0 90 99 03 lds r10, 0x0399 ; 0x800399 145f4: b0 90 9a 03 lds r11, 0x039A ; 0x80039a 145f8: 20 e0 ldi r18, 0x00 ; 0 145fa: 30 e0 ldi r19, 0x00 ; 0 145fc: 40 ea ldi r20, 0xA0 ; 160 145fe: 50 e4 ldi r21, 0x40 ; 64 14600: c5 01 movw r24, r10 14602: b4 01 movw r22, r8 14604: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 14608: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 1460c: 25 e0 ldi r18, 0x05 ; 5 1460e: 26 9f mul r18, r22 14610: a0 01 movw r20, r0 14612: 27 9f mul r18, r23 14614: 50 0d add r21, r0 14616: 11 24 eor r1, r1 14618: ba 01 movw r22, r20 1461a: 55 0f add r21, r21 1461c: 88 0b sbc r24, r24 1461e: 99 0b sbc r25, r25 14620: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 14624: 1b 01 movw r2, r22 14626: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 14628: 20 e0 ldi r18, 0x00 ; 0 1462a: 30 e0 ldi r19, 0x00 ; 0 1462c: 4c e0 ldi r20, 0x0C ; 12 1462e: 52 e4 ldi r21, 0x42 ; 66 14630: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 14634: 87 ff sbrs r24, 7 14636: 06 c0 rjmp .+12 ; 0x14644 14638: 21 2c mov r2, r1 1463a: 31 2c mov r3, r1 1463c: 0c e0 ldi r16, 0x0C ; 12 1463e: e0 2e mov r14, r16 14640: 82 e4 ldi r24, 0x42 ; 66 14642: f8 2e mov r15, r24 if (start_temp < current_temperature_pinda) start_temp += 5; 14644: 22 2d mov r18, r2 14646: 33 2d mov r19, r3 14648: 4e 2d mov r20, r14 1464a: 5f 2d mov r21, r15 1464c: c5 01 movw r24, r10 1464e: b4 01 movw r22, r8 14650: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 14654: 18 16 cp r1, r24 14656: 64 f4 brge .+24 ; 0x14670 14658: 20 e0 ldi r18, 0x00 ; 0 1465a: 30 e0 ldi r19, 0x00 ; 0 1465c: 40 ea ldi r20, 0xA0 ; 160 1465e: 50 e4 ldi r21, 0x40 ; 64 14660: 62 2d mov r22, r2 14662: 73 2d mov r23, r3 14664: 8e 2d mov r24, r14 14666: 9f 2d mov r25, r15 14668: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1466c: 1b 01 movw r2, r22 1466e: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 14670: ff 92 push r15 14672: ef 92 push r14 14674: 3f 92 push r3 14676: 2f 92 push r2 14678: 81 e8 ldi r24, 0x81 ; 129 1467a: 9a e6 ldi r25, 0x6A ; 106 1467c: 9f 93 push r25 1467e: 8f 93 push r24 14680: 0f 94 4b dc call 0x3b896 ; 0x3b896 setTargetBed(70 + (start_temp - 30)); 14684: 20 e0 ldi r18, 0x00 ; 0 14686: 30 e0 ldi r19, 0x00 ; 0 14688: 40 ef ldi r20, 0xF0 ; 240 1468a: 51 e4 ldi r21, 0x41 ; 65 1468c: 62 2d mov r22, r2 1468e: 73 2d mov r23, r3 14690: 8e 2d mov r24, r14 14692: 9f 2d mov r25, r15 14694: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 14698: 20 e0 ldi r18, 0x00 ; 0 1469a: 30 e0 ldi r19, 0x00 ; 0 1469c: 4c e8 ldi r20, 0x8C ; 140 1469e: 52 e4 ldi r21, 0x42 ; 66 146a0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 146a4: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 146a8: 70 93 6a 0e sts 0x0E6A, r23 ; 0x800e6a 146ac: 60 93 69 0e sts 0x0E69, r22 ; 0x800e69 custom_message_type = CustomMsg::TempCal; 146b0: 84 e0 ldi r24, 0x04 ; 4 146b2: 80 93 73 07 sts 0x0773, r24 ; 0x800773 custom_message_state = 1; 146b6: 81 e0 ldi r24, 0x01 ; 1 146b8: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 146bc: 82 e3 ldi r24, 0x32 ; 50 146be: 9a e3 ldi r25, 0x3A ; 58 146c0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 146c4: 0f 94 e2 0b call 0x217c4 ; 0x217c4 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 146c8: 80 e0 ldi r24, 0x00 ; 0 146ca: 90 e0 ldi r25, 0x00 ; 0 146cc: a0 ea ldi r26, 0xA0 ; 160 146ce: b0 e4 ldi r27, 0x40 ; 64 146d0: 80 93 49 07 sts 0x0749, r24 ; 0x800749 146d4: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 146d8: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 146dc: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(3000 / 60); 146e0: 60 e0 ldi r22, 0x00 ; 0 146e2: 70 e0 ldi r23, 0x00 ; 0 146e4: 88 e4 ldi r24, 0x48 ; 72 146e6: 92 e4 ldi r25, 0x42 ; 66 146e8: 0f 94 8b ba call 0x37516 ; 0x37516 current_position[X_AXIS] = PINDA_PREHEAT_X; 146ec: 80 e0 ldi r24, 0x00 ; 0 146ee: 90 e0 ldi r25, 0x00 ; 0 146f0: a0 ea ldi r26, 0xA0 ; 160 146f2: b1 e4 ldi r27, 0x41 ; 65 146f4: 80 93 41 07 sts 0x0741, r24 ; 0x800741 146f8: 90 93 42 07 sts 0x0742, r25 ; 0x800742 146fc: a0 93 43 07 sts 0x0743, r26 ; 0x800743 14700: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14704: 80 e0 ldi r24, 0x00 ; 0 14706: 90 e0 ldi r25, 0x00 ; 0 14708: a0 e7 ldi r26, 0x70 ; 112 1470a: b2 e4 ldi r27, 0x42 ; 66 1470c: 80 93 45 07 sts 0x0745, r24 ; 0x800745 14710: 90 93 46 07 sts 0x0746, r25 ; 0x800746 14714: a0 93 47 07 sts 0x0747, r26 ; 0x800747 14718: b0 93 48 07 sts 0x0748, r27 ; 0x800748 plan_buffer_line_curposXYZE(3000 / 60); 1471c: 60 e0 ldi r22, 0x00 ; 0 1471e: 70 e0 ldi r23, 0x00 ; 0 14720: 88 e4 ldi r24, 0x48 ; 72 14722: 92 e4 ldi r25, 0x42 ; 66 14724: 0f 94 8b ba call 0x37516 ; 0x37516 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14728: 8a e9 ldi r24, 0x9A ; 154 1472a: 99 e9 ldi r25, 0x99 ; 153 1472c: a9 e1 ldi r26, 0x19 ; 25 1472e: be e3 ldi r27, 0x3E ; 62 14730: 80 93 49 07 sts 0x0749, r24 ; 0x800749 14734: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 14738: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 1473c: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(3000 / 60); 14740: 60 e0 ldi r22, 0x00 ; 0 14742: 70 e0 ldi r23, 0x00 ; 0 14744: 88 e4 ldi r24, 0x48 ; 72 14746: 92 e4 ldi r25, 0x42 ; 66 14748: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 1474c: 0f 94 24 59 call 0x2b248 ; 0x2b248 14750: 0f 90 pop r0 14752: 0f 90 pop r0 14754: 0f 90 pop r0 14756: 0f 90 pop r0 14758: 0f 90 pop r0 1475a: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 1475c: 20 91 97 03 lds r18, 0x0397 ; 0x800397 14760: 30 91 98 03 lds r19, 0x0398 ; 0x800398 14764: 40 91 99 03 lds r20, 0x0399 ; 0x800399 14768: 50 91 9a 03 lds r21, 0x039A ; 0x80039a 1476c: 62 2d mov r22, r2 1476e: 73 2d mov r23, r3 14770: 8e 2d mov r24, r14 14772: 9f 2d mov r25, r15 14774: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 14778: 18 16 cp r1, r24 1477a: 3c f4 brge .+14 ; 0x1478a { delay_keep_alive(1000); 1477c: 88 ee ldi r24, 0xE8 ; 232 1477e: 93 e0 ldi r25, 0x03 ; 3 14780: 0e 94 7f 8e call 0x11cfe ; 0x11cfe serialecho_temperatures(); 14784: 0e 94 e1 78 call 0xf1c2 ; 0xf1c2 14788: e9 cf rjmp .-46 ; 0x1475c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1478a: 60 e0 ldi r22, 0x00 ; 0 1478c: 86 ea ldi r24, 0xA6 ; 166 1478e: 9f e0 ldi r25, 0x0F ; 15 14790: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a } 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; 14794: 80 e0 ldi r24, 0x00 ; 0 14796: 90 e0 ldi r25, 0x00 ; 0 14798: a0 ea ldi r26, 0xA0 ; 160 1479a: b0 e4 ldi r27, 0x40 ; 64 1479c: 80 93 49 07 sts 0x0749, r24 ; 0x800749 147a0: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 147a4: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 147a8: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(3000 / 60); 147ac: 60 e0 ldi r22, 0x00 ; 0 147ae: 70 e0 ldi r23, 0x00 ; 0 147b0: 88 e4 ldi r24, 0x48 ; 72 147b2: 92 e4 ldi r25, 0x42 ; 66 147b4: 0f 94 8b ba call 0x37516 ; 0x37516 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 147b8: e6 e1 ldi r30, 0x16 ; 22 147ba: f2 e9 ldi r31, 0x92 ; 146 147bc: 85 91 lpm r24, Z+ 147be: 95 91 lpm r25, Z+ 147c0: a5 91 lpm r26, Z+ 147c2: b4 91 lpm r27, Z 147c4: 80 93 41 07 sts 0x0741, r24 ; 0x800741 147c8: 90 93 42 07 sts 0x0742, r25 ; 0x800742 147cc: a0 93 43 07 sts 0x0743, r26 ; 0x800743 147d0: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 147d4: ea e1 ldi r30, 0x1A ; 26 147d6: f2 e9 ldi r31, 0x92 ; 146 147d8: 85 91 lpm r24, Z+ 147da: 95 91 lpm r25, Z+ 147dc: a5 91 lpm r26, Z+ 147de: b4 91 lpm r27, Z 147e0: 80 93 45 07 sts 0x0745, r24 ; 0x800745 147e4: 90 93 46 07 sts 0x0746, r25 ; 0x800746 147e8: a0 93 47 07 sts 0x0747, r26 ; 0x800747 147ec: b0 93 48 07 sts 0x0748, r27 ; 0x800748 plan_buffer_line_curposXYZE(3000 / 60); 147f0: 60 e0 ldi r22, 0x00 ; 0 147f2: 70 e0 ldi r23, 0x00 ; 0 147f4: 88 e4 ldi r24, 0x48 ; 72 147f6: 92 e4 ldi r25, 0x42 ; 66 147f8: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 147fc: 0f 94 24 59 call 0x2b248 ; 0x2b248 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 14800: 43 e0 ldi r20, 0x03 ; 3 14802: 60 e0 ldi r22, 0x00 ; 0 14804: 70 e0 ldi r23, 0x00 ; 0 14806: 80 e8 ldi r24, 0x80 ; 128 14808: 9f eb ldi r25, 0xBF ; 191 1480a: 0f 94 21 8c call 0x31842 ; 0x31842 if (find_z_result == false) { 1480e: 81 11 cpse r24, r1 14810: 06 c0 rjmp .+12 ; 0x1481e 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); 14812: 0f 94 95 36 call 0x26d2a ; 0x26d2a homing_flag = false; 14816: 10 92 56 0e sts 0x0E56, r1 ; 0x800e56 1481a: 0c 94 21 9c jmp 0x13842 ; 0x13842 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 1481e: 90 91 49 07 lds r25, 0x0749 ; 0x800749 14822: 67 96 adiw r28, 0x17 ; 23 14824: 9f af std Y+63, r25 ; 0x3f 14826: 67 97 sbiw r28, 0x17 ; 23 14828: a0 91 4a 07 lds r26, 0x074A ; 0x80074a 1482c: 6b 96 adiw r28, 0x1b ; 27 1482e: af af std Y+63, r26 ; 0x3f 14830: 6b 97 sbiw r28, 0x1b ; 27 14832: b0 91 4b 07 lds r27, 0x074B ; 0x80074b 14836: 6f 96 adiw r28, 0x1f ; 31 14838: bf af std Y+63, r27 ; 0x3f 1483a: 6f 97 sbiw r28, 0x1f ; 31 1483c: e0 91 4c 07 lds r30, 0x074C ; 0x80074c 14840: a7 96 adiw r28, 0x27 ; 39 14842: ef af std Y+63, r30 ; 0x3f 14844: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 14846: ef 93 push r30 14848: bf 93 push r27 1484a: af 93 push r26 1484c: 9f 93 push r25 1484e: 84 e7 ldi r24, 0x74 ; 116 14850: 9a e6 ldi r25, 0x6A ; 106 14852: 9f 93 push r25 14854: 8f 93 push r24 14856: 0f 94 4b dc call 0x3b896 ; 0x3b896 1485a: 0f 90 pop r0 1485c: 0f 90 pop r0 1485e: 0f 90 pop r0 14860: 0f 90 pop r0 14862: 0f 90 pop r0 14864: 0f 90 pop r0 14866: be ea ldi r27, 0xAE ; 174 14868: 8b 2e mov r8, r27 1486a: bf e0 ldi r27, 0x0F ; 15 1486c: 9b 2e mov r9, r27 1486e: 13 e2 ldi r17, 0x23 ; 35 14870: c1 2e mov r12, r17 14872: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 14874: 0f ef ldi r16, 0xFF ; 255 14876: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 14878: b6 01 movw r22, r12 1487a: 0d 2c mov r0, r13 1487c: 00 0c add r0, r0 1487e: 88 0b sbc r24, r24 14880: 99 0b sbc r25, r25 14882: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 14886: 2b 01 movw r4, r22 14888: 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)); 1488a: df 92 push r13 1488c: cf 92 push r12 1488e: c8 01 movw r24, r16 14890: 02 96 adiw r24, 0x02 ; 2 14892: 9f 93 push r25 14894: 8f 93 push r24 14896: 28 e3 ldi r18, 0x38 ; 56 14898: 3a e6 ldi r19, 0x6A ; 106 1489a: 3f 93 push r19 1489c: 2f 93 push r18 1489e: 0f 94 4b dc call 0x3b896 ; 0x3b896 148a2: 58 01 movw r10, r16 148a4: 5f ef ldi r21, 0xFF ; 255 148a6: a5 1a sub r10, r21 148a8: b5 0a sbc r11, r21 if (i >= 0) { 148aa: 0f 90 pop r0 148ac: 0f 90 pop r0 148ae: 0f 90 pop r0 148b0: 0f 90 pop r0 148b2: 0f 90 pop r0 148b4: 0f 90 pop r0 148b6: 11 f4 brne .+4 ; 0x148bc 148b8: 0c 94 2e cf jmp 0x19e5c ; 0x19e5c if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 148bc: 70 e0 ldi r23, 0x00 ; 0 148be: 60 e0 ldi r22, 0x00 ; 0 148c0: c4 01 movw r24, r8 148c2: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 148c6: a3 01 movw r20, r6 148c8: 92 01 movw r18, r4 148ca: 62 2d mov r22, r2 148cc: 73 2d mov r23, r3 148ce: 8e 2d mov r24, r14 148d0: 9f 2d mov r25, r15 148d2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 148d6: 18 16 cp r1, r24 148d8: 44 f4 brge .+16 ; 0x148ea } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 148da: 85 e0 ldi r24, 0x05 ; 5 148dc: a8 16 cp r10, r24 148de: b1 04 cpc r11, r1 148e0: 11 f0 breq .+4 ; 0x148e6 148e2: 0c 94 3a cf jmp 0x19e74 ; 0x19e74 148e6: 05 e0 ldi r16, 0x05 ; 5 148e8: 10 e0 ldi r17, 0x00 ; 0 148ea: 58 01 movw r10, r16 148ec: 97 e2 ldi r25, 0x27 ; 39 148ee: a9 1a sub r10, r25 148f0: 98 ef ldi r25, 0xF8 ; 248 148f2: b9 0a sbc r11, r25 148f4: aa 0c add r10, r10 148f6: bb 1c adc r11, r11 148f8: 85 e0 ldi r24, 0x05 ; 5 148fa: 80 9f mul r24, r16 148fc: 10 01 movw r2, r0 148fe: 81 9f mul r24, r17 14900: 30 0c add r3, r0 14902: 11 24 eor r1, r1 14904: 0d 5f subi r16, 0xFD ; 253 14906: 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; 14908: fa e9 ldi r31, 0x9A ; 154 1490a: 4f 2e mov r4, r31 1490c: f9 e9 ldi r31, 0x99 ; 153 1490e: 5f 2e mov r5, r31 14910: f9 e1 ldi r31, 0x19 ; 25 14912: 6f 2e mov r6, r31 14914: fe e3 ldi r31, 0x3E ; 62 14916: 7f 2e mov r7, r31 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); 14918: af ef ldi r26, 0xFF ; 255 1491a: 8a 2e mov r8, r26 1491c: a9 e6 ldi r26, 0x69 ; 105 1491e: 9a 2e mov r9, r26 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; } for (i++; i < 5; i++) 14920: c8 01 movw r24, r16 14922: 02 97 sbiw r24, 0x02 ; 2 14924: 05 97 sbiw r24, 0x05 ; 5 14926: 0c f0 brlt .+2 ; 0x1492a 14928: d4 c0 rjmp .+424 ; 0x14ad2 { float temp = (40 + i * 5); 1492a: b1 01 movw r22, r2 1492c: 63 5d subi r22, 0xD3 ; 211 1492e: 7f 4f sbci r23, 0xFF ; 255 14930: 07 2e mov r0, r23 14932: 00 0c add r0, r0 14934: 88 0b sbc r24, r24 14936: 99 0b sbc r25, r25 14938: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1493c: 6b 01 movw r12, r22 1493e: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 14940: 1f 93 push r17 14942: 0f 93 push r16 14944: ab e2 ldi r26, 0x2B ; 43 14946: ba e6 ldi r27, 0x6A ; 106 14948: bf 93 push r27 1494a: af 93 push r26 1494c: 0f 94 4b dc call 0x3b896 ; 0x3b896 custom_message_state = i + 2; 14950: 00 93 f1 03 sts 0x03F1, r16 ; 0x8003f1 setTargetBed(50 + 10 * (temp - 30) / 5); 14954: 20 e0 ldi r18, 0x00 ; 0 14956: 30 e0 ldi r19, 0x00 ; 0 14958: 40 ef ldi r20, 0xF0 ; 240 1495a: 51 e4 ldi r21, 0x41 ; 65 1495c: c7 01 movw r24, r14 1495e: b6 01 movw r22, r12 14960: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 14964: 20 e0 ldi r18, 0x00 ; 0 14966: 30 e0 ldi r19, 0x00 ; 0 14968: 40 e2 ldi r20, 0x20 ; 32 1496a: 51 e4 ldi r21, 0x41 ; 65 1496c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 14970: 20 e0 ldi r18, 0x00 ; 0 14972: 30 e0 ldi r19, 0x00 ; 0 14974: 40 ea ldi r20, 0xA0 ; 160 14976: 50 e4 ldi r21, 0x40 ; 64 14978: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1497c: 20 e0 ldi r18, 0x00 ; 0 1497e: 30 e0 ldi r19, 0x00 ; 0 14980: 48 e4 ldi r20, 0x48 ; 72 14982: 52 e4 ldi r21, 0x42 ; 66 14984: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 14988: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 1498c: 70 93 6a 0e sts 0x0E6A, r23 ; 0x800e6a 14990: 60 93 69 0e sts 0x0E69, r22 ; 0x800e69 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14994: 80 e0 ldi r24, 0x00 ; 0 14996: 90 e0 ldi r25, 0x00 ; 0 14998: a0 ea ldi r26, 0xA0 ; 160 1499a: b0 e4 ldi r27, 0x40 ; 64 1499c: 80 93 49 07 sts 0x0749, r24 ; 0x800749 149a0: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 149a4: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 149a8: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(3000 / 60); 149ac: 60 e0 ldi r22, 0x00 ; 0 149ae: 70 e0 ldi r23, 0x00 ; 0 149b0: 88 e4 ldi r24, 0x48 ; 72 149b2: 92 e4 ldi r25, 0x42 ; 66 149b4: 0f 94 8b ba call 0x37516 ; 0x37516 current_position[X_AXIS] = PINDA_PREHEAT_X; 149b8: 20 e0 ldi r18, 0x00 ; 0 149ba: 30 e0 ldi r19, 0x00 ; 0 149bc: 40 ea ldi r20, 0xA0 ; 160 149be: 51 e4 ldi r21, 0x41 ; 65 149c0: 20 93 41 07 sts 0x0741, r18 ; 0x800741 149c4: 30 93 42 07 sts 0x0742, r19 ; 0x800742 149c8: 40 93 43 07 sts 0x0743, r20 ; 0x800743 149cc: 50 93 44 07 sts 0x0744, r21 ; 0x800744 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 149d0: 80 e0 ldi r24, 0x00 ; 0 149d2: 90 e0 ldi r25, 0x00 ; 0 149d4: a0 e7 ldi r26, 0x70 ; 112 149d6: b2 e4 ldi r27, 0x42 ; 66 149d8: 80 93 45 07 sts 0x0745, r24 ; 0x800745 149dc: 90 93 46 07 sts 0x0746, r25 ; 0x800746 149e0: a0 93 47 07 sts 0x0747, r26 ; 0x800747 149e4: b0 93 48 07 sts 0x0748, r27 ; 0x800748 plan_buffer_line_curposXYZE(3000 / 60); 149e8: 60 e0 ldi r22, 0x00 ; 0 149ea: 70 e0 ldi r23, 0x00 ; 0 149ec: 88 e4 ldi r24, 0x48 ; 72 149ee: 92 e4 ldi r25, 0x42 ; 66 149f0: 0f 94 8b ba call 0x37516 ; 0x37516 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 149f4: 40 92 49 07 sts 0x0749, r4 ; 0x800749 149f8: 50 92 4a 07 sts 0x074A, r5 ; 0x80074a 149fc: 60 92 4b 07 sts 0x074B, r6 ; 0x80074b 14a00: 70 92 4c 07 sts 0x074C, r7 ; 0x80074c plan_buffer_line_curposXYZE(3000 / 60); 14a04: 60 e0 ldi r22, 0x00 ; 0 14a06: 70 e0 ldi r23, 0x00 ; 0 14a08: 88 e4 ldi r24, 0x48 ; 72 14a0a: 92 e4 ldi r25, 0x42 ; 66 14a0c: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 14a10: 0f 94 24 59 call 0x2b248 ; 0x2b248 14a14: 0f 90 pop r0 14a16: 0f 90 pop r0 14a18: 0f 90 pop r0 14a1a: 0f 90 pop r0 while (current_temperature_pinda < temp) 14a1c: 20 91 97 03 lds r18, 0x0397 ; 0x800397 14a20: 30 91 98 03 lds r19, 0x0398 ; 0x800398 14a24: 40 91 99 03 lds r20, 0x0399 ; 0x800399 14a28: 50 91 9a 03 lds r21, 0x039A ; 0x80039a 14a2c: c7 01 movw r24, r14 14a2e: b6 01 movw r22, r12 14a30: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 14a34: 18 16 cp r1, r24 14a36: 3c f4 brge .+14 ; 0x14a46 { delay_keep_alive(1000); 14a38: 88 ee ldi r24, 0xE8 ; 232 14a3a: 93 e0 ldi r25, 0x03 ; 3 14a3c: 0e 94 7f 8e call 0x11cfe ; 0x11cfe serialecho_temperatures(); 14a40: 0e 94 e1 78 call 0xf1c2 ; 0xf1c2 14a44: eb cf rjmp .-42 ; 0x14a1c } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14a46: 80 e0 ldi r24, 0x00 ; 0 14a48: 90 e0 ldi r25, 0x00 ; 0 14a4a: a0 ea ldi r26, 0xA0 ; 160 14a4c: b0 e4 ldi r27, 0x40 ; 64 14a4e: 80 93 49 07 sts 0x0749, r24 ; 0x800749 14a52: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 14a56: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 14a5a: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(3000 / 60); 14a5e: 60 e0 ldi r22, 0x00 ; 0 14a60: 70 e0 ldi r23, 0x00 ; 0 14a62: 88 e4 ldi r24, 0x48 ; 72 14a64: 92 e4 ldi r25, 0x42 ; 66 14a66: 0f 94 8b ba call 0x37516 ; 0x37516 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14a6a: e6 e1 ldi r30, 0x16 ; 22 14a6c: f2 e9 ldi r31, 0x92 ; 146 14a6e: 85 91 lpm r24, Z+ 14a70: 95 91 lpm r25, Z+ 14a72: a5 91 lpm r26, Z+ 14a74: b4 91 lpm r27, Z 14a76: 80 93 41 07 sts 0x0741, r24 ; 0x800741 14a7a: 90 93 42 07 sts 0x0742, r25 ; 0x800742 14a7e: a0 93 43 07 sts 0x0743, r26 ; 0x800743 14a82: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14a86: ea e1 ldi r30, 0x1A ; 26 14a88: f2 e9 ldi r31, 0x92 ; 146 14a8a: 85 91 lpm r24, Z+ 14a8c: 95 91 lpm r25, Z+ 14a8e: a5 91 lpm r26, Z+ 14a90: b4 91 lpm r27, Z 14a92: 80 93 45 07 sts 0x0745, r24 ; 0x800745 14a96: 90 93 46 07 sts 0x0746, r25 ; 0x800746 14a9a: a0 93 47 07 sts 0x0747, r26 ; 0x800747 14a9e: b0 93 48 07 sts 0x0748, r27 ; 0x800748 plan_buffer_line_curposXYZE(3000 / 60); 14aa2: 60 e0 ldi r22, 0x00 ; 0 14aa4: 70 e0 ldi r23, 0x00 ; 0 14aa6: 88 e4 ldi r24, 0x48 ; 72 14aa8: 92 e4 ldi r25, 0x42 ; 66 14aaa: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 14aae: 0f 94 24 59 call 0x2b248 ; 0x2b248 find_z_result = find_bed_induction_sensor_point_z(-1.f); 14ab2: 43 e0 ldi r20, 0x03 ; 3 14ab4: 60 e0 ldi r22, 0x00 ; 0 14ab6: 70 e0 ldi r23, 0x00 ; 0 14ab8: 80 e8 ldi r24, 0x80 ; 128 14aba: 9f eb ldi r25, 0xBF ; 191 14abc: 0f 94 21 8c call 0x31842 ; 0x31842 14ac0: 95 e0 ldi r25, 0x05 ; 5 14ac2: 29 0e add r2, r25 14ac4: 31 1c adc r3, r1 14ac6: 0f 5f subi r16, 0xFF ; 255 14ac8: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 14aca: 81 11 cpse r24, r1 14acc: 04 c0 rjmp .+8 ; 0x14ad6 lcd_temp_cal_show_result(find_z_result); 14ace: 0f 94 95 36 call 0x26d2a ; 0x26d2a 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); 14ad2: 81 e0 ldi r24, 0x01 ; 1 14ad4: 9e ce rjmp .-708 ; 0x14812 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]); 14ad6: 67 96 adiw r28, 0x17 ; 23 14ad8: 7f ad ldd r23, Y+63 ; 0x3f 14ada: 67 97 sbiw r28, 0x17 ; 23 14adc: 6b 96 adiw r28, 0x1b ; 27 14ade: 6f ad ldd r22, Y+63 ; 0x3f 14ae0: 6b 97 sbiw r28, 0x1b ; 27 14ae2: 6f 96 adiw r28, 0x1f ; 31 14ae4: 9f ad ldd r25, Y+63 ; 0x3f 14ae6: 6f 97 sbiw r28, 0x1f ; 31 14ae8: a7 96 adiw r28, 0x27 ; 39 14aea: 8f ad ldd r24, Y+63 ; 0x3f 14aec: a7 97 sbiw r28, 0x27 ; 39 14aee: 27 2f mov r18, r23 14af0: 36 2f mov r19, r22 14af2: 49 2f mov r20, r25 14af4: 58 2f mov r21, r24 14af6: 60 91 49 07 lds r22, 0x0749 ; 0x800749 14afa: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 14afe: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 14b02: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 14b06: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 14b0a: f6 2e mov r15, r22 14b0c: e7 2e mov r14, r23 14b0e: d8 2e mov r13, r24 14b10: c9 2e mov r12, r25 14b12: 20 91 78 06 lds r18, 0x0678 ; 0x800678 14b16: 30 91 79 06 lds r19, 0x0679 ; 0x800679 14b1a: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 14b1e: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 14b22: d7 01 movw r26, r14 14b24: f6 01 movw r30, r12 14b26: 6b 2f mov r22, r27 14b28: 7a 2f mov r23, r26 14b2a: 8f 2f mov r24, r31 14b2c: 9e 2f mov r25, r30 14b2e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 14b32: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 14b36: a6 96 adiw r28, 0x26 ; 38 14b38: 6c af std Y+60, r22 ; 0x3c 14b3a: 7d af std Y+61, r23 ; 0x3d 14b3c: 8e af std Y+62, r24 ; 0x3e 14b3e: 9f af std Y+63, r25 ; 0x3f 14b40: 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); 14b42: cf 92 push r12 14b44: df 92 push r13 14b46: ef 92 push r14 14b48: ff 92 push r15 14b4a: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 14b4e: 8f 93 push r24 14b50: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14b54: 8f 93 push r24 14b56: 80 91 98 03 lds r24, 0x0398 ; 0x800398 14b5a: 8f 93 push r24 14b5c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14b60: 8f 93 push r24 14b62: 9f 92 push r9 14b64: 8f 92 push r8 14b66: 0f 94 4b dc call 0x3b896 ; 0x3b896 14b6a: a4 96 adiw r28, 0x24 ; 36 14b6c: 6e ad ldd r22, Y+62 ; 0x3e 14b6e: 7f ad ldd r23, Y+63 ; 0x3f 14b70: a4 97 sbiw r28, 0x24 ; 36 14b72: c5 01 movw r24, r10 14b74: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 14b78: a2 e0 ldi r26, 0x02 ; 2 14b7a: aa 0e add r10, r26 14b7c: b1 1c adc r11, r1 14b7e: 0f b6 in r0, 0x3f ; 63 14b80: f8 94 cli 14b82: de bf out 0x3e, r29 ; 62 14b84: 0f be out 0x3f, r0 ; 63 14b86: cd bf out 0x3d, r28 ; 61 14b88: cb ce rjmp .-618 ; 0x14920 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 14b8a: 80 e1 ldi r24, 0x10 ; 16 14b8c: 0e 94 09 e7 call 0x1ce12 ; 0x1ce12 14b90: 0c 94 21 9c jmp 0x13842 ; 0x13842 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 14b94: 80 e1 ldi r24, 0x10 ; 16 14b96: 0e 94 5e e7 call 0x1cebc ; 0x1cebc 14b9a: 0c 94 21 9c jmp 0x13842 ; 0x13842 /*! ### 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); 14b9e: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 14ba2: 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; 14ba4: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 14ba8: 0c 94 21 9c jmp 0x13842 ; 0x13842 14bac: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 14bb0: 87 60 ori r24, 0x07 ; 7 14bb2: f8 cf rjmp .-16 ; 0x14ba4 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 14bb4: 0f 94 24 59 call 0x2b248 ; 0x2b248 14bb8: f1 2c mov r15, r1 14bba: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 14bbc: f8 01 movw r30, r16 14bbe: 81 91 ld r24, Z+ 14bc0: 8f 01 movw r16, r30 14bc2: 88 23 and r24, r24 14bc4: d1 f0 breq .+52 ; 0x14bfa current_position[i] = values[i] + cs.add_homing[i]; 14bc6: 97 01 movw r18, r14 14bc8: 2f 5b subi r18, 0xBF ; 191 14bca: 38 4f sbci r19, 0xF8 ; 248 14bcc: 59 01 movw r10, r18 14bce: f3 01 movw r30, r6 14bd0: ee 0d add r30, r14 14bd2: ff 1d adc r31, r15 14bd4: 20 81 ld r18, Z 14bd6: 31 81 ldd r19, Z+1 ; 0x01 14bd8: 42 81 ldd r20, Z+2 ; 0x02 14bda: 53 81 ldd r21, Z+3 ; 0x03 14bdc: f7 01 movw r30, r14 14bde: ec 53 subi r30, 0x3C ; 60 14be0: f9 4f sbci r31, 0xF9 ; 249 14be2: 60 81 ld r22, Z 14be4: 71 81 ldd r23, Z+1 ; 0x01 14be6: 82 81 ldd r24, Z+2 ; 0x02 14be8: 93 81 ldd r25, Z+3 ; 0x03 14bea: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 14bee: d5 01 movw r26, r10 14bf0: 6d 93 st X+, r22 14bf2: 7d 93 st X+, r23 14bf4: 8d 93 st X+, r24 14bf6: 9c 93 st X, r25 14bf8: 13 97 sbiw r26, 0x03 ; 3 14bfa: b4 e0 ldi r27, 0x04 ; 4 14bfc: eb 0e add r14, r27 14bfe: 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) 14c00: ec e0 ldi r30, 0x0C ; 12 14c02: ee 16 cp r14, r30 14c04: f1 04 cpc r15, r1 14c06: d1 f6 brne .-76 ; 0x14bbc { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 14c08: dd 20 and r13, r13 14c0a: 61 f0 breq .+24 ; 0x14c24 current_position[E_AXIS] = values[E_AXIS]; 14c0c: 8d 85 ldd r24, Y+13 ; 0x0d 14c0e: 9e 85 ldd r25, Y+14 ; 0x0e 14c10: af 85 ldd r26, Y+15 ; 0x0f 14c12: b8 89 ldd r27, Y+16 ; 0x10 14c14: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 14c18: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e 14c1c: a0 93 4f 07 sts 0x074F, r26 ; 0x80074f 14c20: b0 93 50 07 sts 0x0750, r27 ; 0x800750 // Set all at once plan_set_position_curposXYZE(); 14c24: 0f 94 4b b9 call 0x37296 ; 0x37296 14c28: 0c 94 21 9c jmp 0x13842 ; 0x13842 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 14c2c: 8d 34 cpi r24, 0x4D ; 77 14c2e: 11 f0 breq .+4 ; 0x14c34 14c30: 0c 94 9f cd jmp 0x19b3e ; 0x19b3e { strchr_pointer = CMDBUFFER_CURRENT_STRING; 14c34: 10 93 96 03 sts 0x0396, r17 ; 0x800396 14c38: 00 93 95 03 sts 0x0395, r16 ; 0x800395 14c3c: f8 01 movw r30, r16 14c3e: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 14c40: 81 91 ld r24, Z+ 14c42: 80 32 cpi r24, 0x20 ; 32 14c44: e9 f3 breq .-6 ; 0x14c40 14c46: 89 30 cpi r24, 0x09 ; 9 14c48: d9 f3 breq .-10 ; 0x14c40 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 14c4a: 80 53 subi r24, 0x30 ; 48 14c4c: 8a 30 cpi r24, 0x0A ; 10 14c4e: 70 f0 brcs .+28 ; 0x14c6c printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14c50: 1f 93 push r17 14c52: 0f 93 push r16 14c54: 8b ea ldi r24, 0xAB ; 171 14c56: 98 e8 ldi r25, 0x88 ; 136 14c58: 9f 93 push r25 14c5a: 8f 93 push r24 14c5c: 0f 94 4b dc call 0x3b896 ; 0x3b896 14c60: 0f 90 pop r0 14c62: 0f 90 pop r0 14c64: 0f 90 pop r0 14c66: 0f 90 pop r0 14c68: 0c 94 de 97 jmp 0x12fbc ; 0x12fbc } else { mcode_in_progress = code_value_short(); 14c6c: 0e 94 13 5c call 0xb826 ; 0xb826 14c70: 90 93 5a 0e sts 0x0E5A, r25 ; 0x800e5a <_ZL17mcode_in_progress.lto_priv.551+0x1> 14c74: 80 93 59 0e sts 0x0E59, r24 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.551> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14c78: 89 3c cpi r24, 0xC9 ; 201 14c7a: 91 05 cpc r25, r1 14c7c: 11 f4 brne .+4 ; 0x14c82 14c7e: 0c 94 62 ba jmp 0x174c4 ; 0x174c4 14c82: 0c f0 brlt .+2 ; 0x14c86 14c84: 40 c3 rjmp .+1664 ; 0x15306 14c86: 8e 34 cpi r24, 0x4E ; 78 14c88: 91 05 cpc r25, r1 14c8a: 11 f4 brne .+4 ; 0x14c90 14c8c: 0c 94 c8 b5 jmp 0x16b90 ; 0x16b90 14c90: 0c f0 brlt .+2 ; 0x14c94 14c92: 35 c2 rjmp .+1130 ; 0x150fe 14c94: 8c 31 cpi r24, 0x1C ; 28 14c96: 91 05 cpc r25, r1 14c98: 11 f4 brne .+4 ; 0x14c9e 14c9a: 0c 94 27 b4 jmp 0x1684e ; 0x1684e 14c9e: 0c f0 brlt .+2 ; 0x14ca2 14ca0: 00 c1 rjmp .+512 ; 0x14ea2 14ca2: 85 31 cpi r24, 0x15 ; 21 14ca4: 91 05 cpc r25, r1 14ca6: 11 f4 brne .+4 ; 0x14cac 14ca8: 0c 94 40 b3 jmp 0x16680 ; 0x16680 14cac: 0c f0 brlt .+2 ; 0x14cb0 14cae: 5e c0 rjmp .+188 ; 0x14d6c 14cb0: 81 31 cpi r24, 0x11 ; 17 14cb2: 91 05 cpc r25, r1 14cb4: 11 f4 brne .+4 ; 0x14cba 14cb6: 0c 94 35 b3 jmp 0x1666a ; 0x1666a 14cba: ec f4 brge .+58 ; 0x14cf6 14cbc: 02 97 sbiw r24, 0x02 ; 2 14cbe: 10 f4 brcc .+4 ; 0x14cc4 14cc0: 0c 94 a9 b2 jmp 0x16552 ; 0x16552 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 14cc4: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 14cc8: 90 91 6f 12 lds r25, 0x126F ; 0x80126f 14ccc: 8c 57 subi r24, 0x7C ; 124 14cce: 9f 4e sbci r25, 0xEF ; 239 14cd0: 9f 93 push r25 14cd2: 8f 93 push r24 14cd4: 1f 92 push r1 14cd6: 8d e4 ldi r24, 0x4D ; 77 14cd8: 8f 93 push r24 14cda: 8a ee ldi r24, 0xEA ; 234 14cdc: 99 e6 ldi r25, 0x69 ; 105 14cde: 9f 93 push r25 14ce0: 8f 93 push r24 14ce2: 0f 94 4b dc call 0x3b896 ; 0x3b896 14ce6: 0f 90 pop r0 14ce8: 0f 90 pop r0 14cea: 0f 90 pop r0 14cec: 0f 90 pop r0 14cee: 0f 90 pop r0 14cf0: 0f 90 pop r0 14cf2: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14cf6: 82 31 cpi r24, 0x12 ; 18 14cf8: 91 05 cpc r25, r1 14cfa: 11 f4 brne .+4 ; 0x14d00 14cfc: 0c 94 7d b7 jmp 0x16efa ; 0x16efa 14d00: 44 97 sbiw r24, 0x14 ; 20 14d02: 01 f7 brne .-64 ; 0x14cc4 #### 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() 14d04: 81 e0 ldi r24, 0x01 ; 1 14d06: 80 93 96 02 sts 0x0296, r24 ; 0x800296 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 14d0a: 8a ed ldi r24, 0xDA ; 218 14d0c: 99 e6 ldi r25, 0x69 ; 105 14d0e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 14d12: 84 e5 ldi r24, 0x54 ; 84 14d14: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 14d18: 18 2f mov r17, r24 14d1a: 8c e4 ldi r24, 0x4C ; 76 14d1c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 14d20: 00 e0 ldi r16, 0x00 ; 0 14d22: 80 fb bst r24, 0 14d24: 00 f9 bld r16, 0 14d26: 10 fb bst r17, 0 14d28: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 14d2a: 82 ef ldi r24, 0xF2 ; 242 14d2c: 94 e1 ldi r25, 0x14 ; 20 14d2e: 0e 94 af 78 call 0xf15e ; 0xf15e lsDive("",root, NULL, LS_SerialPrint, params); 14d32: 83 e2 ldi r24, 0x23 ; 35 14d34: e2 ef ldi r30, 0xF2 ; 242 14d36: f4 e1 ldi r31, 0x14 ; 20 14d38: de 01 movw r26, r28 14d3a: 11 96 adiw r26, 0x01 ; 1 14d3c: 01 90 ld r0, Z+ 14d3e: 0d 92 st X+, r0 14d40: 8a 95 dec r24 14d42: e1 f7 brne .-8 ; 0x14d3c 14d44: 20 e0 ldi r18, 0x00 ; 0 14d46: 50 e0 ldi r21, 0x00 ; 0 14d48: 40 e0 ldi r20, 0x00 ; 0 14d4a: be 01 movw r22, r28 14d4c: 6f 5f subi r22, 0xFF ; 255 14d4e: 7f 4f sbci r23, 0xFF ; 255 14d50: 83 ef ldi r24, 0xF3 ; 243 14d52: 92 e0 ldi r25, 0x02 ; 2 14d54: 0f 94 2b 79 call 0x2f256 ; 0x2f256 14d58: ce 01 movw r24, r28 14d5a: 01 96 adiw r24, 0x01 ; 1 14d5c: 0e 94 b4 78 call 0xf168 ; 0xf168 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14d60: 8c ec ldi r24, 0xCC ; 204 14d62: 99 e6 ldi r25, 0x69 ; 105 14d64: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 14d68: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d6c: 88 31 cpi r24, 0x18 ; 24 14d6e: 91 05 cpc r25, r1 14d70: 11 f4 brne .+4 ; 0x14d76 14d72: 0c 94 51 b3 jmp 0x166a2 ; 0x166a2 14d76: 94 f4 brge .+36 ; 0x14d9c 14d78: 86 31 cpi r24, 0x16 ; 22 14d7a: 91 05 cpc r25, r1 14d7c: 11 f4 brne .+4 ; 0x14d82 14d7e: 0c 94 44 b3 jmp 0x16688 ; 0x16688 14d82: 47 97 sbiw r24, 0x17 ; 23 14d84: 09 f0 breq .+2 ; 0x14d88 14d86: 9e cf rjmp .-196 ; 0x14cc4 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 14d88: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14d8c: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14d90: 61 e0 ldi r22, 0x01 ; 1 14d92: 04 96 adiw r24, 0x04 ; 4 14d94: 0f 94 f9 7f call 0x2fff2 ; 0x2fff2 14d98: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d9c: 8a 31 cpi r24, 0x1A ; 26 14d9e: 91 05 cpc r25, r1 14da0: 11 f4 brne .+4 ; 0x14da6 14da2: 0c 94 97 b3 jmp 0x1672e ; 0x1672e 14da6: 14 f0 brlt .+4 ; 0x14dac 14da8: 0c 94 b9 b3 jmp 0x16772 ; 0x16772 14dac: 0d ed ldi r16, 0xDD ; 221 14dae: 12 e0 ldi r17, 0x02 ; 2 14db0: ff e3 ldi r31, 0x3F ; 63 14db2: af 2e mov r10, r31 14db4: f2 e0 ldi r31, 0x02 ; 2 14db6: bf 2e mov r11, r31 14db8: a1 e2 ldi r26, 0x21 ; 33 14dba: ca 2e mov r12, r26 14dbc: a2 e0 ldi r26, 0x02 ; 2 14dbe: da 2e mov r13, r26 14dc0: b5 e1 ldi r27, 0x15 ; 21 14dc2: eb 2e mov r14, r27 14dc4: b2 e0 ldi r27, 0x02 ; 2 14dc6: fb 2e mov r15, r27 14dc8: 80 ee ldi r24, 0xE0 ; 224 14dca: 88 2e mov r8, r24 14dcc: 82 e0 ldi r24, 0x02 ; 2 14dce: 98 2e mov r9, r24 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])) { 14dd0: f8 01 movw r30, r16 14dd2: 81 91 ld r24, Z+ 14dd4: 8f 01 movw r16, r30 14dd6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 14dda: 88 23 and r24, r24 14ddc: 21 f1 breq .+72 ; 0x14e26 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 14dde: 0e 94 4a 61 call 0xc294 ; 0xc294 14de2: d6 01 movw r26, r12 14de4: 4d 90 ld r4, X+ 14de6: 5d 90 ld r5, X+ 14de8: 6d 90 ld r6, X+ 14dea: 7c 90 ld r7, X 14dec: a3 01 movw r20, r6 14dee: 92 01 movw r18, r4 14df0: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 14df4: 87 fd sbrc r24, 7 14df6: 11 c0 rjmp .+34 ; 0x14e1a 14df8: 0e 94 4a 61 call 0xc294 ; 0xc294 14dfc: f7 01 movw r30, r14 14dfe: 40 80 ld r4, Z 14e00: 51 80 ldd r5, Z+1 ; 0x01 14e02: 62 80 ldd r6, Z+2 ; 0x02 14e04: 73 80 ldd r7, Z+3 ; 0x03 14e06: a3 01 movw r20, r6 14e08: 92 01 movw r18, r4 14e0a: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 14e0e: 18 16 cp r1, r24 14e10: 24 f0 brlt .+8 ; 0x14e1a 14e12: 0e 94 4a 61 call 0xc294 ; 0xc294 14e16: 2b 01 movw r4, r22 14e18: 3c 01 movw r6, r24 14e1a: d5 01 movw r26, r10 14e1c: 4d 92 st X+, r4 14e1e: 5d 92 st X+, r5 14e20: 6d 92 st X+, r6 14e22: 7c 92 st X, r7 14e24: 13 97 sbiw r26, 0x03 ; 3 14e26: b4 e0 ldi r27, 0x04 ; 4 14e28: ab 0e add r10, r27 14e2a: b1 1c adc r11, r1 14e2c: e4 e0 ldi r30, 0x04 ; 4 14e2e: ce 0e add r12, r30 14e30: d1 1c adc r13, r1 14e32: f4 e0 ldi r31, 0x04 ; 4 14e34: ef 0e add r14, r31 14e36: 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++) { 14e38: 80 16 cp r8, r16 14e3a: 91 06 cpc r9, r17 14e3c: 49 f6 brne .-110 ; 0x14dd0 //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')) { 14e3e: 83 e5 ldi r24, 0x53 ; 83 14e40: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 14e44: 88 23 and r24, r24 14e46: 11 f4 brne .+4 ; 0x14e4c 14e48: 0c 94 24 c6 jmp 0x18c48 ; 0x18c48 if ( code_value_uint8() == 0 ) { 14e4c: 0e 94 06 5c call 0xb80c ; 0xb80c 14e50: 81 11 cpse r24, r1 14e52: 0c 94 8d b2 jmp 0x1651a ; 0x1651a pause_position[X_AXIS] = X_PAUSE_POS; 14e56: 80 e0 ldi r24, 0x00 ; 0 14e58: 90 e0 ldi r25, 0x00 ; 0 14e5a: a8 e4 ldi r26, 0x48 ; 72 14e5c: b2 e4 ldi r27, 0x42 ; 66 14e5e: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.497> 14e62: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.497+0x1> 14e66: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.497+0x2> 14e6a: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.497+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14e6e: 80 e0 ldi r24, 0x00 ; 0 14e70: 90 e0 ldi r25, 0x00 ; 0 14e72: ae e3 ldi r26, 0x3E ; 62 14e74: b3 e4 ldi r27, 0x43 ; 67 14e76: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.497+0x4> 14e7a: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.497+0x5> 14e7e: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.497+0x6> 14e82: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.497+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14e86: 80 e0 ldi r24, 0x00 ; 0 14e88: 90 e0 ldi r25, 0x00 ; 0 14e8a: a0 ea ldi r26, 0xA0 ; 160 14e8c: b1 e4 ldi r27, 0x41 ; 65 14e8e: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.497+0x8> 14e92: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.497+0x9> 14e96: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.497+0xa> 14e9a: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.497+0xb> 14e9e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14ea2: 8d 32 cpi r24, 0x2D ; 45 14ea4: 91 05 cpc r25, r1 14ea6: 11 f4 brne .+4 ; 0x14eac 14ea8: 0c 94 cc b4 jmp 0x16998 ; 0x16998 14eac: 0c f0 brlt .+2 ; 0x14eb0 14eae: f0 c0 rjmp .+480 ; 0x15090 14eb0: 8f 31 cpi r24, 0x1F ; 31 14eb2: 91 05 cpc r25, r1 14eb4: 11 f4 brne .+4 ; 0x14eba 14eb6: 0c 94 59 b4 jmp 0x168b2 ; 0x168b2 14eba: 0c f0 brlt .+2 ; 0x14ebe 14ebc: 6a c0 rjmp .+212 ; 0x14f92 14ebe: 8d 31 cpi r24, 0x1D ; 29 14ec0: 91 05 cpc r25, r1 14ec2: 11 f4 brne .+4 ; 0x14ec8 14ec4: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 14ec8: 4e 97 sbiw r24, 0x1e ; 30 14eca: 09 f0 breq .+2 ; 0x14ece 14ecc: fb ce rjmp .-522 ; 0x14cc4 M30 [filename] */ case 30: if (card.mounted){ 14ece: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 14ed2: 88 23 and r24, r24 14ed4: 11 f4 brne .+4 ; 0x14eda 14ed6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14eda: 8c ef ldi r24, 0xFC ; 252 14edc: 96 e1 ldi r25, 0x16 ; 22 14ede: 0f 94 74 6e call 0x2dce8 ; 0x2dce8 file.close(); 14ee2: 8c ef ldi r24, 0xFC ; 252 14ee4: 96 e1 ldi r25, 0x16 ; 22 14ee6: 0f 94 6c a4 call 0x348d8 ; 0x348d8 saving = false; 14eea: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a logging = false; 14eee: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b card.closefile(); card.removeFile(strchr_pointer + 4); 14ef2: 00 91 95 03 lds r16, 0x0395 ; 0x800395 14ef6: 10 91 96 03 lds r17, 0x0396 ; 0x800396 14efa: 0c 5f subi r16, 0xFC ; 252 14efc: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14efe: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 14f02: 88 23 and r24, r24 14f04: 11 f4 brne .+4 ; 0x14f0a 14f06: 0c 94 8d b2 jmp 0x1651a ; 0x1651a file.close(); 14f0a: 8c ef ldi r24, 0xFC ; 252 14f0c: 96 e1 ldi r25, 0x16 ; 22 14f0e: 0f 94 6c a4 call 0x348d8 ; 0x348d8 sdprinting = false; 14f12: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c const char *fname=name; 14f16: 23 96 adiw r28, 0x03 ; 3 14f18: 1f af std Y+63, r17 ; 0x3f 14f1a: 0e af std Y+62, r16 ; 0x3e 14f1c: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 14f1e: ce 01 movw r24, r28 14f20: 8f 5b subi r24, 0xBF ; 191 14f22: 9f 4f sbci r25, 0xFF ; 255 14f24: 0f 94 74 7f call 0x2fee8 ; 0x2fee8 14f28: 88 23 and r24, r24 14f2a: 11 f4 brne .+4 ; 0x14f30 14f2c: 0c 94 8d b2 jmp 0x1651a ; 0x1651a return; if (file.remove(curDir, fname)) 14f30: 23 96 adiw r28, 0x03 ; 3 14f32: 4e ad ldd r20, Y+62 ; 0x3e 14f34: 5f ad ldd r21, Y+63 ; 0x3f 14f36: 23 97 sbiw r28, 0x03 ; 3 14f38: 60 91 15 15 lds r22, 0x1515 ; 0x801515 14f3c: 70 91 16 15 lds r23, 0x1516 ; 0x801516 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 14f40: 19 82 std Y+1, r1 ; 0x01 14f42: 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; 14f44: 22 e0 ldi r18, 0x02 ; 2 14f46: ce 01 movw r24, r28 14f48: 01 96 adiw r24, 0x01 ; 1 14f4a: 0f 94 36 d7 call 0x3ae6c ; 0x3ae6c 14f4e: 81 11 cpse r24, r1 14f50: 0c 94 2f b4 jmp 0x1685e ; 0x1685e return file.remove(); fail: // can't set iostate - static function return false; 14f54: 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; 14f56: ce 01 movw r24, r28 14f58: 01 96 adiw r24, 0x01 ; 1 14f5a: 0e 94 b4 78 call 0xf168 ; 0xf168 14f5e: 11 23 and r17, r17 14f60: 11 f4 brne .+4 ; 0x14f66 14f62: 0c 94 49 b4 jmp 0x16892 ; 0x16892 { SERIAL_PROTOCOLPGM("File deleted:"); 14f66: 83 ed ldi r24, 0xD3 ; 211 14f68: 95 e8 ldi r25, 0x85 ; 133 14f6a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLLN(fname); 14f6e: 23 96 adiw r28, 0x03 ; 3 14f70: 8e ad ldd r24, Y+62 ; 0x3e 14f72: 9f ad ldd r25, Y+63 ; 0x3f 14f74: 23 97 sbiw r28, 0x03 ; 3 14f76: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c sdpos = 0; 14f7a: 10 92 80 17 sts 0x1780, r1 ; 0x801780 14f7e: 10 92 81 17 sts 0x1781, r1 ; 0x801781 14f82: 10 92 82 17 sts 0x1782, r1 ; 0x801782 14f86: 10 92 83 17 sts 0x1783, r1 ; 0x801783 #ifdef SDCARD_SORT_ALPHA presort(); 14f8a: 0f 94 40 7d call 0x2fa80 ; 0x2fa80 14f8e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14f92: 8a 32 cpi r24, 0x2A ; 42 14f94: 91 05 cpc r25, r1 14f96: 11 f4 brne .+4 ; 0x14f9c 14f98: 0c 94 80 b4 jmp 0x16900 ; 0x16900 14f9c: 8c 32 cpi r24, 0x2C ; 44 14f9e: 91 05 cpc r25, r1 14fa0: 11 f4 brne .+4 ; 0x14fa6 14fa2: 0c 94 b3 b4 jmp 0x16966 ; 0x16966 14fa6: 80 97 sbiw r24, 0x20 ; 32 14fa8: 09 f0 breq .+2 ; 0x14fac 14faa: 8c ce rjmp .-744 ; 0x14cc4 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14fac: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 14fb0: 81 11 cpse r24, r1 st_synchronize(); 14fb2: 0f 94 24 59 call 0x2b248 ; 0x2b248 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 14fb6: 00 91 95 03 lds r16, 0x0395 ; 0x800395 14fba: 10 91 96 03 lds r17, 0x0396 ; 0x800396 14fbe: 0c 5f subi r16, 0xFC ; 252 14fc0: 1f 4f sbci r17, 0xFF ; 255 14fc2: 61 e2 ldi r22, 0x21 ; 33 14fc4: 70 e0 ldi r23, 0x00 ; 0 14fc6: c8 01 movw r24, r16 14fc8: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 if(namestartpos==NULL) 14fcc: 00 97 sbiw r24, 0x00 ; 0 14fce: 19 f0 breq .+6 ; 0x14fd6 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 14fd0: 8c 01 movw r16, r24 14fd2: 0f 5f subi r16, 0xFF ; 255 14fd4: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 14fd6: 80 e5 ldi r24, 0x50 ; 80 14fd8: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 14fdc: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 14fde: 80 91 95 03 lds r24, 0x0395 ; 0x800395 14fe2: 90 91 96 03 lds r25, 0x0396 ; 0x800396 14fe6: 08 17 cp r16, r24 14fe8: 19 07 cpc r17, r25 14fea: 08 f4 brcc .+2 ; 0x14fee call_procedure=false; //false alert, 'P' found within filename 14fec: f1 2c mov r15, r1 if( card.mounted ) 14fee: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 14ff2: 88 23 and r24, r24 14ff4: 11 f4 brne .+4 ; 0x14ffa 14ff6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 14ffa: 61 e0 ldi r22, 0x01 ; 1 14ffc: 6f 25 eor r22, r15 14ffe: c8 01 movw r24, r16 15000: 0f 94 f9 7f call 0x2fff2 ; 0x2fff2 if(code_seen('S')) 15004: 83 e5 ldi r24, 0x53 ; 83 15006: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1500a: 88 23 and r24, r24 1500c: 99 f0 breq .+38 ; 0x15034 if(strchr_pointer 15012: 90 91 96 03 lds r25, 0x0396 ; 0x800396 15016: 80 17 cp r24, r16 15018: 91 07 cpc r25, r17 1501a: 60 f4 brcc .+24 ; 0x15034 card.setIndex(code_value_long()); 1501c: 0e 94 20 5c call 0xb840 ; 0xb840 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 15020: 60 93 80 17 sts 0x1780, r22 ; 0x801780 15024: 70 93 81 17 sts 0x1781, r23 ; 0x801781 15028: 80 93 82 17 sts 0x1782, r24 ; 0x801782 1502c: 90 93 83 17 sts 0x1783, r25 ; 0x801783 15030: 0f 94 b8 77 call 0x2ef70 ; 0x2ef70 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 15034: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 15038: 88 23 and r24, r24 1503a: 31 f0 breq .+12 ; 0x15048 { sdprinting = true; 1503c: 81 e0 ldi r24, 0x01 ; 1 1503e: 80 93 6c 14 sts 0x146C, r24 ; 0x80146c 15042: 85 e0 ldi r24, 0x05 ; 5 15044: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> card.startFileprint(); if(!call_procedure) 15048: f1 10 cpse r15, r1 1504a: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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); }; 1504e: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 15052: 88 23 and r24, r24 15054: 61 f0 breq .+24 ; 0x1506e { if(!card.get_sdpos()) 15056: 80 91 80 17 lds r24, 0x1780 ; 0x801780 1505a: 90 91 81 17 lds r25, 0x1781 ; 0x801781 1505e: a0 91 82 17 lds r26, 0x1782 ; 0x801782 15062: b0 91 83 17 lds r27, 0x1783 ; 0x801783 15066: 89 2b or r24, r25 15068: 8a 2b or r24, r26 1506a: 8b 2b or r24, r27 1506c: 69 f4 brne .+26 ; 0x15088 { // A new print has started from scratch, reset stats failstats_reset_print(); 1506e: 0e 94 c2 5c call 0xb984 ; 0xb984 sdpos_atomic = 0; 15072: 10 92 82 03 sts 0x0382, r1 ; 0x800382 15076: 10 92 83 03 sts 0x0383, r1 ; 0x800383 1507a: 10 92 84 03 sts 0x0384, r1 ; 0x800384 1507e: 10 92 85 03 sts 0x0385, r1 ; 0x800385 15082: 80 e0 ldi r24, 0x00 ; 0 15084: 0e 94 3a 83 call 0x10674 ; 0x10674 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 15088: 0f 94 c9 58 call 0x2b192 ; 0x2b192 1508c: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15090: 89 34 cpi r24, 0x49 ; 73 15092: 91 05 cpc r25, r1 15094: 11 f4 brne .+4 ; 0x1509a 15096: 0c 94 10 b5 jmp 0x16a20 ; 0x16a20 1509a: f4 f4 brge .+60 ; 0x150d8 1509c: 8e 32 cpi r24, 0x2E ; 46 1509e: 91 05 cpc r25, r1 150a0: 11 f4 brne .+4 ; 0x150a6 150a2: 0c 94 d2 b4 jmp 0x169a4 ; 0x169a4 150a6: 88 34 cpi r24, 0x48 ; 72 150a8: 91 05 cpc r25, r1 150aa: 09 f0 breq .+2 ; 0x150ae 150ac: 0b ce rjmp .-1002 ; 0x14cc4 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 150ae: 83 e5 ldi r24, 0x53 ; 83 150b0: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 150b4: 88 23 and r24, r24 150b6: 11 f4 brne .+4 ; 0x150bc 150b8: 0c 94 01 b5 jmp 0x16a02 ; 0x16a02 switch (code_value_uint8()){ 150bc: 0e 94 06 5c call 0xb80c ; 0xb80c 150c0: 88 23 and r24, r24 150c2: 11 f4 brne .+4 ; 0x150c8 150c4: 0c 94 fe b4 jmp 0x169fc ; 0x169fc 150c8: 81 30 cpi r24, 0x01 ; 1 150ca: 11 f0 breq .+4 ; 0x150d0 150cc: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 150d0: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 150d4: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 150d8: 8c 34 cpi r24, 0x4C ; 76 150da: 91 05 cpc r25, r1 150dc: 11 f4 brne .+4 ; 0x150e2 150de: 0c 94 b0 b5 jmp 0x16b60 ; 0x16b60 150e2: 14 f0 brlt .+4 ; 0x150e8 150e4: 0c 94 c3 b5 jmp 0x16b86 ; 0x16b86 150e8: 8b 34 cpi r24, 0x4B ; 75 150ea: 91 05 cpc r25, r1 150ec: 09 f0 breq .+2 ; 0x150f0 150ee: ea cd rjmp .-1068 ; 0x14cc4 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 150f0: 0f 94 77 16 call 0x22cee ; 0x22cee 150f4: 88 23 and r24, r24 150f6: 11 f4 brne .+4 ; 0x150fc 150f8: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 150fc: c5 cf rjmp .-118 ; 0x15088 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 150fe: 8e 36 cpi r24, 0x6E ; 110 15100: 91 05 cpc r25, r1 15102: 11 f4 brne .+4 ; 0x15108 15104: 0c 94 72 b8 jmp 0x170e4 ; 0x170e4 15108: 0c f0 brlt .+2 ; 0x1510c 1510a: 86 c0 rjmp .+268 ; 0x15218 1510c: 86 35 cpi r24, 0x56 ; 86 1510e: 91 05 cpc r25, r1 15110: 11 f4 brne .+4 ; 0x15116 15112: 0c 94 cd b7 jmp 0x16f9a ; 0x16f9a 15116: d4 f5 brge .+116 ; 0x1518c 15118: 83 35 cpi r24, 0x53 ; 83 1511a: 91 05 cpc r25, r1 1511c: 11 f4 brne .+4 ; 0x15122 1511e: 0c 94 77 b7 jmp 0x16eee ; 0x16eee 15122: 84 f4 brge .+32 ; 0x15144 15124: 8f 34 cpi r24, 0x4F ; 79 15126: 91 05 cpc r25, r1 15128: 11 f4 brne .+4 ; 0x1512e 1512a: 0c 94 33 b6 jmp 0x16c66 ; 0x16c66 1512e: 82 35 cpi r24, 0x52 ; 82 15130: 91 05 cpc r25, r1 15132: 09 f0 breq .+2 ; 0x15136 15134: c7 cd rjmp .-1138 ; 0x14cc4 /*! ### 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; 15136: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 1513a: 87 7f andi r24, 0xF7 ; 247 1513c: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 15140: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15144: 84 35 cpi r24, 0x54 ; 84 15146: 91 05 cpc r25, r1 15148: 11 f4 brne .+4 ; 0x1514e 1514a: 0c 94 7d b7 jmp 0x16efa ; 0x16efa 1514e: 85 35 cpi r24, 0x55 ; 85 15150: 91 05 cpc r25, r1 15152: 09 f0 breq .+2 ; 0x15156 15154: b7 cd rjmp .-1170 ; 0x14cc4 #### 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')) { 15156: 83 e5 ldi r24, 0x53 ; 83 15158: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1515c: 88 23 and r24, r24 1515e: 11 f4 brne .+4 ; 0x15164 15160: 0c 94 8d b2 jmp 0x1651a ; 0x1651a max_inactive_time = code_value() * 1000; 15164: 0e 94 4a 61 call 0xc294 ; 0xc294 15168: 20 e0 ldi r18, 0x00 ; 0 1516a: 30 e0 ldi r19, 0x00 ; 0 1516c: 4a e7 ldi r20, 0x7A ; 122 1516e: 54 e4 ldi r21, 0x44 ; 68 15170: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 15174: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 15178: 60 93 7e 03 sts 0x037E, r22 ; 0x80037e 1517c: 70 93 7f 03 sts 0x037F, r23 ; 0x80037f 15180: 80 93 80 03 sts 0x0380, r24 ; 0x800380 15184: 90 93 81 03 sts 0x0381, r25 ; 0x800381 15188: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1518c: 89 36 cpi r24, 0x69 ; 105 1518e: 91 05 cpc r25, r1 15190: 11 f4 brne .+4 ; 0x15196 15192: 0c 94 8f b6 jmp 0x16d1e ; 0x16d1e 15196: d4 f4 brge .+52 ; 0x151cc 15198: 8c 35 cpi r24, 0x5C ; 92 1519a: 91 05 cpc r25, r1 1519c: 11 f4 brne .+4 ; 0x151a2 1519e: 0c 94 ea b7 jmp 0x16fd4 ; 0x16fd4 151a2: 88 36 cpi r24, 0x68 ; 104 151a4: 91 05 cpc r25, r1 151a6: 09 f0 breq .+2 ; 0x151aa 151a8: 8d cd rjmp .-1254 ; 0x14cc4 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 151aa: 83 e5 ldi r24, 0x53 ; 83 151ac: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 151b0: 88 23 and r24, r24 151b2: 11 f4 brne .+4 ; 0x151b8 151b4: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { setTargetHotend(code_value()); 151b8: 0e 94 4a 61 call 0xc294 ; 0xc294 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 151bc: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 151c0: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 151c4: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b 151c8: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151cc: 8b 36 cpi r24, 0x6B ; 107 151ce: 91 05 cpc r25, r1 151d0: 11 f4 brne .+4 ; 0x151d6 151d2: 0c 94 74 b7 jmp 0x16ee8 ; 0x16ee8 151d6: 14 f4 brge .+4 ; 0x151dc 151d8: 0c 94 66 b7 jmp 0x16ecc ; 0x16ecc 151dc: 8d 36 cpi r24, 0x6D ; 109 151de: 91 05 cpc r25, r1 151e0: 09 f0 breq .+2 ; 0x151e4 151e2: 70 cd rjmp .-1312 ; 0x14cc4 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)); 151e4: 8e ed ldi r24, 0xDE ; 222 151e6: 99 e4 ldi r25, 0x49 ; 73 151e8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 151ec: 0f 94 e2 0b call 0x217c4 ; 0x217c4 heating_status = HeatingStatus::EXTRUDER_HEATING; 151f0: 81 e0 ldi r24, 0x01 ; 1 151f2: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 151f6: 83 e5 ldi r24, 0x53 ; 83 151f8: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 151fc: 88 23 and r24, r24 151fe: 11 f4 brne .+4 ; 0x15204 15200: 0c 94 a3 b6 jmp 0x16d46 ; 0x16d46 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 15204: 0e 94 4a 61 call 0xc294 ; 0xc294 15208: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 1520c: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 15210: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b 15214: 0c 94 a9 b6 jmp 0x16d52 ; 0x16d52 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15218: 87 37 cpi r24, 0x77 ; 119 1521a: 91 05 cpc r25, r1 1521c: 11 f4 brne .+4 ; 0x15222 1521e: 0c 94 b7 b9 jmp 0x1736e ; 0x1736e 15222: ac f5 brge .+106 ; 0x1528e 15224: 82 37 cpi r24, 0x72 ; 114 15226: 91 05 cpc r25, r1 15228: 11 f4 brne .+4 ; 0x1522e 1522a: 0c 94 6c b9 jmp 0x172d8 ; 0x172d8 1522e: b4 f4 brge .+44 ; 0x1525c 15230: 80 37 cpi r24, 0x70 ; 112 15232: 91 05 cpc r25, r1 15234: 11 f4 brne .+4 ; 0x1523a 15236: 0c 94 7c b6 jmp 0x16cf8 ; 0x16cf8 1523a: 81 37 cpi r24, 0x71 ; 113 1523c: 91 05 cpc r25, r1 1523e: 09 f0 breq .+2 ; 0x15242 15240: 41 cd rjmp .-1406 ; 0x14cc4 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 15242: 83 e5 ldi r24, 0x53 ; 83 15244: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15248: 88 23 and r24, r24 1524a: 11 f4 brne .+4 ; 0x15250 1524c: 0c 94 83 b8 jmp 0x17106 ; 0x17106 host_keepalive_interval = code_value_uint8(); 15250: 0e 94 06 5c call 0xb80c ; 0xb80c 15254: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 15258: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1525c: 85 37 cpi r24, 0x75 ; 117 1525e: 91 05 cpc r25, r1 15260: 11 f4 brne .+4 ; 0x15266 15262: 0c 94 6f b9 jmp 0x172de ; 0x172de 15266: 14 f0 brlt .+4 ; 0x1526c 15268: 0c 94 7f b9 jmp 0x172fe ; 0x172fe 1526c: 83 37 cpi r24, 0x73 ; 115 1526e: 91 05 cpc r25, r1 15270: 09 f0 breq .+2 ; 0x15274 15272: 28 cd rjmp .-1456 ; 0x14cc4 #### 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')) { 15274: 86 e5 ldi r24, 0x56 ; 86 15276: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1527a: 88 23 and r24, r24 1527c: 11 f4 brne .+4 ; 0x15282 1527e: 0c 94 98 b8 jmp 0x17130 ; 0x17130 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 15282: 84 eb ldi r24, 0xB4 ; 180 15284: 95 e8 ldi r25, 0x85 ; 133 15286: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 1528a: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1528e: 8c 38 cpi r24, 0x8C ; 140 15290: 91 05 cpc r25, r1 15292: 11 f4 brne .+4 ; 0x15298 15294: 0c 94 80 b6 jmp 0x16d00 ; 0x16d00 15298: 54 f4 brge .+20 ; 0x152ae 1529a: 8b 37 cpi r24, 0x7B ; 123 1529c: 91 05 cpc r25, r1 1529e: 11 f4 brne .+4 ; 0x152a4 152a0: 0c 94 1c ba jmp 0x17438 ; 0x17438 152a4: 8d 37 cpi r24, 0x7D ; 125 152a6: 91 05 cpc r25, r1 152a8: 09 f4 brne .+2 ; 0x152ac 152aa: 80 cd rjmp .-1280 ; 0x14dac 152ac: 0b cd rjmp .-1514 ; 0x14cc4 152ae: 8e 3b cpi r24, 0xBE ; 190 152b0: 91 05 cpc r25, r1 152b2: 11 f4 brne .+4 ; 0x152b8 152b4: 0c 94 d9 b6 jmp 0x16db2 ; 0x16db2 152b8: 88 3c cpi r24, 0xC8 ; 200 152ba: 91 05 cpc r25, r1 152bc: 11 f4 brne .+4 ; 0x152c2 152be: 0c 94 1f ba jmp 0x1743e ; 0x1743e 152c2: 8b 39 cpi r24, 0x9B ; 155 152c4: 91 05 cpc r25, r1 152c6: 09 f0 breq .+2 ; 0x152ca 152c8: fd cc rjmp .-1542 ; 0x14cc4 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 152ca: 83 e5 ldi r24, 0x53 ; 83 152cc: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 152d0: 88 23 and r24, r24 152d2: 61 f0 breq .+24 ; 0x152ec autoReportFeatures.SetPeriod( code_value_uint8() ); 152d4: 0e 94 06 5c call 0xb80c ; 0xb80c 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; 152d8: 80 93 64 14 sts 0x1464, r24 ; 0x801464 if (auto_report_period != 0){ 152dc: 88 23 and r24, r24 152de: 11 f4 brne .+4 ; 0x152e4 152e0: 0c 94 9b b6 jmp 0x16d36 ; 0x16d36 auto_report_timer.start(); 152e4: 85 e6 ldi r24, 0x65 ; 101 152e6: 94 e1 ldi r25, 0x14 ; 20 152e8: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 152ec: 83 e4 ldi r24, 0x43 ; 67 152ee: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 152f2: 88 23 and r24, r24 152f4: 11 f4 brne .+4 ; 0x152fa 152f6: 0c 94 9f b6 jmp 0x16d3e ; 0x16d3e autoReportFeatures.SetMask(code_value_uint8()); 152fa: 0e 94 06 5c call 0xb80c ; 0xb80c 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; } 152fe: 80 93 63 14 sts 0x1463, r24 ; 0x801463 15302: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15306: 85 3f cpi r24, 0xF5 ; 245 15308: f1 e0 ldi r31, 0x01 ; 1 1530a: 9f 07 cpc r25, r31 1530c: 11 f4 brne .+4 ; 0x15312 1530e: 0c 94 09 c2 jmp 0x18412 ; 0x18412 15312: 0c f0 brlt .+2 ; 0x15316 15314: 60 c4 rjmp .+2240 ; 0x15bd6 15316: 81 15 cp r24, r1 15318: 31 e0 ldi r19, 0x01 ; 1 1531a: 93 07 cpc r25, r19 1531c: 11 f4 brne .+4 ; 0x15322 1531e: 0c 94 8b bd jmp 0x17b16 ; 0x17b16 15322: 0c f0 brlt .+2 ; 0x15326 15324: 24 c1 rjmp .+584 ; 0x1556e 15326: 80 3d cpi r24, 0xD0 ; 208 15328: 91 05 cpc r25, r1 1532a: 11 f4 brne .+4 ; 0x15330 1532c: 0c 94 ce bb jmp 0x1779c ; 0x1779c 15330: 0c f0 brlt .+2 ; 0x15334 15332: 77 c0 rjmp .+238 ; 0x15422 15334: 8d 3c cpi r24, 0xCD ; 205 15336: 91 05 cpc r25, r1 15338: 11 f4 brne .+4 ; 0x1533e 1533a: 0c 94 38 bb jmp 0x17670 ; 0x17670 1533e: ac f5 brge .+106 ; 0x153aa 15340: 8b 3c cpi r24, 0xCB ; 203 15342: 91 05 cpc r25, r1 15344: 11 f4 brne .+4 ; 0x1534a 15346: 0c 94 af ba jmp 0x1755e ; 0x1755e 1534a: 8c 3c cpi r24, 0xCC ; 204 1534c: 91 05 cpc r25, r1 1534e: 09 f0 breq .+2 ; 0x15352 15350: b9 cc rjmp .-1678 ; 0x14cc4 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 15352: 83 e5 ldi r24, 0x53 ; 83 15354: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15358: 88 23 and r24, r24 1535a: 11 f4 brne .+4 ; 0x15360 1535c: 0c 94 07 bb jmp 0x1760e ; 0x1760e // 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(); 15360: 0e 94 4a 61 call 0xc294 ; 0xc294 15364: 60 93 2c 07 sts 0x072C, r22 ; 0x80072c 15368: 70 93 2d 07 sts 0x072D, r23 ; 0x80072d 1536c: 80 93 2e 07 sts 0x072E, r24 ; 0x80072e 15370: 90 93 2f 07 sts 0x072F, r25 ; 0x80072f 15374: 60 93 a0 06 sts 0x06A0, r22 ; 0x8006a0 15378: 70 93 a1 06 sts 0x06A1, r23 ; 0x8006a1 1537c: 80 93 a2 06 sts 0x06A2, r24 ; 0x8006a2 15380: 90 93 a3 06 sts 0x06A3, r25 ; 0x8006a3 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 15384: 84 e5 ldi r24, 0x54 ; 84 15386: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1538a: 88 23 and r24, r24 1538c: 11 f4 brne .+4 ; 0x15392 1538e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a cs.retract_acceleration = code_value(); 15392: 0e 94 4a 61 call 0xc294 ; 0xc294 15396: 60 93 a4 06 sts 0x06A4, r22 ; 0x8006a4 1539a: 70 93 a5 06 sts 0x06A5, r23 ; 0x8006a5 1539e: 80 93 a6 06 sts 0x06A6, r24 ; 0x8006a6 153a2: 90 93 a7 06 sts 0x06A7, r25 ; 0x8006a7 153a6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 153aa: 8e 3c cpi r24, 0xCE ; 206 153ac: 91 05 cpc r25, r1 153ae: 11 f4 brne .+4 ; 0x153b4 153b0: 0c 94 b1 bb jmp 0x17762 ; 0x17762 153b4: 8f 3c cpi r24, 0xCF ; 207 153b6: 91 05 cpc r25, r1 153b8: 09 f0 breq .+2 ; 0x153bc 153ba: 84 cc rjmp .-1784 ; 0x14cc4 - `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')) 153bc: 83 e5 ldi r24, 0x53 ; 83 153be: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 153c2: 88 23 and r24, r24 153c4: 51 f0 breq .+20 ; 0x153da { cs.retract_length = code_value() ; 153c6: 0e 94 4a 61 call 0xc294 ; 0xc294 153ca: 60 93 ef 06 sts 0x06EF, r22 ; 0x8006ef 153ce: 70 93 f0 06 sts 0x06F0, r23 ; 0x8006f0 153d2: 80 93 f1 06 sts 0x06F1, r24 ; 0x8006f1 153d6: 90 93 f2 06 sts 0x06F2, r25 ; 0x8006f2 } if(code_seen('F')) 153da: 86 e4 ldi r24, 0x46 ; 70 153dc: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 153e0: 88 23 and r24, r24 153e2: 61 f0 breq .+24 ; 0x153fc { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 153e4: 0e 94 4a 61 call 0xc294 ; 0xc294 153e8: 0e 94 74 67 call 0xcee8 ; 0xcee8 153ec: 60 93 f3 06 sts 0x06F3, r22 ; 0x8006f3 153f0: 70 93 f4 06 sts 0x06F4, r23 ; 0x8006f4 153f4: 80 93 f5 06 sts 0x06F5, r24 ; 0x8006f5 153f8: 90 93 f6 06 sts 0x06F6, r25 ; 0x8006f6 } if(code_seen('Z')) 153fc: 8a e5 ldi r24, 0x5A ; 90 153fe: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15402: 88 23 and r24, r24 15404: 11 f4 brne .+4 ; 0x1540a 15406: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { cs.retract_zlift = code_value() ; 1540a: 0e 94 4a 61 call 0xc294 ; 0xc294 1540e: 60 93 f7 06 sts 0x06F7, r22 ; 0x8006f7 15412: 70 93 f8 06 sts 0x06F8, r23 ; 0x8006f8 15416: 80 93 f9 06 sts 0x06F9, r24 ; 0x8006f9 1541a: 90 93 fa 06 sts 0x06FA, r25 ; 0x8006fa 1541e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15422: 8c 3d cpi r24, 0xDC ; 220 15424: 91 05 cpc r25, r1 15426: 11 f4 brne .+4 ; 0x1542c 15428: 0c 94 35 bc jmp 0x1786a ; 0x1786a 1542c: 0c f0 brlt .+2 ; 0x15430 1542e: 82 c0 rjmp .+260 ; 0x15534 15430: 81 3d cpi r24, 0xD1 ; 209 15432: 91 05 cpc r25, r1 15434: 11 f4 brne .+4 ; 0x1543a 15436: 0c 94 f2 bb jmp 0x177e4 ; 0x177e4 1543a: 86 3d cpi r24, 0xD6 ; 214 1543c: 91 05 cpc r25, r1 1543e: 09 f0 breq .+2 ; 0x15442 15440: 41 cc rjmp .-1918 ; 0x14cc4 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; 15442: 80 e5 ldi r24, 0x50 ; 80 15444: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15448: 88 23 and r24, r24 1544a: 11 f4 brne .+4 ; 0x15450 1544c: 0c 94 21 bc jmp 0x17842 ; 0x17842 15450: 0e 94 4a 61 call 0xc294 ; 0xc294 15454: 2b 01 movw r4, r22 15456: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 15458: 83 e5 ldi r24, 0x53 ; 83 1545a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1545e: 88 23 and r24, r24 15460: 11 f4 brne .+4 ; 0x15466 15462: 0c 94 2b bc jmp 0x17856 ; 0x17856 15466: 0e 94 4a 61 call 0xc294 ; 0xc294 1546a: 4b 01 movw r8, r22 1546c: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 1546e: 8e e4 ldi r24, 0x4E ; 78 15470: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15474: d0 90 38 07 lds r13, 0x0738 ; 0x800738 15478: 88 23 and r24, r24 1547a: 29 f0 breq .+10 ; 0x15486 1547c: 0e 94 4a 61 call 0xc294 ; 0xc294 15480: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 15484: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 15486: 82 e5 ldi r24, 0x52 ; 82 15488: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1548c: e0 90 39 07 lds r14, 0x0739 ; 0x800739 15490: f0 90 3a 07 lds r15, 0x073A ; 0x80073a 15494: 88 23 and r24, r24 15496: 29 f0 breq .+10 ; 0x154a2 15498: 0e 94 4a 61 call 0xc294 ; 0xc294 1549c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 154a0: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 154a2: 86 e4 ldi r24, 0x46 ; 70 154a4: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 154a8: 00 91 3b 07 lds r16, 0x073B ; 0x80073b 154ac: 10 91 3c 07 lds r17, 0x073C ; 0x80073c 154b0: 88 23 and r24, r24 154b2: 29 f0 breq .+10 ; 0x154be 154b4: 0e 94 4a 61 call 0xc294 ; 0xc294 154b8: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 154bc: 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) 154be: 20 e0 ldi r18, 0x00 ; 0 154c0: 30 e0 ldi r19, 0x00 ; 0 154c2: a9 01 movw r20, r18 154c4: c3 01 movw r24, r6 154c6: b2 01 movw r22, r4 154c8: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 154cc: 18 16 cp r1, r24 154ce: 14 f0 brlt .+4 ; 0x154d4 154d0: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 154d4: 20 e0 ldi r18, 0x00 ; 0 154d6: 30 e0 ldi r19, 0x00 ; 0 154d8: a9 01 movw r20, r18 154da: c5 01 movw r24, r10 154dc: b4 01 movw r22, r8 154de: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 154e2: 87 ff sbrs r24, 7 154e4: 02 c0 rjmp .+4 ; 0x154ea 154e6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 154ea: a5 01 movw r20, r10 154ec: 94 01 movw r18, r8 154ee: c3 01 movw r24, r6 154f0: b2 01 movw r22, r4 154f2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 154f6: 87 ff sbrs r24, 7 154f8: 02 c0 rjmp .+4 ; 0x154fe 154fa: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 154fe: 40 92 30 07 sts 0x0730, r4 ; 0x800730 15502: 50 92 31 07 sts 0x0731, r5 ; 0x800731 15506: 60 92 32 07 sts 0x0732, r6 ; 0x800732 1550a: 70 92 33 07 sts 0x0733, r7 ; 0x800733 cs.min_mm_per_arc_segment = s; 1550e: 80 92 34 07 sts 0x0734, r8 ; 0x800734 15512: 90 92 35 07 sts 0x0735, r9 ; 0x800735 15516: a0 92 36 07 sts 0x0736, r10 ; 0x800736 1551a: b0 92 37 07 sts 0x0737, r11 ; 0x800737 cs.n_arc_correction = n; 1551e: d0 92 38 07 sts 0x0738, r13 ; 0x800738 cs.min_arc_segments = r; 15522: f0 92 3a 07 sts 0x073A, r15 ; 0x80073a 15526: e0 92 39 07 sts 0x0739, r14 ; 0x800739 cs.arc_segments_per_sec = f; 1552a: 10 93 3c 07 sts 0x073C, r17 ; 0x80073c 1552e: 00 93 3b 07 sts 0x073B, r16 ; 0x80073b 15532: f3 c7 rjmp .+4070 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15534: 82 3e cpi r24, 0xE2 ; 226 15536: 91 05 cpc r25, r1 15538: 11 f4 brne .+4 ; 0x1553e 1553a: 0c 94 86 bc jmp 0x1790c ; 0x1790c 1553e: 80 3f cpi r24, 0xF0 ; 240 15540: 91 05 cpc r25, r1 15542: 09 f4 brne .+2 ; 0x15546 15544: ea c7 rjmp .+4052 ; 0x1651a 15546: 8d 3d cpi r24, 0xDD ; 221 15548: 91 05 cpc r25, r1 1554a: 09 f0 breq .+2 ; 0x1554e 1554c: bb cb rjmp .-2186 ; 0x14cc4 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 1554e: 83 e5 ldi r24, 0x53 ; 83 15550: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15554: 88 23 and r24, r24 15556: 11 f4 brne .+4 ; 0x1555c 15558: 0c 94 74 bc jmp 0x178e8 ; 0x178e8 { extrudemultiply = code_value_short(); 1555c: 0e 94 13 5c call 0xb826 ; 0xb826 15560: 90 93 95 02 sts 0x0295, r25 ; 0x800295 15564: 80 93 94 02 sts 0x0294, r24 ; 0x800294 calculate_extruder_multipliers(); 15568: 0e 94 66 66 call 0xcccc ; 0xcccc 1556c: d6 c7 rjmp .+4012 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1556e: 8e 35 cpi r24, 0x5E ; 94 15570: 51 e0 ldi r21, 0x01 ; 1 15572: 95 07 cpc r25, r21 15574: 11 f4 brne .+4 ; 0x1557a 15576: 0c 94 b8 cb jmp 0x19770 ; 0x19770 1557a: 0c f0 brlt .+2 ; 0x1557e 1557c: ec c2 rjmp .+1496 ; 0x15b56 1557e: 8e 32 cpi r24, 0x2E ; 46 15580: b1 e0 ldi r27, 0x01 ; 1 15582: 9b 07 cpc r25, r27 15584: 11 f4 brne .+4 ; 0x1558a 15586: 0c 94 e9 bd jmp 0x17bd2 ; 0x17bd2 1558a: 0c f0 brlt .+2 ; 0x1558e 1558c: 82 c0 rjmp .+260 ; 0x15692 1558e: 8c 32 cpi r24, 0x2C ; 44 15590: f1 e0 ldi r31, 0x01 ; 1 15592: 9f 07 cpc r25, r31 15594: 11 f4 brne .+4 ; 0x1559a 15596: 0c 94 df bc jmp 0x179be ; 0x179be 1559a: 8d 32 cpi r24, 0x2D ; 45 1559c: 91 40 sbci r25, 0x01 ; 1 1559e: 09 f0 breq .+2 ; 0x155a2 155a0: 91 cb rjmp .-2270 ; 0x14cc4 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 155a2: 80 e5 ldi r24, 0x50 ; 80 155a4: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 155a8: 88 23 and r24, r24 155aa: 51 f0 breq .+20 ; 0x155c0 155ac: 0e 94 4a 61 call 0xc294 ; 0xc294 155b0: 60 93 d4 06 sts 0x06D4, r22 ; 0x8006d4 155b4: 70 93 d5 06 sts 0x06D5, r23 ; 0x8006d5 155b8: 80 93 d6 06 sts 0x06D6, r24 ; 0x8006d6 155bc: 90 93 d7 06 sts 0x06D7, r25 ; 0x8006d7 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 155c0: 89 e4 ldi r24, 0x49 ; 73 155c2: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 155c6: 88 23 and r24, r24 155c8: 81 f0 breq .+32 ; 0x155ea 155ca: 0e 94 4a 61 call 0xc294 ; 0xc294 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 155ce: 2c ea ldi r18, 0xAC ; 172 155d0: 35 ec ldi r19, 0xC5 ; 197 155d2: 47 e2 ldi r20, 0x27 ; 39 155d4: 5e e3 ldi r21, 0x3E ; 62 155d6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 155da: 60 93 d8 06 sts 0x06D8, r22 ; 0x8006d8 155de: 70 93 d9 06 sts 0x06D9, r23 ; 0x8006d9 155e2: 80 93 da 06 sts 0x06DA, r24 ; 0x8006da 155e6: 90 93 db 06 sts 0x06DB, r25 ; 0x8006db if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 155ea: 84 e4 ldi r24, 0x44 ; 68 155ec: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 155f0: 88 23 and r24, r24 155f2: 81 f0 breq .+32 ; 0x15614 155f4: 0e 94 4a 61 call 0xc294 ; 0xc294 } float unscalePID_i(float i) { return i/PID_dT; 155f8: 2c ea ldi r18, 0xAC ; 172 155fa: 35 ec ldi r19, 0xC5 ; 197 155fc: 47 e2 ldi r20, 0x27 ; 39 155fe: 5e e3 ldi r21, 0x3E ; 62 15600: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 15604: 60 93 dc 06 sts 0x06DC, r22 ; 0x8006dc 15608: 70 93 dd 06 sts 0x06DD, r23 ; 0x8006dd 1560c: 80 93 de 06 sts 0x06DE, r24 ; 0x8006de 15610: 90 93 df 06 sts 0x06DF, r25 ; 0x8006df updatePID(); 15614: 0f 94 0f 51 call 0x2a21e ; 0x2a21e SERIAL_PROTOCOLRPGM(MSG_OK); 15618: 8a e0 ldi r24, 0x0A ; 10 1561a: 9e e6 ldi r25, 0x6E ; 110 1561c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLPGM(" p:"); 15620: 88 e8 ldi r24, 0x88 ; 136 15622: 97 e8 ldi r25, 0x87 ; 135 15624: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15628: 60 91 d4 06 lds r22, 0x06D4 ; 0x8006d4 1562c: 70 91 d5 06 lds r23, 0x06D5 ; 0x8006d5 15630: 80 91 d6 06 lds r24, 0x06D6 ; 0x8006d6 15634: 90 91 d7 06 lds r25, 0x06D7 ; 0x8006d7 15638: 42 e0 ldi r20, 0x02 ; 2 1563a: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 1563e: 84 e8 ldi r24, 0x84 ; 132 15640: 97 e8 ldi r25, 0x87 ; 135 15642: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 15646: 2c ea ldi r18, 0xAC ; 172 15648: 35 ec ldi r19, 0xC5 ; 197 1564a: 47 e2 ldi r20, 0x27 ; 39 1564c: 5e e3 ldi r21, 0x3E ; 62 1564e: 60 91 d8 06 lds r22, 0x06D8 ; 0x8006d8 15652: 70 91 d9 06 lds r23, 0x06D9 ; 0x8006d9 15656: 80 91 da 06 lds r24, 0x06DA ; 0x8006da 1565a: 90 91 db 06 lds r25, 0x06DB ; 0x8006db 1565e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 15662: 42 e0 ldi r20, 0x02 ; 2 15664: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 15668: 80 e8 ldi r24, 0x80 ; 128 1566a: 97 e8 ldi r25, 0x87 ; 135 1566c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15670: 2c ea ldi r18, 0xAC ; 172 15672: 35 ec ldi r19, 0xC5 ; 197 15674: 47 e2 ldi r20, 0x27 ; 39 15676: 5e e3 ldi r21, 0x3E ; 62 15678: 60 91 dc 06 lds r22, 0x06DC ; 0x8006dc 1567c: 70 91 dd 06 lds r23, 0x06DD ; 0x8006dd 15680: 80 91 de 06 lds r24, 0x06DE ; 0x8006de 15684: 90 91 df 06 lds r25, 0x06DF ; 0x8006df 15688: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 1568c: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 15690: 44 c7 rjmp .+3720 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15692: 80 33 cpi r24, 0x30 ; 48 15694: 31 e0 ldi r19, 0x01 ; 1 15696: 93 07 cpc r25, r19 15698: 11 f4 brne .+4 ; 0x1569e 1569a: 0c 94 12 bd jmp 0x17a24 ; 0x17a24 1569e: 14 f4 brge .+4 ; 0x156a4 156a0: 0c 94 f9 bd jmp 0x17bf2 ; 0x17bf2 156a4: 86 33 cpi r24, 0x36 ; 54 156a6: 91 40 sbci r25, 0x01 ; 1 156a8: 09 f0 breq .+2 ; 0x156ac 156aa: 0c cb rjmp .-2536 ; 0x14cc4 { // 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(); 156ac: 89 e4 ldi r24, 0x49 ; 73 156ae: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 156b2: 88 23 and r24, r24 156b4: 11 f4 brne .+4 ; 0x156ba 156b6: 0c 94 2c be jmp 0x17c58 ; 0x17c58 156ba: 0e 94 13 5c call 0xb826 ; 0xb826 156be: ab 96 adiw r28, 0x2b ; 43 156c0: 8f af std Y+63, r24 ; 0x3f 156c2: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 156c4: 82 e5 ldi r24, 0x52 ; 82 156c6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 156ca: 88 23 and r24, r24 156cc: 11 f4 brne .+4 ; 0x156d2 156ce: 0c 94 32 be jmp 0x17c64 ; 0x17c64 156d2: 0e 94 4a 61 call 0xc294 ; 0xc294 156d6: e2 96 adiw r28, 0x32 ; 50 156d8: 6c af std Y+60, r22 ; 0x3c 156da: 7d af std Y+61, r23 ; 0x3d 156dc: 8e af std Y+62, r24 ; 0x3e 156de: 9f af std Y+63, r25 ; 0x3f 156e0: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 156e2: 80 e5 ldi r24, 0x50 ; 80 156e4: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 - `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; 156e8: c1 2c mov r12, r1 156ea: d1 2c mov r13, r1 156ec: 60 ec ldi r22, 0xC0 ; 192 156ee: e6 2e mov r14, r22 156f0: 6f e7 ldi r22, 0x7F ; 127 156f2: 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(); 156f4: 88 23 and r24, r24 156f6: 21 f0 breq .+8 ; 0x15700 156f8: 0e 94 4a 61 call 0xc294 ; 0xc294 156fc: 6b 01 movw r12, r22 156fe: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 15700: 85 e5 ldi r24, 0x55 ; 85 15702: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15706: 88 23 and r24, r24 15708: 11 f4 brne .+4 ; 0x1570e 1570a: 0c 94 3e be jmp 0x17c7c ; 0x17c7c 1570e: 0e 94 4a 61 call 0xc294 ; 0xc294 15712: 6e 96 adiw r28, 0x1e ; 30 15714: 6c af std Y+60, r22 ; 0x3c 15716: 7d af std Y+61, r23 ; 0x3d 15718: 8e af std Y+62, r24 ; 0x3e 1571a: 9f af std Y+63, r25 ; 0x3f 1571c: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 1571e: 86 e5 ldi r24, 0x56 ; 86 15720: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15724: 88 23 and r24, r24 15726: 11 f4 brne .+4 ; 0x1572c 15728: 0c 94 4a be jmp 0x17c94 ; 0x17c94 1572c: 0e 94 4a 61 call 0xc294 ; 0xc294 15730: a2 96 adiw r28, 0x22 ; 34 15732: 6c af std Y+60, r22 ; 0x3c 15734: 7d af std Y+61, r23 ; 0x3d 15736: 8e af std Y+62, r24 ; 0x3e 15738: 9f af std Y+63, r25 ; 0x3f 1573a: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 1573c: 83 e4 ldi r24, 0x43 ; 67 1573e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15742: 88 23 and r24, r24 15744: 11 f4 brne .+4 ; 0x1574a 15746: 0c 94 56 be jmp 0x17cac ; 0x17cac 1574a: 0e 94 4a 61 call 0xc294 ; 0xc294 1574e: 6a 96 adiw r28, 0x1a ; 26 15750: 6c af std Y+60, r22 ; 0x3c 15752: 7d af std Y+61, r23 ; 0x3d 15754: 8e af std Y+62, r24 ; 0x3e 15756: 9f af std Y+63, r25 ; 0x3f 15758: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 1575a: 84 e4 ldi r24, 0x44 ; 68 1575c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15760: 88 23 and r24, r24 15762: 11 f4 brne .+4 ; 0x15768 15764: 0c 94 62 be jmp 0x17cc4 ; 0x17cc4 15768: 0e 94 4a 61 call 0xc294 ; 0xc294 1576c: aa 96 adiw r28, 0x2a ; 42 1576e: 6c af std Y+60, r22 ; 0x3c 15770: 7d af std Y+61, r23 ; 0x3d 15772: 8e af std Y+62, r24 ; 0x3e 15774: 9f af std Y+63, r25 ; 0x3f 15776: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 15778: 8c e4 ldi r24, 0x4C ; 76 1577a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 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; 1577e: 0f ef ldi r16, 0xFF ; 255 15780: 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(); 15782: 88 23 and r24, r24 15784: 19 f0 breq .+6 ; 0x1578c 15786: 0e 94 13 5c call 0xb826 ; 0xb826 1578a: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 1578c: 83 e5 ldi r24, 0x53 ; 83 1578e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15792: 88 23 and r24, r24 15794: 11 f4 brne .+4 ; 0x1579a 15796: 0c 94 6e be jmp 0x17cdc ; 0x17cdc 1579a: 0e 94 13 5c call 0xb826 ; 0xb826 1579e: e3 96 adiw r28, 0x33 ; 51 157a0: 8f af std Y+63, r24 ; 0x3f 157a2: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 157a4: 82 e4 ldi r24, 0x42 ; 66 157a6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 157aa: 88 23 and r24, r24 157ac: 11 f4 brne .+4 ; 0x157b2 157ae: 0c 94 74 be jmp 0x17ce8 ; 0x17ce8 157b2: 0e 94 13 5c call 0xb826 ; 0xb826 157b6: e7 96 adiw r28, 0x37 ; 55 157b8: 8f af std Y+63, r24 ; 0x3f 157ba: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 157bc: 84 e5 ldi r24, 0x54 ; 84 157be: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 157c2: 88 23 and r24, r24 157c4: 11 f4 brne .+4 ; 0x157ca 157c6: 0c 94 7a be jmp 0x17cf4 ; 0x17cf4 157ca: 0e 94 4a 61 call 0xc294 ; 0xc294 157ce: a6 96 adiw r28, 0x26 ; 38 157d0: 6c af std Y+60, r22 ; 0x3c 157d2: 7d af std Y+61, r23 ; 0x3d 157d4: 8e af std Y+62, r24 ; 0x3e 157d6: 9f af std Y+63, r25 ; 0x3f 157d8: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 157da: 85 e4 ldi r24, 0x45 ; 69 157dc: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 - `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; 157e0: 41 2c mov r4, r1 157e2: 51 2c mov r5, r1 157e4: 50 ec ldi r21, 0xC0 ; 192 157e6: 65 2e mov r6, r21 157e8: 5f e7 ldi r21, 0x7F ; 127 157ea: 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(); 157ec: 88 23 and r24, r24 157ee: 21 f0 breq .+8 ; 0x157f8 157f0: 0e 94 4a 61 call 0xc294 ; 0xc294 157f4: 2b 01 movw r4, r22 157f6: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 157f8: 87 e5 ldi r24, 0x57 ; 87 157fa: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 - `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; 157fe: 81 2c mov r8, r1 15800: 91 2c mov r9, r1 15802: 40 ec ldi r20, 0xC0 ; 192 15804: a4 2e mov r10, r20 15806: 4f e7 ldi r20, 0x7F ; 127 15808: 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(); 1580a: 88 23 and r24, r24 1580c: 21 f0 breq .+8 ; 0x15816 1580e: 0e 94 4a 61 call 0xc294 ; 0xc294 15812: 4b 01 movw r8, r22 15814: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 15816: 81 e4 ldi r24, 0x41 ; 65 15818: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 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; 1581c: 22 24 eor r2, r2 1581e: 2a 94 dec r2 15820: 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(); 15822: 88 23 and r24, r24 15824: 19 f0 breq .+6 ; 0x1582c 15826: 0e 94 13 5c call 0xb826 ; 0xb826 1582a: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 1582c: 86 e4 ldi r24, 0x46 ; 70 1582e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15832: 88 23 and r24, r24 15834: 11 f4 brne .+4 ; 0x1583a 15836: 0c 94 86 be jmp 0x17d0c ; 0x17d0c 1583a: 0e 94 13 5c call 0xb826 ; 0xb826 1583e: eb 96 adiw r28, 0x3b ; 59 15840: 8f af std Y+63, r24 ; 0x3f 15842: 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) 15844: e2 96 adiw r28, 0x32 ; 50 15846: 2c ad ldd r18, Y+60 ; 0x3c 15848: 3d ad ldd r19, Y+61 ; 0x3d 1584a: 4e ad ldd r20, Y+62 ; 0x3e 1584c: 5f ad ldd r21, Y+63 ; 0x3f 1584e: e2 97 sbiw r28, 0x32 ; 50 15850: ca 01 movw r24, r20 15852: b9 01 movw r22, r18 15854: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15858: 88 23 and r24, r24 1585a: 11 f4 brne .+4 ; 0x15860 1585c: 0c 94 90 be jmp 0x17d20 ; 0x17d20 15860: a7 01 movw r20, r14 15862: 96 01 movw r18, r12 15864: c7 01 movw r24, r14 15866: b6 01 movw r22, r12 15868: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 1586c: 88 23 and r24, r24 1586e: 11 f4 brne .+4 ; 0x15874 15870: 0c 94 90 be jmp 0x17d20 ; 0x17d20 15874: 6e 96 adiw r28, 0x1e ; 30 15876: 2c ad ldd r18, Y+60 ; 0x3c 15878: 3d ad ldd r19, Y+61 ; 0x3d 1587a: 4e ad ldd r20, Y+62 ; 0x3e 1587c: 5f ad ldd r21, Y+63 ; 0x3f 1587e: 6e 97 sbiw r28, 0x1e ; 30 15880: ca 01 movw r24, r20 15882: b9 01 movw r22, r18 15884: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15888: 88 23 and r24, r24 1588a: 11 f4 brne .+4 ; 0x15890 1588c: 0c 94 90 be jmp 0x17d20 ; 0x17d20 15890: a2 96 adiw r28, 0x22 ; 34 15892: 2c ad ldd r18, Y+60 ; 0x3c 15894: 3d ad ldd r19, Y+61 ; 0x3d 15896: 4e ad ldd r20, Y+62 ; 0x3e 15898: 5f ad ldd r21, Y+63 ; 0x3f 1589a: a2 97 sbiw r28, 0x22 ; 34 1589c: ca 01 movw r24, r20 1589e: b9 01 movw r22, r18 158a0: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 158a4: 88 23 and r24, r24 158a6: 11 f4 brne .+4 ; 0x158ac 158a8: 0c 94 90 be jmp 0x17d20 ; 0x17d20 158ac: 6a 96 adiw r28, 0x1a ; 26 158ae: 2c ad ldd r18, Y+60 ; 0x3c 158b0: 3d ad ldd r19, Y+61 ; 0x3d 158b2: 4e ad ldd r20, Y+62 ; 0x3e 158b4: 5f ad ldd r21, Y+63 ; 0x3f 158b6: 6a 97 sbiw r28, 0x1a ; 26 158b8: ca 01 movw r24, r20 158ba: b9 01 movw r22, r18 158bc: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 158c0: 88 23 and r24, r24 158c2: 11 f4 brne .+4 ; 0x158c8 158c4: 0c 94 90 be jmp 0x17d20 ; 0x17d20 158c8: aa 96 adiw r28, 0x2a ; 42 158ca: 2c ad ldd r18, Y+60 ; 0x3c 158cc: 3d ad ldd r19, Y+61 ; 0x3d 158ce: 4e ad ldd r20, Y+62 ; 0x3e 158d0: 5f ad ldd r21, Y+63 ; 0x3f 158d2: aa 97 sbiw r28, 0x2a ; 42 158d4: ca 01 movw r24, r20 158d6: b9 01 movw r22, r18 158d8: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 158dc: 88 23 and r24, r24 158de: 11 f4 brne .+4 ; 0x158e4 158e0: 0c 94 90 be jmp 0x17d20 ; 0x17d20 158e4: a6 96 adiw r28, 0x26 ; 38 158e6: 2c ad ldd r18, Y+60 ; 0x3c 158e8: 3d ad ldd r19, Y+61 ; 0x3d 158ea: 4e ad ldd r20, Y+62 ; 0x3e 158ec: 5f ad ldd r21, Y+63 ; 0x3f 158ee: a6 97 sbiw r28, 0x26 ; 38 158f0: ca 01 movw r24, r20 158f2: b9 01 movw r22, r18 158f4: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 158f8: 88 23 and r24, r24 158fa: 11 f4 brne .+4 ; 0x15900 158fc: 0c 94 90 be jmp 0x17d20 ; 0x17d20 15900: a5 01 movw r20, r10 15902: 94 01 movw r18, r8 15904: c5 01 movw r24, r10 15906: b4 01 movw r22, r8 15908: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 1590c: 88 23 and r24, r24 1590e: 11 f4 brne .+4 ; 0x15914 15910: 0c 94 90 be jmp 0x17d20 ; 0x17d20 15914: a3 01 movw r20, r6 15916: 92 01 movw r18, r4 15918: c3 01 movw r24, r6 1591a: b2 01 movw r22, r4 1591c: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15920: 88 23 and r24, r24 15922: 11 f4 brne .+4 ; 0x15928 15924: 0c 94 90 be jmp 0x17d20 ; 0x17d20 && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 15928: ab 96 adiw r28, 0x2b ; 43 1592a: af ad ldd r26, Y+63 ; 0x3f 1592c: ab 97 sbiw r28, 0x2b ; 43 1592e: a7 fd sbrc r26, 7 15930: 02 c0 rjmp .+4 ; 0x15936 15932: 0c 94 90 be jmp 0x17d20 ; 0x17d20 15936: e3 96 adiw r28, 0x33 ; 51 15938: bf ad ldd r27, Y+63 ; 0x3f 1593a: e3 97 sbiw r28, 0x33 ; 51 1593c: b7 fd sbrc r27, 7 1593e: 02 c0 rjmp .+4 ; 0x15944 15940: 0c 94 90 be jmp 0x17d20 ; 0x17d20 15944: e7 96 adiw r28, 0x37 ; 55 15946: ef ad ldd r30, Y+63 ; 0x3f 15948: e7 97 sbiw r28, 0x37 ; 55 1594a: e7 fd sbrc r30, 7 1594c: 02 c0 rjmp .+4 ; 0x15952 1594e: 0c 94 95 be jmp 0x17d2a ; 0x17d2a 15952: 37 fc sbrc r3, 7 15954: 02 c0 rjmp .+4 ; 0x1595a 15956: 0c 94 e0 be jmp 0x17dc0 ; 0x17dc0 1595a: 17 ff sbrs r17, 7 1595c: 02 c0 rjmp .+4 ; 0x15962 1595e: 0c 94 8c be jmp 0x17d18 ; 0x17d18 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; 15962: ce 01 movw r24, r28 15964: 01 96 adiw r24, 0x01 ; 1 15966: 0f 94 d6 47 call 0x28fac ; 0x28fac if(!isnan(P) && P > 0) thermal_model::data.P = P; 1596a: a7 01 movw r20, r14 1596c: 96 01 movw r18, r12 1596e: c7 01 movw r24, r14 15970: b6 01 movw r22, r12 15972: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15976: 88 23 and r24, r24 15978: 11 f4 brne .+4 ; 0x1597e 1597a: 0c 94 84 bf jmp 0x17f08 ; 0x17f08 if(!isnan(U)) thermal_model::data.U = U; 1597e: 6e 96 adiw r28, 0x1e ; 30 15980: 2c ad ldd r18, Y+60 ; 0x3c 15982: 3d ad ldd r19, Y+61 ; 0x3d 15984: 4e ad ldd r20, Y+62 ; 0x3e 15986: 5f ad ldd r21, Y+63 ; 0x3f 15988: 6e 97 sbiw r28, 0x1e ; 30 1598a: ca 01 movw r24, r20 1598c: b9 01 movw r22, r18 1598e: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15992: 81 11 cpse r24, r1 15994: 0e c0 rjmp .+28 ; 0x159b2 15996: 6e 96 adiw r28, 0x1e ; 30 15998: 8c ad ldd r24, Y+60 ; 0x3c 1599a: 9d ad ldd r25, Y+61 ; 0x3d 1599c: ae ad ldd r26, Y+62 ; 0x3e 1599e: bf ad ldd r27, Y+63 ; 0x3f 159a0: 6e 97 sbiw r28, 0x1e ; 30 159a2: 80 93 ba 12 sts 0x12BA, r24 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 159a6: 90 93 bb 12 sts 0x12BB, r25 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 159aa: a0 93 bc 12 sts 0x12BC, r26 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 159ae: b0 93 bd 12 sts 0x12BD, r27 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> if(!isnan(V)) thermal_model::data.V = V; 159b2: a2 96 adiw r28, 0x22 ; 34 159b4: 2c ad ldd r18, Y+60 ; 0x3c 159b6: 3d ad ldd r19, Y+61 ; 0x3d 159b8: 4e ad ldd r20, Y+62 ; 0x3e 159ba: 5f ad ldd r21, Y+63 ; 0x3f 159bc: a2 97 sbiw r28, 0x22 ; 34 159be: ca 01 movw r24, r20 159c0: b9 01 movw r22, r18 159c2: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 159c6: 81 11 cpse r24, r1 159c8: 0e c0 rjmp .+28 ; 0x159e6 159ca: a2 96 adiw r28, 0x22 ; 34 159cc: 2c ad ldd r18, Y+60 ; 0x3c 159ce: 3d ad ldd r19, Y+61 ; 0x3d 159d0: 4e ad ldd r20, Y+62 ; 0x3e 159d2: 5f ad ldd r21, Y+63 ; 0x3f 159d4: a2 97 sbiw r28, 0x22 ; 34 159d6: 20 93 be 12 sts 0x12BE, r18 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 159da: 30 93 bf 12 sts 0x12BF, r19 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 159de: 40 93 c0 12 sts 0x12C0, r20 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 159e2: 50 93 c1 12 sts 0x12C1, r21 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 159e6: 6a 96 adiw r28, 0x1a ; 26 159e8: 2c ad ldd r18, Y+60 ; 0x3c 159ea: 3d ad ldd r19, Y+61 ; 0x3d 159ec: 4e ad ldd r20, Y+62 ; 0x3e 159ee: 5f ad ldd r21, Y+63 ; 0x3f 159f0: 6a 97 sbiw r28, 0x1a ; 26 159f2: ca 01 movw r24, r20 159f4: b9 01 movw r22, r18 159f6: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 159fa: 81 11 cpse r24, r1 159fc: 1b c0 rjmp .+54 ; 0x15a34 159fe: 20 e0 ldi r18, 0x00 ; 0 15a00: 30 e0 ldi r19, 0x00 ; 0 15a02: a9 01 movw r20, r18 15a04: 6a 96 adiw r28, 0x1a ; 26 15a06: 6c ad ldd r22, Y+60 ; 0x3c 15a08: 7d ad ldd r23, Y+61 ; 0x3d 15a0a: 8e ad ldd r24, Y+62 ; 0x3e 15a0c: 9f ad ldd r25, Y+63 ; 0x3f 15a0e: 6a 97 sbiw r28, 0x1a ; 26 15a10: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 15a14: 18 16 cp r1, r24 15a16: 74 f4 brge .+28 ; 0x15a34 15a18: 6a 96 adiw r28, 0x1a ; 26 15a1a: 8c ad ldd r24, Y+60 ; 0x3c 15a1c: 9d ad ldd r25, Y+61 ; 0x3d 15a1e: ae ad ldd r26, Y+62 ; 0x3e 15a20: bf ad ldd r27, Y+63 ; 0x3f 15a22: 6a 97 sbiw r28, 0x1a ; 26 15a24: 80 93 c2 12 sts 0x12C2, r24 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 15a28: 90 93 c3 12 sts 0x12C3, r25 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 15a2c: a0 93 c4 12 sts 0x12C4, r26 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 15a30: b0 93 c5 12 sts 0x12C5, r27 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> if(!isnan(D)) thermal_model::data.fS = D; 15a34: aa 96 adiw r28, 0x2a ; 42 15a36: 2c ad ldd r18, Y+60 ; 0x3c 15a38: 3d ad ldd r19, Y+61 ; 0x3d 15a3a: 4e ad ldd r20, Y+62 ; 0x3e 15a3c: 5f ad ldd r21, Y+63 ; 0x3f 15a3e: aa 97 sbiw r28, 0x2a ; 42 15a40: ca 01 movw r24, r20 15a42: b9 01 movw r22, r18 15a44: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15a48: 81 11 cpse r24, r1 15a4a: 0e c0 rjmp .+28 ; 0x15a68 15a4c: aa 96 adiw r28, 0x2a ; 42 15a4e: 2c ad ldd r18, Y+60 ; 0x3c 15a50: 3d ad ldd r19, Y+61 ; 0x3d 15a52: 4e ad ldd r20, Y+62 ; 0x3e 15a54: 5f ad ldd r21, Y+63 ; 0x3f 15a56: aa 97 sbiw r28, 0x2a ; 42 15a58: 20 93 c6 12 sts 0x12C6, r18 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 15a5c: 30 93 c7 12 sts 0x12C7, r19 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 15a60: 40 93 c8 12 sts 0x12C8, r20 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 15a64: 50 93 c9 12 sts 0x12C9, r21 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> if(L >= 0) thermal_model_set_lag(L); 15a68: 17 fd sbrc r17, 7 15a6a: 03 c0 rjmp .+6 ; 0x15a72 15a6c: c8 01 movw r24, r16 15a6e: 0f 94 b9 44 call 0x28972 ; 0x28972 if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 15a72: a6 96 adiw r28, 0x26 ; 38 15a74: 2c ad ldd r18, Y+60 ; 0x3c 15a76: 3d ad ldd r19, Y+61 ; 0x3d 15a78: 4e ad ldd r20, Y+62 ; 0x3e 15a7a: 5f ad ldd r21, Y+63 ; 0x3f 15a7c: a6 97 sbiw r28, 0x26 ; 38 15a7e: ca 01 movw r24, r20 15a80: b9 01 movw r22, r18 15a82: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15a86: 81 11 cpse r24, r1 15a88: 0e c0 rjmp .+28 ; 0x15aa6 15a8a: a6 96 adiw r28, 0x26 ; 38 15a8c: 8c ad ldd r24, Y+60 ; 0x3c 15a8e: 9d ad ldd r25, Y+61 ; 0x3d 15a90: ae ad ldd r26, Y+62 ; 0x3e 15a92: bf ad ldd r27, Y+63 ; 0x3f 15a94: a6 97 sbiw r28, 0x26 ; 38 15a96: 80 93 0c 13 sts 0x130C, r24 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 15a9a: 90 93 0d 13 sts 0x130D, r25 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 15a9e: a0 93 0e 13 sts 0x130E, r26 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 15aa2: b0 93 0f 13 sts 0x130F, r27 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 15aa6: a5 01 movw r20, r10 15aa8: 94 01 movw r18, r8 15aaa: c5 01 movw r24, r10 15aac: b4 01 movw r22, r8 15aae: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15ab2: 81 11 cpse r24, r1 15ab4: 11 c0 rjmp .+34 ; 0x15ad8 15ab6: 20 e0 ldi r18, 0x00 ; 0 15ab8: 30 e0 ldi r19, 0x00 ; 0 15aba: a9 01 movw r20, r18 15abc: c5 01 movw r24, r10 15abe: b4 01 movw r22, r8 15ac0: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 15ac4: 18 16 cp r1, r24 15ac6: 44 f4 brge .+16 ; 0x15ad8 15ac8: 80 92 10 13 sts 0x1310, r8 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15acc: 90 92 11 13 sts 0x1311, r9 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15ad0: a0 92 12 13 sts 0x1312, r10 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15ad4: b0 92 13 13 sts 0x1313, r11 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 15ad8: a3 01 movw r20, r6 15ada: 92 01 movw r18, r4 15adc: c3 01 movw r24, r6 15ade: b2 01 movw r22, r4 15ae0: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 15ae4: 81 11 cpse r24, r1 15ae6: 11 c0 rjmp .+34 ; 0x15b0a 15ae8: 20 e0 ldi r18, 0x00 ; 0 15aea: 30 e0 ldi r19, 0x00 ; 0 15aec: a9 01 movw r20, r18 15aee: c3 01 movw r24, r6 15af0: b2 01 movw r22, r4 15af2: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 15af6: 18 16 cp r1, r24 15af8: 44 f4 brge .+16 ; 0x15b0a 15afa: 40 92 14 13 sts 0x1314, r4 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 15afe: 50 92 15 13 sts 0x1315, r5 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 15b02: 60 92 16 13 sts 0x1316, r6 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 15b06: 70 92 17 13 sts 0x1317, r7 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> // ensure warn <= err if (thermal_model::data.warn > thermal_model::data.err) 15b0a: c0 90 14 13 lds r12, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 15b0e: d0 90 15 13 lds r13, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 15b12: e0 90 16 13 lds r14, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 15b16: f0 90 17 13 lds r15, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 15b1a: a7 01 movw r20, r14 15b1c: 96 01 movw r18, r12 15b1e: 60 91 10 13 lds r22, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15b22: 70 91 11 13 lds r23, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15b26: 80 91 12 13 lds r24, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15b2a: 90 91 13 13 lds r25, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 15b2e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 15b32: 18 16 cp r1, r24 15b34: 44 f4 brge .+16 ; 0x15b46 thermal_model::data.warn = thermal_model::data.err; 15b36: c0 92 10 13 sts 0x1310, r12 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15b3a: d0 92 11 13 sts 0x1311, r13 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15b3e: e0 92 12 13 sts 0x1312, r14 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15b42: f0 92 13 13 sts 0x1313, r15 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::setup(); 15b46: 0f 94 40 45 call 0x28a80 ; 0x28a80 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; 15b4a: ce 01 movw r24, r28 15b4c: 01 96 adiw r24, 0x01 ; 1 15b4e: 0f 94 c9 47 call 0x28f92 ; 0x28f92 15b52: 0c 94 06 bf jmp 0x17e0c ; 0x17e0c } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15b56: 85 39 cpi r24, 0x95 ; 149 15b58: a1 e0 ldi r26, 0x01 ; 1 15b5a: 9a 07 cpc r25, r26 15b5c: 11 f4 brne .+4 ; 0x15b62 15b5e: 0c 94 fc c1 jmp 0x183f8 ; 0x183f8 15b62: 2c f5 brge .+74 ; 0x15bae 15b64: 80 39 cpi r24, 0x90 ; 144 15b66: e1 e0 ldi r30, 0x01 ; 1 15b68: 9e 07 cpc r25, r30 15b6a: 11 f4 brne .+4 ; 0x15b70 15b6c: 0c 94 f8 c1 jmp 0x183f0 ; 0x183f0 15b70: 83 39 cpi r24, 0x93 ; 147 15b72: 91 40 sbci r25, 0x01 ; 1 15b74: 09 f0 breq .+2 ; 0x15b78 15b76: a6 c8 rjmp .-3764 ; 0x14cc4 */ 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()) 15b78: 80 91 96 13 lds r24, 0x1396 ; 0x801396 15b7c: 81 30 cpi r24, 0x01 ; 1 15b7e: 09 f0 breq .+2 ; 0x15b82 15b80: cc c4 rjmp .+2456 ; 0x1651a { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 15b82: 85 e4 ldi r24, 0x45 ; 69 15b84: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15b88: 81 11 cpse r24, r1 15b8a: 0e 94 06 5c call 0xb80c ; 0xb80c if(code_seen('F')) filament = code_value_uint8(); 15b8e: 86 e4 ldi r24, 0x46 ; 70 15b90: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 15b94: 81 11 cpse r24, r1 15b96: 0e 94 06 5c call 0xb80c ; 0xb80c MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 15b9a: 0f 94 4e 88 call 0x3109c ; 0x3109c 15b9e: 88 23 and r24, r24 15ba0: 09 f4 brne .+2 ; 0x15ba4 15ba2: bb c4 rjmp .+2422 ; 0x1651a // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 15ba4: 60 e0 ldi r22, 0x00 ; 0 15ba6: 80 e0 ldi r24, 0x00 ; 0 15ba8: 0f 94 9a 9f call 0x33f34 ; 0x33f34 15bac: b6 c4 rjmp .+2412 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15bae: 84 3a cpi r24, 0xA4 ; 164 15bb0: 21 e0 ldi r18, 0x01 ; 1 15bb2: 92 07 cpc r25, r18 15bb4: 11 f4 brne .+4 ; 0x15bba 15bb6: 0c 94 01 c2 jmp 0x18402 ; 0x18402 15bba: 84 3f cpi r24, 0xF4 ; 244 15bbc: 31 e0 ldi r19, 0x01 ; 1 15bbe: 93 07 cpc r25, r19 15bc0: 11 f4 brne .+4 ; 0x15bc6 15bc2: 0c 94 05 c2 jmp 0x1840a ; 0x1840a 15bc6: 86 39 cpi r24, 0x96 ; 150 15bc8: 91 40 sbci r25, 0x01 ; 1 15bca: 09 f0 breq .+2 ; 0x15bce 15bcc: 7b c8 rjmp .-3850 ; 0x14cc4 */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 15bce: 80 e0 ldi r24, 0x00 ; 0 15bd0: 0e 94 ac 75 call 0xeb58 ; 0xeb58 15bd4: a2 c4 rjmp .+2372 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15bd6: 83 3c cpi r24, 0xC3 ; 195 15bd8: 52 e0 ldi r21, 0x02 ; 2 15bda: 95 07 cpc r25, r21 15bdc: 11 f4 brne .+4 ; 0x15be2 15bde: 0c 94 35 cd jmp 0x19a6a ; 0x19a6a 15be2: 0c f0 brlt .+2 ; 0x15be6 15be4: e7 c3 rjmp .+1998 ; 0x163b4 15be6: 8a 35 cpi r24, 0x5A ; 90 15be8: b2 e0 ldi r27, 0x02 ; 2 15bea: 9b 07 cpc r25, r27 15bec: 11 f4 brne .+4 ; 0x15bf2 15bee: 0c 94 33 c6 jmp 0x18c66 ; 0x18c66 15bf2: 0c f0 brlt .+2 ; 0x15bf6 15bf4: 76 c3 rjmp .+1772 ; 0x162e2 15bf6: 8d 3f cpi r24, 0xFD ; 253 15bf8: f1 e0 ldi r31, 0x01 ; 1 15bfa: 9f 07 cpc r25, r31 15bfc: 11 f4 brne .+4 ; 0x15c02 15bfe: 0c 94 1f c2 jmp 0x1843e ; 0x1843e 15c02: 0c f0 brlt .+2 ; 0x15c06 15c04: 2e c3 rjmp .+1628 ; 0x16262 15c06: 86 3f cpi r24, 0xF6 ; 246 15c08: 31 e0 ldi r19, 0x01 ; 1 15c0a: 93 07 cpc r25, r19 15c0c: 11 f4 brne .+4 ; 0x15c12 15c0e: 0c 94 0d c2 jmp 0x1841a ; 0x1841a 15c12: 87 3f cpi r24, 0xF7 ; 247 15c14: 91 40 sbci r25, 0x01 ; 1 15c16: 09 f0 breq .+2 ; 0x15c1a 15c18: 55 c8 rjmp .-3926 ; 0x14cc4 #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( 15c1a: 80 91 cf 06 lds r24, 0x06CF ; 0x8006cf 15c1e: 8f 93 push r24 15c20: 80 91 ce 06 lds r24, 0x06CE ; 0x8006ce 15c24: 8f 93 push r24 15c26: 80 91 cd 06 lds r24, 0x06CD ; 0x8006cd 15c2a: 8f 93 push r24 15c2c: 80 91 cc 06 lds r24, 0x06CC ; 0x8006cc 15c30: 8f 93 push r24 15c32: 80 91 cb 06 lds r24, 0x06CB ; 0x8006cb 15c36: 8f 93 push r24 15c38: 80 91 ca 06 lds r24, 0x06CA ; 0x8006ca 15c3c: 8f 93 push r24 15c3e: 80 91 c9 06 lds r24, 0x06C9 ; 0x8006c9 15c42: 8f 93 push r24 15c44: 80 91 c8 06 lds r24, 0x06C8 ; 0x8006c8 15c48: 8f 93 push r24 15c4a: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 15c4e: 8f 93 push r24 15c50: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 15c54: 8f 93 push r24 15c56: 80 91 c5 06 lds r24, 0x06C5 ; 0x8006c5 15c5a: 8f 93 push r24 15c5c: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 15c60: 8f 93 push r24 15c62: 02 ee ldi r16, 0xE2 ; 226 15c64: 19 ea ldi r17, 0xA9 ; 169 15c66: 1f 93 push r17 15c68: 0f 93 push r16 15c6a: 1f 93 push r17 15c6c: 0f 93 push r16 15c6e: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 15c72: 8f 93 push r24 15c74: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 15c78: 8f 93 push r24 15c7a: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 15c7e: 8f 93 push r24 15c80: 80 91 c0 06 lds r24, 0x06C0 ; 0x8006c0 15c84: 8f 93 push r24 15c86: 80 91 bf 06 lds r24, 0x06BF ; 0x8006bf 15c8a: 8f 93 push r24 15c8c: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 15c90: 8f 93 push r24 15c92: 80 91 bd 06 lds r24, 0x06BD ; 0x8006bd 15c96: 8f 93 push r24 15c98: 80 91 bc 06 lds r24, 0x06BC ; 0x8006bc 15c9c: 8f 93 push r24 15c9e: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 15ca2: 8f 93 push r24 15ca4: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 15ca8: 8f 93 push r24 15caa: 80 91 b9 06 lds r24, 0x06B9 ; 0x8006b9 15cae: 8f 93 push r24 15cb0: 80 91 b8 06 lds r24, 0x06B8 ; 0x8006b8 15cb4: 8f 93 push r24 15cb6: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 15cba: 8f 93 push r24 15cbc: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 15cc0: 8f 93 push r24 15cc2: 80 91 b5 06 lds r24, 0x06B5 ; 0x8006b5 15cc6: 8f 93 push r24 15cc8: 80 91 b4 06 lds r24, 0x06B4 ; 0x8006b4 15ccc: 8f 93 push r24 15cce: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 15cd2: 8f 93 push r24 15cd4: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 15cd8: 8f 93 push r24 15cda: 80 91 b1 06 lds r24, 0x06B1 ; 0x8006b1 15cde: 8f 93 push r24 15ce0: 80 91 b0 06 lds r24, 0x06B0 ; 0x8006b0 15ce4: 8f 93 push r24 15ce6: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 15cea: 8f 93 push r24 15cec: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 15cf0: 8f 93 push r24 15cf2: 80 91 ad 06 lds r24, 0x06AD ; 0x8006ad 15cf6: 8f 93 push r24 15cf8: 80 91 ac 06 lds r24, 0x06AC ; 0x8006ac 15cfc: 8f 93 push r24 15cfe: 80 91 ab 06 lds r24, 0x06AB ; 0x8006ab 15d02: 8f 93 push r24 15d04: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 15d08: 8f 93 push r24 15d0a: 80 91 a9 06 lds r24, 0x06A9 ; 0x8006a9 15d0e: 8f 93 push r24 15d10: 80 91 a8 06 lds r24, 0x06A8 ; 0x8006a8 15d14: 8f 93 push r24 15d16: 1f 93 push r17 15d18: 0f 93 push r16 15d1a: 1f 93 push r17 15d1c: 0f 93 push r16 15d1e: 80 91 2f 07 lds r24, 0x072F ; 0x80072f 15d22: 8f 93 push r24 15d24: 80 91 2e 07 lds r24, 0x072E ; 0x80072e 15d28: 8f 93 push r24 15d2a: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 15d2e: 8f 93 push r24 15d30: 80 91 2c 07 lds r24, 0x072C ; 0x80072c 15d34: 8f 93 push r24 15d36: 80 91 a7 06 lds r24, 0x06A7 ; 0x8006a7 15d3a: 8f 93 push r24 15d3c: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 15d40: 8f 93 push r24 15d42: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 15d46: 8f 93 push r24 15d48: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 15d4c: 8f 93 push r24 15d4e: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 15d52: 8f 93 push r24 15d54: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 15d58: 8f 93 push r24 15d5a: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 15d5e: 8f 93 push r24 15d60: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 15d64: 8f 93 push r24 15d66: 1f 93 push r17 15d68: 0f 93 push r16 15d6a: 1f 93 push r17 15d6c: 0f 93 push r16 15d6e: 80 91 27 07 lds r24, 0x0727 ; 0x800727 15d72: 8f 93 push r24 15d74: 80 91 26 07 lds r24, 0x0726 ; 0x800726 15d78: 8f 93 push r24 15d7a: 80 91 25 07 lds r24, 0x0725 ; 0x800725 15d7e: 8f 93 push r24 15d80: 80 91 24 07 lds r24, 0x0724 ; 0x800724 15d84: 8f 93 push r24 15d86: 80 91 23 07 lds r24, 0x0723 ; 0x800723 15d8a: 8f 93 push r24 15d8c: 80 91 22 07 lds r24, 0x0722 ; 0x800722 15d90: 8f 93 push r24 15d92: 80 91 21 07 lds r24, 0x0721 ; 0x800721 15d96: 8f 93 push r24 15d98: 80 91 20 07 lds r24, 0x0720 ; 0x800720 15d9c: 8f 93 push r24 15d9e: 80 91 1f 07 lds r24, 0x071F ; 0x80071f 15da2: 8f 93 push r24 15da4: 80 91 1e 07 lds r24, 0x071E ; 0x80071e 15da8: 8f 93 push r24 15daa: 80 91 1d 07 lds r24, 0x071D ; 0x80071d 15dae: 8f 93 push r24 15db0: 80 91 1c 07 lds r24, 0x071C ; 0x80071c 15db4: 8f 93 push r24 15db6: 80 91 1b 07 lds r24, 0x071B ; 0x80071b 15dba: 8f 93 push r24 15dbc: 80 91 1a 07 lds r24, 0x071A ; 0x80071a 15dc0: 8f 93 push r24 15dc2: 80 91 19 07 lds r24, 0x0719 ; 0x800719 15dc6: 8f 93 push r24 15dc8: 80 91 18 07 lds r24, 0x0718 ; 0x800718 15dcc: 8f 93 push r24 15dce: 1f 93 push r17 15dd0: 0f 93 push r16 15dd2: 1f 93 push r17 15dd4: 0f 93 push r16 15dd6: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 15dda: 8f 93 push r24 15ddc: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 15de0: 8f 93 push r24 15de2: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 15de6: 8f 93 push r24 15de8: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 15dec: 8f 93 push r24 15dee: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 15df2: 8f 93 push r24 15df4: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 15df8: 8f 93 push r24 15dfa: 80 91 99 06 lds r24, 0x0699 ; 0x800699 15dfe: 8f 93 push r24 15e00: 80 91 98 06 lds r24, 0x0698 ; 0x800698 15e04: 8f 93 push r24 15e06: 80 91 97 06 lds r24, 0x0697 ; 0x800697 15e0a: 8f 93 push r24 15e0c: 80 91 96 06 lds r24, 0x0696 ; 0x800696 15e10: 8f 93 push r24 15e12: 80 91 95 06 lds r24, 0x0695 ; 0x800695 15e16: 8f 93 push r24 15e18: 80 91 94 06 lds r24, 0x0694 ; 0x800694 15e1c: 8f 93 push r24 15e1e: 80 91 93 06 lds r24, 0x0693 ; 0x800693 15e22: 8f 93 push r24 15e24: 80 91 92 06 lds r24, 0x0692 ; 0x800692 15e28: 8f 93 push r24 15e2a: 80 91 91 06 lds r24, 0x0691 ; 0x800691 15e2e: 8f 93 push r24 15e30: 80 91 90 06 lds r24, 0x0690 ; 0x800690 15e34: 8f 93 push r24 15e36: 1f 93 push r17 15e38: 0f 93 push r16 15e3a: 1f 93 push r17 15e3c: 0f 93 push r16 15e3e: 80 91 17 07 lds r24, 0x0717 ; 0x800717 15e42: 8f 93 push r24 15e44: 80 91 16 07 lds r24, 0x0716 ; 0x800716 15e48: 8f 93 push r24 15e4a: 80 91 15 07 lds r24, 0x0715 ; 0x800715 15e4e: 8f 93 push r24 15e50: 80 91 14 07 lds r24, 0x0714 ; 0x800714 15e54: 8f 93 push r24 15e56: 80 91 13 07 lds r24, 0x0713 ; 0x800713 15e5a: 8f 93 push r24 15e5c: 80 91 12 07 lds r24, 0x0712 ; 0x800712 15e60: 8f 93 push r24 15e62: 80 91 11 07 lds r24, 0x0711 ; 0x800711 15e66: 8f 93 push r24 15e68: 80 91 10 07 lds r24, 0x0710 ; 0x800710 15e6c: 8f 93 push r24 15e6e: 80 91 0f 07 lds r24, 0x070F ; 0x80070f 15e72: 8f 93 push r24 15e74: 80 91 0e 07 lds r24, 0x070E ; 0x80070e 15e78: 8f 93 push r24 15e7a: 80 91 0d 07 lds r24, 0x070D ; 0x80070d 15e7e: 8f 93 push r24 15e80: 80 91 0c 07 lds r24, 0x070C ; 0x80070c 15e84: 8f 93 push r24 15e86: 80 91 0b 07 lds r24, 0x070B ; 0x80070b 15e8a: 8f 93 push r24 15e8c: 80 91 0a 07 lds r24, 0x070A ; 0x80070a 15e90: 8f 93 push r24 15e92: 80 91 09 07 lds r24, 0x0709 ; 0x800709 15e96: 8f 93 push r24 15e98: 80 91 08 07 lds r24, 0x0708 ; 0x800708 15e9c: 8f 93 push r24 15e9e: 1f 93 push r17 15ea0: 0f 93 push r16 15ea2: 1f 93 push r17 15ea4: 0f 93 push r16 15ea6: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 15eaa: 8f 93 push r24 15eac: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 15eb0: 8f 93 push r24 15eb2: 80 91 8d 06 lds r24, 0x068D ; 0x80068d 15eb6: 8f 93 push r24 15eb8: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 15ebc: 8f 93 push r24 15ebe: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 15ec2: 8f 93 push r24 15ec4: 80 91 8a 06 lds r24, 0x068A ; 0x80068a 15ec8: 8f 93 push r24 15eca: 80 91 89 06 lds r24, 0x0689 ; 0x800689 15ece: 8f 93 push r24 15ed0: 80 91 88 06 lds r24, 0x0688 ; 0x800688 15ed4: 8f 93 push r24 15ed6: 80 91 87 06 lds r24, 0x0687 ; 0x800687 15eda: 8f 93 push r24 15edc: 80 91 86 06 lds r24, 0x0686 ; 0x800686 15ee0: 8f 93 push r24 15ee2: 80 91 85 06 lds r24, 0x0685 ; 0x800685 15ee6: 8f 93 push r24 15ee8: 80 91 84 06 lds r24, 0x0684 ; 0x800684 15eec: 8f 93 push r24 15eee: 80 91 83 06 lds r24, 0x0683 ; 0x800683 15ef2: 8f 93 push r24 15ef4: 80 91 82 06 lds r24, 0x0682 ; 0x800682 15ef8: 8f 93 push r24 15efa: 80 91 81 06 lds r24, 0x0681 ; 0x800681 15efe: 8f 93 push r24 15f00: 80 91 80 06 lds r24, 0x0680 ; 0x800680 15f04: 8f 93 push r24 15f06: 1f 93 push r17 15f08: 0f 93 push r16 15f0a: 1f 93 push r17 15f0c: 0f 93 push r16 15f0e: 80 91 2b 07 lds r24, 0x072B ; 0x80072b 15f12: 1f 92 push r1 15f14: 8f 93 push r24 15f16: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 15f1a: 1f 92 push r1 15f1c: 8f 93 push r24 15f1e: 80 91 29 07 lds r24, 0x0729 ; 0x800729 15f22: 1f 92 push r1 15f24: 8f 93 push r24 15f26: 80 91 28 07 lds r24, 0x0728 ; 0x800728 15f2a: 1f 92 push r1 15f2c: 8f 93 push r24 15f2e: 1f 93 push r17 15f30: 0f 93 push r16 15f32: 1f 93 push r17 15f34: 0f 93 push r16 15f36: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 15f3a: 8f 93 push r24 15f3c: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 15f40: 8f 93 push r24 15f42: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 15f46: 8f 93 push r24 15f48: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 15f4c: 8f 93 push r24 15f4e: 80 91 7b 06 lds r24, 0x067B ; 0x80067b 15f52: 8f 93 push r24 15f54: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 15f58: 8f 93 push r24 15f5a: 80 91 79 06 lds r24, 0x0679 ; 0x800679 15f5e: 8f 93 push r24 15f60: 80 91 78 06 lds r24, 0x0678 ; 0x800678 15f64: 8f 93 push r24 15f66: 80 91 77 06 lds r24, 0x0677 ; 0x800677 15f6a: 8f 93 push r24 15f6c: 80 91 76 06 lds r24, 0x0676 ; 0x800676 15f70: 8f 93 push r24 15f72: 80 91 75 06 lds r24, 0x0675 ; 0x800675 15f76: 8f 93 push r24 15f78: 80 91 74 06 lds r24, 0x0674 ; 0x800674 15f7c: 8f 93 push r24 15f7e: 80 91 73 06 lds r24, 0x0673 ; 0x800673 15f82: 8f 93 push r24 15f84: 80 91 72 06 lds r24, 0x0672 ; 0x800672 15f88: 8f 93 push r24 15f8a: 80 91 71 06 lds r24, 0x0671 ; 0x800671 15f8e: 8f 93 push r24 15f90: 80 91 70 06 lds r24, 0x0670 ; 0x800670 15f94: 8f 93 push r24 15f96: 1f 93 push r17 15f98: 0f 93 push r16 15f9a: 1f 93 push r17 15f9c: 0f 93 push r16 15f9e: 87 ef ldi r24, 0xF7 ; 247 15fa0: 91 e8 ldi r25, 0x81 ; 129 15fa2: 9f 93 push r25 15fa4: 8f 93 push r24 15fa6: 0f 94 4b dc call 0x3b896 ; 0x3b896 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"), 15faa: 0f b6 in r0, 0x3f ; 63 15fac: f8 94 cli 15fae: de bf out 0x3e, r29 ; 62 15fb0: 0f be out 0x3f, r0 ; 63 15fb2: 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; 15fb4: 2c ea ldi r18, 0xAC ; 172 15fb6: 35 ec ldi r19, 0xC5 ; 197 15fb8: 47 e2 ldi r20, 0x27 ; 39 15fba: 5e e3 ldi r21, 0x3E ; 62 15fbc: 60 91 dc 06 lds r22, 0x06DC ; 0x8006dc 15fc0: 70 91 dd 06 lds r23, 0x06DD ; 0x8006dd 15fc4: 80 91 de 06 lds r24, 0x06DE ; 0x8006de 15fc8: 90 91 df 06 lds r25, 0x06DF ; 0x8006df 15fcc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 15fd0: 9f 93 push r25 15fd2: 8f 93 push r24 15fd4: 7f 93 push r23 15fd6: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15fd8: 2c ea ldi r18, 0xAC ; 172 15fda: 35 ec ldi r19, 0xC5 ; 197 15fdc: 47 e2 ldi r20, 0x27 ; 39 15fde: 5e e3 ldi r21, 0x3E ; 62 15fe0: 60 91 d8 06 lds r22, 0x06D8 ; 0x8006d8 15fe4: 70 91 d9 06 lds r23, 0x06D9 ; 0x8006d9 15fe8: 80 91 da 06 lds r24, 0x06DA ; 0x8006da 15fec: 90 91 db 06 lds r25, 0x06DB ; 0x8006db 15ff0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 15ff4: 9f 93 push r25 15ff6: 8f 93 push r24 15ff8: 7f 93 push r23 15ffa: 6f 93 push r22 15ffc: 80 91 d7 06 lds r24, 0x06D7 ; 0x8006d7 16000: 8f 93 push r24 16002: 80 91 d6 06 lds r24, 0x06D6 ; 0x8006d6 16006: 8f 93 push r24 16008: 80 91 d5 06 lds r24, 0x06D5 ; 0x8006d5 1600c: 8f 93 push r24 1600e: 80 91 d4 06 lds r24, 0x06D4 ; 0x8006d4 16012: 8f 93 push r24 16014: 1f 93 push r17 16016: 0f 93 push r16 16018: 1f 93 push r17 1601a: 0f 93 push r16 1601c: 8a ec ldi r24, 0xCA ; 202 1601e: 91 e8 ldi r25, 0x81 ; 129 16020: 9f 93 push r25 16022: 8f 93 push r24 16024: 0f 94 4b dc call 0x3b896 ; 0x3b896 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 16028: 2c ea ldi r18, 0xAC ; 172 1602a: 35 ec ldi r19, 0xC5 ; 197 1602c: 47 e2 ldi r20, 0x27 ; 39 1602e: 5e e3 ldi r21, 0x3E ; 62 16030: 60 91 e8 06 lds r22, 0x06E8 ; 0x8006e8 16034: 70 91 e9 06 lds r23, 0x06E9 ; 0x8006e9 16038: 80 91 ea 06 lds r24, 0x06EA ; 0x8006ea 1603c: 90 91 eb 06 lds r25, 0x06EB ; 0x8006eb 16040: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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"), 16044: 9f 93 push r25 16046: 8f 93 push r24 16048: 7f 93 push r23 1604a: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 1604c: 2c ea ldi r18, 0xAC ; 172 1604e: 35 ec ldi r19, 0xC5 ; 197 16050: 47 e2 ldi r20, 0x27 ; 39 16052: 5e e3 ldi r21, 0x3E ; 62 16054: 60 91 e4 06 lds r22, 0x06E4 ; 0x8006e4 16058: 70 91 e5 06 lds r23, 0x06E5 ; 0x8006e5 1605c: 80 91 e6 06 lds r24, 0x06E6 ; 0x8006e6 16060: 90 91 e7 06 lds r25, 0x06E7 ; 0x8006e7 16064: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 16068: 9f 93 push r25 1606a: 8f 93 push r24 1606c: 7f 93 push r23 1606e: 6f 93 push r22 16070: 80 91 e3 06 lds r24, 0x06E3 ; 0x8006e3 16074: 8f 93 push r24 16076: 80 91 e2 06 lds r24, 0x06E2 ; 0x8006e2 1607a: 8f 93 push r24 1607c: 80 91 e1 06 lds r24, 0x06E1 ; 0x8006e1 16080: 8f 93 push r24 16082: 80 91 e0 06 lds r24, 0x06E0 ; 0x8006e0 16086: 8f 93 push r24 16088: 1f 93 push r17 1608a: 0f 93 push r16 1608c: 1f 93 push r17 1608e: 0f 93 push r16 16090: 85 e9 ldi r24, 0x95 ; 149 16092: 91 e8 ldi r25, 0x81 ; 129 16094: 9f 93 push r25 16096: 8f 93 push r24 16098: 0f 94 4b dc call 0x3b896 ; 0x3b896 echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 1609c: 0f b6 in r0, 0x3f ; 63 1609e: f8 94 cli 160a0: de bf out 0x3e, r29 ; 62 160a2: 0f be out 0x3f, r0 ; 63 160a4: cd bf out 0x3d, r28 ; 61 160a6: 80 91 ee 06 lds r24, 0x06EE ; 0x8006ee 160aa: 1f 92 push r1 160ac: 8f 93 push r24 160ae: 1f 93 push r17 160b0: 0f 93 push r16 160b2: 1f 93 push r17 160b4: 0f 93 push r16 160b6: 20 e0 ldi r18, 0x00 ; 0 160b8: 30 e0 ldi r19, 0x00 ; 0 160ba: 40 e7 ldi r20, 0x70 ; 112 160bc: 52 e4 ldi r21, 0x42 ; 66 160be: 60 91 ff 06 lds r22, 0x06FF ; 0x8006ff 160c2: 70 91 00 07 lds r23, 0x0700 ; 0x800700 160c6: 80 91 01 07 lds r24, 0x0701 ; 0x800701 160ca: 90 91 02 07 lds r25, 0x0702 ; 0x800702 160ce: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 160d2: 9f 93 push r25 160d4: 8f 93 push r24 160d6: 7f 93 push r23 160d8: 6f 93 push r22 160da: 80 91 fe 06 lds r24, 0x06FE ; 0x8006fe 160de: 8f 93 push r24 160e0: 80 91 fd 06 lds r24, 0x06FD ; 0x8006fd 160e4: 8f 93 push r24 160e6: 80 91 fc 06 lds r24, 0x06FC ; 0x8006fc 160ea: 8f 93 push r24 160ec: 80 91 fb 06 lds r24, 0x06FB ; 0x8006fb 160f0: 8f 93 push r24 160f2: 1f 93 push r17 160f4: 0f 93 push r16 160f6: 1f 93 push r17 160f8: 0f 93 push r16 160fa: 80 91 fa 06 lds r24, 0x06FA ; 0x8006fa 160fe: 8f 93 push r24 16100: 80 91 f9 06 lds r24, 0x06F9 ; 0x8006f9 16104: 8f 93 push r24 16106: 80 91 f8 06 lds r24, 0x06F8 ; 0x8006f8 1610a: 8f 93 push r24 1610c: 80 91 f7 06 lds r24, 0x06F7 ; 0x8006f7 16110: 8f 93 push r24 16112: 20 e0 ldi r18, 0x00 ; 0 16114: 30 e0 ldi r19, 0x00 ; 0 16116: 40 e7 ldi r20, 0x70 ; 112 16118: 52 e4 ldi r21, 0x42 ; 66 1611a: 60 91 f3 06 lds r22, 0x06F3 ; 0x8006f3 1611e: 70 91 f4 06 lds r23, 0x06F4 ; 0x8006f4 16122: 80 91 f5 06 lds r24, 0x06F5 ; 0x8006f5 16126: 90 91 f6 06 lds r25, 0x06F6 ; 0x8006f6 1612a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1612e: 9f 93 push r25 16130: 8f 93 push r24 16132: 7f 93 push r23 16134: 6f 93 push r22 16136: 80 91 f2 06 lds r24, 0x06F2 ; 0x8006f2 1613a: 8f 93 push r24 1613c: 80 91 f1 06 lds r24, 0x06F1 ; 0x8006f1 16140: 8f 93 push r24 16142: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 16146: 8f 93 push r24 16148: 80 91 ef 06 lds r24, 0x06EF ; 0x8006ef 1614c: 8f 93 push r24 1614e: 1f 93 push r17 16150: 0f 93 push r16 16152: 1f 93 push r17 16154: 0f 93 push r16 16156: 84 e9 ldi r24, 0x94 ; 148 16158: 90 e8 ldi r25, 0x80 ; 128 1615a: 9f 93 push r25 1615c: 8f 93 push r24 1615e: 0f 94 4b dc call 0x3b896 ; 0x3b896 ); #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) { 16162: 0f b6 in r0, 0x3f ; 63 16164: f8 94 cli 16166: de bf out 0x3e, r29 ; 62 16168: 0f be out 0x3f, r0 ; 63 1616a: cd bf out 0x3d, r28 ; 61 1616c: 80 91 03 07 lds r24, 0x0703 ; 0x800703 16170: 88 23 and r24, r24 16172: 11 f4 brne .+4 ; 0x16178 16174: 0c 94 11 c2 jmp 0x18422 ; 0x18422 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 16178: 80 91 07 07 lds r24, 0x0707 ; 0x800707 1617c: 8f 93 push r24 1617e: 80 91 06 07 lds r24, 0x0706 ; 0x800706 16182: 8f 93 push r24 16184: 80 91 05 07 lds r24, 0x0705 ; 0x800705 16188: 8f 93 push r24 1618a: 80 91 04 07 lds r24, 0x0704 ; 0x800704 1618e: 8f 93 push r24 16190: 1f 93 push r17 16192: 0f 93 push r16 16194: 1f 93 push r17 16196: 0f 93 push r16 16198: 8e e6 ldi r24, 0x6E ; 110 1619a: 90 e8 ldi r25, 0x80 ; 128 1619c: 9f 93 push r25 1619e: 8f 93 push r24 161a0: 0f 94 4b dc call 0x3b896 ; 0x3b896 161a4: 0f b6 in r0, 0x3f ; 63 161a6: f8 94 cli 161a8: de bf out 0x3e, r29 ; 62 161aa: 0f be out 0x3f, r0 ; 63 161ac: 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( 161ae: 80 91 3c 07 lds r24, 0x073C ; 0x80073c 161b2: 8f 93 push r24 161b4: 80 91 3b 07 lds r24, 0x073B ; 0x80073b 161b8: 8f 93 push r24 161ba: 80 91 3a 07 lds r24, 0x073A ; 0x80073a 161be: 8f 93 push r24 161c0: 80 91 39 07 lds r24, 0x0739 ; 0x800739 161c4: 8f 93 push r24 161c6: 80 91 38 07 lds r24, 0x0738 ; 0x800738 161ca: 1f 92 push r1 161cc: 8f 93 push r24 161ce: 80 91 37 07 lds r24, 0x0737 ; 0x800737 161d2: 8f 93 push r24 161d4: 80 91 36 07 lds r24, 0x0736 ; 0x800736 161d8: 8f 93 push r24 161da: 80 91 35 07 lds r24, 0x0735 ; 0x800735 161de: 8f 93 push r24 161e0: 80 91 34 07 lds r24, 0x0734 ; 0x800734 161e4: 8f 93 push r24 161e6: 80 91 33 07 lds r24, 0x0733 ; 0x800733 161ea: 8f 93 push r24 161ec: 80 91 32 07 lds r24, 0x0732 ; 0x800732 161f0: 8f 93 push r24 161f2: 80 91 31 07 lds r24, 0x0731 ; 0x800731 161f6: 8f 93 push r24 161f8: 80 91 30 07 lds r24, 0x0730 ; 0x800730 161fc: 8f 93 push r24 161fe: 02 ee ldi r16, 0xE2 ; 226 16200: 19 ea ldi r17, 0xA9 ; 169 16202: 1f 93 push r17 16204: 0f 93 push r16 16206: 1f 93 push r17 16208: 0f 93 push r16 1620a: 8d ec ldi r24, 0xCD ; 205 1620c: 9f e7 ldi r25, 0x7F ; 127 1620e: 9f 93 push r25 16210: 8f 93 push r24 16212: 0f 94 4b dc call 0x3b896 ; 0x3b896 "%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(); 16216: 0f 94 f8 43 call 0x287f0 ; 0x287f0 #endif printf_P(PSTR( 1621a: 8d ee ldi r24, 0xED ; 237 1621c: 9f e0 ldi r25, 0x0F ; 15 1621e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 16222: f6 2e mov r15, r22 16224: e7 2e mov r14, r23 16226: d8 2e mov r13, r24 16228: c9 2e mov r12, r25 1622a: 81 ef ldi r24, 0xF1 ; 241 1622c: 9f e0 ldi r25, 0x0F ; 15 1622e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 16232: cf 92 push r12 16234: df 92 push r13 16236: ef 92 push r14 16238: ff 92 push r15 1623a: 9f 93 push r25 1623c: 8f 93 push r24 1623e: 7f 93 push r23 16240: 6f 93 push r22 16242: 1f 93 push r17 16244: 0f 93 push r16 16246: 1f 93 push r17 16248: 0f 93 push r16 1624a: 8c ea ldi r24, 0xAC ; 172 1624c: 9f e7 ldi r25, 0x7F ; 127 1624e: 9f 93 push r25 16250: 8f 93 push r24 16252: 0f 94 4b dc call 0x3b896 ; 0x3b896 16256: 0f b6 in r0, 0x3f ; 63 16258: f8 94 cli 1625a: de bf out 0x3e, r29 ; 62 1625c: 0f be out 0x3f, r0 ; 63 1625e: cd bf out 0x3d, r28 ; 61 16260: 5c c1 rjmp .+696 ; 0x1651a 16262: 88 35 cpi r24, 0x58 ; 88 16264: 52 e0 ldi r21, 0x02 ; 2 16266: 95 07 cpc r25, r21 16268: 11 f4 brne .+4 ; 0x1626e 1626a: 0c 94 2b c2 jmp 0x18456 ; 0x18456 1626e: 14 f0 brlt .+4 ; 0x16274 16270: 0c 94 d6 a6 jmp 0x14dac ; 0x14dac 16274: 88 32 cpi r24, 0x28 ; 40 16276: 92 40 sbci r25, 0x02 ; 2 16278: 11 f0 breq .+4 ; 0x1627e 1627a: 0c 94 62 a6 jmp 0x14cc4 ; 0x14cc4 #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 1627e: 80 e5 ldi r24, 0x50 ; 80 16280: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16284: 88 23 and r24, r24 16286: 09 f4 brne .+2 ; 0x1628a 16288: 48 c1 rjmp .+656 ; 0x1651a { uint8_t valCnt = 0; IP_address = 0; 1628a: 10 92 59 06 sts 0x0659, r1 ; 0x800659 1628e: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 16292: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 16296: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c 1629a: 09 e5 ldi r16, 0x59 ; 89 1629c: 16 e0 ldi r17, 0x06 ; 6 1629e: 3d e5 ldi r19, 0x5D ; 93 162a0: e3 2e mov r14, r19 162a2: 36 e0 ldi r19, 0x06 ; 6 162a4: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 162a6: 4a e2 ldi r20, 0x2A ; 42 162a8: d4 2e mov r13, r20 162aa: e0 91 95 03 lds r30, 0x0395 ; 0x800395 162ae: f0 91 96 03 lds r31, 0x0396 ; 0x800396 162b2: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 162b4: 0e 94 13 5c call 0xb826 ; 0xb826 162b8: d8 01 movw r26, r16 162ba: 8d 93 st X+, r24 162bc: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 162be: ea 16 cp r14, r26 162c0: fb 06 cpc r15, r27 162c2: 09 f4 brne .+2 ; 0x162c6 162c4: 2a c1 rjmp .+596 ; 0x1651a 162c6: 8e e2 ldi r24, 0x2E ; 46 162c8: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 162cc: 81 11 cpse r24, r1 162ce: ed cf rjmp .-38 ; 0x162aa if (valCnt != 4) IP_address = 0; 162d0: 10 92 59 06 sts 0x0659, r1 ; 0x800659 162d4: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 162d8: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 162dc: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c 162e0: 1c c1 rjmp .+568 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 162e2: 8e 3b cpi r24, 0xBE ; 190 162e4: e2 e0 ldi r30, 0x02 ; 2 162e6: 9e 07 cpc r25, r30 162e8: 11 f4 brne .+4 ; 0x162ee 162ea: 0c 94 f5 cc jmp 0x199ea ; 0x199ea 162ee: 0c f0 brlt .+2 ; 0x162f2 162f0: 4e c0 rjmp .+156 ; 0x1638e 162f2: 8b 35 cpi r24, 0x5B ; 91 162f4: 22 e0 ldi r18, 0x02 ; 2 162f6: 92 07 cpc r25, r18 162f8: 11 f4 brne .+4 ; 0x162fe 162fa: 0c 94 3b c6 jmp 0x18c76 ; 0x18c76 162fe: 8d 3b cpi r24, 0xBD ; 189 16300: 92 40 sbci r25, 0x02 ; 2 16302: 11 f0 breq .+4 ; 0x16308 16304: 0c 94 62 a6 jmp 0x14cc4 ; 0x14cc4 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 16308: 80 91 96 13 lds r24, 0x1396 ; 0x801396 1630c: 81 30 cpi r24, 0x01 ; 1 1630e: 11 f4 brne .+4 ; 0x16314 16310: 0c 94 96 cc jmp 0x1992c ; 0x1992c - `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; 16314: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16316: 8c e4 ldi r24, 0x4C ; 76 16318: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 - `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 1631c: c1 2c mov r12, r1 1631e: d1 2c mov r13, r1 16320: 6c e8 ldi r22, 0x8C ; 140 16322: e6 2e mov r14, r22 16324: 62 e4 ldi r22, 0x42 ; 66 16326: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16328: 88 23 and r24, r24 1632a: 21 f0 breq .+8 ; 0x16334 1632c: 0e 94 4a 61 call 0xc294 ; 0xc294 16330: 6b 01 movw r12, r22 16332: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 16334: 8a e5 ldi r24, 0x5A ; 90 16336: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1633a: 88 23 and r24, r24 1633c: 11 f4 brne .+4 ; 0x16342 1633e: 0c 94 a7 cc jmp 0x1994e ; 0x1994e 16342: 0e 94 4a 61 call 0xc294 ; 0xc294 16346: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 16348: 0e 94 8e 6e call 0xdd1c ; 0xdd1c 1634c: 4b 01 movw r8, r22 1634e: 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 16350: 8a e5 ldi r24, 0x5A ; 90 16352: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16356: 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; 16358: 10 92 88 17 sts 0x1788, r1 ; 0x801788 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1635c: 10 92 87 17 sts 0x1787, r1 ; 0x801787 void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){ FSensorBlockRunout fsBlockRunout; prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 16360: 80 91 96 13 lds r24, 0x1396 ; 0x801396 16364: 81 30 cpi r24, 0x01 ; 1 16366: 11 f0 breq .+4 ; 0x1636c 16368: 0c 94 ac cc jmp 0x19958 ; 0x19958 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 1636c: 15 30 cpi r17, 0x05 ; 5 1636e: 18 f4 brcc .+6 ; 0x16376 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 16370: 81 2f mov r24, r17 16372: 0f 94 30 1d call 0x23a60 ; 0x23a60 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 16376: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1637a: 86 e8 ldi r24, 0x86 ; 134 1637c: 97 e1 ldi r25, 0x17 ; 23 1637e: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 // 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); 16382: c5 01 movw r24, r10 16384: b4 01 movw r22, r8 16386: 90 58 subi r25, 0x80 ; 128 16388: 0e 94 8e 6e call 0xdd1c ; 0xdd1c 1638c: c6 c0 rjmp .+396 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1638e: 81 3c cpi r24, 0xC1 ; 193 16390: 42 e0 ldi r20, 0x02 ; 2 16392: 94 07 cpc r25, r20 16394: 11 f4 brne .+4 ; 0x1639a 16396: 0c 94 29 cd jmp 0x19a52 ; 0x19a52 1639a: 14 f0 brlt .+4 ; 0x163a0 1639c: 0c 94 2f cd jmp 0x19a5e ; 0x19a5e 163a0: 80 3c cpi r24, 0xC0 ; 192 163a2: 92 40 sbci r25, 0x02 ; 2 163a4: 11 f0 breq .+4 ; 0x163aa 163a6: 0c 94 62 a6 jmp 0x14cc4 ; 0x14cc4 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 163aa: 80 ec ldi r24, 0xC0 ; 192 163ac: 92 e0 ldi r25, 0x02 ; 2 163ae: 0e 94 fc 60 call 0xc1f8 ; 0xc1f8 163b2: b3 c0 rjmp .+358 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 163b4: 84 38 cpi r24, 0x84 ; 132 163b6: b3 e0 ldi r27, 0x03 ; 3 163b8: 9b 07 cpc r25, r27 163ba: 11 f4 brne .+4 ; 0x163c0 163bc: 0c 94 e5 c9 jmp 0x193ca ; 0x193ca 163c0: 0c f0 brlt .+2 ; 0x163c4 163c2: 99 c0 rjmp .+306 ; 0x164f6 163c4: 82 35 cpi r24, 0x52 ; 82 163c6: f3 e0 ldi r31, 0x03 ; 3 163c8: 9f 07 cpc r25, r31 163ca: 11 f4 brne .+4 ; 0x163d0 163cc: 0c 94 41 c6 jmp 0x18c82 ; 0x18c82 163d0: 9c f5 brge .+102 ; 0x16438 163d2: 84 3c cpi r24, 0xC4 ; 196 163d4: 32 e0 ldi r19, 0x02 ; 2 163d6: 93 07 cpc r25, r19 163d8: 11 f4 brne .+4 ; 0x163de 163da: 0c 94 52 cd jmp 0x19aa4 ; 0x19aa4 163de: 85 3c cpi r24, 0xC5 ; 197 163e0: 92 40 sbci r25, 0x02 ; 2 163e2: 11 f0 breq .+4 ; 0x163e8 163e4: 0c 94 62 a6 jmp 0x14cc4 ; 0x14cc4 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 163e8: 83 e5 ldi r24, 0x53 ; 83 163ea: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 163ee: 88 23 and r24, r24 163f0: 51 f0 breq .+20 ; 0x16406 { switch (code_value_uint8()) 163f2: 0e 94 06 5c call 0xb80c ; 0xb80c 163f6: 88 23 and r24, r24 163f8: 11 f4 brne .+4 ; 0x163fe 163fa: 0c 94 7e cd jmp 0x19afc ; 0x19afc 163fe: 81 30 cpi r24, 0x01 ; 1 16400: 11 f4 brne .+4 ; 0x16406 16402: 0c 94 8b cd jmp 0x19b16 ; 0x19b16 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 16406: 80 91 96 13 lds r24, 0x1396 ; 0x801396 1640a: 81 30 cpi r24, 0x01 ; 1 1640c: 91 f4 brne .+36 ; 0x16432 1640e: 88 e5 ldi r24, 0x58 ; 88 16410: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16414: 88 23 and r24, r24 16416: 69 f0 breq .+26 ; 0x16432 { switch (code_value_uint8()) 16418: 0e 94 06 5c call 0xb80c ; 0xb80c 1641c: 81 30 cpi r24, 0x01 ; 1 1641e: 11 f4 brne .+4 ; 0x16424 16420: 0c 94 99 cd jmp 0x19b32 ; 0x19b32 16424: 10 f4 brcc .+4 ; 0x1642a 16426: 0c 94 94 cd jmp 0x19b28 ; 0x19b28 1642a: 8a 32 cpi r24, 0x2A ; 42 1642c: 11 f4 brne .+4 ; 0x16432 1642e: 0c 94 9d cd jmp 0x19b3a ; 0x19b3a break; default: break; } } MMU2::mmu2.Status(); 16432: 0f 94 ff 76 call 0x2edfe ; 0x2edfe 16436: 71 c0 rjmp .+226 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16438: 8d 35 cpi r24, 0x5D ; 93 1643a: 53 e0 ldi r21, 0x03 ; 3 1643c: 95 07 cpc r25, r21 1643e: 11 f4 brne .+4 ; 0x16444 16440: 0c 94 b7 c7 jmp 0x18f6e ; 0x18f6e 16444: 8e 35 cpi r24, 0x5E ; 94 16446: a3 e0 ldi r26, 0x03 ; 3 16448: 9a 07 cpc r25, r26 1644a: 11 f4 brne .+4 ; 0x16450 1644c: 0c 94 4f c8 jmp 0x1909e ; 0x1909e 16450: 8c 35 cpi r24, 0x5C ; 92 16452: 93 40 sbci r25, 0x03 ; 3 16454: 11 f0 breq .+4 ; 0x1645a 16456: 0c 94 62 a6 jmp 0x14cc4 ; 0x14cc4 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1645a: 83 e5 ldi r24, 0x53 ; 83 1645c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16460: 88 23 and r24, r24 16462: 09 f4 brne .+2 ; 0x16466 16464: 5a c0 rjmp .+180 ; 0x1651a set_target_pinda = code_value_short(); 16466: 0e 94 13 5c call 0xb826 ; 0xb826 1646a: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1646c: 89 e9 ldi r24, 0x99 ; 153 1646e: 99 e3 ldi r25, 0x39 ; 57 16470: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 16474: 0f 94 e2 0b call 0x217c4 ; 0x217c4 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 16478: 87 ec ldi r24, 0xC7 ; 199 1647a: 96 e8 ldi r25, 0x86 ; 134 1647c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLLN(set_target_pinda); 16480: c8 01 movw r24, r16 16482: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 codenum = _millis(); 16486: 0f 94 83 3f call 0x27f06 ; 0x27f06 1648a: 4b 01 movw r8, r22 1648c: 5c 01 movw r10, r24 cancel_heatup = false; 1648e: 10 92 64 0e sts 0x0E64, r1 ; 0x800e64 <_ZL13cancel_heatup.lto_priv.404> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 16492: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 16496: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 1649a: 89 2b or r24, r25 1649c: 41 f4 brne .+16 ; 0x164ae 1649e: ff 24 eor r15, r15 164a0: f3 94 inc r15 164a2: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 164a6: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a 164aa: 89 2b or r24, r25 164ac: 09 f0 breq .+2 ; 0x164b0 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 164ae: 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)) ) { 164b0: 28 01 movw r4, r16 164b2: 01 2e mov r0, r17 164b4: 00 0c add r0, r0 164b6: 66 08 sbc r6, r6 164b8: 77 08 sbc r7, r7 164ba: f1 10 cpse r15, r1 164bc: 0c 94 77 c7 jmp 0x18eee ; 0x18eee 164c0: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13cancel_heatup.lto_priv.404> 164c4: 81 11 cpse r24, r1 164c6: 12 c0 rjmp .+36 ; 0x164ec 164c8: c3 01 movw r24, r6 164ca: b2 01 movw r22, r4 164cc: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 164d0: 20 91 97 03 lds r18, 0x0397 ; 0x800397 164d4: 30 91 98 03 lds r19, 0x0398 ; 0x800398 164d8: 40 91 99 03 lds r20, 0x0399 ; 0x800399 164dc: 50 91 9a 03 lds r21, 0x039A ; 0x80039a 164e0: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 164e4: 18 16 cp r1, r24 164e6: 14 f4 brge .+4 ; 0x164ec 164e8: 0c 94 89 c7 jmp 0x18f12 ; 0x18f12 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 164ec: 8a e0 ldi r24, 0x0A ; 10 164ee: 9e e6 ldi r25, 0x6E ; 110 164f0: 0f 94 e2 0b call 0x217c4 ; 0x217c4 164f4: 12 c0 rjmp .+36 ; 0x1651a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 164f6: 81 39 cpi r24, 0x91 ; 145 164f8: e3 e0 ldi r30, 0x03 ; 3 164fa: 9e 07 cpc r25, r30 164fc: 11 f4 brne .+4 ; 0x16502 164fe: 0c 94 18 cb jmp 0x19630 ; 0x19630 16502: 8c f4 brge .+34 ; 0x16526 16504: 8b 38 cpi r24, 0x8B ; 139 16506: 23 e0 ldi r18, 0x03 ; 3 16508: 92 07 cpc r25, r18 1650a: 11 f4 brne .+4 ; 0x16510 1650c: 0c 94 94 ca jmp 0x19528 ; 0x19528 16510: 8c 38 cpi r24, 0x8C ; 140 16512: 93 40 sbci r25, 0x03 ; 3 16514: 11 f0 breq .+4 ; 0x1651a 16516: 0c 94 62 a6 jmp 0x14cc4 ; 0x14cc4 */ 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; 1651a: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a <_ZL17mcode_in_progress.lto_priv.551+0x1> 1651e: 10 92 59 0e sts 0x0E59, r1 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.551> 16522: 0c 94 de 97 jmp 0x12fbc ; 0x12fbc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16526: 84 39 cpi r24, 0x94 ; 148 16528: 43 e0 ldi r20, 0x03 ; 3 1652a: 94 07 cpc r25, r20 1652c: 14 f4 brge .+4 ; 0x16532 1652e: 0c 94 67 cb jmp 0x196ce ; 0x196ce 16532: 80 3a cpi r24, 0xA0 ; 160 16534: 93 40 sbci r25, 0x03 ; 3 16536: 11 f0 breq .+4 ; 0x1653c 16538: 0c 94 62 a6 jmp 0x14cc4 ; 0x14cc4 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 1653c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 16540: 90 91 96 03 lds r25, 0x0396 ; 0x800396 } } void CardReader::openLogFile(const char* name) { logging = true; 16544: 21 e0 ldi r18, 0x01 ; 1 16546: 20 93 6b 14 sts 0x146B, r18 ; 0x80146b openFileWrite(name); 1654a: 05 96 adiw r24, 0x05 ; 5 1654c: 0f 94 14 86 call 0x30c28 ; 0x30c28 16550: e4 cf rjmp .-56 ; 0x1651a - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 16552: 00 91 95 03 lds r16, 0x0395 ; 0x800395 16556: 10 91 96 03 lds r17, 0x0396 ; 0x800396 1655a: 0e 5f subi r16, 0xFE ; 254 1655c: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1655e: 80 e5 ldi r24, 0x50 ; 80 16560: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 16564: c1 2c mov r12, r1 16566: d1 2c mov r13, r1 16568: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1656a: 88 23 and r24, r24 1656c: 21 f0 breq .+8 ; 0x16576 1656e: 0e 94 20 5c call 0xb840 ; 0xb840 16572: 6b 01 movw r12, r22 16574: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 16576: 83 e5 ldi r24, 0x53 ; 83 16578: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1657c: 88 23 and r24, r24 1657e: 51 f0 breq .+20 ; 0x16594 16580: 0e 94 20 5c call 0xb840 ; 0xb840 16584: 9b 01 movw r18, r22 16586: ac 01 movw r20, r24 16588: a8 ee ldi r26, 0xE8 ; 232 1658a: b3 e0 ldi r27, 0x03 ; 3 1658c: 0f 94 1e de call 0x3bc3c ; 0x3bc3c <__muluhisi3> 16590: 6b 01 movw r12, r22 16592: 7c 01 movw r14, r24 16594: c8 01 movw r24, r16 16596: 0f 5f subi r16, 0xFF ; 255 16598: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 1659a: dc 01 movw r26, r24 1659c: 4c 91 ld r20, X 1659e: 40 32 cpi r20, 0x20 ; 32 165a0: c9 f3 breq .-14 ; 0x16594 custom_message_type = CustomMsg::M0Wait; 165a2: 26 e0 ldi r18, 0x06 ; 6 165a4: 20 93 73 07 sts 0x0773, r18 ; 0x800773 if (!expiration_time_set && *src != '\0') { 165a8: c1 14 cp r12, r1 165aa: d1 04 cpc r13, r1 165ac: e1 04 cpc r14, r1 165ae: f1 04 cpc r15, r1 165b0: a1 f5 brne .+104 ; 0x1661a 165b2: 2c 91 ld r18, X 165b4: 22 23 and r18, r18 165b6: 89 f1 breq .+98 ; 0x1661a lcd_setstatus(src); 165b8: 0f 94 4e 15 call 0x22a9c ; 0x22a9c 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(); 165bc: 0f 94 24 59 call 0x2b248 ; 0x2b248 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 165c0: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 165c4: 84 60 ori r24, 0x04 ; 4 165c6: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 previous_millis_cmd.start(); 165ca: 86 e8 ldi r24, 0x86 ; 134 165cc: 93 e0 ldi r25, 0x03 ; 3 165ce: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> if (expiration_time_set) { 165d2: c1 14 cp r12, r1 165d4: d1 04 cpc r13, r1 165d6: e1 04 cpc r14, r1 165d8: f1 04 cpc r15, r1 165da: 79 f1 breq .+94 ; 0x1663a codenum += _millis(); // keep track of when we started waiting 165dc: 0f 94 83 3f call 0x27f06 ; 0x27f06 165e0: c6 0e add r12, r22 165e2: d7 1e adc r13, r23 165e4: e8 1e adc r14, r24 165e6: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 165e8: 84 e0 ldi r24, 0x04 ; 4 165ea: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(_millis() < codenum && !lcd_clicked()) { 165ee: 0f 94 83 3f call 0x27f06 ; 0x27f06 165f2: 6c 15 cp r22, r12 165f4: 7d 05 cpc r23, r13 165f6: 8e 05 cpc r24, r14 165f8: 9f 05 cpc r25, r15 165fa: b0 f0 brcs .+44 ; 0x16628 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 165fc: 82 e0 ldi r24, 0x02 ; 2 165fe: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 16602: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 16606: 8b 7f andi r24, 0xFB ; 251 16608: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 if (IS_SD_PRINTING) 1660c: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 16610: 88 23 and r24, r24 16612: 31 f1 breq .+76 ; 0x16660 custom_message_type = CustomMsg::Status; 16614: 10 92 73 07 sts 0x0773, r1 ; 0x800773 16618: 80 cf rjmp .-256 ; 0x1651a } 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)); 1661a: 82 eb ldi r24, 0xB2 ; 178 1661c: 99 e3 ldi r25, 0x39 ; 57 1661e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 16622: 0f 94 e2 0b call 0x217c4 ; 0x217c4 16626: ca cf rjmp .-108 ; 0x165bc 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()) { 16628: 0e 94 aa 71 call 0xe354 ; 0xe354 1662c: 81 11 cpse r24, r1 1662e: e6 cf rjmp .-52 ; 0x165fc delay_keep_alive(0); 16630: 90 e0 ldi r25, 0x00 ; 0 16632: 80 e0 ldi r24, 0x00 ; 0 16634: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 16638: da cf rjmp .-76 ; 0x165ee //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 1663a: 10 91 96 02 lds r17, 0x0296 ; 0x800296 KEEPALIVE_STATE(PAUSED_FOR_USER); 1663e: 84 e0 ldi r24, 0x04 ; 4 16640: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 16644: 0e 94 a5 71 call 0xe34a ; 0xe34a while(!lcd_clicked()) 16648: 0e 94 aa 71 call 0xe354 ; 0xe354 1664c: 81 11 cpse r24, r1 1664e: 05 c0 rjmp .+10 ; 0x1665a { delay_keep_alive(0); 16650: 90 e0 ldi r25, 0x00 ; 0 16652: 80 e0 ldi r24, 0x00 ; 0 16654: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 16658: f7 cf rjmp .-18 ; 0x16648 } KEEPALIVE_STATE(busy_state_backup); 1665a: 10 93 96 02 sts 0x0296, r17 ; 0x800296 1665e: d1 cf rjmp .-94 ; 0x16602 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 16660: 8a e6 ldi r24, 0x6A ; 106 16662: 90 e7 ldi r25, 0x70 ; 112 16664: 0f 94 e2 0b call 0x217c4 ; 0x217c4 16668: 58 cf rjmp .-336 ; 0x1651a /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 1666a: 87 ea ldi r24, 0xA7 ; 167 1666c: 99 e3 ldi r25, 0x39 ; 57 1666e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 16672: 0f 94 e2 0b call 0x217c4 ; 0x217c4 enable_x(); 16676: 17 98 cbi 0x02, 7 ; 2 enable_y(); 16678: 16 98 cbi 0x02, 6 ; 2 enable_z(); 1667a: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1667c: 14 98 cbi 0x02, 4 ; 2 1667e: 4d cf rjmp .-358 ; 0x1651a /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 16680: 81 e0 ldi r24, 0x01 ; 1 16682: 0f 94 70 81 call 0x302e0 ; 0x302e0 16686: 49 cf rjmp .-366 ; 0x1651a presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 16688: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c mounted = false; 1668c: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d SERIAL_ECHO_START; 16690: 82 ee ldi r24, 0xE2 ; 226 16692: 99 ea ldi r25, 0xA9 ; 169 16694: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 16698: 89 ec ldi r24, 0xC9 ; 201 1669a: 9b e6 ldi r25, 0x6B ; 107 1669c: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 166a0: 3c cf rjmp .-392 ; 0x1651a /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 166a2: 0e 94 32 68 call 0xd064 ; 0xd064 166a6: 88 23 and r24, r24 166a8: 19 f0 breq .+6 ; 0x166b0 lcd_resume_print(); 166aa: 0f 94 22 15 call 0x22a44 ; 0x22a44 166ae: 35 cf rjmp .-406 ; 0x1651a else { if (!filament_presence_check()) { 166b0: 0f 94 77 16 call 0x22cee ; 0x22cee 166b4: 88 23 and r24, r24 166b6: 09 f4 brne .+2 ; 0x166ba 166b8: 30 cf rjmp .-416 ; 0x1651a 166ba: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 166be: 88 23 and r24, r24 166c0: 61 f0 breq .+24 ; 0x166da // Print was aborted break; } if (!card.get_sdpos()) 166c2: 80 91 80 17 lds r24, 0x1780 ; 0x801780 166c6: 90 91 81 17 lds r25, 0x1781 ; 0x801781 166ca: a0 91 82 17 lds r26, 0x1782 ; 0x801782 166ce: b0 91 83 17 lds r27, 0x1783 ; 0x801783 166d2: 89 2b or r24, r25 166d4: 8a 2b or r24, r26 166d6: 8b 2b or r24, r27 166d8: 69 f4 brne .+26 ; 0x166f4 { // A new print has started from scratch, reset stats failstats_reset_print(); 166da: 0e 94 c2 5c call 0xb984 ; 0xb984 sdpos_atomic = 0; 166de: 10 92 82 03 sts 0x0382, r1 ; 0x800382 166e2: 10 92 83 03 sts 0x0383, r1 ; 0x800383 166e6: 10 92 84 03 sts 0x0384, r1 ; 0x800384 166ea: 10 92 85 03 sts 0x0385, r1 ; 0x800385 166ee: 80 e0 ldi r24, 0x00 ; 0 166f0: 0e 94 3a 83 call 0x10674 ; 0x10674 } void CardReader::startFileprint() { if(mounted) 166f4: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 166f8: 88 23 and r24, r24 166fa: 31 f0 breq .+12 ; 0x16708 { sdprinting = true; 166fc: 81 e0 ldi r24, 0x01 ; 1 166fe: 80 93 6c 14 sts 0x146C, r24 ; 0x80146c 16702: 85 e0 ldi r24, 0x05 ; 5 16704: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 16708: 0f 94 c9 58 call 0x2b192 ; 0x2b192 if (MMU2::mmu2.Enabled()) 1670c: 80 91 96 13 lds r24, 0x1396 ; 0x801396 16710: 81 30 cpi r24, 0x01 ; 1 16712: 09 f0 breq .+2 ; 0x16716 16714: 02 cf rjmp .-508 ; 0x1651a { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 16716: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 1671a: 88 23 and r24, r24 1671c: 09 f4 brne .+2 ; 0x16720 1671e: fd ce rjmp .-518 ; 0x1651a 16720: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 16724: 81 11 cpse r24, r1 16726: f9 ce rjmp .-526 ; 0x1651a { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 16728: 0f 94 65 a0 call 0x340ca ; 0x340ca 1672c: f6 ce rjmp .-532 ; 0x1651a #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 1672e: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 16732: 88 23 and r24, r24 16734: 09 f4 brne .+2 ; 0x16738 16736: f1 ce rjmp .-542 ; 0x1651a 16738: 83 e5 ldi r24, 0x53 ; 83 1673a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1673e: 88 23 and r24, r24 16740: 09 f4 brne .+2 ; 0x16744 16742: eb ce rjmp .-554 ; 0x1651a long index = code_value_long(); 16744: 0e 94 20 5c call 0xb840 ; 0xb840 16748: 6b 01 movw r12, r22 1674a: 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);}; 1674c: c0 92 80 17 sts 0x1780, r12 ; 0x801780 16750: d0 92 81 17 sts 0x1781, r13 ; 0x801781 16754: e0 92 82 17 sts 0x1782, r14 ; 0x801782 16758: f0 92 83 17 sts 0x1783, r15 ; 0x801783 1675c: 0f 94 b8 77 call 0x2ef70 ; 0x2ef70 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; 16760: c0 92 82 03 sts 0x0382, r12 ; 0x800382 16764: d0 92 83 03 sts 0x0383, r13 ; 0x800383 16768: e0 92 84 03 sts 0x0384, r14 ; 0x800384 1676c: f0 92 85 03 sts 0x0385, r15 ; 0x800385 16770: d4 ce rjmp .-600 ; 0x1651a #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 16772: 80 e5 ldi r24, 0x50 ; 80 16774: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16778: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 1677a: 0e 94 32 68 call 0xd064 ; 0xd064 1677e: 88 23 and r24, r24 16780: 91 f0 breq .+36 ; 0x167a6 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 16782: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 16786: 88 23 and r24, r24 16788: 49 f0 breq .+18 ; 0x1679c 1678a: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1678e: 81 11 cpse r24, r1 16790: 05 c0 rjmp .+10 ; 0x1679c SERIAL_PROTOCOLLNPGM("SD print paused"); 16792: 8d ef ldi r24, 0xFD ; 253 16794: 95 e8 ldi r25, 0x85 ; 133 16796: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 1679a: bf ce rjmp .-642 ; 0x1651a else SERIAL_PROTOCOLLNPGM("Print saved"); 1679c: 81 ef ldi r24, 0xF1 ; 241 1679e: 95 e8 ldi r25, 0x85 ; 133 167a0: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 167a4: ba ce rjmp .-652 ; 0x1651a } else if (sdprinting) 167a6: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 167aa: 88 23 and r24, r24 167ac: 09 f4 brne .+2 ; 0x167b0 167ae: 4a c0 rjmp .+148 ; 0x16844 { if (arg_P) 167b0: 11 23 and r17, r17 167b2: e1 f1 breq .+120 ; 0x1682c { printAbsFilenameFast(); 167b4: 0f 94 3d 7c call 0x2f87a ; 0x2f87a SERIAL_PROTOCOLLN(); 167b8: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 167bc: 83 e5 ldi r24, 0x53 ; 83 167be: 98 e6 ldi r25, 0x68 ; 104 167c0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 167c4: 60 91 80 17 lds r22, 0x1780 ; 0x801780 167c8: 70 91 81 17 lds r23, 0x1781 ; 0x801781 167cc: 80 91 82 17 lds r24, 0x1782 ; 0x801782 167d0: 90 91 83 17 lds r25, 0x1783 ; 0x801783 167d4: 4a e0 ldi r20, 0x0A ; 10 167d6: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 167da: 8f e2 ldi r24, 0x2F ; 47 167dc: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 167e0: 60 91 79 17 lds r22, 0x1779 ; 0x801779 167e4: 70 91 7a 17 lds r23, 0x177A ; 0x80177a 167e8: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 167ec: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 167f0: 4a e0 ldi r20, 0x0A ; 10 167f2: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 167f6: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 167fa: 0f 94 df 54 call 0x2a9be ; 0x2a9be 167fe: 2c e3 ldi r18, 0x3C ; 60 16800: 30 e0 ldi r19, 0x00 ; 0 16802: 40 e0 ldi r20, 0x00 ; 0 16804: 50 e0 ldi r21, 0x00 ; 0 16806: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 1680a: c9 01 movw r24, r18 1680c: 6c e3 ldi r22, 0x3C ; 60 1680e: 70 e0 ldi r23, 0x00 ; 0 16810: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 16814: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 16816: 90 e0 ldi r25, 0x00 ; 0 16818: 80 e0 ldi r24, 0x00 ; 0 1681a: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1681e: 8a e3 ldi r24, 0x3A ; 58 16820: 0e 94 ba 78 call 0xf174 ; 0xf174 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 16824: c8 01 movw r24, r16 16826: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 1682a: 77 ce rjmp .-786 ; 0x1651a { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 1682c: 80 91 83 14 lds r24, 0x1483 ; 0x801483 16830: 88 23 and r24, r24 16832: 29 f0 breq .+10 ; 0x1683e 16834: 83 e8 ldi r24, 0x83 ; 131 16836: 94 e1 ldi r25, 0x14 ; 20 16838: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c 1683c: bf cf rjmp .-130 ; 0x167bc 1683e: 8e e6 ldi r24, 0x6E ; 110 16840: 94 e1 ldi r25, 0x14 ; 20 16842: fa cf rjmp .-12 ; 0x16838 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 16844: 81 ee ldi r24, 0xE1 ; 225 16846: 95 e8 ldi r25, 0x85 ; 133 16848: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 1684c: 66 ce rjmp .-820 ; 0x1651a /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1684e: 80 91 95 03 lds r24, 0x0395 ; 0x800395 16852: 90 91 96 03 lds r25, 0x0396 ; 0x800396 16856: 04 96 adiw r24, 0x04 ; 4 16858: 0f 94 14 86 call 0x30c28 ; 0x30c28 1685c: 5e ce rjmp .-836 ; 0x1651a * 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; 1685e: ce 01 movw r24, r28 16860: 01 96 adiw r24, 0x01 ; 1 16862: 0f 94 99 78 call 0x2f132 ; 0x2f132 16866: 88 23 and r24, r24 16868: 11 f4 brne .+4 ; 0x1686e 1686a: 0c 94 aa a7 jmp 0x14f54 ; 0x14f54 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1686e: 61 e0 ldi r22, 0x01 ; 1 16870: ce 01 movw r24, r28 16872: 01 96 adiw r24, 0x01 ; 1 16874: 0f 94 75 a4 call 0x348ea ; 0x348ea if (!d) goto fail; 16878: 00 97 sbiw r24, 0x00 ; 0 1687a: 11 f4 brne .+4 ; 0x16880 1687c: 0c 94 aa a7 jmp 0x14f54 ; 0x14f54 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 16880: 25 ee ldi r18, 0xE5 ; 229 16882: fc 01 movw r30, r24 16884: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 16886: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 16888: 0f 94 98 6b call 0x2d730 ; 0x2d730 1688c: 18 2f mov r17, r24 1688e: 0c 94 ab a7 jmp 0x14f56 ; 0x14f56 presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 16892: 8b eb ldi r24, 0xBB ; 187 16894: 95 e8 ldi r25, 0x85 ; 133 16896: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 1689a: 23 96 adiw r28, 0x03 ; 3 1689c: 8e ad ldd r24, Y+62 ; 0x3e 1689e: 9f ad ldd r25, Y+63 ; 0x3f 168a0: 23 97 sbiw r28, 0x03 ; 3 168a2: 0e 94 37 89 call 0x1126e ; 0x1126e 168a6: 8e e2 ldi r24, 0x2E ; 46 168a8: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 168ac: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 168b0: 34 ce rjmp .-920 ; 0x1651a ### 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(); 168b2: 0f 94 df 54 call 0x2a9be ; 0x2a9be int16_t sec, min; min = t / 60; sec = t % 60; 168b6: 2c e3 ldi r18, 0x3C ; 60 168b8: 30 e0 ldi r19, 0x00 ; 0 168ba: 40 e0 ldi r20, 0x00 ; 0 168bc: 50 e0 ldi r21, 0x00 ; 0 168be: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 168c2: 7f 93 push r23 168c4: 6f 93 push r22 168c6: 3f 93 push r19 168c8: 2f 93 push r18 168ca: 8c e9 ldi r24, 0x9C ; 156 168cc: 98 e8 ldi r25, 0x88 ; 136 168ce: 9f 93 push r25 168d0: 8f 93 push r24 168d2: 8e 01 movw r16, r28 168d4: 0f 5f subi r16, 0xFF ; 255 168d6: 1f 4f sbci r17, 0xFF ; 255 168d8: 1f 93 push r17 168da: 0f 93 push r16 168dc: 0f 94 a0 dc call 0x3b940 ; 0x3b940 SERIAL_ECHO_START; 168e0: 82 ee ldi r24, 0xE2 ; 226 168e2: 99 ea ldi r25, 0xA9 ; 169 168e4: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(time); 168e8: c8 01 movw r24, r16 168ea: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c lcd_setstatus(time); 168ee: c8 01 movw r24, r16 168f0: 0f 94 4e 15 call 0x22a9c ; 0x22a9c autotempShutdown(); 168f4: 0f b6 in r0, 0x3f ; 63 168f6: f8 94 cli 168f8: de bf out 0x3e, r29 ; 62 168fa: 0f be out 0x3f, r0 ; 63 168fc: cd bf out 0x3d, r28 ; 61 168fe: 0d ce rjmp .-998 ; 0x1651a #### 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')) 16900: 83 e5 ldi r24, 0x53 ; 83 16902: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16906: 88 23 and r24, r24 16908: 09 f4 brne .+2 ; 0x1690c 1690a: 07 ce rjmp .-1010 ; 0x1651a { uint8_t pin_status = code_value_uint8(); 1690c: 0e 94 06 5c call 0xb80c ; 0xb80c 16910: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 16912: 80 e5 ldi r24, 0x50 ; 80 16914: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 16918: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 1691a: 88 23 and r24, r24 1691c: 19 f0 breq .+6 ; 0x16924 pin_number = code_value_uint8(); 1691e: 0e 94 06 5c call 0xb80c ; 0xb80c 16922: 18 2f mov r17, r24 16924: e0 e8 ldi r30, 0x80 ; 128 16926: f8 e8 ldi r31, 0x88 ; 136 16928: 8c e9 ldi r24, 0x9C ; 156 1692a: 98 e8 ldi r25, 0x88 ; 136 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) 1692c: 24 91 lpm r18, Z 1692e: 21 17 cp r18, r17 16930: 09 f4 brne .+2 ; 0x16934 16932: f3 cd rjmp .-1050 ; 0x1651a 16934: 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++) 16936: 8e 17 cp r24, r30 16938: 9f 07 cpc r25, r31 1693a: c1 f7 brne .-16 ; 0x1692c pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 1693c: 16 30 cpi r17, 0x06 ; 6 1693e: 81 f4 brne .+32 ; 0x16960 fanSpeed = pin_status; 16940: 00 93 e1 03 sts 0x03E1, r16 ; 0x8003e1 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 16944: 61 e0 ldi r22, 0x01 ; 1 16946: 81 2f mov r24, r17 16948: 0e 94 5c df call 0x1beb8 ; 0x1beb8 digitalWrite(pin_number, pin_status); 1694c: 60 2f mov r22, r16 1694e: 81 2f mov r24, r17 16950: 0e 94 2e df call 0x1be5c ; 0x1be5c analogWrite(pin_number, pin_status); 16954: 60 2f mov r22, r16 16956: 70 e0 ldi r23, 0x00 ; 0 16958: 81 2f mov r24, r17 1695a: 0e 94 8d df call 0x1bf1a ; 0x1bf1a 1695e: dd cd rjmp .-1094 ; 0x1651a } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 16960: 17 fd sbrc r17, 7 16962: db cd rjmp .-1098 ; 0x1651a 16964: ef cf rjmp .-34 ; 0x16944 ### 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); 16966: 80 e1 ldi r24, 0x10 ; 16 16968: 0e 94 09 e7 call 0x1ce12 ; 0x1ce12 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1696c: 81 ea ldi r24, 0xA1 ; 161 1696e: 9d e0 ldi r25, 0x0D ; 13 16970: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 16974: 3b e0 ldi r19, 0x0B ; 11 16976: 83 9f mul r24, r19 16978: c0 01 movw r24, r0 1697a: 11 24 eor r1, r1 1697c: 70 e0 ldi r23, 0x00 ; 0 1697e: 60 e0 ldi r22, 0x00 ; 0 16980: 80 5b subi r24, 0xB0 ; 176 16982: 92 4f sbci r25, 0xF2 ; 242 16984: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 16988: 82 e0 ldi r24, 0x02 ; 2 1698a: 0e 94 09 e7 call 0x1ce12 ; 0x1ce12 reset_bed_offset_and_skew(); 1698e: 0f 94 c7 cb call 0x3978e ; 0x3978e // 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(); 16992: 0f 94 a8 cb call 0x39750 ; 0x39750 16996: c1 cd rjmp .-1150 ; 0x1651a */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 16998: 8a e5 ldi r24, 0x5A ; 90 1699a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 // 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); 1699e: 0e 94 6b e7 call 0x1ced6 ; 0x1ced6 169a2: bb cd rjmp .-1162 ; 0x1651a ### 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()) { 169a4: 80 91 dd 16 lds r24, 0x16DD ; 0x8016dd 169a8: 88 23 and r24, r24 169aa: 19 f1 breq .+70 ; 0x169f2 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 169ac: ce 01 movw r24, r28 169ae: 01 96 adiw r24, 0x01 ; 1 169b0: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 169b4: 88 23 and r24, r24 169b6: c1 f0 breq .+48 ; 0x169e8 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169b8: 89 81 ldd r24, Y+1 ; 0x01 169ba: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 169be: 8e e2 ldi r24, 0x2E ; 46 169c0: 0e 94 ba 78 call 0xf174 ; 0xf174 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169c4: 8a 81 ldd r24, Y+2 ; 0x02 169c6: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 169ca: 8e e2 ldi r24, 0x2E ; 46 169cc: 0e 94 ba 78 call 0xf174 ; 0xf174 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169d0: 8b 81 ldd r24, Y+3 ; 0x03 169d2: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 169d6: 8e e2 ldi r24, 0x2E ; 46 169d8: 0e 94 ba 78 call 0xf174 ; 0xf174 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169dc: 8c 81 ldd r24, Y+4 ; 0x04 169de: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 169e2: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 169e6: 99 cd rjmp .-1230 ; 0x1651a SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 169e8: 80 e6 ldi r24, 0x60 ; 96 169ea: 98 e8 ldi r25, 0x88 ; 136 169ec: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 169f0: 94 cd rjmp .-1240 ; 0x1651a } } else { SERIAL_PROTOCOLLNPGM("n/a"); 169f2: 8c e5 ldi r24, 0x5C ; 92 169f4: 98 e8 ldi r25, 0x88 ; 136 169f6: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 169fa: 8f cd rjmp .-1250 ; 0x1651a 169fc: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 16a00: 8c cd rjmp .-1256 ; 0x1651a break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 16a02: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 16a06: 1f 92 push r1 16a08: 8f 93 push r24 16a0a: 8a eb ldi r24, 0xBA ; 186 16a0c: 99 e6 ldi r25, 0x69 ; 105 16a0e: 9f 93 push r25 16a10: 8f 93 push r24 16a12: 0f 94 4b dc call 0x3b896 ; 0x3b896 16a16: 0f 90 pop r0 16a18: 0f 90 pop r0 16a1a: 0f 90 pop r0 16a1c: 0f 90 pop r0 16a1e: 7d cd rjmp .-1286 ; 0x1651a - `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(); 16a20: 80 e5 ldi r24, 0x50 ; 80 16a22: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16a26: 88 23 and r24, r24 16a28: 21 f0 breq .+8 ; 0x16a32 16a2a: 0e 94 06 5c call 0xb80c ; 0xb80c 16a2e: 80 93 86 02 sts 0x0286, r24 ; 0x800286 if(code_seen('R')) print_time_remaining_normal = code_value(); 16a32: 82 e5 ldi r24, 0x52 ; 82 16a34: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16a38: 88 23 and r24, r24 16a3a: 41 f0 breq .+16 ; 0x16a4c 16a3c: 0e 94 4a 61 call 0xc294 ; 0xc294 16a40: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 16a44: 70 93 8a 02 sts 0x028A, r23 ; 0x80028a 16a48: 60 93 89 02 sts 0x0289, r22 ; 0x800289 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 16a4c: 81 e5 ldi r24, 0x51 ; 81 16a4e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16a52: 88 23 and r24, r24 16a54: 21 f0 breq .+8 ; 0x16a5e 16a56: 0e 94 06 5c call 0xb80c ; 0xb80c 16a5a: 80 93 85 02 sts 0x0285, r24 ; 0x800285 if(code_seen('S')) print_time_remaining_silent = code_value(); 16a5e: 83 e5 ldi r24, 0x53 ; 83 16a60: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16a64: 88 23 and r24, r24 16a66: 41 f0 breq .+16 ; 0x16a78 16a68: 0e 94 4a 61 call 0xc294 ; 0xc294 16a6c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 16a70: 70 93 8e 02 sts 0x028E, r23 ; 0x80028e 16a74: 60 93 8d 02 sts 0x028D, r22 ; 0x80028d if(code_seen('C')){ 16a78: 83 e4 ldi r24, 0x43 ; 67 16a7a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16a7e: 88 23 and r24, r24 16a80: a9 f0 breq .+42 ; 0x16aac float print_time_to_change_normal_f = code_value(); 16a82: 0e 94 4a 61 call 0xc294 ; 0xc294 16a86: 6b 01 movw r12, r22 16a88: 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; 16a8a: 20 e0 ldi r18, 0x00 ; 0 16a8c: 30 e0 ldi r19, 0x00 ; 0 16a8e: a9 01 movw r20, r18 16a90: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 16a94: 6f ef ldi r22, 0xFF ; 255 16a96: 7f ef ldi r23, 0xFF ; 255 16a98: 18 16 cp r1, r24 16a9a: 24 f4 brge .+8 ; 0x16aa4 16a9c: c7 01 movw r24, r14 16a9e: b6 01 movw r22, r12 16aa0: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 16aa4: 70 93 88 02 sts 0x0288, r23 ; 0x800288 16aa8: 60 93 87 02 sts 0x0287, r22 ; 0x800287 } if(code_seen('D')){ 16aac: 84 e4 ldi r24, 0x44 ; 68 16aae: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16ab2: 88 23 and r24, r24 16ab4: a9 f0 breq .+42 ; 0x16ae0 float print_time_to_change_silent_f = code_value(); 16ab6: 0e 94 4a 61 call 0xc294 ; 0xc294 16aba: 6b 01 movw r12, r22 16abc: 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; 16abe: 20 e0 ldi r18, 0x00 ; 0 16ac0: 30 e0 ldi r19, 0x00 ; 0 16ac2: a9 01 movw r20, r18 16ac4: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 16ac8: 6f ef ldi r22, 0xFF ; 255 16aca: 7f ef ldi r23, 0xFF ; 255 16acc: 18 16 cp r1, r24 16ace: 24 f4 brge .+8 ; 0x16ad8 16ad0: c7 01 movw r24, r14 16ad2: b6 01 movw r22, r12 16ad4: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 16ad8: 70 93 8c 02 sts 0x028C, r23 ; 0x80028c 16adc: 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); 16ae0: 80 91 88 02 lds r24, 0x0288 ; 0x800288 16ae4: 8f 93 push r24 16ae6: 80 91 87 02 lds r24, 0x0287 ; 0x800287 16aea: 8f 93 push r24 16aec: 80 91 8a 02 lds r24, 0x028A ; 0x80028a 16af0: 8f 93 push r24 16af2: 80 91 89 02 lds r24, 0x0289 ; 0x800289 16af6: 8f 93 push r24 16af8: 80 91 86 02 lds r24, 0x0286 ; 0x800286 16afc: 28 2f mov r18, r24 16afe: 08 2e mov r0, r24 16b00: 00 0c add r0, r0 16b02: 33 0b sbc r19, r19 16b04: 3f 93 push r19 16b06: 8f 93 push r24 16b08: 80 e6 ldi r24, 0x60 ; 96 16b0a: 99 e6 ldi r25, 0x69 ; 105 16b0c: 9f 93 push r25 16b0e: 8f 93 push r24 16b10: 07 e6 ldi r16, 0x67 ; 103 16b12: 19 e6 ldi r17, 0x69 ; 105 16b14: 1f 93 push r17 16b16: 0f 93 push r16 16b18: 0f 94 4b dc call 0x3b896 ; 0x3b896 printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 16b1c: 80 91 8c 02 lds r24, 0x028C ; 0x80028c 16b20: 8f 93 push r24 16b22: 80 91 8b 02 lds r24, 0x028B ; 0x80028b 16b26: 8f 93 push r24 16b28: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 16b2c: 8f 93 push r24 16b2e: 80 91 8d 02 lds r24, 0x028D ; 0x80028d 16b32: 8f 93 push r24 16b34: 80 91 85 02 lds r24, 0x0285 ; 0x800285 16b38: 28 2f mov r18, r24 16b3a: 08 2e mov r0, r24 16b3c: 00 0c add r0, r0 16b3e: 33 0b sbc r19, r19 16b40: 3f 93 push r19 16b42: 8f 93 push r24 16b44: 89 e5 ldi r24, 0x59 ; 89 16b46: 99 e6 ldi r25, 0x69 ; 105 16b48: 9f 93 push r25 16b4a: 8f 93 push r24 16b4c: 1f 93 push r17 16b4e: 0f 93 push r16 16b50: 0f 94 4b dc call 0x3b896 ; 0x3b896 16b54: 0f b6 in r0, 0x3f ; 63 16b56: f8 94 cli 16b58: de bf out 0x3e, r29 ; 62 16b5a: 0f be out 0x3f, r0 ; 63 16b5c: cd bf out 0x3d, r28 ; 61 16b5e: dd cc rjmp .-1606 ; 0x1651a } else return false; } bool Stopwatch::pause() { if (isRunning()) { 16b60: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 16b64: 81 30 cpi r24, 0x01 ; 1 16b66: 09 f0 breq .+2 ; 0x16b6a 16b68: d8 cc rjmp .-1616 ; 0x1651a state = PAUSED; 16b6a: 82 e0 ldi r24, 0x02 ; 2 16b6c: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b stopTimestamp = _millis(); 16b70: 0f 94 83 3f call 0x27f06 ; 0x27f06 16b74: 60 93 4d 06 sts 0x064D, r22 ; 0x80064d 16b78: 70 93 4e 06 sts 0x064E, r23 ; 0x80064e 16b7c: 80 93 4f 06 sts 0x064F, r24 ; 0x80064f 16b80: 90 93 50 06 sts 0x0650, r25 ; 0x800650 16b84: ca cc rjmp .-1644 ; 0x1651a /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 16b86: 0f 94 ed 58 call 0x2b1da ; 0x2b1da save_statistics(); 16b8a: 0e 94 cc 66 call 0xcd98 ; 0xcd98 16b8e: c5 cc rjmp .-1654 ; 0x1651a const char *_m_fil; const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { 16b90: 0e 94 3d 68 call 0xd07a ; 0xd07a 16b94: 88 23 and r24, r24 16b96: c1 f1 breq .+112 ; 0x16c08 _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; 16b98: 60 91 60 06 lds r22, 0x0660 ; 0x800660 16b9c: 70 91 61 06 lds r23, 0x0661 ; 0x800661 16ba0: 80 91 62 06 lds r24, 0x0662 ; 0x800662 16ba4: 90 91 63 06 lds r25, 0x0663 ; 0x800663 16ba8: 28 ee ldi r18, 0xE8 ; 232 16baa: 33 e0 ldi r19, 0x03 ; 3 16bac: 40 e0 ldi r20, 0x00 ; 0 16bae: 50 e0 ldi r21, 0x00 ; 0 16bb0: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 16bb4: 12 2f mov r17, r18 16bb6: 03 2f mov r16, r19 16bb8: f4 2e mov r15, r20 16bba: e5 2e mov r14, r21 _min = print_job_timer.duration() / 60; 16bbc: 0f 94 df 54 call 0x2a9be ; 0x2a9be 16bc0: 2c e3 ldi r18, 0x3C ; 60 16bc2: 30 e0 ldi r19, 0x00 ; 0 16bc4: 40 e0 ldi r20, 0x00 ; 0 16bc6: 50 e0 ldi r21, 0x00 ; 0 16bc8: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 16bcc: b9 01 movw r22, r18 16bce: ca 01 movw r24, r20 uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); 16bd0: 46 e7 ldi r20, 0x76 ; 118 16bd2: 5c e4 ldi r21, 0x4C ; 76 const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { _m_fil = _O(MSG_FILAMENT_USED); 16bd4: 26 e6 ldi r18, 0x66 ; 102 16bd6: 3c e4 ldi r19, 0x4C ; 76 _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); } printf_P(_N("%S:%lu cm\n%S:%lu min\n"),_m_fil,_cm,_m_time,_min); 16bd8: 9f 93 push r25 16bda: 8f 93 push r24 16bdc: 7f 93 push r23 16bde: 6f 93 push r22 16be0: 5f 93 push r21 16be2: 4f 93 push r20 16be4: ef 92 push r14 16be6: ff 92 push r15 16be8: 0f 93 push r16 16bea: 1f 93 push r17 16bec: 3f 93 push r19 16bee: 2f 93 push r18 16bf0: 83 e4 ldi r24, 0x43 ; 67 16bf2: 99 e6 ldi r25, 0x69 ; 105 16bf4: 9f 93 push r25 16bf6: 8f 93 push r24 16bf8: 0f 94 4b dc call 0x3b896 ; 0x3b896 16bfc: 0f b6 in r0, 0x3f ; 63 16bfe: f8 94 cli 16c00: de bf out 0x3e, r29 ; 62 16c02: 0f be out 0x3f, r0 ; 63 16c04: cd bf out 0x3d, r28 ; 61 16c06: 89 cc rjmp .-1774 ; 0x1651a _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; _min = print_job_timer.duration() / 60; } else { if (code_seen('S')) { 16c08: 83 e5 ldi r24, 0x53 ; 83 16c0a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16c0e: 88 23 and r24, r24 16c10: 51 f0 breq .+20 ; 0x16c26 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); 16c12: 0e 94 4a 61 call 0xc294 ; 0xc294 16c16: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 16c1a: ab 01 movw r20, r22 16c1c: bc 01 movw r22, r24 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 16c1e: 81 ef ldi r24, 0xF1 ; 241 16c20: 9f e0 ldi r25, 0x0F ; 15 16c22: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e } if (code_seen('T')) { 16c26: 84 e5 ldi r24, 0x54 ; 84 16c28: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16c2c: 88 23 and r24, r24 16c2e: 51 f0 breq .+20 ; 0x16c44 eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); 16c30: 0e 94 4a 61 call 0xc294 ; 0xc294 16c34: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 16c38: ab 01 movw r20, r22 16c3a: bc 01 movw r22, r24 16c3c: 8d ee ldi r24, 0xED ; 237 16c3e: 9f e0 ldi r25, 0x0F ; 15 16c40: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); 16c44: 81 ef ldi r24, 0xF1 ; 241 16c46: 9f e0 ldi r25, 0x0F ; 15 16c48: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 16c4c: 16 2f mov r17, r22 16c4e: 07 2f mov r16, r23 16c50: f8 2e mov r15, r24 16c52: e9 2e mov r14, r25 _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); 16c54: 8d ee ldi r24, 0xED ; 237 16c56: 9f e0 ldi r25, 0x0F ; 15 16c58: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 } if (code_seen('T')) { eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); 16c5c: 43 e5 ldi r20, 0x53 ; 83 16c5e: 5c e4 ldi r21, 0x4C ; 76 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); } if (code_seen('T')) { eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); } _m_fil = _O(MSG_TOTAL_FILAMENT); 16c60: 22 e4 ldi r18, 0x42 ; 66 16c62: 3c e4 ldi r19, 0x4C ; 76 16c64: b9 cf rjmp .-142 ; 0x16bd8 void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 16c66: 8c e9 ldi r24, 0x9C ; 156 16c68: 93 e0 ldi r25, 0x03 ; 3 16c6a: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 16c6e: 83 e5 ldi r24, 0x53 ; 83 16c70: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16c74: 88 23 and r24, r24 16c76: 09 f1 breq .+66 ; 0x16cba , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 16c78: 62 e2 ldi r22, 0x22 ; 34 16c7a: 70 e0 ldi r23, 0x00 ; 0 16c7c: 80 91 95 03 lds r24, 0x0395 ; 0x800395 16c80: 90 91 96 03 lds r25, 0x0396 ; 0x800396 16c84: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 16c88: 8c 01 movw r16, r24 if (!this->ptr) { 16c8a: 89 2b or r24, r25 16c8c: b1 f0 breq .+44 ; 0x16cba // First quote not found return; } // Skip the leading quote this->ptr++; 16c8e: 0f 5f subi r16, 0xFF ; 255 16c90: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 16c92: 62 e2 ldi r22, 0x22 ; 34 16c94: 70 e0 ldi r23, 0x00 ; 0 16c96: c8 01 movw r24, r16 16c98: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 if(!pStrEnd) { 16c9c: 89 2b or r24, r25 16c9e: 69 f0 breq .+26 ; 0x16cba char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 16ca0: e7 e4 ldi r30, 0x47 ; 71 16ca2: f6 e0 ldi r31, 0x06 ; 6 16ca4: 83 e0 ldi r24, 0x03 ; 3 16ca6: df 01 movw r26, r30 16ca8: 1d 92 st X+, r1 16caa: 8a 95 dec r24 16cac: e9 f7 brne .-6 ; 0x16ca8 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 16cae: 42 e0 ldi r20, 0x02 ; 2 16cb0: 50 e0 ldi r21, 0x00 ; 0 16cb2: b8 01 movw r22, r16 16cb4: cf 01 movw r24, r30 16cb6: 0f 94 09 e4 call 0x3c812 ; 0x3c812 } #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 16cba: 8c e8 ldi r24, 0x8C ; 140 16cbc: 9f e0 ldi r25, 0x0F ; 15 16cbe: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 && printer_recovering() && printingIsPaused()) { 16cc2: 81 30 cpi r24, 0x01 ; 1 16cc4: 09 f0 breq .+2 ; 0x16cc8 16cc6: 29 cc rjmp .-1966 ; 0x1651a #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() 16cc8: 0e 94 28 68 call 0xd050 ; 0xd050 16ccc: 88 23 and r24, r24 16cce: 09 f4 brne .+2 ; 0x16cd2 16cd0: 24 cc rjmp .-1976 ; 0x1651a && printingIsPaused()) { 16cd2: 0e 94 32 68 call 0xd064 ; 0xd064 16cd6: 88 23 and r24, r24 16cd8: 09 f4 brne .+2 ; 0x16cdc 16cda: 1f cc rjmp .-1986 ; 0x1651a // 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) { 16cdc: 80 91 ee 04 lds r24, 0x04EE ; 0x8004ee <_ZL24uvlo_auto_recovery_ready.lto_priv.552> 16ce0: 88 23 and r24, r24 16ce2: 29 f0 breq .+10 ; 0x16cee SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 16ce4: 81 e2 ldi r24, 0x21 ; 33 16ce6: 99 e6 ldi r25, 0x69 ; 105 16ce8: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 16cec: 16 cc rjmp .-2004 ; 0x1651a } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 16cee: 84 e0 ldi r24, 0x04 ; 4 16cf0: 99 e6 ldi r25, 0x69 ; 105 16cf2: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 16cf6: 11 cc rjmp .-2014 ; 0x1651a /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 16cf8: 87 ee ldi r24, 0xE7 ; 231 16cfa: 98 e6 ldi r25, 0x68 ; 104 16cfc: 0e 94 8d 7b call 0xf71a ; 0xf71a #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 16d00: 83 e5 ldi r24, 0x53 ; 83 16d02: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16d06: 88 23 and r24, r24 16d08: 09 f4 brne .+2 ; 0x16d0c 16d0a: 07 cc rjmp .-2034 ; 0x1651a 16d0c: 0e 94 4a 61 call 0xc294 ; 0xc294 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 16d10: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 16d14: 70 93 6a 0e sts 0x0E6A, r23 ; 0x800e6a 16d18: 60 93 69 0e sts 0x0E69, r22 ; 0x800e69 16d1c: fe cb rjmp .-2052 ; 0x1651a 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 "); 16d1e: 88 e5 ldi r24, 0x58 ; 88 16d20: 98 e8 ldi r25, 0x88 ; 136 16d22: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 gcode_M105(); 16d26: 0e 94 45 7a call 0xf48a ; 0xf48a cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 16d2a: 0e 94 3f 78 call 0xf07e ; 0xf07e cmdbuffer_front_already_processed = true; 16d2e: 81 e0 ldi r24, 0x01 ; 1 16d30: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e 16d34: f2 cb rjmp .-2076 ; 0x1651a 16d36: 10 92 65 14 sts 0x1465, r1 ; 0x801465 16d3a: 0c 94 76 a9 jmp 0x152ec ; 0x152ec 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; } 16d3e: 81 e0 ldi r24, 0x01 ; 1 16d40: 80 93 63 14 sts 0x1463, r24 ; 0x801463 16d44: ea cb rjmp .-2092 ; 0x1651a #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 16d46: 82 e5 ldi r24, 0x52 ; 82 16d48: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16d4c: 81 11 cpse r24, r1 16d4e: 0c 94 02 a9 jmp 0x15204 ; 0x15204 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 16d52: 0f 94 83 3f call 0x27f06 ; 0x27f06 16d56: 6b 01 movw r12, r22 16d58: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 16d5a: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 16d5e: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 16d62: 07 2e mov r0, r23 16d64: 00 0c add r0, r0 16d66: 88 0b sbc r24, r24 16d68: 99 0b sbc r25, r25 16d6a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 16d6e: 11 e0 ldi r17, 0x01 ; 1 16d70: 20 91 5f 0e lds r18, 0x0E5F ; 0x800e5f 16d74: 30 91 60 0e lds r19, 0x0E60 ; 0x800e60 16d78: 40 91 61 0e lds r20, 0x0E61 ; 0x800e61 16d7c: 50 91 62 0e lds r21, 0x0E62 ; 0x800e62 16d80: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 16d84: 18 16 cp r1, r24 16d86: 0c f0 brlt .+2 ; 0x16d8a 16d88: 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 16d8a: 10 93 5e 0e sts 0x0E5E, r17 ; 0x800e5e <_ZL16target_direction.lto_priv.553> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 16d8e: c7 01 movw r24, r14 16d90: b6 01 movw r22, r12 16d92: 0f 94 8f 82 call 0x3051e ; 0x3051e LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 16d96: 8e ec ldi r24, 0xCE ; 206 16d98: 99 e4 ldi r25, 0x49 ; 73 16d9a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 16d9e: 0f 94 e2 0b call 0x217c4 ; 0x217c4 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 16da2: 82 e0 ldi r24, 0x02 ; 2 16da4: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd prusa_statistics(2); previous_millis_cmd.start(); 16da8: 86 e8 ldi r24, 0x86 ; 134 16daa: 93 e0 ldi r25, 0x03 ; 3 16dac: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> 16db0: b4 cb rjmp .-2200 ; 0x1651a */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 16db2: 80 ec ldi r24, 0xC0 ; 192 16db4: 99 e4 ldi r25, 0x49 ; 73 16db6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 16dba: 0f 94 e2 0b call 0x217c4 ; 0x217c4 heating_status = HeatingStatus::BED_HEATING; 16dbe: 83 e0 ldi r24, 0x03 ; 3 16dc0: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd prusa_statistics(1); if (code_seen('S')) 16dc4: 83 e5 ldi r24, 0x53 ; 83 16dc6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16dca: 18 2f mov r17, r24 16dcc: 88 23 and r24, r24 16dce: 49 f0 breq .+18 ; 0x16de2 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 16dd0: 0e 94 4a 61 call 0xc294 ; 0xc294 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 16dd4: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 16dd8: 70 93 6a 0e sts 0x0E6A, r23 ; 0x800e6a 16ddc: 60 93 69 0e sts 0x0E69, r22 ; 0x800e69 16de0: 05 c0 rjmp .+10 ; 0x16dec if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 16de2: 82 e5 ldi r24, 0x52 ; 82 16de4: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16de8: 81 11 cpse r24, r1 16dea: f2 cf rjmp .-28 ; 0x16dd0 { setTargetBed(code_value()); } codenum = _millis(); 16dec: 0f 94 83 3f call 0x27f06 ; 0x27f06 16df0: 6b 01 movw r12, r22 16df2: 7c 01 movw r14, r24 cancel_heatup = false; 16df4: 10 92 64 0e sts 0x0E64, r1 ; 0x800e64 <_ZL13cancel_heatup.lto_priv.404> 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; 16df8: 60 91 69 0e lds r22, 0x0E69 ; 0x800e69 16dfc: 70 91 6a 0e lds r23, 0x0E6A ; 0x800e6a 16e00: 07 2e mov r0, r23 16e02: 00 0c add r0, r0 16e04: 88 0b sbc r24, r24 16e06: 99 0b sbc r25, r25 16e08: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 16e0c: 01 e0 ldi r16, 0x01 ; 1 16e0e: 20 91 ef 04 lds r18, 0x04EF ; 0x8004ef 16e12: 30 91 f0 04 lds r19, 0x04F0 ; 0x8004f0 16e16: 40 91 f1 04 lds r20, 0x04F1 ; 0x8004f1 16e1a: 50 91 f2 04 lds r21, 0x04F2 ; 0x8004f2 16e1e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 16e22: 18 16 cp r1, r24 16e24: 0c f0 brlt .+2 ; 0x16e28 16e26: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 16e28: 00 93 5e 0e sts 0x0E5E, r16 ; 0x800e5e <_ZL16target_direction.lto_priv.553> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 16e2c: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13cancel_heatup.lto_priv.404> 16e30: 81 11 cpse r24, r1 16e32: 1a c0 rjmp .+52 ; 0x16e68 16e34: 60 91 69 0e lds r22, 0x0E69 ; 0x800e69 16e38: 70 91 6a 0e lds r23, 0x0E6A ; 0x800e6a 16e3c: 07 2e mov r0, r23 16e3e: 00 0c add r0, r0 16e40: 88 0b sbc r24, r24 16e42: 99 0b sbc r25, r25 16e44: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 16e48: 20 91 ef 04 lds r18, 0x04EF ; 0x8004ef 16e4c: 30 91 f0 04 lds r19, 0x04F0 ; 0x8004f0 16e50: 40 91 f1 04 lds r20, 0x04F1 ; 0x8004f1 16e54: 50 91 f2 04 lds r21, 0x04F2 ; 0x8004f2 16e58: e0 91 5e 0e lds r30, 0x0E5E ; 0x800e5e <_ZL16target_direction.lto_priv.553> 16e5c: ee 23 and r30, r30 16e5e: 91 f0 breq .+36 ; 0x16e84 16e60: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 16e64: 18 16 cp r1, r24 16e66: a4 f0 brlt .+40 ; 0x16e90 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 16e68: 85 eb ldi r24, 0xB5 ; 181 16e6a: 99 e4 ldi r25, 0x49 ; 73 16e6c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 16e70: 0f 94 e2 0b call 0x217c4 ; 0x217c4 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 16e74: 84 e0 ldi r24, 0x04 ; 4 16e76: 80 93 dd 03 sts 0x03DD, r24 ; 0x8003dd previous_millis_cmd.start(); 16e7a: 86 e8 ldi r24, 0x86 ; 134 16e7c: 93 e0 ldi r25, 0x03 ; 3 16e7e: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> 16e82: 4b cb rjmp .-2410 ; 0x1651a codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 16e84: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 16e88: 87 ff sbrs r24, 7 16e8a: ee cf rjmp .-36 ; 0x16e68 16e8c: 11 11 cpse r17, r1 16e8e: ec cf rjmp .-40 ; 0x16e68 { if (lcd_commands_type == LcdCommands::LongPause) { 16e90: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 16e94: 82 30 cpi r24, 0x02 ; 2 16e96: 41 f3 breq .-48 ; 0x16e68 // 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. 16e98: 0f 94 83 3f call 0x27f06 ; 0x27f06 16e9c: 6c 19 sub r22, r12 16e9e: 7d 09 sbc r23, r13 16ea0: 8e 09 sbc r24, r14 16ea2: 9f 09 sbc r25, r15 16ea4: 69 3e cpi r22, 0xE9 ; 233 16ea6: 73 40 sbci r23, 0x03 ; 3 16ea8: 81 05 cpc r24, r1 16eaa: 91 05 cpc r25, r1 16eac: 30 f0 brcs .+12 ; 0x16eba { if (!farm_mode) { serialecho_temperatures(); 16eae: 0e 94 e1 78 call 0xf1c2 ; 0xf1c2 } codenum = _millis(); 16eb2: 0f 94 83 3f call 0x27f06 ; 0x27f06 16eb6: 6b 01 movw r12, r22 16eb8: 7c 01 movw r14, r24 } manage_heater(); 16eba: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(); 16ebe: 80 e0 ldi r24, 0x00 ; 0 16ec0: 0e 94 da 8b call 0x117b4 ; 0x117b4 lcd_update(0); 16ec4: 80 e0 ldi r24, 0x00 ; 0 16ec6: 0e 94 54 6f call 0xdea8 ; 0xdea8 16eca: b0 cf rjmp .-160 ; 0x16e2c #### 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')){ 16ecc: 83 e5 ldi r24, 0x53 ; 83 16ece: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16ed2: 88 23 and r24, r24 16ed4: 29 f0 breq .+10 ; 0x16ee0 fanSpeed = code_value_uint8(); 16ed6: 0e 94 06 5c call 0xb80c ; 0xb80c 16eda: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 16ede: 1d cb rjmp .-2502 ; 0x1651a } else { fanSpeed = 255; 16ee0: 8f ef ldi r24, 0xFF ; 255 16ee2: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 16ee6: 19 cb rjmp .-2510 ; 0x1651a /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 16ee8: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 16eec: 16 cb rjmp .-2516 ; 0x1651a /*! ### 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; 16eee: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 16ef2: 88 60 ori r24, 0x08 ; 8 16ef4: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 16ef8: 10 cb rjmp .-2528 ; 0x1651a ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 16efa: 83 e5 ldi r24, 0x53 ; 83 16efc: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16f00: 88 23 and r24, r24 16f02: 99 f0 breq .+38 ; 0x16f2a stepper_inactive_time = code_value() * 1000; 16f04: 0e 94 4a 61 call 0xc294 ; 0xc294 16f08: 20 e0 ldi r18, 0x00 ; 0 16f0a: 30 e0 ldi r19, 0x00 ; 0 16f0c: 4a e7 ldi r20, 0x7A ; 122 16f0e: 54 e4 ldi r21, 0x44 ; 68 16f10: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 16f14: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 16f18: 60 93 34 02 sts 0x0234, r22 ; 0x800234 16f1c: 70 93 35 02 sts 0x0235, r23 ; 0x800235 16f20: 80 93 36 02 sts 0x0236, r24 ; 0x800236 16f24: 90 93 37 02 sts 0x0237, r25 ; 0x800237 16f28: f8 ca rjmp .-2576 ; 0x1651a } 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]))); 16f2a: 88 e5 ldi r24, 0x58 ; 88 16f2c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16f30: 88 23 and r24, r24 16f32: d1 f0 breq .+52 ; 0x16f68 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 16f34: 0f 94 24 59 call 0x2b248 ; 0x2b248 if (code_seen('X')) disable_x(); 16f38: 88 e5 ldi r24, 0x58 ; 88 16f3a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16f3e: 81 11 cpse r24, r1 16f40: 28 c0 rjmp .+80 ; 0x16f92 if (code_seen('Y')) disable_y(); 16f42: 89 e5 ldi r24, 0x59 ; 89 16f44: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16f48: 88 23 and r24, r24 16f4a: 19 f0 breq .+6 ; 0x16f52 16f4c: 16 9a sbi 0x02, 6 ; 2 16f4e: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f if (code_seen('Z')) disable_z(); 16f52: 8a e5 ldi r24, 0x5A ; 90 16f54: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 16f58: 85 e4 ldi r24, 0x45 ; 69 16f5a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16f5e: 88 23 and r24, r24 16f60: 09 f4 brne .+2 ; 0x16f64 16f62: db ca rjmp .-2634 ; 0x1651a 16f64: 14 9a sbi 0x02, 4 ; 2 16f66: d9 ca rjmp .-2638 ; 0x1651a 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]))); 16f68: 89 e5 ldi r24, 0x59 ; 89 16f6a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16f6e: 81 11 cpse r24, r1 16f70: e1 cf rjmp .-62 ; 0x16f34 16f72: 8a e5 ldi r24, 0x5A ; 90 16f74: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16f78: 81 11 cpse r24, r1 16f7a: dc cf rjmp .-72 ; 0x16f34 16f7c: 85 e4 ldi r24, 0x45 ; 69 16f7e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16f82: 81 11 cpse r24, r1 16f84: d7 cf rjmp .-82 ; 0x16f34 if(all_axis) { st_synchronize(); 16f86: 0f 94 24 59 call 0x2b248 ; 0x2b248 disable_e0(); 16f8a: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 16f8c: 0e 94 8b 83 call 0x10716 ; 0x10716 16f90: c4 ca rjmp .-2680 ; 0x1651a } else { st_synchronize(); if (code_seen('X')) disable_x(); 16f92: 17 9a sbi 0x02, 7 ; 2 16f94: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e 16f98: d4 cf rjmp .-88 ; 0x16f42 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 16f9a: 83 e5 ldi r24, 0x53 ; 83 16f9c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16fa0: 88 23 and r24, r24 16fa2: 09 f4 brne .+2 ; 0x16fa6 16fa4: ba ca rjmp .-2700 ; 0x1651a safetytimer_inactive_time = code_value() * 1000; 16fa6: 0e 94 4a 61 call 0xc294 ; 0xc294 16faa: 20 e0 ldi r18, 0x00 ; 0 16fac: 30 e0 ldi r19, 0x00 ; 0 16fae: 4a e7 ldi r20, 0x7A ; 122 16fb0: 54 e4 ldi r21, 0x44 ; 68 16fb2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 16fb6: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 16fba: 60 93 30 02 sts 0x0230, r22 ; 0x800230 16fbe: 70 93 31 02 sts 0x0231, r23 ; 0x800231 16fc2: 80 93 32 02 sts 0x0232, r24 ; 0x800232 16fc6: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 16fca: 89 ed ldi r24, 0xD9 ; 217 16fcc: 95 e0 ldi r25, 0x05 ; 5 16fce: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> 16fd2: a3 ca rjmp .-2746 ; 0x1651a 16fd4: 4d ed ldi r20, 0xDD ; 221 16fd6: c4 2e mov r12, r20 16fd8: 42 e0 ldi r20, 0x02 ; 2 16fda: d4 2e mov r13, r20 16fdc: 5c e6 ldi r21, 0x6C ; 108 16fde: e5 2e mov r14, r21 16fe0: 56 e0 ldi r21, 0x06 ; 6 16fe2: f5 2e mov r15, r21 - `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++) 16fe4: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 16fe6: f6 01 movw r30, r12 16fe8: 81 91 ld r24, Z+ 16fea: 6f 01 movw r12, r30 16fec: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 16ff0: 88 23 and r24, r24 16ff2: 09 f4 brne .+2 ; 0x16ff6 16ff4: 65 c0 rjmp .+202 ; 0x170c0 { float value = code_value(); 16ff6: 0e 94 4a 61 call 0xc294 ; 0xc294 16ffa: 2b 01 movw r4, r22 16ffc: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 16ffe: 13 30 cpi r17, 0x03 ; 3 17000: 09 f0 breq .+2 ; 0x17004 17002: 68 c0 rjmp .+208 ; 0x170d4 if(value < 20.0) { 17004: 20 e0 ldi r18, 0x00 ; 0 17006: 30 e0 ldi r19, 0x00 ; 0 17008: 40 ea ldi r20, 0xA0 ; 160 1700a: 51 e4 ldi r21, 0x41 ; 65 1700c: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 17010: 87 ff sbrs r24, 7 17012: 4e c0 rjmp .+156 ; 0x170b0 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 17014: a3 01 movw r20, r6 17016: 92 01 movw r18, r4 17018: 60 91 7c 06 lds r22, 0x067C ; 0x80067c 1701c: 70 91 7d 06 lds r23, 0x067D ; 0x80067d 17020: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 17024: 90 91 7f 06 lds r25, 0x067F ; 0x80067f 17028: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1702c: 4b 01 movw r8, r22 1702e: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 17030: ac 01 movw r20, r24 17032: 9b 01 movw r18, r22 17034: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 17038: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 1703c: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 17040: 90 91 c3 06 lds r25, 0x06C3 ; 0x8006c3 17044: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 17048: 60 93 c0 06 sts 0x06C0, r22 ; 0x8006c0 1704c: 70 93 c1 06 sts 0x06C1, r23 ; 0x8006c1 17050: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 17054: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 max_feedrate[E_AXIS] *= factor; 17058: 20 90 99 02 lds r2, 0x0299 ; 0x800299 1705c: 30 90 9a 02 lds r3, 0x029A ; 0x80029a 17060: a5 01 movw r20, r10 17062: 94 01 movw r18, r8 17064: d1 01 movw r26, r2 17066: 1c 96 adiw r26, 0x0c ; 12 17068: 6d 91 ld r22, X+ 1706a: 7d 91 ld r23, X+ 1706c: 8d 91 ld r24, X+ 1706e: 9c 91 ld r25, X 17070: 1f 97 sbiw r26, 0x0f ; 15 17072: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 17076: f1 01 movw r30, r2 17078: 64 87 std Z+12, r22 ; 0x0c 1707a: 75 87 std Z+13, r23 ; 0x0d 1707c: 86 87 std Z+14, r24 ; 0x0e 1707e: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 17080: 60 91 fa 17 lds r22, 0x17FA ; 0x8017fa 17084: 70 91 fb 17 lds r23, 0x17FB ; 0x8017fb 17088: 80 91 fc 17 lds r24, 0x17FC ; 0x8017fc 1708c: 90 91 fd 17 lds r25, 0x17FD ; 0x8017fd 17090: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 17094: a5 01 movw r20, r10 17096: 94 01 movw r18, r8 17098: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1709c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 170a0: 60 93 fa 17 sts 0x17FA, r22 ; 0x8017fa 170a4: 70 93 fb 17 sts 0x17FB, r23 ; 0x8017fb 170a8: 80 93 fc 17 sts 0x17FC, r24 ; 0x8017fc 170ac: 90 93 fd 17 sts 0x17FD, r25 ; 0x8017fd } cs.axis_steps_per_mm[E_AXIS] = value; 170b0: 40 92 7c 06 sts 0x067C, r4 ; 0x80067c 170b4: 50 92 7d 06 sts 0x067D, r5 ; 0x80067d 170b8: 60 92 7e 06 sts 0x067E, r6 ; 0x80067e 170bc: 70 92 7f 06 sts 0x067F, r7 ; 0x80067f 170c0: b4 e0 ldi r27, 0x04 ; 4 170c2: eb 0e add r14, r27 170c4: f1 1c adc r15, r1 170c6: 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++) 170c8: 14 30 cpi r17, 0x04 ; 4 170ca: 09 f0 breq .+2 ; 0x170ce 170cc: 8c cf rjmp .-232 ; 0x16fe6 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 170ce: 0f 94 7d aa call 0x354fa ; 0x354fa 170d2: 23 ca rjmp .-3002 ; 0x1651a 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; 170d4: d7 01 movw r26, r14 170d6: 14 96 adiw r26, 0x04 ; 4 170d8: 4d 92 st X+, r4 170da: 5d 92 st X+, r5 170dc: 6d 92 st X+, r6 170de: 7c 92 st X, r7 170e0: 17 97 sbiw r26, 0x07 ; 7 170e2: ee cf rjmp .-36 ; 0x170c0 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 170e4: 8e e4 ldi r24, 0x4E ; 78 170e6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 170ea: 88 23 and r24, r24 170ec: 09 f4 brne .+2 ; 0x170f0 170ee: 15 ca rjmp .-3030 ; 0x1651a gcode_LastN = code_value_long(); 170f0: 0e 94 20 5c call 0xb840 ; 0xb840 170f4: 60 93 7a 03 sts 0x037A, r22 ; 0x80037a 170f8: 70 93 7b 03 sts 0x037B, r23 ; 0x80037b 170fc: 80 93 7c 03 sts 0x037C, r24 ; 0x80037c 17100: 90 93 7d 03 sts 0x037D, r25 ; 0x80037d 17104: 0a ca rjmp .-3052 ; 0x1651a case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 17106: 82 ee ldi r24, 0xE2 ; 226 17108: 99 ea ldi r25, 0xA9 ; 169 1710a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 1710e: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 17112: d1 2c mov r13, r1 17114: f1 2c mov r15, r1 17116: 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); } 17118: 81 e5 ldi r24, 0x51 ; 81 1711a: 98 e8 ldi r25, 0x88 ; 136 1711c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 17120: 4a e0 ldi r20, 0x0A ; 10 17122: c7 01 movw r24, r14 17124: b6 01 movw r22, r12 17126: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 1712a: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 1712e: f5 c9 rjmp .-3094 ; 0x1651a */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 17130: 85 e5 ldi r24, 0x55 ; 85 17132: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17136: 88 23 and r24, r24 17138: 09 f4 brne .+2 ; 0x1713c 1713a: 5a c0 rjmp .+180 ; 0x171f0 // 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); 1713c: 00 91 95 03 lds r16, 0x0395 ; 0x800395 17140: 10 91 96 03 lds r17, 0x0396 ; 0x800396 17144: 0f 5f subi r16, 0xFF ; 255 17146: 1f 4f sbci r17, 0xFF ; 255 17148: 10 93 96 03 sts 0x0396, r17 ; 0x800396 1714c: 00 93 95 03 sts 0x0395, r16 ; 0x800395 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 17150: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 17154: 88 23 and r24, r24 17156: 09 f4 brne .+2 ; 0x1715a 17158: e0 c9 rjmp .-3136 ; 0x1651a // 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)) 1715a: be 01 movw r22, r28 1715c: 6f 5f subi r22, 0xFF ; 255 1715e: 7f 4f sbci r23, 0xFF ; 255 17160: c8 01 movw r24, r16 17162: 0e 94 50 f9 call 0x1f2a0 ; 0x1f2a0 17166: 88 23 and r24, r24 17168: 09 f4 brne .+2 ; 0x1716c 1716a: d7 c9 rjmp .-3154 ; 0x1651a 1716c: 80 e8 ldi r24, 0x80 ; 128 1716e: 9f e8 ldi r25, 0x8F ; 143 17170: de 01 movw r26, r28 17172: 11 96 adiw r26, 0x01 ; 1 17174: be 01 movw r22, r28 17176: 67 5f subi r22, 0xF7 ; 247 17178: 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]); 1717a: fc 01 movw r30, r24 1717c: 45 91 lpm r20, Z+ 1717e: 54 91 lpm r21, Z if (ver_gcode[i] > v) 17180: 2d 91 ld r18, X+ 17182: 3d 91 ld r19, X+ 17184: 42 17 cp r20, r18 17186: 53 07 cpc r21, r19 17188: 10 f4 brcc .+4 ; 0x1718e 1718a: 0c 94 50 cf jmp 0x19ea0 ; 0x19ea0 return 1; else if (ver_gcode[i] < v) 1718e: 24 17 cp r18, r20 17190: 35 07 cpc r19, r21 17192: 08 f4 brcc .+2 ; 0x17196 17194: c2 c9 rjmp .-3196 ; 0x1651a 17196: 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) 17198: a6 17 cp r26, r22 1719a: b7 07 cpc r27, r23 1719c: 71 f7 brne .-36 ; 0x1717a 1719e: bd c9 rjmp .-3206 ; 0x1651a 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)); 171a0: 83 e4 ldi r24, 0x43 ; 67 171a2: 99 e3 ldi r25, 0x39 ; 57 171a4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 171a8: ac 01 movw r20, r24 171aa: 63 e0 ldi r22, 0x03 ; 3 171ac: 80 e0 ldi r24, 0x00 ; 0 171ae: 0e 94 a1 6f call 0xdf42 ; 0xdf42 Sound_MakeCustom(50,1000,false); 171b2: 40 e0 ldi r20, 0x00 ; 0 171b4: 68 ee ldi r22, 0xE8 ; 232 171b6: 73 e0 ldi r23, 0x03 ; 3 171b8: 82 e3 ldi r24, 0x32 ; 50 171ba: 90 e0 ldi r25, 0x00 ; 0 171bc: 0f 94 99 6a call 0x2d532 ; 0x2d532 delay_keep_alive(500); 171c0: 84 ef ldi r24, 0xF4 ; 244 171c2: 91 e0 ldi r25, 0x01 ; 1 171c4: 0e 94 7f 8e call 0x11cfe ; 0x11cfe Sound_MakeCustom(50,1000,false); 171c8: 40 e0 ldi r20, 0x00 ; 0 171ca: 68 ee ldi r22, 0xE8 ; 232 171cc: 73 e0 ldi r23, 0x03 ; 3 171ce: 82 e3 ldi r24, 0x32 ; 50 171d0: 90 e0 ldi r25, 0x00 ; 0 171d2: 0f 94 99 6a call 0x2d532 ; 0x2d532 lcd_wait_for_click_delay(30); 171d6: 8e e1 ldi r24, 0x1E ; 30 171d8: 90 e0 ldi r25, 0x00 ; 0 171da: 0f 94 6b 50 call 0x2a0d6 ; 0x2a0d6 lcd_update_enable(true); 171de: 81 e0 ldi r24, 0x01 ; 1 171e0: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_clear(); 171e4: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_update(0); 171e8: 80 e0 ldi r24, 0x00 ; 0 171ea: 0e 94 54 6f call 0xdea8 ; 0xdea8 171ee: 95 c9 rjmp .-3286 ; 0x1651a } 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); 171f0: 41 e1 ldi r20, 0x11 ; 17 171f2: 50 e0 ldi r21, 0x00 ; 0 171f4: 60 e8 ldi r22, 0x80 ; 128 171f6: 7c e0 ldi r23, 0x0C ; 12 171f8: ce 01 movw r24, r28 171fa: 01 96 adiw r24, 0x01 ; 1 171fc: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 17200: 83 e3 ldi r24, 0x33 ; 51 17202: 98 e8 ldi r25, 0x88 ; 136 17204: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 17208: 84 eb ldi r24, 0xB4 ; 180 1720a: 95 e8 ldi r25, 0x85 ; 133 1720c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM("+"); 17210: 81 e3 ldi r24, 0x31 ; 49 17212: 98 e8 ldi r25, 0x88 ; 136 17214: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 17218: 8c e2 ldi r24, 0x2C ; 44 1721a: 98 e8 ldi r25, 0x88 ; 136 1721c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM("_"); 17220: 8a e2 ldi r24, 0x2A ; 42 17222: 98 e8 ldi r25, 0x88 ; 136 17224: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM(FW_COMMIT_HASH); 17228: 80 e2 ldi r24, 0x20 ; 32 1722a: 98 e8 ldi r25, 0x88 ; 136 1722c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 17230: 86 ec ldi r24, 0xC6 ; 198 17232: 97 e8 ldi r25, 0x87 ; 135 17234: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM(PROTOCOL_VERSION); 17238: 82 ec ldi r24, 0xC2 ; 194 1723a: 97 e8 ldi r25, 0x87 ; 135 1723c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 17240: 83 eb ldi r24, 0xB3 ; 179 17242: 97 e8 ldi r25, 0x87 ; 135 17244: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 17248: ce 01 movw r24, r28 1724a: 01 96 adiw r24, 0x01 ; 1 1724c: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 17250: 81 ea ldi r24, 0xA1 ; 161 17252: 97 e8 ldi r25, 0x87 ; 135 17254: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 17258: 80 ea ldi r24, 0xA0 ; 160 1725a: 97 e8 ldi r25, 0x87 ; 135 1725c: 0e 94 fe 7a call 0xf5fc ; 0xf5fc } #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'); 17260: 1f 92 push r1 17262: 31 e3 ldi r19, 0x31 ; 49 17264: f3 2e mov r15, r19 17266: ff 92 push r15 17268: 83 ea ldi r24, 0xA3 ; 163 1726a: 95 e8 ldi r25, 0x85 ; 133 1726c: 9f 93 push r25 1726e: 8f 93 push r24 17270: 0c e5 ldi r16, 0x5C ; 92 17272: 15 e8 ldi r17, 0x85 ; 133 17274: 1f 93 push r17 17276: 0f 93 push r16 17278: 0f 94 4b dc call 0x3b896 ; 0x3b896 1727c: 1f 92 push r1 1727e: ff 92 push r15 17280: 83 e9 ldi r24, 0x93 ; 147 17282: 95 e8 ldi r25, 0x85 ; 133 17284: 9f 93 push r25 17286: 8f 93 push r24 17288: 1f 93 push r17 1728a: 0f 93 push r16 1728c: 0f 94 4b dc call 0x3b896 ; 0x3b896 17290: 1f 92 push r1 17292: ff 92 push r15 17294: 8f e7 ldi r24, 0x7F ; 127 17296: 95 e8 ldi r25, 0x85 ; 133 17298: 9f 93 push r25 1729a: 8f 93 push r24 1729c: 1f 93 push r17 1729e: 0f 93 push r16 172a0: 0f 94 4b dc call 0x3b896 ; 0x3b896 172a4: 1f 92 push r1 172a6: ff 92 push r15 172a8: 82 e7 ldi r24, 0x72 ; 114 172aa: 95 e8 ldi r25, 0x85 ; 133 172ac: 9f 93 push r25 172ae: 8f 93 push r24 172b0: 1f 93 push r17 172b2: 0f 93 push r16 172b4: 0f 94 4b dc call 0x3b896 ; 0x3b896 172b8: 1f 92 push r1 172ba: ff 92 push r15 172bc: 87 e6 ldi r24, 0x67 ; 103 172be: 95 e8 ldi r25, 0x85 ; 133 172c0: 9f 93 push r25 172c2: 8f 93 push r24 172c4: 1f 93 push r17 172c6: 0f 93 push r16 172c8: 0f 94 4b dc call 0x3b896 ; 0x3b896 172cc: 0f b6 in r0, 0x3f ; 63 172ce: f8 94 cli 172d0: de bf out 0x3e, r29 ; 62 172d2: 0f be out 0x3f, r0 ; 63 172d4: cd bf out 0x3d, r28 ; 61 172d6: 21 c9 rjmp .-3518 ; 0x1651a /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 172d8: 0e 94 ca 79 call 0xf394 ; 0xf394 172dc: 1e c9 rjmp .-3524 ; 0x1651a /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 172de: e0 91 95 03 lds r30, 0x0395 ; 0x800395 172e2: f0 91 96 03 lds r31, 0x0396 ; 0x800396 172e6: cf 01 movw r24, r30 172e8: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 172ea: 24 81 ldd r18, Z+4 ; 0x04 172ec: 20 32 cpi r18, 0x20 ; 32 172ee: 09 f4 brne .+2 ; 0x172f2 172f0: 01 96 adiw r24, 0x01 ; 1 172f2: 0f 94 4e 15 call 0x22a9c ; 0x22a9c custom_message_type = CustomMsg::M117; 172f6: 87 e0 ldi r24, 0x07 ; 7 172f8: 80 93 73 07 sts 0x0773, r24 ; 0x800773 172fc: 0e c9 rjmp .-3556 ; 0x1651a - `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; 172fe: 00 91 95 03 lds r16, 0x0395 ; 0x800395 17302: 10 91 96 03 lds r17, 0x0396 ; 0x800396 17306: 0b 5f subi r16, 0xFB ; 251 17308: 1f 4f sbci r17, 0xFF ; 255 1730a: 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; 1730c: f1 2c mov r15, r1 1730e: 40 e0 ldi r20, 0x00 ; 0 17310: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 17312: e9 f0 breq .+58 ; 0x1734e // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 17314: d8 01 movw r26, r16 17316: 9c 91 ld r25, X 17318: 29 2f mov r18, r25 1731a: 2b 7f andi r18, 0xFB ; 251 1731c: 21 34 cpi r18, 0x41 ; 65 1731e: b9 f4 brne .+46 ; 0x1734e 17320: 11 96 adiw r26, 0x01 ; 1 17322: 2c 91 ld r18, X 17324: 21 33 cpi r18, 0x31 ; 49 17326: 99 f4 brne .+38 ; 0x1734e switch (p[0]) { 17328: 91 34 cpi r25, 0x41 ; 65 1732a: 71 f0 breq .+28 ; 0x17348 1732c: 95 34 cpi r25, 0x45 ; 69 1732e: 09 f4 brne .+2 ; 0x17332 case 'A': hasA = true; break; case 'E': hasE = true; break; 17330: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 17332: 98 01 movw r18, r16 17334: 2e 5f subi r18, 0xFE ; 254 17336: 3f 4f sbci r19, 0xFF ; 255 17338: 89 01 movw r16, r18 1733a: 2f 5f subi r18, 0xFF ; 255 1733c: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 1733e: f8 01 movw r30, r16 17340: 90 81 ld r25, Z 17342: 90 32 cpi r25, 0x20 ; 32 17344: c9 f3 breq .-14 ; 0x17338 17346: e4 cf rjmp .-56 ; 0x17310 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; 17348: ff 24 eor r15, r15 1734a: f3 94 inc r15 1734c: f2 cf rjmp .-28 ; 0x17332 } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 1734e: 44 23 and r20, r20 17350: 21 f0 breq .+8 ; 0x1735a 17352: 82 ee ldi r24, 0xE2 ; 226 17354: 99 ea ldi r25, 0xA9 ; 169 17356: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if (hasA) SERIAL_ECHOPGM("//"); 1735a: ff 20 and r15, r15 1735c: 21 f0 breq .+8 ; 0x17366 1735e: 8d e9 ldi r24, 0x9D ; 157 17360: 97 e8 ldi r25, 0x87 ; 135 17362: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(p); 17366: c8 01 movw r24, r16 17368: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c 1736c: d6 c8 rjmp .-3668 ; 0x1651a /*! ### 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 1736e: 8e ec ldi r24, 0xCE ; 206 17370: 98 e6 ldi r25, 0x68 ; 104 17372: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLLN(); 17376: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 1737a: 86 ec ldi r24, 0xC6 ; 198 1737c: 98 e6 ldi r25, 0x68 ; 104 1737e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 17382: 1e 99 sbic 0x03, 6 ; 3 17384: 47 c0 rjmp .+142 ; 0x17414 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 17386: 81 ec ldi r24, 0xC1 ; 193 17388: 98 e6 ldi r25, 0x68 ; 104 SERIAL_PROTOCOLRPGM(_N("Reporting endstop status"));////MSG_M119_REPORT SERIAL_PROTOCOLLN(); #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 1738a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1738e: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 17392: 8f ea ldi r24, 0xAF ; 175 17394: 98 e6 ldi r25, 0x68 ; 104 17396: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 1739a: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1739e: 82 fd sbrc r24, 2 173a0: 3c c0 rjmp .+120 ; 0x1741a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173a2: 81 ec ldi r24, 0xC1 ; 193 173a4: 98 e6 ldi r25, 0x68 ; 104 SERIAL_PROTOCOLLN(); #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 173a6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173aa: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 173ae: 87 ea ldi r24, 0xA7 ; 167 173b0: 98 e6 ldi r25, 0x68 ; 104 173b2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 173b6: 1d 99 sbic 0x03, 5 ; 3 173b8: 33 c0 rjmp .+102 ; 0x17420 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173ba: 81 ec ldi r24, 0xC1 ; 193 173bc: 98 e6 ldi r25, 0x68 ; 104 SERIAL_PROTOCOLLN(); #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 173be: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173c2: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 173c6: 8f e9 ldi r24, 0x9F ; 159 173c8: 98 e6 ldi r25, 0x68 ; 104 173ca: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 173ce: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 173d2: 87 fd sbrc r24, 7 173d4: 28 c0 rjmp .+80 ; 0x17426 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173d6: 81 ec ldi r24, 0xC1 ; 193 173d8: 98 e6 ldi r25, 0x68 ; 104 SERIAL_PROTOCOLLN(); #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 173da: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173de: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 173e2: 87 e9 ldi r24, 0x97 ; 151 173e4: 98 e6 ldi r25, 0x68 ; 104 173e6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 173ea: 1c 99 sbic 0x03, 4 ; 3 173ec: 1f c0 rjmp .+62 ; 0x1742c SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173ee: 81 ec ldi r24, 0xC1 ; 193 173f0: 98 e6 ldi r25, 0x68 ; 104 SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 173f2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173f6: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 173fa: 8f e8 ldi r24, 0x8F ; 143 173fc: 98 e6 ldi r25, 0x68 ; 104 173fe: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 17402: 01 9b sbis 0x00, 1 ; 0 17404: 16 c0 rjmp .+44 ; 0x17432 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 17406: 81 ec ldi r24, 0xC1 ; 193 17408: 98 e6 ldi r25, 0x68 ; 104 SERIAL_PROTOCOLLN(); #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); 1740a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1740e: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 17412: 83 c8 rjmp .-3834 ; 0x1651a 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); 17414: 87 eb ldi r24, 0xB7 ; 183 17416: 98 e6 ldi r25, 0x68 ; 104 17418: b8 cf rjmp .-144 ; 0x1738a 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); 1741a: 87 eb ldi r24, 0xB7 ; 183 1741c: 98 e6 ldi r25, 0x68 ; 104 1741e: c3 cf rjmp .-122 ; 0x173a6 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); 17420: 87 eb ldi r24, 0xB7 ; 183 17422: 98 e6 ldi r25, 0x68 ; 104 17424: cc cf rjmp .-104 ; 0x173be 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); 17426: 87 eb ldi r24, 0xB7 ; 183 17428: 98 e6 ldi r25, 0x68 ; 104 1742a: d7 cf rjmp .-82 ; 0x173da 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); 1742c: 87 eb ldi r24, 0xB7 ; 183 1742e: 98 e6 ldi r25, 0x68 ; 104 17430: e0 cf rjmp .-64 ; 0x173f2 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); 17432: 87 eb ldi r24, 0xB7 ; 183 17434: 98 e6 ldi r25, 0x68 ; 104 17436: e9 cf rjmp .-46 ; 0x1740a E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 17438: 0e 94 31 67 call 0xce62 ; 0xce62 1743c: 6e c8 rjmp .-3876 ; 0x1651a */ 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')) { 1743e: 84 e5 ldi r24, 0x54 ; 84 17440: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17444: 88 23 and r24, r24 17446: 69 f0 breq .+26 ; 0x17462 extruder = code_value_uint8(); 17448: 0e 94 06 5c call 0xb80c ; 0xb80c if(extruder >= EXTRUDERS) { 1744c: 88 23 and r24, r24 1744e: 49 f0 breq .+18 ; 0x17462 SERIAL_ECHO_START; 17450: 82 ee ldi r24, 0xE2 ; 226 17452: 99 ea ldi r25, 0xA9 ; 169 17454: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 17458: 88 e7 ldi r24, 0x78 ; 120 1745a: 98 e6 ldi r25, 0x68 ; 104 1745c: 0e 94 37 89 call 0x1126e ; 0x1126e 17460: 5c c8 rjmp .-3912 ; 0x1651a SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 17462: 84 e4 ldi r24, 0x44 ; 68 17464: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17468: 88 23 and r24, r24 1746a: 09 f4 brne .+2 ; 0x1746e 1746c: 56 c8 rjmp .-3924 ; 0x1651a float diameter = code_value(); 1746e: 0e 94 4a 61 call 0xc294 ; 0xc294 if (diameter == 0.0) { 17472: 20 e0 ldi r18, 0x00 ; 0 17474: 30 e0 ldi r19, 0x00 ; 0 17476: a9 01 movw r20, r18 17478: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1747c: 81 11 cpse r24, r1 1747e: 05 c0 rjmp .+10 ; 0x1748a // 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; 17480: 10 92 03 07 sts 0x0703, r1 ; 0x800703 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 17484: 0e 94 66 66 call 0xcccc ; 0xcccc 17488: 48 c8 rjmp .-3952 ; 0x1651a // 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(); 1748a: 0e 94 4a 61 call 0xc294 ; 0xc294 1748e: 6b 01 movw r12, r22 17490: 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]); 17492: 20 e0 ldi r18, 0x00 ; 0 17494: 30 e0 ldi r19, 0x00 ; 0 17496: a9 01 movw r20, r18 17498: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1749c: 81 11 cpse r24, r1 1749e: 06 c0 rjmp .+12 ; 0x174ac 174a0: c1 2c mov r12, r1 174a2: d1 2c mov r13, r1 174a4: 20 ee ldi r18, 0xE0 ; 224 174a6: e2 2e mov r14, r18 174a8: 2f e3 ldi r18, 0x3F ; 63 174aa: f2 2e mov r15, r18 174ac: c0 92 04 07 sts 0x0704, r12 ; 0x800704 174b0: d0 92 05 07 sts 0x0705, r13 ; 0x800705 174b4: e0 92 06 07 sts 0x0706, r14 ; 0x800706 174b8: f0 92 07 07 sts 0x0707, r15 ; 0x800707 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; 174bc: 81 e0 ldi r24, 0x01 ; 1 174be: 80 93 03 07 sts 0x0703, r24 ; 0x800703 174c2: e0 cf rjmp .-64 ; 0x17484 174c4: 8d ed ldi r24, 0xDD ; 221 174c6: c8 2e mov r12, r24 174c8: 82 e0 ldi r24, 0x02 ; 2 174ca: d8 2e mov r13, r24 174cc: 9c e6 ldi r25, 0x6C ; 108 174ce: e9 2e mov r14, r25 174d0: 96 e0 ldi r25, 0x06 ; 6 174d2: f9 2e mov r15, r25 - `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++) 174d4: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 174d6: d6 01 movw r26, r12 174d8: 8d 91 ld r24, X+ 174da: 6d 01 movw r12, r26 174dc: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 174e0: 88 23 and r24, r24 174e2: 41 f1 breq .+80 ; 0x17534 { unsigned long val = code_value(); 174e4: 0e 94 4a 61 call 0xc294 ; 0xc294 174e8: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 174ec: 12 30 cpi r17, 0x02 ; 2 174ee: 4c f5 brge .+82 ; 0x17542 { if (val > NORMAL_MAX_ACCEL_XY) 174f0: 65 3c cpi r22, 0xC5 ; 197 174f2: b9 e0 ldi r27, 0x09 ; 9 174f4: 7b 07 cpc r23, r27 174f6: 81 05 cpc r24, r1 174f8: 91 05 cpc r25, r1 174fa: 40 f5 brcc .+80 ; 0x1754c 174fc: 56 2f mov r21, r22 174fe: 47 2f mov r20, r23 17500: 38 2f mov r19, r24 17502: 29 2f mov r18, r25 17504: 61 3c cpi r22, 0xC1 ; 193 17506: e3 e0 ldi r30, 0x03 ; 3 17508: 7e 07 cpc r23, r30 1750a: 81 05 cpc r24, r1 1750c: 91 05 cpc r25, r1 1750e: 20 f0 brcs .+8 ; 0x17518 17510: 50 ec ldi r21, 0xC0 ; 192 17512: 43 e0 ldi r20, 0x03 ; 3 17514: 30 e0 ldi r19, 0x00 ; 0 17516: 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; 17518: d7 01 movw r26, r14 1751a: 94 96 adiw r26, 0x24 ; 36 1751c: 6d 93 st X+, r22 1751e: 7d 93 st X+, r23 17520: 8d 93 st X+, r24 17522: 9c 93 st X, r25 17524: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 17526: f7 01 movw r30, r14 17528: e4 55 subi r30, 0x54 ; 84 1752a: ff 4f sbci r31, 0xFF ; 255 1752c: 50 83 st Z, r21 1752e: 41 83 std Z+1, r20 ; 0x01 17530: 32 83 std Z+2, r19 ; 0x02 17532: 23 83 std Z+3, r18 ; 0x03 17534: b4 e0 ldi r27, 0x04 ; 4 17536: eb 0e add r14, r27 17538: f1 1c adc r15, r1 1753a: 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++) 1753c: 14 30 cpi r17, 0x04 ; 4 1753e: 59 f6 brne .-106 ; 0x174d6 17540: c6 cd rjmp .-1140 ; 0x170ce { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 17542: 56 2f mov r21, r22 17544: 47 2f mov r20, r23 17546: 38 2f mov r19, r24 17548: 29 2f mov r18, r25 1754a: e6 cf rjmp .-52 ; 0x17518 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; 1754c: 50 ec ldi r21, 0xC0 ; 192 1754e: 43 e0 ldi r20, 0x03 ; 3 17550: 30 e0 ldi r19, 0x00 ; 0 17552: 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; 17554: 64 ec ldi r22, 0xC4 ; 196 17556: 79 e0 ldi r23, 0x09 ; 9 17558: 80 e0 ldi r24, 0x00 ; 0 1755a: 90 e0 ldi r25, 0x00 ; 0 1755c: dd cf rjmp .-70 ; 0x17518 1755e: 1d ed ldi r17, 0xDD ; 221 17560: a1 2e mov r10, r17 17562: 12 e0 ldi r17, 0x02 ; 2 17564: b1 2e mov r11, r17 17566: 0c e6 ldi r16, 0x6C ; 108 17568: c0 2e mov r12, r16 1756a: 06 e0 ldi r16, 0x06 ; 6 1756c: d0 2e mov r13, r16 - `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++) 1756e: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 17570: f5 01 movw r30, r10 17572: 81 91 ld r24, Z+ 17574: 5f 01 movw r10, r30 17576: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1757a: 88 23 and r24, r24 1757c: 71 f1 breq .+92 ; 0x175da { float val = code_value(); 1757e: 0e 94 4a 61 call 0xc294 ; 0xc294 17582: 7b 01 movw r14, r22 17584: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 17586: f1 e0 ldi r31, 0x01 ; 1 17588: f9 15 cp r31, r9 1758a: b8 f1 brcs .+110 ; 0x175fa { if (val > NORMAL_MAX_FEEDRATE_XY) 1758c: 20 e0 ldi r18, 0x00 ; 0 1758e: 30 e0 ldi r19, 0x00 ; 0 17590: 48 e4 ldi r20, 0x48 ; 72 17592: 53 e4 ldi r21, 0x43 ; 67 17594: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 17598: 18 16 cp r1, r24 1759a: 44 f1 brlt .+80 ; 0x175ec 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(); 1759c: 5e 2c mov r5, r14 1759e: 6f 2c mov r6, r15 175a0: 70 2e mov r7, r16 175a2: 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) 175a4: 20 e0 ldi r18, 0x00 ; 0 175a6: 30 e0 ldi r19, 0x00 ; 0 175a8: 48 ec ldi r20, 0xC8 ; 200 175aa: 52 e4 ldi r21, 0x42 ; 66 175ac: b7 01 movw r22, r14 175ae: c8 01 movw r24, r16 175b0: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 175b4: 18 16 cp r1, r24 175b6: 34 f1 brlt .+76 ; 0x17604 val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 175b8: 85 2d mov r24, r5 175ba: 96 2d mov r25, r6 175bc: a7 2d mov r26, r7 175be: b8 2d mov r27, r8 175c0: f6 01 movw r30, r12 175c2: 84 8b std Z+20, r24 ; 0x14 175c4: 95 8b std Z+21, r25 ; 0x15 175c6: a6 8b std Z+22, r26 ; 0x16 175c8: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 175ca: c7 01 movw r24, r14 175cc: d8 01 movw r26, r16 175ce: e4 56 subi r30, 0x64 ; 100 175d0: ff 4f sbci r31, 0xFF ; 255 175d2: 80 83 st Z, r24 175d4: 91 83 std Z+1, r25 ; 0x01 175d6: a2 83 std Z+2, r26 ; 0x02 175d8: 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++) 175da: 93 94 inc r9 175dc: f4 e0 ldi r31, 0x04 ; 4 175de: cf 0e add r12, r31 175e0: d1 1c adc r13, r1 175e2: 24 e0 ldi r18, 0x04 ; 4 175e4: 92 12 cpse r9, r18 175e6: c4 cf rjmp .-120 ; 0x17570 175e8: 0c 94 8d b2 jmp 0x1651a ; 0x1651a #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 175ec: 51 2c mov r5, r1 175ee: 61 2c mov r6, r1 175f0: a8 e4 ldi r26, 0x48 ; 72 175f2: 7a 2e mov r7, r26 175f4: b3 e4 ldi r27, 0x43 ; 67 175f6: 8b 2e mov r8, r27 175f8: d5 cf rjmp .-86 ; 0x175a4 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(); 175fa: 56 2e mov r5, r22 175fc: 6f 2c mov r6, r15 175fe: 78 2e mov r7, r24 17600: 81 2e mov r8, r17 17602: da cf rjmp .-76 ; 0x175b8 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; 17604: e1 2c mov r14, r1 17606: f1 2c mov r15, r1 17608: 08 ec ldi r16, 0xC8 ; 200 1760a: 12 e4 ldi r17, 0x42 ; 66 1760c: d5 cf rjmp .-86 ; 0x175b8 // 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')) 1760e: 80 e5 ldi r24, 0x50 ; 80 17610: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17614: 88 23 and r24, r24 17616: 51 f0 breq .+20 ; 0x1762c cs.acceleration = code_value(); 17618: 0e 94 4a 61 call 0xc294 ; 0xc294 1761c: 60 93 a0 06 sts 0x06A0, r22 ; 0x8006a0 17620: 70 93 a1 06 sts 0x06A1, r23 ; 0x8006a1 17624: 80 93 a2 06 sts 0x06A2, r24 ; 0x8006a2 17628: 90 93 a3 06 sts 0x06A3, r25 ; 0x8006a3 if(code_seen('R')) 1762c: 82 e5 ldi r24, 0x52 ; 82 1762e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17632: 88 23 and r24, r24 17634: 51 f0 breq .+20 ; 0x1764a cs.retract_acceleration = code_value(); 17636: 0e 94 4a 61 call 0xc294 ; 0xc294 1763a: 60 93 a4 06 sts 0x06A4, r22 ; 0x8006a4 1763e: 70 93 a5 06 sts 0x06A5, r23 ; 0x8006a5 17642: 80 93 a6 06 sts 0x06A6, r24 ; 0x8006a6 17646: 90 93 a7 06 sts 0x06A7, r25 ; 0x8006a7 if(code_seen('T')) 1764a: 84 e5 ldi r24, 0x54 ; 84 1764c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17650: 88 23 and r24, r24 17652: 11 f4 brne .+4 ; 0x17658 17654: 0c 94 8d b2 jmp 0x1651a ; 0x1651a cs.travel_acceleration = code_value(); 17658: 0e 94 4a 61 call 0xc294 ; 0xc294 1765c: 60 93 2c 07 sts 0x072C, r22 ; 0x80072c 17660: 70 93 2d 07 sts 0x072D, r23 ; 0x80072d 17664: 80 93 2e 07 sts 0x072E, r24 ; 0x80072e 17668: 90 93 2f 07 sts 0x072F, r25 ; 0x80072f 1766c: 0c 94 8d b2 jmp 0x1651a ; 0x1651a - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 17670: 83 e5 ldi r24, 0x53 ; 83 17672: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17676: 88 23 and r24, r24 17678: 51 f0 breq .+20 ; 0x1768e 1767a: 0e 94 4a 61 call 0xc294 ; 0xc294 1767e: 60 93 a8 06 sts 0x06A8, r22 ; 0x8006a8 17682: 70 93 a9 06 sts 0x06A9, r23 ; 0x8006a9 17686: 80 93 aa 06 sts 0x06AA, r24 ; 0x8006aa 1768a: 90 93 ab 06 sts 0x06AB, r25 ; 0x8006ab if(code_seen('T')) cs.mintravelfeedrate = code_value(); 1768e: 84 e5 ldi r24, 0x54 ; 84 17690: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17694: 88 23 and r24, r24 17696: 51 f0 breq .+20 ; 0x176ac 17698: 0e 94 4a 61 call 0xc294 ; 0xc294 1769c: 60 93 ac 06 sts 0x06AC, r22 ; 0x8006ac 176a0: 70 93 ad 06 sts 0x06AD, r23 ; 0x8006ad 176a4: 80 93 ae 06 sts 0x06AE, r24 ; 0x8006ae 176a8: 90 93 af 06 sts 0x06AF, r25 ; 0x8006af if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 176ac: 82 e4 ldi r24, 0x42 ; 66 176ae: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 176b2: 88 23 and r24, r24 176b4: 61 f0 breq .+24 ; 0x176ce 176b6: 0e 94 4a 61 call 0xc294 ; 0xc294 176ba: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 176be: 60 93 b0 06 sts 0x06B0, r22 ; 0x8006b0 176c2: 70 93 b1 06 sts 0x06B1, r23 ; 0x8006b1 176c6: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 176ca: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 176ce: 88 e5 ldi r24, 0x58 ; 88 176d0: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 176d4: 88 23 and r24, r24 176d6: 91 f0 breq .+36 ; 0x176fc 176d8: 0e 94 4a 61 call 0xc294 ; 0xc294 176dc: 60 93 b8 06 sts 0x06B8, r22 ; 0x8006b8 176e0: 70 93 b9 06 sts 0x06B9, r23 ; 0x8006b9 176e4: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 176e8: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb 176ec: 60 93 b4 06 sts 0x06B4, r22 ; 0x8006b4 176f0: 70 93 b5 06 sts 0x06B5, r23 ; 0x8006b5 176f4: 80 93 b6 06 sts 0x06B6, r24 ; 0x8006b6 176f8: 90 93 b7 06 sts 0x06B7, r25 ; 0x8006b7 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 176fc: 89 e5 ldi r24, 0x59 ; 89 176fe: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17702: 88 23 and r24, r24 17704: 51 f0 breq .+20 ; 0x1771a 17706: 0e 94 4a 61 call 0xc294 ; 0xc294 1770a: 60 93 b8 06 sts 0x06B8, r22 ; 0x8006b8 1770e: 70 93 b9 06 sts 0x06B9, r23 ; 0x8006b9 17712: 80 93 ba 06 sts 0x06BA, r24 ; 0x8006ba 17716: 90 93 bb 06 sts 0x06BB, r25 ; 0x8006bb if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 1771a: 8a e5 ldi r24, 0x5A ; 90 1771c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17720: 88 23 and r24, r24 17722: 51 f0 breq .+20 ; 0x17738 17724: 0e 94 4a 61 call 0xc294 ; 0xc294 17728: 60 93 bc 06 sts 0x06BC, r22 ; 0x8006bc 1772c: 70 93 bd 06 sts 0x06BD, r23 ; 0x8006bd 17730: 80 93 be 06 sts 0x06BE, r24 ; 0x8006be 17734: 90 93 bf 06 sts 0x06BF, r25 ; 0x8006bf if(code_seen('E')) 17738: 85 e4 ldi r24, 0x45 ; 69 1773a: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1773e: 88 23 and r24, r24 17740: 11 f4 brne .+4 ; 0x17746 17742: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { float e = code_value(); 17746: 0e 94 4a 61 call 0xc294 ; 0xc294 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 1774a: 0e 94 d5 82 call 0x105aa ; 0x105aa #endif cs.max_jerk[E_AXIS] = e; 1774e: 60 93 c0 06 sts 0x06C0, r22 ; 0x8006c0 17752: 70 93 c1 06 sts 0x06C1, r23 ; 0x8006c1 17756: 80 93 c2 06 sts 0x06C2, r24 ; 0x8006c2 1775a: 90 93 c3 06 sts 0x06C3, r25 ; 0x8006c3 1775e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 17762: 0d ed ldi r16, 0xDD ; 221 17764: 12 e0 ldi r17, 0x02 ; 2 17766: f4 ec ldi r31, 0xC4 ; 196 17768: ef 2e mov r14, r31 1776a: f6 e0 ldi r31, 0x06 ; 6 1776c: ff 2e mov r15, r31 - `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(); 1776e: d8 01 movw r26, r16 17770: 8d 91 ld r24, X+ 17772: 8d 01 movw r16, r26 17774: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17778: 88 23 and r24, r24 1777a: 39 f0 breq .+14 ; 0x1778a 1777c: 0e 94 4a 61 call 0xc294 ; 0xc294 17780: f7 01 movw r30, r14 17782: 60 83 st Z, r22 17784: 71 83 std Z+1, r23 ; 0x01 17786: 82 83 std Z+2, r24 ; 0x02 17788: 93 83 std Z+3, r25 ; 0x03 1778a: f4 e0 ldi r31, 0x04 ; 4 1778c: ef 0e add r14, r31 1778e: 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++) 17790: 22 e0 ldi r18, 0x02 ; 2 17792: 00 3e cpi r16, 0xE0 ; 224 17794: 12 07 cpc r17, r18 17796: 59 f7 brne .-42 ; 0x1776e 17798: 0c 94 8d b2 jmp 0x1651a ; 0x1651a - `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')) 1779c: 83 e5 ldi r24, 0x53 ; 83 1779e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 177a2: 88 23 and r24, r24 177a4: 51 f0 breq .+20 ; 0x177ba { cs.retract_recover_length = code_value() ; 177a6: 0e 94 4a 61 call 0xc294 ; 0xc294 177aa: 60 93 fb 06 sts 0x06FB, r22 ; 0x8006fb 177ae: 70 93 fc 06 sts 0x06FC, r23 ; 0x8006fc 177b2: 80 93 fd 06 sts 0x06FD, r24 ; 0x8006fd 177b6: 90 93 fe 06 sts 0x06FE, r25 ; 0x8006fe } if(code_seen('F')) 177ba: 86 e4 ldi r24, 0x46 ; 70 177bc: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 177c0: 88 23 and r24, r24 177c2: 11 f4 brne .+4 ; 0x177c8 177c4: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 177c8: 0e 94 4a 61 call 0xc294 ; 0xc294 177cc: 0e 94 74 67 call 0xcee8 ; 0xcee8 177d0: 60 93 ff 06 sts 0x06FF, r22 ; 0x8006ff 177d4: 70 93 00 07 sts 0x0700, r23 ; 0x800700 177d8: 80 93 01 07 sts 0x0701, r24 ; 0x800701 177dc: 90 93 02 07 sts 0x0702, r25 ; 0x800702 177e0: 0c 94 8d b2 jmp 0x1651a ; 0x1651a #### 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')) 177e4: 83 e5 ldi r24, 0x53 ; 83 177e6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 177ea: 88 23 and r24, r24 177ec: 11 f4 brne .+4 ; 0x177f2 177ee: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { switch(code_value_uint8()) 177f2: 0e 94 06 5c call 0xb80c ; 0xb80c 177f6: 88 23 and r24, r24 177f8: c1 f0 breq .+48 ; 0x1782a 177fa: 81 30 cpi r24, 0x01 ; 1 177fc: e1 f0 breq .+56 ; 0x17836 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 177fe: 82 ee ldi r24, 0xE2 ; 226 17800: 99 ea ldi r25, 0xA9 ; 169 17802: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 17806: 85 e6 ldi r24, 0x65 ; 101 17808: 98 e6 ldi r25, 0x68 ; 104 1780a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1780e: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 17812: 90 91 6f 12 lds r25, 0x126F ; 0x80126f 17816: 8c 57 subi r24, 0x7C ; 124 17818: 9f 4e sbci r25, 0xEF ; 239 1781a: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_ECHOLNPGM("\"(1)"); 1781e: 88 e9 ldi r24, 0x98 ; 152 17820: 97 e8 ldi r25, 0x87 ; 135 17822: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 17826: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 1782a: 10 92 ee 06 sts 0x06EE, r1 ; 0x8006ee retracted[0]=false; 1782e: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d 17832: 0c 94 8d b2 jmp 0x1651a ; 0x1651a retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 17836: 80 93 ee 06 sts 0x06EE, r24 ; 0x8006ee retracted[0]=false; 1783a: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d 1783e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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; 17842: 40 90 30 07 lds r4, 0x0730 ; 0x800730 17846: 50 90 31 07 lds r5, 0x0731 ; 0x800731 1784a: 60 90 32 07 lds r6, 0x0732 ; 0x800732 1784e: 70 90 33 07 lds r7, 0x0733 ; 0x800733 17852: 0c 94 2c aa jmp 0x15458 ; 0x15458 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 17856: 80 90 34 07 lds r8, 0x0734 ; 0x800734 1785a: 90 90 35 07 lds r9, 0x0735 ; 0x800735 1785e: a0 90 36 07 lds r10, 0x0736 ; 0x800736 17862: b0 90 37 07 lds r11, 0x0737 ; 0x800737 17866: 0c 94 37 aa jmp 0x1546e ; 0x1546e - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 1786a: 82 e4 ldi r24, 0x42 ; 66 1786c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17870: 18 2f mov r17, r24 17872: 88 23 and r24, r24 17874: 41 f0 breq .+16 ; 0x17886 { saved_feedmultiply_mm = feedmultiply; 17876: 80 91 39 02 lds r24, 0x0239 ; 0x800239 1787a: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 1787e: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 17882: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 17886: 83 e5 ldi r24, 0x53 ; 83 17888: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1788c: 08 2f mov r16, r24 1788e: 88 23 and r24, r24 17890: 39 f0 breq .+14 ; 0x178a0 { feedmultiply = code_value_short(); 17892: 0e 94 13 5c call 0xb826 ; 0xb826 17896: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 1789a: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 1789e: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 178a0: 82 e5 ldi r24, 0x52 ; 82 178a2: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 178a6: 88 23 and r24, r24 178a8: 51 f0 breq .+20 ; 0x178be { feedmultiply = saved_feedmultiply_mm; 178aa: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 178ae: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 178b2: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 178b6: 80 93 39 02 sts 0x0239, r24 ; 0x800239 178ba: 0c 94 8d b2 jmp 0x1651a ; 0x1651a codesWereSeen = true; } if (!codesWereSeen) 178be: 11 11 cpse r17, r1 178c0: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { printf_P(PSTR("%i%%\n"), feedmultiply); 178c4: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 178c8: 8f 93 push r24 178ca: 80 91 39 02 lds r24, 0x0239 ; 0x800239 178ce: 8f 93 push r24 178d0: 82 e9 ldi r24, 0x92 ; 146 178d2: 97 e8 ldi r25, 0x87 ; 135 178d4: 9f 93 push r25 178d6: 8f 93 push r24 178d8: 0f 94 4b dc call 0x3b896 ; 0x3b896 178dc: 0f 90 pop r0 178de: 0f 90 pop r0 178e0: 0f 90 pop r0 178e2: 0f 90 pop r0 178e4: 0c 94 8d b2 jmp 0x1651a ; 0x1651a extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 178e8: 80 91 95 02 lds r24, 0x0295 ; 0x800295 178ec: 8f 93 push r24 178ee: 80 91 94 02 lds r24, 0x0294 ; 0x800294 178f2: 8f 93 push r24 178f4: 8c e8 ldi r24, 0x8C ; 140 178f6: 97 e8 ldi r25, 0x87 ; 135 178f8: 9f 93 push r25 178fa: 8f 93 push r24 178fc: 0f 94 4b dc call 0x3b896 ; 0x3b896 17900: 0f 90 pop r0 17902: 0f 90 pop r0 17904: 0f 90 pop r0 17906: 0f 90 pop r0 17908: 0c 94 8d b2 jmp 0x1651a ; 0x1651a - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1790c: 80 e5 ldi r24, 0x50 ; 80 1790e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17912: 88 23 and r24, r24 17914: 11 f4 brne .+4 ; 0x1791a 17916: 0c 94 8d b2 jmp 0x1651a ; 0x1651a int pin_number = code_value_short(); // pin number 1791a: 0e 94 13 5c call 0xb826 ; 0xb826 1791e: 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 17920: 83 e5 ldi r24, 0x53 ; 83 17922: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 17926: 0f ef ldi r16, 0xFF ; 255 17928: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 1792a: 88 23 and r24, r24 1792c: 19 f0 breq .+6 ; 0x17934 1792e: 0e 94 13 5c call 0xb826 ; 0xb826 17932: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 17934: c8 01 movw r24, r16 17936: 01 96 adiw r24, 0x01 ; 1 17938: 03 97 sbiw r24, 0x03 ; 3 1793a: 10 f0 brcs .+4 ; 0x17940 1793c: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 17940: e0 e8 ldi r30, 0x80 ; 128 17942: f8 e8 ldi r31, 0x88 ; 136 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)) 17944: 84 91 lpm r24, Z 17946: 08 2e mov r0, r24 17948: 00 0c add r0, r0 1794a: 99 0b sbc r25, r25 1794c: e8 16 cp r14, r24 1794e: f9 06 cpc r15, r25 17950: 11 f4 brne .+4 ; 0x17956 17952: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 17956: 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++) 17958: 38 e8 ldi r19, 0x88 ; 136 1795a: ec 39 cpi r30, 0x9C ; 156 1795c: f3 07 cpc r31, r19 1795e: 91 f7 brne .-28 ; 0x17944 pin_number = -1; break; } } if (pin_number > -1) 17960: f7 fe sbrs r15, 7 17962: 02 c0 rjmp .+4 ; 0x17968 17964: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { int target = LOW; st_synchronize(); 17968: 0f 94 24 59 call 0x2b248 ; 0x2b248 pinMode(pin_number, INPUT); 1796c: de 2c mov r13, r14 1796e: 60 e0 ldi r22, 0x00 ; 0 17970: 8e 2d mov r24, r14 17972: 0e 94 5c df call 0x1beb8 ; 0x1beb8 switch(pin_state){ 17976: 0f 3f cpi r16, 0xFF ; 255 17978: 10 07 cpc r17, r16 1797a: b1 f0 breq .+44 ; 0x179a8 1797c: 01 30 cpi r16, 0x01 ; 1 1797e: 11 05 cpc r17, r1 17980: 11 f0 breq .+4 ; 0x17986 } } if (pin_number > -1) { int target = LOW; 17982: 10 e0 ldi r17, 0x00 ; 0 17984: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 17986: 8d 2d mov r24, r13 17988: 0e 94 05 df call 0x1be0a ; 0x1be0a 1798c: 80 17 cp r24, r16 1798e: 91 07 cpc r25, r17 17990: 11 f4 brne .+4 ; 0x17996 17992: 0c 94 8d b2 jmp 0x1651a ; 0x1651a manage_heater(); 17996: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(); 1799a: 80 e0 ldi r24, 0x00 ; 0 1799c: 0e 94 da 8b call 0x117b4 ; 0x117b4 lcd_update(0); 179a0: 80 e0 ldi r24, 0x00 ; 0 179a2: 0e 94 54 6f call 0xdea8 ; 0xdea8 179a6: ef cf rjmp .-34 ; 0x17986 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 179a8: 8e 2d mov r24, r14 179aa: 0e 94 05 df call 0x1be0a ; 0x1be0a 179ae: 31 e0 ldi r19, 0x01 ; 1 179b0: 20 e0 ldi r18, 0x00 ; 0 179b2: 89 2b or r24, r25 179b4: 09 f0 breq .+2 ; 0x179b8 179b6: 30 e0 ldi r19, 0x00 ; 0 179b8: 03 2f mov r16, r19 179ba: 12 2f mov r17, r18 179bc: e4 cf rjmp .-56 ; 0x17986 - `S` - frequency in Hz. Not all firmware versions support this parameter - `P` - duration in milliseconds max 3500ms */ case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; 179be: 80 e5 ldi r24, 0x50 ; 80 179c0: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 179c4: 08 ee ldi r16, 0xE8 ; 232 179c6: 13 e0 ldi r17, 0x03 ; 3 179c8: 88 23 and r24, r24 179ca: 89 f0 breq .+34 ; 0x179ee 179cc: 0e 94 4a 61 call 0xc294 ; 0xc294 179d0: 20 e0 ldi r18, 0x00 ; 0 179d2: 30 ec ldi r19, 0xC0 ; 192 179d4: 4a e5 ldi r20, 0x5A ; 90 179d6: 55 e4 ldi r21, 0x45 ; 69 179d8: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 179dc: 0c ea ldi r16, 0xAC ; 172 179de: 1d e0 ldi r17, 0x0D ; 13 179e0: 87 ff sbrs r24, 7 179e2: 05 c0 rjmp .+10 ; 0x179ee 179e4: 0e 94 4a 61 call 0xc294 ; 0xc294 179e8: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 179ec: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 179ee: 83 e5 ldi r24, 0x53 ; 83 179f0: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 179f4: 88 23 and r24, r24 179f6: 71 f0 breq .+28 ; 0x17a14 beepS = 0; else { beepS = code_value(); 179f8: 0e 94 4a 61 call 0xc294 ; 0xc294 179fc: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> if (!beepS) { 17a00: 61 15 cp r22, r1 17a02: 71 05 cpc r23, r1 17a04: 49 f4 brne .+18 ; 0x17a18 // handle S0 as a pause _delay(beepP); 17a06: b8 01 movw r22, r16 17a08: 90 e0 ldi r25, 0x00 ; 0 17a0a: 80 e0 ldi r24, 0x00 ; 0 17a0c: 0f 94 8a 3d call 0x27b14 ; 0x27b14 17a10: 0c 94 8d b2 jmp 0x1651a ; 0x1651a case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 17a14: 70 e0 ldi r23, 0x00 ; 0 17a16: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 17a18: 40 e0 ldi r20, 0x00 ; 0 17a1a: c8 01 movw r24, r16 17a1c: 0f 94 99 6a call 0x2d532 ; 0x2d532 17a20: 0c 94 8d b2 jmp 0x1651a ; 0x1651a - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 17a24: 80 e5 ldi r24, 0x50 ; 80 17a26: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17a2a: 88 23 and r24, r24 17a2c: 51 f0 breq .+20 ; 0x17a42 17a2e: 0e 94 4a 61 call 0xc294 ; 0xc294 17a32: 60 93 e0 06 sts 0x06E0, r22 ; 0x8006e0 17a36: 70 93 e1 06 sts 0x06E1, r23 ; 0x8006e1 17a3a: 80 93 e2 06 sts 0x06E2, r24 ; 0x8006e2 17a3e: 90 93 e3 06 sts 0x06E3, r25 ; 0x8006e3 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 17a42: 89 e4 ldi r24, 0x49 ; 73 17a44: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17a48: 88 23 and r24, r24 17a4a: 81 f0 breq .+32 ; 0x17a6c 17a4c: 0e 94 4a 61 call 0xc294 ; 0xc294 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17a50: 2c ea ldi r18, 0xAC ; 172 17a52: 35 ec ldi r19, 0xC5 ; 197 17a54: 47 e2 ldi r20, 0x27 ; 39 17a56: 5e e3 ldi r21, 0x3E ; 62 17a58: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 17a5c: 60 93 e4 06 sts 0x06E4, r22 ; 0x8006e4 17a60: 70 93 e5 06 sts 0x06E5, r23 ; 0x8006e5 17a64: 80 93 e6 06 sts 0x06E6, r24 ; 0x8006e6 17a68: 90 93 e7 06 sts 0x06E7, r25 ; 0x8006e7 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 17a6c: 84 e4 ldi r24, 0x44 ; 68 17a6e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17a72: 88 23 and r24, r24 17a74: 81 f0 breq .+32 ; 0x17a96 17a76: 0e 94 4a 61 call 0xc294 ; 0xc294 } float unscalePID_i(float i) { return i/PID_dT; 17a7a: 2c ea ldi r18, 0xAC ; 172 17a7c: 35 ec ldi r19, 0xC5 ; 197 17a7e: 47 e2 ldi r20, 0x27 ; 39 17a80: 5e e3 ldi r21, 0x3E ; 62 17a82: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 17a86: 60 93 e8 06 sts 0x06E8, r22 ; 0x8006e8 17a8a: 70 93 e9 06 sts 0x06E9, r23 ; 0x8006e9 17a8e: 80 93 ea 06 sts 0x06EA, r24 ; 0x8006ea 17a92: 90 93 eb 06 sts 0x06EB, r25 ; 0x8006eb updatePID(); 17a96: 0f 94 0f 51 call 0x2a21e ; 0x2a21e SERIAL_PROTOCOLRPGM(MSG_OK); 17a9a: 8a e0 ldi r24, 0x0A ; 10 17a9c: 9e e6 ldi r25, 0x6E ; 110 17a9e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLPGM(" p:"); 17aa2: 8c e7 ldi r24, 0x7C ; 124 17aa4: 97 e8 ldi r25, 0x87 ; 135 17aa6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 17aaa: 60 91 e0 06 lds r22, 0x06E0 ; 0x8006e0 17aae: 70 91 e1 06 lds r23, 0x06E1 ; 0x8006e1 17ab2: 80 91 e2 06 lds r24, 0x06E2 ; 0x8006e2 17ab6: 90 91 e3 06 lds r25, 0x06E3 ; 0x8006e3 17aba: 42 e0 ldi r20, 0x02 ; 2 17abc: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 17ac0: 88 e7 ldi r24, 0x78 ; 120 17ac2: 97 e8 ldi r25, 0x87 ; 135 17ac4: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 17ac8: 2c ea ldi r18, 0xAC ; 172 17aca: 35 ec ldi r19, 0xC5 ; 197 17acc: 47 e2 ldi r20, 0x27 ; 39 17ace: 5e e3 ldi r21, 0x3E ; 62 17ad0: 60 91 e4 06 lds r22, 0x06E4 ; 0x8006e4 17ad4: 70 91 e5 06 lds r23, 0x06E5 ; 0x8006e5 17ad8: 80 91 e6 06 lds r24, 0x06E6 ; 0x8006e6 17adc: 90 91 e7 06 lds r25, 0x06E7 ; 0x8006e7 17ae0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 17ae4: 42 e0 ldi r20, 0x02 ; 2 17ae6: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 17aea: 84 e7 ldi r24, 0x74 ; 116 17aec: 97 e8 ldi r25, 0x87 ; 135 17aee: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17af2: 2c ea ldi r18, 0xAC ; 172 17af4: 35 ec ldi r19, 0xC5 ; 197 17af6: 47 e2 ldi r20, 0x27 ; 39 17af8: 5e e3 ldi r21, 0x3E ; 62 17afa: 60 91 e8 06 lds r22, 0x06E8 ; 0x8006e8 17afe: 70 91 e9 06 lds r23, 0x06E9 ; 0x8006e9 17b02: 80 91 ea 06 lds r24, 0x06EA ; 0x8006ea 17b06: 90 91 eb 06 lds r25, 0x06EB ; 0x8006eb 17b0a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 17b0e: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 17b12: 0c 94 8d b2 jmp 0x1651a ; 0x1651a - `T` - Brightness timeout (15 - 900), default 15 seconds */ #ifdef LCD_BL_PIN case 256: { if (backlightSupport) { 17b16: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 17b1a: 88 23 and r24, r24 17b1c: 11 f4 brne .+4 ; 0x17b22 17b1e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a if (code_seen('B') ) backlightLevel_HIGH = code_value_uint8(); 17b22: 82 e4 ldi r24, 0x42 ; 66 17b24: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17b28: 88 23 and r24, r24 17b2a: 21 f0 breq .+8 ; 0x17b34 17b2c: 0e 94 06 5c call 0xb80c ; 0xb80c 17b30: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb if (code_seen('D')) backlightLevel_LOW = code_value_uint8(); 17b34: 84 e4 ldi r24, 0x44 ; 68 17b36: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17b3a: 88 23 and r24, r24 17b3c: 21 f0 breq .+8 ; 0x17b46 17b3e: 0e 94 06 5c call 0xb80c ; 0xb80c 17b42: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa if (code_seen('S')) { 17b46: 83 e5 ldi r24, 0x53 ; 83 17b48: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17b4c: 88 23 and r24, r24 17b4e: 31 f0 breq .+12 ; 0x17b5c uint8_t mode = code_value_uint8(); 17b50: 0e 94 06 5c call 0xb80c ; 0xb80c if (mode <= BACKLIGHT_MODE_AUTO) { 17b54: 83 30 cpi r24, 0x03 ; 3 17b56: 10 f4 brcc .+4 ; 0x17b5c backlightMode = static_cast(mode); 17b58: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f } } if (code_seen('T')) backlightTimer_period = constrain(code_value_short(), LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); 17b5c: 84 e5 ldi r24, 0x54 ; 84 17b5e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17b62: 88 23 and r24, r24 17b64: 79 f0 breq .+30 ; 0x17b84 17b66: 0e 94 13 5c call 0xb826 ; 0xb826 17b6a: 0f 97 sbiw r24, 0x0f ; 15 17b6c: 64 f1 brlt .+88 ; 0x17bc6 17b6e: 0e 94 13 5c call 0xb826 ; 0xb826 17b72: 85 38 cpi r24, 0x85 ; 133 17b74: 93 40 sbci r25, 0x03 ; 3 17b76: 54 f5 brge .+84 ; 0x17bcc 17b78: 0e 94 13 5c call 0xb826 ; 0xb826 17b7c: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 17b80: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d printf_P(PSTR("M256 B%d D%d S%d T%u\n"), backlightLevel_HIGH, backlightLevel_LOW, backlightMode, backlightTimer_period); 17b84: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17b88: 8f 93 push r24 17b8a: 80 91 4d 02 lds r24, 0x024D ; 0x80024d 17b8e: 8f 93 push r24 17b90: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 17b94: 1f 92 push r1 17b96: 8f 93 push r24 17b98: 80 91 fa 03 lds r24, 0x03FA ; 0x8003fa 17b9c: 1f 92 push r1 17b9e: 8f 93 push r24 17ba0: 80 91 fb 03 lds r24, 0x03FB ; 0x8003fb 17ba4: 1f 92 push r1 17ba6: 8f 93 push r24 17ba8: 8e e5 ldi r24, 0x5E ; 94 17baa: 97 e8 ldi r25, 0x87 ; 135 17bac: 9f 93 push r25 17bae: 8f 93 push r24 17bb0: 0f 94 4b dc call 0x3b896 ; 0x3b896 backlight_save(); 17bb4: 0e 94 5a 8b call 0x116b4 ; 0x116b4 17bb8: 0f b6 in r0, 0x3f ; 63 17bba: f8 94 cli 17bbc: de bf out 0x3e, r29 ; 62 17bbe: 0f be out 0x3f, r0 ; 63 17bc0: cd bf out 0x3d, r28 ; 61 17bc2: 0c 94 8d b2 jmp 0x1651a ; 0x1651a uint8_t mode = code_value_uint8(); if (mode <= BACKLIGHT_MODE_AUTO) { backlightMode = static_cast(mode); } } if (code_seen('T')) backlightTimer_period = constrain(code_value_short(), LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); 17bc6: 8f e0 ldi r24, 0x0F ; 15 17bc8: 90 e0 ldi r25, 0x00 ; 0 17bca: d8 cf rjmp .-80 ; 0x17b7c 17bcc: 84 e8 ldi r24, 0x84 ; 132 17bce: 93 e0 ldi r25, 0x03 ; 3 17bd0: d5 cf rjmp .-86 ; 0x17b7c - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 17bd2: 83 e5 ldi r24, 0x53 ; 83 17bd4: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17bd8: 88 23 and r24, r24 17bda: 41 f0 breq .+16 ; 0x17bec 17bdc: 0e 94 13 5c call 0xb826 ; 0xb826 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 17be0: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 17be4: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 17be8: 0c 94 8d b2 jmp 0x1651a ; 0x1651a #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 17bec: 90 e0 ldi r25, 0x00 ; 0 17bee: 80 e0 ldi r24, 0x00 ; 0 17bf0: f7 cf rjmp .-18 ; 0x17be0 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 17bf2: 85 e4 ldi r24, 0x45 ; 69 17bf4: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 17bf8: 10 e0 ldi r17, 0x00 ; 0 17bfa: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 17bfc: 88 23 and r24, r24 17bfe: 59 f0 breq .+22 ; 0x17c16 17c00: 0e 94 13 5c call 0xb826 ; 0xb826 17c04: 8c 01 movw r16, r24 if (e < 0) temp = 70; 17c06: c1 2c mov r12, r1 17c08: d1 2c mov r13, r1 17c0a: 7c e8 ldi r23, 0x8C ; 140 17c0c: e7 2e mov r14, r23 17c0e: 72 e4 ldi r23, 0x42 ; 66 17c10: 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) 17c12: 97 fd sbrc r25, 7 17c14: 06 c0 rjmp .+12 ; 0x17c22 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 17c16: c1 2c mov r12, r1 17c18: d1 2c mov r13, r1 17c1a: e6 e1 ldi r30, 0x16 ; 22 17c1c: ee 2e mov r14, r30 17c1e: e3 e4 ldi r30, 0x43 ; 67 17c20: 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(); 17c22: 83 e5 ldi r24, 0x53 ; 83 17c24: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17c28: 88 23 and r24, r24 17c2a: 21 f0 breq .+8 ; 0x17c34 17c2c: 0e 94 4a 61 call 0xc294 ; 0xc294 17c30: 6b 01 movw r12, r22 17c32: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 17c34: 83 e4 ldi r24, 0x43 ; 67 17c36: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 17c3a: 88 23 and r24, r24 17c3c: 51 f0 breq .+20 ; 0x17c52 17c3e: 0e 94 13 5c call 0xb826 ; 0xb826 PID_autotune(temp, e, c); 17c42: 9c 01 movw r18, r24 17c44: a8 01 movw r20, r16 17c46: c7 01 movw r24, r14 17c48: b6 01 movw r22, r12 17c4a: 0f 94 3c 51 call 0x2a278 ; 0x2a278 17c4e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a */ case 303: { float temp = 150.0; int e = 0; int c = 5; 17c52: 85 e0 ldi r24, 0x05 ; 5 17c54: 90 e0 ldi r25, 0x00 ; 0 17c56: f5 cf rjmp .-22 ; 0x17c42 */ 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; 17c58: 9f ef ldi r25, 0xFF ; 255 17c5a: ab 96 adiw r28, 0x2b ; 43 17c5c: 9f af std Y+63, r25 ; 0x3f 17c5e: ab 97 sbiw r28, 0x2b ; 43 17c60: 0c 94 62 ab jmp 0x156c4 ; 0x156c4 - `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; 17c64: 20 e0 ldi r18, 0x00 ; 0 17c66: 30 e0 ldi r19, 0x00 ; 0 17c68: 40 ec ldi r20, 0xC0 ; 192 17c6a: 5f e7 ldi r21, 0x7F ; 127 17c6c: e2 96 adiw r28, 0x32 ; 50 17c6e: 2c af std Y+60, r18 ; 0x3c 17c70: 3d af std Y+61, r19 ; 0x3d 17c72: 4e af std Y+62, r20 ; 0x3e 17c74: 5f af std Y+63, r21 ; 0x3f 17c76: e2 97 sbiw r28, 0x32 ; 50 17c78: 0c 94 71 ab jmp 0x156e2 ; 0x156e2 17c7c: 80 e0 ldi r24, 0x00 ; 0 17c7e: 90 e0 ldi r25, 0x00 ; 0 17c80: a0 ec ldi r26, 0xC0 ; 192 17c82: bf e7 ldi r27, 0x7F ; 127 17c84: 6e 96 adiw r28, 0x1e ; 30 17c86: 8c af std Y+60, r24 ; 0x3c 17c88: 9d af std Y+61, r25 ; 0x3d 17c8a: ae af std Y+62, r26 ; 0x3e 17c8c: bf af std Y+63, r27 ; 0x3f 17c8e: 6e 97 sbiw r28, 0x1e ; 30 17c90: 0c 94 8f ab jmp 0x1571e ; 0x1571e 17c94: 20 e0 ldi r18, 0x00 ; 0 17c96: 30 e0 ldi r19, 0x00 ; 0 17c98: 40 ec ldi r20, 0xC0 ; 192 17c9a: 5f e7 ldi r21, 0x7F ; 127 17c9c: a2 96 adiw r28, 0x22 ; 34 17c9e: 2c af std Y+60, r18 ; 0x3c 17ca0: 3d af std Y+61, r19 ; 0x3d 17ca2: 4e af std Y+62, r20 ; 0x3e 17ca4: 5f af std Y+63, r21 ; 0x3f 17ca6: a2 97 sbiw r28, 0x22 ; 34 17ca8: 0c 94 9e ab jmp 0x1573c ; 0x1573c 17cac: 80 e0 ldi r24, 0x00 ; 0 17cae: 90 e0 ldi r25, 0x00 ; 0 17cb0: a0 ec ldi r26, 0xC0 ; 192 17cb2: bf e7 ldi r27, 0x7F ; 127 17cb4: 6a 96 adiw r28, 0x1a ; 26 17cb6: 8c af std Y+60, r24 ; 0x3c 17cb8: 9d af std Y+61, r25 ; 0x3d 17cba: ae af std Y+62, r26 ; 0x3e 17cbc: bf af std Y+63, r27 ; 0x3f 17cbe: 6a 97 sbiw r28, 0x1a ; 26 17cc0: 0c 94 ad ab jmp 0x1575a ; 0x1575a 17cc4: 20 e0 ldi r18, 0x00 ; 0 17cc6: 30 e0 ldi r19, 0x00 ; 0 17cc8: 40 ec ldi r20, 0xC0 ; 192 17cca: 5f e7 ldi r21, 0x7F ; 127 17ccc: aa 96 adiw r28, 0x2a ; 42 17cce: 2c af std Y+60, r18 ; 0x3c 17cd0: 3d af std Y+61, r19 ; 0x3d 17cd2: 4e af std Y+62, r20 ; 0x3e 17cd4: 5f af std Y+63, r21 ; 0x3f 17cd6: aa 97 sbiw r28, 0x2a ; 42 17cd8: 0c 94 bc ab jmp 0x15778 ; 0x15778 int8_t I = -1, S = -1, B = -1, F = -1; 17cdc: 3f ef ldi r19, 0xFF ; 255 17cde: e3 96 adiw r28, 0x33 ; 51 17ce0: 3f af std Y+63, r19 ; 0x3f 17ce2: e3 97 sbiw r28, 0x33 ; 51 17ce4: 0c 94 d2 ab jmp 0x157a4 ; 0x157a4 17ce8: 4f ef ldi r20, 0xFF ; 255 17cea: e7 96 adiw r28, 0x37 ; 55 17cec: 4f af std Y+63, r20 ; 0x3f 17cee: e7 97 sbiw r28, 0x37 ; 55 17cf0: 0c 94 de ab jmp 0x157bc ; 0x157bc - `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; 17cf4: 80 e0 ldi r24, 0x00 ; 0 17cf6: 90 e0 ldi r25, 0x00 ; 0 17cf8: a0 ec ldi r26, 0xC0 ; 192 17cfa: bf e7 ldi r27, 0x7F ; 127 17cfc: a6 96 adiw r28, 0x26 ; 38 17cfe: 8c af std Y+60, r24 ; 0x3c 17d00: 9d af std Y+61, r25 ; 0x3d 17d02: ae af std Y+62, r26 ; 0x3e 17d04: bf af std Y+63, r27 ; 0x3f 17d06: a6 97 sbiw r28, 0x26 ; 38 17d08: 0c 94 ed ab jmp 0x157da ; 0x157da int8_t I = -1, S = -1, B = -1, F = -1; 17d0c: 9f ef ldi r25, 0xFF ; 255 17d0e: eb 96 adiw r28, 0x3b ; 59 17d10: 9f af std Y+63, r25 ; 0x3f 17d12: eb 97 sbiw r28, 0x3b ; 59 17d14: 0c 94 22 ac jmp 0x15844 ; 0x15844 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(); 17d18: 0f 94 f8 43 call 0x287f0 ; 0x287f0 17d1c: 0c 94 8d b2 jmp 0x1651a ; 0x1651a break; } // update all parameters if(B >= 0) 17d20: e7 96 adiw r28, 0x37 ; 55 17d22: ff ad ldd r31, Y+63 ; 0x3f 17d24: e7 97 sbiw r28, 0x37 ; 55 17d26: f7 fd sbrc r31, 7 17d28: 09 c0 rjmp .+18 ; 0x17d3c thermal_model_set_warn_beep(B); 17d2a: 81 e0 ldi r24, 0x01 ; 1 17d2c: e7 96 adiw r28, 0x37 ; 55 17d2e: 2f ad ldd r18, Y+63 ; 0x3f 17d30: e7 97 sbiw r28, 0x37 ; 55 17d32: 21 11 cpse r18, r1 17d34: 01 c0 rjmp .+2 ; 0x17d38 17d36: 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; 17d38: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> if(!isnan(P) || !isnan(U) || !isnan(V) || !isnan(C) || !isnan(D) || (L >= 0) || !isnan(T) || !isnan(W) || !isnan(E)) 17d3c: a7 01 movw r20, r14 17d3e: 96 01 movw r18, r12 17d40: c7 01 movw r24, r14 17d42: b6 01 movw r22, r12 17d44: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17d48: 88 23 and r24, r24 17d4a: 11 f4 brne .+4 ; 0x17d50 17d4c: 0c 94 b1 ac jmp 0x15962 ; 0x15962 17d50: 6e 96 adiw r28, 0x1e ; 30 17d52: 2c ad ldd r18, Y+60 ; 0x3c 17d54: 3d ad ldd r19, Y+61 ; 0x3d 17d56: 4e ad ldd r20, Y+62 ; 0x3e 17d58: 5f ad ldd r21, Y+63 ; 0x3f 17d5a: 6e 97 sbiw r28, 0x1e ; 30 17d5c: ca 01 movw r24, r20 17d5e: b9 01 movw r22, r18 17d60: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17d64: 88 23 and r24, r24 17d66: 11 f4 brne .+4 ; 0x17d6c 17d68: 0c 94 b1 ac jmp 0x15962 ; 0x15962 17d6c: a2 96 adiw r28, 0x22 ; 34 17d6e: 2c ad ldd r18, Y+60 ; 0x3c 17d70: 3d ad ldd r19, Y+61 ; 0x3d 17d72: 4e ad ldd r20, Y+62 ; 0x3e 17d74: 5f ad ldd r21, Y+63 ; 0x3f 17d76: a2 97 sbiw r28, 0x22 ; 34 17d78: ca 01 movw r24, r20 17d7a: b9 01 movw r22, r18 17d7c: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17d80: 88 23 and r24, r24 17d82: 11 f4 brne .+4 ; 0x17d88 17d84: 0c 94 b1 ac jmp 0x15962 ; 0x15962 17d88: 6a 96 adiw r28, 0x1a ; 26 17d8a: 2c ad ldd r18, Y+60 ; 0x3c 17d8c: 3d ad ldd r19, Y+61 ; 0x3d 17d8e: 4e ad ldd r20, Y+62 ; 0x3e 17d90: 5f ad ldd r21, Y+63 ; 0x3f 17d92: 6a 97 sbiw r28, 0x1a ; 26 17d94: ca 01 movw r24, r20 17d96: b9 01 movw r22, r18 17d98: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17d9c: 88 23 and r24, r24 17d9e: 11 f4 brne .+4 ; 0x17da4 17da0: 0c 94 b1 ac jmp 0x15962 ; 0x15962 17da4: aa 96 adiw r28, 0x2a ; 42 17da6: 2c ad ldd r18, Y+60 ; 0x3c 17da8: 3d ad ldd r19, Y+61 ; 0x3d 17daa: 4e ad ldd r20, Y+62 ; 0x3e 17dac: 5f ad ldd r21, Y+63 ; 0x3f 17dae: aa 97 sbiw r28, 0x2a ; 42 17db0: ca 01 movw r24, r20 17db2: b9 01 movw r22, r18 17db4: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17db8: 88 23 and r24, r24 17dba: 11 f4 brne .+4 ; 0x17dc0 17dbc: 0c 94 b1 ac jmp 0x15962 ; 0x15962 17dc0: 17 fd sbrc r17, 7 17dc2: 02 c0 rjmp .+4 ; 0x17dc8 17dc4: 0c 94 71 cf jmp 0x19ee2 ; 0x19ee2 17dc8: a6 96 adiw r28, 0x26 ; 38 17dca: 2c ad ldd r18, Y+60 ; 0x3c 17dcc: 3d ad ldd r19, Y+61 ; 0x3d 17dce: 4e ad ldd r20, Y+62 ; 0x3e 17dd0: 5f ad ldd r21, Y+63 ; 0x3f 17dd2: a6 97 sbiw r28, 0x26 ; 38 17dd4: ca 01 movw r24, r20 17dd6: b9 01 movw r22, r18 17dd8: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17ddc: 88 23 and r24, r24 17dde: 11 f4 brne .+4 ; 0x17de4 17de0: 0c 94 b1 ac jmp 0x15962 ; 0x15962 17de4: a5 01 movw r20, r10 17de6: 94 01 movw r18, r8 17de8: c5 01 movw r24, r10 17dea: b4 01 movw r22, r8 17dec: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17df0: 88 23 and r24, r24 17df2: 11 f4 brne .+4 ; 0x17df8 17df4: 0c 94 b1 ac jmp 0x15962 ; 0x15962 17df8: a3 01 movw r20, r6 17dfa: 92 01 movw r18, r4 17dfc: c3 01 movw r24, r6 17dfe: b2 01 movw r22, r4 17e00: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17e04: 88 23 and r24, r24 17e06: 11 f4 brne .+4 ; 0x17e0c 17e08: 0c 94 b1 ac jmp 0x15962 ; 0x15962 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 17e0c: ab 96 adiw r28, 0x2b ; 43 17e0e: 9f ad ldd r25, Y+63 ; 0x3f 17e10: ab 97 sbiw r28, 0x2b ; 43 17e12: 97 fd sbrc r25, 7 17e14: 3b c0 rjmp .+118 ; 0x17e8c 17e16: e2 96 adiw r28, 0x32 ; 50 17e18: 2c ad ldd r18, Y+60 ; 0x3c 17e1a: 3d ad ldd r19, Y+61 ; 0x3d 17e1c: 4e ad ldd r20, Y+62 ; 0x3e 17e1e: 5f ad ldd r21, Y+63 ; 0x3f 17e20: e2 97 sbiw r28, 0x32 ; 50 17e22: ca 01 movw r24, r20 17e24: b9 01 movw r22, r18 17e26: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 17e2a: 81 11 cpse r24, r1 17e2c: 2f c0 rjmp .+94 ; 0x17e8c thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 17e2e: ab 96 adiw r28, 0x2b ; 43 17e30: af ad ldd r26, Y+63 ; 0x3f 17e32: ab 97 sbiw r28, 0x2b ; 43 17e34: a0 31 cpi r26, 0x10 ; 16 17e36: 54 f5 brge .+84 ; 0x17e8c 17e38: 20 e0 ldi r18, 0x00 ; 0 17e3a: 30 e0 ldi r19, 0x00 ; 0 17e3c: a9 01 movw r20, r18 17e3e: e2 96 adiw r28, 0x32 ; 50 17e40: 6c ad ldd r22, Y+60 ; 0x3c 17e42: 7d ad ldd r23, Y+61 ; 0x3d 17e44: 8e ad ldd r24, Y+62 ; 0x3e 17e46: 9f ad ldd r25, Y+63 ; 0x3f 17e48: e2 97 sbiw r28, 0x32 ; 50 17e4a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 17e4e: 18 16 cp r1, r24 17e50: ec f4 brge .+58 ; 0x17e8c return; TempMgrGuard temp_mgr_guard; 17e52: ce 01 movw r24, r28 17e54: 01 96 adiw r24, 0x01 ; 1 17e56: 0f 94 d6 47 call 0x28fac ; 0x28fac thermal_model::data.R[index] = R; 17e5a: ab 96 adiw r28, 0x2b ; 43 17e5c: bf ad ldd r27, Y+63 ; 0x3f 17e5e: ab 97 sbiw r28, 0x2b ; 43 17e60: 24 e0 ldi r18, 0x04 ; 4 17e62: b2 02 muls r27, r18 17e64: f0 01 movw r30, r0 17e66: 11 24 eor r1, r1 17e68: e4 53 subi r30, 0x34 ; 52 17e6a: fd 4e sbci r31, 0xED ; 237 17e6c: e2 96 adiw r28, 0x32 ; 50 17e6e: 8c ad ldd r24, Y+60 ; 0x3c 17e70: 9d ad ldd r25, Y+61 ; 0x3d 17e72: ae ad ldd r26, Y+62 ; 0x3e 17e74: bf ad ldd r27, Y+63 ; 0x3f 17e76: e2 97 sbiw r28, 0x32 ; 50 17e78: 80 83 st Z, r24 17e7a: 91 83 std Z+1, r25 ; 0x01 17e7c: a2 83 std Z+2, r26 ; 0x02 17e7e: b3 83 std Z+3, r27 ; 0x03 thermal_model::setup(); 17e80: 0f 94 40 45 call 0x28a80 ; 0x28a80 void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 17e84: ce 01 movw r24, r28 17e86: 01 96 adiw r24, 0x01 ; 1 17e88: 0f 94 c9 47 call 0x28f92 ; 0x28f92 thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17e8c: e3 96 adiw r28, 0x33 ; 51 17e8e: 9f ad ldd r25, Y+63 ; 0x3f 17e90: e3 97 sbiw r28, 0x33 ; 51 17e92: 97 fd sbrc r25, 7 17e94: 06 c0 rjmp .+12 ; 0x17ea2 17e96: 81 e0 ldi r24, 0x01 ; 1 17e98: 91 11 cpse r25, r1 17e9a: 01 c0 rjmp .+2 ; 0x17e9e 17e9c: 80 e0 ldi r24, 0x00 ; 0 17e9e: 0f 94 79 48 call 0x290f2 ; 0x290f2 // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 17ea2: 37 fe sbrs r3, 7 17ea4: 02 c0 rjmp .+4 ; 0x17eaa 17ea6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 17eaa: 11 e0 ldi r17, 0x01 ; 1 17eac: eb 96 adiw r28, 0x3b ; 59 17eae: af ad ldd r26, Y+63 ; 0x3f 17eb0: eb 97 sbiw r28, 0x3b ; 59 17eb2: 1a 16 cp r1, r26 17eb4: 0c f0 brlt .+2 ; 0x17eb8 17eb6: 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; 17eb8: 81 e0 ldi r24, 0x01 ; 1 17eba: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> } //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); 17ebe: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 17ec2: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 17ec6: 89 1b sub r24, r25 17ec8: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 17eca: 41 f4 brne .+16 ; 0x17edc 17ecc: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 17ed0: 85 30 cpi r24, 0x05 ; 5 17ed2: 79 f1 breq .+94 ; 0x17f32 17ed4: 0e 94 8e 68 call 0xd11c ; 0xd11c 17ed8: 88 23 and r24, r24 17eda: 59 f1 breq .+86 ; 0x17f32 sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 17edc: 8a e4 ldi r24, 0x4A ; 74 17ede: 95 e8 ldi r25, 0x85 ; 133 17ee0: 9f 93 push r25 17ee2: 8f 93 push r24 17ee4: e1 e0 ldi r30, 0x01 ; 1 17ee6: f0 e0 ldi r31, 0x00 ; 0 17ee8: ec 0f add r30, r28 17eea: fd 1f adc r31, r29 17eec: ff 93 push r31 17eee: ef 93 push r30 17ef0: 0f 94 a0 dc call 0x3b940 ; 0x3b940 lcd_setstatus_serial(tm_message); 17ef4: ce 01 movw r24, r28 17ef6: 01 96 adiw r24, 0x01 ; 1 17ef8: 0f 94 d1 0b call 0x217a2 ; 0x217a2 return; 17efc: 0f 90 pop r0 17efe: 0f 90 pop r0 17f00: 0f 90 pop r0 17f02: 0f 90 pop r0 17f04: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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; 17f08: 20 e0 ldi r18, 0x00 ; 0 17f0a: 30 e0 ldi r19, 0x00 ; 0 17f0c: a9 01 movw r20, r18 17f0e: c7 01 movw r24, r14 17f10: b6 01 movw r22, r12 17f12: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 17f16: 18 16 cp r1, r24 17f18: 14 f0 brlt .+4 ; 0x17f1e 17f1a: 0c 94 bf ac jmp 0x1597e ; 0x1597e 17f1e: c0 92 b6 12 sts 0x12B6, r12 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 17f22: d0 92 b7 12 sts 0x12B7, r13 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 17f26: e0 92 b8 12 sts 0x12B8, r14 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 17f2a: f0 92 b9 12 sts 0x12B9, r15 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 17f2e: 0c 94 bf ac jmp 0x1597e ; 0x1597e lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 17f32: 83 e0 ldi r24, 0x03 ; 3 17f34: 80 93 96 02 sts 0x0296, r24 ; 0x800296 menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 17f38: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 17f3c: 82 60 ori r24, 0x02 ; 2 17f3e: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 lcd_return_to_status(); 17f42: 0f 94 4b 27 call 0x24e96 ; 0x24e96 // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 17f46: 20 91 c2 12 lds r18, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 17f4a: 30 91 c3 12 lds r19, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 17f4e: 40 91 c4 12 lds r20, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 17f52: 50 91 c5 12 lds r21, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 17f56: 6e 96 adiw r28, 0x1e ; 30 17f58: 2c af std Y+60, r18 ; 0x3c 17f5a: 3d af std Y+61, r19 ; 0x3d 17f5c: 4e af std Y+62, r20 ; 0x3e 17f5e: 5f af std Y+63, r21 ; 0x3f 17f60: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 17f62: 80 e4 ldi r24, 0x40 ; 64 17f64: ec ec ldi r30, 0xCC ; 204 17f66: f2 e1 ldi r31, 0x12 ; 18 17f68: de 01 movw r26, r28 17f6a: 11 96 adiw r26, 0x01 ; 1 17f6c: 01 90 ld r0, Z+ 17f6e: 0d 92 st X+, r0 17f70: 8a 95 dec r24 17f72: e1 f7 brne .-8 ; 0x17f6c orig_enabled = thermal_model::enabled; 17f74: 30 91 1e 05 lds r19, 0x051E ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> 17f78: 67 96 adiw r28, 0x17 ; 23 17f7a: 3f af std Y+63, r19 ; 0x3f 17f7c: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 17f7e: 81 2f mov r24, r17 17f80: 0f 94 9b 48 call 0x29136 ; 0x29136 // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 17f84: 84 e3 ldi r24, 0x34 ; 52 17f86: 95 e8 ldi r25, 0x85 ; 133 17f88: 0e 94 fe 7a call 0xf5fc ; 0xf5fc thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17f8c: 21 14 cp r2, r1 17f8e: 31 04 cpc r3, r1 17f90: 19 f4 brne .+6 ; 0x17f98 17f92: 26 ee ldi r18, 0xE6 ; 230 17f94: 22 2e mov r2, r18 17f96: 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); 17f98: 80 e0 ldi r24, 0x00 ; 0 17f9a: 0f 94 ee 43 call 0x287dc ; 0x287dc 17f9e: 82 e0 ldi r24, 0x02 ; 2 17fa0: 48 2e mov r4, r24 17fa2: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 17fa4: 98 e1 ldi r25, 0x18 ; 24 17fa6: 69 2e mov r6, r25 17fa8: 95 e8 ldi r25, 0x85 ; 133 17faa: 79 2e mov r7, r25 17fac: ae 01 movw r20, r28 17fae: 4f 5b subi r20, 0xBF ; 191 17fb0: 5f 4f sbci r21, 0xFF ; 255 17fb2: 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); 17fb4: 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; 17fb6: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 17fba: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 17fbe: 20 e0 ldi r18, 0x00 ; 0 17fc0: 30 e0 ldi r19, 0x00 ; 0 17fc2: 48 e4 ldi r20, 0x48 ; 72 17fc4: 52 e4 ldi r21, 0x42 ; 66 17fc6: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 17fca: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 17fce: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 17fd2: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 17fd6: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 17fda: 87 fd sbrc r24, 7 17fdc: 58 c0 rjmp .+176 ; 0x1808e sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 17fde: 1f 92 push r1 17fe0: 1f 93 push r17 17fe2: 8e ef ldi r24, 0xFE ; 254 17fe4: 94 e8 ldi r25, 0x84 ; 132 17fe6: 9f 93 push r25 17fe8: 8f 93 push r24 17fea: 9f 92 push r9 17fec: 8f 92 push r8 17fee: 0f 94 a0 dc call 0x3b940 ; 0x3b940 lcd_setstatus_serial(tm_message); 17ff2: c4 01 movw r24, r8 17ff4: 0f 94 d1 0b call 0x217a2 ; 0x217a2 } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 17ff8: 00 91 e1 03 lds r16, 0x03E1 ; 0x8003e1 set_fan_speed(255); 17ffc: 8f ef ldi r24, 0xFF ; 255 17ffe: 0f 94 ee 43 call 0x287dc ; 0x287dc 18002: 0f 90 pop r0 18004: 0f 90 pop r0 18006: 0f 90 pop r0 18008: 0f 90 pop r0 1800a: 0f 90 pop r0 1800c: 0f 90 pop r0 while(current_temperature[0] >= temp) { 1800e: c0 90 5f 0e lds r12, 0x0E5F ; 0x800e5f 18012: d0 90 60 0e lds r13, 0x0E60 ; 0x800e60 18016: e0 90 61 0e lds r14, 0x0E61 ; 0x800e61 1801a: f0 90 62 0e lds r15, 0x0E62 ; 0x800e62 1801e: 20 e0 ldi r18, 0x00 ; 0 18020: 30 e0 ldi r19, 0x00 ; 0 18022: 48 e4 ldi r20, 0x48 ; 72 18024: 52 e4 ldi r21, 0x42 ; 66 18026: c7 01 movw r24, r14 18028: b6 01 movw r22, r12 1802a: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1802e: 87 fd sbrc r24, 7 18030: 27 c0 rjmp .+78 ; 0x18080 if(temp_error_state.v) break; 18032: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 18036: 81 11 cpse r24, r1 18038: 23 c0 rjmp .+70 ; 0x18080 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 1803a: 20 91 51 06 lds r18, 0x0651 ; 0x800651 1803e: 30 91 52 06 lds r19, 0x0652 ; 0x800652 18042: 40 91 53 06 lds r20, 0x0653 ; 0x800653 18046: 50 91 54 06 lds r21, 0x0654 ; 0x800654 1804a: 60 91 0c 13 lds r22, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 1804e: 70 91 0d 13 lds r23, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 18052: 80 91 0e 13 lds r24, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 18056: 90 91 0f 13 lds r25, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1805a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 1805e: 20 e0 ldi r18, 0x00 ; 0 18060: 30 e0 ldi r19, 0x00 ; 0 18062: 40 ea ldi r20, 0xA0 ; 160 18064: 50 e4 ldi r21, 0x40 ; 64 18066: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1806a: 9b 01 movw r18, r22 1806c: ac 01 movw r20, r24 1806e: c7 01 movw r24, r14 18070: b6 01 movw r22, r12 18072: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 18076: 87 fd sbrc r24, 7 18078: 03 c0 rjmp .+6 ; 0x18080 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 1807a: 0f 94 c0 50 call 0x2a180 ; 0x2a180 1807e: c7 cf rjmp .-114 ; 0x1800e } set_fan_speed(old_speed); 18080: 80 2f mov r24, r16 18082: 0f 94 ee 43 call 0x287dc ; 0x287dc 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); 18086: 80 e1 ldi r24, 0x10 ; 16 18088: 97 e2 ldi r25, 0x27 ; 39 1808a: 0f 94 ed 50 call 0x2a1da ; 0x2a1da } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 1808e: 7f 92 push r7 18090: 6f 92 push r6 18092: e0 ef ldi r30, 0xF0 ; 240 18094: f4 e8 ldi r31, 0x84 ; 132 18096: ff 93 push r31 18098: ef 93 push r30 1809a: 9f 92 push r9 1809c: 8f 92 push r8 1809e: 0f 94 a0 dc call 0x3b940 ; 0x3b940 lcd_setstatus_serial(tm_message); 180a2: c4 01 movw r24, r8 180a4: 0f 94 d1 0b call 0x217a2 ; 0x217a2 target_temperature[0] = cal_temp; 180a8: 30 92 6c 0e sts 0x0E6C, r3 ; 0x800e6c 180ac: 20 92 6b 0e sts 0x0E6B, r2 ; 0x800e6b samples = record(); 180b0: 0f 94 01 1e call 0x23c02 ; 0x23c02 180b4: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 180b6: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 180ba: 0f 90 pop r0 180bc: 0f 90 pop r0 180be: 0f 90 pop r0 180c0: 0f 90 pop r0 180c2: 0f 90 pop r0 180c4: 0f 90 pop r0 180c6: 81 11 cpse r24, r1 180c8: 7a c0 rjmp .+244 ; 0x181be 180ca: a1 14 cp r10, r1 180cc: b1 04 cpc r11, r1 180ce: 09 f4 brne .+2 ; 0x180d2 180d0: 76 c0 rjmp .+236 ; 0x181be return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 180d2: 60 91 cc 12 lds r22, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 180d6: 70 91 cd 12 lds r23, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 180da: 80 91 ce 12 lds r24, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 180de: 90 91 cf 12 lds r25, 0x12CF ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> 180e2: 9b 01 movw r18, r22 180e4: ac 01 movw r20, r24 180e6: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 180ea: 88 23 and r24, r24 180ec: 61 f0 breq .+24 ; 0x18106 thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 180ee: 80 e0 ldi r24, 0x00 ; 0 180f0: 90 e0 ldi r25, 0x00 ; 0 180f2: a8 e4 ldi r26, 0x48 ; 72 180f4: b2 e4 ldi r27, 0x42 ; 66 180f6: 80 93 cc 12 sts 0x12CC, r24 ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 180fa: 90 93 cd 12 sts 0x12CD, r25 ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 180fe: a0 93 ce 12 sts 0x12CE, r26 ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 18102: b0 93 cf 12 sts 0x12CF, r27 ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> e = estimate(samples, &thermal_model::data.C, 18106: c0 90 51 06 lds r12, 0x0651 ; 0x800651 1810a: d0 90 52 06 lds r13, 0x0652 ; 0x800652 1810e: e0 90 53 06 lds r14, 0x0653 ; 0x800653 18112: f0 90 54 06 lds r15, 0x0654 ; 0x800654 18116: 00 e0 ldi r16, 0x00 ; 0 18118: 20 e0 ldi r18, 0x00 ; 0 1811a: 30 e0 ldi r19, 0x00 ; 0 1811c: 40 ea ldi r20, 0xA0 ; 160 1811e: 51 e4 ldi r21, 0x41 ; 65 18120: 62 ec ldi r22, 0xC2 ; 194 18122: 72 e1 ldi r23, 0x12 ; 18 18124: c5 01 movw r24, r10 18126: 0e 94 2e dd call 0x1ba5c ; 0x1ba5c 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)) 1812a: 9b 01 movw r18, r22 1812c: ac 01 movw r20, r24 1812e: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 18132: 81 11 cpse r24, r1 18134: 44 c0 rjmp .+136 ; 0x181be return true; wait_temp(); 18136: 0f 94 cb 50 call 0x2a196 ; 0x2a196 if(i) break; // we don't need to refine R 1813a: 4a 94 dec r4 1813c: 45 28 or r4, r5 1813e: 09 f4 brne .+2 ; 0x18142 18140: 85 c0 rjmp .+266 ; 0x1824c wait(30000); // settle PID regulation 18142: 80 e3 ldi r24, 0x30 ; 48 18144: 95 e7 ldi r25, 0x75 ; 117 18146: 0f 94 ed 50 call 0x2a1da ; 0x2a1da sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 1814a: 3f 92 push r3 1814c: 2f 92 push r2 1814e: 7f 92 push r7 18150: 6f 92 push r6 18152: 43 ee ldi r20, 0xE3 ; 227 18154: 54 e8 ldi r21, 0x84 ; 132 18156: 5f 93 push r21 18158: 4f 93 push r20 1815a: 9f 92 push r9 1815c: 8f 92 push r8 1815e: 0f 94 a0 dc call 0x3b940 ; 0x3b940 lcd_setstatus_serial(tm_message); 18162: c4 01 movw r24, r8 18164: 0f 94 d1 0b call 0x217a2 ; 0x217a2 samples = record(); 18168: 0f 94 01 1e call 0x23c02 ; 0x23c02 if(temp_error_state.v || !samples) 1816c: 20 91 1c 05 lds r18, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 18170: 0f b6 in r0, 0x3f ; 63 18172: f8 94 cli 18174: de bf out 0x3e, r29 ; 62 18176: 0f be out 0x3f, r0 ; 63 18178: cd bf out 0x3d, r28 ; 61 1817a: 21 11 cpse r18, r1 1817c: 20 c0 rjmp .+64 ; 0x181be 1817e: 00 97 sbiw r24, 0x00 ; 0 18180: f1 f0 breq .+60 ; 0x181be return true; e = estimate(samples, &thermal_model::data.R[0], 18182: c0 90 51 06 lds r12, 0x0651 ; 0x800651 18186: d0 90 52 06 lds r13, 0x0652 ; 0x800652 1818a: e0 90 53 06 lds r14, 0x0653 ; 0x800653 1818e: f0 90 54 06 lds r15, 0x0654 ; 0x800654 18192: 20 e0 ldi r18, 0x00 ; 0 18194: 30 e0 ldi r19, 0x00 ; 0 18196: 48 e4 ldi r20, 0x48 ; 72 18198: 52 e4 ldi r21, 0x42 ; 66 1819a: 6c ec ldi r22, 0xCC ; 204 1819c: 72 e1 ldi r23, 0x12 ; 18 1819e: 0e 94 2e dd call 0x1ba5c ; 0x1ba5c // 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")); 181a2: b1 e1 ldi r27, 0x11 ; 17 181a4: 6b 2e mov r6, r27 181a6: b5 e8 ldi r27, 0x85 ; 133 181a8: 7b 2e mov r7, r27 181aa: 44 24 eor r4, r4 181ac: 43 94 inc r4 181ae: 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)) 181b0: 9b 01 movw r18, r22 181b2: ac 01 movw r20, r24 181b4: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 181b8: 88 23 and r24, r24 181ba: 09 f4 brne .+2 ; 0x181be 181bc: fc ce rjmp .-520 ; 0x17fb6 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; 181be: 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); 181c0: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> // always reset temperature disable_heater(); 181c4: 0f 94 4f 45 call 0x28a9e ; 0x28a9e if(thermal_model_autotune_err) { 181c8: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> 181cc: 88 23 and r24, r24 181ce: 09 f4 brne .+2 ; 0x181d2 181d0: fd c0 rjmp .+506 ; 0x183cc sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 181d2: 80 e2 ldi r24, 0x20 ; 32 181d4: 95 e8 ldi r25, 0x85 ; 133 181d6: 9f 93 push r25 181d8: 8f 93 push r24 181da: 9f 92 push r9 181dc: 8f 92 push r8 181de: 0f 94 a0 dc call 0x3b940 ; 0x3b940 lcd_setstatus_serial(tm_message); 181e2: c4 01 movw r24, r8 181e4: 0f 94 d1 0b call 0x217a2 ; 0x217a2 if(temp_error_state.v) 181e8: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 181ec: 0f 90 pop r0 181ee: 0f 90 pop r0 181f0: 0f 90 pop r0 181f2: 0f 90 pop r0 181f4: 88 23 and r24, r24 181f6: 19 f0 breq .+6 ; 0x181fe thermal_model_cal::set_fan_speed(255); 181f8: 8f ef ldi r24, 0xFF ; 255 181fa: 0f 94 ee 43 call 0x287dc ; 0x287dc // show calibrated values before overwriting them thermal_model_report_settings(); 181fe: 0f 94 f8 43 call 0x287f0 ; 0x287f0 // restore original state thermal_model::data.C = orig_C; 18202: 6e 96 adiw r28, 0x1e ; 30 18204: 2c ad ldd r18, Y+60 ; 0x3c 18206: 3d ad ldd r19, Y+61 ; 0x3d 18208: 4e ad ldd r20, Y+62 ; 0x3e 1820a: 5f ad ldd r21, Y+63 ; 0x3f 1820c: 6e 97 sbiw r28, 0x1e ; 30 1820e: 20 93 c2 12 sts 0x12C2, r18 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 18212: 30 93 c3 12 sts 0x12C3, r19 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 18216: 40 93 c4 12 sts 0x12C4, r20 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 1821a: 50 93 c5 12 sts 0x12C5, r21 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); 1821e: 80 e4 ldi r24, 0x40 ; 64 18220: fe 01 movw r30, r28 18222: 31 96 adiw r30, 0x01 ; 1 18224: ac ec ldi r26, 0xCC ; 204 18226: b2 e1 ldi r27, 0x12 ; 18 18228: 01 90 ld r0, Z+ 1822a: 0d 92 st X+, r0 1822c: 8a 95 dec r24 1822e: e1 f7 brne .-8 ; 0x18228 thermal_model_set_enabled(orig_enabled); 18230: 67 96 adiw r28, 0x17 ; 23 18232: 8f ad ldd r24, Y+63 ; 0x3f 18234: 67 97 sbiw r28, 0x17 ; 23 18236: 0f 94 79 48 call 0x290f2 ; 0x290f2 thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 1823a: 0e 94 a5 71 call 0xe34a ; 0xe34a menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 1823e: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 18242: 8d 7f andi r24, 0xFD ; 253 18244: 80 93 d0 03 sts 0x03D0, r24 ; 0x8003d0 18248: 0c 94 8d b2 jmp 0x1651a ; 0x1651a // 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); 1824c: 8f ef ldi r24, 0xFF ; 255 1824e: 0f 94 ee 43 call 0x287dc ; 0x287dc wait(30000); 18252: 80 e3 ldi r24, 0x30 ; 48 18254: 95 e7 ldi r25, 0x75 ; 117 18256: 0f 94 ed 50 call 0x2a1da ; 0x2a1da 1825a: e8 e0 ldi r30, 0x08 ; 8 1825c: 6e 2e mov r6, r30 1825e: e3 e1 ldi r30, 0x13 ; 19 18260: 7e 2e mov r7, r30 18262: 1f ef ldi r17, 0xFF ; 255 18264: ff e0 ldi r31, 0x0F ; 15 18266: af 2e mov r10, r31 18268: 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; 1826a: 21 2c mov r2, r1 1826c: 31 2c mov r3, r1 1826e: a0 ec ldi r26, 0xC0 ; 192 18270: 4a 2e mov r4, r26 18272: af e7 ldi r26, 0x7F ; 127 18274: 5a 2e mov r5, r26 18276: f3 01 movw r30, r6 18278: 20 82 st Z, r2 1827a: 31 82 std Z+1, r3 ; 0x01 1827c: 42 82 std Z+2, r4 ; 0x02 1827e: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 18280: 81 2f mov r24, r17 18282: 0f 94 ee 43 call 0x287dc ; 0x287dc wait(10000); 18286: 80 e1 ldi r24, 0x10 ; 16 18288: 97 e2 ldi r25, 0x27 ; 39 1828a: 0f 94 ed 50 call 0x2a1da ; 0x2a1da sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 1828e: bf 92 push r11 18290: af 92 push r10 18292: 2f ec ldi r18, 0xCF ; 207 18294: 34 e8 ldi r19, 0x84 ; 132 18296: 3f 93 push r19 18298: 2f 93 push r18 1829a: 9f 92 push r9 1829c: 8f 92 push r8 1829e: 0f 94 a0 dc call 0x3b940 ; 0x3b940 lcd_setstatus_serial(tm_message); 182a2: c4 01 movw r24, r8 182a4: 0f 94 d1 0b call 0x217a2 ; 0x217a2 samples = record(); 182a8: 0f 94 01 1e call 0x23c02 ; 0x23c02 if(temp_error_state.v || !samples) 182ac: 20 91 1c 05 lds r18, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 182b0: 0f 90 pop r0 182b2: 0f 90 pop r0 182b4: 0f 90 pop r0 182b6: 0f 90 pop r0 182b8: 0f 90 pop r0 182ba: 0f 90 pop r0 182bc: 21 11 cpse r18, r1 182be: 7f cf rjmp .-258 ; 0x181be 182c0: 00 97 sbiw r24, 0x00 ; 0 182c2: 09 f4 brne .+2 ; 0x182c6 182c4: 7c cf rjmp .-264 ; 0x181be 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], 182c6: c0 90 51 06 lds r12, 0x0651 ; 0x800651 182ca: d0 90 52 06 lds r13, 0x0652 ; 0x800652 182ce: e0 90 53 06 lds r14, 0x0653 ; 0x800653 182d2: f0 90 54 06 lds r15, 0x0654 ; 0x800654 182d6: 20 91 cc 12 lds r18, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 182da: 30 91 cd 12 lds r19, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 182de: 40 91 ce 12 lds r20, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 182e2: 50 91 cf 12 lds r21, 0x12CF ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> 182e6: 0a 2d mov r16, r10 182e8: b3 01 movw r22, r6 182ea: 0e 94 2e dd call 0x1ba5c ; 0x1ba5c 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)) 182ee: 9b 01 movw r18, r22 182f0: ac 01 movw r20, r24 182f2: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 182f6: 81 11 cpse r24, r1 182f8: 62 cf rjmp .-316 ; 0x181be 182fa: 54 e0 ldi r21, 0x04 ; 4 182fc: a5 1a sub r10, r21 182fe: b1 08 sbc r11, r1 18300: 80 e1 ldi r24, 0x10 ; 16 18302: 68 1a sub r6, r24 18304: 71 08 sbc r7, r1 18306: 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) { 18308: 9f ef ldi r25, 0xFF ; 255 1830a: a9 16 cp r10, r25 1830c: b9 06 cpc r11, r25 1830e: 09 f0 breq .+2 ; 0x18312 18310: b2 cf rjmp .-156 ; 0x18276 18312: 64 e0 ldi r22, 0x04 ; 4 18314: e6 2e mov r14, r22 18316: 63 e1 ldi r22, 0x13 ; 19 18318: f6 2e mov r15, r22 1831a: 0e e0 ldi r16, 0x0E ; 14 1831c: 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; 1831e: 7f e0 ldi r23, 0x0F ; 15 18320: 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)) { 18322: 8f e0 ldi r24, 0x0F ; 15 18324: 90 e0 ldi r25, 0x00 ; 0 18326: 80 1b sub r24, r16 18328: 91 0b sbc r25, r17 1832a: 83 70 andi r24, 0x03 ; 3 1832c: 99 27 eor r25, r25 1832e: 89 2b or r24, r25 18330: 59 f4 brne .+22 ; 0x18348 next = i; 18332: 30 2e mov r3, r16 18334: 01 50 subi r16, 0x01 ; 1 18336: 11 09 sbc r17, r1 18338: f4 e0 ldi r31, 0x04 ; 4 1833a: ef 1a sub r14, r31 1833c: 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) { 1833e: 01 15 cp r16, r1 18340: 11 05 cpc r17, r1 18342: 79 f7 brne .-34 ; 0x18322 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; 18344: 80 e0 ldi r24, 0x00 ; 0 18346: 3c cf rjmp .-392 ; 0x181c0 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; 18348: 8c ef ldi r24, 0xFC ; 252 1834a: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 1834c: 87 fd sbrc r24, 7 1834e: 80 e0 ldi r24, 0x00 ; 0 18350: 08 2e mov r0, r24 18352: 00 0c add r0, r0 18354: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 18356: fc 01 movw r30, r24 18358: ee 0f add r30, r30 1835a: ff 1f adc r31, r31 1835c: ee 0f add r30, r30 1835e: ff 1f adc r31, r31 18360: e4 53 subi r30, 0x34 ; 52 18362: fd 4e sbci r31, 0xED ; 237 18364: 40 80 ld r4, Z 18366: 51 80 ldd r5, Z+1 ; 0x01 18368: 62 80 ldd r6, Z+2 ; 0x02 1836a: 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; 1836c: b8 01 movw r22, r16 1836e: 68 1b sub r22, r24 18370: 79 0b sbc r23, r25 18372: 07 2e mov r0, r23 18374: 00 0c add r0, r0 18376: 88 0b sbc r24, r24 18378: 99 0b sbc r25, r25 1837a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1837e: 20 e0 ldi r18, 0x00 ; 0 18380: 30 e0 ldi r19, 0x00 ; 0 18382: 40 e8 ldi r20, 0x80 ; 128 18384: 5e e3 ldi r21, 0x3E ; 62 18386: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1838a: 5b 01 movw r10, r22 1838c: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 1838e: a3 2d mov r26, r3 18390: b4 e0 ldi r27, 0x04 ; 4 18392: ab 02 muls r26, r27 18394: f0 01 movw r30, r0 18396: 11 24 eor r1, r1 18398: e4 53 subi r30, 0x34 ; 52 1839a: fd 4e sbci r31, 0xED ; 237 1839c: a3 01 movw r20, r6 1839e: 92 01 movw r18, r4 183a0: 60 81 ld r22, Z 183a2: 71 81 ldd r23, Z+1 ; 0x01 183a4: 82 81 ldd r24, Z+2 ; 0x02 183a6: 93 81 ldd r25, Z+3 ; 0x03 183a8: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 183ac: 9b 01 movw r18, r22 183ae: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 183b0: c6 01 movw r24, r12 183b2: b5 01 movw r22, r10 183b4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 183b8: a3 01 movw r20, r6 183ba: 92 01 movw r18, r4 183bc: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 183c0: f7 01 movw r30, r14 183c2: 60 83 st Z, r22 183c4: 71 83 std Z+1, r23 ; 0x01 183c6: 82 83 std Z+2, r24 ; 0x02 183c8: 93 83 std Z+3, r25 ; 0x03 183ca: b4 cf rjmp .-152 ; 0x18334 // 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); 183cc: 88 e0 ldi r24, 0x08 ; 8 183ce: 0e 94 5e e7 call 0x1cebc ; 0x1cebc lcd_setstatuspgm(MSG_WELCOME); 183d2: 8a e6 ldi r24, 0x6A ; 106 183d4: 90 e7 ldi r25, 0x70 ; 112 183d6: 0f 94 e2 0b call 0x217c4 ; 0x217c4 thermal_model_cal::set_fan_speed(0); 183da: 80 e0 ldi r24, 0x00 ; 0 183dc: 0f 94 ee 43 call 0x287dc ; 0x287dc thermal_model_set_enabled(orig_enabled); 183e0: 67 96 adiw r28, 0x17 ; 23 183e2: 8f ad ldd r24, Y+63 ; 0x3f 183e4: 67 97 sbiw r28, 0x17 ; 23 183e6: 0f 94 79 48 call 0x290f2 ; 0x290f2 thermal_model_report_settings(); 183ea: 0f 94 f8 43 call 0x287f0 ; 0x287f0 183ee: 25 cf rjmp .-438 ; 0x1823a M400 */ case 400: { st_synchronize(); 183f0: 0f 94 24 59 call 0x2b248 ; 0x2b248 183f4: 0c 94 8d b2 jmp 0x1651a ; 0x1651a */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 183f8: 81 e0 ldi r24, 0x01 ; 1 183fa: 0e 94 ac 75 call 0xeb58 ; 0xeb58 183fe: 0c 94 8d b2 jmp 0x1651a ; 0x1651a M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 18402: 0e 94 de 80 call 0x101bc ; 0x101bc 18406: 0c 94 8d b2 jmp 0x1651a ; 0x1651a M500 */ case 500: { Config_StoreSettings(); 1840a: 0e 94 c7 83 call 0x1078e ; 0x1078e 1840e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a M501 */ case 501: { Config_RetrieveSettings(); 18412: 0e 94 51 95 call 0x12aa2 ; 0x12aa2 18416: 0c 94 8d b2 jmp 0x1651a ; 0x1651a M502 */ case 502: { Config_ResetDefault(); 1841a: 0e 94 af 83 call 0x1075e ; 0x1075e 1841e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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); 18422: 1f 93 push r17 18424: 0f 93 push r16 18426: 8f e4 ldi r24, 0x4F ; 79 18428: 90 e8 ldi r25, 0x80 ; 128 1842a: 9f 93 push r25 1842c: 8f 93 push r24 1842e: 0f 94 4b dc call 0x3b896 ; 0x3b896 18432: 0f 90 pop r0 18434: 0f 90 pop r0 18436: 0f 90 pop r0 18438: 0f 90 pop r0 1843a: 0c 94 d7 b0 jmp 0x161ae ; 0x161ae M509 */ case 509: { lang_reset(); 1843e: 0e 94 d9 71 call 0xe3b2 ; 0xe3b2 SERIAL_ECHO_START; 18442: 82 ee ldi r24, 0xE2 ; 226 18444: 99 ea ldi r25, 0xA9 ; 169 18446: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 1844a: 8e e4 ldi r24, 0x4E ; 78 1844c: 97 e8 ldi r25, 0x87 ; 135 1844e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 18452: 0c 94 8d b2 jmp 0x1651a ; 0x1651a - `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(); 18456: 0f 94 24 59 call 0x2b248 ; 0x2b248 /// 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; 1845a: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 1845e: 81 11 cpse r24, r1 18460: 02 c0 rjmp .+4 ; 0x18466 18462: 0e 94 f6 64 call 0xc9ec ; 0xc9ec 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(); 18466: 85 e4 ldi r24, 0x45 ; 69 18468: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 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; 1846c: 81 2c mov r8, r1 1846e: 91 2c mov r9, r1 18470: a1 2c mov r10, r1 18472: 20 ec ldi r18, 0xC0 ; 192 18474: 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(); 18476: 88 23 and r24, r24 18478: 21 f0 breq .+8 ; 0x18482 1847a: 0e 94 4a 61 call 0xc294 ; 0xc294 1847e: 4b 01 movw r8, r22 18480: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 18482: 8c e4 ldi r24, 0x4C ; 76 18484: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 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; 18488: c1 2c mov r12, r1 1848a: d1 2c mov r13, r1 1848c: 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(); 1848e: 88 23 and r24, r24 18490: 21 f0 breq .+8 ; 0x1849a 18492: 0e 94 4a 61 call 0xc294 ; 0xc294 18496: 6b 01 movw r12, r22 18498: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 1849a: 8a e5 ldi r24, 0x5A ; 90 1849c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 // 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; 184a0: 41 2c mov r4, r1 184a2: 51 2c mov r5, r1 184a4: 98 ed ldi r25, 0xD8 ; 216 184a6: 69 2e mov r6, r25 184a8: 91 e4 ldi r25, 0x41 ; 65 184aa: 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()); 184ac: 88 23 and r24, r24 184ae: 31 f0 breq .+12 ; 0x184bc 184b0: 0e 94 4a 61 call 0xc294 ; 0xc294 184b4: 2b 01 movw r4, r22 184b6: 3c 01 movw r6, r24 184b8: e8 94 clt 184ba: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 184bc: 88 e5 ldi r24, 0x58 ; 88 184be: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 184c2: 88 23 and r24, r24 184c4: 09 f4 brne .+2 ; 0x184c8 184c6: ba c1 rjmp .+884 ; 0x1883c 184c8: 0e 94 4a 61 call 0xc294 ; 0xc294 184cc: 6a 96 adiw r28, 0x1a ; 26 184ce: 6c af std Y+60, r22 ; 0x3c 184d0: 7d af std Y+61, r23 ; 0x3d 184d2: 8e af std Y+62, r24 ; 0x3e 184d4: 9f af std Y+63, r25 ; 0x3f 184d6: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 184d8: 89 e5 ldi r24, 0x59 ; 89 184da: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 184de: 88 23 and r24, r24 184e0: 09 f4 brne .+2 ; 0x184e4 184e2: b7 c1 rjmp .+878 ; 0x18852 184e4: 0e 94 4a 61 call 0xc294 ; 0xc294 184e8: 6e 96 adiw r28, 0x1e ; 30 184ea: 6c af std Y+60, r22 ; 0x3c 184ec: 7d af std Y+61, r23 ; 0x3d 184ee: 8e af std Y+62, r24 ; 0x3e 184f0: 9f af std Y+63, r25 ; 0x3f 184f2: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 184f4: 1a 82 std Y+2, r1 ; 0x02 184f6: 19 82 std Y+1, r1 ; 0x01 184f8: fe 01 movw r30, r28 184fa: 33 96 adiw r30, 0x03 ; 3 184fc: 83 e1 ldi r24, 0x13 ; 19 184fe: df 01 movw r26, r30 18500: 1d 92 st X+, r1 18502: 8a 95 dec r24 18504: e9 f7 brne .-6 ; 0x18500 if (code_seen('C')) { 18506: 83 e4 ldi r24, 0x43 ; 67 18508: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1850c: 88 23 and r24, r24 1850e: f9 f0 breq .+62 ; 0x1854e , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18510: 62 e2 ldi r22, 0x22 ; 34 18512: 70 e0 ldi r23, 0x00 ; 0 18514: 80 91 95 03 lds r24, 0x0395 ; 0x800395 18518: 90 91 96 03 lds r25, 0x0396 ; 0x800396 1851c: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 18520: 8c 01 movw r16, r24 if (!this->ptr) { 18522: 89 2b or r24, r25 18524: a1 f0 breq .+40 ; 0x1854e // First quote not found return; } // Skip the leading quote this->ptr++; 18526: 0f 5f subi r16, 0xFF ; 255 18528: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 1852a: 62 e2 ldi r22, 0x22 ; 34 1852c: 70 e0 ldi r23, 0x00 ; 0 1852e: c8 01 movw r24, r16 18530: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 if(!pStrEnd) { 18534: 00 97 sbiw r24, 0x00 ; 0 18536: 59 f0 breq .+22 ; 0x1854e // Second quote not found return; } this->len = pStrEnd - this->ptr; 18538: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 1853a: 84 31 cpi r24, 0x14 ; 20 1853c: 08 f0 brcs .+2 ; 0x18540 1853e: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 18540: 48 2f mov r20, r24 18542: 50 e0 ldi r21, 0x00 ; 0 18544: b8 01 movw r22, r16 18546: ce 01 movw r24, r28 18548: 01 96 adiw r24, 0x01 ; 1 1854a: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 1854e: 80 91 96 13 lds r24, 0x1396 ; 0x801396 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; 18552: 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"))) 18554: 81 30 cpi r24, 0x01 ; 1 18556: 29 f4 brne .+10 ; 0x18562 18558: 89 e4 ldi r24, 0x49 ; 73 1855a: 97 e8 ldi r25, 0x87 ; 135 1855c: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 18560: 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(); 18562: 0f 94 24 59 call 0x2b248 ; 0x2b248 uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 18566: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 // Retract E if (!printingIsPaused()) 1856a: 0e 94 32 68 call 0xd064 ; 0xd064 1856e: 81 11 cpse r24, r1 18570: 77 c1 rjmp .+750 ; 0x18860 { current_position[E_AXIS] += e_shift; 18572: a5 01 movw r20, r10 18574: 94 01 movw r18, r8 18576: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 1857a: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 1857e: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 18582: 90 91 50 07 lds r25, 0x0750 ; 0x800750 18586: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1858a: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 1858e: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 18592: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 18596: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 1859a: 60 e0 ldi r22, 0x00 ; 0 1859c: 70 e0 ldi r23, 0x00 ; 0 1859e: 88 ee ldi r24, 0xE8 ; 232 185a0: 92 e4 ldi r25, 0x42 ; 66 185a2: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 185a6: 0f 94 24 59 call 0x2b248 ; 0x2b248 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 185aa: 86 e2 ldi r24, 0x26 ; 38 185ac: 9f e6 ldi r25, 0x6F ; 111 185ae: 0e 94 fe 7a call 0xf5fc ; 0xf5fc // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 185b2: c3 01 movw r24, r6 185b4: b2 01 movw r22, r4 185b6: 0e 94 8e 6e call 0xdd1c ; 0xdd1c // Move XY to side current_position[X_AXIS] = x_position; 185ba: 6a 96 adiw r28, 0x1a ; 26 185bc: 2c ad ldd r18, Y+60 ; 0x3c 185be: 3d ad ldd r19, Y+61 ; 0x3d 185c0: 4e ad ldd r20, Y+62 ; 0x3e 185c2: 5f ad ldd r21, Y+63 ; 0x3f 185c4: 6a 97 sbiw r28, 0x1a ; 26 185c6: 20 93 41 07 sts 0x0741, r18 ; 0x800741 185ca: 30 93 42 07 sts 0x0742, r19 ; 0x800742 185ce: 40 93 43 07 sts 0x0743, r20 ; 0x800743 185d2: 50 93 44 07 sts 0x0744, r21 ; 0x800744 current_position[Y_AXIS] = y_position; 185d6: 6e 96 adiw r28, 0x1e ; 30 185d8: 8c ad ldd r24, Y+60 ; 0x3c 185da: 9d ad ldd r25, Y+61 ; 0x3d 185dc: ae ad ldd r26, Y+62 ; 0x3e 185de: bf ad ldd r27, Y+63 ; 0x3f 185e0: 6e 97 sbiw r28, 0x1e ; 30 185e2: 80 93 45 07 sts 0x0745, r24 ; 0x800745 185e6: 90 93 46 07 sts 0x0746, r25 ; 0x800746 185ea: a0 93 47 07 sts 0x0747, r26 ; 0x800747 185ee: b0 93 48 07 sts 0x0748, r27 ; 0x800748 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 185f2: 60 e0 ldi r22, 0x00 ; 0 185f4: 70 e0 ldi r23, 0x00 ; 0 185f6: 88 e4 ldi r24, 0x48 ; 72 185f8: 92 e4 ldi r25, 0x42 ; 66 185fa: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 185fe: 0f 94 24 59 call 0x2b248 ; 0x2b248 bool repeat = false; 18602: 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; 18604: 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)); 18606: 08 e9 ldi r16, 0x98 ; 152 18608: 20 2e mov r2, r16 1860a: 0f e7 ldi r16, 0x7F ; 127 1860c: 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)); 1860e: 80 ea ldi r24, 0xA0 ; 160 18610: 88 2e mov r8, r24 18612: 8f e7 ldi r24, 0x7F ; 127 18614: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 18616: 80 91 96 13 lds r24, 0x1396 ; 0x801396 1861a: 81 30 cpi r24, 0x01 ; 1 1861c: 09 f0 breq .+2 ; 0x18620 1861e: 23 c1 rjmp .+582 ; 0x18866 eject_slot = MMU2::mmu2.get_current_tool(); 18620: 0f 94 d5 76 call 0x2edaa ; 0x2edaa 18624: a8 2e mov r10, r24 mmu_M600_unload_filament(); 18626: 0e 94 c4 73 call 0xe788 ; 0xe788 } 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 1862a: 0f 94 24 59 call 0x2b248 ; 0x2b248 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1862e: 10 92 88 17 sts 0x1788, r1 ; 0x801788 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 18632: 10 92 87 17 sts 0x1787, r1 ; 0x801787 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 18636: 80 91 96 13 lds r24, 0x1396 ; 0x801396 1863a: 81 30 cpi r24, 0x01 ; 1 1863c: 09 f4 brne .+2 ; 0x18640 1863e: e1 c1 rjmp .+962 ; 0x18a02 { KEEPALIVE_STATE(PAUSED_FOR_USER); 18640: 84 e0 ldi r24, 0x04 ; 4 18642: 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); 18646: 81 e2 ldi r24, 0x21 ; 33 18648: 99 e3 ldi r25, 0x39 ; 57 1864a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1864e: 40 e0 ldi r20, 0x00 ; 0 18650: 60 e0 ldi r22, 0x00 ; 0 18652: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 18656: 08 2f mov r16, r24 lcd_update_enable(false); 18658: 80 e0 ldi r24, 0x00 ; 0 1865a: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 1865e: 01 30 cpi r16, 0x01 ; 1 18660: 29 f5 brne .+74 ; 0x186ac lcd_clear(); 18662: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18666: 89 e9 ldi r24, 0x99 ; 153 18668: 99 e3 ldi r25, 0x39 ; 57 1866a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1866e: ac 01 movw r20, r24 18670: 62 e0 ldi r22, 0x02 ; 2 18672: 80 e0 ldi r24, 0x00 ; 0 18674: 0e 94 a1 6f call 0xdf42 ; 0xdf42 current_position[X_AXIS] = 100; 18678: 80 e0 ldi r24, 0x00 ; 0 1867a: 90 e0 ldi r25, 0x00 ; 0 1867c: a8 ec ldi r26, 0xC8 ; 200 1867e: b2 e4 ldi r27, 0x42 ; 66 18680: 80 93 41 07 sts 0x0741, r24 ; 0x800741 18684: 90 93 42 07 sts 0x0742, r25 ; 0x800742 18688: a0 93 43 07 sts 0x0743, r26 ; 0x800743 1868c: b0 93 44 07 sts 0x0744, r27 ; 0x800744 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 18690: 60 e0 ldi r22, 0x00 ; 0 18692: 70 e0 ldi r23, 0x00 ; 0 18694: 88 e4 ldi r24, 0x48 ; 72 18696: 92 e4 ldi r25, 0x42 ; 66 18698: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 1869c: 0f 94 24 59 call 0x2b248 ; 0x2b248 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 186a0: 8f ee ldi r24, 0xEF ; 239 186a2: 98 e3 ldi r25, 0x38 ; 56 186a4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 186a8: 0f 94 04 36 call 0x26c08 ; 0x26c08 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 186ac: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 186b0: 8d e7 ldi r24, 0x7D ; 125 186b2: 98 e3 ldi r25, 0x38 ; 56 186b4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 186b8: ac 01 movw r20, r24 186ba: 60 e0 ldi r22, 0x00 ; 0 186bc: 80 e0 ldi r24, 0x00 ; 0 186be: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(0, 1); 186c2: 61 e0 ldi r22, 0x01 ; 1 186c4: 80 e0 ldi r24, 0x00 ; 0 186c6: 0e 94 8d 6f call 0xdf1a ; 0xdf1a if (filament_name[0]) { 186ca: 89 81 ldd r24, Y+1 ; 0x01 186cc: 88 23 and r24, r24 186ce: 41 f0 breq .+16 ; 0x186e0 lcd_print(filament_name); 186d0: ce 01 movw r24, r28 186d2: 01 96 adiw r24, 0x01 ; 1 186d4: 0e 94 94 71 call 0xe328 ; 0xe328 lcd_set_cursor(0, 2); 186d8: 62 e0 ldi r22, 0x02 ; 2 186da: 80 e0 ldi r24, 0x00 ; 0 186dc: 0e 94 8d 6f call 0xdf1a ; 0xdf1a } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 186e0: 80 91 87 17 lds r24, 0x1787 ; 0x801787 186e4: 81 11 cpse r24, r1 186e6: 06 c0 rjmp .+12 ; 0x186f4 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 186e8: 88 e6 ldi r24, 0x68 ; 104 186ea: 98 e3 ldi r25, 0x38 ; 56 186ec: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 186f0: 0e 94 78 6f call 0xdef0 ; 0xdef0 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); 186f4: 84 e0 ldi r24, 0x04 ; 4 186f6: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(!lcd_clicked()) 186fa: 0e 94 aa 71 call 0xe354 ; 0xe354 186fe: 81 11 cpse r24, r1 18700: 10 c0 rjmp .+32 ; 0x18722 { manage_heater(); 18702: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 18706: 81 e0 ldi r24, 0x01 ; 1 18708: 0e 94 da 8b call 0x117b4 ; 0x117b4 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 1870c: 80 91 8a 17 lds r24, 0x178A ; 0x80178a 18710: 88 23 and r24, r24 18712: 99 f3 breq .-26 ; 0x186fa Sound_MakeCustom(50,1000,false); 18714: 40 e0 ldi r20, 0x00 ; 0 18716: 68 ee ldi r22, 0xE8 ; 232 18718: 73 e0 ldi r23, 0x03 ; 3 1871a: 82 e3 ldi r24, 0x32 ; 50 1871c: 90 e0 ldi r25, 0x00 ; 0 1871e: 0f 94 99 6a call 0x2d532 ; 0x2d532 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 18722: 32 e0 ldi r19, 0x02 ; 2 18724: 30 93 96 02 sts 0x0296, r19 ; 0x800296 M600_load_filament_movements(filament_name); 18728: ce 01 movw r24, r28 1872a: 01 96 adiw r24, 0x01 ; 1 1872c: 0e 94 7d 73 call 0xe6fa ; 0xe6fa Sound_MakeCustom(50,1000,false); 18730: 40 e0 ldi r20, 0x00 ; 0 18732: 68 ee ldi r22, 0xE8 ; 232 18734: 73 e0 ldi r23, 0x03 ; 3 18736: 82 e3 ldi r24, 0x32 ; 50 18738: 90 e0 ldi r25, 0x00 ; 0 1873a: 0f 94 99 6a call 0x2d532 ; 0x2d532 else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 1873e: 11 11 cpse r17, r1 18740: a6 c1 rjmp .+844 ; 0x18a8e 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); 18742: b4 e0 ldi r27, 0x04 ; 4 18744: bb 2e mov r11, r27 18746: b0 92 96 02 sts 0x0296, r11 ; 0x800296 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 1874a: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 1874e: 89 eb ldi r24, 0xB9 ; 185 18750: 98 e3 ldi r25, 0x38 ; 56 18752: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 18756: ac 01 movw r20, r24 18758: 60 e0 ldi r22, 0x00 ; 0 1875a: 81 e0 ldi r24, 0x01 ; 1 1875c: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 18760: 83 ea ldi r24, 0xA3 ; 163 18762: 98 e3 ldi r25, 0x38 ; 56 18764: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 18768: ac 01 movw r20, r24 1876a: 61 e0 ldi r22, 0x01 ; 1 1876c: 81 e0 ldi r24, 0x01 ; 1 1876e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 18772: 8f e8 ldi r24, 0x8F ; 143 18774: 98 e3 ldi r25, 0x38 ; 56 18776: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1877a: ac 01 movw r20, r24 1877c: 62 e0 ldi r22, 0x02 ; 2 1877e: 81 e0 ldi r24, 0x01 ; 1 18780: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 18784: 83 eb ldi r24, 0xB3 ; 179 18786: 9b e3 ldi r25, 0x3B ; 59 18788: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1878c: ac 01 movw r20, r24 1878e: 63 e0 ldi r22, 0x03 ; 3 18790: 81 e0 ldi r24, 0x01 ; 1 18792: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_putc_at(0, cursor_pos, '>'); 18796: 4e e3 ldi r20, 0x3E ; 62 18798: 60 e0 ldi r22, 0x00 ; 0 1879a: 80 e0 ldi r24, 0x00 ; 0 1879c: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_consume_click(); 187a0: 0e 94 a5 71 call 0xe34a ; 0xe34a uint8_t lcd_alright() { uint8_t cursor_pos = 0; 187a4: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 187a6: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 187aa: 81 e0 ldi r24, 0x01 ; 1 187ac: 0e 94 da 8b call 0x117b4 ; 0x117b4 if (lcd_encoder) 187b0: 80 91 35 05 lds r24, 0x0535 ; 0x800535 187b4: 90 91 36 05 lds r25, 0x0536 ; 0x800536 187b8: 00 97 sbiw r24, 0x00 ; 0 187ba: d9 f0 breq .+54 ; 0x187f2 { if (lcd_encoder < 0 ) { 187bc: 97 ff sbrs r25, 7 187be: 2a c1 rjmp .+596 ; 0x18a14 // Rotating knob counter clockwise if (cursor_pos > 0) 187c0: 00 23 and r16, r16 187c2: 09 f4 brne .+2 ; 0x187c6 187c4: 2b c1 rjmp .+598 ; 0x18a1c cursor_pos--; 187c6: 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 ")); 187c8: 44 ea ldi r20, 0xA4 ; 164 187ca: 5f e7 ldi r21, 0x7F ; 127 187cc: 60 e0 ldi r22, 0x00 ; 0 187ce: 80 e0 ldi r24, 0x00 ; 0 187d0: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_putc_at(0, cursor_pos, '>'); 187d4: 4e e3 ldi r20, 0x3E ; 62 187d6: 60 2f mov r22, r16 187d8: 80 e0 ldi r24, 0x00 ; 0 187da: 0e 94 ad 6f call 0xdf5a ; 0xdf5a // Consume rotation event and make feedback sound lcd_encoder = 0; 187de: 10 92 36 05 sts 0x0536, r1 ; 0x800536 187e2: 10 92 35 05 sts 0x0535, r1 ; 0x800535 _delay(100); 187e6: 64 e6 ldi r22, 0x64 ; 100 187e8: 70 e0 ldi r23, 0x00 ; 0 187ea: 80 e0 ldi r24, 0x00 ; 0 187ec: 90 e0 ldi r25, 0x00 ; 0 187ee: 0f 94 8a 3d call 0x27b14 ; 0x27b14 } if (lcd_clicked()) 187f2: 0e 94 aa 71 call 0xe354 ; 0xe354 187f6: 88 23 and r24, r24 187f8: b1 f2 breq .-84 ; 0x187a6 { lcd_clear(); 187fa: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_return_to_status(); 187fe: 0f 94 4b 27 call 0x24e96 ; 0x24e96 lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 18802: 42 e0 ldi r20, 0x02 ; 2 18804: 40 93 96 02 sts 0x0296, r20 ; 0x800296 switch(lcd_change_filament_state) 18808: 02 30 cpi r16, 0x02 ; 2 1880a: 09 f4 brne .+2 ; 0x1880e 1880c: 10 c1 rjmp .+544 ; 0x18a2e 1880e: 03 30 cpi r16, 0x03 ; 3 18810: 09 f4 brne .+2 ; 0x18814 18812: f7 c1 rjmp .+1006 ; 0x18c02 18814: 01 30 cpi r16, 0x01 ; 1 18816: 09 f0 breq .+2 ; 0x1881a 18818: 29 c1 rjmp .+594 ; 0x18a6c { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 1881a: 80 91 96 13 lds r24, 0x1396 ; 0x801396 1881e: 81 30 cpi r24, 0x01 ; 1 18820: 09 f0 breq .+2 ; 0x18824 18822: 00 c1 rjmp .+512 ; 0x18a24 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 18824: 0f 94 d5 76 call 0x2edaa ; 0x2edaa 18828: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 1882a: 0e 94 c4 73 call 0xe788 ; 0xe788 // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 1882e: 80 2f mov r24, r16 18830: 0e 94 a2 8e call 0x11d44 ; 0x11d44 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 18834: 80 e0 ldi r24, 0x00 ; 0 18836: 0e 94 91 79 call 0xf322 ; 0xf322 1883a: 85 cf rjmp .-246 ; 0x18746 // 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; 1883c: 20 e0 ldi r18, 0x00 ; 0 1883e: 30 e0 ldi r19, 0x00 ; 0 18840: 43 e5 ldi r20, 0x53 ; 83 18842: 53 e4 ldi r21, 0x43 ; 67 18844: 6a 96 adiw r28, 0x1a ; 26 18846: 2c af std Y+60, r18 ; 0x3c 18848: 3d af std Y+61, r19 ; 0x3d 1884a: 4e af std Y+62, r20 ; 0x3e 1884c: 5f af std Y+63, r21 ; 0x3f 1884e: 6a 97 sbiw r28, 0x1a ; 26 18850: 43 ce rjmp .-890 ; 0x184d8 float y_position = FILAMENTCHANGE_YPOS; 18852: 6e 96 adiw r28, 0x1e ; 30 18854: 1c ae std Y+60, r1 ; 0x3c 18856: 1d ae std Y+61, r1 ; 0x3d 18858: 1e ae std Y+62, r1 ; 0x3e 1885a: 1f ae std Y+63, r1 ; 0x3f 1885c: 6e 97 sbiw r28, 0x1e ; 30 1885e: 4a ce rjmp .-876 ; 0x184f4 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(); 18860: 0e 94 76 65 call 0xcaec ; 0xcaec 18864: a6 ce rjmp .-692 ; 0x185b2 //! //! 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); 18866: 84 e0 ldi r24, 0x04 ; 4 18868: 80 93 96 02 sts 0x0296, r24 ; 0x800296 unsigned long waiting_start_time = _millis(); 1886c: 0f 94 83 3f call 0x27f06 ; 0x27f06 18870: 2b 01 movw r4, r22 18872: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 18874: 8d e3 ldi r24, 0x3D ; 61 18876: 98 e3 ldi r25, 0x38 ; 56 18878: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1887c: 0f 94 7d 35 call 0x26afa ; 0x26afa while (!(wait_for_user_state == 0 && lcd_clicked())){ 18880: 0e 94 aa 71 call 0xe354 ; 0xe354 18884: 08 2f mov r16, r24 18886: 81 11 cpse r24, r1 18888: 38 c0 rjmp .+112 ; 0x188fa 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) { 1888a: a3 01 movw r20, r6 1888c: 92 01 movw r18, r4 1888e: 20 54 subi r18, 0x40 ; 64 18890: 38 4d sbci r19, 0xD8 ; 216 18892: 46 4f sbci r20, 0xF6 ; 246 18894: 5f 4f sbci r21, 0xFF ; 255 18896: 6a 96 adiw r28, 0x1a ; 26 18898: 2c af std Y+60, r18 ; 0x3c 1889a: 3d af std Y+61, r19 ; 0x3d 1889c: 4e af std Y+62, r20 ; 0x3e 1889e: 5f af std Y+63, r21 ; 0x3f 188a0: 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(); 188a2: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 188a6: 81 e0 ldi r24, 0x01 ; 1 188a8: 0e 94 da 8b call 0x117b4 ; 0x117b4 if (wait_for_user_state != 2) sound_wait_for_user(); 188ac: 02 30 cpi r16, 0x02 ; 2 188ae: 09 f4 brne .+2 ; 0x188b2 188b0: 67 c0 rjmp .+206 ; 0x18980 188b2: 0f 94 3d 6b call 0x2d67a ; 0x2d67a 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); 188b6: 84 e0 ldi r24, 0x04 ; 4 188b8: 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) { 188ba: 01 30 cpi r16, 0x01 ; 1 188bc: 39 f1 breq .+78 ; 0x1890c case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 188be: 0e 94 7f 8e call 0x11cfe ; 0x11cfe if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 188c2: 0f 94 83 3f call 0x27f06 ; 0x27f06 188c6: 6a 96 adiw r28, 0x1a ; 26 188c8: 2c ad ldd r18, Y+60 ; 0x3c 188ca: 3d ad ldd r19, Y+61 ; 0x3d 188cc: 4e ad ldd r20, Y+62 ; 0x3e 188ce: 5f ad ldd r21, Y+63 ; 0x3f 188d0: 6a 97 sbiw r28, 0x1a ; 26 188d2: 26 17 cp r18, r22 188d4: 37 07 cpc r19, r23 188d6: 48 07 cpc r20, r24 188d8: 59 07 cpc r21, r25 188da: 90 f6 brcc .-92 ; 0x18880 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 188dc: 8c e0 ldi r24, 0x0C ; 12 188de: 98 e3 ldi r25, 0x38 ; 56 188e0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 188e4: 0f 94 7d 35 call 0x26afa ; 0x26afa return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 188e8: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 188ec: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 188f0: 0f 94 24 59 call 0x2b248 ; 0x2b248 disable_e0(); 188f4: 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; 188f6: 01 e0 ldi r16, 0x01 ; 1 188f8: d4 cf rjmp .-88 ; 0x188a2 188fa: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL10beep_timer.lto_priv.513> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 188fe: 10 92 6d 05 sts 0x056D, r1 ; 0x80056d <_ZL6bFirst.lto_priv.514> 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); 18902: c7 01 movw r24, r14 18904: b6 01 movw r22, r12 18906: 0f 94 cf 16 call 0x22d9e ; 0x22d9e 1890a: 8f ce rjmp .-738 ; 0x1862a 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); 1890c: 0e 94 7f 8e call 0x11cfe ; 0x11cfe if (lcd_clicked()) { 18910: 0e 94 aa 71 call 0xe354 ; 0xe354 18914: 88 23 and r24, r24 18916: 29 f2 breq .-118 ; 0x188a2 18918: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 1891c: 90 91 ac 05 lds r25, 0x05AC ; 0x8005ac 18920: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 18924: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 18928: 8c e6 ldi r24, 0x6C ; 108 1892a: 9f e4 ldi r25, 0x4F ; 79 1892c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 18930: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 18934: 42 e8 ldi r20, 0x82 ; 130 18936: 64 e0 ldi r22, 0x04 ; 4 18938: 80 e0 ldi r24, 0x00 ; 0 1893a: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 1893e: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 18942: 8f 93 push r24 18944: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 18948: 8f 93 push r24 1894a: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 1894e: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 18952: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 18956: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 1895a: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 1895e: 7f 93 push r23 18960: 6f 93 push r22 18962: 3f 92 push r3 18964: 2f 92 push r2 18966: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_putc(LCD_STR_DEGREE[0]); 1896a: 81 e8 ldi r24, 0x81 ; 129 1896c: 0e 94 7c 6f call 0xdef8 ; 0xdef8 18970: 0f 90 pop r0 18972: 0f 90 pop r0 18974: 0f 90 pop r0 18976: 0f 90 pop r0 18978: 0f 90 pop r0 1897a: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 1897c: 02 e0 ldi r16, 0x02 ; 2 1897e: 91 cf rjmp .-222 ; 0x188a2 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 18980: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 18984: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 18988: 07 2e mov r0, r23 1898a: 00 0c add r0, r0 1898c: 88 0b sbc r24, r24 1898e: 99 0b sbc r25, r25 18990: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 18994: 20 91 5f 0e lds r18, 0x0E5F ; 0x800e5f 18998: 30 91 60 0e lds r19, 0x0E60 ; 0x800e60 1899c: 40 91 61 0e lds r20, 0x0E61 ; 0x800e61 189a0: 50 91 62 0e lds r21, 0x0E62 ; 0x800e62 189a4: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 189a8: 9f 77 andi r25, 0x7F ; 127 189aa: 20 e0 ldi r18, 0x00 ; 0 189ac: 30 e0 ldi r19, 0x00 ; 0 189ae: 40 ea ldi r20, 0xA0 ; 160 189b0: 50 e4 ldi r21, 0x40 ; 64 189b2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 189b6: 87 ff sbrs r24, 7 189b8: 0b c0 rjmp .+22 ; 0x189d0 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 189ba: 8d e3 ldi r24, 0x3D ; 61 189bc: 98 e3 ldi r25, 0x38 ; 56 189be: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 189c2: 0f 94 7d 35 call 0x26afa ; 0x26afa waiting_start_time = _millis(); 189c6: 0f 94 83 3f call 0x27f06 ; 0x27f06 189ca: 2b 01 movw r4, r22 189cc: 3c 01 movw r6, r24 189ce: 58 cf rjmp .-336 ; 0x18880 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 189d0: 64 e0 ldi r22, 0x04 ; 4 189d2: 81 e0 ldi r24, 0x01 ; 1 189d4: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 189d8: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 189dc: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 189e0: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 189e4: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 189e8: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 189ec: 7f 93 push r23 189ee: 6f 93 push r22 189f0: 9f 92 push r9 189f2: 8f 92 push r8 189f4: 0e 94 66 6f call 0xdecc ; 0xdecc 189f8: 0f 90 pop r0 189fa: 0f 90 pop r0 189fc: 0f 90 pop r0 189fe: 0f 90 pop r0 18a00: 50 cf rjmp .-352 ; 0x188a2 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 18a02: 11 11 cpse r17, r1 18a04: 03 c0 rjmp .+6 ; 0x18a0c 18a06: 8a 2d mov r24, r10 18a08: 0e 94 a2 8e call 0x11d44 ; 0x11d44 mmu_M600_load_filament(automatic); 18a0c: 81 2f mov r24, r17 18a0e: 0e 94 91 79 call 0xf322 ; 0xf322 18a12: 95 ce rjmp .-726 ; 0x1873e cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 18a14: 03 30 cpi r16, 0x03 ; 3 18a16: 10 f4 brcc .+4 ; 0x18a1c cursor_pos++; 18a18: 0f 5f subi r16, 0xFF ; 255 18a1a: d6 ce rjmp .-596 ; 0x187c8 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18a1c: 87 e0 ldi r24, 0x07 ; 7 18a1e: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee 18a22: d2 ce rjmp .-604 ; 0x187c8 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); 18a24: ce 01 movw r24, r28 18a26: 01 96 adiw r24, 0x01 ; 1 18a28: 0e 94 7d 73 call 0xe6fa ; 0xe6fa 18a2c: 8c ce rjmp .-744 ; 0x18746 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 18a2e: 0f 94 24 59 call 0x2b248 ; 0x2b248 load_filament_final_feed(); 18a32: 0e 94 40 65 call 0xca80 ; 0xca80 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(); 18a36: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 18a3a: 8d ec ldi r24, 0xCD ; 205 18a3c: 98 e3 ldi r25, 0x38 ; 56 18a3e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 18a42: ac 01 movw r20, r24 18a44: 60 e0 ldi r22, 0x00 ; 0 18a46: 80 e0 ldi r24, 0x00 ; 0 18a48: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18a4c: 89 e9 ldi r24, 0x99 ; 153 18a4e: 99 e3 ldi r25, 0x39 ; 57 18a50: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 18a54: ac 01 movw r20, r24 18a56: 62 e0 ldi r22, 0x02 ; 2 18a58: 80 e0 ldi r24, 0x00 ; 0 18a5a: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 18a5e: 87 e9 ldi r24, 0x97 ; 151 18a60: 9d e1 ldi r25, 0x1D ; 29 18a62: 0f 94 c8 36 call 0x26d90 ; 0x26d90 lcd_loading_color(); st_synchronize(); 18a66: 0f 94 24 59 call 0x2b248 ; 0x2b248 18a6a: 6d ce rjmp .-806 ; 0x18746 } void lcd_change_success() { lcd_clear(); 18a6c: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 18a70: 8d ed ldi r24, 0xDD ; 221 18a72: 98 e3 ldi r25, 0x38 ; 56 18a74: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 18a78: ac 01 movw r20, r24 18a7a: 62 e0 ldi r22, 0x02 ; 2 18a7c: 80 e0 ldi r24, 0x00 ; 0 18a7e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 //! @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) 18a82: 00 23 and r16, r16 18a84: 19 f0 breq .+6 ; 0x18a8c 18a86: 03 30 cpi r16, 0x03 ; 3 18a88: 09 f0 breq .+2 ; 0x18a8c 18a8a: 5d ce rjmp .-838 ; 0x18746 default: lcd_change_success(); break; } } return false; 18a8c: 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(); } 18a8e: 86 e8 ldi r24, 0x86 ; 134 18a90: 97 e1 ldi r25, 0x17 ; 23 18a92: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 18a96: b1 10 cpse r11, r1 18a98: be cd rjmp .-1156 ; 0x18616 if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 18a9a: 81 e0 ldi r24, 0x01 ; 1 18a9c: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 // Not let's go back to print fanSpeed = saved_fan_speed; 18aa0: 80 91 aa 05 lds r24, 0x05AA ; 0x8005aa 18aa4: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 // Feed a little of filament to stabilize pressure if (!automatic) { 18aa8: 11 11 cpse r17, r1 18aaa: 27 c0 rjmp .+78 ; 0x18afa if (printingIsPaused()) 18aac: 0e 94 32 68 call 0xd064 ; 0xd064 18ab0: c0 90 4d 07 lds r12, 0x074D ; 0x80074d 18ab4: d0 90 4e 07 lds r13, 0x074E ; 0x80074e 18ab8: e0 90 4f 07 lds r14, 0x074F ; 0x80074f 18abc: f0 90 50 07 lds r15, 0x0750 ; 0x800750 18ac0: 88 23 and r24, r24 18ac2: 09 f4 brne .+2 ; 0x18ac6 18ac4: a1 c0 rjmp .+322 ; 0x18c08 { // 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; 18ac6: 20 e0 ldi r18, 0x00 ; 0 18ac8: 30 e0 ldi r19, 0x00 ; 0 18aca: 40 e8 ldi r20, 0x80 ; 128 18acc: 5f e3 ldi r21, 0x3F ; 63 18ace: c7 01 movw r24, r14 18ad0: b6 01 movw r22, r12 18ad2: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 18ad6: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 18ada: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 18ade: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 18ae2: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 18ae6: 60 e0 ldi r22, 0x00 ; 0 18ae8: 70 e0 ldi r23, 0x00 ; 0 18aea: 88 ee ldi r24, 0xE8 ; 232 18aec: 92 e4 ldi r25, 0x42 ; 66 18aee: 0f 94 8b ba call 0x37516 ; 0x37516 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 18af2: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 18af6: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 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); 18afa: e0 90 49 07 lds r14, 0x0749 ; 0x800749 18afe: f0 90 4a 07 lds r15, 0x074A ; 0x80074a 18b02: 00 91 4b 07 lds r16, 0x074B ; 0x80074b 18b06: 10 91 4c 07 lds r17, 0x074C ; 0x80074c 18b0a: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 18b0e: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 18b12: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 18b16: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 18b1a: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 18b1e: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 18b22: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 18b26: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 18b2a: 1f 92 push r1 18b2c: 1f 92 push r1 18b2e: 1f 92 push r1 18b30: 1f 92 push r1 18b32: 81 2c mov r8, r1 18b34: 91 2c mov r9, r1 18b36: e8 e4 ldi r30, 0x48 ; 72 18b38: ae 2e mov r10, r30 18b3a: e2 e4 ldi r30, 0x42 ; 66 18b3c: be 2e mov r11, r30 18b3e: fd e4 ldi r31, 0x4D ; 77 18b40: cf 2e mov r12, r31 18b42: f7 e0 ldi r31, 0x07 ; 7 18b44: df 2e mov r13, r31 18b46: 0f 94 36 ab call 0x3566c ; 0x3566c st_synchronize(); 18b4a: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 18b4e: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 18b52: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 18b56: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 18b5a: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 18b5e: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 18b62: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 18b66: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 18b6a: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 18b6e: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 18b72: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 18b76: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 18b7a: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 18b7e: 1f 92 push r1 18b80: 1f 92 push r1 18b82: 1f 92 push r1 18b84: 1f 92 push r1 18b86: 81 2c mov r8, r1 18b88: 91 2c mov r9, r1 18b8a: a0 e7 ldi r26, 0x70 ; 112 18b8c: aa 2e mov r10, r26 18b8e: a1 e4 ldi r26, 0x41 ; 65 18b90: ba 2e mov r11, r26 18b92: 0f 94 36 ab call 0x3566c ; 0x3566c st_synchronize(); 18b96: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 18b9a: 87 ea ldi r24, 0xA7 ; 167 18b9c: 92 e0 ldi r25, 0x02 ; 2 18b9e: 0f 94 dc aa call 0x355b8 ; 0x355b8 memcpy(current_position, saved_pos, sizeof(saved_pos)); 18ba2: 80 e1 ldi r24, 0x10 ; 16 18ba4: eb e9 ldi r30, 0x9B ; 155 18ba6: f2 e0 ldi r31, 0x02 ; 2 18ba8: a1 e4 ldi r26, 0x41 ; 65 18baa: b7 e0 ldi r27, 0x07 ; 7 18bac: 01 90 ld r0, Z+ 18bae: 0d 92 st X+, r0 18bb0: 8a 95 dec r24 18bb2: e1 f7 brne .-8 ; 0x18bac set_destination_to_current(); 18bb4: 0e 94 e7 68 call 0xd1ce ; 0xd1ce // Recover feed rate feedmultiply = saved_feedmultiply2; 18bb8: 80 91 71 03 lds r24, 0x0371 ; 0x800371 18bbc: 90 91 72 03 lds r25, 0x0372 ; 0x800372 18bc0: 80 93 39 02 sts 0x0239, r24 ; 0x800239 18bc4: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 18bc8: 9f 93 push r25 18bca: 8f 93 push r24 18bcc: 8d e9 ldi r24, 0x9D ; 157 18bce: 91 e7 ldi r25, 0x71 ; 113 18bd0: 9f 93 push r25 18bd2: 8f 93 push r24 18bd4: 0e 94 e1 89 call 0x113c2 ; 0x113c2 if (printingIsPaused()) { 18bd8: 0e 94 32 68 call 0xd064 ; 0xd064 18bdc: 0f b6 in r0, 0x3f ; 63 18bde: f8 94 cli 18be0: de bf out 0x3e, r29 ; 62 18be2: 0f be out 0x3f, r0 ; 63 18be4: cd bf out 0x3d, r28 ; 61 18be6: 88 23 and r24, r24 18be8: 31 f1 breq .+76 ; 0x18c36 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 18bea: 8c e8 ldi r24, 0x8C ; 140 18bec: 90 e4 ldi r25, 0x40 ; 64 18bee: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 18bf2: 0f 94 e2 0b call 0x217c4 ; 0x217c4 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 18bf6: 10 92 73 07 sts 0x0773, r1 ; 0x800773 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 18bfa: 10 92 51 07 sts 0x0751, r1 ; 0x800751 18bfe: 0c 94 8d b2 jmp 0x1651a ; 0x1651a st_synchronize(); break; // Unload filament case 3: return true; 18c02: bb 24 eor r11, r11 18c04: b3 94 inc r11 18c06: 43 cf rjmp .-378 ; 0x18a8e setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 18c08: 20 e0 ldi r18, 0x00 ; 0 18c0a: 30 e0 ldi r19, 0x00 ; 0 18c0c: 40 ea ldi r20, 0xA0 ; 160 18c0e: 50 e4 ldi r21, 0x40 ; 64 18c10: c7 01 movw r24, r14 18c12: b6 01 movw r22, r12 18c14: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 18c18: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 18c1c: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 18c20: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 18c24: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 18c28: 60 e0 ldi r22, 0x00 ; 0 18c2a: 70 e0 ldi r23, 0x00 ; 0 18c2c: 80 e0 ldi r24, 0x00 ; 0 18c2e: 90 e4 ldi r25, 0x40 ; 64 18c30: 0f 94 8b ba call 0x37516 ; 0x37516 18c34: 62 cf rjmp .-316 ; 0x18afa if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18c36: 8a e6 ldi r24, 0x6A ; 106 18c38: 90 e7 ldi r25, 0x70 ; 112 18c3a: 0f 94 e2 0b call 0x217c4 ; 0x217c4 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 18c3e: 84 e2 ldi r24, 0x24 ; 36 18c40: 9b e6 ldi r25, 0x6B ; 107 18c42: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 18c46: d7 cf rjmp .-82 ; 0x18bf6 SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18c48: 0e 94 32 68 call 0xd064 ; 0xd064 18c4c: 81 11 cpse r24, r1 18c4e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a st_synchronize(); 18c52: 0f 94 24 59 call 0x2b248 ; 0x2b248 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18c56: 0e 94 ad 80 call 0x1015a ; 0x1015a cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18c5a: 0e 94 3f 78 call 0xf07e ; 0xf07e lcd_pause_print(); 18c5e: 0f 94 8f 3f call 0x27f1e ; 0x27f1e 18c62: 0c 94 8d b2 jmp 0x1651a ; 0x1651a /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 18c66: 0e 94 32 68 call 0xd064 ; 0xd064 18c6a: 88 23 and r24, r24 18c6c: 11 f4 brne .+4 ; 0x18c72 18c6e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 18c72: 0c 94 55 b3 jmp 0x166aa ; 0x166aa /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 18c76: 60 e0 ldi r22, 0x00 ; 0 18c78: 80 e0 ldi r24, 0x00 ; 0 18c7a: 0f 94 0f 16 call 0x22c1e ; 0x22c1e 18c7e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 18c82: 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')) { 18c84: 83 e5 ldi r24, 0x53 ; 83 18c86: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 18c8a: 88 23 and r24, r24 18c8c: b1 f0 breq .+44 ; 0x18cba iSel = code_value_uint8(); 18c8e: 0e 94 06 5c call 0xb80c ; 0xb80c 18c92: 18 2f mov r17, r24 if (iSel>=max_sheets) 18c94: 88 30 cpi r24, 0x08 ; 8 18c96: b0 f0 brcs .+44 ; 0x18cc4 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 18c98: 8a e2 ldi r24, 0x2A ; 42 18c9a: 97 e8 ldi r25, 0x87 ; 135 18c9c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18ca0: 4a e0 ldi r20, 0x0A ; 10 18ca2: 67 e0 ldi r22, 0x07 ; 7 18ca4: 70 e0 ldi r23, 0x00 ; 0 18ca6: 80 e0 ldi r24, 0x00 ; 0 18ca8: 90 e0 ldi r25, 0x00 ; 0 18caa: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 18cae: 83 ef ldi r24, 0xF3 ; 243 18cb0: 92 e0 ldi r25, 0x02 ; 2 18cb2: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c 18cb6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18cba: 81 ea ldi r24, 0xA1 ; 161 18cbc: 9d e0 ldi r25, 0x0D ; 13 18cbe: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 18cc2: 18 2f mov r17, r24 } if (code_seen('Z')){ 18cc4: 8a e5 ldi r24, 0x5A ; 90 18cc6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 18cca: 88 23 and r24, r24 18ccc: 09 f4 brne .+2 ; 0x18cd0 18cce: d7 c0 rjmp .+430 ; 0x18e7e z_val = code_value(); 18cd0: 0e 94 4a 61 call 0xc294 ; 0xc294 18cd4: 2b 01 movw r4, r22 18cd6: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 18cd8: 20 91 78 06 lds r18, 0x0678 ; 0x800678 18cdc: 30 91 79 06 lds r19, 0x0679 ; 0x800679 18ce0: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 18ce4: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 18ce8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 18cec: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 18cf0: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 18cf2: 9b 01 movw r18, r22 18cf4: 21 56 subi r18, 0x61 ; 97 18cf6: 30 4f sbci r19, 0xF0 ; 240 18cf8: 20 3a cpi r18, 0xA0 ; 160 18cfa: 3f 40 sbci r19, 0x0F ; 15 18cfc: 30 f0 brcs .+12 ; 0x18d0a { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 18cfe: 84 e1 ldi r24, 0x14 ; 20 18d00: 97 e8 ldi r25, 0x87 ; 135 18d02: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 18d06: 0c 94 8d b2 jmp 0x1651a ; 0x1651a break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 18d0a: 5b e0 ldi r21, 0x0B ; 11 18d0c: 15 9f mul r17, r21 18d0e: 90 01 movw r18, r0 18d10: 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); 18d12: c9 01 movw r24, r18 18d14: 80 5b subi r24, 0xB0 ; 176 18d16: 92 4f sbci r25, 0xF2 ; 242 18d18: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 { 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')) 18d1c: 8c e4 ldi r24, 0x4C ; 76 18d1e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 18d22: bb e0 ldi r27, 0x0B ; 11 18d24: 1b 9f mul r17, r27 18d26: 70 01 movw r14, r0 18d28: 11 24 eor r1, r1 18d2a: 57 01 movw r10, r14 18d2c: e7 eb ldi r30, 0xB7 ; 183 18d2e: ae 1a sub r10, r30 18d30: e2 ef ldi r30, 0xF2 ; 242 18d32: be 0a sbc r11, r30 18d34: 88 23 and r24, r24 18d36: 09 f4 brne .+2 ; 0x18d3a 18d38: be c0 rjmp .+380 ; 0x18eb6 { char *src = strchr_pointer + 1; 18d3a: e0 91 95 03 lds r30, 0x0395 ; 0x800395 18d3e: f0 91 96 03 lds r31, 0x0396 ; 0x800396 18d42: 31 96 adiw r30, 0x01 ; 1 18d44: bf 01 movw r22, r30 while (*src == ' ') ++src; 18d46: 81 91 ld r24, Z+ 18d48: 80 32 cpi r24, 0x20 ; 32 18d4a: e1 f3 breq .-8 ; 0x18d44 if (*src != '\0') 18d4c: 88 23 and r24, r24 18d4e: 31 f0 breq .+12 ; 0x18d5c { strncpy(strLabel,src,7); 18d50: 47 e0 ldi r20, 0x07 ; 7 18d52: 50 e0 ldi r21, 0x00 ; 0 18d54: ce 01 movw r24, r28 18d56: 01 96 adiw r24, 0x01 ; 1 18d58: 0f 94 09 e4 call 0x3c812 ; 0x3c812 #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); 18d5c: 47 e0 ldi r20, 0x07 ; 7 18d5e: 50 e0 ldi r21, 0x00 ; 0 18d60: b5 01 movw r22, r10 18d62: ce 01 movw r24, r28 18d64: 01 96 adiw r24, 0x01 ; 1 18d66: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 18d6a: 82 e4 ldi r24, 0x42 ; 66 18d6c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 18d70: 57 01 movw r10, r14 18d72: fe ea ldi r31, 0xAE ; 174 18d74: af 1a sub r10, r31 18d76: f2 ef ldi r31, 0xF2 ; 242 18d78: bf 0a sbc r11, r31 18d7a: 88 23 and r24, r24 18d7c: 09 f4 brne .+2 ; 0x18d80 18d7e: a3 c0 rjmp .+326 ; 0x18ec6 { iBedC = code_value_uint8(); 18d80: 0e 94 06 5c call 0xb80c ; 0xb80c 18d84: 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); 18d86: 68 2f mov r22, r24 18d88: c5 01 movw r24, r10 18d8a: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 18d8e: 80 e5 ldi r24, 0x50 ; 80 18d90: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 18d94: 2d ea ldi r18, 0xAD ; 173 18d96: e2 1a sub r14, r18 18d98: 22 ef ldi r18, 0xF2 ; 242 18d9a: f2 0a sbc r15, r18 18d9c: 88 23 and r24, r24 18d9e: 09 f4 brne .+2 ; 0x18da2 18da0: 97 c0 rjmp .+302 ; 0x18ed0 { iPindaC = code_value_uint8(); 18da2: 0e 94 06 5c call 0xb80c ; 0xb80c 18da6: b8 2e mov r11, r24 18da8: 68 2f mov r22, r24 18daa: c7 01 movw r24, r14 18dac: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 18db0: 81 e4 ldi r24, 0x41 ; 65 18db2: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 18db6: 88 23 and r24, r24 18db8: 09 f4 brne .+2 ; 0x18dbc 18dba: 8f c0 rjmp .+286 ; 0x18eda { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18dbc: 0e 94 06 5c call 0xb80c ; 0xb80c 18dc0: 81 11 cpse r24, r1 18dc2: 06 c0 rjmp .+12 ; 0x18dd0 18dc4: 81 ea ldi r24, 0xA1 ; 161 18dc6: 9d e0 ldi r25, 0x0D ; 13 18dc8: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 18dcc: 18 13 cpse r17, r24 18dce: 8d c0 rjmp .+282 ; 0x18eea if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 18dd0: 81 2f mov r24, r17 18dd2: 0e 94 c4 77 call 0xef88 ; 0xef88 18dd6: 08 2f mov r16, r24 18dd8: 88 23 and r24, r24 18dda: 29 f0 breq .+10 ; 0x18de6 18ddc: 61 2f mov r22, r17 18dde: 81 ea ldi r24, 0xA1 ; 161 18de0: 9d e0 ldi r25, 0x0D ; 13 18de2: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 18de6: 8d e0 ldi r24, 0x0D ; 13 18de8: 97 e8 ldi r25, 0x87 ; 135 18dea: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18dee: 61 2f mov r22, r17 18df0: 70 e0 ldi r23, 0x00 ; 0 18df2: 90 e0 ldi r25, 0x00 ; 0 18df4: 80 e0 ldi r24, 0x00 ; 0 18df6: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 18dfa: 81 2f mov r24, r17 18dfc: 0e 94 c4 77 call 0xef88 ; 0xef88 18e00: 81 11 cpse r24, r1 18e02: 04 c0 rjmp .+8 ; 0x18e0c SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 18e04: 8c ef ldi r24, 0xFC ; 252 18e06: 96 e8 ldi r25, 0x86 ; 134 18e08: 0e 94 fe 7a call 0xf5fc ; 0xf5fc SERIAL_PROTOCOLPGM(" Z"); 18e0c: 89 ef ldi r24, 0xF9 ; 249 18e0e: 96 e8 ldi r25, 0x86 ; 134 18e10: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18e14: 44 e0 ldi r20, 0x04 ; 4 18e16: c3 01 movw r24, r6 18e18: b2 01 movw r22, r4 18e1a: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 18e1e: 86 ef ldi r24, 0xF6 ; 246 18e20: 96 e8 ldi r25, 0x86 ; 134 18e22: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18e26: b6 01 movw r22, r12 18e28: dd 0c add r13, r13 18e2a: 88 0b sbc r24, r24 18e2c: 99 0b sbc r25, r25 18e2e: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 18e32: 83 ef ldi r24, 0xF3 ; 243 18e34: 96 e8 ldi r25, 0x86 ; 134 18e36: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 18e3a: ce 01 movw r24, r28 18e3c: 01 96 adiw r24, 0x01 ; 1 18e3e: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 18e42: 80 ef ldi r24, 0xF0 ; 240 18e44: 96 e8 ldi r25, 0x86 ; 134 18e46: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 18e4a: 69 2d mov r22, r9 18e4c: 70 e0 ldi r23, 0x00 ; 0 18e4e: 90 e0 ldi r25, 0x00 ; 0 18e50: 80 e0 ldi r24, 0x00 ; 0 18e52: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18e56: 8d ee ldi r24, 0xED ; 237 18e58: 96 e8 ldi r25, 0x86 ; 134 18e5a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 18e5e: 6b 2d mov r22, r11 18e60: 70 e0 ldi r23, 0x00 ; 0 18e62: 90 e0 ldi r25, 0x00 ; 0 18e64: 80 e0 ldi r24, 0x00 ; 0 18e66: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 18e6a: 8a ee ldi r24, 0xEA ; 234 18e6c: 96 e8 ldi r25, 0x86 ; 134 18e6e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLLN((int)bIsActive); 18e72: 80 2f mov r24, r16 18e74: 90 e0 ldi r25, 0x00 ; 0 18e76: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 18e7a: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } 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))); 18e7e: ab e0 ldi r26, 0x0B ; 11 18e80: 1a 9f mul r17, r26 18e82: c0 01 movw r24, r0 18e84: 11 24 eor r1, r1 18e86: 80 5b subi r24, 0xB0 ; 176 18e88: 92 4f sbci r25, 0xF2 ; 242 18e8a: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 18e8e: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 18e90: bc 01 movw r22, r24 18e92: 99 0f add r25, r25 18e94: 88 0b sbc r24, r24 18e96: 99 0b sbc r25, r25 18e98: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 18e9c: 20 91 78 06 lds r18, 0x0678 ; 0x800678 18ea0: 30 91 79 06 lds r19, 0x0679 ; 0x800679 18ea4: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 18ea8: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 18eac: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 18eb0: 2b 01 movw r4, r22 18eb2: 3c 01 movw r6, r24 18eb4: 33 cf rjmp .-410 ; 0x18d1c } 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)); 18eb6: 47 e0 ldi r20, 0x07 ; 7 18eb8: 50 e0 ldi r21, 0x00 ; 0 18eba: b5 01 movw r22, r10 18ebc: ce 01 movw r24, r28 18ebe: 01 96 adiw r24, 0x01 ; 1 18ec0: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 18ec4: 52 cf rjmp .-348 ; 0x18d6a 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); 18ec6: c5 01 movw r24, r10 18ec8: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 18ecc: 98 2e mov r9, r24 18ece: 5f cf rjmp .-322 ; 0x18d8e 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); 18ed0: c7 01 movw r24, r14 18ed2: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 18ed6: b8 2e mov r11, r24 18ed8: 6b cf rjmp .-298 ; 0x18db0 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18eda: 81 ea ldi r24, 0xA1 ; 161 18edc: 9d e0 ldi r25, 0x0D ; 13 18ede: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 18ee2: 01 e0 ldi r16, 0x01 ; 1 18ee4: 18 17 cp r17, r24 18ee6: 09 f4 brne .+2 ; 0x18eea 18ee8: 7e cf rjmp .-260 ; 0x18de6 { 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; 18eea: 00 e0 ldi r16, 0x00 ; 0 18eec: 7c cf rjmp .-264 ; 0x18de6 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)) ) { 18eee: c3 01 movw r24, r6 18ef0: b2 01 movw r22, r4 18ef2: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 18ef6: 20 91 97 03 lds r18, 0x0397 ; 0x800397 18efa: 30 91 98 03 lds r19, 0x0398 ; 0x800398 18efe: 40 91 99 03 lds r20, 0x0399 ; 0x800399 18f02: 50 91 9a 03 lds r21, 0x039A ; 0x80039a 18f06: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 18f0a: 87 fd sbrc r24, 7 18f0c: 02 c0 rjmp .+4 ; 0x18f12 18f0e: 0c 94 76 b2 jmp 0x164ec ; 0x164ec if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 18f12: 0f 94 83 3f call 0x27f06 ; 0x27f06 18f16: 68 19 sub r22, r8 18f18: 79 09 sbc r23, r9 18f1a: 8a 09 sbc r24, r10 18f1c: 9b 09 sbc r25, r11 18f1e: 69 3e cpi r22, 0xE9 ; 233 18f20: 73 40 sbci r23, 0x03 ; 3 18f22: 81 05 cpc r24, r1 18f24: 91 05 cpc r25, r1 18f26: c8 f0 brcs .+50 ; 0x18f5a { SERIAL_PROTOCOLPGM("P:"); 18f28: 84 ec ldi r24, 0xC4 ; 196 18f2a: 96 e8 ldi r25, 0x86 ; 134 18f2c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18f30: 60 91 97 03 lds r22, 0x0397 ; 0x800397 18f34: 70 91 98 03 lds r23, 0x0398 ; 0x800398 18f38: 80 91 99 03 lds r24, 0x0399 ; 0x800399 18f3c: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 18f40: 41 e0 ldi r20, 0x01 ; 1 18f42: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18f46: 8f e2 ldi r24, 0x2F ; 47 18f48: 0e 94 ba 78 call 0xf174 ; 0xf174 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 18f4c: c8 01 movw r24, r16 18f4e: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 codenum = _millis(); 18f52: 0f 94 83 3f call 0x27f06 ; 0x27f06 18f56: 4b 01 movw r8, r22 18f58: 5c 01 movw r10, r24 } manage_heater(); 18f5a: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(); 18f5e: 80 e0 ldi r24, 0x00 ; 0 18f60: 0e 94 da 8b call 0x117b4 ; 0x117b4 lcd_update(0); 18f64: 80 e0 ldi r24, 0x00 ; 0 18f66: 0e 94 54 6f call 0xdea8 ; 0xdea8 18f6a: 0c 94 5d b2 jmp 0x164ba ; 0x164ba - `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 18f6e: 8f e3 ldi r24, 0x3F ; 63 18f70: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 18f74: 88 23 and r24, r24 18f76: c9 f0 breq .+50 ; 0x18faa SERIAL_PROTOCOLPGM("PINDA cal status: "); 18f78: 81 eb ldi r24, 0xB1 ; 177 18f7a: 96 e8 ldi r25, 0x86 ; 134 18f7c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 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); } 18f80: 86 ea ldi r24, 0xA6 ; 166 18f82: 9f e0 ldi r25, 0x0F ; 15 18f84: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 18f88: 21 e0 ldi r18, 0x01 ; 1 18f8a: 30 e0 ldi r19, 0x00 ; 0 18f8c: 81 11 cpse r24, r1 18f8e: 02 c0 rjmp .+4 ; 0x18f94 18f90: 30 e0 ldi r19, 0x00 ; 0 18f92: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 18f94: c9 01 movw r24, r18 18f96: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 SERIAL_PROTOCOLLNRPGM(_header); 18f9a: 8a e9 ldi r24, 0x9A ; 154 18f9c: 96 e8 ldi r25, 0x86 ; 134 18f9e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc gcode_M861_print_pinda_cal_eeprom(); 18fa2: 0e 94 0b 79 call 0xf216 ; 0xf216 18fa6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else if (code_seen('!')) { // ! - Set factory default values 18faa: 81 e2 ldi r24, 0x21 ; 33 18fac: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 18fb0: 88 23 and r24, r24 18fb2: 49 f1 breq .+82 ; 0x19006 18fb4: 61 e0 ldi r22, 0x01 ; 1 18fb6: 86 ea ldi r24, 0xA6 ; 166 18fb8: 9f e0 ldi r25, 0x0F ; 15 18fba: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 18fbe: 68 e0 ldi r22, 0x08 ; 8 18fc0: 70 e0 ldi r23, 0x00 ; 0 18fc2: 80 eb ldi r24, 0xB0 ; 176 18fc4: 9f e0 ldi r25, 0x0F ; 15 18fc6: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 18fca: 68 e1 ldi r22, 0x18 ; 24 18fcc: 70 e0 ldi r23, 0x00 ; 0 18fce: 82 eb ldi r24, 0xB2 ; 178 18fd0: 9f e0 ldi r25, 0x0F ; 15 18fd2: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 18fd6: 60 e3 ldi r22, 0x30 ; 48 18fd8: 70 e0 ldi r23, 0x00 ; 0 18fda: 84 eb ldi r24, 0xB4 ; 180 18fdc: 9f e0 ldi r25, 0x0F ; 15 18fde: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 18fe2: 60 e5 ldi r22, 0x50 ; 80 18fe4: 70 e0 ldi r23, 0x00 ; 0 18fe6: 86 eb ldi r24, 0xB6 ; 182 18fe8: 9f e0 ldi r25, 0x0F ; 15 18fea: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 18fee: 68 e7 ldi r22, 0x78 ; 120 18ff0: 70 e0 ldi r23, 0x00 ; 0 18ff2: 88 eb ldi r24, 0xB8 ; 184 18ff4: 9f e0 ldi r25, 0x0F ; 15 18ff6: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 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"); 18ffa: 89 e8 ldi r24, 0x89 ; 137 18ffc: 96 e8 ldi r25, 0x86 ; 134 18ffe: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 19002: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 19006: 8a e5 ldi r24, 0x5A ; 90 19008: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1900c: 88 23 and r24, r24 1900e: c1 f0 breq .+48 ; 0x19040 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 19010: 61 e0 ldi r22, 0x01 ; 1 19012: 86 ea ldi r24, 0xA6 ; 166 19014: 9f e0 ldi r25, 0x0F ; 15 19016: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 1901a: 00 eb ldi r16, 0xB0 ; 176 1901c: 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); 1901e: 70 e0 ldi r23, 0x00 ; 0 19020: 60 e0 ldi r22, 0x00 ; 0 19022: c8 01 movw r24, r16 19024: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 19028: 0e 5f subi r16, 0xFE ; 254 1902a: 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++) { 1902c: 0a 3b cpi r16, 0xBA ; 186 1902e: 4f e0 ldi r20, 0x0F ; 15 19030: 14 07 cpc r17, r20 19032: a9 f7 brne .-22 ; 0x1901e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 19034: 8f e7 ldi r24, 0x7F ; 127 19036: 96 e8 ldi r25, 0x86 ; 134 19038: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 1903c: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 19040: 83 e5 ldi r24, 0x53 ; 83 19042: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19046: 88 23 and r24, r24 19048: 21 f1 breq .+72 ; 0x19092 int16_t usteps = code_value_short(); 1904a: 0e 94 13 5c call 0xb826 ; 0xb826 1904e: 8c 01 movw r16, r24 if (code_seen('I')) { 19050: 89 e4 ldi r24, 0x49 ; 73 19052: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19056: 88 23 and r24, r24 19058: 11 f4 brne .+4 ; 0x1905e 1905a: 0c 94 8d b2 jmp 0x1651a ; 0x1651a uint8_t index = code_value_uint8(); 1905e: 0e 94 06 5c call 0xb80c ; 0xb80c if (index < 5) { 19062: 85 30 cpi r24, 0x05 ; 5 19064: 10 f0 brcs .+4 ; 0x1906a 19066: 0c 94 8d b2 jmp 0x1651a ; 0x1651a eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 1906a: 90 e0 ldi r25, 0x00 ; 0 1906c: 88 52 subi r24, 0x28 ; 40 1906e: 98 4f sbci r25, 0xF8 ; 248 19070: b8 01 movw r22, r16 19072: 88 0f add r24, r24 19074: 99 1f adc r25, r25 19076: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 SERIAL_PROTOCOLLNRPGM(MSG_OK); 1907a: 8a e0 ldi r24, 0x0A ; 10 1907c: 9e e6 ldi r25, 0x6E ; 110 1907e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc SERIAL_PROTOCOLLNRPGM(_header); 19082: 8a e9 ldi r24, 0x9A ; 154 19084: 96 e8 ldi r25, 0x86 ; 134 19086: 0e 94 fe 7a call 0xf5fc ; 0xf5fc gcode_M861_print_pinda_cal_eeprom(); 1908a: 0e 94 0b 79 call 0xf216 ; 0xf216 1908e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 19092: 8e e6 ldi r24, 0x6E ; 110 19094: 96 e8 ldi r25, 0x86 ; 134 19096: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 1909a: 0c 94 8d b2 jmp 0x1651a ; 0x1651a */ 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); 1909e: 0e 94 4a 61 call 0xc294 ; 0xc294 190a2: 20 e0 ldi r18, 0x00 ; 0 190a4: 30 e0 ldi r19, 0x00 ; 0 190a6: 40 e2 ldi r20, 0x20 ; 32 190a8: 51 e4 ldi r21, 0x41 ; 65 190aa: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 190ae: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 190b2: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 190b4: 63 30 cpi r22, 0x03 ; 3 190b6: 09 f4 brne .+2 ; 0x190ba 190b8: a2 c0 rjmp .+324 ; 0x191fe 190ba: 98 f5 brcc .+102 ; 0x19122 190bc: 61 30 cpi r22, 0x01 ; 1 190be: 09 f4 brne .+2 ; 0x190c2 190c0: 59 c0 rjmp .+178 ; 0x19174 190c2: 62 30 cpi r22, 0x02 ; 2 190c4: 11 f0 breq .+4 ; 0x190ca 190c6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 190ca: 80 91 96 13 lds r24, 0x1396 ; 0x801396 return pgm_read_word(&_nPrinterMmuType); 190ce: e4 e9 ldi r30, 0x94 ; 148 190d0: ff e7 ldi r31, 0x7F ; 127 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 190d2: 81 30 cpi r24, 0x01 ; 1 190d4: 11 f0 breq .+4 ; 0x190da return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 190d6: e6 e9 ldi r30, 0x96 ; 150 190d8: ff e7 ldi r31, 0x7F ; 127 190da: 05 91 lpm r16, Z+ 190dc: 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')) 190de: 80 e5 ldi r24, 0x50 ; 80 190e0: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 190e4: 88 23 and r24, r24 190e6: 09 f4 brne .+2 ; 0x190ea 190e8: 79 c0 rjmp .+242 ; 0x191dc { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 190ea: 0e 94 20 5c call 0xb840 ; 0xb840 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 190ee: f0 90 eb 04 lds r15, 0x04EB ; 0x8004eb 190f2: ff 20 and r15, r15 190f4: 11 f4 brne .+4 ; 0x190fa 190f6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a return; if (nPrinterModel == actualPrinterModel) 190fa: 60 17 cp r22, r16 190fc: 71 07 cpc r23, r17 190fe: 11 f4 brne .+4 ; 0x19104 19100: 0c 94 8d b2 jmp 0x1651a ; 0x1651a // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 19104: 8d eb ldi r24, 0xBD ; 189 19106: 97 e3 ldi r25, 0x37 ; 55 19108: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1910c: 8c 01 movw r16, r24 1910e: 8f e8 ldi r24, 0x8F ; 143 19110: 97 e3 ldi r25, 0x37 ; 55 19112: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19116: 4f 2d mov r20, r15 19118: b8 01 movw r22, r16 1911a: 0f 94 66 16 call 0x22ccc ; 0x22ccc 1911e: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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) 19122: 64 30 cpi r22, 0x04 ; 4 19124: 09 f4 brne .+2 ; 0x19128 19126: be c0 rjmp .+380 ; 0x192a4 19128: 65 30 cpi r22, 0x05 ; 5 1912a: 11 f0 breq .+4 ; 0x19130 1912c: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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')) 19130: 80 e5 ldi r24, 0x50 ; 80 19132: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19136: 88 23 and r24, r24 19138: 09 f4 brne .+2 ; 0x1913c 1913a: 3a c1 rjmp .+628 ; 0x193b0 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 1913c: 0e 94 20 5c call 0xb840 ; 0xb840 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 19140: 10 91 e9 04 lds r17, 0x04E9 ; 0x8004e9 19144: 11 23 and r17, r17 19146: 11 f4 brne .+4 ; 0x1914c 19148: 0c 94 8d b2 jmp 0x1651a ; 0x1651a return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 1914c: 62 30 cpi r22, 0x02 ; 2 1914e: 71 05 cpc r23, r1 19150: 10 f4 brcc .+4 ; 0x19156 19152: 0c 94 8d b2 jmp 0x1651a ; 0x1651a // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 19156: 8f ed ldi r24, 0xDF ; 223 19158: 96 e3 ldi r25, 0x36 ; 54 1915a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1915e: 7c 01 movw r14, r24 19160: 88 eb ldi r24, 0xB8 ; 184 19162: 96 e3 ldi r25, 0x36 ; 54 19164: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19168: 41 2f mov r20, r17 1916a: b7 01 movw r22, r14 1916c: 0f 94 66 16 call 0x22ccc ; 0x22ccc 19170: 0c 94 8d b2 jmp 0x1651a ; 0x1651a ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 19174: 80 e5 ldi r24, 0x50 ; 80 19176: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1917a: 88 23 and r24, r24 1917c: a9 f0 breq .+42 ; 0x191a8 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 1917e: 0e 94 4a 61 call 0xc294 ; 0xc294 19182: 20 e0 ldi r18, 0x00 ; 0 19184: 30 e0 ldi r19, 0x00 ; 0 19186: 4a e7 ldi r20, 0x7A ; 122 19188: 54 e4 ldi r21, 0x44 ; 68 1918a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1918e: 20 e0 ldi r18, 0x00 ; 0 19190: 30 e0 ldi r19, 0x00 ; 0 19192: 40 e0 ldi r20, 0x00 ; 0 19194: 5f e3 ldi r21, 0x3F ; 63 19196: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1919a: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> nozzle_diameter_check(nDiameter); 1919e: cb 01 movw r24, r22 191a0: 0f 94 a5 16 call 0x22d4a ; 0x22d4a 191a4: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } else if(code_seen('Q')) 191a8: 81 e5 ldi r24, 0x51 ; 81 191aa: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 191ae: 88 23 and r24, r24 191b0: 11 f4 brne .+4 ; 0x191b6 191b2: 0c 94 8d b2 jmp 0x1651a ; 0x1651a SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 191b6: 85 ea ldi r24, 0xA5 ; 165 191b8: 9d e0 ldi r25, 0x0D ; 13 191ba: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 191be: bc 01 movw r22, r24 191c0: 90 e0 ldi r25, 0x00 ; 0 191c2: 80 e0 ldi r24, 0x00 ; 0 191c4: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 191c8: 20 e0 ldi r18, 0x00 ; 0 191ca: 30 e0 ldi r19, 0x00 ; 0 191cc: 4a e7 ldi r20, 0x7A ; 122 191ce: 54 e4 ldi r21, 0x44 ; 68 191d0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 191d4: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 191d8: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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')) 191dc: 81 e5 ldi r24, 0x51 ; 81 191de: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 191e2: 88 23 and r24, r24 191e4: 11 f4 brne .+4 ; 0x191ea 191e6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 191ea: b8 01 movw r22, r16 191ec: 90 e0 ldi r25, 0x00 ; 0 191ee: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 191f0: 4a e0 ldi r20, 0x0A ; 10 191f2: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 191f6: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 191fa: 0c 94 8d b2 jmp 0x1651a ; 0x1651a return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 191fe: 80 91 96 13 lds r24, 0x1396 ; 0x801396 return _sPrinterMmuName; 19202: 6b e8 ldi r22, 0x8B ; 139 19204: e6 2e mov r14, r22 19206: 6f e7 ldi r22, 0x7F ; 127 19208: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 1920a: 81 30 cpi r24, 0x01 ; 1 1920c: 21 f0 breq .+8 ; 0x19216 return _sPrinterMmuName; } else { return _sPrinterName; 1920e: 56 e8 ldi r21, 0x86 ; 134 19210: e5 2e mov r14, r21 19212: 5f e7 ldi r21, 0x7F ; 127 19214: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 19216: 80 e5 ldi r24, 0x50 ; 80 19218: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 1921c: 88 23 and r24, r24 1921e: b1 f1 breq .+108 ; 0x1928c , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 19220: 62 e2 ldi r22, 0x22 ; 34 19222: 70 e0 ldi r23, 0x00 ; 0 19224: 80 91 95 03 lds r24, 0x0395 ; 0x800395 19228: 90 91 96 03 lds r25, 0x0396 ; 0x800396 1922c: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 19230: 8c 01 movw r16, r24 if (!this->ptr) { 19232: 89 2b or r24, r25 19234: d1 f0 breq .+52 ; 0x1926a // First quote not found return; } // Skip the leading quote this->ptr++; 19236: 0f 5f subi r16, 0xFF ; 255 19238: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 1923a: 62 e2 ldi r22, 0x22 ; 34 1923c: 70 e0 ldi r23, 0x00 ; 0 1923e: c8 01 movw r24, r16 19240: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 if(!pStrEnd) { 19244: 00 97 sbiw r24, 0x00 ; 0 19246: 89 f0 breq .+34 ; 0x1926a // Second quote not found return; } this->len = pStrEnd - this->ptr; 19248: d8 2e mov r13, r24 1924a: d0 1a sub r13, r16 1924c: c7 01 movw r24, r14 1924e: 0f 94 47 db call 0x3b68e ; 0x3b68e <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 19252: d8 12 cpse r13, r24 19254: 0a c0 rjmp .+20 ; 0x1926a if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 19256: ac 01 movw r20, r24 19258: 55 27 eor r21, r21 1925a: b7 01 movw r22, r14 1925c: c8 01 movw r24, r16 1925e: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 19262: 89 2b or r24, r25 19264: 11 f4 brne .+4 ; 0x1926a 19266: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } } render_M862_warnings( 1926a: f0 90 eb 04 lds r15, 0x04EB ; 0x8004eb 1926e: 8d eb ldi r24, 0xBD ; 189 19270: 97 e3 ldi r25, 0x37 ; 55 19272: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19276: 8c 01 movw r16, r24 19278: 8f e8 ldi r24, 0x8F ; 143 1927a: 97 e3 ldi r25, 0x37 ; 55 1927c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19280: 4f 2d mov r20, r15 19282: b8 01 movw r22, r16 19284: 0f 94 66 16 call 0x22ccc ; 0x22ccc 19288: 0c 94 8d b2 jmp 0x1651a ; 0x1651a { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 1928c: 81 e5 ldi r24, 0x51 ; 81 1928e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19292: 88 23 and r24, r24 19294: 11 f4 brne .+4 ; 0x1929a 19296: 0c 94 8d b2 jmp 0x1651a ; 0x1651a SERIAL_PROTOCOLLNRPGM(type); 1929a: c7 01 movw r24, r14 1929c: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 192a0: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 192a4: 80 e5 ldi r24, 0x50 ; 80 192a6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 192aa: 88 23 and r24, r24 192ac: 09 f4 brne .+2 ; 0x192b0 192ae: 77 c0 rjmp .+238 ; 0x1939e fw_version_check(++strchr_pointer); 192b0: 80 91 95 03 lds r24, 0x0395 ; 0x800395 192b4: 90 91 96 03 lds r25, 0x0396 ; 0x800396 192b8: 01 96 adiw r24, 0x01 ; 1 192ba: 90 93 96 03 sts 0x0396, r25 ; 0x800396 192be: 80 93 95 03 sts 0x0395, r24 ; 0x800395 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 192c2: 20 91 ea 04 lds r18, 0x04EA ; 0x8004ea 192c6: 22 23 and r18, r18 192c8: 11 f4 brne .+4 ; 0x192ce 192ca: 0c 94 8d b2 jmp 0x1651a ; 0x1651a return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 192ce: be 01 movw r22, r28 192d0: 6f 5f subi r22, 0xFF ; 255 192d2: 7f 4f sbci r23, 0xFF ; 255 192d4: 0e 94 50 f9 call 0x1f2a0 ; 0x1f2a0 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 192d8: 8a e0 ldi r24, 0x0A ; 10 192da: 90 e0 ldi r25, 0x00 ; 0 192dc: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 192e0: 29 81 ldd r18, Y+1 ; 0x01 192e2: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 192e4: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 192e6: 82 17 cp r24, r18 192e8: 93 07 cpc r25, r19 192ea: 28 f0 brcs .+10 ; 0x192f6 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 192ec: 11 e0 ldi r17, 0x01 ; 1 192ee: 28 17 cp r18, r24 192f0: 39 07 cpc r19, r25 192f2: 08 f4 brcc .+2 ; 0x192f6 192f4: 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; 192f6: 12 95 swap r17 192f8: 11 0f add r17, r17 192fa: 11 0f add r17, r17 192fc: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 192fe: 8c e0 ldi r24, 0x0C ; 12 19300: 90 e0 ldi r25, 0x00 ; 0 19302: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 19306: ac 01 movw r20, r24 19308: 2b 81 ldd r18, Y+3 ; 0x03 1930a: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 1930c: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1930e: 42 17 cp r20, r18 19310: 53 07 cpc r21, r19 19312: 28 f0 brcs .+10 ; 0x1931e return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19314: 81 e0 ldi r24, 0x01 ; 1 19316: 24 17 cp r18, r20 19318: 35 07 cpc r19, r21 1931a: 08 f4 brcc .+2 ; 0x1931e 1931c: 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; 1931e: 50 e1 ldi r21, 0x10 ; 16 19320: 85 9f mul r24, r21 19322: c0 01 movw r24, r0 19324: 11 24 eor r1, r1 19326: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 19328: 8e e0 ldi r24, 0x0E ; 14 1932a: 90 e0 ldi r25, 0x00 ; 0 1932c: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 19330: ac 01 movw r20, r24 19332: 2d 81 ldd r18, Y+5 ; 0x05 19334: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19336: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19338: 42 17 cp r20, r18 1933a: 53 07 cpc r21, r19 1933c: 28 f0 brcs .+10 ; 0x19348 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 1933e: 81 e0 ldi r24, 0x01 ; 1 19340: 24 17 cp r18, r20 19342: 35 07 cpc r19, r21 19344: 08 f4 brcc .+2 ; 0x19348 19346: 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; 19348: a4 e0 ldi r26, 0x04 ; 4 1934a: 8a 9f mul r24, r26 1934c: c0 01 movw r24, r0 1934e: 11 24 eor r1, r1 19350: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 19352: 80 e1 ldi r24, 0x10 ; 16 19354: 90 e0 ldi r25, 0x00 ; 0 19356: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 1935a: ac 01 movw r20, r24 1935c: 2f 81 ldd r18, Y+7 ; 0x07 1935e: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19360: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19362: 42 17 cp r20, r18 19364: 53 07 cpc r21, r19 19366: 28 f0 brcs .+10 ; 0x19372 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19368: 91 e0 ldi r25, 0x01 ; 1 1936a: 24 17 cp r18, r20 1936c: 35 07 cpc r19, r21 1936e: 08 f4 brcc .+2 ; 0x19372 19370: 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)); 19372: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 19374: 16 35 cpi r17, 0x56 ; 86 19376: 10 f4 brcc .+4 ; 0x1937c 19378: 0c 94 8d b2 jmp 0x1651a ; 0x1651a SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 1937c: f0 90 ea 04 lds r15, 0x04EA ; 0x8004ea 19380: 8d e4 ldi r24, 0x4D ; 77 19382: 97 e3 ldi r25, 0x37 ; 55 19384: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19388: 8c 01 movw r16, r24 1938a: 87 e2 ldi r24, 0x27 ; 39 1938c: 97 e3 ldi r25, 0x37 ; 55 1938e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19392: 4f 2d mov r20, r15 19394: b8 01 movw r22, r16 19396: 0f 94 66 16 call 0x22ccc ; 0x22ccc 1939a: 0c 94 8d b2 jmp 0x1651a ; 0x1651a else if(code_seen('Q')) 1939e: 81 e5 ldi r24, 0x51 ; 81 193a0: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 193a4: 88 23 and r24, r24 193a6: 11 f4 brne .+4 ; 0x193ac 193a8: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 193ac: 0c 94 41 a9 jmp 0x15282 ; 0x15282 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 193b0: 81 e5 ldi r24, 0x51 ; 81 193b2: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 193b6: 88 23 and r24, r24 193b8: 11 f4 brne .+4 ; 0x193be 193ba: 0c 94 8d b2 jmp 0x1651a ; 0x1651a SERIAL_PROTOCOLLN(GCODE_LEVEL); 193be: 81 e0 ldi r24, 0x01 ; 1 193c0: 90 e0 ldi r25, 0x00 ; 0 193c2: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 193c6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a * 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; 193ca: 8b e4 ldi r24, 0x4B ; 75 193cc: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 193d0: c1 2c mov r12, r1 193d2: d1 2c mov r13, r1 193d4: e1 2c mov r14, r1 193d6: 40 ec ldi r20, 0xC0 ; 192 193d8: f4 2e mov r15, r20 193da: 88 23 and r24, r24 193dc: 49 f1 breq .+82 ; 0x19430 193de: 0e 94 4a 61 call 0xc294 ; 0xc294 193e2: 6b 01 movw r12, r22 193e4: 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) 193e6: 20 e0 ldi r18, 0x00 ; 0 193e8: 30 e0 ldi r19, 0x00 ; 0 193ea: a9 01 movw r20, r18 193ec: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 193f0: 81 11 cpse r24, r1 193f2: 1e c0 rjmp .+60 ; 0x19430 { extruder_advance_K = 0; 193f4: 10 92 05 18 sts 0x1805, r1 ; 0x801805 193f8: 10 92 06 18 sts 0x1806, r1 ; 0x801806 193fc: 10 92 07 18 sts 0x1807, r1 ; 0x801807 19400: 10 92 08 18 sts 0x1808, r1 ; 0x801808 19404: 0e 94 3a 83 call 0x10674 ; 0x10674 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 19408: 82 ee ldi r24, 0xE2 ; 226 1940a: 99 ea ldi r25, 0xA9 ; 169 1940c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM("Advance K="); 19410: 83 e6 ldi r24, 0x63 ; 99 19412: 9f e7 ldi r25, 0x7F ; 127 19414: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(extruder_advance_K); 19418: 60 91 05 18 lds r22, 0x1805 ; 0x801805 1941c: 70 91 06 18 lds r23, 0x1806 ; 0x801806 19420: 80 91 07 18 lds r24, 0x1807 ; 0x801807 19424: 90 91 08 18 lds r25, 0x1808 ; 0x801808 19428: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 1942c: 0c 94 8d b2 jmp 0x1651a ; 0x1651a } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 19430: 80 91 70 03 lds r24, 0x0370 ; 0x800370 19434: 81 11 cpse r24, r1 19436: 1b c0 rjmp .+54 ; 0x1946e { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 19438: 20 e0 ldi r18, 0x00 ; 0 1943a: 30 e0 ldi r19, 0x00 ; 0 1943c: a9 01 movw r20, r18 1943e: c7 01 movw r24, r14 19440: b6 01 movw r22, r12 19442: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 19446: 87 ff sbrs r24, 7 19448: 05 c0 rjmp .+10 ; 0x19454 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 1944a: 8e e6 ldi r24, 0x6E ; 110 1944c: 9f e7 ldi r25, 0x7F ; 127 1944e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 19452: da cf rjmp .-76 ; 0x19408 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 19454: 20 e0 ldi r18, 0x00 ; 0 19456: 30 e0 ldi r19, 0x00 ; 0 19458: 40 e2 ldi r20, 0x20 ; 32 1945a: 51 e4 ldi r21, 0x41 ; 65 1945c: c7 01 movw r24, r14 1945e: b6 01 movw r22, r12 19460: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 19464: 87 ff sbrs r24, 7 19466: 2c c0 rjmp .+88 ; 0x194c0 19468: 81 e0 ldi r24, 0x01 ; 1 1946a: 0e 94 3a 83 call 0x10674 ; 0x10674 } if(la10c_mode == LA10C_LA15) 1946e: 80 91 70 03 lds r24, 0x0370 ; 0x800370 return (k >= 0 && k < LA_K_MAX? k: -1); 19472: 20 e0 ldi r18, 0x00 ; 0 19474: 30 e0 ldi r19, 0x00 ; 0 19476: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 19478: 81 30 cpi r24, 0x01 ; 1 1947a: 21 f5 brne .+72 ; 0x194c4 return (k >= 0 && k < LA_K_MAX? k: -1); 1947c: c7 01 movw r24, r14 1947e: b6 01 movw r22, r12 19480: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 19484: 87 fd sbrc r24, 7 19486: e1 cf rjmp .-62 ; 0x1944a 19488: 20 e0 ldi r18, 0x00 ; 0 1948a: 30 e0 ldi r19, 0x00 ; 0 1948c: 40 e2 ldi r20, 0x20 ; 32 1948e: 51 e4 ldi r21, 0x41 ; 65 19490: c7 01 movw r24, r14 19492: b6 01 movw r22, r12 19494: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 19498: 87 ff sbrs r24, 7 1949a: d7 cf rjmp .-82 ; 0x1944a la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 1949c: 20 e0 ldi r18, 0x00 ; 0 1949e: 30 e0 ldi r19, 0x00 ; 0 194a0: a9 01 movw r20, r18 194a2: c7 01 movw r24, r14 194a4: b6 01 movw r22, r12 194a6: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 194aa: 87 fd sbrc r24, 7 194ac: ce cf rjmp .-100 ; 0x1944a SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 194ae: c0 92 05 18 sts 0x1805, r12 ; 0x801805 194b2: d0 92 06 18 sts 0x1806, r13 ; 0x801806 194b6: e0 92 07 18 sts 0x1807, r14 ; 0x801807 194ba: f0 92 08 18 sts 0x1808, r15 ; 0x801808 194be: a4 cf rjmp .-184 ; 0x19408 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 194c0: 82 e0 ldi r24, 0x02 ; 2 194c2: d3 cf rjmp .-90 ; 0x1946a } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 194c4: c7 01 movw r24, r14 194c6: b6 01 movw r22, r12 194c8: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 194cc: 87 fd sbrc r24, 7 194ce: bd cf rjmp .-134 ; 0x1944a // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 194d0: 2f e6 ldi r18, 0x6F ; 111 194d2: 32 e1 ldi r19, 0x12 ; 18 194d4: 43 e0 ldi r20, 0x03 ; 3 194d6: 5b e3 ldi r21, 0x3B ; 59 194d8: c7 01 movw r24, r14 194da: b6 01 movw r22, r12 194dc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 194e0: 2a e0 ldi r18, 0x0A ; 10 194e2: 37 ed ldi r19, 0xD7 ; 215 194e4: 43 e2 ldi r20, 0x23 ; 35 194e6: 5c e3 ldi r21, 0x3C ; 60 194e8: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 194ec: 6b 01 movw r12, r22 194ee: 7c 01 movw r14, r24 return new_K < 0? 0: 194f0: 20 e0 ldi r18, 0x00 ; 0 194f2: 30 e0 ldi r19, 0x00 ; 0 194f4: a9 01 movw r20, r18 194f6: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 194fa: 87 fd sbrc r24, 7 194fc: 11 c0 rjmp .+34 ; 0x19520 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 194fe: 20 e0 ldi r18, 0x00 ; 0 19500: 30 e0 ldi r19, 0x00 ; 0 19502: 40 e2 ldi r20, 0x20 ; 32 19504: 51 e4 ldi r21, 0x41 ; 65 19506: c7 01 movw r24, r14 19508: b6 01 movw r22, r12 1950a: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1950e: 18 16 cp r1, r24 19510: 2c f6 brge .-118 ; 0x1949c 19512: c1 2c mov r12, r1 19514: d1 2c mov r13, r1 19516: 30 e2 ldi r19, 0x20 ; 32 19518: e3 2e mov r14, r19 1951a: 31 e4 ldi r19, 0x41 ; 65 1951c: f3 2e mov r15, r19 1951e: c7 cf rjmp .-114 ; 0x194ae // 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: 19520: c1 2c mov r12, r1 19522: d1 2c mov r13, r1 19524: 76 01 movw r14, r12 19526: c3 cf rjmp .-122 ; 0x194ae 19528: 9d ed ldi r25, 0xDD ; 221 1952a: 89 2e mov r8, r25 1952c: 92 e0 ldi r25, 0x02 ; 2 1952e: 99 2e mov r9, r25 19530: 0d e5 ldi r16, 0x5D ; 93 19532: 12 e0 ldi r17, 0x02 ; 2 19534: 26 ef ldi r18, 0xF6 ; 246 19536: a2 2e mov r10, r18 19538: 24 e0 ldi r18, 0x04 ; 4 1953a: 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++){ 1953c: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 1953e: f4 01 movw r30, r8 19540: 81 91 ld r24, Z+ 19542: 4f 01 movw r8, r30 19544: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19548: 88 23 and r24, r24 1954a: 09 f4 brne .+2 ; 0x1954e 1954c: 45 c0 rjmp .+138 ; 0x195d8 if( i == E_AXIS && FarmOrUserECool() ){ 1954e: f3 e0 ldi r31, 0x03 ; 3 19550: 7f 12 cpse r7, r31 19552: 04 c0 rjmp .+8 ; 0x1955c 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(); 19554: 0e 94 ce f9 call 0x1f39c ; 0x1f39c 19558: 81 11 cpse r24, r1 1955a: 61 c0 rjmp .+194 ; 0x1961e SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 1955c: 0e 94 4a 61 call 0xc294 ; 0xc294 19560: 6b 01 movw r12, r22 19562: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 19564: 20 e0 ldi r18, 0x00 ; 0 19566: 30 e0 ldi r19, 0x00 ; 0 19568: a9 01 movw r20, r18 1956a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1956e: 87 fd sbrc r24, 7 19570: 46 c0 rjmp .+140 ; 0x195fe if (cur > 1029) cur = 1029; //limit max 19572: 20 e0 ldi r18, 0x00 ; 0 19574: 30 ea ldi r19, 0xA0 ; 160 19576: 40 e8 ldi r20, 0x80 ; 128 19578: 54 e4 ldi r21, 0x44 ; 68 1957a: c7 01 movw r24, r14 1957c: b6 01 movw r22, r12 1957e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 19582: 18 16 cp r1, r24 19584: a4 f1 brlt .+104 ; 0x195ee //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; 19586: 20 e0 ldi r18, 0x00 ; 0 19588: 30 e0 ldi r19, 0x00 ; 0 1958a: 47 e0 ldi r20, 0x07 ; 7 1958c: 54 e4 ldi r21, 0x44 ; 68 1958e: c7 01 movw r24, r14 19590: b6 01 movw r22, r12 19592: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 19596: 87 fd sbrc r24, 7 19598: 35 c0 rjmp .+106 ; 0x19604 1959a: 20 e0 ldi r18, 0x00 ; 0 1959c: 30 e0 ldi r19, 0x00 ; 0 1959e: 4c e7 ldi r20, 0x7C ; 124 195a0: 52 e4 ldi r21, 0x42 ; 66 195a2: c7 01 movw r24, r14 195a4: b6 01 movw r22, r12 195a6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 195aa: 20 e0 ldi r18, 0x00 ; 0 195ac: 30 ea ldi r19, 0xA0 ; 160 195ae: 40 e8 ldi r20, 0x80 ; 128 195b0: 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); 195b2: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 195b6: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 195ba: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 195bc: c8 01 movw r24, r16 195be: 0e 94 ab 68 call 0xd156 ; 0xd156 currents[i].setiRun(val); 195c2: 6f 2d mov r22, r15 195c4: c8 01 movw r24, r16 195c6: 0e 94 b3 68 call 0xd166 ; 0xd166 tmc2130_setup_chopper(i, tmc2130_mres[i]); 195ca: 50 e0 ldi r21, 0x00 ; 0 195cc: 40 e0 ldi r20, 0x00 ; 0 195ce: d5 01 movw r26, r10 195d0: 6c 91 ld r22, X 195d2: 87 2d mov r24, r7 195d4: 0f 94 42 3a call 0x27484 ; 0x27484 */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 195d8: 73 94 inc r7 195da: 0d 5f subi r16, 0xFD ; 253 195dc: 1f 4f sbci r17, 0xFF ; 255 195de: bf ef ldi r27, 0xFF ; 255 195e0: ab 1a sub r10, r27 195e2: bb 0a sbc r11, r27 195e4: e4 e0 ldi r30, 0x04 ; 4 195e6: 7e 12 cpse r7, r30 195e8: aa cf rjmp .-172 ; 0x1953e 195ea: 0c 94 8d b2 jmp 0x1651a ; 0x1651a //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 195ee: c1 2c mov r12, r1 195f0: 80 ea ldi r24, 0xA0 ; 160 195f2: d8 2e mov r13, r24 195f4: 80 e8 ldi r24, 0x80 ; 128 195f6: e8 2e mov r14, r24 195f8: 84 e4 ldi r24, 0x44 ; 68 195fa: f8 2e mov r15, r24 195fc: ce cf rjmp .-100 ; 0x1959a //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 195fe: c1 2c mov r12, r1 19600: d1 2c mov r13, r1 19602: 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); 19604: 20 e0 ldi r18, 0x00 ; 0 19606: 30 e0 ldi r19, 0x00 ; 0 19608: 4c e7 ldi r20, 0x7C ; 124 1960a: 52 e4 ldi r21, 0x42 ; 66 1960c: c7 01 movw r24, r14 1960e: b6 01 movw r22, r12 19610: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 19614: 20 e0 ldi r18, 0x00 ; 0 19616: 34 eb ldi r19, 0xB4 ; 180 19618: 40 e9 ldi r20, 0x90 ; 144 1961a: 54 e4 ldi r21, 0x44 ; 68 1961c: ca cf rjmp .-108 ; 0x195b2 if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 1961e: 8a eb ldi r24, 0xBA ; 186 19620: 9f e9 ldi r25, 0x9F ; 159 19622: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM(", M907 E ignored"); 19626: 8d e5 ldi r24, 0x5D ; 93 19628: 96 e8 ldi r25, 0x86 ; 134 1962a: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 1962e: d4 cf rjmp .-88 ; 0x195d8 19630: 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; } 19634: 80 91 66 02 lds r24, 0x0266 ; 0x800266 19638: 81 11 cpse r24, r1 1963a: 01 c0 rjmp .+2 ; 0x1963e 1963c: 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"), 1963e: 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() 19640: 86 e6 ldi r24, 0x66 ; 102 19642: 92 e0 ldi r25, 0x02 ; 2 19644: 0f 94 4d 3d call 0x27a9a ; 0x27a9a 19648: 88 2e mov r8, r24 1964a: c0 90 64 02 lds r12, 0x0264 ; 0x800264 1964e: 80 91 63 02 lds r24, 0x0263 ; 0x800263 19652: 81 11 cpse r24, r1 19654: 01 c0 rjmp .+2 ; 0x19658 19656: 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"), 19658: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 1965a: 83 e6 ldi r24, 0x63 ; 99 1965c: 92 e0 ldi r25, 0x02 ; 2 1965e: 0f 94 4d 3d call 0x27a9a ; 0x27a9a 19662: 98 2e mov r9, r24 19664: 00 91 61 02 lds r16, 0x0261 ; 0x800261 19668: 80 91 60 02 lds r24, 0x0260 ; 0x800260 1966c: 81 11 cpse r24, r1 1966e: 01 c0 rjmp .+2 ; 0x19672 19670: 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"), 19672: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 19674: 80 e6 ldi r24, 0x60 ; 96 19676: 92 e0 ldi r25, 0x02 ; 2 19678: 0f 94 4d 3d call 0x27a9a ; 0x27a9a 1967c: e8 2e mov r14, r24 1967e: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 19682: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 19686: 81 11 cpse r24, r1 19688: 01 c0 rjmp .+2 ; 0x1968c 1968a: 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(), 1968c: 8d e5 ldi r24, 0x5D ; 93 1968e: 92 e0 ldi r25, 0x02 ; 2 19690: 0f 94 4d 3d call 0x27a9a ; 0x27a9a 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"), 19694: bf 92 push r11 19696: af 92 push r10 19698: 1f 92 push r1 1969a: 8f 92 push r8 1969c: df 92 push r13 1969e: cf 92 push r12 196a0: 1f 92 push r1 196a2: 9f 92 push r9 196a4: 1f 93 push r17 196a6: 0f 93 push r16 196a8: 1f 92 push r1 196aa: ef 92 push r14 196ac: 1f 92 push r1 196ae: ff 92 push r15 196b0: 1f 92 push r1 196b2: 8f 93 push r24 196b4: 84 e1 ldi r24, 0x14 ; 20 196b6: 98 e6 ldi r25, 0x68 ; 104 196b8: 9f 93 push r25 196ba: 8f 93 push r24 196bc: 0f 94 4b dc call 0x3b896 ; 0x3b896 196c0: 0f b6 in r0, 0x3f ; 63 196c2: f8 94 cli 196c4: de bf out 0x3e, r29 ; 62 196c6: 0f be out 0x3f, r0 ; 63 196c8: cd bf out 0x3d, r28 ; 61 196ca: 0c 94 8d b2 jmp 0x1651a ; 0x1651a - `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; 196ce: 11 e0 ldi r17, 0x01 ; 1 196d0: 82 39 cpi r24, 0x92 ; 146 196d2: 93 40 sbci r25, 0x03 ; 3 196d4: 09 f4 brne .+2 ; 0x196d8 196d6: 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')) 196d8: 82 e5 ldi r24, 0x52 ; 82 196da: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 196de: 88 23 and r24, r24 196e0: 81 f0 breq .+32 ; 0x19702 { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 196e2: 8f ef ldi r24, 0xFF ; 255 196e4: 9f e0 ldi r25, 0x0F ; 15 196e6: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 196ea: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 196ec: 80 91 6a 06 lds r24, 0x066A ; 0x80066a 196f0: 81 17 cp r24, r17 196f2: 11 f4 brne .+4 ; 0x196f8 196f4: 0c 94 8d b2 jmp 0x1651a ; 0x1651a ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 196f8: 81 2f mov r24, r17 196fa: 0e 94 36 61 call 0xc26c ; 0xc26c 196fe: 0c 94 8d b2 jmp 0x1651a ; 0x1651a //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')) 19702: 80 e5 ldi r24, 0x50 ; 80 19704: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19708: 88 23 and r24, r24 1970a: 89 f0 breq .+34 ; 0x1972e { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 1970c: 01 e0 ldi r16, 0x01 ; 1 1970e: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.551> 19712: 90 91 5a 0e lds r25, 0x0E5A ; 0x800e5a <_ZL17mcode_in_progress.lto_priv.551+0x1> 19716: 82 39 cpi r24, 0x92 ; 146 19718: 93 40 sbci r25, 0x03 ; 3 1971a: 09 f4 brne .+2 ; 0x1971e 1971c: 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); 1971e: 60 2f mov r22, r16 19720: 8f ef ldi r24, 0xFF ; 255 19722: 9f e0 ldi r25, 0x0F ; 15 19724: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 19728: 00 93 a2 03 sts 0x03A2, r16 ; 0x8003a2 1972c: df cf rjmp .-66 ; 0x196ec //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')) 1972e: 81 e5 ldi r24, 0x51 ; 81 19730: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19734: 88 23 and r24, r24 19736: d1 f2 breq .-76 ; 0x196ec { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 19738: 80 91 6a 06 lds r24, 0x066A ; 0x80066a 1973c: 81 11 cpse r24, r1 1973e: 15 c0 rjmp .+42 ; 0x1976a 19740: 8e e7 ldi r24, 0x7E ; 126 19742: 97 e5 ldi r25, 0x57 ; 87 19744: 9f 93 push r25 19746: 8f 93 push r24 19748: 8e e2 ldi r24, 0x2E ; 46 1974a: 9d e3 ldi r25, 0x3D ; 61 1974c: 9f 93 push r25 1974e: 8f 93 push r24 19750: 85 e5 ldi r24, 0x55 ; 85 19752: 96 e8 ldi r25, 0x86 ; 134 19754: 9f 93 push r25 19756: 8f 93 push r24 19758: 0f 94 4b dc call 0x3b896 ; 0x3b896 1975c: 0f 90 pop r0 1975e: 0f 90 pop r0 19760: 0f 90 pop r0 19762: 0f 90 pop r0 19764: 0f 90 pop r0 19766: 0f 90 pop r0 19768: c1 cf rjmp .-126 ; 0x196ec 1976a: 8b ea ldi r24, 0xAB ; 171 1976c: 9c e3 ldi r25, 0x3C ; 60 1976e: ea cf rjmp .-44 ; 0x19744 19770: 8d ed ldi r24, 0xDD ; 221 19772: 92 e0 ldi r25, 0x02 ; 2 19774: 6c 96 adiw r28, 0x1c ; 28 19776: 9f af std Y+63, r25 ; 0x3f 19778: 8e af std Y+62, r24 ; 0x3e 1977a: 6c 97 sbiw r28, 0x1c ; 28 1977c: ec e6 ldi r30, 0x6C ; 108 1977e: ce 2e mov r12, r30 19780: e6 e0 ldi r30, 0x06 ; 6 19782: de 2e mov r13, r30 19784: f2 e5 ldi r31, 0x52 ; 82 19786: ef 2e mov r14, r31 19788: f7 e0 ldi r31, 0x07 ; 7 1978a: ff 2e mov r15, r31 1978c: a6 ef ldi r26, 0xF6 ; 246 1978e: 2a 2e mov r2, r26 19790: a4 e0 ldi r26, 0x04 ; 4 19792: 3a 2e mov r3, r26 19794: b8 e2 ldi r27, 0x28 ; 40 19796: 8b 2e mov r8, r27 19798: b7 e0 ldi r27, 0x07 ; 7 1979a: 9b 2e mov r9, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 197b8: b8 2e mov r11, r24 197ba: 88 23 and r24, r24 197bc: 09 f4 brne .+2 ; 0x197c0 197be: 75 c0 rjmp .+234 ; 0x198aa { uint16_t res_new = code_value(); 197c0: 0e 94 4a 61 call 0xc294 ; 0xc294 197c4: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 197c8: 2b 01 movw r4, r22 197ca: 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 197cc: 68 30 cpi r22, 0x08 ; 8 197ce: 71 05 cpc r23, r1 197d0: 09 f4 brne .+2 ; 0x197d4 197d2: 59 c3 rjmp .+1714 ; 0x19e86 197d4: 60 31 cpi r22, 0x10 ; 16 197d6: 71 05 cpc r23, r1 197d8: 09 f4 brne .+2 ; 0x197dc 197da: 55 c3 rjmp .+1706 ; 0x19e86 197dc: 81 e0 ldi r24, 0x01 ; 1 197de: 00 32 cpi r16, 0x20 ; 32 197e0: 11 05 cpc r17, r1 197e2: 09 f0 breq .+2 ; 0x197e6 197e4: 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 197e6: 67 96 adiw r28, 0x17 ; 23 197e8: bf ad ldd r27, Y+63 ; 0x3f 197ea: 67 97 sbiw r28, 0x17 ; 23 197ec: b3 30 cpi r27, 0x03 ; 3 197ee: 09 f4 brne .+2 ; 0x197f2 197f0: 55 c3 rjmp .+1706 ; 0x19e9c 197f2: 92 01 movw r18, r4 197f4: 21 50 subi r18, 0x01 ; 1 197f6: 31 09 sbc r19, r1 197f8: 22 30 cpi r18, 0x02 ; 2 197fa: 31 05 cpc r19, r1 197fc: 08 f0 brcs .+2 ; 0x19800 197fe: 49 c3 rjmp .+1682 ; 0x19e92 19800: 9b 2d mov r25, r11 19802: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 19804: 67 96 adiw r28, 0x17 ; 23 19806: ef ad ldd r30, Y+63 ; 0x3f 19808: 67 97 sbiw r28, 0x17 ; 23 1980a: e3 30 cpi r30, 0x03 ; 3 1980c: 41 f4 brne .+16 ; 0x1981e 1980e: 00 34 cpi r16, 0x40 ; 64 19810: 11 05 cpc r17, r1 19812: 31 f0 breq .+12 ; 0x19820 19814: bb 24 eor r11, r11 19816: b3 94 inc r11 19818: 00 38 cpi r16, 0x80 ; 128 1981a: 11 05 cpc r17, r1 1981c: 09 f0 breq .+2 ; 0x19820 1981e: b1 2c mov r11, r1 #endif if (res_valid) 19820: 81 11 cpse r24, r1 19822: 03 c0 rjmp .+6 ; 0x1982a 19824: bb 20 and r11, r11 19826: 09 f4 brne .+2 ; 0x1982a 19828: 40 c0 rjmp .+128 ; 0x198aa { st_synchronize(); 1982a: 0f 94 24 59 call 0x2b248 ; 0x2b248 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 1982e: d1 01 movw r26, r2 19830: 8c 91 ld r24, X 19832: a1 2c mov r10, r1 19834: bb 24 eor r11, r11 19836: b3 94 inc r11 19838: 02 c0 rjmp .+4 ; 0x1983e 1983a: b6 94 lsr r11 1983c: a7 94 ror r10 1983e: 8a 95 dec r24 19840: e2 f7 brpl .-8 ; 0x1983a uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 19842: b2 01 movw r22, r4 19844: 67 96 adiw r28, 0x17 ; 23 19846: 8f ad ldd r24, Y+63 ; 0x3f 19848: 67 97 sbiw r28, 0x17 ; 23 1984a: 0f 94 ad 3a call 0x2755a ; 0x2755a cs.axis_ustep_resolution[i] = res_new; 1984e: f4 01 movw r30, r8 19850: 40 82 st Z, r4 if (res_new > res) 19852: a0 16 cp r10, r16 19854: b1 06 cpc r11, r17 19856: 08 f0 brcs .+2 ; 0x1985a 19858: 40 c0 rjmp .+128 ; 0x198da { uint16_t fac = (res_new / res); 1985a: c8 01 movw r24, r16 1985c: b5 01 movw r22, r10 1985e: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 19862: 2b 01 movw r4, r22 19864: 71 2c mov r7, r1 19866: 61 2c mov r6, r1 19868: c3 01 movw r24, r6 1986a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 1986e: 9b 01 movw r18, r22 19870: ac 01 movw r20, r24 19872: d6 01 movw r26, r12 19874: 14 96 adiw r26, 0x04 ; 4 19876: 6d 91 ld r22, X+ 19878: 7d 91 ld r23, X+ 1987a: 8d 91 ld r24, X+ 1987c: 9c 91 ld r25, X 1987e: 17 97 sbiw r26, 0x07 ; 7 19880: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 19884: f6 01 movw r30, r12 19886: 64 83 std Z+4, r22 ; 0x04 19888: 75 83 std Z+5, r23 ; 0x05 1988a: 86 83 std Z+6, r24 ; 0x06 1988c: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 1988e: d7 01 movw r26, r14 19890: 2d 91 ld r18, X+ 19892: 3d 91 ld r19, X+ 19894: 4d 91 ld r20, X+ 19896: 5c 91 ld r21, X 19898: c3 01 movw r24, r6 1989a: b2 01 movw r22, r4 1989c: 0f 94 ec dd call 0x3bbd8 ; 0x3bbd8 <__mulsi3> 198a0: f7 01 movw r30, r14 198a2: 60 83 st Z, r22 198a4: 71 83 std Z+1, r23 ; 0x01 198a6: 82 83 std Z+2, r24 ; 0x02 198a8: 93 83 std Z+3, r25 ; 0x03 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 198d4: 66 cf rjmp .-308 ; 0x197a2 198d6: 0c 94 67 b8 jmp 0x170ce ; 0x170ce cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 198da: c5 01 movw r24, r10 198dc: b8 01 movw r22, r16 198de: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 198e2: 2b 01 movw r4, r22 198e4: 71 2c mov r7, r1 198e6: 61 2c mov r6, r1 198e8: c3 01 movw r24, r6 198ea: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 198ee: 9b 01 movw r18, r22 198f0: ac 01 movw r20, r24 198f2: d6 01 movw r26, r12 198f4: 14 96 adiw r26, 0x04 ; 4 198f6: 6d 91 ld r22, X+ 198f8: 7d 91 ld r23, X+ 198fa: 8d 91 ld r24, X+ 198fc: 9c 91 ld r25, X 198fe: 17 97 sbiw r26, 0x07 ; 7 19900: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 19904: f6 01 movw r30, r12 19906: 64 83 std Z+4, r22 ; 0x04 19908: 75 83 std Z+5, r23 ; 0x05 1990a: 86 83 std Z+6, r24 ; 0x06 1990c: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 1990e: d7 01 movw r26, r14 19910: 6d 91 ld r22, X+ 19912: 7d 91 ld r23, X+ 19914: 8d 91 ld r24, X+ 19916: 9c 91 ld r25, X 19918: a3 01 movw r20, r6 1991a: 92 01 movw r18, r4 1991c: 0f 94 7a de call 0x3bcf4 ; 0x3bcf4 <__divmodsi4> 19920: f7 01 movw r30, r14 19922: 20 83 st Z, r18 19924: 31 83 std Z+1, r19 ; 0x01 19926: 42 83 std Z+2, r20 ; 0x02 19928: 53 83 std Z+3, r21 ; 0x03 1992a: bf cf rjmp .-130 ; 0x198aa 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') ) { 1992c: 80 e5 ldi r24, 0x50 ; 80 1992e: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19932: 88 23 and r24, r24 19934: 29 f0 breq .+10 ; 0x19940 mmuSlotIndex = code_value_uint8(); 19936: 0e 94 06 5c call 0xb80c ; 0xb80c 1993a: 18 2f mov r17, r24 1993c: 0c 94 8b b1 jmp 0x16316 ; 0x16316 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') ) { 19940: 84 e5 ldi r24, 0x54 ; 84 19942: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19946: 81 11 cpse r24, r1 19948: f6 cf rjmp .-20 ; 0x19936 1994a: 0c 94 8a b1 jmp 0x16314 ; 0x16314 */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 1994e: 60 e0 ldi r22, 0x00 ; 0 19950: 70 e0 ldi r23, 0x00 ; 0 19952: cb 01 movw r24, r22 19954: 0c 94 a4 b1 jmp 0x16348 ; 0x16348 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; 19958: 82 e0 ldi r24, 0x02 ; 2 1995a: 80 93 73 07 sts 0x0773, r24 ; 0x800773 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 1995e: 86 e7 ldi r24, 0x76 ; 118 19960: 9c e5 ldi r25, 0x5C ; 92 19962: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19966: 0f 94 e2 0b call 0x217c4 ; 0x217c4 current_position[E_AXIS] += fastLoadLength; 1996a: a7 01 movw r20, r14 1996c: 96 01 movw r18, r12 1996e: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 19972: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 19976: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 1997a: 90 91 50 07 lds r25, 0x0750 ; 0x800750 1997e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 19982: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 19986: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 1998a: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 1998e: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 19992: 60 e0 ldi r22, 0x00 ; 0 19994: 70 e0 ldi r23, 0x00 ; 0 19996: 80 ea ldi r24, 0xA0 ; 160 19998: 91 e4 ldi r25, 0x41 ; 65 1999a: 0f 94 8b ba call 0x37516 ; 0x37516 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 1999e: 01 11 cpse r16, r1 199a0: 06 c0 rjmp .+12 ; 0x199ae raise_z_above(MIN_Z_FOR_LOAD); 199a2: 60 e0 ldi r22, 0x00 ; 0 199a4: 70 e0 ldi r23, 0x00 ; 0 199a6: 8c e0 ldi r24, 0x0C ; 12 199a8: 92 e4 ldi r25, 0x42 ; 66 199aa: 0e 94 0d 6f call 0xde1a ; 0xde1a } load_filament_final_feed(); // slow sequence 199ae: 0e 94 40 65 call 0xca80 ; 0xca80 st_synchronize(); 199b2: 0f 94 24 59 call 0x2b248 ; 0x2b248 Sound_MakeCustom(50, 500, false); 199b6: 40 e0 ldi r20, 0x00 ; 0 199b8: 64 ef ldi r22, 0xF4 ; 244 199ba: 71 e0 ldi r23, 0x01 ; 1 199bc: 82 e3 ldi r24, 0x32 ; 50 199be: 90 e0 ldi r25, 0x00 ; 0 199c0: 0f 94 99 6a call 0x2d532 ; 0x2d532 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 199c4: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 199c8: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 199ca: 0f 94 af 68 call 0x2d15e ; 0x2d15e #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 199ce: 81 e0 ldi r24, 0x01 ; 1 199d0: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_update(2); 199d4: 82 e0 ldi r24, 0x02 ; 2 199d6: 0e 94 54 6f call 0xdea8 ; 0xdea8 lcd_setstatuspgm(MSG_WELCOME); 199da: 8a e6 ldi r24, 0x6A ; 106 199dc: 90 e7 ldi r25, 0x70 ; 112 199de: 0f 94 e2 0b call 0x217c4 ; 0x217c4 custom_message_type = CustomMsg::Status; 199e2: 10 92 73 07 sts 0x0773, r1 ; 0x800773 199e6: 0c 94 bb b1 jmp 0x16376 ; 0x16376 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 199ea: 85 e5 ldi r24, 0x55 ; 85 199ec: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 - `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; 199f0: c1 2c mov r12, r1 199f2: d1 2c mov r13, r1 199f4: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 199f6: 88 23 and r24, r24 199f8: 21 f0 breq .+8 ; 0x19a02 199fa: 0e 94 4a 61 call 0xc294 ; 0xc294 199fe: 6b 01 movw r12, r22 19a00: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 19a02: 8a e5 ldi r24, 0x5A ; 90 19a04: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19a08: 88 23 and r24, r24 19a0a: a1 f0 breq .+40 ; 0x19a34 19a0c: 0e 94 4a 61 call 0xc294 ; 0xc294 19a10: 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); 19a12: 0e 94 8e 6e call 0xdd1c ; 0xdd1c 19a16: 4b 01 movw r8, r22 19a18: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 19a1a: 80 91 96 13 lds r24, 0x1396 ; 0x801396 19a1e: 81 30 cpi r24, 0x01 ; 1 19a20: 99 f4 brne .+38 ; 0x19a48 19a22: 0f 94 65 a0 call 0x340ca ; 0x340ca else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 19a26: c5 01 movw r24, r10 19a28: b4 01 movw r22, r8 19a2a: 90 58 subi r25, 0x80 ; 128 19a2c: 0e 94 8e 6e call 0xdd1c ; 0xdd1c 19a30: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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 19a34: 60 e0 ldi r22, 0x00 ; 0 19a36: 70 e0 ldi r23, 0x00 ; 0 19a38: 8c e0 ldi r24, 0x0C ; 12 19a3a: 92 e4 ldi r25, 0x42 ; 66 19a3c: 0e 94 0d 6f call 0xde1a ; 0xde1a - `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; 19a40: 60 e0 ldi r22, 0x00 ; 0 19a42: 70 e0 ldi r23, 0x00 ; 0 19a44: cb 01 movw r24, r22 19a46: e5 cf rjmp .-54 ; 0x19a12 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 19a48: c7 01 movw r24, r14 19a4a: b6 01 movw r22, r12 19a4c: 0f 94 cf 16 call 0x22d9e ; 0x22d9e 19a50: ea cf rjmp .-44 ; 0x19a26 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 19a52: 81 ec ldi r24, 0xC1 ; 193 19a54: 92 e0 ldi r25, 0x02 ; 2 19a56: 0e 94 fc 60 call 0xc1f8 ; 0xc1f8 19a5a: 0c 94 8d b2 jmp 0x1651a ; 0x1651a #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 19a5e: 82 ec ldi r24, 0xC2 ; 194 19a60: 92 e0 ldi r25, 0x02 ; 2 19a62: 0e 94 fc 60 call 0xc1f8 ; 0xc1f8 19a66: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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() ) { 19a6a: 80 91 96 13 lds r24, 0x1396 ; 0x801396 19a6e: 81 30 cpi r24, 0x01 ; 1 19a70: 11 f0 breq .+4 ; 0x19a76 19a72: 0c 94 8d b2 jmp 0x1651a ; 0x1651a if( code_seen('A') ) { 19a76: 81 e4 ldi r24, 0x41 ; 65 19a78: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19a7c: 88 23 and r24, r24 19a7e: 11 f4 brne .+4 ; 0x19a84 19a80: 0c 94 8d b2 jmp 0x1651a ; 0x1651a MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 19a84: 80 91 95 03 lds r24, 0x0395 ; 0x800395 19a88: 90 91 96 03 lds r25, 0x0396 ; 0x800396 19a8c: 40 e1 ldi r20, 0x10 ; 16 19a8e: 50 e0 ldi r21, 0x00 ; 0 19a90: 70 e0 ldi r23, 0x00 ; 0 19a92: 60 e0 ldi r22, 0x00 ; 0 19a94: 01 96 adiw r24, 0x01 ; 1 19a96: 0f 94 14 d9 call 0x3b228 ; 0x3b228 19a9a: 86 2f mov r24, r22 19a9c: 0f 94 d0 1d call 0x23ba0 ; 0x23ba0 19aa0: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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() ){ 19aa4: 80 91 96 13 lds r24, 0x1396 ; 0x801396 19aa8: 81 30 cpi r24, 0x01 ; 1 19aaa: 11 f0 breq .+4 ; 0x19ab0 19aac: 0c 94 8d b2 jmp 0x1651a ; 0x1651a uint8_t addr = 0; if( code_seen('A') ) { 19ab0: 81 e4 ldi r24, 0x41 ; 65 19ab2: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 19ab6: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 19ab8: 88 23 and r24, r24 19aba: 61 f0 breq .+24 ; 0x19ad4 addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 19abc: 80 91 95 03 lds r24, 0x0395 ; 0x800395 19ac0: 90 91 96 03 lds r25, 0x0396 ; 0x800396 19ac4: 40 e1 ldi r20, 0x10 ; 16 19ac6: 50 e0 ldi r21, 0x00 ; 0 19ac8: 70 e0 ldi r23, 0x00 ; 0 19aca: 60 e0 ldi r22, 0x00 ; 0 19acc: 01 96 adiw r24, 0x01 ; 1 19ace: 0f 94 14 d9 call 0x3b228 ; 0x3b228 19ad2: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 19ad4: 88 e5 ldi r24, 0x58 ; 88 19ad6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19ada: 88 23 and r24, r24 19adc: 61 f0 breq .+24 ; 0x19af6 data = code_value_short(); 19ade: 0e 94 13 5c call 0xb826 ; 0xb826 } if(addr){ 19ae2: 11 23 and r17, r17 19ae4: 11 f4 brne .+4 ; 0x19aea 19ae6: 0c 94 8d b2 jmp 0x1651a ; 0x1651a MMU2::mmu2.WriteRegister(addr, data); 19aea: bc 01 movw r22, r24 19aec: 81 2f mov r24, r17 19aee: 0e 94 bb de call 0x1bd76 ; 0x1bd76 19af2: 0c 94 8d b2 jmp 0x1651a ; 0x1651a 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; 19af6: 90 e0 ldi r25, 0x00 ; 0 19af8: 80 e0 ldi r24, 0x00 ; 0 19afa: f3 cf rjmp .-26 ; 0x19ae2 19afc: 60 e0 ldi r22, 0x00 ; 0 19afe: 8c ea ldi r24, 0xAC ; 172 19b00: 9c e0 ldi r25, 0x0C ; 12 19b02: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 19b06: 10 92 96 13 sts 0x1396, r1 ; 0x801396 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 19b0a: 10 92 44 13 sts 0x1344, r1 ; 0x801344 currentScope = Scope::Stopped; 19b0e: 10 92 29 13 sts 0x1329, r1 ; 0x801329 19b12: 0c 94 03 b2 jmp 0x16406 ; 0x16406 19b16: 61 e0 ldi r22, 0x01 ; 1 19b18: 8c ea ldi r24, 0xAC ; 172 19b1a: 9c e0 ldi r25, 0x0C ; 12 19b1c: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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(); 19b20: 0e 94 1b db call 0x1b636 ; 0x1b636 19b24: 0c 94 03 b2 jmp 0x16406 ; 0x16406 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19b28: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 19b2a: 0f 94 b4 1d call 0x23b68 ; 0x23b68 19b2e: 0c 94 19 b2 jmp 0x16432 ; 0x16432 } void MMU2::TriggerResetPin() { reset(); 19b32: 0f 94 11 c3 call 0x38622 ; 0x38622 19b36: 0c 94 19 b2 jmp 0x16432 ; 0x16432 void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 19b3a: 8a e2 ldi r24, 0x2A ; 42 19b3c: f6 cf rjmp .-20 ; 0x19b2a 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') { 19b3e: 84 35 cpi r24, 0x54 ; 84 19b40: 09 f0 breq .+2 ; 0x19b44 19b42: 79 c0 rjmp .+242 ; 0x19c36 strchr_pointer = CMDBUFFER_CURRENT_STRING; 19b44: 10 93 96 03 sts 0x0396, r17 ; 0x800396 19b48: 00 93 95 03 sts 0x0395, r16 ; 0x800395 processing_tcode = true; 19b4c: 81 e0 ldi r24, 0x01 ; 1 19b4e: 80 93 a1 03 sts 0x03A1, r24 ; 0x8003a1 TCodes(strchr_pointer, code_value_uint8()); 19b52: 0e 94 06 5c call 0xb80c ; 0xb80c 19b56: 18 2f mov r17, r24 19b58: 20 91 95 03 lds r18, 0x0395 ; 0x800395 19b5c: 30 91 96 03 lds r19, 0x0396 ; 0x800396 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 19b60: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 19b62: 79 01 movw r14, r18 19b64: e9 0e add r14, r25 19b66: f1 1c adc r15, r1 19b68: d7 01 movw r26, r14 19b6a: 8c 91 ld r24, X 19b6c: 80 32 cpi r24, 0x20 ; 32 19b6e: 11 f0 breq .+4 ; 0x19b74 19b70: 89 30 cpi r24, 0x09 ; 9 19b72: 11 f4 brne .+4 ; 0x19b78 19b74: 9f 5f subi r25, 0xFF ; 255 19b76: f5 cf rjmp .-22 ; 0x19b62 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 19b78: 08 2e mov r0, r24 19b7a: 00 0c add r0, r0 19b7c: 99 0b sbc r25, r25 19b7e: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 19b82: f7 01 movw r30, r14 19b84: 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'); 19b86: 90 ed ldi r25, 0xD0 ; 208 19b88: 98 0f add r25, r24 19b8a: 95 30 cpi r25, 0x05 ; 5 19b8c: 58 f0 brcs .+22 ; 0x19ba4 19b8e: 8f 33 cpi r24, 0x3F ; 63 19b90: 59 f0 breq .+22 ; 0x19ba8 19b92: 88 37 cpi r24, 0x78 ; 120 19b94: 49 f0 breq .+18 ; 0x19ba8 19b96: 83 36 cpi r24, 0x63 ; 99 19b98: f1 f0 breq .+60 ; 0x19bd6 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 19b9a: 89 e3 ldi r24, 0x39 ; 57 19b9c: 9f e7 ldi r25, 0x7F ; 127 } else { SERIAL_ECHO_START; if (codeValue >= EXTRUDERS) { SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19b9e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 19ba2: 13 c0 rjmp .+38 ; 0x19bca strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 19ba4: 8f 33 cpi r24, 0x3F ; 63 19ba6: a9 f4 brne .+42 ; 0x19bd2 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 19ba8: 80 91 96 13 lds r24, 0x1396 ; 0x801396 19bac: 81 30 cpi r24, 0x01 ; 1 19bae: 69 f4 brne .+26 ; 0x19bca MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 19bb0: 8e e1 ldi r24, 0x1E ; 30 19bb2: 9f e3 ldi r25, 0x3F ; 63 19bb4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19bb8: 70 e0 ldi r23, 0x00 ; 0 19bba: 60 e0 ldi r22, 0x00 ; 0 19bbc: 0e 94 b2 d9 call 0x1b364 ; 0x1b364 19bc0: 68 2f mov r22, r24 19bc2: d7 01 movw r26, r14 19bc4: 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()); 19bc6: 0f 94 69 1d call 0x23ad2 ; 0x23ad2 processing_tcode = false; 19bca: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 19bce: 0c 94 de 97 jmp 0x12fbc ; 0x12fbc } 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'){ 19bd2: 83 36 cpi r24, 0x63 ; 99 19bd4: 49 f4 brne .+18 ; 0x19be8 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 19bd6: 80 91 96 13 lds r24, 0x1396 ; 0x801396 19bda: 81 30 cpi r24, 0x01 ; 1 19bdc: b1 f7 brne .-20 ; 0x19bca MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 19bde: 0f 94 d5 76 call 0x2edaa ; 0x2edaa 19be2: 68 2f mov r22, r24 19be4: 83 e6 ldi r24, 0x63 ; 99 19be6: ef cf rjmp .-34 ; 0x19bc6 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 19be8: 80 91 96 13 lds r24, 0x1396 ; 0x801396 19bec: 81 30 cpi r24, 0x01 ; 1 19bee: 69 f4 brne .+26 ; 0x19c0a if (codeValue == MMU2::mmu2.get_current_tool()){ 19bf0: 0f 94 d5 76 call 0x2edaa ; 0x2edaa 19bf4: 18 13 cpse r17, r24 19bf6: 05 c0 rjmp .+10 ; 0x19c02 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 19bf8: 89 e4 ldi r24, 0x49 ; 73 19bfa: 9f e7 ldi r25, 0x7F ; 127 19bfc: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 19c00: e4 cf rjmp .-56 ; 0x19bca #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); 19c02: 81 2f mov r24, r17 19c04: 0f 94 4d 1a call 0x2349a ; 0x2349a 19c08: e0 cf rjmp .-64 ; 0x19bca } } else { SERIAL_ECHO_START; 19c0a: 82 ee ldi r24, 0xE2 ; 226 19c0c: 99 ea ldi r25, 0xA9 ; 169 19c0e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if (codeValue >= EXTRUDERS) { 19c12: 11 23 and r17, r17 19c14: 59 f0 breq .+22 ; 0x19c2c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 19c16: 84 e5 ldi r24, 0x54 ; 84 19c18: 0e 94 ba 78 call 0xf174 ; 0xf174 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 19c1c: 81 2f mov r24, r17 19c1e: 90 e0 ldi r25, 0x00 ; 0 19c20: c0 96 adiw r24, 0x30 ; 48 19c22: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19c26: 83 e0 ldi r24, 0x03 ; 3 19c28: 98 e6 ldi r25, 0x68 ; 104 19c2a: b9 cf rjmp .-142 ; 0x19b9e // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19c2c: 80 ef ldi r24, 0xF0 ; 240 19c2e: 97 e6 ldi r25, 0x67 ; 103 19c30: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 19c34: ca cf rjmp .-108 ; 0x19bca /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19c36: 84 34 cpi r24, 0x44 ; 68 19c38: 09 f0 breq .+2 ; 0x19c3c 19c3a: ee c0 rjmp .+476 ; 0x19e18 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19c3c: 10 93 96 03 sts 0x0396, r17 ; 0x800396 19c40: 00 93 95 03 sts 0x0395, r16 ; 0x800395 switch(code_value_short()) 19c44: 0e 94 13 5c call 0xb826 ; 0xb826 19c48: 86 30 cpi r24, 0x06 ; 6 19c4a: 91 05 cpc r25, r1 19c4c: 09 f4 brne .+2 ; 0x19c50 19c4e: 79 c0 rjmp .+242 ; 0x19d42 19c50: 9c f4 brge .+38 ; 0x19c78 19c52: 82 30 cpi r24, 0x02 ; 2 19c54: 91 05 cpc r25, r1 19c56: 09 f4 brne .+2 ; 0x19c5a 19c58: 52 c0 rjmp .+164 ; 0x19cfe 19c5a: 83 30 cpi r24, 0x03 ; 3 19c5c: 91 05 cpc r25, r1 19c5e: 09 f4 brne .+2 ; 0x19c62 19c60: 61 c0 rjmp .+194 ; 0x19d24 19c62: 01 96 adiw r24, 0x01 ; 1 19c64: 89 f4 brne .+34 ; 0x19c88 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 19c66: 8c ed ldi r24, 0xDC ; 220 19c68: 97 e6 ldi r25, 0x67 ; 103 19c6a: 9f 93 push r25 19c6c: 8f 93 push r24 19c6e: 0f 94 4b dc call 0x3b896 ; 0x3b896 19c72: 0f 90 pop r0 19c74: 0f 90 pop r0 19c76: ff cf rjmp .-2 ; 0x19c76 19c78: 85 31 cpi r24, 0x15 ; 21 19c7a: 91 05 cpc r25, r1 19c7c: 09 f4 brne .+2 ; 0x19c80 19c7e: 8d c0 rjmp .+282 ; 0x19d9a 19c80: 94 f4 brge .+36 ; 0x19ca6 19c82: 44 97 sbiw r24, 0x14 ; 20 19c84: 09 f4 brne .+2 ; 0x19c88 19c86: 69 c0 rjmp .+210 ; 0x19d5a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 19c88: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 19c8c: 90 91 6f 12 lds r25, 0x126F ; 0x80126f 19c90: 8c 57 subi r24, 0x7C ; 124 19c92: 9f 4e sbci r25, 0xEF ; 239 19c94: 9f 93 push r25 19c96: 8f 93 push r24 19c98: 1f 92 push r1 19c9a: 84 e4 ldi r24, 0x44 ; 68 19c9c: 8f 93 push r24 19c9e: 8a ee ldi r24, 0xEA ; 234 19ca0: 99 e6 ldi r25, 0x69 ; 105 19ca2: 0c 94 79 99 jmp 0x132f2 ; 0x132f2 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 19ca6: 86 31 cpi r24, 0x16 ; 22 19ca8: 91 05 cpc r25, r1 19caa: 09 f4 brne .+2 ; 0x19cae 19cac: 9b c0 rjmp .+310 ; 0x19de4 19cae: 86 34 cpi r24, 0x46 ; 70 19cb0: 91 05 cpc r25, r1 19cb2: 51 f7 brne .-44 ; 0x19c88 #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 19cb4: 83 e5 ldi r24, 0x53 ; 83 19cb6: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19cba: 88 23 and r24, r24 19cbc: 11 f4 brne .+4 ; 0x19cc2 19cbe: 0c 94 de 97 jmp 0x12fbc ; 0x12fbc thermal_model_log_enable(code_value_short()); 19cc2: 0e 94 13 5c call 0xb826 ; 0xb826 19cc6: 11 e0 ldi r17, 0x01 ; 1 19cc8: 00 97 sbiw r24, 0x00 ; 0 19cca: 09 f4 brne .+2 ; 0x19cce 19ccc: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 19cce: 89 2b or r24, r25 19cd0: 91 f0 breq .+36 ; 0x19cf6 TempMgrGuard temp_mgr_guard; 19cd2: ce 01 movw r24, r28 19cd4: 01 96 adiw r24, 0x01 ; 1 19cd6: 0f 94 d6 47 call 0x28fac ; 0x28fac thermal_model::log_buf.entry.stamp = _millis(); 19cda: 0f 94 83 3f call 0x27f06 ; 0x27f06 19cde: 60 93 1f 06 sts 0x061F, r22 ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.558> 19ce2: 70 93 20 06 sts 0x0620, r23 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x1> 19ce6: 80 93 21 06 sts 0x0621, r24 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x2> 19cea: 90 93 22 06 sts 0x0622, r25 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x3> #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { TempMgrGuard temp_mgr_guard; 19cee: ce 01 movw r24, r28 19cf0: 01 96 adiw r24, 0x01 ; 1 19cf2: 0f 94 c9 47 call 0x28f92 ; 0x28f92 thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 19cf6: 10 93 2f 06 sts 0x062F, r17 ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x10> 19cfa: 0c 94 de 97 jmp 0x12fbc ; 0x12fbc - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 19cfe: 47 ed ldi r20, 0xD7 ; 215 19d00: c4 2e mov r12, r20 19d02: 47 e6 ldi r20, 0x67 ; 103 19d04: d4 2e mov r13, r20 19d06: 52 e0 ldi r21, 0x02 ; 2 19d08: e5 2e mov r14, r21 19d0a: 00 e0 ldi r16, 0x00 ; 0 19d0c: 20 e0 ldi r18, 0x00 ; 0 19d0e: 32 e2 ldi r19, 0x22 ; 34 19d10: 40 e0 ldi r20, 0x00 ; 0 19d12: 50 e0 ldi r21, 0x00 ; 0 19d14: 60 e0 ldi r22, 0x00 ; 0 19d16: 72 e0 ldi r23, 0x02 ; 2 19d18: 80 e0 ldi r24, 0x00 ; 0 19d1a: 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")); 19d1c: 0e 94 50 63 call 0xc6a0 ; 0xc6a0 19d20: 0c 94 de 97 jmp 0x12fbc ; 0x12fbc - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 19d24: 20 ed ldi r18, 0xD0 ; 208 19d26: c2 2e mov r12, r18 19d28: 27 e6 ldi r18, 0x67 ; 103 19d2a: d2 2e mov r13, r18 19d2c: 33 e0 ldi r19, 0x03 ; 3 19d2e: e3 2e mov r14, r19 19d30: 01 e0 ldi r16, 0x01 ; 1 19d32: 20 e0 ldi r18, 0x00 ; 0 19d34: 30 e1 ldi r19, 0x10 ; 16 19d36: 40 e0 ldi r20, 0x00 ; 0 19d38: 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")); 19d3a: 60 e0 ldi r22, 0x00 ; 0 19d3c: 70 e0 ldi r23, 0x00 ; 0 19d3e: cb 01 movw r24, r22 19d40: ed cf rjmp .-38 ; 0x19d1c 19d42: 89 ec ldi r24, 0xC9 ; 201 19d44: c8 2e mov r12, r24 19d46: 87 e6 ldi r24, 0x67 ; 103 19d48: d8 2e mov r13, r24 19d4a: 96 e0 ldi r25, 0x06 ; 6 19d4c: e9 2e mov r14, r25 19d4e: 03 e0 ldi r16, 0x03 ; 3 19d50: 20 e0 ldi r18, 0x00 ; 0 19d52: 30 e0 ldi r19, 0x00 ; 0 19d54: 44 e0 ldi r20, 0x04 ; 4 19d56: 50 e0 ldi r21, 0x00 ; 0 19d58: f0 cf rjmp .-32 ; 0x19d3a #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 19d5a: 85 e4 ldi r24, 0x45 ; 69 19d5c: 0e 94 74 5c call 0xb8e8 ; 0xb8e8 19d60: 88 23 and r24, r24 19d62: 29 f0 breq .+10 ; 0x19d6e xfdump_full_dump_and_reset(); 19d64: 80 e0 ldi r24, 0x00 ; 0 19d66: 0e 94 33 e4 call 0x1c866 ; 0x1c866 19d6a: 0c 94 de 97 jmp 0x12fbc ; 0x12fbc else { unsigned long ts = _millis(); 19d6e: 0f 94 83 3f call 0x27f06 ; 0x27f06 19d72: 6b 01 movw r12, r22 19d74: 7c 01 movw r14, r24 xfdump_dump(); 19d76: 0e 94 61 e4 call 0x1c8c2 ; 0x1c8c2 ts = _millis() - ts; 19d7a: 0f 94 83 3f call 0x27f06 ; 0x27f06 19d7e: dc 01 movw r26, r24 19d80: cb 01 movw r24, r22 19d82: 8c 19 sub r24, r12 19d84: 9d 09 sbc r25, r13 19d86: ae 09 sbc r26, r14 19d88: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 19d8a: bf 93 push r27 19d8c: af 93 push r26 19d8e: 9f 93 push r25 19d90: 8f 93 push r24 19d92: 80 eb ldi r24, 0xB0 ; 176 19d94: 97 e6 ldi r25, 0x67 ; 103 19d96: 0c 94 79 99 jmp 0x132f2 ; 0x132f2 } } void dcode_21() { if(!xfdump_check_state()) 19d9a: 90 e0 ldi r25, 0x00 ; 0 19d9c: 80 e0 ldi r24, 0x00 ; 0 19d9e: 0e 94 7f e3 call 0x1c6fe ; 0x1c6fe 19da2: 81 11 cpse r24, r1 19da4: 07 c0 rjmp .+14 ; 0x19db4 DBG(_N("no dump available\n")); 19da6: 8d e9 ldi r24, 0x9D ; 157 19da8: 97 e6 ldi r25, 0x67 ; 103 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19daa: 9f 93 push r25 19dac: 8f 93 push r24 19dae: 0f 94 4b dc call 0x3b896 ; 0x3b896 19db2: 14 c0 rjmp .+40 ; 0x19ddc { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 19db4: 81 e0 ldi r24, 0x01 ; 1 19db6: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D21 - read crash dump\n")); 19dba: 86 e8 ldi r24, 0x86 ; 134 19dbc: 97 e6 ldi r25, 0x67 ; 103 19dbe: 9f 93 push r25 19dc0: 8f 93 push r24 19dc2: 0f 94 4b dc call 0x3b896 ; 0x3b896 print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 19dc6: 03 e0 ldi r16, 0x03 ; 3 19dc8: 20 e0 ldi r18, 0x00 ; 0 19dca: 33 e2 ldi r19, 0x23 ; 35 19dcc: 40 e0 ldi r20, 0x00 ; 0 19dce: 50 e0 ldi r21, 0x00 ; 0 19dd0: 60 e0 ldi r22, 0x00 ; 0 19dd2: 70 ed ldi r23, 0xD0 ; 208 19dd4: 83 e0 ldi r24, 0x03 ; 3 19dd6: 90 e0 ldi r25, 0x00 ; 0 19dd8: 0f 94 d7 86 call 0x30dae ; 0x30dae if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19ddc: 0f 90 pop r0 19dde: 0f 90 pop r0 19de0: 0c 94 de 97 jmp 0x12fbc ; 0x12fbc } } void dcode_22() { if(!xfdump_check_state()) 19de4: 90 e0 ldi r25, 0x00 ; 0 19de6: 80 e0 ldi r24, 0x00 ; 0 19de8: 0e 94 7f e3 call 0x1c6fe ; 0x1c6fe 19dec: 81 11 cpse r24, r1 19dee: 03 c0 rjmp .+6 ; 0x19df6 DBG(_N("no dump available\n")); 19df0: 83 e7 ldi r24, 0x73 ; 115 19df2: 97 e6 ldi r25, 0x67 ; 103 19df4: da cf rjmp .-76 ; 0x19daa SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 19df6: 8c e5 ldi r24, 0x5C ; 92 19df8: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 19dfa: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 19dfc: 0e 94 b7 e3 call 0x1c76e ; 0x1c76e _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 19e00: 40 e0 ldi r20, 0x00 ; 0 19e02: 50 ed ldi r21, 0xD0 ; 208 19e04: 63 e0 ldi r22, 0x03 ; 3 19e06: 70 e0 ldi r23, 0x00 ; 0 19e08: 80 e2 ldi r24, 0x20 ; 32 19e0a: 0e 94 39 e3 call 0x1c672 ; 0x1c672 xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 19e0e: 0e 94 1b e3 call 0x1c636 ; 0x1c636 else { xfdump_reset(); DBG(_N("dump cleared\n")); 19e12: 85 e6 ldi r24, 0x65 ; 101 19e14: 97 e6 ldi r25, 0x67 ; 103 19e16: c9 cf rjmp .-110 ; 0x19daa } } else { SERIAL_ECHO_START; 19e18: 82 ee ldi r24, 0xE2 ; 226 19e1a: 99 ea ldi r25, 0xA9 ; 169 19e1c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 19e20: 85 e6 ldi r24, 0x65 ; 101 19e22: 98 e6 ldi r25, 0x68 ; 104 19e24: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19e28: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 19e2c: 90 91 6f 12 lds r25, 0x126F ; 0x80126f 19e30: 8c 57 subi r24, 0x7C ; 124 19e32: 9f 4e sbci r25, 0xEF ; 239 19e34: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_ECHOLNPGM("\"(2)"); 19e38: 80 e5 ldi r24, 0x50 ; 80 19e3a: 96 e8 ldi r25, 0x86 ; 134 19e3c: 0c 94 e9 99 jmp 0x133d2 ; 0x133d2 #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 19e40: 2d ec ldi r18, 0xCD ; 205 19e42: 3c ec ldi r19, 0xCC ; 204 19e44: 4c ec ldi r20, 0xCC ; 204 19e46: 5d e3 ldi r21, 0x3D ; 61 19e48: c7 01 movw r24, r14 19e4a: b6 01 movw r22, r12 19e4c: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 19e50: 18 16 cp r1, r24 19e52: 14 f4 brge .+4 ; 0x19e58 19e54: 0c 94 26 9b jmp 0x1364c ; 0x1364c 19e58: 0c 94 94 9c jmp 0x13928 ; 0x13928 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; 19e5c: a3 01 movw r20, r6 19e5e: 92 01 movw r18, r4 19e60: 62 2d mov r22, r2 19e62: 73 2d mov r23, r3 19e64: 8e 2d mov r24, r14 19e66: 9f 2d mov r25, r15 19e68: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 19e6c: 18 16 cp r1, r24 19e6e: 14 f0 brlt .+4 ; 0x19e74 19e70: 0c 94 75 a4 jmp 0x148ea ; 0x148ea 19e74: e5 e0 ldi r30, 0x05 ; 5 19e76: ce 0e add r12, r30 19e78: d1 1c adc r13, r1 19e7a: f2 e0 ldi r31, 0x02 ; 2 19e7c: 8f 0e add r8, r31 19e7e: 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; 19e80: 85 01 movw r16, r10 19e82: 0c 94 3c a4 jmp 0x14878 ; 0x14878 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 19e86: 67 96 adiw r28, 0x17 ; 23 19e88: 2f ad ldd r18, Y+63 ; 0x3f 19e8a: 67 97 sbiw r28, 0x17 ; 23 19e8c: 8b 2d mov r24, r11 19e8e: 23 30 cpi r18, 0x03 ; 3 19e90: 29 f0 breq .+10 ; 0x19e9c 19e92: 91 e0 ldi r25, 0x01 ; 1 19e94: 04 30 cpi r16, 0x04 ; 4 19e96: 11 05 cpc r17, r1 19e98: 09 f4 brne .+2 ; 0x19e9c 19e9a: b3 cc rjmp .-1690 ; 0x19802 19e9c: 90 e0 ldi r25, 0x00 ; 0 19e9e: b1 cc rjmp .-1694 ; 0x19802 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)); 19ea0: 85 e5 ldi r24, 0x55 ; 85 19ea2: 99 e3 ldi r25, 0x39 ; 57 19ea4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 19ea8: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_puts_at_P(0, 2, PSTR("")); 19eac: 43 eb ldi r20, 0xB3 ; 179 19eae: 55 e8 ldi r21, 0x85 ; 133 19eb0: 62 e0 ldi r22, 0x02 ; 2 19eb2: 80 e0 ldi r24, 0x00 ; 0 19eb4: 0e 94 a1 6f call 0xdf42 ; 0xdf42 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 19eb8: f8 01 movw r30, r16 19eba: 81 91 ld r24, Z+ 19ebc: 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'; 19ebe: 98 2f mov r25, r24 19ec0: 9f 7d andi r25, 0xDF ; 223 19ec2: 11 f4 brne .+4 ; 0x19ec8 19ec4: 0c 94 d0 b8 jmp 0x171a0 ; 0x171a0 19ec8: 97 ef ldi r25, 0xF7 ; 247 19eca: 98 0f add r25, r24 19ecc: 92 30 cpi r25, 0x02 ; 2 19ece: 10 f4 brcc .+4 ; 0x19ed4 19ed0: 0c 94 d0 b8 jmp 0x171a0 ; 0x171a0 19ed4: 8d 30 cpi r24, 0x0D ; 13 19ed6: 11 f4 brne .+4 ; 0x19edc 19ed8: 0c 94 d0 b8 jmp 0x171a0 ; 0x171a0 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); 19edc: 0e 94 7c 6f call 0xdef8 ; 0xdef8 19ee0: eb cf rjmp .-42 ; 0x19eb8 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; 19ee2: ce 01 movw r24, r28 19ee4: 01 96 adiw r24, 0x01 ; 1 19ee6: 0f 94 d6 47 call 0x28fac ; 0x28fac 19eea: 0c 94 bf ac jmp 0x1597e ; 0x1597e 00019eee : uint8_t check_pinda_0() { return _PINDA?0:1; } 19eee: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 19ef2: 90 91 f8 03 lds r25, 0x03F8 ; 0x8003f8 19ef6: 08 95 ret 00019ef8 : 19ef8: 81 50 subi r24, 0x01 ; 1 19efa: 82 31 cpi r24, 0x12 ; 18 19efc: 08 f0 brcs .+2 ; 0x19f00 19efe: 5a c0 rjmp .+180 ; 0x19fb4 19f00: e8 2f mov r30, r24 19f02: f0 e0 ldi r31, 0x00 ; 0 19f04: 88 27 eor r24, r24 19f06: e8 57 subi r30, 0x78 ; 120 19f08: f0 43 sbci r31, 0x30 ; 48 19f0a: 8f 4f sbci r24, 0xFF ; 255 19f0c: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 19f10: a8 cf rjmp .-176 ; 0x19e62 19f12: ac cf rjmp .-168 ; 0x19e6c 19f14: 9a cf rjmp .-204 ; 0x19e4a 19f16: a0 cf rjmp .-192 ; 0x19e58 19f18: a4 cf rjmp .-184 ; 0x19e62 19f1a: da cf rjmp .-76 ; 0x19ed0 19f1c: af cf rjmp .-162 ; 0x19e7c 19f1e: b5 cf rjmp .-150 ; 0x19e8a 19f20: b9 cf rjmp .-142 ; 0x19e94 19f22: bf cf rjmp .-130 ; 0x19ea2 19f24: c3 cf rjmp .-122 ; 0x19eac 19f26: c7 cf rjmp .-114 ; 0x19eb6 19f28: cd cf rjmp .-102 ; 0x19ec4 19f2a: d1 cf rjmp .-94 ; 0x19ece 19f2c: da cf rjmp .-76 ; 0x19ee2 19f2e: d5 cf rjmp .-86 ; 0x19eda 19f30: db cf rjmp .-74 ; 0x19ee8 19f32: df cf rjmp .-66 ; 0x19ef2 19f34: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f38: 8f 77 andi r24, 0x7F ; 127 19f3a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f3e: 08 95 ret 19f40: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f44: 8f 7d andi r24, 0xDF ; 223 19f46: f9 cf rjmp .-14 ; 0x19f3a 19f48: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f4c: 87 7f andi r24, 0xF7 ; 247 19f4e: f5 cf rjmp .-22 ; 0x19f3a 19f50: 84 b5 in r24, 0x24 ; 36 19f52: 8f 77 andi r24, 0x7F ; 127 19f54: 84 bd out 0x24, r24 ; 36 19f56: 08 95 ret 19f58: 84 b5 in r24, 0x24 ; 36 19f5a: 8f 7d andi r24, 0xDF ; 223 19f5c: fb cf rjmp .-10 ; 0x19f54 19f5e: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f62: 8f 77 andi r24, 0x7F ; 127 19f64: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f68: 08 95 ret 19f6a: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f6e: 8f 7d andi r24, 0xDF ; 223 19f70: f9 cf rjmp .-14 ; 0x19f64 19f72: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19f76: 8f 77 andi r24, 0x7F ; 127 19f78: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19f7c: 08 95 ret 19f7e: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19f82: 8f 7d andi r24, 0xDF ; 223 19f84: f9 cf rjmp .-14 ; 0x19f78 19f86: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19f8a: 87 7f andi r24, 0xF7 ; 247 19f8c: f5 cf rjmp .-22 ; 0x19f78 19f8e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19f92: 8f 77 andi r24, 0x7F ; 127 19f94: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19f98: 08 95 ret 19f9a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19f9e: 8f 7d andi r24, 0xDF ; 223 19fa0: f9 cf rjmp .-14 ; 0x19f94 19fa2: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fa6: 87 7f andi r24, 0xF7 ; 247 19fa8: f5 cf rjmp .-22 ; 0x19f94 19faa: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fae: 8f 77 andi r24, 0x7F ; 127 19fb0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fb4: 08 95 ret 19fb6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fba: 8f 7d andi r24, 0xDF ; 223 19fbc: f9 cf rjmp .-14 ; 0x19fb0 19fbe: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fc2: 87 7f andi r24, 0xF7 ; 247 19fc4: f5 cf rjmp .-22 ; 0x19fb0 00019fc6 : 19fc6: 83 b1 in r24, 0x03 ; 3 19fc8: 82 95 swap r24 19fca: 81 70 andi r24, 0x01 ; 1 19fcc: 08 95 ret 00019fce : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19fce: cf 92 push r12 19fd0: df 92 push r13 19fd2: ef 92 push r14 19fd4: 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; 19fd6: 20 91 f9 03 lds r18, 0x03F9 ; 0x8003f9 19fda: b0 e0 ldi r27, 0x00 ; 0 19fdc: a0 e0 ldi r26, 0x00 ; 0 19fde: c0 90 62 07 lds r12, 0x0762 ; 0x800762 19fe2: d0 90 63 07 lds r13, 0x0763 ; 0x800763 19fe6: e0 90 64 07 lds r14, 0x0764 ; 0x800764 19fea: f0 90 65 07 lds r15, 0x0765 ; 0x800765 19fee: 20 ff sbrs r18, 0 19ff0: 42 c0 rjmp .+132 ; 0x1a076 19ff2: c8 1a sub r12, r24 19ff4: d9 0a sbc r13, r25 19ff6: ea 0a sbc r14, r26 19ff8: fb 0a sbc r15, r27 19ffa: c0 92 62 07 sts 0x0762, r12 ; 0x800762 19ffe: d0 92 63 07 sts 0x0763, r13 ; 0x800763 1a002: e0 92 64 07 sts 0x0764, r14 ; 0x800764 1a006: f0 92 65 07 sts 0x0765, r15 ; 0x800765 1a00a: cb 01 movw r24, r22 1a00c: b0 e0 ldi r27, 0x00 ; 0 1a00e: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1a010: c0 90 66 07 lds r12, 0x0766 ; 0x800766 1a014: d0 90 67 07 lds r13, 0x0767 ; 0x800767 1a018: e0 90 68 07 lds r14, 0x0768 ; 0x800768 1a01c: f0 90 69 07 lds r15, 0x0769 ; 0x800769 1a020: 21 ff sbrs r18, 1 1a022: 36 c0 rjmp .+108 ; 0x1a090 1a024: c8 1a sub r12, r24 1a026: d9 0a sbc r13, r25 1a028: ea 0a sbc r14, r26 1a02a: fb 0a sbc r15, r27 1a02c: c0 92 66 07 sts 0x0766, r12 ; 0x800766 1a030: d0 92 67 07 sts 0x0767, r13 ; 0x800767 1a034: e0 92 68 07 sts 0x0768, r14 ; 0x800768 1a038: f0 92 69 07 sts 0x0769, r15 ; 0x800769 1a03c: 70 e0 ldi r23, 0x00 ; 0 1a03e: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1a040: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 1a044: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 1a048: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 1a04c: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 1a050: 22 ff sbrs r18, 2 1a052: 2b c0 rjmp .+86 ; 0x1a0aa 1a054: 84 1b sub r24, r20 1a056: 95 0b sbc r25, r21 1a058: a6 0b sbc r26, r22 1a05a: b7 0b sbc r27, r23 1a05c: 80 93 6a 07 sts 0x076A, r24 ; 0x80076a 1a060: 90 93 6b 07 sts 0x076B, r25 ; 0x80076b 1a064: a0 93 6c 07 sts 0x076C, r26 ; 0x80076c 1a068: b0 93 6d 07 sts 0x076D, r27 ; 0x80076d // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 1a06c: ff 90 pop r15 1a06e: ef 90 pop r14 1a070: df 90 pop r13 1a072: cf 90 pop r12 1a074: 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; 1a076: 8c 0d add r24, r12 1a078: 9d 1d adc r25, r13 1a07a: ae 1d adc r26, r14 1a07c: bf 1d adc r27, r15 1a07e: 80 93 62 07 sts 0x0762, r24 ; 0x800762 1a082: 90 93 63 07 sts 0x0763, r25 ; 0x800763 1a086: a0 93 64 07 sts 0x0764, r26 ; 0x800764 1a08a: b0 93 65 07 sts 0x0765, r27 ; 0x800765 1a08e: bd cf rjmp .-134 ; 0x1a00a if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1a090: 8c 0d add r24, r12 1a092: 9d 1d adc r25, r13 1a094: ae 1d adc r26, r14 1a096: bf 1d adc r27, r15 1a098: 80 93 66 07 sts 0x0766, r24 ; 0x800766 1a09c: 90 93 67 07 sts 0x0767, r25 ; 0x800767 1a0a0: a0 93 68 07 sts 0x0768, r26 ; 0x800768 1a0a4: b0 93 69 07 sts 0x0769, r27 ; 0x800769 1a0a8: c9 cf rjmp .-110 ; 0x1a03c if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1a0aa: 84 0f add r24, r20 1a0ac: 95 1f adc r25, r21 1a0ae: a6 1f adc r26, r22 1a0b0: b7 1f adc r27, r23 1a0b2: d4 cf rjmp .-88 ; 0x1a05c 0001a0b4 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 1a0b4: fb 01 movw r30, r22 *v = 0; 1a0b6: 11 82 std Z+1, r1 ; 0x01 1a0b8: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 1a0ba: 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'; 1a0bc: dc 01 movw r26, r24 1a0be: 2c 91 ld r18, X 1a0c0: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 1a0c2: 2a 30 cpi r18, 0x0A ; 10 1a0c4: a0 f4 brcc .+40 ; 0x1a0ee *v *= 10; 1a0c6: 40 81 ld r20, Z 1a0c8: 51 81 ldd r21, Z+1 ; 0x01 1a0ca: 64 9f mul r22, r20 1a0cc: 90 01 movw r18, r0 1a0ce: 65 9f mul r22, r21 1a0d0: 30 0d add r19, r0 1a0d2: 11 24 eor r1, r1 1a0d4: 31 83 std Z+1, r19 ; 0x01 1a0d6: 20 83 st Z, r18 *v += *str - '0'; 1a0d8: 4d 91 ld r20, X+ 1a0da: cd 01 movw r24, r26 1a0dc: 20 53 subi r18, 0x30 ; 48 1a0de: 31 09 sbc r19, r1 1a0e0: 24 0f add r18, r20 1a0e2: 31 1d adc r19, r1 1a0e4: 47 fd sbrc r20, 7 1a0e6: 3a 95 dec r19 1a0e8: 31 83 std Z+1, r19 ; 0x01 1a0ea: 20 83 st Z, r18 1a0ec: e7 cf rjmp .-50 ; 0x1a0bc ++str; } return str; } 1a0ee: 08 95 ret 0001a0f0 : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 1a0f0: 85 e0 ldi r24, 0x05 ; 5 1a0f2: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 lcd_return_to_status(); 1a0f6: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 0001a0fa : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 1a0fa: 85 e0 ldi r24, 0x05 ; 5 1a0fc: 9c e6 ldi r25, 0x6C ; 108 1a0fe: 0e 94 fe 7a call 0xf5fc ; 0xf5fc lcd_return_to_status(); 1a102: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 0001a106 : //! 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) { 1a106: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 1a10a: 81 30 cpi r24, 0x01 ; 1 1a10c: 21 f4 brne .+8 ; 0x1a116 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 1a10e: 84 e5 ldi r24, 0x54 ; 84 1a110: 9b e6 ldi r25, 0x6B ; 107 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 1a112: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc 1a116: 85 e4 ldi r24, 0x45 ; 69 1a118: 9b e6 ldi r25, 0x6B ; 107 1a11a: fb cf rjmp .-10 ; 0x1a112 0001a11c : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1a11c: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1a120: 80 93 9e 04 sts 0x049E, r24 ; 0x80049e #endif manage_heater(); 1a124: 0d 94 98 4e jmp 0x29d30 ; 0x29d30 0001a128 : 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, 1a128: 1f 93 push r17 1a12a: cf 93 push r28 1a12c: df 93 push r29 1a12e: c8 2f mov r28, r24 1a130: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 1a132: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 1a136: 8d eb ldi r24, 0xBD ; 189 1a138: 93 e4 ldi r25, 0x43 ; 67 1a13a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a13e: ac 01 movw r20, r24 1a140: 60 e0 ldi r22, 0x00 ; 0 1a142: 80 e0 ldi r24, 0x00 ; 0 1a144: 0e 94 a1 6f call 0xdf42 ; 0xdf42 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)); 1a148: 83 e5 ldi r24, 0x53 ; 83 1a14a: 94 e4 ldi r25, 0x44 ; 68 1a14c: c1 11 cpse r28, r1 1a14e: 02 c0 rjmp .+4 ; 0x1a154 1a150: 86 e6 ldi r24, 0x66 ; 102 1a152: 94 e4 ldi r25, 0x44 ; 68 1a154: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a158: ac 01 movw r20, r24 1a15a: 61 e0 ldi r22, 0x01 ; 1 1a15c: 80 e0 ldi r24, 0x00 ; 0 1a15e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_selftest_setfan(255); 1a162: 8f ef ldi r24, 0xFF ; 255 1a164: 0e 94 8e d0 call 0x1a11c ; 0x1a11c break; } _delay(500); 1a168: 64 ef ldi r22, 0xF4 ; 244 1a16a: 71 e0 ldi r23, 0x01 ; 1 1a16c: 80 e0 ldi r24, 0x00 ; 0 1a16e: 90 e0 ldi r25, 0x00 ; 0 1a170: 0f 94 8a 3d call 0x27b14 ; 0x27b14 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 1a174: 82 eb ldi r24, 0xB2 ; 178 1a176: 93 e4 ldi r25, 0x43 ; 67 1a178: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a17c: ac 01 movw r20, r24 1a17e: 62 e0 ldi r22, 0x02 ; 2 1a180: 81 e0 ldi r24, 0x01 ; 1 1a182: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_putc_at(0, 3, '>'); 1a186: 4e e3 ldi r20, 0x3E ; 62 1a188: 63 e0 ldi r22, 0x03 ; 3 1a18a: 80 e0 ldi r24, 0x00 ; 0 1a18c: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 1a190: 83 ea ldi r24, 0xA3 ; 163 1a192: 93 e4 ldi r25, 0x43 ; 67 1a194: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a198: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_encoder = _default; 1a19c: 6d 2f mov r22, r29 1a19e: 70 e0 ldi r23, 0x00 ; 0 1a1a0: 70 93 36 05 sts 0x0536, r23 ; 0x800536 1a1a4: 60 93 35 05 sts 0x0535, r22 ; 0x800535 KEEPALIVE_STATE(PAUSED_FOR_USER); 1a1a8: 84 e0 ldi r24, 0x04 ; 4 1a1aa: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 1a1ae: 0e 94 a5 71 call 0xe34a ; 0xe34a 1a1b2: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 1a1b4: 11 e0 ldi r17, 0x01 ; 1 1a1b6: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 1a1b8: 80 91 35 05 lds r24, 0x0535 ; 0x800535 1a1bc: 90 91 36 05 lds r25, 0x0536 ; 0x800536 1a1c0: 00 97 sbiw r24, 0x00 ; 0 1a1c2: 19 f1 breq .+70 ; 0x1a20a if (lcd_encoder < 0) { 1a1c4: 97 ff sbrs r25, 7 1a1c6: 0b c0 rjmp .+22 ; 0x1a1de _result = !check_opposite; 1a1c8: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 1a1ca: 4e e3 ldi r20, 0x3E ; 62 1a1cc: 62 e0 ldi r22, 0x02 ; 2 1a1ce: 80 e0 ldi r24, 0x00 ; 0 1a1d0: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_putc_at(0, 3, ' '); 1a1d4: 40 e2 ldi r20, 0x20 ; 32 1a1d6: 63 e0 ldi r22, 0x03 ; 3 1a1d8: 80 e0 ldi r24, 0x00 ; 0 1a1da: 0e 94 ad 6f call 0xdf5a ; 0xdf5a } if (lcd_encoder > 0) { 1a1de: 80 91 35 05 lds r24, 0x0535 ; 0x800535 1a1e2: 90 91 36 05 lds r25, 0x0536 ; 0x800536 1a1e6: 18 16 cp r1, r24 1a1e8: 19 06 cpc r1, r25 1a1ea: 5c f4 brge .+22 ; 0x1a202 _result = check_opposite; lcd_putc_at(0, 2, ' '); 1a1ec: 40 e2 ldi r20, 0x20 ; 32 1a1ee: 62 e0 ldi r22, 0x02 ; 2 1a1f0: 80 e0 ldi r24, 0x00 ; 0 1a1f2: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_putc_at(0, 3, '>'); 1a1f6: 4e e3 ldi r20, 0x3E ; 62 1a1f8: 63 e0 ldi r22, 0x03 ; 3 1a1fa: 80 e0 ldi r24, 0x00 ; 0 1a1fc: 0e 94 ad 6f call 0xdf5a ; 0xdf5a 1a200: dc 2f mov r29, r28 } lcd_encoder = 0; 1a202: 10 92 36 05 sts 0x0536, r1 ; 0x800536 1a206: 10 92 35 05 sts 0x0535, r1 ; 0x800535 } manage_heater(); 1a20a: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 1a20e: 81 e0 ldi r24, 0x01 ; 1 1a210: 0e 94 da 8b call 0x117b4 ; 0x117b4 _delay(100); 1a214: 64 e6 ldi r22, 0x64 ; 100 1a216: 70 e0 ldi r23, 0x00 ; 0 1a218: 80 e0 ldi r24, 0x00 ; 0 1a21a: 90 e0 ldi r25, 0x00 ; 0 1a21c: 0f 94 8a 3d call 0x27b14 ; 0x27b14 } while (!lcd_clicked()); 1a220: 0e 94 aa 71 call 0xe354 ; 0xe354 1a224: 88 23 and r24, r24 1a226: 41 f2 breq .-112 ; 0x1a1b8 KEEPALIVE_STATE(IN_HANDLER); 1a228: 82 e0 ldi r24, 0x02 ; 2 1a22a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 setExtruderAutoFanState(0); // Turn off hotend fan 1a22e: 80 e0 ldi r24, 0x00 ; 0 1a230: 0e 94 c9 76 call 0xed92 ; 0xed92 lcd_selftest_setfan(0); // Turn off print fan 1a234: 80 e0 ldi r24, 0x00 ; 0 1a236: 0e 94 8e d0 call 0x1a11c ; 0x1a11c return _result; } 1a23a: 8d 2f mov r24, r29 1a23c: df 91 pop r29 1a23e: cf 91 pop r28 1a240: 1f 91 pop r17 1a242: 08 95 ret 0001a244 : #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) { 1a244: cf 93 push r28 1a246: df 93 push r29 1a248: c8 2f mov r28, r24 1a24a: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 1a24c: c1 50 subi r28, 0x01 ; 1 1a24e: 98 f0 brcs .+38 ; 0x1a276 for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1a250: 4d e2 ldi r20, 0x2D ; 45 1a252: 6d 2f mov r22, r29 1a254: 82 e1 ldi r24, 0x12 ; 18 1a256: 0e 94 ad 6f call 0xdf5a ; 0xdf5a delay_keep_alive(1000 / sizeof(symbols)); 1a25a: 84 ef ldi r24, 0xF4 ; 244 1a25c: 91 e0 ldi r25, 0x01 ; 1 1a25e: 0e 94 7f 8e call 0x11cfe ; 0x11cfe // 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]); 1a262: 4c e7 ldi r20, 0x7C ; 124 1a264: 6d 2f mov r22, r29 1a266: 82 e1 ldi r24, 0x12 ; 18 1a268: 0e 94 ad 6f call 0xdf5a ; 0xdf5a delay_keep_alive(1000 / sizeof(symbols)); 1a26c: 84 ef ldi r24, 0xF4 ; 244 1a26e: 91 e0 ldi r25, 0x01 ; 1 1a270: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 1a274: eb cf rjmp .-42 ; 0x1a24c } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1a276: 0f 94 83 3f call 0x27f06 ; 0x27f06 1a27a: 60 93 9a 17 sts 0x179A, r22 ; 0x80179a 1a27e: 70 93 9b 17 sts 0x179B, r23 ; 0x80179b 1a282: 80 93 9c 17 sts 0x179C, r24 ; 0x80179c 1a286: 90 93 9d 17 sts 0x179D, r25 ; 0x80179d #endif fan_measuring = true; 1a28a: 81 e0 ldi r24, 0x01 ; 1 1a28c: 80 93 34 05 sts 0x0534, r24 ; 0x800534 while(fan_measuring) { 1a290: 80 91 34 05 lds r24, 0x0534 ; 0x800534 1a294: 88 23 and r24, r24 1a296: 29 f0 breq .+10 ; 0x1a2a2 delay_keep_alive(100); 1a298: 84 e6 ldi r24, 0x64 ; 100 1a29a: 90 e0 ldi r25, 0x00 ; 0 1a29c: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 1a2a0: f7 cf rjmp .-18 ; 0x1a290 } gcode_M123(); } 1a2a2: df 91 pop r29 1a2a4: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 1a2a6: 0c 94 31 67 jmp 0xce62 ; 0xce62 0001a2aa : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 1a2aa: cf 93 push r28 1a2ac: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1a2ae: 0f 94 24 59 call 0x2b248 ; 0x2b248 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 1a2b2: c1 e4 ldi r28, 0x41 ; 65 1a2b4: 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)); 1a2b6: 60 91 73 13 lds r22, 0x1373 ; 0x801373 1a2ba: 70 e0 ldi r23, 0x00 ; 0 1a2bc: 90 e0 ldi r25, 0x00 ; 0 1a2be: 80 e0 ldi r24, 0x00 ; 0 1a2c0: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1a2c4: 9b 01 movw r18, r22 1a2c6: ac 01 movw r20, r24 1a2c8: 6c 85 ldd r22, Y+12 ; 0x0c 1a2ca: 7d 85 ldd r23, Y+13 ; 0x0d 1a2cc: 8e 85 ldd r24, Y+14 ; 0x0e 1a2ce: 9f 85 ldd r25, Y+15 ; 0x0f 1a2d0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1a2d4: 6c 87 std Y+12, r22 ; 0x0c 1a2d6: 7d 87 std Y+13, r23 ; 0x0d 1a2d8: 8e 87 std Y+14, r24 ; 0x0e 1a2da: 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])); 1a2dc: 62 e0 ldi r22, 0x02 ; 2 1a2de: 8e e6 ldi r24, 0x6E ; 110 1a2e0: 90 e9 ldi r25, 0x90 ; 144 } 1a2e2: df 91 pop r29 1a2e4: 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])); 1a2e6: 0d 94 25 88 jmp 0x3104a ; 0x3104a 0001a2ea : 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) { 1a2ea: 0f 93 push r16 1a2ec: 1f 93 push r17 1a2ee: cf 93 push r28 1a2f0: df 93 push r29 1a2f2: 98 2f mov r25, r24 1a2f4: 86 2f mov r24, r22 1a2f6: 14 2f mov r17, r20 1a2f8: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a2fa: 69 2f mov r22, r25 1a2fc: 0e 94 8d 6f call 0xdf1a ; 0xdf1a switch (_state) 1a300: 11 30 cpi r17, 0x01 ; 1 1a302: 21 f0 breq .+8 ; 0x1a30c 1a304: 12 30 cpi r17, 0x02 ; 2 1a306: 79 f0 breq .+30 ; 0x1a326 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a308: ce 01 movw r24, r28 1a30a: 15 c0 rjmp .+42 ; 0x1a336 { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a30c: ce 01 movw r24, r28 1a30e: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc(':'); 1a312: 8a e3 ldi r24, 0x3A ; 58 1a314: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc(_indicator); 1a318: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a31a: df 91 pop r29 1a31c: cf 91 pop r28 1a31e: 1f 91 pop r17 1a320: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a322: 0c 94 7c 6f jmp 0xdef8 ; 0xdef8 break; case 2: lcd_puts_P(_name_PROGMEM); 1a326: ce 01 movw r24, r28 1a328: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc(':'); 1a32c: 8a e3 ldi r24, 0x3A ; 58 1a32e: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_puts_P(MSG_OK_CAPS); 1a332: 83 eb ldi r24, 0xB3 ; 179 1a334: 9b e6 ldi r25, 0x6B ; 107 break; default: lcd_puts_P(_name_PROGMEM); } } 1a336: df 91 pop r29 1a338: cf 91 pop r28 1a33a: 1f 91 pop r17 1a33c: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a33e: 0c 94 78 6f jmp 0xdef0 ; 0xdef0 0001a342 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 1a342: df 92 push r13 1a344: ef 92 push r14 1a346: ff 92 push r15 1a348: 0f 93 push r16 1a34a: 1f 93 push r17 1a34c: cf 93 push r28 1a34e: df 93 push r29 1a350: cd b7 in r28, 0x3d ; 61 1a352: de b7 in r29, 0x3e ; 62 1a354: 63 97 sbiw r28, 0x13 ; 19 1a356: 0f b6 in r0, 0x3f ; 63 1a358: f8 94 cli 1a35a: de bf out 0x3e, r29 ; 62 1a35c: 0f be out 0x3f, r0 ; 63 1a35e: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1a360: 30 91 16 05 lds r19, 0x0516 ; 0x800516 1a364: 20 91 15 05 lds r18, 0x0515 ; 0x800515 1a368: 32 13 cpse r19, r18 1a36a: 73 c0 rjmp .+230 ; 0x1a452 1a36c: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 1a36e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a372: 88 23 and r24, r24 1a374: 09 f4 brne .+2 ; 0x1a378 1a376: 45 c0 rjmp .+138 ; 0x1a402 //! //! @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)); 1a378: 8b e9 ldi r24, 0x9B ; 155 1a37a: 93 e4 ldi r25, 0x43 ; 67 1a37c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a380: 9f 93 push r25 1a382: 8f 93 push r24 1a384: 8d e2 ldi r24, 0x2D ; 45 1a386: 90 e9 ldi r25, 0x90 ; 144 1a388: 9f 93 push r25 1a38a: 8f 93 push r24 1a38c: 8e 01 movw r16, r28 1a38e: 0f 5f subi r16, 0xFF ; 255 1a390: 1f 4f sbci r17, 0xFF ; 255 1a392: 1f 93 push r17 1a394: 0f 93 push r16 1a396: 0f 94 a0 dc call 0x3b940 ; 0x3b940 1a39a: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 1a39c: 47 e0 ldi r20, 0x07 ; 7 1a39e: 50 e0 ldi r21, 0x00 ; 0 1a3a0: b7 01 movw r22, r14 1a3a2: 80 0f add r24, r16 1a3a4: 91 2f mov r25, r17 1a3a6: 91 1d adc r25, r1 1a3a8: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 1a3ac: 0f 90 pop r0 1a3ae: 0f 90 pop r0 1a3b0: 0f 90 pop r0 1a3b2: 0f 90 pop r0 1a3b4: 0f 90 pop r0 1a3b6: 0f 90 pop r0 1a3b8: 20 e0 ldi r18, 0x00 ; 0 1a3ba: 82 2f mov r24, r18 1a3bc: 8d 0d add r24, r13 1a3be: 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) 1a3c0: 27 30 cpi r18, 0x07 ; 7 1a3c2: 39 f0 breq .+14 ; 0x1a3d2 1a3c4: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 1a3c6: f8 01 movw r30, r16 1a3c8: e8 0f add r30, r24 1a3ca: f9 1f adc r31, r25 1a3cc: 30 81 ld r19, Z 1a3ce: 31 11 cpse r19, r1 1a3d0: f4 cf rjmp .-24 ; 0x1a3ba } buffer.c[index] = ']'; 1a3d2: f8 01 movw r30, r16 1a3d4: e8 0f add r30, r24 1a3d6: f9 1f adc r31, r25 1a3d8: 2d e5 ldi r18, 0x5D ; 93 1a3da: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 1a3dc: 8c 0f add r24, r28 1a3de: 9d 1f adc r25, r29 1a3e0: fc 01 movw r30, r24 1a3e2: 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()); 1a3e4: 0f 94 ca cd call 0x39b94 ; 0x39b94 1a3e8: 48 2f mov r20, r24 1a3ea: 60 91 13 05 lds r22, 0x0513 ; 0x800513 1a3ee: 80 e0 ldi r24, 0x00 ; 0 1a3f0: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_print_pad(buffer.c, LCD_WIDTH - 2); 1a3f4: 62 e1 ldi r22, 0x12 ; 18 1a3f6: c8 01 movw r24, r16 1a3f8: 0e 94 7c 71 call 0xe2f8 ; 0xe2f8 lcd_putc(type_char); 1a3fc: 80 e2 ldi r24, 0x20 ; 32 1a3fe: 0e 94 7c 6f call 0xdef8 ; 0xdef8 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)) 1a402: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a406: 88 23 and r24, r24 1a408: 21 f1 breq .+72 ; 0x1a452 1a40a: 20 91 16 05 lds r18, 0x0516 ; 0x800516 1a40e: 80 91 35 05 lds r24, 0x0535 ; 0x800535 1a412: 90 91 36 05 lds r25, 0x0536 ; 0x800536 1a416: 28 17 cp r18, r24 1a418: 19 06 cpc r1, r25 1a41a: d9 f4 brne .+54 ; 0x1a452 { lcd_update_enabled = 0; 1a41c: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 1a420: 86 ee ldi r24, 0xE6 ; 230 1a422: 97 e7 ldi r25, 0x77 ; 119 1a424: 89 2b or r24, r25 1a426: 11 f0 breq .+4 ; 0x1a42c 1a428: 0e 94 e6 77 call 0xefcc ; 0xefcc lcd_update_enabled = 1; 1a42c: 81 e0 ldi r24, 0x01 ; 1 1a42e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 1a432: 0f 94 ee cd call 0x39bdc ; 0x39bdc return; } } menu_item++; } 1a436: 63 96 adiw r28, 0x13 ; 19 1a438: 0f b6 in r0, 0x3f ; 63 1a43a: f8 94 cli 1a43c: de bf out 0x3e, r29 ; 62 1a43e: 0f be out 0x3f, r0 ; 63 1a440: cd bf out 0x3d, r28 ; 61 1a442: df 91 pop r29 1a444: cf 91 pop r28 1a446: 1f 91 pop r17 1a448: 0f 91 pop r16 1a44a: ff 90 pop r15 1a44c: ef 90 pop r14 1a44e: df 90 pop r13 1a450: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 1a452: 80 91 16 05 lds r24, 0x0516 ; 0x800516 1a456: 8f 5f subi r24, 0xFF ; 255 1a458: 80 93 16 05 sts 0x0516, r24 ; 0x800516 1a45c: ec cf rjmp .-40 ; 0x1a436 0001a45e : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 1a45e: cf 92 push r12 1a460: df 92 push r13 1a462: ef 92 push r14 1a464: ff 92 push r15 1a466: 0f 93 push r16 1a468: 1f 93 push r17 1a46a: cf 93 push r28 1a46c: df 93 push r29 1a46e: 6c 01 movw r12, r24 1a470: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 1a472: c4 2f mov r28, r20 1a474: d0 e0 ldi r29, 0x00 ; 0 1a476: ae 01 movw r20, r28 1a478: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 1a47c: 89 2b or r24, r25 1a47e: b9 f4 brne .+46 ; 0x1a4ae Number(str + tagSize, v); 1a480: b8 01 movw r22, r16 1a482: c6 01 movw r24, r12 1a484: 8c 0f add r24, r28 1a486: 9d 1f adc r25, r29 1a488: 0e 94 5a d0 call 0x1a0b4 ; 0x1a0b4 *v |= tagMask; 1a48c: f8 01 movw r30, r16 1a48e: 20 81 ld r18, Z 1a490: 31 81 ldd r19, Z+1 ; 0x01 1a492: 2e 29 or r18, r14 1a494: 3f 29 or r19, r15 1a496: 31 83 std Z+1, r19 ; 0x01 1a498: 20 83 st Z, r18 return true; 1a49a: 81 e0 ldi r24, 0x01 ; 1 } return false; } 1a49c: df 91 pop r29 1a49e: cf 91 pop r28 1a4a0: 1f 91 pop r17 1a4a2: 0f 91 pop r16 1a4a4: ff 90 pop r15 1a4a6: ef 90 pop r14 1a4a8: df 90 pop r13 1a4aa: cf 90 pop r12 1a4ac: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 1a4ae: 80 e0 ldi r24, 0x00 ; 0 1a4b0: f5 cf rjmp .-22 ; 0x1a49c 0001a4b2 : } #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); 1a4b2: 87 ea ldi r24, 0xA7 ; 167 1a4b4: 9c e0 ldi r25, 0x0C ; 12 1a4b6: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 if (value > 1) value = 1; 1a4ba: 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) 1a4bc: 82 30 cpi r24, 0x02 ; 2 1a4be: 08 f4 brcc .+2 ; 0x1a4c2 1a4c0: 68 27 eor r22, r24 1a4c2: 87 ea ldi r24, 0xA7 ; 167 1a4c4: 9c e0 ldi r25, 0x0C ; 12 1a4c6: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0001a4ca : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 1a4ca: cf 93 push r28 1a4cc: df 93 push r29 1a4ce: c5 e1 ldi r28, 0x15 ; 21 1a4d0: 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++)); 1a4d2: fe 01 movw r30, r28 1a4d4: ef 5e subi r30, 0xEF ; 239 1a4d6: f0 48 sbci r31, 0x80 ; 128 1a4d8: 64 91 lpm r22, Z 1a4da: ce 01 movw r24, r28 1a4dc: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 1a4e0: 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++) { 1a4e2: c9 32 cpi r28, 0x29 ; 41 1a4e4: 8d e0 ldi r24, 0x0D ; 13 1a4e6: d8 07 cpc r29, r24 1a4e8: a1 f7 brne .-24 ; 0x1a4d2 eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 1a4ea: df 91 pop r29 1a4ec: cf 91 pop r28 1a4ee: 08 95 ret 0001a4f0 : 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); 1a4f0: 8a ea ldi r24, 0xAA ; 170 1a4f2: 9d e0 ldi r25, 0x0D ; 13 1a4f4: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 1a4f8: 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) { 1a4fa: 83 30 cpi r24, 0x03 ; 3 1a4fc: 21 f0 breq .+8 ; 0x1a506 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 1a4fe: 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) { 1a500: 85 30 cpi r24, 0x05 ; 5 1a502: 09 f0 breq .+2 ; 0x1a506 case 1: mbl_z_probe_nr = 3; break; 1a504: 63 e0 ldi r22, 0x03 ; 3 1a506: 8a ea ldi r24, 0xAA ; 170 1a508: 9d e0 ldi r25, 0x0D ; 13 1a50a: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0001a50e : 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); 1a50e: 8b ea ldi r24, 0xAB ; 171 1a510: 9d e0 ldi r25, 0x0D ; 13 1a512: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 1a516: 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; 1a518: 83 30 cpi r24, 0x03 ; 3 1a51a: 09 f4 brne .+2 ; 0x1a51e 1a51c: 67 e0 ldi r22, 0x07 ; 7 1a51e: 8b ea ldi r24, 0xAB ; 171 1a520: 9d e0 ldi r25, 0x0D ; 13 1a522: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0001a526 : #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); 1a526: 8c ea ldi r24, 0xAC ; 172 1a528: 9d e0 ldi r25, 0x0D ; 13 1a52a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 magnet_elimination = !magnet_elimination; 1a52e: 61 e0 ldi r22, 0x01 ; 1 1a530: 81 11 cpse r24, r1 1a532: 60 e0 ldi r22, 0x00 ; 0 1a534: 8c ea ldi r24, 0xAC ; 172 1a536: 9d e0 ldi r25, 0x0D ; 13 1a538: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0001a53c : 1a53c: 60 91 dc 03 lds r22, 0x03DC ; 0x8003dc 1a540: 81 ea ldi r24, 0xA1 ; 161 1a542: 9d e0 ldi r25, 0x0D ; 13 1a544: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a //! @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(); 1a548: 0d 94 81 2a jmp 0x25502 ; 0x25502 0001a54c : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a54c: 0f 93 push r16 1a54e: 1f 93 push r17 1a550: cf 93 push r28 1a552: df 93 push r29 1a554: 00 d0 rcall .+0 ; 0x1a556 1a556: 00 d0 rcall .+0 ; 0x1a558 1a558: 1f 92 push r1 1a55a: 1f 92 push r1 1a55c: cd b7 in r28, 0x3d ; 61 1a55e: de b7 in r29, 0x3e ; 62 1a560: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a562: 8a e0 ldi r24, 0x0A ; 10 1a564: 90 e0 ldi r25, 0x00 ; 0 1a566: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 1a56a: 9a 83 std Y+2, r25 ; 0x02 1a56c: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a56e: 8c e0 ldi r24, 0x0C ; 12 1a570: 90 e0 ldi r25, 0x00 ; 0 1a572: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 1a576: 9c 83 std Y+4, r25 ; 0x04 1a578: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a57a: 8e e0 ldi r24, 0x0E ; 14 1a57c: 90 e0 ldi r25, 0x00 ; 0 1a57e: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 1a582: 9e 83 std Y+6, r25 ; 0x06 1a584: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a586: 80 e1 ldi r24, 0x10 ; 16 1a588: 90 e0 ldi r25, 0x00 ; 0 1a58a: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 1a58e: 98 87 std Y+8, r25 ; 0x08 1a590: 8f 83 std Y+7, r24 ; 0x07 1a592: c8 01 movw r24, r16 1a594: de 01 movw r26, r28 1a596: 11 96 adiw r26, 0x01 ; 1 1a598: be 01 movw r22, r28 1a59a: 67 5f subi r22, 0xF7 ; 247 1a59c: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a59e: fc 01 movw r30, r24 1a5a0: 25 91 lpm r18, Z+ 1a5a2: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a5a4: 4d 91 ld r20, X+ 1a5a6: 5d 91 ld r21, X+ 1a5a8: 42 17 cp r20, r18 1a5aa: 53 07 cpc r21, r19 1a5ac: 48 f0 brcs .+18 ; 0x1a5c0 return true; else if (v < ver_eeprom[i]) 1a5ae: 24 17 cp r18, r20 1a5b0: 35 07 cpc r19, r21 1a5b2: 20 f0 brcs .+8 ; 0x1a5bc 1a5b4: 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) { 1a5b6: a6 17 cp r26, r22 1a5b8: b7 07 cpc r27, r23 1a5ba: 89 f7 brne .-30 ; 0x1a59e return true; else if (v < ver_eeprom[i]) break; } return false; 1a5bc: 80 e0 ldi r24, 0x00 ; 0 1a5be: 01 c0 rjmp .+2 ; 0x1a5c2 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; 1a5c0: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a5c2: 28 96 adiw r28, 0x08 ; 8 1a5c4: 0f b6 in r0, 0x3f ; 63 1a5c6: f8 94 cli 1a5c8: de bf out 0x3e, r29 ; 62 1a5ca: 0f be out 0x3f, r0 ; 63 1a5cc: cd bf out 0x3d, r28 ; 61 1a5ce: df 91 pop r29 1a5d0: cf 91 pop r28 1a5d2: 1f 91 pop r17 1a5d4: 0f 91 pop r16 1a5d6: 08 95 ret 0001a5d8 : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1a5d8: 0e 94 06 8a call 0x1140c ; 0x1140c // M24: Start/resume SD print enquecommand_P(MSG_M24); 1a5dc: 61 e0 ldi r22, 0x01 ; 1 1a5de: 88 ee ldi r24, 0xE8 ; 232 1a5e0: 90 e7 ldi r25, 0x70 ; 112 1a5e2: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_return_to_status(); 1a5e6: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 0001a5ea : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a5ea: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a5ec: 8d e7 ldi r24, 0x7D ; 125 1a5ee: 9d e3 ldi r25, 0x3D ; 61 1a5f0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a5f4: ac 01 movw r20, r24 1a5f6: 60 e0 ldi r22, 0x00 ; 0 1a5f8: 80 e0 ldi r24, 0x00 ; 0 1a5fa: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_putc_at(0, 1, '\n'); 1a5fe: 4a e0 ldi r20, 0x0A ; 10 1a600: 61 e0 ldi r22, 0x01 ; 1 1a602: 80 e0 ldi r24, 0x00 ; 0 1a604: 0e 94 ad 6f call 0xdf5a ; 0xdf5a MENU_BEGIN(); 1a608: 0f 94 08 cf call 0x39e10 ; 0x39e10 1a60c: 10 92 13 05 sts 0x0513, r1 ; 0x800513 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a610: 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(); 1a612: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a616: 84 30 cpi r24, 0x04 ; 4 1a618: 18 f5 brcc .+70 ; 0x1a660 1a61a: 10 92 16 05 sts 0x0516, r1 ; 0x800516 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a61e: 81 11 cpse r24, r1 1a620: 02 c0 rjmp .+4 ; 0x1a626 1a622: c0 93 13 05 sts 0x0513, r28 ; 0x800513 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1a626: 88 e7 ldi r24, 0x78 ; 120 1a628: 9d e3 ldi r25, 0x3D ; 61 1a62a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a62e: 61 ec ldi r22, 0xC1 ; 193 1a630: 79 e3 ldi r23, 0x39 ; 57 1a632: 0f 94 85 ce call 0x39d0a ; 0x39d0a MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a636: 82 e7 ldi r24, 0x72 ; 114 1a638: 9d e3 ldi r25, 0x3D ; 61 1a63a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a63e: 67 ea ldi r22, 0xA7 ; 167 1a640: 7a e3 ldi r23, 0x3A ; 58 1a642: 0f 94 85 ce call 0x39d0a ; 0x39d0a MENU_END(); 1a646: 0f 94 dc ce call 0x39db8 ; 0x39db8 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a64a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a64e: 8f 5f subi r24, 0xFF ; 255 1a650: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a654: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a658: 8f 5f subi r24, 0xFF ; 255 1a65a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a65e: d9 cf rjmp .-78 ; 0x1a612 // 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(); } 1a660: cf 91 pop r28 1a662: 08 95 ret 0001a664 : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1a664: cf 93 push r28 1a666: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1a668: 86 ed ldi r24, 0xD6 ; 214 1a66a: 93 e0 ldi r25, 0x03 ; 3 1a66c: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1a670: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 1a674: 81 11 cpse r24, r1 1a676: 18 c0 rjmp .+48 ; 0x1a6a8 1a678: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 1a67c: 81 11 cpse r24, r1 1a67e: 14 c0 rjmp .+40 ; 0x1a6a8 1a680: c0 91 67 0e lds r28, 0x0E67 ; 0x800e67 1a684: d0 91 68 0e lds r29, 0x0E68 ; 0x800e68 1a688: 89 e3 ldi r24, 0x39 ; 57 1a68a: c3 3e cpi r28, 0xE3 ; 227 1a68c: d8 07 cpc r29, r24 1a68e: 61 f0 breq .+24 ; 0x1a6a8 1a690: 89 e3 ldi r24, 0x39 ; 57 1a692: cf 37 cpi r28, 0x7F ; 127 1a694: d8 07 cpc r29, r24 1a696: 41 f0 breq .+16 ; 0x1a6a8 1a698: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 1a69c: 81 11 cpse r24, r1 1a69e: 04 c0 rjmp .+8 ; 0x1a6a8 1a6a0: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1a6a4: 88 23 and r24, r24 1a6a6: 31 f0 breq .+12 ; 0x1a6b4 { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1a6a8: 82 e0 ldi r24, 0x02 ; 2 1a6aa: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a6ae: df 91 pop r29 1a6b0: cf 91 pop r28 1a6b2: 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) 1a6b4: 8b e3 ldi r24, 0x3B ; 59 1a6b6: cb 30 cpi r28, 0x0B ; 11 1a6b8: d8 07 cpc r29, r24 1a6ba: 49 f4 brne .+18 ; 0x1a6ce { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1a6bc: 82 e0 ldi r24, 0x02 ; 2 1a6be: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a6c2: 8a e2 ldi r24, 0x2A ; 42 1a6c4: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a6c6: df 91 pop r29 1a6c8: 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); 1a6ca: 0c 94 b7 77 jmp 0xef6e ; 0xef6e 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); 1a6ce: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 1a6d2: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 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 1a6d6: 98 13 cpse r25, r24 1a6d8: 04 c0 rjmp .+8 ; 0x1a6e2 1a6da: 0e 94 3d 68 call 0xd07a ; 0xd07a 1a6de: 88 23 and r24, r24 1a6e0: 61 f0 breq .+24 ; 0x1a6fa if ( babystep_allowed_strict() 1a6e2: 0e 94 78 68 call 0xd0f0 ; 0xd0f0 && (menu_menu == lcd_status_screen // and in listed menus... 1a6e6: 81 11 cpse r24, r1 1a6e8: 10 c0 rjmp .+32 ; 0x1a70a Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1a6ea: 82 e0 ldi r24, 0x02 ; 2 1a6ec: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1a6f0: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a6f2: df 91 pop r29 1a6f4: cf 91 pop r28 1a6f6: 0d 94 77 64 jmp 0x2c8ee ; 0x2c8ee menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1a6fa: 8a e3 ldi r24, 0x3A ; 58 1a6fc: cb 33 cpi r28, 0x3B ; 59 1a6fe: d8 07 cpc r29, r24 1a700: e1 f4 brne .+56 ; 0x1a73a #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a702: 60 e0 ldi r22, 0x00 ; 0 1a704: 8f e7 ldi r24, 0x7F ; 127 1a706: 99 e3 ldi r25, 0x39 ; 57 1a708: 14 c0 rjmp .+40 ; 0x1a732 // 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... 1a70a: 8a e3 ldi r24, 0x3A ; 58 1a70c: cb 33 cpi r28, 0x3B ; 59 1a70e: d8 07 cpc r29, r24 1a710: 59 f0 breq .+22 ; 0x1a728 || menu_menu == lcd_main_menu 1a712: 84 ee ldi r24, 0xE4 ; 228 1a714: c9 3b cpi r28, 0xB9 ; 185 1a716: d8 07 cpc r29, r24 1a718: 39 f0 breq .+14 ; 0x1a728 || menu_menu == lcd_tune_menu 1a71a: 84 ed ldi r24, 0xD4 ; 212 1a71c: c3 3e cpi r28, 0xE3 ; 227 1a71e: d8 07 cpc r29, r24 1a720: 19 f0 breq .+6 ; 0x1a728 || menu_menu == lcd_support_menu 1a722: cd 58 subi r28, 0x8D ; 141 1a724: d9 43 sbci r29, 0x39 ; 57 1a726: 09 f7 brne .-62 ; 0x1a6ea ) ){ lcd_clear(); 1a728: 0e 94 c0 6f call 0xdf80 ; 0xdf80 menu_submenu(lcd_babystep_z); 1a72c: 60 e0 ldi r22, 0x00 ; 0 1a72e: 83 ee ldi r24, 0xE3 ; 227 1a730: 99 e3 ldi r25, 0x39 ; 57 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a732: df 91 pop r29 1a734: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a736: 0d 94 75 d0 jmp 0x3a0ea ; 0x3a0ea } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1a73a: 84 ee ldi r24, 0xE4 ; 228 1a73c: c9 3b cpi r28, 0xB9 ; 185 1a73e: d8 07 cpc r29, r24 1a740: 01 f3 breq .-64 ; 0x1a702 || menu_menu == lcd_preheat_menu 1a742: 8a e3 ldi r24, 0x3A ; 58 1a744: cb 30 cpi r28, 0x0B ; 11 1a746: d8 07 cpc r29, r24 1a748: e1 f2 breq .-72 ; 0x1a702 || menu_menu == lcd_sdcard_menu 1a74a: 89 e3 ldi r24, 0x39 ; 57 1a74c: cb 36 cpi r28, 0x6B ; 107 1a74e: d8 07 cpc r29, r24 1a750: c1 f2 breq .-80 ; 0x1a702 || menu_menu == lcd_settings_menu 1a752: 89 e3 ldi r24, 0x39 ; 57 1a754: c5 3a cpi r28, 0xA5 ; 165 1a756: d8 07 cpc r29, r24 1a758: a1 f2 breq .-88 ; 0x1a702 || menu_menu == lcd_control_temperature_menu 1a75a: 84 ed ldi r24, 0xD4 ; 212 1a75c: c3 3c cpi r28, 0xC3 ; 195 1a75e: d8 07 cpc r29, r24 1a760: 81 f2 breq .-96 ; 0x1a702 #if (LANG_MODE != 0) || menu_menu == lcd_language 1a762: 8a e3 ldi r24, 0x3A ; 58 1a764: c7 30 cpi r28, 0x07 ; 7 1a766: d8 07 cpc r29, r24 1a768: 61 f2 breq .-104 ; 0x1a702 #endif || menu_menu == lcd_support_menu 1a76a: cd 58 subi r28, 0x8D ; 141 1a76c: d9 43 sbci r29, 0x39 ; 57 1a76e: 09 f0 breq .+2 ; 0x1a772 1a770: bc cf rjmp .-136 ; 0x1a6ea 1a772: c7 cf rjmp .-114 ; 0x1a702 0001a774 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a774: 0f 94 08 cf call 0x39e10 ; 0x39e10 1a778: 10 92 13 05 sts 0x0513, r1 ; 0x800513 1a77c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a780: 84 30 cpi r24, 0x04 ; 4 1a782: 08 f0 brcs .+2 ; 0x1a786 1a784: 3f c0 rjmp .+126 ; 0x1a804 1a786: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a78a: 8d e3 ldi r24, 0x3D ; 61 1a78c: 9b e3 ldi r25, 0x3B ; 59 1a78e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a792: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 if(eeprom_is_sheet_initialized(selected_sheet)){ 1a796: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc 1a79a: 0e 94 c4 77 call 0xef88 ; 0xef88 1a79e: 88 23 and r24, r24 1a7a0: 41 f0 breq .+16 ; 0x1a7b2 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a7a2: 84 e3 ldi r24, 0x34 ; 52 1a7a4: 9b e3 ldi r25, 0x3B ; 59 1a7a6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a7aa: 63 ef ldi r22, 0xF3 ; 243 1a7ac: 78 ed ldi r23, 0xD8 ; 216 1a7ae: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } if (lcd_commands_type == LcdCommands::Idle) 1a7b2: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 1a7b6: 81 11 cpse r24, r1 1a7b8: 08 c0 rjmp .+16 ; 0x1a7ca { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a7ba: 81 e2 ldi r24, 0x21 ; 33 1a7bc: 9b e3 ldi r25, 0x3B ; 59 1a7be: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a7c2: 6e e9 ldi r22, 0x9E ; 158 1a7c4: 72 ed ldi r23, 0xD2 ; 210 1a7c6: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a7ca: 88 e1 ldi r24, 0x18 ; 24 1a7cc: 9b e3 ldi r25, 0x3B ; 59 1a7ce: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a7d2: 66 eb ldi r22, 0xB6 ; 182 1a7d4: 76 ed ldi r23, 0xD6 ; 214 1a7d6: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a7da: 80 e1 ldi r24, 0x10 ; 16 1a7dc: 9b e3 ldi r25, 0x3B ; 59 1a7de: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a7e2: 67 e1 ldi r22, 0x17 ; 23 1a7e4: 77 ee ldi r23, 0xE7 ; 231 1a7e6: 0f 94 85 ce call 0x39d0a ; 0x39d0a MENU_END(); 1a7ea: 0f 94 dc ce call 0x39db8 ; 0x39db8 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a7ee: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a7f2: 8f 5f subi r24, 0xFF ; 255 1a7f4: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a7f8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a7fc: 8f 5f subi r24, 0xFF ; 255 1a7fe: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a802: bc cf rjmp .-136 ; 0x1a77c } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a804: 08 95 ret 0001a806 () [clone .lto_priv.454]>: } template static void select_sheet_menu() { selected_sheet = number; 1a806: 87 e0 ldi r24, 0x07 ; 7 1a808: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc lcd_sheet_menu(); 1a80c: 0c 94 ba d3 jmp 0x1a774 ; 0x1a774 0001a810 () [clone .lto_priv.453]>: } template static void select_sheet_menu() { selected_sheet = number; 1a810: 86 e0 ldi r24, 0x06 ; 6 1a812: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc lcd_sheet_menu(); 1a816: 0c 94 ba d3 jmp 0x1a774 ; 0x1a774 0001a81a () [clone .lto_priv.452]>: } template static void select_sheet_menu() { selected_sheet = number; 1a81a: 85 e0 ldi r24, 0x05 ; 5 1a81c: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc lcd_sheet_menu(); 1a820: 0c 94 ba d3 jmp 0x1a774 ; 0x1a774 0001a824 () [clone .lto_priv.451]>: } template static void select_sheet_menu() { selected_sheet = number; 1a824: 84 e0 ldi r24, 0x04 ; 4 1a826: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc lcd_sheet_menu(); 1a82a: 0c 94 ba d3 jmp 0x1a774 ; 0x1a774 0001a82e () [clone .lto_priv.450]>: } template static void select_sheet_menu() { selected_sheet = number; 1a82e: 83 e0 ldi r24, 0x03 ; 3 1a830: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc lcd_sheet_menu(); 1a834: 0c 94 ba d3 jmp 0x1a774 ; 0x1a774 0001a838 () [clone .lto_priv.449]>: } template static void select_sheet_menu() { selected_sheet = number; 1a838: 82 e0 ldi r24, 0x02 ; 2 1a83a: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc lcd_sheet_menu(); 1a83e: 0c 94 ba d3 jmp 0x1a774 ; 0x1a774 0001a842 () [clone .lto_priv.448]>: } template static void select_sheet_menu() { selected_sheet = number; 1a842: 81 e0 ldi r24, 0x01 ; 1 1a844: 80 93 dc 03 sts 0x03DC, r24 ; 0x8003dc lcd_sheet_menu(); 1a848: 0c 94 ba d3 jmp 0x1a774 ; 0x1a774 0001a84c () [clone .lto_priv.447]>: } template static void select_sheet_menu() { selected_sheet = number; 1a84c: 10 92 dc 03 sts 0x03DC, r1 ; 0x8003dc lcd_sheet_menu(); 1a850: 0c 94 ba d3 jmp 0x1a774 ; 0x1a774 0001a854 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a854: 0f 94 08 cf call 0x39e10 ; 0x39e10 1a858: 10 92 13 05 sts 0x0513, r1 ; 0x800513 1a85c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a860: 84 30 cpi r24, 0x04 ; 4 1a862: 08 f0 brcs .+2 ; 0x1a866 1a864: 8f c0 rjmp .+286 ; 0x1a984 1a866: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1a86a: 88 eb ldi r24, 0xB8 ; 184 1a86c: 9d e3 ldi r25, 0x3D ; 61 1a86e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a872: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1a876: 82 ec ldi r24, 0xC2 ; 194 1a878: 9a e3 ldi r25, 0x3A ; 58 1a87a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a87e: 6f ec ldi r22, 0xCF ; 207 1a880: 79 e3 ldi r23, 0x39 ; 57 1a882: 0f 94 85 ce call 0x39d0a ; 0x39d0a if (lcd_commands_type == LcdCommands::Idle) 1a886: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 1a88a: 81 11 cpse r24, r1 1a88c: 08 c0 rjmp .+16 ; 0x1a89e { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1a88e: 81 e2 ldi r24, 0x21 ; 33 1a890: 9b e3 ldi r25, 0x3B ; 59 1a892: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a896: 65 ec ldi r22, 0xC5 ; 197 1a898: 79 e3 ldi r23, 0x39 ; 57 1a89a: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1a89e: 83 e5 ldi r24, 0x53 ; 83 1a8a0: 99 e4 ldi r25, 0x49 ; 73 1a8a2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a8a6: 61 e2 ldi r22, 0x21 ; 33 1a8a8: 7c e6 ldi r23, 0x6C ; 108 1a8aa: 0f 94 fe cd call 0x39bfc ; 0x39bfc #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1a8ae: 86 eb ldi r24, 0xB6 ; 182 1a8b0: 9a e3 ldi r25, 0x3A ; 58 1a8b2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a8b6: 6f ee ldi r22, 0xEF ; 239 1a8b8: 7a e3 ldi r23, 0x3A ; 58 1a8ba: 0f 94 85 ce call 0x39d0a ; 0x39d0a #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1a8be: 8b ea ldi r24, 0xAB ; 171 1a8c0: 9a e3 ldi r25, 0x3A ; 58 1a8c2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a8c6: 65 ea ldi r22, 0xA5 ; 165 1a8c8: 7a e3 ldi r23, 0x3A ; 58 1a8ca: 0f 94 85 ce call 0x39d0a ; 0x39d0a // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1a8ce: 8b e9 ldi r24, 0x9B ; 155 1a8d0: 9a e3 ldi r25, 0x3A ; 58 1a8d2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a8d6: 6f e9 ldi r22, 0x9F ; 159 1a8d8: 7a e3 ldi r23, 0x3A ; 58 1a8da: 0f 94 85 ce call 0x39d0a ; 0x39d0a // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1a8de: 8d e8 ldi r24, 0x8D ; 141 1a8e0: 9a e3 ldi r25, 0x3A ; 58 1a8e2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a8e6: 6f e6 ldi r22, 0x6F ; 111 1a8e8: 7a e3 ldi r23, 0x3A ; 58 1a8ea: 0f 94 85 ce call 0x39d0a ; 0x39d0a MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1a8ee: 89 e7 ldi r24, 0x79 ; 121 1a8f0: 9a e3 ldi r25, 0x3A ; 58 1a8f2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a8f6: 6d ef ldi r22, 0xFD ; 253 1a8f8: 79 e3 ldi r23, 0x39 ; 57 1a8fa: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1a8fe: 85 e6 ldi r24, 0x65 ; 101 1a900: 9a e3 ldi r25, 0x3A ; 58 1a902: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a906: 65 e2 ldi r22, 0x25 ; 37 1a908: 7b e3 ldi r23, 0x3B ; 59 1a90a: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1a90e: 83 e5 ldi r24, 0x53 ; 83 1a910: 9a e3 ldi r25, 0x3A ; 58 1a912: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a916: 6b e5 ldi r22, 0x5B ; 91 1a918: 7a e3 ldi r23, 0x3A ; 58 1a91a: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #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")); 1a91e: 8f e3 ldi r24, 0x3F ; 63 1a920: 9a e3 ldi r25, 0x3A ; 58 1a922: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a926: 66 e1 ldi r22, 0x16 ; 22 1a928: 7b e8 ldi r23, 0x8B ; 139 1a92a: 0f 94 fe cd call 0x39bfc ; 0x39bfc #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1a92e: 20 e0 ldi r18, 0x00 ; 0 1a930: 30 e0 ldi r19, 0x00 ; 0 1a932: 40 e2 ldi r20, 0x20 ; 32 1a934: 51 e4 ldi r21, 0x41 ; 65 1a936: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1a93a: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1a93e: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1a942: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1a946: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1a94a: 87 fd sbrc r24, 7 1a94c: 08 c0 rjmp .+16 ; 0x1a95e MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1a94e: 82 e3 ldi r24, 0x32 ; 50 1a950: 9a e3 ldi r25, 0x3A ; 58 1a952: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a956: 65 ed ldi r22, 0xD5 ; 213 1a958: 79 e3 ldi r23, 0x39 ; 57 1a95a: 0f 94 85 ce call 0x39d0a ; 0x39d0a #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1a95e: 68 e7 ldi r22, 0x78 ; 120 1a960: 70 ed ldi r23, 0xD0 ; 208 1a962: 88 ee ldi r24, 0xE8 ; 232 1a964: 9a e6 ldi r25, 0x6A ; 106 1a966: 0f 94 85 ce call 0x39d0a ; 0x39d0a #endif //THERMAL_MODEL MENU_END(); 1a96a: 0f 94 dc ce call 0x39db8 ; 0x39db8 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a96e: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a972: 8f 5f subi r24, 0xFF ; 255 1a974: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a978: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a97c: 8f 5f subi r24, 0xFF ; 255 1a97e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a982: 6c cf rjmp .-296 ; 0x1a85c #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1a984: 08 95 ret 0001a986 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a986: 0f 94 08 cf call 0x39e10 ; 0x39e10 1a98a: 10 92 13 05 sts 0x0513, r1 ; 0x800513 1a98e: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a992: 84 30 cpi r24, 0x04 ; 4 1a994: b8 f4 brcc .+46 ; 0x1a9c4 1a996: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a99a: 87 e6 ldi r24, 0x67 ; 103 1a99c: 9d e3 ldi r25, 0x3D ; 61 1a99e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1a9a2: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 menuitems_temperature_common(); 1a9a6: 0f 94 d3 32 call 0x265a6 ; 0x265a6 MENU_END(); 1a9aa: 0f 94 dc ce call 0x39db8 ; 0x39db8 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a9ae: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1a9b2: 8f 5f subi r24, 0xFF ; 255 1a9b4: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1a9b8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a9bc: 8f 5f subi r24, 0xFF ; 255 1a9be: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a9c2: e5 cf rjmp .-54 ; 0x1a98e MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1a9c4: 08 95 ret 0001a9c6 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1a9c6: ef 92 push r14 1a9c8: ff 92 push r15 1a9ca: 0f 93 push r16 1a9cc: 1f 93 push r17 1a9ce: cf 93 push r28 1a9d0: df 93 push r29 1a9d2: 80 91 94 02 lds r24, 0x0294 ; 0x800294 1a9d6: 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) 1a9da: 20 91 b4 03 lds r18, 0x03B4 ; 0x8003b4 1a9de: 21 11 cpse r18, r1 1a9e0: 97 c0 rjmp .+302 ; 0x1ab10 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1a9e2: 21 e0 ldi r18, 0x01 ; 1 1a9e4: 20 93 b4 03 sts 0x03B4, r18 ; 0x8003b4 _md->extrudemultiply = extrudemultiply; 1a9e8: 90 93 b6 03 sts 0x03B6, r25 ; 0x8003b6 1a9ec: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 1a9f0: 8f ef ldi r24, 0xFF ; 255 1a9f2: 9f e0 ldi r25, 0x0F ; 15 1a9f4: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1a9f8: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 MENU_BEGIN(); 1a9fc: 0f 94 08 cf call 0x39e10 ; 0x39e10 1aa00: 10 92 13 05 sts 0x0513, r1 ; 0x800513 1aa04: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1aa08: 84 30 cpi r24, 0x04 ; 4 1aa0a: 08 f0 brcs .+2 ; 0x1aa0e 1aa0c: 99 c0 rjmp .+306 ; 0x1ab40 1aa0e: 10 92 16 05 sts 0x0516, r1 ; 0x800516 ON_MENU_LEAVE( 1aa12: 0f 94 88 cd call 0x39b10 ; 0x39b10 1aa16: 81 11 cpse r24, r1 1aa18: 0e 94 90 65 call 0xcb20 ; 0xcb20 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1aa1c: 88 eb ldi r24, 0xB8 ; 184 1aa1e: 9d e3 ldi r25, 0x3D ; 61 1aa20: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aa24: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1aa28: 8f ee ldi r24, 0xEF ; 239 1aa2a: 9c e3 ldi r25, 0x3C ; 60 1aa2c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aa30: f1 2c mov r15, r1 1aa32: e1 2c mov r14, r1 1aa34: 07 ee ldi r16, 0xE7 ; 231 1aa36: 13 e0 ldi r17, 0x03 ; 3 1aa38: 2a e0 ldi r18, 0x0A ; 10 1aa3a: 30 e0 ldi r19, 0x00 ; 0 1aa3c: 40 e1 ldi r20, 0x10 ; 16 1aa3e: 69 e3 ldi r22, 0x39 ; 57 1aa40: 72 e0 ldi r23, 0x02 ; 2 1aa42: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 menuitems_temperature_common(); 1aa46: 0f 94 d3 32 call 0x265a6 ; 0x265a6 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1aa4a: 88 ee ldi r24, 0xE8 ; 232 1aa4c: 9c e3 ldi r25, 0x3C ; 60 1aa4e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aa52: 2a e0 ldi r18, 0x0A ; 10 1aa54: 30 e0 ldi r19, 0x00 ; 0 1aa56: 40 e1 ldi r20, 0x10 ; 16 1aa58: 64 e9 ldi r22, 0x94 ; 148 1aa5a: 72 e0 ldi r23, 0x02 ; 2 1aa5c: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 #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); 1aa60: 86 ed ldi r24, 0xD6 ; 214 1aa62: 9c e3 ldi r25, 0x3C ; 60 1aa64: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aa68: 6b ed ldi r22, 0xDB ; 219 1aa6a: 79 e3 ldi r23, 0x39 ; 57 1aa6c: 0f 94 85 ce call 0x39d0a ; 0x39d0a #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1aa70: 0e 94 32 68 call 0xd064 ; 0xd064 1aa74: 88 23 and r24, r24 1aa76: 41 f0 breq .+16 ; 0x1aa88 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1aa78: 83 e5 ldi r24, 0x53 ; 83 1aa7a: 99 e4 ldi r25, 0x49 ; 73 1aa7c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aa80: 6e e2 ldi r22, 0x2E ; 46 1aa82: 7b e8 ldi r23, 0x8B ; 139 1aa84: 0f 94 fe cd call 0x39bfc ; 0x39bfc } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1aa88: 88 ec ldi r24, 0xC8 ; 200 1aa8a: 9c e3 ldi r25, 0x3C ; 60 1aa8c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aa90: 69 ed ldi r22, 0xD9 ; 217 1aa92: 7a e3 ldi r23, 0x3A ; 58 1aa94: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1aa98: 80 91 96 13 lds r24, 0x1396 ; 0x801396 1aa9c: 81 30 cpi r24, 0x01 ; 1 1aa9e: 11 f4 brne .+4 ; 0x1aaa4 { menuitems_MMU_settings_common(); 1aaa0: 0f 94 70 33 call 0x266e0 ; 0x266e0 } SETTINGS_FANS_CHECK(); 1aaa4: 0f 94 b9 32 call 0x26572 ; 0x26572 SETTINGS_SILENT_MODE(); 1aaa8: 0f 94 0c 33 call 0x26618 ; 0x26618 SETTINGS_SOUND; 1aaac: 80 91 df 04 lds r24, 0x04DF ; 0x8004df 1aab0: 82 30 cpi r24, 0x02 ; 2 1aab2: 09 f4 brne .+2 ; 0x1aab6 1aab4: 3f c0 rjmp .+126 ; 0x1ab34 1aab6: 83 30 cpi r24, 0x03 ; 3 1aab8: 09 f4 brne .+2 ; 0x1aabc 1aaba: 3f c0 rjmp .+126 ; 0x1ab3a 1aabc: 81 30 cpi r24, 0x01 ; 1 1aabe: b9 f1 breq .+110 ; 0x1ab2e 1aac0: 81 ec ldi r24, 0xC1 ; 193 1aac2: 9c e3 ldi r25, 0x3C ; 60 1aac4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aac8: ec 01 movw r28, r24 1aaca: 89 eb ldi r24, 0xB9 ; 185 1aacc: 9c e3 ldi r25, 0x3C ; 60 1aace: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aad2: 22 e0 ldi r18, 0x02 ; 2 1aad4: 45 e6 ldi r20, 0x65 ; 101 1aad6: 59 e3 ldi r21, 0x39 ; 57 1aad8: be 01 movw r22, r28 1aada: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #ifdef LCD_BL_PIN if (backlightSupport) 1aade: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 1aae2: 88 23 and r24, r24 1aae4: 41 f0 breq .+16 ; 0x1aaf6 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1aae6: 83 e9 ldi r24, 0x93 ; 147 1aae8: 9c e3 ldi r25, 0x3C ; 60 1aaea: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aaee: 63 e9 ldi r22, 0x93 ; 147 1aaf0: 77 ed ldi r23, 0xD7 ; 215 1aaf2: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } #endif //LCD_BL_PIN MENU_END(); 1aaf6: 0f 94 dc ce call 0x39db8 ; 0x39db8 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1aafa: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1aafe: 8f 5f subi r24, 0xFF ; 255 1ab00: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1ab04: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1ab08: 8f 5f subi r24, 0xFF ; 255 1ab0a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1ab0e: 7a cf rjmp .-268 ; 0x1aa04 { // 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) 1ab10: 20 91 b5 03 lds r18, 0x03B5 ; 0x8003b5 1ab14: 30 91 b6 03 lds r19, 0x03B6 ; 0x8003b6 1ab18: 28 17 cp r18, r24 1ab1a: 39 07 cpc r19, r25 1ab1c: 09 f4 brne .+2 ; 0x1ab20 1ab1e: 68 cf rjmp .-304 ; 0x1a9f0 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1ab20: 90 93 b6 03 sts 0x03B6, r25 ; 0x8003b6 1ab24: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 calculate_extruder_multipliers(); 1ab28: 0e 94 66 66 call 0xcccc ; 0xcccc 1ab2c: 61 cf rjmp .-318 ; 0x1a9f0 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1ab2e: 82 eb ldi r24, 0xB2 ; 178 1ab30: 9c e3 ldi r25, 0x3C ; 60 1ab32: c8 cf rjmp .-112 ; 0x1aac4 1ab34: 89 ea ldi r24, 0xA9 ; 169 1ab36: 9c e3 ldi r25, 0x3C ; 60 1ab38: c5 cf rjmp .-118 ; 0x1aac4 1ab3a: 80 ea ldi r24, 0xA0 ; 160 1ab3c: 9c e3 ldi r25, 0x3C ; 60 1ab3e: c2 cf rjmp .-124 ; 0x1aac4 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1ab40: df 91 pop r29 1ab42: cf 91 pop r28 1ab44: 1f 91 pop r17 1ab46: 0f 91 pop r16 1ab48: ff 90 pop r15 1ab4a: ef 90 pop r14 1ab4c: 08 95 ret 0001ab4e : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1ab4e: bf 92 push r11 1ab50: cf 92 push r12 1ab52: df 92 push r13 1ab54: ef 92 push r14 1ab56: ff 92 push r15 1ab58: 0f 93 push r16 1ab5a: 1f 93 push r17 1ab5c: cf 93 push r28 1ab5e: df 93 push r29 1ab60: c8 2f mov r28, r24 1ab62: f6 2e mov r15, r22 1ab64: e4 2e mov r14, r20 1ab66: b2 2e mov r11, r18 1ab68: 68 01 movw r12, r16 lcd_update_enable(false); 1ab6a: 80 e0 ldi r24, 0x00 ; 0 1ab6c: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1ab70: dc e7 ldi r29, 0x7C ; 124 1ab72: fe 14 cp r15, r14 1ab74: 08 f0 brcs .+2 ; 0x1ab78 1ab76: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1ab78: bb 20 and r11, r11 1ab7a: 09 f1 breq .+66 ; 0x1abbe lcd_clear(); 1ab7c: 0e 94 c0 6f call 0xdf80 ; 0xdf80 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1ab80: c1 11 cpse r28, r1 1ab82: 20 c0 rjmp .+64 ; 0x1abc4 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1ab84: 8d eb ldi r24, 0xBD ; 189 1ab86: 93 e4 ldi r25, 0x43 ; 67 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)); 1ab88: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ab8c: 0e 94 78 6f call 0xdef0 ; 0xdef0 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1ab90: 88 ef ldi r24, 0xF8 ; 248 1ab92: 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 1ab94: 82 30 cpi r24, 0x02 ; 2 1ab96: 78 f5 brcc .+94 ; 0x1abf6 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1ab98: 8f e9 ldi r24, 0x9F ; 159 1ab9a: 9f e3 ldi r25, 0x3F ; 63 1ab9c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1aba0: 0e 94 78 6f call 0xdef0 ; 0xdef0 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)); 1aba4: 8e e7 ldi r24, 0x7E ; 126 1aba6: 9f e3 ldi r25, 0x3F ; 63 1aba8: cc 30 cpi r28, 0x0C ; 12 1abaa: 49 f1 breq .+82 ; 0x1abfe if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1abac: 88 ec ldi r24, 0xC8 ; 200 1abae: 93 e4 ldi r25, 0x43 ; 67 1abb0: cd 30 cpi r28, 0x0D ; 13 1abb2: 29 f1 breq .+74 ; 0x1abfe if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1abb4: ce 30 cpi r28, 0x0E ; 14 1abb6: 39 f5 brne .+78 ; 0x1ac06 1abb8: 8b e6 ldi r24, 0x6B ; 107 1abba: 9f e3 ldi r25, 0x3F ; 63 1abbc: 20 c0 rjmp .+64 ; 0x1abfe lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1abbe: 0e 94 b9 6f call 0xdf72 ; 0xdf72 1abc2: de cf rjmp .-68 ; 0x1ab80 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1abc4: c1 30 cpi r28, 0x01 ; 1 1abc6: f1 f2 breq .-68 ; 0x1ab84 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1abc8: c2 30 cpi r28, 0x02 ; 2 1abca: e1 f2 breq .-72 ; 0x1ab84 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1abcc: 86 ef ldi r24, 0xF6 ; 246 1abce: 9f e3 ldi r25, 0x3F ; 63 1abd0: c3 30 cpi r28, 0x03 ; 3 1abd2: d1 f2 breq .-76 ; 0x1ab88 if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1abd4: 84 ee ldi r24, 0xE4 ; 228 1abd6: 9f e3 ldi r25, 0x3F ; 63 1abd8: c4 30 cpi r28, 0x04 ; 4 1abda: b1 f2 breq .-84 ; 0x1ab88 if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1abdc: 82 ed ldi r24, 0xD2 ; 210 1abde: 9f e3 ldi r25, 0x3F ; 63 1abe0: c5 30 cpi r28, 0x05 ; 5 1abe2: 91 f2 breq .-92 ; 0x1ab88 if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1abe4: 80 ec ldi r24, 0xC0 ; 192 1abe6: 9f e3 ldi r25, 0x3F ; 63 1abe8: c6 30 cpi r28, 0x06 ; 6 1abea: 71 f2 breq .-100 ; 0x1ab88 if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1abec: c7 30 cpi r28, 0x07 ; 7 1abee: 81 f6 brne .-96 ; 0x1ab90 1abf0: 81 eb ldi r24, 0xB1 ; 177 1abf2: 9f e3 ldi r25, 0x3F ; 63 1abf4: c9 cf rjmp .-110 ; 0x1ab88 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)); 1abf6: ca 30 cpi r28, 0x0A ; 10 1abf8: 99 f5 brne .+102 ; 0x1ac60 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1abfa: 8c e8 ldi r24, 0x8C ; 140 1abfc: 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)); 1abfe: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ac02: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1ac06: 41 e1 ldi r20, 0x11 ; 17 1ac08: 5c e8 ldi r21, 0x8C ; 140 1ac0a: 61 e0 ldi r22, 0x01 ; 1 1ac0c: 80 e0 ldi r24, 0x00 ; 0 1ac0e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1ac12: c3 30 cpi r28, 0x03 ; 3 1ac14: 70 f5 brcc .+92 ; 0x1ac72 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1ac16: 8d e5 ldi r24, 0x5D ; 93 1ac18: 9f e3 ldi r25, 0x3F ; 63 1ac1a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ac1e: ac 01 movw r20, r24 1ac20: 62 e0 ldi r22, 0x02 ; 2 1ac22: 80 e0 ldi r24, 0x00 ; 0 1ac24: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(18, 2); 1ac28: 62 e0 ldi r22, 0x02 ; 2 1ac2a: 82 e1 ldi r24, 0x12 ; 18 1ac2c: 0e 94 8d 6f call 0xdf1a ; 0xdf1a (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1ac30: c1 11 cpse r28, r1 1ac32: 1a c0 rjmp .+52 ; 0x1ac68 1ac34: 8d 2f mov r24, r29 1ac36: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1ac3a: 80 e5 ldi r24, 0x50 ; 80 1ac3c: 9f e3 ldi r25, 0x3F ; 63 1ac3e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ac42: ac 01 movw r20, r24 1ac44: 63 e0 ldi r22, 0x03 ; 3 1ac46: 80 e0 ldi r24, 0x00 ; 0 1ac48: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(18, 3); 1ac4c: 63 e0 ldi r22, 0x03 ; 3 1ac4e: 82 e1 ldi r24, 0x12 ; 18 1ac50: 0e 94 8d 6f call 0xdf1a ; 0xdf1a (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1ac54: c2 30 cpi r28, 0x02 ; 2 1ac56: 19 f1 breq .+70 ; 0x1ac9e 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); 1ac58: 8d 2f mov r24, r29 1ac5a: 0e 94 7c 6f call 0xdef8 ; 0xdef8 1ac5e: 23 c0 rjmp .+70 ; 0x1aca6 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)); 1ac60: cb 30 cpi r28, 0x0B ; 11 1ac62: 09 f0 breq .+2 ; 0x1ac66 1ac64: 9f cf rjmp .-194 ; 0x1aba4 1ac66: c9 cf rjmp .-110 ; 0x1abfa 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); 1ac68: 83 eb ldi r24, 0xB3 ; 179 1ac6a: 9b e6 ldi r25, 0x6B ; 107 1ac6c: 0e 94 78 6f call 0xdef0 ; 0xdef0 1ac70: e4 cf rjmp .-56 ; 0x1ac3a 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) 1ac72: 86 ef ldi r24, 0xF6 ; 246 1ac74: 8c 0f add r24, r28 1ac76: 82 30 cpi r24, 0x02 ; 2 1ac78: 80 f5 brcc .+96 ; 0x1acda { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1ac7a: 81 e0 ldi r24, 0x01 ; 1 1ac7c: 94 e4 ldi r25, 0x44 ; 68 1ac7e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ac82: ac 01 movw r20, r24 1ac84: 62 e0 ldi r22, 0x02 ; 2 1ac86: 80 e0 ldi r24, 0x00 ; 0 1ac88: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_putc(':'); 1ac8c: 8a e3 ldi r24, 0x3A ; 58 1ac8e: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_set_cursor(18, 2); 1ac92: 62 e0 ldi r22, 0x02 ; 2 1ac94: 82 e1 ldi r24, 0x12 ; 18 1ac96: 0e 94 8d 6f call 0xdf1a ; 0xdf1a (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1ac9a: ca 30 cpi r28, 0x0A ; 10 1ac9c: e9 f2 breq .-70 ; 0x1ac58 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); 1ac9e: 83 eb ldi r24, 0xB3 ; 179 1aca0: 9b e6 ldi r25, 0x6B ; 107 1aca2: 0e 94 78 6f call 0xdef0 ; 0xdef0 _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); 1aca6: c1 14 cp r12, r1 1aca8: d1 04 cpc r13, r1 1acaa: 19 f0 breq .+6 ; 0x1acb2 1acac: c6 01 movw r24, r12 1acae: 0e 94 7f 8e call 0x11cfe ; 0x11cfe _progress++; 1acb2: 81 e0 ldi r24, 0x01 ; 1 1acb4: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1acb6: 4e 2d mov r20, r14 1acb8: 50 e0 ldi r21, 0x00 ; 0 1acba: 44 0f add r20, r20 1acbc: 55 1f adc r21, r21 1acbe: 84 17 cp r24, r20 1acc0: 15 06 cpc r1, r21 1acc2: 0c f0 brlt .+2 ; 0x1acc6 1acc4: 80 e0 ldi r24, 0x00 ; 0 } 1acc6: df 91 pop r29 1acc8: cf 91 pop r28 1acca: 1f 91 pop r17 1accc: 0f 91 pop r16 1acce: ff 90 pop r15 1acd0: ef 90 pop r14 1acd2: df 90 pop r13 1acd4: cf 90 pop r12 1acd6: bf 90 pop r11 1acd8: 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) 1acda: ca 30 cpi r28, 0x0A ; 10 1acdc: 20 f7 brcc .-56 ; 0x1aca6 { //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); 1acde: 41 e0 ldi r20, 0x01 ; 1 1ace0: c4 30 cpi r28, 0x04 ; 4 1ace2: 21 f0 breq .+8 ; 0x1acec 1ace4: 42 e0 ldi r20, 0x02 ; 2 1ace6: c3 30 cpi r28, 0x03 ; 3 1ace8: 09 f4 brne .+2 ; 0x1acec 1acea: 40 e0 ldi r20, 0x00 ; 0 1acec: 0d 2f mov r16, r29 1acee: 2f e0 ldi r18, 0x0F ; 15 1acf0: 3c e8 ldi r19, 0x8C ; 140 1acf2: 62 e0 ldi r22, 0x02 ; 2 1acf4: 82 e0 ldi r24, 0x02 ; 2 1acf6: 0e 94 75 d1 call 0x1a2ea ; 0x1a2ea _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1acfa: 41 e0 ldi r20, 0x01 ; 1 1acfc: c5 30 cpi r28, 0x05 ; 5 1acfe: 21 f0 breq .+8 ; 0x1ad08 1ad00: 42 e0 ldi r20, 0x02 ; 2 1ad02: c5 30 cpi r28, 0x05 ; 5 1ad04: 08 f4 brcc .+2 ; 0x1ad08 1ad06: 40 e0 ldi r20, 0x00 ; 0 1ad08: 0d 2f mov r16, r29 1ad0a: 2d e0 ldi r18, 0x0D ; 13 1ad0c: 3c e8 ldi r19, 0x8C ; 140 1ad0e: 68 e0 ldi r22, 0x08 ; 8 1ad10: 82 e0 ldi r24, 0x02 ; 2 1ad12: 0e 94 75 d1 call 0x1a2ea ; 0x1a2ea _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1ad16: 41 e0 ldi r20, 0x01 ; 1 1ad18: c6 30 cpi r28, 0x06 ; 6 1ad1a: 21 f0 breq .+8 ; 0x1ad24 1ad1c: 42 e0 ldi r20, 0x02 ; 2 1ad1e: c6 30 cpi r28, 0x06 ; 6 1ad20: 08 f4 brcc .+2 ; 0x1ad24 1ad22: 40 e0 ldi r20, 0x00 ; 0 1ad24: 0d 2f mov r16, r29 1ad26: 2b e0 ldi r18, 0x0B ; 11 1ad28: 3c e8 ldi r19, 0x8C ; 140 1ad2a: 6e e0 ldi r22, 0x0E ; 14 1ad2c: 82 e0 ldi r24, 0x02 ; 2 1ad2e: 0e 94 75 d1 call 0x1a2ea ; 0x1a2ea _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1ad32: 41 e0 ldi r20, 0x01 ; 1 1ad34: c7 30 cpi r28, 0x07 ; 7 1ad36: 21 f0 breq .+8 ; 0x1ad40 1ad38: 42 e0 ldi r20, 0x02 ; 2 1ad3a: c7 30 cpi r28, 0x07 ; 7 1ad3c: 08 f4 brcc .+2 ; 0x1ad40 1ad3e: 40 e0 ldi r20, 0x00 ; 0 1ad40: 0d 2f mov r16, r29 1ad42: 27 e0 ldi r18, 0x07 ; 7 1ad44: 3c e8 ldi r19, 0x8C ; 140 1ad46: 60 e0 ldi r22, 0x00 ; 0 1ad48: 83 e0 ldi r24, 0x03 ; 3 1ad4a: 0e 94 75 d1 call 0x1a2ea ; 0x1a2ea _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1ad4e: 41 e0 ldi r20, 0x01 ; 1 1ad50: c8 30 cpi r28, 0x08 ; 8 1ad52: 21 f0 breq .+8 ; 0x1ad5c 1ad54: 42 e0 ldi r20, 0x02 ; 2 1ad56: c8 30 cpi r28, 0x08 ; 8 1ad58: 08 f4 brcc .+2 ; 0x1ad5c 1ad5a: 40 e0 ldi r20, 0x00 ; 0 1ad5c: 0d 2f mov r16, r29 1ad5e: 20 e0 ldi r18, 0x00 ; 0 1ad60: 3c e8 ldi r19, 0x8C ; 140 1ad62: 69 e0 ldi r22, 0x09 ; 9 1ad64: 83 e0 ldi r24, 0x03 ; 3 1ad66: 0e 94 75 d1 call 0x1a2ea ; 0x1a2ea 1ad6a: 9d cf rjmp .-198 ; 0x1aca6 0001ad6c : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1ad6c: cf 93 push r28 1ad6e: 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) 1ad70: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1ad74: 81 11 cpse r24, r1 1ad76: 18 c0 rjmp .+48 ; 0x1ada8 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1ad78: 60 91 dc 03 lds r22, 0x03DC ; 0x8003dc 1ad7c: 8b e0 ldi r24, 0x0B ; 11 1ad7e: 68 9f mul r22, r24 1ad80: b0 01 movw r22, r0 1ad82: 11 24 eor r1, r1 1ad84: 67 5b subi r22, 0xB7 ; 183 1ad86: 72 4f sbci r23, 0xF2 ; 242 1ad88: 47 e0 ldi r20, 0x07 ; 7 1ad8a: 50 e0 ldi r21, 0x00 ; 0 1ad8c: 89 ea ldi r24, 0xA9 ; 169 1ad8e: 93 e0 ldi r25, 0x03 ; 3 1ad90: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 lcd_encoder = menuData->name[0]; 1ad94: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1ad98: 90 e0 ldi r25, 0x00 ; 0 1ad9a: 90 93 36 05 sts 0x0536, r25 ; 0x800536 1ad9e: 80 93 35 05 sts 0x0535, r24 ; 0x800535 menuData->initialized = true; 1ada2: 81 e0 ldi r24, 0x01 ; 1 1ada4: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1ada8: 80 91 35 05 lds r24, 0x0535 ; 0x800535 1adac: 90 91 36 05 lds r25, 0x0536 ; 0x800536 1adb0: 80 97 sbiw r24, 0x20 ; 32 1adb2: 34 f4 brge .+12 ; 0x1adc0 1adb4: 80 e2 ldi r24, 0x20 ; 32 1adb6: 90 e0 ldi r25, 0x00 ; 0 1adb8: 90 93 36 05 sts 0x0536, r25 ; 0x800536 1adbc: 80 93 35 05 sts 0x0535, r24 ; 0x800535 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1adc0: 80 91 35 05 lds r24, 0x0535 ; 0x800535 1adc4: 90 91 36 05 lds r25, 0x0536 ; 0x800536 1adc8: 8f 3f cpi r24, 0xFF ; 255 1adca: 91 05 cpc r25, r1 1adcc: 39 f0 breq .+14 ; 0x1addc 1adce: 34 f0 brlt .+12 ; 0x1addc 1add0: 8f ef ldi r24, 0xFF ; 255 1add2: 90 e0 ldi r25, 0x00 ; 0 1add4: 90 93 36 05 sts 0x0536, r25 ; 0x800536 1add8: 80 93 35 05 sts 0x0535, r24 ; 0x800535 menuData->name[menuData->selected] = lcd_encoder; 1addc: e0 91 a8 03 lds r30, 0x03A8 ; 0x8003a8 1ade0: f0 e0 ldi r31, 0x00 ; 0 1ade2: e9 55 subi r30, 0x59 ; 89 1ade4: fc 4f sbci r31, 0xFC ; 252 1ade6: 80 91 35 05 lds r24, 0x0535 ; 0x800535 1adea: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1adec: 0e 94 b9 6f call 0xdf72 ; 0xdf72 1adf0: c9 ea ldi r28, 0xA9 ; 169 1adf2: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1adf4: 89 91 ld r24, Y+ 1adf6: 0e 94 7c 6f call 0xdef8 ; 0xdef8 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) 1adfa: 83 e0 ldi r24, 0x03 ; 3 1adfc: c0 3b cpi r28, 0xB0 ; 176 1adfe: d8 07 cpc r29, r24 1ae00: c9 f7 brne .-14 ; 0x1adf4 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1ae02: 4e e5 ldi r20, 0x5E ; 94 1ae04: 61 e0 ldi r22, 0x01 ; 1 1ae06: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1ae0a: 0e 94 ad 6f call 0xdf5a ; 0xdf5a if (menuData->selected > 0) 1ae0e: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 1ae12: 88 23 and r24, r24 1ae14: 29 f0 breq .+10 ; 0x1ae20 { lcd_putc_at(menuData->selected-1, 1, ' '); 1ae16: 40 e2 ldi r20, 0x20 ; 32 1ae18: 61 e0 ldi r22, 0x01 ; 1 1ae1a: 81 50 subi r24, 0x01 ; 1 1ae1c: 0e 94 ad 6f call 0xdf5a ; 0xdf5a } if (lcd_clicked()) 1ae20: 0e 94 aa 71 call 0xe354 ; 0xe354 1ae24: 88 23 and r24, r24 1ae26: 99 f0 breq .+38 ; 0x1ae4e { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1ae28: e0 91 a8 03 lds r30, 0x03A8 ; 0x8003a8 1ae2c: 8e 2f mov r24, r30 1ae2e: 90 e0 ldi r25, 0x00 ; 0 1ae30: 01 96 adiw r24, 0x01 ; 1 1ae32: 07 97 sbiw r24, 0x07 ; 7 1ae34: 78 f4 brcc .+30 ; 0x1ae54 { lcd_encoder = menuData->name[++(menuData->selected)]; 1ae36: ef 5f subi r30, 0xFF ; 255 1ae38: e0 93 a8 03 sts 0x03A8, r30 ; 0x8003a8 1ae3c: f0 e0 ldi r31, 0x00 ; 0 1ae3e: e9 55 subi r30, 0x59 ; 89 1ae40: fc 4f sbci r31, 0xFC ; 252 1ae42: 82 81 ldd r24, Z+2 ; 0x02 1ae44: 90 e0 ldi r25, 0x00 ; 0 1ae46: 90 93 36 05 sts 0x0536, r25 ; 0x800536 1ae4a: 80 93 35 05 sts 0x0535, r24 ; 0x800535 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1ae4e: df 91 pop r29 1ae50: cf 91 pop r28 1ae52: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1ae54: 60 91 dc 03 lds r22, 0x03DC ; 0x8003dc 1ae58: 8b e0 ldi r24, 0x0B ; 11 1ae5a: 68 9f mul r22, r24 1ae5c: b0 01 movw r22, r0 1ae5e: 11 24 eor r1, r1 1ae60: 67 5b subi r22, 0xB7 ; 183 1ae62: 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); 1ae64: 47 e0 ldi r20, 0x07 ; 7 1ae66: 50 e0 ldi r21, 0x00 ; 0 1ae68: 89 ea ldi r24, 0xA9 ; 169 1ae6a: 93 e0 ldi r25, 0x03 ; 3 1ae6c: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1ae70: df 91 pop r29 1ae72: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1ae74: 0d 94 d0 d1 jmp 0x3a3a0 ; 0x3a3a0 0001ae78 : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1ae78: cf 93 push r28 1ae7a: df 93 push r29 current_position[axis] += 10; 1ae7c: 94 e0 ldi r25, 0x04 ; 4 1ae7e: 89 9f mul r24, r25 1ae80: e0 01 movw r28, r0 1ae82: 11 24 eor r1, r1 1ae84: cf 5b subi r28, 0xBF ; 191 1ae86: d8 4f sbci r29, 0xF8 ; 248 1ae88: 20 e0 ldi r18, 0x00 ; 0 1ae8a: 30 e0 ldi r19, 0x00 ; 0 1ae8c: 40 e2 ldi r20, 0x20 ; 32 1ae8e: 51 e4 ldi r21, 0x41 ; 65 1ae90: 68 81 ld r22, Y 1ae92: 79 81 ldd r23, Y+1 ; 0x01 1ae94: 8a 81 ldd r24, Y+2 ; 0x02 1ae96: 9b 81 ldd r25, Y+3 ; 0x03 1ae98: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1ae9c: 68 83 st Y, r22 1ae9e: 79 83 std Y+1, r23 ; 0x01 1aea0: 8a 83 std Y+2, r24 ; 0x02 1aea2: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1aea4: 60 e0 ldi r22, 0x00 ; 0 1aea6: 70 e0 ldi r23, 0x00 ; 0 1aea8: 84 e3 ldi r24, 0x34 ; 52 1aeaa: 92 e4 ldi r25, 0x42 ; 66 1aeac: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 1aeb0: 0f 94 24 59 call 0x2b248 ; 0x2b248 crashdet_use_eeprom_setting(); } 1aeb4: df 91 pop r29 1aeb6: 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(); 1aeb8: 0d 94 08 3c jmp 0x27810 ; 0x27810 0001aebc : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1aebc: 0f 94 40 7d call 0x2fa80 ; 0x2fa80 #endif menu_top = 0; 1aec0: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 lcd_encoder = 0; 1aec4: 10 92 36 05 sts 0x0536, r1 ; 0x800536 1aec8: 10 92 35 05 sts 0x0535, r1 ; 0x800535 menu_data_reset(); //Forces reloading of cached variables. 1aecc: 0d 94 2a cf jmp 0x39e54 ; 0x39e54 0001aed0 : } } void CardReader::updir() { if(workDirDepth > 0) 1aed0: 80 91 0c 16 lds r24, 0x160C ; 0x80160c 1aed4: 88 23 and r24, r24 1aed6: f9 f0 breq .+62 ; 0x1af16 { --workDirDepth; 1aed8: 81 50 subi r24, 0x01 ; 1 1aeda: 80 93 0c 16 sts 0x160C, r24 ; 0x80160c workDir = workDirParents[0]; 1aede: 93 e2 ldi r25, 0x23 ; 35 1aee0: ea e3 ldi r30, 0x3A ; 58 1aee2: f5 e1 ldi r31, 0x15 ; 21 1aee4: a7 e1 ldi r26, 0x17 ; 23 1aee6: b5 e1 ldi r27, 0x15 ; 21 1aee8: 01 90 ld r0, Z+ 1aeea: 0d 92 st X+, r0 1aeec: 9a 95 dec r25 1aeee: e1 f7 brne .-8 ; 0x1aee8 1aef0: 2a e3 ldi r18, 0x3A ; 58 1aef2: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1aef4: 90 e0 ldi r25, 0x00 ; 0 1aef6: 98 17 cp r25, r24 1aef8: 60 f4 brcc .+24 ; 0x1af12 { workDirParents[d] = workDirParents[d+1]; 1aefa: 43 e2 ldi r20, 0x23 ; 35 1aefc: f9 01 movw r30, r18 1aefe: b3 96 adiw r30, 0x23 ; 35 1af00: d9 01 movw r26, r18 1af02: 01 90 ld r0, Z+ 1af04: 0d 92 st X+, r0 1af06: 4a 95 dec r20 1af08: e1 f7 brne .-8 ; 0x1af02 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1af0a: 9f 5f subi r25, 0xFF ; 255 1af0c: 2d 5d subi r18, 0xDD ; 221 1af0e: 3f 4f sbci r19, 0xFF ; 255 1af10: f2 cf rjmp .-28 ; 0x1aef6 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1af12: 0f 94 40 7d call 0x2fa80 ; 0x2fa80 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1af16: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 lcd_encoder = 0; 1af1a: 10 92 36 05 sts 0x0536, r1 ; 0x800536 1af1e: 10 92 35 05 sts 0x0535, r1 ; 0x800535 menu_data_reset(); //Forces reloading of cached variables. 1af22: 0d 94 2a cf jmp 0x39e54 ; 0x39e54 0001af26 : } backlight_save(); } static void lcd_backlight_menu() { 1af26: ef 92 push r14 1af28: ff 92 push r15 1af2a: 0f 93 push r16 1af2c: 1f 93 push r17 1af2e: cf 93 push r28 1af30: df 93 push r29 MENU_BEGIN(); 1af32: 0f 94 08 cf call 0x39e10 ; 0x39e10 1af36: 10 92 13 05 sts 0x0513, r1 ; 0x800513 1af3a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1af3e: 84 30 cpi r24, 0x04 ; 4 1af40: 08 f0 brcs .+2 ; 0x1af44 1af42: 63 c0 rjmp .+198 ; 0x1b00a 1af44: 10 92 16 05 sts 0x0516, r1 ; 0x800516 ON_MENU_LEAVE( 1af48: 0f 94 88 cd call 0x39b10 ; 0x39b10 1af4c: 81 11 cpse r24, r1 1af4e: 0e 94 5a 8b call 0x116b4 ; 0x116b4 backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1af52: 89 e1 ldi r24, 0x19 ; 25 1af54: 90 e4 ldi r25, 0x40 ; 64 1af56: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1af5a: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1af5e: c0 91 fa 03 lds r28, 0x03FA ; 0x8003fa 1af62: d0 e0 ldi r29, 0x00 ; 0 1af64: 88 e5 ldi r24, 0x58 ; 88 1af66: 9d e3 ldi r25, 0x3D ; 61 1af68: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1af6c: f1 2c mov r15, r1 1af6e: e1 2c mov r14, r1 1af70: 0f ef ldi r16, 0xFF ; 255 1af72: 10 e0 ldi r17, 0x00 ; 0 1af74: 9e 01 movw r18, r28 1af76: 48 e0 ldi r20, 0x08 ; 8 1af78: 6b ef ldi r22, 0xFB ; 251 1af7a: 73 e0 ldi r23, 0x03 ; 3 1af7c: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1af80: 00 91 fb 03 lds r16, 0x03FB ; 0x8003fb 1af84: 10 e0 ldi r17, 0x00 ; 0 1af86: 89 e4 ldi r24, 0x49 ; 73 1af88: 9d e3 ldi r25, 0x3D ; 61 1af8a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1af8e: 30 e0 ldi r19, 0x00 ; 0 1af90: 20 e0 ldi r18, 0x00 ; 0 1af92: 48 e0 ldi r20, 0x08 ; 8 1af94: 6a ef ldi r22, 0xFA ; 250 1af96: 73 e0 ldi r23, 0x03 ; 3 1af98: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 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); 1af9c: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1afa0: 81 30 cpi r24, 0x01 ; 1 1afa2: 59 f5 brne .+86 ; 0x1affa 1afa4: 80 e4 ldi r24, 0x40 ; 64 1afa6: 9d e3 ldi r25, 0x3D ; 61 1afa8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1afac: ec 01 movw r28, r24 1afae: 8c e2 ldi r24, 0x2C ; 44 1afb0: 9d e3 ldi r25, 0x3D ; 61 1afb2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1afb6: 22 e0 ldi r18, 0x02 ; 2 1afb8: 4c e0 ldi r20, 0x0C ; 12 1afba: 58 ed ldi r21, 0xD8 ; 216 1afbc: be 01 movw r22, r28 1afbe: 0f 94 97 d0 call 0x3a12e ; 0x3a12e MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); 1afc2: 82 e2 ldi r24, 0x22 ; 34 1afc4: 9d e3 ldi r25, 0x3D ; 61 1afc6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1afca: f1 2c mov r15, r1 1afcc: e1 2c mov r14, r1 1afce: 04 e8 ldi r16, 0x84 ; 132 1afd0: 13 e0 ldi r17, 0x03 ; 3 1afd2: 2f e0 ldi r18, 0x0F ; 15 1afd4: 30 e0 ldi r19, 0x00 ; 0 1afd6: 40 e1 ldi r20, 0x10 ; 16 1afd8: 6d e4 ldi r22, 0x4D ; 77 1afda: 72 e0 ldi r23, 0x02 ; 2 1afdc: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 MENU_END(); 1afe0: 0f 94 dc ce call 0x39db8 ; 0x39db8 backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1afe4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1afe8: 8f 5f subi r24, 0xFF ; 255 1afea: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1afee: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1aff2: 8f 5f subi r24, 0xFF ; 255 1aff4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1aff8: a0 cf rjmp .-192 ; 0x1af3a ); 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); 1affa: 81 11 cpse r24, r1 1affc: 03 c0 rjmp .+6 ; 0x1b004 1affe: 8a e3 ldi r24, 0x3A ; 58 1b000: 9d e3 ldi r25, 0x3D ; 61 1b002: d2 cf rjmp .-92 ; 0x1afa8 1b004: 83 e3 ldi r24, 0x33 ; 51 1b006: 9d e3 ldi r25, 0x3D ; 61 1b008: cf cf rjmp .-98 ; 0x1afa8 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); MENU_END(); } 1b00a: df 91 pop r29 1b00c: cf 91 pop r28 1b00e: 1f 91 pop r17 1b010: 0f 91 pop r16 1b012: ff 90 pop r15 1b014: ef 90 pop r14 1b016: 08 95 ret 0001b018 : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1b018: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1b01c: 88 23 and r24, r24 1b01e: 31 f0 breq .+12 ; 0x1b02c 1b020: 81 30 cpi r24, 0x01 ; 1 1b022: 41 f4 brne .+16 ; 0x1b034 { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1b024: 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(); 1b028: 0c 94 5a 8b jmp 0x116b4 ; 0x116b4 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; 1b02c: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1b02e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1b032: fa cf rjmp .-12 ; 0x1b028 1b034: 81 e0 ldi r24, 0x01 ; 1 1b036: fb cf rjmp .-10 ; 0x1b02e 0001b038 : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 1b038: bf 92 push r11 1b03a: cf 92 push r12 1b03c: df 92 push r13 1b03e: ef 92 push r14 1b040: ff 92 push r15 1b042: 0f 93 push r16 1b044: 1f 93 push r17 1b046: cf 93 push r28 1b048: df 93 push r29 1b04a: 00 d0 rcall .+0 ; 0x1b04c 1b04c: 1f 92 push r1 1b04e: cd b7 in r28, 0x3d ; 61 1b050: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1b052: 8c ea ldi r24, 0xAC ; 172 1b054: 9d e0 ldi r25, 0x0D ; 13 1b056: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1b05a: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1b05c: 8b ea ldi r24, 0xAB ; 171 1b05e: 9d e0 ldi r25, 0x0D ; 13 1b060: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1b064: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1b066: 8a ea ldi r24, 0xAA ; 170 1b068: 9d e0 ldi r25, 0x0D ; 13 1b06a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1b06e: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1b070: 0f 94 08 cf call 0x39e10 ; 0x39e10 1b074: 10 92 13 05 sts 0x0513, r1 ; 0x800513 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 1b078: 80 e3 ldi r24, 0x30 ; 48 1b07a: d8 2e mov r13, r24 1b07c: df 0c add r13, r15 sToggle[1] = 'x'; 1b07e: 98 e7 ldi r25, 0x78 ; 120 1b080: 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'; 1b082: 20 e3 ldi r18, 0x30 ; 48 1b084: e2 2e mov r14, r18 1b086: 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(); 1b088: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b08c: 84 30 cpi r24, 0x04 ; 4 1b08e: 08 f0 brcs .+2 ; 0x1b092 1b090: 56 c0 rjmp .+172 ; 0x1b13e 1b092: 10 92 16 05 sts 0x0516, r1 ; 0x800516 ON_MENU_LEAVE( 1b096: 0f 94 88 cd call 0x39b10 ; 0x39b10 1b09a: 88 23 and r24, r24 1b09c: 31 f0 breq .+12 ; 0x1b0aa 1b09e: 87 e0 ldi r24, 0x07 ; 7 1b0a0: f8 12 cpse r15, r24 1b0a2: 03 c0 rjmp .+6 ; 0x1b0aa 1b0a4: 81 e0 ldi r24, 0x01 ; 1 1b0a6: 0f 94 d1 67 call 0x2cfa2 ; 0x2cfa2 // 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)); 1b0aa: 87 e6 ldi r24, 0x67 ; 103 1b0ac: 9d e3 ldi r25, 0x3D ; 61 1b0ae: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b0b2: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 sToggle[0] = points_nr + '0'; 1b0b6: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1b0b8: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1b0ba: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1b0bc: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1b0be: 8b e1 ldi r24, 0x1B ; 27 1b0c0: 9d e3 ldi r25, 0x3D ; 61 1b0c2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b0c6: 20 e0 ldi r18, 0x00 ; 0 1b0c8: 47 e8 ldi r20, 0x87 ; 135 1b0ca: 52 ed ldi r21, 0xD2 ; 210 1b0cc: be 01 movw r22, r28 1b0ce: 6f 5f subi r22, 0xFF ; 255 1b0d0: 7f 4f sbci r23, 0xFF ; 255 1b0d2: 0f 94 97 d0 call 0x3a12e ; 0x3a12e sToggle[0] = mbl_z_probe_nr + '0'; 1b0d6: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1b0d8: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1b0da: 8d e0 ldi r24, 0x0D ; 13 1b0dc: 9d e3 ldi r25, 0x3D ; 61 1b0de: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b0e2: 20 e0 ldi r18, 0x00 ; 0 1b0e4: 48 e7 ldi r20, 0x78 ; 120 1b0e6: 52 ed ldi r21, 0xD2 ; 210 1b0e8: be 01 movw r22, r28 1b0ea: 6f 5f subi r22, 0xFF ; 255 1b0ec: 7f 4f sbci r23, 0xFF ; 255 1b0ee: 0f 94 97 d0 call 0x3a12e ; 0x3a12e 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); 1b0f2: 87 e0 ldi r24, 0x07 ; 7 1b0f4: f8 12 cpse r15, r24 1b0f6: 20 c0 rjmp .+64 ; 0x1b138 1b0f8: 88 e4 ldi r24, 0x48 ; 72 1b0fa: 9d e5 ldi r25, 0x5D ; 93 1b0fc: c1 10 cpse r12, r1 1b0fe: 02 c0 rjmp .+4 ; 0x1b104 1b100: 82 e4 ldi r24, 0x42 ; 66 1b102: 9d e5 ldi r25, 0x5D ; 93 1b104: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b108: 8c 01 movw r16, r24 1b10a: 87 ef ldi r24, 0xF7 ; 247 1b10c: 9c e3 ldi r25, 0x3C ; 60 1b10e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b112: 22 e0 ldi r18, 0x02 ; 2 1b114: 43 e9 ldi r20, 0x93 ; 147 1b116: 52 ed ldi r21, 0xD2 ; 210 1b118: b8 01 movw r22, r16 1b11a: 0f 94 97 d0 call 0x3a12e ; 0x3a12e MENU_END(); 1b11e: 0f 94 dc ce call 0x39db8 ; 0x39db8 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(); 1b122: 90 91 13 05 lds r25, 0x0513 ; 0x800513 1b126: 9f 5f subi r25, 0xFF ; 255 1b128: 90 93 13 05 sts 0x0513, r25 ; 0x800513 1b12c: 90 91 15 05 lds r25, 0x0515 ; 0x800515 1b130: 9f 5f subi r25, 0xFF ; 255 1b132: 90 93 15 05 sts 0x0515, r25 ; 0x800515 1b136: a8 cf rjmp .-176 ; 0x1b088 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); 1b138: 87 e0 ldi r24, 0x07 ; 7 1b13a: 9d e3 ldi r25, 0x3D ; 61 1b13c: e3 cf rjmp .-58 ; 0x1b104 MENU_END(); } 1b13e: 0f 90 pop r0 1b140: 0f 90 pop r0 1b142: 0f 90 pop r0 1b144: 0f 90 pop r0 1b146: df 91 pop r29 1b148: cf 91 pop r28 1b14a: 1f 91 pop r17 1b14c: 0f 91 pop r16 1b14e: ff 90 pop r15 1b150: ef 90 pop r14 1b152: df 90 pop r13 1b154: cf 90 pop r12 1b156: bf 90 pop r11 1b158: 08 95 ret 0001b15a : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1b15a: cf 93 push r28 MENU_BEGIN(); 1b15c: 0f 94 08 cf call 0x39e10 ; 0x39e10 1b160: 10 92 13 05 sts 0x0513, r1 ; 0x800513 1b164: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b168: 84 30 cpi r24, 0x04 ; 4 1b16a: 60 f5 brcc .+88 ; 0x1b1c4 1b16c: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b170: 88 eb ldi r24, 0xB8 ; 184 1b172: 9d e3 ldi r25, 0x3D ; 61 1b174: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b178: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1b17c: 8e ed ldi r24, 0xDE ; 222 1b17e: 9a e3 ldi r25, 0x3A ; 58 1b180: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b184: 61 ea ldi r22, 0xA1 ; 161 1b186: 79 ed ldi r23, 0xD9 ; 217 1b188: 0f 94 85 ce call 0x39d0a ; 0x39d0a for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b18c: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1b18e: 83 ea ldi r24, 0xA3 ; 163 1b190: 9b e3 ldi r25, 0x3B ; 59 1b192: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b196: 61 e3 ldi r22, 0x31 ; 49 1b198: 6c 0f add r22, r28 1b19a: 2c 2f mov r18, r28 1b19c: 40 eb ldi r20, 0xB0 ; 176 1b19e: 59 ed ldi r21, 0xD9 ; 217 1b1a0: 0f 94 2e ce call 0x39c5c ; 0x39c5c 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++) 1b1a4: cf 5f subi r28, 0xFF ; 255 1b1a6: c5 30 cpi r28, 0x05 ; 5 1b1a8: 91 f7 brne .-28 ; 0x1b18e MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1b1aa: 0f 94 dc ce call 0x39db8 ; 0x39db8 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1b1ae: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b1b2: 8f 5f subi r24, 0xFF ; 255 1b1b4: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1b1b8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b1bc: 8f 5f subi r24, 0xFF ; 255 1b1be: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b1c2: d0 cf rjmp .-96 ; 0x1b164 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(); } 1b1c4: cf 91 pop r28 1b1c6: 08 95 ret 0001b1c8 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1b1c8: 84 e0 ldi r24, 0x04 ; 4 1b1ca: 0d 94 0e 6a jmp 0x2d41c ; 0x2d41c 0001b1ce : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1b1ce: 85 e0 ldi r24, 0x05 ; 5 1b1d0: 0d 94 0e 6a jmp 0x2d41c ; 0x2d41c 0001b1d4 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1b1d4: 86 e0 ldi r24, 0x06 ; 6 1b1d6: 0d 94 0e 6a jmp 0x2d41c ; 0x2d41c 0001b1da : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1b1da: 87 e0 ldi r24, 0x07 ; 7 1b1dc: 0d 94 0e 6a jmp 0x2d41c ; 0x2d41c 0001b1e0 : 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); 1b1e0: 88 e0 ldi r24, 0x08 ; 8 1b1e2: 0d 94 0e 6a jmp 0x2d41c ; 0x2d41c 0001b1e6 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1b1e6: 60 91 dc 03 lds r22, 0x03DC ; 0x8003dc 1b1ea: 81 ea ldi r24, 0xA1 ; 161 1b1ec: 9d e0 ldi r25, 0x0D ; 13 1b1ee: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1b1f2: 83 e0 ldi r24, 0x03 ; 3 1b1f4: 0d 94 b4 d1 jmp 0x3a368 ; 0x3a368 0001b1f8 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1b1f8: cf 93 push r28 MENU_BEGIN(); 1b1fa: 0f 94 08 cf call 0x39e10 ; 0x39e10 1b1fe: 10 92 13 05 sts 0x0513, r1 ; 0x800513 1b202: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b206: 84 30 cpi r24, 0x04 ; 4 1b208: 88 f5 brcc .+98 ; 0x1b26c 1b20a: 10 92 16 05 sts 0x0516, r1 ; 0x800516 ON_MENU_LEAVE( 1b20e: 0f 94 88 cd call 0x39b10 ; 0x39b10 1b212: 81 11 cpse r24, r1 1b214: 0f 94 ec 36 call 0x26dd8 ; 0x26dd8 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b218: 88 eb ldi r24, 0xB8 ; 184 1b21a: 9d e3 ldi r25, 0x3D ; 61 1b21c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b220: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1b224: 8e ed ldi r24, 0xDE ; 222 1b226: 9a e3 ldi r25, 0x3A ; 58 1b228: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b22c: 6f eb ldi r22, 0xBF ; 191 1b22e: 7a e3 ldi r23, 0x3A ; 58 1b230: 0f 94 85 ce call 0x39d0a ; 0x39d0a for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b234: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1b236: 83 ea ldi r24, 0xA3 ; 163 1b238: 9b e3 ldi r25, 0x3B ; 59 1b23a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b23e: 61 e3 ldi r22, 0x31 ; 49 1b240: 6c 0f add r22, r28 1b242: 2c 2f mov r18, r28 1b244: 49 e1 ldi r20, 0x19 ; 25 1b246: 5b e3 ldi r21, 0x3B ; 59 1b248: 0f 94 2e ce call 0x39c5c ; 0x39c5c 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++) 1b24c: cf 5f subi r28, 0xFF ; 255 1b24e: c5 30 cpi r28, 0x05 ; 5 1b250: 91 f7 brne .-28 ; 0x1b236 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1b252: 0f 94 dc ce call 0x39db8 ; 0x39db8 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1b256: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b25a: 8f 5f subi r24, 0xFF ; 255 1b25c: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1b260: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b264: 8f 5f subi r24, 0xFF ; 255 1b266: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b26a: cb cf rjmp .-106 ; 0x1b202 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(); } 1b26c: cf 91 pop r28 1b26e: 08 95 ret 0001b270 : } // 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)) { 1b270: ef 92 push r14 1b272: ff 92 push r15 1b274: 0f 93 push r16 1b276: 1f 93 push r17 1b278: cf 93 push r28 1b27a: 8c 01 movw r16, r24 1b27c: 7b 01 movw r14, r22 MENU_BEGIN(); 1b27e: 0f 94 08 cf call 0x39e10 ; 0x39e10 1b282: 10 92 13 05 sts 0x0513, r1 ; 0x800513 1b286: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b28a: 84 30 cpi r24, 0x04 ; 4 1b28c: 28 f5 brcc .+74 ; 0x1b2d8 1b28e: 10 92 16 05 sts 0x0516, r1 ; 0x800516 ON_MENU_LEAVE( 1b292: 0f 94 88 cd call 0x39b10 ; 0x39b10 1b296: 81 11 cpse r24, r1 1b298: 0f 94 ec 36 call 0x26dd8 ; 0x26dd8 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b29c: 88 eb ldi r24, 0xB8 ; 184 1b29e: 9d e3 ldi r25, 0x3D ; 61 1b2a0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b2a4: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b2a8: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1b2aa: 61 e3 ldi r22, 0x31 ; 49 1b2ac: 6c 0f add r22, r28 1b2ae: 2c 2f mov r18, r28 1b2b0: a7 01 movw r20, r14 1b2b2: c8 01 movw r24, r16 1b2b4: 0f 94 2e ce call 0x39c5c ; 0x39c5c MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b2b8: cf 5f subi r28, 0xFF ; 255 1b2ba: c5 30 cpi r28, 0x05 ; 5 1b2bc: b1 f7 brne .-20 ; 0x1b2aa MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1b2be: 0f 94 dc ce call 0x39db8 ; 0x39db8 // 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(); 1b2c2: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1b2c6: 8f 5f subi r24, 0xFF ; 255 1b2c8: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1b2cc: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b2d0: 8f 5f subi r24, 0xFF ; 255 1b2d2: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b2d6: d7 cf rjmp .-82 ; 0x1b286 ); 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(); } 1b2d8: cf 91 pop r28 1b2da: 1f 91 pop r17 1b2dc: 0f 91 pop r16 1b2de: ff 90 pop r15 1b2e0: ef 90 pop r14 1b2e2: 08 95 ret 0001b2e4 : 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); 1b2e4: 86 e5 ldi r24, 0x56 ; 86 1b2e6: 9c e5 ldi r25, 0x5C ; 92 1b2e8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b2ec: 6a e8 ldi r22, 0x8A ; 138 1b2ee: 79 ed ldi r23, 0xD9 ; 217 1b2f0: 0c 94 38 d9 jmp 0x1b270 ; 0x1b270 0001b2f4 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1b2f4: 85 e6 ldi r24, 0x65 ; 101 1b2f6: 9c e5 ldi r25, 0x5C ; 92 1b2f8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b2fc: 66 e9 ldi r22, 0x96 ; 150 1b2fe: 79 ed ldi r23, 0xD9 ; 217 1b300: 0c 94 38 d9 jmp 0x1b270 ; 0x1b270 0001b304 : 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); 1b304: 83 ea ldi r24, 0xA3 ; 163 1b306: 9b e3 ldi r25, 0x3B ; 59 1b308: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1b30c: 6f e4 ldi r22, 0x4F ; 79 1b30e: 7b e3 ldi r23, 0x3B ; 59 1b310: 0c 94 38 d9 jmp 0x1b270 ; 0x1b270 0001b314 : 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){ 1b314: cf 93 push r28 1b316: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1b318: 0f 94 4e 88 call 0x3109c ; 0x3109c 1b31c: 88 23 and r24, r24 1b31e: 21 f0 breq .+8 ; 0x1b328 1b320: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1b322: cf 91 pop r28 1b324: 0d 94 3d a1 jmp 0x3427a ; 0x3427a 1b328: cf 91 pop r28 1b32a: 08 95 ret 0001b32c : 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) { 1b32c: cf 93 push r28 1b32e: c8 2f mov r28, r24 menu_back(); 1b330: 0f 94 d0 d1 call 0x3a3a0 ; 0x3a3a0 MMU2::mmu2.eject_filament(filament, true); 1b334: 61 e0 ldi r22, 0x01 ; 1 1b336: 8c 2f mov r24, r28 1b338: 0f 94 c0 a0 call 0x34180 ; 0x34180 // Clear the filament action clearFilamentAction(); } 1b33c: 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(); 1b33e: 0d 94 ec 36 jmp 0x26dd8 ; 0x26dd8 0001b342 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.load_filament(i); 1b342: 80 e0 ldi r24, 0x00 ; 0 1b344: 0f 94 7d a0 call 0x340fa ; 0x340fa 1b348: 81 e0 ldi r24, 0x01 ; 1 1b34a: 0f 94 7d a0 call 0x340fa ; 0x340fa 1b34e: 82 e0 ldi r24, 0x02 ; 2 1b350: 0f 94 7d a0 call 0x340fa ; 0x340fa 1b354: 83 e0 ldi r24, 0x03 ; 3 1b356: 0f 94 7d a0 call 0x340fa ; 0x340fa 1b35a: 84 e0 ldi r24, 0x04 ; 4 1b35c: 0d 94 7d a0 jmp 0x340fa ; 0x340fa 0001b360 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1b360: 0d 94 7d a0 jmp 0x340fa ; 0x340fa 0001b364 : //! //! @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) 1b364: 4f 92 push r4 1b366: 5f 92 push r5 1b368: 6f 92 push r6 1b36a: 7f 92 push r7 1b36c: 8f 92 push r8 1b36e: 9f 92 push r9 1b370: af 92 push r10 1b372: bf 92 push r11 1b374: cf 92 push r12 1b376: df 92 push r13 1b378: ef 92 push r14 1b37a: ff 92 push r15 1b37c: 0f 93 push r16 1b37e: 1f 93 push r17 1b380: cf 93 push r28 1b382: df 93 push r29 1b384: 6c 01 movw r12, r24 1b386: 7b 01 movw r14, r22 1b388: 80 91 96 13 lds r24, 0x1396 ; 0x801396 { //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); 1b38c: 67 2b or r22, r23 1b38e: 29 f0 breq .+10 ; 0x1b39a 1b390: 06 e0 ldi r16, 0x06 ; 6 1b392: 81 30 cpi r24, 0x01 ; 1 1b394: 29 f0 breq .+10 ; 0x1b3a0 1b396: 05 e0 ldi r16, 0x05 ; 5 1b398: 03 c0 rjmp .+6 ; 0x1b3a0 1b39a: 04 e0 ldi r16, 0x04 ; 4 1b39c: 81 30 cpi r24, 0x01 ; 1 1b39e: d9 f3 breq .-10 ; 0x1b396 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1b3a0: 0e 94 c0 6f call 0xdf80 ; 0xdf80 KEEPALIVE_STATE(PAUSED_FOR_USER); 1b3a4: 84 e0 ldi r24, 0x04 ; 4 1b3a6: 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; 1b3aa: 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; 1b3ac: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1b3ae: 03 50 subi r16, 0x03 ; 3 1b3b0: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1b3b2: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 1b3b6: 81 e0 ldi r24, 0x01 ; 1 1b3b8: 0e 94 da 8b call 0x117b4 ; 0x117b4 if (lcd_encoder) 1b3bc: 80 91 35 05 lds r24, 0x0535 ; 0x800535 1b3c0: 90 91 36 05 lds r25, 0x0536 ; 0x800536 1b3c4: 00 97 sbiw r24, 0x00 ; 0 1b3c6: 09 f4 brne .+2 ; 0x1b3ca 1b3c8: 9d c0 rjmp .+314 ; 0x1b504 { if (lcd_encoder < 0) 1b3ca: 97 ff sbrs r25, 7 1b3cc: 88 c0 rjmp .+272 ; 0x1b4de { cursor_pos--; 1b3ce: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1b3d0: 10 92 36 05 sts 0x0536, r1 ; 0x800536 1b3d4: 10 92 35 05 sts 0x0535, r1 ; 0x800535 } if (cursor_pos > 3) 1b3d8: c4 30 cpi r28, 0x04 ; 4 1b3da: 0c f4 brge .+2 ; 0x1b3de 1b3dc: 86 c0 rjmp .+268 ; 0x1b4ea { cursor_pos = 3; if (first < items_no - 3) 1b3de: 88 2d mov r24, r8 1b3e0: 08 2c mov r0, r8 1b3e2: 00 0c add r0, r0 1b3e4: 99 0b sbc r25, r25 1b3e6: 80 17 cp r24, r16 1b3e8: 91 07 cpc r25, r17 1b3ea: 0c f0 brlt .+2 ; 0x1b3ee 1b3ec: 7a c0 rjmp .+244 ; 0x1b4e2 { first++; 1b3ee: 83 94 inc r8 lcd_clear(); 1b3f0: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1b3f4: 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); 1b3f6: c1 14 cp r12, r1 1b3f8: d1 04 cpc r13, r1 1b3fa: 29 f0 breq .+10 ; 0x1b406 1b3fc: a6 01 movw r20, r12 1b3fe: 60 e0 ldi r22, 0x00 ; 0 1b400: 80 e0 ldi r24, 0x00 ; 0 1b402: 0e 94 a1 6f call 0xdf42 ; 0xdf42 const bool last_visible = (first == items_no - 3); 1b406: a8 2c mov r10, r8 1b408: 08 2c mov r0, r8 1b40a: 00 0c add r0, r0 1b40c: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1b40e: e1 14 cp r14, r1 1b410: f1 04 cpc r15, r1 1b412: 29 f0 breq .+10 ; 0x1b41e 1b414: 82 e0 ldi r24, 0x02 ; 2 1b416: 98 2e mov r9, r24 1b418: a0 16 cp r10, r16 1b41a: b1 06 cpc r11, r17 1b41c: 11 f0 breq .+4 ; 0x1b422 1b41e: 93 e0 ldi r25, 0x03 ; 3 1b420: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1b422: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1b424: df 5f subi r29, 0xFF ; 255 1b426: 4d e0 ldi r20, 0x0D ; 13 1b428: 5e e6 ldi r21, 0x6E ; 110 1b42a: 6d 2f mov r22, r29 1b42c: 81 e0 ldi r24, 0x01 ; 1 1b42e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 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++) 1b432: 9d 12 cpse r9, r29 1b434: f7 cf rjmp .-18 ; 0x1b424 1b436: 48 2c mov r4, r8 1b438: 08 2c mov r0, r8 1b43a: 00 0c add r0, r0 1b43c: 55 08 sbc r5, r5 1b43e: 66 08 sbc r6, r6 1b440: 77 08 sbc r7, r7 1b442: 8f ef ldi r24, 0xFF ; 255 1b444: 48 1a sub r4, r24 1b446: 58 0a sbc r5, r24 1b448: 68 0a sbc r6, r24 1b44a: 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++) 1b44c: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1b44e: 93 94 inc r9 1b450: 69 2d mov r22, r9 1b452: 8a e0 ldi r24, 0x0A ; 10 1b454: 0e 94 8d 6f call 0xdf1a ; 0xdf1a 1b458: c3 01 movw r24, r6 1b45a: b2 01 movw r22, r4 1b45c: 0e 94 46 71 call 0xe28c ; 0xe28c 1b460: 8f ef ldi r24, 0xFF ; 255 1b462: 48 1a sub r4, r24 1b464: 58 0a sbc r5, r24 1b466: 68 0a sbc r6, r24 1b468: 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++) 1b46a: d9 11 cpse r29, r9 1b46c: f0 cf rjmp .-32 ; 0x1b44e { 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); 1b46e: e1 14 cp r14, r1 1b470: f1 04 cpc r15, r1 1b472: 41 f0 breq .+16 ; 0x1b484 1b474: a0 16 cp r10, r16 1b476: b1 06 cpc r11, r17 1b478: 29 f4 brne .+10 ; 0x1b484 1b47a: a7 01 movw r20, r14 1b47c: 63 e0 ldi r22, 0x03 ; 3 1b47e: 81 e0 ldi r24, 0x01 ; 1 1b480: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1b484: 4e e7 ldi r20, 0x7E ; 126 1b486: 50 e9 ldi r21, 0x90 ; 144 1b488: 61 e0 ldi r22, 0x01 ; 1 1b48a: 80 e0 ldi r24, 0x00 ; 0 1b48c: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_putc_at(0, cursor_pos, '>'); 1b490: 4e e3 ldi r20, 0x3E ; 62 1b492: 6c 2f mov r22, r28 1b494: 80 e0 ldi r24, 0x00 ; 0 1b496: 0e 94 ad 6f call 0xdf5a ; 0xdf5a _delay(100); 1b49a: 64 e6 ldi r22, 0x64 ; 100 1b49c: 70 e0 ldi r23, 0x00 ; 0 1b49e: 80 e0 ldi r24, 0x00 ; 0 1b4a0: 90 e0 ldi r25, 0x00 ; 0 1b4a2: 0f 94 8a 3d call 0x27b14 ; 0x27b14 if (lcd_clicked()) 1b4a6: 0e 94 aa 71 call 0xe354 ; 0xe354 1b4aa: 88 23 and r24, r24 1b4ac: 09 f4 brne .+2 ; 0x1b4b0 1b4ae: 81 cf rjmp .-254 ; 0x1b3b2 { KEEPALIVE_STATE(IN_HANDLER); 1b4b0: 82 e0 ldi r24, 0x02 ; 2 1b4b2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(cursor_pos + first - 1); 1b4b6: 8f ef ldi r24, 0xFF ; 255 1b4b8: 8c 0f add r24, r28 1b4ba: 88 0d add r24, r8 } } } 1b4bc: df 91 pop r29 1b4be: cf 91 pop r28 1b4c0: 1f 91 pop r17 1b4c2: 0f 91 pop r16 1b4c4: ff 90 pop r15 1b4c6: ef 90 pop r14 1b4c8: df 90 pop r13 1b4ca: cf 90 pop r12 1b4cc: bf 90 pop r11 1b4ce: af 90 pop r10 1b4d0: 9f 90 pop r9 1b4d2: 8f 90 pop r8 1b4d4: 7f 90 pop r7 1b4d6: 6f 90 pop r6 1b4d8: 5f 90 pop r5 1b4da: 4f 90 pop r4 1b4dc: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b4de: cf 5f subi r28, 0xFF ; 255 1b4e0: 77 cf rjmp .-274 ; 0x1b3d0 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); 1b4e2: 87 e0 ldi r24, 0x07 ; 7 1b4e4: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee 1b4e8: 85 cf rjmp .-246 ; 0x1b3f4 } } if (cursor_pos < 1) 1b4ea: c1 11 cpse r28, r1 1b4ec: 84 cf rjmp .-248 ; 0x1b3f6 { cursor_pos = 1; if (first > 0) 1b4ee: 18 14 cp r1, r8 1b4f0: 2c f4 brge .+10 ; 0x1b4fc { first--; 1b4f2: 8a 94 dec r8 lcd_clear(); 1b4f4: 0e 94 c0 6f call 0xdf80 ; 0xdf80 } } if (cursor_pos < 1) { cursor_pos = 1; 1b4f8: c1 e0 ldi r28, 0x01 ; 1 1b4fa: 7d cf rjmp .-262 ; 0x1b3f6 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b4fc: 87 e0 ldi r24, 0x07 ; 7 1b4fe: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee 1b502: fa cf rjmp .-12 ; 0x1b4f8 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1b504: c4 30 cpi r28, 0x04 ; 4 1b506: 0c f0 brlt .+2 ; 0x1b50a 1b508: 6a cf rjmp .-300 ; 0x1b3de 1b50a: 75 cf rjmp .-278 ; 0x1b3f6 0001b50c : } #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) { 1b50c: 4f 92 push r4 1b50e: 5f 92 push r5 1b510: 6f 92 push r6 1b512: 7f 92 push r7 1b514: af 92 push r10 1b516: bf 92 push r11 1b518: cf 92 push r12 1b51a: df 92 push r13 1b51c: ef 92 push r14 1b51e: ff 92 push r15 1b520: 0f 93 push r16 1b522: 1f 93 push r17 1b524: cf 93 push r28 1b526: df 93 push r29 1b528: 24 e0 ldi r18, 0x04 ; 4 1b52a: 30 e0 ldi r19, 0x00 ; 0 1b52c: 41 e0 ldi r20, 0x01 ; 1 1b52e: 50 e0 ldi r21, 0x00 ; 0 1b530: d9 01 movw r26, r18 1b532: aa 56 subi r26, 0x6A ; 106 1b534: b5 47 sbci r27, 0x75 ; 117 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 1b536: fd 01 movw r30, r26 1b538: 65 91 lpm r22, Z+ 1b53a: 74 91 lpm r23, Z 1b53c: 86 17 cp r24, r22 1b53e: 97 07 cpc r25, r23 1b540: 0c f0 brlt .+2 ; 0x1b544 1b542: 66 c0 rjmp .+204 ; 0x1b610 { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b544: 41 50 subi r20, 0x01 ; 1 1b546: 51 09 sbc r21, r1 1b548: 44 0f add r20, r20 1b54a: 55 1f adc r21, r21 1b54c: 44 0f add r20, r20 1b54e: 55 1f adc r21, r21 1b550: ea 01 movw r28, r20 1b552: c8 56 subi r28, 0x68 ; 104 1b554: d5 47 sbci r29, 0x75 ; 117 1b556: fe 01 movw r30, r28 1b558: 05 91 lpm r16, Z+ 1b55a: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 1b55c: 4a 56 subi r20, 0x6A ; 106 1b55e: 55 47 sbci r21, 0x75 ; 117 1b560: fa 01 movw r30, r20 1b562: 65 91 lpm r22, Z+ 1b564: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b566: f9 01 movw r30, r18 1b568: e8 56 subi r30, 0x68 ; 104 1b56a: f5 47 sbci r31, 0x75 ; 117 1b56c: e5 90 lpm r14, Z+ 1b56e: f4 90 lpm r15, Z 1b570: fe 01 movw r30, r28 1b572: c5 90 lpm r12, Z+ 1b574: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 1b576: fd 01 movw r30, r26 1b578: c5 91 lpm r28, Z+ 1b57a: d4 91 lpm r29, Z 1b57c: fa 01 movw r30, r20 1b57e: a5 90 lpm r10, Z+ 1b580: 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])) * 1b582: 86 1b sub r24, r22 1b584: 97 0b sbc r25, r23 1b586: bc 01 movw r22, r24 1b588: 99 0f add r25, r25 1b58a: 88 0b sbc r24, r24 1b58c: 99 0b sbc r25, r25 1b58e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1b592: 2b 01 movw r4, r22 1b594: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b596: b7 01 movw r22, r14 1b598: 6c 19 sub r22, r12 1b59a: 7d 09 sbc r23, r13 1b59c: 07 2e mov r0, r23 1b59e: 00 0c add r0, r0 1b5a0: 88 0b sbc r24, r24 1b5a2: 99 0b sbc r25, r25 1b5a4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1b5a8: 9b 01 movw r18, r22 1b5aa: 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])) * 1b5ac: c3 01 movw r24, r6 1b5ae: b2 01 movw r22, r4 1b5b0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b5b4: 6b 01 movw r12, r22 1b5b6: 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])); 1b5b8: be 01 movw r22, r28 1b5ba: 6a 19 sub r22, r10 1b5bc: 7b 09 sbc r23, r11 1b5be: 07 2e mov r0, r23 1b5c0: 00 0c add r0, r0 1b5c2: 88 0b sbc r24, r24 1b5c4: 99 0b sbc r25, r25 1b5c6: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1b5ca: 9b 01 movw r18, r22 1b5cc: 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])) / 1b5ce: c7 01 movw r24, r14 1b5d0: b6 01 movw r22, r12 1b5d2: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1b5d6: 6b 01 movw r12, r22 1b5d8: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b5da: b8 01 movw r22, r16 1b5dc: 11 0f add r17, r17 1b5de: 88 0b sbc r24, r24 1b5e0: 99 0b sbc r25, r25 1b5e2: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1b5e6: 9b 01 movw r18, r22 1b5e8: ac 01 movw r20, r24 1b5ea: c7 01 movw r24, r14 1b5ec: b6 01 movw r22, r12 1b5ee: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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; } 1b5f2: df 91 pop r29 1b5f4: cf 91 pop r28 1b5f6: 1f 91 pop r17 1b5f8: 0f 91 pop r16 1b5fa: ff 90 pop r15 1b5fc: ef 90 pop r14 1b5fe: df 90 pop r13 1b600: cf 90 pop r12 1b602: bf 90 pop r11 1b604: af 90 pop r10 1b606: 7f 90 pop r7 1b608: 6f 90 pop r6 1b60a: 5f 90 pop r5 1b60c: 4f 90 pop r4 1b60e: 08 95 ret 1b610: 4f 5f subi r20, 0xFF ; 255 1b612: 5f 4f sbci r21, 0xFF ; 255 1b614: 2c 5f subi r18, 0xFC ; 252 1b616: 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 1b61e: 88 cf rjmp .-240 ; 0x1b530 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 1b620: e4 e1 ldi r30, 0x14 ; 20 1b622: fb e8 ldi r31, 0x8B ; 139 1b624: 65 91 lpm r22, Z+ 1b626: 74 91 lpm r23, Z 1b628: 07 2e mov r0, r23 1b62a: 00 0c add r0, r0 1b62c: 88 0b sbc r24, r24 1b62e: 99 0b sbc r25, r25 1b630: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1b634: de cf rjmp .-68 ; 0x1b5f2 0001b636 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1b636: 1f 93 push r17 1b638: cf 93 push r28 1b63a: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1b63c: e1 e0 ldi r30, 0x01 ; 1 1b63e: f1 e0 ldi r31, 0x01 ; 1 1b640: 80 81 ld r24, Z 1b642: 8e 7f andi r24, 0xFE ; 254 1b644: 80 83 st Z, r24 PORTH |= 0x01; 1b646: e2 e0 ldi r30, 0x02 ; 2 1b648: f1 e0 ldi r31, 0x01 ; 1 1b64a: 80 81 ld r24, Z 1b64c: 81 60 ori r24, 0x01 ; 1 1b64e: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1b650: e0 e2 ldi r30, 0x20 ; 32 1b652: f5 e0 ldi r31, 0x05 ; 5 1b654: 90 e1 ldi r25, 0x10 ; 16 1b656: 90 83 st Z, r25 ptr[1] = 0; 1b658: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1b65a: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1b65c: e0 ed ldi r30, 0xD0 ; 208 1b65e: f0 e0 ldi r31, 0x00 ; 0 1b660: 80 81 ld r24, Z 1b662: 82 60 ori r24, 0x02 ; 2 1b664: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1b666: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1b66a: e1 ed ldi r30, 0xD1 ; 209 1b66c: f0 e0 ldi r31, 0x00 ; 0 1b66e: 88 e1 ldi r24, 0x18 ; 24 1b670: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1b672: 80 81 ld r24, Z 1b674: 80 68 ori r24, 0x80 ; 128 1b676: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1b678: e0 e7 ldi r30, 0x70 ; 112 1b67a: f2 e1 ldi r31, 0x12 ; 18 1b67c: 89 e8 ldi r24, 0x89 ; 137 1b67e: 9a e3 ldi r25, 0x3A ; 58 1b680: 91 87 std Z+9, r25 ; 0x09 1b682: 80 87 std Z+8, r24 ; 0x08 1b684: 8f e5 ldi r24, 0x5F ; 95 1b686: 99 e3 ldi r25, 0x39 ; 57 1b688: 93 87 std Z+11, r25 ; 0x0b 1b68a: 82 87 std Z+10, r24 ; 0x0a 1b68c: 13 e0 ldi r17, 0x03 ; 3 1b68e: 13 83 std Z+3, r17 ; 0x03 1b690: 15 86 std Z+13, r1 ; 0x0d 1b692: 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); 1b694: 9f b7 in r25, 0x3f ; 63 1b696: f8 94 cli 1b698: e5 e0 ldi r30, 0x05 ; 5 1b69a: f1 e0 ldi r31, 0x01 ; 1 1b69c: 80 81 ld r24, Z 1b69e: 80 62 ori r24, 0x20 ; 32 1b6a0: 80 83 st Z, r24 1b6a2: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1b6a4: e4 e0 ldi r30, 0x04 ; 4 1b6a6: f1 e0 ldi r31, 0x01 ; 1 1b6a8: 80 81 ld r24, Z 1b6aa: 80 62 ori r24, 0x20 ; 32 1b6ac: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1b6ae: 0f 94 11 c3 call 0x38622 ; 0x38622 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1b6b2: 83 e6 ldi r24, 0x63 ; 99 1b6b4: 0f 94 cd 87 call 0x30f9a ; 0x30f9a retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1b6b8: 84 e0 ldi r24, 0x04 ; 4 1b6ba: 96 ea ldi r25, 0xA6 ; 166 1b6bc: 0e 94 fe 7a call 0xf5fc ; 0xf5fc retryAttempts = MAX_RETRIES; 1b6c0: c7 e2 ldi r28, 0x27 ; 39 1b6c2: d3 e1 ldi r29, 0x13 ; 19 1b6c4: 10 93 7b 13 sts 0x137B, r17 ; 0x80137b } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1b6c8: 85 e8 ldi r24, 0x85 ; 133 1b6ca: 99 ea ldi r25, 0xA9 ; 169 1b6cc: 0e 94 fe 7a call 0xf5fc ; 0xf5fc /// @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; } 1b6d0: 8a e0 ldi r24, 0x0A ; 10 1b6d2: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1b6d4: 82 e0 ldi r24, 0x02 ; 2 1b6d6: 80 93 96 13 sts 0x1396, r24 ; 0x801396 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1b6da: 81 e0 ldi r24, 0x01 ; 1 1b6dc: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1b6de: 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; 1b6e0: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1b6e2: 86 e0 ldi r24, 0x06 ; 6 1b6e4: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1b6e6: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1b6e8: df 91 pop r29 1b6ea: cf 91 pop r28 1b6ec: 1f 91 pop r17 1b6ee: 0d 94 a0 98 jmp 0x33140 ; 0x33140 0001b6f2 : useU2X = false; } #endif // set up the first (original serial port) if (useU2X) { M_UCSRxA = 1 << M_U2Xx; 1b6f2: 22 e0 ldi r18, 0x02 ; 2 1b6f4: 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; 1b6f8: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> M_UBRRxL = baud_setting; 1b6fc: 90 e1 ldi r25, 0x10 ; 16 1b6fe: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> sbi(M_UCSRxB, M_RXENx); 1b702: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b706: 80 61 ori r24, 0x10 ; 16 1b708: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_TXENx); 1b70c: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b710: 88 60 ori r24, 0x08 ; 8 1b712: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_RXCIEx); 1b716: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b71a: 80 68 ori r24, 0x80 ; 128 1b71c: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> if (selectedSerialPort == 1) { //set up also the second serial port 1b720: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 1b724: 81 30 cpi r24, 0x01 ; 1 1b726: a9 f4 brne .+42 ; 0x1b752 if (useU2X) { UCSR1A = 1 << U2X1; 1b728: 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; 1b72c: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> UBRR1L = baud_setting; 1b730: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> sbi(UCSR1B, RXEN1); 1b734: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b738: 80 61 ori r24, 0x10 ; 16 1b73a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, TXEN1); 1b73e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b742: 88 60 ori r24, 0x08 ; 8 1b744: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, RXCIE1); 1b748: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b74c: 80 68 ori r24, 0x80 ; 128 1b74e: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> } } 1b752: 08 95 ret 0001b754 : { 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) 1b754: 2f 92 push r2 1b756: 3f 92 push r3 1b758: 4f 92 push r4 1b75a: 5f 92 push r5 1b75c: 6f 92 push r6 1b75e: 7f 92 push r7 1b760: 8f 92 push r8 1b762: 9f 92 push r9 1b764: af 92 push r10 1b766: bf 92 push r11 1b768: cf 92 push r12 1b76a: df 92 push r13 1b76c: ef 92 push r14 1b76e: ff 92 push r15 1b770: 0f 93 push r16 1b772: 1f 93 push r17 1b774: cf 93 push r28 1b776: df 93 push r29 1b778: 00 d0 rcall .+0 ; 0x1b77a 1b77a: 00 d0 rcall .+0 ; 0x1b77c 1b77c: 1f 92 push r1 1b77e: cd b7 in r28, 0x3d ; 61 1b780: de b7 in r29, 0x3e ; 62 1b782: 69 83 std Y+1, r22 ; 0x01 1b784: 49 01 movw r8, r18 1b786: 5a 01 movw r10, r20 1b788: 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; 1b78a: 68 2f mov r22, r24 1b78c: 70 e0 ldi r23, 0x00 ; 0 1b78e: 90 e0 ldi r25, 0x00 ; 0 1b790: 80 e0 ldi r24, 0x00 ; 0 1b792: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1b796: 24 e0 ldi r18, 0x04 ; 4 1b798: 32 e0 ldi r19, 0x02 ; 2 1b79a: 41 e0 ldi r20, 0x01 ; 1 1b79c: 5c e3 ldi r21, 0x3C ; 60 1b79e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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] 1b7a2: 20 91 b6 12 lds r18, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 1b7a6: 30 91 b7 12 lds r19, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 1b7aa: 40 91 b8 12 lds r20, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 1b7ae: 50 91 b9 12 lds r21, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 1b7b2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b7b6: 6b 01 movw r12, r22 1b7b8: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1b7ba: 20 91 ba 12 lds r18, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 1b7be: 30 91 bb 12 lds r19, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 1b7c2: 40 91 bc 12 lds r20, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 1b7c6: 50 91 bd 12 lds r21, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 1b7ca: c5 01 movw r24, r10 1b7cc: b4 01 movw r22, r8 1b7ce: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b7d2: 20 91 be 12 lds r18, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 1b7d6: 30 91 bf 12 lds r19, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 1b7da: 40 91 c0 12 lds r20, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 1b7de: 50 91 c1 12 lds r21, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 1b7e2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1b7e6: a7 01 movw r20, r14 1b7e8: 96 01 movw r18, r12 1b7ea: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b7ee: 6b 01 movw r12, r22 1b7f0: 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; 1b7f2: 20 91 0c 13 lds r18, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 1b7f6: 30 91 0d 13 lds r19, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 1b7fa: 40 91 0e 13 lds r20, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 1b7fe: 50 91 0f 13 lds r21, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1b802: c8 01 movw r24, r16 1b804: b2 01 movw r22, r4 1b806: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1b80a: 9b 01 movw r18, r22 1b80c: 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 1b80e: c5 01 movw r24, r10 1b810: b4 01 movw r22, r8 1b812: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__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) 1b816: 39 81 ldd r19, Y+1 ; 0x01 1b818: 24 e0 ldi r18, 0x04 ; 4 1b81a: 32 9f mul r19, r18 1b81c: f0 01 movw r30, r0 1b81e: 11 24 eor r1, r1 1b820: e4 53 subi r30, 0x34 ; 52 1b822: 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 1b824: 20 81 ld r18, Z 1b826: 31 81 ldd r19, Z+1 ; 0x01 1b828: 42 81 ldd r20, Z+2 ; 0x02 1b82a: 53 81 ldd r21, Z+3 ; 0x03 1b82c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1b830: 9b 01 movw r18, r22 1b832: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1b834: c7 01 movw r24, r14 1b836: b6 01 movw r22, r12 1b838: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1b83c: 20 91 19 13 lds r18, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 1b840: 30 91 1a 13 lds r19, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 1b844: 40 91 1b 13 lds r20, 0x131B ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 1b848: 50 91 1c 13 lds r21, 0x131C ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> 1b84c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b850: 6f 83 std Y+7, r22 ; 0x07 1b852: 79 83 std Y+1, r23 ; 0x01 1b854: 18 2f mov r17, r24 1b856: 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); 1b858: 20 91 ad 12 lds r18, 0x12AD ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> 1b85c: e2 2f mov r30, r18 1b85e: f0 e0 ldi r31, 0x00 ; 0 1b860: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 1b864: 81 50 subi r24, 0x01 ; 1 1b866: 99 0b sbc r25, r25 1b868: e8 17 cp r30, r24 1b86a: f9 07 cpc r31, r25 1b86c: 09 f4 brne .+2 ; 0x1b870 1b86e: f4 c0 rjmp .+488 ; 0x1ba58 1b870: 2f 5f subi r18, 0xFF ; 255 1b872: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1b874: 5e 81 ldd r21, Y+6 ; 0x06 1b876: 44 e0 ldi r20, 0x04 ; 4 1b878: 54 9f mul r21, r20 1b87a: 10 01 movw r2, r0 1b87c: 11 24 eor r1, r1 1b87e: d1 01 movw r26, r2 1b880: a4 57 subi r26, 0x74 ; 116 1b882: bd 4e sbci r27, 0xED ; 237 1b884: 2d 91 ld r18, X+ 1b886: 3d 91 ld r19, X+ 1b888: 4d 91 ld r20, X+ 1b88a: 5c 91 ld r21, X 1b88c: 2a 83 std Y+2, r18 ; 0x02 1b88e: 3b 83 std Y+3, r19 ; 0x03 1b890: 4c 83 std Y+4, r20 ; 0x04 1b892: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1b894: ee 0f add r30, r30 1b896: ff 1f adc r31, r31 1b898: ee 0f add r30, r30 1b89a: ff 1f adc r31, r31 1b89c: e4 57 subi r30, 0x74 ; 116 1b89e: fd 4e sbci r31, 0xED ; 237 1b8a0: 40 80 ld r4, Z 1b8a2: 51 80 ldd r5, Z+1 ; 0x01 1b8a4: 62 80 ldd r6, Z+2 ; 0x02 1b8a6: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1b8a8: c0 90 c6 12 lds r12, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 1b8ac: d0 90 c7 12 lds r13, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 1b8b0: e0 90 c8 12 lds r14, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 1b8b4: f0 90 c9 12 lds r15, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+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; 1b8b8: 92 01 movw r18, r4 1b8ba: a3 01 movw r20, r6 1b8bc: b2 01 movw r22, r4 1b8be: c3 01 movw r24, r6 1b8c0: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 1b8c4: 88 23 and r24, r24 1b8c6: 21 f0 breq .+8 ; 0x1b8d0 1b8c8: 4f 80 ldd r4, Y+7 ; 0x07 1b8ca: 59 80 ldd r5, Y+1 ; 0x01 1b8cc: 61 2e mov r6, r17 1b8ce: 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; 1b8d0: a1 01 movw r20, r2 1b8d2: 44 57 subi r20, 0x74 ; 116 1b8d4: 5d 4e sbci r21, 0xED ; 237 1b8d6: 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); 1b8d8: a7 01 movw r20, r14 1b8da: 96 01 movw r18, r12 1b8dc: 60 e0 ldi r22, 0x00 ; 0 1b8de: 70 e0 ldi r23, 0x00 ; 0 1b8e0: 80 e8 ldi r24, 0x80 ; 128 1b8e2: 9f e3 ldi r25, 0x3F ; 63 1b8e4: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1b8e8: 92 01 movw r18, r4 1b8ea: a3 01 movw r20, r6 1b8ec: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b8f0: 2b 01 movw r4, r22 1b8f2: 3c 01 movw r6, r24 1b8f4: a7 01 movw r20, r14 1b8f6: 96 01 movw r18, r12 1b8f8: 6f 81 ldd r22, Y+7 ; 0x07 1b8fa: 79 81 ldd r23, Y+1 ; 0x01 1b8fc: 81 2f mov r24, r17 1b8fe: 90 2f mov r25, r16 1b900: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b904: 9b 01 movw r18, r22 1b906: ac 01 movw r20, r24 1b908: c3 01 movw r24, r6 1b90a: b2 01 movw r22, r4 1b90c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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; 1b910: f1 01 movw r30, r2 1b912: 60 83 st Z, r22 1b914: 71 83 std Z+1, r23 ; 0x01 1b916: 82 83 std Z+2, r24 ; 0x02 1b918: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1b91a: fe 81 ldd r31, Y+6 ; 0x06 1b91c: f0 93 ad 12 sts 0x12AD, r31 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; 1b920: 20 91 b2 12 lds r18, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 1b924: 30 91 b3 12 lds r19, 0x12B3 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 1b928: 40 91 b4 12 lds r20, 0x12B4 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 1b92c: 50 91 b5 12 lds r21, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> 1b930: c5 01 movw r24, r10 1b932: b4 01 movw r22, r8 1b934: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1b938: 2a 81 ldd r18, Y+2 ; 0x02 1b93a: 3b 81 ldd r19, Y+3 ; 0x03 1b93c: 4c 81 ldd r20, Y+4 ; 0x04 1b93e: 5d 81 ldd r21, Y+5 ; 0x05 1b940: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1b944: 2b 01 movw r4, r22 1b946: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1b948: c0 90 ae 12 lds r12, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 1b94c: d0 90 af 12 lds r13, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 1b950: e0 90 b0 12 lds r14, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 1b954: f0 90 b1 12 lds r15, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+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; 1b958: a7 01 movw r20, r14 1b95a: 96 01 movw r18, r12 1b95c: c7 01 movw r24, r14 1b95e: b6 01 movw r22, r12 1b960: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 1b964: 88 23 and r24, r24 1b966: 19 f0 breq .+6 ; 0x1b96e 1b968: c1 2c mov r12, r1 1b96a: d1 2c mov r13, r1 1b96c: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1b96e: 23 e3 ldi r18, 0x33 ; 51 1b970: 33 e3 ldi r19, 0x33 ; 51 1b972: 43 e7 ldi r20, 0x73 ; 115 1b974: 5f e3 ldi r21, 0x3F ; 63 1b976: c7 01 movw r24, r14 1b978: b6 01 movw r22, r12 1b97a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b97e: 6b 01 movw r12, r22 1b980: 7c 01 movw r14, r24 1b982: 2d ec ldi r18, 0xCD ; 205 1b984: 3c ec ldi r19, 0xCC ; 204 1b986: 4c e4 ldi r20, 0x4C ; 76 1b988: 5d e3 ldi r21, 0x3D ; 61 1b98a: c3 01 movw r24, r6 1b98c: b2 01 movw r22, r4 1b98e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1b992: 9b 01 movw r18, r22 1b994: ac 01 movw r20, r24 1b996: c7 01 movw r24, r14 1b998: b6 01 movw r22, r12 1b99a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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; 1b99e: 80 92 b2 12 sts 0x12B2, r8 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 1b9a2: 90 92 b3 12 sts 0x12B3, r9 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 1b9a6: a0 92 b4 12 sts 0x12B4, r10 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 1b9aa: b0 92 b5 12 sts 0x12B5, r11 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> dT_err_prev = dT_err_f; 1b9ae: 60 93 ae 12 sts 0x12AE, r22 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 1b9b2: 70 93 af 12 sts 0x12AF, r23 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 1b9b6: 80 93 b0 12 sts 0x12B0, r24 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 1b9ba: 90 93 b1 12 sts 0x12B1, r25 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> // check and trigger errors flag_bits.error = (fabsf(dT_err_f) > err_s); 1b9be: 6b 01 movw r12, r22 1b9c0: 7c 01 movw r14, r24 1b9c2: e8 94 clt 1b9c4: f7 f8 bld r15, 7 1b9c6: 21 e0 ldi r18, 0x01 ; 1 1b9c8: 29 83 std Y+1, r18 ; 0x01 1b9ca: 20 91 21 13 lds r18, 0x1321 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 1b9ce: 30 91 22 13 lds r19, 0x1322 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 1b9d2: 40 91 23 13 lds r20, 0x1323 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 1b9d6: 50 91 24 13 lds r21, 0x1324 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> 1b9da: c7 01 movw r24, r14 1b9dc: b6 01 movw r22, r12 1b9de: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1b9e2: 18 16 cp r1, r24 1b9e4: 0c f0 brlt .+2 ; 0x1b9e8 1b9e6: 19 82 std Y+1, r1 ; 0x01 1b9e8: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 1b9ec: 39 81 ldd r19, Y+1 ; 0x01 1b9ee: 30 fb bst r19, 0 1b9f0: 81 f9 bld r24, 1 1b9f2: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1b9f6: 41 e0 ldi r20, 0x01 ; 1 1b9f8: 49 83 std Y+1, r20 ; 0x01 1b9fa: 20 91 1d 13 lds r18, 0x131D ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 1b9fe: 30 91 1e 13 lds r19, 0x131E ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 1ba02: 40 91 1f 13 lds r20, 0x131F ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 1ba06: 50 91 20 13 lds r21, 0x1320 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> 1ba0a: c7 01 movw r24, r14 1ba0c: b6 01 movw r22, r12 1ba0e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1ba12: 18 16 cp r1, r24 1ba14: 0c f0 brlt .+2 ; 0x1ba18 1ba16: 19 82 std Y+1, r1 ; 0x01 1ba18: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 1ba1c: 59 81 ldd r21, Y+1 ; 0x01 1ba1e: 50 fb bst r21, 0 1ba20: 82 f9 bld r24, 2 1ba22: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> } 1ba26: 27 96 adiw r28, 0x07 ; 7 1ba28: 0f b6 in r0, 0x3f ; 63 1ba2a: f8 94 cli 1ba2c: de bf out 0x3e, r29 ; 62 1ba2e: 0f be out 0x3f, r0 ; 63 1ba30: cd bf out 0x3d, r28 ; 61 1ba32: df 91 pop r29 1ba34: cf 91 pop r28 1ba36: 1f 91 pop r17 1ba38: 0f 91 pop r16 1ba3a: ff 90 pop r15 1ba3c: ef 90 pop r14 1ba3e: df 90 pop r13 1ba40: cf 90 pop r12 1ba42: bf 90 pop r11 1ba44: af 90 pop r10 1ba46: 9f 90 pop r9 1ba48: 8f 90 pop r8 1ba4a: 7f 90 pop r7 1ba4c: 6f 90 pop r6 1ba4e: 5f 90 pop r5 1ba50: 4f 90 pop r4 1ba52: 3f 90 pop r3 1ba54: 2f 90 pop r2 1ba56: 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); 1ba58: 1e 82 std Y+6, r1 ; 0x06 1ba5a: 0c cf rjmp .-488 ; 0x1b874 0001ba5c : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1ba5c: 2f 92 push r2 1ba5e: 3f 92 push r3 1ba60: 4f 92 push r4 1ba62: 5f 92 push r5 1ba64: 6f 92 push r6 1ba66: 7f 92 push r7 1ba68: 8f 92 push r8 1ba6a: 9f 92 push r9 1ba6c: af 92 push r10 1ba6e: bf 92 push r11 1ba70: cf 92 push r12 1ba72: df 92 push r13 1ba74: ef 92 push r14 1ba76: ff 92 push r15 1ba78: 0f 93 push r16 1ba7a: 1f 93 push r17 1ba7c: cf 93 push r28 1ba7e: df 93 push r29 1ba80: cd b7 in r28, 0x3d ; 61 1ba82: de b7 in r29, 0x3e ; 62 1ba84: a4 97 sbiw r28, 0x24 ; 36 1ba86: 0f b6 in r0, 0x3f ; 63 1ba88: f8 94 cli 1ba8a: de bf out 0x3e, r29 ; 62 1ba8c: 0f be out 0x3f, r0 ; 63 1ba8e: cd bf out 0x3d, r28 ; 61 1ba90: 9b 8f std Y+27, r25 ; 0x1b 1ba92: 8a 8f std Y+26, r24 ; 0x1a 1ba94: 7a 8b std Y+18, r23 ; 0x12 1ba96: 69 8b std Y+17, r22 ; 0x11 1ba98: 2b 8b std Y+19, r18 ; 0x13 1ba9a: 3c 8b std Y+20, r19 ; 0x14 1ba9c: 4d 8b std Y+21, r20 ; 0x15 1ba9e: 5e 8b std Y+22, r21 ; 0x16 1baa0: 0c 8f std Y+28, r16 ; 0x1c 1baa2: cd 8e std Y+29, r12 ; 0x1d 1baa4: de 8e std Y+30, r13 ; 0x1e 1baa6: ef 8e std Y+31, r14 ; 0x1f 1baa8: 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; 1baaa: 20 91 1e 05 lds r18, 0x051E ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> 1baae: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1bab0: 80 e0 ldi r24, 0x00 ; 0 1bab2: 0f 94 9b 48 call 0x29136 ; 0x29136 float orig = *var; 1bab6: a9 89 ldd r26, Y+17 ; 0x11 1bab8: ba 89 ldd r27, Y+18 ; 0x12 1baba: 8d 91 ld r24, X+ 1babc: 9d 91 ld r25, X+ 1babe: 0d 90 ld r0, X+ 1bac0: bc 91 ld r27, X 1bac2: a0 2d mov r26, r0 1bac4: 89 a3 std Y+33, r24 ; 0x21 1bac6: 9a a3 std Y+34, r25 ; 0x22 1bac8: ab a3 std Y+35, r26 ; 0x23 1baca: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1bacc: 80 e0 ldi r24, 0x00 ; 0 1bace: 90 e0 ldi r25, 0x00 ; 0 1bad0: a0 ea ldi r26, 0xA0 ; 160 1bad2: b0 e4 ldi r27, 0x40 ; 64 1bad4: 89 83 std Y+1, r24 ; 0x01 1bad6: 9a 83 std Y+2, r25 ; 0x02 1bad8: ab 83 std Y+3, r26 ; 0x03 1bada: bc 83 std Y+4, r27 ; 0x04 1badc: 8b 89 ldd r24, Y+19 ; 0x13 1bade: 9c 89 ldd r25, Y+20 ; 0x14 1bae0: ad 89 ldd r26, Y+21 ; 0x15 1bae2: be 89 ldd r27, Y+22 ; 0x16 1bae4: 8d 83 std Y+5, r24 ; 0x05 1bae6: 9e 83 std Y+6, r25 ; 0x06 1bae8: af 83 std Y+7, r26 ; 0x07 1baea: 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]); 1baec: 20 e0 ldi r18, 0x00 ; 0 1baee: 30 e0 ldi r19, 0x00 ; 0 1baf0: 40 ea ldi r20, 0xA0 ; 160 1baf2: 50 e4 ldi r21, 0x40 ; 64 1baf4: bc 01 movw r22, r24 1baf6: cd 01 movw r24, r26 1baf8: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1bafc: 2a e7 ldi r18, 0x7A ; 122 1bafe: 37 e3 ldi r19, 0x37 ; 55 1bb00: 4e e1 ldi r20, 0x1E ; 30 1bb02: 5f e3 ldi r21, 0x3F ; 63 1bb04: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1bb08: 6b 01 movw r12, r22 1bb0a: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 1bb0c: 20 e0 ldi r18, 0x00 ; 0 1bb0e: 30 e0 ldi r19, 0x00 ; 0 1bb10: 40 ea ldi r20, 0xA0 ; 160 1bb12: 50 e4 ldi r21, 0x40 ; 64 1bb14: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1bb18: 69 87 std Y+9, r22 ; 0x09 1bb1a: 7a 87 std Y+10, r23 ; 0x0a 1bb1c: 8b 87 std Y+11, r24 ; 0x0b 1bb1e: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1bb20: a7 01 movw r20, r14 1bb22: 96 01 movw r18, r12 1bb24: 6b 89 ldd r22, Y+19 ; 0x13 1bb26: 7c 89 ldd r23, Y+20 ; 0x14 1bb28: 8d 89 ldd r24, Y+21 ; 0x15 1bb2a: 9e 89 ldd r25, Y+22 ; 0x16 1bb2c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1bb30: 6d 87 std Y+13, r22 ; 0x0d 1bb32: 7e 87 std Y+14, r23 ; 0x0e 1bb34: 8f 87 std Y+15, r24 ; 0x0f 1bb36: 98 8b std Y+16, r25 ; 0x10 1bb38: 31 2c mov r3, r1 1bb3a: 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); 1bb3c: 29 85 ldd r18, Y+9 ; 0x09 1bb3e: 3a 85 ldd r19, Y+10 ; 0x0a 1bb40: 4b 85 ldd r20, Y+11 ; 0x0b 1bb42: 5c 85 ldd r21, Y+12 ; 0x0c 1bb44: cd 8c ldd r12, Y+29 ; 0x1d 1bb46: de 8c ldd r13, Y+30 ; 0x1e 1bb48: ef 8c ldd r14, Y+31 ; 0x1f 1bb4a: f8 a0 ldd r15, Y+32 ; 0x20 1bb4c: 0c 8d ldd r16, Y+28 ; 0x1c 1bb4e: 69 89 ldd r22, Y+17 ; 0x11 1bb50: 7a 89 ldd r23, Y+18 ; 0x12 1bb52: 8a 8d ldd r24, Y+26 ; 0x1a 1bb54: 9b 8d ldd r25, Y+27 ; 0x1b 1bb56: 0f 94 e4 42 call 0x285c8 ; 0x285c8 1bb5a: 4b 01 movw r8, r22 1bb5c: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1bb5e: 2d 85 ldd r18, Y+13 ; 0x0d 1bb60: 3e 85 ldd r19, Y+14 ; 0x0e 1bb62: 4f 85 ldd r20, Y+15 ; 0x0f 1bb64: 58 89 ldd r21, Y+16 ; 0x10 1bb66: cd 8c ldd r12, Y+29 ; 0x1d 1bb68: de 8c ldd r13, Y+30 ; 0x1e 1bb6a: ef 8c ldd r14, Y+31 ; 0x1f 1bb6c: f8 a0 ldd r15, Y+32 ; 0x20 1bb6e: 0c 8d ldd r16, Y+28 ; 0x1c 1bb70: 69 89 ldd r22, Y+17 ; 0x11 1bb72: 7a 89 ldd r23, Y+18 ; 0x12 1bb74: 8a 8d ldd r24, Y+26 ; 0x1a 1bb76: 9b 8d ldd r25, Y+27 ; 0x1b 1bb78: 0f 94 e4 42 call 0x285c8 ; 0x285c8 1bb7c: 9b 01 movw r18, r22 1bb7e: ac 01 movw r20, r24 bool dir = (c2 < c1); 1bb80: 11 e0 ldi r17, 0x01 ; 1 1bb82: c5 01 movw r24, r10 1bb84: b4 01 movw r22, r8 1bb86: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1bb8a: 18 16 cp r1, r24 1bb8c: 0c f0 brlt .+2 ; 0x1bb90 1bb8e: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1bb90: 01 e0 ldi r16, 0x01 ; 1 1bb92: 01 27 eor r16, r17 1bb94: 80 2f mov r24, r16 1bb96: 90 e0 ldi r25, 0x00 ; 0 1bb98: e1 2f mov r30, r17 1bb9a: f0 e0 ldi r31, 0x00 ; 0 1bb9c: ee 0f add r30, r30 1bb9e: ff 1f adc r31, r31 1bba0: ee 0f add r30, r30 1bba2: ff 1f adc r31, r31 1bba4: 41 e0 ldi r20, 0x01 ; 1 1bba6: 50 e0 ldi r21, 0x00 ; 0 1bba8: 4c 0f add r20, r28 1bbaa: 5d 1f adc r21, r29 1bbac: 4e 0f add r20, r30 1bbae: 5f 1f adc r21, r31 1bbb0: 8c 01 movw r16, r24 1bbb2: 00 0f add r16, r16 1bbb4: 11 1f adc r17, r17 1bbb6: 00 0f add r16, r16 1bbb8: 11 1f adc r17, r17 1bbba: a1 e0 ldi r26, 0x01 ; 1 1bbbc: b0 e0 ldi r27, 0x00 ; 0 1bbbe: ac 0f add r26, r28 1bbc0: bd 1f adc r27, r29 1bbc2: 0a 0f add r16, r26 1bbc4: 1b 1f adc r17, r27 1bbc6: f8 01 movw r30, r16 1bbc8: 38 96 adiw r30, 0x08 ; 8 1bbca: f8 8f std Y+24, r31 ; 0x18 1bbcc: ef 8b std Y+23, r30 ; 0x17 1bbce: f8 01 movw r30, r16 1bbd0: 80 85 ldd r24, Z+8 ; 0x08 1bbd2: 91 85 ldd r25, Z+9 ; 0x09 1bbd4: a2 85 ldd r26, Z+10 ; 0x0a 1bbd6: b3 85 ldd r27, Z+11 ; 0x0b 1bbd8: fa 01 movw r30, r20 1bbda: 80 83 st Z, r24 1bbdc: 91 83 std Z+1, r25 ; 0x01 1bbde: a2 83 std Z+2, r26 ; 0x02 1bbe0: 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]); 1bbe2: 8d 80 ldd r8, Y+5 ; 0x05 1bbe4: 9e 80 ldd r9, Y+6 ; 0x06 1bbe6: af 80 ldd r10, Y+7 ; 0x07 1bbe8: b8 84 ldd r11, Y+8 ; 0x08 1bbea: c9 80 ldd r12, Y+1 ; 0x01 1bbec: da 80 ldd r13, Y+2 ; 0x02 1bbee: eb 80 ldd r14, Y+3 ; 0x03 1bbf0: fc 80 ldd r15, Y+4 ; 0x04 1bbf2: a7 01 movw r20, r14 1bbf4: 96 01 movw r18, r12 1bbf6: c5 01 movw r24, r10 1bbf8: b4 01 movw r22, r8 1bbfa: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1bbfe: 2a e7 ldi r18, 0x7A ; 122 1bc00: 37 e3 ldi r19, 0x37 ; 55 1bc02: 4e e1 ldi r20, 0x1E ; 30 1bc04: 5f e3 ldi r21, 0x3F ; 63 1bc06: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1bc0a: 2b 01 movw r4, r22 1bc0c: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1bc0e: ac 01 movw r20, r24 1bc10: 9b 01 movw r18, r22 1bc12: c7 01 movw r24, r14 1bc14: b6 01 movw r22, r12 1bc16: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1bc1a: 69 87 std Y+9, r22 ; 0x09 1bc1c: 7a 87 std Y+10, r23 ; 0x0a 1bc1e: 8b 87 std Y+11, r24 ; 0x0b 1bc20: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1bc22: a3 01 movw r20, r6 1bc24: 92 01 movw r18, r4 1bc26: c5 01 movw r24, r10 1bc28: b4 01 movw r22, r8 1bc2a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1bc2e: 6d 87 std Y+13, r22 ; 0x0d 1bc30: 7e 87 std Y+14, r23 ; 0x0e 1bc32: 8f 87 std Y+15, r24 ; 0x0f 1bc34: 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]; 1bc36: d8 01 movw r26, r16 1bc38: 18 96 adiw r26, 0x08 ; 8 1bc3a: 4c 90 ld r4, X 1bc3c: ef 89 ldd r30, Y+23 ; 0x17 1bc3e: f8 8d ldd r31, Y+24 ; 0x18 1bc40: 51 80 ldd r5, Z+1 ; 0x01 1bc42: 62 80 ldd r6, Z+2 ; 0x02 1bc44: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1bc46: a5 01 movw r20, r10 1bc48: 94 01 movw r18, r8 1bc4a: c7 01 movw r24, r14 1bc4c: b6 01 movw r22, r12 1bc4e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1bc52: 24 2d mov r18, r4 1bc54: 35 2d mov r19, r5 1bc56: 46 2d mov r20, r6 1bc58: 57 2d mov r21, r7 1bc5a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1bc5e: 9f 77 andi r25, 0x7F ; 127 1bc60: 2c e0 ldi r18, 0x0C ; 12 1bc62: 31 e9 ldi r19, 0x91 ; 145 1bc64: 43 ec ldi r20, 0xC3 ; 195 1bc66: 5e e3 ldi r21, 0x3E ; 62 1bc68: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1bc6c: 6b 01 movw r12, r22 1bc6e: 7c 01 movw r14, r24 1bc70: 5b 01 movw r10, r22 1bc72: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1bc74: ff 92 push r15 1bc76: 8f 93 push r24 1bc78: df 92 push r13 1bc7a: 6f 93 push r22 1bc7c: 7f 92 push r7 1bc7e: 6f 92 push r6 1bc80: 5f 92 push r5 1bc82: 4f 92 push r4 1bc84: 3f 92 push r3 1bc86: 2f 92 push r2 1bc88: 24 e5 ldi r18, 0x54 ; 84 1bc8a: 30 e9 ldi r19, 0x90 ; 144 1bc8c: 3f 93 push r19 1bc8e: 2f 93 push r18 1bc90: 0f 94 4b dc call 0x3b896 ; 0x3b896 if(e < thr) { 1bc94: 0f b6 in r0, 0x3f ; 63 1bc96: f8 94 cli 1bc98: de bf out 0x3e, r29 ; 62 1bc9a: 0f be out 0x3f, r0 ; 63 1bc9c: cd bf out 0x3d, r28 ; 61 1bc9e: 2a e0 ldi r18, 0x0A ; 10 1bca0: 37 ed ldi r19, 0xD7 ; 215 1bca2: 43 e2 ldi r20, 0x23 ; 35 1bca4: 5c e3 ldi r21, 0x3C ; 60 1bca6: 6c 2d mov r22, r12 1bca8: 7d 2d mov r23, r13 1bcaa: 8e 2d mov r24, r14 1bcac: 9f 2d mov r25, r15 1bcae: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1bcb2: 87 ff sbrs r24, 7 1bcb4: 42 c0 rjmp .+132 ; 0x1bd3a if(x == min || x == max) { 1bcb6: 20 e0 ldi r18, 0x00 ; 0 1bcb8: 30 e0 ldi r19, 0x00 ; 0 1bcba: 40 ea ldi r20, 0xA0 ; 160 1bcbc: 50 e4 ldi r21, 0x40 ; 64 1bcbe: 64 2d mov r22, r4 1bcc0: 75 2d mov r23, r5 1bcc2: 86 2d mov r24, r6 1bcc4: 97 2d mov r25, r7 1bcc6: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1bcca: 88 23 and r24, r24 1bccc: f1 f1 breq .+124 ; 0x1bd4a 1bcce: 24 2d mov r18, r4 1bcd0: 35 2d mov r19, r5 1bcd2: 46 2d mov r20, r6 1bcd4: 57 2d mov r21, r7 1bcd6: 6b 89 ldd r22, Y+19 ; 0x13 1bcd8: 7c 89 ldd r23, Y+20 ; 0x14 1bcda: 8d 89 ldd r24, Y+21 ; 0x15 1bcdc: 9e 89 ldd r25, Y+22 ; 0x16 1bcde: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1bce2: 88 23 and r24, r24 1bce4: 91 f1 breq .+100 ; 0x1bd4a // real value likely outside of the search boundaries break; } *var = x; 1bce6: 84 2d mov r24, r4 1bce8: 95 2d mov r25, r5 1bcea: a6 2d mov r26, r6 1bcec: b7 2d mov r27, r7 1bcee: e9 89 ldd r30, Y+17 ; 0x11 1bcf0: fa 89 ldd r31, Y+18 ; 0x12 1bcf2: 80 83 st Z, r24 1bcf4: 91 83 std Z+1, r25 ; 0x01 1bcf6: a2 83 std Z+2, r26 ; 0x02 1bcf8: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bcfa: 89 8d ldd r24, Y+25 ; 0x19 1bcfc: 0f 94 9b 48 call 0x29136 ; 0x29136 SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1bd00: 6a 2d mov r22, r10 1bd02: 7b 2d mov r23, r11 1bd04: 80 2f mov r24, r16 1bd06: 91 2f mov r25, r17 1bd08: a4 96 adiw r28, 0x24 ; 36 1bd0a: 0f b6 in r0, 0x3f ; 63 1bd0c: f8 94 cli 1bd0e: de bf out 0x3e, r29 ; 62 1bd10: 0f be out 0x3f, r0 ; 63 1bd12: cd bf out 0x3d, r28 ; 61 1bd14: df 91 pop r29 1bd16: cf 91 pop r28 1bd18: 1f 91 pop r17 1bd1a: 0f 91 pop r16 1bd1c: ff 90 pop r15 1bd1e: ef 90 pop r14 1bd20: df 90 pop r13 1bd22: cf 90 pop r12 1bd24: bf 90 pop r11 1bd26: af 90 pop r10 1bd28: 9f 90 pop r9 1bd2a: 8f 90 pop r8 1bd2c: 7f 90 pop r7 1bd2e: 6f 90 pop r6 1bd30: 5f 90 pop r5 1bd32: 4f 90 pop r4 1bd34: 3f 90 pop r3 1bd36: 2f 90 pop r2 1bd38: 08 95 ret 1bd3a: ff ef ldi r31, 0xFF ; 255 1bd3c: 2f 1a sub r2, r31 1bd3e: 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) { 1bd40: 2e e1 ldi r18, 0x1E ; 30 1bd42: 22 16 cp r2, r18 1bd44: 31 04 cpc r3, r1 1bd46: 09 f0 breq .+2 ; 0x1bd4a 1bd48: f9 ce rjmp .-526 ; 0x1bb3c thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1bd4a: 85 e3 ldi r24, 0x35 ; 53 1bd4c: 90 e9 ldi r25, 0x90 ; 144 1bd4e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc *var = orig; 1bd52: 89 a1 ldd r24, Y+33 ; 0x21 1bd54: 9a a1 ldd r25, Y+34 ; 0x22 1bd56: ab a1 ldd r26, Y+35 ; 0x23 1bd58: bc a1 ldd r27, Y+36 ; 0x24 1bd5a: e9 89 ldd r30, Y+17 ; 0x11 1bd5c: fa 89 ldd r31, Y+18 ; 0x12 1bd5e: 80 83 st Z, r24 1bd60: 91 83 std Z+1, r25 ; 0x01 1bd62: a2 83 std Z+2, r26 ; 0x02 1bd64: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bd66: 89 8d ldd r24, Y+25 ; 0x19 1bd68: 0f 94 9b 48 call 0x29136 ; 0x29136 return NAN; 1bd6c: a1 2c mov r10, r1 1bd6e: b1 2c mov r11, r1 1bd70: 00 ec ldi r16, 0xC0 ; 192 1bd72: 1f e7 ldi r17, 0x7F ; 127 1bd74: c5 cf rjmp .-118 ; 0x1bd00 0001bd76 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1bd76: ef 92 push r14 1bd78: ff 92 push r15 1bd7a: 0f 93 push r16 1bd7c: 1f 93 push r17 1bd7e: cf 93 push r28 1bd80: df 93 push r29 1bd82: 00 d0 rcall .+0 ; 0x1bd84 1bd84: 1f 92 push r1 1bd86: 1f 92 push r1 1bd88: cd b7 in r28, 0x3d ; 61 1bd8a: de b7 in r29, 0x3e ; 62 1bd8c: 08 2f mov r16, r24 1bd8e: 16 2f mov r17, r22 1bd90: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1bd92: 0f 94 4e 88 call 0x3109c ; 0x3109c 1bd96: 88 23 and r24, r24 1bd98: d9 f0 breq .+54 ; 0x1bdd0 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) { 1bd9a: 0b 30 cpi r16, 0x0B ; 11 1bd9c: 29 f1 breq .+74 ; 0x1bde8 1bd9e: 04 31 cpi r16, 0x14 ; 20 1bda0: 31 f1 breq .+76 ; 0x1bdee /// @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()) { 1bda2: 87 e5 ldi r24, 0x57 ; 87 1bda4: e8 2e mov r14, r24 1bda6: e9 82 std Y+1, r14 ; 0x01 1bda8: 0a 83 std Y+2, r16 ; 0x02 1bdaa: 1b 83 std Y+3, r17 ; 0x03 1bdac: fc 82 std Y+4, r15 ; 0x04 1bdae: ce 01 movw r24, r28 1bdb0: 01 96 adiw r24, 0x01 ; 1 1bdb2: 0f 94 e0 c2 call 0x385c0 ; 0x385c0 1bdb6: 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)); 1bdb8: 47 e5 ldi r20, 0x57 ; 87 1bdba: 50 2f mov r21, r16 1bdbc: 61 2f mov r22, r17 1bdbe: 7f 2d mov r23, r15 1bdc0: 0f 94 76 98 call 0x330ec ; 0x330ec 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)); 1bdc4: 60 e0 ldi r22, 0x00 ; 0 1bdc6: 80 e0 ldi r24, 0x00 ; 0 1bdc8: 0f 94 9a 9f call 0x33f34 ; 0x33f34 1bdcc: 88 23 and r24, r24 1bdce: 59 f3 breq .-42 ; 0x1bda6 return true; } 1bdd0: 0f 90 pop r0 1bdd2: 0f 90 pop r0 1bdd4: 0f 90 pop r0 1bdd6: 0f 90 pop r0 1bdd8: 0f 90 pop r0 1bdda: df 91 pop r29 1bddc: cf 91 pop r28 1bdde: 1f 91 pop r17 1bde0: 0f 91 pop r16 1bde2: ff 90 pop r15 1bde4: ef 90 pop r14 1bde6: 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); 1bde8: 10 93 73 13 sts 0x1373, r17 ; 0x801373 1bdec: da cf rjmp .-76 ; 0x1bda2 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1bdee: 10 93 74 13 sts 0x1374, r17 ; 0x801374 1bdf2: d7 cf rjmp .-82 ; 0x1bda2 0001bdf4 : #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) 1bdf4: 82 30 cpi r24, 0x02 ; 2 1bdf6: 91 05 cpc r25, r1 1bdf8: 38 f0 brcs .+14 ; 0x1be08 // 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 1bdfa: 88 0f add r24, r24 1bdfc: 99 1f adc r25, r25 1bdfe: 88 0f add r24, r24 1be00: 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, 1be02: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1be04: 01 97 sbiw r24, 0x01 ; 1 1be06: f1 f7 brne .-4 ; 0x1be04 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1be08: 08 95 ret 0001be0a : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1be0a: cf 93 push r28 1be0c: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1be0e: 28 2f mov r18, r24 1be10: 30 e0 ldi r19, 0x00 ; 0 1be12: f9 01 movw r30, r18 1be14: e8 5a subi r30, 0xA8 ; 168 1be16: f1 47 sbci r31, 0x71 ; 113 1be18: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1be1a: f9 01 movw r30, r18 1be1c: ee 5f subi r30, 0xFE ; 254 1be1e: f1 47 sbci r31, 0x71 ; 113 1be20: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1be22: f9 01 movw r30, r18 1be24: e4 55 subi r30, 0x54 ; 84 1be26: f2 47 sbci r31, 0x72 ; 114 1be28: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1be2a: cc 23 and r28, r28 1be2c: a1 f0 breq .+40 ; 0x1be56 // 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); 1be2e: 81 11 cpse r24, r1 1be30: 0e 94 7c cf call 0x19ef8 ; 0x19ef8 if (*portInputRegister(port) & bit) return HIGH; 1be34: ec 2f mov r30, r28 1be36: f0 e0 ldi r31, 0x00 ; 0 1be38: ee 0f add r30, r30 1be3a: ff 1f adc r31, r31 1be3c: ee 56 subi r30, 0x6E ; 110 1be3e: f2 47 sbci r31, 0x72 ; 114 1be40: a5 91 lpm r26, Z+ 1be42: b4 91 lpm r27, Z 1be44: ec 91 ld r30, X 1be46: ed 23 and r30, r29 1be48: 81 e0 ldi r24, 0x01 ; 1 1be4a: 90 e0 ldi r25, 0x00 ; 0 1be4c: 09 f4 brne .+2 ; 0x1be50 1be4e: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1be50: df 91 pop r29 1be52: cf 91 pop r28 1be54: 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; 1be56: 80 e0 ldi r24, 0x00 ; 0 1be58: 90 e0 ldi r25, 0x00 ; 0 1be5a: fa cf rjmp .-12 ; 0x1be50 0001be5c : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1be5c: 1f 93 push r17 1be5e: cf 93 push r28 1be60: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1be62: 28 2f mov r18, r24 1be64: 30 e0 ldi r19, 0x00 ; 0 1be66: f9 01 movw r30, r18 1be68: e8 5a subi r30, 0xA8 ; 168 1be6a: f1 47 sbci r31, 0x71 ; 113 1be6c: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1be6e: f9 01 movw r30, r18 1be70: ee 5f subi r30, 0xFE ; 254 1be72: f1 47 sbci r31, 0x71 ; 113 1be74: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1be76: f9 01 movw r30, r18 1be78: e4 55 subi r30, 0x54 ; 84 1be7a: f2 47 sbci r31, 0x72 ; 114 1be7c: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1be7e: cc 23 and r28, r28 1be80: a9 f0 breq .+42 ; 0x1beac 1be82: 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); 1be84: 81 11 cpse r24, r1 1be86: 0e 94 7c cf call 0x19ef8 ; 0x19ef8 out = portOutputRegister(port); 1be8a: ec 2f mov r30, r28 1be8c: f0 e0 ldi r31, 0x00 ; 0 1be8e: ee 0f add r30, r30 1be90: ff 1f adc r31, r31 1be92: e8 58 subi r30, 0x88 ; 136 1be94: f2 47 sbci r31, 0x72 ; 114 1be96: a5 91 lpm r26, Z+ 1be98: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1be9a: 8f b7 in r24, 0x3f ; 63 cli(); 1be9c: f8 94 cli if (val == LOW) { *out &= ~bit; 1be9e: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1bea0: 11 11 cpse r17, r1 1bea2: 08 c0 rjmp .+16 ; 0x1beb4 *out &= ~bit; 1bea4: d0 95 com r29 1bea6: de 23 and r29, r30 } else { *out |= bit; 1bea8: dc 93 st X, r29 } SREG = oldSREG; 1beaa: 8f bf out 0x3f, r24 ; 63 } 1beac: df 91 pop r29 1beae: cf 91 pop r28 1beb0: 1f 91 pop r17 1beb2: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1beb4: de 2b or r29, r30 1beb6: f8 cf rjmp .-16 ; 0x1bea8 0001beb8 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1beb8: cf 93 push r28 1beba: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1bebc: 90 e0 ldi r25, 0x00 ; 0 1bebe: fc 01 movw r30, r24 1bec0: ee 5f subi r30, 0xFE ; 254 1bec2: f1 47 sbci r31, 0x71 ; 113 1bec4: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1bec6: 84 55 subi r24, 0x54 ; 84 1bec8: 92 47 sbci r25, 0x72 ; 114 1beca: fc 01 movw r30, r24 1becc: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1bece: 88 23 and r24, r24 1bed0: d1 f0 breq .+52 ; 0x1bf06 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1bed2: 90 e0 ldi r25, 0x00 ; 0 1bed4: 88 0f add r24, r24 1bed6: 99 1f adc r25, r25 1bed8: fc 01 movw r30, r24 1beda: e2 5a subi r30, 0xA2 ; 162 1bedc: f2 47 sbci r31, 0x72 ; 114 1bede: a5 91 lpm r26, Z+ 1bee0: b4 91 lpm r27, Z out = portOutputRegister(port); 1bee2: fc 01 movw r30, r24 1bee4: e8 58 subi r30, 0x88 ; 136 1bee6: f2 47 sbci r31, 0x72 ; 114 1bee8: c5 91 lpm r28, Z+ 1beea: d4 91 lpm r29, Z if (mode == INPUT) { 1beec: 61 11 cpse r22, r1 1beee: 0e c0 rjmp .+28 ; 0x1bf0c uint8_t oldSREG = SREG; 1bef0: 9f b7 in r25, 0x3f ; 63 cli(); 1bef2: f8 94 cli *reg &= ~bit; 1bef4: 8c 91 ld r24, X 1bef6: e2 2f mov r30, r18 1bef8: e0 95 com r30 1befa: 8e 23 and r24, r30 1befc: 8c 93 st X, r24 *out &= ~bit; 1befe: 28 81 ld r18, Y 1bf00: e2 23 and r30, r18 1bf02: e8 83 st Y, r30 SREG = oldSREG; 1bf04: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1bf06: df 91 pop r29 1bf08: cf 91 pop r28 1bf0a: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1bf0c: 8f b7 in r24, 0x3f ; 63 cli(); 1bf0e: f8 94 cli *reg |= bit; 1bf10: ec 91 ld r30, X 1bf12: e2 2b or r30, r18 1bf14: ec 93 st X, r30 SREG = oldSREG; 1bf16: 8f bf out 0x3f, r24 ; 63 1bf18: f6 cf rjmp .-20 ; 0x1bf06 0001bf1a : // 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) { 1bf1a: 1f 93 push r17 1bf1c: cf 93 push r28 1bf1e: df 93 push r29 1bf20: 18 2f mov r17, r24 1bf22: 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); 1bf24: 61 e0 ldi r22, 0x01 ; 1 1bf26: 0e 94 5c df call 0x1beb8 ; 0x1beb8 if (val == 0) 1bf2a: 20 97 sbiw r28, 0x00 ; 0 1bf2c: 39 f4 brne .+14 ; 0x1bf3c { digitalWrite(pin, LOW); 1bf2e: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1bf30: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1bf32: df 91 pop r29 1bf34: cf 91 pop r28 1bf36: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1bf38: 0c 94 2e df jmp 0x1be5c ; 0x1be5c pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1bf3c: cf 3f cpi r28, 0xFF ; 255 1bf3e: d1 05 cpc r29, r1 1bf40: 11 f4 brne .+4 ; 0x1bf46 { digitalWrite(pin, HIGH); 1bf42: 61 e0 ldi r22, 0x01 ; 1 1bf44: f5 cf rjmp .-22 ; 0x1bf30 } else { switch(digitalPinToTimer(pin)) 1bf46: e1 2f mov r30, r17 1bf48: f0 e0 ldi r31, 0x00 ; 0 1bf4a: e8 5a subi r30, 0xA8 ; 168 1bf4c: f1 47 sbci r31, 0x71 ; 113 1bf4e: e4 91 lpm r30, Z 1bf50: e1 50 subi r30, 0x01 ; 1 1bf52: e2 31 cpi r30, 0x12 ; 18 1bf54: 08 f0 brcs .+2 ; 0x1bf58 1bf56: b3 c0 rjmp .+358 ; 0x1c0be 1bf58: f0 e0 ldi r31, 0x00 ; 0 1bf5a: 88 27 eor r24, r24 1bf5c: ed 54 subi r30, 0x4D ; 77 1bf5e: f0 42 sbci r31, 0x20 ; 32 1bf60: 8f 4f sbci r24, 0xFF ; 255 1bf62: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 1bf66: c5 df rcall .-118 ; 0x1bef2 1bf68: cd df rcall .-102 ; 0x1bf04 1bf6a: d2 df rcall .-92 ; 0x1bf10 1bf6c: dc df rcall .-72 ; 0x1bf26 1bf6e: e6 df rcall .-52 ; 0x1bf3c 1bf70: 5f e0 ldi r21, 0x0F ; 15 1bf72: f0 df rcall .-32 ; 0x1bf54 1bf74: f8 df rcall .-16 ; 0x1bf66 1bf76: 00 e0 ldi r16, 0x00 ; 0 1bf78: 0a e0 ldi r16, 0x0A ; 10 1bf7a: 14 e0 ldi r17, 0x04 ; 4 1bf7c: 1e e0 ldi r17, 0x0E ; 14 1bf7e: 2d e0 ldi r18, 0x0D ; 13 1bf80: 37 e0 ldi r19, 0x07 ; 7 1bf82: 5f e0 ldi r21, 0x0F ; 15 1bf84: 41 e0 ldi r20, 0x01 ; 1 1bf86: 4b e0 ldi r20, 0x0B ; 11 1bf88: 55 e0 ldi r21, 0x05 ; 5 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1bf8a: 84 b5 in r24, 0x24 ; 36 1bf8c: 80 68 ori r24, 0x80 ; 128 1bf8e: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1bf90: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1bf92: df 91 pop r29 1bf94: cf 91 pop r28 1bf96: 1f 91 pop r17 1bf98: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1bf9a: 84 b5 in r24, 0x24 ; 36 1bf9c: 80 62 ori r24, 0x20 ; 32 1bf9e: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1bfa0: c8 bd out 0x28, r28 ; 40 1bfa2: f7 cf rjmp .-18 ; 0x1bf92 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1bfa4: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bfa8: 80 68 ori r24, 0x80 ; 128 1bfaa: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1bfae: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1bfb2: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1bfb6: ed cf rjmp .-38 ; 0x1bf92 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1bfb8: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bfbc: 80 62 ori r24, 0x20 ; 32 1bfbe: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1bfc2: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1bfc6: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1bfca: e3 cf rjmp .-58 ; 0x1bf92 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1bfcc: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bfd0: 88 60 ori r24, 0x08 ; 8 1bfd2: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1bfd6: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1bfda: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1bfde: d9 cf rjmp .-78 ; 0x1bf92 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1bfe0: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1bfe4: 80 68 ori r24, 0x80 ; 128 1bfe6: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1bfea: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1bfee: d1 cf rjmp .-94 ; 0x1bf92 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1bff0: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1bff4: 80 62 ori r24, 0x20 ; 32 1bff6: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1bffa: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1bffe: c9 cf rjmp .-110 ; 0x1bf92 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1c000: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c004: 80 68 ori r24, 0x80 ; 128 1c006: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1c00a: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1c00e: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1c012: bf cf rjmp .-130 ; 0x1bf92 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1c014: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c018: 80 62 ori r24, 0x20 ; 32 1c01a: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1c01e: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1c022: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1c026: b5 cf rjmp .-150 ; 0x1bf92 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1c028: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c02c: 88 60 ori r24, 0x08 ; 8 1c02e: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1c032: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1c036: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1c03a: ab cf rjmp .-170 ; 0x1bf92 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1c03c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c040: 80 68 ori r24, 0x80 ; 128 1c042: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1c046: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c04a: 8f 7b andi r24, 0xBF ; 191 1c04c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1c050: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1c054: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1c058: 9c cf rjmp .-200 ; 0x1bf92 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1c05a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c05e: 80 62 ori r24, 0x20 ; 32 1c060: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1c064: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1c068: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1c06c: 92 cf rjmp .-220 ; 0x1bf92 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1c06e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c072: 88 60 ori r24, 0x08 ; 8 1c074: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1c078: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1c07c: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1c080: 88 cf rjmp .-240 ; 0x1bf92 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1c082: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c086: 80 68 ori r24, 0x80 ; 128 1c088: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1c08c: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1c090: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1c094: 7e cf rjmp .-260 ; 0x1bf92 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1c096: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c09a: 80 62 ori r24, 0x20 ; 32 1c09c: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1c0a0: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1c0a4: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1c0a8: 74 cf rjmp .-280 ; 0x1bf92 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1c0aa: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c0ae: 88 60 ori r24, 0x08 ; 8 1c0b0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1c0b4: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1c0b8: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1c0bc: 6a cf rjmp .-300 ; 0x1bf92 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1c0be: c0 38 cpi r28, 0x80 ; 128 1c0c0: d1 05 cpc r29, r1 1c0c2: 0c f0 brlt .+2 ; 0x1c0c6 1c0c4: 3e cf rjmp .-388 ; 0x1bf42 1c0c6: 33 cf rjmp .-410 ; 0x1bf2e 0001c0c8 : } } /// 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){ 1c0c8: 4f 92 push r4 1c0ca: 5f 92 push r5 1c0cc: 6f 92 push r6 1c0ce: 7f 92 push r7 1c0d0: 8f 92 push r8 1c0d2: 9f 92 push r9 1c0d4: af 92 push r10 1c0d6: bf 92 push r11 1c0d8: cf 92 push r12 1c0da: df 92 push r13 1c0dc: ef 92 push r14 1c0de: ff 92 push r15 1c0e0: 0f 93 push r16 1c0e2: 1f 93 push r17 1c0e4: cf 93 push r28 1c0e6: 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 1c0e8: 86 b9 out 0x06, r24 ; 6 1c0ea: fa 01 movw r30, r20 1c0ec: e0 80 ld r14, Z 1c0ee: 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){ 1c0f0: 16 16 cp r1, r22 1c0f2: 17 06 cpc r1, r23 1c0f4: b4 f4 brge .+44 ; 0x1c122 1c0f6: e2 16 cp r14, r18 1c0f8: f3 06 cpc r15, r19 1c0fa: 99 f4 brne .+38 ; 0x1c122 delayMicroseconds(delay_us); 1c0fc: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1c0fe: df 91 pop r29 1c100: cf 91 pop r28 1c102: 1f 91 pop r17 1c104: 0f 91 pop r16 1c106: ff 90 pop r15 1c108: ef 90 pop r14 1c10a: df 90 pop r13 1c10c: cf 90 pop r12 1c10e: bf 90 pop r11 1c110: af 90 pop r10 1c112: 9f 90 pop r9 1c114: 8f 90 pop r8 1c116: 7f 90 pop r7 1c118: 6f 90 pop r6 1c11a: 5f 90 pop r5 1c11c: 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); 1c11e: 0c 94 fa de jmp 0x1bdf4 ; 0x1bdf4 1c122: 89 01 movw r16, r18 1c124: 6a 01 movw r12, r20 1c126: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1c128: b7 01 movw r22, r14 1c12a: 90 e0 ldi r25, 0x00 ; 0 1c12c: 80 e0 ldi r24, 0x00 ; 0 1c12e: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 1c132: 2d eb ldi r18, 0xBD ; 189 1c134: 37 e3 ldi r19, 0x37 ; 55 1c136: 46 e8 ldi r20, 0x86 ; 134 1c138: 55 e3 ldi r21, 0x35 ; 53 1c13a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1c13e: 4b 01 movw r8, r22 1c140: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1c142: be 01 movw r22, r28 1c144: 0d 2e mov r0, r29 1c146: 00 0c add r0, r0 1c148: 88 0b sbc r24, r24 1c14a: 99 0b sbc r25, r25 1c14c: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1c150: a5 01 movw r20, r10 1c152: 94 01 movw r18, r8 1c154: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1c158: 2b 01 movw r4, r22 1c15a: 3c 01 movw r6, r24 1c15c: a5 01 movw r20, r10 1c15e: 94 01 movw r18, r8 1c160: 6a e0 ldi r22, 0x0A ; 10 1c162: 77 ed ldi r23, 0xD7 ; 215 1c164: 83 e2 ldi r24, 0x23 ; 35 1c166: 9c e3 ldi r25, 0x3C ; 60 1c168: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1c16c: 9b 01 movw r18, r22 1c16e: ac 01 movw r20, r24 1c170: c3 01 movw r24, r6 1c172: b2 01 movw r22, r4 1c174: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1c178: 4b 01 movw r8, r22 1c17a: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1c17c: 2a e0 ldi r18, 0x0A ; 10 1c17e: 37 ed ldi r19, 0xD7 ; 215 1c180: 43 e2 ldi r20, 0x23 ; 35 1c182: 5e e3 ldi r21, 0x3E ; 62 1c184: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1c188: 18 16 cp r1, r24 1c18a: dc f5 brge .+118 ; 0x1c202 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)); 1c18c: a5 01 movw r20, r10 1c18e: 94 01 movw r18, r8 1c190: 6a e0 ldi r22, 0x0A ; 10 1c192: 77 ed ldi r23, 0xD7 ; 215 1c194: 83 e2 ldi r24, 0x23 ; 35 1c196: 9c e3 ldi r25, 0x3C ; 60 1c198: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1c19c: 20 e0 ldi r18, 0x00 ; 0 1c19e: 34 e2 ldi r19, 0x24 ; 36 1c1a0: 44 e7 ldi r20, 0x74 ; 116 1c1a2: 59 e4 ldi r21, 0x49 ; 73 1c1a4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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); 1c1a8: 20 e0 ldi r18, 0x00 ; 0 1c1aa: 30 e0 ldi r19, 0x00 ; 0 1c1ac: 40 e0 ldi r20, 0x00 ; 0 1c1ae: 5f e3 ldi r21, 0x3F ; 63 1c1b0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1c1b4: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 1c1b8: 5b 01 movw r10, r22 1c1ba: 60 17 cp r22, r16 1c1bc: 71 07 cpc r23, r17 1c1be: 08 f4 brcc .+2 ; 0x1c1c2 1c1c0: 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){ 1c1c2: ea 14 cp r14, r10 1c1c4: fb 04 cpc r15, r11 1c1c6: 31 f4 brne .+12 ; 0x1c1d4 1c1c8: 20 97 sbiw r28, 0x00 ; 0 1c1ca: 21 f0 breq .+8 ; 0x1c1d4 if (acc > 0) 1c1cc: fc f0 brlt .+62 ; 0x1c20c t1--; 1c1ce: f1 e0 ldi r31, 0x01 ; 1 1c1d0: af 1a sub r10, r31 1c1d2: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1c1d4: c5 01 movw r24, r10 1c1d6: 0e 94 fa de call 0x1bdf4 ; 0x1bdf4 delay_us = t1; 1c1da: f6 01 movw r30, r12 1c1dc: b1 82 std Z+1, r11 ; 0x01 1c1de: a0 82 st Z, r10 } 1c1e0: df 91 pop r29 1c1e2: cf 91 pop r28 1c1e4: 1f 91 pop r17 1c1e6: 0f 91 pop r16 1c1e8: ff 90 pop r15 1c1ea: ef 90 pop r14 1c1ec: df 90 pop r13 1c1ee: cf 90 pop r12 1c1f0: bf 90 pop r11 1c1f2: af 90 pop r10 1c1f4: 9f 90 pop r9 1c1f6: 8f 90 pop r8 1c1f8: 7f 90 pop r7 1c1fa: 6f 90 pop r6 1c1fc: 5f 90 pop r5 1c1fe: 4f 90 pop r4 1c200: 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 1c202: 80 e1 ldi r24, 0x10 ; 16 1c204: a8 2e mov r10, r24 1c206: 87 e2 ldi r24, 0x27 ; 39 1c208: b8 2e mov r11, r24 1c20a: db cf rjmp .-74 ; 0x1c1c2 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1c20c: 8f ef ldi r24, 0xFF ; 255 1c20e: a8 1a sub r10, r24 1c210: b8 0a sbc r11, r24 1c212: e0 cf rjmp .-64 ; 0x1c1d4 0001c214 : /// 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){ 1c214: 2f 92 push r2 1c216: 3f 92 push r3 1c218: 4f 92 push r4 1c21a: 5f 92 push r5 1c21c: 6f 92 push r6 1c21e: 7f 92 push r7 1c220: 8f 92 push r8 1c222: 9f 92 push r9 1c224: af 92 push r10 1c226: bf 92 push r11 1c228: cf 92 push r12 1c22a: df 92 push r13 1c22c: ef 92 push r14 1c22e: ff 92 push r15 1c230: 0f 93 push r16 1c232: 1f 93 push r17 1c234: cf 93 push r28 1c236: df 93 push r29 1c238: 00 d0 rcall .+0 ; 0x1c23a 1c23a: cd b7 in r28, 0x3d ; 61 1c23c: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1c23e: f9 01 movw r30, r18 1c240: e0 80 ld r14, Z 1c242: f1 80 ldd r15, Z+1 ; 0x01 1c244: e1 14 cp r14, r1 1c246: f1 04 cpc r15, r1 1c248: 09 f4 brne .+2 ; 0x1c24c 1c24a: 6b c0 rjmp .+214 ; 0x1c322 1c24c: 16 16 cp r1, r22 1c24e: 17 06 cpc r1, r23 1c250: 0c f0 brlt .+2 ; 0x1c254 1c252: 67 c0 rjmp .+206 ; 0x1c322 1c254: 19 01 movw r2, r18 1c256: 5b 83 std Y+3, r21 ; 0x03 1c258: 4a 83 std Y+2, r20 ; 0x02 1c25a: 6b 01 movw r12, r22 1c25c: 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)); 1c25e: fa 01 movw r30, r20 1c260: 00 81 ld r16, Z 1c262: 11 81 ldd r17, Z+1 ; 0x01 1c264: b8 01 movw r22, r16 1c266: 90 e0 ldi r25, 0x00 ; 0 1c268: 80 e0 ldi r24, 0x00 ; 0 1c26a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 1c26e: 4b 01 movw r8, r22 1c270: 5c 01 movw r10, r24 1c272: b6 01 movw r22, r12 1c274: 0d 2c mov r0, r13 1c276: 00 0c add r0, r0 1c278: 88 0b sbc r24, r24 1c27a: 99 0b sbc r25, r25 1c27c: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1c280: 2b 01 movw r4, r22 1c282: 3c 01 movw r6, r24 1c284: a5 01 movw r20, r10 1c286: 94 01 movw r18, r8 1c288: c5 01 movw r24, r10 1c28a: b4 01 movw r22, r8 1c28c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1c290: 9b 01 movw r18, r22 1c292: ac 01 movw r20, r24 1c294: c3 01 movw r24, r6 1c296: b2 01 movw r22, r4 1c298: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1c29c: 9b 01 movw r18, r22 1c29e: ac 01 movw r20, r24 1c2a0: 6a e0 ldi r22, 0x0A ; 10 1c2a2: 77 ed ldi r23, 0xD7 ; 215 1c2a4: 83 ea ldi r24, 0xA3 ; 163 1c2a6: 9b e3 ldi r25, 0x3B ; 59 1c2a8: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__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); 1c2ac: 20 e0 ldi r18, 0x00 ; 0 1c2ae: 30 e0 ldi r19, 0x00 ; 0 1c2b0: 40 e0 ldi r20, 0x00 ; 0 1c2b2: 5f e3 ldi r21, 0x3F ; 63 1c2b4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1c2b8: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__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){ 1c2bc: 6e 15 cp r22, r14 1c2be: 7f 05 cpc r23, r15 1c2c0: 28 f5 brcc .+74 ; 0x1c30c 1c2c2: f9 81 ldd r31, Y+1 ; 0x01 1c2c4: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1c2c6: ea 81 ldd r30, Y+2 ; 0x02 1c2c8: fb 81 ldd r31, Y+3 ; 0x03 1c2ca: 80 81 ld r24, Z 1c2cc: 91 81 ldd r25, Z+1 ; 0x01 1c2ce: 0e 94 fa de call 0x1bdf4 ; 0x1bdf4 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1c2d2: f1 01 movw r30, r2 1c2d4: 80 81 ld r24, Z 1c2d6: 91 81 ldd r25, Z+1 ; 0x01 1c2d8: 01 97 sbiw r24, 0x01 ; 1 1c2da: 91 83 std Z+1, r25 ; 0x01 1c2dc: 80 83 st Z, r24 return true; 1c2de: 81 e0 ldi r24, 0x01 ; 1 } 1c2e0: 0f 90 pop r0 1c2e2: 0f 90 pop r0 1c2e4: 0f 90 pop r0 1c2e6: df 91 pop r29 1c2e8: cf 91 pop r28 1c2ea: 1f 91 pop r17 1c2ec: 0f 91 pop r16 1c2ee: ff 90 pop r15 1c2f0: ef 90 pop r14 1c2f2: df 90 pop r13 1c2f4: cf 90 pop r12 1c2f6: bf 90 pop r11 1c2f8: af 90 pop r10 1c2fa: 9f 90 pop r9 1c2fc: 8f 90 pop r8 1c2fe: 7f 90 pop r7 1c300: 6f 90 pop r6 1c302: 5f 90 pop r5 1c304: 4f 90 pop r4 1c306: 3f 90 pop r3 1c308: 2f 90 pop r2 1c30a: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1c30c: 66 27 eor r22, r22 1c30e: 77 27 eor r23, r23 1c310: 6c 19 sub r22, r12 1c312: 7d 09 sbc r23, r13 1c314: 98 01 movw r18, r16 1c316: 4a 81 ldd r20, Y+2 ; 0x02 1c318: 5b 81 ldd r21, Y+3 ; 0x03 1c31a: 89 81 ldd r24, Y+1 ; 0x01 1c31c: 0e 94 64 e0 call 0x1c0c8 ; 0x1c0c8 1c320: d8 cf rjmp .-80 ; 0x1c2d2 /// 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; 1c322: 80 e0 ldi r24, 0x00 ; 0 1c324: dd cf rjmp .-70 ; 0x1c2e0 0001c326 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1c326: 0f 93 push r16 1c328: 1f 93 push r17 1c32a: cf 93 push r28 1c32c: df 93 push r29 1c32e: 18 2f mov r17, r24 1c330: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c332: d1 e0 ldi r29, 0x01 ; 1 1c334: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1c336: 81 2f mov r24, r17 1c338: 8d 23 and r24, r29 1c33a: 29 f0 breq .+10 ; 0x1c346 sm4_set_dir(i, dir & mask); 1c33c: 60 2f mov r22, r16 1c33e: 6d 23 and r22, r29 1c340: 8c 2f mov r24, r28 1c342: 0f 94 6f 6b call 0x2d6de ; 0x2d6de } } } 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) { 1c346: cf 5f subi r28, 0xFF ; 255 1c348: dd 0f add r29, r29 1c34a: c3 30 cpi r28, 0x03 ; 3 1c34c: a1 f7 brne .-24 ; 0x1c336 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1c34e: df 91 pop r29 1c350: cf 91 pop r28 1c352: 1f 91 pop r17 1c354: 0f 91 pop r16 1c356: 08 95 ret 0001c358 : //@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) { 1c358: 8f 92 push r8 1c35a: 9f 92 push r9 1c35c: af 92 push r10 1c35e: bf 92 push r11 1c360: cf 92 push r12 1c362: df 92 push r13 1c364: ef 92 push r14 1c366: ff 92 push r15 1c368: 30 e0 ldi r19, 0x00 ; 0 1c36a: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c36c: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1c36e: 48 2f mov r20, r24 1c370: 49 23 and r20, r25 1c372: 19 f1 breq .+70 ; 0x1c3ba count_position[i] += dir & mask ? -1L : 1L; 1c374: a9 01 movw r20, r18 1c376: 44 0f add r20, r20 1c378: 55 1f adc r21, r21 1c37a: 44 0f add r20, r20 1c37c: 55 1f adc r21, r21 1c37e: fa 01 movw r30, r20 1c380: ee 59 subi r30, 0x9E ; 158 1c382: f8 4f sbci r31, 0xF8 ; 248 1c384: c0 80 ld r12, Z 1c386: d1 80 ldd r13, Z+1 ; 0x01 1c388: e2 80 ldd r14, Z+2 ; 0x02 1c38a: f3 80 ldd r15, Z+3 ; 0x03 1c38c: 76 2f mov r23, r22 1c38e: 79 23 and r23, r25 1c390: 81 2c mov r8, r1 1c392: 91 2c mov r9, r1 1c394: 54 01 movw r10, r8 1c396: 83 94 inc r8 1c398: 77 23 and r23, r23 1c39a: 21 f0 breq .+8 ; 0x1c3a4 1c39c: 88 24 eor r8, r8 1c39e: 8a 94 dec r8 1c3a0: 98 2c mov r9, r8 1c3a2: 54 01 movw r10, r8 1c3a4: c8 0c add r12, r8 1c3a6: d9 1c adc r13, r9 1c3a8: ea 1c adc r14, r10 1c3aa: fb 1c adc r15, r11 1c3ac: 4e 59 subi r20, 0x9E ; 158 1c3ae: 58 4f sbci r21, 0xF8 ; 248 1c3b0: fa 01 movw r30, r20 1c3b2: c0 82 st Z, r12 1c3b4: d1 82 std Z+1, r13 ; 0x01 1c3b6: e2 82 std Z+2, r14 ; 0x02 1c3b8: 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) { 1c3ba: 99 0f add r25, r25 1c3bc: 2f 5f subi r18, 0xFF ; 255 1c3be: 3f 4f sbci r19, 0xFF ; 255 1c3c0: 23 30 cpi r18, 0x03 ; 3 1c3c2: 31 05 cpc r19, r1 1c3c4: a1 f6 brne .-88 ; 0x1c36e if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1c3c6: ff 90 pop r15 1c3c8: ef 90 pop r14 1c3ca: df 90 pop r13 1c3cc: cf 90 pop r12 1c3ce: bf 90 pop r11 1c3d0: af 90 pop r10 1c3d2: 9f 90 pop r9 1c3d4: 8f 90 pop r8 1c3d6: 08 95 ret 0001c3d8 : /// 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) { 1c3d8: 2f 92 push r2 1c3da: 3f 92 push r3 1c3dc: 4f 92 push r4 1c3de: 5f 92 push r5 1c3e0: 6f 92 push r6 1c3e2: 7f 92 push r7 1c3e4: 8f 92 push r8 1c3e6: 9f 92 push r9 1c3e8: af 92 push r10 1c3ea: bf 92 push r11 1c3ec: cf 92 push r12 1c3ee: df 92 push r13 1c3f0: ef 92 push r14 1c3f2: ff 92 push r15 1c3f4: 0f 93 push r16 1c3f6: 1f 93 push r17 1c3f8: cf 93 push r28 1c3fa: df 93 push r29 1c3fc: 00 d0 rcall .+0 ; 0x1c3fe 1c3fe: 00 d0 rcall .+0 ; 0x1c400 1c400: cd b7 in r28, 0x3d ; 61 1c402: 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]; 1c404: c0 90 62 07 lds r12, 0x0762 ; 0x800762 1c408: d0 90 63 07 lds r13, 0x0763 ; 0x800763 1c40c: e0 90 64 07 lds r14, 0x0764 ; 0x800764 1c410: f0 90 65 07 lds r15, 0x0765 ; 0x800765 1c414: 7c 01 movw r14, r24 1c416: ec 18 sub r14, r12 1c418: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1c41a: 80 91 66 07 lds r24, 0x0766 ; 0x800766 1c41e: 90 91 67 07 lds r25, 0x0767 ; 0x800767 1c422: a0 91 68 07 lds r26, 0x0768 ; 0x800768 1c426: b0 91 69 07 lds r27, 0x0769 ; 0x800769 1c42a: 68 1b sub r22, r24 1c42c: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1c42e: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 1c432: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 1c436: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 1c43a: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 1c43e: fa 01 movw r30, r20 1c440: e8 1b sub r30, r24 1c442: f9 0b sbc r31, r25 1c444: fa 83 std Y+2, r31 ; 0x02 1c446: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1c448: fb 01 movw r30, r22 1c44a: ff 0f add r31, r31 1c44c: ee 0b sbc r30, r30 1c44e: ff 0f add r31, r31 1c450: fe 2f mov r31, r30 1c452: ee 1f adc r30, r30 1c454: e2 70 andi r30, 0x02 ; 2 1c456: 89 81 ldd r24, Y+1 ; 0x01 1c458: 9a 81 ldd r25, Y+2 ; 0x02 1c45a: 88 e0 ldi r24, 0x08 ; 8 1c45c: 98 02 muls r25, r24 1c45e: 81 2d mov r24, r1 1c460: 99 0b sbc r25, r25 1c462: 11 24 eor r1, r1 1c464: 84 70 andi r24, 0x04 ; 4 1c466: e8 2b or r30, r24 1c468: 8f 2d mov r24, r15 1c46a: 88 1f adc r24, r24 1c46c: 88 27 eor r24, r24 1c46e: 88 1f adc r24, r24 1c470: e8 2b or r30, r24 1c472: e0 93 f9 03 sts 0x03F9, r30 ; 0x8003f9 asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1c476: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1c47a: 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; 1c47c: 8a e0 ldi r24, 0x0A ; 10 1c47e: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1c480: e0 fd sbrc r30, 0 1c482: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1c484: e1 fd sbrc r30, 1 1c486: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1c488: e2 fd sbrc r30, 2 1c48a: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1c48c: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1c48e: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1c492: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1c494: 83 ee ldi r24, 0xE3 ; 227 1c496: 9f ec ldi r25, 0xCF ; 207 1c498: 01 11 cpse r16, r1 1c49a: 02 c0 rjmp .+4 ; 0x1c4a0 1c49c: 90 e0 ldi r25, 0x00 ; 0 1c49e: 80 e0 ldi r24, 0x00 ; 0 1c4a0: 90 93 67 05 sts 0x0567, r25 ; 0x800567 1c4a4: 80 93 66 05 sts 0x0566, r24 ; 0x800566 xyzcal_sm4_delay = delay_us; 1c4a8: 30 93 f8 03 sts 0x03F8, r19 ; 0x8003f8 1c4ac: 20 93 f7 03 sts 0x03F7, r18 ; 0x8003f7 // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1c4b0: 29 81 ldd r18, Y+1 ; 0x01 1c4b2: 3a 81 ldd r19, Y+2 ; 0x02 1c4b4: 3e 83 std Y+6, r19 ; 0x06 1c4b6: 2d 83 std Y+5, r18 ; 0x05 1c4b8: 37 ff sbrs r19, 7 1c4ba: 05 c0 rjmp .+10 ; 0x1c4c6 1c4bc: 31 95 neg r19 1c4be: 21 95 neg r18 1c4c0: 31 09 sbc r19, r1 1c4c2: 3e 83 std Y+6, r19 ; 0x06 1c4c4: 2d 83 std Y+5, r18 ; 0x05 1c4c6: 8b 01 movw r16, r22 1c4c8: 77 ff sbrs r23, 7 1c4ca: 03 c0 rjmp .+6 ; 0x1c4d2 1c4cc: 11 95 neg r17 1c4ce: 01 95 neg r16 1c4d0: 11 09 sbc r17, r1 1c4d2: f7 fe sbrs r15, 7 1c4d4: 03 c0 rjmp .+6 ; 0x1c4dc 1c4d6: f1 94 neg r15 1c4d8: e1 94 neg r14 1c4da: 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); 1c4dc: 98 01 movw r18, r16 1c4de: d8 01 movw r26, r16 1c4e0: 0f 94 a1 de call 0x3bd42 ; 0x3bd42 <__mulhisi3> 1c4e4: 4b 01 movw r8, r22 1c4e6: 5c 01 movw r10, r24 1c4e8: 2d 81 ldd r18, Y+5 ; 0x05 1c4ea: 3e 81 ldd r19, Y+6 ; 0x06 1c4ec: d9 01 movw r26, r18 1c4ee: 0f 94 a1 de call 0x3bd42 ; 0x3bd42 <__mulhisi3> 1c4f2: 86 0e add r8, r22 1c4f4: 97 1e adc r9, r23 1c4f6: a8 1e adc r10, r24 1c4f8: b9 1e adc r11, r25 1c4fa: 97 01 movw r18, r14 1c4fc: d7 01 movw r26, r14 1c4fe: 0f 94 a1 de call 0x3bd42 ; 0x3bd42 <__mulhisi3> 1c502: 68 0d add r22, r8 1c504: 79 1d adc r23, r9 1c506: 8a 1d adc r24, r10 1c508: 9b 1d adc r25, r11 1c50a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 1c50e: 0f 94 7f e2 call 0x3c4fe ; 0x3c4fe 1c512: 20 e0 ldi r18, 0x00 ; 0 1c514: 30 e0 ldi r19, 0x00 ; 0 1c516: 40 e0 ldi r20, 0x00 ; 0 1c518: 5f e3 ldi r21, 0x3F ; 63 1c51a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1c51e: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 1c522: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1c524: 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; 1c526: 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; 1c528: 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; 1c52a: 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; 1c52c: 1c 82 std Y+4, r1 ; 0x04 1c52e: 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; 1c530: 31 2c mov r3, r1 1c532: 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; 1c534: 1a 82 std Y+2, r1 ; 0x02 1c536: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1c538: 61 14 cp r6, r1 1c53a: 71 04 cpc r7, r1 1c53c: 09 f4 brne .+2 ; 0x1c540 1c53e: 47 c0 rjmp .+142 ; 0x1c5ce if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1c540: e0 91 66 05 lds r30, 0x0566 ; 0x800566 1c544: f0 91 67 05 lds r31, 0x0567 ; 0x800567 1c548: 30 97 sbiw r30, 0x00 ; 0 1c54a: e9 f5 brne .+122 ; 0x1c5c6 uint8_t sm = 0; //step mask 1c54c: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1c54e: ec 14 cp r14, r12 1c550: fd 04 cpc r15, r13 1c552: 40 f0 brcs .+16 ; 0x1c564 sm |= 1; cx += dd; 1c554: c4 0c add r12, r4 1c556: d5 1c adc r13, r5 x++; 1c558: 89 81 ldd r24, Y+1 ; 0x01 1c55a: 9a 81 ldd r25, Y+2 ; 0x02 1c55c: 01 96 adiw r24, 0x01 ; 1 1c55e: 9a 83 std Y+2, r25 ; 0x02 1c560: 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; 1c562: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1c564: 0a 15 cp r16, r10 1c566: 1b 05 cpc r17, r11 1c568: 30 f0 brcs .+12 ; 0x1c576 sm |= 2; 1c56a: 82 60 ori r24, 0x02 ; 2 cy += dd; 1c56c: a4 0c add r10, r4 1c56e: b5 1c adc r11, r5 y++; 1c570: 9f ef ldi r25, 0xFF ; 255 1c572: 29 1a sub r2, r25 1c574: 39 0a sbc r3, r25 } if (cz <= dz){ 1c576: ed 81 ldd r30, Y+5 ; 0x05 1c578: fe 81 ldd r31, Y+6 ; 0x06 1c57a: e8 15 cp r30, r8 1c57c: f9 05 cpc r31, r9 1c57e: 48 f0 brcs .+18 ; 0x1c592 sm |= 4; 1c580: 84 60 ori r24, 0x04 ; 4 cz += dd; 1c582: 84 0c add r8, r4 1c584: 95 1c adc r9, r5 z++; 1c586: 2b 81 ldd r18, Y+3 ; 0x03 1c588: 3c 81 ldd r19, Y+4 ; 0x04 1c58a: 2f 5f subi r18, 0xFF ; 255 1c58c: 3f 4f sbci r19, 0xFF ; 255 1c58e: 3c 83 std Y+4, r19 ; 0x04 1c590: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1c592: ce 18 sub r12, r14 1c594: df 08 sbc r13, r15 cy -= dy; 1c596: a0 1a sub r10, r16 1c598: b1 0a sbc r11, r17 cz -= dz; 1c59a: ed 81 ldd r30, Y+5 ; 0x05 1c59c: fe 81 ldd r31, Y+6 ; 0x06 1c59e: 8e 1a sub r8, r30 1c5a0: 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 1c5a2: 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); 1c5a4: e0 91 62 05 lds r30, 0x0562 ; 0x800562 1c5a8: f0 91 63 05 lds r31, 0x0563 ; 0x800563 1c5ac: 30 97 sbiw r30, 0x00 ; 0 1c5ae: d1 f1 breq .+116 ; 0x1c624 1c5b0: b2 01 movw r22, r4 1c5b2: c3 01 movw r24, r6 1c5b4: 19 95 eicall if (delay) delayMicroseconds(delay); 1c5b6: 00 97 sbiw r24, 0x00 ; 0 1c5b8: 11 f0 breq .+4 ; 0x1c5be 1c5ba: 0e 94 fa de call 0x1bdf4 ; 0x1bdf4 nd--; 1c5be: f1 e0 ldi r31, 0x01 ; 1 1c5c0: 6f 1a sub r6, r31 1c5c2: 71 08 sbc r7, r1 1c5c4: b9 cf rjmp .-142 ; 0x1c538 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; 1c5c6: 19 95 eicall 1c5c8: 88 23 and r24, r24 1c5ca: 09 f4 brne .+2 ; 0x1c5ce 1c5cc: bf cf rjmp .-130 ; 0x1c54c 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) 1c5ce: e0 91 64 05 lds r30, 0x0564 ; 0x800564 1c5d2: f0 91 65 05 lds r31, 0x0565 ; 0x800565 1c5d6: 30 97 sbiw r30, 0x00 ; 0 1c5d8: 41 f0 breq .+16 ; 0x1c5ea (*sm4_update_pos_cb)(x, y, z, 0); 1c5da: 30 e0 ldi r19, 0x00 ; 0 1c5dc: 20 e0 ldi r18, 0x00 ; 0 1c5de: 4b 81 ldd r20, Y+3 ; 0x03 1c5e0: 5c 81 ldd r21, Y+4 ; 0x04 1c5e2: b1 01 movw r22, r2 1c5e4: 89 81 ldd r24, Y+1 ; 0x01 1c5e6: 9a 81 ldd r25, Y+2 ; 0x02 1c5e8: 19 95 eicall 1c5ea: 81 e0 ldi r24, 0x01 ; 1 1c5ec: 67 28 or r6, r7 1c5ee: 09 f4 brne .+2 ; 0x1c5f2 1c5f0: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1c5f2: 26 96 adiw r28, 0x06 ; 6 1c5f4: 0f b6 in r0, 0x3f ; 63 1c5f6: f8 94 cli 1c5f8: de bf out 0x3e, r29 ; 62 1c5fa: 0f be out 0x3f, r0 ; 63 1c5fc: cd bf out 0x3d, r28 ; 61 1c5fe: df 91 pop r29 1c600: cf 91 pop r28 1c602: 1f 91 pop r17 1c604: 0f 91 pop r16 1c606: ff 90 pop r15 1c608: ef 90 pop r14 1c60a: df 90 pop r13 1c60c: cf 90 pop r12 1c60e: bf 90 pop r11 1c610: af 90 pop r10 1c612: 9f 90 pop r9 1c614: 8f 90 pop r8 1c616: 7f 90 pop r7 1c618: 6f 90 pop r6 1c61a: 5f 90 pop r5 1c61c: 4f 90 pop r4 1c61e: 3f 90 pop r3 1c620: 2f 90 pop r2 1c622: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1c624: 84 ef ldi r24, 0xF4 ; 244 1c626: 91 e0 ldi r25, 0x01 ; 1 1c628: c8 cf rjmp .-112 ; 0x1c5ba 0001c62a : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1c62a: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1c62c: 0d b4 in r0, 0x2d ; 45 1c62e: 07 fe sbrs r0, 7 1c630: fd cf rjmp .-6 ; 0x1c62c return SPDR; 1c632: 8e b5 in r24, 0x2e ; 46 } 1c634: 08 95 ret 0001c636 : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1c636: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1c638: 85 e0 ldi r24, 0x05 ; 5 1c63a: 0e 94 15 e3 call 0x1c62a ; 0x1c62a uint8_t val = _SPI_RX(); // receive value 1c63e: 8f ef ldi r24, 0xFF ; 255 1c640: 0e 94 15 e3 call 0x1c62a ; 0x1c62a _CS_HIGH(); 1c644: 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) ; 1c646: 80 fd sbrc r24, 0 1c648: f6 cf rjmp .-20 ; 0x1c636 } 1c64a: 08 95 ret 0001c64c : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1c64c: 1f 93 push r17 1c64e: cf 93 push r28 1c650: df 93 push r29 1c652: ea 01 movw r28, r20 1c654: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1c656: 0e 94 15 e3 call 0x1c62a ; 0x1c62a _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1c65a: 81 2f mov r24, r17 1c65c: 0e 94 15 e3 call 0x1c62a ; 0x1c62a _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1c660: 8d 2f mov r24, r29 1c662: 0e 94 15 e3 call 0x1c62a ; 0x1c62a _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1c666: 8c 2f mov r24, r28 } 1c668: df 91 pop r29 1c66a: cf 91 pop r28 1c66c: 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 1c66e: 0c 94 15 e3 jmp 0x1c62a ; 0x1c62a 0001c672 : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1c672: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1c674: 0e 94 26 e3 call 0x1c64c ; 0x1c64c _CS_HIGH(); 1c678: 45 9a sbi 0x08, 5 ; 8 } 1c67a: 08 95 ret 0001c67c : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1c67c: ef 92 push r14 1c67e: ff 92 push r15 1c680: 0f 93 push r16 1c682: 1f 93 push r17 1c684: cf 93 push r28 1c686: df 93 push r29 1c688: 7a 01 movw r14, r20 1c68a: 89 01 movw r16, r18 _CS_LOW(); 1c68c: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c68e: ab 01 movw r20, r22 1c690: bc 01 movw r22, r24 1c692: 82 e0 ldi r24, 0x02 ; 2 1c694: 0e 94 26 e3 call 0x1c64c ; 0x1c64c 1c698: e7 01 movw r28, r14 1c69a: 0e 0d add r16, r14 1c69c: 1f 1d adc r17, r15 while (cnt--) // send data 1c69e: c0 17 cp r28, r16 1c6a0: d1 07 cpc r29, r17 1c6a2: 41 f4 brne .+16 ; 0x1c6b4 _SPI_TX(*(data++)); _CS_HIGH(); 1c6a4: 45 9a sbi 0x08, 5 ; 8 } 1c6a6: df 91 pop r29 1c6a8: cf 91 pop r28 1c6aa: 1f 91 pop r17 1c6ac: 0f 91 pop r16 1c6ae: ff 90 pop r15 1c6b0: ef 90 pop r14 1c6b2: 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++)); 1c6b4: 89 91 ld r24, Y+ 1c6b6: 0e 94 15 e3 call 0x1c62a ; 0x1c62a 1c6ba: f1 cf rjmp .-30 ; 0x1c69e 0001c6bc : _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) { 1c6bc: ef 92 push r14 1c6be: ff 92 push r15 1c6c0: 0f 93 push r16 1c6c2: 1f 93 push r17 1c6c4: cf 93 push r28 1c6c6: df 93 push r29 1c6c8: 7a 01 movw r14, r20 1c6ca: 89 01 movw r16, r18 _CS_LOW(); 1c6cc: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1c6ce: ab 01 movw r20, r22 1c6d0: bc 01 movw r22, r24 1c6d2: 83 e0 ldi r24, 0x03 ; 3 1c6d4: 0e 94 26 e3 call 0x1c64c ; 0x1c64c 1c6d8: e7 01 movw r28, r14 1c6da: 0e 0d add r16, r14 1c6dc: 1f 1d adc r17, r15 while (cnt--) // receive data 1c6de: c0 17 cp r28, r16 1c6e0: d1 07 cpc r29, r17 1c6e2: 41 f4 brne .+16 ; 0x1c6f4 *(data++) = _SPI_RX(); _CS_HIGH(); 1c6e4: 45 9a sbi 0x08, 5 ; 8 } 1c6e6: df 91 pop r29 1c6e8: cf 91 pop r28 1c6ea: 1f 91 pop r17 1c6ec: 0f 91 pop r16 1c6ee: ff 90 pop r15 1c6f0: ef 90 pop r14 1c6f2: 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(); 1c6f4: 8f ef ldi r24, 0xFF ; 255 1c6f6: 0e 94 15 e3 call 0x1c62a ; 0x1c62a 1c6fa: 89 93 st Y+, r24 1c6fc: f0 cf rjmp .-32 ; 0x1c6de 0001c6fe : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1c6fe: 0f 93 push r16 1c700: 1f 93 push r17 1c702: cf 93 push r28 1c704: df 93 push r29 1c706: 00 d0 rcall .+0 ; 0x1c708 1c708: 1f 92 push r1 1c70a: cd b7 in r28, 0x3d ; 61 1c70c: de b7 in r29, 0x3e ; 62 1c70e: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c710: 8c e5 ldi r24, 0x5C ; 92 1c712: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c714: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1c716: 24 e0 ldi r18, 0x04 ; 4 1c718: 30 e0 ldi r19, 0x00 ; 0 1c71a: ae 01 movw r20, r28 1c71c: 4f 5f subi r20, 0xFF ; 255 1c71e: 5f 4f sbci r21, 0xFF ; 255 1c720: 60 e0 ldi r22, 0x00 ; 0 1c722: 70 ed ldi r23, 0xD0 ; 208 1c724: 83 e0 ldi r24, 0x03 ; 3 1c726: 90 e0 ldi r25, 0x00 ; 0 1c728: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1c72c: 89 81 ldd r24, Y+1 ; 0x01 1c72e: 9a 81 ldd r25, Y+2 ; 0x02 1c730: ab 81 ldd r26, Y+3 ; 0x03 1c732: bc 81 ldd r27, Y+4 ; 0x04 1c734: 87 34 cpi r24, 0x47 ; 71 1c736: 95 45 sbci r25, 0x55 ; 85 1c738: a2 45 sbci r26, 0x52 ; 82 1c73a: b5 45 sbci r27, 0x55 ; 85 1c73c: 71 f4 brne .+28 ; 0x1c75a return false; if (reason) 1c73e: 01 15 cp r16, r1 1c740: 11 05 cpc r17, r1 1c742: 49 f0 breq .+18 ; 0x1c756 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1c744: 21 e0 ldi r18, 0x01 ; 1 1c746: 30 e0 ldi r19, 0x00 ; 0 1c748: a8 01 movw r20, r16 1c74a: 65 e0 ldi r22, 0x05 ; 5 1c74c: 70 ed ldi r23, 0xD0 ; 208 1c74e: 83 e0 ldi r24, 0x03 ; 3 1c750: 90 e0 ldi r25, 0x00 ; 0 1c752: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc (uint8_t*)reason, sizeof(*reason)); } return true; 1c756: 81 e0 ldi r24, 0x01 ; 1 1c758: 01 c0 rjmp .+2 ; 0x1c75c XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1c75a: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1c75c: 0f 90 pop r0 1c75e: 0f 90 pop r0 1c760: 0f 90 pop r0 1c762: 0f 90 pop r0 1c764: df 91 pop r29 1c766: cf 91 pop r28 1c768: 1f 91 pop r17 1c76a: 0f 91 pop r16 1c76c: 08 95 ret 0001c76e : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1c76e: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1c770: 86 e0 ldi r24, 0x06 ; 6 1c772: 0e 94 15 e3 call 0x1c62a ; 0x1c62a _CS_HIGH(); 1c776: 45 9a sbi 0x08, 5 ; 8 } 1c778: 08 95 ret 0001c77a : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1c77a: 4f 92 push r4 1c77c: 5f 92 push r5 1c77e: 6f 92 push r6 1c780: 7f 92 push r7 1c782: 8f 92 push r8 1c784: 9f 92 push r9 1c786: af 92 push r10 1c788: bf 92 push r11 1c78a: ef 92 push r14 1c78c: ff 92 push r15 1c78e: 0f 93 push r16 1c790: 1f 93 push r17 1c792: cf 93 push r28 1c794: df 93 push r29 1c796: 7c 01 movw r14, r24 1c798: 4a 01 movw r8, r20 1c79a: 5b 01 movw r10, r22 1c79c: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c79e: 8c e5 ldi r24, 0x5C ; 92 1c7a0: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c7a2: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1c7a4: 41 2c mov r4, r1 1c7a6: 80 ed ldi r24, 0xD0 ; 208 1c7a8: 58 2e mov r5, r24 1c7aa: 83 e0 ldi r24, 0x03 ; 3 1c7ac: 68 2e mov r6, r24 1c7ae: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1c7b0: 0e 94 b7 e3 call 0x1c76e ; 0x1c76e _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1c7b4: b3 01 movw r22, r6 1c7b6: a2 01 movw r20, r4 1c7b8: 80 e2 ldi r24, 0x20 ; 32 1c7ba: 0e 94 39 e3 call 0x1c672 ; 0x1c672 xflash_sector_erase(addr); xflash_wait_busy(); 1c7be: 0e 94 1b e3 call 0x1c636 ; 0x1c636 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1c7c2: 80 e1 ldi r24, 0x10 ; 16 1c7c4: 58 0e add r5, r24 1c7c6: 61 1c adc r6, r1 1c7c8: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1c7ca: 41 14 cp r4, r1 1c7cc: 51 04 cpc r5, r1 1c7ce: e4 e0 ldi r30, 0x04 ; 4 1c7d0: 6e 06 cpc r6, r30 1c7d2: 71 04 cpc r7, r1 1c7d4: 69 f7 brne .-38 ; 0x1c7b0 // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1c7d6: 8d b7 in r24, 0x3d ; 61 1c7d8: 9e b7 in r25, 0x3e ; 62 1c7da: f7 01 movw r30, r14 1c7dc: 93 87 std Z+11, r25 ; 0x0b 1c7de: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1c7e0: 00 d0 rcall .+0 ; 0x1c7e2 1c7e2: 8f 91 pop r24 1c7e4: 9f 91 pop r25 1c7e6: af 91 pop r26 hdr.pc = GETPC(); 1c7e8: b0 e0 ldi r27, 0x00 ; 0 1c7ea: 86 83 std Z+6, r24 ; 0x06 1c7ec: 97 83 std Z+7, r25 ; 0x07 1c7ee: a0 87 std Z+8, r26 ; 0x08 1c7f0: 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(); 1c7f2: 0e 94 b7 e3 call 0x1c76e ; 0x1c76e xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1c7f6: 2c e0 ldi r18, 0x0C ; 12 1c7f8: 30 e0 ldi r19, 0x00 ; 0 1c7fa: a7 01 movw r20, r14 1c7fc: 60 e0 ldi r22, 0x00 ; 0 1c7fe: 70 ed ldi r23, 0xD0 ; 208 1c800: 83 e0 ldi r24, 0x03 ; 3 1c802: 90 e0 ldi r25, 0x00 ; 0 1c804: 0e 94 3e e3 call 0x1c67c ; 0x1c67c xflash_wait_busy(); 1c808: 0e 94 1b e3 call 0x1c636 ; 0x1c636 void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1c80c: 0e 94 b7 e3 call 0x1c76e ; 0x1c76e _CS_LOW(); 1c810: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c812: b5 01 movw r22, r10 1c814: a4 01 movw r20, r8 1c816: 82 e0 ldi r24, 0x02 ; 2 1c818: 0e 94 26 e3 call 0x1c64c ; 0x1c64c 1c81c: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1c81e: 21 96 adiw r28, 0x01 ; 1 1c820: 80 81 ld r24, Z 1c822: 0e 94 15 e3 call 0x1c62a ; 0x1c62a if(!--cnt || !(++addr & 0xFF)) 1c826: 01 50 subi r16, 0x01 ; 1 1c828: 11 09 sbc r17, r1 1c82a: 41 f0 breq .+16 ; 0x1c83c 1c82c: ff ef ldi r31, 0xFF ; 255 1c82e: 8f 1a sub r8, r31 1c830: 9f 0a sbc r9, r31 1c832: af 0a sbc r10, r31 1c834: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1c836: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1c838: 81 10 cpse r8, r1 1c83a: f1 cf rjmp .-30 ; 0x1c81e { // on a page boundary or end of write _CS_HIGH(); 1c83c: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1c83e: 0e 94 1b e3 call 0x1c636 ; 0x1c636 _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1c842: 01 15 cp r16, r1 1c844: 11 05 cpc r17, r1 1c846: 11 f7 brne .-60 ; 0x1c80c // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1c848: df 91 pop r29 1c84a: cf 91 pop r28 1c84c: 1f 91 pop r17 1c84e: 0f 91 pop r16 1c850: ff 90 pop r15 1c852: ef 90 pop r14 1c854: bf 90 pop r11 1c856: af 90 pop r10 1c858: 9f 90 pop r9 1c85a: 8f 90 pop r8 1c85c: 7f 90 pop r7 1c85e: 6f 90 pop r6 1c860: 5f 90 pop r5 1c862: 4f 90 pop r4 1c864: 08 95 ret 0001c866 : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1c866: cf 93 push r28 1c868: df 93 push r29 1c86a: cd b7 in r28, 0x3d ; 61 1c86c: de b7 in r29, 0x3e ; 62 1c86e: 2c 97 sbiw r28, 0x0c ; 12 1c870: 0f b6 in r0, 0x3f ; 63 1c872: f8 94 cli 1c874: de bf out 0x3e, r29 ; 62 1c876: 0f be out 0x3f, r0 ; 63 1c878: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c87a: 47 e4 ldi r20, 0x47 ; 71 1c87c: 55 e5 ldi r21, 0x55 ; 85 1c87e: 62 e5 ldi r22, 0x52 ; 82 1c880: 75 e5 ldi r23, 0x55 ; 85 1c882: 49 83 std Y+1, r20 ; 0x01 1c884: 5a 83 std Y+2, r21 ; 0x02 1c886: 6b 83 std Y+3, r22 ; 0x03 1c888: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1c88a: 91 e0 ldi r25, 0x01 ; 1 1c88c: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1c88e: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1c890: f8 94 cli 1c892: 88 e1 ldi r24, 0x18 ; 24 1c894: 9d e0 ldi r25, 0x0D ; 13 1c896: 0f b6 in r0, 0x3f ; 63 1c898: f8 94 cli 1c89a: a8 95 wdr 1c89c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1c8a0: 0f be out 0x3f, r0 ; 63 1c8a2: 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); 1c8a6: 00 e0 ldi r16, 0x00 ; 0 1c8a8: 12 e2 ldi r17, 0x22 ; 34 1c8aa: 30 e0 ldi r19, 0x00 ; 0 1c8ac: 20 e0 ldi r18, 0x00 ; 0 1c8ae: 40 e0 ldi r20, 0x00 ; 0 1c8b0: 51 ed ldi r21, 0xD1 ; 209 1c8b2: 63 e0 ldi r22, 0x03 ; 3 1c8b4: 70 e0 ldi r23, 0x00 ; 0 1c8b6: ce 01 movw r24, r28 1c8b8: 01 96 adiw r24, 0x01 ; 1 1c8ba: 0e 94 bd e3 call 0x1c77a ; 0x1c77a // force a reset even sooner softReset(); 1c8be: 0e 94 f9 67 call 0xcff2 ; 0xcff2 0001c8c2 : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1c8c2: 0f 93 push r16 1c8c4: 1f 93 push r17 1c8c6: cf 93 push r28 1c8c8: df 93 push r29 1c8ca: cd b7 in r28, 0x3d ; 61 1c8cc: de b7 in r29, 0x3e ; 62 1c8ce: 2c 97 sbiw r28, 0x0c ; 12 1c8d0: 0f b6 in r0, 0x3f ; 63 1c8d2: f8 94 cli 1c8d4: de bf out 0x3e, r29 ; 62 1c8d6: 0f be out 0x3f, r0 ; 63 1c8d8: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c8da: 87 e4 ldi r24, 0x47 ; 71 1c8dc: 95 e5 ldi r25, 0x55 ; 85 1c8de: a2 e5 ldi r26, 0x52 ; 82 1c8e0: b5 e5 ldi r27, 0x55 ; 85 1c8e2: 89 83 std Y+1, r24 ; 0x01 1c8e4: 9a 83 std Y+2, r25 ; 0x02 1c8e6: ab 83 std Y+3, r26 ; 0x03 1c8e8: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1c8ea: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1c8ec: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1c8ee: 00 e0 ldi r16, 0x00 ; 0 1c8f0: 10 e2 ldi r17, 0x20 ; 32 1c8f2: 20 e0 ldi r18, 0x00 ; 0 1c8f4: 32 e0 ldi r19, 0x02 ; 2 1c8f6: 40 e0 ldi r20, 0x00 ; 0 1c8f8: 53 ed ldi r21, 0xD3 ; 211 1c8fa: 63 e0 ldi r22, 0x03 ; 3 1c8fc: 70 e0 ldi r23, 0x00 ; 0 1c8fe: ce 01 movw r24, r28 1c900: 01 96 adiw r24, 0x01 ; 1 1c902: 0e 94 bd e3 call 0x1c77a ; 0x1c77a (uint8_t*)RAMSTART, RAMSIZE); } 1c906: 2c 96 adiw r28, 0x0c ; 12 1c908: 0f b6 in r0, 0x3f ; 63 1c90a: f8 94 cli 1c90c: de bf out 0x3e, r29 ; 62 1c90e: 0f be out 0x3f, r0 ; 63 1c910: cd bf out 0x3d, r28 ; 61 1c912: df 91 pop r29 1c914: cf 91 pop r28 1c916: 1f 91 pop r17 1c918: 0f 91 pop r16 1c91a: 08 95 ret 0001c91c : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1c91c: cf 93 push r28 _CS_HIGH(); 1c91e: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1c920: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c922: 8c e5 ldi r24, 0x5C ; 92 1c924: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c926: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1c928: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1c92a: 80 e9 ldi r24, 0x90 ; 144 1c92c: 0e 94 15 e3 call 0x1c62a ; 0x1c62a uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1c930: 80 e0 ldi r24, 0x00 ; 0 1c932: 0e 94 15 e3 call 0x1c62a ; 0x1c62a 1c936: 80 e0 ldi r24, 0x00 ; 0 1c938: 0e 94 15 e3 call 0x1c62a ; 0x1c62a 1c93c: 80 e0 ldi r24, 0x00 ; 0 1c93e: 0e 94 15 e3 call 0x1c62a ; 0x1c62a uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1c942: 8f ef ldi r24, 0xFF ; 255 1c944: 0e 94 15 e3 call 0x1c62a ; 0x1c62a 1c948: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1c94a: 8f ef ldi r24, 0xFF ; 255 1c94c: 0e 94 15 e3 call 0x1c62a ; 0x1c62a 1c950: 98 2f mov r25, r24 _CS_HIGH(); 1c952: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1c954: cf 3e cpi r28, 0xEF ; 239 1c956: 11 f0 breq .+4 ; 0x1c95c 1c958: c8 3c cpi r28, 0xC8 ; 200 1c95a: 19 f4 brne .+6 ; 0x1c962 1c95c: 81 e0 ldi r24, 0x01 ; 1 1c95e: 91 31 cpi r25, 0x11 ; 17 1c960: 09 f0 breq .+2 ; 0x1c964 int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1c962: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1c964: cf 91 pop r28 1c966: 08 95 ret 0001c968 : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 1c968: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1c96c: 80 95 com r24 1c96e: 81 70 andi r24, 0x01 ; 1 1c970: 08 95 ret 0001c972 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1c972: 1f 93 push r17 1c974: cf 93 push r28 1c976: df 93 push r29 MENU_BEGIN(); 1c978: 0f 94 08 cf call 0x39e10 ; 0x39e10 1c97c: 10 92 13 05 sts 0x0513, r1 ; 0x800513 #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); 1c980: 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 1c982: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1c984: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1c988: 84 30 cpi r24, 0x04 ; 4 1c98a: 08 f0 brcs .+2 ; 0x1c98e 1c98c: 3e c2 rjmp .+1148 ; 0x1ce0a 1c98e: 10 92 16 05 sts 0x0516, r1 ; 0x800516 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1c992: 85 e8 ldi r24, 0x85 ; 133 1c994: 9c e3 ldi r25, 0x3C ; 60 1c996: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1c99a: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 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)) { 1c99e: 0e 94 8e 68 call 0xd11c ; 0xd11c 1c9a2: 81 11 cpse r24, r1 1c9a4: 19 c0 rjmp .+50 ; 0x1c9d8 1c9a6: 0e 94 28 68 call 0xd050 ; 0xd050 1c9aa: 81 11 cpse r24, r1 1c9ac: 15 c0 rjmp .+42 ; 0x1c9d8 1c9ae: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 1c9b2: 81 11 cpse r24, r1 1c9b4: 11 c0 rjmp .+34 ; 0x1c9d8 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1c9b6: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 <_ZL13printer_state.lto_priv.397> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1c9ba: 83 30 cpi r24, 0x03 ; 3 1c9bc: 09 f0 breq .+2 ; 0x1c9c0 1c9be: 51 c0 rjmp .+162 ; 0x1ca62 1c9c0: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 1c9c4: 88 23 and r24, r24 1c9c6: 41 f0 breq .+16 ; 0x1c9d8 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1c9c8: 8b e7 ldi r24, 0x7B ; 123 1c9ca: 9c e3 ldi r25, 0x3C ; 60 1c9cc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1c9d0: 6c ee ldi r22, 0xEC ; 236 1c9d2: 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); 1c9d4: 0f 94 85 ce call 0x39d0a ; 0x39d0a } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1c9d8: 0e 94 78 68 call 0xd0f0 ; 0xd0f0 1c9dc: 88 23 and r24, r24 1c9de: 81 f0 breq .+32 ; 0x1ca00 1c9e0: 0e 94 3d 68 call 0xd07a ; 0xd07a 1c9e4: 81 11 cpse r24, r1 1c9e6: 04 c0 rjmp .+8 ; 0x1c9f0 1c9e8: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 1c9ec: 84 30 cpi r24, 0x04 ; 4 1c9ee: 41 f4 brne .+16 ; 0x1ca00 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1c9f0: 8b e6 ldi r24, 0x6B ; 107 1c9f2: 9c e3 ldi r25, 0x3C ; 60 1c9f4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1c9f8: 63 ee ldi r22, 0xE3 ; 227 1c9fa: 79 e3 ldi r23, 0x39 ; 57 1c9fc: 0f 94 86 d1 call 0x3a30c ; 0x3a30c if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1ca00: 0e 94 28 68 call 0xd050 ; 0xd050 1ca04: 81 11 cpse r24, r1 1ca06: 61 c0 rjmp .+194 ; 0x1caca } //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); 1ca08: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 1ca0c: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 1ca10: 89 1b sub r24, r25 1ca12: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1ca14: a9 f5 brne .+106 ; 0x1ca80 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1ca16: 0e 94 8e 68 call 0xd11c ; 0xd11c 1ca1a: 81 11 cpse r24, r1 1ca1c: 31 c0 rjmp .+98 ; 0x1ca80 #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1ca1e: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1ca22: 82 30 cpi r24, 0x02 ; 2 1ca24: 69 f1 breq .+90 ; 0x1ca80 #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1ca26: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1ca2a: 81 11 cpse r24, r1 1ca2c: 31 c0 rjmp .+98 ; 0x1ca90 MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1ca2e: 8a e5 ldi r24, 0x5A ; 90 1ca30: 9c e3 ldi r25, 0x3C ; 60 1ca32: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ca36: 6b e0 ldi r22, 0x0B ; 11 1ca38: 7a e3 ldi r23, 0x3A ; 58 1ca3a: 0f 94 86 d1 call 0x3a30c ; 0x3a30c if (M79_timer_get_status()) { 1ca3e: 80 91 9c 03 lds r24, 0x039C ; 0x80039c <_ZL9M79_timer.lto_priv.466> 1ca42: 88 23 and r24, r24 1ca44: 29 f1 breq .+74 ; 0x1ca90 #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1ca46: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 1ca4a: 81 30 cpi r24, 0x01 ; 1 1ca4c: 09 f0 breq .+2 ; 0x1ca50 1ca4e: 7e c0 rjmp .+252 ; 0x1cb4c MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1ca50: 8a e4 ldi r24, 0x4A ; 74 1ca52: 9c e3 ldi r25, 0x3C ; 60 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1ca54: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ca58: 63 e8 ldi r22, 0x83 ; 131 1ca5a: 70 ed ldi r23, 0xD0 ; 208 1ca5c: 0f 94 85 ce call 0x39d0a ; 0x39d0a 1ca60: 17 c0 rjmp .+46 ; 0x1ca90 // 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()) { 1ca62: 84 30 cpi r24, 0x04 ; 4 1ca64: 09 f0 breq .+2 ; 0x1ca68 1ca66: b8 cf rjmp .-144 ; 0x1c9d8 1ca68: 80 91 9c 03 lds r24, 0x039C ; 0x80039c <_ZL9M79_timer.lto_priv.466> 1ca6c: 88 23 and r24, r24 1ca6e: 09 f4 brne .+2 ; 0x1ca72 1ca70: b3 cf rjmp .-154 ; 0x1c9d8 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1ca72: 8b e7 ldi r24, 0x7B ; 123 1ca74: 9c e3 ldi r25, 0x3C ; 60 1ca76: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ca7a: 6d e7 ldi r22, 0x7D ; 125 1ca7c: 70 ed ldi r23, 0xD0 ; 208 1ca7e: aa cf rjmp .-172 ; 0x1c9d4 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); 1ca80: 84 e6 ldi r24, 0x64 ; 100 1ca82: 9c e3 ldi r25, 0x3C ; 60 1ca84: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ca88: 63 ee ldi r22, 0xE3 ; 227 1ca8a: 74 ed ldi r23, 0xD4 ; 212 1ca8c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #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) { 1ca90: c0 91 57 0e lds r28, 0x0E57 ; 0x800e57 1ca94: 0e 94 32 68 call 0xd064 ; 0xd064 1ca98: c1 11 cpse r28, r1 1ca9a: 17 c0 rjmp .+46 ; 0x1caca 1ca9c: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 1caa0: 91 11 cpse r25, r1 1caa2: 13 c0 rjmp .+38 ; 0x1caca 1caa4: 81 11 cpse r24, r1 1caa6: 15 c0 rjmp .+42 ; 0x1cad2 1caa8: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 1caac: 81 11 cpse r24, r1 1caae: 0d c0 rjmp .+26 ; 0x1caca if (usb_timer.running()) { 1cab0: 80 91 0f 05 lds r24, 0x050F ; 0x80050f 1cab4: 88 23 and r24, r24 1cab6: 09 f4 brne .+2 ; 0x1caba 1cab8: 4c c0 rjmp .+152 ; 0x1cb52 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1caba: 80 e3 ldi r24, 0x30 ; 48 1cabc: 9c e3 ldi r25, 0x3C ; 60 1cabe: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cac2: 65 e0 ldi r22, 0x05 ; 5 1cac4: 7b e3 ldi r23, 0x3B ; 59 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1cac6: 0f 94 85 ce call 0x39d0a ; 0x39d0a } } } if (printingIsPaused() 1caca: 0e 94 32 68 call 0xd064 ; 0xd064 && !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) { 1cace: 88 23 and r24, r24 1cad0: f1 f0 breq .+60 ; 0x1cb0e temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1cad2: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 1cad6: 81 11 cpse r24, r1 1cad8: 1a c0 rjmp .+52 ; 0x1cb0e #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cada: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1cade: 82 30 cpi r24, 0x02 ; 2 1cae0: b1 f0 breq .+44 ; 0x1cb0e #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1cae2: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1cae6: 82 30 cpi r24, 0x02 ; 2 1cae8: 21 f4 brne .+8 ; 0x1caf2 1caea: 90 91 58 0e lds r25, 0x0E58 ; 0x800e58 1caee: 99 23 and r25, r25 1caf0: 71 f0 breq .+28 ; 0x1cb0e && custom_message_type != CustomMsg::Resuming) { 1caf2: 90 91 73 07 lds r25, 0x0773 ; 0x800773 1caf6: 98 30 cpi r25, 0x08 ; 8 1caf8: 51 f0 breq .+20 ; 0x1cb0e if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1cafa: 81 11 cpse r24, r1 1cafc: 36 c0 rjmp .+108 ; 0x1cb6a MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1cafe: 81 e2 ldi r24, 0x21 ; 33 1cb00: 9c e3 ldi r25, 0x3C ; 60 1cb02: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cb06: 61 e7 ldi r22, 0x71 ; 113 1cb08: 79 e3 ldi r23, 0x39 ; 57 } 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); 1cb0a: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1cb0e: 0e 94 3d 68 call 0xd07a ; 0xd07a && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1cb12: 81 11 cpse r24, r1 1cb14: 08 c0 rjmp .+16 ; 0x1cb26 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())) 1cb16: 0e 94 32 68 call 0xd064 ; 0xd064 1cb1a: 81 11 cpse r24, r1 1cb1c: 04 c0 rjmp .+8 ; 0x1cb26 1cb1e: 0e 94 28 68 call 0xd050 ; 0xd050 1cb22: 88 23 and r24, r24 1cb24: 41 f0 breq .+16 ; 0x1cb36 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1cb26: 80 91 73 07 lds r24, 0x0773 ; 0x800773 1cb2a: 81 30 cpi r24, 0x01 ; 1 1cb2c: 21 f0 breq .+8 ; 0x1cb36 1cb2e: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 1cb32: 88 23 and r24, r24 1cb34: 39 f1 breq .+78 ; 0x1cb84 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1cb36: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1cb3a: 88 23 and r24, r24 1cb3c: 59 f1 breq .+86 ; 0x1cb94 MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1cb3e: 80 e1 ldi r24, 0x10 ; 16 1cb40: 9c e3 ldi r25, 0x3C ; 60 1cb42: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cb46: 67 ea ldi r22, 0xA7 ; 167 1cb48: 7a e3 ldi r23, 0x3A ; 58 1cb4a: 22 c0 rjmp .+68 ; 0x1cb90 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); 1cb4c: 8e e3 ldi r24, 0x3E ; 62 1cb4e: 9c e3 ldi r25, 0x3C ; 60 1cb50: 81 cf rjmp .-254 ; 0x1ca54 } } 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) { 1cb52: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 1cb56: 88 23 and r24, r24 1cb58: 09 f4 brne .+2 ; 0x1cb5c 1cb5a: b7 cf rjmp .-146 ; 0x1caca MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1cb5c: 80 e3 ldi r24, 0x30 ; 48 1cb5e: 9c e3 ldi r25, 0x3C ; 60 1cb60: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cb64: 67 e7 ldi r22, 0x77 ; 119 1cb66: 79 e3 ldi r23, 0x39 ; 57 1cb68: ae cf rjmp .-164 ; 0x1cac6 #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())) { 1cb6a: 81 30 cpi r24, 0x01 ; 1 1cb6c: 81 f6 brne .-96 ; 0x1cb0e 1cb6e: 80 91 9c 03 lds r24, 0x039C ; 0x80039c <_ZL9M79_timer.lto_priv.466> 1cb72: 88 23 and r24, r24 1cb74: 61 f2 breq .-104 ; 0x1cb0e MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1cb76: 81 e2 ldi r24, 0x21 ; 33 1cb78: 9c e3 ldi r25, 0x3C ; 60 1cb7a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cb7e: 65 e3 ldi r22, 0x35 ; 53 1cb80: 7a e3 ldi r23, 0x3A ; 58 1cb82: c3 cf rjmp .-122 ; 0x1cb0a } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1cb84: 8d e7 ldi r24, 0x7D ; 125 1cb86: 9d e3 ldi r25, 0x3D ; 61 1cb88: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cb8c: 65 ef ldi r22, 0xF5 ; 245 1cb8e: 72 ed ldi r23, 0xD2 ; 210 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1cb90: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1cb94: 0e 94 28 68 call 0xd050 ; 0xd050 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cb98: 81 11 cpse r24, r1 1cb9a: 9e c0 rjmp .+316 ; 0x1ccd8 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() 1cb9c: 0e 94 8e 68 call 0xd11c ; 0xd11c 1cba0: 81 11 cpse r24, r1 1cba2: 9a c0 rjmp .+308 ; 0x1ccd8 1cba4: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 1cba8: 81 11 cpse r24, r1 1cbaa: 96 c0 rjmp .+300 ; 0x1ccd8 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cbac: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1cbb0: 82 30 cpi r24, 0x02 ; 2 1cbb2: 09 f4 brne .+2 ; 0x1cbb6 1cbb4: 91 c0 rjmp .+290 ; 0x1ccd8 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1cbb6: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 1cbba: 81 11 cpse r24, r1 1cbbc: 05 c0 rjmp .+10 ; 0x1cbc8 || lcd_commands_type != LcdCommands::Idle) { 1cbbe: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 1cbc2: 88 23 and r24, r24 1cbc4: 09 f4 brne .+2 ; 0x1cbc8 1cbc6: b9 c0 rjmp .+370 ; 0x1cd3a if (!card.isFileOpen()) { 1cbc8: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 1cbcc: 81 11 cpse r24, r1 1cbce: 12 c0 rjmp .+36 ; 0x1cbf4 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1cbd0: 80 91 0f 05 lds r24, 0x050F ; 0x80050f 1cbd4: 81 11 cpse r24, r1 1cbd6: 0e c0 rjmp .+28 ; 0x1cbf4 1cbd8: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 1cbdc: 81 11 cpse r24, r1 1cbde: 0a c0 rjmp .+20 ; 0x1cbf4 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1cbe0: d0 93 db 03 sts 0x03DB, r29 ; 0x8003db MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1cbe4: 80 e0 ldi r24, 0x00 ; 0 1cbe6: 9c e3 ldi r25, 0x3C ; 60 1cbe8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cbec: 6b e6 ldi r22, 0x6B ; 107 1cbee: 79 e3 ldi r23, 0x39 ; 57 1cbf0: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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)); 1cbf4: 81 ea ldi r24, 0xA1 ; 161 1cbf6: 9d e0 ldi r25, 0x0D ; 13 1cbf8: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1cbfc: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1cbfe: 0e 94 d2 77 call 0xefa4 ; 0xefa4 if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1cc02: 87 fd sbrc r24, 7 1cc04: 09 c0 rjmp .+18 ; 0x1cc18 1cc06: c8 17 cp r28, r24 1cc08: 39 f0 breq .+14 ; 0x1cc18 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1cc0a: c1 02 muls r28, r17 1cc0c: c0 01 movw r24, r0 1cc0e: 11 24 eor r1, r1 1cc10: 87 5b subi r24, 0xB7 ; 183 1cc12: 92 4f sbci r25, 0xF2 ; 242 1cc14: 0e 94 a1 d1 call 0x1a342 ; 0x1a342 } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1cc18: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 1cc1c: 8c 33 cpi r24, 0x3C ; 60 1cc1e: 09 f4 brne .+2 ; 0x1cc22 1cc20: b0 c0 rjmp .+352 ; 0x1cd82 1cc22: 08 f0 brcs .+2 ; 0x1cc26 1cc24: 93 c0 rjmp .+294 ; 0x1cd4c 1cc26: 89 31 cpi r24, 0x19 ; 25 1cc28: 09 f4 brne .+2 ; 0x1cc2c 1cc2a: 9f c0 rjmp .+318 ; 0x1cd6a 1cc2c: 88 32 cpi r24, 0x28 ; 40 1cc2e: 09 f4 brne .+2 ; 0x1cc32 1cc30: 92 c0 rjmp .+292 ; 0x1cd56 #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1cc32: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 1cc36: 81 11 cpse r24, r1 1cc38: 4f c0 rjmp .+158 ; 0x1ccd8 1cc3a: 80 91 12 05 lds r24, 0x0512 ; 0x800512 1cc3e: 81 11 cpse r24, r1 1cc40: 4b c0 rjmp .+150 ; 0x1ccd8 if (MMU2::mmu2.Enabled()) { 1cc42: 80 91 96 13 lds r24, 0x1396 ; 0x801396 1cc46: 81 30 cpi r24, 0x01 ; 1 1cc48: 09 f0 breq .+2 ; 0x1cc4c 1cc4a: af c0 rjmp .+350 ; 0x1cdaa if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1cc4c: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 1cc50: 81 11 cpse r24, r1 1cc52: 0c c0 rjmp .+24 ; 0x1cc6c 1cc54: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 1cc58: 81 11 cpse r24, r1 1cc5a: 08 c0 rjmp .+16 ; 0x1cc6c // 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); 1cc5c: 86 ed ldi r24, 0xD6 ; 214 1cc5e: 9b e3 ldi r25, 0x3B ; 59 1cc60: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cc64: 6d ea ldi r22, 0xAD ; 173 1cc66: 78 ed ldi r23, 0xD8 ; 216 1cc68: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1cc6c: 85 ec ldi r24, 0xC5 ; 197 1cc6e: 9b e3 ldi r25, 0x3B ; 59 1cc70: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cc74: 64 ee ldi r22, 0xE4 ; 228 1cc76: 78 ed ldi r23, 0xD8 ; 216 1cc78: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1cc7c: 83 eb ldi r24, 0xB3 ; 179 1cc7e: 9b e3 ldi r25, 0x3B ; 59 1cc80: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cc84: 67 ee ldi r22, 0xE7 ; 231 1cc86: 78 ed ldi r23, 0xD8 ; 216 1cc88: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1cc8c: 85 e6 ldi r24, 0x65 ; 101 1cc8e: 9c e5 ldi r25, 0x5C ; 92 1cc90: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cc94: 6a ee ldi r22, 0xEA ; 234 1cc96: 78 ed ldi r23, 0xD8 ; 216 1cc98: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1cc9c: 8e ec ldi r24, 0xCE ; 206 1cc9e: 9e e0 ldi r25, 0x0E ; 14 1cca0: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1cca4: 88 23 and r24, r24 1cca6: 41 f0 breq .+16 ; 0x1ccb8 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1cca8: 86 e5 ldi r24, 0x56 ; 86 1ccaa: 9c e5 ldi r25, 0x5C ; 92 1ccac: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ccb0: 6d ee ldi r22, 0xED ; 237 1ccb2: 78 ed ldi r23, 0xD8 ; 216 } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 1ccb4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1ccb8: 87 e6 ldi r24, 0x67 ; 103 1ccba: 9d e3 ldi r25, 0x3D ; 61 1ccbc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ccc0: 65 ea ldi r22, 0xA5 ; 165 1ccc2: 79 e3 ldi r23, 0x39 ; 57 1ccc4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1ccc8: 81 e8 ldi r24, 0x81 ; 129 1ccca: 9b e3 ldi r25, 0x3B ; 59 1cccc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ccd0: 6a e2 ldi r22, 0x2A ; 42 1ccd2: 74 ed ldi r23, 0xD4 ; 212 1ccd4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1ccd8: 84 e7 ldi r24, 0x74 ; 116 1ccda: 9b e3 ldi r25, 0x3B ; 59 1ccdc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cce0: 67 ee ldi r22, 0xE7 ; 231 1cce2: 7a e3 ldi r23, 0x3A ; 58 1cce4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1cce8: 87 e6 ldi r24, 0x67 ; 103 1ccea: 9b e3 ldi r25, 0x3B ; 59 1ccec: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ccf0: 6f e9 ldi r22, 0x9F ; 159 1ccf2: 79 e3 ldi r23, 0x39 ; 57 1ccf4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #endif if (MMU2::mmu2.Enabled()) { 1ccf8: 80 91 96 13 lds r24, 0x1396 ; 0x801396 1ccfc: 81 30 cpi r24, 0x01 ; 1 1ccfe: 41 f4 brne .+16 ; 0x1cd10 MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1cd00: 86 e5 ldi r24, 0x56 ; 86 1cd02: 9b e3 ldi r25, 0x3B ; 59 1cd04: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cd08: 67 e5 ldi r22, 0x57 ; 87 1cd0a: 7a e3 ldi r23, 0x3A ; 58 1cd0c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 1cd10: 8c e4 ldi r24, 0x4C ; 76 1cd12: 9b e3 ldi r25, 0x3B ; 59 1cd14: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cd18: 6d e8 ldi r22, 0x8D ; 141 1cd1a: 79 e3 ldi r23, 0x39 ; 57 1cd1c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_END(); 1cd20: 0f 94 dc ce call 0x39db8 ; 0x39db8 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1cd24: 80 91 13 05 lds r24, 0x0513 ; 0x800513 1cd28: 8f 5f subi r24, 0xFF ; 255 1cd2a: 80 93 13 05 sts 0x0513, r24 ; 0x800513 1cd2e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1cd32: 8f 5f subi r24, 0xFF ; 255 1cd34: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1cd38: 25 ce rjmp .-950 ; 0x1c984 #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 1cd3a: d0 93 db 03 sts 0x03DB, r29 ; 0x8003db MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1cd3e: 83 ef ldi r24, 0xF3 ; 243 1cd40: 9b e3 ldi r25, 0x3B ; 59 1cd42: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cd46: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 1cd4a: 54 cf rjmp .-344 ; 0x1cbf4 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1cd4c: 80 35 cpi r24, 0x50 ; 80 1cd4e: 19 f1 breq .+70 ; 0x1cd96 1cd50: 8f 3f cpi r24, 0xFF ; 255 1cd52: 09 f0 breq .+2 ; 0x1cd56 1cd54: 6e cf rjmp .-292 ; 0x1cc32 1cd56: 87 ee ldi r24, 0xE7 ; 231 1cd58: 9b e3 ldi r25, 0x3B ; 59 1cd5a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cd5e: 22 e0 ldi r18, 0x02 ; 2 1cd60: 41 e6 ldi r20, 0x61 ; 97 1cd62: 5b e3 ldi r21, 0x3B ; 59 1cd64: 64 e2 ldi r22, 0x24 ; 36 1cd66: 7b e8 ldi r23, 0x8B ; 139 1cd68: 09 c0 rjmp .+18 ; 0x1cd7c 1cd6a: 87 ee ldi r24, 0xE7 ; 231 1cd6c: 9b e3 ldi r25, 0x3B ; 59 1cd6e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cd72: 22 e0 ldi r18, 0x02 ; 2 1cd74: 41 e6 ldi r20, 0x61 ; 97 1cd76: 5b e3 ldi r21, 0x3B ; 59 1cd78: 69 e2 ldi r22, 0x29 ; 41 1cd7a: 7b e8 ldi r23, 0x8B ; 139 1cd7c: 0f 94 97 d0 call 0x3a12e ; 0x3a12e 1cd80: 58 cf rjmp .-336 ; 0x1cc32 1cd82: 87 ee ldi r24, 0xE7 ; 231 1cd84: 9b e3 ldi r25, 0x3B ; 59 1cd86: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cd8a: 22 e0 ldi r18, 0x02 ; 2 1cd8c: 41 e6 ldi r20, 0x61 ; 97 1cd8e: 5b e3 ldi r21, 0x3B ; 59 1cd90: 6f e1 ldi r22, 0x1F ; 31 1cd92: 7b e8 ldi r23, 0x8B ; 139 1cd94: f3 cf rjmp .-26 ; 0x1cd7c 1cd96: 87 ee ldi r24, 0xE7 ; 231 1cd98: 9b e3 ldi r25, 0x3B ; 59 1cd9a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cd9e: 22 e0 ldi r18, 0x02 ; 2 1cda0: 41 e6 ldi r20, 0x61 ; 97 1cda2: 5b e3 ldi r21, 0x3B ; 59 1cda4: 6a e1 ldi r22, 0x1A ; 26 1cda6: 7b e8 ldi r23, 0x8B ; 139 1cda8: e9 cf rjmp .-46 ; 0x1cd7c MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1cdaa: 80 91 86 17 lds r24, 0x1786 ; 0x801786 1cdae: 88 23 and r24, r24 1cdb0: 19 f1 breq .+70 ; 0x1cdf8 if (!fsensor.getAutoLoadEnabled()) { 1cdb2: 80 91 87 17 lds r24, 0x1787 ; 0x801787 1cdb6: 81 11 cpse r24, r1 1cdb8: 08 c0 rjmp .+16 ; 0x1cdca MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1cdba: 83 ea ldi r24, 0xA3 ; 163 1cdbc: 9b e3 ldi r25, 0x3B ; 59 1cdbe: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cdc2: 69 e6 ldi r22, 0x69 ; 105 1cdc4: 7b e3 ldi r23, 0x3B ; 59 1cdc6: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } if (fsensor.getFilamentPresent()) { 1cdca: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 1cdce: 88 23 and r24, r24 1cdd0: 39 f0 breq .+14 ; 0x1cde0 } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 1cdd2: 83 eb ldi r24, 0xB3 ; 179 1cdd4: 9b e3 ldi r25, 0x3B ; 59 1cdd6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cdda: 65 eb ldi r22, 0xB5 ; 181 1cddc: 79 e3 ldi r23, 0x39 ; 57 1cdde: 6a cf rjmp .-300 ; 0x1ccb4 if (fsensor.getFilamentPresent()) { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } #ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY else { if (fsensor.getAutoLoadEnabled()) { 1cde0: 80 91 87 17 lds r24, 0x1787 ; 0x801787 1cde4: 88 23 and r24, r24 1cde6: 09 f4 brne .+2 ; 0x1cdea 1cde8: 67 cf rjmp .-306 ; 0x1ccb8 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1cdea: 8f e8 ldi r24, 0x8F ; 143 1cdec: 9b e3 ldi r25, 0x3B ; 59 1cdee: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cdf2: 67 e3 ldi r22, 0x37 ; 55 1cdf4: 7b e3 ldi r23, 0x3B ; 59 1cdf6: 5e cf rjmp .-324 ; 0x1ccb4 } } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1cdf8: 83 ea ldi r24, 0xA3 ; 163 1cdfa: 9b e3 ldi r25, 0x3B ; 59 1cdfc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1ce00: 69 e6 ldi r22, 0x69 ; 105 1ce02: 7b e3 ldi r23, 0x3B ; 59 1ce04: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 1ce08: e4 cf rjmp .-56 ; 0x1cdd2 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1ce0a: df 91 pop r29 1ce0c: cf 91 pop r28 1ce0e: 1f 91 pop r17 1ce10: 08 95 ret 0001ce12 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1ce12: cf 93 push r28 1ce14: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1ce16: 86 ea ldi r24, 0xA6 ; 166 1ce18: 9c e0 ldi r25, 0x0C ; 12 1ce1a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 status &= ~components; 1ce1e: c0 95 com r28 1ce20: 6c 2f mov r22, r28 1ce22: 68 23 and r22, r24 1ce24: 86 ea ldi r24, 0xA6 ; 166 1ce26: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1ce28: cf 91 pop r28 1ce2a: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0001ce2e : } } } static void lcd_reset_sheet() { 1ce2e: 1f 93 push r17 1ce30: cf 93 push r28 1ce32: df 93 push r29 1ce34: 00 d0 rcall .+0 ; 0x1ce36 1ce36: 00 d0 rcall .+0 ; 0x1ce38 1ce38: 1f 92 push r1 1ce3a: 1f 92 push r1 1ce3c: cd b7 in r28, 0x3d ; 61 1ce3e: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1ce40: be 01 movw r22, r28 1ce42: 6f 5f subi r22, 0xFF ; 255 1ce44: 7f 4f sbci r23, 0xFF ; 255 1ce46: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc 1ce4a: 0e 94 f4 77 call 0xefe8 ; 0xefe8 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1ce4e: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc 1ce52: 1b e0 ldi r17, 0x0B ; 11 1ce54: 81 9f mul r24, r17 1ce56: c0 01 movw r24, r0 1ce58: 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); 1ce5a: 6f ef ldi r22, 0xFF ; 255 1ce5c: 7f ef ldi r23, 0xFF ; 255 1ce5e: 80 5b subi r24, 0xB0 ; 176 1ce60: 92 4f sbci r25, 0xF2 ; 242 1ce62: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1ce66: 60 91 dc 03 lds r22, 0x03DC ; 0x8003dc 1ce6a: 61 9f mul r22, r17 1ce6c: b0 01 movw r22, r0 1ce6e: 11 24 eor r1, r1 1ce70: 67 5b subi r22, 0xB7 ; 183 1ce72: 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); 1ce74: 47 e0 ldi r20, 0x07 ; 7 1ce76: 50 e0 ldi r21, 0x00 ; 0 1ce78: ce 01 movw r24, r28 1ce7a: 01 96 adiw r24, 0x01 ; 1 1ce7c: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1ce80: 81 ea ldi r24, 0xA1 ; 161 1ce82: 9d e0 ldi r25, 0x0D ; 13 1ce84: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1ce88: 90 91 dc 03 lds r25, 0x03DC ; 0x8003dc 1ce8c: 89 13 cpse r24, r25 1ce8e: 0a c0 rjmp .+20 ; 0x1cea4 { eeprom_switch_to_next_sheet(); 1ce90: 0e 94 e6 77 call 0xefcc ; 0xefcc if (-1 == eeprom_next_initialized_sheet(0)) 1ce94: 80 e0 ldi r24, 0x00 ; 0 1ce96: 0e 94 d2 77 call 0xefa4 ; 0xefa4 1ce9a: 8f 3f cpi r24, 0xFF ; 255 1ce9c: 19 f4 brne .+6 ; 0x1cea4 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1ce9e: 80 e1 ldi r24, 0x10 ; 16 1cea0: 0e 94 09 e7 call 0x1ce12 ; 0x1ce12 } menu_back(); 1cea4: 0f 94 d0 d1 call 0x3a3a0 ; 0x3a3a0 } 1cea8: 28 96 adiw r28, 0x08 ; 8 1ceaa: 0f b6 in r0, 0x3f ; 63 1ceac: f8 94 cli 1ceae: de bf out 0x3e, r29 ; 62 1ceb0: 0f be out 0x3f, r0 ; 63 1ceb2: cd bf out 0x3d, r28 ; 61 1ceb4: df 91 pop r29 1ceb6: cf 91 pop r28 1ceb8: 1f 91 pop r17 1ceba: 08 95 ret 0001cebc : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1cebc: cf 93 push r28 1cebe: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1cec0: 86 ea ldi r24, 0xA6 ; 166 1cec2: 9c e0 ldi r25, 0x0C ; 12 1cec4: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 status |= components; 1cec8: 68 2f mov r22, r24 1ceca: 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); 1cecc: 86 ea ldi r24, 0xA6 ; 166 1cece: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1ced0: cf 91 pop r28 1ced2: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0001ced6 : //! @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) 1ced6: 2f 92 push r2 1ced8: 3f 92 push r3 1ceda: 4f 92 push r4 1cedc: 5f 92 push r5 1cede: 6f 92 push r6 1cee0: 7f 92 push r7 1cee2: 8f 92 push r8 1cee4: 9f 92 push r9 1cee6: af 92 push r10 1cee8: bf 92 push r11 1ceea: cf 92 push r12 1ceec: df 92 push r13 1ceee: ef 92 push r14 1cef0: ff 92 push r15 1cef2: 0f 93 push r16 1cef4: 1f 93 push r17 1cef6: cf 93 push r28 1cef8: df 93 push r29 1cefa: cd b7 in r28, 0x3d ; 61 1cefc: de b7 in r29, 0x3e ; 62 1cefe: ce 5c subi r28, 0xCE ; 206 1cf00: d1 09 sbc r29, r1 1cf02: 0f b6 in r0, 0x3f ; 63 1cf04: f8 94 cli 1cf06: de bf out 0x3e, r29 ; 62 1cf08: 0f be out 0x3f, r0 ; 63 1cf0a: cd bf out 0x3d, r28 ; 61 1cf0c: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 1cf0e: 81 e0 ldi r24, 0x01 ; 1 1cf10: 0e 94 5d 67 call 0xceba ; 0xceba #endif // TMC2130 FORCE_BL_ON_START; 1cf14: 81 e0 ldi r24, 0x01 ; 1 1cf16: 0e 94 74 8b call 0x116e8 ; 0x116e8 // Only Z calibration? if (!onlyZ) 1cf1a: 11 11 cpse r17, r1 1cf1c: 04 c0 rjmp .+8 ; 0x1cf26 { disable_heater(); 1cf1e: 0f 94 4f 45 call 0x28a9e ; 0x28a9e eeprom_adjust_bed_reset(); //reset bed level correction 1cf22: 0e 94 1b 78 call 0xf036 ; 0xf036 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 1cf26: 80 e0 ldi r24, 0x00 ; 0 1cf28: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 // Let the planner use the uncorrected coordinates. mbl.reset(); 1cf2c: 0f 94 17 8c call 0x3182e ; 0x3182e // 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(); 1cf30: 0f 94 a8 cb call 0x39750 ; 0x39750 babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 1cf34: 10 92 69 05 sts 0x0569, r1 ; 0x800569 <_ZL13babystepLoadZ.lto_priv.516+0x1> 1cf38: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.516> // 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)); 1cf3c: ee e3 ldi r30, 0x3E ; 62 1cf3e: f7 e0 ldi r31, 0x07 ; 7 1cf40: 83 e0 ldi r24, 0x03 ; 3 1cf42: df 01 movw r26, r30 1cf44: 1d 92 st X+, r1 1cf46: 8a 95 dec r24 1cf48: e9 f7 brne .-6 ; 0x1cf44 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 1cf4a: 81 e0 ldi r24, 0x01 ; 1 1cf4c: 0e 94 95 67 call 0xcf2a ; 0xcf2a 1cf50: c7 55 subi r28, 0x57 ; 87 1cf52: df 4f sbci r29, 0xFF ; 255 1cf54: 99 83 std Y+1, r25 ; 0x01 1cf56: 88 83 st Y, r24 1cf58: c9 5a subi r28, 0xA9 ; 169 1cf5a: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 1cf5c: 83 e5 ldi r24, 0x53 ; 83 1cf5e: 99 e4 ldi r25, 0x49 ; 73 1cf60: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1cf64: 0f 94 7d 35 call 0x26afa ; 0x26afa raise_z_above(MESH_HOME_Z_SEARCH); 1cf68: 60 e0 ldi r22, 0x00 ; 0 1cf6a: 70 e0 ldi r23, 0x00 ; 0 1cf6c: 80 ea ldi r24, 0xA0 ; 160 1cf6e: 90 e4 ldi r25, 0x40 ; 64 1cf70: 0e 94 0d 6f call 0xde1a ; 0xde1a } /**/ void home_xy() { set_destination_to_current(); 1cf74: 0e 94 e7 68 call 0xd1ce ; 0xd1ce homeaxis(X_AXIS); 1cf78: 50 e0 ldi r21, 0x00 ; 0 1cf7a: 40 e0 ldi r20, 0x00 ; 0 1cf7c: 61 e0 ldi r22, 0x01 ; 1 1cf7e: 80 e0 ldi r24, 0x00 ; 0 1cf80: 0e 94 ee 7b call 0xf7dc ; 0xf7dc homeaxis(Y_AXIS); 1cf84: 50 e0 ldi r21, 0x00 ; 0 1cf86: 40 e0 ldi r20, 0x00 ; 0 1cf88: 61 e0 ldi r22, 0x01 ; 1 1cf8a: 81 e0 ldi r24, 0x01 ; 1 1cf8c: 0e 94 ee 7b call 0xf7dc ; 0xf7dc plan_set_position_curposXYZE(); 1cf90: 0f 94 4b b9 call 0x37296 ; 0x37296 endstops_hit_on_purpose(); 1cf94: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc 1cf98: 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; 1cf9c: 20 e0 ldi r18, 0x00 ; 0 1cf9e: 30 e0 ldi r19, 0x00 ; 0 1cfa0: 40 ea ldi r20, 0xA0 ; 160 1cfa2: 50 e4 ldi r21, 0x40 ; 64 1cfa4: 60 91 41 07 lds r22, 0x0741 ; 0x800741 1cfa8: 70 91 42 07 lds r23, 0x0742 ; 0x800742 1cfac: 80 91 43 07 lds r24, 0x0743 ; 0x800743 1cfb0: 90 91 44 07 lds r25, 0x0744 ; 0x800744 1cfb4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1cfb8: 60 93 41 07 sts 0x0741, r22 ; 0x800741 1cfbc: 70 93 42 07 sts 0x0742, r23 ; 0x800742 1cfc0: 80 93 43 07 sts 0x0743, r24 ; 0x800743 1cfc4: 90 93 44 07 sts 0x0744, r25 ; 0x800744 current_position[Y_AXIS] += 5; 1cfc8: 20 e0 ldi r18, 0x00 ; 0 1cfca: 30 e0 ldi r19, 0x00 ; 0 1cfcc: 40 ea ldi r20, 0xA0 ; 160 1cfce: 50 e4 ldi r21, 0x40 ; 64 1cfd0: 60 91 45 07 lds r22, 0x0745 ; 0x800745 1cfd4: 70 91 46 07 lds r23, 0x0746 ; 0x800746 1cfd8: 80 91 47 07 lds r24, 0x0747 ; 0x800747 1cfdc: 90 91 48 07 lds r25, 0x0748 ; 0x800748 1cfe0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1cfe4: 60 93 45 07 sts 0x0745, r22 ; 0x800745 1cfe8: 70 93 46 07 sts 0x0746, r23 ; 0x800746 1cfec: 80 93 47 07 sts 0x0747, r24 ; 0x800747 1cff0: 90 93 48 07 sts 0x0748, r25 ; 0x800748 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1cff4: 60 e0 ldi r22, 0x00 ; 0 1cff6: 70 e0 ldi r23, 0x00 ; 0 1cff8: 80 ea ldi r24, 0xA0 ; 160 1cffa: 91 e4 ldi r25, 0x41 ; 65 1cffc: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 1d000: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 1d004: 0e 94 eb 73 call 0xe7d6 ; 0xe7d6 1d008: e5 96 adiw r28, 0x35 ; 53 1d00a: 8f af std Y+63, r24 ; 0x3f 1d00c: e5 97 sbiw r28, 0x35 ; 53 1d00e: 81 11 cpse r24, r1 1d010: 04 c0 rjmp .+8 ; 0x1d01a //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 1d012: e5 96 adiw r28, 0x35 ; 53 1d014: 1f ae std Y+63, r1 ; 0x3f 1d016: e5 97 sbiw r28, 0x35 ; 53 1d018: 0d c3 rjmp .+1562 ; 0x1d634 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 1d01a: 87 e1 ldi r24, 0x17 ; 23 1d01c: 99 e4 ldi r25, 0x49 ; 73 1d01e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1d022: 0f 94 04 36 call 0x26c08 ; 0x26c08 if(onlyZ){ 1d026: 11 23 and r17, r17 1d028: 09 f4 brne .+2 ; 0x1d02c 1d02a: df c2 rjmp .+1470 ; 0x1d5ea prompt_steel_sheet_on_bed(true); 1d02c: 81 e0 ldi r24, 0x01 ; 1 1d02e: 0f 94 b4 67 call 0x2cf68 ; 0x2cf68 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 1d032: 85 ee ldi r24, 0xE5 ; 229 1d034: 98 e4 ldi r25, 0x48 ; 72 1d036: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1d03a: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_puts_at_P(0,3,_n("1/9")); 1d03e: 43 e9 ldi r20, 0x93 ; 147 1d040: 5e e6 ldi r21, 0x6E ; 110 }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")); 1d042: 63 e0 ldi r22, 0x03 ; 3 1d044: 80 e0 ldi r24, 0x00 ; 0 1d046: 0e 94 a1 6f call 0xdf42 ; 0xdf42 } refresh_cmd_timeout(); 1d04a: 0e 94 70 67 call 0xcee0 ; 0xcee0 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 1d04e: 11 11 cpse r17, r1 1d050: 1b c0 rjmp .+54 ; 0x1d088 { KEEPALIVE_STATE(PAUSED_FOR_USER); 1d052: 84 e0 ldi r24, 0x04 ; 4 1d054: 80 93 96 02 sts 0x0296, r24 ; 0x800296 prompt_steel_sheet_on_bed(false); 1d058: 80 e0 ldi r24, 0x00 ; 0 1d05a: 0f 94 b4 67 call 0x2cf68 ; 0x2cf68 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 1d05e: 8b e2 ldi r24, 0x2B ; 43 1d060: 98 e4 ldi r25, 0x48 ; 72 1d062: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1d066: 0f 94 04 36 call 0x26c08 ; 0x26c08 KEEPALIVE_STATE(IN_HANDLER); 1d06a: 82 e0 ldi r24, 0x02 ; 2 1d06c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 1d070: 83 ec ldi r24, 0xC3 ; 195 1d072: 98 e4 ldi r25, 0x48 ; 72 1d074: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1d078: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_puts_at_P(0,3,_n("1/4")); 1d07c: 4b e8 ldi r20, 0x8B ; 139 1d07e: 5e e6 ldi r21, 0x6E ; 110 1d080: 63 e0 ldi r22, 0x03 ; 3 1d082: 80 e0 ldi r24, 0x00 ; 0 1d084: 0e 94 a1 6f call 0xdf42 ; 0xdf42 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 1d088: 00 91 8f 02 lds r16, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 1d08c: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 1d090: 60 e0 ldi r22, 0x00 ; 0 1d092: 70 e0 ldi r23, 0x00 ; 0 1d094: 80 e8 ldi r24, 0x80 ; 128 1d096: 9f eb ldi r25, 0xBF ; 191 1d098: 0e 94 8e 6e call 0xdd1c ; 0xdd1c // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1d09c: c1 2c mov r12, r1 1d09e: d1 2c mov r13, r1 1d0a0: b0 ea ldi r27, 0xA0 ; 160 1d0a2: eb 2e mov r14, r27 1d0a4: b0 e4 ldi r27, 0x40 ; 64 1d0a6: fb 2e mov r15, r27 1d0a8: c0 92 49 07 sts 0x0749, r12 ; 0x800749 1d0ac: d0 92 4a 07 sts 0x074A, r13 ; 0x80074a 1d0b0: e0 92 4b 07 sts 0x074B, r14 ; 0x80074b 1d0b4: f0 92 4c 07 sts 0x074C, r15 ; 0x80074c 1d0b8: 81 e0 ldi r24, 0x01 ; 1 1d0ba: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 1d0be: 84 e0 ldi r24, 0x04 ; 4 1d0c0: 0f 94 8b 3b call 0x27716 ; 0x27716 #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1d0c4: 60 e0 ldi r22, 0x00 ; 0 1d0c6: 70 e0 ldi r23, 0x00 ; 0 1d0c8: 80 ea ldi r24, 0xA0 ; 160 1d0ca: 91 e4 ldi r25, 0x41 ; 65 1d0cc: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 1d0d0: 0f 94 24 59 call 0x2b248 ; 0x2b248 #ifdef TMC2130 tmc2130_home_exit(); 1d0d4: 0f 94 5c 3b call 0x276b8 ; 0x276b8 1d0d8: 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)) && 1d0dc: 82 e0 ldi r24, 0x02 ; 2 1d0de: 0f 94 10 59 call 0x2b220 ; 0x2b220 1d0e2: 2d ec ldi r18, 0xCD ; 205 1d0e4: 3c ec ldi r19, 0xCC ; 204 1d0e6: 44 ea ldi r20, 0xA4 ; 164 1d0e8: 50 e4 ldi r21, 0x40 ; 64 1d0ea: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1d0ee: 18 16 cp r1, r24 1d0f0: 0c f4 brge .+2 ; 0x1d0f4 1d0f2: 84 c2 rjmp .+1288 ; 0x1d5fc (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 1d0f4: 82 e0 ldi r24, 0x02 ; 2 1d0f6: 0f 94 10 59 call 0x2b220 ; 0x2b220 #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)) && 1d0fa: 23 e3 ldi r18, 0x33 ; 51 1d0fc: 33 e3 ldi r19, 0x33 ; 51 1d0fe: 4b e9 ldi r20, 0x9B ; 155 1d100: 50 e4 ldi r21, 0x40 ; 64 1d102: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1d106: 87 fd sbrc r24, 7 1d108: 79 c2 rjmp .+1266 ; 0x1d5fc (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 1d10a: 11 11 cpse r17, r1 1d10c: 7c c2 rjmp .+1272 ; 0x1d606 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1d10e: 80 e1 ldi r24, 0x10 ; 16 1d110: 0e 94 09 e7 call 0x1ce12 ; 0x1ce12 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1d114: 81 ea ldi r24, 0xA1 ; 161 1d116: 9d e0 ldi r25, 0x0D ; 13 1d118: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1d11c: bb e0 ldi r27, 0x0B ; 11 1d11e: 8b 9f mul r24, r27 1d120: c0 01 movw r24, r0 1d122: 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); 1d124: 70 e0 ldi r23, 0x00 ; 0 1d126: 60 e0 ldi r22, 0x00 ; 0 1d128: 80 5b subi r24, 0xB0 ; 176 1d12a: 92 4f sbci r25, 0xF2 ; 242 1d12c: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 } 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(); 1d130: 0e 94 70 67 call 0xcee0 ; 0xcee0 // 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); 1d134: ef e9 ldi r30, 0x9F ; 159 1d136: f3 e1 ldi r31, 0x13 ; 19 1d138: 84 ec ldi r24, 0xC4 ; 196 1d13a: df 01 movw r26, r30 1d13c: 1d 92 st X+, r1 1d13e: 8a 95 dec r24 1d140: e9 f7 brne .-6 ; 0x1d13c { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 1d142: 8b e3 ldi r24, 0x3B ; 59 1d144: 92 e9 ldi r25, 0x92 ; 146 1d146: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 MYSERIAL.println(int(iteration + 1)); 1d14a: 81 e0 ldi r24, 0x01 ; 1 1d14c: 90 e0 ldi r25, 0x00 ; 0 1d14e: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 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)); 1d152: 83 ec ldi r24, 0xC3 ; 195 1d154: 98 e4 ldi r25, 0x48 ; 72 1d156: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1d15a: 0f 94 7d 35 call 0x26afa ; 0x26afa #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; 1d15e: c0 92 49 07 sts 0x0749, r12 ; 0x800749 1d162: d0 92 4a 07 sts 0x074A, r13 ; 0x80074a 1d166: e0 92 4b 07 sts 0x074B, r14 ; 0x80074b 1d16a: f0 92 4c 07 sts 0x074C, r15 ; 0x80074c 1d16e: b2 e0 ldi r27, 0x02 ; 2 1d170: e1 96 adiw r28, 0x31 ; 49 1d172: bf af std Y+63, r27 ; 0x3f 1d174: e1 97 sbiw r28, 0x31 ; 49 1d176: 26 e1 ldi r18, 0x16 ; 22 1d178: 32 e9 ldi r19, 0x92 ; 146 1d17a: cd 56 subi r28, 0x6D ; 109 1d17c: df 4f sbci r29, 0xFF ; 255 1d17e: 39 83 std Y+1, r19 ; 0x01 1d180: 28 83 st Y, r18 1d182: c3 59 subi r28, 0x93 ; 147 1d184: d0 40 sbci r29, 0x00 ; 0 1d186: 4e e9 ldi r20, 0x9E ; 158 1d188: 53 e1 ldi r21, 0x13 ; 19 1d18a: cf 56 subi r28, 0x6F ; 111 1d18c: df 4f sbci r29, 0xFF ; 255 1d18e: 59 83 std Y+1, r21 ; 0x01 1d190: 48 83 st Y, r20 1d192: c1 59 subi r28, 0x91 ; 145 1d194: d0 40 sbci r29, 0x00 ; 0 1d196: a0 96 adiw r28, 0x20 ; 32 1d198: 5f af std Y+63, r21 ; 0x3f 1d19a: 4e af std Y+62, r20 ; 0x3e 1d19c: a0 97 sbiw r28, 0x20 ; 32 1d19e: e0 96 adiw r28, 0x30 ; 48 1d1a0: 3f af std Y+63, r19 ; 0x3f 1d1a2: 2e af std Y+62, r18 ; 0x3e 1d1a4: 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; 1d1a6: a7 96 adiw r28, 0x27 ; 39 1d1a8: 1f ae std Y+63, r1 ; 0x3f 1d1aa: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 1d1ac: 31 2c mov r3, r1 1d1ae: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 1d1b0: 0e 94 70 67 call 0xcee0 ; 0xcee0 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 1d1b4: 63 e0 ldi r22, 0x03 ; 3 1d1b6: 80 e0 ldi r24, 0x00 ; 0 1d1b8: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%d/4"),(k+1)); 1d1bc: bf ef ldi r27, 0xFF ; 255 1d1be: 2b 1a sub r2, r27 1d1c0: 3b 0a sbc r3, r27 1d1c2: 3f 92 push r3 1d1c4: 2f 92 push r2 1d1c6: e6 e3 ldi r30, 0x36 ; 54 1d1c8: f2 e9 ldi r31, 0x92 ; 146 1d1ca: ff 93 push r31 1d1cc: ef 93 push r30 1d1ce: 0e 94 66 6f call 0xdecc ; 0xdecc } #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); 1d1d2: 65 e5 ldi r22, 0x55 ; 85 1d1d4: 75 e5 ldi r23, 0x55 ; 85 1d1d6: 85 e5 ldi r24, 0x55 ; 85 1d1d8: 91 e4 ldi r25, 0x41 ; 65 1d1da: 0f 94 48 c3 call 0x38690 ; 0x38690 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); 1d1de: e0 96 adiw r28, 0x30 ; 48 1d1e0: ee ad ldd r30, Y+62 ; 0x3e 1d1e2: ff ad ldd r31, Y+63 ; 0x3f 1d1e4: e0 97 sbiw r28, 0x30 ; 48 1d1e6: 85 91 lpm r24, Z+ 1d1e8: 95 91 lpm r25, Z+ 1d1ea: a5 91 lpm r26, Z+ 1d1ec: b4 91 lpm r27, Z 1d1ee: 80 93 41 07 sts 0x0741, r24 ; 0x800741 1d1f2: 90 93 42 07 sts 0x0742, r25 ; 0x800742 1d1f6: a0 93 43 07 sts 0x0743, r26 ; 0x800743 1d1fa: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 1d1fe: e0 96 adiw r28, 0x30 ; 48 1d200: ee ad ldd r30, Y+62 ; 0x3e 1d202: ff ad ldd r31, Y+63 ; 0x3f 1d204: e0 97 sbiw r28, 0x30 ; 48 1d206: 34 96 adiw r30, 0x04 ; 4 1d208: 85 91 lpm r24, Z+ 1d20a: 95 91 lpm r25, Z+ 1d20c: a5 91 lpm r26, Z+ 1d20e: b4 91 lpm r27, Z 1d210: 80 93 45 07 sts 0x0745, r24 ; 0x800745 1d214: 90 93 46 07 sts 0x0746, r25 ; 0x800746 1d218: a0 93 47 07 sts 0x0747, r26 ; 0x800747 1d21c: b0 93 48 07 sts 0x0748, r27 ; 0x800748 MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 1d220: 60 e0 ldi r22, 0x00 ; 0 1d222: 70 e0 ldi r23, 0x00 ; 0 1d224: 88 e4 ldi r24, 0x48 ; 72 1d226: 92 e4 ldi r25, 0x42 ; 66 1d228: 0f 94 48 c3 call 0x38690 ; 0x38690 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 1d22c: 4b e9 ldi r20, 0x9B ; 155 1d22e: 50 e9 ldi r21, 0x90 ; 144 1d230: 5f 93 push r21 1d232: 4f 93 push r20 1d234: 0f 94 4b dc call 0x3b896 ; 0x3b896 lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 1d238: 4a e8 ldi r20, 0x8A ; 138 1d23a: 50 e9 ldi r21, 0x90 ; 144 1d23c: 63 e0 ldi r22, 0x03 ; 3 1d23e: 84 e0 ldi r24, 0x04 ; 4 1d240: 0e 94 a1 6f call 0xdf42 ; 0xdf42 // disable heaters and stop motion before we initialize sm4 disable_heater(); 1d244: 0f 94 4f 45 call 0x28a9e ; 0x28a9e st_synchronize(); 1d248: 0f 94 24 59 call 0x2b248 ; 0x2b248 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 1d24c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d250: 8d 7f andi r24, 0xFD ; 253 1d252: 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" ); 1d256: 0f b6 in r0, 0x3f ; 63 1d258: f8 94 cli 1d25a: a8 95 wdr 1d25c: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d260: 88 61 ori r24, 0x18 ; 24 1d262: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d266: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d26a: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 1d26c: 10 92 67 05 sts 0x0567, r1 ; 0x800567 1d270: 10 92 66 05 sts 0x0566, r1 ; 0x800566 sm4_update_pos_cb = xyzcal_update_pos; 1d274: 87 ee ldi r24, 0xE7 ; 231 1d276: 9f ec ldi r25, 0xCF ; 207 1d278: 90 93 65 05 sts 0x0565, r25 ; 0x800565 1d27c: 80 93 64 05 sts 0x0564, r24 ; 0x800564 sm4_calc_delay_cb = xyzcal_calc_delay; 1d280: a7 e7 ldi r26, 0x77 ; 119 1d282: bf ec ldi r27, 0xCF ; 207 1d284: b0 93 63 05 sts 0x0563, r27 ; 0x800563 1d288: a0 93 62 05 sts 0x0562, r26 ; 0x800562 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]); 1d28c: 00 91 6a 07 lds r16, 0x076A ; 0x80076a 1d290: 10 91 6b 07 lds r17, 0x076B ; 0x80076b 1d294: 20 91 6c 07 lds r18, 0x076C ; 0x80076c 1d298: 30 91 6d 07 lds r19, 0x076D ; 0x80076d 1d29c: 40 91 66 07 lds r20, 0x0766 ; 0x800766 1d2a0: 50 91 67 07 lds r21, 0x0767 ; 0x800767 1d2a4: 60 91 68 07 lds r22, 0x0768 ; 0x800768 1d2a8: 70 91 69 07 lds r23, 0x0769 ; 0x800769 1d2ac: 80 91 62 07 lds r24, 0x0762 ; 0x800762 1d2b0: 90 91 63 07 lds r25, 0x0763 ; 0x800763 1d2b4: a0 91 64 07 lds r26, 0x0764 ; 0x800764 1d2b8: b0 91 65 07 lds r27, 0x0765 ; 0x800765 1d2bc: 3f 93 push r19 1d2be: 2f 93 push r18 1d2c0: 1f 93 push r17 1d2c2: 0f 93 push r16 1d2c4: 7f 93 push r23 1d2c6: 6f 93 push r22 1d2c8: 5f 93 push r21 1d2ca: 4f 93 push r20 1d2cc: bf 93 push r27 1d2ce: af 93 push r26 1d2d0: 9f 93 push r25 1d2d2: 8f 93 push r24 1d2d4: ea e3 ldi r30, 0x3A ; 58 1d2d6: f1 e9 ldi r31, 0x91 ; 145 1d2d8: ff 93 push r31 1d2da: ef 93 push r30 1d2dc: 0f 94 4b dc call 0x3b896 ; 0x3b896 int16_t x0 = _X; 1d2e0: 40 90 62 07 lds r4, 0x0762 ; 0x800762 1d2e4: 50 90 63 07 lds r5, 0x0763 ; 0x800763 1d2e8: 60 90 64 07 lds r6, 0x0764 ; 0x800764 1d2ec: 70 90 65 07 lds r7, 0x0765 ; 0x800765 1d2f0: b4 2c mov r11, r4 1d2f2: a5 2c mov r10, r5 int16_t y0 = _Y; 1d2f4: 80 91 66 07 lds r24, 0x0766 ; 0x800766 1d2f8: 90 91 67 07 lds r25, 0x0767 ; 0x800767 1d2fc: a0 91 68 07 lds r26, 0x0768 ; 0x800768 1d300: b0 91 69 07 lds r27, 0x0769 ; 0x800769 1d304: a6 96 adiw r28, 0x26 ; 38 1d306: 8c af std Y+60, r24 ; 0x3c 1d308: 9d af std Y+61, r25 ; 0x3d 1d30a: ae af std Y+62, r26 ; 0x3e 1d30c: bf af std Y+63, r27 ; 0x3f 1d30e: a6 97 sbiw r28, 0x26 ; 38 1d310: a3 96 adiw r28, 0x23 ; 35 1d312: 9f ac ldd r9, Y+63 ; 0x3f 1d314: a3 97 sbiw r28, 0x23 ; 35 1d316: a4 96 adiw r28, 0x24 ; 36 1d318: 8f ac ldd r8, Y+63 ; 0x3f 1d31a: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 1d31c: c0 90 6a 07 lds r12, 0x076A ; 0x80076a 1d320: d0 90 6b 07 lds r13, 0x076B ; 0x80076b 1d324: e0 90 6c 07 lds r14, 0x076C ; 0x80076c 1d328: f0 90 6d 07 lds r15, 0x076D ; 0x80076d 1d32c: 0f b6 in r0, 0x3f ; 63 1d32e: f8 94 cli 1d330: de bf out 0x3e, r29 ; 62 1d332: 0f be out 0x3f, r0 ; 63 1d334: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 1d336: b5 e0 ldi r27, 0x05 ; 5 1d338: cb 16 cp r12, r27 1d33a: b7 ef ldi r27, 0xF7 ; 247 1d33c: db 06 cpc r13, r27 1d33e: 0c f4 brge .+2 ; 0x1d342 1d340: d9 c1 rjmp .+946 ; 0x1d6f4 } 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; 1d342: 1a 82 std Y+2, r1 ; 0x02 1d344: 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); 1d346: 1f 92 push r1 1d348: 1f 92 push r1 1d34a: e3 e0 ldi r30, 0x03 ; 3 1d34c: ef 93 push r30 1d34e: f4 e8 ldi r31, 0x84 ; 132 1d350: ff 93 push r31 1d352: 1f 92 push r1 1d354: 24 e6 ldi r18, 0x64 ; 100 1d356: 2f 93 push r18 1d358: df 92 push r13 1d35a: cf 92 push r12 1d35c: 8f 92 push r8 1d35e: 9f 92 push r9 1d360: af 92 push r10 1d362: bf 92 push r11 1d364: 41 eb ldi r20, 0xB1 ; 177 1d366: 50 e9 ldi r21, 0x90 ; 144 1d368: 5f 93 push r21 1d36a: 4f 93 push r20 1d36c: 0f 94 4b dc call 0x3b896 ; 0x3b896 if (!ret && (ad < 720)) 1d370: 0f b6 in r0, 0x3f ; 63 1d372: f8 94 cli 1d374: de bf out 0x3e, r29 ; 62 1d376: 0f be out 0x3f, r0 ; 63 1d378: cd bf out 0x3d, r28 ; 61 1d37a: 89 81 ldd r24, Y+1 ; 0x01 1d37c: 9a 81 ldd r25, Y+2 ; 0x02 1d37e: 80 3d cpi r24, 0xD0 ; 208 1d380: 92 40 sbci r25, 0x02 ; 2 1d382: 08 f4 brcc .+2 ; 0x1d386 1d384: 82 c1 rjmp .+772 ; 0x1d68a if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 1d386: 89 81 ldd r24, Y+1 ; 0x01 1d388: 9a 81 ldd r25, Y+2 ; 0x02 1d38a: 80 3a cpi r24, 0xA0 ; 160 1d38c: 95 40 sbci r25, 0x05 ; 5 1d38e: 10 f0 brcs .+4 ; 0x1d394 1d390: 0c 94 c5 f8 jmp 0x1f18a ; 0x1f18a if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 1d394: 9e 01 movw r18, r28 1d396: 2f 5f subi r18, 0xFF ; 255 1d398: 3f 4f sbci r19, 0xFF ; 255 1d39a: 79 01 movw r14, r18 1d39c: 10 e0 ldi r17, 0x00 ; 0 1d39e: 00 e0 ldi r16, 0x00 ; 0 1d3a0: 2c e7 ldi r18, 0x7C ; 124 1d3a2: 3c ef ldi r19, 0xFC ; 252 1d3a4: a6 01 movw r20, r12 1d3a6: 44 56 subi r20, 0x64 ; 100 1d3a8: 51 09 sbc r21, r1 1d3aa: 69 2d mov r22, r9 1d3ac: 78 2d mov r23, r8 1d3ae: 8b 2d mov r24, r11 1d3b0: 9a 2d mov r25, r10 1d3b2: 0f 94 0f 95 call 0x32a1e ; 0x32a1e 1d3b6: 88 23 and r24, r24 1d3b8: 11 f4 brne .+4 ; 0x1d3be 1d3ba: 0c 94 c5 f8 jmp 0x1f18a ; 0x1f18a ad += 720; 1d3be: 89 81 ldd r24, Y+1 ; 0x01 1d3c0: 9a 81 ldd r25, Y+2 ; 0x02 1d3c2: 80 53 subi r24, 0x30 ; 48 1d3c4: 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); 1d3c6: c0 90 6a 07 lds r12, 0x076A ; 0x80076a 1d3ca: d0 90 6b 07 lds r13, 0x076B ; 0x80076b 1d3ce: e0 90 6c 07 lds r14, 0x076C ; 0x80076c 1d3d2: f0 90 6d 07 lds r15, 0x076D ; 0x80076d 1d3d6: 00 91 66 07 lds r16, 0x0766 ; 0x800766 1d3da: 10 91 67 07 lds r17, 0x0767 ; 0x800767 1d3de: 20 91 68 07 lds r18, 0x0768 ; 0x800768 1d3e2: 30 91 69 07 lds r19, 0x0769 ; 0x800769 1d3e6: 40 91 62 07 lds r20, 0x0762 ; 0x800762 1d3ea: 50 91 63 07 lds r21, 0x0763 ; 0x800763 1d3ee: 60 91 64 07 lds r22, 0x0764 ; 0x800764 1d3f2: 70 91 65 07 lds r23, 0x0765 ; 0x800765 1d3f6: 9f 93 push r25 1d3f8: 8f 93 push r24 1d3fa: df 92 push r13 1d3fc: cf 92 push r12 1d3fe: 1f 93 push r17 1d400: 0f 93 push r16 1d402: 5f 93 push r21 1d404: 4f 93 push r20 1d406: 86 e1 ldi r24, 0x16 ; 22 1d408: 91 e9 ldi r25, 0x91 ; 145 1d40a: 9f 93 push r25 1d40c: 8f 93 push r24 1d40e: 0f 94 4b dc call 0x3b896 ; 0x3b896 /// 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); 1d412: 40 91 6a 07 lds r20, 0x076A ; 0x80076a 1d416: 50 91 6b 07 lds r21, 0x076B ; 0x80076b 1d41a: 60 91 6c 07 lds r22, 0x076C ; 0x80076c 1d41e: 70 91 6d 07 lds r23, 0x076D ; 0x80076d 1d422: 48 54 subi r20, 0x48 ; 72 1d424: 51 09 sbc r21, r1 1d426: 00 e0 ldi r16, 0x00 ; 0 1d428: 28 ec ldi r18, 0xC8 ; 200 1d42a: 30 e0 ldi r19, 0x00 ; 0 1d42c: a3 96 adiw r28, 0x23 ; 35 1d42e: 6f ad ldd r22, Y+63 ; 0x3f 1d430: a3 97 sbiw r28, 0x23 ; 35 1d432: a4 96 adiw r28, 0x24 ; 36 1d434: 7f ad ldd r23, Y+63 ; 0x3f 1d436: a4 97 sbiw r28, 0x24 ; 36 1d438: c2 01 movw r24, r4 1d43a: 0e 94 ec e1 call 0x1c3d8 ; 0x1c3d8 /// 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; 1d43e: 20 91 62 07 lds r18, 0x0762 ; 0x800762 1d442: 30 91 63 07 lds r19, 0x0763 ; 0x800763 1d446: 40 91 64 07 lds r20, 0x0764 ; 0x800764 1d44a: 50 91 65 07 lds r21, 0x0765 ; 0x800765 1d44e: 6e 96 adiw r28, 0x1e ; 30 1d450: 2c af std Y+60, r18 ; 0x3c 1d452: 3d af std Y+61, r19 ; 0x3d 1d454: 4e af std Y+62, r20 ; 0x3e 1d456: 5f af std Y+63, r21 ; 0x3f 1d458: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 1d45a: 80 91 66 07 lds r24, 0x0766 ; 0x800766 1d45e: 90 91 67 07 lds r25, 0x0767 ; 0x800767 1d462: a0 91 68 07 lds r26, 0x0768 ; 0x800768 1d466: b0 91 69 07 lds r27, 0x0769 ; 0x800769 1d46a: ae 96 adiw r28, 0x2e ; 46 1d46c: 8c af std Y+60, r24 ; 0x3c 1d46e: 9d af std Y+61, r25 ; 0x3d 1d470: ae af std Y+62, r26 ; 0x3e 1d472: bf af std Y+63, r27 ; 0x3f 1d474: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 1d476: 20 91 6a 07 lds r18, 0x076A ; 0x80076a 1d47a: 30 91 6b 07 lds r19, 0x076B ; 0x80076b 1d47e: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 1d482: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 1d486: e9 96 adiw r28, 0x39 ; 57 1d488: 2c af std Y+60, r18 ; 0x3c 1d48a: 3d af std Y+61, r19 ; 0x3d 1d48c: 4e af std Y+62, r20 ; 0x3e 1d48e: 5f af std Y+63, r21 ; 0x3f 1d490: e9 97 sbiw r28, 0x39 ; 57 1d492: a4 e7 ldi r26, 0x74 ; 116 1d494: bb e0 ldi r27, 0x0B ; 11 1d496: 0f b6 in r0, 0x3f ; 63 1d498: f8 94 cli 1d49a: de bf out 0x3e, r29 ; 62 1d49c: 0f be out 0x3f, r0 ; 63 1d49e: cd bf out 0x3d, r28 ; 61 1d4a0: 90 e0 ldi r25, 0x00 ; 0 1d4a2: 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)); 1d4a4: fc 01 movw r30, r24 1d4a6: ef 54 subi r30, 0x4F ; 79 1d4a8: fe 46 sbci r31, 0x6E ; 110 1d4aa: 25 91 lpm r18, Z+ 1d4ac: 34 91 lpm r19, Z 1d4ae: 2d 93 st X+, r18 1d4b0: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 1d4b2: fc 01 movw r30, r24 1d4b4: e7 56 subi r30, 0x67 ; 103 1d4b6: fe 46 sbci r31, 0x6E ; 110 1d4b8: 25 91 lpm r18, Z+ 1d4ba: 34 91 lpm r19, Z 1d4bc: 57 96 adiw r26, 0x17 ; 23 1d4be: 3c 93 st X, r19 1d4c0: 2e 93 st -X, r18 1d4c2: 56 97 sbiw r26, 0x16 ; 22 1d4c4: 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++){ 1d4c6: 88 31 cpi r24, 0x18 ; 24 1d4c8: 91 05 cpc r25, r1 1d4ca: 61 f7 brne .-40 ; 0x1d4a4 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); 1d4cc: e7 96 adiw r28, 0x37 ; 55 1d4ce: 4e ad ldd r20, Y+62 ; 0x3e 1d4d0: 5f ad ldd r21, Y+63 ; 0x3f 1d4d2: e7 97 sbiw r28, 0x37 ; 55 1d4d4: ac 96 adiw r28, 0x2c ; 44 1d4d6: 6e ad ldd r22, Y+62 ; 0x3e 1d4d8: 7f ad ldd r23, Y+63 ; 0x3f 1d4da: ac 97 sbiw r28, 0x2c ; 44 1d4dc: 6c 96 adiw r28, 0x1c ; 28 1d4de: 8e ad ldd r24, Y+62 ; 0x3e 1d4e0: 9f ad ldd r25, Y+63 ; 0x3f 1d4e2: 6c 97 sbiw r28, 0x1c ; 28 1d4e4: 0f 94 97 91 call 0x3232e ; 0x3232e 1d4e8: 24 e7 ldi r18, 0x74 ; 116 1d4ea: 37 e0 ldi r19, 0x07 ; 7 1d4ec: a4 96 adiw r28, 0x24 ; 36 1d4ee: 3f af std Y+63, r19 ; 0x3f 1d4f0: 2e af std Y+62, r18 ; 0x3e 1d4f2: a4 97 sbiw r28, 0x24 ; 36 1d4f4: 79 01 movw r14, r18 1d4f6: f0 e2 ldi r31, 0x20 ; 32 1d4f8: 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]); 1d4fa: ac e5 ldi r26, 0x5C ; 92 1d4fc: ca 2e mov r12, r26 1d4fe: a1 e9 ldi r26, 0x91 ; 145 1d500: da 2e mov r13, r26 } DBG(endl); 1d502: 0e ee ldi r16, 0xEE ; 238 1d504: 14 ea ldi r17, 0xA4 ; 164 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); 1d506: 57 01 movw r10, r14 1d508: e0 e2 ldi r30, 0x20 ; 32 1d50a: 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]); 1d50c: d5 01 movw r26, r10 1d50e: 8d 91 ld r24, X+ 1d510: 5d 01 movw r10, r26 1d512: 1f 92 push r1 1d514: 8f 93 push r24 1d516: df 92 push r13 1d518: cf 92 push r12 1d51a: 0f 94 4b dc call 0x3b896 ; 0x3b896 1d51e: 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){ 1d520: 0f 90 pop r0 1d522: 0f 90 pop r0 1d524: 0f 90 pop r0 1d526: 0f 90 pop r0 1d528: 81 10 cpse r8, r1 1d52a: f0 cf rjmp .-32 ; 0x1d50c DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 1d52c: 1f 93 push r17 1d52e: 0f 93 push r16 1d530: 0f 94 4b dc call 0x3b896 ; 0x3b896 1d534: 9a 94 dec r9 1d536: b0 e2 ldi r27, 0x20 ; 32 1d538: eb 0e add r14, r27 1d53a: 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){ 1d53c: 0f 90 pop r0 1d53e: 0f 90 pop r0 1d540: 91 10 cpse r9, r1 1d542: e1 cf rjmp .-62 ; 0x1d506 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 1d544: 1f 93 push r17 1d546: 0f 93 push r16 1d548: 0f 94 4b dc call 0x3b896 ; 0x3b896 1d54c: 64 e7 ldi r22, 0x74 ; 116 1d54e: 7b e0 ldi r23, 0x0B ; 11 1d550: 0f 90 pop r0 1d552: 0f 90 pop r0 1d554: e4 e7 ldi r30, 0x74 ; 116 1d556: 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; 1d558: 90 e0 ldi r25, 0x00 ; 0 1d55a: 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; 1d55c: 50 e0 ldi r21, 0x00 ; 0 1d55e: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 1d560: 21 91 ld r18, Z+ 1d562: 21 11 cpse r18, r1 1d564: 07 c3 rjmp .+1550 ; 0x1db74 ++mins; 1d566: 4f 5f subi r20, 0xFF ; 255 1d568: 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){ 1d56a: 6e 17 cp r22, r30 1d56c: 7f 07 cpc r23, r31 1d56e: c1 f7 brne .-16 ; 0x1d560 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 1d570: 9a 01 movw r18, r20 1d572: 28 0f add r18, r24 1d574: 39 1f adc r19, r25 1d576: 25 38 cpi r18, 0x85 ; 133 1d578: 33 40 sbci r19, 0x03 ; 3 1d57a: a4 f0 brlt .+40 ; 0x1d5a4 && mins > threshold_extreme 1d57c: 43 33 cpi r20, 0x33 ; 51 1d57e: 51 05 cpc r21, r1 1d580: 8c f0 brlt .+34 ; 0x1d5a4 && maxs > threshold_extreme 1d582: 83 33 cpi r24, 0x33 ; 51 1d584: 91 05 cpc r25, r1 1d586: 74 f0 brlt .+28 ; 0x1d5a4 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 1d588: 20 e0 ldi r18, 0x00 ; 0 1d58a: 34 e0 ldi r19, 0x04 ; 4 1d58c: 24 1b sub r18, r20 1d58e: 35 0b sbc r19, r21 1d590: 28 1b sub r18, r24 1d592: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 1d594: 24 17 cp r18, r20 1d596: 35 07 cpc r19, r21 1d598: 2c f4 brge .+10 ; 0x1d5a4 } 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; 1d59a: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 1d59c: 28 17 cp r18, r24 1d59e: 39 07 cpc r19, r25 1d5a0: 0c f4 brge .+2 ; 0x1d5a4 1d5a2: d8 c0 rjmp .+432 ; 0x1d754 } /// 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; 1d5a4: 66 96 adiw r28, 0x16 ; 22 1d5a6: 1f ae std Y+63, r1 ; 0x3f 1d5a8: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 1d5aa: 62 96 adiw r28, 0x12 ; 18 1d5ac: 1f ae std Y+63, r1 ; 0x3f 1d5ae: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 1d5b0: 22 96 adiw r28, 0x02 ; 2 1d5b2: 1f ae std Y+63, r1 ; 0x3f 1d5b4: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 1d5b6: 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) 1d5b8: 84 e7 ldi r24, 0x74 ; 116 1d5ba: 97 e0 ldi r25, 0x07 ; 7 1d5bc: 89 2b or r24, r25 1d5be: 99 f0 breq .+38 ; 0x1d5e6 1d5c0: 84 e7 ldi r24, 0x74 ; 116 1d5c2: 9b e0 ldi r25, 0x0B ; 11 return -1; 1d5c4: 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) 1d5c6: 00 97 sbiw r24, 0x00 ; 0 1d5c8: 49 f0 breq .+18 ; 0x1d5dc 1d5ca: ae 01 movw r20, r28 1d5cc: 4f 5a subi r20, 0xAF ; 175 1d5ce: 5f 4f sbci r21, 0xFF ; 255 1d5d0: be 01 movw r22, r28 1d5d2: 6b 5a subi r22, 0xAB ; 171 1d5d4: 7f 4f sbci r23, 0xFF ; 255 1d5d6: 0f 94 ba 90 call 0x32174 ; 0x32174 1d5da: 08 2f mov r16, r24 1d5dc: 8c e8 ldi r24, 0x8C ; 140 1d5de: 9b e0 ldi r25, 0x0B ; 11 1d5e0: 89 2b or r24, r25 1d5e2: 09 f0 breq .+2 ; 0x1d5e6 1d5e4: cc c2 rjmp .+1432 ; 0x1db7e 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; 1d5e6: 8f ef ldi r24, 0xFF ; 255 1d5e8: dc c2 rjmp .+1464 ; 0x1dba2 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)); 1d5ea: 83 ec ldi r24, 0xC3 ; 195 1d5ec: 98 e4 ldi r25, 0x48 ; 72 1d5ee: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1d5f2: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_puts_at_P(0,3,_n("1/4")); 1d5f6: 4f e8 ldi r20, 0x8F ; 143 1d5f8: 5e e6 ldi r21, 0x6E ; 110 1d5fa: 23 cd rjmp .-1466 ; 0x1d042 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 1d5fc: 87 e4 ldi r24, 0x47 ; 71 1d5fe: 92 e9 ldi r25, 0x92 ; 146 // 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); 1d600: 0f 94 04 36 call 0x26c08 ; 0x26c08 1d604: 06 cd rjmp .-1524 ; 0x1d012 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); 1d606: c7 55 subi r28, 0x57 ; 87 1d608: df 4f sbci r29, 0xFF ; 255 1d60a: 88 81 ld r24, Y 1d60c: 99 81 ldd r25, Y+1 ; 0x01 1d60e: c9 5a subi r28, 0xA9 ; 169 1d610: d0 40 sbci r29, 0x00 ; 0 1d612: 0e 94 7b 67 call 0xcef6 ; 0xcef6 // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 1d616: 0f 94 0d cc call 0x3981a ; 0x3981a // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 1d61a: 0f 94 ab c9 call 0x39356 ; 0x39356 //FIXME bool result = sample_mesh_and_store_reference(); 1d61e: 0f 94 ba c7 call 0x38f74 ; 0x38f74 1d622: e5 96 adiw r28, 0x35 ; 53 1d624: 8f af std Y+63, r24 ; 0x3f 1d626: e5 97 sbiw r28, 0x35 ; 53 if (result) 1d628: 88 23 and r24, r24 1d62a: 09 f4 brne .+2 ; 0x1d62e 1d62c: f2 cc rjmp .-1564 ; 0x1d012 { calibration_status_set(CALIBRATION_STATUS_Z); 1d62e: 84 e0 ldi r24, 0x04 ; 4 1d630: 0e 94 5e e7 call 0x1cebc ; 0x1cebc } else { // Timeouted. } lcd_update_enable(true); 1d634: 81 e0 ldi r24, 0x01 ; 1 1d636: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 #ifdef TMC2130 FORCE_HIGH_POWER_END; 1d63a: 80 e0 ldi r24, 0x00 ; 0 1d63c: 0e 94 5d 67 call 0xceba ; 0xceba #endif // TMC2130 FORCE_BL_ON_END; 1d640: 80 e0 ldi r24, 0x00 ; 0 1d642: 0e 94 74 8b call 0x116e8 ; 0x116e8 return final_result; } 1d646: e5 96 adiw r28, 0x35 ; 53 1d648: 8f ad ldd r24, Y+63 ; 0x3f 1d64a: e5 97 sbiw r28, 0x35 ; 53 1d64c: c2 53 subi r28, 0x32 ; 50 1d64e: df 4f sbci r29, 0xFF ; 255 1d650: 0f b6 in r0, 0x3f ; 63 1d652: f8 94 cli 1d654: de bf out 0x3e, r29 ; 62 1d656: 0f be out 0x3f, r0 ; 63 1d658: cd bf out 0x3d, r28 ; 61 1d65a: df 91 pop r29 1d65c: cf 91 pop r28 1d65e: 1f 91 pop r17 1d660: 0f 91 pop r16 1d662: ff 90 pop r15 1d664: ef 90 pop r14 1d666: df 90 pop r13 1d668: cf 90 pop r12 1d66a: bf 90 pop r11 1d66c: af 90 pop r10 1d66e: 9f 90 pop r9 1d670: 8f 90 pop r8 1d672: 7f 90 pop r7 1d674: 6f 90 pop r6 1d676: 5f 90 pop r5 1d678: 4f 90 pop r4 1d67a: 3f 90 pop r3 1d67c: 2f 90 pop r2 1d67e: 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) { 1d680: e1 e0 ldi r30, 0x01 ; 1 1d682: e1 96 adiw r28, 0x31 ; 49 1d684: ef af std Y+63, r30 ; 0x3f 1d686: e1 97 sbiw r28, 0x31 ; 49 1d688: 76 cd rjmp .-1300 ; 0x1d176 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) 1d68a: fe 01 movw r30, r28 1d68c: 31 96 adiw r30, 0x01 ; 1 1d68e: 7f 01 movw r14, r30 1d690: 10 e0 ldi r17, 0x00 ; 0 1d692: 00 e0 ldi r16, 0x00 ; 0 1d694: 24 e8 ldi r18, 0x84 ; 132 1d696: 33 e0 ldi r19, 0x03 ; 3 1d698: a6 01 movw r20, r12 1d69a: 69 2d mov r22, r9 1d69c: 78 2d mov r23, r8 1d69e: 8b 2d mov r24, r11 1d6a0: 9a 2d mov r25, r10 1d6a2: 0f 94 0f 95 call 0x32a1e ; 0x32a1e ad += 0; if (!ret && (ad < 1440)) 1d6a6: 88 23 and r24, r24 1d6a8: 09 f4 brne .+2 ; 0x1d6ac 1d6aa: 6d ce rjmp .-806 ; 0x1d386 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; 1d6ac: 89 81 ldd r24, Y+1 ; 0x01 1d6ae: 9a 81 ldd r25, Y+2 ; 0x02 1d6b0: 8a ce rjmp .-748 ; 0x1d3c6 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)) 1d6b2: 89 81 ldd r24, Y+1 ; 0x01 1d6b4: 9a 81 ldd r25, Y+2 ; 0x02 1d6b6: 80 34 cpi r24, 0x40 ; 64 1d6b8: 9b 40 sbci r25, 0x0B ; 11 1d6ba: b8 f4 brcc .+46 ; 0x1d6ea if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 1d6bc: ce 01 movw r24, r28 1d6be: 01 96 adiw r24, 0x01 ; 1 1d6c0: 7c 01 movw r14, r24 1d6c2: 04 eb ldi r16, 0xB4 ; 180 1d6c4: 10 e0 ldi r17, 0x00 ; 0 1d6c6: 2c e7 ldi r18, 0x7C ; 124 1d6c8: 3c ef ldi r19, 0xFC ; 252 1d6ca: a6 01 movw r20, r12 1d6cc: 4c 52 subi r20, 0x2C ; 44 1d6ce: 51 40 sbci r21, 0x01 ; 1 1d6d0: 69 2d mov r22, r9 1d6d2: 78 2d mov r23, r8 1d6d4: 8b 2d mov r24, r11 1d6d6: 9a 2d mov r25, r10 1d6d8: 0f 94 0f 95 call 0x32a1e ; 0x32a1e 1d6dc: 88 23 and r24, r24 1d6de: 29 f0 breq .+10 ; 0x1d6ea ad += 2160; 1d6e0: 89 81 ldd r24, Y+1 ; 0x01 1d6e2: 9a 81 ldd r25, Y+2 ; 0x02 1d6e4: 80 59 subi r24, 0x90 ; 144 1d6e6: 97 4f sbci r25, 0xF7 ; 247 1d6e8: 6e ce rjmp .-804 ; 0x1d3c6 /// 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; 1d6ea: 90 e9 ldi r25, 0x90 ; 144 1d6ec: c9 1a sub r12, r25 1d6ee: 91 e0 ldi r25, 0x01 ; 1 1d6f0: d9 0a sbc r13, r25 1d6f2: 21 ce rjmp .-958 ; 0x1d336 } //@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]); 1d6f4: 00 91 6a 07 lds r16, 0x076A ; 0x80076a 1d6f8: 10 91 6b 07 lds r17, 0x076B ; 0x80076b 1d6fc: 20 91 6c 07 lds r18, 0x076C ; 0x80076c 1d700: 30 91 6d 07 lds r19, 0x076D ; 0x80076d 1d704: 40 91 66 07 lds r20, 0x0766 ; 0x800766 1d708: 50 91 67 07 lds r21, 0x0767 ; 0x800767 1d70c: 60 91 68 07 lds r22, 0x0768 ; 0x800768 1d710: 70 91 69 07 lds r23, 0x0769 ; 0x800769 1d714: 80 91 62 07 lds r24, 0x0762 ; 0x800762 1d718: 90 91 63 07 lds r25, 0x0763 ; 0x800763 1d71c: a0 91 64 07 lds r26, 0x0764 ; 0x800764 1d720: b0 91 65 07 lds r27, 0x0765 ; 0x800765 1d724: 3f 93 push r19 1d726: 2f 93 push r18 1d728: 1f 93 push r17 1d72a: 0f 93 push r16 1d72c: 7f 93 push r23 1d72e: 6f 93 push r22 1d730: 5f 93 push r21 1d732: 4f 93 push r20 1d734: bf 93 push r27 1d736: af 93 push r26 1d738: 9f 93 push r25 1d73a: 8f 93 push r24 1d73c: 89 ee ldi r24, 0xE9 ; 233 1d73e: 90 e9 ldi r25, 0x90 ; 144 1d740: 9f 93 push r25 1d742: 8f 93 push r24 1d744: 0f 94 4b dc call 0x3b896 ; 0x3b896 1d748: 0f b6 in r0, 0x3f ; 63 1d74a: f8 94 cli 1d74c: de bf out 0x3e, r29 ; 62 1d74e: 0f be out 0x3f, r0 ; 63 1d750: 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; 1d752: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 1d754: 89 ec ldi r24, 0xC9 ; 201 1d756: 91 e9 ldi r25, 0x91 ; 145 1d758: 9f 93 push r25 1d75a: 8f 93 push r24 1d75c: 0f 94 4b dc call 0x3b896 ; 0x3b896 lcd_set_cursor(4,3); 1d760: 63 e0 ldi r22, 0x03 ; 3 1d762: 84 e0 ldi r24, 0x04 ; 4 1d764: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_space(16); 1d768: 80 e1 ldi r24, 0x10 ; 16 1d76a: 0e 94 83 6f call 0xdf06 ; 0xdf06 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 1d76e: 0f 94 be ba call 0x3757c ; 0x3757c : "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" ); 1d772: 88 e1 ldi r24, 0x18 ; 24 1d774: 98 e2 ldi r25, 0x28 ; 40 1d776: 0f b6 in r0, 0x3f ; 63 1d778: f8 94 cli 1d77a: a8 95 wdr 1d77c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d780: 0f be out 0x3f, r0 ; 63 1d782: 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); 1d786: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d78a: 80 64 ori r24, 0x40 ; 64 1d78c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 1d790: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d794: 82 60 ori r24, 0x02 ; 2 1d796: 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){ 1d79a: 0f 90 pop r0 1d79c: 0f 90 pop r0 1d79e: 1d 3f cpi r17, 0xFD ; 253 1d7a0: 09 f4 brne .+2 ; 0x1d7a4 1d7a2: 64 c3 rjmp .+1736 ; 0x1de6c 1d7a4: 1f 3f cpi r17, 0xFF ; 255 1d7a6: 11 f4 brne .+4 ; 0x1d7ac 1d7a8: 0c 94 81 f8 jmp 0x1f102 ; 0x1f102 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); 1d7ac: 20 e0 ldi r18, 0x00 ; 0 1d7ae: 30 e0 ldi r19, 0x00 ; 0 1d7b0: a9 01 movw r20, r18 1d7b2: a0 96 adiw r28, 0x20 ; 32 1d7b4: ee ad ldd r30, Y+62 ; 0x3e 1d7b6: ff ad ldd r31, Y+63 ; 0x3f 1d7b8: a0 97 sbiw r28, 0x20 ; 32 1d7ba: 61 81 ldd r22, Z+1 ; 0x01 1d7bc: 72 81 ldd r23, Z+2 ; 0x02 1d7be: 83 81 ldd r24, Z+3 ; 0x03 1d7c0: 94 81 ldd r25, Z+4 ; 0x04 1d7c2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 1d7c6: 20 91 41 07 lds r18, 0x0741 ; 0x800741 1d7ca: 30 91 42 07 lds r19, 0x0742 ; 0x800742 1d7ce: 40 91 43 07 lds r20, 0x0743 ; 0x800743 1d7d2: 50 91 44 07 lds r21, 0x0744 ; 0x800744 1d7d6: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1d7da: a0 96 adiw r28, 0x20 ; 32 1d7dc: ae ad ldd r26, Y+62 ; 0x3e 1d7de: bf ad ldd r27, Y+63 ; 0x3f 1d7e0: a0 97 sbiw r28, 0x20 ; 32 1d7e2: 11 96 adiw r26, 0x01 ; 1 1d7e4: 6d 93 st X+, r22 1d7e6: 7d 93 st X+, r23 1d7e8: 8d 93 st X+, r24 1d7ea: 9c 93 st X, r25 1d7ec: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d7ee: c0 90 45 07 lds r12, 0x0745 ; 0x800745 1d7f2: d0 90 46 07 lds r13, 0x0746 ; 0x800746 1d7f6: e0 90 47 07 lds r14, 0x0747 ; 0x800747 1d7fa: f0 90 48 07 lds r15, 0x0748 ; 0x800748 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); 1d7fe: 20 e0 ldi r18, 0x00 ; 0 1d800: 30 e0 ldi r19, 0x00 ; 0 1d802: a9 01 movw r20, r18 1d804: 15 96 adiw r26, 0x05 ; 5 1d806: 6d 91 ld r22, X+ 1d808: 7d 91 ld r23, X+ 1d80a: 8d 91 ld r24, X+ 1d80c: 9c 91 ld r25, X 1d80e: 18 97 sbiw r26, 0x08 ; 8 1d810: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d814: a7 01 movw r20, r14 1d816: 96 01 movw r18, r12 1d818: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1d81c: a0 96 adiw r28, 0x20 ; 32 1d81e: ee ad ldd r30, Y+62 ; 0x3e 1d820: ff ad ldd r31, Y+63 ; 0x3f 1d822: a0 97 sbiw r28, 0x20 ; 32 1d824: 65 83 std Z+5, r22 ; 0x05 1d826: 76 83 std Z+6, r23 ; 0x06 1d828: 87 83 std Z+7, r24 ; 0x07 1d82a: 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) 1d82c: 20 e0 ldi r18, 0x00 ; 0 1d82e: 30 e0 ldi r19, 0x00 ; 0 1d830: 40 e8 ldi r20, 0x80 ; 128 1d832: 50 ec ldi r21, 0xC0 ; 192 1d834: c7 01 movw r24, r14 1d836: b6 01 movw r22, r12 1d838: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1d83c: 87 ff sbrs r24, 7 1d83e: 0c c0 rjmp .+24 ; 0x1d858 current_position[Y_AXIS] = Y_MIN_POS; 1d840: 80 e0 ldi r24, 0x00 ; 0 1d842: 90 e0 ldi r25, 0x00 ; 0 1d844: a0 e8 ldi r26, 0x80 ; 128 1d846: b0 ec ldi r27, 0xC0 ; 192 1d848: 80 93 45 07 sts 0x0745, r24 ; 0x800745 1d84c: 90 93 46 07 sts 0x0746, r25 ; 0x800746 1d850: a0 93 47 07 sts 0x0747, r26 ; 0x800747 1d854: b0 93 48 07 sts 0x0748, r27 ; 0x800748 // 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; 1d858: 20 e0 ldi r18, 0x00 ; 0 1d85a: 30 e0 ldi r19, 0x00 ; 0 1d85c: 40 e4 ldi r20, 0x40 ; 64 1d85e: 50 e4 ldi r21, 0x40 ; 64 1d860: 60 91 49 07 lds r22, 0x0749 ; 0x800749 1d864: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 1d868: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 1d86c: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 1d870: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1d874: 60 93 49 07 sts 0x0749, r22 ; 0x800749 1d878: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 1d87c: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 1d880: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 1d884: e0 96 adiw r28, 0x30 ; 48 1d886: 2e ad ldd r18, Y+62 ; 0x3e 1d888: 3f ad ldd r19, Y+63 ; 0x3f 1d88a: e0 97 sbiw r28, 0x30 ; 48 1d88c: 28 5f subi r18, 0xF8 ; 248 1d88e: 3f 4f sbci r19, 0xFF ; 255 1d890: e0 96 adiw r28, 0x30 ; 48 1d892: 3f af std Y+63, r19 ; 0x3f 1d894: 2e af std Y+62, r18 ; 0x3e 1d896: e0 97 sbiw r28, 0x30 ; 48 1d898: a0 96 adiw r28, 0x20 ; 32 1d89a: 4e ad ldd r20, Y+62 ; 0x3e 1d89c: 5f ad ldd r21, Y+63 ; 0x3f 1d89e: a0 97 sbiw r28, 0x20 ; 32 1d8a0: 48 5f subi r20, 0xF8 ; 248 1d8a2: 5f 4f sbci r21, 0xFF ; 255 1d8a4: a0 96 adiw r28, 0x20 ; 32 1d8a6: 5f af std Y+63, r21 ; 0x3f 1d8a8: 4e af std Y+62, r20 ; 0x3e 1d8aa: 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) { 1d8ac: 54 e0 ldi r21, 0x04 ; 4 1d8ae: 25 16 cp r2, r21 1d8b0: 31 04 cpc r3, r1 1d8b2: 09 f0 breq .+2 ; 0x1d8b6 1d8b4: 7d cc rjmp .-1798 ; 0x1d1b0 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 1d8b6: a7 96 adiw r28, 0x27 ; 39 1d8b8: 6f ad ldd r22, Y+63 ; 0x3f 1d8ba: a7 97 sbiw r28, 0x27 ; 39 1d8bc: 66 23 and r22, r22 1d8be: 31 f0 breq .+12 ; 0x1d8cc 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) { 1d8c0: e1 96 adiw r28, 0x31 ; 49 1d8c2: 8f ad ldd r24, Y+63 ; 0x3f 1d8c4: e1 97 sbiw r28, 0x31 ; 49 1d8c6: 81 30 cpi r24, 0x01 ; 1 1d8c8: 09 f0 breq .+2 ; 0x1d8cc 1d8ca: da ce rjmp .-588 ; 0x1d680 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 1d8cc: 8a e6 ldi r24, 0x6A ; 106 1d8ce: 9e e6 ldi r25, 0x6E ; 110 1d8d0: 9f 93 push r25 1d8d2: 8f 93 push r24 1d8d4: 0f 94 4b dc call 0x3b896 ; 0x3b896 delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 1d8d8: 90 e0 ldi r25, 0x00 ; 0 1d8da: 80 e0 ldi r24, 0x00 ; 0 1d8dc: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 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) { 1d8e0: 0f 90 pop r0 1d8e2: 0f 90 pop r0 1d8e4: 20 e0 ldi r18, 0x00 ; 0 1d8e6: 30 e0 ldi r19, 0x00 ; 0 1d8e8: 40 e9 ldi r20, 0x90 ; 144 1d8ea: 50 ec ldi r21, 0xC0 ; 192 1d8ec: 60 91 a3 13 lds r22, 0x13A3 ; 0x8013a3 1d8f0: 70 91 a4 13 lds r23, 0x13A4 ; 0x8013a4 1d8f4: 80 91 a5 13 lds r24, 0x13A5 ; 0x8013a5 1d8f8: 90 91 a6 13 lds r25, 0x13A6 ; 0x8013a6 1d8fc: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1d900: 87 ff sbrs r24, 7 1d902: bb c2 rjmp .+1398 ; 0x1de7a too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 1d904: 85 e1 ldi r24, 0x15 ; 21 1d906: 92 e9 ldi r25, 0x92 ; 146 1d908: 0e 94 fe 7a call 0xf5fc ; 0xf5fc SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 1d90c: 83 ee ldi r24, 0xE3 ; 227 1d90e: 91 e9 ldi r25, 0x91 ; 145 1d910: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1d914: 60 91 a3 13 lds r22, 0x13A3 ; 0x8013a3 1d918: 70 91 a4 13 lds r23, 0x13A4 ; 0x8013a4 1d91c: 80 91 a5 13 lds r24, 0x13A5 ; 0x8013a5 1d920: 90 91 a6 13 lds r25, 0x13A6 ; 0x8013a6 1d924: 42 e0 ldi r20, 0x02 ; 2 1d926: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 1d92a: 8f ed ldi r24, 0xDF ; 223 1d92c: 91 e9 ldi r25, 0x91 ; 145 1d92e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 1d932: 60 e0 ldi r22, 0x00 ; 0 1d934: 70 e0 ldi r23, 0x00 ; 0 1d936: 80 e9 ldi r24, 0x90 ; 144 1d938: 90 ec ldi r25, 0xC0 ; 192 1d93a: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 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 1d93e: 92 e0 ldi r25, 0x02 ; 2 1d940: af 96 adiw r28, 0x2f ; 47 1d942: 9f af std Y+63, r25 ; 0x3f 1d944: 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; 1d946: 10 92 cf 13 sts 0x13CF, r1 ; 0x8013cf 1d94a: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 1d94e: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 1d952: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 cntr[1] = 0.f; 1d956: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1d95a: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 1d95e: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 1d962: 10 92 d6 13 sts 0x13D6, r1 ; 0x8013d6 1d966: a4 e6 ldi r26, 0x64 ; 100 1d968: e6 96 adiw r28, 0x36 ; 54 1d96a: af af std Y+63, r26 ; 0x3f 1d96c: 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; 1d96e: a2 96 adiw r28, 0x22 ; 34 1d970: 1c ae std Y+60, r1 ; 0x3c 1d972: 1d ae std Y+61, r1 ; 0x3d 1d974: 1e ae std Y+62, r1 ; 0x3e 1d976: 1f ae std Y+63, r1 ; 0x3f 1d978: 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; 1d97a: a6 96 adiw r28, 0x26 ; 38 1d97c: 1c ae std Y+60, r1 ; 0x3c 1d97e: 1d ae std Y+61, r1 ; 0x3d 1d980: 1e ae std Y+62, r1 ; 0x3e 1d982: 1f ae std Y+63, r1 ; 0x3f 1d984: 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 }; 1d986: fe 01 movw r30, r28 1d988: 31 96 adiw r30, 0x01 ; 1 1d98a: 68 96 adiw r28, 0x18 ; 24 1d98c: ff af std Y+63, r31 ; 0x3f 1d98e: ee af std Y+62, r30 ; 0x3e 1d990: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 1d992: 9e 01 movw r18, r28 1d994: 2f 5b subi r18, 0xBF ; 191 1d996: 3f 4f sbci r19, 0xFF ; 255 1d998: 6a 96 adiw r28, 0x1a ; 26 1d99a: 3f af std Y+63, r19 ; 0x3f 1d99c: 2e af std Y+62, r18 ; 0x3e 1d99e: 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; 1d9a0: a6 96 adiw r28, 0x26 ; 38 1d9a2: 6c ad ldd r22, Y+60 ; 0x3c 1d9a4: 7d ad ldd r23, Y+61 ; 0x3d 1d9a6: 8e ad ldd r24, Y+62 ; 0x3e 1d9a8: 9f ad ldd r25, Y+63 ; 0x3f 1d9aa: a6 97 sbiw r28, 0x26 ; 38 1d9ac: 0f 94 ab df call 0x3bf56 ; 0x3bf56 1d9b0: 6e 96 adiw r28, 0x1e ; 30 1d9b2: 6c af std Y+60, r22 ; 0x3c 1d9b4: 7d af std Y+61, r23 ; 0x3d 1d9b6: 8e af std Y+62, r24 ; 0x3e 1d9b8: 9f af std Y+63, r25 ; 0x3f 1d9ba: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 1d9bc: a6 96 adiw r28, 0x26 ; 38 1d9be: 6c ad ldd r22, Y+60 ; 0x3c 1d9c0: 7d ad ldd r23, Y+61 ; 0x3d 1d9c2: 8e ad ldd r24, Y+62 ; 0x3e 1d9c4: 9f ad ldd r25, Y+63 ; 0x3f 1d9c6: a6 97 sbiw r28, 0x26 ; 38 1d9c8: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 1d9cc: cb 57 subi r28, 0x7B ; 123 1d9ce: df 4f sbci r29, 0xFF ; 255 1d9d0: 68 83 st Y, r22 1d9d2: 79 83 std Y+1, r23 ; 0x01 1d9d4: 8a 83 std Y+2, r24 ; 0x02 1d9d6: 9b 83 std Y+3, r25 ; 0x03 1d9d8: c5 58 subi r28, 0x85 ; 133 1d9da: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 1d9dc: a2 96 adiw r28, 0x22 ; 34 1d9de: 6c ad ldd r22, Y+60 ; 0x3c 1d9e0: 7d ad ldd r23, Y+61 ; 0x3d 1d9e2: 8e ad ldd r24, Y+62 ; 0x3e 1d9e4: 9f ad ldd r25, Y+63 ; 0x3f 1d9e6: a2 97 sbiw r28, 0x22 ; 34 1d9e8: 0f 94 ab df call 0x3bf56 ; 0x3bf56 1d9ec: c7 57 subi r28, 0x77 ; 119 1d9ee: df 4f sbci r29, 0xFF ; 255 1d9f0: 68 83 st Y, r22 1d9f2: 79 83 std Y+1, r23 ; 0x01 1d9f4: 8a 83 std Y+2, r24 ; 0x02 1d9f6: 9b 83 std Y+3, r25 ; 0x03 1d9f8: c9 58 subi r28, 0x89 ; 137 1d9fa: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 1d9fc: a2 96 adiw r28, 0x22 ; 34 1d9fe: 6c ad ldd r22, Y+60 ; 0x3c 1da00: 7d ad ldd r23, Y+61 ; 0x3d 1da02: 8e ad ldd r24, Y+62 ; 0x3e 1da04: 9f ad ldd r25, Y+63 ; 0x3f 1da06: a2 97 sbiw r28, 0x22 ; 34 1da08: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 1da0c: cb 56 subi r28, 0x6B ; 107 1da0e: df 4f sbci r29, 0xFF ; 255 1da10: 68 83 st Y, r22 1da12: 79 83 std Y+1, r23 ; 0x01 1da14: 8a 83 std Y+2, r24 ; 0x02 1da16: 9b 83 std Y+3, r25 ; 0x03 1da18: c5 59 subi r28, 0x95 ; 149 1da1a: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 1da1c: 68 96 adiw r28, 0x18 ; 24 1da1e: ae ad ldd r26, Y+62 ; 0x3e 1da20: bf ad ldd r27, Y+63 ; 0x3f 1da22: 68 97 sbiw r28, 0x18 ; 24 1da24: e0 e4 ldi r30, 0x40 ; 64 1da26: 1d 92 st X+, r1 1da28: ea 95 dec r30 1da2a: e9 f7 brne .-6 ; 0x1da26 float b[4] = { 0.f }; 1da2c: 80 e1 ldi r24, 0x10 ; 16 1da2e: 6a 96 adiw r28, 0x1a ; 26 1da30: ae ad ldd r26, Y+62 ; 0x3e 1da32: bf ad ldd r27, Y+63 ; 0x3f 1da34: 6a 97 sbiw r28, 0x1a ; 26 1da36: 1d 92 st X+, r1 1da38: 8a 95 dec r24 1da3a: e9 f7 brne .-6 ; 0x1da36 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 1da3c: 90 e0 ldi r25, 0x00 ; 0 1da3e: 80 e0 ldi r24, 0x00 ; 0 1da40: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 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); 1da44: 20 91 cf 13 lds r18, 0x13CF ; 0x8013cf 1da48: 30 91 d0 13 lds r19, 0x13D0 ; 0x8013d0 1da4c: 40 91 d1 13 lds r20, 0x13D1 ; 0x8013d1 1da50: 50 91 d2 13 lds r21, 0x13D2 ; 0x8013d2 1da54: c5 55 subi r28, 0x55 ; 85 1da56: df 4f sbci r29, 0xFF ; 255 1da58: 28 83 st Y, r18 1da5a: 39 83 std Y+1, r19 ; 0x01 1da5c: 4a 83 std Y+2, r20 ; 0x02 1da5e: 5b 83 std Y+3, r21 ; 0x03 1da60: cb 5a subi r28, 0xAB ; 171 1da62: 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); 1da64: 80 91 d3 13 lds r24, 0x13D3 ; 0x8013d3 1da68: 90 91 d4 13 lds r25, 0x13D4 ; 0x8013d4 1da6c: a0 91 d5 13 lds r26, 0x13D5 ; 0x8013d5 1da70: b0 91 d6 13 lds r27, 0x13D6 ; 0x8013d6 1da74: c1 55 subi r28, 0x51 ; 81 1da76: df 4f sbci r29, 0xFF ; 255 1da78: 88 83 st Y, r24 1da7a: 99 83 std Y+1, r25 ; 0x01 1da7c: aa 83 std Y+2, r26 ; 0x02 1da7e: bb 83 std Y+3, r27 ; 0x03 1da80: cf 5a subi r28, 0xAF ; 175 1da82: d0 40 sbci r29, 0x00 ; 0 1da84: de 01 movw r26, r28 1da86: af 5b subi r26, 0xBF ; 191 1da88: bf 4f sbci r27, 0xFF ; 255 1da8a: c7 56 subi r28, 0x67 ; 103 1da8c: df 4f sbci r29, 0xFF ; 255 1da8e: b9 83 std Y+1, r27 ; 0x01 1da90: a8 83 st Y, r26 1da92: c9 59 subi r28, 0x99 ; 153 1da94: d0 40 sbci r29, 0x00 ; 0 1da96: fe 01 movw r30, r28 1da98: 31 96 adiw r30, 0x01 ; 1 1da9a: ac 96 adiw r28, 0x2c ; 44 1da9c: ff af std Y+63, r31 ; 0x3f 1da9e: ee af std Y+62, r30 ; 0x3e 1daa0: 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) { 1daa2: 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])); 1daa4: cb 56 subi r28, 0x6B ; 107 1daa6: df 4f sbci r29, 0xFF ; 255 1daa8: 28 81 ld r18, Y 1daaa: 39 81 ldd r19, Y+1 ; 0x01 1daac: 4a 81 ldd r20, Y+2 ; 0x02 1daae: 5b 81 ldd r21, Y+3 ; 0x03 1dab0: c5 59 subi r28, 0x95 ; 149 1dab2: d0 40 sbci r29, 0x00 ; 0 1dab4: 50 58 subi r21, 0x80 ; 128 1dab6: ed 96 adiw r28, 0x3d ; 61 1dab8: 2c af std Y+60, r18 ; 0x3c 1daba: 3d af std Y+61, r19 ; 0x3d 1dabc: 4e af std Y+62, r20 ; 0x3e 1dabe: 5f af std Y+63, r21 ; 0x3f 1dac0: 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])); 1dac2: c7 57 subi r28, 0x77 ; 119 1dac4: df 4f sbci r29, 0xFF ; 255 1dac6: 88 81 ld r24, Y 1dac8: 99 81 ldd r25, Y+1 ; 0x01 1daca: aa 81 ldd r26, Y+2 ; 0x02 1dacc: bb 81 ldd r27, Y+3 ; 0x03 1dace: c9 58 subi r28, 0x89 ; 137 1dad0: d0 40 sbci r29, 0x00 ; 0 1dad2: b0 58 subi r27, 0x80 ; 128 1dad4: c3 58 subi r28, 0x83 ; 131 1dad6: df 4f sbci r29, 0xFF ; 255 1dad8: 88 83 st Y, r24 1dada: 99 83 std Y+1, r25 ; 0x01 1dadc: aa 83 std Y+2, r26 ; 0x02 1dade: bb 83 std Y+3, r27 ; 0x03 1dae0: cd 57 subi r28, 0x7D ; 125 1dae2: 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]) : 1dae4: cb 57 subi r28, 0x7B ; 123 1dae6: df 4f sbci r29, 0xFF ; 255 1dae8: 28 81 ld r18, Y 1daea: 39 81 ldd r19, Y+1 ; 0x01 1daec: 4a 81 ldd r20, Y+2 ; 0x02 1daee: 5b 81 ldd r21, Y+3 ; 0x03 1daf0: c5 58 subi r28, 0x85 ; 133 1daf2: d0 40 sbci r29, 0x00 ; 0 1daf4: 50 58 subi r21, 0x80 ; 128 1daf6: cf 57 subi r28, 0x7F ; 127 1daf8: df 4f sbci r29, 0xFF ; 255 1dafa: 28 83 st Y, r18 1dafc: 39 83 std Y+1, r19 ; 0x01 1dafe: 4a 83 std Y+2, r20 ; 0x02 1db00: 5b 83 std Y+3, r21 ; 0x03 1db02: c1 58 subi r28, 0x81 ; 129 1db04: 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) { 1db06: ac 96 adiw r28, 0x2c ; 44 1db08: 2e ac ldd r2, Y+62 ; 0x3e 1db0a: 3f ac ldd r3, Y+63 ; 0x3f 1db0c: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 1db0e: 10 e0 ldi r17, 0x00 ; 0 1db10: 6e e9 ldi r22, 0x9E ; 158 1db12: 46 2e mov r4, r22 1db14: 63 e1 ldi r22, 0x13 ; 19 1db16: 56 2e mov r5, r22 1db18: 74 e0 ldi r23, 0x04 ; 4 1db1a: 77 2e mov r7, r23 acc = 0; 1db1c: c1 2c mov r12, r1 1db1e: d1 2c mov r13, r1 1db20: 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) { 1db22: 01 30 cpi r16, 0x01 ; 1 1db24: 11 f4 brne .+4 ; 0x1db2a 1db26: 0c 94 39 f9 jmp 0x1f272 ; 0x1f272 1db2a: 11 30 cpi r17, 0x01 ; 1 1db2c: 11 f4 brne .+4 ; 0x1db32 1db2e: 0c 94 e7 f8 jmp 0x1f1ce ; 0x1f1ce float a = (r == 0) ? 1.f : 1db32: 00 23 and r16, r16 1db34: 11 f4 brne .+4 ; 0x1db3a 1db36: 0c 94 27 f9 jmp 0x1f24e ; 0x1f24e ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1db3a: 02 30 cpi r16, 0x02 ; 2 1db3c: 09 f0 breq .+2 ; 0x1db40 1db3e: a1 c1 rjmp .+834 ; 0x1de82 1db40: d2 01 movw r26, r4 1db42: 11 96 adiw r26, 0x01 ; 1 1db44: 2d 91 ld r18, X+ 1db46: 3d 91 ld r19, X+ 1db48: 4d 91 ld r20, X+ 1db4a: 5c 91 ld r21, X 1db4c: 14 97 sbiw r26, 0x04 ; 4 1db4e: cf 57 subi r28, 0x7F ; 127 1db50: df 4f sbci r29, 0xFF ; 255 1db52: 68 81 ld r22, Y 1db54: 79 81 ldd r23, Y+1 ; 0x01 1db56: 8a 81 ldd r24, Y+2 ; 0x02 1db58: 9b 81 ldd r25, Y+3 ; 0x03 1db5a: c1 58 subi r28, 0x81 ; 129 1db5c: d0 40 sbci r29, 0x00 ; 0 1db5e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1db62: 4b 01 movw r8, r22 1db64: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1db66: 11 11 cpse r17, r1 1db68: 9a c1 rjmp .+820 ; 0x1de9e 1db6a: 60 e0 ldi r22, 0x00 ; 0 1db6c: 70 e0 ldi r23, 0x00 ; 0 1db6e: 80 e8 ldi r24, 0x80 ; 128 1db70: 9f e3 ldi r25, 0x3F ; 63 1db72: aa c1 rjmp .+852 ; 0x1dec8 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 1db74: 2f 3f cpi r18, 0xFF ; 255 1db76: 09 f0 breq .+2 ; 0x1db7a 1db78: f8 cc rjmp .-1552 ; 0x1d56a ++maxs; 1db7a: 01 96 adiw r24, 0x01 ; 1 1db7c: f6 cc rjmp .-1556 ; 0x1d56a 1db7e: ae 01 movw r20, r28 1db80: 4f 5f subi r20, 0xFF ; 255 1db82: 5f 4f sbci r21, 0xFF ; 255 1db84: be 01 movw r22, r28 1db86: 6f 5b subi r22, 0xBF ; 191 1db88: 7f 4f sbci r23, 0xFF ; 255 1db8a: 8c e8 ldi r24, 0x8C ; 140 1db8c: 9b e0 ldi r25, 0x0B ; 11 1db8e: 0f 94 ba 90 call 0x32174 ; 0x32174 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; 1db92: 66 96 adiw r28, 0x16 ; 22 1db94: 6f ad ldd r22, Y+63 ; 0x3f 1db96: 66 97 sbiw r28, 0x16 ; 22 row = r08; 1db98: 62 96 adiw r28, 0x12 ; 18 1db9a: 1f ad ldd r17, Y+63 ; 0x3f 1db9c: 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){ 1db9e: 80 17 cp r24, r16 1dba0: 28 f0 brcs .+10 ; 0x1dbac col = c08; row = r08; return match08; } col = c10; 1dba2: 22 96 adiw r28, 0x02 ; 2 1dba4: 6f ad ldd r22, Y+63 ; 0x3f 1dba6: 22 97 sbiw r28, 0x02 ; 2 row = r10; 1dba8: 19 81 ldd r17, Y+1 ; 0x01 1dbaa: 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){ 1dbac: 08 35 cpi r16, 0x58 ; 88 1dbae: 08 f4 brcc .+2 ; 0x1dbb2 1dbb0: 5b c1 rjmp .+694 ; 0x1de68 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 1dbb2: 70 e0 ldi r23, 0x00 ; 0 1dbb4: 90 e0 ldi r25, 0x00 ; 0 1dbb6: 80 e0 ldi r24, 0x00 ; 0 1dbb8: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1dbbc: 20 e0 ldi r18, 0x00 ; 0 1dbbe: 30 e0 ldi r19, 0x00 ; 0 1dbc0: 40 eb ldi r20, 0xB0 ; 176 1dbc2: 50 e4 ldi r21, 0x40 ; 64 1dbc4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1dbc8: 2b 01 movw r4, r22 1dbca: 3c 01 movw r6, r24 1dbcc: 65 96 adiw r28, 0x15 ; 21 1dbce: 4c ae std Y+60, r4 ; 0x3c 1dbd0: 5d ae std Y+61, r5 ; 0x3d 1dbd2: 6e ae std Y+62, r6 ; 0x3e 1dbd4: 7f ae std Y+63, r7 ; 0x3f 1dbd6: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 1dbd8: 61 2f mov r22, r17 1dbda: 70 e0 ldi r23, 0x00 ; 0 1dbdc: 90 e0 ldi r25, 0x00 ; 0 1dbde: 80 e0 ldi r24, 0x00 ; 0 1dbe0: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1dbe4: 20 e0 ldi r18, 0x00 ; 0 1dbe6: 30 e0 ldi r19, 0x00 ; 0 1dbe8: 40 eb ldi r20, 0xB0 ; 176 1dbea: 50 e4 ldi r21, 0x40 ; 64 1dbec: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1dbf0: 4b 01 movw r8, r22 1dbf2: 5c 01 movw r10, r24 1dbf4: 25 96 adiw r28, 0x05 ; 5 1dbf6: 8c ae std Y+60, r8 ; 0x3c 1dbf8: 9d ae std Y+61, r9 ; 0x3d 1dbfa: ae ae std Y+62, r10 ; 0x3e 1dbfc: bf ae std Y+63, r11 ; 0x3f 1dbfe: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 1dc00: 20 e0 ldi r18, 0x00 ; 0 1dc02: 30 e0 ldi r19, 0x00 ; 0 1dc04: 40 e9 ldi r20, 0x90 ; 144 1dc06: 50 e4 ldi r21, 0x40 ; 64 1dc08: 29 83 std Y+1, r18 ; 0x01 1dc0a: 3a 83 std Y+2, r19 ; 0x02 1dc0c: 4b 83 std Y+3, r20 ; 0x03 1dc0e: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 1dc10: ae 01 movw r20, r28 1dc12: 4f 5f subi r20, 0xFF ; 255 1dc14: 5f 4f sbci r21, 0xFF ; 255 1dc16: be 01 movw r22, r28 1dc18: 6f 5b subi r22, 0xBF ; 191 1dc1a: 7f 4f sbci r23, 0xFF ; 255 1dc1c: ce 01 movw r24, r28 1dc1e: 8f 5a subi r24, 0xAF ; 175 1dc20: 9f 4f sbci r25, 0xFF ; 255 1dc22: 0f 94 6f 8d call 0x31ade ; 0x31ade if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 1dc26: a3 01 movw r20, r6 1dc28: 92 01 movw r18, r4 1dc2a: 65 96 adiw r28, 0x15 ; 21 1dc2c: 6c ad ldd r22, Y+60 ; 0x3c 1dc2e: 7d ad ldd r23, Y+61 ; 0x3d 1dc30: 8e ad ldd r24, Y+62 ; 0x3e 1dc32: 9f ad ldd r25, Y+63 ; 0x3f 1dc34: 65 97 sbiw r28, 0x15 ; 21 1dc36: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1dc3a: 6b 01 movw r12, r22 1dc3c: 7c 01 movw r14, r24 1dc3e: 9f 77 andi r25, 0x7F ; 127 1dc40: 20 e0 ldi r18, 0x00 ; 0 1dc42: 30 e0 ldi r19, 0x00 ; 0 1dc44: 40 e4 ldi r20, 0x40 ; 64 1dc46: 50 e4 ldi r21, 0x40 ; 64 1dc48: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1dc4c: 18 16 cp r1, r24 1dc4e: 34 f1 brlt .+76 ; 0x1dc9c 1dc50: a5 01 movw r20, r10 1dc52: 94 01 movw r18, r8 1dc54: 25 96 adiw r28, 0x05 ; 5 1dc56: 6c ad ldd r22, Y+60 ; 0x3c 1dc58: 7d ad ldd r23, Y+61 ; 0x3d 1dc5a: 8e ad ldd r24, Y+62 ; 0x3e 1dc5c: 9f ad ldd r25, Y+63 ; 0x3f 1dc5e: 25 97 sbiw r28, 0x05 ; 5 1dc60: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1dc64: 9f 77 andi r25, 0x7F ; 127 1dc66: 20 e0 ldi r18, 0x00 ; 0 1dc68: 30 e0 ldi r19, 0x00 ; 0 1dc6a: 40 e4 ldi r20, 0x40 ; 64 1dc6c: 50 e4 ldi r21, 0x40 ; 64 1dc6e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1dc72: 18 16 cp r1, r24 1dc74: 9c f0 brlt .+38 ; 0x1dc9c 1dc76: 20 e0 ldi r18, 0x00 ; 0 1dc78: 30 e0 ldi r19, 0x00 ; 0 1dc7a: 40 ea ldi r20, 0xA0 ; 160 1dc7c: 50 e4 ldi r21, 0x40 ; 64 1dc7e: 69 81 ldd r22, Y+1 ; 0x01 1dc80: 7a 81 ldd r23, Y+2 ; 0x02 1dc82: 8b 81 ldd r24, Y+3 ; 0x03 1dc84: 9c 81 ldd r25, Y+4 ; 0x04 1dc86: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1dc8a: 9f 77 andi r25, 0x7F ; 127 1dc8c: 20 e0 ldi r18, 0x00 ; 0 1dc8e: 30 e0 ldi r19, 0x00 ; 0 1dc90: 40 e4 ldi r20, 0x40 ; 64 1dc92: 50 e4 ldi r21, 0x40 ; 64 1dc94: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1dc98: 18 16 cp r1, r24 1dc9a: bc f5 brge .+110 ; 0x1dd0a //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 1dc9c: 20 e0 ldi r18, 0x00 ; 0 1dc9e: 30 e0 ldi r19, 0x00 ; 0 1dca0: 40 ea ldi r20, 0xA0 ; 160 1dca2: 50 e4 ldi r21, 0x40 ; 64 1dca4: 69 81 ldd r22, Y+1 ; 0x01 1dca6: 7a 81 ldd r23, Y+2 ; 0x02 1dca8: 8b 81 ldd r24, Y+3 ; 0x03 1dcaa: 9c 81 ldd r25, Y+4 ; 0x04 1dcac: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1dcb0: 9f 93 push r25 1dcb2: 8f 93 push r24 1dcb4: 7f 93 push r23 1dcb6: 6f 93 push r22 1dcb8: a5 01 movw r20, r10 1dcba: 94 01 movw r18, r8 1dcbc: 25 96 adiw r28, 0x05 ; 5 1dcbe: 6c ad ldd r22, Y+60 ; 0x3c 1dcc0: 7d ad ldd r23, Y+61 ; 0x3d 1dcc2: 8e ad ldd r24, Y+62 ; 0x3e 1dcc4: 9f ad ldd r25, Y+63 ; 0x3f 1dcc6: 25 97 sbiw r28, 0x05 ; 5 1dcc8: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1dccc: 9f 93 push r25 1dcce: 8f 93 push r24 1dcd0: 7f 93 push r23 1dcd2: 6f 93 push r22 1dcd4: ff 92 push r15 1dcd6: ef 92 push r14 1dcd8: df 92 push r13 1dcda: cf 92 push r12 1dcdc: 8d e7 ldi r24, 0x7D ; 125 1dcde: 91 e9 ldi r25, 0x91 ; 145 1dce0: 9f 93 push r25 1dce2: 8f 93 push r24 1dce4: 0f 94 4b dc call 0x3b896 ; 0x3b896 /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 1dce8: 65 96 adiw r28, 0x15 ; 21 1dcea: 4c ae std Y+60, r4 ; 0x3c 1dcec: 5d ae std Y+61, r5 ; 0x3d 1dcee: 6e ae std Y+62, r6 ; 0x3e 1dcf0: 7f ae std Y+63, r7 ; 0x3f 1dcf2: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 1dcf4: 25 96 adiw r28, 0x05 ; 5 1dcf6: 8c ae std Y+60, r8 ; 0x3c 1dcf8: 9d ae std Y+61, r9 ; 0x3d 1dcfa: ae ae std Y+62, r10 ; 0x3e 1dcfc: bf ae std Y+63, r11 ; 0x3f 1dcfe: 25 97 sbiw r28, 0x05 ; 5 1dd00: 0f b6 in r0, 0x3f ; 63 1dd02: f8 94 cli 1dd04: de bf out 0x3e, r29 ; 62 1dd06: 0f be out 0x3f, r0 ; 63 1dd08: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 1dd0a: 20 e0 ldi r18, 0x00 ; 0 1dd0c: 30 e0 ldi r19, 0x00 ; 0 1dd0e: 48 e7 ldi r20, 0x78 ; 120 1dd10: 51 e4 ldi r21, 0x41 ; 65 1dd12: 65 96 adiw r28, 0x15 ; 21 1dd14: 6c ad ldd r22, Y+60 ; 0x3c 1dd16: 7d ad ldd r23, Y+61 ; 0x3d 1dd18: 8e ad ldd r24, Y+62 ; 0x3e 1dd1a: 9f ad ldd r25, Y+63 ; 0x3f 1dd1c: 65 97 sbiw r28, 0x15 ; 21 1dd1e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1dd22: 20 e0 ldi r18, 0x00 ; 0 1dd24: 30 e0 ldi r19, 0x00 ; 0 1dd26: 40 e8 ldi r20, 0x80 ; 128 1dd28: 52 e4 ldi r21, 0x42 ; 66 1dd2a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1dd2e: 6b 01 movw r12, r22 1dd30: 7c 01 movw r14, r24 1dd32: 6c 96 adiw r28, 0x1c ; 28 1dd34: ae ad ldd r26, Y+62 ; 0x3e 1dd36: bf ad ldd r27, Y+63 ; 0x3f 1dd38: 6c 97 sbiw r28, 0x1c ; 28 1dd3a: bd 01 movw r22, r26 1dd3c: bb 0f add r27, r27 1dd3e: 88 0b sbc r24, r24 1dd40: 99 0b sbc r25, r25 1dd42: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1dd46: 9b 01 movw r18, r22 1dd48: ac 01 movw r20, r24 1dd4a: c7 01 movw r24, r14 1dd4c: b6 01 movw r22, r12 1dd4e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1dd52: 6b 01 movw r12, r22 1dd54: 7c 01 movw r14, r24 1dd56: 65 96 adiw r28, 0x15 ; 21 1dd58: cc ae std Y+60, r12 ; 0x3c 1dd5a: dd ae std Y+61, r13 ; 0x3d 1dd5c: ee ae std Y+62, r14 ; 0x3e 1dd5e: ff ae std Y+63, r15 ; 0x3f 1dd60: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 1dd62: 20 e0 ldi r18, 0x00 ; 0 1dd64: 30 e0 ldi r19, 0x00 ; 0 1dd66: 48 e7 ldi r20, 0x78 ; 120 1dd68: 51 e4 ldi r21, 0x41 ; 65 1dd6a: 25 96 adiw r28, 0x05 ; 5 1dd6c: 6c ad ldd r22, Y+60 ; 0x3c 1dd6e: 7d ad ldd r23, Y+61 ; 0x3d 1dd70: 8e ad ldd r24, Y+62 ; 0x3e 1dd72: 9f ad ldd r25, Y+63 ; 0x3f 1dd74: 25 97 sbiw r28, 0x05 ; 5 1dd76: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1dd7a: 20 e0 ldi r18, 0x00 ; 0 1dd7c: 30 e0 ldi r19, 0x00 ; 0 1dd7e: 40 e8 ldi r20, 0x80 ; 128 1dd80: 52 e4 ldi r21, 0x42 ; 66 1dd82: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1dd86: 4b 01 movw r8, r22 1dd88: 5c 01 movw r10, r24 1dd8a: ac 96 adiw r28, 0x2c ; 44 1dd8c: ee ad ldd r30, Y+62 ; 0x3e 1dd8e: ff ad ldd r31, Y+63 ; 0x3f 1dd90: ac 97 sbiw r28, 0x2c ; 44 1dd92: bf 01 movw r22, r30 1dd94: ff 0f add r31, r31 1dd96: 88 0b sbc r24, r24 1dd98: 99 0b sbc r25, r25 1dd9a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 1dd9e: 9b 01 movw r18, r22 1dda0: ac 01 movw r20, r24 1dda2: c5 01 movw r24, r10 1dda4: b4 01 movw r22, r8 1dda6: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1ddaa: 25 96 adiw r28, 0x05 ; 5 1ddac: 6c af std Y+60, r22 ; 0x3c 1ddae: 7d af std Y+61, r23 ; 0x3d 1ddb0: 8e af std Y+62, r24 ; 0x3e 1ddb2: 9f af std Y+63, r25 ; 0x3f 1ddb4: 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; 1ddb6: 2a e0 ldi r18, 0x0A ; 10 1ddb8: 37 ed ldi r19, 0xD7 ; 215 1ddba: 43 e2 ldi r20, 0x23 ; 35 1ddbc: 5c e3 ldi r21, 0x3C ; 60 1ddbe: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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)); 1ddc2: 9f 93 push r25 1ddc4: 8f 93 push r24 1ddc6: 7f 93 push r23 1ddc8: 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; 1ddca: 2a e0 ldi r18, 0x0A ; 10 1ddcc: 37 ed ldi r19, 0xD7 ; 215 1ddce: 43 e2 ldi r20, 0x23 ; 35 1ddd0: 5c e3 ldi r21, 0x3C ; 60 1ddd2: c7 01 movw r24, r14 1ddd4: b6 01 movw r22, r12 1ddd6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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)); 1ddda: 9f 93 push r25 1dddc: 8f 93 push r24 1ddde: 7f 93 push r23 1dde0: 6f 93 push r22 1dde2: 81 e6 ldi r24, 0x61 ; 97 1dde4: 91 e9 ldi r25, 0x91 ; 145 1dde6: 9f 93 push r25 1dde8: 8f 93 push r24 1ddea: 0f 94 4b dc call 0x3b896 ; 0x3b896 uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 1ddee: 20 e0 ldi r18, 0x00 ; 0 1ddf0: 30 e0 ldi r19, 0x00 ; 0 1ddf2: 40 e0 ldi r20, 0x00 ; 0 1ddf4: 5f e3 ldi r21, 0x3F ; 63 1ddf6: 25 96 adiw r28, 0x05 ; 5 1ddf8: 6c ad ldd r22, Y+60 ; 0x3c 1ddfa: 7d ad ldd r23, Y+61 ; 0x3d 1ddfc: 8e ad ldd r24, Y+62 ; 0x3e 1ddfe: 9f ad ldd r25, Y+63 ; 0x3f 1de00: 25 97 sbiw r28, 0x05 ; 5 1de02: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1de06: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 1de0a: 6b 01 movw r12, r22 1de0c: 20 e0 ldi r18, 0x00 ; 0 1de0e: 30 e0 ldi r19, 0x00 ; 0 1de10: 40 e0 ldi r20, 0x00 ; 0 1de12: 5f e3 ldi r21, 0x3F ; 63 1de14: 65 96 adiw r28, 0x15 ; 21 1de16: 6c ad ldd r22, Y+60 ; 0x3c 1de18: 7d ad ldd r23, Y+61 ; 0x3d 1de1a: 8e ad ldd r24, Y+62 ; 0x3e 1de1c: 9f ad ldd r25, Y+63 ; 0x3f 1de1e: 65 97 sbiw r28, 0x15 ; 21 1de20: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1de24: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 1de28: 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); 1de2a: 00 e0 ldi r16, 0x00 ; 0 1de2c: 28 ec ldi r18, 0xC8 ; 200 1de2e: 30 e0 ldi r19, 0x00 ; 0 1de30: e7 96 adiw r28, 0x37 ; 55 1de32: 4e ad ldd r20, Y+62 ; 0x3e 1de34: 5f ad ldd r21, Y+63 ; 0x3f 1de36: e7 97 sbiw r28, 0x37 ; 55 1de38: b6 01 movw r22, r12 1de3a: 0e 94 ec e1 call 0x1c3d8 ; 0x1c3d8 1de3e: 0f b6 in r0, 0x3f ; 63 1de40: f8 94 cli 1de42: de bf out 0x3e, r29 ; 62 1de44: 0f be out 0x3f, r0 ; 63 1de46: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 1de48: 10 e0 ldi r17, 0x00 ; 0 1de4a: 84 e5 ldi r24, 0x54 ; 84 1de4c: 9e e0 ldi r25, 0x0E ; 14 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 1de4e: a4 96 adiw r28, 0x24 ; 36 1de50: ae ad ldd r26, Y+62 ; 0x3e 1de52: bf ad ldd r27, Y+63 ; 0x3f 1de54: a4 97 sbiw r28, 0x24 ; 36 1de56: 1d 92 st X+, r1 1de58: a4 96 adiw r28, 0x24 ; 36 1de5a: bf af std Y+63, r27 ; 0x3f 1de5c: ae af std Y+62, r26 ; 0x3e 1de5e: 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++) 1de60: 8a 17 cp r24, r26 1de62: 9b 07 cpc r25, r27 1de64: a1 f7 brne .-24 ; 0x1de4e 1de66: 76 cc rjmp .-1812 ; 0x1d754 /// 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; 1de68: 1f ef ldi r17, 0xFF ; 255 1de6a: ef cf rjmp .-34 ; 0x1de4a 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; 1de6c: e5 96 adiw r28, 0x35 ; 53 1de6e: bf ad ldd r27, Y+63 ; 0x3f 1de70: e5 97 sbiw r28, 0x35 ; 53 1de72: a7 96 adiw r28, 0x27 ; 39 1de74: bf af std Y+63, r27 ; 0x3f 1de76: a7 97 sbiw r28, 0x27 ; 39 1de78: 99 cc rjmp .-1742 ; 0x1d7ac // 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; 1de7a: af 96 adiw r28, 0x2f ; 47 1de7c: 1f ae std Y+63, r1 ; 0x3f 1de7e: af 97 sbiw r28, 0x2f ; 47 1de80: 62 cd rjmp .-1340 ; 0x1d946 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]) : 1de82: f2 01 movw r30, r4 1de84: 25 81 ldd r18, Z+5 ; 0x05 1de86: 36 81 ldd r19, Z+6 ; 0x06 1de88: 47 81 ldd r20, Z+7 ; 0x07 1de8a: 50 85 ldd r21, Z+8 ; 0x08 1de8c: c3 58 subi r28, 0x83 ; 131 1de8e: df 4f sbci r29, 0xFF ; 255 1de90: 68 81 ld r22, Y 1de92: 79 81 ldd r23, Y+1 ; 0x01 1de94: 8a 81 ldd r24, Y+2 ; 0x02 1de96: 9b 81 ldd r25, Y+3 ; 0x03 1de98: cd 57 subi r28, 0x7D ; 125 1de9a: d0 40 sbci r29, 0x00 ; 0 1de9c: 60 ce rjmp .-832 ; 0x1db5e (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 1de9e: 12 30 cpi r17, 0x02 ; 2 1dea0: 11 f0 breq .+4 ; 0x1dea6 1dea2: 0c 94 28 f8 jmp 0x1f050 ; 0x1f050 1dea6: d2 01 movw r26, r4 1dea8: 11 96 adiw r26, 0x01 ; 1 1deaa: 2d 91 ld r18, X+ 1deac: 3d 91 ld r19, X+ 1deae: 4d 91 ld r20, X+ 1deb0: 5c 91 ld r21, X 1deb2: 14 97 sbiw r26, 0x04 ; 4 1deb4: cf 57 subi r28, 0x7F ; 127 1deb6: df 4f sbci r29, 0xFF ; 255 1deb8: 68 81 ld r22, Y 1deba: 79 81 ldd r23, Y+1 ; 0x01 1debc: 8a 81 ldd r24, Y+2 ; 0x02 1debe: 9b 81 ldd r25, Y+3 ; 0x03 1dec0: c1 58 subi r28, 0x81 ; 129 1dec2: d0 40 sbci r29, 0x00 ; 0 1dec4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 1dec8: 9b 01 movw r18, r22 1deca: ac 01 movw r20, r24 1decc: c5 01 movw r24, r10 1dece: b4 01 movw r22, r8 1ded0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1ded4: 9b 01 movw r18, r22 1ded6: ac 01 movw r20, r24 1ded8: c7 01 movw r24, r14 1deda: b6 01 movw r22, r12 1dedc: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1dee0: 6b 01 movw r12, r22 1dee2: 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) { 1dee4: 01 11 cpse r16, r1 1dee6: 0c 94 35 f9 jmp 0x1f26a ; 0x1f26a 1deea: 7a 94 dec r7 1deec: f8 e0 ldi r31, 0x08 ; 8 1deee: 4f 0e add r4, r31 1def0: 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) { 1def2: 71 10 cpse r7, r1 1def4: 16 ce rjmp .-980 ; 0x1db22 (-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; 1def6: d1 01 movw r26, r2 1def8: cd 92 st X+, r12 1defa: dd 92 st X+, r13 1defc: ed 92 st X+, r14 1defe: fd 92 st X+, r15 1df00: 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) { 1df02: 1f 5f subi r17, 0xFF ; 255 1df04: 14 30 cpi r17, 0x04 ; 4 1df06: 09 f0 breq .+2 ; 0x1df0a 1df08: 03 ce rjmp .-1018 ; 0x1db10 1df0a: 36 e1 ldi r19, 0x16 ; 22 1df0c: 23 2e mov r2, r19 1df0e: 32 e9 ldi r19, 0x92 ; 146 1df10: 33 2e mov r3, r19 1df12: ee e9 ldi r30, 0x9E ; 158 1df14: f3 e1 ldi r31, 0x13 ; 19 1df16: a8 96 adiw r28, 0x28 ; 40 1df18: ff af std Y+63, r31 ; 0x3f 1df1a: ee af std Y+62, r30 ; 0x3e 1df1c: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 1df1e: c3 57 subi r28, 0x73 ; 115 1df20: df 4f sbci r29, 0xFF ; 255 1df22: 18 82 st Y, r1 1df24: cd 58 subi r28, 0x8D ; 141 1df26: d0 40 sbci r29, 0x00 ; 0 1df28: c3 56 subi r28, 0x63 ; 99 1df2a: df 4f sbci r29, 0xFF ; 255 1df2c: 18 82 st Y, r1 1df2e: cd 59 subi r28, 0x9D ; 157 1df30: d0 40 sbci r29, 0x00 ; 0 1df32: cf 55 subi r28, 0x5F ; 95 1df34: df 4f sbci r29, 0xFF ; 255 1df36: 18 82 st Y, r1 1df38: c1 5a subi r28, 0xA1 ; 161 1df3a: d0 40 sbci r29, 0x00 ; 0 1df3c: 10 e0 ldi r17, 0x00 ; 0 1df3e: a8 96 adiw r28, 0x28 ; 40 1df40: ae ad ldd r26, Y+62 ; 0x3e 1df42: bf ad ldd r27, Y+63 ; 0x3f 1df44: a8 97 sbiw r28, 0x28 ; 40 1df46: 11 96 adiw r26, 0x01 ; 1 1df48: 2d 91 ld r18, X+ 1df4a: 3d 91 ld r19, X+ 1df4c: 4d 91 ld r20, X+ 1df4e: 5c 91 ld r21, X 1df50: 14 97 sbiw r26, 0x04 ; 4 1df52: e4 96 adiw r28, 0x34 ; 52 1df54: 2c af std Y+60, r18 ; 0x3c 1df56: 3d af std Y+61, r19 ; 0x3d 1df58: 4e af std Y+62, r20 ; 0x3e 1df5a: 5f af std Y+63, r21 ; 0x3f 1df5c: e4 97 sbiw r28, 0x34 ; 52 1df5e: 15 96 adiw r26, 0x05 ; 5 1df60: 4d 90 ld r4, X+ 1df62: 5d 90 ld r5, X+ 1df64: 6d 90 ld r6, X+ 1df66: 7c 90 ld r7, X 1df68: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1df6a: 00 23 and r16, r16 1df6c: 11 f4 brne .+4 ; 0x1df72 1df6e: 0c 94 5b f8 jmp 0x1f0b6 ; 0x1f0b6 ((r == 1) ? 0.f : 1df72: 81 2c mov r8, r1 1df74: 91 2c mov r9, r1 1df76: 54 01 movw r10, r8 1df78: 01 30 cpi r16, 0x01 ; 1 1df7a: 81 f0 breq .+32 ; 0x1df9c ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1df7c: 02 30 cpi r16, 0x02 ; 2 1df7e: 11 f0 breq .+4 ; 0x1df84 1df80: 0c 94 4f f8 jmp 0x1f09e ; 0x1f09e 1df84: cf 57 subi r28, 0x7F ; 127 1df86: df 4f sbci r29, 0xFF ; 255 1df88: 68 81 ld r22, Y 1df8a: 79 81 ldd r23, Y+1 ; 0x01 1df8c: 8a 81 ldd r24, Y+2 ; 0x02 1df8e: 9b 81 ldd r25, Y+3 ; 0x03 1df90: c1 58 subi r28, 0x81 ; 129 1df92: d0 40 sbci r29, 0x00 ; 0 1df94: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1df98: 4b 01 movw r8, r22 1df9a: 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); 1df9c: e4 96 adiw r28, 0x34 ; 52 1df9e: 2c ad ldd r18, Y+60 ; 0x3c 1dfa0: 3d ad ldd r19, Y+61 ; 0x3d 1dfa2: 4e ad ldd r20, Y+62 ; 0x3e 1dfa4: 5f ad ldd r21, Y+63 ; 0x3f 1dfa6: e4 97 sbiw r28, 0x34 ; 52 1dfa8: 6e 96 adiw r28, 0x1e ; 30 1dfaa: 6c ad ldd r22, Y+60 ; 0x3c 1dfac: 7d ad ldd r23, Y+61 ; 0x3d 1dfae: 8e ad ldd r24, Y+62 ; 0x3e 1dfb0: 9f ad ldd r25, Y+63 ; 0x3f 1dfb2: 6e 97 sbiw r28, 0x1e ; 30 1dfb4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1dfb8: 6b 01 movw r12, r22 1dfba: 7c 01 movw r14, r24 1dfbc: f1 01 movw r30, r2 1dfbe: 25 91 lpm r18, Z+ 1dfc0: 35 91 lpm r19, Z+ 1dfc2: 45 91 lpm r20, Z+ 1dfc4: 54 91 lpm r21, Z 1dfc6: cb 55 subi r28, 0x5B ; 91 1dfc8: df 4f sbci r29, 0xFF ; 255 1dfca: 28 83 st Y, r18 1dfcc: 39 83 std Y+1, r19 ; 0x01 1dfce: 4a 83 std Y+2, r20 ; 0x02 1dfd0: 5b 83 std Y+3, r21 ; 0x03 1dfd2: c5 5a subi r28, 0xA5 ; 165 1dfd4: d0 40 sbci r29, 0x00 ; 0 1dfd6: a3 01 movw r20, r6 1dfd8: 92 01 movw r18, r4 1dfda: cb 56 subi r28, 0x6B ; 107 1dfdc: df 4f sbci r29, 0xFF ; 255 1dfde: 68 81 ld r22, Y 1dfe0: 79 81 ldd r23, Y+1 ; 0x01 1dfe2: 8a 81 ldd r24, Y+2 ; 0x02 1dfe4: 9b 81 ldd r25, Y+3 ; 0x03 1dfe6: c5 59 subi r28, 0x95 ; 149 1dfe8: d0 40 sbci r29, 0x00 ; 0 1dfea: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1dfee: 9b 01 movw r18, r22 1dff0: ac 01 movw r20, r24 1dff2: c7 01 movw r24, r14 1dff4: b6 01 movw r22, r12 1dff6: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1dffa: c5 55 subi r28, 0x55 ; 85 1dffc: df 4f sbci r29, 0xFF ; 255 1dffe: 28 81 ld r18, Y 1e000: 39 81 ldd r19, Y+1 ; 0x01 1e002: 4a 81 ldd r20, Y+2 ; 0x02 1e004: 5b 81 ldd r21, Y+3 ; 0x03 1e006: cb 5a subi r28, 0xAB ; 171 1e008: d0 40 sbci r29, 0x00 ; 0 1e00a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e00e: cb 55 subi r28, 0x5B ; 91 1e010: df 4f sbci r29, 0xFF ; 255 1e012: 28 81 ld r18, Y 1e014: 39 81 ldd r19, Y+1 ; 0x01 1e016: 4a 81 ldd r20, Y+2 ; 0x02 1e018: 5b 81 ldd r21, Y+3 ; 0x03 1e01a: c5 5a subi r28, 0xA5 ; 165 1e01c: d0 40 sbci r29, 0x00 ; 0 1e01e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 1e022: a5 01 movw r20, r10 1e024: 94 01 movw r18, r8 1e026: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e02a: c3 57 subi r28, 0x73 ; 115 1e02c: df 4f sbci r29, 0xFF ; 255 1e02e: 28 81 ld r18, Y 1e030: cd 58 subi r28, 0x8D ; 141 1e032: d0 40 sbci r29, 0x00 ; 0 1e034: c3 56 subi r28, 0x63 ; 99 1e036: df 4f sbci r29, 0xFF ; 255 1e038: 38 81 ld r19, Y 1e03a: cd 59 subi r28, 0x9D ; 157 1e03c: d0 40 sbci r29, 0x00 ; 0 1e03e: cf 55 subi r28, 0x5F ; 95 1e040: df 4f sbci r29, 0xFF ; 255 1e042: 48 81 ld r20, Y 1e044: c1 5a subi r28, 0xA1 ; 161 1e046: d0 40 sbci r29, 0x00 ; 0 1e048: 51 2f mov r21, r17 1e04a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e04e: c3 57 subi r28, 0x73 ; 115 1e050: df 4f sbci r29, 0xFF ; 255 1e052: 68 83 st Y, r22 1e054: 79 83 std Y+1, r23 ; 0x01 1e056: 8a 83 std Y+2, r24 ; 0x02 1e058: 9b 83 std Y+3, r25 ; 0x03 1e05a: cd 58 subi r28, 0x8D ; 141 1e05c: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 1e05e: 00 23 and r16, r16 1e060: 11 f4 brne .+4 ; 0x1e066 1e062: 0c 94 63 f8 jmp 0x1f0c6 ; 0x1f0c6 ((r == 1) ? 1.f : 1e066: 01 30 cpi r16, 0x01 ; 1 1e068: 11 f4 brne .+4 ; 0x1e06e 1e06a: 0c 94 68 f8 jmp 0x1f0d0 ; 0x1f0d0 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1e06e: 02 30 cpi r16, 0x02 ; 2 1e070: 61 f0 breq .+24 ; 0x1e08a 1e072: a3 01 movw r20, r6 1e074: 92 01 movw r18, r4 1e076: ed 96 adiw r28, 0x3d ; 61 1e078: 6c ad ldd r22, Y+60 ; 0x3c 1e07a: 7d ad ldd r23, Y+61 ; 0x3d 1e07c: 8e ad ldd r24, Y+62 ; 0x3e 1e07e: 9f ad ldd r25, Y+63 ; 0x3f 1e080: ed 97 sbiw r28, 0x3d ; 61 1e082: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e086: 6b 01 movw r12, r22 1e088: 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); 1e08a: f1 01 movw r30, r2 1e08c: 34 96 adiw r30, 0x04 ; 4 1e08e: 85 90 lpm r8, Z+ 1e090: 95 90 lpm r9, Z+ 1e092: a5 90 lpm r10, Z+ 1e094: b4 90 lpm r11, Z 1e096: e4 96 adiw r28, 0x34 ; 52 1e098: 2c ad ldd r18, Y+60 ; 0x3c 1e09a: 3d ad ldd r19, Y+61 ; 0x3d 1e09c: 4e ad ldd r20, Y+62 ; 0x3e 1e09e: 5f ad ldd r21, Y+63 ; 0x3f 1e0a0: e4 97 sbiw r28, 0x34 ; 52 1e0a2: cb 57 subi r28, 0x7B ; 123 1e0a4: df 4f sbci r29, 0xFF ; 255 1e0a6: 68 81 ld r22, Y 1e0a8: 79 81 ldd r23, Y+1 ; 0x01 1e0aa: 8a 81 ldd r24, Y+2 ; 0x02 1e0ac: 9b 81 ldd r25, Y+3 ; 0x03 1e0ae: c5 58 subi r28, 0x85 ; 133 1e0b0: d0 40 sbci r29, 0x00 ; 0 1e0b2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e0b6: e4 96 adiw r28, 0x34 ; 52 1e0b8: 6c af std Y+60, r22 ; 0x3c 1e0ba: 7d af std Y+61, r23 ; 0x3d 1e0bc: 8e af std Y+62, r24 ; 0x3e 1e0be: 9f af std Y+63, r25 ; 0x3f 1e0c0: e4 97 sbiw r28, 0x34 ; 52 1e0c2: a3 01 movw r20, r6 1e0c4: 92 01 movw r18, r4 1e0c6: c7 57 subi r28, 0x77 ; 119 1e0c8: df 4f sbci r29, 0xFF ; 255 1e0ca: 68 81 ld r22, Y 1e0cc: 79 81 ldd r23, Y+1 ; 0x01 1e0ce: 8a 81 ldd r24, Y+2 ; 0x02 1e0d0: 9b 81 ldd r25, Y+3 ; 0x03 1e0d2: c9 58 subi r28, 0x89 ; 137 1e0d4: d0 40 sbci r29, 0x00 ; 0 1e0d6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e0da: 9b 01 movw r18, r22 1e0dc: ac 01 movw r20, r24 1e0de: e4 96 adiw r28, 0x34 ; 52 1e0e0: 6c ad ldd r22, Y+60 ; 0x3c 1e0e2: 7d ad ldd r23, Y+61 ; 0x3d 1e0e4: 8e ad ldd r24, Y+62 ; 0x3e 1e0e6: 9f ad ldd r25, Y+63 ; 0x3f 1e0e8: e4 97 sbiw r28, 0x34 ; 52 1e0ea: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e0ee: c1 55 subi r28, 0x51 ; 81 1e0f0: df 4f sbci r29, 0xFF ; 255 1e0f2: 28 81 ld r18, Y 1e0f4: 39 81 ldd r19, Y+1 ; 0x01 1e0f6: 4a 81 ldd r20, Y+2 ; 0x02 1e0f8: 5b 81 ldd r21, Y+3 ; 0x03 1e0fa: cf 5a subi r28, 0xAF ; 175 1e0fc: d0 40 sbci r29, 0x00 ; 0 1e0fe: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e102: a5 01 movw r20, r10 1e104: 94 01 movw r18, r8 1e106: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 1e10a: a7 01 movw r20, r14 1e10c: 96 01 movw r18, r12 1e10e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e112: c3 57 subi r28, 0x73 ; 115 1e114: df 4f sbci r29, 0xFF ; 255 1e116: 28 81 ld r18, Y 1e118: 39 81 ldd r19, Y+1 ; 0x01 1e11a: 4a 81 ldd r20, Y+2 ; 0x02 1e11c: 5b 81 ldd r21, Y+3 ; 0x03 1e11e: cd 58 subi r28, 0x8D ; 141 1e120: d0 40 sbci r29, 0x00 ; 0 1e122: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e126: c3 57 subi r28, 0x73 ; 115 1e128: df 4f sbci r29, 0xFF ; 255 1e12a: 68 83 st Y, r22 1e12c: cd 58 subi r28, 0x8D ; 141 1e12e: d0 40 sbci r29, 0x00 ; 0 1e130: c3 56 subi r28, 0x63 ; 99 1e132: df 4f sbci r29, 0xFF ; 255 1e134: 78 83 st Y, r23 1e136: cd 59 subi r28, 0x9D ; 157 1e138: d0 40 sbci r29, 0x00 ; 0 1e13a: cf 55 subi r28, 0x5F ; 95 1e13c: df 4f sbci r29, 0xFF ; 255 1e13e: 88 83 st Y, r24 1e140: c1 5a subi r28, 0xA1 ; 161 1e142: d0 40 sbci r29, 0x00 ; 0 1e144: 19 2f mov r17, r25 1e146: a8 96 adiw r28, 0x28 ; 40 1e148: 4e ad ldd r20, Y+62 ; 0x3e 1e14a: 5f ad ldd r21, Y+63 ; 0x3f 1e14c: a8 97 sbiw r28, 0x28 ; 40 1e14e: 48 5f subi r20, 0xF8 ; 248 1e150: 5f 4f sbci r21, 0xFF ; 255 1e152: a8 96 adiw r28, 0x28 ; 40 1e154: 5f af std Y+63, r21 ; 0x3f 1e156: 4e af std Y+62, r20 ; 0x3e 1e158: a8 97 sbiw r28, 0x28 ; 40 1e15a: 58 e0 ldi r21, 0x08 ; 8 1e15c: 25 0e add r2, r21 1e15e: 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) { 1e160: ae eb ldi r26, 0xBE ; 190 1e162: b3 e1 ldi r27, 0x13 ; 19 1e164: a8 96 adiw r28, 0x28 ; 40 1e166: ee ad ldd r30, Y+62 ; 0x3e 1e168: ff ad ldd r31, Y+63 ; 0x3f 1e16a: a8 97 sbiw r28, 0x28 ; 40 1e16c: ae 17 cp r26, r30 1e16e: bf 07 cpc r27, r31 1e170: 09 f0 breq .+2 ; 0x1e174 1e172: e5 ce rjmp .-566 ; 0x1df3e 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; 1e174: 90 58 subi r25, 0x80 ; 128 1e176: c7 56 subi r28, 0x67 ; 103 1e178: df 4f sbci r29, 0xFF ; 255 1e17a: a8 81 ld r26, Y 1e17c: b9 81 ldd r27, Y+1 ; 0x01 1e17e: c9 59 subi r28, 0x99 ; 153 1e180: d0 40 sbci r29, 0x00 ; 0 1e182: 6d 93 st X+, r22 1e184: 7d 93 st X+, r23 1e186: 8d 93 st X+, r24 1e188: 9d 93 st X+, r25 1e18a: c7 56 subi r28, 0x67 ; 103 1e18c: df 4f sbci r29, 0xFF ; 255 1e18e: b9 83 std Y+1, r27 ; 0x01 1e190: a8 83 st Y, r26 1e192: c9 59 subi r28, 0x99 ; 153 1e194: 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) { 1e196: 0f 5f subi r16, 0xFF ; 255 1e198: ac 96 adiw r28, 0x2c ; 44 1e19a: ee ad ldd r30, Y+62 ; 0x3e 1e19c: ff ad ldd r31, Y+63 ; 0x3f 1e19e: ac 97 sbiw r28, 0x2c ; 44 1e1a0: 70 96 adiw r30, 0x10 ; 16 1e1a2: ac 96 adiw r28, 0x2c ; 44 1e1a4: ff af std Y+63, r31 ; 0x3f 1e1a6: ee af std Y+62, r30 ; 0x3e 1e1a8: ac 97 sbiw r28, 0x2c ; 44 1e1aa: 04 30 cpi r16, 0x04 ; 4 1e1ac: 09 f0 breq .+2 ; 0x1e1b0 1e1ae: ab cc rjmp .-1706 ; 0x1db06 } // 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]; 1e1b0: 25 96 adiw r28, 0x05 ; 5 1e1b2: 2c ad ldd r18, Y+60 ; 0x3c 1e1b4: 3d ad ldd r19, Y+61 ; 0x3d 1e1b6: 4e ad ldd r20, Y+62 ; 0x3e 1e1b8: 5f ad ldd r21, Y+63 ; 0x3f 1e1ba: 25 97 sbiw r28, 0x05 ; 5 1e1bc: ae 96 adiw r28, 0x2e ; 46 1e1be: 2c af std Y+60, r18 ; 0x3c 1e1c0: 3d af std Y+61, r19 ; 0x3d 1e1c2: 4e af std Y+62, r20 ; 0x3e 1e1c4: 5f af std Y+63, r21 ; 0x3f 1e1c6: ae 97 sbiw r28, 0x2e ; 46 1e1c8: 8d 81 ldd r24, Y+5 ; 0x05 1e1ca: 9e 81 ldd r25, Y+6 ; 0x06 1e1cc: af 81 ldd r26, Y+7 ; 0x07 1e1ce: b8 85 ldd r27, Y+8 ; 0x08 1e1d0: e4 96 adiw r28, 0x34 ; 52 1e1d2: 8c af std Y+60, r24 ; 0x3c 1e1d4: 9d af std Y+61, r25 ; 0x3d 1e1d6: ae af std Y+62, r26 ; 0x3e 1e1d8: bf af std Y+63, r27 ; 0x3f 1e1da: e4 97 sbiw r28, 0x34 ; 52 1e1dc: 29 85 ldd r18, Y+9 ; 0x09 1e1de: 3a 85 ldd r19, Y+10 ; 0x0a 1e1e0: 4b 85 ldd r20, Y+11 ; 0x0b 1e1e2: 5c 85 ldd r21, Y+12 ; 0x0c 1e1e4: ed 96 adiw r28, 0x3d ; 61 1e1e6: 2c af std Y+60, r18 ; 0x3c 1e1e8: 3d af std Y+61, r19 ; 0x3d 1e1ea: 4e af std Y+62, r20 ; 0x3e 1e1ec: 5f af std Y+63, r21 ; 0x3f 1e1ee: ed 97 sbiw r28, 0x3d ; 61 1e1f0: 8d 85 ldd r24, Y+13 ; 0x0d 1e1f2: 9e 85 ldd r25, Y+14 ; 0x0e 1e1f4: af 85 ldd r26, Y+15 ; 0x0f 1e1f6: b8 89 ldd r27, Y+16 ; 0x10 1e1f8: c3 58 subi r28, 0x83 ; 131 1e1fa: df 4f sbci r29, 0xFF ; 255 1e1fc: 88 83 st Y, r24 1e1fe: 99 83 std Y+1, r25 ; 0x01 1e200: aa 83 std Y+2, r26 ; 0x02 1e202: bb 83 std Y+3, r27 ; 0x03 1e204: cd 57 subi r28, 0x7D ; 125 1e206: d0 40 sbci r29, 0x00 ; 0 1e208: 29 81 ldd r18, Y+1 ; 0x01 1e20a: 3a 81 ldd r19, Y+2 ; 0x02 1e20c: 4b 81 ldd r20, Y+3 ; 0x03 1e20e: 5c 81 ldd r21, Y+4 ; 0x04 1e210: cf 57 subi r28, 0x7F ; 127 1e212: df 4f sbci r29, 0xFF ; 255 1e214: 28 83 st Y, r18 1e216: 39 83 std Y+1, r19 ; 0x01 1e218: 4a 83 std Y+2, r20 ; 0x02 1e21a: 5b 83 std Y+3, r21 ; 0x03 1e21c: c1 58 subi r28, 0x81 ; 129 1e21e: 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]; 1e220: 29 96 adiw r28, 0x09 ; 9 1e222: 8c ad ldd r24, Y+60 ; 0x3c 1e224: 9d ad ldd r25, Y+61 ; 0x3d 1e226: ae ad ldd r26, Y+62 ; 0x3e 1e228: bf ad ldd r27, Y+63 ; 0x3f 1e22a: 29 97 sbiw r28, 0x09 ; 9 1e22c: cb 57 subi r28, 0x7B ; 123 1e22e: df 4f sbci r29, 0xFF ; 255 1e230: 88 83 st Y, r24 1e232: 99 83 std Y+1, r25 ; 0x01 1e234: aa 83 std Y+2, r26 ; 0x02 1e236: bb 83 std Y+3, r27 ; 0x03 1e238: c5 58 subi r28, 0x85 ; 133 1e23a: d0 40 sbci r29, 0x00 ; 0 1e23c: 29 89 ldd r18, Y+17 ; 0x11 1e23e: 3a 89 ldd r19, Y+18 ; 0x12 1e240: 4b 89 ldd r20, Y+19 ; 0x13 1e242: 5c 89 ldd r21, Y+20 ; 0x14 1e244: c7 57 subi r28, 0x77 ; 119 1e246: df 4f sbci r29, 0xFF ; 255 1e248: 28 83 st Y, r18 1e24a: 39 83 std Y+1, r19 ; 0x01 1e24c: 4a 83 std Y+2, r20 ; 0x02 1e24e: 5b 83 std Y+3, r21 ; 0x03 1e250: c9 58 subi r28, 0x89 ; 137 1e252: d0 40 sbci r29, 0x00 ; 0 1e254: 89 8d ldd r24, Y+25 ; 0x19 1e256: 9a 8d ldd r25, Y+26 ; 0x1a 1e258: ab 8d ldd r26, Y+27 ; 0x1b 1e25a: bc 8d ldd r27, Y+28 ; 0x1c 1e25c: cb 56 subi r28, 0x6B ; 107 1e25e: df 4f sbci r29, 0xFF ; 255 1e260: 88 83 st Y, r24 1e262: 99 83 std Y+1, r25 ; 0x01 1e264: aa 83 std Y+2, r26 ; 0x02 1e266: bb 83 std Y+3, r27 ; 0x03 1e268: c5 59 subi r28, 0x95 ; 149 1e26a: d0 40 sbci r29, 0x00 ; 0 1e26c: 2d 8d ldd r18, Y+29 ; 0x1d 1e26e: 3e 8d ldd r19, Y+30 ; 0x1e 1e270: 4f 8d ldd r20, Y+31 ; 0x1f 1e272: 58 a1 ldd r21, Y+32 ; 0x20 1e274: c7 56 subi r28, 0x67 ; 103 1e276: df 4f sbci r29, 0xFF ; 255 1e278: 28 83 st Y, r18 1e27a: 39 83 std Y+1, r19 ; 0x01 1e27c: 4a 83 std Y+2, r20 ; 0x02 1e27e: 5b 83 std Y+3, r21 ; 0x03 1e280: c9 59 subi r28, 0x99 ; 153 1e282: d0 40 sbci r29, 0x00 ; 0 1e284: 8d 89 ldd r24, Y+21 ; 0x15 1e286: 9e 89 ldd r25, Y+22 ; 0x16 1e288: af 89 ldd r26, Y+23 ; 0x17 1e28a: b8 8d ldd r27, Y+24 ; 0x18 1e28c: c3 57 subi r28, 0x73 ; 115 1e28e: df 4f sbci r29, 0xFF ; 255 1e290: 88 83 st Y, r24 1e292: 99 83 std Y+1, r25 ; 0x01 1e294: aa 83 std Y+2, r26 ; 0x02 1e296: bb 83 std Y+3, r27 ; 0x03 1e298: cd 58 subi r28, 0x8D ; 141 1e29a: 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]; 1e29c: 2d 96 adiw r28, 0x0d ; 13 1e29e: 2c ad ldd r18, Y+60 ; 0x3c 1e2a0: 3d ad ldd r19, Y+61 ; 0x3d 1e2a2: 4e ad ldd r20, Y+62 ; 0x3e 1e2a4: 5f ad ldd r21, Y+63 ; 0x3f 1e2a6: 2d 97 sbiw r28, 0x0d ; 13 1e2a8: c3 56 subi r28, 0x63 ; 99 1e2aa: df 4f sbci r29, 0xFF ; 255 1e2ac: 28 83 st Y, r18 1e2ae: 39 83 std Y+1, r19 ; 0x01 1e2b0: 4a 83 std Y+2, r20 ; 0x02 1e2b2: 5b 83 std Y+3, r21 ; 0x03 1e2b4: cd 59 subi r28, 0x9D ; 157 1e2b6: d0 40 sbci r29, 0x00 ; 0 1e2b8: 89 a1 ldd r24, Y+33 ; 0x21 1e2ba: 9a a1 ldd r25, Y+34 ; 0x22 1e2bc: ab a1 ldd r26, Y+35 ; 0x23 1e2be: bc a1 ldd r27, Y+36 ; 0x24 1e2c0: cf 55 subi r28, 0x5F ; 95 1e2c2: df 4f sbci r29, 0xFF ; 255 1e2c4: 88 83 st Y, r24 1e2c6: 99 83 std Y+1, r25 ; 0x01 1e2c8: aa 83 std Y+2, r26 ; 0x02 1e2ca: bb 83 std Y+3, r27 ; 0x03 1e2cc: c1 5a subi r28, 0xA1 ; 161 1e2ce: d0 40 sbci r29, 0x00 ; 0 1e2d0: 2d a1 ldd r18, Y+37 ; 0x25 1e2d2: 3e a1 ldd r19, Y+38 ; 0x26 1e2d4: 4f a1 ldd r20, Y+39 ; 0x27 1e2d6: 58 a5 ldd r21, Y+40 ; 0x28 1e2d8: cb 55 subi r28, 0x5B ; 91 1e2da: df 4f sbci r29, 0xFF ; 255 1e2dc: 28 83 st Y, r18 1e2de: 39 83 std Y+1, r19 ; 0x01 1e2e0: 4a 83 std Y+2, r20 ; 0x02 1e2e2: 5b 83 std Y+3, r21 ; 0x03 1e2e4: c5 5a subi r28, 0xA5 ; 165 1e2e6: d0 40 sbci r29, 0x00 ; 0 1e2e8: 8d a5 ldd r24, Y+45 ; 0x2d 1e2ea: 9e a5 ldd r25, Y+46 ; 0x2e 1e2ec: af a5 ldd r26, Y+47 ; 0x2f 1e2ee: b8 a9 ldd r27, Y+48 ; 0x30 1e2f0: cd 54 subi r28, 0x4D ; 77 1e2f2: df 4f sbci r29, 0xFF ; 255 1e2f4: 88 83 st Y, r24 1e2f6: 99 83 std Y+1, r25 ; 0x01 1e2f8: aa 83 std Y+2, r26 ; 0x02 1e2fa: bb 83 std Y+3, r27 ; 0x03 1e2fc: c3 5b subi r28, 0xB3 ; 179 1e2fe: d0 40 sbci r29, 0x00 ; 0 1e300: 29 a5 ldd r18, Y+41 ; 0x29 1e302: 3a a5 ldd r19, Y+42 ; 0x2a 1e304: 4b a5 ldd r20, Y+43 ; 0x2b 1e306: 5c a5 ldd r21, Y+44 ; 0x2c 1e308: c9 54 subi r28, 0x49 ; 73 1e30a: df 4f sbci r29, 0xFF ; 255 1e30c: 28 83 st Y, r18 1e30e: 39 83 std Y+1, r19 ; 0x01 1e310: 4a 83 std Y+2, r20 ; 0x02 1e312: 5b 83 std Y+3, r21 ; 0x03 1e314: c7 5b subi r28, 0xB7 ; 183 1e316: 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]; 1e318: 61 96 adiw r28, 0x11 ; 17 1e31a: 8c ad ldd r24, Y+60 ; 0x3c 1e31c: 9d ad ldd r25, Y+61 ; 0x3d 1e31e: ae ad ldd r26, Y+62 ; 0x3e 1e320: bf ad ldd r27, Y+63 ; 0x3f 1e322: 61 97 sbiw r28, 0x11 ; 17 1e324: c5 54 subi r28, 0x45 ; 69 1e326: df 4f sbci r29, 0xFF ; 255 1e328: 88 83 st Y, r24 1e32a: 99 83 std Y+1, r25 ; 0x01 1e32c: aa 83 std Y+2, r26 ; 0x02 1e32e: bb 83 std Y+3, r27 ; 0x03 1e330: cb 5b subi r28, 0xBB ; 187 1e332: d0 40 sbci r29, 0x00 ; 0 1e334: 29 a9 ldd r18, Y+49 ; 0x31 1e336: 3a a9 ldd r19, Y+50 ; 0x32 1e338: 4b a9 ldd r20, Y+51 ; 0x33 1e33a: 5c a9 ldd r21, Y+52 ; 0x34 1e33c: c1 54 subi r28, 0x41 ; 65 1e33e: df 4f sbci r29, 0xFF ; 255 1e340: 28 83 st Y, r18 1e342: 39 83 std Y+1, r19 ; 0x01 1e344: 4a 83 std Y+2, r20 ; 0x02 1e346: 5b 83 std Y+3, r21 ; 0x03 1e348: cf 5b subi r28, 0xBF ; 191 1e34a: d0 40 sbci r29, 0x00 ; 0 1e34c: 8d a9 ldd r24, Y+53 ; 0x35 1e34e: 9e a9 ldd r25, Y+54 ; 0x36 1e350: af a9 ldd r26, Y+55 ; 0x37 1e352: b8 ad ldd r27, Y+56 ; 0x38 1e354: cd 53 subi r28, 0x3D ; 61 1e356: df 4f sbci r29, 0xFF ; 255 1e358: 88 83 st Y, r24 1e35a: 99 83 std Y+1, r25 ; 0x01 1e35c: aa 83 std Y+2, r26 ; 0x02 1e35e: bb 83 std Y+3, r27 ; 0x03 1e360: c3 5c subi r28, 0xC3 ; 195 1e362: d0 40 sbci r29, 0x00 ; 0 1e364: 29 ad ldd r18, Y+57 ; 0x39 1e366: 3a ad ldd r19, Y+58 ; 0x3a 1e368: 4b ad ldd r20, Y+59 ; 0x3b 1e36a: 5c ad ldd r21, Y+60 ; 0x3c 1e36c: c9 53 subi r28, 0x39 ; 57 1e36e: df 4f sbci r29, 0xFF ; 255 1e370: 28 83 st Y, r18 1e372: 39 83 std Y+1, r19 ; 0x01 1e374: 4a 83 std Y+2, r20 ; 0x02 1e376: 5b 83 std Y+3, r21 ; 0x03 1e378: c7 5c subi r28, 0xC7 ; 199 1e37a: d0 40 sbci r29, 0x00 ; 0 1e37c: 21 96 adiw r28, 0x01 ; 1 1e37e: 8c ad ldd r24, Y+60 ; 0x3c 1e380: 9d ad ldd r25, Y+61 ; 0x3d 1e382: ae ad ldd r26, Y+62 ; 0x3e 1e384: bf ad ldd r27, Y+63 ; 0x3f 1e386: 21 97 sbiw r28, 0x01 ; 1 1e388: c5 53 subi r28, 0x35 ; 53 1e38a: df 4f sbci r29, 0xFF ; 255 1e38c: 88 83 st Y, r24 1e38e: 99 83 std Y+1, r25 ; 0x01 1e390: aa 83 std Y+2, r26 ; 0x02 1e392: bb 83 std Y+3, r27 ; 0x03 1e394: cb 5c subi r28, 0xCB ; 203 1e396: d0 40 sbci r29, 0x00 ; 0 1e398: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1e39a: c1 2c mov r12, r1 1e39c: d1 2c mov r13, r1 1e39e: 76 01 movw r14, r12 1e3a0: 46 01 movw r8, r12 1e3a2: 57 01 movw r10, r14 1e3a4: 26 01 movw r4, r12 1e3a6: 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]; 1e3a8: a3 01 movw r20, r6 1e3aa: 92 01 movw r18, r4 1e3ac: e4 96 adiw r28, 0x34 ; 52 1e3ae: 6c ad ldd r22, Y+60 ; 0x3c 1e3b0: 7d ad ldd r23, Y+61 ; 0x3d 1e3b2: 8e ad ldd r24, Y+62 ; 0x3e 1e3b4: 9f ad ldd r25, Y+63 ; 0x3f 1e3b6: e4 97 sbiw r28, 0x34 ; 52 1e3b8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e3bc: 9b 01 movw r18, r22 1e3be: ac 01 movw r20, r24 1e3c0: ae 96 adiw r28, 0x2e ; 46 1e3c2: 6c ad ldd r22, Y+60 ; 0x3c 1e3c4: 7d ad ldd r23, Y+61 ; 0x3d 1e3c6: 8e ad ldd r24, Y+62 ; 0x3e 1e3c8: 9f ad ldd r25, Y+63 ; 0x3f 1e3ca: ae 97 sbiw r28, 0x2e ; 46 1e3cc: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e3d0: 2b 01 movw r4, r22 1e3d2: 3c 01 movw r6, r24 1e3d4: a5 01 movw r20, r10 1e3d6: 94 01 movw r18, r8 1e3d8: ed 96 adiw r28, 0x3d ; 61 1e3da: 6c ad ldd r22, Y+60 ; 0x3c 1e3dc: 7d ad ldd r23, Y+61 ; 0x3d 1e3de: 8e ad ldd r24, Y+62 ; 0x3e 1e3e0: 9f ad ldd r25, Y+63 ; 0x3f 1e3e2: ed 97 sbiw r28, 0x3d ; 61 1e3e4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e3e8: 9b 01 movw r18, r22 1e3ea: ac 01 movw r20, r24 1e3ec: c3 01 movw r24, r6 1e3ee: b2 01 movw r22, r4 1e3f0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e3f4: 2b 01 movw r4, r22 1e3f6: 3c 01 movw r6, r24 1e3f8: a7 01 movw r20, r14 1e3fa: 96 01 movw r18, r12 1e3fc: c3 58 subi r28, 0x83 ; 131 1e3fe: df 4f sbci r29, 0xFF ; 255 1e400: 68 81 ld r22, Y 1e402: 79 81 ldd r23, Y+1 ; 0x01 1e404: 8a 81 ldd r24, Y+2 ; 0x02 1e406: 9b 81 ldd r25, Y+3 ; 0x03 1e408: cd 57 subi r28, 0x7D ; 125 1e40a: d0 40 sbci r29, 0x00 ; 0 1e40c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e410: 9b 01 movw r18, r22 1e412: ac 01 movw r20, r24 1e414: c3 01 movw r24, r6 1e416: b2 01 movw r22, r4 1e418: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e41c: cf 57 subi r28, 0x7F ; 127 1e41e: df 4f sbci r29, 0xFF ; 255 1e420: 28 81 ld r18, Y 1e422: 39 81 ldd r19, Y+1 ; 0x01 1e424: 4a 81 ldd r20, Y+2 ; 0x02 1e426: 5b 81 ldd r21, Y+3 ; 0x03 1e428: c1 58 subi r28, 0x81 ; 129 1e42a: d0 40 sbci r29, 0x00 ; 0 1e42c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1e430: 6e 96 adiw r28, 0x1e ; 30 1e432: 6c af std Y+60, r22 ; 0x3c 1e434: 7d af std Y+61, r23 ; 0x3d 1e436: 8e af std Y+62, r24 ; 0x3e 1e438: 9f af std Y+63, r25 ; 0x3f 1e43a: 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]; 1e43c: c7 57 subi r28, 0x77 ; 119 1e43e: df 4f sbci r29, 0xFF ; 255 1e440: 28 81 ld r18, Y 1e442: 39 81 ldd r19, Y+1 ; 0x01 1e444: 4a 81 ldd r20, Y+2 ; 0x02 1e446: 5b 81 ldd r21, Y+3 ; 0x03 1e448: c9 58 subi r28, 0x89 ; 137 1e44a: d0 40 sbci r29, 0x00 ; 0 1e44c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e450: 9b 01 movw r18, r22 1e452: ac 01 movw r20, r24 1e454: cb 57 subi r28, 0x7B ; 123 1e456: df 4f sbci r29, 0xFF ; 255 1e458: 68 81 ld r22, Y 1e45a: 79 81 ldd r23, Y+1 ; 0x01 1e45c: 8a 81 ldd r24, Y+2 ; 0x02 1e45e: 9b 81 ldd r25, Y+3 ; 0x03 1e460: c5 58 subi r28, 0x85 ; 133 1e462: d0 40 sbci r29, 0x00 ; 0 1e464: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e468: 2b 01 movw r4, r22 1e46a: 3c 01 movw r6, r24 1e46c: a5 01 movw r20, r10 1e46e: 94 01 movw r18, r8 1e470: cb 56 subi r28, 0x6B ; 107 1e472: df 4f sbci r29, 0xFF ; 255 1e474: 68 81 ld r22, Y 1e476: 79 81 ldd r23, Y+1 ; 0x01 1e478: 8a 81 ldd r24, Y+2 ; 0x02 1e47a: 9b 81 ldd r25, Y+3 ; 0x03 1e47c: c5 59 subi r28, 0x95 ; 149 1e47e: d0 40 sbci r29, 0x00 ; 0 1e480: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e484: 9b 01 movw r18, r22 1e486: ac 01 movw r20, r24 1e488: c3 01 movw r24, r6 1e48a: b2 01 movw r22, r4 1e48c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e490: 4b 01 movw r8, r22 1e492: 5c 01 movw r10, r24 1e494: a7 01 movw r20, r14 1e496: 96 01 movw r18, r12 1e498: c7 56 subi r28, 0x67 ; 103 1e49a: df 4f sbci r29, 0xFF ; 255 1e49c: 68 81 ld r22, Y 1e49e: 79 81 ldd r23, Y+1 ; 0x01 1e4a0: 8a 81 ldd r24, Y+2 ; 0x02 1e4a2: 9b 81 ldd r25, Y+3 ; 0x03 1e4a4: c9 59 subi r28, 0x99 ; 153 1e4a6: d0 40 sbci r29, 0x00 ; 0 1e4a8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e4ac: 9b 01 movw r18, r22 1e4ae: ac 01 movw r20, r24 1e4b0: c5 01 movw r24, r10 1e4b2: b4 01 movw r22, r8 1e4b4: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e4b8: c3 57 subi r28, 0x73 ; 115 1e4ba: df 4f sbci r29, 0xFF ; 255 1e4bc: 28 81 ld r18, Y 1e4be: 39 81 ldd r19, Y+1 ; 0x01 1e4c0: 4a 81 ldd r20, Y+2 ; 0x02 1e4c2: 5b 81 ldd r21, Y+3 ; 0x03 1e4c4: cd 58 subi r28, 0x8D ; 141 1e4c6: d0 40 sbci r29, 0x00 ; 0 1e4c8: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1e4cc: 2b 01 movw r4, r22 1e4ce: 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]; 1e4d0: cf 55 subi r28, 0x5F ; 95 1e4d2: df 4f sbci r29, 0xFF ; 255 1e4d4: 28 81 ld r18, Y 1e4d6: 39 81 ldd r19, Y+1 ; 0x01 1e4d8: 4a 81 ldd r20, Y+2 ; 0x02 1e4da: 5b 81 ldd r21, Y+3 ; 0x03 1e4dc: c1 5a subi r28, 0xA1 ; 161 1e4de: d0 40 sbci r29, 0x00 ; 0 1e4e0: 6e 96 adiw r28, 0x1e ; 30 1e4e2: 6c ad ldd r22, Y+60 ; 0x3c 1e4e4: 7d ad ldd r23, Y+61 ; 0x3d 1e4e6: 8e ad ldd r24, Y+62 ; 0x3e 1e4e8: 9f ad ldd r25, Y+63 ; 0x3f 1e4ea: 6e 97 sbiw r28, 0x1e ; 30 1e4ec: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e4f0: 9b 01 movw r18, r22 1e4f2: ac 01 movw r20, r24 1e4f4: c3 56 subi r28, 0x63 ; 99 1e4f6: df 4f sbci r29, 0xFF ; 255 1e4f8: 68 81 ld r22, Y 1e4fa: 79 81 ldd r23, Y+1 ; 0x01 1e4fc: 8a 81 ldd r24, Y+2 ; 0x02 1e4fe: 9b 81 ldd r25, Y+3 ; 0x03 1e500: cd 59 subi r28, 0x9D ; 157 1e502: d0 40 sbci r29, 0x00 ; 0 1e504: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e508: 4b 01 movw r8, r22 1e50a: 5c 01 movw r10, r24 1e50c: cb 55 subi r28, 0x5B ; 91 1e50e: df 4f sbci r29, 0xFF ; 255 1e510: 28 81 ld r18, Y 1e512: 39 81 ldd r19, Y+1 ; 0x01 1e514: 4a 81 ldd r20, Y+2 ; 0x02 1e516: 5b 81 ldd r21, Y+3 ; 0x03 1e518: c5 5a subi r28, 0xA5 ; 165 1e51a: d0 40 sbci r29, 0x00 ; 0 1e51c: c3 01 movw r24, r6 1e51e: b2 01 movw r22, r4 1e520: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e524: 9b 01 movw r18, r22 1e526: ac 01 movw r20, r24 1e528: c5 01 movw r24, r10 1e52a: b4 01 movw r22, r8 1e52c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e530: 4b 01 movw r8, r22 1e532: 5c 01 movw r10, r24 1e534: a7 01 movw r20, r14 1e536: 96 01 movw r18, r12 1e538: cd 54 subi r28, 0x4D ; 77 1e53a: df 4f sbci r29, 0xFF ; 255 1e53c: 68 81 ld r22, Y 1e53e: 79 81 ldd r23, Y+1 ; 0x01 1e540: 8a 81 ldd r24, Y+2 ; 0x02 1e542: 9b 81 ldd r25, Y+3 ; 0x03 1e544: c3 5b subi r28, 0xB3 ; 179 1e546: d0 40 sbci r29, 0x00 ; 0 1e548: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e54c: 9b 01 movw r18, r22 1e54e: ac 01 movw r20, r24 1e550: c5 01 movw r24, r10 1e552: b4 01 movw r22, r8 1e554: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e558: c9 54 subi r28, 0x49 ; 73 1e55a: df 4f sbci r29, 0xFF ; 255 1e55c: 28 81 ld r18, Y 1e55e: 39 81 ldd r19, Y+1 ; 0x01 1e560: 4a 81 ldd r20, Y+2 ; 0x02 1e562: 5b 81 ldd r21, Y+3 ; 0x03 1e564: c7 5b subi r28, 0xB7 ; 183 1e566: d0 40 sbci r29, 0x00 ; 0 1e568: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1e56c: 4b 01 movw r8, r22 1e56e: 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]; 1e570: c1 54 subi r28, 0x41 ; 65 1e572: df 4f sbci r29, 0xFF ; 255 1e574: 28 81 ld r18, Y 1e576: 39 81 ldd r19, Y+1 ; 0x01 1e578: 4a 81 ldd r20, Y+2 ; 0x02 1e57a: 5b 81 ldd r21, Y+3 ; 0x03 1e57c: cf 5b subi r28, 0xBF ; 191 1e57e: d0 40 sbci r29, 0x00 ; 0 1e580: 6e 96 adiw r28, 0x1e ; 30 1e582: 6c ad ldd r22, Y+60 ; 0x3c 1e584: 7d ad ldd r23, Y+61 ; 0x3d 1e586: 8e ad ldd r24, Y+62 ; 0x3e 1e588: 9f ad ldd r25, Y+63 ; 0x3f 1e58a: 6e 97 sbiw r28, 0x1e ; 30 1e58c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e590: 9b 01 movw r18, r22 1e592: ac 01 movw r20, r24 1e594: c5 54 subi r28, 0x45 ; 69 1e596: df 4f sbci r29, 0xFF ; 255 1e598: 68 81 ld r22, Y 1e59a: 79 81 ldd r23, Y+1 ; 0x01 1e59c: 8a 81 ldd r24, Y+2 ; 0x02 1e59e: 9b 81 ldd r25, Y+3 ; 0x03 1e5a0: cb 5b subi r28, 0xBB ; 187 1e5a2: d0 40 sbci r29, 0x00 ; 0 1e5a4: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e5a8: 6b 01 movw r12, r22 1e5aa: 7c 01 movw r14, r24 1e5ac: cd 53 subi r28, 0x3D ; 61 1e5ae: df 4f sbci r29, 0xFF ; 255 1e5b0: 28 81 ld r18, Y 1e5b2: 39 81 ldd r19, Y+1 ; 0x01 1e5b4: 4a 81 ldd r20, Y+2 ; 0x02 1e5b6: 5b 81 ldd r21, Y+3 ; 0x03 1e5b8: c3 5c subi r28, 0xC3 ; 195 1e5ba: d0 40 sbci r29, 0x00 ; 0 1e5bc: c3 01 movw r24, r6 1e5be: b2 01 movw r22, r4 1e5c0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e5c4: 9b 01 movw r18, r22 1e5c6: ac 01 movw r20, r24 1e5c8: c7 01 movw r24, r14 1e5ca: b6 01 movw r22, r12 1e5cc: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e5d0: 6b 01 movw r12, r22 1e5d2: 7c 01 movw r14, r24 1e5d4: c9 53 subi r28, 0x39 ; 57 1e5d6: df 4f sbci r29, 0xFF ; 255 1e5d8: 28 81 ld r18, Y 1e5da: 39 81 ldd r19, Y+1 ; 0x01 1e5dc: 4a 81 ldd r20, Y+2 ; 0x02 1e5de: 5b 81 ldd r21, Y+3 ; 0x03 1e5e0: c7 5c subi r28, 0xC7 ; 199 1e5e2: d0 40 sbci r29, 0x00 ; 0 1e5e4: c5 01 movw r24, r10 1e5e6: b4 01 movw r22, r8 1e5e8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e5ec: 9b 01 movw r18, r22 1e5ee: ac 01 movw r20, r24 1e5f0: c7 01 movw r24, r14 1e5f2: b6 01 movw r22, r12 1e5f4: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e5f8: c5 53 subi r28, 0x35 ; 53 1e5fa: df 4f sbci r29, 0xFF ; 255 1e5fc: 28 81 ld r18, Y 1e5fe: 39 81 ldd r19, Y+1 ; 0x01 1e600: 4a 81 ldd r20, Y+2 ; 0x02 1e602: 5b 81 ldd r21, Y+3 ; 0x03 1e604: cb 5c subi r28, 0xCB ; 203 1e606: d0 40 sbci r29, 0x00 ; 0 1e608: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1e60c: 6b 01 movw r12, r22 1e60e: 7c 01 movw r14, r24 1e610: 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) { 1e612: 09 f0 breq .+2 ; 0x1e616 1e614: c9 ce rjmp .-622 ; 0x1e3a8 // 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]; 1e616: 6e 96 adiw r28, 0x1e ; 30 1e618: 2c ad ldd r18, Y+60 ; 0x3c 1e61a: 3d ad ldd r19, Y+61 ; 0x3d 1e61c: 4e ad ldd r20, Y+62 ; 0x3e 1e61e: 5f ad ldd r21, Y+63 ; 0x3f 1e620: 6e 97 sbiw r28, 0x1e ; 30 1e622: c5 55 subi r28, 0x55 ; 85 1e624: df 4f sbci r29, 0xFF ; 255 1e626: 68 81 ld r22, Y 1e628: 79 81 ldd r23, Y+1 ; 0x01 1e62a: 8a 81 ldd r24, Y+2 ; 0x02 1e62c: 9b 81 ldd r25, Y+3 ; 0x03 1e62e: cb 5a subi r28, 0xAB ; 171 1e630: d0 40 sbci r29, 0x00 ; 0 1e632: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e636: 60 93 cf 13 sts 0x13CF, r22 ; 0x8013cf 1e63a: 70 93 d0 13 sts 0x13D0, r23 ; 0x8013d0 1e63e: 80 93 d1 13 sts 0x13D1, r24 ; 0x8013d1 1e642: 90 93 d2 13 sts 0x13D2, r25 ; 0x8013d2 cntr[1] += h[1]; 1e646: a3 01 movw r20, r6 1e648: 92 01 movw r18, r4 1e64a: c1 55 subi r28, 0x51 ; 81 1e64c: df 4f sbci r29, 0xFF ; 255 1e64e: 68 81 ld r22, Y 1e650: 79 81 ldd r23, Y+1 ; 0x01 1e652: 8a 81 ldd r24, Y+2 ; 0x02 1e654: 9b 81 ldd r25, Y+3 ; 0x03 1e656: cf 5a subi r28, 0xAF ; 175 1e658: d0 40 sbci r29, 0x00 ; 0 1e65a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e65e: 60 93 d3 13 sts 0x13D3, r22 ; 0x8013d3 1e662: 70 93 d4 13 sts 0x13D4, r23 ; 0x8013d4 1e666: 80 93 d5 13 sts 0x13D5, r24 ; 0x8013d5 1e66a: 90 93 d6 13 sts 0x13D6, r25 ; 0x8013d6 a1 += h[2]; 1e66e: a5 01 movw r20, r10 1e670: 94 01 movw r18, r8 1e672: a6 96 adiw r28, 0x26 ; 38 1e674: 6c ad ldd r22, Y+60 ; 0x3c 1e676: 7d ad ldd r23, Y+61 ; 0x3d 1e678: 8e ad ldd r24, Y+62 ; 0x3e 1e67a: 9f ad ldd r25, Y+63 ; 0x3f 1e67c: a6 97 sbiw r28, 0x26 ; 38 1e67e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e682: a6 96 adiw r28, 0x26 ; 38 1e684: 6c af std Y+60, r22 ; 0x3c 1e686: 7d af std Y+61, r23 ; 0x3d 1e688: 8e af std Y+62, r24 ; 0x3e 1e68a: 9f af std Y+63, r25 ; 0x3f 1e68c: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1e68e: a7 01 movw r20, r14 1e690: 96 01 movw r18, r12 1e692: a2 96 adiw r28, 0x22 ; 34 1e694: 6c ad ldd r22, Y+60 ; 0x3c 1e696: 7d ad ldd r23, Y+61 ; 0x3d 1e698: 8e ad ldd r24, Y+62 ; 0x3e 1e69a: 9f ad ldd r25, Y+63 ; 0x3f 1e69c: a2 97 sbiw r28, 0x22 ; 34 1e69e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e6a2: a2 96 adiw r28, 0x22 ; 34 1e6a4: 6c af std Y+60, r22 ; 0x3c 1e6a6: 7d af std Y+61, r23 ; 0x3d 1e6a8: 8e af std Y+62, r24 ; 0x3e 1e6aa: 9f af std Y+63, r25 ; 0x3f 1e6ac: a2 97 sbiw r28, 0x22 ; 34 1e6ae: e6 96 adiw r28, 0x36 ; 54 1e6b0: 9f ad ldd r25, Y+63 ; 0x3f 1e6b2: e6 97 sbiw r28, 0x36 ; 54 1e6b4: 91 50 subi r25, 0x01 ; 1 1e6b6: e6 96 adiw r28, 0x36 ; 54 1e6b8: 9f af std Y+63, r25 ; 0x3f 1e6ba: 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) { 1e6bc: 91 11 cpse r25, r1 1e6be: 70 c9 rjmp .-3360 ; 0x1d9a0 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1e6c0: a6 96 adiw r28, 0x26 ; 38 1e6c2: 6c ad ldd r22, Y+60 ; 0x3c 1e6c4: 7d ad ldd r23, Y+61 ; 0x3d 1e6c6: 8e ad ldd r24, Y+62 ; 0x3e 1e6c8: 9f ad ldd r25, Y+63 ; 0x3f 1e6ca: a6 97 sbiw r28, 0x26 ; 38 1e6cc: 0f 94 ab df call 0x3bf56 ; 0x3bf56 1e6d0: 60 93 bf 13 sts 0x13BF, r22 ; 0x8013bf 1e6d4: 70 93 c0 13 sts 0x13C0, r23 ; 0x8013c0 1e6d8: 80 93 c1 13 sts 0x13C1, r24 ; 0x8013c1 1e6dc: 90 93 c2 13 sts 0x13C2, r25 ; 0x8013c2 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1e6e0: a6 96 adiw r28, 0x26 ; 38 1e6e2: 6c ad ldd r22, Y+60 ; 0x3c 1e6e4: 7d ad ldd r23, Y+61 ; 0x3d 1e6e6: 8e ad ldd r24, Y+62 ; 0x3e 1e6e8: 9f ad ldd r25, Y+63 ; 0x3f 1e6ea: a6 97 sbiw r28, 0x26 ; 38 1e6ec: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 1e6f0: 60 93 c3 13 sts 0x13C3, r22 ; 0x8013c3 1e6f4: 70 93 c4 13 sts 0x13C4, r23 ; 0x8013c4 1e6f8: 80 93 c5 13 sts 0x13C5, r24 ; 0x8013c5 1e6fc: 90 93 c6 13 sts 0x13C6, r25 ; 0x8013c6 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1e700: a2 96 adiw r28, 0x22 ; 34 1e702: 6c ad ldd r22, Y+60 ; 0x3c 1e704: 7d ad ldd r23, Y+61 ; 0x3d 1e706: 8e ad ldd r24, Y+62 ; 0x3e 1e708: 9f ad ldd r25, Y+63 ; 0x3f 1e70a: a2 97 sbiw r28, 0x22 ; 34 1e70c: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 1e710: 90 58 subi r25, 0x80 ; 128 1e712: 60 93 c7 13 sts 0x13C7, r22 ; 0x8013c7 1e716: 70 93 c8 13 sts 0x13C8, r23 ; 0x8013c8 1e71a: 80 93 c9 13 sts 0x13C9, r24 ; 0x8013c9 1e71e: 90 93 ca 13 sts 0x13CA, r25 ; 0x8013ca vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1e722: a2 96 adiw r28, 0x22 ; 34 1e724: 6c ad ldd r22, Y+60 ; 0x3c 1e726: 7d ad ldd r23, Y+61 ; 0x3d 1e728: 8e ad ldd r24, Y+62 ; 0x3e 1e72a: 9f ad ldd r25, Y+63 ; 0x3f 1e72c: a2 97 sbiw r28, 0x22 ; 34 1e72e: 0f 94 ab df call 0x3bf56 ; 0x3bf56 1e732: 60 93 cb 13 sts 0x13CB, r22 ; 0x8013cb 1e736: 70 93 cc 13 sts 0x13CC, r23 ; 0x8013cc 1e73a: 80 93 cd 13 sts 0x13CD, r24 ; 0x8013cd 1e73e: 90 93 ce 13 sts 0x13CE, r25 ; 0x8013ce BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1e742: a6 96 adiw r28, 0x26 ; 38 1e744: 2c ad ldd r18, Y+60 ; 0x3c 1e746: 3d ad ldd r19, Y+61 ; 0x3d 1e748: 4e ad ldd r20, Y+62 ; 0x3e 1e74a: 5f ad ldd r21, Y+63 ; 0x3f 1e74c: a6 97 sbiw r28, 0x26 ; 38 1e74e: a2 96 adiw r28, 0x22 ; 34 1e750: 6c ad ldd r22, Y+60 ; 0x3c 1e752: 7d ad ldd r23, Y+61 ; 0x3d 1e754: 8e ad ldd r24, Y+62 ; 0x3e 1e756: 9f ad ldd r25, Y+63 ; 0x3f 1e758: a2 97 sbiw r28, 0x22 ; 34 1e75a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e75e: 4b 01 movw r8, r22 1e760: 5c 01 movw r10, r24 1e762: 7c 01 movw r14, r24 1e764: 6b 01 movw r12, r22 1e766: e8 94 clt 1e768: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1e76a: 21 ee ldi r18, 0xE1 ; 225 1e76c: 3e e2 ldi r19, 0x2E ; 46 1e76e: 45 e6 ldi r20, 0x65 ; 101 1e770: 52 e4 ldi r21, 0x42 ; 66 1e772: a2 96 adiw r28, 0x22 ; 34 1e774: 6c ad ldd r22, Y+60 ; 0x3c 1e776: 7d ad ldd r23, Y+61 ; 0x3d 1e778: 8e ad ldd r24, Y+62 ; 0x3e 1e77a: 9f ad ldd r25, Y+63 ; 0x3f 1e77c: a2 97 sbiw r28, 0x22 ; 34 1e77e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e782: 9f 93 push r25 1e784: 8f 93 push r24 1e786: 7f 93 push r23 1e788: 6f 93 push r22 1e78a: 21 ee ldi r18, 0xE1 ; 225 1e78c: 3e e2 ldi r19, 0x2E ; 46 1e78e: 45 e6 ldi r20, 0x65 ; 101 1e790: 52 e4 ldi r21, 0x42 ; 66 1e792: c5 01 movw r24, r10 1e794: b4 01 movw r22, r8 1e796: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e79a: 9f 93 push r25 1e79c: 8f 93 push r24 1e79e: 7f 93 push r23 1e7a0: 6f 93 push r22 1e7a2: 86 e1 ldi r24, 0x16 ; 22 1e7a4: 9e e6 ldi r25, 0x6E ; 110 1e7a6: 9f 93 push r25 1e7a8: 8f 93 push r24 1e7aa: 0f 94 4b dc call 0x3b896 ; 0x3b896 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1e7ae: b7 01 movw r22, r14 1e7b0: a6 01 movw r20, r12 1e7b2: 80 e6 ldi r24, 0x60 ; 96 1e7b4: 9f e0 ldi r25, 0x0F ; 15 1e7b6: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 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) 1e7ba: 0f b6 in r0, 0x3f ; 63 1e7bc: f8 94 cli 1e7be: de bf out 0x3e, r29 ; 62 1e7c0: 0f be out 0x3f, r0 ; 63 1e7c2: cd bf out 0x3d, r28 ; 61 1e7c4: 2f e1 ldi r18, 0x1F ; 31 1e7c6: 32 e4 ldi r19, 0x42 ; 66 1e7c8: 49 e0 ldi r20, 0x09 ; 9 1e7ca: 5b e3 ldi r21, 0x3B ; 59 1e7cc: c7 01 movw r24, r14 1e7ce: b6 01 movw r22, r12 1e7d0: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__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; 1e7d4: 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) 1e7d6: 18 16 cp r1, r24 1e7d8: 64 f4 brge .+24 ; 0x1e7f2 result = (angleDiff > bed_skew_angle_extreme) ? 1e7da: 25 e3 ldi r18, 0x35 ; 53 1e7dc: 3a ef ldi r19, 0xFA ; 250 1e7de: 4e e8 ldi r20, 0x8E ; 142 1e7e0: 5b e3 ldi r21, 0x3B ; 59 1e7e2: c7 01 movw r24, r14 1e7e4: b6 01 movw r22, r12 1e7e6: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1e7ea: 12 e0 ldi r17, 0x02 ; 2 1e7ec: 18 16 cp r1, r24 1e7ee: 0c f0 brlt .+2 ; 0x1e7f2 1e7f0: 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 || 1e7f2: 25 e3 ldi r18, 0x35 ; 53 1e7f4: 3a ef ldi r19, 0xFA ; 250 1e7f6: 4e e8 ldi r20, 0x8E ; 142 1e7f8: 5b e3 ldi r21, 0x3B ; 59 1e7fa: a6 96 adiw r28, 0x26 ; 38 1e7fc: 6c ad ldd r22, Y+60 ; 0x3c 1e7fe: 7d ad ldd r23, Y+61 ; 0x3d 1e800: 8e ad ldd r24, Y+62 ; 0x3e 1e802: 9f ad ldd r25, Y+63 ; 0x3f 1e804: a6 97 sbiw r28, 0x26 ; 38 1e806: 9f 77 andi r25, 0x7F ; 127 1e808: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1e80c: 18 16 cp r1, r24 1e80e: 0c f4 brge .+2 ; 0x1e812 1e810: 67 c4 rjmp .+2254 ; 0x1f0e0 1e812: 25 e3 ldi r18, 0x35 ; 53 1e814: 3a ef ldi r19, 0xFA ; 250 1e816: 4e e8 ldi r20, 0x8E ; 142 1e818: 5b e3 ldi r21, 0x3B ; 59 1e81a: a2 96 adiw r28, 0x22 ; 34 1e81c: 6c ad ldd r22, Y+60 ; 0x3c 1e81e: 7d ad ldd r23, Y+61 ; 0x3d 1e820: 8e ad ldd r24, Y+62 ; 0x3e 1e822: 9f ad ldd r25, Y+63 ; 0x3f 1e824: a2 97 sbiw r28, 0x22 ; 34 1e826: 9f 77 andi r25, 0x7F ; 127 1e828: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1e82c: 18 16 cp r1, r24 1e82e: 0c f4 brge .+2 ; 0x1e832 1e830: 57 c4 rjmp .+2222 ; 0x1f0e0 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]; 1e832: 20 91 bf 13 lds r18, 0x13BF ; 0x8013bf 1e836: 30 91 c0 13 lds r19, 0x13C0 ; 0x8013c0 1e83a: 40 91 c1 13 lds r20, 0x13C1 ; 0x8013c1 1e83e: 50 91 c2 13 lds r21, 0x13C2 ; 0x8013c2 1e842: ae 96 adiw r28, 0x2e ; 46 1e844: 2c af std Y+60, r18 ; 0x3c 1e846: 3d af std Y+61, r19 ; 0x3d 1e848: 4e af std Y+62, r20 ; 0x3e 1e84a: 5f af std Y+63, r21 ; 0x3f 1e84c: ae 97 sbiw r28, 0x2e ; 46 1e84e: 80 91 c7 13 lds r24, 0x13C7 ; 0x8013c7 1e852: 90 91 c8 13 lds r25, 0x13C8 ; 0x8013c8 1e856: a0 91 c9 13 lds r26, 0x13C9 ; 0x8013c9 1e85a: b0 91 ca 13 lds r27, 0x13CA ; 0x8013ca 1e85e: e9 96 adiw r28, 0x39 ; 57 1e860: 8c af std Y+60, r24 ; 0x3c 1e862: 9d af std Y+61, r25 ; 0x3d 1e864: ae af std Y+62, r26 ; 0x3e 1e866: bf af std Y+63, r27 ; 0x3f 1e868: e9 97 sbiw r28, 0x39 ; 57 1e86a: 20 91 cf 13 lds r18, 0x13CF ; 0x8013cf 1e86e: 30 91 d0 13 lds r19, 0x13D0 ; 0x8013d0 1e872: 40 91 d1 13 lds r20, 0x13D1 ; 0x8013d1 1e876: 50 91 d2 13 lds r21, 0x13D2 ; 0x8013d2 1e87a: e4 96 adiw r28, 0x34 ; 52 1e87c: 2c af std Y+60, r18 ; 0x3c 1e87e: 3d af std Y+61, r19 ; 0x3d 1e880: 4e af std Y+62, r20 ; 0x3e 1e882: 5f af std Y+63, r21 ; 0x3f 1e884: 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]; 1e886: 80 91 c3 13 lds r24, 0x13C3 ; 0x8013c3 1e88a: 90 91 c4 13 lds r25, 0x13C4 ; 0x8013c4 1e88e: a0 91 c5 13 lds r26, 0x13C5 ; 0x8013c5 1e892: b0 91 c6 13 lds r27, 0x13C6 ; 0x8013c6 1e896: ed 96 adiw r28, 0x3d ; 61 1e898: 8c af std Y+60, r24 ; 0x3c 1e89a: 9d af std Y+61, r25 ; 0x3d 1e89c: ae af std Y+62, r26 ; 0x3e 1e89e: bf af std Y+63, r27 ; 0x3f 1e8a0: ed 97 sbiw r28, 0x3d ; 61 1e8a2: 20 91 cb 13 lds r18, 0x13CB ; 0x8013cb 1e8a6: 30 91 cc 13 lds r19, 0x13CC ; 0x8013cc 1e8aa: 40 91 cd 13 lds r20, 0x13CD ; 0x8013cd 1e8ae: 50 91 ce 13 lds r21, 0x13CE ; 0x8013ce 1e8b2: c3 58 subi r28, 0x83 ; 131 1e8b4: df 4f sbci r29, 0xFF ; 255 1e8b6: 28 83 st Y, r18 1e8b8: 39 83 std Y+1, r19 ; 0x01 1e8ba: 4a 83 std Y+2, r20 ; 0x02 1e8bc: 5b 83 std Y+3, r21 ; 0x03 1e8be: cd 57 subi r28, 0x7D ; 125 1e8c0: d0 40 sbci r29, 0x00 ; 0 1e8c2: 80 91 d3 13 lds r24, 0x13D3 ; 0x8013d3 1e8c6: 90 91 d4 13 lds r25, 0x13D4 ; 0x8013d4 1e8ca: a0 91 d5 13 lds r26, 0x13D5 ; 0x8013d5 1e8ce: b0 91 d6 13 lds r27, 0x13D6 ; 0x8013d6 1e8d2: cf 57 subi r28, 0x7F ; 127 1e8d4: df 4f sbci r29, 0xFF ; 255 1e8d6: 88 83 st Y, r24 1e8d8: 99 83 std Y+1, r25 ; 0x01 1e8da: aa 83 std Y+2, r26 ; 0x02 1e8dc: bb 83 std Y+3, r27 ; 0x03 1e8de: c1 58 subi r28, 0x81 ; 129 1e8e0: d0 40 sbci r29, 0x00 ; 0 1e8e2: a6 e1 ldi r26, 0x16 ; 22 1e8e4: b2 e9 ldi r27, 0x92 ; 146 1e8e6: 6c 96 adiw r28, 0x1c ; 28 1e8e8: bf af std Y+63, r27 ; 0x3f 1e8ea: ae af std Y+62, r26 ; 0x3e 1e8ec: 6c 97 sbiw r28, 0x1c ; 28 1e8ee: 8e e9 ldi r24, 0x9E ; 158 1e8f0: 28 2e mov r2, r24 1e8f2: 83 e1 ldi r24, 0x13 ; 19 1e8f4: 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]; 1e8f6: f1 01 movw r30, r2 1e8f8: c1 80 ldd r12, Z+1 ; 0x01 1e8fa: d2 80 ldd r13, Z+2 ; 0x02 1e8fc: e3 80 ldd r14, Z+3 ; 0x03 1e8fe: f4 80 ldd r15, Z+4 ; 0x04 1e900: 45 80 ldd r4, Z+5 ; 0x05 1e902: 56 80 ldd r5, Z+6 ; 0x06 1e904: 67 80 ldd r6, Z+7 ; 0x07 1e906: 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; 1e908: 6c 96 adiw r28, 0x1c ; 28 1e90a: ee ad ldd r30, Y+62 ; 0x3e 1e90c: ff ad ldd r31, Y+63 ; 0x3f 1e90e: 6c 97 sbiw r28, 0x1c ; 28 1e910: 25 91 lpm r18, Z+ 1e912: 35 91 lpm r19, Z+ 1e914: 45 91 lpm r20, Z+ 1e916: 54 91 lpm r21, Z 1e918: cb 57 subi r28, 0x7B ; 123 1e91a: df 4f sbci r29, 0xFF ; 255 1e91c: 28 83 st Y, r18 1e91e: 39 83 std Y+1, r19 ; 0x01 1e920: 4a 83 std Y+2, r20 ; 0x02 1e922: 5b 83 std Y+3, r21 ; 0x03 1e924: c5 58 subi r28, 0x85 ; 133 1e926: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1e928: 6c 96 adiw r28, 0x1c ; 28 1e92a: ee ad ldd r30, Y+62 ; 0x3e 1e92c: ff ad ldd r31, Y+63 ; 0x3f 1e92e: 6c 97 sbiw r28, 0x1c ; 28 1e930: 34 96 adiw r30, 0x04 ; 4 1e932: 85 90 lpm r8, Z+ 1e934: 95 90 lpm r9, Z+ 1e936: a5 90 lpm r10, Z+ 1e938: 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]; 1e93a: ed 96 adiw r28, 0x3d ; 61 1e93c: 2c ad ldd r18, Y+60 ; 0x3c 1e93e: 3d ad ldd r19, Y+61 ; 0x3d 1e940: 4e ad ldd r20, Y+62 ; 0x3e 1e942: 5f ad ldd r21, Y+63 ; 0x3f 1e944: ed 97 sbiw r28, 0x3d ; 61 1e946: c7 01 movw r24, r14 1e948: b6 01 movw r22, r12 1e94a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e94e: c7 57 subi r28, 0x77 ; 119 1e950: df 4f sbci r29, 0xFF ; 255 1e952: 68 83 st Y, r22 1e954: 79 83 std Y+1, r23 ; 0x01 1e956: 8a 83 std Y+2, r24 ; 0x02 1e958: 9b 83 std Y+3, r25 ; 0x03 1e95a: c9 58 subi r28, 0x89 ; 137 1e95c: d0 40 sbci r29, 0x00 ; 0 1e95e: c3 58 subi r28, 0x83 ; 131 1e960: df 4f sbci r29, 0xFF ; 255 1e962: 28 81 ld r18, Y 1e964: 39 81 ldd r19, Y+1 ; 0x01 1e966: 4a 81 ldd r20, Y+2 ; 0x02 1e968: 5b 81 ldd r21, Y+3 ; 0x03 1e96a: cd 57 subi r28, 0x7D ; 125 1e96c: d0 40 sbci r29, 0x00 ; 0 1e96e: c3 01 movw r24, r6 1e970: b2 01 movw r22, r4 1e972: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e976: 9b 01 movw r18, r22 1e978: ac 01 movw r20, r24 1e97a: c7 57 subi r28, 0x77 ; 119 1e97c: df 4f sbci r29, 0xFF ; 255 1e97e: 68 81 ld r22, Y 1e980: 79 81 ldd r23, Y+1 ; 0x01 1e982: 8a 81 ldd r24, Y+2 ; 0x02 1e984: 9b 81 ldd r25, Y+3 ; 0x03 1e986: c9 58 subi r28, 0x89 ; 137 1e988: d0 40 sbci r29, 0x00 ; 0 1e98a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e98e: cf 57 subi r28, 0x7F ; 127 1e990: df 4f sbci r29, 0xFF ; 255 1e992: 28 81 ld r18, Y 1e994: 39 81 ldd r19, Y+1 ; 0x01 1e996: 4a 81 ldd r20, Y+2 ; 0x02 1e998: 5b 81 ldd r21, Y+3 ; 0x03 1e99a: c1 58 subi r28, 0x81 ; 129 1e99c: d0 40 sbci r29, 0x00 ; 0 1e99e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e9a2: 9b 01 movw r18, r22 1e9a4: 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; 1e9a6: c5 01 movw r24, r10 1e9a8: b4 01 movw r22, r8 1e9aa: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1e9ae: 4b 01 movw r8, r22 1e9b0: 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]; 1e9b2: a7 01 movw r20, r14 1e9b4: 96 01 movw r18, r12 1e9b6: ae 96 adiw r28, 0x2e ; 46 1e9b8: 6c ad ldd r22, Y+60 ; 0x3c 1e9ba: 7d ad ldd r23, Y+61 ; 0x3d 1e9bc: 8e ad ldd r24, Y+62 ; 0x3e 1e9be: 9f ad ldd r25, Y+63 ; 0x3f 1e9c0: ae 97 sbiw r28, 0x2e ; 46 1e9c2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e9c6: 6b 01 movw r12, r22 1e9c8: 7c 01 movw r14, r24 1e9ca: a3 01 movw r20, r6 1e9cc: 92 01 movw r18, r4 1e9ce: e9 96 adiw r28, 0x39 ; 57 1e9d0: 6c ad ldd r22, Y+60 ; 0x3c 1e9d2: 7d ad ldd r23, Y+61 ; 0x3d 1e9d4: 8e ad ldd r24, Y+62 ; 0x3e 1e9d6: 9f ad ldd r25, Y+63 ; 0x3f 1e9d8: e9 97 sbiw r28, 0x39 ; 57 1e9da: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1e9de: 9b 01 movw r18, r22 1e9e0: ac 01 movw r20, r24 1e9e2: c7 01 movw r24, r14 1e9e4: b6 01 movw r22, r12 1e9e6: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e9ea: e4 96 adiw r28, 0x34 ; 52 1e9ec: 2c ad ldd r18, Y+60 ; 0x3c 1e9ee: 3d ad ldd r19, Y+61 ; 0x3d 1e9f0: 4e ad ldd r20, Y+62 ; 0x3e 1e9f2: 5f ad ldd r21, Y+63 ; 0x3f 1e9f4: e4 97 sbiw r28, 0x34 ; 52 1e9f6: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1e9fa: 9b 01 movw r18, r22 1e9fc: 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; 1e9fe: cb 57 subi r28, 0x7B ; 123 1ea00: df 4f sbci r29, 0xFF ; 255 1ea02: 68 81 ld r22, Y 1ea04: 79 81 ldd r23, Y+1 ; 0x01 1ea06: 8a 81 ldd r24, Y+2 ; 0x02 1ea08: 9b 81 ldd r25, Y+3 ; 0x03 1ea0a: c5 58 subi r28, 0x85 ; 133 1ea0c: d0 40 sbci r29, 0x00 ; 0 1ea0e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1ea12: a5 01 movw r20, r10 1ea14: 94 01 movw r18, r8 1ea16: 0f 94 4d e1 call 0x3c29a ; 0x3c29a } 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) { 1ea1a: 2d ec ldi r18, 0xCD ; 205 1ea1c: 3c ec ldi r19, 0xCC ; 204 1ea1e: 4c e4 ldi r20, 0x4C ; 76 1ea20: 5f e3 ldi r21, 0x3F ; 63 1ea22: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1ea26: 18 16 cp r1, r24 1ea28: 0c f4 brge .+2 ; 0x1ea2c result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1ea2a: 1e ef ldi r17, 0xFE ; 254 1ea2c: 38 e0 ldi r19, 0x08 ; 8 1ea2e: 23 0e add r2, r19 1ea30: 31 1c adc r3, r1 1ea32: 6c 96 adiw r28, 0x1c ; 28 1ea34: 4e ad ldd r20, Y+62 ; 0x3e 1ea36: 5f ad ldd r21, Y+63 ; 0x3f 1ea38: 6c 97 sbiw r28, 0x1c ; 28 1ea3a: 48 5f subi r20, 0xF8 ; 248 1ea3c: 5f 4f sbci r21, 0xFF ; 255 1ea3e: 6c 96 adiw r28, 0x1c ; 28 1ea40: 5f af std Y+63, r21 ; 0x3f 1ea42: 4e af std Y+62, r20 ; 0x3e 1ea44: 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) { 1ea46: a8 96 adiw r28, 0x28 ; 40 1ea48: 8e ad ldd r24, Y+62 ; 0x3e 1ea4a: 9f ad ldd r25, Y+63 ; 0x3f 1ea4c: a8 97 sbiw r28, 0x28 ; 40 1ea4e: 82 15 cp r24, r2 1ea50: 93 05 cpc r25, r3 1ea52: 09 f0 breq .+2 ; 0x1ea56 1ea54: 50 cf rjmp .-352 ; 0x1e8f6 MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1ea56: 11 11 cpse r17, r1 1ea58: 62 c1 rjmp .+708 ; 0x1ed1e #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); 1ea5a: a2 96 adiw r28, 0x22 ; 34 1ea5c: 2c ad ldd r18, Y+60 ; 0x3c 1ea5e: 3d ad ldd r19, Y+61 ; 0x3d 1ea60: 4e ad ldd r20, Y+62 ; 0x3e 1ea62: 5f ad ldd r21, Y+63 ; 0x3f 1ea64: a2 97 sbiw r28, 0x22 ; 34 1ea66: a6 96 adiw r28, 0x26 ; 38 1ea68: 6c ad ldd r22, Y+60 ; 0x3c 1ea6a: 7d ad ldd r23, Y+61 ; 0x3d 1ea6c: 8e ad ldd r24, Y+62 ; 0x3e 1ea6e: 9f ad ldd r25, Y+63 ; 0x3f 1ea70: a6 97 sbiw r28, 0x26 ; 38 1ea72: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1ea76: 20 e0 ldi r18, 0x00 ; 0 1ea78: 30 e0 ldi r19, 0x00 ; 0 1ea7a: 40 e0 ldi r20, 0x00 ; 0 1ea7c: 5f e3 ldi r21, 0x3F ; 63 1ea7e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1ea82: 6b 01 movw r12, r22 1ea84: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1ea86: 0f 94 ab df call 0x3bf56 ; 0x3bf56 1ea8a: a2 96 adiw r28, 0x22 ; 34 1ea8c: 6c af std Y+60, r22 ; 0x3c 1ea8e: 7d af std Y+61, r23 ; 0x3d 1ea90: 8e af std Y+62, r24 ; 0x3e 1ea92: 9f af std Y+63, r25 ; 0x3f 1ea94: a2 97 sbiw r28, 0x22 ; 34 1ea96: 60 93 bf 13 sts 0x13BF, r22 ; 0x8013bf 1ea9a: 70 93 c0 13 sts 0x13C0, r23 ; 0x8013c0 1ea9e: 80 93 c1 13 sts 0x13C1, r24 ; 0x8013c1 1eaa2: 90 93 c2 13 sts 0x13C2, r25 ; 0x8013c2 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1eaa6: c7 01 movw r24, r14 1eaa8: b6 01 movw r22, r12 1eaaa: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 1eaae: a6 96 adiw r28, 0x26 ; 38 1eab0: 6c af std Y+60, r22 ; 0x3c 1eab2: 7d af std Y+61, r23 ; 0x3d 1eab4: 8e af std Y+62, r24 ; 0x3e 1eab6: 9f af std Y+63, r25 ; 0x3f 1eab8: a6 97 sbiw r28, 0x26 ; 38 1eaba: 60 93 c3 13 sts 0x13C3, r22 ; 0x8013c3 1eabe: 70 93 c4 13 sts 0x13C4, r23 ; 0x8013c4 1eac2: 80 93 c5 13 sts 0x13C5, r24 ; 0x8013c5 1eac6: 90 93 c6 13 sts 0x13C6, r25 ; 0x8013c6 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1eaca: 9b 01 movw r18, r22 1eacc: ac 01 movw r20, r24 1eace: 50 58 subi r21, 0x80 ; 128 1ead0: aa 96 adiw r28, 0x2a ; 42 1ead2: 2c af std Y+60, r18 ; 0x3c 1ead4: 3d af std Y+61, r19 ; 0x3d 1ead6: 4e af std Y+62, r20 ; 0x3e 1ead8: 5f af std Y+63, r21 ; 0x3f 1eada: aa 97 sbiw r28, 0x2a ; 42 1eadc: 20 93 c7 13 sts 0x13C7, r18 ; 0x8013c7 1eae0: 30 93 c8 13 sts 0x13C8, r19 ; 0x8013c8 1eae4: 40 93 c9 13 sts 0x13C9, r20 ; 0x8013c9 1eae8: 50 93 ca 13 sts 0x13CA, r21 ; 0x8013ca vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1eaec: a2 96 adiw r28, 0x22 ; 34 1eaee: 8c ad ldd r24, Y+60 ; 0x3c 1eaf0: 9d ad ldd r25, Y+61 ; 0x3d 1eaf2: ae ad ldd r26, Y+62 ; 0x3e 1eaf4: bf ad ldd r27, Y+63 ; 0x3f 1eaf6: a2 97 sbiw r28, 0x22 ; 34 1eaf8: 80 93 cb 13 sts 0x13CB, r24 ; 0x8013cb 1eafc: 90 93 cc 13 sts 0x13CC, r25 ; 0x8013cc 1eb00: a0 93 cd 13 sts 0x13CD, r26 ; 0x8013cd 1eb04: b0 93 ce 13 sts 0x13CE, r27 ; 0x8013ce // Refresh the offset. cntr[0] = 0.f; 1eb08: 10 92 cf 13 sts 0x13CF, r1 ; 0x8013cf 1eb0c: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 1eb10: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 1eb14: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 cntr[1] = 0.f; 1eb18: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1eb1c: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 1eb20: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 1eb24: 10 92 d6 13 sts 0x13D6, r1 ; 0x8013d6 float wx = 0.f; 1eb28: 41 2c mov r4, r1 1eb2a: 51 2c mov r5, r1 1eb2c: 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]; 1eb2e: cf 56 subi r28, 0x6F ; 111 1eb30: df 4f sbci r29, 0xFF ; 255 1eb32: a8 81 ld r26, Y 1eb34: b9 81 ldd r27, Y+1 ; 0x01 1eb36: c1 59 subi r28, 0x91 ; 145 1eb38: d0 40 sbci r29, 0x00 ; 0 1eb3a: 11 96 adiw r26, 0x01 ; 1 1eb3c: 8d 90 ld r8, X+ 1eb3e: 9d 90 ld r9, X+ 1eb40: ad 90 ld r10, X+ 1eb42: bc 90 ld r11, X 1eb44: 14 97 sbiw r26, 0x04 ; 4 1eb46: 15 96 adiw r26, 0x05 ; 5 1eb48: 2d 91 ld r18, X+ 1eb4a: 3d 91 ld r19, X+ 1eb4c: 4d 91 ld r20, X+ 1eb4e: 5c 91 ld r21, X 1eb50: 18 97 sbiw r26, 0x08 ; 8 1eb52: 6e 96 adiw r28, 0x1e ; 30 1eb54: 2c af std Y+60, r18 ; 0x3c 1eb56: 3d af std Y+61, r19 ; 0x3d 1eb58: 4e af std Y+62, r20 ; 0x3e 1eb5a: 5f af std Y+63, r21 ; 0x3f 1eb5c: 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); 1eb5e: cd 56 subi r28, 0x6D ; 109 1eb60: df 4f sbci r29, 0xFF ; 255 1eb62: e8 81 ld r30, Y 1eb64: f9 81 ldd r31, Y+1 ; 0x01 1eb66: c3 59 subi r28, 0x93 ; 147 1eb68: d0 40 sbci r29, 0x00 ; 0 1eb6a: c5 90 lpm r12, Z+ 1eb6c: d5 90 lpm r13, Z+ 1eb6e: e5 90 lpm r14, Z+ 1eb70: 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]; 1eb72: a5 01 movw r20, r10 1eb74: 94 01 movw r18, r8 1eb76: a2 96 adiw r28, 0x22 ; 34 1eb78: 6c ad ldd r22, Y+60 ; 0x3c 1eb7a: 7d ad ldd r23, Y+61 ; 0x3d 1eb7c: 8e ad ldd r24, Y+62 ; 0x3e 1eb7e: 9f ad ldd r25, Y+63 ; 0x3f 1eb80: a2 97 sbiw r28, 0x22 ; 34 1eb82: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1eb86: ae 96 adiw r28, 0x2e ; 46 1eb88: 6c af std Y+60, r22 ; 0x3c 1eb8a: 7d af std Y+61, r23 ; 0x3d 1eb8c: 8e af std Y+62, r24 ; 0x3e 1eb8e: 9f af std Y+63, r25 ; 0x3f 1eb90: ae 97 sbiw r28, 0x2e ; 46 1eb92: 6e 96 adiw r28, 0x1e ; 30 1eb94: 2c ad ldd r18, Y+60 ; 0x3c 1eb96: 3d ad ldd r19, Y+61 ; 0x3d 1eb98: 4e ad ldd r20, Y+62 ; 0x3e 1eb9a: 5f ad ldd r21, Y+63 ; 0x3f 1eb9c: 6e 97 sbiw r28, 0x1e ; 30 1eb9e: aa 96 adiw r28, 0x2a ; 42 1eba0: 6c ad ldd r22, Y+60 ; 0x3c 1eba2: 7d ad ldd r23, Y+61 ; 0x3d 1eba4: 8e ad ldd r24, Y+62 ; 0x3e 1eba6: 9f ad ldd r25, Y+63 ; 0x3f 1eba8: aa 97 sbiw r28, 0x2a ; 42 1ebaa: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1ebae: 9b 01 movw r18, r22 1ebb0: ac 01 movw r20, r24 1ebb2: ae 96 adiw r28, 0x2e ; 46 1ebb4: 6c ad ldd r22, Y+60 ; 0x3c 1ebb6: 7d ad ldd r23, Y+61 ; 0x3d 1ebb8: 8e ad ldd r24, Y+62 ; 0x3e 1ebba: 9f ad ldd r25, Y+63 ; 0x3f 1ebbc: ae 97 sbiw r28, 0x2e ; 46 1ebbe: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1ebc2: 9b 01 movw r18, r22 1ebc4: 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); 1ebc6: c7 01 movw r24, r14 1ebc8: b6 01 movw r22, r12 1ebca: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1ebce: 20 91 cf 13 lds r18, 0x13CF ; 0x8013cf 1ebd2: 30 91 d0 13 lds r19, 0x13D0 ; 0x8013d0 1ebd6: 40 91 d1 13 lds r20, 0x13D1 ; 0x8013d1 1ebda: 50 91 d2 13 lds r21, 0x13D2 ; 0x8013d2 1ebde: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1ebe2: 6b 01 movw r12, r22 1ebe4: 7c 01 movw r14, r24 1ebe6: c0 92 cf 13 sts 0x13CF, r12 ; 0x8013cf 1ebea: d0 92 d0 13 sts 0x13D0, r13 ; 0x8013d0 1ebee: e0 92 d1 13 sts 0x13D1, r14 ; 0x8013d1 1ebf2: f0 92 d2 13 sts 0x13D2, r15 ; 0x8013d2 wx += w; 1ebf6: 20 e0 ldi r18, 0x00 ; 0 1ebf8: 30 e0 ldi r19, 0x00 ; 0 1ebfa: 40 e8 ldi r20, 0x80 ; 128 1ebfc: 5f e3 ldi r21, 0x3F ; 63 1ebfe: c3 01 movw r24, r6 1ec00: b2 01 movw r22, r4 1ec02: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1ec06: 2b 01 movw r4, r22 1ec08: 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); 1ec0a: cd 56 subi r28, 0x6D ; 109 1ec0c: df 4f sbci r29, 0xFF ; 255 1ec0e: e8 81 ld r30, Y 1ec10: f9 81 ldd r31, Y+1 ; 0x01 1ec12: c3 59 subi r28, 0x93 ; 147 1ec14: d0 40 sbci r29, 0x00 ; 0 1ec16: 34 96 adiw r30, 0x04 ; 4 1ec18: 25 91 lpm r18, Z+ 1ec1a: 35 91 lpm r19, Z+ 1ec1c: 45 91 lpm r20, Z+ 1ec1e: 54 91 lpm r21, Z 1ec20: ae 96 adiw r28, 0x2e ; 46 1ec22: 2c af std Y+60, r18 ; 0x3c 1ec24: 3d af std Y+61, r19 ; 0x3d 1ec26: 4e af std Y+62, r20 ; 0x3e 1ec28: 5f af std Y+63, r21 ; 0x3f 1ec2a: 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]; 1ec2c: a5 01 movw r20, r10 1ec2e: 94 01 movw r18, r8 1ec30: a6 96 adiw r28, 0x26 ; 38 1ec32: 6c ad ldd r22, Y+60 ; 0x3c 1ec34: 7d ad ldd r23, Y+61 ; 0x3d 1ec36: 8e ad ldd r24, Y+62 ; 0x3e 1ec38: 9f ad ldd r25, Y+63 ; 0x3f 1ec3a: a6 97 sbiw r28, 0x26 ; 38 1ec3c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1ec40: 4b 01 movw r8, r22 1ec42: 5c 01 movw r10, r24 1ec44: 6e 96 adiw r28, 0x1e ; 30 1ec46: 2c ad ldd r18, Y+60 ; 0x3c 1ec48: 3d ad ldd r19, Y+61 ; 0x3d 1ec4a: 4e ad ldd r20, Y+62 ; 0x3e 1ec4c: 5f ad ldd r21, Y+63 ; 0x3f 1ec4e: 6e 97 sbiw r28, 0x1e ; 30 1ec50: a2 96 adiw r28, 0x22 ; 34 1ec52: 6c ad ldd r22, Y+60 ; 0x3c 1ec54: 7d ad ldd r23, Y+61 ; 0x3d 1ec56: 8e ad ldd r24, Y+62 ; 0x3e 1ec58: 9f ad ldd r25, Y+63 ; 0x3f 1ec5a: a2 97 sbiw r28, 0x22 ; 34 1ec5c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1ec60: 9b 01 movw r18, r22 1ec62: ac 01 movw r20, r24 1ec64: c5 01 movw r24, r10 1ec66: b4 01 movw r22, r8 1ec68: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1ec6c: 9b 01 movw r18, r22 1ec6e: 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); 1ec70: ae 96 adiw r28, 0x2e ; 46 1ec72: 6c ad ldd r22, Y+60 ; 0x3c 1ec74: 7d ad ldd r23, Y+61 ; 0x3d 1ec76: 8e ad ldd r24, Y+62 ; 0x3e 1ec78: 9f ad ldd r25, Y+63 ; 0x3f 1ec7a: ae 97 sbiw r28, 0x2e ; 46 1ec7c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1ec80: 20 91 d3 13 lds r18, 0x13D3 ; 0x8013d3 1ec84: 30 91 d4 13 lds r19, 0x13D4 ; 0x8013d4 1ec88: 40 91 d5 13 lds r20, 0x13D5 ; 0x8013d5 1ec8c: 50 91 d6 13 lds r21, 0x13D6 ; 0x8013d6 1ec90: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1ec94: 4b 01 movw r8, r22 1ec96: 5c 01 movw r10, r24 1ec98: 80 92 d3 13 sts 0x13D3, r8 ; 0x8013d3 1ec9c: 90 92 d4 13 sts 0x13D4, r9 ; 0x8013d4 1eca0: a0 92 d5 13 sts 0x13D5, r10 ; 0x8013d5 1eca4: b0 92 d6 13 sts 0x13D6, r11 ; 0x8013d6 1eca8: cf 56 subi r28, 0x6F ; 111 1ecaa: df 4f sbci r29, 0xFF ; 255 1ecac: 48 81 ld r20, Y 1ecae: 59 81 ldd r21, Y+1 ; 0x01 1ecb0: c1 59 subi r28, 0x91 ; 145 1ecb2: d0 40 sbci r29, 0x00 ; 0 1ecb4: 48 5f subi r20, 0xF8 ; 248 1ecb6: 5f 4f sbci r21, 0xFF ; 255 1ecb8: cf 56 subi r28, 0x6F ; 111 1ecba: df 4f sbci r29, 0xFF ; 255 1ecbc: 59 83 std Y+1, r21 ; 0x01 1ecbe: 48 83 st Y, r20 1ecc0: c1 59 subi r28, 0x91 ; 145 1ecc2: d0 40 sbci r29, 0x00 ; 0 1ecc4: cd 56 subi r28, 0x6D ; 109 1ecc6: df 4f sbci r29, 0xFF ; 255 1ecc8: 88 81 ld r24, Y 1ecca: 99 81 ldd r25, Y+1 ; 0x01 1eccc: c3 59 subi r28, 0x93 ; 147 1ecce: d0 40 sbci r29, 0x00 ; 0 1ecd0: 08 96 adiw r24, 0x08 ; 8 1ecd2: cd 56 subi r28, 0x6D ; 109 1ecd4: df 4f sbci r29, 0xFF ; 255 1ecd6: 99 83 std Y+1, r25 ; 0x01 1ecd8: 88 83 st Y, r24 1ecda: c3 59 subi r28, 0x93 ; 147 1ecdc: 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) { 1ecde: 24 16 cp r2, r20 1ece0: 35 06 cpc r3, r21 1ece2: 09 f0 breq .+2 ; 0x1ece6 1ece4: 24 cf rjmp .-440 ; 0x1eb2e SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1ece6: a3 01 movw r20, r6 1ece8: 92 01 movw r18, r4 1ecea: c7 01 movw r24, r14 1ecec: b6 01 movw r22, r12 1ecee: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1ecf2: 60 93 cf 13 sts 0x13CF, r22 ; 0x8013cf 1ecf6: 70 93 d0 13 sts 0x13D0, r23 ; 0x8013d0 1ecfa: 80 93 d1 13 sts 0x13D1, r24 ; 0x8013d1 1ecfe: 90 93 d2 13 sts 0x13D2, r25 ; 0x8013d2 cntr[1] /= wy; 1ed02: a3 01 movw r20, r6 1ed04: 92 01 movw r18, r4 1ed06: c5 01 movw r24, r10 1ed08: b4 01 movw r22, r8 1ed0a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1ed0e: 60 93 d3 13 sts 0x13D3, r22 ; 0x8013d3 1ed12: 70 93 d4 13 sts 0x13D4, r23 ; 0x8013d4 1ed16: 80 93 d5 13 sts 0x13D5, r24 ; 0x8013d5 1ed1a: 90 93 d6 13 sts 0x13D6, r25 ; 0x8013d6 #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]; 1ed1e: 40 90 bf 13 lds r4, 0x13BF ; 0x8013bf 1ed22: 50 90 c0 13 lds r5, 0x13C0 ; 0x8013c0 1ed26: 60 90 c1 13 lds r6, 0x13C1 ; 0x8013c1 1ed2a: 70 90 c2 13 lds r7, 0x13C2 ; 0x8013c2 1ed2e: c0 90 cb 13 lds r12, 0x13CB ; 0x8013cb 1ed32: d0 90 cc 13 lds r13, 0x13CC ; 0x8013cc 1ed36: e0 90 cd 13 lds r14, 0x13CD ; 0x8013cd 1ed3a: f0 90 ce 13 lds r15, 0x13CE ; 0x8013ce 1ed3e: 20 91 c3 13 lds r18, 0x13C3 ; 0x8013c3 1ed42: 30 91 c4 13 lds r19, 0x13C4 ; 0x8013c4 1ed46: 40 91 c5 13 lds r20, 0x13C5 ; 0x8013c5 1ed4a: 50 91 c6 13 lds r21, 0x13C6 ; 0x8013c6 1ed4e: a2 96 adiw r28, 0x22 ; 34 1ed50: 2c af std Y+60, r18 ; 0x3c 1ed52: 3d af std Y+61, r19 ; 0x3d 1ed54: 4e af std Y+62, r20 ; 0x3e 1ed56: 5f af std Y+63, r21 ; 0x3f 1ed58: a2 97 sbiw r28, 0x22 ; 34 1ed5a: 80 91 c7 13 lds r24, 0x13C7 ; 0x8013c7 1ed5e: 90 91 c8 13 lds r25, 0x13C8 ; 0x8013c8 1ed62: a0 91 c9 13 lds r26, 0x13C9 ; 0x8013c9 1ed66: b0 91 ca 13 lds r27, 0x13CA ; 0x8013ca 1ed6a: a6 96 adiw r28, 0x26 ; 38 1ed6c: 8c af std Y+60, r24 ; 0x3c 1ed6e: 9d af std Y+61, r25 ; 0x3d 1ed70: ae af std Y+62, r26 ; 0x3e 1ed72: bf af std Y+63, r27 ; 0x3f 1ed74: a6 97 sbiw r28, 0x26 ; 38 1ed76: a7 01 movw r20, r14 1ed78: 96 01 movw r18, r12 1ed7a: c3 01 movw r24, r6 1ed7c: b2 01 movw r22, r4 1ed7e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1ed82: 4b 01 movw r8, r22 1ed84: 5c 01 movw r10, r24 1ed86: a6 96 adiw r28, 0x26 ; 38 1ed88: 2c ad ldd r18, Y+60 ; 0x3c 1ed8a: 3d ad ldd r19, Y+61 ; 0x3d 1ed8c: 4e ad ldd r20, Y+62 ; 0x3e 1ed8e: 5f ad ldd r21, Y+63 ; 0x3f 1ed90: a6 97 sbiw r28, 0x26 ; 38 1ed92: a2 96 adiw r28, 0x22 ; 34 1ed94: 6c ad ldd r22, Y+60 ; 0x3c 1ed96: 7d ad ldd r23, Y+61 ; 0x3d 1ed98: 8e ad ldd r24, Y+62 ; 0x3e 1ed9a: 9f ad ldd r25, Y+63 ; 0x3f 1ed9c: a2 97 sbiw r28, 0x22 ; 34 1ed9e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1eda2: 9b 01 movw r18, r22 1eda4: ac 01 movw r20, r24 1eda6: c5 01 movw r24, r10 1eda8: b4 01 movw r22, r8 1edaa: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 1edae: 4b 01 movw r8, r22 1edb0: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1edb2: ac 01 movw r20, r24 1edb4: 9b 01 movw r18, r22 1edb6: c7 01 movw r24, r14 1edb8: b6 01 movw r22, r12 1edba: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1edbe: 6b 01 movw r12, r22 1edc0: 7c 01 movw r14, r24 1edc2: a6 96 adiw r28, 0x26 ; 38 1edc4: 6c ad ldd r22, Y+60 ; 0x3c 1edc6: 7d ad ldd r23, Y+61 ; 0x3d 1edc8: 8e ad ldd r24, Y+62 ; 0x3e 1edca: 9f ad ldd r25, Y+63 ; 0x3f 1edcc: a6 97 sbiw r28, 0x26 ; 38 1edce: 90 58 subi r25, 0x80 ; 128 1edd0: a5 01 movw r20, r10 1edd2: 94 01 movw r18, r8 1edd4: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1edd8: a6 96 adiw r28, 0x26 ; 38 1edda: 6c af std Y+60, r22 ; 0x3c 1eddc: 7d af std Y+61, r23 ; 0x3d 1edde: 8e af std Y+62, r24 ; 0x3e 1ede0: 9f af std Y+63, r25 ; 0x3f 1ede2: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1ede4: a2 96 adiw r28, 0x22 ; 34 1ede6: 6c ad ldd r22, Y+60 ; 0x3c 1ede8: 7d ad ldd r23, Y+61 ; 0x3d 1edea: 8e ad ldd r24, Y+62 ; 0x3e 1edec: 9f ad ldd r25, Y+63 ; 0x3f 1edee: a2 97 sbiw r28, 0x22 ; 34 1edf0: 90 58 subi r25, 0x80 ; 128 1edf2: a5 01 movw r20, r10 1edf4: 94 01 movw r18, r8 1edf6: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1edfa: aa 96 adiw r28, 0x2a ; 42 1edfc: 6c af std Y+60, r22 ; 0x3c 1edfe: 7d af std Y+61, r23 ; 0x3d 1ee00: 8e af std Y+62, r24 ; 0x3e 1ee02: 9f af std Y+63, r25 ; 0x3f 1ee04: aa 97 sbiw r28, 0x2a ; 42 1ee06: a5 01 movw r20, r10 1ee08: 94 01 movw r18, r8 1ee0a: c3 01 movw r24, r6 1ee0c: b2 01 movw r22, r4 1ee0e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 1ee12: 4b 01 movw r8, r22 1ee14: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ee16: 40 90 cf 13 lds r4, 0x13CF ; 0x8013cf 1ee1a: 50 90 d0 13 lds r5, 0x13D0 ; 0x8013d0 1ee1e: 60 90 d1 13 lds r6, 0x13D1 ; 0x8013d1 1ee22: 70 90 d2 13 lds r7, 0x13D2 ; 0x8013d2 1ee26: 20 91 d3 13 lds r18, 0x13D3 ; 0x8013d3 1ee2a: 30 91 d4 13 lds r19, 0x13D4 ; 0x8013d4 1ee2e: 40 91 d5 13 lds r20, 0x13D5 ; 0x8013d5 1ee32: 50 91 d6 13 lds r21, 0x13D6 ; 0x8013d6 1ee36: a2 96 adiw r28, 0x22 ; 34 1ee38: 2c af std Y+60, r18 ; 0x3c 1ee3a: 3d af std Y+61, r19 ; 0x3d 1ee3c: 4e af std Y+62, r20 ; 0x3e 1ee3e: 5f af std Y+63, r21 ; 0x3f 1ee40: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1ee42: c0 92 bf 13 sts 0x13BF, r12 ; 0x8013bf 1ee46: d0 92 c0 13 sts 0x13C0, r13 ; 0x8013c0 1ee4a: e0 92 c1 13 sts 0x13C1, r14 ; 0x8013c1 1ee4e: f0 92 c2 13 sts 0x13C2, r15 ; 0x8013c2 vec_x[1] = Ainv[1][0]; 1ee52: aa 96 adiw r28, 0x2a ; 42 1ee54: 8c ad ldd r24, Y+60 ; 0x3c 1ee56: 9d ad ldd r25, Y+61 ; 0x3d 1ee58: ae ad ldd r26, Y+62 ; 0x3e 1ee5a: bf ad ldd r27, Y+63 ; 0x3f 1ee5c: aa 97 sbiw r28, 0x2a ; 42 1ee5e: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 1ee62: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 1ee66: a0 93 c5 13 sts 0x13C5, r26 ; 0x8013c5 1ee6a: b0 93 c6 13 sts 0x13C6, r27 ; 0x8013c6 vec_y[0] = Ainv[0][1]; 1ee6e: a6 96 adiw r28, 0x26 ; 38 1ee70: 2c ad ldd r18, Y+60 ; 0x3c 1ee72: 3d ad ldd r19, Y+61 ; 0x3d 1ee74: 4e ad ldd r20, Y+62 ; 0x3e 1ee76: 5f ad ldd r21, Y+63 ; 0x3f 1ee78: a6 97 sbiw r28, 0x26 ; 38 1ee7a: 20 93 c7 13 sts 0x13C7, r18 ; 0x8013c7 1ee7e: 30 93 c8 13 sts 0x13C8, r19 ; 0x8013c8 1ee82: 40 93 c9 13 sts 0x13C9, r20 ; 0x8013c9 1ee86: 50 93 ca 13 sts 0x13CA, r21 ; 0x8013ca vec_y[1] = Ainv[1][1]; 1ee8a: 80 92 cb 13 sts 0x13CB, r8 ; 0x8013cb 1ee8e: 90 92 cc 13 sts 0x13CC, r9 ; 0x8013cc 1ee92: a0 92 cd 13 sts 0x13CD, r10 ; 0x8013cd 1ee96: b0 92 ce 13 sts 0x13CE, r11 ; 0x8013ce 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], 1ee9a: c7 01 movw r24, r14 1ee9c: b6 01 movw r22, r12 1ee9e: 90 58 subi r25, 0x80 ; 128 1eea0: a3 01 movw r20, r6 1eea2: 92 01 movw r18, r4 1eea4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1eea8: 6b 01 movw r12, r22 1eeaa: 7c 01 movw r14, r24 1eeac: a2 96 adiw r28, 0x22 ; 34 1eeae: 2c ad ldd r18, Y+60 ; 0x3c 1eeb0: 3d ad ldd r19, Y+61 ; 0x3d 1eeb2: 4e ad ldd r20, Y+62 ; 0x3e 1eeb4: 5f ad ldd r21, Y+63 ; 0x3f 1eeb6: a2 97 sbiw r28, 0x22 ; 34 1eeb8: a6 96 adiw r28, 0x26 ; 38 1eeba: 6c ad ldd r22, Y+60 ; 0x3c 1eebc: 7d ad ldd r23, Y+61 ; 0x3d 1eebe: 8e ad ldd r24, Y+62 ; 0x3e 1eec0: 9f ad ldd r25, Y+63 ; 0x3f 1eec2: a6 97 sbiw r28, 0x26 ; 38 1eec4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1eec8: 9b 01 movw r18, r22 1eeca: ac 01 movw r20, r24 1eecc: c7 01 movw r24, r14 1eece: b6 01 movw r22, r12 1eed0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__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]; 1eed4: 60 93 cf 13 sts 0x13CF, r22 ; 0x8013cf 1eed8: 70 93 d0 13 sts 0x13D0, r23 ; 0x8013d0 1eedc: 80 93 d1 13 sts 0x13D1, r24 ; 0x8013d1 1eee0: 90 93 d2 13 sts 0x13D2, r25 ; 0x8013d2 { 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] 1eee4: aa 96 adiw r28, 0x2a ; 42 1eee6: 6c ad ldd r22, Y+60 ; 0x3c 1eee8: 7d ad ldd r23, Y+61 ; 0x3d 1eeea: 8e ad ldd r24, Y+62 ; 0x3e 1eeec: 9f ad ldd r25, Y+63 ; 0x3f 1eeee: aa 97 sbiw r28, 0x2a ; 42 1eef0: 90 58 subi r25, 0x80 ; 128 1eef2: a3 01 movw r20, r6 1eef4: 92 01 movw r18, r4 1eef6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1eefa: 6b 01 movw r12, r22 1eefc: 7c 01 movw r14, r24 1eefe: a2 96 adiw r28, 0x22 ; 34 1ef00: 2c ad ldd r18, Y+60 ; 0x3c 1ef02: 3d ad ldd r19, Y+61 ; 0x3d 1ef04: 4e ad ldd r20, Y+62 ; 0x3e 1ef06: 5f ad ldd r21, Y+63 ; 0x3f 1ef08: a2 97 sbiw r28, 0x22 ; 34 1ef0a: c5 01 movw r24, r10 1ef0c: b4 01 movw r22, r8 1ef0e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1ef12: 9b 01 movw r18, r22 1ef14: ac 01 movw r20, r24 1ef16: c7 01 movw r24, r14 1ef18: b6 01 movw r22, r12 1ef1a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__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]; 1ef1e: 60 93 d3 13 sts 0x13D3, r22 ; 0x8013d3 1ef22: 70 93 d4 13 sts 0x13D4, r23 ; 0x8013d4 1ef26: 80 93 d5 13 sts 0x13D5, r24 ; 0x8013d5 1ef2a: 90 93 d6 13 sts 0x13D6, r25 ; 0x8013d6 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 1ef2e: 90 e0 ldi r25, 0x00 ; 0 1ef30: 80 e0 ldi r24, 0x00 ; 0 1ef32: 0e 94 7f 8e call 0x11cfe ; 0x11cfe if (result >= 0) { 1ef36: 17 fd sbrc r17, 7 1ef38: d5 c0 rjmp .+426 ; 0x1f0e4 DBG(_n("Calibration success.\n")); 1ef3a: 84 e5 ldi r24, 0x54 ; 84 1ef3c: 9e e6 ldi r25, 0x6E ; 110 1ef3e: 9f 93 push r25 1ef40: 8f 93 push r24 1ef42: 0f 94 4b dc call 0x3b896 ; 0x3b896 world2machine_update(vec_x, vec_y, cntr); 1ef46: 4f ec ldi r20, 0xCF ; 207 1ef48: 53 e1 ldi r21, 0x13 ; 19 1ef4a: 67 ec ldi r22, 0xC7 ; 199 1ef4c: 73 e1 ldi r23, 0x13 ; 19 1ef4e: 8f eb ldi r24, 0xBF ; 191 1ef50: 93 e1 ldi r25, 0x13 ; 19 1ef52: 0f 94 26 ca call 0x3944c ; 0x3944c #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); 1ef56: 48 e0 ldi r20, 0x08 ; 8 1ef58: 50 e0 ldi r21, 0x00 ; 0 1ef5a: 65 ee ldi r22, 0xE5 ; 229 1ef5c: 7f e0 ldi r23, 0x0F ; 15 1ef5e: 8f ec ldi r24, 0xCF ; 207 1ef60: 93 e1 ldi r25, 0x13 ; 19 1ef62: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 1ef66: 48 e0 ldi r20, 0x08 ; 8 1ef68: 50 e0 ldi r21, 0x00 ; 0 1ef6a: 6d ed ldi r22, 0xDD ; 221 1ef6c: 7f e0 ldi r23, 0x0F ; 15 1ef6e: 8f eb ldi r24, 0xBF ; 191 1ef70: 93 e1 ldi r25, 0x13 ; 19 1ef72: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 1ef76: 48 e0 ldi r20, 0x08 ; 8 1ef78: 50 e0 ldi r21, 0x00 ; 0 1ef7a: 65 ed ldi r22, 0xD5 ; 213 1ef7c: 7f e0 ldi r23, 0x0F ; 15 1ef7e: 87 ec ldi r24, 0xC7 ; 199 1ef80: 93 e1 ldi r25, 0x13 ; 19 1ef82: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 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(); 1ef86: 0f 94 ab c9 call 0x39356 ; 0x39356 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1ef8a: 0f 90 pop r0 1ef8c: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1ef8e: c7 55 subi r28, 0x57 ; 87 1ef90: df 4f sbci r29, 0xFF ; 255 1ef92: 88 81 ld r24, Y 1ef94: 99 81 ldd r25, Y+1 ; 0x01 1ef96: c9 5a subi r28, 0xA9 ; 169 1ef98: d0 40 sbci r29, 0x00 ; 0 1ef9a: 0e 94 7b 67 call 0xcef6 ; 0xcef6 // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1ef9e: 80 e0 ldi r24, 0x00 ; 0 1efa0: 90 e0 ldi r25, 0x00 ; 0 1efa2: a0 ea ldi r26, 0xA0 ; 160 1efa4: b0 e4 ldi r27, 0x40 ; 64 1efa6: 80 93 49 07 sts 0x0749, r24 ; 0x800749 1efaa: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 1efae: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 1efb2: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1efb6: 60 e0 ldi r22, 0x00 ; 0 1efb8: 70 e0 ldi r23, 0x00 ; 0 1efba: 80 ea ldi r24, 0xA0 ; 160 1efbc: 91 e4 ldi r25, 0x41 ; 65 1efbe: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 1efc2: 0f 94 24 59 call 0x2b248 ; 0x2b248 //#ifndef NEW_XYZCAL if (result >= 0) 1efc6: 17 fd sbrc r17, 7 1efc8: 22 c0 rjmp .+68 ; 0x1f00e 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; 1efca: 10 92 49 07 sts 0x0749, r1 ; 0x800749 1efce: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a 1efd2: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b 1efd6: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c destination[Z_AXIS] = 150.F; 1efda: 80 e0 ldi r24, 0x00 ; 0 1efdc: 90 e0 ldi r25, 0x00 ; 0 1efde: a6 e1 ldi r26, 0x16 ; 22 1efe0: b3 e4 ldi r27, 0x43 ; 67 1efe2: 80 93 5a 05 sts 0x055A, r24 ; 0x80055a 1efe6: 90 93 5b 05 sts 0x055B, r25 ; 0x80055b 1efea: a0 93 5c 05 sts 0x055C, r26 ; 0x80055c 1efee: b0 93 5d 05 sts 0x055D, r27 ; 0x80055d plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1eff2: 65 e5 ldi r22, 0x55 ; 85 1eff4: 75 e5 ldi r23, 0x55 ; 85 1eff6: 85 e5 ldi r24, 0x55 ; 85 1eff8: 91 e4 ldi r25, 0x41 ; 65 1effa: 0f 94 58 ba call 0x374b0 ; 0x374b0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1effe: 85 e6 ldi r24, 0x65 ; 101 1f000: 97 e4 ldi r25, 0x47 ; 71 1f002: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1f006: 0f 94 04 36 call 0x26c08 ; 0x26c08 // 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()) 1f00a: 0f 94 ba c7 call 0x38f74 ; 0x38f74 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1f00e: 81 e0 ldi r24, 0x01 ; 1 1f010: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_update(2); 1f014: 82 e0 ldi r24, 0x02 ; 2 1f016: 0e 94 54 6f call 0xdea8 ; 0xdea8 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)); 1f01a: 86 e2 ldi r24, 0x26 ; 38 1f01c: 97 e4 ldi r25, 0x47 ; 71 } void lcd_bed_calibration_show_result(BedSkewOffsetDetectionResultType result, uint8_t point_too_far_mask) { const char *msg = NULL; if (result == BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND) { 1f01e: 1f 3f cpi r17, 0xFF ; 255 1f020: 99 f0 breq .+38 ; 0x1f048 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) { 1f022: 1e 3f cpi r17, 0xFE ; 254 1f024: 09 f0 breq .+2 ; 0x1f028 1f026: 73 c0 rjmp .+230 ; 0x1f10e if (point_too_far_mask == 0) 1f028: af 96 adiw r28, 0x2f ; 47 1f02a: 4f ad ldd r20, Y+63 ; 0x3f 1f02c: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1f02e: 81 ef ldi r24, 0xF1 ; 241 1f030: 96 e4 ldi r25, 0x46 ; 70 { 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) 1f032: 44 23 and r20, r20 1f034: 49 f0 breq .+18 ; 0x1f048 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1f036: af 96 adiw r28, 0x2f ; 47 1f038: 5f ad ldd r21, Y+63 ; 0x3f 1f03a: 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); 1f03c: 8f ea ldi r24, 0xAF ; 175 1f03e: 96 e4 ldi r25, 0x46 ; 70 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) 1f040: 52 30 cpi r21, 0x02 ; 2 1f042: 11 f0 breq .+4 ; 0x1f048 // 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); 1f044: 88 e6 ldi r24, 0x68 ; 104 1f046: 96 e4 ldi r25, 0x46 ; 70 1f048: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1f04c: 0c 94 00 eb jmp 0x1d600 ; 0x1d600 (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]) : 1f050: f2 01 movw r30, r4 1f052: 25 81 ldd r18, Z+5 ; 0x05 1f054: 36 81 ldd r19, Z+6 ; 0x06 1f056: 47 81 ldd r20, Z+7 ; 0x07 1f058: 50 85 ldd r21, Z+8 ; 0x08 1f05a: c3 58 subi r28, 0x83 ; 131 1f05c: df 4f sbci r29, 0xFF ; 255 1f05e: 68 81 ld r22, Y 1f060: 79 81 ldd r23, Y+1 ; 0x01 1f062: 8a 81 ldd r24, Y+2 ; 0x02 1f064: 9b 81 ldd r25, Y+3 ; 0x03 1f066: cd 57 subi r28, 0x7D ; 125 1f068: d0 40 sbci r29, 0x00 ; 0 1f06a: 0c 94 62 ef jmp 0x1dec4 ; 0x1dec4 // 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]) : 1f06e: f2 01 movw r30, r4 1f070: 25 81 ldd r18, Z+5 ; 0x05 1f072: 36 81 ldd r19, Z+6 ; 0x06 1f074: 47 81 ldd r20, Z+7 ; 0x07 1f076: 50 85 ldd r21, Z+8 ; 0x08 1f078: ed 96 adiw r28, 0x3d ; 61 1f07a: 6c ad ldd r22, Y+60 ; 0x3c 1f07c: 7d ad ldd r23, Y+61 ; 0x3d 1f07e: 8e ad ldd r24, Y+62 ; 0x3e 1f080: 9f ad ldd r25, Y+63 ; 0x3f 1f082: ed 97 sbiw r28, 0x3d ; 61 1f084: b8 c0 rjmp .+368 ; 0x1f1f6 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1f086: f2 01 movw r30, r4 1f088: 25 81 ldd r18, Z+5 ; 0x05 1f08a: 36 81 ldd r19, Z+6 ; 0x06 1f08c: 47 81 ldd r20, Z+7 ; 0x07 1f08e: 50 85 ldd r21, Z+8 ; 0x08 1f090: ed 96 adiw r28, 0x3d ; 61 1f092: 6c ad ldd r22, Y+60 ; 0x3c 1f094: 7d ad ldd r23, Y+61 ; 0x3d 1f096: 8e ad ldd r24, Y+62 ; 0x3e 1f098: 9f ad ldd r25, Y+63 ; 0x3f 1f09a: ed 97 sbiw r28, 0x3d ; 61 1f09c: c6 c0 rjmp .+396 ; 0x1f22a 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]) : 1f09e: a3 01 movw r20, r6 1f0a0: 92 01 movw r18, r4 1f0a2: c3 58 subi r28, 0x83 ; 131 1f0a4: df 4f sbci r29, 0xFF ; 255 1f0a6: 68 81 ld r22, Y 1f0a8: 79 81 ldd r23, Y+1 ; 0x01 1f0aa: 8a 81 ldd r24, Y+2 ; 0x02 1f0ac: 9b 81 ldd r25, Y+3 ; 0x03 1f0ae: cd 57 subi r28, 0x7D ; 125 1f0b0: d0 40 sbci r29, 0x00 ; 0 1f0b2: 0c 94 ca ef jmp 0x1df94 ; 0x1df94 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1f0b6: 81 2c mov r8, r1 1f0b8: 91 2c mov r9, r1 1f0ba: 20 e8 ldi r18, 0x80 ; 128 1f0bc: a2 2e mov r10, r18 1f0be: 2f e3 ldi r18, 0x3F ; 63 1f0c0: b2 2e mov r11, r18 1f0c2: 0c 94 ce ef jmp 0x1df9c ; 0x1df9c float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1f0c6: c1 2c mov r12, r1 1f0c8: d1 2c mov r13, r1 1f0ca: 76 01 movw r14, r12 1f0cc: 0c 94 45 f0 jmp 0x1e08a ; 0x1e08a ((r == 1) ? 1.f : 1f0d0: c1 2c mov r12, r1 1f0d2: d1 2c mov r13, r1 1f0d4: 90 e8 ldi r25, 0x80 ; 128 1f0d6: e9 2e mov r14, r25 1f0d8: 9f e3 ldi r25, 0x3F ; 63 1f0da: f9 2e mov r15, r25 1f0dc: 0c 94 45 f0 jmp 0x1e08a ; 0x1e08a 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; 1f0e0: 12 e0 ldi r17, 0x02 ; 2 1f0e2: a7 cb rjmp .-2226 ; 0x1e832 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1f0e4: 1e 3f cpi r17, 0xFE ; 254 1f0e6: 89 f4 brne .+34 ; 0x1f10a 1f0e8: af 96 adiw r28, 0x2f ; 47 1f0ea: 3f ad ldd r19, Y+63 ; 0x3f 1f0ec: af 97 sbiw r28, 0x2f ; 47 1f0ee: 32 30 cpi r19, 0x02 ; 2 1f0f0: 09 f0 breq .+2 ; 0x1f0f4 1f0f2: 4d cf rjmp .-358 ; 0x1ef8e DBG(_n("Fitting failed => calibration failed.\n")); 1f0f4: 8d e2 ldi r24, 0x2D ; 45 1f0f6: 9e e6 ldi r25, 0x6E ; 110 1f0f8: 9f 93 push r25 1f0fa: 8f 93 push r24 1f0fc: 0f 94 4b dc call 0x3b896 ; 0x3b896 1f100: 44 cf rjmp .-376 ; 0x1ef8a // 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; 1f102: af 96 adiw r28, 0x2f ; 47 1f104: 1f ae std Y+63, r1 ; 0x3f 1f106: af 97 sbiw r28, 0x2f ; 47 1f108: 42 cf rjmp .-380 ; 0x1ef8e } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1f10a: 1f ef ldi r17, 0xFF ; 255 1f10c: 40 cf rjmp .-384 ; 0x1ef8e 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) { 1f10e: af 96 adiw r28, 0x2f ; 47 1f110: 6f ad ldd r22, Y+63 ; 0x3f 1f112: af 97 sbiw r28, 0x2f ; 47 1f114: 61 11 cpse r22, r1 1f116: 13 c0 rjmp .+38 ; 0x1f13e 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); 1f118: 8d e4 ldi r24, 0x4D ; 77 1f11a: 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) { 1f11c: 11 30 cpi r17, 0x01 ; 1 1f11e: 51 f0 breq .+20 ; 0x1f134 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); 1f120: 8a e0 ldi r24, 0x0A ; 10 1f122: 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) { 1f124: 12 30 cpi r17, 0x02 ; 2 1f126: 31 f0 breq .+12 ; 0x1f134 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1f128: 81 ef ldi r24, 0xF1 ; 241 1f12a: 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) { 1f12c: 11 11 cpse r17, r1 1f12e: 02 c0 rjmp .+4 ; 0x1f134 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); 1f130: 82 e9 ldi r24, 0x92 ; 146 1f132: 95 e4 ldi r25, 0x45 ; 69 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); 1f134: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 break; } lcd_show_fullscreen_message_and_wait_P(msg); 1f138: 0f 94 04 36 call 0x26c08 ; 0x26c08 1f13c: 0d c0 rjmp .+26 ; 0x1f158 // 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) 1f13e: af 96 adiw r28, 0x2f ; 47 1f140: 8f ad ldd r24, Y+63 ; 0x3f 1f142: af 97 sbiw r28, 0x2f ; 47 1f144: 82 30 cpi r24, 0x02 ; 2 1f146: f1 f4 brne .+60 ; 0x1f184 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1f148: 81 e2 ldi r24, 0x21 ; 33 1f14a: 96 e4 ldi r25, 0x46 ; 70 else if ((point_too_far_mask & 1) == 0) // The right and maybe the center point out of reach. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR); 1f14c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 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); 1f150: 0f 94 04 36 call 0x26c08 ; 0x26c08 } if (point_too_far_mask == 0 || result > 0) { 1f154: 11 16 cp r1, r17 1f156: 04 f3 brlt .-64 ; 0x1f118 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1f158: 1f 3f cpi r17, 0xFF ; 255 1f15a: 11 f4 brne .+4 ; 0x1f160 1f15c: 0c 94 09 e8 jmp 0x1d012 ; 0x1d012 { // 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); 1f160: 86 e0 ldi r24, 0x06 ; 6 1f162: 0e 94 5e e7 call 0x1cebc ; 0x1cebc if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1f166: 8f e5 ldi r24, 0x5F ; 95 1f168: 9f e0 ldi r25, 0x0F ; 15 1f16a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1f16e: 81 11 cpse r24, r1 1f170: 0c 94 1a eb jmp 0x1d634 ; 0x1d634 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1f174: 8c e8 ldi r24, 0x8C ; 140 1f176: 97 e4 ldi r25, 0x47 ; 71 1f178: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1f17c: 0f 94 04 36 call 0x26c08 ; 0x26c08 1f180: 0c 94 1a eb jmp 0x1d634 ; 0x1d634 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); 1f184: 85 ed ldi r24, 0xD5 ; 213 1f186: 95 e4 ldi r25, 0x45 ; 69 1f188: e1 cf rjmp .-62 ; 0x1f14c 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)) 1f18a: 89 81 ldd r24, Y+1 ; 0x01 1f18c: 9a 81 ldd r25, Y+2 ; 0x02 1f18e: 80 37 cpi r24, 0x70 ; 112 1f190: 98 40 sbci r25, 0x08 ; 8 1f192: 10 f0 brcs .+4 ; 0x1f198 1f194: 0c 94 59 eb jmp 0x1d6b2 ; 0x1d6b2 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1f198: ae 01 movw r20, r28 1f19a: 4f 5f subi r20, 0xFF ; 255 1f19c: 5f 4f sbci r21, 0xFF ; 255 1f19e: 7a 01 movw r14, r20 1f1a0: 04 eb ldi r16, 0xB4 ; 180 1f1a2: 10 e0 ldi r17, 0x00 ; 0 1f1a4: 24 e8 ldi r18, 0x84 ; 132 1f1a6: 33 e0 ldi r19, 0x03 ; 3 1f1a8: a6 01 movw r20, r12 1f1aa: 48 5c subi r20, 0xC8 ; 200 1f1ac: 51 09 sbc r21, r1 1f1ae: 69 2d mov r22, r9 1f1b0: 78 2d mov r23, r8 1f1b2: 8b 2d mov r24, r11 1f1b4: 9a 2d mov r25, r10 1f1b6: 0f 94 0f 95 call 0x32a1e ; 0x32a1e 1f1ba: 88 23 and r24, r24 1f1bc: 11 f4 brne .+4 ; 0x1f1c2 1f1be: 0c 94 59 eb jmp 0x1d6b2 ; 0x1d6b2 ad += 1440; 1f1c2: 89 81 ldd r24, Y+1 ; 0x01 1f1c4: 9a 81 ldd r25, Y+2 ; 0x02 1f1c6: 80 56 subi r24, 0x60 ; 96 1f1c8: 9a 4f sbci r25, 0xFA ; 250 1f1ca: 0c 94 e3 e9 jmp 0x1d3c6 ; 0x1d3c6 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) { 1f1ce: 00 23 and r16, r16 1f1d0: 11 f4 brne .+4 ; 0x1f1d6 1f1d2: 0c 94 75 ef jmp 0x1deea ; 0x1deea float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1f1d6: 02 30 cpi r16, 0x02 ; 2 1f1d8: 09 f0 breq .+2 ; 0x1f1dc 1f1da: 49 cf rjmp .-366 ; 0x1f06e 1f1dc: d2 01 movw r26, r4 1f1de: 11 96 adiw r26, 0x01 ; 1 1f1e0: 2d 91 ld r18, X+ 1f1e2: 3d 91 ld r19, X+ 1f1e4: 4d 91 ld r20, X+ 1f1e6: 5c 91 ld r21, X 1f1e8: 14 97 sbiw r26, 0x04 ; 4 1f1ea: 6e 96 adiw r28, 0x1e ; 30 1f1ec: 6c ad ldd r22, Y+60 ; 0x3c 1f1ee: 7d ad ldd r23, Y+61 ; 0x3d 1f1f0: 8e ad ldd r24, Y+62 ; 0x3e 1f1f2: 9f ad ldd r25, Y+63 ; 0x3f 1f1f4: 6e 97 sbiw r28, 0x1e ; 30 1f1f6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1f1fa: 4b 01 movw r8, r22 1f1fc: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1f1fe: 60 e0 ldi r22, 0x00 ; 0 1f200: 70 e0 ldi r23, 0x00 ; 0 1f202: 80 e8 ldi r24, 0x80 ; 128 1f204: 9f e3 ldi r25, 0x3F ; 63 1f206: 11 30 cpi r17, 0x01 ; 1 1f208: 91 f0 breq .+36 ; 0x1f22e ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1f20a: 12 30 cpi r17, 0x02 ; 2 1f20c: 09 f0 breq .+2 ; 0x1f210 1f20e: 3b cf rjmp .-394 ; 0x1f086 1f210: d2 01 movw r26, r4 1f212: 11 96 adiw r26, 0x01 ; 1 1f214: 2d 91 ld r18, X+ 1f216: 3d 91 ld r19, X+ 1f218: 4d 91 ld r20, X+ 1f21a: 5c 91 ld r21, X 1f21c: 14 97 sbiw r26, 0x04 ; 4 1f21e: 6e 96 adiw r28, 0x1e ; 30 1f220: 6c ad ldd r22, Y+60 ; 0x3c 1f222: 7d ad ldd r23, Y+61 ; 0x3d 1f224: 8e ad ldd r24, Y+62 ; 0x3e 1f226: 9f ad ldd r25, Y+63 ; 0x3f 1f228: 6e 97 sbiw r28, 0x1e ; 30 1f22a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1f22e: 9b 01 movw r18, r22 1f230: ac 01 movw r20, r24 1f232: c5 01 movw r24, r10 1f234: b4 01 movw r22, r8 1f236: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 1f23a: 9b 01 movw r18, r22 1f23c: ac 01 movw r20, r24 1f23e: c7 01 movw r24, r14 1f240: b6 01 movw r22, r12 1f242: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 1f246: 6b 01 movw r12, r22 1f248: 7c 01 movw r14, r24 1f24a: 0c 94 75 ef jmp 0x1deea ; 0x1deea // 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 : 1f24e: 81 2c mov r8, r1 1f250: 91 2c mov r9, r1 1f252: 50 e8 ldi r21, 0x80 ; 128 1f254: a5 2e mov r10, r21 1f256: 5f e3 ldi r21, 0x3F ; 63 1f258: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1f25a: 11 11 cpse r17, r1 1f25c: 0c 94 4f ef jmp 0x1de9e ; 0x1de9e ((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; 1f260: 20 e0 ldi r18, 0x00 ; 0 1f262: 30 e0 ldi r19, 0x00 ; 0 1f264: 40 e8 ldi r20, 0x80 ; 128 1f266: 5f e3 ldi r21, 0x3F ; 63 1f268: ea cf rjmp .-44 ; 0x1f23e } // 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) { 1f26a: 11 11 cpse r17, r1 1f26c: b4 cf rjmp .-152 ; 0x1f1d6 1f26e: 0c 94 75 ef jmp 0x1deea ; 0x1deea float a = (r == 1) ? 1.f : 1f272: 81 2c mov r8, r1 1f274: 91 2c mov r9, r1 1f276: 40 e8 ldi r20, 0x80 ; 128 1f278: a4 2e mov r10, r20 1f27a: 4f e3 ldi r20, 0x3F ; 63 1f27c: 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) { 1f27e: 11 11 cpse r17, r1 1f280: be cf rjmp .-132 ; 0x1f1fe 1f282: 0c 94 75 ef jmp 0x1deea ; 0x1deea 0001f286 : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1f286: cf 93 push r28 1f288: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1f28a: 86 ea ldi r24, 0xA6 ; 166 1f28c: 9c e0 ldi r25, 0x0C ; 12 1f28e: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 return ((status & components) == components); 1f292: 98 2f mov r25, r24 1f294: 9c 23 and r25, r28 1f296: 81 e0 ldi r24, 0x01 ; 1 1f298: 9c 13 cpse r25, r28 1f29a: 80 e0 ldi r24, 0x00 ; 0 } 1f29c: cf 91 pop r28 1f29e: 08 95 ret 0001f2a0 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1f2a0: 0f 93 push r16 1f2a2: 1f 93 push r17 1f2a4: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1f2a6: 0e 94 5a d0 call 0x1a0b4 ; 0x1a0b4 if (*str != '.') 1f2aa: fc 01 movw r30, r24 1f2ac: 20 81 ld r18, Z 1f2ae: 2e 32 cpi r18, 0x2E ; 46 1f2b0: 11 f0 breq .+4 ; 0x1f2b6 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 1f2b2: 80 e0 ldi r24, 0x00 ; 0 1f2b4: 34 c0 rjmp .+104 ; 0x1f31e // 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); 1f2b6: b8 01 movw r22, r16 1f2b8: 6e 5f subi r22, 0xFE ; 254 1f2ba: 7f 4f sbci r23, 0xFF ; 255 1f2bc: 01 96 adiw r24, 0x01 ; 1 1f2be: 0e 94 5a d0 call 0x1a0b4 ; 0x1a0b4 if (*str != '.') 1f2c2: fc 01 movw r30, r24 1f2c4: 20 81 ld r18, Z 1f2c6: 2e 32 cpi r18, 0x2E ; 46 1f2c8: a1 f7 brne .-24 ; 0x1f2b2 return false; ++str; } str = Number(str, version + 2); 1f2ca: b8 01 movw r22, r16 1f2cc: 6c 5f subi r22, 0xFC ; 252 1f2ce: 7f 4f sbci r23, 0xFF ; 255 1f2d0: 01 96 adiw r24, 0x01 ; 1 1f2d2: 0e 94 5a d0 call 0x1a0b4 ; 0x1a0b4 version[3] = FIRMWARE_REVISION_RELEASED; 1f2d6: 20 e4 ldi r18, 0x40 ; 64 1f2d8: 30 e0 ldi r19, 0x00 ; 0 1f2da: f8 01 movw r30, r16 1f2dc: 37 83 std Z+7, r19 ; 0x07 1f2de: 26 83 std Z+6, r18 ; 0x06 1f2e0: fc 01 movw r30, r24 1f2e2: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1f2e4: 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'; 1f2e6: 89 2f mov r24, r25 1f2e8: 8f 7d andi r24, 0xDF ; 223 1f2ea: c1 f1 breq .+112 ; 0x1f35c 1f2ec: 87 ef ldi r24, 0xF7 ; 247 1f2ee: 89 0f add r24, r25 1f2f0: 82 30 cpi r24, 0x02 ; 2 1f2f2: a0 f1 brcs .+104 ; 0x1f35c 1f2f4: 9d 30 cpi r25, 0x0D ; 13 1f2f6: 91 f1 breq .+100 ; 0x1f35c 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 == '-'){ 1f2f8: 9d 32 cpi r25, 0x2D ; 45 1f2fa: 99 f7 brne .-26 ; 0x1f2e2 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f2fc: 11 96 adiw r26, 0x01 ; 1 1f2fe: 9c 91 ld r25, X 1f300: 92 34 cpi r25, 0x42 ; 66 1f302: e1 f0 breq .+56 ; 0x1f33c 1f304: 7c f4 brge .+30 ; 0x1f324 1f306: 91 34 cpi r25, 0x41 ; 65 1f308: a1 f6 brne .-88 ; 0x1f2b2 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); 1f30a: 0a 5f subi r16, 0xFA ; 250 1f30c: 1f 4f sbci r17, 0xFF ; 255 1f30e: 28 e0 ldi r18, 0x08 ; 8 1f310: 30 e0 ldi r19, 0x00 ; 0 1f312: 45 e0 ldi r20, 0x05 ; 5 1f314: 68 e5 ldi r22, 0x58 ; 88 1f316: 7d e8 ldi r23, 0x8D ; 141 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); 1f318: cf 01 movw r24, r30 1f31a: 0e 94 2f d2 call 0x1a45e ; 0x1a45e // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1f31e: 1f 91 pop r17 1f320: 0f 91 pop r16 1f322: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f324: 94 34 cpi r25, 0x44 ; 68 1f326: 91 f0 breq .+36 ; 0x1f34c 1f328: 92 35 cpi r25, 0x52 ; 82 1f32a: 19 f6 brne .-122 ; 0x1f2b2 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); 1f32c: 0a 5f subi r16, 0xFA ; 250 1f32e: 1f 4f sbci r17, 0xFF ; 255 1f330: 20 e2 ldi r18, 0x20 ; 32 1f332: 30 e0 ldi r19, 0x00 ; 0 1f334: 42 e0 ldi r20, 0x02 ; 2 1f336: 6c e4 ldi r22, 0x4C ; 76 1f338: 7d e8 ldi r23, 0x8D ; 141 1f33a: ee cf rjmp .-36 ; 0x1f318 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); 1f33c: 0a 5f subi r16, 0xFA ; 250 1f33e: 1f 4f sbci r17, 0xFF ; 255 1f340: 20 e1 ldi r18, 0x10 ; 16 1f342: 30 e0 ldi r19, 0x00 ; 0 1f344: 44 e0 ldi r20, 0x04 ; 4 1f346: 63 e5 ldi r22, 0x53 ; 83 1f348: 7d e8 ldi r23, 0x8D ; 141 1f34a: e6 cf rjmp .-52 ; 0x1f318 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); 1f34c: 0a 5f subi r16, 0xFA ; 250 1f34e: 1f 4f sbci r17, 0xFF ; 255 1f350: 30 e0 ldi r19, 0x00 ; 0 1f352: 20 e0 ldi r18, 0x00 ; 0 1f354: 43 e0 ldi r20, 0x03 ; 3 1f356: 6f e4 ldi r22, 0x4F ; 79 1f358: 7d e8 ldi r23, 0x8D ; 141 1f35a: de cf rjmp .-68 ; 0x1f318 // 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; 1f35c: 81 e0 ldi r24, 0x01 ; 1 1f35e: df cf rjmp .-66 ; 0x1f31e 0001f360 : 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)) { 1f360: 0f 93 push r16 1f362: 1f 93 push r17 1f364: cf 93 push r28 1f366: df 93 push r29 1f368: eb 01 movw r28, r22 1f36a: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1f36c: 81 30 cpi r24, 0x01 ; 1 1f36e: 81 f0 breq .+32 ; 0x1f390 1f370: 82 30 cpi r24, 0x02 ; 2 1f372: 89 f0 breq .+34 ; 0x1f396 case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1f374: 80 e3 ldi r24, 0x30 ; 48 1f376: 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); 1f378: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 1f37c: 22 e0 ldi r18, 0x02 ; 2 1f37e: a8 01 movw r20, r16 1f380: bc 01 movw r22, r24 1f382: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1f384: df 91 pop r29 1f386: cf 91 pop r28 1f388: 1f 91 pop r17 1f38a: 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); 1f38c: 0d 94 97 d0 jmp 0x3a12e ; 0x3a12e 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); 1f390: 89 e2 ldi r24, 0x29 ; 41 1f392: 90 e4 ldi r25, 0x40 ; 64 1f394: f1 cf rjmp .-30 ; 0x1f378 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1f396: 80 e2 ldi r24, 0x20 ; 32 1f398: 90 e4 ldi r25, 0x40 ; 64 1f39a: ee cf rjmp .-36 ; 0x1f378 0001f39c : /// (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 ) 1f39c: 84 e0 ldi r24, 0x04 ; 4 1f39e: 9d e0 ldi r25, 0x0D ; 13 1f3a0: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1f3a4: 8a 32 cpi r24, 0x2A ; 42 1f3a6: 39 f4 brne .+14 ; 0x1f3b6 1f3a8: 8a e2 ldi r24, 0x2A ; 42 1f3aa: 9d e0 ldi r25, 0x0D ; 13 1f3ac: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1f3b0: 91 e0 ldi r25, 0x01 ; 1 1f3b2: 81 30 cpi r24, 0x01 ; 1 1f3b4: 09 f0 breq .+2 ; 0x1f3b8 1f3b6: 90 e0 ldi r25, 0x00 ; 0 } 1f3b8: 89 2f mov r24, r25 1f3ba: 08 95 ret 0001f3bc
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f3bc: cf 93 push r28 1f3be: df 93 push r29 1f3c0: cd b7 in r28, 0x3d ; 61 1f3c2: de b7 in r29, 0x3e ; 62 1f3c4: 67 97 sbiw r28, 0x17 ; 23 1f3c6: 0f b6 in r0, 0x3f ; 63 1f3c8: f8 94 cli 1f3ca: de bf out 0x3e, r29 ; 62 1f3cc: 0f be out 0x3f, r0 ; 63 1f3ce: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f3d0: 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); 1f3d2: 84 b5 in r24, 0x24 ; 36 1f3d4: 82 60 ori r24, 0x02 ; 2 1f3d6: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f3d8: 84 b5 in r24, 0x24 ; 36 1f3da: 81 60 ori r24, 0x01 ; 1 1f3dc: 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); 1f3de: 85 b5 in r24, 0x25 ; 37 1f3e0: 82 60 ori r24, 0x02 ; 2 1f3e2: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f3e4: 85 b5 in r24, 0x25 ; 37 1f3e6: 81 60 ori r24, 0x01 ; 1 1f3e8: 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); 1f3ea: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f3ee: 81 60 ori r24, 0x01 ; 1 1f3f0: 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; 1f3f4: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f3f8: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f3fc: 82 60 ori r24, 0x02 ; 2 1f3fe: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f402: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f406: 81 60 ori r24, 0x01 ; 1 1f408: 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); 1f40c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f410: 81 60 ori r24, 0x01 ; 1 1f412: 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); 1f416: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f41a: 84 60 ori r24, 0x04 ; 4 1f41c: 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); 1f420: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f424: 81 60 ori r24, 0x01 ; 1 1f426: 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 1f42a: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f42e: 82 60 ori r24, 0x02 ; 2 1f430: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f434: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f438: 81 60 ori r24, 0x01 ; 1 1f43a: 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 1f43e: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f442: 81 60 ori r24, 0x01 ; 1 1f444: 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 1f448: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f44c: 82 60 ori r24, 0x02 ; 2 1f44e: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f452: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f456: 81 60 ori r24, 0x01 ; 1 1f458: 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 1f45c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f460: 81 60 ori r24, 0x01 ; 1 1f462: 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 1f466: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f46a: 82 60 ori r24, 0x02 ; 2 1f46c: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f470: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f474: 81 60 ori r24, 0x01 ; 1 1f476: 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 1f47a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f47e: 81 60 ori r24, 0x01 ; 1 1f480: 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); 1f484: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f488: 84 60 ori r24, 0x04 ; 4 1f48a: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f48e: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f492: 82 60 ori r24, 0x02 ; 2 1f494: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f498: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f49c: 81 60 ori r24, 0x01 ; 1 1f49e: 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); 1f4a2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f4a6: 80 68 ori r24, 0x80 ; 128 1f4a8: 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; 1f4ac: 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) { 1f4b0: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f4b2: f8 94 cli wdt_reset(); 1f4b4: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f4b6: 84 b7 in r24, 0x34 ; 52 1f4b8: 87 7f andi r24, 0xF7 ; 247 1f4ba: 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" ); 1f4bc: 0f b6 in r0, 0x3f ; 63 1f4be: f8 94 cli 1f4c0: a8 95 wdr 1f4c2: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f4c6: 88 61 ori r24, 0x18 ; 24 1f4c8: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f4cc: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f4d0: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f4d2: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f4d4: 9f b7 in r25, 0x3f ; 63 1f4d6: 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 1f4d8: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f4dc: 84 e0 ldi r24, 0x04 ; 4 1f4de: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f4e6: 81 60 ori r24, 0x01 ; 1 1f4e8: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f4f0: 8d 7f andi r24, 0xFD ; 253 1f4f2: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f4fa: 8b 7f andi r24, 0xFB ; 251 1f4fc: 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; 1f500: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f504: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f506: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f508: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f50a: 6a e0 ldi r22, 0x0A ; 10 1f50c: 70 e0 ldi r23, 0x00 ; 0 1f50e: 80 e0 ldi r24, 0x00 ; 0 1f510: 90 e0 ldi r25, 0x00 ; 0 1f512: 0f 94 8a 3d call 0x27b14 ; 0x27b14 backlightSupport = !READ(LCD_BL_PIN); 1f516: 9c b1 in r25, 0x0c ; 12 1f518: 81 e0 ldi r24, 0x01 ; 1 1f51a: 29 2f mov r18, r25 1f51c: 28 70 andi r18, 0x08 ; 8 1f51e: 93 fd sbrc r25, 3 1f520: 80 e0 ldi r24, 0x00 ; 0 1f522: 80 93 fc 03 sts 0x03FC, r24 ; 0x8003fc if (!backlightSupport) return; 1f526: 21 11 cpse r18, r1 1f528: 22 c0 rjmp .+68 ; 0x1f56e //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f52a: 62 e0 ldi r22, 0x02 ; 2 1f52c: 82 e3 ldi r24, 0x32 ; 50 1f52e: 9d e0 ldi r25, 0x0D ; 13 1f530: 0e 94 8c 77 call 0xef18 ; 0xef18 1f534: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, LCD_BACKLIGHT_LEVEL_HIGH); 1f538: 62 e8 ldi r22, 0x82 ; 130 1f53a: 84 e3 ldi r24, 0x34 ; 52 1f53c: 9d e0 ldi r25, 0x0D ; 13 1f53e: 0e 94 8c 77 call 0xef18 ; 0xef18 1f542: 80 93 fb 03 sts 0x03FB, r24 ; 0x8003fb backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, LCD_BACKLIGHT_LEVEL_LOW); 1f546: 62 e3 ldi r22, 0x32 ; 50 1f548: 83 e3 ldi r24, 0x33 ; 51 1f54a: 9d e0 ldi r25, 0x0D ; 13 1f54c: 0e 94 8c 77 call 0xef18 ; 0xef18 1f550: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT); // in seconds 1f554: 6f e0 ldi r22, 0x0F ; 15 1f556: 70 e0 ldi r23, 0x00 ; 0 1f558: 80 e3 ldi r24, 0x30 ; 48 1f55a: 9d e0 ldi r25, 0x0D ; 13 1f55c: 0e 94 74 77 call 0xeee8 ; 0xeee8 1f560: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f564: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f568: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f56a: 0e 94 8d 8b call 0x1171a ; 0x1171a return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f56e: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f570: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f572: 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); 1f574: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f576: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f578: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f57c: 80 68 ori r24, 0x80 ; 128 1f57e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f582: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f584: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL19lcd_displayfunction.lto_priv.570> 1f588: 88 60 ori r24, 0x08 ; 8 1f58a: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b <_ZL19lcd_displayfunction.lto_priv.570> 1f58e: 2f ef ldi r18, 0xFF ; 255 1f590: 30 e7 ldi r19, 0x70 ; 112 1f592: 82 e0 ldi r24, 0x02 ; 2 1f594: 21 50 subi r18, 0x01 ; 1 1f596: 30 40 sbci r19, 0x00 ; 0 1f598: 80 40 sbci r24, 0x00 ; 0 1f59a: e1 f7 brne .-8 ; 0x1f594 1f59c: 00 c0 rjmp .+0 ; 0x1f59e 1f59e: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f5a0: 81 e0 ldi r24, 0x01 ; 1 1f5a2: 0e 94 f8 6f call 0xdff0 ; 0xdff0 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f5a6: 80 ea ldi r24, 0xA0 ; 160 1f5a8: 91 e7 ldi r25, 0x71 ; 113 1f5aa: 90 93 06 04 sts 0x0406, r25 ; 0x800406 <_lcdout+0x9> 1f5ae: 80 93 05 04 sts 0x0405, r24 ; 0x800405 <_lcdout+0x8> 1f5b2: 10 92 08 04 sts 0x0408, r1 ; 0x800408 <_lcdout+0xb> 1f5b6: 10 92 07 04 sts 0x0407, r1 ; 0x800407 <_lcdout+0xa> 1f5ba: 12 e0 ldi r17, 0x02 ; 2 1f5bc: 10 93 00 04 sts 0x0400, r17 ; 0x800400 <_lcdout+0x3> 1f5c0: 10 92 0a 04 sts 0x040A, r1 ; 0x80040a <_lcdout+0xd> 1f5c4: 10 92 09 04 sts 0x0409, r1 ; 0x800409 <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f5c8: 0e 94 39 70 call 0xe072 ; 0xe072 lcd_longpress_func = menu_lcd_longpress_func; 1f5cc: 82 e3 ldi r24, 0x32 ; 50 1f5ce: 93 ed ldi r25, 0xD3 ; 211 1f5d0: 90 93 10 04 sts 0x0410, r25 ; 0x800410 1f5d4: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f5d8: 81 ec ldi r24, 0xC1 ; 193 1f5da: 9a e3 ldi r25, 0x3A ; 58 1f5dc: 90 93 0e 04 sts 0x040E, r25 ; 0x80040e 1f5e0: 80 93 0d 04 sts 0x040D, r24 ; 0x80040d menu_menu = lcd_status_screen; 1f5e4: 8b e3 ldi r24, 0x3B ; 59 1f5e6: 9a e3 ldi r25, 0x3A ; 58 1f5e8: 90 93 68 0e sts 0x0E68, r25 ; 0x800e68 1f5ec: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 SET_INPUT(BTN_EN1); 1f5f0: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f5f4: 8b 7f andi r24, 0xFB ; 251 1f5f6: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f5fa: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f5fe: 8d 7f andi r24, 0xFD ; 253 1f600: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f604: 9f b7 in r25, 0x3f ; 63 1f606: f8 94 cli 1f608: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f60c: 84 60 ori r24, 0x04 ; 4 1f60e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f612: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f614: 9f b7 in r25, 0x3f ; 63 1f616: f8 94 cli 1f618: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f61c: 82 60 ori r24, 0x02 ; 2 1f61e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f622: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f624: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f628: 8f 7b andi r24, 0xBF ; 191 1f62a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f62e: 9f b7 in r25, 0x3f ; 63 1f630: f8 94 cli 1f632: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f636: 80 64 ori r24, 0x40 ; 64 1f638: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f63c: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f63e: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f642: 8e 7f andi r24, 0xFE ; 254 1f644: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f648: 9f b7 in r25, 0x3f ; 63 1f64a: f8 94 cli 1f64c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f650: 81 60 ori r24, 0x01 ; 1 1f652: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f656: 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); 1f658: af e9 ldi r26, 0x9F ; 159 1f65a: bf e0 ldi r27, 0x0F ; 15 1f65c: 11 97 sbiw r26, 0x01 ; 1 1f65e: f1 f7 brne .-4 ; 0x1f65c 1f660: 00 c0 rjmp .+0 ; 0x1f662 1f662: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f664: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f668: 80 95 com r24 1f66a: 81 70 andi r24, 0x01 ; 1 1f66c: 80 93 0c 04 sts 0x040C, r24 ; 0x80040c #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f670: 44 e1 ldi r20, 0x14 ; 20 1f672: 50 e0 ldi r21, 0x00 ; 0 1f674: 6a e6 ldi r22, 0x6A ; 106 1f676: 70 e7 ldi r23, 0x70 ; 112 1f678: 88 e3 ldi r24, 0x38 ; 56 1f67a: 95 e0 ldi r25, 0x05 ; 5 1f67c: 0f 94 76 db call 0x3b6ec ; 0x3b6ec timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f680: 0f 94 48 c0 call 0x38090 ; 0x38090 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f684: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f688: 8e ea ldi r24, 0xAE ; 174 1f68a: 9e e8 ldi r25, 0x8E ; 142 1f68c: 9f 93 push r25 1f68e: 8f 93 push r24 1f690: 85 eb ldi r24, 0xB5 ; 181 1f692: 9e e8 ldi r25, 0x8E ; 142 1f694: 9f 93 push r25 1f696: 8f 93 push r24 1f698: 0e 94 66 6f call 0xdecc ; 0xdecc static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f69c: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f6a0: 84 60 ori r24, 0x04 ; 4 1f6a2: 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)); 1f6a6: 60 e0 ldi r22, 0x00 ; 0 1f6a8: 87 ed ldi r24, 0xD7 ; 215 1f6aa: 9e e0 ldi r25, 0x0E ; 14 1f6ac: 0e 94 8c 77 call 0xef18 ; 0xef18 1f6b0: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1f6b4: 60 e0 ldi r22, 0x00 ; 0 1f6b6: 88 e0 ldi r24, 0x08 ; 8 1f6b8: 9f e0 ldi r25, 0x0F ; 15 1f6ba: 0e 94 8c 77 call 0xef18 ; 0xef18 1f6be: 80 93 1f 05 sts 0x051F, r24 ; 0x80051f MYSERIAL.begin(BAUDRATE); 1f6c2: 0e 94 79 db call 0x1b6f2 ; 0x1b6f2 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f6c6: 8e ec ldi r24, 0xCE ; 206 1f6c8: 98 e7 ldi r25, 0x78 ; 120 1f6ca: 90 93 07 05 sts 0x0507, r25 ; 0x800507 <_uartout+0x9> 1f6ce: 80 93 06 05 sts 0x0506, r24 ; 0x800506 <_uartout+0x8> 1f6d2: 10 92 09 05 sts 0x0509, r1 ; 0x800509 <_uartout+0xb> 1f6d6: 10 92 08 05 sts 0x0508, r1 ; 0x800508 <_uartout+0xa> 1f6da: 10 93 01 05 sts 0x0501, r17 ; 0x800501 <_uartout+0x3> 1f6de: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_uartout+0xd> 1f6e2: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_uartout+0xc> stdout = uartout; 1f6e6: 8e ef ldi r24, 0xFE ; 254 1f6e8: 94 e0 ldi r25, 0x04 ; 4 1f6ea: 90 93 14 18 sts 0x1814, r25 ; 0x801814 <__iob+0x3> 1f6ee: 80 93 13 18 sts 0x1813, r24 ; 0x801813 <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1f6f2: 0e 94 8e e4 call 0x1c91c ; 0x1c91c 1f6f6: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1f6f8: 0f 90 pop r0 1f6fa: 0f 90 pop r0 1f6fc: 0f 90 pop r0 1f6fe: 0f 90 pop r0 1f700: 8e 01 movw r16, r28 1f702: 0f 5f subi r16, 0xFF ; 255 1f704: 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; 1f706: aa 24 eor r10, r10 1f708: a3 94 inc r10 if (xflash_success) 1f70a: 88 23 and r24, r24 1f70c: 09 f4 brne .+2 ; 0x1f710 1f70e: d8 c0 rjmp .+432 ; 0x1f8c0 { optiboot_status = optiboot_xflash_enter(); 1f710: 0f 94 56 c0 call 0x380ac ; 0x380ac 1f714: 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)) 1f716: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e5> 1f71a: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e6> 1f71e: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e7> 1f722: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e8> 1f726: 8a 3a cpi r24, 0xAA ; 170 1f728: 95 45 sbci r25, 0x55 ; 85 1f72a: aa 4a sbci r26, 0xAA ; 170 1f72c: b5 45 sbci r27, 0x55 ; 85 1f72e: 09 f0 breq .+2 ; 0x1f732 1f730: bf c0 rjmp .+382 ; 0x1f8b0 1f732: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e4> 1f736: 87 ff sbrs r24, 7 1f738: bb c0 rjmp .+374 ; 0x1f8b0 { uint8_t lang = boot_reserved >> 3; 1f73a: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7e3> 1f73e: 98 2c mov r9, r8 1f740: 96 94 lsr r9 1f742: 96 94 lsr r9 1f744: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1f746: f8 2d mov r31, r8 1f748: f7 70 andi r31, 0x07 ; 7 1f74a: 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 1f74c: 99 20 and r9, r9 1f74e: 09 f4 brne .+2 ; 0x1f752 1f750: af c0 rjmp .+350 ; 0x1f8b0 #ifdef XFLASH if (lang == LANG_ID_SEC) 1f752: 21 e0 ldi r18, 0x01 ; 1 1f754: 92 12 cpse r9, r18 1f756: 24 c0 rjmp .+72 ; 0x1f7a0 { 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 1f758: 40 e1 ldi r20, 0x10 ; 16 1f75a: 50 e0 ldi r21, 0x00 ; 0 1f75c: 60 e0 ldi r22, 0x00 ; 0 1f75e: 71 e0 ldi r23, 0x01 ; 1 1f760: c8 01 movw r24, r16 1f762: 0f 94 23 db call 0x3b646 ; 0x3b646 if (offset) *offset = ui; 1f766: 60 e0 ldi r22, 0x00 ; 0 1f768: 71 e0 ldi r23, 0x01 ; 1 1f76a: 6b 01 movw r12, r22 1f76c: f1 2c mov r15, r1 1f76e: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 1f770: 89 81 ldd r24, Y+1 ; 0x01 1f772: 9a 81 ldd r25, Y+2 ; 0x02 1f774: ab 81 ldd r26, Y+3 ; 0x03 1f776: bc 81 ldd r27, Y+4 ; 0x04 1f778: 85 3a cpi r24, 0xA5 ; 165 1f77a: 9a 45 sbci r25, 0x5A ; 90 1f77c: a4 4b sbci r26, 0xB4 ; 180 1f77e: bb 44 sbci r27, 0x4B ; 75 1f780: 09 f0 breq .+2 ; 0x1f784 1f782: 96 c0 rjmp .+300 ; 0x1f8b0 { lcd_puts_at_P(1,0,PSTR("Language update")); 1f784: 43 ee ldi r20, 0xE3 ; 227 1f786: 5e e8 ldi r21, 0x8E ; 142 1f788: 60 e0 ldi r22, 0x00 ; 0 1f78a: 81 e0 ldi r24, 0x01 ; 1 1f78c: 0e 94 a1 6f call 0xdf42 ; 0xdf42 for (uint8_t i = 0; i < state; i++) 1f790: 91 2c mov r9, r1 1f792: 89 14 cp r8, r9 1f794: 39 f1 breq .+78 ; 0x1f7e4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1f796: 8e e2 ldi r24, 0x2E ; 46 1f798: 0e 94 3c 70 call 0xe078 ; 0xe078 1f79c: 93 94 inc r9 1f79e: f9 cf rjmp .-14 ; 0x1f792 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1f7a0: 8c e5 ldi r24, 0x5C ; 92 1f7a2: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1f7a4: 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; 1f7a6: c1 2c mov r12, r1 1f7a8: d1 2c mov r13, r1 1f7aa: 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 1f7ac: 20 e1 ldi r18, 0x10 ; 16 1f7ae: 30 e0 ldi r19, 0x00 ; 0 1f7b0: a8 01 movw r20, r16 1f7b2: c7 01 movw r24, r14 1f7b4: b6 01 movw r22, r12 1f7b6: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc if (header->magic != LANG_MAGIC) break; //break if not valid 1f7ba: 89 81 ldd r24, Y+1 ; 0x01 1f7bc: 9a 81 ldd r25, Y+2 ; 0x02 1f7be: ab 81 ldd r26, Y+3 ; 0x03 1f7c0: bc 81 ldd r27, Y+4 ; 0x04 1f7c2: 85 3a cpi r24, 0xA5 ; 165 1f7c4: 9a 45 sbci r25, 0x5A ; 90 1f7c6: a4 4b sbci r26, 0xB4 ; 180 1f7c8: bb 44 sbci r27, 0x4B ; 75 1f7ca: 09 f0 breq .+2 ; 0x1f7ce 1f7cc: 71 c0 rjmp .+226 ; 0x1f8b0 if (offset) *offset = addr; if (--lang == 0) return 1; 1f7ce: f2 e0 ldi r31, 0x02 ; 2 1f7d0: 9f 16 cp r9, r31 1f7d2: c1 f2 breq .-80 ; 0x1f784 addr += header->size; //calc address of next table 1f7d4: 8d 81 ldd r24, Y+5 ; 0x05 1f7d6: 9e 81 ldd r25, Y+6 ; 0x06 1f7d8: c8 0e add r12, r24 1f7da: d9 1e adc r13, r25 1f7dc: e1 1c adc r14, r1 1f7de: f1 1c adc r15, r1 1f7e0: 9a 94 dec r9 1f7e2: e4 cf rjmp .-56 ; 0x1f7ac lcd_print('.'); _delay(100); 1f7e4: 64 e6 ldi r22, 0x64 ; 100 1f7e6: 70 e0 ldi r23, 0x00 ; 0 1f7e8: 80 e0 ldi r24, 0x00 ; 0 1f7ea: 90 e0 ldi r25, 0x00 ; 0 1f7ec: 0f 94 8a 3d call 0x27b14 ; 0x27b14 boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1f7f0: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7e3> 1f7f4: 88 7f andi r24, 0xF8 ; 248 1f7f6: 91 e0 ldi r25, 0x01 ; 1 1f7f8: 98 0d add r25, r8 1f7fa: 97 70 andi r25, 0x07 ; 7 1f7fc: 89 2b or r24, r25 1f7fe: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7e3> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1f802: 91 2c mov r9, r1 1f804: 98 2c mov r9, r8 1f806: 88 24 eor r8, r8 1f808: 92 94 swap r9 1f80a: 80 ef ldi r24, 0xF0 ; 240 1f80c: 98 22 and r9, r24 1f80e: 8d 81 ldd r24, Y+5 ; 0x05 1f810: 9e 81 ldd r25, Y+6 ; 0x06 1f812: 88 16 cp r8, r24 1f814: 99 06 cpc r9, r25 1f816: 08 f0 brcs .+2 ; 0x1f81a 1f818: 46 c0 rjmp .+140 ; 0x1f8a6 { cli(); 1f81a: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1f81c: 0d 81 ldd r16, Y+5 ; 0x05 1f81e: 1e 81 ldd r17, Y+6 ; 0x06 1f820: 08 19 sub r16, r8 1f822: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1f824: 01 30 cpi r16, 0x01 ; 1 1f826: 20 e1 ldi r18, 0x10 ; 16 1f828: 12 07 cpc r17, r18 1f82a: 10 f0 brcs .+4 ; 0x1f830 1f82c: 00 e0 ldi r16, 0x00 ; 0 1f82e: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1f830: c7 01 movw r24, r14 1f832: b6 01 movw r22, r12 1f834: 68 0d add r22, r8 1f836: 79 1d adc r23, r9 1f838: 81 1d adc r24, r1 1f83a: 91 1d adc r25, r1 1f83c: 98 01 movw r18, r16 1f83e: 40 e0 ldi r20, 0x00 ; 0 1f840: 58 e0 ldi r21, 0x08 ; 8 1f842: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1f846: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1f848: 8a ea ldi r24, 0xAA ; 170 1f84a: 95 e5 ldi r25, 0x55 ; 85 1f84c: dc 01 movw r26, r24 1f84e: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e5> 1f852: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e6> 1f856: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e7> 1f85a: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e8> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1f85e: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e4> 1f862: 83 60 ori r24, 0x03 ; 3 1f864: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e4> boot_copy_size = (uint16_t)size; 1f868: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7e2> 1f86c: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7e1> boot_src_addr = (uint32_t)rptr; 1f870: 80 e0 ldi r24, 0x00 ; 0 1f872: 98 e0 ldi r25, 0x08 ; 8 1f874: a0 e0 ldi r26, 0x00 ; 0 1f876: b0 e0 ldi r27, 0x00 ; 0 1f878: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7d9> 1f87c: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7da> 1f880: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7db> 1f884: b0 93 f3 1f sts 0x1FF3, r27 ; 0x801ff3 <__bss_end+0x7dc> if (state == 0) { //TODO - check header integrity } bootapp_ram2flash(LANGBOOT_RAMBUFFER, _SEC_LANG_TABLE + state * LANGBOOT_BLOCKSIZE, size); 1f888: c4 01 movw r24, r8 1f88a: 80 50 subi r24, 0x00 ; 0 1f88c: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1f88e: b0 e0 ldi r27, 0x00 ; 0 1f890: a0 e0 ldi r26, 0x00 ; 0 1f892: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7dd> 1f896: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7de> 1f89a: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7df> 1f89e: b0 93 f7 1f sts 0x1FF7, r27 ; 0x801ff7 <__bss_end+0x7e0> 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(); 1f8a2: 0e 94 f9 67 call 0xcff2 ; 0xcff2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1f8a6: 61 e0 ldi r22, 0x01 ; 1 1f8a8: 8e ef ldi r24, 0xFE ; 254 1f8aa: 9f e0 ldi r25, 0x0F ; 15 1f8ac: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1f8b0: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e5> 1f8b4: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e6> 1f8b8: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e7> 1f8bc: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e8> 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(); 1f8c0: 0e 94 ce f9 call 0x1f39c ; 0x1f39c setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1f8c4: 88 23 and r24, r24 1f8c6: 51 f0 breq .+20 ; 0x1f8dc //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1f8c8: 64 e2 ldi r22, 0x24 ; 36 1f8ca: 86 e6 ldi r24, 0x66 ; 102 1f8cc: 92 e0 ldi r25, 0x02 ; 2 1f8ce: 0e 94 b3 68 call 0xd166 ; 0xd166 currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1f8d2: 64 e2 ldi r22, 0x24 ; 36 1f8d4: 86 e6 ldi r24, 0x66 ; 102 1f8d6: 92 e0 ldi r25, 0x02 ; 2 1f8d8: 0e 94 ab 68 call 0xd156 ; 0xd156 #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); 1f8dc: 44 e1 ldi r20, 0x14 ; 20 1f8de: 50 e0 ldi r21, 0x00 ; 0 1f8e0: 65 e1 ldi r22, 0x15 ; 21 1f8e2: 7d e0 ldi r23, 0x0D ; 13 1f8e4: c8 01 movw r24, r16 1f8e6: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1f8ea: 8c 89 ldd r24, Y+20 ; 0x14 1f8ec: 81 11 cpse r24, r1 1f8ee: 0a c0 rjmp .+20 ; 0x1f904 1f8f0: 44 e0 ldi r20, 0x04 ; 4 1f8f2: 50 e0 ldi r21, 0x00 ; 0 1f8f4: 63 ef ldi r22, 0xF3 ; 243 1f8f6: 7f e8 ldi r23, 0x8F ; 143 1f8f8: c8 01 movw r24, r16 1f8fa: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 1f8fe: 89 2b or r24, r25 1f900: 09 f4 brne .+2 ; 0x1f904 1f902: 51 c0 rjmp .+162 ; 0x1f9a6 * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1f904: e0 90 1f 05 lds r14, 0x051F ; 0x80051f uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1f908: 1d 8a std Y+21, r1 ; 0x15 1f90a: 1f 8a std Y+23, r1 ; 0x17 1f90c: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1f90e: 10 92 1f 05 sts 0x051F, r1 ; 0x80051f timeout.start(); 1f912: ce 01 movw r24, r28 1f914: 45 96 adiw r24, 0x15 ; 21 1f916: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1f91a: 62 e3 ldi r22, 0x32 ; 50 1f91c: 70 e0 ldi r23, 0x00 ; 0 1f91e: 80 e0 ldi r24, 0x00 ; 0 1f920: 90 e0 ldi r25, 0x00 ; 0 1f922: 0f 94 8a 3d call 0x27b14 ; 0x27b14 // 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; 1f926: 80 91 93 04 lds r24, 0x0493 ; 0x800493 1f92a: 90 91 94 04 lds r25, 0x0494 ; 0x800494 1f92e: 90 93 92 04 sts 0x0492, r25 ; 0x800492 1f932: 80 93 91 04 sts 0x0491, r24 ; 0x800491 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1f936: 88 ef ldi r24, 0xF8 ; 248 1f938: 9e e8 ldi r25, 0x8E ; 142 1f93a: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 1f93e: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1f940: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1f942: 33 e1 ldi r19, 0x13 ; 19 1f944: f3 16 cp r15, r19 1f946: a1 f0 breq .+40 ; 0x1f970 { if (timeout.expired(250u)) 1f948: 6a ef ldi r22, 0xFA ; 250 1f94a: 70 e0 ldi r23, 0x00 ; 0 1f94c: ce 01 movw r24, r28 1f94e: 45 96 adiw r24, 0x15 ; 21 1f950: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 1f954: 81 11 cpse r24, r1 1f956: c1 c0 rjmp .+386 ; 0x1fada goto exit; if (MYSERIAL.available() > 0) 1f958: 0e 94 8c 78 call 0xf118 ; 0xf118 1f95c: 18 16 cp r1, r24 1f95e: 19 06 cpc r1, r25 1f960: 84 f7 brge .-32 ; 0x1f942 { SN[rxIndex] = MYSERIAL.read(); 1f962: 0f 94 92 d6 call 0x3ad24 ; 0x3ad24 1f966: d6 01 movw r26, r12 1f968: 8d 93 st X+, r24 1f96a: 6d 01 movw r12, r26 rxIndex++; 1f96c: f3 94 inc r15 1f96e: e9 cf rjmp .-46 ; 0x1f942 } } SN[rxIndex] = 0; 1f970: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1f972: 44 e0 ldi r20, 0x04 ; 4 1f974: 50 e0 ldi r21, 0x00 ; 0 1f976: 63 ef ldi r22, 0xF3 ; 243 1f978: 7e e8 ldi r23, 0x8E ; 142 1f97a: c8 01 movw r24, r16 1f97c: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1f980: 89 2b or r24, r25 1f982: 59 f6 brne .-106 ; 0x1f91a 1f984: 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; 1f986: e0 92 1f 05 sts 0x051F, r14 ; 0x80051f { 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)) 1f98a: 88 23 and r24, r24 1f98c: 09 f4 brne .+2 ; 0x1f990 1f98e: a7 c0 rjmp .+334 ; 0x1fade #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); 1f990: 44 e1 ldi r20, 0x14 ; 20 1f992: 50 e0 ldi r21, 0x00 ; 0 1f994: 65 e1 ldi r22, 0x15 ; 21 1f996: 7d e0 ldi r23, 0x0D ; 13 1f998: c8 01 movw r24, r16 1f99a: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1f99e: 88 ee ldi r24, 0xE8 ; 232 1f9a0: 9f e8 ldi r25, 0x8F ; 143 } else puts_P(PSTR("SN update failed")); 1f9a2: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1f9a6: a1 10 cpse r10, r1 1f9a8: 04 c0 rjmp .+8 ; 0x1f9b2 1f9aa: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 1f9ae: 88 23 and r24, r24 1f9b0: 21 f0 breq .+8 ; 0x1f9ba SERIAL_PROTOCOLLNPGM("start"); 1f9b2: 81 ed ldi r24, 0xD1 ; 209 1f9b4: 9f e8 ldi r25, 0x8F ; 143 1f9b6: 0e 94 fe 7a call 0xf5fc ; 0xf5fc #endif SERIAL_ECHO_START; 1f9ba: 82 ee ldi r24, 0xE2 ; 226 1f9bc: 99 ea ldi r25, 0xA9 ; 169 1f9be: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1f9c2: 8a eb ldi r24, 0xBA ; 186 1f9c4: 9f e8 ldi r25, 0x8F ; 143 1f9c6: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1f9ca: 60 e0 ldi r22, 0x00 ; 0 1f9cc: 8c ea ldi r24, 0xAC ; 172 1f9ce: 9c e0 ldi r25, 0x0C ; 12 1f9d0: 0e 94 8c 77 call 0xef18 ; 0xef18 1f9d4: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1f9d6: 0e 94 1b db call 0x1b636 ; 0x1b636 } MMU2::mmu2.Status(); 1f9da: 0f 94 ff 76 call 0x2edfe ; 0x2edfe } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1f9de: 8b ef ldi r24, 0xFB ; 251 1f9e0: 9e e8 ldi r25, 0x8E ; 142 1f9e2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1f9e6: 62 e0 ldi r22, 0x02 ; 2 1f9e8: 86 ed ldi r24, 0xD6 ; 214 1f9ea: 9e e0 ldi r25, 0x0E ; 14 1f9ec: 0e 94 8c 77 call 0xef18 ; 0xef18 if (status == (uint8_t)EEPROM::Enabled) 1f9f0: 81 30 cpi r24, 0x01 ; 1 1f9f2: 09 f0 breq .+2 ; 0x1f9f6 1f9f4: 77 c0 rjmp .+238 ; 0x1fae4 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1f9f6: 8a e4 ldi r24, 0x4A ; 74 1f9f8: 9d e5 ldi r25, 0x5D ; 93 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1f9fa: 0e 94 fe 7a call 0xf5fc ; 0xf5fc #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1f9fe: 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); 1fa00: f0 fe sbrs r15, 0 1fa02: 04 c0 rjmp .+8 ; 0x1fa0c 1fa04: 8a ed ldi r24, 0xDA ; 218 1fa06: 9d e6 ldi r25, 0x6D ; 109 1fa08: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1fa0c: f1 fe sbrs r15, 1 1fa0e: 04 c0 rjmp .+8 ; 0x1fa18 1fa10: 8a ec ldi r24, 0xCA ; 202 1fa12: 9d e6 ldi r25, 0x6D ; 109 1fa14: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1fa18: f2 fe sbrs r15, 2 1fa1a: 04 c0 rjmp .+8 ; 0x1fa24 1fa1c: 89 eb ldi r24, 0xB9 ; 185 1fa1e: 9d e6 ldi r25, 0x6D ; 109 1fa20: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1fa24: f3 fe sbrs r15, 3 1fa26: 04 c0 rjmp .+8 ; 0x1fa30 1fa28: 89 ea ldi r24, 0xA9 ; 169 1fa2a: 9d e6 ldi r25, 0x6D ; 109 1fa2c: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1fa30: f5 fe sbrs r15, 5 1fa32: 04 c0 rjmp .+8 ; 0x1fa3c 1fa34: 89 e9 ldi r24, 0x99 ; 153 1fa36: 9d e6 ldi r25, 0x6D ; 109 1fa38: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 MCUSR = 0; 1fa3c: 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; 1fa3e: 82 ee ldi r24, 0xE2 ; 226 1fa40: 99 ea ldi r25, 0xA9 ; 169 1fa42: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1fa46: 89 e8 ldi r24, 0x89 ; 137 1fa48: 9d e6 ldi r25, 0x6D ; 109 1fa4a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1fa4e: 86 ea ldi r24, 0xA6 ; 166 1fa50: 9f e8 ldi r25, 0x8F ; 143 1fa52: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1fa56: 8d e7 ldi r24, 0x7D ; 125 1fa58: 9d e6 ldi r25, 0x6D ; 109 1fa5a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1fa5e: 8e e9 ldi r24, 0x9E ; 158 1fa60: 9f e8 ldi r25, 0x8F ; 143 1fa62: 0e 94 fe 7a call 0xf5fc ; 0xf5fc #endif #endif SERIAL_ECHO_START; 1fa66: 82 ee ldi r24, 0xE2 ; 226 1fa68: 99 ea ldi r25, 0xA9 ; 169 1fa6a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1fa6e: 8e e6 ldi r24, 0x6E ; 110 1fa70: 9d e6 ldi r25, 0x6D ; 109 1fa72: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1fa76: 80 91 0d 18 lds r24, 0x180D ; 0x80180d <__brkval> 1fa7a: 90 91 0e 18 lds r25, 0x180E ; 0x80180e <__brkval+0x1> 1fa7e: 00 97 sbiw r24, 0x00 ; 0 1fa80: a1 f1 breq .+104 ; 0x1faea 1fa82: 08 1b sub r16, r24 1fa84: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1fa86: b8 01 movw r22, r16 1fa88: 11 0f add r17, r17 1fa8a: 88 0b sbc r24, r24 1fa8c: 99 0b sbc r25, r25 1fa8e: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1fa92: 87 e5 ldi r24, 0x57 ; 87 1fa94: 9d e6 ldi r25, 0x6D ; 109 1fa96: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1fa9a: 80 ee ldi r24, 0xE0 ; 224 1fa9c: 96 e0 ldi r25, 0x06 ; 6 1fa9e: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 #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); 1faa2: 6e e2 ldi r22, 0x2E ; 46 1faa4: 71 e0 ldi r23, 0x01 ; 1 1faa6: 8e ee ldi r24, 0xEE ; 238 1faa8: 9e e0 ldi r25, 0x0E ; 14 1faaa: 0e 94 74 77 call 0xeee8 ; 0xeee8 1faae: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1fab0: 66 e3 ldi r22, 0x36 ; 54 1fab2: 71 e0 ldi r23, 0x01 ; 1 1fab4: 8c ee ldi r24, 0xEC ; 236 1fab6: 9e e0 ldi r25, 0x0E ; 14 1fab8: 0e 94 74 77 call 0xeee8 ; 0xeee8 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1fabc: 0e 32 cpi r16, 0x2E ; 46 1fabe: 11 40 sbci r17, 0x01 ; 1 1fac0: 11 f0 breq .+4 ; 0x1fac6 1fac2: 0d 94 b1 05 jmp 0x20b62 ; 0x20b62 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1fac6: 01 e0 ldi r16, 0x01 ; 1 1fac8: 86 33 cpi r24, 0x36 ; 54 1faca: 91 40 sbci r25, 0x01 ; 1 1facc: 09 f4 brne .+2 ; 0x1fad0 1face: 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(); 1fad0: 0e 94 51 95 call 0x12aa2 ; 0x12aa2 1fad4: f8 2e mov r15, r24 1fad6: 0d 94 b9 05 jmp 0x20b72 ; 0x20b72 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1fada: 80 e0 ldi r24, 0x00 ; 0 1fadc: 54 cf rjmp .-344 ; 0x1f986 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1fade: 87 ed ldi r24, 0xD7 ; 215 1fae0: 9f e8 ldi r25, 0x8F ; 143 1fae2: 5f cf rjmp .-322 ; 0x1f9a2 1fae4: 84 e4 ldi r24, 0x44 ; 68 1fae6: 9d e5 ldi r25, 0x5D ; 93 1fae8: 88 cf rjmp .-240 ; 0x1f9fa 1faea: 07 51 subi r16, 0x17 ; 23 1faec: 18 41 sbci r17, 0x18 ; 24 1faee: cb cf rjmp .-106 ; 0x1fa86 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1faf0: 81 e3 ldi r24, 0x31 ; 49 1faf2: 91 e0 ldi r25, 0x01 ; 1 1faf4: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.485+0x1> 1faf8: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.485> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1fafc: c0 90 99 04 lds r12, 0x0499 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.478> 1fb00: d0 90 9a 04 lds r13, 0x049A ; 0x80049a <_ZL12maxttemp_raw.lto_priv.478+0x1> 1fb04: c6 01 movw r24, r12 1fb06: 0e 94 86 da call 0x1b50c ; 0x1b50c 1fb0a: 20 e0 ldi r18, 0x00 ; 0 1fb0c: 30 e8 ldi r19, 0x80 ; 128 1fb0e: 48 e9 ldi r20, 0x98 ; 152 1fb10: 53 e4 ldi r21, 0x43 ; 67 1fb12: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1fb16: 18 16 cp r1, r24 1fb18: 44 f4 brge .+16 ; 0x1fb2a #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1fb1a: f0 e1 ldi r31, 0x10 ; 16 1fb1c: cf 0e add r12, r31 1fb1e: d1 1c adc r13, r1 1fb20: d0 92 9a 04 sts 0x049A, r13 ; 0x80049a <_ZL12maxttemp_raw.lto_priv.478+0x1> 1fb24: c0 92 99 04 sts 0x0499, r12 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.478> 1fb28: e9 cf rjmp .-46 ; 0x1fafc #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1fb2a: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.486> 1fb2e: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.486+0x1> 1fb32: 0f 94 f2 4a call 0x295e4 ; 0x295e4 1fb36: 20 e0 ldi r18, 0x00 ; 0 1fb38: 30 e0 ldi r19, 0x00 ; 0 1fb3a: 40 e2 ldi r20, 0x20 ; 32 1fb3c: 51 e4 ldi r21, 0x41 ; 65 1fb3e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1fb42: 87 ff sbrs r24, 7 1fb44: 0a c0 rjmp .+20 ; 0x1fb5a #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1fb46: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.486> 1fb4a: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.486+0x1> 1fb4e: 40 97 sbiw r24, 0x10 ; 16 1fb50: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.486+0x1> 1fb54: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.486> 1fb58: e8 cf rjmp .-48 ; 0x1fb2a #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1fb5a: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.479> 1fb5e: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL16bed_maxttemp_raw.lto_priv.479+0x1> 1fb62: 0f 94 f2 4a call 0x295e4 ; 0x295e4 1fb66: 20 e0 ldi r18, 0x00 ; 0 1fb68: 30 e0 ldi r19, 0x00 ; 0 1fb6a: 4a ef ldi r20, 0xFA ; 250 1fb6c: 52 e4 ldi r21, 0x42 ; 66 1fb6e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1fb72: 18 16 cp r1, r24 1fb74: 54 f4 brge .+20 ; 0x1fb8a #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1fb76: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.479> 1fb7a: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL16bed_maxttemp_raw.lto_priv.479+0x1> 1fb7e: 40 96 adiw r24, 0x10 ; 16 1fb80: 90 93 98 04 sts 0x0498, r25 ; 0x800498 <_ZL16bed_maxttemp_raw.lto_priv.479+0x1> 1fb84: 80 93 97 04 sts 0x0497, r24 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.479> 1fb88: e8 cf rjmp .-48 ; 0x1fb5a #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1fb8a: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.477> 1fb8e: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.477+0x1> 1fb92: 0f 94 5d 4a call 0x294ba ; 0x294ba 1fb96: 20 e0 ldi r18, 0x00 ; 0 1fb98: 30 e0 ldi r19, 0x00 ; 0 1fb9a: 40 ef ldi r20, 0xF0 ; 240 1fb9c: 51 ec ldi r21, 0xC1 ; 193 1fb9e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 1fba2: 87 ff sbrs r24, 7 1fba4: 0a c0 rjmp .+20 ; 0x1fbba #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1fba6: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.477> 1fbaa: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.477+0x1> 1fbae: 40 97 sbiw r24, 0x10 ; 16 1fbb0: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.477+0x1> 1fbb4: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.477> 1fbb8: e8 cf rjmp .-48 ; 0x1fb8a #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1fbba: 80 91 95 04 lds r24, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.480> 1fbbe: 90 91 96 04 lds r25, 0x0496 ; 0x800496 <_ZL20ambient_maxttemp_raw.lto_priv.480+0x1> 1fbc2: 0f 94 5d 4a call 0x294ba ; 0x294ba 1fbc6: 20 e0 ldi r18, 0x00 ; 0 1fbc8: 30 e0 ldi r19, 0x00 ; 0 1fbca: 40 ea ldi r20, 0xA0 ; 160 1fbcc: 52 e4 ldi r21, 0x42 ; 66 1fbce: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 1fbd2: 18 16 cp r1, r24 1fbd4: 54 f4 brge .+20 ; 0x1fbea #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1fbd6: 80 91 95 04 lds r24, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.480> 1fbda: 90 91 96 04 lds r25, 0x0496 ; 0x800496 <_ZL20ambient_maxttemp_raw.lto_priv.480+0x1> 1fbde: 40 96 adiw r24, 0x10 ; 16 1fbe0: 90 93 96 04 sts 0x0496, r25 ; 0x800496 <_ZL20ambient_maxttemp_raw.lto_priv.480+0x1> 1fbe4: 80 93 95 04 sts 0x0495, r24 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.480> 1fbe8: e8 cf rjmp .-48 ; 0x1fbba #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1fbea: 9f b7 in r25, 0x3f ; 63 1fbec: f8 94 cli TCNT0 = 0; 1fbee: 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; 1fbf0: 8f ef ldi r24, 0xFF ; 255 1fbf2: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1fbf4: 83 e3 ldi r24, 0x33 ; 51 1fbf6: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1fbf8: 12 e0 ldi r17, 0x02 ; 2 1fbfa: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1fbfc: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1fc00: 81 60 ori r24, 0x01 ; 1 1fc02: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1fc06: 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; 1fc08: 80 e8 ldi r24, 0x80 ; 128 1fc0a: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1fc0e: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1fc12: 84 60 ori r24, 0x04 ; 4 1fc14: 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; 1fc18: 2f b7 in r18, 0x3f ; 63 1fc1a: f8 94 cli SET_OUTPUT(BEEPER); 1fc1c: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fc20: 84 60 ori r24, 0x04 ; 4 1fc22: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1fc26: 9f b7 in r25, 0x3f ; 63 1fc28: f8 94 cli 1fc2a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fc2e: 8b 7f andi r24, 0xFB ; 251 1fc30: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fc34: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1fc36: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fc3a: 80 62 ori r24, 0x20 ; 32 1fc3c: 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); 1fc40: 81 e0 ldi r24, 0x01 ; 1 1fc42: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1fc46: 85 e1 ldi r24, 0x15 ; 21 1fc48: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1fc4c: 8f ef ldi r24, 0xFF ; 255 1fc4e: 90 e0 ldi r25, 0x00 ; 0 1fc50: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1fc54: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1fc58: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1fc5c: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1fc60: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1fc64: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1fc68: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1fc6c: 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")); 1fc6e: 89 e0 ldi r24, 0x09 ; 9 1fc70: 9f e8 ldi r25, 0x8F ; 143 1fc72: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1fc76: 8f e5 ldi r24, 0x5F ; 95 1fc78: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1fc7c: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1fc80: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1fc84: 80 64 ori r24, 0x40 ; 64 1fc86: 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); 1fc8a: 8f e9 ldi r24, 0x9F ; 159 1fc8c: 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(); 1fc90: 0e 94 7c 8f call 0x11ef8 ; 0x11ef8 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fc94: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1fc96: f8 94 cli // CTC TCCRxB &= ~(1< 1fc9c: 8f 7e andi r24, 0xEF ; 239 1fc9e: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1fca6: 88 60 ori r24, 0x08 ; 8 1fca8: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1fcb0: 8d 7f andi r24, 0xFD ; 253 1fcb2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1fcba: 8e 7f andi r24, 0xFE ; 254 1fcbc: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1fcc4: 8f 73 andi r24, 0x3F ; 63 1fcc6: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1fcce: 8f 7c andi r24, 0xCF ; 207 1fcd0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fcd8: 84 60 ori r24, 0x04 ; 4 1fcda: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fce2: 8d 7f andi r24, 0xFD ; 253 1fce4: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fcec: 8e 7f andi r24, 0xFE ; 254 1fcee: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 1fcf2: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 1fcf6: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 1fcfa: 2b ee ldi r18, 0xEB ; 235 1fcfc: 31 e4 ldi r19, 0x41 ; 65 1fcfe: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1fd02: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1fd06: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 1fd08: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 1fd0c: 82 60 ori r24, 0x02 ; 2 1fd0e: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fd12: 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: ")); 1fd14: 85 e4 ldi r24, 0x45 ; 69 1fd16: 9d e6 ldi r25, 0x6D ; 109 1fd18: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } bool extruder_altfan_detect() { // override isAltFan setting for detection altfanStatus.isAltfan = 0; 1fd1c: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> 1fd20: 8e 7f andi r24, 0xFE ; 254 1fd22: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> // During initialisation, use the EEPROM value altfanStatus.altfanOverride = eeprom_init_default_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE, 0); 1fd26: 60 e0 ldi r22, 0x00 ; 0 1fd28: 8b e2 ldi r24, 0x2B ; 43 1fd2a: 9d e0 ldi r25, 0x0D ; 13 1fd2c: 0e 94 8c 77 call 0xef18 ; 0xef18 1fd30: 90 91 b7 04 lds r25, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> 1fd34: 80 fb bst r24, 0 1fd36: 91 f9 bld r25, 1 1fd38: 90 93 b7 04 sts 0x04B7, r25 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> setExtruderAutoFanState(3); 1fd3c: 83 e0 ldi r24, 0x03 ; 3 1fd3e: 0e 94 c9 76 call 0xed92 ; 0xed92 SET_INPUT(TACH_0); 1fd42: 6e 98 cbi 0x0d, 6 ; 13 CRITICAL_SECTION_START; 1fd44: 9f b7 in r25, 0x3f ; 63 1fd46: f8 94 cli EICRB &= ~(1 << ISC61); 1fd48: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fd4c: 8f 7d andi r24, 0xDF ; 223 1fd4e: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << ISC60); 1fd52: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fd56: 80 61 ori r24, 0x10 ; 16 1fd58: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EIMSK |= (1 << INT6); 1fd5c: ee 9a sbi 0x1d, 6 ; 29 fan_edge_counter[0] = 0; 1fd5e: 10 92 b4 04 sts 0x04B4, r1 ; 0x8004b4 1fd62: 10 92 b3 04 sts 0x04B3, r1 ; 0x8004b3 CRITICAL_SECTION_END; 1fd66: 9f bf out 0x3f, r25 ; 63 extruder_autofan_last_check = _millis(); 1fd68: 0f 94 83 3f call 0x27f06 ; 0x27f06 1fd6c: 60 93 9a 17 sts 0x179A, r22 ; 0x80179a 1fd70: 70 93 9b 17 sts 0x179B, r23 ; 0x80179b 1fd74: 80 93 9c 17 sts 0x179C, r24 ; 0x80179c 1fd78: 90 93 9d 17 sts 0x179D, r25 ; 0x80179d _delay(1000); 1fd7c: 68 ee ldi r22, 0xE8 ; 232 1fd7e: 73 e0 ldi r23, 0x03 ; 3 1fd80: 80 e0 ldi r24, 0x00 ; 0 1fd82: 90 e0 ldi r25, 0x00 ; 0 1fd84: 0f 94 8a 3d call 0x27b14 ; 0x27b14 EIMSK &= ~(1 << INT6); 1fd88: ee 98 cbi 0x1d, 6 ; 29 countFanSpeed(); 1fd8a: 0e 94 52 76 call 0xeca4 ; 0xeca4 // restore fan state altfanStatus.isAltfan = fan_speed[0] > 100; 1fd8e: 91 e0 ldi r25, 0x01 ; 1 1fd90: 20 91 af 04 lds r18, 0x04AF ; 0x8004af 1fd94: 30 91 b0 04 lds r19, 0x04B0 ; 0x8004b0 1fd98: 25 36 cpi r18, 0x65 ; 101 1fd9a: 31 05 cpc r19, r1 1fd9c: 0c f4 brge .+2 ; 0x1fda0 1fd9e: 90 e0 ldi r25, 0x00 ; 0 1fda0: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> 1fda4: 90 fb bst r25, 0 1fda6: 80 f9 bld r24, 0 1fda8: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> setExtruderAutoFanState(1); 1fdac: 81 e0 ldi r24, 0x01 ; 1 1fdae: 0e 94 c9 76 call 0xed92 ; 0xed92 return altfanStatus.isAltfan; 1fdb2: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> if (extruder_altfan_detect()) 1fdb6: 80 ff sbrs r24, 0 1fdb8: c4 c0 rjmp .+392 ; 0x1ff42 SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); 1fdba: 87 e9 ldi r24, 0x97 ; 151 1fdbc: 9f e8 ldi r25, 0x8F ; 143 else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1fdbe: 0e 94 fe 7a call 0xf5fc ; 0xf5fc // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1fdc2: 10 92 54 0e sts 0x0E54, r1 ; 0x800e54 block_buffer_tail = 0; 1fdc6: 10 92 55 0e sts 0x0E55, r1 ; 0x800e55 memset(position, 0, sizeof(position)); // clear position 1fdca: 80 e1 ldi r24, 0x10 ; 16 1fdcc: e2 e5 ldi r30, 0x52 ; 82 1fdce: f7 e0 ldi r31, 0x07 ; 7 1fdd0: df 01 movw r26, r30 1fdd2: 28 2f mov r18, r24 1fdd4: 1d 92 st X+, r1 1fdd6: 2a 95 dec r18 1fdd8: e9 f7 brne .-6 ; 0x1fdd4 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1fdda: ee ec ldi r30, 0xCE ; 206 1fddc: f4 e0 ldi r31, 0x04 ; 4 1fdde: df 01 movw r26, r30 1fde0: 28 2f mov r18, r24 1fde2: 1d 92 st X+, r1 1fde4: 2a 95 dec r18 1fde6: e9 f7 brne .-6 ; 0x1fde2 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1fde8: ee eb ldi r30, 0xBE ; 190 1fdea: f4 e0 ldi r31, 0x04 ; 4 1fdec: df 01 movw r26, r30 1fdee: 1d 92 st X+, r1 1fdf0: 8a 95 dec r24 1fdf2: e9 f7 brne .-6 ; 0x1fdee previous_nominal_speed = 0.0; 1fdf4: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.507> 1fdf8: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.507+0x1> 1fdfc: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507+0x2> 1fe00: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x3> plan_reset_next_e_queue = false; 1fe04: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL23plan_reset_next_e_queue.lto_priv.505> plan_reset_next_e_sched = false; 1fe08: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_sched.lto_priv.506> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1fe0c: 84 e0 ldi r24, 0x04 ; 4 1fe0e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 if (!READ(BTN_ENC)) 1fe12: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe16: 86 fd sbrc r24, 6 1fe18: cd c0 rjmp .+410 ; 0x1ffb4 1fe1a: bf ef ldi r27, 0xFF ; 255 1fe1c: e3 ed ldi r30, 0xD3 ; 211 1fe1e: f0 e3 ldi r31, 0x30 ; 48 1fe20: b1 50 subi r27, 0x01 ; 1 1fe22: e0 40 sbci r30, 0x00 ; 0 1fe24: f0 40 sbci r31, 0x00 ; 0 1fe26: e1 f7 brne .-8 ; 0x1fe20 1fe28: 00 c0 rjmp .+0 ; 0x1fe2a 1fe2a: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1fe2c: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe30: 86 fd sbrc r24, 6 1fe32: c0 c0 rjmp .+384 ; 0x1ffb4 { lcd_clear(); 1fe34: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_P(PSTR("Factory RESET")); 1fe38: 83 e6 ldi r24, 0x63 ; 99 1fe3a: 9f e8 ldi r25, 0x8F ; 143 1fe3c: 0e 94 78 6f call 0xdef0 ; 0xdef0 SET_OUTPUT(BEEPER); 1fe40: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fe44: 84 60 ori r24, 0x04 ; 4 1fe46: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1fe4a: 80 91 df 04 lds r24, 0x04DF ; 0x8004df 1fe4e: 82 30 cpi r24, 0x02 ; 2 1fe50: 41 f0 breq .+16 ; 0x1fe62 WRITE(BEEPER, HIGH); 1fe52: 9f b7 in r25, 0x3f ; 63 1fe54: f8 94 cli 1fe56: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe5a: 84 60 ori r24, 0x04 ; 4 1fe5c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe60: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1fe62: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe66: 86 ff sbrs r24, 6 1fe68: fc cf rjmp .-8 ; 0x1fe62 WRITE(BEEPER, LOW); 1fe6a: 9f b7 in r25, 0x3f ; 63 1fe6c: f8 94 cli 1fe6e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe72: 8b 7f andi r24, 0xFB ; 251 1fe74: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe78: 9f bf out 0x3f, r25 ; 63 1fe7a: 2f ef ldi r18, 0xFF ; 255 1fe7c: 37 ea ldi r19, 0xA7 ; 167 1fe7e: 81 e6 ldi r24, 0x61 ; 97 1fe80: 21 50 subi r18, 0x01 ; 1 1fe82: 30 40 sbci r19, 0x00 ; 0 1fe84: 80 40 sbci r24, 0x00 ; 0 1fe86: e1 f7 brne .-8 ; 0x1fe80 1fe88: 00 c0 rjmp .+0 ; 0x1fe8a 1fe8a: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1fe8c: 89 e4 ldi r24, 0x49 ; 73 1fe8e: 9f e8 ldi r25, 0x8F ; 143 1fe90: 9a 83 std Y+2, r25 ; 0x02 1fe92: 89 83 std Y+1, r24 ; 0x01 1fe94: 8e e3 ldi r24, 0x3E ; 62 1fe96: 9f e8 ldi r25, 0x8F ; 143 1fe98: 9c 83 std Y+4, r25 ; 0x04 1fe9a: 8b 83 std Y+3, r24 ; 0x03 1fe9c: 80 e3 ldi r24, 0x30 ; 48 1fe9e: 9f e8 ldi r25, 0x8F ; 143 1fea0: 9e 83 std Y+6, r25 ; 0x06 1fea2: 8d 83 std Y+5, r24 ; 0x05 1fea4: 83 e2 ldi r24, 0x23 ; 35 1fea6: 9f e8 ldi r25, 0x8F ; 143 1fea8: 98 87 std Y+8, r25 ; 0x08 1feaa: 8f 83 std Y+7, r24 ; 0x07 1feac: 8a e1 ldi r24, 0x1A ; 26 1feae: 9f e8 ldi r25, 0x8F ; 143 1feb0: 9a 87 std Y+10, r25 ; 0x0a 1feb2: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1feb4: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_putc_at(0, 0, '>'); 1feb8: 4e e3 ldi r20, 0x3E ; 62 1feba: 60 e0 ldi r22, 0x00 ; 0 1febc: 80 e0 ldi r24, 0x00 ; 0 1febe: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_consume_click(); 1fec2: 0e 94 a5 71 call 0xe34a ; 0xe34a } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1fec6: 10 e0 ldi r17, 0x00 ; 0 1fec8: d1 2c mov r13, r1 1feca: 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]); 1fecc: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1fed0: f6 01 movw r30, r12 1fed2: e8 0f add r30, r24 1fed4: f1 1d adc r31, r1 1fed6: 87 fd sbrc r24, 7 1fed8: fa 95 dec r31 1feda: ee 0f add r30, r30 1fedc: ff 1f adc r31, r31 1fede: a1 e0 ldi r26, 0x01 ; 1 1fee0: b0 e0 ldi r27, 0x00 ; 0 1fee2: ac 0f add r26, r28 1fee4: bd 1f adc r27, r29 1fee6: ea 0f add r30, r26 1fee8: fb 1f adc r31, r27 1feea: 40 81 ld r20, Z 1feec: 51 81 ldd r21, Z+1 ; 0x01 1feee: 6c 2d mov r22, r12 1fef0: 81 e0 ldi r24, 0x01 ; 1 1fef2: 0e 94 a1 6f call 0xdf42 ; 0xdf42 1fef6: bf ef ldi r27, 0xFF ; 255 1fef8: cb 1a sub r12, r27 1fefa: 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++) { 1fefc: e4 e0 ldi r30, 0x04 ; 4 1fefe: ce 16 cp r12, r30 1ff00: d1 04 cpc r13, r1 1ff02: 21 f7 brne .-56 ; 0x1fecc lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1ff04: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 1ff08: 81 e0 ldi r24, 0x01 ; 1 1ff0a: 0e 94 da 8b call 0x117b4 ; 0x117b4 if (lcd_encoder) { 1ff0e: 80 91 35 05 lds r24, 0x0535 ; 0x800535 1ff12: 90 91 36 05 lds r25, 0x0536 ; 0x800536 1ff16: 00 97 sbiw r24, 0x00 ; 0 1ff18: 89 f1 breq .+98 ; 0x1ff7c if (lcd_encoder < 0) { 1ff1a: 97 ff sbrs r25, 7 1ff1c: 15 c0 rjmp .+42 ; 0x1ff48 cursor_pos--; 1ff1e: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1ff20: 14 30 cpi r17, 0x04 ; 4 1ff22: 0c f4 brge .+2 ; 0x1ff26 1ff24: a9 c0 rjmp .+338 ; 0x20078 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1ff26: 87 e0 ldi r24, 0x07 ; 7 1ff28: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1ff2c: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1ff30: 18 16 cp r1, r24 1ff32: 2c f0 brlt .+10 ; 0x1ff3e first++; 1ff34: 8f 5f subi r24, 0xFF ; 255 1ff36: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de lcd_clear(); 1ff3a: 0e 94 c0 6f call 0xdf80 ; 0xdf80 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1ff3e: 13 e0 ldi r17, 0x03 ; 3 1ff40: 06 c0 rjmp .+12 ; 0x1ff4e #ifdef EXTRUDER_ALTFAN_DETECT SERIAL_ECHORPGM(_n("Hotend fan type: ")); if (extruder_altfan_detect()) SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1ff42: 80 e9 ldi r24, 0x90 ; 144 1ff44: 9f e8 ldi r25, 0x8F ; 143 1ff46: 3b cf rjmp .-394 ; 0x1fdbe if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1ff48: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1ff4a: 14 30 cpi r17, 0x04 ; 4 1ff4c: 60 f7 brcc .-40 ; 0x1ff26 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1ff4e: 42 e1 ldi r20, 0x12 ; 18 1ff50: 5f e8 ldi r21, 0x8F ; 143 1ff52: 60 e0 ldi r22, 0x00 ; 0 1ff54: 80 e0 ldi r24, 0x00 ; 0 1ff56: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(0, cursor_pos); 1ff5a: 61 2f mov r22, r17 1ff5c: 80 e0 ldi r24, 0x00 ; 0 1ff5e: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_putc('>'); 1ff62: 8e e3 ldi r24, 0x3E ; 62 1ff64: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_encoder = 0; 1ff68: 10 92 36 05 sts 0x0536, r1 ; 0x800536 1ff6c: 10 92 35 05 sts 0x0535, r1 ; 0x800535 _delay(100); 1ff70: 64 e6 ldi r22, 0x64 ; 100 1ff72: 70 e0 ldi r23, 0x00 ; 0 1ff74: 80 e0 ldi r24, 0x00 ; 0 1ff76: 90 e0 ldi r25, 0x00 ; 0 1ff78: 0f 94 8a 3d call 0x27b14 ; 0x27b14 } if (lcd_clicked()) { 1ff7c: 0e 94 aa 71 call 0xe354 ; 0xe354 1ff80: 88 23 and r24, r24 1ff82: 09 f4 brne .+2 ; 0x1ff86 1ff84: a1 cf rjmp .-190 ; 0x1fec8 return(cursor_pos + first); 1ff86: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 1ff8a: 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(); 1ff8c: 0e 94 c0 6f call 0xdf80 ; 0xdf80 Sound_MakeCustom(100,0,false); 1ff90: 40 e0 ldi r20, 0x00 ; 0 1ff92: 70 e0 ldi r23, 0x00 ; 0 1ff94: 60 e0 ldi r22, 0x00 ; 0 1ff96: 84 e6 ldi r24, 0x64 ; 100 1ff98: 90 e0 ldi r25, 0x00 ; 0 1ff9a: 0f 94 99 6a call 0x2d532 ; 0x2d532 switch (level) { 1ff9e: 12 30 cpi r17, 0x02 ; 2 1ffa0: 09 f4 brne .+2 ; 0x1ffa4 1ffa2: a0 c0 rjmp .+320 ; 0x200e4 1ffa4: 08 f0 brcs .+2 ; 0x1ffa8 1ffa6: 79 c0 rjmp .+242 ; 0x2009a 1ffa8: 11 23 and r17, r17 1ffaa: 09 f4 brne .+2 ; 0x1ffae 1ffac: 93 c0 rjmp .+294 ; 0x200d4 1ffae: 11 30 cpi r17, 0x01 ; 1 1ffb0: 09 f4 brne .+2 ; 0x1ffb4 1ffb2: 93 c0 rjmp .+294 ; 0x200da case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1ffb4: 82 e0 ldi r24, 0x02 ; 2 1ffb6: 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); 1ffba: 60 e0 ldi r22, 0x00 ; 0 1ffbc: 8f ef ldi r24, 0xFF ; 255 1ffbe: 9f e0 ldi r25, 0x0F ; 15 1ffc0: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1ffc4: 61 e0 ldi r22, 0x01 ; 1 1ffc6: 8f e5 ldi r24, 0x5F ; 95 1ffc8: 9f e0 ldi r25, 0x0F ; 15 1ffca: 0e 94 8c 77 call 0xef18 ; 0xef18 #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 1ffce: 8f ef ldi r24, 0xFF ; 255 1ffd0: 9f e0 ldi r25, 0x0F ; 15 1ffd2: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 1ffd6: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 1ffd8: 8f 3f cpi r24, 0xFF ; 255 1ffda: 09 f4 brne .+2 ; 0x1ffde 1ffdc: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 1ffde: 10 92 6a 06 sts 0x066A, r1 ; 0x80066a tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); 1ffe2: 61 e0 ldi r22, 0x01 ; 1 1ffe4: 89 e6 ldi r24, 0x69 ; 105 1ffe6: 9f e0 ldi r25, 0x0F ; 15 1ffe8: 0e 94 8c 77 call 0xef18 ; 0xef18 1ffec: 91 e0 ldi r25, 0x01 ; 1 1ffee: 81 11 cpse r24, r1 1fff0: 01 c0 rjmp .+2 ; 0x1fff4 1fff2: 90 e0 ldi r25, 0x00 ; 0 1fff4: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 1fff8: 88 23 and r24, r24 1fffa: 09 f4 brne .+2 ; 0x1fffe 1fffc: 92 c0 rjmp .+292 ; 0x20122 puts_P(_N("CrashDetect ENABLED!")); 1fffe: 80 e3 ldi r24, 0x30 ; 48 20000: 9d e6 ldi r25, 0x6D ; 109 } else { puts_P(_N("CrashDetect DISABLED")); 20002: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 20006: 87 ef ldi r24, 0xF7 ; 247 20008: 9e e0 ldi r25, 0x0E ; 14 2000a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2000e: c8 2e mov r12, r24 20010: 80 93 fa 04 sts 0x04FA, r24 ; 0x8004fa tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 20014: 86 ef ldi r24, 0xF6 ; 246 20016: 9e e0 ldi r25, 0x0E ; 14 20018: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2001c: d8 2e mov r13, r24 2001e: 80 93 fb 04 sts 0x04FB, r24 ; 0x8004fb tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 20022: 85 ef ldi r24, 0xF5 ; 245 20024: 9e e0 ldi r25, 0x0E ; 14 20026: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2002a: e8 2e mov r14, r24 2002c: 80 93 fc 04 sts 0x04FC, r24 ; 0x8004fc #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[E_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_E_FAC); 20030: 84 ef ldi r24, 0xF4 ; 244 20032: 9e e0 ldi r25, 0x0E ; 14 20034: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 20038: 80 93 fd 04 sts 0x04FD, r24 ; 0x8004fd if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 2003c: 2f ef ldi r18, 0xFF ; 255 2003e: c2 12 cpse r12, r18 20040: 02 c0 rjmp .+4 ; 0x20046 20042: 10 92 fa 04 sts 0x04FA, r1 ; 0x8004fa if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 20046: 3f ef ldi r19, 0xFF ; 255 20048: d3 12 cpse r13, r19 2004a: 02 c0 rjmp .+4 ; 0x20050 2004c: 10 92 fb 04 sts 0x04FB, r1 ; 0x8004fb if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 20050: 9f ef ldi r25, 0xFF ; 255 20052: e9 12 cpse r14, r25 20054: 02 c0 rjmp .+4 ; 0x2005a 20056: 10 92 fc 04 sts 0x04FC, r1 ; 0x8004fc if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 2005a: 8f 3f cpi r24, 0xFF ; 255 2005c: 11 f4 brne .+4 ; 0x20062 2005e: 10 92 fd 04 sts 0x04FD, r1 ; 0x8004fd #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 20062: 80 91 28 07 lds r24, 0x0728 ; 0x800728 20066: 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--; 20068: 28 e0 ldi r18, 0x08 ; 8 2006a: 96 95 lsr r25 2006c: 87 95 ror r24 2006e: 00 97 sbiw r24, 0x00 ; 0 20070: 09 f4 brne .+2 ; 0x20074 20072: 5a c0 rjmp .+180 ; 0x20128 20074: 21 50 subi r18, 0x01 ; 1 20076: f9 cf rjmp .-14 ; 0x2006a first++; lcd_clear(); } } if (cursor_pos < 0) { 20078: 1f 3f cpi r17, 0xFF ; 255 2007a: 09 f0 breq .+2 ; 0x2007e 2007c: 68 cf rjmp .-304 ; 0x1ff4e cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 2007e: 87 e0 ldi r24, 0x07 ; 7 20080: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee if (first > 0) { 20084: 80 91 de 04 lds r24, 0x04DE ; 0x8004de 20088: 18 16 cp r1, r24 2008a: 2c f4 brge .+10 ; 0x20096 first--; 2008c: 81 50 subi r24, 0x01 ; 1 2008e: 80 93 de 04 sts 0x04DE, r24 ; 0x8004de lcd_clear(); 20092: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 20096: 10 e0 ldi r17, 0x00 ; 0 20098: 5a cf rjmp .-332 ; 0x1ff4e // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 2009a: 13 30 cpi r17, 0x03 ; 3 2009c: 29 f1 breq .+74 ; 0x200e8 2009e: 14 30 cpi r17, 0x04 ; 4 200a0: 09 f0 breq .+2 ; 0x200a4 200a2: 88 cf rjmp .-240 ; 0x1ffb4 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 200a4: 62 e5 ldi r22, 0x52 ; 82 200a6: 7f e8 ldi r23, 0x8F ; 143 200a8: 80 e0 ldi r24, 0x00 ; 0 200aa: 90 e1 ldi r25, 0x10 ; 16 200ac: 0f 94 6a cd call 0x39ad4 ; 0x39ad4 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 200b0: 10 e0 ldi r17, 0x00 ; 0 200b2: 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); 200b4: 6f ef ldi r22, 0xFF ; 255 200b6: c8 01 movw r24, r16 200b8: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 200bc: c8 01 movw r24, r16 200be: 0f 94 3b cd call 0x39a76 ; 0x39a76 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 200c2: 0f 5f subi r16, 0xFF ; 255 200c4: 1f 4f sbci r17, 0xFF ; 255 200c6: 01 15 cp r16, r1 200c8: f0 e1 ldi r31, 0x10 ; 16 200ca: 1f 07 cpc r17, r31 200cc: 99 f7 brne .-26 ; 0x200b4 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 200ce: 0f 94 5c cd call 0x39ab8 ; 0x39ab8 200d2: e7 cb rjmp .-2098 ; 0x1f8a2 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 200d4: 0e 94 d9 71 call 0xe3b2 ; 0xe3b2 200d8: 6d cf rjmp .-294 ; 0x1ffb4 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 200da: 0e 94 be 67 call 0xcf7c ; 0xcf7c lcd_menu_statistics(); 200de: 0f 94 11 55 call 0x2aa22 ; 0x2aa22 200e2: 68 cf rjmp .-304 ; 0x1ffb4 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 200e4: 0e 94 be 67 call 0xcf7c ; 0xcf7c // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 200e8: 0e 94 d9 71 call 0xe3b2 ; 0xe3b2 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 200ec: 84 e0 ldi r24, 0x04 ; 4 200ee: 0e 94 09 e7 call 0x1ce12 ; 0x1ce12 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); 200f2: 62 e0 ldi r22, 0x02 ; 2 200f4: 8f e5 ldi r24, 0x5F ; 95 200f6: 9f e0 ldi r25, 0x0F ; 15 200f8: 0f 94 d1 dd call 0x3bba2 ; 0x3bba2 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 200fc: 81 e0 ldi r24, 0x01 ; 1 200fe: 0e 94 ac 75 call 0xeb58 ; 0xeb58 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 20102: 11 e0 ldi r17, 0x01 ; 1 20104: 10 93 87 17 sts 0x1787, r17 ; 0x801787 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20108: 61 e0 ldi r22, 0x01 ; 1 2010a: 87 e0 ldi r24, 0x07 ; 7 2010c: 9f e0 ldi r25, 0x0F ; 15 2010e: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 20112: 10 93 88 17 sts 0x1788, r17 ; 0x801788 20116: 61 e0 ldi r22, 0x01 ; 1 20118: 85 ed ldi r24, 0xD5 ; 213 2011a: 9e e0 ldi r25, 0x0E ; 14 2011c: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 20120: 49 cf rjmp .-366 ; 0x1ffb4 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")); 20122: 8b e1 ldi r24, 0x1B ; 27 20124: 9d e6 ldi r25, 0x6D ; 109 20126: 6d cf rjmp .-294 ; 0x20002 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]); 20128: 20 93 f6 04 sts 0x04F6, r18 ; 0x8004f6 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 2012c: 80 91 29 07 lds r24, 0x0729 ; 0x800729 20130: 90 e0 ldi r25, 0x00 ; 0 20132: 28 e0 ldi r18, 0x08 ; 8 20134: 96 95 lsr r25 20136: 87 95 ror r24 20138: 00 97 sbiw r24, 0x00 ; 0 2013a: 11 f0 breq .+4 ; 0x20140 2013c: 21 50 subi r18, 0x01 ; 1 2013e: fa cf rjmp .-12 ; 0x20134 20140: 20 93 f7 04 sts 0x04F7, r18 ; 0x8004f7 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 20144: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 20148: 90 e0 ldi r25, 0x00 ; 0 2014a: 28 e0 ldi r18, 0x08 ; 8 2014c: 96 95 lsr r25 2014e: 87 95 ror r24 20150: 00 97 sbiw r24, 0x00 ; 0 20152: 11 f0 breq .+4 ; 0x20158 20154: 21 50 subi r18, 0x01 ; 1 20156: fa cf rjmp .-12 ; 0x2014c 20158: 20 93 f8 04 sts 0x04F8, r18 ; 0x8004f8 tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 2015c: 80 91 2b 07 lds r24, 0x072B ; 0x80072b 20160: 90 e0 ldi r25, 0x00 ; 0 20162: 28 e0 ldi r18, 0x08 ; 8 20164: 96 95 lsr r25 20166: 87 95 ror r24 20168: 00 97 sbiw r24, 0x00 ; 0 2016a: 11 f0 breq .+4 ; 0x20170 2016c: 21 50 subi r18, 0x01 ; 1 2016e: fa cf rjmp .-12 ; 0x20164 20170: 20 93 f9 04 sts 0x04F9, r18 ; 0x8004f9 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(); 20174: 0e 94 ce f9 call 0x1f39c ; 0x1f39c 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) { } 20178: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 2017a: 82 70 andi r24, 0x02 ; 2 2017c: 0f 94 19 3c call 0x27832 ; 0x27832 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 20180: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20184: 81 60 ori r24, 0x01 ; 1 20186: 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); 2018a: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2018e: 82 60 ori r24, 0x02 ; 2 20190: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #endif #if defined(Z_DIR_PIN) && Z_DIR_PIN > -1 SET_OUTPUT(Z_DIR_PIN); 20194: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20198: 84 60 ori r24, 0x04 ; 4 2019a: 80 93 0a 01 sts 0x010A, r24 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> #endif #if defined(E0_DIR_PIN) && E0_DIR_PIN > -1 SET_OUTPUT(E0_DIR_PIN); 2019e: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 201a2: 80 64 ori r24, 0x40 ; 64 201a4: 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); 201a8: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 201aa: 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); 201ac: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 201ae: 16 9a sbi 0x02, 6 ; 2 #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 201b0: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 201b2: 15 9a sbi 0x02, 5 ; 2 #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 201b4: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 201b6: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 201b8: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 201ba: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 201bc: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 201be: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 201c0: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 201c2: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 201c4: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 201c8: 8b 7f andi r24, 0xFB ; 251 201ca: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 201ce: 9f b7 in r25, 0x3f ; 63 201d0: f8 94 cli 201d2: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 201d6: 84 60 ori r24, 0x04 ; 4 201d8: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 201dc: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 201de: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 201e2: 8f 77 andi r24, 0x7F ; 127 201e4: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 201e8: 9f b7 in r25, 0x3f ; 63 201ea: f8 94 cli 201ec: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 201f0: 80 68 ori r24, 0x80 ; 128 201f2: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 201f6: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 201f8: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 201fa: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 201fc: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 201fe: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 20200: 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(); 20202: 17 9a sbi 0x02, 7 ; 2 20204: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e 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); 20208: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 2020a: 41 98 cbi 0x08, 1 ; 8 #ifdef DEBUG_YSTEP_DUP_PIN SET_OUTPUT(DEBUG_YSTEP_DUP_PIN); WRITE(DEBUG_YSTEP_DUP_PIN,INVERT_Y_STEP_PIN); #endif //DEBUG_YSTEP_DUP_PIN disable_y(); 2020c: 16 9a sbi 0x02, 6 ; 2 2020e: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 20212: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 20214: 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); 20216: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 20218: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 2021a: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 20220: 8f 7e andi r24, 0xEF ; 239 20222: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 2022a: 88 60 ori r24, 0x08 ; 8 2022c: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 20234: 8d 7f andi r24, 0xFD ; 253 20236: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 2023e: 8e 7f andi r24, 0xFE ; 254 20240: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 20248: 8f 73 andi r24, 0x3F ; 63 2024a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 20252: 8f 7c andi r24, 0xCF ; 207 20254: 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< 2025c: 88 7f andi r24, 0xF8 ; 248 2025e: 82 60 ori r24, 0x02 ; 2 20260: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 20264: 80 e0 ldi r24, 0x00 ; 0 20266: 90 e4 ldi r25, 0x40 ; 64 20268: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2026c: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 20270: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 20274: 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; 20278: 10 92 e7 04 sts 0x04E7, r1 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2027c: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> nextAdvanceISR = ADV_NEVER; 20280: 8f ef ldi r24, 0xFF ; 255 20282: 9f ef ldi r25, 0xFF ; 255 20284: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 20288: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> main_Rate = ADV_NEVER; 2028c: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL9main_Rate.lto_priv.494+0x1> 20290: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL9main_Rate.lto_priv.494> current_adv_steps = 0; 20294: 10 92 e1 04 sts 0x04E1, r1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 20298: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 2029c: 81 e0 ldi r24, 0x01 ; 1 2029e: 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(); 202a2: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 202a6: 82 60 ori r24, 0x02 ; 2 202a8: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 202ac: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 202ae: 81 e0 ldi r24, 0x01 ; 1 202b0: 11 11 cpse r17, r1 202b2: 01 c0 rjmp .+2 ; 0x202b6 202b4: 80 e0 ldi r24, 0x00 ; 0 202b6: 80 93 6a 06 sts 0x066A, r24 ; 0x80066a update_mode_profile(); 202ba: 0f 94 bf aa call 0x3557e ; 0x3557e 202be: 0e 94 ce f9 call 0x1f39c ; 0x1f39c 202c2: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 202c4: 82 70 andi r24, 0x02 ; 2 202c6: 0f 94 19 3c call 0x27832 ; 0x27832 setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 202ca: 0f 94 6f cb call 0x396de ; 0x396de // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 202ce: 81 e4 ldi r24, 0x41 ; 65 202d0: 97 e0 ldi r25, 0x07 ; 7 202d2: 0e 94 76 6c call 0xd8ec ; 0xd8ec plan_set_position_curposXYZE(); 202d6: 0f 94 4b b9 call 0x37296 ; 0x37296 // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 202da: b1 10 cpse r11, r1 202dc: 08 c0 rjmp .+16 ; 0x202ee } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 202de: 88 e7 ldi r24, 0x78 ; 120 202e0: 9c e6 ldi r25, 0x6C ; 108 202e2: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 202e6: 8c e2 ldi r24, 0x2C ; 44 202e8: 9c e6 ldi r25, 0x6C ; 108 202ea: 0f 94 04 36 call 0x26c08 ; 0x26c08 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 202ee: 84 e9 ldi r24, 0x94 ; 148 202f0: 9c e0 ldi r25, 0x0C ; 12 202f2: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 202f6: 82 34 cpi r24, 0x42 ; 66 202f8: 59 f4 brne .+22 ; 0x20310 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); 202fa: 6f ef ldi r22, 0xFF ; 255 202fc: 84 e9 ldi r24, 0x94 ; 148 202fe: 9c e0 ldi r25, 0x0C ; 12 20300: 0f 94 d1 dd call 0x3bba2 ; 0x3bba2 // 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); 20304: 85 e9 ldi r24, 0x95 ; 149 20306: 9c e0 ldi r25, 0x0C ; 12 20308: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e lcd_show_fullscreen_message_and_wait_P(kill_msg); 2030c: 0f 94 04 36 call 0x26c08 ; 0x26c08 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 20310: 0f 94 6c 87 call 0x30ed8 ; 0x30ed8 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 20314: 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); 20316: 8b eb ldi r24, 0xBB ; 187 20318: 9f e0 ldi r25, 0x0F ; 15 2031a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2031e: 91 e0 ldi r25, 0x01 ; 1 20320: 81 30 cpi r24, 0x01 ; 1 20322: 09 f0 breq .+2 ; 0x20326 20324: 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; } 20326: 90 93 dd 16 sts 0x16DD, r25 ; 0x8016dd // 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(); 2032a: 81 e0 ldi r24, 0x01 ; 1 2032c: 0f 94 70 81 call 0x302e0 ; 0x302e0 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 20330: 60 e0 ldi r22, 0x00 ; 0 20332: 84 e6 ldi r24, 0x64 ; 100 20334: 9f e0 ldi r25, 0x0F ; 15 20336: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 2033a: 60 e0 ldi r22, 0x00 ; 0 2033c: 86 e6 ldi r24, 0x66 ; 102 2033e: 9f e0 ldi r25, 0x0F ; 15 20340: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 20344: 60 e0 ldi r22, 0x00 ; 0 20346: 88 e6 ldi r24, 0x68 ; 104 20348: 9f e0 ldi r25, 0x0F ; 15 2034a: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 2034e: 60 e0 ldi r22, 0x00 ; 0 20350: 85 e6 ldi r24, 0x65 ; 101 20352: 9f e0 ldi r25, 0x0F ; 15 20354: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 20358: 70 e0 ldi r23, 0x00 ; 0 2035a: 60 e0 ldi r22, 0x00 ; 0 2035c: 8f ef ldi r24, 0xFF ; 255 2035e: 9e e0 ldi r25, 0x0E ; 14 20360: 0e 94 74 77 call 0xeee8 ; 0xeee8 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 20364: 70 e0 ldi r23, 0x00 ; 0 20366: 60 e0 ldi r22, 0x00 ; 0 20368: 85 e0 ldi r24, 0x05 ; 5 2036a: 9f e0 ldi r25, 0x0F ; 15 2036c: 0e 94 74 77 call 0xeee8 ; 0xeee8 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 20370: 70 e0 ldi r23, 0x00 ; 0 20372: 60 e0 ldi r22, 0x00 ; 0 20374: 83 e0 ldi r24, 0x03 ; 3 20376: 9f e0 ldi r25, 0x0F ; 15 20378: 0e 94 74 77 call 0xeee8 ; 0xeee8 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 2037c: 70 e0 ldi r23, 0x00 ; 0 2037e: 60 e0 ldi r22, 0x00 ; 0 20380: 81 e0 ldi r24, 0x01 ; 1 20382: 9f e0 ldi r25, 0x0F ; 15 20384: 0e 94 74 77 call 0xeee8 ; 0xeee8 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 20388: 70 e0 ldi r23, 0x00 ; 0 2038a: 60 e0 ldi r22, 0x00 ; 0 2038c: 83 ed ldi r24, 0xD3 ; 211 2038e: 9e e0 ldi r25, 0x0E ; 14 20390: 0e 94 74 77 call 0xeee8 ; 0xeee8 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 20394: 70 e0 ldi r23, 0x00 ; 0 20396: 60 e0 ldi r22, 0x00 ; 0 20398: 80 ed ldi r24, 0xD0 ; 208 2039a: 9e e0 ldi r25, 0x0E ; 14 2039c: 0e 94 74 77 call 0xeee8 ; 0xeee8 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 203a0: 60 e0 ldi r22, 0x00 ; 0 203a2: 82 ed ldi r24, 0xD2 ; 210 203a4: 9e e0 ldi r25, 0x0E ; 14 203a6: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 203aa: 60 e0 ldi r22, 0x00 ; 0 203ac: 8f ec ldi r24, 0xCF ; 207 203ae: 9e e0 ldi r25, 0x0E ; 14 203b0: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 203b4: 88 ea ldi r24, 0xA8 ; 168 203b6: 9c e0 ldi r25, 0x0C ; 12 203b8: 0f 94 79 7c call 0x2f8f2 ; 0x2f8f2 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 203bc: 81 ea ldi r24, 0xA1 ; 161 203be: 9d e0 ldi r25, 0x0D ; 13 203c0: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 203c4: 8f 3f cpi r24, 0xFF ; 255 203c6: 71 f4 brne .+28 ; 0x203e4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 203c8: 60 e0 ldi r22, 0x00 ; 0 203ca: 81 ea ldi r24, 0xA1 ; 161 203cc: 9d e0 ldi r25, 0x0D ; 13 203ce: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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); 203d2: 88 ef ldi r24, 0xF8 ; 248 203d4: 9f e0 ldi r25, 0x0F ; 15 203d6: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 203da: bc 01 movw r22, r24 203dc: 80 e5 ldi r24, 0x50 ; 80 203de: 9d e0 ldi r25, 0x0D ; 13 203e0: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 203e4: 39 e4 ldi r19, 0x49 ; 73 203e6: c3 2e mov r12, r19 203e8: 3d e0 ldi r19, 0x0D ; 13 203ea: d3 2e mov r13, r19 203ec: 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); 203ee: be 01 movw r22, r28 203f0: 6f 5f subi r22, 0xFF ; 255 203f2: 7f 4f sbci r23, 0xFF ; 255 203f4: 81 2f mov r24, r17 203f6: 0e 94 f4 77 call 0xefe8 ; 0xefe8 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 203fa: ae 01 movw r20, r28 203fc: 4f 5f subi r20, 0xFF ; 255 203fe: 5f 4f sbci r21, 0xFF ; 255 20400: 67 e0 ldi r22, 0x07 ; 7 20402: 70 e0 ldi r23, 0x00 ; 0 20404: c6 01 movw r24, r12 20406: 0e 94 55 77 call 0xeeaa ; 0xeeaa 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++) { 2040a: 1f 5f subi r17, 0xFF ; 255 2040c: ab e0 ldi r26, 0x0B ; 11 2040e: ca 0e add r12, r26 20410: d1 1c adc r13, r1 20412: 18 30 cpi r17, 0x08 ; 8 20414: 61 f7 brne .-40 ; 0x203ee 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)))) 20416: 81 ea ldi r24, 0xA1 ; 161 20418: 9d e0 ldi r25, 0x0D ; 13 2041a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2041e: 0e 94 c4 77 call 0xef88 ; 0xef88 20422: 81 11 cpse r24, r1 20424: 02 c0 rjmp .+4 ; 0x2042a { eeprom_switch_to_next_sheet(); 20426: 0e 94 e6 77 call 0xefcc ; 0xefcc } check_babystep(); 2042a: 0e 94 02 7b call 0xf604 ; 0xf604 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 2042e: 80 e8 ldi r24, 0x80 ; 128 20430: 9c e0 ldi r25, 0x0C ; 12 20432: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 20436: 8f 3f cpi r24, 0xFF ; 255 20438: 41 f4 brne .+16 ; 0x2044a #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); 2043a: 40 e1 ldi r20, 0x10 ; 16 2043c: 50 e0 ldi r21, 0x00 ; 0 2043e: 60 e8 ldi r22, 0x80 ; 128 20440: 7c e0 ldi r23, 0x0C ; 12 20442: 81 ee ldi r24, 0xE1 ; 225 20444: 92 e0 ldi r25, 0x02 ; 2 20446: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a #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); 2044a: 85 e0 ldi r24, 0x05 ; 5 2044c: 9d e0 ldi r25, 0x0D ; 13 2044e: 0f 94 79 7c call 0x2f8f2 ; 0x2f8f2 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 20452: 8d ee ldi r24, 0xED ; 237 20454: 9f e0 ldi r25, 0x0F ; 15 20456: 0f 94 79 7c call 0x2f8f2 ; 0x2f8f2 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 2045a: 81 ef ldi r24, 0xF1 ; 241 2045c: 9f e0 ldi r25, 0x0F ; 15 2045e: 0f 94 79 7c call 0x2f8f2 ; 0x2f8f2 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 20462: 60 e0 ldi r22, 0x00 ; 0 20464: 8e ec ldi r24, 0xCE ; 206 20466: 9e e0 ldi r25, 0x0E ; 14 20468: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 2046c: 61 e0 ldi r22, 0x01 ; 1 2046e: 87 ea ldi r24, 0xA7 ; 167 20470: 9c e0 ldi r25, 0x0C ; 12 20472: 0e 94 8c 77 call 0xef18 ; 0xef18 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 20476: 8e ef ldi r24, 0xFE ; 254 20478: 9f e0 ldi r25, 0x0F ; 15 2047a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2047e: 0e 94 e1 72 call 0xe5c2 ; 0xe5c2 20482: 81 11 cpse r24, r1 20484: 02 c0 rjmp .+4 ; 0x2048a lcd_language(); 20486: 0f 94 5c 27 call 0x24eb8 ; 0x24eb8 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 2048a: 60 e0 ldi r22, 0x00 ; 0 2048c: 8f ea ldi r24, 0xAF ; 175 2048e: 9f e0 ldi r25, 0x0F ; 15 20490: 0e 94 8c 77 call 0xef18 ; 0xef18 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 20494: 86 ea ldi r24, 0xA6 ; 166 20496: 9f e0 ldi r25, 0x0F ; 15 20498: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2049c: 8f 3f cpi r24, 0xFF ; 255 2049e: d9 f4 brne .+54 ; 0x204d6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 204a0: 61 e0 ldi r22, 0x01 ; 1 204a2: 86 ea ldi r24, 0xA6 ; 166 204a4: 9f e0 ldi r25, 0x0F ; 15 204a6: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 204aa: 20 eb ldi r18, 0xB0 ; 176 204ac: c2 2e mov r12, r18 204ae: 2f e0 ldi r18, 0x0F ; 15 204b0: 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); 204b2: 70 e0 ldi r23, 0x00 ; 0 204b4: 60 e0 ldi r22, 0x00 ; 0 204b6: c6 01 movw r24, r12 204b8: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 204bc: b2 e0 ldi r27, 0x02 ; 2 204be: cb 0e add r12, r27 204c0: 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++) { 204c2: ea eb ldi r30, 0xBA ; 186 204c4: ce 16 cp r12, r30 204c6: ef e0 ldi r30, 0x0F ; 15 204c8: de 06 cpc r13, r30 204ca: 99 f7 brne .-26 ; 0x204b2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 204cc: 60 e0 ldi r22, 0x00 ; 0 204ce: 8f ea ldi r24, 0xAF ; 175 204d0: 9f e0 ldi r25, 0x0F ; 15 204d2: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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); 204d6: 60 e0 ldi r22, 0x00 ; 0 204d8: 85 ea ldi r24, 0xA5 ; 165 204da: 9f e0 ldi r25, 0x0F ; 15 204dc: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 204e0: 60 e0 ldi r22, 0x00 ; 0 204e2: 8f e7 ldi r24, 0x7F ; 127 204e4: 9c e0 ldi r25, 0x0C ; 12 204e6: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 204ea: 60 e0 ldi r22, 0x00 ; 0 204ec: 89 e0 ldi r24, 0x09 ; 9 204ee: 9f e0 ldi r25, 0x0F ; 15 204f0: 0e 94 8c 77 call 0xef18 ; 0xef18 } 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); 204f4: 61 e0 ldi r22, 0x01 ; 1 204f6: 8c ea ldi r24, 0xAC ; 172 204f8: 9d e0 ldi r25, 0x0D ; 13 204fa: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 204fe: 63 e0 ldi r22, 0x03 ; 3 20500: 8b ea ldi r24, 0xAB ; 171 20502: 9d e0 ldi r25, 0x0D ; 13 20504: 0e 94 8c 77 call 0xef18 ; 0xef18 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 20508: 63 e0 ldi r22, 0x03 ; 3 2050a: 8a ea ldi r24, 0xAA ; 170 2050c: 9d e0 ldi r25, 0x0D ; 13 2050e: 0e 94 8c 77 call 0xef18 ; 0xef18 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 20512: 61 e0 ldi r22, 0x01 ; 1 20514: 89 ea ldi r24, 0xA9 ; 169 20516: 9d e0 ldi r25, 0x0D ; 13 20518: 0e 94 8c 77 call 0xef18 ; 0xef18 #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 2051c: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 2051e: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 20520: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20524: 8f 7b andi r24, 0xBF ; 191 20526: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 2052a: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 2052e: 80 68 ori r24, 0x80 ; 128 20530: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 20534: 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); 20536: 84 e0 ldi r24, 0x04 ; 4 20538: 80 93 96 02 sts 0x0296, r24 ; 0x800296 void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 2053c: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 2053e: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 20540: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 20542: 50 9a sbi 0x0a, 0 ; 10 20544: 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); 20546: 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); 20548: f5 e0 ldi r31, 0x05 ; 5 2054a: fa 95 dec r31 2054c: f1 f7 brne .-4 ; 0x2054a 2054e: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 20550: 58 98 cbi 0x0b, 0 ; 11 20552: 25 e0 ldi r18, 0x05 ; 5 20554: 2a 95 dec r18 20556: f1 f7 brne .-4 ; 0x20554 20558: 00 00 nop 2055a: 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++) { 2055c: a1 f7 brne .-24 ; 0x20546 WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 2055e: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 20560: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 20562: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 20566: 8c 7f andi r24, 0xFC ; 252 20568: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 2056c: 8c e0 ldi r24, 0x0C ; 12 2056e: 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); 20572: 84 ea ldi r24, 0xA4 ; 164 20574: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 20578: 88 e0 ldi r24, 0x08 ; 8 2057a: 0f 94 f0 3f call 0x27fe0 ; 0x27fe0 2057e: 81 11 cpse r24, r1 20580: 14 c0 rjmp .+40 ; 0x205aa return 1; // send address TWDR = TW_WRITE | (address << 1); 20582: 8a ee ldi r24, 0xEA ; 234 20584: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 20588: 84 e8 ldi r24, 0x84 ; 132 2058a: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2058e: 88 e1 ldi r24, 0x18 ; 24 20590: 0f 94 f0 3f call 0x27fe0 ; 0x27fe0 20594: 81 11 cpse r24, r1 20596: 09 c0 rjmp .+18 ; 0x205aa } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 20598: 84 e9 ldi r24, 0x94 ; 148 2059a: 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)); 2059e: 84 e4 ldi r24, 0x44 ; 68 205a0: 91 e4 ldi r25, 0x41 ; 65 205a2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 205a6: 0f 94 04 36 call 0x26c08 ; 0x26c08 #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 205aa: 02 30 cpi r16, 0x02 ; 2 205ac: 81 f0 breq .+32 ; 0x205ce 205ae: 03 30 cpi r16, 0x03 ; 3 205b0: 09 f4 brne .+2 ; 0x205b4 205b2: 37 c1 rjmp .+622 ; 0x20822 205b4: 01 30 cpi r16, 0x01 ; 1 205b6: b9 f4 brne .+46 ; 0x205e6 //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)); 205b8: 86 e7 ldi r24, 0x76 ; 118 205ba: 93 e4 ldi r25, 0x43 ; 67 205bc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 205c0: 0f 94 04 36 call 0x26c08 ; 0x26c08 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); 205c4: 66 e3 ldi r22, 0x36 ; 54 205c6: 71 e0 ldi r23, 0x01 ; 1 205c8: 8c ee ldi r24, 0xEC ; 236 205ca: 9e e0 ldi r25, 0x0E ; 14 205cc: 0a c0 rjmp .+20 ; 0x205e2 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 205ce: 85 e5 ldi r24, 0x55 ; 85 205d0: 93 e4 ldi r25, 0x43 ; 67 205d2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 205d6: 0f 94 04 36 call 0x26c08 ; 0x26c08 205da: 6e e2 ldi r22, 0x2E ; 46 205dc: 71 e0 ldi r23, 0x01 ; 1 205de: 8e ee ldi r24, 0xEE ; 238 205e0: 9e e0 ldi r25, 0x0E ; 14 205e2: 0f 94 e7 dd call 0x3bbce ; 0x3bbce eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 205e6: f1 10 cpse r15, r1 205e8: 08 c0 rjmp .+16 ; 0x205fa 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 205ea: 8e ed ldi r24, 0xDE ; 222 205ec: 92 e4 ldi r25, 0x42 ; 66 205ee: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 205f2: 0f 94 04 36 call 0x26c08 ; 0x26c08 Config_StoreSettings(); 205f6: 0e 94 c7 83 call 0x1078e ; 0x1078e } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 205fa: 80 e8 ldi r24, 0x80 ; 128 205fc: 0e 94 43 f9 call 0x1f286 ; 0x1f286 20600: 88 23 and r24, r24 20602: c9 f0 breq .+50 ; 0x20636 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 20604: 87 ef ldi r24, 0xF7 ; 247 20606: 9f e0 ldi r25, 0x0F ; 15 20608: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 2060c: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 2060e: 81 30 cpi r24, 0x01 ; 1 20610: 71 f4 brne .+28 ; 0x2062e // 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)) { 20612: 88 e8 ldi r24, 0x88 ; 136 20614: 9f e8 ldi r25, 0x8F ; 143 20616: 0e 94 a6 d2 call 0x1a54c ; 0x1a54c 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); 2061a: 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)) { 2061c: 88 23 and r24, r24 2061e: 39 f0 breq .+14 ; 0x2062e // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 20620: 8c e9 ldi r24, 0x9C ; 156 20622: 92 e4 ldi r25, 0x42 ; 66 20624: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20628: 0f 94 04 36 call 0x26c08 ; 0x26c08 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 2062c: 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); 2062e: 86 ea ldi r24, 0xA6 ; 166 20630: 9c e0 ldi r25, 0x0C ; 12 20632: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 20636: 80 e8 ldi r24, 0x80 ; 128 20638: 9f e8 ldi r25, 0x8F ; 143 2063a: 0e 94 a6 d2 call 0x1a54c ; 0x1a54c 2063e: f8 2e mov r15, r24 20640: 88 23 and r24, r24 20642: 31 f0 breq .+12 ; 0x20650 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 20644: 8f e1 ldi r24, 0x1F ; 31 20646: 0e 94 43 f9 call 0x1f286 ; 0x1f286 2064a: 91 e0 ldi r25, 0x01 ; 1 2064c: f8 2e mov r15, r24 2064e: 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; 20650: 10 e0 ldi r17, 0x00 ; 0 20652: 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)); 20654: f8 01 movw r30, r16 20656: ef 58 subi r30, 0x8F ; 143 20658: f0 47 sbci r31, 0x70 ; 112 2065a: 64 91 lpm r22, Z 2065c: c8 01 movw r24, r16 2065e: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 20662: 0f 5f subi r16, 0xFF ; 255 20664: 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){ 20666: 0a 30 cpi r16, 0x0A ; 10 20668: 11 05 cpc r17, r1 2066a: a1 f7 brne .-24 ; 0x20654 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])); 2066c: e0 e8 ldi r30, 0x80 ; 128 2066e: ff e8 ldi r31, 0x8F ; 143 20670: 65 91 lpm r22, Z+ 20672: 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); 20674: 8a e0 ldi r24, 0x0A ; 10 20676: 90 e0 ldi r25, 0x00 ; 0 20678: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 2067c: e2 e8 ldi r30, 0x82 ; 130 2067e: ff e8 ldi r31, 0x8F ; 143 20680: 65 91 lpm r22, Z+ 20682: 74 91 lpm r23, Z 20684: 8c e0 ldi r24, 0x0C ; 12 20686: 90 e0 ldi r25, 0x00 ; 0 20688: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 2068c: e4 e8 ldi r30, 0x84 ; 132 2068e: ff e8 ldi r31, 0x8F ; 143 20690: 65 91 lpm r22, Z+ 20692: 74 91 lpm r23, Z 20694: 8e e0 ldi r24, 0x0E ; 14 20696: 90 e0 ldi r25, 0x00 ; 0 20698: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 // 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])); 2069c: e6 e8 ldi r30, 0x86 ; 134 2069e: ff e8 ldi r31, 0x8F ; 143 206a0: 65 91 lpm r22, Z+ 206a2: 74 91 lpm r23, Z 206a4: 80 e1 ldi r24, 0x10 ; 16 206a6: 90 e0 ldi r25, 0x00 ; 0 206a8: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 206ac: 8f e5 ldi r24, 0x5F ; 95 206ae: 9f e0 ldi r25, 0x0F ; 15 206b0: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 206b4: 88 23 and r24, r24 206b6: 09 f4 brne .+2 ; 0x206ba 206b8: c1 c0 rjmp .+386 ; 0x2083c // first time run of wizard or service prep lcd_wizard(WizState::Run); 206ba: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 206bc: 0f 94 02 66 call 0x2cc04 ; 0x2cc04 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 206c0: 83 e0 ldi r24, 0x03 ; 3 206c2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 206c6: 81 e0 ldi r24, 0x01 ; 1 206c8: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_clear(); 206cc: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_update(2); 206d0: 82 e0 ldi r24, 0x02 ; 2 206d2: 0e 94 54 6f call 0xdea8 ; 0xdea8 #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 206d6: 60 e0 ldi r22, 0x00 ; 0 206d8: 8e ef ldi r24, 0xFE ; 254 206da: 9e e0 ldi r25, 0x0E ; 14 206dc: 0e 94 8c 77 call 0xef18 ; 0xef18 206e0: 80 93 f4 04 sts 0x04F4, r24 ; 0x8004f4 tmc2130_home_bsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_BSTEPS, 48); 206e4: 60 e3 ldi r22, 0x30 ; 48 206e6: 8d ef ldi r24, 0xFD ; 253 206e8: 9e e0 ldi r25, 0x0E ; 14 206ea: 0e 94 8c 77 call 0xef18 ; 0xef18 206ee: 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); 206f2: 60 e3 ldi r22, 0x30 ; 48 206f4: 8c ef ldi r24, 0xFC ; 252 206f6: 9e e0 ldi r25, 0x0E ; 14 206f8: 0e 94 8c 77 call 0xef18 ; 0xef18 206fc: 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); 20700: 60 e0 ldi r22, 0x00 ; 0 20702: 8b ef ldi r24, 0xFB ; 251 20704: 9e e0 ldi r25, 0x0E ; 14 20706: 0e 94 8c 77 call 0xef18 ; 0xef18 2070a: 80 93 f5 04 sts 0x04F5, r24 ; 0x8004f5 tmc2130_home_bsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_BSTEPS, 48); 2070e: 60 e3 ldi r22, 0x30 ; 48 20710: 8a ef ldi r24, 0xFA ; 250 20712: 9e e0 ldi r25, 0x0E ; 14 20714: 0e 94 8c 77 call 0xef18 ; 0xef18 20718: 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); 2071c: 60 e3 ldi r22, 0x30 ; 48 2071e: 89 ef ldi r24, 0xF9 ; 249 20720: 9e e0 ldi r25, 0x0E ; 14 20722: 0e 94 8c 77 call 0xef18 ; 0xef18 20726: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 2072a: 60 e0 ldi r22, 0x00 ; 0 2072c: 88 ef ldi r24, 0xF8 ; 248 2072e: 9e e0 ldi r25, 0x0E ; 14 20730: 0e 94 8c 77 call 0xef18 ; 0xef18 20734: 80 93 f3 04 sts 0x04F3, r24 ; 0x8004f3 static void fw_crash_init() { #ifdef XFLASH_DUMP dump_crash_reason crash_reason; if(xfdump_check_state(&crash_reason)) 20738: ce 01 movw r24, r28 2073a: 01 96 adiw r24, 0x01 ; 1 2073c: 0e 94 7f e3 call 0x1c6fe ; 0x1c6fe 20740: 88 23 and r24, r24 20742: 89 f0 breq .+34 ; 0x20766 { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 20744: 83 e0 ldi r24, 0x03 ; 3 20746: 9d e6 ldi r25, 0x6D ; 109 20748: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 2074c: 89 81 ldd r24, Y+1 ; 0x01 2074e: 88 23 and r24, r24 20750: 51 f0 breq .+20 ; 0x20766 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 20752: 83 e0 ldi r24, 0x03 ; 3 20754: 9d e0 ldi r25, 0x0D ; 13 20756: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 { // 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 && 2075a: 8f 3f cpi r24, 0xFF ; 255 2075c: 21 f0 breq .+8 ; 0x20766 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 2075e: 8f e8 ldi r24, 0x8F ; 143 20760: 9c e6 ldi r25, 0x6C ; 108 20762: 0f 94 04 36 call 0x26c08 ; 0x26c08 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20766: 6f ef ldi r22, 0xFF ; 255 20768: 83 e0 ldi r24, 0x03 ; 3 2076a: 9d e0 ldi r25, 0x0D ; 13 2076c: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 20770: 0e 94 28 68 call 0xd050 ; 0xd050 20774: 88 23 and r24, r24 20776: d9 f1 breq .+118 ; 0x207ee manage_heater(); // Update temperatures 20778: 0f 94 98 4e call 0x29d30 ; 0x29d30 //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 2077c: 8c e8 ldi r24, 0x8C ; 140 2077e: 9f e0 ldi r25, 0x0F ; 15 20780: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 20784: 08 2f mov r16, r24 20786: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 2078a: 80 90 ef 04 lds r8, 0x04EF ; 0x8004ef 2078e: 90 90 f0 04 lds r9, 0x04F0 ; 0x8004f0 20792: a0 90 f1 04 lds r10, 0x04F1 ; 0x8004f1 20796: b0 90 f2 04 lds r11, 0x04F2 ; 0x8004f2 #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)); 2079a: 8b e8 ldi r24, 0x8B ; 139 2079c: 9f e0 ldi r25, 0x0F ; 15 2079e: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 207a2: 68 2f mov r22, r24 207a4: 70 e0 ldi r23, 0x00 ; 0 207a6: 90 e0 ldi r25, 0x00 ; 0 207a8: 80 e0 ldi r24, 0x00 ; 0 207aa: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 207ae: 20 e0 ldi r18, 0x00 ; 0 207b0: 30 e0 ldi r19, 0x00 ; 0 207b2: 40 ea ldi r20, 0xA0 ; 160 207b4: 50 e4 ldi r21, 0x40 ; 64 207b6: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 207ba: 6b 01 movw r12, r22 207bc: 7c 01 movw r14, r24 207be: 11 e0 ldi r17, 0x01 ; 1 207c0: ac 01 movw r20, r24 207c2: 9b 01 movw r18, r22 207c4: c5 01 movw r24, r10 207c6: b4 01 movw r22, r8 207c8: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 207cc: 18 16 cp r1, r24 207ce: 0c f0 brlt .+2 ; 0x207d2 207d0: 10 e0 ldi r17, 0x00 ; 0 207d2: 10 93 ee 04 sts 0x04EE, r17 ; 0x8004ee <_ZL24uvlo_auto_recovery_ready.lto_priv.552> if (uvlo_auto_recovery_ready){ 207d6: a7 01 movw r20, r14 207d8: 96 01 movw r18, r12 207da: c5 01 movw r24, r10 207dc: b4 01 movw r22, r8 207de: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 207e2: 18 16 cp r1, r24 207e4: 0c f0 brlt .+2 ; 0x207e8 207e6: 58 c0 rjmp .+176 ; 0x20898 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 207e8: 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); 207ea: 0f 94 f9 d2 call 0x3a5f2 ; 0x3a5f2 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 207ee: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 207f0: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 207f2: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 207f6: 81 60 ori r24, 0x01 ; 1 207f8: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 207fc: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20800: 8d 7f andi r24, 0xFD ; 253 20802: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 20806: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 20808: 64 99 sbic 0x0c, 4 ; 12 2080a: 57 c0 rjmp .+174 ; 0x208ba 2080c: 0e 94 28 68 call 0xd050 ; 0xd050 20810: 88 23 and r24, r24 20812: 09 f4 brne .+2 ; 0x20816 20814: 52 c0 rjmp .+164 ; 0x208ba { SERIAL_ECHOLNRPGM(MSG_INT4); 20816: 8b e7 ldi r24, 0x7B ; 123 20818: 9f e8 ldi r25, 0x8F ; 143 2081a: 0e 94 fe 7a call 0xf5fc ; 0xf5fc uvlo_drain_reset(); 2081e: 0f 94 32 aa call 0x35464 ; 0x35464 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)); 20822: 8a e1 ldi r24, 0x1A ; 26 20824: 93 e4 ldi r25, 0x43 ; 67 20826: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2082a: 0f 94 04 36 call 0x26c08 ; 0x26c08 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); 2082e: 6e e2 ldi r22, 0x2E ; 46 20830: 71 e0 ldi r23, 0x01 ; 1 20832: 8e ee ldi r24, 0xEE ; 238 20834: 9e e0 ldi r25, 0x0E ; 14 20836: 0f 94 e7 dd call 0x3bbce ; 0x3bbce 2083a: c4 ce rjmp .-632 ; 0x205c4 // 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); 2083c: 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) { 2083e: f1 10 cpse r15, r1 20840: 3d cf rjmp .-390 ; 0x206bc // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 20842: 0e 94 43 f9 call 0x1f286 ; 0x1f286 20846: 81 11 cpse r24, r1 20848: 07 c0 rjmp .+14 ; 0x20858 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 2084a: 8c e2 ldi r24, 0x2C ; 44 2084c: 92 e4 ldi r25, 0x42 ; 66 // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 2084e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20852: 0f 94 04 36 call 0x26c08 ; 0x26c08 20856: 34 cf rjmp .-408 ; 0x206c0 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)) { 20858: 84 e0 ldi r24, 0x04 ; 4 2085a: 0e 94 43 f9 call 0x1f286 ; 0x1f286 2085e: 81 11 cpse r24, r1 20860: 03 c0 rjmp .+6 ; 0x20868 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 20862: 84 eb ldi r24, 0xB4 ; 180 20864: 91 e4 ldi r25, 0x41 ; 65 20866: f3 cf rjmp .-26 ; 0x2084e } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 20868: 80 e1 ldi r24, 0x10 ; 16 2086a: 0e 94 43 f9 call 0x1f286 ; 0x1f286 2086e: 81 11 cpse r24, r1 20870: 06 c0 rjmp .+12 ; 0x2087e lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 20872: 8c e8 ldi r24, 0x8C ; 140 20874: 97 e4 ldi r25, 0x47 ; 71 20876: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2087a: 0f 94 04 36 call 0x26c08 ; 0x26c08 #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 2087e: 88 e0 ldi r24, 0x08 ; 8 20880: 0e 94 43 f9 call 0x1f286 ; 0x1f286 20884: 81 11 cpse r24, r1 20886: 1c cf rjmp .-456 ; 0x206c0 20888: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> 2088c: 88 23 and r24, r24 2088e: 09 f4 brne .+2 ; 0x20892 20890: 17 cf rjmp .-466 ; 0x206c0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 20892: 80 e9 ldi r24, 0x90 ; 144 20894: 91 e4 ldi r25, 0x41 ; 65 20896: db cf rjmp .-74 ; 0x2084e 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) { 20898: 01 30 cpi r16, 0x01 ; 1 2089a: 11 f4 brne .+4 ; 0x208a0 recover_print(0); 2089c: 80 e0 ldi r24, 0x00 ; 0 2089e: a5 cf rjmp .-182 ; 0x207ea } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 208a0: 8c e6 ldi r24, 0x6C ; 108 208a2: 91 e4 ldi r25, 0x41 ; 65 208a4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 208a8: 41 e0 ldi r20, 0x01 ; 1 208aa: 60 e0 ldi r22, 0x00 ; 0 208ac: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 if ( btn == LCD_LEFT_BUTTON_CHOICE) { 208b0: 88 23 and r24, r24 208b2: a1 f3 breq .-24 ; 0x2089c recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 208b4: 0e 94 5a 65 call 0xcab4 ; 0xcab4 208b8: 9a cf rjmp .-204 ; 0x207ee ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 208ba: 61 e0 ldi r22, 0x01 ; 1 208bc: 88 ea ldi r24, 0xA8 ; 168 208be: 9d e0 ldi r25, 0x0D ; 13 208c0: 0e 94 8c 77 call 0xef18 ; 0xef18 208c4: 80 93 ed 04 sts 0x04ED, r24 ; 0x8004ed 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); 208c8: 68 e2 ldi r22, 0x28 ; 40 208ca: 87 ea ldi r24, 0xA7 ; 167 208cc: 9d e0 ldi r25, 0x0D ; 13 208ce: 0e 94 8c 77 call 0xef18 ; 0xef18 208d2: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 208d6: 60 e9 ldi r22, 0x90 ; 144 208d8: 71 e0 ldi r23, 0x01 ; 1 208da: 85 ea ldi r24, 0xA5 ; 165 208dc: 9d e0 ldi r25, 0x0D ; 13 208de: 0e 94 74 77 call 0xeee8 ; 0xeee8 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 208e2: 61 e0 ldi r22, 0x01 ; 1 208e4: 84 ea ldi r24, 0xA4 ; 164 208e6: 9d e0 ldi r25, 0x0D ; 13 208e8: 0e 94 8c 77 call 0xef18 ; 0xef18 208ec: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 208f0: 61 e0 ldi r22, 0x01 ; 1 208f2: 83 ea ldi r24, 0xA3 ; 163 208f4: 9d e0 ldi r25, 0x0D ; 13 208f6: 0e 94 8c 77 call 0xef18 ; 0xef18 208fa: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 208fe: 61 e0 ldi r22, 0x01 ; 1 20900: 82 ea ldi r24, 0xA2 ; 162 20902: 9d e0 ldi r25, 0x0D ; 13 20904: 0e 94 8c 77 call 0xef18 ; 0xef18 20908: 80 93 e9 04 sts 0x04E9, r24 ; 0x8004e9 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 2090c: 61 e0 ldi r22, 0x01 ; 1 2090e: 80 e2 ldi r24, 0x20 ; 32 20910: 9c e0 ldi r25, 0x0C ; 12 20912: 0e 94 8c 77 call 0xef18 ; 0xef18 20916: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 2091a: 81 e0 ldi r24, 0x01 ; 1 2091c: 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" ); 20920: 88 e1 ldi r24, 0x18 ; 24 20922: 98 e2 ldi r25, 0x28 ; 40 20924: 0f b6 in r0, 0x3f ; 63 20926: f8 94 cli 20928: a8 95 wdr 2092a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2092e: 0f be out 0x3f, r0 ; 63 20930: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 20934: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 20938: 80 64 ori r24, 0x40 ; 64 2093a: 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; 2093e: 85 e0 ldi r24, 0x05 ; 5 20940: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 20942: 00 e0 ldi r16, 0x00 ; 0 20944: 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); 20946: cc 24 eor r12, r12 20948: 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); 2094a: 94 e0 ldi r25, 0x04 ; 4 2094c: 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; 2094e: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b if(Stopped) { 20952: 80 91 12 05 lds r24, 0x0512 ; 0x800512 20956: 88 23 and r24, r24 20958: 09 f4 brne .+2 ; 0x2095c 2095a: c4 c0 rjmp .+392 ; 0x20ae4 // 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); 2095c: 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. 20960: 0e 94 32 68 call 0xd064 ; 0xd064 20964: 88 23 and r24, r24 20966: 09 f4 brne .+2 ; 0x2096a 20968: c0 c0 rjmp .+384 ; 0x20aea 2096a: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2096e: 81 30 cpi r24, 0x01 ; 1 20970: 09 f0 breq .+2 ; 0x20974 20972: bb c0 rjmp .+374 ; 0x20aea usb_timer.start(); 20974: 8f e0 ldi r24, 0x0F ; 15 20976: 95 e0 ldi r25, 0x05 ; 5 20978: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> } else #endif { get_command(); 2097c: 0e 94 43 84 call 0x10886 ; 0x10886 // 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) 20980: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.572> 20984: 88 23 and r24, r24 20986: 89 f0 breq .+34 ; 0x209aa return; if(autostart_atmillis.expired(5000)) 20988: 68 e8 ldi r22, 0x88 ; 136 2098a: 73 e1 ldi r23, 0x13 ; 19 2098c: 8d e7 ldi r24, 0x7D ; 125 2098e: 97 e1 ldi r25, 0x17 ; 23 20990: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 20994: 81 11 cpse r24, r1 20996: 09 c0 rjmp .+18 ; 0x209aa return; } autostart_stilltocheck = false; 20998: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.572> if(!mounted) 2099c: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 209a0: 88 23 and r24, r24 209a2: 09 f4 brne .+2 ; 0x209a6 209a4: ae c0 rjmp .+348 ; 0x20b02 209a6: 0f 94 d3 77 call 0x2efa6 ; 0x2efa6 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 209aa: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 209ae: 90 91 80 10 lds r25, 0x1080 ; 0x801080 209b2: 89 2b or r24, r25 209b4: 09 f4 brne .+2 ; 0x209b8 209b6: 61 c0 rjmp .+194 ; 0x20a7a { cmdbuffer_front_already_processed = false; 209b8: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e #ifdef SDSUPPORT if(card.saving) 209bc: 80 91 6a 14 lds r24, 0x146A ; 0x80146a 209c0: 88 23 and r24, r24 209c2: d1 f1 breq .+116 ; 0x20a38 { // 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) { 209c4: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 209c8: 90 91 6f 12 lds r25, 0x126F ; 0x80126f 209cc: dc 01 movw r26, r24 209ce: ac 57 subi r26, 0x7C ; 124 209d0: bf 4e sbci r27, 0xEF ; 239 209d2: 7d 01 movw r14, r26 209d4: 69 e2 ldi r22, 0x29 ; 41 209d6: 70 e9 ldi r23, 0x90 ; 144 209d8: cd 01 movw r24, r26 209da: 0f 94 90 db call 0x3b720 ; 0x3b720 209de: 89 2b or r24, r25 209e0: 09 f0 breq .+2 ; 0x209e4 209e2: 9c c0 rjmp .+312 ; 0x20b1c else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 209e4: 10 92 fc 16 sts 0x16FC, r1 ; 0x8016fc /** 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)); 209e8: f7 01 movw r30, r14 209ea: 01 90 ld r0, Z+ 209ec: 00 20 and r0, r0 209ee: e9 f7 brne .-6 ; 0x209ea 209f0: 31 97 sbiw r30, 0x01 ; 1 209f2: bf 01 movw r22, r30 209f4: 6e 19 sub r22, r14 209f6: 7f 09 sbc r23, r15 209f8: c7 01 movw r24, r14 209fa: 0f 94 0e 84 call 0x3081c ; 0x3081c 209fe: 62 e0 ldi r22, 0x02 ; 2 20a00: 70 e0 ldi r23, 0x00 ; 0 20a02: 81 ef ldi r24, 0xF1 ; 241 20a04: 92 e0 ldi r25, 0x02 ; 2 20a06: 0f 94 0e 84 call 0x3081c ; 0x3081c file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 20a0a: 80 91 fc 16 lds r24, 0x16FC ; 0x8016fc 20a0e: 88 23 and r24, r24 20a10: 41 f0 breq .+16 ; 0x20a22 { SERIAL_ERROR_START; 20a12: 8a eb ldi r24, 0xBA ; 186 20a14: 99 ea ldi r25, 0xA9 ; 169 20a16: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 20a1a: 82 ee ldi r24, 0xE2 ; 226 20a1c: 9d e6 ldi r25, 0x6D ; 109 20a1e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 20a22: 80 91 6b 14 lds r24, 0x146B ; 0x80146b 20a26: 88 23 and r24, r24 20a28: 09 f4 brne .+2 ; 0x20a2c 20a2a: 73 c0 rjmp .+230 ; 0x20b12 */ void process_commands() { if (!buflen) return; //empty command 20a2c: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 20a30: 90 91 80 10 lds r25, 0x1080 ; 0x801080 20a34: 89 2b or r24, r25 20a36: 11 f0 breq .+4 ; 0x20a3c 20a38: 0e 94 20 97 call 0x12e40 ; 0x12e40 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 20a3c: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 20a40: 81 11 cpse r24, r1 20a42: 19 c0 rjmp .+50 ; 0x20a76 20a44: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 20a48: 90 91 80 10 lds r25, 0x1080 ; 0x801080 20a4c: 89 2b or r24, r25 20a4e: 99 f0 breq .+38 ; 0x20a76 { // 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; 20a50: e0 91 6e 12 lds r30, 0x126E ; 0x80126e 20a54: f0 91 6f 12 lds r31, 0x126F ; 0x80126f 20a58: ef 57 subi r30, 0x7F ; 127 20a5a: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 20a5c: 80 81 ld r24, Z 20a5e: 82 30 cpi r24, 0x02 ; 2 20a60: 09 f0 breq .+2 ; 0x20a64 20a62: 6b c0 rjmp .+214 ; 0x20b3a { // 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(); 20a64: 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; 20a66: 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); 20a68: 81 81 ldd r24, Z+1 ; 0x01 20a6a: 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); 20a6c: 0f 94 64 aa call 0x354c8 ; 0x354c8 sei(); 20a70: 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(); 20a72: 0e 94 3f 78 call 0xf07e ; 0xf07e } host_keepalive(); 20a76: 0e 94 2a 81 call 0x10254 ; 0x10254 } } //check heater every n milliseconds manage_heater(); 20a7a: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(printingIsPaused()); 20a7e: 0e 94 32 68 call 0xd064 ; 0xd064 20a82: 0e 94 da 8b call 0x117b4 ; 0x117b4 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 20a86: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZL11endstop_hit.lto_priv.496> 20a8a: 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; 20a8c: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZL11endstop_hit.lto_priv.496> checkHitEndstops(); lcd_update(0); 20a90: 80 e0 ldi r24, 0x00 ; 0 20a92: 0e 94 54 6f call 0xdea8 ; 0xdea8 #ifdef TMC2130 tmc2130_check_overtemp(); 20a96: 0f 94 1e 40 call 0x2803c ; 0x2803c if (tmc2130_sg_crash) 20a9a: 80 91 0e 05 lds r24, 0x050E ; 0x80050e 20a9e: 88 23 and r24, r24 20aa0: 79 f0 breq .+30 ; 0x20ac0 { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 20aa2: 10 92 0e 05 sts 0x050E, r1 ; 0x80050e // crashdet_stop_and_save_print(); switch (crash) 20aa6: 82 30 cpi r24, 0x02 ; 2 20aa8: 09 f4 brne .+2 ; 0x20aac 20aaa: 53 c0 rjmp .+166 ; 0x20b52 20aac: 83 30 cpi r24, 0x03 ; 3 20aae: 09 f4 brne .+2 ; 0x20ab2 20ab0: 54 c0 rjmp .+168 ; 0x20b5a 20ab2: 81 30 cpi r24, 0x01 ; 1 20ab4: 29 f4 brne .+10 ; 0x20ac0 { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 20ab6: 61 e0 ldi r22, 0x01 ; 1 20ab8: 89 e1 ldi r24, 0x19 ; 25 20aba: 90 e9 ldi r25, 0x90 ; 144 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20abc: 0e 94 43 89 call 0x11286 ; 0x11286 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) { 20ac0: 80 91 0d 05 lds r24, 0x050D ; 0x80050d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> 20ac4: 81 11 cpse r24, r1 20ac6: 07 c0 rjmp .+14 ; 0x20ad6 return; } avoidRecursion = true; 20ac8: c0 92 0d 05 sts 0x050D, r12 ; 0x80050d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> mmu_loop_inner(true); 20acc: 81 e0 ldi r24, 0x01 ; 1 20ace: 0f 94 26 9a call 0x3344c ; 0x3344c avoidRecursion = false; 20ad2: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> 20ad6: 01 15 cp r16, r1 20ad8: 11 05 cpc r17, r1 20ada: 09 f4 brne .+2 ; 0x20ade 20adc: 38 cf rjmp .-400 ; 0x2094e 20ade: 0e 94 00 00 call 0 ; 0x0 <__vectors> 20ae2: 35 cf rjmp .-406 ; 0x2094e // 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); 20ae4: c0 92 96 02 sts 0x0296, r12 ; 0x800296 20ae8: 3b cf rjmp .-394 ; 0x20960 } 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. 20aea: 60 e1 ldi r22, 0x10 ; 16 20aec: 77 e2 ldi r23, 0x27 ; 39 20aee: 8f e0 ldi r24, 0x0F ; 15 20af0: 95 e0 ldi r25, 0x05 ; 5 20af2: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 20af6: 88 23 and r24, r24 20af8: 09 f4 brne .+2 ; 0x20afc 20afa: 40 cf rjmp .-384 ; 0x2097c } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 20afc: b0 92 65 0e sts 0x0E65, r11 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 20b00: 3d cf rjmp .-390 ; 0x2097c return; } autostart_stilltocheck = false; if(!mounted) { mount(); 20b02: 81 e0 ldi r24, 0x01 ; 1 20b04: 0f 94 70 81 call 0x302e0 ; 0x302e0 if(!mounted) //fail 20b08: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 20b0c: 81 11 cpse r24, r1 20b0e: 4b cf rjmp .-362 ; 0x209a6 20b10: 4c cf rjmp .-360 ; 0x209aa 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); 20b12: 8a e0 ldi r24, 0x0A ; 10 20b14: 9e e6 ldi r25, 0x6E ; 110 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 20b16: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 20b1a: 90 cf rjmp .-224 ; 0x20a3c lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20b1c: 8c ef ldi r24, 0xFC ; 252 20b1e: 96 e1 ldi r25, 0x16 ; 22 20b20: 0f 94 74 6e call 0x2dce8 ; 0x2dce8 file.close(); 20b24: 8c ef ldi r24, 0xFC ; 252 20b26: 96 e1 ldi r25, 0x16 ; 22 20b28: 0f 94 6c a4 call 0x348d8 ; 0x348d8 saving = false; 20b2c: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a logging = false; 20b30: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b 20b34: 88 ef ldi r24, 0xF8 ; 248 20b36: 9d e6 ldi r25, 0x6D ; 109 20b38: ee cf rjmp .-36 ; 0x20b16 // 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){ 20b3a: 86 30 cpi r24, 0x06 ; 6 20b3c: 09 f0 breq .+2 ; 0x20b40 20b3e: 99 cf rjmp .-206 ; 0x20a72 20b40: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 20b44: 81 11 cpse r24, r1 20b46: 95 cf rjmp .-214 ; 0x20a72 cli(); 20b48: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 20b4a: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 20b4c: 81 e0 ldi r24, 0x01 ; 1 20b4e: 90 e0 ldi r25, 0x00 ; 0 20b50: 8d cf rjmp .-230 ; 0x20a6c 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; 20b52: 61 e0 ldi r22, 0x01 ; 1 20b54: 89 e0 ldi r24, 0x09 ; 9 20b56: 90 e9 ldi r25, 0x90 ; 144 20b58: b1 cf rjmp .-158 ; 0x20abc case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20b5a: 61 e0 ldi r22, 0x01 ; 1 20b5c: 88 ef ldi r24, 0xF8 ; 248 20b5e: 9f e8 ldi r25, 0x8F ; 143 20b60: ad cf rjmp .-166 ; 0x20abc { 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; 20b62: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 20b64: 86 33 cpi r24, 0x36 ; 54 20b66: 91 40 sbci r25, 0x01 ; 1 20b68: 09 f0 breq .+2 ; 0x20b6c 20b6a: 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(); 20b6c: 0e 94 af 83 call 0x1075e ; 0x1075e 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; 20b70: 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; 20b72: 82 ea ldi r24, 0xA2 ; 162 20b74: 92 ea ldi r25, 0xA2 ; 162 20b76: a0 e0 ldi r26, 0x00 ; 0 20b78: b0 e0 ldi r27, 0x00 ; 0 20b7a: 80 93 37 18 sts 0x1837, r24 ; 0x801837 <__bss_end+0x20> 20b7e: 90 93 38 18 sts 0x1838, r25 ; 0x801838 <__bss_end+0x21> 20b82: a0 93 39 18 sts 0x1839, r26 ; 0x801839 <__bss_end+0x22> 20b86: b0 93 3a 18 sts 0x183A, r27 ; 0x80183a <__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; 20b8a: 10 92 ab 04 sts 0x04AB, r1 ; 0x8004ab <_ZL14iState_sum_min.lto_priv.483> 20b8e: 10 92 ac 04 sts 0x04AC, r1 ; 0x8004ac <_ZL14iState_sum_min.lto_priv.483+0x1> 20b92: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL14iState_sum_min.lto_priv.483+0x2> 20b96: 10 92 ae 04 sts 0x04AE, r1 ; 0x8004ae <_ZL14iState_sum_min.lto_priv.483+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 20b9a: 20 91 d8 06 lds r18, 0x06D8 ; 0x8006d8 20b9e: 30 91 d9 06 lds r19, 0x06D9 ; 0x8006d9 20ba2: 40 91 da 06 lds r20, 0x06DA ; 0x8006da 20ba6: 50 91 db 06 lds r21, 0x06DB ; 0x8006db 20baa: 60 e0 ldi r22, 0x00 ; 0 20bac: 70 e0 ldi r23, 0x00 ; 0 20bae: 8f e7 ldi r24, 0x7F ; 127 20bb0: 93 e4 ldi r25, 0x43 ; 67 20bb2: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 20bb6: 60 93 a7 04 sts 0x04A7, r22 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.484> 20bba: 70 93 a8 04 sts 0x04A8, r23 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.484+0x1> 20bbe: 80 93 a9 04 sts 0x04A9, r24 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.484+0x2> 20bc2: 90 93 aa 04 sts 0x04AA, r25 ; 0x8004aa <_ZL14iState_sum_max.lto_priv.484+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 20bc6: 10 92 a3 04 sts 0x04A3, r1 ; 0x8004a3 <_ZL19temp_iState_min_bed.lto_priv.481> 20bca: 10 92 a4 04 sts 0x04A4, r1 ; 0x8004a4 <_ZL19temp_iState_min_bed.lto_priv.481+0x1> 20bce: 10 92 a5 04 sts 0x04A5, r1 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.481+0x2> 20bd2: 10 92 a6 04 sts 0x04A6, r1 ; 0x8004a6 <_ZL19temp_iState_min_bed.lto_priv.481+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 20bd6: 20 91 e4 06 lds r18, 0x06E4 ; 0x8006e4 20bda: 30 91 e5 06 lds r19, 0x06E5 ; 0x8006e5 20bde: 40 91 e6 06 lds r20, 0x06E6 ; 0x8006e6 20be2: 50 91 e7 06 lds r21, 0x06E7 ; 0x8006e7 20be6: 60 e0 ldi r22, 0x00 ; 0 20be8: 70 e0 ldi r23, 0x00 ; 0 20bea: 8f e7 ldi r24, 0x7F ; 127 20bec: 93 e4 ldi r25, 0x43 ; 67 20bee: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 20bf2: 60 93 9f 04 sts 0x049F, r22 ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.482> 20bf6: 70 93 a0 04 sts 0x04A0, r23 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.482+0x1> 20bfa: 80 93 a1 04 sts 0x04A1, r24 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.482+0x2> 20bfe: 90 93 a2 04 sts 0x04A2, r25 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.482+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 20c02: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20c04: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20c06: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20c0a: 88 60 ori r24, 0x08 ; 8 20c0c: 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)); 20c10: 80 91 9e 04 lds r24, 0x049E ; 0x80049e 20c14: 90 e0 ldi r25, 0x00 ; 0 20c16: b4 e0 ldi r27, 0x04 ; 4 20c18: 95 95 asr r25 20c1a: 87 95 ror r24 20c1c: ba 95 dec r27 20c1e: e1 f7 brne .-8 ; 0x20c18 20c20: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d <_ZL12soft_pwm_fan.lto_priv.475> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 20c24: 8a e0 ldi r24, 0x0A ; 10 20c26: 90 e0 ldi r25, 0x00 ; 0 20c28: 90 93 9c 04 sts 0x049C, r25 ; 0x80049c <_ZL8minttemp.lto_priv.476+0x1> 20c2c: 80 93 9b 04 sts 0x049B, r24 ; 0x80049b <_ZL8minttemp.lto_priv.476> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20c30: c0 90 54 02 lds r12, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.487> 20c34: d0 90 55 02 lds r13, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.487+0x1> 20c38: c6 01 movw r24, r12 20c3a: 0e 94 86 da call 0x1b50c ; 0x1b50c 20c3e: 20 e0 ldi r18, 0x00 ; 0 20c40: 30 e0 ldi r19, 0x00 ; 0 20c42: 40 e2 ldi r20, 0x20 ; 32 20c44: 51 e4 ldi r21, 0x41 ; 65 20c46: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 20c4a: 87 fd sbrc r24, 7 20c4c: 02 c0 rjmp .+4 ; 0x20c52 20c4e: 0c 94 78 fd jmp 0x1faf0 ; 0x1faf0 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20c52: e0 e1 ldi r30, 0x10 ; 16 20c54: ce 1a sub r12, r30 20c56: d1 08 sbc r13, r1 20c58: d0 92 55 02 sts 0x0255, r13 ; 0x800255 <_ZL12minttemp_raw.lto_priv.487+0x1> 20c5c: c0 92 54 02 sts 0x0254, r12 ; 0x800254 <_ZL12minttemp_raw.lto_priv.487> 20c60: e7 cf rjmp .-50 ; 0x20c30 00020c62 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20c62: 0f 94 08 cf call 0x39e10 ; 0x39e10 20c66: 10 92 13 05 sts 0x0513, r1 ; 0x800513 20c6a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 20c6e: 84 30 cpi r24, 0x04 ; 4 20c70: 08 f0 brcs .+2 ; 0x20c74 20c72: 41 c0 rjmp .+130 ; 0x20cf6 20c74: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_BACK)); 20c78: 89 e1 ldi r24, 0x19 ; 25 20c7a: 90 e4 ldi r25, 0x40 ; 64 20c7c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20c80: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 eeprom_update_byte_notify((uint8_t *)EEPROM_ALTFAN_OVERRIDE, altfanStatus.altfanOverride); } bool altfanOverride_get() { return altfanStatus.altfanOverride; 20c84: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> #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 20c88: 81 ff sbrs r24, 1 20c8a: 2f c0 rjmp .+94 ; 0x20cea 20c8c: 82 e4 ldi r24, 0x42 ; 66 20c8e: 9d e5 ldi r25, 0x5D ; 93 20c90: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20c94: 22 e0 ldi r18, 0x02 ; 2 20c96: 40 ee ldi r20, 0xE0 ; 224 20c98: 5c e5 ldi r21, 0x5C ; 92 20c9a: bc 01 movw r22, r24 20c9c: 89 ef ldi r24, 0xF9 ; 249 20c9e: 9b e6 ldi r25, 0x6B ; 107 20ca0: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #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 20ca4: 0e 94 ce f9 call 0x1f39c ; 0x1f39c 20ca8: 88 23 and r24, r24 20caa: 11 f1 breq .+68 ; 0x20cf0 20cac: 88 e4 ldi r24, 0x48 ; 72 20cae: 9d e5 ldi r25, 0x5D ; 93 20cb0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20cb4: 22 e0 ldi r18, 0x02 ; 2 20cb6: 41 ea ldi r20, 0xA1 ; 161 20cb8: 5a e3 ldi r21, 0x3A ; 58 20cba: bc 01 movw r22, r24 20cbc: 8d ee ldi r24, 0xED ; 237 20cbe: 9b e6 ldi r25, 0x6B ; 107 20cc0: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #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 20cc4: 65 e6 ldi r22, 0x65 ; 101 20cc6: 72 ed ldi r23, 0xD2 ; 210 20cc8: 8a ed ldi r24, 0xDA ; 218 20cca: 9b e6 ldi r25, 0x6B ; 107 20ccc: 0f 94 85 ce call 0x39d0a ; 0x39d0a #endif //PRUSA_SN_SUPPORT MENU_END(); 20cd0: 0f 94 dc ce call 0x39db8 ; 0x39db8 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20cd4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 20cd8: 8f 5f subi r24, 0xFF ; 255 20cda: 80 93 13 05 sts 0x0513, r24 ; 0x800513 20cde: 80 91 15 05 lds r24, 0x0515 ; 0x800515 20ce2: 8f 5f subi r24, 0xFF ; 255 20ce4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 20ce8: c0 cf rjmp .-128 ; 0x20c6a 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 20cea: 88 e4 ldi r24, 0x48 ; 72 20cec: 9d e5 ldi r25, 0x5D ; 93 20cee: d0 cf rjmp .-96 ; 0x20c90 #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 20cf0: 82 e4 ldi r24, 0x42 ; 66 20cf2: 9d e5 ldi r25, 0x5D ; 93 20cf4: dd cf rjmp .-70 ; 0x20cb0 #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(); } 20cf6: 08 95 ret 00020cf8 : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 20cf8: 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(); 20cfa: 0e 94 ce f9 call 0x1f39c ; 0x1f39c 20cfe: c1 e0 ldi r28, 0x01 ; 1 20d00: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 20d02: 6f ef ldi r22, 0xFF ; 255 20d04: 09 f0 breq .+2 ; 0x20d08 20d06: 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); 20d08: 84 e0 ldi r24, 0x04 ; 4 20d0a: 9d e0 ldi r25, 0x0D ; 13 20d0c: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 1 #else 0 #endif ) , enableECool(enableECool) { } 20d10: 8c 2f mov r24, r28 20d12: 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)); 20d14: 82 70 andi r24, 0x02 ; 2 } 20d16: 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)); 20d18: 0d 94 19 3c jmp 0x27832 ; 0x27832 00020d1c : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 20d1c: 44 e1 ldi r20, 0x14 ; 20 20d1e: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 20d20: 66 23 and r22, r22 20d22: 89 f0 breq .+34 ; 0x20d46 strncpy_P(lcd_status_message, message, LCD_WIDTH); 20d24: bc 01 movw r22, r24 20d26: 88 e3 ldi r24, 0x38 ; 56 20d28: 95 e0 ldi r25, 0x05 ; 5 20d2a: 0f 94 76 db call 0x3b6ec ; 0x3b6ec else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 20d2e: 10 92 4c 05 sts 0x054C, r1 ; 0x80054c <_ZL18lcd_status_message.lto_priv.468+0x14> lcd_status_message_idx = 0; // Print message from beginning 20d32: 10 92 37 05 sts 0x0537, r1 ; 0x800537 <_ZL22lcd_status_message_idx.lto_priv.464> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 20d36: 86 eb ldi r24, 0xB6 ; 182 20d38: 9b e6 ldi r25, 0x6B ; 107 20d3a: 0e 94 fe 7a call 0xf5fc ; 0xf5fc // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 20d3e: 81 e0 ldi r24, 0x01 ; 1 20d40: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 20d44: 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); 20d46: bc 01 movw r22, r24 20d48: 88 e3 ldi r24, 0x38 ; 56 20d4a: 95 e0 ldi r25, 0x05 ; 5 20d4c: 0f 94 09 e4 call 0x3c812 ; 0x3c812 20d50: ee cf rjmp .-36 ; 0x20d2e 00020d52 : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 20d52: 90 91 cf 03 lds r25, 0x03CF ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> 20d56: 89 17 cp r24, r25 20d58: 80 f4 brcc .+32 ; 0x20d7a return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 20d5a: 91 30 cpi r25, 0x01 ; 1 20d5c: 61 f4 brne .+24 ; 0x20d76 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 20d5e: 80 91 4d 05 lds r24, 0x054D ; 0x80054d <_ZL26lcd_status_message_timeout.lto_priv.467> 20d62: 88 23 and r24, r24 20d64: 51 f0 breq .+20 ; 0x20d7a 20d66: 40 e2 ldi r20, 0x20 ; 32 20d68: 5e e4 ldi r21, 0x4E ; 78 20d6a: 60 e0 ldi r22, 0x00 ; 0 20d6c: 70 e0 ldi r23, 0x00 ; 0 20d6e: 8d e4 ldi r24, 0x4D ; 77 20d70: 95 e0 ldi r25, 0x05 ; 5 20d72: 0d 94 67 40 jmp 0x280ce ; 0x280ce ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 20d76: 80 e0 ldi r24, 0x00 ; 0 20d78: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 20d7a: 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; } 20d7c: 08 95 ret 00020d7e : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 20d7e: ef 92 push r14 20d80: ff 92 push r15 20d82: 1f 93 push r17 20d84: cf 93 push r28 20d86: df 93 push r29 20d88: ec 01 movw r28, r24 20d8a: 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)) { 20d8c: 86 2f mov r24, r22 20d8e: 0f 94 a9 06 call 0x20d52 ; 0x20d52 20d92: 88 23 and r24, r24 20d94: e9 f0 breq .+58 ; 0x20dd0 bool same = !(progmem? strcmp_P(lcd_status_message, message): 20d96: be 01 movw r22, r28 20d98: 88 e3 ldi r24, 0x38 ; 56 20d9a: 95 e0 ldi r25, 0x05 ; 5 20d9c: 0f 94 37 db call 0x3b66e ; 0x3b66e 20da0: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 20da2: 8d e4 ldi r24, 0x4D ; 77 20da4: 95 e0 ldi r25, 0x05 ; 5 20da6: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> lcd_status_message_level = severity; 20daa: 10 93 cf 03 sts 0x03CF, r17 ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> custom_message_type = CustomMsg::Status; 20dae: 10 92 73 07 sts 0x0773, r1 ; 0x800773 custom_message_state = 0; 20db2: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 if (!same) { 20db6: ef 28 or r14, r15 20db8: 59 f0 breq .+22 ; 0x20dd0 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 20dba: 61 e0 ldi r22, 0x01 ; 1 20dbc: ce 01 movw r24, r28 20dbe: 0f 94 8e 06 call 0x20d1c ; 0x20d1c } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20dc2: df 91 pop r29 20dc4: cf 91 pop r28 20dc6: 1f 91 pop r17 20dc8: ff 90 pop r15 20dca: 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(); 20dcc: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20dd0: df 91 pop r29 20dd2: cf 91 pop r28 20dd4: 1f 91 pop r17 20dd6: ff 90 pop r15 20dd8: ef 90 pop r14 20dda: 08 95 ret 00020ddc : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 20ddc: 1f 93 push r17 20dde: cf 93 push r28 20de0: df 93 push r29 20de2: 18 2f mov r17, r24 20de4: eb 01 movw r28, r22 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 20de6: 80 e0 ldi r24, 0x00 ; 0 20de8: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 20dec: 80 e0 ldi r24, 0x00 ; 0 20dee: 0e 94 74 8b call 0x116e8 ; 0x116e8 target_temperature[0] = 0; 20df2: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 20df6: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b target_temperature_bed = 0; 20dfa: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 20dfe: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 manage_heater(); 20e02: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(); 20e06: 80 e0 ldi r24, 0x00 ; 0 20e08: 0e 94 da 8b call 0x117b4 ; 0x117b4 lcd_clear(); 20e0c: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 20e10: 88 ef ldi r24, 0xF8 ; 248 20e12: 94 e4 ldi r25, 0x44 ; 68 20e14: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20e18: ac 01 movw r20, r24 20e1a: 60 e0 ldi r22, 0x00 ; 0 20e1c: 80 e0 ldi r24, 0x00 ; 0 20e1e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 20e22: 88 ee ldi r24, 0xE8 ; 232 20e24: 94 e4 ldi r25, 0x44 ; 68 20e26: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20e2a: ac 01 movw r20, r24 20e2c: 61 e0 ldi r22, 0x01 ; 1 20e2e: 80 e0 ldi r24, 0x00 ; 0 20e30: 0e 94 a1 6f call 0xdf42 ; 0xdf42 switch (testError) 20e34: 11 50 subi r17, 0x01 ; 1 20e36: 1c 30 cpi r17, 0x0C ; 12 20e38: a0 f4 brcc .+40 ; 0x20e62 20e3a: e1 2f mov r30, r17 20e3c: f0 e0 ldi r31, 0x00 ; 0 20e3e: 88 27 eor r24, r24 20e40: eb 5d subi r30, 0xDB ; 219 20e42: f8 4f sbci r31, 0xF8 ; 248 20e44: 8e 4f sbci r24, 0xFE ; 254 20e46: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 20e4a: 75 39 cpi r23, 0x95 ; 149 20e4c: 0d 3a cpi r16, 0xAD ; 173 20e4e: ed 39 cpi r30, 0x9D ; 157 20e50: b7 3a cpi r27, 0xA7 ; 167 20e52: 8f 39 cpi r24, 0x9F ; 159 20e54: 99 39 cpi r25, 0x99 ; 153 20e56: d3 39 cpi r29, 0x93 ; 147 20e58: c5 3a cpi r28, 0xA5 ; 165 20e5a: 43 3a cpi r20, 0xA3 ; 163 20e5c: c3 39 cpi r28, 0x93 ; 147 20e5e: f3 3a cpi r31, 0xA3 ; 163 20e60: 6f 39 cpi r22, 0x9F ; 159 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 20e62: 84 ed ldi r24, 0xD4 ; 212 20e64: 94 e4 ldi r25, 0x44 ; 68 20e66: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20e6a: ac 01 movw r20, r24 20e6c: 62 e0 ldi r22, 0x02 ; 2 20e6e: 80 e0 ldi r24, 0x00 ; 0 20e70: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 20e74: 84 ec ldi r24, 0xC4 ; 196 20e76: 94 e4 ldi r25, 0x44 ; 68 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)); 20e78: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20e7c: ac 01 movw r20, r24 20e7e: 63 e0 ldi r22, 0x03 ; 3 20e80: 80 e0 ldi r24, 0x00 ; 0 20e82: 0e 94 a1 6f call 0xdf42 ; 0xdf42 20e86: 45 c0 rjmp .+138 ; 0x20f12 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)); 20e88: 87 eb ldi r24, 0xB7 ; 183 20e8a: 94 e4 ldi r25, 0x44 ; 68 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)); 20e8c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20e90: ac 01 movw r20, r24 20e92: 62 e0 ldi r22, 0x02 ; 2 20e94: 80 e0 ldi r24, 0x00 ; 0 20e96: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20e9a: 88 ea ldi r24, 0xA8 ; 168 20e9c: 94 e4 ldi r25, 0x44 ; 68 20e9e: ec cf rjmp .-40 ; 0x20e78 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)); 20ea0: 8d e9 ldi r24, 0x9D ; 157 20ea2: 94 e4 ldi r25, 0x44 ; 68 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)); 20ea4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20ea8: ac 01 movw r20, r24 20eaa: 62 e0 ldi r22, 0x02 ; 2 20eac: 80 e0 ldi r24, 0x00 ; 0 20eae: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20eb2: 88 ea ldi r24, 0xA8 ; 168 20eb4: 94 e4 ldi r25, 0x44 ; 68 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)); 20eb6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20eba: ac 01 movw r20, r24 20ebc: 63 e0 ldi r22, 0x03 ; 3 20ebe: 80 e0 ldi r24, 0x00 ; 0 20ec0: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(18, 3); 20ec4: 63 e0 ldi r22, 0x03 ; 3 20ec6: 82 e1 ldi r24, 0x12 ; 18 20ec8: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print(_error_1); 20ecc: ce 01 movw r24, r28 20ece: 1f c0 rjmp .+62 ; 0x20f0e 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)); 20ed0: 85 e9 ldi r24, 0x95 ; 149 20ed2: 94 e4 ldi r25, 0x44 ; 68 20ed4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20ed8: ac 01 movw r20, r24 20eda: 62 e0 ldi r22, 0x02 ; 2 20edc: 80 e0 ldi r24, 0x00 ; 0 20ede: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(18, 2); 20ee2: 62 e0 ldi r22, 0x02 ; 2 20ee4: 82 e1 ldi r24, 0x12 ; 18 20ee6: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print(_error_1); 20eea: ce 01 movw r24, r28 20eec: 0e 94 94 71 call 0xe328 ; 0xe328 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 20ef0: 8b e8 ldi r24, 0x8B ; 139 20ef2: 94 e4 ldi r25, 0x44 ; 68 20ef4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20ef8: ac 01 movw r20, r24 20efa: 63 e0 ldi r22, 0x03 ; 3 20efc: 80 e0 ldi r24, 0x00 ; 0 20efe: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(18, 3); 20f02: 63 e0 ldi r22, 0x03 ; 3 20f04: 82 e1 ldi r24, 0x12 ; 18 20f06: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print(_error_2); 20f0a: 83 ef ldi r24, 0xF3 ; 243 20f0c: 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); 20f0e: 0e 94 94 71 call 0xe328 ; 0xe328 lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 20f12: 68 ee ldi r22, 0xE8 ; 232 20f14: 73 e0 ldi r23, 0x03 ; 3 20f16: 80 e0 ldi r24, 0x00 ; 0 20f18: 90 e0 ldi r25, 0x00 ; 0 20f1a: 0f 94 8a 3d call 0x27b14 ; 0x27b14 20f1e: 80 e0 ldi r24, 0x00 ; 0 20f20: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee lcd_beeper_quick_feedback(); do { _delay(100); 20f24: 64 e6 ldi r22, 0x64 ; 100 20f26: 70 e0 ldi r23, 0x00 ; 0 20f28: 80 e0 ldi r24, 0x00 ; 0 20f2a: 90 e0 ldi r25, 0x00 ; 0 20f2c: 0f 94 8a 3d call 0x27b14 ; 0x27b14 manage_heater(); 20f30: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(); 20f34: 80 e0 ldi r24, 0x00 ; 0 20f36: 0e 94 da 8b call 0x117b4 ; 0x117b4 } while (!lcd_clicked()); 20f3a: 0e 94 aa 71 call 0xe354 ; 0xe354 20f3e: 88 23 and r24, r24 20f40: 89 f3 breq .-30 ; 0x20f24 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 20f42: 88 ec ldi r24, 0xC8 ; 200 20f44: 93 e4 ldi r25, 0x43 ; 67 20f46: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20f4a: 62 e0 ldi r22, 0x02 ; 2 20f4c: 0f 94 bf 06 call 0x20d7e ; 0x20d7e lcd_return_to_status(); } 20f50: df 91 pop r29 20f52: cf 91 pop r28 20f54: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 20f56: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 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)); 20f5a: 89 e7 ldi r24, 0x79 ; 121 20f5c: 94 e4 ldi r25, 0x44 ; 68 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)); 20f5e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20f62: ac 01 movw r20, r24 20f64: 62 e0 ldi r22, 0x02 ; 2 20f66: 80 e0 ldi r24, 0x00 ; 0 20f68: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 20f6c: 85 e9 ldi r24, 0x95 ; 149 20f6e: 94 e4 ldi r25, 0x44 ; 68 20f70: a2 cf rjmp .-188 ; 0x20eb6 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)); 20f72: 86 e6 ldi r24, 0x66 ; 102 20f74: 94 e4 ldi r25, 0x44 ; 68 20f76: 96 cf rjmp .-212 ; 0x20ea4 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)); 20f78: 83 e5 ldi r24, 0x53 ; 83 20f7a: 94 e4 ldi r25, 0x44 ; 68 20f7c: 93 cf rjmp .-218 ; 0x20ea4 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)); 20f7e: 84 e4 ldi r24, 0x44 ; 68 20f80: 94 e4 ldi r25, 0x44 ; 68 20f82: ed cf rjmp .-38 ; 0x20f5e 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)); 20f84: 86 e3 ldi r24, 0x36 ; 54 20f86: 94 e4 ldi r25, 0x44 ; 68 20f88: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20f8c: ac 01 movw r20, r24 20f8e: 62 e0 ldi r22, 0x02 ; 2 20f90: 80 e0 ldi r24, 0x00 ; 0 20f92: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 20f96: 8f e2 ldi r24, 0x2F ; 47 20f98: 94 e4 ldi r25, 0x44 ; 68 20f9a: 8d cf rjmp .-230 ; 0x20eb6 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 20f9c: 8d e1 ldi r24, 0x1D ; 29 20f9e: 94 e4 ldi r25, 0x44 ; 68 20fa0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20fa4: ac 01 movw r20, r24 20fa6: 62 e0 ldi r22, 0x02 ; 2 20fa8: 80 e0 ldi r24, 0x00 ; 0 20faa: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 20fae: 83 e1 ldi r24, 0x13 ; 19 20fb0: 94 e4 ldi r25, 0x44 ; 68 20fb2: 81 cf rjmp .-254 ; 0x20eb6 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20fb4: 81 e0 ldi r24, 0x01 ; 1 20fb6: 94 e4 ldi r25, 0x44 ; 68 20fb8: 69 cf rjmp .-302 ; 0x20e8c 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)); 20fba: 81 e0 ldi r24, 0x01 ; 1 20fbc: 94 e4 ldi r25, 0x44 ; 68 20fbe: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20fc2: ac 01 movw r20, r24 20fc4: 62 e0 ldi r22, 0x02 ; 2 20fc6: 80 e0 ldi r24, 0x00 ; 0 20fc8: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 3, _T(MSG_FALSE_TRIGGERING)); 20fcc: 8e ee ldi r24, 0xEE ; 238 20fce: 93 e4 ldi r25, 0x43 ; 67 20fd0: 53 cf rjmp .-346 ; 0x20e78 break; case TestError::FsensorLevel: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20fd2: 81 e0 ldi r24, 0x01 ; 1 20fd4: 94 e4 ldi r25, 0x44 ; 68 20fd6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20fda: ac 01 movw r20, r24 20fdc: 62 e0 ldi r22, 0x02 ; 2 20fde: 80 e0 ldi r24, 0x00 ; 0 20fe0: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(0, 3); 20fe4: 63 e0 ldi r22, 0x03 ; 3 20fe6: 80 e0 ldi r24, 0x00 ; 0 20fe8: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); 20fec: 8a ed ldi r24, 0xDA ; 218 20fee: 93 e4 ldi r25, 0x43 ; 67 20ff0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 20ff4: df 93 push r29 20ff6: cf 93 push r28 20ff8: 9f 93 push r25 20ffa: 8f 93 push r24 20ffc: 0e 94 66 6f call 0xdecc ; 0xdecc 21000: 0f 90 pop r0 21002: 0f 90 pop r0 21004: 0f 90 pop r0 21006: 0f 90 pop r0 21008: 84 cf rjmp .-248 ; 0x20f12 0002100a : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 2100a: 8f 92 push r8 2100c: 9f 92 push r9 2100e: af 92 push r10 21010: bf 92 push r11 21012: cf 92 push r12 21014: df 92 push r13 21016: ef 92 push r14 21018: ff 92 push r15 2101a: 0f 93 push r16 2101c: 1f 93 push r17 2101e: cf 93 push r28 21020: df 93 push r29 21022: f8 2e mov r15, r24 21024: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 21028: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 2102c: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 21030: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 21034: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 21038: 4b 01 movw r8, r22 2103a: 6b 01 movw r12, r22 2103c: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 21040: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 21044: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 21048: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 2104c: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 21050: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 21052: ff 20 and r15, r15 21054: 09 f4 brne .+2 ; 0x21058 21056: a6 c0 rjmp .+332 ; 0x211a4 21058: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 2105a: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 2105c: 24 eb ldi r18, 0xB4 ; 180 2105e: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 21060: 90 e0 ldi r25, 0x00 ; 0 21062: 80 e0 ldi r24, 0x00 ; 0 21064: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 21068: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b target_temperature_bed = (_isbed) ? 100 : 0; 2106c: 84 e6 ldi r24, 0x64 ; 100 2106e: 90 e0 ldi r25, 0x00 ; 0 21070: f1 10 cpse r15, r1 21072: 02 c0 rjmp .+4 ; 0x21078 21074: 90 e0 ldi r25, 0x00 ; 0 21076: 80 e0 ldi r24, 0x00 ; 0 21078: 90 93 6a 0e sts 0x0E6A, r25 ; 0x800e6a 2107c: 80 93 69 0e sts 0x0E69, r24 ; 0x800e69 thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 21080: e0 90 1e 05 lds r14, 0x051E ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); 21084: 80 e0 ldi r24, 0x00 ; 0 21086: 0f 94 79 48 call 0x290f2 ; 0x290f2 #endif //THERMAL_MODEL manage_heater(); 2108a: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 2108e: 81 e0 ldi r24, 0x01 ; 1 21090: 0e 94 da 8b call 0x117b4 ; 0x117b4 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 21094: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 21096: 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 21098: 85 e0 ldi r24, 0x05 ; 5 2109a: 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) 2109c: 80 91 12 05 lds r24, 0x0512 ; 0x800512 210a0: 81 11 cpse r24, r1 210a2: 1c c0 rjmp .+56 ; 0x210dc { manage_heater(); 210a4: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 210a8: 81 e0 ldi r24, 0x01 ; 1 210aa: 0e 94 da 8b call 0x117b4 ; 0x117b4 _progress = (_isbed? 210ae: 00 e9 ldi r16, 0x90 ; 144 210b0: 11 e0 ldi r17, 0x01 ; 1 210b2: 20 e0 ldi r18, 0x00 ; 0 210b4: 42 e0 ldi r20, 0x02 ; 2 210b6: 6a 2d mov r22, r10 210b8: 87 e0 ldi r24, 0x07 ; 7 210ba: f1 10 cpse r15, r1 210bc: 01 c0 rjmp .+2 ; 0x210c0 210be: 88 e0 ldi r24, 0x08 ; 8 210c0: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 210c4: 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 210c6: 8b 2d mov r24, r11 210c8: 68 2d mov r22, r8 210ca: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__udivmodqi4> 210ce: 91 11 cpse r25, r1 210d0: 02 c0 rjmp .+4 ; 0x210d6 210d2: 0e 94 e1 78 call 0xf1c2 ; 0xf1c2 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 210d6: b3 94 inc r11 210d8: b9 10 cpse r11, r9 210da: e0 cf rjmp .-64 ; 0x2109c MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 210dc: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 210e0: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b target_temperature_bed = 0; 210e4: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 210e8: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 manage_heater(); 210ec: 0f 94 98 4e call 0x29d30 ; 0x29d30 210f0: b6 01 movw r22, r12 210f2: dd 0c add r13, r13 210f4: 88 0b sbc r24, r24 210f6: 99 0b sbc r25, r25 210f8: 4e 01 movw r8, r28 210fa: dd 0f add r29, r29 210fc: aa 08 sbc r10, r10 210fe: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 21100: ff 20 and r15, r15 21102: 09 f4 brne .+2 ; 0x21106 21104: 54 c0 rjmp .+168 ; 0x211ae 21106: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 2110a: 9b 01 movw r18, r22 2110c: ac 01 movw r20, r24 2110e: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 21112: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 21116: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 2111a: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 2111e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 21122: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 21126: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 21128: c5 01 movw r24, r10 2112a: b4 01 movw r22, r8 2112c: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 21130: 9b 01 movw r18, r22 21132: ac 01 movw r20, r24 21134: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 21138: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 2113c: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 21140: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 21144: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 21148: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 2114c: 10 91 12 05 lds r17, 0x0512 ; 0x800512 21150: 11 11 cpse r17, r1 21152: 0c c0 rjmp .+24 ; 0x2116c 21154: f1 10 cpse r15, r1 21156: 4b c0 rjmp .+150 ; 0x211ee 21158: 69 30 cpi r22, 0x09 ; 9 2115a: 71 05 cpc r23, r1 2115c: 0c f0 brlt .+2 ; 0x21160 2115e: 4d c0 rjmp .+154 ; 0x211fa { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 21160: 8e e1 ldi r24, 0x1E ; 30 21162: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 21164: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 21166: c8 17 cp r28, r24 21168: d9 07 cpc r29, r25 2116a: 34 f4 brge .+12 ; 0x21178 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 2116c: 63 ef ldi r22, 0xF3 ; 243 2116e: 72 e0 ldi r23, 0x02 ; 2 21170: 80 e0 ldi r24, 0x00 ; 0 21172: 0f 94 ee 06 call 0x20ddc ; 0x20ddc MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 21176: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 21178: 8e 2d mov r24, r14 2117a: 0f 94 79 48 call 0x290f2 ; 0x290f2 #endif //THERMAL_MODEL manage_heater(); 2117e: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 21182: 81 e0 ldi r24, 0x01 ; 1 21184: 0e 94 da 8b call 0x117b4 ; 0x117b4 return _stepresult; } 21188: 81 2f mov r24, r17 2118a: df 91 pop r29 2118c: cf 91 pop r28 2118e: 1f 91 pop r17 21190: 0f 91 pop r16 21192: ff 90 pop r15 21194: ef 90 pop r14 21196: df 90 pop r13 21198: cf 90 pop r12 2119a: bf 90 pop r11 2119c: af 90 pop r10 2119e: 9f 90 pop r9 211a0: 8f 90 pop r8 211a2: 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 211a4: 9c e3 ldi r25, 0x3C ; 60 211a6: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 211a8: 88 ec ldi r24, 0xC8 ; 200 211aa: 90 e0 ldi r25, 0x00 ; 0 211ac: 5b cf rjmp .-330 ; 0x21064 target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 211ae: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 211b2: 9b 01 movw r18, r22 211b4: ac 01 movw r20, r24 211b6: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 211ba: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 211be: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 211c2: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 211c6: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 211ca: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 211ce: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 211d0: c5 01 movw r24, r10 211d2: b4 01 movw r22, r8 211d4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 211d8: 9b 01 movw r18, r22 211da: ac 01 movw r20, r24 211dc: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 211e0: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 211e4: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 211e8: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 211ec: ab cf rjmp .-170 ; 0x21144 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 211ee: 89 e0 ldi r24, 0x09 ; 9 211f0: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 211f2: 6e 31 cpi r22, 0x1E ; 30 211f4: 71 05 cpc r23, r1 211f6: 0c f4 brge .+2 ; 0x211fa 211f8: b5 cf rjmp .-150 ; 0x21164 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 211fa: 63 ef ldi r22, 0xF3 ; 243 211fc: 72 e0 ldi r23, 0x02 ; 2 211fe: 81 e0 ldi r24, 0x01 ; 1 21200: 0f 94 ee 06 call 0x20ddc ; 0x20ddc 21204: b9 cf rjmp .-142 ; 0x21178 00021206 : plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); crashdet_use_eeprom_setting(); } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 21206: 2f 92 push r2 21208: 3f 92 push r3 2120a: 4f 92 push r4 2120c: 5f 92 push r5 2120e: 6f 92 push r6 21210: 7f 92 push r7 21212: 8f 92 push r8 21214: 9f 92 push r9 21216: af 92 push r10 21218: bf 92 push r11 2121a: cf 92 push r12 2121c: df 92 push r13 2121e: ef 92 push r14 21220: ff 92 push r15 21222: 1f 93 push r17 21224: cf 93 push r28 21226: df 93 push r29 21228: 00 d0 rcall .+0 ; 0x2122a 2122a: 00 d0 rcall .+0 ; 0x2122c 2122c: 1f 92 push r1 2122e: cd b7 in r28, 0x3d ; 61 21230: de b7 in r29, 0x3e ; 62 21232: 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) { 21234: 68 2e mov r6, r24 21236: 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; 21238: 81 2c mov r8, r1 2123a: 20 e8 ldi r18, 0x80 ; 128 2123c: 92 2e mov r9, r18 2123e: 2c e5 ldi r18, 0x5C ; 92 21240: a2 2e mov r10, r18 21242: 23 e4 ldi r18, 0x43 ; 67 21244: 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) { 21246: 81 30 cpi r24, 0x01 ; 1 21248: 31 f0 breq .+12 ; 0x21256 case 0: axis_length = X_MAX_POS; break; 2124a: 81 2c mov r8, r1 2124c: 91 2c mov r9, r1 2124e: 9f e7 ldi r25, 0x7F ; 127 21250: a9 2e mov r10, r25 21252: 93 e4 ldi r25, 0x43 ; 67 21254: 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; 21256: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 2125a: 0f 94 5c 3b call 0x276b8 ; 0x276b8 } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 2125e: 81 e0 ldi r24, 0x01 ; 1 21260: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 21264: 60 e0 ldi r22, 0x00 ; 0 21266: 70 e0 ldi r23, 0x00 ; 0 21268: 80 ea ldi r24, 0xA0 ; 160 2126a: 90 e4 ldi r25, 0x40 ; 64 2126c: 0e 94 0d 6f call 0xde1a ; 0xde1a tmc2130_home_enter(1 << axis); 21270: 81 e0 ldi r24, 0x01 ; 1 21272: 01 2e mov r0, r17 21274: 01 c0 rjmp .+2 ; 0x21278 21276: 88 0f add r24, r24 21278: 0a 94 dec r0 2127a: ea f7 brpl .-6 ; 0x21276 2127c: 0f 94 8b 3b call 0x27716 ; 0x27716 // first axis length measurement begin current_position[axis] -= (axis_length + margin); 21280: 20 e0 ldi r18, 0x00 ; 0 21282: 30 e0 ldi r19, 0x00 ; 0 21284: 40 e7 ldi r20, 0x70 ; 112 21286: 52 e4 ldi r21, 0x42 ; 66 21288: c5 01 movw r24, r10 2128a: b4 01 movw r22, r8 2128c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 21290: 69 83 std Y+1, r22 ; 0x01 21292: 7a 83 std Y+2, r23 ; 0x02 21294: 8b 83 std Y+3, r24 ; 0x03 21296: 9c 83 std Y+4, r25 ; 0x04 21298: 13 01 movw r2, r6 2129a: 22 0c add r2, r2 2129c: 33 1c adc r3, r3 2129e: 22 0c add r2, r2 212a0: 33 1c adc r3, r3 212a2: c1 01 movw r24, r2 212a4: 8f 5b subi r24, 0xBF ; 191 212a6: 98 4f sbci r25, 0xF8 ; 248 212a8: 9e 83 std Y+6, r25 ; 0x06 212aa: 8d 83 std Y+5, r24 ; 0x05 212ac: 29 81 ldd r18, Y+1 ; 0x01 212ae: 3a 81 ldd r19, Y+2 ; 0x02 212b0: 4b 81 ldd r20, Y+3 ; 0x03 212b2: 5c 81 ldd r21, Y+4 ; 0x04 212b4: fc 01 movw r30, r24 212b6: 60 81 ld r22, Z 212b8: 71 81 ldd r23, Z+1 ; 0x01 212ba: 82 81 ldd r24, Z+2 ; 0x02 212bc: 93 81 ldd r25, Z+3 ; 0x03 212be: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 212c2: ed 81 ldd r30, Y+5 ; 0x05 212c4: fe 81 ldd r31, Y+6 ; 0x06 212c6: 60 83 st Z, r22 212c8: 71 83 std Z+1, r23 ; 0x01 212ca: 82 83 std Z+2, r24 ; 0x02 212cc: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 212ce: 60 e0 ldi r22, 0x00 ; 0 212d0: 70 e0 ldi r23, 0x00 ; 0 212d2: 84 e3 ldi r24, 0x34 ; 52 212d4: 92 e4 ldi r25, 0x42 ; 66 212d6: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 212da: 0f 94 24 59 call 0x2b248 ; 0x2b248 #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 212de: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.489> tmc2130_sg_measure_cnt = 0; 212e2: 10 92 c7 03 sts 0x03C7, r1 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491> 212e6: 10 92 c8 03 sts 0x03C8, r1 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x1> 212ea: 10 92 c9 03 sts 0x03C9, r1 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x2> 212ee: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x3> tmc2130_sg_measure_val = 0; 212f2: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.490> 212f6: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x1> 212fa: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x2> 212fe: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x3> tmc2130_sg_measure_start(axis); current_position_init = st_get_position_mm(axis); 21302: 81 2f mov r24, r17 21304: 0f 94 10 59 call 0x2b220 ; 0x2b220 21308: 6b 01 movw r12, r22 2130a: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 2130c: 20 e0 ldi r18, 0x00 ; 0 2130e: 30 e0 ldi r19, 0x00 ; 0 21310: 40 ef ldi r20, 0xF0 ; 240 21312: 52 e4 ldi r21, 0x42 ; 66 21314: ed 81 ldd r30, Y+5 ; 0x05 21316: fe 81 ldd r31, Y+6 ; 0x06 21318: 60 81 ld r22, Z 2131a: 71 81 ldd r23, Z+1 ; 0x01 2131c: 82 81 ldd r24, Z+2 ; 0x02 2131e: 93 81 ldd r25, Z+3 ; 0x03 21320: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 21324: ed 81 ldd r30, Y+5 ; 0x05 21326: fe 81 ldd r31, Y+6 ; 0x06 21328: 60 83 st Z, r22 2132a: 71 83 std Z+1, r23 ; 0x01 2132c: 82 83 std Z+2, r24 ; 0x02 2132e: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21330: 60 e0 ldi r22, 0x00 ; 0 21332: 70 e0 ldi r23, 0x00 ; 0 21334: 84 e3 ldi r24, 0x34 ; 52 21336: 92 e4 ldi r25, 0x42 ; 66 21338: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 2133c: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position[axis] += axis_length; 21340: a5 01 movw r20, r10 21342: 94 01 movw r18, r8 21344: ed 81 ldd r30, Y+5 ; 0x05 21346: fe 81 ldd r31, Y+6 ; 0x06 21348: 60 81 ld r22, Z 2134a: 71 81 ldd r23, Z+1 ; 0x01 2134c: 82 81 ldd r24, Z+2 ; 0x02 2134e: 93 81 ldd r25, Z+3 ; 0x03 21350: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 21354: ed 81 ldd r30, Y+5 ; 0x05 21356: fe 81 ldd r31, Y+6 ; 0x06 21358: 60 83 st Z, r22 2135a: 71 83 std Z+1, r23 ; 0x01 2135c: 82 83 std Z+2, r24 ; 0x02 2135e: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21360: 60 e0 ldi r22, 0x00 ; 0 21362: 70 e0 ldi r23, 0x00 ; 0 21364: 84 e3 ldi r24, 0x34 ; 52 21366: 92 e4 ldi r25, 0x42 ; 66 21368: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 2136c: 0f 94 24 59 call 0x2b248 ; 0x2b248 } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 21370: 8f ef ldi r24, 0xFF ; 255 21372: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.489> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 21376: 60 91 cb 03 lds r22, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.490> 2137a: 70 91 cc 03 lds r23, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x1> 2137e: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x2> 21382: 90 91 ce 03 lds r25, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x3> 21386: 20 91 c7 03 lds r18, 0x03C7 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491> 2138a: 30 91 c8 03 lds r19, 0x03C8 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x1> 2138e: 40 91 c9 03 lds r20, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x2> 21392: 50 91 ca 03 lds r21, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x3> 21396: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 2139a: 2d 83 std Y+5, r18 ; 0x05 2139c: 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); 2139e: 3f 93 push r19 213a0: 2f 93 push r18 213a2: f8 e5 ldi r31, 0x58 ; 88 213a4: 6f 0e add r6, r31 213a6: 71 1c adc r7, r1 213a8: 7f 92 push r7 213aa: 6f 92 push r6 213ac: 80 ef ldi r24, 0xF0 ; 240 213ae: 9b e8 ldi r25, 0x8B ; 139 213b0: 9f 93 push r25 213b2: 8f 93 push r24 213b4: 0f 94 4b dc call 0x3b896 ; 0x3b896 eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 213b8: 0f 90 pop r0 213ba: 0f 90 pop r0 213bc: 0f 90 pop r0 213be: 0f 90 pop r0 213c0: 0f 90 pop r0 213c2: 0f 90 pop r0 213c4: 8b e5 ldi r24, 0x5B ; 91 213c6: 9f e0 ldi r25, 0x0F ; 15 213c8: 11 11 cpse r17, r1 213ca: 02 c0 rjmp .+4 ; 0x213d0 213cc: 8d e5 ldi r24, 0x5D ; 93 213ce: 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); 213d0: 6d 81 ldd r22, Y+5 ; 0x05 213d2: 7f 81 ldd r23, Y+7 ; 0x07 213d4: 0f 94 e7 dd call 0x3bbce ; 0x3bbce current_position_final = st_get_position_mm(axis); 213d8: 81 2f mov r24, r17 213da: 0f 94 10 59 call 0x2b220 ; 0x2b220 213de: 2b 01 movw r4, r22 213e0: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 213e2: a7 01 movw r20, r14 213e4: 96 01 movw r18, r12 213e6: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 213ea: 6b 01 movw r12, r22 213ec: 7c 01 movw r14, r24 213ee: e8 94 clt 213f0: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 213f2: c1 01 movw r24, r2 213f4: 8f 5b subi r24, 0xBF ; 191 213f6: 98 4f sbci r25, 0xF8 ; 248 213f8: 9e 83 std Y+6, r25 ; 0x06 213fa: 8d 83 std Y+5, r24 ; 0x05 213fc: 20 e0 ldi r18, 0x00 ; 0 213fe: 30 e0 ldi r19, 0x00 ; 0 21400: 40 e7 ldi r20, 0x70 ; 112 21402: 52 e4 ldi r21, 0x42 ; 66 21404: fc 01 movw r30, r24 21406: 60 81 ld r22, Z 21408: 71 81 ldd r23, Z+1 ; 0x01 2140a: 82 81 ldd r24, Z+2 ; 0x02 2140c: 93 81 ldd r25, Z+3 ; 0x03 2140e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 21412: ed 81 ldd r30, Y+5 ; 0x05 21414: fe 81 ldd r31, Y+6 ; 0x06 21416: 60 83 st Z, r22 21418: 71 83 std Z+1, r23 ; 0x01 2141a: 82 83 std Z+2, r24 ; 0x02 2141c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2141e: 60 e0 ldi r22, 0x00 ; 0 21420: 70 e0 ldi r23, 0x00 ; 0 21422: 84 e3 ldi r24, 0x34 ; 52 21424: 92 e4 ldi r25, 0x42 ; 66 21426: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 2142a: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position[axis] -= (axis_length + margin); 2142e: 29 81 ldd r18, Y+1 ; 0x01 21430: 3a 81 ldd r19, Y+2 ; 0x02 21432: 4b 81 ldd r20, Y+3 ; 0x03 21434: 5c 81 ldd r21, Y+4 ; 0x04 21436: ed 81 ldd r30, Y+5 ; 0x05 21438: fe 81 ldd r31, Y+6 ; 0x06 2143a: 60 81 ld r22, Z 2143c: 71 81 ldd r23, Z+1 ; 0x01 2143e: 82 81 ldd r24, Z+2 ; 0x02 21440: 93 81 ldd r25, Z+3 ; 0x03 21442: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 21446: ed 81 ldd r30, Y+5 ; 0x05 21448: fe 81 ldd r31, Y+6 ; 0x06 2144a: 60 83 st Z, r22 2144c: 71 83 std Z+1, r23 ; 0x01 2144e: 82 83 std Z+2, r24 ; 0x02 21450: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21452: 60 e0 ldi r22, 0x00 ; 0 21454: 70 e0 ldi r23, 0x00 ; 0 21456: 84 e3 ldi r24, 0x34 ; 52 21458: 92 e4 ldi r25, 0x42 ; 66 2145a: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 2145e: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position_init = st_get_position_mm(axis); 21462: 81 2f mov r24, r17 21464: 0f 94 10 59 call 0x2b220 ; 0x2b220 21468: 9b 01 movw r18, r22 2146a: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 2146c: c3 01 movw r24, r6 2146e: b2 01 movw r22, r4 21470: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 21474: 2b 01 movw r4, r22 21476: 3c 01 movw r6, r24 21478: e8 94 clt 2147a: 77 f8 bld r7, 7 tmc2130_home_exit(); 2147c: 0f 94 5c 3b call 0x276b8 ; 0x276b8 //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]); 21480: ff 92 push r15 21482: ef 92 push r14 21484: df 92 push r13 21486: cf 92 push r12 21488: 88 e9 ldi r24, 0x98 ; 152 2148a: 9b e6 ldi r25, 0x6B ; 107 2148c: 9f 93 push r25 2148e: 8f 93 push r24 21490: 0f 94 4b dc call 0x3b896 ; 0x3b896 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 21494: a5 01 movw r20, r10 21496: 94 01 movw r18, r8 21498: c7 01 movw r24, r14 2149a: b6 01 movw r22, r12 2149c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 214a0: 9f 77 andi r25, 0x7F ; 127 214a2: 0f 90 pop r0 214a4: 0f 90 pop r0 214a6: 0f 90 pop r0 214a8: 0f 90 pop r0 214aa: 0f 90 pop r0 214ac: 0f 90 pop r0 214ae: 20 e0 ldi r18, 0x00 ; 0 214b0: 30 e0 ldi r19, 0x00 ; 0 214b2: 40 ea ldi r20, 0xA0 ; 160 214b4: 50 e4 ldi r21, 0x40 ; 64 214b6: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 214ba: 18 16 cp r1, r24 214bc: 0c f4 brge .+2 ; 0x214c0 214be: 53 c0 rjmp .+166 ; 0x21566 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]); 214c0: 7f 92 push r7 214c2: 6f 92 push r6 214c4: 5f 92 push r5 214c6: 4f 92 push r4 214c8: 88 e9 ldi r24, 0x98 ; 152 214ca: 9b e6 ldi r25, 0x6B ; 107 214cc: 9f 93 push r25 214ce: 8f 93 push r24 214d0: 0f 94 4b dc call 0x3b896 ; 0x3b896 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 214d4: a5 01 movw r20, r10 214d6: 94 01 movw r18, r8 214d8: c3 01 movw r24, r6 214da: b2 01 movw r22, r4 214dc: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 214e0: 9f 77 andi r25, 0x7F ; 127 214e2: 0f 90 pop r0 214e4: 0f 90 pop r0 214e6: 0f 90 pop r0 214e8: 0f 90 pop r0 214ea: 0f 90 pop r0 214ec: 0f 90 pop r0 214ee: 20 e0 ldi r18, 0x00 ; 0 214f0: 30 e0 ldi r19, 0x00 ; 0 214f2: 40 ea ldi r20, 0xA0 ; 160 214f4: 50 e4 ldi r21, 0x40 ; 64 214f6: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 214fa: 18 16 cp r1, r24 214fc: a4 f1 brlt .+104 ; 0x21566 endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 214fe: a3 01 movw r20, r6 21500: 92 01 movw r18, r4 21502: c7 01 movw r24, r14 21504: b6 01 movw r22, r12 21506: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 2150a: 6b 01 movw r12, r22 2150c: 7c 01 movw r14, r24 2150e: e8 94 clt 21510: f7 f8 bld r15, 7 21512: ff 92 push r15 21514: ef 92 push r14 21516: df 92 push r13 21518: cf 92 push r12 2151a: 8b e7 ldi r24, 0x7B ; 123 2151c: 9b e6 ldi r25, 0x6B ; 107 2151e: 9f 93 push r25 21520: 8f 93 push r24 21522: 0f 94 4b dc call 0x3b896 ; 0x3b896 if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 21526: 0f 90 pop r0 21528: 0f 90 pop r0 2152a: 0f 90 pop r0 2152c: 0f 90 pop r0 2152e: 0f 90 pop r0 21530: 0f 90 pop r0 21532: 20 e0 ldi r18, 0x00 ; 0 21534: 30 e0 ldi r19, 0x00 ; 0 21536: 40 e8 ldi r20, 0x80 ; 128 21538: 5f e3 ldi r21, 0x3F ; 63 2153a: c7 01 movw r24, r14 2153c: b6 01 movw r22, r12 2153e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 21542: 18 16 cp r1, r24 21544: 0c f4 brge .+2 ; 0x21548 21546: 44 c0 rjmp .+136 ; 0x215d0 plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 21548: ed 81 ldd r30, Y+5 ; 0x05 2154a: fe 81 ldd r31, Y+6 ; 0x06 2154c: 10 82 st Z, r1 2154e: 11 82 std Z+1, r1 ; 0x01 21550: 12 82 std Z+2, r1 ; 0x02 21552: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 21554: 0f 94 4b b9 call 0x37296 ; 0x37296 reset_crash_det(axis); 21558: 81 2f mov r24, r17 2155a: 0e 94 3c d7 call 0x1ae78 ; 0x1ae78 endstops_hit_on_purpose(); 2155e: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc return true; 21562: 81 e0 ldi r24, 0x01 ; 1 21564: 1d c0 rjmp .+58 ; 0x215a0 21566: 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"; 2156a: 66 ef ldi r22, 0xF6 ; 246 2156c: 72 e0 ldi r23, 0x02 ; 2 2156e: 11 30 cpi r17, 0x01 ; 1 21570: 11 f0 breq .+4 ; 0x21576 21572: 64 ef ldi r22, 0xF4 ; 244 21574: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 21576: 88 e0 ldi r24, 0x08 ; 8 21578: 0f 94 ee 06 call 0x20ddc ; 0x20ddc current_position[axis] = 0; 2157c: f1 01 movw r30, r2 2157e: ef 5b subi r30, 0xBF ; 191 21580: f8 4f sbci r31, 0xF8 ; 248 21582: 10 82 st Z, r1 21584: 11 82 std Z+1, r1 ; 0x01 21586: 12 82 std Z+2, r1 ; 0x02 21588: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2158a: 0f 94 4b b9 call 0x37296 ; 0x37296 reset_crash_det(axis); 2158e: 81 2f mov r24, r17 21590: 0e 94 3c d7 call 0x1ae78 ; 0x1ae78 21594: 81 e0 ldi r24, 0x01 ; 1 21596: 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(); 2159a: 0f 94 6e 64 call 0x2c8dc ; 0x2c8dc return false; 2159e: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 215a0: 27 96 adiw r28, 0x07 ; 7 215a2: 0f b6 in r0, 0x3f ; 63 215a4: f8 94 cli 215a6: de bf out 0x3e, r29 ; 62 215a8: 0f be out 0x3f, r0 ; 63 215aa: cd bf out 0x3d, r28 ; 61 215ac: df 91 pop r29 215ae: cf 91 pop r28 215b0: 1f 91 pop r17 215b2: ff 90 pop r15 215b4: ef 90 pop r14 215b6: df 90 pop r13 215b8: cf 90 pop r12 215ba: bf 90 pop r11 215bc: af 90 pop r10 215be: 9f 90 pop r9 215c0: 8f 90 pop r8 215c2: 7f 90 pop r7 215c4: 6f 90 pop r6 215c6: 5f 90 pop r5 215c8: 4f 90 pop r4 215ca: 3f 90 pop r3 215cc: 2f 90 pop r2 215ce: 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"; 215d0: 66 ef ldi r22, 0xF6 ; 246 215d2: 72 e0 ldi r23, 0x02 ; 2 215d4: 11 30 cpi r17, 0x01 ; 1 215d6: 11 f0 breq .+4 ; 0x215dc 215d8: 64 ef ldi r22, 0xF4 ; 244 215da: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 215dc: 87 e0 ldi r24, 0x07 ; 7 215de: 0f 94 ee 06 call 0x20ddc ; 0x20ddc current_position[axis] = 0; 215e2: f1 01 movw r30, r2 215e4: ef 5b subi r30, 0xBF ; 191 215e6: f8 4f sbci r31, 0xF8 ; 248 215e8: 10 82 st Z, r1 215ea: 11 82 std Z+1, r1 ; 0x01 215ec: 12 82 std Z+2, r1 ; 0x02 215ee: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 215f0: 0f 94 4b b9 call 0x37296 ; 0x37296 reset_crash_det(axis); 215f4: 81 2f mov r24, r17 215f6: 0e 94 3c d7 call 0x1ae78 ; 0x1ae78 215fa: cf cf rjmp .-98 ; 0x2159a 000215fc : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 215fc: 0f 93 push r16 215fe: 1f 93 push r17 21600: cf 93 push r28 21602: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 21604: 0e 94 c0 6f call 0xdf80 ; 0xdf80 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 21608: 81 e0 ldi r24, 0x01 ; 1 2160a: 0e 94 5d 67 call 0xceba ; 0xceba uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 2160e: 8d e5 ldi r24, 0x5D ; 93 21610: 9f e0 ldi r25, 0x0F ; 15 21612: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 21616: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 21618: 8b e5 ldi r24, 0x5B ; 91 2161a: 9f e0 ldi r25, 0x0F ; 15 2161c: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 21620: 18 2f mov r17, r24 21622: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 21624: 84 ee ldi r24, 0xE4 ; 228 21626: 9f e3 ldi r25, 0x3F ; 63 21628: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2162c: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 21630: 61 e0 ldi r22, 0x01 ; 1 21632: 80 e0 ldi r24, 0x00 ; 0 21634: 0e 94 8d 6f call 0xdf1a ; 0xdf1a 21638: df 93 push r29 2163a: cf 93 push r28 2163c: 8b e4 ldi r24, 0x4B ; 75 2163e: 9b e8 ldi r25, 0x8B ; 139 21640: 9f 93 push r25 21642: 8f 93 push r24 21644: 0e 94 66 6f call 0xdecc ; 0xdecc KEEPALIVE_STATE(IN_HANDLER); 21648: 82 e0 ldi r24, 0x02 ; 2 2164a: 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)){ 2164e: 80 e0 ldi r24, 0x00 ; 0 21650: 0f 94 03 09 call 0x21206 ; 0x21206 21654: 0f 90 pop r0 21656: 0f 90 pop r0 21658: 0f 90 pop r0 2165a: 0f 90 pop r0 2165c: 88 23 and r24, r24 2165e: 09 f4 brne .+2 ; 0x21662 21660: 45 c0 rjmp .+138 ; 0x216ec X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 21662: 8d e5 ldi r24, 0x5D ; 93 21664: 9f e0 ldi r25, 0x0F ; 15 21666: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 2166a: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 2166c: 61 e0 ldi r22, 0x01 ; 1 2166e: 8a e0 ldi r24, 0x0A ; 10 21670: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 21674: be 01 movw r22, r28 21676: 90 e0 ldi r25, 0x00 ; 0 21678: 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); 2167a: 4a e0 ldi r20, 0x0A ; 10 2167c: 0e 94 e1 70 call 0xe1c2 ; 0xe1c2 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 21680: 82 ed ldi r24, 0xD2 ; 210 21682: 9f e3 ldi r25, 0x3F ; 63 21684: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 21688: ac 01 movw r20, r24 2168a: 62 e0 ldi r22, 0x02 ; 2 2168c: 80 e0 ldi r24, 0x00 ; 0 2168e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 21692: 63 e0 ldi r22, 0x03 ; 3 21694: 80 e0 ldi r24, 0x00 ; 0 21696: 0e 94 8d 6f call 0xdf1a ; 0xdf1a 2169a: 0f 93 push r16 2169c: 1f 93 push r17 2169e: 8e e3 ldi r24, 0x3E ; 62 216a0: 9b e8 ldi r25, 0x8B ; 139 216a2: 9f 93 push r25 216a4: 8f 93 push r24 216a6: 0e 94 66 6f call 0xdecc ; 0xdecc if (lcd_selfcheck_axis_sg(Y_AXIS)) 216aa: 81 e0 ldi r24, 0x01 ; 1 216ac: 0f 94 03 09 call 0x21206 ; 0x21206 216b0: 0f 90 pop r0 216b2: 0f 90 pop r0 216b4: 0f 90 pop r0 216b6: 0f 90 pop r0 216b8: 88 23 and r24, r24 216ba: c1 f0 breq .+48 ; 0x216ec { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 216bc: 8b e5 ldi r24, 0x5B ; 91 216be: 9f e0 ldi r25, 0x0F ; 15 216c0: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 216c4: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 216c6: 63 e0 ldi r22, 0x03 ; 3 216c8: 8a e0 ldi r24, 0x0A ; 10 216ca: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 216ce: be 01 movw r22, r28 216d0: 90 e0 ldi r25, 0x00 ; 0 216d2: 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); 216d4: 4a e0 ldi r20, 0x0A ; 10 216d6: 0e 94 e1 70 call 0xe1c2 ; 0xe1c2 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 216da: 43 e8 ldi r20, 0x83 ; 131 216dc: 63 e0 ldi r22, 0x03 ; 3 216de: 83 e1 ldi r24, 0x13 ; 19 216e0: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_wait_for_click_delay(10); 216e4: 8a e0 ldi r24, 0x0A ; 10 216e6: 90 e0 ldi r25, 0x00 ; 0 216e8: 0f 94 6b 50 call 0x2a0d6 ; 0x2a0d6 } } FORCE_HIGH_POWER_END; 216ec: 80 e0 ldi r24, 0x00 ; 0 216ee: 0e 94 5d 67 call 0xceba ; 0xceba KEEPALIVE_STATE(NOT_BUSY); 216f2: 81 e0 ldi r24, 0x01 ; 1 216f4: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 216f8: df 91 pop r29 216fa: cf 91 pop r28 216fc: 1f 91 pop r17 216fe: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 21700: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00021704 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 21704: 0f 94 4b 27 call 0x24e96 ; 0x24e96 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 21708: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 2170c: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 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() 21710: 81 11 cpse r24, r1 21712: 32 c0 rjmp .+100 ; 0x21778 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 21714: 80 91 38 02 lds r24, 0x0238 ; 0x800238 21718: 81 11 cpse r24, r1 2171a: 02 c0 rjmp .+4 ; 0x21720 #endif ) { return false; // abort if error persists } return true; 2171c: 81 e0 ldi r24, 0x01 ; 1 2171e: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 21720: 8f ef ldi r24, 0xFF ; 255 21722: 0e 94 8e d0 call 0x1a11c ; 0x1a11c setExtruderAutoFanState(3); //force enables the hotend fan 21726: 83 e0 ldi r24, 0x03 ; 3 21728: 0e 94 c9 76 call 0xed92 ; 0xed92 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 2172c: 0f 94 83 3f call 0x27f06 ; 0x27f06 21730: 60 93 9a 17 sts 0x179A, r22 ; 0x80179a 21734: 70 93 9b 17 sts 0x179B, r23 ; 0x80179b 21738: 80 93 9c 17 sts 0x179C, r24 ; 0x80179c 2173c: 90 93 9d 17 sts 0x179D, r25 ; 0x80179d fan_measuring = true; 21740: 81 e0 ldi r24, 0x01 ; 1 21742: 80 93 34 05 sts 0x0534, r24 ; 0x800534 #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 21746: 68 ee ldi r22, 0xE8 ; 232 21748: 73 e0 ldi r23, 0x03 ; 3 2174a: 80 e0 ldi r24, 0x00 ; 0 2174c: 90 e0 ldi r25, 0x00 ; 0 2174e: 0f 94 8a 3d call 0x27b14 ; 0x27b14 manage_heater(); 21752: 0f 94 98 4e call 0x29d30 ; 0x29d30 setExtruderAutoFanState(1); //releases lock on the hotend fan 21756: 81 e0 ldi r24, 0x01 ; 1 21758: 0e 94 c9 76 call 0xed92 ; 0xed92 lcd_selftest_setfan(0); 2175c: 80 e0 ldi r24, 0x00 ; 0 2175e: 0e 94 8e d0 call 0x1a11c ; 0x1a11c #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 21762: 80 91 af 04 lds r24, 0x04AF ; 0x8004af 21766: 90 91 b0 04 lds r25, 0x04B0 ; 0x8004b0 2176a: 45 97 sbiw r24, 0x15 ; 21 2176c: 3c f4 brge .+14 ; 0x2177c LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 2176e: 62 e0 ldi r22, 0x02 ; 2 21770: 8f e0 ldi r24, 0x0F ; 15 21772: 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); 21774: 0f 94 bf 06 call 0x20d7e ; 0x20d7e if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 21778: 80 e0 ldi r24, 0x00 ; 0 } return true; } 2177a: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 2177c: 80 91 b1 04 lds r24, 0x04B1 ; 0x8004b1 21780: 90 91 b2 04 lds r25, 0x04B2 ; 0x8004b2 21784: 45 97 sbiw r24, 0x15 ; 21 21786: 54 f6 brge .-108 ; 0x2171c LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 21788: 62 e0 ldi r22, 0x02 ; 2 2178a: 8b ef ldi r24, 0xFB ; 251 2178c: 9a e6 ldi r25, 0x6A ; 106 2178e: f2 cf rjmp .-28 ; 0x21774 00021790 : //! @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; 21790: 0f 94 82 0b call 0x21704 ; 0x21704 21794: 88 23 and r24, r24 21796: 21 f0 breq .+8 ; 0x217a0 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 21798: 85 e3 ldi r24, 0x35 ; 53 2179a: 9b e6 ldi r25, 0x6B ; 107 2179c: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc } 217a0: 08 95 ret 000217a2 : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 217a2: cf 93 push r28 217a4: df 93 push r29 217a6: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 217a8: 80 e0 ldi r24, 0x00 ; 0 217aa: 0f 94 a9 06 call 0x20d52 ; 0x20d52 217ae: 88 23 and r24, r24 217b0: 21 f0 breq .+8 ; 0x217ba lcd_updatestatus(message); 217b2: 60 e0 ldi r22, 0x00 ; 0 217b4: ce 01 movw r24, r28 217b6: 0f 94 8e 06 call 0x20d1c ; 0x20d1c SERIAL_ECHOLN(message); 217ba: ce 01 movw r24, r28 } 217bc: df 91 pop r29 217be: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 217c0: 0d 94 8e d6 jmp 0x3ad1c ; 0x3ad1c 000217c4 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 217c4: cf 93 push r28 217c6: df 93 push r29 217c8: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 217ca: 80 e0 ldi r24, 0x00 ; 0 217cc: 0f 94 a9 06 call 0x20d52 ; 0x20d52 217d0: 88 23 and r24, r24 217d2: 31 f0 breq .+12 ; 0x217e0 lcd_updatestatus(message, true); 217d4: 61 e0 ldi r22, 0x01 ; 1 217d6: ce 01 movw r24, r28 } 217d8: df 91 pop r29 217da: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 217dc: 0d 94 8e 06 jmp 0x20d1c ; 0x20d1c } 217e0: df 91 pop r29 217e2: cf 91 pop r28 217e4: 08 95 ret 000217e6 : } } void lcd_print_stop_finish(); void lcd_commands() 217e6: 2f 92 push r2 217e8: 3f 92 push r3 217ea: 4f 92 push r4 217ec: 5f 92 push r5 217ee: 6f 92 push r6 217f0: 7f 92 push r7 217f2: 8f 92 push r8 217f4: 9f 92 push r9 217f6: af 92 push r10 217f8: bf 92 push r11 217fa: cf 92 push r12 217fc: df 92 push r13 217fe: ef 92 push r14 21800: ff 92 push r15 21802: 0f 93 push r16 21804: 1f 93 push r17 21806: cf 93 push r28 21808: df 93 push r29 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) 2180a: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2180e: 81 30 cpi r24, 0x01 ; 1 21810: 09 f0 breq .+2 ; 0x21814 21812: 61 c0 rjmp .+194 ; 0x218d6 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); 21814: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 21818: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 { if (!blocks_queued() && !homing_flag) 2181c: 98 13 cpse r25, r24 2181e: 5b c0 rjmp .+182 ; 0x218d6 21820: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 21824: 81 11 cpse r24, r1 21826: 57 c0 rjmp .+174 ; 0x218d6 { custom_message_type = CustomMsg::Status; 21828: 10 92 73 07 sts 0x0773, r1 ; 0x800773 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 2182c: 8b e9 ldi r24, 0x9B ; 155 2182e: 90 e4 ldi r25, 0x40 ; 64 21830: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 21834: 0f 94 e2 0b call 0x217c4 ; 0x217c4 lcd_commands_type = LcdCommands::Idle; 21838: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 2183c: 82 e0 ldi r24, 0x02 ; 2 2183e: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 21842: 10 92 f5 03 sts 0x03F5, r1 ; 0x8003f5 #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(); 21846: 0f 94 ed 58 call 0x2b1da ; 0x2b1da save_statistics(); 2184a: 0e 94 cc 66 call 0xcd98 ; 0xcd98 // lift Z raise_z(10); 2184e: 60 e0 ldi r22, 0x00 ; 0 21850: 70 e0 ldi r23, 0x00 ; 0 21852: 80 e2 ldi r24, 0x20 ; 32 21854: 91 e4 ldi r25, 0x41 ; 65 21856: 0e 94 8e 6e call 0xdd1c ; 0xdd1c // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 2185a: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 2185e: 88 23 and r24, r24 21860: 21 f1 breq .+72 ; 0x218aa 21862: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 21866: 88 23 and r24, r24 21868: 01 f1 breq .+64 ; 0x218aa current_position[X_AXIS] = X_CANCEL_POS; 2186a: 80 e0 ldi r24, 0x00 ; 0 2186c: 90 e0 ldi r25, 0x00 ; 0 2186e: a8 e4 ldi r26, 0x48 ; 72 21870: b2 e4 ldi r27, 0x42 ; 66 21872: 80 93 41 07 sts 0x0741, r24 ; 0x800741 21876: 90 93 42 07 sts 0x0742, r25 ; 0x800742 2187a: a0 93 43 07 sts 0x0743, r26 ; 0x800743 2187e: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = Y_CANCEL_POS; 21882: 80 e0 ldi r24, 0x00 ; 0 21884: 90 e0 ldi r25, 0x00 ; 0 21886: ae e3 ldi r26, 0x3E ; 62 21888: b3 e4 ldi r27, 0x43 ; 67 2188a: 80 93 45 07 sts 0x0745, r24 ; 0x800745 2188e: 90 93 46 07 sts 0x0746, r25 ; 0x800746 21892: a0 93 47 07 sts 0x0747, r26 ; 0x800747 21896: b0 93 48 07 sts 0x0748, r27 ; 0x800748 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2189a: 60 e0 ldi r22, 0x00 ; 0 2189c: 70 e0 ldi r23, 0x00 ; 0 2189e: 84 e3 ldi r24, 0x34 ; 52 218a0: 92 e4 ldi r25, 0x42 ; 66 218a2: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 218a6: 0f 94 24 59 call 0x2b248 ; 0x2b248 218aa: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> // 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()) { 218ae: 88 23 and r24, r24 218b0: 09 f4 brne .+2 ; 0x218b4 218b2: c8 c0 rjmp .+400 ; 0x21a44 // time to stop the error beep WRITE(BEEPER, LOW); 218b4: 9f b7 in r25, 0x3f ; 63 218b6: f8 94 cli 218b8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 218bc: 8b 7f andi r24, 0xFB ; 251 218be: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 218c2: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 218c4: 0f 94 64 45 call 0x28ac8 ; 0x28ac8 finishAndDisableSteppers(); //M84 218c8: 0e 94 8b 83 call 0x10716 ; 0x10716 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 218cc: 88 e0 ldi r24, 0x08 ; 8 218ce: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df did_pause_print = false; // Clear pause state in case the print was aborted while paused 218d2: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 218d6: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 218da: 82 30 cpi r24, 0x02 ; 2 218dc: 09 f0 breq .+2 ; 0x218e0 218de: 6a c0 rjmp .+212 ; 0x219b4 218e0: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 218e4: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 { if (!blocks_queued() && !homing_flag) 218e8: 98 13 cpse r25, r24 218ea: 64 c0 rjmp .+200 ; 0x219b4 218ec: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 218f0: 81 11 cpse r24, r1 218f2: 60 c0 rjmp .+192 ; 0x219b4 { if (custom_message_type != CustomMsg::M117) 218f4: 80 91 73 07 lds r24, 0x0773 ; 0x800773 218f8: 87 30 cpi r24, 0x07 ; 7 218fa: 41 f0 breq .+16 ; 0x2190c { custom_message_type = CustomMsg::Status; 218fc: 10 92 73 07 sts 0x0773, r1 ; 0x800773 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 21900: 8c e8 ldi r24, 0x8C ; 140 21902: 90 e4 ldi r25, 0x40 ; 64 21904: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 21908: 0f 94 e2 0b call 0x217c4 ; 0x217c4 } lcd_commands_type = LcdCommands::Idle; 2190c: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 21910: 82 e0 ldi r24, 0x02 ; 2 21912: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 21916: 10 92 f5 03 sts 0x03F5, r1 ; 0x8003f5 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 2191a: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 2191e: 10 92 dd 03 sts 0x03DD, r1 ; 0x8003dd return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 21922: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 21926: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 2192a: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.497+0x8> 2192e: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.497+0x9> 21932: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.497+0xa> 21936: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.497+0xb> 2193a: 0e 94 8e 6e call 0xdd1c ; 0xdd1c // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 2193e: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 21942: 88 23 and r24, r24 21944: 51 f1 breq .+84 ; 0x2199a 21946: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 2194a: 88 23 and r24, r24 2194c: 31 f1 breq .+76 ; 0x2199a current_position[X_AXIS] = pause_position[X_AXIS]; 2194e: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.497> 21952: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.497+0x1> 21956: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.497+0x2> 2195a: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.497+0x3> 2195e: 80 93 41 07 sts 0x0741, r24 ; 0x800741 21962: 90 93 42 07 sts 0x0742, r25 ; 0x800742 21966: a0 93 43 07 sts 0x0743, r26 ; 0x800743 2196a: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = pause_position[Y_AXIS]; 2196e: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.497+0x4> 21972: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.497+0x5> 21976: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.497+0x6> 2197a: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.497+0x7> 2197e: 80 93 45 07 sts 0x0745, r24 ; 0x800745 21982: 90 93 46 07 sts 0x0746, r25 ; 0x800746 21986: a0 93 47 07 sts 0x0747, r26 ; 0x800747 2198a: b0 93 48 07 sts 0x0748, r27 ; 0x800748 plan_buffer_line_curposXYZE(50); 2198e: 60 e0 ldi r22, 0x00 ; 0 21990: 70 e0 ldi r23, 0x00 ; 0 21992: 88 e4 ldi r24, 0x48 ; 72 21994: 92 e4 ldi r25, 0x42 ; 66 21996: 0f 94 8b ba call 0x37516 ; 0x37516 2199a: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> } // did we come here from a thermal error? if(get_temp_error()) { 2199e: 88 23 and r24, r24 219a0: 09 f4 brne .+2 ; 0x219a4 219a2: 77 c0 rjmp .+238 ; 0x21a92 // time to stop the error beep WRITE(BEEPER, LOW); 219a4: 9f b7 in r25, 0x3f ; 63 219a6: f8 94 cli 219a8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 219ac: 8b 7f andi r24, 0xFB ; 251 219ae: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 219b2: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 219b4: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 219b8: 84 30 cpi r24, 0x04 ; 4 219ba: 09 f0 breq .+2 ; 0x219be 219bc: a4 c0 rjmp .+328 ; 0x21b06 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 219be: 85 ea ldi r24, 0xA5 ; 165 219c0: 9d e0 ldi r25, 0x0D ; 13 219c2: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 219c6: 30 91 54 0e lds r19, 0x0E54 ; 0x800e54 219ca: 20 91 55 0e lds r18, 0x0E55 ; 0x800e55 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 219ce: 32 13 cpse r19, r18 219d0: 71 c1 rjmp .+738 ; 0x21cb4 219d2: 20 91 7f 10 lds r18, 0x107F ; 0x80107f 219d6: 30 91 80 10 lds r19, 0x1080 ; 0x801080 219da: 23 2b or r18, r19 219dc: 09 f0 breq .+2 ; 0x219e0 219de: 6a c1 rjmp .+724 ; 0x21cb4 219e0: c0 91 58 0e lds r28, 0x0E58 ; 0x800e58 219e4: c1 11 cpse r28, r1 219e6: 66 c1 rjmp .+716 ; 0x21cb4 { if (lcd_commands_step == 0) 219e8: 20 91 f5 03 lds r18, 0x03F5 ; 0x8003f5 219ec: 21 11 cpse r18, r1 219ee: 54 c0 rjmp .+168 ; 0x21a98 lcd_commands_step = 12; 219f0: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 219f2: 20 93 f5 03 sts 0x03F5, r18 ; 0x8003f5 } 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; 219f6: 44 96 adiw r24, 0x14 ; 20 219f8: bc 01 movw r22, r24 219fa: 90 e0 ldi r25, 0x00 ; 0 219fc: 80 e0 ldi r24, 0x00 ; 0 219fe: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 21a02: 20 e0 ldi r18, 0x00 ; 0 21a04: 30 e0 ldi r19, 0x00 ; 0 21a06: 4a e7 ldi r20, 0x7A ; 122 21a08: 54 e4 ldi r21, 0x44 ; 68 21a0a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 21a0e: 4b 01 movw r8, r22 21a10: 5c 01 movw r10, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 21a12: e0 91 f5 03 lds r30, 0x03F5 ; 0x8003f5 21a16: e1 50 subi r30, 0x01 ; 1 21a18: ec 30 cpi r30, 0x0C ; 12 21a1a: 08 f0 brcs .+2 ; 0x21a1e 21a1c: 74 c0 rjmp .+232 ; 0x21b06 21a1e: f0 e0 ldi r31, 0x00 ; 0 21a20: 88 27 eor r24, r24 21a22: ea 5e subi r30, 0xEA ; 234 21a24: f2 4f sbci r31, 0xF2 ; 242 21a26: 8e 4f sbci r24, 0xFE ; 254 21a28: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 21a2c: e5 3a cpi r30, 0xA5 ; 165 21a2e: db 3a cpi r29, 0xAB ; 171 21a30: c9 39 cpi r28, 0x99 ; 153 21a32: c9 39 cpi r28, 0x99 ; 153 21a34: c9 39 cpi r28, 0x99 ; 153 21a36: c9 39 cpi r28, 0x99 ; 153 21a38: 21 3a cpi r18, 0xA1 ; 161 21a3a: d9 39 cpi r29, 0x99 ; 153 21a3c: f9 3a cpi r31, 0xA9 ; 169 21a3e: 1b 3b cpi r17, 0xBB ; 187 21a40: 53 3b cpi r21, 0xB3 ; 179 21a42: 23 3b cpi r18, 0xB3 ; 179 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 21a44: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 // restore the auto hotend state hotendDefaultAutoFanState(); 21a48: 0e 94 1b 77 call 0xee36 ; 0xee36 if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21a4c: 80 91 96 13 lds r24, 0x1396 ; 0x801396 21a50: 81 30 cpi r24, 0x01 ; 1 21a52: 09 f0 breq .+2 ; 0x21a56 21a54: 37 cf rjmp .-402 ; 0x218c4 fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 21a56: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 21a5a: 88 23 and r24, r24 21a5c: 09 f4 brne .+2 ; 0x21a60 21a5e: 32 cf rjmp .-412 ; 0x218c4 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21a60: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 21a64: 82 30 cpi r24, 0x02 ; 2 21a66: 09 f4 brne .+2 ; 0x21a6a 21a68: 2d cf rjmp .-422 ; 0x218c4 #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()) 21a6a: 0e 94 32 68 call 0xd064 ; 0xd064 21a6e: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 21a70: 0e 94 76 65 call 0xcaec ; 0xcaec } // 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) { 21a74: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 21a78: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 21a7c: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 21a80: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 21a84: 28 17 cp r18, r24 21a86: 39 07 cpc r19, r25 21a88: 0c f4 brge .+2 ; 0x21a8c 21a8a: 1c cf rjmp .-456 ; 0x218c4 MMU2::mmu2.unload(); // M702 21a8c: 0f 94 65 a0 call 0x340ca ; 0x340ca 21a90: 19 cf rjmp .-462 ; 0x218c4 } else { // Turn off the print fan fanSpeed = 0; 21a92: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 21a96: 8e cf rjmp .-228 ; 0x219b4 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 21a98: 21 50 subi r18, 0x01 ; 1 21a9a: ab cf rjmp .-170 ; 0x219f2 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 21a9c: 65 e0 ldi r22, 0x05 ; 5 21a9e: 84 eb ldi r24, 0xB4 ; 180 21aa0: 9c e8 ldi r25, 0x8C ; 140 MSG_M702, // Unload filament (MMU only) cmd_cal_finish_8, // Turn off hotend heater MSG_M84 // Disable stepper motors }; lay1cal_common_enqueue_loop(cmd_cal_finish, (sizeof(cmd_cal_finish)/sizeof(cmd_cal_finish[0]))); 21aa2: 0e 94 c2 89 call 0x11384 ; 0x11384 21aa6: 2f c0 rjmp .+94 ; 0x21b06 //! @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()) 21aa8: 80 91 96 13 lds r24, 0x1396 ; 0x801396 21aac: 81 30 cpi r24, 0x01 ; 1 21aae: 49 f5 brne .+82 ; 0x21b02 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 21ab0: d0 91 f4 03 lds r29, 0x03F4 ; 0x8003f4 <_ZL16lay1cal_filament.lto_priv.456> { enquecommand_P(MSG_M83); 21ab4: 61 e0 ldi r22, 0x01 ; 1 21ab6: 8d e1 ldi r24, 0x1D ; 29 21ab8: 9c e6 ldi r25, 0x6C ; 108 21aba: 0e 94 43 89 call 0x11286 ; 0x11286 enquecommand_P(PSTR("G1Y-3F1000")); 21abe: 61 e0 ldi r22, 0x01 ; 1 21ac0: 89 ea ldi r24, 0xA9 ; 169 21ac2: 9c e8 ldi r25, 0x8C ; 140 21ac4: 0e 94 43 89 call 0x11286 ; 0x11286 enquecommand_P(PSTR("G1Z0.4")); 21ac8: 61 e0 ldi r22, 0x01 ; 1 21aca: 82 ea ldi r24, 0xA2 ; 162 21acc: 9c e8 ldi r25, 0x8C ; 140 21ace: 0e 94 43 89 call 0x11286 ; 0x11286 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 21ad2: 0f 94 d5 76 call 0x2edaa ; 0x2edaa if(currentTool == filament ){ 21ad6: d8 17 cp r29, r24 21ad8: a1 f0 breq .+40 ; 0x21b02 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 21ada: 8f 3f cpi r24, 0xFF ; 255 21adc: 29 f0 breq .+10 ; 0x21ae8 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 21ade: 61 e0 ldi r22, 0x01 ; 1 21ae0: 88 e1 ldi r24, 0x18 ; 24 21ae2: 9c e6 ldi r25, 0x6C ; 108 21ae4: 0e 94 43 89 call 0x11286 ; 0x11286 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 21ae8: 1f 92 push r1 21aea: df 93 push r29 21aec: 8e e9 ldi r24, 0x9E ; 158 21aee: 9c e8 ldi r25, 0x8C ; 140 21af0: 9f 93 push r25 21af2: 8f 93 push r24 21af4: 0e 94 e1 89 call 0x113c2 ; 0x113c2 21af8: 0f 90 pop r0 21afa: 0f 90 pop r0 21afc: 0f 90 pop r0 21afe: 0f 90 pop r0 return true; 21b00: c1 e0 ldi r28, 0x01 ; 1 21b02: c0 93 f3 03 sts 0x03F3, r28 ; 0x8003f3 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 21b06: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 21b0a: 83 30 cpi r24, 0x03 ; 3 21b0c: 09 f0 breq .+2 ; 0x21b10 21b0e: d2 c0 rjmp .+420 ; 0x21cb4 if (lcd_commands_step == 0) { 21b10: 90 91 f5 03 lds r25, 0x03F5 ; 0x8003f5 21b14: 91 11 cpse r25, r1 21b16: 09 c0 rjmp .+18 ; 0x21b2a custom_message_type = CustomMsg::PidCal; 21b18: 80 93 73 07 sts 0x0773, r24 ; 0x800773 custom_message_state = 1; 21b1c: 91 e0 ldi r25, 0x01 ; 1 21b1e: 90 93 f1 03 sts 0x03F1, r25 ; 0x8003f1 lcd_draw_update = 3; 21b22: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 21b26: 80 93 f5 03 sts 0x03F5, r24 ; 0x8003f5 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 21b2a: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 21b2e: 83 30 cpi r24, 0x03 ; 3 21b30: 19 f5 brne .+70 ; 0x21b78 21b32: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 21b36: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 21b3a: 98 13 cpse r25, r24 21b3c: 1d c0 rjmp .+58 ; 0x21b78 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 21b3e: 0f 94 4f 45 call 0x28a9e ; 0x28a9e pid_tuning_finished = false; 21b42: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> 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); 21b46: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 21b4a: 8f 93 push r24 21b4c: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.457> 21b50: 8f 93 push r24 21b52: 8f e3 ldi r24, 0x3F ; 63 21b54: 9d e8 ldi r25, 0x8D ; 141 21b56: 9f 93 push r25 21b58: 8f 93 push r24 21b5a: 0e 94 e1 89 call 0x113c2 ; 0x113c2 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 21b5e: 81 e8 ldi r24, 0x81 ; 129 21b60: 90 e4 ldi r25, 0x40 ; 64 21b62: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 21b66: 0f 94 e2 0b call 0x217c4 ; 0x217c4 lcd_commands_step = 2; 21b6a: 82 e0 ldi r24, 0x02 ; 2 21b6c: 80 93 f5 03 sts 0x03F5, r24 ; 0x8003f5 21b70: 0f 90 pop r0 21b72: 0f 90 pop r0 21b74: 0f 90 pop r0 21b76: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 21b78: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 21b7c: 82 30 cpi r24, 0x02 ; 2 21b7e: 09 f0 breq .+2 ; 0x21b82 21b80: 7a c0 rjmp .+244 ; 0x21c76 21b82: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> 21b86: 88 23 and r24, r24 21b88: 09 f4 brne .+2 ; 0x21b8c 21b8a: 75 c0 rjmp .+234 ; 0x21c76 custom_message_state = 0; 21b8c: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 21b90: 8d e6 ldi r24, 0x6D ; 109 21b92: 90 e4 ldi r25, 0x40 ; 64 21b94: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 21b98: 0f 94 e2 0b call 0x217c4 ; 0x217c4 21b9c: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 21ba0: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 21ba4: c0 91 ed 03 lds r28, 0x03ED ; 0x8003ed <_Kp> 21ba8: d0 91 ee 03 lds r29, 0x03EE ; 0x8003ee <_Kp+0x1> 21bac: 10 91 ef 03 lds r17, 0x03EF ; 0x8003ef <_Kp+0x2> 21bb0: 00 91 f0 03 lds r16, 0x03F0 ; 0x8003f0 <_Kp+0x3> 21bb4: 20 e0 ldi r18, 0x00 ; 0 21bb6: 30 e0 ldi r19, 0x00 ; 0 21bb8: a9 01 movw r20, r18 21bba: f8 01 movw r30, r16 21bbc: 6c 2f mov r22, r28 21bbe: 7d 2f mov r23, r29 21bc0: 8f 2f mov r24, r31 21bc2: 9e 2f mov r25, r30 21bc4: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 21bc8: 81 11 cpse r24, r1 21bca: 1f c0 rjmp .+62 ; 0x21c0a 21bcc: 20 e0 ldi r18, 0x00 ; 0 21bce: 30 e0 ldi r19, 0x00 ; 0 21bd0: a9 01 movw r20, r18 21bd2: 60 91 e9 03 lds r22, 0x03E9 ; 0x8003e9 <_Ki> 21bd6: 70 91 ea 03 lds r23, 0x03EA ; 0x8003ea <_Ki+0x1> 21bda: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Ki+0x2> 21bde: 90 91 ec 03 lds r25, 0x03EC ; 0x8003ec <_Ki+0x3> 21be2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 21be6: 81 11 cpse r24, r1 21be8: 10 c0 rjmp .+32 ; 0x21c0a 21bea: 20 e0 ldi r18, 0x00 ; 0 21bec: 30 e0 ldi r19, 0x00 ; 0 21bee: a9 01 movw r20, r18 21bf0: 60 91 e5 03 lds r22, 0x03E5 ; 0x8003e5 <_Kd> 21bf4: 70 91 e6 03 lds r23, 0x03E6 ; 0x8003e6 <_Kd+0x1> 21bf8: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 <_Kd+0x2> 21bfc: 90 91 e8 03 lds r25, 0x03E8 ; 0x8003e8 <_Kd+0x3> 21c00: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 21c04: 88 23 and r24, r24 21c06: 09 f4 brne .+2 ; 0x21c0a 21c08: 7e c2 rjmp .+1276 ; 0x22106 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 21c0a: 80 91 e8 03 lds r24, 0x03E8 ; 0x8003e8 <_Kd+0x3> 21c0e: 8f 93 push r24 21c10: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 <_Kd+0x2> 21c14: 8f 93 push r24 21c16: 80 91 e6 03 lds r24, 0x03E6 ; 0x8003e6 <_Kd+0x1> 21c1a: 8f 93 push r24 21c1c: 80 91 e5 03 lds r24, 0x03E5 ; 0x8003e5 <_Kd> 21c20: 8f 93 push r24 21c22: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Ki+0x3> 21c26: 8f 93 push r24 21c28: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Ki+0x2> 21c2c: 8f 93 push r24 21c2e: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Ki+0x1> 21c32: 8f 93 push r24 21c34: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Ki> 21c38: 8f 93 push r24 21c3a: 0f 93 push r16 21c3c: 1f 93 push r17 21c3e: df 93 push r29 21c40: cf 93 push r28 21c42: 88 e2 ldi r24, 0x28 ; 40 21c44: 9d e8 ldi r25, 0x8D ; 141 21c46: 9f 93 push r25 21c48: 8f 93 push r24 21c4a: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommand_P(MSG_M500); 21c4e: 61 e0 ldi r22, 0x01 ; 1 21c50: 87 e2 ldi r24, 0x27 ; 39 21c52: 9c e6 ldi r25, 0x6C ; 108 21c54: 0e 94 43 89 call 0x11286 ; 0x11286 21c58: 8d b7 in r24, 0x3d ; 61 21c5a: 9e b7 in r25, 0x3e ; 62 21c5c: 0e 96 adiw r24, 0x0e ; 14 21c5e: 0f b6 in r0, 0x3f ; 63 21c60: f8 94 cli 21c62: 9e bf out 0x3e, r25 ; 62 21c64: 0f be out 0x3f, r0 ; 63 21c66: 8d bf out 0x3d, r24 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 21c68: 82 ee ldi r24, 0xE2 ; 226 21c6a: 93 e0 ldi r25, 0x03 ; 3 21c6c: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> lcd_commands_step = 1; 21c70: 81 e0 ldi r24, 0x01 ; 1 21c72: 80 93 f5 03 sts 0x03F5, r24 ; 0x8003f5 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 21c76: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 21c7a: 81 30 cpi r24, 0x01 ; 1 21c7c: d9 f4 brne .+54 ; 0x21cb4 21c7e: 60 ed ldi r22, 0xD0 ; 208 21c80: 77 e0 ldi r23, 0x07 ; 7 21c82: 82 ee ldi r24, 0xE2 ; 226 21c84: 93 e0 ldi r25, 0x03 ; 3 21c86: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 21c8a: 88 23 and r24, r24 21c8c: 99 f0 breq .+38 ; 0x21cb4 lcd_setstatuspgm(MSG_WELCOME); 21c8e: 8a e6 ldi r24, 0x6A ; 106 21c90: 90 e7 ldi r25, 0x70 ; 112 21c92: 0f 94 e2 0b call 0x217c4 ; 0x217c4 custom_message_type = CustomMsg::Status; 21c96: 10 92 73 07 sts 0x0773, r1 ; 0x800773 pid_temp = DEFAULT_PID_TEMP; 21c9a: 82 ed ldi r24, 0xD2 ; 210 21c9c: 90 e0 ldi r25, 0x00 ; 0 21c9e: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 21ca2: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.457> lcd_commands_step = 0; 21ca6: 10 92 f5 03 sts 0x03F5, r1 ; 0x8003f5 lcd_commands_type = LcdCommands::Idle; 21caa: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 21cae: 82 e0 ldi r24, 0x02 ; 2 21cb0: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); } } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) 21cb4: 90 91 63 0e lds r25, 0x0E63 ; 0x800e63 21cb8: 95 30 cpi r25, 0x05 ; 5 21cba: 99 f4 brne .+38 ; 0x21ce2 21cbc: 20 91 7f 10 lds r18, 0x107F ; 0x80107f 21cc0: 30 91 80 10 lds r19, 0x1080 ; 0x801080 21cc4: 23 2b or r18, r19 21cc6: 79 f5 brne .+94 ; 0x21d26 { switch (lcd_commands_step) 21cc8: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 21ccc: 82 30 cpi r24, 0x02 ; 2 21cce: 09 f4 brne .+2 ; 0x21cd2 21cd0: 43 c2 rjmp .+1158 ; 0x22158 21cd2: 08 f0 brcs .+2 ; 0x21cd6 21cd4: 1d c2 rjmp .+1082 ; 0x22110 21cd6: 88 23 and r24, r24 21cd8: 09 f4 brne .+2 ; 0x21cdc 21cda: 2e c2 rjmp .+1116 ; 0x22138 21cdc: 81 30 cpi r24, 0x01 ; 1 21cde: 09 f4 brne .+2 ; 0x21ce2 21ce0: 46 c2 rjmp .+1164 ; 0x2216e break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 21ce2: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 21ce6: 86 30 cpi r24, 0x06 ; 6 21ce8: f1 f4 brne .+60 ; 0x21d26 21cea: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 21cee: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 21cf2: 98 13 cpse r25, r24 21cf4: 18 c0 rjmp .+48 ; 0x21d26 21cf6: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 21cfa: 90 91 80 10 lds r25, 0x1080 ; 0x801080 21cfe: 89 2b or r24, r25 21d00: 91 f4 brne .+36 ; 0x21d26 21d02: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 21d06: 81 11 cpse r24, r1 21d08: 0e c0 rjmp .+28 ; 0x21d26 #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) 21d0a: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 21d0e: 81 30 cpi r24, 0x01 ; 1 21d10: 09 f4 brne .+2 ; 0x21d14 21d12: 85 c2 rjmp .+1290 ; 0x2221e 21d14: 08 f4 brcc .+2 ; 0x21d18 21d16: 45 c2 rjmp .+1162 ; 0x221a2 21d18: 82 30 cpi r24, 0x02 ; 2 21d1a: 09 f4 brne .+2 ; 0x21d1e 21d1c: 6d c2 rjmp .+1242 ; 0x221f8 was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); #endif //THERMAL_MODEL #else //nozzle change without heating while((int)degHotend(active_extruder)>40) { //check temp fanSpeed = 255; //turn on fan 21d1e: cf ef ldi r28, 0xFF ; 255 #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) 21d20: 83 30 cpi r24, 0x03 ; 3 21d22: 09 f4 brne .+2 ; 0x21d26 21d24: 42 c2 rjmp .+1156 ; 0x221aa menu_depth = 3; break; } } } } 21d26: df 91 pop r29 21d28: cf 91 pop r28 21d2a: 1f 91 pop r17 21d2c: 0f 91 pop r16 21d2e: ff 90 pop r15 21d30: ef 90 pop r14 21d32: df 90 pop r13 21d34: cf 90 pop r12 21d36: bf 90 pop r11 21d38: af 90 pop r10 21d3a: 9f 90 pop r9 21d3c: 8f 90 pop r8 21d3e: 7f 90 pop r7 21d40: 6f 90 pop r6 21d42: 5f 90 pop r5 21d44: 4f 90 pop r4 21d46: 3f 90 pop r3 21d48: 2f 90 pop r2 21d4a: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 21d4c: 0e 94 c0 6f call 0xdf80 ; 0xdf80 menu_depth = 0; 21d50: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 menu_submenu(lcd_babystep_z, true); 21d54: 61 e0 ldi r22, 0x01 ; 1 21d56: 83 ee ldi r24, 0xE3 ; 227 21d58: 99 e3 ldi r25, 0x39 ; 57 21d5a: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea cmd_intro_mmu_9, cmd_intro_mmu_10, cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) 21d5e: 80 91 96 13 lds r24, 0x1396 ; 0x801396 21d62: 81 30 cpi r24, 0x01 ; 1 21d64: b9 f4 brne .+46 ; 0x21d94 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 21d66: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 21d6a: 10 e0 ldi r17, 0x00 ; 0 21d6c: 81 11 cpse r24, r1 21d6e: 01 c0 rjmp .+2 ; 0x21d72 21d70: 12 e0 ldi r17, 0x02 ; 2 21d72: c1 2f mov r28, r17 21d74: d0 e0 ldi r29, 0x00 ; 0 21d76: cc 0f add r28, r28 21d78: dd 1f adc r29, r29 21d7a: c4 57 subi r28, 0x74 ; 116 21d7c: d3 47 sbci r29, 0x73 ; 115 { enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); 21d7e: fe 01 movw r30, r28 21d80: 85 91 lpm r24, Z+ 21d82: 94 91 lpm r25, Z 21d84: 61 e0 ldi r22, 0x01 ; 1 21d86: 0e 94 43 89 call 0x11286 ; 0x11286 cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 21d8a: 1f 5f subi r17, 0xFF ; 255 21d8c: 22 96 adiw r28, 0x02 ; 2 21d8e: 19 30 cpi r17, 0x09 ; 9 21d90: b1 f7 brne .-20 ; 0x21d7e 21d92: b9 ce rjmp .-654 ; 0x21b06 enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); } } else { enquecommand_P(feedrate_F1080); //fixed velocity for the intro line 21d94: 61 e0 ldi r22, 0x01 ; 1 21d96: 84 e8 ldi r24, 0x84 ; 132 21d98: 9c e8 ldi r25, 0x8C ; 140 21d9a: 0e 94 43 89 call 0x11286 ; 0x11286 enquecommandf_P(extrude_fmt_X, 60.f, count_e(layer_height, extrusion_width * 4.f, 60)); 21d9e: 20 e0 ldi r18, 0x00 ; 0 21da0: 30 e0 ldi r19, 0x00 ; 0 21da2: 40 e8 ldi r20, 0x80 ; 128 21da4: 50 e4 ldi r21, 0x40 ; 64 21da6: c5 01 movw r24, r10 21da8: b4 01 movw r22, r8 21daa: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 21dae: 20 e0 ldi r18, 0x00 ; 0 21db0: 30 e0 ldi r19, 0x00 ; 0 21db2: 40 e7 ldi r20, 0x70 ; 112 21db4: 52 e4 ldi r21, 0x42 ; 66 21db6: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 21dba: 9f 93 push r25 21dbc: 8f 93 push r24 21dbe: 7f 93 push r23 21dc0: 6f 93 push r22 21dc2: 82 e4 ldi r24, 0x42 ; 66 21dc4: 8f 93 push r24 21dc6: 80 e7 ldi r24, 0x70 ; 112 21dc8: 8f 93 push r24 21dca: 1f 92 push r1 21dcc: 1f 92 push r1 21dce: c7 e7 ldi r28, 0x77 ; 119 21dd0: dc e8 ldi r29, 0x8C ; 140 21dd2: df 93 push r29 21dd4: cf 93 push r28 21dd6: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(extrude_fmt_X, 202.5f, count_e(layer_height, extrusion_width * 8.f, 142.5)); 21dda: 20 e0 ldi r18, 0x00 ; 0 21ddc: 30 e0 ldi r19, 0x00 ; 0 21dde: 40 e0 ldi r20, 0x00 ; 0 21de0: 51 e4 ldi r21, 0x41 ; 65 21de2: c5 01 movw r24, r10 21de4: b4 01 movw r22, r8 21de6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 21dea: 20 e0 ldi r18, 0x00 ; 0 21dec: 30 e8 ldi r19, 0x80 ; 128 21dee: 4e e0 ldi r20, 0x0E ; 14 21df0: 53 e4 ldi r21, 0x43 ; 67 21df2: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 21df6: 9f 93 push r25 21df8: 8f 93 push r24 21dfa: 7f 93 push r23 21dfc: 6f 93 push r22 21dfe: 83 e4 ldi r24, 0x43 ; 67 21e00: 8f 93 push r24 21e02: 8a e4 ldi r24, 0x4A ; 74 21e04: 8f 93 push r24 21e06: 80 e8 ldi r24, 0x80 ; 128 21e08: 8f 93 push r24 21e0a: 1f 92 push r1 21e0c: df 93 push r29 21e0e: cf 93 push r28 21e10: 0e 94 e1 89 call 0x113c2 ; 0x113c2 21e14: 8d b7 in r24, 0x3d ; 61 21e16: 9e b7 in r25, 0x3e ; 62 21e18: 44 96 adiw r24, 0x14 ; 20 21e1a: 0f b6 in r0, 0x3f ; 63 21e1c: f8 94 cli 21e1e: 9e bf out 0x3e, r25 ; 62 21e20: 0f be out 0x3f, r0 ; 63 21e22: 8d bf out 0x3d, r24 ; 61 21e24: 70 ce rjmp .-800 ; 0x21b06 cmd_pre_meander_5, #endif //NEW_FIRST_LAYER_CAL cmd_pre_meander_6, }; lay1cal_common_enqueue_loop(cmd_pre_meander, (sizeof(cmd_pre_meander)/sizeof(cmd_pre_meander[0]))); 21e26: 66 e0 ldi r22, 0x06 ; 6 21e28: 8b e6 ldi r24, 0x6B ; 107 21e2a: 9c e8 ldi r25, 0x8C ; 140 21e2c: 3a ce rjmp .-908 ; 0x21aa2 //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { #ifndef NEW_FIRST_LAYER_CAL enquecommand_P(PSTR("G1X50Y155")); 21e2e: 61 e0 ldi r22, 0x01 ; 1 21e30: 81 e6 ldi r24, 0x61 ; 97 21e32: 9c e8 ldi r25, 0x8C ; 140 21e34: 0e 94 43 89 call 0x11286 ; 0x11286 #endif //_NEW_FIRST_LAYER_CAL static const char fmt1[] PROGMEM = "G1Z%.2f"; enquecommandf_P(fmt1, layer_height); 21e38: 8e e3 ldi r24, 0x3E ; 62 21e3a: 8f 93 push r24 21e3c: 8c e4 ldi r24, 0x4C ; 76 21e3e: 8f 93 push r24 21e40: 8c ec ldi r24, 0xCC ; 204 21e42: 8f 93 push r24 21e44: 8d ec ldi r24, 0xCD ; 205 21e46: 8f 93 push r24 21e48: 89 e5 ldi r24, 0x59 ; 89 21e4a: 9c e8 ldi r25, 0x8C ; 140 21e4c: 9f 93 push r25 21e4e: 8f 93 push r24 21e50: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommand_P(feedrate_F1080); 21e54: 61 e0 ldi r22, 0x01 ; 1 21e56: 84 e8 ldi r24, 0x84 ; 132 21e58: 9c e8 ldi r25, 0x8C ; 140 21e5a: 0e 94 43 89 call 0x11286 ; 0x11286 enquecommand_P(MSG_G91); //enable relative XYZ 21e5e: 61 e0 ldi r22, 0x01 ; 1 21e60: 84 e1 ldi r24, 0x14 ; 20 21e62: 9c e6 ldi r25, 0x6C ; 108 21e64: 0e 94 43 89 call 0x11286 ; 0x11286 #ifdef NEW_FIRST_LAYER_CAL enquecommandf_P(extrude_fmt_Y, short_length, count_e(layer_height, extrusion_width, short_length)); enquecommandf_P(extrude_fmt_X, long_length*invert, count_e(layer_height, extrusion_width, long_length)); enquecommandf_P(extrude_fmt_Y, -short_length*invert, count_e(layer_height, extrusion_width, short_length)); #else enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 4.f, 25)); 21e68: 20 e0 ldi r18, 0x00 ; 0 21e6a: 30 e0 ldi r19, 0x00 ; 0 21e6c: 40 e8 ldi r20, 0x80 ; 128 21e6e: 50 e4 ldi r21, 0x40 ; 64 21e70: c5 01 movw r24, r10 21e72: b4 01 movw r22, r8 21e74: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 21e78: 20 e0 ldi r18, 0x00 ; 0 21e7a: 30 e0 ldi r19, 0x00 ; 0 21e7c: 48 ec ldi r20, 0xC8 ; 200 21e7e: 51 e4 ldi r21, 0x41 ; 65 21e80: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 21e84: 9f 93 push r25 21e86: 8f 93 push r24 21e88: 7f 93 push r23 21e8a: 6f 93 push r22 21e8c: 01 e4 ldi r16, 0x41 ; 65 21e8e: 0f 93 push r16 21e90: 18 ec ldi r17, 0xC8 ; 200 21e92: 1f 93 push r17 21e94: 1f 92 push r1 21e96: 1f 92 push r1 21e98: c7 e7 ldi r28, 0x77 ; 119 21e9a: dc e8 ldi r29, 0x8C ; 140 21e9c: df 93 push r29 21e9e: cf 93 push r28 21ea0: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 2.f, 25)); 21ea4: a5 01 movw r20, r10 21ea6: 94 01 movw r18, r8 21ea8: c5 01 movw r24, r10 21eaa: b4 01 movw r22, r8 21eac: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 21eb0: 20 e0 ldi r18, 0x00 ; 0 21eb2: 30 e0 ldi r19, 0x00 ; 0 21eb4: 48 ec ldi r20, 0xC8 ; 200 21eb6: 51 e4 ldi r21, 0x41 ; 65 21eb8: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 21ebc: 9f 93 push r25 21ebe: 8f 93 push r24 21ec0: 7f 93 push r23 21ec2: 6f 93 push r22 21ec4: 0f 93 push r16 21ec6: 1f 93 push r17 21ec8: 1f 92 push r1 21eca: 1f 92 push r1 21ecc: df 93 push r29 21ece: cf 93 push r28 21ed0: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(extrude_fmt_X, 100.f*invert, count_e(layer_height, extrusion_width, 100)); 21ed4: 20 e0 ldi r18, 0x00 ; 0 21ed6: 30 e0 ldi r19, 0x00 ; 0 21ed8: 48 ec ldi r20, 0xC8 ; 200 21eda: 52 e4 ldi r21, 0x42 ; 66 21edc: c5 01 movw r24, r10 21ede: b4 01 movw r22, r8 21ee0: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 21ee4: 9f 93 push r25 21ee6: 8f 93 push r24 21ee8: 7f 93 push r23 21eea: 6f 93 push r22 21eec: 82 e4 ldi r24, 0x42 ; 66 21eee: 8f 93 push r24 21ef0: 1f 93 push r17 21ef2: 1f 92 push r1 21ef4: 1f 92 push r1 21ef6: df 93 push r29 21ef8: cf 93 push r28 21efa: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(extrude_fmt_Y, -20.f*invert, count_e(layer_height, extrusion_width, 20)); 21efe: 8d b7 in r24, 0x3d ; 61 21f00: 9e b7 in r25, 0x3e ; 62 21f02: 84 96 adiw r24, 0x24 ; 36 21f04: 0f b6 in r0, 0x3f ; 63 21f06: f8 94 cli 21f08: 9e bf out 0x3e, r25 ; 62 21f0a: 0f be out 0x3f, r0 ; 63 21f0c: 8d bf out 0x3d, r24 ; 61 21f0e: 20 e0 ldi r18, 0x00 ; 0 21f10: 30 e0 ldi r19, 0x00 ; 0 21f12: 40 ea ldi r20, 0xA0 ; 160 21f14: 51 e4 ldi r21, 0x41 ; 65 21f16: c5 01 movw r24, r10 21f18: b4 01 movw r22, r8 21f1a: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 21f1e: 9f 93 push r25 21f20: 8f 93 push r24 21f22: 7f 93 push r23 21f24: 6f 93 push r22 21f26: 81 ec ldi r24, 0xC1 ; 193 21f28: 8f 93 push r24 21f2a: 80 ea ldi r24, 0xA0 ; 160 21f2c: 8f 93 push r24 21f2e: 1f 92 push r1 21f30: 1f 92 push r1 21f32: 8c e4 ldi r24, 0x4C ; 76 21f34: 9c e8 ldi r25, 0x8C ; 140 21f36: 9f 93 push r25 21f38: 8f 93 push r24 21f3a: 0e 94 e1 89 call 0x113c2 ; 0x113c2 21f3e: 8d b7 in r24, 0x3d ; 61 21f40: 9e b7 in r25, 0x3e ; 62 21f42: 0a 96 adiw r24, 0x0a ; 10 21f44: 0f b6 in r0, 0x3f ; 63 21f46: f8 94 cli 21f48: 9e bf out 0x3e, r25 ; 62 21f4a: 0f be out 0x3f, r0 ; 63 21f4c: 8d bf out 0x3d, r24 ; 61 21f4e: db cd rjmp .-1098 ; 0x21b06 //! @brief Print meander //! @param cmd_buffer character buffer needed to format gcodes void lay1cal_meander(float layer_height, float extrusion_width) { const float long_extrusion = count_e(layer_height, extrusion_width, long_length); 21f50: 20 e0 ldi r18, 0x00 ; 0 21f52: 30 e0 ldi r19, 0x00 ; 0 21f54: 46 e1 ldi r20, 0x16 ; 22 21f56: 53 e4 ldi r21, 0x43 ; 67 21f58: c5 01 movw r24, r10 21f5a: b4 01 movw r22, r8 21f5c: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 21f60: 76 2e mov r7, r22 21f62: 67 2e mov r6, r23 21f64: 58 2e mov r5, r24 21f66: 49 2e mov r4, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 21f68: 20 e0 ldi r18, 0x00 ; 0 21f6a: 30 e0 ldi r19, 0x00 ; 0 21f6c: 40 ea ldi r20, 0xA0 ; 160 21f6e: 51 e4 ldi r21, 0x41 ; 65 21f70: c5 01 movw r24, r10 21f72: b4 01 movw r22, r8 21f74: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 21f78: b6 2e mov r11, r22 21f7a: a7 2e mov r10, r23 21f7c: 98 2e mov r9, r24 21f7e: 89 2e mov r8, r25 21f80: c5 e0 ldi r28, 0x05 ; 5 for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 21f82: df ef ldi r29, 0xFF ; 255 { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 21f84: 27 e7 ldi r18, 0x77 ; 119 21f86: e2 2e mov r14, r18 21f88: 2c e8 ldi r18, 0x8C ; 140 21f8a: f2 2e mov r15, r18 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 21f8c: 31 ec ldi r19, 0xC1 ; 193 21f8e: c3 2e mov r12, r19 21f90: 40 ea ldi r20, 0xA0 ; 160 21f92: d4 2e mov r13, r20 21f94: 0c e4 ldi r16, 0x4C ; 76 21f96: 1c e8 ldi r17, 0x8C ; 140 const float long_extrusion = count_e(layer_height, extrusion_width, long_length); const float short_extrusion = count_e(layer_height, extrusion_width, short_length); for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 21f98: 4f 92 push r4 21f9a: 5f 92 push r5 21f9c: 6f 92 push r6 21f9e: 7f 92 push r7 21fa0: 6d 2f mov r22, r29 21fa2: 0d 2e mov r0, r29 21fa4: 00 0c add r0, r0 21fa6: 77 0b sbc r23, r23 21fa8: 88 0b sbc r24, r24 21faa: 99 0b sbc r25, r25 21fac: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 21fb0: 20 e0 ldi r18, 0x00 ; 0 21fb2: 30 e0 ldi r19, 0x00 ; 0 21fb4: 46 e1 ldi r20, 0x16 ; 22 21fb6: 53 e4 ldi r21, 0x43 ; 67 21fb8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 21fbc: 9f 93 push r25 21fbe: 8f 93 push r24 21fc0: 7f 93 push r23 21fc2: 6f 93 push r22 21fc4: ff 92 push r15 21fc6: ef 92 push r14 21fc8: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 21fcc: 8f 92 push r8 21fce: 9f 92 push r9 21fd0: af 92 push r10 21fd2: bf 92 push r11 21fd4: cf 92 push r12 21fd6: df 92 push r13 21fd8: 1f 92 push r1 21fda: 1f 92 push r1 21fdc: 1f 93 push r17 21fde: 0f 93 push r16 21fe0: 0e 94 e1 89 call 0x113c2 ; 0x113c2 void lay1cal_meander(float layer_height, float 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); for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 21fe4: d1 95 neg r29 21fe6: c1 50 subi r28, 0x01 ; 1 21fe8: 8d b7 in r24, 0x3d ; 61 21fea: 9e b7 in r25, 0x3e ; 62 21fec: 44 96 adiw r24, 0x14 ; 20 21fee: 0f b6 in r0, 0x3f ; 63 21ff0: f8 94 cli 21ff2: 9e bf out 0x3e, r25 ; 62 21ff4: 0f be out 0x3f, r0 ; 63 21ff6: 8d bf out 0x3d, r24 ; 61 21ff8: c1 11 cpse r28, r1 21ffa: ce cf rjmp .-100 ; 0x21f98 21ffc: 84 cd rjmp .-1272 ; 0x21b06 //! @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); 21ffe: 23 e4 ldi r18, 0x43 ; 67 22000: 3d ec ldi r19, 0xCD ; 205 22002: 4f e2 ldi r20, 0x2F ; 47 22004: 5d e3 ldi r21, 0x3D ; 61 22006: c5 01 movw r24, r10 22008: b4 01 movw r22, r8 2200a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 2200e: 6b 01 movw r12, r22 22010: 7c 01 movw r14, r24 //! //! @param cmd_buffer character buffer needed to format gcodes void lay1cal_square(float layer_height, float extrusion_width) { const float Y_spacing = spacing(layer_height, extrusion_width); const float long_extrusion = count_e(layer_height, extrusion_width, square_width); 22012: 20 e0 ldi r18, 0x00 ; 0 22014: 30 e0 ldi r19, 0x00 ; 0 22016: 40 ea ldi r20, 0xA0 ; 160 22018: 51 e4 ldi r21, 0x41 ; 65 2201a: c5 01 movw r24, r10 2201c: b4 01 movw r22, r8 2201e: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 22022: 66 2e mov r6, r22 22024: 57 2e mov r5, r23 22026: 48 2e mov r4, r24 22028: 39 2e mov r3, r25 const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); 2202a: a7 01 movw r20, r14 2202c: 96 01 movw r18, r12 2202e: c5 01 movw r24, r10 22030: b4 01 movw r22, r8 22032: 0f 94 8e 87 call 0x30f1c ; 0x30f1c 22036: 26 2e mov r2, r22 22038: a7 2e mov r10, r23 2203a: 98 2e mov r9, r24 2203c: 89 2e mov r8, r25 2203e: 84 e0 ldi r24, 0x04 ; 4 22040: b8 2e mov r11, r24 for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 22042: 90 ea ldi r25, 0xA0 ; 160 22044: 79 2e mov r7, r25 22046: 07 e7 ldi r16, 0x77 ; 119 22048: 1c e8 ldi r17, 0x8C ; 140 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 2204a: f7 fa bst r15, 7 2204c: f0 94 com r15 2204e: f7 f8 bld r15, 7 22050: f0 94 com r15 22052: cc e4 ldi r28, 0x4C ; 76 22054: dc e8 ldi r29, 0x8C ; 140 const float long_extrusion = count_e(layer_height, extrusion_width, square_width); const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 22056: 3f 92 push r3 22058: 4f 92 push r4 2205a: 5f 92 push r5 2205c: 6f 92 push r6 2205e: 91 e4 ldi r25, 0x41 ; 65 22060: 9f 93 push r25 22062: 7f 92 push r7 22064: 1f 92 push r1 22066: 1f 92 push r1 22068: 1f 93 push r17 2206a: 0f 93 push r16 2206c: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 22070: 8f 92 push r8 22072: 9f 92 push r9 22074: af 92 push r10 22076: 2f 92 push r2 22078: ff 92 push r15 2207a: ef 92 push r14 2207c: df 92 push r13 2207e: cf 92 push r12 22080: df 93 push r29 22082: cf 93 push r28 22084: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(extrude_fmt_X, -square_width*invert, long_extrusion); 22088: 3f 92 push r3 2208a: 4f 92 push r4 2208c: 5f 92 push r5 2208e: 6f 92 push r6 22090: 81 ec ldi r24, 0xC1 ; 193 22092: 8f 93 push r24 22094: 7f 92 push r7 22096: 1f 92 push r1 22098: 1f 92 push r1 2209a: 1f 93 push r17 2209c: 0f 93 push r16 2209e: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 220a2: 8f 92 push r8 220a4: 9f 92 push r9 220a6: af 92 push r10 220a8: 2f 92 push r2 220aa: ff 92 push r15 220ac: ef 92 push r14 220ae: df 92 push r13 220b0: cf 92 push r12 220b2: df 93 push r29 220b4: cf 93 push r28 220b6: 0e 94 e1 89 call 0x113c2 ; 0x113c2 220ba: ba 94 dec r11 { const float Y_spacing = spacing(layer_height, extrusion_width); const float long_extrusion = count_e(layer_height, extrusion_width, square_width); const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); for (uint8_t i = 0; i < 4; i++) 220bc: 8d b7 in r24, 0x3d ; 61 220be: 9e b7 in r25, 0x3e ; 62 220c0: 88 96 adiw r24, 0x28 ; 40 220c2: 0f b6 in r0, 0x3f ; 63 220c4: f8 94 cli 220c6: 9e bf out 0x3e, r25 ; 62 220c8: 0f be out 0x3f, r0 ; 63 220ca: 8d bf out 0x3d, r24 ; 61 220cc: b1 10 cpse r11, r1 220ce: c3 cf rjmp .-122 ; 0x22056 220d0: 1a cd rjmp .-1484 ; 0x21b06 MSG_M702, // Unload filament (MMU only) cmd_cal_finish_8, // Turn off hotend heater MSG_M84 // Disable stepper motors }; lay1cal_common_enqueue_loop(cmd_cal_finish, (sizeof(cmd_cal_finish)/sizeof(cmd_cal_finish[0]))); 220d2: 69 e0 ldi r22, 0x09 ; 9 220d4: 8a e3 ldi r24, 0x3A ; 58 220d6: 9c e8 ldi r25, 0x8C ; 140 220d8: e4 cc rjmp .-1592 ; 0x21aa2 break; case 2: lay1cal_finish(); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 220da: 8a e6 ldi r24, 0x6A ; 106 220dc: 90 e7 ldi r25, 0x70 ; 112 220de: 0f 94 e2 0b call 0x217c4 ; 0x217c4 lcd_commands_step = 0; 220e2: 10 92 f5 03 sts 0x03F5, r1 ; 0x8003f5 lcd_commands_type = LcdCommands::Idle; 220e6: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 220ea: 82 e0 ldi r24, 0x02 ; 2 220ec: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 220f0: 8f e5 ldi r24, 0x5F ; 95 220f2: 9f e0 ldi r25, 0x0F ; 15 220f4: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 220f8: 88 23 and r24, r24 220fa: 09 f4 brne .+2 ; 0x220fe 220fc: db cd rjmp .-1098 ; 0x21cb4 lcd_wizard(WizState::RepeatLay1Cal); 220fe: 8c e0 ldi r24, 0x0C ; 12 22100: 0f 94 02 66 call 0x2cc04 ; 0x2cc04 22104: 00 cd rjmp .-1536 ; 0x21b06 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."); 22106: 88 ef ldi r24, 0xF8 ; 248 22108: 9c e8 ldi r25, 0x8C ; 140 2210a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2210e: ac cd rjmp .-1192 ; 0x21c68 } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 22110: 84 30 cpi r24, 0x04 ; 4 22112: a9 f0 breq .+42 ; 0x2213e 22114: c0 f0 brcs .+48 ; 0x22146 22116: 85 30 cpi r24, 0x05 ; 5 22118: 09 f0 breq .+2 ; 0x2211c 2211a: e3 cd rjmp .-1082 ; 0x21ce2 case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 2211c: 61 e0 ldi r22, 0x01 ; 1 2211e: 81 e2 ldi r24, 0x21 ; 33 22120: 9c e6 ldi r25, 0x6C ; 108 22122: 0e 94 43 89 call 0x11286 ; 0x11286 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 22126: 61 e0 ldi r22, 0x01 ; 1 22128: 82 ee ldi r24, 0xE2 ; 226 2212a: 9c e8 ldi r25, 0x8C ; 140 2212c: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_commands_step = 4; 22130: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 22132: 80 93 f5 03 sts 0x03F5, r24 ; 0x8003f5 22136: d5 cd rjmp .-1110 ; 0x21ce2 if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 22138: 90 93 f5 03 sts 0x03F5, r25 ; 0x8003f5 2213c: ef cf rjmp .-34 ; 0x2211c enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 2213e: 0f 94 24 59 call 0x2b248 ; 0x2b248 lcd_commands_step = 3; 22142: 83 e0 ldi r24, 0x03 ; 3 22144: f6 cf rjmp .-20 ; 0x22132 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 22146: 10 92 3d 02 sts 0x023D, r1 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> break; case 3: thermal_model_set_warn_beep(false); enquecommand_P(PSTR("M310 A F1")); 2214a: 61 e0 ldi r22, 0x01 ; 1 2214c: 88 ed ldi r24, 0xD8 ; 216 2214e: 9c e8 ldi r25, 0x8C ; 140 22150: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_commands_step = 2; 22154: 82 e0 ldi r24, 0x02 ; 2 22156: ed cf rjmp .-38 ; 0x22132 break; case 2: if (thermal_model_autotune_result()) 22158: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> 2215c: 81 11 cpse r24, r1 2215e: 05 c0 rjmp .+10 ; 0x2216a enquecommand_P(MSG_M500); 22160: 61 e0 ldi r22, 0x01 ; 1 22162: 87 e2 ldi r24, 0x27 ; 39 22164: 9c e6 ldi r25, 0x6C ; 108 22166: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_commands_step = 1; 2216a: 81 e0 ldi r24, 0x01 ; 1 2216c: e2 cf rjmp .-60 ; 0x22132 break; case 1: lcd_commands_step = 0; 2216e: 10 92 f5 03 sts 0x03F5, r1 ; 0x8003f5 lcd_commands_type = LcdCommands::Idle; 22172: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 22176: 92 e0 ldi r25, 0x02 ; 2 22178: 90 93 65 0e sts 0x0E65, r25 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 2217c: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> SetPrinterState(PrinterState::Idle); thermal_model_set_warn_beep(true); bool res = thermal_model_autotune_result(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 22180: 8f e5 ldi r24, 0x5F ; 95 22182: 9f e0 ldi r25, 0x0F ; 15 22184: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 22188: 88 23 and r24, r24 2218a: 09 f4 brne .+2 ; 0x2218e 2218c: cc cd rjmp .-1128 ; 0x21d26 // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 2218e: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> 22192: 81 11 cpse r24, r1 22194: 04 c0 rjmp .+8 ; 0x2219e 22196: 81 e0 ldi r24, 0x01 ; 1 22198: 0f 94 02 66 call 0x2cc04 ; 0x2cc04 2219c: a2 cd rjmp .-1212 ; 0x21ce2 2219e: 8e e0 ldi r24, 0x0E ; 14 221a0: fb cf rjmp .-10 ; 0x22198 #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 221a2: 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; 221a4: 80 93 f5 03 sts 0x03F5, r24 ; 0x8003f5 221a8: be cd rjmp .-1156 ; 0x21d26 #ifdef THERMAL_MODEL was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); #endif //THERMAL_MODEL #else //nozzle change without heating while((int)degHotend(active_extruder)>40) { //check temp 221aa: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 221ae: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 221b2: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 221b6: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 221ba: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 221be: 69 32 cpi r22, 0x29 ; 41 221c0: 71 05 cpc r23, r1 221c2: 74 f0 brlt .+28 ; 0x221e0 fanSpeed = 255; //turn on fan 221c4: c0 93 e1 03 sts 0x03E1, r28 ; 0x8003e1 disable_heater(); 221c8: 0f 94 4f 45 call 0x28a9e ; 0x28a9e uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_COOLDOWN), true, LCD_LEFT_BUTTON_CHOICE); 221cc: 89 e4 ldi r24, 0x49 ; 73 221ce: 90 e4 ldi r25, 0x40 ; 64 221d0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 221d4: 40 e0 ldi r20, 0x00 ; 0 221d6: 61 e0 ldi r22, 0x01 ; 1 221d8: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 221dc: 81 30 cpi r24, 0x01 ; 1 221de: 29 f7 brne .-54 ; 0x221aa break; } } enquecommand_P(G28W); //home 221e0: 61 e0 ldi r22, 0x01 ; 1 221e2: 81 e2 ldi r24, 0x21 ; 33 221e4: 9c e6 ldi r25, 0x6C ; 108 221e6: 0e 94 43 89 call 0x11286 ; 0x11286 enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center 221ea: 61 e0 ldi r22, 0x01 ; 1 221ec: 85 ec ldi r24, 0xC5 ; 197 221ee: 9c e8 ldi r25, 0x8C ; 140 221f0: 0e 94 43 89 call 0x11286 ; 0x11286 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 221f4: 82 e0 ldi r24, 0x02 ; 2 221f6: d6 cf rjmp .-84 ; 0x221a4 break; case 2: enquecommand_P(PSTR("M84 XY")); 221f8: 61 e0 ldi r22, 0x01 ; 1 221fa: 8e eb ldi r24, 0xBE ; 190 221fc: 9c e8 ldi r25, 0x8C ; 140 221fe: 0e 94 43 89 call 0x11286 ; 0x11286 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 22202: 87 e3 ldi r24, 0x37 ; 55 22204: 90 e4 ldi r25, 0x40 ; 64 22206: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2220a: 41 e0 ldi r20, 0x01 ; 1 2220c: 60 e0 ldi r22, 0x00 ; 0 2220e: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 22212: 81 11 cpse r24, r1 22214: 88 cd rjmp .-1264 ; 0x21d26 setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan 22216: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 2221a: 81 e0 ldi r24, 0x01 ; 1 2221c: c3 cf rjmp .-122 ; 0x221a4 } break; case 1: lcd_commands_step = 0; 2221e: 10 92 f5 03 sts 0x03F5, r1 ; 0x8003f5 lcd_commands_type = LcdCommands::Idle; 22222: 10 92 63 0e sts 0x0E63, r1 ; 0x800e63 22226: 82 e0 ldi r24, 0x02 ; 2 22228: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 2222c: 20 e0 ldi r18, 0x00 ; 0 2222e: 41 e0 ldi r20, 0x01 ; 1 22230: 62 e0 ldi r22, 0x02 ; 2 22232: 70 e0 ldi r23, 0x00 ; 0 22234: 8b e0 ldi r24, 0x0B ; 11 22236: 9b e3 ldi r25, 0x3B ; 59 22238: 0f 94 32 cf call 0x39e64 ; 0x39e64 menu_depth = 3; 2223c: 83 e0 ldi r24, 0x03 ; 3 2223e: 80 93 f2 03 sts 0x03F2, r24 ; 0x8003f2 22242: 71 cd rjmp .-1310 ; 0x21d26 00022244 : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 22244: 0f 93 push r16 22246: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 22248: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2224c: 80 95 com r24 2224e: 81 70 andi r24, 0x01 ; 1 22250: 90 91 0c 04 lds r25, 0x040C ; 0x80040c 22254: 89 17 cp r24, r25 22256: a1 f1 breq .+104 ; 0x222c0 { if(menu_menu == lcd_sdcard_menu) { 22258: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 2225c: 90 91 68 0e lds r25, 0x0E68 ; 0x800e68 22260: 8b 56 subi r24, 0x6B ; 107 22262: 99 43 sbci r25, 0x39 ; 57 22264: 11 f4 brne .+4 ; 0x2226a // 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(); 22266: 0f 94 d0 d1 call 0x3a3a0 ; 0x3a3a0 } lcd_draw_update = 2; 2226a: 82 e0 ldi r24, 0x02 ; 2 2226c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 22270: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22274: 80 95 com r24 22276: 81 70 andi r24, 0x01 ; 1 22278: 80 93 0c 04 sts 0x040C, r24 ; 0x80040c lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2227c: 0e 94 39 70 call 0xe072 ; 0xe072 backlight_wake(); 22280: 80 e0 ldi r24, 0x00 ; 0 22282: 0e 94 98 8b call 0x11730 ; 0x11730 if (lcd_oldcardstatus) 22286: 80 91 0c 04 lds r24, 0x040C ; 0x80040c 2228a: 88 23 and r24, r24 2228c: 09 f4 brne .+2 ; 0x22290 2228e: 71 c0 rjmp .+226 ; 0x22372 { if (!card.mounted) 22290: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 22294: 81 11 cpse r24, r1 22296: 05 c0 rjmp .+10 ; 0x222a2 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 22298: 0f 94 70 81 call 0x302e0 ; 0x302e0 card.presort_flag = true; //force sorting of the SD menu 2229c: 81 e0 ldi r24, 0x01 ; 1 2229e: 80 93 bb 14 sts 0x14BB, r24 ; 0x8014bb } LCD_MESSAGERPGM(MSG_WELCOME); 222a2: 8a e6 ldi r24, 0x6A ; 106 222a4: 90 e7 ldi r25, 0x70 ; 112 222a6: 0f 94 e2 0b call 0x217c4 ; 0x217c4 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 222aa: 10 92 db 03 sts 0x03DB, r1 ; 0x8003db menu_submenu(lcd_sdcard_menu, true); 222ae: 61 e0 ldi r22, 0x01 ; 1 222b0: 8b e6 ldi r24, 0x6B ; 107 222b2: 99 e3 ldi r25, 0x39 ; 57 222b4: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea lcd_timeoutToStatus.start(); 222b8: 86 ed ldi r24, 0xD6 ; 214 222ba: 93 e0 ldi r25, 0x03 ; 3 222bc: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 222c0: 0f 94 83 3f call 0x27f06 ; 0x27f06 222c4: 00 91 d2 03 lds r16, 0x03D2 ; 0x8003d2 222c8: 10 91 d3 03 lds r17, 0x03D3 ; 0x8003d3 222cc: 20 91 d4 03 lds r18, 0x03D4 ; 0x8003d4 222d0: 30 91 d5 03 lds r19, 0x03D5 ; 0x8003d5 222d4: 06 17 cp r16, r22 222d6: 17 07 cpc r17, r23 222d8: 28 07 cpc r18, r24 222da: 39 07 cpc r19, r25 222dc: e8 f5 brcc .+122 ; 0x22358 { if (lcd_draw_update) { 222de: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 222e2: 88 23 and r24, r24 222e4: 31 f0 breq .+12 ; 0x222f2 lcd_timeoutToStatus.start(); 222e6: 86 ed ldi r24, 0xD6 ; 214 222e8: 93 e0 ldi r25, 0x03 ; 3 222ea: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> lcd_frame_start(); 222ee: 0e 94 41 6f call 0xde82 ; 0xde82 } (*menu_menu)(); 222f2: e0 91 67 0e lds r30, 0x0E67 ; 0x800e67 222f6: f0 91 68 0e lds r31, 0x0E68 ; 0x800e68 222fa: 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)))); 222fc: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 22300: 90 91 68 0e lds r25, 0x0E68 ; 0x800e68 22304: 83 5e subi r24, 0xE3 ; 227 22306: 99 43 sbci r25, 0x39 ; 57 22308: 09 f4 brne .+2 ; 0x2230c 2230a: 46 c0 rjmp .+140 ; 0x22398 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 2230c: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 22310: 90 91 68 0e lds r25, 0x0E68 ; 0x800e68 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 22314: 2a e3 ldi r18, 0x3A ; 58 22316: 8b 33 cpi r24, 0x3B ; 59 22318: 92 07 cpc r25, r18 2231a: 09 f0 breq .+2 ; 0x2231e 2231c: 5e c0 rjmp .+188 ; 0x223da } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 2231e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22322: 82 30 cpi r24, 0x02 ; 2 22324: 21 f4 brne .+8 ; 0x2232e #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 22326: 0e 94 39 70 call 0xe072 ; 0xe072 lcd_status_message_idx = 0; // Re-draw message from beginning 2232a: 10 92 37 05 sts 0x0537, r1 ; 0x800537 <_ZL22lcd_status_message_idx.lto_priv.464> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 2232e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22332: 88 23 and r24, r24 22334: 19 f0 breq .+6 ; 0x2233c 22336: 81 50 subi r24, 0x01 ; 1 22338: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 2233c: 0f 94 83 3f call 0x27f06 ; 0x27f06 22340: 6c 59 subi r22, 0x9C ; 156 22342: 7f 4f sbci r23, 0xFF ; 255 22344: 8f 4f sbci r24, 0xFF ; 255 22346: 9f 4f sbci r25, 0xFF ; 255 22348: 60 93 d2 03 sts 0x03D2, r22 ; 0x8003d2 2234c: 70 93 d3 03 sts 0x03D3, r23 ; 0x8003d3 22350: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 22354: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 22358: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2235c: 84 30 cpi r24, 0x04 ; 4 2235e: 09 f0 breq .+2 ; 0x22362 22360: 53 c0 rjmp .+166 ; 0x22408 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) { 22362: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 22366: 81 11 cpse r24, r1 22368: 4f c0 rjmp .+158 ; 0x22408 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(); } 2236a: 1f 91 pop r17 2236c: 0f 91 pop r16 2236e: 0d 94 f3 0b jmp 0x217e6 ; 0x217e6 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 22372: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c mounted = false; 22376: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d SERIAL_ECHO_START; 2237a: 82 ee ldi r24, 0xE2 ; 226 2237c: 99 ea ldi r25, 0xA9 ; 169 2237e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 22382: 89 ec ldi r24, 0xC9 ; 201 22384: 9b e6 ldi r25, 0x6B ; 107 22386: 0e 94 fe 7a call 0xf5fc ; 0xf5fc lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 2238a: 8a e0 ldi r24, 0x0A ; 10 2238c: 90 e4 ldi r25, 0x40 ; 64 2238e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22392: 0f 94 e2 0b call 0x217c4 ; 0x217c4 22396: 94 cf rjmp .-216 ; 0x222c0 // 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)))); 22398: 0e 94 4c 68 call 0xd098 ; 0xd098 2239c: 81 11 cpse r24, r1 2239e: 0e c0 rjmp .+28 ; 0x223bc 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) 223a0: e0 91 67 0e lds r30, 0x0E67 ; 0x800e67 223a4: f0 91 68 0e lds r31, 0x0E68 ; 0x800e68 223a8: 30 97 sbiw r30, 0x00 ; 0 223aa: 39 f5 brne .+78 ; 0x223fa { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 223ac: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_return_to_status(); 223b0: 0f 94 4b 27 call 0x24e96 ; 0x24e96 lcd_draw_update = 2; 223b4: 82 e0 ldi r24, 0x02 ; 2 223b6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 223ba: b1 cf rjmp .-158 ; 0x2231e // 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)))); 223bc: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 223c0: 81 11 cpse r24, r1 223c2: a4 cf rjmp .-184 ; 0x2230c 223c4: 40 e9 ldi r20, 0x90 ; 144 223c6: 5f e5 ldi r21, 0x5F ; 95 223c8: 61 e0 ldi r22, 0x01 ; 1 223ca: 70 e0 ldi r23, 0x00 ; 0 223cc: 86 ed ldi r24, 0xD6 ; 214 223ce: 93 e0 ldi r25, 0x03 ; 3 223d0: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 223d4: 81 11 cpse r24, r1 223d6: e4 cf rjmp .-56 ; 0x223a0 223d8: 99 cf rjmp .-206 ; 0x2230c } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 223da: 83 5e subi r24, 0xE3 ; 227 223dc: 99 43 sbci r25, 0x39 ; 57 223de: 09 f4 brne .+2 ; 0x223e2 223e0: 9e cf rjmp .-196 ; 0x2231e && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 223e2: 40 e3 ldi r20, 0x30 ; 48 223e4: 55 e7 ldi r21, 0x75 ; 117 223e6: 60 e0 ldi r22, 0x00 ; 0 223e8: 70 e0 ldi r23, 0x00 ; 0 223ea: 86 ed ldi r24, 0xD6 ; 214 223ec: 93 e0 ldi r25, 0x03 ; 3 223ee: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 223f2: 88 23 and r24, r24 223f4: 09 f4 brne .+2 ; 0x223f8 223f6: 93 cf rjmp .-218 ; 0x2231e 223f8: d3 cf rjmp .-90 ; 0x223a0 // 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; 223fa: 81 e0 ldi r24, 0x01 ; 1 223fc: 80 93 d1 03 sts 0x03D1, r24 ; 0x8003d1 (*menu_menu)(); 22400: 19 95 eicall menu_leaving = 0; 22402: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 22406: d2 cf rjmp .-92 ; 0x223ac 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(); } 22408: 1f 91 pop r17 2240a: 0f 91 pop r16 2240c: 08 95 ret 0002240e : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 2240e: 2f 92 push r2 22410: 3f 92 push r3 22412: 4f 92 push r4 22414: 5f 92 push r5 22416: 6f 92 push r6 22418: 7f 92 push r7 2241a: 8f 92 push r8 2241c: 9f 92 push r9 2241e: af 92 push r10 22420: bf 92 push r11 22422: cf 92 push r12 22424: df 92 push r13 22426: ef 92 push r14 22428: ff 92 push r15 2242a: 0f 93 push r16 2242c: 1f 93 push r17 2242e: cf 93 push r28 22430: df 93 push r29 22432: cd b7 in r28, 0x3d ; 61 22434: de b7 in r29, 0x3e ; 62 22436: 2d 97 sbiw r28, 0x0d ; 13 22438: 0f b6 in r0, 0x3f ; 63 2243a: f8 94 cli 2243c: de bf out 0x3e, r29 ; 62 2243e: 0f be out 0x3f, r0 ; 63 22440: 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) 22442: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 22446: 81 30 cpi r24, 0x01 ; 1 22448: 31 f1 breq .+76 ; 0x22496 2244a: 30 f0 brcs .+12 ; 0x22458 2244c: 82 30 cpi r24, 0x02 ; 2 2244e: 09 f4 brne .+2 ; 0x22452 22450: 7d c2 rjmp .+1274 ; 0x2294c { _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. 22452: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 22456: fe c0 rjmp .+508 ; 0x22654 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 22458: 80 91 bb 14 lds r24, 0x14BB ; 0x8014bb 2245c: 88 23 and r24, r24 2245e: 49 f0 breq .+18 ; 0x22472 { card.presort_flag = false; 22460: 10 92 bb 14 sts 0x14BB, r1 ; 0x8014bb lcd_update_enabled = false; 22464: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 22468: 0f 94 40 7d call 0x2fa80 ; 0x2fa80 lcd_update_enabled = true; 2246c: 81 e0 ldi r24, 0x01 ; 1 2246e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 22472: 0f 94 f0 7b call 0x2f7e0 ; 0x2f7e0 22476: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af 2247a: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2247e: 89 e0 ldi r24, 0x09 ; 9 22480: 9f e0 ldi r25, 0x0F ; 15 22482: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 22486: 80 93 b1 03 sts 0x03B1, r24 ; 0x8003b1 _md->menuState = _standard; 2248a: 81 e0 ldi r24, 0x01 ; 1 2248c: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 _md->row = -1; // assume that no SD file/dir is currently selected. Once they are rendered, it will be changed to the correct row for the _scrolling state. 22490: 8f ef ldi r24, 0xFF ; 255 22492: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 } // FALLTHRU case _standard: //normal menu structure. { if (!_md->lcd_scrollTimer.running()) //if the timer is not running, then the menu state was just switched, so redraw the screen. 22496: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 2249a: 81 11 cpse r24, r1 2249c: 07 c0 rjmp .+14 ; 0x224ac { _md->lcd_scrollTimer.start(); 2249e: 82 eb ldi r24, 0xB2 ; 178 224a0: 93 e0 ldi r25, 0x03 ; 3 224a2: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> lcd_draw_update = 1; 224a6: 81 e0 ldi r24, 0x01 ; 1 224a8: 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. 224ac: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 224b0: 81 11 cpse r24, r1 224b2: 21 c0 rjmp .+66 ; 0x224f6 224b4: 64 ef ldi r22, 0xF4 ; 244 224b6: 71 e0 ldi r23, 0x01 ; 1 224b8: 82 eb ldi r24, 0xB2 ; 178 224ba: 93 e0 ldi r25, 0x03 ; 3 224bc: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 224c0: 88 23 and r24, r24 224c2: a1 f0 breq .+40 ; 0x224ec 224c4: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 224c8: 8f 3f cpi r24, 0xFF ; 255 224ca: 81 f0 breq .+32 ; 0x224ec { _md->menuState = _scrolling; 224cc: 82 e0 ldi r24, 0x02 ; 2 224ce: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 _md->offset = 0; 224d2: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 _md->scrollPointer = NULL; 224d6: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 224da: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->lcd_scrollTimer.start(); 224de: 82 eb ldi r24, 0xB2 ; 178 224e0: 93 e0 ldi r25, 0x03 ; 3 224e2: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 224e6: 81 e0 ldi r24, 0x01 ; 1 224e8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 224ec: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 224f0: 88 23 and r24, r24 224f2: 09 f4 brne .+2 ; 0x224f6 224f4: ab c0 rjmp .+342 ; 0x2264c 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. 224f6: 8f ef ldi r24, 0xFF ; 255 224f8: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 //if we reached this point it means that the encoder moved or clicked or the state is being switched. Reset the scrollTimer. _md->lcd_scrollTimer.start(); 224fc: 82 eb ldi r24, 0xB2 ; 178 224fe: 93 e0 ldi r25, 0x03 ; 3 22500: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> MENU_BEGIN(); 22504: 0f 94 08 cf call 0x39e10 ; 0x39e10 22508: 10 92 13 05 sts 0x0513, r1 ; 0x800513 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); 2250c: ce 01 movw r24, r28 2250e: 01 96 adiw r24, 0x01 ; 1 22510: 7c 01 movw r14, r24 if (!check_file(selected_filename)) { result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); lcd_update_enable(true); } if (result) { enquecommandf_P(MSG_M23, selected_filename); 22512: fc ee ldi r31, 0xEC ; 236 22514: 2f 2e mov r2, r31 22516: f0 e7 ldi r31, 0x70 ; 112 22518: 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(); 2251a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2251e: 84 30 cpi r24, 0x04 ; 4 22520: 08 f0 brcs .+2 ; 0x22524 22522: 98 c0 rjmp .+304 ; 0x22654 22524: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 22528: 80 91 db 03 lds r24, 0x03DB ; 0x8003db 2252c: 88 23 and r24, r24 2252e: 09 f4 brne .+2 ; 0x22532 22530: aa c0 rjmp .+340 ; 0x22686 22532: 88 eb ldi r24, 0xB8 ; 184 22534: 9d e3 ldi r25, 0x3D ; 61 22536: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2253a: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 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;}; 2253e: 6e e6 ldi r22, 0x6E ; 110 22540: 74 e1 ldi r23, 0x14 ; 20 22542: 87 e1 ldi r24, 0x17 ; 23 22544: 95 e1 ldi r25, 0x15 ; 21 22546: 0f 94 8f a4 call 0x3491e ; 0x3491e card.getWorkDirName(); if (card.filename[0] == '/') 2254a: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 2254e: 8f 32 cpi r24, 0x2F ; 47 22550: 09 f0 breq .+2 ; 0x22554 22552: 9c c0 rjmp .+312 ; 0x2268c { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 22554: 80 91 dd 16 lds r24, 0x16DD ; 0x8016dd 22558: 88 23 and r24, r24 2255a: 41 f0 breq .+16 ; 0x2256c MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 2255c: 8d ea ldi r24, 0xAD ; 173 2255e: 9d e3 ldi r25, 0x3D ; 61 22560: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22564: 6e e5 ldi r22, 0x5E ; 94 22566: 77 ed ldi r23, 0xD7 ; 215 #endif } else MENU_ITEM_FUNCTION_P(PSTR(LCD_STR_FOLDER ".."), lcd_sd_updir); //Show the updir button if in a subdir. 22568: 0f 94 85 ce call 0x39d0a ; 0x39d0a for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 2256c: c0 90 ae 03 lds r12, 0x03AE ; 0x8003ae 22570: d0 90 af 03 lds r13, 0x03AF ; 0x8003af } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 22574: 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. 22576: 91 e0 ldi r25, 0x01 ; 1 22578: c9 1a sub r12, r25 2257a: d1 08 sbc r13, r1 2257c: 08 f4 brcc .+2 ; 0x22580 2257e: d9 c1 rjmp .+946 ; 0x22932 { if (menu_item == menu_line) //If the file is on the screen. 22580: 80 91 16 05 lds r24, 0x0516 ; 0x800516 22584: 90 91 15 05 lds r25, 0x0515 ; 0x800515 22588: 89 13 cpse r24, r25 2258a: cf c1 rjmp .+926 ; 0x2292a { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 2258c: 60 91 b1 03 lds r22, 0x03B1 ; 0x8003b1 22590: c6 01 movw r24, r12 22592: 0f 94 ae 85 call 0x30b5c ; 0x30b5c #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 22596: 80 91 16 05 lds r24, 0x0516 ; 0x800516 2259a: 90 e0 ldi r25, 0x00 ; 0 2259c: 20 91 35 05 lds r18, 0x0535 ; 0x800535 225a0: 30 91 36 05 lds r19, 0x0536 ; 0x800536 225a4: 10 91 b8 14 lds r17, 0x14B8 ; 0x8014b8 225a8: 82 17 cp r24, r18 225aa: 93 07 cpc r25, r19 225ac: 51 f4 brne .+20 ; 0x225c2 { _md->selectedFileID = i; 225ae: d0 92 ad 03 sts 0x03AD, r13 ; 0x8003ad 225b2: c0 92 ac 03 sts 0x03AC, r12 ; 0x8003ac _md->isDir = card.filenameIsDir; 225b6: 10 93 a9 03 sts 0x03A9, r17 ; 0x8003a9 _md->row = menu_row; 225ba: 40 91 13 05 lds r20, 0x0513 ; 0x800513 225be: 40 93 b0 03 sts 0x03B0, r20 ; 0x8003b0 225c2: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 225c6: 11 23 and r17, r17 225c8: 09 f4 brne .+2 ; 0x225cc 225ca: 65 c0 rjmp .+202 ; 0x22696 #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) 225cc: 44 23 and r20, r20 225ce: e9 f0 breq .+58 ; 0x2260a { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 225d0: 40 91 83 14 lds r20, 0x1483 ; 0x801483 225d4: ee e6 ldi r30, 0x6E ; 110 225d6: ae 2e mov r10, r30 225d8: e4 e1 ldi r30, 0x14 ; 20 225da: be 2e mov r11, r30 225dc: 44 23 and r20, r20 225de: 21 f0 breq .+8 ; 0x225e8 225e0: 73 e8 ldi r23, 0x83 ; 131 225e2: a7 2e mov r10, r23 225e4: 74 e1 ldi r23, 0x14 ; 20 225e6: b7 2e mov r11, r23 225e8: 60 91 13 05 lds r22, 0x0513 ; 0x800513 } 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)?'>':' '); 225ec: 4e e3 ldi r20, 0x3E ; 62 225ee: 82 17 cp r24, r18 225f0: 93 07 cpc r25, r19 225f2: 09 f0 breq .+2 ; 0x225f6 225f4: 40 e2 ldi r20, 0x20 ; 32 225f6: 80 e0 ldi r24, 0x00 ; 0 225f8: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_putc(LCD_STR_FOLDER[0]); 225fc: 85 e8 ldi r24, 0x85 ; 133 225fe: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_print_pad(longFilename, len); 22602: 62 e1 ldi r22, 0x12 ; 18 22604: c5 01 movw r24, r10 22606: 0e 94 7c 71 call 0xe2f8 ; 0xe2f8 2260a: 80 91 16 05 lds r24, 0x0516 ; 0x800516 { 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)) 2260e: 90 91 14 05 lds r25, 0x0514 ; 0x800514 22612: 99 23 and r25, r25 22614: 09 f4 brne .+2 ; 0x22618 22616: 89 c1 rjmp .+786 ; 0x2292a 22618: 20 91 35 05 lds r18, 0x0535 ; 0x800535 2261c: 30 91 36 05 lds r19, 0x0536 ; 0x800536 22620: 82 17 cp r24, r18 22622: 13 06 cpc r1, r19 22624: 09 f0 breq .+2 ; 0x22628 22626: 81 c1 rjmp .+770 ; 0x2292a { lcd_update_enabled = false; 22628: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 2262c: 61 e0 ldi r22, 0x01 ; 1 2262e: 8e e6 ldi r24, 0x6E ; 110 22630: 94 e1 ldi r25, 0x14 ; 20 22632: 0f 94 c2 7e call 0x2fd84 ; 0x2fd84 lcd_encoder = 0; 22636: 10 92 36 05 sts 0x0536, r1 ; 0x800536 2263a: 10 92 35 05 sts 0x0535, r1 ; 0x800535 menu_data_reset(); //Forces reloading of cached variables. 2263e: 0f 94 2a cf call 0x39e54 ; 0x39e54 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 22642: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 22646: 0f 94 ee cd call 0x39bdc ; 0x39bdc 2264a: 95 cf rjmp .-214 ; 0x22576 _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()) 2264c: 0e 94 aa 71 call 0xe354 ; 0xe354 22650: 81 11 cpse r24, r1 22652: 51 cf rjmp .-350 ; 0x224f6 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 22654: 2d 96 adiw r28, 0x0d ; 13 22656: 0f b6 in r0, 0x3f ; 63 22658: f8 94 cli 2265a: de bf out 0x3e, r29 ; 62 2265c: 0f be out 0x3f, r0 ; 63 2265e: cd bf out 0x3d, r28 ; 61 22660: df 91 pop r29 22662: cf 91 pop r28 22664: 1f 91 pop r17 22666: 0f 91 pop r16 22668: ff 90 pop r15 2266a: ef 90 pop r14 2266c: df 90 pop r13 2266e: cf 90 pop r12 22670: bf 90 pop r11 22672: af 90 pop r10 22674: 9f 90 pop r9 22676: 8f 90 pop r8 22678: 7f 90 pop r7 2267a: 6f 90 pop r6 2267c: 5f 90 pop r5 2267e: 4f 90 pop r4 22680: 3f 90 pop r3 22682: 2f 90 pop r2 22684: 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 22686: 89 e1 ldi r24, 0x19 ; 25 22688: 90 e4 ldi r25, 0x40 ; 64 2268a: 55 cf rjmp .-342 ; 0x22536 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. 2268c: 68 e6 ldi r22, 0x68 ; 104 2268e: 77 ed ldi r23, 0xD7 ; 215 22690: 8a e3 ldi r24, 0x3A ; 58 22692: 9b e8 ldi r25, 0x8B ; 139 22694: 69 cf rjmp .-302 ; 0x22568 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 22696: 44 23 and r20, r20 22698: d1 f0 breq .+52 ; 0x226ce { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 2269a: 40 91 83 14 lds r20, 0x1483 ; 0x801483 2269e: 6e e6 ldi r22, 0x6E ; 110 226a0: a6 2e mov r10, r22 226a2: 64 e1 ldi r22, 0x14 ; 20 226a4: b6 2e mov r11, r22 226a6: 44 23 and r20, r20 226a8: 21 f0 breq .+8 ; 0x226b2 226aa: 53 e8 ldi r21, 0x83 ; 131 226ac: a5 2e mov r10, r21 226ae: 54 e1 ldi r21, 0x14 ; 20 226b0: b5 2e mov r11, r21 226b2: 60 91 13 05 lds r22, 0x0513 ; 0x800513 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)?'>':' '); 226b6: 4e e3 ldi r20, 0x3E ; 62 226b8: 82 17 cp r24, r18 226ba: 93 07 cpc r25, r19 226bc: 09 f0 breq .+2 ; 0x226c0 226be: 40 e2 ldi r20, 0x20 ; 32 226c0: 80 e0 ldi r24, 0x00 ; 0 226c2: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_print_pad(longFilename, len); 226c6: 63 e1 ldi r22, 0x13 ; 19 226c8: c5 01 movw r24, r10 226ca: 0e 94 7c 71 call 0xe2f8 ; 0xe2f8 226ce: 80 91 16 05 lds r24, 0x0516 ; 0x800516 { 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)) 226d2: 90 91 14 05 lds r25, 0x0514 ; 0x800514 226d6: 99 23 and r25, r25 226d8: 09 f4 brne .+2 ; 0x226dc 226da: 27 c1 rjmp .+590 ; 0x2292a 226dc: 20 91 35 05 lds r18, 0x0535 ; 0x800535 226e0: 30 91 36 05 lds r19, 0x0536 ; 0x800536 226e4: 82 17 cp r24, r18 226e6: 13 06 cpc r1, r19 226e8: 09 f0 breq .+2 ; 0x226ec 226ea: 1f c1 rjmp .+574 ; 0x2292a { lcd_update_enabled = false; 226ec: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 226f0: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 226f4: 81 11 cpse r24, r1 226f6: a5 cf rjmp .-182 ; 0x22642 // 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); 226f8: 6e e6 ldi r22, 0x6E ; 110 226fa: 74 e1 ldi r23, 0x14 ; 20 226fc: c7 01 movw r24, r14 226fe: 0f 94 f4 e3 call 0x3c7e8 ; 0x3c7e8 22702: 47 01 movw r8, r14 22704: 45 e9 ldi r20, 0x95 ; 149 22706: a4 2e mov r10, r20 22708: 4f e0 ldi r20, 0x0F ; 15 2270a: 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] == '.') { 2270c: f4 01 movw r30, r8 2270e: 61 91 ld r22, Z+ 22710: 4f 01 movw r8, r30 22712: 66 23 and r22, r22 22714: 19 f0 breq .+6 ; 0x2271c 22716: 6e 32 cpi r22, 0x2E ; 46 22718: 09 f0 breq .+2 ; 0x2271c 2271a: 4b c0 rjmp .+150 ; 0x227b2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2271c: 60 e0 ldi r22, 0x00 ; 0 2271e: c5 01 movw r24, r10 22720: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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, '.'); 22724: 6e e2 ldi r22, 0x2E ; 46 22726: 70 e0 ldi r23, 0x00 ; 0 22728: c7 01 movw r24, r14 2272a: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 2272e: 3c 01 movw r6, r24 if (extension_ptr) { 22730: 89 2b or r24, r25 22732: 19 f0 breq .+6 ; 0x2273a extension_ptr++; // skip the '.' 22734: 8f ef ldi r24, 0xFF ; 255 22736: 68 1a sub r6, r24 22738: 78 0a sbc r7, r24 2273a: 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); 2273c: 31 e9 ldi r19, 0x91 ; 145 2273e: a3 2e mov r10, r19 22740: 3c e0 ldi r19, 0x0C ; 12 22742: 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') { 22744: 61 14 cp r6, r1 22746: 71 04 cpc r7, r1 22748: 21 f0 breq .+8 ; 0x22752 2274a: f4 01 movw r30, r8 2274c: 60 81 ld r22, Z 2274e: 61 11 cpse r22, r1 22750: 01 c0 rjmp .+2 ; 0x22754 22752: 60 e0 ldi r22, 0x00 ; 0 22754: c5 01 movw r24, r10 22756: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 2275a: ff ef ldi r31, 0xFF ; 255 2275c: af 1a sub r10, r31 2275e: bf 0a sbc r11, r31 22760: 2f ef ldi r18, 0xFF ; 255 22762: 82 1a sub r8, r18 22764: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 22766: 84 e9 ldi r24, 0x94 ; 148 22768: a8 16 cp r10, r24 2276a: 8c e0 ldi r24, 0x0C ; 12 2276c: b8 06 cpc r11, r24 2276e: 51 f7 brne .-44 ; 0x22744 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 22770: 60 90 0c 16 lds r6, 0x160C ; 0x80160c 22774: 66 2d mov r22, r6 22776: 8a e5 ldi r24, 0x5A ; 90 22778: 9f e0 ldi r25, 0x0F ; 15 2277a: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 2277e: 8a e6 ldi r24, 0x6A ; 106 22780: 94 e1 ldi r25, 0x14 ; 20 22782: 2a e0 ldi r18, 0x0A ; 10 22784: a2 2e mov r10, r18 22786: 2f e0 ldi r18, 0x0F ; 15 22788: 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++) { 2278a: 71 2c mov r7, r1 2278c: 4c 01 movw r8, r24 2278e: e9 e0 ldi r30, 0x09 ; 9 22790: 8e 0e add r8, r30 22792: 91 1c adc r9, r1 22794: 76 14 cp r7, r6 22796: d1 f0 breq .+52 ; 0x227cc #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); 22798: 48 e0 ldi r20, 0x08 ; 8 2279a: 50 e0 ldi r21, 0x00 ; 0 2279c: b5 01 movw r22, r10 2279e: 8e 5a subi r24, 0xAE ; 174 227a0: 9f 4f sbci r25, 0xFF ; 255 227a2: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 227a6: 73 94 inc r7 227a8: f8 e0 ldi r31, 0x08 ; 8 227aa: af 0e add r10, r31 227ac: b1 1c adc r11, r1 227ae: c4 01 movw r24, r8 227b0: ed cf rjmp .-38 ; 0x2278c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 227b2: c5 01 movw r24, r10 227b4: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 227b8: ff ef ldi r31, 0xFF ; 255 227ba: af 1a sub r10, r31 227bc: 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++) { 227be: 2d e9 ldi r18, 0x9D ; 157 227c0: a2 16 cp r10, r18 227c2: 2f e0 ldi r18, 0x0F ; 15 227c4: b2 06 cpc r11, r18 227c6: 09 f0 breq .+2 ; 0x227ca 227c8: a1 cf rjmp .-190 ; 0x2270c 227ca: ac cf rjmp .-168 ; 0x22724 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 227cc: 61 e0 ldi r22, 0x01 ; 1 227ce: c7 01 movw r24, r14 227d0: 0f 94 f9 7f call 0x2fff2 ; 0x2fff2 } uint32_t CardReader::getFileSize() { return filesize; 227d4: 40 90 79 17 lds r4, 0x1779 ; 0x801779 227d8: 50 90 7a 17 lds r5, 0x177A ; 0x80177a 227dc: 60 90 7b 17 lds r6, 0x177B ; 0x80177b 227e0: 70 90 7c 17 lds r7, 0x177C ; 0x80177c bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 227e4: 94 2d mov r25, r4 227e6: 85 2d mov r24, r5 227e8: 21 e0 ldi r18, 0x01 ; 1 227ea: 42 16 cp r4, r18 227ec: 28 e7 ldi r18, 0x78 ; 120 227ee: 52 06 cpc r5, r18 227f0: 61 04 cpc r6, r1 227f2: 71 04 cpc r7, r1 227f4: 10 f0 brcs .+4 ; 0x227fa 227f6: 90 e0 ldi r25, 0x00 ; 0 227f8: 88 e7 ldi r24, 0x78 ; 120 227fa: a9 2e mov r10, r25 227fc: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 227fe: 81 e0 ldi r24, 0x01 ; 1 22800: 48 16 cp r4, r24 22802: 88 e7 ldi r24, 0x78 ; 120 22804: 58 06 cpc r5, r24 22806: 61 04 cpc r6, r1 22808: 71 04 cpc r7, r1 2280a: 08 f4 brcc .+2 ; 0x2280e 2280c: 5d c0 rjmp .+186 ; 0x228c8 startPos = filesize - END_FILE_SECTION; 2280e: 98 e7 ldi r25, 0x78 ; 120 22810: 59 1a sub r5, r25 22812: 61 08 sbc r6, r1 22814: 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);}; 22816: 40 92 80 17 sts 0x1780, r4 ; 0x801780 2281a: 50 92 81 17 sts 0x1781, r5 ; 0x801781 2281e: 60 92 82 17 sts 0x1782, r6 ; 0x801782 22822: 70 92 83 17 sts 0x1783, r7 ; 0x801783 22826: c3 01 movw r24, r6 22828: b2 01 movw r22, r4 2282a: 0f 94 b8 77 call 0x2ef70 ; 0x2ef70 card.setIndex(startPos); } cmdqueue_reset(); 2282e: 0e 94 c7 80 call 0x1018e ; 0x1018e cmdqueue_serial_disabled = true; 22832: 00 93 a4 03 sts 0x03A4, r16 ; 0x8003a4 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 22836: 8a e8 ldi r24, 0x8A ; 138 22838: 9d e3 ldi r25, 0x3D ; 61 2283a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2283e: bc 01 movw r22, r24 22840: c5 01 movw r24, r10 22842: 0f 94 6a cd call 0x39ad4 ; 0x39ad4 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; } 22846: 80 91 80 17 lds r24, 0x1780 ; 0x801780 2284a: 90 91 81 17 lds r25, 0x1781 ; 0x801781 2284e: a0 91 82 17 lds r26, 0x1782 ; 0x801782 22852: b0 91 83 17 lds r27, 0x1783 ; 0x801783 while (!card.eof() && !result) { 22856: 40 91 79 17 lds r20, 0x1779 ; 0x801779 2285a: 50 91 7a 17 lds r21, 0x177A ; 0x80177a 2285e: 60 91 7b 17 lds r22, 0x177B ; 0x80177b 22862: 70 91 7c 17 lds r23, 0x177C ; 0x80177c 22866: 84 17 cp r24, r20 22868: 95 07 cpc r25, r21 2286a: a6 07 cpc r26, r22 2286c: b7 07 cpc r27, r23 2286e: 80 f5 brcc .+96 ; 0x228d0 22870: 11 11 cpse r17, r1 22872: 2e c0 rjmp .+92 ; 0x228d0 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); }; 22874: 20 91 ff 16 lds r18, 0x16FF ; 0x8016ff 22878: 21 11 cpse r18, r1 2287a: 03 c0 rjmp .+6 ; 0x22882 2287c: 80 e0 ldi r24, 0x00 ; 0 2287e: 90 e0 ldi r25, 0x00 ; 0 22880: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 22882: 84 19 sub r24, r4 22884: 95 09 sbc r25, r5 22886: 0f 94 3b cd call 0x39a76 ; 0x39a76 card.sdprinting = true; 2288a: 00 93 6c 14 sts 0x146C, r16 ; 0x80146c get_command(); 2288e: 0e 94 43 84 call 0x10886 ; 0x10886 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 22892: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 22896: 90 91 80 10 lds r25, 0x1080 ; 0x801080 2289a: 89 2b or r24, r25 2289c: a1 f2 breq .-88 ; 0x22846 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 2289e: 87 e7 ldi r24, 0x77 ; 119 228a0: 9b e6 ldi r25, 0x6B ; 107 228a2: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 228a6: 81 11 cpse r24, r1 228a8: 05 c0 rjmp .+10 ; 0x228b4 228aa: 85 e3 ldi r24, 0x35 ; 53 228ac: 9b e8 ldi r25, 0x8B ; 139 228ae: 0e 94 d3 68 call 0xd1a6 ; 0xd1a6 228b2: 81 11 cpse r24, r1 228b4: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 228b6: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 228ba: 81 11 cpse r24, r1 228bc: 02 c0 rjmp .+4 ; 0x228c2 cmdqueue_pop_front(); 228be: 0e 94 3f 78 call 0xf07e ; 0xf07e cmdbuffer_front_already_processed = false; 228c2: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e 228c6: e5 cf rjmp .-54 ; 0x22892 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; 228c8: 41 2c mov r4, r1 228ca: 51 2c mov r5, r1 228cc: 32 01 movw r6, r4 228ce: af cf rjmp .-162 ; 0x2282e // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 228d0: 0f 94 5c cd call 0x39ab8 ; 0x39ab8 cmdqueue_serial_disabled = false; 228d4: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 card.printingHasFinished(); 228d8: 0f 94 31 81 call 0x30262 ; 0x30262 lcd_setstatuspgm(MSG_WELCOME); 228dc: 8a e6 ldi r24, 0x6A ; 106 228de: 90 e7 ldi r25, 0x70 ; 112 228e0: 0f 94 e2 0b call 0x217c4 ; 0x217c4 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)) { 228e4: 11 23 and r17, r17 228e6: 91 f0 breq .+36 ; 0x2290c result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); lcd_update_enable(true); } if (result) { enquecommandf_P(MSG_M23, selected_filename); 228e8: ff 92 push r15 228ea: ef 92 push r14 228ec: 3f 92 push r3 228ee: 2f 92 push r2 228f0: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommand_P(MSG_M24); 228f4: 61 e0 ldi r22, 0x01 ; 1 228f6: 88 ee ldi r24, 0xE8 ; 232 228f8: 90 e7 ldi r25, 0x70 ; 112 228fa: 0e 94 43 89 call 0x11286 ; 0x11286 228fe: 0f 90 pop r0 22900: 0f 90 pop r0 22902: 0f 90 pop r0 22904: 0f 90 pop r0 } lcd_return_to_status(); 22906: 0f 94 4b 27 call 0x24e96 ; 0x24e96 2290a: 9b ce rjmp .-714 ; 0x22642 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_cont_cancel_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 2290c: 8a e9 ldi r24, 0x9A ; 154 2290e: 9d e3 ldi r25, 0x3D ; 61 22910: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22914: 41 e0 ldi r20, 0x01 ; 1 22916: 60 e0 ldi r22, 0x00 ; 0 22918: 0f 94 b0 65 call 0x2cb60 ; 0x2cb60 2291c: 18 2f mov r17, r24 lcd_update_enable(true); 2291e: 81 e0 ldi r24, 0x01 ; 1 22920: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 } if (result) { 22924: 11 23 and r17, r17 22926: 01 f3 breq .-64 ; 0x228e8 22928: ee cf rjmp .-36 ; 0x22906 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 2292a: 8f 5f subi r24, 0xFF ; 255 2292c: 80 93 16 05 sts 0x0516, r24 ; 0x800516 22930: 22 ce rjmp .-956 ; 0x22576 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 22932: 0f 94 dc ce call 0x39db8 ; 0x39db8 _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(); 22936: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2293a: 8f 5f subi r24, 0xFF ; 255 2293c: 80 93 13 05 sts 0x0513, r24 ; 0x800513 22940: 80 91 15 05 lds r24, 0x0515 ; 0x800515 22944: 8f 5f subi r24, 0xFF ; 255 22946: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2294a: e7 cd rjmp .-1074 ; 0x2251a 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. 2294c: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 22950: 11 e0 ldi r17, 0x01 ; 1 22952: 81 11 cpse r24, r1 22954: 05 c0 rjmp .+10 ; 0x22960 22956: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2295a: 81 11 cpse r24, r1 2295c: 01 c0 rjmp .+2 ; 0x22960 2295e: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 22960: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 22964: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab 22968: 89 2b or r24, r25 2296a: 91 f4 brne .+36 ; 0x22990 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 2296c: 60 91 b1 03 lds r22, 0x03B1 ; 0x8003b1 22970: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22974: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 22978: 0f 94 ae 85 call 0x30b5c ; 0x30b5c #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 2297c: 80 91 83 14 lds r24, 0x1483 ; 0x801483 22980: 81 11 cpse r24, r1 22982: 46 c0 rjmp .+140 ; 0x22a10 22984: 8e e6 ldi r24, 0x6E ; 110 22986: 94 e1 ldi r25, 0x14 ; 20 22988: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 2298c: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } if (rewindFlag) 22990: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 22992: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 22996: 6c e2 ldi r22, 0x2C ; 44 22998: 71 e0 ldi r23, 0x01 ; 1 2299a: 82 eb ldi r24, 0xB2 ; 178 2299c: 93 e0 ldi r25, 0x03 ; 3 2299e: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 229a2: 81 11 cpse r24, r1 229a4: 03 c0 rjmp .+6 ; 0x229ac 229a6: 11 23 and r17, r17 229a8: 09 f4 brne .+2 ; 0x229ac 229aa: 54 ce rjmp .-856 ; 0x22654 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 229ac: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 229b0: 02 e1 ldi r16, 0x12 ; 18 229b2: 81 11 cpse r24, r1 229b4: 01 c0 rjmp .+2 ; 0x229b8 229b6: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 229b8: 4e e3 ldi r20, 0x3E ; 62 229ba: 60 91 b0 03 lds r22, 0x03B0 ; 0x8003b0 229be: 80 e0 ldi r24, 0x00 ; 0 229c0: 0e 94 ad 6f call 0xdf5a ; 0xdf5a if (_md->isDir) 229c4: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 229c8: 88 23 and r24, r24 229ca: 19 f0 breq .+6 ; 0x229d2 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 229cc: 85 e8 ldi r24, 0x85 ; 133 229ce: 0e 94 3c 70 call 0xe078 ; 0xe078 lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 229d2: 20 91 a8 03 lds r18, 0x03A8 ; 0x8003a8 229d6: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 229da: 90 91 ab 03 lds r25, 0x03AB ; 0x8003ab 229de: 60 2f mov r22, r16 229e0: 82 0f add r24, r18 229e2: 91 1d adc r25, r1 229e4: 0e 94 7c 71 call 0xe2f8 ; 0xe2f8 229e8: 81 11 cpse r24, r1 229ea: 15 c0 rjmp .+42 ; 0x22a16 { _md->lcd_scrollTimer.start(); 229ec: 82 eb ldi r24, 0xB2 ; 178 229ee: 93 e0 ldi r25, 0x03 ; 3 229f0: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> _md->offset++; 229f4: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 229f8: 8f 5f subi r24, 0xFF ; 255 229fa: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } else { // stop at the end of the string _md->lcd_scrollTimer.stop(); } } if (rewindFlag) //go back to sd_menu. 229fe: 11 23 and r17, r17 22a00: 09 f4 brne .+2 ; 0x22a04 22a02: 28 ce rjmp .-944 ; 0x22654 22a04: 10 92 b2 03 sts 0x03B2, r1 ; 0x8003b2 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 22a08: 81 e0 ldi r24, 0x01 ; 1 22a0a: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 22a0e: 22 ce rjmp .-956 ; 0x22654 #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; 22a10: 83 e8 ldi r24, 0x83 ; 131 22a12: 94 e1 ldi r25, 0x14 ; 20 22a14: b9 cf rjmp .-142 ; 0x22988 22a16: 10 92 b2 03 sts 0x03B2, r1 ; 0x8003b2 22a1a: f1 cf rjmp .-30 ; 0x229fe 00022a1c : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 22a1c: 61 e0 ldi r22, 0x01 ; 1 22a1e: 8e e7 ldi r24, 0x7E ; 126 22a20: 90 e7 ldi r25, 0x70 ; 112 22a22: 0e 94 43 89 call 0x11286 ; 0x11286 custom_message_type = CustomMsg::FilamentLoading; //just print status message 22a26: 82 e0 ldi r24, 0x02 ; 2 22a28: 80 93 73 07 sts 0x0773, r24 ; 0x800773 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 22a2c: 8f e2 ldi r24, 0x2F ; 47 22a2e: 99 e5 ldi r25, 0x59 ; 89 22a30: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22a34: 0f 94 e2 0b call 0x217c4 ; 0x217c4 lcd_return_to_status(); 22a38: 0f 94 4b 27 call 0x24e96 ; 0x24e96 lcd_draw_update = 3; 22a3c: 83 e0 ldi r24, 0x03 ; 3 22a3e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 22a42: 08 95 ret 00022a44 : //! @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; 22a44: 0f 94 82 0b call 0x21704 ; 0x21704 22a48: 88 23 and r24, r24 22a4a: 39 f1 breq .+78 ; 0x22a9a cmdqueue_serial_disabled = false; 22a4c: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 22a50: 8f e2 ldi r24, 0x2F ; 47 22a52: 99 e5 ldi r25, 0x59 ; 89 22a54: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22a58: 0f 94 e2 0b call 0x217c4 ; 0x217c4 st_synchronize(); 22a5c: 0f 94 24 59 call 0x2b248 ; 0x2b248 custom_message_type = CustomMsg::Resuming; 22a60: 88 e0 ldi r24, 0x08 ; 8 22a62: 80 93 73 07 sts 0x0773, r24 ; 0x800773 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); 22a66: 0e 94 1b 77 call 0xee36 ; 0xee36 Stopped = false; 22a6a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 restore_print_from_ram_and_continue(default_retraction); 22a6e: 60 e0 ldi r22, 0x00 ; 0 22a70: 70 e0 ldi r23, 0x00 ; 0 22a72: 80 e8 ldi r24, 0x80 ; 128 22a74: 9f e3 ldi r25, 0x3F ; 63 22a76: 0e 94 f1 68 call 0xd1e2 ; 0xd1e2 did_pause_print = false; 22a7a: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 22a7e: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 22a82: 82 30 cpi r24, 0x02 ; 2 22a84: 11 f4 brne .+4 ; 0x22a8a 22a86: 0f 94 c9 58 call 0x2b192 ; 0x2b192 refresh_cmd_timeout(); 22a8a: 0e 94 70 67 call 0xcee0 ; 0xcee0 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 22a8e: 84 e2 ldi r24, 0x24 ; 36 22a90: 9b e6 ldi r25, 0x6B ; 107 22a92: 0e 94 fe 7a call 0xf5fc ; 0xf5fc custom_message_type = CustomMsg::Status; 22a96: 10 92 73 07 sts 0x0773, r1 ; 0x800773 } 22a9a: 08 95 ret 00022a9c : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 22a9c: cf 93 push r28 22a9e: df 93 push r29 22aa0: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 22aa2: 80 e0 ldi r24, 0x00 ; 0 22aa4: 0f 94 a9 06 call 0x20d52 ; 0x20d52 22aa8: 88 23 and r24, r24 22aaa: 31 f0 breq .+12 ; 0x22ab8 lcd_updatestatus(message); 22aac: 60 e0 ldi r22, 0x00 ; 0 22aae: ce 01 movw r24, r28 } 22ab0: df 91 pop r29 22ab2: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 22ab4: 0d 94 8e 06 jmp 0x20d1c ; 0x20d1c } 22ab8: df 91 pop r29 22aba: cf 91 pop r28 22abc: 08 95 ret 00022abe : #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()); 22abe: 0f 94 e7 7c call 0x2f9ce ; 0x2f9ce 22ac2: 9f 93 push r25 22ac4: 8f 93 push r24 22ac6: 88 e5 ldi r24, 0x58 ; 88 22ac8: 9b e8 ldi r25, 0x8B ; 139 22aca: 9f 93 push r25 22acc: 8f 93 push r24 22ace: 0f 94 4b dc call 0x3b896 ; 0x3b896 22ad2: 0f 90 pop r0 22ad4: 0f 90 pop r0 22ad6: 0f 90 pop r0 22ad8: 0f 90 pop r0 } 22ada: 08 95 ret 00022adc : printf_IRSensorAnalogBoardChange(); } return true; } static void lcd_detect_IRsensor(){ 22adc: ef 92 push r14 22ade: ff 92 push r15 22ae0: 0f 93 push r16 22ae2: 1f 93 push r17 22ae4: cf 93 push r28 22ae6: 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(); 22ae8: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 22aec: c8 2f mov r28, r24 if(loaded){ lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 22aee: 8c eb ldi r24, 0xBC ; 188 22af0: 9e e3 ldi r25, 0x3E ; 62 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){ 22af2: c1 11 cpse r28, r1 22af4: 8a c0 rjmp .+276 ; 0x22c0a 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)); 22af6: 87 e7 ldi r24, 0x77 ; 119 22af8: 9e e3 ldi r25, 0x3E ; 62 22afa: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22afe: 0f 94 04 36 call 0x26c08 ; 0x26c08 22b02: 10 92 88 17 sts 0x1788, r1 ; 0x801788 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 22b06: 10 92 87 17 sts 0x1787, r1 ; 0x801787 22b0a: d0 91 8f 17 lds r29, 0x178F ; 0x80178f 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(); 22b0e: 0f 94 df 7c call 0x2f9be ; 0x2f9be 22b12: 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)); 22b14: bc 01 movw r22, r24 22b16: 90 e0 ldi r25, 0x00 ; 0 22b18: 80 e0 ldi r24, 0x00 ; 0 22b1a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 22b1e: 20 e0 ldi r18, 0x00 ; 0 22b20: 30 ec ldi r19, 0xC0 ; 192 22b22: 4f e7 ldi r20, 0x7F ; 127 22b24: 56 e4 ldi r21, 0x46 ; 70 22b26: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 22b2a: 20 e0 ldi r18, 0x00 ; 0 22b2c: 30 e0 ldi r19, 0x00 ; 0 22b2e: 40 ea ldi r20, 0xA0 ; 160 22b30: 50 e4 ldi r21, 0x40 ; 64 22b32: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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) ); 22b36: 9f 93 push r25 22b38: 8f 93 push r24 22b3a: 7f 93 push r23 22b3c: 6f 93 push r22 22b3e: 87 eb ldi r24, 0xB7 ; 183 22b40: 9b e8 ldi r25, 0x8B ; 139 22b42: 9f 93 push r25 22b44: 8f 93 push r24 22b46: 0f 94 4b dc call 0x3b896 ; 0x3b896 if(volt_IR_int < fsensor.IRsensor_Hmin_TRESHOLD){ 22b4a: 0f 90 pop r0 22b4c: 0f 90 pop r0 22b4e: 0f 90 pop r0 22b50: 0f 90 pop r0 22b52: 0f 90 pop r0 22b54: 0f 90 pop r0 22b56: 0d 35 cpi r16, 0x5D ; 93 22b58: 86 e2 ldi r24, 0x26 ; 38 22b5a: 18 07 cpc r17, r24 22b5c: 08 f4 brcc .+2 ; 0x22b60 22b5e: 3f c0 rjmp .+126 ; 0x22bde if(!bStandalone) lcd_selftest_error(TestError::FsensorLevel,"HIGH",""); return false; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_INSERT_FIL)); 22b60: 8f eb ldi r24, 0xBF ; 191 22b62: 9d e3 ldi r25, 0x3D ; 61 22b64: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22b68: 0f 94 04 36 call 0x26c08 ; 0x26c08 volt_IR_int = fsensor.getVoltRaw(); 22b6c: 0f 94 df 7c call 0x2f9be ; 0x2f9be 22b70: 7c 01 movw r14, r24 22b72: bc 01 movw r22, r24 22b74: 90 e0 ldi r25, 0x00 ; 0 22b76: 80 e0 ldi r24, 0x00 ; 0 22b78: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 22b7c: 20 e0 ldi r18, 0x00 ; 0 22b7e: 30 ec ldi r19, 0xC0 ; 192 22b80: 4f e7 ldi r20, 0x7F ; 127 22b82: 56 e4 ldi r21, 0x46 ; 70 22b84: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 22b88: 20 e0 ldi r18, 0x00 ; 0 22b8a: 30 e0 ldi r19, 0x00 ; 0 22b8c: 40 ea ldi r20, 0xA0 ; 160 22b8e: 50 e4 ldi r21, 0x40 ; 64 22b90: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> printf_P(PSTR("Measured filament sensor low level: %4.2fV\n"), Raw2Voltage(volt_IR_int)); 22b94: 9f 93 push r25 22b96: 8f 93 push r24 22b98: 7f 93 push r23 22b9a: 6f 93 push r22 22b9c: 8b e8 ldi r24, 0x8B ; 139 22b9e: 9b e8 ldi r25, 0x8B ; 139 22ba0: 9f 93 push r25 22ba2: 8f 93 push r24 22ba4: 0f 94 4b dc call 0x3b896 ; 0x3b896 if(volt_IR_int > (fsensor.IRsensor_Lmax_TRESHOLD)){ 22ba8: 0f 90 pop r0 22baa: 0f 90 pop r0 22bac: 0f 90 pop r0 22bae: 0f 90 pop r0 22bb0: 0f 90 pop r0 22bb2: 0f 90 pop r0 22bb4: 8f e2 ldi r24, 0x2F ; 47 22bb6: e8 16 cp r14, r24 22bb8: 83 e1 ldi r24, 0x13 ; 19 22bba: f8 06 cpc r15, r24 22bbc: 80 f4 brcc .+32 ; 0x22bde 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; 22bbe: 61 e0 ldi r22, 0x01 ; 1 22bc0: 03 3d cpi r16, 0xD3 ; 211 22bc2: 1a 43 sbci r17, 0x3A ; 58 22bc4: 08 f0 brcs .+2 ; 0x22bc8 22bc6: 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) { 22bc8: d6 17 cp r29, r22 22bca: 41 f0 breq .+16 ; 0x22bdc return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 22bcc: 60 93 8f 17 sts 0x178F, r22 ; 0x80178f 22bd0: 88 e4 ldi r24, 0x48 ; 72 22bd2: 9d e0 ldi r25, 0x0D ; 13 22bd4: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a fsensor.setSensorRevision(newSensorRevision, true); printf_IRSensorAnalogBoardChange(); 22bd8: 0f 94 5f 15 call 0x22abe ; 0x22abe } return true; 22bdc: 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(); } 22bde: 86 e8 ldi r24, 0x86 ; 134 22be0: 97 e1 ldi r25, 0x17 ; 23 22be2: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 } 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)); 22be6: 8d e3 ldi r24, 0x3D ; 61 22be8: 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){ 22bea: cc 23 and r28, r28 22bec: 71 f0 breq .+28 ; 0x22c0a lcd_show_fullscreen_message_and_wait_P(_T(MSG_FS_VERIFIED)); 22bee: 81 e1 ldi r24, 0x11 ; 17 22bf0: 9e e3 ldi r25, 0x3E ; 62 22bf2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22bf6: 0f 94 04 36 call 0x26c08 ; 0x26c08 fsensor.init(); } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); } } 22bfa: df 91 pop r29 22bfc: cf 91 pop r28 22bfe: 1f 91 pop r17 22c00: 0f 91 pop r16 22c02: ff 90 pop r15 22c04: 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(); 22c06: 0d 94 6c 87 jmp 0x30ed8 ; 0x30ed8 } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); 22c0a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 } } 22c0e: df 91 pop r29 22c10: cf 91 pop r28 22c12: 1f 91 pop r17 22c14: 0f 91 pop r16 22c16: ff 90 pop r15 22c18: 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)); 22c1a: 0d 94 04 36 jmp 0x26c08 ; 0x26c08 00022c1e : 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) { 22c1e: cf 93 push r28 22c20: df 93 push r29 22c22: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 22c24: 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) { 22c26: 66 23 and r22, r22 22c28: d9 f1 breq .+118 ; 0x22ca0 22c2a: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 22c2c: 0f 94 4f 45 call 0x28a9e ; 0x28a9e cancel_heatup = true; 22c30: 81 e0 ldi r24, 0x01 ; 1 22c32: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13cancel_heatup.lto_priv.404> heating_status = HeatingStatus::NO_HEATING; 22c36: 10 92 dd 03 sts 0x03DD, r1 ; 0x8003dd // Clear any saved printing state cancel_saved_printing(); 22c3a: 0e 94 5a 65 call 0xcab4 ; 0xcab4 // Abort the planner planner_abort_hard(); 22c3e: 0f 94 05 bc call 0x3780a ; 0x3780a // Reset the queue cmdqueue_reset(); 22c42: 0e 94 c7 80 call 0x1018e ; 0x1018e cmdqueue_serial_disabled = false; 22c46: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 st_reset_timer(); 22c4a: 0f 94 7e 59 call 0x2b2fc ; 0x2b2fc CRITICAL_SECTION_END; 22c4e: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 22c50: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de print_job_timer.stop(); 22c54: 0f 94 ed 58 call 0x2b1da ; 0x2b1da } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 22c58: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 22c5c: 88 23 and r24, r24 22c5e: 71 f0 breq .+28 ; 0x22c7c // Reset the sd status card.sdprinting = false; 22c60: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 22c64: 8c ef ldi r24, 0xFC ; 252 22c66: 96 e1 ldi r25, 0x16 ; 22 22c68: 0f 94 74 6e call 0x2dce8 ; 0x2dce8 file.close(); 22c6c: 8c ef ldi r24, 0xFC ; 252 22c6e: 96 e1 ldi r25, 0x16 ; 22 22c70: 0f 94 6c a4 call 0x348d8 ; 0x348d8 saving = false; 22c74: 10 92 6a 14 sts 0x146A, r1 ; 0x80146a logging = false; 22c78: 10 92 6b 14 sts 0x146B, r1 ; 0x80146b card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 22c7c: 87 e6 ldi r24, 0x67 ; 103 22c7e: 9b e6 ldi r25, 0x6B ; 107 22c80: 0e 94 fe 7a call 0xf5fc ; 0xf5fc #ifdef MESH_BED_LEVELING mbl.active = false; 22c84: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e #endif if (interactive) { 22c88: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 22c8a: 10 92 12 05 sts 0x0512, r1 ; 0x800512 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 22c8e: 81 e0 ldi r24, 0x01 ; 1 22c90: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 22c94: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 22c98: df 91 pop r29 22c9a: 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(); 22c9c: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 } void ConditionalStop() { CRITICAL_SECTION_START; 22ca0: 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; 22ca2: 81 e0 ldi r24, 0x01 ; 1 22ca4: 80 93 64 0e sts 0x0E64, r24 ; 0x800e64 <_ZL13cancel_heatup.lto_priv.404> heating_status = HeatingStatus::NO_HEATING; 22ca8: 10 92 dd 03 sts 0x03DD, r1 ; 0x8003dd // Clear any saved printing state cancel_saved_printing(); 22cac: 0e 94 5a 65 call 0xcab4 ; 0xcab4 // Abort the planner planner_abort_hard(); 22cb0: 0f 94 05 bc call 0x3780a ; 0x3780a // Reset the queue cmdqueue_reset(); 22cb4: 0e 94 c7 80 call 0x1018e ; 0x1018e cmdqueue_serial_disabled = false; 22cb8: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 st_reset_timer(); 22cbc: 0f 94 7e 59 call 0x2b2fc ; 0x2b2fc CRITICAL_SECTION_END; 22cc0: df bf out 0x3f, r29 ; 63 22cc2: ca cf rjmp .-108 ; 0x22c58 00022cc4 : } void lcd_print_stop() { print_stop(true); 22cc4: 60 e0 ldi r22, 0x00 ; 0 22cc6: 81 e0 ldi r24, 0x01 ; 1 22cc8: 0d 94 0f 16 jmp 0x22c1e ; 0x22c1e 00022ccc : } static void render_M862_warnings(const char* warning, const char* strict, uint8_t check) { if (check == 1) { // Warning, stop print if user selects 'No' 22ccc: 41 30 cpi r20, 0x01 ; 1 22cce: 41 f4 brne .+16 ; 0x22ce0 if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 22cd0: 40 e0 ldi r20, 0x00 ; 0 22cd2: 61 e0 ldi r22, 0x01 ; 1 22cd4: 0f 94 b0 65 call 0x2cb60 ; 0x2cb60 22cd8: 81 30 cpi r24, 0x01 ; 1 22cda: 41 f4 brne .+16 ; 0x22cec lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 22cdc: 0d 94 62 16 jmp 0x22cc4 ; 0x22cc4 { if (check == 1) { // Warning, stop print if user selects 'No' if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print 22ce0: 42 30 cpi r20, 0x02 ; 2 22ce2: 21 f4 brne .+8 ; 0x22cec lcd_show_fullscreen_message_and_wait_P(strict); 22ce4: cb 01 movw r24, r22 22ce6: 0f 94 04 36 call 0x26c08 ; 0x26c08 22cea: f8 cf rjmp .-16 ; 0x22cdc lcd_print_stop(); } } 22cec: 08 95 ret 00022cee : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 22cee: 0f 93 push r16 22cf0: 1f 93 push r17 22cf2: 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)) { 22cf4: 8c ea ldi r24, 0xAC ; 172 22cf6: 9c e0 ldi r25, 0x0C ; 12 22cf8: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 22cfc: 88 23 and r24, r24 22cfe: 29 f0 breq .+10 ; 0x22d0a return false; } } done: return true; 22d00: 81 e0 ldi r24, 0x01 ; 1 } 22d02: cf 91 pop r28 22d04: 1f 91 pop r17 22d06: 0f 91 pop r16 22d08: 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()) { 22d0a: 80 91 86 17 lds r24, 0x1786 ; 0x801786 22d0e: 88 23 and r24, r24 22d10: b9 f3 breq .-18 ; 0x22d00 22d12: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 22d16: 81 11 cpse r24, r1 22d18: f3 cf rjmp .-26 ; 0x22d00 if (oCheckFilament == ClCheckMode::_None) { 22d1a: c0 91 e8 04 lds r28, 0x04E8 ; 0x8004e8 22d1e: cc 23 and r28, r28 22d20: 79 f3 breq .-34 ; 0x22d00 goto done; } render_M862_warnings( 22d22: 85 e2 ldi r24, 0x25 ; 37 22d24: 91 e4 ldi r25, 0x41 ; 65 22d26: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22d2a: 8c 01 movw r16, r24 22d2c: 85 e2 ldi r24, 0x25 ; 37 22d2e: 91 e4 ldi r25, 0x41 ; 65 22d30: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22d34: 4c 2f mov r20, r28 22d36: b8 01 movw r22, r16 22d38: 0f 94 66 16 call 0x22ccc ; 0x22ccc _T(MSG_MISSING_FILAMENT) ,_T(MSG_MISSING_FILAMENT) //Identical messages ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 22d3c: 81 e0 ldi r24, 0x01 ; 1 22d3e: 90 91 63 0e lds r25, 0x0E63 ; 0x800e63 22d42: 91 30 cpi r25, 0x01 ; 1 22d44: f1 f6 brne .-68 ; 0x22d02 22d46: 80 e0 ldi r24, 0x00 ; 0 22d48: dc cf rjmp .-72 ; 0x22d02 00022d4a : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 22d4a: 1f 93 push r17 22d4c: cf 93 push r28 22d4e: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 22d50: 10 91 ed 04 lds r17, 0x04ED ; 0x8004ed 22d54: 11 23 and r17, r17 22d56: f9 f0 breq .+62 ; 0x22d96 22d58: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 22d5a: 85 ea ldi r24, 0xA5 ; 165 22d5c: 9d e0 ldi r25, 0x0D ; 13 22d5e: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e if (nDiameter == nDiameter_um) 22d62: 8c 17 cp r24, r28 22d64: 9d 07 cpc r25, r29 22d66: b9 f0 breq .+46 ; 0x22d96 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 22d68: 86 ed ldi r24, 0xD6 ; 214 22d6a: 90 e4 ldi r25, 0x40 ; 64 22d6c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22d70: ec 01 movw r28, r24 22d72: 8b ea ldi r24, 0xAB ; 171 22d74: 90 e4 ldi r25, 0x40 ; 64 22d76: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22d7a: 41 2f mov r20, r17 22d7c: be 01 movw r22, r28 22d7e: 0f 94 66 16 call 0x22ccc ; 0x22ccc ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 22d82: 10 92 f6 03 sts 0x03F6, r1 ; 0x8003f6 menu_submenu(lcd_hw_setup_menu); 22d86: 60 e0 ldi r22, 0x00 ; 0 22d88: 8b e0 ldi r24, 0x0B ; 11 22d8a: 9b e3 ldi r25, 0x3B ; 59 } } 22d8c: df 91 pop r29 22d8e: cf 91 pop r28 22d90: 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); 22d92: 0d 94 75 d0 jmp 0x3a0ea ; 0x3a0ea } } 22d96: df 91 pop r29 22d98: cf 91 pop r28 22d9a: 1f 91 pop r17 22d9c: 08 95 ret 00022d9e : } /// @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) { 22d9e: cf 92 push r12 22da0: df 92 push r13 22da2: ef 92 push r14 22da4: ff 92 push r15 22da6: cf 93 push r28 22da8: 6b 01 movw r12, r22 22daa: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 22dac: 82 e0 ldi r24, 0x02 ; 2 22dae: 80 93 73 07 sts 0x0773, r24 ; 0x800773 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 22db2: 82 ed ldi r24, 0xD2 ; 210 22db4: 98 e5 ldi r25, 0x58 ; 88 22db6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22dba: 0f 94 e2 0b call 0x217c4 ; 0x217c4 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 22dbe: 10 92 88 17 sts 0x1788, r1 ; 0x801788 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 22dc2: 10 92 87 17 sts 0x1787, r1 ; 0x801787 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 22dc6: 20 e0 ldi r18, 0x00 ; 0 22dc8: 30 e0 ldi r19, 0x00 ; 0 22dca: 44 e3 ldi r20, 0x34 ; 52 22dcc: 52 e4 ldi r21, 0x42 ; 66 22dce: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 22dd2: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 22dd6: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 22dda: 90 91 50 07 lds r25, 0x0750 ; 0x800750 22dde: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 22de2: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 22de6: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 22dea: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 22dee: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 22df2: 6a e0 ldi r22, 0x0A ; 10 22df4: 77 e5 ldi r23, 0x57 ; 87 22df6: 8d ea ldi r24, 0xAD ; 173 22df8: 92 e4 ldi r25, 0x42 ; 66 22dfa: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 22dfe: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 22e02: 20 e0 ldi r18, 0x00 ; 0 22e04: 30 e0 ldi r19, 0x00 ; 0 22e06: 4c e0 ldi r20, 0x0C ; 12 22e08: 52 e4 ldi r21, 0x42 ; 66 22e0a: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 22e0e: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 22e12: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 22e16: 90 91 50 07 lds r25, 0x0750 ; 0x800750 22e1a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 22e1e: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 22e22: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 22e26: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 22e2a: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 22e2e: 69 e2 ldi r22, 0x29 ; 41 22e30: 7c e5 ldi r23, 0x5C ; 92 22e32: 85 e8 ldi r24, 0x85 ; 133 22e34: 91 e4 ldi r25, 0x41 ; 65 22e36: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 22e3a: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 22e3e: 20 e0 ldi r18, 0x00 ; 0 22e40: 30 e0 ldi r19, 0x00 ; 0 22e42: a9 01 movw r20, r18 22e44: c7 01 movw r24, r14 22e46: b6 01 movw r22, r12 22e48: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 22e4c: 88 23 and r24, r24 22e4e: e1 f0 breq .+56 ; 0x22e88 { current_position[E_AXIS] += unloadLength; 22e50: a7 01 movw r20, r14 22e52: 96 01 movw r18, r12 22e54: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 22e58: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 22e5c: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 22e60: 90 91 50 07 lds r25, 0x0750 ; 0x800750 22e64: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 22e68: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 22e6c: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 22e70: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 22e74: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 22e78: 60 e0 ldi r22, 0x00 ; 0 22e7a: 70 e0 ldi r23, 0x00 ; 0 22e7c: 80 e2 ldi r24, 0x20 ; 32 22e7e: 91 e4 ldi r25, 0x41 ; 65 22e80: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 22e84: 0f 94 24 59 call 0x2b248 ; 0x2b248 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 22e88: 89 ee ldi r24, 0xE9 ; 233 22e8a: 9a e3 ldi r25, 0x3A ; 58 22e8c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 22e90: 0f 94 7d 35 call 0x26afa ; 0x26afa //disable extruder steppers so filament can be removed disable_e0(); 22e94: 14 9a sbi 0x02, 4 ; 2 _delay(100); 22e96: 64 e6 ldi r22, 0x64 ; 100 22e98: 70 e0 ldi r23, 0x00 ; 0 22e9a: 80 e0 ldi r24, 0x00 ; 0 22e9c: 90 e0 ldi r25, 0x00 ; 0 22e9e: 0f 94 8a 3d call 0x27b14 ; 0x27b14 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 22ea2: 82 e0 ldi r24, 0x02 ; 2 22ea4: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee 22ea8: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 22eaa: 0e 94 aa 71 call 0xe354 ; 0xe354 22eae: 81 11 cpse r24, r1 22eb0: 07 c0 rjmp .+14 ; 0x22ec0 22eb2: c1 50 subi r28, 0x01 ; 1 22eb4: 29 f0 breq .+10 ; 0x22ec0 delay_keep_alive(100); 22eb6: 84 e6 ldi r24, 0x64 ; 100 22eb8: 90 e0 ldi r25, 0x00 ; 0 22eba: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 22ebe: f5 cf rjmp .-22 ; 0x22eaa counterBeep++; } st_synchronize(); 22ec0: 0f 94 24 59 call 0x2b248 ; 0x2b248 while (lcd_clicked()) delay_keep_alive(100); 22ec4: 0e 94 aa 71 call 0xe354 ; 0xe354 22ec8: 88 23 and r24, r24 22eca: 29 f0 breq .+10 ; 0x22ed6 22ecc: 84 e6 ldi r24, 0x64 ; 100 22ece: 90 e0 ldi r25, 0x00 ; 0 22ed0: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 22ed4: f7 cf rjmp .-18 ; 0x22ec4 lcd_update_enable(true); 22ed6: 81 e0 ldi r24, 0x01 ; 1 22ed8: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_setstatuspgm(MSG_WELCOME); 22edc: 8a e6 ldi r24, 0x6A ; 106 22ede: 90 e7 ldi r25, 0x70 ; 112 22ee0: 0f 94 e2 0b call 0x217c4 ; 0x217c4 custom_message_type = CustomMsg::Status; 22ee4: 10 92 73 07 sts 0x0773, r1 ; 0x800773 clearFilamentAction(); 22ee8: 0f 94 ec 36 call 0x26dd8 ; 0x26dd8 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 22eec: 86 e8 ldi r24, 0x86 ; 134 22eee: 97 e1 ldi r25, 0x17 ; 23 } 22ef0: cf 91 pop r28 22ef2: ff 90 pop r15 22ef4: ef 90 pop r14 22ef6: df 90 pop r13 22ef8: cf 90 pop r12 22efa: 0c 94 7c 75 jmp 0xeaf8 ; 0xeaf8 00022efe : 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() 22efe: 2f 92 push r2 22f00: 3f 92 push r3 22f02: 4f 92 push r4 22f04: 5f 92 push r5 22f06: 6f 92 push r6 22f08: 7f 92 push r7 22f0a: 8f 92 push r8 22f0c: 9f 92 push r9 22f0e: af 92 push r10 22f10: bf 92 push r11 22f12: cf 92 push r12 22f14: df 92 push r13 22f16: ef 92 push r14 22f18: ff 92 push r15 22f1a: 0f 93 push r16 22f1c: 1f 93 push r17 22f1e: cf 93 push r28 22f20: df 93 push r29 22f22: 00 d0 rcall .+0 ; 0x22f24 22f24: 00 d0 rcall .+0 ; 0x22f26 22f26: 00 d0 rcall .+0 ; 0x22f28 22f28: cd b7 in r28, 0x3d ; 61 22f2a: de b7 in r29, 0x3e ; 62 22f2c: 0e e9 ldi r16, 0x9E ; 158 22f2e: 13 e1 ldi r17, 0x13 ; 19 22f30: 1f 83 std Y+7, r17 ; 0x07 22f32: 0e 83 std Y+6, r16 ; 0x06 22f34: 2e 80 ldd r2, Y+6 ; 0x06 22f36: 3f 80 ldd r3, Y+7 ; 0x07 22f38: 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])) 22f3a: f1 01 movw r30, r2 22f3c: 61 81 ldd r22, Z+1 ; 0x01 22f3e: 72 81 ldd r23, Z+2 ; 0x02 22f40: 83 81 ldd r24, Z+3 ; 0x03 22f42: 94 81 ldd r25, Z+4 ; 0x04 22f44: 9b 01 movw r18, r22 22f46: ac 01 movw r20, r24 22f48: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 22f4c: 88 23 and r24, r24 22f4e: 09 f4 brne .+2 ; 0x22f52 22f50: 7c c0 rjmp .+248 ; 0x2304a mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 22f52: 89 81 ldd r24, Y+1 ; 0x01 22f54: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 22f58: 20 e0 ldi r18, 0x00 ; 0 22f5a: 30 e0 ldi r19, 0x00 ; 0 22f5c: 48 eb ldi r20, 0xB8 ; 184 22f5e: 51 e4 ldi r21, 0x41 ; 65 22f60: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 22f64: 6b 01 movw r12, r22 22f66: 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)) + 22f68: 20 e0 ldi r18, 0x00 ; 0 22f6a: 30 e0 ldi r19, 0x00 ; 0 22f6c: 4c ef ldi r20, 0xFC ; 252 22f6e: 52 e4 ldi r21, 0x42 ; 66 22f70: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 22f74: 2b 01 movw r4, r22 22f76: 3c 01 movw r6, r24 22f78: 20 e0 ldi r18, 0x00 ; 0 22f7a: 30 e0 ldi r19, 0x00 ; 0 22f7c: 44 e6 ldi r20, 0x64 ; 100 22f7e: 53 e4 ldi r21, 0x43 ; 67 22f80: c7 01 movw r24, r14 22f82: b6 01 movw r22, r12 22f84: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 22f88: 4b 01 movw r8, r22 22f8a: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22f8c: 20 e0 ldi r18, 0x00 ; 0 22f8e: 30 e0 ldi r19, 0x00 ; 0 22f90: 40 ec ldi r20, 0xC0 ; 192 22f92: 51 e4 ldi r21, 0x41 ; 65 22f94: c7 01 movw r24, r14 22f96: b6 01 movw r22, r12 22f98: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 22f9c: 6b 01 movw r12, r22 22f9e: 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)) + 22fa0: ee 81 ldd r30, Y+6 ; 0x06 22fa2: ff 81 ldd r31, Y+7 ; 0x07 22fa4: 21 81 ldd r18, Z+1 ; 0x01 22fa6: 32 81 ldd r19, Z+2 ; 0x02 22fa8: 43 81 ldd r20, Z+3 ; 0x03 22faa: 54 81 ldd r21, Z+4 ; 0x04 22fac: c3 01 movw r24, r6 22fae: b2 01 movw r22, r4 22fb0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 22fb4: a5 01 movw r20, r10 22fb6: 94 01 movw r18, r8 22fb8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 22fbc: 20 e0 ldi r18, 0x00 ; 0 22fbe: 30 e9 ldi r19, 0x90 ; 144 22fc0: 42 ea ldi r20, 0xA2 ; 162 22fc2: 56 e4 ldi r21, 0x46 ; 70 22fc4: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 22fc8: 6a 83 std Y+2, r22 ; 0x02 22fca: 7b 83 std Y+3, r23 ; 0x03 22fcc: 8c 83 std Y+4, r24 ; 0x04 22fce: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22fd0: ee 81 ldd r30, Y+6 ; 0x06 22fd2: ff 81 ldd r31, Y+7 ; 0x07 22fd4: 25 85 ldd r18, Z+13 ; 0x0d 22fd6: 36 85 ldd r19, Z+14 ; 0x0e 22fd8: 47 85 ldd r20, Z+15 ; 0x0f 22fda: 50 89 ldd r21, Z+16 ; 0x10 22fdc: c7 01 movw r24, r14 22fde: b6 01 movw r22, r12 22fe0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 22fe4: a5 01 movw r20, r10 22fe6: 94 01 movw r18, r8 22fe8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 22fec: 20 e0 ldi r18, 0x00 ; 0 22fee: 30 e9 ldi r19, 0x90 ; 144 22ff0: 42 e2 ldi r20, 0x22 ; 34 22ff2: 56 ec ldi r21, 0xC6 ; 198 22ff4: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 22ff8: 9b 01 movw r18, r22 22ffa: 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)) + 22ffc: 6a 81 ldd r22, Y+2 ; 0x02 22ffe: 7b 81 ldd r23, Y+3 ; 0x03 23000: 8c 81 ldd r24, Y+4 ; 0x04 23002: 9d 81 ldd r25, Y+5 ; 0x05 23004: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 23008: 4b 01 movw r8, r22 2300a: 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)); 2300c: ee 81 ldd r30, Y+6 ; 0x06 2300e: ff 81 ldd r31, Y+7 ; 0x07 23010: 21 8d ldd r18, Z+25 ; 0x19 23012: 32 8d ldd r19, Z+26 ; 0x1a 23014: 43 8d ldd r20, Z+27 ; 0x1b 23016: 54 8d ldd r21, Z+28 ; 0x1c 23018: c7 01 movw r24, r14 2301a: b6 01 movw r22, r12 2301c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23020: a3 01 movw r20, r6 23022: 92 01 movw r18, r4 23024: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23028: 20 e0 ldi r18, 0x00 ; 0 2302a: 30 e9 ldi r19, 0x90 ; 144 2302c: 42 ea ldi r20, 0xA2 ; 162 2302e: 56 e4 ldi r21, 0x46 ; 70 23030: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 23034: 9b 01 movw r18, r22 23036: 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)) + 23038: c5 01 movw r24, r10 2303a: b4 01 movw r22, r8 2303c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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] = 23040: f1 01 movw r30, r2 23042: 61 83 std Z+1, r22 ; 0x01 23044: 72 83 std Z+2, r23 ; 0x02 23046: 83 83 std Z+3, r24 ; 0x03 23048: 94 83 std Z+4, r25 ; 0x04 2304a: f4 e0 ldi r31, 0x04 ; 4 2304c: 2f 0e add r2, r31 2304e: 31 1c adc r3, r1 23050: 29 81 ldd r18, Y+1 ; 0x01 23052: 2f 5f subi r18, 0xFF ; 255 23054: 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) { 23056: 27 30 cpi r18, 0x07 ; 7 23058: 09 f0 breq .+2 ; 0x2305c 2305a: 6f cf rjmp .-290 ; 0x22f3a 2305c: 8e 81 ldd r24, Y+6 ; 0x06 2305e: 9f 81 ldd r25, Y+7 ; 0x07 23060: 4c 96 adiw r24, 0x1c ; 28 23062: 9f 83 std Y+7, r25 ; 0x07 23064: 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) { 23066: 82 56 subi r24, 0x62 ; 98 23068: 94 41 sbci r25, 0x14 ; 20 2306a: 09 f0 breq .+2 ; 0x2306e 2306c: 63 cf rjmp .-314 ; 0x22f34 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() 2306e: 19 87 std Y+9, r17 ; 0x09 23070: 08 87 std Y+8, r16 ; 0x08 23072: f1 e0 ldi r31, 0x01 ; 1 23074: 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)) + 23076: c8 01 movw r24, r16 23078: 8b 5a subi r24, 0xAB ; 171 2307a: 9f 4f sbci r25, 0xFF ; 255 2307c: 9f 83 std Y+7, r25 ; 0x07 2307e: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 23080: 18 01 movw r2, r16 23082: 99 ea ldi r25, 0xA9 ; 169 23084: 29 0e add r2, r25 23086: 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])) 23088: e8 85 ldd r30, Y+8 ; 0x08 2308a: f9 85 ldd r31, Y+9 ; 0x09 2308c: 65 8d ldd r22, Z+29 ; 0x1d 2308e: 76 8d ldd r23, Z+30 ; 0x1e 23090: 87 8d ldd r24, Z+31 ; 0x1f 23092: 90 a1 ldd r25, Z+32 ; 0x20 23094: 9b 01 movw r18, r22 23096: ac 01 movw r20, r24 23098: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 2309c: 88 23 and r24, r24 2309e: 09 f4 brne .+2 ; 0x230a2 230a0: 79 c0 rjmp .+242 ; 0x23194 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 230a2: 89 81 ldd r24, Y+1 ; 0x01 230a4: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 230a8: 20 e0 ldi r18, 0x00 ; 0 230aa: 30 e0 ldi r19, 0x00 ; 0 230ac: 40 ea ldi r20, 0xA0 ; 160 230ae: 50 e4 ldi r21, 0x40 ; 64 230b0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 230b4: 6b 01 movw r12, r22 230b6: 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)) + 230b8: 20 e0 ldi r18, 0x00 ; 0 230ba: 30 e0 ldi r19, 0x00 ; 0 230bc: 48 ed ldi r20, 0xD8 ; 216 230be: 52 e4 ldi r21, 0x42 ; 66 230c0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 230c4: 2b 01 movw r4, r22 230c6: 3c 01 movw r6, r24 230c8: 20 e0 ldi r18, 0x00 ; 0 230ca: 30 e0 ldi r19, 0x00 ; 0 230cc: 42 e5 ldi r20, 0x52 ; 82 230ce: 53 e4 ldi r21, 0x43 ; 67 230d0: c7 01 movw r24, r14 230d2: b6 01 movw r22, r12 230d4: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 230d8: 4b 01 movw r8, r22 230da: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 230dc: 20 e0 ldi r18, 0x00 ; 0 230de: 30 e0 ldi r19, 0x00 ; 0 230e0: 40 ec ldi r20, 0xC0 ; 192 230e2: 50 e4 ldi r21, 0x40 ; 64 230e4: c7 01 movw r24, r14 230e6: b6 01 movw r22, r12 230e8: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 230ec: 6b 01 movw r12, r22 230ee: 7c 01 movw r14, r24 230f0: ee 81 ldd r30, Y+6 ; 0x06 230f2: ff 81 ldd r31, Y+7 ; 0x07 230f4: 20 81 ld r18, Z 230f6: 31 81 ldd r19, Z+1 ; 0x01 230f8: 42 81 ldd r20, Z+2 ; 0x02 230fa: 53 81 ldd r21, Z+3 ; 0x03 230fc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23100: a5 01 movw r20, r10 23102: 94 01 movw r18, r8 23104: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23108: 20 e0 ldi r18, 0x00 ; 0 2310a: 30 e9 ldi r19, 0x90 ; 144 2310c: 42 e2 ldi r20, 0x22 ; 34 2310e: 56 ec ldi r21, 0xC6 ; 198 23110: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 23114: 6a 83 std Y+2, r22 ; 0x02 23116: 7b 83 std Y+3, r23 ; 0x03 23118: 8c 83 std Y+4, r24 ; 0x04 2311a: 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)) + 2311c: f8 01 movw r30, r16 2311e: 21 81 ldd r18, Z+1 ; 0x01 23120: 32 81 ldd r19, Z+2 ; 0x02 23122: 43 81 ldd r20, Z+3 ; 0x03 23124: 54 81 ldd r21, Z+4 ; 0x04 23126: c3 01 movw r24, r6 23128: b2 01 movw r22, r4 2312a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2312e: a5 01 movw r20, r10 23130: 94 01 movw r18, r8 23132: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23136: 20 e0 ldi r18, 0x00 ; 0 23138: 30 e9 ldi r19, 0x90 ; 144 2313a: 42 ea ldi r20, 0xA2 ; 162 2313c: 56 e4 ldi r21, 0x46 ; 70 2313e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 23142: 9b 01 movw r18, r22 23144: ac 01 movw r20, r24 23146: 6a 81 ldd r22, Y+2 ; 0x02 23148: 7b 81 ldd r23, Y+3 ; 0x03 2314a: 8c 81 ldd r24, Y+4 ; 0x04 2314c: 9d 81 ldd r25, Y+5 ; 0x05 2314e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 23152: 4b 01 movw r8, r22 23154: 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)); 23156: f1 01 movw r30, r2 23158: 20 81 ld r18, Z 2315a: 31 81 ldd r19, Z+1 ; 0x01 2315c: 42 81 ldd r20, Z+2 ; 0x02 2315e: 53 81 ldd r21, Z+3 ; 0x03 23160: c7 01 movw r24, r14 23162: b6 01 movw r22, r12 23164: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23168: a3 01 movw r20, r6 2316a: 92 01 movw r18, r4 2316c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23170: 20 e0 ldi r18, 0x00 ; 0 23172: 30 e9 ldi r19, 0x90 ; 144 23174: 42 ea ldi r20, 0xA2 ; 162 23176: 56 e4 ldi r21, 0x46 ; 70 23178: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2317c: 9b 01 movw r18, r22 2317e: 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)) + 23180: c5 01 movw r24, r10 23182: b4 01 movw r22, r8 23184: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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] = 23188: e8 85 ldd r30, Y+8 ; 0x08 2318a: f9 85 ldd r31, Y+9 ; 0x09 2318c: 65 8f std Z+29, r22 ; 0x1d 2318e: 76 8f std Z+30, r23 ; 0x1e 23190: 87 8f std Z+31, r24 ; 0x1f 23192: 90 a3 std Z+32, r25 ; 0x20 23194: 88 85 ldd r24, Y+8 ; 0x08 23196: 99 85 ldd r25, Y+9 ; 0x09 23198: 4c 96 adiw r24, 0x1c ; 28 2319a: 99 87 std Y+9, r25 ; 0x09 2319c: 88 87 std Y+8, r24 ; 0x08 2319e: 99 81 ldd r25, Y+1 ; 0x01 231a0: 9f 5f subi r25, 0xFF ; 255 231a2: 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) { 231a4: 96 30 cpi r25, 0x06 ; 6 231a6: 09 f0 breq .+2 ; 0x231aa 231a8: 6f cf rjmp .-290 ; 0x23088 231aa: 0c 5f subi r16, 0xFC ; 252 231ac: 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) { 231ae: e3 e1 ldi r30, 0x13 ; 19 231b0: 0a 3b cpi r16, 0xBA ; 186 231b2: 1e 07 cpc r17, r30 231b4: 09 f0 breq .+2 ; 0x231b8 231b6: 5b cf rjmp .-330 ; 0x2306e z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 231b8: 29 96 adiw r28, 0x09 ; 9 231ba: 0f b6 in r0, 0x3f ; 63 231bc: f8 94 cli 231be: de bf out 0x3e, r29 ; 62 231c0: 0f be out 0x3f, r0 ; 63 231c2: cd bf out 0x3d, r28 ; 61 231c4: df 91 pop r29 231c6: cf 91 pop r28 231c8: 1f 91 pop r17 231ca: 0f 91 pop r16 231cc: ff 90 pop r15 231ce: ef 90 pop r14 231d0: df 90 pop r13 231d2: cf 90 pop r12 231d4: bf 90 pop r11 231d6: af 90 pop r10 231d8: 9f 90 pop r9 231da: 8f 90 pop r8 231dc: 7f 90 pop r7 231de: 6f 90 pop r6 231e0: 5f 90 pop r5 231e2: 4f 90 pop r4 231e4: 3f 90 pop r3 231e6: 2f 90 pop r2 231e8: 08 95 ret 000231ea : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 231ea: 2f 92 push r2 231ec: 3f 92 push r3 231ee: 4f 92 push r4 231f0: 5f 92 push r5 231f2: 6f 92 push r6 231f4: 7f 92 push r7 231f6: 8f 92 push r8 231f8: 9f 92 push r9 231fa: af 92 push r10 231fc: bf 92 push r11 231fe: cf 92 push r12 23200: df 92 push r13 23202: ef 92 push r14 23204: ff 92 push r15 23206: 0f 93 push r16 23208: 1f 93 push r17 2320a: cf 93 push r28 2320c: df 93 push r29 2320e: cd b7 in r28, 0x3d ; 61 23210: de b7 in r29, 0x3e ; 62 23212: 67 97 sbiw r28, 0x17 ; 23 23214: 0f b6 in r0, 0x3f ; 63 23216: f8 94 cli 23218: de bf out 0x3e, r29 ; 62 2321a: 0f be out 0x3f, r0 ; 63 2321c: cd bf out 0x3d, r28 ; 61 2321e: 08 2f mov r16, r24 23220: ce 01 movw r24, r28 23222: 46 96 adiw r24, 0x16 ; 22 23224: 9f 8b std Y+23, r25 ; 0x17 23226: 8e 8b std Y+22, r24 ; 0x16 23228: 83 e0 ldi r24, 0x03 ; 3 2322a: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 2322c: 95 e1 ldi r25, 0x15 ; 21 2322e: 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 23230: 0f 94 26 c3 call 0x3864c ; 0x3864c tool_change_extruder = slot; 23234: 00 93 7e 13 sts 0x137E, r16 ; 0x80137e state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 23238: 40 2f mov r20, r16 2323a: 64 e5 ldi r22, 0x54 ; 84 2323c: ce 01 movw r24, r28 2323e: 01 96 adiw r24, 0x01 ; 1 23240: 0f 94 04 c3 call 0x38608 ; 0x38608 23244: 49 81 ldd r20, Y+1 ; 0x01 23246: 5a 81 ldd r21, Y+2 ; 0x02 23248: 6b 81 ldd r22, Y+3 ; 0x03 2324a: 7c 81 ldd r23, Y+4 ; 0x04 2324c: 8d 81 ldd r24, Y+5 ; 0x05 2324e: 0f 94 76 98 call 0x330ec ; 0x330ec logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 23252: 61 e0 ldi r22, 0x01 ; 1 23254: 81 e0 ldi r24, 0x01 ; 1 23256: 0f 94 9a 9f call 0x33f34 ; 0x33f34 2325a: 18 2f mov r17, r24 2325c: 81 11 cpse r24, r1 2325e: 07 c0 rjmp .+14 ; 0x2326e break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 23260: 0f 94 68 c2 call 0x384d0 ; 0x384d0 // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 23264: 0f 94 38 9f call 0x33e70 ; 0x33e70 // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 23268: 0f 94 28 a0 call 0x34050 ; 0x34050 2326c: e1 cf rjmp .-62 ; 0x23230 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2326e: 0f 94 24 59 call 0x2b248 ; 0x2b248 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 23272: 0f 94 5c c3 call 0x386b8 ; 0x386b8 23276: 81 30 cpi r24, 0x01 ; 1 23278: 79 f1 breq .+94 ; 0x232d8 // 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(); 2327a: 0f 94 28 a0 call 0x34050 ; 0x34050 if (retries == 2 && cutter_enabled()) { 2327e: 92 e0 ldi r25, 0x02 ; 2 23280: f9 12 cpse r15, r25 23282: 09 c0 rjmp .+18 ; 0x23296 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; 23284: 8e ec ldi r24, 0xCE ; 206 23286: 9e e0 ldi r25, 0x0E ; 14 23288: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2328c: 81 30 cpi r24, 0x01 ; 1 2328e: 19 f4 brne .+6 ; 0x23296 CutFilamentInner(slot); // try cutting filament tip at the last attempt 23290: 80 2f mov r24, r16 23292: 0f 94 13 a1 call 0x34226 ; 0x34226 23296: 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) { 23298: f1 10 cpse r15, r1 2329a: ca cf rjmp .-108 ; 0x23230 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()) { 2329c: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 232a0: 88 23 and r24, r24 232a2: 09 f4 brne .+2 ; 0x232a6 232a4: ef c0 rjmp .+478 ; 0x23484 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 232a6: 67 96 adiw r28, 0x17 ; 23 232a8: 0f b6 in r0, 0x3f ; 63 232aa: f8 94 cli 232ac: de bf out 0x3e, r29 ; 62 232ae: 0f be out 0x3f, r0 ; 63 232b0: cd bf out 0x3d, r28 ; 61 232b2: df 91 pop r29 232b4: cf 91 pop r28 232b6: 1f 91 pop r17 232b8: 0f 91 pop r16 232ba: ff 90 pop r15 232bc: ef 90 pop r14 232be: df 90 pop r13 232c0: cf 90 pop r12 232c2: bf 90 pop r11 232c4: af 90 pop r10 232c6: 9f 90 pop r9 232c8: 8f 90 pop r8 232ca: 7f 90 pop r7 232cc: 6f 90 pop r6 232ce: 5f 90 pop r5 232d0: 4f 90 pop r4 232d2: 3f 90 pop r3 232d4: 2f 90 pop r2 232d6: 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(); 232d8: 60 91 73 13 lds r22, 0x1373 ; 0x801373 232dc: 70 e0 ldi r23, 0x00 ; 0 232de: 90 e0 ldi r25, 0x00 ; 0 232e0: 80 e0 ldi r24, 0x00 ; 0 232e2: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 232e6: 9b 01 movw r18, r22 232e8: ac 01 movw r20, r24 232ea: 60 e0 ldi r22, 0x00 ; 0 232ec: 70 e0 ldi r23, 0x00 ; 0 232ee: 8c e5 ldi r24, 0x5C ; 92 232f0: 92 e4 ldi r25, 0x42 ; 66 232f2: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 232f6: 36 2e mov r3, r22 232f8: 87 2e mov r8, r23 232fa: 98 2e mov r9, r24 232fc: 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)) 232fe: 26 2f mov r18, r22 23300: 37 2f mov r19, r23 23302: 48 2f mov r20, r24 23304: 59 2f mov r21, r25 23306: 60 e0 ldi r22, 0x00 ; 0 23308: 70 e0 ldi r23, 0x00 ; 0 2330a: 80 e2 ldi r24, 0x20 ; 32 2330c: 91 e4 ldi r25, 0x41 ; 65 2330e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 23312: 2b 01 movw r4, r22 23314: 3c 01 movw r6, r24 23316: e8 e3 ldi r30, 0x38 ; 56 23318: f5 e0 ldi r31, 0x05 ; 5 2331a: 82 2d mov r24, r2 2331c: 11 92 st Z+, r1 2331e: 8a 95 dec r24 23320: e9 f7 brne .-6 ; 0x2331c lcd_status_message_idx = 0; 23322: 10 92 37 05 sts 0x0537, r1 ; 0x800537 <_ZL22lcd_status_message_idx.lto_priv.464> 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); 23326: 83 2d mov r24, r3 23328: 98 2d mov r25, r8 2332a: a9 2d mov r26, r9 2332c: be 2d mov r27, r14 2332e: bc 01 movw r22, r24 23330: 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++) { 23332: 91 2c mov r9, r1 23334: 31 2c mov r3, r1 23336: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 23338: 5b 01 movw r10, r22 2333a: 6c 01 movw r12, r24 2333c: d7 fa bst r13, 7 2333e: d0 94 com r13 23340: d7 f8 bld r13, 7 23342: d0 94 com r13 23344: 20 e0 ldi r18, 0x00 ; 0 23346: 30 e0 ldi r19, 0x00 ; 0 23348: 48 e4 ldi r20, 0x48 ; 72 2334a: 52 e4 ldi r21, 0x42 ; 66 2334c: 0f 94 28 c3 call 0x38650 ; 0x38650 23350: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 23354: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 while (planner_any_moves()) { 23358: 98 17 cp r25, r24 2335a: 09 f4 brne .+2 ; 0x2335e 2335c: 49 c0 rjmp .+146 ; 0x233f0 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 2335e: 11 23 and r17, r17 23360: 31 f0 breq .+12 ; 0x2336e 23362: 0f 94 5c c3 call 0x386b8 ; 0x386b8 23366: 11 e0 ldi r17, 0x01 ; 1 23368: 81 30 cpi r24, 0x01 ; 1 2336a: 09 f0 breq .+2 ; 0x2336e 2336c: 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); 2336e: 83 e0 ldi r24, 0x03 ; 3 23370: 0f 94 10 59 call 0x2b220 ; 0x2b220 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); 23374: 20 91 4d 07 lds r18, 0x074D ; 0x80074d 23378: 30 91 4e 07 lds r19, 0x074E ; 0x80074e 2337c: 40 91 4f 07 lds r20, 0x074F ; 0x80074f 23380: 50 91 50 07 lds r21, 0x0750 ; 0x800750 23384: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 23388: a3 01 movw r20, r6 2338a: 92 01 movw r18, r4 2338c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23390: 0f 94 8f df call 0x3bf1e ; 0x3bf1e 23394: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 23398: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 2339a: e6 16 cp r14, r22 2339c: c1 f0 breq .+48 ; 0x233ce 2339e: e3 2d mov r30, r3 233a0: e4 31 cpi r30, 0x14 ; 20 233a2: 08 f0 brcs .+2 ; 0x233a6 233a4: 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); 233a6: 33 24 eor r3, r3 233a8: 33 94 inc r3 233aa: 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] : '-'); 233ac: 8f ef ldi r24, 0xFF ; 255 233ae: 11 11 cpse r17, r1 233b0: 01 c0 rjmp .+2 ; 0x233b4 233b2: 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; 233b4: f0 e0 ldi r31, 0x00 ; 0 233b6: e8 5c subi r30, 0xC8 ; 200 233b8: fa 4f sbci r31, 0xFA ; 250 233ba: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 233bc: 91 e0 ldi r25, 0x01 ; 1 233be: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 233c2: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 233c6: 81 11 cpse r24, r1 233c8: 02 c0 rjmp .+4 ; 0x233ce 233ca: 0f 94 aa 40 call 0x28154 ; 0x28154 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 233ce: 90 e0 ldi r25, 0x00 ; 0 233d0: 80 e0 ldi r24, 0x00 ; 0 233d2: 0e 94 7f 8e call 0x11cfe ; 0x11cfe } 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); 233d6: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 233d8: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 233dc: 88 23 and r24, r24 233de: 09 f4 brne .+2 ; 0x233e2 233e0: b7 cf rjmp .-146 ; 0x23350 return false; // power panic or a similar issue happened, bail out fast 233e2: 10 e0 ldi r17, 0x00 ; 0 233e4: 37 c0 rjmp .+110 ; 0x23454 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); 233e6: c6 01 movw r24, r12 233e8: b5 01 movw r22, r10 233ea: 99 24 eor r9, r9 233ec: 93 94 inc r9 233ee: aa cf rjmp .-172 ; 0x23344 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++) { 233f0: 91 e0 ldi r25, 0x01 ; 1 233f2: 99 12 cpse r9, r25 233f4: f8 cf rjmp .-16 ; 0x233e6 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 233f6: 0f 94 26 c3 call 0x3864c ; 0x3864c if (!filament_inserted) { 233fa: 11 11 cpse r17, r1 233fc: 08 c0 rjmp .+16 ; 0x2340e eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 233fe: 8f ec ldi r24, 0xCF ; 207 23400: 9e e0 ldi r25, 0x0E ; 14 23402: 0e 94 ab 77 call 0xef56 ; 0xef56 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 23406: 80 ed ldi r24, 0xD0 ; 208 23408: 9e e0 ldi r25, 0x0E ; 14 2340a: 0e 94 9e 77 call 0xef3c ; 0xef3c 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); 2340e: 44 e1 ldi r20, 0x14 ; 20 23410: 50 e0 ldi r21, 0x00 ; 0 23412: 68 e3 ldi r22, 0x38 ; 56 23414: 75 e0 ldi r23, 0x05 ; 5 23416: ce 01 movw r24, r28 23418: 01 96 adiw r24, 0x01 ; 1 2341a: 0f 94 09 e4 call 0x3c812 ; 0x3c812 2341e: fe 01 movw r30, r28 23420: 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'; 23422: 81 91 ld r24, Z+ 23424: 87 fd sbrc r24, 7 23426: 2c c0 rjmp .+88 ; 0x23480 23428: 80 e3 ldi r24, 0x30 ; 48 2342a: df 01 movw r26, r30 2342c: 11 97 sbiw r26, 0x01 ; 1 2342e: 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++) { 23430: 8e 89 ldd r24, Y+22 ; 0x16 23432: 9f 89 ldd r25, Y+23 ; 0x17 23434: 8e 17 cp r24, r30 23436: 9f 07 cpc r25, r31 23438: a1 f7 brne .-24 ; 0x23422 // 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; 2343a: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 2343c: 82 ee ldi r24, 0xE2 ; 226 2343e: 99 ea ldi r25, 0xA9 ; 169 23440: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 23444: 84 e8 ldi r24, 0x84 ; 132 23446: 90 e9 ldi r25, 0x90 ; 144 23448: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2344c: ce 01 movw r24, r28 2344e: 01 96 adiw r24, 0x01 ; 1 23450: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 23454: 8d e4 ldi r24, 0x4D ; 77 23456: 95 e0 ldi r25, 0x05 ; 5 23458: 0f 94 26 42 call 0x2844c ; 0x2844c ::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()) { 2345c: 11 23 and r17, r17 2345e: 09 f4 brne .+2 ; 0x23462 23460: 0c cf rjmp .-488 ; 0x2327a // 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 23462: 80 2f mov r24, r16 23464: 0f 94 cd 87 call 0x30f9a ; 0x30f9a } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 23468: 00 93 25 13 sts 0x1325, r16 ; 0x801325 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 2346c: 80 91 9a 13 lds r24, 0x139A ; 0x80139a 23470: 90 91 9b 13 lds r25, 0x139B ; 0x80139b 23474: 01 96 adiw r24, 0x01 ; 1 23476: 90 93 9b 13 sts 0x139B, r25 ; 0x80139b 2347a: 80 93 9a 13 sts 0x139A, r24 ; 0x80139a 2347e: 13 cf rjmp .-474 ; 0x232a6 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'; 23480: 81 e3 ldi r24, 0x31 ; 49 23482: d3 cf rjmp .-90 ; 0x2342a void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 23484: 8a e2 ldi r24, 0x2A ; 42 23486: 90 e8 ldi r25, 0x80 ; 128 23488: 90 93 28 13 sts 0x1328, r25 ; 0x801328 2348c: 80 93 27 13 sts 0x1327, r24 ; 0x801327 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 23490: 61 e0 ldi r22, 0x01 ; 1 23492: 81 e0 ldi r24, 0x01 ; 1 23494: 0f 94 9a 9f call 0x33f34 ; 0x33f34 23498: c7 ce rjmp .-626 ; 0x23228 0002349a : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 2349a: cf 93 push r28 2349c: df 93 push r29 2349e: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 234a0: 0f 94 4e 88 call 0x3109c ; 0x3109c 234a4: c8 2f mov r28, r24 234a6: 88 23 and r24, r24 234a8: d9 f0 breq .+54 ; 0x234e0 return false; } if (slot != extruder) { 234aa: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 234ae: 8d 17 cp r24, r29 234b0: b9 f0 breq .+46 ; 0x234e0 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(); 234b2: 0e 94 8e 68 call 0xd11c ; 0xd11c if (/*FindaDetectsFilament()*/ 234b6: 81 11 cpse r24, r1 234b8: 02 c0 rjmp .+4 ; 0x234be /*!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(); 234ba: 0f 94 65 a0 call 0x340ca ; 0x340ca struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 234be: 0f 94 c2 87 call 0x30f84 ; 0x30f84 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 234c2: 10 92 88 17 sts 0x1788, r1 ; 0x801788 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 234c6: 10 92 87 17 sts 0x1787, r1 ; 0x801787 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 234ca: 0f 94 24 59 call 0x2b248 ; 0x2b248 } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 234ce: 8d 2f mov r24, r29 234d0: 0f 94 f5 18 call 0x231ea ; 0x231ea #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 234d4: 86 e8 ldi r24, 0x86 ; 134 234d6: 97 e1 ldi r25, 0x17 ; 23 234d8: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 234dc: 0f 94 43 88 call 0x31086 ; 0x31086 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 234e0: 8c 2f mov r24, r28 234e2: df 91 pop r29 234e4: cf 91 pop r28 234e6: 08 95 ret 000234e8 : { (void)lcd_selftest(); } bool lcd_selftest() { 234e8: cf 92 push r12 234ea: df 92 push r13 234ec: ef 92 push r14 234ee: ff 92 push r15 234f0: 0f 93 push r16 234f2: 1f 93 push r17 234f4: cf 93 push r28 234f6: df 93 push r29 234f8: 00 d0 rcall .+0 ; 0x234fa 234fa: 1f 92 push r1 234fc: cd b7 in r28, 0x3d ; 61 234fe: 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) { 23500: 80 91 8f 17 lds r24, 0x178F ; 0x80178f 23504: 8f 3f cpi r24, 0xFF ; 255 23506: 31 f4 brne .+12 ; 0x23514 if (!MMU2::mmu2.Enabled()) { 23508: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2350c: 81 30 cpi r24, 0x01 ; 1 2350e: 11 f0 breq .+4 ; 0x23514 lcd_detect_IRsensor(); 23510: 0f 94 6e 15 call 0x22adc ; 0x22adc 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(); 23514: 0f 94 4f 45 call 0x28a9e ; 0x28a9e uint8_t fanSpeedBckp = fanSpeed; 23518: d0 90 e1 03 lds r13, 0x03E1 ; 0x8003e1 fanSpeed = 255; 2351c: 8f ef ldi r24, 0xFF ; 255 2351e: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 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)); 23522: 8a ee ldi r24, 0xEA ; 234 23524: e8 2e mov r14, r24 23526: 8b e8 ldi r24, 0x8B ; 139 23528: 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()); 2352a: 04 ee ldi r16, 0xE4 ; 228 2352c: 1b e8 ldi r17, 0x8B ; 139 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)) { 2352e: 20 e0 ldi r18, 0x00 ; 0 23530: 30 e0 ldi r19, 0x00 ; 0 23532: 48 e4 ldi r20, 0x48 ; 72 23534: 52 e4 ldi r21, 0x42 ; 66 23536: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 2353a: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 2353e: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 23542: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 23546: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 2354a: 18 16 cp r1, r24 2354c: 8c f0 brlt .+34 ; 0x23570 2354e: 20 e0 ldi r18, 0x00 ; 0 23550: 30 e0 ldi r19, 0x00 ; 0 23552: 48 e4 ldi r20, 0x48 ; 72 23554: 52 e4 ldi r21, 0x42 ; 66 23556: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 2355a: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 2355e: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 23562: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 23566: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 2356a: 18 16 cp r1, r24 2356c: 0c f0 brlt .+2 ; 0x23570 2356e: 42 c0 rjmp .+132 ; 0x235f4 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 23570: 89 ef ldi r24, 0xF9 ; 249 23572: 9e e3 ldi r25, 0x3E ; 62 23574: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 23578: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 2357c: 42 e8 ldi r20, 0x82 ; 130 2357e: 64 e0 ldi r22, 0x04 ; 4 23580: 80 e0 ldi r24, 0x00 ; 0 23582: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 23586: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 2358a: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 2358e: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 23592: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 23596: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 2359a: 7f 93 push r23 2359c: 6f 93 push r22 2359e: ff 92 push r15 235a0: ef 92 push r14 235a2: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_putc(LCD_STR_DEGREE[0]); 235a6: 81 e8 ldi r24, 0x81 ; 129 235a8: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 235ac: 40 e8 ldi r20, 0x80 ; 128 235ae: 64 e0 ldi r22, 0x04 ; 4 235b0: 89 e0 ldi r24, 0x09 ; 9 235b2: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 235b6: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 235ba: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 235be: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 235c2: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 235c6: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 235ca: 7f 93 push r23 235cc: 6f 93 push r22 235ce: 1f 93 push r17 235d0: 0f 93 push r16 235d2: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_putc(LCD_STR_DEGREE[0]); 235d6: 81 e8 ldi r24, 0x81 ; 129 235d8: 0e 94 7c 6f call 0xdef8 ; 0xdef8 delay_keep_alive(1000); 235dc: 88 ee ldi r24, 0xE8 ; 232 235de: 93 e0 ldi r25, 0x03 ; 3 235e0: 0e 94 7f 8e call 0x11cfe ; 0x11cfe serialecho_temperatures(); 235e4: 0e 94 e1 78 call 0xf1c2 ; 0xf1c2 235e8: 0f b6 in r0, 0x3f ; 63 235ea: f8 94 cli 235ec: de bf out 0x3e, r29 ; 62 235ee: 0f be out 0x3f, r0 ; 63 235f0: cd bf out 0x3d, r28 ; 61 235f2: 9d cf rjmp .-198 ; 0x2352e } fanSpeed = fanSpeedBckp; 235f4: d0 92 e1 03 sts 0x03E1, r13 ; 0x8003e1 lcd_update_enable(true); 235f8: 81 e0 ldi r24, 0x01 ; 1 235fa: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 235fe: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 23602: 8f e3 ldi r24, 0x3F ; 63 23604: 9f e3 ldi r25, 0x3F ; 63 23606: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2360a: ac 01 movw r20, r24 2360c: 60 e0 ldi r22, 0x00 ; 0 2360e: 80 e0 ldi r24, 0x00 ; 0 23610: 0e 94 a1 6f call 0xdf42 ; 0xdf42 #ifdef TMC2130 FORCE_HIGH_POWER_START; 23614: 81 e0 ldi r24, 0x01 ; 1 23616: 0e 94 5d 67 call 0xceba ; 0xceba #endif // TMC2130 FORCE_BL_ON_START; 2361a: 81 e0 ldi r24, 0x01 ; 1 2361c: 0e 94 74 8b call 0x116e8 ; 0x116e8 _delay(2000); 23620: 60 ed ldi r22, 0xD0 ; 208 23622: 77 e0 ldi r23, 0x07 ; 7 23624: 80 e0 ldi r24, 0x00 ; 0 23626: 90 e0 ldi r25, 0x00 ; 0 23628: 0f 94 8a 3d call 0x27b14 ; 0x27b14 KEEPALIVE_STATE(IN_HANDLER); 2362c: 82 e0 ldi r24, 0x02 ; 2 2362e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 23632: 00 ed ldi r16, 0xD0 ; 208 23634: 17 e0 ldi r17, 0x07 ; 7 23636: 21 e0 ldi r18, 0x01 ; 1 23638: 43 e0 ldi r20, 0x03 ; 3 2363a: 60 e0 ldi r22, 0x00 ; 0 2363c: 80 e0 ldi r24, 0x00 ; 0 2363e: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 23642: 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 23644: 83 e0 ldi r24, 0x03 ; 3 23646: 0e 94 c9 76 call 0xed92 ; 0xed92 lcd_selftest_setfan(0); // print fan off 2364a: 80 e0 ldi r24, 0x00 ; 0 2364c: 0e 94 8e d0 call 0x1a11c ; 0x1a11c lcd_selftest_measure_fans(2, 18, 2); 23650: 62 e0 ldi r22, 0x02 ; 2 23652: 82 e0 ldi r24, 0x02 ; 2 23654: 0e 94 22 d1 call 0x1a244 ; 0x1a244 setExtruderAutoFanState(0); // hotend fan off 23658: 80 e0 ldi r24, 0x00 ; 0 2365a: 0e 94 c9 76 call 0xed92 ; 0xed92 if (fan_speed[0] < failThr) { 2365e: c0 90 af 04 lds r12, 0x04AF ; 0x8004af 23662: d0 90 b0 04 lds r13, 0x04B0 ; 0x8004b0 23666: 94 e1 ldi r25, 0x14 ; 20 23668: c9 16 cp r12, r25 2366a: d1 04 cpc r13, r1 2366c: 5c f1 brlt .+86 ; 0x236c4 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 2366e: 21 e0 ldi r18, 0x01 ; 1 23670: 43 e0 ldi r20, 0x03 ; 3 23672: 6f 2d mov r22, r15 23674: 81 e0 ldi r24, 0x01 ; 1 23676: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 2367a: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 2367c: 8f ef ldi r24, 0xFF ; 255 2367e: 0e 94 8e d0 call 0x1a11c ; 0x1a11c lcd_selftest_measure_fans(5, 18, 3); 23682: 63 e0 ldi r22, 0x03 ; 3 23684: 85 e0 ldi r24, 0x05 ; 5 23686: 0e 94 22 d1 call 0x1a244 ; 0x1a244 lcd_selftest_setfan(0); 2368a: 80 e0 ldi r24, 0x00 ; 0 2368c: 0e 94 8e d0 call 0x1a11c ; 0x1a11c if (fan_speed[1] < failThr) { 23690: 80 91 b1 04 lds r24, 0x04B1 ; 0x8004b1 23694: 90 91 b2 04 lds r25, 0x04B2 ; 0x8004b2 23698: 84 31 cpi r24, 0x14 ; 20 2369a: 91 05 cpc r25, r1 2369c: cc f4 brge .+50 ; 0x236d0 #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 2369e: 63 ef ldi r22, 0xF3 ; 243 236a0: 72 e0 ldi r23, 0x02 ; 2 236a2: 85 e0 ldi r24, 0x05 ; 5 236a4: 0f 94 ee 06 call 0x20ddc ; 0x20ddc } } if (_swapped_fan) { 236a8: 96 e4 ldi r25, 0x46 ; 70 236aa: c9 16 cp r12, r25 236ac: d1 04 cpc r13, r1 236ae: 9c f4 brge .+38 ; 0x236d6 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 236b0: 08 e8 ldi r16, 0x88 ; 136 236b2: 13 e1 ldi r17, 0x13 ; 19 236b4: 21 e0 ldi r18, 0x01 ; 1 236b6: 43 e0 ldi r20, 0x03 ; 3 236b8: 6f 2d mov r22, r15 236ba: 8d e0 ldi r24, 0x0D ; 13 236bc: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 236c0: e1 2c mov r14, r1 236c2: 5d c1 rjmp .+698 ; 0x2397e #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 236c4: 63 ef ldi r22, 0xF3 ; 243 236c6: 72 e0 ldi r23, 0x02 ; 2 236c8: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 236ca: 0f 94 ee 06 call 0x20ddc ; 0x20ddc 236ce: f0 cf rjmp .-32 ; 0x236b0 lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 236d0: 86 34 cpi r24, 0x46 ; 70 236d2: 91 05 cpc r25, r1 236d4: 54 f4 brge .+20 ; 0x236ea } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 236d6: 60 e0 ldi r22, 0x00 ; 0 236d8: 81 e0 ldi r24, 0x01 ; 1 236da: 0e 94 94 d0 call 0x1a128 ; 0x1a128 if (_result) { 236de: 81 11 cpse r24, r1 236e0: 7c c1 rjmp .+760 ; 0x239da lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 236e2: 63 ef ldi r22, 0xF3 ; 243 236e4: 72 e0 ldi r23, 0x02 ; 2 236e6: 89 e0 ldi r24, 0x09 ; 9 236e8: f0 cf rjmp .-32 ; 0x236ca { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 236ea: 86 e4 ldi r24, 0x46 ; 70 236ec: c8 16 cp r12, r24 236ee: d1 04 cpc r13, r1 236f0: 94 f7 brge .-28 ; 0x236d6 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 236f2: 00 ed ldi r16, 0xD0 ; 208 236f4: 17 e0 ldi r17, 0x07 ; 7 236f6: 21 e0 ldi r18, 0x01 ; 1 236f8: 43 e0 ldi r20, 0x03 ; 3 236fa: 6f 2d mov r22, r15 236fc: 82 e0 ldi r24, 0x02 ; 2 236fe: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 23702: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 23704: 1c 9b sbis 0x03, 4 ; 3 23706: 18 c0 rjmp .+48 ; 0x23738 { #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; 23708: 1c 9b sbis 0x03, 4 ; 3 2370a: 16 c0 rjmp .+44 ; 0x23738 2370c: 20 e0 ldi r18, 0x00 ; 0 2370e: 30 e0 ldi r19, 0x00 ; 0 23710: 40 e2 ldi r20, 0x20 ; 32 23712: 51 e4 ldi r21, 0x41 ; 65 23714: 60 91 49 07 lds r22, 0x0749 ; 0x800749 23718: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 2371c: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 23720: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 23724: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 23728: 60 93 49 07 sts 0x0749, r22 ; 0x800749 2372c: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 23730: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 23734: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 23738: 60 e0 ldi r22, 0x00 ; 0 2373a: 70 e0 ldi r23, 0x00 ; 0 2373c: 84 e3 ldi r24, 0x34 ; 52 2373e: 92 e4 ldi r25, 0x42 ; 66 23740: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 23744: 0f 94 24 59 call 0x2b248 ; 0x2b248 if ( 23748: 1c 9b sbis 0x03, 4 ; 3 2374a: 51 c1 rjmp .+674 ; 0x239ee ((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] = ""; 2374c: 1a 82 std Y+2, r1 ; 0x02 2374e: 19 82 std Y+1, r1 ; 0x01 23750: 1c 82 std Y+4, r1 ; 0x04 23752: 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"); 23754: 1c 9b sbis 0x03, 4 ; 3 23756: 06 c0 rjmp .+12 ; 0x23764 23758: 68 ef ldi r22, 0xF8 ; 248 2375a: 72 e0 ldi r23, 0x02 ; 2 2375c: ce 01 movw r24, r28 2375e: 01 96 adiw r24, 0x01 ; 1 23760: 0f 94 d5 e3 call 0x3c7aa ; 0x3c7aa lcd_selftest_error(TestError::Endstops, _error, ""); 23764: be 01 movw r22, r28 23766: 6f 5f subi r22, 0xFF ; 255 23768: 7f 4f sbci r23, 0xFF ; 255 2376a: 82 e0 ldi r24, 0x02 ; 2 2376c: 0f 94 ee 06 call 0x20ddc ; 0x20ddc ((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; 23770: 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(); 23772: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 23776: 81 e0 ldi r24, 0x01 ; 1 23778: 0e 94 da 8b call 0x117b4 ; 0x117b4 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 2377c: 11 23 and r17, r17 2377e: 09 f4 brne .+2 ; 0x23782 23780: 97 cf rjmp .-210 ; 0x236b0 { //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); 23782: 00 ed ldi r16, 0xD0 ; 208 23784: 17 e0 ldi r17, 0x07 ; 7 23786: 21 e0 ldi r18, 0x01 ; 1 23788: 43 e0 ldi r20, 0x03 ; 3 2378a: 6f 2d mov r22, r15 2378c: 84 e0 ldi r24, 0x04 ; 4 2378e: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 23792: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 23794: 80 e0 ldi r24, 0x00 ; 0 23796: 0f 94 03 09 call 0x21206 ; 0x21206 } if (_result) 2379a: 88 23 and r24, r24 2379c: 09 f4 brne .+2 ; 0x237a0 2379e: 88 cf rjmp .-240 ; 0x236b0 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 237a0: 10 e0 ldi r17, 0x00 ; 0 237a2: 00 e0 ldi r16, 0x00 ; 0 237a4: 21 e0 ldi r18, 0x01 ; 1 237a6: 43 e0 ldi r20, 0x03 ; 3 237a8: 6f 2d mov r22, r15 237aa: 84 e0 ldi r24, 0x04 ; 4 237ac: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 237b0: 0c ed ldi r16, 0xDC ; 220 237b2: 15 e0 ldi r17, 0x05 ; 5 237b4: 21 e0 ldi r18, 0x01 ; 1 237b6: 43 e0 ldi r20, 0x03 ; 3 237b8: 68 2f mov r22, r24 237ba: 85 e0 ldi r24, 0x05 ; 5 237bc: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 237c0: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 237c2: 81 e0 ldi r24, 0x01 ; 1 237c4: 0f 94 03 09 call 0x21206 ; 0x21206 #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 237c8: 88 23 and r24, r24 237ca: 09 f4 brne .+2 ; 0x237ce 237cc: 71 cf rjmp .-286 ; 0x236b0 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 237ce: 10 e0 ldi r17, 0x00 ; 0 237d0: 00 e0 ldi r16, 0x00 ; 0 237d2: 21 e0 ldi r18, 0x01 ; 1 237d4: 43 e0 ldi r20, 0x03 ; 3 237d6: 6f 2d mov r22, r15 237d8: 86 e0 ldi r24, 0x06 ; 6 237da: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 237de: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 237e0: 0f 94 5c 3b call 0x276b8 ; 0x276b8 237e4: 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); 237e8: e6 e1 ldi r30, 0x16 ; 22 237ea: f2 e9 ldi r31, 0x92 ; 146 237ec: 85 91 lpm r24, Z+ 237ee: 95 91 lpm r25, Z+ 237f0: a5 91 lpm r26, Z+ 237f2: b4 91 lpm r27, Z 237f4: 80 93 41 07 sts 0x0741, r24 ; 0x800741 237f8: 90 93 42 07 sts 0x0742, r25 ; 0x800742 237fc: a0 93 43 07 sts 0x0743, r26 ; 0x800743 23800: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 23804: ea e1 ldi r30, 0x1A ; 26 23806: f2 e9 ldi r31, 0x92 ; 146 23808: 65 91 lpm r22, Z+ 2380a: 75 91 lpm r23, Z+ 2380c: 85 91 lpm r24, Z+ 2380e: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 23810: 20 e0 ldi r18, 0x00 ; 0 23812: 30 e0 ldi r19, 0x00 ; 0 23814: 40 e8 ldi r20, 0x80 ; 128 23816: 50 e4 ldi r21, 0x40 ; 64 23818: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2381c: 60 93 45 07 sts 0x0745, r22 ; 0x800745 23820: 70 93 46 07 sts 0x0746, r23 ; 0x800746 23824: 80 93 47 07 sts 0x0747, r24 ; 0x800747 23828: 90 93 48 07 sts 0x0748, r25 ; 0x800748 #endif //TMC2130 raise_z(10); 2382c: 60 e0 ldi r22, 0x00 ; 0 2382e: 70 e0 ldi r23, 0x00 ; 0 23830: 80 e2 ldi r24, 0x20 ; 32 23832: 91 e4 ldi r25, 0x41 ; 65 23834: 0e 94 8e 6e call 0xdd1c ; 0xdd1c set_destination_to_current(); 23838: 0e 94 e7 68 call 0xd1ce ; 0xd1ce _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 2383c: 0c ed ldi r16, 0xDC ; 220 2383e: 15 e0 ldi r17, 0x05 ; 5 23840: 21 e0 ldi r18, 0x01 ; 1 23842: 43 e0 ldi r20, 0x03 ; 3 23844: 6f 2d mov r22, r15 23846: 86 e0 ldi r24, 0x06 ; 6 23848: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 2384c: 50 e0 ldi r21, 0x00 ; 0 2384e: 40 e0 ldi r20, 0x00 ; 0 23850: 61 e0 ldi r22, 0x01 ; 1 23852: 82 e0 ldi r24, 0x02 ; 2 23854: 0e 94 ee 7b call 0xf7dc ; 0xf7dc #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); 23858: 60 e0 ldi r22, 0x00 ; 0 2385a: 70 e0 ldi r23, 0x00 ; 0 2385c: 80 ea ldi r24, 0xA0 ; 160 2385e: 91 e4 ldi r25, 0x41 ; 65 23860: 0e 94 8e 6e call 0xdd1c ; 0xdd1c } #ifdef TMC2130 if (_result) { raise_z(10); 23864: 60 e0 ldi r22, 0x00 ; 0 23866: 70 e0 ldi r23, 0x00 ; 0 23868: 80 e2 ldi r24, 0x20 ; 32 2386a: 91 e4 ldi r25, 0x41 ; 65 2386c: 0e 94 8e 6e call 0xdd1c ; 0xdd1c _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 23870: 10 e0 ldi r17, 0x00 ; 0 23872: 00 e0 ldi r16, 0x00 ; 0 23874: 21 e0 ldi r18, 0x01 ; 1 23876: 42 e0 ldi r20, 0x02 ; 2 23878: 60 e0 ldi r22, 0x00 ; 0 2387a: 8e e0 ldi r24, 0x0E ; 14 2387c: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e bool bres = tmc2130_home_calibrate(X_AXIS); 23880: 80 e0 ldi r24, 0x00 ; 0 23882: 0f 94 4e 38 call 0x2709c ; 0x2709c 23886: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 23888: 21 e0 ldi r18, 0x01 ; 1 2388a: 42 e0 ldi r20, 0x02 ; 2 2388c: 61 e0 ldi r22, 0x01 ; 1 2388e: 8e e0 ldi r24, 0x0E ; 14 23890: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e bres &= tmc2130_home_calibrate(Y_AXIS); 23894: 81 e0 ldi r24, 0x01 ; 1 23896: 0f 94 4e 38 call 0x2709c ; 0x2709c 2389a: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 2389c: 21 e0 ldi r18, 0x01 ; 1 2389e: 42 e0 ldi r20, 0x02 ; 2 238a0: 62 e0 ldi r22, 0x02 ; 2 238a2: 8e e0 ldi r24, 0x0E ; 14 238a4: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 238a8: f8 2e mov r15, r24 if (bres) 238aa: ee 20 and r14, r14 238ac: 09 f4 brne .+2 ; 0x238b0 238ae: 00 cf rjmp .-512 ; 0x236b0 238b0: 61 e0 ldi r22, 0x01 ; 1 238b2: 88 ef ldi r24, 0xF8 ; 248 238b4: 9e e0 ldi r25, 0x0E ; 14 238b6: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 238ba: 00 ed ldi r16, 0xD0 ; 208 238bc: 17 e0 ldi r17, 0x07 ; 7 238be: 21 e0 ldi r18, 0x01 ; 1 238c0: 43 e0 ldi r20, 0x03 ; 3 238c2: 6f 2d mov r22, r15 238c4: 87 e0 ldi r24, 0x07 ; 7 238c6: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 238ca: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 238cc: 81 e0 ldi r24, 0x01 ; 1 238ce: 0f 94 05 08 call 0x2100a ; 0x2100a } if (_result) 238d2: 88 23 and r24, r24 238d4: 09 f4 brne .+2 ; 0x238d8 238d6: ec ce rjmp .-552 ; 0x236b0 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 238d8: 08 ee ldi r16, 0xE8 ; 232 238da: 13 e0 ldi r17, 0x03 ; 3 238dc: 21 e0 ldi r18, 0x01 ; 1 238de: 43 e0 ldi r20, 0x03 ; 3 238e0: 6f 2d mov r22, r15 238e2: 88 e0 ldi r24, 0x08 ; 8 238e4: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 238e8: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 238ea: 80 e0 ldi r24, 0x00 ; 0 238ec: 0f 94 05 08 call 0x2100a ; 0x2100a 238f0: e8 2e mov r14, r24 } if (_result) 238f2: 88 23 and r24, r24 238f4: 09 f4 brne .+2 ; 0x238f8 238f6: dc ce rjmp .-584 ; 0x236b0 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 238f8: 00 ed ldi r16, 0xD0 ; 208 238fa: 17 e0 ldi r17, 0x07 ; 7 238fc: 21 e0 ldi r18, 0x01 ; 1 238fe: 43 e0 ldi r20, 0x03 ; 3 23900: 6f 2d mov r22, r15 23902: 89 e0 ldi r24, 0x09 ; 9 23904: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 23908: 90 91 96 13 lds r25, 0x1396 ; 0x801396 2390c: 91 30 cpi r25, 0x01 ; 1 2390e: 79 f5 brne .+94 ; 0x2396e { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 23910: 21 e0 ldi r18, 0x01 ; 1 23912: 43 e0 ldi r20, 0x03 ; 3 23914: 68 2f mov r22, r24 23916: 8a e0 ldi r24, 0x0A ; 10 23918: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e 2391c: 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); 2391e: 8e e1 ldi r24, 0x1E ; 30 23920: 9f e3 ldi r25, 0x3F ; 63 23922: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 23926: 70 e0 ldi r23, 0x00 ; 0 23928: 60 e0 ldi r22, 0x00 ; 0 2392a: 0e 94 b2 d9 call 0x1b364 ; 0x1b364 2392e: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 23930: 10 e0 ldi r17, 0x00 ; 0 23932: 00 e0 ldi r16, 0x00 ; 0 23934: 21 e0 ldi r18, 0x01 ; 1 23936: 41 e0 ldi r20, 0x01 ; 1 23938: 60 e0 ldi r22, 0x00 ; 0 2393a: 8a e0 ldi r24, 0x0A ; 10 2393c: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 23940: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 23944: 10 92 6b 02 sts 0x026B, r1 ; 0x80026b // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 23948: 8d 2d mov r24, r13 2394a: 0f 94 4d 1a call 0x2349a ; 0x2349a MMU2::mmu2.unload(); //Unload filament 2394e: 0f 94 65 a0 call 0x340ca ; 0x340ca 23952: 8f ea ldi r24, 0xAF ; 175 23954: 90 e0 ldi r25, 0x00 ; 0 23956: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 2395a: 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 2395e: 00 ed ldi r16, 0xD0 ; 208 23960: 17 e0 ldi r17, 0x07 ; 7 23962: 21 e0 ldi r18, 0x01 ; 1 23964: 43 e0 ldi r20, 0x03 ; 3 23966: 6f 2d mov r22, r15 23968: 8b e0 ldi r24, 0x0B ; 11 2396a: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 2396e: 08 e8 ldi r16, 0x88 ; 136 23970: 13 e1 ldi r17, 0x13 ; 19 23972: 21 e0 ldi r18, 0x01 ; 1 23974: 43 e0 ldi r20, 0x03 ; 3 23976: 68 2f mov r22, r24 23978: 8c e0 ldi r24, 0x0C ; 12 2397a: 0e 94 a7 d5 call 0x1ab4e ; 0x1ab4e lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2397e: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 23982: 61 e0 ldi r22, 0x01 ; 1 23984: 87 e7 ldi r24, 0x77 ; 119 23986: 9b e6 ldi r25, 0x6B ; 107 23988: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_update_enable(true); 2398c: 81 e0 ldi r24, 0x01 ; 1 2398e: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 if (_result) 23992: ee 20 and r14, r14 23994: 71 f1 breq .+92 ; 0x239f2 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 23996: 81 e0 ldi r24, 0x01 ; 1 23998: 0e 94 5e e7 call 0x1cebc ; 0x1cebc lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 2399c: 81 e3 ldi r24, 0x31 ; 49 2399e: 9f e3 ldi r25, 0x3F ; 63 239a0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 239a4: 0f 94 e2 0b call 0x217c4 ; 0x217c4 lcd_return_to_status(); 239a8: 0f 94 4b 27 call 0x24e96 ; 0x24e96 else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 239ac: 80 e0 ldi r24, 0x00 ; 0 239ae: 0e 94 5d 67 call 0xceba ; 0xceba #endif // TMC2130 FORCE_BL_ON_END; 239b2: 80 e0 ldi r24, 0x00 ; 0 239b4: 0e 94 74 8b call 0x116e8 ; 0x116e8 KEEPALIVE_STATE(NOT_BUSY); 239b8: 81 e0 ldi r24, 0x01 ; 1 239ba: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(_result); } 239be: 8e 2d mov r24, r14 239c0: 0f 90 pop r0 239c2: 0f 90 pop r0 239c4: 0f 90 pop r0 239c6: 0f 90 pop r0 239c8: df 91 pop r29 239ca: cf 91 pop r28 239cc: 1f 91 pop r17 239ce: 0f 91 pop r16 239d0: ff 90 pop r15 239d2: ef 90 pop r14 239d4: df 90 pop r13 239d6: cf 90 pop r12 239d8: 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); 239da: 61 e0 ldi r22, 0x01 ; 1 239dc: 80 e0 ldi r24, 0x00 ; 0 239de: 0e 94 94 d0 call 0x1a128 ; 0x1a128 if (!_result){ 239e2: 81 11 cpse r24, r1 239e4: 86 ce rjmp .-756 ; 0x236f2 lcd_selftest_error(TestError::PrintFan, "", ""); 239e6: 63 ef ldi r22, 0xF3 ; 243 239e8: 72 e0 ldi r23, 0x02 ; 2 239ea: 85 e0 ldi r24, 0x05 ; 5 239ec: 6e ce rjmp .-804 ; 0x236ca #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 239ee: 11 e0 ldi r17, 0x01 ; 1 239f0: c0 ce rjmp .-640 ; 0x23772 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 239f2: 88 ec ldi r24, 0xC8 ; 200 239f4: 93 e4 ldi r25, 0x43 ; 67 239f6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 239fa: 62 e0 ldi r22, 0x02 ; 2 239fc: 0f 94 bf 06 call 0x20d7e ; 0x20d7e 23a00: d5 cf rjmp .-86 ; 0x239ac 00023a02 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 23a02: 0d 94 74 1a jmp 0x234e8 ; 0x234e8 00023a06 : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 23a06: cf 93 push r28 23a08: 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); 23a0a: 8b ec ldi r24, 0xCB ; 203 23a0c: 9a e3 ldi r25, 0x3A ; 58 23a0e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 23a12: 6c 2f mov r22, r28 23a14: 0f 94 49 c2 call 0x38492 ; 0x38492 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 23a18: 8c 2f mov r24, r28 23a1a: 0f 94 4d 1a call 0x2349a ; 0x2349a 23a1e: 0f 94 24 59 call 0x2b248 ; 0x2b248 planner_synchronize(); unload(); 23a22: 0f 94 65 a0 call 0x340ca ; 0x340ca ScreenUpdateEnable(); 23a26: 0f 94 46 c2 call 0x3848c ; 0x3848c MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 23a2a: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 23a2c: 0d 94 ec 36 jmp 0x26dd8 ; 0x26dd8 00023a30 : 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(){ 23a30: cf 93 push r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ 23a32: c0 e0 ldi r28, 0x00 ; 0 23a34: 8b ec ldi r24, 0xCB ; 203 23a36: 9a e3 ldi r25, 0x3A ; 58 23a38: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 23a3c: 6c 2f mov r22, r28 23a3e: 0f 94 49 c2 call 0x38492 ; 0x38492 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 23a42: 8c 2f mov r24, r28 23a44: 0f 94 4d 1a call 0x2349a ; 0x2349a 23a48: 0f 94 24 59 call 0x2b248 ; 0x2b248 planner_synchronize(); unload(); 23a4c: 0f 94 65 a0 call 0x340ca ; 0x340ca ScreenUpdateEnable(); 23a50: 0f 94 46 c2 call 0x3848c ; 0x3848c 23a54: cf 5f subi r28, 0xFF ; 255 23a56: c5 30 cpi r28, 0x05 ; 5 23a58: 69 f7 brne .-38 ; 0x23a34 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 23a5a: cf 91 pop r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 23a5c: 0d 94 ec 36 jmp 0x26dd8 ; 0x26dd8 00023a60 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 23a60: cf 93 push r28 23a62: df 93 push r29 23a64: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 23a66: 0f 94 4e 88 call 0x3109c ; 0x3109c 23a6a: c8 2f mov r28, r24 23a6c: 88 23 and r24, r24 23a6e: 69 f1 breq .+90 ; 0x23aca safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 23a70: 88 ec ldi r24, 0xC8 ; 200 23a72: 90 e0 ldi r25, 0x00 ; 0 23a74: 0f 94 a5 c6 call 0x38d4a ; 0x38d4a (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); 23a78: 82 e0 ldi r24, 0x02 ; 2 23a7a: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 23a7e: 86 e7 ldi r24, 0x76 ; 118 23a80: 9c e5 ldi r25, 0x5C ; 92 23a82: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 23a86: 6d 2f mov r22, r29 23a88: 0f 94 49 c2 call 0x38492 ; 0x38492 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 23a8c: 0f 94 c2 87 call 0x30f84 ; 0x30f84 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23a90: 10 92 88 17 sts 0x1788, r1 ; 0x801788 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 23a94: 10 92 87 17 sts 0x1787, r1 ; 0x801787 { // 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 23a98: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 23a9c: 83 36 cpi r24, 0x63 ; 99 23a9e: 29 f0 breq .+10 ; 0x23aaa return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 23aa0: 62 e1 ldi r22, 0x12 ; 18 23aa2: 84 e7 ldi r24, 0x74 ; 116 23aa4: 95 ea ldi r25, 0xA5 ; 165 23aa6: 0f 94 25 88 call 0x3104a ; 0x3104a if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 23aaa: 8d 2f mov r24, r29 23aac: 0f 94 f5 18 call 0x231ea ; 0x231ea // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 23ab0: 0e 94 55 d1 call 0x1a2aa ; 0x1a2aa 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); 23ab4: 83 e0 ldi r24, 0x03 ; 3 23ab6: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 23aba: 86 e8 ldi r24, 0x86 ; 134 23abc: 97 e1 ldi r25, 0x17 ; 23 23abe: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 23ac2: 0f 94 43 88 call 0x31086 ; 0x31086 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 23ac6: 0f 94 46 c2 call 0x3848c ; 0x3848c return true; } 23aca: 8c 2f mov r24, r28 23acc: df 91 pop r29 23ace: cf 91 pop r28 23ad0: 08 95 ret 00023ad2 : /// 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) { 23ad2: 1f 93 push r17 23ad4: cf 93 push r28 23ad6: df 93 push r29 23ad8: c8 2f mov r28, r24 23ada: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 23adc: 0f 94 4e 88 call 0x3109c ; 0x3109c 23ae0: d8 2f mov r29, r24 23ae2: 88 23 and r24, r24 23ae4: a9 f0 breq .+42 ; 0x23b10 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23ae6: 10 92 88 17 sts 0x1788, r1 ; 0x801788 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 23aea: 10 92 87 17 sts 0x1787, r1 ; 0x801787 return false; } FSensorBlockRunout blockRunout; switch (code) { 23aee: c3 36 cpi r28, 0x63 ; 99 23af0: 11 f1 breq .+68 ; 0x23b36 23af2: c8 37 cpi r28, 0x78 ; 120 23af4: 91 f0 breq .+36 ; 0x23b1a 23af6: cf 33 cpi r28, 0x3F ; 63 23af8: 39 f4 brne .+14 ; 0x23b08 case '?': { waitForHotendTargetTemp(100, [] {}); 23afa: 84 e6 ldi r24, 0x64 ; 100 23afc: 90 e0 ldi r25, 0x00 ; 0 23afe: 0f 94 a5 c6 call 0x38d4a ; 0x38d4a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> load_filament_to_nozzle(slot); 23b02: 81 2f mov r24, r17 23b04: 0f 94 30 1d call 0x23a60 ; 0x23a60 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 23b08: 86 e8 ldi r24, 0x86 ; 134 23b0a: 97 e1 ldi r25, 0x17 ; 23 23b0c: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 execute_load_to_nozzle_sequence(); } break; } return true; } 23b10: 8d 2f mov r24, r29 23b12: df 91 pop r29 23b14: cf 91 pop r28 23b16: 1f 91 pop r17 23b18: 08 95 ret 23b1a: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 23b1e: 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); 23b22: 81 2f mov r24, r17 23b24: 0f 94 4d 1a call 0x2349a ; 0x2349a 23b28: 8f ea ldi r24, 0xAF ; 175 23b2a: 90 e0 ldi r25, 0x00 ; 0 23b2c: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 23b30: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 23b34: e9 cf rjmp .-46 ; 0x23b08 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 23b36: 84 e6 ldi r24, 0x64 ; 100 23b38: 90 e0 ldi r25, 0x00 ; 0 23b3a: 0f 94 a5 c6 call 0x38d4a ; 0x38d4a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> execute_load_to_nozzle_sequence(); 23b3e: 0e 94 55 d1 call 0x1a2aa ; 0x1a2aa 23b42: e2 cf rjmp .-60 ; 0x23b08 00023b44 : 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); 23b44: 0f 94 30 1d call 0x23a60 ; 0x23a60 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 23b48: 0e 94 40 65 call 0xca80 ; 0xca80 st_synchronize(); 23b4c: 0f 94 24 59 call 0x2b248 ; 0x2b248 // Ask user if the extruded color is correct: lcd_return_to_status(); 23b50: 0f 94 4b 27 call 0x24e96 ; 0x24e96 lcd_load_filament_color_check(); 23b54: 0f 94 af 68 call 0x2d15e ; 0x2d15e lcd_setstatuspgm(MSG_WELCOME); 23b58: 8a e6 ldi r24, 0x6A ; 106 23b5a: 90 e7 ldi r25, 0x70 ; 112 23b5c: 0f 94 e2 0b call 0x217c4 ; 0x217c4 custom_message_type = CustomMsg::Status; 23b60: 10 92 73 07 sts 0x0773, r1 ; 0x800773 // Clear the filament action clearFilamentAction(); 23b64: 0d 94 ec 36 jmp 0x26dd8 ; 0x26dd8 00023b68 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 23b68: cf 93 push r28 23b6a: df 93 push r29 23b6c: 00 d0 rcall .+0 ; 0x23b6e 23b6e: 1f 92 push r1 23b70: 1f 92 push r1 23b72: cd b7 in r28, 0x3d ; 61 23b74: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 23b76: 48 2f mov r20, r24 23b78: 68 e5 ldi r22, 0x58 ; 88 23b7a: ce 01 movw r24, r28 23b7c: 01 96 adiw r24, 0x01 ; 1 23b7e: 0f 94 04 c3 call 0x38608 ; 0x38608 23b82: 49 81 ldd r20, Y+1 ; 0x01 23b84: 5a 81 ldd r21, Y+2 ; 0x02 23b86: 6b 81 ldd r22, Y+3 ; 0x03 23b88: 7c 81 ldd r23, Y+4 ; 0x04 23b8a: 8d 81 ldd r24, Y+5 ; 0x05 23b8c: 0f 94 76 98 call 0x330ec ; 0x330ec } 23b90: 0f 90 pop r0 23b92: 0f 90 pop r0 23b94: 0f 90 pop r0 23b96: 0f 90 pop r0 23b98: 0f 90 pop r0 23b9a: df 91 pop r29 23b9c: cf 91 pop r28 23b9e: 08 95 ret 00023ba0 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 23ba0: 1f 93 push r17 23ba2: cf 93 push r28 23ba4: df 93 push r29 23ba6: 00 d0 rcall .+0 ; 0x23ba8 23ba8: 1f 92 push r1 23baa: 1f 92 push r1 23bac: cd b7 in r28, 0x3d ; 61 23bae: de b7 in r29, 0x3e ; 62 23bb0: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 23bb2: 0f 94 4e 88 call 0x3109c ; 0x3109c 23bb6: 88 23 and r24, r24 23bb8: d9 f0 breq .+54 ; 0x23bf0 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 23bba: 41 2f mov r20, r17 23bbc: 62 e5 ldi r22, 0x52 ; 82 23bbe: ce 01 movw r24, r28 23bc0: 01 96 adiw r24, 0x01 ; 1 23bc2: 0f 94 04 c3 call 0x38608 ; 0x38608 23bc6: 49 81 ldd r20, Y+1 ; 0x01 23bc8: 5a 81 ldd r21, Y+2 ; 0x02 23bca: 6b 81 ldd r22, Y+3 ; 0x03 23bcc: 7c 81 ldd r23, Y+4 ; 0x04 23bce: 8d 81 ldd r24, Y+5 ; 0x05 23bd0: 0f 94 76 98 call 0x330ec ; 0x330ec 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)); 23bd4: 60 e0 ldi r22, 0x00 ; 0 23bd6: 80 e0 ldi r24, 0x00 ; 0 23bd8: 0f 94 9a 9f call 0x33f34 ; 0x33f34 23bdc: 88 23 and r24, r24 23bde: 69 f3 breq .-38 ; 0x23bba // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 23be0: 20 91 42 13 lds r18, 0x1342 ; 0x801342 23be4: 30 91 43 13 lds r19, 0x1343 ; 0x801343 23be8: 30 93 93 13 sts 0x1393, r19 ; 0x801393 23bec: 20 93 92 13 sts 0x1392, r18 ; 0x801392 return true; } 23bf0: 0f 90 pop r0 23bf2: 0f 90 pop r0 23bf4: 0f 90 pop r0 23bf6: 0f 90 pop r0 23bf8: 0f 90 pop r0 23bfa: df 91 pop r29 23bfc: cf 91 pop r28 23bfe: 1f 91 pop r17 23c00: 08 95 ret 00023c02 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 23c02: ff 92 push r15 23c04: 0f 93 push r16 23c06: 1f 93 push r17 23c08: cf 93 push r28 23c0a: df 93 push r29 23c0c: 1f 92 push r1 23c0e: cd b7 in r28, 0x3d ; 61 23c10: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 23c12: ce 01 movw r24, r28 23c14: 01 96 adiw r24, 0x01 ; 1 23c16: 0f 94 d6 47 call 0x28fac ; 0x28fac uint16_t pos = 0; 23c1a: 10 e0 ldi r17, 0x00 ; 0 23c1c: 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]; 23c1e: 85 e0 ldi r24, 0x05 ; 5 23c20: 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()) { 23c22: d1 99 sbic 0x1a, 1 ; 26 23c24: 11 c0 rjmp .+34 ; 0x23c48 // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 23c26: 0f 94 98 4e call 0x29d30 ; 0x29d30 static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 23c2a: 0e 3d cpi r16, 0xDE ; 222 23c2c: 11 05 cpc r17, r1 23c2e: c9 f7 brne .-14 ; 0x23c22 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 23c30: ce 01 movw r24, r28 23c32: 01 96 adiw r24, 0x01 ; 1 23c34: 0f 94 c9 47 call 0x28f92 ; 0x28f92 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 23c38: c8 01 movw r24, r16 23c3a: 0f 90 pop r0 23c3c: df 91 pop r29 23c3e: cf 91 pop r28 23c40: 1f 91 pop r17 23c42: 0f 91 pop r16 23c44: ff 90 pop r15 23c46: 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(); 23c48: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 23c4a: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZL16adc_values_ready.lto_priv.472> 23c4e: 88 23 and r24, r24 23c50: 61 f3 breq .-40 ; 0x23c2a adc_values_ready = false; 23c52: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL16adc_values_ready.lto_priv.472> adc_start_cycle(); 23c56: 0e 94 7c 8f call 0x11ef8 ; 0x11ef8 temp_mgr_isr(); 23c5a: 0f 94 f5 4b call 0x297ea ; 0x297ea // stop recording for an hard error condition if(temp_error_state.v) 23c5e: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 23c62: 81 11 cpse r24, r1 23c64: 1b c0 rjmp .+54 ; 0x23c9c return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 23c66: f0 9e mul r15, r16 23c68: f0 01 movw r30, r0 23c6a: f1 9e mul r15, r17 23c6c: f0 0d add r31, r0 23c6e: 11 24 eor r1, r1 23c70: ec 58 subi r30, 0x8C ; 140 23c72: f8 4f sbci r31, 0xF8 ; 248 entry.temp = current_temperature_isr[0]; 23c74: 80 91 18 05 lds r24, 0x0518 ; 0x800518 23c78: 90 91 19 05 lds r25, 0x0519 ; 0x800519 23c7c: a0 91 1a 05 lds r26, 0x051A ; 0x80051a 23c80: b0 91 1b 05 lds r27, 0x051B ; 0x80051b 23c84: 80 83 st Z, r24 23c86: 91 83 std Z+1, r25 ; 0x01 23c88: a2 83 std Z+2, r26 ; 0x02 23c8a: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 23c8c: 80 91 17 05 lds r24, 0x0517 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 23c90: 84 83 std Z+4, r24 ; 0x04 ++pos; 23c92: 0f 5f subi r16, 0xFF ; 255 23c94: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 23c96: 0f 94 c0 50 call 0x2a180 ; 0x2a180 23c9a: c7 cf rjmp .-114 ; 0x23c2a adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 23c9c: 10 e0 ldi r17, 0x00 ; 0 23c9e: 00 e0 ldi r16, 0x00 ; 0 23ca0: c7 cf rjmp .-114 ; 0x23c30 00023ca2 : 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) { 23ca2: fc 01 movw r30, r24 switch(*oCheckSetting) { 23ca4: 80 81 ld r24, Z 23ca6: 88 23 and r24, r24 23ca8: 21 f0 breq .+8 ; 0x23cb2 23caa: 81 30 cpi r24, 0x01 ; 1 23cac: 29 f4 brne .+10 ; 0x23cb8 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23cae: 82 e0 ldi r24, 0x02 ; 2 23cb0: 01 c0 rjmp .+2 ; 0x23cb4 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 23cb2: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23cb4: 80 83 st Z, r24 23cb6: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 23cb8: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 23cba: 08 95 ret 00023cbc : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 23cbc: fc 01 movw r30, r24 23cbe: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 23cc0: 90 32 cpi r25, 0x20 ; 32 23cc2: 49 f0 breq .+18 ; 0x23cd6 23cc4: 87 ef ldi r24, 0xF7 ; 247 23cc6: 89 0f add r24, r25 23cc8: 82 30 cpi r24, 0x02 ; 2 23cca: 28 f0 brcs .+10 ; 0x23cd6 23ccc: 81 e0 ldi r24, 0x01 ; 1 23cce: 9d 30 cpi r25, 0x0D ; 13 23cd0: 19 f0 breq .+6 ; 0x23cd8 23cd2: 80 e0 ldi r24, 0x00 ; 0 23cd4: 08 95 ret 23cd6: 81 e0 ldi r24, 0x01 ; 1 } 23cd8: 08 95 ret 00023cda : 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; 23cda: 88 3e cpi r24, 0xE8 ; 232 23cdc: 23 e0 ldi r18, 0x03 ; 3 23cde: 92 07 cpc r25, r18 23ce0: 10 f0 brcs .+4 ; 0x23ce6 23ce2: 87 ee ldi r24, 0xE7 ; 231 23ce4: 93 e0 ldi r25, 0x03 ; 3 } 23ce6: 08 95 ret 00023ce8 : return 0; } static int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 23ce8: 90 91 22 05 lds r25, 0x0522 ; 0x800522 23cec: 80 91 21 05 lds r24, 0x0521 ; 0x800521 23cf0: 2f ef ldi r18, 0xFF ; 255 23cf2: 3f ef ldi r19, 0xFF ; 255 23cf4: 89 17 cp r24, r25 23cf6: 71 f0 breq .+28 ; 0x23d14 _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 23cf8: e9 2f mov r30, r25 23cfa: f0 e0 ldi r31, 0x00 ; 0 23cfc: ec 5d subi r30, 0xDC ; 220 23cfe: fa 4f sbci r31, 0xFA ; 250 23d00: 20 81 ld r18, Z 23d02: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 23d04: 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 23d06: 80 91 20 05 lds r24, 0x0520 ; 0x800520 23d0a: 98 17 cp r25, r24 23d0c: 08 f0 brcs .+2 ; 0x23d10 23d0e: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 23d10: 90 93 22 05 sts 0x0522, r25 ; 0x800522 return rbuf_get(uart2_ibuf); } 23d14: c9 01 movw r24, r18 23d16: 08 95 ret 00023d18 : uint8_t uart2_ibuf[20] = {0, 0}; FILE _uart2io; static int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 23d18: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 23d1c: 95 ff sbrs r25, 5 23d1e: fc cf rjmp .-8 ; 0x23d18 UDR2 = c; // transmit byte 23d20: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> return 0; } 23d24: 90 e0 ldi r25, 0x00 ; 0 23d26: 80 e0 ldi r24, 0x00 ; 0 23d28: 08 95 ret 00023d2a : } 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) { 23d2a: cf 92 push r12 23d2c: df 92 push r13 23d2e: ef 92 push r14 23d30: ff 92 push r15 23d32: 0f 93 push r16 23d34: 1f 93 push r17 23d36: cf 93 push r28 23d38: df 93 push r29 23d3a: 8c 01 movw r16, r24 23d3c: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23d3e: 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; 23d40: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 23d42: 61 50 subi r22, 0x01 ; 1 23d44: 77 0b sbc r23, r23 23d46: 29 2f mov r18, r25 23d48: 30 e0 ldi r19, 0x00 ; 0 23d4a: 26 17 cp r18, r22 23d4c: 37 07 cpc r19, r23 23d4e: 2c f0 brlt .+10 ; 0x23d5a } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 23d50: 55 23 and r21, r21 23d52: 19 f1 breq .+70 ; 0x23d9a { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23d54: 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; 23d56: 50 e0 ldi r21, 0x00 ; 0 23d58: f6 cf rjmp .-20 ; 0x23d46 for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 23d5a: 78 01 movw r14, r16 23d5c: e2 0e add r14, r18 23d5e: f3 1e adc r15, r19 23d60: f7 01 movw r30, r14 23d62: 80 81 ld r24, Z 23d64: d9 01 movw r26, r18 23d66: 11 96 adiw r26, 0x01 ; 1 23d68: 68 01 movw r12, r16 23d6a: ca 0e add r12, r26 23d6c: db 1e adc r13, r27 23d6e: f6 01 movw r30, r12 23d70: 40 81 ld r20, Z 23d72: 48 17 cp r20, r24 23d74: 80 f4 brcc .+32 ; 0x23d96 { uint8_t d = data[i]; data[i] = data[i+1]; 23d76: f7 01 movw r30, r14 23d78: 40 83 st Z, r20 data[i+1] = d; 23d7a: f6 01 movw r30, r12 23d7c: 80 83 st Z, r24 if (data2) 23d7e: 20 97 sbiw r28, 0x00 ; 0 23d80: 49 f0 breq .+18 ; 0x23d94 { d = data2[i]; 23d82: fe 01 movw r30, r28 23d84: e2 0f add r30, r18 23d86: f3 1f adc r31, r19 23d88: 80 81 ld r24, Z data2[i] = data2[i+1]; 23d8a: ac 0f add r26, r28 23d8c: bd 1f adc r27, r29 23d8e: 2c 91 ld r18, X 23d90: 20 83 st Z, r18 data2[i+1] = d; 23d92: 8c 93 st X, r24 } changed = 1; 23d94: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23d96: 9f 5f subi r25, 0xFF ; 255 23d98: d6 cf rjmp .-84 ; 0x23d46 data2[i+1] = d; } changed = 1; } } } 23d9a: df 91 pop r29 23d9c: cf 91 pop r28 23d9e: 1f 91 pop r17 23da0: 0f 91 pop r16 23da2: ff 90 pop r15 23da4: ef 90 pop r14 23da6: df 90 pop r13 23da8: cf 90 pop r12 23daa: 08 95 ret 00023dac : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 23dac: 81 30 cpi r24, 0x01 ; 1 23dae: 41 f0 breq .+16 ; 0x23dc0 23db0: 28 f0 brcs .+10 ; 0x23dbc 23db2: 82 30 cpi r24, 0x02 ; 2 23db4: 39 f0 breq .+14 ; 0x23dc4 23db6: 83 30 cpi r24, 0x03 ; 3 23db8: 71 f0 breq .+28 ; 0x23dd6 23dba: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 23dbc: a0 9a sbi 0x14, 0 ; 20 23dbe: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 23dc0: a2 9a sbi 0x14, 2 ; 20 23dc2: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 23dc4: 9f b7 in r25, 0x3f ; 63 23dc6: f8 94 cli 23dc8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23dcc: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 23dce: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23dd2: 9f bf out 0x3f, r25 ; 63 } } 23dd4: 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; 23dd6: 9f b7 in r25, 0x3f ; 63 23dd8: f8 94 cli 23dda: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23dde: 80 61 ori r24, 0x10 ; 16 23de0: f6 cf rjmp .-20 ; 0x23dce 00023de2 : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 23de2: 81 30 cpi r24, 0x01 ; 1 23de4: 41 f0 breq .+16 ; 0x23df6 23de6: 28 f0 brcs .+10 ; 0x23df2 23de8: 82 30 cpi r24, 0x02 ; 2 23dea: 39 f0 breq .+14 ; 0x23dfa 23dec: 83 30 cpi r24, 0x03 ; 3 23dee: 71 f0 breq .+28 ; 0x23e0c 23df0: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 23df2: a0 98 cbi 0x14, 0 ; 20 23df4: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 23df6: a2 98 cbi 0x14, 2 ; 20 23df8: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 23dfa: 9f b7 in r25, 0x3f ; 63 23dfc: f8 94 cli 23dfe: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23e02: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 23e04: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23e08: 9f bf out 0x3f, r25 ; 63 } } 23e0a: 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; 23e0c: 9f b7 in r25, 0x3f ; 63 23e0e: f8 94 cli 23e10: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23e14: 8f 7e andi r24, 0xEF ; 239 23e16: f6 cf rjmp .-20 ; 0x23e04 00023e18 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 23e18: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 23e1a: 0d b4 in r0, 0x2d ; 45 23e1c: 07 fe sbrs r0, 7 23e1e: fd cf rjmp .-6 ; 0x23e1a return SPDR; 23e20: 8e b5 in r24, 0x2e ; 46 } 23e22: 08 95 ret 00023e24 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 23e24: 2f 92 push r2 23e26: 3f 92 push r3 23e28: 4f 92 push r4 23e2a: 5f 92 push r5 23e2c: 6f 92 push r6 23e2e: 7f 92 push r7 23e30: 8f 92 push r8 23e32: 9f 92 push r9 23e34: af 92 push r10 23e36: bf 92 push r11 23e38: cf 92 push r12 23e3a: df 92 push r13 23e3c: ef 92 push r14 23e3e: ff 92 push r15 23e40: 0f 93 push r16 23e42: 1f 93 push r17 23e44: cf 93 push r28 23e46: df 93 push r29 23e48: cd b7 in r28, 0x3d ; 61 23e4a: de b7 in r29, 0x3e ; 62 23e4c: 2e 97 sbiw r28, 0x0e ; 14 23e4e: 0f b6 in r0, 0x3f ; 63 23e50: f8 94 cli 23e52: de bf out 0x3e, r29 ; 62 23e54: 0f be out 0x3f, r0 ; 63 23e56: 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]); 23e58: 20 90 19 06 lds r2, 0x0619 ; 0x800619 23e5c: 30 90 1a 06 lds r3, 0x061A ; 0x80061a 23e60: 40 90 18 05 lds r4, 0x0518 ; 0x800518 23e64: 50 90 19 05 lds r5, 0x0519 ; 0x800519 23e68: 60 90 1a 05 lds r6, 0x051A ; 0x80051a 23e6c: 70 90 1b 05 lds r7, 0x051B ; 0x80051b #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 23e70: 21 14 cp r2, r1 23e72: 31 04 cpc r3, r1 23e74: 39 f4 brne .+14 ; 0x23e84 pid_output = 0; pid_reset[e] = true; 23e76: 81 e0 ldi r24, 0x01 ; 1 23e78: 80 93 f0 05 sts 0x05F0, r24 ; 0x8005f0 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; 23e7c: 81 2c mov r8, r1 23e7e: 91 2c mov r9, r1 23e80: 54 01 movw r10, r8 23e82: f9 c0 rjmp .+498 ; 0x24076 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 23e84: b1 01 movw r22, r2 23e86: 03 2c mov r0, r3 23e88: 00 0c add r0, r0 23e8a: 88 0b sbc r24, r24 23e8c: 99 0b sbc r25, r25 23e8e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 23e92: a3 01 movw r20, r6 23e94: 92 01 movw r18, r4 23e96: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 23e9a: 6b 01 movw r12, r22 23e9c: 7c 01 movw r14, r24 if(pid_reset[e]) { 23e9e: 80 91 f0 05 lds r24, 0x05F0 ; 0x8005f0 23ea2: 88 23 and r24, r24 23ea4: 91 f0 breq .+36 ; 0x23eca iState_sum[e] = 0.0; 23ea6: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec 23eaa: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed 23eae: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 23eb2: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 23eb6: 10 92 e8 05 sts 0x05E8, r1 ; 0x8005e8 23eba: 10 92 e9 05 sts 0x05E9, r1 ; 0x8005e9 23ebe: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea 23ec2: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb pid_reset[e] = false; 23ec6: 10 92 f0 05 sts 0x05F0, r1 ; 0x8005f0 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 23eca: 20 91 d4 06 lds r18, 0x06D4 ; 0x8006d4 23ece: 30 91 d5 06 lds r19, 0x06D5 ; 0x8006d5 23ed2: 40 91 d6 06 lds r20, 0x06D6 ; 0x8006d6 23ed6: 50 91 d7 06 lds r21, 0x06D7 ; 0x8006d7 23eda: c7 01 movw r24, r14 23edc: b6 01 movw r22, r12 23ede: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23ee2: 69 83 std Y+1, r22 ; 0x01 23ee4: 7a 83 std Y+2, r23 ; 0x02 23ee6: 8b 83 std Y+3, r24 ; 0x03 23ee8: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 23eea: 20 91 ec 05 lds r18, 0x05EC ; 0x8005ec 23eee: 30 91 ed 05 lds r19, 0x05ED ; 0x8005ed 23ef2: 40 91 ee 05 lds r20, 0x05EE ; 0x8005ee 23ef6: 50 91 ef 05 lds r21, 0x05EF ; 0x8005ef 23efa: c7 01 movw r24, r14 23efc: b6 01 movw r22, r12 23efe: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 23f02: 4b 01 movw r8, r22 23f04: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 23f06: 20 91 ab 04 lds r18, 0x04AB ; 0x8004ab <_ZL14iState_sum_min.lto_priv.483> 23f0a: 2d 87 std Y+13, r18 ; 0x0d 23f0c: 30 91 ac 04 lds r19, 0x04AC ; 0x8004ac <_ZL14iState_sum_min.lto_priv.483+0x1> 23f10: 39 87 std Y+9, r19 ; 0x09 23f12: 10 91 ad 04 lds r17, 0x04AD ; 0x8004ad <_ZL14iState_sum_min.lto_priv.483+0x2> 23f16: 00 91 ae 04 lds r16, 0x04AE ; 0x8004ae <_ZL14iState_sum_min.lto_priv.483+0x3> 23f1a: 41 2f mov r20, r17 23f1c: 50 2f mov r21, r16 23f1e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 23f22: 87 fd sbrc r24, 7 23f24: 17 c0 rjmp .+46 ; 0x23f54 23f26: 80 91 a7 04 lds r24, 0x04A7 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.484> 23f2a: 8d 87 std Y+13, r24 ; 0x0d 23f2c: 90 91 a8 04 lds r25, 0x04A8 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.484+0x1> 23f30: 99 87 std Y+9, r25 ; 0x09 23f32: 10 91 a9 04 lds r17, 0x04A9 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.484+0x2> 23f36: 00 91 aa 04 lds r16, 0x04AA ; 0x8004aa <_ZL14iState_sum_max.lto_priv.484+0x3> 23f3a: 9c 01 movw r18, r24 23f3c: 41 2f mov r20, r17 23f3e: 50 2f mov r21, r16 23f40: b4 01 movw r22, r8 23f42: c5 01 movw r24, r10 23f44: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 23f48: 18 16 cp r1, r24 23f4a: 24 f0 brlt .+8 ; 0x23f54 23f4c: 8d 86 std Y+13, r8 ; 0x0d 23f4e: 99 86 std Y+9, r9 ; 0x09 23f50: 1a 2d mov r17, r10 23f52: 0b 2d mov r16, r11 23f54: 8d 85 ldd r24, Y+13 ; 0x0d 23f56: 99 85 ldd r25, Y+9 ; 0x09 23f58: a1 2f mov r26, r17 23f5a: b0 2f mov r27, r16 23f5c: 80 93 ec 05 sts 0x05EC, r24 ; 0x8005ec 23f60: 90 93 ed 05 sts 0x05ED, r25 ; 0x8005ed 23f64: a0 93 ee 05 sts 0x05EE, r26 ; 0x8005ee 23f68: b0 93 ef 05 sts 0x05EF, r27 ; 0x8005ef iTerm[e] = cs.Ki * iState_sum[e]; 23f6c: 20 91 d8 06 lds r18, 0x06D8 ; 0x8006d8 23f70: 30 91 d9 06 lds r19, 0x06D9 ; 0x8006d9 23f74: 40 91 da 06 lds r20, 0x06DA ; 0x8006da 23f78: 50 91 db 06 lds r21, 0x06DB ; 0x8006db 23f7c: bc 01 movw r22, r24 23f7e: 81 2f mov r24, r17 23f80: 90 2f mov r25, r16 23f82: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23f86: 6d 83 std Y+5, r22 ; 0x05 23f88: 7e 83 std Y+6, r23 ; 0x06 23f8a: 8f 83 std Y+7, r24 ; 0x07 23f8c: 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 23f8e: 20 91 e4 05 lds r18, 0x05E4 ; 0x8005e4 23f92: 30 91 e5 05 lds r19, 0x05E5 ; 0x8005e5 23f96: 40 91 e6 05 lds r20, 0x05E6 ; 0x8005e6 23f9a: 50 91 e7 05 lds r21, 0x05E7 ; 0x8005e7 23f9e: c3 01 movw r24, r6 23fa0: b2 01 movw r22, r4 23fa2: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 23fa6: 20 91 dc 06 lds r18, 0x06DC ; 0x8006dc 23faa: 30 91 dd 06 lds r19, 0x06DD ; 0x8006dd 23fae: 40 91 de 06 lds r20, 0x06DE ; 0x8006de 23fb2: 50 91 df 06 lds r21, 0x06DF ; 0x8006df 23fb6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23fba: 20 ed ldi r18, 0xD0 ; 208 23fbc: 3c ec ldi r19, 0xCC ; 204 23fbe: 4c e4 ldi r20, 0x4C ; 76 23fc0: 5d e3 ldi r21, 0x3D ; 61 23fc2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23fc6: 4b 01 movw r8, r22 23fc8: 5c 01 movw r10, r24 23fca: 23 e3 ldi r18, 0x33 ; 51 23fcc: 33 e3 ldi r19, 0x33 ; 51 23fce: 43 e7 ldi r20, 0x73 ; 115 23fd0: 5f e3 ldi r21, 0x3F ; 63 23fd2: 60 91 e8 05 lds r22, 0x05E8 ; 0x8005e8 23fd6: 70 91 e9 05 lds r23, 0x05E9 ; 0x8005e9 23fda: 80 91 ea 05 lds r24, 0x05EA ; 0x8005ea 23fde: 90 91 eb 05 lds r25, 0x05EB ; 0x8005eb 23fe2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 23fe6: 9b 01 movw r18, r22 23fe8: ac 01 movw r20, r24 23fea: c5 01 movw r24, r10 23fec: b4 01 movw r22, r8 23fee: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 23ff2: 4b 01 movw r8, r22 23ff4: 5c 01 movw r10, r24 23ff6: 80 92 e8 05 sts 0x05E8, r8 ; 0x8005e8 23ffa: 90 92 e9 05 sts 0x05E9, r9 ; 0x8005e9 23ffe: a0 92 ea 05 sts 0x05EA, r10 ; 0x8005ea 24002: b0 92 eb 05 sts 0x05EB, r11 ; 0x8005eb 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) 24006: 2d 81 ldd r18, Y+5 ; 0x05 24008: 3e 81 ldd r19, Y+6 ; 0x06 2400a: 4f 81 ldd r20, Y+7 ; 0x07 2400c: 58 85 ldd r21, Y+8 ; 0x08 2400e: 69 81 ldd r22, Y+1 ; 0x01 24010: 7a 81 ldd r23, Y+2 ; 0x02 24012: 8b 81 ldd r24, Y+3 ; 0x03 24014: 9c 81 ldd r25, Y+4 ; 0x04 24016: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2401a: a5 01 movw r20, r10 2401c: 94 01 movw r18, r8 2401e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 24022: 4b 01 movw r8, r22 24024: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 24026: 20 e0 ldi r18, 0x00 ; 0 24028: 30 e0 ldi r19, 0x00 ; 0 2402a: 4f e7 ldi r20, 0x7F ; 127 2402c: 53 e4 ldi r21, 0x43 ; 67 2402e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 24032: 20 e0 ldi r18, 0x00 ; 0 24034: 30 e0 ldi r19, 0x00 ; 0 24036: 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) { 24038: 18 16 cp r1, r24 2403a: 0c f0 brlt .+2 ; 0x2403e 2403c: 6d c1 rjmp .+730 ; 0x24318 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 2403e: c7 01 movw r24, r14 24040: b6 01 movw r22, r12 24042: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 24046: 18 16 cp r1, r24 24048: 84 f4 brge .+32 ; 0x2406a 2404a: a7 01 movw r20, r14 2404c: 96 01 movw r18, r12 2404e: 6d 85 ldd r22, Y+13 ; 0x0d 24050: 79 85 ldd r23, Y+9 ; 0x09 24052: 81 2f mov r24, r17 24054: 90 2f mov r25, r16 24056: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 2405a: 60 93 ec 05 sts 0x05EC, r22 ; 0x8005ec 2405e: 70 93 ed 05 sts 0x05ED, r23 ; 0x8005ed 24062: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee 24066: 90 93 ef 05 sts 0x05EF, r25 ; 0x8005ef pid_output=PID_MAX; 2406a: 81 2c mov r8, r1 2406c: 91 2c mov r9, r1 2406e: 3f e7 ldi r19, 0x7F ; 127 24070: a3 2e mov r10, r19 24072: 33 e4 ldi r19, 0x43 ; 67 24074: 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; 24076: 40 92 e4 05 sts 0x05E4, r4 ; 0x8005e4 2407a: 50 92 e5 05 sts 0x05E5, r5 ; 0x8005e5 2407e: 60 92 e6 05 sts 0x05E6, r6 ; 0x8005e6 24082: 70 92 e7 05 sts 0x05E7, r7 ; 0x8005e7 pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 24086: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.485> 2408a: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.485+0x1> 2408e: 07 2e mov r0, r23 24090: 00 0c add r0, r0 24092: 88 0b sbc r24, r24 24094: 99 0b sbc r25, r25 24096: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 2409a: 9b 01 movw r18, r22 2409c: ac 01 movw r20, r24 2409e: c3 01 movw r24, r6 240a0: b2 01 movw r22, r4 240a2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 240a6: 87 ff sbrs r24, 7 240a8: 57 c1 rjmp .+686 ; 0x24358 240aa: 23 28 or r2, r3 240ac: 09 f4 brne .+2 ; 0x240b0 240ae: 54 c1 rjmp .+680 ; 0x24358 soft_pwm[e] = (int)pid_output >> 1; 240b0: c5 01 movw r24, r10 240b2: b4 01 movw r22, r8 240b4: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 240b8: 75 95 asr r23 240ba: 67 95 ror r22 240bc: 60 93 17 05 sts 0x0517, r22 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 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); 240c0: 20 91 12 06 lds r18, 0x0612 ; 0x800612 240c4: 30 91 13 06 lds r19, 0x0613 ; 0x800613 240c8: 3a 83 std Y+2, r19 ; 0x02 240ca: 29 83 std Y+1, r18 ; 0x01 240cc: 40 90 14 06 lds r4, 0x0614 ; 0x800614 240d0: 50 90 15 06 lds r5, 0x0615 ; 0x800615 240d4: 60 90 16 06 lds r6, 0x0616 ; 0x800616 240d8: 70 90 17 06 lds r7, 0x0617 ; 0x800617 #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 240dc: b9 01 movw r22, r18 240de: 33 0f add r19, r19 240e0: 88 0b sbc r24, r24 240e2: 99 0b sbc r25, r25 240e4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 240e8: a3 01 movw r20, r6 240ea: 92 01 movw r18, r4 240ec: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 240f0: 6b 01 movw r12, r22 240f2: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 240f4: 20 91 e0 06 lds r18, 0x06E0 ; 0x8006e0 240f8: 30 91 e1 06 lds r19, 0x06E1 ; 0x8006e1 240fc: 40 91 e2 06 lds r20, 0x06E2 ; 0x8006e2 24100: 50 91 e3 06 lds r21, 0x06E3 ; 0x8006e3 24104: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 24108: 6d 83 std Y+5, r22 ; 0x05 2410a: 7e 83 std Y+6, r23 ; 0x06 2410c: 8f 83 std Y+7, r24 ; 0x07 2410e: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 24110: 20 91 f9 05 lds r18, 0x05F9 ; 0x8005f9 24114: 30 91 fa 05 lds r19, 0x05FA ; 0x8005fa 24118: 40 91 fb 05 lds r20, 0x05FB ; 0x8005fb 2411c: 50 91 fc 05 lds r21, 0x05FC ; 0x8005fc 24120: c7 01 movw r24, r14 24122: b6 01 movw r22, r12 24124: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 24128: 5b 01 movw r10, r22 2412a: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 2412c: 30 91 a3 04 lds r19, 0x04A3 ; 0x8004a3 <_ZL19temp_iState_min_bed.lto_priv.481> 24130: 3e 87 std Y+14, r19 ; 0x0e 24132: 80 91 a4 04 lds r24, 0x04A4 ; 0x8004a4 <_ZL19temp_iState_min_bed.lto_priv.481+0x1> 24136: 8d 87 std Y+13, r24 ; 0x0d 24138: 30 90 a5 04 lds r3, 0x04A5 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.481+0x2> 2413c: 20 90 a6 04 lds r2, 0x04A6 ; 0x8004a6 <_ZL19temp_iState_min_bed.lto_priv.481+0x3> 24140: 23 2f mov r18, r19 24142: 38 2f mov r19, r24 24144: 43 2d mov r20, r3 24146: 52 2d mov r21, r2 24148: b5 01 movw r22, r10 2414a: c8 01 movw r24, r16 2414c: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 24150: 87 fd sbrc r24, 7 24152: 18 c0 rjmp .+48 ; 0x24184 24154: 90 91 9f 04 lds r25, 0x049F ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.482> 24158: 9e 87 std Y+14, r25 ; 0x0e 2415a: 20 91 a0 04 lds r18, 0x04A0 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.482+0x1> 2415e: 2d 87 std Y+13, r18 ; 0x0d 24160: 30 90 a1 04 lds r3, 0x04A1 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.482+0x2> 24164: 20 90 a2 04 lds r2, 0x04A2 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.482+0x3> 24168: 29 2f mov r18, r25 2416a: 3d 85 ldd r19, Y+13 ; 0x0d 2416c: 43 2d mov r20, r3 2416e: 52 2d mov r21, r2 24170: b5 01 movw r22, r10 24172: c8 01 movw r24, r16 24174: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 24178: 18 16 cp r1, r24 2417a: 24 f0 brlt .+8 ; 0x24184 2417c: ae 86 std Y+14, r10 ; 0x0e 2417e: bd 86 std Y+13, r11 ; 0x0d 24180: 30 2e mov r3, r16 24182: 21 2e mov r2, r17 24184: 8e 85 ldd r24, Y+14 ; 0x0e 24186: 9d 85 ldd r25, Y+13 ; 0x0d 24188: a3 2d mov r26, r3 2418a: b2 2d mov r27, r2 2418c: 80 93 f9 05 sts 0x05F9, r24 ; 0x8005f9 24190: 90 93 fa 05 sts 0x05FA, r25 ; 0x8005fa 24194: a0 93 fb 05 sts 0x05FB, r26 ; 0x8005fb 24198: b0 93 fc 05 sts 0x05FC, r27 ; 0x8005fc iTerm_bed = cs.bedKi * temp_iState_bed; 2419c: 20 91 e4 06 lds r18, 0x06E4 ; 0x8006e4 241a0: 30 91 e5 06 lds r19, 0x06E5 ; 0x8006e5 241a4: 40 91 e6 06 lds r20, 0x06E6 ; 0x8006e6 241a8: 50 91 e7 06 lds r21, 0x06E7 ; 0x8006e7 241ac: bc 01 movw r22, r24 241ae: 83 2d mov r24, r3 241b0: 92 2d mov r25, r2 241b2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 241b6: 69 87 std Y+9, r22 ; 0x09 241b8: 7a 87 std Y+10, r23 ; 0x0a 241ba: 8b 87 std Y+11, r24 ; 0x0b 241bc: 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); 241be: 20 91 f5 05 lds r18, 0x05F5 ; 0x8005f5 241c2: 30 91 f6 05 lds r19, 0x05F6 ; 0x8005f6 241c6: 40 91 f7 05 lds r20, 0x05F7 ; 0x8005f7 241ca: 50 91 f8 05 lds r21, 0x05F8 ; 0x8005f8 241ce: c3 01 movw r24, r6 241d0: b2 01 movw r22, r4 241d2: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 241d6: 20 91 e8 06 lds r18, 0x06E8 ; 0x8006e8 241da: 30 91 e9 06 lds r19, 0x06E9 ; 0x8006e9 241de: 40 91 ea 06 lds r20, 0x06EA ; 0x8006ea 241e2: 50 91 eb 06 lds r21, 0x06EB ; 0x8006eb 241e6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 241ea: 20 ed ldi r18, 0xD0 ; 208 241ec: 3c ec ldi r19, 0xCC ; 204 241ee: 4c e4 ldi r20, 0x4C ; 76 241f0: 5d e3 ldi r21, 0x3D ; 61 241f2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 241f6: 4b 01 movw r8, r22 241f8: 5c 01 movw r10, r24 241fa: 23 e3 ldi r18, 0x33 ; 51 241fc: 33 e3 ldi r19, 0x33 ; 51 241fe: 43 e7 ldi r20, 0x73 ; 115 24200: 5f e3 ldi r21, 0x3F ; 63 24202: 60 91 f1 05 lds r22, 0x05F1 ; 0x8005f1 24206: 70 91 f2 05 lds r23, 0x05F2 ; 0x8005f2 2420a: 80 91 f3 05 lds r24, 0x05F3 ; 0x8005f3 2420e: 90 91 f4 05 lds r25, 0x05F4 ; 0x8005f4 24212: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 24216: 9b 01 movw r18, r22 24218: ac 01 movw r20, r24 2421a: c5 01 movw r24, r10 2421c: b4 01 movw r22, r8 2421e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 24222: 4b 01 movw r8, r22 24224: 5c 01 movw r10, r24 24226: 80 92 f1 05 sts 0x05F1, r8 ; 0x8005f1 2422a: 90 92 f2 05 sts 0x05F2, r9 ; 0x8005f2 2422e: a0 92 f3 05 sts 0x05F3, r10 ; 0x8005f3 24232: b0 92 f4 05 sts 0x05F4, r11 ; 0x8005f4 temp_dState_bed = pid_input; 24236: 40 92 f5 05 sts 0x05F5, r4 ; 0x8005f5 2423a: 50 92 f6 05 sts 0x05F6, r5 ; 0x8005f6 2423e: 60 92 f7 05 sts 0x05F7, r6 ; 0x8005f7 24242: 70 92 f8 05 sts 0x05F8, r7 ; 0x8005f8 pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 24246: 29 85 ldd r18, Y+9 ; 0x09 24248: 3a 85 ldd r19, Y+10 ; 0x0a 2424a: 4b 85 ldd r20, Y+11 ; 0x0b 2424c: 5c 85 ldd r21, Y+12 ; 0x0c 2424e: 6d 81 ldd r22, Y+5 ; 0x05 24250: 7e 81 ldd r23, Y+6 ; 0x06 24252: 8f 81 ldd r24, Y+7 ; 0x07 24254: 98 85 ldd r25, Y+8 ; 0x08 24256: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2425a: a5 01 movw r20, r10 2425c: 94 01 movw r18, r8 2425e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 24262: 4b 01 movw r8, r22 24264: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 24266: 20 e0 ldi r18, 0x00 ; 0 24268: 30 e0 ldi r19, 0x00 ; 0 2426a: 4f e7 ldi r20, 0x7F ; 127 2426c: 53 e4 ldi r21, 0x43 ; 67 2426e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 24272: 20 e0 ldi r18, 0x00 ; 0 24274: 30 e0 ldi r19, 0x00 ; 0 24276: 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) { 24278: 18 16 cp r1, r24 2427a: 0c f0 brlt .+2 ; 0x2427e 2427c: 70 c0 rjmp .+224 ; 0x2435e if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 2427e: c7 01 movw r24, r14 24280: b6 01 movw r22, r12 24282: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 24286: 18 16 cp r1, r24 24288: 84 f4 brge .+32 ; 0x242aa 2428a: a7 01 movw r20, r14 2428c: 96 01 movw r18, r12 2428e: 6e 85 ldd r22, Y+14 ; 0x0e 24290: 7d 85 ldd r23, Y+13 ; 0x0d 24292: 83 2d mov r24, r3 24294: 92 2d mov r25, r2 24296: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 2429a: 60 93 f9 05 sts 0x05F9, r22 ; 0x8005f9 2429e: 70 93 fa 05 sts 0x05FA, r23 ; 0x8005fa 242a2: 80 93 fb 05 sts 0x05FB, r24 ; 0x8005fb 242a6: 90 93 fc 05 sts 0x05FC, r25 ; 0x8005fc pid_output=MAX_BED_POWER; 242aa: 81 2c mov r8, r1 242ac: 91 2c mov r9, r1 242ae: 9f e7 ldi r25, 0x7F ; 127 242b0: a9 2e mov r10, r25 242b2: 93 e4 ldi r25, 0x43 ; 67 242b4: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 242b6: 20 e0 ldi r18, 0x00 ; 0 242b8: 30 e0 ldi r19, 0x00 ; 0 242ba: 4a ef ldi r20, 0xFA ; 250 242bc: 52 e4 ldi r21, 0x42 ; 66 242be: c3 01 movw r24, r6 242c0: b2 01 movw r22, r4 242c2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 242c6: 87 ff sbrs r24, 7 242c8: 6d c0 rjmp .+218 ; 0x243a4 { soft_pwm_bed = (int)pid_output >> 1; 242ca: c5 01 movw r24, r10 242cc: b4 01 movw r22, r8 242ce: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 242d2: 75 95 asr r23 242d4: 67 95 ror r22 242d6: 60 93 18 06 sts 0x0618, r22 ; 0x800618 soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 242da: 89 81 ldd r24, Y+1 ; 0x01 242dc: 9a 81 ldd r25, Y+2 ; 0x02 242de: 89 2b or r24, r25 242e0: 11 f4 brne .+4 ; 0x242e6 { soft_pwm_bed = 0; 242e2: 10 92 18 06 sts 0x0618, r1 ; 0x800618 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); } 242e6: 2e 96 adiw r28, 0x0e ; 14 242e8: 0f b6 in r0, 0x3f ; 63 242ea: f8 94 cli 242ec: de bf out 0x3e, r29 ; 62 242ee: 0f be out 0x3f, r0 ; 63 242f0: cd bf out 0x3d, r28 ; 61 242f2: df 91 pop r29 242f4: cf 91 pop r28 242f6: 1f 91 pop r17 242f8: 0f 91 pop r16 242fa: ff 90 pop r15 242fc: ef 90 pop r14 242fe: df 90 pop r13 24300: cf 90 pop r12 24302: bf 90 pop r11 24304: af 90 pop r10 24306: 9f 90 pop r9 24308: 8f 90 pop r8 2430a: 7f 90 pop r7 2430c: 6f 90 pop r6 2430e: 5f 90 pop r5 24310: 4f 90 pop r4 24312: 3f 90 pop r3 24314: 2f 90 pop r2 24316: 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) { 24318: c5 01 movw r24, r10 2431a: b4 01 movw r22, r8 2431c: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 24320: 87 ff sbrs r24, 7 24322: a9 ce rjmp .-686 ; 0x24076 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 24324: 20 e0 ldi r18, 0x00 ; 0 24326: 30 e0 ldi r19, 0x00 ; 0 24328: a9 01 movw r20, r18 2432a: c7 01 movw r24, r14 2432c: b6 01 movw r22, r12 2432e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 24332: 87 ff sbrs r24, 7 24334: a3 cd rjmp .-1210 ; 0x23e7c 24336: a7 01 movw r20, r14 24338: 96 01 movw r18, r12 2433a: 6d 85 ldd r22, Y+13 ; 0x0d 2433c: 79 85 ldd r23, Y+9 ; 0x09 2433e: 81 2f mov r24, r17 24340: 90 2f mov r25, r16 24342: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 24346: 60 93 ec 05 sts 0x05EC, r22 ; 0x8005ec 2434a: 70 93 ed 05 sts 0x05ED, r23 ; 0x8005ed 2434e: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee 24352: 90 93 ef 05 sts 0x05EF, r25 ; 0x8005ef 24356: 92 cd rjmp .-1244 ; 0x23e7c // 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; 24358: 10 92 17 05 sts 0x0517, r1 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 2435c: b1 ce rjmp .-670 ; 0x240c0 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){ 2435e: c5 01 movw r24, r10 24360: b4 01 movw r22, r8 24362: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 24366: 87 ff sbrs r24, 7 24368: a6 cf rjmp .-180 ; 0x242b6 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 2436a: 20 e0 ldi r18, 0x00 ; 0 2436c: 30 e0 ldi r19, 0x00 ; 0 2436e: a9 01 movw r20, r18 24370: c7 01 movw r24, r14 24372: b6 01 movw r22, r12 24374: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 24378: 87 ff sbrs r24, 7 2437a: 10 c0 rjmp .+32 ; 0x2439c 2437c: a7 01 movw r20, r14 2437e: 96 01 movw r18, r12 24380: 6e 85 ldd r22, Y+14 ; 0x0e 24382: 7d 85 ldd r23, Y+13 ; 0x0d 24384: 83 2d mov r24, r3 24386: 92 2d mov r25, r2 24388: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 2438c: 60 93 f9 05 sts 0x05F9, r22 ; 0x8005f9 24390: 70 93 fa 05 sts 0x05FA, r23 ; 0x8005fa 24394: 80 93 fb 05 sts 0x05FB, r24 ; 0x8005fb 24398: 90 93 fc 05 sts 0x05FC, r25 ; 0x8005fc pid_output=0; 2439c: 81 2c mov r8, r1 2439e: 91 2c mov r9, r1 243a0: 54 01 movw r10, r8 243a2: 89 cf rjmp .-238 ; 0x242b6 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 243a4: 10 92 18 06 sts 0x0618, r1 ; 0x800618 243a8: 98 cf rjmp .-208 ; 0x242da 000243aa : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 243ae: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 243b2: 90 93 1a 06 sts 0x061A, r25 ; 0x80061a 243b6: 80 93 19 06 sts 0x0619, r24 ; 0x800619 target_temperature_bed_isr = target_temperature_bed; 243ba: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 243be: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a 243c2: 90 93 13 06 sts 0x0613, r25 ; 0x800613 243c6: 80 93 12 06 sts 0x0612, r24 ; 0x800612 } 243ca: 08 95 ret 000243cc : { // 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) 243cc: 81 30 cpi r24, 0x01 ; 1 243ce: 41 f1 breq .+80 ; 0x24420 243d0: 20 f0 brcs .+8 ; 0x243da 243d2: 82 30 cpi r24, 0x02 ; 2 243d4: 09 f4 brne .+2 ; 0x243d8 243d6: 45 c0 rjmp .+138 ; 0x24462 243d8: 08 95 ret { case X_AXIS: { enable_x(); 243da: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); 243dc: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 243e0: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 243e2: 91 e0 ldi r25, 0x01 ; 1 243e4: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 243e6: 86 17 cp r24, r22 243e8: 59 f0 breq .+22 ; 0x24400 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 243ea: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 243ee: 66 23 and r22, r22 243f0: 89 f0 breq .+34 ; 0x24414 243f2: 91 60 ori r25, 0x01 ; 1 243f4: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 243f8: eb e4 ldi r30, 0x4B ; 75 243fa: f0 e0 ldi r31, 0x00 ; 0 243fc: 31 97 sbiw r30, 0x01 ; 1 243fe: f1 f7 brne .-4 ; 0x243fc delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 24400: 91 e0 ldi r25, 0x01 ; 1 24402: 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); 24404: 88 23 and r24, r24 24406: 41 f0 breq .+16 ; 0x24418 24408: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2440c: 81 60 ori r24, 0x01 ; 1 STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 2440e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 24412: 08 95 ret uint8_t old_x_dir_pin = READ(X_DIR_PIN); 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); 24414: 9e 7f andi r25, 0xFE ; 254 24416: ee cf rjmp .-36 ; 0x243f4 #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); 24418: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2441c: 8e 7f andi r24, 0xFE ; 254 2441e: f7 cf rjmp .-18 ; 0x2440e } break; case Y_AXIS: { enable_y(); 24420: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); 24422: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 24426: 81 e0 ldi r24, 0x01 ; 1 24428: 29 2f mov r18, r25 2442a: 22 70 andi r18, 0x02 ; 2 2442c: 91 ff sbrs r25, 1 2442e: 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) { 24430: 86 17 cp r24, r22 24432: 59 f0 breq .+22 ; 0x2444a WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 24434: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24438: 66 23 and r22, r22 2443a: 79 f0 breq .+30 ; 0x2445a 2443c: 82 60 ori r24, 0x02 ; 2 2443e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24442: 8b e4 ldi r24, 0x4B ; 75 24444: 90 e0 ldi r25, 0x00 ; 0 24446: 01 97 sbiw r24, 0x01 ; 1 24448: f1 f7 brne .-4 ; 0x24446 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 2444a: 82 e0 ldi r24, 0x02 ; 2 2444c: 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); 2444e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24452: 22 23 and r18, r18 24454: 21 f0 breq .+8 ; 0x2445e 24456: 82 60 ori r24, 0x02 ; 2 24458: da cf rjmp .-76 ; 0x2440e uint8_t old_y_dir_pin = READ(Y_DIR_PIN); 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); 2445a: 8d 7f andi r24, 0xFD ; 253 2445c: f0 cf rjmp .-32 ; 0x2443e #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); 2445e: 8d 7f andi r24, 0xFD ; 253 24460: d6 cf rjmp .-84 ; 0x2440e } break; case Z_AXIS: { enable_z(); 24462: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); 24464: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 24468: 81 e0 ldi r24, 0x01 ; 1 2446a: 29 2f mov r18, r25 2446c: 24 70 andi r18, 0x04 ; 4 2446e: 92 ff sbrs r25, 2 24470: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 24472: 91 e0 ldi r25, 0x01 ; 1 24474: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 24476: 86 17 cp r24, r22 24478: 59 f0 breq .+22 ; 0x24490 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 2447a: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2447e: 66 23 and r22, r22 24480: 91 f0 breq .+36 ; 0x244a6 24482: 94 60 ori r25, 0x04 ; 4 24484: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24488: eb e4 ldi r30, 0x4B ; 75 2448a: f0 e0 ldi r31, 0x00 ; 0 2448c: 31 97 sbiw r30, 0x01 ; 1 2448e: f1 f7 brne .-4 ; 0x2448c delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 24490: 94 e0 ldi r25, 0x04 ; 4 24492: 96 b9 out 0x06, r25 ; 6 STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { 24494: 86 17 cp r24, r22 24496: 09 f4 brne .+2 ; 0x2449a 24498: bc cf rjmp .-136 ; 0x24412 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 2449a: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2449e: 22 23 and r18, r18 244a0: 21 f0 breq .+8 ; 0x244aa 244a2: 84 60 ori r24, 0x04 ; 4 244a4: b4 cf rjmp .-152 ; 0x2440e uint8_t old_z_dir_pin = READ(Z_DIR_PIN); 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); 244a6: 9b 7f andi r25, 0xFB ; 251 244a8: ed cf rjmp .-38 ; 0x24484 STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); //get old pin state back. if (new_z_dir_pin != old_z_dir_pin) { WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 244aa: 8b 7f andi r24, 0xFB ; 251 244ac: b0 cf rjmp .-160 ; 0x2440e 000244ae : } } static void checkRx(void) { if (selectedSerialPort == 0) { 244ae: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 244b2: 81 11 cpse r24, r1 244b4: 25 c0 rjmp .+74 ; 0x24500 if((M_UCSRxA & (1< 244ba: 87 ff sbrs r24, 7 244bc: 3d c0 rjmp .+122 ; 0x24538 // Test for a framing error. if (M_UCSRxA & (1< 244c2: 84 ff sbrs r24, 4 244c4: 03 c0 rjmp .+6 ; 0x244cc // 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); 244c6: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 244ca: 08 95 ret } else { unsigned char c = M_UDRx; 244cc: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 244d0: 20 91 91 04 lds r18, 0x0491 ; 0x800491 244d4: 30 91 92 04 lds r19, 0x0492 ; 0x800492 244d8: c9 01 movw r24, r18 244da: 01 96 adiw r24, 0x01 ; 1 244dc: 8f 77 andi r24, 0x7F ; 127 244de: 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) { 244e0: 60 91 93 04 lds r22, 0x0493 ; 0x800493 244e4: 70 91 94 04 lds r23, 0x0494 ; 0x800494 244e8: 86 17 cp r24, r22 244ea: 97 07 cpc r25, r23 244ec: 29 f1 breq .+74 ; 0x24538 // 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; 244ee: 2f 5e subi r18, 0xEF ; 239 244f0: 3b 4f sbci r19, 0xFB ; 251 244f2: f9 01 movw r30, r18 244f4: 40 83 st Z, r20 rx_buffer.head = i; 244f6: 90 93 92 04 sts 0x0492, r25 ; 0x800492 244fa: 80 93 91 04 sts 0x0491, r24 ; 0x800491 244fe: 1c c0 rjmp .+56 ; 0x24538 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 24504: 87 ff sbrs r24, 7 24506: 18 c0 rjmp .+48 ; 0x24538 // Test for a framing error. if (UCSR1A & (1< 2450c: 84 ff sbrs r24, 4 2450e: 03 c0 rjmp .+6 ; 0x24516 // 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); 24510: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 24514: 08 95 ret } else { unsigned char c = UDR1; 24516: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 2451a: 20 91 91 04 lds r18, 0x0491 ; 0x800491 2451e: 30 91 92 04 lds r19, 0x0492 ; 0x800492 24522: c9 01 movw r24, r18 24524: 01 96 adiw r24, 0x01 ; 1 24526: 8f 77 andi r24, 0x7F ; 127 24528: 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) { 2452a: 60 91 93 04 lds r22, 0x0493 ; 0x800493 2452e: 70 91 94 04 lds r23, 0x0494 ; 0x800494 24532: 68 17 cp r22, r24 24534: 79 07 cpc r23, r25 24536: d9 f6 brne .-74 ; 0x244ee M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 24538: 08 95 ret 0002453a : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 2453a: 23 e0 ldi r18, 0x03 ; 3 2453c: 81 11 cpse r24, r1 2453e: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 24552: 94 60 ori r25, 0x04 ; 4 24554: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24558: 3f bf out 0x3f, r19 ; 63 2455a: fb 01 movw r30, r22 2455c: 31 97 sbiw r30, 0x01 ; 1 2455e: f1 f7 brne .-4 ; 0x2455c delayMicroseconds(200); WRITE(BEEPER,LOW); 24560: 3f b7 in r19, 0x3f ; 63 24562: f8 94 cli 24564: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24568: 9b 7f andi r25, 0xFB ; 251 2456a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2456e: 3f bf out 0x3f, r19 ; 63 24570: fa 01 movw r30, r20 24572: 31 97 sbiw r30, 0x01 ; 1 24574: f1 f7 brne .-4 ; 0x24572 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); } } 2457c: 08 95 ret 0002457e : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 2457e: 8a e0 ldi r24, 0x0A ; 10 24580: 2b e8 ldi r18, 0x8B ; 139 24582: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 24584: 4f b7 in r20, 0x3f ; 63 24586: f8 94 cli 24588: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2458c: 94 60 ori r25, 0x04 ; 4 2458e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24592: 4f bf out 0x3f, r20 ; 63 24594: f9 01 movw r30, r18 24596: 31 97 sbiw r30, 0x01 ; 1 24598: f1 f7 brne .-4 ; 0x24596 delayMicroseconds(100); WRITE(BEEPER,LOW); 2459a: 4f b7 in r20, 0x3f ; 63 2459c: f8 94 cli 2459e: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 245a2: 9b 7f andi r25, 0xFB ; 251 245a4: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 245a8: 4f bf out 0x3f, r20 ; 63 245aa: f9 01 movw r30, r18 245ac: 31 97 sbiw r30, 0x01 ; 1 245ae: f1 f7 brne .-4 ; 0x245ac 245b0: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 245b2: 41 f7 brne .-48 ; 0x24584 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 245b4: 08 95 ret 000245b6 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 245b6: 87 ea ldi r24, 0xA7 ; 167 245b8: 9c e0 ldi r25, 0x0C ; 12 245ba: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 if (eeprom_setting != 0) 245be: 81 11 cpse r24, r1 245c0: 05 c0 rjmp .+10 ; 0x245cc return false; switch(eFilamentAction) { 245c2: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 245c6: 81 50 subi r24, 0x01 ; 1 245c8: 88 30 cpi r24, 0x08 ; 8 245ca: 10 f0 brcs .+4 ; 0x245d0 #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; 245cc: 80 e0 ldi r24, 0x00 ; 0 245ce: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 245d0: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 245d2: 08 95 ret 000245d4 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 245d4: 0f 94 08 cf call 0x39e10 ; 0x39e10 245d8: 10 92 13 05 sts 0x0513, r1 ; 0x800513 245dc: 80 91 13 05 lds r24, 0x0513 ; 0x800513 245e0: 84 30 cpi r24, 0x04 ; 4 245e2: a8 f5 brcc .+106 ; 0x2464e 245e4: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 245e8: 87 e6 ldi r24, 0x67 ; 103 245ea: 9d e3 ldi r25, 0x3D ; 61 245ec: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 245f0: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 245f4: 8f ef ldi r24, 0xFF ; 255 245f6: 9d e4 ldi r25, 0x4D ; 77 245f8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 245fc: 67 ed ldi r22, 0xD7 ; 215 245fe: 7a e3 ldi r23, 0x3A ; 58 24600: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 24604: 86 ef ldi r24, 0xF6 ; 246 24606: 9d e4 ldi r25, 0x4D ; 77 24608: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2460c: 6d e5 ldi r22, 0x5D ; 93 2460e: 79 e3 ldi r23, 0x39 ; 57 24610: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 24614: 8d ee ldi r24, 0xED ; 237 24616: 9d e4 ldi r25, 0x4D ; 77 24618: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2461c: 6f e7 ldi r22, 0x7F ; 127 2461e: 79 e3 ldi r23, 0x39 ; 57 24620: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 24624: 82 ee ldi r24, 0xE2 ; 226 24626: 9d e4 ldi r25, 0x4D ; 77 24628: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2462c: 6d ec ldi r22, 0xCD ; 205 2462e: 7a e3 ldi r23, 0x3A ; 58 24630: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_END(); 24634: 0f 94 dc ce call 0x39db8 ; 0x39db8 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 24638: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2463c: 8f 5f subi r24, 0xFF ; 255 2463e: 80 93 13 05 sts 0x0513, r24 ; 0x800513 24642: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24646: 8f 5f subi r24, 0xFF ; 255 24648: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2464c: c7 cf rjmp .-114 ; 0x245dc 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(); } 2464e: 08 95 ret 00024650 : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 24650: 0f 94 08 cf call 0x39e10 ; 0x39e10 24654: 10 92 13 05 sts 0x0513, r1 ; 0x800513 24658: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2465c: 84 30 cpi r24, 0x04 ; 4 2465e: 28 f5 brcc .+74 ; 0x246aa 24660: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 24664: 88 eb ldi r24, 0xB8 ; 184 24666: 9d e3 ldi r25, 0x3D ; 61 24668: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2466c: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 24670: 81 e8 ldi r24, 0x81 ; 129 24672: 9a e4 ldi r25, 0x4A ; 74 24674: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24678: 65 ee ldi r22, 0xE5 ; 229 2467a: 79 e3 ldi r23, 0x39 ; 57 2467c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 24680: 89 e7 ldi r24, 0x79 ; 121 24682: 9a e4 ldi r25, 0x4A ; 74 24684: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24688: 69 e0 ldi r22, 0x09 ; 9 2468a: 7b e3 ldi r23, 0x3B ; 59 2468c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_END(); 24690: 0f 94 dc ce call 0x39db8 ; 0x39db8 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 24694: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24698: 8f 5f subi r24, 0xFF ; 255 2469a: 80 93 13 05 sts 0x0513, r24 ; 0x800513 2469e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 246a2: 8f 5f subi r24, 0xFF ; 255 246a4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 246a8: d7 cf rjmp .-82 ; 0x24658 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(); } 246aa: 08 95 ret 000246ac : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 246ac: 0f 94 08 cf call 0x39e10 ; 0x39e10 246b0: 10 92 13 05 sts 0x0513, r1 ; 0x800513 246b4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 246b8: 84 30 cpi r24, 0x04 ; 4 246ba: 68 f5 brcc .+90 ; 0x24716 246bc: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 246c0: 88 eb ldi r24, 0xB8 ; 184 246c2: 9d e3 ldi r25, 0x3D ; 61 246c4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 246c8: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 246cc: 81 e8 ldi r24, 0x81 ; 129 246ce: 9a e4 ldi r25, 0x4A ; 74 246d0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 246d4: 6d e9 ldi r22, 0x9D ; 157 246d6: 7a e3 ldi r23, 0x3A ; 58 246d8: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 246dc: 89 e7 ldi r24, 0x79 ; 121 246de: 9a e4 ldi r25, 0x4A ; 74 246e0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 246e4: 69 ec ldi r22, 0xC9 ; 201 246e6: 7a e3 ldi r23, 0x3A ; 58 246e8: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 246ec: 87 e1 ldi r24, 0x17 ; 23 246ee: 9a e4 ldi r25, 0x4A ; 74 246f0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 246f4: 61 e7 ldi r22, 0x71 ; 113 246f6: 7b e3 ldi r23, 0x3B ; 59 246f8: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_END(); 246fc: 0f 94 dc ce call 0x39db8 ; 0x39db8 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 24700: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24704: 8f 5f subi r24, 0xFF ; 255 24706: 80 93 13 05 sts 0x0513, r24 ; 0x800513 2470a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2470e: 8f 5f subi r24, 0xFF ; 255 24710: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24714: cf cf rjmp .-98 ; 0x246b4 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(); } 24716: 08 95 ret 00024718 : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 24718: 89 ea ldi r24, 0xA9 ; 169 2471a: 9d e0 ldi r25, 0x0D ; 13 2471c: 0c 94 b7 77 jmp 0xef6e ; 0xef6e 00024720 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 24720: 8c ea ldi r24, 0xAC ; 172 24722: 9c e0 ldi r25, 0x0C ; 12 24724: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 if (current_state) 24728: 88 23 and r24, r24 2472a: 61 f0 breq .+24 ; 0x24744 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2472c: 10 92 96 13 sts 0x1396, r1 ; 0x801396 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 24730: 10 92 44 13 sts 0x1344, r1 ; 0x801344 currentScope = Scope::Stopped; 24734: 10 92 29 13 sts 0x1329, r1 ; 0x801329 else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 24738: 8c ea ldi r24, 0xAC ; 172 2473a: 9c e0 ldi r25, 0x0C ; 12 2473c: 0e 94 b7 77 call 0xef6e ; 0xef6e MMU2::mmu2.Status(); 24740: 0d 94 ff 76 jmp 0x2edfe ; 0x2edfe { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 24744: 0e 94 1b db call 0x1b636 ; 0x1b636 24748: f7 cf rjmp .-18 ; 0x24738 0002474a : 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) 2474a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2474e: 88 23 and r24, r24 24750: 21 f0 breq .+8 ; 0x2475a 24752: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 24756: 88 23 and r24, r24 24758: 51 f0 breq .+20 ; 0x2476e { _md->status = 1; 2475a: 81 e0 ldi r24, 0x01 ; 1 2475c: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 24760: 60 e0 ldi r22, 0x00 ; 0 24762: 8a e2 ldi r24, 0x2A ; 42 24764: 9d e0 ldi r25, 0x0D ; 13 24766: 0e 94 8c 77 call 0xef18 ; 0xef18 2476a: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } MENU_BEGIN(); 2476e: 0f 94 08 cf call 0x39e10 ; 0x39e10 24772: 10 92 13 05 sts 0x0513, r1 ; 0x800513 24776: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2477a: 84 30 cpi r24, 0x04 ; 4 2477c: 08 f0 brcs .+2 ; 0x24780 2477e: 81 c0 rjmp .+258 ; 0x24882 24780: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 24784: 80 91 f6 03 lds r24, 0x03F6 ; 0x8003f6 24788: 81 11 cpse r24, r1 2478a: 4a c0 rjmp .+148 ; 0x24820 2478c: 89 e1 ldi r24, 0x19 ; 25 2478e: 90 e4 ldi r25, 0x40 ; 64 24790: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24794: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 24798: 8d e3 ldi r24, 0x3D ; 61 2479a: 9b e3 ldi r25, 0x3B ; 59 2479c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 247a0: 6f ed ldi r22, 0xDF ; 223 247a2: 79 e3 ldi r23, 0x39 ; 57 247a4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c SETTINGS_NOZZLE; 247a8: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 247ac: 8c 33 cpi r24, 0x3C ; 60 247ae: 09 f4 brne .+2 ; 0x247b2 247b0: 54 c0 rjmp .+168 ; 0x2485a 247b2: c8 f5 brcc .+114 ; 0x24826 247b4: 89 31 cpi r24, 0x19 ; 25 247b6: 09 f4 brne .+2 ; 0x247ba 247b8: 44 c0 rjmp .+136 ; 0x24842 247ba: 88 32 cpi r24, 0x28 ; 40 247bc: c1 f1 breq .+112 ; 0x2482e MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 247be: 83 e5 ldi r24, 0x53 ; 83 247c0: 97 e5 ldi r25, 0x57 ; 87 247c2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 247c6: 67 e4 ldi r22, 0x47 ; 71 247c8: 7b e3 ldi r23, 0x3B ; 59 247ca: 0f 94 85 ce call 0x39d0a ; 0x39d0a MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 247ce: 8a e4 ldi r24, 0x4A ; 74 247d0: 97 e5 ldi r25, 0x57 ; 87 247d2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 247d6: 61 e3 ldi r22, 0x31 ; 49 247d8: 7b e3 ldi r23, 0x3B ; 59 247da: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #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); 247de: 80 91 96 13 lds r24, 0x1396 ; 0x801396 247e2: 81 30 cpi r24, 0x01 ; 1 247e4: 31 f0 breq .+12 ; 0x247f2 247e6: 67 e2 ldi r22, 0x27 ; 39 247e8: 7a e3 ldi r23, 0x3A ; 58 247ea: 82 e8 ldi r24, 0x82 ; 130 247ec: 94 ea ldi r25, 0xA4 ; 164 247ee: 0f 94 85 ce call 0x39d0a ; 0x39d0a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (_md->experimental_menu_visibility) 247f2: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 247f6: 88 23 and r24, r24 247f8: 31 f0 breq .+12 ; 0x24806 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 247fa: 6d e3 ldi r22, 0x3D ; 61 247fc: 7a e3 ldi r23, 0x3A ; 58 247fe: 85 e7 ldi r24, 0x75 ; 117 24800: 94 ea ldi r25, 0xA4 ; 164 24802: 0f 94 86 d1 call 0x3a30c ; 0x3a30c //! //! 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(); 24806: 0f 94 dc ce call 0x39db8 ; 0x39db8 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 2480a: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2480e: 8f 5f subi r24, 0xFF ; 255 24810: 80 93 13 05 sts 0x0513, r24 ; 0x800513 24814: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24818: 8f 5f subi r24, 0xFF ; 255 2481a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2481e: ab cf rjmp .-170 ; 0x24776 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 24820: 87 e6 ldi r24, 0x67 ; 103 24822: 9d e3 ldi r25, 0x3D ; 61 24824: b5 cf rjmp .-150 ; 0x24790 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 24826: 80 35 cpi r24, 0x50 ; 80 24828: 11 f1 breq .+68 ; 0x2486e 2482a: 8f 3f cpi r24, 0xFF ; 255 2482c: 41 f6 brne .-112 ; 0x247be 2482e: 87 ee ldi r24, 0xE7 ; 231 24830: 9b e3 ldi r25, 0x3B ; 59 24832: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24836: 22 e0 ldi r18, 0x02 ; 2 24838: 41 e6 ldi r20, 0x61 ; 97 2483a: 5b e3 ldi r21, 0x3B ; 59 2483c: 6e e9 ldi r22, 0x9E ; 158 2483e: 74 ea ldi r23, 0xA4 ; 164 24840: 09 c0 rjmp .+18 ; 0x24854 24842: 87 ee ldi r24, 0xE7 ; 231 24844: 9b e3 ldi r25, 0x3B ; 59 24846: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2484a: 22 e0 ldi r18, 0x02 ; 2 2484c: 41 e6 ldi r20, 0x61 ; 97 2484e: 5b e3 ldi r21, 0x3B ; 59 24850: 63 ea ldi r22, 0xA3 ; 163 24852: 74 ea ldi r23, 0xA4 ; 164 24854: 0f 94 97 d0 call 0x3a12e ; 0x3a12e 24858: b2 cf rjmp .-156 ; 0x247be 2485a: 87 ee ldi r24, 0xE7 ; 231 2485c: 9b e3 ldi r25, 0x3B ; 59 2485e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24862: 22 e0 ldi r18, 0x02 ; 2 24864: 41 e6 ldi r20, 0x61 ; 97 24866: 5b e3 ldi r21, 0x3B ; 59 24868: 69 e9 ldi r22, 0x99 ; 153 2486a: 74 ea ldi r23, 0xA4 ; 164 2486c: f3 cf rjmp .-26 ; 0x24854 2486e: 87 ee ldi r24, 0xE7 ; 231 24870: 9b e3 ldi r25, 0x3B ; 59 24872: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24876: 22 e0 ldi r18, 0x02 ; 2 24878: 41 e6 ldi r20, 0x61 ; 97 2487a: 5b e3 ldi r21, 0x3B ; 59 2487c: 64 e9 ldi r22, 0x94 ; 148 2487e: 74 ea ldi r23, 0xA4 ; 164 24880: e9 cf rjmp .-46 ; 0x24854 //! 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(); } 24882: 08 95 ret 00024884 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 24884: 80 e0 ldi r24, 0x00 ; 0 24886: 0d 94 b4 1d jmp 0x23b68 ; 0x23b68 0002488a : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 2488a: 0f 94 08 cf call 0x39e10 ; 0x39e10 2488e: 10 92 13 05 sts 0x0513, r1 ; 0x800513 24892: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24896: 84 30 cpi r24, 0x04 ; 4 24898: 08 f0 brcs .+2 ; 0x2489c 2489a: 45 c0 rjmp .+138 ; 0x24926 2489c: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 248a0: 8e eb ldi r24, 0xBE ; 190 248a2: 97 e5 ldi r25, 0x57 ; 87 248a4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 248a8: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 248ac: 66 e2 ldi r22, 0x26 ; 38 248ae: 74 ed ldi r23, 0xD4 ; 212 248b0: 89 e4 ldi r24, 0x49 ; 73 248b2: 9d e0 ldi r25, 0x0D ; 13 248b4: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 248b8: 61 e2 ldi r22, 0x21 ; 33 248ba: 74 ed ldi r23, 0xD4 ; 212 248bc: 84 e5 ldi r24, 0x54 ; 84 248be: 9d e0 ldi r25, 0x0D ; 13 248c0: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 248c4: 6c e1 ldi r22, 0x1C ; 28 248c6: 74 ed ldi r23, 0xD4 ; 212 248c8: 8f e5 ldi r24, 0x5F ; 95 248ca: 9d e0 ldi r25, 0x0D ; 13 248cc: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 248d0: 67 e1 ldi r22, 0x17 ; 23 248d2: 74 ed ldi r23, 0xD4 ; 212 248d4: 8a e6 ldi r24, 0x6A ; 106 248d6: 9d e0 ldi r25, 0x0D ; 13 248d8: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 248dc: 62 e1 ldi r22, 0x12 ; 18 248de: 74 ed ldi r23, 0xD4 ; 212 248e0: 85 e7 ldi r24, 0x75 ; 117 248e2: 9d e0 ldi r25, 0x0D ; 13 248e4: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 248e8: 6d e0 ldi r22, 0x0D ; 13 248ea: 74 ed ldi r23, 0xD4 ; 212 248ec: 80 e8 ldi r24, 0x80 ; 128 248ee: 9d e0 ldi r25, 0x0D ; 13 248f0: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 248f4: 68 e0 ldi r22, 0x08 ; 8 248f6: 74 ed ldi r23, 0xD4 ; 212 248f8: 8b e8 ldi r24, 0x8B ; 139 248fa: 9d e0 ldi r25, 0x0D ; 13 248fc: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 24900: 63 e0 ldi r22, 0x03 ; 3 24902: 74 ed ldi r23, 0xD4 ; 212 24904: 86 e9 ldi r24, 0x96 ; 150 24906: 9d e0 ldi r25, 0x0D ; 13 24908: 0f 94 36 d1 call 0x3a26c ; 0x3a26c MENU_END(); 2490c: 0f 94 dc ce call 0x39db8 ; 0x39db8 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 24910: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24914: 8f 5f subi r24, 0xFF ; 255 24916: 80 93 13 05 sts 0x0513, r24 ; 0x800513 2491a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2491e: 8f 5f subi r24, 0xFF ; 255 24920: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24924: b6 cf rjmp .-148 ; 0x24892 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(); } 24926: 08 95 ret 00024928 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 24928: 0f 94 08 cf call 0x39e10 ; 0x39e10 2492c: 10 92 13 05 sts 0x0513, r1 ; 0x800513 24930: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24934: 84 30 cpi r24, 0x04 ; 4 24936: d8 f5 brcc .+118 ; 0x249ae 24938: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 2493c: 8e eb ldi r24, 0xBE ; 190 2493e: 97 e5 ldi r25, 0x57 ; 87 24940: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24944: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 24948: 81 e4 ldi r24, 0x41 ; 65 2494a: 97 e5 ldi r25, 0x57 ; 87 2494c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24950: 49 e8 ldi r20, 0x89 ; 137 24952: 59 e3 ldi r21, 0x39 ; 57 24954: bc 01 movw r22, r24 24956: 80 91 ed 04 lds r24, 0x04ED ; 0x8004ed 2495a: 0e 94 b0 f9 call 0x1f360 ; 0x1f360 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 2495e: 89 e3 ldi r24, 0x39 ; 57 24960: 97 e5 ldi r25, 0x57 ; 87 24962: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24966: 47 ea ldi r20, 0xA7 ; 167 24968: 59 e3 ldi r21, 0x39 ; 57 2496a: bc 01 movw r22, r24 2496c: 80 91 eb 04 lds r24, 0x04EB ; 0x8004eb 24970: 0e 94 b0 f9 call 0x1f360 ; 0x1f360 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 24974: 43 e8 ldi r20, 0x83 ; 131 24976: 5a e3 ldi r21, 0x3A ; 58 24978: 6b e4 ldi r22, 0x4B ; 75 2497a: 70 e7 ldi r23, 0x70 ; 112 2497c: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 24980: 0e 94 b0 f9 call 0x1f360 ; 0x1f360 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 24984: 47 e4 ldi r20, 0x47 ; 71 24986: 5a e3 ldi r21, 0x3A ; 58 24988: 6d e0 ldi r22, 0x0D ; 13 2498a: 7e e6 ldi r23, 0x6E ; 110 2498c: 80 91 e8 04 lds r24, 0x04E8 ; 0x8004e8 24990: 0e 94 b0 f9 call 0x1f360 ; 0x1f360 MENU_END(); 24994: 0f 94 dc ce call 0x39db8 ; 0x39db8 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 24998: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2499c: 8f 5f subi r24, 0xFF ; 255 2499e: 80 93 13 05 sts 0x0513, r24 ; 0x800513 249a2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 249a6: 8f 5f subi r24, 0xFF ; 255 249a8: 80 93 15 05 sts 0x0515, r24 ; 0x800515 249ac: c1 cf rjmp .-126 ; 0x24930 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(); } 249ae: 08 95 ret 000249b0 : 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); 249b0: 88 ee ldi r24, 0xE8 ; 232 249b2: 94 e0 ldi r25, 0x04 ; 4 249b4: 0f 94 51 1e call 0x23ca2 ; 0x23ca2 249b8: 60 91 e8 04 lds r22, 0x04E8 ; 0x8004e8 249bc: 80 e2 ldi r24, 0x20 ; 32 249be: 9c e0 ldi r25, 0x0C ; 12 249c0: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 000249c4 : 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); 249c4: 8a ee ldi r24, 0xEA ; 234 249c6: 94 e0 ldi r25, 0x04 ; 4 249c8: 0f 94 51 1e call 0x23ca2 ; 0x23ca2 249cc: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 249d0: 83 ea ldi r24, 0xA3 ; 163 249d2: 9d e0 ldi r25, 0x0D ; 13 249d4: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 000249d8 : 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); 249d8: 8b ee ldi r24, 0xEB ; 235 249da: 94 e0 ldi r25, 0x04 ; 4 249dc: 0f 94 51 1e call 0x23ca2 ; 0x23ca2 249e0: 60 91 eb 04 lds r22, 0x04EB ; 0x8004eb 249e4: 84 ea ldi r24, 0xA4 ; 164 249e6: 9d e0 ldi r25, 0x0D ; 13 249e8: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 000249ec : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 249ec: 8d ee ldi r24, 0xED ; 237 249ee: 94 e0 ldi r25, 0x04 ; 4 249f0: 0f 94 51 1e call 0x23ca2 ; 0x23ca2 249f4: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 249f8: 88 ea ldi r24, 0xA8 ; 168 249fa: 9d e0 ldi r25, 0x0D ; 13 249fc: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 00024a00 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 24a00: 80 91 8e 17 lds r24, 0x178E ; 0x80178e case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 24a04: 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) { 24a06: 81 11 cpse r24, r1 24a08: 01 c0 rjmp .+2 ; 0x24a0c case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 24a0a: 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; 24a0c: 60 93 8e 17 sts 0x178E, r22 ; 0x80178e 24a10: 87 e4 ldi r24, 0x47 ; 71 24a12: 9d e0 ldi r25, 0x0D ; 13 24a14: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 00024a18 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 24a18: cf 93 push r28 24a1a: df 93 push r29 MENU_BEGIN(); 24a1c: 0f 94 08 cf call 0x39e10 ; 0x39e10 24a20: 10 92 13 05 sts 0x0513, r1 ; 0x800513 24a24: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24a28: 84 30 cpi r24, 0x04 ; 4 24a2a: 08 f0 brcs .+2 ; 0x24a2e 24a2c: 96 c0 rjmp .+300 ; 0x24b5a 24a2e: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_BACK)); 24a32: 89 e1 ldi r24, 0x19 ; 25 24a34: 90 e4 ldi r25, 0x40 ; 64 24a36: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24a3a: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 24a3e: 80 91 86 17 lds r24, 0x1786 ; 0x801786 24a42: 88 23 and r24, r24 24a44: f1 f1 breq .+124 ; 0x24ac2 24a46: 88 e4 ldi r24, 0x48 ; 72 24a48: 9d e5 ldi r25, 0x5D ; 93 24a4a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24a4e: ec 01 movw r28, r24 24a50: 88 ec ldi r24, 0xC8 ; 200 24a52: 9c e3 ldi r25, 0x3C ; 60 24a54: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24a58: 22 e0 ldi r18, 0x02 ; 2 24a5a: 45 e3 ldi r20, 0x35 ; 53 24a5c: 5b e3 ldi r21, 0x3B ; 59 24a5e: be 01 movw r22, r28 24a60: 0f 94 97 d0 call 0x3a12e ; 0x3a12e 24a64: 80 91 86 17 lds r24, 0x1786 ; 0x801786 if (fsensor.isEnabled()) { 24a68: 88 23 and r24, r24 24a6a: 09 f4 brne .+2 ; 0x24a6e 24a6c: 66 c0 rjmp .+204 ; 0x24b3a if (fsensor.isError()) { 24a6e: 83 30 cpi r24, 0x03 ; 3 24a70: 59 f5 brne .+86 ; 0x24ac8 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 24a72: 87 e0 ldi r24, 0x07 ; 7 24a74: 9d e3 ldi r25, 0x3D ; 61 24a76: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24a7a: ec 01 movw r28, r24 24a7c: 83 ee ldi r24, 0xE3 ; 227 24a7e: 96 e5 ldi r25, 0x56 ; 86 24a80: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24a84: 22 e0 ldi r18, 0x02 ; 2 24a86: 4d eb ldi r20, 0xBD ; 189 24a88: 59 e3 ldi r21, 0x39 ; 57 24a8a: be 01 movw r22, r28 24a8c: 0f 94 97 d0 call 0x3a12e ; 0x3a12e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 24a90: 87 e0 ldi r24, 0x07 ; 7 24a92: 9d e3 ldi r25, 0x3D ; 61 24a94: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24a98: ec 01 movw r28, r24 24a9a: 85 ed ldi r24, 0xD5 ; 213 24a9c: 96 e5 ldi r25, 0x56 ; 86 24a9e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24aa2: 22 e0 ldi r18, 0x02 ; 2 24aa4: 4d eb ldi r20, 0xBD ; 189 24aa6: 59 e3 ldi r21, 0x39 ; 57 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); 24aa8: be 01 movw r22, r28 24aaa: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #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()) { 24aae: 80 91 8e 17 lds r24, 0x178E ; 0x80178e 24ab2: 88 23 and r24, r24 24ab4: 99 f1 breq .+102 ; 0x24b1c 24ab6: 81 30 cpi r24, 0x01 ; 1 24ab8: 09 f4 brne .+2 ; 0x24abc 24aba: 4c c0 rjmp .+152 ; 0x24b54 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(); 24abc: 0f 94 00 25 call 0x24a00 ; 0x24a00 24ac0: 3c c0 rjmp .+120 ; 0x24b3a 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); 24ac2: 82 e4 ldi r24, 0x42 ; 66 24ac4: 9d e5 ldi r25, 0x5D ; 93 24ac6: c1 cf rjmp .-126 ; 0x24a4a #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); 24ac8: 80 91 88 17 lds r24, 0x1788 ; 0x801788 24acc: 88 23 and r24, r24 24ace: 01 f1 breq .+64 ; 0x24b10 24ad0: 88 e4 ldi r24, 0x48 ; 72 24ad2: 9d e5 ldi r25, 0x5D ; 93 24ad4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24ad8: ec 01 movw r28, r24 24ada: 83 ee ldi r24, 0xE3 ; 227 24adc: 96 e5 ldi r25, 0x56 ; 86 24ade: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24ae2: 22 e0 ldi r18, 0x02 ; 2 24ae4: 4b e4 ldi r20, 0x4B ; 75 24ae6: 5b e3 ldi r21, 0x3B ; 59 24ae8: be 01 movw r22, r28 24aea: 0f 94 97 d0 call 0x3a12e ; 0x3a12e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24aee: 80 91 87 17 lds r24, 0x1787 ; 0x801787 24af2: 88 23 and r24, r24 24af4: 81 f0 breq .+32 ; 0x24b16 24af6: 88 e4 ldi r24, 0x48 ; 72 24af8: 9d e5 ldi r25, 0x5D ; 93 24afa: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24afe: ec 01 movw r28, r24 24b00: 85 ed ldi r24, 0xD5 ; 213 24b02: 96 e5 ldi r25, 0x56 ; 86 24b04: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24b08: 22 e0 ldi r18, 0x02 ; 2 24b0a: 43 e3 ldi r20, 0x33 ; 51 24b0c: 5a e3 ldi r21, 0x3A ; 58 24b0e: cc cf rjmp .-104 ; 0x24aa8 #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); 24b10: 82 e4 ldi r24, 0x42 ; 66 24b12: 9d e5 ldi r25, 0x5D ; 93 24b14: df cf rjmp .-66 ; 0x24ad4 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24b16: 82 e4 ldi r24, 0x42 ; 66 24b18: 9d e5 ldi r25, 0x5D ; 93 24b1a: ef cf rjmp .-34 ; 0x24afa #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); 24b1c: 8d ec ldi r24, 0xCD ; 205 24b1e: 96 e5 ldi r25, 0x56 ; 86 break; case Filament_sensor::SensorActionOnError::_Pause: MENU_ITEM_TOGGLE_P(_T(MSG_FS_ACTION), _T(MSG_PAUSE), lcd_fsensor_actionNA_set); 24b20: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24b24: ec 01 movw r28, r24 24b26: 81 ec ldi r24, 0xC1 ; 193 24b28: 96 e5 ldi r25, 0x56 ; 86 24b2a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24b2e: 22 e0 ldi r18, 0x02 ; 2 24b30: 47 e1 ldi r20, 0x17 ; 23 24b32: 5a e3 ldi r21, 0x3A ; 58 24b34: be 01 movw r22, r28 24b36: 0f 94 97 d0 call 0x3a12e ; 0x3a12e default: lcd_fsensor_actionNA_set(); } } MENU_END(); 24b3a: 0f 94 dc ce call 0x39db8 ; 0x39db8 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 24b3e: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24b42: 8f 5f subi r24, 0xFF ; 255 24b44: 80 93 13 05 sts 0x0513, r24 ; 0x800513 24b48: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24b4c: 8f 5f subi r24, 0xFF ; 255 24b4e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24b52: 68 cf rjmp .-304 ; 0x24a24 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); 24b54: 89 eb ldi r24, 0xB9 ; 185 24b56: 96 e5 ldi r25, 0x56 ; 86 24b58: e3 cf rjmp .-58 ; 0x24b20 lcd_fsensor_actionNA_set(); } } MENU_END(); } 24b5a: df 91 pop r29 24b5c: cf 91 pop r28 24b5e: 08 95 ret 00024b60 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 24b60: e6 e8 ldi r30, 0x86 ; 134 24b62: f7 e1 ldi r31, 0x17 ; 23 24b64: 61 81 ldd r22, Z+1 ; 0x01 24b66: 81 e0 ldi r24, 0x01 ; 1 24b68: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 24b6a: 61 83 std Z+1, r22 ; 0x01 24b6c: 87 e0 ldi r24, 0x07 ; 7 24b6e: 9f e0 ldi r25, 0x0F ; 15 24b70: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 00024b74 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 24b74: e6 e8 ldi r30, 0x86 ; 134 24b76: f7 e1 ldi r31, 0x17 ; 23 24b78: 62 81 ldd r22, Z+2 ; 0x02 24b7a: 81 e0 ldi r24, 0x01 ; 1 24b7c: 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; 24b7e: 62 83 std Z+2, r22 ; 0x02 24b80: 85 ed ldi r24, 0xD5 ; 213 24b82: 9e e0 ldi r25, 0x0E ; 14 24b84: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 00024b88 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 24b88: ed ed ldi r30, 0xDD ; 221 24b8a: f6 e1 ldi r31, 0x16 ; 22 24b8c: 60 81 ld r22, Z 24b8e: 81 e0 ldi r24, 0x01 ; 1 24b90: 68 27 eor r22, r24 24b92: 60 83 st Z, r22 24b94: 8b eb ldi r24, 0xBB ; 187 24b96: 9f e0 ldi r25, 0x0F ; 15 24b98: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 00024b9c : 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; 24b9c: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 24ba0: 81 30 cpi r24, 0x01 ; 1 24ba2: 51 f4 brne .+20 ; 0x24bb8 24ba4: 10 92 1f 05 sts 0x051F, r1 ; 0x80051f 24ba8: 60 91 1f 05 lds r22, 0x051F ; 0x80051f 24bac: 88 e0 ldi r24, 0x08 ; 8 24bae: 9f e0 ldi r25, 0x0F ; 15 24bb0: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 24bb4: 0c 94 79 db jmp 0x1b6f2 ; 0x1b6f2 } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 24bb8: 81 e0 ldi r24, 0x01 ; 1 24bba: 80 93 1f 05 sts 0x051F, r24 ; 0x80051f 24bbe: f4 cf rjmp .-24 ; 0x24ba8 00024bc0 : 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); 24bc0: 8f ea ldi r24, 0xAF ; 175 24bc2: 9f e0 ldi r25, 0x0F ; 15 24bc4: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 temp_cal_active = !temp_cal_active; 24bc8: 61 e0 ldi r22, 0x01 ; 1 24bca: 81 11 cpse r24, r1 24bcc: 60 e0 ldi r22, 0x00 ; 0 24bce: 8f ea ldi r24, 0xAF ; 175 24bd0: 9f e0 ldi r25, 0x0F ; 15 24bd2: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 00024bd6 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 24bd6: 80 91 df 04 lds r24, 0x04DF ; 0x8004df 24bda: 81 30 cpi r24, 0x01 ; 1 24bdc: 71 f0 breq .+28 ; 0x24bfa 24bde: 20 f0 brcs .+8 ; 0x24be8 24be0: 82 30 cpi r24, 0x02 ; 2 24be2: 69 f4 brne .+26 ; 0x24bfe break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 24be4: 83 e0 ldi r24, 0x03 ; 3 24be6: 01 c0 rjmp .+2 ; 0x24bea void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 24be8: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 24bea: 80 93 df 04 sts 0x04DF, r24 ; 0x8004df 24bee: 60 91 df 04 lds r22, 0x04DF ; 0x8004df 24bf2: 87 ed ldi r24, 0xD7 ; 215 24bf4: 9e e0 ldi r25, 0x0E ; 14 24bf6: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 24bfa: 82 e0 ldi r24, 0x02 ; 2 24bfc: f6 cf rjmp .-20 ; 0x24bea break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 24bfe: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df 24c02: f5 cf rjmp .-22 ; 0x24bee 00024c04 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 24c04: 89 e0 ldi r24, 0x09 ; 9 24c06: 9f e0 ldi r25, 0x0F ; 15 24c08: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 24c0c: 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) { 24c0e: 88 23 and r24, r24 24c10: 21 f0 breq .+8 ; 0x24c1a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 24c12: 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) { 24c14: 81 30 cpi r24, 0x01 ; 1 24c16: 09 f0 breq .+2 ; 0x24c1a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 24c18: 60 e0 ldi r22, 0x00 ; 0 24c1a: 89 e0 ldi r24, 0x09 ; 9 24c1c: 9f e0 ldi r25, 0x0F ; 15 24c1e: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 24c22: 81 e0 ldi r24, 0x01 ; 1 24c24: 80 93 bb 14 sts 0x14BB, r24 ; 0x8014bb } 24c28: 08 95 ret 00024c2a : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 24c2a: ef 92 push r14 24c2c: ff 92 push r15 24c2e: 0f 93 push r16 24c30: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 24c32: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 24c36: 81 11 cpse r24, r1 24c38: 35 c0 rjmp .+106 ; 0x24ca4 { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 24c3a: 80 ec ldi r24, 0xC0 ; 192 24c3c: 9f e0 ldi r25, 0x0F ; 15 24c3e: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 24c42: 81 30 cpi r24, 0x01 ; 1 24c44: 61 f5 brne .+88 ; 0x24c9e { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 24c46: 8f eb ldi r24, 0xBF ; 191 24c48: 9f e0 ldi r25, 0x0F ; 15 24c4a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 24c4e: 08 2e mov r0, r24 24c50: 00 0c add r0, r0 24c52: 99 0b sbc r25, r25 24c54: 90 93 b6 03 sts 0x03B6, r25 ; 0x8003b6 24c58: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 24c5c: 8e eb ldi r24, 0xBE ; 190 24c5e: 9f e0 ldi r25, 0x0F ; 15 24c60: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 24c64: 08 2e mov r0, r24 24c66: 00 0c add r0, r0 24c68: 99 0b sbc r25, r25 24c6a: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 24c6e: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 24c72: 8d eb ldi r24, 0xBD ; 189 24c74: 9f e0 ldi r25, 0x0F ; 15 24c76: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 24c7a: 08 2e mov r0, r24 24c7c: 00 0c add r0, r0 24c7e: 99 0b sbc r25, r25 24c80: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 24c84: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 24c88: 8c eb ldi r24, 0xBC ; 188 24c8a: 9f e0 ldi r25, 0x0F ; 15 24c8c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 24c90: 08 2e mov r0, r24 24c92: 00 0c add r0, r0 24c94: 99 0b sbc r25, r25 24c96: 90 93 bc 03 sts 0x03BC, r25 ; 0x8003bc 24c9a: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb } _md->status = 1; 24c9e: 81 e0 ldi r24, 0x01 ; 1 24ca0: 80 93 b4 03 sts 0x03B4, r24 ; 0x8003b4 } MENU_BEGIN(); 24ca4: 0f 94 08 cf call 0x39e10 ; 0x39e10 24ca8: 10 92 13 05 sts 0x0513, r1 ; 0x800513 24cac: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24cb0: 84 30 cpi r24, 0x04 ; 4 24cb2: 08 f0 brcs .+2 ; 0x24cb6 24cb4: 6e c0 rjmp .+220 ; 0x24d92 24cb6: 10 92 16 05 sts 0x0516, r1 ; 0x800516 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 24cba: 0f 94 88 cd call 0x39b10 ; 0x39b10 24cbe: 88 23 and r24, r24 24cc0: e9 f0 breq .+58 ; 0x24cfc 24cc2: 60 91 b5 03 lds r22, 0x03B5 ; 0x8003b5 24cc6: 8f eb ldi r24, 0xBF ; 191 24cc8: 9f e0 ldi r25, 0x0F ; 15 24cca: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 24cce: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 24cd2: 8d eb ldi r24, 0xBD ; 189 24cd4: 9f e0 ldi r25, 0x0F ; 15 24cd6: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 24cda: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 24cde: 8c eb ldi r24, 0xBC ; 188 24ce0: 9f e0 ldi r25, 0x0F ; 15 24ce2: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 24ce6: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 24cea: 8e eb ldi r24, 0xBE ; 190 24cec: 9f e0 ldi r25, 0x0F ; 15 24cee: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 24cf2: 61 e0 ldi r22, 0x01 ; 1 24cf4: 80 ec ldi r24, 0xC0 ; 192 24cf6: 9f e0 ldi r25, 0x0F ; 15 24cf8: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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)); 24cfc: 89 e1 ldi r24, 0x19 ; 25 24cfe: 90 e4 ldi r25, 0x40 ; 64 24d00: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24d04: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d08: 87 e4 ldi r24, 0x47 ; 71 24d0a: 9d e4 ldi r25, 0x4D ; 77 24d0c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24d10: f1 2c mov r15, r1 24d12: e1 2c mov r14, r1 24d14: 04 e6 ldi r16, 0x64 ; 100 24d16: 10 e0 ldi r17, 0x00 ; 0 24d18: 2c e9 ldi r18, 0x9C ; 156 24d1a: 3f ef ldi r19, 0xFF ; 255 24d1c: 40 e1 ldi r20, 0x10 ; 16 24d1e: 65 eb ldi r22, 0xB5 ; 181 24d20: 73 e0 ldi r23, 0x03 ; 3 24d22: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d26: 86 e3 ldi r24, 0x36 ; 54 24d28: 9d e4 ldi r25, 0x4D ; 77 24d2a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24d2e: 2c e9 ldi r18, 0x9C ; 156 24d30: 3f ef ldi r19, 0xFF ; 255 24d32: 40 e1 ldi r20, 0x10 ; 16 24d34: 67 eb ldi r22, 0xB7 ; 183 24d36: 73 e0 ldi r23, 0x03 ; 3 24d38: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d3c: 85 e2 ldi r24, 0x25 ; 37 24d3e: 9d e4 ldi r25, 0x4D ; 77 24d40: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24d44: 2c e9 ldi r18, 0x9C ; 156 24d46: 3f ef ldi r19, 0xFF ; 255 24d48: 40 e1 ldi r20, 0x10 ; 16 24d4a: 69 eb ldi r22, 0xB9 ; 185 24d4c: 73 e0 ldi r23, 0x03 ; 3 24d4e: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d52: 84 e1 ldi r24, 0x14 ; 20 24d54: 9d e4 ldi r25, 0x4D ; 77 24d56: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24d5a: 2c e9 ldi r18, 0x9C ; 156 24d5c: 3f ef ldi r19, 0xFF ; 255 24d5e: 40 e1 ldi r20, 0x10 ; 16 24d60: 6b eb ldi r22, 0xBB ; 187 24d62: 73 e0 ldi r23, 0x03 ; 3 24d64: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 24d68: 80 e1 ldi r24, 0x10 ; 16 24d6a: 9b e3 ldi r25, 0x3B ; 59 24d6c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24d70: 6d ec ldi r22, 0xCD ; 205 24d72: 79 e3 ldi r23, 0x39 ; 57 24d74: 0f 94 85 ce call 0x39d0a ; 0x39d0a MENU_END(); 24d78: 0f 94 dc ce call 0x39db8 ; 0x39db8 _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(); 24d7c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 24d80: 8f 5f subi r24, 0xFF ; 255 24d82: 80 93 13 05 sts 0x0513, r24 ; 0x800513 24d86: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24d8a: 8f 5f subi r24, 0xFF ; 255 24d8c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24d90: 8d cf rjmp .-230 ; 0x24cac 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(); } 24d92: 1f 91 pop r17 24d94: 0f 91 pop r16 24d96: ff 90 pop r15 24d98: ef 90 pop r14 24d9a: 08 95 ret 00024d9c : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 24d9c: 8e ec ldi r24, 0xCE ; 206 24d9e: 9e e0 ldi r25, 0x0E ; 14 24da0: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 24da4: 60 e0 ldi r22, 0x00 ; 0 24da6: 81 30 cpi r24, 0x01 ; 1 24da8: 09 f0 breq .+2 ; 0x24dac 24daa: 61 e0 ldi r22, 0x01 ; 1 24dac: 8e ec ldi r24, 0xCE ; 206 24dae: 9e e0 ldi r25, 0x0E ; 14 24db0: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 00024db4 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 24db4: 60 91 38 02 lds r22, 0x0238 ; 0x800238 24db8: 81 e0 ldi r24, 0x01 ; 1 24dba: 68 27 eor r22, r24 24dbc: 60 93 38 02 sts 0x0238, r22 ; 0x800238 24dc0: 87 e8 ldi r24, 0x87 ; 135 24dc2: 9f e0 ldi r25, 0x0F ; 15 24dc4: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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. 24dc8: 80 91 38 02 lds r24, 0x0238 ; 0x800238 24dcc: 81 11 cpse r24, r1 24dce: 02 c0 rjmp .+4 ; 0x24dd4 24dd0: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 #endif //FANCHECK } 24dd4: 08 95 ret 00024dd6 : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 24dd6: 86 ed ldi r24, 0xD6 ; 214 24dd8: 9e e0 ldi r25, 0x0E ; 14 24dda: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 24dde: 61 e0 ldi r22, 0x01 ; 1 24de0: 82 30 cpi r24, 0x02 ; 2 24de2: 09 f0 breq .+2 ; 0x24de6 24de4: 62 e0 ldi r22, 0x02 ; 2 24de6: 86 ed ldi r24, 0xD6 ; 214 24de8: 9e e0 ldi r25, 0x0E ; 14 24dea: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 00024dee : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 24dee: cf 93 push r28 24df0: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 24df2: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 24df6: 8c 33 cpi r24, 0x3C ; 60 24df8: e1 f0 breq .+56 ; 0x24e32 24dfa: 80 35 cpi r24, 0x50 ; 80 24dfc: 01 f1 breq .+64 ; 0x24e3e 24dfe: 88 32 cpi r24, 0x28 ; 40 24e00: 91 f0 breq .+36 ; 0x24e26 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 24e02: 88 e2 ldi r24, 0x28 ; 40 24e04: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec nDiameter=400; 24e08: c0 e9 ldi r28, 0x90 ; 144 24e0a: d1 e0 ldi r29, 0x01 ; 1 24e0c: 60 91 ec 04 lds r22, 0x04EC ; 0x8004ec 24e10: 87 ea ldi r24, 0xA7 ; 167 24e12: 9d e0 ldi r25, 0x0D ; 13 24e14: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 24e18: be 01 movw r22, r28 24e1a: 85 ea ldi r24, 0xA5 ; 165 24e1c: 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); } 24e1e: df 91 pop r29 24e20: cf 91 pop r28 24e22: 0d 94 cb dd jmp 0x3bb96 ; 0x3bb96 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 24e26: 8c e3 ldi r24, 0x3C ; 60 24e28: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec nDiameter=600; 24e2c: c8 e5 ldi r28, 0x58 ; 88 24e2e: d2 e0 ldi r29, 0x02 ; 2 24e30: ed cf rjmp .-38 ; 0x24e0c break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 24e32: 80 e5 ldi r24, 0x50 ; 80 24e34: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec nDiameter=800; 24e38: c0 e2 ldi r28, 0x20 ; 32 24e3a: d3 e0 ldi r29, 0x03 ; 3 24e3c: e7 cf rjmp .-50 ; 0x24e0c break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 24e3e: 89 e1 ldi r24, 0x19 ; 25 24e40: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec nDiameter=250; 24e44: ca ef ldi r28, 0xFA ; 250 24e46: d0 e0 ldi r29, 0x00 ; 0 24e48: e1 cf rjmp .-62 ; 0x24e0c 00024e4a : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 24e4a: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 24e4e: 88 e0 ldi r24, 0x08 ; 8 24e50: 9e e4 ldi r25, 0x4E ; 78 24e52: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24e56: 0e 94 78 6f call 0xdef0 ; 0xdef0 menu_back_if_clicked(); 24e5a: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00024e5e : } static void lcd_crash_mode_info2() { lcd_home(); 24e5e: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 24e62: 8f e3 ldi r24, 0x3F ; 63 24e64: 9e e4 ldi r25, 0x4E ; 78 24e66: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24e6a: 0e 94 78 6f call 0xdef0 ; 0xdef0 menu_back_if_clicked(); 24e6e: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00024e72 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 24e72: 81 30 cpi r24, 0x01 ; 1 24e74: 21 f4 brne .+8 ; 0x24e7e case STATE_ON: lcd_puts_P(_N(" 1")); 24e76: 8b e1 ldi r24, 0x1B ; 27 24e78: 90 e7 ldi r25, 0x70 ; 112 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 24e7a: 0c 94 78 6f jmp 0xdef0 ; 0xdef0 24e7e: 87 e1 ldi r24, 0x17 ; 23 24e80: 90 e7 ldi r25, 0x70 ; 112 24e82: fb cf rjmp .-10 ; 0x24e7a 00024e84 : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 24e84: 81 e0 ldi r24, 0x01 ; 1 24e86: 90 91 86 17 lds r25, 0x1786 ; 0x801786 24e8a: 91 11 cpse r25, r1 24e8c: 80 e0 ldi r24, 0x00 ; 0 24e8e: 0c 94 ac 75 jmp 0xeb58 ; 0xeb58 00024e92 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 24e92: 0d 94 6c 87 jmp 0x30ed8 ; 0x30ed8 00024e96 : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 24e96: 0e 94 39 70 call 0xe072 ; 0xe072 lcd_status_message_idx = 0; // Re-draw message from beginning 24e9a: 10 92 37 05 sts 0x0537, r1 ; 0x800537 <_ZL22lcd_status_message_idx.lto_priv.464> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 24e9e: 20 e0 ldi r18, 0x00 ; 0 24ea0: 41 e0 ldi r20, 0x01 ; 1 24ea2: 70 e0 ldi r23, 0x00 ; 0 24ea4: 60 e0 ldi r22, 0x00 ; 0 24ea6: 8b e3 ldi r24, 0x3B ; 59 24ea8: 9a e3 ldi r25, 0x3A ; 58 24eaa: 0f 94 32 cf call 0x39e64 ; 0x39e64 menu_depth = 0; 24eae: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 24eb2: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 } 24eb6: 08 95 ret 00024eb8 : } } #if (LANG_MODE != 0) void lcd_language() { 24eb8: cf 93 push r28 24eba: df 93 push r29 lcd_update_enable(true); 24ebc: 81 e0 ldi r24, 0x01 ; 1 24ebe: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 menu_goto(lcd_language_menu, 0, true, true); 24ec2: 21 e0 ldi r18, 0x01 ; 1 24ec4: 41 e0 ldi r20, 0x01 ; 1 24ec6: 70 e0 ldi r23, 0x00 ; 0 24ec8: 60 e0 ldi r22, 0x00 ; 0 24eca: 87 e2 ldi r24, 0x27 ; 39 24ecc: 9b e3 ldi r25, 0x3B ; 59 24ece: 0f 94 32 cf call 0x39e64 ; 0x39e64 24ed2: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 24ed6: c0 91 67 0e lds r28, 0x0E67 ; 0x800e67 24eda: d0 91 68 0e lds r29, 0x0E68 ; 0x800e68 24ede: 0e 94 ca 71 call 0xe394 ; 0xe394 24ee2: cb 53 subi r28, 0x3B ; 59 24ee4: da 43 sbci r29, 0x3A ; 58 24ee6: 39 f0 breq .+14 ; 0x24ef6 24ee8: 81 11 cpse r24, r1 24eea: 07 c0 rjmp .+14 ; 0x24efa { delay_keep_alive(50); 24eec: 82 e3 ldi r24, 0x32 ; 50 24eee: 90 e0 ldi r25, 0x00 ; 0 24ef0: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 24ef4: f0 cf rjmp .-32 ; 0x24ed6 } if (lang_is_selected()) 24ef6: 88 23 and r24, r24 24ef8: 21 f0 breq .+8 ; 0x24f02 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 24efa: df 91 pop r29 24efc: 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(); 24efe: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 else lang_select(LANG_ID_PRI); 24f02: 80 e0 ldi r24, 0x00 ; 0 } 24f04: df 91 pop r29 24f06: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 24f08: 0c 94 e1 72 jmp 0xe5c2 ; 0xe5c2 00024f0c : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 24f0c: 61 e0 ldi r22, 0x01 ; 1 24f0e: 8d e4 ldi r24, 0x4D ; 77 24f10: 94 ea ldi r25, 0xA4 ; 164 24f12: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_return_to_status(); 24f16: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 00024f1a : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 24f1a: 61 e0 ldi r22, 0x01 ; 1 24f1c: 87 e4 ldi r24, 0x47 ; 71 24f1e: 94 ea ldi r25, 0xA4 ; 164 24f20: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_return_to_status(); 24f24: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 00024f28 : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 24f28: 61 e0 ldi r22, 0x01 ; 1 24f2a: 83 e4 ldi r24, 0x43 ; 67 24f2c: 94 ea ldi r25, 0xA4 ; 164 24f2e: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_return_to_status(); 24f32: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 00024f36 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 24f36: 61 e0 ldi r22, 0x01 ; 1 24f38: 8f e3 ldi r24, 0x3F ; 63 24f3a: 94 ea ldi r25, 0xA4 ; 164 24f3c: 0e 94 43 89 call 0x11286 ; 0x11286 lcd_return_to_status(); 24f40: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 00024f44 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 24f44: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 24f48: 88 e5 ldi r24, 0x58 ; 88 24f4a: 9d e4 ldi r25, 0x4D ; 77 24f4c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 24f50: ac 01 movw r20, r24 24f52: 60 e0 ldi r22, 0x00 ; 0 24f54: 80 e0 ldi r24, 0x00 ; 0 24f56: 0e 94 a1 6f call 0xdf42 ; 0xdf42 pid_temp += lcd_encoder; 24f5a: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.457> 24f5e: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 24f62: 20 91 35 05 lds r18, 0x0535 ; 0x800535 24f66: 30 91 36 05 lds r19, 0x0536 ; 0x800536 24f6a: 82 0f add r24, r18 24f6c: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 24f6e: 82 33 cpi r24, 0x32 ; 50 24f70: 21 e0 ldi r18, 0x01 ; 1 24f72: 92 07 cpc r25, r18 24f74: 50 f1 brcs .+84 ; 0x24fca 24f76: 81 e3 ldi r24, 0x31 ; 49 24f78: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 24f7a: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 24f7e: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.457> lcd_encoder = 0; 24f82: 10 92 36 05 sts 0x0536, r1 ; 0x800536 24f86: 10 92 35 05 sts 0x0535, r1 ; 0x800535 lcd_set_cursor(1, 2); 24f8a: 62 e0 ldi r22, 0x02 ; 2 24f8c: 81 e0 ldi r24, 0x01 ; 1 24f8e: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%3u"), pid_temp); 24f92: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 24f96: 8f 93 push r24 24f98: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.457> 24f9c: 8f 93 push r24 24f9e: 87 ec ldi r24, 0xC7 ; 199 24fa0: 93 ea ldi r25, 0xA3 ; 163 24fa2: 9f 93 push r25 24fa4: 8f 93 push r24 24fa6: 0e 94 66 6f call 0xdecc ; 0xdecc if (lcd_clicked()) { 24faa: 0e 94 aa 71 call 0xe354 ; 0xe354 24fae: 0f 90 pop r0 24fb0: 0f 90 pop r0 24fb2: 0f 90 pop r0 24fb4: 0f 90 pop r0 24fb6: 88 23 and r24, r24 24fb8: 71 f0 breq .+28 ; 0x24fd6 lcd_commands_type = LcdCommands::PidExtruder; 24fba: 83 e0 ldi r24, 0x03 ; 3 24fbc: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 lcd_return_to_status(); 24fc0: 0f 94 4b 27 call 0x24e96 ; 0x24e96 lcd_update(2); 24fc4: 82 e0 ldi r24, 0x02 ; 2 24fc6: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 { 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; 24fca: 8a 30 cpi r24, 0x0A ; 10 24fcc: 91 05 cpc r25, r1 24fce: a8 f6 brcc .-86 ; 0x24f7a 24fd0: 8a e0 ldi r24, 0x0A ; 10 24fd2: 90 e0 ldi r25, 0x00 ; 0 24fd4: d2 cf rjmp .-92 ; 0x24f7a lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 24fd6: 08 95 ret 00024fd8 : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 24fd8: df 92 push r13 24fda: ef 92 push r14 24fdc: ff 92 push r15 24fde: 0f 93 push r16 24fe0: 1f 93 push r17 24fe2: cf 93 push r28 24fe4: df 93 push r29 24fe6: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 24fea: 0e 94 b9 6f call 0xdf72 ; 0xdf72 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] ); 24fee: cf ea ldi r28, 0xAF ; 175 24ff0: d4 e0 ldi r29, 0x04 ; 4 24ff2: 8a 81 ldd r24, Y+2 ; 0x02 24ff4: 9b 81 ldd r25, Y+3 ; 0x03 24ff6: 2c e3 ldi r18, 0x3C ; 60 24ff8: f2 2e mov r15, r18 24ffa: f8 9e mul r15, r24 24ffc: 80 01 movw r16, r0 24ffe: f9 9e mul r15, r25 25000: 10 0d add r17, r0 25002: 11 24 eor r1, r1 25004: 80 e5 ldi r24, 0x50 ; 80 25006: 9f e3 ldi r25, 0x3F ; 63 25008: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2500c: e8 2e mov r14, r24 2500e: d9 2e mov r13, r25 25010: 88 81 ld r24, Y 25012: 99 81 ldd r25, Y+1 ; 0x01 25014: f8 9e mul r15, r24 25016: e0 01 movw r28, r0 25018: f9 9e mul r15, r25 2501a: d0 0d add r29, r0 2501c: 11 24 eor r1, r1 2501e: 8d e5 ldi r24, 0x5D ; 93 25020: 9f e3 ldi r25, 0x3F ; 63 25022: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25026: 1f 93 push r17 25028: 0f 93 push r16 2502a: df 92 push r13 2502c: ef 92 push r14 2502e: df 93 push r29 25030: cf 93 push r28 25032: 9f 93 push r25 25034: 8f 93 push r24 25036: 8a ed ldi r24, 0xDA ; 218 25038: 90 ea ldi r25, 0xA0 ; 160 2503a: 9f 93 push r25 2503c: 8f 93 push r24 2503e: 0e 94 66 6f call 0xdecc ; 0xdecc menu_back_if_clicked(); 25042: 8d b7 in r24, 0x3d ; 61 25044: 9e b7 in r25, 0x3e ; 62 25046: 0a 96 adiw r24, 0x0a ; 10 25048: 0f b6 in r0, 0x3f ; 63 2504a: f8 94 cli 2504c: 9e bf out 0x3e, r25 ; 62 2504e: 0f be out 0x3f, r0 ; 63 25050: 8d bf out 0x3d, r24 ; 61 } 25052: df 91 pop r29 25054: cf 91 pop r28 25056: 1f 91 pop r17 25058: 0f 91 pop r16 2505a: ff 90 pop r15 2505c: ef 90 pop r14 2505e: 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(); 25060: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00025064 : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 25064: 0f 93 push r16 25066: 1f 93 push r17 25068: cf 93 push r28 2506a: df 93 push r29 lcd_home(); 2506c: 0e 94 b9 6f call 0xdf72 ; 0xdf72 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))); 25070: 8b e5 ldi r24, 0x5B ; 91 25072: 9f e0 ldi r25, 0x0F ; 15 25074: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 25078: 18 2f mov r17, r24 2507a: 09 2f mov r16, r25 2507c: 8d e5 ldi r24, 0x5D ; 93 2507e: 9f e0 ldi r25, 0x0F ; 15 25080: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 25084: ec 01 movw r28, r24 25086: 82 eb ldi r24, 0xB2 ; 178 25088: 9a e4 ldi r25, 0x4A ; 74 2508a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2508e: 0f 93 push r16 25090: 1f 93 push r17 25092: df 93 push r29 25094: cf 93 push r28 25096: 9f 93 push r25 25098: 8f 93 push r24 2509a: 88 eb ldi r24, 0xB8 ; 184 2509c: 91 ea ldi r25, 0xA1 ; 161 2509e: 9f 93 push r25 250a0: 8f 93 push r24 250a2: 0e 94 66 6f call 0xdecc ; 0xdecc menu_back_if_clicked(); 250a6: 8d b7 in r24, 0x3d ; 61 250a8: 9e b7 in r25, 0x3e ; 62 250aa: 08 96 adiw r24, 0x08 ; 8 250ac: 0f b6 in r0, 0x3f ; 63 250ae: f8 94 cli 250b0: 9e bf out 0x3e, r25 ; 62 250b2: 0f be out 0x3f, r0 ; 63 250b4: 8d bf out 0x3d, r24 ; 61 } 250b6: df 91 pop r29 250b8: cf 91 pop r28 250ba: 1f 91 pop r17 250bc: 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(); 250be: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 000250c2 : #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){ 250c2: cf 93 push r28 250c4: df 93 push r29 250c6: cd b7 in r28, 0x3d ; 61 250c8: de b7 in r29, 0x3e ; 62 250ca: 2f 97 sbiw r28, 0x0f ; 15 250cc: 0f b6 in r0, 0x3f ; 63 250ce: f8 94 cli 250d0: de bf out 0x3e, r29 ; 62 250d2: 0f be out 0x3f, r0 ; 63 250d4: cd bf out 0x3d, r28 ; 61 250d6: fc 01 movw r30, r24 250d8: de 01 movw r26, r28 250da: 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; 250dc: 90 e0 ldi r25, 0x00 ; 0 250de: 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); 250e0: 84 91 lpm r24, Z 250e2: 41 e0 ldi r20, 0x01 ; 1 250e4: 49 0f add r20, r25 if( ! b ) 250e6: 88 23 and r24, r24 250e8: 29 f0 breq .+10 ; 0x250f4 break; dst[i] = b; 250ea: 8d 93 st X+, r24 250ec: 31 96 adiw r30, 0x01 ; 1 250ee: 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 250f0: 4d 30 cpi r20, 0x0D ; 13 250f2: b1 f7 brne .-20 ; 0x250e0 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 250f4: f9 01 movw r30, r18 250f6: e9 0f add r30, r25 250f8: f1 1d adc r31, r1 250fa: 8a e3 ldi r24, 0x3A ; 58 250fc: 80 83 st Z, r24 ++i; 250fe: 9f 5f subi r25, 0xFF ; 255 25100: f9 01 movw r30, r18 25102: e9 0f add r30, r25 25104: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 25106: 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 25108: 9e 30 cpi r25, 0x0E ; 14 2510a: 19 f0 breq .+6 ; 0x25112 dst[i] = ' '; 2510c: 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 2510e: 9f 5f subi r25, 0xFF ; 255 25110: fb cf rjmp .-10 ; 0x25108 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 25112: 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 25114: 7f 93 push r23 25116: 6f 93 push r22 25118: 3f 93 push r19 2511a: 2f 93 push r18 2511c: 86 e7 ldi r24, 0x76 ; 118 2511e: 91 ea ldi r25, 0xA1 ; 161 25120: 9f 93 push r25 25122: 8f 93 push r24 25124: 0e 94 66 6f call 0xdecc ; 0xdecc 25128: 0f 90 pop r0 2512a: 0f 90 pop r0 2512c: 0f 90 pop r0 2512e: 0f 90 pop r0 25130: 0f 90 pop r0 25132: 0f 90 pop r0 } 25134: 2f 96 adiw r28, 0x0f ; 15 25136: 0f b6 in r0, 0x3f ; 63 25138: f8 94 cli 2513a: de bf out 0x3e, r29 ; 62 2513c: 0f be out 0x3f, r0 ; 63 2513e: cd bf out 0x3d, r28 ; 61 25140: df 91 pop r29 25142: cf 91 pop r28 25144: 08 95 ret 00025146 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 25146: cf 92 push r12 25148: df 92 push r13 2514a: ef 92 push r14 2514c: ff 92 push r15 2514e: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25152: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 25156: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 2515a: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 2515e: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 25162: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 25166: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 2516a: 6b 01 movw r12, r22 2516c: 81 e4 ldi r24, 0x41 ; 65 2516e: 97 e5 ldi r25, 0x57 ; 87 25170: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25174: b6 01 movw r22, r12 25176: 0f 94 61 28 call 0x250c2 ; 0x250c2 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 2517a: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 2517e: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 25182: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 25186: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 2518a: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 2518e: 6b 01 movw r12, r22 25190: 86 e2 ldi r24, 0x26 ; 38 25192: 97 e5 ldi r25, 0x57 ; 87 25194: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25198: b6 01 movw r22, r12 2519a: 0f 94 61 28 call 0x250c2 ; 0x250c2 #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 2519e: 60 91 51 06 lds r22, 0x0651 ; 0x800651 251a2: 70 91 52 06 lds r23, 0x0652 ; 0x800652 251a6: 80 91 53 06 lds r24, 0x0653 ; 0x800653 251aa: 90 91 54 06 lds r25, 0x0654 ; 0x800654 251ae: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 251b2: 6b 01 movw r12, r22 251b4: 8e e8 ldi r24, 0x8E ; 142 251b6: 9a e4 ldi r25, 0x4A ; 74 251b8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 251bc: b6 01 movw r22, r12 251be: 0f 94 61 28 call 0x250c2 ; 0x250c2 #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 251c2: 60 91 97 03 lds r22, 0x0397 ; 0x800397 251c6: 70 91 98 03 lds r23, 0x0398 ; 0x800398 251ca: 80 91 99 03 lds r24, 0x0399 ; 0x800399 251ce: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 251d2: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 251d6: 85 e2 ldi r24, 0x25 ; 37 251d8: 90 e7 ldi r25, 0x70 ; 112 251da: 0f 94 61 28 call 0x250c2 ; 0x250c2 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 251de: ff 90 pop r15 251e0: ef 90 pop r14 251e2: df 90 pop r13 251e4: 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(); 251e6: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 000251ea : //! | 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() { 251ea: af 92 push r10 251ec: bf 92 push r11 251ee: cf 92 push r12 251f0: df 92 push r13 251f2: ef 92 push r14 251f4: ff 92 push r15 251f6: 0f 93 push r16 251f8: 1f 93 push r17 251fa: cf 93 push r28 251fc: df 93 push r29 251fe: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 25202: 84 e6 ldi r24, 0x64 ; 100 25204: 9f e0 ldi r25, 0x0F ; 15 25206: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2520a: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 2520c: 85 e6 ldi r24, 0x65 ; 101 2520e: 9f e0 ldi r25, 0x0F ; 15 25210: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 25214: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 25216: 86 e6 ldi r24, 0x66 ; 102 25218: 9f e0 ldi r25, 0x0F ; 15 2521a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2521e: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 25220: 88 e6 ldi r24, 0x68 ; 104 25222: 9f e0 ldi r25, 0x0F ; 15 25224: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 25228: a8 2e mov r10, r24 lcd_home(); 2522a: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_printf_P(failStatsFmt, 2522e: 81 e7 ldi r24, 0x71 ; 113 25230: 9a e4 ldi r25, 0x4A ; 74 25232: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25236: d8 2e mov r13, r24 25238: c9 2e mov r12, r25 2523a: 82 e6 ldi r24, 0x62 ; 98 2523c: 9a e4 ldi r25, 0x4A ; 74 2523e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25242: 08 2f mov r16, r24 25244: f9 2e mov r15, r25 25246: 81 e5 ldi r24, 0x51 ; 81 25248: 9a e4 ldi r25, 0x4A ; 74 2524a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2524e: ec 01 movw r28, r24 25250: 8b e3 ldi r24, 0x3B ; 59 25252: 9a e4 ldi r25, 0x4A ; 74 25254: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25258: 1f 92 push r1 2525a: af 92 push r10 2525c: 1f 92 push r1 2525e: bf 92 push r11 25260: cf 92 push r12 25262: df 92 push r13 25264: 1f 92 push r1 25266: ef 92 push r14 25268: ff 92 push r15 2526a: 0f 93 push r16 2526c: 1f 92 push r1 2526e: 1f 93 push r17 25270: df 93 push r29 25272: cf 93 push r28 25274: 9f 93 push r25 25276: 8f 93 push r24 25278: 81 e4 ldi r24, 0x41 ; 65 2527a: 91 ea ldi r25, 0xA1 ; 161 2527c: 9f 93 push r25 2527e: 8f 93 push r24 25280: 0e 94 66 6f call 0xdecc ; 0xdecc _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 25284: 8d b7 in r24, 0x3d ; 61 25286: 9e b7 in r25, 0x3e ; 62 25288: 42 96 adiw r24, 0x12 ; 18 2528a: 0f b6 in r0, 0x3f ; 63 2528c: f8 94 cli 2528e: 9e bf out 0x3e, r25 ; 62 25290: 0f be out 0x3f, r0 ; 63 25292: 8d bf out 0x3d, r24 ; 61 } 25294: df 91 pop r29 25296: cf 91 pop r28 25298: 1f 91 pop r17 2529a: 0f 91 pop r16 2529c: ff 90 pop r15 2529e: ef 90 pop r14 252a0: df 90 pop r13 252a2: cf 90 pop r12 252a4: bf 90 pop r11 252a6: 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(); 252a8: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 000252ac : //! | 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() { 252ac: 6f 92 push r6 252ae: 7f 92 push r7 252b0: 8f 92 push r8 252b2: 9f 92 push r9 252b4: af 92 push r10 252b6: bf 92 push r11 252b8: cf 92 push r12 252ba: df 92 push r13 252bc: ef 92 push r14 252be: ff 92 push r15 252c0: 0f 93 push r16 252c2: 1f 93 push r17 252c4: cf 93 push r28 252c6: df 93 push r29 252c8: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 252cc: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_printf_P(failStatsFmt, 252d0: 83 e0 ldi r24, 0x03 ; 3 252d2: 9f e0 ldi r25, 0x0F ; 15 252d4: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 252d8: 0f 94 6d 1e call 0x23cda ; 0x23cda 252dc: 78 2e mov r7, r24 252de: 69 2e mov r6, r25 252e0: 85 e0 ldi r24, 0x05 ; 5 252e2: 9f e0 ldi r25, 0x0F ; 15 252e4: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 252e8: 0f 94 6d 1e call 0x23cda ; 0x23cda 252ec: 98 2e mov r9, r24 252ee: 89 2e mov r8, r25 252f0: 81 e7 ldi r24, 0x71 ; 113 252f2: 9a e4 ldi r25, 0x4A ; 74 252f4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 252f8: b8 2e mov r11, r24 252fa: a9 2e mov r10, r25 252fc: 81 e0 ldi r24, 0x01 ; 1 252fe: 9f e0 ldi r25, 0x0F ; 15 25300: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 25304: 0f 94 6d 1e call 0x23cda ; 0x23cda 25308: d8 2e mov r13, r24 2530a: c9 2e mov r12, r25 2530c: 82 e6 ldi r24, 0x62 ; 98 2530e: 9a e4 ldi r25, 0x4A ; 74 25310: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25314: f8 2e mov r15, r24 25316: e9 2e mov r14, r25 25318: 8f ef ldi r24, 0xFF ; 255 2531a: 9e e0 ldi r25, 0x0E ; 14 2531c: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 25320: 0f 94 6d 1e call 0x23cda ; 0x23cda 25324: 18 2f mov r17, r24 25326: 09 2f mov r16, r25 25328: 81 e5 ldi r24, 0x51 ; 81 2532a: 9a e4 ldi r25, 0x4A ; 74 2532c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25330: ec 01 movw r28, r24 25332: 8a e2 ldi r24, 0x2A ; 42 25334: 9a e4 ldi r25, 0x4A ; 74 25336: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2533a: 6f 92 push r6 2533c: 7f 92 push r7 2533e: 8f 92 push r8 25340: 9f 92 push r9 25342: af 92 push r10 25344: bf 92 push r11 25346: cf 92 push r12 25348: df 92 push r13 2534a: ef 92 push r14 2534c: ff 92 push r15 2534e: 0f 93 push r16 25350: 1f 93 push r17 25352: df 93 push r29 25354: cf 93 push r28 25356: 9f 93 push r25 25358: 8f 93 push r24 2535a: 81 e4 ldi r24, 0x41 ; 65 2535c: 91 ea ldi r25, 0xA1 ; 161 2535e: 9f 93 push r25 25360: 8f 93 push r24 25362: 0e 94 66 6f call 0xdecc ; 0xdecc _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(); 25366: 8d b7 in r24, 0x3d ; 61 25368: 9e b7 in r25, 0x3e ; 62 2536a: 42 96 adiw r24, 0x12 ; 18 2536c: 0f b6 in r0, 0x3f ; 63 2536e: f8 94 cli 25370: 9e bf out 0x3e, r25 ; 62 25372: 0f be out 0x3f, r0 ; 63 25374: 8d bf out 0x3d, r24 ; 61 } 25376: df 91 pop r29 25378: cf 91 pop r28 2537a: 1f 91 pop r17 2537c: 0f 91 pop r16 2537e: ff 90 pop r15 25380: ef 90 pop r14 25382: df 90 pop r13 25384: cf 90 pop r12 25386: bf 90 pop r11 25388: af 90 pop r10 2538a: 9f 90 pop r9 2538c: 8f 90 pop r8 2538e: 7f 90 pop r7 25390: 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(); 25392: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00025396 : //! | 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() { 25396: 8f 92 push r8 25398: 9f 92 push r9 2539a: af 92 push r10 2539c: bf 92 push r11 2539e: cf 92 push r12 253a0: df 92 push r13 253a2: ef 92 push r14 253a4: ff 92 push r15 253a6: 0f 93 push r16 253a8: 1f 93 push r17 253aa: cf 93 push r28 253ac: df 93 push r29 253ae: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 253b2: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_printf_P( 253b6: 80 91 9c 13 lds r24, 0x139C ; 0x80139c 253ba: 90 91 9d 13 lds r25, 0x139D ; 0x80139d 253be: 0f 94 6d 1e call 0x23cda ; 0x23cda 253c2: 98 2e mov r9, r24 253c4: 89 2e mov r8, r25 253c6: 85 e0 ldi r24, 0x05 ; 5 253c8: 9a e4 ldi r25, 0x4A ; 74 253ca: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 253ce: b8 2e mov r11, r24 253d0: a9 2e mov r10, r25 253d2: 80 ed ldi r24, 0xD0 ; 208 253d4: 9e e0 ldi r25, 0x0E ; 14 253d6: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 253da: 0f 94 6d 1e call 0x23cda ; 0x23cda 253de: d8 2e mov r13, r24 253e0: c9 2e mov r12, r25 253e2: 84 ef ldi r24, 0xF4 ; 244 253e4: 99 e4 ldi r25, 0x49 ; 73 253e6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 253ea: f8 2e mov r15, r24 253ec: e9 2e mov r14, r25 253ee: 83 ed ldi r24, 0xD3 ; 211 253f0: 9e e0 ldi r25, 0x0E ; 14 253f2: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 253f6: 0f 94 6d 1e call 0x23cda ; 0x23cda 253fa: 18 2f mov r17, r24 253fc: 09 2f mov r16, r25 253fe: 88 ee ldi r24, 0xE8 ; 232 25400: 99 e4 ldi r25, 0x49 ; 73 25402: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25406: ec 01 movw r28, r24 25408: 8a e2 ldi r24, 0x2A ; 42 2540a: 9a e4 ldi r25, 0x4A ; 74 2540c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25410: 8f 92 push r8 25412: 9f 92 push r9 25414: af 92 push r10 25416: bf 92 push r11 25418: cf 92 push r12 2541a: df 92 push r13 2541c: ef 92 push r14 2541e: ff 92 push r15 25420: 0f 93 push r16 25422: 1f 93 push r17 25424: df 93 push r29 25426: cf 93 push r28 25428: 9f 93 push r25 2542a: 8f 93 push r24 2542c: 84 e1 ldi r24, 0x14 ; 20 2542e: 91 ea ldi r25, 0xA1 ; 161 25430: 9f 93 push r25 25432: 8f 93 push r24 25434: 0e 94 66 6f call 0xdecc ; 0xdecc ), _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(); 25438: 8d b7 in r24, 0x3d ; 61 2543a: 9e b7 in r25, 0x3e ; 62 2543c: 40 96 adiw r24, 0x10 ; 16 2543e: 0f b6 in r0, 0x3f ; 63 25440: f8 94 cli 25442: 9e bf out 0x3e, r25 ; 62 25444: 0f be out 0x3f, r0 ; 63 25446: 8d bf out 0x3d, r24 ; 61 } 25448: df 91 pop r29 2544a: cf 91 pop r28 2544c: 1f 91 pop r17 2544e: 0f 91 pop r16 25450: ff 90 pop r15 25452: ef 90 pop r14 25454: df 90 pop r13 25456: cf 90 pop r12 25458: bf 90 pop r11 2545a: af 90 pop r10 2545c: 9f 90 pop r9 2545e: 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(); 25460: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00025464 : //! | 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() { 25464: cf 92 push r12 25466: df 92 push r13 25468: ef 92 push r14 2546a: ff 92 push r15 2546c: 0f 93 push r16 2546e: 1f 93 push r17 25470: cf 93 push r28 25472: df 93 push r29 25474: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25478: 0e 94 b9 6f call 0xdf72 ; 0xdf72 " %-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) )); 2547c: 8f ec ldi r24, 0xCF ; 207 2547e: 9e e0 ldi r25, 0x0E ; 14 25480: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 25484: 90 e0 ldi r25, 0x00 ; 0 25486: 0f 94 6d 1e call 0x23cda ; 0x23cda 2548a: d8 2e mov r13, r24 2548c: c9 2e mov r12, r25 2548e: 84 ef ldi r24, 0xF4 ; 244 25490: 99 e4 ldi r25, 0x49 ; 73 25492: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25496: f8 2e mov r15, r24 25498: 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) ), 2549a: 82 ed ldi r24, 0xD2 ; 210 2549c: 9e e0 ldi r25, 0x0E ; 14 2549e: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 254a2: 90 e0 ldi r25, 0x00 ; 0 254a4: 0f 94 6d 1e call 0x23cda ; 0x23cda 254a8: 18 2f mov r17, r24 254aa: 09 2f mov r16, r25 254ac: 88 ee ldi r24, 0xE8 ; 232 254ae: 99 e4 ldi r25, 0x49 ; 73 254b0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 254b4: ec 01 movw r28, r24 254b6: 8b e3 ldi r24, 0x3B ; 59 254b8: 9a e4 ldi r25, 0x4A ; 74 254ba: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 254be: cf 92 push r12 254c0: df 92 push r13 254c2: ef 92 push r14 254c4: ff 92 push r15 254c6: 0f 93 push r16 254c8: 1f 93 push r17 254ca: df 93 push r29 254cc: cf 93 push r28 254ce: 9f 93 push r25 254d0: 8f 93 push r24 254d2: 85 ef ldi r24, 0xF5 ; 245 254d4: 90 ea ldi r25, 0xA0 ; 160 254d6: 9f 93 push r25 254d8: 8f 93 push r24 254da: 0e 94 66 6f call 0xdecc ; 0xdecc " %-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(); 254de: 8d b7 in r24, 0x3d ; 61 254e0: 9e b7 in r25, 0x3e ; 62 254e2: 0c 96 adiw r24, 0x0c ; 12 254e4: 0f b6 in r0, 0x3f ; 63 254e6: f8 94 cli 254e8: 9e bf out 0x3e, r25 ; 62 254ea: 0f be out 0x3f, r0 ; 63 254ec: 8d bf out 0x3d, r24 ; 61 } 254ee: df 91 pop r29 254f0: cf 91 pop r28 254f2: 1f 91 pop r17 254f4: 0f 91 pop r16 254f6: ff 90 pop r15 254f8: ef 90 pop r14 254fa: df 90 pop r13 254fc: 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(); 254fe: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00025502 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 25502: af 92 push r10 25504: bf 92 push r11 25506: cf 92 push r12 25508: df 92 push r13 2550a: ef 92 push r14 2550c: ff 92 push r15 2550e: 0f 93 push r16 25510: 1f 93 push r17 25512: cf 93 push r28 25514: df 93 push r29 25516: 00 d0 rcall .+0 ; 0x25518 25518: 00 d0 rcall .+0 ; 0x2551a 2551a: 1f 92 push r1 2551c: cd b7 in r28, 0x3d ; 61 2551e: 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)) || 25520: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 25524: 81 11 cpse r24, r1 25526: 18 c0 rjmp .+48 ; 0x25558 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))) || 25528: 81 ea ldi r24, 0xA1 ; 161 2552a: 9d e0 ldi r25, 0x0D ; 13 2552c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 25530: 18 2f mov r17, r24 25532: 0e 94 c4 77 call 0xef88 ; 0xef88 25536: 88 23 and r24, r24 25538: 79 f0 breq .+30 ; 0x25558 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 2553a: 80 e1 ldi r24, 0x10 ; 16 2553c: 0e 94 43 f9 call 0x1f286 ; 0x1f286 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))) || 25540: 88 23 and r24, r24 25542: 51 f0 breq .+20 ; 0x25558 (!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))))) 25544: 2b e0 ldi r18, 0x0B ; 11 25546: 12 9f mul r17, r18 25548: c0 01 movw r24, r0 2554a: 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 2554c: 80 5b subi r24, 0xB0 ; 176 2554e: 92 4f sbci r25, 0xF2 ; 242 25550: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e } 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)) || 25554: 89 2b or r24, r25 25556: f1 f4 brne .+60 ; 0x25594 (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) 25558: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2555c: 88 23 and r24, r24 2555e: 71 f0 breq .+28 ; 0x2557c { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 25560: 81 ea ldi r24, 0xA1 ; 161 25562: 9d e0 ldi r25, 0x0D ; 13 25564: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 25568: 2b e0 ldi r18, 0x0B ; 11 2556a: 82 9f mul r24, r18 2556c: c0 01 movw r24, r0 2556e: 11 24 eor r1, r1 25570: 6f ef ldi r22, 0xFF ; 255 25572: 7f ef ldi r23, 0xFF ; 255 25574: 80 5b subi r24, 0xB0 ; 176 25576: 92 4f sbci r25, 0xF2 ; 242 25578: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 } // 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()); 2557c: 0e 94 aa 71 call 0xe354 ; 0xe354 25580: 21 e0 ldi r18, 0x01 ; 1 25582: 81 11 cpse r24, r1 25584: 20 e0 ldi r18, 0x00 ; 0 25586: 41 e0 ldi r20, 0x01 ; 1 25588: 70 e0 ldi r23, 0x00 ; 0 2558a: 60 e0 ldi r22, 0x00 ; 0 2558c: 8b e9 ldi r24, 0x9B ; 155 2558e: 99 e3 ldi r25, 0x39 ; 57 25590: 0f 94 32 cf call 0x39e64 ; 0x39e64 } if (lcd_encoder) { 25594: 20 91 35 05 lds r18, 0x0535 ; 0x800535 25598: 30 91 36 05 lds r19, 0x0536 ; 0x800536 2559c: 21 15 cp r18, r1 2559e: 31 05 cpc r19, r1 255a0: 59 f0 breq .+22 ; 0x255b8 menuData->reset = lcd_encoder > 0; 255a2: 81 e0 ldi r24, 0x01 ; 1 255a4: 12 16 cp r1, r18 255a6: 13 06 cpc r1, r19 255a8: 0c f0 brlt .+2 ; 0x255ac 255aa: 80 e0 ldi r24, 0x00 ; 0 255ac: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 lcd_encoder = 0; // Reset 255b0: 10 92 36 05 sts 0x0536, r1 ; 0x800536 255b4: 10 92 35 05 sts 0x0535, r1 ; 0x800535 } 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)); 255b8: 81 ea ldi r24, 0xA1 ; 161 255ba: 9d e0 ldi r25, 0x0D ; 13 255bc: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 255c0: 1b e0 ldi r17, 0x0B ; 11 255c2: 81 9f mul r24, r17 255c4: b0 01 movw r22, r0 255c6: 11 24 eor r1, r1 255c8: 67 5b subi r22, 0xB7 ; 183 255ca: 72 4f sbci r23, 0xF2 ; 242 255cc: 47 e0 ldi r20, 0x07 ; 7 255ce: 50 e0 ldi r21, 0x00 ; 0 255d0: ce 01 movw r24, r28 255d2: 01 96 adiw r24, 0x01 ; 1 255d4: 7c 01 movw r14, r24 255d6: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 lcd_home(); 255da: 0e 94 b9 6f call 0xdf72 ; 0xdf72 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]; 255de: 81 ea ldi r24, 0xA1 ; 161 255e0: 9d e0 ldi r25, 0x0D ; 13 255e2: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 255e6: 81 9f mul r24, r17 255e8: c0 01 movw r24, r0 255ea: 11 24 eor r1, r1 255ec: 80 5b subi r24, 0xB0 ; 176 255ee: 92 4f sbci r25, 0xF2 ; 242 255f0: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 255f4: bc 01 movw r22, r24 255f6: 99 0f add r25, r25 255f8: 88 0b sbc r24, r24 255fa: 99 0b sbc r25, r25 255fc: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 25600: 20 91 78 06 lds r18, 0x0678 ; 0x800678 25604: 30 91 79 06 lds r19, 0x0679 ; 0x800679 25608: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 2560c: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 25610: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 25614: d6 2e mov r13, r22 25616: c7 2e mov r12, r23 25618: b8 2e mov r11, r24 2561a: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 2561c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 25620: 0e e3 ldi r16, 0x3E ; 62 25622: 10 e2 ldi r17, 0x20 ; 32 25624: 81 11 cpse r24, r1 25626: 02 c0 rjmp .+4 ; 0x2562c 25628: 00 e2 ldi r16, 0x20 ; 32 2562a: 1e e3 ldi r17, 0x3E ; 62 2562c: 8b eb ldi r24, 0xBB ; 187 2562e: 9e e4 ldi r25, 0x4E ; 78 25630: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25634: 1f 92 push r1 25636: 0f 93 push r16 25638: 1f 92 push r1 2563a: 1f 93 push r17 2563c: af 92 push r10 2563e: bf 92 push r11 25640: cf 92 push r12 25642: df 92 push r13 25644: ff 92 push r15 25646: ef 92 push r14 25648: 9f 93 push r25 2564a: 8f 93 push r24 2564c: 0e 94 66 6f call 0xdecc ; 0xdecc 25650: 0f b6 in r0, 0x3f ; 63 25652: f8 94 cli 25654: de bf out 0x3e, r29 ; 62 25656: 0f be out 0x3f, r0 ; 63 25658: 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. } 2565a: 27 96 adiw r28, 0x07 ; 7 2565c: 0f b6 in r0, 0x3f ; 63 2565e: f8 94 cli 25660: de bf out 0x3e, r29 ; 62 25662: 0f be out 0x3f, r0 ; 63 25664: cd bf out 0x3d, r28 ; 61 25666: df 91 pop r29 25668: cf 91 pop r28 2566a: 1f 91 pop r17 2566c: 0f 91 pop r16 2566e: ff 90 pop r15 25670: ef 90 pop r14 25672: df 90 pop r13 25674: cf 90 pop r12 25676: bf 90 pop r11 25678: af 90 pop r10 2567a: 08 95 ret 0002567c : //! |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() { 2567c: 2f 92 push r2 2567e: 3f 92 push r3 25680: 4f 92 push r4 25682: 5f 92 push r5 25684: 6f 92 push r6 25686: 7f 92 push r7 25688: 8f 92 push r8 2568a: 9f 92 push r9 2568c: af 92 push r10 2568e: bf 92 push r11 25690: cf 92 push r12 25692: df 92 push r13 25694: ef 92 push r14 25696: ff 92 push r15 25698: 0f 93 push r16 2569a: 1f 93 push r17 2569c: cf 93 push r28 2569e: df 93 push r29 256a0: cd b7 in r28, 0x3d ; 61 256a2: de b7 in r29, 0x3e ; 62 256a4: a8 97 sbiw r28, 0x28 ; 40 256a6: 0f b6 in r0, 0x3f ; 63 256a8: f8 94 cli 256aa: de bf out 0x3e, r29 ; 62 256ac: 0f be out 0x3f, r0 ; 63 256ae: cd bf out 0x3d, r28 ; 61 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); 256b0: 48 e0 ldi r20, 0x08 ; 8 256b2: 50 e0 ldi r21, 0x00 ; 0 256b4: 65 ee ldi r22, 0xE5 ; 229 256b6: 7f e0 ldi r23, 0x0F ; 15 256b8: ce 01 movw r24, r28 256ba: 41 96 adiw r24, 0x11 ; 17 256bc: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 256c0: 48 e0 ldi r20, 0x08 ; 8 256c2: 50 e0 ldi r21, 0x00 ; 0 256c4: 6d ed ldi r22, 0xDD ; 221 256c6: 7f e0 ldi r23, 0x0F ; 15 256c8: ce 01 movw r24, r28 256ca: 09 96 adiw r24, 0x09 ; 9 256cc: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 256d0: 48 e0 ldi r20, 0x08 ; 8 256d2: 50 e0 ldi r21, 0x00 ; 0 256d4: 65 ed ldi r22, 0xD5 ; 213 256d6: 7f e0 ldi r23, 0x0F ; 15 256d8: ce 01 movw r24, r28 256da: 01 96 adiw r24, 0x01 ; 1 256dc: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 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]; 256e0: 8d 84 ldd r8, Y+13 ; 0x0d 256e2: 9e 84 ldd r9, Y+14 ; 0x0e 256e4: af 84 ldd r10, Y+15 ; 0x0f 256e6: b8 88 ldd r11, Y+16 ; 0x10 256e8: e6 e1 ldi r30, 0x16 ; 22 256ea: f2 e9 ldi r31, 0x92 ; 146 256ec: 25 91 lpm r18, Z+ 256ee: 35 91 lpm r19, Z+ 256f0: 45 91 lpm r20, Z+ 256f2: 54 91 lpm r21, Z 256f4: cd 80 ldd r12, Y+5 ; 0x05 256f6: de 80 ldd r13, Y+6 ; 0x06 256f8: ef 80 ldd r14, Y+7 ; 0x07 256fa: f8 84 ldd r15, Y+8 ; 0x08 256fc: ea e1 ldi r30, 0x1A ; 26 256fe: f2 e9 ldi r31, 0x92 ; 146 25700: 85 91 lpm r24, Z+ 25702: 95 91 lpm r25, Z+ 25704: a5 91 lpm r26, Z+ 25706: b4 91 lpm r27, Z 25708: 8d a3 std Y+37, r24 ; 0x25 2570a: 9e a3 std Y+38, r25 ; 0x26 2570c: af a3 std Y+39, r26 ; 0x27 2570e: b8 a7 std Y+40, r27 ; 0x28 25710: 8d 89 ldd r24, Y+21 ; 0x15 25712: 9e 89 ldd r25, Y+22 ; 0x16 25714: af 89 ldd r26, Y+23 ; 0x17 25716: b8 8d ldd r27, Y+24 ; 0x18 25718: 89 a3 std Y+33, r24 ; 0x21 2571a: 9a a3 std Y+34, r25 ; 0x22 2571c: ab a3 std Y+35, r26 ; 0x23 2571e: bc a3 std Y+36, r27 ; 0x24 25720: c5 01 movw r24, r10 25722: b4 01 movw r22, r8 25724: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 25728: 2b 01 movw r4, r22 2572a: 3c 01 movw r6, r24 2572c: 2d a1 ldd r18, Y+37 ; 0x25 2572e: 3e a1 ldd r19, Y+38 ; 0x26 25730: 4f a1 ldd r20, Y+39 ; 0x27 25732: 58 a5 ldd r21, Y+40 ; 0x28 25734: c7 01 movw r24, r14 25736: b6 01 movw r22, r12 25738: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2573c: 9b 01 movw r18, r22 2573e: ac 01 movw r20, r24 25740: c3 01 movw r24, r6 25742: b2 01 movw r22, r4 25744: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 25748: 29 a1 ldd r18, Y+33 ; 0x21 2574a: 3a a1 ldd r19, Y+34 ; 0x22 2574c: 4b a1 ldd r20, Y+35 ; 0x23 2574e: 5c a1 ldd r21, Y+36 ; 0x24 25750: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 25754: 20 e0 ldi r18, 0x00 ; 0 25756: 30 e0 ldi r19, 0x00 ; 0 25758: 40 e9 ldi r20, 0x90 ; 144 2575a: 50 e4 ldi r21, 0x40 ; 64 2575c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 25760: 1b 01 movw r2, r22 25762: 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]; 25764: ee e1 ldi r30, 0x1E ; 30 25766: f2 e9 ldi r31, 0x92 ; 146 25768: 25 91 lpm r18, Z+ 2576a: 35 91 lpm r19, Z+ 2576c: 45 91 lpm r20, Z+ 2576e: 54 91 lpm r21, Z 25770: e2 e2 ldi r30, 0x22 ; 34 25772: f2 e9 ldi r31, 0x92 ; 146 25774: 45 90 lpm r4, Z+ 25776: 55 90 lpm r5, Z+ 25778: 65 90 lpm r6, Z+ 2577a: 74 90 lpm r7, Z 2577c: c5 01 movw r24, r10 2577e: b4 01 movw r22, r8 25780: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 25784: 4b 01 movw r8, r22 25786: 5c 01 movw r10, r24 25788: a3 01 movw r20, r6 2578a: 92 01 movw r18, r4 2578c: c7 01 movw r24, r14 2578e: b6 01 movw r22, r12 25790: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 25794: 9b 01 movw r18, r22 25796: ac 01 movw r20, r24 25798: c5 01 movw r24, r10 2579a: b4 01 movw r22, r8 2579c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 257a0: 29 a1 ldd r18, Y+33 ; 0x21 257a2: 3a a1 ldd r19, Y+34 ; 0x22 257a4: 4b a1 ldd r20, Y+35 ; 0x23 257a6: 5c a1 ldd r21, Y+36 ; 0x24 257a8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 257ac: 20 e0 ldi r18, 0x00 ; 0 257ae: 30 e0 ldi r19, 0x00 ; 0 257b0: 40 e9 ldi r20, 0x90 ; 144 257b2: 50 e4 ldi r21, 0x40 ; 64 257b4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 257b8: 6d 8f std Y+29, r22 ; 0x1d 257ba: 7e 8f std Y+30, r23 ; 0x1e 257bc: 8f 8f std Y+31, r24 ; 0x1f 257be: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 257c0: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_printf_P(_N( 257c4: 8d eb ldi r24, 0xBD ; 189 257c6: 9c e4 ldi r25, 0x4C ; 76 257c8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 257cc: d8 2e mov r13, r24 257ce: c9 2e mov r12, r25 257d0: 86 eb ldi r24, 0xB6 ; 182 257d2: 9c e4 ldi r25, 0x4C ; 76 257d4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 257d8: f8 2e mov r15, r24 257da: e9 2e mov r14, r25 257dc: 80 ea ldi r24, 0xA0 ; 160 257de: 9c e4 ldi r25, 0x4C ; 76 257e0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 257e4: cf 92 push r12 257e6: df 92 push r13 257e8: ef 92 push r14 257ea: ff 92 push r15 257ec: 21 e1 ldi r18, 0x11 ; 17 257ee: 3c e8 ldi r19, 0x8C ; 140 257f0: 3f 93 push r19 257f2: 2f 93 push r18 257f4: 9f 93 push r25 257f6: 8f 93 push r24 257f8: 85 ed ldi r24, 0xD5 ; 213 257fa: 9f e6 ldi r25, 0x6F ; 111 257fc: 9f 93 push r25 257fe: 8f 93 push r24 25800: 0e 94 66 6f call 0xdecc ; 0xdecc _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 25804: 62 e0 ldi r22, 0x02 ; 2 25806: 8b e0 ldi r24, 0x0B ; 11 25808: 0e 94 8d 6f call 0xdf1a ; 0xdf1a if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2580c: 0f b6 in r0, 0x3f ; 63 2580e: f8 94 cli 25810: de bf out 0x3e, r29 ; 62 25812: 0f be out 0x3f, r0 ; 63 25814: cd bf out 0x3d, r28 ; 61 25816: 20 e0 ldi r18, 0x00 ; 0 25818: 30 e0 ldi r19, 0x00 ; 0 2581a: 48 e4 ldi r20, 0x48 ; 72 2581c: 53 e4 ldi r21, 0x43 ; 67 2581e: 62 2d mov r22, r2 25820: 73 2d mov r23, r3 25822: 80 2f mov r24, r16 25824: 91 2f mov r25, r17 25826: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 2582a: 87 ff sbrs r24, 7 2582c: 51 c0 rjmp .+162 ; 0x258d0 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 2582e: 1f 93 push r17 25830: 0f 93 push r16 25832: 3f 92 push r3 25834: 2f 92 push r2 25836: 8d ec ldi r24, 0xCD ; 205 25838: 9f e6 ldi r25, 0x6F ; 111 2583a: 9f 93 push r25 2583c: 8f 93 push r24 2583e: 0e 94 66 6f call 0xdecc ; 0xdecc 25842: 0f 90 pop r0 25844: 0f 90 pop r0 25846: 0f 90 pop r0 25848: 0f 90 pop r0 2584a: 0f 90 pop r0 2584c: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 2584e: 63 e0 ldi r22, 0x03 ; 3 25850: 8b e0 ldi r24, 0x0B ; 11 25852: 0e 94 8d 6f call 0xdf1a ; 0xdf1a if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 25856: 1d 8d ldd r17, Y+29 ; 0x1d 25858: 0e 8d ldd r16, Y+30 ; 0x1e 2585a: ff 8c ldd r15, Y+31 ; 0x1f 2585c: e8 a0 ldd r14, Y+32 ; 0x20 2585e: 20 e0 ldi r18, 0x00 ; 0 25860: 30 e0 ldi r19, 0x00 ; 0 25862: 48 e4 ldi r20, 0x48 ; 72 25864: 53 e4 ldi r21, 0x43 ; 67 25866: d8 01 movw r26, r16 25868: f7 01 movw r30, r14 2586a: 6b 2f mov r22, r27 2586c: 7a 2f mov r23, r26 2586e: 8f 2f mov r24, r31 25870: 9e 2f mov r25, r30 25872: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 25876: 87 fd sbrc r24, 7 25878: 32 c0 rjmp .+100 ; 0x258de 2587a: 87 e0 ldi r24, 0x07 ; 7 2587c: 9d e3 ldi r25, 0x3D ; 61 2587e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25882: 0e 94 78 6f call 0xdef0 ; 0xdef0 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 25886: 0e 94 aa 71 call 0xe354 ; 0xe354 2588a: 88 23 and r24, r24 2588c: 41 f0 breq .+16 ; 0x2589e menu_goto(lcd_menu_xyz_skew, 0, true); 2588e: 20 e0 ldi r18, 0x00 ; 0 25890: 41 e0 ldi r20, 0x01 ; 1 25892: 70 e0 ldi r23, 0x00 ; 0 25894: 60 e0 ldi r22, 0x00 ; 0 25896: 85 ef ldi r24, 0xF5 ; 245 25898: 99 e3 ldi r25, 0x39 ; 57 2589a: 0f 94 32 cf call 0x39e64 ; 0x39e64 } 2589e: a8 96 adiw r28, 0x28 ; 40 258a0: 0f b6 in r0, 0x3f ; 63 258a2: f8 94 cli 258a4: de bf out 0x3e, r29 ; 62 258a6: 0f be out 0x3f, r0 ; 63 258a8: cd bf out 0x3d, r28 ; 61 258aa: df 91 pop r29 258ac: cf 91 pop r28 258ae: 1f 91 pop r17 258b0: 0f 91 pop r16 258b2: ff 90 pop r15 258b4: ef 90 pop r14 258b6: df 90 pop r13 258b8: cf 90 pop r12 258ba: bf 90 pop r11 258bc: af 90 pop r10 258be: 9f 90 pop r9 258c0: 8f 90 pop r8 258c2: 7f 90 pop r7 258c4: 6f 90 pop r6 258c6: 5f 90 pop r5 258c8: 4f 90 pop r4 258ca: 3f 90 pop r3 258cc: 2f 90 pop r2 258ce: 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)); 258d0: 87 e0 ldi r24, 0x07 ; 7 258d2: 9d e3 ldi r25, 0x3D ; 61 258d4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 258d8: 0e 94 78 6f call 0xdef0 ; 0xdef0 258dc: b8 cf rjmp .-144 ; 0x2584e else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 258de: ef 92 push r14 258e0: ff 92 push r15 258e2: 0f 93 push r16 258e4: 1f 93 push r17 258e6: 8d ec ldi r24, 0xCD ; 205 258e8: 9f e6 ldi r25, 0x6F ; 111 258ea: 9f 93 push r25 258ec: 8f 93 push r24 258ee: 0e 94 66 6f call 0xdecc ; 0xdecc 258f2: 0f 90 pop r0 258f4: 0f 90 pop r0 258f6: 0f 90 pop r0 258f8: 0f 90 pop r0 258fa: 0f 90 pop r0 258fc: 0f 90 pop r0 258fe: c3 cf rjmp .-122 ; 0x25886 00025900 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 25900: 86 e3 ldi r24, 0x36 ; 54 25902: 9f e6 ldi r25, 0x6F ; 111 25904: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc 00025908 : * 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) { 25908: af 92 push r10 2590a: bf 92 push r11 2590c: cf 92 push r12 2590e: df 92 push r13 25910: ef 92 push r14 25912: ff 92 push r15 25914: 0f 93 push r16 25916: 1f 93 push r17 25918: cf 93 push r28 2591a: df 93 push r29 2591c: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 2591e: 0e 94 41 6f call 0xde82 ; 0xde82 * @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; 25922: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 25924: 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; 25926: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 25928: 6f 2d mov r22, r15 2592a: 80 e0 ldi r24, 0x00 ; 0 2592c: 0e 94 8d 6f call 0xdf1a ; 0xdf1a // 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) 25930: c6 01 movw r24, r12 25932: 0f 94 5e 1e call 0x23cbc ; 0x23cbc 25936: 88 23 and r24, r24 25938: 29 f0 breq .+10 ; 0x25944 2593a: 8f ef ldi r24, 0xFF ; 255 2593c: c8 1a sub r12, r24 2593e: d8 0a sbc r13, r24 25940: 09 f4 brne .+2 ; 0x25944 25942: 49 c0 rjmp .+146 ; 0x259d6 25944: c6 01 movw r24, r12 25946: 0f 94 47 db call 0x3b68e ; 0x3b68e <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 2594a: 84 31 cpi r24, 0x14 ; 20 2594c: 91 05 cpc r25, r1 2594e: 10 f0 brcs .+4 ; 0x25954 25950: 84 e1 ldi r24, 0x14 ; 20 25952: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 25954: e6 01 movw r28, r12 25956: c8 0f add r28, r24 25958: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 2595a: e3 e0 ldi r30, 0x03 ; 3 2595c: fe 12 cpse r15, r30 2595e: 0a c0 rjmp .+20 ; 0x25974 25960: 84 31 cpi r24, 0x14 ; 20 25962: 41 f4 brne .+16 ; 0x25974 // 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; 25964: fe 01 movw r30, r28 25966: 84 91 lpm r24, Z 25968: e1 2c mov r14, r1 if (multi_screen) 2596a: 88 23 and r24, r24 2596c: 19 f0 breq .+6 ; 0x25974 msgend = (msgend2 -= 2); 2596e: 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; 25970: ee 24 eor r14, r14 25972: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 25974: fe 01 movw r30, r28 25976: 84 91 lpm r24, Z 25978: 88 23 and r24, r24 2597a: 09 f4 brne .+2 ; 0x2597e 2597c: 40 c0 rjmp .+128 ; 0x259fe 2597e: ce 01 movw r24, r28 25980: 0f 94 5e 1e call 0x23cbc ; 0x23cbc 25984: 81 11 cpse r24, r1 25986: 3b c0 rjmp .+118 ; 0x259fe 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); 25988: fe 01 movw r30, r28 2598a: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 2598c: 92 ed ldi r25, 0xD2 ; 210 2598e: 98 0f add r25, r24 25990: 92 30 cpi r25, 0x02 ; 2 25992: a8 f1 brcs .+106 ; 0x259fe 25994: 8c 32 cpi r24, 0x2C ; 44 25996: 99 f1 breq .+102 ; 0x259fe 25998: 96 ec ldi r25, 0xC6 ; 198 2599a: 98 0f add r25, r24 2599c: 92 30 cpi r25, 0x02 ; 2 2599e: 78 f1 brcs .+94 ; 0x259fe 259a0: 8f 33 cpi r24, 0x3F ; 63 259a2: 69 f1 breq .+90 ; 0x259fe 259a4: 81 32 cpi r24, 0x21 ; 33 259a6: 59 f1 breq .+86 ; 0x259fe 259a8: 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)) 259aa: c0 16 cp r12, r16 259ac: d1 06 cpc r13, r17 259ae: 58 f4 brcc .+22 ; 0x259c6 259b0: 58 01 movw r10, r16 259b2: f1 e0 ldi r31, 0x01 ; 1 259b4: af 1a sub r10, r31 259b6: b1 08 sbc r11, r1 259b8: c5 01 movw r24, r10 259ba: 0f 94 5e 1e call 0x23cbc ; 0x23cbc 259be: 81 11 cpse r24, r1 259c0: 1d c0 rjmp .+58 ; 0x259fc -- msgend; 259c2: 85 01 movw r16, r10 259c4: f2 cf rjmp .-28 ; 0x259aa if (msgend == msg) 259c6: c0 16 cp r12, r16 259c8: d1 06 cpc r13, r17 259ca: c9 f0 breq .+50 ; 0x259fe 259cc: 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) { 259ce: f3 94 inc r15 259d0: 84 e0 ldi r24, 0x04 ; 4 259d2: f8 12 cpse r15, r24 259d4: a9 cf rjmp .-174 ; 0x25928 } lcd_print(c); } } if (multi_screen) { 259d6: ee 20 and r14, r14 259d8: f9 f0 breq .+62 ; 0x25a18 // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 259da: 48 e8 ldi r20, 0x88 ; 136 259dc: 63 e0 ldi r22, 0x03 ; 3 259de: 83 e1 ldi r24, 0x13 ; 19 259e0: 0e 94 ad 6f call 0xdf5a ; 0xdf5a } return multi_screen ? msgend : NULL; } 259e4: ce 01 movw r24, r28 259e6: df 91 pop r29 259e8: cf 91 pop r28 259ea: 1f 91 pop r17 259ec: 0f 91 pop r16 259ee: ff 90 pop r15 259f0: ef 90 pop r14 259f2: df 90 pop r13 259f4: cf 90 pop r12 259f6: bf 90 pop r11 259f8: af 90 pop r10 259fa: 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)) 259fc: 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) { 259fe: cc 16 cp r12, r28 25a00: dd 06 cpc r13, r29 25a02: 28 f7 brcc .-54 ; 0x259ce char c = char(pgm_read_byte(msg)); 25a04: f6 01 movw r30, r12 25a06: 84 91 lpm r24, Z if (c == '\n') { 25a08: 8a 30 cpi r24, 0x0A ; 10 25a0a: 09 f3 breq .-62 ; 0x259ce 25a0c: 0e 94 3c 70 call 0xe078 ; 0xe078 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 25a10: ff ef ldi r31, 0xFF ; 255 25a12: cf 1a sub r12, r31 25a14: df 0a sbc r13, r31 25a16: f3 cf rjmp .-26 ; 0x259fe if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 25a18: d0 e0 ldi r29, 0x00 ; 0 25a1a: c0 e0 ldi r28, 0x00 ; 0 25a1c: e3 cf rjmp .-58 ; 0x259e4 00025a1e : } #if defined(FILAMENT_SENSOR) && !defined(REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY) static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 25a1e: 83 ef ldi r24, 0xF3 ; 243 25a20: 9b e4 ldi r25, 0x4B ; 75 25a22: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25a26: 0f 94 84 2c call 0x25908 ; 0x25908 menu_back_if_clicked(); 25a2a: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00025a2e : } _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(); 25a2e: 0e 94 1b 78 call 0xf036 ; 0xf036 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 25a32: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 } 25a36: 08 95 ret 00025a38 : //! |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() { 25a38: cf 93 push r28 25a3a: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 25a3c: 81 ef ldi r24, 0xF1 ; 241 25a3e: 9c e4 ldi r25, 0x4C ; 76 25a40: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25a44: ac 01 movw r20, r24 25a46: 60 e0 ldi r22, 0x00 ; 0 25a48: 80 e0 ldi r24, 0x00 ; 0 25a4a: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 1, STR_SEPARATOR); 25a4e: 41 e1 ldi r20, 0x11 ; 17 25a50: 5c e8 ldi r21, 0x8C ; 140 25a52: 61 e0 ldi r22, 0x01 ; 1 25a54: 80 e0 ldi r24, 0x00 ; 0 25a56: 0e 94 a1 6f call 0xdf42 ; 0xdf42 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 25a5a: 62 e0 ldi r22, 0x02 ; 2 25a5c: 80 e0 ldi r24, 0x00 ; 0 25a5e: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25a62: 85 ee ldi r24, 0xE5 ; 229 25a64: 9f e0 ldi r25, 0x0F ; 15 25a66: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 25a6a: 9f 93 push r25 25a6c: 8f 93 push r24 25a6e: 7f 93 push r23 25a70: 6f 93 push r22 25a72: 1f 92 push r1 25a74: 88 e5 ldi r24, 0x58 ; 88 25a76: 8f 93 push r24 25a78: c2 ea ldi r28, 0xA2 ; 162 25a7a: d3 ea ldi r29, 0xA3 ; 163 25a7c: df 93 push r29 25a7e: cf 93 push r28 25a80: 0e 94 66 6f call 0xdecc ; 0xdecc { 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); 25a84: 63 e0 ldi r22, 0x03 ; 3 25a86: 80 e0 ldi r24, 0x00 ; 0 25a88: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25a8c: 89 ee ldi r24, 0xE9 ; 233 25a8e: 9f e0 ldi r25, 0x0F ; 15 25a90: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 25a94: 9f 93 push r25 25a96: 8f 93 push r24 25a98: 7f 93 push r23 25a9a: 6f 93 push r22 25a9c: 1f 92 push r1 25a9e: 89 e5 ldi r24, 0x59 ; 89 25aa0: 8f 93 push r24 25aa2: df 93 push r29 25aa4: cf 93 push r28 25aa6: 0e 94 66 6f call 0xdecc ; 0xdecc } menu_back_if_clicked(); 25aaa: 8d b7 in r24, 0x3d ; 61 25aac: 9e b7 in r25, 0x3e ; 62 25aae: 40 96 adiw r24, 0x10 ; 16 25ab0: 0f b6 in r0, 0x3f ; 63 25ab2: f8 94 cli 25ab4: 9e bf out 0x3e, r25 ; 62 25ab6: 0f be out 0x3f, r0 ; 63 25ab8: 8d bf out 0x3d, r24 ; 61 } 25aba: df 91 pop r29 25abc: 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(); 25abe: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00025ac2 : //! ---------------------- //! 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() { 25ac2: cf 92 push r12 25ac4: df 92 push r13 25ac6: ef 92 push r14 25ac8: ff 92 push r15 25aca: 0f 93 push r16 25acc: 1f 93 push r17 25ace: cf 93 push r28 25ad0: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 25ad2: 80 e6 ldi r24, 0x60 ; 96 25ad4: 9f e0 ldi r25, 0x0F ; 15 25ad6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 25ada: 6b 01 movw r12, r22 25adc: 7c 01 movw r14, r24 lcd_home(); 25ade: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_printf_P(_N( 25ae2: 83 ee ldi r24, 0xE3 ; 227 25ae4: 9c e4 ldi r25, 0x4C ; 76 25ae6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25aea: 18 2f mov r17, r24 25aec: 09 2f mov r16, r25 25aee: 85 ed ldi r24, 0xD5 ; 213 25af0: 9c e4 ldi r25, 0x4C ; 76 25af2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25af6: ec 01 movw r28, r24 25af8: 85 ec ldi r24, 0xC5 ; 197 25afa: 9c e4 ldi r25, 0x4C ; 76 25afc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25b00: 2e e3 ldi r18, 0x3E ; 62 25b02: 2f 93 push r18 25b04: 20 e8 ldi r18, 0x80 ; 128 25b06: 2f 93 push r18 25b08: 1f 92 push r1 25b0a: 1f 92 push r1 25b0c: 0f 93 push r16 25b0e: 1f 93 push r17 25b10: 2d e3 ldi r18, 0x3D ; 61 25b12: 2f 93 push r18 25b14: 25 ef ldi r18, 0xF5 ; 245 25b16: 2f 93 push r18 25b18: 22 ec ldi r18, 0xC2 ; 194 25b1a: 2f 93 push r18 25b1c: 20 e9 ldi r18, 0x90 ; 144 25b1e: 2f 93 push r18 25b20: df 93 push r29 25b22: cf 93 push r28 25b24: 21 e1 ldi r18, 0x11 ; 17 25b26: 3c e8 ldi r19, 0x8C ; 140 25b28: 3f 93 push r19 25b2a: 2f 93 push r18 25b2c: 9f 93 push r25 25b2e: 8f 93 push r24 25b30: 8a ee ldi r24, 0xEA ; 234 25b32: 9f e6 ldi r25, 0x6F ; 111 25b34: 9f 93 push r25 25b36: 8f 93 push r24 25b38: 0e 94 66 6f call 0xdecc ; 0xdecc _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); 25b3c: 60 e0 ldi r22, 0x00 ; 0 25b3e: 8f e0 ldi r24, 0x0F ; 15 25b40: 0e 94 8d 6f call 0xdf1a ; 0xdf1a if (angleDiff < 100){ 25b44: 8d b7 in r24, 0x3d ; 61 25b46: 9e b7 in r25, 0x3e ; 62 25b48: 42 96 adiw r24, 0x12 ; 18 25b4a: 0f b6 in r0, 0x3f ; 63 25b4c: f8 94 cli 25b4e: 9e bf out 0x3e, r25 ; 62 25b50: 0f be out 0x3f, r0 ; 63 25b52: 8d bf out 0x3d, r24 ; 61 25b54: 20 e0 ldi r18, 0x00 ; 0 25b56: 30 e0 ldi r19, 0x00 ; 0 25b58: 48 ec ldi r20, 0xC8 ; 200 25b5a: 52 e4 ldi r21, 0x42 ; 66 25b5c: c7 01 movw r24, r14 25b5e: b6 01 movw r22, r12 25b60: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 25b64: 87 ff sbrs r24, 7 25b66: 32 c0 rjmp .+100 ; 0x25bcc } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 25b68: 20 e0 ldi r18, 0x00 ; 0 25b6a: 30 e0 ldi r19, 0x00 ; 0 25b6c: 44 e3 ldi r20, 0x34 ; 52 25b6e: 53 e4 ldi r21, 0x43 ; 67 25b70: c7 01 movw r24, r14 25b72: b6 01 movw r22, r12 25b74: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 25b78: 2b ed ldi r18, 0xDB ; 219 25b7a: 3f e0 ldi r19, 0x0F ; 15 25b7c: 49 e4 ldi r20, 0x49 ; 73 25b7e: 50 e4 ldi r21, 0x40 ; 64 25b80: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__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)); 25b84: 9f 93 push r25 25b86: 8f 93 push r24 25b88: 7f 93 push r23 25b8a: 6f 93 push r22 25b8c: 83 ee ldi r24, 0xE3 ; 227 25b8e: 9f e6 ldi r25, 0x6F ; 111 25b90: 9f 93 push r25 25b92: 8f 93 push r24 25b94: 0e 94 66 6f call 0xdecc ; 0xdecc 25b98: 0f 90 pop r0 25b9a: 0f 90 pop r0 25b9c: 0f 90 pop r0 25b9e: 0f 90 pop r0 25ba0: 0f 90 pop r0 25ba2: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 25ba4: 0e 94 aa 71 call 0xe354 ; 0xe354 25ba8: 88 23 and r24, r24 25baa: b9 f0 breq .+46 ; 0x25bda menu_goto(lcd_menu_xyz_offset, 0, true); 25bac: 20 e0 ldi r18, 0x00 ; 0 25bae: 41 e0 ldi r20, 0x01 ; 1 25bb0: 70 e0 ldi r23, 0x00 ; 0 25bb2: 60 e0 ldi r22, 0x00 ; 0 25bb4: 81 e9 ldi r24, 0x91 ; 145 25bb6: 9a e3 ldi r25, 0x3A ; 58 } 25bb8: df 91 pop r29 25bba: cf 91 pop r28 25bbc: 1f 91 pop r17 25bbe: 0f 91 pop r16 25bc0: ff 90 pop r15 25bc2: ef 90 pop r14 25bc4: df 90 pop r13 25bc6: 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); 25bc8: 0d 94 32 cf jmp 0x39e64 ; 0x39e64 ); 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)); 25bcc: 87 e0 ldi r24, 0x07 ; 7 25bce: 9d e3 ldi r25, 0x3D ; 61 25bd0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25bd4: 0e 94 78 6f call 0xdef0 ; 0xdef0 25bd8: e5 cf rjmp .-54 ; 0x25ba4 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 25bda: df 91 pop r29 25bdc: cf 91 pop r28 25bde: 1f 91 pop r17 25be0: 0f 91 pop r16 25be2: ff 90 pop r15 25be4: ef 90 pop r14 25be6: df 90 pop r13 25be8: cf 90 pop r12 25bea: 08 95 ret 00025bec <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 25bec: 2f 92 push r2 25bee: 3f 92 push r3 25bf0: 4f 92 push r4 25bf2: 5f 92 push r5 25bf4: 6f 92 push r6 25bf6: 7f 92 push r7 25bf8: 9f 92 push r9 25bfa: af 92 push r10 25bfc: bf 92 push r11 25bfe: cf 92 push r12 25c00: df 92 push r13 25c02: ef 92 push r14 25c04: ff 92 push r15 25c06: 0f 93 push r16 25c08: 1f 93 push r17 25c0a: cf 93 push r28 25c0c: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 25c0e: 70 91 56 0e lds r23, 0x0E56 ; 0x800e56 25c12: 71 11 cpse r23, r1 25c14: 04 c0 rjmp .+8 ; 0x25c1e <_lcd_move(char const*, unsigned char, int, int)+0x32> 25c16: 70 91 57 0e lds r23, 0x0E57 ; 0x800e57 25c1a: 77 23 and r23, r23 25c1c: 99 f0 breq .+38 ; 0x25c44 <_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(); } 25c1e: df 91 pop r29 25c20: cf 91 pop r28 25c22: 1f 91 pop r17 25c24: 0f 91 pop r16 25c26: ff 90 pop r15 25c28: ef 90 pop r14 25c2a: df 90 pop r13 25c2c: cf 90 pop r12 25c2e: bf 90 pop r11 25c30: af 90 pop r10 25c32: 9f 90 pop r9 25c34: 7f 90 pop r7 25c36: 6f 90 pop r6 25c38: 5f 90 pop r5 25c3a: 4f 90 pop r4 25c3c: 3f 90 pop r3 25c3e: 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(); 25c40: 0d 94 d0 d1 jmp 0x3a3a0 ; 0x3a3a0 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) 25c44: 70 91 a7 03 lds r23, 0x03A7 ; 0x8003a7 25c48: 71 11 cpse r23, r1 25c4a: 09 c0 rjmp .+18 ; 0x25c5e <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 25c4c: 70 91 8f 02 lds r23, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 25c50: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> { _md->endstopsEnabledPrevious = enable_endstops(false); 25c54: 70 93 a8 03 sts 0x03A8, r23 ; 0x8003a8 _md->initialized = true; 25c58: 71 e0 ldi r23, 0x01 ; 1 25c5a: 70 93 a7 03 sts 0x03A7, r23 ; 0x8003a7 25c5e: 19 01 movw r2, r18 25c60: 6a 01 movw r12, r20 25c62: c6 2f mov r28, r22 25c64: d9 2f mov r29, r25 25c66: 98 2e mov r9, r24 } if (lcd_encoder != 0) 25c68: 80 91 35 05 lds r24, 0x0535 ; 0x800535 25c6c: 90 91 36 05 lds r25, 0x0536 ; 0x800536 25c70: 89 2b or r24, r25 25c72: 09 f4 brne .+2 ; 0x25c76 <_lcd_move(char const*, unsigned char, int, int)+0x8a> 25c74: 71 c0 rjmp .+226 ; 0x25d58 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 25c76: 0e 94 70 67 call 0xcee0 ; 0xcee0 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; 25c7a: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 if (++ next_block_index == BLOCK_BUFFER_SIZE) 25c7e: 8f 5f subi r24, 0xFF ; 255 25c80: 80 31 cpi r24, 0x10 ; 16 25c82: 09 f4 brne .+2 ; 0x25c86 <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 25c84: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 25c86: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 if (! planner_queue_full()) 25c8a: 98 17 cp r25, r24 25c8c: 09 f4 brne .+2 ; 0x25c90 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 25c8e: 64 c0 rjmp .+200 ; 0x25d58 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 25c90: 84 e0 ldi r24, 0x04 ; 4 25c92: c8 9f mul r28, r24 25c94: 80 01 movw r16, r0 25c96: 11 24 eor r1, r1 25c98: f8 01 movw r30, r16 25c9a: ef 5b subi r30, 0xBF ; 191 25c9c: f8 4f sbci r31, 0xF8 ; 248 25c9e: 5f 01 movw r10, r30 25ca0: 60 91 35 05 lds r22, 0x0535 ; 0x800535 25ca4: 70 91 36 05 lds r23, 0x0536 ; 0x800536 25ca8: 07 2e mov r0, r23 25caa: 00 0c add r0, r0 25cac: 88 0b sbc r24, r24 25cae: 99 0b sbc r25, r25 25cb0: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 25cb4: f5 01 movw r30, r10 25cb6: 20 81 ld r18, Z 25cb8: 31 81 ldd r19, Z+1 ; 0x01 25cba: 42 81 ldd r20, Z+2 ; 0x02 25cbc: 53 81 ldd r21, Z+3 ; 0x03 25cbe: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 25cc2: 2b 01 movw r4, r22 25cc4: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25cc6: b6 01 movw r22, r12 25cc8: dd 0c add r13, r13 25cca: 88 0b sbc r24, r24 25ccc: 99 0b sbc r25, r25 25cce: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 25cd2: 6b 01 movw r12, r22 25cd4: 7c 01 movw r14, r24 25cd6: ac 01 movw r20, r24 25cd8: 9b 01 movw r18, r22 25cda: c3 01 movw r24, r6 25cdc: b2 01 movw r22, r4 25cde: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 25ce2: f5 01 movw r30, r10 25ce4: 87 fd sbrc r24, 7 25ce6: 7d c0 rjmp .+250 ; 0x25de2 <_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; 25ce8: 40 82 st Z, r4 25cea: 51 82 std Z+1, r5 ; 0x01 25cec: 62 82 std Z+2, r6 ; 0x02 25cee: 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; 25cf0: b1 01 movw r22, r2 25cf2: 33 0c add r3, r3 25cf4: 88 0b sbc r24, r24 25cf6: 99 0b sbc r25, r25 25cf8: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 25cfc: 2b 01 movw r4, r22 25cfe: 3c 01 movw r6, r24 25d00: c8 01 movw r24, r16 25d02: 8f 5b subi r24, 0xBF ; 191 25d04: 98 4f sbci r25, 0xF8 ; 248 25d06: 7c 01 movw r14, r24 25d08: a3 01 movw r20, r6 25d0a: 92 01 movw r18, r4 25d0c: fc 01 movw r30, r24 25d0e: 60 81 ld r22, Z 25d10: 71 81 ldd r23, Z+1 ; 0x01 25d12: 82 81 ldd r24, Z+2 ; 0x02 25d14: 93 81 ldd r25, Z+3 ; 0x03 25d16: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 25d1a: 18 16 cp r1, r24 25d1c: 2c f4 brge .+10 ; 0x25d28 <_lcd_move(char const*, unsigned char, int, int)+0x13c> 25d1e: f7 01 movw r30, r14 25d20: 40 82 st Z, r4 25d22: 51 82 std Z+1, r5 ; 0x01 25d24: 62 82 std Z+2, r6 ; 0x02 25d26: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 25d28: 10 92 36 05 sts 0x0536, r1 ; 0x800536 25d2c: 10 92 35 05 sts 0x0535, r1 ; 0x800535 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 25d30: 65 e4 ldi r22, 0x45 ; 69 25d32: 77 e0 ldi r23, 0x07 ; 7 25d34: 81 e4 ldi r24, 0x41 ; 65 25d36: 97 e0 ldi r25, 0x07 ; 7 25d38: 0e 94 57 6b call 0xd6ae ; 0xd6ae plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 25d3c: f8 01 movw r30, r16 25d3e: e6 50 subi r30, 0x06 ; 6 25d40: fd 4f sbci r31, 0xFD ; 253 25d42: 60 81 ld r22, Z 25d44: 71 81 ldd r23, Z+1 ; 0x01 25d46: 82 81 ldd r24, Z+2 ; 0x02 25d48: 93 81 ldd r25, Z+3 ; 0x03 25d4a: 0e 94 74 67 call 0xcee8 ; 0xcee8 25d4e: 0f 94 8b ba call 0x37516 ; 0x37516 lcd_draw_update = 1; 25d52: 81 e0 ldi r24, 0x01 ; 1 25d54: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 25d58: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25d5c: 88 23 and r24, r24 25d5e: 11 f1 breq .+68 ; 0x25da4 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 25d60: 61 e0 ldi r22, 0x01 ; 1 25d62: 80 e0 ldi r24, 0x00 ; 0 25d64: 0e 94 8d 6f call 0xdf1a ; 0xdf1a menu_draw_float31(name, current_position[axis]); 25d68: 84 e0 ldi r24, 0x04 ; 4 25d6a: c8 9f mul r28, r24 25d6c: f0 01 movw r30, r0 25d6e: 11 24 eor r1, r1 25d70: ef 5b subi r30, 0xBF ; 191 25d72: 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); 25d74: 83 81 ldd r24, Z+3 ; 0x03 25d76: 8f 93 push r24 25d78: 82 81 ldd r24, Z+2 ; 0x02 25d7a: 8f 93 push r24 25d7c: 81 81 ldd r24, Z+1 ; 0x01 25d7e: 8f 93 push r24 25d80: 80 81 ld r24, Z 25d82: 8f 93 push r24 25d84: df 93 push r29 25d86: 9f 92 push r9 25d88: 89 e8 ldi r24, 0x89 ; 137 25d8a: 93 ea ldi r25, 0xA3 ; 163 25d8c: 9f 93 push r25 25d8e: 8f 93 push r24 25d90: 0e 94 66 6f call 0xdecc ; 0xdecc 25d94: ed b7 in r30, 0x3d ; 61 25d96: fe b7 in r31, 0x3e ; 62 25d98: 38 96 adiw r30, 0x08 ; 8 25d9a: 0f b6 in r0, 0x3f ; 63 25d9c: f8 94 cli 25d9e: fe bf out 0x3e, r31 ; 62 25da0: 0f be out 0x3f, r0 ; 63 25da2: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 25da4: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 25da8: 81 11 cpse r24, r1 25daa: 04 c0 rjmp .+8 ; 0x25db4 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 25dac: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 25db0: 88 23 and r24, r24 25db2: 21 f0 breq .+8 ; 0x25dbc <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 25db4: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 25db8: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> menu_back_if_clicked(); } 25dbc: df 91 pop r29 25dbe: cf 91 pop r28 25dc0: 1f 91 pop r17 25dc2: 0f 91 pop r16 25dc4: ff 90 pop r15 25dc6: ef 90 pop r14 25dc8: df 90 pop r13 25dca: cf 90 pop r12 25dcc: bf 90 pop r11 25dce: af 90 pop r10 25dd0: 9f 90 pop r9 25dd2: 7f 90 pop r7 25dd4: 6f 90 pop r6 25dd6: 5f 90 pop r5 25dd8: 4f 90 pop r4 25dda: 3f 90 pop r3 25ddc: 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(); 25dde: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25de2: c0 82 st Z, r12 25de4: d1 82 std Z+1, r13 ; 0x01 25de6: e2 82 std Z+2, r14 ; 0x02 25de8: f3 82 std Z+3, r15 ; 0x03 25dea: 82 cf rjmp .-252 ; 0x25cf0 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00025dec : } // 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); 25dec: 2f ef ldi r18, 0xFF ; 255 25dee: 30 e0 ldi r19, 0x00 ; 0 25df0: 50 e0 ldi r21, 0x00 ; 0 25df2: 40 e0 ldi r20, 0x00 ; 0 25df4: 60 e0 ldi r22, 0x00 ; 0 25df6: 8d ea ldi r24, 0xAD ; 173 25df8: 93 ea ldi r25, 0xA3 ; 163 25dfa: 0d 94 f6 2d jmp 0x25bec ; 0x25bec <_lcd_move(char const*, unsigned char, int, int)> 00025dfe : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 25dfe: 24 ed ldi r18, 0xD4 ; 212 25e00: 30 e0 ldi r19, 0x00 ; 0 25e02: 4c ef ldi r20, 0xFC ; 252 25e04: 5f ef ldi r21, 0xFF ; 255 25e06: 61 e0 ldi r22, 0x01 ; 1 25e08: 80 eb ldi r24, 0xB0 ; 176 25e0a: 93 ea ldi r25, 0xA3 ; 163 25e0c: 0d 94 f6 2d jmp 0x25bec ; 0x25bec <_lcd_move(char const*, unsigned char, int, int)> 00025e10 : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 25e10: 22 ed ldi r18, 0xD2 ; 210 25e12: 30 e0 ldi r19, 0x00 ; 0 25e14: 50 e0 ldi r21, 0x00 ; 0 25e16: 40 e0 ldi r20, 0x00 ; 0 25e18: 62 e0 ldi r22, 0x02 ; 2 25e1a: 83 eb ldi r24, 0xB3 ; 179 25e1c: 93 ea ldi r25, 0xA3 ; 163 25e1e: 0d 94 f6 2d jmp 0x25bec ; 0x25bec <_lcd_move(char const*, unsigned char, int, int)> 00025e22 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 25e22: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 25e26: 81 11 cpse r24, r1 25e28: 03 c0 rjmp .+6 ; 0x25e30 25e2a: 82 e0 ldi r24, 0x02 ; 2 25e2c: 0d 94 b4 d1 jmp 0x3a368 ; 0x3a368 25e30: 81 e0 ldi r24, 0x01 ; 1 25e32: fc cf rjmp .-8 ; 0x25e2c 00025e34 : } // 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); 25e34: 5f 93 push r21 25e36: 4f 93 push r20 25e38: 7f 93 push r23 25e3a: 6f 93 push r22 25e3c: 28 2f mov r18, r24 25e3e: 08 2e mov r0, r24 25e40: 00 0c add r0, r0 25e42: 33 0b sbc r19, r19 25e44: 3f 93 push r19 25e46: 8f 93 push r24 25e48: 81 ed ldi r24, 0xD1 ; 209 25e4a: 9e e6 ldi r25, 0x6E ; 110 25e4c: 9f 93 push r25 25e4e: 8f 93 push r24 25e50: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_space(9 - chars); 25e54: 2d b7 in r18, 0x3d ; 61 25e56: 3e b7 in r19, 0x3e ; 62 25e58: 28 5f subi r18, 0xF8 ; 248 25e5a: 3f 4f sbci r19, 0xFF ; 255 25e5c: 0f b6 in r0, 0x3f ; 63 25e5e: f8 94 cli 25e60: 3e bf out 0x3e, r19 ; 62 25e62: 0f be out 0x3f, r0 ; 63 25e64: 2d bf out 0x3d, r18 ; 61 25e66: 99 e0 ldi r25, 0x09 ; 9 25e68: 98 1b sub r25, r24 25e6a: 89 2f mov r24, r25 25e6c: 0c 94 83 6f jmp 0xdf06 ; 0xdf06 00025e70 : default: return false; } } void lcd_print_target_temps_first_line() { 25e70: cf 93 push r28 25e72: df 93 push r29 lcd_home(); 25e74: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 25e78: c0 91 6b 0e lds r28, 0x0E6B ; 0x800e6b 25e7c: d0 91 6c 0e lds r29, 0x0E6C ; 0x800e6c 25e80: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 25e84: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 25e88: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 25e8c: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 25e90: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 25e94: ae 01 movw r20, r28 25e96: 82 e8 ldi r24, 0x82 ; 130 25e98: 0f 94 1a 2f call 0x25e34 ; 0x25e34 lcd_set_cursor(10, 0); 25e9c: 60 e0 ldi r22, 0x00 ; 0 25e9e: 8a e0 ldi r24, 0x0A ; 10 25ea0: 0e 94 8d 6f call 0xdf1a ; 0xdf1a FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 25ea4: c0 91 69 0e lds r28, 0x0E69 ; 0x800e69 25ea8: d0 91 6a 0e lds r29, 0x0E6A ; 0x800e6a int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 25eac: 20 97 sbiw r28, 0x00 ; 0 25eae: 81 f0 breq .+32 ; 0x25ed0 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 25eb0: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 25eb4: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 25eb8: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 25ebc: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 25ec0: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 25ec4: ae 01 movw r20, r28 25ec6: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 25ec8: df 91 pop r29 25eca: 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); 25ecc: 0d 94 1a 2f jmp 0x25e34 ; 0x25e34 } else { lcd_space(10); 25ed0: 8a e0 ldi r24, 0x0A ; 10 } } 25ed2: df 91 pop r29 25ed4: 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); 25ed6: 0c 94 83 6f jmp 0xdf06 ; 0xdf06 00025eda : 25eda: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 25ede: 0f 94 38 2f call 0x25e70 ; 0x25e70 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 25ee2: 8e e4 ldi r24, 0x4E ; 78 25ee4: 9b e4 ldi r25, 0x4B ; 75 25ee6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25eea: ac 01 movw r20, r24 25eec: 61 e0 ldi r22, 0x01 ; 1 25eee: 80 e0 ldi r24, 0x00 ; 0 25ef0: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(0,2); 25ef4: 62 e0 ldi r22, 0x02 ; 2 25ef6: 80 e0 ldi r24, 0x00 ; 0 25ef8: 0e 94 8d 6f call 0xdf1a ; 0xdf1a switch(eFilamentAction) { 25efc: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 25f00: 83 30 cpi r24, 0x03 ; 3 25f02: 81 f1 breq .+96 ; 0x25f64 25f04: 48 f4 brcc .+18 ; 0x25f18 25f06: 81 30 cpi r24, 0x01 ; 1 25f08: 60 f0 brcs .+24 ; 0x25f22 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 25f0a: 8b e3 ldi r24, 0x3B ; 59 25f0c: 9b e4 ldi r25, 0x4B ; 75 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 25f0e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 25f12: 0e 94 78 6f call 0xdef0 ; 0xdef0 25f16: 05 c0 rjmp .+10 ; 0x25f22 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) { 25f18: 85 30 cpi r24, 0x05 ; 5 25f1a: 21 f1 breq .+72 ; 0x25f64 25f1c: b0 f3 brcs .-20 ; 0x25f0a 25f1e: 88 30 cpi r24, 0x08 ; 8 25f20: a1 f3 breq .-24 ; 0x25f0a case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 25f22: 0e 94 aa 71 call 0xe354 ; 0xe354 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 25f26: 81 11 cpse r24, r1 25f28: 09 c0 rjmp .+18 ; 0x25f3c 25f2a: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 25f2e: 81 50 subi r24, 0x01 ; 1 25f30: 82 30 cpi r24, 0x02 ; 2 25f32: 28 f5 brcc .+74 ; 0x25f7e 25f34: 80 91 8a 17 lds r24, 0x178A ; 0x80178a 25f38: 88 23 and r24, r24 25f3a: 09 f1 breq .+66 ; 0x25f7e #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 25f3c: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 25f40: 81 11 cpse r24, r1 25f42: 13 c0 rjmp .+38 ; 0x25f6a 25f44: 83 e0 ldi r24, 0x03 ; 3 25f46: 0f 94 b4 d1 call 0x3a368 ; 0x3a368 switch(eFilamentAction) { 25f4a: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 25f4e: 82 30 cpi r24, 0x02 ; 2 25f50: 71 f0 breq .+28 ; 0x25f6e 25f52: 83 30 cpi r24, 0x03 ; 3 25f54: 81 f0 breq .+32 ; 0x25f76 25f56: 81 30 cpi r24, 0x01 ; 1 25f58: 91 f4 brne .+36 ; 0x25f7e case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 25f5a: 61 e0 ldi r22, 0x01 ; 1 25f5c: 80 e8 ldi r24, 0x80 ; 128 25f5e: 9f e6 ldi r25, 0x6F ; 111 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25f60: 0c 94 43 89 jmp 0x11286 ; 0x11286 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)); 25f64: 86 e2 ldi r24, 0x26 ; 38 25f66: 9b e4 ldi r25, 0x4B ; 75 25f68: d2 cf rjmp .-92 ; 0x25f0e #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); 25f6a: 82 e0 ldi r24, 0x02 ; 2 25f6c: ec cf rjmp .-40 ; 0x25f46 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 25f6e: 81 e0 ldi r24, 0x01 ; 1 25f70: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 25f74: f2 cf rjmp .-28 ; 0x25f5a [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25f76: 61 e0 ldi r22, 0x01 ; 1 25f78: 88 e1 ldi r24, 0x18 ; 24 25f7a: 9c e6 ldi r25, 0x6C ; 108 25f7c: f1 cf rjmp .-30 ; 0x25f60 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 25f7e: 08 95 ret 00025f80 : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 25f80: cf 92 push r12 25f82: df 92 push r13 25f84: ef 92 push r14 25f86: ff 92 push r15 25f88: 0f 93 push r16 25f8a: 1f 93 push r17 25f8c: cf 93 push r28 25f8e: df 93 push r29 25f90: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25f94: 60 91 57 06 lds r22, 0x0657 ; 0x800657 25f98: 70 91 58 06 lds r23, 0x0658 ; 0x800658 25f9c: 07 2e mov r0, r23 25f9e: 00 0c add r0, r0 25fa0: 88 0b sbc r24, r24 25fa2: 99 0b sbc r25, r25 25fa4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 25fa8: 20 e0 ldi r18, 0x00 ; 0 25faa: 30 ec ldi r19, 0xC0 ; 192 25fac: 4f e7 ldi r20, 0x7F ; 127 25fae: 56 e4 ldi r21, 0x46 ; 70 25fb0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 25fb4: 20 e0 ldi r18, 0x00 ; 0 25fb6: 30 e0 ldi r19, 0x00 ; 0 25fb8: 40 ea ldi r20, 0xA0 ; 160 25fba: 50 e4 ldi r21, 0x40 ; 64 25fbc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 25fc0: 27 ed ldi r18, 0xD7 ; 215 25fc2: 30 e3 ldi r19, 0x30 ; 48 25fc4: 44 e4 ldi r20, 0x44 ; 68 25fc6: 5e e3 ldi r21, 0x3E ; 62 25fc8: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 25fcc: eb 01 movw r28, r22 25fce: 18 2f mov r17, r24 25fd0: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25fd2: 60 91 55 06 lds r22, 0x0655 ; 0x800655 25fd6: 70 91 56 06 lds r23, 0x0656 ; 0x800656 25fda: 07 2e mov r0, r23 25fdc: 00 0c add r0, r0 25fde: 88 0b sbc r24, r24 25fe0: 99 0b sbc r25, r25 25fe2: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 25fe6: 20 e0 ldi r18, 0x00 ; 0 25fe8: 30 ec ldi r19, 0xC0 ; 192 25fea: 4f e7 ldi r20, 0x7F ; 127 25fec: 56 e4 ldi r21, 0x46 ; 70 25fee: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 25ff2: 20 e0 ldi r18, 0x00 ; 0 25ff4: 30 e0 ldi r19, 0x00 ; 0 25ff6: 40 ea ldi r20, 0xA0 ; 160 25ff8: 50 e4 ldi r21, 0x40 ; 64 25ffa: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 25ffe: 27 ed ldi r18, 0xD7 ; 215 26000: 30 e3 ldi r19, 0x30 ; 48 26002: 44 e4 ldi r20, 0x44 ; 68 26004: 5e e3 ldi r21, 0x3E ; 62 26006: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2600a: f6 2e mov r15, r22 2600c: e7 2e mov r14, r23 2600e: d8 2e mov r13, r24 26010: c9 2e mov r12, r25 lcd_home(); 26012: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 26016: cf 92 push r12 26018: df 92 push r13 2601a: ef 92 push r14 2601c: ff 92 push r15 2601e: 0f 93 push r16 26020: 1f 93 push r17 26022: df 93 push r29 26024: cf 93 push r28 26026: 84 e9 ldi r24, 0x94 ; 148 26028: 91 ea ldi r25, 0xA1 ; 161 2602a: 9f 93 push r25 2602c: 8f 93 push r24 2602e: 0e 94 66 6f call 0xdecc ; 0xdecc #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) lcd_printf_P(PSTR("\n IR : %3.1fV"), Raw2Voltage(fsensor.getVoltRaw())); 26032: 0f 94 df 7c call 0x2f9be ; 0x2f9be 26036: bc 01 movw r22, r24 26038: 90 e0 ldi r25, 0x00 ; 0 2603a: 80 e0 ldi r24, 0x00 ; 0 2603c: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 26040: 20 e0 ldi r18, 0x00 ; 0 26042: 30 ec ldi r19, 0xC0 ; 192 26044: 4f e7 ldi r20, 0x7F ; 127 26046: 56 e4 ldi r21, 0x46 ; 70 26048: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2604c: 20 e0 ldi r18, 0x00 ; 0 2604e: 30 e0 ldi r19, 0x00 ; 0 26050: 40 ea ldi r20, 0xA0 ; 160 26052: 50 e4 ldi r21, 0x40 ; 64 26054: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 26058: 9f 93 push r25 2605a: 8f 93 push r24 2605c: 7f 93 push r23 2605e: 6f 93 push r22 26060: 80 e8 ldi r24, 0x80 ; 128 26062: 91 ea ldi r25, 0xA1 ; 161 26064: 9f 93 push r25 26066: 8f 93 push r24 26068: 0e 94 66 6f call 0xdecc ; 0xdecc #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) menu_back_if_clicked(); 2606c: 8d b7 in r24, 0x3d ; 61 2606e: 9e b7 in r25, 0x3e ; 62 26070: 40 96 adiw r24, 0x10 ; 16 26072: 0f b6 in r0, 0x3f ; 63 26074: f8 94 cli 26076: 9e bf out 0x3e, r25 ; 62 26078: 0f be out 0x3f, r0 ; 63 2607a: 8d bf out 0x3d, r24 ; 61 } 2607c: df 91 pop r29 2607e: cf 91 pop r28 26080: 1f 91 pop r17 26082: 0f 91 pop r16 26084: ff 90 pop r15 26086: ef 90 pop r14 26088: df 90 pop r13 2608a: 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(); 2608c: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00026090 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 26090: ef 92 push r14 26092: ff 92 push r15 26094: 0f 93 push r16 26096: 1f 93 push r17 26098: cf 93 push r28 2609a: 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) 2609c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 260a0: 88 23 and r24, r24 260a2: 29 f0 breq .+10 ; 0x260ae 260a4: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 260a8: 92 30 cpi r25, 0x02 ; 2 260aa: 09 f0 breq .+2 ; 0x260ae 260ac: 8c c1 rjmp .+792 ; 0x263c6 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 260ae: 81 e0 ldi r24, 0x01 ; 1 260b0: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 260b4: 80 91 dd 16 lds r24, 0x16DD ; 0x8016dd _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 260b8: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 if (_md->is_flash_air) { 260bc: 88 23 and r24, r24 260be: 21 f0 breq .+8 ; 0x260c8 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 260c0: 89 ea ldi r24, 0xA9 ; 169 260c2: 93 e0 ldi r25, 0x03 ; 3 260c4: 0f 94 7c 86 call 0x30cf8 ; 0x30cf8 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 260c8: 0f 94 08 cf call 0x39e10 ; 0x39e10 260cc: 10 92 13 05 sts 0x0513, r1 ; 0x800513 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); 260d0: 88 ef ldi r24, 0xF8 ; 248 260d2: e8 2e mov r14, r24 260d4: 81 ea ldi r24, 0xA1 ; 161 260d6: 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]); 260d8: c7 ec ldi r28, 0xC7 ; 199 260da: d1 ea ldi r29, 0xA1 ; 161 260dc: 0d ea ldi r16, 0xAD ; 173 260de: 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(); 260e0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 260e4: 84 30 cpi r24, 0x04 ; 4 260e6: 08 f0 brcs .+2 ; 0x260ea 260e8: 95 c1 rjmp .+810 ; 0x26414 260ea: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 260ee: 88 eb ldi r24, 0xB8 ; 184 260f0: 9d e3 ldi r25, 0x3D ; 61 260f2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 260f6: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR("Firmware:")); 260fa: 8a e6 ldi r24, 0x6A ; 106 260fc: 92 ea ldi r25, 0xA2 ; 162 260fe: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 26102: 8d e5 ldi r24, 0x5D ; 93 26104: 92 ea ldi r25, 0xA2 ; 162 26106: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 2610a: 8f e4 ldi r24, 0x4F ; 79 2610c: 92 ea ldi r25, 0xA2 ; 162 2610e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 26112: 8f e3 ldi r24, 0x3F ; 63 26114: 92 ea ldi r25, 0xA2 ; 162 26116: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 2611a: 84 e7 ldi r24, 0x74 ; 116 2611c: 9f e6 ldi r25, 0x6F ; 111 2611e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 26122: 82 e6 ldi r24, 0x62 ; 98 26124: 9f e6 ldi r25, 0x6F ; 111 26126: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 2612a: 81 e5 ldi r24, 0x51 ; 81 2612c: 9f e6 ldi r25, 0x6F ; 111 2612e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(STR_SEPARATOR); 26132: 81 e1 ldi r24, 0x11 ; 17 26134: 9c e8 ldi r25, 0x8C ; 140 26136: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 2613a: 83 e3 ldi r24, 0x33 ; 51 2613c: 92 ea ldi r25, 0xA2 ; 162 2613e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 26142: 89 e2 ldi r24, 0x29 ; 41 26144: 92 ea ldi r25, 0xA2 ; 162 26146: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 2614a: 81 e2 ldi r24, 0x21 ; 33 2614c: 92 ea ldi r25, 0xA2 ; 162 2614e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(STR_SEPARATOR); 26152: 81 e1 ldi r24, 0x11 ; 17 26154: 9c e8 ldi r25, 0x8C ; 140 26156: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(_T(MSG_DATE)); 2615a: 8e e1 ldi r24, 0x1E ; 30 2615c: 9b e4 ldi r25, 0x4B ; 75 2615e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26162: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 26166: 86 e1 ldi r24, 0x16 ; 22 26168: 92 ea ldi r25, 0xA2 ; 162 2616a: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 2616e: 81 e1 ldi r24, 0x11 ; 17 26170: 9c e8 ldi r25, 0x8C ; 140 26172: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR("Fil. sensor v.:")); 26176: 86 e0 ldi r24, 0x06 ; 6 26178: 92 ea ldi r25, 0xA2 ; 162 2617a: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(fsensor.getIRVersionText()); 2617e: 0f 94 e7 7c call 0x2f9ce ; 0x2f9ce 26182: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 26186: 81 e1 ldi r24, 0x11 ; 17 26188: 9c e8 ldi r25, 0x8C ; 140 2618a: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 if (MMU2::mmu2.Enabled()) 2618e: 80 91 96 13 lds r24, 0x1396 ; 0x801396 26192: 81 30 cpi r24, 0x01 ; 1 26194: 09 f0 breq .+2 ; 0x26198 26196: 39 c1 rjmp .+626 ; 0x2640a { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 26198: 8e e0 ldi r24, 0x0E ; 14 2619a: 9b e4 ldi r25, 0x4B ; 75 2619c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 261a0: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 261a4: 81 e0 ldi r24, 0x01 ; 1 261a6: 92 ea ldi r25, 0xA2 ; 162 261a8: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 if (((menu_item - 1) == menu_line) && lcd_draw_update) 261ac: 80 91 16 05 lds r24, 0x0516 ; 0x800516 261b0: 81 50 subi r24, 0x01 ; 1 261b2: 99 0b sbc r25, r25 261b4: 20 91 15 05 lds r18, 0x0515 ; 0x800515 261b8: 28 17 cp r18, r24 261ba: 19 06 cpc r1, r25 261bc: 49 f5 brne .+82 ; 0x26210 261be: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 261c2: 88 23 and r24, r24 261c4: 29 f1 breq .+74 ; 0x26210 { lcd_set_cursor(6, menu_row); 261c6: 60 91 13 05 lds r22, 0x0513 ; 0x800513 261ca: 86 e0 ldi r24, 0x06 ; 6 261cc: 0e 94 8d 6f call 0xdf1a ; 0xdf1a 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) { 261d0: 80 91 96 13 lds r24, 0x1396 ; 0x801396 261d4: 81 30 cpi r24, 0x01 ; 1 261d6: 09 f0 breq .+2 ; 0x261da 261d8: 11 c1 rjmp .+546 ; 0x263fc 261da: 80 91 76 13 lds r24, 0x1376 ; 0x801376 261de: 90 91 77 13 lds r25, 0x1377 ; 0x801377 261e2: 20 91 78 13 lds r18, 0x1378 ; 0x801378 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 261e6: 88 23 and r24, r24 261e8: 09 f4 brne .+2 ; 0x261ec 261ea: 08 c1 rjmp .+528 ; 0x263fc lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 261ec: 1f 92 push r1 261ee: 2f 93 push r18 261f0: 1f 92 push r1 261f2: 9f 93 push r25 261f4: 1f 92 push r1 261f6: 8f 93 push r24 261f8: ff 92 push r15 261fa: ef 92 push r14 261fc: 0e 94 66 6f call 0xdecc ; 0xdecc 26200: 8d b7 in r24, 0x3d ; 61 26202: 9e b7 in r25, 0x3e ; 62 26204: 08 96 adiw r24, 0x08 ; 8 26206: 0f b6 in r0, 0x3f ; 63 26208: f8 94 cli 2620a: 9e bf out 0x3e, r25 ; 62 2620c: 0f be out 0x3f, r0 ; 63 2620e: 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) { 26210: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 26214: 88 23 and r24, r24 26216: 09 f4 brne .+2 ; 0x2621a 26218: 40 c0 rjmp .+128 ; 0x2629a MENU_ITEM_BACK_P(STR_SEPARATOR); 2621a: 81 e1 ldi r24, 0x11 ; 17 2621c: 9c e8 ldi r25, 0x8C ; 140 2621e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 26222: 87 ed ldi r24, 0xD7 ; 215 26224: 91 ea ldi r25, 0xA1 ; 161 26226: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(" ")); 2622a: 85 ed ldi r24, 0xD5 ; 213 2622c: 91 ea ldi r25, 0xA1 ; 161 2622e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 26232: 80 91 16 05 lds r24, 0x0516 ; 0x800516 26236: 81 50 subi r24, 0x01 ; 1 26238: 99 0b sbc r25, r25 2623a: 20 91 15 05 lds r18, 0x0515 ; 0x800515 2623e: 28 17 cp r18, r24 26240: 19 06 cpc r1, r25 26242: 59 f5 brne .+86 ; 0x2629a 26244: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 26248: 88 23 and r24, r24 2624a: 39 f1 breq .+78 ; 0x2629a lcd_set_cursor(2, menu_row); 2624c: 60 91 13 05 lds r22, 0x0513 ; 0x800513 26250: 82 e0 ldi r24, 0x02 ; 2 26252: 0e 94 8d 6f call 0xdf1a ; 0xdf1a 26256: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 2625a: 1f 92 push r1 2625c: 8f 93 push r24 2625e: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 26262: 1f 92 push r1 26264: 8f 93 push r24 26266: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 2626a: 1f 92 push r1 2626c: 8f 93 push r24 2626e: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 26272: 1f 92 push r1 26274: 8f 93 push r24 26276: df 93 push r29 26278: cf 93 push r28 2627a: 1f 93 push r17 2627c: 0f 93 push r16 2627e: 0f 94 a0 dc call 0x3b940 ; 0x3b940 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 26282: 8d ea ldi r24, 0xAD ; 173 26284: 93 e0 ldi r25, 0x03 ; 3 26286: 0e 94 94 71 call 0xe328 ; 0xe328 2628a: 8d b7 in r24, 0x3d ; 61 2628c: 9e b7 in r25, 0x3e ; 62 2628e: 0c 96 adiw r24, 0x0c ; 12 26290: 0f b6 in r0, 0x3f ; 63 26292: f8 94 cli 26294: 9e bf out 0x3e, r25 ; 62 26296: 0f be out 0x3f, r0 ; 63 26298: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 2629a: 80 91 59 06 lds r24, 0x0659 ; 0x800659 2629e: 90 91 5a 06 lds r25, 0x065A ; 0x80065a 262a2: a0 91 5b 06 lds r26, 0x065B ; 0x80065b 262a6: b0 91 5c 06 lds r27, 0x065C ; 0x80065c 262aa: 89 2b or r24, r25 262ac: 8a 2b or r24, r26 262ae: 8b 2b or r24, r27 262b0: 09 f4 brne .+2 ; 0x262b4 262b2: 42 c0 rjmp .+132 ; 0x26338 MENU_ITEM_BACK_P(STR_SEPARATOR); 262b4: 81 e1 ldi r24, 0x11 ; 17 262b6: 9c e8 ldi r25, 0x8C ; 140 262b8: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 262bc: 81 ef ldi r24, 0xF1 ; 241 262be: 9a e4 ldi r25, 0x4A ; 74 262c0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 262c4: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_BACK_P(PSTR(" ")); 262c8: 83 ed ldi r24, 0xD3 ; 211 262ca: 91 ea ldi r25, 0xA1 ; 161 262cc: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 262d0: 80 91 16 05 lds r24, 0x0516 ; 0x800516 262d4: 81 50 subi r24, 0x01 ; 1 262d6: 99 0b sbc r25, r25 262d8: 20 91 15 05 lds r18, 0x0515 ; 0x800515 262dc: 28 17 cp r18, r24 262de: 19 06 cpc r1, r25 262e0: 59 f5 brne .+86 ; 0x26338 262e2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 262e6: 88 23 and r24, r24 262e8: 39 f1 breq .+78 ; 0x26338 lcd_set_cursor(2, menu_row); 262ea: 60 91 13 05 lds r22, 0x0513 ; 0x800513 262ee: 82 e0 ldi r24, 0x02 ; 2 262f0: 0e 94 8d 6f call 0xdf1a ; 0xdf1a 262f4: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 262f8: 1f 92 push r1 262fa: 8f 93 push r24 262fc: 80 91 5b 06 lds r24, 0x065B ; 0x80065b 26300: 1f 92 push r1 26302: 8f 93 push r24 26304: 80 91 5a 06 lds r24, 0x065A ; 0x80065a 26308: 1f 92 push r1 2630a: 8f 93 push r24 2630c: 80 91 59 06 lds r24, 0x0659 ; 0x800659 26310: 1f 92 push r1 26312: 8f 93 push r24 26314: df 93 push r29 26316: cf 93 push r28 26318: 1f 93 push r17 2631a: 0f 93 push r16 2631c: 0f 94 a0 dc call 0x3b940 ; 0x3b940 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 26320: 8d ea ldi r24, 0xAD ; 173 26322: 93 e0 ldi r25, 0x03 ; 3 26324: 0e 94 94 71 call 0xe328 ; 0xe328 26328: 8d b7 in r24, 0x3d ; 61 2632a: 9e b7 in r25, 0x3e ; 62 2632c: 0c 96 adiw r24, 0x0c ; 12 2632e: 0f b6 in r0, 0x3f ; 63 26330: f8 94 cli 26332: 9e bf out 0x3e, r25 ; 62 26334: 0f be out 0x3f, r0 ; 63 26336: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 26338: 81 e1 ldi r24, 0x11 ; 17 2633a: 9c e8 ldi r25, 0x8C ; 140 2633c: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 26340: 8e ed ldi r24, 0xDE ; 222 26342: 9a e4 ldi r25, 0x4A ; 74 26344: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26348: 6b ec ldi r22, 0xCB ; 203 2634a: 7a e3 ldi r23, 0x3A ; 58 2634c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 26350: 8e ec ldi r24, 0xCE ; 206 26352: 9a e4 ldi r25, 0x4A ; 74 26354: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26358: 69 e4 ldi r22, 0x49 ; 73 2635a: 7a e3 ldi r23, 0x3A ; 58 2635c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 26360: 80 ec ldi r24, 0xC0 ; 192 26362: 9a e4 ldi r25, 0x4A ; 74 26364: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26368: 6f ef ldi r22, 0xFF ; 255 2636a: 79 e3 ldi r23, 0x39 ; 57 2636c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 26370: 82 eb ldi r24, 0xB2 ; 178 26372: 9a e4 ldi r25, 0x4A ; 74 26374: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26378: 61 e0 ldi r22, 0x01 ; 1 2637a: 7a e3 ldi r23, 0x3A ; 58 2637c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 26380: 83 ea ldi r24, 0xA3 ; 163 26382: 9a e4 ldi r25, 0x4A ; 74 26384: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26388: 6d e6 ldi r22, 0x6D ; 109 2638a: 79 e3 ldi r23, 0x39 ; 57 2638c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 26390: 88 e9 ldi r24, 0x98 ; 152 26392: 9a e4 ldi r25, 0x4A ; 74 26394: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26398: 6b e6 ldi r22, 0x6B ; 107 2639a: 7b e3 ldi r23, 0x3B ; 59 2639c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 263a0: 67 e9 ldi r22, 0x97 ; 151 263a2: 7a e3 ldi r23, 0x3A ; 58 263a4: 85 e4 ldi r24, 0x45 ; 69 263a6: 9f e6 ldi r25, 0x6F ; 111 263a8: 0f 94 85 ce call 0x39d0a ; 0x39d0a 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(); 263ac: 0f 94 dc ce call 0x39db8 ; 0x39db8 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 263b0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 263b4: 8f 5f subi r24, 0xFF ; 255 263b6: 80 93 13 05 sts 0x0513, r24 ; 0x800513 263ba: 80 91 15 05 lds r24, 0x0515 ; 0x800515 263be: 8f 5f subi r24, 0xFF ; 255 263c0: 80 93 15 05 sts 0x0515, r24 ; 0x800515 263c4: 8d ce rjmp .-742 ; 0x260e0 _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) 263c6: 90 91 a8 03 lds r25, 0x03A8 ; 0x8003a8 263ca: 99 23 and r25, r25 263cc: 09 f4 brne .+2 ; 0x263d0 263ce: 7c ce rjmp .-776 ; 0x260c8 263d0: 40 91 a9 03 lds r20, 0x03A9 ; 0x8003a9 263d4: 50 91 aa 03 lds r21, 0x03AA ; 0x8003aa 263d8: 60 91 ab 03 lds r22, 0x03AB ; 0x8003ab 263dc: 70 91 ac 03 lds r23, 0x03AC ; 0x8003ac 263e0: 45 2b or r20, r21 263e2: 46 2b or r20, r22 263e4: 47 2b or r20, r23 263e6: 09 f0 breq .+2 ; 0x263ea 263e8: 6f ce rjmp .-802 ; 0x260c8 263ea: 8f 5f subi r24, 0xFF ; 255 263ec: 80 31 cpi r24, 0x10 ; 16 263ee: 19 f0 breq .+6 ; 0x263f6 263f0: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 263f4: 69 ce rjmp .-814 ; 0x260c8 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 263f6: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 263fa: 66 ce rjmp .-820 ; 0x260c8 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)); 263fc: 84 e0 ldi r24, 0x04 ; 4 263fe: 9b e4 ldi r25, 0x4B ; 75 26400: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26404: 0e 94 78 6f call 0xdef0 ; 0xdef0 26408: 03 cf rjmp .-506 ; 0x26210 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 2640a: 89 ee ldi r24, 0xE9 ; 233 2640c: 91 ea ldi r25, 0xA1 ; 161 2640e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 26412: fe ce rjmp .-516 ; 0x26210 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 26414: df 91 pop r29 26416: cf 91 pop r28 26418: 1f 91 pop r17 2641a: 0f 91 pop r16 2641c: ff 90 pop r15 2641e: ef 90 pop r14 26420: 08 95 ret 00026422 : { 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) { 26422: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 26426: 81 11 cpse r24, r1 26428: 19 c0 rjmp .+50 ; 0x2645c lcd_clear(); 2642a: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 2642e: 87 e1 ldi r24, 0x17 ; 23 26430: 9a e4 ldi r25, 0x4A ; 74 26432: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26436: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc(':'); 2643a: 8a e3 ldi r24, 0x3A ; 58 2643c: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_set_cursor(10, 1); 26440: 61 e0 ldi r22, 0x01 ; 1 26442: 8a e0 ldi r24, 0x0A ; 10 26444: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 26448: 88 ea ldi r24, 0xA8 ; 168 2644a: 9c e0 ldi r25, 0x0C ; 12 2644c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 26450: 4a e0 ldi r20, 0x0A ; 10 26452: 0e 94 e1 70 call 0xe1c2 ; 0xe1c2 _md->initialized = true; 26456: 81 e0 ldi r24, 0x01 ; 1 26458: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } menu_back_if_clicked(); 2645c: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 00026460 : } 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){ 26460: 0f 93 push r16 26462: 1f 93 push r17 26464: cf 93 push r28 26466: df 93 push r29 26468: ec 01 movw r28, r24 2646a: cb 01 movw r24, r22 2646c: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 2646e: 4a 81 ldd r20, Y+2 ; 0x02 26470: 41 30 cpi r20, 0x01 ; 1 26472: 29 f0 breq .+10 ; 0x2647e 26474: 88 f0 brcs .+34 ; 0x26498 26476: 42 30 cpi r20, 0x02 ; 2 26478: 09 f1 breq .+66 ; 0x264bc 2647a: 43 30 cpi r20, 0x03 ; 3 2647c: d1 f4 brne .+52 ; 0x264b2 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 ){ 2647e: 8b 81 ldd r24, Y+3 ; 0x03 26480: 81 11 cpse r24, r1 26482: 25 c0 rjmp .+74 ; 0x264ce state = next_state; // advance to the next state 26484: 82 e0 ldi r24, 0x02 ; 2 26486: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 26488: 63 e0 ldi r22, 0x03 ; 3 2648a: 83 ed ldi r24, 0xD3 ; 211 2648c: 9e e9 ldi r25, 0x9E ; 158 2648e: 0f 94 bf 06 call 0x20d7e ; 0x20d7e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 26492: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 26494: 8b 83 std Y+3, r24 ; 0x03 26496: 0d c0 rjmp .+26 ; 0x264b2 //! @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 ){ 26498: a9 01 movw r20, r18 2649a: 98 01 movw r18, r16 2649c: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 264a0: 18 16 cp r1, r24 264a2: 3c f4 brge .+14 ; 0x264b2 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 264a4: 63 e0 ldi r22, 0x03 ; 3 264a6: 88 81 ld r24, Y 264a8: 99 81 ldd r25, Y+1 ; 0x01 264aa: 0f 94 bf 06 call 0x20d7e ; 0x20d7e state = States::TempAboveMintemp; 264ae: 81 e0 ldi r24, 0x01 ; 1 264b0: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 264b2: df 91 pop r29 264b4: cf 91 pop r28 264b6: 1f 91 pop r17 264b8: 0f 91 pop r16 264ba: 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 ){ 264bc: 8b 81 ldd r24, Y+3 ; 0x03 264be: 81 11 cpse r24, r1 264c0: 06 c0 rjmp .+12 ; 0x264ce 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); 264c2: 88 81 ld r24, Y 264c4: 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 264c6: 23 e0 ldi r18, 0x03 ; 3 264c8: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 264ca: 63 e0 ldi r22, 0x03 ; 3 264cc: e0 cf rjmp .-64 ; 0x2648e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 264ce: 81 50 subi r24, 0x01 ; 1 264d0: e1 cf rjmp .-62 ; 0x26494 000264d2 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 264d2: cf 93 push r28 if(IsStopped() == false) { 264d4: 90 91 12 05 lds r25, 0x0512 ; 0x800512 264d8: 91 11 cpse r25, r1 264da: 18 c0 rjmp .+48 ; 0x2650c 264dc: c6 2f mov r28, r22 if (isPreheat) { 264de: 88 23 and r24, r24 264e0: c9 f0 breq .+50 ; 0x26514 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 264e2: 87 e7 ldi r24, 0x77 ; 119 264e4: 9e e9 ldi r25, 0x9E ; 158 264e6: 66 23 and r22, r22 264e8: 11 f0 breq .+4 ; 0x264ee 264ea: 85 e8 ldi r24, 0x85 ; 133 264ec: 9e e9 ldi r25, 0x9E ; 158 264ee: 63 e0 ldi r22, 0x03 ; 3 264f0: 0f 94 bf 06 call 0x20d7e ; 0x20d7e SERIAL_ERROR_START; 264f4: 8a eb ldi r24, 0xBA ; 186 264f6: 99 ea ldi r25, 0xA9 ; 169 264f8: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 264fc: 84 e5 ldi r24, 0x54 ; 84 264fe: 9e e9 ldi r25, 0x9E ; 158 { if(IsStopped() == false) { if (isPreheat) { lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 26500: c1 11 cpse r28, r1 26502: 02 c0 rjmp .+4 ; 0x26508 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 26504: 82 e3 ldi r24, 0x32 ; 50 26506: 9e e9 ldi r25, 0x9E ; 158 lcd_setalertstatuspgm(isBed? PSTR("BED THERMAL RUNAWAY") : PSTR("THERMAL RUNAWAY"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 26508: 0e 94 fe 7a call 0xf5fc ; 0xf5fc } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 2650c: 80 e0 ldi r24, 0x00 ; 0 } 2650e: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 26510: 0c 94 2f 7b jmp 0xf65e ; 0xf65e 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); 26514: 8e e0 ldi r24, 0x0E ; 14 26516: 9e e9 ldi r25, 0x9E ; 158 26518: 66 23 and r22, r22 2651a: 11 f0 breq .+4 ; 0x26520 2651c: 8e e1 ldi r24, 0x1E ; 30 2651e: 9e e9 ldi r25, 0x9E ; 158 26520: 63 e0 ldi r22, 0x03 ; 3 26522: 0f 94 bf 06 call 0x20d7e ; 0x20d7e SERIAL_ERROR_START; 26526: 8a eb ldi r24, 0xBA ; 186 26528: 99 ea ldi r25, 0xA9 ; 169 2652a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 2652e: 85 ef ldi r24, 0xF5 ; 245 26530: 9d e9 ldi r25, 0x9D ; 157 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); } } else { lcd_setalertstatuspgm(isBed? PSTR("BED THERMAL RUNAWAY") : PSTR("THERMAL RUNAWAY"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 26532: c1 11 cpse r28, r1 26534: e9 cf rjmp .-46 ; 0x26508 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 26536: 8d ed ldi r24, 0xDD ; 221 26538: 9d e9 ldi r25, 0x9D ; 157 2653a: e6 cf rjmp .-52 ; 0x26508 0002653c : } } static void Sound_DoSound_Prompt(void) { backlight_wake(2); 2653c: 82 e0 ldi r24, 0x02 ; 2 2653e: 0e 94 98 8b call 0x11730 ; 0x11730 WRITE(BEEPER,HIGH); 26542: 9f b7 in r25, 0x3f ; 63 26544: f8 94 cli 26546: e2 e0 ldi r30, 0x02 ; 2 26548: f1 e0 ldi r31, 0x01 ; 1 2654a: 80 81 ld r24, Z 2654c: 84 60 ori r24, 0x04 ; 4 2654e: 80 83 st Z, r24 26550: 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); 26552: 2f ef ldi r18, 0xFF ; 255 26554: 89 e6 ldi r24, 0x69 ; 105 26556: 98 e1 ldi r25, 0x18 ; 24 26558: 21 50 subi r18, 0x01 ; 1 2655a: 80 40 sbci r24, 0x00 ; 0 2655c: 90 40 sbci r25, 0x00 ; 0 2655e: e1 f7 brne .-8 ; 0x26558 26560: 00 c0 rjmp .+0 ; 0x26562 26562: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 26564: 9f b7 in r25, 0x3f ; 63 26566: f8 94 cli 26568: 80 81 ld r24, Z 2656a: 8b 7f andi r24, 0xFB ; 251 2656c: 80 83 st Z, r24 2656e: 9f bf out 0x3f, r25 ; 63 } 26570: 08 95 ret 00026572 : 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() { 26572: cf 93 push r28 26574: 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); 26576: 80 91 38 02 lds r24, 0x0238 ; 0x800238 2657a: 88 23 and r24, r24 2657c: 89 f0 breq .+34 ; 0x265a0 2657e: 88 e4 ldi r24, 0x48 ; 72 26580: 9d e5 ldi r25, 0x5D ; 93 26582: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26586: ec 01 movw r28, r24 26588: 8c e2 ldi r24, 0x2C ; 44 2658a: 97 e5 ldi r25, 0x57 ; 87 2658c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26590: 22 e0 ldi r18, 0x02 ; 2 26592: 43 e9 ldi r20, 0x93 ; 147 26594: 5a e3 ldi r21, 0x3A ; 58 26596: be 01 movw r22, r28 } 26598: df 91 pop r29 2659a: 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); 2659c: 0d 94 97 d0 jmp 0x3a12e ; 0x3a12e 265a0: 82 e4 ldi r24, 0x42 ; 66 265a2: 9d e5 ldi r25, 0x5D ; 93 265a4: ee cf rjmp .-36 ; 0x26582 000265a6 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 265a6: ef 92 push r14 265a8: ff 92 push r15 265aa: 0f 93 push r16 265ac: 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); 265ae: 81 e4 ldi r24, 0x41 ; 65 265b0: 97 e5 ldi r25, 0x57 ; 87 265b2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 265b6: 28 ec ldi r18, 0xC8 ; 200 265b8: e2 2e mov r14, r18 265ba: f1 2c mov r15, r1 265bc: 07 e2 ldi r16, 0x27 ; 39 265be: 11 e0 ldi r17, 0x01 ; 1 265c0: 30 e0 ldi r19, 0x00 ; 0 265c2: 20 e0 ldi r18, 0x00 ; 0 265c4: 40 e1 ldi r20, 0x10 ; 16 265c6: 6b e6 ldi r22, 0x6B ; 107 265c8: 7e e0 ldi r23, 0x0E ; 14 265ca: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 #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); 265ce: 86 e2 ldi r24, 0x26 ; 38 265d0: 97 e5 ldi r25, 0x57 ; 87 265d2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 265d6: 32 e3 ldi r19, 0x32 ; 50 265d8: e3 2e mov r14, r19 265da: f1 2c mov r15, r1 265dc: 08 e7 ldi r16, 0x78 ; 120 265de: 10 e0 ldi r17, 0x00 ; 0 265e0: 30 e0 ldi r19, 0x00 ; 0 265e2: 20 e0 ldi r18, 0x00 ; 0 265e4: 40 e1 ldi r20, 0x10 ; 16 265e6: 69 e6 ldi r22, 0x69 ; 105 265e8: 7e e0 ldi r23, 0x0E ; 14 265ea: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 265ee: 8a e1 ldi r24, 0x1A ; 26 265f0: 97 e5 ldi r25, 0x57 ; 87 265f2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 265f6: 4f e7 ldi r20, 0x7F ; 127 265f8: e4 2e mov r14, r20 265fa: f1 2c mov r15, r1 265fc: 0f ef ldi r16, 0xFF ; 255 265fe: 10 e0 ldi r17, 0x00 ; 0 26600: 30 e0 ldi r19, 0x00 ; 0 26602: 20 e0 ldi r18, 0x00 ; 0 26604: 48 e0 ldi r20, 0x08 ; 8 26606: 61 ee ldi r22, 0xE1 ; 225 26608: 73 e0 ldi r23, 0x03 ; 3 2660a: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 } 2660e: 1f 91 pop r17 26610: 0f 91 pop r16 26612: ff 90 pop r15 26614: ef 90 pop r14 26616: 08 95 ret 00026618 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 26618: cf 93 push r28 2661a: 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); 2661c: 8f ef ldi r24, 0xFF ; 255 2661e: 9f e0 ldi r25, 0x0F ; 15 26620: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 bool bDesync = tmc2130_mode ^ eeprom_mode; 26624: 90 91 6a 06 lds r25, 0x066A ; 0x80066a if (eeprom_mode == SILENT_MODE_NORMAL) 26628: 81 11 cpse r24, r1 2662a: 35 c0 rjmp .+106 ; 0x26696 { if (bDesync) 2662c: 99 23 and r25, r25 2662e: 11 f1 breq .+68 ; 0x26674 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 26630: 8c e2 ldi r24, 0x2C ; 44 26632: 9d e3 ldi r25, 0x3D ; 61 26634: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26638: 22 e0 ldi r18, 0x02 ; 2 2663a: 43 e9 ldi r20, 0x93 ; 147 2663c: 59 e3 ldi r21, 0x39 ; 57 2663e: 60 e7 ldi r22, 0x70 ; 112 26640: 74 ea ldi r23, 0xA4 ; 164 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 26642: 0f 94 97 d0 call 0x3a12e ; 0x3a12e } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 26646: 89 e6 ldi r24, 0x69 ; 105 26648: 9f e0 ldi r25, 0x0F ; 15 2664a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2664e: 88 23 and r24, r24 26650: f9 f0 breq .+62 ; 0x26690 26652: 88 e4 ldi r24, 0x48 ; 72 26654: 9d e5 ldi r25, 0x5D ; 93 26656: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2665a: ec 01 movw r28, r24 2665c: 8d e0 ldi r24, 0x0D ; 13 2665e: 97 e5 ldi r25, 0x57 ; 87 26660: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26664: 22 e0 ldi r18, 0x02 ; 2 26666: 49 ee ldi r20, 0xE9 ; 233 26668: 5a e3 ldi r21, 0x3A ; 58 2666a: 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 } } 2666c: df 91 pop r29 2666e: 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); 26670: 0d 94 97 d0 jmp 0x3a12e ; 0x3a12e { 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); 26674: 8c e7 ldi r24, 0x7C ; 124 26676: 97 e5 ldi r25, 0x57 ; 87 26678: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2667c: ec 01 movw r28, r24 2667e: 8c e2 ldi r24, 0x2C ; 44 26680: 9d e3 ldi r25, 0x3D ; 61 26682: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26686: 22 e0 ldi r18, 0x02 ; 2 26688: 43 e9 ldi r20, 0x93 ; 147 2668a: 59 e3 ldi r21, 0x39 ; 57 2668c: be 01 movw r22, r28 2668e: d9 cf rjmp .-78 ; 0x26642 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 26690: 82 e4 ldi r24, 0x42 ; 66 26692: 9d e5 ldi r25, 0x5D ; 93 26694: e0 cf rjmp .-64 ; 0x26656 } else { if (bDesync) 26696: 98 17 cp r25, r24 26698: a9 f0 breq .+42 ; 0x266c4 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 2669a: 8c e2 ldi r24, 0x2C ; 44 2669c: 9d e3 ldi r25, 0x3D ; 61 2669e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 266a2: 22 e0 ldi r18, 0x02 ; 2 266a4: 43 e9 ldi r20, 0x93 ; 147 266a6: 59 e3 ldi r21, 0x39 ; 57 266a8: 6b e6 ldi r22, 0x6B ; 107 266aa: 74 ea ldi r23, 0xA4 ; 164 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 266ac: 0f 94 97 d0 call 0x3a12e ; 0x3a12e } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 266b0: 8d e0 ldi r24, 0x0D ; 13 266b2: 97 e5 ldi r25, 0x57 ; 87 266b4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 266b8: 22 e0 ldi r18, 0x02 ; 2 266ba: 4b e6 ldi r20, 0x6B ; 107 266bc: 5a e3 ldi r21, 0x3A ; 58 266be: 70 e0 ldi r23, 0x00 ; 0 266c0: 60 e0 ldi r22, 0x00 ; 0 266c2: d4 cf rjmp .-88 ; 0x2666c { 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); 266c4: 83 e0 ldi r24, 0x03 ; 3 266c6: 97 e5 ldi r25, 0x57 ; 87 266c8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 266cc: ec 01 movw r28, r24 266ce: 8c e2 ldi r24, 0x2C ; 44 266d0: 9d e3 ldi r25, 0x3D ; 61 266d2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 266d6: 22 e0 ldi r18, 0x02 ; 2 266d8: 43 e9 ldi r20, 0x93 ; 147 266da: 59 e3 ldi r21, 0x39 ; 57 266dc: be 01 movw r22, r28 266de: e6 cf rjmp .-52 ; 0x266ac 000266e0 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 266e0: cf 93 push r28 266e2: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 266e4: 86 ed ldi r24, 0xD6 ; 214 266e6: 9e e0 ldi r25, 0x0E ; 14 266e8: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 266ec: 81 30 cpi r24, 0x01 ; 1 266ee: c1 f5 brne .+112 ; 0x26760 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 266f0: 88 e4 ldi r24, 0x48 ; 72 266f2: 9d e5 ldi r25, 0x5D ; 93 266f4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 266f8: 22 e0 ldi r18, 0x02 ; 2 266fa: 45 ed ldi r20, 0xD5 ; 213 266fc: 5a e3 ldi r21, 0x3A ; 58 266fe: bc 01 movw r22, r24 26700: 81 e4 ldi r24, 0x41 ; 65 26702: 90 e7 ldi r25, 0x70 ; 112 26704: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 26708: 8e ec ldi r24, 0xCE ; 206 2670a: 9e e0 ldi r25, 0x0E ; 14 2670c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 26710: 81 30 cpi r24, 0x01 ; 1 26712: 49 f5 brne .+82 ; 0x26766 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 26714: 88 e4 ldi r24, 0x48 ; 72 26716: 9d e5 ldi r25, 0x5D ; 93 MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ALWAYS), lcd_cutter_enabled); } #endif else { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_OFF), lcd_cutter_enabled); 26718: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2671c: ec 01 movw r28, r24 2671e: 8a ef ldi r24, 0xFA ; 250 26720: 96 e5 ldi r25, 0x56 ; 86 26722: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26726: 22 e0 ldi r18, 0x02 ; 2 26728: 47 e1 ldi r20, 0x17 ; 23 2672a: 5b e3 ldi r21, 0x3B ; 59 2672c: be 01 movw r22, r28 2672e: 0f 94 97 d0 call 0x3a12e ; 0x3a12e } #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); 26732: 89 ea ldi r24, 0xA9 ; 169 26734: 9d e0 ldi r25, 0x0D ; 13 26736: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2673a: 88 23 and r24, r24 2673c: b9 f0 breq .+46 ; 0x2676c 2673e: 83 e0 ldi r24, 0x03 ; 3 26740: 97 e5 ldi r25, 0x57 ; 87 26742: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26746: ec 01 movw r28, r24 26748: 8f ee ldi r24, 0xEF ; 239 2674a: 96 e5 ldi r25, 0x56 ; 86 2674c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26750: 22 e0 ldi r18, 0x02 ; 2 26752: 41 e1 ldi r20, 0x11 ; 17 26754: 5a e3 ldi r21, 0x3A ; 58 26756: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 26758: df 91 pop r29 2675a: 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); 2675c: 0d 94 97 d0 jmp 0x3a12e ; 0x3a12e #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); 26760: 82 e4 ldi r24, 0x42 ; 66 26762: 9d e5 ldi r25, 0x5D ; 93 26764: c7 cf rjmp .-114 ; 0x266f4 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); 26766: 82 e4 ldi r24, 0x42 ; 66 26768: 9d e5 ldi r25, 0x5D ; 93 2676a: d6 cf rjmp .-84 ; 0x26718 } #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); 2676c: 8c e7 ldi r24, 0x7C ; 124 2676e: 97 e5 ldi r25, 0x57 ; 87 26770: e8 cf rjmp .-48 ; 0x26742 00026772 : MENU_END(); } static void lcd_settings_menu() { 26772: 1f 93 push r17 26774: cf 93 push r28 26776: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 26778: 8f ef ldi r24, 0xFF ; 255 2677a: 9f e0 ldi r25, 0x0F ; 15 2677c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 26780: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 MENU_BEGIN(); 26784: 0f 94 08 cf call 0x39e10 ; 0x39e10 26788: 10 92 13 05 sts 0x0513, r1 ; 0x800513 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 2678c: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 2678e: 80 91 13 05 lds r24, 0x0513 ; 0x800513 26792: 84 30 cpi r24, 0x04 ; 4 26794: 08 f0 brcs .+2 ; 0x26798 26796: 5c c1 rjmp .+696 ; 0x26a50 26798: 10 92 16 05 sts 0x0516, r1 ; 0x800516 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2679c: 88 eb ldi r24, 0xB8 ; 184 2679e: 9d e3 ldi r25, 0x3D ; 61 267a0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 267a4: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 267a8: 87 ef ldi r24, 0xF7 ; 247 267aa: 97 e5 ldi r25, 0x57 ; 87 267ac: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 267b0: 63 ec ldi r22, 0xC3 ; 195 267b2: 74 ed ldi r23, 0xD4 ; 212 267b4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c if (!printer_active() || printingIsPaused()) 267b8: 0e 94 8e 68 call 0xd11c ; 0xd11c 267bc: 88 23 and r24, r24 267be: 21 f0 breq .+8 ; 0x267c8 267c0: 0e 94 32 68 call 0xd064 ; 0xd064 267c4: 88 23 and r24, r24 267c6: 81 f0 breq .+32 ; 0x267e8 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 267c8: 8b ee ldi r24, 0xEB ; 235 267ca: 97 e5 ldi r25, 0x57 ; 87 267cc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 267d0: 6d ea ldi r22, 0xAD ; 173 267d2: 79 e3 ldi r23, 0x39 ; 57 267d4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 267d8: 88 ed ldi r24, 0xD8 ; 216 267da: 97 e5 ldi r25, 0x57 ; 87 267dc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 267e0: 67 e7 ldi r22, 0x77 ; 119 267e2: 7b e6 ldi r23, 0x6B ; 107 267e4: 0f 94 fe cd call 0x39bfc ; 0x39bfc } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 267e8: 88 ec ldi r24, 0xC8 ; 200 267ea: 9c e3 ldi r25, 0x3C ; 60 267ec: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 267f0: 69 ed ldi r22, 0xD9 ; 217 267f2: 7a e3 ldi r23, 0x3A ; 58 267f4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #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); 267f8: 8c ea ldi r24, 0xAC ; 172 267fa: 9c e0 ldi r25, 0x0C ; 12 267fc: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 26800: 88 23 and r24, r24 26802: 09 f4 brne .+2 ; 0x26806 26804: ac c0 rjmp .+344 ; 0x2695e 26806: 88 e4 ldi r24, 0x48 ; 72 26808: 9d e5 ldi r25, 0x5D ; 93 2680a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2680e: 22 e0 ldi r18, 0x02 ; 2 26810: 4f e4 ldi r20, 0x4F ; 79 26812: 5a e3 ldi r21, 0x3A ; 58 26814: bc 01 movw r22, r24 26816: 82 eb ldi r24, 0xB2 ; 178 26818: 94 ea ldi r25, 0xA4 ; 164 2681a: 0f 94 97 d0 call 0x3a12e ; 0x3a12e if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 2681e: 8c ea ldi r24, 0xAC ; 172 26820: 9c e0 ldi r25, 0x0C ; 12 26822: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 26826: 88 23 and r24, r24 26828: 31 f0 breq .+12 ; 0x26836 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 2682a: 67 e7 ldi r22, 0x77 ; 119 2682c: 7a e3 ldi r23, 0x3A ; 58 2682e: 88 ea ldi r24, 0xA8 ; 168 26830: 94 ea ldi r25, 0xA4 ; 164 26832: 0f 94 85 ce call 0x39d0a ; 0x39d0a } if (MMU2::mmu2.Enabled()) 26836: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2683a: 81 30 cpi r24, 0x01 ; 1 2683c: 51 f4 brne .+20 ; 0x26852 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 2683e: 0f 94 70 33 call 0x266e0 ; 0x266e0 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 26842: 89 ec ldi r24, 0xC9 ; 201 26844: 97 e5 ldi r25, 0x57 ; 87 26846: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2684a: 60 ef ldi r22, 0xF0 ; 240 2684c: 78 ed ldi r23, 0xD8 ; 216 2684e: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } SETTINGS_FANS_CHECK(); 26852: 0f 94 b9 32 call 0x26572 ; 0x26572 SETTINGS_SILENT_MODE(); 26856: 0f 94 0c 33 call 0x26618 ; 0x26618 if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 2685a: 10 93 f6 03 sts 0x03F6, r17 ; 0x8003f6 MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 2685e: 8e eb ldi r24, 0xBE ; 190 26860: 97 e5 ldi r25, 0x57 ; 87 26862: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26866: 6b e0 ldi r22, 0x0B ; 11 26868: 7b e3 ldi r23, 0x3B ; 59 2686a: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } 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); 2686e: 89 e7 ldi r24, 0x79 ; 121 26870: 9a e3 ldi r25, 0x3A ; 58 26872: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26876: 6c e1 ldi r22, 0x1C ; 28 26878: 78 ed ldi r23, 0xD8 ; 216 2687a: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 2687e: 8c ea ldi r24, 0xAC ; 172 26880: 97 e5 ldi r25, 0x57 ; 87 26882: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26886: 6b ef ldi r22, 0xFB ; 251 26888: 7a e3 ldi r23, 0x3A ; 58 2688a: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 2688e: 20 e0 ldi r18, 0x00 ; 0 26890: 30 e0 ldi r19, 0x00 ; 0 26892: 40 e2 ldi r20, 0x20 ; 32 26894: 51 e4 ldi r21, 0x41 ; 65 26896: 60 91 97 03 lds r22, 0x0397 ; 0x800397 2689a: 70 91 98 03 lds r23, 0x0398 ; 0x800398 2689e: 80 91 99 03 lds r24, 0x0399 ; 0x800399 268a2: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 268a6: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 268aa: 87 fd sbrc r24, 7 268ac: 16 c0 rjmp .+44 ; 0x268da 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); 268ae: 8f ea ldi r24, 0xAF ; 175 268b0: 9f e0 ldi r25, 0x0F ; 15 268b2: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 268b6: 88 23 and r24, r24 268b8: 09 f4 brne .+2 ; 0x268bc 268ba: 54 c0 rjmp .+168 ; 0x26964 268bc: 88 e4 ldi r24, 0x48 ; 72 268be: 9d e5 ldi r25, 0x5D ; 93 268c0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 268c4: ec 01 movw r28, r24 268c6: 82 e3 ldi r24, 0x32 ; 50 268c8: 9a e3 ldi r25, 0x3A ; 58 268ca: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 268ce: 22 e0 ldi r18, 0x02 ; 2 268d0: 4d ed ldi r20, 0xDD ; 221 268d2: 59 e3 ldi r21, 0x39 ; 57 268d4: be 01 movw r22, r28 268d6: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #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); 268da: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 268de: 81 11 cpse r24, r1 268e0: 44 c0 rjmp .+136 ; 0x2696a 268e2: 82 e4 ldi r24, 0x42 ; 66 268e4: 9d e5 ldi r25, 0x5D ; 93 268e6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 268ea: ec 01 movw r28, r24 268ec: 81 ea ldi r24, 0xA1 ; 161 268ee: 97 e5 ldi r25, 0x57 ; 87 268f0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 268f4: 22 e0 ldi r18, 0x02 ; 2 268f6: 4d e1 ldi r20, 0x1D ; 29 268f8: 5b e3 ldi r21, 0x3B ; 59 268fa: be 01 movw r22, r28 268fc: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 26900: 0e 94 32 68 call 0xd064 ; 0xd064 26904: 81 11 cpse r24, r1 26906: 08 c0 rjmp .+16 ; 0x26918 26908: 8b e6 ldi r24, 0x6B ; 107 2690a: 9c e3 ldi r25, 0x3C ; 60 2690c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26910: 63 ee ldi r22, 0xE3 ; 227 26912: 79 e3 ldi r23, 0x39 ; 57 26914: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 26918: 8f e8 ldi r24, 0x8F ; 143 2691a: 97 e5 ldi r25, 0x57 ; 87 2691c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26920: 67 e2 ldi r22, 0x27 ; 39 26922: 7b e3 ldi r23, 0x3B ; 59 26924: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 26928: 80 91 dd 16 lds r24, 0x16DD ; 0x8016dd 2692c: 88 23 and r24, r24 2692e: 01 f1 breq .+64 ; 0x26970 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 26930: 85 e8 ldi r24, 0x85 ; 133 26932: 97 e5 ldi r25, 0x57 ; 87 26934: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26938: 22 e0 ldi r18, 0x02 ; 2 2693a: 4b e7 ldi r20, 0x7B ; 123 2693c: 5a e3 ldi r21, 0x3A ; 58 2693e: 61 e6 ldi r22, 0x61 ; 97 26940: 70 e7 ldi r23, 0x70 ; 112 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 26942: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 26946: 89 e0 ldi r24, 0x09 ; 9 26948: 9f e0 ldi r25, 0x0F ; 15 2694a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2694e: 88 23 and r24, r24 26950: e9 f0 breq .+58 ; 0x2698c 26952: 81 30 cpi r24, 0x01 ; 1 26954: 09 f4 brne .+2 ; 0x26958 26956: 6d c0 rjmp .+218 ; 0x26a32 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); 26958: 80 e3 ldi r24, 0x30 ; 48 2695a: 90 e4 ldi r25, 0x40 ; 64 2695c: 19 c0 rjmp .+50 ; 0x26990 #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); 2695e: 82 e4 ldi r24, 0x42 ; 66 26960: 9d e5 ldi r25, 0x5D ; 93 26962: 53 cf rjmp .-346 ; 0x2680a #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); 26964: 82 e4 ldi r24, 0x42 ; 66 26966: 9d e5 ldi r25, 0x5D ; 93 26968: ab cf rjmp .-170 ; 0x268c0 #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); 2696a: 88 e4 ldi r24, 0x48 ; 72 2696c: 9d e5 ldi r25, 0x5D ; 93 2696e: bb cf rjmp .-138 ; 0x268e6 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); 26970: 8c e7 ldi r24, 0x7C ; 124 26972: 97 e5 ldi r25, 0x57 ; 87 26974: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26978: ec 01 movw r28, r24 2697a: 85 e8 ldi r24, 0x85 ; 133 2697c: 97 e5 ldi r25, 0x57 ; 87 2697e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26982: 22 e0 ldi r18, 0x02 ; 2 26984: 4b e7 ldi r20, 0x7B ; 123 26986: 5a e3 ldi r21, 0x3A ; 58 26988: be 01 movw r22, r28 2698a: db cf rjmp .-74 ; 0x26942 #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; 2698c: 85 e7 ldi r24, 0x75 ; 117 2698e: 97 e5 ldi r25, 0x57 ; 87 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); 26990: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26994: ec 01 movw r28, r24 26996: 8e e6 ldi r24, 0x6E ; 110 26998: 97 e5 ldi r25, 0x57 ; 87 2699a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2699e: 22 e0 ldi r18, 0x02 ; 2 269a0: 43 e4 ldi r20, 0x43 ; 67 269a2: 5b e3 ldi r21, 0x3B ; 59 269a4: be 01 movw r22, r28 269a6: 0f 94 97 d0 call 0x3a12e ; 0x3a12e } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 269aa: 80 91 df 04 lds r24, 0x04DF ; 0x8004df 269ae: 82 30 cpi r24, 0x02 ; 2 269b0: 09 f4 brne .+2 ; 0x269b4 269b2: 45 c0 rjmp .+138 ; 0x26a3e 269b4: 83 30 cpi r24, 0x03 ; 3 269b6: 09 f4 brne .+2 ; 0x269ba 269b8: 45 c0 rjmp .+138 ; 0x26a44 269ba: 81 30 cpi r24, 0x01 ; 1 269bc: e9 f1 breq .+122 ; 0x26a38 269be: 81 ec ldi r24, 0xC1 ; 193 269c0: 9c e3 ldi r25, 0x3C ; 60 269c2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 269c6: ec 01 movw r28, r24 269c8: 89 eb ldi r24, 0xB9 ; 185 269ca: 9c e3 ldi r25, 0x3C ; 60 269cc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 269d0: 22 e0 ldi r18, 0x02 ; 2 269d2: 45 e6 ldi r20, 0x65 ; 101 269d4: 59 e3 ldi r21, 0x39 ; 57 269d6: be 01 movw r22, r28 269d8: 0f 94 97 d0 call 0x3a12e ; 0x3a12e #ifdef LCD_BL_PIN if (backlightSupport) 269dc: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 269e0: 88 23 and r24, r24 269e2: 41 f0 breq .+16 ; 0x269f4 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 269e4: 83 e9 ldi r24, 0x93 ; 147 269e6: 9c e3 ldi r25, 0x3C ; 60 269e8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 269ec: 63 e9 ldi r22, 0x93 ; 147 269ee: 77 ed ldi r23, 0xD7 ; 215 269f0: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } #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 269f4: 87 ea ldi r24, 0xA7 ; 167 269f6: 9c e0 ldi r25, 0x0C ; 12 269f8: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 269fc: 88 23 and r24, r24 269fe: 29 f1 breq .+74 ; 0x26a4a 26a00: 82 e7 ldi r24, 0x72 ; 114 26a02: 9d e3 ldi r25, 0x3D ; 61 26a04: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26a08: 22 e0 ldi r18, 0x02 ; 2 26a0a: 49 e5 ldi r20, 0x59 ; 89 26a0c: 52 ed ldi r21, 0xD2 ; 210 26a0e: bc 01 movw r22, r24 26a10: 84 e5 ldi r24, 0x54 ; 84 26a12: 90 e7 ldi r25, 0x70 ; 112 26a14: 0f 94 97 d0 call 0x3a12e ; 0x3a12e if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 26a18: 0f 94 dc ce call 0x39db8 ; 0x39db8 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 26a1c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 26a20: 8f 5f subi r24, 0xFF ; 255 26a22: 80 93 13 05 sts 0x0513, r24 ; 0x800513 26a26: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26a2a: 8f 5f subi r24, 0xFF ; 255 26a2c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 26a30: ae ce rjmp .-676 ; 0x2678e 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; 26a32: 83 e6 ldi r24, 0x63 ; 99 26a34: 97 e5 ldi r25, 0x57 ; 87 26a36: ac cf rjmp .-168 ; 0x26990 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 26a38: 82 eb ldi r24, 0xB2 ; 178 26a3a: 9c e3 ldi r25, 0x3C ; 60 26a3c: c2 cf rjmp .-124 ; 0x269c2 26a3e: 89 ea ldi r24, 0xA9 ; 169 26a40: 9c e3 ldi r25, 0x3C ; 60 26a42: bf cf rjmp .-130 ; 0x269c2 26a44: 80 ea ldi r24, 0xA0 ; 160 26a46: 9c e3 ldi r25, 0x3C ; 60 26a48: bc cf rjmp .-136 ; 0x269c2 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 26a4a: 88 e7 ldi r24, 0x78 ; 120 26a4c: 9d e3 ldi r25, 0x3D ; 61 26a4e: da cf rjmp .-76 ; 0x26a04 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 26a50: df 91 pop r29 26a52: cf 91 pop r28 26a54: 1f 91 pop r17 26a56: 08 95 ret 00026a58 : //! @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) { 26a58: cf 92 push r12 26a5a: df 92 push r13 26a5c: ef 92 push r14 26a5e: ff 92 push r15 26a60: 0f 93 push r16 26a62: 1f 93 push r17 26a64: cf 93 push r28 26a66: df 93 push r29 26a68: d8 2f mov r29, r24 26a6a: 6b 01 movw r12, r22 26a6c: 7a 01 movw r14, r20 26a6e: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 26a70: 40 e2 ldi r20, 0x20 ; 32 26a72: 81 11 cpse r24, r1 26a74: 01 c0 rjmp .+2 ; 0x26a78 26a76: 4e e3 ldi r20, 0x3E ; 62 26a78: 63 e0 ldi r22, 0x03 ; 3 26a7a: 80 e0 ldi r24, 0x00 ; 0 26a7c: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_puts_P(first_choice); 26a80: c6 01 movw r24, r12 26a82: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 26a86: 40 e2 ldi r20, 0x20 ; 32 26a88: d1 30 cpi r29, 0x01 ; 1 26a8a: 09 f4 brne .+2 ; 0x26a8e 26a8c: 4e e3 ldi r20, 0x3E ; 62 26a8e: 63 e0 ldi r22, 0x03 ; 3 26a90: 8c 2f mov r24, r28 26a92: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_puts_P(second_choice); 26a96: c7 01 movw r24, r14 26a98: 0e 94 78 6f call 0xdef0 ; 0xdef0 if (third_choice) { 26a9c: 01 15 cp r16, r1 26a9e: 11 05 cpc r17, r1 26aa0: 19 f1 breq .+70 ; 0x26ae8 26aa2: c8 01 movw r24, r16 26aa4: 0f 94 47 db call 0x3b68e ; 0x3b68e <__strlen_P> 26aa8: d8 2e mov r13, r24 26aaa: c7 01 movw r24, r14 26aac: 0f 94 47 db call 0x3b68e ; 0x3b68e <__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; 26ab0: 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;} 26ab2: 93 e1 ldi r25, 0x13 ; 19 26ab4: 9d 19 sub r25, r13 26ab6: 8c 0f add r24, r28 26ab8: 89 17 cp r24, r25 26aba: 08 f4 brcc .+2 ; 0x26abe 26abc: 89 2f mov r24, r25 26abe: 83 31 cpi r24, 0x13 ; 19 26ac0: 08 f0 brcs .+2 ; 0x26ac4 26ac2: 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 ? '>': ' '); 26ac4: 40 e2 ldi r20, 0x20 ; 32 26ac6: d2 30 cpi r29, 0x02 ; 2 26ac8: 09 f4 brne .+2 ; 0x26acc 26aca: 4e e3 ldi r20, 0x3E ; 62 26acc: 63 e0 ldi r22, 0x03 ; 3 26ace: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_puts_P(third_choice); 26ad2: c8 01 movw r24, r16 } } 26ad4: df 91 pop r29 26ad6: cf 91 pop r28 26ad8: 1f 91 pop r17 26ada: 0f 91 pop r16 26adc: ff 90 pop r15 26ade: ef 90 pop r14 26ae0: df 90 pop r13 26ae2: 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); 26ae4: 0c 94 78 6f jmp 0xdef0 ; 0xdef0 } } 26ae8: df 91 pop r29 26aea: cf 91 pop r28 26aec: 1f 91 pop r17 26aee: 0f 91 pop r16 26af0: ff 90 pop r15 26af2: ef 90 pop r14 26af4: df 90 pop r13 26af6: cf 90 pop r12 26af8: 08 95 ret 00026afa : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 26afa: cf 93 push r28 26afc: df 93 push r29 26afe: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 26b00: 80 e0 ldi r24, 0x00 ; 0 26b02: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_clear(); 26b06: 0e 94 c0 6f call 0xdf80 ; 0xdf80 return lcd_display_message_fullscreen_nonBlocking_P(msg); 26b0a: ce 01 movw r24, r28 } 26b0c: df 91 pop r29 26b0e: 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); 26b10: 0d 94 84 2c jmp 0x25908 ; 0x25908 00026b14 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 26b14: cf 92 push r12 26b16: df 92 push r13 26b18: ef 92 push r14 26b1a: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 26b1c: 80 e0 ldi r24, 0x00 ; 0 26b1e: 90 e0 ldi r25, 0x00 ; 0 26b20: a8 ec ldi r26, 0xC8 ; 200 26b22: b2 e4 ldi r27, 0x42 ; 66 26b24: 80 93 49 07 sts 0x0749, r24 ; 0x800749 26b28: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 26b2c: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 26b30: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 26b34: 65 e5 ldi r22, 0x55 ; 85 26b36: 75 e5 ldi r23, 0x55 ; 85 26b38: 85 e5 ldi r24, 0x55 ; 85 26b3a: 91 e4 ldi r25, 0x41 ; 65 26b3c: 0f 94 8b ba call 0x37516 ; 0x37516 delay_keep_alive(2000); 26b40: 80 ed ldi r24, 0xD0 ; 208 26b42: 97 e0 ldi r25, 0x07 ; 7 26b44: 0e 94 7f 8e call 0x11cfe ; 0x11cfe lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 26b48: 8c e6 ldi r24, 0x6C ; 108 26b4a: 9f e4 ldi r25, 0x4F ; 79 26b4c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26b50: 0f 94 7d 35 call 0x26afa ; 0x26afa return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 26b54: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 26b58: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 26b5c: 07 2e mov r0, r23 26b5e: 00 0c add r0, r0 26b60: 88 0b sbc r24, r24 26b62: 99 0b sbc r25, r25 26b64: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 26b68: 9b 01 movw r18, r22 26b6a: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 26b6c: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 26b70: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 26b74: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 26b78: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 26b7c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 26b80: 9f 77 andi r25, 0x7F ; 127 26b82: 20 e0 ldi r18, 0x00 ; 0 26b84: 30 e0 ldi r19, 0x00 ; 0 26b86: 40 ea ldi r20, 0xA0 ; 160 26b88: 50 e4 ldi r21, 0x40 ; 64 26b8a: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 26b8e: 18 16 cp r1, r24 26b90: b4 f5 brge .+108 ; 0x26bfe lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 26b92: 8c e6 ldi r24, 0x6C ; 108 26b94: 9f e4 ldi r25, 0x4F ; 79 26b96: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26b9a: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_set_cursor(0, 4); 26b9e: 64 e0 ldi r22, 0x04 ; 4 26ba0: 80 e0 ldi r24, 0x00 ; 0 26ba2: 0e 94 8d 6f call 0xdf1a ; 0xdf1a 26ba6: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 26baa: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 26bae: 07 2e mov r0, r23 26bb0: 00 0c add r0, r0 26bb2: 88 0b sbc r24, r24 26bb4: 99 0b sbc r25, r25 26bb6: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__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)); 26bba: 20 e0 ldi r18, 0x00 ; 0 26bbc: 30 e0 ldi r19, 0x00 ; 0 26bbe: 40 e0 ldi r20, 0x00 ; 0 26bc0: 5f e3 ldi r21, 0x3F ; 63 26bc2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 26bc6: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 26bca: 6b 01 movw r12, r22 26bcc: 20 e0 ldi r18, 0x00 ; 0 26bce: 30 e0 ldi r19, 0x00 ; 0 26bd0: 40 e0 ldi r20, 0x00 ; 0 26bd2: 5f e3 ldi r21, 0x3F ; 63 26bd4: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 26bd8: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 26bdc: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 26be0: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 26be4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 26be8: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 26bec: a6 01 movw r20, r12 26bee: 82 e8 ldi r24, 0x82 ; 130 26bf0: 0f 94 1a 2f call 0x25e34 ; 0x25e34 delay_keep_alive(1000); 26bf4: 88 ee ldi r24, 0xE8 ; 232 26bf6: 93 e0 ldi r25, 0x03 ; 3 26bf8: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 26bfc: ab cf rjmp .-170 ; 0x26b54 } } 26bfe: ff 90 pop r15 26c00: ef 90 pop r14 26c02: df 90 pop r13 26c04: cf 90 pop r12 26c06: 08 95 ret 00026c08 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 26c08: cf 92 push r12 26c0a: df 92 push r13 26c0c: ef 92 push r14 26c0e: ff 92 push r15 26c10: 0f 93 push r16 26c12: 1f 93 push r17 26c14: cf 93 push r28 26c16: df 93 push r29 26c18: d8 2e mov r13, r24 26c1a: 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) 26c1c: 01 e0 ldi r16, 0x01 ; 1 26c1e: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 26c22: 81 11 cpse r24, r1 26c24: 01 c0 rjmp .+2 ; 0x26c28 26c26: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 26c28: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 26c2c: 8d 2d mov r24, r13 26c2e: 9c 2d mov r25, r12 26c30: 0f 94 7d 35 call 0x26afa ; 0x26afa 26c34: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 26c36: 0e 94 a5 71 call 0xe34a ; 0xe34a KEEPALIVE_STATE(PAUSED_FOR_USER); 26c3a: 84 e0 ldi r24, 0x04 ; 4 26c3c: 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); 26c40: 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) { 26c42: 20 97 sbiw r28, 0x00 ; 0 26c44: 29 f4 brne .+10 ; 0x26c50 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 26c46: 49 e8 ldi r20, 0x89 ; 137 26c48: 63 e0 ldi r22, 0x03 ; 3 26c4a: 83 e1 ldi r24, 0x13 ; 19 26c4c: 0e 94 ad 6f call 0xdf5a ; 0xdf5a * @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); 26c50: 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); 26c52: 82 e3 ldi r24, 0x32 ; 50 26c54: 90 e0 ldi r25, 0x00 ; 0 26c56: 0e 94 7f 8e call 0x11cfe ; 0x11cfe if (lcd_clicked()) { 26c5a: 0e 94 aa 71 call 0xe354 ; 0xe354 26c5e: 88 23 and r24, r24 26c60: 81 f0 breq .+32 ; 0x26c82 if (msg_next == NULL) { 26c62: 20 97 sbiw r28, 0x00 ; 0 26c64: 81 f4 brne .+32 ; 0x26c86 KEEPALIVE_STATE(IN_HANDLER); 26c66: 82 e0 ldi r24, 0x02 ; 2 26c68: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 26c6c: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 26c70: df 91 pop r29 26c72: cf 91 pop r28 26c74: 1f 91 pop r17 26c76: 0f 91 pop r16 26c78: ff 90 pop r15 26c7a: ef 90 pop r14 26c7c: df 90 pop r13 26c7e: cf 90 pop r12 26c80: 08 95 ret 26c82: 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) { 26c84: 31 f7 brne .-52 ; 0x26c52 else { break; } } } if (multi_screen) { 26c86: e1 14 cp r14, r1 26c88: f1 04 cpc r15, r1 26c8a: d9 f2 breq .-74 ; 0x26c42 if (msg_next == NULL) 26c8c: 20 97 sbiw r28, 0x00 ; 0 26c8e: 11 f4 brne .+4 ; 0x26c94 msg_next = msg; 26c90: cd 2d mov r28, r13 26c92: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 26c94: ce 01 movw r24, r28 26c96: 0f 94 7d 35 call 0x26afa ; 0x26afa 26c9a: ec 01 movw r28, r24 26c9c: d2 cf rjmp .-92 ; 0x26c42 00026c9e : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 26c9e: cf 93 push r28 26ca0: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 26ca2: 8e e5 ldi r24, 0x5E ; 94 26ca4: 91 e5 ldi r25, 0x51 ; 81 26ca6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26caa: 0f 94 04 36 call 0x26c08 ; 0x26c08 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 26cae: 80 91 96 13 lds r24, 0x1396 ; 0x801396 26cb2: 81 30 cpi r24, 0x01 ; 1 26cb4: 69 f4 brne .+26 ; 0x26cd0 { lcd_show_fullscreen_message_and_wait_P( 26cb6: 85 e0 ldi r24, 0x05 ; 5 26cb8: 91 e5 ldi r25, 0x51 ; 81 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 26cba: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26cbe: 0f 94 04 36 call 0x26c08 ; 0x26c08 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 26cc2: 83 e3 ldi r24, 0x33 ; 51 26cc4: 90 e5 ldi r25, 0x50 ; 80 26cc6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 _T(MSG_WIZARD_V2_CAL_2)); } 26cca: 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( 26ccc: 0d 94 04 36 jmp 0x26c08 ; 0x26c08 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 26cd0: cc 23 and r28, r28 26cd2: b9 f3 breq .-18 ; 0x26cc2 { lcd_show_fullscreen_message_and_wait_P( 26cd4: 83 ed ldi r24, 0xD3 ; 211 26cd6: 90 e5 ldi r25, 0x50 ; 80 26cd8: f0 cf rjmp .-32 ; 0x26cba 00026cda : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 26cda: 80 91 96 13 lds r24, 0x1396 ; 0x801396 26cde: 81 30 cpi r24, 0x01 ; 1 26ce0: 71 f4 brne .+28 ; 0x26cfe lcd_show_fullscreen_message_and_wait_P( 26ce2: 8a ed ldi r24, 0xDA ; 218 26ce4: 9f e4 ldi r25, 0x4F ; 79 26ce6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26cea: 0f 94 04 36 call 0x26c08 ; 0x26c08 _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; 26cee: 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; 26cf0: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 26cf4: 61 e0 ldi r22, 0x01 ; 1 26cf6: 81 e5 ldi r24, 0x51 ; 81 26cf8: 94 ea ldi r25, 0xA4 ; 164 26cfa: 0c 94 43 89 jmp 0x11286 ; 0x11286 // 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( 26cfe: 8e e8 ldi r24, 0x8E ; 142 26d00: 9f e4 ldi r25, 0x4F ; 79 26d02: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26d06: 0f 94 04 36 call 0x26c08 ; 0x26c08 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 26d0a: 80 e0 ldi r24, 0x00 ; 0 26d0c: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_clear(); 26d10: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 26d14: 86 e7 ldi r24, 0x76 ; 118 26d16: 9c e5 ldi r25, 0x5C ; 92 26d18: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26d1c: ac 01 movw r20, r24 26d1e: 62 e0 ldi r22, 0x02 ; 2 26d20: 80 e0 ldi r24, 0x00 ; 0 26d22: 0e 94 a1 6f call 0xdf42 ; 0xdf42 eFilamentAction = FilamentAction::Load; 26d26: 81 e0 ldi r24, 0x01 ; 1 26d28: e3 cf rjmp .-58 ; 0x26cf0 00026d2a : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 26d2a: cf 93 push r28 26d2c: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 26d2e: 10 92 73 07 sts 0x0773, r1 ; 0x800773 disable_x(); 26d32: 17 9a sbi 0x02, 7 ; 2 26d34: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_y(); 26d38: 16 9a sbi 0x02, 6 ; 2 26d3a: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f disable_z(); disable_e0(); 26d3e: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 26d40: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 26d44: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 26d48: 68 2f mov r22, r24 26d4a: 86 ea ldi r24, 0xA6 ; 166 26d4c: 9f e0 ldi r25, 0x0F ; 15 26d4e: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 26d52: 6c 2f mov r22, r28 26d54: 8f ea ldi r24, 0xAF ; 175 26d56: 9f e0 ldi r25, 0x0F ; 15 26d58: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a // 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) { 26d5c: cc 23 and r28, r28 26d5e: 89 f0 breq .+34 ; 0x26d82 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 26d60: 86 e0 ldi r24, 0x06 ; 6 26d62: 94 ea ldi r25, 0xA4 ; 164 26d64: 0e 94 fe 7a call 0xf5fc ; 0xf5fc lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 26d68: 86 e8 ldi r24, 0x86 ; 134 26d6a: 9d e4 ldi r25, 0x4D ; 77 } else { SERIAL_ECHOLNPGM("PINDA calibration failed. Continue with pressing the knob."); lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 26d6c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26d70: 0f 94 04 36 call 0x26c08 ; 0x26c08 } lcd_update_enable(true); 26d74: 81 e0 ldi r24, 0x01 ; 1 26d76: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_update(2); 26d7a: 82 e0 ldi r24, 0x02 ; 2 } 26d7c: 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); 26d7e: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 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."); 26d82: 8b ec ldi r24, 0xCB ; 203 26d84: 93 ea ldi r25, 0xA3 ; 163 26d86: 0e 94 fe 7a call 0xf5fc ; 0xf5fc lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 26d8a: 8b e6 ldi r24, 0x6B ; 107 26d8c: 9d e4 ldi r25, 0x4D ; 77 26d8e: ee cf rjmp .-36 ; 0x26d6c 00026d90 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 26d90: 1f 93 push r17 26d92: cf 93 push r28 26d94: 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); 26d96: 64 e6 ldi r22, 0x64 ; 100 26d98: 70 e0 ldi r23, 0x00 ; 0 26d9a: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 26d9e: 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++) { 26da0: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 26da2: 4e e2 ldi r20, 0x2E ; 46 26da4: 63 e0 ldi r22, 0x03 ; 3 26da6: 81 2f mov r24, r17 26da8: 0e 94 ad 6f call 0xdf5a ; 0xdf5a //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 26dac: ce 01 movw r24, r28 26dae: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 26db2: ce 01 movw r24, r28 26db4: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 26db8: ce 01 movw r24, r28 26dba: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 26dbe: ce 01 movw r24, r28 26dc0: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 26dc4: ce 01 movw r24, r28 26dc6: 0e 94 7f 8e call 0x11cfe ; 0x11cfe } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 26dca: 1f 5f subi r17, 0xFF ; 255 26dcc: 14 31 cpi r17, 0x14 ; 20 26dce: 49 f7 brne .-46 ; 0x26da2 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 26dd0: df 91 pop r29 26dd2: cf 91 pop r28 26dd4: 1f 91 pop r17 26dd6: 08 95 ret 00026dd8 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 26dd8: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 26ddc: 08 95 ret 00026dde : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 26dde: cf 93 push r28 MENU_BEGIN(); 26de0: 0f 94 08 cf call 0x39e10 ; 0x39e10 26de4: 10 92 13 05 sts 0x0513, r1 ; 0x800513 26de8: 80 91 13 05 lds r24, 0x0513 ; 0x800513 26dec: 84 30 cpi r24, 0x04 ; 4 26dee: 08 f0 brcs .+2 ; 0x26df2 26df0: a1 c0 rjmp .+322 ; 0x26f34 26df2: 10 92 16 05 sts 0x0516, r1 ; 0x800516 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 26df6: 8f e5 ldi r24, 0x5F ; 95 26df8: 9f e0 ldi r25, 0x0F ; 15 26dfa: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 26dfe: 81 11 cpse r24, r1 26e00: 10 c0 rjmp .+32 ; 0x26e22 { ON_MENU_LEAVE( 26e02: 0f 94 88 cd call 0x39b10 ; 0x39b10 26e06: 81 11 cpse r24, r1 26e08: 0f 94 ec 36 call 0x26dd8 ; 0x26dd8 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 26e0c: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 26e10: 8a 30 cpi r24, 0x0A ; 10 26e12: 09 f4 brne .+2 ; 0x26e16 26e14: 8c c0 rjmp .+280 ; 0x26f2e 26e16: 88 eb ldi r24, 0xB8 ; 184 26e18: 9d e3 ldi r25, 0x3D ; 61 26e1a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26e1e: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 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(); 26e22: 0f 94 db 22 call 0x245b6 ; 0x245b6 26e26: 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); 26e28: 8e e6 ldi r24, 0x6E ; 110 26e2a: 93 ea ldi r25, 0xA3 ; 163 26e2c: cc 23 and r28, r28 26e2e: 11 f0 breq .+4 ; 0x26e34 26e30: 8d e7 ldi r24, 0x7D ; 125 26e32: 93 ea ldi r25, 0xA3 ; 163 26e34: 63 e1 ldi r22, 0x13 ; 19 26e36: 7a e3 ldi r23, 0x3A ; 58 26e38: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26e3c: 83 e5 ldi r24, 0x53 ; 83 26e3e: 93 ea ldi r25, 0xA3 ; 163 26e40: cc 23 and r28, r28 26e42: 11 f0 breq .+4 ; 0x26e48 26e44: 82 e6 ldi r24, 0x62 ; 98 26e46: 93 ea ldi r25, 0xA3 ; 163 26e48: 6b e2 ldi r22, 0x2B ; 43 26e4a: 7b e3 ldi r23, 0x3B ; 59 26e4c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26e50: 87 e3 ldi r24, 0x37 ; 55 26e52: 93 ea ldi r25, 0xA3 ; 163 26e54: cc 23 and r28, r28 26e56: 11 f0 breq .+4 ; 0x26e5c 26e58: 87 e4 ldi r24, 0x47 ; 71 26e5a: 93 ea ldi r25, 0xA3 ; 163 26e5c: 6d e1 ldi r22, 0x1D ; 29 26e5e: 7a e3 ldi r23, 0x3A ; 58 26e60: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26e64: 8b e1 ldi r24, 0x1B ; 27 26e66: 93 ea ldi r25, 0xA3 ; 163 26e68: cc 23 and r28, r28 26e6a: 11 f0 breq .+4 ; 0x26e70 26e6c: 8b e2 ldi r24, 0x2B ; 43 26e6e: 93 ea ldi r25, 0xA3 ; 163 26e70: 69 e3 ldi r22, 0x39 ; 57 26e72: 7b e3 ldi r23, 0x3B ; 59 26e74: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26e78: 80 e0 ldi r24, 0x00 ; 0 26e7a: 93 ea ldi r25, 0xA3 ; 163 26e7c: cc 23 and r28, r28 26e7e: 11 f0 breq .+4 ; 0x26e84 26e80: 8f e0 ldi r24, 0x0F ; 15 26e82: 93 ea ldi r25, 0xA3 ; 163 26e84: 63 e5 ldi r22, 0x53 ; 83 26e86: 7a e3 ldi r23, 0x3A ; 58 26e88: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26e8c: 85 ee ldi r24, 0xE5 ; 229 26e8e: 92 ea ldi r25, 0xA2 ; 162 26e90: cc 23 and r28, r28 26e92: 11 f0 breq .+4 ; 0x26e98 26e94: 84 ef ldi r24, 0xF4 ; 244 26e96: 92 ea ldi r25, 0xA2 ; 162 26e98: 6b ea ldi r22, 0xAB ; 171 26e9a: 79 e3 ldi r23, 0x39 ; 57 26e9c: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26ea0: 89 ec ldi r24, 0xC9 ; 201 26ea2: 92 ea ldi r25, 0xA2 ; 162 26ea4: cc 23 and r28, r28 26ea6: 11 f0 breq .+4 ; 0x26eac 26ea8: 89 ed ldi r24, 0xD9 ; 217 26eaa: 92 ea ldi r25, 0xA2 ; 162 26eac: 67 e6 ldi r22, 0x67 ; 103 26eae: 7b e3 ldi r23, 0x3B ; 59 26eb0: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26eb4: 8d ea ldi r24, 0xAD ; 173 26eb6: 92 ea ldi r25, 0xA2 ; 162 26eb8: cc 23 and r28, r28 26eba: 11 f0 breq .+4 ; 0x26ec0 26ebc: 8d eb ldi r24, 0xBD ; 189 26ebe: 92 ea ldi r25, 0xA2 ; 162 26ec0: 61 e6 ldi r22, 0x61 ; 97 26ec2: 79 e3 ldi r23, 0x39 ; 57 26ec4: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26ec8: 81 e9 ldi r24, 0x91 ; 145 26eca: 92 ea ldi r25, 0xA2 ; 162 26ecc: cc 23 and r28, r28 26ece: 11 f0 breq .+4 ; 0x26ed4 26ed0: 81 ea ldi r24, 0xA1 ; 161 26ed2: 92 ea ldi r25, 0xA2 ; 162 26ed4: 6f eb ldi r22, 0xBF ; 191 26ed6: 79 e3 ldi r23, 0x39 ; 57 26ed8: 0f 94 86 d1 call 0x3a30c ; 0x3a30c 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); 26edc: 86 e7 ldi r24, 0x76 ; 118 26ede: 92 ea ldi r25, 0xA2 ; 162 26ee0: cc 23 and r28, r28 26ee2: 11 f0 breq .+4 ; 0x26ee8 26ee4: 85 e8 ldi r24, 0x85 ; 133 26ee6: 92 ea ldi r25, 0xA2 ; 162 26ee8: 69 ea ldi r22, 0xA9 ; 169 26eea: 7a e3 ldi r23, 0x3A ; 58 26eec: 0f 94 86 d1 call 0x3a30c ; 0x3a30c } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 26ef0: 8f e5 ldi r24, 0x5F ; 95 26ef2: 9f e0 ldi r25, 0x0F ; 15 26ef4: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 26ef8: 81 11 cpse r24, r1 26efa: 0c c0 rjmp .+24 ; 0x26f14 26efc: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 26f00: 89 30 cpi r24, 0x09 ; 9 26f02: 41 f4 brne .+16 ; 0x26f14 26f04: 85 eb ldi r24, 0xB5 ; 181 26f06: 9b e4 ldi r25, 0x4B ; 75 26f08: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 26f0c: 6b eb ldi r22, 0xBB ; 187 26f0e: 7a e3 ldi r23, 0x3A ; 58 26f10: 0f 94 85 ce call 0x39d0a ; 0x39d0a MENU_END(); 26f14: 0f 94 dc ce call 0x39db8 ; 0x39db8 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 26f18: 80 91 13 05 lds r24, 0x0513 ; 0x800513 26f1c: 8f 5f subi r24, 0xFF ; 255 26f1e: 80 93 13 05 sts 0x0513, r24 ; 0x800513 26f22: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26f26: 8f 5f subi r24, 0xFF ; 255 26f28: 80 93 15 05 sts 0x0515, r24 ; 0x800515 26f2c: 5d cf rjmp .-326 ; 0x26de8 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)); 26f2e: 89 e1 ldi r24, 0x19 ; 25 26f30: 90 e4 ldi r25, 0x40 ; 64 26f32: 73 cf rjmp .-282 ; 0x26e1a 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(); } 26f34: cf 91 pop r28 26f36: 08 95 ret 00026f38 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 26f38: 89 e0 ldi r24, 0x09 ; 9 26f3a: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 lcd_generic_preheat_menu(); 26f3e: 0d 94 ef 36 jmp 0x26dde ; 0x26dde 00026f42 : // 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); 26f42: 81 e0 ldi r24, 0x01 ; 1 26f44: 0e 94 83 6f call 0xdf06 ; 0xdf06 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 26f48: 0f 94 d5 76 call 0x2edaa ; 0x2edaa 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; 26f4c: 90 91 7e 13 lds r25, 0x137E ; 0x80137e 26f50: 93 36 cpi r25, 0x63 ; 99 26f52: 09 f4 brne .+2 ; 0x26f56 26f54: 9f ef ldi r25, 0xFF ; 255 26f56: 89 13 cpse r24, r25 26f58: 0e c0 rjmp .+28 ; 0x26f76 lcd_putc('F'); 26f5a: 86 e4 ldi r24, 0x46 ; 70 26f5c: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26f60: 0f 94 d5 76 call 0x2edaa ; 0x2edaa 26f64: 8f 3f cpi r24, 0xFF ; 255 26f66: 29 f0 breq .+10 ; 0x26f72 26f68: 8f 5c subi r24, 0xCF ; 207 26f6a: 0e 94 7c 6f call 0xdef8 ; 0xdef8 26f6e: 83 e0 ldi r24, 0x03 ; 3 26f70: 08 95 ret 26f72: 8f e3 ldi r24, 0x3F ; 63 26f74: fa cf rjmp .-12 ; 0x26f6a chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26f76: 8f 3f cpi r24, 0xFF ; 255 26f78: 89 f0 breq .+34 ; 0x26f9c 26f7a: 8f 5c subi r24, 0xCF ; 207 26f7c: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc('>'); 26f80: 8e e3 ldi r24, 0x3E ; 62 26f82: 0e 94 7c 6f call 0xdef8 ; 0xdef8 26f86: 80 91 7e 13 lds r24, 0x137E ; 0x80137e 26f8a: 83 36 cpi r24, 0x63 ; 99 26f8c: 49 f0 breq .+18 ; 0x26fa0 lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26f8e: 8f 3f cpi r24, 0xFF ; 255 26f90: 39 f0 breq .+14 ; 0x26fa0 26f92: 8f 5c subi r24, 0xCF ; 207 26f94: 0e 94 7c 6f call 0xdef8 ; 0xdef8 chars += 3; 26f98: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 26f9a: 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'); 26f9c: 8f e3 ldi r24, 0x3F ; 63 26f9e: ee cf rjmp .-36 ; 0x26f7c lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26fa0: 8f e3 ldi r24, 0x3F ; 63 26fa2: f8 cf rjmp .-16 ; 0x26f94 00026fa4 <__vector_51>: UCSR2B |= (1 << RXCIE2); // enable rx interrupt fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream } ISR(USART2_RX_vect) { 26fa4: 1f 92 push r1 26fa6: 0f 92 push r0 26fa8: 0f b6 in r0, 0x3f ; 63 26faa: 0f 92 push r0 26fac: 11 24 eor r1, r1 26fae: 0b b6 in r0, 0x3b ; 59 26fb0: 0f 92 push r0 26fb2: 2f 93 push r18 26fb4: 3f 93 push r19 26fb6: 4f 93 push r20 26fb8: 5f 93 push r21 26fba: 6f 93 push r22 26fbc: 7f 93 push r23 26fbe: 8f 93 push r24 26fc0: 9f 93 push r25 26fc2: af 93 push r26 26fc4: bf 93 push r27 26fc6: ef 93 push r30 26fc8: ff 93 push r31 if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 26fca: 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 26fce: 80 91 21 05 lds r24, 0x0521 ; 0x800521 uint8_t buf_r = ptr[2]; //get read index 26fd2: 90 91 22 05 lds r25, 0x0522 ; 0x800522 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 26fd6: e8 2f mov r30, r24 26fd8: f0 e0 ldi r31, 0x00 ; 0 26fda: ec 5d subi r30, 0xDC ; 220 26fdc: fa 4f sbci r31, 0xFA ; 250 26fde: 20 83 st Z, r18 buf_w++; //incerment write index 26fe0: 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 26fe2: 20 91 20 05 lds r18, 0x0520 ; 0x800520 26fe6: 82 17 cp r24, r18 26fe8: 08 f0 brcs .+2 ; 0x26fec <__vector_51+0x48> 26fea: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 26fec: 98 13 cpse r25, r24 26fee: 17 c0 rjmp .+46 ; 0x2701e <__vector_51+0x7a> { //rx buffer full puts_P(PSTR("USART2 rx Full!!!")); 26ff0: 87 e9 ldi r24, 0x97 ; 151 26ff2: 90 ea ldi r25, 0xA0 ; 160 26ff4: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 } } 26ff8: ff 91 pop r31 26ffa: ef 91 pop r30 26ffc: bf 91 pop r27 26ffe: af 91 pop r26 27000: 9f 91 pop r25 27002: 8f 91 pop r24 27004: 7f 91 pop r23 27006: 6f 91 pop r22 27008: 5f 91 pop r21 2700a: 4f 91 pop r20 2700c: 3f 91 pop r19 2700e: 2f 91 pop r18 27010: 0f 90 pop r0 27012: 0b be out 0x3b, r0 ; 59 27014: 0f 90 pop r0 27016: 0f be out 0x3f, r0 ; 63 27018: 0f 90 pop r0 2701a: 1f 90 pop r1 2701c: 18 95 reti ptr[1] = buf_w; //store write index 2701e: 80 93 21 05 sts 0x0521, r24 ; 0x800521 27022: ea cf rjmp .-44 ; 0x26ff8 <__vector_51+0x54> 00027024 <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 27024: 1f 92 push r1 27026: 0f 92 push r0 27028: 0f b6 in r0, 0x3f ; 63 2702a: 0f 92 push r0 2702c: 11 24 eor r1, r1 2702e: 0b b6 in r0, 0x3b ; 59 27030: 0f 92 push r0 27032: 8f 93 push r24 27034: 9f 93 push r25 27036: ef 93 push r30 27038: ff 93 push r31 WRITE(BEEPER, 0); 2703a: 9f b7 in r25, 0x3f ; 63 2703c: f8 94 cli 2703e: e2 e0 ldi r30, 0x02 ; 2 27040: f1 e0 ldi r31, 0x01 ; 1 27042: 80 81 ld r24, Z 27044: 8b 7f andi r24, 0xFB ; 251 27046: 80 83 st Z, r24 27048: 9f bf out 0x3f, r25 ; 63 } 2704a: ff 91 pop r31 2704c: ef 91 pop r30 2704e: 9f 91 pop r25 27050: 8f 91 pop r24 27052: 0f 90 pop r0 27054: 0b be out 0x3b, r0 ; 59 27056: 0f 90 pop r0 27058: 0f be out 0x3f, r0 ; 63 2705a: 0f 90 pop r0 2705c: 1f 90 pop r1 2705e: 18 95 reti 00027060 <__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) { 27060: 1f 92 push r1 27062: 0f 92 push r0 27064: 0f b6 in r0, 0x3f ; 63 27066: 0f 92 push r0 27068: 11 24 eor r1, r1 2706a: 0b b6 in r0, 0x3b ; 59 2706c: 0f 92 push r0 2706e: 8f 93 push r24 27070: 9f 93 push r25 27072: ef 93 push r30 27074: ff 93 push r31 WRITE(BEEPER, 1); 27076: 9f b7 in r25, 0x3f ; 63 27078: f8 94 cli 2707a: e2 e0 ldi r30, 0x02 ; 2 2707c: f1 e0 ldi r31, 0x01 ; 1 2707e: 80 81 ld r24, Z 27080: 84 60 ori r24, 0x04 ; 4 27082: 80 83 st Z, r24 27084: 9f bf out 0x3f, r25 ; 63 } 27086: ff 91 pop r31 27088: ef 91 pop r30 2708a: 9f 91 pop r25 2708c: 8f 91 pop r24 2708e: 0f 90 pop r0 27090: 0b be out 0x3b, r0 ; 59 27092: 0f 90 pop r0 27094: 0f be out 0x3f, r0 ; 63 27096: 0f 90 pop r0 27098: 1f 90 pop r1 2709a: 18 95 reti 0002709c : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 2709c: 6f 92 push r6 2709e: 7f 92 push r7 270a0: 8f 92 push r8 270a2: 9f 92 push r9 270a4: af 92 push r10 270a6: bf 92 push r11 270a8: df 92 push r13 270aa: ef 92 push r14 270ac: ff 92 push r15 270ae: 0f 93 push r16 270b0: 1f 93 push r17 270b2: cf 93 push r28 270b4: df 93 push r29 270b6: cd b7 in r28, 0x3d ; 61 270b8: de b7 in r29, 0x3e ; 62 270ba: e0 97 sbiw r28, 0x30 ; 48 270bc: 0f b6 in r0, 0x3f ; 63 270be: f8 94 cli 270c0: de bf out 0x3e, r29 ; 62 270c2: 0f be out 0x3f, r0 ; 63 270c4: cd bf out 0x3d, r28 ; 61 270c6: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 270c8: ae 01 movw r20, r28 270ca: 4f 5f subi r20, 0xFF ; 255 270cc: 5f 4f sbci r21, 0xFF ; 255 270ce: 60 e1 ldi r22, 0x10 ; 16 270d0: 0e 94 ee 7b call 0xf7dc ; 0xf7dc bubblesort_uint8(step, 16, 0); 270d4: 50 e0 ldi r21, 0x00 ; 0 270d6: 40 e0 ldi r20, 0x00 ; 0 270d8: 60 e1 ldi r22, 0x10 ; 16 270da: ce 01 movw r24, r28 270dc: 01 96 adiw r24, 0x01 ; 1 270de: 0f 94 95 1e call 0x23d2a ; 0x23d2a puts_P(PSTR("sorted samples:")); 270e2: 87 e8 ldi r24, 0x87 ; 135 270e4: 90 ea ldi r25, 0xA0 ; 160 270e6: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 270ea: 9e 01 movw r18, r28 270ec: 2f 5f subi r18, 0xFF ; 255 270ee: 3f 4f sbci r19, 0xFF ; 255 270f0: 59 01 movw r10, r18 270f2: 10 e0 ldi r17, 0x00 ; 0 270f4: 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]); 270f6: 26 e7 ldi r18, 0x76 ; 118 270f8: e2 2e mov r14, r18 270fa: 20 ea ldi r18, 0xA0 ; 160 270fc: f2 2e mov r15, r18 270fe: d5 01 movw r26, r10 27100: 8d 91 ld r24, X+ 27102: 5d 01 movw r10, r26 27104: 1f 92 push r1 27106: 8f 93 push r24 27108: 1f 93 push r17 2710a: 0f 93 push r16 2710c: ff 92 push r15 2710e: ef 92 push r14 27110: 0f 94 4b dc call 0x3b896 ; 0x3b896 27114: 0f 5f subi r16, 0xFF ; 255 27116: 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++) 27118: 0f 90 pop r0 2711a: 0f 90 pop r0 2711c: 0f 90 pop r0 2711e: 0f 90 pop r0 27120: 0f 90 pop r0 27122: 0f 90 pop r0 27124: 00 31 cpi r16, 0x10 ; 16 27126: 11 05 cpc r17, r1 27128: 51 f7 brne .-44 ; 0x270fe } 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]; 2712a: 09 81 ldd r16, Y+1 ; 0x01 2712c: 10 e0 ldi r17, 0x00 ; 0 2712e: 5e 01 movw r10, r28 27130: b2 e0 ldi r27, 0x02 ; 2 27132: ab 0e add r10, r27 27134: b1 1c adc r11, r1 27136: ee 24 eor r14, r14 27138: e3 94 inc r14 2713a: f1 2c mov r15, r1 2713c: ec 0e add r14, r28 2713e: fd 1e adc r15, r29 27140: e0 e1 ldi r30, 0x10 ; 16 27142: ee 0e add r14, r30 27144: f1 1c adc r15, r1 uint8_t cl = 0; 27146: 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; 27148: 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]; 2714a: d5 01 movw r26, r10 2714c: 3d 91 ld r19, X+ 2714e: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 27150: 62 2f mov r22, r18 27152: 70 e0 ldi r23, 0x00 ; 0 27154: c8 01 movw r24, r16 27156: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 2715a: 46 2f mov r20, r22 2715c: 43 1b sub r20, r19 2715e: 36 17 cp r19, r22 27160: 10 f0 brcs .+4 ; 0x27166 else dif = d - val; 27162: 43 2f mov r20, r19 27164: 46 1b sub r20, r22 27166: 83 2f mov r24, r19 27168: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 2716a: 42 30 cpi r20, 0x02 ; 2 2716c: 08 f0 brcs .+2 ; 0x27170 2716e: 47 c0 rjmp .+142 ; 0x271fe { cnt += 1; 27170: 2f 5f subi r18, 0xFF ; 255 sum += d; 27172: 08 0f add r16, r24 27174: 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++) 27176: ae 14 cp r10, r14 27178: bf 04 cpc r11, r15 2717a: 39 f7 brne .-50 ; 0x2714a cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 2717c: ae 2e mov r10, r30 2717e: b1 2c mov r11, r1 27180: a1 e1 ldi r26, 0x11 ; 17 27182: b0 e0 ldi r27, 0x00 ; 0 27184: ac 0f add r26, r28 27186: bd 1f adc r27, r29 27188: aa 0d add r26, r10 2718a: bb 1d adc r27, r11 2718c: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 2718e: 7e 01 movw r14, r28 27190: b1 e2 ldi r27, 0x21 ; 33 27192: eb 0e add r14, r27 27194: f1 1c adc r15, r1 27196: ae 0c add r10, r14 27198: bf 1c adc r11, r15 2719a: 62 2f mov r22, r18 2719c: 70 e0 ldi r23, 0x00 ; 0 2719e: c8 01 movw r24, r16 271a0: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 271a4: d5 01 movw r26, r10 271a6: 6c 93 st X, r22 return ++cl; 271a8: 11 e0 ldi r17, 0x01 ; 1 271aa: 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:")); 271ac: 8c e6 ldi r24, 0x6C ; 108 271ae: 90 ea ldi r25, 0xA0 ; 160 271b0: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 271b4: fe 01 movw r30, r28 271b6: 71 96 adiw r30, 0x11 ; 17 271b8: 3f 01 movw r6, r30 271ba: 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]); 271bc: 84 e5 ldi r24, 0x54 ; 84 271be: 88 2e mov r8, r24 271c0: 80 ea ldi r24, 0xA0 ; 160 271c2: 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++) 271c4: 8a 2d mov r24, r10 271c6: 8e 19 sub r24, r14 271c8: 81 17 cp r24, r17 271ca: 70 f5 brcc .+92 ; 0x27228 271cc: c5 01 movw r24, r10 271ce: 8e 19 sub r24, r14 271d0: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 271d2: d5 01 movw r26, r10 271d4: 3d 91 ld r19, X+ 271d6: 5d 01 movw r10, r26 271d8: f3 01 movw r30, r6 271da: 21 91 ld r18, Z+ 271dc: 3f 01 movw r6, r30 271de: 1f 92 push r1 271e0: 3f 93 push r19 271e2: 1f 92 push r1 271e4: 2f 93 push r18 271e6: 9f 93 push r25 271e8: 8f 93 push r24 271ea: 9f 92 push r9 271ec: 8f 92 push r8 271ee: 0f 94 4b dc call 0x3b896 ; 0x3b896 271f2: 0f b6 in r0, 0x3f ; 63 271f4: f8 94 cli 271f6: de bf out 0x3e, r29 ; 62 271f8: 0f be out 0x3f, r0 ; 63 271fa: cd bf out 0x3d, r28 ; 61 271fc: e3 cf rjmp .-58 ; 0x271c4 271fe: 4e 2f mov r20, r30 27200: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 27202: a1 e1 ldi r26, 0x11 ; 17 27204: b0 e0 ldi r27, 0x00 ; 0 27206: ac 0f add r26, r28 27208: bd 1f adc r27, r29 2720a: a4 0f add r26, r20 2720c: b5 1f adc r27, r21 2720e: ef 5f subi r30, 0xFF ; 255 27210: 2c 93 st X, r18 if (cval) cval[cl] = val; 27212: 21 e2 ldi r18, 0x21 ; 33 27214: 30 e0 ldi r19, 0x00 ; 0 27216: 2c 0f add r18, r28 27218: 3d 1f adc r19, r29 2721a: 42 0f add r20, r18 2721c: 53 1f adc r21, r19 2721e: da 01 movw r26, r20 27220: 6c 93 st X, r22 cnt = 1; sum = d; 27222: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 27224: 21 e0 ldi r18, 0x01 ; 1 27226: a7 cf rjmp .-178 ; 0x27176 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); 27228: a7 01 movw r20, r14 2722a: 61 2f mov r22, r17 2722c: ce 01 movw r24, r28 2722e: 41 96 adiw r24, 0x11 ; 17 27230: 0f 94 95 1e call 0x23d2a ; 0x23d2a tmc2130_home_origin[axis] = val[cl-1]; 27234: fe 01 movw r30, r28 27236: e1 0f add r30, r17 27238: f1 1d adc r31, r1 2723a: 80 a1 ldd r24, Z+32 ; 0x20 2723c: ed 2d mov r30, r13 2723e: f0 e0 ldi r31, 0x00 ; 0 27240: ec 50 subi r30, 0x0C ; 12 27242: fb 4f sbci r31, 0xFB ; 251 27244: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 27246: 1f 92 push r1 27248: 8f 93 push r24 2724a: 82 e4 ldi r24, 0x42 ; 66 2724c: 90 ea ldi r25, 0xA0 ; 160 2724e: 9f 93 push r25 27250: 8f 93 push r24 27252: 0f 94 4b dc call 0x3b896 ; 0x3b896 if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 27256: 0f 90 pop r0 27258: 0f 90 pop r0 2725a: 0f 90 pop r0 2725c: 0f 90 pop r0 2725e: 60 91 f4 04 lds r22, 0x04F4 ; 0x8004f4 27262: 8e ef ldi r24, 0xFE ; 254 27264: 9e e0 ldi r25, 0x0E ; 14 27266: dd 20 and r13, r13 27268: 21 f0 breq .+8 ; 0x27272 2726a: 60 91 f5 04 lds r22, 0x04F5 ; 0x8004f5 2726e: 8b ef ldi r24, 0xFB ; 251 27270: 9e e0 ldi r25, 0x0E ; 14 27272: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 27276: 81 e0 ldi r24, 0x01 ; 1 27278: e0 96 adiw r28, 0x30 ; 48 2727a: 0f b6 in r0, 0x3f ; 63 2727c: f8 94 cli 2727e: de bf out 0x3e, r29 ; 62 27280: 0f be out 0x3f, r0 ; 63 27282: cd bf out 0x3d, r28 ; 61 27284: df 91 pop r29 27286: cf 91 pop r28 27288: 1f 91 pop r17 2728a: 0f 91 pop r16 2728c: ff 90 pop r15 2728e: ef 90 pop r14 27290: df 90 pop r13 27292: bf 90 pop r11 27294: af 90 pop r10 27296: 9f 90 pop r9 27298: 8f 90 pop r8 2729a: 7f 90 pop r7 2729c: 6f 90 pop r6 2729e: 08 95 ret 000272a0 : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 272a0: 81 30 cpi r24, 0x01 ; 1 272a2: 49 f0 breq .+18 ; 0x272b6 272a4: 28 f0 brcs .+10 ; 0x272b0 272a6: 82 30 cpi r24, 0x02 ; 2 272a8: 41 f0 breq .+16 ; 0x272ba 272aa: 83 30 cpi r24, 0x03 ; 3 272ac: 41 f0 breq .+16 ; 0x272be 272ae: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 272b0: 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; 272b2: 86 b9 out 0x06, r24 ; 6 } } 272b4: 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; 272b6: 82 e0 ldi r24, 0x02 ; 2 272b8: fc cf rjmp .-8 ; 0x272b2 case Z_AXIS: _DO_STEP_Z; break; 272ba: 84 e0 ldi r24, 0x04 ; 4 272bc: fa cf rjmp .-12 ; 0x272b2 case E_AXIS: _DO_STEP_E; break; 272be: 88 e0 ldi r24, 0x08 ; 8 272c0: f8 cf rjmp .-16 ; 0x272b2 000272c2 : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 272c2: 81 30 cpi r24, 0x01 ; 1 272c4: d1 f0 breq .+52 ; 0x272fa 272c6: 48 f0 brcs .+18 ; 0x272da 272c8: 82 30 cpi r24, 0x02 ; 2 272ca: 21 f1 breq .+72 ; 0x27314 272cc: 83 30 cpi r24, 0x03 ; 3 272ce: 79 f1 breq .+94 ; 0x2732e 272d0: 8b e4 ldi r24, 0x4B ; 75 272d2: 90 e0 ldi r25, 0x00 ; 0 272d4: 01 97 sbiw r24, 0x01 ; 1 272d6: f1 f7 brne .-4 ; 0x272d4 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); } 272d8: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 272da: 9f b7 in r25, 0x3f ; 63 272dc: 66 23 and r22, r22 272de: 41 f0 breq .+16 ; 0x272f0 272e0: f8 94 cli 272e2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272e6: 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; 272e8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272ec: 9f bf out 0x3f, r25 ; 63 272ee: f0 cf rjmp .-32 ; 0x272d0 void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 272f0: f8 94 cli 272f2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272f6: 8e 7f andi r24, 0xFE ; 254 272f8: f7 cf rjmp .-18 ; 0x272e8 case Y_AXIS: _SET_DIR_Y(dir); break; 272fa: 9f b7 in r25, 0x3f ; 63 272fc: 61 11 cpse r22, r1 272fe: 05 c0 rjmp .+10 ; 0x2730a 27300: f8 94 cli 27302: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27306: 82 60 ori r24, 0x02 ; 2 27308: ef cf rjmp .-34 ; 0x272e8 2730a: f8 94 cli 2730c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27310: 8d 7f andi r24, 0xFD ; 253 27312: ea cf rjmp .-44 ; 0x272e8 case Z_AXIS: _SET_DIR_Z(dir); break; 27314: 9f b7 in r25, 0x3f ; 63 27316: 66 23 and r22, r22 27318: 29 f0 breq .+10 ; 0x27324 2731a: f8 94 cli 2731c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27320: 84 60 ori r24, 0x04 ; 4 27322: e2 cf rjmp .-60 ; 0x272e8 27324: f8 94 cli 27326: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2732a: 8b 7f andi r24, 0xFB ; 251 2732c: dd cf rjmp .-70 ; 0x272e8 case E_AXIS: _SET_DIR_E(dir); break; 2732e: 9f b7 in r25, 0x3f ; 63 27330: 61 11 cpse r22, r1 27332: 05 c0 rjmp .+10 ; 0x2733e 27334: f8 94 cli 27336: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2733a: 80 64 ori r24, 0x40 ; 64 2733c: d5 cf rjmp .-86 ; 0x272e8 2733e: f8 94 cli 27340: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27344: 8f 7b andi r24, 0xBF ; 191 27346: d0 cf rjmp .-96 ; 0x272e8 00027348 : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 27348: cf 92 push r12 2734a: df 92 push r13 2734c: ef 92 push r14 2734e: ff 92 push r15 27350: 0f 93 push r16 27352: 1f 93 push r17 27354: cf 93 push r28 27356: df 93 push r29 27358: 18 2f mov r17, r24 2735a: f6 2e mov r15, r22 2735c: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 2735e: 0c e5 ldi r16, 0x5C ; 92 27360: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 27362: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27364: 0f 94 f1 1e call 0x23de2 ; 0x23de2 TMC2130_SPI_TXRX(addr); // address 27368: 8f 2d mov r24, r15 2736a: 0f 94 0c 1f call 0x23e18 ; 0x23e18 TMC2130_SPI_TXRX(0); // MSB 2736e: 80 e0 ldi r24, 0x00 ; 0 27370: 0f 94 0c 1f call 0x23e18 ; 0x23e18 TMC2130_SPI_TXRX(0); 27374: 80 e0 ldi r24, 0x00 ; 0 27376: 0f 94 0c 1f call 0x23e18 ; 0x23e18 TMC2130_SPI_TXRX(0); 2737a: 80 e0 ldi r24, 0x00 ; 0 2737c: 0f 94 0c 1f call 0x23e18 ; 0x23e18 TMC2130_SPI_TXRX(0); // LSB 27380: 80 e0 ldi r24, 0x00 ; 0 27382: 0f 94 0c 1f call 0x23e18 ; 0x23e18 tmc2130_cs_high(axis); 27386: 81 2f mov r24, r17 27388: 0f 94 d6 1e call 0x23dac ; 0x23dac SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 2738c: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 2738e: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27390: 81 2f mov r24, r17 27392: 0f 94 f1 1e call 0x23de2 ; 0x23de2 uint8_t stat = TMC2130_SPI_TXRX(0); // status 27396: 80 e0 ldi r24, 0x00 ; 0 27398: 0f 94 0c 1f call 0x23e18 ; 0x23e18 2739c: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 2739e: 80 e0 ldi r24, 0x00 ; 0 273a0: 0f 94 0c 1f call 0x23e18 ; 0x23e18 273a4: 90 e0 ldi r25, 0x00 ; 0 273a6: b0 e0 ldi r27, 0x00 ; 0 273a8: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 273aa: cc 24 eor r12, r12 273ac: d8 2e mov r13, r24 273ae: e9 2e mov r14, r25 273b0: fa 2e mov r15, r26 273b2: 80 e0 ldi r24, 0x00 ; 0 273b4: 0f 94 0c 1f call 0x23e18 ; 0x23e18 273b8: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 273ba: fe 2c mov r15, r14 273bc: ed 2c mov r14, r13 273be: dc 2c mov r13, r12 273c0: cc 24 eor r12, r12 273c2: 80 e0 ldi r24, 0x00 ; 0 273c4: 0f 94 0c 1f call 0x23e18 ; 0x23e18 273c8: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 273ca: fe 2c mov r15, r14 273cc: ed 2c mov r14, r13 273ce: dc 2c mov r13, r12 273d0: cc 24 eor r12, r12 273d2: 80 e0 ldi r24, 0x00 ; 0 273d4: 0f 94 0c 1f call 0x23e18 ; 0x23e18 273d8: c8 2a or r12, r24 tmc2130_cs_high(axis); 273da: 81 2f mov r24, r17 273dc: 0f 94 d6 1e call 0x23dac ; 0x23dac TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 273e0: c8 82 st Y, r12 273e2: d9 82 std Y+1, r13 ; 0x01 273e4: ea 82 std Y+2, r14 ; 0x02 273e6: fb 82 std Y+3, r15 ; 0x03 return stat; } 273e8: 80 2f mov r24, r16 273ea: df 91 pop r29 273ec: cf 91 pop r28 273ee: 1f 91 pop r17 273f0: 0f 91 pop r16 273f2: ff 90 pop r15 273f4: ef 90 pop r14 273f6: df 90 pop r13 273f8: cf 90 pop r12 273fa: 08 95 ret 000273fc : #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) { 273fc: ef 92 push r14 273fe: ff 92 push r15 27400: 0f 93 push r16 27402: 1f 93 push r17 27404: cf 93 push r28 27406: df 93 push r29 27408: c8 2f mov r28, r24 2740a: e6 2e mov r14, r22 2740c: d2 2f mov r29, r18 2740e: 13 2f mov r17, r19 27410: 04 2f mov r16, r20 27412: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 27414: 8c e5 ldi r24, 0x5C ; 92 27416: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 27418: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 2741a: 8c 2f mov r24, r28 2741c: 0f 94 f1 1e call 0x23de2 ; 0x23de2 TMC2130_SPI_TXRX(addr); // address 27420: 8e 2d mov r24, r14 27422: 0f 94 0c 1f call 0x23e18 ; 0x23e18 TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 27426: 8f 2d mov r24, r15 27428: 0f 94 0c 1f call 0x23e18 ; 0x23e18 TMC2130_SPI_TXRX((wval >> 16) & 0xff); 2742c: 80 2f mov r24, r16 2742e: 0f 94 0c 1f call 0x23e18 ; 0x23e18 TMC2130_SPI_TXRX((wval >> 8) & 0xff); 27432: 81 2f mov r24, r17 27434: 0f 94 0c 1f call 0x23e18 ; 0x23e18 TMC2130_SPI_TXRX(wval & 0xff); // LSB 27438: 8d 2f mov r24, r29 2743a: 0f 94 0c 1f call 0x23e18 ; 0x23e18 tmc2130_cs_high(axis); 2743e: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 27440: df 91 pop r29 27442: cf 91 pop r28 27444: 1f 91 pop r17 27446: 0f 91 pop r16 27448: ff 90 pop r15 2744a: 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); 2744c: 0d 94 d6 1e jmp 0x23dac ; 0x23dac 00027450 : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 27450: cf 93 push r28 27452: df 93 push r29 27454: 00 d0 rcall .+0 ; 0x27456 27456: 1f 92 push r1 27458: cd b7 in r28, 0x3d ; 61 2745a: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 2745c: 19 82 std Y+1, r1 ; 0x01 2745e: 1a 82 std Y+2, r1 ; 0x02 27460: 1b 82 std Y+3, r1 ; 0x03 27462: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 27464: ae 01 movw r20, r28 27466: 4f 5f subi r20, 0xFF ; 255 27468: 5f 4f sbci r21, 0xFF ; 255 2746a: 6a e6 ldi r22, 0x6A ; 106 2746c: 0f 94 a4 39 call 0x27348 ; 0x27348 return val32 & 0x3ff; 27470: 89 81 ldd r24, Y+1 ; 0x01 27472: 9a 81 ldd r25, Y+2 ; 0x02 } 27474: 93 70 andi r25, 0x03 ; 3 27476: 0f 90 pop r0 27478: 0f 90 pop r0 2747a: 0f 90 pop r0 2747c: 0f 90 pop r0 2747e: df 91 pop r29 27480: cf 91 pop r28 27482: 08 95 ret 00027484 : #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 */) { 27484: ff 92 push r15 27486: 0f 93 push r16 27488: 1f 93 push r17 2748a: cf 93 push r28 2748c: df 93 push r29 2748e: f8 2e mov r15, r24 27490: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 27492: e8 2f mov r30, r24 27494: f0 e0 ldi r31, 0x00 ; 0 27496: 83 e0 ldi r24, 0x03 ; 3 27498: f8 9e mul r15, r24 2749a: 80 01 movw r16, r0 2749c: 11 24 eor r1, r1 2749e: 03 5a subi r16, 0xA3 ; 163 274a0: 1d 4f sbci r17, 0xFD ; 253 274a2: d8 01 movw r26, r16 274a4: 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) {} 274a6: 30 e0 ldi r19, 0x00 ; 0 274a8: 37 7f andi r19, 0xF7 ; 247 274aa: 3f 7e andi r19, 0xEF ; 239 274ac: 3f 7d andi r19, 0xDF ; 223 274ae: 3f 7b andi r19, 0xBF ; 191 274b0: 40 e0 ldi r20, 0x00 ; 0 274b2: 80 fb bst r24, 0 274b4: 41 f9 bld r20, 1 274b6: 43 70 andi r20, 0x03 ; 3 274b8: 56 2f mov r21, r22 274ba: 5f 70 andi r21, 0x0F ; 15 274bc: 50 62 ori r21, 0x20 ; 32 274be: 5f 7b andi r21, 0xBF ; 191 274c0: 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 274c2: 81 e0 ldi r24, 0x01 ; 1 274c4: 61 11 cpse r22, r1 274c6: 01 c0 rjmp .+2 ; 0x274ca 274c8: 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); 274ca: 80 fb bst r24, 0 274cc: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 274ce: bf 01 movw r22, r30 274d0: 66 0f add r22, r22 274d2: 77 1f adc r23, r23 274d4: fb 01 movw r30, r22 274d6: e3 58 subi r30, 0x83 ; 131 274d8: fd 4f sbci r31, 0xFD ; 253 274da: 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 274dc: 92 2f mov r25, r18 274de: 99 1f adc r25, r25 274e0: 99 27 eor r25, r25 274e2: 99 1f adc r25, r25 274e4: 81 81 ldd r24, Z+1 ; 0x01 274e6: 87 70 andi r24, 0x07 ; 7 274e8: 88 0f add r24, r24 274ea: 89 2b or r24, r25 274ec: 80 fb bst r24, 0 274ee: 27 f9 bld r18, 7 274f0: 86 95 lsr r24 274f2: 87 70 andi r24, 0x07 ; 7 274f4: 38 7f andi r19, 0xF8 ; 248 274f6: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 274f8: 62 58 subi r22, 0x82 ; 130 274fa: 7d 4f sbci r23, 0xFD ; 253 274fc: fb 01 movw r30, r22 274fe: 80 81 ld r24, Z 27500: 86 95 lsr r24 27502: 86 95 lsr r24 27504: 86 95 lsr r24 27506: 80 fb bst r24, 0 27508: 37 f9 bld r19, 7 2750a: 81 fb bst r24, 1 2750c: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 2750e: 6c ee ldi r22, 0xEC ; 236 27510: 8f 2d mov r24, r15 27512: 0f 94 fe 39 call 0x273fc ; 0x273fc if (curr == nullptr) { 27516: 20 97 sbiw r28, 0x00 ; 0 27518: 09 f4 brne .+2 ; 0x2751c curr = ¤ts[axis]; 2751a: e8 01 movw r28, r16 2751c: 19 81 ldd r17, Y+1 ; 0x01 2751e: 8a 81 ldd r24, Y+2 ; 0x02 27520: c1 2f mov r28, r17 27522: 81 17 cp r24, r17 27524: 08 f4 brcc .+2 ; 0x27528 27526: 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()) { 27528: 18 17 cp r17, r24 2752a: 40 f4 brcc .+16 ; 0x2753c // Let user know firmware modified the value SERIAL_ECHO_START; 2752c: 82 ee ldi r24, 0xE2 ; 226 2752e: 99 ea ldi r25, 0xA9 ; 169 27530: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 27534: 8b ea ldi r24, 0xAB ; 171 27536: 9e e6 ldi r25, 0x6E ; 110 27538: 0e 94 fe 7a call 0xf5fc ; 0xf5fc struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 2753c: 2c 2f mov r18, r28 2753e: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 27540: 31 2f mov r19, r17 27542: 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); 27544: 4f e0 ldi r20, 0x0F ; 15 27546: 50 e0 ldi r21, 0x00 ; 0 27548: 60 e9 ldi r22, 0x90 ; 144 2754a: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 2754c: df 91 pop r29 2754e: cf 91 pop r28 27550: 1f 91 pop r17 27552: 0f 91 pop r16 27554: 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); 27556: 0d 94 fe 39 jmp 0x273fc ; 0x273fc 0002755a : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 2755a: e8 2f mov r30, r24 2755c: 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--; 2755e: 98 e0 ldi r25, 0x08 ; 8 27560: 76 95 lsr r23 27562: 67 95 ror r22 27564: 61 15 cp r22, r1 27566: 71 05 cpc r23, r1 27568: 11 f0 breq .+4 ; 0x2756e 2756a: 91 50 subi r25, 0x01 ; 1 2756c: f9 cf rjmp .-14 ; 0x27560 return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 2756e: ea 50 subi r30, 0x0A ; 10 27570: fb 4f sbci r31, 0xFB ; 251 27572: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 27574: 50 e0 ldi r21, 0x00 ; 0 27576: 40 e0 ldi r20, 0x00 ; 0 27578: 69 2f mov r22, r25 2757a: 0d 94 42 3a jmp 0x27484 ; 0x27484 0002757e : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 2757e: 0f 93 push r16 27580: 1f 93 push r17 27582: cf 93 push r28 27584: df 93 push r29 27586: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 27588: 08 2f mov r16, r24 2758a: 10 e0 ldi r17, 0x00 ; 0 2758c: f8 01 movw r30, r16 2758e: ea 50 subi r30, 0x0A ; 10 27590: fb 4f sbci r31, 0xFB ; 251 27592: 50 e0 ldi r21, 0x00 ; 0 27594: 40 e0 ldi r20, 0x00 ; 0 27596: 60 81 ld r22, Z 27598: 0f 94 42 3a call 0x27484 ; 0x27484 tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 2759c: 20 e0 ldi r18, 0x00 ; 0 2759e: 30 e0 ldi r19, 0x00 ; 0 275a0: a9 01 movw r20, r18 275a2: 61 e9 ldi r22, 0x91 ; 145 275a4: 8c 2f mov r24, r28 275a6: 0f 94 fe 39 call 0x273fc ; 0x273fc const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 275aa: d0 91 6a 06 lds r29, 0x066A ; 0x80066a if (axis == Z_AXIS) { 275ae: c2 30 cpi r28, 0x02 ; 2 275b0: e1 f5 brne .+120 ; 0x2762a #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 275b2: 20 e0 ldi r18, 0x00 ; 0 275b4: 30 e0 ldi r19, 0x00 ; 0 275b6: 44 e0 ldi r20, 0x04 ; 4 275b8: 51 e0 ldi r21, 0x01 ; 1 275ba: 6d ee ldi r22, 0xED ; 237 275bc: 82 e0 ldi r24, 0x02 ; 2 275be: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 275c2: 24 ef ldi r18, 0xF4 ; 244 275c4: 31 e0 ldi r19, 0x01 ; 1 275c6: 40 e0 ldi r20, 0x00 ; 0 275c8: 50 e0 ldi r21, 0x00 ; 0 275ca: d1 30 cpi r29, 0x01 ; 1 275cc: 19 f4 brne .+6 ; 0x275d4 275ce: 20 e0 ldi r18, 0x00 ; 0 275d0: 30 e0 ldi r19, 0x00 ; 0 275d2: a9 01 movw r20, r18 275d4: 64 e9 ldi r22, 0x94 ; 148 275d6: 82 e0 ldi r24, 0x02 ; 2 275d8: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 275dc: 24 e8 ldi r18, 0x84 ; 132 275de: 31 e0 ldi r19, 0x01 ; 1 275e0: 40 e0 ldi r20, 0x00 ; 0 275e2: 50 e0 ldi r21, 0x00 ; 0 275e4: d1 30 cpi r29, 0x01 ; 1 275e6: 21 f4 brne .+8 ; 0x275f0 275e8: 24 e0 ldi r18, 0x04 ; 4 275ea: 30 e0 ldi r19, 0x00 ; 0 275ec: 40 e0 ldi r20, 0x00 ; 0 275ee: 50 e0 ldi r21, 0x00 ; 0 275f0: 60 e8 ldi r22, 0x80 ; 128 275f2: 82 e0 ldi r24, 0x02 ; 2 275f4: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 275f8: 28 ec ldi r18, 0xC8 ; 200 275fa: 34 e0 ldi r19, 0x04 ; 4 275fc: 46 e0 ldi r20, 0x06 ; 6 275fe: 50 e0 ldi r21, 0x00 ; 0 27600: 60 ef ldi r22, 0xF0 ; 240 27602: 82 e0 ldi r24, 0x02 ; 2 27604: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 27608: 20 ef ldi r18, 0xF0 ; 240 2760a: 3f ef ldi r19, 0xFF ; 255 2760c: 4f e0 ldi r20, 0x0F ; 15 2760e: 50 e0 ldi r21, 0x00 ; 0 27610: d1 30 cpi r29, 0x01 ; 1 27612: 19 f4 brne .+6 ; 0x2761a 27614: 20 e0 ldi r18, 0x00 ; 0 27616: 30 e0 ldi r19, 0x00 ; 0 27618: a9 01 movw r20, r18 2761a: 63 e9 ldi r22, 0x93 ; 147 2761c: 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); } } 2761e: df 91 pop r29 27620: cf 91 pop r28 27622: 1f 91 pop r17 27624: 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); 27626: 0d 94 fe 39 jmp 0x273fc ; 0x273fc 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)); 2762a: f8 01 movw r30, r16 2762c: e6 5e subi r30, 0xE6 ; 230 2762e: fc 4f sbci r31, 0xFC ; 252 27630: 20 81 ld r18, Z 27632: 30 e0 ldi r19, 0x00 ; 0 27634: 50 e0 ldi r21, 0x00 ; 0 27636: 40 e0 ldi r20, 0x00 ; 0 27638: a9 01 movw r20, r18 2763a: 33 27 eor r19, r19 2763c: 22 27 eor r18, r18 2763e: 51 60 ori r21, 0x01 ; 1 27640: 6d ee ldi r22, 0xED ; 237 27642: 8c 2f mov r24, r28 27644: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 27648: 20 e0 ldi r18, 0x00 ; 0 2764a: 30 e0 ldi r19, 0x00 ; 0 2764c: a9 01 movw r20, r18 2764e: d1 30 cpi r29, 0x01 ; 1 27650: 61 f0 breq .+24 ; 0x2766a uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 27652: 2e ea ldi r18, 0xAE ; 174 27654: 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) 27656: c2 30 cpi r28, 0x02 ; 2 27658: 30 f0 brcs .+12 ; 0x27666 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 2765a: 24 ef ldi r18, 0xF4 ; 244 2765c: 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) 2765e: c2 30 cpi r28, 0x02 ; 2 27660: 11 f0 breq .+4 ; 0x27666 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 27662: 30 e0 ldi r19, 0x00 ; 0 27664: 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)); 27666: 50 e0 ldi r21, 0x00 ; 0 27668: 40 e0 ldi r20, 0x00 ; 0 2766a: 64 e9 ldi r22, 0x94 ; 148 2766c: 8c 2f mov r24, r28 2766e: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 27672: 20 e8 ldi r18, 0x80 ; 128 27674: 31 e0 ldi r19, 0x01 ; 1 27676: 40 e0 ldi r20, 0x00 ; 0 27678: 50 e0 ldi r21, 0x00 ; 0 2767a: d1 30 cpi r29, 0x01 ; 1 2767c: 21 f4 brne .+8 ; 0x27686 2767e: 24 e0 ldi r18, 0x04 ; 4 27680: 30 e0 ldi r19, 0x00 ; 0 27682: 40 e0 ldi r20, 0x00 ; 0 27684: 50 e0 ldi r21, 0x00 ; 0 27686: 60 e8 ldi r22, 0x80 ; 128 27688: 8c 2f mov r24, r28 2768a: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 2768e: 00 0f add r16, r16 27690: 11 1f adc r17, r17 27692: 00 0f add r16, r16 27694: 11 1f adc r17, r17 27696: f8 01 movw r30, r16 27698: e6 5f subi r30, 0xF6 ; 246 2769a: fc 4f sbci r31, 0xFC ; 252 2769c: 20 81 ld r18, Z 2769e: 31 81 ldd r19, Z+1 ; 0x01 276a0: 42 81 ldd r20, Z+2 ; 0x02 276a2: 53 81 ldd r21, Z+3 ; 0x03 276a4: 60 ef ldi r22, 0xF0 ; 240 276a6: 8c 2f mov r24, r28 276a8: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 276ac: 20 e0 ldi r18, 0x00 ; 0 276ae: 30 e0 ldi r19, 0x00 ; 0 276b0: a9 01 movw r20, r18 276b2: 63 e9 ldi r22, 0x93 ; 147 276b4: 8c 2f mov r24, r28 276b6: b3 cf rjmp .-154 ; 0x2761e 000276b8 : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 276b8: 1f 93 push r17 276ba: cf 93 push r28 276bc: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 276be: 80 91 3e 06 lds r24, 0x063E ; 0x80063e 276c2: 1f 92 push r1 276c4: 8f 93 push r24 276c6: 8c e0 ldi r24, 0x0C ; 12 276c8: 90 ea ldi r25, 0xA0 ; 160 276ca: 9f 93 push r25 276cc: 8f 93 push r24 276ce: 0f 94 4b dc call 0x3b896 ; 0x3b896 #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 276d2: 80 91 3e 06 lds r24, 0x063E ; 0x80063e 276d6: 83 70 andi r24, 0x03 ; 3 276d8: 0f 90 pop r0 276da: 0f 90 pop r0 276dc: 0f 90 pop r0 276de: 0f 90 pop r0 276e0: 11 f0 breq .+4 ; 0x276e6 tmc2130_wait_standstill_xy(1000); 276e2: 0f 94 e2 87 call 0x30fc4 ; 0x30fc4 if (tmc2130_sg_homing_axes_mask) 276e6: 10 91 3e 06 lds r17, 0x063E ; 0x80063e 276ea: 11 23 and r17, r17 276ec: 71 f0 breq .+28 ; 0x2770a { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 276ee: d1 e0 ldi r29, 0x01 ; 1 276f0: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 276f2: 81 2f mov r24, r17 276f4: 8d 23 and r24, r29 276f6: 19 f0 breq .+6 ; 0x276fe tmc2130_XYZ_reg_init(axis); 276f8: 8c 2f mov r24, r28 276fa: 0f 94 bf 3a call 0x2757e ; 0x2757e #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 276fe: cf 5f subi r28, 0xFF ; 255 27700: dd 0f add r29, r29 27702: c3 30 cpi r28, 0x03 ; 3 27704: b1 f7 brne .-20 ; 0x276f2 { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 27706: 10 92 3e 06 sts 0x063E, r1 ; 0x80063e } tmc2130_sg_crash = false; 2770a: 10 92 0e 05 sts 0x050E, r1 ; 0x80050e #endif } 2770e: df 91 pop r29 27710: cf 91 pop r28 27712: 1f 91 pop r17 27714: 08 95 ret 00027716 : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 27716: df 92 push r13 27718: ef 92 push r14 2771a: ff 92 push r15 2771c: 0f 93 push r16 2771e: 1f 93 push r17 27720: cf 93 push r28 27722: df 93 push r29 27724: 00 d0 rcall .+0 ; 0x27726 27726: cd b7 in r28, 0x3d ; 61 27728: de b7 in r29, 0x3e ; 62 2772a: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 2772c: 1f 92 push r1 2772e: 8f 93 push r24 27730: 86 ee ldi r24, 0xE6 ; 230 27732: 9f e9 ldi r25, 0x9F ; 159 27734: 9f 93 push r25 27736: 8f 93 push r24 27738: 0f 94 4b dc call 0x3b896 ; 0x3b896 #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 2773c: 8d 2d mov r24, r13 2773e: 83 70 andi r24, 0x03 ; 3 27740: 0f 90 pop r0 27742: 0f 90 pop r0 27744: 0f 90 pop r0 27746: 0f 90 pop r0 27748: 11 f0 breq .+4 ; 0x2774e tmc2130_wait_standstill_xy(1000); 2774a: 0f 94 e2 87 call 0x30fc4 ; 0x30fc4 } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 2774e: 10 e0 ldi r17, 0x00 ; 0 27750: 00 e0 ldi r16, 0x00 ; 0 27752: ff 24 eor r15, r15 27754: f3 94 inc r15 27756: 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) 27758: 8d 2d mov r24, r13 2775a: 8f 21 and r24, r15 2775c: 09 f4 brne .+2 ; 0x27760 2775e: 46 c0 rjmp .+140 ; 0x277ec { tmc2130_sg_homing_axes_mask |= mask; 27760: 80 91 3e 06 lds r24, 0x063E ; 0x80063e 27764: 8f 29 or r24, r15 27766: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 2776a: 20 e0 ldi r18, 0x00 ; 0 2776c: 30 e0 ldi r19, 0x00 ; 0 2776e: a9 01 movw r20, r18 27770: 60 e8 ldi r22, 0x80 ; 128 27772: 80 2f mov r24, r16 27774: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 27778: f8 01 movw r30, r16 2777a: e6 5e subi r30, 0xE6 ; 230 2777c: fc 4f sbci r31, 0xFC ; 252 2777e: 20 81 ld r18, Z 27780: 30 e0 ldi r19, 0x00 ; 0 27782: 50 e0 ldi r21, 0x00 ; 0 27784: 40 e0 ldi r20, 0x00 ; 0 27786: a9 01 movw r20, r18 27788: 33 27 eor r19, r19 2778a: 22 27 eor r18, r18 2778c: 6d ee ldi r22, 0xED ; 237 2778e: 80 2f mov r24, r16 27790: 0f 94 fe 39 call 0x273fc ; 0x273fc 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) 27794: 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; 27796: 24 ef ldi r18, 0xF4 ; 244 27798: 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) 2779a: 08 17 cp r16, r24 2779c: 11 f0 breq .+4 ; 0x277a2 { case X_AXIS: return TMC2130_TCOOLTHRS_X; 2779e: 2e ea ldi r18, 0xAE ; 174 277a0: 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)); 277a2: 50 e0 ldi r21, 0x00 ; 0 277a4: 40 e0 ldi r20, 0x00 ; 0 277a6: 64 e9 ldi r22, 0x94 ; 148 277a8: 8e 2d mov r24, r14 277aa: 0f 94 fe 39 call 0x273fc ; 0x273fc iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 277ae: b8 01 movw r22, r16 277b0: 66 0f add r22, r22 277b2: 77 1f adc r23, r23 277b4: 60 0f add r22, r16 277b6: 71 1f adc r23, r17 277b8: 66 52 subi r22, 0x26 ; 38 277ba: 70 46 sbci r23, 0x60 ; 96 277bc: 43 e0 ldi r20, 0x03 ; 3 277be: 50 e0 ldi r21, 0x00 ; 0 277c0: ce 01 movw r24, r28 277c2: 01 96 adiw r24, 0x01 ; 1 277c4: 0f 94 23 db call 0x3b646 ; 0x3b646 MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 277c8: ae 01 movw r20, r28 277ca: 4f 5f subi r20, 0xFF ; 255 277cc: 5f 4f sbci r21, 0xFF ; 255 277ce: f8 01 movw r30, r16 277d0: ea 50 subi r30, 0x0A ; 10 277d2: fb 4f sbci r31, 0xFB ; 251 277d4: 60 81 ld r22, Z 277d6: 8e 2d mov r24, r14 277d8: 0f 94 42 3a call 0x27484 ; 0x27484 tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 277dc: 20 e8 ldi r18, 0x80 ; 128 277de: 31 e0 ldi r19, 0x01 ; 1 277e0: 40 e0 ldi r20, 0x00 ; 0 277e2: 50 e0 ldi r21, 0x00 ; 0 277e4: 60 e8 ldi r22, 0x80 ; 128 277e6: 8e 2d mov r24, r14 277e8: 0f 94 fe 39 call 0x273fc ; 0x273fc { 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 277ec: ff 0c add r15, r15 277ee: 0f 5f subi r16, 0xFF ; 255 277f0: 1f 4f sbci r17, 0xFF ; 255 277f2: 03 30 cpi r16, 0x03 ; 3 277f4: 11 05 cpc r17, r1 277f6: 09 f0 breq .+2 ; 0x277fa 277f8: ae cf rjmp .-164 ; 0x27756 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 } 277fa: 0f 90 pop r0 277fc: 0f 90 pop r0 277fe: 0f 90 pop r0 27800: df 91 pop r29 27802: cf 91 pop r28 27804: 1f 91 pop r17 27806: 0f 91 pop r16 27808: ff 90 pop r15 2780a: ef 90 pop r14 2780c: df 90 pop r13 2780e: 08 95 ret 00027810 : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 27810: 89 e6 ldi r24, 0x69 ; 105 27812: 9f e0 ldi r25, 0x0F ; 15 27814: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 27818: 91 e0 ldi r25, 0x01 ; 1 2781a: 81 11 cpse r24, r1 2781c: 01 c0 rjmp .+2 ; 0x27820 2781e: 90 e0 ldi r25, 0x00 ; 0 27820: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 27824: 08 95 ret 00027826 : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 27826: 89 e6 ldi r24, 0x69 ; 105 27828: 9f e0 ldi r25, 0x0F ; 15 2782a: 0e 94 b7 77 call 0xef6e ; 0xef6e crashdet_use_eeprom_setting(); 2782e: 0d 94 08 3c jmp 0x27810 ; 0x27810 00027832 : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 27832: cf 93 push r28 27834: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 27836: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 27838: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 2783a: 9f b7 in r25, 0x3f ; 63 2783c: f8 94 cli 2783e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27842: 80 62 ori r24, 0x20 ; 32 27844: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27848: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, HIGH); 2784a: 9f b7 in r25, 0x3f ; 63 2784c: f8 94 cli 2784e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27852: 80 61 ori r24, 0x10 ; 16 27854: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27858: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 2785a: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 2785c: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 2785e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27862: 80 62 ori r24, 0x20 ; 32 27864: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 27868: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2786c: 80 61 ori r24, 0x10 ; 16 2786e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 27872: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27876: 8b 7f andi r24, 0xFB ; 251 27878: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 2787c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27880: 8f 77 andi r24, 0x7F ; 127 27882: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 27886: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2788a: 8f 7b andi r24, 0xBF ; 191 2788c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 27890: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27894: 87 7f andi r24, 0xF7 ; 247 27896: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,HIGH); 2789a: 9f b7 in r25, 0x3f ; 63 2789c: f8 94 cli 2789e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278a2: 84 60 ori r24, 0x04 ; 4 278a4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278a8: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 278aa: 9f b7 in r25, 0x3f ; 63 278ac: f8 94 cli 278ae: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278b2: 80 68 ori r24, 0x80 ; 128 278b4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278b8: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 278ba: 9f b7 in r25, 0x3f ; 63 278bc: f8 94 cli 278be: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278c2: 80 64 ori r24, 0x40 ; 64 278c4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278c8: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 278ca: 9f b7 in r25, 0x3f ; 63 278cc: f8 94 cli 278ce: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278d2: 88 60 ori r24, 0x08 ; 8 278d4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278d8: 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); 278da: 80 e0 ldi r24, 0x00 ; 0 278dc: 0f 94 bf 3a call 0x2757e ; 0x2757e 278e0: 81 e0 ldi r24, 0x01 ; 1 278e2: 0f 94 bf 3a call 0x2757e ; 0x2757e 278e6: 82 e0 ldi r24, 0x02 ; 2 278e8: 0f 94 bf 3a call 0x2757e ; 0x2757e } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 278ec: 50 e0 ldi r21, 0x00 ; 0 278ee: 40 e0 ldi r20, 0x00 ; 0 278f0: 60 91 f9 04 lds r22, 0x04F9 ; 0x8004f9 278f4: 83 e0 ldi r24, 0x03 ; 3 278f6: 0f 94 42 3a call 0x27484 ; 0x27484 tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 278fa: 20 e0 ldi r18, 0x00 ; 0 278fc: 30 e0 ldi r19, 0x00 ; 0 278fe: a9 01 movw r20, r18 27900: 61 e9 ldi r22, 0x91 ; 145 27902: 83 e0 ldi r24, 0x03 ; 3 27904: 0f 94 fe 39 call 0x273fc ; 0x273fc #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 27908: c1 fd sbrc r28, 1 2790a: 1d c0 rjmp .+58 ; 0x27946 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 2790c: 20 e8 ldi r18, 0x80 ; 128 2790e: 31 e0 ldi r19, 0x01 ; 1 27910: 40 e0 ldi r20, 0x00 ; 0 27912: 50 e0 ldi r21, 0x00 ; 0 27914: 60 e8 ldi r22, 0x80 ; 128 27916: 83 e0 ldi r24, 0x03 ; 3 27918: 0f 94 fe 39 call 0x273fc ; 0x273fc 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]); 2791c: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 27920: 80 e0 ldi r24, 0x00 ; 0 27922: 0f 94 56 88 call 0x310ac ; 0x310ac tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 27926: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 2792a: 81 e0 ldi r24, 0x01 ; 1 2792c: 0f 94 56 88 call 0x310ac ; 0x310ac tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 27930: 60 91 fc 04 lds r22, 0x04FC ; 0x8004fc 27934: 82 e0 ldi r24, 0x02 ; 2 27936: 0f 94 56 88 call 0x310ac ; 0x310ac #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 2793a: 60 91 fd 04 lds r22, 0x04FD ; 0x8004fd 2793e: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 27940: 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]); 27942: 0d 94 56 88 jmp 0x310ac ; 0x310ac 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)); 27946: 20 e0 ldi r18, 0x00 ; 0 27948: 30 e0 ldi r19, 0x00 ; 0 2794a: 43 e0 ldi r20, 0x03 ; 3 2794c: 50 e0 ldi r21, 0x00 ; 0 2794e: 6d ee ldi r22, 0xED ; 237 27950: 83 e0 ldi r24, 0x03 ; 3 27952: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 27956: 20 e0 ldi r18, 0x00 ; 0 27958: 30 e0 ldi r19, 0x00 ; 0 2795a: a9 01 movw r20, r18 2795c: 64 e9 ldi r22, 0x94 ; 148 2795e: 83 e0 ldi r24, 0x03 ; 3 27960: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 27964: 24 e0 ldi r18, 0x04 ; 4 27966: 30 e0 ldi r19, 0x00 ; 0 27968: 40 e0 ldi r20, 0x00 ; 0 2796a: 50 e0 ldi r21, 0x00 ; 0 2796c: 60 e8 ldi r22, 0x80 ; 128 2796e: 83 e0 ldi r24, 0x03 ; 3 27970: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 27974: 2b e2 ldi r18, 0x2B ; 43 27976: 34 e5 ldi r19, 0x54 ; 84 27978: 42 e0 ldi r20, 0x02 ; 2 2797a: 50 e0 ldi r21, 0x00 ; 0 2797c: 60 ef ldi r22, 0xF0 ; 240 2797e: 83 e0 ldi r24, 0x03 ; 3 27980: 0f 94 fe 39 call 0x273fc ; 0x273fc tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 27984: 23 e9 ldi r18, 0x93 ; 147 27986: 31 e0 ldi r19, 0x01 ; 1 27988: 40 e0 ldi r20, 0x00 ; 0 2798a: 50 e0 ldi r21, 0x00 ; 0 2798c: 63 e9 ldi r22, 0x93 ; 147 2798e: 83 e0 ldi r24, 0x03 ; 3 27990: 0f 94 fe 39 call 0x273fc ; 0x273fc SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 27994: 8a eb ldi r24, 0xBA ; 186 27996: 9f e9 ldi r25, 0x9F ; 159 27998: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 2799c: bf cf rjmp .-130 ; 0x2791c 0002799e : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 2799e: df 92 push r13 279a0: ef 92 push r14 279a2: ff 92 push r15 279a4: 0f 93 push r16 279a6: 1f 93 push r17 279a8: cf 93 push r28 279aa: df 93 push r29 MENU_BEGIN(); 279ac: 0f 94 08 cf call 0x39e10 ; 0x39e10 279b0: 10 92 13 05 sts 0x0513, r1 ; 0x800513 279b4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 279b8: 84 30 cpi r24, 0x04 ; 4 279ba: 08 f0 brcs .+2 ; 0x279be 279bc: 66 c0 rjmp .+204 ; 0x27a8a 279be: 10 92 16 05 sts 0x0516, r1 ; 0x800516 ON_MENU_LEAVE( 279c2: 0f 94 88 cd call 0x39b10 ; 0x39b10 279c6: 88 23 and r24, r24 279c8: e9 f0 breq .+58 ; 0x27a04 279ca: 0a ef ldi r16, 0xFA ; 250 279cc: 14 e0 ldi r17, 0x04 ; 4 279ce: c7 ef ldi r28, 0xF7 ; 247 279d0: 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) { 279d2: f8 01 movw r30, r16 279d4: 80 81 ld r24, Z 279d6: 8e 31 cpi r24, 0x1E ; 30 279d8: 08 f4 brcc .+2 ; 0x279dc tmc2130_wave_fac[axis] = 0; 279da: 10 82 st Z, r1 279dc: f8 01 movw r30, r16 279de: 61 91 ld r22, Z+ 279e0: 8f 01 movw r16, r30 279e2: ce 01 movw r24, r28 279e4: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 279e8: 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++) { 279ea: c3 3f cpi r28, 0xF3 ; 243 279ec: fe e0 ldi r31, 0x0E ; 14 279ee: df 07 cpc r29, r31 279f0: 81 f7 brne .-32 ; 0x279d2 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(); 279f2: 0e 94 ce f9 call 0x1f39c ; 0x1f39c 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) { } 279f6: e8 94 clt 279f8: d0 f8 bld r13, 0 279fa: 80 fb bst r24, 0 279fc: 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())); 279fe: 8d 2d mov r24, r13 27a00: 0f 94 19 3c call 0x27832 ; 0x27832 { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 27a04: 87 e6 ldi r24, 0x67 ; 103 27a06: 9d e3 ldi r25, 0x3D ; 61 27a08: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 27a0c: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 #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); 27a10: 8d ea ldi r24, 0xAD ; 173 27a12: 96 e5 ldi r25, 0x56 ; 86 27a14: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 27a18: f1 2c mov r15, r1 27a1a: e1 2c mov r14, r1 27a1c: 08 ec ldi r16, 0xC8 ; 200 27a1e: 10 e0 ldi r17, 0x00 ; 0 27a20: 2d e1 ldi r18, 0x1D ; 29 27a22: 30 e0 ldi r19, 0x00 ; 0 27a24: 48 e0 ldi r20, 0x08 ; 8 27a26: 6a ef ldi r22, 0xFA ; 250 27a28: 74 e0 ldi r23, 0x04 ; 4 27a2a: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 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); 27a2e: 81 ea ldi r24, 0xA1 ; 161 27a30: 96 e5 ldi r25, 0x56 ; 86 27a32: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 27a36: 2d e1 ldi r18, 0x1D ; 29 27a38: 30 e0 ldi r19, 0x00 ; 0 27a3a: 48 e0 ldi r20, 0x08 ; 8 27a3c: 6b ef ldi r22, 0xFB ; 251 27a3e: 74 e0 ldi r23, 0x04 ; 4 27a40: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 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); 27a44: 85 e9 ldi r24, 0x95 ; 149 27a46: 96 e5 ldi r25, 0x56 ; 86 27a48: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 27a4c: 2d e1 ldi r18, 0x1D ; 29 27a4e: 30 e0 ldi r19, 0x00 ; 0 27a50: 48 e0 ldi r20, 0x08 ; 8 27a52: 6c ef ldi r22, 0xFC ; 252 27a54: 74 e0 ldi r23, 0x04 ; 4 27a56: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 #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); 27a5a: 89 e8 ldi r24, 0x89 ; 137 27a5c: 96 e5 ldi r25, 0x56 ; 86 27a5e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 27a62: 2d e1 ldi r18, 0x1D ; 29 27a64: 30 e0 ldi r19, 0x00 ; 0 27a66: 48 e0 ldi r20, 0x08 ; 8 27a68: 6d ef ldi r22, 0xFD ; 253 27a6a: 74 e0 ldi r23, 0x04 ; 4 27a6c: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 MENU_END(); 27a70: 0f 94 dc ce call 0x39db8 ; 0x39db8 } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 27a74: 80 91 13 05 lds r24, 0x0513 ; 0x800513 27a78: 8f 5f subi r24, 0xFF ; 255 27a7a: 80 93 13 05 sts 0x0513, r24 ; 0x800513 27a7e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 27a82: 8f 5f subi r24, 0xFF ; 255 27a84: 80 93 15 05 sts 0x0515, r24 ; 0x800515 27a88: 95 cf rjmp .-214 ; 0x279b4 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(); } 27a8a: df 91 pop r29 27a8c: cf 91 pop r28 27a8e: 1f 91 pop r17 27a90: 0f 91 pop r16 27a92: ff 90 pop r15 27a94: ef 90 pop r14 27a96: df 90 pop r13 27a98: 08 95 ret 00027a9a : , 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()); } 27a9a: fc 01 movw r30, r24 27a9c: 20 81 ld r18, Z 27a9e: 92 81 ldd r25, Z+2 ; 0x02 27aa0: 49 2f mov r20, r25 27aa2: 50 e0 ldi r21, 0x00 ; 0 27aa4: 21 11 cpse r18, r1 27aa6: 02 c0 rjmp .+4 ; 0x27aac 27aa8: 44 0f add r20, r20 27aaa: 55 1f adc r21, r21 27aac: 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; } 27aae: 21 11 cpse r18, r1 27ab0: 01 c0 rjmp .+2 ; 0x27ab4 27ab2: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 27ab4: 84 17 cp r24, r20 27ab6: 15 06 cpc r1, r21 27ab8: 31 f0 breq .+12 ; 0x27ac6 27aba: 2c f0 brlt .+10 ; 0x27ac6 27abc: 89 2f mov r24, r25 27abe: 21 11 cpse r18, r1 27ac0: 02 c0 rjmp .+4 ; 0x27ac6 27ac2: 88 0f add r24, r24 27ac4: 08 95 ret 27ac6: 08 95 ret 00027ac8 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 27ac8: 3f b7 in r19, 0x3f ; 63 cli(); 27aca: f8 94 cli m = timer2_overflow_count; 27acc: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 27ad0: 90 91 3b 06 lds r25, 0x063B ; 0x80063b 27ad4: a0 91 3c 06 lds r26, 0x063C ; 0x80063c 27ad8: b0 91 3d 06 lds r27, 0x063D ; 0x80063d #if defined(TCNT2) t = TCNT2; 27adc: 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)) 27ae0: b8 9b sbis 0x17, 0 ; 23 27ae2: 05 c0 rjmp .+10 ; 0x27aee 27ae4: 2f 3f cpi r18, 0xFF ; 255 27ae6: 19 f0 breq .+6 ; 0x27aee m++; 27ae8: 01 96 adiw r24, 0x01 ; 1 27aea: a1 1d adc r26, r1 27aec: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 27aee: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 27af0: ba 2f mov r27, r26 27af2: a9 2f mov r26, r25 27af4: 98 2f mov r25, r24 27af6: 88 27 eor r24, r24 27af8: bc 01 movw r22, r24 27afa: cd 01 movw r24, r26 27afc: 62 0f add r22, r18 27afe: 71 1d adc r23, r1 27b00: 81 1d adc r24, r1 27b02: 91 1d adc r25, r1 27b04: 42 e0 ldi r20, 0x02 ; 2 27b06: 66 0f add r22, r22 27b08: 77 1f adc r23, r23 27b0a: 88 1f adc r24, r24 27b0c: 99 1f adc r25, r25 27b0e: 4a 95 dec r20 27b10: d1 f7 brne .-12 ; 0x27b06 } 27b12: 08 95 ret 00027b14 : void delay2(unsigned long ms) { 27b14: 8f 92 push r8 27b16: 9f 92 push r9 27b18: af 92 push r10 27b1a: bf 92 push r11 27b1c: cf 92 push r12 27b1e: df 92 push r13 27b20: ef 92 push r14 27b22: ff 92 push r15 27b24: 6b 01 movw r12, r22 27b26: 7c 01 movw r14, r24 uint32_t start = micros2(); 27b28: 0f 94 64 3d call 0x27ac8 ; 0x27ac8 27b2c: 4b 01 movw r8, r22 27b2e: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 27b30: c1 14 cp r12, r1 27b32: d1 04 cpc r13, r1 27b34: e1 04 cpc r14, r1 27b36: f1 04 cpc r15, r1 27b38: b9 f0 breq .+46 ; 0x27b68 27b3a: 0f 94 64 3d call 0x27ac8 ; 0x27ac8 27b3e: 68 19 sub r22, r8 27b40: 79 09 sbc r23, r9 27b42: 8a 09 sbc r24, r10 27b44: 9b 09 sbc r25, r11 27b46: 68 3e cpi r22, 0xE8 ; 232 27b48: 73 40 sbci r23, 0x03 ; 3 27b4a: 81 05 cpc r24, r1 27b4c: 91 05 cpc r25, r1 27b4e: 80 f3 brcs .-32 ; 0x27b30 { ms--; 27b50: 21 e0 ldi r18, 0x01 ; 1 27b52: c2 1a sub r12, r18 27b54: d1 08 sbc r13, r1 27b56: e1 08 sbc r14, r1 27b58: f1 08 sbc r15, r1 start += 1000; 27b5a: 88 ee ldi r24, 0xE8 ; 232 27b5c: 88 0e add r8, r24 27b5e: 83 e0 ldi r24, 0x03 ; 3 27b60: 98 1e adc r9, r24 27b62: a1 1c adc r10, r1 27b64: b1 1c adc r11, r1 27b66: e4 cf rjmp .-56 ; 0x27b30 } } } 27b68: ff 90 pop r15 27b6a: ef 90 pop r14 27b6c: df 90 pop r13 27b6e: cf 90 pop r12 27b70: bf 90 pop r11 27b72: af 90 pop r10 27b74: 9f 90 pop r9 27b76: 8f 90 pop r8 27b78: 08 95 ret 00027b7a : * @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() { 27b7a: ef 92 push r14 27b7c: ff 92 push r15 27b7e: 0f 93 push r16 27b80: 1f 93 push r17 27b82: cf 93 push r28 27b84: df 93 push r29 27b86: cd b7 in r28, 0x3d ; 61 27b88: de b7 in r29, 0x3e ; 62 27b8a: 63 97 sbiw r28, 0x13 ; 19 27b8c: 0f b6 in r0, 0x3f ; 63 27b8e: f8 94 cli 27b90: de bf out 0x3e, r29 ; 62 27b92: 0f be out 0x3f, r0 ; 63 27b94: 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) 27b96: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 27b9a: 81 11 cpse r24, r1 27b9c: 3a c0 rjmp .+116 ; 0x27c12 { // Menu was entered. // Initialize its status. _md->status = 1; 27b9e: 81 e0 ldi r24, 0x01 ; 1 27ba0: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 check_babystep(); 27ba4: 0e 94 02 7b call 0xf604 ; 0xf604 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 27ba8: 81 ea ldi r24, 0xA1 ; 161 27baa: 9d e0 ldi r25, 0x0D ; 13 27bac: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 27bb0: 18 2f mov r17, r24 27bb2: 0e 94 c4 77 call 0xef88 ; 0xef88 27bb6: 81 11 cpse r24, r1 27bb8: ee c0 rjmp .+476 ; 0x27d96 _md->babystepMemZ = 0; 27bba: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 27bbe: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 _md->babystepMemZ = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); } // same logic as in babystep_load if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 27bc2: 80 e1 ldi r24, 0x10 ; 16 27bc4: 0e 94 43 f9 call 0x1f286 ; 0x1f286 27bc8: 81 11 cpse r24, r1 27bca: 04 c0 rjmp .+8 ; 0x27bd4 _md->babystepMemZ = 0; 27bcc: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 27bd0: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 27bd4: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 27bd8: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 27bdc: 07 2e mov r0, r23 27bde: 00 0c add r0, r0 27be0: 88 0b sbc r24, r24 27be2: 99 0b sbc r25, r25 27be4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 27be8: 20 91 78 06 lds r18, 0x0678 ; 0x800678 27bec: 30 91 79 06 lds r19, 0x0679 ; 0x800679 27bf0: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 27bf4: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 27bf8: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 27bfc: 60 93 aa 03 sts 0x03AA, r22 ; 0x8003aa 27c00: 70 93 ab 03 sts 0x03AB, r23 ; 0x8003ab 27c04: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 27c08: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad lcd_draw_update = 1; 27c0c: 81 e0 ldi r24, 0x01 ; 1 27c0e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 27c12: 80 91 35 05 lds r24, 0x0535 ; 0x800535 27c16: 90 91 36 05 lds r25, 0x0536 ; 0x800536 27c1a: 00 97 sbiw r24, 0x00 ; 0 27c1c: f1 f1 breq .+124 ; 0x27c9a { _md->babystepMemZ += lcd_encoder; 27c1e: 20 91 a8 03 lds r18, 0x03A8 ; 0x8003a8 27c22: 30 91 a9 03 lds r19, 0x03A9 ; 0x8003a9 27c26: 28 0f add r18, r24 27c28: 39 1f adc r19, r25 27c2a: 30 93 a9 03 sts 0x03A9, r19 ; 0x8003a9 27c2e: 20 93 a8 03 sts 0x03A8, r18 ; 0x8003a8 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 27c32: 21 36 cpi r18, 0x61 ; 97 27c34: 40 ef ldi r20, 0xF0 ; 240 27c36: 34 07 cpc r19, r20 27c38: 0c f0 brlt .+2 ; 0x27c3c 27c3a: ba c0 rjmp .+372 ; 0x27db0 27c3c: 81 e6 ldi r24, 0x61 ; 97 27c3e: 90 ef ldi r25, 0xF0 ; 240 27c40: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 27c44: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 else if (_md->babystepMemZ > Z_BABYSTEP_MAX) _md->babystepMemZ = Z_BABYSTEP_MAX; //0 else babystepsTodoZadd(lcd_encoder); _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 27c48: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 27c4c: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 27c50: 07 2e mov r0, r23 27c52: 00 0c add r0, r0 27c54: 88 0b sbc r24, r24 27c56: 99 0b sbc r25, r25 27c58: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 27c5c: 20 91 78 06 lds r18, 0x0678 ; 0x800678 27c60: 30 91 79 06 lds r19, 0x0679 ; 0x800679 27c64: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 27c68: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 27c6c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 27c70: 60 93 aa 03 sts 0x03AA, r22 ; 0x8003aa 27c74: 70 93 ab 03 sts 0x03AB, r23 ; 0x8003ab 27c78: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac 27c7c: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad _delay(50); 27c80: 62 e3 ldi r22, 0x32 ; 50 27c82: 70 e0 ldi r23, 0x00 ; 0 27c84: 80 e0 ldi r24, 0x00 ; 0 27c86: 90 e0 ldi r25, 0x00 ; 0 27c88: 0f 94 8a 3d call 0x27b14 ; 0x27b14 lcd_encoder = 0; 27c8c: 10 92 36 05 sts 0x0536, r1 ; 0x800536 27c90: 10 92 35 05 sts 0x0535, r1 ; 0x800535 lcd_draw_update = 1; 27c94: 81 e0 ldi r24, 0x01 ; 1 27c96: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 27c9a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27c9e: 88 23 and r24, r24 27ca0: c9 f1 breq .+114 ; 0x27d14 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 27ca2: 81 ea ldi r24, 0xA1 ; 161 27ca4: 9d e0 ldi r25, 0x0D ; 13 27ca6: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 27caa: 2b e0 ldi r18, 0x0B ; 11 27cac: 82 9f mul r24, r18 27cae: c0 01 movw r24, r0 27cb0: 11 24 eor r1, r1 27cb2: be 01 movw r22, r28 27cb4: 6f 5f subi r22, 0xFF ; 255 27cb6: 7f 4f sbci r23, 0xFF ; 255 27cb8: 87 5b subi r24, 0xB7 ; 183 27cba: 92 4f sbci r25, 0xF2 ; 242 27cbc: 0f 94 a2 cd call 0x39b44 ; 0x39b44 lcd_home(); 27cc0: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_print(buffer.c); 27cc4: ce 01 movw r24, r28 27cc6: 01 96 adiw r24, 0x01 ; 1 27cc8: 0e 94 94 71 call 0xe328 ; 0xe328 lcd_set_cursor(0, 1); 27ccc: 61 e0 ldi r22, 0x01 ; 1 27cce: 80 e0 ldi r24, 0x00 ; 0 27cd0: 0e 94 8d 6f call 0xdf1a ; 0xdf1a menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 27cd4: 10 91 aa 03 lds r17, 0x03AA ; 0x8003aa 27cd8: 00 91 ab 03 lds r16, 0x03AB ; 0x8003ab 27cdc: f0 90 ac 03 lds r15, 0x03AC ; 0x8003ac 27ce0: e0 90 ad 03 lds r14, 0x03AD ; 0x8003ad 27ce4: 86 e0 ldi r24, 0x06 ; 6 27ce6: 9d e4 ldi r25, 0x4D ; 77 27ce8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 //! (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); 27cec: ef 92 push r14 27cee: ff 92 push r15 27cf0: 0f 93 push r16 27cf2: 1f 93 push r17 27cf4: 9f 93 push r25 27cf6: 8f 93 push r24 27cf8: 1f 92 push r1 27cfa: 80 e2 ldi r24, 0x20 ; 32 27cfc: 8f 93 push r24 27cfe: 86 eb ldi r24, 0xB6 ; 182 27d00: 93 ea ldi r25, 0xA3 ; 163 27d02: 9f 93 push r25 27d04: 8f 93 push r24 27d06: 0e 94 66 6f call 0xdecc ; 0xdecc 27d0a: 0f b6 in r0, 0x3f ; 63 27d0c: f8 94 cli 27d0e: de bf out 0x3e, r29 ; 62 27d10: 0f be out 0x3f, r0 ; 63 27d12: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 27d14: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 27d18: 81 11 cpse r24, r1 27d1a: 04 c0 rjmp .+8 ; 0x27d24 27d1c: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 27d20: 88 23 and r24, r24 27d22: 51 f1 breq .+84 ; 0x27d78 { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 27d24: 81 ea ldi r24, 0xA1 ; 161 27d26: 9d e0 ldi r25, 0x0D ; 13 27d28: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 27d2c: 9b e0 ldi r25, 0x0B ; 11 27d2e: 89 9f mul r24, r25 27d30: 80 01 movw r16, r0 27d32: 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); 27d34: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 27d38: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 27d3c: c8 01 movw r24, r16 27d3e: 80 5b subi r24, 0xB0 ; 176 27d40: 92 4f sbci r25, 0xF2 ; 242 27d42: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 27d46: 60 91 69 0e lds r22, 0x0E69 ; 0x800e69 27d4a: c8 01 movw r24, r16 27d4c: 8e 5a subi r24, 0xAE ; 174 27d4e: 92 4f sbci r25, 0xF2 ; 242 27d50: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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); 27d54: 60 91 97 03 lds r22, 0x0397 ; 0x800397 27d58: 70 91 98 03 lds r23, 0x0398 ; 0x800398 27d5c: 80 91 99 03 lds r24, 0x0399 ; 0x800399 27d60: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 27d64: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 27d68: c8 01 movw r24, r16 27d6a: 8d 5a subi r24, 0xAD ; 173 27d6c: 92 4f sbci r25, 0xF2 ; 242 27d6e: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 27d72: 80 e1 ldi r24, 0x10 ; 16 27d74: 0e 94 5e e7 call 0x1cebc ; 0x1cebc } menu_back_if_clicked(); 27d78: 0f 94 72 d2 call 0x3a4e4 ; 0x3a4e4 } 27d7c: 63 96 adiw r28, 0x13 ; 19 27d7e: 0f b6 in r0, 0x3f ; 63 27d80: f8 94 cli 27d82: de bf out 0x3e, r29 ; 62 27d84: 0f be out 0x3f, r0 ; 63 27d86: cd bf out 0x3d, r28 ; 61 27d88: df 91 pop r29 27d8a: cf 91 pop r28 27d8c: 1f 91 pop r17 27d8e: 0f 91 pop r16 27d90: ff 90 pop r15 27d92: ef 90 pop r14 27d94: 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-> 27d96: 2b e0 ldi r18, 0x0B ; 11 27d98: 12 9f mul r17, r18 27d9a: c0 01 movw r24, r0 27d9c: 11 24 eor r1, r1 27d9e: 80 5b subi r24, 0xB0 ; 176 27da0: 92 4f sbci r25, 0xF2 ; 242 27da2: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 27da6: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 27daa: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 27dae: 09 cf rjmp .-494 ; 0x27bc2 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 27db0: 12 16 cp r1, r18 27db2: 13 06 cpc r1, r19 27db4: 2c f4 brge .+10 ; 0x27dc0 27db6: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 27dba: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 27dbe: 44 cf rjmp .-376 ; 0x27c48 extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 27dc0: 2f b7 in r18, 0x3f ; 63 27dc2: f8 94 cli babystepsTodo[Z_AXIS] += n; 27dc4: 40 91 68 06 lds r20, 0x0668 ; 0x800668 27dc8: 50 91 69 06 lds r21, 0x0669 ; 0x800669 27dcc: 84 0f add r24, r20 27dce: 95 1f adc r25, r21 27dd0: 90 93 69 06 sts 0x0669, r25 ; 0x800669 27dd4: 80 93 68 06 sts 0x0668, r24 ; 0x800668 CRITICAL_SECTION_END 27dd8: 2f bf out 0x3f, r18 ; 63 27dda: 36 cf rjmp .-404 ; 0x27c48 00027ddc : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 27ddc: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 27de0: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 27de4: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 27de8: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 27dec: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 27df0: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 27df4: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 27df8: 26 17 cp r18, r22 27dfa: 37 07 cpc r19, r23 27dfc: 0c f0 brlt .+2 ; 0x27e00 27dfe: 65 c0 rjmp .+202 ; 0x27eca { if (lcd_encoder != 0) 27e00: 80 91 35 05 lds r24, 0x0535 ; 0x800535 27e04: 90 91 36 05 lds r25, 0x0536 ; 0x800536 27e08: 89 2b or r24, r25 27e0a: b9 f1 breq .+110 ; 0x27e7a { refresh_cmd_timeout(); 27e0c: 0e 94 70 67 call 0xcee0 ; 0xcee0 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; 27e10: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 if (++ next_block_index == BLOCK_BUFFER_SIZE) 27e14: 8f 5f subi r24, 0xFF ; 255 27e16: 80 31 cpi r24, 0x10 ; 16 27e18: 09 f4 brne .+2 ; 0x27e1c next_block_index = 0; 27e1a: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 27e1c: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 if (! planner_queue_full()) 27e20: 98 17 cp r25, r24 27e22: 59 f1 breq .+86 ; 0x27e7a { current_position[E_AXIS] += lcd_encoder; 27e24: 60 91 35 05 lds r22, 0x0535 ; 0x800535 27e28: 70 91 36 05 lds r23, 0x0536 ; 0x800536 27e2c: 07 2e mov r0, r23 27e2e: 00 0c add r0, r0 27e30: 88 0b sbc r24, r24 27e32: 99 0b sbc r25, r25 27e34: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 27e38: 9b 01 movw r18, r22 27e3a: ac 01 movw r20, r24 27e3c: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 27e40: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 27e44: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 27e48: 90 91 50 07 lds r25, 0x0750 ; 0x800750 27e4c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 27e50: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 27e54: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 27e58: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 27e5c: 90 93 50 07 sts 0x0750, r25 ; 0x800750 lcd_encoder = 0; 27e60: 10 92 36 05 sts 0x0536, r1 ; 0x800536 27e64: 10 92 35 05 sts 0x0535, r1 ; 0x800535 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 27e68: 65 e5 ldi r22, 0x55 ; 85 27e6a: 75 e5 ldi r23, 0x55 ; 85 27e6c: 85 ed ldi r24, 0xD5 ; 213 27e6e: 9f e3 ldi r25, 0x3F ; 63 27e70: 0f 94 8b ba call 0x37516 ; 0x37516 lcd_draw_update = 1; 27e74: 81 e0 ldi r24, 0x01 ; 1 27e76: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 27e7a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27e7e: 88 23 and r24, r24 27e80: 11 f1 breq .+68 ; 0x27ec6 { lcd_set_cursor(0, 1); 27e82: 61 e0 ldi r22, 0x01 ; 1 27e84: 80 e0 ldi r24, 0x00 ; 0 27e86: 0e 94 8d 6f call 0xdf1a ; 0xdf1a //! 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); 27e8a: 80 91 50 07 lds r24, 0x0750 ; 0x800750 27e8e: 8f 93 push r24 27e90: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 27e94: 8f 93 push r24 27e96: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 27e9a: 8f 93 push r24 27e9c: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 27ea0: 8f 93 push r24 27ea2: 88 e9 ldi r24, 0x98 ; 152 27ea4: 93 ea ldi r25, 0xA3 ; 163 27ea6: 9f 93 push r25 27ea8: 8f 93 push r24 27eaa: 89 e8 ldi r24, 0x89 ; 137 27eac: 93 ea ldi r25, 0xA3 ; 163 27eae: 9f 93 push r25 27eb0: 8f 93 push r24 27eb2: 0e 94 66 6f call 0xdecc ; 0xdecc 27eb6: 8d b7 in r24, 0x3d ; 61 27eb8: 9e b7 in r25, 0x3e ; 62 27eba: 08 96 adiw r24, 0x08 ; 8 27ebc: 0f b6 in r0, 0x3f ; 63 27ebe: f8 94 cli 27ec0: 9e bf out 0x3e, r25 ; 62 27ec2: 0f be out 0x3f, r0 ; 63 27ec4: 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(); 27ec6: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 }; } void show_preheat_nozzle_warning() { lcd_clear(); 27eca: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 27ece: 87 e9 ldi r24, 0x97 ; 151 27ed0: 9c e4 ldi r25, 0x4C ; 76 27ed2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 27ed6: ac 01 movw r20, r24 27ed8: 60 e0 ldi r22, 0x00 ; 0 27eda: 80 e0 ldi r24, 0x00 ; 0 27edc: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 27ee0: 81 e8 ldi r24, 0x81 ; 129 27ee2: 9c e4 ldi r25, 0x4C ; 76 27ee4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 27ee8: ac 01 movw r20, r24 27eea: 62 e0 ldi r22, 0x02 ; 2 27eec: 80 e0 ldi r24, 0x00 ; 0 27eee: 0e 94 a1 6f call 0xdf42 ; 0xdf42 _delay(2000); 27ef2: 60 ed ldi r22, 0xD0 ; 208 27ef4: 77 e0 ldi r23, 0x07 ; 7 27ef6: 80 e0 ldi r24, 0x00 ; 0 27ef8: 90 e0 ldi r25, 0x00 ; 0 27efa: 0f 94 8a 3d call 0x27b14 ; 0x27b14 lcd_clear(); 27efe: 0e 94 c0 6f call 0xdf80 ; 0xdf80 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 27f02: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 00027f06 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 27f06: 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(); 27f08: f8 94 cli m = timer2_millis; 27f0a: 60 91 36 06 lds r22, 0x0636 ; 0x800636 27f0e: 70 91 37 06 lds r23, 0x0637 ; 0x800637 27f12: 80 91 38 06 lds r24, 0x0638 ; 0x800638 27f16: 90 91 39 06 lds r25, 0x0639 ; 0x800639 SREG = oldSREG; 27f1a: 2f bf out 0x3f, r18 ; 63 return m; } 27f1c: 08 95 ret 00027f1e : } //! @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); 27f1e: 20 e0 ldi r18, 0x00 ; 0 27f20: 30 e0 ldi r19, 0x00 ; 0 27f22: 40 e8 ldi r20, 0x80 ; 128 27f24: 5f eb ldi r21, 0xBF ; 191 27f26: 60 e0 ldi r22, 0x00 ; 0 27f28: 70 e0 ldi r23, 0x00 ; 0 27f2a: cb 01 movw r24, r22 27f2c: 0e 94 62 8a call 0x114c4 ; 0x114c4 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 27f30: 86 e2 ldi r24, 0x26 ; 38 27f32: 9f e6 ldi r25, 0x6F ; 111 27f34: 0e 94 fe 7a call 0xf5fc ; 0xf5fc // Indicate that the printer is paused did_pause_print = true; 27f38: 81 e0 ldi r24, 0x01 ; 1 27f3a: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de } else return false; } bool Stopwatch::pause() { if (isRunning()) { 27f3e: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 27f42: 81 30 cpi r24, 0x01 ; 1 27f44: 69 f4 brne .+26 ; 0x27f60 state = PAUSED; 27f46: 82 e0 ldi r24, 0x02 ; 2 27f48: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b stopTimestamp = _millis(); 27f4c: 0f 94 83 3f call 0x27f06 ; 0x27f06 27f50: 60 93 4d 06 sts 0x064D, r22 ; 0x80064d 27f54: 70 93 4e 06 sts 0x064E, r23 ; 0x80064e 27f58: 80 93 4f 06 sts 0x064F, r24 ; 0x80064f 27f5c: 90 93 50 06 sts 0x0650, r25 ; 0x800650 print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 27f60: 82 e0 ldi r24, 0x02 ; 2 27f62: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 lcd_return_to_status(); 27f66: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 00027f6a ::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) 27f6a: ff 92 push r15 27f6c: 0f 93 push r16 27f6e: 1f 93 push r17 27f70: cf 93 push r28 27f72: df 93 push r29 { if (!m_isRunning) return false; 27f74: fc 01 movw r30, r24 27f76: f0 80 ld r15, Z 27f78: f1 10 cpse r15, r1 27f7a: 08 c0 rjmp .+16 ; 0x27f8c ::expired(unsigned short)+0x22> 27f7c: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 27f7e: 8f 2d mov r24, r15 27f80: df 91 pop r29 27f82: cf 91 pop r28 27f84: 1f 91 pop r17 27f86: 0f 91 pop r16 27f88: ff 90 pop r15 27f8a: 08 95 ret 27f8c: 8b 01 movw r16, r22 27f8e: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 27f90: 0f 94 83 3f call 0x27f06 ; 0x27f06 if (m_started <= m_started + msPeriod) 27f94: 89 81 ldd r24, Y+1 ; 0x01 27f96: 9a 81 ldd r25, Y+2 ; 0x02 27f98: 08 0f add r16, r24 27f9a: 19 1f adc r17, r25 27f9c: 08 17 cp r16, r24 27f9e: 19 07 cpc r17, r25 27fa0: 40 f0 brcs .+16 ; 0x27fb2 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 27fa2: 60 17 cp r22, r16 27fa4: 71 07 cpc r23, r17 27fa6: 18 f4 brcc .+6 ; 0x27fae ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27fa8: 68 17 cp r22, r24 27faa: 79 07 cpc r23, r25 27fac: 38 f7 brcc .-50 ; 0x27f7c ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 27fae: 18 82 st Y, r1 27fb0: e6 cf rjmp .-52 ; 0x27f7e ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27fb2: 60 17 cp r22, r16 27fb4: 71 07 cpc r23, r17 27fb6: c0 f7 brcc .-16 ; 0x27fa8 ::expired(unsigned short)+0x3e> 27fb8: e1 cf rjmp .-62 ; 0x27f7c ::expired(unsigned short)+0x12> 00027fba ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 27fba: fc 01 movw r30, r24 27fbc: 20 81 ld r18, Z 27fbe: 21 11 cpse r18, r1 27fc0: 0d 94 b5 3f jmp 0x27f6a ; 0x27f6a ::expired(unsigned short)> } 27fc4: 81 e0 ldi r24, 0x01 ; 1 27fc6: 08 95 ret 00027fc8 ::start()>: /** * @brief Start timer */ template void Timer::start() 27fc8: cf 93 push r28 27fca: df 93 push r29 27fcc: ec 01 movw r28, r24 { m_started = _millis(); 27fce: 0f 94 83 3f call 0x27f06 ; 0x27f06 27fd2: 7a 83 std Y+2, r23 ; 0x02 27fd4: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 27fd6: 81 e0 ldi r24, 0x01 ; 1 27fd8: 88 83 st Y, r24 } 27fda: df 91 pop r29 27fdc: cf 91 pop r28 27fde: 08 95 ret 00027fe0 : } static uint8_t twi_wait(uint8_t status) { 27fe0: 1f 93 push r17 27fe2: cf 93 push r28 27fe4: df 93 push r29 27fe6: 00 d0 rcall .+0 ; 0x27fe8 27fe8: cd b7 in r28, 0x3d ; 61 27fea: de b7 in r29, 0x3e ; 62 27fec: 18 2f mov r17, r24 ShortTimer timmy; 27fee: 19 82 std Y+1, r1 ; 0x01 27ff0: 1b 82 std Y+3, r1 ; 0x03 27ff2: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 27ff4: ce 01 movw r24, r28 27ff6: 01 96 adiw r24, 0x01 ; 1 27ff8: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> while(!(TWCR & _BV(TWINT))) { 27ffc: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 28000: 87 fd sbrc r24, 7 28002: 0a c0 rjmp .+20 ; 0x28018 if (timmy.expired(TWI_TIMEOUT_MS)) { 28004: 6a e0 ldi r22, 0x0A ; 10 28006: 70 e0 ldi r23, 0x00 ; 0 28008: ce 01 movw r24, r28 2800a: 01 96 adiw r24, 0x01 ; 1 2800c: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 28010: 88 23 and r24, r24 28012: a1 f3 breq .-24 ; 0x27ffc return 2; 28014: 82 e0 ldi r24, 0x02 ; 2 28016: 09 c0 rjmp .+18 ; 0x2802a } } if(TW_STATUS != status) 28018: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2801c: 88 7f andi r24, 0xF8 ; 248 2801e: 18 17 cp r17, r24 28020: 59 f0 breq .+22 ; 0x28038 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 28022: 84 e9 ldi r24, 0x94 ; 148 28024: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 28028: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 2802a: 0f 90 pop r0 2802c: 0f 90 pop r0 2802e: 0f 90 pop r0 28030: df 91 pop r29 28032: cf 91 pop r28 28034: 1f 91 pop r17 28036: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 28038: 80 e0 ldi r24, 0x00 ; 0 2803a: f7 cf rjmp .-18 ; 0x2802a 0002803c : } return standstill; } void tmc2130_check_overtemp() { 2803c: 1f 93 push r17 2803e: cf 93 push r28 28040: df 93 push r29 28042: 00 d0 rcall .+0 ; 0x28044 28044: 1f 92 push r1 28046: cd b7 in r28, 0x3d ; 61 28048: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 2804a: 68 ee ldi r22, 0xE8 ; 232 2804c: 73 e0 ldi r23, 0x03 ; 3 2804e: 8f e3 ldi r24, 0x3F ; 63 28050: 96 e0 ldi r25, 0x06 ; 6 28052: 0f 94 dd 3f call 0x27fba ; 0x27fba ::expired_cont(unsigned short)> 28056: 88 23 and r24, r24 28058: 91 f1 breq .+100 ; 0x280be { for (uint_least8_t i = 0; i < 4; i++) 2805a: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 2805c: 19 82 std Y+1, r1 ; 0x01 2805e: 1a 82 std Y+2, r1 ; 0x02 28060: 1b 82 std Y+3, r1 ; 0x03 28062: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 28064: ae 01 movw r20, r28 28066: 4f 5f subi r20, 0xFF ; 255 28068: 5f 4f sbci r21, 0xFF ; 255 2806a: 6f e6 ldi r22, 0x6F ; 111 2806c: 81 2f mov r24, r17 2806e: 0f 94 a4 39 call 0x27348 ; 0x27348 if (drv_status & ((uint32_t)1 << 26)) 28072: 89 81 ldd r24, Y+1 ; 0x01 28074: 9a 81 ldd r25, Y+2 ; 0x02 28076: ab 81 ldd r26, Y+3 ; 0x03 28078: bc 81 ldd r27, Y+4 ; 0x04 2807a: b2 ff sbrs r27, 2 2807c: 19 c0 rjmp .+50 ; 0x280b0 { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 2807e: 87 e9 ldi r24, 0x97 ; 151 28080: 9e e6 ldi r25, 0x6E ; 110 28082: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 28086: 81 2f mov r24, r17 28088: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 2808c: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 28090: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 28092: 20 e0 ldi r18, 0x00 ; 0 28094: 30 e0 ldi r19, 0x00 ; 0 28096: 41 e0 ldi r20, 0x01 ; 1 28098: 50 e0 ldi r21, 0x00 ; 0 2809a: 6c ee ldi r22, 0xEC ; 236 2809c: 81 2f mov r24, r17 2809e: 0f 94 fe 39 call 0x273fc ; 0x273fc 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++) 280a2: 1f 5f subi r17, 0xFF ; 255 280a4: 14 30 cpi r17, 0x04 ; 4 280a6: a9 f7 brne .-22 ; 0x28092 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 280a8: 87 e9 ldi r24, 0x97 ; 151 280aa: 9e e6 ldi r25, 0x6E ; 110 280ac: 0e 94 8d 7b call 0xf71a ; 0xf71a void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 280b0: 1f 5f subi r17, 0xFF ; 255 280b2: 14 30 cpi r17, 0x04 ; 4 280b4: 99 f6 brne .-90 ; 0x2805c tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 280b6: 8f e3 ldi r24, 0x3F ; 63 280b8: 96 e0 ldi r25, 0x06 ; 6 280ba: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> } } 280be: 0f 90 pop r0 280c0: 0f 90 pop r0 280c2: 0f 90 pop r0 280c4: 0f 90 pop r0 280c6: df 91 pop r29 280c8: cf 91 pop r28 280ca: 1f 91 pop r17 280cc: 08 95 ret 000280ce ::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) 280ce: 8f 92 push r8 280d0: 9f 92 push r9 280d2: af 92 push r10 280d4: bf 92 push r11 280d6: cf 92 push r12 280d8: df 92 push r13 280da: ef 92 push r14 280dc: ff 92 push r15 280de: 1f 93 push r17 280e0: cf 93 push r28 280e2: df 93 push r29 { if (!m_isRunning) return false; 280e4: fc 01 movw r30, r24 280e6: 10 81 ld r17, Z 280e8: 11 11 cpse r17, r1 280ea: 0e c0 rjmp .+28 ; 0x28108 ::expired(unsigned long)+0x3a> 280ec: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 280ee: 81 2f mov r24, r17 280f0: df 91 pop r29 280f2: cf 91 pop r28 280f4: 1f 91 pop r17 280f6: ff 90 pop r15 280f8: ef 90 pop r14 280fa: df 90 pop r13 280fc: cf 90 pop r12 280fe: bf 90 pop r11 28100: af 90 pop r10 28102: 9f 90 pop r9 28104: 8f 90 pop r8 28106: 08 95 ret 28108: 6a 01 movw r12, r20 2810a: 7b 01 movw r14, r22 2810c: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 2810e: 0f 94 83 3f call 0x27f06 ; 0x27f06 28112: 4b 01 movw r8, r22 28114: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 28116: 89 81 ldd r24, Y+1 ; 0x01 28118: 9a 81 ldd r25, Y+2 ; 0x02 2811a: ab 81 ldd r26, Y+3 ; 0x03 2811c: bc 81 ldd r27, Y+4 ; 0x04 2811e: c8 0e add r12, r24 28120: d9 1e adc r13, r25 28122: ea 1e adc r14, r26 28124: fb 1e adc r15, r27 28126: c8 16 cp r12, r24 28128: d9 06 cpc r13, r25 2812a: ea 06 cpc r14, r26 2812c: fb 06 cpc r15, r27 2812e: 60 f0 brcs .+24 ; 0x28148 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 28130: 8c 14 cp r8, r12 28132: 9d 04 cpc r9, r13 28134: ae 04 cpc r10, r14 28136: bf 04 cpc r11, r15 28138: 28 f4 brcc .+10 ; 0x28144 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2813a: 88 16 cp r8, r24 2813c: 99 06 cpc r9, r25 2813e: aa 06 cpc r10, r26 28140: bb 06 cpc r11, r27 28142: a0 f6 brcc .-88 ; 0x280ec ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 28144: 18 82 st Y, r1 28146: d3 cf rjmp .-90 ; 0x280ee ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 28148: 8c 14 cp r8, r12 2814a: 9d 04 cpc r9, r13 2814c: ae 04 cpc r10, r14 2814e: bf 04 cpc r11, r15 28150: a0 f7 brcc .-24 ; 0x2813a ::expired(unsigned long)+0x6c> 28152: cc cf rjmp .-104 ; 0x280ec ::expired(unsigned long)+0x1e> 00028154 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 28154: 0f 93 push r16 28156: 1f 93 push r17 28158: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 2815a: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 2815e: 88 23 and r24, r24 28160: 09 f4 brne .+2 ; 0x28164 28162: 4d c0 rjmp .+154 ; 0x281fe heating_status_counter++; 28164: 80 91 46 06 lds r24, 0x0646 ; 0x800646 28168: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 2816a: 8e 30 cpi r24, 0x0E ; 14 2816c: b0 f4 brcc .+44 ; 0x2819a //! @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++; 2816e: 80 93 46 06 sts 0x0646, r24 ; 0x800646 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 28172: 63 e0 ldi r22, 0x03 ; 3 28174: 87 e0 ldi r24, 0x07 ; 7 28176: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_space(13); 2817a: 8d e0 ldi r24, 0x0D ; 13 2817c: 0e 94 83 6f call 0xdf06 ; 0xdf06 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 28180: c0 e0 ldi r28, 0x00 ; 0 28182: 80 91 46 06 lds r24, 0x0646 ; 0x800646 28186: c8 17 cp r28, r24 28188: 58 f4 brcc .+22 ; 0x281a0 lcd_putc_at(7 + dots, 3, '.'); 2818a: 4e e2 ldi r20, 0x2E ; 46 2818c: 63 e0 ldi r22, 0x03 ; 3 2818e: 87 e0 ldi r24, 0x07 ; 7 28190: 8c 0f add r24, r28 28192: 0e 94 ad 6f call 0xdf5a ; 0xdf5a heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 28196: cf 5f subi r28, 0xFF ; 255 28198: f4 cf rjmp .-24 ; 0x28182 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; 2819a: 10 92 46 06 sts 0x0646, r1 ; 0x800646 2819e: e9 cf rjmp .-46 ; 0x28172 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 281a0: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 281a4: 82 30 cpi r24, 0x02 ; 2 281a6: d1 f0 breq .+52 ; 0x281dc 281a8: 30 f4 brcc .+12 ; 0x281b6 281aa: 81 30 cpi r24, 0x01 ; 1 281ac: 59 f0 breq .+22 ; 0x281c4 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 281ae: cf 91 pop r28 281b0: 1f 91 pop r17 281b2: 0f 91 pop r16 281b4: 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) { 281b6: 83 30 cpi r24, 0x03 ; 3 281b8: f9 f0 breq .+62 ; 0x281f8 281ba: 84 30 cpi r24, 0x04 ; 4 281bc: c1 f7 brne .-16 ; 0x281ae 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)); 281be: 85 eb ldi r24, 0xB5 ; 181 281c0: 99 e4 ldi r25, 0x49 ; 73 281c2: 0e c0 rjmp .+28 ; 0x281e0 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)); 281c4: 8e ed ldi r24, 0xDE ; 222 281c6: 99 e4 ldi r25, 0x49 ; 73 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 281c8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 281cc: ac 01 movw r20, r24 281ce: 63 e0 ldi r22, 0x03 ; 3 281d0: 80 e0 ldi r24, 0x00 ; 0 break; } } } 281d2: cf 91 pop r28 281d4: 1f 91 pop r17 281d6: 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)); 281d8: 0c 94 a1 6f jmp 0xdf42 ; 0xdf42 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)); 281dc: 8e ec ldi r24, 0xCE ; 206 281de: 99 e4 ldi r25, 0x49 ; 73 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)); 281e0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 281e4: ac 01 movw r20, r24 281e6: 63 e0 ldi r22, 0x03 ; 3 281e8: 80 e0 ldi r24, 0x00 ; 0 281ea: 0e 94 a1 6f call 0xdf42 ; 0xdf42 heating_status = HeatingStatus::NO_HEATING; 281ee: 10 92 dd 03 sts 0x03DD, r1 ; 0x8003dd heating_status_counter = 0; 281f2: 10 92 46 06 sts 0x0646, r1 ; 0x800646 281f6: db cf rjmp .-74 ; 0x281ae 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)); 281f8: 80 ec ldi r24, 0xC0 ; 192 281fa: 99 e4 ldi r25, 0x49 ; 73 281fc: e5 cf rjmp .-54 ; 0x281c8 #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 281fe: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 28202: 88 23 and r24, r24 28204: 61 f1 breq .+88 ; 0x2825e } else if (((IS_SD_PRINTING) #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && 28206: 80 91 73 07 lds r24, 0x0773 ; 0x800773 2820a: 81 11 cpse r24, r1 2820c: 28 c0 rjmp .+80 ; 0x2825e (custom_message_type == CustomMsg::Status) && 2820e: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> 28212: 82 30 cpi r24, 0x02 ; 2 28214: 20 f5 brcc .+72 ; 0x2825e } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 28216: 80 91 4d 05 lds r24, 0x054D ; 0x80054d <_ZL26lcd_status_message_timeout.lto_priv.467> 2821a: 81 11 cpse r24, r1 2821c: 16 c0 rjmp .+44 ; 0x2824a (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); 2821e: 80 91 83 14 lds r24, 0x1483 ; 0x801483 28222: 88 23 and r24, r24 28224: 09 f4 brne .+2 ; 0x28228 28226: 35 c0 rjmp .+106 ; 0x28292 28228: 83 e8 ldi r24, 0x83 ; 131 2822a: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 2822c: 20 91 66 0e lds r18, 0x0E66 ; 0x800e66 28230: 64 e1 ldi r22, 0x14 ; 20 28232: 82 0f add r24, r18 28234: 91 1d adc r25, r1 28236: 0e 94 7c 71 call 0xe2f8 ; 0xe2f8 2823a: 81 11 cpse r24, r1 2823c: 2d c0 rjmp .+90 ; 0x28298 { scrollstuff++; 2823e: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 28242: 8f 5f subi r24, 0xFF ; 255 28244: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 28248: b2 cf rjmp .-156 ; 0x281ae 2824a: 40 e2 ldi r20, 0x20 ; 32 2824c: 5e e4 ldi r21, 0x4E ; 78 2824e: 60 e0 ldi r22, 0x00 ; 0 28250: 70 e0 ldi r23, 0x00 ; 0 28252: 8d e4 ldi r24, 0x4D ; 77 28254: 95 e0 ldi r25, 0x05 ; 5 28256: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 2825a: 81 11 cpse r24, r1 2825c: e0 cf rjmp .-64 ; 0x2821e 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) 2825e: 80 91 73 07 lds r24, 0x0773 ; 0x800773 28262: 81 11 cpse r24, r1 28264: 1c c0 rjmp .+56 ; 0x2829e { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 28266: e0 91 73 07 lds r30, 0x0773 ; 0x800773 2826a: ea 30 cpi r30, 0x0A ; 10 2826c: 08 f0 brcs .+2 ; 0x28270 2826e: 9f cf rjmp .-194 ; 0x281ae 28270: f0 e0 ldi r31, 0x00 ; 0 28272: 88 27 eor r24, r24 28274: e1 5c subi r30, 0xC1 ; 193 28276: fe 4b sbci r31, 0xBE ; 190 28278: 8e 4f sbci r24, 0xFE ; 254 2827a: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 2827e: 73 39 cpi r23, 0x93 ; 147 28280: 8f 3a cpi r24, 0xAF ; 175 28282: 73 39 cpi r23, 0x93 ; 147 28284: eb 39 cpi r30, 0x9B ; 155 28286: b7 39 cpi r27, 0x97 ; 151 28288: 63 3b cpi r22, 0xB3 ; 179 2828a: 73 39 cpi r23, 0x93 ; 147 2828c: 73 39 cpi r23, 0x93 ; 147 2828e: f1 3a cpi r31, 0xA1 ; 161 28290: 73 39 cpi r23, 0x93 ; 147 (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); 28292: 8e e6 ldi r24, 0x6E ; 110 28294: 94 e1 ldi r25, 0x14 ; 20 28296: ca cf rjmp .-108 ; 0x2822c if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 28298: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 2829c: 88 cf rjmp .-240 ; 0x281ae } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 2829e: 80 91 4d 05 lds r24, 0x054D ; 0x80054d <_ZL26lcd_status_message_timeout.lto_priv.467> 282a2: 88 23 and r24, r24 282a4: 01 f3 breq .-64 ; 0x28266 * 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; 282a6: 0f 94 83 3f call 0x27f06 ; 0x27f06 282aa: 00 91 4e 05 lds r16, 0x054E ; 0x80054e <_ZL26lcd_status_message_timeout.lto_priv.467+0x1> 282ae: 10 91 4f 05 lds r17, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.467+0x2> 282b2: 20 91 50 05 lds r18, 0x0550 ; 0x800550 <_ZL26lcd_status_message_timeout.lto_priv.467+0x3> 282b6: 30 91 51 05 lds r19, 0x0551 ; 0x800551 <_ZL26lcd_status_message_timeout.lto_priv.467+0x4> 282ba: 60 1b sub r22, r16 282bc: 71 0b sbc r23, r17 282be: 82 0b sbc r24, r18 282c0: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 282c2: 60 3a cpi r22, 0xA0 ; 160 282c4: 7f 40 sbci r23, 0x0F ; 15 282c6: 81 05 cpc r24, r1 282c8: 91 05 cpc r25, r1 282ca: 68 f6 brcc .-102 ; 0x28266 282cc: 70 cf rjmp .-288 ; 0x281ae 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); 282ce: 63 e0 ldi r22, 0x03 ; 3 282d0: 80 91 37 05 lds r24, 0x0537 ; 0x800537 <_ZL22lcd_status_message_idx.lto_priv.464> 282d4: 0e 94 8d 6f call 0xdf1a ; 0xdf1a const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 282d8: 80 91 37 05 lds r24, 0x0537 ; 0x800537 <_ZL22lcd_status_message_idx.lto_priv.464> 282dc: c4 e1 ldi r28, 0x14 ; 20 282de: 6c 2f mov r22, r28 282e0: 68 1b sub r22, r24 282e2: 90 e0 ldi r25, 0x00 ; 0 282e4: 88 5c subi r24, 0xC8 ; 200 282e6: 9a 4f sbci r25, 0xFA ; 250 282e8: 0e 94 7c 71 call 0xe2f8 ; 0xe2f8 lcd_status_message_idx = LCD_WIDTH - padding; 282ec: c8 1b sub r28, r24 282ee: c0 93 37 05 sts 0x0537, r28 ; 0x800537 <_ZL22lcd_status_message_idx.lto_priv.464> 282f2: 5d cf rjmp .-326 ; 0x281ae } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 282f4: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 282f8: 8b 30 cpi r24, 0x0B ; 11 282fa: 08 f1 brcs .+66 ; 0x2833e lcd_set_cursor(0, 3); 282fc: 63 e0 ldi r22, 0x03 ; 3 282fe: 80 e0 ldi r24, 0x00 ; 0 28300: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_space(LCD_WIDTH); 28304: 84 e1 ldi r24, 0x14 ; 20 28306: 0e 94 83 6f call 0xdf06 ; 0xdf06 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 2830a: 85 ea ldi r24, 0xA5 ; 165 2830c: 99 e4 ldi r25, 0x49 ; 73 2830e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 28312: ac 01 movw r20, r24 28314: 63 e0 ldi r22, 0x03 ; 3 28316: 80 e0 ldi r24, 0x00 ; 0 28318: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_P(PSTR(" : ")); 2831c: 83 ec ldi r24, 0xC3 ; 195 2831e: 90 ea ldi r25, 0xA0 ; 160 28320: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_print(custom_message_state - 10); 28324: 60 91 f1 03 lds r22, 0x03F1 ; 0x8003f1 28328: 6a 50 subi r22, 0x0A ; 10 2832a: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 2832c: 07 2e mov r0, r23 2832e: 00 0c add r0, r0 28330: 88 0b sbc r24, r24 28332: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 28334: cf 91 pop r28 28336: 1f 91 pop r17 28338: 0f 91 pop r16 2833a: 0c 94 46 71 jmp 0xe28c ; 0xe28c 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) { 2833e: 83 30 cpi r24, 0x03 ; 3 28340: 31 f4 brne .+12 ; 0x2834e lcd_setstatuspgm(MSG_WELCOME); 28342: 8a e6 ldi r24, 0x6A ; 106 28344: 90 e7 ldi r25, 0x70 ; 112 28346: 0f 94 e2 0b call 0x217c4 ; 0x217c4 custom_message_type = CustomMsg::Status; 2834a: 10 92 73 07 sts 0x0773, r1 ; 0x800773 } if (custom_message_state > 3 && custom_message_state <= 10) { 2834e: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 28352: 84 50 subi r24, 0x04 ; 4 28354: 87 30 cpi r24, 0x07 ; 7 28356: 08 f0 brcs .+2 ; 0x2835a 28358: 2a cf rjmp .-428 ; 0x281ae lcd_set_cursor(0, 3); 2835a: 63 e0 ldi r22, 0x03 ; 3 2835c: 80 e0 ldi r24, 0x00 ; 0 2835e: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_space(19); 28362: 83 e1 ldi r24, 0x13 ; 19 28364: 0e 94 83 6f call 0xdf06 ; 0xdf06 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 28368: 82 e9 ldi r24, 0x92 ; 146 2836a: 99 e4 ldi r25, 0x49 ; 73 2836c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 28370: ac 01 movw r20, r24 28372: 63 e0 ldi r22, 0x03 ; 3 28374: 80 e0 ldi r24, 0x00 ; 0 28376: 0e 94 a1 6f call 0xdf42 ; 0xdf42 custom_message_state--; 2837a: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 2837e: 81 50 subi r24, 0x01 ; 1 28380: 80 93 f1 03 sts 0x03F1, r24 ; 0x8003f1 28384: 14 cf rjmp .-472 ; 0x281ae } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 28386: 64 e1 ldi r22, 0x14 ; 20 28388: 88 e3 ldi r24, 0x38 ; 56 2838a: 95 e0 ldi r25, 0x05 ; 5 2838c: 0e 94 7c 71 call 0xe2f8 ; 0xe2f8 if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 28390: 20 91 44 06 lds r18, 0x0644 ; 0x800644 28394: 30 91 45 06 lds r19, 0x0645 ; 0x800645 28398: 80 91 42 06 lds r24, 0x0642 ; 0x800642 2839c: 90 91 43 06 lds r25, 0x0643 ; 0x800643 283a0: 82 17 cp r24, r18 283a2: 93 07 cpc r25, r19 283a4: 0c f4 brge .+2 ; 0x283a8 283a6: 03 cf rjmp .-506 ; 0x281ae 283a8: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 283ac: 88 23 and r24, r24 283ae: 09 f4 brne .+2 ; 0x283b2 283b0: fe ce rjmp .-516 ; 0x281ae lcd_set_cursor(10, 3); 283b2: 63 e0 ldi r22, 0x03 ; 3 283b4: 8a e0 ldi r24, 0x0A ; 10 283b6: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 283ba: 80 91 43 06 lds r24, 0x0643 ; 0x800643 283be: 8f 93 push r24 283c0: 80 91 42 06 lds r24, 0x0642 ; 0x800642 283c4: 8f 93 push r24 283c6: 80 91 45 06 lds r24, 0x0645 ; 0x800645 283ca: 8f 93 push r24 283cc: 80 91 44 06 lds r24, 0x0644 ; 0x800644 283d0: 8f 93 push r24 283d2: 8a eb ldi r24, 0xBA ; 186 283d4: 90 ea ldi r25, 0xA0 ; 160 } break; case CustomMsg::TempCal: // PINDA temp calibration in progress lcd_set_cursor(0, 3); lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 283d6: 9f 93 push r25 283d8: 8f 93 push r24 283da: 0e 94 66 6f call 0xdecc ; 0xdecc 283de: 0f 90 pop r0 283e0: 0f 90 pop r0 283e2: 0f 90 pop r0 283e4: 0f 90 pop r0 283e6: 0f 90 pop r0 283e8: 0f 90 pop r0 283ea: e1 ce rjmp .-574 ; 0x281ae 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); 283ec: 63 e0 ldi r22, 0x03 ; 3 283ee: 80 e0 ldi r24, 0x00 ; 0 283f0: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 283f4: c0 91 f1 03 lds r28, 0x03F1 ; 0x8003f1 283f8: 82 e3 ldi r24, 0x32 ; 50 283fa: 9a e3 ldi r25, 0x3A ; 58 283fc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 28400: 1f 92 push r1 28402: cf 93 push r28 28404: 9f 93 push r25 28406: 8f 93 push r24 28408: 8c ea ldi r24, 0xAC ; 172 2840a: 90 ea ldi r25, 0xA0 ; 160 2840c: e4 cf rjmp .-56 ; 0x283d6 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 2840e: 82 e8 ldi r24, 0x82 ; 130 28410: 99 e4 ldi r25, 0x49 ; 73 28412: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 28416: ac 01 movw r20, r24 28418: 63 e0 ldi r22, 0x03 ; 3 2841a: 80 e0 ldi r24, 0x00 ; 0 2841c: 0e 94 a1 6f call 0xdf42 ; 0xdf42 if (custom_message_state <= PINDA_HEAT_T) { 28420: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 28424: 89 37 cpi r24, 0x79 ; 121 28426: 08 f0 brcs .+2 ; 0x2842a 28428: c2 ce rjmp .-636 ; 0x281ae lcd_puts_P(PSTR(": ")); 2842a: 89 ea ldi r24, 0xA9 ; 169 2842c: 90 ea ldi r25, 0xA0 ; 160 2842e: 0e 94 78 6f call 0xdef0 ; 0xdef0 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 28432: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 28436: 0e 94 3c 70 call 0xe078 ; 0xe078 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 2843a: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2843c: cf 91 pop r28 2843e: 1f 91 pop r17 28440: 0f 91 pop r16 28442: 0c 94 3c 70 jmp 0xe078 ; 0xe078 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 28446: 81 e7 ldi r24, 0x71 ; 113 28448: 99 e4 ldi r25, 0x49 ; 73 2844a: be ce rjmp .-644 ; 0x281c8 0002844c ::start()>: /** * @brief Start timer */ template void Timer::start() 2844c: cf 93 push r28 2844e: df 93 push r29 28450: ec 01 movw r28, r24 { m_started = _millis(); 28452: 0f 94 83 3f call 0x27f06 ; 0x27f06 28456: 69 83 std Y+1, r22 ; 0x01 28458: 7a 83 std Y+2, r23 ; 0x02 2845a: 8b 83 std Y+3, r24 ; 0x03 2845c: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 2845e: 81 e0 ldi r24, 0x01 ; 1 28460: 88 83 st Y, r24 } 28462: df 91 pop r29 28464: cf 91 pop r28 28466: 08 95 ret 00028468 : //! 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) { 28468: cf 92 push r12 2846a: df 92 push r13 2846c: ff 92 push r15 2846e: 0f 93 push r16 28470: 1f 93 push r17 28472: cf 93 push r28 28474: df 93 push r29 28476: cd b7 in r28, 0x3d ; 61 28478: de b7 in r29, 0x3e ; 62 2847a: 64 97 sbiw r28, 0x14 ; 20 2847c: 0f b6 in r0, 0x3f ; 63 2847e: f8 94 cli 28480: de bf out 0x3e, r29 ; 62 28482: 0f be out 0x3f, r0 ; 63 28484: cd bf out 0x3d, r28 ; 61 28486: 8c 01 movw r16, r24 28488: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 2848a: 6d eb ldi r22, 0xBD ; 189 2848c: 7e e9 ldi r23, 0x9E ; 158 2848e: ce 01 movw r24, r28 28490: 01 96 adiw r24, 0x01 ; 1 28492: 0f 94 40 db call 0x3b680 ; 0x3b680 strcat_P(msg, type); 28496: b8 01 movw r22, r16 28498: ce 01 movw r24, r28 2849a: 01 96 adiw r24, 0x01 ; 1 2849c: 0f 94 2c db call 0x3b658 ; 0x3b658 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 284a0: 83 e0 ldi r24, 0x03 ; 3 284a2: 0f 94 a9 06 call 0x20d52 ; 0x20d52 284a6: 88 23 and r24, r24 284a8: e1 f0 breq .+56 ; 0x284e2 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 284aa: be 01 movw r22, r28 284ac: 6f 5f subi r22, 0xFF ; 255 284ae: 7f 4f sbci r23, 0xFF ; 255 284b0: 88 e3 ldi r24, 0x38 ; 56 284b2: 95 e0 ldi r25, 0x05 ; 5 284b4: 0f 94 eb e3 call 0x3c7d6 ; 0x3c7d6 284b8: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 284ba: 8d e4 ldi r24, 0x4D ; 77 284bc: 95 e0 ldi r25, 0x05 ; 5 284be: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> lcd_status_message_level = severity; 284c2: 83 e0 ldi r24, 0x03 ; 3 284c4: 80 93 cf 03 sts 0x03CF, r24 ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> custom_message_type = CustomMsg::Status; 284c8: 10 92 73 07 sts 0x0773, r1 ; 0x800773 custom_message_state = 0; 284cc: 10 92 f1 03 sts 0x03F1, r1 ; 0x8003f1 if (!same) { 284d0: cd 28 or r12, r13 284d2: 39 f0 breq .+14 ; 0x284e2 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 284d4: 60 e0 ldi r22, 0x00 ; 0 284d6: ce 01 movw r24, r28 284d8: 01 96 adiw r24, 0x01 ; 1 284da: 0f 94 8e 06 call 0x20d1c ; 0x20d1c lcd_return_to_status(); 284de: 0f 94 4b 27 call 0x24e96 ; 0x24e96 lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 284e2: 8a eb ldi r24, 0xBA ; 186 284e4: 99 ea ldi r25, 0xA9 ; 169 284e6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if(e != EXTRUDERS) { 284ea: 81 e0 ldi r24, 0x01 ; 1 284ec: f8 16 cp r15, r24 284ee: 49 f0 breq .+18 ; 0x28502 284f0: 60 e0 ldi r22, 0x00 ; 0 284f2: 70 e0 ldi r23, 0x00 ; 0 284f4: cb 01 movw r24, r22 284f6: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 284fa: 8a eb ldi r24, 0xBA ; 186 284fc: 9e e9 ldi r25, 0x9E ; 158 284fe: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } SERIAL_ERRORPGM("Heaters switched off. "); 28502: 83 ea ldi r24, 0xA3 ; 163 28504: 9e e9 ldi r25, 0x9E ; 158 28506: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORRPGM(type); 2850a: c8 01 movw r24, r16 2850c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORLNPGM(" triggered!"); 28510: 87 e9 ldi r24, 0x97 ; 151 28512: 9e e9 ldi r25, 0x9E ; 158 28514: 0e 94 fe 7a call 0xf5fc ; 0xf5fc } 28518: 64 96 adiw r28, 0x14 ; 20 2851a: 0f b6 in r0, 0x3f ; 63 2851c: f8 94 cli 2851e: de bf out 0x3e, r29 ; 62 28520: 0f be out 0x3f, r0 ; 63 28522: cd bf out 0x3d, r28 ; 61 28524: df 91 pop r29 28526: cf 91 pop r28 28528: 1f 91 pop r17 2852a: 0f 91 pop r16 2852c: ff 90 pop r15 2852e: df 90 pop r13 28530: cf 90 pop r12 28532: 08 95 ret 00028534 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 28534: 1f 92 push r1 28536: 0f 92 push r0 28538: 0f b6 in r0, 0x3f ; 63 2853a: 0f 92 push r0 2853c: 11 24 eor r1, r1 2853e: 2f 93 push r18 28540: 3f 93 push r19 28542: 8f 93 push r24 28544: 9f 93 push r25 28546: af 93 push r26 28548: 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; 2854a: 80 91 36 06 lds r24, 0x0636 ; 0x800636 2854e: 90 91 37 06 lds r25, 0x0637 ; 0x800637 28552: a0 91 38 06 lds r26, 0x0638 ; 0x800638 28556: b0 91 39 06 lds r27, 0x0639 ; 0x800639 unsigned char f = timer2_fract; 2855a: 30 91 35 06 lds r19, 0x0635 ; 0x800635 m += MILLIS_INC; f += FRACT_INC; 2855e: 23 e0 ldi r18, 0x03 ; 3 28560: 23 0f add r18, r19 if (f >= FRACT_MAX) 28562: 2d 37 cpi r18, 0x7D ; 125 28564: 58 f5 brcc .+86 ; 0x285bc <__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; 28566: 01 96 adiw r24, 0x01 ; 1 28568: a1 1d adc r26, r1 2856a: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 2856c: 20 93 35 06 sts 0x0635, r18 ; 0x800635 timer2_millis = m; 28570: 80 93 36 06 sts 0x0636, r24 ; 0x800636 28574: 90 93 37 06 sts 0x0637, r25 ; 0x800637 28578: a0 93 38 06 sts 0x0638, r26 ; 0x800638 2857c: b0 93 39 06 sts 0x0639, r27 ; 0x800639 timer2_overflow_count++; 28580: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 28584: 90 91 3b 06 lds r25, 0x063B ; 0x80063b 28588: a0 91 3c 06 lds r26, 0x063C ; 0x80063c 2858c: b0 91 3d 06 lds r27, 0x063D ; 0x80063d 28590: 01 96 adiw r24, 0x01 ; 1 28592: a1 1d adc r26, r1 28594: b1 1d adc r27, r1 28596: 80 93 3a 06 sts 0x063A, r24 ; 0x80063a 2859a: 90 93 3b 06 sts 0x063B, r25 ; 0x80063b 2859e: a0 93 3c 06 sts 0x063C, r26 ; 0x80063c 285a2: b0 93 3d 06 sts 0x063D, r27 ; 0x80063d } 285a6: bf 91 pop r27 285a8: af 91 pop r26 285aa: 9f 91 pop r25 285ac: 8f 91 pop r24 285ae: 3f 91 pop r19 285b0: 2f 91 pop r18 285b2: 0f 90 pop r0 285b4: 0f be out 0x3f, r0 ; 63 285b6: 0f 90 pop r0 285b8: 1f 90 pop r1 285ba: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 285bc: 26 e8 ldi r18, 0x86 ; 134 285be: 23 0f add r18, r19 m += 1; 285c0: 02 96 adiw r24, 0x02 ; 2 285c2: a1 1d adc r26, r1 285c4: b1 1d adc r27, r1 285c6: d2 cf rjmp .-92 ; 0x2856c <__vector_15+0x38> 000285c8 : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 285c8: 2f 92 push r2 285ca: 3f 92 push r3 285cc: 4f 92 push r4 285ce: 5f 92 push r5 285d0: 6f 92 push r6 285d2: 7f 92 push r7 285d4: 8f 92 push r8 285d6: 9f 92 push r9 285d8: af 92 push r10 285da: bf 92 push r11 285dc: cf 92 push r12 285de: df 92 push r13 285e0: ef 92 push r14 285e2: ff 92 push r15 285e4: 0f 93 push r16 285e6: 1f 93 push r17 285e8: cf 93 push r28 285ea: df 93 push r29 285ec: 00 d0 rcall .+0 ; 0x285ee 285ee: 00 d0 rcall .+0 ; 0x285f0 285f0: 1f 92 push r1 285f2: cd b7 in r28, 0x3d ; 61 285f4: de b7 in r29, 0x3e ; 62 285f6: 9c 83 std Y+4, r25 ; 0x04 285f8: 8b 83 std Y+3, r24 ; 0x03 285fa: 0d 83 std Y+5, r16 ; 0x05 285fc: 26 01 movw r4, r12 285fe: 37 01 movw r6, r14 *var = v; 28600: fb 01 movw r30, r22 28602: 20 83 st Z, r18 28604: 31 83 std Z+1, r19 ; 0x01 28606: 42 83 std Z+2, r20 ; 0x02 28608: 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); 2860a: 20 91 c2 12 lds r18, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 2860e: 30 91 c3 12 lds r19, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 28612: 40 91 c4 12 lds r20, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 28616: 50 91 c5 12 lds r21, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 2861a: 61 e7 ldi r22, 0x71 ; 113 2861c: 7d e3 ldi r23, 0x3D ; 61 2861e: 8a e8 ldi r24, 0x8A ; 138 28620: 9e e3 ldi r25, 0x3E ; 62 28622: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 28626: 60 93 19 13 sts 0x1319, r22 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 2862a: 70 93 1a 13 sts 0x131A, r23 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 2862e: 80 93 1b 13 sts 0x131B, r24 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 28632: 90 93 1c 13 sts 0x131C, r25 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> warn_s = warn * TEMP_MGR_INTV; 28636: 21 e7 ldi r18, 0x71 ; 113 28638: 3d e3 ldi r19, 0x3D ; 61 2863a: 4a e8 ldi r20, 0x8A ; 138 2863c: 5e e3 ldi r21, 0x3E ; 62 2863e: 60 91 10 13 lds r22, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 28642: 70 91 11 13 lds r23, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 28646: 80 91 12 13 lds r24, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 2864a: 90 91 13 13 lds r25, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 2864e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 28652: 60 93 1d 13 sts 0x131D, r22 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 28656: 70 93 1e 13 sts 0x131E, r23 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 2865a: 80 93 1f 13 sts 0x131F, r24 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 2865e: 90 93 20 13 sts 0x1320, r25 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> err_s = err * TEMP_MGR_INTV; 28662: 21 e7 ldi r18, 0x71 ; 113 28664: 3d e3 ldi r19, 0x3D ; 61 28666: 4a e8 ldi r20, 0x8A ; 138 28668: 5e e3 ldi r21, 0x3E ; 62 2866a: 60 91 14 13 lds r22, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 2866e: 70 91 15 13 lds r23, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 28672: 80 91 16 13 lds r24, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 28676: 90 91 17 13 lds r25, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 2867a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2867e: 60 93 21 13 sts 0x1321, r22 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 28682: 70 93 22 13 sts 0x1322, r23 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 28686: 80 93 23 13 sts 0x1323, r24 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 2868a: 90 93 24 13 sts 0x1324, r25 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 2868e: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 28692: 90 91 cb 12 lds r25, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 28696: 6e e0 ldi r22, 0x0E ; 14 28698: 71 e0 ldi r23, 0x01 ; 1 2869a: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 2869e: 60 93 ac 12 sts 0x12AC, r22 ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 286a2: ec e8 ldi r30, 0x8C ; 140 286a4: 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; 286a6: 80 e0 ldi r24, 0x00 ; 0 286a8: 90 e0 ldi r25, 0x00 ; 0 286aa: a0 ec ldi r26, 0xC0 ; 192 286ac: bf e7 ldi r27, 0x7F ; 127 286ae: 81 93 st Z+, r24 286b0: 91 93 st Z+, r25 286b2: a1 93 st Z+, r26 286b4: 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) 286b6: 22 e1 ldi r18, 0x12 ; 18 286b8: ec 3a cpi r30, 0xAC ; 172 286ba: f2 07 cpc r31, r18 286bc: c1 f7 brne .-16 ; 0x286ae dT_lag_buf[i] = NAN; dT_lag_idx = 0; 286be: 10 92 ad 12 sts 0x12AD, r1 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> dT_err_prev = 0; 286c2: 10 92 ae 12 sts 0x12AE, r1 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 286c6: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 286ca: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 286ce: 10 92 b1 12 sts 0x12B1, r1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> T_prev = NAN; 286d2: 80 93 b2 12 sts 0x12B2, r24 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 286d6: 90 93 b3 12 sts 0x12B3, r25 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 286da: a0 93 b4 12 sts 0x12B4, r26 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 286de: b0 93 b5 12 sts 0x12B5, r27 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> // clear the initialization flag flag_bits.uninitialized = false; 286e2: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 286e6: 8e 7f andi r24, 0xFE ; 254 286e8: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 286ec: 84 e7 ldi r24, 0x74 ; 116 286ee: 97 e0 ldi r25, 0x07 ; 7 286f0: 9f 83 std Y+7, r25 ; 0x07 286f2: 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) { 286f4: e1 e0 ldi r30, 0x01 ; 1 286f6: f0 e0 ldi r31, 0x00 ; 0 286f8: fa 83 std Y+2, r31 ; 0x02 286fa: 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; 286fc: 31 2c mov r3, r1 286fe: 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; 28700: 81 2c mov r8, r1 28702: 91 2c mov r9, r1 28704: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 28706: 29 81 ldd r18, Y+1 ; 0x01 28708: 3a 81 ldd r19, Y+2 ; 0x02 2870a: 8b 81 ldd r24, Y+3 ; 0x03 2870c: 9c 81 ldd r25, Y+4 ; 0x04 2870e: 28 17 cp r18, r24 28710: 39 07 cpc r19, r25 28712: c8 f5 brcc .+114 ; 0x28786 thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 28714: ee 81 ldd r30, Y+6 ; 0x06 28716: ff 81 ldd r31, Y+7 ; 0x07 28718: 25 81 ldd r18, Z+5 ; 0x05 2871a: 36 81 ldd r19, Z+6 ; 0x06 2871c: 47 81 ldd r20, Z+7 ; 0x07 2871e: 50 85 ldd r21, Z+8 ; 0x08 28720: 83 01 movw r16, r6 28722: 72 01 movw r14, r4 28724: 6d 81 ldd r22, Y+5 ; 0x05 28726: 81 85 ldd r24, Z+9 ; 0x09 28728: 0e 94 aa db call 0x1b754 ; 0x1b754 float err_v = thermal_model::data.dT_err_prev; 2872c: c0 90 ae 12 lds r12, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 28730: d0 90 af 12 lds r13, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 28734: e0 90 b0 12 lds r14, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 28738: f0 90 b1 12 lds r15, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> if(!isnan(err_v)) { 2873c: a7 01 movw r20, r14 2873e: 96 01 movw r18, r12 28740: c7 01 movw r24, r14 28742: b6 01 movw r22, r12 28744: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 28748: 81 11 cpse r24, r1 2874a: 11 c0 rjmp .+34 ; 0x2876e err += err_v * err_v; 2874c: a7 01 movw r20, r14 2874e: 96 01 movw r18, r12 28750: c7 01 movw r24, r14 28752: b6 01 movw r22, r12 28754: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 28758: 9b 01 movw r18, r22 2875a: ac 01 movw r20, r24 2875c: c5 01 movw r24, r10 2875e: b4 01 movw r22, r8 28760: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 28764: 4b 01 movw r8, r22 28766: 5c 01 movw r10, r24 ++cnt; 28768: ff ef ldi r31, 0xFF ; 255 2876a: 2f 1a sub r2, r31 2876c: 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) { 2876e: 29 81 ldd r18, Y+1 ; 0x01 28770: 3a 81 ldd r19, Y+2 ; 0x02 28772: 2f 5f subi r18, 0xFF ; 255 28774: 3f 4f sbci r19, 0xFF ; 255 28776: 3a 83 std Y+2, r19 ; 0x02 28778: 29 83 std Y+1, r18 ; 0x01 2877a: 8e 81 ldd r24, Y+6 ; 0x06 2877c: 9f 81 ldd r25, Y+7 ; 0x07 2877e: 05 96 adiw r24, 0x05 ; 5 28780: 9f 83 std Y+7, r25 ; 0x07 28782: 8e 83 std Y+6, r24 ; 0x06 28784: c0 cf rjmp .-128 ; 0x28706 if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 28786: 60 e0 ldi r22, 0x00 ; 0 28788: 70 e0 ldi r23, 0x00 ; 0 2878a: 80 ec ldi r24, 0xC0 ; 192 2878c: 9f e7 ldi r25, 0x7F ; 127 2878e: 21 14 cp r2, r1 28790: 31 04 cpc r3, r1 28792: 59 f0 breq .+22 ; 0x287aa 28794: b1 01 movw r22, r2 28796: 90 e0 ldi r25, 0x00 ; 0 28798: 80 e0 ldi r24, 0x00 ; 0 2879a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 2879e: 9b 01 movw r18, r22 287a0: ac 01 movw r20, r24 287a2: c5 01 movw r24, r10 287a4: b4 01 movw r22, r8 287a6: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> } 287aa: 27 96 adiw r28, 0x07 ; 7 287ac: 0f b6 in r0, 0x3f ; 63 287ae: f8 94 cli 287b0: de bf out 0x3e, r29 ; 62 287b2: 0f be out 0x3f, r0 ; 63 287b4: cd bf out 0x3d, r28 ; 61 287b6: df 91 pop r29 287b8: cf 91 pop r28 287ba: 1f 91 pop r17 287bc: 0f 91 pop r16 287be: ff 90 pop r15 287c0: ef 90 pop r14 287c2: df 90 pop r13 287c4: cf 90 pop r12 287c6: bf 90 pop r11 287c8: af 90 pop r10 287ca: 9f 90 pop r9 287cc: 8f 90 pop r8 287ce: 7f 90 pop r7 287d0: 6f 90 pop r6 287d2: 5f 90 pop r5 287d4: 4f 90 pop r4 287d6: 3f 90 pop r3 287d8: 2f 90 pop r2 287da: 08 95 ret 000287dc : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 287dc: cf 93 push r28 287de: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 287e0: 0e 94 bb 75 call 0xeb76 ; 0xeb76 fanSpeed = fan_speed; 287e4: c0 93 e1 03 sts 0x03E1, r28 ; 0x8003e1 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 287e8: c0 93 9e 04 sts 0x049E, r28 ; 0x80049e #endif } 287ec: cf 91 pop r28 287ee: 08 95 ret 000287f0 : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 287f0: cf 92 push r12 287f2: df 92 push r13 287f4: ef 92 push r14 287f6: ff 92 push r15 287f8: 0f 93 push r16 287fa: 1f 93 push r17 287fc: cf 93 push r28 287fe: df 93 push r29 SERIAL_ECHO_START; 28800: 82 ee ldi r24, 0xE2 ; 226 28802: 99 ea ldi r25, 0xA9 ; 169 28804: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNPGM("Thermal Model settings:"); 28808: 82 e6 ldi r24, 0x62 ; 98 2880a: 9f e9 ldi r25, 0x9F ; 159 2880c: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 28810: cc ec ldi r28, 0xCC ; 204 28812: d2 e1 ldi r29, 0x12 ; 18 28814: 10 e0 ldi r17, 0x00 ; 0 28816: 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]); 28818: 82 ee ldi r24, 0xE2 ; 226 2881a: e8 2e mov r14, r24 2881c: 89 ea ldi r24, 0xA9 ; 169 2881e: f8 2e mov r15, r24 28820: 9e e4 ldi r25, 0x4E ; 78 28822: c9 2e mov r12, r25 28824: 9f e9 ldi r25, 0x9F ; 159 28826: d9 2e mov r13, r25 28828: 88 81 ld r24, Y 2882a: 99 81 ldd r25, Y+1 ; 0x01 2882c: 2a 81 ldd r18, Y+2 ; 0x02 2882e: 3b 81 ldd r19, Y+3 ; 0x03 28830: 24 96 adiw r28, 0x04 ; 4 28832: 3f 93 push r19 28834: 2f 93 push r18 28836: 9f 93 push r25 28838: 8f 93 push r24 2883a: 1f 93 push r17 2883c: 0f 93 push r16 2883e: ff 92 push r15 28840: ef 92 push r14 28842: df 92 push r13 28844: cf 92 push r12 28846: 0f 94 4b dc call 0x3b896 ; 0x3b896 2884a: 0f 5f subi r16, 0xFF ; 255 2884c: 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) 2884e: 8d b7 in r24, 0x3d ; 61 28850: 9e b7 in r25, 0x3e ; 62 28852: 0a 96 adiw r24, 0x0a ; 10 28854: 0f b6 in r0, 0x3f ; 63 28856: f8 94 cli 28858: 9e bf out 0x3e, r25 ; 62 2885a: 0f be out 0x3f, r0 ; 63 2885c: 8d bf out 0x3d, r24 ; 61 2885e: 00 31 cpi r16, 0x10 ; 16 28860: 11 05 cpc r17, r1 28862: 11 f7 brne .-60 ; 0x28828 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"), 28864: 80 91 0f 13 lds r24, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 28868: 8f 93 push r24 2886a: 80 91 0e 13 lds r24, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 2886e: 8f 93 push r24 28870: 80 91 0d 13 lds r24, 0x130D ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 28874: 8f 93 push r24 28876: 80 91 0c 13 lds r24, 0x130C ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 2887a: 8f 93 push r24 2887c: 80 91 13 13 lds r24, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 28880: 8f 93 push r24 28882: 80 91 12 13 lds r24, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 28886: 8f 93 push r24 28888: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 2888c: 8f 93 push r24 2888e: 80 91 10 13 lds r24, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 28892: 8f 93 push r24 28894: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 28898: 8f 93 push r24 2889a: 80 91 16 13 lds r24, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 2889e: 8f 93 push r24 288a0: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 288a4: 8f 93 push r24 288a6: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 288aa: 8f 93 push r24 288ac: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> 288b0: 1f 92 push r1 288b2: 8f 93 push r24 288b4: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> 288b8: 1f 92 push r1 288ba: 8f 93 push r24 288bc: 80 91 cb 12 lds r24, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 288c0: 8f 93 push r24 288c2: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 288c6: 8f 93 push r24 288c8: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> 288cc: 8f 93 push r24 288ce: 80 91 c8 12 lds r24, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 288d2: 8f 93 push r24 288d4: 80 91 c7 12 lds r24, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 288d8: 8f 93 push r24 288da: 80 91 c6 12 lds r24, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 288de: 8f 93 push r24 288e0: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 288e4: 8f 93 push r24 288e6: 80 91 c4 12 lds r24, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 288ea: 8f 93 push r24 288ec: 80 91 c3 12 lds r24, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 288f0: 8f 93 push r24 288f2: 80 91 c2 12 lds r24, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 288f6: 8f 93 push r24 288f8: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 288fc: 8f 93 push r24 288fe: 80 91 c0 12 lds r24, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 28902: 8f 93 push r24 28904: 80 91 bf 12 lds r24, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 28908: 8f 93 push r24 2890a: 80 91 be 12 lds r24, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 2890e: 8f 93 push r24 28910: 80 91 bd 12 lds r24, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 28914: 8f 93 push r24 28916: 80 91 bc 12 lds r24, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 2891a: 8f 93 push r24 2891c: 80 91 bb 12 lds r24, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 28920: 8f 93 push r24 28922: 80 91 ba 12 lds r24, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 28926: 8f 93 push r24 28928: 80 91 b9 12 lds r24, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 2892c: 8f 93 push r24 2892e: 80 91 b8 12 lds r24, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 28932: 8f 93 push r24 28934: 80 91 b7 12 lds r24, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 28938: 8f 93 push r24 2893a: 80 91 b6 12 lds r24, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 2893e: 8f 93 push r24 28940: ff 92 push r15 28942: ef 92 push r14 28944: 88 e0 ldi r24, 0x08 ; 8 28946: 9f e9 ldi r25, 0x9F ; 159 28948: 9f 93 push r25 2894a: 8f 93 push r24 2894c: 0f 94 4b dc call 0x3b896 ; 0x3b896 28950: 8d b7 in r24, 0x3d ; 61 28952: 9e b7 in r25, 0x3e ; 62 28954: 8a 96 adiw r24, 0x2a ; 42 28956: 0f b6 in r0, 0x3f ; 63 28958: f8 94 cli 2895a: 9e bf out 0x3e, r25 ; 62 2895c: 0f be out 0x3f, r0 ; 63 2895e: 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); } 28960: df 91 pop r29 28962: cf 91 pop r28 28964: 1f 91 pop r17 28966: 0f 91 pop r16 28968: ff 90 pop r15 2896a: ef 90 pop r14 2896c: df 90 pop r13 2896e: cf 90 pop r12 28970: 08 95 ret 00028972 : // 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); 28972: 89 57 subi r24, 0x79 ; 121 28974: 9f 4f sbci r25, 0xFF ; 255 28976: 6e e0 ldi r22, 0x0E ; 14 28978: 71 e0 ldi r23, 0x01 ; 1 2897a: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 2897e: 61 15 cp r22, r1 28980: 71 05 cpc r23, r1 28982: 99 f0 breq .+38 ; 0x289aa 28984: 69 30 cpi r22, 0x09 ; 9 28986: 71 05 cpc r23, r1 28988: 10 f0 brcs .+4 ; 0x2898e 2898a: 68 e0 ldi r22, 0x08 ; 8 2898c: 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; 2898e: 2e e0 ldi r18, 0x0E ; 14 28990: 31 e0 ldi r19, 0x01 ; 1 28992: 62 9f mul r22, r18 28994: c0 01 movw r24, r0 28996: 63 9f mul r22, r19 28998: 90 0d add r25, r0 2899a: 72 9f mul r23, r18 2899c: 90 0d add r25, r0 2899e: 11 24 eor r1, r1 289a0: 90 93 cb 12 sts 0x12CB, r25 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 289a4: 80 93 ca 12 sts 0x12CA, r24 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> } 289a8: 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; 289aa: 61 e0 ldi r22, 0x01 ; 1 289ac: 70 e0 ldi r23, 0x00 ; 0 289ae: ef cf rjmp .-34 ; 0x2898e 000289b0 : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 289b0: cf 93 push r28 289b2: df 93 push r29 if(!(data.P > 0)) return false; 289b4: 20 e0 ldi r18, 0x00 ; 0 289b6: 30 e0 ldi r19, 0x00 ; 0 289b8: a9 01 movw r20, r18 289ba: 60 91 b6 12 lds r22, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 289be: 70 91 b7 12 lds r23, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 289c2: 80 91 b8 12 lds r24, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 289c6: 90 91 b9 12 lds r25, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 289ca: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 289ce: 18 16 cp r1, r24 289d0: 0c f0 brlt .+2 ; 0x289d4 289d2: 54 c0 rjmp .+168 ; 0x28a7c if(isnan(data.U)) return false; 289d4: 60 91 ba 12 lds r22, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 289d8: 70 91 bb 12 lds r23, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 289dc: 80 91 bc 12 lds r24, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 289e0: 90 91 bd 12 lds r25, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 289e4: 9b 01 movw r18, r22 289e6: ac 01 movw r20, r24 289e8: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 289ec: 81 11 cpse r24, r1 289ee: 46 c0 rjmp .+140 ; 0x28a7c if(isnan(data.V)) return false; 289f0: 60 91 be 12 lds r22, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 289f4: 70 91 bf 12 lds r23, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 289f8: 80 91 c0 12 lds r24, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 289fc: 90 91 c1 12 lds r25, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 28a00: 9b 01 movw r18, r22 28a02: ac 01 movw r20, r24 28a04: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 28a08: 81 11 cpse r24, r1 28a0a: 38 c0 rjmp .+112 ; 0x28a7c if(!(data.C > 0)) return false; 28a0c: 20 e0 ldi r18, 0x00 ; 0 28a0e: 30 e0 ldi r19, 0x00 ; 0 28a10: a9 01 movw r20, r18 28a12: 60 91 c2 12 lds r22, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 28a16: 70 91 c3 12 lds r23, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 28a1a: 80 91 c4 12 lds r24, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 28a1e: 90 91 c5 12 lds r25, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 28a22: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28a26: 18 16 cp r1, r24 28a28: 4c f5 brge .+82 ; 0x28a7c if(isnan(data.fS)) return false; 28a2a: 60 91 c6 12 lds r22, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 28a2e: 70 91 c7 12 lds r23, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 28a32: 80 91 c8 12 lds r24, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 28a36: 90 91 c9 12 lds r25, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> 28a3a: 9b 01 movw r18, r22 28a3c: ac 01 movw r20, r24 28a3e: 0f 94 bf e2 call 0x3c57e ; 0x3c57e <__unordsf2> 28a42: 81 11 cpse r24, r1 28a44: 1b c0 rjmp .+54 ; 0x28a7c if(!(data.L > 0)) return false; 28a46: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 28a4a: 90 91 cb 12 lds r25, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 28a4e: 89 2b or r24, r25 28a50: a9 f0 breq .+42 ; 0x28a7c 28a52: cc ec ldi r28, 0xCC ; 204 28a54: 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)) 28a56: 69 91 ld r22, Y+ 28a58: 79 91 ld r23, Y+ 28a5a: 89 91 ld r24, Y+ 28a5c: 99 91 ld r25, Y+ 28a5e: 20 e0 ldi r18, 0x00 ; 0 28a60: 30 e0 ldi r19, 0x00 ; 0 28a62: a9 01 movw r20, r18 28a64: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28a68: 87 fd sbrc r24, 7 28a6a: 08 c0 rjmp .+16 ; 0x28a7c 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) { 28a6c: 83 e1 ldi r24, 0x13 ; 19 28a6e: cc 30 cpi r28, 0x0C ; 12 28a70: d8 07 cpc r29, r24 28a72: 89 f7 brne .-30 ; 0x28a56 if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 28a74: 81 e0 ldi r24, 0x01 ; 1 } 28a76: df 91 pop r29 28a78: cf 91 pop r28 28a7a: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 28a7c: 80 e0 ldi r24, 0x00 ; 0 28a7e: fb cf rjmp .-10 ; 0x28a76 00028a80 : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 28a80: 0f 94 d8 44 call 0x289b0 ; 0x289b0 28a84: 81 11 cpse r24, r1 28a86: 02 c0 rjmp .+4 ; 0x28a8c 28a88: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28a8c: 81 e0 ldi r24, 0x01 ; 1 28a8e: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 28a92: 80 91 34 06 lds r24, 0x0634 ; 0x800634 28a96: 8d 7f andi r24, 0xFD ; 253 28a98: 80 93 34 06 sts 0x0634, r24 ; 0x800634 // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; reinitialize(); } 28a9c: 08 95 ret 00028a9e : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 28a9e: 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; 28aa0: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 28aa4: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 28aa8: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 28aac: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28ab0: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28ab2: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 28ab4: 0f 94 d5 21 call 0x243aa ; 0x243aa temp_mgr_pid(); 28ab8: 0f 94 12 1f call 0x23e24 ; 0x23e24 // 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); 28abc: 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; 28abe: 10 92 6b 06 sts 0x066B, r1 ; 0x80066b (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28ac2: cf bf out 0x3f, r28 ; 63 #endif } } 28ac4: cf 91 pop r28 28ac6: 08 95 ret 00028ac8 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 28ac8: 0f 94 4f 45 call 0x28a9e ; 0x28a9e fanSpeed = 0; 28acc: 10 92 e1 03 sts 0x03E1, r1 ; 0x8003e1 lcd_return_to_status(); 28ad0: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 00028ad4 : // 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) { 28ad4: 1f 93 push r17 28ad6: cf 93 push r28 28ad8: df 93 push r29 28ada: c8 2f mov r28, r24 28adc: 16 2f mov r17, r22 28ade: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 28ae0: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 28ae4: 80 fd sbrc r24, 0 28ae6: 18 c0 rjmp .+48 ; 0x28b18 28ae8: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 28aec: 81 11 cpse r24, r1 28aee: 14 c0 rjmp .+40 ; 0x28b18 saved_bed_temperature = target_temperature_bed; 28af0: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 28af4: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_temperature = target_temperature[index]; 28af8: e6 2f mov r30, r22 28afa: f0 e0 ldi r31, 0x00 ; 0 28afc: ee 0f add r30, r30 28afe: ff 1f adc r31, r31 28b00: e5 59 subi r30, 0x95 ; 149 28b02: f1 4f sbci r31, 0xF1 ; 241 28b04: 80 81 ld r24, Z 28b06: 91 81 ldd r25, Z+1 ; 0x01 28b08: 90 93 ac 05 sts 0x05AC, r25 ; 0x8005ac 28b0c: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab saved_fan_speed = fanSpeed; 28b10: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 28b14: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 28b18: 0f 94 4f 45 call 0x28a9e ; 0x28a9e void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed 28b1c: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> 28b20: 82 60 ori r24, 0x02 ; 2 28b22: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 <_ZL12altfanStatus.lto_priv.488> #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 28b26: 0e 94 bb 75 call 0xeb76 ; 0xeb76 setExtruderAutoFanState(3); 28b2a: 83 e0 ldi r24, 0x03 ; 3 28b2c: 0e 94 c9 76 call 0xed92 ; 0xed92 SET_OUTPUT(FAN_PIN); 28b30: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 28b34: 88 60 ori r24, 0x08 ; 8 28b36: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 28b3a: 8f ef ldi r24, 0xFF ; 255 28b3c: 80 93 9e 04 sts 0x049E, r24 ; 0x80049e #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 28b40: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 28b44: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 28b48: 80 ff sbrs r24, 0 28b4a: 07 c0 rjmp .+14 ; 0x28b5a 28b4c: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 28b50: 82 95 swap r24 28b52: 86 95 lsr r24 28b54: 87 70 andi r24, 0x07 ; 7 28b56: d8 17 cp r29, r24 28b58: c0 f4 brcc .+48 ; 0x28b8a temp_error_state.source = (uint8_t)source; 28b5a: c3 70 andi r28, 0x03 ; 3 28b5c: cc 0f add r28, r28 28b5e: cc 0f add r28, r28 28b60: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 28b64: 83 7f andi r24, 0xF3 ; 243 28b66: 8c 2b or r24, r28 28b68: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16temp_error_state.lto_priv.469> temp_error_state.index = index; 28b6c: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 28b70: 10 fb bst r17, 0 28b72: 84 f9 bld r24, 4 28b74: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16temp_error_state.lto_priv.469> temp_error_state.type = (uint8_t)type; 28b78: d2 95 swap r29 28b7a: dd 0f add r29, r29 28b7c: d0 7e andi r29, 0xE0 ; 224 28b7e: 40 91 1c 05 lds r20, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 28b82: 4f 71 andi r20, 0x1F ; 31 28b84: 4d 2b or r20, r29 28b86: 40 93 1c 05 sts 0x051C, r20 ; 0x80051c <_ZL16temp_error_state.lto_priv.469> } // always set the error state temp_error_state.error = true; 28b8a: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 28b8e: 81 60 ori r24, 0x01 ; 1 28b90: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16temp_error_state.lto_priv.469> temp_error_state.assert = true; 28b94: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 28b98: 82 60 ori r24, 0x02 ; 2 28b9a: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16temp_error_state.lto_priv.469> } 28b9e: df 91 pop r29 28ba0: cf 91 pop r28 28ba2: 1f 91 pop r17 28ba4: 08 95 ret 00028ba6 : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 28ba6: 20 91 04 06 lds r18, 0x0604 ; 0x800604 28baa: 30 91 05 06 lds r19, 0x0605 ; 0x800605 28bae: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.486> 28bb2: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.486+0x1> 28bb6: 28 17 cp r18, r24 28bb8: 39 07 cpc r19, r25 28bba: 2c f0 brlt .+10 ; 0x28bc6 #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 28bbc: 41 e0 ldi r20, 0x01 ; 1 28bbe: 60 e0 ldi r22, 0x00 ; 0 28bc0: 81 e0 ldi r24, 0x01 ; 1 28bc2: 0d 94 6a 45 jmp 0x28ad4 ; 0x28ad4 } } 28bc6: 08 95 ret 00028bc8 : 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]) { 28bc8: 20 91 06 06 lds r18, 0x0606 ; 0x800606 28bcc: 30 91 07 06 lds r19, 0x0607 ; 0x800607 28bd0: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.487> 28bd4: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.487+0x1> 28bd8: 28 17 cp r18, r24 28bda: 39 07 cpc r19, r25 28bdc: 2c f0 brlt .+10 ; 0x28be8 #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 28bde: 41 e0 ldi r20, 0x01 ; 1 28be0: 60 e0 ldi r22, 0x00 ; 0 28be2: 80 e0 ldi r24, 0x00 ; 0 28be4: 0d 94 6a 45 jmp 0x28ad4 ; 0x28ad4 } } 28be8: 08 95 ret 00028bea : 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) { 28bea: 2f 92 push r2 28bec: 3f 92 push r3 28bee: 4f 92 push r4 28bf0: 5f 92 push r5 28bf2: 6f 92 push r6 28bf4: 7f 92 push r7 28bf6: 8f 92 push r8 28bf8: 9f 92 push r9 28bfa: af 92 push r10 28bfc: bf 92 push r11 28bfe: cf 92 push r12 28c00: df 92 push r13 28c02: ef 92 push r14 28c04: ff 92 push r15 28c06: 0f 93 push r16 28c08: 1f 93 push r17 28c0a: cf 93 push r28 28c0c: df 93 push r29 28c0e: cd b7 in r28, 0x3d ; 61 28c10: de b7 in r29, 0x3e ; 62 28c12: 2c 97 sbiw r28, 0x0c ; 12 28c14: 0f b6 in r0, 0x3f ; 63 28c16: f8 94 cli 28c18: de bf out 0x3e, r29 ; 62 28c1a: 0f be out 0x3f, r0 ; 63 28c1c: cd bf out 0x3d, r28 ; 61 28c1e: 28 2e mov r2, r24 28c20: 49 83 std Y+1, r20 ; 0x01 28c22: 5a 83 std Y+2, r21 ; 0x02 28c24: 6b 83 std Y+3, r22 ; 0x03 28c26: 7c 83 std Y+4, r23 ; 0x04 28c28: 28 01 movw r4, r16 28c2a: 39 01 movw r6, r18 28c2c: 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) 28c2e: 0f 94 83 3f call 0x27f06 ; 0x27f06 28c32: 02 2d mov r16, r2 28c34: 10 e0 ldi r17, 0x00 ; 0 28c36: 98 01 movw r18, r16 28c38: 22 0f add r18, r18 28c3a: 33 1f adc r19, r19 28c3c: 22 0f add r18, r18 28c3e: 33 1f adc r19, r19 28c40: 3c 87 std Y+12, r19 ; 0x0c 28c42: 2b 87 std Y+11, r18 ; 0x0b 28c44: f9 01 movw r30, r18 28c46: e8 53 subi r30, 0x38 ; 56 28c48: fa 4f sbci r31, 0xFA ; 250 28c4a: 80 80 ld r8, Z 28c4c: 91 80 ldd r9, Z+1 ; 0x01 28c4e: a2 80 ldd r10, Z+2 ; 0x02 28c50: b3 80 ldd r11, Z+3 ; 0x03 28c52: 68 19 sub r22, r8 28c54: 79 09 sbc r23, r9 28c56: 8a 09 sbc r24, r10 28c58: 9b 09 sbc r25, r11 28c5a: 61 3d cpi r22, 0xD1 ; 209 28c5c: 77 40 sbci r23, 0x07 ; 7 28c5e: 81 05 cpc r24, r1 28c60: 91 05 cpc r25, r1 28c62: 08 f4 brcc .+2 ; 0x28c66 28c64: ea c0 rjmp .+468 ; 0x28e3a { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 28c66: 33 20 and r3, r3 28c68: 09 f4 brne .+2 ; 0x28c6c 28c6a: 75 c0 rjmp .+234 ; 0x28d56 { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 28c6c: 88 e6 ldi r24, 0x68 ; 104 28c6e: 91 e0 ldi r25, 0x01 ; 1 28c70: 9a 87 std Y+10, r25 ; 0x0a 28c72: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 28c74: 80 e0 ldi r24, 0x00 ; 0 28c76: 90 e0 ldi r25, 0x00 ; 0 28c78: a0 ea ldi r26, 0xA0 ; 160 28c7a: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28c7c: 8d 83 std Y+5, r24 ; 0x05 28c7e: 9e 83 std Y+6, r25 ; 0x06 28c80: af 83 std Y+7, r26 ; 0x07 28c82: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 28c84: 0f 94 83 3f call 0x27f06 ; 0x27f06 28c88: eb 85 ldd r30, Y+11 ; 0x0b 28c8a: fc 85 ldd r31, Y+12 ; 0x0c 28c8c: e8 53 subi r30, 0x38 ; 56 28c8e: fa 4f sbci r31, 0xFA ; 250 28c90: 60 83 st Z, r22 28c92: 71 83 std Z+1, r23 ; 0x01 28c94: 82 83 std Z+2, r24 ; 0x02 28c96: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 28c98: 20 e0 ldi r18, 0x00 ; 0 28c9a: 30 e0 ldi r19, 0x00 ; 0 28c9c: a9 01 movw r20, r18 28c9e: c7 01 movw r24, r14 28ca0: b6 01 movw r22, r12 28ca2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 28ca6: 81 11 cpse r24, r1 28ca8: 07 c0 rjmp .+14 ; 0x28cb8 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28caa: f8 01 movw r30, r16 28cac: ee 0f add r30, r30 28cae: ff 1f adc r31, r31 28cb0: ec 53 subi r30, 0x3C ; 60 28cb2: fa 4f sbci r31, 0xFA ; 250 28cb4: 11 82 std Z+1, r1 ; 0x01 28cb6: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 28cb8: ab 85 ldd r26, Y+11 ; 0x0b 28cba: bc 85 ldd r27, Y+12 ; 0x0c 28cbc: a4 54 subi r26, 0x44 ; 68 28cbe: ba 4f sbci r27, 0xFA ; 250 28cc0: 5d 01 movw r10, r26 28cc2: 29 81 ldd r18, Y+1 ; 0x01 28cc4: 3a 81 ldd r19, Y+2 ; 0x02 28cc6: 4b 81 ldd r20, Y+3 ; 0x03 28cc8: 5c 81 ldd r21, Y+4 ; 0x04 28cca: 6d 91 ld r22, X+ 28ccc: 7d 91 ld r23, X+ 28cce: 8d 91 ld r24, X+ 28cd0: 9c 91 ld r25, X 28cd2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 28cd6: 88 23 and r24, r24 28cd8: 09 f4 brne .+2 ; 0x28cdc 28cda: 91 c0 rjmp .+290 ; 0x28dfe { if (_target_temperature > 0) 28cdc: 20 e0 ldi r18, 0x00 ; 0 28cde: 30 e0 ldi r19, 0x00 ; 0 28ce0: a9 01 movw r20, r18 28ce2: 69 81 ldd r22, Y+1 ; 0x01 28ce4: 7a 81 ldd r23, Y+2 ; 0x02 28ce6: 8b 81 ldd r24, Y+3 ; 0x03 28ce8: 9c 81 ldd r25, Y+4 ; 0x04 28cea: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28cee: f8 01 movw r30, r16 28cf0: e6 54 subi r30, 0x46 ; 70 28cf2: fa 4f sbci r31, 0xFA ; 250 28cf4: 18 16 cp r1, r24 28cf6: c4 f5 brge .+112 ; 0x28d68 { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 28cf8: 81 e0 ldi r24, 0x01 ; 1 28cfa: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 28cfc: 89 81 ldd r24, Y+1 ; 0x01 28cfe: 9a 81 ldd r25, Y+2 ; 0x02 28d00: ab 81 ldd r26, Y+3 ; 0x03 28d02: bc 81 ldd r27, Y+4 ; 0x04 28d04: f5 01 movw r30, r10 28d06: 80 83 st Z, r24 28d08: 91 83 std Z+1, r25 ; 0x01 28d0a: a2 83 std Z+2, r26 ; 0x02 28d0c: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 28d0e: eb 85 ldd r30, Y+11 ; 0x0b 28d10: fc 85 ldd r31, Y+12 ; 0x0c 28d12: ee 54 subi r30, 0x4E ; 78 28d14: fa 4f sbci r31, 0xFA ; 250 28d16: 40 82 st Z, r4 28d18: 51 82 std Z+1, r5 ; 0x01 28d1a: 62 82 std Z+2, r6 ; 0x02 28d1c: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 28d1e: f8 01 movw r30, r16 28d20: e0 55 subi r30, 0x50 ; 80 28d22: fa 4f sbci r31, 0xFA ; 250 28d24: 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)) 28d26: a3 01 movw r20, r6 28d28: 92 01 movw r18, r4 28d2a: bc 01 movw r22, r24 28d2c: cd 01 movw r24, r26 28d2e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28d32: 18 16 cp r1, r24 28d34: 1c f5 brge .+70 ; 0x28d7c { __preheat_counter[_heater_id]++; 28d36: f8 01 movw r30, r16 28d38: e0 55 subi r30, 0x50 ; 80 28d3a: fa 4f sbci r31, 0xFA ; 250 28d3c: 80 81 ld r24, Z 28d3e: 8f 5f subi r24, 0xFF ; 255 28d40: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 28d42: 31 10 cpse r3, r1 28d44: c7 c0 rjmp .+398 ; 0x28ed4 28d46: 89 30 cpi r24, 0x09 ; 9 28d48: c8 f0 brcs .+50 ; 0x28d7c { __delta=2.0; 28d4a: 81 2c mov r8, r1 28d4c: 91 2c mov r9, r1 28d4e: a1 2c mov r10, r1 28d50: 50 e4 ldi r21, 0x40 ; 64 28d52: b5 2e mov r11, r21 28d54: e8 c0 rjmp .+464 ; 0x28f26 #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 28d56: ad e2 ldi r26, 0x2D ; 45 28d58: b0 e0 ldi r27, 0x00 ; 0 28d5a: ba 87 std Y+10, r27 ; 0x0a 28d5c: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28d5e: 80 e0 ldi r24, 0x00 ; 0 28d60: 90 e0 ldi r25, 0x00 ; 0 28d62: a0 e7 ldi r26, 0x70 ; 112 28d64: b1 e4 ldi r27, 0x41 ; 65 28d66: 8a cf rjmp .-236 ; 0x28c7c __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 28d68: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 28d6a: 89 81 ldd r24, Y+1 ; 0x01 28d6c: 9a 81 ldd r25, Y+2 ; 0x02 28d6e: ab 81 ldd r26, Y+3 ; 0x03 28d70: bc 81 ldd r27, Y+4 ; 0x04 28d72: f5 01 movw r30, r10 28d74: 80 83 st Z, r24 28d76: 91 83 std Z+1, r25 ; 0x01 28d78: a2 83 std Z+2, r26 ; 0x02 28d7a: 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) 28d7c: 2d 81 ldd r18, Y+5 ; 0x05 28d7e: 3e 81 ldd r19, Y+6 ; 0x06 28d80: 4f 81 ldd r20, Y+7 ; 0x07 28d82: 58 85 ldd r21, Y+8 ; 0x08 28d84: 69 81 ldd r22, Y+1 ; 0x01 28d86: 7a 81 ldd r23, Y+2 ; 0x02 28d88: 8b 81 ldd r24, Y+3 ; 0x03 28d8a: 9c 81 ldd r25, Y+4 ; 0x04 28d8c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 28d90: a3 01 movw r20, r6 28d92: 92 01 movw r18, r4 28d94: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 28d98: 87 ff sbrs r24, 7 28d9a: 46 c0 rjmp .+140 ; 0x28e28 28d9c: f8 01 movw r30, r16 28d9e: e6 54 subi r30, 0x46 ; 70 28da0: fa 4f sbci r31, 0xFA ; 250 28da2: 80 81 ld r24, Z 28da4: 81 30 cpi r24, 0x01 ; 1 28da6: 49 f4 brne .+18 ; 0x28dba { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 28da8: 82 e0 ldi r24, 0x02 ; 2 28daa: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28dac: f8 01 movw r30, r16 28dae: ee 0f add r30, r30 28db0: ff 1f adc r31, r31 28db2: ec 53 subi r30, 0x3C ; 60 28db4: fa 4f sbci r31, 0xFA ; 250 28db6: 11 82 std Z+1, r1 ; 0x01 28db8: 10 82 st Z, r1 } if (_output > 0) 28dba: 20 e0 ldi r18, 0x00 ; 0 28dbc: 30 e0 ldi r19, 0x00 ; 0 28dbe: a9 01 movw r20, r18 28dc0: c7 01 movw r24, r14 28dc2: b6 01 movw r22, r12 28dc4: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28dc8: 18 16 cp r1, r24 28dca: bc f5 brge .+110 ; 0x28e3a if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 28dcc: 29 81 ldd r18, Y+1 ; 0x01 28dce: 3a 81 ldd r19, Y+2 ; 0x02 28dd0: 4b 81 ldd r20, Y+3 ; 0x03 28dd2: 5c 81 ldd r21, Y+4 ; 0x04 28dd4: 6d 81 ldd r22, Y+5 ; 0x05 28dd6: 7e 81 ldd r23, Y+6 ; 0x06 28dd8: 8f 81 ldd r24, Y+7 ; 0x07 28dda: 98 85 ldd r25, Y+8 ; 0x08 28ddc: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 28de0: a3 01 movw r20, r6 28de2: 92 01 movw r18, r4 28de4: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28de8: 18 16 cp r1, r24 28dea: 0c f0 brlt .+2 ; 0x28dee 28dec: 3f c0 rjmp .+126 ; 0x28e6c { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28dee: 00 0f add r16, r16 28df0: 11 1f adc r17, r17 28df2: f8 01 movw r30, r16 28df4: ec 53 subi r30, 0x3C ; 60 28df6: fa 4f sbci r31, 0xFA ; 250 28df8: 11 82 std Z+1, r1 ; 0x01 28dfa: 10 82 st Z, r1 28dfc: 1e c0 rjmp .+60 ; 0x28e3a 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)) 28dfe: a3 01 movw r20, r6 28e00: 92 01 movw r18, r4 28e02: 69 81 ldd r22, Y+1 ; 0x01 28e04: 7a 81 ldd r23, Y+2 ; 0x02 28e06: 8b 81 ldd r24, Y+3 ; 0x03 28e08: 9c 81 ldd r25, Y+4 ; 0x04 28e0a: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28e0e: 18 16 cp r1, r24 28e10: 0c f0 brlt .+2 ; 0x28e14 28e12: b4 cf rjmp .-152 ; 0x28d7c 28e14: f8 01 movw r30, r16 28e16: e6 54 subi r30, 0x46 ; 70 28e18: fa 4f sbci r31, 0xFA ; 250 28e1a: 80 81 ld r24, Z 28e1c: 81 30 cpi r24, 0x01 ; 1 28e1e: 09 f0 breq .+2 ; 0x28e22 28e20: ad cf rjmp .-166 ; 0x28d7c 28e22: 89 cf rjmp .-238 ; 0x28d36 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; 28e24: 10 82 st Z, r1 28e26: 97 c0 rjmp .+302 ; 0x28f56 temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 28e28: 20 e0 ldi r18, 0x00 ; 0 28e2a: 30 e0 ldi r19, 0x00 ; 0 28e2c: a9 01 movw r20, r18 28e2e: c7 01 movw r24, r14 28e30: b6 01 movw r22, r12 28e32: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28e36: 18 16 cp r1, r24 28e38: cc f0 brlt .+50 ; 0x28e6c } } } } } 28e3a: 2c 96 adiw r28, 0x0c ; 12 28e3c: 0f b6 in r0, 0x3f ; 63 28e3e: f8 94 cli 28e40: de bf out 0x3e, r29 ; 62 28e42: 0f be out 0x3f, r0 ; 63 28e44: cd bf out 0x3d, r28 ; 61 28e46: df 91 pop r29 28e48: cf 91 pop r28 28e4a: 1f 91 pop r17 28e4c: 0f 91 pop r16 28e4e: ff 90 pop r15 28e50: ef 90 pop r14 28e52: df 90 pop r13 28e54: cf 90 pop r12 28e56: bf 90 pop r11 28e58: af 90 pop r10 28e5a: 9f 90 pop r9 28e5c: 8f 90 pop r8 28e5e: 7f 90 pop r7 28e60: 6f 90 pop r6 28e62: 5f 90 pop r5 28e64: 4f 90 pop r4 28e66: 3f 90 pop r3 28e68: 2f 90 pop r2 28e6a: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 28e6c: f8 01 movw r30, r16 28e6e: e6 54 subi r30, 0x46 ; 70 28e70: fa 4f sbci r31, 0xFA ; 250 28e72: 80 81 ld r24, Z 28e74: 82 30 cpi r24, 0x02 ; 2 28e76: 08 f3 brcs .-62 ; 0x28e3a { temp_runaway_error_counter[_heater_id]++; 28e78: 00 0f add r16, r16 28e7a: 11 1f adc r17, r17 28e7c: f8 01 movw r30, r16 28e7e: ec 53 subi r30, 0x3C ; 60 28e80: fa 4f sbci r31, 0xFA ; 250 28e82: 80 81 ld r24, Z 28e84: 91 81 ldd r25, Z+1 ; 0x01 28e86: 01 96 adiw r24, 0x01 ; 1 28e88: 91 83 std Z+1, r25 ; 0x01 28e8a: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 28e8c: 88 0f add r24, r24 28e8e: 99 1f adc r25, r25 28e90: e9 85 ldd r30, Y+9 ; 0x09 28e92: fa 85 ldd r31, Y+10 ; 0x0a 28e94: e8 17 cp r30, r24 28e96: f9 07 cpc r31, r25 28e98: 80 f6 brcc .-96 ; 0x28e3a set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 28e9a: 43 e0 ldi r20, 0x03 ; 3 28e9c: 62 2d mov r22, r2 28e9e: 83 2d mov r24, r3 } } } } } 28ea0: 2c 96 adiw r28, 0x0c ; 12 28ea2: 0f b6 in r0, 0x3f ; 63 28ea4: f8 94 cli 28ea6: de bf out 0x3e, r29 ; 62 28ea8: 0f be out 0x3f, r0 ; 63 28eaa: cd bf out 0x3d, r28 ; 61 28eac: df 91 pop r29 28eae: cf 91 pop r28 28eb0: 1f 91 pop r17 28eb2: 0f 91 pop r16 28eb4: ff 90 pop r15 28eb6: ef 90 pop r14 28eb8: df 90 pop r13 28eba: cf 90 pop r12 28ebc: bf 90 pop r11 28ebe: af 90 pop r10 28ec0: 9f 90 pop r9 28ec2: 8f 90 pop r8 28ec4: 7f 90 pop r7 28ec6: 6f 90 pop r6 28ec8: 5f 90 pop r5 28eca: 4f 90 pop r4 28ecc: 3f 90 pop r3 28ece: 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); 28ed0: 0d 94 6a 45 jmp 0x28ad4 ; 0x28ad4 } 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 28ed4: 81 31 cpi r24, 0x11 ; 17 28ed6: 08 f4 brcc .+2 ; 0x28eda 28ed8: 51 cf rjmp .-350 ; 0x28d7c { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 28eda: 20 e0 ldi r18, 0x00 ; 0 28edc: 30 e0 ldi r19, 0x00 ; 0 28ede: 44 eb ldi r20, 0xB4 ; 180 28ee0: 52 e4 ldi r21, 0x42 ; 66 28ee2: c3 01 movw r24, r6 28ee4: b2 01 movw r22, r4 28ee6: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 28eea: 81 2c mov r8, r1 28eec: 91 2c mov r9, r1 28eee: e0 e4 ldi r30, 0x40 ; 64 28ef0: ae 2e mov r10, r30 28ef2: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 28ef4: 18 16 cp r1, r24 28ef6: 2c f4 brge .+10 ; 0x28f02 28ef8: 81 2c mov r8, r1 28efa: 91 2c mov r9, r1 28efc: a1 2c mov r10, r1 28efe: 70 e4 ldi r23, 0x40 ; 64 28f00: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 28f02: 20 e0 ldi r18, 0x00 ; 0 28f04: 30 e0 ldi r19, 0x00 ; 0 28f06: 42 ed ldi r20, 0xD2 ; 210 28f08: 52 e4 ldi r21, 0x42 ; 66 28f0a: c3 01 movw r24, r6 28f0c: b2 01 movw r22, r4 28f0e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 28f12: 18 16 cp r1, r24 28f14: 44 f4 brge .+16 ; 0x28f26 28f16: 6a e9 ldi r22, 0x9A ; 154 28f18: 86 2e mov r8, r22 28f1a: 69 e9 ldi r22, 0x99 ; 153 28f1c: 96 2e mov r9, r22 28f1e: 69 e1 ldi r22, 0x19 ; 25 28f20: a6 2e mov r10, r22 28f22: 6f e3 ldi r22, 0x3F ; 63 28f24: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 28f26: eb 85 ldd r30, Y+11 ; 0x0b 28f28: fc 85 ldd r31, Y+12 ; 0x0c 28f2a: ee 54 subi r30, 0x4E ; 78 28f2c: fa 4f sbci r31, 0xFA ; 250 28f2e: 20 81 ld r18, Z 28f30: 31 81 ldd r19, Z+1 ; 0x01 28f32: 42 81 ldd r20, Z+2 ; 0x02 28f34: 53 81 ldd r21, Z+3 ; 0x03 28f36: c3 01 movw r24, r6 28f38: b2 01 movw r22, r4 28f3a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 28f3e: a5 01 movw r20, r10 28f40: 94 01 movw r18, r8 28f42: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 28f46: f8 01 movw r30, r16 28f48: e2 55 subi r30, 0x52 ; 82 28f4a: fa 4f sbci r31, 0xFA ; 250 28f4c: 87 ff sbrs r24, 7 28f4e: 6a cf rjmp .-300 ; 0x28e24 __preheat_errors[_heater_id]++; 28f50: 80 81 ld r24, Z 28f52: 8f 5f subi r24, 0xFF ; 255 28f54: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28f56: 80 81 ld r24, Z 28f58: 90 e0 ldi r25, 0x00 ; 0 28f5a: 31 10 cpse r3, r1 28f5c: 04 c0 rjmp .+8 ; 0x28f66 28f5e: 06 97 sbiw r24, 0x06 ; 6 28f60: 4c f0 brlt .+18 ; 0x28f74 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28f62: 80 e0 ldi r24, 0x00 ; 0 28f64: 03 c0 rjmp .+6 ; 0x28f6c __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28f66: 04 97 sbiw r24, 0x04 ; 4 28f68: 2c f0 brlt .+10 ; 0x28f74 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28f6a: 81 e0 ldi r24, 0x01 ; 1 28f6c: 42 e0 ldi r20, 0x02 ; 2 28f6e: 62 2d mov r22, r2 28f70: 0f 94 6a 45 call 0x28ad4 ; 0x28ad4 __preheat_start[_heater_id] = _current_temperature; 28f74: 2b 85 ldd r18, Y+11 ; 0x0b 28f76: 3c 85 ldd r19, Y+12 ; 0x0c 28f78: 2e 54 subi r18, 0x4E ; 78 28f7a: 3a 4f sbci r19, 0xFA ; 250 28f7c: d9 01 movw r26, r18 28f7e: 4d 92 st X+, r4 28f80: 5d 92 st X+, r5 28f82: 6d 92 st X+, r6 28f84: 7c 92 st X, r7 28f86: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 28f88: f8 01 movw r30, r16 28f8a: e0 55 subi r30, 0x50 ; 80 28f8c: fa 4f sbci r31, 0xFA ; 250 28f8e: 10 82 st Z, r1 28f90: f5 ce rjmp .-534 ; 0x28d7c 00028f92 : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 28f92: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28f94: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28f96: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 28f98: 80 81 ld r24, Z 28f9a: 88 23 and r24, r24 28f9c: 29 f0 breq .+10 ; 0x28fa8 28f9e: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 28fa2: 82 60 ori r24, 0x02 ; 2 28fa4: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28fa8: 9f bf out 0x3f, r25 ; 63 } } 28faa: 08 95 ret 00028fac : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 28fac: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28fae: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28fb0: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 28fb2: e3 e7 ldi r30, 0x73 ; 115 28fb4: f0 e0 ldi r31, 0x00 ; 0 28fb6: 90 81 ld r25, Z 28fb8: 96 95 lsr r25 28fba: 91 70 andi r25, 0x01 ; 1 28fbc: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 28fbe: 80 81 ld r24, Z 28fc0: 8d 7f andi r24, 0xFD ; 253 28fc2: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28fc4: 2f bf out 0x3f, r18 ; 63 } } 28fc6: 08 95 ret 00028fc8 : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 28fc8: cf 93 push r28 28fca: df 93 push r29 28fcc: 1f 92 push r1 28fce: cd b7 in r28, 0x3d ; 61 28fd0: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 28fd2: ce 01 movw r24, r28 28fd4: 01 96 adiw r24, 0x01 ; 1 28fd6: 0f 94 d6 47 call 0x28fac ; 0x28fac thermal_model::data.P = THERMAL_MODEL_DEF(P); 28fda: 80 e0 ldi r24, 0x00 ; 0 28fdc: 90 e0 ldi r25, 0x00 ; 0 28fde: a0 e2 ldi r26, 0x20 ; 32 28fe0: b2 e4 ldi r27, 0x42 ; 66 28fe2: 80 93 b6 12 sts 0x12B6, r24 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 28fe6: 90 93 b7 12 sts 0x12B7, r25 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 28fea: a0 93 b8 12 sts 0x12B8, r26 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 28fee: b0 93 b9 12 sts 0x12B9, r27 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 28ff2: 84 e3 ldi r24, 0x34 ; 52 28ff4: 90 e8 ldi r25, 0x80 ; 128 28ff6: a7 eb ldi r26, 0xB7 ; 183 28ff8: ba eb ldi r27, 0xBA ; 186 28ffa: 80 93 ba 12 sts 0x12BA, r24 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 28ffe: 90 93 bb 12 sts 0x12BB, r25 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 29002: a0 93 bc 12 sts 0x12BC, r26 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 29006: b0 93 bd 12 sts 0x12BD, r27 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 2900a: 86 e6 ldi r24, 0x66 ; 102 2900c: 96 e6 ldi r25, 0x66 ; 102 2900e: a6 e8 ldi r26, 0x86 ; 134 29010: bf e3 ldi r27, 0x3F ; 63 29012: 80 93 be 12 sts 0x12BE, r24 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 29016: 90 93 bf 12 sts 0x12BF, r25 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 2901a: a0 93 c0 12 sts 0x12C0, r26 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 2901e: b0 93 c1 12 sts 0x12C1, r27 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 29022: 8c ee ldi r24, 0xEC ; 236 29024: 91 e5 ldi r25, 0x51 ; 81 29026: ac e0 ldi r26, 0x0C ; 12 29028: b1 e4 ldi r27, 0x41 ; 65 2902a: 80 93 c2 12 sts 0x12C2, r24 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 2902e: 90 93 c3 12 sts 0x12C3, r25 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 29032: a0 93 c4 12 sts 0x12C4, r26 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 29036: b0 93 c5 12 sts 0x12C5, r27 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 2903a: 8a e9 ldi r24, 0x9A ; 154 2903c: 99 e9 ldi r25, 0x99 ; 153 2903e: a9 e1 ldi r26, 0x19 ; 25 29040: be e3 ldi r27, 0x3E ; 62 29042: 80 93 c6 12 sts 0x12C6, r24 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 29046: 90 93 c7 12 sts 0x12C7, r25 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 2904a: a0 93 c8 12 sts 0x12C8, r26 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 2904e: b0 93 c9 12 sts 0x12C9, r27 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> thermal_model::data.L = (uint16_t)(THERMAL_MODEL_DEF(LAG) / (TEMP_MGR_INTV * 1000) + 0.5) * (uint16_t)(TEMP_MGR_INTV * 1000); 29052: 8e e0 ldi r24, 0x0E ; 14 29054: 91 e0 ldi r25, 0x01 ; 1 29056: 90 93 cb 12 sts 0x12CB, r25 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 2905a: 80 93 ca 12 sts 0x12CA, r24 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 2905e: 8a e7 ldi r24, 0x7A ; 122 29060: 9f e9 ldi r25, 0x9F ; 159 29062: ac ec ldi r26, 0xCC ; 204 29064: 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); 29066: fc 01 movw r30, r24 29068: 45 91 lpm r20, Z+ 2906a: 55 91 lpm r21, Z+ 2906c: 65 91 lpm r22, Z+ 2906e: 74 91 lpm r23, Z 29070: 4d 93 st X+, r20 29072: 5d 93 st X+, r21 29074: 6d 93 st X+, r22 29076: 7d 93 st X+, r23 29078: 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) 2907a: 23 e1 ldi r18, 0x13 ; 19 2907c: ac 30 cpi r26, 0x0C ; 12 2907e: b2 07 cpc r27, r18 29080: 91 f7 brne .-28 ; 0x29066 thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 29082: 80 e0 ldi r24, 0x00 ; 0 29084: 90 e0 ldi r25, 0x00 ; 0 29086: a0 ee ldi r26, 0xE0 ; 224 29088: b0 ec ldi r27, 0xC0 ; 192 2908a: 80 93 0c 13 sts 0x130C, r24 ; 0x80130c <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 2908e: 90 93 0d 13 sts 0x130D, r25 ; 0x80130d <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 29092: a0 93 0e 13 sts 0x130E, r26 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 29096: b0 93 0f 13 sts 0x130F, r27 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 2909a: 8a e9 ldi r24, 0x9A ; 154 2909c: 99 e9 ldi r25, 0x99 ; 153 2909e: a9 e5 ldi r26, 0x59 ; 89 290a0: bf e3 ldi r27, 0x3F ; 63 290a2: 80 93 10 13 sts 0x1310, r24 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 290a6: 90 93 11 13 sts 0x1311, r25 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 290aa: a0 93 12 13 sts 0x1312, r26 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 290ae: b0 93 13 13 sts 0x1313, r27 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 290b2: 84 ea ldi r24, 0xA4 ; 164 290b4: 90 e7 ldi r25, 0x70 ; 112 290b6: ad e9 ldi r26, 0x9D ; 157 290b8: bf e3 ldi r27, 0x3F ; 63 290ba: 80 93 14 13 sts 0x1314, r24 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 290be: 90 93 15 13 sts 0x1315, r25 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 290c2: a0 93 16 13 sts 0x1316, r26 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 290c6: b0 93 17 13 sts 0x1317, r27 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> thermal_model::warn_beep = true; 290ca: 81 e0 ldi r24, 0x01 ; 1 290cc: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> thermal_model::enabled = true; 290d0: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 290d4: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 290d8: 80 91 34 06 lds r24, 0x0634 ; 0x800634 290dc: 8d 7f andi r24, 0xFD ; 253 290de: 80 93 34 06 sts 0x0634, r24 ; 0x800634 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 290e2: ce 01 movw r24, r28 290e4: 01 96 adiw r24, 0x01 ; 1 290e6: 0f 94 c9 47 call 0x28f92 ; 0x28f92 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(); } 290ea: 0f 90 pop r0 290ec: df 91 pop r29 290ee: cf 91 pop r28 290f0: 08 95 ret 000290f2 : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 290f2: 1f 93 push r17 290f4: cf 93 push r28 290f6: df 93 push r29 290f8: 1f 92 push r1 290fa: cd b7 in r28, 0x3d ; 61 290fc: de b7 in r29, 0x3e ; 62 290fe: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 29100: ce 01 movw r24, r28 29102: 01 96 adiw r24, 0x01 ; 1 29104: 0f 94 d6 47 call 0x28fac ; 0x28fac thermal_model::enabled = enabled; 29108: 10 93 1e 05 sts 0x051E, r17 ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> thermal_model::setup(); 2910c: 0f 94 40 45 call 0x28a80 ; 0x28a80 void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 29110: ce 01 movw r24, r28 29112: 01 96 adiw r24, 0x01 ; 1 29114: 0f 94 c9 47 call 0x28f92 ; 0x28f92 thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 29118: 11 23 and r17, r17 2911a: 41 f0 breq .+16 ; 0x2912c 2911c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> 29120: 81 11 cpse r24, r1 29122: 04 c0 rjmp .+8 ; 0x2912c SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 29124: 82 ee ldi r24, 0xE2 ; 226 29126: 9e e9 ldi r25, 0x9E ; 158 29128: 0e 94 fe 7a call 0xf5fc ; 0xf5fc } 2912c: 0f 90 pop r0 2912e: df 91 pop r29 29130: cf 91 pop r28 29132: 1f 91 pop r17 29134: 08 95 ret 00029136 : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 29136: 1f 93 push r17 29138: cf 93 push r28 2913a: df 93 push r29 2913c: 1f 92 push r1 2913e: cd b7 in r28, 0x3d ; 61 29140: de b7 in r29, 0x3e ; 62 29142: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 29144: ce 01 movw r24, r28 29146: 01 96 adiw r24, 0x01 ; 1 29148: 0f 94 d6 47 call 0x28fac ; 0x28fac thermal_model::enabled = enabled; 2914c: 10 93 1e 05 sts 0x051E, r17 ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 29150: 81 e0 ldi r24, 0x01 ; 1 29152: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 29156: e4 e3 ldi r30, 0x34 ; 52 29158: f6 e0 ldi r31, 0x06 ; 6 2915a: 80 81 ld r24, Z 2915c: 8d 7f andi r24, 0xFD ; 253 2915e: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 29160: ce 01 movw r24, r28 29162: 01 96 adiw r24, 0x01 ; 1 29164: 0f 94 c9 47 call 0x28f92 ; 0x28f92 thermal_model::enabled = enabled; thermal_model::reinitialize(); } 29168: 0f 90 pop r0 2916a: df 91 pop r29 2916c: cf 91 pop r28 2916e: 1f 91 pop r17 29170: 08 95 ret 00029172 : /* 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() { 29172: cf 93 push r28 29174: df 93 push r29 29176: 1f 92 push r1 29178: cd b7 in r28, 0x3d ; 61 2917a: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 2917c: ce 01 movw r24, r28 2917e: 01 96 adiw r24, 0x01 ; 1 29180: 0f 94 d6 47 call 0x28fac ; 0x28fac } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 29188: 90 91 19 05 lds r25, 0x0519 ; 0x800519 2918c: a0 91 1a 05 lds r26, 0x051A ; 0x80051a 29190: b0 91 1b 05 lds r27, 0x051B ; 0x80051b 29194: 80 93 5f 0e sts 0x0E5F, r24 ; 0x800e5f 29198: 90 93 60 0e sts 0x0E60, r25 ; 0x800e60 2919c: a0 93 61 0e sts 0x0E61, r26 ; 0x800e61 291a0: b0 93 62 0e sts 0x0E62, r27 ; 0x800e62 current_temperature_bed = current_temperature_bed_isr; 291a4: 80 91 14 06 lds r24, 0x0614 ; 0x800614 291a8: 90 91 15 06 lds r25, 0x0615 ; 0x800615 291ac: a0 91 16 06 lds r26, 0x0616 ; 0x800616 291b0: b0 91 17 06 lds r27, 0x0617 ; 0x800617 291b4: 80 93 ef 04 sts 0x04EF, r24 ; 0x8004ef 291b8: 90 93 f0 04 sts 0x04F0, r25 ; 0x8004f0 291bc: a0 93 f1 04 sts 0x04F1, r26 ; 0x8004f1 291c0: b0 93 f2 04 sts 0x04F2, r27 ; 0x8004f2 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 291c4: 80 91 fe 05 lds r24, 0x05FE ; 0x8005fe 291c8: 90 91 ff 05 lds r25, 0x05FF ; 0x8005ff 291cc: a0 91 00 06 lds r26, 0x0600 ; 0x800600 291d0: b0 91 01 06 lds r27, 0x0601 ; 0x800601 291d4: 80 93 97 03 sts 0x0397, r24 ; 0x800397 291d8: 90 93 98 03 sts 0x0398, r25 ; 0x800398 291dc: a0 93 99 03 sts 0x0399, r26 ; 0x800399 291e0: b0 93 9a 03 sts 0x039A, r27 ; 0x80039a #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 291e4: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 291e8: 90 91 1c 06 lds r25, 0x061C ; 0x80061c 291ec: a0 91 1d 06 lds r26, 0x061D ; 0x80061d 291f0: b0 91 1e 06 lds r27, 0x061E ; 0x80061e 291f4: 80 93 51 06 sts 0x0651, r24 ; 0x800651 291f8: 90 93 52 06 sts 0x0652, r25 ; 0x800652 291fc: a0 93 53 06 sts 0x0653, r26 ; 0x800653 29200: b0 93 54 06 sts 0x0654, r27 ; 0x800654 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 29204: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29208: 81 11 cpse r24, r1 2920a: 02 c0 rjmp .+4 ; 0x29210 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 2920c: 0f 94 d5 21 call 0x243aa ; 0x243aa } temp_meas_ready = false; 29210: 10 92 fd 05 sts 0x05FD, r1 ; 0x8005fd - 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; 29214: ce 01 movw r24, r28 29216: 01 96 adiw r24, 0x01 ; 1 29218: 0f 94 c9 47 call 0x28f92 ; 0x28f92 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 2921c: 0f 90 pop r0 2921e: df 91 pop r29 29220: cf 91 pop r28 29222: 08 95 ret 00029224 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 29224: 1f 92 push r1 29226: 0f 92 push r0 29228: 0f b6 in r0, 0x3f ; 63 2922a: 0f 92 push r0 2922c: 11 24 eor r1, r1 2922e: 0b b6 in r0, 0x3b ; 59 29230: 0f 92 push r0 29232: ff 92 push r15 29234: 0f 93 push r16 29236: 1f 93 push r17 29238: 2f 93 push r18 2923a: 3f 93 push r19 2923c: 4f 93 push r20 2923e: 5f 93 push r21 29240: 6f 93 push r22 29242: 7f 93 push r23 29244: 8f 93 push r24 29246: 9f 93 push r25 29248: af 93 push r26 2924a: bf 93 push r27 2924c: cf 93 push r28 2924e: df 93 push r29 29250: ef 93 push r30 29252: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 29254: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 29258: 8b 7f andi r24, 0xFB ; 251 2925a: 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(); 2925e: 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) 29260: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 29264: 86 fd sbrc r24, 6 29266: c8 c0 rjmp .+400 ; 0x293f8 <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 29268: 68 ec ldi r22, 0xC8 ; 200 2926a: 70 e0 ldi r23, 0x00 ; 0 2926c: 8e ed ldi r24, 0xDE ; 222 2926e: 95 e0 ldi r25, 0x05 ; 5 29270: 0f 94 dd 3f call 0x27fba ; 0x27fba ::expired_cont(unsigned short)> 29274: 88 23 and r24, r24 29276: b9 f0 breq .+46 ; 0x292a6 <__vector_14+0x82> buttonBlanking.start(); 29278: 8e ed ldi r24, 0xDE ; 222 2927a: 95 e0 ldi r25, 0x05 ; 5 2927c: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> safetyTimer.start(); 29280: 89 ed ldi r24, 0xD9 ; 217 29282: 95 e0 ldi r25, 0x05 ; 5 29284: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 29288: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 2928c: 81 11 cpse r24, r1 2928e: a5 c0 rjmp .+330 ; 0x293da <__vector_14+0x1b6> 29290: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 29294: 81 11 cpse r24, r1 29296: a1 c0 rjmp .+322 ; 0x293da <__vector_14+0x1b6> { longPressTimer.start(); 29298: 84 ed ldi r24, 0xD4 ; 212 2929a: 95 e0 ldi r25, 0x05 ; 5 2929c: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> lcd_button_pressed = 1; 292a0: 81 e0 ldi r24, 0x01 ; 1 292a2: 80 93 d8 05 sts 0x05D8, r24 ; 0x8005d8 -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 292a6: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 292aa: 82 fb bst r24, 2 292ac: 88 27 eor r24, r24 292ae: 80 f9 bld r24, 0 292b0: 91 e0 ldi r25, 0x01 ; 1 292b2: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 292b4: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 292b8: 91 ff sbrs r25, 1 292ba: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 292bc: e0 91 d1 05 lds r30, 0x05D1 ; 0x8005d1 292c0: e8 17 cp r30, r24 292c2: e1 f0 breq .+56 ; 0x292fc <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 292c4: 24 e0 ldi r18, 0x04 ; 4 292c6: e2 9f mul r30, r18 292c8: f0 01 movw r30, r0 292ca: 11 24 eor r1, r1 292cc: e8 2b or r30, r24 292ce: ed 53 subi r30, 0x3D ; 61 292d0: f1 46 sbci r31, 0x61 ; 97 292d2: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 292d4: 90 91 d0 05 lds r25, 0x05D0 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.560> 292d8: e9 0f add r30, r25 292da: e0 93 d0 05 sts 0x05D0, r30 ; 0x8005d0 <_ZL16lcd_encoder_diff.lto_priv.560> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 292de: 0e 2e mov r0, r30 292e0: 00 0c add r0, r0 292e2: ff 0b sbc r31, r31 292e4: f7 ff sbrs r31, 7 292e6: 03 c0 rjmp .+6 ; 0x292ee <__vector_14+0xca> 292e8: f1 95 neg r31 292ea: e1 95 neg r30 292ec: f1 09 sbc r31, r1 292ee: 34 97 sbiw r30, 0x04 ; 4 292f0: 1c f0 brlt .+6 ; 0x292f8 <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 292f2: 91 e0 ldi r25, 0x01 ; 1 292f4: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 <_ZL26lcd_backlight_wake_trigger.lto_priv.559> } enc_bits_old = enc_bits; 292f8: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 292fc: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29300: 81 11 cpse r24, r1 29302: 08 c0 rjmp .+16 ; 0x29314 <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 29304: 80 91 17 05 lds r24, 0x0517 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 29308: 80 93 e3 05 sts 0x05E3, r24 ; 0x8005e3 if(soft_pwm_0 > 0) 2930c: 88 23 and r24, r24 2930e: 09 f4 brne .+2 ; 0x29312 <__vector_14+0xee> 29310: 87 c0 rjmp .+270 ; 0x29420 <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 29312: 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) 29314: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29318: 8f 70 andi r24, 0x0F ; 15 2931a: a9 f4 brne .+42 ; 0x29346 <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 2931c: 80 91 9e 04 lds r24, 0x049E ; 0x80049e 29320: 90 e0 ldi r25, 0x00 ; 0 29322: 24 e0 ldi r18, 0x04 ; 4 29324: 95 95 asr r25 29326: 87 95 ror r24 29328: 2a 95 dec r18 2932a: e1 f7 brne .-8 ; 0x29324 <__vector_14+0x100> 2932c: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d <_ZL12soft_pwm_fan.lto_priv.475> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 29330: 89 2b or r24, r25 29332: 09 f4 brne .+2 ; 0x29336 <__vector_14+0x112> 29334: 77 c0 rjmp .+238 ; 0x29424 <__vector_14+0x200> 29336: 9f b7 in r25, 0x3f ; 63 29338: f8 94 cli 2933a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2933e: 88 60 ori r24, 0x08 ; 8 29340: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29344: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 29346: 90 91 e3 05 lds r25, 0x05E3 ; 0x8005e3 2934a: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2934e: 98 17 cp r25, r24 29350: 08 f4 brcc .+2 ; 0x29354 <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 29352: 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); 29354: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29358: 8f 70 andi r24, 0x0F ; 15 2935a: 90 91 9d 04 lds r25, 0x049D ; 0x80049d <_ZL12soft_pwm_fan.lto_priv.475> 2935e: 98 17 cp r25, r24 29360: 40 f4 brcc .+16 ; 0x29372 <__vector_14+0x14e> 29362: 9f b7 in r25, 0x3f ; 63 29364: f8 94 cli 29366: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2936a: 87 7f andi r24, 0xF7 ; 247 2936c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29370: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 29372: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29376: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 29378: 8f 77 andi r24, 0x7F ; 127 2937a: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2937e: 10 e0 ldi r17, 0x00 ; 0 29380: 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 29382: e8 01 movw r28, r16 29384: cc 0f add r28, r28 29386: dd 1f adc r29, r29 29388: cc 59 subi r28, 0x9C ; 156 2938a: d9 4f sbci r29, 0xF9 ; 249 2938c: 88 81 ld r24, Y 2938e: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 29390: 18 16 cp r1, r24 29392: 19 06 cpc r1, r25 29394: 0c f0 brlt .+2 ; 0x29398 <__vector_14+0x174> 29396: 4c c0 rjmp .+152 ; 0x29430 <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 29398: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2939a: f8 94 cli babystep(axis,/*fwd*/true); 2939c: 61 e0 ldi r22, 0x01 ; 1 2939e: 80 2f mov r24, r16 293a0: 0f 94 e6 21 call 0x243cc ; 0x243cc babystepsTodo[axis]--; //less to do next time 293a4: 88 81 ld r24, Y 293a6: 99 81 ldd r25, Y+1 ; 0x01 293a8: 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 293aa: 99 83 std Y+1, r25 ; 0x01 293ac: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 293ae: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 293b0: 0f 5f subi r16, 0xFF ; 255 293b2: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 293b4: 03 30 cpi r16, 0x03 ; 3 293b6: 11 05 cpc r17, r1 293b8: 21 f7 brne .-56 ; 0x29382 <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 293ba: 80 91 37 18 lds r24, 0x1837 ; 0x801837 <__bss_end+0x20> 293be: 90 91 38 18 lds r25, 0x1838 ; 0x801838 <__bss_end+0x21> 293c2: a0 91 39 18 lds r26, 0x1839 ; 0x801839 <__bss_end+0x22> 293c6: b0 91 3a 18 lds r27, 0x183A ; 0x80183a <__bss_end+0x23> 293ca: 82 3a cpi r24, 0xA2 ; 162 293cc: 92 4a sbci r25, 0xA2 ; 162 293ce: a1 05 cpc r26, r1 293d0: b1 05 cpc r27, r1 293d2: d9 f1 breq .+118 ; 0x2944a <__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); 293d4: 81 e0 ldi r24, 0x01 ; 1 293d6: 0e 94 05 68 call 0xd00a ; 0xd00a if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 293da: 68 ee ldi r22, 0xE8 ; 232 293dc: 73 e0 ldi r23, 0x03 ; 3 293de: 84 ed ldi r24, 0xD4 ; 212 293e0: 95 e0 ldi r25, 0x05 ; 5 293e2: 0f 94 b5 3f call 0x27f6a ; 0x27f6a ::expired(unsigned short)> 293e6: 88 23 and r24, r24 293e8: 09 f4 brne .+2 ; 0x293ec <__vector_14+0x1c8> 293ea: 5d cf rjmp .-326 ; 0x292a6 <__vector_14+0x82> { lcd_long_press_active = 1; 293ec: 81 e0 ldi r24, 0x01 ; 1 293ee: 80 93 d7 05 sts 0x05D7, r24 ; 0x8005d7 lcd_longpress_trigger = 1; 293f2: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 293f6: 57 cf rjmp .-338 ; 0x292a6 <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 293f8: 80 91 d8 05 lds r24, 0x05D8 ; 0x8005d8 293fc: 88 23 and r24, r24 293fe: 09 f4 brne .+2 ; 0x29402 <__vector_14+0x1de> 29400: 52 cf rjmp .-348 ; 0x292a6 <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 29402: 10 92 d8 05 sts 0x05D8, r1 ; 0x8005d8 if (!lcd_long_press_active) 29406: 80 91 d7 05 lds r24, 0x05D7 ; 0x8005d7 2940a: 81 11 cpse r24, r1 2940c: 03 c0 rjmp .+6 ; 0x29414 <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 2940e: 81 e0 ldi r24, 0x01 ; 1 29410: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 29414: 81 e0 ldi r24, 0x01 ; 1 29416: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 <_ZL26lcd_backlight_wake_trigger.lto_priv.559> lcd_long_press_active = 0; 2941a: 10 92 d7 05 sts 0x05D7, r1 ; 0x8005d7 2941e: 43 cf rjmp .-378 ; 0x292a6 <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 29420: 75 98 cbi 0x0e, 5 ; 14 29422: 78 cf rjmp .-272 ; 0x29314 <__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); 29424: 9f b7 in r25, 0x3f ; 63 29426: f8 94 cli 29428: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2942c: 87 7f andi r24, 0xF7 ; 247 2942e: 88 cf rjmp .-240 ; 0x29340 <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 29430: 89 2b or r24, r25 29432: 09 f4 brne .+2 ; 0x29436 <__vector_14+0x212> 29434: bd cf rjmp .-134 ; 0x293b0 <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 29436: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 29438: f8 94 cli babystep(axis,/*fwd*/false); 2943a: 60 e0 ldi r22, 0x00 ; 0 2943c: 80 2f mov r24, r16 2943e: 0f 94 e6 21 call 0x243cc ; 0x243cc babystepsTodo[axis]++; //less to do next time 29442: 88 81 ld r24, Y 29444: 99 81 ldd r25, Y+1 ; 0x01 29446: 01 96 adiw r24, 0x01 ; 1 29448: b0 cf rjmp .-160 ; 0x293aa <__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]) { 2944a: 9c b1 in r25, 0x0c ; 12 2944c: 80 91 e1 05 lds r24, 0x05E1 ; 0x8005e1 29450: 96 fb bst r25, 6 29452: 99 27 eor r25, r25 29454: 90 f9 bld r25, 0 29456: 98 17 cp r25, r24 29458: 91 f0 breq .+36 ; 0x2947e <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 2945a: 90 91 34 05 lds r25, 0x0534 ; 0x800534 2945e: 99 23 and r25, r25 29460: 51 f0 breq .+20 ; 0x29476 <__vector_14+0x252> 29462: 20 91 b3 04 lds r18, 0x04B3 ; 0x8004b3 29466: 30 91 b4 04 lds r19, 0x04B4 ; 0x8004b4 2946a: 2f 5f subi r18, 0xFF ; 255 2946c: 3f 4f sbci r19, 0xFF ; 255 2946e: 30 93 b4 04 sts 0x04B4, r19 ; 0x8004b4 29472: 20 93 b3 04 sts 0x04B3, r18 ; 0x8004b3 fan_state[0] = !fan_state[0]; 29476: 91 e0 ldi r25, 0x01 ; 1 29478: 89 27 eor r24, r25 2947a: 80 93 e1 05 sts 0x05E1, r24 ; 0x8005e1 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 2947e: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 29480: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 29484: 84 60 ori r24, 0x04 ; 4 29486: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 2948a: ff 91 pop r31 2948c: ef 91 pop r30 2948e: df 91 pop r29 29490: cf 91 pop r28 29492: bf 91 pop r27 29494: af 91 pop r26 29496: 9f 91 pop r25 29498: 8f 91 pop r24 2949a: 7f 91 pop r23 2949c: 6f 91 pop r22 2949e: 5f 91 pop r21 294a0: 4f 91 pop r20 294a2: 3f 91 pop r19 294a4: 2f 91 pop r18 294a6: 1f 91 pop r17 294a8: 0f 91 pop r16 294aa: ff 90 pop r15 294ac: 0f 90 pop r0 294ae: 0b be out 0x3b, r0 ; 59 294b0: 0f 90 pop r0 294b2: 0f be out 0x3f, r0 ; 63 294b4: 0f 90 pop r0 294b6: 1f 90 pop r1 294b8: 18 95 reti 000294ba : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 294ba: 4f 92 push r4 294bc: 5f 92 push r5 294be: 6f 92 push r6 294c0: 7f 92 push r7 294c2: af 92 push r10 294c4: bf 92 push r11 294c6: cf 92 push r12 294c8: df 92 push r13 294ca: ef 92 push r14 294cc: ff 92 push r15 294ce: 0f 93 push r16 294d0: 1f 93 push r17 294d2: cf 93 push r28 294d4: df 93 push r29 294d6: 24 e0 ldi r18, 0x04 ; 4 294d8: 30 e0 ldi r19, 0x00 ; 0 294da: 41 e0 ldi r20, 0x01 ; 1 294dc: 50 e0 ldi r21, 0x00 ; 0 294de: d9 01 movw r26, r18 294e0: ab 5a subi r26, 0xAB ; 171 294e2: b2 46 sbci r27, 0x62 ; 98 float celsius = 0; byte i; for (i=1; i raw) 294e4: fd 01 movw r30, r26 294e6: 65 91 lpm r22, Z+ 294e8: 74 91 lpm r23, Z 294ea: 86 17 cp r24, r22 294ec: 97 07 cpc r25, r23 294ee: 0c f0 brlt .+2 ; 0x294f2 294f0: 66 c0 rjmp .+204 ; 0x295be { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 294f2: 41 50 subi r20, 0x01 ; 1 294f4: 51 09 sbc r21, r1 294f6: 44 0f add r20, r20 294f8: 55 1f adc r21, r21 294fa: 44 0f add r20, r20 294fc: 55 1f adc r21, r21 294fe: ea 01 movw r28, r20 29500: c9 5a subi r28, 0xA9 ; 169 29502: d2 46 sbci r29, 0x62 ; 98 29504: fe 01 movw r30, r28 29506: 05 91 lpm r16, Z+ 29508: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 2950a: 4b 5a subi r20, 0xAB ; 171 2950c: 52 46 sbci r21, 0x62 ; 98 2950e: fa 01 movw r30, r20 29510: 65 91 lpm r22, Z+ 29512: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 29514: f9 01 movw r30, r18 29516: e9 5a subi r30, 0xA9 ; 169 29518: f2 46 sbci r31, 0x62 ; 98 2951a: e5 90 lpm r14, Z+ 2951c: f4 90 lpm r15, Z 2951e: fe 01 movw r30, r28 29520: c5 90 lpm r12, Z+ 29522: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 29524: fd 01 movw r30, r26 29526: c5 91 lpm r28, Z+ 29528: d4 91 lpm r29, Z 2952a: fa 01 movw r30, r20 2952c: a5 90 lpm r10, Z+ 2952e: 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])) * 29530: 86 1b sub r24, r22 29532: 97 0b sbc r25, r23 29534: bc 01 movw r22, r24 29536: 99 0f add r25, r25 29538: 88 0b sbc r24, r24 2953a: 99 0b sbc r25, r25 2953c: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29540: 2b 01 movw r4, r22 29542: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 29544: b7 01 movw r22, r14 29546: 6c 19 sub r22, r12 29548: 7d 09 sbc r23, r13 2954a: 07 2e mov r0, r23 2954c: 00 0c add r0, r0 2954e: 88 0b sbc r24, r24 29550: 99 0b sbc r25, r25 29552: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29556: 9b 01 movw r18, r22 29558: 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])) * 2955a: c3 01 movw r24, r6 2955c: b2 01 movw r22, r4 2955e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 29562: 6b 01 movw r12, r22 29564: 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])); 29566: be 01 movw r22, r28 29568: 6a 19 sub r22, r10 2956a: 7b 09 sbc r23, r11 2956c: 07 2e mov r0, r23 2956e: 00 0c add r0, r0 29570: 88 0b sbc r24, r24 29572: 99 0b sbc r25, r25 29574: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29578: 9b 01 movw r18, r22 2957a: 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])) / 2957c: c7 01 movw r24, r14 2957e: b6 01 movw r22, r12 29580: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 29584: 6b 01 movw r12, r22 29586: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 29588: b8 01 movw r22, r16 2958a: 11 0f add r17, r17 2958c: 88 0b sbc r24, r24 2958e: 99 0b sbc r25, r25 29590: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29594: 9b 01 movw r18, r22 29596: ac 01 movw r20, r24 29598: c7 01 movw r24, r14 2959a: b6 01 movw r22, r12 2959c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 295a0: df 91 pop r29 295a2: cf 91 pop r28 295a4: 1f 91 pop r17 295a6: 0f 91 pop r16 295a8: ff 90 pop r15 295aa: ef 90 pop r14 295ac: df 90 pop r13 295ae: cf 90 pop r12 295b0: bf 90 pop r11 295b2: af 90 pop r10 295b4: 7f 90 pop r7 295b6: 6f 90 pop r6 295b8: 5f 90 pop r5 295ba: 4f 90 pop r4 295bc: 08 95 ret 295be: 4f 5f subi r20, 0xFF ; 255 295c0: 5f 4f sbci r21, 0xFF ; 255 295c2: 2c 5f subi r18, 0xFC ; 252 295c4: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 295cc: 88 cf rjmp .-240 ; 0x294de (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]); 295ce: eb ed ldi r30, 0xDB ; 219 295d0: fd e9 ldi r31, 0x9D ; 157 295d2: 65 91 lpm r22, Z+ 295d4: 74 91 lpm r23, Z 295d6: 07 2e mov r0, r23 295d8: 00 0c add r0, r0 295da: 88 0b sbc r24, r24 295dc: 99 0b sbc r25, r25 295de: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 295e2: de cf rjmp .-68 ; 0x295a0 000295e4 : 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) { 295e4: 4f 92 push r4 295e6: 5f 92 push r5 295e8: 6f 92 push r6 295ea: 7f 92 push r7 295ec: af 92 push r10 295ee: bf 92 push r11 295f0: cf 92 push r12 295f2: df 92 push r13 295f4: ef 92 push r14 295f6: ff 92 push r15 295f8: 0f 93 push r16 295fa: 1f 93 push r17 295fc: cf 93 push r28 295fe: df 93 push r29 29600: 24 e0 ldi r18, 0x04 ; 4 29602: 30 e0 ldi r19, 0x00 ; 0 29604: 41 e0 ldi r20, 0x01 ; 1 29606: 50 e0 ldi r21, 0x00 ; 0 29608: d9 01 movw r26, r18 2960a: af 59 subi r26, 0x9F ; 159 2960c: b3 46 sbci r27, 0x63 ; 99 float celsius = 0; byte i; for (i=1; i raw) 2960e: fd 01 movw r30, r26 29610: 65 91 lpm r22, Z+ 29612: 74 91 lpm r23, Z 29614: 86 17 cp r24, r22 29616: 97 07 cpc r25, r23 29618: 0c f0 brlt .+2 ; 0x2961c 2961a: 80 c0 rjmp .+256 ; 0x2971c { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 2961c: 41 50 subi r20, 0x01 ; 1 2961e: 51 09 sbc r21, r1 29620: 44 0f add r20, r20 29622: 55 1f adc r21, r21 29624: 44 0f add r20, r20 29626: 55 1f adc r21, r21 29628: 8a 01 movw r16, r20 2962a: 0d 59 subi r16, 0x9D ; 157 2962c: 13 46 sbci r17, 0x63 ; 99 2962e: f8 01 movw r30, r16 29630: c5 90 lpm r12, Z+ 29632: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 29634: 4f 59 subi r20, 0x9F ; 159 29636: 53 46 sbci r21, 0x63 ; 99 29638: fa 01 movw r30, r20 2963a: 65 91 lpm r22, Z+ 2963c: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 2963e: f9 01 movw r30, r18 29640: ed 59 subi r30, 0x9D ; 157 29642: f3 46 sbci r31, 0x63 ; 99 29644: c5 91 lpm r28, Z+ 29646: d4 91 lpm r29, Z 29648: f8 01 movw r30, r16 2964a: 05 91 lpm r16, Z+ 2964c: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 2964e: fd 01 movw r30, r26 29650: e5 90 lpm r14, Z+ 29652: f4 90 lpm r15, Z 29654: fa 01 movw r30, r20 29656: a5 90 lpm r10, Z+ 29658: 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])) * 2965a: 86 1b sub r24, r22 2965c: 97 0b sbc r25, r23 2965e: bc 01 movw r22, r24 29660: 99 0f add r25, r25 29662: 88 0b sbc r24, r24 29664: 99 0b sbc r25, r25 29666: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 2966a: 2b 01 movw r4, r22 2966c: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 2966e: be 01 movw r22, r28 29670: 60 1b sub r22, r16 29672: 71 0b sbc r23, r17 29674: 07 2e mov r0, r23 29676: 00 0c add r0, r0 29678: 88 0b sbc r24, r24 2967a: 99 0b sbc r25, r25 2967c: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29680: 9b 01 movw r18, r22 29682: 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])) * 29684: c3 01 movw r24, r6 29686: b2 01 movw r22, r4 29688: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2968c: 2b 01 movw r4, r22 2968e: 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])); 29690: b7 01 movw r22, r14 29692: 6a 19 sub r22, r10 29694: 7b 09 sbc r23, r11 29696: 07 2e mov r0, r23 29698: 00 0c add r0, r0 2969a: 88 0b sbc r24, r24 2969c: 99 0b sbc r25, r25 2969e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 296a2: 9b 01 movw r18, r22 296a4: 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])) / 296a6: c3 01 movw r24, r6 296a8: b2 01 movw r22, r4 296aa: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 296ae: 2b 01 movw r4, r22 296b0: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 296b2: b6 01 movw r22, r12 296b4: dd 0c add r13, r13 296b6: 88 0b sbc r24, r24 296b8: 99 0b sbc r25, r25 296ba: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 296be: 9b 01 movw r18, r22 296c0: ac 01 movw r20, r24 296c2: c3 01 movw r24, r6 296c4: b2 01 movw r22, r4 296c6: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 296ca: 6b 01 movw r12, r22 296cc: 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) 296ce: 20 e0 ldi r18, 0x00 ; 0 296d0: 30 e0 ldi r19, 0x00 ; 0 296d2: 40 e2 ldi r20, 0x20 ; 32 296d4: 52 e4 ldi r21, 0x42 ; 66 296d6: c7 01 movw r24, r14 296d8: b6 01 movw r22, r12 296da: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 296de: 87 fd sbrc r24, 7 296e0: 30 c0 rjmp .+96 ; 0x29742 296e2: 20 e0 ldi r18, 0x00 ; 0 296e4: 30 e0 ldi r19, 0x00 ; 0 296e6: 48 e4 ldi r20, 0x48 ; 72 296e8: 52 e4 ldi r21, 0x42 ; 66 296ea: c7 01 movw r24, r14 296ec: b6 01 movw r22, r12 296ee: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 296f2: 18 16 cp r1, r24 296f4: 34 f1 brlt .+76 ; 0x29742 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 296f6: 20 e0 ldi r18, 0x00 ; 0 296f8: 30 e0 ldi r19, 0x00 ; 0 296fa: 40 e2 ldi r20, 0x20 ; 32 296fc: 52 e4 ldi r21, 0x42 ; 66 296fe: c7 01 movw r24, r14 29700: b6 01 movw r22, r12 29702: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 29706: 20 e0 ldi r18, 0x00 ; 0 29708: 30 e0 ldi r19, 0x00 ; 0 2970a: 40 e0 ldi r20, 0x00 ; 0 2970c: 5f e3 ldi r21, 0x3F ; 63 2970e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 29712: 9b 01 movw r18, r22 29714: 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; 29716: c7 01 movw r24, r14 29718: b6 01 movw r22, r12 2971a: 43 c0 rjmp .+134 ; 0x297a2 2971c: 4f 5f subi r20, 0xFF ; 255 2971e: 5f 4f sbci r21, 0xFF ; 255 29720: 2c 5f subi r18, 0xFC ; 252 29722: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 2972a: 6e cf rjmp .-292 ; 0x29608 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 2972c: e3 e5 ldi r30, 0x53 ; 83 2972e: fd e9 ldi r31, 0x9D ; 157 29730: 65 91 lpm r22, Z+ 29732: 74 91 lpm r23, Z 29734: 07 2e mov r0, r23 29736: 00 0c add r0, r0 29738: 88 0b sbc r24, r24 2973a: 99 0b sbc r25, r25 2973c: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29740: c4 cf rjmp .-120 ; 0x296ca if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 29742: 20 e0 ldi r18, 0x00 ; 0 29744: 30 e0 ldi r19, 0x00 ; 0 29746: 48 e4 ldi r20, 0x48 ; 72 29748: 52 e4 ldi r21, 0x42 ; 66 2974a: c7 01 movw r24, r14 2974c: b6 01 movw r22, r12 2974e: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 29752: 18 16 cp r1, r24 29754: dc f5 brge .+118 ; 0x297cc 29756: 20 e0 ldi r18, 0x00 ; 0 29758: 30 e0 ldi r19, 0x00 ; 0 2975a: 48 ec ldi r20, 0xC8 ; 200 2975c: 52 e4 ldi r21, 0x42 ; 66 2975e: c7 01 movw r24, r14 29760: b6 01 movw r22, r12 29762: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 29766: 18 16 cp r1, r24 29768: 8c f1 brlt .+98 ; 0x297cc { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 2976a: 20 e0 ldi r18, 0x00 ; 0 2976c: 30 e0 ldi r19, 0x00 ; 0 2976e: 40 ea ldi r20, 0xA0 ; 160 29770: 50 e4 ldi r21, 0x40 ; 64 29772: c7 01 movw r24, r14 29774: b6 01 movw r22, r12 29776: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2977a: 2b 01 movw r4, r22 2977c: 3c 01 movw r6, r24 2977e: 20 e0 ldi r18, 0x00 ; 0 29780: 30 e0 ldi r19, 0x00 ; 0 29782: 48 e4 ldi r20, 0x48 ; 72 29784: 52 e4 ldi r21, 0x42 ; 66 29786: c7 01 movw r24, r14 29788: b6 01 movw r22, r12 2978a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 2978e: 2d ec ldi r18, 0xCD ; 205 29790: 3c ec ldi r19, 0xCC ; 204 29792: 4c ec ldi r20, 0xCC ; 204 29794: 5d e3 ldi r21, 0x3D ; 61 29796: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2979a: 9b 01 movw r18, r22 2979c: ac 01 movw r20, r24 2979e: c3 01 movw r24, r6 297a0: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 297a2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 297a6: 6b 01 movw r12, r22 297a8: 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 } 297aa: c7 01 movw r24, r14 297ac: b6 01 movw r22, r12 297ae: df 91 pop r29 297b0: cf 91 pop r28 297b2: 1f 91 pop r17 297b4: 0f 91 pop r16 297b6: ff 90 pop r15 297b8: ef 90 pop r14 297ba: df 90 pop r13 297bc: cf 90 pop r12 297be: bf 90 pop r11 297c0: af 90 pop r10 297c2: 7f 90 pop r7 297c4: 6f 90 pop r6 297c6: 5f 90 pop r5 297c8: 4f 90 pop r4 297ca: 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) 297cc: 20 e0 ldi r18, 0x00 ; 0 297ce: 30 e0 ldi r19, 0x00 ; 0 297d0: 48 ec ldi r20, 0xC8 ; 200 297d2: 52 e4 ldi r21, 0x42 ; 66 297d4: c7 01 movw r24, r14 297d6: b6 01 movw r22, r12 297d8: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 297dc: 18 16 cp r1, r24 297de: 2c f7 brge .-54 ; 0x297aa { celsius = celsius + _offset; 297e0: 20 e0 ldi r18, 0x00 ; 0 297e2: 30 e0 ldi r19, 0x00 ; 0 297e4: 40 e2 ldi r20, 0x20 ; 32 297e6: 51 e4 ldi r21, 0x41 ; 65 297e8: 96 cf rjmp .-212 ; 0x29716 000297ea : } static void check_temp_raw(); static void temp_mgr_isr() { 297ea: 4f 92 push r4 297ec: 5f 92 push r5 297ee: 6f 92 push r6 297f0: 7f 92 push r7 297f2: af 92 push r10 297f4: cf 92 push r12 297f6: df 92 push r13 297f8: ef 92 push r14 297fa: ff 92 push r15 297fc: 0f 93 push r16 297fe: 1f 93 push r17 29800: cf 93 push r28 29802: 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 29808: 90 91 07 06 lds r25, 0x0607 ; 0x800607 2980c: 0e 94 86 da call 0x1b50c ; 0x1b50c 29810: 60 93 18 05 sts 0x0518, r22 ; 0x800518 29814: 70 93 19 05 sts 0x0519, r23 ; 0x800519 29818: 80 93 1a 05 sts 0x051A, r24 ; 0x80051a 2981c: 90 93 1b 05 sts 0x051B, r25 ; 0x80051b current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 29820: 60 90 04 06 lds r6, 0x0604 ; 0x800604 29824: 70 90 05 06 lds r7, 0x0605 ; 0x800605 29828: c3 01 movw r24, r6 2982a: 0f 94 f2 4a call 0x295e4 ; 0x295e4 2982e: 6b 01 movw r12, r22 29830: 7c 01 movw r14, r24 29832: c0 92 14 06 sts 0x0614, r12 ; 0x800614 29836: d0 92 15 06 sts 0x0615, r13 ; 0x800615 2983a: e0 92 16 06 sts 0x0616, r14 ; 0x800616 2983e: f0 92 17 06 sts 0x0617, r15 ; 0x800617 #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 29842: 80 91 02 06 lds r24, 0x0602 ; 0x800602 29846: 90 91 03 06 lds r25, 0x0603 ; 0x800603 2984a: 0f 94 f2 4a call 0x295e4 ; 0x295e4 2984e: 60 93 fe 05 sts 0x05FE, r22 ; 0x8005fe 29852: 70 93 ff 05 sts 0x05FF, r23 ; 0x8005ff 29856: 80 93 00 06 sts 0x0600, r24 ; 0x800600 2985a: 90 93 01 06 sts 0x0601, r25 ; 0x800601 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) 2985e: c0 91 10 06 lds r28, 0x0610 ; 0x800610 29862: d0 91 11 06 lds r29, 0x0611 ; 0x800611 29866: ce 01 movw r24, r28 29868: 0f 94 5d 4a call 0x294ba ; 0x294ba 2986c: 60 93 1b 06 sts 0x061B, r22 ; 0x80061b 29870: 70 93 1c 06 sts 0x061C, r23 ; 0x80061c 29874: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d 29878: 90 93 1e 06 sts 0x061E, r25 ; 0x80061e #endif temp_meas_ready = true; 2987c: 81 e0 ldi r24, 0x01 ; 1 2987e: 80 93 fd 05 sts 0x05FD, r24 ; 0x8005fd { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 29882: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29886: 8d 7f andi r24, 0xFD ; 253 29888: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 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]) { 2988c: 20 91 06 06 lds r18, 0x0606 ; 0x800606 29890: 30 91 07 06 lds r19, 0x0607 ; 0x800607 29894: 80 91 99 04 lds r24, 0x0499 ; 0x800499 <_ZL12maxttemp_raw.lto_priv.478> 29898: 90 91 9a 04 lds r25, 0x049A ; 0x80049a <_ZL12maxttemp_raw.lto_priv.478+0x1> 2989c: 82 17 cp r24, r18 2989e: 93 07 cpc r25, r19 298a0: 2c f0 brlt .+10 ; 0x298ac #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 298a2: 40 e0 ldi r20, 0x00 ; 0 298a4: 60 e0 ldi r22, 0x00 ; 0 298a6: 80 e0 ldi r24, 0x00 ; 0 298a8: 0f 94 6a 45 call 0x28ad4 ; 0x28ad4 } //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) { 298ac: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL16bed_maxttemp_raw.lto_priv.479> 298b0: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL16bed_maxttemp_raw.lto_priv.479+0x1> 298b4: 86 15 cp r24, r6 298b6: 97 05 cpc r25, r7 298b8: 2c f0 brlt .+10 ; 0x298c4 #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 298ba: 40 e0 ldi r20, 0x00 ; 0 298bc: 60 e0 ldi r22, 0x00 ; 0 298be: 81 e0 ldi r24, 0x01 ; 1 298c0: 0f 94 6a 45 call 0x28ad4 ; 0x28ad4 } #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) { 298c4: 80 91 95 04 lds r24, 0x0495 ; 0x800495 <_ZL20ambient_maxttemp_raw.lto_priv.480> 298c8: 90 91 96 04 lds r25, 0x0496 ; 0x800496 <_ZL20ambient_maxttemp_raw.lto_priv.480+0x1> 298cc: 8c 17 cp r24, r28 298ce: 9d 07 cpc r25, r29 298d0: 2c f0 brlt .+10 ; 0x298dc #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 298d2: 40 e0 ldi r20, 0x00 ; 0 298d4: 60 e0 ldi r22, 0x00 ; 0 298d6: 82 e0 ldi r24, 0x02 ; 2 298d8: 0f 94 6a 45 call 0x28ad4 ; 0x28ad4 #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) { 298dc: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.477> 298e0: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.477+0x1> 298e4: c8 17 cp r28, r24 298e6: d9 07 cpc r29, r25 298e8: 2c f0 brlt .+10 ; 0x298f4 #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 298ea: 41 e0 ldi r20, 0x01 ; 1 298ec: 60 e0 ldi r22, 0x00 ; 0 298ee: 82 e0 ldi r24, 0x02 ; 2 298f0: 0f 94 6a 45 call 0x28ad4 ; 0x28ad4 #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 298f4: c1 3a cpi r28, 0xA1 ; 161 298f6: de 43 sbci r29, 0x3E ; 62 298f8: 0c f4 brge .+2 ; 0x298fc 298fa: cd c1 rjmp .+922 ; 0x29c96 { // 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]) { 298fc: 60 91 9b 04 lds r22, 0x049B ; 0x80049b <_ZL8minttemp.lto_priv.476> 29900: 70 91 9c 04 lds r23, 0x049C ; 0x80049c <_ZL8minttemp.lto_priv.476+0x1> 29904: 80 91 19 06 lds r24, 0x0619 ; 0x800619 29908: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 2990c: 68 17 cp r22, r24 2990e: 79 07 cpc r23, r25 29910: 0c f0 brlt .+2 ; 0x29914 29912: 55 c0 rjmp .+170 ; 0x299be // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 29914: c0 91 0f 06 lds r28, 0x060F ; 0x80060f 29918: c1 11 cpse r28, r1 2991a: 18 c0 rjmp .+48 ; 0x2994c 2991c: 6b 5f subi r22, 0xFB ; 251 2991e: 7f 4f sbci r23, 0xFF ; 255 29920: 07 2e mov r0, r23 29922: 00 0c add r0, r0 29924: 88 0b sbc r24, r24 29926: 99 0b sbc r25, r25 29928: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 2992c: 9b 01 movw r18, r22 2992e: ac 01 movw r20, r24 29930: c1 e0 ldi r28, 0x01 ; 1 29932: 60 91 18 05 lds r22, 0x0518 ; 0x800518 29936: 70 91 19 05 lds r23, 0x0519 ; 0x800519 2993a: 80 91 1a 05 lds r24, 0x051A ; 0x80051a 2993e: 90 91 1b 05 lds r25, 0x051B ; 0x80051b 29942: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 29946: 18 16 cp r1, r24 29948: 0c f0 brlt .+2 ; 0x2994c 2994a: c0 e0 ldi r28, 0x00 ; 0 2994c: c0 93 0f 06 sts 0x060F, r28 ; 0x80060f if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 29950: 68 e9 ldi r22, 0x98 ; 152 29952: 7a e3 ldi r23, 0x3A ; 58 29954: 8c e0 ldi r24, 0x0C ; 12 29956: 96 e0 ldi r25, 0x06 ; 6 29958: 0f 94 dd 3f call 0x27fba ; 0x27fba ::expired_cont(unsigned short)> 2995c: 81 11 cpse r24, r1 2995e: 02 c0 rjmp .+4 ; 0x29964 29960: cc 23 and r28, r28 29962: 29 f0 breq .+10 ; 0x2996e bCheckingOnHeater=true; // not necessary 29964: 81 e0 ldi r24, 0x01 ; 1 29966: 80 93 0f 06 sts 0x060F, r24 ; 0x80060f check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active 2996a: 0f 94 e4 45 call 0x28bc8 ; 0x28bc8 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 2996e: 80 91 12 06 lds r24, 0x0612 ; 0x800612 29972: 90 91 13 06 lds r25, 0x0613 ; 0x800613 29976: 0b 97 sbiw r24, 0x0b ; 11 29978: 4c f1 brlt .+82 ; 0x299cc // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 2997a: c0 91 0b 06 lds r28, 0x060B ; 0x80060b 2997e: c1 11 cpse r28, r1 29980: 0c c0 rjmp .+24 ; 0x2999a 29982: c1 e0 ldi r28, 0x01 ; 1 29984: 20 e0 ldi r18, 0x00 ; 0 29986: 30 e0 ldi r19, 0x00 ; 0 29988: 40 e7 ldi r20, 0x70 ; 112 2998a: 51 e4 ldi r21, 0x41 ; 65 2998c: c7 01 movw r24, r14 2998e: b6 01 movw r22, r12 29990: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 29994: 18 16 cp r1, r24 29996: 0c f0 brlt .+2 ; 0x2999a 29998: c0 e0 ldi r28, 0x00 ; 0 2999a: c0 93 0b 06 sts 0x060B, r28 ; 0x80060b if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 2999e: 60 e5 ldi r22, 0x50 ; 80 299a0: 73 ec ldi r23, 0xC3 ; 195 299a2: 88 e0 ldi r24, 0x08 ; 8 299a4: 96 e0 ldi r25, 0x06 ; 6 299a6: 0f 94 dd 3f call 0x27fba ; 0x27fba ::expired_cont(unsigned short)> 299aa: 81 11 cpse r24, r1 299ac: 02 c0 rjmp .+4 ; 0x299b2 299ae: cc 23 and r28, r28 299b0: 99 f0 breq .+38 ; 0x299d8 bCheckingOnBed=true; // not necessary 299b2: 81 e0 ldi r24, 0x01 ; 1 299b4: 80 93 0b 06 sts 0x060B, r24 ; 0x80060b #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 299b8: 0f 94 d3 45 call 0x28ba6 ; 0x28ba6 299bc: 0d c0 rjmp .+26 ; 0x299d8 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 299be: 8c e0 ldi r24, 0x0C ; 12 299c0: 96 e0 ldi r25, 0x06 ; 6 299c2: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> bCheckingOnHeater=false; 299c6: 10 92 0f 06 sts 0x060F, r1 ; 0x80060f 299ca: d1 cf rjmp .-94 ; 0x2996e check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 299cc: 88 e0 ldi r24, 0x08 ; 8 299ce: 96 e0 ldi r25, 0x06 ; 6 299d0: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> bCheckingOnBed=false; 299d4: 10 92 0b 06 sts 0x060B, r1 ; 0x80060b 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); 299d8: 60 91 17 05 lds r22, 0x0517 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 299dc: 70 e0 ldi r23, 0x00 ; 0 299de: 90 e0 ldi r25, 0x00 ; 0 299e0: 80 e0 ldi r24, 0x00 ; 0 299e2: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 299e6: 6b 01 movw r12, r22 299e8: 7c 01 movw r14, r24 299ea: 40 90 18 05 lds r4, 0x0518 ; 0x800518 299ee: 50 90 19 05 lds r5, 0x0519 ; 0x800519 299f2: 60 90 1a 05 lds r6, 0x051A ; 0x80051a 299f6: 70 90 1b 05 lds r7, 0x051B ; 0x80051b 299fa: 60 91 19 06 lds r22, 0x0619 ; 0x800619 299fe: 70 91 1a 06 lds r23, 0x061A ; 0x80061a 29a02: 07 2e mov r0, r23 29a04: 00 0c add r0, r0 29a06: 88 0b sbc r24, r24 29a08: 99 0b sbc r25, r25 29a0a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29a0e: ab 01 movw r20, r22 29a10: bc 01 movw r22, r24 29a12: a1 2c mov r10, r1 29a14: 93 01 movw r18, r6 29a16: 82 01 movw r16, r4 29a18: 81 e0 ldi r24, 0x01 ; 1 29a1a: 0f 94 f5 45 call 0x28bea ; 0x28bea #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 29a1e: 60 91 18 06 lds r22, 0x0618 ; 0x800618 29a22: 70 e0 ldi r23, 0x00 ; 0 29a24: 90 e0 ldi r25, 0x00 ; 0 29a26: 80 e0 ldi r24, 0x00 ; 0 29a28: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 29a2c: 6b 01 movw r12, r22 29a2e: 7c 01 movw r14, r24 29a30: 40 90 14 06 lds r4, 0x0614 ; 0x800614 29a34: 50 90 15 06 lds r5, 0x0615 ; 0x800615 29a38: 60 90 16 06 lds r6, 0x0616 ; 0x800616 29a3c: 70 90 17 06 lds r7, 0x0617 ; 0x800617 29a40: 60 91 12 06 lds r22, 0x0612 ; 0x800612 29a44: 70 91 13 06 lds r23, 0x0613 ; 0x800613 29a48: 07 2e mov r0, r23 29a4a: 00 0c add r0, r0 29a4c: 88 0b sbc r24, r24 29a4e: 99 0b sbc r25, r25 29a50: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29a54: ab 01 movw r20, r22 29a56: bc 01 movw r22, r24 29a58: aa 24 eor r10, r10 29a5a: a3 94 inc r10 29a5c: 93 01 movw r18, r6 29a5e: 82 01 movw r16, r4 29a60: 80 e0 ldi r24, 0x00 ; 0 29a62: 0f 94 f5 45 call 0x28bea ; 0x28bea return true; } static void check() { if(!enabled) return; 29a66: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZN13thermal_modelL7enabledE.lto_priv.471> 29a6a: 88 23 and r24, r24 29a6c: 09 f4 brne .+2 ; 0x29a70 29a6e: bc c0 rjmp .+376 ; 0x29be8 uint8_t heater_pwm = soft_pwm[0]; 29a70: c0 91 17 05 lds r28, 0x0517 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> uint8_t fan_pwm = soft_pwm_fan; 29a74: d0 91 9d 04 lds r29, 0x049D ; 0x80049d <_ZL12soft_pwm_fan.lto_priv.475> float heater_temp = current_temperature_isr[0]; 29a78: 40 90 18 05 lds r4, 0x0518 ; 0x800518 29a7c: 50 90 19 05 lds r5, 0x0519 ; 0x800519 29a80: 60 90 1a 05 lds r6, 0x051A ; 0x80051a 29a84: 70 90 1b 05 lds r7, 0x051B ; 0x80051b float ambient_temp = current_temperature_ambient_isr; 29a88: c0 90 1b 06 lds r12, 0x061B ; 0x80061b 29a8c: d0 90 1c 06 lds r13, 0x061C ; 0x80061c 29a90: e0 90 1d 06 lds r14, 0x061D ; 0x80061d 29a94: f0 90 1e 06 lds r15, 0x061E ; 0x80061e // 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) 29a98: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29a9c: 80 ff sbrs r24, 0 29a9e: 72 c0 rjmp .+228 ; 0x29b84 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); 29aa0: 20 91 c2 12 lds r18, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 29aa4: 30 91 c3 12 lds r19, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 29aa8: 40 91 c4 12 lds r20, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 29aac: 50 91 c5 12 lds r21, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 29ab0: 61 e7 ldi r22, 0x71 ; 113 29ab2: 7d e3 ldi r23, 0x3D ; 61 29ab4: 8a e8 ldi r24, 0x8A ; 138 29ab6: 9e e3 ldi r25, 0x3E ; 62 29ab8: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 29abc: 60 93 19 13 sts 0x1319, r22 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 29ac0: 70 93 1a 13 sts 0x131A, r23 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 29ac4: 80 93 1b 13 sts 0x131B, r24 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 29ac8: 90 93 1c 13 sts 0x131C, r25 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> warn_s = warn * TEMP_MGR_INTV; 29acc: 21 e7 ldi r18, 0x71 ; 113 29ace: 3d e3 ldi r19, 0x3D ; 61 29ad0: 4a e8 ldi r20, 0x8A ; 138 29ad2: 5e e3 ldi r21, 0x3E ; 62 29ad4: 60 91 10 13 lds r22, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 29ad8: 70 91 11 13 lds r23, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 29adc: 80 91 12 13 lds r24, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 29ae0: 90 91 13 13 lds r25, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 29ae4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 29ae8: 60 93 1d 13 sts 0x131D, r22 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 29aec: 70 93 1e 13 sts 0x131E, r23 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 29af0: 80 93 1f 13 sts 0x131F, r24 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 29af4: 90 93 20 13 sts 0x1320, r25 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> err_s = err * TEMP_MGR_INTV; 29af8: 21 e7 ldi r18, 0x71 ; 113 29afa: 3d e3 ldi r19, 0x3D ; 61 29afc: 4a e8 ldi r20, 0x8A ; 138 29afe: 5e e3 ldi r21, 0x3E ; 62 29b00: 60 91 14 13 lds r22, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 29b04: 70 91 15 13 lds r23, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 29b08: 80 91 16 13 lds r24, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 29b0c: 90 91 17 13 lds r25, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 29b10: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 29b14: 60 93 21 13 sts 0x1321, r22 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 29b18: 70 93 22 13 sts 0x1322, r23 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 29b1c: 80 93 23 13 sts 0x1323, r24 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 29b20: 90 93 24 13 sts 0x1324, r25 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 29b24: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 29b28: 90 91 cb 12 lds r25, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 29b2c: 6e e0 ldi r22, 0x0E ; 14 29b2e: 71 e0 ldi r23, 0x01 ; 1 29b30: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 29b34: 60 93 ac 12 sts 0x12AC, r22 ; 0x8012ac <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 29b38: ec e8 ldi r30, 0x8C ; 140 29b3a: f2 e1 ldi r31, 0x12 ; 18 29b3c: 8c ea ldi r24, 0xAC ; 172 29b3e: 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; 29b40: 40 e0 ldi r20, 0x00 ; 0 29b42: 50 e0 ldi r21, 0x00 ; 0 29b44: 60 ec ldi r22, 0xC0 ; 192 29b46: 7f e7 ldi r23, 0x7F ; 127 29b48: 41 93 st Z+, r20 29b4a: 51 93 st Z+, r21 29b4c: 61 93 st Z+, r22 29b4e: 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) 29b50: 8e 17 cp r24, r30 29b52: 9f 07 cpc r25, r31 29b54: c9 f7 brne .-14 ; 0x29b48 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 29b56: 10 92 ad 12 sts 0x12AD, r1 ; 0x8012ad <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> dT_err_prev = 0; 29b5a: 10 92 ae 12 sts 0x12AE, r1 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 29b5e: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 29b62: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 29b66: 10 92 b1 12 sts 0x12B1, r1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> T_prev = NAN; 29b6a: 40 93 b2 12 sts 0x12B2, r20 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 29b6e: 50 93 b3 12 sts 0x12B3, r21 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 29b72: 60 93 b4 12 sts 0x12B4, r22 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 29b76: 70 93 b5 12 sts 0x12B5, r23 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> // clear the initialization flag flag_bits.uninitialized = false; 29b7a: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29b7e: 8e 7f andi r24, 0xFE ; 254 29b80: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+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); 29b84: 87 01 movw r16, r14 29b86: 76 01 movw r14, r12 29b88: a3 01 movw r20, r6 29b8a: 92 01 movw r18, r4 29b8c: 6d 2f mov r22, r29 29b8e: 8c 2f mov r24, r28 29b90: 0e 94 aa db call 0x1b754 ; 0x1b754 // handle errors if(data.flag_bits.error) 29b94: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29b98: 81 ff sbrs r24, 1 29b9a: 05 c0 rjmp .+10 ; 0x29ba6 set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 29b9c: 44 e0 ldi r20, 0x04 ; 4 29b9e: 60 e0 ldi r22, 0x00 ; 0 29ba0: 80 e0 ldi r24, 0x00 ; 0 29ba2: 0f 94 6a 45 call 0x28ad4 ; 0x28ad4 // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 29ba6: 90 91 18 13 lds r25, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29baa: 80 91 34 06 lds r24, 0x0634 ; 0x800634 29bae: 92 fb bst r25, 2 29bb0: 81 f9 bld r24, 1 29bb2: 80 93 34 06 sts 0x0634, r24 ; 0x800634 if(warning_state.assert) { 29bb6: 80 91 34 06 lds r24, 0x0634 ; 0x800634 29bba: 81 ff sbrs r24, 1 29bbc: 15 c0 rjmp .+42 ; 0x29be8 warning_state.warning = true; 29bbe: 80 91 34 06 lds r24, 0x0634 ; 0x800634 29bc2: 81 60 ori r24, 0x01 ; 1 29bc4: 80 93 34 06 sts 0x0634, r24 ; 0x800634 warning_state.dT_err = thermal_model::data.dT_err_prev; 29bc8: 80 91 ae 12 lds r24, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 29bcc: 90 91 af 12 lds r25, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 29bd0: a0 91 b0 12 lds r26, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 29bd4: b0 91 b1 12 lds r27, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> 29bd8: 80 93 30 06 sts 0x0630, r24 ; 0x800630 29bdc: 90 93 31 06 sts 0x0631, r25 ; 0x800631 29be0: a0 93 32 06 sts 0x0632, r26 ; 0x800632 29be4: b0 93 33 06 sts 0x0633, r27 ; 0x800633 (int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b); } static void log_isr() { if(!log_buf.enabled) return; 29be8: 80 91 2f 06 lds r24, 0x062F ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x10> 29bec: 88 23 and r24, r24 29bee: 09 f4 brne .+2 ; 0x29bf2 29bf0: 3f c0 rjmp .+126 ; 0x29c70 uint32_t stamp = _millis(); 29bf2: 0f 94 83 3f call 0x27f06 ; 0x27f06 uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 29bf6: c0 90 1f 06 lds r12, 0x061F ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.558> 29bfa: d0 90 20 06 lds r13, 0x0620 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x1> 29bfe: e0 90 21 06 lds r14, 0x0621 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x2> 29c02: f0 90 22 06 lds r15, 0x0622 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x3> log_buf.entry.stamp = stamp; 29c06: 60 93 1f 06 sts 0x061F, r22 ; 0x80061f <_ZN13thermal_modelL7log_bufE.lto_priv.558> 29c0a: 70 93 20 06 sts 0x0620, r23 ; 0x800620 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x1> 29c0e: 80 93 21 06 sts 0x0621, r24 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x2> 29c12: 90 93 22 06 sts 0x0622, r25 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x3> ++log_buf.entry.counter; 29c16: 20 91 24 06 lds r18, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x5> 29c1a: 2f 5f subi r18, 0xFF ; 255 29c1c: 20 93 24 06 sts 0x0624, r18 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.558+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); 29c20: 6c 19 sub r22, r12 29c22: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 29c24: 60 93 23 06 sts 0x0623, r22 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 29c28: 80 91 17 05 lds r24, 0x0517 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 29c2c: 80 93 25 06 sts 0x0625, r24 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 29c30: 80 91 18 05 lds r24, 0x0518 ; 0x800518 29c34: 90 91 19 05 lds r25, 0x0519 ; 0x800519 29c38: a0 91 1a 05 lds r26, 0x051A ; 0x80051a 29c3c: b0 91 1b 05 lds r27, 0x051B ; 0x80051b 29c40: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x7> 29c44: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x8> 29c48: a0 93 28 06 sts 0x0628, r26 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x9> 29c4c: b0 93 29 06 sts 0x0629, r27 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 29c50: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 29c54: 90 91 1c 06 lds r25, 0x061C ; 0x80061c 29c58: a0 91 1d 06 lds r26, 0x061D ; 0x80061d 29c5c: b0 91 1e 06 lds r27, 0x061E ; 0x80061e 29c60: 80 93 2a 06 sts 0x062A, r24 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xb> 29c64: 90 93 2b 06 sts 0x062B, r25 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xc> 29c68: a0 93 2c 06 sts 0x062C, r26 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xd> 29c6c: b0 93 2d 06 sts 0x062D, r27 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xe> thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 29c70: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> 29c74: 88 23 and r24, r24 29c76: 91 f0 breq .+36 ; 0x29c9c temp_mgr_pid(); } 29c78: df 91 pop r29 29c7a: cf 91 pop r28 29c7c: 1f 91 pop r17 29c7e: 0f 91 pop r16 29c80: ff 90 pop r15 29c82: ef 90 pop r14 29c84: df 90 pop r13 29c86: cf 90 pop r12 29c88: af 90 pop r10 29c8a: 7f 90 pop r7 29c8c: 6f 90 pop r6 29c8e: 5f 90 pop r5 29c90: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 29c92: 0d 94 12 1f jmp 0x23e24 ; 0x23e24 // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 29c96: 0f 94 e4 45 call 0x28bc8 ; 0x28bc8 29c9a: 8e ce rjmp .-740 ; 0x299b8 #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 29c9c: df 91 pop r29 29c9e: cf 91 pop r28 29ca0: 1f 91 pop r17 29ca2: 0f 91 pop r16 29ca4: ff 90 pop r15 29ca6: ef 90 pop r14 29ca8: df 90 pop r13 29caa: cf 90 pop r12 29cac: af 90 pop r10 29cae: 7f 90 pop r7 29cb0: 6f 90 pop r6 29cb2: 5f 90 pop r5 29cb4: 4f 90 pop r4 29cb6: 08 95 ret 00029cb8 <__vector_47>: ISR(TIMERx_COMPA_vect) { 29cb8: 1f 92 push r1 29cba: 0f 92 push r0 29cbc: 0f b6 in r0, 0x3f ; 63 29cbe: 0f 92 push r0 29cc0: 11 24 eor r1, r1 29cc2: 0b b6 in r0, 0x3b ; 59 29cc4: 0f 92 push r0 29cc6: 2f 93 push r18 29cc8: 3f 93 push r19 29cca: 4f 93 push r20 29ccc: 5f 93 push r21 29cce: 6f 93 push r22 29cd0: 7f 93 push r23 29cd2: 8f 93 push r24 29cd4: 9f 93 push r25 29cd6: af 93 push r26 29cd8: bf 93 push r27 29cda: ef 93 push r30 29cdc: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 29cde: 80 91 1d 05 lds r24, 0x051D ; 0x80051d <_ZL16adc_values_ready.lto_priv.472> 29ce2: 88 23 and r24, r24 29ce4: 91 f0 breq .+36 ; 0x29d0a <__vector_47+0x52> adc_values_ready = false; 29ce6: 10 92 1d 05 sts 0x051D, r1 ; 0x80051d <_ZL16adc_values_ready.lto_priv.472> adc_start_cycle(); 29cea: 0e 94 7c 8f call 0x11ef8 ; 0x11ef8 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 29cee: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29cf2: 8d 7f andi r24, 0xFD ; 253 29cf4: 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(); 29cf8: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 29cfa: 0f 94 f5 4b call 0x297ea ; 0x297ea (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 29cfe: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 29d00: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29d04: 82 60 ori r24, 0x02 ; 2 29d06: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 29d0a: ff 91 pop r31 29d0c: ef 91 pop r30 29d0e: bf 91 pop r27 29d10: af 91 pop r26 29d12: 9f 91 pop r25 29d14: 8f 91 pop r24 29d16: 7f 91 pop r23 29d18: 6f 91 pop r22 29d1a: 5f 91 pop r21 29d1c: 4f 91 pop r20 29d1e: 3f 91 pop r19 29d20: 2f 91 pop r18 29d22: 0f 90 pop r0 29d24: 0b be out 0x3b, r0 ; 59 29d26: 0f 90 pop r0 29d28: 0f be out 0x3f, r0 ; 63 29d2a: 0f 90 pop r0 29d2c: 1f 90 pop r1 29d2e: 18 95 reti 00029d30 : } void handle_temp_error(); void manage_heater() { 29d30: 6f 92 push r6 29d32: 7f 92 push r7 29d34: 8f 92 push r8 29d36: 9f 92 push r9 29d38: af 92 push r10 29d3a: bf 92 push r11 29d3c: cf 92 push r12 29d3e: df 92 push r13 29d40: ef 92 push r14 29d42: ff 92 push r15 29d44: 0f 93 push r16 29d46: 1f 93 push r17 29d48: cf 93 push r28 29d4a: df 93 push r29 29d4c: 1f 92 push r1 29d4e: cd b7 in r28, 0x3d ; 61 29d50: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 29d52: 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) 29d54: 80 91 fd 05 lds r24, 0x05FD ; 0x8005fd 29d58: 88 23 and r24, r24 29d5a: 09 f4 brne .+2 ; 0x29d5e 29d5c: bb c0 rjmp .+374 ; 0x29ed4 return; // syncronize temperatures with isr updateTemperatures(); 29d5e: 0f 94 b9 48 call 0x29172 ; 0x29172 #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 29d62: 80 91 34 06 lds r24, 0x0634 ; 0x800634 29d66: 80 ff sbrs r24, 0 29d68: 51 c0 rjmp .+162 ; 0x29e0c } static void handle_warning() { // update values float warn = data.warn; 29d6a: 10 91 10 13 lds r17, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 29d6e: 00 91 11 13 lds r16, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 29d72: b0 90 12 13 lds r11, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 29d76: a0 90 13 13 lds r10, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 29d7a: ce 01 movw r24, r28 29d7c: 01 96 adiw r24, 0x01 ; 1 29d7e: 0f 94 d6 47 call 0x28fac ; 0x28fac dT_err = warning_state.dT_err; 29d82: c0 90 30 06 lds r12, 0x0630 ; 0x800630 29d86: d0 90 31 06 lds r13, 0x0631 ; 0x800631 29d8a: e0 90 32 06 lds r14, 0x0632 ; 0x800632 29d8e: f0 90 33 06 lds r15, 0x0633 ; 0x800633 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 29d92: ce 01 movw r24, r28 29d94: 01 96 adiw r24, 0x01 ; 1 29d96: 0f 94 c9 47 call 0x28f92 ; 0x28f92 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); 29d9a: af 92 push r10 29d9c: bf 92 push r11 29d9e: 0f 93 push r16 29da0: 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 29da2: 21 e7 ldi r18, 0x71 ; 113 29da4: 3d e3 ldi r19, 0x3D ; 61 29da6: 4a e8 ldi r20, 0x8A ; 138 29da8: 5e e3 ldi r21, 0x3E ; 62 29daa: c7 01 movw r24, r14 29dac: b6 01 movw r22, r12 29dae: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 29db2: 9f 93 push r25 29db4: 8f 93 push r24 29db6: 7f 93 push r23 29db8: 6f 93 push r22 29dba: 8e e4 ldi r24, 0x4E ; 78 29dbc: 9c e9 ldi r25, 0x9C ; 156 29dbe: 9f 93 push r25 29dc0: 8f 93 push r24 29dc2: 0f 94 4b dc call 0x3b896 ; 0x3b896 static bool first = true; if(warning_state.assert) { 29dc6: 90 91 34 06 lds r25, 0x0634 ; 0x800634 29dca: 0f b6 in r0, 0x3f ; 63 29dcc: f8 94 cli 29dce: de bf out 0x3e, r29 ; 62 29dd0: 0f be out 0x3f, r0 ; 63 29dd2: cd bf out 0x3d, r28 ; 61 29dd4: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> 29dd8: 91 ff sbrs r25, 1 29dda: 93 c0 rjmp .+294 ; 0x29f02 if (first) { 29ddc: 90 91 7b 02 lds r25, 0x027B ; 0x80027b 29de0: 99 23 and r25, r25 29de2: 09 f4 brne .+2 ; 0x29de6 29de4: 87 c0 rjmp .+270 ; 0x29ef4 if(warn_beep) { 29de6: 88 23 and r24, r24 29de8: 79 f0 breq .+30 ; 0x29e08 lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 29dea: 8f e5 ldi r24, 0x5F ; 95 29dec: 99 e4 ldi r25, 0x49 ; 73 29dee: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 29df2: 61 e0 ldi r22, 0x01 ; 1 29df4: 0f 94 bf 06 call 0x20d7e ; 0x20d7e WRITE(BEEPER, HIGH); 29df8: 9f b7 in r25, 0x3f ; 63 29dfa: f8 94 cli 29dfc: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e00: 84 60 ori r24, 0x04 ; 4 29e02: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e06: 9f bf out 0x3f, r25 ; 63 } first = false; 29e08: 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) 29e0c: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29e10: 88 23 and r24, r24 29e12: 89 f0 breq .+34 ; 0x29e36 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29e14: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29e18: 82 95 swap r24 29e1a: 86 95 lsr r24 29e1c: 87 70 andi r24, 0x07 ; 7 29e1e: 84 30 cpi r24, 0x04 ; 4 29e20: 08 f0 brcs .+2 ; 0x29e24 29e22: 82 c0 rjmp .+260 ; 0x29f28 29e24: 82 30 cpi r24, 0x02 ; 2 29e26: 08 f0 brcs .+2 ; 0x29e2a 29e28: 1d c1 rjmp .+570 ; 0x2a064 29e2a: 88 23 and r24, r24 29e2c: 09 f4 brne .+2 ; 0x29e30 29e2e: f4 c0 rjmp .+488 ; 0x2a018 29e30: 81 30 cpi r24, 0x01 ; 1 29e32: 09 f4 brne .+2 ; 0x29e36 29e34: 94 c0 rjmp .+296 ; 0x29f5e // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 29e36: 0e 94 85 81 call 0x1030a ; 0x1030a } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 29e3a: 80 91 2f 06 lds r24, 0x062F ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x10> 29e3e: 88 23 and r24, r24 29e40: 09 f4 brne .+2 ; 0x29e44 29e42: 48 c0 rjmp .+144 ; 0x29ed4 uint8_t counter = log_buf.entry.counter; 29e44: 80 91 24 06 lds r24, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x5> if (counter == log_buf.serial) return; 29e48: 70 90 2e 06 lds r7, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xf> 29e4c: 87 15 cp r24, r7 29e4e: 09 f4 brne .+2 ; 0x29e52 29e50: 41 c0 rjmp .+130 ; 0x29ed4 // 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; 29e52: ce 01 movw r24, r28 29e54: 01 96 adiw r24, 0x01 ; 1 29e56: 0f 94 d6 47 call 0x28fac ; 0x28fac delta_ms = log_buf.entry.delta_ms; 29e5a: 00 91 23 06 lds r16, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x4> counter = log_buf.entry.counter; 29e5e: 10 91 24 06 lds r17, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x5> cur_pwm = log_buf.entry.cur_pwm; 29e62: 60 90 25 06 lds r6, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x6> cur_temp = log_buf.entry.cur_temp; 29e66: c0 90 26 06 lds r12, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x7> 29e6a: d0 90 27 06 lds r13, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x8> 29e6e: e0 90 28 06 lds r14, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x9> 29e72: f0 90 29 06 lds r15, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xa> cur_amb = log_buf.entry.cur_amb; 29e76: 80 90 2a 06 lds r8, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xb> 29e7a: 90 90 2b 06 lds r9, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xc> 29e7e: a0 90 2c 06 lds r10, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xd> 29e82: b0 90 2d 06 lds r11, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.558+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; 29e86: ce 01 movw r24, r28 29e88: 01 96 adiw r24, 0x01 ; 1 29e8a: 0f 94 c9 47 call 0x28f92 ; 0x28f92 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; 29e8e: 10 93 2e 06 sts 0x062E, r17 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xf> printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 29e92: bf 92 push r11 29e94: af 92 push r10 29e96: 9f 92 push r9 29e98: 8f 92 push r8 29e9a: ff 92 push r15 29e9c: ef 92 push r14 29e9e: df 92 push r13 29ea0: cf 92 push r12 29ea2: 1f 92 push r1 29ea4: 6f 92 push r6 29ea6: 80 2f mov r24, r16 29ea8: 00 0f add r16, r16 29eaa: 99 0b sbc r25, r25 29eac: 01 96 adiw r24, 0x01 ; 1 29eae: 9f 93 push r25 29eb0: 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; 29eb2: 81 2f mov r24, r17 29eb4: 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, 29eb6: 81 50 subi r24, 0x01 ; 1 29eb8: 99 0b sbc r25, r25 29eba: 9f 93 push r25 29ebc: 8f 93 push r24 29ebe: 81 ed ldi r24, 0xD1 ; 209 29ec0: 9b e9 ldi r25, 0x9B ; 155 29ec2: 9f 93 push r25 29ec4: 8f 93 push r24 29ec6: 0f 94 4b dc call 0x3b896 ; 0x3b896 29eca: 0f b6 in r0, 0x3f ; 63 29ecc: f8 94 cli 29ece: de bf out 0x3e, r29 ; 62 29ed0: 0f be out 0x3f, r0 ; 63 29ed2: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 29ed4: 0f 90 pop r0 29ed6: df 91 pop r29 29ed8: cf 91 pop r28 29eda: 1f 91 pop r17 29edc: 0f 91 pop r16 29ede: ff 90 pop r15 29ee0: ef 90 pop r14 29ee2: df 90 pop r13 29ee4: cf 90 pop r12 29ee6: bf 90 pop r11 29ee8: af 90 pop r10 29eea: 9f 90 pop r9 29eec: 8f 90 pop r8 29eee: 7f 90 pop r7 29ef0: 6f 90 pop r6 29ef2: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 29ef4: 88 23 and r24, r24 29ef6: 09 f4 brne .+2 ; 0x29efa 29ef8: 89 cf rjmp .-238 ; 0x29e0c 29efa: 84 e0 ldi r24, 0x04 ; 4 29efc: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 29f00: 85 cf rjmp .-246 ; 0x29e0c } } else { // warning cleared, reset state warning_state.warning = false; 29f02: 90 91 34 06 lds r25, 0x0634 ; 0x800634 29f06: 9e 7f andi r25, 0xFE ; 254 29f08: 90 93 34 06 sts 0x0634, r25 ; 0x800634 if(warn_beep) WRITE(BEEPER, LOW); 29f0c: 88 23 and r24, r24 29f0e: 41 f0 breq .+16 ; 0x29f20 29f10: 9f b7 in r25, 0x3f ; 63 29f12: f8 94 cli 29f14: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f18: 8b 7f andi r24, 0xFB ; 251 29f1a: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f1e: 9f bf out 0x3f, r25 ; 63 first = true; 29f20: 81 e0 ldi r24, 0x01 ; 1 29f22: 80 93 7b 02 sts 0x027B, r24 ; 0x80027b 29f26: 72 cf rjmp .-284 ; 0x29e0c #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29f28: 84 30 cpi r24, 0x04 ; 4 29f2a: 09 f0 breq .+2 ; 0x29f2e 29f2c: 84 cf rjmp .-248 ; 0x29e36 #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 29f2e: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29f32: 81 ff sbrs r24, 1 29f34: b4 c0 rjmp .+360 ; 0x2a09e if(IsStopped() == false) { 29f36: 80 91 12 05 lds r24, 0x0512 ; 0x800512 29f3a: 81 11 cpse r24, r1 29f3c: 04 c0 rjmp .+8 ; 0x29f46 SERIAL_ECHOLNPGM("TM: error triggered!"); 29f3e: 89 e3 ldi r24, 0x39 ; 57 29f40: 9c e9 ldi r25, 0x9C ; 156 29f42: 0e 94 fe 7a call 0xf5fc ; 0xf5fc } ThermalStop(true); 29f46: 81 e0 ldi r24, 0x01 ; 1 29f48: 0e 94 2f 7b call 0xf65e ; 0xf65e WRITE(BEEPER, HIGH); 29f4c: 9f b7 in r25, 0x3f ; 63 29f4e: f8 94 cli 29f50: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f54: 84 60 ori r24, 0x04 ; 4 29f56: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f5a: 9f bf out 0x3f, r25 ; 63 29f5c: 6c cf rjmp .-296 ; 0x29e36 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 29f5e: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29f62: 86 95 lsr r24 29f64: 86 95 lsr r24 29f66: 83 70 andi r24, 0x03 ; 3 29f68: 81 30 cpi r24, 0x01 ; 1 29f6a: d9 f1 breq .+118 ; 0x29fe2 29f6c: 58 f0 brcs .+22 ; 0x29f84 29f6e: 82 30 cpi r24, 0x02 ; 2 29f70: 09 f0 breq .+2 ; 0x29f74 29f72: 61 cf rjmp .-318 ; 0x29e36 } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 29f74: 80 91 12 05 lds r24, 0x0512 ; 0x800512 29f78: 81 11 cpse r24, r1 29f7a: 14 c0 rjmp .+40 ; 0x29fa4 temp_error_messagepgm(PSTR("MINTEMP AMB")); 29f7c: 61 e0 ldi r22, 0x01 ; 1 29f7e: 8b ef ldi r24, 0xFB ; 251 29f80: 9b e9 ldi r25, 0x9B ; 155 29f82: 0e c0 rjmp .+28 ; 0x29fa0 // 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) { 29f84: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29f88: 81 ff sbrs r24, 1 29f8a: 10 c0 rjmp .+32 ; 0x29fac min_temp_error(temp_error_state.index); 29f8c: 60 91 1c 05 lds r22, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29f90: 62 95 swap r22 29f92: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 29f94: 80 91 12 05 lds r24, 0x0512 ; 0x800512 29f98: 81 11 cpse r24, r1 29f9a: 04 c0 rjmp .+8 ; 0x29fa4 temp_error_messagepgm(err, e); 29f9c: 87 ee ldi r24, 0xE7 ; 231 29f9e: 9b e9 ldi r25, 0x9B ; 155 29fa0: 0f 94 34 42 call 0x28468 ; 0x28468 prusa_statistics(92); } ThermalStop(); 29fa4: 80 e0 ldi r24, 0x00 ; 0 29fa6: 0e 94 2f 7b call 0xf65e ; 0xf65e 29faa: 45 cf rjmp .-374 ; 0x29e36 // 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); 29fac: 60 91 9b 04 lds r22, 0x049B ; 0x80049b <_ZL8minttemp.lto_priv.476> 29fb0: 70 91 9c 04 lds r23, 0x049C ; 0x80049c <_ZL8minttemp.lto_priv.476+0x1> 29fb4: 6b 5f subi r22, 0xFB ; 251 29fb6: 7f 4f sbci r23, 0xFF ; 255 29fb8: 07 2e mov r0, r23 29fba: 00 0c add r0, r0 29fbc: 88 0b sbc r24, r24 29fbe: 99 0b sbc r25, r25 29fc0: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 29fc4: 8b 01 movw r16, r22 29fc6: 9c 01 movw r18, r24 29fc8: 40 91 5f 0e lds r20, 0x0E5F ; 0x800e5f 29fcc: 50 91 60 0e lds r21, 0x0E60 ; 0x800e60 29fd0: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 29fd4: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 29fd8: 87 e7 ldi r24, 0x77 ; 119 29fda: 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); 29fdc: 0f 94 30 32 call 0x26460 ; 0x26460 29fe0: 2a cf rjmp .-428 ; 0x29e36 // 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) { 29fe2: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 29fe6: 81 ff sbrs r24, 1 29fe8: 08 c0 rjmp .+16 ; 0x29ffa ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 29fea: 80 91 12 05 lds r24, 0x0512 ; 0x800512 29fee: 81 11 cpse r24, r1 29ff0: d9 cf rjmp .-78 ; 0x29fa4 temp_error_messagepgm(err); 29ff2: 61 e0 ldi r22, 0x01 ; 1 29ff4: 8f ee ldi r24, 0xEF ; 239 29ff6: 9b e9 ldi r25, 0x9B ; 155 29ff8: d3 cf rjmp .-90 ; 0x29fa0 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); 29ffa: 40 91 ef 04 lds r20, 0x04EF ; 0x8004ef 29ffe: 50 91 f0 04 lds r21, 0x04F0 ; 0x8004f0 2a002: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 2a006: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 2a00a: 00 e0 ldi r16, 0x00 ; 0 2a00c: 10 e0 ldi r17, 0x00 ; 0 2a00e: 20 e7 ldi r18, 0x70 ; 112 2a010: 31 e4 ldi r19, 0x41 ; 65 2a012: 83 e7 ldi r24, 0x73 ; 115 2a014: 92 e0 ldi r25, 0x02 ; 2 2a016: e2 cf rjmp .-60 ; 0x29fdc break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 2a018: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 2a01c: 86 95 lsr r24 2a01e: 86 95 lsr r24 2a020: 83 70 andi r24, 0x03 ; 3 2a022: 81 30 cpi r24, 0x01 ; 1 2a024: b9 f0 breq .+46 ; 0x2a054 2a026: 58 f0 brcs .+22 ; 0x2a03e 2a028: 82 30 cpi r24, 0x02 ; 2 2a02a: 09 f0 breq .+2 ; 0x2a02e 2a02c: 04 cf rjmp .-504 ; 0x29e36 } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 2a02e: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2a032: 81 11 cpse r24, r1 2a034: b7 cf rjmp .-146 ; 0x29fa4 temp_error_messagepgm(PSTR("MAXTEMP AMB")); 2a036: 61 e0 ldi r22, 0x01 ; 1 2a038: 8b e1 ldi r24, 0x1B ; 27 2a03a: 9c e9 ldi r25, 0x9C ; 156 2a03c: b1 cf rjmp .-158 ; 0x29fa0 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 2a03e: 60 91 1c 05 lds r22, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 2a042: 62 95 swap r22 2a044: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 2a046: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2a04a: 81 11 cpse r24, r1 2a04c: ab cf rjmp .-170 ; 0x29fa4 temp_error_messagepgm(PSTR("MAXTEMP"), e); 2a04e: 87 e0 ldi r24, 0x07 ; 7 2a050: 9c e9 ldi r25, 0x9C ; 156 2a052: a6 cf rjmp .-180 ; 0x29fa0 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 2a054: 80 91 12 05 lds r24, 0x0512 ; 0x800512 2a058: 81 11 cpse r24, r1 2a05a: a4 cf rjmp .-184 ; 0x29fa4 temp_error_messagepgm(PSTR("MAXTEMP BED")); 2a05c: 61 e0 ldi r22, 0x01 ; 1 2a05e: 8f e0 ldi r24, 0x0F ; 15 2a060: 9c e9 ldi r25, 0x9C ; 156 2a062: 9e cf rjmp .-196 ; 0x29fa0 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 2a064: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 2a068: 86 95 lsr r24 2a06a: 86 95 lsr r24 2a06c: 83 70 andi r24, 0x03 ; 3 2a06e: 82 30 cpi r24, 0x02 ; 2 2a070: 08 f0 brcs .+2 ; 0x2a074 2a072: e1 ce rjmp .-574 ; 0x29e36 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 2a074: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 2a078: 86 95 lsr r24 2a07a: 86 95 lsr r24 2a07c: 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), 2a07e: 90 91 1c 05 lds r25, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 2a082: 92 95 swap r25 2a084: 96 95 lsr r25 2a086: 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( 2a088: 61 e0 ldi r22, 0x01 ; 1 2a08a: 81 30 cpi r24, 0x01 ; 1 2a08c: 09 f0 breq .+2 ; 0x2a090 2a08e: 60 e0 ldi r22, 0x00 ; 0 2a090: 81 e0 ldi r24, 0x01 ; 1 2a092: 92 30 cpi r25, 0x02 ; 2 2a094: 09 f0 breq .+2 ; 0x2a098 2a096: 80 e0 ldi r24, 0x00 ; 0 2a098: 0f 94 69 32 call 0x264d2 ; 0x264d2 2a09c: cc ce rjmp .-616 ; 0x29e36 SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 2a09e: 10 92 1c 05 sts 0x051C, r1 ; 0x80051c <_ZL16temp_error_state.lto_priv.469> WRITE(BEEPER, LOW); 2a0a2: 9f b7 in r25, 0x3f ; 63 2a0a4: f8 94 cli 2a0a6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a0aa: 8b 7f andi r24, 0xFB ; 251 2a0ac: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a0b0: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 2a0b2: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 2a0b6: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a 2a0ba: 89 2b or r24, r25 2a0bc: 39 f4 brne .+14 ; 0x2a0cc target_temperature_bed = saved_bed_temperature; 2a0be: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad 2a0c2: 90 e0 ldi r25, 0x00 ; 0 2a0c4: 90 93 6a 0e sts 0x0E6A, r25 ; 0x800e6a 2a0c8: 80 93 69 0e sts 0x0E69, r24 ; 0x800e69 SERIAL_ECHOLNPGM("TM: error cleared"); 2a0cc: 87 e2 ldi r24, 0x27 ; 39 2a0ce: 9c e9 ldi r25, 0x9C ; 156 2a0d0: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 2a0d4: b0 ce rjmp .-672 ; 0x29e36 0002a0d6 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 2a0d6: 4f 92 push r4 2a0d8: 5f 92 push r5 2a0da: 6f 92 push r6 2a0dc: 7f 92 push r7 2a0de: 8f 92 push r8 2a0e0: 9f 92 push r9 2a0e2: af 92 push r10 2a0e4: bf 92 push r11 2a0e6: cf 92 push r12 2a0e8: df 92 push r13 2a0ea: ef 92 push r14 2a0ec: ff 92 push r15 2a0ee: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 2a0f0: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a0f4: 28 ee ldi r18, 0xE8 ; 232 2a0f6: 33 e0 ldi r19, 0x03 ; 3 2a0f8: 40 e0 ldi r20, 0x00 ; 0 2a0fa: 50 e0 ldi r21, 0x00 ; 0 2a0fc: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 2a100: 29 01 movw r4, r18 2a102: 3a 01 movw r6, r20 lcd_consume_click(); 2a104: 0e 94 a5 71 call 0xe34a ; 0xe34a KEEPALIVE_STATE(PAUSED_FOR_USER); 2a108: 84 e0 ldi r24, 0x04 ; 4 2a10a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 2a10e: f1 2c mov r15, r1 2a110: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 2a112: 0f 94 98 4e call 0x29d30 ; 0x29d30 manage_inactivity(true); 2a116: 81 e0 ldi r24, 0x01 ; 1 2a118: 0e 94 da 8b call 0x117b4 ; 0x117b4 bDelayed = ((_millis()/1000-nTime0) > nDelay); 2a11c: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a120: 28 ee ldi r18, 0xE8 ; 232 2a122: 33 e0 ldi r19, 0x03 ; 3 2a124: 40 e0 ldi r20, 0x00 ; 0 2a126: 50 e0 ldi r21, 0x00 ; 0 2a128: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 2a12c: 49 01 movw r8, r18 2a12e: 5a 01 movw r10, r20 2a130: 84 18 sub r8, r4 2a132: 95 08 sbc r9, r5 2a134: a6 08 sbc r10, r6 2a136: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 2a138: 0e 94 aa 71 call 0xe354 ; 0xe354 2a13c: 81 11 cpse r24, r1 2a13e: 07 c0 rjmp .+14 ; 0x2a14e 2a140: c8 14 cp r12, r8 2a142: d9 04 cpc r13, r9 2a144: ea 04 cpc r14, r10 2a146: fb 04 cpc r15, r11 2a148: 20 f7 brcc .-56 ; 0x2a112 2a14a: 81 e0 ldi r24, 0x01 ; 1 2a14c: 07 c0 rjmp .+14 ; 0x2a15c 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 2a14e: 81 e0 ldi r24, 0x01 ; 1 2a150: c8 14 cp r12, r8 2a152: d9 04 cpc r13, r9 2a154: ea 04 cpc r14, r10 2a156: fb 04 cpc r15, r11 2a158: 08 f0 brcs .+2 ; 0x2a15c 2a15a: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 2a15c: 92 e0 ldi r25, 0x02 ; 2 2a15e: 90 93 96 02 sts 0x0296, r25 ; 0x800296 return(!bDelayed); } } } 2a162: 91 e0 ldi r25, 0x01 ; 1 2a164: 89 27 eor r24, r25 2a166: ff 90 pop r15 2a168: ef 90 pop r14 2a16a: df 90 pop r13 2a16c: cf 90 pop r12 2a16e: bf 90 pop r11 2a170: af 90 pop r10 2a172: 9f 90 pop r9 2a174: 8f 90 pop r8 2a176: 7f 90 pop r7 2a178: 6f 90 pop r6 2a17a: 5f 90 pop r5 2a17c: 4f 90 pop r4 2a17e: 08 95 ret 0002a180 : #endif } static void waiting_handler() { manage_heater(); 2a180: 0f 94 98 4e call 0x29d30 ; 0x29d30 host_keepalive(); 2a184: 0e 94 2a 81 call 0x10254 ; 0x10254 host_autoreport(); 2a188: 0e 94 db 7a call 0xf5b6 ; 0xf5b6 checkFans(); 2a18c: 0e 94 85 81 call 0x1030a ; 0x1030a lcd_update(0); 2a190: 80 e0 ldi r24, 0x00 ; 0 2a192: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 0002a196 : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 2a196: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 2a19a: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 2a19e: 65 50 subi r22, 0x05 ; 5 2a1a0: 71 09 sbc r23, r1 2a1a2: 07 2e mov r0, r23 2a1a4: 00 0c add r0, r0 2a1a6: 88 0b sbc r24, r24 2a1a8: 99 0b sbc r25, r25 2a1aa: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 2a1ae: 9b 01 movw r18, r22 2a1b0: ac 01 movw r20, r24 2a1b2: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 2a1b6: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 2a1ba: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 2a1be: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 2a1c2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 2a1c6: 87 ff sbrs r24, 7 2a1c8: 07 c0 rjmp .+14 ; 0x2a1d8 if(temp_error_state.v) break; 2a1ca: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 2a1ce: 81 11 cpse r24, r1 2a1d0: 03 c0 rjmp .+6 ; 0x2a1d8 waiting_handler(); 2a1d2: 0f 94 c0 50 call 0x2a180 ; 0x2a180 2a1d6: df cf rjmp .-66 ; 0x2a196 } } 2a1d8: 08 95 ret 0002a1da : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 2a1da: cf 92 push r12 2a1dc: df 92 push r13 2a1de: ef 92 push r14 2a1e0: ff 92 push r15 2a1e2: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 2a1e4: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a1e8: 9b 01 movw r18, r22 2a1ea: ac 01 movw r20, r24 2a1ec: 2e 0d add r18, r14 2a1ee: 3f 1d adc r19, r15 2a1f0: 41 1d adc r20, r1 2a1f2: 51 1d adc r21, r1 2a1f4: 69 01 movw r12, r18 2a1f6: 7a 01 movw r14, r20 while(_millis() < mark) { 2a1f8: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a1fc: 6c 15 cp r22, r12 2a1fe: 7d 05 cpc r23, r13 2a200: 8e 05 cpc r24, r14 2a202: 9f 05 cpc r25, r15 2a204: 38 f4 brcc .+14 ; 0x2a214 if(temp_error_state.v) break; 2a206: 80 91 1c 05 lds r24, 0x051C ; 0x80051c <_ZL16temp_error_state.lto_priv.469> 2a20a: 81 11 cpse r24, r1 2a20c: 03 c0 rjmp .+6 ; 0x2a214 waiting_handler(); 2a20e: 0f 94 c0 50 call 0x2a180 ; 0x2a180 2a212: f2 cf rjmp .-28 ; 0x2a1f8 } } 2a214: ff 90 pop r15 2a216: ef 90 pop r14 2a218: df 90 pop r13 2a21a: cf 90 pop r12 2a21c: 08 95 ret 0002a21e : 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; 2a21e: 20 91 d8 06 lds r18, 0x06D8 ; 0x8006d8 2a222: 30 91 d9 06 lds r19, 0x06D9 ; 0x8006d9 2a226: 40 91 da 06 lds r20, 0x06DA ; 0x8006da 2a22a: 50 91 db 06 lds r21, 0x06DB ; 0x8006db 2a22e: 60 e0 ldi r22, 0x00 ; 0 2a230: 70 e0 ldi r23, 0x00 ; 0 2a232: 8f e7 ldi r24, 0x7F ; 127 2a234: 93 e4 ldi r25, 0x43 ; 67 2a236: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2a23a: 60 93 a7 04 sts 0x04A7, r22 ; 0x8004a7 <_ZL14iState_sum_max.lto_priv.484> 2a23e: 70 93 a8 04 sts 0x04A8, r23 ; 0x8004a8 <_ZL14iState_sum_max.lto_priv.484+0x1> 2a242: 80 93 a9 04 sts 0x04A9, r24 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.484+0x2> 2a246: 90 93 aa 04 sts 0x04AA, r25 ; 0x8004aa <_ZL14iState_sum_max.lto_priv.484+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 2a24a: 20 91 e4 06 lds r18, 0x06E4 ; 0x8006e4 2a24e: 30 91 e5 06 lds r19, 0x06E5 ; 0x8006e5 2a252: 40 91 e6 06 lds r20, 0x06E6 ; 0x8006e6 2a256: 50 91 e7 06 lds r21, 0x06E7 ; 0x8006e7 2a25a: 60 e0 ldi r22, 0x00 ; 0 2a25c: 70 e0 ldi r23, 0x00 ; 0 2a25e: 8f e7 ldi r24, 0x7F ; 127 2a260: 93 e4 ldi r25, 0x43 ; 67 2a262: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2a266: 60 93 9f 04 sts 0x049F, r22 ; 0x80049f <_ZL19temp_iState_max_bed.lto_priv.482> 2a26a: 70 93 a0 04 sts 0x04A0, r23 ; 0x8004a0 <_ZL19temp_iState_max_bed.lto_priv.482+0x1> 2a26e: 80 93 a1 04 sts 0x04A1, r24 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.482+0x2> 2a272: 90 93 a2 04 sts 0x04A2, r25 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.482+0x3> #endif } 2a276: 08 95 ret 0002a278 : #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) { 2a278: 2f 92 push r2 2a27a: 3f 92 push r3 2a27c: 4f 92 push r4 2a27e: 5f 92 push r5 2a280: 6f 92 push r6 2a282: 7f 92 push r7 2a284: 8f 92 push r8 2a286: 9f 92 push r9 2a288: af 92 push r10 2a28a: bf 92 push r11 2a28c: cf 92 push r12 2a28e: df 92 push r13 2a290: ef 92 push r14 2a292: ff 92 push r15 2a294: 0f 93 push r16 2a296: 1f 93 push r17 2a298: cf 93 push r28 2a29a: df 93 push r29 2a29c: cd b7 in r28, 0x3d ; 61 2a29e: de b7 in r29, 0x3e ; 62 2a2a0: e0 97 sbiw r28, 0x30 ; 48 2a2a2: 0f b6 in r0, 0x3f ; 63 2a2a4: f8 94 cli 2a2a6: de bf out 0x3e, r29 ; 62 2a2a8: 0f be out 0x3f, r0 ; 63 2a2aa: cd bf out 0x3d, r28 ; 61 2a2ac: 6a 87 std Y+10, r22 ; 0x0a 2a2ae: 7b 87 std Y+11, r23 ; 0x0b 2a2b0: 8c 87 std Y+12, r24 ; 0x0c 2a2b2: 9d 87 std Y+13, r25 ; 0x0d 2a2b4: 1a 01 movw r2, r20 2a2b6: 3a a7 std Y+42, r19 ; 0x2a 2a2b8: 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(); 2a2ba: 0f 94 4f 45 call 0x28a9e ; 0x28a9e pid_tuning_finished = false; 2a2be: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> // 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; 2a2c2: 29 a5 ldd r18, Y+41 ; 0x29 2a2c4: 3a a5 ldd r19, Y+42 ; 0x2a 2a2c6: 30 93 43 06 sts 0x0643, r19 ; 0x800643 2a2ca: 20 93 42 06 sts 0x0642, r18 ; 0x800642 float input = 0.0; pid_cycle=0; 2a2ce: 10 92 45 06 sts 0x0645, r1 ; 0x800645 2a2d2: 10 92 44 06 sts 0x0644, r1 ; 0x800644 bool heating = true; unsigned long temp_millis = _millis(); 2a2d6: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a2da: 6e 83 std Y+6, r22 ; 0x06 2a2dc: 7f 83 std Y+7, r23 ; 0x07 2a2de: 88 87 std Y+8, r24 ; 0x08 2a2e0: 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 2a2e2: 37 fe sbrs r3, 7 2a2e4: ff c0 rjmp .+510 ; 0x2a4e4 2a2e6: 3d e2 ldi r19, 0x2D ; 45 2a2e8: 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(); 2a2ea: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a2ee: 6c a3 std Y+36, r22 ; 0x24 2a2f0: 7d a3 std Y+37, r23 ; 0x25 2a2f2: 8e a3 std Y+38, r24 ; 0x26 2a2f4: 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."); 2a2f6: 87 ea ldi r24, 0xA7 ; 167 2a2f8: 9b e9 ldi r25, 0x9B ; 155 #if (defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1) unsigned long extruder_autofan_last_check = _millis(); #endif if ((extruder >= EXTRUDERS) 2a2fa: 12 14 cp r1, r2 2a2fc: 13 04 cpc r1, r3 2a2fe: 0c f4 brge .+2 ; 0x2a302 2a300: 8a c2 rjmp .+1300 ; 0x2a816 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 2a302: 84 e9 ldi r24, 0x94 ; 148 2a304: 9b e9 ldi r25, 0x9B ; 155 2a306: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 2a30a: 6a 85 ldd r22, Y+10 ; 0x0a 2a30c: 7b 85 ldd r23, Y+11 ; 0x0b 2a30e: 8c 85 ldd r24, Y+12 ; 0x0c 2a310: 9d 85 ldd r25, Y+13 ; 0x0d 2a312: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 2a316: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 2a318: 21 14 cp r2, r1 2a31a: 31 04 cpc r3, r1 2a31c: 09 f4 brne .+2 ; 0x2a320 2a31e: e5 c0 rjmp .+458 ; 0x2a4ea { soft_pwm_bed = (MAX_BED_POWER)/2; 2a320: 20 93 18 06 sts 0x0618, r18 ; 0x800618 bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 2a324: 70 93 6a 0e sts 0x0E6A, r23 ; 0x800e6a 2a328: 60 93 69 0e sts 0x0E69, r22 ; 0x800e69 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 2a32c: 8e 81 ldd r24, Y+6 ; 0x06 2a32e: 9f 81 ldd r25, Y+7 ; 0x07 2a330: a8 85 ldd r26, Y+8 ; 0x08 2a332: b9 85 ldd r27, Y+9 ; 0x09 2a334: 8e 87 std Y+14, r24 ; 0x0e 2a336: 9f 87 std Y+15, r25 ; 0x0f 2a338: a8 8b std Y+16, r26 ; 0x10 2a33a: b9 8b std Y+17, r27 ; 0x11 2a33c: 88 a3 std Y+32, r24 ; 0x20 2a33e: 99 a3 std Y+33, r25 ; 0x21 2a340: aa a3 std Y+34, r26 ; 0x22 2a342: bb a3 std Y+35, r27 ; 0x23 2a344: 1a 8a std Y+18, r1 ; 0x12 2a346: 90 e4 ldi r25, 0x40 ; 64 2a348: 9b 8b std Y+19, r25 ; 0x13 2a34a: ac e1 ldi r26, 0x1C ; 28 2a34c: ac 8b std Y+20, r26 ; 0x14 2a34e: b6 e4 ldi r27, 0x46 ; 70 2a350: bd 8b std Y+21, r27 ; 0x15 2a352: 1e 8a std Y+22, r1 ; 0x16 2a354: 1f 8a std Y+23, r1 ; 0x17 2a356: 18 8e std Y+24, r1 ; 0x18 2a358: 19 8e std Y+25, r1 ; 0x19 2a35a: 6f e7 ldi r22, 0x7F ; 127 2a35c: c6 2e mov r12, r22 2a35e: d1 2c mov r13, r1 2a360: e1 2c mov r14, r1 2a362: f1 2c mov r15, r1 2a364: 00 e0 ldi r16, 0x00 ; 0 2a366: 10 e0 ldi r17, 0x00 ; 0 2a368: 18 aa std Y+48, r1 ; 0x30 2a36a: 1f a6 std Y+47, r1 ; 0x2f 2a36c: 1d 82 std Y+5, r1 ; 0x05 2a36e: 2f e7 ldi r18, 0x7F ; 127 2a370: 30 e0 ldi r19, 0x00 ; 0 2a372: 40 e0 ldi r20, 0x00 ; 0 2a374: 50 e0 ldi r21, 0x00 ; 0 2a376: 29 83 std Y+1, r18 ; 0x01 2a378: 3a 83 std Y+2, r19 ; 0x02 2a37a: 4b 83 std Y+3, r20 ; 0x03 2a37c: 5c 83 std Y+4, r21 ; 0x04 2a37e: 1b 8e std Y+27, r1 ; 0x1b 2a380: 1c 8e std Y+28, r1 ; 0x1c 2a382: 1d 8e std Y+29, r1 ; 0x1d 2a384: 1e 8e std Y+30, r1 ; 0x1e 2a386: 31 e0 ldi r19, 0x01 ; 1 2a388: 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(); 2a38a: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2a38c: 40 91 fd 05 lds r20, 0x05FD ; 0x8005fd 2a390: 48 a7 std Y+40, r20 ; 0x28 2a392: 44 23 and r20, r20 2a394: 09 f4 brne .+2 ; 0x2a398 2a396: 2c c2 rjmp .+1112 ; 0x2a7f0 updateTemperatures(); 2a398: 0f 94 b9 48 call 0x29172 ; 0x29172 input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a39c: 21 14 cp r2, r1 2a39e: 31 04 cpc r3, r1 2a3a0: 09 f0 breq .+2 ; 0x2a3a4 2a3a2: aa c0 rjmp .+340 ; 0x2a4f8 2a3a4: 00 91 5f 0e lds r16, 0x0E5F ; 0x800e5f 2a3a8: 10 91 60 0e lds r17, 0x0E60 ; 0x800e60 2a3ac: 50 91 61 0e lds r21, 0x0E61 ; 0x800e61 2a3b0: 58 ab std Y+48, r21 ; 0x30 2a3b2: 80 91 62 0e lds r24, 0x0E62 ; 0x800e62 2a3b6: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2a3b8: 2e 89 ldd r18, Y+22 ; 0x16 2a3ba: 3f 89 ldd r19, Y+23 ; 0x17 2a3bc: 48 8d ldd r20, Y+24 ; 0x18 2a3be: 59 8d ldd r21, Y+25 ; 0x19 2a3c0: b8 01 movw r22, r16 2a3c2: 88 a9 ldd r24, Y+48 ; 0x30 2a3c4: 9f a5 ldd r25, Y+47 ; 0x2f 2a3c6: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 2a3ca: 87 fd sbrc r24, 7 2a3cc: 06 c0 rjmp .+12 ; 0x2a3da 2a3ce: 0e 8b std Y+22, r16 ; 0x16 2a3d0: 1f 8b std Y+23, r17 ; 0x17 2a3d2: b8 a9 ldd r27, Y+48 ; 0x30 2a3d4: b8 8f std Y+24, r27 ; 0x18 2a3d6: 2f a5 ldd r18, Y+47 ; 0x2f 2a3d8: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 2a3da: 2a 89 ldd r18, Y+18 ; 0x12 2a3dc: 3b 89 ldd r19, Y+19 ; 0x13 2a3de: 4c 89 ldd r20, Y+20 ; 0x14 2a3e0: 5d 89 ldd r21, Y+21 ; 0x15 2a3e2: b8 01 movw r22, r16 2a3e4: 88 a9 ldd r24, Y+48 ; 0x30 2a3e6: 9f a5 ldd r25, Y+47 ; 0x2f 2a3e8: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 2a3ec: 18 16 cp r1, r24 2a3ee: 34 f0 brlt .+12 ; 0x2a3fc 2a3f0: 0a 8b std Y+18, r16 ; 0x12 2a3f2: 1b 8b std Y+19, r17 ; 0x13 2a3f4: 38 a9 ldd r19, Y+48 ; 0x30 2a3f6: 3c 8b std Y+20, r19 ; 0x14 2a3f8: 4f a5 ldd r20, Y+47 ; 0x2f 2a3fa: 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) { 2a3fc: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a400: 2c a1 ldd r18, Y+36 ; 0x24 2a402: 3d a1 ldd r19, Y+37 ; 0x25 2a404: 4e a1 ldd r20, Y+38 ; 0x26 2a406: 5f a1 ldd r21, Y+39 ; 0x27 2a408: 62 1b sub r22, r18 2a40a: 73 0b sbc r23, r19 2a40c: 84 0b sbc r24, r20 2a40e: 95 0b sbc r25, r21 2a410: 65 3c cpi r22, 0xC5 ; 197 2a412: 79 40 sbci r23, 0x09 ; 9 2a414: 81 05 cpc r24, r1 2a416: 91 05 cpc r25, r1 2a418: 40 f0 brcs .+16 ; 0x2a42a checkExtruderAutoFans(); 2a41a: 0e 94 2a 77 call 0xee54 ; 0xee54 extruder_autofan_last_check = _millis(); 2a41e: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a422: 6c a3 std Y+36, r22 ; 0x24 2a424: 7d a3 std Y+37, r23 ; 0x25 2a426: 8e a3 std Y+38, r24 ; 0x26 2a428: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 2a42a: 4a 8d ldd r20, Y+26 ; 0x1a 2a42c: 44 23 and r20, r20 2a42e: 09 f4 brne .+2 ; 0x2a432 2a430: 4c c0 rjmp .+152 ; 0x2a4ca 2a432: 2a 85 ldd r18, Y+10 ; 0x0a 2a434: 3b 85 ldd r19, Y+11 ; 0x0b 2a436: 4c 85 ldd r20, Y+12 ; 0x0c 2a438: 5d 85 ldd r21, Y+13 ; 0x0d 2a43a: b8 01 movw r22, r16 2a43c: 88 a9 ldd r24, Y+48 ; 0x30 2a43e: 9f a5 ldd r25, Y+47 ; 0x2f 2a440: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 2a444: 18 16 cp r1, r24 2a446: 0c f0 brlt .+2 ; 0x2a44a 2a448: d3 c1 rjmp .+934 ; 0x2a7f0 if(_millis() - t2 > 5000) { 2a44a: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a44e: 2e 85 ldd r18, Y+14 ; 0x0e 2a450: 3f 85 ldd r19, Y+15 ; 0x0f 2a452: 48 89 ldd r20, Y+16 ; 0x10 2a454: 59 89 ldd r21, Y+17 ; 0x11 2a456: 62 1b sub r22, r18 2a458: 73 0b sbc r23, r19 2a45a: 84 0b sbc r24, r20 2a45c: 95 0b sbc r25, r21 2a45e: 69 38 cpi r22, 0x89 ; 137 2a460: 73 41 sbci r23, 0x13 ; 19 2a462: 81 05 cpc r24, r1 2a464: 91 05 cpc r25, r1 2a466: 08 f4 brcc .+2 ; 0x2a46a 2a468: c3 c1 rjmp .+902 ; 0x2a7f0 2a46a: d7 01 movw r26, r14 2a46c: c6 01 movw r24, r12 2a46e: 29 81 ldd r18, Y+1 ; 0x01 2a470: 3a 81 ldd r19, Y+2 ; 0x02 2a472: 4b 81 ldd r20, Y+3 ; 0x03 2a474: 5c 81 ldd r21, Y+4 ; 0x04 2a476: 82 1b sub r24, r18 2a478: 93 0b sbc r25, r19 2a47a: a4 0b sbc r26, r20 2a47c: b5 0b sbc r27, r21 2a47e: b5 95 asr r27 2a480: a7 95 ror r26 2a482: 97 95 ror r25 2a484: 87 95 ror r24 heating=false; if (extruder<0) { 2a486: 21 14 cp r2, r1 2a488: 31 04 cpc r3, r1 2a48a: 09 f4 brne .+2 ; 0x2a48e 2a48c: 40 c0 rjmp .+128 ; 0x2a50e soft_pwm_bed = (bias - d) >> 1; 2a48e: 80 93 18 06 sts 0x0618, r24 ; 0x800618 } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 2a492: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a496: 6e 83 std Y+6, r22 ; 0x06 2a498: 7f 83 std Y+7, r23 ; 0x07 2a49a: 88 87 std Y+8, r24 ; 0x08 2a49c: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 2a49e: dc 01 movw r26, r24 2a4a0: cb 01 movw r24, r22 2a4a2: 2e 85 ldd r18, Y+14 ; 0x0e 2a4a4: 3f 85 ldd r19, Y+15 ; 0x0f 2a4a6: 48 89 ldd r20, Y+16 ; 0x10 2a4a8: 59 89 ldd r21, Y+17 ; 0x11 2a4aa: 82 1b sub r24, r18 2a4ac: 93 0b sbc r25, r19 2a4ae: a4 0b sbc r26, r20 2a4b0: b5 0b sbc r27, r21 2a4b2: 8b 8f std Y+27, r24 ; 0x1b 2a4b4: 9c 8f std Y+28, r25 ; 0x1c 2a4b6: ad 8f std Y+29, r26 ; 0x1d 2a4b8: be 8f std Y+30, r27 ; 0x1e max=temp; 2a4ba: 3a 85 ldd r19, Y+10 ; 0x0a 2a4bc: 3e 8b std Y+22, r19 ; 0x16 2a4be: 4b 85 ldd r20, Y+11 ; 0x0b 2a4c0: 4f 8b std Y+23, r20 ; 0x17 2a4c2: 5c 85 ldd r21, Y+12 ; 0x0c 2a4c4: 58 8f std Y+24, r21 ; 0x18 2a4c6: 8d 85 ldd r24, Y+13 ; 0x0d 2a4c8: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 2a4ca: 2a 85 ldd r18, Y+10 ; 0x0a 2a4cc: 3b 85 ldd r19, Y+11 ; 0x0b 2a4ce: 4c 85 ldd r20, Y+12 ; 0x0c 2a4d0: 5d 85 ldd r21, Y+13 ; 0x0d 2a4d2: b8 01 movw r22, r16 2a4d4: 88 a9 ldd r24, Y+48 ; 0x30 2a4d6: 9f a5 ldd r25, Y+47 ; 0x2f 2a4d8: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 2a4dc: 87 fd sbrc r24, 7 2a4de: 1a c0 rjmp .+52 ; 0x2a514 if(_millis() - t1 > 5000) { 2a4e0: 1a 8e std Y+26, r1 ; 0x1a 2a4e2: 86 c1 rjmp .+780 ; 0x2a7f0 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 2a4e4: 4a e0 ldi r20, 0x0A ; 10 2a4e6: 4f 8f std Y+31, r20 ; 0x1f 2a4e8: 00 cf rjmp .-512 ; 0x2a2ea 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; 2a4ea: 20 93 17 05 sts 0x0517, r18 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 2a4ee: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 2a4f2: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b 2a4f6: 1a cf rjmp .-460 ; 0x2a32c wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a4f8: 00 91 ef 04 lds r16, 0x04EF ; 0x8004ef 2a4fc: 10 91 f0 04 lds r17, 0x04F0 ; 0x8004f0 2a500: 90 91 f1 04 lds r25, 0x04F1 ; 0x8004f1 2a504: 98 ab std Y+48, r25 ; 0x30 2a506: a0 91 f2 04 lds r26, 0x04F2 ; 0x8004f2 2a50a: af a7 std Y+47, r26 ; 0x2f 2a50c: 55 cf rjmp .-342 ; 0x2a3b8 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 2a50e: 80 93 17 05 sts 0x0517, r24 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 2a512: bf cf rjmp .-130 ; 0x2a492 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 2a514: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a518: 2e 81 ldd r18, Y+6 ; 0x06 2a51a: 3f 81 ldd r19, Y+7 ; 0x07 2a51c: 48 85 ldd r20, Y+8 ; 0x08 2a51e: 59 85 ldd r21, Y+9 ; 0x09 2a520: 62 1b sub r22, r18 2a522: 73 0b sbc r23, r19 2a524: 84 0b sbc r24, r20 2a526: 95 0b sbc r25, r21 2a528: 69 38 cpi r22, 0x89 ; 137 2a52a: 73 41 sbci r23, 0x13 ; 19 2a52c: 81 05 cpc r24, r1 2a52e: 91 05 cpc r25, r1 2a530: b8 f2 brcs .-82 ; 0x2a4e0 heating=true; t2=_millis(); 2a532: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a536: 6e 87 std Y+14, r22 ; 0x0e 2a538: 7f 87 std Y+15, r23 ; 0x0f 2a53a: 88 8b std Y+16, r24 ; 0x10 2a53c: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 2a53e: 80 91 44 06 lds r24, 0x0644 ; 0x800644 2a542: 90 91 45 06 lds r25, 0x0645 ; 0x800645 2a546: 18 16 cp r1, r24 2a548: 19 06 cpc r1, r25 2a54a: 0c f0 brlt .+2 ; 0x2a54e 2a54c: 2c c1 rjmp .+600 ; 0x2a7a6 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 2a54e: 8e 85 ldd r24, Y+14 ; 0x0e 2a550: 9f 85 ldd r25, Y+15 ; 0x0f 2a552: a8 89 ldd r26, Y+16 ; 0x10 2a554: b9 89 ldd r27, Y+17 ; 0x11 2a556: 2e 81 ldd r18, Y+6 ; 0x06 2a558: 3f 81 ldd r19, Y+7 ; 0x07 2a55a: 48 85 ldd r20, Y+8 ; 0x08 2a55c: 59 85 ldd r21, Y+9 ; 0x09 2a55e: 82 1b sub r24, r18 2a560: 93 0b sbc r25, r19 2a562: a4 0b sbc r26, r20 2a564: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 2a566: 4b 8c ldd r4, Y+27 ; 0x1b 2a568: 5c 8c ldd r5, Y+28 ; 0x1c 2a56a: 6d 8c ldd r6, Y+29 ; 0x1d 2a56c: 7e 8c ldd r7, Y+30 ; 0x1e 2a56e: 48 0e add r4, r24 2a570: 59 1e adc r5, r25 2a572: 6a 1e adc r6, r26 2a574: 7b 1e adc r7, r27 2a576: 2b 8d ldd r18, Y+27 ; 0x1b 2a578: 3c 8d ldd r19, Y+28 ; 0x1c 2a57a: 4d 8d ldd r20, Y+29 ; 0x1d 2a57c: 5e 8d ldd r21, Y+30 ; 0x1e 2a57e: 28 1b sub r18, r24 2a580: 39 0b sbc r19, r25 2a582: 4a 0b sbc r20, r26 2a584: 5b 0b sbc r21, r27 2a586: 69 81 ldd r22, Y+1 ; 0x01 2a588: 7a 81 ldd r23, Y+2 ; 0x02 2a58a: 8b 81 ldd r24, Y+3 ; 0x03 2a58c: 9c 81 ldd r25, Y+4 ; 0x04 2a58e: 0f 94 ec dd call 0x3bbd8 ; 0x3bbd8 <__mulsi3> 2a592: a3 01 movw r20, r6 2a594: 92 01 movw r18, r4 2a596: 0f 94 7a de call 0x3bcf4 ; 0x3bcf4 <__divmodsi4> 2a59a: da 01 movw r26, r20 2a59c: c9 01 movw r24, r18 2a59e: 8c 0d add r24, r12 2a5a0: 9d 1d adc r25, r13 2a5a2: ae 1d adc r26, r14 2a5a4: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 2a5a6: 84 31 cpi r24, 0x14 ; 20 2a5a8: 91 05 cpc r25, r1 2a5aa: a1 05 cpc r26, r1 2a5ac: b1 05 cpc r27, r1 2a5ae: 0c f4 brge .+2 ; 0x2a5b2 2a5b0: 3c c1 rjmp .+632 ; 0x2a82a 2a5b2: 6c 01 movw r12, r24 2a5b4: 7d 01 movw r14, r26 2a5b6: 3c ee ldi r19, 0xEC ; 236 2a5b8: c3 16 cp r12, r19 2a5ba: d1 04 cpc r13, r1 2a5bc: e1 04 cpc r14, r1 2a5be: f1 04 cpc r15, r1 2a5c0: 2c f0 brlt .+10 ; 0x2a5cc 2a5c2: 4b ee ldi r20, 0xEB ; 235 2a5c4: c4 2e mov r12, r20 2a5c6: d1 2c mov r13, r1 2a5c8: e1 2c mov r14, r1 2a5ca: 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; 2a5cc: 80 38 cpi r24, 0x80 ; 128 2a5ce: 91 05 cpc r25, r1 2a5d0: a1 05 cpc r26, r1 2a5d2: b1 05 cpc r27, r1 2a5d4: 0c f4 brge .+2 ; 0x2a5d8 2a5d6: 37 c1 rjmp .+622 ; 0x2a846 2a5d8: 8e ef ldi r24, 0xFE ; 254 2a5da: 90 e0 ldi r25, 0x00 ; 0 2a5dc: a0 e0 ldi r26, 0x00 ; 0 2a5de: b0 e0 ldi r27, 0x00 ; 0 2a5e0: 8c 19 sub r24, r12 2a5e2: 9d 09 sbc r25, r13 2a5e4: ae 09 sbc r26, r14 2a5e6: bf 09 sbc r27, r15 2a5e8: 89 83 std Y+1, r24 ; 0x01 2a5ea: 9a 83 std Y+2, r25 ; 0x02 2a5ec: ab 83 std Y+3, r26 ; 0x03 2a5ee: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 2a5f0: 8c e8 ldi r24, 0x8C ; 140 2a5f2: 9b e9 ldi r25, 0x9B ; 155 2a5f4: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a5f8: c7 01 movw r24, r14 2a5fa: b6 01 movw r22, r12 2a5fc: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 2a600: 87 e8 ldi r24, 0x87 ; 135 2a602: 9b e9 ldi r25, 0x9B ; 155 2a604: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a608: 69 81 ldd r22, Y+1 ; 0x01 2a60a: 7a 81 ldd r23, Y+2 ; 0x02 2a60c: 8b 81 ldd r24, Y+3 ; 0x03 2a60e: 9c 81 ldd r25, Y+4 ; 0x04 2a610: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 2a614: 80 e8 ldi r24, 0x80 ; 128 2a616: 9b e9 ldi r25, 0x9B ; 155 2a618: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2a61c: 42 e0 ldi r20, 0x02 ; 2 2a61e: 6a 89 ldd r22, Y+18 ; 0x12 2a620: 7b 89 ldd r23, Y+19 ; 0x13 2a622: 8c 89 ldd r24, Y+20 ; 0x14 2a624: 9d 89 ldd r25, Y+21 ; 0x15 2a626: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 2a62a: 89 e7 ldi r24, 0x79 ; 121 2a62c: 9b e9 ldi r25, 0x9B ; 155 2a62e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a632: 6e 89 ldd r22, Y+22 ; 0x16 2a634: 7f 89 ldd r23, Y+23 ; 0x17 2a636: 88 8d ldd r24, Y+24 ; 0x18 2a638: 99 8d ldd r25, Y+25 ; 0x19 2a63a: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 if(pid_cycle > 2) { 2a63e: 80 91 44 06 lds r24, 0x0644 ; 0x800644 2a642: 90 91 45 06 lds r25, 0x0645 ; 0x800645 2a646: 03 97 sbiw r24, 0x03 ; 3 2a648: 0c f4 brge .+2 ; 0x2a64c 2a64a: ad c0 rjmp .+346 ; 0x2a7a6 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 2a64c: 69 81 ldd r22, Y+1 ; 0x01 2a64e: 7a 81 ldd r23, Y+2 ; 0x02 2a650: 8b 81 ldd r24, Y+3 ; 0x03 2a652: 9c 81 ldd r25, Y+4 ; 0x04 2a654: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 2a658: 20 e0 ldi r18, 0x00 ; 0 2a65a: 30 e0 ldi r19, 0x00 ; 0 2a65c: 40 e8 ldi r20, 0x80 ; 128 2a65e: 50 e4 ldi r21, 0x40 ; 64 2a660: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2a664: 4b 01 movw r8, r22 2a666: 5c 01 movw r10, r24 2a668: 2a 89 ldd r18, Y+18 ; 0x12 2a66a: 3b 89 ldd r19, Y+19 ; 0x13 2a66c: 4c 89 ldd r20, Y+20 ; 0x14 2a66e: 5d 89 ldd r21, Y+21 ; 0x15 2a670: 6e 89 ldd r22, Y+22 ; 0x16 2a672: 7f 89 ldd r23, Y+23 ; 0x17 2a674: 88 8d ldd r24, Y+24 ; 0x18 2a676: 99 8d ldd r25, Y+25 ; 0x19 2a678: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 2a67c: 20 ed ldi r18, 0xD0 ; 208 2a67e: 3f e0 ldi r19, 0x0F ; 15 2a680: 49 e4 ldi r20, 0x49 ; 73 2a682: 50 e4 ldi r21, 0x40 ; 64 2a684: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2a688: 20 e0 ldi r18, 0x00 ; 0 2a68a: 30 e0 ldi r19, 0x00 ; 0 2a68c: 40 e0 ldi r20, 0x00 ; 0 2a68e: 5f e3 ldi r21, 0x3F ; 63 2a690: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2a694: 9b 01 movw r18, r22 2a696: ac 01 movw r20, r24 2a698: c5 01 movw r24, r10 2a69a: b4 01 movw r22, r8 2a69c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2a6a0: 4b 01 movw r8, r22 2a6a2: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 2a6a4: c3 01 movw r24, r6 2a6a6: b2 01 movw r22, r4 2a6a8: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 2a6ac: 20 e0 ldi r18, 0x00 ; 0 2a6ae: 30 e0 ldi r19, 0x00 ; 0 2a6b0: 4a e7 ldi r20, 0x7A ; 122 2a6b2: 54 e4 ldi r21, 0x44 ; 68 2a6b4: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2a6b8: 2b 01 movw r4, r22 2a6ba: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 2a6bc: 83 e7 ldi r24, 0x73 ; 115 2a6be: 9b e9 ldi r25, 0x9B ; 155 2a6c0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a6c4: 42 e0 ldi r20, 0x02 ; 2 2a6c6: c5 01 movw r24, r10 2a6c8: b4 01 movw r22, r8 2a6ca: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 2a6ce: 8d e6 ldi r24, 0x6D ; 109 2a6d0: 9b e9 ldi r25, 0x9B ; 155 2a6d2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a6d6: c3 01 movw r24, r6 2a6d8: b2 01 movw r22, r4 2a6da: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 _Kp = 0.6*Ku; 2a6de: 2a e9 ldi r18, 0x9A ; 154 2a6e0: 39 e9 ldi r19, 0x99 ; 153 2a6e2: 49 e1 ldi r20, 0x19 ; 25 2a6e4: 5f e3 ldi r21, 0x3F ; 63 2a6e6: c5 01 movw r24, r10 2a6e8: b4 01 movw r22, r8 2a6ea: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2a6ee: 4b 01 movw r8, r22 2a6f0: 5c 01 movw r10, r24 2a6f2: 80 92 ed 03 sts 0x03ED, r8 ; 0x8003ed <_Kp> 2a6f6: 90 92 ee 03 sts 0x03EE, r9 ; 0x8003ee <_Kp+0x1> 2a6fa: a0 92 ef 03 sts 0x03EF, r10 ; 0x8003ef <_Kp+0x2> 2a6fe: b0 92 f0 03 sts 0x03F0, r11 ; 0x8003f0 <_Kp+0x3> _Ki = 2*_Kp/Tu; 2a702: ac 01 movw r20, r24 2a704: 9b 01 movw r18, r22 2a706: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2a70a: a3 01 movw r20, r6 2a70c: 92 01 movw r18, r4 2a70e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2a712: 60 93 e9 03 sts 0x03E9, r22 ; 0x8003e9 <_Ki> 2a716: 70 93 ea 03 sts 0x03EA, r23 ; 0x8003ea <_Ki+0x1> 2a71a: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb <_Ki+0x2> 2a71e: 90 93 ec 03 sts 0x03EC, r25 ; 0x8003ec <_Ki+0x3> _Kd = _Kp*Tu/8; 2a722: a3 01 movw r20, r6 2a724: 92 01 movw r18, r4 2a726: c5 01 movw r24, r10 2a728: b4 01 movw r22, r8 2a72a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2a72e: 20 e0 ldi r18, 0x00 ; 0 2a730: 30 e0 ldi r19, 0x00 ; 0 2a732: 40 e0 ldi r20, 0x00 ; 0 2a734: 5e e3 ldi r21, 0x3E ; 62 2a736: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2a73a: 60 93 e5 03 sts 0x03E5, r22 ; 0x8003e5 <_Kd> 2a73e: 70 93 e6 03 sts 0x03E6, r23 ; 0x8003e6 <_Kd+0x1> 2a742: 80 93 e7 03 sts 0x03E7, r24 ; 0x8003e7 <_Kd+0x2> 2a746: 90 93 e8 03 sts 0x03E8, r25 ; 0x8003e8 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 2a74a: 8f e5 ldi r24, 0x5F ; 95 2a74c: 9b e9 ldi r25, 0x9B ; 155 2a74e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 2a752: 89 e5 ldi r24, 0x59 ; 89 2a754: 9b e9 ldi r25, 0x9B ; 155 2a756: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a75a: 60 91 ed 03 lds r22, 0x03ED ; 0x8003ed <_Kp> 2a75e: 70 91 ee 03 lds r23, 0x03EE ; 0x8003ee <_Kp+0x1> 2a762: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef <_Kp+0x2> 2a766: 90 91 f0 03 lds r25, 0x03F0 ; 0x8003f0 <_Kp+0x3> 2a76a: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 2a76e: 83 e5 ldi r24, 0x53 ; 83 2a770: 9b e9 ldi r25, 0x9B ; 155 2a772: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a776: 60 91 e9 03 lds r22, 0x03E9 ; 0x8003e9 <_Ki> 2a77a: 70 91 ea 03 lds r23, 0x03EA ; 0x8003ea <_Ki+0x1> 2a77e: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Ki+0x2> 2a782: 90 91 ec 03 lds r25, 0x03EC ; 0x8003ec <_Ki+0x3> 2a786: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 2a78a: 8d e4 ldi r24, 0x4D ; 77 2a78c: 9b e9 ldi r25, 0x9B ; 155 2a78e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a792: 60 91 e5 03 lds r22, 0x03E5 ; 0x8003e5 <_Kd> 2a796: 70 91 e6 03 lds r23, 0x03E6 ; 0x8003e6 <_Kd+0x1> 2a79a: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 <_Kd+0x2> 2a79e: 90 91 e8 03 lds r25, 0x03E8 ; 0x8003e8 <_Kd+0x3> 2a7a2: 0f 94 d0 76 call 0x2eda0 ; 0x2eda0 2a7a6: 89 81 ldd r24, Y+1 ; 0x01 2a7a8: 9a 81 ldd r25, Y+2 ; 0x02 2a7aa: ab 81 ldd r26, Y+3 ; 0x03 2a7ac: bc 81 ldd r27, Y+4 ; 0x04 2a7ae: 8c 0d add r24, r12 2a7b0: 9d 1d adc r25, r13 2a7b2: ae 1d adc r26, r14 2a7b4: bf 1d adc r27, r15 2a7b6: b5 95 asr r27 2a7b8: a7 95 ror r26 2a7ba: 97 95 ror r25 2a7bc: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 2a7be: 21 14 cp r2, r1 2a7c0: 31 04 cpc r3, r1 2a7c2: 09 f4 brne .+2 ; 0x2a7c6 2a7c4: 45 c0 rjmp .+138 ; 0x2a850 { soft_pwm_bed = (bias + d) >> 1; 2a7c6: 80 93 18 06 sts 0x0618, r24 ; 0x800618 } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 2a7ca: 80 91 44 06 lds r24, 0x0644 ; 0x800644 2a7ce: 90 91 45 06 lds r25, 0x0645 ; 0x800645 2a7d2: 01 96 adiw r24, 0x01 ; 1 2a7d4: 90 93 45 06 sts 0x0645, r25 ; 0x800645 2a7d8: 80 93 44 06 sts 0x0644, r24 ; 0x800644 min=temp; 2a7dc: 3a 85 ldd r19, Y+10 ; 0x0a 2a7de: 3a 8b std Y+18, r19 ; 0x12 2a7e0: 4b 85 ldd r20, Y+11 ; 0x0b 2a7e2: 4b 8b std Y+19, r20 ; 0x13 2a7e4: 5c 85 ldd r21, Y+12 ; 0x0c 2a7e6: 5c 8b std Y+20, r21 ; 0x14 2a7e8: 8d 85 ldd r24, Y+13 ; 0x0d 2a7ea: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 2a7ec: 98 a5 ldd r25, Y+40 ; 0x28 2a7ee: 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)) { 2a7f0: 20 e0 ldi r18, 0x00 ; 0 2a7f2: 30 e0 ldi r19, 0x00 ; 0 2a7f4: 40 ea ldi r20, 0xA0 ; 160 2a7f6: 51 e4 ldi r21, 0x41 ; 65 2a7f8: 6a 85 ldd r22, Y+10 ; 0x0a 2a7fa: 7b 85 ldd r23, Y+11 ; 0x0b 2a7fc: 8c 85 ldd r24, Y+12 ; 0x0c 2a7fe: 9d 85 ldd r25, Y+13 ; 0x0d 2a800: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2a804: 98 01 movw r18, r16 2a806: 48 a9 ldd r20, Y+48 ; 0x30 2a808: 5f a5 ldd r21, Y+47 ; 0x2f 2a80a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 2a80e: 87 ff sbrs r24, 7 2a810: 22 c0 rjmp .+68 ; 0x2a856 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 2a812: 83 e2 ldi r24, 0x23 ; 35 2a814: 9b e9 ldi r25, 0x9B ; 155 pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 2a816: 0e 94 fe 7a call 0xf5fc ; 0xf5fc pid_tuning_finished = true; 2a81a: 81 e0 ldi r24, 0x01 ; 1 2a81c: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> pid_cycle = 0; 2a820: 10 92 45 06 sts 0x0645, r1 ; 0x800645 2a824: 10 92 44 06 sts 0x0644, r1 ; 0x800644 2a828: 98 c0 rjmp .+304 ; 0x2a95a 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); 2a82a: 34 e1 ldi r19, 0x14 ; 20 2a82c: c3 2e mov r12, r19 2a82e: d1 2c mov r13, r1 2a830: e1 2c mov r14, r1 2a832: f1 2c mov r15, r1 2a834: 24 e1 ldi r18, 0x14 ; 20 2a836: 30 e0 ldi r19, 0x00 ; 0 2a838: 40 e0 ldi r20, 0x00 ; 0 2a83a: 50 e0 ldi r21, 0x00 ; 0 2a83c: 29 83 std Y+1, r18 ; 0x01 2a83e: 3a 83 std Y+2, r19 ; 0x02 2a840: 4b 83 std Y+3, r20 ; 0x03 2a842: 5c 83 std Y+4, r21 ; 0x04 2a844: d5 ce rjmp .-598 ; 0x2a5f0 2a846: c9 82 std Y+1, r12 ; 0x01 2a848: da 82 std Y+2, r13 ; 0x02 2a84a: eb 82 std Y+3, r14 ; 0x03 2a84c: fc 82 std Y+4, r15 ; 0x04 2a84e: d0 ce rjmp .-608 ; 0x2a5f0 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 2a850: 80 93 17 05 sts 0x0517, r24 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 2a854: ba cf rjmp .-140 ; 0x2a7ca SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 2a856: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a85a: 28 a1 ldd r18, Y+32 ; 0x20 2a85c: 39 a1 ldd r19, Y+33 ; 0x21 2a85e: 4a a1 ldd r20, Y+34 ; 0x22 2a860: 5b a1 ldd r21, Y+35 ; 0x23 2a862: 62 1b sub r22, r18 2a864: 73 0b sbc r23, r19 2a866: 84 0b sbc r24, r20 2a868: 95 0b sbc r25, r21 2a86a: 61 3d cpi r22, 0xD1 ; 209 2a86c: 77 40 sbci r23, 0x07 ; 7 2a86e: 81 05 cpc r24, r1 2a870: 91 05 cpc r25, r1 2a872: 58 f1 brcs .+86 ; 0x2a8ca int p; if (extruder<0){ p=soft_pwm_bed; 2a874: a0 90 18 06 lds r10, 0x0618 ; 0x800618 2a878: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 2a87a: 80 e2 ldi r24, 0x20 ; 32 2a87c: 9b e9 ldi r25, 0x9B ; 155 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 2a87e: 21 14 cp r2, r1 2a880: 31 04 cpc r3, r1 2a882: 29 f4 brne .+10 ; 0x2a88e p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 2a884: a0 90 17 05 lds r10, 0x0517 ; 0x800517 <_ZL8soft_pwm.lto_priv.474> 2a888: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 2a88a: 8d e1 ldi r24, 0x1D ; 29 2a88c: 9b e9 ldi r25, 0x9B ; 155 2a88e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2a892: 42 e0 ldi r20, 0x02 ; 2 2a894: b8 01 movw r22, r16 2a896: 88 a9 ldd r24, Y+48 ; 0x30 2a898: 9f a5 ldd r25, Y+47 ; 0x2f 2a89a: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 2a89e: 89 e1 ldi r24, 0x19 ; 25 2a8a0: 9b e9 ldi r25, 0x9B ; 155 2a8a2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_PROTOCOLLN(p); 2a8a6: c5 01 movw r24, r10 2a8a8: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 if (safety_check_cycles == 0) { //save ambient temp 2a8ac: 4d 81 ldd r20, Y+5 ; 0x05 2a8ae: 44 23 and r20, r20 2a8b0: 09 f4 brne .+2 ; 0x2a8b4 2a8b2: 6c c0 rjmp .+216 ; 0x2a98c temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 2a8b4: 5f 8d ldd r21, Y+31 ; 0x1f 2a8b6: 45 17 cp r20, r21 2a8b8: 70 f5 brcc .+92 ; 0x2a916 safety_check_cycles++; 2a8ba: 4f 5f subi r20, 0xFF ; 255 2a8bc: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 2a8be: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a8c2: 68 a3 std Y+32, r22 ; 0x20 2a8c4: 79 a3 std Y+33, r23 ; 0x21 2a8c6: 8a a3 std Y+34, r24 ; 0x22 2a8c8: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 2a8ca: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a8ce: 4b 01 movw r8, r22 2a8d0: 5c 01 movw r10, r24 2a8d2: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a8d6: 4e 80 ldd r4, Y+6 ; 0x06 2a8d8: 5f 80 ldd r5, Y+7 ; 0x07 2a8da: 68 84 ldd r6, Y+8 ; 0x08 2a8dc: 79 84 ldd r7, Y+9 ; 0x09 2a8de: 2e 85 ldd r18, Y+14 ; 0x0e 2a8e0: 3f 85 ldd r19, Y+15 ; 0x0f 2a8e2: 48 89 ldd r20, Y+16 ; 0x10 2a8e4: 59 89 ldd r21, Y+17 ; 0x11 2a8e6: 42 0e add r4, r18 2a8e8: 53 1e adc r5, r19 2a8ea: 64 1e adc r6, r20 2a8ec: 75 1e adc r7, r21 2a8ee: 84 18 sub r8, r4 2a8f0: 95 08 sbc r9, r5 2a8f2: a6 08 sbc r10, r6 2a8f4: b7 08 sbc r11, r7 2a8f6: 86 0e add r8, r22 2a8f8: 97 1e adc r9, r23 2a8fa: a8 1e adc r10, r24 2a8fc: b9 1e adc r11, r25 2a8fe: 31 e8 ldi r19, 0x81 ; 129 2a900: 83 16 cp r8, r19 2a902: 3f e4 ldi r19, 0x4F ; 79 2a904: 93 06 cpc r9, r19 2a906: 32 e1 ldi r19, 0x12 ; 18 2a908: a3 06 cpc r10, r19 2a90a: b1 04 cpc r11, r1 2a90c: 08 f4 brcc .+2 ; 0x2a910 2a90e: 47 c0 rjmp .+142 ; 0x2a99e SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 2a910: 8c ef ldi r24, 0xFC ; 252 2a912: 9a e9 ldi r25, 0x9A ; 154 2a914: 80 cf rjmp .-256 ; 0x2a816 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 2a916: 8d 81 ldd r24, Y+5 ; 0x05 2a918: 9f 8d ldd r25, Y+31 ; 0x1f 2a91a: 89 13 cpse r24, r25 2a91c: d0 cf rjmp .-96 ; 0x2a8be safety_check_cycles++; 2a91e: 8f 5f subi r24, 0xFF ; 255 2a920: 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) { 2a922: 2b a5 ldd r18, Y+43 ; 0x2b 2a924: 3c a5 ldd r19, Y+44 ; 0x2c 2a926: 4d a5 ldd r20, Y+45 ; 0x2d 2a928: 5e a5 ldd r21, Y+46 ; 0x2e 2a92a: b8 01 movw r22, r16 2a92c: 88 a9 ldd r24, Y+48 ; 0x30 2a92e: 9f a5 ldd r25, Y+47 ; 0x2f 2a930: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 2a934: 9f 77 andi r25, 0x7F ; 127 2a936: 20 e0 ldi r18, 0x00 ; 0 2a938: 30 e0 ldi r19, 0x00 ; 0 2a93a: 40 ea ldi r20, 0xA0 ; 160 2a93c: 50 e4 ldi r21, 0x40 ; 64 2a93e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 2a942: 87 ff sbrs r24, 7 2a944: bc cf rjmp .-136 ; 0x2a8be temp_runaway_stop(false, (extruder<0)); 2a946: 63 2d mov r22, r3 2a948: 66 1f adc r22, r22 2a94a: 66 27 eor r22, r22 2a94c: 66 1f adc r22, r22 2a94e: 80 e0 ldi r24, 0x00 ; 0 2a950: 0f 94 69 32 call 0x264d2 ; 0x264d2 pid_tuning_finished = true; 2a954: 81 e0 ldi r24, 0x01 ; 1 2a956: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> pid_cycle = 0; return; } lcd_update(0); } } 2a95a: e0 96 adiw r28, 0x30 ; 48 2a95c: 0f b6 in r0, 0x3f ; 63 2a95e: f8 94 cli 2a960: de bf out 0x3e, r29 ; 62 2a962: 0f be out 0x3f, r0 ; 63 2a964: cd bf out 0x3d, r28 ; 61 2a966: df 91 pop r29 2a968: cf 91 pop r28 2a96a: 1f 91 pop r17 2a96c: 0f 91 pop r16 2a96e: ff 90 pop r15 2a970: ef 90 pop r14 2a972: df 90 pop r13 2a974: cf 90 pop r12 2a976: bf 90 pop r11 2a978: af 90 pop r10 2a97a: 9f 90 pop r9 2a97c: 8f 90 pop r8 2a97e: 7f 90 pop r7 2a980: 6f 90 pop r6 2a982: 5f 90 pop r5 2a984: 4f 90 pop r4 2a986: 3f 90 pop r3 2a988: 2f 90 pop r2 2a98a: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 2a98c: 0b a7 std Y+43, r16 ; 0x2b 2a98e: 1c a7 std Y+44, r17 ; 0x2c 2a990: a8 a9 ldd r26, Y+48 ; 0x30 2a992: ad a7 std Y+45, r26 ; 0x2d 2a994: bf a5 ldd r27, Y+47 ; 0x2f 2a996: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 2a998: 21 e0 ldi r18, 0x01 ; 1 2a99a: 2d 83 std Y+5, r18 ; 0x05 2a99c: 90 cf rjmp .-224 ; 0x2a8be SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 2a99e: 80 91 44 06 lds r24, 0x0644 ; 0x800644 2a9a2: 90 91 45 06 lds r25, 0x0645 ; 0x800645 2a9a6: 49 a5 ldd r20, Y+41 ; 0x29 2a9a8: 5a a5 ldd r21, Y+42 ; 0x2a 2a9aa: 48 17 cp r20, r24 2a9ac: 59 07 cpc r21, r25 2a9ae: 1c f4 brge .+6 ; 0x2a9b6 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 2a9b0: 80 ea ldi r24, 0xA0 ; 160 2a9b2: 9a e9 ldi r25, 0x9A ; 154 2a9b4: 30 cf rjmp .-416 ; 0x2a816 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 2a9b6: 80 e0 ldi r24, 0x00 ; 0 2a9b8: 0e 94 54 6f call 0xdea8 ; 0xdea8 2a9bc: e6 cc rjmp .-1588 ; 0x2a38a 0002a9be : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 2a9be: 0f 93 push r16 2a9c0: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2a9c2: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 2a9c6: 81 30 cpi r24, 0x01 ; 1 2a9c8: 19 f5 brne .+70 ; 0x2aa10 2a9ca: 0f 94 83 3f call 0x27f06 ; 0x27f06 2a9ce: 00 91 a6 05 lds r16, 0x05A6 ; 0x8005a6 2a9d2: 10 91 a7 05 lds r17, 0x05A7 ; 0x8005a7 2a9d6: 20 91 a8 05 lds r18, 0x05A8 ; 0x8005a8 2a9da: 30 91 a9 05 lds r19, 0x05A9 ; 0x8005a9 2a9de: 60 1b sub r22, r16 2a9e0: 71 0b sbc r23, r17 2a9e2: 82 0b sbc r24, r18 2a9e4: 93 0b sbc r25, r19 2a9e6: 28 ee ldi r18, 0xE8 ; 232 2a9e8: 33 e0 ldi r19, 0x03 ; 3 2a9ea: 40 e0 ldi r20, 0x00 ; 0 2a9ec: 50 e0 ldi r21, 0x00 ; 0 2a9ee: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 2a9f2: 60 91 a2 05 lds r22, 0x05A2 ; 0x8005a2 2a9f6: 70 91 a3 05 lds r23, 0x05A3 ; 0x8005a3 2a9fa: 80 91 a4 05 lds r24, 0x05A4 ; 0x8005a4 2a9fe: 90 91 a5 05 lds r25, 0x05A5 ; 0x8005a5 2aa02: 62 0f add r22, r18 2aa04: 73 1f adc r23, r19 2aa06: 84 1f adc r24, r20 2aa08: 95 1f adc r25, r21 } 2aa0a: 1f 91 pop r17 2aa0c: 0f 91 pop r16 2aa0e: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2aa10: 60 91 4d 06 lds r22, 0x064D ; 0x80064d 2aa14: 70 91 4e 06 lds r23, 0x064E ; 0x80064e 2aa18: 80 91 4f 06 lds r24, 0x064F ; 0x80064f 2aa1c: 90 91 50 06 lds r25, 0x0650 ; 0x800650 2aa20: d6 cf rjmp .-84 ; 0x2a9ce 0002aa22 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 2aa22: 4f 92 push r4 2aa24: 5f 92 push r5 2aa26: 6f 92 push r6 2aa28: 7f 92 push r7 2aa2a: 8f 92 push r8 2aa2c: 9f 92 push r9 2aa2e: af 92 push r10 2aa30: bf 92 push r11 2aa32: cf 92 push r12 2aa34: df 92 push r13 2aa36: ef 92 push r14 2aa38: ff 92 push r15 2aa3a: 0f 93 push r16 2aa3c: 1f 93 push r17 2aa3e: cf 93 push r28 2aa40: df 93 push r29 2aa42: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 2aa46: 0e 94 3d 68 call 0xd07a ; 0xd07a 2aa4a: 88 23 and r24, r24 2aa4c: 09 f4 brne .+2 ; 0x2aa50 2aa4e: 6e c0 rjmp .+220 ; 0x2ab2c { const float _met = ((float)total_filament_used) / (100000.f); 2aa50: 60 91 60 06 lds r22, 0x0660 ; 0x800660 2aa54: 70 91 61 06 lds r23, 0x0661 ; 0x800661 2aa58: 80 91 62 06 lds r24, 0x0662 ; 0x800662 2aa5c: 90 91 63 06 lds r25, 0x0663 ; 0x800663 2aa60: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 2aa64: 20 e0 ldi r18, 0x00 ; 0 2aa66: 30 e5 ldi r19, 0x50 ; 80 2aa68: 43 ec ldi r20, 0xC3 ; 195 2aa6a: 57 e4 ldi r21, 0x47 ; 71 2aa6c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2aa70: 56 2e mov r5, r22 2aa72: 47 2e mov r4, r23 2aa74: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 2aa76: 0f 94 df 54 call 0x2a9be ; 0x2a9be 2aa7a: 6b 01 movw r12, r22 2aa7c: 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(); 2aa7e: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_printf_P(_N( 2aa82: 84 e7 ldi r24, 0x74 ; 116 2aa84: 9c e4 ldi r25, 0x4C ; 76 2aa86: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2aa8a: 18 2f mov r17, r24 2aa8c: 09 2f mov r16, r25 2aa8e: 84 e6 ldi r24, 0x64 ; 100 2aa90: 9c e4 ldi r25, 0x4C ; 76 2aa92: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2aa96: 78 2e mov r7, r24 2aa98: 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; 2aa9a: 8c e3 ldi r24, 0x3C ; 60 2aa9c: 88 2e mov r8, r24 2aa9e: 91 2c mov r9, r1 2aaa0: a1 2c mov r10, r1 2aaa2: b1 2c mov r11, r1 2aaa4: c7 01 movw r24, r14 2aaa6: b6 01 movw r22, r12 2aaa8: a5 01 movw r20, r10 2aaaa: 94 01 movw r18, r8 2aaac: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2aab0: 7f 93 push r23 2aab2: 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; 2aab4: ca 01 movw r24, r20 2aab6: b9 01 movw r22, r18 2aab8: a5 01 movw r20, r10 2aaba: 94 01 movw r18, r8 2aabc: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2aac0: 7f 93 push r23 2aac2: 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; 2aac4: c7 01 movw r24, r14 2aac6: b6 01 movw r22, r12 2aac8: 20 e1 ldi r18, 0x10 ; 16 2aaca: 3e e0 ldi r19, 0x0E ; 14 2aacc: 40 e0 ldi r20, 0x00 ; 0 2aace: 50 e0 ldi r21, 0x00 ; 0 2aad0: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2aad4: 5f 93 push r21 2aad6: 4f 93 push r20 2aad8: 3f 93 push r19 2aada: 2f 93 push r18 2aadc: 0f 93 push r16 2aade: 1f 93 push r17 2aae0: df 93 push r29 2aae2: cf 93 push r28 2aae4: 4f 92 push r4 2aae6: 5f 92 push r5 2aae8: 6f 92 push r6 2aaea: 7f 92 push r7 2aaec: 89 ea ldi r24, 0xA9 ; 169 2aaee: 9f e6 ldi r25, 0x6F ; 111 2aaf0: 9f 93 push r25 2aaf2: 8f 93 push r24 2aaf4: 0e 94 66 6f call 0xdecc ; 0xdecc "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 2aaf8: 8d b7 in r24, 0x3d ; 61 2aafa: 9e b7 in r25, 0x3e ; 62 2aafc: 42 96 adiw r24, 0x12 ; 18 2aafe: 0f b6 in r0, 0x3f ; 63 2ab00: f8 94 cli 2ab02: 9e bf out 0x3e, r25 ; 62 2ab04: 0f be out 0x3f, r0 ; 63 2ab06: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 2ab08: df 91 pop r29 2ab0a: cf 91 pop r28 2ab0c: 1f 91 pop r17 2ab0e: 0f 91 pop r16 2ab10: ff 90 pop r15 2ab12: ef 90 pop r14 2ab14: df 90 pop r13 2ab16: cf 90 pop r12 2ab18: bf 90 pop r11 2ab1a: af 90 pop r10 2ab1c: 9f 90 pop r9 2ab1e: 8f 90 pop r8 2ab20: 7f 90 pop r7 2ab22: 6f 90 pop r6 2ab24: 5f 90 pop r5 2ab26: 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(); 2ab28: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 2ab2c: 81 ef ldi r24, 0xF1 ; 241 2ab2e: 9f e0 ldi r25, 0x0F ; 15 2ab30: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2ab34: 2b 01 movw r4, r22 2ab36: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 2ab38: 8d ee ldi r24, 0xED ; 237 2ab3a: 9f e0 ldi r25, 0x0F ; 15 2ab3c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2ab40: 6b 01 movw r12, r22 2ab42: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 2ab44: 0e 94 b9 6f call 0xdf72 ; 0xdf72 lcd_printf_P(_N( 2ab48: 81 e5 ldi r24, 0x51 ; 81 2ab4a: 9c e4 ldi r25, 0x4C ; 76 2ab4c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2ab50: 98 2e mov r9, r24 2ab52: 89 2e mov r8, r25 2ab54: 80 e4 ldi r24, 0x40 ; 64 2ab56: 9c e4 ldi r25, 0x4C ; 76 2ab58: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2ab5c: b8 2e mov r11, r24 2ab5e: 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; 2ab60: c7 01 movw r24, r14 2ab62: b6 01 movw r22, r12 2ab64: 2c e3 ldi r18, 0x3C ; 60 2ab66: 30 e0 ldi r19, 0x00 ; 0 2ab68: 40 e0 ldi r20, 0x00 ; 0 2ab6a: 50 e0 ldi r21, 0x00 ; 0 2ab6c: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2ab70: 7f 93 push r23 2ab72: 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; 2ab74: ca 01 movw r24, r20 2ab76: b9 01 movw r22, r18 2ab78: 28 e1 ldi r18, 0x18 ; 24 2ab7a: 30 e0 ldi r19, 0x00 ; 0 2ab7c: 40 e0 ldi r20, 0x00 ; 0 2ab7e: 50 e0 ldi r21, 0x00 ; 0 2ab80: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2ab84: 7f 93 push r23 2ab86: 6f 93 push r22 uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 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; 2ab88: c7 01 movw r24, r14 2ab8a: b6 01 movw r22, r12 2ab8c: 20 ea ldi r18, 0xA0 ; 160 2ab8e: 35 e0 ldi r19, 0x05 ; 5 2ab90: 40 e0 ldi r20, 0x00 ; 0 2ab92: 50 e0 ldi r21, 0x00 ; 0 2ab94: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2ab98: 5f 93 push r21 2ab9a: 4f 93 push r20 2ab9c: 3f 93 push r19 2ab9e: 2f 93 push r18 2aba0: 8f 92 push r8 2aba2: 9f 92 push r9 { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 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; 2aba4: c3 01 movw r24, r6 2aba6: b2 01 movw r22, r4 2aba8: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 2abac: 20 e0 ldi r18, 0x00 ; 0 2abae: 30 e0 ldi r19, 0x00 ; 0 2abb0: 48 ec ldi r20, 0xC8 ; 200 2abb2: 52 e4 ldi r21, 0x42 ; 66 2abb4: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2abb8: 9f 93 push r25 2abba: 8f 93 push r24 2abbc: 7f 93 push r23 2abbe: 6f 93 push r22 2abc0: af 92 push r10 2abc2: bf 92 push r11 2abc4: 85 e8 ldi r24, 0x85 ; 133 2abc6: 9f e6 ldi r25, 0x6F ; 111 2abc8: 9f 93 push r25 2abca: 8f 93 push r24 2abcc: 0e 94 66 6f call 0xdecc ; 0xdecc "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 2abd0: 8d b7 in r24, 0x3d ; 61 2abd2: 9e b7 in r25, 0x3e ; 62 2abd4: 42 96 adiw r24, 0x12 ; 18 2abd6: 0f b6 in r0, 0x3f ; 63 2abd8: f8 94 cli 2abda: 9e bf out 0x3e, r25 ; 62 2abdc: 0f be out 0x3f, r0 ; 63 2abde: 8d bf out 0x3d, r24 ; 61 2abe0: 93 cf rjmp .-218 ; 0x2ab08 0002abe2 : 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()") { 2abe2: cf 92 push r12 2abe4: df 92 push r13 2abe6: ef 92 push r14 2abe8: ff 92 push r15 2abea: 0f 93 push r16 2abec: 1f 93 push r17 2abee: cf 93 push r28 2abf0: df 93 push r29 2abf2: 00 d0 rcall .+0 ; 0x2abf4 2abf4: 00 d0 rcall .+0 ; 0x2abf6 2abf6: 1f 92 push r1 2abf8: 1f 92 push r1 2abfa: cd b7 in r28, 0x3d ; 61 2abfc: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 2abfe: 80 91 35 05 lds r24, 0x0535 ; 0x800535 2ac02: 90 91 36 05 lds r25, 0x0536 ; 0x800536 2ac06: 00 97 sbiw r24, 0x00 ; 0 2ac08: e1 f1 breq .+120 ; 0x2ac82 { const int16_t initial_feedmultiply = feedmultiply; 2ac0a: 20 91 39 02 lds r18, 0x0239 ; 0x800239 2ac0e: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2ac12: 24 36 cpi r18, 0x64 ; 100 2ac14: 31 05 cpc r19, r1 2ac16: 4c f4 brge .+18 ; 0x2ac2a 2ac18: ac 01 movw r20, r24 2ac1a: 42 0f add r20, r18 2ac1c: 53 1f adc r21, r19 2ac1e: 45 36 cpi r20, 0x65 ; 101 2ac20: 51 05 cpc r21, r1 2ac22: 6c f4 brge .+26 ; 0x2ac3e 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; 2ac24: 82 0f add r24, r18 2ac26: 93 1f adc r25, r19 2ac28: 0c c0 rjmp .+24 ; 0x2ac42 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2ac2a: 24 36 cpi r18, 0x64 ; 100 2ac2c: 31 05 cpc r19, r1 2ac2e: 09 f4 brne .+2 ; 0x2ac32 2ac30: 55 c0 rjmp .+170 ; 0x2acdc (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 2ac32: ac 01 movw r20, r24 2ac34: 42 0f add r20, r18 2ac36: 53 1f adc r21, r19 2ac38: 44 36 cpi r20, 0x64 ; 100 2ac3a: 51 05 cpc r21, r1 2ac3c: 9c f7 brge .-26 ; 0x2ac24 { feedmultiply = 100; 2ac3e: 84 e6 ldi r24, 0x64 ; 100 2ac40: 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; 2ac42: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2ac46: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 2ac4a: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2ac4e: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 2ac52: 82 17 cp r24, r18 2ac54: 93 07 cpc r25, r19 2ac56: a9 f0 breq .+42 ; 0x2ac82 feedmultiply = constrain(feedmultiply, 10, 999); 2ac58: 88 3e cpi r24, 0xE8 ; 232 2ac5a: 53 e0 ldi r21, 0x03 ; 3 2ac5c: 95 07 cpc r25, r21 2ac5e: 14 f0 brlt .+4 ; 0x2ac64 2ac60: 87 ee ldi r24, 0xE7 ; 231 2ac62: 93 e0 ldi r25, 0x03 ; 3 2ac64: 8a 30 cpi r24, 0x0A ; 10 2ac66: 91 05 cpc r25, r1 2ac68: 14 f4 brge .+4 ; 0x2ac6e 2ac6a: 8a e0 ldi r24, 0x0A ; 10 2ac6c: 90 e0 ldi r25, 0x00 ; 0 2ac6e: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2ac72: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 2ac76: 10 92 36 05 sts 0x0536, r1 ; 0x800536 2ac7a: 10 92 35 05 sts 0x0535, r1 ; 0x800535 refresh_saved_feedrate_multiplier_in_ram(); 2ac7e: 0e 94 90 65 call 0xcb20 ; 0xcb20 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 2ac82: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2ac86: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 2ac88: 10 92 4c 06 sts 0x064C, r1 ; 0x80064c } if (lcd_status_update_delay) 2ac8c: 10 91 4c 06 lds r17, 0x064C ; 0x80064c 2ac90: 11 23 and r17, r17 2ac92: 91 f1 breq .+100 ; 0x2acf8 lcd_status_update_delay--; 2ac94: 2f ef ldi r18, 0xFF ; 255 2ac96: 21 0f add r18, r17 2ac98: 20 93 4c 06 sts 0x064C, r18 ; 0x80064c if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 2ac9c: 80 91 d0 03 lds r24, 0x03D0 ; 0x8003d0 2aca0: 81 11 cpse r24, r1 2aca2: 0d c0 rjmp .+26 ; 0x2acbe 2aca4: 0e 94 aa 71 call 0xe354 ; 0xe354 2aca8: 88 23 and r24, r24 2acaa: 49 f0 breq .+18 ; 0x2acbe menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 2acac: 10 92 f2 03 sts 0x03F2, r1 ; 0x8003f2 menu_submenu(lcd_main_menu); 2acb0: 60 e0 ldi r22, 0x00 ; 0 2acb2: 89 eb ldi r24, 0xB9 ; 185 2acb4: 94 ee ldi r25, 0xE4 ; 228 2acb6: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2acba: 0e 94 39 70 call 0xe072 ; 0xe072 } } 2acbe: 28 96 adiw r28, 0x08 ; 8 2acc0: 0f b6 in r0, 0x3f ; 63 2acc2: f8 94 cli 2acc4: de bf out 0x3e, r29 ; 62 2acc6: 0f be out 0x3f, r0 ; 63 2acc8: cd bf out 0x3d, r28 ; 61 2acca: df 91 pop r29 2accc: cf 91 pop r28 2acce: 1f 91 pop r17 2acd0: 0f 91 pop r16 2acd2: ff 90 pop r15 2acd4: ef 90 pop r14 2acd6: df 90 pop r13 2acd8: cf 90 pop r12 2acda: 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) { 2acdc: 8b 30 cpi r24, 0x0B ; 11 2acde: 91 05 cpc r25, r1 2ace0: 1c f0 brlt .+6 ; 0x2ace8 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 2ace2: 86 5a subi r24, 0xA6 ; 166 2ace4: 9f 4f sbci r25, 0xFF ; 255 2ace6: ad cf rjmp .-166 ; 0x2ac42 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 2ace8: 86 3f cpi r24, 0xF6 ; 246 2acea: 4f ef ldi r20, 0xFF ; 255 2acec: 94 07 cpc r25, r20 2acee: 0c f0 brlt .+2 ; 0x2acf2 2acf0: ac cf rjmp .-168 ; 0x2ac4a feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 2acf2: 82 59 subi r24, 0x92 ; 146 2acf4: 9f 4f sbci r25, 0xFF ; 255 2acf6: a5 cf rjmp .-182 ; 0x2ac42 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; 2acf8: 6a e0 ldi r22, 0x0A ; 10 2acfa: 60 93 4c 06 sts 0x064C, r22 ; 0x80064c ReInitLCD++; 2acfe: 80 91 4b 06 lds r24, 0x064B ; 0x80064b 2ad02: 8f 5f subi r24, 0xFF ; 255 2ad04: 80 93 4b 06 sts 0x064B, r24 ; 0x80064b if (ReInitLCD == 30) 2ad08: 8e 31 cpi r24, 0x1E ; 30 2ad0a: 09 f0 breq .+2 ; 0x2ad0e 2ad0c: 9f c0 rjmp .+318 ; 0x2ae4c { ReInitLCD = 0 ; 2ad0e: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2ad12: 0e 94 39 70 call 0xe072 ; 0xe072 lcd_status_message_idx = 0; // Re-draw message from beginning 2ad16: 10 92 37 05 sts 0x0537, r1 ; 0x800537 <_ZL22lcd_status_message_idx.lto_priv.464> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 2ad1a: 0e 94 41 6f call 0xde82 ; 0xde82 lcd_home(); //line 0 2ad1e: 0e 94 b9 6f call 0xdf72 ; 0xdf72 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2ad22: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 2ad26: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 2ad2a: 07 2e mov r0, r23 2ad2c: 00 0c add r0, r0 2ad2e: 88 0b sbc r24, r24 2ad30: 99 0b sbc r25, r25 2ad32: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__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)); 2ad36: 20 e0 ldi r18, 0x00 ; 0 2ad38: 30 e0 ldi r19, 0x00 ; 0 2ad3a: 40 e0 ldi r20, 0x00 ; 0 2ad3c: 5f e3 ldi r21, 0x3F ; 63 2ad3e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2ad42: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 2ad46: 6b 01 movw r12, r22 2ad48: 20 e0 ldi r18, 0x00 ; 0 2ad4a: 30 e0 ldi r19, 0x00 ; 0 2ad4c: 40 e0 ldi r20, 0x00 ; 0 2ad4e: 5f e3 ldi r21, 0x3F ; 63 2ad50: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 2ad54: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 2ad58: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 2ad5c: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 2ad60: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2ad64: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 2ad68: a6 01 movw r20, r12 2ad6a: 82 e8 ldi r24, 0x82 ; 130 2ad6c: 0f 94 1a 2f call 0x25e34 ; 0x25e34 lcd_space(3); //3 spaces 2ad70: 83 e0 ldi r24, 0x03 ; 3 2ad72: 0e 94 83 6f call 0xdf06 ; 0xdf06 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 2ad76: 80 91 73 07 lds r24, 0x0773 ; 0x800773 2ad7a: 81 30 cpi r24, 0x01 ; 1 2ad7c: 09 f0 breq .+2 ; 0x2ad80 2ad7e: 6e c0 rjmp .+220 ; 0x2ae5c lcd_puts_P(_N("Z --- ")); 2ad80: 84 ee ldi r24, 0xE4 ; 228 2ad82: 9e e6 ldi r25, 0x6E ; 110 2ad84: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 2ad88: 61 e0 ldi r22, 0x01 ; 1 2ad8a: 80 e0 ldi r24, 0x00 ; 0 2ad8c: 0e 94 8d 6f call 0xdf1a ; 0xdf1a }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 2ad90: 60 91 69 0e lds r22, 0x0E69 ; 0x800e69 2ad94: 70 91 6a 0e lds r23, 0x0E6A ; 0x800e6a 2ad98: 07 2e mov r0, r23 2ad9a: 00 0c add r0, r0 2ad9c: 88 0b sbc r24, r24 2ad9e: 99 0b sbc r25, r25 2ada0: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 2ada4: 20 e0 ldi r18, 0x00 ; 0 2ada6: 30 e0 ldi r19, 0x00 ; 0 2ada8: 40 e0 ldi r20, 0x00 ; 0 2adaa: 5f e3 ldi r21, 0x3F ; 63 2adac: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2adb0: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 2adb4: 6b 01 movw r12, r22 2adb6: 20 e0 ldi r18, 0x00 ; 0 2adb8: 30 e0 ldi r19, 0x00 ; 0 2adba: 40 e0 ldi r20, 0x00 ; 0 2adbc: 5f e3 ldi r21, 0x3F ; 63 2adbe: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 2adc2: 70 91 f0 04 lds r23, 0x04F0 ; 0x8004f0 2adc6: 80 91 f1 04 lds r24, 0x04F1 ; 0x8004f1 2adca: 90 91 f2 04 lds r25, 0x04F2 ; 0x8004f2 2adce: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 2add2: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 2add6: a6 01 movw r20, r12 2add8: 80 e8 ldi r24, 0x80 ; 128 2adda: 0f 94 1a 2f call 0x25e34 ; 0x25e34 lcd_space(3); //3 spaces 2adde: 83 e0 ldi r24, 0x03 ; 3 2ade0: 0e 94 83 6f call 0xdf06 ; 0xdf06 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 2ade4: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 2ade8: 8f 93 push r24 2adea: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2adee: 8f 93 push r24 2adf0: 8d ee ldi r24, 0xED ; 237 2adf2: 9e e6 ldi r25, 0x6E ; 110 2adf4: 9f 93 push r25 2adf6: 8f 93 push r24 2adf8: 0e 94 66 6f call 0xdecc ; 0xdecc lcd_space(8 - chars); 2adfc: 98 e0 ldi r25, 0x08 ; 8 2adfe: 98 1b sub r25, r24 2ae00: 89 2f mov r24, r25 2ae02: 0e 94 83 6f call 0xdf06 ; 0xdf06 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 2ae06: 62 e0 ldi r22, 0x02 ; 2 2ae08: 80 e0 ldi r24, 0x00 ; 0 2ae0a: 0e 94 8d 6f call 0xdf1a ; 0xdf1a } // 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(" ")); 2ae0e: 0f 90 pop r0 2ae10: 0f 90 pop r0 2ae12: 0f 90 pop r0 2ae14: 0f 90 pop r0 2ae16: 80 91 0f 05 lds r24, 0x050F ; 0x80050f 2ae1a: e0 90 6c 14 lds r14, 0x146C ; 0x80146c 2ae1e: 81 11 cpse r24, r1 2ae20: 3e c0 rjmp .+124 ; 0x2ae9e 2ae22: 20 e0 ldi r18, 0x00 ; 0 2ae24: c2 2e mov r12, r18 2ae26: 2f e6 ldi r18, 0x6F ; 111 2ae28: d2 2e mov r13, r18 2ae2a: e1 10 cpse r14, r1 2ae2c: 3c c0 rjmp .+120 ; 0x2aea6 2ae2e: 84 e0 ldi r24, 0x04 ; 4 2ae30: c8 2e mov r12, r24 2ae32: 8f e6 ldi r24, 0x6F ; 111 2ae34: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2ae36: 0e 94 8e 68 call 0xd11c ; 0xd11c 2ae3a: f8 2e mov r15, r24 2ae3c: 88 23 and r24, r24 2ae3e: e1 f1 breq .+120 ; 0x2aeb8 2ae40: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2ae44: 8f 3f cpi r24, 0xFF ; 255 2ae46: 89 f5 brne .+98 ; 0x2aeaa 2ae48: f1 2c mov r15, r1 2ae4a: 36 c0 rjmp .+108 ; 0x2aeb8 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 2ae4c: 0f 94 44 de call 0x3bc88 ; 0x3bc88 <__divmodqi4> 2ae50: 91 11 cpse r25, r1 2ae52: 63 cf rjmp .-314 ; 0x2ad1a lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 2ae54: 80 e0 ldi r24, 0x00 ; 0 2ae56: 0e 94 f8 6f call 0xdff0 ; 0xdff0 2ae5a: 5d cf rjmp .-326 ; 0x2ad16 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]?' ':'?'); 2ae5c: 80 91 40 07 lds r24, 0x0740 ; 0x800740 2ae60: 88 23 and r24, r24 2ae62: d9 f0 breq .+54 ; 0x2ae9a 2ae64: 80 e2 ldi r24, 0x20 ; 32 2ae66: 1f 92 push r1 2ae68: 8f 93 push r24 2ae6a: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 2ae6e: 8f 93 push r24 2ae70: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 2ae74: 8f 93 push r24 2ae76: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 2ae7a: 8f 93 push r24 2ae7c: 80 91 49 07 lds r24, 0x0749 ; 0x800749 2ae80: 8f 93 push r24 2ae82: 8b ed ldi r24, 0xDB ; 219 2ae84: 9e e6 ldi r25, 0x6E ; 110 2ae86: 9f 93 push r25 2ae88: 8f 93 push r24 2ae8a: 0e 94 66 6f call 0xdecc ; 0xdecc 2ae8e: 0f b6 in r0, 0x3f ; 63 2ae90: f8 94 cli 2ae92: de bf out 0x3e, r29 ; 62 2ae94: 0f be out 0x3f, r0 ; 63 2ae96: cd bf out 0x3d, r28 ; 61 2ae98: 77 cf rjmp .-274 ; 0x2ad88 2ae9a: 8f e3 ldi r24, 0x3F ; 63 2ae9c: e4 cf rjmp .-56 ; 0x2ae66 } // 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(" ")); 2ae9e: 98 e0 ldi r25, 0x08 ; 8 2aea0: c9 2e mov r12, r25 2aea2: 9f e6 ldi r25, 0x6F ; 111 2aea4: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2aea6: ee 20 and r14, r14 2aea8: 31 f2 breq .-116 ; 0x2ae36 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2aeaa: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd // 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)); 2aeae: ff 24 eor r15, r15 2aeb0: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2aeb2: 88 23 and r24, r24 2aeb4: 09 f4 brne .+2 ; 0x2aeb8 2aeb6: bb c0 rjmp .+374 ; 0x2b02e { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 2aeb8: 81 ea ldi r24, 0xA1 ; 161 2aeba: 9d e0 ldi r25, 0x0D ; 13 2aebc: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2aec0: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 2aec2: 0e 94 d2 77 call 0xefa4 ; 0xefa4 if ((nextSheet >= 0) && (sheetNR != nextSheet)) 2aec6: 87 fd sbrc r24, 7 2aec8: b2 c0 rjmp .+356 ; 0x2b02e 2aeca: 08 17 cp r16, r24 2aecc: 09 f4 brne .+2 ; 0x2aed0 2aece: af c0 rjmp .+350 ; 0x2b02e { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 2aed0: 9b e0 ldi r25, 0x0B ; 11 2aed2: 09 02 muls r16, r25 2aed4: b0 01 movw r22, r0 2aed6: 11 24 eor r1, r1 2aed8: 67 5b subi r22, 0xB7 ; 183 2aeda: 72 4f sbci r23, 0xF2 ; 242 2aedc: 47 e0 ldi r20, 0x07 ; 7 2aede: 50 e0 ldi r21, 0x00 ; 0 2aee0: 8e 01 movw r16, r28 2aee2: 0f 5f subi r16, 0xFF ; 255 2aee4: 1f 4f sbci r17, 0xFF ; 255 2aee6: c8 01 movw r24, r16 2aee8: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 sheet[7] = '\0'; 2aeec: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 2aeee: 1f 93 push r17 2aef0: 0f 93 push r16 2aef2: 8b ec ldi r24, 0xCB ; 203 2aef4: 90 ea ldi r25, 0xA0 ; 160 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2aef6: 9f 93 push r25 2aef8: 8f 93 push r24 2aefa: 0e 94 66 6f call 0xdecc ; 0xdecc 2aefe: 0f 90 pop r0 2af00: 0f 90 pop r0 2af02: 0f 90 pop r0 2af04: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 2af06: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2af0a: 81 30 cpi r24, 0x01 ; 1 2af0c: 09 f0 breq .+2 ; 0x2af10 2af0e: e9 c0 rjmp .+466 ; 0x2b0e2 // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 2af10: 0f 94 a1 37 call 0x26f42 ; 0x26f42 2af14: 95 e0 ldi r25, 0x05 ; 5 2af16: 98 1b sub r25, r24 2af18: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2af1a: 0e 94 83 6f call 0xdf06 ; 0xdf06 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()) { 2af1e: 0e 94 8e 68 call 0xd11c ; 0xd11c 2af22: 88 23 and r24, r24 2af24: 09 f4 brne .+2 ; 0x2af28 2af26: fa c0 rjmp .+500 ; 0x2b11c uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 2af28: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 2af2c: 88 23 and r24, r24 2af2e: 09 f4 brne .+2 ; 0x2af32 2af30: da c0 rjmp .+436 ; 0x2b0e6 if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 2af32: c0 90 8d 02 lds r12, 0x028D ; 0x80028d 2af36: 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) 2af3a: e0 90 8b 02 lds r14, 0x028B ; 0x80028b 2af3e: f0 90 8c 02 lds r15, 0x028C ; 0x80028c #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 2af42: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 2af46: 8a 30 cpi r24, 0x0A ; 10 2af48: 11 f4 brne .+4 ; 0x2af4e clock_interval = 0; 2af4a: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a clock_interval++; 2af4e: 80 91 4a 06 lds r24, 0x064A ; 0x80064a 2af52: 8f 5f subi r24, 0xFF ; 255 2af54: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 2af58: 2f ef ldi r18, 0xFF ; 255 2af5a: e2 16 cp r14, r18 2af5c: f2 06 cpc r15, r18 2af5e: 21 f0 breq .+8 ; 0x2af68 2af60: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 2af62: 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) { 2af64: 86 30 cpi r24, 0x06 ; 6 2af66: 70 f4 brcc .+28 ; 0x2af84 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 2af68: 3f ef ldi r19, 0xFF ; 255 2af6a: c3 16 cp r12, r19 2af6c: d3 06 cpc r13, r19 2af6e: 09 f0 breq .+2 ; 0x2af72 2af70: c3 c0 rjmp .+390 ; 0x2b0f8 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 2af72: 0f 94 df 54 call 0x2a9be ; 0x2a9be 2af76: 2c e3 ldi r18, 0x3C ; 60 2af78: 30 e0 ldi r19, 0x00 ; 0 2af7a: 40 e0 ldi r20, 0x00 ; 0 2af7c: 50 e0 ldi r21, 0x00 ; 0 2af7e: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__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 = ' '; 2af82: 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)) { 2af84: 40 91 39 02 lds r20, 0x0239 ; 0x800239 2af88: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 2af8c: 44 36 cpi r20, 0x64 ; 100 2af8e: 51 05 cpc r21, r1 2af90: 09 f4 brne .+2 ; 0x2af94 2af92: b5 c0 rjmp .+362 ; 0x2b0fe 2af94: c2 16 cp r12, r18 2af96: d3 06 cpc r13, r19 2af98: 21 f0 breq .+8 ; 0x2afa2 2af9a: e2 16 cp r14, r18 2af9c: f3 06 cpc r15, r19 2af9e: 09 f0 breq .+2 ; 0x2afa2 2afa0: ae c0 rjmp .+348 ; 0x2b0fe 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); 2afa2: a4 e6 ldi r26, 0x64 ; 100 2afa4: b0 e0 ldi r27, 0x00 ; 0 2afa6: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 2afaa: 9a 01 movw r18, r20 2afac: 55 0f add r21, r21 2afae: 44 0b sbc r20, r20 2afb0: 55 0b sbc r21, r21 2afb2: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2afb6: 4f e3 ldi r20, 0x3F ; 63 2afb8: e4 2e mov r14, r20 2afba: 04 2e mov r0, r20 2afbc: 00 0c add r0, r0 2afbe: ff 08 sbc r15, r15 2afc0: e1 2f mov r30, r17 2afc2: 01 2e mov r0, r17 2afc4: 00 0c add r0, r0 2afc6: ff 0b sbc r31, r31 2afc8: c9 01 movw r24, r18 2afca: 6c e3 ldi r22, 0x3C ; 60 2afcc: 70 e0 ldi r23, 0x00 ; 0 2afce: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__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 2afd2: 20 37 cpi r18, 0x70 ; 112 2afd4: 37 41 sbci r19, 0x17 ; 23 2afd6: 08 f0 brcs .+2 ; 0x2afda 2afd8: 94 c0 rjmp .+296 ; 0x2b102 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 2afda: ff 92 push r15 2afdc: 4f 93 push r20 2afde: ff 93 push r31 2afe0: 1f 93 push r17 2afe2: 9f 93 push r25 2afe4: 8f 93 push r24 2afe6: 7f 93 push r23 2afe8: 6f 93 push r22 2afea: 87 e1 ldi r24, 0x17 ; 23 2afec: 9f e6 ldi r25, 0x6F ; 111 2afee: 9f 93 push r25 2aff0: 8f 93 push r24 2aff2: 0e 94 66 6f call 0xdecc ; 0xdecc else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 2aff6: 0f b6 in r0, 0x3f ; 63 2aff8: f8 94 cli 2affa: de bf out 0x3e, r29 ; 62 2affc: 0f be out 0x3f, r0 ; 63 2affe: 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); 2b000: 98 e0 ldi r25, 0x08 ; 8 2b002: 98 1b sub r25, r24 2b004: 89 2f mov r24, r25 2b006: 0e 94 83 6f call 0xdf06 ; 0xdf06 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 2b00a: 63 e0 ldi r22, 0x03 ; 3 2b00c: 80 e0 ldi r24, 0x00 ; 0 2b00e: 0e 94 8d 6f call 0xdf1a ; 0xdf1a #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2b012: 0f 94 aa 40 call 0x28154 ; 0x28154 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 2b016: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2b01a: 88 23 and r24, r24 2b01c: 09 f4 brne .+2 ; 0x2b020 2b01e: 3e ce rjmp .-900 ; 0x2ac9c 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) { 2b020: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b 2b024: 81 11 cpse r24, r1 2b026: 3a ce rjmp .-908 ; 0x2ac9c 2b028: 0f 94 f3 0b call 0x217e6 ; 0x217e6 2b02c: 37 ce rjmp .-914 ; 0x2ac9c lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 2b02e: e1 10 cpse r14, r1 2b030: 04 c0 rjmp .+8 ; 0x2b03a 2b032: 80 91 9c 03 lds r24, 0x039C ; 0x80039c <_ZL9M79_timer.lto_priv.466> 2b036: 81 11 cpse r24, r1 2b038: 4a c0 rjmp .+148 ; 0x2b0ce // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 2b03a: df 92 push r13 2b03c: cf 92 push r12 2b03e: 87 ec ldi r24, 0xC7 ; 199 2b040: 90 ea ldi r25, 0xA0 ; 160 2b042: 9f 93 push r25 2b044: 8f 93 push r24 2b046: 0e 94 66 6f call 0xdecc ; 0xdecc 2b04a: 0f 90 pop r0 2b04c: 0f 90 pop r0 2b04e: 0f 90 pop r0 2b050: 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) 2b052: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 2b056: 81 11 cpse r24, r1 2b058: 04 c0 rjmp .+8 ; 0x2b062 2b05a: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2b05e: 85 36 cpi r24, 0x65 ; 101 2b060: f0 f1 brcs .+124 ; 0x2b0de { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 2b062: 80 91 85 02 lds r24, 0x0285 ; 0x800285 2b066: 85 36 cpi r24, 0x65 ; 101 2b068: d0 f1 brcs .+116 ; 0x2b0de 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;}; 2b06a: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 2b06e: 88 23 and r24, r24 2b070: 19 f1 breq .+70 ; 0x2b0b8 2b072: 80 91 79 17 lds r24, 0x1779 ; 0x801779 2b076: 90 91 7a 17 lds r25, 0x177A ; 0x80177a 2b07a: a0 91 7b 17 lds r26, 0x177B ; 0x80177b 2b07e: b0 91 7c 17 lds r27, 0x177C ; 0x80177c 2b082: 00 97 sbiw r24, 0x00 ; 0 2b084: a1 05 cpc r26, r1 2b086: b1 05 cpc r27, r1 2b088: b9 f0 breq .+46 ; 0x2b0b8 2b08a: bc 01 movw r22, r24 2b08c: cd 01 movw r24, r26 2b08e: 6d 59 subi r22, 0x9D ; 157 2b090: 7f 4f sbci r23, 0xFF ; 255 2b092: 8f 4f sbci r24, 0xFF ; 255 2b094: 9f 4f sbci r25, 0xFF ; 255 2b096: 24 e6 ldi r18, 0x64 ; 100 2b098: 30 e0 ldi r19, 0x00 ; 0 2b09a: 40 e0 ldi r20, 0x00 ; 0 2b09c: 50 e0 ldi r21, 0x00 ; 0 2b09e: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 2b0a2: 60 91 80 17 lds r22, 0x1780 ; 0x801780 2b0a6: 70 91 81 17 lds r23, 0x1781 ; 0x801781 2b0aa: 80 91 82 17 lds r24, 0x1782 ; 0x801782 2b0ae: 90 91 83 17 lds r25, 0x1783 ; 0x801783 2b0b2: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 2b0b6: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2b0b8: 21 2f mov r18, r17 2b0ba: 30 e0 ldi r19, 0x00 ; 0 2b0bc: 8a ef ldi r24, 0xFA ; 250 2b0be: 9e e6 ldi r25, 0x6E ; 110 2b0c0: f1 10 cpse r15, r1 2b0c2: 02 c0 rjmp .+4 ; 0x2b0c8 2b0c4: 84 ef ldi r24, 0xF4 ; 244 2b0c6: 9e e6 ldi r25, 0x6E ; 110 2b0c8: 3f 93 push r19 2b0ca: 2f 93 push r18 2b0cc: 14 cf rjmp .-472 ; 0x2aef6 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 2b0ce: 81 e0 ldi r24, 0x01 ; 1 2b0d0: 0e 94 83 6f call 0xdf06 ; 0xdf06 lcd_print(hostName); // Two characters 2b0d4: 87 e4 ldi r24, 0x47 ; 71 2b0d6: 96 e0 ldi r25, 0x06 ; 6 2b0d8: 0e 94 94 71 call 0xe328 ; 0xe328 2b0dc: ba cf rjmp .-140 ; 0x2b052 2b0de: 18 2f mov r17, r24 2b0e0: eb cf rjmp .-42 ; 0x2b0b8 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2b0e2: 85 e0 ldi r24, 0x05 ; 5 2b0e4: 1a cf rjmp .-460 ; 0x2af1a 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) 2b0e6: c0 90 89 02 lds r12, 0x0289 ; 0x800289 2b0ea: 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) 2b0ee: e0 90 87 02 lds r14, 0x0287 ; 0x800287 2b0f2: f0 90 88 02 lds r15, 0x0288 ; 0x800288 2b0f6: 25 cf rjmp .-438 ; 0x2af42 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) { 2b0f8: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 2b0fa: 12 e5 ldi r17, 0x52 ; 82 2b0fc: 43 cf rjmp .-378 ; 0x2af84 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 = ' '; 2b0fe: 40 e2 ldi r20, 0x20 ; 32 2b100: 5b cf rjmp .-330 ; 0x2afb8 } 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); 2b102: ff 92 push r15 2b104: 4f 93 push r20 2b106: ff 93 push r31 2b108: 1f 93 push r17 2b10a: 7f 93 push r23 2b10c: 6f 93 push r22 2b10e: 8c e0 ldi r24, 0x0C ; 12 2b110: 9f e6 ldi r25, 0x6F ; 111 2b112: 9f 93 push r25 2b114: 8f 93 push r24 2b116: 0e 94 66 6f call 0xdecc ; 0xdecc 2b11a: 6d cf rjmp .-294 ; 0x2aff6 } 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); 2b11c: 85 ea ldi r24, 0xA5 ; 165 2b11e: 9d e0 ldi r25, 0x0D ; 13 2b120: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 2b124: bc 01 movw r22, r24 2b126: 90 e0 ldi r25, 0x00 ; 0 2b128: 80 e0 ldi r24, 0x00 ; 0 2b12a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 2b12e: 20 e0 ldi r18, 0x00 ; 0 2b130: 30 e0 ldi r19, 0x00 ; 0 2b132: 4a e7 ldi r20, 0x7A ; 122 2b134: 54 e4 ldi r21, 0x44 ; 68 2b136: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 2b13a: 9f 93 push r25 2b13c: 8f 93 push r24 2b13e: 7f 93 push r23 2b140: 6f 93 push r22 2b142: 80 ed ldi r24, 0xD0 ; 208 2b144: 90 ea ldi r25, 0xA0 ; 160 2b146: 9f 93 push r25 2b148: 8f 93 push r24 2b14a: 0e 94 66 6f call 0xdecc ; 0xdecc 2b14e: 0f 90 pop r0 2b150: 0f 90 pop r0 2b152: 0f 90 pop r0 2b154: 0f 90 pop r0 2b156: 0f 90 pop r0 2b158: 0f 90 pop r0 2b15a: 52 cf rjmp .-348 ; 0x2b000 0002b15c : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 2b15c: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b startTimestamp = 0; 2b160: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 2b164: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 2b168: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 2b16c: 10 92 a9 05 sts 0x05A9, r1 ; 0x8005a9 stopTimestamp = 0; 2b170: 10 92 4d 06 sts 0x064D, r1 ; 0x80064d 2b174: 10 92 4e 06 sts 0x064E, r1 ; 0x80064e 2b178: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f 2b17c: 10 92 50 06 sts 0x0650, r1 ; 0x800650 accumulator = 0; 2b180: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 2b184: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 2b188: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 2b18c: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 } 2b190: 08 95 ret 0002b192 : /** * @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; } 2b192: 80 91 9b 03 lds r24, 0x039B ; 0x80039b } else return false; } bool Stopwatch::start() { if (!isRunning()) { 2b196: 81 30 cpi r24, 0x01 ; 1 2b198: f1 f0 breq .+60 ; 0x2b1d6 if (isPaused()) accumulator = duration(); 2b19a: 82 30 cpi r24, 0x02 ; 2 2b19c: c9 f4 brne .+50 ; 0x2b1d0 2b19e: 0f 94 df 54 call 0x2a9be ; 0x2a9be 2b1a2: 60 93 a2 05 sts 0x05A2, r22 ; 0x8005a2 2b1a6: 70 93 a3 05 sts 0x05A3, r23 ; 0x8005a3 2b1aa: 80 93 a4 05 sts 0x05A4, r24 ; 0x8005a4 2b1ae: 90 93 a5 05 sts 0x05A5, r25 ; 0x8005a5 else reset(); state = RUNNING; 2b1b2: 81 e0 ldi r24, 0x01 ; 1 2b1b4: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b startTimestamp = _millis(); 2b1b8: 0f 94 83 3f call 0x27f06 ; 0x27f06 2b1bc: 60 93 a6 05 sts 0x05A6, r22 ; 0x8005a6 2b1c0: 70 93 a7 05 sts 0x05A7, r23 ; 0x8005a7 2b1c4: 80 93 a8 05 sts 0x05A8, r24 ; 0x8005a8 2b1c8: 90 93 a9 05 sts 0x05A9, r25 ; 0x8005a9 2b1cc: 81 e0 ldi r24, 0x01 ; 1 2b1ce: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 2b1d0: 0f 94 ae 58 call 0x2b15c ; 0x2b15c 2b1d4: ee cf rjmp .-36 ; 0x2b1b2 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 2b1d6: 80 e0 ldi r24, 0x00 ; 0 } 2b1d8: 08 95 ret 0002b1da : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 2b1da: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 2b1de: 81 50 subi r24, 0x01 ; 1 2b1e0: 82 30 cpi r24, 0x02 ; 2 2b1e2: 70 f4 brcc .+28 ; 0x2b200 state = STOPPED; 2b1e4: 10 92 9b 03 sts 0x039B, r1 ; 0x80039b stopTimestamp = _millis(); 2b1e8: 0f 94 83 3f call 0x27f06 ; 0x27f06 2b1ec: 60 93 4d 06 sts 0x064D, r22 ; 0x80064d 2b1f0: 70 93 4e 06 sts 0x064E, r23 ; 0x80064e 2b1f4: 80 93 4f 06 sts 0x064F, r24 ; 0x80064f 2b1f8: 90 93 50 06 sts 0x0650, r25 ; 0x800650 2b1fc: 81 e0 ldi r24, 0x01 ; 1 2b1fe: 08 95 ret return true; } else return false; 2b200: 80 e0 ldi r24, 0x00 ; 0 } 2b202: 08 95 ret 0002b204 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 2b204: 2f b7 in r18, 0x3f ; 63 2b206: f8 94 cli count_pos = count_position[axis]; 2b208: 94 e0 ldi r25, 0x04 ; 4 2b20a: 89 9f mul r24, r25 2b20c: f0 01 movw r30, r0 2b20e: 11 24 eor r1, r1 2b210: ee 59 subi r30, 0x9E ; 158 2b212: f8 4f sbci r31, 0xF8 ; 248 2b214: 60 81 ld r22, Z 2b216: 71 81 ldd r23, Z+1 ; 0x01 2b218: 82 81 ldd r24, Z+2 ; 0x02 2b21a: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 2b21c: 2f bf out 0x3f, r18 ; 63 return count_pos; } 2b21e: 08 95 ret 0002b220 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 2b220: cf 93 push r28 2b222: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 2b224: 0f 94 02 59 call 0x2b204 ; 0x2b204 2b228: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2b22c: 24 e0 ldi r18, 0x04 ; 4 2b22e: c2 9f mul r28, r18 2b230: f0 01 movw r30, r0 2b232: 11 24 eor r1, r1 2b234: e0 59 subi r30, 0x90 ; 144 2b236: f9 4f sbci r31, 0xF9 ; 249 2b238: 20 81 ld r18, Z 2b23a: 31 81 ldd r19, Z+1 ; 0x01 2b23c: 42 81 ldd r20, Z+2 ; 0x02 2b23e: 53 81 ldd r21, Z+3 ; 0x03 2b240: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> } 2b244: cf 91 pop r28 2b246: 08 95 ret 0002b248 : } // Block until all buffered steps are executed void st_synchronize() { 2b248: cf 93 push r28 2b24a: df 93 push r29 2b24c: 00 d0 rcall .+0 ; 0x2b24e 2b24e: 1f 92 push r1 2b250: cd b7 in r28, 0x3d ; 61 2b252: 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); 2b254: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 2b258: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 while(blocks_queued()) 2b25c: 98 17 cp r25, r24 2b25e: 09 f4 brne .+2 ; 0x2b262 2b260: 46 c0 rjmp .+140 ; 0x2b2ee { #ifdef TMC2130 manage_heater(); 2b262: 0f 94 98 4e call 0x29d30 ; 0x29d30 tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 2b266: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.489> 2b26a: 84 30 cpi r24, 0x04 ; 4 2b26c: 38 f0 brcs .+14 ; 0x2b27c // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 2b26e: 81 e0 ldi r24, 0x01 ; 1 2b270: 0e 94 da 8b call 0x117b4 ; 0x117b4 lcd_update(0); 2b274: 80 e0 ldi r24, 0x00 ; 0 2b276: 0e 94 54 6f call 0xdea8 ; 0xdea8 2b27a: ec cf rjmp .-40 ; 0x2b254 { uint32_t val32 = 0; 2b27c: 19 82 std Y+1, r1 ; 0x01 2b27e: 1a 82 std Y+2, r1 ; 0x02 2b280: 1b 82 std Y+3, r1 ; 0x03 2b282: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 2b284: ae 01 movw r20, r28 2b286: 4f 5f subi r20, 0xFF ; 255 2b288: 5f 4f sbci r21, 0xFF ; 255 2b28a: 6f e6 ldi r22, 0x6F ; 111 2b28c: 0f 94 a4 39 call 0x27348 ; 0x27348 tmc2130_sg_measure_val += (val32 & 0x3ff); 2b290: 89 81 ldd r24, Y+1 ; 0x01 2b292: 9a 81 ldd r25, Y+2 ; 0x02 2b294: ab 81 ldd r26, Y+3 ; 0x03 2b296: bc 81 ldd r27, Y+4 ; 0x04 2b298: 93 70 andi r25, 0x03 ; 3 2b29a: aa 27 eor r26, r26 2b29c: bb 27 eor r27, r27 2b29e: 40 91 cb 03 lds r20, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.490> 2b2a2: 50 91 cc 03 lds r21, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x1> 2b2a6: 60 91 cd 03 lds r22, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x2> 2b2aa: 70 91 ce 03 lds r23, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x3> 2b2ae: 84 0f add r24, r20 2b2b0: 95 1f adc r25, r21 2b2b2: a6 1f adc r26, r22 2b2b4: b7 1f adc r27, r23 2b2b6: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb <_ZL22tmc2130_sg_measure_val.lto_priv.490> 2b2ba: 90 93 cc 03 sts 0x03CC, r25 ; 0x8003cc <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x1> 2b2be: a0 93 cd 03 sts 0x03CD, r26 ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x2> 2b2c2: b0 93 ce 03 sts 0x03CE, r27 ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x3> tmc2130_sg_measure_cnt++; 2b2c6: 80 91 c7 03 lds r24, 0x03C7 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491> 2b2ca: 90 91 c8 03 lds r25, 0x03C8 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x1> 2b2ce: a0 91 c9 03 lds r26, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x2> 2b2d2: b0 91 ca 03 lds r27, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x3> 2b2d6: 01 96 adiw r24, 0x01 ; 1 2b2d8: a1 1d adc r26, r1 2b2da: b1 1d adc r27, r1 2b2dc: 80 93 c7 03 sts 0x03C7, r24 ; 0x8003c7 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491> 2b2e0: 90 93 c8 03 sts 0x03C8, r25 ; 0x8003c8 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x1> 2b2e4: a0 93 c9 03 sts 0x03C9, r26 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x2> 2b2e8: b0 93 ca 03 sts 0x03CA, r27 ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x3> 2b2ec: b3 cf rjmp .-154 ; 0x2b254 #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 2b2ee: 0f 90 pop r0 2b2f0: 0f 90 pop r0 2b2f2: 0f 90 pop r0 2b2f4: 0f 90 pop r0 2b2f6: df 91 pop r29 2b2f8: cf 91 pop r28 2b2fa: 08 95 ret 0002b2fc : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 2b2fc: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 2b2fe: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2b302: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2b306: 80 ed ldi r24, 0xD0 ; 208 2b308: 97 e0 ldi r25, 0x07 ; 7 2b30a: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b30e: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 2b312: 10 92 e7 04 sts 0x04E7, r1 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2b316: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b31a: 80 91 e4 04 lds r24, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> 2b31e: 90 91 e5 04 lds r25, 0x04E5 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b322: 01 97 sbiw r24, 0x01 ; 1 2b324: 8e 3f cpi r24, 0xFE ; 254 2b326: 9f 4f sbci r25, 0xFF ; 255 2b328: 20 f4 brcc .+8 ; 0x2b332 nextAdvanceISR = 0; 2b32a: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b32e: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> #endif } 2b332: 08 95 ret 0002b334 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 2b334: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 2b338: 81 11 cpse r24, r1 2b33a: 3c c0 rjmp .+120 ; 0x2b3b4 #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 2b33c: 81 e0 ldi r24, 0x01 ; 1 2b33e: 80 93 a2 03 sts 0x03A2, r24 ; 0x8003a2 2b342: 60 91 a2 03 lds r22, 0x03A2 ; 0x8003a2 2b346: 8f ef ldi r24, 0xFF ; 255 2b348: 9f e0 ldi r25, 0x0F ; 15 2b34a: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 2b34e: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 2b352: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 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()) 2b356: 98 17 cp r25, r24 2b358: 41 f0 breq .+16 ; 0x2b36a { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 2b35a: 83 e7 ldi r24, 0x73 ; 115 2b35c: 9e e4 ldi r25, 0x4E ; 78 2b35e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2b362: 0f 94 7d 35 call 0x26afa ; 0x26afa // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 2b366: 0f 94 24 59 call 0x2b248 ; 0x2b248 } tmc2130_wait_standstill_xy(1000); 2b36a: 0f 94 e2 87 call 0x30fc4 ; 0x30fc4 cli(); 2b36e: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 2b370: 81 e0 ldi r24, 0x01 ; 1 2b372: 90 91 a2 03 lds r25, 0x03A2 ; 0x8003a2 2b376: 91 11 cpse r25, r1 2b378: 01 c0 rjmp .+2 ; 0x2b37c 2b37a: 80 e0 ldi r24, 0x00 ; 0 2b37c: 80 93 6a 06 sts 0x066A, r24 ; 0x80066a update_mode_profile(); 2b380: 0f 94 bf aa call 0x3557e ; 0x3557e 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(); 2b384: 0e 94 ce f9 call 0x1f39c ; 0x1f39c 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) { } 2b388: 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())); 2b38a: 82 70 andi r24, 0x02 ; 2 2b38c: 0f 94 19 3c call 0x27832 ; 0x27832 // 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(); 2b390: 0f 94 7e 59 call 0x2b2fc ; 0x2b2fc sei(); 2b394: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 2b396: 89 e6 ldi r24, 0x69 ; 105 2b398: 9f e0 ldi r25, 0x0F ; 15 2b39a: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2b39e: 88 23 and r24, r24 2b3a0: 61 f0 breq .+24 ; 0x2b3ba 2b3a2: 80 91 a2 03 lds r24, 0x03A2 ; 0x8003a2 2b3a6: 88 23 and r24, r24 2b3a8: 41 f0 breq .+16 ; 0x2b3ba menu_submenu(lcd_crash_mode_info2); 2b3aa: 60 e0 ldi r22, 0x00 ; 0 2b3ac: 83 e6 ldi r24, 0x63 ; 99 2b3ae: 9a e3 ldi r25, 0x3A ; 58 2b3b0: 0d 94 75 d0 jmp 0x3a0ea ; 0x3a0ea 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; 2b3b4: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 2b3b8: c4 cf rjmp .-120 ; 0x2b342 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 2b3ba: 08 95 ret 0002b3bc <__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) { 2b3bc: 1f 92 push r1 2b3be: 0f 92 push r0 2b3c0: 0f b6 in r0, 0x3f ; 63 2b3c2: 0f 92 push r0 2b3c4: 11 24 eor r1, r1 2b3c6: 0b b6 in r0, 0x3b ; 59 2b3c8: 0f 92 push r0 2b3ca: 6f 92 push r6 2b3cc: 7f 92 push r7 2b3ce: 8f 92 push r8 2b3d0: cf 92 push r12 2b3d2: df 92 push r13 2b3d4: ef 92 push r14 2b3d6: ff 92 push r15 2b3d8: 0f 93 push r16 2b3da: 1f 93 push r17 2b3dc: 2f 93 push r18 2b3de: 3f 93 push r19 2b3e0: 4f 93 push r20 2b3e2: 5f 93 push r21 2b3e4: 6f 93 push r22 2b3e6: 7f 93 push r23 2b3e8: 8f 93 push r24 2b3ea: 9f 93 push r25 2b3ec: af 93 push r26 2b3ee: bf 93 push r27 2b3f0: cf 93 push r28 2b3f2: df 93 push r29 2b3f4: ef 93 push r30 2b3f6: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b3f8: 80 91 e4 04 lds r24, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> 2b3fc: 90 91 e5 04 lds r25, 0x04E5 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b400: 9c 01 movw r18, r24 2b402: 21 50 subi r18, 0x01 ; 1 2b404: 31 09 sbc r19, r1 2b406: 2e 3f cpi r18, 0xFE ; 254 2b408: 3f 4f sbci r19, 0xFF ; 255 2b40a: 90 f4 brcc .+36 ; 0x2b430 <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 2b40c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b410: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b414: 28 17 cp r18, r24 2b416: 39 07 cpc r19, r25 2b418: 08 f0 brcs .+2 ; 0x2b41c <__vector_17+0x60> 2b41a: f9 c0 rjmp .+498 ; 0x2b60e <__vector_17+0x252> nextAdvanceISR -= OCR1A; 2b41c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b420: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b424: 82 1b sub r24, r18 2b426: 93 0b sbc r25, r19 2b428: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b42c: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2b430: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b434: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b438: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> 2b43c: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2b440: 28 17 cp r18, r24 2b442: 39 07 cpc r19, r25 2b444: 08 f0 brcs .+2 ; 0x2b448 <__vector_17+0x8c> 2b446: e8 c0 rjmp .+464 ; 0x2b618 <__vector_17+0x25c> nextMainISR -= OCR1A; 2b448: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b44c: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b450: 82 1b sub r24, r18 2b452: 93 0b sbc r25, r19 2b454: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2b458: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2b45c: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> 2b460: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2b464: 89 2b or r24, r25 2b466: 11 f0 breq .+4 ; 0x2b46c <__vector_17+0xb0> 2b468: 0d 94 2e 63 jmp 0x2c65c ; 0x2c65c <__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) 2b46c: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2b470: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2b474: 30 97 sbiw r30, 0x00 ; 0 2b476: 09 f0 breq .+2 ; 0x2b47a <__vector_17+0xbe> 2b478: 87 c1 rjmp .+782 ; 0x2b788 <__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) { 2b47a: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 2b47e: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 2b482: 98 17 cp r25, r24 2b484: 09 f4 brne .+2 ; 0x2b488 <__vector_17+0xcc> 2b486: f9 c1 rjmp .+1010 ; 0x2b87a <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 2b488: c0 91 55 0e lds r28, 0x0E55 ; 0x800e55 2b48c: 2c 2f mov r18, r28 2b48e: 30 e0 ldi r19, 0x00 ; 0 2b490: 5e e6 ldi r21, 0x6E ; 110 2b492: c5 9f mul r28, r21 2b494: e0 01 movw r28, r0 2b496: 11 24 eor r1, r1 2b498: cc 58 subi r28, 0x8C ; 140 2b49a: d8 4f sbci r29, 0xF8 ; 248 block->busy = true; 2b49c: fe 01 movw r30, r28 2b49e: e9 5b subi r30, 0xB9 ; 185 2b4a0: ff 4f sbci r31, 0xFF ; 255 2b4a2: 41 e0 ldi r20, 0x01 ; 1 2b4a4: 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(); 2b4a6: d0 93 a1 05 sts 0x05A1, r29 ; 0x8005a1 2b4aa: c0 93 a0 05 sts 0x05A0, r28 ; 0x8005a0 if (current_block != NULL) { 2b4ae: 20 97 sbiw r28, 0x00 ; 0 2b4b0: 09 f4 brne .+2 ; 0x2b4b4 <__vector_17+0xf8> 2b4b2: e3 c1 rjmp .+966 ; 0x2b87a <__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; 2b4b4: 10 92 9c 05 sts 0x059C, r1 ; 0x80059c 2b4b8: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d 2b4bc: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e 2b4c0: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f // Set the nominal step loops to zero to indicate, that the timer value is not known yet. // That means, delay the initialization of nominal step rate and step loops until the steady // state is reached. step_loops_nominal = 0; 2b4c4: 10 92 9b 05 sts 0x059B, r1 ; 0x80059b acc_step_rate = uint16_t(current_block->initial_rate); 2b4c8: 8a ad ldd r24, Y+58 ; 0x3a 2b4ca: 9b ad ldd r25, Y+59 ; 0x3b 2b4cc: 90 93 9a 05 sts 0x059A, r25 ; 0x80059a 2b4d0: 80 93 99 05 sts 0x0599, r24 ; 0x800599 #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2b4d4: 81 34 cpi r24, 0x41 ; 65 2b4d6: ec e9 ldi r30, 0x9C ; 156 2b4d8: 9e 07 cpc r25, r30 2b4da: 08 f0 brcs .+2 ; 0x2b4de <__vector_17+0x122> 2b4dc: a2 c0 rjmp .+324 ; 0x2b622 <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2b4de: 81 32 cpi r24, 0x21 ; 33 2b4e0: fe e4 ldi r31, 0x4E ; 78 2b4e2: 9f 07 cpc r25, r31 2b4e4: 08 f4 brcc .+2 ; 0x2b4e8 <__vector_17+0x12c> 2b4e6: a0 c0 rjmp .+320 ; 0x2b628 <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 2b4e8: 96 95 lsr r25 2b4ea: 87 95 ror r24 2b4ec: 96 95 lsr r25 2b4ee: 87 95 ror r24 step_loops = 4; 2b4f0: 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; 2b4f2: 40 93 98 05 sts 0x0598, r20 ; 0x800598 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2b4f6: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2b4f8: 81 15 cp r24, r1 2b4fa: e8 e0 ldi r30, 0x08 ; 8 2b4fc: 9e 07 cpc r25, r30 2b4fe: 08 f4 brcc .+2 ; 0x2b502 <__vector_17+0x146> 2b500: a4 c0 rjmp .+328 ; 0x2b64a <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2b502: e9 2f mov r30, r25 2b504: ff 27 eor r31, r31 2b506: ee 0f add r30, r30 2b508: ff 1f adc r31, r31 2b50a: ee 0f add r30, r30 2b50c: ff 1f adc r31, r31 2b50e: af 01 movw r20, r30 2b510: 40 56 subi r20, 0x60 ; 96 2b512: 59 46 sbci r21, 0x69 ; 105 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2b514: fa 01 movw r30, r20 2b516: 32 96 adiw r30, 0x02 ; 2 2b518: a5 91 lpm r26, Z+ 2b51a: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2b51c: fa 01 movw r30, r20 2b51e: 45 91 lpm r20, Z+ 2b520: 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. ); 2b522: b8 9f mul r27, r24 2b524: b0 01 movw r22, r0 2b526: a8 9f mul r26, r24 2b528: 00 0c add r0, r0 2b52a: 61 1d adc r22, r1 2b52c: 11 24 eor r1, r1 2b52e: 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); 2b530: ca 01 movw r24, r20 2b532: 86 1b sub r24, r22 2b534: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 2b536: 84 36 cpi r24, 0x64 ; 100 2b538: 91 05 cpc r25, r1 2b53a: 10 f4 brcc .+4 ; 0x2b540 <__vector_17+0x184> 2b53c: 84 e6 ldi r24, 0x64 ; 100 2b53e: 90 e0 ldi r25, 0x00 ; 0 2b540: b0 e0 ldi r27, 0x00 ; 0 2b542: a0 e0 ldi r26, 0x00 ; 0 2b544: 80 93 94 05 sts 0x0594, r24 ; 0x800594 2b548: 90 93 95 05 sts 0x0595, r25 ; 0x800595 2b54c: a0 93 96 05 sts 0x0596, r26 ; 0x800596 2b550: b0 93 97 05 sts 0x0597, r27 ; 0x800597 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2b554: 4e e6 ldi r20, 0x6E ; 110 2b556: 42 9f mul r20, r18 2b558: c0 01 movw r24, r0 2b55a: 43 9f mul r20, r19 2b55c: 90 0d add r25, r0 2b55e: 11 24 eor r1, r1 2b560: 8c 58 subi r24, 0x8C ; 140 2b562: 98 4f sbci r25, 0xF8 ; 248 2b564: fc 01 movw r30, r24 2b566: e4 5b subi r30, 0xB4 ; 180 2b568: ff 4f sbci r31, 0xFF ; 255 2b56a: 40 81 ld r20, Z 2b56c: 44 23 and r20, r20 2b56e: 49 f0 breq .+18 ; 0x2b582 <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 2b570: 81 5b subi r24, 0xB1 ; 177 2b572: 9f 4f sbci r25, 0xFF ; 255 2b574: fc 01 movw r30, r24 2b576: 80 81 ld r24, Z 2b578: 91 81 ldd r25, Z+1 ; 0x01 2b57a: 90 93 93 05 sts 0x0593, r25 ; 0x800593 2b57e: 80 93 92 05 sts 0x0592, r24 ; 0x800592 } e_steps = 0; 2b582: 10 92 91 05 sts 0x0591, r1 ; 0x800591 nextAdvanceISR = ADV_NEVER; 2b586: 8f ef ldi r24, 0xFF ; 255 2b588: 9f ef ldi r25, 0xFF ; 255 2b58a: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b58e: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> LA_phase = -1; 2b592: 80 93 90 05 sts 0x0590, r24 ; 0x800590 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 2b596: 8e e6 ldi r24, 0x6E ; 110 2b598: 82 9f mul r24, r18 2b59a: f0 01 movw r30, r0 2b59c: 83 9f mul r24, r19 2b59e: f0 0d add r31, r0 2b5a0: 11 24 eor r1, r1 2b5a2: ec 58 subi r30, 0x8C ; 140 2b5a4: f8 4f sbci r31, 0xF8 ; 248 2b5a6: 85 a9 ldd r24, Z+53 ; 0x35 2b5a8: 84 ff sbrs r24, 4 2b5aa: 08 c0 rjmp .+16 ; 0x2b5bc <__vector_17+0x200> count_position[E_AXIS] = 0; 2b5ac: 10 92 6e 07 sts 0x076E, r1 ; 0x80076e 2b5b0: 10 92 6f 07 sts 0x076F, r1 ; 0x80076f 2b5b4: 10 92 70 07 sts 0x0770, r1 ; 0x800770 2b5b8: 10 92 71 07 sts 0x0771, r1 ; 0x800771 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 2b5bc: 83 ff sbrs r24, 3 2b5be: 66 c0 rjmp .+204 ; 0x2b68c <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 2b5c0: 8e e6 ldi r24, 0x6E ; 110 2b5c2: 82 9f mul r24, r18 2b5c4: f0 01 movw r30, r0 2b5c6: 83 9f mul r24, r19 2b5c8: f0 0d add r31, r0 2b5ca: 11 24 eor r1, r1 2b5cc: ec 58 subi r30, 0x8C ; 140 2b5ce: f8 4f sbci r31, 0xF8 ; 248 2b5d0: 80 89 ldd r24, Z+16 ; 0x10 2b5d2: 91 89 ldd r25, Z+17 ; 0x11 2b5d4: 96 95 lsr r25 2b5d6: 87 95 ror r24 2b5d8: 91 95 neg r25 2b5da: 81 95 neg r24 2b5dc: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 2b5de: 90 93 81 05 sts 0x0581, r25 ; 0x800581 2b5e2: 80 93 80 05 sts 0x0580, r24 ; 0x800580 2b5e6: 90 93 85 05 sts 0x0585, r25 ; 0x800585 2b5ea: 80 93 84 05 sts 0x0584, r24 ; 0x800584 2b5ee: 90 93 89 05 sts 0x0589, r25 ; 0x800589 2b5f2: 80 93 88 05 sts 0x0588, r24 ; 0x800588 2b5f6: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 2b5fa: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 2b5fe: 81 e0 ldi r24, 0x01 ; 1 2b600: 24 85 ldd r18, Z+12 ; 0x0c 2b602: 35 85 ldd r19, Z+13 ; 0x0d 2b604: 23 2b or r18, r19 2b606: 09 f0 breq .+2 ; 0x2b60a <__vector_17+0x24e> 2b608: 82 c0 rjmp .+260 ; 0x2b70e <__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; 2b60a: 80 e0 ldi r24, 0x00 ; 0 2b60c: 80 c0 rjmp .+256 ; 0x2b70e <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 2b60e: 10 92 e5 04 sts 0x04E5, r1 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b612: 10 92 e4 04 sts 0x04E4, r1 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> 2b616: 0c cf rjmp .-488 ; 0x2b430 <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 2b618: 10 92 e7 04 sts 0x04E7, r1 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2b61c: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> 2b620: 1d cf rjmp .-454 ; 0x2b45c <__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; 2b622: 80 e4 ldi r24, 0x40 ; 64 2b624: 9c e9 ldi r25, 0x9C ; 156 2b626: 60 cf rjmp .-320 ; 0x2b4e8 <__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 2b628: 81 31 cpi r24, 0x11 ; 17 2b62a: 57 e2 ldi r21, 0x27 ; 39 2b62c: 95 07 cpc r25, r21 2b62e: 20 f0 brcs .+8 ; 0x2b638 <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 2b630: 96 95 lsr r25 2b632: 87 95 ror r24 step_loops = 2; 2b634: 42 e0 ldi r20, 0x02 ; 2 2b636: 5d cf rjmp .-326 ; 0x2b4f2 <__vector_17+0x136> } else { step_loops = 1; 2b638: 40 93 98 05 sts 0x0598, r20 ; 0x800598 2b63c: 80 32 cpi r24, 0x20 ; 32 2b63e: 91 05 cpc r25, r1 2b640: 08 f0 brcs .+2 ; 0x2b644 <__vector_17+0x288> 2b642: 59 cf rjmp .-334 ; 0x2b4f6 <__vector_17+0x13a> 2b644: 80 e2 ldi r24, 0x20 ; 32 2b646: 90 e0 ldi r25, 0x00 ; 0 2b648: 56 cf rjmp .-340 ; 0x2b4f6 <__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; 2b64a: ac 01 movw r20, r24 2b64c: 56 95 lsr r21 2b64e: 47 95 ror r20 2b650: 4c 7f andi r20, 0xFC ; 252 2b652: 40 56 subi r20, 0x60 ; 96 2b654: 5d 46 sbci r21, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2b656: fa 01 movw r30, r20 2b658: 65 91 lpm r22, Z+ 2b65a: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2b65c: fa 01 movw r30, r20 2b65e: 32 96 adiw r30, 0x02 ; 2 2b660: a5 91 lpm r26, Z+ 2b662: b4 91 lpm r27, Z 2b664: ac 01 movw r20, r24 2b666: 47 70 andi r20, 0x07 ; 7 2b668: 55 27 eor r21, r21 2b66a: 4a 9f mul r20, r26 2b66c: c0 01 movw r24, r0 2b66e: 4b 9f mul r20, r27 2b670: 90 0d add r25, r0 2b672: 5a 9f mul r21, r26 2b674: 90 0d add r25, r0 2b676: 11 24 eor r1, r1 2b678: e3 e0 ldi r30, 0x03 ; 3 2b67a: 96 95 lsr r25 2b67c: 87 95 ror r24 2b67e: ea 95 dec r30 2b680: e1 f7 brne .-8 ; 0x2b67a <__vector_17+0x2be> 2b682: ab 01 movw r20, r22 2b684: 48 1b sub r20, r24 2b686: 59 0b sbc r21, r25 2b688: ca 01 movw r24, r20 2b68a: 55 cf rjmp .-342 ; 0x2b536 <__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); 2b68c: 8e e6 ldi r24, 0x6E ; 110 2b68e: 82 9f mul r24, r18 2b690: f0 01 movw r30, r0 2b692: 83 9f mul r24, r19 2b694: f0 0d add r31, r0 2b696: 11 24 eor r1, r1 2b698: ec 58 subi r30, 0x8C ; 140 2b69a: f8 4f sbci r31, 0xF8 ; 248 2b69c: 80 89 ldd r24, Z+16 ; 0x10 2b69e: 91 89 ldd r25, Z+17 ; 0x11 2b6a0: a2 89 ldd r26, Z+18 ; 0x12 2b6a2: b3 89 ldd r27, Z+19 ; 0x13 2b6a4: b6 95 lsr r27 2b6a6: a7 95 ror r26 2b6a8: 97 95 ror r25 2b6aa: 87 95 ror r24 2b6ac: b0 95 com r27 2b6ae: a0 95 com r26 2b6b0: 90 95 com r25 2b6b2: 81 95 neg r24 2b6b4: 9f 4f sbci r25, 0xFF ; 255 2b6b6: af 4f sbci r26, 0xFF ; 255 2b6b8: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 2b6ba: 80 93 80 05 sts 0x0580, r24 ; 0x800580 2b6be: 90 93 81 05 sts 0x0581, r25 ; 0x800581 2b6c2: a0 93 82 05 sts 0x0582, r26 ; 0x800582 2b6c6: b0 93 83 05 sts 0x0583, r27 ; 0x800583 2b6ca: 80 93 84 05 sts 0x0584, r24 ; 0x800584 2b6ce: 90 93 85 05 sts 0x0585, r25 ; 0x800585 2b6d2: a0 93 86 05 sts 0x0586, r26 ; 0x800586 2b6d6: b0 93 87 05 sts 0x0587, r27 ; 0x800587 2b6da: 80 93 88 05 sts 0x0588, r24 ; 0x800588 2b6de: 90 93 89 05 sts 0x0589, r25 ; 0x800589 2b6e2: a0 93 8a 05 sts 0x058A, r26 ; 0x80058a 2b6e6: b0 93 8b 05 sts 0x058B, r27 ; 0x80058b 2b6ea: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c 2b6ee: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 2b6f2: a0 93 8e 05 sts 0x058E, r26 ; 0x80058e 2b6f6: b0 93 8f 05 sts 0x058F, r27 ; 0x80058f } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 2b6fa: 81 e0 ldi r24, 0x01 ; 1 2b6fc: 44 85 ldd r20, Z+12 ; 0x0c 2b6fe: 55 85 ldd r21, Z+13 ; 0x0d 2b700: 66 85 ldd r22, Z+14 ; 0x0e 2b702: 77 85 ldd r23, Z+15 ; 0x0f 2b704: 45 2b or r20, r21 2b706: 46 2b or r20, r22 2b708: 47 2b or r20, r23 2b70a: 09 f4 brne .+2 ; 0x2b70e <__vector_17+0x352> 2b70c: 7e cf rjmp .-260 ; 0x2b60a <__vector_17+0x24e> 2b70e: 80 93 7f 05 sts 0x057F, r24 ; 0x80057f #endif } step_events_completed.wide = 0; 2b712: 10 92 7b 05 sts 0x057B, r1 ; 0x80057b 2b716: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 2b71a: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 2b71e: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e // Set directions. out_bits = current_block->direction_bits; 2b722: 88 8d ldd r24, Y+24 ; 0x18 2b724: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< WRITE_NC(X_DIR_PIN, INVERT_X_DIR); 2b72c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b730: 81 60 ori r24, 0x01 ; 1 2b732: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 2b736: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 2b738: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } if((out_bits & (1< 2b740: 81 ff sbrs r24, 1 2b742: 8b c0 rjmp .+278 ; 0x2b85a <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 2b744: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b748: 8d 7f andi r24, 0xFD ; 253 2b74a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2b74e: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 2b750: 80 93 70 02 sts 0x0270, r24 ; 0x800270 } if ((out_bits & (1< 2b758: 82 ff sbrs r24, 2 2b75a: 86 c0 rjmp .+268 ; 0x2b868 <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 2b75c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b760: 84 60 ori r24, 0x04 ; 4 2b762: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 2b766: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 2b768: 80 93 71 02 sts 0x0271, r24 ; 0x800271 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 2b76c: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 2b770: 83 ff sbrs r24, 3 2b772: 81 c0 rjmp .+258 ; 0x2b876 <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 2b774: 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; 2b776: 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) 2b77a: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2b77e: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2b782: 30 97 sbiw r30, 0x00 ; 0 2b784: 09 f4 brne .+2 ; 0x2b788 <__vector_17+0x3cc> 2b786: 3d c7 rjmp .+3706 ; 0x2c602 <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 2b788: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 2b78c: 50 91 77 05 lds r21, 0x0577 ; 0x800577 2b790: 88 23 and r24, r24 2b792: 09 f4 brne .+2 ; 0x2b796 <__vector_17+0x3da> 2b794: cb c0 rjmp .+406 ; 0x2b92c <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 2b796: 20 91 0c 05 lds r18, 0x050C ; 0x80050c <_ZL11endstop_hit.lto_priv.496> uint8_t _endstop = endstop; 2b79a: 80 91 79 05 lds r24, 0x0579 ; 0x800579 uint8_t _old_endstop = old_endstop; 2b79e: 90 91 78 05 lds r25, 0x0578 ; 0x800578 #ifndef COREXY if ((out_bits & (1< #endif { #if ( (defined(X_MIN_PIN) && (X_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_XMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); 2b7a6: 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))); 2b7ae: 42 fd sbrc r20, 2 2b7b0: 83 c0 rjmp .+262 ; 0x2b8b8 <__vector_17+0x4fc> 2b7b2: 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)) { 2b7b4: 49 2f mov r20, r25 2b7b6: 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)){ 2b7b8: 48 23 and r20, r24 2b7ba: b1 f0 breq .+44 ; 0x2b7e8 <__vector_17+0x42c> 2b7bc: c0 80 ld r12, Z 2b7be: d1 80 ldd r13, Z+1 ; 0x01 2b7c0: e2 80 ldd r14, Z+2 ; 0x02 2b7c2: f3 80 ldd r15, Z+3 ; 0x03 2b7c4: 1c 14 cp r1, r12 2b7c6: 1d 04 cpc r1, r13 2b7c8: 1e 04 cpc r1, r14 2b7ca: 1f 04 cpc r1, r15 2b7cc: 6c f4 brge .+26 ; 0x2b7e8 <__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); 2b7ce: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 2b7d0: c0 88 ldd r12, Z+16 ; 0x10 2b7d2: d1 88 ldd r13, Z+17 ; 0x11 2b7d4: e2 88 ldd r14, Z+18 ; 0x12 2b7d6: f3 88 ldd r15, Z+19 ; 0x13 2b7d8: c0 92 7b 05 sts 0x057B, r12 ; 0x80057b 2b7dc: d0 92 7c 05 sts 0x057C, r13 ; 0x80057c 2b7e0: e0 92 7d 05 sts 0x057D, r14 ; 0x80057d 2b7e4: f0 92 7e 05 sts 0x057E, r15 ; 0x80057e #endif { #if ( (defined(Y_MIN_PIN) && (Y_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_YMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); 2b7e8: 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))); 2b7f0: 47 fd sbrc r20, 7 2b7f2: 6c c0 rjmp .+216 ; 0x2b8cc <__vector_17+0x510> 2b7f4: 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)) { 2b7f6: 49 2f mov r20, r25 2b7f8: 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)){ 2b7fa: 48 23 and r20, r24 2b7fc: b1 f0 breq .+44 ; 0x2b82a <__vector_17+0x46e> 2b7fe: c4 80 ldd r12, Z+4 ; 0x04 2b800: d5 80 ldd r13, Z+5 ; 0x05 2b802: e6 80 ldd r14, Z+6 ; 0x06 2b804: f7 80 ldd r15, Z+7 ; 0x07 2b806: 1c 14 cp r1, r12 2b808: 1d 04 cpc r1, r13 2b80a: 1e 04 cpc r1, r14 2b80c: 1f 04 cpc r1, r15 2b80e: 6c f4 brge .+26 ; 0x2b82a <__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); 2b810: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 2b812: c0 88 ldd r12, Z+16 ; 0x10 2b814: d1 88 ldd r13, Z+17 ; 0x11 2b816: e2 88 ldd r14, Z+18 ; 0x12 2b818: f3 88 ldd r15, Z+19 ; 0x13 2b81a: c0 92 7b 05 sts 0x057B, r12 ; 0x80057b 2b81e: d0 92 7c 05 sts 0x057C, r13 ; 0x80057c 2b822: e0 92 7d 05 sts 0x057D, r14 ; 0x80057d 2b826: f0 92 7e 05 sts 0x057E, r15 ; 0x80057e } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 2b82e: 51 11 cpse r21, r1 2b830: 77 c0 rjmp .+238 ; 0x2b920 <__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)) 2b832: 30 91 6a 06 lds r19, 0x066A ; 0x80066a 2b836: 31 30 cpi r19, 0x01 ; 1 2b838: 09 f0 breq .+2 ; 0x2b83c <__vector_17+0x480> 2b83a: 52 c0 rjmp .+164 ; 0x2b8e0 <__vector_17+0x524> 2b83c: 30 91 3e 06 lds r19, 0x063E ; 0x80063e 2b840: 32 fd sbrc r19, 2 2b842: 4e c0 rjmp .+156 ; 0x2b8e0 <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b844: 1c 9b sbis 0x03, 4 ; 3 2b846: 52 c0 rjmp .+164 ; 0x2b8ec <__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))); 2b848: 84 60 ori r24, 0x04 ; 4 2b84a: 51 c0 rjmp .+162 ; 0x2b8ee <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 2b850: 8e 7f andi r24, 0xFE ; 254 2b852: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 2b856: 81 e0 ldi r24, 0x01 ; 1 2b858: 6f cf rjmp .-290 ; 0x2b738 <__vector_17+0x37c> } if((out_bits & (1< 2b85e: 82 60 ori r24, 0x02 ; 2 2b860: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 2b864: 81 e0 ldi r24, 0x01 ; 1 2b866: 74 cf rjmp .-280 ; 0x2b750 <__vector_17+0x394> } if ((out_bits & (1< 2b86c: 8b 7f andi r24, 0xFB ; 251 2b86e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 2b872: 81 e0 ldi r24, 0x01 ; 1 2b874: 79 cf rjmp .-270 ; 0x2b768 <__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; 2b876: 81 e0 ldi r24, 0x01 ; 1 2b878: 7e cf rjmp .-260 ; 0x2b776 <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 2b87a: 80 ed ldi r24, 0xD0 ; 208 2b87c: 97 e0 ldi r25, 0x07 ; 7 2b87e: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2b882: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> 2b886: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL9main_Rate.lto_priv.494+0x1> 2b88a: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL9main_Rate.lto_priv.494> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 2b88e: 8f ef ldi r24, 0xFF ; 255 2b890: 9f ef ldi r25, 0xFF ; 255 2b892: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b896: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> e_steps = 0; 2b89a: 10 92 91 05 sts 0x0591, r1 ; 0x800591 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 2b89e: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2b8a2: 90 91 e1 04 lds r25, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2b8a6: 00 97 sbiw r24, 0x00 ; 0 2b8a8: 09 f4 brne .+2 ; 0x2b8ac <__vector_17+0x4f0> 2b8aa: 67 cf rjmp .-306 ; 0x2b77a <__vector_17+0x3be> --current_adv_steps; 2b8ac: 01 97 sbiw r24, 0x01 ; 1 2b8ae: 90 93 e1 04 sts 0x04E1, r25 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2b8b2: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2b8b6: 61 cf rjmp .-318 ; 0x2b77a <__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))); 2b8b8: 8e 7f andi r24, 0xFE ; 254 2b8ba: 7c cf rjmp .-264 ; 0x2b7b4 <__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))); 2b8bc: 42 fd sbrc r20, 2 2b8be: 04 c0 rjmp .+8 ; 0x2b8c8 <__vector_17+0x50c> 2b8c0: 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)){ 2b8c2: 49 2f mov r20, r25 2b8c4: 40 71 andi r20, 0x10 ; 16 2b8c6: 78 cf rjmp .-272 ; 0x2b7b8 <__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))); 2b8c8: 8f 7e andi r24, 0xEF ; 239 2b8ca: fb cf rjmp .-10 ; 0x2b8c2 <__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))); 2b8cc: 8d 7f andi r24, 0xFD ; 253 2b8ce: 93 cf rjmp .-218 ; 0x2b7f6 <__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))); 2b8d0: 47 fd sbrc r20, 7 2b8d2: 04 c0 rjmp .+8 ; 0x2b8dc <__vector_17+0x520> 2b8d4: 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)){ 2b8d6: 49 2f mov r20, r25 2b8d8: 40 72 andi r20, 0x20 ; 32 2b8da: 8f cf rjmp .-226 ; 0x2b7fa <__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))); 2b8dc: 8f 7d andi r24, 0xDF ; 223 2b8de: fb cf rjmp .-10 ; 0x2b8d6 <__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))); 2b8e0: 1c 99 sbic 0x03, 4 ; 3 2b8e2: b2 cf rjmp .-156 ; 0x2b848 <__vector_17+0x48c> 2b8e4: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b8e8: 36 ff sbrs r19, 6 2b8ea: ae cf rjmp .-164 ; 0x2b848 <__vector_17+0x48c> 2b8ec: 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)) { 2b8ee: 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)) { 2b8f0: 98 23 and r25, r24 2b8f2: b1 f0 breq .+44 ; 0x2b920 <__vector_17+0x564> 2b8f4: c0 84 ldd r12, Z+8 ; 0x08 2b8f6: d1 84 ldd r13, Z+9 ; 0x09 2b8f8: e2 84 ldd r14, Z+10 ; 0x0a 2b8fa: f3 84 ldd r15, Z+11 ; 0x0b 2b8fc: 1c 14 cp r1, r12 2b8fe: 1d 04 cpc r1, r13 2b900: 1e 04 cpc r1, r14 2b902: 1f 04 cpc r1, r15 2b904: 6c f4 brge .+26 ; 0x2b920 <__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); 2b906: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b908: c0 88 ldd r12, Z+16 ; 0x10 2b90a: d1 88 ldd r13, Z+17 ; 0x11 2b90c: e2 88 ldd r14, Z+18 ; 0x12 2b90e: f3 88 ldd r15, Z+19 ; 0x13 2b910: c0 92 7b 05 sts 0x057B, r12 ; 0x80057b 2b914: d0 92 7c 05 sts 0x057C, r13 ; 0x80057c 2b918: e0 92 7d 05 sts 0x057D, r14 ; 0x80057d 2b91c: f0 92 7e 05 sts 0x057E, r15 ; 0x80057e } #endif } endstop = _endstop; 2b920: 80 93 79 05 sts 0x0579, r24 ; 0x800579 old_endstop = _endstop; //apply current endstop state to the old endstop 2b924: 80 93 78 05 sts 0x0578, r24 ; 0x800578 endstop_hit = _endstop_hit; 2b928: 20 93 0c 05 sts 0x050C, r18 ; 0x80050c <_ZL11endstop_hit.lto_priv.496> } // 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) { 2b92c: 55 23 and r21, r21 2b92e: 09 f4 brne .+2 ; 0x2b932 <__vector_17+0x576> 2b930: 40 c0 rjmp .+128 ; 0x2b9b2 <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 2b932: 20 91 0c 05 lds r18, 0x050C ; 0x80050c <_ZL11endstop_hit.lto_priv.496> uint8_t _endstop = endstop; 2b936: 80 91 79 05 lds r24, 0x0579 ; 0x800579 uint8_t _old_endstop = old_endstop; 2b93a: 90 91 78 05 lds r25, 0x0578 ; 0x800578 // Check the Z min end-stop no matter what. // Good for searching for the center of an induction target. #ifdef TMC2130_SG_HOMING // Stall guard homing turned on #ifdef TMC2130_STEALTH_Z if ((tmc2130_mode == TMC2130_MODE_SILENT) && !(tmc2130_sg_homing_axes_mask & 0x04)) 2b93e: 30 91 6a 06 lds r19, 0x066A ; 0x80066a 2b942: 31 30 cpi r19, 0x01 ; 1 2b944: c9 f4 brne .+50 ; 0x2b978 <__vector_17+0x5bc> 2b946: 30 91 3e 06 lds r19, 0x063E ; 0x80063e 2b94a: 32 fd sbrc r19, 2 2b94c: 15 c0 rjmp .+42 ; 0x2b978 <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b94e: 1c 9b sbis 0x03, 4 ; 3 2b950: 19 c0 rjmp .+50 ; 0x2b984 <__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))); 2b952: 84 60 ori r24, 0x04 ; 4 2b954: 18 c0 rjmp .+48 ; 0x2b986 <__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)) 2b956: 30 91 6a 06 lds r19, 0x066A ; 0x80066a 2b95a: 31 30 cpi r19, 0x01 ; 1 2b95c: 31 f4 brne .+12 ; 0x2b96a <__vector_17+0x5ae> 2b95e: 30 91 3e 06 lds r19, 0x063E ; 0x80063e 2b962: 32 fd sbrc r19, 2 2b964: 02 c0 rjmp .+4 ; 0x2b96a <__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))); 2b966: 8f 7b andi r24, 0xBF ; 191 2b968: 05 c0 rjmp .+10 ; 0x2b974 <__vector_17+0x5b8> 2b96a: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b96e: 36 fd sbrc r19, 6 2b970: fa cf rjmp .-12 ; 0x2b966 <__vector_17+0x5aa> 2b972: 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)) { 2b974: 90 74 andi r25, 0x40 ; 64 2b976: bc cf rjmp .-136 ; 0x2b8f0 <__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))); 2b978: 1c 99 sbic 0x03, 4 ; 3 2b97a: eb cf rjmp .-42 ; 0x2b952 <__vector_17+0x596> 2b97c: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b980: 36 ff sbrs r19, 6 2b982: e7 cf rjmp .-50 ; 0x2b952 <__vector_17+0x596> 2b984: 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)) { 2b986: 94 70 andi r25, 0x04 ; 4 2b988: 98 23 and r25, r24 2b98a: 69 f0 breq .+26 ; 0x2b9a6 <__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); 2b98c: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b98e: 40 89 ldd r20, Z+16 ; 0x10 2b990: 51 89 ldd r21, Z+17 ; 0x11 2b992: 62 89 ldd r22, Z+18 ; 0x12 2b994: 73 89 ldd r23, Z+19 ; 0x13 2b996: 40 93 7b 05 sts 0x057B, r20 ; 0x80057b 2b99a: 50 93 7c 05 sts 0x057C, r21 ; 0x80057c 2b99e: 60 93 7d 05 sts 0x057D, r22 ; 0x80057d 2b9a2: 70 93 7e 05 sts 0x057E, r23 ; 0x80057e } endstop = _endstop; 2b9a6: 80 93 79 05 sts 0x0579, r24 ; 0x800579 old_endstop = _endstop; //apply current endstop state to the old endstop 2b9aa: 80 93 78 05 sts 0x0578, r24 ; 0x800578 endstop_hit = _endstop_hit; 2b9ae: 20 93 0c 05 sts 0x050C, r18 ; 0x80050c <_ZL11endstop_hit.lto_priv.496> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b9b2: 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) 2b9b4: 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); 2b9b6: 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); 2b9b8: 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); 2b9ba: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b9bc: 83 ff sbrs r24, 3 2b9be: 08 c1 rjmp .+528 ; 0x2bbd0 <__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) 2b9c0: 80 91 98 05 lds r24, 0x0598 ; 0x800598 2b9c4: c8 17 cp r28, r24 2b9c6: 08 f0 brcs .+2 ; 0x2b9ca <__vector_17+0x60e> 2b9c8: 72 c2 rjmp .+1252 ; 0x2beae <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2b9ca: 0f 94 57 22 call 0x244ae ; 0x244ae // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 2b9ce: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2b9d2: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2b9d6: 80 81 ld r24, Z 2b9d8: 91 81 ldd r25, Z+1 ; 0x01 2b9da: 20 91 80 05 lds r18, 0x0580 ; 0x800580 2b9de: 30 91 81 05 lds r19, 0x0581 ; 0x800581 2b9e2: 82 0f add r24, r18 2b9e4: 93 1f adc r25, r19 2b9e6: 90 93 81 05 sts 0x0581, r25 ; 0x800581 2b9ea: 80 93 80 05 sts 0x0580, r24 ; 0x800580 if (counter[X_AXIS].lo > 0) { 2b9ee: 18 16 cp r1, r24 2b9f0: 19 06 cpc r1, r25 2b9f2: 64 f5 brge .+88 ; 0x2ba4c <__vector_17+0x690> STEP_NC_HI(X_AXIS); 2b9f4: 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; 2b9f6: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2b9fa: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2b9fe: 80 91 80 05 lds r24, 0x0580 ; 0x800580 2ba02: 90 91 81 05 lds r25, 0x0581 ; 0x800581 2ba06: 20 89 ldd r18, Z+16 ; 0x10 2ba08: 31 89 ldd r19, Z+17 ; 0x11 2ba0a: 82 1b sub r24, r18 2ba0c: 93 0b sbc r25, r19 2ba0e: 90 93 81 05 sts 0x0581, r25 ; 0x800581 2ba12: 80 93 80 05 sts 0x0580, r24 ; 0x800580 count_position[X_AXIS]+=count_direction[X_AXIS]; 2ba16: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2ba1a: 40 91 62 07 lds r20, 0x0762 ; 0x800762 2ba1e: 50 91 63 07 lds r21, 0x0763 ; 0x800763 2ba22: 60 91 64 07 lds r22, 0x0764 ; 0x800764 2ba26: 70 91 65 07 lds r23, 0x0765 ; 0x800765 2ba2a: 89 2f mov r24, r25 2ba2c: 99 0f add r25, r25 2ba2e: 99 0b sbc r25, r25 2ba30: aa 0b sbc r26, r26 2ba32: bb 0b sbc r27, r27 2ba34: 84 0f add r24, r20 2ba36: 95 1f adc r25, r21 2ba38: a6 1f adc r26, r22 2ba3a: b7 1f adc r27, r23 2ba3c: 80 93 62 07 sts 0x0762, r24 ; 0x800762 2ba40: 90 93 63 07 sts 0x0763, r25 ; 0x800763 2ba44: a0 93 64 07 sts 0x0764, r26 ; 0x800764 2ba48: b0 93 65 07 sts 0x0765, r27 ; 0x800765 #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; 2ba4c: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2ba50: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2ba54: 84 81 ldd r24, Z+4 ; 0x04 2ba56: 95 81 ldd r25, Z+5 ; 0x05 2ba58: 20 91 84 05 lds r18, 0x0584 ; 0x800584 2ba5c: 30 91 85 05 lds r19, 0x0585 ; 0x800585 2ba60: 82 0f add r24, r18 2ba62: 93 1f adc r25, r19 2ba64: 90 93 85 05 sts 0x0585, r25 ; 0x800585 2ba68: 80 93 84 05 sts 0x0584, r24 ; 0x800584 if (counter[Y_AXIS].lo > 0) { 2ba6c: 18 16 cp r1, r24 2ba6e: 19 06 cpc r1, r25 2ba70: 44 f5 brge .+80 ; 0x2bac2 <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 2ba72: 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; 2ba74: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2ba78: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2ba7c: 20 89 ldd r18, Z+16 ; 0x10 2ba7e: 31 89 ldd r19, Z+17 ; 0x11 2ba80: 82 1b sub r24, r18 2ba82: 93 0b sbc r25, r19 2ba84: 90 93 85 05 sts 0x0585, r25 ; 0x800585 2ba88: 80 93 84 05 sts 0x0584, r24 ; 0x800584 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2ba8c: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2ba90: 40 91 66 07 lds r20, 0x0766 ; 0x800766 2ba94: 50 91 67 07 lds r21, 0x0767 ; 0x800767 2ba98: 60 91 68 07 lds r22, 0x0768 ; 0x800768 2ba9c: 70 91 69 07 lds r23, 0x0769 ; 0x800769 2baa0: 89 2f mov r24, r25 2baa2: 99 0f add r25, r25 2baa4: 99 0b sbc r25, r25 2baa6: aa 0b sbc r26, r26 2baa8: bb 0b sbc r27, r27 2baaa: 84 0f add r24, r20 2baac: 95 1f adc r25, r21 2baae: a6 1f adc r26, r22 2bab0: b7 1f adc r27, r23 2bab2: 80 93 66 07 sts 0x0766, r24 ; 0x800766 2bab6: 90 93 67 07 sts 0x0767, r25 ; 0x800767 2baba: a0 93 68 07 sts 0x0768, r26 ; 0x800768 2babe: b0 93 69 07 sts 0x0769, r27 ; 0x800769 #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; 2bac2: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bac6: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2baca: 80 85 ldd r24, Z+8 ; 0x08 2bacc: 91 85 ldd r25, Z+9 ; 0x09 2bace: 20 91 88 05 lds r18, 0x0588 ; 0x800588 2bad2: 30 91 89 05 lds r19, 0x0589 ; 0x800589 2bad6: 82 0f add r24, r18 2bad8: 93 1f adc r25, r19 2bada: 90 93 89 05 sts 0x0589, r25 ; 0x800589 2bade: 80 93 88 05 sts 0x0588, r24 ; 0x800588 if (counter[Z_AXIS].lo > 0) { 2bae2: 18 16 cp r1, r24 2bae4: 19 06 cpc r1, r25 2bae6: 44 f5 brge .+80 ; 0x2bb38 <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 2bae8: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 2baea: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2baee: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2baf2: 20 89 ldd r18, Z+16 ; 0x10 2baf4: 31 89 ldd r19, Z+17 ; 0x11 2baf6: 82 1b sub r24, r18 2baf8: 93 0b sbc r25, r19 2bafa: 90 93 89 05 sts 0x0589, r25 ; 0x800589 2bafe: 80 93 88 05 sts 0x0588, r24 ; 0x800588 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2bb02: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2bb06: 40 91 6a 07 lds r20, 0x076A ; 0x80076a 2bb0a: 50 91 6b 07 lds r21, 0x076B ; 0x80076b 2bb0e: 60 91 6c 07 lds r22, 0x076C ; 0x80076c 2bb12: 70 91 6d 07 lds r23, 0x076D ; 0x80076d 2bb16: 89 2f mov r24, r25 2bb18: 99 0f add r25, r25 2bb1a: 99 0b sbc r25, r25 2bb1c: aa 0b sbc r26, r26 2bb1e: bb 0b sbc r27, r27 2bb20: 84 0f add r24, r20 2bb22: 95 1f adc r25, r21 2bb24: a6 1f adc r26, r22 2bb26: b7 1f adc r27, r23 2bb28: 80 93 6a 07 sts 0x076A, r24 ; 0x80076a 2bb2c: 90 93 6b 07 sts 0x076B, r25 ; 0x80076b 2bb30: a0 93 6c 07 sts 0x076C, r26 ; 0x80076c 2bb34: b0 93 6d 07 sts 0x076D, r27 ; 0x80076d STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 2bb38: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bb3c: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2bb40: 80 91 8c 05 lds r24, 0x058C ; 0x80058c 2bb44: 90 91 8d 05 lds r25, 0x058D ; 0x80058d 2bb48: 24 85 ldd r18, Z+12 ; 0x0c 2bb4a: 35 85 ldd r19, Z+13 ; 0x0d 2bb4c: 82 0f add r24, r18 2bb4e: 93 1f adc r25, r19 2bb50: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 2bb54: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c 2bb58: 20 89 ldd r18, Z+16 ; 0x10 2bb5a: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 2bb5c: 18 16 cp r1, r24 2bb5e: 19 06 cpc r1, r25 2bb60: 44 f5 brge .+80 ; 0x2bbb2 <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 2bb62: 82 1b sub r24, r18 2bb64: 93 0b sbc r25, r19 2bb66: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 2bb6a: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c count_position[E_AXIS] += count_direction[E_AXIS]; 2bb6e: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bb72: 40 91 6e 07 lds r20, 0x076E ; 0x80076e 2bb76: 50 91 6f 07 lds r21, 0x076F ; 0x80076f 2bb7a: 60 91 70 07 lds r22, 0x0770 ; 0x800770 2bb7e: 70 91 71 07 lds r23, 0x0771 ; 0x800771 2bb82: 89 2f mov r24, r25 2bb84: 99 0f add r25, r25 2bb86: 99 0b sbc r25, r25 2bb88: aa 0b sbc r26, r26 2bb8a: bb 0b sbc r27, r27 2bb8c: 84 0f add r24, r20 2bb8e: 95 1f adc r25, r21 2bb90: a6 1f adc r26, r22 2bb92: b7 1f adc r27, r23 2bb94: 80 93 6e 07 sts 0x076E, r24 ; 0x80076e 2bb98: 90 93 6f 07 sts 0x076F, r25 ; 0x80076f 2bb9c: a0 93 70 07 sts 0x0770, r26 ; 0x800770 2bba0: b0 93 71 07 sts 0x0771, r27 ; 0x800771 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2bba4: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bba8: 80 91 91 05 lds r24, 0x0591 ; 0x800591 2bbac: 89 0f add r24, r25 2bbae: 80 93 91 05 sts 0x0591, r24 ; 0x800591 fsensor.stStep(count_direction[E_AXIS] < 0); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) STEP_NC_LO(E_AXIS); #endif } if(++ step_events_completed.lo >= current_block->step_event_count.lo) 2bbb2: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 2bbb6: 90 91 7c 05 lds r25, 0x057C ; 0x80057c 2bbba: 01 96 adiw r24, 0x01 ; 1 2bbbc: 90 93 7c 05 sts 0x057C, r25 ; 0x80057c 2bbc0: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b 2bbc4: 82 17 cp r24, r18 2bbc6: 93 07 cpc r25, r19 2bbc8: 08 f0 brcs .+2 ; 0x2bbcc <__vector_17+0x810> 2bbca: 71 c1 rjmp .+738 ; 0x2beae <__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) 2bbcc: cf 5f subi r28, 0xFF ; 255 2bbce: f8 ce rjmp .-528 ; 0x2b9c0 <__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) 2bbd0: 80 91 98 05 lds r24, 0x0598 ; 0x800598 2bbd4: c8 17 cp r28, r24 2bbd6: 08 f0 brcs .+2 ; 0x2bbda <__vector_17+0x81e> 2bbd8: 6a c1 rjmp .+724 ; 0x2beae <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2bbda: 0f 94 57 22 call 0x244ae ; 0x244ae // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 2bbde: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bbe2: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2bbe6: 80 81 ld r24, Z 2bbe8: 91 81 ldd r25, Z+1 ; 0x01 2bbea: a2 81 ldd r26, Z+2 ; 0x02 2bbec: b3 81 ldd r27, Z+3 ; 0x03 2bbee: 40 91 80 05 lds r20, 0x0580 ; 0x800580 2bbf2: 50 91 81 05 lds r21, 0x0581 ; 0x800581 2bbf6: 60 91 82 05 lds r22, 0x0582 ; 0x800582 2bbfa: 70 91 83 05 lds r23, 0x0583 ; 0x800583 2bbfe: 84 0f add r24, r20 2bc00: 95 1f adc r25, r21 2bc02: a6 1f adc r26, r22 2bc04: b7 1f adc r27, r23 2bc06: 80 93 80 05 sts 0x0580, r24 ; 0x800580 2bc0a: 90 93 81 05 sts 0x0581, r25 ; 0x800581 2bc0e: a0 93 82 05 sts 0x0582, r26 ; 0x800582 2bc12: b0 93 83 05 sts 0x0583, r27 ; 0x800583 if (counter[X_AXIS].wide > 0) { 2bc16: 18 16 cp r1, r24 2bc18: 19 06 cpc r1, r25 2bc1a: 1a 06 cpc r1, r26 2bc1c: 1b 06 cpc r1, r27 2bc1e: c4 f5 brge .+112 ; 0x2bc90 <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 2bc20: 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; 2bc22: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bc26: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2bc2a: 80 91 80 05 lds r24, 0x0580 ; 0x800580 2bc2e: 90 91 81 05 lds r25, 0x0581 ; 0x800581 2bc32: a0 91 82 05 lds r26, 0x0582 ; 0x800582 2bc36: b0 91 83 05 lds r27, 0x0583 ; 0x800583 2bc3a: 40 89 ldd r20, Z+16 ; 0x10 2bc3c: 51 89 ldd r21, Z+17 ; 0x11 2bc3e: 62 89 ldd r22, Z+18 ; 0x12 2bc40: 73 89 ldd r23, Z+19 ; 0x13 2bc42: 84 1b sub r24, r20 2bc44: 95 0b sbc r25, r21 2bc46: a6 0b sbc r26, r22 2bc48: b7 0b sbc r27, r23 2bc4a: 80 93 80 05 sts 0x0580, r24 ; 0x800580 2bc4e: 90 93 81 05 sts 0x0581, r25 ; 0x800581 2bc52: a0 93 82 05 sts 0x0582, r26 ; 0x800582 2bc56: b0 93 83 05 sts 0x0583, r27 ; 0x800583 count_position[X_AXIS]+=count_direction[X_AXIS]; 2bc5a: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2bc5e: 40 91 62 07 lds r20, 0x0762 ; 0x800762 2bc62: 50 91 63 07 lds r21, 0x0763 ; 0x800763 2bc66: 60 91 64 07 lds r22, 0x0764 ; 0x800764 2bc6a: 70 91 65 07 lds r23, 0x0765 ; 0x800765 2bc6e: 89 2f mov r24, r25 2bc70: 99 0f add r25, r25 2bc72: 99 0b sbc r25, r25 2bc74: aa 0b sbc r26, r26 2bc76: bb 0b sbc r27, r27 2bc78: 84 0f add r24, r20 2bc7a: 95 1f adc r25, r21 2bc7c: a6 1f adc r26, r22 2bc7e: b7 1f adc r27, r23 2bc80: 80 93 62 07 sts 0x0762, r24 ; 0x800762 2bc84: 90 93 63 07 sts 0x0763, r25 ; 0x800763 2bc88: a0 93 64 07 sts 0x0764, r26 ; 0x800764 2bc8c: b0 93 65 07 sts 0x0765, r27 ; 0x800765 #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; 2bc90: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bc94: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2bc98: 84 81 ldd r24, Z+4 ; 0x04 2bc9a: 95 81 ldd r25, Z+5 ; 0x05 2bc9c: a6 81 ldd r26, Z+6 ; 0x06 2bc9e: b7 81 ldd r27, Z+7 ; 0x07 2bca0: 40 91 84 05 lds r20, 0x0584 ; 0x800584 2bca4: 50 91 85 05 lds r21, 0x0585 ; 0x800585 2bca8: 60 91 86 05 lds r22, 0x0586 ; 0x800586 2bcac: 70 91 87 05 lds r23, 0x0587 ; 0x800587 2bcb0: 84 0f add r24, r20 2bcb2: 95 1f adc r25, r21 2bcb4: a6 1f adc r26, r22 2bcb6: b7 1f adc r27, r23 2bcb8: 80 93 84 05 sts 0x0584, r24 ; 0x800584 2bcbc: 90 93 85 05 sts 0x0585, r25 ; 0x800585 2bcc0: a0 93 86 05 sts 0x0586, r26 ; 0x800586 2bcc4: b0 93 87 05 sts 0x0587, r27 ; 0x800587 if (counter[Y_AXIS].wide > 0) { 2bcc8: 18 16 cp r1, r24 2bcca: 19 06 cpc r1, r25 2bccc: 1a 06 cpc r1, r26 2bcce: 1b 06 cpc r1, r27 2bcd0: 84 f5 brge .+96 ; 0x2bd32 <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 2bcd2: 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; 2bcd4: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bcd8: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2bcdc: 40 89 ldd r20, Z+16 ; 0x10 2bcde: 51 89 ldd r21, Z+17 ; 0x11 2bce0: 62 89 ldd r22, Z+18 ; 0x12 2bce2: 73 89 ldd r23, Z+19 ; 0x13 2bce4: 84 1b sub r24, r20 2bce6: 95 0b sbc r25, r21 2bce8: a6 0b sbc r26, r22 2bcea: b7 0b sbc r27, r23 2bcec: 80 93 84 05 sts 0x0584, r24 ; 0x800584 2bcf0: 90 93 85 05 sts 0x0585, r25 ; 0x800585 2bcf4: a0 93 86 05 sts 0x0586, r26 ; 0x800586 2bcf8: b0 93 87 05 sts 0x0587, r27 ; 0x800587 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2bcfc: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2bd00: 40 91 66 07 lds r20, 0x0766 ; 0x800766 2bd04: 50 91 67 07 lds r21, 0x0767 ; 0x800767 2bd08: 60 91 68 07 lds r22, 0x0768 ; 0x800768 2bd0c: 70 91 69 07 lds r23, 0x0769 ; 0x800769 2bd10: 89 2f mov r24, r25 2bd12: 99 0f add r25, r25 2bd14: 99 0b sbc r25, r25 2bd16: aa 0b sbc r26, r26 2bd18: bb 0b sbc r27, r27 2bd1a: 84 0f add r24, r20 2bd1c: 95 1f adc r25, r21 2bd1e: a6 1f adc r26, r22 2bd20: b7 1f adc r27, r23 2bd22: 80 93 66 07 sts 0x0766, r24 ; 0x800766 2bd26: 90 93 67 07 sts 0x0767, r25 ; 0x800767 2bd2a: a0 93 68 07 sts 0x0768, r26 ; 0x800768 2bd2e: b0 93 69 07 sts 0x0769, r27 ; 0x800769 #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; 2bd32: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bd36: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2bd3a: 80 85 ldd r24, Z+8 ; 0x08 2bd3c: 91 85 ldd r25, Z+9 ; 0x09 2bd3e: a2 85 ldd r26, Z+10 ; 0x0a 2bd40: b3 85 ldd r27, Z+11 ; 0x0b 2bd42: 40 91 88 05 lds r20, 0x0588 ; 0x800588 2bd46: 50 91 89 05 lds r21, 0x0589 ; 0x800589 2bd4a: 60 91 8a 05 lds r22, 0x058A ; 0x80058a 2bd4e: 70 91 8b 05 lds r23, 0x058B ; 0x80058b 2bd52: 84 0f add r24, r20 2bd54: 95 1f adc r25, r21 2bd56: a6 1f adc r26, r22 2bd58: b7 1f adc r27, r23 2bd5a: 80 93 88 05 sts 0x0588, r24 ; 0x800588 2bd5e: 90 93 89 05 sts 0x0589, r25 ; 0x800589 2bd62: a0 93 8a 05 sts 0x058A, r26 ; 0x80058a 2bd66: b0 93 8b 05 sts 0x058B, r27 ; 0x80058b if (counter[Z_AXIS].wide > 0) { 2bd6a: 18 16 cp r1, r24 2bd6c: 19 06 cpc r1, r25 2bd6e: 1a 06 cpc r1, r26 2bd70: 1b 06 cpc r1, r27 2bd72: 84 f5 brge .+96 ; 0x2bdd4 <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 2bd74: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 2bd76: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bd7a: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2bd7e: 40 89 ldd r20, Z+16 ; 0x10 2bd80: 51 89 ldd r21, Z+17 ; 0x11 2bd82: 62 89 ldd r22, Z+18 ; 0x12 2bd84: 73 89 ldd r23, Z+19 ; 0x13 2bd86: 84 1b sub r24, r20 2bd88: 95 0b sbc r25, r21 2bd8a: a6 0b sbc r26, r22 2bd8c: b7 0b sbc r27, r23 2bd8e: 80 93 88 05 sts 0x0588, r24 ; 0x800588 2bd92: 90 93 89 05 sts 0x0589, r25 ; 0x800589 2bd96: a0 93 8a 05 sts 0x058A, r26 ; 0x80058a 2bd9a: b0 93 8b 05 sts 0x058B, r27 ; 0x80058b count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2bd9e: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2bda2: 40 91 6a 07 lds r20, 0x076A ; 0x80076a 2bda6: 50 91 6b 07 lds r21, 0x076B ; 0x80076b 2bdaa: 60 91 6c 07 lds r22, 0x076C ; 0x80076c 2bdae: 70 91 6d 07 lds r23, 0x076D ; 0x80076d 2bdb2: 89 2f mov r24, r25 2bdb4: 99 0f add r25, r25 2bdb6: 99 0b sbc r25, r25 2bdb8: aa 0b sbc r26, r26 2bdba: bb 0b sbc r27, r27 2bdbc: 84 0f add r24, r20 2bdbe: 95 1f adc r25, r21 2bdc0: a6 1f adc r26, r22 2bdc2: b7 1f adc r27, r23 2bdc4: 80 93 6a 07 sts 0x076A, r24 ; 0x80076a 2bdc8: 90 93 6b 07 sts 0x076B, r25 ; 0x80076b 2bdcc: a0 93 6c 07 sts 0x076C, r26 ; 0x80076c 2bdd0: b0 93 6d 07 sts 0x076D, r27 ; 0x80076d STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 2bdd4: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2bdd8: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2bddc: 80 91 8c 05 lds r24, 0x058C ; 0x80058c 2bde0: 90 91 8d 05 lds r25, 0x058D ; 0x80058d 2bde4: a0 91 8e 05 lds r26, 0x058E ; 0x80058e 2bde8: b0 91 8f 05 lds r27, 0x058F ; 0x80058f 2bdec: 44 85 ldd r20, Z+12 ; 0x0c 2bdee: 55 85 ldd r21, Z+13 ; 0x0d 2bdf0: 66 85 ldd r22, Z+14 ; 0x0e 2bdf2: 77 85 ldd r23, Z+15 ; 0x0f 2bdf4: 84 0f add r24, r20 2bdf6: 95 1f adc r25, r21 2bdf8: a6 1f adc r26, r22 2bdfa: b7 1f adc r27, r23 2bdfc: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c 2be00: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 2be04: a0 93 8e 05 sts 0x058E, r26 ; 0x80058e 2be08: b0 93 8f 05 sts 0x058F, r27 ; 0x80058f 2be0c: 40 89 ldd r20, Z+16 ; 0x10 2be0e: 51 89 ldd r21, Z+17 ; 0x11 2be10: 62 89 ldd r22, Z+18 ; 0x12 2be12: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 2be14: 18 16 cp r1, r24 2be16: 19 06 cpc r1, r25 2be18: 1a 06 cpc r1, r26 2be1a: 1b 06 cpc r1, r27 2be1c: 74 f5 brge .+92 ; 0x2be7a <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 2be1e: 84 1b sub r24, r20 2be20: 95 0b sbc r25, r21 2be22: a6 0b sbc r26, r22 2be24: b7 0b sbc r27, r23 2be26: 80 93 8c 05 sts 0x058C, r24 ; 0x80058c 2be2a: 90 93 8d 05 sts 0x058D, r25 ; 0x80058d 2be2e: a0 93 8e 05 sts 0x058E, r26 ; 0x80058e 2be32: b0 93 8f 05 sts 0x058F, r27 ; 0x80058f count_position[E_AXIS] += count_direction[E_AXIS]; 2be36: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2be3a: c0 90 6e 07 lds r12, 0x076E ; 0x80076e 2be3e: d0 90 6f 07 lds r13, 0x076F ; 0x80076f 2be42: e0 90 70 07 lds r14, 0x0770 ; 0x800770 2be46: f0 90 71 07 lds r15, 0x0771 ; 0x800771 2be4a: 89 2f mov r24, r25 2be4c: 99 0f add r25, r25 2be4e: 99 0b sbc r25, r25 2be50: aa 0b sbc r26, r26 2be52: bb 0b sbc r27, r27 2be54: 8c 0d add r24, r12 2be56: 9d 1d adc r25, r13 2be58: ae 1d adc r26, r14 2be5a: bf 1d adc r27, r15 2be5c: 80 93 6e 07 sts 0x076E, r24 ; 0x80076e 2be60: 90 93 6f 07 sts 0x076F, r25 ; 0x80076f 2be64: a0 93 70 07 sts 0x0770, r26 ; 0x800770 2be68: b0 93 71 07 sts 0x0771, r27 ; 0x800771 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2be6c: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2be70: 80 91 91 05 lds r24, 0x0591 ; 0x800591 2be74: 89 0f add r24, r25 2be76: 80 93 91 05 sts 0x0591, r24 ; 0x800591 fsensor.stStep(count_direction[E_AXIS] < 0); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) STEP_NC_LO(E_AXIS); #endif } if(++ step_events_completed.wide >= current_block->step_event_count.wide) 2be7a: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 2be7e: 90 91 7c 05 lds r25, 0x057C ; 0x80057c 2be82: a0 91 7d 05 lds r26, 0x057D ; 0x80057d 2be86: b0 91 7e 05 lds r27, 0x057E ; 0x80057e 2be8a: 01 96 adiw r24, 0x01 ; 1 2be8c: a1 1d adc r26, r1 2be8e: b1 1d adc r27, r1 2be90: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b 2be94: 90 93 7c 05 sts 0x057C, r25 ; 0x80057c 2be98: a0 93 7d 05 sts 0x057D, r26 ; 0x80057d 2be9c: b0 93 7e 05 sts 0x057E, r27 ; 0x80057e 2bea0: 84 17 cp r24, r20 2bea2: 95 07 cpc r25, r21 2bea4: a6 07 cpc r26, r22 2bea6: b7 07 cpc r27, r23 2bea8: 10 f4 brcc .+4 ; 0x2beae <__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) 2beaa: cf 5f subi r28, 0xFF ; 255 2beac: 91 ce rjmp .-734 ; 0x2bbd0 <__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); 2beae: 80 91 91 05 lds r24, 0x0591 ; 0x800591 2beb2: 88 23 and r24, r24 2beb4: 39 f0 breq .+14 ; 0x2bec4 <__vector_17+0xb08> 2beb6: 87 fd sbrc r24, 7 2beb8: ee c0 rjmp .+476 ; 0x2c096 <__vector_17+0xcda> 2beba: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2bebe: 80 64 ori r24, 0x40 ; 64 2bec0: 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) { 2bec4: 40 91 7b 05 lds r20, 0x057B ; 0x80057b 2bec8: 50 91 7c 05 lds r21, 0x057C ; 0x80057c 2becc: 60 91 7d 05 lds r22, 0x057D ; 0x80057d 2bed0: 70 91 7e 05 lds r23, 0x057E ; 0x80057e 2bed4: c0 91 a0 05 lds r28, 0x05A0 ; 0x8005a0 2bed8: d0 91 a1 05 lds r29, 0x05A1 ; 0x8005a1 2bedc: 89 8d ldd r24, Y+25 ; 0x19 2bede: 9a 8d ldd r25, Y+26 ; 0x1a 2bee0: ab 8d ldd r26, Y+27 ; 0x1b 2bee2: bc 8d ldd r27, Y+28 ; 0x1c 2bee4: 84 17 cp r24, r20 2bee6: 95 07 cpc r25, r21 2bee8: a6 07 cpc r26, r22 2beea: b7 07 cpc r27, r23 2beec: 08 f4 brcc .+2 ; 0x2bef0 <__vector_17+0xb34> 2beee: 34 c1 rjmp .+616 ; 0x2c158 <__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); 2bef0: 40 91 94 05 lds r20, 0x0594 ; 0x800594 2bef4: 50 91 95 05 lds r21, 0x0595 ; 0x800595 2bef8: 60 91 96 05 lds r22, 0x0596 ; 0x800596 2befc: 70 91 97 05 lds r23, 0x0597 ; 0x800597 "adc %B0, r26 \n\t" "clr r1 \n\t" : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1", "r26" , "r27" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. R26 is __zero_reg__, R27 is a temporary register. ); 2bf00: cc 88 ldd r12, Y+20 ; 0x14 2bf02: dd 88 ldd r13, Y+21 ; 0x15 2bf04: ee 88 ldd r14, Y+22 ; 0x16 2bf06: aa 27 eor r26, r26 2bf08: 4d 9d mul r20, r13 2bf0a: b1 2d mov r27, r1 2bf0c: 5e 9d mul r21, r14 2bf0e: c0 01 movw r24, r0 2bf10: 6e 9d mul r22, r14 2bf12: 90 0d add r25, r0 2bf14: 6d 9d mul r22, r13 2bf16: 80 0d add r24, r0 2bf18: 91 1d adc r25, r1 2bf1a: 4e 9d mul r20, r14 2bf1c: b0 0d add r27, r0 2bf1e: 81 1d adc r24, r1 2bf20: 9a 1f adc r25, r26 2bf22: 5d 9d mul r21, r13 2bf24: b0 0d add r27, r0 2bf26: 81 1d adc r24, r1 2bf28: 9a 1f adc r25, r26 2bf2a: 6c 9d mul r22, r12 2bf2c: b0 0d add r27, r0 2bf2e: 81 1d adc r24, r1 2bf30: 9a 1f adc r25, r26 2bf32: 5c 9d mul r21, r12 2bf34: b1 0d add r27, r1 2bf36: 8a 1f adc r24, r26 2bf38: 9a 1f adc r25, r26 2bf3a: bb 0f add r27, r27 2bf3c: 8a 1f adc r24, r26 2bf3e: 9a 1f adc r25, r26 2bf40: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 2bf42: 2a ad ldd r18, Y+58 ; 0x3a 2bf44: 3b ad ldd r19, Y+59 ; 0x3b 2bf46: 82 0f add r24, r18 2bf48: 93 1f adc r25, r19 2bf4a: 90 93 9a 05 sts 0x059A, r25 ; 0x80059a 2bf4e: 80 93 99 05 sts 0x0599, r24 ; 0x800599 // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 2bf52: 2e a9 ldd r18, Y+54 ; 0x36 2bf54: 3f a9 ldd r19, Y+55 ; 0x37 2bf56: 28 17 cp r18, r24 2bf58: 39 07 cpc r19, r25 2bf5a: 20 f4 brcc .+8 ; 0x2bf64 <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 2bf5c: 30 93 9a 05 sts 0x059A, r19 ; 0x80059a 2bf60: 20 93 99 05 sts 0x0599, r18 ; 0x800599 // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 2bf64: 80 91 99 05 lds r24, 0x0599 ; 0x800599 2bf68: 90 91 9a 05 lds r25, 0x059A ; 0x80059a #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2bf6c: 81 34 cpi r24, 0x41 ; 65 2bf6e: fc e9 ldi r31, 0x9C ; 156 2bf70: 9f 07 cpc r25, r31 2bf72: 08 f0 brcs .+2 ; 0x2bf76 <__vector_17+0xbba> 2bf74: 94 c0 rjmp .+296 ; 0x2c09e <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2bf76: 81 32 cpi r24, 0x21 ; 33 2bf78: 2e e4 ldi r18, 0x4E ; 78 2bf7a: 92 07 cpc r25, r18 2bf7c: 08 f4 brcc .+2 ; 0x2bf80 <__vector_17+0xbc4> 2bf7e: 92 c0 rjmp .+292 ; 0x2c0a4 <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 2bf80: 96 95 lsr r25 2bf82: 87 95 ror r24 2bf84: 96 95 lsr r25 2bf86: 87 95 ror r24 step_loops = 4; 2bf88: 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; 2bf8a: 20 93 98 05 sts 0x0598, r18 ; 0x800598 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2bf8e: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2bf90: 81 15 cp r24, r1 2bf92: f8 e0 ldi r31, 0x08 ; 8 2bf94: 9f 07 cpc r25, r31 2bf96: 08 f4 brcc .+2 ; 0x2bf9a <__vector_17+0xbde> 2bf98: 97 c0 rjmp .+302 ; 0x2c0c8 <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2bf9a: e9 2f mov r30, r25 2bf9c: ff 27 eor r31, r31 2bf9e: ee 0f add r30, r30 2bfa0: ff 1f adc r31, r31 2bfa2: ee 0f add r30, r30 2bfa4: ff 1f adc r31, r31 2bfa6: 9f 01 movw r18, r30 2bfa8: 20 56 subi r18, 0x60 ; 96 2bfaa: 39 46 sbci r19, 0x69 ; 105 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2bfac: f9 01 movw r30, r18 2bfae: 32 96 adiw r30, 0x02 ; 2 2bfb0: a5 91 lpm r26, Z+ 2bfb2: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2bfb4: f9 01 movw r30, r18 2bfb6: 25 91 lpm r18, Z+ 2bfb8: 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. ); 2bfba: b8 9f mul r27, r24 2bfbc: f0 01 movw r30, r0 2bfbe: a8 9f mul r26, r24 2bfc0: 00 0c add r0, r0 2bfc2: e1 1d adc r30, r1 2bfc4: 11 24 eor r1, r1 2bfc6: 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); 2bfc8: c9 01 movw r24, r18 2bfca: 8e 1b sub r24, r30 2bfcc: 9f 0b sbc r25, r31 2bfce: 84 36 cpi r24, 0x64 ; 100 2bfd0: 91 05 cpc r25, r1 2bfd2: 10 f4 brcc .+4 ; 0x2bfd8 <__vector_17+0xc1c> 2bfd4: 84 e6 ldi r24, 0x64 ; 100 2bfd6: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 2bfd8: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2bfdc: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> 2bfe0: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL9main_Rate.lto_priv.494+0x1> 2bfe4: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL9main_Rate.lto_priv.494> acceleration_time += timer; 2bfe8: 48 0f add r20, r24 2bfea: 59 1f adc r21, r25 2bfec: 61 1d adc r22, r1 2bfee: 71 1d adc r23, r1 2bff0: 40 93 94 05 sts 0x0594, r20 ; 0x800594 2bff4: 50 93 95 05 sts 0x0595, r21 ; 0x800595 2bff8: 60 93 96 05 sts 0x0596, r22 ; 0x800596 2bffc: 70 93 97 05 sts 0x0597, r23 ; 0x800597 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2c000: fe 01 movw r30, r28 2c002: e4 5b subi r30, 0xB4 ; 180 2c004: ff 4f sbci r31, 0xFF ; 255 2c006: 80 81 ld r24, Z 2c008: 81 11 cpse r24, r1 2c00a: 7d c0 rjmp .+250 ; 0x2c106 <__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; 2c00c: 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) { 2c00e: 80 ff sbrs r24, 0 2c010: 16 c0 rjmp .+44 ; 0x2c03e <__vector_17+0xc82> LA_phase = -1; 2c012: 9f ef ldi r25, 0xFF ; 255 2c014: 90 93 90 05 sts 0x0590, r25 ; 0x800590 if (current_adv_steps == target_adv_steps) { 2c018: e0 91 e0 04 lds r30, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2c01c: f0 91 e1 04 lds r31, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c020: 20 91 92 05 lds r18, 0x0592 ; 0x800592 2c024: 30 91 93 05 lds r19, 0x0593 ; 0x800593 2c028: e2 17 cp r30, r18 2c02a: f3 07 cpc r31, r19 2c02c: 09 f0 breq .+2 ; 0x2c030 <__vector_17+0xc74> 2c02e: 24 c2 rjmp .+1096 ; 0x2c478 <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 2c030: 8f ef ldi r24, 0xFF ; 255 2c032: 9f ef ldi r25, 0xFF ; 255 2c034: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c038: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> 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; 2c03c: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 2c03e: 80 fd sbrc r24, 0 2c040: 07 c0 rjmp .+14 ; 0x2c050 <__vector_17+0xc94> 2c042: 80 91 e4 04 lds r24, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> 2c046: 90 91 e5 04 lds r25, 0x04E5 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c04a: 01 96 adiw r24, 0x01 ; 1 2c04c: 09 f4 brne .+2 ; 0x2c050 <__vector_17+0xc94> 2c04e: b2 c2 rjmp .+1380 ; 0x2c5b4 <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 2c050: e0 91 e2 04 lds r30, 0x04E2 ; 0x8004e2 <_ZL9main_Rate.lto_priv.494> 2c054: f0 91 e3 04 lds r31, 0x04E3 ; 0x8004e3 <_ZL9main_Rate.lto_priv.494+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 2c058: 80 91 71 05 lds r24, 0x0571 ; 0x800571 2c05c: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c060: a0 91 73 05 lds r26, 0x0573 ; 0x800573 2c064: b0 91 74 05 lds r27, 0x0574 ; 0x800574 2c068: 8e 0f add r24, r30 2c06a: 9f 1f adc r25, r31 2c06c: a1 1d adc r26, r1 2c06e: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 2c070: c3 5b subi r28, 0xB3 ; 179 2c072: df 4f sbci r29, 0xFF ; 255 2c074: 08 81 ld r16, Y 2c076: 19 81 ldd r17, Y+1 ; 0x01 2c078: 30 e0 ldi r19, 0x00 ; 0 2c07a: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 2c07c: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 2c07e: 80 17 cp r24, r16 2c080: 91 07 cpc r25, r17 2c082: a2 07 cpc r26, r18 2c084: b3 07 cpc r27, r19 2c086: 08 f4 brcc .+2 ; 0x2c08a <__vector_17+0xcce> 2c088: 27 c2 rjmp .+1102 ; 0x2c4d8 <__vector_17+0x111c> { ++ticks; 2c08a: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 2c08c: 80 1b sub r24, r16 2c08e: 91 0b sbc r25, r17 2c090: a2 0b sbc r26, r18 2c092: b3 0b sbc r27, r19 2c094: f4 cf rjmp .-24 ; 0x2c07e <__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); 2c096: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c09a: 8f 7b andi r24, 0xBF ; 191 2c09c: 11 cf rjmp .-478 ; 0x2bec0 <__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; 2c09e: 80 e4 ldi r24, 0x40 ; 64 2c0a0: 9c e9 ldi r25, 0x9C ; 156 2c0a2: 6e cf rjmp .-292 ; 0x2bf80 <__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 2c0a4: 81 31 cpi r24, 0x11 ; 17 2c0a6: e7 e2 ldi r30, 0x27 ; 39 2c0a8: 9e 07 cpc r25, r30 2c0aa: 20 f0 brcs .+8 ; 0x2c0b4 <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 2c0ac: 96 95 lsr r25 2c0ae: 87 95 ror r24 step_loops = 2; 2c0b0: 22 e0 ldi r18, 0x02 ; 2 2c0b2: 6b cf rjmp .-298 ; 0x2bf8a <__vector_17+0xbce> } else { step_loops = 1; 2c0b4: 21 e0 ldi r18, 0x01 ; 1 2c0b6: 20 93 98 05 sts 0x0598, r18 ; 0x800598 2c0ba: 80 32 cpi r24, 0x20 ; 32 2c0bc: 91 05 cpc r25, r1 2c0be: 08 f0 brcs .+2 ; 0x2c0c2 <__vector_17+0xd06> 2c0c0: 66 cf rjmp .-308 ; 0x2bf8e <__vector_17+0xbd2> 2c0c2: 80 e2 ldi r24, 0x20 ; 32 2c0c4: 90 e0 ldi r25, 0x00 ; 0 2c0c6: 63 cf rjmp .-314 ; 0x2bf8e <__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; 2c0c8: 9c 01 movw r18, r24 2c0ca: 36 95 lsr r19 2c0cc: 27 95 ror r18 2c0ce: 2c 7f andi r18, 0xFC ; 252 2c0d0: 20 56 subi r18, 0x60 ; 96 2c0d2: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c0d4: f9 01 movw r30, r18 2c0d6: a5 91 lpm r26, Z+ 2c0d8: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c0da: f9 01 movw r30, r18 2c0dc: 32 96 adiw r30, 0x02 ; 2 2c0de: 05 91 lpm r16, Z+ 2c0e0: 14 91 lpm r17, Z 2c0e2: 87 70 andi r24, 0x07 ; 7 2c0e4: 99 27 eor r25, r25 2c0e6: 80 9f mul r24, r16 2c0e8: 90 01 movw r18, r0 2c0ea: 81 9f mul r24, r17 2c0ec: 30 0d add r19, r0 2c0ee: 90 9f mul r25, r16 2c0f0: 30 0d add r19, r0 2c0f2: 11 24 eor r1, r1 2c0f4: f3 e0 ldi r31, 0x03 ; 3 2c0f6: 36 95 lsr r19 2c0f8: 27 95 ror r18 2c0fa: fa 95 dec r31 2c0fc: e1 f7 brne .-8 ; 0x2c0f6 <__vector_17+0xd3a> 2c0fe: cd 01 movw r24, r26 2c100: 82 1b sub r24, r18 2c102: 93 0b sbc r25, r19 2c104: 64 cf rjmp .-312 ; 0x2bfce <__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) { 2c106: 40 91 7b 05 lds r20, 0x057B ; 0x80057b 2c10a: 50 91 7c 05 lds r21, 0x057C ; 0x80057c 2c10e: 60 91 7d 05 lds r22, 0x057D ; 0x80057d 2c112: 70 91 7e 05 lds r23, 0x057E ; 0x80057e 2c116: 80 91 98 05 lds r24, 0x0598 ; 0x800598 2c11a: 90 e0 ldi r25, 0x00 ; 0 2c11c: b0 e0 ldi r27, 0x00 ; 0 2c11e: a0 e0 ldi r26, 0x00 ; 0 2c120: 84 17 cp r24, r20 2c122: 95 07 cpc r25, r21 2c124: a6 07 cpc r26, r22 2c126: b7 07 cpc r27, r23 2c128: 08 f4 brcc .+2 ; 0x2c12c <__vector_17+0xd70> 2c12a: 70 cf rjmp .-288 ; 0x2c00c <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 2c12c: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2c130: 81 11 cpse r24, r1 2c132: 02 c0 rjmp .+4 ; 0x2c138 <__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; 2c134: 83 e0 ldi r24, 0x03 ; 3 2c136: 6b cf rjmp .-298 ; 0x2c00e <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 2c138: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2c13c: 90 91 e1 04 lds r25, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c140: 20 91 92 05 lds r18, 0x0592 ; 0x800592 2c144: 30 91 93 05 lds r19, 0x0593 ; 0x800593 2c148: 28 17 cp r18, r24 2c14a: 39 07 cpc r19, r25 2c14c: 98 f7 brcc .-26 ; 0x2c134 <__vector_17+0xd78> target_adv_steps = current_adv_steps; 2c14e: 90 93 93 05 sts 0x0593, r25 ; 0x800593 2c152: 80 93 92 05 sts 0x0592, r24 ; 0x800592 2c156: ee cf rjmp .-36 ; 0x2c134 <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 2c158: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 2c15c: 90 91 7c 05 lds r25, 0x057C ; 0x80057c 2c160: a0 91 7d 05 lds r26, 0x057D ; 0x80057d 2c164: b0 91 7e 05 lds r27, 0x057E ; 0x80057e 2c168: 4d 8d ldd r20, Y+29 ; 0x1d 2c16a: 5e 8d ldd r21, Y+30 ; 0x1e 2c16c: 6f 8d ldd r22, Y+31 ; 0x1f 2c16e: 78 a1 ldd r23, Y+32 ; 0x20 2c170: 48 17 cp r20, r24 2c172: 59 07 cpc r21, r25 2c174: 6a 07 cpc r22, r26 2c176: 7b 07 cpc r23, r27 2c178: 08 f0 brcs .+2 ; 0x2c17c <__vector_17+0xdc0> 2c17a: e3 c0 rjmp .+454 ; 0x2c342 <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 2c17c: c0 90 9c 05 lds r12, 0x059C ; 0x80059c 2c180: d0 90 9d 05 lds r13, 0x059D ; 0x80059d 2c184: e0 90 9e 05 lds r14, 0x059E ; 0x80059e 2c188: f0 90 9f 05 lds r15, 0x059F ; 0x80059f "adc %B0, r26 \n\t" "clr r1 \n\t" : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1", "r26" , "r27" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. R26 is __zero_reg__, R27 is a temporary register. ); 2c18c: 6c 88 ldd r6, Y+20 ; 0x14 2c18e: 7d 88 ldd r7, Y+21 ; 0x15 2c190: 8e 88 ldd r8, Y+22 ; 0x16 2c192: aa 27 eor r26, r26 2c194: c7 9c mul r12, r7 2c196: b1 2d mov r27, r1 2c198: d8 9c mul r13, r8 2c19a: f0 01 movw r30, r0 2c19c: e8 9c mul r14, r8 2c19e: f0 0d add r31, r0 2c1a0: e7 9c mul r14, r7 2c1a2: e0 0d add r30, r0 2c1a4: f1 1d adc r31, r1 2c1a6: c8 9c mul r12, r8 2c1a8: b0 0d add r27, r0 2c1aa: e1 1d adc r30, r1 2c1ac: fa 1f adc r31, r26 2c1ae: d7 9c mul r13, r7 2c1b0: b0 0d add r27, r0 2c1b2: e1 1d adc r30, r1 2c1b4: fa 1f adc r31, r26 2c1b6: e6 9c mul r14, r6 2c1b8: b0 0d add r27, r0 2c1ba: e1 1d adc r30, r1 2c1bc: fa 1f adc r31, r26 2c1be: d6 9c mul r13, r6 2c1c0: b1 0d add r27, r1 2c1c2: ea 1f adc r30, r26 2c1c4: fa 1f adc r31, r26 2c1c6: bb 0f add r27, r27 2c1c8: ea 1f adc r30, r26 2c1ca: fa 1f adc r31, r26 2c1cc: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 2c1ce: 20 91 99 05 lds r18, 0x0599 ; 0x800599 2c1d2: 30 91 9a 05 lds r19, 0x059A ; 0x80059a 2c1d6: 8e ad ldd r24, Y+62 ; 0x3e 2c1d8: 9f ad ldd r25, Y+63 ; 0x3f 2c1da: 2e 17 cp r18, r30 2c1dc: 3f 07 cpc r19, r31 2c1de: 30 f0 brcs .+12 ; 0x2c1ec <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 2c1e0: 2e 1b sub r18, r30 2c1e2: 3f 0b sbc r19, r31 2c1e4: 82 17 cp r24, r18 2c1e6: 93 07 cpc r25, r19 2c1e8: 08 f4 brcc .+2 ; 0x2c1ec <__vector_17+0xe30> 2c1ea: 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; 2c1ec: 81 34 cpi r24, 0x41 ; 65 2c1ee: 2c e9 ldi r18, 0x9C ; 156 2c1f0: 92 07 cpc r25, r18 2c1f2: 08 f0 brcs .+2 ; 0x2c1f6 <__vector_17+0xe3a> 2c1f4: 75 c0 rjmp .+234 ; 0x2c2e0 <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2c1f6: 81 32 cpi r24, 0x21 ; 33 2c1f8: ee e4 ldi r30, 0x4E ; 78 2c1fa: 9e 07 cpc r25, r30 2c1fc: 08 f4 brcc .+2 ; 0x2c200 <__vector_17+0xe44> 2c1fe: 73 c0 rjmp .+230 ; 0x2c2e6 <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 2c200: 96 95 lsr r25 2c202: 87 95 ror r24 2c204: 96 95 lsr r25 2c206: 87 95 ror r24 step_loops = 4; 2c208: 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; 2c20a: 20 93 98 05 sts 0x0598, r18 ; 0x800598 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c20e: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c210: 81 15 cp r24, r1 2c212: 28 e0 ldi r18, 0x08 ; 8 2c214: 92 07 cpc r25, r18 2c216: 08 f4 brcc .+2 ; 0x2c21a <__vector_17+0xe5e> 2c218: 78 c0 rjmp .+240 ; 0x2c30a <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c21a: e9 2f mov r30, r25 2c21c: ff 27 eor r31, r31 2c21e: ee 0f add r30, r30 2c220: ff 1f adc r31, r31 2c222: ee 0f add r30, r30 2c224: ff 1f adc r31, r31 2c226: 9f 01 movw r18, r30 2c228: 20 56 subi r18, 0x60 ; 96 2c22a: 39 46 sbci r19, 0x69 ; 105 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2c22c: f9 01 movw r30, r18 2c22e: 32 96 adiw r30, 0x02 ; 2 2c230: a5 91 lpm r26, Z+ 2c232: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c234: f9 01 movw r30, r18 2c236: 25 91 lpm r18, Z+ 2c238: 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. ); 2c23a: b8 9f mul r27, r24 2c23c: f0 01 movw r30, r0 2c23e: a8 9f mul r26, r24 2c240: 00 0c add r0, r0 2c242: e1 1d adc r30, r1 2c244: 11 24 eor r1, r1 2c246: 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); 2c248: 2e 1b sub r18, r30 2c24a: 3f 0b sbc r19, r31 2c24c: c9 01 movw r24, r18 2c24e: 24 36 cpi r18, 0x64 ; 100 2c250: 31 05 cpc r19, r1 2c252: 10 f4 brcc .+4 ; 0x2c258 <__vector_17+0xe9c> 2c254: 84 e6 ldi r24, 0x64 ; 100 2c256: 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); 2c258: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2c25c: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> 2c260: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL9main_Rate.lto_priv.494+0x1> 2c264: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL9main_Rate.lto_priv.494> deceleration_time += timer; 2c268: c8 0e add r12, r24 2c26a: d9 1e adc r13, r25 2c26c: e1 1c adc r14, r1 2c26e: f1 1c adc r15, r1 2c270: c0 92 9c 05 sts 0x059C, r12 ; 0x80059c 2c274: d0 92 9d 05 sts 0x059D, r13 ; 0x80059d 2c278: e0 92 9e 05 sts 0x059E, r14 ; 0x80059e 2c27c: f0 92 9f 05 sts 0x059F, r15 ; 0x80059f #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2c280: fe 01 movw r30, r28 2c282: e4 5b subi r30, 0xB4 ; 180 2c284: ff 4f sbci r31, 0xFF ; 255 2c286: 80 81 ld r24, Z 2c288: 88 23 and r24, r24 2c28a: 09 f4 brne .+2 ; 0x2c28e <__vector_17+0xed2> 2c28c: bf ce rjmp .-642 ; 0x2c00c <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 2c28e: 80 91 7b 05 lds r24, 0x057B ; 0x80057b 2c292: 90 91 7c 05 lds r25, 0x057C ; 0x80057c 2c296: a0 91 7d 05 lds r26, 0x057D ; 0x80057d 2c29a: b0 91 7e 05 lds r27, 0x057E ; 0x80057e 2c29e: 20 91 98 05 lds r18, 0x0598 ; 0x800598 2c2a2: 42 0f add r20, r18 2c2a4: 51 1d adc r21, r1 2c2a6: 61 1d adc r22, r1 2c2a8: 71 1d adc r23, r1 2c2aa: 48 17 cp r20, r24 2c2ac: 59 07 cpc r21, r25 2c2ae: 6a 07 cpc r22, r26 2c2b0: 7b 07 cpc r23, r27 2c2b2: 08 f4 brcc .+2 ; 0x2c2b6 <__vector_17+0xefa> 2c2b4: ab ce rjmp .-682 ; 0x2c00c <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 2c2b6: 35 96 adiw r30, 0x05 ; 5 2c2b8: 20 81 ld r18, Z 2c2ba: 31 81 ldd r19, Z+1 ; 0x01 2c2bc: 30 93 93 05 sts 0x0593, r19 ; 0x800593 2c2c0: 20 93 92 05 sts 0x0592, r18 ; 0x800592 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 2c2c4: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2c2c8: 88 23 and r24, r24 2c2ca: 09 f4 brne .+2 ; 0x2c2ce <__vector_17+0xf12> 2c2cc: 33 cf rjmp .-410 ; 0x2c134 <__vector_17+0xd78> 2c2ce: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2c2d2: 90 91 e1 04 lds r25, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c2d6: 82 17 cp r24, r18 2c2d8: 93 07 cpc r25, r19 2c2da: 08 f0 brcs .+2 ; 0x2c2de <__vector_17+0xf22> 2c2dc: 2b cf rjmp .-426 ; 0x2c134 <__vector_17+0xd78> 2c2de: 37 cf rjmp .-402 ; 0x2c14e <__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; 2c2e0: 80 e4 ldi r24, 0x40 ; 64 2c2e2: 9c e9 ldi r25, 0x9C ; 156 2c2e4: 8d cf rjmp .-230 ; 0x2c200 <__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 2c2e6: 81 31 cpi r24, 0x11 ; 17 2c2e8: f7 e2 ldi r31, 0x27 ; 39 2c2ea: 9f 07 cpc r25, r31 2c2ec: 20 f0 brcs .+8 ; 0x2c2f6 <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 2c2ee: 96 95 lsr r25 2c2f0: 87 95 ror r24 step_loops = 2; 2c2f2: 22 e0 ldi r18, 0x02 ; 2 2c2f4: 8a cf rjmp .-236 ; 0x2c20a <__vector_17+0xe4e> } else { step_loops = 1; 2c2f6: 21 e0 ldi r18, 0x01 ; 1 2c2f8: 20 93 98 05 sts 0x0598, r18 ; 0x800598 2c2fc: 80 32 cpi r24, 0x20 ; 32 2c2fe: 91 05 cpc r25, r1 2c300: 08 f0 brcs .+2 ; 0x2c304 <__vector_17+0xf48> 2c302: 85 cf rjmp .-246 ; 0x2c20e <__vector_17+0xe52> 2c304: 80 e2 ldi r24, 0x20 ; 32 2c306: 90 e0 ldi r25, 0x00 ; 0 2c308: 82 cf rjmp .-252 ; 0x2c20e <__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; 2c30a: dc 01 movw r26, r24 2c30c: b6 95 lsr r27 2c30e: a7 95 ror r26 2c310: ac 7f andi r26, 0xFC ; 252 2c312: a0 56 subi r26, 0x60 ; 96 2c314: bd 46 sbci r27, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c316: fd 01 movw r30, r26 2c318: 25 91 lpm r18, Z+ 2c31a: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c31c: fd 01 movw r30, r26 2c31e: 32 96 adiw r30, 0x02 ; 2 2c320: a5 91 lpm r26, Z+ 2c322: b4 91 lpm r27, Z 2c324: 87 70 andi r24, 0x07 ; 7 2c326: 99 27 eor r25, r25 2c328: 8a 9f mul r24, r26 2c32a: f0 01 movw r30, r0 2c32c: 8b 9f mul r24, r27 2c32e: f0 0d add r31, r0 2c330: 9a 9f mul r25, r26 2c332: f0 0d add r31, r0 2c334: 11 24 eor r1, r1 2c336: a3 e0 ldi r26, 0x03 ; 3 2c338: f6 95 lsr r31 2c33a: e7 95 ror r30 2c33c: aa 95 dec r26 2c33e: e1 f7 brne .-8 ; 0x2c338 <__vector_17+0xf7c> 2c340: 83 cf rjmp .-250 ; 0x2c248 <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 2c342: 80 91 9b 05 lds r24, 0x059B ; 0x80059b 2c346: 88 23 and r24, r24 2c348: 71 f0 breq .+28 ; 0x2c366 <__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; 2c34a: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 2c34c: 20 91 75 05 lds r18, 0x0575 ; 0x800575 2c350: 30 91 76 05 lds r19, 0x0576 ; 0x800576 2c354: 30 93 e7 04 sts 0x04E7, r19 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2c358: 20 93 e6 04 sts 0x04E6, r18 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> 2c35c: 30 93 e3 04 sts 0x04E3, r19 ; 0x8004e3 <_ZL9main_Rate.lto_priv.494+0x1> 2c360: 20 93 e2 04 sts 0x04E2, r18 ; 0x8004e2 <_ZL9main_Rate.lto_priv.494> 2c364: 54 ce rjmp .-856 ; 0x2c00e <__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); 2c366: 8e a9 ldd r24, Y+54 ; 0x36 2c368: 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; 2c36a: 81 34 cpi r24, 0x41 ; 65 2c36c: 4c e9 ldi r20, 0x9C ; 156 2c36e: 94 07 cpc r25, r20 2c370: 08 f0 brcs .+2 ; 0x2c374 <__vector_17+0xfb8> 2c372: 4e c0 rjmp .+156 ; 0x2c410 <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2c374: 81 32 cpi r24, 0x21 ; 33 2c376: 5e e4 ldi r21, 0x4E ; 78 2c378: 95 07 cpc r25, r21 2c37a: 08 f4 brcc .+2 ; 0x2c37e <__vector_17+0xfc2> 2c37c: 4c c0 rjmp .+152 ; 0x2c416 <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 2c37e: 96 95 lsr r25 2c380: 87 95 ror r24 2c382: 96 95 lsr r25 2c384: 87 95 ror r24 step_loops = 4; 2c386: 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; 2c388: 20 93 98 05 sts 0x0598, r18 ; 0x800598 else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c38c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c38e: 81 15 cp r24, r1 2c390: f8 e0 ldi r31, 0x08 ; 8 2c392: 9f 07 cpc r25, r31 2c394: 08 f4 brcc .+2 ; 0x2c398 <__vector_17+0xfdc> 2c396: 51 c0 rjmp .+162 ; 0x2c43a <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c398: e9 2f mov r30, r25 2c39a: ff 27 eor r31, r31 2c39c: ee 0f add r30, r30 2c39e: ff 1f adc r31, r31 2c3a0: ee 0f add r30, r30 2c3a2: ff 1f adc r31, r31 2c3a4: 9f 01 movw r18, r30 2c3a6: 20 56 subi r18, 0x60 ; 96 2c3a8: 39 46 sbci r19, 0x69 ; 105 unsigned char tmp_step_rate = (step_rate & 0x00ff); uint16_t gain = (uint16_t)pgm_read_word_near(table_address+2); 2c3aa: f9 01 movw r30, r18 2c3ac: 32 96 adiw r30, 0x02 ; 2 2c3ae: 65 91 lpm r22, Z+ 2c3b0: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c3b2: f9 01 movw r30, r18 2c3b4: 25 91 lpm r18, Z+ 2c3b6: 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. ); 2c3b8: 78 9f mul r23, r24 2c3ba: a0 01 movw r20, r0 2c3bc: 68 9f mul r22, r24 2c3be: 00 0c add r0, r0 2c3c0: 41 1d adc r20, r1 2c3c2: 11 24 eor r1, r1 2c3c4: 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); 2c3c6: c9 01 movw r24, r18 2c3c8: 84 1b sub r24, r20 2c3ca: 95 0b sbc r25, r21 2c3cc: 84 36 cpi r24, 0x64 ; 100 2c3ce: 91 05 cpc r25, r1 2c3d0: 10 f4 brcc .+4 ; 0x2c3d6 <__vector_17+0x101a> 2c3d2: 84 e6 ldi r24, 0x64 ; 100 2c3d4: 90 e0 ldi r25, 0x00 ; 0 2c3d6: 90 93 76 05 sts 0x0576, r25 ; 0x800576 2c3da: 80 93 75 05 sts 0x0575, r24 ; 0x800575 step_loops_nominal = step_loops; 2c3de: 80 91 98 05 lds r24, 0x0598 ; 0x800598 2c3e2: 80 93 9b 05 sts 0x059B, r24 ; 0x80059b #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 2c3e6: fe 01 movw r30, r28 2c3e8: e4 5b subi r30, 0xB4 ; 180 2c3ea: ff 4f sbci r31, 0xFF ; 255 2c3ec: 80 81 ld r24, Z 2c3ee: 88 23 and r24, r24 2c3f0: 09 f4 brne .+2 ; 0x2c3f4 <__vector_17+0x1038> 2c3f2: ab cf rjmp .-170 ; 0x2c34a <__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) 2c3f4: 80 91 7f 05 lds r24, 0x057F ; 0x80057f 2c3f8: 88 23 and r24, r24 2c3fa: 41 f0 breq .+16 ; 0x2c40c <__vector_17+0x1050> target_adv_steps = current_adv_steps; 2c3fc: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2c400: 90 91 e1 04 lds r25, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c404: 90 93 93 05 sts 0x0593, r25 ; 0x800593 2c408: 80 93 92 05 sts 0x0592, r24 ; 0x800592 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { // Due to E-jerk, there can be discontinuities in pressure state where an // acceleration or deceleration can be skipped or joined with the previous block. // If LA was not previously active, re-check the pressure level la_state = ADV_INIT; 2c40c: 81 e0 ldi r24, 0x01 ; 1 2c40e: 9e cf rjmp .-196 ; 0x2c34c <__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; 2c410: 80 e4 ldi r24, 0x40 ; 64 2c412: 9c e9 ldi r25, 0x9C ; 156 2c414: b4 cf rjmp .-152 ; 0x2c37e <__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 2c416: 81 31 cpi r24, 0x11 ; 17 2c418: e7 e2 ldi r30, 0x27 ; 39 2c41a: 9e 07 cpc r25, r30 2c41c: 20 f0 brcs .+8 ; 0x2c426 <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 2c41e: 96 95 lsr r25 2c420: 87 95 ror r24 step_loops = 2; 2c422: 22 e0 ldi r18, 0x02 ; 2 2c424: b1 cf rjmp .-158 ; 0x2c388 <__vector_17+0xfcc> } else { step_loops = 1; 2c426: 21 e0 ldi r18, 0x01 ; 1 2c428: 20 93 98 05 sts 0x0598, r18 ; 0x800598 2c42c: 80 32 cpi r24, 0x20 ; 32 2c42e: 91 05 cpc r25, r1 2c430: 08 f0 brcs .+2 ; 0x2c434 <__vector_17+0x1078> 2c432: ac cf rjmp .-168 ; 0x2c38c <__vector_17+0xfd0> 2c434: 80 e2 ldi r24, 0x20 ; 32 2c436: 90 e0 ldi r25, 0x00 ; 0 2c438: a9 cf rjmp .-174 ; 0x2c38c <__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; 2c43a: 9c 01 movw r18, r24 2c43c: 36 95 lsr r19 2c43e: 27 95 ror r18 2c440: 2c 7f andi r18, 0xFC ; 252 2c442: 20 56 subi r18, 0x60 ; 96 2c444: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c446: f9 01 movw r30, r18 2c448: 45 91 lpm r20, Z+ 2c44a: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c44c: f9 01 movw r30, r18 2c44e: 32 96 adiw r30, 0x02 ; 2 2c450: 65 91 lpm r22, Z+ 2c452: 74 91 lpm r23, Z 2c454: 87 70 andi r24, 0x07 ; 7 2c456: 99 27 eor r25, r25 2c458: 86 9f mul r24, r22 2c45a: 90 01 movw r18, r0 2c45c: 87 9f mul r24, r23 2c45e: 30 0d add r19, r0 2c460: 96 9f mul r25, r22 2c462: 30 0d add r19, r0 2c464: 11 24 eor r1, r1 2c466: a3 e0 ldi r26, 0x03 ; 3 2c468: 36 95 lsr r19 2c46a: 27 95 ror r18 2c46c: aa 95 dec r26 2c46e: e1 f7 brne .-8 ; 0x2c468 <__vector_17+0x10ac> 2c470: ca 01 movw r24, r20 2c472: 82 1b sub r24, r18 2c474: 93 0b sbc r25, r19 2c476: aa cf rjmp .-172 ; 0x2c3cc <__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; 2c478: de 01 movw r26, r28 2c47a: a3 5b subi r26, 0xB3 ; 179 2c47c: bf 4f sbci r27, 0xFF ; 255 2c47e: 4d 91 ld r20, X+ 2c480: 5c 91 ld r21, X 2c482: 11 97 sbiw r26, 0x01 ; 1 2c484: 70 e0 ldi r23, 0x00 ; 0 2c486: 60 e0 ldi r22, 0x00 ; 0 2c488: 40 93 71 05 sts 0x0571, r20 ; 0x800571 2c48c: 50 93 72 05 sts 0x0572, r21 ; 0x800572 2c490: 60 93 73 05 sts 0x0573, r22 ; 0x800573 2c494: 70 93 74 05 sts 0x0574, r23 ; 0x800574 e_step_loops = current_block->advance_step_loops; 2c498: 16 96 adiw r26, 0x06 ; 6 2c49a: 9c 91 ld r25, X 2c49c: 90 93 70 05 sts 0x0570, r25 ; 0x800570 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 2c4a0: 98 2f mov r25, r24 2c4a2: 92 70 andi r25, 0x02 ; 2 2c4a4: 09 f4 brne .+2 ; 0x2c4a8 <__vector_17+0x10ec> 2c4a6: cb cd rjmp .-1130 ; 0x2c03e <__vector_17+0xc82> 2c4a8: 90 91 7f 05 lds r25, 0x057F ; 0x80057f 2c4ac: 99 23 and r25, r25 2c4ae: 09 f4 brne .+2 ; 0x2c4b2 <__vector_17+0x10f6> 2c4b0: c6 cd rjmp .-1140 ; 0x2c03e <__vector_17+0xc82> 2c4b2: 2e 17 cp r18, r30 2c4b4: 3f 07 cpc r19, r31 2c4b6: 08 f0 brcs .+2 ; 0x2c4ba <__vector_17+0x10fe> 2c4b8: c2 cd rjmp .-1148 ; 0x2c03e <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2c4ba: 44 0f add r20, r20 2c4bc: 55 1f adc r21, r21 2c4be: 66 1f adc r22, r22 2c4c0: 77 1f adc r23, r23 2c4c2: 40 93 71 05 sts 0x0571, r20 ; 0x800571 2c4c6: 50 93 72 05 sts 0x0572, r21 ; 0x800572 2c4ca: 60 93 73 05 sts 0x0573, r22 ; 0x800573 2c4ce: 70 93 74 05 sts 0x0574, r23 ; 0x800574 LA_phase = 0; 2c4d2: 10 92 90 05 sts 0x0590, r1 ; 0x800590 2c4d6: b3 cd rjmp .-1178 ; 0x2c03e <__vector_17+0xc82> 2c4d8: 80 93 71 05 sts 0x0571, r24 ; 0x800571 2c4dc: 90 93 72 05 sts 0x0572, r25 ; 0x800572 2c4e0: a0 93 73 05 sts 0x0573, r26 ; 0x800573 2c4e4: b0 93 74 05 sts 0x0574, r27 ; 0x800574 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 2c4e8: 61 11 cpse r22, r1 2c4ea: 1b c0 rjmp .+54 ; 0x2c522 <__vector_17+0x1166> { eISR_Rate = timer; 2c4ec: f0 93 6f 05 sts 0x056F, r31 ; 0x80056f 2c4f0: e0 93 6e 05 sts 0x056E, r30 ; 0x80056e nextAdvanceISR = timer; 2c4f4: f0 93 e5 04 sts 0x04E5, r31 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c4f8: e0 93 e4 04 sts 0x04E4, r30 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 2c4fc: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2c500: 87 fd sbrc r24, 7 2c502: 58 c0 rjmp .+176 ; 0x2c5b4 <__vector_17+0x11f8> if (step_loops == e_step_loops) 2c504: 80 91 98 05 lds r24, 0x0598 ; 0x800598 2c508: 10 91 70 05 lds r17, 0x0570 ; 0x800570 2c50c: 28 81 ld r18, Y 2c50e: 39 81 ldd r19, Y+1 ; 0x01 2c510: 81 13 cpse r24, r17 2c512: 35 c0 rjmp .+106 ; 0x2c57e <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 2c514: 81 e0 ldi r24, 0x01 ; 1 2c516: 2e 17 cp r18, r30 2c518: 3f 07 cpc r19, r31 2c51a: 08 f4 brcc .+2 ; 0x2c51e <__vector_17+0x1162> 2c51c: 49 c0 rjmp .+146 ; 0x2c5b0 <__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); 2c51e: 80 e0 ldi r24, 0x00 ; 0 2c520: 47 c0 rjmp .+142 ; 0x2c5b0 <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 2c522: 64 30 cpi r22, 0x04 ; 4 2c524: 28 f5 brcc .+74 ; 0x2c570 <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 2c526: 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); 2c528: 63 30 cpi r22, 0x03 ; 3 2c52a: a9 f0 breq .+42 ; 0x2c556 <__vector_17+0x119a> 2c52c: 66 95 lsr r22 2c52e: af 01 movw r20, r30 2c530: 02 c0 rjmp .+4 ; 0x2c536 <__vector_17+0x117a> 2c532: 56 95 lsr r21 2c534: 47 95 ror r20 2c536: 6a 95 dec r22 2c538: e2 f7 brpl .-8 ; 0x2c532 <__vector_17+0x1176> 2c53a: 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); 2c53c: 70 93 6f 05 sts 0x056F, r23 ; 0x80056f 2c540: 60 93 6e 05 sts 0x056E, r22 ; 0x80056e } nextAdvanceISR = eISR_Rate; 2c544: 80 91 6e 05 lds r24, 0x056E ; 0x80056e 2c548: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c54c: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c550: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> 2c554: d3 cf rjmp .-90 ; 0x2c4fc <__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; 2c556: 9f 01 movw r18, r30 2c558: ab ea ldi r26, 0xAB ; 171 2c55a: ba ea ldi r27, 0xAA ; 170 2c55c: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 2c560: 41 e1 ldi r20, 0x11 ; 17 2c562: 96 95 lsr r25 2c564: 87 95 ror r24 2c566: 77 95 ror r23 2c568: 67 95 ror r22 2c56a: 4a 95 dec r20 2c56c: d1 f7 brne .-12 ; 0x2c562 <__vector_17+0x11a6> 2c56e: e6 cf rjmp .-52 ; 0x2c53c <__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); 2c570: 70 e0 ldi r23, 0x00 ; 0 2c572: 6f 5f subi r22, 0xFF ; 255 2c574: 7f 4f sbci r23, 0xFF ; 255 2c576: cf 01 movw r24, r30 2c578: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 2c57c: df cf rjmp .-66 ; 0x2c53c <__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); 2c57e: 83 30 cpi r24, 0x03 ; 3 2c580: 09 f4 brne .+2 ; 0x2c584 <__vector_17+0x11c8> 2c582: cf c0 rjmp .+414 ; 0x2c722 <__vector_17+0x1366> 2c584: 86 95 lsr r24 2c586: a9 01 movw r20, r18 2c588: 02 c0 rjmp .+4 ; 0x2c58e <__vector_17+0x11d2> 2c58a: 56 95 lsr r21 2c58c: 47 95 ror r20 2c58e: 8a 95 dec r24 2c590: e2 f7 brpl .-8 ; 0x2c58a <__vector_17+0x11ce> 2c592: 13 30 cpi r17, 0x03 ; 3 2c594: 09 f4 brne .+2 ; 0x2c598 <__vector_17+0x11dc> 2c596: d3 c0 rjmp .+422 ; 0x2c73e <__vector_17+0x1382> 2c598: 16 95 lsr r17 2c59a: bf 01 movw r22, r30 2c59c: 02 c0 rjmp .+4 ; 0x2c5a2 <__vector_17+0x11e6> 2c59e: 76 95 lsr r23 2c5a0: 67 95 ror r22 2c5a2: 1a 95 dec r17 2c5a4: e2 f7 brpl .-8 ; 0x2c59e <__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); 2c5a6: 81 e0 ldi r24, 0x01 ; 1 2c5a8: 46 17 cp r20, r22 2c5aa: 57 07 cpc r21, r23 2c5ac: 08 f0 brcs .+2 ; 0x2c5b0 <__vector_17+0x11f4> 2c5ae: b7 cf rjmp .-146 ; 0x2c51e <__vector_17+0x1162> 2c5b0: 80 93 90 05 sts 0x0590, r24 ; 0x800590 } } // Check for serial chars. This executes roughtly inbetween 50-60% of the total runtime of the // entire isr, making this spot a much better choice than checking during esteps MSerial.checkRx(); 2c5b4: 0f 94 57 22 call 0x244ae ; 0x244ae #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 2c5b8: 40 91 7b 05 lds r20, 0x057B ; 0x80057b 2c5bc: 50 91 7c 05 lds r21, 0x057C ; 0x80057c 2c5c0: 60 91 7d 05 lds r22, 0x057D ; 0x80057d 2c5c4: 70 91 7e 05 lds r23, 0x057E ; 0x80057e 2c5c8: e0 91 a0 05 lds r30, 0x05A0 ; 0x8005a0 2c5cc: f0 91 a1 05 lds r31, 0x05A1 ; 0x8005a1 2c5d0: 80 89 ldd r24, Z+16 ; 0x10 2c5d2: 91 89 ldd r25, Z+17 ; 0x11 2c5d4: a2 89 ldd r26, Z+18 ; 0x12 2c5d6: b3 89 ldd r27, Z+19 ; 0x13 2c5d8: 48 17 cp r20, r24 2c5da: 59 07 cpc r21, r25 2c5dc: 6a 07 cpc r22, r26 2c5de: 7b 07 cpc r23, r27 2c5e0: 80 f0 brcs .+32 ; 0x2c602 <__vector_17+0x1246> current_block = NULL; 2c5e2: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 2c5e6: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 extern volatile uint8_t block_buffer_tail; // Called when the current block is no longer needed. Discards the block and makes the memory // available for new blocks. FORCE_INLINE void plan_discard_current_block() { if (block_buffer_head != block_buffer_tail) { 2c5ea: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 2c5ee: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 2c5f2: 98 17 cp r25, r24 2c5f4: 31 f0 breq .+12 ; 0x2c602 <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c5f6: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 2c5fa: 8f 5f subi r24, 0xFF ; 255 2c5fc: 8f 70 andi r24, 0x0F ; 15 2c5fe: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 return mask; } void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) 2c602: 80 91 6a 06 lds r24, 0x066A ; 0x80066a 2c606: 81 30 cpi r24, 0x01 ; 1 2c608: 49 f1 breq .+82 ; 0x2c65c <__vector_17+0x12a0> 2c60a: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2c60e: 88 23 and r24, r24 2c610: 29 f1 breq .+74 ; 0x2c65c <__vector_17+0x12a0> 2c612: 80 91 3e 06 lds r24, 0x063E ; 0x80063e 2c616: 81 11 cpse r24, r1 2c618: 21 c0 rjmp .+66 ; 0x2c65c <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 2c61a: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c61e: 81 e0 ldi r24, 0x01 ; 1 2c620: 29 2f mov r18, r25 2c622: 24 70 andi r18, 0x04 ; 4 2c624: 92 fd sbrc r25, 2 2c626: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 2c628: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c62c: 82 60 ori r24, 0x02 ; 2 2c62e: 97 ff sbrs r25, 7 2c630: 03 c0 rjmp .+6 ; 0x2c638 <__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) { 2c632: 21 11 cpse r18, r1 2c634: 13 c0 rjmp .+38 ; 0x2c65c <__vector_17+0x12a0> 2c636: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 2c638: 80 93 0e 05 sts 0x050E, r24 ; 0x80050e tmc2130_sg_stop_on_crash = false; 2c63c: 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 2c640: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.497+0x8> 2c644: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.497+0x9> 2c648: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.497+0xa> 2c64c: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.497+0xb> 2c650: 20 e0 ldi r18, 0x00 ; 0 2c652: 30 e0 ldi r19, 0x00 ; 0 2c654: 40 e8 ldi r20, 0x80 ; 128 2c656: 5f eb ldi r21, 0xBF ; 191 2c658: 0e 94 62 8a call 0x114c4 ; 0x114c4 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c65c: 60 91 e4 04 lds r22, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> 2c660: 70 91 e5 04 lds r23, 0x04E5 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> if (eisr) 2c664: 61 15 cp r22, r1 2c666: 71 05 cpc r23, r1 2c668: 09 f0 breq .+2 ; 0x2c66c <__vector_17+0x12b0> 2c66a: 46 c0 rjmp .+140 ; 0x2c6f8 <__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) { 2c66c: 40 91 e0 04 lds r20, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2c670: 50 91 e1 04 lds r21, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c674: 20 91 92 05 lds r18, 0x0592 ; 0x800592 2c678: 30 91 93 05 lds r19, 0x0593 ; 0x800593 2c67c: 80 91 91 05 lds r24, 0x0591 ; 0x800591 2c680: 24 17 cp r18, r20 2c682: 35 07 cpc r19, r21 2c684: 08 f0 brcs .+2 ; 0x2c688 <__vector_17+0x12cc> 2c686: 6c c0 rjmp .+216 ; 0x2c760 <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 2c688: 90 91 70 05 lds r25, 0x0570 ; 0x800570 2c68c: 91 30 cpi r25, 0x01 ; 1 2c68e: 41 f0 breq .+16 ; 0x2c6a0 <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 2c690: 42 1b sub r20, r18 2c692: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 2c694: 94 17 cp r25, r20 2c696: 15 06 cpc r1, r21 2c698: 19 f0 breq .+6 ; 0x2c6a0 <__vector_17+0x12e4> 2c69a: 10 f0 brcs .+4 ; 0x2c6a0 <__vector_17+0x12e4> e_step_loops = d_steps; 2c69c: 40 93 70 05 sts 0x0570, r20 ; 0x800570 } e_steps -= e_step_loops; 2c6a0: 90 91 70 05 lds r25, 0x0570 ; 0x800570 2c6a4: 89 1b sub r24, r25 2c6a6: 80 93 91 05 sts 0x0591, r24 ; 0x800591 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c6aa: 88 23 and r24, r24 2c6ac: 39 f0 breq .+14 ; 0x2c6bc <__vector_17+0x1300> 2c6ae: 87 fd sbrc r24, 7 2c6b0: 53 c0 rjmp .+166 ; 0x2c758 <__vector_17+0x139c> 2c6b2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c6b6: 80 64 ori r24, 0x40 ; 64 2c6b8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 2c6bc: 20 91 70 05 lds r18, 0x0570 ; 0x800570 2c6c0: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2c6c4: 90 91 e1 04 lds r25, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c6c8: 82 1b sub r24, r18 2c6ca: 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; 2c6cc: 90 93 e1 04 sts 0x04E1, r25 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c6d0: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> } if (current_adv_steps == target_adv_steps) { 2c6d4: 20 91 e0 04 lds r18, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2c6d8: 30 91 e1 04 lds r19, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c6dc: 80 91 92 05 lds r24, 0x0592 ; 0x800592 2c6e0: 90 91 93 05 lds r25, 0x0593 ; 0x800593 2c6e4: 28 17 cp r18, r24 2c6e6: 39 07 cpc r19, r25 2c6e8: 09 f0 breq .+2 ; 0x2c6ec <__vector_17+0x1330> 2c6ea: 66 c0 rjmp .+204 ; 0x2c7b8 <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 2c6ec: 8f ef ldi r24, 0xFF ; 255 2c6ee: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c6f0: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c6f4: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c6f8: 40 91 91 05 lds r20, 0x0591 ; 0x800591 2c6fc: 41 11 cpse r20, r1 2c6fe: 61 c0 rjmp .+194 ; 0x2c7c2 <__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) 2c700: 80 91 e4 04 lds r24, 0x04E4 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> 2c704: 90 91 e5 04 lds r25, 0x04E5 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c708: 20 91 e6 04 lds r18, 0x04E6 ; 0x8004e6 <_ZL11nextMainISR.lto_priv.492> 2c70c: 30 91 e7 04 lds r19, 0x04E7 ; 0x8004e7 <_ZL11nextMainISR.lto_priv.492+0x1> 2c710: 8f 3f cpi r24, 0xFF ; 255 2c712: 98 07 cpc r25, r24 2c714: 09 f0 breq .+2 ; 0x2c718 <__vector_17+0x135c> 2c716: 88 c0 rjmp .+272 ; 0x2c828 <__vector_17+0x146c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 2c718: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c71c: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c720: 8e c0 rjmp .+284 ; 0x2c83e <__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; 2c722: ab ea ldi r26, 0xAB ; 171 2c724: ba ea ldi r27, 0xAA ; 170 2c726: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 2c72a: ab 01 movw r20, r22 2c72c: bc 01 movw r22, r24 2c72e: 31 e1 ldi r19, 0x11 ; 17 2c730: 76 95 lsr r23 2c732: 67 95 ror r22 2c734: 57 95 ror r21 2c736: 47 95 ror r20 2c738: 3a 95 dec r19 2c73a: d1 f7 brne .-12 ; 0x2c730 <__vector_17+0x1374> 2c73c: 2a cf rjmp .-428 ; 0x2c592 <__vector_17+0x11d6> 2c73e: 9f 01 movw r18, r30 2c740: ab ea ldi r26, 0xAB ; 171 2c742: ba ea ldi r27, 0xAA ; 170 2c744: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 2c748: 21 e1 ldi r18, 0x11 ; 17 2c74a: 96 95 lsr r25 2c74c: 87 95 ror r24 2c74e: 77 95 ror r23 2c750: 67 95 ror r22 2c752: 2a 95 dec r18 2c754: d1 f7 brne .-12 ; 0x2c74a <__vector_17+0x138e> 2c756: 27 cf rjmp .-434 ; 0x2c5a6 <__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); 2c758: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c75c: 8f 7b andi r24, 0xBF ; 191 2c75e: ac cf rjmp .-168 ; 0x2c6b8 <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 2c760: 42 17 cp r20, r18 2c762: 53 07 cpc r21, r19 2c764: 08 f0 brcs .+2 ; 0x2c768 <__vector_17+0x13ac> 2c766: b6 cf rjmp .-148 ; 0x2c6d4 <__vector_17+0x1318> // compression if (e_step_loops != 1) { 2c768: 90 91 70 05 lds r25, 0x0570 ; 0x800570 2c76c: 91 30 cpi r25, 0x01 ; 1 2c76e: 41 f0 breq .+16 ; 0x2c780 <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 2c770: 24 1b sub r18, r20 2c772: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 2c774: 92 17 cp r25, r18 2c776: 13 06 cpc r1, r19 2c778: 19 f0 breq .+6 ; 0x2c780 <__vector_17+0x13c4> 2c77a: 10 f0 brcs .+4 ; 0x2c780 <__vector_17+0x13c4> e_step_loops = d_steps; 2c77c: 20 93 70 05 sts 0x0570, r18 ; 0x800570 } e_steps += e_step_loops; 2c780: 90 91 70 05 lds r25, 0x0570 ; 0x800570 2c784: 89 0f add r24, r25 2c786: 80 93 91 05 sts 0x0591, r24 ; 0x800591 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c78a: 88 23 and r24, r24 2c78c: 39 f0 breq .+14 ; 0x2c79c <__vector_17+0x13e0> 2c78e: 87 fd sbrc r24, 7 2c790: 0f c0 rjmp .+30 ; 0x2c7b0 <__vector_17+0x13f4> 2c792: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c796: 80 64 ori r24, 0x40 ; 64 2c798: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 2c79c: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2c7a0: 20 91 e0 04 lds r18, 0x04E0 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> 2c7a4: 30 91 e1 04 lds r19, 0x04E1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c7a8: 82 0f add r24, r18 2c7aa: 93 2f mov r25, r19 2c7ac: 91 1d adc r25, r1 2c7ae: 8e cf rjmp .-228 ; 0x2c6cc <__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); 2c7b0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c7b4: 8f 7b andi r24, 0xBF ; 191 2c7b6: f0 cf rjmp .-32 ; 0x2c798 <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c7b8: 80 91 6e 05 lds r24, 0x056E ; 0x80056e 2c7bc: 90 91 6f 05 lds r25, 0x056F ; 0x80056f 2c7c0: 97 cf rjmp .-210 ; 0x2c6f0 <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c7c2: 80 91 90 05 lds r24, 0x0590 ; 0x800590 2c7c6: 87 fd sbrc r24, 7 2c7c8: 0e c0 rjmp .+28 ; 0x2c7e6 <__vector_17+0x142a> 2c7ca: 08 2e mov r0, r24 2c7cc: 00 0c add r0, r0 2c7ce: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c7d0: 21 e0 ldi r18, 0x01 ; 1 2c7d2: 30 e0 ldi r19, 0x00 ; 0 2c7d4: 61 15 cp r22, r1 2c7d6: 71 05 cpc r23, r1 2c7d8: 11 f0 breq .+4 ; 0x2c7de <__vector_17+0x1422> 2c7da: 30 e0 ldi r19, 0x00 ; 0 2c7dc: 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)) { 2c7de: 82 17 cp r24, r18 2c7e0: 93 07 cpc r25, r19 2c7e2: 09 f0 breq .+2 ; 0x2c7e6 <__vector_17+0x142a> 2c7e4: 8d cf rjmp .-230 ; 0x2c700 <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 2c7e6: 20 91 70 05 lds r18, 0x0570 ; 0x800570 2c7ea: 67 2b or r22, r23 2c7ec: 11 f0 breq .+4 ; 0x2c7f2 <__vector_17+0x1436> 2c7ee: 20 91 98 05 lds r18, 0x0598 ; 0x800598 max_ticks = min(abs(e_steps), max_ticks); 2c7f2: 84 2f mov r24, r20 2c7f4: 04 2e mov r0, r20 2c7f6: 00 0c add r0, r0 2c7f8: 99 0b sbc r25, r25 2c7fa: 97 ff sbrs r25, 7 2c7fc: 03 c0 rjmp .+6 ; 0x2c804 <__vector_17+0x1448> 2c7fe: 91 95 neg r25 2c800: 81 95 neg r24 2c802: 91 09 sbc r25, r1 2c804: 30 e0 ldi r19, 0x00 ; 0 2c806: 28 17 cp r18, r24 2c808: 39 07 cpc r19, r25 2c80a: 0c f4 brge .+2 ; 0x2c80e <__vector_17+0x1452> 2c80c: c9 01 movw r24, r18 2c80e: 21 e0 ldi r18, 0x01 ; 1 2c810: 47 ff sbrs r20, 7 2c812: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 2c814: 38 e0 ldi r19, 0x08 ; 8 2c816: 36 b9 out 0x06, r19 ; 6 e_steps += (rev? 1: -1); 2c818: 90 91 91 05 lds r25, 0x0591 ; 0x800591 2c81c: 92 0f add r25, r18 2c81e: 90 93 91 05 sts 0x0591, r25 ; 0x800591 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); 2c822: 81 50 subi r24, 0x01 ; 1 2c824: c1 f7 brne .-16 ; 0x2c816 <__vector_17+0x145a> 2c826: 6c cf rjmp .-296 ; 0x2c700 <__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) 2c828: ac 01 movw r20, r24 2c82a: 48 5d subi r20, 0xD8 ; 216 2c82c: 5f 4f sbci r21, 0xFF ; 255 2c82e: 42 17 cp r20, r18 2c830: 53 07 cpc r21, r19 2c832: 08 f0 brcs .+2 ; 0x2c836 <__vector_17+0x147a> 2c834: 71 cf rjmp .-286 ; 0x2c718 <__vector_17+0x135c> OCR1A = nextAdvanceISR; 2c836: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c83a: 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) { 2c83e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c842: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c846: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c84a: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c84e: 40 96 adiw r24, 0x10 ; 16 2c850: 28 17 cp r18, r24 2c852: 39 07 cpc r19, r25 2c854: 48 f4 brcc .+18 ; 0x2c868 <__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; 2c856: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c85a: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c85e: 40 96 adiw r24, 0x10 ; 16 2c860: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c864: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 2c868: ff 91 pop r31 2c86a: ef 91 pop r30 2c86c: df 91 pop r29 2c86e: cf 91 pop r28 2c870: bf 91 pop r27 2c872: af 91 pop r26 2c874: 9f 91 pop r25 2c876: 8f 91 pop r24 2c878: 7f 91 pop r23 2c87a: 6f 91 pop r22 2c87c: 5f 91 pop r21 2c87e: 4f 91 pop r20 2c880: 3f 91 pop r19 2c882: 2f 91 pop r18 2c884: 1f 91 pop r17 2c886: 0f 91 pop r16 2c888: ff 90 pop r15 2c88a: ef 90 pop r14 2c88c: df 90 pop r13 2c88e: cf 90 pop r12 2c890: 8f 90 pop r8 2c892: 7f 90 pop r7 2c894: 6f 90 pop r6 2c896: 0f 90 pop r0 2c898: 0b be out 0x3b, r0 ; 59 2c89a: 0f 90 pop r0 2c89c: 0f be out 0x3f, r0 ; 63 2c89e: 0f 90 pop r0 2c8a0: 1f 90 pop r1 2c8a2: 18 95 reti 0002c8a4 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 2c8a4: 90 91 77 05 lds r25, 0x0577 ; 0x800577 check_z_endstop = check; 2c8a8: 80 93 77 05 sts 0x0577, r24 ; 0x800577 CRITICAL_SECTION_START; 2c8ac: 2f b7 in r18, 0x3f ; 63 2c8ae: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c8b0: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZL11endstop_hit.lto_priv.496> 2c8b4: 8b 7f andi r24, 0xFB ; 251 2c8b6: 80 93 0c 05 sts 0x050C, r24 ; 0x80050c <_ZL11endstop_hit.lto_priv.496> CRITICAL_SECTION_END; 2c8ba: 2f bf out 0x3f, r18 ; 63 return old; } 2c8bc: 89 2f mov r24, r25 2c8be: 08 95 ret 0002c8c0 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 2c8c0: 80 91 0c 05 lds r24, 0x050C ; 0x80050c <_ZL11endstop_hit.lto_priv.496> CRITICAL_SECTION_START; 2c8c4: 2f b7 in r18, 0x3f ; 63 2c8c6: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c8c8: 90 91 0c 05 lds r25, 0x050C ; 0x80050c <_ZL11endstop_hit.lto_priv.496> 2c8cc: 9b 7f andi r25, 0xFB ; 251 2c8ce: 90 93 0c 05 sts 0x050C, r25 ; 0x80050c <_ZL11endstop_hit.lto_priv.496> CRITICAL_SECTION_END; 2c8d2: 2f bf out 0x3f, r18 ; 63 return hit; } 2c8d4: 82 fb bst r24, 2 2c8d6: 88 27 eor r24, r24 2c8d8: 80 f9 bld r24, 0 2c8da: 08 95 ret 0002c8dc : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 2c8dc: 90 91 0c 05 lds r25, 0x050C ; 0x80050c <_ZL11endstop_hit.lto_priv.496> endstop_hit = 0; 2c8e0: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_ZL11endstop_hit.lto_priv.496> return old; 2c8e4: 81 e0 ldi r24, 0x01 ; 1 2c8e6: 91 11 cpse r25, r1 2c8e8: 01 c0 rjmp .+2 ; 0x2c8ec 2c8ea: 80 e0 ldi r24, 0x00 ; 0 } 2c8ec: 08 95 ret 0002c8ee : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 2c8ee: 90 91 df 04 lds r25, 0x04DF ; 0x8004df 2c8f2: 91 30 cpi r25, 0x01 ; 1 2c8f4: a1 f0 breq .+40 ; 0x2c91e 2c8f6: 28 f0 brcs .+10 ; 0x2c902 2c8f8: 92 30 cpi r25, 0x02 ; 2 2c8fa: a9 f0 breq .+42 ; 0x2c926 2c8fc: 93 30 cpi r25, 0x03 ; 3 2c8fe: c1 f0 breq .+48 ; 0x2c930 2c900: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 2c902: 81 11 cpse r24, r1 2c904: 02 c0 rjmp .+4 ; 0x2c90a 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(); 2c906: 0d 94 bf 22 jmp 0x2457e ; 0x2457e switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c90a: 82 30 cpi r24, 0x02 ; 2 2c90c: 11 f4 brne .+4 ; 0x2c912 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 2c90e: 0d 94 9e 32 jmp 0x2653c ; 0x2653c 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) 2c912: 85 30 cpi r24, 0x05 ; 5 2c914: 09 f0 breq .+2 ; 0x2c918 2c916: 50 c0 rjmp .+160 ; 0x2c9b8 Sound_DoSound_Alert(false); 2c918: 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); 2c91a: 0d 94 9d 22 jmp 0x2453a ; 0x2453a 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) 2c91e: 88 23 and r24, r24 2c920: 91 f3 breq .-28 ; 0x2c906 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c922: 82 30 cpi r24, 0x02 ; 2 2c924: a1 f3 breq .-24 ; 0x2c90e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c926: 85 30 cpi r24, 0x05 ; 5 2c928: 09 f0 breq .+2 ; 0x2c92c 2c92a: 46 c0 rjmp .+140 ; 0x2c9b8 Sound_DoSound_Alert(true); 2c92c: 81 e0 ldi r24, 0x01 ; 1 2c92e: f5 cf rjmp .-22 ; 0x2c91a 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) 2c930: 88 23 and r24, r24 2c932: 49 f3 breq .-46 ; 0x2c906 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c934: 82 30 cpi r24, 0x02 ; 2 2c936: 59 f3 breq .-42 ; 0x2c90e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c938: 85 30 cpi r24, 0x05 ; 5 2c93a: 71 f3 breq .-36 ; 0x2c918 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 2c93c: 86 30 cpi r24, 0x06 ; 6 2c93e: e1 f4 brne .+56 ; 0x2c978 2c940: 85 e0 ldi r24, 0x05 ; 5 2c942: 27 e2 ldi r18, 0x27 ; 39 2c944: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 2c946: 4f b7 in r20, 0x3f ; 63 2c948: f8 94 cli 2c94a: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c94e: 94 60 ori r25, 0x04 ; 4 2c950: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c954: 4f bf out 0x3f, r20 ; 63 2c956: f9 01 movw r30, r18 2c958: 31 97 sbiw r30, 0x01 ; 1 2c95a: f1 f7 brne .-4 ; 0x2c958 delayMicroseconds(75); WRITE(BEEPER,LOW); 2c95c: 4f b7 in r20, 0x3f ; 63 2c95e: f8 94 cli 2c960: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c964: 9b 7f andi r25, 0xFB ; 251 2c966: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c96a: 4f bf out 0x3f, r20 ; 63 2c96c: f9 01 movw r30, r18 2c96e: 31 97 sbiw r30, 0x01 ; 1 2c970: f1 f7 brne .-4 ; 0x2c96e 2c972: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 2c974: 41 f7 brne .-48 ; 0x2c946 2c976: 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) 2c978: 87 30 cpi r24, 0x07 ; 7 2c97a: f1 f4 brne .+60 ; 0x2c9b8 } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 2c97c: 81 e0 ldi r24, 0x01 ; 1 2c97e: 0e 94 98 8b call 0x11730 ; 0x11730 2c982: 84 e1 ldi r24, 0x14 ; 20 2c984: 23 e7 ldi r18, 0x73 ; 115 2c986: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 2c988: 4f b7 in r20, 0x3f ; 63 2c98a: f8 94 cli 2c98c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c990: 94 60 ori r25, 0x04 ; 4 2c992: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c996: 4f bf out 0x3f, r20 ; 63 2c998: f9 01 movw r30, r18 2c99a: 31 97 sbiw r30, 0x01 ; 1 2c99c: f1 f7 brne .-4 ; 0x2c99a delayMicroseconds(94); WRITE(BEEPER,LOW); 2c99e: 4f b7 in r20, 0x3f ; 63 2c9a0: f8 94 cli 2c9a2: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c9a6: 9b 7f andi r25, 0xFB ; 251 2c9a8: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c9ac: 4f bf out 0x3f, r20 ; 63 2c9ae: f9 01 movw r30, r18 2c9b0: 31 97 sbiw r30, 0x01 ; 1 2c9b2: f1 f7 brne .-4 ; 0x2c9b0 2c9b4: 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++) 2c9b6: 41 f7 brne .-48 ; 0x2c988 Sound_DoSound_Blind_Alert(); break; default: break; } } 2c9b8: 08 95 ret 0002c9ba : //! @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 ) { 2c9ba: 2f 92 push r2 2c9bc: 3f 92 push r3 2c9be: 4f 92 push r4 2c9c0: 5f 92 push r5 2c9c2: 6f 92 push r6 2c9c4: 7f 92 push r7 2c9c6: 8f 92 push r8 2c9c8: 9f 92 push r9 2c9ca: af 92 push r10 2c9cc: bf 92 push r11 2c9ce: cf 92 push r12 2c9d0: df 92 push r13 2c9d2: ef 92 push r14 2c9d4: ff 92 push r15 2c9d6: 0f 93 push r16 2c9d8: 1f 93 push r17 2c9da: cf 93 push r28 2c9dc: df 93 push r29 2c9de: 00 d0 rcall .+0 ; 0x2c9e0 2c9e0: 00 d0 rcall .+0 ; 0x2c9e2 2c9e2: cd b7 in r28, 0x3d ; 61 2c9e4: de b7 in r29, 0x3e ; 62 2c9e6: 5c 01 movw r10, r24 2c9e8: 6c 83 std Y+4, r22 ; 0x04 2c9ea: 34 2e mov r3, r20 2c9ec: 3b 83 std Y+3, r19 ; 0x03 2c9ee: 2a 83 std Y+2, r18 ; 0x02 2c9f0: 48 01 movw r8, r16 2c9f2: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 2c9f4: 00 97 sbiw r24, 0x00 ; 0 2c9f6: 09 f0 breq .+2 ; 0x2c9fa 2c9f8: 51 c0 rjmp .+162 ; 0x2ca9c 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); 2c9fa: 87 01 movw r16, r14 2c9fc: 22 2d mov r18, r2 2c9fe: a4 01 movw r20, r8 2ca00: 6a 81 ldd r22, Y+2 ; 0x02 2ca02: 7b 81 ldd r23, Y+3 ; 0x03 2ca04: 83 2d mov r24, r3 2ca06: 0f 94 2c 35 call 0x26a58 ; 0x26a58 2ca0a: d1 2c mov r13, r1 2ca0c: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 2ca0e: 0f 94 83 3f call 0x27f06 ; 0x27f06 2ca12: 2b 01 movw r4, r22 2ca14: 3c 01 movw r6, r24 lcd_consume_click(); 2ca16: 0e 94 a5 71 call 0xe34a ; 0xe34a KEEPALIVE_STATE(PAUSED_FOR_USER); 2ca1a: 84 e0 ldi r24, 0x04 ; 4 2ca1c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 2ca20: de 82 std Y+6, r13 ; 0x06 2ca22: cd 82 std Y+5, r12 ; 0x05 2ca24: 24 e6 ldi r18, 0x64 ; 100 2ca26: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 2ca28: 82 e3 ldi r24, 0x32 ; 50 2ca2a: 90 e0 ldi r25, 0x00 ; 0 2ca2c: 0e 94 7f 8e call 0x11cfe ; 0x11cfe if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 2ca30: 3c 81 ldd r19, Y+4 ; 0x04 2ca32: 31 11 cpse r19, r1 2ca34: 3a c0 rjmp .+116 ; 0x2caaa current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 2ca36: 80 91 35 05 lds r24, 0x0535 ; 0x800535 2ca3a: 90 91 36 05 lds r25, 0x0536 ; 0x800536 2ca3e: 00 97 sbiw r24, 0x00 ; 0 2ca40: 09 f0 breq .+2 ; 0x2ca44 2ca42: 42 c0 rjmp .+132 ; 0x2cac8 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 2ca44: 0e 94 aa 71 call 0xe354 ; 0xe354 2ca48: 88 23 and r24, r24 2ca4a: 09 f4 brne .+2 ; 0x2ca4e 2ca4c: 67 c0 rjmp .+206 ; 0x2cb1c if (msg_next == NULL) { 2ca4e: 8d 81 ldd r24, Y+5 ; 0x05 2ca50: 9e 81 ldd r25, Y+6 ; 0x06 2ca52: 89 2b or r24, r25 2ca54: 09 f0 breq .+2 ; 0x2ca58 2ca56: 5e c0 rjmp .+188 ; 0x2cb14 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 2ca58: 82 e0 ldi r24, 0x02 ; 2 2ca5a: 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; 2ca5e: 91 e0 ldi r25, 0x01 ; 1 2ca60: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 2ca64: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 2ca68: 83 2d mov r24, r3 2ca6a: 26 96 adiw r28, 0x06 ; 6 2ca6c: 0f b6 in r0, 0x3f ; 63 2ca6e: f8 94 cli 2ca70: de bf out 0x3e, r29 ; 62 2ca72: 0f be out 0x3f, r0 ; 63 2ca74: cd bf out 0x3d, r28 ; 61 2ca76: df 91 pop r29 2ca78: cf 91 pop r28 2ca7a: 1f 91 pop r17 2ca7c: 0f 91 pop r16 2ca7e: ff 90 pop r15 2ca80: ef 90 pop r14 2ca82: df 90 pop r13 2ca84: cf 90 pop r12 2ca86: bf 90 pop r11 2ca88: af 90 pop r10 2ca8a: 9f 90 pop r9 2ca8c: 8f 90 pop r8 2ca8e: 7f 90 pop r7 2ca90: 6f 90 pop r6 2ca92: 5f 90 pop r5 2ca94: 4f 90 pop r4 2ca96: 3f 90 pop r3 2ca98: 2f 90 pop r2 2ca9a: 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; 2ca9c: 0f 94 7d 35 call 0x26afa ; 0x26afa 2caa0: 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) { 2caa2: 89 2b or r24, r25 2caa4: 09 f0 breq .+2 ; 0x2caa8 2caa6: b3 cf rjmp .-154 ; 0x2ca0e 2caa8: a8 cf rjmp .-176 ; 0x2c9fa 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) { 2caaa: 0f 94 83 3f call 0x27f06 ; 0x27f06 2caae: 64 19 sub r22, r4 2cab0: 75 09 sbc r23, r5 2cab2: 86 09 sbc r24, r6 2cab4: 97 09 sbc r25, r7 2cab6: 61 33 cpi r22, 0x31 ; 49 2cab8: 75 47 sbci r23, 0x75 ; 117 2caba: 81 05 cpc r24, r1 2cabc: 91 05 cpc r25, r1 2cabe: 08 f4 brcc .+2 ; 0x2cac2 2cac0: ba cf rjmp .-140 ; 0x2ca36 current_selection = LCD_BUTTON_TIMEOUT; 2cac2: 33 24 eor r3, r3 2cac4: 3a 94 dec r3 2cac6: c8 cf rjmp .-112 ; 0x2ca58 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 2cac8: 2d 81 ldd r18, Y+5 ; 0x05 2caca: 3e 81 ldd r19, Y+6 ; 0x06 2cacc: 23 2b or r18, r19 2cace: f9 f4 brne .+62 ; 0x2cb0e if (third_choice) { // third_choice is not nullptr, safe to dereference 2cad0: e1 14 cp r14, r1 2cad2: f1 04 cpc r15, r1 2cad4: b1 f0 breq .+44 ; 0x2cb02 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2cad6: 97 ff sbrs r25, 7 2cad8: 0f c0 rjmp .+30 ; 0x2caf8 2cada: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 2cadc: 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); 2cade: 87 01 movw r16, r14 2cae0: 22 2d mov r18, r2 2cae2: a4 01 movw r20, r8 2cae4: 6a 81 ldd r22, Y+2 ; 0x02 2cae6: 7b 81 ldd r23, Y+3 ; 0x03 2cae8: 83 2d mov r24, r3 2caea: 0f 94 2c 35 call 0x26a58 ; 0x26a58 lcd_encoder = 0; 2caee: 10 92 36 05 sts 0x0536, r1 ; 0x800536 2caf2: 10 92 35 05 sts 0x0535, r1 ; 0x800535 2caf6: a6 cf rjmp .-180 ; 0x2ca44 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) { 2caf8: 32 e0 ldi r19, 0x02 ; 2 2cafa: 33 16 cp r3, r19 2cafc: 81 f3 breq .-32 ; 0x2cade // Rotating knob clockwise current_selection++; 2cafe: 33 94 inc r3 2cb00: ee cf rjmp .-36 ; 0x2cade } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2cb02: 39 2e mov r3, r25 2cb04: 30 94 com r3 2cb06: 33 1c adc r3, r3 2cb08: 33 24 eor r3, r3 2cb0a: 33 1c adc r3, r3 2cb0c: e8 cf rjmp .-48 ; 0x2cade } } 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); 2cb0e: 87 e0 ldi r24, 0x07 ; 7 2cb10: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee goto exit; } else break; } } if (multi_screen) { 2cb14: c1 14 cp r12, r1 2cb16: d1 04 cpc r13, r1 2cb18: 79 f4 brne .+30 ; 0x2cb38 2cb1a: 84 cf rjmp .-248 ; 0x2ca24 2cb1c: 99 81 ldd r25, Y+1 ; 0x01 2cb1e: 91 50 subi r25, 0x01 ; 1 2cb20: 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) { 2cb22: 91 11 cpse r25, r1 2cb24: 81 cf rjmp .-254 ; 0x2ca28 goto exit; } else break; } } if (multi_screen) { 2cb26: c1 14 cp r12, r1 2cb28: d1 04 cpc r13, r1 2cb2a: 61 f0 breq .+24 ; 0x2cb44 if (msg_next == NULL) { 2cb2c: 2d 81 ldd r18, Y+5 ; 0x05 2cb2e: 3e 81 ldd r19, Y+6 ; 0x06 2cb30: 23 2b or r18, r19 2cb32: 11 f4 brne .+4 ; 0x2cb38 2cb34: be 82 std Y+6, r11 ; 0x06 2cb36: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 2cb38: 8d 81 ldd r24, Y+5 ; 0x05 2cb3a: 9e 81 ldd r25, Y+6 ; 0x06 2cb3c: 0f 94 7d 35 call 0x26afa ; 0x26afa 2cb40: 9e 83 std Y+6, r25 ; 0x06 2cb42: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 2cb44: 8d 81 ldd r24, Y+5 ; 0x05 2cb46: 9e 81 ldd r25, Y+6 ; 0x06 2cb48: 89 2b or r24, r25 2cb4a: 09 f0 breq .+2 ; 0x2cb4e 2cb4c: 6b cf rjmp .-298 ; 0x2ca24 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 2cb4e: 87 01 movw r16, r14 2cb50: 22 2d mov r18, r2 2cb52: a4 01 movw r20, r8 2cb54: 6a 81 ldd r22, Y+2 ; 0x02 2cb56: 7b 81 ldd r23, Y+3 ; 0x03 2cb58: 83 2d mov r24, r3 2cb5a: 0f 94 2c 35 call 0x26a58 ; 0x26a58 2cb5e: 62 cf rjmp .-316 ; 0x2ca24 0002cb60 : //! @param default_selection if 0, 'Yes' choice is selected by default, otherwise 'No' choice is preselected //! @retval 0 cont choice selected by user //! @retval 1 cancel choice selected by user //! @retval 0xFF button timeout (only possible if allow_timeouting is true) uint8_t lcd_show_multiscreen_message_cont_cancel_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) { 2cb60: bf 92 push r11 2cb62: cf 92 push r12 2cb64: df 92 push r13 2cb66: ef 92 push r14 2cb68: ff 92 push r15 2cb6a: 0f 93 push r16 2cb6c: 1f 93 push r17 2cb6e: cf 93 push r28 2cb70: df 93 push r29 2cb72: ec 01 movw r28, r24 2cb74: d6 2e mov r13, r22 2cb76: b4 2e mov r11, r20 return lcd_show_multiscreen_message_with_choices_and_wait_P(msg, allow_timeouting, default_selection, _T(MSG_CONTINUE_SHORT), _T(MSG_CANCEL), nullptr, 10); 2cb78: 8c e0 ldi r24, 0x0C ; 12 2cb7a: 9f e4 ldi r25, 0x4F ; 79 2cb7c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cb80: 8c 01 movw r16, r24 2cb82: 8d ec ldi r24, 0xCD ; 205 2cb84: 96 e5 ldi r25, 0x56 ; 86 2cb86: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cb8a: 2a e0 ldi r18, 0x0A ; 10 2cb8c: c2 2e mov r12, r18 2cb8e: f1 2c mov r15, r1 2cb90: e1 2c mov r14, r1 2cb92: 9c 01 movw r18, r24 2cb94: 4b 2d mov r20, r11 2cb96: 6d 2d mov r22, r13 2cb98: ce 01 movw r24, r28 2cb9a: 0f 94 dd 64 call 0x2c9ba ; 0x2c9ba } 2cb9e: df 91 pop r29 2cba0: cf 91 pop r28 2cba2: 1f 91 pop r17 2cba4: 0f 91 pop r16 2cba6: ff 90 pop r15 2cba8: ef 90 pop r14 2cbaa: df 90 pop r13 2cbac: cf 90 pop r12 2cbae: bf 90 pop r11 2cbb0: 08 95 ret 0002cbb2 : //! @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) { 2cbb2: bf 92 push r11 2cbb4: cf 92 push r12 2cbb6: df 92 push r13 2cbb8: ef 92 push r14 2cbba: ff 92 push r15 2cbbc: 0f 93 push r16 2cbbe: 1f 93 push r17 2cbc0: cf 93 push r28 2cbc2: df 93 push r29 2cbc4: ec 01 movw r28, r24 2cbc6: d6 2e mov r13, r22 2cbc8: 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); 2cbca: 88 e7 ldi r24, 0x78 ; 120 2cbcc: 9d e3 ldi r25, 0x3D ; 61 2cbce: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cbd2: 8c 01 movw r16, r24 2cbd4: 82 e7 ldi r24, 0x72 ; 114 2cbd6: 9d e3 ldi r25, 0x3D ; 61 2cbd8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cbdc: 2a e0 ldi r18, 0x0A ; 10 2cbde: c2 2e mov r12, r18 2cbe0: f1 2c mov r15, r1 2cbe2: e1 2c mov r14, r1 2cbe4: 9c 01 movw r18, r24 2cbe6: 4b 2d mov r20, r11 2cbe8: 6d 2d mov r22, r13 2cbea: ce 01 movw r24, r28 2cbec: 0f 94 dd 64 call 0x2c9ba ; 0x2c9ba } 2cbf0: df 91 pop r29 2cbf2: cf 91 pop r28 2cbf4: 1f 91 pop r17 2cbf6: 0f 91 pop r16 2cbf8: ff 90 pop r15 2cbfa: ef 90 pop r14 2cbfc: df 90 pop r13 2cbfe: cf 90 pop r12 2cc00: bf 90 pop r11 2cc02: 08 95 ret 0002cc04 : //! ---------------------- | ---------------- //! 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) { 2cc04: af 92 push r10 2cc06: bf 92 push r11 2cc08: cf 92 push r12 2cc0a: df 92 push r13 2cc0c: ef 92 push r14 2cc0e: ff 92 push r15 2cc10: 0f 93 push r16 2cc12: 1f 93 push r17 2cc14: cf 93 push r28 2cc16: 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); 2cc18: 88 23 and r24, r24 2cc1a: 29 f0 breq .+10 ; 0x2cc26 2cc1c: 61 e0 ldi r22, 0x01 ; 1 2cc1e: 8f e5 ldi r24, 0x5F ; 95 2cc20: 9f e0 ldi r25, 0x0F ; 15 2cc22: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a FORCE_BL_ON_START; 2cc26: 81 e0 ldi r24, 0x01 ; 1 2cc28: 0e 94 74 8b call 0x116e8 ; 0x116e8 while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2cc2c: 89 e5 ldi r24, 0x59 ; 89 2cc2e: e8 2e mov r14, r24 2cc30: 84 ea ldi r24, 0xA4 ; 164 2cc32: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cc34: 97 ed ldi r25, 0xD7 ; 215 2cc36: c9 2e mov r12, r25 2cc38: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2cc3a: 2c e3 ldi r18, 0x3C ; 60 2cc3c: a2 2e mov r10, r18 2cc3e: b1 2c mov r11, r1 2cc40: 0c 2f mov r16, r28 2cc42: 10 e0 ldi r17, 0x00 ; 0 2cc44: 1f 92 push r1 2cc46: cf 93 push r28 2cc48: ff 92 push r15 2cc4a: ef 92 push r14 2cc4c: 0f 94 4b dc call 0x3b896 ; 0x3b896 switch (state) { 2cc50: 0f 90 pop r0 2cc52: 0f 90 pop r0 2cc54: 0f 90 pop r0 2cc56: 0f 90 pop r0 2cc58: cf 30 cpi r28, 0x0F ; 15 2cc5a: a0 f7 brcc .-24 ; 0x2cc44 2cc5c: f8 01 movw r30, r16 2cc5e: 88 27 eor r24, r24 2cc60: eb 5c subi r30, 0xCB ; 203 2cc62: f9 49 sbci r31, 0x99 ; 153 2cc64: 8e 4f sbci r24, 0xFE ; 254 2cc66: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 2cc6a: 75 3a cpi r23, 0xA5 ; 165 2cc6c: a9 39 cpi r26, 0x99 ; 153 2cc6e: 83 39 cpi r24, 0x93 ; 147 2cc70: c7 39 cpi r28, 0x97 ; 151 2cc72: 03 3a cpi r16, 0xA3 ; 163 2cc74: 85 39 cpi r24, 0x95 ; 149 2cc76: 6d 3b cpi r22, 0xBD ; 189 2cc78: 71 3a cpi r23, 0xA1 ; 161 2cc7a: e9 39 cpi r30, 0x99 ; 153 2cc7c: 6d 3a cpi r22, 0xAD ; 173 2cc7e: 79 39 cpi r23, 0x99 ; 153 2cc80: f3 39 cpi r31, 0x93 ; 147 2cc82: 5f 3b cpi r21, 0xBF ; 191 2cc84: 8d 3a cpi r24, 0xAD ; 173 2cc86: 8d 3a cpi r24, 0xAD ; 173 // 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; 2cc88: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 2cc8c: 8f e5 ldi r24, 0x5F ; 95 2cc8e: 9f e0 ldi r25, 0x0F ; 15 2cc90: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2cc94: 82 30 cpi r24, 0x02 ; 2 2cc96: 39 f4 brne .+14 ; 0x2cca6 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 2cc98: 84 ee ldi r24, 0xE4 ; 228 2cc9a: 95 e5 ldi r25, 0x55 ; 85 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)); 2cc9c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cca0: 0f 94 04 36 call 0x26c08 ; 0x26c08 2cca4: 0f c0 rjmp .+30 ; 0x2ccc4 // 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); 2cca6: 8f e7 ldi r24, 0x7F ; 127 2cca8: 95 e5 ldi r25, 0x55 ; 85 2ccaa: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2ccae: 40 e0 ldi r20, 0x00 ; 0 2ccb0: 60 e0 ldi r22, 0x00 ; 0 2ccb2: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2ccb6: 81 11 cpse r24, r1 2ccb8: 07 c0 rjmp .+14 ; 0x2ccc8 2ccba: 61 e0 ldi r22, 0x01 ; 1 2ccbc: 8f e5 ldi r24, 0x5F ; 95 2ccbe: 9f e0 ldi r25, 0x0F ; 15 2ccc0: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 2ccc4: c1 e0 ldi r28, 0x01 ; 1 2ccc6: bc cf rjmp .-136 ; 0x2cc40 2ccc8: 60 e0 ldi r22, 0x00 ; 0 2ccca: 8f e5 ldi r24, 0x5F ; 95 2cccc: 9f e0 ldi r25, 0x0F ; 15 2ccce: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 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); 2ccd2: 10 e0 ldi r17, 0x00 ; 0 2ccd4: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 2ccd6: 80 e0 ldi r24, 0x00 ; 0 2ccd8: 0e 94 74 8b call 0x116e8 ; 0x116e8 const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 2ccdc: 1f 93 push r17 2ccde: 0f 93 push r16 2cce0: 8b e2 ldi r24, 0x2B ; 43 2cce2: 90 e7 ldi r25, 0x70 ; 112 2cce4: 9f 93 push r25 2cce6: 8f 93 push r24 2cce8: 0f 94 4b dc call 0x3b896 ; 0x3b896 switch (state) { 2ccec: 0f 90 pop r0 2ccee: 0f 90 pop r0 2ccf0: 0f 90 pop r0 2ccf2: 0f 90 pop r0 2ccf4: cd 30 cpi r28, 0x0D ; 13 2ccf6: 09 f4 brne .+2 ; 0x2ccfa 2ccf8: ff c0 rjmp .+510 ; 0x2cef8 2ccfa: ce 30 cpi r28, 0x0E ; 14 2ccfc: 09 f4 brne .+2 ; 0x2cd00 2ccfe: 11 c1 rjmp .+546 ; 0x2cf22 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 2cd00: 8e e9 ldi r24, 0x9E ; 158 2cd02: 92 e5 ldi r25, 0x52 ; 82 FORCE_BL_ON_END; const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); switch (state) { 2cd04: cc 23 and r28, r28 2cd06: 09 f4 brne .+2 ; 0x2cd0a 2cd08: 0e c1 rjmp .+540 ; 0x2cf26 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 2cd0a: 81 e0 ldi r24, 0x01 ; 1 2cd0c: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_update(2); 2cd10: 82 e0 ldi r24, 0x02 ; 2 } 2cd12: cf 91 pop r28 2cd14: 1f 91 pop r17 2cd16: 0f 91 pop r16 2cd18: ff 90 pop r15 2cd1a: ef 90 pop r14 2cd1c: df 90 pop r13 2cd1e: cf 90 pop r12 2cd20: bf 90 pop r11 2cd22: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 2cd24: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2cd28: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> 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)) { 2cd2c: 81 e0 ldi r24, 0x01 ; 1 2cd2e: 0e 94 43 f9 call 0x1f286 ; 0x1f286 state = S::Selftest; 2cd32: 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)) { 2cd34: 88 23 and r24, r24 2cd36: 09 f4 brne .+2 ; 0x2cd3a 2cd38: 83 cf rjmp .-250 ; 0x2cc40 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 2cd3a: 82 e0 ldi r24, 0x02 ; 2 2cd3c: 0e 94 43 f9 call 0x1f286 ; 0x1f286 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 2cd40: 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)) { 2cd42: 88 23 and r24, r24 2cd44: 09 f4 brne .+2 ; 0x2cd48 2cd46: 7c cf rjmp .-264 ; 0x2cc40 // 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)) { 2cd48: 84 e0 ldi r24, 0x04 ; 4 2cd4a: 0e 94 43 f9 call 0x1f286 ; 0x1f286 state = S::Z; 2cd4e: 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)) { 2cd50: 88 23 and r24, r24 2cd52: 09 f4 brne .+2 ; 0x2cd56 2cd54: 75 cf rjmp .-278 ; 0x2cc40 state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 2cd56: 88 e0 ldi r24, 0x08 ; 8 2cd58: 0e 94 43 f9 call 0x1f286 ; 0x1f286 state = S::ThermalModel; 2cd5c: 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)) { 2cd5e: 88 23 and r24, r24 2cd60: 09 f4 brne .+2 ; 0x2cd64 2cd62: 6e cf rjmp .-292 ; 0x2cc40 state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 2cd64: 80 e1 ldi r24, 0x10 ; 16 2cd66: 0e 94 43 f9 call 0x1f286 ; 0x1f286 state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 2cd6a: 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)) { 2cd6c: 81 11 cpse r24, r1 2cd6e: 68 cf rjmp .-304 ; 0x2cc40 state = S::IsFil; 2cd70: c6 e0 ldi r28, 0x06 ; 6 2cd72: 66 cf rjmp .-308 ; 0x2cc40 // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 2cd74: 86 e3 ldi r24, 0x36 ; 54 2cd76: 95 e5 ldi r25, 0x55 ; 85 2cd78: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cd7c: 0f 94 04 36 call 0x26c08 ; 0x26c08 wizard_event = lcd_selftest(); 2cd80: 0f 94 74 1a call 0x234e8 ; 0x234e8 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); 2cd84: 81 11 cpse r24, r1 2cd86: 9e cf rjmp .-196 ; 0x2ccc4 } 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); 2cd88: ce e0 ldi r28, 0x0E ; 14 2cd8a: 5a cf rjmp .-332 ; 0x2cc40 break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 2cd8c: 88 ef ldi r24, 0xF8 ; 248 2cd8e: 94 e5 ldi r25, 0x54 ; 84 2cd90: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cd94: 0f 94 04 36 call 0x26c08 ; 0x26c08 wizard_event = gcode_M45(false, 0); 2cd98: 80 e0 ldi r24, 0x00 ; 0 2cd9a: 0e 94 6b e7 call 0x1ced6 ; 0x1ced6 2cd9e: f2 cf rjmp .-28 ; 0x2cd84 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 2cda0: 80 ed ldi r24, 0xD0 ; 208 2cda2: 94 e5 ldi r25, 0x54 ; 84 2cda4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cda8: 0f 94 04 36 call 0x26c08 ; 0x26c08 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 2cdac: 82 ea ldi r24, 0xA2 ; 162 2cdae: 94 e5 ldi r25, 0x54 ; 84 2cdb0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cdb4: 0f 94 04 36 call 0x26c08 ; 0x26c08 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 2cdb8: 82 e8 ldi r24, 0x82 ; 130 2cdba: 94 e5 ldi r25, 0x54 ; 84 2cdbc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cdc0: 0f 94 04 36 call 0x26c08 ; 0x26c08 wizard_event = gcode_M45(true, 0); 2cdc4: 81 e0 ldi r24, 0x01 ; 1 2cdc6: 0e 94 6b e7 call 0x1ced6 ; 0x1ced6 if (!wizard_event) { 2cdca: 88 23 and r24, r24 2cdcc: e9 f2 breq .-70 ; 0x2cd88 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 2cdce: 60 e0 ldi r22, 0x00 ; 0 2cdd0: 70 e0 ldi r23, 0x00 ; 0 2cdd2: 88 ed ldi r24, 0xD8 ; 216 2cdd4: 91 e4 ldi r25, 0x41 ; 65 2cdd6: 0e 94 0d 6f call 0xde1a ; 0xde1a if(!MMU2::mmu2.Enabled()) { 2cdda: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2cdde: 81 30 cpi r24, 0x01 ; 1 2cde0: 09 f4 brne .+2 ; 0x2cde4 2cde2: 70 cf rjmp .-288 ; 0x2ccc4 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cde4: d0 92 6c 0e sts 0x0E6C, r13 ; 0x800e6c 2cde8: c0 92 6b 0e sts 0x0E6B, r12 ; 0x800e6b //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)); 2cdec: 8d e5 ldi r24, 0x5D ; 93 2cdee: 94 e5 ldi r25, 0x54 ; 84 2cdf0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cdf4: 0f 94 7d 35 call 0x26afa ; 0x26afa wait_preheat(); 2cdf8: 0f 94 8a 35 call 0x26b14 ; 0x26b14 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 2cdfc: 60 e0 ldi r22, 0x00 ; 0 2cdfe: 70 e0 ldi r23, 0x00 ; 0 2ce00: cb 01 movw r24, r22 2ce02: 0f 94 cf 16 call 0x22d9e ; 0x22d9e lcd_wizard_load(); // load filament 2ce06: 0f 94 6d 36 call 0x26cda ; 0x26cda 2ce0a: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 2ce0e: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b 2ce12: 58 cf rjmp .-336 ; 0x2ccc4 state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 2ce14: 8d e1 ldi r24, 0x1D ; 29 2ce16: 94 e5 ldi r25, 0x54 ; 84 2ce18: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2ce1c: 0f 94 04 36 call 0x26c08 ; 0x26c08 lcd_commands_type = LcdCommands::ThermalModel; 2ce20: 85 e0 ldi r24, 0x05 ; 5 2ce22: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 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); 2ce26: 05 e0 ldi r16, 0x05 ; 5 2ce28: 10 e0 ldi r17, 0x00 ; 0 2ce2a: 55 cf rjmp .-342 ; 0x2ccd6 2ce2c: d0 92 6c 0e sts 0x0E6C, r13 ; 0x800e6c 2ce30: c0 92 6b 0e sts 0x0E6B, r12 ; 0x800e6b resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2ce34: b0 92 6a 0e sts 0x0E6A, r11 ; 0x800e6a 2ce38: a0 92 69 0e sts 0x0E69, r10 ; 0x800e69 #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); 2ce3c: 87 e0 ldi r24, 0x07 ; 7 2ce3e: 94 e5 ldi r25, 0x54 ; 84 2ce40: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2ce44: 41 e0 ldi r20, 0x01 ; 1 2ce46: 60 e0 ldi r22, 0x00 ; 0 2ce48: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2ce4c: 88 23 and r24, r24 2ce4e: 09 f1 breq .+66 ; 0x2ce92 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 2ce50: 80 91 96 13 lds r24, 0x1396 ; 0x801396 else state = S::Preheat; 2ce54: 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; 2ce56: 81 30 cpi r24, 0x01 ; 1 2ce58: 09 f0 breq .+2 ; 0x2ce5c 2ce5a: f2 ce rjmp .-540 ; 0x2cc40 2ce5c: c8 e0 ldi r28, 0x08 ; 8 2ce5e: f0 ce rjmp .-544 ; 0x2cc40 else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 2ce60: 20 e0 ldi r18, 0x00 ; 0 2ce62: 41 e0 ldi r20, 0x01 ; 1 2ce64: 70 e0 ldi r23, 0x00 ; 0 2ce66: 60 e0 ldi r22, 0x00 ; 0 2ce68: 8b e0 ldi r24, 0x0B ; 11 2ce6a: 9a e3 ldi r25, 0x3A ; 58 2ce6c: 0f 94 32 cf call 0x39e64 ; 0x39e64 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 2ce70: 86 ec ldi r24, 0xC6 ; 198 2ce72: 93 e5 ldi r25, 0x53 ; 83 2ce74: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2ce78: 0f 94 04 36 call 0x26c08 ; 0x26c08 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); 2ce7c: 07 e0 ldi r16, 0x07 ; 7 2ce7e: 10 e0 ldi r17, 0x00 ; 0 2ce80: 2a cf rjmp .-428 ; 0x2ccd6 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(); 2ce82: 0f 94 8a 35 call 0x26b14 ; 0x26b14 lcd_wizard_load(); 2ce86: 0f 94 6d 36 call 0x26cda ; 0x26cda state = S::Lay1CalHot; 2ce8a: cb e0 ldi r28, 0x0B ; 11 2ce8c: d9 ce rjmp .-590 ; 0x2cc40 break; case S::LoadFilCold: lcd_wizard_load(); 2ce8e: 0f 94 6d 36 call 0x26cda ; 0x26cda 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; 2ce92: ca e0 ldi r28, 0x0A ; 10 2ce94: d5 ce rjmp .-598 ; 0x2cc40 case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 2ce96: 81 e0 ldi r24, 0x01 ; 1 2ce98: 0f 94 4f 36 call 0x26c9e ; 0x26c9e menu_goto(lcd_v2_calibration, 0, true); 2ce9c: 20 e0 ldi r18, 0x00 ; 0 2ce9e: 41 e0 ldi r20, 0x01 ; 1 2cea0: 70 e0 ldi r23, 0x00 ; 0 2cea2: 60 e0 ldi r22, 0x00 ; 0 2cea4: 8b e9 ldi r24, 0x9B ; 155 2cea6: 99 e3 ldi r25, 0x39 ; 57 2cea8: 0f 94 32 cf call 0x39e64 ; 0x39e64 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); 2ceac: 0a e0 ldi r16, 0x0A ; 10 2ceae: 10 e0 ldi r17, 0x00 ; 0 2ceb0: 12 cf rjmp .-476 ; 0x2ccd6 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); 2ceb2: 80 e0 ldi r24, 0x00 ; 0 2ceb4: 0f 94 4f 36 call 0x26c9e ; 0x26c9e lcd_commands_type = LcdCommands::Layer1Cal; 2ceb8: 84 e0 ldi r24, 0x04 ; 4 2ceba: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 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); 2cebe: 0b e0 ldi r16, 0x0B ; 11 2cec0: 10 e0 ldi r17, 0x00 ; 0 2cec2: 09 cf rjmp .-494 ; 0x2ccd6 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); 2cec4: 83 e7 ldi r24, 0x73 ; 115 2cec6: 93 e5 ldi r25, 0x53 ; 83 2cec8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cecc: 41 e0 ldi r20, 0x01 ; 1 2cece: 60 e0 ldi r22, 0x00 ; 0 2ced0: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 2ced4: 81 11 cpse r24, r1 2ced6: 07 c0 rjmp .+14 ; 0x2cee6 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 2ced8: 83 e4 ldi r24, 0x43 ; 67 2ceda: 93 e5 ldi r25, 0x53 ; 83 2cedc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cee0: 0f 94 04 36 call 0x26c08 ; 0x26c08 2cee4: d6 cf rjmp .-84 ; 0x2ce92 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 2cee6: 8d ed ldi r24, 0xDD ; 221 2cee8: 92 e5 ldi r25, 0x52 ; 82 2ceea: d8 ce rjmp .-592 ; 0x2cc9c 2ceec: 60 e0 ldi r22, 0x00 ; 0 2ceee: 8f e5 ldi r24, 0x5F ; 95 2cef0: 9f e0 ldi r25, 0x0F ; 15 2cef2: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 2cef6: ef ce rjmp .-546 ; 0x2ccd6 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 2cef8: 8f e7 ldi r24, 0x7F ; 127 2cefa: 92 e5 ldi r25, 0x52 ; 82 2cefc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cf00: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2cf02: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL24lcd_status_message_level.lto_priv.455> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 2cf06: 8a e6 ldi r24, 0x6A ; 106 2cf08: 90 e7 ldi r25, 0x70 ; 112 2cf0a: 0f 94 e2 0b call 0x217c4 ; 0x217c4 lcd_return_to_status(); 2cf0e: 0f 94 4b 27 call 0x24e96 ; 0x24e96 default: // exiting for later re-entry break; } if (msg) { 2cf12: 01 15 cp r16, r1 2cf14: 11 05 cpc r17, r1 2cf16: 09 f4 brne .+2 ; 0x2cf1a 2cf18: f8 ce rjmp .-528 ; 0x2cd0a lcd_show_fullscreen_message_and_wait_P(msg); 2cf1a: c8 01 movw r24, r16 2cf1c: 0f 94 04 36 call 0x26c08 ; 0x26c08 2cf20: f4 ce rjmp .-536 ; 0x2cd0a lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 2cf22: 8d e1 ldi r24, 0x1D ; 29 2cf24: 92 e5 ldi r25, 0x52 ; 82 2cf26: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cf2a: 8c 01 movw r16, r24 2cf2c: f2 cf rjmp .-28 ; 0x2cf12 0002cf2e : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 2cf2e: 8f e1 ldi r24, 0x1F ; 31 2cf30: 0e 94 43 f9 call 0x1f286 ; 0x1f286 2cf34: 81 11 cpse r24, r1 2cf36: 06 c0 rjmp .+12 ; 0x2cf44 // calibration already performed: ask before clearing the previous status result = !lcd_show_multiscreen_message_cont_cancel_and_wait_P(_T(MSG_WIZARD_RERUN), false); } if (result) { calibration_status_clear(CALIBRATION_WIZARD_STEPS); 2cf38: 8f e1 ldi r24, 0x1F ; 31 2cf3a: 0e 94 09 e7 call 0x1ce12 ; 0x1ce12 lcd_wizard(WizState::Run); 2cf3e: 80 e0 ldi r24, 0x00 ; 0 2cf40: 0d 94 02 66 jmp 0x2cc04 ; 0x2cc04 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_cont_cancel_and_wait_P(_T(MSG_WIZARD_RERUN), false); 2cf44: 85 e1 ldi r24, 0x15 ; 21 2cf46: 9f e4 ldi r25, 0x4F ; 79 2cf48: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cf4c: 41 e0 ldi r20, 0x01 ; 1 2cf4e: 60 e0 ldi r22, 0x00 ; 0 2cf50: 0f 94 b0 65 call 0x2cb60 ; 0x2cb60 } if (result) { 2cf54: 88 23 and r24, r24 2cf56: 81 f3 breq .-32 ; 0x2cf38 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 2cf58: 0f 94 4b 27 call 0x24e96 ; 0x24e96 lcd_update_enable(true); 2cf5c: 81 e0 ldi r24, 0x01 ; 1 2cf5e: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_update(2); 2cf62: 82 e0 ldi r24, 0x02 ; 2 2cf64: 0c 94 54 6f jmp 0xdea8 ; 0xdea8 0002cf68 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 2cf68: cf 93 push r28 2cf6a: 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); 2cf6c: 80 e0 ldi r24, 0x00 ; 0 2cf6e: 92 e5 ldi r25, 0x52 ; 82 2cf70: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cf74: 41 e0 ldi r20, 0x01 ; 1 2cf76: 4c 27 eor r20, r28 2cf78: 60 e0 ldi r22, 0x00 ; 0 2cf7a: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 2cf7e: 91 e0 ldi r25, 0x01 ; 1 2cf80: 81 11 cpse r24, r1 2cf82: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 2cf84: c9 17 cp r28, r25 2cf86: 59 f0 breq .+22 ; 0x2cf9e lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 2cf88: 86 ed ldi r24, 0xD6 ; 214 2cf8a: 91 e5 ldi r25, 0x51 ; 81 2cf8c: cc 23 and r28, r28 2cf8e: 11 f0 breq .+4 ; 0x2cf94 2cf90: 85 e6 ldi r24, 0x65 ; 101 2cf92: 97 e4 ldi r25, 0x47 ; 71 2cf94: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 } #endif //STEEL_SHEET } 2cf98: 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)); 2cf9a: 0d 94 04 36 jmp 0x26c08 ; 0x26c08 } #endif //STEEL_SHEET } 2cf9e: cf 91 pop r28 2cfa0: 08 95 ret 0002cfa2 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 2cfa2: cf 93 push r28 2cfa4: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 2cfa6: 8d ea ldi r24, 0xAD ; 173 2cfa8: 91 e5 ldi r25, 0x51 ; 81 2cfaa: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cfae: 40 e0 ldi r20, 0x00 ; 0 2cfb0: 6c 2f mov r22, r28 2cfb2: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 if (result == LCD_LEFT_BUTTON_CHOICE) { 2cfb6: 81 11 cpse r24, r1 2cfb8: 03 c0 rjmp .+6 ; 0x2cfc0 lcd_mesh_calibration_z(); } } 2cfba: 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(); 2cfbc: 0d 94 8d 27 jmp 0x24f1a ; 0x24f1a } } 2cfc0: cf 91 pop r28 2cfc2: 08 95 ret 0002cfc4 : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 2cfc4: cf 93 push r28 2cfc6: c8 2f mov r28, r24 if (!lang_select(lang)) 2cfc8: 0e 94 e1 72 call 0xe5c2 ; 0xe5c2 2cfcc: 81 11 cpse r24, r1 2cfce: 37 c0 rjmp .+110 ; 0x2d03e { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 2cfd0: 80 e9 ldi r24, 0x90 ; 144 2cfd2: 9e e4 ldi r25, 0x4E ; 78 2cfd4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2cfd8: 40 e0 ldi r20, 0x00 ; 0 2cfda: 60 e0 ldi r22, 0x00 ; 0 2cfdc: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 2cfe0: 81 11 cpse r24, r1 2cfe2: 20 c0 rjmp .+64 ; 0x2d024 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 2cfe4: 0e 94 96 72 call 0xe52c ; 0xe52c if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 2cfe8: c2 30 cpi r28, 0x02 ; 2 2cfea: e0 f0 brcs .+56 ; 0x2d024 2cfec: 8c 17 cp r24, r28 2cfee: d0 f0 brcs .+52 ; 0x2d024 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 2cff0: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 2cff2: 8a ea ldi r24, 0xAA ; 170 2cff4: 95 e5 ldi r25, 0x55 ; 85 2cff6: dc 01 movw r26, r24 2cff8: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e5> 2cffc: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e6> 2d000: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e7> 2d004: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e8> boot_app_flags = BOOT_APP_FLG_USER0; 2d008: 80 e8 ldi r24, 0x80 ; 128 2d00a: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e4> boot_copy_size = 0; 2d00e: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7e2> 2d012: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7e1> bootapp_reboot_user0(lang << 3); 2d016: cc 0f add r28, r28 2d018: cc 0f add r28, r28 2d01a: cc 0f add r28, r28 boot_reserved = reserved; 2d01c: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7e3> // bootapp_print_vars(); softReset(); 2d020: 0e 94 f9 67 call 0xcff2 ; 0xcff2 lang_boot_update_start(lang); lcd_update_enable(true); 2d024: 81 e0 ldi r24, 0x01 ; 1 2d026: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 menu_goto(lcd_language_menu, 0, true, true); 2d02a: 21 e0 ldi r18, 0x01 ; 1 2d02c: 41 e0 ldi r20, 0x01 ; 1 2d02e: 70 e0 ldi r23, 0x00 ; 0 2d030: 60 e0 ldi r22, 0x00 ; 0 2d032: 87 e2 ldi r24, 0x27 ; 39 2d034: 9b e3 ldi r25, 0x3B ; 59 2d036: 0f 94 32 cf call 0x39e64 ; 0x39e64 2d03a: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 lcd_timeoutToStatus.stop(); //infinite timeout } } 2d03e: cf 91 pop r28 2d040: 08 95 ret 0002d042 : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 2d042: cf 93 push r28 MENU_BEGIN(); 2d044: 0f 94 08 cf call 0x39e10 ; 0x39e10 2d048: 10 92 13 05 sts 0x0513, r1 ; 0x800513 2d04c: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2d050: 84 30 cpi r24, 0x04 ; 4 2d052: 08 f0 brcs .+2 ; 0x2d056 2d054: 4a c0 rjmp .+148 ; 0x2d0ea 2d056: 10 92 16 05 sts 0x0516, r1 ; 0x800516 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 2d05a: 0e 94 ca 71 call 0xe394 ; 0xe394 2d05e: 88 23 and r24, r24 2d060: 31 f0 breq .+12 ; 0x2d06e 2d062: 87 e6 ldi r24, 0x67 ; 103 2d064: 9d e3 ldi r25, 0x3D ; 61 2d066: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d06a: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 2d06e: 8e e6 ldi r24, 0x6E ; 110 2d070: 95 e6 ldi r25, 0x65 ; 101 2d072: 0e 94 e0 71 call 0xe3c0 ; 0xe3c0 2d076: 0f 94 b6 ce call 0x39d6c ; 0x39d6c 2d07a: 88 23 and r24, r24 2d07c: 21 f0 breq .+8 ; 0x2d086 { menu_setlang(0); 2d07e: 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(); } 2d080: 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); 2d082: 0d 94 e2 67 jmp 0x2cfc4 ; 0x2cfc4 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(); 2d086: 0e 94 96 72 call 0xe52c ; 0xe52c 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 2d08a: 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 2d08c: 82 30 cpi r24, 0x02 ; 2 2d08e: 51 f4 brne .+20 ; 0x2d0a4 2d090: 0e 94 b7 71 call 0xe36e ; 0xe36e { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 2d094: 0e 94 e0 71 call 0xe3c0 ; 0xe3c0 2d098: 0f 94 b6 ce call 0x39d6c ; 0x39d6c 2d09c: 88 23 and r24, r24 2d09e: 81 f0 breq .+32 ; 0x2d0c0 { menu_setlang(1); 2d0a0: 81 e0 ldi r24, 0x01 ; 1 2d0a2: ee cf rjmp .-36 ; 0x2d080 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)))) 2d0a4: 8c 2f mov r24, r28 2d0a6: 0e 94 47 72 call 0xe48e ; 0xe48e 2d0aa: 0e 94 e0 71 call 0xe3c0 ; 0xe3c0 2d0ae: 0f 94 b6 ce call 0x39d6c ; 0x39d6c 2d0b2: 88 23 and r24, r24 2d0b4: 11 f0 breq .+4 ; 0x2d0ba { menu_setlang(i); 2d0b6: 8c 2f mov r24, r28 2d0b8: e3 cf rjmp .-58 ; 0x2d080 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 2d0ba: cf 5f subi r28, 0xFF ; 255 2d0bc: c8 30 cpi r28, 0x08 ; 8 2d0be: 91 f7 brne .-28 ; 0x2d0a4 return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 2d0c0: 8a ea ldi r24, 0xAA ; 170 2d0c2: 9e e4 ldi r25, 0x4E ; 78 2d0c4: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d0c8: 6d ee ldi r22, 0xED ; 237 2d0ca: 7a e3 ldi r23, 0x3A ; 58 2d0cc: 0f 94 86 d1 call 0x3a30c ; 0x3a30c #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 2d0d0: 0f 94 dc ce call 0x39db8 ; 0x39db8 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 2d0d4: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2d0d8: 8f 5f subi r24, 0xFF ; 255 2d0da: 80 93 13 05 sts 0x0513, r24 ; 0x800513 2d0de: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2d0e2: 8f 5f subi r24, 0xFF ; 255 2d0e4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2d0e8: b1 cf rjmp .-158 ; 0x2d04c MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 2d0ea: cf 91 pop r28 2d0ec: 08 95 ret 0002d0ee : } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 2d0ee: cf 93 push r28 2d0f0: df 93 push r29 MENU_BEGIN(); 2d0f2: 0f 94 08 cf call 0x39e10 ; 0x39e10 2d0f6: 10 92 13 05 sts 0x0513, r1 ; 0x800513 2d0fa: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2d0fe: 84 30 cpi r24, 0x04 ; 4 2d100: 58 f5 brcc .+86 ; 0x2d158 2d102: 10 92 16 05 sts 0x0516, r1 ; 0x800516 uint8_t cnt = lang_get_count(); 2d106: 0e 94 96 72 call 0xe52c ; 0xe52c 2d10a: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 2d10c: 8f e8 ldi r24, 0x8F ; 143 2d10e: 97 e5 ldi r25, 0x57 ; 87 2d110: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d114: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 for (uint8_t i = 8; i < cnt; i++) //all community languages 2d118: c8 e0 ldi r28, 0x08 ; 8 2d11a: cd 17 cp r28, r29 2d11c: 80 f4 brcc .+32 ; 0x2d13e if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 2d11e: 8c 2f mov r24, r28 2d120: 0e 94 47 72 call 0xe48e ; 0xe48e 2d124: 0e 94 e0 71 call 0xe3c0 ; 0xe3c0 2d128: 0f 94 b6 ce call 0x39d6c ; 0x39d6c 2d12c: 88 23 and r24, r24 2d12e: 29 f0 breq .+10 ; 0x2d13a { menu_setlang(i); 2d130: 8c 2f mov r24, r28 return; } MENU_END(); } 2d132: df 91 pop r29 2d134: 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); 2d136: 0d 94 e2 67 jmp 0x2cfc4 ; 0x2cfc4 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 2d13a: cf 5f subi r28, 0xFF ; 255 2d13c: ee cf rjmp .-36 ; 0x2d11a if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 2d13e: 0f 94 dc ce call 0x39db8 ; 0x39db8 #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 2d142: 80 91 13 05 lds r24, 0x0513 ; 0x800513 2d146: 8f 5f subi r24, 0xFF ; 255 2d148: 80 93 13 05 sts 0x0513, r24 ; 0x800513 2d14c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2d150: 8f 5f subi r24, 0xFF ; 255 2d152: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2d156: d1 cf rjmp .-94 ; 0x2d0fa { menu_setlang(i); return; } MENU_END(); } 2d158: df 91 pop r29 2d15a: cf 91 pop r28 2d15c: 08 95 ret 0002d15e : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 2d15e: cf 92 push r12 2d160: ef 92 push r14 2d162: ff 92 push r15 2d164: 0f 93 push r16 2d166: 1f 93 push r17 2d168: cf 93 push r28 2d16a: df 93 push r29 // >Ja >Nein >Auswerfen // Hungarian // 01234567890123456789 // >Igen >Nem >Kiadás 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), strlen_P(_T(MSG_YES))+2); 2d16c: 82 e7 ldi r24, 0x72 ; 114 2d16e: 9d e3 ldi r25, 0x3D ; 61 2d170: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d174: 0f 94 47 db call 0x3b68e ; 0x3b68e <__strlen_P> 2d178: c8 2e mov r12, r24 2d17a: 8b ee ldi r24, 0xEB ; 235 2d17c: 9b e4 ldi r25, 0x4B ; 75 2d17e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d182: 7c 01 movw r14, r24 2d184: 88 e7 ldi r24, 0x78 ; 120 2d186: 9d e3 ldi r25, 0x3D ; 61 2d188: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d18c: 8c 01 movw r16, r24 2d18e: 82 e7 ldi r24, 0x72 ; 114 2d190: 9d e3 ldi r25, 0x3D ; 61 2d192: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d196: ec 01 movw r28, r24 2d198: 80 ec ldi r24, 0xC0 ; 192 2d19a: 9b e4 ldi r25, 0x4B ; 75 2d19c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d1a0: c3 94 inc r12 2d1a2: c3 94 inc r12 2d1a4: 9e 01 movw r18, r28 2d1a6: 40 e0 ldi r20, 0x00 ; 0 2d1a8: 60 e0 ldi r22, 0x00 ; 0 2d1aa: 0f 94 dd 64 call 0x2c9ba ; 0x2c9ba while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 2d1ae: 81 30 cpi r24, 0x01 ; 1 2d1b0: 29 f4 brne .+10 ; 0x2d1bc load_filament_final_feed(); 2d1b2: 0e 94 40 65 call 0xca80 ; 0xca80 st_synchronize(); 2d1b6: 0f 94 24 59 call 0x2b248 ; 0x2b248 2d1ba: d8 cf rjmp .-80 ; 0x2d16c 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), strlen_P(_T(MSG_YES))+2); } if (clean == LCD_RIGHT_BUTTON_CHOICE) { 2d1bc: 82 30 cpi r24, 0x02 ; 2 2d1be: 61 f4 brne .+24 ; 0x2d1d8 unload_filament(FILAMENTCHANGE_FINALRETRACT); 2d1c0: 60 e0 ldi r22, 0x00 ; 0 2d1c2: 70 e0 ldi r23, 0x00 ; 0 2d1c4: cb 01 movw r24, r22 } } 2d1c6: df 91 pop r29 2d1c8: cf 91 pop r28 2d1ca: 1f 91 pop r17 2d1cc: 0f 91 pop r16 2d1ce: ff 90 pop r15 2d1d0: ef 90 pop r14 2d1d2: 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), strlen_P(_T(MSG_YES))+2); } if (clean == LCD_RIGHT_BUTTON_CHOICE) { unload_filament(FILAMENTCHANGE_FINALRETRACT); 2d1d4: 0d 94 cf 16 jmp 0x22d9e ; 0x22d9e } } 2d1d8: df 91 pop r29 2d1da: cf 91 pop r28 2d1dc: 1f 91 pop r17 2d1de: 0f 91 pop r16 2d1e0: ff 90 pop r15 2d1e2: ef 90 pop r14 2d1e4: cf 90 pop r12 2d1e6: 08 95 ret 0002d1e8 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 2d1e8: 0f 93 push r16 2d1ea: 1f 93 push r17 2d1ec: cf 93 push r28 2d1ee: df 93 push r29 2d1f0: 8c 01 movw r16, r24 2d1f2: 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; 2d1f4: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 2d1f8: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 2d1fc: 0f 94 db 22 call 0x245b6 ; 0x245b6 2d200: 81 11 cpse r24, r1 2d202: 04 c0 rjmp .+8 ; 0x2d20c resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2d204: d0 93 6a 0e sts 0x0E6A, r29 ; 0x800e6a 2d208: c0 93 69 0e sts 0x0E69, r28 ; 0x800e69 { const FilamentAction action = eFilamentAction; 2d20c: c0 91 a5 03 lds r28, 0x03A5 ; 0x8003a5 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 2d210: 87 ef ldi r24, 0xF7 ; 247 2d212: 8c 0f add r24, r28 2d214: 82 30 cpi r24, 0x02 ; 2 2d216: f8 f4 brcc .+62 ; 0x2d256 { lcd_return_to_status(); 2d218: 0f 94 4b 27 call 0x24e96 ; 0x24e96 if (action == FilamentAction::Lay1Cal) 2d21c: ca 30 cpi r28, 0x0A ; 10 2d21e: 41 f4 brne .+16 ; 0x2d230 { lcd_commands_type = LcdCommands::Layer1Cal; 2d220: 84 e0 ldi r24, 0x04 ; 4 2d222: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 } menu_back(); clearFilamentAction(); } } } 2d226: df 91 pop r29 2d228: cf 91 pop r28 2d22a: 1f 91 pop r17 2d22c: 0f 91 pop r16 2d22e: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 2d230: 60 e0 ldi r22, 0x00 ; 0 2d232: 70 e0 ldi r23, 0x00 ; 0 2d234: 80 e2 ldi r24, 0x20 ; 32 2d236: 91 e4 ldi r25, 0x41 ; 65 2d238: 0e 94 0d 6f call 0xde1a ; 0xde1a if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2d23c: 8f e5 ldi r24, 0x5F ; 95 2d23e: 9f e0 ldi r25, 0x0F ; 15 2d240: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2d244: 88 23 and r24, r24 2d246: 79 f3 breq .-34 ; 0x2d226 lcd_wizard(WizState::LoadFilHot); 2d248: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 2d24a: df 91 pop r29 2d24c: cf 91 pop r28 2d24e: 1f 91 pop r17 2d250: 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); 2d252: 0d 94 02 66 jmp 0x2cc04 ; 0x2cc04 2d256: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 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) 2d25a: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d25e: 81 11 cpse r24, r1 2d260: 12 c0 rjmp .+36 ; 0x2d286 2d262: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 2d266: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 2d26a: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 2d26e: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 2d272: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 2d276: 60 1b sub r22, r16 2d278: 71 0b sbc r23, r17 2d27a: 6c 5f subi r22, 0xFC ; 252 2d27c: 7f 4f sbci r23, 0xFF ; 255 2d27e: 69 30 cpi r22, 0x09 ; 9 2d280: 71 05 cpc r23, r1 2d282: 08 f0 brcs .+2 ; 0x2d286 2d284: 60 c0 rjmp .+192 ; 0x2d346 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 2d286: c1 50 subi r28, 0x01 ; 1 2d288: c8 30 cpi r28, 0x08 ; 8 2d28a: 88 f5 brcc .+98 ; 0x2d2ee 2d28c: ec 2f mov r30, r28 2d28e: f0 e0 ldi r31, 0x00 ; 0 2d290: 88 27 eor r24, r24 2d292: e2 5b subi r30, 0xB2 ; 178 2d294: f6 49 sbci r31, 0x96 ; 150 2d296: 8e 4f sbci r24, 0xFE ; 254 2d298: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 2d29c: 7b 39 cpi r23, 0x9B ; 155 2d29e: 7b 39 cpi r23, 0x9B ; 155 2d2a0: 7b 39 cpi r23, 0x9B ; 155 2d2a2: 55 3a cpi r21, 0xA5 ; 165 2d2a4: 13 3b cpi r17, 0xB3 ; 179 2d2a6: 9b 3a cpi r25, 0xAB ; 171 2d2a8: b1 39 cpi r27, 0x91 ; 145 2d2aa: ff 3a cpi r31, 0xAF ; 175 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2d2ac: c2 e8 ldi r28, 0x82 ; 130 2d2ae: d9 ed ldi r29, 0xD9 ; 217 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2d2b0: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2d2b4: 88 23 and r24, r24 2d2b6: 29 f0 breq .+10 ; 0x2d2c2 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2d2b8: 82 e0 ldi r24, 0x02 ; 2 2d2ba: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee bFilamentWaitingFlag = false; 2d2be: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } if (filamentActionMenu) { 2d2c2: 20 97 sbiw r28, 0x00 ; 0 2d2c4: 09 f4 brne .+2 ; 0x2d2c8 2d2c6: af cf rjmp .-162 ; 0x2d226 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2d2c8: 0f 94 11 2f call 0x25e22 ; 0x25e22 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2d2cc: 61 e0 ldi r22, 0x01 ; 1 2d2ce: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2d2d0: df 91 pop r29 2d2d2: cf 91 pop r28 2d2d4: 1f 91 pop r17 2d2d6: 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); 2d2d8: 0d 94 75 d0 jmp 0x3a0ea ; 0x3a0ea switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2d2dc: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2d2e0: 88 23 and r24, r24 2d2e2: 41 f0 breq .+16 ; 0x2d2f4 2d2e4: 61 e0 ldi r22, 0x01 ; 1 2d2e6: 8f e1 ldi r24, 0x1F ; 31 2d2e8: 9b e3 ldi r25, 0x3B ; 59 2d2ea: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea // 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; 2d2ee: d0 e0 ldi r29, 0x00 ; 0 2d2f0: c0 e0 ldi r28, 0x00 ; 0 2d2f2: de cf rjmp .-68 ; 0x2d2b0 case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2d2f4: 0f 94 11 2f call 0x25e22 ; 0x25e22 if (eFilamentAction == FilamentAction::AutoLoad) { 2d2f8: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 2d2fc: 82 30 cpi r24, 0x02 ; 2 2d2fe: 19 f4 brne .+6 ; 0x2d306 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2d300: 81 e0 ldi r24, 0x01 ; 1 2d302: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 } if (eFilamentAction == FilamentAction::Load) 2d306: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 2d30a: 81 30 cpi r24, 0x01 ; 1 2d30c: 31 f4 brne .+12 ; 0x2d31a enquecommand_P(MSG_M701); // load filament 2d30e: 61 e0 ldi r22, 0x01 ; 1 2d310: 80 e8 ldi r24, 0x80 ; 128 2d312: 9f e6 ldi r25, 0x6F ; 111 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2d314: 0e 94 43 89 call 0x11286 ; 0x11286 2d318: ea cf rjmp .-44 ; 0x2d2ee eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 2d31a: 83 30 cpi r24, 0x03 ; 3 2d31c: 41 f7 brne .-48 ; 0x2d2ee enquecommand_P(MSG_M702); // unload filament 2d31e: 61 e0 ldi r22, 0x01 ; 1 2d320: 88 e1 ldi r24, 0x18 ; 24 2d322: 9c e6 ldi r25, 0x6C ; 108 2d324: f7 cf rjmp .-18 ; 0x2d314 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2d326: cc ef ldi r28, 0xFC ; 252 2d328: d8 ed ldi r29, 0xD8 ; 216 2d32a: c2 cf rjmp .-124 ; 0x2d2b0 break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2d32c: 0f 94 11 2f call 0x25e22 ; 0x25e22 MMU2::mmu2.unload(); 2d330: 0f 94 65 a0 call 0x340ca ; 0x340ca // 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(); 2d334: 0f 94 ec 36 call 0x26dd8 ; 0x26dd8 2d338: da cf rjmp .-76 ; 0x2d2ee break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2d33a: ca e7 ldi r28, 0x7A ; 122 2d33c: d9 ed ldi r29, 0xD9 ; 217 2d33e: b8 cf rjmp .-144 ; 0x2d2b0 break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2d340: c2 e7 ldi r28, 0x72 ; 114 2d342: d9 ed ldi r29, 0xD9 ; 217 2d344: b5 cf rjmp .-150 ; 0x2d2b0 menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2d346: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2d34a: 88 23 and r24, r24 2d34c: 21 f0 breq .+8 ; 0x2d356 2d34e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2d352: 88 23 and r24, r24 2d354: a1 f1 breq .+104 ; 0x2d3be // 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; 2d356: 81 e0 ldi r24, 0x01 ; 1 2d358: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 2d35c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2d360: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0,3, PSTR(">")); 2d364: 44 e7 ldi r20, 0x74 ; 116 2d366: 52 ea ldi r21, 0xA2 ; 162 2d368: 63 e0 ldi r22, 0x03 ; 3 2d36a: 80 e0 ldi r24, 0x00 ; 0 2d36c: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_puts_at_P(1, 3, _T(MSG_CANCEL)); 2d370: 8c e0 ldi r24, 0x0C ; 12 2d372: 9f e4 ldi r25, 0x4F ; 79 2d374: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d378: ac 01 movw r20, r24 2d37a: 63 e0 ldi r22, 0x03 ; 3 2d37c: 81 e0 ldi r24, 0x01 ; 1 2d37e: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(0, 1); 2d382: 61 e0 ldi r22, 0x01 ; 1 2d384: 80 e0 ldi r24, 0x00 ; 0 2d386: 0e 94 8d 6f call 0xdf1a ; 0xdf1a switch (eFilamentAction) 2d38a: e0 91 a5 03 lds r30, 0x03A5 ; 0x8003a5 2d38e: e1 50 subi r30, 0x01 ; 1 2d390: e8 30 cpi r30, 0x08 ; 8 2d392: a8 f4 brcc .+42 ; 0x2d3be 2d394: f0 e0 ldi r31, 0x00 ; 0 2d396: 88 27 eor r24, r24 2d398: ef 52 subi r30, 0x2F ; 47 2d39a: f6 49 sbci r31, 0x96 ; 150 2d39c: 8e 4f sbci r24, 0xFE ; 254 2d39e: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 2d3a2: b5 3a cpi r27, 0xA5 ; 165 2d3a4: b5 3a cpi r27, 0xA5 ; 165 2d3a6: df 3a cpi r29, 0xAF ; 175 2d3a8: b5 3a cpi r27, 0xA5 ; 165 2d3aa: df 3a cpi r29, 0xAF ; 175 2d3ac: e1 3a cpi r30, 0xA1 ; 161 2d3ae: 5d 3a cpi r21, 0xAD ; 173 2d3b0: b5 3a cpi r27, 0xA5 ; 165 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2d3b2: 80 ea ldi r24, 0xA0 ; 160 2d3b4: 9b e4 ldi r25, 0x4B ; 75 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2d3b6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2d3ba: 0e 94 78 6f call 0xdef0 ; 0xdef0 // handled earlier break; } } if (bFilamentWaitingFlag) { 2d3be: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2d3c2: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2d3c4: 0f 94 38 2f call 0x25e70 ; 0x25e70 } if (lcd_clicked()) 2d3c8: 0e 94 aa 71 call 0xe354 ; 0xe354 2d3cc: 88 23 and r24, r24 2d3ce: 09 f4 brne .+2 ; 0x2d3d2 2d3d0: 2a cf rjmp .-428 ; 0x2d226 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2d3d2: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d if (!bFilamentPreheatState) 2d3d6: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 2d3da: 81 11 cpse r24, r1 2d3dc: 0e c0 rjmp .+28 ; 0x2d3fa return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2d3de: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 2d3e2: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2d3e6: 0e 94 32 68 call 0xd064 ; 0xd064 2d3ea: 81 11 cpse r24, r1 2d3ec: 04 c0 rjmp .+8 ; 0x2d3f6 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2d3ee: 10 92 6a 0e sts 0x0E6A, r1 ; 0x800e6a 2d3f2: 10 92 69 0e sts 0x0E69, r1 ; 0x800e69 menu_back(); 2d3f6: 0f 94 d0 d1 call 0x3a3a0 ; 0x3a3a0 } menu_back(); 2d3fa: 0f 94 d0 d1 call 0x3a3a0 ; 0x3a3a0 clearFilamentAction(); } } } 2d3fe: df 91 pop r29 2d400: cf 91 pop r28 2d402: 1f 91 pop r17 2d404: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2d406: 0d 94 ec 36 jmp 0x26dd8 ; 0x26dd8 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)); 2d40a: 89 e8 ldi r24, 0x89 ; 137 2d40c: 9b e4 ldi r25, 0x4B ; 75 2d40e: d3 cf rjmp .-90 ; 0x2d3b6 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2d410: 83 e7 ldi r24, 0x73 ; 115 2d412: 9b e4 ldi r25, 0x4B ; 75 2d414: d0 cf rjmp .-96 ; 0x2d3b6 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2d416: 8f e5 ldi r24, 0x5F ; 95 2d418: 9b e4 ldi r25, 0x4B ; 75 2d41a: cd cf rjmp .-102 ; 0x2d3b6 0002d41c : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2d41c: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2d420: 40 91 96 13 lds r20, 0x1396 ; 0x801396 2d424: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 2d428: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 2d42c: 41 30 cpi r20, 0x01 ; 1 2d42e: 59 f0 breq .+22 ; 0x2d446 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() 2d430: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2d434: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2d438: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2d43c: 28 17 cp r18, r24 2d43e: 39 07 cpc r19, r25 2d440: 5c f4 brge .+22 ; 0x2d458 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2d442: 0d 94 ef 36 jmp 0x26dde ; 0x26dde 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() 2d446: 90 91 6c 13 lds r25, 0x136C ; 0x80136c 2d44a: 91 11 cpse r25, r1 2d44c: f1 cf rjmp .-30 ; 0x2d430 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2d44e: 86 50 subi r24, 0x06 ; 6 2d450: 82 30 cpi r24, 0x02 ; 2 2d452: 70 f7 brcc .-36 ; 0x2d430 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() 2d454: 40 93 5f 06 sts 0x065F, r20 ; 0x80065f && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2d458: 81 e0 ldi r24, 0x01 ; 1 2d45a: 80 93 5e 06 sts 0x065E, r24 ; 0x80065e mFilamentItem(target_temperature[0], target_temperature_bed); 2d45e: 60 91 69 0e lds r22, 0x0E69 ; 0x800e69 2d462: 70 91 6a 0e lds r23, 0x0E6A ; 0x800e6a 2d466: c9 01 movw r24, r18 2d468: 0f 94 f4 68 call 0x2d1e8 ; 0x2d1e8 bFilamentSkipPreheat = false; // Reset flag 2d46c: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f } else { lcd_generic_preheat_menu(); } } 2d470: 08 95 ret 0002d472 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2d472: 82 e0 ldi r24, 0x02 ; 2 2d474: 0d 94 0e 6a jmp 0x2d41c ; 0x2d41c 0002d478 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2d478: 81 e0 ldi r24, 0x01 ; 1 2d47a: 0d 94 0e 6a jmp 0x2d41c ; 0x2d41c 0002d47e : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2d47e: 83 e0 ldi r24, 0x03 ; 3 2d480: 0d 94 0e 6a jmp 0x2d41c ; 0x2d41c 0002d484 : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2d484: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2d488: 6c e3 ldi r22, 0x3C ; 60 2d48a: 70 e0 ldi r23, 0x00 ; 0 2d48c: 87 ed ldi r24, 0xD7 ; 215 2d48e: 90 e0 ldi r25, 0x00 ; 0 2d490: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d494 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2d494: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2d498: 65 e5 ldi r22, 0x55 ; 85 2d49a: 70 e0 ldi r23, 0x00 ; 0 2d49c: 86 ee ldi r24, 0xE6 ; 230 2d49e: 90 e0 ldi r25, 0x00 ; 0 2d4a0: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d4a4 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2d4a4: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2d4a8: 69 e6 ldi r22, 0x69 ; 105 2d4aa: 70 e0 ldi r23, 0x00 ; 0 2d4ac: 84 e0 ldi r24, 0x04 ; 4 2d4ae: 91 e0 ldi r25, 0x01 ; 1 2d4b0: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d4b4 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2d4b4: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2d4b8: 6e e6 ldi r22, 0x6E ; 110 2d4ba: 70 e0 ldi r23, 0x00 ; 0 2d4bc: 83 e1 ldi r24, 0x13 ; 19 2d4be: 91 e0 ldi r25, 0x01 ; 1 2d4c0: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d4c4 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2d4c4: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2d4c8: 6b e4 ldi r22, 0x4B ; 75 2d4ca: 70 e0 ldi r23, 0x00 ; 0 2d4cc: 87 ed ldi r24, 0xD7 ; 215 2d4ce: 90 e0 ldi r25, 0x00 ; 0 2d4d0: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d4d4 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2d4d4: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2d4d8: 6a e5 ldi r22, 0x5A ; 90 2d4da: 70 e0 ldi r23, 0x00 ; 0 2d4dc: 83 e1 ldi r24, 0x13 ; 19 2d4de: 91 e0 ldi r25, 0x01 ; 1 2d4e0: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d4e4 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2d4e4: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2d4e8: 64 e6 ldi r22, 0x64 ; 100 2d4ea: 70 e0 ldi r23, 0x00 ; 0 2d4ec: 8f ef ldi r24, 0xFF ; 255 2d4ee: 90 e0 ldi r25, 0x00 ; 0 2d4f0: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d4f4 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2d4f4: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2d4f8: 64 e6 ldi r22, 0x64 ; 100 2d4fa: 70 e0 ldi r23, 0x00 ; 0 2d4fc: 8c ed ldi r24, 0xDC ; 220 2d4fe: 90 e0 ldi r25, 0x00 ; 0 2d500: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d504 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2d504: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2d508: 64 e6 ldi r22, 0x64 ; 100 2d50a: 70 e0 ldi r23, 0x00 ; 0 2d50c: 8e ef ldi r24, 0xFE ; 254 2d50e: 90 e0 ldi r25, 0x00 ; 0 2d510: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d514 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2d514: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2d518: 62 e3 ldi r22, 0x32 ; 50 2d51a: 70 e0 ldi r23, 0x00 ; 0 2d51c: 80 ef ldi r24, 0xF0 ; 240 2d51e: 90 e0 ldi r25, 0x00 ; 0 2d520: 0d 94 f4 68 jmp 0x2d1e8 ; 0x2d1e8 0002d524 : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d524: 80 e0 ldi r24, 0x00 ; 0 2d526: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2d52a: 0e 94 61 e4 call 0x1c8c2 ; 0x1c8c2 lcd_return_to_status(); 2d52e: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 0002d532 : } 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){ 2d532: cf 92 push r12 2d534: df 92 push r13 2d536: ef 92 push r14 2d538: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2d53a: 41 11 cpse r20, r1 2d53c: 04 c0 rjmp .+8 ; 0x2d546 2d53e: 20 91 df 04 lds r18, 0x04DF ; 0x8004df 2d542: 22 30 cpi r18, 0x02 ; 2 2d544: d1 f0 breq .+52 ; 0x2d57a 2d546: 9b 01 movw r18, r22 2d548: 6c 01 movw r12, r24 2d54a: f1 2c mov r15, r1 2d54c: e1 2c mov r14, r1 if(!tone_) { 2d54e: 67 2b or r22, r23 2d550: c9 f4 brne .+50 ; 0x2d584 WRITE(BEEPER, HIGH); 2d552: 9f b7 in r25, 0x3f ; 63 2d554: f8 94 cli 2d556: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d55a: 84 60 ori r24, 0x04 ; 4 2d55c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d560: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2d562: c7 01 movw r24, r14 2d564: b6 01 movw r22, r12 2d566: 0f 94 8a 3d call 0x27b14 ; 0x27b14 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); 2d56a: 9f b7 in r25, 0x3f ; 63 2d56c: f8 94 cli 2d56e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d572: 8b 7f andi r24, 0xFB ; 251 2d574: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d578: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2d57a: ff 90 pop r15 2d57c: ef 90 pop r14 2d57e: df 90 pop r13 2d580: cf 90 pop r12 2d582: 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); 2d584: 22 0f add r18, r18 2d586: 33 1f adc r19, r19 2d588: 50 e0 ldi r21, 0x00 ; 0 2d58a: 40 e0 ldi r20, 0x00 ; 0 2d58c: 60 e0 ldi r22, 0x00 ; 0 2d58e: 74 e2 ldi r23, 0x24 ; 36 2d590: 84 ef ldi r24, 0xF4 ; 244 2d592: 90 e0 ldi r25, 0x00 ; 0 2d594: 0f 94 7a de call 0x3bcf4 ; 0x3bcf4 <__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; 2d598: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2d59a: 21 15 cp r18, r1 2d59c: 31 05 cpc r19, r1 2d59e: 81 e0 ldi r24, 0x01 ; 1 2d5a0: 48 07 cpc r20, r24 2d5a2: 51 05 cpc r21, r1 2d5a4: 44 f0 brlt .+16 ; 0x2d5b6 pwm_freq /= 64; // Increase prescaler to 64 2d5a6: 86 e0 ldi r24, 0x06 ; 6 2d5a8: 56 95 lsr r21 2d5aa: 47 95 ror r20 2d5ac: 37 95 ror r19 2d5ae: 27 95 ror r18 2d5b0: 8a 95 dec r24 2d5b2: d1 f7 brne .-12 ; 0x2d5a8 prescalarbits = 0b011; 2d5b4: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2d5b6: 21 50 subi r18, 0x01 ; 1 2d5b8: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2d5ba: 4f b7 in r20, 0x3f ; 63 2d5bc: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2d5be: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d5c2: 88 7f andi r24, 0xF8 ; 248 2d5c4: 89 2b or r24, r25 2d5c6: 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); 2d5ca: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d5ce: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d5d2: 26 9f mul r18, r22 2d5d4: c0 01 movw r24, r0 2d5d6: 27 9f mul r18, r23 2d5d8: 90 0d add r25, r0 2d5da: 36 9f mul r19, r22 2d5dc: 90 0d add r25, r0 2d5de: 11 24 eor r1, r1 2d5e0: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d5e4: 6f ef ldi r22, 0xFF ; 255 2d5e6: 70 e0 ldi r23, 0x00 ; 0 2d5e8: 51 ff sbrs r21, 1 2d5ea: 04 c0 rjmp .+8 ; 0x2d5f4 2d5ec: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d5f0: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d5f4: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 2d5f8: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d5fc: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2d600: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d604: 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); 2d608: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d60c: 83 60 ori r24, 0x03 ; 3 2d60e: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d612: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2d614: c7 01 movw r24, r14 2d616: b6 01 movw r22, r12 2d618: 0f 94 8a 3d call 0x27b14 ; 0x27b14 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2d61c: 2f b7 in r18, 0x3f ; 63 2d61e: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2d620: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d624: 88 7f andi r24, 0xF8 ; 248 2d626: 85 60 ori r24, 0x05 ; 5 2d628: 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); 2d62c: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d630: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d634: 3f ef ldi r19, 0xFF ; 255 2d636: 34 9f mul r19, r20 2d638: c0 01 movw r24, r0 2d63a: 35 9f mul r19, r21 2d63c: 90 0d add r25, r0 2d63e: 11 24 eor r1, r1 2d640: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d644: 6f ef ldi r22, 0xFF ; 255 2d646: 70 e0 ldi r23, 0x00 ; 0 2d648: 31 ff sbrs r19, 1 2d64a: 04 c0 rjmp .+8 ; 0x2d654 2d64c: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d650: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d654: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 2d658: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d65c: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2d660: 8f ef ldi r24, 0xFF ; 255 2d662: 90 e0 ldi r25, 0x00 ; 0 2d664: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d668: 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)); 2d66c: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d670: 8c 7f andi r24, 0xFC ; 252 2d672: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d676: 2f bf out 0x3f, r18 ; 63 2d678: 78 cf rjmp .-272 ; 0x2d56a 0002d67a : /// 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() { 2d67a: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2d67c: c0 91 df 04 lds r28, 0x04DF ; 0x8004df 2d680: c2 30 cpi r28, 0x02 ; 2 2d682: 59 f1 breq .+86 ; 0x2d6da // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2d684: c1 30 cpi r28, 0x01 ; 1 2d686: 69 f4 brne .+26 ; 0x2d6a2 if (bFirst) return; 2d688: 80 91 6d 05 lds r24, 0x056D ; 0x80056d <_ZL6bFirst.lto_priv.514> 2d68c: 81 11 cpse r24, r1 2d68e: 25 c0 rjmp .+74 ; 0x2d6da Sound_MakeCustom(80, 0, false); 2d690: 40 e0 ldi r20, 0x00 ; 0 2d692: 70 e0 ldi r23, 0x00 ; 0 2d694: 60 e0 ldi r22, 0x00 ; 0 2d696: 80 e5 ldi r24, 0x50 ; 80 2d698: 90 e0 ldi r25, 0x00 ; 0 2d69a: 0f 94 99 6a call 0x2d532 ; 0x2d532 bFirst = true; 2d69e: c0 93 6d 05 sts 0x056D, r28 ; 0x80056d <_ZL6bFirst.lto_priv.514> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 2d6a2: 60 ed ldi r22, 0xD0 ; 208 2d6a4: 77 e0 ldi r23, 0x07 ; 7 2d6a6: 8a e6 ldi r24, 0x6A ; 106 2d6a8: 95 e0 ldi r25, 0x05 ; 5 2d6aa: 0f 94 dd 3f call 0x27fba ; 0x27fba ::expired_cont(unsigned short)> 2d6ae: 88 23 and r24, r24 2d6b0: a1 f0 breq .+40 ; 0x2d6da beep_timer.start(); 2d6b2: 8a e6 ldi r24, 0x6A ; 106 2d6b4: 95 e0 ldi r25, 0x05 ; 5 2d6b6: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2d6ba: 80 91 df 04 lds r24, 0x04DF ; 0x8004df 2d6be: 81 11 cpse r24, r1 2d6c0: 08 c0 rjmp .+16 ; 0x2d6d2 Sound_MakeCustom(80, 0, false); 2d6c2: 40 e0 ldi r20, 0x00 ; 0 2d6c4: 70 e0 ldi r23, 0x00 ; 0 2d6c6: 60 e0 ldi r22, 0x00 ; 0 2d6c8: 80 e5 ldi r24, 0x50 ; 80 2d6ca: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2d6cc: 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); 2d6ce: 0d 94 99 6a jmp 0x2d532 ; 0x2d532 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d6d2: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2d6d4: 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); 2d6d6: 0d 94 77 64 jmp 0x2c8ee ; 0x2c8ee } } #endif // BEEPER > 0 } 2d6da: cf 91 pop r28 2d6dc: 08 95 ret 0002d6de : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2d6de: 82 30 cpi r24, 0x02 ; 2 2d6e0: b9 f0 breq .+46 ; 0x2d710 2d6e2: 83 30 cpi r24, 0x03 ; 3 2d6e4: e9 f0 breq .+58 ; 0x2d720 2d6e6: 81 30 cpi r24, 0x01 ; 1 2d6e8: 59 f0 breq .+22 ; 0x2d700 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; 2d6ea: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d6ee: 61 30 cpi r22, 0x01 ; 1 2d6f0: 29 f4 brne .+10 ; 0x2d6fc 2d6f2: 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; 2d6f4: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2d6f8: 00 00 nop } 2d6fa: 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; 2d6fc: 8e 7f andi r24, 0xFE ; 254 2d6fe: fa cf rjmp .-12 ; 0x2d6f4 case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2d700: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d704: 61 11 cpse r22, r1 2d706: 02 c0 rjmp .+4 ; 0x2d70c 2d708: 82 60 ori r24, 0x02 ; 2 2d70a: f4 cf rjmp .-24 ; 0x2d6f4 2d70c: 8d 7f andi r24, 0xFD ; 253 2d70e: f2 cf rjmp .-28 ; 0x2d6f4 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2d710: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d714: 61 30 cpi r22, 0x01 ; 1 2d716: 11 f4 brne .+4 ; 0x2d71c 2d718: 84 60 ori r24, 0x04 ; 4 2d71a: ec cf rjmp .-40 ; 0x2d6f4 2d71c: 8b 7f andi r24, 0xFB ; 251 2d71e: ea cf rjmp .-44 ; 0x2d6f4 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2d720: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d724: 61 11 cpse r22, r1 2d726: 02 c0 rjmp .+4 ; 0x2d72c 2d728: 80 64 ori r24, 0x40 ; 64 2d72a: e4 cf rjmp .-56 ; 0x2d6f4 2d72c: 8f 7b andi r24, 0xBF ; 191 2d72e: e2 cf rjmp .-60 ; 0x2d6f4 0002d730 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2d730: cf 93 push r28 if (cacheDirty_) { 2d732: 80 91 75 0e lds r24, 0x0E75 ; 0x800e75 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2d736: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2d738: 88 23 and r24, r24 2d73a: a1 f0 breq .+40 ; 0x2d764 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2d73c: 40 91 6d 0e lds r20, 0x0E6D ; 0x800e6d 2d740: 50 91 6e 0e lds r21, 0x0E6E ; 0x800e6e 2d744: 60 91 6f 0e lds r22, 0x0E6F ; 0x800e6f 2d748: 70 91 70 0e lds r23, 0x0E70 ; 0x800e70 2d74c: 29 e7 ldi r18, 0x79 ; 121 2d74e: 3e e0 ldi r19, 0x0E ; 14 2d750: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 2d754: 90 91 77 0e lds r25, 0x0E77 ; 0x800e77 2d758: 0f 94 30 a6 call 0x34c60 ; 0x34c60 2d75c: c8 2f mov r28, r24 2d75e: 81 11 cpse r24, r1 2d760: 04 c0 rjmp .+8 ; 0x2d76a cacheDirty_ = 0; } return true; fail: return false; 2d762: c0 e0 ldi r28, 0x00 ; 0 } 2d764: 8c 2f mov r24, r28 2d766: cf 91 pop r28 2d768: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2d76a: 40 91 71 0e lds r20, 0x0E71 ; 0x800e71 2d76e: 50 91 72 0e lds r21, 0x0E72 ; 0x800e72 2d772: 60 91 73 0e lds r22, 0x0E73 ; 0x800e73 2d776: 70 91 74 0e lds r23, 0x0E74 ; 0x800e74 2d77a: 41 15 cp r20, r1 2d77c: 51 05 cpc r21, r1 2d77e: 61 05 cpc r22, r1 2d780: 71 05 cpc r23, r1 2d782: 91 f0 breq .+36 ; 0x2d7a8 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2d784: 29 e7 ldi r18, 0x79 ; 121 2d786: 3e e0 ldi r19, 0x0E ; 14 2d788: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 2d78c: 90 91 77 0e lds r25, 0x0E77 ; 0x800e77 2d790: 0f 94 30 a6 call 0x34c60 ; 0x34c60 2d794: 88 23 and r24, r24 2d796: 29 f3 breq .-54 ; 0x2d762 goto fail; } cacheMirrorBlock_ = 0; 2d798: 10 92 71 0e sts 0x0E71, r1 ; 0x800e71 2d79c: 10 92 72 0e sts 0x0E72, r1 ; 0x800e72 2d7a0: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 2d7a4: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 } cacheDirty_ = 0; 2d7a8: 10 92 75 0e sts 0x0E75, r1 ; 0x800e75 2d7ac: db cf rjmp .-74 ; 0x2d764 0002d7ae : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2d7ae: cf 92 push r12 2d7b0: df 92 push r13 2d7b2: ef 92 push r14 2d7b4: ff 92 push r15 2d7b6: cf 93 push r28 2d7b8: 6b 01 movw r12, r22 2d7ba: 7c 01 movw r14, r24 2d7bc: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2d7be: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 2d7c2: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 2d7c6: a0 91 6f 0e lds r26, 0x0E6F ; 0x800e6f 2d7ca: b0 91 70 0e lds r27, 0x0E70 ; 0x800e70 2d7ce: 8c 15 cp r24, r12 2d7d0: 9d 05 cpc r25, r13 2d7d2: ae 05 cpc r26, r14 2d7d4: bf 05 cpc r27, r15 2d7d6: 01 f1 breq .+64 ; 0x2d818 if (!cacheFlush()) goto fail; 2d7d8: 0f 94 98 6b call 0x2d730 ; 0x2d730 2d7dc: 81 11 cpse r24, r1 2d7de: 08 c0 rjmp .+16 ; 0x2d7f0 } if (dirty) cacheDirty_ = true; return true; fail: return false; 2d7e0: c0 e0 ldi r28, 0x00 ; 0 } 2d7e2: 8c 2f mov r24, r28 2d7e4: cf 91 pop r28 2d7e6: ff 90 pop r15 2d7e8: ef 90 pop r14 2d7ea: df 90 pop r13 2d7ec: cf 90 pop r12 2d7ee: 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; 2d7f0: 29 e7 ldi r18, 0x79 ; 121 2d7f2: 3e e0 ldi r19, 0x0E ; 14 2d7f4: b7 01 movw r22, r14 2d7f6: a6 01 movw r20, r12 2d7f8: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 2d7fc: 90 91 77 0e lds r25, 0x0E77 ; 0x800e77 2d800: 0f 94 94 a6 call 0x34d28 ; 0x34d28 2d804: 88 23 and r24, r24 2d806: 61 f3 breq .-40 ; 0x2d7e0 cacheBlockNumber_ = blockNumber; 2d808: c0 92 6d 0e sts 0x0E6D, r12 ; 0x800e6d 2d80c: d0 92 6e 0e sts 0x0E6E, r13 ; 0x800e6e 2d810: e0 92 6f 0e sts 0x0E6F, r14 ; 0x800e6f 2d814: f0 92 70 0e sts 0x0E70, r15 ; 0x800e70 } if (dirty) cacheDirty_ = true; 2d818: cc 23 and r28, r28 2d81a: 21 f0 breq .+8 ; 0x2d824 2d81c: 81 e0 ldi r24, 0x01 ; 1 2d81e: 80 93 75 0e sts 0x0E75, r24 ; 0x800e75 2d822: df cf rjmp .-66 ; 0x2d7e2 return true; 2d824: c1 e0 ldi r28, 0x01 ; 1 2d826: dd cf rjmp .-70 ; 0x2d7e2 0002d828 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2d828: 4f 92 push r4 2d82a: 5f 92 push r5 2d82c: 6f 92 push r6 2d82e: 7f 92 push r7 2d830: 8f 92 push r8 2d832: 9f 92 push r9 2d834: af 92 push r10 2d836: bf 92 push r11 2d838: cf 92 push r12 2d83a: df 92 push r13 2d83c: ef 92 push r14 2d83e: ff 92 push r15 2d840: 0f 93 push r16 2d842: 1f 93 push r17 2d844: cf 93 push r28 2d846: df 93 push r29 2d848: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2d84a: 42 30 cpi r20, 0x02 ; 2 2d84c: 51 05 cpc r21, r1 2d84e: 61 05 cpc r22, r1 2d850: 71 05 cpc r23, r1 2d852: 90 f4 brcc .+36 ; 0x2d878 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2d854: 80 e0 ldi r24, 0x00 ; 0 } 2d856: df 91 pop r29 2d858: cf 91 pop r28 2d85a: 1f 91 pop r17 2d85c: 0f 91 pop r16 2d85e: ff 90 pop r15 2d860: ef 90 pop r14 2d862: df 90 pop r13 2d864: cf 90 pop r12 2d866: bf 90 pop r11 2d868: af 90 pop r10 2d86a: 9f 90 pop r9 2d86c: 8f 90 pop r8 2d86e: 7f 90 pop r7 2d870: 6f 90 pop r6 2d872: 5f 90 pop r5 2d874: 4f 90 pop r4 2d876: 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; 2d878: 89 85 ldd r24, Y+9 ; 0x09 2d87a: 9a 85 ldd r25, Y+10 ; 0x0a 2d87c: ab 85 ldd r26, Y+11 ; 0x0b 2d87e: bc 85 ldd r27, Y+12 ; 0x0c 2d880: 01 96 adiw r24, 0x01 ; 1 2d882: a1 1d adc r26, r1 2d884: b1 1d adc r27, r1 2d886: 84 17 cp r24, r20 2d888: 95 07 cpc r25, r21 2d88a: a6 07 cpc r26, r22 2d88c: b7 07 cpc r27, r23 2d88e: 10 f3 brcs .-60 ; 0x2d854 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2d890: 8f 89 ldd r24, Y+23 ; 0x17 2d892: 80 31 cpi r24, 0x10 ; 16 2d894: c9 f5 brne .+114 ; 0x2d908 lba = fatStartBlock_ + (cluster >> 8); 2d896: 85 2e mov r8, r21 2d898: 96 2e mov r9, r22 2d89a: a7 2e mov r10, r23 2d89c: bb 24 eor r11, r11 2d89e: 8b 89 ldd r24, Y+19 ; 0x13 2d8a0: 9c 89 ldd r25, Y+20 ; 0x14 2d8a2: ad 89 ldd r26, Y+21 ; 0x15 2d8a4: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d8a6: 88 0e add r8, r24 2d8a8: 99 1e adc r9, r25 2d8aa: aa 1e adc r10, r26 2d8ac: bb 1e adc r11, r27 2d8ae: 28 01 movw r4, r16 2d8b0: 39 01 movw r6, r18 2d8b2: 6a 01 movw r12, r20 2d8b4: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2d8b6: 41 e0 ldi r20, 0x01 ; 1 2d8b8: c5 01 movw r24, r10 2d8ba: b4 01 movw r22, r8 2d8bc: 0f 94 d7 6b call 0x2d7ae ; 0x2d7ae 2d8c0: 88 23 and r24, r24 2d8c2: 41 f2 breq .-112 ; 0x2d854 // store entry if (fatType_ == 16) { 2d8c4: 9f 89 ldd r25, Y+23 ; 0x17 2d8c6: 90 31 cpi r25, 0x10 ; 16 2d8c8: 81 f5 brne .+96 ; 0x2d92a cacheBuffer_.fat16[cluster & 0XFF] = value; 2d8ca: dd 24 eor r13, r13 2d8cc: ee 24 eor r14, r14 2d8ce: ff 24 eor r15, r15 2d8d0: f6 01 movw r30, r12 2d8d2: ee 0f add r30, r30 2d8d4: ff 1f adc r31, r31 2d8d6: e7 58 subi r30, 0x87 ; 135 2d8d8: f1 4f sbci r31, 0xF1 ; 241 2d8da: 11 83 std Z+1, r17 ; 0x01 2d8dc: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2d8de: 9a 89 ldd r25, Y+18 ; 0x12 2d8e0: 92 30 cpi r25, 0x02 ; 2 2d8e2: 08 f4 brcc .+2 ; 0x2d8e6 2d8e4: b8 cf rjmp .-144 ; 0x2d856 2d8e6: 4d 81 ldd r20, Y+5 ; 0x05 2d8e8: 5e 81 ldd r21, Y+6 ; 0x06 2d8ea: 6f 81 ldd r22, Y+7 ; 0x07 2d8ec: 78 85 ldd r23, Y+8 ; 0x08 2d8ee: 84 0e add r8, r20 2d8f0: 95 1e adc r9, r21 2d8f2: a6 1e adc r10, r22 2d8f4: b7 1e adc r11, r23 2d8f6: 80 92 71 0e sts 0x0E71, r8 ; 0x800e71 2d8fa: 90 92 72 0e sts 0x0E72, r9 ; 0x800e72 2d8fe: a0 92 73 0e sts 0x0E73, r10 ; 0x800e73 2d902: b0 92 74 0e sts 0x0E74, r11 ; 0x800e74 2d906: a7 cf rjmp .-178 ; 0x2d856 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d908: 80 32 cpi r24, 0x20 ; 32 2d90a: 09 f0 breq .+2 ; 0x2d90e 2d90c: a3 cf rjmp .-186 ; 0x2d854 lba = fatStartBlock_ + (cluster >> 7); 2d90e: 8b 89 ldd r24, Y+19 ; 0x13 2d910: 9c 89 ldd r25, Y+20 ; 0x14 2d912: ad 89 ldd r26, Y+21 ; 0x15 2d914: be 89 ldd r27, Y+22 ; 0x16 2d916: 4a 01 movw r8, r20 2d918: 5b 01 movw r10, r22 2d91a: e7 e0 ldi r30, 0x07 ; 7 2d91c: b6 94 lsr r11 2d91e: a7 94 ror r10 2d920: 97 94 ror r9 2d922: 87 94 ror r8 2d924: ea 95 dec r30 2d926: d1 f7 brne .-12 ; 0x2d91c 2d928: be cf rjmp .-132 ; 0x2d8a6 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2d92a: e8 94 clt 2d92c: c7 f8 bld r12, 7 2d92e: dd 24 eor r13, r13 2d930: ee 24 eor r14, r14 2d932: ff 24 eor r15, r15 2d934: f6 01 movw r30, r12 2d936: ee 0f add r30, r30 2d938: ff 1f adc r31, r31 2d93a: ee 0f add r30, r30 2d93c: ff 1f adc r31, r31 2d93e: e7 58 subi r30, 0x87 ; 135 2d940: f1 4f sbci r31, 0xF1 ; 241 2d942: 40 82 st Z, r4 2d944: 51 82 std Z+1, r5 ; 0x01 2d946: 62 82 std Z+2, r6 ; 0x02 2d948: 73 82 std Z+3, r7 ; 0x03 2d94a: c9 cf rjmp .-110 ; 0x2d8de 0002d94c : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2d94c: cf 92 push r12 2d94e: df 92 push r13 2d950: ef 92 push r14 2d952: ff 92 push r15 2d954: 0f 93 push r16 2d956: 1f 93 push r17 2d958: cf 93 push r28 2d95a: df 93 push r29 2d95c: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2d95e: 81 85 ldd r24, Z+9 ; 0x09 2d960: 92 85 ldd r25, Z+10 ; 0x0a 2d962: a3 85 ldd r26, Z+11 ; 0x0b 2d964: b4 85 ldd r27, Z+12 ; 0x0c 2d966: 01 96 adiw r24, 0x01 ; 1 2d968: a1 1d adc r26, r1 2d96a: b1 1d adc r27, r1 2d96c: 84 17 cp r24, r20 2d96e: 95 07 cpc r25, r21 2d970: a6 07 cpc r26, r22 2d972: b7 07 cpc r27, r23 2d974: 50 f4 brcc .+20 ; 0x2d98a *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2d976: 80 e0 ldi r24, 0x00 ; 0 } 2d978: df 91 pop r29 2d97a: cf 91 pop r28 2d97c: 1f 91 pop r17 2d97e: 0f 91 pop r16 2d980: ff 90 pop r15 2d982: ef 90 pop r14 2d984: df 90 pop r13 2d986: cf 90 pop r12 2d988: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2d98a: 87 89 ldd r24, Z+23 ; 0x17 2d98c: 80 31 cpi r24, 0x10 ; 16 2d98e: a9 f5 brne .+106 ; 0x2d9fa lba = fatStartBlock_ + (cluster >> 8); 2d990: bb 27 eor r27, r27 2d992: a7 2f mov r26, r23 2d994: 96 2f mov r25, r22 2d996: 85 2f mov r24, r21 2d998: c3 88 ldd r12, Z+19 ; 0x13 2d99a: d4 88 ldd r13, Z+20 ; 0x14 2d99c: e5 88 ldd r14, Z+21 ; 0x15 2d99e: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d9a0: 8c 0d add r24, r12 2d9a2: 9d 1d adc r25, r13 2d9a4: ae 1d adc r26, r14 2d9a6: bf 1d adc r27, r15 2d9a8: e9 01 movw r28, r18 2d9aa: 6a 01 movw r12, r20 2d9ac: 7b 01 movw r14, r22 2d9ae: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2d9b0: 40 91 6d 0e lds r20, 0x0E6D ; 0x800e6d 2d9b4: 50 91 6e 0e lds r21, 0x0E6E ; 0x800e6e 2d9b8: 60 91 6f 0e lds r22, 0x0E6F ; 0x800e6f 2d9bc: 70 91 70 0e lds r23, 0x0E70 ; 0x800e70 2d9c0: 84 17 cp r24, r20 2d9c2: 95 07 cpc r25, r21 2d9c4: a6 07 cpc r26, r22 2d9c6: b7 07 cpc r27, r23 2d9c8: 49 f5 brne .+82 ; 0x2da1c if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2d9ca: f8 01 movw r30, r16 2d9cc: 87 89 ldd r24, Z+23 ; 0x17 2d9ce: 80 31 cpi r24, 0x10 ; 16 2d9d0: 69 f5 brne .+90 ; 0x2da2c *value = cacheBuffer_.fat16[cluster & 0XFF]; 2d9d2: b7 01 movw r22, r14 2d9d4: a6 01 movw r20, r12 2d9d6: 55 27 eor r21, r21 2d9d8: 66 27 eor r22, r22 2d9da: 77 27 eor r23, r23 2d9dc: 44 0f add r20, r20 2d9de: 55 1f adc r21, r21 2d9e0: 47 58 subi r20, 0x87 ; 135 2d9e2: 51 4f sbci r21, 0xF1 ; 241 2d9e4: fa 01 movw r30, r20 2d9e6: 80 81 ld r24, Z 2d9e8: 91 81 ldd r25, Z+1 ; 0x01 2d9ea: b0 e0 ldi r27, 0x00 ; 0 2d9ec: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2d9ee: 88 83 st Y, r24 2d9f0: 99 83 std Y+1, r25 ; 0x01 2d9f2: aa 83 std Y+2, r26 ; 0x02 2d9f4: bb 83 std Y+3, r27 ; 0x03 2d9f6: 81 e0 ldi r24, 0x01 ; 1 2d9f8: bf cf rjmp .-130 ; 0x2d978 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d9fa: 80 32 cpi r24, 0x20 ; 32 2d9fc: 09 f0 breq .+2 ; 0x2da00 2d9fe: bb cf rjmp .-138 ; 0x2d976 lba = fatStartBlock_ + (cluster >> 7); 2da00: c3 88 ldd r12, Z+19 ; 0x13 2da02: d4 88 ldd r13, Z+20 ; 0x14 2da04: e5 88 ldd r14, Z+21 ; 0x15 2da06: f6 88 ldd r15, Z+22 ; 0x16 2da08: db 01 movw r26, r22 2da0a: ca 01 movw r24, r20 2da0c: c7 e0 ldi r28, 0x07 ; 7 2da0e: b6 95 lsr r27 2da10: a7 95 ror r26 2da12: 97 95 ror r25 2da14: 87 95 ror r24 2da16: ca 95 dec r28 2da18: d1 f7 brne .-12 ; 0x2da0e 2da1a: c2 cf rjmp .-124 ; 0x2d9a0 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2da1c: 40 e0 ldi r20, 0x00 ; 0 2da1e: bc 01 movw r22, r24 2da20: cd 01 movw r24, r26 2da22: 0f 94 d7 6b call 0x2d7ae ; 0x2d7ae 2da26: 81 11 cpse r24, r1 2da28: d0 cf rjmp .-96 ; 0x2d9ca 2da2a: a5 cf rjmp .-182 ; 0x2d976 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2da2c: b7 01 movw r22, r14 2da2e: a6 01 movw r20, r12 2da30: 4f 77 andi r20, 0x7F ; 127 2da32: 55 27 eor r21, r21 2da34: 66 27 eor r22, r22 2da36: 77 27 eor r23, r23 2da38: 44 0f add r20, r20 2da3a: 55 1f adc r21, r21 2da3c: 44 0f add r20, r20 2da3e: 55 1f adc r21, r21 2da40: 47 58 subi r20, 0x87 ; 135 2da42: 51 4f sbci r21, 0xF1 ; 241 2da44: fa 01 movw r30, r20 2da46: 80 81 ld r24, Z 2da48: 91 81 ldd r25, Z+1 ; 0x01 2da4a: a2 81 ldd r26, Z+2 ; 0x02 2da4c: b3 81 ldd r27, Z+3 ; 0x03 2da4e: bf 70 andi r27, 0x0F ; 15 2da50: ce cf rjmp .-100 ; 0x2d9ee 0002da52 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2da52: 4f 92 push r4 2da54: 5f 92 push r5 2da56: 6f 92 push r6 2da58: 7f 92 push r7 2da5a: af 92 push r10 2da5c: bf 92 push r11 2da5e: cf 92 push r12 2da60: df 92 push r13 2da62: ef 92 push r14 2da64: ff 92 push r15 2da66: 0f 93 push r16 2da68: 1f 93 push r17 2da6a: cf 93 push r28 2da6c: df 93 push r29 2da6e: 00 d0 rcall .+0 ; 0x2da70 2da70: 1f 92 push r1 2da72: cd b7 in r28, 0x3d ; 61 2da74: de b7 in r29, 0x3e ; 62 2da76: 8c 01 movw r16, r24 2da78: 49 83 std Y+1, r20 ; 0x01 2da7a: 5a 83 std Y+2, r21 ; 0x02 2da7c: 6b 83 std Y+3, r22 ; 0x03 2da7e: 7c 83 std Y+4, r23 ; 0x04 2da80: 59 01 movw r10, r18 uint32_t s = 0; 2da82: c1 2c mov r12, r1 2da84: d1 2c mov r13, r1 2da86: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2da88: 41 2c mov r4, r1 2da8a: 82 e0 ldi r24, 0x02 ; 2 2da8c: 58 2e mov r5, r24 2da8e: 61 2c mov r6, r1 2da90: 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; 2da92: 49 81 ldd r20, Y+1 ; 0x01 2da94: 5a 81 ldd r21, Y+2 ; 0x02 2da96: 6b 81 ldd r22, Y+3 ; 0x03 2da98: 7c 81 ldd r23, Y+4 ; 0x04 2da9a: 9e 01 movw r18, r28 2da9c: 2f 5f subi r18, 0xFF ; 255 2da9e: 3f 4f sbci r19, 0xFF ; 255 2daa0: c8 01 movw r24, r16 2daa2: 0f 94 a6 6c call 0x2d94c ; 0x2d94c 2daa6: 88 23 and r24, r24 2daa8: 19 f1 breq .+70 ; 0x2daf0 s += 512UL << clusterSizeShift_; 2daaa: f8 01 movw r30, r16 2daac: 85 85 ldd r24, Z+13 ; 0x0d 2daae: a3 01 movw r20, r6 2dab0: 92 01 movw r18, r4 2dab2: 04 c0 rjmp .+8 ; 0x2dabc 2dab4: 22 0f add r18, r18 2dab6: 33 1f adc r19, r19 2dab8: 44 1f adc r20, r20 2daba: 55 1f adc r21, r21 2dabc: 8a 95 dec r24 2dabe: d2 f7 brpl .-12 ; 0x2dab4 2dac0: da 01 movw r26, r20 2dac2: c9 01 movw r24, r18 2dac4: c8 0e add r12, r24 2dac6: d9 1e adc r13, r25 2dac8: ea 1e adc r14, r26 2daca: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2dacc: 49 81 ldd r20, Y+1 ; 0x01 2dace: 5a 81 ldd r21, Y+2 ; 0x02 2dad0: 6b 81 ldd r22, Y+3 ; 0x03 2dad2: 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; 2dad4: 87 89 ldd r24, Z+23 ; 0x17 2dad6: 80 31 cpi r24, 0x10 ; 16 2dad8: f1 f4 brne .+60 ; 0x2db16 2dada: 81 e0 ldi r24, 0x01 ; 1 2dadc: 48 3f cpi r20, 0xF8 ; 248 2dade: 5f 4f sbci r21, 0xFF ; 255 2dae0: 61 05 cpc r22, r1 2dae2: 71 05 cpc r23, r1 2dae4: b0 f2 brcs .-84 ; 0x2da92 *size = s; 2dae6: f5 01 movw r30, r10 2dae8: c0 82 st Z, r12 2daea: d1 82 std Z+1, r13 ; 0x01 2daec: e2 82 std Z+2, r14 ; 0x02 2daee: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2daf0: 0f 90 pop r0 2daf2: 0f 90 pop r0 2daf4: 0f 90 pop r0 2daf6: 0f 90 pop r0 2daf8: df 91 pop r29 2dafa: cf 91 pop r28 2dafc: 1f 91 pop r17 2dafe: 0f 91 pop r16 2db00: ff 90 pop r15 2db02: ef 90 pop r14 2db04: df 90 pop r13 2db06: cf 90 pop r12 2db08: bf 90 pop r11 2db0a: af 90 pop r10 2db0c: 7f 90 pop r7 2db0e: 6f 90 pop r6 2db10: 5f 90 pop r5 2db12: 4f 90 pop r4 2db14: 08 95 ret return cluster >= FAT32EOC_MIN; 2db16: 81 e0 ldi r24, 0x01 ; 1 2db18: 48 3f cpi r20, 0xF8 ; 248 2db1a: 5f 4f sbci r21, 0xFF ; 255 2db1c: 6f 4f sbci r22, 0xFF ; 255 2db1e: 7f 40 sbci r23, 0x0F ; 15 2db20: 08 f4 brcc .+2 ; 0x2db24 2db22: b7 cf rjmp .-146 ; 0x2da92 2db24: e0 cf rjmp .-64 ; 0x2dae6 0002db26 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2db26: cf 92 push r12 2db28: df 92 push r13 2db2a: ef 92 push r14 2db2c: ff 92 push r15 2db2e: 1f 93 push r17 2db30: cf 93 push r28 2db32: df 93 push r29 2db34: ec 01 movw r28, r24 2db36: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2db38: e1 11 cpse r30, r1 2db3a: 09 c0 rjmp .+18 ; 0x2db4e 2db3c: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2db3e: df 91 pop r29 2db40: cf 91 pop r28 2db42: 1f 91 pop r17 2db44: ff 90 pop r15 2db46: ef 90 pop r14 2db48: df 90 pop r13 2db4a: cf 90 pop r12 2db4c: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2db4e: 89 81 ldd r24, Y+1 ; 0x01 2db50: 80 ff sbrs r24, 0 2db52: f4 cf rjmp .-24 ; 0x2db3c gfOffset = curPosition_ & 0X1FF; // offset in block 2db54: 48 85 ldd r20, Y+8 ; 0x08 2db56: 59 85 ldd r21, Y+9 ; 0x09 2db58: 6a 85 ldd r22, Y+10 ; 0x0a 2db5a: 7b 85 ldd r23, Y+11 ; 0x0b 2db5c: 9a 01 movw r18, r20 2db5e: 31 70 andi r19, 0x01 ; 1 2db60: 3a a3 std Y+34, r19 ; 0x22 2db62: 29 a3 std Y+33, r18 ; 0x21 2db64: 89 8d ldd r24, Y+25 ; 0x19 2db66: 9a 8d ldd r25, Y+26 ; 0x1a 2db68: 6a 01 movw r12, r20 2db6a: 7b 01 movw r14, r22 2db6c: f9 e0 ldi r31, 0x09 ; 9 2db6e: f6 94 lsr r15 2db70: e7 94 ror r14 2db72: d7 94 ror r13 2db74: c7 94 ror r12 2db76: fa 95 dec r31 2db78: d1 f7 brne .-12 ; 0x2db6e if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2db7a: e2 30 cpi r30, 0x02 ; 2 2db7c: 79 f4 brne .+30 ; 0x2db9c // 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); 2db7e: fc 01 movw r30, r24 2db80: 82 8d ldd r24, Z+26 ; 0x1a 2db82: 93 8d ldd r25, Z+27 ; 0x1b 2db84: a4 8d ldd r26, Z+28 ; 0x1c 2db86: b5 8d ldd r27, Z+29 ; 0x1d 2db88: 8c 0d add r24, r12 2db8a: 9d 1d adc r25, r13 2db8c: ae 1d adc r26, r14 2db8e: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2db90: 8d 8f std Y+29, r24 ; 0x1d 2db92: 9e 8f std Y+30, r25 ; 0x1e 2db94: af 8f std Y+31, r26 ; 0x1f 2db96: b8 a3 std Y+32, r27 ; 0x20 } return true; 2db98: 81 e0 ldi r24, 0x01 ; 1 2db9a: d1 cf rjmp .-94 ; 0x2db3e 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);} 2db9c: fc 01 movw r30, r24 2db9e: 14 81 ldd r17, Z+4 ; 0x04 2dba0: 11 50 subi r17, 0x01 ; 1 2dba2: 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) { 2dba4: 23 2b or r18, r19 2dba6: 71 f4 brne .+28 ; 0x2dbc4 2dba8: 11 11 cpse r17, r1 2dbaa: 0c c0 rjmp .+24 ; 0x2dbc4 // start of new cluster if (curPosition_ == 0) { 2dbac: 45 2b or r20, r21 2dbae: 46 2b or r20, r22 2dbb0: 47 2b or r20, r23 2dbb2: 31 f5 brne .+76 ; 0x2dc00 // use first cluster in file curCluster_ = firstCluster_; 2dbb4: 8d 89 ldd r24, Y+21 ; 0x15 2dbb6: 9e 89 ldd r25, Y+22 ; 0x16 2dbb8: af 89 ldd r26, Y+23 ; 0x17 2dbba: b8 8d ldd r27, Y+24 ; 0x18 2dbbc: 8c 83 std Y+4, r24 ; 0x04 2dbbe: 9d 83 std Y+5, r25 ; 0x05 2dbc0: ae 83 std Y+6, r26 ; 0x06 2dbc2: 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; 2dbc4: e9 8d ldd r30, Y+25 ; 0x19 2dbc6: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2dbc8: 8c 81 ldd r24, Y+4 ; 0x04 2dbca: 9d 81 ldd r25, Y+5 ; 0x05 2dbcc: ae 81 ldd r26, Y+6 ; 0x06 2dbce: bf 81 ldd r27, Y+7 ; 0x07 2dbd0: 02 97 sbiw r24, 0x02 ; 2 2dbd2: a1 09 sbc r26, r1 2dbd4: b1 09 sbc r27, r1 2dbd6: 25 85 ldd r18, Z+13 ; 0x0d 2dbd8: 04 c0 rjmp .+8 ; 0x2dbe2 2dbda: 88 0f add r24, r24 2dbdc: 99 1f adc r25, r25 2dbde: aa 1f adc r26, r26 2dbe0: bb 1f adc r27, r27 2dbe2: 2a 95 dec r18 2dbe4: d2 f7 brpl .-12 ; 0x2dbda 2dbe6: 46 85 ldd r20, Z+14 ; 0x0e 2dbe8: 57 85 ldd r21, Z+15 ; 0x0f 2dbea: 60 89 ldd r22, Z+16 ; 0x10 2dbec: 71 89 ldd r23, Z+17 ; 0x11 2dbee: 84 0f add r24, r20 2dbf0: 95 1f adc r25, r21 2dbf2: a6 1f adc r26, r22 2dbf4: b7 1f adc r27, r23 2dbf6: 81 0f add r24, r17 2dbf8: 91 1d adc r25, r1 2dbfa: a1 1d adc r26, r1 2dbfc: b1 1d adc r27, r1 2dbfe: c8 cf rjmp .-112 ; 0x2db90 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2dc00: 4c 81 ldd r20, Y+4 ; 0x04 2dc02: 5d 81 ldd r21, Y+5 ; 0x05 2dc04: 6e 81 ldd r22, Y+6 ; 0x06 2dc06: 7f 81 ldd r23, Y+7 ; 0x07 2dc08: 9e 01 movw r18, r28 2dc0a: 2c 5f subi r18, 0xFC ; 252 2dc0c: 3f 4f sbci r19, 0xFF ; 255 2dc0e: 0f 94 a6 6c call 0x2d94c ; 0x2d94c 2dc12: 81 11 cpse r24, r1 2dc14: d7 cf rjmp .-82 ; 0x2dbc4 2dc16: 92 cf rjmp .-220 ; 0x2db3c 0002dc18 : * 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) { 2dc18: df 92 push r13 2dc1a: ef 92 push r14 2dc1c: ff 92 push r15 2dc1e: 0f 93 push r16 2dc20: 1f 93 push r17 2dc22: cf 93 push r28 2dc24: df 93 push r29 2dc26: 8c 01 movw r16, r24 2dc28: eb 01 movw r28, r22 2dc2a: 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; 2dc2c: 8d e0 ldi r24, 0x0D ; 13 2dc2e: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2dc30: 40 e2 ldi r20, 0x20 ; 32 2dc32: 50 e0 ldi r21, 0x00 ; 0 2dc34: be 01 movw r22, r28 2dc36: c8 01 movw r24, r16 2dc38: 0f 94 4d a7 call 0x34e9a ; 0x34e9a if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2dc3c: 80 32 cpi r24, 0x20 ; 32 2dc3e: 91 05 cpc r25, r1 2dc40: 71 f0 breq .+28 ; 0x2dc5e 2dc42: 21 e0 ldi r18, 0x01 ; 1 2dc44: 89 2b or r24, r25 2dc46: 09 f4 brne .+2 ; 0x2dc4a 2dc48: 20 e0 ldi r18, 0x00 ; 0 2dc4a: 82 2f mov r24, r18 2dc4c: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2dc4e: df 91 pop r29 2dc50: cf 91 pop r28 2dc52: 1f 91 pop r17 2dc54: 0f 91 pop r16 2dc56: ff 90 pop r15 2dc58: ef 90 pop r14 2dc5a: df 90 pop r13 2dc5c: 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; 2dc5e: 28 81 ld r18, Y 2dc60: 22 23 and r18, r18 2dc62: 09 f4 brne .+2 ; 0x2dc66 2dc64: 3f c0 rjmp .+126 ; 0x2dce4 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2dc66: 25 3e cpi r18, 0xE5 ; 229 2dc68: 19 f3 breq .-58 ; 0x2dc30 2dc6a: 2e 32 cpi r18, 0x2E ; 46 2dc6c: 09 f3 breq .-62 ; 0x2dc30 //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) 2dc6e: 3b 85 ldd r19, Y+11 ; 0x0b 2dc70: 3f 73 andi r19, 0x3F ; 63 2dc72: 3f 30 cpi r19, 0x0F ; 15 2dc74: 99 f5 brne .+102 ; 0x2dcdc 2dc76: e1 14 cp r14, r1 2dc78: f1 04 cpc r15, r1 2dc7a: 81 f1 breq .+96 ; 0x2dcdc { 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) 2dc7c: 4a 8d ldd r20, Y+26 ; 0x1a 2dc7e: 5b 8d ldd r21, Y+27 ; 0x1b 2dc80: 45 2b or r20, r21 2dc82: 61 f5 brne .+88 ; 0x2dcdc 2dc84: 2f 71 andi r18, 0x1F ; 31 2dc86: 3f ef ldi r19, 0xFF ; 255 2dc88: 32 0f add r19, r18 2dc8a: 34 30 cpi r19, 0x04 ; 4 2dc8c: 38 f5 brcc .+78 ; 0x2dcdc { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2dc8e: 21 50 subi r18, 0x01 ; 1 2dc90: 33 0b sbc r19, r19 2dc92: d2 9e mul r13, r18 2dc94: c0 01 movw r24, r0 2dc96: d3 9e mul r13, r19 2dc98: 90 0d add r25, r0 2dc9a: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2dc9c: f7 01 movw r30, r14 2dc9e: e8 0f add r30, r24 2dca0: f9 1f adc r31, r25 2dca2: 29 81 ldd r18, Y+1 ; 0x01 2dca4: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2dca6: 2b 81 ldd r18, Y+3 ; 0x03 2dca8: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2dcaa: 2d 81 ldd r18, Y+5 ; 0x05 2dcac: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2dcae: 2f 81 ldd r18, Y+7 ; 0x07 2dcb0: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2dcb2: 29 85 ldd r18, Y+9 ; 0x09 2dcb4: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2dcb6: 2e 85 ldd r18, Y+14 ; 0x0e 2dcb8: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2dcba: 28 89 ldd r18, Y+16 ; 0x10 2dcbc: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2dcbe: 2a 89 ldd r18, Y+18 ; 0x12 2dcc0: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2dcc2: 2c 89 ldd r18, Y+20 ; 0x14 2dcc4: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2dcc6: 2e 89 ldd r18, Y+22 ; 0x16 2dcc8: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2dcca: 28 8d ldd r18, Y+24 ; 0x18 2dccc: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2dcce: 2c 8d ldd r18, Y+28 ; 0x1c 2dcd0: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2dcd2: 2e 8d ldd r18, Y+30 ; 0x1e 2dcd4: 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) 2dcd6: 28 81 ld r18, Y 2dcd8: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2dcda: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2dcdc: 2b 85 ldd r18, Y+11 ; 0x0b 2dcde: 23 fd sbrc r18, 3 2dce0: a7 cf rjmp .-178 ; 0x2dc30 2dce2: b5 cf rjmp .-150 ; 0x2dc4e 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; 2dce4: 80 e0 ldi r24, 0x00 ; 0 2dce6: b3 cf rjmp .-154 ; 0x2dc4e 0002dce8 : * \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() { 2dce8: cf 93 push r28 2dcea: df 93 push r29 2dcec: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2dcee: 8b 81 ldd r24, Y+3 ; 0x03 2dcf0: 88 23 and r24, r24 2dcf2: 49 f1 breq .+82 ; 0x2dd46 if (flags_ & F_FILE_DIR_DIRTY) { 2dcf4: 89 81 ldd r24, Y+1 ; 0x01 2dcf6: 87 ff sbrs r24, 7 2dcf8: 22 c0 rjmp .+68 ; 0x2dd3e dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2dcfa: 61 e0 ldi r22, 0x01 ; 1 2dcfc: ce 01 movw r24, r28 2dcfe: 0f 94 75 a4 call 0x348ea ; 0x348ea 2dd02: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2dd04: 89 2b or r24, r25 2dd06: f9 f0 breq .+62 ; 0x2dd46 2dd08: 80 81 ld r24, Z 2dd0a: 85 3e cpi r24, 0xE5 ; 229 2dd0c: e1 f0 breq .+56 ; 0x2dd46 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2dd0e: 8b 81 ldd r24, Y+3 ; 0x03 2dd10: 82 30 cpi r24, 0x02 ; 2 2dd12: 40 f4 brcc .+16 ; 0x2dd24 2dd14: 89 89 ldd r24, Y+17 ; 0x11 2dd16: 9a 89 ldd r25, Y+18 ; 0x12 2dd18: ab 89 ldd r26, Y+19 ; 0x13 2dd1a: bc 89 ldd r27, Y+20 ; 0x14 2dd1c: 84 8f std Z+28, r24 ; 0x1c 2dd1e: 95 8f std Z+29, r25 ; 0x1d 2dd20: a6 8f std Z+30, r26 ; 0x1e 2dd22: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2dd24: 8d 89 ldd r24, Y+21 ; 0x15 2dd26: 9e 89 ldd r25, Y+22 ; 0x16 2dd28: 93 8f std Z+27, r25 ; 0x1b 2dd2a: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2dd2c: 8d 89 ldd r24, Y+21 ; 0x15 2dd2e: 9e 89 ldd r25, Y+22 ; 0x16 2dd30: af 89 ldd r26, Y+23 ; 0x17 2dd32: b8 8d ldd r27, Y+24 ; 0x18 2dd34: b5 8b std Z+21, r27 ; 0x15 2dd36: 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; 2dd38: 89 81 ldd r24, Y+1 ; 0x01 2dd3a: 8f 77 andi r24, 0x7F ; 127 2dd3c: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2dd3e: df 91 pop r29 2dd40: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2dd42: 0d 94 98 6b jmp 0x2d730 ; 0x2d730 fail: writeError = true; 2dd46: 81 e0 ldi r24, 0x01 ; 1 2dd48: 88 83 st Y, r24 return false; } 2dd4a: 80 e0 ldi r24, 0x00 ; 0 2dd4c: df 91 pop r29 2dd4e: cf 91 pop r28 2dd50: 08 95 ret 0002dd52 : * \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) { 2dd52: 8f 92 push r8 2dd54: 9f 92 push r9 2dd56: af 92 push r10 2dd58: bf 92 push r11 2dd5a: cf 92 push r12 2dd5c: df 92 push r13 2dd5e: ef 92 push r14 2dd60: ff 92 push r15 2dd62: 0f 93 push r16 2dd64: 1f 93 push r17 2dd66: cf 93 push r28 2dd68: df 93 push r29 2dd6a: ec 01 movw r28, r24 2dd6c: 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; 2dd6e: 81 11 cpse r24, r1 2dd70: 0e c0 rjmp .+28 ; 0x2dd8e done: return true; fail: return false; 2dd72: 80 e0 ldi r24, 0x00 ; 0 } 2dd74: df 91 pop r29 2dd76: cf 91 pop r28 2dd78: 1f 91 pop r17 2dd7a: 0f 91 pop r16 2dd7c: ff 90 pop r15 2dd7e: ef 90 pop r14 2dd80: df 90 pop r13 2dd82: cf 90 pop r12 2dd84: bf 90 pop r11 2dd86: af 90 pop r10 2dd88: 9f 90 pop r9 2dd8a: 8f 90 pop r8 2dd8c: 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; 2dd8e: 09 89 ldd r16, Y+17 ; 0x11 2dd90: 1a 89 ldd r17, Y+18 ; 0x12 2dd92: 2b 89 ldd r18, Y+19 ; 0x13 2dd94: 3c 89 ldd r19, Y+20 ; 0x14 2dd96: 04 17 cp r16, r20 2dd98: 15 07 cpc r17, r21 2dd9a: 26 07 cpc r18, r22 2dd9c: 37 07 cpc r19, r23 2dd9e: 48 f3 brcs .-46 ; 0x2dd72 2dda0: 4a 01 movw r8, r20 2dda2: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2dda4: 82 30 cpi r24, 0x02 ; 2 2dda6: 31 f4 brne .+12 ; 0x2ddb4 curPosition_ = pos; 2dda8: 88 86 std Y+8, r8 ; 0x08 2ddaa: 99 86 std Y+9, r9 ; 0x09 2ddac: aa 86 std Y+10, r10 ; 0x0a 2ddae: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2ddb0: 81 e0 ldi r24, 0x01 ; 1 2ddb2: e0 cf rjmp .-64 ; 0x2dd74 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2ddb4: 81 14 cp r8, r1 2ddb6: 91 04 cpc r9, r1 2ddb8: a1 04 cpc r10, r1 2ddba: b1 04 cpc r11, r1 2ddbc: 49 f4 brne .+18 ; 0x2ddd0 // set position to start of file curCluster_ = 0; 2ddbe: 1c 82 std Y+4, r1 ; 0x04 2ddc0: 1d 82 std Y+5, r1 ; 0x05 2ddc2: 1e 82 std Y+6, r1 ; 0x06 2ddc4: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2ddc6: 18 86 std Y+8, r1 ; 0x08 2ddc8: 19 86 std Y+9, r1 ; 0x09 2ddca: 1a 86 std Y+10, r1 ; 0x0a 2ddcc: 1b 86 std Y+11, r1 ; 0x0b 2ddce: f0 cf rjmp .-32 ; 0x2ddb0 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2ddd0: 08 85 ldd r16, Y+8 ; 0x08 2ddd2: 19 85 ldd r17, Y+9 ; 0x09 2ddd4: 2a 85 ldd r18, Y+10 ; 0x0a 2ddd6: 3b 85 ldd r19, Y+11 ; 0x0b 2ddd8: e9 8d ldd r30, Y+25 ; 0x19 2ddda: fa 8d ldd r31, Y+26 ; 0x1a 2dddc: 85 85 ldd r24, Z+13 ; 0x0d 2ddde: 90 e0 ldi r25, 0x00 ; 0 2dde0: 09 96 adiw r24, 0x09 ; 9 2dde2: b9 01 movw r22, r18 2dde4: a8 01 movw r20, r16 2dde6: 41 50 subi r20, 0x01 ; 1 2dde8: 51 09 sbc r21, r1 2ddea: 61 09 sbc r22, r1 2ddec: 71 09 sbc r23, r1 2ddee: 08 2e mov r0, r24 2ddf0: 04 c0 rjmp .+8 ; 0x2ddfa 2ddf2: 76 95 lsr r23 2ddf4: 67 95 ror r22 2ddf6: 57 95 ror r21 2ddf8: 47 95 ror r20 2ddfa: 0a 94 dec r0 2ddfc: d2 f7 brpl .-12 ; 0x2ddf2 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2ddfe: 75 01 movw r14, r10 2de00: 64 01 movw r12, r8 2de02: e1 e0 ldi r30, 0x01 ; 1 2de04: ce 1a sub r12, r30 2de06: d1 08 sbc r13, r1 2de08: e1 08 sbc r14, r1 2de0a: f1 08 sbc r15, r1 2de0c: 04 c0 rjmp .+8 ; 0x2de16 2de0e: f6 94 lsr r15 2de10: e7 94 ror r14 2de12: d7 94 ror r13 2de14: c7 94 ror r12 2de16: 8a 95 dec r24 2de18: d2 f7 brpl .-12 ; 0x2de0e if (nNew < nCur || curPosition_ == 0) { 2de1a: c4 16 cp r12, r20 2de1c: d5 06 cpc r13, r21 2de1e: e6 06 cpc r14, r22 2de20: f7 06 cpc r15, r23 2de22: 20 f0 brcs .+8 ; 0x2de2c 2de24: 01 2b or r16, r17 2de26: 02 2b or r16, r18 2de28: 03 2b or r16, r19 2de2a: 11 f5 brne .+68 ; 0x2de70 // must follow chain from first cluster curCluster_ = firstCluster_; 2de2c: 8d 89 ldd r24, Y+21 ; 0x15 2de2e: 9e 89 ldd r25, Y+22 ; 0x16 2de30: af 89 ldd r26, Y+23 ; 0x17 2de32: b8 8d ldd r27, Y+24 ; 0x18 2de34: 8c 83 std Y+4, r24 ; 0x04 2de36: 9d 83 std Y+5, r25 ; 0x05 2de38: ae 83 std Y+6, r26 ; 0x06 2de3a: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2de3c: 8e 01 movw r16, r28 2de3e: 0c 5f subi r16, 0xFC ; 252 2de40: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2de42: c1 14 cp r12, r1 2de44: d1 04 cpc r13, r1 2de46: e1 04 cpc r14, r1 2de48: f1 04 cpc r15, r1 2de4a: 09 f4 brne .+2 ; 0x2de4e 2de4c: ad cf rjmp .-166 ; 0x2dda8 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2de4e: 4c 81 ldd r20, Y+4 ; 0x04 2de50: 5d 81 ldd r21, Y+5 ; 0x05 2de52: 6e 81 ldd r22, Y+6 ; 0x06 2de54: 7f 81 ldd r23, Y+7 ; 0x07 2de56: 98 01 movw r18, r16 2de58: 89 8d ldd r24, Y+25 ; 0x19 2de5a: 9a 8d ldd r25, Y+26 ; 0x1a 2de5c: 0f 94 a6 6c call 0x2d94c ; 0x2d94c 2de60: 91 e0 ldi r25, 0x01 ; 1 2de62: c9 1a sub r12, r25 2de64: d1 08 sbc r13, r1 2de66: e1 08 sbc r14, r1 2de68: f1 08 sbc r15, r1 2de6a: 81 11 cpse r24, r1 2de6c: ea cf rjmp .-44 ; 0x2de42 2de6e: 81 cf rjmp .-254 ; 0x2dd72 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2de70: c4 1a sub r12, r20 2de72: d5 0a sbc r13, r21 2de74: e6 0a sbc r14, r22 2de76: f7 0a sbc r15, r23 2de78: e1 cf rjmp .-62 ; 0x2de3c 0002de7a : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 2de7a: 80 91 86 17 lds r24, 0x1786 ; 0x801786 2de7e: 88 23 and r24, r24 2de80: 61 f0 breq .+24 ; 0x2de9a 2de82: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 2de86: 88 23 and r24, r24 2de88: 41 f0 breq .+16 ; 0x2de9a lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 2de8a: 8c eb ldi r24, 0xBC ; 188 2de8c: 9e e3 ldi r25, 0x3E ; 62 2de8e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2de92: 0f 94 04 36 call 0x26c08 ; 0x26c08 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 2de96: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 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; 2de9a: 86 e0 ldi r24, 0x06 ; 6 2de9c: 80 93 63 0e sts 0x0E63, r24 ; 0x800e63 2dea0: fa cf rjmp .-12 ; 0x2de96 0002dea2 : 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() { 2dea2: cf 93 push r28 2dea4: df 93 push r29 if (MMU2::mmu2.Enabled()) { 2dea6: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2deaa: 81 30 cpi r24, 0x01 ; 1 2deac: e9 f4 brne .+58 ; 0x2dee8 const uint8_t filament = choose_menu_P( 2deae: 8c e0 ldi r24, 0x0C ; 12 2deb0: 9f e4 ldi r25, 0x4F ; 79 2deb2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2deb6: ec 01 movw r28, r24 2deb8: 8e e1 ldi r24, 0x1E ; 30 2deba: 9f e3 ldi r25, 0x3F ; 63 2debc: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,_T(MSG_CANCEL)); 2dec0: be 01 movw r22, r28 2dec2: 0e 94 b2 d9 call 0x1b364 ; 0x1b364 if (filament < MMU_FILAMENT_COUNT) { 2dec6: 85 30 cpi r24, 0x05 ; 5 2dec8: a0 f5 brcc .+104 ; 0x2df32 lay1cal_filament = filament; 2deca: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 <_ZL16lay1cal_filament.lto_priv.456> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 2dece: 8a e0 ldi r24, 0x0A ; 10 2ded0: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 menu_goto(lcd_generic_preheat_menu, 0, true); 2ded4: 20 e0 ldi r18, 0x00 ; 0 2ded6: 41 e0 ldi r20, 0x01 ; 1 2ded8: 70 e0 ldi r23, 0x00 ; 0 2deda: 60 e0 ldi r22, 0x00 ; 0 2dedc: 85 e9 ldi r24, 0x95 ; 149 2dede: 9a e3 ldi r25, 0x3A ; 58 } 2dee0: df 91 pop r29 2dee2: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 2dee4: 0d 94 32 cf jmp 0x39e64 ; 0x39e64 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2dee8: 8f e5 ldi r24, 0x5F ; 95 2deea: 9f e0 ldi r25, 0x0F ; 15 2deec: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2def0: 81 11 cpse r24, r1 2def2: ed cf rjmp .-38 ; 0x2dece { bool loaded = false; if (fsensor.isReady()) { 2def4: 80 91 86 17 lds r24, 0x1786 ; 0x801786 2def8: 82 30 cpi r24, 0x02 ; 2 2defa: f9 f4 brne .+62 ; 0x2df3a loaded = fsensor.getFilamentPresent(); 2defc: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 2df00: 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) { 2df02: 91 11 cpse r25, r1 2df04: e4 cf rjmp .-56 ; 0x2dece lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 2df06: 8e ee ldi r24, 0xEE ; 238 2df08: 9e e4 ldi r25, 0x4E ; 78 2df0a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2df0e: 0f 94 7d 35 call 0x26afa ; 0x26afa lcd_consume_click(); 2df12: 0e 94 a5 71 call 0xe34a ; 0xe34a 2df16: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 2df18: 84 e6 ldi r24, 0x64 ; 100 2df1a: 90 e0 ldi r25, 0x00 ; 0 2df1c: 0e 94 7f 8e call 0x11cfe ; 0x11cfe if (lcd_clicked()) { 2df20: 0e 94 aa 71 call 0xe354 ; 0xe354 2df24: 81 11 cpse r24, r1 2df26: 02 c0 rjmp .+4 ; 0x2df2c 2df28: 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 2df2a: b1 f7 brne .-20 ; 0x2df18 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 2df2c: 81 e0 ldi r24, 0x01 ; 1 2df2e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 2df32: df 91 pop r29 2df34: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 2df36: 0d 94 d0 d1 jmp 0x3a3a0 ; 0x3a3a0 { 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); 2df3a: 87 e0 ldi r24, 0x07 ; 7 2df3c: 94 e5 ldi r25, 0x54 ; 84 2df3e: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2df42: 41 e0 ldi r20, 0x01 ; 1 2df44: 60 e0 ldi r22, 0x00 ; 0 2df46: 0f 94 d9 65 call 0x2cbb2 ; 0x2cbb2 2df4a: 91 e0 ldi r25, 0x01 ; 1 2df4c: 81 11 cpse r24, r1 2df4e: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 2df50: 81 e0 ldi r24, 0x01 ; 1 2df52: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 2df56: d5 cf rjmp .-86 ; 0x2df02 0002df58 : 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()") { 2df58: cf 93 push r28 2df5a: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 { //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); 2df5e: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 2df60: 45 e2 ldi r20, 0x25 ; 37 2df62: 50 e7 ldi r21, 0x70 ; 112 2df64: 60 e0 ldi r22, 0x00 ; 0 2df66: 80 e0 ldi r24, 0x00 ; 0 2df68: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(LCD_WIDTH - 14, 0); 2df6c: 60 e0 ldi r22, 0x00 ; 0 2df6e: 86 e0 ldi r24, 0x06 ; 6 2df70: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print_state(pinda_state); 2df74: c4 fb bst r28, 4 2df76: 88 27 eor r24, r24 2df78: 80 f9 bld r24, 0 2df7a: 0f 94 39 27 call 0x24e72 ; 0x24e72 if (MMU2::mmu2.Enabled()) { 2df7e: 80 91 96 13 lds r24, 0x1396 ; 0x801396 2df82: 81 30 cpi r24, 0x01 ; 1 2df84: 99 f4 brne .+38 ; 0x2dfac inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 2df86: c1 e0 ldi r28, 0x01 ; 1 2df88: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 2df8c: 81 11 cpse r24, r1 2df8e: 01 c0 rjmp .+2 ; 0x2df92 2df90: 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 2df92: 4f e1 ldi r20, 0x1F ; 31 2df94: 50 e7 ldi r21, 0x70 ; 112 2df96: 60 e0 ldi r22, 0x00 ; 0 2df98: 8a e0 ldi r24, 0x0A ; 10 2df9a: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(LCD_WIDTH - 3, 0); 2df9e: 60 e0 ldi r22, 0x00 ; 0 2dfa0: 81 e1 ldi r24, 0x11 ; 17 2dfa2: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print_state(finda_state); 2dfa6: 8c 2f mov r24, r28 2dfa8: 0f 94 39 27 call 0x24e72 ; 0x24e72 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 2dfac: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 2dfb0: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 2dfb2: 88 ec ldi r24, 0xC8 ; 200 2dfb4: 9c e3 ldi r25, 0x3C ; 60 2dfb6: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2dfba: ac 01 movw r20, r24 2dfbc: 61 e0 ldi r22, 0x01 ; 1 2dfbe: 80 e0 ldi r24, 0x00 ; 0 2dfc0: 0e 94 a1 6f call 0xdf42 ; 0xdf42 lcd_set_cursor(LCD_WIDTH - 3, 1); 2dfc4: 61 e0 ldi r22, 0x01 ; 1 2dfc6: 81 e1 ldi r24, 0x11 ; 17 2dfc8: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print_state(idler_state); 2dfcc: 8c 2f mov r24, r28 2dfce: 0f 94 39 27 call 0x24e72 ; 0x24e72 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(); } 2dfd2: 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(); 2dfd4: 0d 94 72 d2 jmp 0x3a4e4 ; 0x3a4e4 0002dfd8 : 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){ 2dfd8: 2f 92 push r2 2dfda: 3f 92 push r3 2dfdc: 4f 92 push r4 2dfde: 5f 92 push r5 2dfe0: 6f 92 push r6 2dfe2: 7f 92 push r7 2dfe4: 8f 92 push r8 2dfe6: 9f 92 push r9 2dfe8: af 92 push r10 2dfea: bf 92 push r11 2dfec: cf 92 push r12 2dfee: df 92 push r13 2dff0: ef 92 push r14 2dff2: ff 92 push r15 2dff4: 0f 93 push r16 2dff6: 1f 93 push r17 2dff8: cf 93 push r28 2dffa: df 93 push r29 2dffc: 00 d0 rcall .+0 ; 0x2dffe 2dffe: 1f 92 push r1 2e000: 1f 92 push r1 2e002: cd b7 in r28, 0x3d ; 61 2e004: de b7 in r29, 0x3e ; 62 2e006: 1c 01 movw r2, r24 2e008: 2a 01 movw r4, r20 2e00a: 3b 01 movw r6, r22 2e00c: 00 e2 ldi r16, 0x20 ; 32 2e00e: 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){ 2e010: 19 82 std Y+1, r1 ; 0x01 2e012: 99 81 ldd r25, Y+1 ; 0x01 2e014: 89 2f mov r24, r25 2e016: 90 e0 ldi r25, 0x00 ; 0 2e018: 9b 83 std Y+3, r25 ; 0x03 2e01a: 8a 83 std Y+2, r24 ; 0x02 2e01c: 80 17 cp r24, r16 2e01e: 91 07 cpc r25, r17 2e020: 9c f5 brge .+102 ; 0x2e088 if (points[j] > points[j + 1]) 2e022: 88 0f add r24, r24 2e024: 99 1f adc r25, r25 2e026: 88 0f add r24, r24 2e028: 99 1f adc r25, r25 2e02a: 9d 83 std Y+5, r25 ; 0x05 2e02c: 8c 83 std Y+4, r24 ; 0x04 2e02e: 82 0d add r24, r2 2e030: 93 1d adc r25, r3 2e032: 9b 83 std Y+3, r25 ; 0x03 2e034: 8a 83 std Y+2, r24 ; 0x02 2e036: fc 01 movw r30, r24 2e038: c0 80 ld r12, Z 2e03a: d1 80 ldd r13, Z+1 ; 0x01 2e03c: e2 80 ldd r14, Z+2 ; 0x02 2e03e: f3 80 ldd r15, Z+3 ; 0x03 2e040: 8c 81 ldd r24, Y+4 ; 0x04 2e042: 9d 81 ldd r25, Y+5 ; 0x05 2e044: 04 96 adiw r24, 0x04 ; 4 2e046: 82 0d add r24, r2 2e048: 93 1d adc r25, r3 2e04a: 9d 83 std Y+5, r25 ; 0x05 2e04c: 8c 83 std Y+4, r24 ; 0x04 2e04e: fc 01 movw r30, r24 2e050: 80 80 ld r8, Z 2e052: 91 80 ldd r9, Z+1 ; 0x01 2e054: a2 80 ldd r10, Z+2 ; 0x02 2e056: b3 80 ldd r11, Z+3 ; 0x03 2e058: a5 01 movw r20, r10 2e05a: 94 01 movw r18, r8 2e05c: c7 01 movw r24, r14 2e05e: b6 01 movw r22, r12 2e060: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 2e064: 18 16 cp r1, r24 2e066: 64 f4 brge .+24 ; 0x2e080 SWAP(points[j], points[j + 1]); 2e068: ea 81 ldd r30, Y+2 ; 0x02 2e06a: fb 81 ldd r31, Y+3 ; 0x03 2e06c: 80 82 st Z, r8 2e06e: 91 82 std Z+1, r9 ; 0x01 2e070: a2 82 std Z+2, r10 ; 0x02 2e072: b3 82 std Z+3, r11 ; 0x03 2e074: ec 81 ldd r30, Y+4 ; 0x04 2e076: fd 81 ldd r31, Y+5 ; 0x05 2e078: c0 82 st Z, r12 2e07a: d1 82 std Z+1, r13 ; 0x01 2e07c: e2 82 std Z+2, r14 ; 0x02 2e07e: 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){ 2e080: f9 81 ldd r31, Y+1 ; 0x01 2e082: ff 5f subi r31, 0xFF ; 255 2e084: f9 83 std Y+1, r31 ; 0x01 2e086: c5 cf rjmp .-118 ; 0x2e012 2e088: 01 50 subi r16, 0x01 ; 1 2e08a: 11 09 sbc r17, r1 2e08c: 08 f6 brcc .-126 ; 0x2e010 /// 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]; 2e08e: f1 01 movw r30, r2 2e090: e0 5c subi r30, 0xC0 ; 192 2e092: 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); 2e094: 20 81 ld r18, Z 2e096: 31 81 ldd r19, Z+1 ; 0x01 2e098: 42 81 ldd r20, Z+2 ; 0x02 2e09a: 53 81 ldd r21, Z+3 ; 0x03 2e09c: c3 01 movw r24, r6 2e09e: b2 01 movw r22, r4 2e0a0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 2e0a4: 6b 01 movw r12, r22 2e0a6: 7c 01 movw r14, r24 2e0a8: 20 e0 ldi r18, 0x00 ; 0 2e0aa: 30 e0 ldi r19, 0x00 ; 0 2e0ac: 40 e0 ldi r20, 0x00 ; 0 2e0ae: 5f eb ldi r21, 0xBF ; 191 2e0b0: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 2e0b4: 87 fd sbrc r24, 7 2e0b6: 10 c0 rjmp .+32 ; 0x2e0d8 2e0b8: 20 e0 ldi r18, 0x00 ; 0 2e0ba: 30 e0 ldi r19, 0x00 ; 0 2e0bc: 40 e0 ldi r20, 0x00 ; 0 2e0be: 5f e3 ldi r21, 0x3F ; 63 2e0c0: c7 01 movw r24, r14 2e0c2: b6 01 movw r22, r12 2e0c4: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 2e0c8: 18 16 cp r1, r24 2e0ca: 5c f4 brge .+22 ; 0x2e0e2 2e0cc: c1 2c mov r12, r1 2e0ce: d1 2c mov r13, r1 2e0d0: e1 2c mov r14, r1 2e0d2: 8f e3 ldi r24, 0x3F ; 63 2e0d4: f8 2e mov r15, r24 2e0d6: 05 c0 rjmp .+10 ; 0x2e0e2 2e0d8: c1 2c mov r12, r1 2e0da: d1 2c mov r13, r1 2e0dc: e1 2c mov r14, r1 2e0de: 9f eb ldi r25, 0xBF ; 191 2e0e0: f9 2e mov r15, r25 } 2e0e2: c7 01 movw r24, r14 2e0e4: b6 01 movw r22, r12 2e0e6: 0f 90 pop r0 2e0e8: 0f 90 pop r0 2e0ea: 0f 90 pop r0 2e0ec: 0f 90 pop r0 2e0ee: 0f 90 pop r0 2e0f0: df 91 pop r29 2e0f2: cf 91 pop r28 2e0f4: 1f 91 pop r17 2e0f6: 0f 91 pop r16 2e0f8: ff 90 pop r15 2e0fa: ef 90 pop r14 2e0fc: df 90 pop r13 2e0fe: cf 90 pop r12 2e100: bf 90 pop r11 2e102: af 90 pop r10 2e104: 9f 90 pop r9 2e106: 8f 90 pop r8 2e108: 7f 90 pop r7 2e10a: 6f 90 pop r6 2e10c: 5f 90 pop r5 2e10e: 4f 90 pop r4 2e110: 3f 90 pop r3 2e112: 2f 90 pop r2 2e114: 08 95 ret 0002e116 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2e116: 0f 94 83 3f call 0x27f06 ; 0x27f06 2e11a: 60 93 36 13 sts 0x1336, r22 ; 0x801336 2e11e: 70 93 37 13 sts 0x1337, r23 ; 0x801337 2e122: 80 93 38 13 sts 0x1338, r24 ; 0x801338 2e126: 90 93 39 13 sts 0x1339, r25 ; 0x801339 } 2e12a: 08 95 ret 0002e12c : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2e12c: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 2e130: 88 23 and r24, r24 2e132: 69 f0 breq .+26 ; 0x2e14e 2e134: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 2e138: 88 23 and r24, r24 2e13a: 49 f0 breq .+18 ; 0x2e14e SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2e13c: 89 e6 ldi r24, 0x69 ; 105 2e13e: 99 ea ldi r25, 0xA9 ; 169 2e140: 0e 94 fe 7a call 0xf5fc ; 0xf5fc retryAttempts--; 2e144: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 2e148: 81 50 subi r24, 0x01 ; 1 2e14a: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b } } 2e14e: 08 95 ret 0002e150 : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2e150: 9f 92 push r9 2e152: af 92 push r10 2e154: bf 92 push r11 2e156: cf 92 push r12 2e158: df 92 push r13 2e15a: ef 92 push r14 2e15c: ff 92 push r15 2e15e: 0f 93 push r16 2e160: 1f 93 push r17 2e162: cf 93 push r28 2e164: df 93 push r29 2e166: cd b7 in r28, 0x3d ; 61 2e168: de b7 in r29, 0x3e ; 62 2e16a: e0 97 sbiw r28, 0x30 ; 48 2e16c: 0f b6 in r0, 0x3f ; 63 2e16e: f8 94 cli 2e170: de bf out 0x3e, r29 ; 62 2e172: 0f be out 0x3f, r0 ; 63 2e174: cd bf out 0x3d, r28 ; 61 2e176: 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()]; 2e178: e0 90 64 13 lds r14, 0x1364 ; 0x801364 2e17c: fe 01 movw r30, r28 2e17e: 31 96 adiw r30, 0x01 ; 1 2e180: 21 e0 ldi r18, 0x01 ; 1 2e182: 30 e0 ldi r19, 0x00 ; 0 2e184: 5f 01 movw r10, r30 2e186: f1 2c mov r15, r1 2e188: 40 e1 ldi r20, 0x10 ; 16 2e18a: c4 2e mov r12, r20 2e18c: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2e18e: 50 e2 ldi r21, 0x20 ; 32 2e190: 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()]; 2e192: c7 01 movw r24, r14 2e194: 82 1b sub r24, r18 2e196: 93 0b sbc r25, r19 2e198: b6 01 movw r22, r12 2e19a: 0f 94 66 de call 0x3bccc ; 0x3bccc <__divmodhi4> 2e19e: dc 01 movw r26, r24 2e1a0: bb 27 eor r27, r27 2e1a2: a9 5d subi r26, 0xD9 ; 217 2e1a4: bc 4e sbci r27, 0xEC ; 236 2e1a6: 9d 96 adiw r26, 0x2d ; 45 2e1a8: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2e1aa: 48 2f mov r20, r24 2e1ac: 50 e0 ldi r21, 0x00 ; 0 2e1ae: 94 e0 ldi r25, 0x04 ; 4 2e1b0: 55 95 asr r21 2e1b2: 47 95 ror r20 2e1b4: 9a 95 dec r25 2e1b6: e1 f7 brne .-8 ; 0x2e1b0 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2e1b8: 96 ef ldi r25, 0xF6 ; 246 2e1ba: 94 0f add r25, r20 2e1bc: 96 30 cpi r25, 0x06 ; 6 2e1be: a8 f1 brcs .+106 ; 0x2e22a case 5: case 6: case 7: case 8: case 9: return c + '0'; 2e1c0: 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); 2e1c2: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2e1c4: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2e1c6: 96 ef ldi r25, 0xF6 ; 246 2e1c8: 98 0f add r25, r24 2e1ca: 96 30 cpi r25, 0x06 ; 6 2e1cc: 80 f1 brcs .+96 ; 0x2e22e case 5: case 6: case 7: case 8: case 9: return c + '0'; 2e1ce: 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); 2e1d0: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2e1d2: 92 82 std Z+2, r9 ; 0x02 2e1d4: 2f 5f subi r18, 0xFF ; 255 2e1d6: 3f 4f sbci r19, 0xFF ; 255 2e1d8: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2e1da: 21 31 cpi r18, 0x11 ; 17 2e1dc: 31 05 cpc r19, r1 2e1de: c9 f6 brne .-78 ; 0x2e192 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 2e1e0: 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); 2e1e2: 82 ee ldi r24, 0xE2 ; 226 2e1e4: 99 ea ldi r25, 0xA9 ; 169 2e1e6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2e1ea: 8c ed ldi r24, 0xDC ; 220 2e1ec: 99 ea ldi r25, 0xA9 ; 169 2e1ee: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2e1f2: c8 01 movw r24, r16 2e1f4: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOPGM(", last bytes: "); 2e1f8: 84 e9 ldi r24, 0x94 ; 148 2e1fa: 99 ea ldi r25, 0xA9 ; 169 2e1fc: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(lrb); 2e200: c5 01 movw r24, r10 2e202: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c } 2e206: e0 96 adiw r28, 0x30 ; 48 2e208: 0f b6 in r0, 0x3f ; 63 2e20a: f8 94 cli 2e20c: de bf out 0x3e, r29 ; 62 2e20e: 0f be out 0x3f, r0 ; 63 2e210: cd bf out 0x3d, r28 ; 61 2e212: df 91 pop r29 2e214: cf 91 pop r28 2e216: 1f 91 pop r17 2e218: 0f 91 pop r16 2e21a: ff 90 pop r15 2e21c: ef 90 pop r14 2e21e: df 90 pop r13 2e220: cf 90 pop r12 2e222: bf 90 pop r11 2e224: af 90 pop r10 2e226: 9f 90 pop r9 2e228: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2e22a: 49 5a subi r20, 0xA9 ; 169 2e22c: ca cf rjmp .-108 ; 0x2e1c2 2e22e: 89 5a subi r24, 0xA9 ; 169 2e230: cf cf rjmp .-98 ; 0x2e1d0 0002e232 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2e232: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2e234: 90 91 3b 13 lds r25, 0x133B ; 0x80133b 2e238: 9a 30 cpi r25, 0x0A ; 10 2e23a: 11 f4 brne .+4 ; 0x2e240 cause = ss; 2e23c: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a } --occurrences; 2e240: 91 50 subi r25, 0x01 ; 1 2e242: 90 93 3b 13 sts 0x133B, r25 ; 0x80133b FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2e246: 91 11 cpse r25, r1 2e248: 0d c0 rjmp .+26 ; 0x2e264 2e24a: c9 01 movw r24, r18 LogError(msg_P); 2e24c: 0f 94 a8 70 call 0x2e150 ; 0x2e150 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2e250: 85 e8 ldi r24, 0x85 ; 133 2e252: 99 ea ldi r25, 0xA9 ; 169 2e254: 0e 94 fe 7a call 0xf5fc ; 0xf5fc /// @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; } 2e258: 8a e0 ldi r24, 0x0A ; 10 2e25a: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b 2e25e: 80 91 3a 13 lds r24, 0x133A ; 0x80133a 2e262: 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 2e264: 80 e0 ldi r24, 0x00 ; 0 } } 2e266: 08 95 ret 0002e268 : } *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) { 2e268: cf 93 push r28 2e26a: df 93 push r29 2e26c: cd b7 in r28, 0x3d ; 61 2e26e: de b7 in r29, 0x3e ; 62 2e270: 2e 97 sbiw r28, 0x0e ; 14 2e272: 0f b6 in r0, 0x3f ; 63 2e274: f8 94 cli 2e276: de bf out 0x3e, r29 ; 62 2e278: 0f be out 0x3f, r0 ; 63 2e27a: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2e27c: 2e e3 ldi r18, 0x3E ; 62 2e27e: 30 e0 ldi r19, 0x00 ; 0 2e280: 3a 83 std Y+2, r19 ; 0x02 2e282: 29 83 std Y+1, r18 ; 0x01 2e284: fe 01 movw r30, r28 2e286: 33 96 adiw r30, 0x03 ; 3 2e288: 2c e0 ldi r18, 0x0C ; 12 2e28a: df 01 movw r26, r30 2e28c: 1d 92 st X+, r1 2e28e: 2a 95 dec r18 2e290: e9 f7 brne .-6 ; 0x2e28c 2e292: de 01 movw r26, r28 2e294: 12 96 adiw r26, 0x02 ; 2 2e296: 48 2f mov r20, r24 2e298: fc 01 movw r30, r24 2e29a: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2e29c: 8e 2f mov r24, r30 2e29e: 84 1b sub r24, r20 2e2a0: 86 17 cp r24, r22 2e2a2: 40 f4 brcc .+16 ; 0x2e2b4 uint8_t b = txbuff[i]; 2e2a4: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2e2a6: 90 ee ldi r25, 0xE0 ; 224 2e2a8: 98 0f add r25, r24 2e2aa: 90 36 cpi r25, 0x60 ; 96 2e2ac: 08 f0 brcs .+2 ; 0x2e2b0 b = '.'; 2e2ae: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2e2b0: 8d 93 st X+, r24 2e2b2: f4 cf rjmp .-24 ; 0x2e29c } tmp[size + 1] = 0; 2e2b4: f9 01 movw r30, r18 2e2b6: e6 0f add r30, r22 2e2b8: f1 1d adc r31, r1 2e2ba: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2e2bc: 4e e0 ldi r20, 0x0E ; 14 2e2be: 50 e0 ldi r21, 0x00 ; 0 2e2c0: 68 ee ldi r22, 0xE8 ; 232 2e2c2: 79 ea ldi r23, 0xA9 ; 169 2e2c4: ce 01 movw r24, r28 2e2c6: 01 96 adiw r24, 0x01 ; 1 2e2c8: 0f 94 68 db call 0x3b6d0 ; 0x3b6d0 2e2cc: 89 2b or r24, r25 2e2ce: 59 f4 brne .+22 ; 0x2e2e6 2e2d0: 4e e0 ldi r20, 0x0E ; 14 2e2d2: 50 e0 ldi r21, 0x00 ; 0 2e2d4: be 01 movw r22, r28 2e2d6: 6f 5f subi r22, 0xFF ; 255 2e2d8: 7f 4f sbci r23, 0xFF ; 255 2e2da: 8e e7 ldi r24, 0x7E ; 126 2e2dc: 92 e1 ldi r25, 0x12 ; 18 2e2de: 0f 94 fb e3 call 0x3c7f6 ; 0x3c7f6 2e2e2: 89 2b or r24, r25 2e2e4: 61 f0 breq .+24 ; 0x2e2fe // 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); 2e2e6: 82 ee ldi r24, 0xE2 ; 226 2e2e8: 99 ea ldi r25, 0xA9 ; 169 2e2ea: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2e2ee: 8c ed ldi r24, 0xDC ; 220 2e2f0: 99 ea ldi r25, 0xA9 ; 169 2e2f2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 2e2f6: ce 01 movw r24, r28 2e2f8: 01 96 adiw r24, 0x01 ; 1 2e2fa: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c } strncpy(lastMsg, tmp, rqs); 2e2fe: 4e e0 ldi r20, 0x0E ; 14 2e300: 50 e0 ldi r21, 0x00 ; 0 2e302: be 01 movw r22, r28 2e304: 6f 5f subi r22, 0xFF ; 255 2e306: 7f 4f sbci r23, 0xFF ; 255 2e308: 8e e7 ldi r24, 0x7E ; 126 2e30a: 92 e1 ldi r25, 0x12 ; 18 2e30c: 0f 94 09 e4 call 0x3c812 ; 0x3c812 } 2e310: 2e 96 adiw r28, 0x0e ; 14 2e312: 0f b6 in r0, 0x3f ; 63 2e314: f8 94 cli 2e316: de bf out 0x3e, r29 ; 62 2e318: 0f be out 0x3f, r0 ; 63 2e31a: cd bf out 0x3d, r28 ; 61 2e31c: df 91 pop r29 2e31e: cf 91 pop r28 2e320: 08 95 ret 0002e322 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2e322: cf 92 push r12 2e324: df 92 push r13 2e326: ef 92 push r14 2e328: ff 92 push r15 2e32a: 1f 93 push r17 2e32c: cf 93 push r28 2e32e: df 93 push r29 2e330: cd b7 in r28, 0x3d ; 61 2e332: de b7 in r29, 0x3e ; 62 2e334: 62 97 sbiw r28, 0x12 ; 18 2e336: 0f b6 in r0, 0x3f ; 63 2e338: f8 94 cli 2e33a: de bf out 0x3e, r29 ; 62 2e33c: 0f be out 0x3f, r0 ; 63 2e33e: cd bf out 0x3d, r28 ; 61 2e340: 4e 87 std Y+14, r20 ; 0x0e 2e342: 5f 87 std Y+15, r21 ; 0x0f 2e344: 68 8b std Y+16, r22 ; 0x10 2e346: 79 8b std Y+17, r23 ; 0x11 2e348: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2e34a: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2e34c: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e34e: 51 11 cpse r21, r1 2e350: 31 c0 rjmp .+98 ; 0x2e3b4 *dst = '0'; 2e352: 80 e3 ldi r24, 0x30 ; 48 2e354: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e356: 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); 2e358: e1 e0 ldi r30, 0x01 ; 1 2e35a: e1 0f add r30, r17 2e35c: 81 e0 ldi r24, 0x01 ; 1 2e35e: 90 e0 ldi r25, 0x00 ; 0 2e360: 8c 0f add r24, r28 2e362: 9d 1f adc r25, r29 2e364: 8e 0f add r24, r30 2e366: 91 1d adc r25, r1 2e368: fc 01 movw r30, r24 2e36a: 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 2e36c: 9a e2 ldi r25, 0x2A ; 42 2e36e: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e370: 81 11 cpse r24, r1 2e372: 27 c0 rjmp .+78 ; 0x2e3c2 *dst = '0'; 2e374: 80 e3 ldi r24, 0x30 ; 48 2e376: 81 83 std Z+1, r24 ; 0x01 return 1; 2e378: 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); 2e37a: 1e 5f subi r17, 0xFE ; 254 2e37c: 18 0f add r17, r24 txbuff[i] = '\n'; 2e37e: e1 e0 ldi r30, 0x01 ; 1 2e380: f0 e0 ldi r31, 0x00 ; 0 2e382: ec 0f add r30, r28 2e384: fd 1f adc r31, r29 2e386: e1 0f add r30, r17 2e388: f1 1d adc r31, r1 2e38a: 8a e0 ldi r24, 0x0A ; 10 2e38c: 80 83 st Z, r24 ++i; 2e38e: 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); 2e390: fe 01 movw r30, r28 2e392: 31 96 adiw r30, 0x01 ; 1 2e394: 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--){ 2e396: 6f 01 movw r12, r30 2e398: c1 0e add r12, r17 2e39a: d1 1c adc r13, r1 2e39c: ec 14 cp r14, r12 2e39e: fd 04 cpc r15, r13 2e3a0: b1 f0 breq .+44 ; 0x2e3ce fputc(*buffer, uart2io); 2e3a2: f7 01 movw r30, r14 2e3a4: 81 91 ld r24, Z+ 2e3a6: 7f 01 movw r14, r30 2e3a8: 60 e7 ldi r22, 0x70 ; 112 2e3aa: 72 e1 ldi r23, 0x12 ; 18 2e3ac: 90 e0 ldi r25, 0x00 ; 0 2e3ae: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 2e3b2: f4 cf rjmp .-24 ; 0x2e39c 2e3b4: be 01 movw r22, r28 2e3b6: 6e 5f subi r22, 0xFE ; 254 2e3b8: 7f 4f sbci r23, 0xFF ; 255 2e3ba: 0f 94 b4 c2 call 0x38568 ; 0x38568 2e3be: 18 2f mov r17, r24 2e3c0: cb cf rjmp .-106 ; 0x2e358 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); 2e3c2: bf 01 movw r22, r30 2e3c4: 6f 5f subi r22, 0xFF ; 255 2e3c6: 7f 4f sbci r23, 0xFF ; 255 2e3c8: 0f 94 b4 c2 call 0x38568 ; 0x38568 2e3cc: d6 cf rjmp .-84 ; 0x2e37a LogRequestMsg(txbuff, len); 2e3ce: 61 2f mov r22, r17 2e3d0: ce 01 movw r24, r28 2e3d2: 01 96 adiw r24, 0x01 ; 1 2e3d4: 0f 94 34 71 call 0x2e268 ; 0x2e268 RecordUARTActivity(); 2e3d8: 0f 94 8b 70 call 0x2e116 ; 0x2e116 } 2e3dc: 62 96 adiw r28, 0x12 ; 18 2e3de: 0f b6 in r0, 0x3f ; 63 2e3e0: f8 94 cli 2e3e2: de bf out 0x3e, r29 ; 62 2e3e4: 0f be out 0x3f, r0 ; 63 2e3e6: cd bf out 0x3d, r28 ; 61 2e3e8: df 91 pop r29 2e3ea: cf 91 pop r28 2e3ec: 1f 91 pop r17 2e3ee: ff 90 pop r15 2e3f0: ef 90 pop r14 2e3f2: df 90 pop r13 2e3f4: cf 90 pop r12 2e3f6: 08 95 ret 0002e3f8 : 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) { 2e3f8: 8f 92 push r8 2e3fa: 9f 92 push r9 2e3fc: af 92 push r10 2e3fe: bf 92 push r11 2e400: df 92 push r13 2e402: ef 92 push r14 2e404: ff 92 push r15 2e406: 0f 93 push r16 2e408: 1f 93 push r17 2e40a: cf 93 push r28 2e40c: df 93 push r29 2e40e: cd b7 in r28, 0x3d ; 61 2e410: de b7 in r29, 0x3e ; 62 2e412: 67 97 sbiw r28, 0x17 ; 23 2e414: 0f b6 in r0, 0x3f ; 63 2e416: f8 94 cli 2e418: de bf out 0x3e, r29 ; 62 2e41a: 0f be out 0x3f, r0 ; 63 2e41c: cd bf out 0x3d, r28 ; 61 2e41e: 18 2f mov r17, r24 2e420: 7b 01 movw r14, r22 2e422: d4 2e mov r13, r20 2e424: 07 e5 ldi r16, 0x57 ; 87 2e426: 0b 8b std Y+19, r16 ; 0x13 2e428: 8c 8b std Y+20, r24 ; 0x14 2e42a: 7e 8b std Y+22, r23 ; 0x16 2e42c: 6d 8b std Y+21, r22 ; 0x15 2e42e: ce 01 movw r24, r28 2e430: 43 96 adiw r24, 0x13 ; 19 2e432: 0f 94 e0 c2 call 0x385c0 ; 0x385c0 2e436: 8f 8b std Y+23, r24 ; 0x17 2e438: 0e 87 std Y+14, r16 ; 0x0e 2e43a: 1f 87 std Y+15, r17 ; 0x0f 2e43c: f9 8a std Y+17, r15 ; 0x11 2e43e: e8 8a std Y+16, r14 ; 0x10 2e440: ce 01 movw r24, r28 2e442: 0e 96 adiw r24, 0x0e ; 14 2e444: 0f 94 e0 c2 call 0x385c0 ; 0x385c0 2e448: 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; 2e44a: 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) { 2e44c: 11 11 cpse r17, r1 2e44e: 27 c0 rjmp .+78 ; 0x2e49e *dst = '0'; 2e450: 80 e3 ldi r24, 0x30 ; 48 2e452: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e454: 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); 2e456: e1 e0 ldi r30, 0x01 ; 1 2e458: e8 0f add r30, r24 dst[i] = ' '; 2e45a: 21 e0 ldi r18, 0x01 ; 1 2e45c: 30 e0 ldi r19, 0x00 ; 0 2e45e: 2c 0f add r18, r28 2e460: 3d 1f adc r19, r29 2e462: 2e 0f add r18, r30 2e464: 31 1d adc r19, r1 2e466: f9 01 movw r30, r18 2e468: 90 e2 ldi r25, 0x20 ; 32 2e46a: 90 83 st Z, r25 return i + 1; 2e46c: 02 e0 ldi r16, 0x02 ; 2 2e46e: 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); 2e470: aa 24 eor r10, r10 2e472: a3 94 inc r10 2e474: b1 2c mov r11, r1 2e476: ac 0e add r10, r28 2e478: bd 1e adc r11, r29 2e47a: a0 0e add r10, r16 2e47c: 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) { 2e47e: e1 14 cp r14, r1 2e480: f1 04 cpc r15, r1 2e482: 39 f1 breq .+78 ; 0x2e4d2 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2e484: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2e486: c7 01 movw r24, r14 2e488: 88 27 eor r24, r24 2e48a: 90 7f andi r25, 0xF0 ; 240 2e48c: 89 2b or r24, r25 2e48e: 71 f4 brne .+28 ; 0x2e4ac value <<= 4U; 2e490: 24 e0 ldi r18, 0x04 ; 4 2e492: ee 0c add r14, r14 2e494: ff 1c adc r15, r15 2e496: 2a 95 dec r18 2e498: e1 f7 brne .-8 ; 0x2e492 --charsOut; 2e49a: 11 50 subi r17, 0x01 ; 1 2e49c: f4 cf rjmp .-24 ; 0x2e486 2e49e: be 01 movw r22, r28 2e4a0: 6e 5f subi r22, 0xFE ; 254 2e4a2: 7f 4f sbci r23, 0xFF ; 255 2e4a4: 81 2f mov r24, r17 2e4a6: 0f 94 b4 c2 call 0x38568 ; 0x38568 2e4aa: d5 cf rjmp .-86 ; 0x2e456 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2e4ac: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2e4ae: 88 2d mov r24, r8 2e4b0: 8a 19 sub r24, r10 2e4b2: 81 17 cp r24, r17 2e4b4: 90 f4 brcc .+36 ; 0x2e4da uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2e4b6: 8f 2d mov r24, r15 2e4b8: 82 95 swap r24 2e4ba: 8f 70 andi r24, 0x0F ; 15 2e4bc: 94 e0 ldi r25, 0x04 ; 4 2e4be: ee 0c add r14, r14 2e4c0: ff 1c adc r15, r15 2e4c2: 9a 95 dec r25 2e4c4: e1 f7 brne .-8 ; 0x2e4be 2e4c6: 0f 94 aa c2 call 0x38554 ; 0x38554 2e4ca: f4 01 movw r30, r8 2e4cc: 81 93 st Z+, r24 2e4ce: 4f 01 movw r8, r30 2e4d0: ee cf rjmp .-36 ; 0x2e4ae } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2e4d2: 80 e3 ldi r24, 0x30 ; 48 2e4d4: f5 01 movw r30, r10 2e4d6: 80 83 st Z, r24 return 1; 2e4d8: 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); 2e4da: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2e4dc: e1 e0 ldi r30, 0x01 ; 1 2e4de: f0 e0 ldi r31, 0x00 ; 0 2e4e0: ec 0f add r30, r28 2e4e2: fd 1f adc r31, r29 2e4e4: e1 0f add r30, r17 2e4e6: f1 1d adc r31, r1 2e4e8: 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 2e4ea: 9a e2 ldi r25, 0x2A ; 42 2e4ec: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e4ee: 81 11 cpse r24, r1 2e4f0: 21 c0 rjmp .+66 ; 0x2e534 *dst = '0'; 2e4f2: 80 e3 ldi r24, 0x30 ; 48 2e4f4: 81 83 std Z+1, r24 ; 0x01 return 1; 2e4f6: 81 e0 ldi r24, 0x01 ; 1 2e4f8: 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); 2e4fa: 18 0f add r17, r24 txbuff[i] = '\n'; 2e4fc: e1 e0 ldi r30, 0x01 ; 1 2e4fe: f0 e0 ldi r31, 0x00 ; 0 2e500: ec 0f add r30, r28 2e502: fd 1f adc r31, r29 2e504: e1 0f add r30, r17 2e506: f1 1d adc r31, r1 2e508: 8a e0 ldi r24, 0x0A ; 10 2e50a: 80 83 st Z, r24 ++i; 2e50c: 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); 2e50e: 9e 01 movw r18, r28 2e510: 2f 5f subi r18, 0xFF ; 255 2e512: 3f 4f sbci r19, 0xFF ; 255 2e514: 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--){ 2e516: 59 01 movw r10, r18 2e518: a1 0e add r10, r17 2e51a: b1 1c adc r11, r1 2e51c: ea 14 cp r14, r10 2e51e: fb 04 cpc r15, r11 2e520: 79 f0 breq .+30 ; 0x2e540 fputc(*buffer, uart2io); 2e522: f7 01 movw r30, r14 2e524: 81 91 ld r24, Z+ 2e526: 7f 01 movw r14, r30 2e528: 60 e7 ldi r22, 0x70 ; 112 2e52a: 72 e1 ldi r23, 0x12 ; 18 2e52c: 90 e0 ldi r25, 0x00 ; 0 2e52e: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 2e532: f4 cf rjmp .-24 ; 0x2e51c 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); 2e534: bf 01 movw r22, r30 2e536: 6f 5f subi r22, 0xFF ; 255 2e538: 7f 4f sbci r23, 0xFF ; 255 2e53a: 0f 94 b4 c2 call 0x38568 ; 0x38568 2e53e: dc cf rjmp .-72 ; 0x2e4f8 LogRequestMsg(txbuff, len); 2e540: 61 2f mov r22, r17 2e542: ce 01 movw r24, r28 2e544: 01 96 adiw r24, 0x01 ; 1 2e546: 0f 94 34 71 call 0x2e268 ; 0x2e268 RecordUARTActivity(); 2e54a: 0f 94 8b 70 call 0x2e116 ; 0x2e116 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2e54e: d0 92 2a 13 sts 0x132A, r13 ; 0x80132a } 2e552: 67 96 adiw r28, 0x17 ; 23 2e554: 0f b6 in r0, 0x3f ; 63 2e556: f8 94 cli 2e558: de bf out 0x3e, r29 ; 62 2e55a: 0f be out 0x3f, r0 ; 63 2e55c: cd bf out 0x3d, r28 ; 61 2e55e: df 91 pop r29 2e560: cf 91 pop r28 2e562: 1f 91 pop r17 2e564: 0f 91 pop r16 2e566: ff 90 pop r15 2e568: ef 90 pop r14 2e56a: df 90 pop r13 2e56c: bf 90 pop r11 2e56e: af 90 pop r10 2e570: 9f 90 pop r9 2e572: 8f 90 pop r8 2e574: 08 95 ret 0002e576 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2e576: 20 91 75 13 lds r18, 0x1375 ; 0x801375 2e57a: 2f 5f subi r18, 0xFF ; 255 2e57c: 20 93 75 13 sts 0x1375, r18 ; 0x801375 if (regIndex >= initRegs8Count) { 2e580: 22 30 cpi r18, 0x02 ; 2 2e582: 78 f4 brcc .+30 ; 0x2e5a2 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2e584: 30 e0 ldi r19, 0x00 ; 0 2e586: f9 01 movw r30, r18 2e588: ed 57 subi r30, 0x7D ; 125 2e58a: f6 45 sbci r31, 0x56 ; 86 2e58c: 84 91 lpm r24, Z 2e58e: 2d 58 subi r18, 0x8D ; 141 2e590: 3c 4e sbci r19, 0xEC ; 236 2e592: f9 01 movw r30, r18 2e594: 60 81 ld r22, Z 2e596: 70 e0 ldi r23, 0x00 ; 0 2e598: 49 e0 ldi r20, 0x09 ; 9 2e59a: 0f 94 fc 71 call 0x2e3f8 ; 0x2e3f8 } return false; 2e59e: 80 e0 ldi r24, 0x00 ; 0 2e5a0: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2e5a2: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2e5a4: 08 95 ret 0002e5a6 : * \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) { 2e5a6: 8f 92 push r8 2e5a8: 9f 92 push r9 2e5aa: af 92 push r10 2e5ac: bf 92 push r11 2e5ae: cf 92 push r12 2e5b0: df 92 push r13 2e5b2: ef 92 push r14 2e5b4: ff 92 push r15 2e5b6: cf 93 push r28 2e5b8: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2e5ba: 29 ed ldi r18, 0xD9 ; 217 2e5bc: 36 e1 ldi r19, 0x16 ; 22 2e5be: 30 93 77 0e sts 0x0E77, r19 ; 0x800e77 2e5c2: 20 93 76 0e sts 0x0E76, r18 ; 0x800e76 fatType_ = 0; 2e5c6: 10 92 f5 16 sts 0x16F5, r1 ; 0x8016f5 allocSearchStart_ = 2; 2e5ca: 42 e0 ldi r20, 0x02 ; 2 2e5cc: 50 e0 ldi r21, 0x00 ; 0 2e5ce: 60 e0 ldi r22, 0x00 ; 0 2e5d0: 70 e0 ldi r23, 0x00 ; 0 2e5d2: 40 93 de 16 sts 0x16DE, r20 ; 0x8016de 2e5d6: 50 93 df 16 sts 0x16DF, r21 ; 0x8016df 2e5da: 60 93 e0 16 sts 0x16E0, r22 ; 0x8016e0 2e5de: 70 93 e1 16 sts 0x16E1, r23 ; 0x8016e1 cacheDirty_ = 0; // cacheFlush() will write block if true 2e5e2: 10 92 75 0e sts 0x0E75, r1 ; 0x800e75 cacheMirrorBlock_ = 0; 2e5e6: 10 92 71 0e sts 0x0E71, r1 ; 0x800e71 2e5ea: 10 92 72 0e sts 0x0E72, r1 ; 0x800e72 2e5ee: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 2e5f2: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 cacheBlockNumber_ = 0XFFFFFFFF; 2e5f6: 4f ef ldi r20, 0xFF ; 255 2e5f8: 5f ef ldi r21, 0xFF ; 255 2e5fa: ba 01 movw r22, r20 2e5fc: 40 93 6d 0e sts 0x0E6D, r20 ; 0x800e6d 2e600: 50 93 6e 0e sts 0x0E6E, r21 ; 0x800e6e 2e604: 60 93 6f 0e sts 0x0E6F, r22 ; 0x800e6f 2e608: 70 93 70 0e sts 0x0E70, r23 ; 0x800e70 // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2e60c: 88 23 and r24, r24 2e60e: 09 f4 brne .+2 ; 0x2e612 2e610: 70 c0 rjmp .+224 ; 0x2e6f2 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e612: 40 e0 ldi r20, 0x00 ; 0 2e614: 60 e0 ldi r22, 0x00 ; 0 2e616: 70 e0 ldi r23, 0x00 ; 0 2e618: cb 01 movw r24, r22 2e61a: 0f 94 d7 6b call 0x2d7ae ; 0x2d7ae 2e61e: 81 11 cpse r24, r1 2e620: 0d c0 rjmp .+26 ; 0x2e63c fatType_ = 32; } return true; fail: return false; 2e622: c0 e0 ldi r28, 0x00 ; 0 } 2e624: 8c 2f mov r24, r28 2e626: df 91 pop r29 2e628: cf 91 pop r28 2e62a: ff 90 pop r15 2e62c: ef 90 pop r14 2e62e: df 90 pop r13 2e630: cf 90 pop r12 2e632: bf 90 pop r11 2e634: af 90 pop r10 2e636: 9f 90 pop r9 2e638: 8f 90 pop r8 2e63a: 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 || 2e63c: 80 91 37 10 lds r24, 0x1037 ; 0x801037 2e640: 8f 77 andi r24, 0x7F ; 127 2e642: 79 f7 brne .-34 ; 0x2e622 2e644: 80 91 43 10 lds r24, 0x1043 ; 0x801043 2e648: 90 91 44 10 lds r25, 0x1044 ; 0x801044 2e64c: a0 91 45 10 lds r26, 0x1045 ; 0x801045 2e650: b0 91 46 10 lds r27, 0x1046 ; 0x801046 2e654: 84 36 cpi r24, 0x64 ; 100 2e656: 91 05 cpc r25, r1 2e658: a1 05 cpc r26, r1 2e65a: b1 05 cpc r27, r1 2e65c: 10 f3 brcs .-60 ; 0x2e622 p->totalSectors < 100 || p->firstSector == 0) { 2e65e: c0 90 3f 10 lds r12, 0x103F ; 0x80103f 2e662: d0 90 40 10 lds r13, 0x1040 ; 0x801040 2e666: e0 90 41 10 lds r14, 0x1041 ; 0x801041 2e66a: f0 90 42 10 lds r15, 0x1042 ; 0x801042 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 || 2e66e: c1 14 cp r12, r1 2e670: d1 04 cpc r13, r1 2e672: e1 04 cpc r14, r1 2e674: f1 04 cpc r15, r1 2e676: a9 f2 breq .-86 ; 0x2e622 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e678: 40 e0 ldi r20, 0x00 ; 0 2e67a: c7 01 movw r24, r14 2e67c: b6 01 movw r22, r12 2e67e: 0f 94 d7 6b call 0x2d7ae ; 0x2d7ae 2e682: c8 2f mov r28, r24 2e684: 88 23 and r24, r24 2e686: 69 f2 breq .-102 ; 0x2e622 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e688: 80 91 84 0e lds r24, 0x0E84 ; 0x800e84 2e68c: 90 91 85 0e lds r25, 0x0E85 ; 0x800e85 2e690: 81 15 cp r24, r1 2e692: 92 40 sbci r25, 0x02 ; 2 2e694: 31 f6 brne .-116 ; 0x2e622 fbs->fatCount == 0 || 2e696: a0 91 89 0e lds r26, 0x0E89 ; 0x800e89 } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e69a: aa 23 and r26, r26 2e69c: 11 f2 breq .-124 ; 0x2e622 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e69e: 60 91 87 0e lds r22, 0x0E87 ; 0x800e87 2e6a2: 70 91 88 0e lds r23, 0x0E88 ; 0x800e88 volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2e6a6: 61 15 cp r22, r1 2e6a8: 71 05 cpc r23, r1 2e6aa: 09 f4 brne .+2 ; 0x2e6ae 2e6ac: ba cf rjmp .-140 ; 0x2e622 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2e6ae: 20 91 86 0e lds r18, 0x0E86 ; 0x800e86 } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e6b2: 22 23 and r18, r18 2e6b4: 09 f4 brne .+2 ; 0x2e6b8 2e6b6: b5 cf rjmp .-150 ; 0x2e622 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2e6b8: a0 93 f0 16 sts 0x16F0, r26 ; 0x8016f0 blocksPerCluster_ = fbs->sectorsPerCluster; 2e6bc: 20 93 e2 16 sts 0x16E2, r18 ; 0x8016e2 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2e6c0: 90 e0 ldi r25, 0x00 ; 0 2e6c2: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2e6c4: 30 e0 ldi r19, 0x00 ; 0 2e6c6: e1 e0 ldi r30, 0x01 ; 1 2e6c8: f0 e0 ldi r31, 0x00 ; 0 2e6ca: d8 2f mov r29, r24 2e6cc: af 01 movw r20, r30 2e6ce: 08 2e mov r0, r24 2e6d0: 02 c0 rjmp .+4 ; 0x2e6d6 2e6d2: 44 0f add r20, r20 2e6d4: 55 1f adc r21, r21 2e6d6: 0a 94 dec r0 2e6d8: e2 f7 brpl .-8 ; 0x2e6d2 2e6da: 24 17 cp r18, r20 2e6dc: 35 07 cpc r19, r21 2e6de: 69 f0 breq .+26 ; 0x2e6fa 2e6e0: 41 e0 ldi r20, 0x01 ; 1 2e6e2: 48 0f add r20, r24 2e6e4: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2e6e6: 89 30 cpi r24, 0x09 ; 9 2e6e8: 91 05 cpc r25, r1 2e6ea: 79 f7 brne .-34 ; 0x2e6ca 2e6ec: 40 93 eb 16 sts 0x16EB, r20 ; 0x8016eb 2e6f0: 98 cf rjmp .-208 ; 0x2e622 * 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; 2e6f2: c1 2c mov r12, r1 2e6f4: d1 2c mov r13, r1 2e6f6: 76 01 movw r14, r12 2e6f8: bf cf rjmp .-130 ; 0x2e678 2e6fa: 80 93 eb 16 sts 0x16EB, r24 ; 0x8016eb clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2e6fe: 20 91 8f 0e lds r18, 0x0E8F ; 0x800e8f 2e702: 30 91 90 0e lds r19, 0x0E90 ; 0x800e90 2e706: 50 e0 ldi r21, 0x00 ; 0 2e708: 40 e0 ldi r20, 0x00 ; 0 2e70a: 21 15 cp r18, r1 2e70c: 31 05 cpc r19, r1 2e70e: 41 f4 brne .+16 ; 0x2e720 2e710: 20 91 9d 0e lds r18, 0x0E9D ; 0x800e9d 2e714: 30 91 9e 0e lds r19, 0x0E9E ; 0x800e9e 2e718: 40 91 9f 0e lds r20, 0x0E9F ; 0x800e9f 2e71c: 50 91 a0 0e lds r21, 0x0EA0 ; 0x800ea0 2e720: 20 93 e3 16 sts 0x16E3, r18 ; 0x8016e3 2e724: 30 93 e4 16 sts 0x16E4, r19 ; 0x8016e4 2e728: 40 93 e5 16 sts 0x16E5, r20 ; 0x8016e5 2e72c: 50 93 e6 16 sts 0x16E6, r21 ; 0x8016e6 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2e730: 46 01 movw r8, r12 2e732: 57 01 movw r10, r14 2e734: 86 0e add r8, r22 2e736: 97 1e adc r9, r23 2e738: a1 1c adc r10, r1 2e73a: b1 1c adc r11, r1 2e73c: 80 92 f1 16 sts 0x16F1, r8 ; 0x8016f1 2e740: 90 92 f2 16 sts 0x16F2, r9 ; 0x8016f2 2e744: a0 92 f3 16 sts 0x16F3, r10 ; 0x8016f3 2e748: b0 92 f4 16 sts 0x16F4, r11 ; 0x8016f4 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2e74c: e0 91 8a 0e lds r30, 0x0E8A ; 0x800e8a 2e750: f0 91 8b 0e lds r31, 0x0E8B ; 0x800e8b 2e754: f0 93 f7 16 sts 0x16F7, r31 ; 0x8016f7 2e758: e0 93 f6 16 sts 0x16F6, r30 ; 0x8016f6 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2e75c: b0 e0 ldi r27, 0x00 ; 0 2e75e: 0f 94 1e de call 0x3bc3c ; 0x3bc3c <__muluhisi3> 2e762: dc 01 movw r26, r24 2e764: cb 01 movw r24, r22 2e766: 88 0d add r24, r8 2e768: 99 1d adc r25, r9 2e76a: aa 1d adc r26, r10 2e76c: bb 1d adc r27, r11 2e76e: 80 93 f8 16 sts 0x16F8, r24 ; 0x8016f8 2e772: 90 93 f9 16 sts 0x16F9, r25 ; 0x8016f9 2e776: a0 93 fa 16 sts 0x16FA, r26 ; 0x8016fa 2e77a: b0 93 fb 16 sts 0x16FB, r27 ; 0x8016fb // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2e77e: 25 e0 ldi r18, 0x05 ; 5 2e780: ee 0f add r30, r30 2e782: ff 1f adc r31, r31 2e784: 2a 95 dec r18 2e786: e1 f7 brne .-8 ; 0x2e780 2e788: e1 50 subi r30, 0x01 ; 1 2e78a: fe 4f sbci r31, 0xFE ; 254 2e78c: ef 2f mov r30, r31 2e78e: ff 27 eor r31, r31 2e790: e6 95 lsr r30 2e792: 8e 0f add r24, r30 2e794: 9f 1f adc r25, r31 2e796: a1 1d adc r26, r1 2e798: b1 1d adc r27, r1 2e79a: 80 93 ec 16 sts 0x16EC, r24 ; 0x8016ec 2e79e: 90 93 ed 16 sts 0x16ED, r25 ; 0x8016ed 2e7a2: a0 93 ee 16 sts 0x16EE, r26 ; 0x8016ee 2e7a6: b0 93 ef 16 sts 0x16EF, r27 ; 0x8016ef // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2e7aa: 80 90 8c 0e lds r8, 0x0E8C ; 0x800e8c 2e7ae: 90 90 8d 0e lds r9, 0x0E8D ; 0x800e8d 2e7b2: b1 2c mov r11, r1 2e7b4: a1 2c mov r10, r1 2e7b6: 81 14 cp r8, r1 2e7b8: 91 04 cpc r9, r1 2e7ba: 41 f4 brne .+16 ; 0x2e7cc 2e7bc: 80 90 99 0e lds r8, 0x0E99 ; 0x800e99 2e7c0: 90 90 9a 0e lds r9, 0x0E9A ; 0x800e9a 2e7c4: a0 90 9b 0e lds r10, 0x0E9B ; 0x800e9b 2e7c8: b0 90 9c 0e lds r11, 0x0E9C ; 0x800e9c fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2e7cc: c8 1a sub r12, r24 2e7ce: d9 0a sbc r13, r25 2e7d0: ea 0a sbc r14, r26 2e7d2: fb 0a sbc r15, r27 2e7d4: c8 0c add r12, r8 2e7d6: d9 1c adc r13, r9 2e7d8: ea 1c adc r14, r10 2e7da: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2e7dc: 04 c0 rjmp .+8 ; 0x2e7e6 2e7de: f6 94 lsr r15 2e7e0: e7 94 ror r14 2e7e2: d7 94 ror r13 2e7e4: c7 94 ror r12 2e7e6: da 95 dec r29 2e7e8: d2 f7 brpl .-12 ; 0x2e7de 2e7ea: c0 92 e7 16 sts 0x16E7, r12 ; 0x8016e7 2e7ee: d0 92 e8 16 sts 0x16E8, r13 ; 0x8016e8 2e7f2: e0 92 e9 16 sts 0x16E9, r14 ; 0x8016e9 2e7f6: f0 92 ea 16 sts 0x16EA, r15 ; 0x8016ea // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2e7fa: 85 ef ldi r24, 0xF5 ; 245 2e7fc: c8 16 cp r12, r24 2e7fe: 8f e0 ldi r24, 0x0F ; 15 2e800: d8 06 cpc r13, r24 2e802: e1 04 cpc r14, r1 2e804: f1 04 cpc r15, r1 2e806: 20 f4 brcc .+8 ; 0x2e810 fatType_ = 12; 2e808: 8c e0 ldi r24, 0x0C ; 12 2e80a: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 2e80e: 09 cf rjmp .-494 ; 0x2e622 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2e810: 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) { 2e812: 25 ef ldi r18, 0xF5 ; 245 2e814: c2 16 cp r12, r18 2e816: 2f ef ldi r18, 0xFF ; 255 2e818: d2 06 cpc r13, r18 2e81a: e1 04 cpc r14, r1 2e81c: f1 04 cpc r15, r1 2e81e: 88 f0 brcs .+34 ; 0x2e842 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2e820: 80 91 a5 0e lds r24, 0x0EA5 ; 0x800ea5 2e824: 90 91 a6 0e lds r25, 0x0EA6 ; 0x800ea6 2e828: a0 91 a7 0e lds r26, 0x0EA7 ; 0x800ea7 2e82c: b0 91 a8 0e lds r27, 0x0EA8 ; 0x800ea8 2e830: 80 93 f8 16 sts 0x16F8, r24 ; 0x8016f8 2e834: 90 93 f9 16 sts 0x16F9, r25 ; 0x8016f9 2e838: a0 93 fa 16 sts 0x16FA, r26 ; 0x8016fa 2e83c: b0 93 fb 16 sts 0x16FB, r27 ; 0x8016fb fatType_ = 32; 2e840: 80 e2 ldi r24, 0x20 ; 32 2e842: 80 93 f5 16 sts 0x16F5, r24 ; 0x8016f5 2e846: ee ce rjmp .-548 ; 0x2e624 0002e848 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2e848: 20 e0 ldi r18, 0x00 ; 0 2e84a: 30 e0 ldi r19, 0x00 ; 0 2e84c: 40 ea ldi r20, 0xA0 ; 160 2e84e: 52 e4 ldi r21, 0x42 ; 66 2e850: 60 e0 ldi r22, 0x00 ; 0 2e852: 70 e0 ldi r23, 0x00 ; 0 2e854: 80 ea ldi r24, 0xA0 ; 160 2e856: 92 ec ldi r25, 0xC2 ; 194 2e858: 0d 94 28 c3 jmp 0x38650 ; 0x38650 0002e85c : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2e85c: 90 91 97 13 lds r25, 0x1397 ; 0x801397 2e860: 91 fd sbrc r25, 1 2e862: 17 c0 rjmp .+46 ; 0x2e892 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2e864: 88 23 and r24, r24 2e866: a9 f0 breq .+42 ; 0x2e892 2e868: 92 fd sbrc r25, 2 2e86a: 13 c0 rjmp .+38 ; 0x2e892 Disable_E0(); 2e86c: 0f 94 26 c3 call 0x3864c ; 0x3864c resume_hotend_temp = thermal_degTargetHotend(); 2e870: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 2e874: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 2e878: 90 93 8c 13 sts 0x138C, r25 ; 0x80138c 2e87c: 80 93 8b 13 sts 0x138B, r24 ; 0x80138b mmu_print_saved |= SavedState::CooldownPending; 2e880: 80 91 97 13 lds r24, 0x1397 ; 0x801397 2e884: 84 60 ori r24, 0x04 ; 4 2e886: 80 93 97 13 sts 0x1397, r24 ; 0x801397 LogEchoEvent_P(PSTR("Heater cooldown pending")); 2e88a: 88 e6 ldi r24, 0x68 ; 104 2e88c: 96 ea ldi r25, 0xA6 ; 166 2e88e: 0d 94 4c c3 jmp 0x38698 ; 0x38698 } } 2e892: 08 95 ret 0002e894 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2e894: 80 91 97 13 lds r24, 0x1397 ; 0x801397 2e898: 80 ff sbrs r24, 0 2e89a: 47 c0 rjmp .+142 ; 0x2e92a LogEchoEvent_P(PSTR("Resuming XYZ")); 2e89c: 80 e8 ldi r24, 0x80 ; 128 2e89e: 96 ea ldi r25, 0xA6 ; 166 2e8a0: 0f 94 4c c3 call 0x38698 ; 0x38698 // 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)); 2e8a4: 80 91 83 13 lds r24, 0x1383 ; 0x801383 2e8a8: 90 91 84 13 lds r25, 0x1384 ; 0x801384 2e8ac: a0 91 85 13 lds r26, 0x1385 ; 0x801385 2e8b0: b0 91 86 13 lds r27, 0x1386 ; 0x801386 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; 2e8b4: 40 91 7f 13 lds r20, 0x137F ; 0x80137f 2e8b8: 50 91 80 13 lds r21, 0x1380 ; 0x801380 2e8bc: 60 91 81 13 lds r22, 0x1381 ; 0x801381 2e8c0: 70 91 82 13 lds r23, 0x1382 ; 0x801382 2e8c4: 40 93 41 07 sts 0x0741, r20 ; 0x800741 2e8c8: 50 93 42 07 sts 0x0742, r21 ; 0x800742 2e8cc: 60 93 43 07 sts 0x0743, r22 ; 0x800743 2e8d0: 70 93 44 07 sts 0x0744, r23 ; 0x800744 current_position[Y_AXIS] = ry; 2e8d4: 80 93 45 07 sts 0x0745, r24 ; 0x800745 2e8d8: 90 93 46 07 sts 0x0746, r25 ; 0x800746 2e8dc: a0 93 47 07 sts 0x0747, r26 ; 0x800747 2e8e0: b0 93 48 07 sts 0x0748, r27 ; 0x800748 planner_line_to_current_position_sync(feedRate_mm_s); 2e8e4: 60 e0 ldi r22, 0x00 ; 0 2e8e6: 70 e0 ldi r23, 0x00 ; 0 2e8e8: 88 e4 ldi r24, 0x48 ; 72 2e8ea: 92 e4 ldi r25, 0x42 ; 66 2e8ec: 0f 94 48 c3 call 0x38690 ; 0x38690 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2e8f0: 80 91 87 13 lds r24, 0x1387 ; 0x801387 2e8f4: 90 91 88 13 lds r25, 0x1388 ; 0x801388 2e8f8: a0 91 89 13 lds r26, 0x1389 ; 0x801389 2e8fc: b0 91 8a 13 lds r27, 0x138A ; 0x80138a 2e900: 80 93 49 07 sts 0x0749, r24 ; 0x800749 2e904: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 2e908: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 2e90c: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c planner_line_to_current_position_sync(feedRate_mm_s); 2e910: 60 e0 ldi r22, 0x00 ; 0 2e912: 70 e0 ldi r23, 0x00 ; 0 2e914: 80 e7 ldi r24, 0x70 ; 112 2e916: 91 e4 ldi r25, 0x41 ; 65 2e918: 0f 94 48 c3 call 0x38690 ; 0x38690 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2e91c: 10 92 51 07 sts 0x0751, r1 ; 0x800751 // 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); 2e920: 80 91 97 13 lds r24, 0x1397 ; 0x801397 2e924: 8e 7f andi r24, 0xFE ; 254 2e926: 80 93 97 13 sts 0x1397, r24 ; 0x801397 } } 2e92a: 08 95 ret 0002e92c : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2e92c: 0f 93 push r16 2e92e: 1f 93 push r17 2e930: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2e932: 90 91 97 13 lds r25, 0x1397 ; 0x801397 2e936: 91 11 cpse r25, r1 2e938: 72 c0 rjmp .+228 ; 0x2ea1e 2e93a: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2e93c: 85 e5 ldi r24, 0x55 ; 85 2e93e: 96 ea ldi r25, 0xA6 ; 166 2e940: 0f 94 4c c3 call 0x38698 ; 0x38698 Disable_E0(); 2e944: 0f 94 26 c3 call 0x3864c ; 0x3864c bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2e948: 0f 94 24 59 call 0x2b248 ; 0x2b248 /// 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; 2e94c: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 2e950: 81 11 cpse r24, r1 2e952: 02 c0 rjmp .+4 ; 0x2e958 2e954: 0e 94 f6 64 call 0xc9ec ; 0xc9ec // 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) { 2e958: cc 23 and r28, r28 2e95a: 09 f4 brne .+2 ; 0x2e95e 2e95c: 60 c0 rjmp .+192 ; 0x2ea1e mmu_print_saved |= SavedState::ParkExtruder; 2e95e: 80 91 97 13 lds r24, 0x1397 ; 0x801397 2e962: 81 60 ori r24, 0x01 ; 1 2e964: 80 93 97 13 sts 0x1397, r24 ; 0x801397 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]); 2e968: 80 91 49 07 lds r24, 0x0749 ; 0x800749 2e96c: 90 91 4a 07 lds r25, 0x074A ; 0x80074a 2e970: a0 91 4b 07 lds r26, 0x074B ; 0x80074b 2e974: b0 91 4c 07 lds r27, 0x074C ; 0x80074c 2e978: 40 91 45 07 lds r20, 0x0745 ; 0x800745 2e97c: 50 91 46 07 lds r21, 0x0746 ; 0x800746 2e980: 60 91 47 07 lds r22, 0x0747 ; 0x800747 2e984: 70 91 48 07 lds r23, 0x0748 ; 0x800748 resume_position = planner_current_position(); // save current pos 2e988: 00 91 41 07 lds r16, 0x0741 ; 0x800741 2e98c: 10 91 42 07 lds r17, 0x0742 ; 0x800742 2e990: 20 91 43 07 lds r18, 0x0743 ; 0x800743 2e994: 30 91 44 07 lds r19, 0x0744 ; 0x800744 2e998: 00 93 7f 13 sts 0x137F, r16 ; 0x80137f 2e99c: 10 93 80 13 sts 0x1380, r17 ; 0x801380 2e9a0: 20 93 81 13 sts 0x1381, r18 ; 0x801381 2e9a4: 30 93 82 13 sts 0x1382, r19 ; 0x801382 2e9a8: 40 93 83 13 sts 0x1383, r20 ; 0x801383 2e9ac: 50 93 84 13 sts 0x1384, r21 ; 0x801384 2e9b0: 60 93 85 13 sts 0x1385, r22 ; 0x801385 2e9b4: 70 93 86 13 sts 0x1386, r23 ; 0x801386 2e9b8: 80 93 87 13 sts 0x1387, r24 ; 0x801387 2e9bc: 90 93 88 13 sts 0x1388, r25 ; 0x801388 2e9c0: a0 93 89 13 sts 0x1389, r26 ; 0x801389 2e9c4: b0 93 8a 13 sts 0x138A, r27 ; 0x80138a current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2e9c8: 60 e0 ldi r22, 0x00 ; 0 2e9ca: 70 e0 ldi r23, 0x00 ; 0 2e9cc: 80 ea ldi r24, 0xA0 ; 160 2e9ce: 91 e4 ldi r25, 0x41 ; 65 2e9d0: 0e 94 8e 6e call 0xdd1c ; 0xdd1c void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2e9d4: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 2e9d8: 88 23 and r24, r24 2e9da: 09 f1 breq .+66 ; 0x2ea1e 2e9dc: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 2e9e0: 88 23 and r24, r24 2e9e2: e9 f0 breq .+58 ; 0x2ea1e 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; 2e9e4: 80 e0 ldi r24, 0x00 ; 0 2e9e6: 90 e0 ldi r25, 0x00 ; 0 2e9e8: aa ef ldi r26, 0xFA ; 250 2e9ea: b2 e4 ldi r27, 0x42 ; 66 2e9ec: 80 93 41 07 sts 0x0741, r24 ; 0x800741 2e9f0: 90 93 42 07 sts 0x0742, r25 ; 0x800742 2e9f4: a0 93 43 07 sts 0x0743, r26 ; 0x800743 2e9f8: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2e9fc: 10 92 45 07 sts 0x0745, r1 ; 0x800745 2ea00: 10 92 46 07 sts 0x0746, r1 ; 0x800746 2ea04: 10 92 47 07 sts 0x0747, r1 ; 0x800747 2ea08: 10 92 48 07 sts 0x0748, r1 ; 0x800748 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2ea0c: 60 e0 ldi r22, 0x00 ; 0 2ea0e: 70 e0 ldi r23, 0x00 ; 0 2ea10: 88 e4 ldi r24, 0x48 ; 72 2ea12: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2ea14: cf 91 pop r28 2ea16: 1f 91 pop r17 2ea18: 0f 91 pop r16 2ea1a: 0d 94 48 c3 jmp 0x38690 ; 0x38690 2ea1e: cf 91 pop r28 2ea20: 1f 91 pop r17 2ea22: 0f 91 pop r16 2ea24: 08 95 ret 0002ea26 : 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){ 2ea26: ef 92 push r14 2ea28: ff 92 push r15 2ea2a: 0f 93 push r16 2ea2c: 1f 93 push r17 2ea2e: cf 93 push r28 2ea30: df 93 push r29 2ea32: 1f 92 push r1 2ea34: 1f 92 push r1 2ea36: cd b7 in r28, 0x3d ; 61 2ea38: de b7 in r29, 0x3e ; 62 2ea3a: f8 2e mov r15, r24 2ea3c: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2ea3e: 80 e1 ldi r24, 0x10 ; 16 2ea40: 97 e2 ldi r25, 0x27 ; 39 2ea42: 9a 83 std Y+2, r25 ; 0x02 2ea44: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2ea46: 8a 01 movw r16, r20 2ea48: 16 95 lsr r17 2ea4a: 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); 2ea4c: 8f 2d mov r24, r15 2ea4e: 0e 94 93 e1 call 0x1c326 ; 0x1c326 while (steps--){ 2ea52: 01 50 subi r16, 0x01 ; 1 2ea54: 11 09 sbc r17, r1 2ea56: 78 f0 brcs .+30 ; 0x2ea76 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2ea58: 28 ec ldi r18, 0xC8 ; 200 2ea5a: 30 e0 ldi r19, 0x00 ; 0 2ea5c: ae 01 movw r20, r28 2ea5e: 4f 5f subi r20, 0xFF ; 255 2ea60: 5f 4f sbci r21, 0xFF ; 255 2ea62: 68 ee ldi r22, 0xE8 ; 232 2ea64: 73 e0 ldi r23, 0x03 ; 3 2ea66: 8f 2d mov r24, r15 2ea68: 0e 94 64 e0 call 0x1c0c8 ; 0x1c0c8 update_position_1_step(axes, dir); 2ea6c: 6e 2d mov r22, r14 2ea6e: 8f 2d mov r24, r15 2ea70: 0e 94 ac e1 call 0x1c358 ; 0x1c358 2ea74: ee cf rjmp .-36 ; 0x2ea52 } /// \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); 2ea76: 6e 2d mov r22, r14 2ea78: 8f 2d mov r24, r15 2ea7a: 0e 94 93 e1 call 0x1c326 ; 0x1c326 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); } 2ea7e: 0f 90 pop r0 2ea80: 0f 90 pop r0 2ea82: df 91 pop r29 2ea84: cf 91 pop r28 2ea86: 1f 91 pop r17 2ea88: 0f 91 pop r16 2ea8a: ff 90 pop r15 2ea8c: ef 90 pop r14 2ea8e: 08 95 ret 0002ea90 : 2ea90: ef 92 push r14 2ea92: ff 92 push r15 2ea94: 0f 93 push r16 2ea96: 1f 93 push r17 2ea98: cf 93 push r28 2ea9a: df 93 push r29 2ea9c: cd b7 in r28, 0x3d ; 61 2ea9e: de b7 in r29, 0x3e ; 62 2eaa0: 2f 97 sbiw r28, 0x0f ; 15 2eaa2: 0f b6 in r0, 0x3f ; 63 2eaa4: f8 94 cli 2eaa6: de bf out 0x3e, r29 ; 62 2eaa8: 0f be out 0x3f, r0 ; 63 2eaaa: cd bf out 0x3d, r28 ; 61 2eaac: ec e8 ldi r30, 0x8C ; 140 2eaae: f2 e1 ldi r31, 0x12 ; 18 2eab0: 10 a2 std Z+32, r1 ; 0x20 2eab2: 11 a2 std Z+33, r1 ; 0x21 2eab4: 12 a2 std Z+34, r1 ; 0x22 2eab6: 13 a2 std Z+35, r1 ; 0x23 2eab8: 14 a2 std Z+36, r1 ; 0x24 2eaba: 15 a2 std Z+37, r1 ; 0x25 2eabc: 16 a2 std Z+38, r1 ; 0x26 2eabe: 17 a2 std Z+39, r1 ; 0x27 2eac0: 10 a6 std Z+40, r1 ; 0x28 2eac2: 11 a6 std Z+41, r1 ; 0x29 2eac4: 10 92 25 13 sts 0x1325, r1 ; 0x801325 2eac8: 07 e2 ldi r16, 0x27 ; 39 2eaca: 13 e1 ldi r17, 0x13 ; 19 2eacc: ee 24 eor r14, r14 2eace: e3 94 inc r14 2ead0: f1 2c mov r15, r1 2ead2: d8 01 movw r26, r16 2ead4: 11 96 adiw r26, 0x01 ; 1 2ead6: fc 92 st X, r15 2ead8: ee 92 st -X, r14 2eada: 12 96 adiw r26, 0x02 ; 2 2eadc: 1c 92 st X, r1 2eade: 12 97 sbiw r26, 0x02 ; 2 2eae0: 82 e8 ldi r24, 0x82 ; 130 2eae2: 13 96 adiw r26, 0x03 ; 3 2eae4: 8c 93 st X, r24 2eae6: 40 e0 ldi r20, 0x00 ; 0 2eae8: 60 e0 ldi r22, 0x00 ; 0 2eaea: 8c e2 ldi r24, 0x2C ; 44 2eaec: 93 e1 ldi r25, 0x13 ; 19 2eaee: 0f 94 04 c3 call 0x38608 ; 0x38608 2eaf2: 40 e0 ldi r20, 0x00 ; 0 2eaf4: 60 e0 ldi r22, 0x00 ; 0 2eaf6: 81 e3 ldi r24, 0x31 ; 49 2eaf8: 93 e1 ldi r25, 0x13 ; 19 2eafa: 0f 94 04 c3 call 0x38608 ; 0x38608 2eafe: f8 01 movw r30, r16 2eb00: 17 86 std Z+15, r1 ; 0x0f 2eb02: 10 8a std Z+16, r1 ; 0x10 2eb04: 11 8a std Z+17, r1 ; 0x11 2eb06: 12 8a std Z+18, r1 ; 0x12 2eb08: 13 8a std Z+19, r1 ; 0x13 2eb0a: 8a e0 ldi r24, 0x0A ; 10 2eb0c: 84 8b std Z+20, r24 ; 0x14 2eb0e: 40 e0 ldi r20, 0x00 ; 0 2eb10: 60 e0 ldi r22, 0x00 ; 0 2eb12: ce 01 movw r24, r28 2eb14: 01 96 adiw r24, 0x01 ; 1 2eb16: 0f 94 04 c3 call 0x38608 ; 0x38608 2eb1a: 85 e0 ldi r24, 0x05 ; 5 2eb1c: fe 01 movw r30, r28 2eb1e: 31 96 adiw r30, 0x01 ; 1 2eb20: de 01 movw r26, r28 2eb22: 16 96 adiw r26, 0x06 ; 6 2eb24: 01 90 ld r0, Z+ 2eb26: 0d 92 st X+, r0 2eb28: 8a 95 dec r24 2eb2a: e1 f7 brne .-8 ; 0x2eb24 2eb2c: 85 e0 ldi r24, 0x05 ; 5 2eb2e: fe 01 movw r30, r28 2eb30: 36 96 adiw r30, 0x06 ; 6 2eb32: ac e3 ldi r26, 0x3C ; 60 2eb34: b3 e1 ldi r27, 0x13 ; 19 2eb36: 01 90 ld r0, Z+ 2eb38: 0d 92 st X+, r0 2eb3a: 8a 95 dec r24 2eb3c: e1 f7 brne .-8 ; 0x2eb36 2eb3e: d8 01 movw r26, r16 2eb40: 5a 96 adiw r26, 0x1a ; 26 2eb42: 1c 92 st X, r1 2eb44: 5a 97 sbiw r26, 0x1a ; 26 2eb46: 5c 96 adiw r26, 0x1c ; 28 2eb48: 1c 92 st X, r1 2eb4a: 1e 92 st -X, r1 2eb4c: 5b 97 sbiw r26, 0x1b ; 27 2eb4e: 8c e3 ldi r24, 0x3C ; 60 2eb50: 93 e1 ldi r25, 0x13 ; 19 2eb52: 0f 94 f3 c2 call 0x385e6 ; 0x385e6 2eb56: f8 01 movw r30, r16 2eb58: 81 8f std Z+25, r24 ; 0x19 2eb5a: 15 8e std Z+29, r1 ; 0x1d 2eb5c: 16 8e std Z+30, r1 ; 0x1e 2eb5e: 40 e0 ldi r20, 0x00 ; 0 2eb60: 60 e0 ldi r22, 0x00 ; 0 2eb62: 86 e4 ldi r24, 0x46 ; 70 2eb64: 93 e1 ldi r25, 0x13 ; 19 2eb66: 0f 94 04 c3 call 0x38608 ; 0x38608 2eb6a: d8 01 movw r26, r16 2eb6c: 94 96 adiw r26, 0x24 ; 36 2eb6e: 1c 92 st X, r1 2eb70: 40 e0 ldi r20, 0x00 ; 0 2eb72: 60 e0 ldi r22, 0x00 ; 0 2eb74: ce 01 movw r24, r28 2eb76: 0b 96 adiw r24, 0x0b ; 11 2eb78: 0f 94 04 c3 call 0x38608 ; 0x38608 2eb7c: 85 e0 ldi r24, 0x05 ; 5 2eb7e: fe 01 movw r30, r28 2eb80: 3b 96 adiw r30, 0x0b ; 11 2eb82: de 01 movw r26, r28 2eb84: 11 96 adiw r26, 0x01 ; 1 2eb86: 01 90 ld r0, Z+ 2eb88: 0d 92 st X+, r0 2eb8a: 8a 95 dec r24 2eb8c: e1 f7 brne .-8 ; 0x2eb86 2eb8e: 85 e0 ldi r24, 0x05 ; 5 2eb90: fe 01 movw r30, r28 2eb92: 31 96 adiw r30, 0x01 ; 1 2eb94: ac e4 ldi r26, 0x4C ; 76 2eb96: b3 e1 ldi r27, 0x13 ; 19 2eb98: 01 90 ld r0, Z+ 2eb9a: 0d 92 st X+, r0 2eb9c: 8a 95 dec r24 2eb9e: e1 f7 brne .-8 ; 0x2eb98 2eba0: f8 01 movw r30, r16 2eba2: 12 a6 std Z+42, r1 ; 0x2a 2eba4: 14 a6 std Z+44, r1 ; 0x2c 2eba6: 13 a6 std Z+43, r1 ; 0x2b 2eba8: 8c e4 ldi r24, 0x4C ; 76 2ebaa: 93 e1 ldi r25, 0x13 ; 19 2ebac: 0f 94 f3 c2 call 0x385e6 ; 0x385e6 2ebb0: d8 01 movw r26, r16 2ebb2: 99 96 adiw r26, 0x29 ; 41 2ebb4: 8c 93 st X, r24 2ebb6: 99 97 sbiw r26, 0x29 ; 41 2ebb8: dd 96 adiw r26, 0x3d ; 61 2ebba: 1c 92 st X, r1 2ebbc: dd 97 sbiw r26, 0x3d ; 61 2ebbe: 86 e2 ldi r24, 0x26 ; 38 2ebc0: 93 e1 ldi r25, 0x13 ; 19 2ebc2: df 96 adiw r26, 0x3f ; 63 2ebc4: 9c 93 st X, r25 2ebc6: 8e 93 st -X, r24 2ebc8: de 97 sbiw r26, 0x3e ; 62 2ebca: f0 92 68 13 sts 0x1368, r15 ; 0x801368 2ebce: e0 92 67 13 sts 0x1367, r14 ; 0x801367 2ebd2: 10 92 69 13 sts 0x1369, r1 ; 0x801369 2ebd6: 1f ef ldi r17, 0xFF ; 255 2ebd8: 10 93 6a 13 sts 0x136A, r17 ; 0x80136a 2ebdc: 0f 94 5c c3 call 0x386b8 ; 0x386b8 2ebe0: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b 2ebe4: 10 92 6c 13 sts 0x136C, r1 ; 0x80136c 2ebe8: 10 92 6d 13 sts 0x136D, r1 ; 0x80136d 2ebec: 10 92 6e 13 sts 0x136E, r1 ; 0x80136e 2ebf0: 10 92 70 13 sts 0x1370, r1 ; 0x801370 2ebf4: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f 2ebf8: 10 92 72 13 sts 0x1372, r1 ; 0x801372 2ebfc: 10 92 71 13 sts 0x1371, r1 ; 0x801371 2ec00: 10 92 75 13 sts 0x1375, r1 ; 0x801375 2ec04: 10 92 76 13 sts 0x1376, r1 ; 0x801376 2ec08: 10 92 77 13 sts 0x1377, r1 ; 0x801377 2ec0c: 10 92 78 13 sts 0x1378, r1 ; 0x801378 2ec10: 83 e0 ldi r24, 0x03 ; 3 2ec12: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b 2ec16: 10 92 7c 13 sts 0x137C, r1 ; 0x80137c 2ec1a: 85 e0 ldi r24, 0x05 ; 5 2ec1c: 80 93 73 13 sts 0x1373, r24 ; 0x801373 2ec20: 84 e1 ldi r24, 0x14 ; 20 2ec22: 80 93 74 13 sts 0x1374, r24 ; 0x801374 2ec26: 83 e6 ldi r24, 0x63 ; 99 2ec28: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 2ec2c: 80 93 7e 13 sts 0x137E, r24 ; 0x80137e 2ec30: 10 92 7f 13 sts 0x137F, r1 ; 0x80137f 2ec34: 10 92 80 13 sts 0x1380, r1 ; 0x801380 2ec38: 10 92 81 13 sts 0x1381, r1 ; 0x801381 2ec3c: 10 92 82 13 sts 0x1382, r1 ; 0x801382 2ec40: 10 92 83 13 sts 0x1383, r1 ; 0x801383 2ec44: 10 92 84 13 sts 0x1384, r1 ; 0x801384 2ec48: 10 92 85 13 sts 0x1385, r1 ; 0x801385 2ec4c: 10 92 86 13 sts 0x1386, r1 ; 0x801386 2ec50: 10 92 87 13 sts 0x1387, r1 ; 0x801387 2ec54: 10 92 88 13 sts 0x1388, r1 ; 0x801388 2ec58: 10 92 89 13 sts 0x1389, r1 ; 0x801389 2ec5c: 10 92 8a 13 sts 0x138A, r1 ; 0x80138a 2ec60: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 2ec64: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b 2ec68: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d 2ec6c: 8e e2 ldi r24, 0x2E ; 46 2ec6e: 90 e8 ldi r25, 0x80 ; 128 2ec70: 90 93 8f 13 sts 0x138F, r25 ; 0x80138f 2ec74: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e 2ec78: 10 93 90 13 sts 0x1390, r17 ; 0x801390 2ec7c: 10 93 91 13 sts 0x1391, r17 ; 0x801391 2ec80: 10 92 93 13 sts 0x1393, r1 ; 0x801393 2ec84: 10 92 92 13 sts 0x1392, r1 ; 0x801392 2ec88: 10 93 94 13 sts 0x1394, r17 ; 0x801394 2ec8c: 82 e0 ldi r24, 0x02 ; 2 2ec8e: 80 93 95 13 sts 0x1395, r24 ; 0x801395 2ec92: 10 92 96 13 sts 0x1396, r1 ; 0x801396 2ec96: 10 92 97 13 sts 0x1397, r1 ; 0x801397 2ec9a: 10 92 98 13 sts 0x1398, r1 ; 0x801398 2ec9e: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2eca2: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2eca6: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2ecaa: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d 2ecae: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c 2ecb2: 0f 94 17 8c call 0x3182e ; 0x3182e 2ecb6: ea e6 ldi r30, 0x6A ; 106 2ecb8: f4 e1 ldi r31, 0x14 ; 20 2ecba: 10 92 f2 14 sts 0x14F2, r1 ; 0x8014f2 2ecbe: 10 92 f5 14 sts 0x14F5, r1 ; 0x8014f5 2ecc2: 10 92 17 15 sts 0x1517, r1 ; 0x801517 2ecc6: 10 92 1a 15 sts 0x151A, r1 ; 0x80151a 2ecca: 89 e1 ldi r24, 0x19 ; 25 2eccc: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 2ecd0: 10 92 dc 16 sts 0x16DC, r1 ; 0x8016dc 2ecd4: 10 92 dd 16 sts 0x16DD, r1 ; 0x8016dd 2ecd8: 10 92 f5 16 sts 0x16F5, r1 ; 0x8016f5 2ecdc: 10 92 fc 16 sts 0x16FC, r1 ; 0x8016fc 2ece0: 10 92 ff 16 sts 0x16FF, r1 ; 0x8016ff 2ece4: 10 92 7d 17 sts 0x177D, r1 ; 0x80177d 2ece8: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 2ecec: 10 92 7e 17 sts 0x177E, r1 ; 0x80177e 2ecf0: 10 92 0e 16 sts 0x160E, r1 ; 0x80160e 2ecf4: 10 92 0d 16 sts 0x160D, r1 ; 0x80160d 2ecf8: 10 92 79 17 sts 0x1779, r1 ; 0x801779 2ecfc: 10 92 7a 17 sts 0x177A, r1 ; 0x80177a 2ed00: 10 92 7b 17 sts 0x177B, r1 ; 0x80177b 2ed04: 10 92 7c 17 sts 0x177C, r1 ; 0x80177c 2ed08: 10 92 80 17 sts 0x1780, r1 ; 0x801780 2ed0c: 10 92 81 17 sts 0x1781, r1 ; 0x801781 2ed10: 10 92 82 17 sts 0x1782, r1 ; 0x801782 2ed14: 10 92 83 17 sts 0x1783, r1 ; 0x801783 2ed18: 12 82 std Z+2, r1 ; 0x02 2ed1a: 13 82 std Z+3, r1 ; 0x03 2ed1c: 10 82 st Z, r1 2ed1e: 11 82 std Z+1, r1 ; 0x01 2ed20: 10 92 0c 16 sts 0x160C, r1 ; 0x80160c 2ed24: 10 92 1f 17 sts 0x171F, r1 ; 0x80171f 2ed28: ea e3 ldi r30, 0x3A ; 58 2ed2a: f5 e1 ldi r31, 0x15 ; 21 2ed2c: 82 ed ldi r24, 0xD2 ; 210 2ed2e: df 01 movw r26, r30 2ed30: 1d 92 st X+, r1 2ed32: 8a 95 dec r24 2ed34: e9 f7 brne .-6 ; 0x2ed30 2ed36: 10 92 bb 14 sts 0x14BB, r1 ; 0x8014bb 2ed3a: 10 92 ba 14 sts 0x14BA, r1 ; 0x8014ba 2ed3e: 10 92 b9 14 sts 0x14B9, r1 ; 0x8014b9 2ed42: 8d e7 ldi r24, 0x7D ; 125 2ed44: 97 e1 ldi r25, 0x17 ; 23 2ed46: 0f 94 e4 3f call 0x27fc8 ; 0x27fc8 ::start()> 2ed4a: e3 e6 ldi r30, 0x63 ; 99 2ed4c: f4 e1 ldi r31, 0x14 ; 20 2ed4e: 11 82 std Z+1, r1 ; 0x01 2ed50: 12 82 std Z+2, r1 ; 0x02 2ed52: 13 82 std Z+3, r1 ; 0x03 2ed54: 14 82 std Z+4, r1 ; 0x04 2ed56: 15 82 std Z+5, r1 ; 0x05 2ed58: 16 82 std Z+6, r1 ; 0x06 2ed5a: 10 83 st Z, r17 2ed5c: e6 e8 ldi r30, 0x86 ; 134 2ed5e: f7 e1 ldi r31, 0x17 ; 23 2ed60: 15 82 std Z+5, r1 ; 0x05 2ed62: 17 82 std Z+7, r1 ; 0x07 2ed64: 16 82 std Z+6, r1 ; 0x06 2ed66: 8a eb ldi r24, 0xBA ; 186 2ed68: 9c e4 ldi r25, 0x4C ; 76 2ed6a: 96 87 std Z+14, r25 ; 0x0e 2ed6c: 85 87 std Z+13, r24 ; 0x0d 2ed6e: 10 8a std Z+16, r1 ; 0x10 2ed70: 17 86 std Z+15, r1 ; 0x0f 2ed72: 0f 94 83 3f call 0x27f06 ; 0x27f06 2ed76: 60 93 9a 17 sts 0x179A, r22 ; 0x80179a 2ed7a: 70 93 9b 17 sts 0x179B, r23 ; 0x80179b 2ed7e: 80 93 9c 17 sts 0x179C, r24 ; 0x80179c 2ed82: 90 93 9d 17 sts 0x179D, r25 ; 0x80179d 2ed86: 2f 96 adiw r28, 0x0f ; 15 2ed88: 0f b6 in r0, 0x3f ; 63 2ed8a: f8 94 cli 2ed8c: de bf out 0x3e, r29 ; 62 2ed8e: 0f be out 0x3f, r0 ; 63 2ed90: cd bf out 0x3d, r28 ; 61 2ed92: df 91 pop r29 2ed94: cf 91 pop r28 2ed96: 1f 91 pop r17 2ed98: 0f 91 pop r16 2ed9a: ff 90 pop r15 2ed9c: ef 90 pop r14 2ed9e: 08 95 ret 0002eda0 : 2eda0: 42 e0 ldi r20, 0x02 ; 2 2eda2: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2eda6: 0d 94 8b d6 jmp 0x3ad16 ; 0x3ad16 0002edaa : 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; 2edaa: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 2edae: 83 36 cpi r24, 0x63 ; 99 2edb0: 09 f4 brne .+2 ; 0x2edb4 2edb2: 8f ef ldi r24, 0xFF ; 255 } 2edb4: 08 95 ret 0002edb6 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2edb6: 9f b7 in r25, 0x3f ; 63 2edb8: f8 94 cli 2edba: e5 e0 ldi r30, 0x05 ; 5 2edbc: f1 e0 ldi r31, 0x01 ; 1 2edbe: 80 81 ld r24, Z 2edc0: 80 64 ori r24, 0x40 ; 64 2edc2: 80 83 st Z, r24 2edc4: 9f bf out 0x3f, r25 ; 63 } 2edc6: 08 95 ret 0002edc8 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2edc8: 0f 93 push r16 2edca: 1f 93 push r17 2edcc: cf 93 push r28 2edce: df 93 push r29 2edd0: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2edd2: 0f 94 83 3f call 0x27f06 ; 0x27f06 2edd6: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2edd8: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 2eddc: 8f 3f cpi r24, 0xFF ; 255 2edde: 69 f0 breq .+26 ; 0x2edfa if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2ede0: 0f 94 83 3f call 0x27f06 ; 0x27f06 2ede4: 60 1b sub r22, r16 2ede6: 71 0b sbc r23, r17 2ede8: 6c 17 cp r22, r28 2edea: 7d 07 cpc r23, r29 2edec: a8 f3 brcs .-22 ; 0x2edd8 } return true; fail: return false; 2edee: 80 e0 ldi r24, 0x00 ; 0 } 2edf0: df 91 pop r29 2edf2: cf 91 pop r28 2edf4: 1f 91 pop r17 2edf6: 0f 91 pop r16 2edf8: 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; 2edfa: 81 e0 ldi r24, 0x01 ; 1 2edfc: f9 cf rjmp .-14 ; 0x2edf0 0002edfe : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2edfe: 80 ef ldi r24, 0xF0 ; 240 2ee00: 99 ea ldi r25, 0xA9 ; 169 2ee02: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2ee06: 60 e0 ldi r22, 0x00 ; 0 2ee08: 8c ea ldi r24, 0xAC ; 172 2ee0a: 9c e0 ldi r25, 0x0C ; 12 2ee0c: 0e 94 8c 77 call 0xef18 ; 0xef18 if (status == 1) { 2ee10: 81 30 cpi r24, 0x01 ; 1 2ee12: 21 f4 brne .+8 ; 0x2ee1c SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2ee14: 8a e4 ldi r24, 0x4A ; 74 2ee16: 9d e5 ldi r25, 0x5D ; 93 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2ee18: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc 2ee1c: 84 e4 ldi r24, 0x44 ; 68 2ee1e: 9d e5 ldi r25, 0x5D ; 93 2ee20: fb cf rjmp .-10 ; 0x2ee18 0002ee22 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2ee22: bc 01 movw r22, r24 2ee24: 99 0f add r25, r25 2ee26: 88 0b sbc r24, r24 2ee28: 99 0b sbc r25, r25 2ee2a: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2ee2e: 0d 94 8b d6 jmp 0x3ad16 ; 0x3ad16 0002ee32 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2ee32: 0f 93 push r16 2ee34: 1f 93 push r17 2ee36: cf 93 push r28 2ee38: df 93 push r29 2ee3a: ec 01 movw r28, r24 2ee3c: 0f 94 47 db call 0x3b68e ; 0x3b68e <__strlen_P> 2ee40: 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) 2ee42: 80 36 cpi r24, 0x60 ; 96 2ee44: 91 05 cpc r25, r1 2ee46: 08 f0 brcs .+2 ; 0x2ee4a 2ee48: 85 c0 rjmp .+266 ; 0x2ef54 return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2ee4a: 80 91 7e 10 lds r24, 0x107E ; 0x80107e 2ee4e: 81 11 cpse r24, r1 2ee50: 05 c0 rjmp .+10 ; 0x2ee5c cmdqueue_pop_front(); 2ee52: 0e 94 3f 78 call 0xf07e ; 0xf07e cmdbuffer_front_already_processed = true; 2ee56: 81 e0 ldi r24, 0x01 ; 1 2ee58: 80 93 7e 10 sts 0x107E, r24 ; 0x80107e } if (bufindr == bufindw && buflen > 0) 2ee5c: 40 91 6e 12 lds r20, 0x126E ; 0x80126e 2ee60: 50 91 6f 12 lds r21, 0x126F ; 0x80126f 2ee64: 80 91 7c 10 lds r24, 0x107C ; 0x80107c <_ZL7bufindw.lto_priv.571> 2ee68: 90 91 7d 10 lds r25, 0x107D ; 0x80107d <_ZL7bufindw.lto_priv.571+0x1> 2ee6c: 48 17 cp r20, r24 2ee6e: 59 07 cpc r21, r25 2ee70: 41 f4 brne .+16 ; 0x2ee82 2ee72: 20 91 7f 10 lds r18, 0x107F ; 0x80107f 2ee76: 30 91 80 10 lds r19, 0x1080 ; 0x801080 2ee7a: 12 16 cp r1, r18 2ee7c: 13 06 cpc r1, r19 2ee7e: 0c f4 brge .+2 ; 0x2ee82 2ee80: 69 c0 rjmp .+210 ; 0x2ef54 // 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; 2ee82: 20 91 7a 10 lds r18, 0x107A ; 0x80107a 2ee86: 30 91 7b 10 lds r19, 0x107B ; 0x80107b 2ee8a: 12 16 cp r1, r18 2ee8c: 13 06 cpc r1, r19 2ee8e: 0c f0 brlt .+2 ; 0x2ee92 2ee90: 41 c0 rjmp .+130 ; 0x2ef14 2ee92: 9c 01 movw r18, r24 2ee94: 2f 59 subi r18, 0x9F ; 159 2ee96: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2ee98: 84 17 cp r24, r20 2ee9a: 95 07 cpc r25, r21 2ee9c: e8 f5 brcc .+122 ; 0x2ef18 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2ee9e: 44 50 subi r20, 0x04 ; 4 2eea0: 51 09 sbc r21, r1 2eea2: 40 1b sub r20, r16 2eea4: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2eea6: 42 17 cp r20, r18 2eea8: 53 07 cpc r21, r19 2eeaa: 0c f4 brge .+2 ; 0x2eeae 2eeac: 53 c0 rjmp .+166 ; 0x2ef54 } } 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); 2eeae: 50 93 6f 12 sts 0x126F, r21 ; 0x80126f 2eeb2: 40 93 6e 12 sts 0x126E, r20 ; 0x80126e 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; 2eeb6: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 2eeba: 90 91 6f 12 lds r25, 0x126F ; 0x80126f 2eebe: fc 01 movw r30, r24 2eec0: ef 57 subi r30, 0x7F ; 127 2eec2: ff 4e sbci r31, 0xEF ; 239 2eec4: 23 e0 ldi r18, 0x03 ; 3 2eec6: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2eec8: be 01 movw r22, r28 2eeca: 8c 57 subi r24, 0x7C ; 124 2eecc: 9f 4e sbci r25, 0xEF ; 239 2eece: 0f 94 40 db call 0x3b680 ; 0x3b680 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2eed2: 80 91 7f 10 lds r24, 0x107F ; 0x80107f 2eed6: 90 91 80 10 lds r25, 0x1080 ; 0x801080 2eeda: 01 96 adiw r24, 0x01 ; 1 2eedc: 90 93 80 10 sts 0x1080, r25 ; 0x801080 2eee0: 80 93 7f 10 sts 0x107F, r24 ; 0x80107f SERIAL_ECHO_START; 2eee4: 82 ee ldi r24, 0xE2 ; 226 2eee6: 99 ea ldi r25, 0xA9 ; 169 2eee8: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(enqueingFront); 2eeec: 83 ec ldi r24, 0xC3 ; 195 2eeee: 99 ea ldi r25, 0xA9 ; 169 2eef0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2eef4: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 2eef8: 90 91 6f 12 lds r25, 0x126F ; 0x80126f } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2eefc: 8c 57 subi r24, 0x7C ; 124 2eefe: 9f 4e sbci r25, 0xEF ; 239 2ef00: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_ECHOLNPGM("\""); 2ef04: 81 ec ldi r24, 0xC1 ; 193 2ef06: 99 ea ldi r25, 0xA9 ; 169 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2ef08: df 91 pop r29 2ef0a: cf 91 pop r28 2ef0c: 1f 91 pop r17 2ef0e: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ef10: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc // 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) 2ef14: 9c 01 movw r18, r24 2ef16: c0 cf rjmp .-128 ; 0x2ee98 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2ef18: c8 01 movw r24, r16 2ef1a: 04 96 adiw r24, 0x04 ; 4 2ef1c: 48 17 cp r20, r24 2ef1e: 59 07 cpc r21, r25 2ef20: 28 f0 brcs .+10 ; 0x2ef2c // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2ef22: 44 50 subi r20, 0x04 ; 4 2ef24: 51 09 sbc r21, r1 2ef26: 40 1b sub r20, r16 2ef28: 51 0b sbc r21, r17 2ef2a: c1 cf rjmp .-126 ; 0x2eeae return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2ef2c: 89 ee ldi r24, 0xE9 ; 233 2ef2e: 91 e0 ldi r25, 0x01 ; 1 2ef30: bc 01 movw r22, r24 2ef32: 60 1b sub r22, r16 2ef34: 71 0b sbc r23, r17 2ef36: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2ef38: 62 17 cp r22, r18 2ef3a: 73 07 cpc r23, r19 2ef3c: 5c f0 brlt .+22 ; 0x2ef54 memset(cmdbuffer, 0, bufindr); 2ef3e: 70 e0 ldi r23, 0x00 ; 0 2ef40: 60 e0 ldi r22, 0x00 ; 0 2ef42: 81 e8 ldi r24, 0x81 ; 129 2ef44: 90 e1 ldi r25, 0x10 ; 16 2ef46: 0f 94 bb e3 call 0x3c776 ; 0x3c776 bufindr = bufindr_new; 2ef4a: 10 93 6f 12 sts 0x126F, r17 ; 0x80126f 2ef4e: 00 93 6e 12 sts 0x126E, r16 ; 0x80126e 2ef52: b1 cf rjmp .-158 ; 0x2eeb6 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2ef54: 8a eb ldi r24, 0xBA ; 186 2ef56: 99 ea ldi r25, 0xA9 ; 169 2ef58: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(enqueingFront); 2ef5c: 83 ec ldi r24, 0xC3 ; 195 2ef5e: 99 ea ldi r25, 0xA9 ; 169 2ef60: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2ef64: ce 01 movw r24, r28 2ef66: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ef6a: 83 ea ldi r24, 0xA3 ; 163 2ef6c: 99 ea ldi r25, 0xA9 ; 169 2ef6e: cc cf rjmp .-104 ; 0x2ef08 0002ef70 : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2ef70: ab 01 movw r20, r22 2ef72: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2ef74: 8c ef ldi r24, 0xFC ; 252 2ef76: 96 e1 ldi r25, 0x16 ; 22 2ef78: 0f 94 a9 6e call 0x2dd52 ; 0x2dd52 2ef7c: 81 11 cpse r24, r1 2ef7e: 02 c0 rjmp .+4 ; 0x2ef84 2ef80: 80 e0 ldi r24, 0x00 ; 0 2ef82: 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() ) 2ef84: 8c ef ldi r24, 0xFC ; 252 2ef86: 96 e1 ldi r25, 0x16 ; 22 2ef88: 0f 94 93 6d call 0x2db26 ; 0x2db26 2ef8c: 88 23 and r24, r24 2ef8e: c1 f3 breq .-16 ; 0x2ef80 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; 2ef90: 20 91 1d 17 lds r18, 0x171D ; 0x80171d 2ef94: 30 91 1e 17 lds r19, 0x171E ; 0x80171e 2ef98: 27 58 subi r18, 0x87 ; 135 2ef9a: 31 4f sbci r19, 0xF1 ; 241 2ef9c: 30 93 18 17 sts 0x1718, r19 ; 0x801718 2efa0: 20 93 17 17 sts 0x1717, r18 ; 0x801717 bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2efa4: 08 95 ret 0002efa6 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2efa6: 8f 92 push r8 2efa8: 9f 92 push r9 2efaa: af 92 push r10 2efac: bf 92 push r11 2efae: cf 92 push r12 2efb0: df 92 push r13 2efb2: ef 92 push r14 2efb4: ff 92 push r15 2efb6: 0f 93 push r16 2efb8: 1f 93 push r17 2efba: cf 93 push r28 2efbc: df 93 push r29 2efbe: cd b7 in r28, 0x3d ; 61 2efc0: de b7 in r29, 0x3e ; 62 2efc2: ee 97 sbiw r28, 0x3e ; 62 2efc4: 0f b6 in r0, 0x3f ; 63 2efc6: f8 94 cli 2efc8: de bf out 0x3e, r29 ; 62 2efca: 0f be out 0x3f, r0 ; 63 2efcc: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2efce: 80 91 ba 14 lds r24, 0x14BA ; 0x8014ba 2efd2: 8f 93 push r24 2efd4: 80 91 b9 14 lds r24, 0x14B9 ; 0x8014b9 2efd8: 8f 93 push r24 2efda: 8e e5 ldi r24, 0x5E ; 94 2efdc: 99 ea ldi r25, 0xA9 ; 169 2efde: 9f 93 push r25 2efe0: 8f 93 push r24 2efe2: 8e 01 movw r16, r28 2efe4: 0f 5d subi r16, 0xDF ; 223 2efe6: 1f 4f sbci r17, 0xFF ; 255 2efe8: 1f 93 push r17 2efea: 0f 93 push r16 2efec: 0f 94 a0 dc call 0x3b940 ; 0x3b940 2eff0: 0f 90 pop r0 2eff2: 0f 90 pop r0 2eff4: 0f 90 pop r0 2eff6: 0f 90 pop r0 2eff8: 0f 90 pop r0 2effa: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2effc: f1 2c mov r15, r1 2effe: f8 01 movw r30, r16 2f000: 01 90 ld r0, Z+ 2f002: 00 20 and r0, r0 2f004: e9 f7 brne .-6 ; 0x2f000 2f006: 31 97 sbiw r30, 0x01 ; 1 2f008: e0 1b sub r30, r16 2f00a: f1 0b sbc r31, r17 2f00c: fe 16 cp r15, r30 2f00e: 84 f4 brge .+32 ; 0x2f030 autoname[i]=tolower(autoname[i]); 2f010: 68 01 movw r12, r16 2f012: cf 0c add r12, r15 2f014: d1 1c adc r13, r1 2f016: f7 fc sbrc r15, 7 2f018: da 94 dec r13 2f01a: f6 01 movw r30, r12 2f01c: 80 81 ld r24, Z 2f01e: 08 2e mov r0, r24 2f020: 00 0c add r0, r0 2f022: 99 0b sbc r25, r25 2f024: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 2f028: f6 01 movw r30, r12 2f02a: 80 83 st Z, r24 2f02c: f3 94 inc r15 2f02e: e7 cf rjmp .-50 ; 0x2effe dir_t p; root.rewind(); 2f030: 82 ef ldi r24, 0xF2 ; 242 2f032: 94 e1 ldi r25, 0x14 ; 20 2f034: 0e 94 af 78 call 0xf15e ; 0xf15e bool found=false; 2f038: a1 2c mov r10, r1 2f03a: ce 01 movw r24, r28 2f03c: 01 96 adiw r24, 0x01 ; 1 2f03e: 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); 2f040: 8c ee ldi r24, 0xEC ; 236 2f042: c8 2e mov r12, r24 2f044: 80 e7 ldi r24, 0x70 ; 112 2f046: 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; 2f048: 80 91 f5 14 lds r24, 0x14F5 ; 0x8014f5 2f04c: 82 30 cpi r24, 0x02 ; 2 2f04e: 08 f4 brcc .+2 ; 0x2f052 2f050: 50 c0 rjmp .+160 ; 0x2f0f2 2f052: 80 91 fa 14 lds r24, 0x14FA ; 0x8014fa 2f056: 90 91 fb 14 lds r25, 0x14FB ; 0x8014fb 2f05a: a0 91 fc 14 lds r26, 0x14FC ; 0x8014fc 2f05e: b0 91 fd 14 lds r27, 0x14FD ; 0x8014fd 2f062: 8f 71 andi r24, 0x1F ; 31 2f064: 99 27 eor r25, r25 2f066: aa 27 eor r26, r26 2f068: bb 27 eor r27, r27 2f06a: 89 2b or r24, r25 2f06c: 8a 2b or r24, r26 2f06e: 8b 2b or r24, r27 2f070: 09 f0 breq .+2 ; 0x2f074 2f072: 3f c0 rjmp .+126 ; 0x2f0f2 2f074: 50 e0 ldi r21, 0x00 ; 0 2f076: 40 e0 ldi r20, 0x00 ; 0 2f078: b7 01 movw r22, r14 2f07a: 82 ef ldi r24, 0xF2 ; 242 2f07c: 94 e1 ldi r25, 0x14 ; 20 2f07e: 0f 94 0c 6e call 0x2dc18 ; 0x2dc18 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2f082: 18 16 cp r1, r24 2f084: b4 f5 brge .+108 ; 0x2f0f2 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2f086: b1 2c mov r11, r1 2f088: f7 01 movw r30, r14 2f08a: 01 90 ld r0, Z+ 2f08c: 00 20 and r0, r0 2f08e: e9 f7 brne .-6 ; 0x2f08a 2f090: 31 97 sbiw r30, 0x01 ; 1 2f092: ee 19 sub r30, r14 2f094: ff 09 sbc r31, r15 2f096: be 16 cp r11, r30 2f098: 74 f4 brge .+28 ; 0x2f0b6 p.name[i]=tolower(p.name[i]); 2f09a: 47 01 movw r8, r14 2f09c: 8b 0c add r8, r11 2f09e: 91 1c adc r9, r1 2f0a0: b7 fc sbrc r11, 7 2f0a2: 9a 94 dec r9 2f0a4: f4 01 movw r30, r8 2f0a6: 80 81 ld r24, Z 2f0a8: 90 e0 ldi r25, 0x00 ; 0 2f0aa: 0f 94 9d e3 call 0x3c73a ; 0x3c73a 2f0ae: f4 01 movw r30, r8 2f0b0: 80 83 st Z, r24 2f0b2: b3 94 inc r11 2f0b4: e9 cf rjmp .-46 ; 0x2f088 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2f0b6: 8a 85 ldd r24, Y+10 ; 0x0a 2f0b8: 8e 37 cpi r24, 0x7E ; 126 2f0ba: 31 f2 breq .-116 ; 0x2f048 if(strncmp((char*)p.name,autoname,5)==0) 2f0bc: 45 e0 ldi r20, 0x05 ; 5 2f0be: 50 e0 ldi r21, 0x00 ; 0 2f0c0: b8 01 movw r22, r16 2f0c2: c7 01 movw r24, r14 2f0c4: 0f 94 fb e3 call 0x3c7f6 ; 0x3c7f6 2f0c8: 89 2b or r24, r25 2f0ca: 09 f0 breq .+2 ; 0x2f0ce 2f0cc: bd cf rjmp .-134 ; 0x2f048 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2f0ce: 1f 93 push r17 2f0d0: 0f 93 push r16 2f0d2: df 92 push r13 2f0d4: cf 92 push r12 2f0d6: 0e 94 e1 89 call 0x113c2 ; 0x113c2 // M24: Start/resume SD print enquecommand_P(MSG_M24); 2f0da: 61 e0 ldi r22, 0x01 ; 1 2f0dc: 88 ee ldi r24, 0xE8 ; 232 2f0de: 90 e7 ldi r25, 0x70 ; 112 2f0e0: 0e 94 43 89 call 0x11286 ; 0x11286 2f0e4: 0f 90 pop r0 2f0e6: 0f 90 pop r0 2f0e8: 0f 90 pop r0 2f0ea: 0f 90 pop r0 found=true; 2f0ec: aa 24 eor r10, r10 2f0ee: a3 94 inc r10 2f0f0: ab cf rjmp .-170 ; 0x2f048 } } if(!found) lastnr=-1; 2f0f2: 8f ef ldi r24, 0xFF ; 255 2f0f4: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2f0f6: aa 20 and r10, r10 2f0f8: 29 f0 breq .+10 ; 0x2f104 lastnr=-1; else lastnr++; 2f0fa: 80 91 b9 14 lds r24, 0x14B9 ; 0x8014b9 2f0fe: 90 91 ba 14 lds r25, 0x14BA ; 0x8014ba 2f102: 01 96 adiw r24, 0x01 ; 1 2f104: 90 93 ba 14 sts 0x14BA, r25 ; 0x8014ba 2f108: 80 93 b9 14 sts 0x14B9, r24 ; 0x8014b9 } 2f10c: ee 96 adiw r28, 0x3e ; 62 2f10e: 0f b6 in r0, 0x3f ; 63 2f110: f8 94 cli 2f112: de bf out 0x3e, r29 ; 62 2f114: 0f be out 0x3f, r0 ; 63 2f116: cd bf out 0x3d, r28 ; 61 2f118: df 91 pop r29 2f11a: cf 91 pop r28 2f11c: 1f 91 pop r17 2f11e: 0f 91 pop r16 2f120: ff 90 pop r15 2f122: ef 90 pop r14 2f124: df 90 pop r13 2f126: cf 90 pop r12 2f128: bf 90 pop r11 2f12a: af 90 pop r10 2f12c: 9f 90 pop r9 2f12e: 8f 90 pop r8 2f130: 08 95 ret 0002f132 : * \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) { 2f132: 8f 92 push r8 2f134: 9f 92 push r9 2f136: af 92 push r10 2f138: bf 92 push r11 2f13a: cf 92 push r12 2f13c: df 92 push r13 2f13e: ef 92 push r14 2f140: ff 92 push r15 2f142: 0f 93 push r16 2f144: 1f 93 push r17 2f146: cf 93 push r28 2f148: df 93 push r29 2f14a: 00 d0 rcall .+0 ; 0x2f14c 2f14c: 1f 92 push r1 2f14e: cd b7 in r28, 0x3d ; 61 2f150: de b7 in r29, 0x3e ; 62 2f152: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2f154: 83 81 ldd r24, Z+3 ; 0x03 2f156: 81 30 cpi r24, 0x01 ; 1 2f158: 11 f0 breq .+4 ; 0x2f15e // set file to correct position return seekSet(newPos); fail: return false; 2f15a: 80 e0 ldi r24, 0x00 ; 0 2f15c: 60 c0 rjmp .+192 ; 0x2f21e * \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; 2f15e: 81 81 ldd r24, Z+1 ; 0x01 2f160: 81 ff sbrs r24, 1 2f162: fb cf rjmp .-10 ; 0x2f15a // 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; 2f164: 81 89 ldd r24, Z+17 ; 0x11 2f166: 92 89 ldd r25, Z+18 ; 0x12 2f168: a3 89 ldd r26, Z+19 ; 0x13 2f16a: b4 89 ldd r27, Z+20 ; 0x14 2f16c: 89 2b or r24, r25 2f16e: 8a 2b or r24, r26 2f170: 8b 2b or r24, r27 2f172: 09 f4 brne .+2 ; 0x2f176 2f174: 6e c0 rjmp .+220 ; 0x2f252 2f176: 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; 2f178: 40 e0 ldi r20, 0x00 ; 0 2f17a: 50 e0 ldi r21, 0x00 ; 0 2f17c: ba 01 movw r22, r20 2f17e: cf 01 movw r24, r30 2f180: 0f 94 a9 6e call 0x2dd52 ; 0x2dd52 2f184: 88 23 and r24, r24 2f186: 49 f3 breq .-46 ; 0x2f15a if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2f188: f7 01 movw r30, r14 2f18a: c1 8c ldd r12, Z+25 ; 0x19 2f18c: d2 8c ldd r13, Z+26 ; 0x1a 2f18e: 85 88 ldd r8, Z+21 ; 0x15 2f190: 96 88 ldd r9, Z+22 ; 0x16 2f192: a7 88 ldd r10, Z+23 ; 0x17 2f194: 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; 2f196: 82 e0 ldi r24, 0x02 ; 2 2f198: 90 e0 ldi r25, 0x00 ; 0 2f19a: a0 e0 ldi r26, 0x00 ; 0 2f19c: b0 e0 ldi r27, 0x00 ; 0 2f19e: f6 01 movw r30, r12 2f1a0: 80 83 st Z, r24 2f1a2: 91 83 std Z+1, r25 ; 0x01 2f1a4: a2 83 std Z+2, r26 ; 0x02 2f1a6: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2f1a8: 9e 01 movw r18, r28 2f1aa: 2f 5f subi r18, 0xFF ; 255 2f1ac: 3f 4f sbci r19, 0xFF ; 255 2f1ae: b5 01 movw r22, r10 2f1b0: a4 01 movw r20, r8 2f1b2: c6 01 movw r24, r12 2f1b4: 0f 94 a6 6c call 0x2d94c ; 0x2d94c 2f1b8: 88 23 and r24, r24 2f1ba: 79 f2 breq .-98 ; 0x2f15a // free cluster if (!fatPut(cluster, 0)) goto fail; 2f1bc: 00 e0 ldi r16, 0x00 ; 0 2f1be: 10 e0 ldi r17, 0x00 ; 0 2f1c0: 98 01 movw r18, r16 2f1c2: b5 01 movw r22, r10 2f1c4: a4 01 movw r20, r8 2f1c6: c6 01 movw r24, r12 2f1c8: 0f 94 14 6c call 0x2d828 ; 0x2d828 2f1cc: 88 23 and r24, r24 2f1ce: 29 f2 breq .-118 ; 0x2f15a cluster = next; 2f1d0: 89 80 ldd r8, Y+1 ; 0x01 2f1d2: 9a 80 ldd r9, Y+2 ; 0x02 2f1d4: ab 80 ldd r10, Y+3 ; 0x03 2f1d6: 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; 2f1d8: f6 01 movw r30, r12 2f1da: 87 89 ldd r24, Z+23 ; 0x17 2f1dc: 80 31 cpi r24, 0x10 ; 16 2f1de: 81 f5 brne .+96 ; 0x2f240 2f1e0: f8 ef ldi r31, 0xF8 ; 248 2f1e2: 8f 16 cp r8, r31 2f1e4: ff ef ldi r31, 0xFF ; 255 2f1e6: 9f 06 cpc r9, r31 2f1e8: a1 04 cpc r10, r1 2f1ea: b1 04 cpc r11, r1 2f1ec: e8 f2 brcs .-70 ; 0x2f1a8 firstCluster_ = 0; 2f1ee: f7 01 movw r30, r14 2f1f0: 15 8a std Z+21, r1 ; 0x15 2f1f2: 16 8a std Z+22, r1 ; 0x16 2f1f4: 17 8a std Z+23, r1 ; 0x17 2f1f6: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2f1f8: 11 8a std Z+17, r1 ; 0x11 2f1fa: 12 8a std Z+18, r1 ; 0x12 2f1fc: 13 8a std Z+19, r1 ; 0x13 2f1fe: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2f200: 81 81 ldd r24, Z+1 ; 0x01 2f202: 80 68 ori r24, 0x80 ; 128 2f204: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2f206: c7 01 movw r24, r14 2f208: 0f 94 74 6e call 0x2dce8 ; 0x2dce8 2f20c: 88 23 and r24, r24 2f20e: 09 f4 brne .+2 ; 0x2f212 2f210: a4 cf rjmp .-184 ; 0x2f15a // set file to correct position return seekSet(newPos); 2f212: 40 e0 ldi r20, 0x00 ; 0 2f214: 50 e0 ldi r21, 0x00 ; 0 2f216: ba 01 movw r22, r20 2f218: c7 01 movw r24, r14 2f21a: 0f 94 a9 6e call 0x2dd52 ; 0x2dd52 fail: return false; } 2f21e: 0f 90 pop r0 2f220: 0f 90 pop r0 2f222: 0f 90 pop r0 2f224: 0f 90 pop r0 2f226: df 91 pop r29 2f228: cf 91 pop r28 2f22a: 1f 91 pop r17 2f22c: 0f 91 pop r16 2f22e: ff 90 pop r15 2f230: ef 90 pop r14 2f232: df 90 pop r13 2f234: cf 90 pop r12 2f236: bf 90 pop r11 2f238: af 90 pop r10 2f23a: 9f 90 pop r9 2f23c: 8f 90 pop r8 2f23e: 08 95 ret return cluster >= FAT32EOC_MIN; 2f240: 88 ef ldi r24, 0xF8 ; 248 2f242: 88 16 cp r8, r24 2f244: 8f ef ldi r24, 0xFF ; 255 2f246: 98 06 cpc r9, r24 2f248: a8 06 cpc r10, r24 2f24a: 8f e0 ldi r24, 0x0F ; 15 2f24c: b8 06 cpc r11, r24 2f24e: 78 f6 brcc .-98 ; 0x2f1ee 2f250: ab cf rjmp .-170 ; 0x2f1a8 // 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; 2f252: 81 e0 ldi r24, 0x01 ; 1 2f254: e4 cf rjmp .-56 ; 0x2f21e 0002f256 : +* 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) { 2f256: 2f 92 push r2 2f258: 3f 92 push r3 2f25a: 4f 92 push r4 2f25c: 5f 92 push r5 2f25e: 6f 92 push r6 2f260: 7f 92 push r7 2f262: 8f 92 push r8 2f264: 9f 92 push r9 2f266: af 92 push r10 2f268: bf 92 push r11 2f26a: cf 92 push r12 2f26c: df 92 push r13 2f26e: ef 92 push r14 2f270: ff 92 push r15 2f272: 0f 93 push r16 2f274: 1f 93 push r17 2f276: cf 93 push r28 2f278: df 93 push r29 2f27a: cd b7 in r28, 0x3d ; 61 2f27c: de b7 in r29, 0x3e ; 62 2f27e: c6 57 subi r28, 0x76 ; 118 2f280: d1 09 sbc r29, r1 2f282: 0f b6 in r0, 0x3f ; 63 2f284: f8 94 cli 2f286: de bf out 0x3e, r29 ; 62 2f288: 0f be out 0x3f, r0 ; 63 2f28a: cd bf out 0x3d, r28 ; 61 2f28c: 4c 01 movw r8, r24 2f28e: 6b 01 movw r12, r22 2f290: 3a 01 movw r6, r20 2f292: e5 96 adiw r28, 0x35 ; 53 2f294: 2f af std Y+63, r18 ; 0x3f 2f296: e5 97 sbiw r28, 0x35 ; 53 2f298: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2f29a: 2d b6 in r2, 0x3d ; 61 2f29c: 3e b6 in r3, 0x3e ; 62 2f29e: 10 2f mov r17, r16 2f2a0: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2f2a2: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2f2a6: 8f 5f subi r24, 0xFF ; 255 2f2a8: 80 93 78 0e sts 0x0E78, r24 ; 0x800e78 } 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()) { 2f2ac: fb 01 movw r30, r22 2f2ae: 80 85 ldd r24, Z+8 ; 0x08 2f2b0: 91 85 ldd r25, Z+9 ; 0x09 2f2b2: a2 85 ldd r26, Z+10 ; 0x0a 2f2b4: b3 85 ldd r27, Z+11 ; 0x0b 2f2b6: 80 93 7f 14 sts 0x147F, r24 ; 0x80147f 2f2ba: 90 93 80 14 sts 0x1480, r25 ; 0x801480 2f2be: a0 93 81 14 sts 0x1481, r26 ; 0x801481 2f2c2: b0 93 82 14 sts 0x1482, r27 ; 0x801482 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2f2c6: 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); 2f2c8: 5e 01 movw r10, r28 2f2ca: f7 e6 ldi r31, 0x67 ; 103 2f2cc: af 0e add r10, r31 2f2ce: 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; 2f2d0: f6 01 movw r30, r12 2f2d2: 83 81 ldd r24, Z+3 ; 0x03 2f2d4: 82 30 cpi r24, 0x02 ; 2 2f2d6: 08 f4 brcc .+2 ; 0x2f2da 2f2d8: c0 c1 rjmp .+896 ; 0x2f65a 2f2da: 80 85 ldd r24, Z+8 ; 0x08 2f2dc: 91 85 ldd r25, Z+9 ; 0x09 2f2de: a2 85 ldd r26, Z+10 ; 0x0a 2f2e0: b3 85 ldd r27, Z+11 ; 0x0b 2f2e2: 8f 71 andi r24, 0x1F ; 31 2f2e4: 99 27 eor r25, r25 2f2e6: aa 27 eor r26, r26 2f2e8: bb 27 eor r27, r27 2f2ea: 89 2b or r24, r25 2f2ec: 8a 2b or r24, r26 2f2ee: 8b 2b or r24, r27 2f2f0: 09 f0 breq .+2 ; 0x2f2f4 2f2f2: b3 c1 rjmp .+870 ; 0x2f65a //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'; 2f2f4: 10 92 83 14 sts 0x1483, r1 ; 0x801483 2f2f8: 43 e8 ldi r20, 0x83 ; 131 2f2fa: 54 e1 ldi r21, 0x14 ; 20 2f2fc: be 01 movw r22, r28 2f2fe: 69 5b subi r22, 0xB9 ; 185 2f300: 7f 4f sbci r23, 0xFF ; 255 2f302: c6 01 movw r24, r12 2f304: 0f 94 0c 6e call 0x2dc18 ; 0x2dc18 } 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()) { 2f308: 18 16 cp r1, r24 2f30a: 0c f0 brlt .+2 ; 0x2f30e 2f30c: a6 c1 rjmp .+844 ; 0x2f65a if (recursionCnt > MAX_DIR_DEPTH) 2f30e: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2f312: 87 30 cpi r24, 0x07 ; 7 2f314: 08 f0 brcs .+2 ; 0x2f318 2f316: a1 c1 rjmp .+834 ; 0x2f65a return; uint8_t pn0 = p.name[0]; 2f318: 28 96 adiw r28, 0x08 ; 8 2f31a: 8f ad ldd r24, Y+63 ; 0x3f 2f31c: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2f31e: 88 23 and r24, r24 2f320: 09 f4 brne .+2 ; 0x2f324 2f322: 9b c1 rjmp .+822 ; 0x2f65a if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2f324: 85 3e cpi r24, 0xE5 ; 229 2f326: 09 f4 brne .+2 ; 0x2f32a 2f328: 39 c1 rjmp .+626 ; 0x2f59c 2f32a: 8e 32 cpi r24, 0x2E ; 46 2f32c: 09 f4 brne .+2 ; 0x2f330 2f32e: 36 c1 rjmp .+620 ; 0x2f59c if (longFilename[0] == '.') continue; 2f330: 80 91 83 14 lds r24, 0x1483 ; 0x801483 2f334: 8e 32 cpi r24, 0x2E ; 46 2f336: 09 f4 brne .+2 ; 0x2f33a 2f338: 31 c1 rjmp .+610 ; 0x2f59c 2f33a: 63 96 adiw r28, 0x13 ; 19 2f33c: 8f ad ldd r24, Y+63 ; 0x3f 2f33e: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2f340: 98 2f mov r25, r24 2f342: 9a 70 andi r25, 0x0A ; 10 2f344: 09 f0 breq .+2 ; 0x2f348 2f346: 2a c1 rjmp .+596 ; 0x2f59c 2f348: 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; 2f34a: 91 e0 ldi r25, 0x01 ; 1 2f34c: 80 31 cpi r24, 0x10 ; 16 2f34e: 19 f0 breq .+6 ; 0x2f356 2f350: 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 2f352: 80 31 cpi r24, 0x10 ; 16 2f354: 31 f4 brne .+12 ; 0x2f362 2f356: e5 96 adiw r28, 0x35 ; 53 2f358: ff ad ldd r31, Y+63 ; 0x3f 2f35a: e5 97 sbiw r28, 0x35 ; 53 2f35c: ff 23 and r31, r31 2f35e: 09 f4 brne .+2 ; 0x2f362 2f360: 94 c0 rjmp .+296 ; 0x2f48a if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2f362: 90 93 b8 14 sts 0x14B8, r25 ; 0x8014b8 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2f366: 80 31 cpi r24, 0x10 ; 16 2f368: 61 f0 breq .+24 ; 0x2f382 2f36a: 60 96 adiw r28, 0x10 ; 16 2f36c: 8f ad ldd r24, Y+63 ; 0x3f 2f36e: 60 97 sbiw r28, 0x10 ; 16 2f370: 87 34 cpi r24, 0x47 ; 71 2f372: 09 f0 breq .+2 ; 0x2f376 2f374: 13 c1 rjmp .+550 ; 0x2f59c 2f376: 61 96 adiw r28, 0x11 ; 17 2f378: 8f ad ldd r24, Y+63 ; 0x3f 2f37a: 61 97 sbiw r28, 0x11 ; 17 2f37c: 8e 37 cpi r24, 0x7E ; 126 2f37e: 09 f4 brne .+2 ; 0x2f382 2f380: 0d c1 rjmp .+538 ; 0x2f59c switch (lsAction) { 2f382: e5 96 adiw r28, 0x35 ; 53 2f384: ff ad ldd r31, Y+63 ; 0x3f 2f386: e5 97 sbiw r28, 0x35 ; 53 2f388: f1 30 cpi r31, 0x01 ; 1 2f38a: 09 f4 brne .+2 ; 0x2f38e 2f38c: 1b c1 rjmp .+566 ; 0x2f5c4 2f38e: f2 30 cpi r31, 0x02 ; 2 2f390: 09 f4 brne .+2 ; 0x2f394 2f392: 25 c1 rjmp .+586 ; 0x2f5de case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2f394: be 01 movw r22, r28 2f396: 69 5b subi r22, 0xB9 ; 185 2f398: 7f 4f sbci r23, 0xFF ; 255 2f39a: 8e e6 ldi r24, 0x6E ; 110 2f39c: 94 e1 ldi r25, 0x14 ; 20 2f39e: 0e 94 99 78 call 0xf132 ; 0xf132 2f3a2: c4 01 movw r24, r8 2f3a4: 0e 94 37 89 call 0x1126e ; 0x1126e 2f3a8: 8e e6 ldi r24, 0x6E ; 110 2f3aa: 94 e1 ldi r25, 0x14 ; 20 2f3ac: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2f3b0: 80 e2 ldi r24, 0x20 ; 32 2f3b2: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2f3b6: a7 96 adiw r28, 0x27 ; 39 2f3b8: 6c ad ldd r22, Y+60 ; 0x3c 2f3ba: 7d ad ldd r23, Y+61 ; 0x3d 2f3bc: 8e ad ldd r24, Y+62 ; 0x3e 2f3be: 9f ad ldd r25, Y+63 ; 0x3f 2f3c0: a7 97 sbiw r28, 0x27 ; 39 2f3c2: 4a e0 ldi r20, 0x0A ; 10 2f3c4: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2f3c8: 51 fe sbrs r5, 1 2f3ca: 45 c0 rjmp .+138 ; 0x2f456 { crmodDate = p.lastWriteDate; 2f3cc: a1 96 adiw r28, 0x21 ; 33 2f3ce: 2e ad ldd r18, Y+62 ; 0x3e 2f3d0: 3f ad ldd r19, Y+63 ; 0x3f 2f3d2: a1 97 sbiw r28, 0x21 ; 33 2f3d4: 30 93 7e 14 sts 0x147E, r19 ; 0x80147e 2f3d8: 20 93 7d 14 sts 0x147D, r18 ; 0x80147d crmodTime = p.lastWriteTime; 2f3dc: 6f 96 adiw r28, 0x1f ; 31 2f3de: 4e ad ldd r20, Y+62 ; 0x3e 2f3e0: 5f ad ldd r21, Y+63 ; 0x3f 2f3e2: 6f 97 sbiw r28, 0x1f ; 31 2f3e4: 50 93 7c 14 sts 0x147C, r21 ; 0x80147c 2f3e8: 40 93 7b 14 sts 0x147B, r20 ; 0x80147b if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2f3ec: 69 96 adiw r28, 0x19 ; 25 2f3ee: 8e ad ldd r24, Y+62 ; 0x3e 2f3f0: 9f ad ldd r25, Y+63 ; 0x3f 2f3f2: 69 97 sbiw r28, 0x19 ; 25 2f3f4: 28 17 cp r18, r24 2f3f6: 39 07 cpc r19, r25 2f3f8: 50 f0 brcs .+20 ; 0x2f40e 2f3fa: 28 17 cp r18, r24 2f3fc: 39 07 cpc r19, r25 2f3fe: 99 f4 brne .+38 ; 0x2f426 2f400: 67 96 adiw r28, 0x17 ; 23 2f402: 2e ad ldd r18, Y+62 ; 0x3e 2f404: 3f ad ldd r19, Y+63 ; 0x3f 2f406: 67 97 sbiw r28, 0x17 ; 23 2f408: 42 17 cp r20, r18 2f40a: 53 07 cpc r21, r19 2f40c: 60 f4 brcc .+24 ; 0x2f426 crmodDate = p.creationDate; 2f40e: 90 93 7e 14 sts 0x147E, r25 ; 0x80147e 2f412: 80 93 7d 14 sts 0x147D, r24 ; 0x80147d crmodTime = p.creationTime; 2f416: 67 96 adiw r28, 0x17 ; 23 2f418: 8e ad ldd r24, Y+62 ; 0x3e 2f41a: 9f ad ldd r25, Y+63 ; 0x3f 2f41c: 67 97 sbiw r28, 0x17 ; 23 2f41e: 90 93 7c 14 sts 0x147C, r25 ; 0x80147c 2f422: 80 93 7b 14 sts 0x147B, r24 ; 0x80147b } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2f426: 80 91 7e 14 lds r24, 0x147E ; 0x80147e 2f42a: 8f 93 push r24 2f42c: 80 91 7d 14 lds r24, 0x147D ; 0x80147d 2f430: 8f 93 push r24 2f432: 80 91 7c 14 lds r24, 0x147C ; 0x80147c 2f436: 8f 93 push r24 2f438: 80 91 7b 14 lds r24, 0x147B ; 0x80147b 2f43c: 8f 93 push r24 2f43e: 2b e3 ldi r18, 0x3B ; 59 2f440: 39 ea ldi r19, 0xA9 ; 169 2f442: 3f 93 push r19 2f444: 2f 93 push r18 2f446: 0f 94 4b dc call 0x3b896 ; 0x3b896 2f44a: 0f 90 pop r0 2f44c: 0f 90 pop r0 2f44e: 0f 90 pop r0 2f450: 0f 90 pop r0 2f452: 0f 90 pop r0 2f454: 0f 90 pop r0 } if (lsParams.LFN) 2f456: 11 23 and r17, r17 2f458: 99 f0 breq .+38 ; 0x2f480 printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f45a: 80 91 83 14 lds r24, 0x1483 ; 0x801483 2f45e: 88 23 and r24, r24 2f460: 09 f4 brne .+2 ; 0x2f464 2f462: ba c0 rjmp .+372 ; 0x2f5d8 2f464: 83 e8 ldi r24, 0x83 ; 131 2f466: 94 e1 ldi r25, 0x14 ; 20 2f468: 9f 93 push r25 2f46a: 8f 93 push r24 2f46c: e5 e3 ldi r30, 0x35 ; 53 2f46e: f9 ea ldi r31, 0xA9 ; 169 2f470: ff 93 push r31 2f472: ef 93 push r30 2f474: 0f 94 4b dc call 0x3b896 ; 0x3b896 2f478: 0f 90 pop r0 2f47a: 0f 90 pop r0 2f47c: 0f 90 pop r0 2f47e: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2f480: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 manage_heater(); 2f484: 0f 94 98 4e call 0x29d30 ; 0x29d30 2f488: 89 c0 rjmp .+274 ; 0x2f59c } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2f48a: 2d b7 in r18, 0x3d ; 61 2f48c: 3e b7 in r19, 0x3e ; 62 2f48e: e7 96 adiw r28, 0x37 ; 55 2f490: 3f af std Y+63, r19 ; 0x3f 2f492: 2e af std Y+62, r18 ; 0x3e 2f494: 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); 2f496: be 01 movw r22, r28 2f498: 69 5b subi r22, 0xB9 ; 185 2f49a: 7f 4f sbci r23, 0xFF ; 255 2f49c: c5 01 movw r24, r10 2f49e: 0e 94 99 78 call 0xf132 ; 0xf132 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2f4a2: f4 01 movw r30, r8 2f4a4: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2f4a6: 88 23 and r24, r24 2f4a8: 09 f4 brne .+2 ; 0x2f4ac 2f4aa: 86 c0 rjmp .+268 ; 0x2f5b8 2f4ac: 01 90 ld r0, Z+ 2f4ae: 00 20 and r0, r0 2f4b0: e9 f7 brne .-6 ; 0x2f4ac 2f4b2: 31 97 sbiw r30, 0x01 ; 1 2f4b4: e8 19 sub r30, r8 2f4b6: f9 09 sbc r31, r9 2f4b8: d5 01 movw r26, r10 2f4ba: 0d 90 ld r0, X+ 2f4bc: 00 20 and r0, r0 2f4be: e9 f7 brne .-6 ; 0x2f4ba 2f4c0: ea 19 sub r30, r10 2f4c2: fb 09 sbc r31, r11 char path[len]; 2f4c4: ea 0f add r30, r26 2f4c6: fb 1f adc r31, r27 2f4c8: 31 96 adiw r30, 0x01 ; 1 2f4ca: 2d b7 in r18, 0x3d ; 61 2f4cc: 3e b7 in r19, 0x3e ; 62 2f4ce: 2e 1b sub r18, r30 2f4d0: 3f 0b sbc r19, r31 2f4d2: 0f b6 in r0, 0x3f ; 63 2f4d4: f8 94 cli 2f4d6: 3e bf out 0x3e, r19 ; 62 2f4d8: 0f be out 0x3f, r0 ; 63 2f4da: 2d bf out 0x3d, r18 ; 61 2f4dc: ed b7 in r30, 0x3d ; 61 2f4de: fe b7 in r31, 0x3e ; 62 2f4e0: 31 96 adiw r30, 0x01 ; 1 2f4e2: 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 2f4e4: 6e e1 ldi r22, 0x1E ; 30 2f4e6: 73 e0 ldi r23, 0x03 ; 3 2f4e8: 81 11 cpse r24, r1 2f4ea: b4 01 movw r22, r8 2f4ec: c7 01 movw r24, r14 2f4ee: 0f 94 f4 e3 call 0x3c7e8 ; 0x3c7e8 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f4f2: b5 01 movw r22, r10 2f4f4: c7 01 movw r24, r14 2f4f6: 0f 94 d5 e3 call 0x3c7aa ; 0x3c7aa strcat(path, "/"); // 1 character 2f4fa: 6e e1 ldi r22, 0x1E ; 30 2f4fc: 73 e0 ldi r23, 0x03 ; 3 2f4fe: c7 01 movw r24, r14 2f500: 0f 94 d5 e3 call 0x3c7aa ; 0x3c7aa // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f504: 11 23 and r17, r17 2f506: a9 f0 breq .+42 ; 0x2f532 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f508: 80 91 83 14 lds r24, 0x1483 ; 0x801483 2f50c: 81 11 cpse r24, r1 2f50e: 57 c0 rjmp .+174 ; 0x2f5be 2f510: c5 01 movw r24, r10 2f512: 9f 93 push r25 2f514: 8f 93 push r24 2f516: ff 92 push r15 2f518: ef 92 push r14 2f51a: 2a e4 ldi r18, 0x4A ; 74 2f51c: 39 ea ldi r19, 0xA9 ; 169 2f51e: 3f 93 push r19 2f520: 2f 93 push r18 2f522: 0f 94 4b dc call 0x3b896 ; 0x3b896 2f526: 0f 90 pop r0 2f528: 0f 90 pop r0 2f52a: 0f 90 pop r0 2f52c: 0f 90 pop r0 2f52e: 0f 90 pop r0 2f530: 0f 90 pop r0 2f532: 1c a2 std Y+36, r1 ; 0x24 2f534: 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); 2f536: 21 e0 ldi r18, 0x01 ; 1 2f538: a5 01 movw r20, r10 2f53a: b6 01 movw r22, r12 2f53c: ce 01 movw r24, r28 2f53e: 84 96 adiw r24, 0x24 ; 36 2f540: 0f 94 36 d7 call 0x3ae6c ; 0x3ae6c 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); 2f544: 83 e2 ldi r24, 0x23 ; 35 2f546: fe 01 movw r30, r28 2f548: b4 96 adiw r30, 0x24 ; 36 2f54a: de 01 movw r26, r28 2f54c: 11 96 adiw r26, 0x01 ; 1 2f54e: 01 90 ld r0, Z+ 2f550: 0d 92 st X+, r0 2f552: 8a 95 dec r24 2f554: e1 f7 brne .-8 ; 0x2f54e 2f556: 10 fb bst r17, 0 2f558: 50 f8 bld r5, 0 2f55a: 05 2d mov r16, r5 2f55c: 20 e0 ldi r18, 0x00 ; 0 2f55e: 50 e0 ldi r21, 0x00 ; 0 2f560: 40 e0 ldi r20, 0x00 ; 0 2f562: be 01 movw r22, r28 2f564: 6f 5f subi r22, 0xFF ; 255 2f566: 7f 4f sbci r23, 0xFF ; 255 2f568: c7 01 movw r24, r14 2f56a: 0f 94 2b 79 call 0x2f256 ; 0x2f256 2f56e: ce 01 movw r24, r28 2f570: 01 96 adiw r24, 0x01 ; 1 2f572: 0e 94 b4 78 call 0xf168 ; 0xf168 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f576: 11 23 and r17, r17 2f578: 21 f0 breq .+8 ; 0x2f582 puts_P(PSTR("DIR_EXIT")); 2f57a: 81 e4 ldi r24, 0x41 ; 65 2f57c: 99 ea ldi r25, 0xA9 ; 169 2f57e: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 2f582: ce 01 movw r24, r28 2f584: 84 96 adiw r24, 0x24 ; 36 2f586: 0e 94 b4 78 call 0xf168 ; 0xf168 2f58a: e7 96 adiw r28, 0x37 ; 55 2f58c: ee ad ldd r30, Y+62 ; 0x3e 2f58e: ff ad ldd r31, Y+63 ; 0x3f 2f590: e7 97 sbiw r28, 0x37 ; 55 2f592: 0f b6 in r0, 0x3f ; 63 2f594: f8 94 cli 2f596: fe bf out 0x3e, r31 ; 62 2f598: 0f be out 0x3f, r0 ; 63 2f59a: 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()) { 2f59c: f6 01 movw r30, r12 2f59e: 80 85 ldd r24, Z+8 ; 0x08 2f5a0: 91 85 ldd r25, Z+9 ; 0x09 2f5a2: a2 85 ldd r26, Z+10 ; 0x0a 2f5a4: b3 85 ldd r27, Z+11 ; 0x0b 2f5a6: 80 93 7f 14 sts 0x147F, r24 ; 0x80147f 2f5aa: 90 93 80 14 sts 0x1480, r25 ; 0x801480 2f5ae: a0 93 81 14 sts 0x1481, r26 ; 0x801481 2f5b2: b0 93 82 14 sts 0x1482, r27 ; 0x801482 2f5b6: 8c ce rjmp .-744 ; 0x2f2d0 // 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; 2f5b8: e1 e0 ldi r30, 0x01 ; 1 2f5ba: f0 e0 ldi r31, 0x00 ; 0 2f5bc: 7d cf rjmp .-262 ; 0x2f4b8 // 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); 2f5be: 83 e8 ldi r24, 0x83 ; 131 2f5c0: 94 e1 ldi r25, 0x14 ; 20 2f5c2: a7 cf rjmp .-178 ; 0x2f512 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f5c4: 80 91 84 17 lds r24, 0x1784 ; 0x801784 2f5c8: 90 91 85 17 lds r25, 0x1785 ; 0x801785 2f5cc: 01 96 adiw r24, 0x01 ; 1 2f5ce: 90 93 85 17 sts 0x1785, r25 ; 0x801785 2f5d2: 80 93 84 17 sts 0x1784, r24 ; 0x801784 2f5d6: e2 cf rjmp .-60 ; 0x2f59c } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f5d8: 8e e6 ldi r24, 0x6E ; 110 2f5da: 94 e1 ldi r25, 0x14 ; 20 2f5dc: 45 cf rjmp .-374 ; 0x2f468 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f5de: be 01 movw r22, r28 2f5e0: 69 5b subi r22, 0xB9 ; 185 2f5e2: 7f 4f sbci r23, 0xFF ; 255 2f5e4: 8e e6 ldi r24, 0x6E ; 110 2f5e6: 94 e1 ldi r25, 0x14 ; 20 2f5e8: 0e 94 99 78 call 0xf132 ; 0xf132 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f5ec: a1 96 adiw r28, 0x21 ; 33 2f5ee: 2e ad ldd r18, Y+62 ; 0x3e 2f5f0: 3f ad ldd r19, Y+63 ; 0x3f 2f5f2: a1 97 sbiw r28, 0x21 ; 33 2f5f4: 30 93 7e 14 sts 0x147E, r19 ; 0x80147e 2f5f8: 20 93 7d 14 sts 0x147D, r18 ; 0x80147d crmodTime = p.lastWriteTime; 2f5fc: 6f 96 adiw r28, 0x1f ; 31 2f5fe: 4e ad ldd r20, Y+62 ; 0x3e 2f600: 5f ad ldd r21, Y+63 ; 0x3f 2f602: 6f 97 sbiw r28, 0x1f ; 31 2f604: 50 93 7c 14 sts 0x147C, r21 ; 0x80147c 2f608: 40 93 7b 14 sts 0x147B, r20 ; 0x80147b // 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 ) ){ 2f60c: 69 96 adiw r28, 0x19 ; 25 2f60e: 8e ad ldd r24, Y+62 ; 0x3e 2f610: 9f ad ldd r25, Y+63 ; 0x3f 2f612: 69 97 sbiw r28, 0x19 ; 25 2f614: 28 17 cp r18, r24 2f616: 39 07 cpc r19, r25 2f618: 50 f0 brcs .+20 ; 0x2f62e 2f61a: 28 17 cp r18, r24 2f61c: 39 07 cpc r19, r25 2f61e: 99 f4 brne .+38 ; 0x2f646 2f620: 67 96 adiw r28, 0x17 ; 23 2f622: 2e ad ldd r18, Y+62 ; 0x3e 2f624: 3f ad ldd r19, Y+63 ; 0x3f 2f626: 67 97 sbiw r28, 0x17 ; 23 2f628: 42 17 cp r20, r18 2f62a: 53 07 cpc r21, r19 2f62c: 60 f4 brcc .+24 ; 0x2f646 crmodDate = p.creationDate; 2f62e: 90 93 7e 14 sts 0x147E, r25 ; 0x80147e 2f632: 80 93 7d 14 sts 0x147D, r24 ; 0x80147d crmodTime = p.creationTime; 2f636: 67 96 adiw r28, 0x17 ; 23 2f638: 8e ad ldd r24, Y+62 ; 0x3e 2f63a: 9f ad ldd r25, Y+63 ; 0x3f 2f63c: 67 97 sbiw r28, 0x17 ; 23 2f63e: 90 93 7c 14 sts 0x147C, r25 ; 0x80147c 2f642: 80 93 7b 14 sts 0x147B, r24 ; 0x80147b } //writeDate = p.lastAccessDate; if (match != NULL) { 2f646: 61 14 cp r6, r1 2f648: 71 04 cpc r7, r1 2f64a: 59 f1 breq .+86 ; 0x2f6a2 if (strcasecmp(match, filename) == 0) return; 2f64c: 6e e6 ldi r22, 0x6E ; 110 2f64e: 74 e1 ldi r23, 0x14 ; 20 2f650: c3 01 movw r24, r6 2f652: 0f 94 c2 e3 call 0x3c784 ; 0x3c784 2f656: 89 2b or r24, r25 2f658: 59 f5 brne .+86 ; 0x2f6b0 // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f65a: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2f65e: 81 50 subi r24, 0x01 ; 1 2f660: 80 93 78 0e sts 0x0E78, r24 ; 0x800e78 cnt++; break; } } } // while readDir } 2f664: 0f b6 in r0, 0x3f ; 63 2f666: f8 94 cli 2f668: 3e be out 0x3e, r3 ; 62 2f66a: 0f be out 0x3f, r0 ; 63 2f66c: 2d be out 0x3d, r2 ; 61 2f66e: ca 58 subi r28, 0x8A ; 138 2f670: df 4f sbci r29, 0xFF ; 255 2f672: 0f b6 in r0, 0x3f ; 63 2f674: f8 94 cli 2f676: de bf out 0x3e, r29 ; 62 2f678: 0f be out 0x3f, r0 ; 63 2f67a: cd bf out 0x3d, r28 ; 61 2f67c: df 91 pop r29 2f67e: cf 91 pop r28 2f680: 1f 91 pop r17 2f682: 0f 91 pop r16 2f684: ff 90 pop r15 2f686: ef 90 pop r14 2f688: df 90 pop r13 2f68a: cf 90 pop r12 2f68c: bf 90 pop r11 2f68e: af 90 pop r10 2f690: 9f 90 pop r9 2f692: 8f 90 pop r8 2f694: 7f 90 pop r7 2f696: 6f 90 pop r6 2f698: 5f 90 pop r5 2f69a: 4f 90 pop r4 2f69c: 3f 90 pop r3 2f69e: 2f 90 pop r2 2f6a0: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f6a2: 80 91 84 17 lds r24, 0x1784 ; 0x801784 2f6a6: 90 91 85 17 lds r25, 0x1785 ; 0x801785 2f6aa: 48 16 cp r4, r24 2f6ac: 19 06 cpc r1, r25 2f6ae: a9 f2 breq .-86 ; 0x2f65a cnt++; 2f6b0: 43 94 inc r4 2f6b2: 74 cf rjmp .-280 ; 0x2f59c 0002f6b4 : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f6b4: cf 92 push r12 2f6b6: df 92 push r13 2f6b8: ef 92 push r14 2f6ba: ff 92 push r15 2f6bc: 0f 93 push r16 2f6be: cf 93 push r28 2f6c0: df 93 push r29 2f6c2: cd b7 in r28, 0x3d ; 61 2f6c4: de b7 in r29, 0x3e ; 62 2f6c6: a3 97 sbiw r28, 0x23 ; 35 2f6c8: 0f b6 in r0, 0x3f ; 63 2f6ca: f8 94 cli 2f6cc: de bf out 0x3e, r29 ; 62 2f6ce: 0f be out 0x3f, r0 ; 63 2f6d0: cd bf out 0x3d, r28 ; 61 2f6d2: 6c 01 movw r12, r24 { curDir=&workDir; 2f6d4: 85 e1 ldi r24, 0x15 ; 21 2f6d6: e8 2e mov r14, r24 2f6d8: 85 e1 ldi r24, 0x15 ; 21 2f6da: f8 2e mov r15, r24 2f6dc: 87 e1 ldi r24, 0x17 ; 23 2f6de: 95 e1 ldi r25, 0x15 ; 21 2f6e0: d7 01 movw r26, r14 2f6e2: 8d 93 st X+, r24 2f6e4: 9c 93 st X, r25 nrFiles=nr; 2f6e6: 10 92 85 17 sts 0x1785, r1 ; 0x801785 2f6ea: 10 92 84 17 sts 0x1784, r1 ; 0x801784 curDir->rewind(); 2f6ee: 0e 94 af 78 call 0xf15e ; 0xf15e }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f6f2: 00 e0 ldi r16, 0x00 ; 0 2f6f4: 0e 7f andi r16, 0xFE ; 254 2f6f6: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f6f8: d7 01 movw r26, r14 2f6fa: ed 91 ld r30, X+ 2f6fc: fc 91 ld r31, X 2f6fe: 83 e2 ldi r24, 0x23 ; 35 2f700: de 01 movw r26, r28 2f702: 11 96 adiw r26, 0x01 ; 1 2f704: 01 90 ld r0, Z+ 2f706: 0d 92 st X+, r0 2f708: 8a 95 dec r24 2f70a: e1 f7 brne .-8 ; 0x2f704 2f70c: 22 e0 ldi r18, 0x02 ; 2 2f70e: a6 01 movw r20, r12 2f710: be 01 movw r22, r28 2f712: 6f 5f subi r22, 0xFF ; 255 2f714: 7f 4f sbci r23, 0xFF ; 255 2f716: 83 ef ldi r24, 0xF3 ; 243 2f718: 92 e0 ldi r25, 0x02 ; 2 2f71a: 0f 94 2b 79 call 0x2f256 ; 0x2f256 2f71e: ce 01 movw r24, r28 2f720: 01 96 adiw r24, 0x01 ; 1 2f722: 0e 94 b4 78 call 0xf168 ; 0xf168 } 2f726: a3 96 adiw r28, 0x23 ; 35 2f728: 0f b6 in r0, 0x3f ; 63 2f72a: f8 94 cli 2f72c: de bf out 0x3e, r29 ; 62 2f72e: 0f be out 0x3f, r0 ; 63 2f730: cd bf out 0x3d, r28 ; 61 2f732: df 91 pop r29 2f734: cf 91 pop r28 2f736: 0f 91 pop r16 2f738: ff 90 pop r15 2f73a: ef 90 pop r14 2f73c: df 90 pop r13 2f73e: cf 90 pop r12 2f740: 08 95 ret 0002f742 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f742: ef 92 push r14 2f744: ff 92 push r15 2f746: 0f 93 push r16 2f748: cf 93 push r28 2f74a: df 93 push r29 2f74c: cd b7 in r28, 0x3d ; 61 2f74e: de b7 in r29, 0x3e ; 62 2f750: a3 97 sbiw r28, 0x23 ; 35 2f752: 0f b6 in r0, 0x3f ; 63 2f754: f8 94 cli 2f756: de bf out 0x3e, r29 ; 62 2f758: 0f be out 0x3f, r0 ; 63 2f75a: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f75c: 25 e1 ldi r18, 0x15 ; 21 2f75e: e2 2e mov r14, r18 2f760: 25 e1 ldi r18, 0x15 ; 21 2f762: f2 2e mov r15, r18 2f764: 27 e1 ldi r18, 0x17 ; 23 2f766: 35 e1 ldi r19, 0x15 ; 21 2f768: d7 01 movw r26, r14 2f76a: 2d 93 st X+, r18 2f76c: 3c 93 st X, r19 nrFiles = 0; 2f76e: 10 92 85 17 sts 0x1785, r1 ; 0x801785 2f772: 10 92 84 17 sts 0x1784, r1 ; 0x801784 curDir->seekSet((uint32_t)entry << 5); 2f776: b0 e0 ldi r27, 0x00 ; 0 2f778: a0 e0 ldi r26, 0x00 ; 0 2f77a: ac 01 movw r20, r24 2f77c: bd 01 movw r22, r26 2f77e: e5 e0 ldi r30, 0x05 ; 5 2f780: 44 0f add r20, r20 2f782: 55 1f adc r21, r21 2f784: 66 1f adc r22, r22 2f786: 77 1f adc r23, r23 2f788: ea 95 dec r30 2f78a: d1 f7 brne .-12 ; 0x2f780 2f78c: c9 01 movw r24, r18 2f78e: 0f 94 a9 6e call 0x2dd52 ; 0x2dd52 2f792: 00 e0 ldi r16, 0x00 ; 0 2f794: 0e 7f andi r16, 0xFE ; 254 2f796: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f798: d7 01 movw r26, r14 2f79a: ed 91 ld r30, X+ 2f79c: fc 91 ld r31, X 2f79e: 83 e2 ldi r24, 0x23 ; 35 2f7a0: de 01 movw r26, r28 2f7a2: 11 96 adiw r26, 0x01 ; 1 2f7a4: 01 90 ld r0, Z+ 2f7a6: 0d 92 st X+, r0 2f7a8: 8a 95 dec r24 2f7aa: e1 f7 brne .-8 ; 0x2f7a4 2f7ac: 22 e0 ldi r18, 0x02 ; 2 2f7ae: 50 e0 ldi r21, 0x00 ; 0 2f7b0: 40 e0 ldi r20, 0x00 ; 0 2f7b2: be 01 movw r22, r28 2f7b4: 6f 5f subi r22, 0xFF ; 255 2f7b6: 7f 4f sbci r23, 0xFF ; 255 2f7b8: 83 ef ldi r24, 0xF3 ; 243 2f7ba: 92 e0 ldi r25, 0x02 ; 2 2f7bc: 0f 94 2b 79 call 0x2f256 ; 0x2f256 2f7c0: ce 01 movw r24, r28 2f7c2: 01 96 adiw r24, 0x01 ; 1 2f7c4: 0e 94 b4 78 call 0xf168 ; 0xf168 } 2f7c8: a3 96 adiw r28, 0x23 ; 35 2f7ca: 0f b6 in r0, 0x3f ; 63 2f7cc: f8 94 cli 2f7ce: de bf out 0x3e, r29 ; 62 2f7d0: 0f be out 0x3f, r0 ; 63 2f7d2: cd bf out 0x3d, r28 ; 61 2f7d4: df 91 pop r29 2f7d6: cf 91 pop r28 2f7d8: 0f 91 pop r16 2f7da: ff 90 pop r15 2f7dc: ef 90 pop r14 2f7de: 08 95 ret 0002f7e0 : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f7e0: cf 92 push r12 2f7e2: df 92 push r13 2f7e4: ef 92 push r14 2f7e6: ff 92 push r15 2f7e8: 0f 93 push r16 2f7ea: cf 93 push r28 2f7ec: df 93 push r29 2f7ee: cd b7 in r28, 0x3d ; 61 2f7f0: de b7 in r29, 0x3e ; 62 2f7f2: a3 97 sbiw r28, 0x23 ; 35 2f7f4: 0f b6 in r0, 0x3f ; 63 2f7f6: f8 94 cli 2f7f8: de bf out 0x3e, r29 ; 62 2f7fa: 0f be out 0x3f, r0 ; 63 2f7fc: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f7fe: 85 e1 ldi r24, 0x15 ; 21 2f800: c8 2e mov r12, r24 2f802: 85 e1 ldi r24, 0x15 ; 21 2f804: d8 2e mov r13, r24 2f806: 87 e1 ldi r24, 0x17 ; 23 2f808: 95 e1 ldi r25, 0x15 ; 21 2f80a: d6 01 movw r26, r12 2f80c: 8d 93 st X+, r24 2f80e: 9c 93 st X, r25 nrFiles=0; 2f810: 24 e8 ldi r18, 0x84 ; 132 2f812: e2 2e mov r14, r18 2f814: 27 e1 ldi r18, 0x17 ; 23 2f816: f2 2e mov r15, r18 2f818: f7 01 movw r30, r14 2f81a: 11 82 std Z+1, r1 ; 0x01 2f81c: 10 82 st Z, r1 curDir->rewind(); 2f81e: 0e 94 af 78 call 0xf15e ; 0xf15e 2f822: 00 e0 ldi r16, 0x00 ; 0 2f824: 0e 7f andi r16, 0xFE ; 254 2f826: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f828: d6 01 movw r26, r12 2f82a: ed 91 ld r30, X+ 2f82c: fc 91 ld r31, X 2f82e: 83 e2 ldi r24, 0x23 ; 35 2f830: de 01 movw r26, r28 2f832: 11 96 adiw r26, 0x01 ; 1 2f834: 01 90 ld r0, Z+ 2f836: 0d 92 st X+, r0 2f838: 8a 95 dec r24 2f83a: e1 f7 brne .-8 ; 0x2f834 2f83c: 21 e0 ldi r18, 0x01 ; 1 2f83e: 50 e0 ldi r21, 0x00 ; 0 2f840: 40 e0 ldi r20, 0x00 ; 0 2f842: be 01 movw r22, r28 2f844: 6f 5f subi r22, 0xFF ; 255 2f846: 7f 4f sbci r23, 0xFF ; 255 2f848: 83 ef ldi r24, 0xF3 ; 243 2f84a: 92 e0 ldi r25, 0x02 ; 2 2f84c: 0f 94 2b 79 call 0x2f256 ; 0x2f256 2f850: ce 01 movw r24, r28 2f852: 01 96 adiw r24, 0x01 ; 1 2f854: 0e 94 b4 78 call 0xf168 ; 0xf168 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f858: f7 01 movw r30, r14 2f85a: 80 81 ld r24, Z 2f85c: 91 81 ldd r25, Z+1 ; 0x01 2f85e: a3 96 adiw r28, 0x23 ; 35 2f860: 0f b6 in r0, 0x3f ; 63 2f862: f8 94 cli 2f864: de bf out 0x3e, r29 ; 62 2f866: 0f be out 0x3f, r0 ; 63 2f868: cd bf out 0x3d, r28 ; 61 2f86a: df 91 pop r29 2f86c: cf 91 pop r28 2f86e: 0f 91 pop r16 2f870: ff 90 pop r15 2f872: ef 90 pop r14 2f874: df 90 pop r13 2f876: cf 90 pop r12 2f878: 08 95 ret 0002f87a : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f87a: cf 93 push r28 2f87c: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f87e: 8f e2 ldi r24, 0x2F ; 47 2f880: 0e 94 ba 78 call 0xf174 ; 0xf174 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f884: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f886: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f888: 80 91 0c 16 lds r24, 0x160C ; 0x80160c 2f88c: c8 17 cp r28, r24 2f88e: 60 f4 brcc .+24 ; 0x2f8a8 { SERIAL_PROTOCOL(dir_names[i]); 2f890: cd 9f mul r28, r29 2f892: c0 01 movw r24, r0 2f894: 11 24 eor r1, r1 2f896: 84 54 subi r24, 0x44 ; 68 2f898: 9b 4e sbci r25, 0xEB ; 235 2f89a: 0e 94 37 89 call 0x1126e ; 0x1126e 2f89e: 8f e2 ldi r24, 0x2F ; 47 2f8a0: 0e 94 ba 78 call 0xf174 ; 0xf174 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f8a4: cf 5f subi r28, 0xFF ; 255 2f8a6: f0 cf rjmp .-32 ; 0x2f888 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f8a8: 80 91 83 14 lds r24, 0x1483 ; 0x801483 2f8ac: 81 11 cpse r24, r1 2f8ae: 06 c0 rjmp .+12 ; 0x2f8bc 2f8b0: 8e e6 ldi r24, 0x6E ; 110 2f8b2: 94 e1 ldi r25, 0x14 ; 20 } 2f8b4: df 91 pop r29 2f8b6: cf 91 pop r28 2f8b8: 0c 94 37 89 jmp 0x1126e ; 0x1126e for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f8bc: 83 e8 ldi r24, 0x83 ; 131 2f8be: 94 e1 ldi r25, 0x14 ; 20 2f8c0: f9 cf rjmp .-14 ; 0x2f8b4 0002f8c2 : 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) { 2f8c2: cf 92 push r12 2f8c4: df 92 push r13 2f8c6: ef 92 push r14 2f8c8: ff 92 push r15 2f8ca: 6b 01 movw r12, r22 2f8cc: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f8ce: 88 ea ldi r24, 0xA8 ; 168 2f8d0: 9c e0 ldi r25, 0x0C ; 12 2f8d2: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2f8d6: ab 01 movw r20, r22 2f8d8: bc 01 movw r22, r24 2f8da: 4c 0d add r20, r12 2f8dc: 5d 1d adc r21, r13 2f8de: 6e 1d adc r22, r14 2f8e0: 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); 2f8e2: 88 ea ldi r24, 0xA8 ; 168 2f8e4: 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); } 2f8e6: ff 90 pop r15 2f8e8: ef 90 pop r14 2f8ea: df 90 pop r13 2f8ec: 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); 2f8ee: 0d 94 df dd jmp 0x3bbbe ; 0x3bbbe 0002f8f2 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f8f2: cf 93 push r28 2f8f4: df 93 push r29 2f8f6: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f8f8: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (val == EEPROM_EMPTY_VALUE32) { 2f8fc: 6f 3f cpi r22, 0xFF ; 255 2f8fe: 2f ef ldi r18, 0xFF ; 255 2f900: 72 07 cpc r23, r18 2f902: 82 07 cpc r24, r18 2f904: 92 07 cpc r25, r18 2f906: 49 f4 brne .+18 ; 0x2f91a 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); 2f908: 40 e0 ldi r20, 0x00 ; 0 2f90a: 50 e0 ldi r21, 0x00 ; 0 2f90c: ba 01 movw r22, r20 2f90e: ce 01 movw r24, r28 2f910: 0f 94 df dd call 0x3bbbe ; 0x3bbbe 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; 2f914: 60 e0 ldi r22, 0x00 ; 0 2f916: 70 e0 ldi r23, 0x00 ; 0 2f918: cb 01 movw r24, r22 } return val; } 2f91a: df 91 pop r29 2f91c: cf 91 pop r28 2f91e: 08 95 ret 0002f920 : } // 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; 2f920: e4 e0 ldi r30, 0x04 ; 4 2f922: f7 e1 ldi r31, 0x17 ; 23 2f924: 40 81 ld r20, Z 2f926: 51 81 ldd r21, Z+1 ; 0x01 2f928: 62 81 ldd r22, Z+2 ; 0x02 2f92a: 73 81 ldd r23, Z+3 ; 0x03 2f92c: 48 0f add r20, r24 2f92e: 59 1f adc r21, r25 2f930: 61 1d adc r22, r1 2f932: 71 1d adc r23, r1 2f934: 40 83 st Z, r20 2f936: 51 83 std Z+1, r21 ; 0x01 2f938: 62 83 std Z+2, r22 ; 0x02 2f93a: 73 83 std Z+3, r23 ; 0x03 } 2f93c: 08 95 ret 0002f93e : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f93e: 0f 93 push r16 2f940: 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_ ){ 2f942: 60 91 19 17 lds r22, 0x1719 ; 0x801719 2f946: 70 91 1a 17 lds r23, 0x171A ; 0x80171a 2f94a: 80 91 1b 17 lds r24, 0x171B ; 0x80171b 2f94e: 90 91 1c 17 lds r25, 0x171C ; 0x80171c 2f952: 00 91 6d 0e lds r16, 0x0E6D ; 0x800e6d 2f956: 10 91 6e 0e lds r17, 0x0E6E ; 0x800e6e 2f95a: 20 91 6f 0e lds r18, 0x0E6F ; 0x800e6f 2f95e: 30 91 70 0e lds r19, 0x0E70 ; 0x800e70 2f962: 60 17 cp r22, r16 2f964: 71 07 cpc r23, r17 2f966: 82 07 cpc r24, r18 2f968: 93 07 cpc r25, r19 2f96a: 39 f1 breq .+78 ; 0x2f9ba if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f96c: 40 e0 ldi r20, 0x00 ; 0 2f96e: 0f 94 d7 6b call 0x2d7ae ; 0x2d7ae 2f972: 88 23 and r24, r24 2f974: f9 f0 breq .+62 ; 0x2f9b4 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f976: 20 91 1d 17 lds r18, 0x171D ; 0x80171d 2f97a: 30 91 1e 17 lds r19, 0x171E ; 0x80171e 2f97e: 40 91 0d 17 lds r20, 0x170D ; 0x80170d 2f982: 50 91 0e 17 lds r21, 0x170E ; 0x80170e 2f986: 60 91 0f 17 lds r22, 0x170F ; 0x80170f 2f98a: 70 91 10 17 lds r23, 0x1710 ; 0x801710 2f98e: 42 1b sub r20, r18 2f990: 53 0b sbc r21, r19 2f992: 61 09 sbc r22, r1 2f994: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f996: 41 30 cpi r20, 0x01 ; 1 2f998: 92 e0 ldi r25, 0x02 ; 2 2f99a: 59 07 cpc r21, r25 2f99c: 61 05 cpc r22, r1 2f99e: 71 05 cpc r23, r1 2f9a0: 20 f0 brcs .+8 ; 0x2f9aa 2f9a2: 40 e0 ldi r20, 0x00 ; 0 2f9a4: 52 e0 ldi r21, 0x02 ; 2 2f9a6: 60 e0 ldi r22, 0x00 ; 0 2f9a8: 70 e0 ldi r23, 0x00 ; 0 2f9aa: 47 58 subi r20, 0x87 ; 135 2f9ac: 51 4f sbci r21, 0xF1 ; 241 2f9ae: 9a e0 ldi r25, 0x0A ; 10 2f9b0: fa 01 movw r30, r20 2f9b2: 90 83 st Z, r25 } return true; } 2f9b4: 1f 91 pop r17 2f9b6: 0f 91 pop r16 2f9b8: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f9ba: 81 e0 ldi r24, 0x01 ; 1 2f9bc: fb cf rjmp .-10 ; 0x2f9b4 0002f9be : voltReady = true; } uint16_t IR_sensor_analog::getVoltRaw() { uint16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = voltRaw; } 2f9be: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f9c0: f8 94 cli 2f9c2: 80 91 91 17 lds r24, 0x1791 ; 0x801791 2f9c6: 90 91 92 17 lds r25, 0x1792 ; 0x801792 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f9ca: 2f bf out 0x3f, r18 ; 63 return ret; } 2f9cc: 08 95 ret 0002f9ce : const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { 2f9ce: 80 91 8f 17 lds r24, 0x178F ; 0x80178f 2f9d2: 88 23 and r24, r24 2f9d4: 29 f0 breq .+10 ; 0x2f9e0 2f9d6: 81 30 cpi r24, 0x01 ; 1 2f9d8: 39 f0 breq .+14 ; 0x2f9e8 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); 2f9da: 82 e1 ldi r24, 0x12 ; 18 2f9dc: 9d e5 ldi r25, 0x5D ; 93 2f9de: 02 c0 rjmp .+4 ; 0x2f9e4 } const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { case SensorRevision::_Old: return _T(MSG_IR_03_OR_OLDER); 2f9e0: 82 e3 ldi r24, 0x32 ; 50 2f9e2: 9d e5 ldi r25, 0x5D ; 93 case SensorRevision::_Rev04: return _T(MSG_IR_04_OR_NEWER); default: return _T(MSG_IR_UNKNOWN); 2f9e4: 0c 94 59 73 jmp 0xe6b2 ; 0xe6b2 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); 2f9e8: 82 e2 ldi r24, 0x22 ; 34 2f9ea: 9d e5 ldi r25, 0x5D ; 93 2f9ec: fb cf rjmp .-10 ; 0x2f9e4 0002f9ee : void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } } void IR_sensor_analog::IR_ANALOG_Check(SensorRevision isVersion, SensorRevision switchTo) { 2f9ee: cf 93 push r28 bool bTemp = (!CHECK_ALL_HEATERS); 2f9f0: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 2f9f4: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 2f9f8: 23 2b or r18, r19 2f9fa: b9 f4 brne .+46 ; 0x2fa2a 2f9fc: 20 91 69 0e lds r18, 0x0E69 ; 0x800e69 2fa00: 30 91 6a 0e lds r19, 0x0E6A ; 0x800e6a 2fa04: 23 2b or r18, r19 2fa06: 89 f4 brne .+34 ; 0x2fa2a bTemp = bTemp && (menu_menu == lcd_status_screen); 2fa08: 20 91 67 0e lds r18, 0x0E67 ; 0x800e67 2fa0c: 30 91 68 0e lds r19, 0x0E68 ; 0x800e68 2fa10: 2b 53 subi r18, 0x3B ; 59 2fa12: 3a 43 sbci r19, 0x3A ; 58 2fa14: 51 f4 brne .+20 ; 0x2fa2a bTemp = bTemp && ((sensorRevision == isVersion) || (sensorRevision == SensorRevision::_Undef)); 2fa16: 90 91 8f 17 lds r25, 0x178F ; 0x80178f 2fa1a: 98 17 cp r25, r24 2fa1c: 11 f0 breq .+4 ; 0x2fa22 2fa1e: 9f 3f cpi r25, 0xFF ; 255 2fa20: 21 f4 brne .+8 ; 0x2fa2a bTemp = bTemp && (state == State::ready); 2fa22: 80 91 86 17 lds r24, 0x1786 ; 0x801786 2fa26: 82 30 cpi r24, 0x02 ; 2 2fa28: 31 f0 breq .+12 ; 0x2fa36 default: break; } } } else { nFSCheckCount = 0; 2fa2a: 10 92 98 17 sts 0x1798, r1 ; 0x801798 2fa2e: 10 92 97 17 sts 0x1797, r1 ; 0x801797 } } 2fa32: cf 91 pop r28 2fa34: 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++; 2fa36: 80 91 97 17 lds r24, 0x1797 ; 0x801797 2fa3a: 90 91 98 17 lds r25, 0x1798 ; 0x801798 2fa3e: 01 96 adiw r24, 0x01 ; 1 if (nFSCheckCount > FS_CHECK_COUNT) { 2fa40: 85 30 cpi r24, 0x05 ; 5 2fa42: 91 05 cpc r25, r1 2fa44: 28 f4 brcc .+10 ; 0x2fa50 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++; 2fa46: 90 93 98 17 sts 0x1798, r25 ; 0x801798 2fa4a: 80 93 97 17 sts 0x1797, r24 ; 0x801797 2fa4e: f1 cf rjmp .-30 ; 0x2fa32 2fa50: c6 2f mov r28, r22 if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary 2fa52: 10 92 98 17 sts 0x1798, r1 ; 0x801798 2fa56: 10 92 97 17 sts 0x1797, r1 ; 0x801797 return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 2fa5a: 60 93 8f 17 sts 0x178F, r22 ; 0x80178f if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2fa5e: 88 e4 ldi r24, 0x48 ; 72 2fa60: 9d e0 ldi r25, 0x0D ; 13 2fa62: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a if (bTemp) { nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); 2fa66: 0f 94 5f 15 call 0x22abe ; 0x22abe switch (switchTo) { case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); 2fa6a: 82 e3 ldi r24, 0x32 ; 50 2fa6c: 9d e5 ldi r25, 0x5D ; 93 nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); switch (switchTo) { 2fa6e: c1 30 cpi r28, 0x01 ; 1 2fa70: 11 f4 brne .+4 ; 0x2fa76 case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); break; case SensorRevision::_Rev04: lcd_setstatuspgm(_T(MSG_IR_04_OR_NEWER)); 2fa72: 82 e2 ldi r24, 0x22 ; 34 2fa74: 9d e5 ldi r25, 0x5D ; 93 2fa76: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 } } } else { nFSCheckCount = 0; } } 2fa7a: 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)); 2fa7c: 0d 94 e2 0b jmp 0x217c4 ; 0x217c4 0002fa80 : * 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() { 2fa80: 2f 92 push r2 2fa82: 3f 92 push r3 2fa84: 4f 92 push r4 2fa86: 5f 92 push r5 2fa88: 6f 92 push r6 2fa8a: 7f 92 push r7 2fa8c: 8f 92 push r8 2fa8e: 9f 92 push r9 2fa90: af 92 push r10 2fa92: bf 92 push r11 2fa94: cf 92 push r12 2fa96: df 92 push r13 2fa98: ef 92 push r14 2fa9a: ff 92 push r15 2fa9c: 0f 93 push r16 2fa9e: 1f 93 push r17 2faa0: cf 93 push r28 2faa2: df 93 push r29 2faa4: cd b7 in r28, 0x3d ; 61 2faa6: de b7 in r29, 0x3e ; 62 2faa8: ed 97 sbiw r28, 0x3d ; 61 2faaa: 0f b6 in r0, 0x3f ; 63 2faac: f8 94 cli 2faae: de bf out 0x3e, r29 ; 62 2fab0: 0f be out 0x3f, r0 ; 63 2fab2: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2fab4: 10 92 0e 16 sts 0x160E, r1 ; 0x80160e 2fab8: 10 92 0d 16 sts 0x160D, r1 ; 0x80160d lastSortedFilePosition = 0; 2fabc: 10 92 d8 16 sts 0x16D8, r1 ; 0x8016d8 2fac0: 10 92 d7 16 sts 0x16D7, r1 ; 0x8016d7 */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2fac4: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fac8: 80 fd sbrc r24, 0 2faca: ef c0 rjmp .+478 ; 0x2fcaa uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2facc: 89 e0 ldi r24, 0x09 ; 9 2face: 9f e0 ldi r25, 0x0F ; 15 2fad0: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 2fad4: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2fad6: 82 e0 ldi r24, 0x02 ; 2 2fad8: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2fadc: 0f 94 f0 7b call 0x2f7e0 ; 0x2f7e0 2fae0: 6c 01 movw r12, r24 if (fileCnt > 0) { 2fae2: 00 97 sbiw r24, 0x00 ; 0 2fae4: 09 f4 brne .+2 ; 0x2fae8 2fae6: de c0 rjmp .+444 ; 0x2fca4 // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2fae8: 85 36 cpi r24, 0x65 ; 101 2faea: 91 05 cpc r25, r1 2faec: 60 f0 brcs .+24 ; 0x2fb06 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2faee: 32 e0 ldi r19, 0x02 ; 2 2faf0: 33 16 cp r3, r19 2faf2: 31 f0 breq .+12 ; 0x2fb00 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2faf4: 8f eb ldi r24, 0xBF ; 191 2faf6: 9c e5 ldi r25, 0x5C ; 92 2faf8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2fafc: 0f 94 04 36 call 0x26c08 ; 0x26c08 } fileCnt = SDSORT_LIMIT; 2fb00: f4 e6 ldi r31, 0x64 ; 100 2fb02: cf 2e mov r12, r31 2fb04: d1 2c mov r13, r1 } sort_count = fileCnt; 2fb06: d0 92 0e 16 sts 0x160E, r13 ; 0x80160e 2fb0a: c0 92 0d 16 sts 0x160D, r12 ; 0x80160d 2fb0e: 6f e0 ldi r22, 0x0F ; 15 2fb10: 66 2e mov r6, r22 2fb12: 66 e1 ldi r22, 0x16 ; 22 2fb14: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fb16: f1 2c mov r15, r1 2fb18: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fb1a: 77 e1 ldi r23, 0x17 ; 23 2fb1c: a7 2e mov r10, r23 2fb1e: 75 e1 ldi r23, 0x15 ; 21 2fb20: b7 2e mov r11, r23 nrFiles = 1; 2fb22: 88 24 eor r8, r8 2fb24: 83 94 inc r8 2fb26: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2fb28: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fb2c: 80 fd sbrc r24, 0 2fb2e: bd c0 rjmp .+378 ; 0x2fcaa manage_heater(); 2fb30: 0f 94 98 4e call 0x29d30 ; 0x29d30 if (i == 0) 2fb34: e1 14 cp r14, r1 2fb36: f1 04 cpc r15, r1 2fb38: 09 f0 breq .+2 ; 0x2fb3c 2fb3a: d0 c0 rjmp .+416 ; 0x2fcdc getfilename(0); 2fb3c: 90 e0 ldi r25, 0x00 ; 0 2fb3e: 80 e0 ldi r24, 0x00 ; 0 2fb40: 0f 94 5a 7b call 0x2f6b4 ; 0x2f6b4 else getfilename_next(position); sort_entries[i] = position >> 5; 2fb44: 80 91 7f 14 lds r24, 0x147F ; 0x80147f 2fb48: 90 91 80 14 lds r25, 0x1480 ; 0x801480 2fb4c: a0 91 81 14 lds r26, 0x1481 ; 0x801481 2fb50: b0 91 82 14 lds r27, 0x1482 ; 0x801482 2fb54: 55 e0 ldi r21, 0x05 ; 5 2fb56: b6 95 lsr r27 2fb58: a7 95 ror r26 2fb5a: 97 95 ror r25 2fb5c: 87 95 ror r24 2fb5e: 5a 95 dec r21 2fb60: d1 f7 brne .-12 ; 0x2fb56 2fb62: f3 01 movw r30, r6 2fb64: 81 93 st Z+, r24 2fb66: 91 93 st Z+, r25 2fb68: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fb6a: ff ef ldi r31, 0xFF ; 255 2fb6c: ef 1a sub r14, r31 2fb6e: ff 0a sbc r15, r31 2fb70: ce 14 cp r12, r14 2fb72: df 04 cpc r13, r15 2fb74: c9 f6 brne .-78 ; 0x2fb28 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2fb76: 21 e0 ldi r18, 0x01 ; 1 2fb78: e2 16 cp r14, r18 2fb7a: f1 04 cpc r15, r1 2fb7c: 09 f4 brne .+2 ; 0x2fb80 2fb7e: 92 c0 rjmp .+292 ; 0x2fca4 2fb80: 32 e0 ldi r19, 0x02 ; 2 2fb82: 33 16 cp r3, r19 2fb84: 09 f4 brne .+2 ; 0x2fb88 2fb86: 8e c0 rjmp .+284 ; 0x2fca4 #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2fb88: 90 93 d8 16 sts 0x16D8, r25 ; 0x8016d8 2fb8c: 80 93 d7 16 sts 0x16D7, r24 ; 0x8016d7 #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)); 2fb90: 8f ea ldi r24, 0xAF ; 175 2fb92: 9c e5 ldi r25, 0x5C ; 92 2fb94: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 2fb98: ee 9c mul r14, r14 2fb9a: 90 01 movw r18, r0 2fb9c: ef 9c mul r14, r15 2fb9e: 30 0d add r19, r0 2fba0: 30 0d add r19, r0 2fba2: 11 24 eor r1, r1 2fba4: bc 01 movw r22, r24 2fba6: c9 01 movw r24, r18 2fba8: 96 95 lsr r25 2fbaa: 87 95 ror r24 2fbac: 0f 94 6a cd call 0x39ad4 ; 0x39ad4 2fbb0: 31 e1 ldi r19, 0x11 ; 17 2fbb2: a3 2e mov r10, r19 2fbb4: 36 e1 ldi r19, 0x16 ; 22 2fbb6: 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; 2fbb8: 91 2c mov r9, r1 2fbba: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2fbbc: cc 24 eor r12, r12 2fbbe: c3 94 inc r12 2fbc0: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2fbc2: c4 01 movw r24, r8 2fbc4: 0f 94 3b cd call 0x39a76 ; 0x39a76 counter += i; 2fbc8: 8c 0c add r8, r12 2fbca: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2fbcc: f5 01 movw r30, r10 2fbce: 01 90 ld r0, Z+ 2fbd0: f0 81 ld r31, Z 2fbd2: e0 2d mov r30, r0 2fbd4: f9 af std Y+57, r31 ; 0x39 2fbd6: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2fbd8: cf 01 movw r24, r30 2fbda: 0f 94 a1 7b call 0x2f742 ; 0x2f742 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2fbde: 80 91 83 14 lds r24, 0x1483 ; 0x801483 2fbe2: 6e e6 ldi r22, 0x6E ; 110 2fbe4: 74 e1 ldi r23, 0x14 ; 20 2fbe6: 88 23 and r24, r24 2fbe8: 11 f0 breq .+4 ; 0x2fbee 2fbea: 63 e8 ldi r22, 0x83 ; 131 2fbec: 74 e1 ldi r23, 0x14 ; 20 2fbee: ce 01 movw r24, r28 2fbf0: 01 96 adiw r24, 0x01 ; 1 2fbf2: 0f 94 f4 e3 call 0x3c7e8 ; 0x3c7e8 crmod_date_bckp = crmodDate; 2fbf6: 60 90 7d 14 lds r6, 0x147D ; 0x80147d 2fbfa: 70 90 7e 14 lds r7, 0x147E ; 0x80147e crmod_time_bckp = crmodTime; 2fbfe: 20 91 7b 14 lds r18, 0x147B ; 0x80147b 2fc02: 30 91 7c 14 lds r19, 0x147C ; 0x80147c 2fc06: 3b af std Y+59, r19 ; 0x3b 2fc08: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2fc0a: 20 90 b8 14 lds r2, 0x14B8 ; 0x8014b8 2fc0e: bf aa std Y+55, r11 ; 0x37 2fc10: ae aa std Y+54, r10 ; 0x36 2fc12: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2fc14: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fc18: 80 fd sbrc r24, 0 2fc1a: 47 c0 rjmp .+142 ; 0x2fcaa printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2fc1c: 0f 94 98 4e call 0x29d30 ; 0x29d30 const uint16_t o2 = sort_entries[j - 1]; 2fc20: c8 01 movw r24, r16 2fc22: 01 97 sbiw r24, 0x01 ; 1 2fc24: 9d af std Y+61, r25 ; 0x3d 2fc26: 8c af std Y+60, r24 ; 0x3c 2fc28: ee a9 ldd r30, Y+54 ; 0x36 2fc2a: ff a9 ldd r31, Y+55 ; 0x37 2fc2c: 52 90 ld r5, -Z 2fc2e: 42 90 ld r4, -Z 2fc30: ff ab std Y+55, r31 ; 0x37 2fc32: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2fc34: c2 01 movw r24, r4 2fc36: 0f 94 a1 7b call 0x2f742 ; 0x2f742 char *name2 = LONGEST_FILENAME; // use the string in-place 2fc3a: 80 91 83 14 lds r24, 0x1483 ; 0x801483 2fc3e: 6e e6 ldi r22, 0x6E ; 110 2fc40: 74 e1 ldi r23, 0x14 ; 20 2fc42: 88 23 and r24, r24 2fc44: 11 f0 breq .+4 ; 0x2fc4a 2fc46: 63 e8 ldi r22, 0x83 ; 131 2fc48: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2fc4a: 31 10 cpse r3, r1 2fc4c: 8a c0 rjmp .+276 ; 0x2fd62 2fc4e: 80 91 b8 14 lds r24, 0x14B8 ; 0x8014b8 2fc52: 28 12 cpse r2, r24 2fc54: 83 c0 rjmp .+262 ; 0x2fd5c #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fc56: 80 91 7d 14 lds r24, 0x147D ; 0x80147d 2fc5a: 90 91 7e 14 lds r25, 0x147E ; 0x80147e 2fc5e: 68 16 cp r6, r24 2fc60: 79 06 cpc r7, r25 2fc62: 09 f0 breq .+2 ; 0x2fc66 2fc64: 6c c0 rjmp .+216 ; 0x2fd3e 2fc66: 80 91 7b 14 lds r24, 0x147B ; 0x80147b 2fc6a: 90 91 7c 14 lds r25, 0x147C ; 0x80147c 2fc6e: 2a ad ldd r18, Y+58 ; 0x3a 2fc70: 3b ad ldd r19, Y+59 ; 0x3b 2fc72: 82 17 cp r24, r18 2fc74: 93 07 cpc r25, r19 2fc76: 08 f0 brcs .+2 ; 0x2fc7a 2fc78: 66 c0 rjmp .+204 ; 0x2fd46 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2fc7a: 00 0f add r16, r16 2fc7c: 11 1f adc r17, r17 2fc7e: f8 01 movw r30, r16 2fc80: e1 5f subi r30, 0xF1 ; 241 2fc82: f9 4e sbci r31, 0xE9 ; 233 2fc84: 28 ad ldd r18, Y+56 ; 0x38 2fc86: 39 ad ldd r19, Y+57 ; 0x39 2fc88: 31 83 std Z+1, r19 ; 0x01 2fc8a: 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){ 2fc8c: 3f ef ldi r19, 0xFF ; 255 2fc8e: c3 1a sub r12, r19 2fc90: d3 0a sbc r13, r19 2fc92: 82 e0 ldi r24, 0x02 ; 2 2fc94: a8 0e add r10, r24 2fc96: b1 1c adc r11, r1 2fc98: ec 14 cp r14, r12 2fc9a: fd 04 cpc r15, r13 2fc9c: 09 f0 breq .+2 ; 0x2fca0 2fc9e: 91 cf rjmp .-222 ; 0x2fbc2 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2fca0: 0f 94 5c cd call 0x39ab8 ; 0x39ab8 } } KEEPALIVE_STATE(NOT_BUSY); 2fca4: 81 e0 ldi r24, 0x01 ; 1 2fca6: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } 2fcaa: ed 96 adiw r28, 0x3d ; 61 2fcac: 0f b6 in r0, 0x3f ; 63 2fcae: f8 94 cli 2fcb0: de bf out 0x3e, r29 ; 62 2fcb2: 0f be out 0x3f, r0 ; 63 2fcb4: cd bf out 0x3d, r28 ; 61 2fcb6: df 91 pop r29 2fcb8: cf 91 pop r28 2fcba: 1f 91 pop r17 2fcbc: 0f 91 pop r16 2fcbe: ff 90 pop r15 2fcc0: ef 90 pop r14 2fcc2: df 90 pop r13 2fcc4: cf 90 pop r12 2fcc6: bf 90 pop r11 2fcc8: af 90 pop r10 2fcca: 9f 90 pop r9 2fccc: 8f 90 pop r8 2fcce: 7f 90 pop r7 2fcd0: 6f 90 pop r6 2fcd2: 5f 90 pop r5 2fcd4: 4f 90 pop r4 2fcd6: 3f 90 pop r3 2fcd8: 2f 90 pop r2 2fcda: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2fcdc: 40 91 7f 14 lds r20, 0x147F ; 0x80147f 2fce0: 50 91 80 14 lds r21, 0x1480 ; 0x801480 2fce4: 60 91 81 14 lds r22, 0x1481 ; 0x801481 2fce8: 70 91 82 14 lds r23, 0x1482 ; 0x801482 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fcec: b0 92 16 15 sts 0x1516, r11 ; 0x801516 2fcf0: a0 92 15 15 sts 0x1515, r10 ; 0x801515 nrFiles = 1; 2fcf4: 90 92 85 17 sts 0x1785, r9 ; 0x801785 2fcf8: 80 92 84 17 sts 0x1784, r8 ; 0x801784 curDir->seekSet(position); 2fcfc: 87 e1 ldi r24, 0x17 ; 23 2fcfe: 95 e1 ldi r25, 0x15 ; 21 2fd00: 0f 94 a9 6e call 0x2dd52 ; 0x2dd52 2fd04: 1e 7f andi r17, 0xFE ; 254 2fd06: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2fd08: e0 91 15 15 lds r30, 0x1515 ; 0x801515 2fd0c: f0 91 16 15 lds r31, 0x1516 ; 0x801516 2fd10: 83 e2 ldi r24, 0x23 ; 35 2fd12: de 01 movw r26, r28 2fd14: 11 96 adiw r26, 0x01 ; 1 2fd16: 01 90 ld r0, Z+ 2fd18: 0d 92 st X+, r0 2fd1a: 8a 95 dec r24 2fd1c: e1 f7 brne .-8 ; 0x2fd16 2fd1e: 01 2f mov r16, r17 2fd20: 22 e0 ldi r18, 0x02 ; 2 2fd22: 50 e0 ldi r21, 0x00 ; 0 2fd24: 40 e0 ldi r20, 0x00 ; 0 2fd26: be 01 movw r22, r28 2fd28: 6f 5f subi r22, 0xFF ; 255 2fd2a: 7f 4f sbci r23, 0xFF ; 255 2fd2c: 83 ef ldi r24, 0xF3 ; 243 2fd2e: 92 e0 ldi r25, 0x02 ; 2 2fd30: 0f 94 2b 79 call 0x2f256 ; 0x2f256 2fd34: ce 01 movw r24, r28 2fd36: 01 96 adiw r24, 0x01 ; 1 2fd38: 0e 94 b4 78 call 0xf168 ; 0xf168 2fd3c: 03 cf rjmp .-506 ; 0x2fb44 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)) 2fd3e: 86 15 cp r24, r6 2fd40: 97 05 cpc r25, r7 2fd42: 08 f4 brcc .+2 ; 0x2fd46 2fd44: 9a cf rjmp .-204 ; 0x2fc7a break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fd46: ee a9 ldd r30, Y+54 ; 0x36 2fd48: ff a9 ldd r31, Y+55 ; 0x37 2fd4a: 53 82 std Z+3, r5 ; 0x03 2fd4c: 42 82 std Z+2, r4 ; 0x02 2fd4e: 0c ad ldd r16, Y+60 ; 0x3c 2fd50: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2fd52: 01 15 cp r16, r1 2fd54: 11 05 cpc r17, r1 2fd56: 09 f0 breq .+2 ; 0x2fd5a 2fd58: 5d cf rjmp .-326 ; 0x2fc14 2fd5a: 8f cf rjmp .-226 ; 0x2fc7a 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)) 2fd5c: 22 20 and r2, r2 2fd5e: 99 f3 breq .-26 ; 0x2fd46 2fd60: 8c cf rjmp .-232 ; 0x2fc7a 2fd62: 31 e0 ldi r19, 0x01 ; 1 2fd64: 33 12 cpse r3, r19 2fd66: ef cf rjmp .-34 ; 0x2fd46 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fd68: 80 91 b8 14 lds r24, 0x14B8 ; 0x8014b8 2fd6c: 28 12 cpse r2, r24 2fd6e: 07 c0 rjmp .+14 ; 0x2fd7e #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fd70: ce 01 movw r24, r28 2fd72: 01 96 adiw r24, 0x01 ; 1 2fd74: 0f 94 c2 e3 call 0x3c784 ; 0x3c784 2fd78: 97 fd sbrc r25, 7 2fd7a: e5 cf rjmp .-54 ; 0x2fd46 2fd7c: 7e cf rjmp .-260 ; 0x2fc7a 2fd7e: 21 10 cpse r2, r1 2fd80: e2 cf rjmp .-60 ; 0x2fd46 2fd82: 7b cf rjmp .-266 ; 0x2fc7a 0002fd84 : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fd84: cf 92 push r12 2fd86: df 92 push r13 2fd88: ef 92 push r14 2fd8a: ff 92 push r15 2fd8c: 0f 93 push r16 2fd8e: 1f 93 push r17 2fd90: cf 93 push r28 2fd92: df 93 push r29 2fd94: cd b7 in r28, 0x3d ; 61 2fd96: de b7 in r29, 0x3e ; 62 2fd98: a3 97 sbiw r28, 0x23 ; 35 2fd9a: 0f b6 in r0, 0x3f ; 63 2fd9c: f8 94 cli 2fd9e: de bf out 0x3e, r29 ; 62 2fda0: 0f be out 0x3f, r0 ; 63 2fda2: cd bf out 0x3d, r28 ; 61 2fda4: 7c 01 movw r14, r24 2fda6: 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) {} 2fda8: 19 82 std Y+1, r1 ; 0x01 2fdaa: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fdac: 80 91 1a 15 lds r24, 0x151A ; 0x80151a parent=&workDir; 2fdb0: 97 e1 ldi r25, 0x17 ; 23 2fdb2: c9 2e mov r12, r25 2fdb4: 95 e1 ldi r25, 0x15 ; 21 2fdb6: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fdb8: 81 11 cpse r24, r1 2fdba: 04 c0 rjmp .+8 ; 0x2fdc4 } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fdbc: 82 ef ldi r24, 0xF2 ; 242 2fdbe: c8 2e mov r12, r24 2fdc0: 84 e1 ldi r24, 0x14 ; 20 2fdc2: 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); 2fdc4: 21 e0 ldi r18, 0x01 ; 1 2fdc6: a7 01 movw r20, r14 2fdc8: b6 01 movw r22, r12 2fdca: ce 01 movw r24, r28 2fdcc: 01 96 adiw r24, 0x01 ; 1 2fdce: 0f 94 36 d7 call 0x3ae6c ; 0x3ae6c 2fdd2: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2fdd4: 88 23 and r24, r24 2fdd6: 21 f1 breq .+72 ; 0x2fe20 2fdd8: 80 91 0c 16 lds r24, 0x160C ; 0x80160c 2fddc: 85 30 cpi r24, 0x05 ; 5 2fdde: 00 f5 brcc .+64 ; 0x2fe20 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fde0: 29 e0 ldi r18, 0x09 ; 9 2fde2: 82 9f mul r24, r18 2fde4: c0 01 movw r24, r0 2fde6: 11 24 eor r1, r1 2fde8: b7 01 movw r22, r14 2fdea: 84 54 subi r24, 0x44 ; 68 2fdec: 9b 4e sbci r25, 0xEB ; 235 2fdee: 0f 94 f4 e3 call 0x3c7e8 ; 0x3c7e8 puts(relpath); 2fdf2: c7 01 movw r24, r14 2fdf4: 0f 94 18 e4 call 0x3c830 ; 0x3c830 if (workDirDepth < MAX_DIR_DEPTH) { 2fdf8: 80 91 0c 16 lds r24, 0x160C ; 0x80160c 2fdfc: 86 30 cpi r24, 0x06 ; 6 2fdfe: 80 f1 brcs .+96 ; 0x2fe60 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2fe00: 83 e2 ldi r24, 0x23 ; 35 2fe02: fe 01 movw r30, r28 2fe04: 31 96 adiw r30, 0x01 ; 1 2fe06: a7 e1 ldi r26, 0x17 ; 23 2fe08: b5 e1 ldi r27, 0x15 ; 21 2fe0a: 01 90 ld r0, Z+ 2fe0c: 0d 92 st X+, r0 2fe0e: 8a 95 dec r24 2fe10: e1 f7 brne .-8 ; 0x2fe0a #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fe12: 00 23 and r16, r16 2fe14: 09 f4 brne .+2 ; 0x2fe18 2fe16: 4c c0 rjmp .+152 ; 0x2feb0 presort(); 2fe18: 0f 94 40 7d call 0x2fa80 ; 0x2fa80 else presort_flag = true; #endif return 1; 2fe1c: 10 2f mov r17, r16 2fe1e: 0c c0 rjmp .+24 ; 0x2fe38 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2fe20: 82 ee ldi r24, 0xE2 ; 226 2fe22: 99 ea ldi r25, 0xA9 ; 169 2fe24: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2fe28: 82 ed ldi r24, 0xD2 ; 210 2fe2a: 90 e7 ldi r25, 0x70 ; 112 2fe2c: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(relpath); 2fe30: c7 01 movw r24, r14 2fe32: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c return 0; 2fe36: 10 e0 ldi r17, 0x00 ; 0 2fe38: ce 01 movw r24, r28 2fe3a: 01 96 adiw r24, 0x01 ; 1 2fe3c: 0e 94 b4 78 call 0xf168 ; 0xf168 else presort_flag = true; #endif return 1; } } 2fe40: 81 2f mov r24, r17 2fe42: a3 96 adiw r28, 0x23 ; 35 2fe44: 0f b6 in r0, 0x3f ; 63 2fe46: f8 94 cli 2fe48: de bf out 0x3e, r29 ; 62 2fe4a: 0f be out 0x3f, r0 ; 63 2fe4c: cd bf out 0x3d, r28 ; 61 2fe4e: df 91 pop r29 2fe50: cf 91 pop r28 2fe52: 1f 91 pop r17 2fe54: 0f 91 pop r16 2fe56: ff 90 pop r15 2fe58: ef 90 pop r14 2fe5a: df 90 pop r13 2fe5c: cf 90 pop r12 2fe5e: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fe60: 8f 5f subi r24, 0xFF ; 255 2fe62: 80 93 0c 16 sts 0x160C, r24 ; 0x80160c workDirParents[d+1] = workDirParents[d]; 2fe66: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fe68: 81 50 subi r24, 0x01 ; 1 2fe6a: c8 f0 brcs .+50 ; 0x2fe9e workDirParents[d+1] = workDirParents[d]; 2fe6c: 28 2f mov r18, r24 2fe6e: 30 e0 ldi r19, 0x00 ; 0 2fe70: a9 01 movw r20, r18 2fe72: 4f 5f subi r20, 0xFF ; 255 2fe74: 5f 4f sbci r21, 0xFF ; 255 2fe76: 94 9f mul r25, r20 2fe78: d0 01 movw r26, r0 2fe7a: 95 9f mul r25, r21 2fe7c: b0 0d add r27, r0 2fe7e: 11 24 eor r1, r1 2fe80: a6 5c subi r26, 0xC6 ; 198 2fe82: ba 4e sbci r27, 0xEA ; 234 2fe84: 92 9f mul r25, r18 2fe86: f0 01 movw r30, r0 2fe88: 93 9f mul r25, r19 2fe8a: f0 0d add r31, r0 2fe8c: 11 24 eor r1, r1 2fe8e: e6 5c subi r30, 0xC6 ; 198 2fe90: fa 4e sbci r31, 0xEA ; 234 2fe92: 29 2f mov r18, r25 2fe94: 01 90 ld r0, Z+ 2fe96: 0d 92 st X+, r0 2fe98: 2a 95 dec r18 2fe9a: e1 f7 brne .-8 ; 0x2fe94 2fe9c: e5 cf rjmp .-54 ; 0x2fe68 workDirParents[0]=*parent; 2fe9e: 83 e2 ldi r24, 0x23 ; 35 2fea0: f6 01 movw r30, r12 2fea2: aa e3 ldi r26, 0x3A ; 58 2fea4: b5 e1 ldi r27, 0x15 ; 21 2fea6: 01 90 ld r0, Z+ 2fea8: 0d 92 st X+, r0 2feaa: 8a 95 dec r24 2feac: e1 f7 brne .-8 ; 0x2fea6 2feae: a8 cf rjmp .-176 ; 0x2fe00 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2feb0: 81 e0 ldi r24, 0x01 ; 1 2feb2: 80 93 bb 14 sts 0x14BB, r24 ; 0x8014bb 2feb6: c0 cf rjmp .-128 ; 0x2fe38 0002feb8 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2feb8: 93 e2 ldi r25, 0x23 ; 35 2feba: e2 ef ldi r30, 0xF2 ; 242 2febc: f4 e1 ldi r31, 0x14 ; 20 2febe: a7 e1 ldi r26, 0x17 ; 23 2fec0: b5 e1 ldi r27, 0x15 ; 21 2fec2: 01 90 ld r0, Z+ 2fec4: 0d 92 st X+, r0 2fec6: 9a 95 dec r25 2fec8: e1 f7 brne .-8 ; 0x2fec2 workDirDepth = 0; 2feca: 10 92 0c 16 sts 0x160C, r1 ; 0x80160c curDir=&workDir; 2fece: 27 e1 ldi r18, 0x17 ; 23 2fed0: 35 e1 ldi r19, 0x15 ; 21 2fed2: 30 93 16 15 sts 0x1516, r19 ; 0x801516 2fed6: 20 93 15 15 sts 0x1515, r18 ; 0x801515 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2feda: 81 11 cpse r24, r1 presort(); 2fedc: 0d 94 40 7d jmp 0x2fa80 ; 0x2fa80 else presort_flag = true; 2fee0: 81 e0 ldi r24, 0x01 ; 1 2fee2: 80 93 bb 14 sts 0x14BB, r24 ; 0x8014bb #endif } 2fee6: 08 95 ret 0002fee8 : * * @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) 2fee8: 8f 92 push r8 2feea: 9f 92 push r9 2feec: af 92 push r10 2feee: bf 92 push r11 2fef0: cf 92 push r12 2fef2: df 92 push r13 2fef4: ef 92 push r14 2fef6: ff 92 push r15 2fef8: 0f 93 push r16 2fefa: 1f 93 push r17 2fefc: cf 93 push r28 2fefe: df 93 push r29 2ff00: cd b7 in r28, 0x3d ; 61 2ff02: de b7 in r29, 0x3e ; 62 2ff04: 2d 97 sbiw r28, 0x0d ; 13 2ff06: 0f b6 in r0, 0x3f ; 63 2ff08: f8 94 cli 2ff0a: de bf out 0x3e, r29 ; 62 2ff0c: 0f be out 0x3f, r0 ; 63 2ff0e: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2ff10: 22 ef ldi r18, 0xF2 ; 242 2ff12: 34 e1 ldi r19, 0x14 ; 20 2ff14: 30 93 16 15 sts 0x1516, r19 ; 0x801516 2ff18: 20 93 15 15 sts 0x1515, r18 ; 0x801515 if (!fileName) 2ff1c: dc 01 movw r26, r24 2ff1e: ed 91 ld r30, X+ 2ff20: fc 91 ld r31, X 2ff22: 30 97 sbiw r30, 0x00 ; 0 2ff24: a1 f4 brne .+40 ; 0x2ff4e } else //relative path { curDir = &workDir; } return 1; 2ff26: 81 e0 ldi r24, 0x01 ; 1 } 2ff28: 2d 96 adiw r28, 0x0d ; 13 2ff2a: 0f b6 in r0, 0x3f ; 63 2ff2c: f8 94 cli 2ff2e: de bf out 0x3e, r29 ; 62 2ff30: 0f be out 0x3f, r0 ; 63 2ff32: cd bf out 0x3d, r28 ; 61 2ff34: df 91 pop r29 2ff36: cf 91 pop r28 2ff38: 1f 91 pop r17 2ff3a: 0f 91 pop r16 2ff3c: ff 90 pop r15 2ff3e: ef 90 pop r14 2ff40: df 90 pop r13 2ff42: cf 90 pop r12 2ff44: bf 90 pop r11 2ff46: af 90 pop r10 2ff48: 9f 90 pop r9 2ff4a: 8f 90 pop r8 2ff4c: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2ff4e: 20 81 ld r18, Z 2ff50: 2f 32 cpi r18, 0x2F ; 47 2ff52: 09 f0 breq .+2 ; 0x2ff56 2ff54: 47 c0 rjmp .+142 ; 0x2ffe4 2ff56: 6c 01 movw r12, r24 { cdroot(false); 2ff58: 80 e0 ldi r24, 0x00 ; 0 2ff5a: 0f 94 5c 7f call 0x2feb8 ; 0x2feb8 dirname_start = fileName + 1; 2ff5e: f6 01 movw r30, r12 2ff60: 00 81 ld r16, Z 2ff62: 11 81 ldd r17, Z+1 ; 0x01 2ff64: 0f 5f subi r16, 0xFF ; 255 2ff66: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2ff68: 97 e1 ldi r25, 0x17 ; 23 2ff6a: 89 2e mov r8, r25 2ff6c: 95 e1 ldi r25, 0x15 ; 21 2ff6e: 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) 2ff70: d8 01 movw r26, r16 2ff72: 8c 91 ld r24, X 2ff74: 88 23 and r24, r24 2ff76: b9 f2 breq .-82 ; 0x2ff26 { dirname_end = strchr(dirname_start, '/'); 2ff78: 6f e2 ldi r22, 0x2F ; 47 2ff7a: 70 e0 ldi r23, 0x00 ; 0 2ff7c: c8 01 movw r24, r16 2ff7e: 0f 94 e0 e3 call 0x3c7c0 ; 0x3c7c0 2ff82: 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) 2ff84: 00 97 sbiw r24, 0x00 ; 0 2ff86: 51 f1 breq .+84 ; 0x2ffdc 2ff88: 08 17 cp r16, r24 2ff8a: 19 07 cpc r17, r25 2ff8c: 38 f5 brcc .+78 ; 0x2ffdc { 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); 2ff8e: 7c 01 movw r14, r24 2ff90: e0 1a sub r14, r16 2ff92: f1 0a sbc r15, r17 2ff94: bd e0 ldi r27, 0x0D ; 13 2ff96: eb 16 cp r14, r27 2ff98: f1 04 cpc r15, r1 2ff9a: 18 f0 brcs .+6 ; 0x2ffa2 2ff9c: 8c e0 ldi r24, 0x0C ; 12 2ff9e: e8 2e mov r14, r24 2ffa0: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2ffa2: a7 01 movw r20, r14 2ffa4: b8 01 movw r22, r16 2ffa6: ce 01 movw r24, r28 2ffa8: 01 96 adiw r24, 0x01 ; 1 2ffaa: 0f 94 09 e4 call 0x3c812 ; 0x3c812 subdirname[len] = 0; 2ffae: e1 e0 ldi r30, 0x01 ; 1 2ffb0: f0 e0 ldi r31, 0x00 ; 0 2ffb2: ec 0f add r30, r28 2ffb4: fd 1f adc r31, r29 2ffb6: ee 0d add r30, r14 2ffb8: ff 1d adc r31, r15 2ffba: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2ffbc: 60 e0 ldi r22, 0x00 ; 0 2ffbe: ce 01 movw r24, r28 2ffc0: 01 96 adiw r24, 0x01 ; 1 2ffc2: 0f 94 c2 7e call 0x2fd84 ; 0x2fd84 2ffc6: 88 23 and r24, r24 2ffc8: 09 f4 brne .+2 ; 0x2ffcc 2ffca: ae cf rjmp .-164 ; 0x2ff28 return 0; curDir = &workDir; 2ffcc: 90 92 16 15 sts 0x1516, r9 ; 0x801516 2ffd0: 80 92 15 15 sts 0x1515, r8 ; 0x801515 dirname_start = dirname_end + 1; 2ffd4: 85 01 movw r16, r10 2ffd6: 0f 5f subi r16, 0xFF ; 255 2ffd8: 1f 4f sbci r17, 0xFF ; 255 2ffda: ca cf rjmp .-108 ; 0x2ff70 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2ffdc: f6 01 movw r30, r12 2ffde: 11 83 std Z+1, r17 ; 0x01 2ffe0: 00 83 st Z, r16 2ffe2: a1 cf rjmp .-190 ; 0x2ff26 } } else //relative path { curDir = &workDir; 2ffe4: 87 e1 ldi r24, 0x17 ; 23 2ffe6: 95 e1 ldi r25, 0x15 ; 21 2ffe8: 90 93 16 15 sts 0x1516, r25 ; 0x801516 2ffec: 80 93 15 15 sts 0x1515, r24 ; 0x801515 2fff0: 9a cf rjmp .-204 ; 0x2ff26 0002fff2 : 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*/){ 2fff2: bf 92 push r11 2fff4: cf 92 push r12 2fff6: df 92 push r13 2fff8: ef 92 push r14 2fffa: ff 92 push r15 2fffc: 0f 93 push r16 2fffe: 1f 93 push r17 30000: cf 93 push r28 30002: df 93 push r29 30004: 1f 92 push r1 30006: 1f 92 push r1 30008: cd b7 in r28, 0x3d ; 61 3000a: de b7 in r29, 0x3e ; 62 if(!mounted) 3000c: 20 91 6d 14 lds r18, 0x146D ; 0x80146d 30010: 22 23 and r18, r18 30012: 09 f4 brne .+2 ; 0x30016 30014: ef c0 rjmp .+478 ; 0x301f4 30016: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30018: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 3001c: 88 23 and r24, r24 3001e: 09 f4 brne .+2 ; 0x30022 30020: 04 c1 rjmp .+520 ; 0x3022a if(!replace_current){ 30022: 61 11 cpse r22, r1 30024: f6 c0 rjmp .+492 ; 0x30212 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 30026: d0 90 1f 17 lds r13, 0x171F ; 0x80171f 3002a: dd 20 and r13, r13 3002c: 21 f0 breq .+8 ; 0x30036 // 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); 3002e: 80 e0 ldi r24, 0x00 ; 0 30030: 99 ea ldi r25, 0xA9 ; 169 30032: 0e 94 8d 7b call 0xf71a ; 0xf71a return; } SERIAL_ECHO_START; 30036: 82 ee ldi r24, 0xE2 ; 226 30038: 99 ea ldi r25, 0xA9 ; 169 3003a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(ofSubroutineCallTgt); 3003e: 87 ee ldi r24, 0xE7 ; 231 30040: 98 ea ldi r25, 0xA8 ; 168 30042: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 30046: c7 01 movw r24, r14 30048: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 3004c: 8c ed ldi r24, 0xDC ; 220 3004e: 98 ea ldi r25, 0xA8 ; 168 30050: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 30054: 00 91 1f 17 lds r16, 0x171F ; 0x80171f 30058: 25 e5 ldi r18, 0x55 ; 85 3005a: 02 9f mul r16, r18 3005c: 80 01 movw r16, r0 3005e: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 30060: 0c 5d subi r16, 0xDC ; 220 30062: 18 4e sbci r17, 0xE8 ; 232 30064: 8f e2 ldi r24, 0x2F ; 47 30066: f8 01 movw r30, r16 30068: 81 93 st Z+, r24 3006a: 8f 01 movw r16, r30 3006c: cc 24 eor r12, r12 3006e: c3 94 inc r12 for(uint8_t i=0;i 30078: d8 16 cp r13, r24 3007a: b0 f4 brcc .+44 ; 0x300a8 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 3007c: db 9c mul r13, r11 3007e: c0 01 movw r24, r0 30080: 11 24 eor r1, r1 30082: b8 01 movw r22, r16 30084: 86 5c subi r24, 0xC6 ; 198 30086: 9a 4e sbci r25, 0xEA ; 234 30088: 0f 94 8f a4 call 0x3491e ; 0x3491e 3008c: c8 01 movw r24, r16 3008e: 8c 01 movw r16, r24 30090: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 30092: f8 01 movw r30, r16 30094: 20 81 ld r18, Z 30096: 22 23 and r18, r18 30098: 29 f0 breq .+10 ; 0x300a4 3009a: f4 e5 ldi r31, 0x54 ; 84 3009c: fc 15 cp r31, r12 3009e: 10 f0 brcs .+4 ; 0x300a4 {t++;cnt++;} //crawl counter forward. 300a0: c3 94 inc r12 300a2: f5 cf rjmp .-22 ; 0x3008e 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) 300a8: 27 e4 ldi r18, 0x47 ; 71 300aa: 2c 15 cp r18, r12 300ac: 08 f4 brcc .+2 ; 0x300b0 300ae: ae c0 rjmp .+348 ; 0x3020c file.getFilename(t); 300b0: b8 01 movw r22, r16 300b2: 8c ef ldi r24, 0xFC ; 252 300b4: 96 e1 ldi r25, 0x16 ; 22 300b6: 0f 94 8f a4 call 0x3491e ; 0x3491e SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 300ba: 80 91 1f 17 lds r24, 0x171F ; 0x80171f 300be: f5 e5 ldi r31, 0x55 ; 85 300c0: 8f 9f mul r24, r31 300c2: c0 01 movw r24, r0 300c4: 11 24 eor r1, r1 300c6: 8c 5d subi r24, 0xDC ; 220 300c8: 98 4e sbci r25, 0xE8 ; 232 300ca: 0e 94 37 89 call 0x1126e ; 0x1126e SERIAL_ECHORPGM(ofPos); 300ce: 86 ed ldi r24, 0xD6 ; 214 300d0: 98 ea ldi r25, 0xA8 ; 168 300d2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 300d6: 60 91 80 17 lds r22, 0x1780 ; 0x801780 300da: 70 91 81 17 lds r23, 0x1781 ; 0x801781 300de: 80 91 82 17 lds r24, 0x1782 ; 0x801782 300e2: 90 91 83 17 lds r25, 0x1783 ; 0x801783 300e6: 4a e0 ldi r20, 0x0A ; 10 300e8: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 300ec: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 300f0: 80 91 1f 17 lds r24, 0x171F ; 0x80171f 300f4: 24 e0 ldi r18, 0x04 ; 4 300f6: 82 9f mul r24, r18 300f8: f0 01 movw r30, r0 300fa: 11 24 eor r1, r1 300fc: e0 5e subi r30, 0xE0 ; 224 300fe: f8 4e sbci r31, 0xE8 ; 232 30100: 40 91 80 17 lds r20, 0x1780 ; 0x801780 30104: 50 91 81 17 lds r21, 0x1781 ; 0x801781 30108: 60 91 82 17 lds r22, 0x1782 ; 0x801782 3010c: 70 91 83 17 lds r23, 0x1783 ; 0x801783 30110: 40 83 st Z, r20 30112: 51 83 std Z+1, r21 ; 0x01 30114: 62 83 std Z+2, r22 ; 0x02 30116: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 30118: 8f 5f subi r24, 0xFF ; 255 3011a: 80 93 1f 17 sts 0x171F, r24 ; 0x80171f } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 3011e: 8c ef ldi r24, 0xFC ; 252 30120: 96 e1 ldi r25, 0x16 ; 22 30122: 0f 94 6c a4 call 0x348d8 ; 0x348d8 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; 30126: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c const char *fname=name; 3012a: fa 82 std Y+2, r15 ; 0x02 3012c: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 3012e: ce 01 movw r24, r28 30130: 01 96 adiw r24, 0x01 ; 1 30132: 0f 94 74 7f call 0x2fee8 ; 0x2fee8 30136: 88 23 and r24, r24 30138: 09 f4 brne .+2 ; 0x3013c 3013a: 5c c0 rjmp .+184 ; 0x301f4 */ 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) ){ 3013c: 49 81 ldd r20, Y+1 ; 0x01 3013e: 5a 81 ldd r21, Y+2 ; 0x02 30140: 60 91 15 15 lds r22, 0x1515 ; 0x801515 30144: 70 91 16 15 lds r23, 0x1516 ; 0x801516 30148: 21 e0 ldi r18, 0x01 ; 1 3014a: 8c ef ldi r24, 0xFC ; 252 3014c: 96 e1 ldi r25, 0x16 ; 22 3014e: 0f 94 36 d7 call 0x3ae6c ; 0x3ae6c 30152: 88 23 and r24, r24 30154: 09 f4 brne .+2 ; 0x30158 30156: 77 c0 rjmp .+238 ; 0x30246 // compute the block to start with if( ! gfComputeNextFileBlock() ) 30158: 8c ef ldi r24, 0xFC ; 252 3015a: 96 e1 ldi r25, 0x16 ; 22 3015c: 0f 94 93 6d call 0x2db26 ; 0x2db26 30160: 88 23 and r24, r24 30162: 09 f4 brne .+2 ; 0x30166 30164: 70 c0 rjmp .+224 ; 0x30246 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; 30166: 80 91 1d 17 lds r24, 0x171D ; 0x80171d 3016a: 90 91 1e 17 lds r25, 0x171E ; 0x80171e 3016e: 87 58 subi r24, 0x87 ; 135 30170: 91 4f sbci r25, 0xF1 ; 241 30172: 90 93 18 17 sts 0x1718, r25 ; 0x801718 30176: 80 93 17 17 sts 0x1717, r24 ; 0x801717 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 3017a: 89 81 ldd r24, Y+1 ; 0x01 3017c: 9a 81 ldd r25, Y+2 ; 0x02 3017e: 0f 94 5a 7b call 0x2f6b4 ; 0x2f6b4 filesize = file.fileSize(); 30182: 80 91 0d 17 lds r24, 0x170D ; 0x80170d 30186: 90 91 0e 17 lds r25, 0x170E ; 0x80170e 3018a: a0 91 0f 17 lds r26, 0x170F ; 0x80170f 3018e: b0 91 10 17 lds r27, 0x1710 ; 0x801710 30192: 80 93 79 17 sts 0x1779, r24 ; 0x801779 30196: 90 93 7a 17 sts 0x177A, r25 ; 0x80177a 3019a: a0 93 7b 17 sts 0x177B, r26 ; 0x80177b 3019e: b0 93 7c 17 sts 0x177C, r27 ; 0x80177c SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 301a2: 86 ea ldi r24, 0xA6 ; 166 301a4: 98 ea ldi r25, 0xA8 ; 168 301a6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 printAbsFilenameFast(); 301aa: 0f 94 3d 7c call 0x2f87a ; 0x2f87a SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 301ae: 8e e9 ldi r24, 0x9E ; 158 301b0: 98 ea ldi r25, 0xA8 ; 168 301b2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 301b6: 60 91 79 17 lds r22, 0x1779 ; 0x801779 301ba: 70 91 7a 17 lds r23, 0x177A ; 0x80177a 301be: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 301c2: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 301c6: 4a e0 ldi r20, 0x0A ; 10 301c8: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 301cc: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 301d0: 10 92 80 17 sts 0x1780, r1 ; 0x801780 301d4: 10 92 81 17 sts 0x1781, r1 ; 0x801781 301d8: 10 92 82 17 sts 0x1782, r1 ; 0x801782 301dc: 10 92 83 17 sts 0x1783, r1 ; 0x801783 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 301e0: 80 e9 ldi r24, 0x90 ; 144 301e2: 98 ea ldi r25, 0xA8 ; 168 301e4: 0e 94 fe 7a call 0xf5fc ; 0xf5fc lcd_setstatuspgm(ofFileSelected); 301e8: 80 e9 ldi r24, 0x90 ; 144 301ea: 98 ea ldi r25, 0xA8 ; 168 301ec: 0f 94 e2 0b call 0x217c4 ; 0x217c4 scrollstuff = 0; 301f0: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 301f4: 0f 90 pop r0 301f6: 0f 90 pop r0 301f8: df 91 pop r29 301fa: cf 91 pop r28 301fc: 1f 91 pop r17 301fe: 0f 91 pop r16 30200: ff 90 pop r15 30202: ef 90 pop r14 30204: df 90 pop r13 30206: cf 90 pop r12 30208: bf 90 pop r11 3020a: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 3020c: f8 01 movw r30, r16 3020e: 10 82 st Z, r1 30210: 54 cf rjmp .-344 ; 0x300ba SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 30212: 82 ee ldi r24, 0xE2 ; 226 30214: 99 ea ldi r25, 0xA9 ; 169 30216: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(ofNowDoingFile); 3021a: 85 ec ldi r24, 0xC5 ; 197 3021c: 98 ea ldi r25, 0xA8 ; 168 3021e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(name); 30222: c7 01 movw r24, r14 30224: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c 30228: 7a cf rjmp .-268 ; 0x3011e } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 3022a: 10 92 1f 17 sts 0x171F, r1 ; 0x80171f SERIAL_ECHO_START; 3022e: 82 ee ldi r24, 0xE2 ; 226 30230: 99 ea ldi r25, 0xA9 ; 169 30232: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(ofNowFreshFile); 30236: 84 eb ldi r24, 0xB4 ; 180 30238: 98 ea ldi r25, 0xA8 ; 168 3023a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(name); 3023e: c7 01 movw r24, r14 30240: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c 30244: 70 cf rjmp .-288 ; 0x30126 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30246: 8e eb ldi r24, 0xBE ; 190 30248: 90 e7 ldi r25, 0x70 ; 112 3024a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 3024e: 89 81 ldd r24, Y+1 ; 0x01 30250: 9a 81 ldd r25, Y+2 ; 0x02 30252: 0e 94 37 89 call 0x1126e ; 0x1126e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 30256: 8e e2 ldi r24, 0x2E ; 46 30258: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 3025c: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 30260: c9 cf rjmp .-110 ; 0x301f4 00030262 : void CardReader::printingHasFinished() { st_synchronize(); 30262: 0f 94 24 59 call 0x2b248 ; 0x2b248 file.close(); 30266: 8c ef ldi r24, 0xFC ; 252 30268: 96 e1 ldi r25, 0x16 ; 22 3026a: 0f 94 6c a4 call 0x348d8 ; 0x348d8 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 3026e: 80 91 1f 17 lds r24, 0x171F ; 0x80171f 30272: 88 23 and r24, r24 30274: 69 f1 breq .+90 ; 0x302d0 { file_subcall_ctr--; 30276: 81 50 subi r24, 0x01 ; 1 30278: 80 93 1f 17 sts 0x171F, r24 ; 0x80171f openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 3027c: 25 e5 ldi r18, 0x55 ; 85 3027e: 82 9f mul r24, r18 30280: c0 01 movw r24, r0 30282: 11 24 eor r1, r1 30284: 61 e0 ldi r22, 0x01 ; 1 30286: 8c 5d subi r24, 0xDC ; 220 30288: 98 4e sbci r25, 0xE8 ; 232 3028a: 0f 94 f9 7f call 0x2fff2 ; 0x2fff2 setIndex(filespos[file_subcall_ctr]); 3028e: e0 91 1f 17 lds r30, 0x171F ; 0x80171f 30292: 84 e0 ldi r24, 0x04 ; 4 30294: e8 9f mul r30, r24 30296: f0 01 movw r30, r0 30298: 11 24 eor r1, r1 3029a: e0 5e subi r30, 0xE0 ; 224 3029c: f8 4e sbci r31, 0xE8 ; 232 3029e: 60 81 ld r22, Z 302a0: 71 81 ldd r23, Z+1 ; 0x01 302a2: 82 81 ldd r24, Z+2 ; 0x02 302a4: 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);}; 302a6: 60 93 80 17 sts 0x1780, r22 ; 0x801780 302aa: 70 93 81 17 sts 0x1781, r23 ; 0x801781 302ae: 80 93 82 17 sts 0x1782, r24 ; 0x801782 302b2: 90 93 83 17 sts 0x1783, r25 ; 0x801783 302b6: 0f 94 b8 77 call 0x2ef70 ; 0x2ef70 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 302ba: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 302be: 88 23 and r24, r24 302c0: 71 f0 breq .+28 ; 0x302de { sdprinting = true; 302c2: 81 e0 ldi r24, 0x01 ; 1 302c4: 80 93 6c 14 sts 0x146C, r24 ; 0x80146c 302c8: 85 e0 ldi r24, 0x05 ; 5 302ca: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> 302ce: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 302d0: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c 302d4: 83 e0 ldi r24, 0x03 ; 3 302d6: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 302da: 0c 94 8b 83 jmp 0x10716 ; 0x10716 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 302de: 08 95 ret 000302e0 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 302e0: cf 92 push r12 302e2: df 92 push r13 302e4: ef 92 push r14 302e6: ff 92 push r15 302e8: 0f 93 push r16 302ea: 1f 93 push r17 302ec: cf 93 push r28 302ee: df 93 push r29 302f0: 08 2f mov r16, r24 { mounted = false; 302f2: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d if(root.isOpen()) 302f6: 80 91 f5 14 lds r24, 0x14F5 ; 0x8014f5 302fa: 88 23 and r24, r24 302fc: 21 f0 breq .+8 ; 0x30306 root.close(); 302fe: 82 ef ldi r24, 0xF2 ; 242 30300: 94 e1 ldi r25, 0x14 ; 20 30302: 0f 94 6c a4 call 0x348d8 ; 0x348d8 * \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; 30306: 10 92 dc 16 sts 0x16DC, r1 ; 0x8016dc 3030a: 10 92 d9 16 sts 0x16D9, r1 ; 0x8016d9 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 3030e: 0f 94 83 3f call 0x27f06 ; 0x27f06 30312: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 30314: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 SET_OUTPUT(SDSS); 30318: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 3031c: 80 64 ori r24, 0x40 ; 64 3031e: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 30322: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 30324: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 30326: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 30328: 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); 3032a: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 3032c: 85 e0 ldi r24, 0x05 ; 5 3032e: 80 93 da 16 sts 0x16DA, r24 ; 0x8016da * 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); 30332: 82 e5 ldi r24, 0x52 ; 82 30334: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 30336: 1d bc out 0x2d, r1 ; 45 30338: 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); 3033a: 8f ef ldi r24, 0xFF ; 255 3033c: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 30340: 11 50 subi r17, 0x01 ; 1 30342: d9 f7 brne .-10 ; 0x3033a WRITE(MISO, 1); // temporarily enable the MISO line pullup 30344: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 30346: 20 e0 ldi r18, 0x00 ; 0 30348: 30 e0 ldi r19, 0x00 ; 0 3034a: a9 01 movw r20, r18 3034c: 60 e0 ldi r22, 0x00 ; 0 3034e: 89 ed ldi r24, 0xD9 ; 217 30350: 96 e1 ldi r25, 0x16 ; 22 30352: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 30356: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 3035a: 81 30 cpi r24, 0x01 ; 1 3035c: 61 f0 breq .+24 ; 0x30376 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 3035e: 0f 94 83 3f call 0x27f06 ; 0x27f06 30362: 6c 1b sub r22, r28 30364: 7d 0b sbc r23, r29 30366: 61 3d cpi r22, 0xD1 ; 209 30368: 77 40 sbci r23, 0x07 ; 7 3036a: 68 f3 brcs .-38 ; 0x30346 WRITE(MISO, 0); // disable the MISO line pullup 3036c: 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;} 3036e: 81 e0 ldi r24, 0x01 ; 1 30370: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 30374: 22 c0 rjmp .+68 ; 0x303ba error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 30376: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 30378: 0f 94 83 3f call 0x27f06 ; 0x27f06 3037c: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 3037e: 83 e8 ldi r24, 0x83 ; 131 30380: 98 ea ldi r25, 0xA8 ; 168 30382: 0e 94 fe 7a call 0xf5fc ; 0xf5fc spiSend(0XFF); 30386: 8f ef ldi r24, 0xFF ; 255 30388: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 while ((status_ = spiRec()) != 0xFF) 3038c: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 30390: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 30394: 8f 3f cpi r24, 0xFF ; 255 30396: 59 f1 breq .+86 ; 0x303ee { spiSend(0XFF); 30398: 8f ef ldi r24, 0xFF ; 255 3039a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 3039e: 0f 94 83 3f call 0x27f06 ; 0x27f06 303a2: 6c 1b sub r22, r28 303a4: 7d 0b sbc r23, r29 303a6: 62 32 cpi r22, 0x22 ; 34 303a8: 71 05 cpc r23, r1 303aa: 80 f3 brcs .-32 ; 0x3038c 303ac: 82 e0 ldi r24, 0x02 ; 2 303ae: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 303b2: 82 e7 ldi r24, 0x72 ; 114 303b4: 98 ea ldi r25, 0xA8 ; 168 303b6: 0e 94 fe 7a call 0xf5fc ; 0xf5fc #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 303ba: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 303be: 82 ee ldi r24, 0xE2 ; 226 303c0: 99 ea ldi r25, 0xA9 ; 169 303c2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 303c6: 81 eb ldi r24, 0xB1 ; 177 303c8: 90 e7 ldi r25, 0x70 ; 112 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 303ca: 0e 94 fe 7a call 0xf5fc ; 0xf5fc } if (mounted) 303ce: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 303d2: 88 23 and r24, r24 303d4: 09 f4 brne .+2 ; 0x303d8 303d6: 9a c0 rjmp .+308 ; 0x3050c { cdroot(doPresort); 303d8: 80 2f mov r24, r16 } } 303da: df 91 pop r29 303dc: cf 91 pop r28 303de: 1f 91 pop r17 303e0: 0f 91 pop r16 303e2: ff 90 pop r15 303e4: ef 90 pop r14 303e6: df 90 pop r13 303e8: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 303ea: 0d 94 5c 7f jmp 0x2feb8 ; 0x2feb8 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 303ee: 2a ea ldi r18, 0xAA ; 170 303f0: 31 e0 ldi r19, 0x01 ; 1 303f2: 40 e0 ldi r20, 0x00 ; 0 303f4: 50 e0 ldi r21, 0x00 ; 0 303f6: 68 e0 ldi r22, 0x08 ; 8 303f8: 89 ed ldi r24, 0xD9 ; 217 303fa: 96 e1 ldi r25, 0x16 ; 22 303fc: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 30400: 82 ff sbrs r24, 2 30402: 2b c0 rjmp .+86 ; 0x3045a 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;} 30404: 81 e0 ldi r24, 0x01 ; 1 30406: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 3040a: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 3040e: c1 2c mov r12, r1 30410: d1 2c mov r13, r1 30412: 76 01 movw r14, r12 30414: 82 30 cpi r24, 0x02 ; 2 30416: 29 f4 brne .+10 ; 0x30422 30418: c1 2c mov r12, r1 3041a: d1 2c mov r13, r1 3041c: e1 2c mov r14, r1 3041e: 80 e4 ldi r24, 0x40 ; 64 30420: 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); 30422: 20 e0 ldi r18, 0x00 ; 0 30424: 30 e0 ldi r19, 0x00 ; 0 30426: a9 01 movw r20, r18 30428: 67 e3 ldi r22, 0x37 ; 55 3042a: 89 ed ldi r24, 0xD9 ; 217 3042c: 96 e1 ldi r25, 0x16 ; 22 3042e: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 return cardCommand(cmd, arg); 30432: a7 01 movw r20, r14 30434: 96 01 movw r18, r12 30436: 69 e2 ldi r22, 0x29 ; 41 30438: 89 ed ldi r24, 0xD9 ; 217 3043a: 96 e1 ldi r25, 0x16 ; 22 3043c: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 30440: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 30444: 88 23 and r24, r24 30446: b1 f0 breq .+44 ; 0x30474 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30448: 0f 94 83 3f call 0x27f06 ; 0x27f06 3044c: 6c 1b sub r22, r28 3044e: 7d 0b sbc r23, r29 30450: 61 3d cpi r22, 0xD1 ; 209 30452: 77 40 sbci r23, 0x07 ; 7 30454: 30 f3 brcs .-52 ; 0x30422 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30456: 8a e0 ldi r24, 0x0A ; 10 30458: 8b cf rjmp .-234 ; 0x30370 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 3045a: 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(); 3045c: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 30460: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 30464: 11 50 subi r17, 0x01 ; 1 30466: d1 f7 brne .-12 ; 0x3045c if (status_ != 0XAA) { 30468: 8a 3a cpi r24, 0xAA ; 170 3046a: 11 f0 breq .+4 ; 0x30470 3046c: 82 e0 ldi r24, 0x02 ; 2 3046e: 80 cf rjmp .-256 ; 0x30370 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;} 30470: 82 e0 ldi r24, 0x02 ; 2 30472: c9 cf rjmp .-110 ; 0x30406 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 30474: 80 91 dc 16 lds r24, 0x16DC ; 0x8016dc 30478: 82 30 cpi r24, 0x02 ; 2 3047a: d1 f4 brne .+52 ; 0x304b0 if (cardCommand(CMD58, 0)) { 3047c: 20 e0 ldi r18, 0x00 ; 0 3047e: 30 e0 ldi r19, 0x00 ; 0 30480: a9 01 movw r20, r18 30482: 6a e3 ldi r22, 0x3A ; 58 30484: 89 ed ldi r24, 0xD9 ; 217 30486: 96 e1 ldi r25, 0x16 ; 22 30488: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 3048c: 88 23 and r24, r24 3048e: 11 f0 breq .+4 ; 0x30494 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30490: 88 e0 ldi r24, 0x08 ; 8 30492: 6e cf rjmp .-292 ; 0x30370 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 30494: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 30498: 80 7c andi r24, 0xC0 ; 192 3049a: 80 3c cpi r24, 0xC0 ; 192 3049c: 19 f4 brne .+6 ; 0x304a4 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;} 3049e: 83 e0 ldi r24, 0x03 ; 3 304a0: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 304a4: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 304a8: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 304ac: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 } chipSelectHigh(); 304b0: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 304b4: 10 92 da 16 sts 0x16DA, r1 ; 0x8016da * \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);} 304b8: 81 e0 ldi r24, 0x01 ; 1 304ba: 0f 94 d3 72 call 0x2e5a6 ; 0x2e5a6 304be: 81 11 cpse r24, r1 304c0: 0c c0 rjmp .+24 ; 0x304da 304c2: 80 e0 ldi r24, 0x00 ; 0 304c4: 0f 94 d3 72 call 0x2e5a6 ; 0x2e5a6 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 304c8: 81 11 cpse r24, r1 304ca: 07 c0 rjmp .+14 ; 0x304da { SERIAL_ERROR_START; 304cc: 8a eb ldi r24, 0xBA ; 186 304ce: 99 ea ldi r25, 0xA9 ; 169 304d0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 304d4: 8e e9 ldi r24, 0x9E ; 158 304d6: 90 e7 ldi r25, 0x70 ; 112 304d8: 78 cf rjmp .-272 ; 0x303ca } else if (!root.openRoot(&volume)) 304da: 6e ed ldi r22, 0xDE ; 222 304dc: 76 e1 ldi r23, 0x16 ; 22 304de: 82 ef ldi r24, 0xF2 ; 242 304e0: 94 e1 ldi r25, 0x14 ; 20 304e2: 0f 94 1c a4 call 0x34838 ; 0x34838 304e6: 81 11 cpse r24, r1 304e8: 07 c0 rjmp .+14 ; 0x304f8 { SERIAL_ERROR_START; 304ea: 8a eb ldi r24, 0xBA ; 186 304ec: 99 ea ldi r25, 0xA9 ; 169 304ee: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 304f2: 8e e8 ldi r24, 0x8E ; 142 304f4: 90 e7 ldi r25, 0x70 ; 112 304f6: 69 cf rjmp .-302 ; 0x303ca } else { mounted = true; 304f8: 81 e0 ldi r24, 0x01 ; 1 304fa: 80 93 6d 14 sts 0x146D, r24 ; 0x80146d SERIAL_ECHO_START; 304fe: 82 ee ldi r24, 0xE2 ; 226 30500: 99 ea ldi r25, 0xA9 ; 169 30502: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 30506: 83 e8 ldi r24, 0x83 ; 131 30508: 90 e7 ldi r25, 0x70 ; 112 3050a: 5f cf rjmp .-322 ; 0x303ca if (mounted) { cdroot(doPresort); } } 3050c: df 91 pop r29 3050e: cf 91 pop r28 30510: 1f 91 pop r17 30512: 0f 91 pop r16 30514: ff 90 pop r15 30516: ef 90 pop r14 30518: df 90 pop r13 3051a: cf 90 pop r12 3051c: 08 95 ret 0003051e : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 3051e: 4f 92 push r4 30520: 5f 92 push r5 30522: 6f 92 push r6 30524: 7f 92 push r7 30526: 8f 92 push r8 30528: 9f 92 push r9 3052a: af 92 push r10 3052c: bf 92 push r11 3052e: cf 92 push r12 30530: df 92 push r13 30532: ef 92 push r14 30534: ff 92 push r15 30536: 4b 01 movw r8, r22 30538: 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]; 3053a: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 3053e: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 30542: 07 2e mov r0, r23 30544: 00 0c add r0, r0 30546: 88 0b sbc r24, r24 30548: 99 0b sbc r25, r25 3054a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> if (!degTargetHotend(extruder)) 3054e: 20 e0 ldi r18, 0x00 ; 0 30550: 30 e0 ldi r19, 0x00 ; 0 30552: a9 01 movw r20, r18 30554: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 30558: 88 23 and r24, r24 3055a: d1 f0 breq .+52 ; 0x30590 #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; 3055c: 10 92 64 0e sts 0x0E64, r1 ; 0x800e64 <_ZL13cancel_heatup.lto_priv.404> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 30560: cc 24 eor r12, r12 30562: ca 94 dec r12 30564: dc 2c mov r13, r12 30566: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 30568: 98 ee ldi r25, 0xE8 ; 232 3056a: 49 2e mov r4, r25 3056c: 93 e0 ldi r25, 0x03 ; 3 3056e: 59 2e mov r5, r25 30570: 61 2c mov r6, r1 30572: 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) || 30574: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 <_ZL13cancel_heatup.lto_priv.404> 30578: 81 11 cpse r24, r1 3057a: 0a c0 rjmp .+20 ; 0x30590 3057c: 2f ef ldi r18, 0xFF ; 255 3057e: c2 16 cp r12, r18 30580: d2 06 cpc r13, r18 30582: e2 06 cpc r14, r18 30584: f2 06 cpc r15, r18 30586: 89 f4 brne .+34 ; 0x305aa (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) { 30588: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 3058c: 82 30 cpi r24, 0x02 ; 2 3058e: b9 f4 brne .+46 ; 0x305be { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 30590: ff 90 pop r15 30592: ef 90 pop r14 30594: df 90 pop r13 30596: cf 90 pop r12 30598: bf 90 pop r11 3059a: af 90 pop r10 3059c: 9f 90 pop r9 3059e: 8f 90 pop r8 305a0: 7f 90 pop r7 305a2: 6f 90 pop r6 305a4: 5f 90 pop r5 305a6: 4f 90 pop r4 305a8: 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) || 305aa: f7 fc sbrc r15, 7 305ac: f1 cf rjmp .-30 ; 0x30590 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 305ae: 0f 94 83 3f call 0x27f06 ; 0x27f06 305b2: 6c 19 sub r22, r12 305b4: 7d 09 sbc r23, r13 305b6: 68 3b cpi r22, 0xB8 ; 184 305b8: 7b 40 sbci r23, 0x0B ; 11 305ba: 30 f3 brcs .-52 ; 0x30588 305bc: e9 cf rjmp .-46 ; 0x30590 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) 305be: 0f 94 83 3f call 0x27f06 ; 0x27f06 305c2: 68 19 sub r22, r8 305c4: 79 09 sbc r23, r9 305c6: 8a 09 sbc r24, r10 305c8: 9b 09 sbc r25, r11 305ca: 69 3e cpi r22, 0xE9 ; 233 305cc: 73 40 sbci r23, 0x03 ; 3 305ce: 81 05 cpc r24, r1 305d0: 91 05 cpc r25, r1 305d2: f0 f1 brcs .+124 ; 0x30650 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 305d4: 8f e6 ldi r24, 0x6F ; 111 305d6: 98 ea ldi r25, 0xA8 ; 168 305d8: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 305dc: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 305e0: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 305e4: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 305e8: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 305ec: 41 e0 ldi r20, 0x01 ; 1 305ee: 0f 94 15 d6 call 0x3ac2a ; 0x3ac2a SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 305f2: 8b e6 ldi r24, 0x6B ; 107 305f4: 98 ea ldi r25, 0xA8 ; 168 305f6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 305fa: 60 e0 ldi r22, 0x00 ; 0 305fc: 70 e0 ldi r23, 0x00 ; 0 305fe: cb 01 movw r24, r22 30600: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 30604: 87 e6 ldi r24, 0x67 ; 103 30606: 98 ea ldi r25, 0xA8 ; 168 30608: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 if (residencyStart > -1) 3060c: f7 fc sbrc r15, 7 3060e: 52 c0 rjmp .+164 ; 0x306b4 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 30610: 0f 94 83 3f call 0x27f06 ; 0x27f06 30614: 46 01 movw r8, r12 30616: 57 01 movw r10, r14 30618: 58 eb ldi r21, 0xB8 ; 184 3061a: 85 0e add r8, r21 3061c: 5b e0 ldi r21, 0x0B ; 11 3061e: 95 1e adc r9, r21 30620: a1 1c adc r10, r1 30622: b1 1c adc r11, r1 30624: a5 01 movw r20, r10 30626: 94 01 movw r18, r8 30628: 26 1b sub r18, r22 3062a: 37 0b sbc r19, r23 3062c: 48 0b sbc r20, r24 3062e: 59 0b sbc r21, r25 30630: ca 01 movw r24, r20 30632: b9 01 movw r22, r18 30634: a3 01 movw r20, r6 30636: 92 01 movw r18, r4 30638: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 3063c: ca 01 movw r24, r20 3063e: b9 01 movw r22, r18 30640: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30644: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 30648: 0f 94 83 3f call 0x27f06 ; 0x27f06 3064c: 4b 01 movw r8, r22 3064e: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 30650: 90 e0 ldi r25, 0x00 ; 0 30652: 80 e0 ldi r24, 0x00 ; 0 30654: 0e 94 7f 8e call 0x11cfe ; 0x11cfe #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))) || 30658: 3f ef ldi r19, 0xFF ; 255 3065a: c3 16 cp r12, r19 3065c: d3 06 cpc r13, r19 3065e: e3 06 cpc r14, r19 30660: f3 06 cpc r15, r19 30662: 09 f0 breq .+2 ; 0x30666 30664: 46 c0 rjmp .+140 ; 0x306f2 } 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))) || 30666: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e <_ZL16target_direction.lto_priv.553> 3066a: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 3066e: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 30672: 88 23 and r24, r24 30674: 19 f1 breq .+70 ; 0x306bc 30676: 07 2e mov r0, r23 30678: 00 0c add r0, r0 3067a: 88 0b sbc r24, r24 3067c: 99 0b sbc r25, r25 3067e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 30682: 20 e0 ldi r18, 0x00 ; 0 30684: 30 e0 ldi r19, 0x00 ; 0 30686: 40 e8 ldi r20, 0x80 ; 128 30688: 5f e3 ldi r21, 0x3F ; 63 3068a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 3068e: 9b 01 movw r18, r22 30690: ac 01 movw r20, r24 30692: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 30696: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 3069a: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 3069e: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 306a2: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 306a6: 87 fd sbrc r24, 7 306a8: 65 cf rjmp .-310 ; 0x30574 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 306aa: 0f 94 83 3f call 0x27f06 ; 0x27f06 306ae: 6b 01 movw r12, r22 306b0: 7c 01 movw r14, r24 306b2: 60 cf rjmp .-320 ; 0x30574 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 306b4: 8f e3 ldi r24, 0x3F ; 63 306b6: 0e 94 ba 78 call 0xf174 ; 0xf174 306ba: c4 cf rjmp .-120 ; 0x30644 306bc: 07 2e mov r0, r23 306be: 00 0c add r0, r0 306c0: 88 0b sbc r24, r24 306c2: 99 0b sbc r25, r25 306c4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__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))) || 306c8: 20 e0 ldi r18, 0x00 ; 0 306ca: 30 e0 ldi r19, 0x00 ; 0 306cc: 40 e8 ldi r20, 0x80 ; 128 306ce: 5f e3 ldi r21, 0x3F ; 63 306d0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 306d4: 9b 01 movw r18, r22 306d6: ac 01 movw r20, r24 306d8: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 306dc: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 306e0: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 306e4: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 306e8: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 306ec: 18 16 cp r1, r24 306ee: ec f6 brge .-70 ; 0x306aa 306f0: 41 cf rjmp .-382 ; 0x30574 306f2: f7 fc sbrc r15, 7 306f4: 3f cf rjmp .-386 ; 0x30574 306f6: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 306fa: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 306fe: 07 2e mov r0, r23 30700: 00 0c add r0, r0 30702: 88 0b sbc r24, r24 30704: 99 0b sbc r25, r25 30706: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3070a: 9b 01 movw r18, r22 3070c: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 3070e: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 30712: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 30716: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 3071a: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 3071e: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 30722: 9f 77 andi r25, 0x7F ; 127 30724: 20 e0 ldi r18, 0x00 ; 0 30726: 30 e0 ldi r19, 0x00 ; 0 30728: 40 ea ldi r20, 0xA0 ; 160 3072a: 50 e4 ldi r21, 0x40 ; 64 3072c: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 30730: 18 16 cp r1, r24 30732: 0c f0 brlt .+2 ; 0x30736 30734: 1f cf rjmp .-450 ; 0x30574 30736: b9 cf rjmp .-142 ; 0x306aa 00030738 : // 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) { 30738: 1f 93 push r17 3073a: cf 93 push r28 3073c: df 93 push r29 3073e: ec 01 movw r28, r24 30740: 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()) { 30742: 80 91 69 13 lds r24, 0x1369 ; 0x801369 30746: 83 30 cpi r24, 0x03 ; 3 30748: 09 f4 brne .+2 ; 0x3074c 3074a: 4e c0 rjmp .+156 ; 0x307e8 3074c: 8c 31 cpi r24, 0x1C ; 28 3074e: 09 f4 brne .+2 ; 0x30752 30750: 52 c0 rjmp .+164 ; 0x307f6 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 30752: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 30756: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 3075a: 8c 17 cp r24, r28 3075c: 9d 07 cpc r25, r29 3075e: 79 f1 breq .+94 ; 0x307be lastErrorCode = ec; 30760: d0 93 8f 13 sts 0x138F, r29 ; 0x80138f 30764: c0 93 8e 13 sts 0x138E, r28 ; 0x80138e lastErrorSource = res; 30768: 10 93 90 13 sts 0x1390, r17 ; 0x801390 LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 3076c: ce 01 movw r24, r28 3076e: 0f 94 5e c3 call 0x386bc ; 0x386bc 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); 30772: e8 2f mov r30, r24 30774: f0 e0 ldi r31, 0x00 ; 0 30776: ee 0f add r30, r30 30778: ff 1f adc r31, r31 3077a: e5 56 subi r30, 0x65 ; 101 3077c: f8 45 sbci r31, 0x58 ; 88 3077e: 85 91 lpm r24, Z+ 30780: 94 91 lpm r25, Z 30782: 02 96 adiw r24, 0x02 ; 2 30784: 0f 94 4c c3 call 0x38698 ; 0x38698 if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 30788: c1 30 cpi r28, 0x01 ; 1 3078a: d1 05 cpc r29, r1 3078c: c1 f0 breq .+48 ; 0x307be 3078e: cc 30 cpi r28, 0x0C ; 12 30790: 80 e8 ldi r24, 0x80 ; 128 30792: d8 07 cpc r29, r24 30794: a1 f0 breq .+40 ; 0x307be 30796: c9 32 cpi r28, 0x29 ; 41 30798: 80 e8 ldi r24, 0x80 ; 128 3079a: d8 07 cpc r29, r24 3079c: 81 f0 breq .+32 ; 0x307be IncrementMMUFails(); 3079e: 0f 94 68 c2 call 0x384d0 ; 0x384d0 | (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 307a2: ce 01 movw r24, r28 307a4: 88 27 eor r24, r24 307a6: 9e 77 andi r25, 0x7E ; 126 307a8: 89 2b or r24, r25 307aa: 49 f0 breq .+18 ; 0x307be /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 307ac: 80 91 9c 13 lds r24, 0x139C ; 0x80139c 307b0: 90 91 9d 13 lds r25, 0x139D ; 0x80139d 307b4: 01 96 adiw r24, 0x01 ; 1 307b6: 90 93 9d 13 sts 0x139D, r25 ; 0x80139d 307ba: 80 93 9c 13 sts 0x139C, r24 ; 0x80139c return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 307be: 80 91 7b 13 lds r24, 0x137B ; 0x80137b 307c2: 88 23 and r24, r24 307c4: d9 f0 breq .+54 ; 0x307fc return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 307c6: 11 e0 ldi r17, 0x01 ; 1 307c8: 10 93 5d 0e sts 0x0E5D, r17 ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 307cc: ce 01 movw r24, r28 307ce: 0f 94 e9 c5 call 0x38bd2 ; 0x38bd2 307d2: 8f 3f cpi r24, 0xFF ; 255 307d4: 99 f0 breq .+38 ; 0x307fc void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 307d6: 10 93 7c 13 sts 0x137C, r17 ; 0x80137c logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 307da: 88 e8 ldi r24, 0x88 ; 136 307dc: 97 ea ldi r25, 0xA7 ; 167 && mmu2Magic[2] == 'U' && mmu2Magic[3] == '2' && mmu2Magic[4] == ':' && strlen_constexpr(mmu2Magic) == 5, "MMU2 logging prefix mismatch, must be updated at various spots"); } 307de: df 91 pop r29 307e0: cf 91 pop r28 307e2: 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"); 307e4: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc // 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; 307e8: 10 92 99 13 sts 0x1399, r1 ; 0x801399 float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 307ec: 0f 94 05 bc call 0x3780a ; 0x3780a // 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; 307f0: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b 307f4: ae cf rjmp .-164 ; 0x30752 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; 307f6: 10 92 98 13 sts 0x1398, r1 ; 0x801398 307fa: f8 cf rjmp .-16 ; 0x307ec 307fc: 10 92 7c 13 sts 0x137C, r1 ; 0x80137c bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 30800: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> 30804: 81 11 cpse r24, r1 30806: 06 c0 rjmp .+12 ; 0x30814 30808: 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"); } 3080a: df 91 pop r29 3080c: cf 91 pop r28 3080e: 1f 91 pop r17 30810: 0d 94 af c4 jmp 0x3895e ; 0x3895e 30814: df 91 pop r29 30816: cf 91 pop r28 30818: 1f 91 pop r17 3081a: 08 95 ret 0003081c : * \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) { 3081c: 2f 92 push r2 3081e: 3f 92 push r3 30820: 4f 92 push r4 30822: 5f 92 push r5 30824: 6f 92 push r6 30826: 7f 92 push r7 30828: 8f 92 push r8 3082a: 9f 92 push r9 3082c: af 92 push r10 3082e: bf 92 push r11 30830: cf 92 push r12 30832: df 92 push r13 30834: ef 92 push r14 30836: ff 92 push r15 30838: 0f 93 push r16 3083a: 1f 93 push r17 3083c: cf 93 push r28 3083e: df 93 push r29 30840: 00 d0 rcall .+0 ; 0x30842 30842: 1f 92 push r1 30844: cd b7 in r28, 0x3d ; 61 30846: de b7 in r29, 0x3e ; 62 30848: 5c 01 movw r10, r24 3084a: 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; 3084c: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 30850: 81 30 cpi r24, 0x01 ; 1 30852: 09 f0 breq .+2 ; 0x30856 30854: de c0 rjmp .+444 ; 0x30a12 30856: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd 3085a: 81 ff sbrs r24, 1 3085c: da c0 rjmp .+436 ; 0x30a12 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 3085e: 82 fd sbrc r24, 2 30860: bc c0 rjmp .+376 ; 0x309da * \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) { 30862: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30864: 21 2c mov r2, r1 30866: 32 e0 ldi r19, 0x02 ; 2 30868: 33 2e mov r3, r19 3086a: 00 91 04 17 lds r16, 0x1704 ; 0x801704 3086e: 10 91 05 17 lds r17, 0x1705 ; 0x801705 30872: 20 91 06 17 lds r18, 0x1706 ; 0x801706 30876: 30 91 07 17 lds r19, 0x1707 ; 0x801707 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 3087a: e1 14 cp r14, r1 3087c: f1 04 cpc r15, r1 3087e: 09 f4 brne .+2 ; 0x30882 30880: 30 c1 rjmp .+608 ; 0x30ae2 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 30882: 80 91 15 17 lds r24, 0x1715 ; 0x801715 30886: 90 91 16 17 lds r25, 0x1716 ; 0x801716 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);} 3088a: dc 01 movw r26, r24 3088c: 14 96 adiw r26, 0x04 ; 4 3088e: 7c 90 ld r7, X 30890: 7a 94 dec r7 30892: b9 01 movw r22, r18 30894: a8 01 movw r20, r16 30896: 29 e0 ldi r18, 0x09 ; 9 30898: 76 95 lsr r23 3089a: 67 95 ror r22 3089c: 57 95 ror r21 3089e: 47 95 ror r20 308a0: 2a 95 dec r18 308a2: d1 f7 brne .-12 ; 0x30898 308a4: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 308a6: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 308a8: 71 10 cpse r7, r1 308aa: 25 c0 rjmp .+74 ; 0x308f6 308ac: 01 15 cp r16, r1 308ae: 11 05 cpc r17, r1 308b0: 11 f5 brne .+68 ; 0x308f6 308b2: 40 91 00 17 lds r20, 0x1700 ; 0x801700 308b6: 50 91 01 17 lds r21, 0x1701 ; 0x801701 308ba: 60 91 02 17 lds r22, 0x1702 ; 0x801702 308be: 70 91 03 17 lds r23, 0x1703 ; 0x801703 // start of new cluster if (curCluster_ == 0) { 308c2: 41 15 cp r20, r1 308c4: 51 05 cpc r21, r1 308c6: 61 05 cpc r22, r1 308c8: 71 05 cpc r23, r1 308ca: 09 f0 breq .+2 ; 0x308ce 308cc: a8 c0 rjmp .+336 ; 0x30a1e if (firstCluster_ == 0) { 308ce: 80 91 11 17 lds r24, 0x1711 ; 0x801711 308d2: 90 91 12 17 lds r25, 0x1712 ; 0x801712 308d6: a0 91 13 17 lds r26, 0x1713 ; 0x801713 308da: b0 91 14 17 lds r27, 0x1714 ; 0x801714 308de: 00 97 sbiw r24, 0x00 ; 0 308e0: a1 05 cpc r26, r1 308e2: b1 05 cpc r27, r1 308e4: 09 f0 breq .+2 ; 0x308e8 308e6: b4 c0 rjmp .+360 ; 0x30a50 } 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; 308e8: 8c ef ldi r24, 0xFC ; 252 308ea: 96 e1 ldi r25, 0x16 ; 22 308ec: 0f 94 c9 a4 call 0x34992 ; 0x34992 308f0: 88 23 and r24, r24 308f2: 09 f4 brne .+2 ; 0x308f6 308f4: 8e c0 rjmp .+284 ; 0x30a12 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 308f6: c1 01 movw r24, r2 308f8: 80 1b sub r24, r16 308fa: 91 0b sbc r25, r17 308fc: 67 01 movw r12, r14 308fe: 8e 15 cp r24, r14 30900: 9f 05 cpc r25, r15 30902: 08 f4 brcc .+2 ; 0x30906 30904: 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; 30906: e0 91 15 17 lds r30, 0x1715 ; 0x801715 3090a: f0 91 16 17 lds r31, 0x1716 ; 0x801716 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 3090e: 80 91 00 17 lds r24, 0x1700 ; 0x801700 30912: 90 91 01 17 lds r25, 0x1701 ; 0x801701 30916: a0 91 02 17 lds r26, 0x1702 ; 0x801702 3091a: b0 91 03 17 lds r27, 0x1703 ; 0x801703 3091e: 02 97 sbiw r24, 0x02 ; 2 30920: a1 09 sbc r26, r1 30922: b1 09 sbc r27, r1 30924: 25 85 ldd r18, Z+13 ; 0x0d 30926: 04 c0 rjmp .+8 ; 0x30930 30928: 88 0f add r24, r24 3092a: 99 1f adc r25, r25 3092c: aa 1f adc r26, r26 3092e: bb 1f adc r27, r27 30930: 2a 95 dec r18 30932: d2 f7 brpl .-12 ; 0x30928 30934: 46 85 ldd r20, Z+14 ; 0x0e 30936: 57 85 ldd r21, Z+15 ; 0x0f 30938: 60 89 ldd r22, Z+16 ; 0x10 3093a: 71 89 ldd r23, Z+17 ; 0x11 3093c: 84 0f add r24, r20 3093e: 95 1f adc r25, r21 30940: a6 1f adc r26, r22 30942: b7 1f adc r27, r23 30944: 9c 01 movw r18, r24 30946: ad 01 movw r20, r26 30948: 27 0d add r18, r7 3094a: 31 1d adc r19, r1 3094c: 41 1d adc r20, r1 3094e: 51 1d adc r21, r1 30950: 29 01 movw r4, r18 30952: 3a 01 movw r6, r20 if (n == 512) { 30954: c1 14 cp r12, r1 30956: 32 e0 ldi r19, 0x02 ; 2 30958: d3 06 cpc r13, r19 3095a: 09 f0 breq .+2 ; 0x3095e 3095c: 8a c0 rjmp .+276 ; 0x30a72 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 3095e: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 30962: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 30966: a0 91 6f 0e lds r26, 0x0E6F ; 0x800e6f 3096a: b0 91 70 0e lds r27, 0x0E70 ; 0x800e70 3096e: 48 16 cp r4, r24 30970: 59 06 cpc r5, r25 30972: 6a 06 cpc r6, r26 30974: 7b 06 cpc r7, r27 30976: 69 f4 brne .+26 ; 0x30992 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; 30978: 10 92 75 0e sts 0x0E75, r1 ; 0x800e75 cacheBlockNumber_ = blockNumber; 3097c: 8f ef ldi r24, 0xFF ; 255 3097e: 9f ef ldi r25, 0xFF ; 255 30980: dc 01 movw r26, r24 30982: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d 30986: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 3098a: a0 93 6f 0e sts 0x0E6F, r26 ; 0x800e6f 3098e: b0 93 70 0e sts 0x0E70, r27 ; 0x800e70 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); 30992: 95 01 movw r18, r10 30994: b3 01 movw r22, r6 30996: a2 01 movw r20, r4 30998: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 3099c: 90 91 77 0e lds r25, 0x0E77 ; 0x800e77 309a0: 0f 94 30 a6 call 0x34c60 ; 0x34c60 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 309a4: 88 23 and r24, r24 309a6: a9 f1 breq .+106 ; 0x30a12 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 309a8: 80 91 04 17 lds r24, 0x1704 ; 0x801704 309ac: 90 91 05 17 lds r25, 0x1705 ; 0x801705 309b0: a0 91 06 17 lds r26, 0x1706 ; 0x801706 309b4: b0 91 07 17 lds r27, 0x1707 ; 0x801707 309b8: 8c 0d add r24, r12 309ba: 9d 1d adc r25, r13 309bc: a1 1d adc r26, r1 309be: b1 1d adc r27, r1 309c0: 80 93 04 17 sts 0x1704, r24 ; 0x801704 309c4: 90 93 05 17 sts 0x1705, r25 ; 0x801705 309c8: a0 93 06 17 sts 0x1706, r26 ; 0x801706 309cc: b0 93 07 17 sts 0x1707, r27 ; 0x801707 src += n; 309d0: ac 0c add r10, r12 309d2: bd 1c adc r11, r13 nToWrite -= n; 309d4: ec 18 sub r14, r12 309d6: fd 08 sbc r15, r13 309d8: 48 cf rjmp .-368 ; 0x3086a // 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_) { 309da: 40 91 0d 17 lds r20, 0x170D ; 0x80170d 309de: 50 91 0e 17 lds r21, 0x170E ; 0x80170e 309e2: 60 91 0f 17 lds r22, 0x170F ; 0x80170f 309e6: 70 91 10 17 lds r23, 0x1710 ; 0x801710 309ea: 80 91 04 17 lds r24, 0x1704 ; 0x801704 309ee: 90 91 05 17 lds r25, 0x1705 ; 0x801705 309f2: a0 91 06 17 lds r26, 0x1706 ; 0x801706 309f6: b0 91 07 17 lds r27, 0x1707 ; 0x801707 309fa: 48 17 cp r20, r24 309fc: 59 07 cpc r21, r25 309fe: 6a 07 cpc r22, r26 30a00: 7b 07 cpc r23, r27 30a02: 09 f4 brne .+2 ; 0x30a06 30a04: 2e cf rjmp .-420 ; 0x30862 } /** 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);} 30a06: 8c ef ldi r24, 0xFC ; 252 30a08: 96 e1 ldi r25, 0x16 ; 22 30a0a: 0f 94 a9 6e call 0x2dd52 ; 0x2dd52 if (!seekEnd()) goto fail; 30a0e: 81 11 cpse r24, r1 30a10: 28 cf rjmp .-432 ; 0x30862 } return nbyte; fail: // return for write error writeError = true; 30a12: 81 e0 ldi r24, 0x01 ; 1 30a14: 80 93 fc 16 sts 0x16FC, r24 ; 0x8016fc return -1; 30a18: 8f ef ldi r24, 0xFF ; 255 30a1a: 9f ef ldi r25, 0xFF ; 255 30a1c: 81 c0 rjmp .+258 ; 0x30b20 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 30a1e: 9e 01 movw r18, r28 30a20: 2f 5f subi r18, 0xFF ; 255 30a22: 3f 4f sbci r19, 0xFF ; 255 30a24: 0f 94 a6 6c call 0x2d94c ; 0x2d94c 30a28: 88 23 and r24, r24 30a2a: 99 f3 breq .-26 ; 0x30a12 if (vol_->isEOC(next)) { 30a2c: 89 81 ldd r24, Y+1 ; 0x01 30a2e: 9a 81 ldd r25, Y+2 ; 0x02 30a30: ab 81 ldd r26, Y+3 ; 0x03 30a32: 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; 30a34: e0 91 15 17 lds r30, 0x1715 ; 0x801715 30a38: f0 91 16 17 lds r31, 0x1716 ; 0x801716 30a3c: 27 89 ldd r18, Z+23 ; 0x17 30a3e: 20 31 cpi r18, 0x10 ; 16 30a40: 81 f4 brne .+32 ; 0x30a62 30a42: 88 3f cpi r24, 0xF8 ; 248 30a44: ef ef ldi r30, 0xFF ; 255 30a46: 9e 07 cpc r25, r30 30a48: a1 05 cpc r26, r1 30a4a: b1 05 cpc r27, r1 30a4c: 08 f0 brcs .+2 ; 0x30a50 30a4e: 4c cf rjmp .-360 ; 0x308e8 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 30a50: 80 93 00 17 sts 0x1700, r24 ; 0x801700 30a54: 90 93 01 17 sts 0x1701, r25 ; 0x801701 30a58: a0 93 02 17 sts 0x1702, r26 ; 0x801702 30a5c: b0 93 03 17 sts 0x1703, r27 ; 0x801703 30a60: 4a cf rjmp .-364 ; 0x308f6 return cluster >= FAT32EOC_MIN; 30a62: 88 3f cpi r24, 0xF8 ; 248 30a64: ff ef ldi r31, 0xFF ; 255 30a66: 9f 07 cpc r25, r31 30a68: af 07 cpc r26, r31 30a6a: ff e0 ldi r31, 0x0F ; 15 30a6c: bf 07 cpc r27, r31 30a6e: 80 f3 brcs .-32 ; 0x30a50 30a70: 3b cf rjmp .-394 ; 0x308e8 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 30a72: 01 15 cp r16, r1 30a74: 11 05 cpc r17, r1 30a76: 69 f5 brne .+90 ; 0x30ad2 30a78: 40 91 04 17 lds r20, 0x1704 ; 0x801704 30a7c: 50 91 05 17 lds r21, 0x1705 ; 0x801705 30a80: 60 91 06 17 lds r22, 0x1706 ; 0x801706 30a84: 70 91 07 17 lds r23, 0x1707 ; 0x801707 30a88: 80 91 0d 17 lds r24, 0x170D ; 0x80170d 30a8c: 90 91 0e 17 lds r25, 0x170E ; 0x80170e 30a90: a0 91 0f 17 lds r26, 0x170F ; 0x80170f 30a94: b0 91 10 17 lds r27, 0x1710 ; 0x801710 30a98: 48 17 cp r20, r24 30a9a: 59 07 cpc r21, r25 30a9c: 6a 07 cpc r22, r26 30a9e: 7b 07 cpc r23, r27 30aa0: c0 f0 brcs .+48 ; 0x30ad2 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 30aa2: 0f 94 98 6b call 0x2d730 ; 0x2d730 30aa6: 88 23 and r24, r24 30aa8: 09 f4 brne .+2 ; 0x30aac 30aaa: b3 cf rjmp .-154 ; 0x30a12 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; 30aac: 81 e0 ldi r24, 0x01 ; 1 30aae: 80 93 75 0e sts 0x0E75, r24 ; 0x800e75 cacheBlockNumber_ = blockNumber; 30ab2: 40 92 6d 0e sts 0x0E6D, r4 ; 0x800e6d 30ab6: 50 92 6e 0e sts 0x0E6E, r5 ; 0x800e6e 30aba: 60 92 6f 0e sts 0x0E6F, r6 ; 0x800e6f 30abe: 70 92 70 0e sts 0x0E70, r7 ; 0x800e70 } 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); 30ac2: a6 01 movw r20, r12 30ac4: b5 01 movw r22, r10 30ac6: c8 01 movw r24, r16 30ac8: 87 58 subi r24, 0x87 ; 135 30aca: 91 4f sbci r25, 0xF1 ; 241 30acc: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 30ad0: 6b cf rjmp .-298 ; 0x309a8 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; 30ad2: 41 e0 ldi r20, 0x01 ; 1 30ad4: c3 01 movw r24, r6 30ad6: b2 01 movw r22, r4 30ad8: 0f 94 d7 6b call 0x2d7ae ; 0x2d7ae 30adc: 81 11 cpse r24, r1 30ade: f1 cf rjmp .-30 ; 0x30ac2 30ae0: 98 cf rjmp .-208 ; 0x30a12 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 30ae2: 80 91 0d 17 lds r24, 0x170D ; 0x80170d 30ae6: 90 91 0e 17 lds r25, 0x170E ; 0x80170e 30aea: a0 91 0f 17 lds r26, 0x170F ; 0x80170f 30aee: b0 91 10 17 lds r27, 0x1710 ; 0x801710 30af2: 80 17 cp r24, r16 30af4: 91 07 cpc r25, r17 30af6: a2 07 cpc r26, r18 30af8: b3 07 cpc r27, r19 30afa: 68 f4 brcc .+26 ; 0x30b16 30afc: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 30b00: 00 93 0d 17 sts 0x170D, r16 ; 0x80170d 30b04: 10 93 0e 17 sts 0x170E, r17 ; 0x80170e 30b08: 20 93 0f 17 sts 0x170F, r18 ; 0x80170f 30b0c: 30 93 10 17 sts 0x1710, r19 ; 0x801710 flags_ |= F_FILE_DIR_DIRTY; 30b10: 80 68 ori r24, 0x80 ; 128 30b12: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 30b16: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd 30b1a: 83 fd sbrc r24, 3 30b1c: 18 c0 rjmp .+48 ; 0x30b4e if (!sync()) goto fail; } return nbyte; 30b1e: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 30b20: 0f 90 pop r0 30b22: 0f 90 pop r0 30b24: 0f 90 pop r0 30b26: 0f 90 pop r0 30b28: df 91 pop r29 30b2a: cf 91 pop r28 30b2c: 1f 91 pop r17 30b2e: 0f 91 pop r16 30b30: ff 90 pop r15 30b32: ef 90 pop r14 30b34: df 90 pop r13 30b36: cf 90 pop r12 30b38: bf 90 pop r11 30b3a: af 90 pop r10 30b3c: 9f 90 pop r9 30b3e: 8f 90 pop r8 30b40: 7f 90 pop r7 30b42: 6f 90 pop r6 30b44: 5f 90 pop r5 30b46: 4f 90 pop r4 30b48: 3f 90 pop r3 30b4a: 2f 90 pop r2 30b4c: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 30b4e: 8c ef ldi r24, 0xFC ; 252 30b50: 96 e1 ldi r25, 0x16 ; 22 30b52: 0f 94 74 6e call 0x2dce8 ; 0x2dce8 30b56: 81 11 cpse r24, r1 30b58: e2 cf rjmp .-60 ; 0x30b1e 30b5a: 5b cf rjmp .-330 ; 0x30a12 00030b5c : #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) { 30b5c: 0f 93 push r16 30b5e: cf 93 push r28 30b60: df 93 push r29 30b62: cd b7 in r28, 0x3d ; 61 30b64: de b7 in r29, 0x3e ; 62 30b66: a3 97 sbiw r28, 0x23 ; 35 30b68: 0f b6 in r0, 0x3f ; 63 30b6a: f8 94 cli 30b6c: de bf out 0x3e, r29 ; 62 30b6e: 0f be out 0x3f, r0 ; 63 30b70: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 30b72: 20 91 0d 16 lds r18, 0x160D ; 0x80160d 30b76: 30 91 0e 16 lds r19, 0x160E ; 0x80160e 30b7a: 82 17 cp r24, r18 30b7c: 93 07 cpc r25, r19 30b7e: d8 f4 brcc .+54 ; 0x30bb6 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 30b80: 61 30 cpi r22, 0x01 ; 1 30b82: 31 f4 brne .+12 ; 0x30b90 30b84: 21 50 subi r18, 0x01 ; 1 30b86: 31 09 sbc r19, r1 30b88: a9 01 movw r20, r18 30b8a: 48 1b sub r20, r24 30b8c: 59 0b sbc r21, r25 30b8e: ca 01 movw r24, r20 30b90: 88 0f add r24, r24 30b92: 99 1f adc r25, r25 30b94: fc 01 movw r30, r24 30b96: e1 5f subi r30, 0xF1 ; 241 30b98: f9 4e sbci r31, 0xE9 ; 233 30b9a: 80 81 ld r24, Z 30b9c: 91 81 ldd r25, Z+1 ; 0x01 30b9e: 0f 94 a1 7b call 0x2f742 ; 0x2f742 else getfilename_afterMaxSorting(nr); } 30ba2: a3 96 adiw r28, 0x23 ; 35 30ba4: 0f b6 in r0, 0x3f ; 63 30ba6: f8 94 cli 30ba8: de bf out 0x3e, r29 ; 62 30baa: 0f be out 0x3f, r0 ; 63 30bac: cd bf out 0x3d, r28 ; 61 30bae: df 91 pop r29 30bb0: cf 91 pop r28 30bb2: 0f 91 pop r16 30bb4: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 30bb6: 47 e1 ldi r20, 0x17 ; 23 30bb8: 55 e1 ldi r21, 0x15 ; 21 30bba: 50 93 16 15 sts 0x1516, r21 ; 0x801516 30bbe: 40 93 15 15 sts 0x1515, r20 ; 0x801515 nrFiles = entry - sort_count + 1; 30bc2: 82 1b sub r24, r18 30bc4: 93 0b sbc r25, r19 30bc6: 01 96 adiw r24, 0x01 ; 1 30bc8: 90 93 85 17 sts 0x1785, r25 ; 0x801785 30bcc: 80 93 84 17 sts 0x1784, r24 ; 0x801784 curDir->seekSet(lastSortedFilePosition << 5); 30bd0: 40 91 d7 16 lds r20, 0x16D7 ; 0x8016d7 30bd4: 50 91 d8 16 lds r21, 0x16D8 ; 0x8016d8 30bd8: 85 e0 ldi r24, 0x05 ; 5 30bda: 44 0f add r20, r20 30bdc: 55 1f adc r21, r21 30bde: 8a 95 dec r24 30be0: e1 f7 brne .-8 ; 0x30bda 30be2: 70 e0 ldi r23, 0x00 ; 0 30be4: 60 e0 ldi r22, 0x00 ; 0 30be6: 87 e1 ldi r24, 0x17 ; 23 30be8: 95 e1 ldi r25, 0x15 ; 21 30bea: 0f 94 a9 6e call 0x2dd52 ; 0x2dd52 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 30bee: 00 e0 ldi r16, 0x00 ; 0 30bf0: 0e 7f andi r16, 0xFE ; 254 30bf2: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 30bf4: e0 91 15 15 lds r30, 0x1515 ; 0x801515 30bf8: f0 91 16 15 lds r31, 0x1516 ; 0x801516 30bfc: 83 e2 ldi r24, 0x23 ; 35 30bfe: de 01 movw r26, r28 30c00: 11 96 adiw r26, 0x01 ; 1 30c02: 01 90 ld r0, Z+ 30c04: 0d 92 st X+, r0 30c06: 8a 95 dec r24 30c08: e1 f7 brne .-8 ; 0x30c02 30c0a: 22 e0 ldi r18, 0x02 ; 2 30c0c: 50 e0 ldi r21, 0x00 ; 0 30c0e: 40 e0 ldi r20, 0x00 ; 0 30c10: be 01 movw r22, r28 30c12: 6f 5f subi r22, 0xFF ; 255 30c14: 7f 4f sbci r23, 0xFF ; 255 30c16: 83 ef ldi r24, 0xF3 ; 243 30c18: 92 e0 ldi r25, 0x02 ; 2 30c1a: 0f 94 2b 79 call 0x2f256 ; 0x2f256 30c1e: ce 01 movw r24, r28 30c20: 01 96 adiw r24, 0x01 ; 1 30c22: 0e 94 b4 78 call 0xf168 ; 0xf168 30c26: bd cf rjmp .-134 ; 0x30ba2 00030c28 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 30c28: 0f 93 push r16 30c2a: 1f 93 push r17 30c2c: cf 93 push r28 30c2e: df 93 push r29 30c30: 1f 92 push r1 30c32: 1f 92 push r1 30c34: cd b7 in r28, 0x3d ; 61 30c36: de b7 in r29, 0x3e ; 62 { if(!mounted) 30c38: 20 91 6d 14 lds r18, 0x146D ; 0x80146d 30c3c: 22 23 and r18, r18 30c3e: 69 f1 breq .+90 ; 0x30c9a 30c40: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30c42: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 30c46: 88 23 and r24, r24 30c48: 79 f1 breq .+94 ; 0x30ca8 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 30c4a: 8f ea ldi r24, 0xAF ; 175 30c4c: 96 ea ldi r25, 0xA6 ; 166 30c4e: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 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; 30c52: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c const char *fname=name; 30c56: 1a 83 std Y+2, r17 ; 0x02 30c58: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 30c5a: ce 01 movw r24, r28 30c5c: 01 96 adiw r24, 0x01 ; 1 30c5e: 0f 94 74 7f call 0x2fee8 ; 0x2fee8 30c62: 88 23 and r24, r24 30c64: d1 f0 breq .+52 ; 0x30c9a return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 30c66: 49 81 ldd r20, Y+1 ; 0x01 30c68: 5a 81 ldd r21, Y+2 ; 0x02 30c6a: 60 91 15 15 lds r22, 0x1515 ; 0x801515 30c6e: 70 91 16 15 lds r23, 0x1516 ; 0x801516 30c72: 26 e5 ldi r18, 0x56 ; 86 30c74: 8c ef ldi r24, 0xFC ; 252 30c76: 96 e1 ldi r25, 0x16 ; 22 30c78: 0f 94 36 d7 call 0x3ae6c ; 0x3ae6c 30c7c: 81 11 cpse r24, r1 30c7e: 22 c0 rjmp .+68 ; 0x30cc4 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30c80: 8e eb ldi r24, 0xBE ; 190 30c82: 90 e7 ldi r25, 0x70 ; 112 30c84: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 30c88: 89 81 ldd r24, Y+1 ; 0x01 30c8a: 9a 81 ldd r25, Y+2 ; 0x02 30c8c: 0e 94 37 89 call 0x1126e ; 0x1126e 30c90: 8e e2 ldi r24, 0x2E ; 46 30c92: 0e 94 ba 78 call 0xf174 ; 0xf174 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30c96: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 30c9a: 0f 90 pop r0 30c9c: 0f 90 pop r0 30c9e: df 91 pop r29 30ca0: cf 91 pop r28 30ca2: 1f 91 pop r17 30ca4: 0f 91 pop r16 30ca6: 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 30ca8: 10 92 1f 17 sts 0x171F, r1 ; 0x80171f SERIAL_ECHO_START; 30cac: 82 ee ldi r24, 0xE2 ; 226 30cae: 99 ea ldi r25, 0xA9 ; 169 30cb0: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHORPGM(ofNowFreshFile); 30cb4: 84 eb ldi r24, 0xB4 ; 180 30cb6: 98 ea ldi r25, 0xA8 ; 168 30cb8: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN(name); 30cbc: c8 01 movw r24, r16 30cbe: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c 30cc2: c7 cf rjmp .-114 ; 0x30c52 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; 30cc4: 81 e0 ldi r24, 0x01 ; 1 30cc6: 80 93 6a 14 sts 0x146A, r24 ; 0x80146a getfilename(0, fname); 30cca: 89 81 ldd r24, Y+1 ; 0x01 30ccc: 9a 81 ldd r25, Y+2 ; 0x02 30cce: 0f 94 5a 7b call 0x2f6b4 ; 0x2f6b4 SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 30cd2: 8d e9 ldi r24, 0x9D ; 157 30cd4: 96 ea ldi r25, 0xA6 ; 166 30cd6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 printAbsFilenameFast(); 30cda: 0f 94 3d 7c call 0x2f87a ; 0x2f87a SERIAL_PROTOCOLLN(); 30cde: 0f 94 8b d6 call 0x3ad16 ; 0x3ad16 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30ce2: 80 e9 ldi r24, 0x90 ; 144 30ce4: 98 ea ldi r25, 0xA8 ; 168 30ce6: 0e 94 fe 7a call 0xf5fc ; 0xf5fc lcd_setstatuspgm(ofFileSelected); 30cea: 80 e9 ldi r24, 0x90 ; 144 30cec: 98 ea ldi r25, 0xA8 ; 168 30cee: 0f 94 e2 0b call 0x217c4 ; 0x217c4 scrollstuff = 0; 30cf2: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 30cf6: d1 cf rjmp .-94 ; 0x30c9a 00030cf8 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 30cf8: 0f 93 push r16 30cfa: 1f 93 push r17 30cfc: cf 93 push r28 30cfe: df 93 push r29 30d00: ec 01 movw r28, r24 { memset(ip, 0, 4); 30d02: 84 e0 ldi r24, 0x04 ; 4 30d04: fe 01 movw r30, r28 30d06: 11 92 st Z+, r1 30d08: 8a 95 dec r24 30d0a: e9 f7 brne .-6 ; 0x30d06 /** 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 30d0c: 23 e0 ldi r18, 0x03 ; 3 30d0e: 30 ea ldi r19, 0xA0 ; 160 30d10: 4a e0 ldi r20, 0x0A ; 10 30d12: 50 e9 ldi r21, 0x90 ; 144 30d14: 60 e3 ldi r22, 0x30 ; 48 30d16: 89 ed ldi r24, 0xD9 ; 217 30d18: 96 e1 ldi r25, 0x16 ; 22 30d1a: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 30d1e: 88 23 and r24, r24 30d20: 91 f0 breq .+36 ; 0x30d46 30d22: 23 e0 ldi r18, 0x03 ; 3 30d24: 30 ea ldi r19, 0xA0 ; 160 30d26: 4a e0 ldi r20, 0x0A ; 10 30d28: 50 e9 ldi r21, 0x90 ; 144 30d2a: 61 e1 ldi r22, 0x11 ; 17 30d2c: 89 ed ldi r24, 0xD9 ; 217 30d2e: 96 e1 ldi r25, 0x16 ; 22 30d30: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 30d34: 88 23 and r24, r24 30d36: 39 f0 breq .+14 ; 0x30d46 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30d38: 80 e8 ldi r24, 0x80 ; 128 30d3a: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30d3e: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 return false; 30d42: 80 e0 ldi r24, 0x00 ; 0 30d44: 2f c0 rjmp .+94 ; 0x30da4 //------------------------------------------------------------------------------ /** 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(); 30d46: 0f 94 83 3f call 0x27f06 ; 0x27f06 30d4a: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30d4c: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 30d50: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 30d54: 8f 3f cpi r24, 0xFF ; 255 30d56: 69 f4 brne .+26 ; 0x30d72 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30d58: 0f 94 83 3f call 0x27f06 ; 0x27f06 30d5c: 60 1b sub r22, r16 30d5e: 71 0b sbc r23, r17 30d60: 6d 32 cpi r22, 0x2D ; 45 30d62: 71 40 sbci r23, 0x01 ; 1 30d64: 98 f3 brcs .-26 ; 0x30d4c 30d66: 81 e1 ldi r24, 0x11 ; 17 30d68: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 goto fail; } return true; fail: chipSelectHigh(); 30d6c: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 30d70: e6 cf rjmp .-52 ; 0x30d3e if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30d72: 8e 3f cpi r24, 0xFE ; 254 30d74: 11 f0 breq .+4 ; 0x30d7a 30d76: 8f e0 ldi r24, 0x0F ; 15 30d78: f7 cf rjmp .-18 ; 0x30d68 30d7a: 8e 01 movw r16, r28 30d7c: 0c 5f subi r16, 0xFC ; 252 30d7e: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30d80: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 30d84: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30d86: c0 17 cp r28, r16 30d88: d1 07 cpc r29, r17 30d8a: d1 f7 brne .-12 ; 0x30d80 30d8c: ce ef ldi r28, 0xFE ; 254 30d8e: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30d90: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 30d94: 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) { 30d96: e1 f7 brne .-8 ; 0x30d90 spiRec(); } chipSelectHigh(); 30d98: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30d9c: 8f ef ldi r24, 0xFF ; 255 30d9e: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 30da2: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30da4: df 91 pop r29 30da6: cf 91 pop r28 30da8: 1f 91 pop r17 30daa: 0f 91 pop r16 30dac: 08 95 ret 00030dae : } 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) 30dae: 8f 92 push r8 30db0: 9f 92 push r9 30db2: af 92 push r10 30db4: bf 92 push r11 30db6: cf 92 push r12 30db8: df 92 push r13 30dba: ef 92 push r14 30dbc: ff 92 push r15 30dbe: 0f 93 push r16 30dc0: 1f 93 push r17 30dc2: cf 93 push r28 30dc4: df 93 push r29 30dc6: 1f 92 push r1 30dc8: cd b7 in r28, 0x3d ; 61 30dca: de b7 in r29, 0x3e ; 62 30dcc: 6b 01 movw r12, r22 30dce: 7c 01 movw r14, r24 30dd0: 49 01 movw r8, r18 30dd2: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30dd4: 03 30 cpi r16, 0x03 ; 3 30dd6: 19 f4 brne .+6 ; 0x30dde SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30dd8: 8c e5 ldi r24, 0x5C ; 92 30dda: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30ddc: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30dde: 81 14 cp r8, r1 30de0: 91 04 cpc r9, r1 30de2: a1 04 cpc r10, r1 30de4: b1 04 cpc r11, r1 30de6: 09 f4 brne .+2 ; 0x30dea 30de8: 59 c0 rjmp .+178 ; 0x30e9c #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30dea: 8e 2d mov r24, r14 30dec: 0e 94 34 78 call 0xf068 ; 0xf068 #endif print_hex_byte((val >> 8) & 0xFF); 30df0: 8d 2d mov r24, r13 30df2: 0e 94 34 78 call 0xf068 ; 0xf068 print_hex_byte(val & 0xFF); 30df6: 8c 2d mov r24, r12 30df8: 0e 94 34 78 call 0xf068 ; 0xf068 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30dfc: 60 91 13 18 lds r22, 0x1813 ; 0x801813 <__iob+0x2> 30e00: 70 91 14 18 lds r23, 0x1814 ; 0x801814 <__iob+0x3> 30e04: 80 e2 ldi r24, 0x20 ; 32 30e06: 90 e0 ldi r25, 0x00 ; 0 30e08: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 uint8_t count_line = countperline; 30e0c: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30e0e: 19 82 std Y+1, r1 ; 0x01 switch (type) 30e10: 01 30 cpi r16, 0x01 ; 1 30e12: b1 f1 breq .+108 ; 0x30e80 30e14: 88 f1 brcs .+98 ; 0x30e78 30e16: 03 30 cpi r16, 0x03 ; 3 30e18: b9 f1 breq .+110 ; 0x30e88 case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30e1a: 8f ef ldi r24, 0xFF ; 255 30e1c: c8 1a sub r12, r24 30e1e: d8 0a sbc r13, r24 30e20: e8 0a sbc r14, r24 30e22: f8 0a sbc r15, r24 putchar(' '); 30e24: 60 91 13 18 lds r22, 0x1813 ; 0x801813 <__iob+0x2> 30e28: 70 91 14 18 lds r23, 0x1814 ; 0x801814 <__iob+0x3> 30e2c: 80 e2 ldi r24, 0x20 ; 32 30e2e: 90 e0 ldi r25, 0x00 ; 0 30e30: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 print_hex_byte(data); 30e34: 89 81 ldd r24, Y+1 ; 0x01 30e36: 0e 94 34 78 call 0xf068 ; 0xf068 count_line--; 30e3a: 11 50 subi r17, 0x01 ; 1 count--; 30e3c: 81 e0 ldi r24, 0x01 ; 1 30e3e: 88 1a sub r8, r24 30e40: 91 08 sbc r9, r1 30e42: a1 08 sbc r10, r1 30e44: 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)) 30e46: 0f b6 in r0, 0x3f ; 63 30e48: 07 fe sbrs r0, 7 30e4a: 06 c0 rjmp .+12 ; 0x30e58 30e4c: c4 01 movw r24, r8 30e4e: 9f 71 andi r25, 0x1F ; 31 30e50: 89 2b or r24, r25 30e52: 11 f4 brne .+4 ; 0x30e58 manage_heater(); 30e54: 0f 94 98 4e call 0x29d30 ; 0x29d30 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30e58: 81 14 cp r8, r1 30e5a: 91 04 cpc r9, r1 30e5c: a1 04 cpc r10, r1 30e5e: b1 04 cpc r11, r1 30e60: 11 f0 breq .+4 ; 0x30e66 30e62: 11 11 cpse r17, r1 30e64: d4 cf rjmp .-88 ; 0x30e0e // 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'); 30e66: 60 91 13 18 lds r22, 0x1813 ; 0x801813 <__iob+0x2> 30e6a: 70 91 14 18 lds r23, 0x1814 ; 0x801814 <__iob+0x3> 30e6e: 8a e0 ldi r24, 0x0A ; 10 30e70: 90 e0 ldi r25, 0x00 ; 0 30e72: 0f 94 f1 db call 0x3b7e2 ; 0x3b7e2 30e76: b3 cf rjmp .-154 ; 0x30dde while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30e78: f6 01 movw r30, r12 30e7a: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30e7c: 89 83 std Y+1, r24 ; 0x01 30e7e: cd cf rjmp .-102 ; 0x30e1a 30e80: c6 01 movw r24, r12 30e82: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 30e86: fa cf rjmp .-12 ; 0x30e7c 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; 30e88: 21 e0 ldi r18, 0x01 ; 1 30e8a: 30 e0 ldi r19, 0x00 ; 0 30e8c: ae 01 movw r20, r28 30e8e: 4f 5f subi r20, 0xFF ; 255 30e90: 5f 4f sbci r21, 0xFF ; 255 30e92: c7 01 movw r24, r14 30e94: b6 01 movw r22, r12 30e96: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc 30e9a: bf cf rjmp .-130 ; 0x30e1a if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30e9c: 0f 90 pop r0 30e9e: df 91 pop r29 30ea0: cf 91 pop r28 30ea2: 1f 91 pop r17 30ea4: 0f 91 pop r16 30ea6: ff 90 pop r15 30ea8: ef 90 pop r14 30eaa: df 90 pop r13 30eac: cf 90 pop r12 30eae: bf 90 pop r11 30eb0: af 90 pop r10 30eb2: 9f 90 pop r9 30eb4: 8f 90 pop r8 30eb6: 08 95 ret 00030eb8 : 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 30eb8: e7 e0 ldi r30, 0x07 ; 7 30eba: f1 e0 ldi r31, 0x01 ; 1 30ebc: 80 81 ld r24, Z 30ebe: 8e 7f andi r24, 0xFE ; 254 30ec0: 80 83 st Z, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup 30ec2: 9f b7 in r25, 0x3f ; 63 30ec4: f8 94 cli 30ec6: e8 e0 ldi r30, 0x08 ; 8 30ec8: f1 e0 ldi r31, 0x01 ; 1 30eca: 80 81 ld r24, Z 30ecc: 8e 7f andi r24, 0xFE ; 254 30ece: 80 83 st Z, r24 30ed0: 9f bf out 0x3f, r25 ; 63 state = State::disabled; 30ed2: 10 92 86 17 sts 0x1786, r1 ; 0x801786 } 30ed6: 08 95 ret 00030ed8 : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 30ed8: 80 91 86 17 lds r24, 0x1786 ; 0x801786 30edc: 83 30 cpi r24, 0x03 ; 3 30ede: 11 f4 brne .+4 ; 0x30ee4 fsensor.deinit(); // deinit first if there was an error. 30ee0: 0f 94 5c 87 call 0x30eb8 ; 0x30eb8 } // puts_P(PSTR("fsensor::init()")); SET_INPUT(IR_SENSOR_PIN); // input mode 30ee4: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 30ee8: 8e 7f andi r24, 0xFE ; 254 30eea: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 30eee: 9f b7 in r25, 0x3f ; 63 30ef0: f8 94 cli 30ef2: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30ef6: 81 60 ori r24, 0x01 ; 1 30ef8: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30efc: 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(); } 30efe: 86 e8 ldi r24, 0x86 ; 134 30f00: 97 e1 ldi r25, 0x17 ; 23 30f02: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 30f06: 86 e8 ldi r24, 0x86 ; 134 30f08: 97 e1 ldi r25, 0x17 ; 23 30f0a: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 #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); 30f0e: 88 e4 ldi r24, 0x48 ; 72 30f10: 9d e0 ldi r25, 0x0D ; 13 30f12: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 30f16: 80 93 8f 17 sts 0x178F, r24 ; 0x80178f } 30f1a: 08 95 ret 00030f1c : //! //! @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) 30f1c: cf 92 push r12 30f1e: df 92 push r13 30f20: ef 92 push r14 30f22: ff 92 push r15 30f24: 69 01 movw r12, r18 30f26: 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); 30f28: 2d ec ldi r18, 0xCD ; 205 30f2a: 3c ec ldi r19, 0xCC ; 204 30f2c: 4c e4 ldi r20, 0x4C ; 76 30f2e: 5e e3 ldi r21, 0x3E ; 62 30f30: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 30f34: 2d ec ldi r18, 0xCD ; 205 30f36: 3c ec ldi r19, 0xCC ; 204 30f38: 4c e4 ldi r20, 0x4C ; 76 30f3a: 5e e3 ldi r21, 0x3E ; 62 30f3c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 30f40: 2d ef ldi r18, 0xFD ; 253 30f42: 3d ea ldi r19, 0xAD ; 173 30f44: 40 e0 ldi r20, 0x00 ; 0 30f46: 5d e3 ldi r21, 0x3D ; 61 30f48: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 30f4c: a7 01 movw r20, r14 30f4e: 96 01 movw r18, r12 30f50: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 30f54: 24 e2 ldi r18, 0x24 ; 36 30f56: 30 ef ldi r19, 0xF0 ; 240 30f58: 49 e1 ldi r20, 0x19 ; 25 30f5a: 50 e4 ldi r21, 0x40 ; 64 30f5c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> } 30f60: ff 90 pop r15 30f62: ef 90 pop r14 30f64: df 90 pop r13 30f66: cf 90 pop r12 30f68: 08 95 ret 00030f6a : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 30f6a: 9f b7 in r25, 0x3f ; 63 30f6c: 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)); 30f6e: 80 e1 ldi r24, 0x10 ; 16 30f70: e2 e5 ldi r30, 0x52 ; 82 30f72: f7 e0 ldi r31, 0x07 ; 7 30f74: a2 e6 ldi r26, 0x62 ; 98 30f76: b7 e0 ldi r27, 0x07 ; 7 30f78: 01 90 ld r0, Z+ 30f7a: 0d 92 st X+, r0 30f7c: 8a 95 dec r24 30f7e: e1 f7 brne .-8 ; 0x30f78 CRITICAL_SECTION_END; 30f80: 9f bf out 0x3f, r25 ; 63 } 30f82: 08 95 ret 00030f84 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 30f84: 89 e0 ldi r24, 0x09 ; 9 30f86: 80 93 73 07 sts 0x0773, r24 ; 0x800773 }; 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])) 30f8a: e5 ec ldi r30, 0xC5 ; 197 30f8c: f6 ea ldi r31, 0xA6 ; 166 30f8e: 85 91 lpm r24, Z+ 30f90: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 30f92: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 30f96: 0d 94 e2 0b jmp 0x217c4 ; 0x217c4 00030f9a : 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){ 30f9a: cf 93 push r28 30f9c: c8 2f mov r28, r24 extruder = ex; 30f9e: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 30fa2: 82 ee ldi r24, 0xE2 ; 226 30fa4: 99 ea ldi r25, 0xA9 ; 169 30fa6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 30faa: 87 e9 ldi r24, 0x97 ; 151 30fac: 96 ea ldi r25, 0xA6 ; 166 30fae: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 30fb2: 8d e8 ldi r24, 0x8D ; 141 30fb4: 96 ea ldi r25, 0xA6 ; 166 30fb6: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN((int)ex); 30fba: 8c 2f mov r24, r28 30fbc: 90 e0 ldi r25, 0x00 ; 0 } 30fbe: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 30fc0: 0d 94 11 77 jmp 0x2ee22 ; 0x2ee22 00030fc4 : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 30fc4: 0f 93 push r16 30fc6: 1f 93 push r17 30fc8: cf 93 push r28 30fca: df 93 push r29 30fcc: 00 d0 rcall .+0 ; 0x30fce 30fce: 00 d0 rcall .+0 ; 0x30fd0 30fd0: 1f 92 push r1 30fd2: 1f 92 push r1 30fd4: cd b7 in r28, 0x3d ; 61 30fd6: de b7 in r29, 0x3e ; 62 30fd8: 08 ee ldi r16, 0xE8 ; 232 30fda: 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; 30fdc: 1d 82 std Y+5, r1 ; 0x05 30fde: 1e 82 std Y+6, r1 ; 0x06 30fe0: 1f 82 std Y+7, r1 ; 0x07 30fe2: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 30fe4: 19 82 std Y+1, r1 ; 0x01 30fe6: 1a 82 std Y+2, r1 ; 0x02 30fe8: 1b 82 std Y+3, r1 ; 0x03 30fea: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 30fec: ae 01 movw r20, r28 30fee: 4b 5f subi r20, 0xFB ; 251 30ff0: 5f 4f sbci r21, 0xFF ; 255 30ff2: 6f e6 ldi r22, 0x6F ; 111 30ff4: 80 e0 ldi r24, 0x00 ; 0 30ff6: 0f 94 a4 39 call 0x27348 ; 0x27348 tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 30ffa: ae 01 movw r20, r28 30ffc: 4f 5f subi r20, 0xFF ; 255 30ffe: 5f 4f sbci r21, 0xFF ; 255 31000: 6f e6 ldi r22, 0x6F ; 111 31002: 81 e0 ldi r24, 0x01 ; 1 31004: 0f 94 a4 39 call 0x27348 ; 0x27348 // 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); 31008: 8d 81 ldd r24, Y+5 ; 0x05 3100a: 9e 81 ldd r25, Y+6 ; 0x06 3100c: af 81 ldd r26, Y+7 ; 0x07 3100e: b8 85 ldd r27, Y+8 ; 0x08 31010: b7 fd sbrc r27, 7 31012: 07 c0 rjmp .+14 ; 0x31022 tmc2130_check_overtemp(); 31014: 0f 94 1e 40 call 0x2803c ; 0x2803c 31018: 01 50 subi r16, 0x01 ; 1 3101a: 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)) 3101c: f9 f6 brne .-66 ; 0x30fdc 3101e: 80 e0 ldi r24, 0x00 ; 0 31020: 09 c0 rjmp .+18 ; 0x31034 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); 31022: 89 81 ldd r24, Y+1 ; 0x01 31024: 9a 81 ldd r25, Y+2 ; 0x02 31026: ab 81 ldd r26, Y+3 ; 0x03 31028: bc 81 ldd r27, Y+4 ; 0x04 3102a: b7 ff sbrs r27, 7 3102c: f3 cf rjmp .-26 ; 0x31014 tmc2130_check_overtemp(); 3102e: 0f 94 1e 40 call 0x2803c ; 0x2803c 31032: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 31034: 28 96 adiw r28, 0x08 ; 8 31036: 0f b6 in r0, 0x3f ; 63 31038: f8 94 cli 3103a: de bf out 0x3e, r29 ; 62 3103c: 0f be out 0x3f, r0 ; 63 3103e: cd bf out 0x3d, r28 ; 61 31040: df 91 pop r29 31042: cf 91 pop r28 31044: 1f 91 pop r17 31046: 0f 91 pop r16 31048: 08 95 ret 0003104a : 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) { 3104a: 1f 93 push r17 3104c: cf 93 push r28 3104e: df 93 push r29 31050: ec 01 movw r28, r24 31052: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 31054: 0f 94 24 59 call 0x2b248 ; 0x2b248 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))); 31058: fe 01 movw r30, r28 3105a: 34 96 adiw r30, 0x04 ; 4 3105c: 25 91 lpm r18, Z+ 3105e: 35 91 lpm r19, Z+ 31060: 45 91 lpm r20, Z+ 31062: 54 91 lpm r21, Z 31064: fe 01 movw r30, r28 31066: 65 91 lpm r22, Z+ 31068: 75 91 lpm r23, Z+ 3106a: 85 91 lpm r24, Z+ 3106c: 94 91 lpm r25, Z 3106e: 0f 94 28 c3 call 0x38650 ; 0x38650 step++; 31072: 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) { 31074: 11 50 subi r17, 0x01 ; 1 31076: 81 f7 brne .-32 ; 0x31058 31078: 0f 94 24 59 call 0x2b248 ; 0x2b248 // 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(); } 3107c: df 91 pop r29 3107e: cf 91 pop r28 31080: 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(); 31082: 0d 94 26 c3 jmp 0x3864c ; 0x3864c 00031086 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 31086: 0e 94 3d 68 call 0xd07a ; 0xd07a 3108a: 81 11 cpse r24, r1 3108c: 04 c0 rjmp .+8 ; 0x31096 lcd_setstatuspgm(MSG_WELCOME); 3108e: 8a e6 ldi r24, 0x6A ; 106 31090: 90 e7 ldi r25, 0x70 ; 112 31092: 0f 94 e2 0b call 0x217c4 ; 0x217c4 } custom_message_type = CustomMsg::Status; 31096: 10 92 73 07 sts 0x0773, r1 ; 0x800773 } 3109a: 08 95 ret 0003109c : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 3109c: 80 91 96 13 lds r24, 0x1396 ; 0x801396 310a0: 88 23 and r24, r24 310a2: 11 f0 breq .+4 ; 0x310a8 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; 310a4: 81 e0 ldi r24, 0x01 ; 1 310a6: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 310a8: 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; } } 310aa: 08 95 ret 000310ac : } 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) 310ac: 2f 92 push r2 310ae: 3f 92 push r3 310b0: 4f 92 push r4 310b2: 5f 92 push r5 310b4: 6f 92 push r6 310b6: 7f 92 push r7 310b8: 8f 92 push r8 310ba: 9f 92 push r9 310bc: af 92 push r10 310be: bf 92 push r11 310c0: cf 92 push r12 310c2: df 92 push r13 310c4: ef 92 push r14 310c6: ff 92 push r15 310c8: 0f 93 push r16 310ca: 1f 93 push r17 310cc: cf 93 push r28 310ce: df 93 push r29 310d0: cd b7 in r28, 0x3d ; 61 310d2: de b7 in r29, 0x3e ; 62 310d4: 2d 97 sbiw r28, 0x0d ; 13 310d6: 0f b6 in r0, 0x3f ; 63 310d8: f8 94 cli 310da: de bf out 0x3e, r29 ; 62 310dc: 0f be out 0x3f, r0 ; 63 310de: cd bf out 0x3d, r28 ; 61 310e0: 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; 310e2: 41 2c mov r4, r1 310e4: 51 2c mov r5, r1 310e6: 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; 310e8: 6e 31 cpi r22, 0x1E ; 30 310ea: 90 f0 brcs .+36 ; 0x31110 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 310ec: 69 3c cpi r22, 0xC9 ; 201 310ee: 08 f0 brcs .+2 ; 0x310f2 310f0: 68 ec ldi r22, 0xC8 ; 200 310f2: 70 e0 ldi r23, 0x00 ; 0 310f4: 68 51 subi r22, 0x18 ; 24 310f6: 7c 4f sbci r23, 0xFC ; 252 310f8: 90 e0 ldi r25, 0x00 ; 0 310fa: 80 e0 ldi r24, 0x00 ; 0 310fc: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 31100: 20 e0 ldi r18, 0x00 ; 0 31102: 30 e0 ldi r19, 0x00 ; 0 31104: 4a e7 ldi r20, 0x7A ; 122 31106: 54 e4 ldi r21, 0x44 ; 68 31108: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 3110c: 2b 01 movw r4, r22 3110e: 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) 31110: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 31114: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 31118: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 3111c: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 31120: 89 83 std Y+1, r24 ; 0x01 31122: 9a 83 std Y+2, r25 ; 0x02 31124: ab 83 std Y+3, r26 ; 0x03 31126: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 31128: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 3112c: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 31130: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 31134: 8d 83 std Y+5, r24 ; 0x05 31136: 9e 83 std Y+6, r25 ; 0x06 31138: 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); 3113a: 20 e0 ldi r18, 0x00 ; 0 3113c: 30 e0 ldi r19, 0x00 ; 0 3113e: 47 ef ldi r20, 0xF7 ; 247 31140: 50 e0 ldi r21, 0x00 ; 0 31142: 69 ee ldi r22, 0xE9 ; 233 31144: 8e 2d mov r24, r14 31146: 0f 94 fe 39 call 0x273fc ; 0x273fc 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 3114a: 81 2c mov r8, r1 3114c: 91 2c mov r9, r1 3114e: 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 31150: 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 31152: 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 31154: 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 31156: 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 31158: 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) 3115a: 2f 2c mov r2, r15 3115c: 31 2c mov r3, r1 3115e: 8f 2d mov r24, r15 31160: 8f 71 andi r24, 0x1F ; 31 31162: 88 87 std Y+8, r24 ; 0x08 31164: 81 11 cpse r24, r1 31166: 03 c0 rjmp .+6 ; 0x3116e reg = 0; 31168: 81 2c mov r8, r1 3116a: 91 2c mov r9, r1 3116c: 54 01 movw r10, r8 3116e: b1 01 movw r22, r2 31170: 03 2c mov r0, r3 31172: 00 0c add r0, r0 31174: 88 0b sbc r24, r24 31176: 99 0b sbc r25, r25 31178: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3117c: 2b ed ldi r18, 0xDB ; 219 3117e: 3f e0 ldi r19, 0x0F ; 15 31180: 49 ec ldi r20, 0xC9 ; 201 31182: 50 e4 ldi r21, 0x40 ; 64 31184: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31188: 6a 87 std Y+10, r22 ; 0x0a 3118a: 7b 87 std Y+11, r23 ; 0x0b 3118c: 8c 87 std Y+12, r24 ; 0x0c 3118e: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 31190: 20 e0 ldi r18, 0x00 ; 0 31192: 30 e0 ldi r19, 0x00 ; 0 31194: a9 01 movw r20, r18 31196: c3 01 movw r24, r6 31198: b2 01 movw r22, r4 3119a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3119e: 81 11 cpse r24, r1 311a0: 4d c0 rjmp .+154 ; 0x3123c vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 311a2: 2b ed ldi r18, 0xDB ; 219 311a4: 3f e0 ldi r19, 0x0F ; 15 311a6: 49 e4 ldi r20, 0x49 ; 73 311a8: 50 e4 ldi r21, 0x40 ; 64 311aa: 6a 85 ldd r22, Y+10 ; 0x0a 311ac: 7b 85 ldd r23, Y+11 ; 0x0b 311ae: 8c 85 ldd r24, Y+12 ; 0x0c 311b0: 9d 85 ldd r25, Y+13 ; 0x0d 311b2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 311b6: 20 e0 ldi r18, 0x00 ; 0 311b8: 30 e0 ldi r19, 0x00 ; 0 311ba: 40 e8 ldi r20, 0x80 ; 128 311bc: 5a e3 ldi r21, 0x3A ; 58 311be: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 311c2: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 311c6: 20 e0 ldi r18, 0x00 ; 0 311c8: 30 e0 ldi r19, 0x00 ; 0 311ca: 48 e7 ldi r20, 0x78 ; 120 311cc: 53 e4 ldi r21, 0x43 ; 67 311ce: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 311d2: 20 e0 ldi r18, 0x00 ; 0 311d4: 30 e0 ldi r19, 0x00 ; 0 311d6: 40 e0 ldi r20, 0x00 ; 0 311d8: 5f e3 ldi r21, 0x3F ; 63 311da: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 311de: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 311e2: cc 24 eor r12, r12 311e4: ca 94 dec r12 311e6: 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 311e8: 8c 2d mov r24, r12 311ea: 99 85 ldd r25, Y+9 ; 0x09 311ec: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 311ee: 8d 15 cp r24, r13 311f0: f9 f0 breq .+62 ; 0x31230 else if (dA == d1) b = 1; //delta == delta1 => bit=1 311f2: 80 17 cp r24, r16 311f4: 09 f4 brne .+2 ; 0x311f8 311f6: 71 c0 rjmp .+226 ; 0x312da else { if (dA < d0) // delta < delta0 => switch wbit down 311f8: 8d 15 cp r24, r13 311fa: 0c f0 brlt .+2 ; 0x311fe 311fc: 53 c0 rjmp .+166 ; 0x312a4 { //printf("dn\n"); b = 0; switch (dA) 311fe: 88 23 and r24, r24 31200: e9 f1 breq .+122 ; 0x3127c 31202: 81 30 cpi r24, 0x01 ; 1 31204: 09 f4 brne .+2 ; 0x31208 31206: 44 c0 rjmp .+136 ; 0x31290 31208: 8f 3f cpi r24, 0xFF ; 255 3120a: 09 f0 breq .+2 ; 0x3120e 3120c: 81 c0 rjmp .+258 ; 0x31310 { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 3120e: e2 e0 ldi r30, 0x02 ; 2 31210: f0 e0 ldi r31, 0x00 ; 0 31212: ec 0f add r30, r28 31214: fd 1f adc r31, r29 31216: e1 0f add r30, r17 31218: f1 1d adc r31, r1 3121a: 10 82 st Z, r1 3121c: 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++; } 3121e: e5 e0 ldi r30, 0x05 ; 5 31220: f0 e0 ldi r31, 0x00 ; 0 31222: ec 0f add r30, r28 31224: fd 1f adc r31, r29 31226: e1 0f add r30, r17 31228: f1 1d adc r31, r1 3122a: f0 82 st Z, r15 3122c: 1f 5f subi r17, 0xFF ; 255 3122e: 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) 31230: 14 30 cpi r17, 0x04 ; 4 31232: 08 f4 brcc .+2 ; 0x31236 31234: 56 c0 rjmp .+172 ; 0x312e2 31236: 6c c0 rjmp .+216 ; 0x31310 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); 31238: f8 2e mov r15, r24 3123a: 8f cf rjmp .-226 ; 0x3115a 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); 3123c: 20 e0 ldi r18, 0x00 ; 0 3123e: 30 e0 ldi r19, 0x00 ; 0 31240: 40 e8 ldi r20, 0x80 ; 128 31242: 5a e3 ldi r21, 0x3A ; 58 31244: 6a 85 ldd r22, Y+10 ; 0x0a 31246: 7b 85 ldd r23, Y+11 ; 0x0b 31248: 8c 85 ldd r24, Y+12 ; 0x0c 3124a: 9d 85 ldd r25, Y+13 ; 0x0d 3124c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31250: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 31254: a3 01 movw r20, r6 31256: 92 01 movw r18, r4 31258: 0f 94 21 e2 call 0x3c442 ; 0x3c442 3125c: 20 e0 ldi r18, 0x00 ; 0 3125e: 30 e0 ldi r19, 0x00 ; 0 31260: 47 e7 ldi r20, 0x77 ; 119 31262: 53 e4 ldi r21, 0x43 ; 67 31264: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31268: 20 e0 ldi r18, 0x00 ; 0 3126a: 30 e0 ldi r19, 0x00 ; 0 3126c: 40 e0 ldi r20, 0x00 ; 0 3126e: 5f e3 ldi r21, 0x3F ; 63 31270: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31274: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 31278: c6 2e mov r12, r22 3127a: b6 cf rjmp .-148 ; 0x311e8 //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; 3127c: e2 e0 ldi r30, 0x02 ; 2 3127e: f0 e0 ldi r31, 0x00 ; 0 31280: ec 0f add r30, r28 31282: fd 1f adc r31, r29 31284: e1 0f add r30, r17 31286: f1 1d adc r31, r1 31288: 91 e0 ldi r25, 0x01 ; 1 3128a: 90 83 st Z, r25 3128c: 01 e0 ldi r16, 0x01 ; 1 3128e: c7 cf rjmp .-114 ; 0x3121e case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 31290: e2 e0 ldi r30, 0x02 ; 2 31292: f0 e0 ldi r31, 0x00 ; 0 31294: ec 0f add r30, r28 31296: fd 1f adc r31, r29 31298: e1 0f add r30, r17 3129a: f1 1d adc r31, r1 3129c: 92 e0 ldi r25, 0x02 ; 2 3129e: 90 83 st Z, r25 312a0: 02 e0 ldi r16, 0x02 ; 2 312a2: bd cf rjmp .-134 ; 0x3121e default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 312a4: 08 17 cp r16, r24 312a6: a4 f5 brge .+104 ; 0x31310 { //printf("up\n"); b = 1; switch (dA) 312a8: 82 30 cpi r24, 0x02 ; 2 312aa: 09 f4 brne .+2 ; 0x312ae 312ac: 80 c0 rjmp .+256 ; 0x313ae 312ae: 83 30 cpi r24, 0x03 ; 3 312b0: 09 f4 brne .+2 ; 0x312b4 312b2: 88 c0 rjmp .+272 ; 0x313c4 312b4: 81 30 cpi r24, 0x01 ; 1 312b6: 61 f5 brne .+88 ; 0x31310 { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 312b8: e2 e0 ldi r30, 0x02 ; 2 312ba: f0 e0 ldi r31, 0x00 ; 0 312bc: ec 0f add r30, r28 312be: fd 1f adc r31, r29 312c0: e1 0f add r30, r17 312c2: f1 1d adc r31, r1 312c4: 80 83 st Z, r24 312c6: 01 e0 ldi r16, 0x01 ; 1 312c8: 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++; } 312ca: e5 e0 ldi r30, 0x05 ; 5 312cc: f0 e0 ldi r31, 0x00 ; 0 312ce: ec 0f add r30, r28 312d0: fd 1f adc r31, r29 312d2: e1 0f add r30, r17 312d4: f1 1d adc r31, r1 312d6: f0 82 st Z, r15 312d8: 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) 312da: 14 30 cpi r17, 0x04 ; 4 312dc: c8 f4 brcc .+50 ; 0x31310 //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 312de: 68 94 set 312e0: b7 f8 bld r11, 7 if ((i & 31) == 31) 312e2: 88 85 ldd r24, Y+8 ; 0x08 312e4: 8f 31 cpi r24, 0x1F ; 31 312e6: 09 f0 breq .+2 ; 0x312ea 312e8: 78 c0 rjmp .+240 ; 0x313da tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 312ea: b1 01 movw r22, r2 312ec: e5 e0 ldi r30, 0x05 ; 5 312ee: 75 95 asr r23 312f0: 67 95 ror r22 312f2: ea 95 dec r30 312f4: e1 f7 brne .-8 ; 0x312ee //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); 312f6: 60 5a subi r22, 0xA0 ; 160 312f8: 60 68 ori r22, 0x80 ; 128 312fa: a5 01 movw r20, r10 312fc: 94 01 movw r18, r8 312fe: 8e 2d mov r24, r14 31300: 0f 94 fe 39 call 0x273fc ; 0x273fc 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); 31304: 81 e0 ldi r24, 0x01 ; 1 31306: 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; 31308: 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); 3130a: 9f ef ldi r25, 0xFF ; 255 3130c: f9 12 cpse r15, r25 3130e: 94 cf rjmp .-216 ; 0x31238 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; 31310: 2a 81 ldd r18, Y+2 ; 0x02 31312: 30 e0 ldi r19, 0x00 ; 0 31314: 50 e0 ldi r21, 0x00 ; 0 31316: 40 e0 ldi r20, 0x00 ; 0 31318: 82 e0 ldi r24, 0x02 ; 2 3131a: 22 0f add r18, r18 3131c: 33 1f adc r19, r19 3131e: 44 1f adc r20, r20 31320: 55 1f adc r21, r21 31322: 8a 95 dec r24 31324: d1 f7 brne .-12 ; 0x3131a val |= ((uint32_t)w2) << 4; 31326: 8b 80 ldd r8, Y+3 ; 0x03 31328: 91 2c mov r9, r1 3132a: b1 2c mov r11, r1 3132c: a1 2c mov r10, r1 3132e: 94 e0 ldi r25, 0x04 ; 4 31330: 88 0c add r8, r8 31332: 99 1c adc r9, r9 31334: aa 1c adc r10, r10 31336: bb 1c adc r11, r11 31338: 9a 95 dec r25 3133a: d1 f7 brne .-12 ; 0x31330 3133c: 82 2a or r8, r18 3133e: 93 2a or r9, r19 31340: a4 2a or r10, r20 31342: 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); 31344: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 31346: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 31348: 8c 81 ldd r24, Y+4 ; 0x04 3134a: 90 e0 ldi r25, 0x00 ; 0 3134c: b0 e0 ldi r27, 0x00 ; 0 3134e: a0 e0 ldi r26, 0x00 ; 0 31350: 9c 01 movw r18, r24 31352: ad 01 movw r20, r26 31354: 66 e0 ldi r22, 0x06 ; 6 31356: 22 0f add r18, r18 31358: 33 1f adc r19, r19 3135a: 44 1f adc r20, r20 3135c: 55 1f adc r21, r21 3135e: 6a 95 dec r22 31360: d1 f7 brne .-12 ; 0x31356 31362: 28 29 or r18, r8 31364: 39 29 or r19, r9 31366: 4a 29 or r20, r10 31368: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 3136a: 8d 81 ldd r24, Y+5 ; 0x05 3136c: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 3136e: 8e 81 ldd r24, Y+6 ; 0x06 31370: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 31372: 8f 81 ldd r24, Y+7 ; 0x07 31374: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 31376: 68 ee ldi r22, 0xE8 ; 232 31378: 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]); } 3137a: 2d 96 adiw r28, 0x0d ; 13 3137c: 0f b6 in r0, 0x3f ; 63 3137e: f8 94 cli 31380: de bf out 0x3e, r29 ; 62 31382: 0f be out 0x3f, r0 ; 63 31384: cd bf out 0x3d, r28 ; 61 31386: df 91 pop r29 31388: cf 91 pop r28 3138a: 1f 91 pop r17 3138c: 0f 91 pop r16 3138e: ff 90 pop r15 31390: ef 90 pop r14 31392: df 90 pop r13 31394: cf 90 pop r12 31396: bf 90 pop r11 31398: af 90 pop r10 3139a: 9f 90 pop r9 3139c: 8f 90 pop r8 3139e: 7f 90 pop r7 313a0: 6f 90 pop r6 313a2: 5f 90 pop r5 313a4: 4f 90 pop r4 313a6: 3f 90 pop r3 313a8: 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); 313aa: 0d 94 fe 39 jmp 0x273fc ; 0x273fc //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; 313ae: e2 e0 ldi r30, 0x02 ; 2 313b0: f0 e0 ldi r31, 0x00 ; 0 313b2: ec 0f add r30, r28 313b4: fd 1f adc r31, r29 313b6: e1 0f add r30, r17 313b8: f1 1d adc r31, r1 313ba: 80 83 st Z, r24 313bc: 02 e0 ldi r16, 0x02 ; 2 313be: dd 24 eor r13, r13 313c0: d3 94 inc r13 313c2: 83 cf rjmp .-250 ; 0x312ca case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 313c4: e2 e0 ldi r30, 0x02 ; 2 313c6: f0 e0 ldi r31, 0x00 ; 0 313c8: ec 0f add r30, r28 313ca: fd 1f adc r31, r29 313cc: e1 0f add r30, r17 313ce: f1 1d adc r31, r1 313d0: 80 83 st Z, r24 313d2: 03 e0 ldi r16, 0x03 ; 3 313d4: f2 e0 ldi r31, 0x02 ; 2 313d6: df 2e mov r13, r31 313d8: 78 cf rjmp .-272 ; 0x312ca //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; 313da: b6 94 lsr r11 313dc: a7 94 ror r10 313de: 97 94 ror r9 313e0: 87 94 ror r8 313e2: 90 cf rjmp .-224 ; 0x31304 000313e4 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 313e4: 8f 92 push r8 313e6: 9f 92 push r9 313e8: af 92 push r10 313ea: bf 92 push r11 313ec: cf 92 push r12 313ee: df 92 push r13 313f0: ef 92 push r14 313f2: ff 92 push r15 313f4: 90 91 3d 07 lds r25, 0x073D ; 0x80073d // 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]) { 313f8: 88 23 and r24, r24 313fa: 09 f4 brne .+2 ; 0x313fe 313fc: 9d c0 rjmp .+314 ; 0x31538 313fe: 91 11 cpse r25, r1 31400: 92 c0 rjmp .+292 ; 0x31526 st_synchronize(); 31402: 0f 94 24 59 call 0x2b248 ; 0x2b248 set_destination_to_current(); 31406: 0e 94 e7 68 call 0xd1ce ; 0xd1ce current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 3140a: 60 91 94 02 lds r22, 0x0294 ; 0x800294 3140e: 70 91 95 02 lds r23, 0x0295 ; 0x800295 31412: 07 2e mov r0, r23 31414: 00 0c add r0, r0 31416: 88 0b sbc r24, r24 31418: 99 0b sbc r25, r25 3141a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3141e: 20 91 ef 06 lds r18, 0x06EF ; 0x8006ef 31422: 30 91 f0 06 lds r19, 0x06F0 ; 0x8006f0 31426: 40 91 f1 06 lds r20, 0x06F1 ; 0x8006f1 3142a: 50 91 f2 06 lds r21, 0x06F2 ; 0x8006f2 3142e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31432: 2a e0 ldi r18, 0x0A ; 10 31434: 37 ed ldi r19, 0xD7 ; 215 31436: 43 e2 ldi r20, 0x23 ; 35 31438: 5c e3 ldi r21, 0x3C ; 60 3143a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3143e: 20 91 4d 07 lds r18, 0x074D ; 0x80074d 31442: 30 91 4e 07 lds r19, 0x074E ; 0x80074e 31446: 40 91 4f 07 lds r20, 0x074F ; 0x80074f 3144a: 50 91 50 07 lds r21, 0x0750 ; 0x800750 3144e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31452: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 31456: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 3145a: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 3145e: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_set_e_position(current_position[E_AXIS]); 31462: 8d e4 ldi r24, 0x4D ; 77 31464: 97 e0 ldi r25, 0x07 ; 7 31466: 0f 94 dc aa call 0x355b8 ; 0x355b8 float oldFeedrate = feedrate; 3146a: c0 90 90 02 lds r12, 0x0290 ; 0x800290 3146e: d0 90 91 02 lds r13, 0x0291 ; 0x800291 31472: e0 90 92 02 lds r14, 0x0292 ; 0x800292 31476: f0 90 93 02 lds r15, 0x0293 ; 0x800293 feedrate=cs.retract_feedrate*60; 3147a: 20 e0 ldi r18, 0x00 ; 0 3147c: 30 e0 ldi r19, 0x00 ; 0 3147e: 40 e7 ldi r20, 0x70 ; 112 31480: 52 e4 ldi r21, 0x42 ; 66 31482: 60 91 f3 06 lds r22, 0x06F3 ; 0x8006f3 31486: 70 91 f4 06 lds r23, 0x06F4 ; 0x8006f4 3148a: 80 91 f5 06 lds r24, 0x06F5 ; 0x8006f5 3148e: 90 91 f6 06 lds r25, 0x06F6 ; 0x8006f6 31492: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31496: 60 93 90 02 sts 0x0290, r22 ; 0x800290 3149a: 70 93 91 02 sts 0x0291, r23 ; 0x800291 3149e: 80 93 92 02 sts 0x0292, r24 ; 0x800292 314a2: 90 93 93 02 sts 0x0293, r25 ; 0x800293 retracted[active_extruder]=true; 314a6: 81 e0 ldi r24, 0x01 ; 1 314a8: 80 93 3d 07 sts 0x073D, r24 ; 0x80073d prepare_move(); 314ac: 90 e0 ldi r25, 0x00 ; 0 314ae: 80 e0 ldi r24, 0x00 ; 0 314b0: 0e 94 b5 6c call 0xd96a ; 0xd96a if(cs.retract_zlift) { 314b4: 20 e0 ldi r18, 0x00 ; 0 314b6: 30 e0 ldi r19, 0x00 ; 0 314b8: a9 01 movw r20, r18 314ba: 60 91 f7 06 lds r22, 0x06F7 ; 0x8006f7 314be: 70 91 f8 06 lds r23, 0x06F8 ; 0x8006f8 314c2: 80 91 f9 06 lds r24, 0x06F9 ; 0x8006f9 314c6: 90 91 fa 06 lds r25, 0x06FA ; 0x8006fa 314ca: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 314ce: 88 23 and r24, r24 314d0: 11 f1 breq .+68 ; 0x31516 st_synchronize(); 314d2: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position[Z_AXIS]-=cs.retract_zlift; 314d6: 20 91 f7 06 lds r18, 0x06F7 ; 0x8006f7 314da: 30 91 f8 06 lds r19, 0x06F8 ; 0x8006f8 314de: 40 91 f9 06 lds r20, 0x06F9 ; 0x8006f9 314e2: 50 91 fa 06 lds r21, 0x06FA ; 0x8006fa 314e6: 60 91 49 07 lds r22, 0x0749 ; 0x800749 314ea: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 314ee: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 314f2: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 314f6: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 314fa: 60 93 49 07 sts 0x0749, r22 ; 0x800749 314fe: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 31502: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 31506: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c plan_set_position_curposXYZE(); 3150a: 0f 94 4b b9 call 0x37296 ; 0x37296 prepare_move(); 3150e: 90 e0 ldi r25, 0x00 ; 0 31510: 80 e0 ldi r24, 0x00 ; 0 31512: 0e 94 b5 6c call 0xd96a ; 0xd96a } feedrate = oldFeedrate; 31516: c0 92 90 02 sts 0x0290, r12 ; 0x800290 3151a: d0 92 91 02 sts 0x0291, r13 ; 0x800291 3151e: e0 92 92 02 sts 0x0292, r14 ; 0x800292 31522: 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 31526: ff 90 pop r15 31528: ef 90 pop r14 3152a: df 90 pop r13 3152c: cf 90 pop r12 3152e: bf 90 pop r11 31530: af 90 pop r10 31532: 9f 90 pop r9 31534: 8f 90 pop r8 31536: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 31538: 99 23 and r25, r25 3153a: a9 f3 breq .-22 ; 0x31526 st_synchronize(); 3153c: 0f 94 24 59 call 0x2b248 ; 0x2b248 set_destination_to_current(); 31540: 0e 94 e7 68 call 0xd1ce ; 0xd1ce float oldFeedrate = feedrate; 31544: 80 90 90 02 lds r8, 0x0290 ; 0x800290 31548: 90 90 91 02 lds r9, 0x0291 ; 0x800291 3154c: a0 90 92 02 lds r10, 0x0292 ; 0x800292 31550: b0 90 93 02 lds r11, 0x0293 ; 0x800293 feedrate=cs.retract_recover_feedrate*60; 31554: 20 e0 ldi r18, 0x00 ; 0 31556: 30 e0 ldi r19, 0x00 ; 0 31558: 40 e7 ldi r20, 0x70 ; 112 3155a: 52 e4 ldi r21, 0x42 ; 66 3155c: 60 91 ff 06 lds r22, 0x06FF ; 0x8006ff 31560: 70 91 00 07 lds r23, 0x0700 ; 0x800700 31564: 80 91 01 07 lds r24, 0x0701 ; 0x800701 31568: 90 91 02 07 lds r25, 0x0702 ; 0x800702 3156c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31570: 60 93 90 02 sts 0x0290, r22 ; 0x800290 31574: 70 93 91 02 sts 0x0291, r23 ; 0x800291 31578: 80 93 92 02 sts 0x0292, r24 ; 0x800292 3157c: 90 93 93 02 sts 0x0293, r25 ; 0x800293 if(cs.retract_zlift) { 31580: c0 90 f7 06 lds r12, 0x06F7 ; 0x8006f7 31584: d0 90 f8 06 lds r13, 0x06F8 ; 0x8006f8 31588: e0 90 f9 06 lds r14, 0x06F9 ; 0x8006f9 3158c: f0 90 fa 06 lds r15, 0x06FA ; 0x8006fa 31590: 20 e0 ldi r18, 0x00 ; 0 31592: 30 e0 ldi r19, 0x00 ; 0 31594: a9 01 movw r20, r18 31596: c7 01 movw r24, r14 31598: b6 01 movw r22, r12 3159a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3159e: 88 23 and r24, r24 315a0: e1 f0 breq .+56 ; 0x315da current_position[Z_AXIS]+=cs.retract_zlift; 315a2: a7 01 movw r20, r14 315a4: 96 01 movw r18, r12 315a6: 60 91 49 07 lds r22, 0x0749 ; 0x800749 315aa: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 315ae: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 315b2: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 315b6: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 315ba: 60 93 49 07 sts 0x0749, r22 ; 0x800749 315be: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 315c2: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 315c6: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c plan_set_position_curposXYZE(); 315ca: 0f 94 4b b9 call 0x37296 ; 0x37296 prepare_move(); 315ce: 90 e0 ldi r25, 0x00 ; 0 315d0: 80 e0 ldi r24, 0x00 ; 0 315d2: 0e 94 b5 6c call 0xd96a ; 0xd96a st_synchronize(); 315d6: 0f 94 24 59 call 0x2b248 ; 0x2b248 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 315da: 20 91 fb 06 lds r18, 0x06FB ; 0x8006fb 315de: 30 91 fc 06 lds r19, 0x06FC ; 0x8006fc 315e2: 40 91 fd 06 lds r20, 0x06FD ; 0x8006fd 315e6: 50 91 fe 06 lds r21, 0x06FE ; 0x8006fe 315ea: 60 91 ef 06 lds r22, 0x06EF ; 0x8006ef 315ee: 70 91 f0 06 lds r23, 0x06F0 ; 0x8006f0 315f2: 80 91 f1 06 lds r24, 0x06F1 ; 0x8006f1 315f6: 90 91 f2 06 lds r25, 0x06F2 ; 0x8006f2 315fa: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 315fe: 6b 01 movw r12, r22 31600: 7c 01 movw r14, r24 31602: 60 91 94 02 lds r22, 0x0294 ; 0x800294 31606: 70 91 95 02 lds r23, 0x0295 ; 0x800295 3160a: 07 2e mov r0, r23 3160c: 00 0c add r0, r0 3160e: 88 0b sbc r24, r24 31610: 99 0b sbc r25, r25 31612: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 31616: 9b 01 movw r18, r22 31618: ac 01 movw r20, r24 3161a: c7 01 movw r24, r14 3161c: b6 01 movw r22, r12 3161e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31622: 2a e0 ldi r18, 0x0A ; 10 31624: 37 ed ldi r19, 0xD7 ; 215 31626: 43 e2 ldi r20, 0x23 ; 35 31628: 5c e3 ldi r21, 0x3C ; 60 3162a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3162e: 9b 01 movw r18, r22 31630: ac 01 movw r20, r24 31632: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 31636: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 3163a: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 3163e: 90 91 50 07 lds r25, 0x0750 ; 0x800750 31642: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 31646: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 3164a: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 3164e: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 31652: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_set_e_position(current_position[E_AXIS]); 31656: 8d e4 ldi r24, 0x4D ; 77 31658: 97 e0 ldi r25, 0x07 ; 7 3165a: 0f 94 dc aa call 0x355b8 ; 0x355b8 retracted[active_extruder]=false; 3165e: 10 92 3d 07 sts 0x073D, r1 ; 0x80073d prepare_move(); 31662: 90 e0 ldi r25, 0x00 ; 0 31664: 80 e0 ldi r24, 0x00 ; 0 31666: 0e 94 b5 6c call 0xd96a ; 0xd96a feedrate = oldFeedrate; 3166a: 80 92 90 02 sts 0x0290, r8 ; 0x800290 3166e: 90 92 91 02 sts 0x0291, r9 ; 0x800291 31672: a0 92 92 02 sts 0x0292, r10 ; 0x800292 31676: b0 92 93 02 sts 0x0293, r11 ; 0x800293 3167a: 55 cf rjmp .-342 ; 0x31526 0003167c : 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) 3167c: ef 92 push r14 3167e: ff 92 push r15 31680: 0f 93 push r16 31682: 1f 93 push r17 31684: cf 93 push r28 31686: c8 2f mov r28, r24 31688: 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; 3168a: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 3168e: c1 30 cpi r28, 0x01 ; 1 31690: b9 f0 breq .+46 ; 0x316c0 31692: c2 30 cpi r28, 0x02 ; 2 31694: c1 f0 breq .+48 ; 0x316c6 { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 31696: 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) 31698: 48 17 cp r20, r24 3169a: 21 f0 breq .+8 ; 0x316a4 tmc2130_set_dir(axis, dir); 3169c: 64 2f mov r22, r20 3169e: 8c 2f mov r24, r28 316a0: 0f 94 61 39 call 0x272c2 ; 0x272c2 316a4: 8b e9 ldi r24, 0x9B ; 155 316a6: e8 2e mov r14, r24 316a8: 8f e0 ldi r24, 0x0F ; 15 316aa: f8 2e mov r15, r24 while (steps--) 316ac: 01 50 subi r16, 0x01 ; 1 316ae: 11 09 sbc r17, r1 316b0: 70 f0 brcs .+28 ; 0x316ce { tmc2130_do_step(axis); 316b2: 8c 2f mov r24, r28 316b4: 0f 94 50 39 call 0x272a0 ; 0x272a0 316b8: c7 01 movw r24, r14 316ba: 01 97 sbiw r24, 0x01 ; 1 316bc: f1 f7 brne .-4 ; 0x316ba 316be: f6 cf rjmp .-20 ; 0x316ac uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 316c0: 86 95 lsr r24 316c2: 8c 27 eor r24, r28 316c4: e8 cf rjmp .-48 ; 0x31696 case Z_AXIS: return _GET_DIR_Z; 316c6: 82 fb bst r24, 2 316c8: 88 27 eor r24, r24 316ca: 80 f9 bld r24, 0 316cc: e5 cf rjmp .-54 ; 0x31698 while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 316ce: cf 91 pop r28 316d0: 1f 91 pop r17 316d2: 0f 91 pop r16 316d4: ff 90 pop r15 316d6: ef 90 pop r14 316d8: 08 95 ret 000316da : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 316da: 8f 92 push r8 316dc: 9f 92 push r9 316de: af 92 push r10 316e0: bf 92 push r11 316e2: cf 92 push r12 316e4: df 92 push r13 316e6: ef 92 push r14 316e8: ff 92 push r15 316ea: 0f 93 push r16 316ec: 1f 93 push r17 316ee: cf 93 push r28 316f0: c8 2f mov r28, r24 316f2: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 316f4: c6 2e mov r12, r22 316f6: d1 2c mov r13, r1 316f8: 1f 93 push r17 316fa: 4f 93 push r20 316fc: 83 e0 ldi r24, 0x03 ; 3 316fe: 8f 93 push r24 31700: 88 ee ldi r24, 0xE8 ; 232 31702: 8f 93 push r24 31704: 1f 92 push r1 31706: 82 e0 ldi r24, 0x02 ; 2 31708: 8f 93 push r24 3170a: 1f 92 push r1 3170c: 6f 93 push r22 3170e: 1f 92 push r1 31710: cf 93 push r28 31712: 84 e5 ldi r24, 0x54 ; 84 31714: 95 ea ldi r25, 0xA5 ; 165 31716: 9f 93 push r25 31718: 8f 93 push r24 3171a: 0f 94 4b dc call 0x3b896 ; 0x3b896 3171e: 8d b7 in r24, 0x3d ; 61 31720: 9e b7 in r25, 0x3e ; 62 31722: 0c 96 adiw r24, 0x0c ; 12 31724: 0f b6 in r0, 0x3f ; 63 31726: f8 94 cli 31728: 9e bf out 0x3e, r25 ; 62 3172a: 0f be out 0x3f, r0 ; 63 3172c: 8d bf out 0x3d, r24 ; 61 3172e: 90 e0 ldi r25, 0x00 ; 0 31730: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 31732: 40 e0 ldi r20, 0x00 ; 0 31734: 51 e0 ldi r21, 0x01 ; 1 31736: 28 2f mov r18, r24 31738: ba 01 movw r22, r20 3173a: 08 2e mov r0, r24 3173c: 02 c0 rjmp .+4 ; 0x31742 3173e: 76 95 lsr r23 31740: 67 95 ror r22 31742: 0a 94 dec r0 31744: e2 f7 brpl .-8 ; 0x3173e 31746: 06 17 cp r16, r22 31748: 17 07 cpc r17, r23 3174a: 29 f0 breq .+10 ; 0x31756 3174c: 01 96 adiw r24, 0x01 ; 1 3174e: 88 30 cpi r24, 0x08 ; 8 31750: 91 05 cpc r25, r1 31752: 89 f7 brne .-30 ; 0x31736 31754: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 31756: e2 2e mov r14, r18 31758: f1 2c mov r15, r1 3175a: 88 e0 ldi r24, 0x08 ; 8 3175c: 90 e0 ldi r25, 0x00 ; 0 3175e: 8e 19 sub r24, r14 31760: 9f 09 sbc r25, r15 31762: 24 e0 ldi r18, 0x04 ; 4 31764: 30 e0 ldi r19, 0x00 ; 0 31766: 59 01 movw r10, r18 31768: 02 c0 rjmp .+4 ; 0x3176e 3176a: aa 0c add r10, r10 3176c: bb 1c adc r11, r11 3176e: 8a 95 dec r24 31770: e2 f7 brpl .-8 ; 0x3176a uint16_t mscnt = tmc2130_rd_MSCNT(axis); 31772: 8c 2f mov r24, r28 31774: 0f 94 28 3a call 0x27450 ; 0x27450 31778: 9c 01 movw r18, r24 3177a: 90 e0 ldi r25, 0x00 ; 0 3177c: c4 30 cpi r28, 0x04 ; 4 3177e: 28 f4 brcc .+10 ; 0x3178a 31780: ec 2f mov r30, r28 31782: f0 e0 ldi r31, 0x00 ; 0 31784: e0 5e subi r30, 0xE0 ; 224 31786: fc 4f sbci r31, 0xFC ; 252 31788: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 3178a: 0e 2c mov r0, r14 3178c: 02 c0 rjmp .+4 ; 0x31792 3178e: 36 95 lsr r19 31790: 27 95 ror r18 31792: 0a 94 dec r0 31794: e2 f7 brpl .-8 ; 0x3178e 31796: 86 01 movw r16, r12 31798: 02 1b sub r16, r18 3179a: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 3179c: 95 01 movw r18, r10 3179e: 36 95 lsr r19 317a0: 27 95 ror r18 { dir ^= 1; 317a2: 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)) 317a4: 20 17 cp r18, r16 317a6: 31 07 cpc r19, r17 317a8: 74 f1 brlt .+92 ; 0x31806 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; 317aa: 91 11 cpse r25, r1 317ac: 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) 317ae: 17 ff sbrs r17, 7 317b0: 05 c0 rjmp .+10 ; 0x317bc { dir ^= 1; 317b2: 81 e0 ldi r24, 0x01 ; 1 317b4: 68 27 eor r22, r24 steps = -steps; 317b6: 11 95 neg r17 317b8: 01 95 neg r16 317ba: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 317bc: 8c 2f mov r24, r28 317be: 0f 94 61 39 call 0x272c2 ; 0x272c2 mscnt = tmc2130_rd_MSCNT(axis); 317c2: 8c 2f mov r24, r28 317c4: 0f 94 28 3a call 0x27450 ; 0x27450 317c8: b1 2c mov r11, r1 317ca: a1 2c mov r10, r1 317cc: 2b e9 ldi r18, 0x9B ; 155 317ce: 82 2e mov r8, r18 317d0: 2f e0 ldi r18, 0x0F ; 15 317d2: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 317d4: 0a 15 cp r16, r10 317d6: 1b 05 cpc r17, r11 317d8: f1 f0 breq .+60 ; 0x31816 317da: 2f ef ldi r18, 0xFF ; 255 317dc: a2 1a sub r10, r18 317de: b2 0a sbc r11, r18 317e0: 0e 2c mov r0, r14 317e2: 02 c0 rjmp .+4 ; 0x317e8 317e4: 96 95 lsr r25 317e6: 87 95 ror r24 317e8: 0a 94 dec r0 317ea: e2 f7 brpl .-8 ; 0x317e4 317ec: 8c 15 cp r24, r12 317ee: 9d 05 cpc r25, r13 317f0: 91 f0 breq .+36 ; 0x31816 { tmc2130_do_step(axis); 317f2: 8c 2f mov r24, r28 317f4: 0f 94 50 39 call 0x272a0 ; 0x272a0 317f8: c4 01 movw r24, r8 317fa: 01 97 sbiw r24, 0x01 ; 1 317fc: f1 f7 brne .-4 ; 0x317fa delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 317fe: 8c 2f mov r24, r28 31800: 0f 94 28 3a call 0x27450 ; 0x27450 31804: e7 cf rjmp .-50 ; 0x317d4 { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 31806: 91 11 cpse r25, r1 31808: 01 c0 rjmp .+2 ; 0x3180c 3180a: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 3180c: c5 01 movw r24, r10 3180e: 80 1b sub r24, r16 31810: 91 0b sbc r25, r17 31812: 8c 01 movw r16, r24 31814: cc cf rjmp .-104 ; 0x317ae { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 31816: cf 91 pop r28 31818: 1f 91 pop r17 3181a: 0f 91 pop r16 3181c: ff 90 pop r15 3181e: ef 90 pop r14 31820: df 90 pop r13 31822: cf 90 pop r12 31824: bf 90 pop r11 31826: af 90 pop r10 31828: 9f 90 pop r9 3182a: 8f 90 pop r8 3182c: 08 95 ret 0003182e : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 3182e: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e memset(z_values, 0, sizeof(z_values)); 31832: ef e9 ldi r30, 0x9F ; 159 31834: f3 e1 ldi r31, 0x13 ; 19 31836: 84 ec ldi r24, 0xC4 ; 196 31838: df 01 movw r26, r30 3183a: 1d 92 st X+, r1 3183c: 8a 95 dec r24 3183e: e9 f7 brne .-6 ; 0x3183a } 31840: 08 95 ret 00031842 : 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 31842: 2f 92 push r2 31844: 3f 92 push r3 31846: 4f 92 push r4 31848: 5f 92 push r5 3184a: 6f 92 push r6 3184c: 7f 92 push r7 3184e: 8f 92 push r8 31850: 9f 92 push r9 31852: af 92 push r10 31854: bf 92 push r11 31856: cf 92 push r12 31858: df 92 push r13 3185a: ef 92 push r14 3185c: ff 92 push r15 3185e: 0f 93 push r16 31860: 1f 93 push r17 31862: cf 93 push r28 31864: df 93 push r29 31866: 00 d0 rcall .+0 ; 0x31868 31868: 1f 92 push r1 3186a: cd b7 in r28, 0x3d ; 61 3186c: de b7 in r29, 0x3e ; 62 3186e: 4b 01 movw r8, r22 31870: 5c 01 movw r10, r24 31872: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 31874: 81 e0 ldi r24, 0x01 ; 1 31876: 80 93 6b 06 sts 0x066B, r24 ; 0x80066b #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 3187a: 80 91 6a 06 lds r24, 0x066A ; 0x80066a ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 3187e: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 31880: 81 30 cpi r24, 0x01 ; 1 31882: 19 f4 brne .+6 ; 0x3188a { FORCE_HIGH_POWER_START; 31884: 0e 94 5d 67 call 0xceba ; 0xceba bHighPowerForced = true; 31888: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 3188a: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 3188e: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 31890: 81 e0 ldi r24, 0x01 ; 1 31892: 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); 31896: 80 e0 ldi r24, 0x00 ; 0 31898: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 3189c: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 3189e: 0f 94 60 64 call 0x2c8c0 ; 0x2c8c0 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 318a2: 80 92 49 07 sts 0x0749, r8 ; 0x800749 318a6: 90 92 4a 07 sts 0x074A, r9 ; 0x80074a 318aa: a0 92 4b 07 sts 0x074B, r10 ; 0x80074b 318ae: b0 92 4c 07 sts 0x074C, r11 ; 0x80074c go_to_current(homing_feedrate[Z_AXIS]/60); 318b2: 65 e5 ldi r22, 0x55 ; 85 318b4: 75 e5 ldi r23, 0x55 ; 85 318b6: 85 e5 ldi r24, 0x55 ; 85 318b8: 91 e4 ldi r25, 0x41 ; 65 318ba: 0f 94 48 c3 call 0x38690 ; 0x38690 // 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(); 318be: 0f 94 9c c9 call 0x39338 ; 0x39338 if (! endstop_z_hit_on_purpose()) 318c2: 0f 94 60 64 call 0x2c8c0 ; 0x2c8c0 318c6: 8c 83 std Y+4, r24 ; 0x04 318c8: 88 23 and r24, r24 318ca: 09 f4 brne .+2 ; 0x318ce 318cc: f9 c0 rjmp .+498 ; 0x31ac0 { //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)) 318ce: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 318d2: 86 ff sbrs r24, 6 318d4: f5 c0 rjmp .+490 ; 0x31ac0 { //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) 318d6: 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; 318d8: c1 2c mov r12, r1 318da: d1 2c mov r13, r1 318dc: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 318de: 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) 318e0: 8b 81 ldd r24, Y+3 ; 0x03 318e2: 80 17 cp r24, r16 318e4: 08 f0 brcs .+2 ; 0x318e8 318e6: a8 c0 rjmp .+336 ; 0x31a38 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 318e8: 60 91 49 07 lds r22, 0x0749 ; 0x800749 318ec: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 318f0: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 318f4: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 318f8: 20 e0 ldi r18, 0x00 ; 0 318fa: 30 e0 ldi r19, 0x00 ; 0 318fc: 40 e0 ldi r20, 0x00 ; 0 318fe: 5f e3 ldi r21, 0x3F ; 63 31900: 31 10 cpse r3, r1 31902: 04 c0 rjmp .+8 ; 0x3190c 31904: 2d ec ldi r18, 0xCD ; 205 31906: 3c ec ldi r19, 0xCC ; 204 31908: 4c e4 ldi r20, 0x4C ; 76 3190a: 5e e3 ldi r21, 0x3E ; 62 3190c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31910: 2b 01 movw r4, r22 31912: 3c 01 movw r6, r24 31914: 40 92 49 07 sts 0x0749, r4 ; 0x800749 31918: 50 92 4a 07 sts 0x074A, r5 ; 0x80074a 3191c: 60 92 4b 07 sts 0x074B, r6 ; 0x80074b 31920: 70 92 4c 07 sts 0x074C, r7 ; 0x80074c float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 31924: 65 e5 ldi r22, 0x55 ; 85 31926: 75 e5 ldi r23, 0x55 ; 85 31928: 85 e5 ldi r24, 0x55 ; 85 3192a: 91 e4 ldi r25, 0x41 ; 65 3192c: 0f 94 48 c3 call 0x38690 ; 0x38690 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 31930: 80 92 49 07 sts 0x0749, r8 ; 0x800749 31934: 90 92 4a 07 sts 0x074A, r9 ; 0x80074a 31938: a0 92 4b 07 sts 0x074B, r10 ; 0x80074b 3193c: b0 92 4c 07 sts 0x074C, r11 ; 0x80074c //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)); 31940: 65 e5 ldi r22, 0x55 ; 85 31942: 75 e5 ldi r23, 0x55 ; 85 31944: 85 e5 ldi r24, 0x55 ; 85 31946: 90 e4 ldi r25, 0x40 ; 64 31948: 0f 94 48 c3 call 0x38690 ; 0x38690 // 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(); 3194c: 0f 94 9c c9 call 0x39338 ; 0x39338 //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) { 31950: a3 01 movw r20, r6 31952: 92 01 movw r18, r4 31954: 60 91 49 07 lds r22, 0x0749 ; 0x800749 31958: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 3195c: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 31960: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 31964: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 31968: 9f 77 andi r25, 0x7F ; 127 3196a: 2d ec ldi r18, 0xCD ; 205 3196c: 3c ec ldi r19, 0xCC ; 204 3196e: 4c ec ldi r20, 0xCC ; 204 31970: 5c e3 ldi r21, 0x3C ; 60 31972: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 31976: 87 ff sbrs r24, 7 31978: 16 c0 rjmp .+44 ; 0x319a6 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 3197a: 60 e0 ldi r22, 0x00 ; 0 3197c: 70 e0 ldi r23, 0x00 ; 0 3197e: 80 e0 ldi r24, 0x00 ; 0 31980: 9f e3 ldi r25, 0x3F ; 63 31982: 0e 94 8e 6e call 0xdd1c ; 0xdd1c current_position[Z_AXIS] = minimum_z; 31986: 80 92 49 07 sts 0x0749, r8 ; 0x800749 3198a: 90 92 4a 07 sts 0x074A, r9 ; 0x80074a 3198e: a0 92 4b 07 sts 0x074B, r10 ; 0x80074b 31992: b0 92 4c 07 sts 0x074C, r11 ; 0x80074c go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 31996: 65 e5 ldi r22, 0x55 ; 85 31998: 75 e5 ldi r23, 0x55 ; 85 3199a: 85 e5 ldi r24, 0x55 ; 85 3199c: 90 e4 ldi r25, 0x40 ; 64 3199e: 0f 94 48 c3 call 0x38690 ; 0x38690 // 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(); 319a2: 0f 94 9c c9 call 0x39338 ; 0x39338 } if (!endstop_z_hit_on_purpose()) 319a6: 0f 94 60 64 call 0x2c8c0 ; 0x2c8c0 319aa: 28 2e mov r2, r24 319ac: 88 23 and r24, r24 319ae: 09 f4 brne .+2 ; 0x319b2 319b0: 87 c0 rjmp .+270 ; 0x31ac0 { //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)) { 319b2: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 319b6: 86 ff sbrs r24, 6 319b8: 83 c0 rjmp .+262 ; 0x31ac0 319ba: 40 90 49 07 lds r4, 0x0749 ; 0x800749 319be: 50 90 4a 07 lds r5, 0x074A ; 0x80074a 319c2: 60 90 4b 07 lds r6, 0x074B ; 0x80074b 319c6: 70 90 4c 07 lds r7, 0x074C ; 0x80074c } #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; 319ca: 2b 81 ldd r18, Y+3 ; 0x03 319cc: 22 23 and r18, r18 319ce: d9 f0 breq .+54 ; 0x31a06 319d0: 62 2f mov r22, r18 319d2: 70 e0 ldi r23, 0x00 ; 0 319d4: 90 e0 ldi r25, 0x00 ; 0 319d6: 80 e0 ldi r24, 0x00 ; 0 319d8: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 319dc: 9b 01 movw r18, r22 319de: ac 01 movw r20, r24 319e0: c7 01 movw r24, r14 319e2: b6 01 movw r22, r12 319e4: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 319e8: 9b 01 movw r18, r22 319ea: ac 01 movw r20, r24 319ec: c3 01 movw r24, r6 319ee: b2 01 movw r22, r4 319f0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 319f4: 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 319f6: 2d ec ldi r18, 0xCD ; 205 319f8: 3c ec ldi r19, 0xCC ; 204 319fa: 4c e4 ldi r20, 0x4C ; 76 319fc: 5d e3 ldi r21, 0x3D ; 61 319fe: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 31a02: 18 16 cp r1, r24 31a04: 64 f0 brlt .+24 ; 0x31a1e #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]; 31a06: a3 01 movw r20, r6 31a08: 92 01 movw r18, r4 31a0a: c7 01 movw r24, r14 31a0c: b6 01 movw r22, r12 31a0e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31a12: 6b 01 movw r12, r22 31a14: 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) 31a16: 2b 81 ldd r18, Y+3 ; 0x03 31a18: 2f 5f subi r18, 0xFF ; 255 31a1a: 2b 83 std Y+3, r18 ; 0x03 31a1c: 61 cf rjmp .-318 ; 0x318e0 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 31a1e: 31 10 cpse r3, r1 31a20: 4f c0 rjmp .+158 ; 0x31ac0 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 31a22: 84 ef ldi r24, 0xF4 ; 244 31a24: 91 e0 ldi r25, 0x01 ; 1 31a26: 0e 94 7f 8e call 0x11cfe ; 0x11cfe //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; 31a2a: 32 2c mov r3, r2 i = -1; 31a2c: 8f ef ldi r24, 0xFF ; 255 31a2e: 8b 83 std Y+3, r24 ; 0x03 z = 0; 31a30: c1 2c mov r12, r1 31a32: d1 2c mov r13, r1 31a34: 76 01 movw r14, r12 31a36: ef cf rjmp .-34 ; 0x31a16 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 31a38: 02 30 cpi r16, 0x02 ; 2 31a3a: 68 f5 brcc .+90 ; 0x31a96 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 31a3c: c0 92 49 07 sts 0x0749, r12 ; 0x800749 31a40: d0 92 4a 07 sts 0x074A, r13 ; 0x80074a 31a44: e0 92 4b 07 sts 0x074B, r14 ; 0x80074b 31a48: f0 92 4c 07 sts 0x074C, r15 ; 0x80074c 31a4c: 8a 81 ldd r24, Y+2 ; 0x02 31a4e: 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); 31a52: 89 81 ldd r24, Y+1 ; 0x01 31a54: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31a58: 11 23 and r17, r17 31a5a: 19 f0 breq .+6 ; 0x31a62 31a5c: 80 e0 ldi r24, 0x00 ; 0 31a5e: 0e 94 5d 67 call 0xceba ; 0xceba #endif bedPWMDisabled = 0; 31a62: 10 92 6b 06 sts 0x066B, r1 ; 0x80066b #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 31a66: 8c 81 ldd r24, Y+4 ; 0x04 31a68: 0f 90 pop r0 31a6a: 0f 90 pop r0 31a6c: 0f 90 pop r0 31a6e: 0f 90 pop r0 31a70: df 91 pop r29 31a72: cf 91 pop r28 31a74: 1f 91 pop r17 31a76: 0f 91 pop r16 31a78: ff 90 pop r15 31a7a: ef 90 pop r14 31a7c: df 90 pop r13 31a7e: cf 90 pop r12 31a80: bf 90 pop r11 31a82: af 90 pop r10 31a84: 9f 90 pop r9 31a86: 8f 90 pop r8 31a88: 7f 90 pop r7 31a8a: 6f 90 pop r6 31a8c: 5f 90 pop r5 31a8e: 4f 90 pop r4 31a90: 3f 90 pop r3 31a92: 2f 90 pop r2 31a94: 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); 31a96: 60 2f mov r22, r16 31a98: 70 e0 ldi r23, 0x00 ; 0 31a9a: 90 e0 ldi r25, 0x00 ; 0 31a9c: 80 e0 ldi r24, 0x00 ; 0 31a9e: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 31aa2: 9b 01 movw r18, r22 31aa4: ac 01 movw r20, r24 31aa6: c7 01 movw r24, r14 31aa8: b6 01 movw r22, r12 31aaa: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 31aae: 60 93 49 07 sts 0x0749, r22 ; 0x800749 31ab2: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 31ab6: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 31aba: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 31abe: c6 cf rjmp .-116 ; 0x31a4c 31ac0: 2a 81 ldd r18, Y+2 ; 0x02 31ac2: 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); 31ac6: 89 81 ldd r24, Y+1 ; 0x01 31ac8: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31acc: 11 23 and r17, r17 31ace: 19 f0 breq .+6 ; 0x31ad6 31ad0: 80 e0 ldi r24, 0x00 ; 0 31ad2: 0e 94 5d 67 call 0xceba ; 0xceba #endif bedPWMDisabled = 0; 31ad6: 10 92 6b 06 sts 0x066B, r1 ; 0x80066b return false; 31ada: 1c 82 std Y+4, r1 ; 0x04 31adc: c4 cf rjmp .-120 ; 0x31a66 00031ade : /// 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){ 31ade: 2f 92 push r2 31ae0: 3f 92 push r3 31ae2: 4f 92 push r4 31ae4: 5f 92 push r5 31ae6: 6f 92 push r6 31ae8: 7f 92 push r7 31aea: 8f 92 push r8 31aec: 9f 92 push r9 31aee: af 92 push r10 31af0: bf 92 push r11 31af2: cf 92 push r12 31af4: df 92 push r13 31af6: ef 92 push r14 31af8: ff 92 push r15 31afa: 0f 93 push r16 31afc: 1f 93 push r17 31afe: cf 93 push r28 31b00: df 93 push r29 31b02: cd b7 in r28, 0x3d ; 61 31b04: de b7 in r29, 0x3e ; 62 31b06: cd 5b subi r28, 0xBD ; 189 31b08: d1 40 sbci r29, 0x01 ; 1 31b0a: 0f b6 in r0, 0x3f ; 63 31b0c: f8 94 cli 31b0e: de bf out 0x3e, r29 ; 62 31b10: 0f be out 0x3f, r0 ; 63 31b12: cd bf out 0x3d, r28 ; 61 31b14: c3 57 subi r28, 0x73 ; 115 31b16: de 4f sbci r29, 0xFE ; 254 31b18: 99 83 std Y+1, r25 ; 0x01 31b1a: 88 83 st Y, r24 31b1c: cd 58 subi r28, 0x8D ; 141 31b1e: d1 40 sbci r29, 0x01 ; 1 31b20: c1 57 subi r28, 0x71 ; 113 31b22: de 4f sbci r29, 0xFE ; 254 31b24: 79 83 std Y+1, r23 ; 0x01 31b26: 68 83 st Y, r22 31b28: cf 58 subi r28, 0x8F ; 143 31b2a: d1 40 sbci r29, 0x01 ; 1 31b2c: ce 56 subi r28, 0x6E ; 110 31b2e: de 4f sbci r29, 0xFE ; 254 31b30: 59 83 std Y+1, r21 ; 0x01 31b32: 48 83 st Y, r20 31b34: c2 59 subi r28, 0x92 ; 146 31b36: d1 40 sbci r29, 0x01 ; 1 31b38: 84 e1 ldi r24, 0x14 ; 20 31b3a: cf 56 subi r28, 0x6F ; 111 31b3c: de 4f sbci r29, 0xFE ; 254 31b3e: 88 83 st Y, r24 31b40: c1 59 subi r28, 0x91 ; 145 31b42: 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; 31b44: ce 56 subi r28, 0x6E ; 110 31b46: de 4f sbci r29, 0xFE ; 254 31b48: a8 81 ld r26, Y 31b4a: b9 81 ldd r27, Y+1 ; 0x01 31b4c: c2 59 subi r28, 0x92 ; 146 31b4e: d1 40 sbci r29, 0x01 ; 1 31b50: 8d 91 ld r24, X+ 31b52: 9d 91 ld r25, X+ 31b54: 0d 90 ld r0, X+ 31b56: bc 91 ld r27, X 31b58: a0 2d mov r26, r0 31b5a: c6 56 subi r28, 0x66 ; 102 31b5c: de 4f sbci r29, 0xFE ; 254 31b5e: 88 83 st Y, r24 31b60: 99 83 std Y+1, r25 ; 0x01 31b62: aa 83 std Y+2, r26 ; 0x02 31b64: bb 83 std Y+3, r27 ; 0x03 31b66: ca 59 subi r28, 0x9A ; 154 31b68: d1 40 sbci r29, 0x01 ; 1 31b6a: c1 57 subi r28, 0x71 ; 113 31b6c: de 4f sbci r29, 0xFE ; 254 31b6e: a8 81 ld r26, Y 31b70: b9 81 ldd r27, Y+1 ; 0x01 31b72: cf 58 subi r28, 0x8F ; 143 31b74: d1 40 sbci r29, 0x01 ; 1 31b76: 8d 91 ld r24, X+ 31b78: 9d 91 ld r25, X+ 31b7a: 0d 90 ld r0, X+ 31b7c: bc 91 ld r27, X 31b7e: a0 2d mov r26, r0 31b80: ca 54 subi r28, 0x4A ; 74 31b82: de 4f sbci r29, 0xFE ; 254 31b84: 88 83 st Y, r24 31b86: 99 83 std Y+1, r25 ; 0x01 31b88: aa 83 std Y+2, r26 ; 0x02 31b8a: bb 83 std Y+3, r27 ; 0x03 31b8c: c6 5b subi r28, 0xB6 ; 182 31b8e: d1 40 sbci r29, 0x01 ; 1 31b90: c3 57 subi r28, 0x73 ; 115 31b92: de 4f sbci r29, 0xFE ; 254 31b94: a8 81 ld r26, Y 31b96: b9 81 ldd r27, Y+1 ; 0x01 31b98: cd 58 subi r28, 0x8D ; 141 31b9a: d1 40 sbci r29, 0x01 ; 1 31b9c: 8d 91 ld r24, X+ 31b9e: 9d 91 ld r25, X+ 31ba0: 0d 90 ld r0, X+ 31ba2: bc 91 ld r27, X 31ba4: a0 2d mov r26, r0 31ba6: c6 54 subi r28, 0x46 ; 70 31ba8: de 4f sbci r29, 0xFE ; 254 31baa: 88 83 st Y, r24 31bac: 99 83 std Y+1, r25 ; 0x01 31bae: aa 83 std Y+2, r26 ; 0x02 31bb0: bb 83 std Y+3, r27 ; 0x03 31bb2: ca 5b subi r28, 0xBA ; 186 31bb4: d1 40 sbci r29, 0x01 ; 1 31bb6: fe 01 movw r30, r28 31bb8: e7 5f subi r30, 0xF7 ; 247 31bba: fe 4f sbci r31, 0xFE ; 254 31bbc: c8 55 subi r28, 0x58 ; 88 31bbe: de 4f sbci r29, 0xFE ; 254 31bc0: f9 83 std Y+1, r31 ; 0x01 31bc2: e8 83 st Y, r30 31bc4: c8 5a subi r28, 0xA8 ; 168 31bc6: d1 40 sbci r29, 0x01 ; 1 31bc8: ce 01 movw r24, r28 31bca: 8b 57 subi r24, 0x7B ; 123 31bcc: 9f 4f sbci r25, 0xFF ; 255 31bce: ca 55 subi r28, 0x5A ; 90 31bd0: de 4f sbci r29, 0xFE ; 254 31bd2: 99 83 std Y+1, r25 ; 0x01 31bd4: 88 83 st Y, r24 31bd6: c6 5a subi r28, 0xA6 ; 166 31bd8: d1 40 sbci r29, 0x01 ; 1 31bda: de 01 movw r26, r28 31bdc: 11 96 adiw r26, 0x01 ; 1 31bde: c8 56 subi r28, 0x68 ; 104 31be0: de 4f sbci r29, 0xFE ; 254 31be2: b9 83 std Y+1, r27 ; 0x01 31be4: a8 83 st Y, r26 31be6: c8 59 subi r28, 0x98 ; 152 31be8: d1 40 sbci r29, 0x01 ; 1 31bea: 31 2c mov r3, r1 31bec: 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; 31bee: b1 01 movw r22, r2 31bf0: 03 2c mov r0, r3 31bf2: 00 0c add r0, r0 31bf4: 88 0b sbc r24, r24 31bf6: 99 0b sbc r25, r25 31bf8: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 31bfc: 2a e1 ldi r18, 0x1A ; 26 31bfe: 38 ef ldi r19, 0xF8 ; 248 31c00: 42 e4 ldi r20, 0x42 ; 66 31c02: 5e e3 ldi r21, 0x3E ; 62 31c04: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31c08: 6b 01 movw r12, r22 31c0a: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 31c0c: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 31c10: c2 56 subi r28, 0x62 ; 98 31c12: de 4f sbci r29, 0xFE ; 254 31c14: 68 83 st Y, r22 31c16: 79 83 std Y+1, r23 ; 0x01 31c18: 8a 83 std Y+2, r24 ; 0x02 31c1a: 9b 83 std Y+3, r25 ; 0x03 31c1c: ce 59 subi r28, 0x9E ; 158 31c1e: d1 40 sbci r29, 0x01 ; 1 31c20: c7 01 movw r24, r14 31c22: b6 01 movw r22, r12 31c24: 0f 94 ab df call 0x3bf56 ; 0x3bf56 31c28: ce 55 subi r28, 0x5E ; 94 31c2a: de 4f sbci r29, 0xFE ; 254 31c2c: 68 83 st Y, r22 31c2e: 79 83 std Y+1, r23 ; 0x01 31c30: 8a 83 std Y+2, r24 ; 0x02 31c32: 9b 83 std Y+3, r25 ; 0x03 31c34: c2 5a subi r28, 0xA2 ; 162 31c36: d1 40 sbci r29, 0x01 ; 1 31c38: 9b 01 movw r18, r22 31c3a: ac 01 movw r20, r24 31c3c: c6 56 subi r28, 0x66 ; 102 31c3e: de 4f sbci r29, 0xFE ; 254 31c40: 68 81 ld r22, Y 31c42: 79 81 ldd r23, Y+1 ; 0x01 31c44: 8a 81 ldd r24, Y+2 ; 0x02 31c46: 9b 81 ldd r25, Y+3 ; 0x03 31c48: ca 59 subi r28, 0x9A ; 154 31c4a: d1 40 sbci r29, 0x01 ; 1 31c4c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31c50: c6 54 subi r28, 0x46 ; 70 31c52: de 4f sbci r29, 0xFE ; 254 31c54: 28 81 ld r18, Y 31c56: 39 81 ldd r19, Y+1 ; 0x01 31c58: 4a 81 ldd r20, Y+2 ; 0x02 31c5a: 5b 81 ldd r21, Y+3 ; 0x03 31c5c: ca 5b subi r28, 0xBA ; 186 31c5e: d1 40 sbci r29, 0x01 ; 1 31c60: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31c64: 6b 01 movw r12, r22 31c66: 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) 31c68: 20 e0 ldi r18, 0x00 ; 0 31c6a: 30 e0 ldi r19, 0x00 ; 0 31c6c: a9 01 movw r20, r18 31c6e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 31c72: 18 16 cp r1, r24 31c74: 0c f0 brlt .+2 ; 0x31c78 31c76: 7a c2 rjmp .+1268 ; 0x3216c // 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; 31c78: c2 56 subi r28, 0x62 ; 98 31c7a: de 4f sbci r29, 0xFE ; 254 31c7c: 28 81 ld r18, Y 31c7e: 39 81 ldd r19, Y+1 ; 0x01 31c80: 4a 81 ldd r20, Y+2 ; 0x02 31c82: 5b 81 ldd r21, Y+3 ; 0x03 31c84: ce 59 subi r28, 0x9E ; 158 31c86: d1 40 sbci r29, 0x01 ; 1 31c88: c6 56 subi r28, 0x66 ; 102 31c8a: de 4f sbci r29, 0xFE ; 254 31c8c: 68 81 ld r22, Y 31c8e: 79 81 ldd r23, Y+1 ; 0x01 31c90: 8a 81 ldd r24, Y+2 ; 0x02 31c92: 9b 81 ldd r25, Y+3 ; 0x03 31c94: ca 59 subi r28, 0x9A ; 154 31c96: d1 40 sbci r29, 0x01 ; 1 31c98: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31c9c: ca 54 subi r28, 0x4A ; 74 31c9e: de 4f sbci r29, 0xFE ; 254 31ca0: 28 81 ld r18, Y 31ca2: 39 81 ldd r19, Y+1 ; 0x01 31ca4: 4a 81 ldd r20, Y+2 ; 0x02 31ca6: 5b 81 ldd r21, Y+3 ; 0x03 31ca8: c6 5b subi r28, 0xB6 ; 182 31caa: d1 40 sbci r29, 0x01 ; 1 31cac: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31cb0: 4b 01 movw r8, r22 31cb2: 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) 31cb4: 20 e0 ldi r18, 0x00 ; 0 31cb6: 30 e0 ldi r19, 0x00 ; 0 31cb8: a9 01 movw r20, r18 31cba: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 31cbe: 18 16 cp r1, r24 31cc0: 0c f0 brlt .+2 ; 0x31cc4 31cc2: 54 c2 rjmp .+1192 ; 0x3216c 31cc4: 20 e0 ldi r18, 0x00 ; 0 31cc6: 30 e0 ldi r19, 0x00 ; 0 31cc8: 48 ef ldi r20, 0xF8 ; 248 31cca: 51 e4 ldi r21, 0x41 ; 65 31ccc: c7 01 movw r24, r14 31cce: b6 01 movw r22, r12 31cd0: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 31cd4: 87 ff sbrs r24, 7 31cd6: 4a c2 rjmp .+1172 ; 0x3216c 31cd8: 20 e0 ldi r18, 0x00 ; 0 31cda: 30 e0 ldi r19, 0x00 ; 0 31cdc: 48 ef ldi r20, 0xF8 ; 248 31cde: 51 e4 ldi r21, 0x41 ; 65 31ce0: c5 01 movw r24, r10 31ce2: b4 01 movw r22, r8 31ce4: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 31ce8: 87 ff sbrs r24, 7 31cea: 40 c2 rjmp .+1152 ; 0x3216c return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 31cec: c7 01 movw r24, r14 31cee: b6 01 movw r22, r12 31cf0: 0f 94 58 e0 call 0x3c0b0 ; 0x3c0b0 31cf4: 9b 01 movw r18, r22 31cf6: ac 01 movw r20, r24 31cf8: c7 01 movw r24, r14 31cfa: b6 01 movw r22, r12 31cfc: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 31d00: 2b 01 movw r4, r22 31d02: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 31d04: c5 01 movw r24, r10 31d06: b4 01 movw r22, r8 31d08: 0f 94 58 e0 call 0x3c0b0 ; 0x3c0b0 31d0c: 9b 01 movw r18, r22 31d0e: ac 01 movw r20, r24 31d10: c5 01 movw r24, r10 31d12: b4 01 movw r22, r8 31d14: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 31d18: cc 56 subi r28, 0x6C ; 108 31d1a: de 4f sbci r29, 0xFE ; 254 31d1c: 68 83 st Y, r22 31d1e: 79 83 std Y+1, r23 ; 0x01 31d20: 8a 83 std Y+2, r24 ; 0x02 31d22: 9b 83 std Y+3, r25 ; 0x03 31d24: c4 59 subi r28, 0x94 ; 148 31d26: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 31d28: a3 01 movw r20, r6 31d2a: 92 01 movw r18, r4 31d2c: 60 e0 ldi r22, 0x00 ; 0 31d2e: 70 e0 ldi r23, 0x00 ; 0 31d30: 80 e8 ldi r24, 0x80 ; 128 31d32: 9f e3 ldi r25, 0x3F ; 63 31d34: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 31d38: c2 55 subi r28, 0x52 ; 82 31d3a: de 4f sbci r29, 0xFE ; 254 31d3c: 68 83 st Y, r22 31d3e: 79 83 std Y+1, r23 ; 0x01 31d40: 8a 83 std Y+2, r24 ; 0x02 31d42: 9b 83 std Y+3, r25 ; 0x03 31d44: ce 5a subi r28, 0xAE ; 174 31d46: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 31d48: cc 56 subi r28, 0x6C ; 108 31d4a: de 4f sbci r29, 0xFE ; 254 31d4c: 28 81 ld r18, Y 31d4e: 39 81 ldd r19, Y+1 ; 0x01 31d50: 4a 81 ldd r20, Y+2 ; 0x02 31d52: 5b 81 ldd r21, Y+3 ; 0x03 31d54: c4 59 subi r28, 0x94 ; 148 31d56: d1 40 sbci r29, 0x01 ; 1 31d58: 60 e0 ldi r22, 0x00 ; 0 31d5a: 70 e0 ldi r23, 0x00 ; 0 31d5c: 80 e8 ldi r24, 0x80 ; 128 31d5e: 9f e3 ldi r25, 0x3F ; 63 31d60: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 31d64: ce 54 subi r28, 0x4E ; 78 31d66: de 4f sbci r29, 0xFE ; 254 31d68: 68 83 st Y, r22 31d6a: 79 83 std Y+1, r23 ; 0x01 31d6c: 8a 83 std Y+2, r24 ; 0x02 31d6e: 9b 83 std Y+3, r25 ; 0x03 31d70: c2 5b subi r28, 0xB2 ; 178 31d72: 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; 31d74: c7 01 movw r24, r14 31d76: b6 01 movw r22, r12 31d78: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 31d7c: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 31d7e: fb 01 movw r30, r22 31d80: 31 96 adiw r30, 0x01 ; 1 31d82: c6 55 subi r28, 0x56 ; 86 31d84: de 4f sbci r29, 0xFE ; 254 31d86: f9 83 std Y+1, r31 ; 0x01 31d88: e8 83 st Y, r30 31d8a: ca 5a subi r28, 0xAA ; 170 31d8c: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 31d8e: c5 01 movw r24, r10 31d90: b4 01 movw r22, r8 31d92: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 31d96: 8b 01 movw r16, r22 31d98: 95 e0 ldi r25, 0x05 ; 5 31d9a: 00 0f add r16, r16 31d9c: 11 1f adc r17, r17 31d9e: 9a 95 dec r25 31da0: e1 f7 brne .-8 ; 0x31d9a const uint16_t idx01 = c0 + 32 * r1; 31da2: c8 01 movw r24, r16 31da4: 80 96 adiw r24, 0x20 ; 32 31da6: c4 55 subi r28, 0x54 ; 84 31da8: de 4f sbci r29, 0xFE ; 254 31daa: 99 83 std Y+1, r25 ; 0x01 31dac: 88 83 st Y, r24 31dae: cc 5a subi r28, 0xAC ; 172 31db0: 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]; 31db2: f8 01 movw r30, r16 31db4: ec 0d add r30, r12 31db6: fd 1d adc r31, r13 31db8: ec 58 subi r30, 0x8C ; 140 31dba: f8 4f sbci r31, 0xF8 ; 248 31dbc: 60 81 ld r22, Z 31dbe: 70 e0 ldi r23, 0x00 ; 0 31dc0: 90 e0 ldi r25, 0x00 ; 0 31dc2: 80 e0 ldi r24, 0x00 ; 0 31dc4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 31dc8: 4b 01 movw r8, r22 31dca: 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; 31dcc: ce 54 subi r28, 0x4E ; 78 31dce: de 4f sbci r29, 0xFE ; 254 31dd0: 28 81 ld r18, Y 31dd2: 39 81 ldd r19, Y+1 ; 0x01 31dd4: 4a 81 ldd r20, Y+2 ; 0x02 31dd6: 5b 81 ldd r21, Y+3 ; 0x03 31dd8: c2 5b subi r28, 0xB2 ; 178 31dda: d1 40 sbci r29, 0x01 ; 1 31ddc: c2 55 subi r28, 0x52 ; 82 31dde: de 4f sbci r29, 0xFE ; 254 31de0: 68 81 ld r22, Y 31de2: 79 81 ldd r23, Y+1 ; 0x01 31de4: 8a 81 ldd r24, Y+2 ; 0x02 31de6: 9b 81 ldd r25, Y+3 ; 0x03 31de8: ce 5a subi r28, 0xAE ; 174 31dea: d1 40 sbci r29, 0x01 ; 1 31dec: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31df0: 9b 01 movw r18, r22 31df2: 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]; 31df4: c5 01 movw r24, r10 31df6: b4 01 movw r22, r8 31df8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31dfc: 4b 01 movw r8, r22 31dfe: 5c 01 movw r10, r24 31e00: c4 55 subi r28, 0x54 ; 84 31e02: de 4f sbci r29, 0xFE ; 254 31e04: e8 81 ld r30, Y 31e06: f9 81 ldd r31, Y+1 ; 0x01 31e08: cc 5a subi r28, 0xAC ; 172 31e0a: d1 40 sbci r29, 0x01 ; 1 31e0c: ec 0d add r30, r12 31e0e: fd 1d adc r31, r13 31e10: ec 58 subi r30, 0x8C ; 140 31e12: f8 4f sbci r31, 0xF8 ; 248 31e14: 60 81 ld r22, Z 31e16: 70 e0 ldi r23, 0x00 ; 0 31e18: 90 e0 ldi r25, 0x00 ; 0 31e1a: 80 e0 ldi r24, 0x00 ; 0 31e1c: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 31e20: 6b 01 movw r12, r22 31e22: 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; 31e24: c2 55 subi r28, 0x52 ; 82 31e26: de 4f sbci r29, 0xFE ; 254 31e28: 28 81 ld r18, Y 31e2a: 39 81 ldd r19, Y+1 ; 0x01 31e2c: 4a 81 ldd r20, Y+2 ; 0x02 31e2e: 5b 81 ldd r21, Y+3 ; 0x03 31e30: ce 5a subi r28, 0xAE ; 174 31e32: d1 40 sbci r29, 0x01 ; 1 31e34: cc 56 subi r28, 0x6C ; 108 31e36: de 4f sbci r29, 0xFE ; 254 31e38: 68 81 ld r22, Y 31e3a: 79 81 ldd r23, Y+1 ; 0x01 31e3c: 8a 81 ldd r24, Y+2 ; 0x02 31e3e: 9b 81 ldd r25, Y+3 ; 0x03 31e40: c4 59 subi r28, 0x94 ; 148 31e42: d1 40 sbci r29, 0x01 ; 1 31e44: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31e48: 9b 01 movw r18, r22 31e4a: 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]; 31e4c: c7 01 movw r24, r14 31e4e: b6 01 movw r22, r12 31e50: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31e54: 9b 01 movw r18, r22 31e56: ac 01 movw r20, r24 31e58: c5 01 movw r24, r10 31e5a: b4 01 movw r22, r8 31e5c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31e60: 6b 01 movw r12, r22 31e62: 7c 01 movw r14, r24 31e64: c6 55 subi r28, 0x56 ; 86 31e66: de 4f sbci r29, 0xFE ; 254 31e68: a8 81 ld r26, Y 31e6a: b9 81 ldd r27, Y+1 ; 0x01 31e6c: ca 5a subi r28, 0xAA ; 170 31e6e: d1 40 sbci r29, 0x01 ; 1 31e70: 0a 0f add r16, r26 31e72: 1b 1f adc r17, r27 31e74: f8 01 movw r30, r16 31e76: ec 58 subi r30, 0x8C ; 140 31e78: f8 4f sbci r31, 0xF8 ; 248 31e7a: 60 81 ld r22, Z 31e7c: 70 e0 ldi r23, 0x00 ; 0 31e7e: 90 e0 ldi r25, 0x00 ; 0 31e80: 80 e0 ldi r24, 0x00 ; 0 31e82: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 31e86: 4b 01 movw r8, r22 31e88: 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; 31e8a: ce 54 subi r28, 0x4E ; 78 31e8c: de 4f sbci r29, 0xFE ; 254 31e8e: 28 81 ld r18, Y 31e90: 39 81 ldd r19, Y+1 ; 0x01 31e92: 4a 81 ldd r20, Y+2 ; 0x02 31e94: 5b 81 ldd r21, Y+3 ; 0x03 31e96: c2 5b subi r28, 0xB2 ; 178 31e98: d1 40 sbci r29, 0x01 ; 1 31e9a: c3 01 movw r24, r6 31e9c: b2 01 movw r22, r4 31e9e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31ea2: 9b 01 movw r18, r22 31ea4: 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]; 31ea6: c5 01 movw r24, r10 31ea8: b4 01 movw r22, r8 31eaa: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31eae: 9b 01 movw r18, r22 31eb0: ac 01 movw r20, r24 31eb2: c7 01 movw r24, r14 31eb4: b6 01 movw r22, r12 31eb6: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31eba: 6b 01 movw r12, r22 31ebc: 7c 01 movw r14, r24 31ebe: c6 55 subi r28, 0x56 ; 86 31ec0: de 4f sbci r29, 0xFE ; 254 31ec2: e8 81 ld r30, Y 31ec4: f9 81 ldd r31, Y+1 ; 0x01 31ec6: ca 5a subi r28, 0xAA ; 170 31ec8: d1 40 sbci r29, 0x01 ; 1 31eca: c4 55 subi r28, 0x54 ; 84 31ecc: de 4f sbci r29, 0xFE ; 254 31ece: 88 81 ld r24, Y 31ed0: 99 81 ldd r25, Y+1 ; 0x01 31ed2: cc 5a subi r28, 0xAC ; 172 31ed4: d1 40 sbci r29, 0x01 ; 1 31ed6: e8 0f add r30, r24 31ed8: f9 1f adc r31, r25 31eda: ec 58 subi r30, 0x8C ; 140 31edc: f8 4f sbci r31, 0xF8 ; 248 31ede: 60 81 ld r22, Z 31ee0: 70 e0 ldi r23, 0x00 ; 0 31ee2: 90 e0 ldi r25, 0x00 ; 0 31ee4: 80 e0 ldi r24, 0x00 ; 0 31ee6: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 31eea: 4b 01 movw r8, r22 31eec: 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; 31eee: cc 56 subi r28, 0x6C ; 108 31ef0: de 4f sbci r29, 0xFE ; 254 31ef2: 28 81 ld r18, Y 31ef4: 39 81 ldd r19, Y+1 ; 0x01 31ef6: 4a 81 ldd r20, Y+2 ; 0x02 31ef8: 5b 81 ldd r21, Y+3 ; 0x03 31efa: c4 59 subi r28, 0x94 ; 148 31efc: d1 40 sbci r29, 0x01 ; 1 31efe: c3 01 movw r24, r6 31f00: b2 01 movw r22, r4 31f02: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31f06: 9b 01 movw r18, r22 31f08: 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]; 31f0a: c5 01 movw r24, r10 31f0c: b4 01 movw r22, r8 31f0e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31f12: 9b 01 movw r18, r22 31f14: ac 01 movw r20, r24 31f16: c7 01 movw r24, r14 31f18: b6 01 movw r22, r12 31f1a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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; 31f1e: 20 e0 ldi r18, 0x00 ; 0 31f20: 30 e0 ldi r19, 0x00 ; 0 31f22: 40 e0 ldi r20, 0x00 ; 0 31f24: 52 e4 ldi r21, 0x42 ; 66 31f26: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 31f2a: 6b 01 movw r12, r22 31f2c: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 31f2e: ac 01 movw r20, r24 31f30: 9b 01 movw r18, r22 31f32: ce 55 subi r28, 0x5E ; 94 31f34: de 4f sbci r29, 0xFE ; 254 31f36: 68 81 ld r22, Y 31f38: 79 81 ldd r23, Y+1 ; 0x01 31f3a: 8a 81 ldd r24, Y+2 ; 0x02 31f3c: 9b 81 ldd r25, Y+3 ; 0x03 31f3e: c2 5a subi r28, 0xA2 ; 162 31f40: d1 40 sbci r29, 0x01 ; 1 31f42: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31f46: c8 55 subi r28, 0x58 ; 88 31f48: de 4f sbci r29, 0xFE ; 254 31f4a: a8 81 ld r26, Y 31f4c: b9 81 ldd r27, Y+1 ; 0x01 31f4e: c8 5a subi r28, 0xA8 ; 168 31f50: d1 40 sbci r29, 0x01 ; 1 31f52: 6d 93 st X+, r22 31f54: 7d 93 st X+, r23 31f56: 8d 93 st X+, r24 31f58: 9d 93 st X+, r25 31f5a: c8 55 subi r28, 0x58 ; 88 31f5c: de 4f sbci r29, 0xFE ; 254 31f5e: b9 83 std Y+1, r27 ; 0x01 31f60: a8 83 st Y, r26 31f62: c8 5a subi r28, 0xA8 ; 168 31f64: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 31f66: a7 01 movw r20, r14 31f68: 96 01 movw r18, r12 31f6a: c2 56 subi r28, 0x62 ; 98 31f6c: de 4f sbci r29, 0xFE ; 254 31f6e: 68 81 ld r22, Y 31f70: 79 81 ldd r23, Y+1 ; 0x01 31f72: 8a 81 ldd r24, Y+2 ; 0x02 31f74: 9b 81 ldd r25, Y+3 ; 0x03 31f76: ce 59 subi r28, 0x9E ; 158 31f78: d1 40 sbci r29, 0x01 ; 1 31f7a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 31f7e: ca 55 subi r28, 0x5A ; 90 31f80: de 4f sbci r29, 0xFE ; 254 31f82: e8 81 ld r30, Y 31f84: f9 81 ldd r31, Y+1 ; 0x01 31f86: c6 5a subi r28, 0xA6 ; 166 31f88: d1 40 sbci r29, 0x01 ; 1 31f8a: 61 93 st Z+, r22 31f8c: 71 93 st Z+, r23 31f8e: 81 93 st Z+, r24 31f90: 91 93 st Z+, r25 31f92: ca 55 subi r28, 0x5A ; 90 31f94: de 4f sbci r29, 0xFE ; 254 31f96: f9 83 std Y+1, r31 ; 0x01 31f98: e8 83 st Y, r30 31f9a: c6 5a subi r28, 0xA6 ; 166 31f9c: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 31f9e: c8 56 subi r28, 0x68 ; 104 31fa0: de 4f sbci r29, 0xFE ; 254 31fa2: a8 81 ld r26, Y 31fa4: b9 81 ldd r27, Y+1 ; 0x01 31fa6: c8 59 subi r28, 0x98 ; 152 31fa8: d1 40 sbci r29, 0x01 ; 1 31faa: cd 92 st X+, r12 31fac: dd 92 st X+, r13 31fae: ed 92 st X+, r14 31fb0: fd 92 st X+, r15 31fb2: c8 56 subi r28, 0x68 ; 104 31fb4: de 4f sbci r29, 0xFE ; 254 31fb6: b9 83 std Y+1, r27 ; 0x01 31fb8: a8 83 st Y, r26 31fba: c8 59 subi r28, 0x98 ; 152 31fbc: d1 40 sbci r29, 0x01 ; 1 31fbe: bf ef ldi r27, 0xFF ; 255 31fc0: 2b 1a sub r2, r27 31fc2: 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){ 31fc4: e1 e2 ldi r30, 0x21 ; 33 31fc6: 2e 16 cp r2, r30 31fc8: 31 04 cpc r3, r1 31fca: 09 f0 breq .+2 ; 0x31fce 31fcc: 10 ce rjmp .-992 ; 0x31bee 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); 31fce: 40 e0 ldi r20, 0x00 ; 0 31fd0: 50 e0 ldi r21, 0x00 ; 0 31fd2: 60 e0 ldi r22, 0x00 ; 0 31fd4: 7d e3 ldi r23, 0x3D ; 61 31fd6: ce 01 movw r24, r28 31fd8: 87 5f subi r24, 0xF7 ; 247 31fda: 9e 4f sbci r25, 0xFE ; 254 31fdc: 0f 94 ec 6f call 0x2dfd8 ; 0x2dfd8 31fe0: 9b 01 movw r18, r22 31fe2: ac 01 movw r20, r24 31fe4: c3 57 subi r28, 0x73 ; 115 31fe6: de 4f sbci r29, 0xFE ; 254 31fe8: a8 81 ld r26, Y 31fea: b9 81 ldd r27, Y+1 ; 0x01 31fec: cd 58 subi r28, 0x8D ; 141 31fee: d1 40 sbci r29, 0x01 ; 1 31ff0: 6d 91 ld r22, X+ 31ff2: 7d 91 ld r23, X+ 31ff4: 8d 91 ld r24, X+ 31ff6: 9c 91 ld r25, X 31ff8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 31ffc: c3 57 subi r28, 0x73 ; 115 31ffe: de 4f sbci r29, 0xFE ; 254 32000: e8 81 ld r30, Y 32002: f9 81 ldd r31, Y+1 ; 0x01 32004: cd 58 subi r28, 0x8D ; 141 32006: d1 40 sbci r29, 0x01 ; 1 32008: 60 83 st Z, r22 3200a: 71 83 std Z+1, r23 ; 0x01 3200c: 82 83 std Z+2, r24 ; 0x02 3200e: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 32010: 40 e0 ldi r20, 0x00 ; 0 32012: 50 e0 ldi r21, 0x00 ; 0 32014: 60 e0 ldi r22, 0x00 ; 0 32016: 7d e3 ldi r23, 0x3D ; 61 32018: ce 01 movw r24, r28 3201a: 8b 57 subi r24, 0x7B ; 123 3201c: 9f 4f sbci r25, 0xFF ; 255 3201e: 0f 94 ec 6f call 0x2dfd8 ; 0x2dfd8 32022: 9b 01 movw r18, r22 32024: ac 01 movw r20, r24 32026: c1 57 subi r28, 0x71 ; 113 32028: de 4f sbci r29, 0xFE ; 254 3202a: a8 81 ld r26, Y 3202c: b9 81 ldd r27, Y+1 ; 0x01 3202e: cf 58 subi r28, 0x8F ; 143 32030: d1 40 sbci r29, 0x01 ; 1 32032: 6d 91 ld r22, X+ 32034: 7d 91 ld r23, X+ 32036: 8d 91 ld r24, X+ 32038: 9c 91 ld r25, X 3203a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3203e: c1 57 subi r28, 0x71 ; 113 32040: de 4f sbci r29, 0xFE ; 254 32042: e8 81 ld r30, Y 32044: f9 81 ldd r31, Y+1 ; 0x01 32046: cf 58 subi r28, 0x8F ; 143 32048: d1 40 sbci r29, 0x01 ; 1 3204a: 60 83 st Z, r22 3204c: 71 83 std Z+1, r23 ; 0x01 3204e: 82 83 std Z+2, r24 ; 0x02 32050: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 32052: 40 e0 ldi r20, 0x00 ; 0 32054: 50 e0 ldi r21, 0x00 ; 0 32056: 60 e8 ldi r22, 0x80 ; 128 32058: 7c e3 ldi r23, 0x3C ; 60 3205a: ce 01 movw r24, r28 3205c: 01 96 adiw r24, 0x01 ; 1 3205e: 0f 94 ec 6f call 0x2dfd8 ; 0x2dfd8 32062: ce 56 subi r28, 0x6E ; 110 32064: de 4f sbci r29, 0xFE ; 254 32066: a8 81 ld r26, Y 32068: b9 81 ldd r27, Y+1 ; 0x01 3206a: c2 59 subi r28, 0x92 ; 146 3206c: d1 40 sbci r29, 0x01 ; 1 3206e: 2d 91 ld r18, X+ 32070: 3d 91 ld r19, X+ 32072: 4d 91 ld r20, X+ 32074: 5c 91 ld r21, X 32076: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3207a: 16 2f mov r17, r22 3207c: 07 2f mov r16, r23 3207e: f8 2e mov r15, r24 32080: e9 2e mov r14, r25 r = MAX(2, r); 32082: 20 e0 ldi r18, 0x00 ; 0 32084: 30 e0 ldi r19, 0x00 ; 0 32086: 40 e0 ldi r20, 0x00 ; 0 32088: 50 e4 ldi r21, 0x40 ; 64 3208a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3208e: 18 16 cp r1, r24 32090: 2c f0 brlt .+10 ; 0x3209c 32092: 10 e0 ldi r17, 0x00 ; 0 32094: 00 e0 ldi r16, 0x00 ; 0 32096: f1 2c mov r15, r1 32098: 80 e4 ldi r24, 0x40 ; 64 3209a: e8 2e mov r14, r24 3209c: a8 01 movw r20, r16 3209e: 97 01 movw r18, r14 320a0: 85 2f mov r24, r21 320a2: 90 2f mov r25, r16 320a4: a3 2f mov r26, r19 320a6: be 2d mov r27, r14 320a8: ce 56 subi r28, 0x6E ; 110 320aa: de 4f sbci r29, 0xFE ; 254 320ac: e8 81 ld r30, Y 320ae: f9 81 ldd r31, Y+1 ; 0x01 320b0: c2 59 subi r28, 0x92 ; 146 320b2: d1 40 sbci r29, 0x01 ; 1 320b4: 80 83 st Z, r24 320b6: 91 83 std Z+1, r25 ; 0x01 320b8: a2 83 std Z+2, r26 ; 0x02 320ba: b3 83 std Z+3, r27 ; 0x03 320bc: cf 56 subi r28, 0x6F ; 111 320be: de 4f sbci r29, 0xFE ; 254 320c0: f8 81 ld r31, Y 320c2: c1 59 subi r28, 0x91 ; 145 320c4: d1 40 sbci r29, 0x01 ; 1 320c6: f1 50 subi r31, 0x01 ; 1 320c8: cf 56 subi r28, 0x6F ; 111 320ca: de 4f sbci r29, 0xFE ; 254 320cc: f8 83 st Y, r31 320ce: c1 59 subi r28, 0x91 ; 145 320d0: 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){ 320d2: f1 11 cpse r31, r1 320d4: 37 cd rjmp .-1426 ; 0x31b44 r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 320d6: ef 92 push r14 320d8: ff 92 push r15 320da: 0f 93 push r16 320dc: 1f 93 push r17 320de: c1 57 subi r28, 0x71 ; 113 320e0: de 4f sbci r29, 0xFE ; 254 320e2: a8 81 ld r26, Y 320e4: b9 81 ldd r27, Y+1 ; 0x01 320e6: cf 58 subi r28, 0x8F ; 143 320e8: d1 40 sbci r29, 0x01 ; 1 320ea: 13 96 adiw r26, 0x03 ; 3 320ec: 8c 91 ld r24, X 320ee: 13 97 sbiw r26, 0x03 ; 3 320f0: 8f 93 push r24 320f2: 12 96 adiw r26, 0x02 ; 2 320f4: 8c 91 ld r24, X 320f6: 12 97 sbiw r26, 0x02 ; 2 320f8: 8f 93 push r24 320fa: 11 96 adiw r26, 0x01 ; 1 320fc: 8c 91 ld r24, X 320fe: 11 97 sbiw r26, 0x01 ; 1 32100: 8f 93 push r24 32102: 8c 91 ld r24, X 32104: 8f 93 push r24 32106: c3 57 subi r28, 0x73 ; 115 32108: de 4f sbci r29, 0xFE ; 254 3210a: e8 81 ld r30, Y 3210c: f9 81 ldd r31, Y+1 ; 0x01 3210e: cd 58 subi r28, 0x8D ; 141 32110: d1 40 sbci r29, 0x01 ; 1 32112: 83 81 ldd r24, Z+3 ; 0x03 32114: 8f 93 push r24 32116: 82 81 ldd r24, Z+2 ; 0x02 32118: 8f 93 push r24 3211a: 81 81 ldd r24, Z+1 ; 0x01 3211c: 8f 93 push r24 3211e: 80 81 ld r24, Z 32120: 8f 93 push r24 32122: 88 e3 ldi r24, 0x38 ; 56 32124: 95 ea ldi r25, 0xA5 ; 165 32126: 9f 93 push r25 32128: 8f 93 push r24 3212a: 0f 94 4b dc call 0x3b896 ; 0x3b896 3212e: 0f b6 in r0, 0x3f ; 63 32130: f8 94 cli 32132: de bf out 0x3e, r29 ; 62 32134: 0f be out 0x3f, r0 ; 63 32136: cd bf out 0x3d, r28 ; 61 } 32138: c3 54 subi r28, 0x43 ; 67 3213a: de 4f sbci r29, 0xFE ; 254 3213c: 0f b6 in r0, 0x3f ; 63 3213e: f8 94 cli 32140: de bf out 0x3e, r29 ; 62 32142: 0f be out 0x3f, r0 ; 63 32144: cd bf out 0x3d, r28 ; 61 32146: df 91 pop r29 32148: cf 91 pop r28 3214a: 1f 91 pop r17 3214c: 0f 91 pop r16 3214e: ff 90 pop r15 32150: ef 90 pop r14 32152: df 90 pop r13 32154: cf 90 pop r12 32156: bf 90 pop r11 32158: af 90 pop r10 3215a: 9f 90 pop r9 3215c: 8f 90 pop r8 3215e: 7f 90 pop r7 32160: 6f 90 pop r6 32162: 5f 90 pop r5 32164: 4f 90 pop r4 32166: 3f 90 pop r3 32168: 2f 90 pop r2 3216a: 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; 3216c: 60 e0 ldi r22, 0x00 ; 0 3216e: 70 e0 ldi r23, 0x00 ; 0 32170: cb 01 movw r24, r22 32172: d5 ce rjmp .-598 ; 0x31f1e 00032174 : } /// 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){ 32174: 2f 92 push r2 32176: 3f 92 push r3 32178: 4f 92 push r4 3217a: 5f 92 push r5 3217c: 6f 92 push r6 3217e: 7f 92 push r7 32180: 8f 92 push r8 32182: 9f 92 push r9 32184: af 92 push r10 32186: bf 92 push r11 32188: cf 92 push r12 3218a: df 92 push r13 3218c: ef 92 push r14 3218e: ff 92 push r15 32190: 0f 93 push r16 32192: 1f 93 push r17 32194: cf 93 push r28 32196: df 93 push r29 32198: 00 d0 rcall .+0 ; 0x3219a 3219a: 1f 92 push r1 3219c: 1f 92 push r1 3219e: cd b7 in r28, 0x3d ; 61 321a0: de b7 in r29, 0x3e ; 62 321a2: 2b 01 movw r4, r22 321a4: 1a 01 movw r2, r20 321a6: f1 2c mov r15, r1 321a8: 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; 321aa: 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; 321ac: 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; 321ae: 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){ 321b0: 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); 321b2: 66 24 eor r6, r6 321b4: 63 94 inc r6 321b6: 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){ 321b8: 70 e0 ldi r23, 0x00 ; 0 321ba: 60 e0 ldi r22, 0x00 ; 0 321bc: 97 01 movw r18, r14 321be: 2c 58 subi r18, 0x8C ; 140 321c0: 38 4f sbci r19, 0xF8 ; 248 321c2: 3a 83 std Y+2, r19 ; 0x02 321c4: 29 83 std Y+1, r18 ; 0x01 321c6: 86 2e mov r8, r22 321c8: c9 80 ldd r12, Y+1 ; 0x01 321ca: da 80 ldd r13, Y+2 ; 0x02 321cc: c6 0e add r12, r22 321ce: d7 1e adc r13, r23 321d0: 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; 321d2: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 321d4: 40 e0 ldi r20, 0x00 ; 0 321d6: 30 e0 ldi r19, 0x00 ; 0 321d8: 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; 321da: ae ef ldi r26, 0xFE ; 254 321dc: a4 0f add r26, r20 321de: 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; 321e0: 44 23 and r20, r20 321e2: 19 f0 breq .+6 ; 0x321ea 321e4: 4b 30 cpi r20, 0x0B ; 11 321e6: 09 f0 breq .+2 ; 0x321ea 321e8: 7d c0 rjmp .+250 ; 0x322e4 321ea: ae ef ldi r26, 0xFE ; 254 321ec: a2 0f add r26, r18 321ee: a8 30 cpi r26, 0x08 ; 8 321f0: 08 f4 brcc .+2 ; 0x321f4 321f2: 7a c0 rjmp .+244 ; 0x322e8 321f4: 2f 5f subi r18, 0xFF ; 255 321f6: 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){ 321f8: 2c 30 cpi r18, 0x0C ; 12 321fa: 31 05 cpc r19, r1 321fc: 89 f7 brne .-30 ; 0x321e0 /// 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){ 321fe: 4f 5f subi r20, 0xFF ; 255 32200: 20 e2 ldi r18, 0x20 ; 32 32202: c2 0e add r12, r18 32204: d1 1c adc r13, r1 32206: 32 96 adiw r30, 0x02 ; 2 32208: 4c 30 cpi r20, 0x0C ; 12 3220a: 29 f7 brne .-54 ; 0x321d6 // 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){ 3220c: 3c 81 ldd r19, Y+4 ; 0x04 3220e: 30 17 cp r19, r16 32210: 18 f4 brcc .+6 ; 0x32218 32212: 0c 83 std Y+4, r16 ; 0x04 32214: 5d 83 std Y+5, r21 ; 0x05 32216: 18 2d mov r17, r8 32218: 6f 5f subi r22, 0xFF ; 255 3221a: 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){ 3221c: 64 31 cpi r22, 0x14 ; 20 3221e: 71 05 cpc r23, r1 32220: 91 f6 brne .-92 ; 0x321c6 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){ 32222: 5f 5f subi r21, 0xFF ; 255 32224: a0 e2 ldi r26, 0x20 ; 32 32226: ea 0e add r14, r26 32228: f1 1c adc r15, r1 3222a: 54 31 cpi r21, 0x14 ; 20 3222c: 29 f6 brne .-118 ; 0x321b8 // 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); 3222e: ec 81 ldd r30, Y+4 ; 0x04 32230: 6e 2f mov r22, r30 32232: 70 e0 ldi r23, 0x00 ; 0 32234: 90 e0 ldi r25, 0x00 ; 0 32236: 80 e0 ldi r24, 0x00 ; 0 32238: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3223c: 23 ec ldi r18, 0xC3 ; 195 3223e: 35 ef ldi r19, 0xF5 ; 245 32240: 48 ea ldi r20, 0xA8 ; 168 32242: 5f e3 ldi r21, 0x3F ; 63 32244: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 32248: 9f 93 push r25 3224a: 8f 93 push r24 3224c: 7f 93 push r23 3224e: 6f 93 push r22 32250: fd 81 ldd r31, Y+5 ; 0x05 32252: 6f 2f mov r22, r31 32254: 70 e0 ldi r23, 0x00 ; 0 32256: 90 e0 ldi r25, 0x00 ; 0 32258: 80 e0 ldi r24, 0x00 ; 0 3225a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3225e: 20 e0 ldi r18, 0x00 ; 0 32260: 30 e0 ldi r19, 0x00 ; 0 32262: 40 eb ldi r20, 0xB0 ; 176 32264: 50 e4 ldi r21, 0x40 ; 64 32266: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3226a: 9f 93 push r25 3226c: 8f 93 push r24 3226e: 7f 93 push r23 32270: 6f 93 push r22 32272: 61 2f mov r22, r17 32274: 70 e0 ldi r23, 0x00 ; 0 32276: 90 e0 ldi r25, 0x00 ; 0 32278: 80 e0 ldi r24, 0x00 ; 0 3227a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3227e: 20 e0 ldi r18, 0x00 ; 0 32280: 30 e0 ldi r19, 0x00 ; 0 32282: 40 eb ldi r20, 0xB0 ; 176 32284: 50 e4 ldi r21, 0x40 ; 64 32286: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3228a: 9f 93 push r25 3228c: 8f 93 push r24 3228e: 7f 93 push r23 32290: 6f 93 push r22 32292: 84 e1 ldi r24, 0x14 ; 20 32294: 95 ea ldi r25, 0xA5 ; 165 32296: 9f 93 push r25 32298: 8f 93 push r24 3229a: 0f 94 4b dc call 0x3b896 ; 0x3b896 *pc = max_c; 3229e: f2 01 movw r30, r4 322a0: 10 83 st Z, r17 *pr = max_r; 322a2: 2d 81 ldd r18, Y+5 ; 0x05 322a4: f1 01 movw r30, r2 322a6: 20 83 st Z, r18 322a8: 0f b6 in r0, 0x3f ; 63 322aa: f8 94 cli 322ac: de bf out 0x3e, r29 ; 62 322ae: 0f be out 0x3f, r0 ; 63 322b0: cd bf out 0x3d, r28 ; 61 return max_match; } 322b2: 8c 81 ldd r24, Y+4 ; 0x04 322b4: 0f 90 pop r0 322b6: 0f 90 pop r0 322b8: 0f 90 pop r0 322ba: 0f 90 pop r0 322bc: 0f 90 pop r0 322be: df 91 pop r29 322c0: cf 91 pop r28 322c2: 1f 91 pop r17 322c4: 0f 91 pop r16 322c6: ff 90 pop r15 322c8: ef 90 pop r14 322ca: df 90 pop r13 322cc: cf 90 pop r12 322ce: bf 90 pop r11 322d0: af 90 pop r10 322d2: 9f 90 pop r9 322d4: 8f 90 pop r8 322d6: 7f 90 pop r7 322d8: 6f 90 pop r6 322da: 5f 90 pop r5 322dc: 4f 90 pop r4 322de: 3f 90 pop r3 322e0: 2f 90 pop r2 322e2: 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; 322e4: 22 23 and r18, r18 322e6: 11 f0 breq .+4 ; 0x322ec 322e8: 2b 30 cpi r18, 0x0B ; 11 322ea: 21 f4 brne .+8 ; 0x322f4 322ec: ab 81 ldd r26, Y+3 ; 0x03 322ee: a8 30 cpi r26, 0x08 ; 8 322f0: 08 f0 brcs .+2 ; 0x322f4 322f2: 80 cf rjmp .-256 ; 0x321f4 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 322f4: 99 24 eor r9, r9 322f6: 93 94 inc r9 322f8: d6 01 movw r26, r12 322fa: a2 0f add r26, r18 322fc: b3 1f adc r27, r19 322fe: ac 91 ld r26, X 32300: a1 31 cpi r26, 0x11 ; 17 32302: 08 f4 brcc .+2 ; 0x32306 32304: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 32306: a0 80 ld r10, Z 32308: b1 80 ldd r11, Z+1 ; 0x01 3230a: d3 01 movw r26, r6 3230c: 02 2e mov r0, r18 3230e: 02 c0 rjmp .+4 ; 0x32314 32310: aa 0f add r26, r26 32312: bb 1f adc r27, r27 32314: 0a 94 dec r0 32316: e2 f7 brpl .-8 ; 0x32310 32318: aa 21 and r26, r10 3231a: bb 21 and r27, r11 3231c: bb 24 eor r11, r11 3231e: b3 94 inc r11 32320: ab 2b or r26, r27 32322: 09 f4 brne .+2 ; 0x32326 32324: b1 2c mov r11, r1 if (high_pix == high_pat) 32326: 9b 10 cpse r9, r11 32328: 65 cf rjmp .-310 ; 0x321f4 match++; 3232a: 0f 5f subi r16, 0xFF ; 255 3232c: 63 cf rjmp .-314 ; 0x321f4 0003232e : 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){ 3232e: 2f 92 push r2 32330: 3f 92 push r3 32332: 4f 92 push r4 32334: 5f 92 push r5 32336: 6f 92 push r6 32338: 7f 92 push r7 3233a: 8f 92 push r8 3233c: 9f 92 push r9 3233e: af 92 push r10 32340: bf 92 push r11 32342: cf 92 push r12 32344: df 92 push r13 32346: ef 92 push r14 32348: ff 92 push r15 3234a: 0f 93 push r16 3234c: 1f 93 push r17 3234e: cf 93 push r28 32350: df 93 push r29 32352: cd b7 in r28, 0x3d ; 61 32354: de b7 in r29, 0x3e ; 62 32356: ca 55 subi r28, 0x5A ; 90 32358: d1 09 sbc r29, r1 3235a: 0f b6 in r0, 0x3f ; 63 3235c: f8 94 cli 3235e: de bf out 0x3e, r29 ; 62 32360: 0f be out 0x3f, r0 ; 63 32362: cd bf out 0x3d, r28 ; 61 32364: 63 96 adiw r28, 0x13 ; 19 32366: 9f af std Y+63, r25 ; 0x3f 32368: 8e af std Y+62, r24 ; 0x3e 3236a: 63 97 sbiw r28, 0x13 ; 19 3236c: 8b 01 movw r16, r22 3236e: 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 32370: 7e 01 movw r14, r28 32372: 25 e4 ldi r18, 0x45 ; 69 32374: e2 0e add r14, r18 32376: f1 1c adc r15, r1 32378: 80 e1 ldi r24, 0x10 ; 16 3237a: 97 e2 ldi r25, 0x27 ; 39 3237c: f7 01 movw r30, r14 3237e: 91 83 std Z+1, r25 ; 0x01 32380: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 32382: 83 e0 ldi r24, 0x03 ; 3 32384: 95 ea ldi r25, 0xA5 ; 165 32386: 9f 93 push r25 32388: 8f 93 push r24 3238a: 0f 94 4b dc call 0x3b896 ; 0x3b896 3238e: 24 e7 ldi r18, 0x74 ; 116 32390: 37 e0 ldi r19, 0x07 ; 7 32392: 61 96 adiw r28, 0x11 ; 17 32394: 3f af std Y+63, r19 ; 0x3f 32396: 2e af std Y+62, r18 ; 0x3e 32398: 61 97 sbiw r28, 0x11 ; 17 3239a: c8 01 movw r24, r16 3239c: 80 5e subi r24, 0xE0 ; 224 3239e: 93 40 sbci r25, 0x03 ; 3 323a0: 2b 96 adiw r28, 0x0b ; 11 323a2: 9f af std Y+63, r25 ; 0x3f 323a4: 8e af std Y+62, r24 ; 0x3e 323a6: 2b 97 sbiw r28, 0x0b ; 11 323a8: 0f 90 pop r0 323aa: 0f 90 pop r0 323ac: e0 e4 ldi r30, 0x40 ; 64 323ae: f0 e0 ldi r31, 0x00 ; 0 323b0: 29 96 adiw r28, 0x09 ; 9 323b2: ff af std Y+63, r31 ; 0x3f 323b4: ee af std Y+62, r30 ; 0x3e 323b6: 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); 323b8: 63 96 adiw r28, 0x13 ; 19 323ba: 2e ad ldd r18, Y+62 ; 0x3e 323bc: 3f ad ldd r19, Y+63 ; 0x3f 323be: 63 97 sbiw r28, 0x13 ; 19 323c0: 20 5e subi r18, 0xE0 ; 224 323c2: 33 40 sbci r19, 0x03 ; 3 323c4: 69 96 adiw r28, 0x19 ; 25 323c6: 3f af std Y+63, r19 ; 0x3f 323c8: 2e af std Y+62, r18 ; 0x3e 323ca: 69 97 sbiw r28, 0x19 ; 25 323cc: 29 96 adiw r28, 0x09 ; 9 323ce: 4e ac ldd r4, Y+62 ; 0x3e 323d0: 5f ac ldd r5, Y+63 ; 0x3f 323d2: 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){ 323d4: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 323d6: 63 96 adiw r28, 0x13 ; 19 323d8: 8e ad ldd r24, Y+62 ; 0x3e 323da: 9f ad ldd r25, Y+63 ; 0x3f 323dc: 63 97 sbiw r28, 0x13 ; 19 323de: 80 52 subi r24, 0x20 ; 32 323e0: 9c 4f sbci r25, 0xFC ; 252 323e2: 6b 96 adiw r28, 0x1b ; 27 323e4: 9f af std Y+63, r25 ; 0x3f 323e6: 8e af std Y+62, r24 ; 0x3e 323e8: 6b 97 sbiw r28, 0x1b ; 27 323ea: 60 90 6a 07 lds r6, 0x076A ; 0x80076a 323ee: 70 90 6b 07 lds r7, 0x076B ; 0x80076b 323f2: 80 90 6c 07 lds r8, 0x076C ; 0x80076c 323f6: 90 90 6d 07 lds r9, 0x076D ; 0x80076d 323fa: 6b 96 adiw r28, 0x1b ; 27 323fc: ae ac ldd r10, Y+62 ; 0x3e 323fe: bf ac ldd r11, Y+63 ; 0x3f 32400: 6b 97 sbiw r28, 0x1b ; 27 32402: 31 10 cpse r3, r1 32404: 04 c0 rjmp .+8 ; 0x3240e 32406: 69 96 adiw r28, 0x19 ; 25 32408: ae ac ldd r10, Y+62 ; 0x3e 3240a: bf ac ldd r11, Y+63 ; 0x3f 3240c: 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; 3240e: 80 91 62 07 lds r24, 0x0762 ; 0x800762 32412: 90 91 63 07 lds r25, 0x0763 ; 0x800763 32416: a0 91 64 07 lds r26, 0x0764 ; 0x800764 3241a: b0 91 65 07 lds r27, 0x0765 ; 0x800765 3241e: f5 01 movw r30, r10 32420: e8 1b sub r30, r24 32422: f9 0b sbc r31, r25 32424: 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) 32426: 71 f0 breq .+28 ; 0x32444 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)); 32428: af 01 movw r20, r30 3242a: f7 ff sbrs r31, 7 3242c: 04 c0 rjmp .+8 ; 0x32436 3242e: 44 27 eor r20, r20 32430: 55 27 eor r21, r21 32432: 4e 1b sub r20, r30 32434: 5f 0b sbc r21, r31 32436: 69 2f mov r22, r25 32438: 66 1f adc r22, r22 3243a: 66 27 eor r22, r22 3243c: 66 1f adc r22, r22 3243e: 81 e0 ldi r24, 0x01 ; 1 32440: 0f 94 13 75 call 0x2ea26 ; 0x2ea26 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 32444: 80 91 66 07 lds r24, 0x0766 ; 0x800766 32448: 90 91 67 07 lds r25, 0x0767 ; 0x800767 3244c: a0 91 68 07 lds r26, 0x0768 ; 0x800768 32450: b0 91 69 07 lds r27, 0x0769 ; 0x800769 32454: 2b 96 adiw r28, 0x0b ; 11 32456: 4e ad ldd r20, Y+62 ; 0x3e 32458: 5f ad ldd r21, Y+63 ; 0x3f 3245a: 2b 97 sbiw r28, 0x0b ; 11 3245c: 48 1b sub r20, r24 3245e: 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)); 32460: 57 fd sbrc r21, 7 32462: b2 c0 rjmp .+356 ; 0x325c8 32464: 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) 32466: 41 15 cp r20, r1 32468: 51 05 cpc r21, r1 3246a: 09 f0 breq .+2 ; 0x3246e 3246c: ae c0 rjmp .+348 ; 0x325ca // 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; 3246e: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 32472: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 32476: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 3247a: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 3247e: 68 1a sub r6, r24 32480: 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)); 32482: 77 fc sbrc r7, 7 32484: ab c0 rjmp .+342 ; 0x325dc 32486: 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) 32488: 61 14 cp r6, r1 3248a: 71 04 cpc r7, r1 3248c: 09 f0 breq .+2 ; 0x32490 3248e: a7 c0 rjmp .+334 ; 0x325de 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); 32490: 40 91 6a 07 lds r20, 0x076A ; 0x80076a 32494: 50 91 6b 07 lds r21, 0x076B ; 0x80076b 32498: 60 91 6c 07 lds r22, 0x076C ; 0x80076c 3249c: 70 91 6d 07 lds r23, 0x076D ; 0x80076d 324a0: 00 e0 ldi r16, 0x00 ; 0 324a2: 28 ec ldi r18, 0xC8 ; 200 324a4: 30 e0 ldi r19, 0x00 ; 0 324a6: 2b 96 adiw r28, 0x0b ; 11 324a8: 6e ad ldd r22, Y+62 ; 0x3e 324aa: 7f ad ldd r23, Y+63 ; 0x3f 324ac: 2b 97 sbiw r28, 0x0b ; 11 324ae: c5 01 movw r24, r10 324b0: 0e 94 ec e1 call 0x1c3d8 ; 0x1c3d8 sm4_set_dir(X_AXIS, d); 324b4: 63 2d mov r22, r3 324b6: 80 e0 ldi r24, 0x00 ; 0 324b8: 0f 94 6f 6b call 0x2d6de ; 0x2d6de //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 324bc: 5f 92 push r5 324be: 4f 92 push r4 324c0: 8f ef ldi r24, 0xFF ; 255 324c2: 94 ea ldi r25, 0xA4 ; 164 324c4: 9f 93 push r25 324c6: 8f 93 push r24 324c8: 0f 94 4b dc call 0x3b896 ; 0x3b896 lcd_set_cursor(4,3); 324cc: 63 e0 ldi r22, 0x03 ; 3 324ce: 84 e0 ldi r24, 0x04 ; 4 324d0: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 324d4: 5f 92 push r5 324d6: 4f 92 push r4 324d8: 80 ef ldi r24, 0xF0 ; 240 324da: 94 ea ldi r25, 0xA4 ; 164 324dc: 9f 93 push r25 324de: 8f 93 push r24 324e0: 0e 94 66 6f call 0xdecc ; 0xdecc 324e4: 0f b6 in r0, 0x3f ; 63 324e6: f8 94 cli 324e8: de bf out 0x3e, r29 ; 62 324ea: 0f be out 0x3f, r0 ; 63 324ec: cd bf out 0x3d, r28 ; 61 324ee: 21 e0 ldi r18, 0x01 ; 1 324f0: 30 e0 ldi r19, 0x00 ; 0 324f2: 31 10 cpse r3, r1 324f4: 02 c0 rjmp .+4 ; 0x324fa 324f6: 2f ef ldi r18, 0xFF ; 255 324f8: 3f ef ldi r19, 0xFF ; 255 324fa: 40 ec ldi r20, 0xC0 ; 192 324fc: 42 03 mulsu r20, r18 324fe: c0 01 movw r24, r0 32500: 43 9f mul r20, r19 32502: 90 0d add r25, r0 32504: 11 24 eor r1, r1 32506: 67 96 adiw r28, 0x17 ; 23 32508: 9f af std Y+63, r25 ; 0x3f 3250a: 8e af std Y+62, r24 ; 0x3e 3250c: 67 97 sbiw r28, 0x17 ; 23 3250e: 40 ee ldi r20, 0xE0 ; 224 32510: 53 e0 ldi r21, 0x03 ; 3 32512: 24 9f mul r18, r20 32514: 40 01 movw r8, r0 32516: 25 9f mul r18, r21 32518: 90 0c add r9, r0 3251a: 34 9f mul r19, r20 3251c: 90 0c add r9, r0 3251e: 11 24 eor r1, r1 32520: 63 96 adiw r28, 0x13 ; 19 32522: ee ad ldd r30, Y+62 ; 0x3e 32524: ff ad ldd r31, Y+63 ; 0x3f 32526: 63 97 sbiw r28, 0x13 ; 19 32528: 8e 0e add r8, r30 3252a: 9f 1e adc r9, r31 3252c: 9e 01 movw r18, r28 3252e: 2f 5f subi r18, 0xFF ; 255 32530: 3f 4f sbci r19, 0xFF ; 255 32532: 2d 96 adiw r28, 0x0d ; 13 32534: 3f af std Y+63, r19 ; 0x3f 32536: 2e af std Y+62, r18 ; 0x3e 32538: 2d 97 sbiw r28, 0x0d ; 13 3253a: 61 96 adiw r28, 0x11 ; 17 3253c: 8e ad ldd r24, Y+62 ; 0x3e 3253e: 9f ad ldd r25, Y+63 ; 0x3f 32540: 61 97 sbiw r28, 0x11 ; 17 32542: 2f 96 adiw r28, 0x0f ; 15 32544: 9f af std Y+63, r25 ; 0x3f 32546: 8e af std Y+62, r24 ; 0x3e 32548: 2f 97 sbiw r28, 0x0f ; 15 3254a: 71 2c mov r7, r1 3254c: 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; 3254e: e0 e1 ldi r30, 0x10 ; 16 32550: f7 e2 ldi r31, 0x27 ; 39 32552: 27 96 adiw r28, 0x07 ; 7 32554: ff af std Y+63, r31 ; 0x3f 32556: ee af std Y+62, r30 ; 0x3e 32558: 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); 3255a: 80 91 62 07 lds r24, 0x0762 ; 0x800762 3255e: 90 91 63 07 lds r25, 0x0763 ; 0x800763 32562: a0 91 64 07 lds r26, 0x0764 ; 0x800764 32566: b0 91 65 07 lds r27, 0x0765 ; 0x800765 3256a: 84 01 movw r16, r8 3256c: 08 1b sub r16, r24 3256e: 19 0b sbc r17, r25 32570: 17 ff sbrs r17, 7 32572: 03 c0 rjmp .+6 ; 0x3257a 32574: 11 95 neg r17 32576: 01 95 neg r16 32578: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 3257a: 98 01 movw r18, r16 3257c: 35 95 asr r19 3257e: 27 95 ror r18 32580: 65 96 adiw r28, 0x15 ; 21 32582: 3f af std Y+63, r19 ; 0x3f 32584: 2e af std Y+62, r18 ; 0x3e 32586: 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; 32588: 1c 9b sbis 0x03, 4 ; 3 3258a: 33 c0 rjmp .+102 ; 0x325f2 3258c: 45 e0 ldi r20, 0x05 ; 5 3258e: 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); 32590: 65 96 adiw r28, 0x15 ; 21 32592: ae ac ldd r10, Y+62 ; 0x3e 32594: bf ac ldd r11, Y+63 ; 0x3f 32596: 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); 32598: 63 2d mov r22, r3 3259a: 82 2d mov r24, r2 3259c: 0e 94 93 e1 call 0x1c326 ; 0x1c326 while (steps--){ 325a0: 31 e0 ldi r19, 0x01 ; 1 325a2: a3 1a sub r10, r19 325a4: b1 08 sbc r11, r1 325a6: 40 f1 brcs .+80 ; 0x325f8 accelerate_1_step(axes, acc, delay_us, min_delay_us); 325a8: 28 ec ldi r18, 0xC8 ; 200 325aa: 30 e0 ldi r19, 0x00 ; 0 325ac: a7 01 movw r20, r14 325ae: 68 ee ldi r22, 0xE8 ; 232 325b0: 73 e0 ldi r23, 0x03 ; 3 325b2: 82 2d mov r24, r2 325b4: 0e 94 64 e0 call 0x1c0c8 ; 0x1c0c8 update_position_1_step(axes, dir); 325b8: 63 2d mov r22, r3 325ba: 82 2d mov r24, r2 325bc: 0e 94 ac e1 call 0x1c358 ; 0x1c358 325c0: ef cf rjmp .-34 ; 0x325a0 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){ 325c2: 33 24 eor r3, r3 325c4: 33 94 inc r3 325c6: 11 cf rjmp .-478 ; 0x323ea 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)); 325c8: 62 e0 ldi r22, 0x02 ; 2 325ca: 57 ff sbrs r21, 7 325cc: 03 c0 rjmp .+6 ; 0x325d4 325ce: 51 95 neg r21 325d0: 41 95 neg r20 325d2: 51 09 sbc r21, r1 325d4: 82 e0 ldi r24, 0x02 ; 2 325d6: 0f 94 13 75 call 0x2ea26 ; 0x2ea26 325da: 49 cf rjmp .-366 ; 0x3246e // 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)); 325dc: 64 e0 ldi r22, 0x04 ; 4 325de: a3 01 movw r20, r6 325e0: 77 fe sbrs r7, 7 325e2: 03 c0 rjmp .+6 ; 0x325ea 325e4: 51 95 neg r21 325e6: 41 95 neg r20 325e8: 51 09 sbc r21, r1 325ea: 84 e0 ldi r24, 0x04 ; 4 325ec: 0f 94 13 75 call 0x2ea26 ; 0x2ea26 325f0: 4f cf rjmp .-354 ; 0x32490 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; 325f2: 22 24 eor r2, r2 325f4: 23 94 inc r2 325f6: cc cf rjmp .-104 ; 0x32590 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); 325f8: 65 96 adiw r28, 0x15 ; 21 325fa: ee ad ldd r30, Y+62 ; 0x3e 325fc: ff ad ldd r31, Y+63 ; 0x3f 325fe: 65 97 sbiw r28, 0x15 ; 21 32600: 0e 1b sub r16, r30 32602: 1f 0b sbc r17, r31 32604: 23 96 adiw r28, 0x03 ; 3 32606: 1f af std Y+63, r17 ; 0x3f 32608: 0e af std Y+62, r16 ; 0x3e 3260a: 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); 3260c: 63 2d mov r22, r3 3260e: 82 2d mov r24, r2 32610: 0e 94 93 e1 call 0x1c326 ; 0x1c326 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 32614: 9e 01 movw r18, r28 32616: 2f 5b subi r18, 0xBF ; 191 32618: 3f 4f sbci r19, 0xFF ; 255 3261a: a7 01 movw r20, r14 3261c: 68 ee ldi r22, 0xE8 ; 232 3261e: 73 e0 ldi r23, 0x03 ; 3 32620: 82 2d mov r24, r2 32622: 0e 94 0a e1 call 0x1c214 ; 0x1c214 32626: 88 23 and r24, r24 32628: 29 f0 breq .+10 ; 0x32634 update_position_1_step(axes, dir); 3262a: 63 2d mov r22, r3 3262c: 82 2d mov r24, r2 3262e: 0e 94 ac e1 call 0x1c358 ; 0x1c358 32632: f0 cf rjmp .-32 ; 0x32614 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 32634: 60 e0 ldi r22, 0x00 ; 0 32636: 82 e0 ldi r24, 0x02 ; 2 32638: 0f 94 6f 6b call 0x2d6de ; 0x2d6de /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 3263c: 20 e1 ldi r18, 0x10 ; 16 3263e: 37 e2 ldi r19, 0x27 ; 39 32640: 27 96 adiw r28, 0x07 ; 7 32642: 3f af std Y+63, r19 ; 0x3f 32644: 2e af std Y+62, r18 ; 0x3e 32646: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 32648: 00 91 6a 07 lds r16, 0x076A ; 0x80076a 3264c: 10 91 6b 07 lds r17, 0x076B ; 0x80076b 32650: 20 91 6c 07 lds r18, 0x076C ; 0x80076c 32654: 30 91 6d 07 lds r19, 0x076D ; 0x80076d 32658: 00 5a subi r16, 0xA0 ; 160 3265a: 16 4f sbci r17, 0xF6 ; 246 3265c: 17 ff sbrs r17, 7 3265e: 02 c0 rjmp .+4 ; 0x32664 32660: 0f 5f subi r16, 0xFF ; 255 32662: 1f 4f sbci r17, 0xFF ; 255 32664: 15 95 asr r17 32666: 07 95 ror r16 32668: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 3266c: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 32670: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 32674: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 32678: 80 17 cp r24, r16 3267a: 91 07 cpc r25, r17 3267c: f4 f4 brge .+60 ; 0x326ba if (!_PINDA){ 3267e: 1c 9b sbis 0x03, 4 ; 3 32680: 1c c0 rjmp .+56 ; 0x326ba break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 32682: 28 ec ldi r18, 0xC8 ; 200 32684: 30 e0 ldi r19, 0x00 ; 0 32686: a7 01 movw r20, r14 32688: 68 ee ldi r22, 0xE8 ; 232 3268a: 73 e0 ldi r23, 0x03 ; 3 3268c: 84 e0 ldi r24, 0x04 ; 4 3268e: 0e 94 64 e0 call 0x1c0c8 ; 0x1c0c8 /// 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_){ 32692: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 32696: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 3269a: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 3269e: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 326a2: 01 96 adiw r24, 0x01 ; 1 326a4: a1 1d adc r26, r1 326a6: b1 1d adc r27, r1 326a8: 80 93 6a 07 sts 0x076A, r24 ; 0x80076a 326ac: 90 93 6b 07 sts 0x076B, r25 ; 0x80076b 326b0: a0 93 6c 07 sts 0x076C, r26 ; 0x80076c 326b4: b0 93 6d 07 sts 0x076D, r27 ; 0x80076d 326b8: d7 cf rjmp .-82 ; 0x32668 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 326ba: 1c 9b sbis 0x03, 4 ; 3 326bc: 3f c0 rjmp .+126 ; 0x3273c steps_to_go = MAX(0, max_z - _Z); 326be: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 326c2: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 326c6: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 326ca: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 326ce: e0 e6 ldi r30, 0x60 ; 96 326d0: f9 e0 ldi r31, 0x09 ; 9 326d2: e8 1b sub r30, r24 326d4: f9 0b sbc r31, r25 326d6: cf 01 movw r24, r30 326d8: f7 ff sbrs r31, 7 326da: 02 c0 rjmp .+4 ; 0x326e0 326dc: 90 e0 ldi r25, 0x00 ; 0 326de: 80 e0 ldi r24, 0x00 ; 0 326e0: 25 96 adiw r28, 0x05 ; 5 326e2: 9f af std Y+63, r25 ; 0x3f 326e4: 8e af std Y+62, r24 ; 0x3e 326e6: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 326e8: 1c 9b sbis 0x03, 4 ; 3 326ea: 28 c0 rjmp .+80 ; 0x3273c 326ec: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 326f0: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 326f4: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 326f8: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 326fc: 80 36 cpi r24, 0x60 ; 96 326fe: 99 40 sbci r25, 0x09 ; 9 32700: ec f4 brge .+58 ; 0x3273c go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 32702: 9e 01 movw r18, r28 32704: 2d 5b subi r18, 0xBD ; 189 32706: 3f 4f sbci r19, 0xFF ; 255 32708: a7 01 movw r20, r14 3270a: 68 ee ldi r22, 0xE8 ; 232 3270c: 73 e0 ldi r23, 0x03 ; 3 3270e: 84 e0 ldi r24, 0x04 ; 4 32710: 0e 94 0a e1 call 0x1c214 ; 0x1c214 ++_Z_; 32714: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 32718: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 3271c: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 32720: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 32724: 01 96 adiw r24, 0x01 ; 1 32726: a1 1d adc r26, r1 32728: b1 1d adc r27, r1 3272a: 80 93 6a 07 sts 0x076A, r24 ; 0x80076a 3272e: 90 93 6b 07 sts 0x076B, r25 ; 0x80076b 32732: a0 93 6c 07 sts 0x076C, r26 ; 0x80076c 32736: b0 93 6d 07 sts 0x076D, r27 ; 0x80076d 3273a: d6 cf rjmp .-84 ; 0x326e8 /// \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); 3273c: 60 e0 ldi r22, 0x00 ; 0 3273e: 84 e0 ldi r24, 0x04 ; 4 32740: 0e 94 93 e1 call 0x1c326 ; 0x1c326 while (delay_us < MAX_DELAY){ 32744: f7 01 movw r30, r14 32746: 20 81 ld r18, Z 32748: 31 81 ldd r19, Z+1 ; 0x01 3274a: 20 31 cpi r18, 0x10 ; 16 3274c: f7 e2 ldi r31, 0x27 ; 39 3274e: 3f 07 cpc r19, r31 32750: 58 f4 brcc .+22 ; 0x32768 accelerate_1_step(axes, -dec, delay_us, delay_us); 32752: a7 01 movw r20, r14 32754: 68 e1 ldi r22, 0x18 ; 24 32756: 7c ef ldi r23, 0xFC ; 252 32758: 84 e0 ldi r24, 0x04 ; 4 3275a: 0e 94 64 e0 call 0x1c0c8 ; 0x1c0c8 update_position_1_step(axes, dir); 3275e: 60 e0 ldi r22, 0x00 ; 0 32760: 84 e0 ldi r24, 0x04 ; 4 32762: 0e 94 ac e1 call 0x1c358 ; 0x1c358 32766: ee cf rjmp .-36 ; 0x32744 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 32768: 61 e0 ldi r22, 0x01 ; 1 3276a: 82 e0 ldi r24, 0x02 ; 2 3276c: 0f 94 6f 6b call 0x2d6de ; 0x2d6de /// speed up current_delay_us = MAX_DELAY; 32770: 20 e1 ldi r18, 0x10 ; 16 32772: 37 e2 ldi r19, 0x27 ; 39 32774: f7 01 movw r30, r14 32776: 31 83 std Z+1, r19 ; 0x01 32778: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 3277a: 00 91 6a 07 lds r16, 0x076A ; 0x80076a 3277e: 10 91 6b 07 lds r17, 0x076B ; 0x80076b 32782: 20 91 6c 07 lds r18, 0x076C ; 0x80076c 32786: 30 91 6d 07 lds r19, 0x076D ; 0x80076d 3278a: 0c 0d add r16, r12 3278c: 1d 1d adc r17, r13 3278e: 17 ff sbrs r17, 7 32790: 02 c0 rjmp .+4 ; 0x32796 32792: 0f 5f subi r16, 0xFF ; 255 32794: 1f 4f sbci r17, 0xFF ; 255 32796: 15 95 asr r17 32798: 07 95 ror r16 3279a: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 3279e: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 327a2: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 327a6: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 327aa: 08 17 cp r16, r24 327ac: 19 07 cpc r17, r25 327ae: 0c f0 brlt .+2 ; 0x327b2 327b0: d9 c0 rjmp .+434 ; 0x32964 if (_PINDA){ 327b2: 1c 9b sbis 0x03, 4 ; 3 327b4: bb c0 rjmp .+374 ; 0x3292c z_trig = _Z; 327b6: 00 91 6a 07 lds r16, 0x076A ; 0x80076a 327ba: 10 91 6b 07 lds r17, 0x076B ; 0x80076b 327be: 20 91 6c 07 lds r18, 0x076C ; 0x80076c 327c2: 30 91 6d 07 lds r19, 0x076D ; 0x80076d break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 327c6: 1c 99 sbic 0x03, 4 ; 3 327c8: 28 c0 rjmp .+80 ; 0x3281a steps_to_go = MAX(0, _Z - min_z); 327ca: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 327ce: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 327d2: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 327d6: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 327da: 8c 19 sub r24, r12 327dc: 9d 09 sbc r25, r13 327de: 97 ff sbrs r25, 7 327e0: 02 c0 rjmp .+4 ; 0x327e6 327e2: 90 e0 ldi r25, 0x00 ; 0 327e4: 80 e0 ldi r24, 0x00 ; 0 327e6: 25 96 adiw r28, 0x05 ; 5 327e8: 9f af std Y+63, r25 ; 0x3f 327ea: 8e af std Y+62, r24 ; 0x3e 327ec: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 327ee: 1c 99 sbic 0x03, 4 ; 3 327f0: 0c c0 rjmp .+24 ; 0x3280a 327f2: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 327f6: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 327fa: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 327fe: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 32802: c8 16 cp r12, r24 32804: d9 06 cpc r13, r25 32806: 0c f4 brge .+2 ; 0x3280a 32808: af c0 rjmp .+350 ; 0x32968 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 3280a: 00 91 6a 07 lds r16, 0x076A ; 0x80076a 3280e: 10 91 6b 07 lds r17, 0x076B ; 0x80076b 32812: 20 91 6c 07 lds r18, 0x076C ; 0x80076c 32816: 30 91 6d 07 lds r19, 0x076D ; 0x80076d } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 3281a: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 3281e: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 32822: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 32826: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 3282a: c8 16 cp r12, r24 3282c: d9 06 cpc r13, r25 3282e: 3c f4 brge .+14 ; 0x3283e 32830: f7 01 movw r30, r14 32832: 80 81 ld r24, Z 32834: 91 81 ldd r25, Z+1 ; 0x01 32836: 80 31 cpi r24, 0x10 ; 16 32838: 97 42 sbci r25, 0x27 ; 39 3283a: 08 f4 brcc .+2 ; 0x3283e 3283c: b2 c0 rjmp .+356 ; 0x329a2 3283e: 0c 19 sub r16, r12 32840: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 32842: 31 10 cpse r3, r1 32844: ca c0 rjmp .+404 ; 0x329da line_buffer[c] = (uint16_t)(z_trig - min_z); 32846: f3 01 movw r30, r6 32848: ee 0f add r30, r30 3284a: ff 1f adc r31, r31 3284c: 21 e0 ldi r18, 0x01 ; 1 3284e: 30 e0 ldi r19, 0x00 ; 0 32850: 2c 0f add r18, r28 32852: 3d 1f adc r19, r29 32854: e2 0f add r30, r18 32856: f3 1f adc r31, r19 32858: 11 83 std Z+1, r17 ; 0x01 3285a: 00 83 st Z, r16 3285c: ff ef ldi r31, 0xFF ; 255 3285e: 6f 1a sub r6, r31 32860: 7f 0a sbc r7, r31 32862: 67 96 adiw r28, 0x17 ; 23 32864: 2e ad ldd r18, Y+62 ; 0x3e 32866: 3f ad ldd r19, Y+63 ; 0x3f 32868: 67 97 sbiw r28, 0x17 ; 23 3286a: 82 0e add r8, r18 3286c: 93 1e adc r9, r19 3286e: 2d 96 adiw r28, 0x0d ; 13 32870: 8e ad ldd r24, Y+62 ; 0x3e 32872: 9f ad ldd r25, Y+63 ; 0x3f 32874: 2d 97 sbiw r28, 0x0d ; 13 32876: 02 97 sbiw r24, 0x02 ; 2 32878: 2d 96 adiw r28, 0x0d ; 13 3287a: 9f af std Y+63, r25 ; 0x3f 3287c: 8e af std Y+62, r24 ; 0x3e 3287e: 2d 97 sbiw r28, 0x0d ; 13 32880: 2f 96 adiw r28, 0x0f ; 15 32882: ee ad ldd r30, Y+62 ; 0x3e 32884: ff ad ldd r31, Y+63 ; 0x3f 32886: 2f 97 sbiw r28, 0x0f ; 15 32888: 31 97 sbiw r30, 0x01 ; 1 3288a: 2f 96 adiw r28, 0x0f ; 15 3288c: ff af std Y+63, r31 ; 0x3f 3288e: ee af std Y+62, r30 ; 0x3e 32890: 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 32892: f0 e2 ldi r31, 0x20 ; 32 32894: 6f 16 cp r6, r31 32896: 71 04 cpc r7, r1 32898: 09 f0 breq .+2 ; 0x3289c 3289a: 59 ce rjmp .-846 ; 0x3254e 3289c: 21 e0 ldi r18, 0x01 ; 1 3289e: 42 1a sub r4, r18 328a0: 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){ 328a2: 31 e0 ldi r19, 0x01 ; 1 328a4: 33 12 cpse r3, r19 328a6: 8d ce rjmp .-742 ; 0x325c2 328a8: 61 96 adiw r28, 0x11 ; 17 328aa: 8e ad ldd r24, Y+62 ; 0x3e 328ac: 9f ad ldd r25, Y+63 ; 0x3f 328ae: 61 97 sbiw r28, 0x11 ; 17 328b0: 80 96 adiw r24, 0x20 ; 32 328b2: 61 96 adiw r28, 0x11 ; 17 328b4: 9f af std Y+63, r25 ; 0x3f 328b6: 8e af std Y+62, r24 ; 0x3e 328b8: 61 97 sbiw r28, 0x11 ; 17 328ba: 2b 96 adiw r28, 0x0b ; 11 328bc: ee ad ldd r30, Y+62 ; 0x3e 328be: ff ad ldd r31, Y+63 ; 0x3f 328c0: 2b 97 sbiw r28, 0x0b ; 11 328c2: e0 5c subi r30, 0xC0 ; 192 328c4: ff 4f sbci r31, 0xFF ; 255 328c6: 2b 96 adiw r28, 0x0b ; 11 328c8: ff af std Y+63, r31 ; 0x3f 328ca: ee af std Y+62, r30 ; 0x3e 328cc: 2b 97 sbiw r28, 0x0b ; 11 328ce: 29 96 adiw r28, 0x09 ; 9 328d0: 2e ad ldd r18, Y+62 ; 0x3e 328d2: 3f ad ldd r19, Y+63 ; 0x3f 328d4: 29 97 sbiw r28, 0x09 ; 9 328d6: 22 50 subi r18, 0x02 ; 2 328d8: 31 09 sbc r19, r1 328da: 29 96 adiw r28, 0x09 ; 9 328dc: 3f af std Y+63, r19 ; 0x3f 328de: 2e af std Y+62, r18 ; 0x3e 328e0: 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 328e2: 23 2b or r18, r19 328e4: 09 f0 breq .+2 ; 0x328e8 328e6: 72 cd rjmp .-1308 ; 0x323cc 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); 328e8: 8e ee ldi r24, 0xEE ; 238 328ea: 94 ea ldi r25, 0xA4 ; 164 328ec: 9f 93 push r25 328ee: 8f 93 push r24 328f0: 0f 94 4b dc call 0x3b896 ; 0x3b896 328f4: 0f 90 pop r0 328f6: 0f 90 pop r0 } 328f8: c6 5a subi r28, 0xA6 ; 166 328fa: df 4f sbci r29, 0xFF ; 255 328fc: 0f b6 in r0, 0x3f ; 63 328fe: f8 94 cli 32900: de bf out 0x3e, r29 ; 62 32902: 0f be out 0x3f, r0 ; 63 32904: cd bf out 0x3d, r28 ; 61 32906: df 91 pop r29 32908: cf 91 pop r28 3290a: 1f 91 pop r17 3290c: 0f 91 pop r16 3290e: ff 90 pop r15 32910: ef 90 pop r14 32912: df 90 pop r13 32914: cf 90 pop r12 32916: bf 90 pop r11 32918: af 90 pop r10 3291a: 9f 90 pop r9 3291c: 8f 90 pop r8 3291e: 7f 90 pop r7 32920: 6f 90 pop r6 32922: 5f 90 pop r5 32924: 4f 90 pop r4 32926: 3f 90 pop r3 32928: 2f 90 pop r2 3292a: 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); 3292c: 28 ec ldi r18, 0xC8 ; 200 3292e: 30 e0 ldi r19, 0x00 ; 0 32930: a7 01 movw r20, r14 32932: 68 ee ldi r22, 0xE8 ; 232 32934: 73 e0 ldi r23, 0x03 ; 3 32936: 84 e0 ldi r24, 0x04 ; 4 32938: 0e 94 64 e0 call 0x1c0c8 ; 0x1c0c8 /// 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_){ 3293c: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 32940: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 32944: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 32948: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 3294c: 01 97 sbiw r24, 0x01 ; 1 3294e: a1 09 sbc r26, r1 32950: b1 09 sbc r27, r1 32952: 80 93 6a 07 sts 0x076A, r24 ; 0x80076a 32956: 90 93 6b 07 sts 0x076B, r25 ; 0x80076b 3295a: a0 93 6c 07 sts 0x076C, r26 ; 0x80076c 3295e: b0 93 6d 07 sts 0x076D, r27 ; 0x80076d 32962: 1b cf rjmp .-458 ; 0x3279a 32964: 86 01 movw r16, r12 32966: 2f cf rjmp .-418 ; 0x327c6 } /// 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); 32968: 9e 01 movw r18, r28 3296a: 2d 5b subi r18, 0xBD ; 189 3296c: 3f 4f sbci r19, 0xFF ; 255 3296e: a7 01 movw r20, r14 32970: 68 ee ldi r22, 0xE8 ; 232 32972: 73 e0 ldi r23, 0x03 ; 3 32974: 84 e0 ldi r24, 0x04 ; 4 32976: 0e 94 0a e1 call 0x1c214 ; 0x1c214 --_Z_; 3297a: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 3297e: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 32982: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 32986: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 3298a: 01 97 sbiw r24, 0x01 ; 1 3298c: a1 09 sbc r26, r1 3298e: b1 09 sbc r27, r1 32990: 80 93 6a 07 sts 0x076A, r24 ; 0x80076a 32994: 90 93 6b 07 sts 0x076B, r25 ; 0x80076b 32998: a0 93 6c 07 sts 0x076C, r26 ; 0x80076c 3299c: b0 93 6d 07 sts 0x076D, r27 ; 0x80076d 329a0: 26 cf rjmp .-436 ; 0x327ee } 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); 329a2: 28 ec ldi r18, 0xC8 ; 200 329a4: 30 e0 ldi r19, 0x00 ; 0 329a6: a7 01 movw r20, r14 329a8: 68 e1 ldi r22, 0x18 ; 24 329aa: 7c ef ldi r23, 0xFC ; 252 329ac: 84 e0 ldi r24, 0x04 ; 4 329ae: 0e 94 64 e0 call 0x1c0c8 ; 0x1c0c8 --_Z_; 329b2: 80 91 6a 07 lds r24, 0x076A ; 0x80076a 329b6: 90 91 6b 07 lds r25, 0x076B ; 0x80076b 329ba: a0 91 6c 07 lds r26, 0x076C ; 0x80076c 329be: b0 91 6d 07 lds r27, 0x076D ; 0x80076d 329c2: 01 97 sbiw r24, 0x01 ; 1 329c4: a1 09 sbc r26, r1 329c6: b1 09 sbc r27, r1 329c8: 80 93 6a 07 sts 0x076A, r24 ; 0x80076a 329cc: 90 93 6b 07 sts 0x076B, r25 ; 0x80076b 329d0: a0 93 6c 07 sts 0x076C, r26 ; 0x80076c 329d4: b0 93 6d 07 sts 0x076D, r27 ; 0x80076d 329d8: 20 cf rjmp .-448 ; 0x3281a 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); 329da: 2d 96 adiw r28, 0x0d ; 13 329dc: ee ad ldd r30, Y+62 ; 0x3e 329de: ff ad ldd r31, Y+63 ; 0x3f 329e0: 2d 97 sbiw r28, 0x0d ; 13 329e2: 86 ad ldd r24, Z+62 ; 0x3e 329e4: 97 ad ldd r25, Z+63 ; 0x3f 329e6: 01 2e mov r0, r17 329e8: 00 0c add r0, r0 329ea: 22 0b sbc r18, r18 329ec: 33 0b sbc r19, r19 329ee: 08 0f add r16, r24 329f0: 19 1f adc r17, r25 329f2: 21 1d adc r18, r1 329f4: 31 1d adc r19, r1 329f6: 36 95 lsr r19 329f8: 27 95 ror r18 329fa: 17 95 ror r17 329fc: 07 95 ror r16 329fe: 0f 3f cpi r16, 0xFF ; 255 32a00: 11 05 cpc r17, r1 32a02: 21 05 cpc r18, r1 32a04: 31 05 cpc r19, r1 32a06: 29 f0 breq .+10 ; 0x32a12 32a08: 20 f0 brcs .+8 ; 0x32a12 32a0a: 0f ef ldi r16, 0xFF ; 255 32a0c: 10 e0 ldi r17, 0x00 ; 0 32a0e: 20 e0 ldi r18, 0x00 ; 0 32a10: 30 e0 ldi r19, 0x00 ; 0 32a12: 2f 96 adiw r28, 0x0f ; 15 32a14: ee ad ldd r30, Y+62 ; 0x3e 32a16: ff ad ldd r31, Y+63 ; 0x3f 32a18: 2f 97 sbiw r28, 0x0f ; 15 32a1a: 07 8f std Z+31, r16 ; 0x1f 32a1c: 1f cf rjmp .-450 ; 0x3285c 00032a1e : /// 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) 32a1e: 2f 92 push r2 32a20: 3f 92 push r3 32a22: 4f 92 push r4 32a24: 5f 92 push r5 32a26: 6f 92 push r6 32a28: 7f 92 push r7 32a2a: 8f 92 push r8 32a2c: 9f 92 push r9 32a2e: af 92 push r10 32a30: bf 92 push r11 32a32: cf 92 push r12 32a34: df 92 push r13 32a36: ef 92 push r14 32a38: ff 92 push r15 32a3a: 0f 93 push r16 32a3c: 1f 93 push r17 32a3e: cf 93 push r28 32a40: df 93 push r29 32a42: cd b7 in r28, 0x3d ; 61 32a44: de b7 in r29, 0x3e ; 62 32a46: 6c 97 sbiw r28, 0x1c ; 28 32a48: 0f b6 in r0, 0x3f ; 63 32a4a: f8 94 cli 32a4c: de bf out 0x3e, r29 ; 62 32a4e: 0f be out 0x3f, r0 ; 63 32a50: cd bf out 0x3d, r28 ; 61 32a52: 6c 01 movw r12, r24 32a54: 5b 01 movw r10, r22 32a56: 4a 01 movw r8, r20 32a58: 19 01 movw r2, r18 32a5a: 18 87 std Y+8, r17 ; 0x08 32a5c: 0f 83 std Y+7, r16 ; 0x07 32a5e: fa 82 std Y+2, r15 ; 0x02 32a60: 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; 32a62: d7 01 movw r26, r14 32a64: 8d 91 ld r24, X+ 32a66: 9c 91 ld r25, X 32a68: 60 ed ldi r22, 0xD0 ; 208 32a6a: 72 e0 ldi r23, 0x02 ; 2 32a6c: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 32a70: 9c 8f std Y+28, r25 ; 0x1c 32a72: 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); 32a74: 9f 93 push r25 32a76: 8f 93 push r24 32a78: 3f 92 push r3 32a7a: 2f 93 push r18 32a7c: 1f 92 push r1 32a7e: 84 e6 ldi r24, 0x64 ; 100 32a80: 8f 93 push r24 32a82: 9f 92 push r9 32a84: 8f 92 push r8 32a86: bf 92 push r11 32a88: af 92 push r10 32a8a: df 92 push r13 32a8c: cf 92 push r12 32a8e: 86 eb ldi r24, 0xB6 ; 182 32a90: 94 ea ldi r25, 0xA4 ; 164 32a92: 9f 93 push r25 32a94: 8f 93 push r24 32a96: 0f 94 4b dc call 0x3b896 ; 0x3b896 32a9a: 0f b6 in r0, 0x3f ; 63 32a9c: f8 94 cli 32a9e: de bf out 0x3e, r29 ; 62 32aa0: 0f be out 0x3f, r0 ; 63 32aa2: 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; 32aa4: 22 27 eor r18, r18 32aa6: 33 27 eor r19, r19 32aa8: 22 19 sub r18, r2 32aaa: 33 09 sbc r19, r3 32aac: 3a 8f std Y+26, r19 ; 0x1a 32aae: 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)); 32ab0: c4 01 movw r24, r8 32ab2: 99 0c add r9, r9 32ab4: aa 0b sbc r26, r26 32ab6: bb 0b sbc r27, r27 32ab8: 89 87 std Y+9, r24 ; 0x09 32aba: 9a 87 std Y+10, r25 ; 0x0a 32abc: ab 87 std Y+11, r26 ; 0x0b 32abe: 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)); 32ac0: 95 01 movw r18, r10 32ac2: bb 0c add r11, r11 32ac4: 44 0b sbc r20, r20 32ac6: 55 0b sbc r21, r21 32ac8: 29 8b std Y+17, r18 ; 0x11 32aca: 3a 8b std Y+18, r19 ; 0x12 32acc: 4b 8b std Y+19, r20 ; 0x13 32ace: 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)); 32ad0: c6 01 movw r24, r12 32ad2: dd 0c add r13, r13 32ad4: aa 0b sbc r26, r26 32ad6: bb 0b sbc r27, r27 32ad8: 8d 8b std Y+21, r24 ; 0x15 32ada: 9e 8b std Y+22, r25 ; 0x16 32adc: af 8b std Y+23, r26 ; 0x17 32ade: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 32ae0: 12 14 cp r1, r2 32ae2: 13 04 cpc r1, r3 32ae4: 0c f0 brlt .+2 ; 0x32ae8 32ae6: ba c0 rjmp .+372 ; 0x32c5c { dad = dad_max - (ad / k); 32ae8: 8b 8d ldd r24, Y+27 ; 0x1b 32aea: 9c 8d ldd r25, Y+28 ; 0x1c 32aec: 6c e3 ldi r22, 0x3C ; 60 32aee: 70 e0 ldi r23, 0x00 ; 0 32af0: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 32af4: 10 e1 ldi r17, 0x10 ; 16 32af6: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 32af8: 2b 8d ldd r18, Y+27 ; 0x1b 32afa: 3c 8d ldd r19, Y+28 ; 0x1c 32afc: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32afe: 0f 94 a9 de call 0x3bd52 ; 0x3bd52 <__usmulhisi3> 32b02: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 32b06: 20 e0 ldi r18, 0x00 ; 0 32b08: 30 e0 ldi r19, 0x00 ; 0 32b0a: 44 e3 ldi r20, 0x34 ; 52 32b0c: 54 e4 ldi r21, 0x44 ; 68 32b0e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 32b12: 6b 01 movw r12, r22 32b14: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 32b16: 6f 81 ldd r22, Y+7 ; 0x07 32b18: 78 85 ldd r23, Y+8 ; 0x08 32b1a: eb 8d ldd r30, Y+27 ; 0x1b 32b1c: fc 8d ldd r31, Y+28 ; 0x1c 32b1e: 6e 0f add r22, r30 32b20: 7f 1f adc r23, r31 32b22: 90 e0 ldi r25, 0x00 ; 0 32b24: 80 e0 ldi r24, 0x00 ; 0 32b26: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 32b2a: 25 e3 ldi r18, 0x35 ; 53 32b2c: 3a ef ldi r19, 0xFA ; 250 32b2e: 4e e8 ldi r20, 0x8E ; 142 32b30: 5c e3 ldi r21, 0x3C ; 60 32b32: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32b36: 4b 01 movw r8, r22 32b38: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 32b3a: 0f 94 ab df call 0x3bf56 ; 0x3bf56 32b3e: 6b 83 std Y+3, r22 ; 0x03 32b40: 7c 83 std Y+4, r23 ; 0x04 32b42: 8d 83 std Y+5, r24 ; 0x05 32b44: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 32b46: c5 01 movw r24, r10 32b48: b4 01 movw r22, r8 32b4a: 0f 94 71 e2 call 0x3c4e2 ; 0x3c4e2 32b4e: 2b 01 movw r4, r22 32b50: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 32b52: 69 85 ldd r22, Y+9 ; 0x09 32b54: 7a 85 ldd r23, Y+10 ; 0x0a 32b56: 8b 85 ldd r24, Y+11 ; 0x0b 32b58: 9c 85 ldd r25, Y+12 ; 0x0c 32b5a: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 32b5e: 4b 01 movw r8, r22 32b60: 5c 01 movw r10, r24 32b62: 2b 8d ldd r18, Y+27 ; 0x1b 32b64: 3c 8d ldd r19, Y+28 ; 0x1c 32b66: a4 e6 ldi r26, 0x64 ; 100 32b68: b0 e0 ldi r27, 0x00 ; 0 32b6a: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 32b6e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 32b72: 20 e0 ldi r18, 0x00 ; 0 32b74: 30 e0 ldi r19, 0x00 ; 0 32b76: 44 e3 ldi r20, 0x34 ; 52 32b78: 54 e4 ldi r21, 0x44 ; 68 32b7a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 32b7e: 9b 01 movw r18, r22 32b80: ac 01 movw r20, r24 32b82: c5 01 movw r24, r10 32b84: b4 01 movw r22, r8 32b86: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 32b8a: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 32b8e: 6d 87 std Y+13, r22 ; 0x0d 32b90: 7e 87 std Y+14, r23 ; 0x0e 32b92: 8f 87 std Y+15, r24 ; 0x0f 32b94: 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)); 32b96: 69 89 ldd r22, Y+17 ; 0x11 32b98: 7a 89 ldd r23, Y+18 ; 0x12 32b9a: 8b 89 ldd r24, Y+19 ; 0x13 32b9c: 9c 89 ldd r25, Y+20 ; 0x14 32b9e: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 32ba2: 4b 01 movw r8, r22 32ba4: 5c 01 movw r10, r24 32ba6: a3 01 movw r20, r6 32ba8: 92 01 movw r18, r4 32baa: c7 01 movw r24, r14 32bac: b6 01 movw r22, r12 32bae: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32bb2: 9b 01 movw r18, r22 32bb4: ac 01 movw r20, r24 32bb6: c5 01 movw r24, r10 32bb8: b4 01 movw r22, r8 32bba: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 32bbe: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 32bc2: 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)); 32bc4: 6d 89 ldd r22, Y+21 ; 0x15 32bc6: 7e 89 ldd r23, Y+22 ; 0x16 32bc8: 8f 89 ldd r24, Y+23 ; 0x17 32bca: 98 8d ldd r25, Y+24 ; 0x18 32bcc: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 32bd0: 2b 01 movw r4, r22 32bd2: 3c 01 movw r6, r24 32bd4: a7 01 movw r20, r14 32bd6: 96 01 movw r18, r12 32bd8: 6b 81 ldd r22, Y+3 ; 0x03 32bda: 7c 81 ldd r23, Y+4 ; 0x04 32bdc: 8d 81 ldd r24, Y+5 ; 0x05 32bde: 9e 81 ldd r25, Y+6 ; 0x06 32be0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32be4: 9b 01 movw r18, r22 32be6: ac 01 movw r20, r24 32be8: c3 01 movw r24, r6 32bea: b2 01 movw r22, r4 32bec: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 32bf0: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 32bf4: 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)) 32bf6: 01 e0 ldi r16, 0x01 ; 1 32bf8: 20 e4 ldi r18, 0x40 ; 64 32bfa: 31 e0 ldi r19, 0x01 ; 1 32bfc: 4d 85 ldd r20, Y+13 ; 0x0d 32bfe: 5e 85 ldd r21, Y+14 ; 0x0e 32c00: b4 01 movw r22, r8 32c02: 0e 94 ec e1 call 0x1c3d8 ; 0x1c3d8 32c06: 21 2f mov r18, r17 32c08: 30 e0 ldi r19, 0x00 ; 0 32c0a: 88 23 and r24, r24 32c0c: b9 f1 breq .+110 ; 0x32c7c 32c0e: 4b 8d ldd r20, Y+27 ; 0x1b 32c10: 5c 8d ldd r21, Y+28 ; 0x1c 32c12: 42 0f add r20, r18 32c14: 53 1f adc r21, r19 { ad += dad + 1; 32c16: 4f 5f subi r20, 0xFF ; 255 32c18: 5f 4f sbci r21, 0xFF ; 255 32c1a: 5c 8f std Y+28, r21 ; 0x1c 32c1c: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 32c1e: eb 8d ldd r30, Y+27 ; 0x1b 32c20: fc 8d ldd r31, Y+28 ; 0x1c 32c22: a9 81 ldd r26, Y+1 ; 0x01 32c24: ba 81 ldd r27, Y+2 ; 0x02 32c26: ed 93 st X+, r30 32c28: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 32c2a: 6c 96 adiw r28, 0x1c ; 28 32c2c: 0f b6 in r0, 0x3f ; 63 32c2e: f8 94 cli 32c30: de bf out 0x3e, r29 ; 62 32c32: 0f be out 0x3f, r0 ; 63 32c34: cd bf out 0x3d, r28 ; 61 32c36: df 91 pop r29 32c38: cf 91 pop r28 32c3a: 1f 91 pop r17 32c3c: 0f 91 pop r16 32c3e: ff 90 pop r15 32c40: ef 90 pop r14 32c42: df 90 pop r13 32c44: cf 90 pop r12 32c46: bf 90 pop r11 32c48: af 90 pop r10 32c4a: 9f 90 pop r9 32c4c: 8f 90 pop r8 32c4e: 7f 90 pop r7 32c50: 6f 90 pop r6 32c52: 5f 90 pop r5 32c54: 4f 90 pop r4 32c56: 3f 90 pop r3 32c58: 2f 90 pop r2 32c5a: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 32c5c: 2f ec ldi r18, 0xCF ; 207 32c5e: 32 e0 ldi r19, 0x02 ; 2 32c60: ab 8d ldd r26, Y+27 ; 0x1b 32c62: bc 8d ldd r27, Y+28 ; 0x1c 32c64: 2a 1b sub r18, r26 32c66: 3b 0b sbc r19, r27 32c68: c9 01 movw r24, r18 32c6a: 6c e3 ldi r22, 0x3C ; 60 32c6c: 70 e0 ldi r23, 0x00 ; 0 32c6e: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 32c72: 10 e1 ldi r17, 0x10 ; 16 32c74: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32c76: a9 8d ldd r26, Y+25 ; 0x19 32c78: ba 8d ldd r27, Y+26 ; 0x1a 32c7a: 41 cf rjmp .-382 ; 0x32afe // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 32c7c: 2f 5f subi r18, 0xFF ; 255 32c7e: 3f 4f sbci r19, 0xFF ; 255 32c80: ab 8d ldd r26, Y+27 ; 0x1b 32c82: bc 8d ldd r27, Y+28 ; 0x1c 32c84: a2 0f add r26, r18 32c86: b3 1f adc r27, r19 32c88: bc 8f std Y+28, r27 ; 0x1c 32c8a: ab 8f std Y+27, r26 ; 0x1b 32c8c: a0 3d cpi r26, 0xD0 ; 208 32c8e: b2 40 sbci r27, 0x02 ; 2 32c90: 08 f4 brcc .+2 ; 0x32c94 32c92: 26 cf rjmp .-436 ; 0x32ae0 32c94: c4 cf rjmp .-120 ; 0x32c1e 00032c96 : float mesh_bed_leveling::get_z(float x, float y) { 32c96: 2f 92 push r2 32c98: 3f 92 push r3 32c9a: 4f 92 push r4 32c9c: 5f 92 push r5 32c9e: 6f 92 push r6 32ca0: 7f 92 push r7 32ca2: 8f 92 push r8 32ca4: 9f 92 push r9 32ca6: af 92 push r10 32ca8: bf 92 push r11 32caa: cf 92 push r12 32cac: df 92 push r13 32cae: ef 92 push r14 32cb0: ff 92 push r15 32cb2: 0f 93 push r16 32cb4: 1f 93 push r17 32cb6: cf 93 push r28 32cb8: df 93 push r29 32cba: 00 d0 rcall .+0 ; 0x32cbc 32cbc: 00 d0 rcall .+0 ; 0x32cbe 32cbe: 00 d0 rcall .+0 ; 0x32cc0 32cc0: 1f 92 push r1 32cc2: cd b7 in r28, 0x3d ; 61 32cc4: de b7 in r29, 0x3e ; 62 32cc6: 2b 01 movw r4, r22 32cc8: 3c 01 movw r6, r24 32cca: 49 01 movw r8, r18 32ccc: 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)); 32cce: 20 e0 ldi r18, 0x00 ; 0 32cd0: 30 e0 ldi r19, 0x00 ; 0 32cd2: 40 ec ldi r20, 0xC0 ; 192 32cd4: 51 e4 ldi r21, 0x41 ; 65 32cd6: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 32cda: 20 e0 ldi r18, 0x00 ; 0 32cdc: 30 e0 ldi r19, 0x00 ; 0 32cde: 48 e0 ldi r20, 0x08 ; 8 32ce0: 52 e4 ldi r21, 0x42 ; 66 32ce2: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 32ce6: 6b 01 movw r12, r22 32ce8: 7c 01 movw r14, r24 32cea: 0f 94 58 e0 call 0x3c0b0 ; 0x3c0b0 32cee: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> if (i < 0) { i = 0; 32cf2: 31 2c mov r3, r1 32cf4: 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) { 32cf6: 77 fd sbrc r23, 7 32cf8: 1e c0 rjmp .+60 ; 0x32d36 32cfa: 1b 01 movw r2, r22 32cfc: 66 30 cpi r22, 0x06 ; 6 32cfe: 71 05 cpc r23, r1 32d00: 1c f0 brlt .+6 ; 0x32d08 32d02: 45 e0 ldi r20, 0x05 ; 5 32d04: 24 2e mov r2, r20 32d06: 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; } 32d08: 82 2d mov r24, r2 32d0a: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 32d0e: 20 e0 ldi r18, 0x00 ; 0 32d10: 30 e0 ldi r19, 0x00 ; 0 32d12: 48 eb ldi r20, 0xB8 ; 184 32d14: 51 e4 ldi r21, 0x41 ; 65 32d16: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 32d1a: 9b 01 movw r18, r22 32d1c: 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; 32d1e: c3 01 movw r24, r6 32d20: b2 01 movw r22, r4 32d22: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 32d26: 20 e0 ldi r18, 0x00 ; 0 32d28: 30 e0 ldi r19, 0x00 ; 0 32d2a: 48 e0 ldi r20, 0x08 ; 8 32d2c: 52 e4 ldi r21, 0x42 ; 66 32d2e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 32d32: 6b 01 movw r12, r22 32d34: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 32d36: 20 e0 ldi r18, 0x00 ; 0 32d38: 30 e0 ldi r19, 0x00 ; 0 32d3a: 40 ec ldi r20, 0xC0 ; 192 32d3c: 50 e4 ldi r21, 0x40 ; 64 32d3e: c5 01 movw r24, r10 32d40: b4 01 movw r22, r8 32d42: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 32d46: 20 e0 ldi r18, 0x00 ; 0 32d48: 30 e0 ldi r19, 0x00 ; 0 32d4a: 48 e0 ldi r20, 0x08 ; 8 32d4c: 52 e4 ldi r21, 0x42 ; 66 32d4e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 32d52: 69 83 std Y+1, r22 ; 0x01 32d54: 7a 83 std Y+2, r23 ; 0x02 32d56: 8b 83 std Y+3, r24 ; 0x03 32d58: 9c 83 std Y+4, r25 ; 0x04 32d5a: 0f 94 58 e0 call 0x3c0b0 ; 0x3c0b0 32d5e: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> if (j < 0) { 32d62: 77 fd sbrc r23, 7 32d64: da c0 rjmp .+436 ; 0x32f1a 32d66: 7a 87 std Y+10, r23 ; 0x0a 32d68: 69 87 std Y+9, r22 ; 0x09 32d6a: 66 30 cpi r22, 0x06 ; 6 32d6c: 71 05 cpc r23, r1 32d6e: 24 f0 brlt .+8 ; 0x32d78 32d70: e5 e0 ldi r30, 0x05 ; 5 32d72: f0 e0 ldi r31, 0x00 ; 0 32d74: fa 87 std Y+10, r31 ; 0x0a 32d76: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 32d78: 89 85 ldd r24, Y+9 ; 0x09 32d7a: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 32d7e: 20 e0 ldi r18, 0x00 ; 0 32d80: 30 e0 ldi r19, 0x00 ; 0 32d82: 40 ea ldi r20, 0xA0 ; 160 32d84: 50 e4 ldi r21, 0x40 ; 64 32d86: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 32d8a: 9b 01 movw r18, r22 32d8c: 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; 32d8e: c5 01 movw r24, r10 32d90: b4 01 movw r22, r8 32d92: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 32d96: 20 e0 ldi r18, 0x00 ; 0 32d98: 30 e0 ldi r19, 0x00 ; 0 32d9a: 48 e0 ldi r20, 0x08 ; 8 32d9c: 52 e4 ldi r21, 0x42 ; 66 32d9e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 32da2: 69 83 std Y+1, r22 ; 0x01 32da4: 7a 83 std Y+2, r23 ; 0x02 32da6: 8b 83 std Y+3, r24 ; 0x03 32da8: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 32daa: a7 01 movw r20, r14 32dac: 96 01 movw r18, r12 32dae: 60 e0 ldi r22, 0x00 ; 0 32db0: 70 e0 ldi r23, 0x00 ; 0 32db2: 80 e8 ldi r24, 0x80 ; 128 32db4: 9f e3 ldi r25, 0x3F ; 63 32db6: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 32dba: 2b 01 movw r4, r22 32dbc: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 32dbe: 91 01 movw r18, r2 32dc0: 2f 5f subi r18, 0xFF ; 255 32dc2: 3f 4f sbci r19, 0xFF ; 255 32dc4: 3e 83 std Y+6, r19 ; 0x06 32dc6: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 32dc8: 89 85 ldd r24, Y+9 ; 0x09 32dca: 9a 85 ldd r25, Y+10 ; 0x0a 32dcc: 01 96 adiw r24, 0x01 ; 1 32dce: 98 87 std Y+8, r25 ; 0x08 32dd0: 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]; 32dd2: 27 e0 ldi r18, 0x07 ; 7 32dd4: e9 85 ldd r30, Y+9 ; 0x09 32dd6: fa 85 ldd r31, Y+10 ; 0x0a 32dd8: 2e 9f mul r18, r30 32dda: 80 01 movw r16, r0 32ddc: 2f 9f mul r18, r31 32dde: 10 0d add r17, r0 32de0: 11 24 eor r1, r1 32de2: f8 01 movw r30, r16 32de4: e2 0d add r30, r2 32de6: f3 1d adc r31, r3 32de8: ee 0f add r30, r30 32dea: ff 1f adc r31, r31 32dec: ee 0f add r30, r30 32dee: ff 1f adc r31, r31 32df0: e2 56 subi r30, 0x62 ; 98 32df2: fc 4e sbci r31, 0xEC ; 236 32df4: 21 81 ldd r18, Z+1 ; 0x01 32df6: 32 81 ldd r19, Z+2 ; 0x02 32df8: 43 81 ldd r20, Z+3 ; 0x03 32dfa: 54 81 ldd r21, Z+4 ; 0x04 32dfc: c3 01 movw r24, r6 32dfe: b2 01 movw r22, r4 32e00: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32e04: 4b 01 movw r8, r22 32e06: 5c 01 movw r10, r24 32e08: ed 81 ldd r30, Y+5 ; 0x05 32e0a: fe 81 ldd r31, Y+6 ; 0x06 32e0c: e0 0f add r30, r16 32e0e: f1 1f adc r31, r17 32e10: ee 0f add r30, r30 32e12: ff 1f adc r31, r31 32e14: ee 0f add r30, r30 32e16: ff 1f adc r31, r31 32e18: e2 56 subi r30, 0x62 ; 98 32e1a: fc 4e sbci r31, 0xEC ; 236 32e1c: 21 81 ldd r18, Z+1 ; 0x01 32e1e: 32 81 ldd r19, Z+2 ; 0x02 32e20: 43 81 ldd r20, Z+3 ; 0x03 32e22: 54 81 ldd r21, Z+4 ; 0x04 32e24: c7 01 movw r24, r14 32e26: b6 01 movw r22, r12 32e28: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32e2c: 9b 01 movw r18, r22 32e2e: ac 01 movw r20, r24 32e30: c5 01 movw r24, r10 32e32: b4 01 movw r22, r8 32e34: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 32e38: 4b 01 movw r8, r22 32e3a: 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; 32e3c: 29 81 ldd r18, Y+1 ; 0x01 32e3e: 3a 81 ldd r19, Y+2 ; 0x02 32e40: 4b 81 ldd r20, Y+3 ; 0x03 32e42: 5c 81 ldd r21, Y+4 ; 0x04 32e44: 60 e0 ldi r22, 0x00 ; 0 32e46: 70 e0 ldi r23, 0x00 ; 0 32e48: 80 e8 ldi r24, 0x80 ; 128 32e4a: 9f e3 ldi r25, 0x3F ; 63 32e4c: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 32e50: 9b 01 movw r18, r22 32e52: ac 01 movw r20, r24 32e54: c5 01 movw r24, r10 32e56: b4 01 movw r22, r8 32e58: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32e5c: 4b 01 movw r8, r22 32e5e: 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]; 32e60: 27 e0 ldi r18, 0x07 ; 7 32e62: ef 81 ldd r30, Y+7 ; 0x07 32e64: f8 85 ldd r31, Y+8 ; 0x08 32e66: 2e 9f mul r18, r30 32e68: c0 01 movw r24, r0 32e6a: 2f 9f mul r18, r31 32e6c: 90 0d add r25, r0 32e6e: 11 24 eor r1, r1 32e70: 9a 87 std Y+10, r25 ; 0x0a 32e72: 89 87 std Y+9, r24 ; 0x09 32e74: fc 01 movw r30, r24 32e76: e2 0d add r30, r2 32e78: f3 1d adc r31, r3 32e7a: ee 0f add r30, r30 32e7c: ff 1f adc r31, r31 32e7e: ee 0f add r30, r30 32e80: ff 1f adc r31, r31 32e82: e2 56 subi r30, 0x62 ; 98 32e84: fc 4e sbci r31, 0xEC ; 236 32e86: 21 81 ldd r18, Z+1 ; 0x01 32e88: 32 81 ldd r19, Z+2 ; 0x02 32e8a: 43 81 ldd r20, Z+3 ; 0x03 32e8c: 54 81 ldd r21, Z+4 ; 0x04 32e8e: c3 01 movw r24, r6 32e90: b2 01 movw r22, r4 32e92: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32e96: 2b 01 movw r4, r22 32e98: 3c 01 movw r6, r24 32e9a: 89 85 ldd r24, Y+9 ; 0x09 32e9c: 9a 85 ldd r25, Y+10 ; 0x0a 32e9e: ed 81 ldd r30, Y+5 ; 0x05 32ea0: fe 81 ldd r31, Y+6 ; 0x06 32ea2: 8e 0f add r24, r30 32ea4: 9f 1f adc r25, r31 32ea6: 88 0f add r24, r24 32ea8: 99 1f adc r25, r25 32eaa: 88 0f add r24, r24 32eac: 99 1f adc r25, r25 32eae: 82 56 subi r24, 0x62 ; 98 32eb0: 9c 4e sbci r25, 0xEC ; 236 32eb2: fc 01 movw r30, r24 32eb4: 21 81 ldd r18, Z+1 ; 0x01 32eb6: 32 81 ldd r19, Z+2 ; 0x02 32eb8: 43 81 ldd r20, Z+3 ; 0x03 32eba: 54 81 ldd r21, Z+4 ; 0x04 32ebc: c7 01 movw r24, r14 32ebe: b6 01 movw r22, r12 32ec0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32ec4: 9b 01 movw r18, r22 32ec6: ac 01 movw r20, r24 32ec8: c3 01 movw r24, r6 32eca: b2 01 movw r22, r4 32ecc: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> return (1.f-t) * z0 + t * z1; 32ed0: 29 81 ldd r18, Y+1 ; 0x01 32ed2: 3a 81 ldd r19, Y+2 ; 0x02 32ed4: 4b 81 ldd r20, Y+3 ; 0x03 32ed6: 5c 81 ldd r21, Y+4 ; 0x04 32ed8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 32edc: 9b 01 movw r18, r22 32ede: ac 01 movw r20, r24 32ee0: c5 01 movw r24, r10 32ee2: b4 01 movw r22, r8 32ee4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> } 32ee8: 2a 96 adiw r28, 0x0a ; 10 32eea: 0f b6 in r0, 0x3f ; 63 32eec: f8 94 cli 32eee: de bf out 0x3e, r29 ; 62 32ef0: 0f be out 0x3f, r0 ; 63 32ef2: cd bf out 0x3d, r28 ; 61 32ef4: df 91 pop r29 32ef6: cf 91 pop r28 32ef8: 1f 91 pop r17 32efa: 0f 91 pop r16 32efc: ff 90 pop r15 32efe: ef 90 pop r14 32f00: df 90 pop r13 32f02: cf 90 pop r12 32f04: bf 90 pop r11 32f06: af 90 pop r10 32f08: 9f 90 pop r9 32f0a: 8f 90 pop r8 32f0c: 7f 90 pop r7 32f0e: 6f 90 pop r6 32f10: 5f 90 pop r5 32f12: 4f 90 pop r4 32f14: 3f 90 pop r3 32f16: 2f 90 pop r2 32f18: 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; 32f1a: 1a 86 std Y+10, r1 ; 0x0a 32f1c: 19 86 std Y+9, r1 ; 0x09 32f1e: 45 cf rjmp .-374 ; 0x32daa 00032f20 : 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) { 32f20: 1f 93 push r17 32f22: cf 93 push r28 32f24: df 93 push r29 32f26: 00 d0 rcall .+0 ; 0x32f28 32f28: 1f 92 push r1 32f2a: 1f 92 push r1 32f2c: cd b7 in r28, 0x3d ; 61 32f2e: de b7 in r29, 0x3e ; 62 32f30: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 32f32: 48 2f mov r20, r24 32f34: 62 e5 ldi r22, 0x52 ; 82 32f36: ce 01 movw r24, r28 32f38: 01 96 adiw r24, 0x01 ; 1 32f3a: 0f 94 04 c3 call 0x38608 ; 0x38608 32f3e: 49 81 ldd r20, Y+1 ; 0x01 32f40: 5a 81 ldd r21, Y+2 ; 0x02 32f42: 6b 81 ldd r22, Y+3 ; 0x03 32f44: 7c 81 ldd r23, Y+4 ; 0x04 32f46: 8d 81 ldd r24, Y+5 ; 0x05 32f48: 0f 94 91 71 call 0x2e322 ; 0x2e322 scopeState = nextState; 32f4c: 10 93 2a 13 sts 0x132A, r17 ; 0x80132a } 32f50: 0f 90 pop r0 32f52: 0f 90 pop r0 32f54: 0f 90 pop r0 32f56: 0f 90 pop r0 32f58: 0f 90 pop r0 32f5a: df 91 pop r29 32f5c: cf 91 pop r28 32f5e: 1f 91 pop r17 32f60: 08 95 ret 00032f62 : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 32f62: 10 92 75 13 sts 0x1375, r1 ; 0x801375 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 32f66: e0 e8 ldi r30, 0x80 ; 128 32f68: f9 ea ldi r31, 0xA9 ; 169 32f6a: 84 91 lpm r24, Z 32f6c: 67 e0 ldi r22, 0x07 ; 7 32f6e: 0d 94 90 97 jmp 0x32f20 ; 0x32f20 00032f72 : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 32f72: e0 91 75 13 lds r30, 0x1375 ; 0x801375 32f76: ae 2f mov r26, r30 32f78: b0 e0 ldi r27, 0x00 ; 0 32f7a: aa 0f add r26, r26 32f7c: bb 1f adc r27, r27 32f7e: a1 59 subi r26, 0x91 ; 145 32f80: bc 4e sbci r27, 0xEC ; 236 32f82: 20 91 42 13 lds r18, 0x1342 ; 0x801342 32f86: 30 91 43 13 lds r19, 0x1343 ; 0x801343 32f8a: 2d 93 st X+, r18 32f8c: 3c 93 st X, r19 ++regIndex; 32f8e: ef 5f subi r30, 0xFF ; 255 32f90: e0 93 75 13 sts 0x1375, r30 ; 0x801375 if (regIndex >= regs16Count) { 32f94: e2 30 cpi r30, 0x02 ; 2 32f96: 40 f4 brcc .+16 ; 0x32fa8 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32f98: f0 e0 ldi r31, 0x00 ; 0 32f9a: e9 59 subi r30, 0x99 ; 153 32f9c: f6 45 sbci r31, 0x56 ; 86 32f9e: 84 91 lpm r24, Z 32fa0: 68 e0 ldi r22, 0x08 ; 8 32fa2: 0f 94 90 97 call 0x32f20 ; 0x32f20 } return ScopeState::Reading16bitRegisters; 32fa6: 88 e0 ldi r24, 0x08 ; 8 } 32fa8: 08 95 ret 00032faa : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 32faa: e0 91 75 13 lds r30, 0x1375 ; 0x801375 32fae: ae 2f mov r26, r30 32fb0: b0 e0 ldi r27, 0x00 ; 0 32fb2: a4 59 subi r26, 0x94 ; 148 32fb4: bc 4e sbci r27, 0xEC ; 236 32fb6: 80 91 42 13 lds r24, 0x1342 ; 0x801342 32fba: 8c 93 st X, r24 ++regIndex; 32fbc: ef 5f subi r30, 0xFF ; 255 32fbe: e0 93 75 13 sts 0x1375, r30 ; 0x801375 if (regIndex >= regs8Count) { 32fc2: e3 30 cpi r30, 0x03 ; 3 32fc4: 40 f0 brcs .+16 ; 0x32fd6 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 32fc6: 10 92 75 13 sts 0x1375, r1 ; 0x801375 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32fca: e7 e6 ldi r30, 0x67 ; 103 32fcc: f9 ea ldi r31, 0xA9 ; 169 32fce: 84 91 lpm r24, Z 32fd0: 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); 32fd2: 0d 94 90 97 jmp 0x32f20 ; 0x32f20 32fd6: f0 e0 ldi r31, 0x00 ; 0 32fd8: e0 58 subi r30, 0x80 ; 128 32fda: f6 45 sbci r31, 0x56 ; 86 32fdc: 84 91 lpm r24, Z 32fde: 67 e0 ldi r22, 0x07 ; 7 32fe0: f8 cf rjmp .-16 ; 0x32fd2 00032fe2 : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 32fe2: cf 93 push r28 32fe4: df 93 push r29 32fe6: 00 d0 rcall .+0 ; 0x32fe8 32fe8: 00 d0 rcall .+0 ; 0x32fea 32fea: 00 d0 rcall .+0 ; 0x32fec 32fec: 1f 92 push r1 32fee: cd b7 in r28, 0x3d ; 61 32ff0: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 32ff2: 80 91 31 13 lds r24, 0x1331 ; 0x801331 32ff6: 82 34 cpi r24, 0x42 ; 66 32ff8: 09 f4 brne .+2 ; 0x32ffc 32ffa: 46 c0 rjmp .+140 ; 0x33088 32ffc: b8 f5 brcc .+110 ; 0x3306c 32ffe: 88 23 and r24, r24 33000: 09 f4 brne .+2 ; 0x33004 33002: 72 c0 rjmp .+228 ; 0x330e8 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 33004: 84 e0 ldi r24, 0x04 ; 4 33006: 80 93 29 13 sts 0x1329, r24 ; 0x801329 3300a: 85 e0 ldi r24, 0x05 ; 5 3300c: e1 e3 ldi r30, 0x31 ; 49 3300e: f3 e1 ldi r31, 0x13 ; 19 33010: de 01 movw r26, r28 33012: 16 96 adiw r26, 0x06 ; 6 33014: 01 90 ld r0, Z+ 33016: 0d 92 st X+, r0 33018: 8a 95 dec r24 3301a: e1 f7 brne .-8 ; 0x33014 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 3301c: 85 e0 ldi r24, 0x05 ; 5 3301e: fe 01 movw r30, r28 33020: 36 96 adiw r30, 0x06 ; 6 33022: ac e2 ldi r26, 0x2C ; 44 33024: b3 e1 ldi r27, 0x13 ; 19 33026: 01 90 ld r0, Z+ 33028: 0d 92 st X+, r0 3302a: 8a 95 dec r24 3302c: e1 f7 brne .-8 ; 0x33026 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 3302e: 40 e0 ldi r20, 0x00 ; 0 33030: 60 e0 ldi r22, 0x00 ; 0 33032: ce 01 movw r24, r28 33034: 01 96 adiw r24, 0x01 ; 1 33036: 0f 94 04 c3 call 0x38608 ; 0x38608 3303a: 85 e0 ldi r24, 0x05 ; 5 3303c: fe 01 movw r30, r28 3303e: 31 96 adiw r30, 0x01 ; 1 33040: a1 e3 ldi r26, 0x31 ; 49 33042: b3 e1 ldi r27, 0x13 ; 19 33044: 01 90 ld r0, Z+ 33046: 0d 92 st X+, r0 33048: 8a 95 dec r24 3304a: e1 f7 brne .-8 ; 0x33044 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3304c: 85 e0 ldi r24, 0x05 ; 5 3304e: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a SendMsg(rq); 33052: 40 91 2c 13 lds r20, 0x132C ; 0x80132c 33056: 50 91 2d 13 lds r21, 0x132D ; 0x80132d 3305a: 60 91 2e 13 lds r22, 0x132E ; 0x80132e 3305e: 70 91 2f 13 lds r23, 0x132F ; 0x80132f 33062: 80 91 30 13 lds r24, 0x1330 ; 0x801330 33066: 0f 94 91 71 call 0x2e322 ; 0x2e322 3306a: 2e c0 rjmp .+92 ; 0x330c8 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 3306c: 82 35 cpi r24, 0x52 ; 82 3306e: b1 f1 breq .+108 ; 0x330dc 33070: 87 35 cpi r24, 0x57 ; 87 33072: 41 f6 brne .-112 ; 0x33004 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); 33074: 60 91 33 13 lds r22, 0x1333 ; 0x801333 33078: 70 91 34 13 lds r23, 0x1334 ; 0x801334 3307c: 4c e0 ldi r20, 0x0C ; 12 3307e: 80 91 32 13 lds r24, 0x1332 ; 0x801332 33082: 0f 94 fc 71 call 0x2e3f8 ; 0x2e3f8 33086: 11 c0 rjmp .+34 ; 0x330aa SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 33088: 40 91 32 13 lds r20, 0x1332 ; 0x801332 3308c: 62 e4 ldi r22, 0x42 ; 66 3308e: ce 01 movw r24, r28 33090: 01 96 adiw r24, 0x01 ; 1 33092: 0f 94 04 c3 call 0x38608 ; 0x38608 33096: 49 81 ldd r20, Y+1 ; 0x01 33098: 5a 81 ldd r21, Y+2 ; 0x02 3309a: 6b 81 ldd r22, Y+3 ; 0x03 3309c: 7c 81 ldd r23, Y+4 ; 0x04 3309e: 8d 81 ldd r24, Y+5 ; 0x05 330a0: 0f 94 91 71 call 0x2e322 ; 0x2e322 scopeState = ScopeState::ButtonSent; 330a4: 8a e0 ldi r24, 0x0A ; 10 330a6: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a 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); 330aa: 40 e0 ldi r20, 0x00 ; 0 330ac: 60 e0 ldi r22, 0x00 ; 0 330ae: ce 01 movw r24, r28 330b0: 01 96 adiw r24, 0x01 ; 1 330b2: 0f 94 04 c3 call 0x38608 ; 0x38608 330b6: 85 e0 ldi r24, 0x05 ; 5 330b8: fe 01 movw r30, r28 330ba: 31 96 adiw r30, 0x01 ; 1 330bc: a1 e3 ldi r26, 0x31 ; 49 330be: b3 e1 ldi r27, 0x13 ; 19 330c0: 01 90 ld r0, Z+ 330c2: 0d 92 st X+, r0 330c4: 8a 95 dec r24 330c6: e1 f7 brne .-8 ; 0x330c0 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 330c8: 81 e0 ldi r24, 0x01 ; 1 } } 330ca: 2a 96 adiw r28, 0x0a ; 10 330cc: 0f b6 in r0, 0x3f ; 63 330ce: f8 94 cli 330d0: de bf out 0x3e, r29 ; 62 330d2: 0f be out 0x3f, r0 ; 63 330d4: cd bf out 0x3d, r28 ; 61 330d6: df 91 pop r29 330d8: cf 91 pop r28 330da: 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); 330dc: 6b e0 ldi r22, 0x0B ; 11 330de: 80 91 32 13 lds r24, 0x1332 ; 0x801332 330e2: 0f 94 90 97 call 0x32f20 ; 0x32f20 330e6: e1 cf rjmp .-62 ; 0x330aa case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 330e8: 80 e0 ldi r24, 0x00 ; 0 330ea: ef cf rjmp .-34 ; 0x330ca 000330ec : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 330ec: cf 93 push r28 330ee: df 93 push r29 330f0: 00 d0 rcall .+0 ; 0x330f2 330f2: 1f 92 push r1 330f4: 1f 92 push r1 330f6: cd b7 in r28, 0x3d ; 61 330f8: de b7 in r29, 0x3e ; 62 330fa: 49 83 std Y+1, r20 ; 0x01 330fc: 5a 83 std Y+2, r21 ; 0x02 330fe: 6b 83 std Y+3, r22 ; 0x03 33100: 7c 83 std Y+4, r23 ; 0x04 33102: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 33104: 85 e0 ldi r24, 0x05 ; 5 33106: fe 01 movw r30, r28 33108: 31 96 adiw r30, 0x01 ; 1 3310a: a1 e3 ldi r26, 0x31 ; 49 3310c: b3 e1 ldi r27, 0x13 ; 19 3310e: 01 90 ld r0, Z+ 33110: 0d 92 st X+, r0 33112: 8a 95 dec r24 33114: e1 f7 brne .-8 ; 0x3310e if (!ExpectsResponse()) { 33116: 80 91 2a 13 lds r24, 0x132A ; 0x80132a 3311a: 87 ff sbrs r24, 7 3311c: 09 c0 rjmp .+18 ; 0x33130 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 3311e: 0f 90 pop r0 33120: 0f 90 pop r0 33122: 0f 90 pop r0 33124: 0f 90 pop r0 33126: 0f 90 pop r0 33128: df 91 pop r29 3312a: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 3312c: 0d 94 f1 97 jmp 0x32fe2 ; 0x32fe2 } // otherwise wait for an empty window to activate the request } 33130: 0f 90 pop r0 33132: 0f 90 pop r0 33134: 0f 90 pop r0 33136: 0f 90 pop r0 33138: 0f 90 pop r0 3313a: df 91 pop r29 3313c: cf 91 pop r28 3313e: 08 95 ret 00033140 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 33140: 1f 93 push r17 33142: cf 93 push r28 33144: df 93 push r29 33146: 00 d0 rcall .+0 ; 0x33148 33148: 1f 92 push r1 3314a: 1f 92 push r1 3314c: cd b7 in r28, 0x3d ; 61 3314e: de b7 in r29, 0x3e ; 62 33150: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 33152: 48 2f mov r20, r24 33154: 63 e5 ldi r22, 0x53 ; 83 33156: ce 01 movw r24, r28 33158: 01 96 adiw r24, 0x01 ; 1 3315a: 0f 94 04 c3 call 0x38608 ; 0x38608 3315e: 49 81 ldd r20, Y+1 ; 0x01 33160: 5a 81 ldd r21, Y+2 ; 0x02 33162: 6b 81 ldd r22, Y+3 ; 0x03 33164: 7c 81 ldd r23, Y+4 ; 0x04 33166: 8d 81 ldd r24, Y+5 ; 0x05 33168: 0f 94 91 71 call 0x2e322 ; 0x2e322 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 3316c: 10 93 2a 13 sts 0x132A, r17 ; 0x80132a } 33170: 0f 90 pop r0 33172: 0f 90 pop r0 33174: 0f 90 pop r0 33176: 0f 90 pop r0 33178: 0f 90 pop r0 3317a: df 91 pop r29 3317c: cf 91 pop r28 3317e: 1f 91 pop r17 33180: 08 95 ret 00033182 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 33182: cf 93 push r28 33184: df 93 push r29 33186: 00 d0 rcall .+0 ; 0x33188 33188: 1f 92 push r1 3318a: 1f 92 push r1 3318c: cd b7 in r28, 0x3d ; 61 3318e: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 33190: 40 e0 ldi r20, 0x00 ; 0 33192: 61 e5 ldi r22, 0x51 ; 81 33194: ce 01 movw r24, r28 33196: 01 96 adiw r24, 0x01 ; 1 33198: 0f 94 04 c3 call 0x38608 ; 0x38608 3319c: 49 81 ldd r20, Y+1 ; 0x01 3319e: 5a 81 ldd r21, Y+2 ; 0x02 331a0: 6b 81 ldd r22, Y+3 ; 0x03 331a2: 7c 81 ldd r23, Y+4 ; 0x04 331a4: 8d 81 ldd r24, Y+5 ; 0x05 331a6: 0f 94 91 71 call 0x2e322 ; 0x2e322 scopeState = ScopeState::QuerySent; 331aa: 84 e0 ldi r24, 0x04 ; 4 331ac: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a } 331b0: 0f 90 pop r0 331b2: 0f 90 pop r0 331b4: 0f 90 pop r0 331b6: 0f 90 pop r0 331b8: 0f 90 pop r0 331ba: df 91 pop r29 331bc: cf 91 pop r28 331be: 08 95 ret 000331c0 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 331c0: cf 93 push r28 331c2: df 93 push r29 331c4: 00 d0 rcall .+0 ; 0x331c6 331c6: 1f 92 push r1 331c8: 1f 92 push r1 331ca: cd b7 in r28, 0x3d ; 61 331cc: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 331ce: 0f 94 5c c3 call 0x386b8 ; 0x386b8 331d2: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b 331d6: 48 2f mov r20, r24 331d8: 66 e6 ldi r22, 0x66 ; 102 331da: ce 01 movw r24, r28 331dc: 01 96 adiw r24, 0x01 ; 1 331de: 0f 94 04 c3 call 0x38608 ; 0x38608 331e2: 49 81 ldd r20, Y+1 ; 0x01 331e4: 5a 81 ldd r21, Y+2 ; 0x02 331e6: 6b 81 ldd r22, Y+3 ; 0x03 331e8: 7c 81 ldd r23, Y+4 ; 0x04 331ea: 8d 81 ldd r24, Y+5 ; 0x05 331ec: 0f 94 91 71 call 0x2e322 ; 0x2e322 scopeState = ScopeState::FilamentSensorStateSent; 331f0: 86 e0 ldi r24, 0x06 ; 6 331f2: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a } 331f6: 0f 90 pop r0 331f8: 0f 90 pop r0 331fa: 0f 90 pop r0 331fc: 0f 90 pop r0 331fe: 0f 90 pop r0 33200: df 91 pop r29 33202: cf 91 pop r28 33204: 08 95 ret 00033206 : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 33206: cf 93 push r28 33208: df 93 push r29 3320a: 00 d0 rcall .+0 ; 0x3320c 3320c: 1f 92 push r1 3320e: 1f 92 push r1 33210: cd b7 in r28, 0x3d ; 61 33212: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 33214: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33218: 85 34 cpi r24, 0x45 ; 69 3321a: f1 f0 breq .+60 ; 0x33258 3321c: 20 f4 brcc .+8 ; 0x33226 3321e: 82 34 cpi r24, 0x42 ; 66 33220: 51 f1 breq .+84 ; 0x33276 } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 33222: 85 e0 ldi r24, 0x05 ; 5 33224: 11 c0 rjmp .+34 ; 0x33248 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 33226: 86 34 cpi r24, 0x46 ; 70 33228: 71 f1 breq .+92 ; 0x33286 3322a: 80 35 cpi r24, 0x50 ; 80 3322c: d1 f7 brne .-12 ; 0x33222 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 3322e: 80 91 42 13 lds r24, 0x1342 ; 0x801342 33232: 80 93 69 13 sts 0x1369, r24 ; 0x801369 errorCode = ErrorCode::OK; 33236: 81 e0 ldi r24, 0x01 ; 1 33238: 90 e0 ldi r25, 0x00 ; 0 3323a: 90 93 68 13 sts 0x1368, r25 ; 0x801368 3323e: 80 93 67 13 sts 0x1367, r24 ; 0x801367 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 33242: 0f 94 e0 98 call 0x331c0 ; 0x331c0 return Processing; 33246: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 33248: 0f 90 pop r0 3324a: 0f 90 pop r0 3324c: 0f 90 pop r0 3324e: 0f 90 pop r0 33250: 0f 90 pop r0 33252: df 91 pop r29 33254: cf 91 pop r28 33256: 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; 33258: 8c e0 ldi r24, 0x0C ; 12 3325a: 80 93 69 13 sts 0x1369, r24 ; 0x801369 errorCode = static_cast(rsp.paramValue); 3325e: 80 91 42 13 lds r24, 0x1342 ; 0x801342 33262: 90 91 43 13 lds r25, 0x1343 ; 0x801343 33266: 90 93 68 13 sts 0x1368, r25 ; 0x801368 3326a: 80 93 67 13 sts 0x1367, r24 ; 0x801367 // 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(); 3326e: 0f 94 e0 98 call 0x331c0 ; 0x331c0 return CommandError; 33272: 87 e0 ldi r24, 0x07 ; 7 33274: e9 cf rjmp .-46 ; 0x33248 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); 33276: 80 91 42 13 lds r24, 0x1342 ; 0x801342 3327a: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a SendAndUpdateFilamentSensor(); 3327e: 0f 94 e0 98 call 0x331c0 ; 0x331c0 return ButtonPushed; 33282: 8b e0 ldi r24, 0x0B ; 11 33284: e1 cf rjmp .-62 ; 0x33248 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) { 33286: 90 91 2c 13 lds r25, 0x132C ; 0x80132c 3328a: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 3328e: 98 13 cpse r25, r24 33290: 22 c0 rjmp .+68 ; 0x332d6 33292: 90 91 2d 13 lds r25, 0x132D ; 0x80132d 33296: 80 91 3d 13 lds r24, 0x133D ; 0x80133d 3329a: 98 13 cpse r25, r24 3329c: 1c c0 rjmp .+56 ; 0x332d6 progressCode = ProgressCode::OK; 3329e: 10 92 69 13 sts 0x1369, r1 ; 0x801369 errorCode = ErrorCode::OK; 332a2: 81 e0 ldi r24, 0x01 ; 1 332a4: 90 e0 ldi r25, 0x00 ; 0 332a6: 90 93 68 13 sts 0x1368, r25 ; 0x801368 332aa: 80 93 67 13 sts 0x1367, r24 ; 0x801367 scopeState = ScopeState::Ready; 332ae: 82 e8 ldi r24, 0x82 ; 130 332b0: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 332b4: 40 e0 ldi r20, 0x00 ; 0 332b6: 60 e0 ldi r22, 0x00 ; 0 332b8: ce 01 movw r24, r28 332ba: 01 96 adiw r24, 0x01 ; 1 332bc: 0f 94 04 c3 call 0x38608 ; 0x38608 332c0: 85 e0 ldi r24, 0x05 ; 5 332c2: fe 01 movw r30, r28 332c4: 31 96 adiw r30, 0x01 ; 1 332c6: ac e2 ldi r26, 0x2C ; 44 332c8: b3 e1 ldi r27, 0x13 ; 19 332ca: 01 90 ld r0, Z+ 332cc: 0d 92 st X+, r0 332ce: 8a 95 dec r24 332d0: e1 f7 brne .-8 ; 0x332ca 332d2: 82 e0 ldi r24, 0x02 ; 2 332d4: b9 cf rjmp .-142 ; 0x33248 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 332d6: 83 e0 ldi r24, 0x03 ; 3 332d8: b7 cf rjmp .-146 ; 0x33248 000332da : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 332da: 1f 93 push r17 332dc: cf 93 push r28 332de: df 93 push r29 332e0: 00 d0 rcall .+0 ; 0x332e2 332e2: 1f 92 push r1 332e4: 1f 92 push r1 332e6: cd b7 in r28, 0x3d ; 61 332e8: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 332ea: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 332ee: 81 11 cpse r24, r1 332f0: 2a c0 rjmp .+84 ; 0x33346 auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 332f2: 10 91 91 13 lds r17, 0x1391 ; 0x801391 332f6: 1f 3f cpi r17, 0xFF ; 255 332f8: 91 f5 brne .+100 ; 0x3335e btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 332fa: 80 91 90 13 lds r24, 0x1390 ; 0x801390 332fe: 81 11 cpse r24, r1 33300: 60 c0 rjmp .+192 ; 0x333c2 33302: 1f 3f cpi r17, 0xFF ; 255 33304: b9 f0 breq .+46 ; 0x33334 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 33306: 81 e0 ldi r24, 0x01 ; 1 33308: 90 e0 ldi r25, 0x00 ; 0 3330a: 90 93 28 13 sts 0x1328, r25 ; 0x801328 3330e: 80 93 27 13 sts 0x1327, r24 ; 0x801327 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 33312: 90 93 8f 13 sts 0x138F, r25 ; 0x80138f 33316: 80 93 8e 13 sts 0x138E, r24 ; 0x80138e lastErrorSource = ErrorSource::ErrorSourceNone; 3331a: 8f ef ldi r24, 0xFF ; 255 3331c: 80 93 90 13 sts 0x1390, r24 ; 0x801390 // 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) { 33320: 13 30 cpi r17, 0x03 ; 3 33322: 09 f4 brne .+2 ; 0x33326 33324: 82 c0 rjmp .+260 ; 0x3342a 33326: f8 f0 brcs .+62 ; 0x33366 33328: 16 30 cpi r17, 0x06 ; 6 3332a: 08 f4 brcc .+2 ; 0x3332e 3332c: 7b c0 rjmp .+246 ; 0x33424 3332e: 17 30 cpi r17, 0x07 ; 7 33330: 09 f4 brne .+2 ; 0x33334 33332: 7e c0 rjmp .+252 ; 0x33430 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 33334: 0f 90 pop r0 33336: 0f 90 pop r0 33338: 0f 90 pop r0 3333a: 0f 90 pop r0 3333c: 0f 90 pop r0 3333e: df 91 pop r29 33340: cf 91 pop r28 33342: 1f 91 pop r17 33344: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 33346: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 3334a: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 3334e: 0f 94 e9 c5 call 0x38bd2 ; 0x38bd2 33352: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 33354: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 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) { 33358: 8f 3f cpi r24, 0xFF ; 255 3335a: 79 f6 brne .-98 ; 0x332fa 3335c: ca cf rjmp .-108 ; 0x332f2 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 3335e: 8f ef ldi r24, 0xFF ; 255 33360: 80 93 91 13 sts 0x1391, r24 ; 0x801391 33364: ca cf rjmp .-108 ; 0x332fa switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 33366: 8c ef ldi r24, 0xFC ; 252 33368: 97 ea ldi r25, 0xA7 ; 167 3336a: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 3336e: 81 2f mov r24, r17 33370: 90 e0 ldi r25, 0x00 ; 0 33372: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 33376: 0f 94 38 9f call 0x33e70 ; 0x33e70 if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 3337a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 3337e: 81 30 cpi r24, 0x01 ; 1 33380: 89 f4 brne .+34 ; 0x333a4 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 33382: 85 ef ldi r24, 0xF5 ; 245 33384: 97 ea ldi r25, 0xA7 ; 167 33386: 0f 94 4c c3 call 0x38698 ; 0x38698 void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 3338a: 41 2f mov r20, r17 3338c: 62 e4 ldi r22, 0x42 ; 66 3338e: ce 01 movw r24, r28 33390: 01 96 adiw r24, 0x01 ; 1 33392: 0f 94 04 c3 call 0x38608 ; 0x38608 33396: 49 81 ldd r20, Y+1 ; 0x01 33398: 5a 81 ldd r21, Y+2 ; 0x02 3339a: 6b 81 ldd r22, Y+3 ; 0x03 3339c: 7c 81 ldd r23, Y+4 ; 0x04 3339e: 8d 81 ldd r24, Y+5 ; 0x05 333a0: 0f 94 76 98 call 0x330ec ; 0x330ec } // 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) { 333a4: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 333a8: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 333ac: 84 30 cpi r24, 0x04 ; 4 333ae: 20 e8 ldi r18, 0x80 ; 128 333b0: 92 07 cpc r25, r18 333b2: 21 f0 breq .+8 ; 0x333bc 333b4: 89 30 cpi r24, 0x09 ; 9 333b6: 90 48 sbci r25, 0x80 ; 128 333b8: 09 f0 breq .+2 ; 0x333bc 333ba: bc cf rjmp .-136 ; 0x33334 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 333bc: 0f 94 24 74 call 0x2e848 ; 0x2e848 333c0: b9 cf rjmp .-142 ; 0x33334 // 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) { 333c2: 19 30 cpi r17, 0x09 ; 9 333c4: 08 f0 brcs .+2 ; 0x333c8 333c6: b6 cf rjmp .-148 ; 0x33334 333c8: e1 2f mov r30, r17 333ca: f0 e0 ldi r31, 0x00 ; 0 333cc: 88 27 eor r24, r24 333ce: e4 51 subi r30, 0x14 ; 20 333d0: f6 46 sbci r31, 0x66 ; 102 333d2: 8e 4f sbci r24, 0xFE ; 254 333d4: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 333d8: 31 3a cpi r19, 0xA1 ; 161 333da: 31 3a cpi r19, 0xA1 ; 161 333dc: 31 3a cpi r19, 0xA1 ; 161 333de: 51 3a cpi r21, 0xA1 ; 161 333e0: 23 3a cpi r18, 0xA3 ; 163 333e2: 23 3a cpi r18, 0xA3 ; 163 333e4: 15 3a cpi r17, 0xA5 ; 165 333e6: a3 39 cpi r26, 0x93 ; 147 333e8: 67 39 cpi r22, 0x97 ; 151 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 333ea: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 333ee: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 333f2: 87 38 cpi r24, 0x87 ; 135 333f4: 20 e8 ldi r18, 0x80 ; 128 333f6: 92 07 cpc r25, r18 333f8: 21 f0 breq .+8 ; 0x33402 333fa: 87 30 cpi r24, 0x07 ; 7 333fc: 91 48 sbci r25, 0x81 ; 129 333fe: 09 f0 breq .+2 ; 0x33402 33400: 99 cf rjmp .-206 ; 0x33334 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 33402: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33406: 84 30 cpi r24, 0x04 ; 4 33408: 21 f4 brne .+8 ; 0x33412 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 3340a: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 3340e: 81 11 cpse r24, r1 33410: 91 cf rjmp .-222 ; 0x33334 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 33412: 81 e0 ldi r24, 0x01 ; 1 33414: 80 93 5c 0e sts 0x0E5C, r24 ; 0x800e5c <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> menu_submenu(tuneIdlerStallguardThresholdMenu); 33418: 60 e0 ldi r22, 0x00 ; 0 3341a: 8b e5 ldi r24, 0x5B ; 91 3341c: 99 e3 ldi r25, 0x39 ; 57 3341e: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea 33422: 88 cf rjmp .-240 ; 0x33334 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 33424: 10 93 94 13 sts 0x1394, r17 ; 0x801394 33428: 85 cf rjmp .-246 ; 0x33334 void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 3342a: 0f 94 11 c3 call 0x38622 ; 0x38622 3342e: 82 cf rjmp .-252 ; 0x33334 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 33430: 10 92 96 13 sts 0x1396, r1 ; 0x801396 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33434: 10 92 44 13 sts 0x1344, r1 ; 0x801344 currentScope = Scope::Stopped; 33438: 10 92 29 13 sts 0x1329, r1 ; 0x801329 3343c: 60 e0 ldi r22, 0x00 ; 0 3343e: 8c ea ldi r24, 0xAC ; 172 33440: 9c e0 ldi r25, 0x0C ; 12 33442: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 33446: 0f 94 ff 76 call 0x2edfe ; 0x2edfe 3344a: 74 cf rjmp .-280 ; 0x33334 0003344c : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 3344c: 4f 92 push r4 3344e: 5f 92 push r5 33450: 6f 92 push r6 33452: 7f 92 push r7 33454: 8f 92 push r8 33456: 9f 92 push r9 33458: af 92 push r10 3345a: bf 92 push r11 3345c: cf 92 push r12 3345e: df 92 push r13 33460: ef 92 push r14 33462: ff 92 push r15 33464: 0f 93 push r16 33466: 1f 93 push r17 33468: cf 93 push r28 3346a: df 93 push r29 3346c: cd b7 in r28, 0x3d ; 61 3346e: de b7 in r29, 0x3e ; 62 33470: a0 97 sbiw r28, 0x20 ; 32 33472: 0f b6 in r0, 0x3f ; 63 33474: f8 94 cli 33476: de bf out 0x3e, r29 ; 62 33478: 0f be out 0x3f, r0 ; 63 3347a: cd bf out 0x3d, r28 ; 61 3347c: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 3347e: 0f 94 6d 99 call 0x332da ; 0x332da DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 33482: 80 91 2a 13 lds r24, 0x132A ; 0x80132a 33486: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 33488: 0f 94 f1 97 call 0x32fe2 ; 0x32fe2 3348c: 90 91 2a 13 lds r25, 0x132A ; 0x80132a } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 33490: 97 ff sbrs r25, 7 33492: 7d c0 rjmp .+250 ; 0x3358e // we are waiting for something switch (currentScope) { 33494: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33498: 82 30 cpi r24, 0x02 ; 2 3349a: b1 f0 breq .+44 ; 0x334c8 3349c: 08 f4 brcc .+2 ; 0x334a0 3349e: 75 c0 rjmp .+234 ; 0x3358a 334a0: 83 30 cpi r24, 0x03 ; 3 334a2: e1 f1 breq .+120 ; 0x3351c 334a4: 84 30 cpi r24, 0x04 ; 4 334a6: 09 f4 brne .+2 ; 0x334aa 334a8: 54 c0 rjmp .+168 ; 0x33552 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 334aa: 0f 94 f1 97 call 0x32fe2 ; 0x32fe2 334ae: 81 11 cpse r24, r1 334b0: 6b c3 rjmp .+1750 ; 0x33b88 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 334b2: 82 e0 ldi r24, 0x02 ; 2 334b4: 80 93 44 13 sts 0x1344, r24 ; 0x801344 currentScope = Scope::Idle; 334b8: 83 e0 ldi r24, 0x03 ; 3 334ba: 80 93 29 13 sts 0x1329, r24 ; 0x801329 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 334be: 82 e8 ldi r24, 0x82 ; 130 334c0: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a // 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()) { 334c4: 12 e0 ldi r17, 0x02 ; 2 334c6: db c2 rjmp .+1462 ; 0x33a7e IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 334c8: 0f 94 83 3f call 0x27f06 ; 0x27f06 334cc: ab 01 movw r20, r22 334ce: bc 01 movw r22, r24 334d0: 80 91 36 13 lds r24, 0x1336 ; 0x801336 334d4: 90 91 37 13 lds r25, 0x1337 ; 0x801337 334d8: a0 91 38 13 lds r26, 0x1338 ; 0x801338 334dc: b0 91 39 13 lds r27, 0x1339 ; 0x801339 334e0: 88 51 subi r24, 0x18 ; 24 334e2: 9c 4f sbci r25, 0xFC ; 252 334e4: af 4f sbci r26, 0xFF ; 255 334e6: 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 334e8: 48 17 cp r20, r24 334ea: 59 07 cpc r21, r25 334ec: 6a 07 cpc r22, r26 334ee: 7b 07 cpc r23, r27 334f0: 08 f4 brcc .+2 ; 0x334f4 334f2: 4b c0 rjmp .+150 ; 0x3358a void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 334f4: 80 e7 ldi r24, 0x70 ; 112 334f6: 92 e1 ldi r25, 0x12 ; 18 334f8: 0f 94 b5 db call 0x3b76a ; 0x3b76a while (uart->read() != -1) 334fc: 01 96 adiw r24, 0x01 ; 1 334fe: d1 f7 brne .-12 ; 0x334f4 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 33500: 81 e0 ldi r24, 0x01 ; 1 33502: 80 93 44 13 sts 0x1344, r24 ; 0x801344 currentScope = Scope::StartSeq; 33506: 80 93 29 13 sts 0x1329, r24 ; 0x801329 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 3350a: 10 92 4b 13 sts 0x134B, r1 ; 0x80134b LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 3350e: 86 e0 ldi r24, 0x06 ; 6 33510: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b SendVersion(0); 33514: 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); 33516: 0f 94 a0 98 call 0x33140 ; 0x33140 3351a: 37 c0 rjmp .+110 ; 0x3358a } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 3351c: 92 38 cpi r25, 0x82 ; 130 3351e: 29 f6 brne .-118 ; 0x334aa IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33520: 0f 94 83 3f call 0x27f06 ; 0x27f06 33524: ab 01 movw r20, r22 33526: bc 01 movw r22, r24 33528: 80 91 36 13 lds r24, 0x1336 ; 0x801336 3352c: 90 91 37 13 lds r25, 0x1337 ; 0x801337 33530: a0 91 38 13 lds r26, 0x1338 ; 0x801338 33534: b0 91 39 13 lds r27, 0x1339 ; 0x801339 33538: 88 51 subi r24, 0x18 ; 24 3353a: 9c 4f sbci r25, 0xFC ; 252 3353c: af 4f sbci r26, 0xFF ; 255 3353e: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 33540: 48 17 cp r20, r24 33542: 59 07 cpc r21, r25 33544: 6a 07 cpc r22, r26 33546: 7b 07 cpc r23, r27 33548: 08 f4 brcc .+2 ; 0x3354c 3354a: af cf rjmp .-162 ; 0x334aa void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 3354c: 0f 94 c1 98 call 0x33182 ; 0x33182 33550: 1c c0 rjmp .+56 ; 0x3358a } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33552: 0f 94 83 3f call 0x27f06 ; 0x27f06 33556: ab 01 movw r20, r22 33558: bc 01 movw r22, r24 3355a: 80 91 36 13 lds r24, 0x1336 ; 0x801336 3355e: 90 91 37 13 lds r25, 0x1337 ; 0x801337 33562: a0 91 38 13 lds r26, 0x1338 ; 0x801338 33566: b0 91 39 13 lds r27, 0x1339 ; 0x801339 3356a: 88 51 subi r24, 0x18 ; 24 3356c: 9c 4f sbci r25, 0xFC ; 252 3356e: af 4f sbci r26, 0xFF ; 255 33570: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 33572: 48 17 cp r20, r24 33574: 59 07 cpc r21, r25 33576: 6a 07 cpc r22, r26 33578: 7b 07 cpc r23, r27 3357a: 40 f7 brcc .-48 ; 0x3354c }; 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(); 3357c: 0f 94 5c c3 call 0x386b8 ; 0x386b8 if (fs != lastFSensor) { 33580: 90 91 6b 13 lds r25, 0x136B ; 0x80136b 33584: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 33586: 0f 94 e0 98 call 0x331c0 ; 0x331c0 // 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; 3358a: 10 e0 ldi r17, 0x00 ; 0 3358c: 78 c2 rjmp .+1264 ; 0x33a7e StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 3358e: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 33590: d1 2c mov r13, r1 33592: 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; 33594: 99 24 eor r9, r9 33596: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 33598: 55 e0 ldi r21, 0x05 ; 5 3359a: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 3359c: 63 e0 ldi r22, 0x03 ; 3 3359e: 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; 335a0: 74 e0 ldi r23, 0x04 ; 4 335a2: 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; 335a4: e2 e0 ldi r30, 0x02 ; 2 335a6: 6e 2e mov r6, r30 335a8: 66 c0 rjmp .+204 ; 0x33676 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 335aa: 23 30 cpi r18, 0x03 ; 3 335ac: 09 f4 brne .+2 ; 0x335b0 335ae: e0 c0 rjmp .+448 ; 0x33770 335b0: 24 30 cpi r18, 0x04 ; 4 335b2: 09 f0 breq .+2 ; 0x335b6 335b4: 83 c0 rjmp .+262 ; 0x336bc } 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'); 335b6: 20 ed ldi r18, 0xD0 ; 208 335b8: 28 0f add r18, r24 335ba: 2a 30 cpi r18, 0x0A ; 10 335bc: 08 f4 brcc .+2 ; 0x335c0 335be: f8 c0 rjmp .+496 ; 0x337b0 335c0: 2f e9 ldi r18, 0x9F ; 159 335c2: 28 0f add r18, r24 335c4: 26 30 cpi r18, 0x06 ; 6 335c6: 08 f4 brcc .+2 ; 0x335ca 335c8: f3 c0 rjmp .+486 ; 0x337b0 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 335ca: 8a 30 cpi r24, 0x0A ; 10 335cc: 09 f0 breq .+2 ; 0x335d0 335ce: fa c0 rjmp .+500 ; 0x337c4 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()) { 335d0: 40 90 50 13 lds r4, 0x1350 ; 0x801350 335d4: 8c e4 ldi r24, 0x4C ; 76 335d6: 93 e1 ldi r25, 0x13 ; 19 335d8: 0f 94 f3 c2 call 0x385e6 ; 0x385e6 335dc: 48 12 cpse r4, r24 335de: b8 c0 rjmp .+368 ; 0x33750 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 335e0: 10 92 4b 13 sts 0x134B, r1 ; 0x80134b /// @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; } 335e4: 88 e0 ldi r24, 0x08 ; 8 335e6: ec e4 ldi r30, 0x4C ; 76 335e8: f3 e1 ldi r31, 0x13 ; 19 335ea: de 01 movw r26, r28 335ec: 51 96 adiw r26, 0x11 ; 17 335ee: 01 90 ld r0, Z+ 335f0: 0d 92 st X+, r0 335f2: 8a 95 dec r24 335f4: e1 f7 brne .-8 ; 0x335ee 335f6: 88 e0 ldi r24, 0x08 ; 8 335f8: fe 01 movw r30, r28 335fa: 71 96 adiw r30, 0x11 ; 17 335fc: de 01 movw r26, r28 335fe: 59 96 adiw r26, 0x19 ; 25 33600: 01 90 ld r0, Z+ 33602: 0d 92 st X+, r0 33604: 8a 95 dec r24 33606: e1 f7 brne .-8 ; 0x33600 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 33608: 88 e0 ldi r24, 0x08 ; 8 3360a: fe 01 movw r30, r28 3360c: 79 96 adiw r30, 0x19 ; 25 3360e: ac e3 ldi r26, 0x3C ; 60 33610: b3 e1 ldi r27, 0x13 ; 19 33612: 01 90 ld r0, Z+ 33614: 0d 92 st X+, r0 33616: 8a 95 dec r24 33618: e1 f7 brne .-8 ; 0x33612 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 3361a: 8c e3 ldi r24, 0x3C ; 60 3361c: 89 83 std Y+1, r24 ; 0x01 3361e: fe 01 movw r30, r28 33620: 32 96 adiw r30, 0x02 ; 2 33622: a4 e5 ldi r26, 0x54 ; 84 33624: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 33626: 20 e0 ldi r18, 0x00 ; 0 33628: cf 01 movw r24, r30 3362a: 52 16 cp r5, r18 3362c: 09 f4 brne .+2 ; 0x33630 3362e: cd c0 rjmp .+410 ; 0x337ca uint8_t b = lastReceivedBytes[i]; 33630: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 33632: 40 ee ldi r20, 0xE0 ; 224 33634: 43 0f add r20, r19 33636: 40 36 cpi r20, 0x60 ; 96 33638: 08 f0 brcs .+2 ; 0x3363c b = '.'; 3363a: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 3363c: 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) { 3363e: 2f 5f subi r18, 0xFF ; 255 33640: f4 cf rjmp .-24 ; 0x3362a } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33642: 8e 34 cpi r24, 0x4E ; 78 33644: 08 f0 brcs .+2 ; 0x33648 33646: 56 c0 rjmp .+172 ; 0x336f4 33648: 8b 34 cpi r24, 0x4B ; 75 3364a: 08 f0 brcs .+2 ; 0x3364e 3364c: 46 c0 rjmp .+140 ; 0x336da 3364e: 82 34 cpi r24, 0x42 ; 66 33650: 09 f4 brne .+2 ; 0x33654 33652: 43 c0 rjmp .+134 ; 0x336da 33654: e0 f5 brcc .+120 ; 0x336ce 33656: 8a 30 cpi r24, 0x0A ; 10 33658: 59 f0 breq .+22 ; 0x33670 3365a: 8d 30 cpi r24, 0x0D ; 13 3365c: 49 f0 breq .+18 ; 0x33670 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 3365e: b0 92 4b 13 sts 0x134B, r11 ; 0x80134b 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') { 33662: a1 10 cpse r10, r1 33664: 05 c1 rjmp .+522 ; 0x33870 33666: 1f 36 cpi r17, 0x6F ; 111 33668: 09 f0 breq .+2 ; 0x3366c 3366a: fc c3 rjmp .+2040 ; 0x33e64 ++ok; 3366c: aa 24 eor r10, r10 3366e: 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; 33670: 4f ef ldi r20, 0xFF ; 255 33672: c4 1a sub r12, r20 33674: d4 0a sbc r13, r20 33676: 80 e7 ldi r24, 0x70 ; 112 33678: 92 e1 ldi r25, 0x12 ; 18 3367a: 0f 94 b5 db call 0x3b76a ; 0x3b76a 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) { 3367e: 97 fd sbrc r25, 7 33680: 00 c1 rjmp .+512 ; 0x33882 ++bytesConsumed; RecordReceivedByte(c); 33682: 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]; 33684: 20 91 64 13 lds r18, 0x1364 ; 0x801364 33688: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 3368a: f9 01 movw r30, r18 3368c: e9 5d subi r30, 0xD9 ; 217 3368e: fc 4e sbci r31, 0xEC ; 236 33690: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 33692: 79 01 movw r14, r18 33694: ef ef ldi r30, 0xFF ; 255 33696: ee 1a sub r14, r30 33698: fe 0a sbc r15, r30 3369a: ff e0 ldi r31, 0x0F ; 15 3369c: ef 22 and r14, r31 3369e: ff 24 eor r15, r15 336a0: 5e 2c mov r5, r14 336a2: e0 92 64 13 sts 0x1364, r14 ; 0x801364 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 336a6: 20 91 4b 13 lds r18, 0x134B ; 0x80134b 336aa: 22 30 cpi r18, 0x02 ; 2 336ac: 09 f4 brne .+2 ; 0x336b0 336ae: 48 c0 rjmp .+144 ; 0x33740 336b0: 08 f0 brcs .+2 ; 0x336b4 336b2: 7b cf rjmp .-266 ; 0x335aa 336b4: 22 23 and r18, r18 336b6: 29 f2 breq .-118 ; 0x33642 336b8: 21 30 cpi r18, 0x01 ; 1 336ba: 51 f1 breq .+84 ; 0x33710 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 336bc: 1a 30 cpi r17, 0x0A ; 10 336be: 09 f4 brne .+2 ; 0x336c2 336c0: 8f cf rjmp .-226 ; 0x335e0 336c2: 1d 30 cpi r17, 0x0D ; 13 336c4: 09 f4 brne .+2 ; 0x336c8 336c6: 8c cf rjmp .-232 ; 0x335e0 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 336c8: 10 92 51 13 sts 0x1351, r1 ; 0x801351 336cc: ca cf rjmp .-108 ; 0x33662 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 336ce: 85 34 cpi r24, 0x45 ; 69 336d0: 30 f2 brcs .-116 ; 0x3365e 336d2: 87 34 cpi r24, 0x47 ; 71 336d4: 10 f0 brcs .+4 ; 0x336da 336d6: 88 34 cpi r24, 0x48 ; 72 336d8: 11 f6 brne .-124 ; 0x3365e case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 336da: 80 93 4c 13 sts 0x134C, r24 ; 0x80134c responseMsg.request.value = 0; 336de: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d responseMsg.request.value2 = 0; 336e2: 10 92 4f 13 sts 0x134F, r1 ; 0x80134f 336e6: 10 92 4e 13 sts 0x134E, r1 ; 0x80134e responseMsg.request.crc8 = 0; 336ea: 10 92 50 13 sts 0x1350, r1 ; 0x801350 rspState = ResponseStates::RequestValue; 336ee: 90 92 4b 13 sts 0x134B, r9 ; 0x80134b 336f2: be cf rjmp .-132 ; 0x33670 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 336f4: 89 35 cpi r24, 0x59 ; 89 336f6: 40 f4 brcc .+16 ; 0x33708 336f8: 87 35 cpi r24, 0x57 ; 87 336fa: 78 f7 brcc .-34 ; 0x336da 336fc: 20 eb ldi r18, 0xB0 ; 176 336fe: 28 0f add r18, r24 33700: 26 30 cpi r18, 0x06 ; 6 33702: 08 f0 brcs .+2 ; 0x33706 33704: ac cf rjmp .-168 ; 0x3365e 33706: e9 cf rjmp .-46 ; 0x336da 33708: 86 36 cpi r24, 0x66 ; 102 3370a: 09 f0 breq .+2 ; 0x3370e 3370c: a8 cf rjmp .-176 ; 0x3365e 3370e: e5 cf rjmp .-54 ; 0x336da } 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'); 33710: 20 ed ldi r18, 0xD0 ; 208 33712: 28 0f add r18, r24 33714: 2a 30 cpi r18, 0x0A ; 10 33716: 50 f0 brcs .+20 ; 0x3372c 33718: 2f e9 ldi r18, 0x9F ; 159 3371a: 28 0f add r18, r24 3371c: 26 30 cpi r18, 0x06 ; 6 3371e: 30 f0 brcs .+12 ; 0x3372c case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 33720: 80 32 cpi r24, 0x20 ; 32 33722: 09 f0 breq .+2 ; 0x33726 33724: 9c cf rjmp .-200 ; 0x3365e rspState = ResponseStates::ParamCode; 33726: 60 92 4b 13 sts 0x134B, r6 ; 0x80134b 3372a: a2 cf rjmp .-188 ; 0x33670 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 3372c: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 33730: 90 91 4d 13 lds r25, 0x134D ; 0x80134d 33734: 92 95 swap r25 33736: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 33738: 89 0f add r24, r25 3373a: 80 93 4d 13 sts 0x134D, r24 ; 0x80134d 3373e: 98 cf rjmp .-208 ; 0x33670 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 33740: 87 34 cpi r24, 0x47 ; 71 33742: 48 f4 brcc .+18 ; 0x33756 33744: 85 34 cpi r24, 0x45 ; 69 33746: 58 f4 brcc .+22 ; 0x3375e 33748: 2f eb ldi r18, 0xBF ; 191 3374a: 28 0f add r18, r24 3374c: 22 30 cpi r18, 0x02 ; 2 3374e: 38 f0 brcs .+14 ; 0x3375e return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 33750: 10 92 51 13 sts 0x1351, r1 ; 0x801351 33754: 84 cf rjmp .-248 ; 0x3365e } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 33756: 80 35 cpi r24, 0x50 ; 80 33758: 11 f0 breq .+4 ; 0x3375e 3375a: 82 35 cpi r24, 0x52 ; 82 3375c: c9 f7 brne .-14 ; 0x33750 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 3375e: 80 92 4b 13 sts 0x134B, r8 ; 0x80134b responseMsg.paramCode = (ResponseMsgParamCodes)c; 33762: 80 93 51 13 sts 0x1351, r24 ; 0x801351 responseMsg.paramValue = 0; 33766: 10 92 53 13 sts 0x1353, r1 ; 0x801353 3376a: 10 92 52 13 sts 0x1352, r1 ; 0x801352 3376e: 80 cf rjmp .-256 ; 0x33670 33770: 20 ed ldi r18, 0xD0 ; 208 33772: 28 0f add r18, r24 33774: 2a 30 cpi r18, 0x0A ; 10 33776: 48 f0 brcs .+18 ; 0x3378a 33778: 2f e9 ldi r18, 0x9F ; 159 3377a: 28 0f add r18, r24 3377c: 26 30 cpi r18, 0x06 ; 6 3377e: 28 f0 brcs .+10 ; 0x3378a case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 33780: 8a 32 cpi r24, 0x2A ; 42 33782: 31 f7 brne .-52 ; 0x33750 rspState = ResponseStates::CRC; 33784: 70 92 4b 13 sts 0x134B, r7 ; 0x80134b 33788: 73 cf rjmp .-282 ; 0x33670 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 3378a: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 3378e: 20 91 52 13 lds r18, 0x1352 ; 0x801352 33792: 30 91 53 13 lds r19, 0x1353 ; 0x801353 33796: 44 e0 ldi r20, 0x04 ; 4 33798: 22 0f add r18, r18 3379a: 33 1f adc r19, r19 3379c: 4a 95 dec r20 3379e: e1 f7 brne .-8 ; 0x33798 responseMsg.paramValue += Char2Nibble(c); 337a0: 82 0f add r24, r18 337a2: 93 2f mov r25, r19 337a4: 91 1d adc r25, r1 337a6: 90 93 53 13 sts 0x1353, r25 ; 0x801353 337aa: 80 93 52 13 sts 0x1352, r24 ; 0x801352 337ae: 60 cf rjmp .-320 ; 0x33670 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 337b0: 0f 94 d2 c2 call 0x385a4 ; 0x385a4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 337b4: 90 91 50 13 lds r25, 0x1350 ; 0x801350 337b8: 92 95 swap r25 337ba: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 337bc: 89 0f add r24, r25 337be: 80 93 50 13 sts 0x1350, r24 ; 0x801350 337c2: 56 cf rjmp .-340 ; 0x33670 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 337c4: 8d 30 cpi r24, 0x0D ; 13 337c6: 21 f6 brne .-120 ; 0x33750 337c8: 03 cf rjmp .-506 ; 0x335d0 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 337ca: e8 0e add r14, r24 337cc: f9 1e adc r15, r25 337ce: f7 01 movw r30, r14 337d0: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 337d2: 10 92 64 13 sts 0x1364, r1 ; 0x801364 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 337d6: 82 ee ldi r24, 0xE2 ; 226 337d8: 99 ea ldi r25, 0xA9 ; 169 337da: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 337de: 8c ed ldi r24, 0xDC ; 220 337e0: 99 ea ldi r25, 0xA9 ; 169 337e2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 337e6: ce 01 movw r24, r28 337e8: 01 96 adiw r24, 0x01 ; 1 337ea: 0f 94 8e d6 call 0x3ad1c ; 0x3ad1c 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 337ee: 0f 94 8b 70 call 0x2e116 ; 0x2e116 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 337f2: 80 91 29 13 lds r24, 0x1329 ; 0x801329 337f6: 81 30 cpi r24, 0x01 ; 1 337f8: 09 f4 brne .+2 ; 0x337fc 337fa: 74 c0 rjmp .+232 ; 0x338e4 337fc: 08 f4 brcc .+2 ; 0x33800 337fe: c5 ce rjmp .-630 ; 0x3358a 33800: 83 30 cpi r24, 0x03 ; 3 33802: 09 f4 brne .+2 ; 0x33806 33804: d1 c0 rjmp .+418 ; 0x339a8 33806: 84 30 cpi r24, 0x04 ; 4 33808: 09 f0 breq .+2 ; 0x3380c 3380a: 4f ce rjmp .-866 ; 0x334aa return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 3380c: 80 91 2a 13 lds r24, 0x132A ; 0x80132a 33810: 86 30 cpi r24, 0x06 ; 6 33812: 09 f4 brne .+2 ; 0x33816 33814: 6c c1 rjmp .+728 ; 0x33aee 33816: 08 f0 brcs .+2 ; 0x3381a 33818: 93 c1 rjmp .+806 ; 0x33b40 3381a: 84 30 cpi r24, 0x04 ; 4 3381c: 09 f4 brne .+2 ; 0x33820 3381e: 09 c1 rjmp .+530 ; 0x33a32 33820: 85 30 cpi r24, 0x05 ; 5 33822: 09 f0 breq .+2 ; 0x33826 33824: cc c0 rjmp .+408 ; 0x339be case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 33826: 80 91 41 13 lds r24, 0x1341 ; 0x801341 3382a: 81 34 cpi r24, 0x41 ; 65 3382c: 09 f4 brne .+2 ; 0x33830 3382e: 96 c1 rjmp .+812 ; 0x33b5c 33830: 82 35 cpi r24, 0x52 ; 82 33832: 09 f0 breq .+2 ; 0x33836 33834: c4 c0 rjmp .+392 ; 0x339be errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 33836: 10 92 69 13 sts 0x1369, r1 ; 0x801369 errorCode = ErrorCode::PROTOCOL_ERROR; 3383a: 8d e2 ldi r24, 0x2D ; 45 3383c: 90 e8 ldi r25, 0x80 ; 128 3383e: 90 93 68 13 sts 0x1368, r25 ; 0x801368 33842: 80 93 67 13 sts 0x1367, r24 ; 0x801367 } 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")); 33846: 85 e6 ldi r24, 0x65 ; 101 33848: 97 ea ldi r25, 0xA7 ; 167 3384a: 0f 94 a8 70 call 0x2e150 ; 0x2e150 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3384e: 85 e0 ldi r24, 0x05 ; 5 33850: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a SendMsg(rq); 33854: 40 91 2c 13 lds r20, 0x132C ; 0x80132c 33858: 50 91 2d 13 lds r21, 0x132D ; 0x80132d 3385c: 60 91 2e 13 lds r22, 0x132E ; 0x80132e 33860: 70 91 2f 13 lds r23, 0x132F ; 0x80132f 33864: 80 91 30 13 lds r24, 0x1330 ; 0x801330 33868: 0f 94 91 71 call 0x2e322 ; 0x2e322 3386c: 16 e0 ldi r17, 0x06 ; 6 3386e: 07 c1 rjmp .+526 ; 0x33a7e 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') { 33870: 1b 36 cpi r17, 0x6B ; 107 33872: 09 f0 breq .+2 ; 0x33876 33874: f7 c2 rjmp .+1518 ; 0x33e64 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")); 33876: 86 e4 ldi r24, 0x46 ; 70 33878: 97 ea ldi r25, 0xA7 ; 167 3387a: 0f 94 a8 70 call 0x2e150 ; 0x2e150 3387e: 18 e0 ldi r17, 0x08 ; 8 33880: fe c0 rjmp .+508 ; 0x33a7e default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 33882: cd 28 or r12, r13 33884: 19 f0 breq .+6 ; 0x3388c RecordUARTActivity(); // something has happened on the UART, update the timeout record 33886: 0f 94 8b 70 call 0x2e116 ; 0x2e116 3388a: 7f ce rjmp .-770 ; 0x3358a IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3388c: 0f 94 83 3f call 0x27f06 ; 0x27f06 33890: ab 01 movw r20, r22 33892: bc 01 movw r22, r24 33894: 80 91 36 13 lds r24, 0x1336 ; 0x801336 33898: 90 91 37 13 lds r25, 0x1337 ; 0x801337 3389c: a0 91 38 13 lds r26, 0x1338 ; 0x801338 338a0: b0 91 39 13 lds r27, 0x1339 ; 0x801339 338a4: 80 53 subi r24, 0x30 ; 48 338a6: 98 4f sbci r25, 0xF8 ; 248 338a8: af 4f sbci r26, 0xFF ; 255 338aa: 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) { 338ac: 48 17 cp r20, r24 338ae: 59 07 cpc r21, r25 338b0: 6a 07 cpc r22, r26 338b2: 7b 07 cpc r23, r27 338b4: 08 f4 brcc .+2 ; 0x338b8 338b6: 69 ce rjmp .-814 ; 0x3358a 338b8: 80 91 29 13 lds r24, 0x1329 ; 0x801329 338bc: 88 23 and r24, r24 338be: 09 f4 brne .+2 ; 0x338c2 338c0: 64 ce rjmp .-824 ; 0x3358a rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 338c2: 10 92 4b 13 sts 0x134B, r1 ; 0x80134b initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 338c6: 81 e0 ldi r24, 0x01 ; 1 338c8: 80 93 44 13 sts 0x1344, r24 ; 0x801344 currentScope = Scope::StartSeq; 338cc: 80 93 29 13 sts 0x1329, r24 ; 0x801329 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 338d0: 86 e0 ldi r24, 0x06 ; 6 338d2: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b SendVersion(0); 338d6: 80 e0 ldi r24, 0x00 ; 0 338d8: 0f 94 a0 98 call 0x33140 ; 0x33140 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 338dc: 64 e0 ldi r22, 0x04 ; 4 338de: 8e e1 ldi r24, 0x1E ; 30 338e0: 97 ea ldi r25, 0xA7 ; 167 338e2: 79 c0 rjmp .+242 ; 0x339d6 return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 338e4: 10 91 2a 13 lds r17, 0x132A ; 0x80132a 338e8: 13 30 cpi r17, 0x03 ; 3 338ea: b1 f1 breq .+108 ; 0x33958 338ec: 60 f0 brcs .+24 ; 0x33906 338ee: 16 30 cpi r17, 0x06 ; 6 338f0: 09 f4 brne .+2 ; 0x338f4 338f2: 50 c0 rjmp .+160 ; 0x33994 338f4: 19 30 cpi r17, 0x09 ; 9 338f6: 09 f0 breq .+2 ; 0x338fa 338f8: be cf rjmp .-132 ; 0x33876 // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 338fa: 0f 94 bb 72 call 0x2e576 ; 0x2e576 338fe: 88 23 and r24, r24 33900: 09 f4 brne .+2 ; 0x33904 33902: 43 ce rjmp .-890 ; 0x3358a 33904: 40 ce rjmp .-896 ; 0x33586 void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 33906: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 3390a: 83 35 cpi r24, 0x53 ; 83 3390c: 21 f4 brne .+8 ; 0x33916 3390e: 80 91 3d 13 lds r24, 0x133D ; 0x80133d 33912: 18 17 cp r17, r24 33914: 11 f0 breq .+4 ; 0x3391a mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 33916: 81 2f mov r24, r17 33918: fe cd rjmp .-1028 ; 0x33516 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; 3391a: 80 91 42 13 lds r24, 0x1342 ; 0x801342 3391e: e1 2f mov r30, r17 33920: f0 e0 ldi r31, 0x00 ; 0 33922: df 01 movw r26, r30 33924: aa 58 subi r26, 0x8A ; 138 33926: bc 4e sbci r27, 0xEC ; 236 33928: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 3392a: ed 5b subi r30, 0xBD ; 189 3392c: f8 45 sbci r31, 0x58 ; 88 3392e: e4 91 lpm r30, Z 33930: 8e 17 cp r24, r30 33932: 41 f0 breq .+16 ; 0x33944 if (--retries == 0) { 33934: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33938: 81 50 subi r24, 0x01 ; 1 3393a: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b 3393e: 81 11 cpse r24, r1 33940: ea cf rjmp .-44 ; 0x33916 33942: 99 cf rjmp .-206 ; 0x33876 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 33944: 85 e8 ldi r24, 0x85 ; 133 33946: 99 ea ldi r25, 0xA9 ; 169 33948: 0e 94 fe 7a call 0xf5fc ; 0xf5fc /// @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; } 3394c: 8a e0 ldi r24, 0x0A ; 10 3394e: 80 93 3b 13 sts 0x133B, r24 ; 0x80133b } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 33952: 81 e0 ldi r24, 0x01 ; 1 33954: 81 0f add r24, r17 33956: df cd rjmp .-1090 ; 0x33516 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) { 33958: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 3395c: 83 35 cpi r24, 0x53 ; 83 3395e: 21 f4 brne .+8 ; 0x33968 33960: 80 91 3d 13 lds r24, 0x133D ; 0x80133d 33964: 83 30 cpi r24, 0x03 ; 3 33966: 11 f0 breq .+4 ; 0x3396c // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 33968: 83 e0 ldi r24, 0x03 ; 3 3396a: d5 cd rjmp .-1110 ; 0x33516 } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 3396c: 80 91 42 13 lds r24, 0x1342 ; 0x801342 33970: 90 91 43 13 lds r25, 0x1343 ; 0x801343 33974: 90 93 7a 13 sts 0x137A, r25 ; 0x80137a 33978: 80 93 79 13 sts 0x1379, r24 ; 0x801379 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 3397c: 10 92 75 13 sts 0x1375, r1 ; 0x801375 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 33980: e3 e8 ldi r30, 0x83 ; 131 33982: f9 ea ldi r31, 0xA9 ; 169 33984: 84 91 lpm r24, Z 33986: 60 91 73 13 lds r22, 0x1373 ; 0x801373 3398a: 70 e0 ldi r23, 0x00 ; 0 3398c: 49 e0 ldi r20, 0x09 ; 9 3398e: 0f 94 fc 71 call 0x2e3f8 ; 0x2e3f8 33992: fb cd rjmp .-1034 ; 0x3358a currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 33994: 82 e0 ldi r24, 0x02 ; 2 33996: 80 93 44 13 sts 0x1344, r24 ; 0x801344 currentScope = Scope::Idle; 3399a: 83 e0 ldi r24, 0x03 ; 3 3399c: 80 93 29 13 sts 0x1329, r24 ; 0x801329 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 339a0: 82 e8 ldi r24, 0x82 ; 130 339a2: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a 339a6: d2 cd rjmp .-1116 ; 0x3354c } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 339a8: 80 91 2a 13 lds r24, 0x132A ; 0x80132a 339ac: 88 30 cpi r24, 0x08 ; 8 339ae: 09 f4 brne .+2 ; 0x339b2 339b0: b7 c0 rjmp .+366 ; 0x33b20 339b2: a8 f4 brcc .+42 ; 0x339de 339b4: 84 30 cpi r24, 0x04 ; 4 339b6: d9 f0 breq .+54 ; 0x339ee 339b8: 87 30 cpi r24, 0x07 ; 7 339ba: 09 f4 brne .+2 ; 0x339be 339bc: ae c0 rjmp .+348 ; 0x33b1a return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 339be: 81 e0 ldi r24, 0x01 ; 1 339c0: 80 93 44 13 sts 0x1344, r24 ; 0x801344 currentScope = Scope::DelayedRestart; 339c4: 82 e0 ldi r24, 0x02 ; 2 339c6: 80 93 29 13 sts 0x1329, r24 ; 0x801329 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 339ca: 83 e8 ldi r24, 0x83 ; 131 339cc: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 339d0: 65 e0 ldi r22, 0x05 ; 5 339d2: 84 e3 ldi r24, 0x34 ; 52 339d4: 97 ea ldi r25, 0xA7 ; 167 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 339d6: 0f 94 19 71 call 0x2e232 ; 0x2e232 339da: 18 2f mov r17, r24 339dc: 50 c0 rjmp .+160 ; 0x33a7e } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 339de: 8a 30 cpi r24, 0x0A ; 10 339e0: 09 f4 brne .+2 ; 0x339e4 339e2: a7 c0 rjmp .+334 ; 0x33b32 339e4: 60 f3 brcs .-40 ; 0x339be 339e6: 8d 30 cpi r24, 0x0D ; 13 339e8: 08 f4 brcc .+2 ; 0x339ec 339ea: 5f cd rjmp .-1346 ; 0x334aa 339ec: e8 cf rjmp .-48 ; 0x339be 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) { 339ee: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 339f2: 8e 34 cpi r24, 0x4E ; 78 339f4: 60 f5 brcc .+88 ; 0x33a4e 339f6: 8b 34 cpi r24, 0x4B ; 75 339f8: 10 f4 brcc .+4 ; 0x339fe 339fa: 85 34 cpi r24, 0x45 ; 69 339fc: 01 f7 brne .-64 ; 0x339be case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 339fe: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33a02: 86 34 cpi r24, 0x46 ; 70 33a04: 09 f4 brne .+2 ; 0x33a08 33a06: 73 c0 rjmp .+230 ; 0x33aee return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 33a08: 84 e0 ldi r24, 0x04 ; 4 33a0a: 80 93 29 13 sts 0x1329, r24 ; 0x801329 33a0e: 85 e0 ldi r24, 0x05 ; 5 33a10: ec e3 ldi r30, 0x3C ; 60 33a12: f3 e1 ldi r31, 0x13 ; 19 33a14: de 01 movw r26, r28 33a16: 11 96 adiw r26, 0x01 ; 1 33a18: 01 90 ld r0, Z+ 33a1a: 0d 92 st X+, r0 33a1c: 8a 95 dec r24 33a1e: e1 f7 brne .-8 ; 0x33a18 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 33a20: 85 e0 ldi r24, 0x05 ; 5 33a22: fe 01 movw r30, r28 33a24: 31 96 adiw r30, 0x01 ; 1 33a26: ac e2 ldi r26, 0x2C ; 44 33a28: b3 e1 ldi r27, 0x13 ; 19 33a2a: 01 90 ld r0, Z+ 33a2c: 0d 92 st X+, r0 33a2e: 8a 95 dec r24 33a30: e1 f7 brne .-8 ; 0x33a2a default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 33a32: 0f 94 03 99 call 0x33206 ; 0x33206 33a36: 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) { 33a38: 85 30 cpi r24, 0x05 ; 5 33a3a: 09 f2 breq .-126 ; 0x339be 33a3c: 08 f0 brcs .+2 ; 0x33a40 33a3e: 9c c0 rjmp .+312 ; 0x33b78 33a40: 82 30 cpi r24, 0x02 ; 2 33a42: 09 f4 brne .+2 ; 0x33a46 33a44: 32 cd rjmp .-1436 ; 0x334aa 33a46: 84 30 cpi r24, 0x04 ; 4 33a48: 09 f4 brne .+2 ; 0x33a4c 33a4a: 3b cf rjmp .-394 ; 0x338c2 33a4c: 18 c0 rjmp .+48 ; 0x33a7e 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) { 33a4e: 84 35 cpi r24, 0x54 ; 84 33a50: 08 f4 brcc .+2 ; 0x33a54 33a52: b5 cf rjmp .-150 ; 0x339be 33a54: 86 35 cpi r24, 0x56 ; 86 33a56: 98 f2 brcs .-90 ; 0x339fe 33a58: 88 35 cpi r24, 0x58 ; 88 33a5a: 09 f0 breq .+2 ; 0x33a5e 33a5c: b0 cf rjmp .-160 ; 0x339be 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) { 33a5e: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33a62: 86 34 cpi r24, 0x46 ; 70 33a64: 89 f1 breq .+98 ; 0x33ac8 33a66: 80 35 cpi r24, 0x50 ; 80 33a68: c1 f1 breq .+112 ; 0x33ada 33a6a: 82 34 cpi r24, 0x42 ; 66 33a6c: 09 f0 breq .+2 ; 0x33a70 33a6e: 42 c0 rjmp .+132 ; 0x33af4 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); 33a70: 80 91 42 13 lds r24, 0x1342 ; 0x801342 33a74: 80 93 6a 13 sts 0x136A, r24 ; 0x80136a StartReading8bitRegisters(); 33a78: 0f 94 b1 97 call 0x32f62 ; 0x32f62 return ButtonPushed; 33a7c: 1b e0 ldi r17, 0x0B ; 11 33a7e: 80 91 27 13 lds r24, 0x1327 ; 0x801327 33a82: 90 91 28 13 lds r25, 0x1328 ; 0x801328 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 33a86: 81 30 cpi r24, 0x01 ; 1 33a88: 91 05 cpc r25, r1 33a8a: 09 f0 breq .+2 ; 0x33a8e 33a8c: ee c1 rjmp .+988 ; 0x33e6a const StepStatus ss = logic.Step(); switch (ss) { 33a8e: 12 30 cpi r17, 0x02 ; 2 33a90: 09 f4 brne .+2 ; 0x33a94 33a92: 90 c0 rjmp .+288 ; 0x33bb4 33a94: 08 f0 brcs .+2 ; 0x33a98 33a96: 7d c0 rjmp .+250 ; 0x33b92 33a98: 11 23 and r17, r17 33a9a: 09 f4 brne .+2 ; 0x33a9e 33a9c: 18 c1 rjmp .+560 ; 0x33cce case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33a9e: 00 23 and r16, r16 33aa0: 09 f4 brne .+2 ; 0x33aa4 33aa2: e4 c0 rjmp .+456 ; 0x33c6c switch (ss) { 33aa4: 17 30 cpi r17, 0x07 ; 7 33aa6: 09 f4 brne .+2 ; 0x33aaa 33aa8: c4 c1 rjmp .+904 ; 0x33e32 33aaa: 08 f0 brcs .+2 ; 0x33aae 33aac: b8 c1 rjmp .+880 ; 0x33e1e 33aae: 14 30 cpi r17, 0x04 ; 4 33ab0: 09 f4 brne .+2 ; 0x33ab4 33ab2: c7 c1 rjmp .+910 ; 0x33e42 33ab4: 15 30 cpi r17, 0x05 ; 5 33ab6: 09 f0 breq .+2 ; 0x33aba 33ab8: d9 c0 rjmp .+434 ; 0x33c6c state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 33aba: 82 e0 ldi r24, 0x02 ; 2 33abc: 80 93 96 13 sts 0x1396, r24 ; 0x801396 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 33ac0: 60 e0 ldi r22, 0x00 ; 0 33ac2: 8d e2 ldi r24, 0x2D ; 45 33ac4: 90 e8 ldi r25, 0x80 ; 128 33ac6: ba c1 rjmp .+884 ; 0x33e3c // 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) { 33ac8: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 33acc: 88 23 and r24, r24 33ace: 29 f0 breq .+10 ; 0x33ada scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33ad0: 82 e8 ldi r24, 0x82 ; 130 33ad2: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a 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; 33ad6: 13 e0 ldi r17, 0x03 ; 3 33ad8: d2 cf rjmp .-92 ; 0x33a7e } [[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); 33ada: 80 91 42 13 lds r24, 0x1342 ; 0x801342 33ade: 80 93 69 13 sts 0x1369, r24 ; 0x801369 errorCode = ErrorCode::OK; 33ae2: 81 e0 ldi r24, 0x01 ; 1 33ae4: 90 e0 ldi r25, 0x00 ; 0 33ae6: 90 93 68 13 sts 0x1368, r25 ; 0x801368 33aea: 80 93 67 13 sts 0x1367, r24 ; 0x801367 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 33aee: 0f 94 b1 97 call 0x32f62 ; 0x32f62 33af2: 4b cd rjmp .-1386 ; 0x3358a // 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; 33af4: 8c e0 ldi r24, 0x0C ; 12 33af6: 80 93 69 13 sts 0x1369, r24 ; 0x801369 errorCode = static_cast(rsp.paramValue); 33afa: 80 91 42 13 lds r24, 0x1342 ; 0x801342 33afe: 90 91 43 13 lds r25, 0x1343 ; 0x801343 33b02: 90 93 68 13 sts 0x1368, r25 ; 0x801368 33b06: 80 93 67 13 sts 0x1367, r24 ; 0x801367 StartReading8bitRegisters(); // continue Idle state without restarting the communication 33b0a: 0f 94 b1 97 call 0x32f62 ; 0x32f62 // @@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")); 33b0e: 87 e5 ldi r24, 0x57 ; 87 33b10: 97 ea ldi r25, 0xA7 ; 167 33b12: 0f 94 a8 70 call 0x2e150 ; 0x2e150 33b16: 17 e0 ldi r17, 0x07 ; 7 33b18: b2 cf rjmp .-156 ; 0x33a7e return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 33b1a: 0f 94 d5 97 call 0x32faa ; 0x32faa 33b1e: 35 cd rjmp .-1430 ; 0x3358a return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 33b20: 82 e8 ldi r24, 0x82 ; 130 33b22: 0f 94 b9 97 call 0x32f72 ; 0x32f72 33b26: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a return scopeState == ScopeState::Ready ? Finished : Processing; 33b2a: 82 38 cpi r24, 0x82 ; 130 33b2c: 09 f0 breq .+2 ; 0x33b30 33b2e: 2d cd rjmp .-1446 ; 0x3358a 33b30: bc cc rjmp .-1672 ; 0x334aa case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33b32: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33b36: 81 34 cpi r24, 0x41 ; 65 33b38: d1 f6 brne .-76 ; 0x33aee // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33b3a: 0f 94 96 70 call 0x2e12c ; 0x2e12c 33b3e: d7 cf rjmp .-82 ; 0x33aee return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33b40: 88 30 cpi r24, 0x08 ; 8 33b42: b1 f0 breq .+44 ; 0x33b70 33b44: 50 f3 brcs .-44 ; 0x33b1a 33b46: 8a 30 cpi r24, 0x0A ; 10 33b48: 09 f0 breq .+2 ; 0x33b4c 33b4a: 39 cf rjmp .-398 ; 0x339be return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33b4c: 80 91 41 13 lds r24, 0x1341 ; 0x801341 33b50: 81 34 cpi r24, 0x41 ; 65 33b52: 09 f0 breq .+2 ; 0x33b56 33b54: 18 cd rjmp .-1488 ; 0x33586 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33b56: 0f 94 96 70 call 0x2e12c ; 0x2e12c 33b5a: 15 cd rjmp .-1494 ; 0x33586 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; 33b5c: 10 92 69 13 sts 0x1369, r1 ; 0x801369 errorCode = ErrorCode::RUNNING; 33b60: 10 92 68 13 sts 0x1368, r1 ; 0x801368 33b64: 10 92 67 13 sts 0x1367, r1 ; 0x801367 scopeState = ScopeState::Wait; 33b68: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 33b6a: 80 93 2a 13 sts 0x132A, r24 ; 0x80132a 33b6e: 0d cd rjmp .-1510 ; 0x3358a 33b70: 81 e8 ldi r24, 0x81 ; 129 33b72: 0f 94 b9 97 call 0x32f72 ; 0x32f72 33b76: f9 cf rjmp .-14 ; 0x33b6a StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 33b78: 87 30 cpi r24, 0x07 ; 7 33b7a: 49 f2 breq .-110 ; 0x33b0e 33b7c: 08 f4 brcc .+2 ; 0x33b80 33b7e: 63 ce rjmp .-826 ; 0x33846 33b80: 88 30 cpi r24, 0x08 ; 8 33b82: 09 f4 brne .+2 ; 0x33b86 33b84: 78 ce rjmp .-784 ; 0x33876 33b86: 7b cf rjmp .-266 ; 0x33a7e // 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()) { 33b88: 80 91 2a 13 lds r24, 0x132A ; 0x80132a 33b8c: 87 fd sbrc r24, 7 33b8e: 9a cc rjmp .-1740 ; 0x334c4 33b90: fc cc rjmp .-1544 ; 0x3358a StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 33b92: 13 30 cpi r17, 0x03 ; 3 33b94: 09 f4 brne .+2 ; 0x33b98 33b96: 6a c0 rjmp .+212 ; 0x33c6c 33b98: 1b 30 cpi r17, 0x0B ; 11 33b9a: 09 f0 breq .+2 ; 0x33b9e 33b9c: 80 cf rjmp .-256 ; 0x33a9e case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 33b9e: 80 91 6a 13 lds r24, 0x136A ; 0x80136a 33ba2: 80 93 91 13 sts 0x1391, r24 ; 0x801391 LogEchoEvent_P(PSTR("MMU Button pushed")); 33ba6: 86 e7 ldi r24, 0x76 ; 118 33ba8: 97 ea ldi r25, 0xA7 ; 167 33baa: 0f 94 4c c3 call 0x38698 ; 0x38698 CheckUserInput(); // Process the button immediately 33bae: 0f 94 6d 99 call 0x332da ; 0x332da 33bb2: 5c c0 rjmp .+184 ; 0x33c6c CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 33bb4: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 33bb8: 81 11 cpse r24, r1 33bba: 58 c0 rjmp .+176 ; 0x33c6c 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() 33bbc: 0e 94 3d 68 call 0xd07a ; 0xd07a && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 33bc0: 88 23 and r24, r24 33bc2: 09 f4 brne .+2 ; 0x33bc6 33bc4: 53 c0 rjmp .+166 ; 0x33c6c } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 33bc6: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 <_ZL17mcode_in_progress.lto_priv.551> 33bca: 90 91 5a 0e lds r25, 0x0E5A ; 0x800e5a <_ZL17mcode_in_progress.lto_priv.551+0x1> 33bce: 88 35 cpi r24, 0x58 ; 88 33bd0: 92 40 sbci r25, 0x02 ; 2 33bd2: 09 f4 brne .+2 ; 0x33bd6 33bd4: 4b c0 rjmp .+150 ; 0x33c6c && !saved_printing 33bd6: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 33bda: 81 11 cpse r24, r1 33bdc: 47 c0 rjmp .+142 ; 0x33c6c && !mesh_bed_leveling_flag 33bde: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 33be2: 81 11 cpse r24, r1 33be4: 43 c0 rjmp .+134 ; 0x33c6c && !homing_flag 33be6: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 33bea: 81 11 cpse r24, r1 33bec: 3f c0 rjmp .+126 ; 0x33c6c bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 33bee: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 33bf2: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 33bf6: 98 17 cp r25, r24 33bf8: c9 f1 breq .+114 ; 0x33c6c { uint8_t block_index = block_buffer_tail; 33bfa: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 } #endif bool e_active() { unsigned char e_active = 0; 33bfe: 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++; 33c00: 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) 33c02: 30 91 54 0e lds r19, 0x0E54 ; 0x800e54 33c06: 38 17 cp r19, r24 33c08: 89 f0 breq .+34 ; 0x33c2c { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 33c0a: 28 9f mul r18, r24 33c0c: f0 01 movw r30, r0 33c0e: 11 24 eor r1, r1 33c10: ec 58 subi r30, 0x8C ; 140 33c12: f8 4f sbci r31, 0xF8 ; 248 33c14: 44 85 ldd r20, Z+12 ; 0x0c 33c16: 55 85 ldd r21, Z+13 ; 0x0d 33c18: 66 85 ldd r22, Z+14 ; 0x0e 33c1a: 77 85 ldd r23, Z+15 ; 0x0f 33c1c: 45 2b or r20, r21 33c1e: 46 2b or r20, r22 33c20: 47 2b or r20, r23 33c22: 09 f0 breq .+2 ; 0x33c26 33c24: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 33c26: 8f 5f subi r24, 0xFF ; 255 33c28: 8f 70 andi r24, 0x0F ; 15 33c2a: eb cf rjmp .-42 ; 0x33c02 && e_active(); 33c2c: 99 23 and r25, r25 33c2e: f1 f0 breq .+60 ; 0x33c6c SERIAL_ECHOLNPGM("FINDA filament runout!"); 33c30: 87 e0 ldi r24, 0x07 ; 7 33c32: 97 ea ldi r25, 0xA7 ; 167 33c34: 0e 94 fe 7a call 0xf5fc ; 0xf5fc 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); 33c38: 20 e0 ldi r18, 0x00 ; 0 33c3a: 30 e0 ldi r19, 0x00 ; 0 33c3c: a9 01 movw r20, r18 33c3e: ca 01 movw r24, r20 33c40: b9 01 movw r22, r18 33c42: 0e 94 62 8a call 0x114c4 ; 0x114c4 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 33c46: 60 e0 ldi r22, 0x00 ; 0 33c48: 70 e0 ldi r23, 0x00 ; 0 33c4a: cb 01 movw r24, r22 33c4c: 0e 94 f1 68 call 0xd1e2 ; 0xd1e2 33c50: 86 ed ldi r24, 0xD6 ; 214 33c52: 9e e0 ldi r25, 0x0E ; 14 33c54: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 33c58: 81 30 cpi r24, 0x01 ; 1 33c5a: 21 f4 brne .+8 ; 0x33c64 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 33c5c: 0f 94 d5 76 call 0x2edaa ; 0x2edaa 33c60: 8f 3f cpi r24, 0xFF ; 255 33c62: 91 f5 brne .+100 ; 0x33cc8 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 33c64: 8e e7 ldi r24, 0x7E ; 126 33c66: 90 e7 ldi r25, 0x70 ; 112 if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors SERIAL_ECHOLNPGM("FINDA filament runout!"); marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command 33c68: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 break; } } } if (logic.Running()) { 33c6c: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33c70: 82 30 cpi r24, 0x02 ; 2 33c72: 19 f4 brne .+6 ; 0x33c7a state = xState::Active; 33c74: 81 e0 ldi r24, 0x01 ; 1 33c76: 80 93 96 13 sts 0x1396, r24 ; 0x801396 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 33c7a: 10 93 95 13 sts 0x1395, r17 ; 0x801395 // 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) { 33c7e: 80 91 72 07 lds r24, 0x0772 ; 0x800772 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.509> 33c82: 88 23 and r24, r24 33c84: 51 f0 breq .+20 ; 0x33c9a bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 33c86: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> 33c8a: 81 11 cpse r24, r1 33c8c: 06 c0 rjmp .+12 ; 0x33c9a 33c8e: 80 91 8e 13 lds r24, 0x138E ; 0x80138e 33c92: 90 91 8f 13 lds r25, 0x138F ; 0x80138f 33c96: 0f 94 af c4 call 0x3895e ; 0x3895e CheckErrorScreenUserInput(); } 33c9a: a0 96 adiw r28, 0x20 ; 32 33c9c: 0f b6 in r0, 0x3f ; 63 33c9e: f8 94 cli 33ca0: de bf out 0x3e, r29 ; 62 33ca2: 0f be out 0x3f, r0 ; 63 33ca4: cd bf out 0x3d, r28 ; 61 33ca6: df 91 pop r29 33ca8: cf 91 pop r28 33caa: 1f 91 pop r17 33cac: 0f 91 pop r16 33cae: ff 90 pop r15 33cb0: ef 90 pop r14 33cb2: df 90 pop r13 33cb4: cf 90 pop r12 33cb6: bf 90 pop r11 33cb8: af 90 pop r10 33cba: 9f 90 pop r9 33cbc: 8f 90 pop r8 33cbe: 7f 90 pop r7 33cc0: 6f 90 pop r6 33cc2: 5f 90 pop r5 33cc4: 4f 90 pop r4 33cc6: 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 33cc8: 8d ef ldi r24, 0xFD ; 253 33cca: 96 ea ldi r25, 0xA6 ; 166 33ccc: cd cf rjmp .-102 ; 0x33c68 33cce: 00 91 69 13 lds r16, 0x1369 ; 0x801369 ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 33cd2: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33cd6: 08 17 cp r16, r24 33cd8: 09 f4 brne .+2 ; 0x33cdc 33cda: 49 c0 rjmp .+146 ; 0x33d6e // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 33cdc: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33ce0: 84 30 cpi r24, 0x04 ; 4 33ce2: b9 f4 brne .+46 ; 0x33d12 break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 33ce4: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 33ce8: 88 23 and r24, r24 33cea: 99 f0 breq .+38 ; 0x33d12 custom_message_type = CustomMsg::MMUProgress; 33cec: 89 e0 ldi r24, 0x09 ; 9 33cee: 80 93 73 07 sts 0x0773, r24 ; 0x800773 : static_cast(pgm_read_ptr(&progressTexts[0])); 33cf2: e3 ec ldi r30, 0xC3 ; 195 33cf4: f6 ea ldi r31, 0xA6 ; 166 }; 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])) 33cf6: 0e 31 cpi r16, 0x1E ; 30 33cf8: 30 f4 brcc .+12 ; 0x33d06 33cfa: e0 2f mov r30, r16 33cfc: f0 e0 ldi r31, 0x00 ; 0 33cfe: ee 0f add r30, r30 33d00: ff 1f adc r31, r31 33d02: ed 53 subi r30, 0x3D ; 61 33d04: f9 45 sbci r31, 0x59 ; 89 : static_cast(pgm_read_ptr(&progressTexts[0])); 33d06: 85 91 lpm r24, Z+ 33d08: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 33d0a: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 33d0e: 0f 94 e2 0b call 0x217c4 ; 0x217c4 33d12: e3 ec ldi r30, 0xC3 ; 195 33d14: f6 ea ldi r31, 0xA6 ; 166 }; 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])) 33d16: 0e 31 cpi r16, 0x1E ; 30 33d18: 30 f4 brcc .+12 ; 0x33d26 33d1a: e0 2f mov r30, r16 33d1c: f0 e0 ldi r31, 0x00 ; 0 33d1e: ee 0f add r30, r30 33d20: ff 1f adc r31, r31 33d22: ed 53 subi r30, 0x3D ; 61 33d24: f9 45 sbci r31, 0x59 ; 89 : static_cast(pgm_read_ptr(&progressTexts[0])); 33d26: 85 91 lpm r24, Z+ 33d28: 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))); 33d2a: 02 96 adiw r24, 0x02 ; 2 33d2c: 0f 94 4c c3 call 0x38698 ; 0x38698 } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 33d30: 00 93 8d 13 sts 0x138D, r16 ; 0x80138d switch (pc) { 33d34: 03 30 cpi r16, 0x03 ; 3 33d36: 49 f0 breq .+18 ; 0x33d4a 33d38: 0c 31 cpi r16, 0x1C ; 28 33d3a: 09 f0 breq .+2 ; 0x33d3e 33d3c: 97 cf rjmp .-210 ; 0x33c6c bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33d3e: 0f 94 24 59 call 0x2b248 ; 0x2b248 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 33d42: 81 e0 ldi r24, 0x01 ; 1 33d44: 80 93 98 13 sts 0x1398, r24 ; 0x801398 33d48: 91 cf rjmp .-222 ; 0x33c6c 33d4a: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33d4e: 84 30 cpi r24, 0x04 ; 4 33d50: 31 f4 brne .+12 ; 0x33d5e ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 33d52: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 33d56: 84 55 subi r24, 0x54 ; 84 33d58: 82 30 cpi r24, 0x02 ; 2 33d5a: 08 f4 brcc .+2 ; 0x33d5e 33d5c: 87 cf rjmp .-242 ; 0x33c6c 33d5e: 0f 94 24 59 call 0x2b248 ; 0x2b248 // 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; 33d62: 81 e0 ldi r24, 0x01 ; 1 33d64: 80 93 99 13 sts 0x1399, r24 ; 0x801399 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(); 33d68: 0f 94 24 74 call 0x2e848 ; 0x2e848 33d6c: 7f cf rjmp .-258 ; 0x33c6c 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) { 33d6e: 03 30 cpi r16, 0x03 ; 3 33d70: 71 f1 breq .+92 ; 0x33dce 33d72: 0c 31 cpi r16, 0x1C ; 28 33d74: 09 f0 breq .+2 ; 0x33d78 33d76: 7a cf rjmp .-268 ; 0x33c6c unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 33d78: 80 91 98 13 lds r24, 0x1398 ; 0x801398 33d7c: 88 23 and r24, r24 33d7e: 09 f4 brne .+2 ; 0x33d82 33d80: 75 cf rjmp .-278 ; 0x33c6c switch (WhereIsFilament()) { 33d82: 0f 94 5c c3 call 0x386b8 ; 0x386b8 33d86: 88 23 and r24, r24 33d88: b1 f1 breq .+108 ; 0x33df6 33d8a: 81 30 cpi r24, 0x01 ; 1 33d8c: 09 f0 breq .+2 ; 0x33d90 33d8e: 6e cf rjmp .-292 ; 0x33c6c case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 33d90: 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(); 33d94: 0f 94 05 bc call 0x3780a ; 0x3780a // 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; 33d98: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 33d9c: 60 91 74 13 lds r22, 0x1374 ; 0x801374 33da0: 70 e0 ldi r23, 0x00 ; 0 33da2: 90 e0 ldi r25, 0x00 ; 0 33da4: 80 e0 ldi r24, 0x00 ; 0 33da6: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 33daa: 6b 01 movw r12, r22 33dac: 7c 01 movw r14, r24 33dae: 60 91 73 13 lds r22, 0x1373 ; 0x801373 33db2: 70 e0 ldi r23, 0x00 ; 0 33db4: 6e 5f subi r22, 0xFE ; 254 33db6: 7f 4f sbci r23, 0xFF ; 255 33db8: 07 2e mov r0, r23 33dba: 00 0c add r0, r0 33dbc: 88 0b sbc r24, r24 33dbe: 99 0b sbc r25, r25 33dc0: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 33dc4: a7 01 movw r20, r14 33dc6: 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()); 33dc8: 0f 94 28 c3 call 0x38650 ; 0x38650 33dcc: 4f cf rjmp .-354 ; 0x33c6c } 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 33dce: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33dd2: 88 23 and r24, r24 33dd4: 09 f4 brne .+2 ; 0x33dd8 33dd6: 4a cf rjmp .-364 ; 0x33c6c 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); 33dd8: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 33ddc: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 33de0: 98 13 cpse r25, r24 33de2: 44 cf rjmp .-376 ; 0x33c6c switch (WhereIsFilament()) { 33de4: 0f 94 5c c3 call 0x386b8 ; 0x386b8 33de8: 81 50 subi r24, 0x01 ; 1 33dea: 83 30 cpi r24, 0x03 ; 3 33dec: 08 f4 brcc .+2 ; 0x33df0 33dee: bc cf rjmp .-136 ; 0x33d68 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; 33df0: 10 92 99 13 sts 0x1399, r1 ; 0x801399 33df4: 3b cf rjmp .-394 ; 0x33c6c 33df6: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 33dfa: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 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 33dfe: 98 13 cpse r25, r24 33e00: 35 cf rjmp .-406 ; 0x33c6c // 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()); 33e02: 60 91 74 13 lds r22, 0x1374 ; 0x801374 33e06: 70 e0 ldi r23, 0x00 ; 0 33e08: 90 e0 ldi r25, 0x00 ; 0 33e0a: 80 e0 ldi r24, 0x00 ; 0 33e0c: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 33e10: 9b 01 movw r18, r22 33e12: ac 01 movw r20, r24 33e14: 60 e0 ldi r22, 0x00 ; 0 33e16: 70 e0 ldi r23, 0x00 ; 0 33e18: 8f ea ldi r24, 0xAF ; 175 33e1a: 93 e4 ldi r25, 0x43 ; 67 33e1c: d5 cf rjmp .-86 ; 0x33dc8 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 33e1e: 18 30 cpi r17, 0x08 ; 8 33e20: b9 f0 breq .+46 ; 0x33e50 33e22: 19 30 cpi r17, 0x09 ; 9 33e24: 09 f0 breq .+2 ; 0x33e28 33e26: 22 cf rjmp .-444 ; 0x33c6c StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 33e28: 60 e0 ldi r22, 0x00 ; 0 33e2a: 0f 94 9c 83 call 0x30738 ; 0x30738 33e2e: 19 e0 ldi r17, 0x09 ; 9 33e30: 1d cf rjmp .-454 ; 0x33c6c default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 33e32: 61 e0 ldi r22, 0x01 ; 1 33e34: 80 91 67 13 lds r24, 0x1367 ; 0x801367 33e38: 90 91 68 13 lds r25, 0x1368 ; 0x801368 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33e3c: 0f 94 9c 83 call 0x30738 ; 0x30738 33e40: 15 cf rjmp .-470 ; 0x33c6c case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 33e42: 82 e0 ldi r24, 0x02 ; 2 33e44: 80 93 96 13 sts 0x1396, r24 ; 0x801396 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 33e48: 60 e0 ldi r22, 0x00 ; 0 33e4a: 8e e2 ldi r24, 0x2E ; 46 33e4c: 90 e8 ldi r25, 0x80 ; 128 33e4e: f6 cf rjmp .-20 ; 0x33e3c StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 33e50: 10 92 96 13 sts 0x1396, r1 ; 0x801396 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33e54: 10 92 44 13 sts 0x1344, r1 ; 0x801344 currentScope = Scope::Stopped; 33e58: 10 92 29 13 sts 0x1329, r1 ; 0x801329 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33e5c: 60 e0 ldi r22, 0x00 ; 0 33e5e: 8c e2 ldi r24, 0x2C ; 44 33e60: 90 e8 ldi r25, 0x80 ; 128 33e62: ec cf rjmp .-40 ; 0x33e3c break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 33e64: 0f 94 8b 70 call 0x2e116 ; 0x2e116 33e68: aa cd rjmp .-1196 ; 0x339be case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33e6a: 00 23 and r16, r16 33e6c: 01 f3 breq .-64 ; 0x33e2e 33e6e: dc cf rjmp .-72 ; 0x33e28 00033e70 : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 33e70: 80 91 97 13 lds r24, 0x1397 ; 0x801397 33e74: 82 ff sbrs r24, 2 33e76: 07 c0 rjmp .+14 ; 0x33e86 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 33e78: 8b 7f andi r24, 0xFB ; 251 33e7a: 80 93 97 13 sts 0x1397, r24 ; 0x801397 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 33e7e: 81 e5 ldi r24, 0x51 ; 81 33e80: 98 ea ldi r25, 0xA8 ; 168 33e82: 0f 94 4c c3 call 0x38698 ; 0x38698 } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 33e86: 80 91 97 13 lds r24, 0x1397 ; 0x801397 33e8a: 81 ff sbrs r24, 1 33e8c: 52 c0 rjmp .+164 ; 0x33f32 33e8e: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 33e92: 90 91 8c 13 lds r25, 0x138C ; 0x80138c 33e96: 89 2b or r24, r25 33e98: 09 f4 brne .+2 ; 0x33e9c 33e9a: 4b c0 rjmp .+150 ; 0x33f32 LogEchoEvent_P(PSTR("Resuming Temp")); 33e9c: 83 e4 ldi r24, 0x43 ; 67 33e9e: 98 ea ldi r25, 0xA8 ; 168 33ea0: 0f 94 4c c3 call 0x38698 ; 0x38698 // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 33ea4: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 33ea8: 90 91 8c 13 lds r25, 0x138C ; 0x80138c 33eac: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 mmu_print_saved &= ~(SavedState::Cooldown); 33eb0: 80 91 97 13 lds r24, 0x1397 ; 0x801397 33eb4: 8d 7f andi r24, 0xFD ; 253 33eb6: 80 93 97 13 sts 0x1397, r24 ; 0x801397 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 33eba: 80 91 8b 13 lds r24, 0x138B ; 0x80138b 33ebe: 90 91 8c 13 lds r25, 0x138C ; 0x80138c 33ec2: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 33ec6: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 33eca: 89 e8 ldi r24, 0x89 ; 137 33ecc: 9c e5 ldi r25, 0x5C ; 92 33ece: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 33ed2: 0f 94 7d 35 call 0x26afa ; 0x26afa 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)); 33ed6: 43 e1 ldi r20, 0x13 ; 19 33ed8: 58 ea ldi r21, 0xA8 ; 168 33eda: 62 e0 ldi r22, 0x02 ; 2 33edc: 80 e0 ldi r24, 0x00 ; 0 33ede: 0e 94 a1 6f call 0xdf42 ; 0xdf42 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 33ee2: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 33ee6: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 33eea: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 33eee: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 33ef2: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 33ef6: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 33efa: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 33efe: c9 01 movw r24, r18 33f00: 86 1b sub r24, r22 33f02: 97 0b sbc r25, r23 33f04: 06 97 sbiw r24, 0x06 ; 6 33f06: 6c f0 brlt .+26 ; 0x33f22 void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 33f08: 81 e0 ldi r24, 0x01 ; 1 33f0a: 0e 94 da 8b call 0x117b4 ; 0x117b4 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); 33f0e: 80 e0 ldi r24, 0x00 ; 0 33f10: 0f 94 26 9a call 0x3344c ; 0x3344c ReportErrorHookDynamicRender(); 33f14: 0f 94 70 c2 call 0x384e0 ; 0x384e0 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 33f18: 84 e6 ldi r24, 0x64 ; 100 33f1a: 90 e0 ldi r25, 0x00 ; 0 33f1c: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 33f20: e0 cf rjmp .-64 ; 0x33ee2 }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 33f22: 0f 94 46 c2 call 0x3848c ; 0x3848c LogEchoEvent_P(PSTR("Hotend temperature reached")); 33f26: 88 e2 ldi r24, 0x28 ; 40 33f28: 98 ea ldi r25, 0xA8 ; 168 33f2a: 0f 94 4c c3 call 0x38698 ; 0x38698 void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 33f2e: 0c 94 c0 6f jmp 0xdf80 ; 0xdf80 ScreenClear(); } } 33f32: 08 95 ret 00033f34 : /// 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) { 33f34: 0f 93 push r16 33f36: 1f 93 push r17 33f38: cf 93 push r28 33f3a: df 93 push r29 33f3c: 00 d0 rcall .+0 ; 0x33f3e 33f3e: 1f 92 push r1 33f40: 1f 92 push r1 33f42: cd b7 in r28, 0x3d ; 61 33f44: de b7 in r29, 0x3e ; 62 33f46: 18 2f mov r17, r24 33f48: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 33f4a: 10 92 97 13 sts 0x1397, r1 ; 0x801397 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 33f4e: 83 e0 ldi r24, 0x03 ; 3 33f50: 80 93 96 02 sts 0x0296, r24 ; 0x800296 LongTimer nozzleTimeout; 33f54: 19 82 std Y+1, r1 ; 0x01 33f56: 1a 82 std Y+2, r1 ; 0x02 33f58: 1b 82 std Y+3, r1 ; 0x03 33f5a: 1c 82 std Y+4, r1 ; 0x04 33f5c: 1d 82 std Y+5, r1 ; 0x05 33f5e: 90 e0 ldi r25, 0x00 ; 0 33f60: 80 e0 ldi r24, 0x00 ; 0 33f62: 0e 94 7f 8e call 0x11cfe ; 0x11cfe // - 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) { 33f66: 90 91 97 13 lds r25, 0x1397 ; 0x801397 33f6a: 89 81 ldd r24, Y+1 ; 0x01 33f6c: 92 ff sbrs r25, 2 33f6e: 37 c0 rjmp .+110 ; 0x33fde if (!nozzleTimeout.running()) { 33f70: 81 11 cpse r24, r1 33f72: 1e c0 rjmp .+60 ; 0x33fb0 nozzleTimeout.start(); 33f74: ce 01 movw r24, r28 33f76: 01 96 adiw r24, 0x01 ; 1 33f78: 0f 94 26 42 call 0x2844c ; 0x2844c ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 33f7c: 8d e3 ldi r24, 0x3D ; 61 33f7e: 96 ea ldi r25, 0xA6 ; 166 thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); } } else if (nozzleTimeout.running()) { nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33f80: 0f 94 4c c3 call 0x38698 ; 0x38698 } switch (logicStepLastStatus) { 33f84: e0 91 95 13 lds r30, 0x1395 ; 0x801395 33f88: e2 50 subi r30, 0x02 ; 2 33f8a: ea 30 cpi r30, 0x0A ; 10 33f8c: 40 f7 brcc .-48 ; 0x33f5e 33f8e: f0 e0 ldi r31, 0x00 ; 0 33f90: 88 27 eor r24, r24 33f92: e2 53 subi r30, 0x32 ; 50 33f94: f0 46 sbci r31, 0x60 ; 96 33f96: 8e 4f sbci r24, 0xFE ; 254 33f98: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__tablejump2__> 33f9c: 49 3b cpi r20, 0xB9 ; 185 33f9e: 5f 3a cpi r21, 0xAF ; 175 33fa0: 59 3a cpi r21, 0xA9 ; 169 33fa2: 59 3a cpi r21, 0xA9 ; 169 33fa4: 51 3b cpi r21, 0xB1 ; 177 33fa6: 59 3a cpi r21, 0xA9 ; 169 33fa8: b3 3a cpi r27, 0xA3 ; 163 33faa: ef 39 cpi r30, 0x9F ; 159 33fac: 03 3b cpi r16, 0xB3 ; 179 33fae: 59 3a cpi r21, 0xA9 ; 169 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. 33fb0: 40 e4 ldi r20, 0x40 ; 64 33fb2: 57 e7 ldi r21, 0x77 ; 119 33fb4: 6b e1 ldi r22, 0x1B ; 27 33fb6: 70 e0 ldi r23, 0x00 ; 0 33fb8: ce 01 movw r24, r28 33fba: 01 96 adiw r24, 0x01 ; 1 33fbc: 0f 94 67 40 call 0x280ce ; 0x280ce ::expired(unsigned long)> 33fc0: 88 23 and r24, r24 33fc2: 01 f3 breq .-64 ; 0x33f84 mmu_print_saved &= ~(SavedState::CooldownPending); 33fc4: 80 91 97 13 lds r24, 0x1397 ; 0x801397 33fc8: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 33fca: 82 60 ori r24, 0x02 ; 2 33fcc: 80 93 97 13 sts 0x1397, r24 ; 0x801397 33fd0: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 33fd4: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 33fd8: 8d e2 ldi r24, 0x2D ; 45 33fda: 96 ea ldi r25, 0xA6 ; 166 33fdc: d1 cf rjmp .-94 ; 0x33f80 } } else if (nozzleTimeout.running()) { 33fde: 88 23 and r24, r24 33fe0: 89 f2 breq .-94 ; 0x33f84 33fe2: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33fe4: 87 e1 ldi r24, 0x17 ; 23 33fe6: 96 ea ldi r25, 0xA6 ; 166 33fe8: cb cf rjmp .-106 ; 0x33f80 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(); 33fea: 0f 94 38 9f call 0x33e70 ; 0x33e70 ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 33fee: 0f 94 4a 74 call 0x2e894 ; 0x2e894 if (!TuneMenuEntered()) { 33ff2: 80 91 5c 0e lds r24, 0x0E5C ; 0x800e5c <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> 33ff6: 81 11 cpse r24, r1 33ff8: 07 c0 rjmp .+14 ; 0x34008 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 33ffa: 84 e0 ldi r24, 0x04 ; 4 33ffc: 96 ea ldi r25, 0xA6 ; 166 33ffe: 0e 94 fe 7a call 0xf5fc ; 0xf5fc retryAttempts = MAX_RETRIES; 34002: 83 e0 ldi r24, 0x03 ; 3 34004: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 34008: 0f 94 24 59 call 0x2b248 ; 0x2b248 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; 3400c: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 3400e: 0f 90 pop r0 34010: 0f 90 pop r0 34012: 0f 90 pop r0 34014: 0f 90 pop r0 34016: 0f 90 pop r0 34018: df 91 pop r29 3401a: cf 91 pop r28 3401c: 1f 91 pop r17 3401e: 0f 91 pop r16 34020: 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(); 34022: 0f 94 6d 99 call 0x332da ; 0x332da 34026: f2 cf rjmp .-28 ; 0x3400c break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 34028: 80 91 7c 13 lds r24, 0x137C ; 0x80137c 3402c: 81 11 cpse r24, r1 3402e: 97 cf rjmp .-210 ; 0x33f5e // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 34030: 81 2f mov r24, r17 34032: 0f 94 96 74 call 0x2e92c ; 0x2e92c SaveHotendTemp(turn_off_nozzle); 34036: 80 2f mov r24, r16 34038: 0f 94 2e 74 call 0x2e85c ; 0x2e85c CheckUserInput(); 3403c: 0f 94 6d 99 call 0x332da ; 0x332da 34040: 8e cf rjmp .-228 ; 0x33f5e } 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(); 34042: 0f 94 38 9f call 0x33e70 ; 0x33e70 ResumeUnpark(); 34046: 0f 94 4a 74 call 0x2e894 ; 0x2e894 3404a: 89 cf rjmp .-238 ; 0x33f5e } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 3404c: 80 e0 ldi r24, 0x00 ; 0 3404e: df cf rjmp .-66 ; 0x3400e 00034050 : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 34050: cf 93 push r28 34052: df 93 push r29 34054: 00 d0 rcall .+0 ; 0x34056 34056: 1f 92 push r1 34058: 1f 92 push r1 3405a: cd b7 in r28, 0x3d ; 61 3405c: 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; 3405e: 10 92 88 17 sts 0x1788, r1 ; 0x801788 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 34062: 10 92 87 17 sts 0x1787, r1 ; 0x801787 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 34066: 62 e1 ldi r22, 0x12 ; 18 34068: 84 e7 ldi r24, 0x74 ; 116 3406a: 95 ea ldi r25, 0xA5 ; 165 3406c: 0f 94 25 88 call 0x3104a ; 0x3104a 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(); 34070: 0f 94 26 c3 call 0x3864c ; 0x3864c void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 34074: 40 e0 ldi r20, 0x00 ; 0 34076: 65 e5 ldi r22, 0x55 ; 85 34078: ce 01 movw r24, r28 3407a: 01 96 adiw r24, 0x01 ; 1 3407c: 0f 94 04 c3 call 0x38608 ; 0x38608 34080: 49 81 ldd r20, Y+1 ; 0x01 34082: 5a 81 ldd r21, Y+2 ; 0x02 34084: 6b 81 ldd r22, Y+3 ; 0x03 34086: 7c 81 ldd r23, Y+4 ; 0x04 34088: 8d 81 ldd r24, Y+5 ; 0x05 3408a: 0f 94 76 98 call 0x330ec ; 0x330ec logic.UnloadFilament(); if (manage_response(false, true)) { 3408e: 61 e0 ldi r22, 0x01 ; 1 34090: 80 e0 ldi r24, 0x00 ; 0 34092: 0f 94 9a 9f call 0x33f34 ; 0x33f34 34096: 81 11 cpse r24, r1 34098: 03 c0 rjmp .+6 ; 0x340a0 break; } IncrementMMUFails(); 3409a: 0f 94 68 c2 call 0x384d0 ; 0x384d0 3409e: e8 cf rjmp .-48 ; 0x34070 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); 340a0: 83 e0 ldi r24, 0x03 ; 3 340a2: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 340a6: 83 e6 ldi r24, 0x63 ; 99 340a8: 0f 94 cd 87 call 0x30f9a ; 0x30f9a tool_change_extruder = MMU2_NO_TOOL; 340ac: 83 e6 ldi r24, 0x63 ; 99 340ae: 80 93 7e 13 sts 0x137E, r24 ; 0x80137e #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 340b2: 86 e8 ldi r24, 0x86 ; 134 340b4: 97 e1 ldi r25, 0x17 ; 23 340b6: 0e 94 7c 75 call 0xeaf8 ; 0xeaf8 } 340ba: 0f 90 pop r0 340bc: 0f 90 pop r0 340be: 0f 90 pop r0 340c0: 0f 90 pop r0 340c2: 0f 90 pop r0 340c4: df 91 pop r29 340c6: cf 91 pop r28 340c8: 08 95 ret 000340ca : bool MMU2::unload() { 340ca: cf 93 push r28 if (!WaitForMMUReady()) { 340cc: 0f 94 4e 88 call 0x3109c ; 0x3109c 340d0: c8 2f mov r28, r24 340d2: 88 23 and r24, r24 340d4: 79 f0 breq .+30 ; 0x340f4 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 340d6: 88 ec ldi r24, 0xC8 ; 200 340d8: 90 e0 ldi r25, 0x00 ; 0 340da: 0f 94 a5 c6 call 0x38d4a ; 0x38d4a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> 340de: 82 e0 ldi r24, 0x02 ; 2 340e0: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 340e4: 0f 94 c2 87 call 0x30f84 ; 0x30f84 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 340e8: 0f 94 28 a0 call 0x34050 ; 0x34050 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 340ec: 0f 94 43 88 call 0x31086 ; 0x31086 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 340f0: 0f 94 46 c2 call 0x3848c ; 0x3848c return true; } 340f4: 8c 2f mov r24, r28 340f6: cf 91 pop r28 340f8: 08 95 ret 000340fa : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 340fa: 0f 93 push r16 340fc: 1f 93 push r17 340fe: cf 93 push r28 34100: df 93 push r29 34102: 00 d0 rcall .+0 ; 0x34104 34104: 1f 92 push r1 34106: 1f 92 push r1 34108: cd b7 in r28, 0x3d ; 61 3410a: de b7 in r29, 0x3e ; 62 3410c: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 3410e: 0f 94 4e 88 call 0x3109c ; 0x3109c 34112: 18 2f mov r17, r24 34114: 88 23 and r24, r24 34116: 49 f1 breq .+82 ; 0x3416a void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 34118: 86 e7 ldi r24, 0x76 ; 118 3411a: 9c e5 ldi r25, 0x5C ; 92 3411c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 34120: 60 2f mov r22, r16 34122: 0f 94 49 c2 call 0x38492 ; 0x38492 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 34126: 0f 94 c2 87 call 0x30f84 ; 0x30f84 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 3412a: 0f 94 26 c3 call 0x3864c ; 0x3864c } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 3412e: 40 2f mov r20, r16 34130: 6c e4 ldi r22, 0x4C ; 76 34132: ce 01 movw r24, r28 34134: 01 96 adiw r24, 0x01 ; 1 34136: 0f 94 04 c3 call 0x38608 ; 0x38608 3413a: 49 81 ldd r20, Y+1 ; 0x01 3413c: 5a 81 ldd r21, Y+2 ; 0x02 3413e: 6b 81 ldd r22, Y+3 ; 0x03 34140: 7c 81 ldd r23, Y+4 ; 0x04 34142: 8d 81 ldd r24, Y+5 ; 0x05 34144: 0f 94 76 98 call 0x330ec ; 0x330ec logic.LoadFilament(slot); if (manage_response(false, false)) { 34148: 60 e0 ldi r22, 0x00 ; 0 3414a: 80 e0 ldi r24, 0x00 ; 0 3414c: 0f 94 9a 9f call 0x33f34 ; 0x33f34 34150: 18 2f mov r17, r24 34152: 81 11 cpse r24, r1 34154: 03 c0 rjmp .+6 ; 0x3415c break; } IncrementMMUFails(); 34156: 0f 94 68 c2 call 0x384d0 ; 0x384d0 3415a: e7 cf rjmp .-50 ; 0x3412a 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); 3415c: 83 e0 ldi r24, 0x03 ; 3 3415e: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34162: 0f 94 43 88 call 0x31086 ; 0x31086 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 34166: 0f 94 46 c2 call 0x3848c ; 0x3848c return true; } 3416a: 81 2f mov r24, r17 3416c: 0f 90 pop r0 3416e: 0f 90 pop r0 34170: 0f 90 pop r0 34172: 0f 90 pop r0 34174: 0f 90 pop r0 34176: df 91 pop r29 34178: cf 91 pop r28 3417a: 1f 91 pop r17 3417c: 0f 91 pop r16 3417e: 08 95 ret 00034180 : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 34180: ff 92 push r15 34182: 0f 93 push r16 34184: 1f 93 push r17 34186: cf 93 push r28 34188: df 93 push r29 3418a: 00 d0 rcall .+0 ; 0x3418c 3418c: 1f 92 push r1 3418e: 1f 92 push r1 34190: cd b7 in r28, 0x3d ; 61 34192: de b7 in r29, 0x3e ; 62 34194: 08 2f mov r16, r24 34196: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 34198: 0f 94 4e 88 call 0x3109c ; 0x3109c 3419c: 18 2f mov r17, r24 3419e: 88 23 and r24, r24 341a0: b1 f1 breq .+108 ; 0x3420e return false; } if (enableFullScreenMsg) { 341a2: ff 20 and r15, r15 341a4: 39 f0 breq .+14 ; 0x341b4 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 341a6: 85 e6 ldi r24, 0x65 ; 101 341a8: 9c e5 ldi r25, 0x5C ; 92 341aa: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 341ae: 60 2f mov r22, r16 341b0: 0f 94 49 c2 call 0x38492 ; 0x38492 FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 341b4: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 341b8: 81 11 cpse r24, r1 unload(); 341ba: 0f 94 65 a0 call 0x340ca ; 0x340ca struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 341be: 0f 94 c2 87 call 0x30f84 ; 0x30f84 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 341c2: 0f 94 26 c3 call 0x3864c ; 0x3864c } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 341c6: 40 2f mov r20, r16 341c8: 65 e4 ldi r22, 0x45 ; 69 341ca: ce 01 movw r24, r28 341cc: 01 96 adiw r24, 0x01 ; 1 341ce: 0f 94 04 c3 call 0x38608 ; 0x38608 341d2: 49 81 ldd r20, Y+1 ; 0x01 341d4: 5a 81 ldd r21, Y+2 ; 0x02 341d6: 6b 81 ldd r22, Y+3 ; 0x03 341d8: 7c 81 ldd r23, Y+4 ; 0x04 341da: 8d 81 ldd r24, Y+5 ; 0x05 341dc: 0f 94 76 98 call 0x330ec ; 0x330ec logic.EjectFilament(slot); if (manage_response(false, true)) { 341e0: 61 e0 ldi r22, 0x01 ; 1 341e2: 80 e0 ldi r24, 0x00 ; 0 341e4: 0f 94 9a 9f call 0x33f34 ; 0x33f34 341e8: 18 2f mov r17, r24 341ea: 81 11 cpse r24, r1 341ec: 03 c0 rjmp .+6 ; 0x341f4 break; } IncrementMMUFails(); 341ee: 0f 94 68 c2 call 0x384d0 ; 0x384d0 341f2: e7 cf rjmp .-50 ; 0x341c2 } SetCurrentTool(MMU2_NO_TOOL); 341f4: 83 e6 ldi r24, 0x63 ; 99 341f6: 0f 94 cd 87 call 0x30f9a ; 0x30f9a tool_change_extruder = MMU2_NO_TOOL; 341fa: 83 e6 ldi r24, 0x63 ; 99 341fc: 80 93 7e 13 sts 0x137E, r24 ; 0x80137e 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); 34200: 83 e0 ldi r24, 0x03 ; 3 34202: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34206: 0f 94 43 88 call 0x31086 ; 0x31086 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 3420a: 0f 94 46 c2 call 0x3848c ; 0x3848c return true; } 3420e: 81 2f mov r24, r17 34210: 0f 90 pop r0 34212: 0f 90 pop r0 34214: 0f 90 pop r0 34216: 0f 90 pop r0 34218: 0f 90 pop r0 3421a: df 91 pop r29 3421c: cf 91 pop r28 3421e: 1f 91 pop r17 34220: 0f 91 pop r16 34222: ff 90 pop r15 34224: 08 95 ret 00034226 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 34226: 1f 93 push r17 34228: cf 93 push r28 3422a: df 93 push r29 3422c: 00 d0 rcall .+0 ; 0x3422e 3422e: 1f 92 push r1 34230: 1f 92 push r1 34232: cd b7 in r28, 0x3d ; 61 34234: de b7 in r29, 0x3e ; 62 34236: 18 2f mov r17, r24 for (;;) { Disable_E0(); 34238: 0f 94 26 c3 call 0x3864c ; 0x3864c } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 3423c: 41 2f mov r20, r17 3423e: 6b e4 ldi r22, 0x4B ; 75 34240: ce 01 movw r24, r28 34242: 01 96 adiw r24, 0x01 ; 1 34244: 0f 94 04 c3 call 0x38608 ; 0x38608 34248: 49 81 ldd r20, Y+1 ; 0x01 3424a: 5a 81 ldd r21, Y+2 ; 0x02 3424c: 6b 81 ldd r22, Y+3 ; 0x03 3424e: 7c 81 ldd r23, Y+4 ; 0x04 34250: 8d 81 ldd r24, Y+5 ; 0x05 34252: 0f 94 76 98 call 0x330ec ; 0x330ec logic.CutFilament(slot); if (manage_response(false, true)) { 34256: 61 e0 ldi r22, 0x01 ; 1 34258: 80 e0 ldi r24, 0x00 ; 0 3425a: 0f 94 9a 9f call 0x33f34 ; 0x33f34 3425e: 81 11 cpse r24, r1 34260: 03 c0 rjmp .+6 ; 0x34268 break; } IncrementMMUFails(); 34262: 0f 94 68 c2 call 0x384d0 ; 0x384d0 34266: e8 cf rjmp .-48 ; 0x34238 } } 34268: 0f 90 pop r0 3426a: 0f 90 pop r0 3426c: 0f 90 pop r0 3426e: 0f 90 pop r0 34270: 0f 90 pop r0 34272: df 91 pop r29 34274: cf 91 pop r28 34276: 1f 91 pop r17 34278: 08 95 ret 0003427a : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 3427a: cf 93 push r28 3427c: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 3427e: 86 e5 ldi r24, 0x56 ; 86 34280: 9c e5 ldi r25, 0x5C ; 92 34282: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 34286: 6c 2f mov r22, r28 34288: 0f 94 49 c2 call 0x38492 ; 0x38492 if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 3428c: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 34290: 81 11 cpse r24, r1 unload(); 34292: 0f 94 65 a0 call 0x340ca ; 0x340ca struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 34296: 0f 94 c2 87 call 0x30f84 ; 0x30f84 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 3429a: 8c 2f mov r24, r28 3429c: 0f 94 13 a1 call 0x34226 ; 0x34226 SetCurrentTool(MMU2_NO_TOOL); 342a0: 83 e6 ldi r24, 0x63 ; 99 342a2: 0f 94 cd 87 call 0x30f9a ; 0x30f9a tool_change_extruder = MMU2_NO_TOOL; 342a6: 83 e6 ldi r24, 0x63 ; 99 342a8: 80 93 7e 13 sts 0x137E, r24 ; 0x80137e 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); 342ac: 83 e0 ldi r24, 0x03 ; 3 342ae: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 342b2: 0f 94 43 88 call 0x31086 ; 0x31086 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 342b6: 0f 94 46 c2 call 0x3848c ; 0x3848c return true; } 342ba: 81 e0 ldi r24, 0x01 ; 1 342bc: cf 91 pop r28 342be: 08 95 ret 000342c0 : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 342c0: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 342c4: 95 ff sbrs r25, 5 342c6: fc cf rjmp .-8 ; 0x342c0 UDR0 = ch; 342c8: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 342cc: 08 95 ret 000342ce : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 342ce: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 342d2: 87 ff sbrs r24, 7 342d4: fc cf rjmp .-8 ; 0x342ce if (!(UCSR0A & _BV(FE0))) { 342d6: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 342da: 84 fd sbrc r24, 4 342dc: 01 c0 rjmp .+2 ; 0x342e0 * 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(); 342de: a8 95 wdr } ch = UDR0; 342e0: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 342e4: 08 95 ret 000342e6 : /// 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; 342e6: 86 27 eor r24, r22 342e8: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 342ea: 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) { 342ec: 38 2f mov r19, r24 342ee: 88 0f add r24, r24 342f0: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 342f2: 82 27 eor r24, r18 342f4: 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++) { 342f6: d1 f7 brne .-12 ; 0x342ec } else { data <<= 1U; } } return data; } 342f8: 08 95 ret 000342fa : // 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) { 342fa: 2f 92 push r2 342fc: 3f 92 push r3 342fe: 4f 92 push r4 34300: 5f 92 push r5 34302: 6f 92 push r6 34304: 7f 92 push r7 34306: 8f 92 push r8 34308: 9f 92 push r9 3430a: af 92 push r10 3430c: bf 92 push r11 3430e: cf 92 push r12 34310: df 92 push r13 34312: ef 92 push r14 34314: ff 92 push r15 34316: 0f 93 push r16 34318: 1f 93 push r17 3431a: cf 93 push r28 3431c: df 93 push r29 3431e: cd b7 in r28, 0x3d ; 61 34320: de b7 in r29, 0x3e ; 62 34322: a1 97 sbiw r28, 0x21 ; 33 34324: 0f b6 in r0, 0x3f ; 63 34326: f8 94 cli 34328: de bf out 0x3e, r29 ; 62 3432a: 0f be out 0x3f, r0 ; 63 3432c: cd bf out 0x3d, r28 ; 61 3432e: 1c 01 movw r2, r24 34330: 48 01 movw r8, r16 34332: 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) 34334: fc 01 movw r30, r24 34336: e8 5b subi r30, 0xB8 ; 184 34338: ff 4f sbci r31, 0xFF ; 255 3433a: c0 80 ld r12, Z 3433c: d1 80 ldd r13, Z+1 ; 0x01 3433e: e2 80 ldd r14, Z+2 ; 0x02 34340: f3 80 ldd r15, Z+3 ; 0x03 34342: 9a 01 movw r18, r20 34344: ab 01 movw r20, r22 34346: c7 01 movw r24, r14 34348: b6 01 movw r22, r12 3434a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3434e: 0f 94 8f df call 0x3bf1e ; 0x3bf1e 34352: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 34356: 8b 01 movw r16, r22 34358: 8d 83 std Y+5, r24 ; 0x05 3435a: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 3435c: a5 01 movw r20, r10 3435e: 94 01 movw r18, r8 34360: c7 01 movw r24, r14 34362: b6 01 movw r22, r12 34364: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 34368: 0f 94 8f df call 0x3bf1e ; 0x3bf1e 3436c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 34370: 36 2f mov r19, r22 34372: 27 2f mov r18, r23 34374: a8 01 movw r20, r16 34376: 6d 81 ldd r22, Y+5 ; 0x05 34378: 79 81 ldd r23, Y+1 ; 0x01 3437a: 48 37 cpi r20, 0x78 ; 120 3437c: 51 05 cpc r21, r1 3437e: 61 05 cpc r22, r1 34380: 71 05 cpc r23, r1 34382: 20 f4 brcc .+8 ; 0x3438c 34384: 48 e7 ldi r20, 0x78 ; 120 34386: 50 e0 ldi r21, 0x00 ; 0 34388: 60 e0 ldi r22, 0x00 ; 0 3438a: 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) 3438c: d1 01 movw r26, r2 3438e: d6 96 adiw r26, 0x36 ; 54 34390: 8d 90 ld r8, X+ 34392: 9d 90 ld r9, X+ 34394: ad 90 ld r10, X+ 34396: bc 90 ld r11, X 34398: d9 97 sbiw r26, 0x39 ; 57 3439a: 8f 8a std Y+23, r8 ; 0x17 3439c: 98 8e std Y+24, r9 ; 0x18 3439e: a9 8e std Y+25, r10 ; 0x19 343a0: ba 8e std Y+26, r11 ; 0x1a 343a2: 48 15 cp r20, r8 343a4: 59 05 cpc r21, r9 343a6: 6a 05 cpc r22, r10 343a8: 7b 05 cpc r23, r11 343aa: 20 f4 brcc .+8 ; 0x343b4 343ac: 4f 8b std Y+23, r20 ; 0x17 343ae: 58 8f std Y+24, r21 ; 0x18 343b0: 69 8f std Y+25, r22 ; 0x19 343b2: 7a 8f std Y+26, r23 ; 0x1a 343b4: 43 2f mov r20, r19 343b6: 52 2f mov r21, r18 343b8: bc 01 movw r22, r24 343ba: 48 37 cpi r20, 0x78 ; 120 343bc: 51 05 cpc r21, r1 343be: 61 05 cpc r22, r1 343c0: 71 05 cpc r23, r1 343c2: 20 f4 brcc .+8 ; 0x343cc 343c4: 48 e7 ldi r20, 0x78 ; 120 343c6: 50 e0 ldi r21, 0x00 ; 0 343c8: 60 e0 ldi r22, 0x00 ; 0 343ca: 70 e0 ldi r23, 0x00 ; 0 343cc: 18 2d mov r17, r8 343ce: 09 2d mov r16, r9 343d0: a9 a2 std Y+33, r10 ; 0x21 343d2: b8 a2 std Y+32, r11 ; 0x20 343d4: 48 15 cp r20, r8 343d6: 59 05 cpc r21, r9 343d8: 6a 05 cpc r22, r10 343da: 7b 05 cpc r23, r11 343dc: 20 f4 brcc .+8 ; 0x343e6 343de: 14 2f mov r17, r20 343e0: 05 2f mov r16, r21 343e2: 69 a3 std Y+33, r22 ; 0x21 343e4: 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; 343e6: f1 01 movw r30, r2 343e8: ee 5b subi r30, 0xBE ; 190 343ea: ff 4f sbci r31, 0xFF ; 255 343ec: c0 80 ld r12, Z 343ee: d1 80 ldd r13, Z+1 ; 0x01 343f0: e2 80 ldd r14, Z+2 ; 0x02 343f2: f3 80 ldd r15, Z+3 ; 0x03 343f4: cd 82 std Y+5, r12 ; 0x05 343f6: de 82 std Y+6, r13 ; 0x06 343f8: ef 82 std Y+7, r14 ; 0x07 343fa: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 343fc: cd 28 or r12, r13 343fe: ce 28 or r12, r14 34400: cf 28 or r12, r15 34402: 41 f4 brne .+16 ; 0x34414 // Don't allow zero acceleration. acceleration = 1; 34404: c1 2c mov r12, r1 34406: d1 2c mov r13, r1 34408: 76 01 movw r14, r12 3440a: c3 94 inc r12 3440c: cd 82 std Y+5, r12 ; 0x05 3440e: de 82 std Y+6, r13 ; 0x06 34410: ef 82 std Y+7, r14 ; 0x07 34412: 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; 34414: 2f 89 ldd r18, Y+23 ; 0x17 34416: 38 8d ldd r19, Y+24 ; 0x18 34418: 49 8d ldd r20, Y+25 ; 0x19 3441a: 5a 8d ldd r21, Y+26 ; 0x1a 3441c: b9 01 movw r22, r18 3441e: ca 01 movw r24, r20 34420: 0f 94 ec dd call 0x3bbd8 ; 0x3bbd8 <__mulsi3> 34424: 6d 87 std Y+13, r22 ; 0x0d 34426: 7e 87 std Y+14, r23 ; 0x0e 34428: 8f 87 std Y+15, r24 ; 0x0f 3442a: 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; 3442c: a5 01 movw r20, r10 3442e: 94 01 movw r18, r8 34430: c5 01 movw r24, r10 34432: b4 01 movw r22, r8 34434: 0f 94 ec dd call 0x3bbd8 ; 0x3bbd8 <__mulsi3> 34438: 2b 01 movw r4, r22 3443a: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 3443c: 21 2f mov r18, r17 3443e: 30 2f mov r19, r16 34440: 49 a1 ldd r20, Y+33 ; 0x21 34442: 58 a1 ldd r21, Y+32 ; 0x20 34444: 61 2f mov r22, r17 34446: 70 2f mov r23, r16 34448: ca 01 movw r24, r20 3444a: 0f 94 ec dd call 0x3bbd8 ; 0x3bbd8 <__mulsi3> 3444e: 69 8b std Y+17, r22 ; 0x11 34450: 7a 8b std Y+18, r23 ; 0x12 34452: 8b 8b std Y+19, r24 ; 0x13 34454: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 34456: cd 80 ldd r12, Y+5 ; 0x05 34458: de 80 ldd r13, Y+6 ; 0x06 3445a: ef 80 ldd r14, Y+7 ; 0x07 3445c: f8 84 ldd r15, Y+8 ; 0x08 3445e: cc 0c add r12, r12 34460: dd 1c adc r13, r13 34462: ee 1c adc r14, r14 34464: ff 1c adc r15, r15 34466: c9 86 std Y+9, r12 ; 0x09 34468: da 86 std Y+10, r13 ; 0x0a 3446a: eb 86 std Y+11, r14 ; 0x0b 3446c: 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; 3446e: c3 01 movw r24, r6 34470: b2 01 movw r22, r4 34472: 61 50 subi r22, 0x01 ; 1 34474: 71 09 sbc r23, r1 34476: 81 09 sbc r24, r1 34478: 91 09 sbc r25, r1 3447a: cd 84 ldd r12, Y+13 ; 0x0d 3447c: de 84 ldd r13, Y+14 ; 0x0e 3447e: ef 84 ldd r14, Y+15 ; 0x0f 34480: f8 88 ldd r15, Y+16 ; 0x10 34482: 6c 19 sub r22, r12 34484: 7d 09 sbc r23, r13 34486: 8e 09 sbc r24, r14 34488: 9f 09 sbc r25, r15 3448a: c9 84 ldd r12, Y+9 ; 0x09 3448c: da 84 ldd r13, Y+10 ; 0x0a 3448e: eb 84 ldd r14, Y+11 ; 0x0b 34490: fc 84 ldd r15, Y+12 ; 0x0c 34492: 6c 0d add r22, r12 34494: 7d 1d adc r23, r13 34496: 8e 1d adc r24, r14 34498: 9f 1d adc r25, r15 3449a: a7 01 movw r20, r14 3449c: 96 01 movw r18, r12 3449e: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 344a2: 69 01 movw r12, r18 344a4: 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; 344a6: c3 01 movw r24, r6 344a8: b2 01 movw r22, r4 344aa: 29 89 ldd r18, Y+17 ; 0x11 344ac: 3a 89 ldd r19, Y+18 ; 0x12 344ae: 4b 89 ldd r20, Y+19 ; 0x13 344b0: 5c 89 ldd r21, Y+20 ; 0x14 344b2: 62 1b sub r22, r18 344b4: 73 0b sbc r23, r19 344b6: 84 0b sbc r24, r20 344b8: 95 0b sbc r25, r21 344ba: 29 85 ldd r18, Y+9 ; 0x09 344bc: 3a 85 ldd r19, Y+10 ; 0x0a 344be: 4b 85 ldd r20, Y+11 ; 0x0b 344c0: 5c 85 ldd r21, Y+12 ; 0x0c 344c2: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 344c6: 29 01 movw r4, r18 344c8: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 344ca: d7 01 movw r26, r14 344cc: c6 01 movw r24, r12 344ce: 84 0d add r24, r4 344d0: 95 1d adc r25, r5 344d2: a6 1d adc r26, r6 344d4: b7 1d adc r27, r7 344d6: 8c 8f std Y+28, r24 ; 0x1c 344d8: 9d 8f std Y+29, r25 ; 0x1d 344da: ae 8f std Y+30, r26 ; 0x1e 344dc: 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) { 344de: f1 01 movw r30, r2 344e0: e4 5b subi r30, 0xB4 ; 180 344e2: ff 4f sbci r31, 0xFF ; 255 344e4: 90 81 ld r25, Z 344e6: 9b 8f std Y+27, r25 ; 0x1b 344e8: 99 23 and r25, r25 344ea: 09 f4 brne .+2 ; 0x344ee 344ec: 8d c0 rjmp .+282 ; 0x34608 final_adv_steps = final_rate * block->adv_comp; 344ee: 61 2f mov r22, r17 344f0: 70 2f mov r23, r16 344f2: 89 a1 ldd r24, Y+33 ; 0x21 344f4: 98 a1 ldd r25, Y+32 ; 0x20 344f6: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 344fa: f1 01 movw r30, r2 344fc: ec 5a subi r30, 0xAC ; 172 344fe: ff 4f sbci r31, 0xFF ; 255 34500: 20 81 ld r18, Z 34502: 31 81 ldd r19, Z+1 ; 0x01 34504: 42 81 ldd r20, Z+2 ; 0x02 34506: 53 81 ldd r21, Z+3 ; 0x03 34508: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3450c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 34510: 6d 8b std Y+21, r22 ; 0x15 34512: 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) { 34514: d1 01 movw r26, r2 34516: 50 96 adiw r26, 0x10 ; 16 34518: 2d 91 ld r18, X+ 3451a: 3d 91 ld r19, X+ 3451c: 4d 91 ld r20, X+ 3451e: 5c 91 ld r21, X 34520: 53 97 sbiw r26, 0x13 ; 19 34522: 29 83 std Y+1, r18 ; 0x01 34524: 3a 83 std Y+2, r19 ; 0x02 34526: 4b 83 std Y+3, r20 ; 0x03 34528: 5c 83 std Y+4, r21 ; 0x04 3452a: 8c 8d ldd r24, Y+28 ; 0x1c 3452c: 9d 8d ldd r25, Y+29 ; 0x1d 3452e: ae 8d ldd r26, Y+30 ; 0x1e 34530: bf 8d ldd r27, Y+31 ; 0x1f 34532: 82 17 cp r24, r18 34534: 93 07 cpc r25, r19 34536: a4 07 cpc r26, r20 34538: b5 07 cpc r27, r21 3453a: 08 f0 brcs .+2 ; 0x3453e 3453c: 68 c0 rjmp .+208 ; 0x3460e plateau_steps = block->step_event_count.wide - accel_decel_steps; 3453e: 29 01 movw r4, r18 34540: 3a 01 movw r6, r20 34542: 48 1a sub r4, r24 34544: 59 0a sbc r5, r25 34546: 6a 0a sbc r6, r26 34548: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 3454a: 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; 3454c: 40 e0 ldi r20, 0x00 ; 0 3454e: 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) 34550: 99 23 and r25, r25 34552: 89 f0 breq .+34 ; 0x34576 max_adv_steps = block->nominal_rate * block->adv_comp; 34554: c5 01 movw r24, r10 34556: b4 01 movw r22, r8 34558: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 3455c: f1 01 movw r30, r2 3455e: ec 5a subi r30, 0xAC ; 172 34560: ff 4f sbci r31, 0xFF ; 255 34562: 20 81 ld r18, Z 34564: 31 81 ldd r19, Z+1 ; 0x01 34566: 42 81 ldd r20, Z+2 ; 0x02 34568: 53 81 ldd r21, Z+3 ; 0x03 3456a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3456e: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 34572: 46 2f mov r20, r22 34574: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 34576: 3f b7 in r19, 0x3f ; 63 34578: 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. 3457a: f1 01 movw r30, r2 3457c: e9 5b subi r30, 0xB9 ; 185 3457e: ff 4f sbci r31, 0xFF ; 255 34580: 20 81 ld r18, Z 34582: 21 11 cpse r18, r1 34584: 27 c0 rjmp .+78 ; 0x345d4 block->accelerate_until = accelerate_steps; 34586: d1 01 movw r26, r2 34588: 59 96 adiw r26, 0x19 ; 25 3458a: cd 92 st X+, r12 3458c: dd 92 st X+, r13 3458e: ed 92 st X+, r14 34590: fc 92 st X, r15 34592: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 34594: c4 0c add r12, r4 34596: d5 1c adc r13, r5 34598: e6 1c adc r14, r6 3459a: f7 1c adc r15, r7 3459c: f1 01 movw r30, r2 3459e: c5 8e std Z+29, r12 ; 0x1d 345a0: d6 8e std Z+30, r13 ; 0x1e 345a2: e7 8e std Z+31, r14 ; 0x1f 345a4: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 345a6: cf 88 ldd r12, Y+23 ; 0x17 345a8: c2 ae std Z+58, r12 ; 0x3a 345aa: d8 8c ldd r13, Y+24 ; 0x18 345ac: d3 ae std Z+59, r13 ; 0x3b 345ae: e9 8c ldd r14, Y+25 ; 0x19 345b0: e4 ae std Z+60, r14 ; 0x3c 345b2: fa 8c ldd r15, Y+26 ; 0x1a 345b4: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 345b6: fe 96 adiw r30, 0x3e ; 62 345b8: 10 83 st Z, r17 345ba: 01 83 std Z+1, r16 ; 0x01 345bc: c9 a0 ldd r12, Y+33 ; 0x21 345be: c2 82 std Z+2, r12 ; 0x02 345c0: d8 a0 ldd r13, Y+32 ; 0x20 345c2: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 345c4: 73 96 adiw r30, 0x13 ; 19 345c6: ed 88 ldd r14, Y+21 ; 0x15 345c8: e0 82 st Z, r14 345ca: fe 88 ldd r15, Y+22 ; 0x16 345cc: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 345ce: 32 97 sbiw r30, 0x02 ; 2 345d0: 40 83 st Z, r20 345d2: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 345d4: 3f bf out 0x3f, r19 ; 63 } 345d6: a1 96 adiw r28, 0x21 ; 33 345d8: 0f b6 in r0, 0x3f ; 63 345da: f8 94 cli 345dc: de bf out 0x3e, r29 ; 62 345de: 0f be out 0x3f, r0 ; 63 345e0: cd bf out 0x3d, r28 ; 61 345e2: df 91 pop r29 345e4: cf 91 pop r28 345e6: 1f 91 pop r17 345e8: 0f 91 pop r16 345ea: ff 90 pop r15 345ec: ef 90 pop r14 345ee: df 90 pop r13 345f0: cf 90 pop r12 345f2: bf 90 pop r11 345f4: af 90 pop r10 345f6: 9f 90 pop r9 345f8: 8f 90 pop r8 345fa: 7f 90 pop r7 345fc: 6f 90 pop r6 345fe: 5f 90 pop r5 34600: 4f 90 pop r4 34602: 3f 90 pop r3 34604: 2f 90 pop r2 34606: 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; 34608: 1d 8a std Y+21, r1 ; 0x15 3460a: 1e 8a std Y+22, r1 ; 0x16 3460c: 83 cf rjmp .-250 ; 0x34514 #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; 3460e: 2d 81 ldd r18, Y+5 ; 0x05 34610: 3e 81 ldd r19, Y+6 ; 0x06 34612: 4f 81 ldd r20, Y+7 ; 0x07 34614: 58 85 ldd r21, Y+8 ; 0x08 34616: 82 e0 ldi r24, 0x02 ; 2 34618: 22 0f add r18, r18 3461a: 33 1f adc r19, r19 3461c: 44 1f adc r20, r20 3461e: 55 1f adc r21, r21 34620: 8a 95 dec r24 34622: d1 f7 brne .-12 ; 0x34618 34624: 89 81 ldd r24, Y+1 ; 0x01 34626: 9a 81 ldd r25, Y+2 ; 0x02 34628: ab 81 ldd r26, Y+3 ; 0x03 3462a: bc 81 ldd r27, Y+4 ; 0x04 3462c: 81 70 andi r24, 0x01 ; 1 3462e: 99 27 eor r25, r25 34630: aa 27 eor r26, r26 34632: bb 27 eor r27, r27 34634: 8d 83 std Y+5, r24 ; 0x05 34636: 9e 83 std Y+6, r25 ; 0x06 34638: af 83 std Y+7, r26 ; 0x07 3463a: b8 87 std Y+8, r27 ; 0x08 3463c: 89 80 ldd r8, Y+1 ; 0x01 3463e: 9a 80 ldd r9, Y+2 ; 0x02 34640: ab 80 ldd r10, Y+3 ; 0x03 34642: bc 80 ldd r11, Y+4 ; 0x04 34644: b6 94 lsr r11 34646: a7 94 ror r10 34648: 97 94 ror r9 3464a: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 3464c: cd 84 ldd r12, Y+13 ; 0x0d 3464e: de 84 ldd r13, Y+14 ; 0x0e 34650: ef 84 ldd r14, Y+15 ; 0x0f 34652: f8 88 ldd r15, Y+16 ; 0x10 34654: 89 89 ldd r24, Y+17 ; 0x11 34656: 9a 89 ldd r25, Y+18 ; 0x12 34658: ab 89 ldd r26, Y+19 ; 0x13 3465a: bc 89 ldd r27, Y+20 ; 0x14 3465c: 8c 15 cp r24, r12 3465e: 9d 05 cpc r25, r13 34660: ae 05 cpc r26, r14 34662: bf 05 cpc r27, r15 34664: 08 f4 brcc .+2 ; 0x34668 34666: 6f c0 rjmp .+222 ; 0x34746 // 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; 34668: 6c 01 movw r12, r24 3466a: 7d 01 movw r14, r26 3466c: 91 e0 ldi r25, 0x01 ; 1 3466e: c9 1a sub r12, r25 34670: d1 08 sbc r13, r1 34672: e1 08 sbc r14, r1 34674: f1 08 sbc r15, r1 34676: 8d 85 ldd r24, Y+13 ; 0x0d 34678: 9e 85 ldd r25, Y+14 ; 0x0e 3467a: af 85 ldd r26, Y+15 ; 0x0f 3467c: b8 89 ldd r27, Y+16 ; 0x10 3467e: c8 1a sub r12, r24 34680: d9 0a sbc r13, r25 34682: ea 0a sbc r14, r26 34684: fb 0a sbc r15, r27 34686: c7 01 movw r24, r14 34688: b6 01 movw r22, r12 3468a: 62 0f add r22, r18 3468c: 73 1f adc r23, r19 3468e: 84 1f adc r24, r20 34690: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 34692: cd 80 ldd r12, Y+5 ; 0x05 34694: de 80 ldd r13, Y+6 ; 0x06 34696: ef 80 ldd r14, Y+7 ; 0x07 34698: f8 84 ldd r15, Y+8 ; 0x08 3469a: cd 28 or r12, r13 3469c: ce 28 or r12, r14 3469e: cf 28 or r12, r15 346a0: 41 f0 breq .+16 ; 0x346b2 accelerate_steps += acceleration_x2; 346a2: c9 84 ldd r12, Y+9 ; 0x09 346a4: da 84 ldd r13, Y+10 ; 0x0a 346a6: eb 84 ldd r14, Y+11 ; 0x0b 346a8: fc 84 ldd r15, Y+12 ; 0x0c 346aa: 6c 0d add r22, r12 346ac: 7d 1d adc r23, r13 346ae: 8e 1d adc r24, r14 346b0: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 346b2: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 346b6: 75 01 movw r14, r10 346b8: 64 01 movw r12, r8 346ba: c2 0e add r12, r18 346bc: d3 1e adc r13, r19 346be: e4 1e adc r14, r20 346c0: f5 1e adc r15, r21 346c2: 29 81 ldd r18, Y+1 ; 0x01 346c4: 3a 81 ldd r19, Y+2 ; 0x02 346c6: 4b 81 ldd r20, Y+3 ; 0x03 346c8: 5c 81 ldd r21, Y+4 ; 0x04 346ca: 2c 15 cp r18, r12 346cc: 3d 05 cpc r19, r13 346ce: 4e 05 cpc r20, r14 346d0: 5f 05 cpc r21, r15 346d2: 10 f4 brcc .+4 ; 0x346d8 346d4: 69 01 movw r12, r18 346d6: 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) { 346d8: 2b 8d ldd r18, Y+27 ; 0x1b 346da: 22 23 and r18, r18 346dc: 09 f4 brne .+2 ; 0x346e0 346de: 69 c0 rjmp .+210 ; 0x347b2 if(!accelerate_steps || !decelerate_steps) { 346e0: c1 14 cp r12, r1 346e2: d1 04 cpc r13, r1 346e4: e1 04 cpc r14, r1 346e6: f1 04 cpc r15, r1 346e8: 09 f4 brne .+2 ; 0x346ec 346ea: 66 c0 rjmp .+204 ; 0x347b8 // 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; 346ec: 4d 89 ldd r20, Y+21 ; 0x15 346ee: 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) { 346f0: 41 14 cp r4, r1 346f2: 51 04 cpc r5, r1 346f4: 61 04 cpc r6, r1 346f6: 71 04 cpc r7, r1 346f8: 09 f4 brne .+2 ; 0x346fc 346fa: 3d cf rjmp .-390 ; 0x34576 // 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); 346fc: a7 01 movw r20, r14 346fe: 96 01 movw r18, r12 34700: 69 85 ldd r22, Y+9 ; 0x09 34702: 7a 85 ldd r23, Y+10 ; 0x0a 34704: 8b 85 ldd r24, Y+11 ; 0x0b 34706: 9c 85 ldd r25, Y+12 ; 0x0c 34708: 0f 94 ec dd call 0x3bbd8 ; 0x3bbd8 <__mulsi3> 3470c: 2d 85 ldd r18, Y+13 ; 0x0d 3470e: 3e 85 ldd r19, Y+14 ; 0x0e 34710: 4f 85 ldd r20, Y+15 ; 0x0f 34712: 58 89 ldd r21, Y+16 ; 0x10 34714: 62 0f add r22, r18 34716: 73 1f adc r23, r19 34718: 84 1f adc r24, r20 3471a: 95 1f adc r25, r21 3471c: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 34720: 0f 94 7f e2 call 0x3c4fe ; 0x3c4fe max_adv_steps = max_rate * block->adv_comp; 34724: f1 01 movw r30, r2 34726: ec 5a subi r30, 0xAC ; 172 34728: ff 4f sbci r31, 0xFF ; 255 3472a: 20 81 ld r18, Z 3472c: 31 81 ldd r19, Z+1 ; 0x01 3472e: 42 81 ldd r20, Z+2 ; 0x02 34730: 53 81 ldd r21, Z+3 ; 0x03 34732: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 34736: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 3473a: 46 2f mov r20, r22 3473c: 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; 3473e: 41 2c mov r4, r1 34740: 51 2c mov r5, r1 34742: 32 01 movw r6, r4 34744: 18 cf rjmp .-464 ; 0x34576 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; 34746: 6d 85 ldd r22, Y+13 ; 0x0d 34748: 7e 85 ldd r23, Y+14 ; 0x0e 3474a: 8f 85 ldd r24, Y+15 ; 0x0f 3474c: 98 89 ldd r25, Y+16 ; 0x10 3474e: c9 88 ldd r12, Y+17 ; 0x11 34750: da 88 ldd r13, Y+18 ; 0x12 34752: eb 88 ldd r14, Y+19 ; 0x13 34754: fc 88 ldd r15, Y+20 ; 0x14 34756: 6c 19 sub r22, r12 34758: 7d 09 sbc r23, r13 3475a: 8e 09 sbc r24, r14 3475c: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 3475e: cd 80 ldd r12, Y+5 ; 0x05 34760: de 80 ldd r13, Y+6 ; 0x06 34762: ef 80 ldd r14, Y+7 ; 0x07 34764: f8 84 ldd r15, Y+8 ; 0x08 34766: cd 28 or r12, r13 34768: ce 28 or r12, r14 3476a: cf 28 or r12, r15 3476c: 41 f0 breq .+16 ; 0x3477e decelerate_steps += acceleration_x2; 3476e: c9 84 ldd r12, Y+9 ; 0x09 34770: da 84 ldd r13, Y+10 ; 0x0a 34772: eb 84 ldd r14, Y+11 ; 0x0b 34774: fc 84 ldd r15, Y+12 ; 0x0c 34776: 6c 0d add r22, r12 34778: 7d 1d adc r23, r13 3477a: 8e 1d adc r24, r14 3477c: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 3477e: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 34782: 82 0e add r8, r18 34784: 93 1e adc r9, r19 34786: a4 1e adc r10, r20 34788: b5 1e adc r11, r21 3478a: 49 80 ldd r4, Y+1 ; 0x01 3478c: 5a 80 ldd r5, Y+2 ; 0x02 3478e: 6b 80 ldd r6, Y+3 ; 0x03 34790: 7c 80 ldd r7, Y+4 ; 0x04 34792: 84 14 cp r8, r4 34794: 95 04 cpc r9, r5 34796: a6 04 cpc r10, r6 34798: b7 04 cpc r11, r7 3479a: 10 f4 brcc .+4 ; 0x347a0 3479c: 24 01 movw r4, r8 3479e: 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; 347a0: c9 80 ldd r12, Y+1 ; 0x01 347a2: da 80 ldd r13, Y+2 ; 0x02 347a4: eb 80 ldd r14, Y+3 ; 0x03 347a6: fc 80 ldd r15, Y+4 ; 0x04 347a8: c4 18 sub r12, r4 347aa: d5 08 sbc r13, r5 347ac: e6 08 sbc r14, r6 347ae: f7 08 sbc r15, r7 347b0: 93 cf rjmp .-218 ; 0x346d8 // 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; 347b2: 40 e0 ldi r20, 0x00 ; 0 347b4: 80 e0 ldi r24, 0x00 ; 0 347b6: c3 cf rjmp .-122 ; 0x3473e #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; 347b8: 4d 89 ldd r20, Y+21 ; 0x15 347ba: 8e 89 ldd r24, Y+22 ; 0x16 347bc: c0 cf rjmp .-128 ; 0x3473e 000347be : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 347be: 0f 94 67 a1 call 0x342ce ; 0x342ce 347c2: 80 32 cpi r24, 0x20 ; 32 347c4: 29 f0 breq .+10 ; 0x347d0 putch(STK_FAILED); 347c6: 81 e1 ldi r24, 0x11 ; 17 347c8: 0f 94 60 a1 call 0x342c0 ; 0x342c0 softReset(); 347cc: 0e 94 f9 67 call 0xcff2 ; 0xcff2 } putch(STK_INSYNC); 347d0: 84 e1 ldi r24, 0x14 ; 20 347d2: 0d 94 60 a1 jmp 0x342c0 ; 0x342c0 000347d6 : } static void getNch(uint8_t count) { 347d6: cf 93 push r28 347d8: c8 2f mov r28, r24 do getch(); while (--count); 347da: 0f 94 67 a1 call 0x342ce ; 0x342ce 347de: c1 50 subi r28, 0x01 ; 1 347e0: e1 f7 brne .-8 ; 0x347da verifySpace(); } 347e2: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 347e4: 0d 94 df a3 jmp 0x347be ; 0x347be 000347e8 : /// @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) { 347e8: 0f 93 push r16 347ea: 1f 93 push r17 347ec: cf 93 push r28 347ee: df 93 push r29 347f0: eb 01 movw r28, r22 347f2: 14 2f mov r17, r20 347f4: 05 2f mov r16, r21 lcd_putc(chr); 347f6: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_puts_P(str); 347fa: ce 01 movw r24, r28 347fc: 0e 94 78 6f call 0xdef0 ; 0xdef0 lcd_putc(':'); 34800: 8a e3 ldi r24, 0x3A ; 58 34802: 0e 94 7c 6f call 0xdef8 ; 0xdef8 34806: ce 01 movw r24, r28 34808: 0f 94 47 db call 0x3b68e ; 0x3b68e <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 3480c: 9e e0 ldi r25, 0x0E ; 14 3480e: 98 1b sub r25, r24 34810: 89 2f mov r24, r25 34812: 0e 94 83 6f call 0xdf06 ; 0xdf06 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 34816: 0f 93 push r16 34818: 1f 93 push r17 3481a: 8f ef ldi r24, 0xFF ; 255 3481c: 99 ea ldi r25, 0xA9 ; 169 3481e: 9f 93 push r25 34820: 8f 93 push r24 34822: 0e 94 66 6f call 0xdecc ; 0xdecc 34826: 0f 90 pop r0 34828: 0f 90 pop r0 3482a: 0f 90 pop r0 3482c: 0f 90 pop r0 } 3482e: df 91 pop r29 34830: cf 91 pop r28 34832: 1f 91 pop r17 34834: 0f 91 pop r16 34836: 08 95 ret 00034838 : * \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) { 34838: 0f 93 push r16 3483a: 1f 93 push r17 3483c: cf 93 push r28 3483e: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 34840: fc 01 movw r30, r24 34842: 23 81 ldd r18, Z+3 ; 0x03 34844: 22 23 and r18, r18 34846: 31 f0 breq .+12 ; 0x34854 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 34848: 80 e0 ldi r24, 0x00 ; 0 } 3484a: df 91 pop r29 3484c: cf 91 pop r28 3484e: 1f 91 pop r17 34850: 0f 91 pop r16 34852: 08 95 ret 34854: 8b 01 movw r16, r22 34856: ec 01 movw r28, r24 34858: fb 01 movw r30, r22 3485a: 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)) { 3485c: 80 31 cpi r24, 0x10 ; 16 3485e: 39 f5 brne .+78 ; 0x348ae type_ = FAT_FILE_TYPE_ROOT_FIXED; 34860: 82 e0 ldi r24, 0x02 ; 2 34862: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 34864: 1d 8a std Y+21, r1 ; 0x15 34866: 1e 8a std Y+22, r1 ; 0x16 34868: 1f 8a std Y+23, r1 ; 0x17 3486a: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 3486c: 80 8d ldd r24, Z+24 ; 0x18 3486e: 91 8d ldd r25, Z+25 ; 0x19 34870: b0 e0 ldi r27, 0x00 ; 0 34872: a0 e0 ldi r26, 0x00 ; 0 34874: 25 e0 ldi r18, 0x05 ; 5 34876: 88 0f add r24, r24 34878: 99 1f adc r25, r25 3487a: aa 1f adc r26, r26 3487c: bb 1f adc r27, r27 3487e: 2a 95 dec r18 34880: d1 f7 brne .-12 ; 0x34876 34882: 89 8b std Y+17, r24 ; 0x11 34884: 9a 8b std Y+18, r25 ; 0x12 34886: ab 8b std Y+19, r26 ; 0x13 34888: 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; 3488a: 1a 8f std Y+26, r17 ; 0x1a 3488c: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 3488e: 81 e0 ldi r24, 0x01 ; 1 34890: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 34892: 1c 82 std Y+4, r1 ; 0x04 34894: 1d 82 std Y+5, r1 ; 0x05 34896: 1e 82 std Y+6, r1 ; 0x06 34898: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 3489a: 18 86 std Y+8, r1 ; 0x08 3489c: 19 86 std Y+9, r1 ; 0x09 3489e: 1a 86 std Y+10, r1 ; 0x0a 348a0: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 348a2: 1c 86 std Y+12, r1 ; 0x0c 348a4: 1d 86 std Y+13, r1 ; 0x0d 348a6: 1e 86 std Y+14, r1 ; 0x0e 348a8: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 348aa: 18 8a std Y+16, r1 ; 0x10 348ac: ce cf rjmp .-100 ; 0x3484a 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) { 348ae: 80 32 cpi r24, 0x20 ; 32 348b0: 59 f6 brne .-106 ; 0x34848 type_ = FAT_FILE_TYPE_ROOT32; 348b2: 83 e0 ldi r24, 0x03 ; 3 348b4: 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_;} 348b6: 42 8d ldd r20, Z+26 ; 0x1a 348b8: 53 8d ldd r21, Z+27 ; 0x1b 348ba: 64 8d ldd r22, Z+28 ; 0x1c 348bc: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 348be: 4d 8b std Y+21, r20 ; 0x15 348c0: 5e 8b std Y+22, r21 ; 0x16 348c2: 6f 8b std Y+23, r22 ; 0x17 348c4: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 348c6: 9e 01 movw r18, r28 348c8: 2f 5e subi r18, 0xEF ; 239 348ca: 3f 4f sbci r19, 0xFF ; 255 348cc: c8 01 movw r24, r16 348ce: 0f 94 29 6d call 0x2da52 ; 0x2da52 348d2: 81 11 cpse r24, r1 348d4: da cf rjmp .-76 ; 0x3488a 348d6: b8 cf rjmp .-144 ; 0x34848 000348d8 : * * \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() { 348d8: cf 93 push r28 348da: df 93 push r29 348dc: ec 01 movw r28, r24 bool rtn = sync(); 348de: 0f 94 74 6e call 0x2dce8 ; 0x2dce8 type_ = FAT_FILE_TYPE_CLOSED; 348e2: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 348e4: df 91 pop r29 348e6: cf 91 pop r28 348e8: 08 95 ret 000348ea : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 348ea: cf 93 push r28 348ec: df 93 push r29 348ee: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 348f0: 46 2f mov r20, r22 348f2: 41 70 andi r20, 0x01 ; 1 348f4: 6c 85 ldd r22, Y+12 ; 0x0c 348f6: 7d 85 ldd r23, Y+13 ; 0x0d 348f8: 8e 85 ldd r24, Y+14 ; 0x0e 348fa: 9f 85 ldd r25, Y+15 ; 0x0f 348fc: 0f 94 d7 6b call 0x2d7ae ; 0x2d7ae 34900: 88 23 and r24, r24 34902: 51 f0 breq .+20 ; 0x34918 return vol_->cache()->dir + dirIndex_; 34904: 88 89 ldd r24, Y+16 ; 0x10 34906: 20 e2 ldi r18, 0x20 ; 32 34908: 82 9f mul r24, r18 3490a: c0 01 movw r24, r0 3490c: 11 24 eor r1, r1 3490e: 87 58 subi r24, 0x87 ; 135 34910: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 34912: df 91 pop r29 34914: cf 91 pop r28 34916: 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; 34918: 90 e0 ldi r25, 0x00 ; 0 3491a: 80 e0 ldi r24, 0x00 ; 0 3491c: fa cf rjmp .-12 ; 0x34912 0003491e : * \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) { 3491e: cf 93 push r28 34920: df 93 push r29 34922: eb 01 movw r28, r22 34924: fc 01 movw r30, r24 34926: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 34928: 21 11 cpse r18, r1 3492a: 04 c0 rjmp .+8 ; 0x34934 3492c: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 3492e: df 91 pop r29 34930: cf 91 pop r28 34932: 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; 34934: 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()) { 34936: 22 30 cpi r18, 0x02 ; 2 34938: 28 f4 brcc .+10 ; 0x34944 name[0] = '/'; 3493a: 8f e2 ldi r24, 0x2F ; 47 3493c: 88 83 st Y, r24 name[1] = '\0'; 3493e: 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; 34940: 81 e0 ldi r24, 0x01 ; 1 34942: f5 cf rjmp .-22 ; 0x3492e name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 34944: 60 e0 ldi r22, 0x00 ; 0 34946: 0f 94 75 a4 call 0x348ea ; 0x348ea if (!p) return false; 3494a: 00 97 sbiw r24, 0x00 ; 0 3494c: 79 f3 breq .-34 ; 0x3492c 3494e: 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; 34950: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 34952: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 34954: 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; 34956: 2d 91 ld r18, X+ 34958: 20 32 cpi r18, 0x20 ; 32 3495a: 99 f0 breq .+38 ; 0x34982 if (i == 8) name[j++] = '.'; 3495c: 88 30 cpi r24, 0x08 ; 8 3495e: 31 f4 brne .+12 ; 0x3496c 34960: 9e 01 movw r18, r28 34962: 26 0f add r18, r22 34964: 31 1d adc r19, r1 34966: f9 01 movw r30, r18 34968: 90 83 st Z, r25 3496a: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 3496c: 9e 01 movw r18, r28 3496e: 26 0f add r18, r22 34970: 31 1d adc r19, r1 34972: ad 01 movw r20, r26 34974: 41 50 subi r20, 0x01 ; 1 34976: 51 09 sbc r21, r1 34978: fa 01 movw r30, r20 3497a: 40 81 ld r20, Z 3497c: f9 01 movw r30, r18 3497e: 40 83 st Z, r20 34980: 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++) { 34982: 8f 5f subi r24, 0xFF ; 255 34984: 8b 30 cpi r24, 0x0B ; 11 34986: 39 f7 brne .-50 ; 0x34956 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 34988: fe 01 movw r30, r28 3498a: e6 0f add r30, r22 3498c: f1 1d adc r31, r1 3498e: 10 82 st Z, r1 34990: d7 cf rjmp .-82 ; 0x34940 00034992 : 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() { 34992: 3f 92 push r3 34994: 4f 92 push r4 34996: 5f 92 push r5 34998: 6f 92 push r6 3499a: 7f 92 push r7 3499c: 8f 92 push r8 3499e: 9f 92 push r9 349a0: af 92 push r10 349a2: bf 92 push r11 349a4: cf 92 push r12 349a6: df 92 push r13 349a8: ef 92 push r14 349aa: ff 92 push r15 349ac: 0f 93 push r16 349ae: 1f 93 push r17 349b0: cf 93 push r28 349b2: df 93 push r29 349b4: cd b7 in r28, 0x3d ; 61 349b6: de b7 in r29, 0x3e ; 62 349b8: 2c 97 sbiw r28, 0x0c ; 12 349ba: 0f b6 in r0, 0x3f ; 63 349bc: f8 94 cli 349be: de bf out 0x3e, r29 ; 62 349c0: 0f be out 0x3f, r0 ; 63 349c2: cd bf out 0x3d, r28 ; 61 349c4: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 349c6: dc 01 movw r26, r24 349c8: 59 96 adiw r26, 0x19 ; 25 349ca: 8d 90 ld r8, X+ 349cc: 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; 349ce: f4 01 movw r30, r8 349d0: 81 85 ldd r24, Z+9 ; 0x09 349d2: 92 85 ldd r25, Z+10 ; 0x0a 349d4: a3 85 ldd r26, Z+11 ; 0x0b 349d6: b4 85 ldd r27, Z+12 ; 0x0c 349d8: 9c 01 movw r18, r24 349da: ad 01 movw r20, r26 349dc: 2f 5f subi r18, 0xFF ; 255 349de: 3f 4f sbci r19, 0xFF ; 255 349e0: 4f 4f sbci r20, 0xFF ; 255 349e2: 5f 4f sbci r21, 0xFF ; 255 349e4: 29 87 std Y+9, r18 ; 0x09 349e6: 3a 87 std Y+10, r19 ; 0x0a 349e8: 4b 87 std Y+11, r20 ; 0x0b 349ea: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 349ec: d5 01 movw r26, r10 349ee: 14 96 adiw r26, 0x04 ; 4 349f0: 4d 90 ld r4, X+ 349f2: 5d 90 ld r5, X+ 349f4: 6d 90 ld r6, X+ 349f6: 7c 90 ld r7, X 349f8: 17 97 sbiw r26, 0x07 ; 7 349fa: 41 14 cp r4, r1 349fc: 51 04 cpc r5, r1 349fe: 61 04 cpc r6, r1 34a00: 71 04 cpc r7, r1 34a02: 09 f4 brne .+2 ; 0x34a06 34a04: 59 c0 rjmp .+178 ; 0x34ab8 // try to make file contiguous bgnCluster = *curCluster + 1; 34a06: bf ef ldi r27, 0xFF ; 255 34a08: 4b 1a sub r4, r27 34a0a: 5b 0a sbc r5, r27 34a0c: 6b 0a sbc r6, r27 34a0e: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 34a10: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 34a12: 73 01 movw r14, r6 34a14: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 34a16: 1d 82 std Y+5, r1 ; 0x05 34a18: 1e 82 std Y+6, r1 ; 0x06 34a1a: 1f 82 std Y+7, r1 ; 0x07 34a1c: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 34a1e: f4 01 movw r30, r8 34a20: 81 85 ldd r24, Z+9 ; 0x09 34a22: 92 85 ldd r25, Z+10 ; 0x0a 34a24: a3 85 ldd r26, Z+11 ; 0x0b 34a26: b4 85 ldd r27, Z+12 ; 0x0c 34a28: 2d 81 ldd r18, Y+5 ; 0x05 34a2a: 3e 81 ldd r19, Y+6 ; 0x06 34a2c: 4f 81 ldd r20, Y+7 ; 0x07 34a2e: 58 85 ldd r21, Y+8 ; 0x08 34a30: 28 17 cp r18, r24 34a32: 39 07 cpc r19, r25 34a34: 4a 07 cpc r20, r26 34a36: 5b 07 cpc r21, r27 34a38: 08 f0 brcs .+2 ; 0x34a3c 34a3a: 56 c0 rjmp .+172 ; 0x34ae8 // past end - start from beginning of FAT if (endCluster > fatEnd) { 34a3c: 89 85 ldd r24, Y+9 ; 0x09 34a3e: 9a 85 ldd r25, Y+10 ; 0x0a 34a40: ab 85 ldd r26, Y+11 ; 0x0b 34a42: bc 85 ldd r27, Y+12 ; 0x0c 34a44: 8c 15 cp r24, r12 34a46: 9d 05 cpc r25, r13 34a48: ae 05 cpc r26, r14 34a4a: bf 05 cpc r27, r15 34a4c: 50 f4 brcc .+20 ; 0x34a62 bgnCluster = endCluster = 2; 34a4e: 82 e0 ldi r24, 0x02 ; 2 34a50: c8 2e mov r12, r24 34a52: d1 2c mov r13, r1 34a54: e1 2c mov r14, r1 34a56: f1 2c mov r15, r1 34a58: 92 e0 ldi r25, 0x02 ; 2 34a5a: 49 2e mov r4, r25 34a5c: 51 2c mov r5, r1 34a5e: 61 2c mov r6, r1 34a60: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 34a62: 9e 01 movw r18, r28 34a64: 2f 5f subi r18, 0xFF ; 255 34a66: 3f 4f sbci r19, 0xFF ; 255 34a68: b7 01 movw r22, r14 34a6a: a6 01 movw r20, r12 34a6c: c4 01 movw r24, r8 34a6e: 0f 94 a6 6c call 0x2d94c ; 0x2d94c 34a72: 88 23 and r24, r24 34a74: c9 f1 breq .+114 ; 0x34ae8 if (f != 0) { 34a76: 89 81 ldd r24, Y+1 ; 0x01 34a78: 9a 81 ldd r25, Y+2 ; 0x02 34a7a: ab 81 ldd r26, Y+3 ; 0x03 34a7c: bc 81 ldd r27, Y+4 ; 0x04 34a7e: 89 2b or r24, r25 34a80: 8a 2b or r24, r26 34a82: 8b 2b or r24, r27 34a84: 01 f1 breq .+64 ; 0x34ac6 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 34a86: 26 01 movw r4, r12 34a88: 37 01 movw r6, r14 34a8a: 9f ef ldi r25, 0xFF ; 255 34a8c: 49 1a sub r4, r25 34a8e: 59 0a sbc r5, r25 34a90: 69 0a sbc r6, r25 34a92: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 34a94: 2d 81 ldd r18, Y+5 ; 0x05 34a96: 3e 81 ldd r19, Y+6 ; 0x06 34a98: 4f 81 ldd r20, Y+7 ; 0x07 34a9a: 58 85 ldd r21, Y+8 ; 0x08 34a9c: 2f 5f subi r18, 0xFF ; 255 34a9e: 3f 4f sbci r19, 0xFF ; 255 34aa0: 4f 4f sbci r20, 0xFF ; 255 34aa2: 5f 4f sbci r21, 0xFF ; 255 34aa4: 2d 83 std Y+5, r18 ; 0x05 34aa6: 3e 83 std Y+6, r19 ; 0x06 34aa8: 4f 83 std Y+7, r20 ; 0x07 34aaa: 58 87 std Y+8, r21 ; 0x08 34aac: 3f ef ldi r19, 0xFF ; 255 34aae: c3 1a sub r12, r19 34ab0: d3 0a sbc r13, r19 34ab2: e3 0a sbc r14, r19 34ab4: f3 0a sbc r15, r19 34ab6: b3 cf rjmp .-154 ; 0x34a1e // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 34ab8: 40 80 ld r4, Z 34aba: 51 80 ldd r5, Z+1 ; 0x01 34abc: 62 80 ldd r6, Z+2 ; 0x02 34abe: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 34ac0: 33 24 eor r3, r3 34ac2: 33 94 inc r3 34ac4: a6 cf rjmp .-180 ; 0x34a12 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) { 34ac6: c4 14 cp r12, r4 34ac8: d5 04 cpc r13, r5 34aca: e6 04 cpc r14, r6 34acc: f7 04 cpc r15, r7 34ace: 11 f7 brne .-60 ; 0x34a94 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); 34ad0: 0f ef ldi r16, 0xFF ; 255 34ad2: 1f ef ldi r17, 0xFF ; 255 34ad4: 2f ef ldi r18, 0xFF ; 255 34ad6: 3f e0 ldi r19, 0x0F ; 15 34ad8: b7 01 movw r22, r14 34ada: a6 01 movw r20, r12 34adc: c4 01 movw r24, r8 34ade: 0f 94 14 6c call 0x2d828 ; 0x2d828 34ae2: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 34ae4: 81 11 cpse r24, r1 34ae6: 1a c0 rjmp .+52 ; 0x34b1c flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 34ae8: 71 2c mov r7, r1 } 34aea: 87 2d mov r24, r7 34aec: 2c 96 adiw r28, 0x0c ; 12 34aee: 0f b6 in r0, 0x3f ; 63 34af0: f8 94 cli 34af2: de bf out 0x3e, r29 ; 62 34af4: 0f be out 0x3f, r0 ; 63 34af6: cd bf out 0x3d, r28 ; 61 34af8: df 91 pop r29 34afa: cf 91 pop r28 34afc: 1f 91 pop r17 34afe: 0f 91 pop r16 34b00: ff 90 pop r15 34b02: ef 90 pop r14 34b04: df 90 pop r13 34b06: cf 90 pop r12 34b08: bf 90 pop r11 34b0a: af 90 pop r10 34b0c: 9f 90 pop r9 34b0e: 8f 90 pop r8 34b10: 7f 90 pop r7 34b12: 6f 90 pop r6 34b14: 5f 90 pop r5 34b16: 4f 90 pop r4 34b18: 3f 90 pop r3 34b1a: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 34b1c: f5 01 movw r30, r10 34b1e: 44 81 ldd r20, Z+4 ; 0x04 34b20: 55 81 ldd r21, Z+5 ; 0x05 34b22: 66 81 ldd r22, Z+6 ; 0x06 34b24: 77 81 ldd r23, Z+7 ; 0x07 34b26: 41 15 cp r20, r1 34b28: 51 05 cpc r21, r1 34b2a: 61 05 cpc r22, r1 34b2c: 71 05 cpc r23, r1 34b2e: 39 f0 breq .+14 ; 0x34b3e // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 34b30: 97 01 movw r18, r14 34b32: 86 01 movw r16, r12 34b34: c4 01 movw r24, r8 34b36: 0f 94 14 6c call 0x2d828 ; 0x2d828 34b3a: 88 23 and r24, r24 34b3c: a9 f2 breq .-86 ; 0x34ae8 } // return first cluster number to caller *curCluster = bgnCluster; 34b3e: d5 01 movw r26, r10 34b40: 14 96 adiw r26, 0x04 ; 4 34b42: cd 92 st X+, r12 34b44: dd 92 st X+, r13 34b46: ed 92 st X+, r14 34b48: fc 92 st X, r15 34b4a: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 34b4c: 33 20 and r3, r3 34b4e: 51 f0 breq .+20 ; 0x34b64 34b50: d7 01 movw r26, r14 34b52: c6 01 movw r24, r12 34b54: 01 96 adiw r24, 0x01 ; 1 34b56: a1 1d adc r26, r1 34b58: b1 1d adc r27, r1 34b5a: f4 01 movw r30, r8 34b5c: 80 83 st Z, r24 34b5e: 91 83 std Z+1, r25 ; 0x01 34b60: a2 83 std Z+2, r26 ; 0x02 34b62: 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) { 34b64: f5 01 movw r30, r10 34b66: 85 89 ldd r24, Z+21 ; 0x15 34b68: 96 89 ldd r25, Z+22 ; 0x16 34b6a: a7 89 ldd r26, Z+23 ; 0x17 34b6c: b0 8d ldd r27, Z+24 ; 0x18 34b6e: 89 2b or r24, r25 34b70: 8a 2b or r24, r26 34b72: 8b 2b or r24, r27 34b74: 09 f0 breq .+2 ; 0x34b78 34b76: b9 cf rjmp .-142 ; 0x34aea firstCluster_ = curCluster_; 34b78: c5 8a std Z+21, r12 ; 0x15 34b7a: d6 8a std Z+22, r13 ; 0x16 34b7c: e7 8a std Z+23, r14 ; 0x17 34b7e: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 34b80: 81 81 ldd r24, Z+1 ; 0x01 34b82: 80 68 ori r24, 0x80 ; 128 34b84: 81 83 std Z+1, r24 ; 0x01 34b86: b1 cf rjmp .-158 ; 0x34aea 00034b88 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 34b88: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34b8a: 0d b4 in r0, 0x2d ; 45 34b8c: 07 fe sbrs r0, 7 34b8e: fd cf rjmp .-6 ; 0x34b8a } 34b90: 08 95 ret 00034b92 : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 34b92: 8f ef ldi r24, 0xFF ; 255 34b94: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34b96: 0d b4 in r0, 0x2d ; 45 34b98: 07 fe sbrs r0, 7 34b9a: fd cf rjmp .-6 ; 0x34b96 return SPDR; 34b9c: 8e b5 in r24, 0x2e ; 46 } 34b9e: 08 95 ret 00034ba0 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 34ba0: 8f 92 push r8 34ba2: 9f 92 push r9 34ba4: af 92 push r10 34ba6: bf 92 push r11 34ba8: ef 92 push r14 34baa: ff 92 push r15 34bac: 0f 93 push r16 34bae: 1f 93 push r17 34bb0: cf 93 push r28 34bb2: 7c 01 movw r14, r24 34bb4: c6 2f mov r28, r22 34bb6: 49 01 movw r8, r18 34bb8: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 34bba: fc 01 movw r30, r24 34bbc: 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); 34bbe: 89 2f mov r24, r25 34bc0: 80 6a ori r24, 0xA0 ; 160 34bc2: 86 95 lsr r24 34bc4: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 34bc6: 90 fd sbrc r25, 0 34bc8: 03 c0 rjmp .+6 ; 0x34bd0 34bca: 81 e0 ldi r24, 0x01 ; 1 34bcc: 96 30 cpi r25, 0x06 ; 6 34bce: 09 f4 brne .+2 ; 0x34bd2 34bd0: 80 e0 ldi r24, 0x00 ; 0 34bd2: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 34bd4: 9f b7 in r25, 0x3f ; 63 34bd6: f8 94 cli 34bd8: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34bdc: 8f 7b andi r24, 0xBF ; 191 34bde: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34be2: 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); 34be4: 8c e2 ldi r24, 0x2C ; 44 34be6: 91 e0 ldi r25, 0x01 ; 1 34be8: 0f 94 e4 76 call 0x2edc8 ; 0x2edc8 // send command spiSend(cmd | 0x40); 34bec: 8c 2f mov r24, r28 34bee: 80 64 ori r24, 0x40 ; 64 34bf0: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 34bf4: 08 e1 ldi r16, 0x18 ; 24 34bf6: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 34bf8: d5 01 movw r26, r10 34bfa: c4 01 movw r24, r8 34bfc: 00 2e mov r0, r16 34bfe: 04 c0 rjmp .+8 ; 0x34c08 34c00: b6 95 lsr r27 34c02: a7 95 ror r26 34c04: 97 95 ror r25 34c06: 87 95 ror r24 34c08: 0a 94 dec r0 34c0a: d2 f7 brpl .-12 ; 0x34c00 34c0c: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 34c10: 08 50 subi r16, 0x08 ; 8 34c12: 11 09 sbc r17, r1 34c14: 08 3f cpi r16, 0xF8 ; 248 34c16: ff ef ldi r31, 0xFF ; 255 34c18: 1f 07 cpc r17, r31 34c1a: 71 f7 brne .-36 ; 0x34bf8 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 34c1c: 85 e9 ldi r24, 0x95 ; 149 34c1e: cc 23 and r28, r28 34c20: 21 f0 breq .+8 ; 0x34c2a if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 34c22: 87 e8 ldi r24, 0x87 ; 135 34c24: c8 30 cpi r28, 0x08 ; 8 34c26: 09 f0 breq .+2 ; 0x34c2a // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34c28: 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); 34c2a: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 34c2e: cc 30 cpi r28, 0x0C ; 12 34c30: 11 f4 brne .+4 ; 0x34c36 34c32: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34c36: 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 */ } 34c38: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 34c3c: f7 01 movw r30, r14 34c3e: 82 83 std Z+2, r24 ; 0x02 34c40: 87 ff sbrs r24, 7 34c42: 04 c0 rjmp .+8 ; 0x34c4c 34c44: cf 3f cpi r28, 0xFF ; 255 34c46: 11 f0 breq .+4 ; 0x34c4c 34c48: cf 5f subi r28, 0xFF ; 255 34c4a: f6 cf rjmp .-20 ; 0x34c38 return status_; } 34c4c: cf 91 pop r28 34c4e: 1f 91 pop r17 34c50: 0f 91 pop r16 34c52: ff 90 pop r15 34c54: ef 90 pop r14 34c56: bf 90 pop r11 34c58: af 90 pop r10 34c5a: 9f 90 pop r9 34c5c: 8f 90 pop r8 34c5e: 08 95 ret 00034c60 : * \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) { 34c60: 0f 93 push r16 34c62: 1f 93 push r17 34c64: cf 93 push r28 34c66: df 93 push r29 34c68: ec 01 movw r28, r24 34c6a: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 34c6c: 8b 81 ldd r24, Y+3 ; 0x03 34c6e: 83 30 cpi r24, 0x03 ; 3 34c70: 39 f0 breq .+14 ; 0x34c80 34c72: 89 e0 ldi r24, 0x09 ; 9 34c74: 44 0f add r20, r20 34c76: 55 1f adc r21, r21 34c78: 66 1f adc r22, r22 34c7a: 77 1f adc r23, r23 34c7c: 8a 95 dec r24 34c7e: d1 f7 brne .-12 ; 0x34c74 if (cardCommand(CMD24, blockNumber)) { 34c80: 9a 01 movw r18, r20 34c82: ab 01 movw r20, r22 34c84: 68 e1 ldi r22, 0x18 ; 24 34c86: ce 01 movw r24, r28 34c88: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 34c8c: 88 23 and r24, r24 34c8e: 19 f0 breq .+6 ; 0x34c96 34c90: 86 e0 ldi r24, 0x06 ; 6 34c92: 88 83 st Y, r24 34c94: 39 c0 rjmp .+114 ; 0x34d08 } //------------------------------------------------------------------------------ /** 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; 34c96: 8e ef ldi r24, 0xFE ; 254 34c98: 8e bd out 0x2e, r24 ; 46 34c9a: f8 01 movw r30, r16 34c9c: c8 01 movw r24, r16 34c9e: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34ca0: 0d b4 in r0, 0x2d ; 45 34ca2: 07 fe sbrs r0, 7 34ca4: fd cf rjmp .-6 ; 0x34ca0 SPDR = buf[i]; 34ca6: 20 81 ld r18, Z 34ca8: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34caa: 0d b4 in r0, 0x2d ; 45 34cac: 07 fe sbrs r0, 7 34cae: fd cf rjmp .-6 ; 0x34caa SPDR = buf[i + 1]; 34cb0: 21 81 ldd r18, Z+1 ; 0x01 34cb2: 2e bd out 0x2e, r18 ; 46 34cb4: 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) { 34cb6: e8 17 cp r30, r24 34cb8: f9 07 cpc r31, r25 34cba: 91 f7 brne .-28 ; 0x34ca0 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 */ } 34cbc: 0d b4 in r0, 0x2d ; 45 34cbe: 07 fe sbrs r0, 7 34cc0: fd cf rjmp .-6 ; 0x34cbc //------------------------------------------------------------------------------ // 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 34cc2: 8f ef ldi r24, 0xFF ; 255 34cc4: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 spiSend(0xff); // dummy crc 34cc8: 8f ef ldi r24, 0xFF ; 255 34cca: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 status_ = spiRec(); 34cce: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 34cd2: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 34cd4: 8f 71 andi r24, 0x1F ; 31 34cd6: 85 30 cpi r24, 0x05 ; 5 34cd8: 99 f4 brne .+38 ; 0x34d00 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 34cda: 88 e5 ldi r24, 0x58 ; 88 34cdc: 92 e0 ldi r25, 0x02 ; 2 34cde: 0f 94 e4 76 call 0x2edc8 ; 0x2edc8 34ce2: 18 2f mov r17, r24 34ce4: 87 e1 ldi r24, 0x17 ; 23 34ce6: 11 23 and r17, r17 34ce8: a1 f2 breq .-88 ; 0x34c92 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 34cea: 20 e0 ldi r18, 0x00 ; 0 34cec: 30 e0 ldi r19, 0x00 ; 0 34cee: a9 01 movw r20, r18 34cf0: 6d e0 ldi r22, 0x0D ; 13 34cf2: ce 01 movw r24, r28 34cf4: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 34cf8: 88 23 and r24, r24 34cfa: 51 f0 breq .+20 ; 0x34d10 34cfc: 86 e1 ldi r24, 0x16 ; 22 34cfe: c9 cf rjmp .-110 ; 0x34c92 34d00: 83 e1 ldi r24, 0x13 ; 19 34d02: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 34d04: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 } chipSelectHigh(); return true; fail: chipSelectHigh(); 34d08: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 return false; 34d0c: 10 e0 ldi r17, 0x00 ; 0 34d0e: 06 c0 rjmp .+12 ; 0x34d1c 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()) { 34d10: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 34d14: 81 11 cpse r24, r1 34d16: f2 cf rjmp .-28 ; 0x34cfc error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 34d18: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 return true; fail: chipSelectHigh(); return false; } 34d1c: 81 2f mov r24, r17 34d1e: df 91 pop r29 34d20: cf 91 pop r28 34d22: 1f 91 pop r17 34d24: 0f 91 pop r16 34d26: 08 95 ret 00034d28 : * \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) { 34d28: 2f 92 push r2 34d2a: 3f 92 push r3 34d2c: 4f 92 push r4 34d2e: 5f 92 push r5 34d30: 6f 92 push r6 34d32: 7f 92 push r7 34d34: 8f 92 push r8 34d36: 9f 92 push r9 34d38: af 92 push r10 34d3a: bf 92 push r11 34d3c: cf 92 push r12 34d3e: df 92 push r13 34d40: ef 92 push r14 34d42: ff 92 push r15 34d44: 0f 93 push r16 34d46: 1f 93 push r17 34d48: cf 93 push r28 34d4a: df 93 push r29 34d4c: ec 01 movw r28, r24 34d4e: 2a 01 movw r4, r20 34d50: 3b 01 movw r6, r22 34d52: 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; 34d54: 8b 81 ldd r24, Y+3 ; 0x03 34d56: 83 30 cpi r24, 0x03 ; 3 34d58: 39 f0 breq .+14 ; 0x34d68 34d5a: 69 e0 ldi r22, 0x09 ; 9 34d5c: 44 0c add r4, r4 34d5e: 55 1c adc r5, r5 34d60: 66 1c adc r6, r6 34d62: 77 1c adc r7, r7 34d64: 6a 95 dec r22 34d66: d1 f7 brne .-12 ; 0x34d5c retry2: 34d68: 43 e0 ldi r20, 0x03 ; 3 34d6a: 94 2e mov r9, r20 34d6c: 56 01 movw r10, r12 34d6e: 81 e0 ldi r24, 0x01 ; 1 34d70: a8 1a sub r10, r24 34d72: 8e ef ldi r24, 0xFE ; 254 34d74: b8 0a sbc r11, r24 34d76: 16 01 movw r2, r12 34d78: ee ef ldi r30, 0xFE ; 254 34d7a: 3e 1a sub r3, r30 34d7c: 54 e0 ldi r21, 0x04 ; 4 34d7e: 85 2e mov r8, r21 retryCnt --; 34d80: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 34d82: a3 01 movw r20, r6 34d84: 92 01 movw r18, r4 34d86: 61 e1 ldi r22, 0x11 ; 17 34d88: ce 01 movw r24, r28 34d8a: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 34d8e: 88 23 and r24, r24 34d90: 79 f0 breq .+30 ; 0x34db0 34d92: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 34d94: 99 20 and r9, r9 34d96: 09 f4 brne .+2 ; 0x34d9a 34d98: 7a c0 rjmp .+244 ; 0x34e8e if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 34d9a: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 34d9e: 20 e0 ldi r18, 0x00 ; 0 34da0: 30 e0 ldi r19, 0x00 ; 0 34da2: a9 01 movw r20, r18 34da4: 6c e0 ldi r22, 0x0C ; 12 34da6: ce 01 movw r24, r28 34da8: 0f 94 d0 a5 call 0x34ba0 ; 0x34ba0 errorCode_ = 0; 34dac: 18 82 st Y, r1 34dae: e8 cf rjmp .-48 ; 0x34d80 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 34db0: 0f 94 83 3f call 0x27f06 ; 0x27f06 34db4: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 34db6: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 34dba: 8a 83 std Y+2, r24 ; 0x02 34dbc: 8f 3f cpi r24, 0xFF ; 255 34dbe: 91 f4 brne .+36 ; 0x34de4 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 34dc0: 0f 94 83 3f call 0x27f06 ; 0x27f06 34dc4: 60 1b sub r22, r16 34dc6: 71 0b sbc r23, r17 34dc8: 6d 32 cpi r22, 0x2D ; 45 34dca: 71 40 sbci r23, 0x01 ; 1 34dcc: a0 f3 brcs .-24 ; 0x34db6 34dce: 81 e1 ldi r24, 0x11 ; 17 34dd0: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 34dd2: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34dd6: 8c 81 ldd r24, Y+4 ; 0x04 34dd8: 88 23 and r24, r24 34dda: e1 f2 breq .-72 ; 0x34d94 spiSend(0XFF); 34ddc: 8f ef ldi r24, 0xFF ; 255 34dde: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 34de2: d8 cf rjmp .-80 ; 0x34d94 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 34de4: 8e 3f cpi r24, 0xFE ; 254 34de6: 11 f0 breq .+4 ; 0x34dec 34de8: 8f e0 ldi r24, 0x0F ; 15 34dea: f2 cf rjmp .-28 ; 0x34dd0 //------------------------------------------------------------------------------ /** 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; 34dec: 8f ef ldi r24, 0xFF ; 255 34dee: 8e bd out 0x2e, r24 ; 46 34df0: d6 01 movw r26, r12 34df2: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34df4: 0d b4 in r0, 0x2d ; 45 34df6: 07 fe sbrs r0, 7 34df8: fd cf rjmp .-6 ; 0x34df4 buf[i] = SPDR; 34dfa: 9e b5 in r25, 0x2e ; 46 34dfc: 91 93 st Z+, r25 SPDR = 0XFF; 34dfe: 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++) { 34e00: ea 15 cp r30, r10 34e02: fb 05 cpc r31, r11 34e04: b9 f7 brne .-18 ; 0x34df4 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34e06: 0d b4 in r0, 0x2d ; 45 34e08: 07 fe sbrs r0, 7 34e0a: fd cf rjmp .-6 ; 0x34e06 buf[nbyte] = SPDR; 34e0c: 8e b5 in r24, 0x2e ; 46 34e0e: f5 01 movw r30, r10 34e10: 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; 34e12: f1 2c mov r15, r1 34e14: 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); 34e16: 8d 91 ld r24, X+ 34e18: ef 2d mov r30, r15 34e1a: ff 27 eor r31, r31 34e1c: e8 27 eor r30, r24 34e1e: ee 0f add r30, r30 34e20: ff 1f adc r31, r31 34e22: e5 56 subi r30, 0x65 ; 101 34e24: f3 45 sbci r31, 0x53 ; 83 34e26: 85 91 lpm r24, Z+ 34e28: 94 91 lpm r25, Z 34e2a: fe 2c mov r15, r14 34e2c: ee 24 eor r14, r14 34e2e: e8 26 eor r14, r24 34e30: 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++) { 34e32: 2a 16 cp r2, r26 34e34: 3b 06 cpc r3, r27 34e36: 79 f7 brne .-34 ; 0x34e16 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 34e38: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 34e3c: 08 2f mov r16, r24 34e3e: 10 e0 ldi r17, 0x00 ; 0 34e40: 10 2f mov r17, r16 34e42: 00 27 eor r16, r16 recvCrc |= spiRec(); 34e44: 0f 94 c9 a5 call 0x34b92 ; 0x34b92 34e48: 08 2b or r16, r24 if (calcCrc != recvCrc) 34e4a: 0e 15 cp r16, r14 34e4c: 1f 05 cpc r17, r15 34e4e: 19 f0 breq .+6 ; 0x34e56 34e50: f0 e2 ldi r31, 0x20 ; 32 34e52: f8 83 st Y, r31 34e54: be cf rjmp .-132 ; 0x34dd2 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 34e56: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34e5a: cc 81 ldd r28, Y+4 ; 0x04 34e5c: cc 23 and r28, r28 34e5e: d9 f0 breq .+54 ; 0x34e96 spiSend(0XFF); 34e60: 8f ef ldi r24, 0xFF ; 255 34e62: 0f 94 c4 a5 call 0x34b88 ; 0x34b88 #endif fail: chipSelectHigh(); return false; } 34e66: 8c 2f mov r24, r28 34e68: df 91 pop r29 34e6a: cf 91 pop r28 34e6c: 1f 91 pop r17 34e6e: 0f 91 pop r16 34e70: ff 90 pop r15 34e72: ef 90 pop r14 34e74: df 90 pop r13 34e76: cf 90 pop r12 34e78: bf 90 pop r11 34e7a: af 90 pop r10 34e7c: 9f 90 pop r9 34e7e: 8f 90 pop r8 34e80: 7f 90 pop r7 34e82: 6f 90 pop r6 34e84: 5f 90 pop r5 34e86: 4f 90 pop r4 34e88: 3f 90 pop r3 34e8a: 2f 90 pop r2 34e8c: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 34e8e: 0f 94 db 76 call 0x2edb6 ; 0x2edb6 return false; 34e92: c0 e0 ldi r28, 0x00 ; 0 34e94: e8 cf rjmp .-48 ; 0x34e66 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 34e96: c1 e0 ldi r28, 0x01 ; 1 34e98: e6 cf rjmp .-52 ; 0x34e66 00034e9a : * 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) { 34e9a: 2f 92 push r2 34e9c: 3f 92 push r3 34e9e: 4f 92 push r4 34ea0: 5f 92 push r5 34ea2: 6f 92 push r6 34ea4: 7f 92 push r7 34ea6: 8f 92 push r8 34ea8: 9f 92 push r9 34eaa: af 92 push r10 34eac: bf 92 push r11 34eae: cf 92 push r12 34eb0: df 92 push r13 34eb2: ef 92 push r14 34eb4: ff 92 push r15 34eb6: 0f 93 push r16 34eb8: 1f 93 push r17 34eba: cf 93 push r28 34ebc: df 93 push r29 34ebe: 00 d0 rcall .+0 ; 0x34ec0 34ec0: 1f 92 push r1 34ec2: cd b7 in r28, 0x3d ; 61 34ec4: de b7 in r29, 0x3e ; 62 34ec6: 9c 83 std Y+4, r25 ; 0x04 34ec8: 8b 83 std Y+3, r24 ; 0x03 34eca: 4b 01 movw r8, r22 34ecc: 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; 34ece: dc 01 movw r26, r24 34ed0: 13 96 adiw r26, 0x03 ; 3 34ed2: 8c 91 ld r24, X 34ed4: 81 11 cpse r24, r1 34ed6: 19 c0 rjmp .+50 ; 0x34f0a toRead -= n; } return nbyte; fail: return -1; 34ed8: 8f ef ldi r24, 0xFF ; 255 34eda: 9f ef ldi r25, 0xFF ; 255 } 34edc: 0f 90 pop r0 34ede: 0f 90 pop r0 34ee0: 0f 90 pop r0 34ee2: 0f 90 pop r0 34ee4: df 91 pop r29 34ee6: cf 91 pop r28 34ee8: 1f 91 pop r17 34eea: 0f 91 pop r16 34eec: ff 90 pop r15 34eee: ef 90 pop r14 34ef0: df 90 pop r13 34ef2: cf 90 pop r12 34ef4: bf 90 pop r11 34ef6: af 90 pop r10 34ef8: 9f 90 pop r9 34efa: 8f 90 pop r8 34efc: 7f 90 pop r7 34efe: 6f 90 pop r6 34f00: 5f 90 pop r5 34f02: 4f 90 pop r4 34f04: 3f 90 pop r3 34f06: 2f 90 pop r2 34f08: 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; 34f0a: eb 81 ldd r30, Y+3 ; 0x03 34f0c: fc 81 ldd r31, Y+4 ; 0x04 34f0e: 81 81 ldd r24, Z+1 ; 0x01 34f10: 80 ff sbrs r24, 0 34f12: e2 cf rjmp .-60 ; 0x34ed8 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 34f14: 01 89 ldd r16, Z+17 ; 0x11 34f16: 12 89 ldd r17, Z+18 ; 0x12 34f18: 23 89 ldd r18, Z+19 ; 0x13 34f1a: 34 89 ldd r19, Z+20 ; 0x14 34f1c: 40 85 ldd r20, Z+8 ; 0x08 34f1e: 51 85 ldd r21, Z+9 ; 0x09 34f20: 62 85 ldd r22, Z+10 ; 0x0a 34f22: 73 85 ldd r23, Z+11 ; 0x0b 34f24: c7 01 movw r24, r14 34f26: b0 e0 ldi r27, 0x00 ; 0 34f28: a0 e0 ldi r26, 0x00 ; 0 34f2a: 28 01 movw r4, r16 34f2c: 39 01 movw r6, r18 34f2e: 44 1a sub r4, r20 34f30: 55 0a sbc r5, r21 34f32: 66 0a sbc r6, r22 34f34: 77 0a sbc r7, r23 34f36: 84 15 cp r24, r4 34f38: 95 05 cpc r25, r5 34f3a: a6 05 cpc r26, r6 34f3c: b7 05 cpc r27, r7 34f3e: 18 f0 brcs .+6 ; 0x34f46 nbyte = fileSize_ - curPosition_; 34f40: 78 01 movw r14, r16 34f42: e4 1a sub r14, r20 34f44: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 34f46: 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; 34f48: 8b 81 ldd r24, Y+3 ; 0x03 34f4a: 9c 81 ldd r25, Y+4 ; 0x04 34f4c: 04 96 adiw r24, 0x04 ; 4 34f4e: 9a 83 std Y+2, r25 ; 0x02 34f50: 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; 34f52: 61 2c mov r6, r1 34f54: 32 e0 ldi r19, 0x02 ; 2 34f56: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 34f58: c1 14 cp r12, r1 34f5a: d1 04 cpc r13, r1 34f5c: 09 f4 brne .+2 ; 0x34f60 34f5e: b7 c0 rjmp .+366 ; 0x350ce offset = curPosition_ & 0X1FF; // offset in block 34f60: ab 81 ldd r26, Y+3 ; 0x03 34f62: bc 81 ldd r27, Y+4 ; 0x04 34f64: 18 96 adiw r26, 0x08 ; 8 34f66: 4d 91 ld r20, X+ 34f68: 5d 91 ld r21, X+ 34f6a: 6d 91 ld r22, X+ 34f6c: 7c 91 ld r23, X 34f6e: 1b 97 sbiw r26, 0x0b ; 11 34f70: 5a 01 movw r10, r20 34f72: b1 e0 ldi r27, 0x01 ; 1 34f74: bb 22 and r11, r27 34f76: eb 81 ldd r30, Y+3 ; 0x03 34f78: fc 81 ldd r31, Y+4 ; 0x04 34f7a: 81 8d ldd r24, Z+25 ; 0x19 34f7c: 92 8d ldd r25, Z+26 ; 0x1a 34f7e: 1a 01 movw r2, r20 34f80: 2b 01 movw r4, r22 34f82: 29 e0 ldi r18, 0x09 ; 9 34f84: 56 94 lsr r5 34f86: 47 94 ror r4 34f88: 37 94 ror r3 34f8a: 27 94 ror r2 34f8c: 2a 95 dec r18 34f8e: d1 f7 brne .-12 ; 0x34f84 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 34f90: 23 81 ldd r18, Z+3 ; 0x03 34f92: 22 30 cpi r18, 0x02 ; 2 34f94: 91 f5 brne .+100 ; 0x34ffa block = vol_->rootDirStart() + (curPosition_ >> 9); 34f96: dc 01 movw r26, r24 34f98: 5a 96 adiw r26, 0x1a ; 26 34f9a: 6d 91 ld r22, X+ 34f9c: 7d 91 ld r23, X+ 34f9e: 8d 91 ld r24, X+ 34fa0: 9c 91 ld r25, X 34fa2: 5d 97 sbiw r26, 0x1d ; 29 34fa4: 62 0d add r22, r2 34fa6: 73 1d adc r23, r3 34fa8: 84 1d adc r24, r4 34faa: 95 1d adc r25, r5 34fac: 83 01 movw r16, r6 34fae: 0a 19 sub r16, r10 34fb0: 1b 09 sbc r17, r11 34fb2: c0 16 cp r12, r16 34fb4: d1 06 cpc r13, r17 34fb6: 08 f4 brcc .+2 ; 0x34fba 34fb8: 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()) { 34fba: 01 15 cp r16, r1 34fbc: b2 e0 ldi r27, 0x02 ; 2 34fbe: 1b 07 cpc r17, r27 34fc0: 71 f4 brne .+28 ; 0x34fde 34fc2: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 34fc6: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 34fca: 40 91 6f 0e lds r20, 0x0E6F ; 0x800e6f 34fce: 50 91 70 0e lds r21, 0x0E70 ; 0x800e70 34fd2: 62 17 cp r22, r18 34fd4: 73 07 cpc r23, r19 34fd6: 84 07 cpc r24, r20 34fd8: 95 07 cpc r25, r21 34fda: 09 f0 breq .+2 ; 0x34fde 34fdc: 59 c0 rjmp .+178 ; 0x35090 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; 34fde: 40 e0 ldi r20, 0x00 ; 0 34fe0: 0f 94 d7 6b call 0x2d7ae ; 0x2d7ae 34fe4: 88 23 and r24, r24 34fe6: 09 f4 brne .+2 ; 0x34fea 34fe8: 77 cf rjmp .-274 ; 0x34ed8 uint8_t* src = vol_->cache()->data + offset; 34fea: b5 01 movw r22, r10 34fec: 67 58 subi r22, 0x87 ; 135 34fee: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 34ff0: a8 01 movw r20, r16 34ff2: c4 01 movw r24, r8 34ff4: 0f 94 b2 e3 call 0x3c764 ; 0x3c764 34ff8: 57 c0 rjmp .+174 ; 0x350a8 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);} 34ffa: fc 01 movw r30, r24 34ffc: 14 81 ldd r17, Z+4 ; 0x04 34ffe: 11 50 subi r17, 0x01 ; 1 35000: 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) { 35002: a1 14 cp r10, r1 35004: b1 04 cpc r11, r1 35006: 81 f4 brne .+32 ; 0x35028 35008: 11 11 cpse r17, r1 3500a: 0e c0 rjmp .+28 ; 0x35028 // start of new cluster if (curPosition_ == 0) { 3500c: 45 2b or r20, r21 3500e: 46 2b or r20, r22 35010: 47 2b or r20, r23 35012: 79 f5 brne .+94 ; 0x35072 // use first cluster in file curCluster_ = firstCluster_; 35014: eb 81 ldd r30, Y+3 ; 0x03 35016: fc 81 ldd r31, Y+4 ; 0x04 35018: 85 89 ldd r24, Z+21 ; 0x15 3501a: 96 89 ldd r25, Z+22 ; 0x16 3501c: a7 89 ldd r26, Z+23 ; 0x17 3501e: b0 8d ldd r27, Z+24 ; 0x18 35020: 84 83 std Z+4, r24 ; 0x04 35022: 95 83 std Z+5, r25 ; 0x05 35024: a6 83 std Z+6, r26 ; 0x06 35026: 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; 35028: ab 81 ldd r26, Y+3 ; 0x03 3502a: bc 81 ldd r27, Y+4 ; 0x04 3502c: 59 96 adiw r26, 0x19 ; 25 3502e: ed 91 ld r30, X+ 35030: fc 91 ld r31, X 35032: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 35034: 14 96 adiw r26, 0x04 ; 4 35036: 6d 91 ld r22, X+ 35038: 7d 91 ld r23, X+ 3503a: 8d 91 ld r24, X+ 3503c: 9c 91 ld r25, X 3503e: 17 97 sbiw r26, 0x07 ; 7 35040: 62 50 subi r22, 0x02 ; 2 35042: 71 09 sbc r23, r1 35044: 81 09 sbc r24, r1 35046: 91 09 sbc r25, r1 35048: 25 85 ldd r18, Z+13 ; 0x0d 3504a: 04 c0 rjmp .+8 ; 0x35054 3504c: 66 0f add r22, r22 3504e: 77 1f adc r23, r23 35050: 88 1f adc r24, r24 35052: 99 1f adc r25, r25 35054: 2a 95 dec r18 35056: d2 f7 brpl .-12 ; 0x3504c 35058: 26 85 ldd r18, Z+14 ; 0x0e 3505a: 37 85 ldd r19, Z+15 ; 0x0f 3505c: 40 89 ldd r20, Z+16 ; 0x10 3505e: 51 89 ldd r21, Z+17 ; 0x11 35060: 62 0f add r22, r18 35062: 73 1f adc r23, r19 35064: 84 1f adc r24, r20 35066: 95 1f adc r25, r21 35068: 61 0f add r22, r17 3506a: 71 1d adc r23, r1 3506c: 81 1d adc r24, r1 3506e: 91 1d adc r25, r1 35070: 9d cf rjmp .-198 ; 0x34fac if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 35072: ab 81 ldd r26, Y+3 ; 0x03 35074: bc 81 ldd r27, Y+4 ; 0x04 35076: 14 96 adiw r26, 0x04 ; 4 35078: 4d 91 ld r20, X+ 3507a: 5d 91 ld r21, X+ 3507c: 6d 91 ld r22, X+ 3507e: 7c 91 ld r23, X 35080: 17 97 sbiw r26, 0x07 ; 7 35082: 29 81 ldd r18, Y+1 ; 0x01 35084: 3a 81 ldd r19, Y+2 ; 0x02 35086: 0f 94 a6 6c call 0x2d94c ; 0x2d94c 3508a: 81 11 cpse r24, r1 3508c: cd cf rjmp .-102 ; 0x35028 3508e: 24 cf rjmp .-440 ; 0x34ed8 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);} 35090: 94 01 movw r18, r8 35092: ab 01 movw r20, r22 35094: bc 01 movw r22, r24 35096: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 3509a: 90 91 77 0e lds r25, 0x0E77 ; 0x800e77 3509e: 0f 94 94 a6 call 0x34d28 ; 0x34d28 // 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; 350a2: 88 23 and r24, r24 350a4: 09 f4 brne .+2 ; 0x350a8 350a6: 18 cf rjmp .-464 ; 0x34ed8 // 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; 350a8: 80 0e add r8, r16 350aa: 91 1e adc r9, r17 curPosition_ += n; 350ac: eb 81 ldd r30, Y+3 ; 0x03 350ae: fc 81 ldd r31, Y+4 ; 0x04 350b0: 80 85 ldd r24, Z+8 ; 0x08 350b2: 91 85 ldd r25, Z+9 ; 0x09 350b4: a2 85 ldd r26, Z+10 ; 0x0a 350b6: b3 85 ldd r27, Z+11 ; 0x0b 350b8: 80 0f add r24, r16 350ba: 91 1f adc r25, r17 350bc: a1 1d adc r26, r1 350be: b1 1d adc r27, r1 350c0: 80 87 std Z+8, r24 ; 0x08 350c2: 91 87 std Z+9, r25 ; 0x09 350c4: a2 87 std Z+10, r26 ; 0x0a 350c6: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 350c8: c0 1a sub r12, r16 350ca: d1 0a sbc r13, r17 350cc: 45 cf rjmp .-374 ; 0x34f58 } return nbyte; 350ce: c7 01 movw r24, r14 350d0: 05 cf rjmp .-502 ; 0x34edc 000350d2 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 350d2: 4f 92 push r4 350d4: 5f 92 push r5 350d6: 6f 92 push r6 350d8: 7f 92 push r7 350da: af 92 push r10 350dc: bf 92 push r11 350de: cf 92 push r12 350e0: df 92 push r13 350e2: ef 92 push r14 350e4: ff 92 push r15 350e6: 0f 93 push r16 350e8: 1f 93 push r17 350ea: cf 93 push r28 350ec: df 93 push r29 350ee: 1f 92 push r1 350f0: cd b7 in r28, 0x3d ; 61 350f2: de b7 in r29, 0x3e ; 62 350f4: 8c 01 movw r16, r24 350f6: 7b 01 movw r14, r22 350f8: 5a 01 movw r10, r20 350fa: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 350fc: db 01 movw r26, r22 350fe: 59 96 adiw r26, 0x19 ; 25 35100: 8d 91 ld r24, X+ 35102: 9c 91 ld r25, X 35104: f8 01 movw r30, r16 35106: 92 8f std Z+26, r25 ; 0x1a 35108: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 3510a: cb 01 movw r24, r22 3510c: 0e 94 af 78 call 0xf15e ; 0xf15e } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 35110: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 35112: f7 01 movw r30, r14 35114: 80 85 ldd r24, Z+8 ; 0x08 35116: 91 85 ldd r25, Z+9 ; 0x09 35118: a2 85 ldd r26, Z+10 ; 0x0a 3511a: b3 85 ldd r27, Z+11 ; 0x0b 3511c: 41 89 ldd r20, Z+17 ; 0x11 3511e: 52 89 ldd r21, Z+18 ; 0x12 35120: 63 89 ldd r22, Z+19 ; 0x13 35122: 74 89 ldd r23, Z+20 ; 0x14 35124: 84 17 cp r24, r20 35126: 95 07 cpc r25, r21 35128: a6 07 cpc r26, r22 3512a: b7 07 cpc r27, r23 3512c: 08 f0 brcs .+2 ; 0x35130 3512e: 52 c0 rjmp .+164 ; 0x351d4 index = 0XF & (dirFile->curPosition_ >> 5); 35130: 55 e0 ldi r21, 0x05 ; 5 35132: b6 95 lsr r27 35134: a7 95 ror r26 35136: 97 95 ror r25 35138: 87 95 ror r24 3513a: 5a 95 dec r21 3513c: d1 f7 brne .-12 ; 0x35132 3513e: f8 2f mov r31, r24 35140: ff 70 andi r31, 0x0F ; 15 35142: 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; 35144: d7 01 movw r26, r14 35146: 13 96 adiw r26, 0x03 ; 3 35148: 8c 91 ld r24, X 3514a: 82 30 cpi r24, 0x02 ; 2 3514c: 10 f4 brcc .+4 ; 0x35152 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 3514e: 80 e0 ldi r24, 0x00 ; 0 35150: db c0 rjmp .+438 ; 0x35308 * \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; 35152: 41 e0 ldi r20, 0x01 ; 1 35154: 50 e0 ldi r21, 0x00 ; 0 35156: be 01 movw r22, r28 35158: 6f 5f subi r22, 0xFF ; 255 3515a: 7f 4f sbci r23, 0xFF ; 255 3515c: c7 01 movw r24, r14 3515e: 0f 94 4d a7 call 0x34e9a ; 0x34e9a 35162: 01 97 sbiw r24, 0x01 ; 1 35164: a1 f7 brne .-24 ; 0x3514e // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 35166: f7 01 movw r30, r14 35168: 80 85 ldd r24, Z+8 ; 0x08 3516a: 91 85 ldd r25, Z+9 ; 0x09 3516c: a2 85 ldd r26, Z+10 ; 0x0a 3516e: b3 85 ldd r27, Z+11 ; 0x0b 35170: 4f 96 adiw r24, 0x1f ; 31 35172: a1 1d adc r26, r1 35174: b1 1d adc r27, r1 35176: 80 87 std Z+8, r24 ; 0x08 35178: 91 87 std Z+9, r25 ; 0x09 3517a: a2 87 std Z+10, r26 ; 0x0a 3517c: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 3517e: f0 e2 ldi r31, 0x20 ; 32 35180: df 9e mul r13, r31 35182: b0 01 movw r22, r0 35184: 11 24 eor r1, r1 35186: 67 58 subi r22, 0x87 ; 135 35188: 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; 3518a: 61 15 cp r22, r1 3518c: 71 05 cpc r23, r1 3518e: f9 f2 breq .-66 ; 0x3514e if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 35190: db 01 movw r26, r22 35192: 8c 91 ld r24, X 35194: 88 23 and r24, r24 35196: 41 f0 breq .+16 ; 0x351a8 35198: 85 3e cpi r24, 0xE5 ; 229 3519a: 09 f0 breq .+2 ; 0x3519e 3519c: 4c c0 rjmp .+152 ; 0x35236 // remember first empty slot if (!emptyFound) { 3519e: 77 20 and r7, r7 351a0: 29 f0 breq .+10 ; 0x351ac return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 351a2: 77 24 eor r7, r7 351a4: 73 94 inc r7 351a6: b5 cf rjmp .-150 ; 0x35112 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) { 351a8: 71 10 cpse r7, r1 351aa: 0e c0 rjmp .+28 ; 0x351c8 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 351ac: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 351b0: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 351b4: a0 91 6f 0e lds r26, 0x0E6F ; 0x800e6f 351b8: b0 91 70 0e lds r27, 0x0E70 ; 0x800e70 351bc: f8 01 movw r30, r16 351be: 84 87 std Z+12, r24 ; 0x0c 351c0: 95 87 std Z+13, r25 ; 0x0d 351c2: a6 87 std Z+14, r26 ; 0x0e 351c4: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 351c6: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 351c8: db 01 movw r26, r22 351ca: 8c 91 ld r24, X 351cc: 81 11 cpse r24, r1 351ce: e9 cf rjmp .-46 ; 0x351a2 351d0: 77 24 eor r7, r7 351d2: 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; 351d4: 8c 2d mov r24, r12 351d6: 82 74 andi r24, 0x42 ; 66 351d8: 82 34 cpi r24, 0x42 ; 66 351da: 09 f0 breq .+2 ; 0x351de 351dc: b8 cf rjmp .-144 ; 0x3514e if (emptyFound) { 351de: 77 20 and r7, r7 351e0: 09 f4 brne .+2 ; 0x351e4 351e2: a2 c0 rjmp .+324 ; 0x35328 index = dirIndex_; 351e4: f8 01 movw r30, r16 351e6: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 351e8: 61 e0 ldi r22, 0x01 ; 1 351ea: c8 01 movw r24, r16 351ec: 0f 94 75 a4 call 0x348ea ; 0x348ea if (!p) goto fail; 351f0: 00 97 sbiw r24, 0x00 ; 0 351f2: 09 f4 brne .+2 ; 0x351f6 351f4: ac cf rjmp .-168 ; 0x3514e // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 351f6: 20 e2 ldi r18, 0x20 ; 32 351f8: dc 01 movw r26, r24 351fa: 1d 92 st X+, r1 351fc: 2a 95 dec r18 351fe: e9 f7 brne .-6 ; 0x351fa memcpy(p->name, dname, 11); 35200: 2b e0 ldi r18, 0x0B ; 11 35202: f5 01 movw r30, r10 35204: dc 01 movw r26, r24 35206: 01 90 ld r0, Z+ 35208: 0d 92 st X+, r0 3520a: 2a 95 dec r18 3520c: e1 f7 brne .-8 ; 0x35206 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 3520e: 21 e2 ldi r18, 0x21 ; 33 35210: 38 e2 ldi r19, 0x28 ; 40 35212: fc 01 movw r30, r24 35214: 31 8b std Z+17, r19 ; 0x11 35216: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 35218: 40 e0 ldi r20, 0x00 ; 0 3521a: 58 e0 ldi r21, 0x08 ; 8 3521c: 57 87 std Z+15, r21 ; 0x0f 3521e: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 35220: 33 8b std Z+19, r19 ; 0x13 35222: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 35224: 31 8f std Z+25, r19 ; 0x19 35226: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 35228: 57 8b std Z+23, r21 ; 0x17 3522a: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 3522c: 0f 94 98 6b call 0x2d730 ; 0x2d730 35230: 81 11 cpse r24, r1 35232: 09 c0 rjmp .+18 ; 0x35246 35234: 8c cf rjmp .-232 ; 0x3514e dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 35236: 4b e0 ldi r20, 0x0B ; 11 35238: 50 e0 ldi r21, 0x00 ; 0 3523a: c5 01 movw r24, r10 3523c: 0f 94 a5 e3 call 0x3c74a ; 0x3c74a 35240: 89 2b or r24, r25 35242: 09 f0 breq .+2 ; 0x35246 35244: 66 cf rjmp .-308 ; 0x35112 } //------------------------------------------------------------------------------ // 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]; 35246: f0 e2 ldi r31, 0x20 ; 32 35248: df 9e mul r13, r31 3524a: d0 01 movw r26, r0 3524c: 11 24 eor r1, r1 3524e: 9d 01 movw r18, r26 35250: 27 58 subi r18, 0x87 ; 135 35252: 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)) { 35254: f9 01 movw r30, r18 35256: 83 85 ldd r24, Z+11 ; 0x0b 35258: 81 71 andi r24, 0x11 ; 17 3525a: 21 f0 breq .+8 ; 0x35264 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 3525c: 8c 2d mov r24, r12 3525e: 82 71 andi r24, 0x12 ; 18 35260: 09 f0 breq .+2 ; 0x35264 35262: fc c0 rjmp .+504 ; 0x3545c } //------------------------------------------------------------------------------ // 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]; 35264: f8 01 movw r30, r16 35266: 81 8d ldd r24, Z+25 ; 0x19 35268: 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(); 3526a: 40 91 6d 0e lds r20, 0x0E6D ; 0x800e6d 3526e: 50 91 6e 0e lds r21, 0x0E6E ; 0x800e6e 35272: 60 91 6f 0e lds r22, 0x0E6F ; 0x800e6f 35276: 70 91 70 0e lds r23, 0x0E70 ; 0x800e70 3527a: 44 87 std Z+12, r20 ; 0x0c 3527c: 55 87 std Z+13, r21 ; 0x0d 3527e: 66 87 std Z+14, r22 ; 0x0e 35280: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 35282: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 35284: fd 01 movw r30, r26 35286: e7 58 subi r30, 0x87 ; 135 35288: f1 4f sbci r31, 0xF1 ; 241 3528a: 44 88 ldd r4, Z+20 ; 0x14 3528c: 55 88 ldd r5, Z+21 ; 0x15 3528e: 71 2c mov r7, r1 35290: 61 2c mov r6, r1 35292: 32 01 movw r6, r4 35294: 55 24 eor r5, r5 35296: 44 24 eor r4, r4 35298: d8 01 movw r26, r16 3529a: 55 96 adiw r26, 0x15 ; 21 3529c: 4d 92 st X+, r4 3529e: 5d 92 st X+, r5 352a0: 6d 92 st X+, r6 352a2: 7c 92 st X, r7 352a4: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 352a6: 42 8d ldd r20, Z+26 ; 0x1a 352a8: 53 8d ldd r21, Z+27 ; 0x1b 352aa: 70 e0 ldi r23, 0x00 ; 0 352ac: 60 e0 ldi r22, 0x00 ; 0 352ae: 44 29 or r20, r4 352b0: 55 29 or r21, r5 352b2: 66 29 or r22, r6 352b4: 77 29 or r23, r7 352b6: 55 96 adiw r26, 0x15 ; 21 352b8: 4d 93 st X+, r20 352ba: 5d 93 st X+, r21 352bc: 6d 93 st X+, r22 352be: 7c 93 st X, r23 352c0: 58 97 sbiw r26, 0x18 ; 24 352c2: d9 01 movw r26, r18 352c4: 1b 96 adiw r26, 0x0b ; 11 352c6: 2c 91 ld r18, X 352c8: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 352ca: 09 f0 breq .+2 ; 0x352ce 352cc: b9 c0 rjmp .+370 ; 0x35440 fileSize_ = p->fileSize; 352ce: 84 8d ldd r24, Z+28 ; 0x1c 352d0: 95 8d ldd r25, Z+29 ; 0x1d 352d2: a6 8d ldd r26, Z+30 ; 0x1e 352d4: b7 8d ldd r27, Z+31 ; 0x1f 352d6: f8 01 movw r30, r16 352d8: 81 8b std Z+17, r24 ; 0x11 352da: 92 8b std Z+18, r25 ; 0x12 352dc: a3 8b std Z+19, r26 ; 0x13 352de: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 352e0: 81 e0 ldi r24, 0x01 ; 1 352e2: 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; 352e4: 8c 2d mov r24, r12 352e6: 8f 70 andi r24, 0x0F ; 15 352e8: f8 01 movw r30, r16 352ea: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 352ec: 14 82 std Z+4, r1 ; 0x04 352ee: 15 82 std Z+5, r1 ; 0x05 352f0: 16 82 std Z+6, r1 ; 0x06 352f2: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 352f4: 10 86 std Z+8, r1 ; 0x08 352f6: 11 86 std Z+9, r1 ; 0x09 352f8: 12 86 std Z+10, r1 ; 0x0a 352fa: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 352fc: 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; 352fe: c4 fe sbrs r12, 4 35300: 03 c0 rjmp .+6 ; 0x35308 35302: c8 01 movw r24, r16 35304: 0f 94 99 78 call 0x2f132 ; 0x2f132 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 35308: 0f 90 pop r0 3530a: df 91 pop r29 3530c: cf 91 pop r28 3530e: 1f 91 pop r17 35310: 0f 91 pop r16 35312: ff 90 pop r15 35314: ef 90 pop r14 35316: df 90 pop r13 35318: cf 90 pop r12 3531a: bf 90 pop r11 3531c: af 90 pop r10 3531e: 7f 90 pop r7 35320: 6f 90 pop r6 35322: 5f 90 pop r5 35324: 4f 90 pop r4 35326: 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; 35328: d7 01 movw r26, r14 3532a: 13 96 adiw r26, 0x03 ; 3 3532c: 8c 91 ld r24, X 3532e: 13 97 sbiw r26, 0x03 ; 3 35330: 82 30 cpi r24, 0x02 ; 2 35332: 09 f4 brne .+2 ; 0x35336 35334: 0c cf rjmp .-488 ; 0x3514e // 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; 35336: 51 96 adiw r26, 0x11 ; 17 35338: 8d 91 ld r24, X+ 3533a: 9d 91 ld r25, X+ 3533c: 0d 90 ld r0, X+ 3533e: bc 91 ld r27, X 35340: a0 2d mov r26, r0 35342: 80 3e cpi r24, 0xE0 ; 224 35344: 9f 4f sbci r25, 0xFF ; 255 35346: af 41 sbci r26, 0x1F ; 31 35348: b1 05 cpc r27, r1 3534a: 08 f0 brcs .+2 ; 0x3534e 3534c: 00 cf rjmp .-512 ; 0x3514e if (!addCluster()) goto fail; 3534e: c7 01 movw r24, r14 35350: 0f 94 c9 a4 call 0x34992 ; 0x34992 35354: 88 23 and r24, r24 35356: 09 f4 brne .+2 ; 0x3535a 35358: fa ce rjmp .-524 ; 0x3514e if (!vol_->cacheFlush()) goto fail; 3535a: 0f 94 98 6b call 0x2d730 ; 0x2d730 3535e: 88 23 and r24, r24 35360: 09 f4 brne .+2 ; 0x35364 35362: f5 ce rjmp .-534 ; 0x3514e block = vol_->clusterStartBlock(curCluster_); 35364: d7 01 movw r26, r14 35366: 59 96 adiw r26, 0x19 ; 25 35368: ed 91 ld r30, X+ 3536a: fc 91 ld r31, X 3536c: 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_);} 3536e: 14 96 adiw r26, 0x04 ; 4 35370: 4d 90 ld r4, X+ 35372: 5d 90 ld r5, X+ 35374: 6d 90 ld r6, X+ 35376: 7c 90 ld r7, X 35378: 17 97 sbiw r26, 0x07 ; 7 3537a: b2 e0 ldi r27, 0x02 ; 2 3537c: 4b 1a sub r4, r27 3537e: 51 08 sbc r5, r1 35380: 61 08 sbc r6, r1 35382: 71 08 sbc r7, r1 35384: 85 85 ldd r24, Z+13 ; 0x0d 35386: 04 c0 rjmp .+8 ; 0x35390 35388: 44 0c add r4, r4 3538a: 55 1c adc r5, r5 3538c: 66 1c adc r6, r6 3538e: 77 1c adc r7, r7 35390: 8a 95 dec r24 35392: d2 f7 brpl .-12 ; 0x35388 35394: 86 85 ldd r24, Z+14 ; 0x0e 35396: 97 85 ldd r25, Z+15 ; 0x0f 35398: a0 89 ldd r26, Z+16 ; 0x10 3539a: b1 89 ldd r27, Z+17 ; 0x11 3539c: 48 0e add r4, r24 3539e: 59 1e adc r5, r25 353a0: 6a 1e adc r6, r26 353a2: 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; 353a4: 81 e0 ldi r24, 0x01 ; 1 353a6: 80 93 75 0e sts 0x0E75, r24 ; 0x800e75 cacheBlockNumber_ = blockNumber; 353aa: 40 92 6d 0e sts 0x0E6D, r4 ; 0x800e6d 353ae: 50 92 6e 0e sts 0x0E6E, r5 ; 0x800e6e 353b2: 60 92 6f 0e sts 0x0E6F, r6 ; 0x800e6f 353b6: 70 92 70 0e sts 0x0E70, r7 ; 0x800e70 // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 353ba: e9 e7 ldi r30, 0x79 ; 121 353bc: fe e0 ldi r31, 0x0E ; 14 353be: 80 e0 ldi r24, 0x00 ; 0 353c0: 92 e0 ldi r25, 0x02 ; 2 353c2: df 01 movw r26, r30 353c4: 9c 01 movw r18, r24 353c6: 1d 92 st X+, r1 353c8: 21 50 subi r18, 0x01 ; 1 353ca: 30 40 sbci r19, 0x00 ; 0 353cc: e1 f7 brne .-8 ; 0x353c6 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 353ce: dd 24 eor r13, r13 353d0: d3 94 inc r13 353d2: d7 01 movw r26, r14 353d4: 59 96 adiw r26, 0x19 ; 25 353d6: ed 91 ld r30, X+ 353d8: fc 91 ld r31, X 353da: 84 81 ldd r24, Z+4 ; 0x04 353dc: d8 16 cp r13, r24 353de: 98 f4 brcc .+38 ; 0x35406 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); 353e0: 29 e7 ldi r18, 0x79 ; 121 353e2: 3e e0 ldi r19, 0x0E ; 14 353e4: b3 01 movw r22, r6 353e6: a2 01 movw r20, r4 353e8: 4d 0d add r20, r13 353ea: 51 1d adc r21, r1 353ec: 61 1d adc r22, r1 353ee: 71 1d adc r23, r1 353f0: 80 91 76 0e lds r24, 0x0E76 ; 0x800e76 353f4: 90 91 77 0e lds r25, 0x0E77 ; 0x800e77 353f8: 0f 94 30 a6 call 0x34c60 ; 0x34c60 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 353fc: 88 23 and r24, r24 353fe: 09 f4 brne .+2 ; 0x35402 35400: a6 ce rjmp .-692 ; 0x3514e // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 35402: d3 94 inc r13 35404: e6 cf rjmp .-52 ; 0x353d2 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 35406: 25 85 ldd r18, Z+13 ; 0x0d 35408: 80 e0 ldi r24, 0x00 ; 0 3540a: 92 e0 ldi r25, 0x02 ; 2 3540c: a0 e0 ldi r26, 0x00 ; 0 3540e: b0 e0 ldi r27, 0x00 ; 0 35410: 04 c0 rjmp .+8 ; 0x3541a 35412: 88 0f add r24, r24 35414: 99 1f adc r25, r25 35416: aa 1f adc r26, r26 35418: bb 1f adc r27, r27 3541a: 2a 95 dec r18 3541c: d2 f7 brpl .-12 ; 0x35412 3541e: f7 01 movw r30, r14 35420: 41 89 ldd r20, Z+17 ; 0x11 35422: 52 89 ldd r21, Z+18 ; 0x12 35424: 63 89 ldd r22, Z+19 ; 0x13 35426: 74 89 ldd r23, Z+20 ; 0x14 35428: 84 0f add r24, r20 3542a: 95 1f adc r25, r21 3542c: a6 1f adc r26, r22 3542e: b7 1f adc r27, r23 35430: 81 8b std Z+17, r24 ; 0x11 35432: 92 8b std Z+18, r25 ; 0x12 35434: a3 8b std Z+19, r26 ; 0x13 35436: 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; 35438: 89 e7 ldi r24, 0x79 ; 121 3543a: 9e e0 ldi r25, 0x0E ; 14 index = 0; 3543c: d1 2c mov r13, r1 3543e: db ce rjmp .-586 ; 0x351f6 // 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)) { 35440: 20 31 cpi r18, 0x10 ; 16 35442: 61 f4 brne .+24 ; 0x3545c if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 35444: 98 01 movw r18, r16 35446: 2f 5e subi r18, 0xEF ; 239 35448: 3f 4f sbci r19, 0xFF ; 255 3544a: 0f 94 29 6d call 0x2da52 ; 0x2da52 3544e: 88 23 and r24, r24 35450: 29 f0 breq .+10 ; 0x3545c type_ = FAT_FILE_TYPE_SUBDIR; 35452: 84 e0 ldi r24, 0x04 ; 4 35454: d8 01 movw r26, r16 35456: 13 96 adiw r26, 0x03 ; 3 35458: 8c 93 st X, r24 3545a: 44 cf rjmp .-376 ; 0x352e4 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 3545c: d8 01 movw r26, r16 3545e: 13 96 adiw r26, 0x03 ; 3 35460: 1c 92 st X, r1 35462: 75 ce rjmp .-790 ; 0x3514e 00035464 : 35464: 88 e1 ldi r24, 0x18 ; 24 35466: 9e e0 ldi r25, 0x0E ; 14 35468: 0f b6 in r0, 0x3f ; 63 3546a: f8 94 cli 3546c: a8 95 wdr 3546e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 35472: 0f be out 0x3f, r0 ; 63 35474: 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); 35478: 9f b7 in r25, 0x3f ; 63 3547a: f8 94 cli 3547c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 35480: 84 60 ori r24, 0x04 ; 4 35482: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 35486: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 35488: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 3548c: 4e e3 ldi r20, 0x3E ; 62 3548e: 51 e7 ldi r21, 0x71 ; 113 35490: 61 e0 ldi r22, 0x01 ; 1 35492: 80 e0 ldi r24, 0x00 ; 0 35494: 0e 94 a1 6f call 0xdf42 ; 0xdf42 35498: ff cf rjmp .-2 ; 0x35498 0003549a : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 3549a: 60 91 54 0e lds r22, 0x0E54 ; 0x800e54 uint8_t _block_buffer_tail = block_buffer_tail; 3549e: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 uint16_t sdlen = 0; 354a2: 30 e0 ldi r19, 0x00 ; 0 354a4: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 354a6: 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) 354a8: 96 17 cp r25, r22 354aa: 61 f0 breq .+24 ; 0x354c4 { sdlen += block_buffer[_block_buffer_tail].sdlen; 354ac: 89 9f mul r24, r25 354ae: f0 01 movw r30, r0 354b0: 11 24 eor r1, r1 354b2: e0 52 subi r30, 0x20 ; 32 354b4: f8 4f sbci r31, 0xF8 ; 248 354b6: 40 81 ld r20, Z 354b8: 51 81 ldd r21, Z+1 ; 0x01 354ba: 24 0f add r18, r20 354bc: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 354be: 9f 5f subi r25, 0xFF ; 255 354c0: 9f 70 andi r25, 0x0F ; 15 354c2: f2 cf rjmp .-28 ; 0x354a8 } return sdlen; } 354c4: c9 01 movw r24, r18 354c6: 08 95 ret 000354c8 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 354c8: 30 91 54 0e lds r19, 0x0E54 ; 0x800e54 354cc: 20 91 55 0e lds r18, 0x0E55 ; 0x800e55 354d0: 32 17 cp r19, r18 354d2: 91 f0 breq .+36 ; 0x354f8 // 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; 354d4: e0 91 54 0e lds r30, 0x0E54 ; 0x800e54 } // 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) 354d8: e1 11 cpse r30, r1 354da: 01 c0 rjmp .+2 ; 0x354de block_index = BLOCK_BUFFER_SIZE; 354dc: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 354de: 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; 354e0: 2e e6 ldi r18, 0x6E ; 110 354e2: e2 9f mul r30, r18 354e4: f0 01 movw r30, r0 354e6: 11 24 eor r1, r1 354e8: e0 52 subi r30, 0x20 ; 32 354ea: f8 4f sbci r31, 0xF8 ; 248 354ec: 20 81 ld r18, Z 354ee: 31 81 ldd r19, Z+1 ; 0x01 354f0: 82 0f add r24, r18 354f2: 93 1f adc r25, r19 354f4: 91 83 std Z+1, r25 ; 0x01 354f6: 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. } } 354f8: 08 95 ret 000354fa : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 354fa: 8f 92 push r8 354fc: 9f 92 push r9 354fe: af 92 push r10 35500: bf 92 push r11 35502: cf 92 push r12 35504: df 92 push r13 35506: ef 92 push r14 35508: ff 92 push r15 3550a: 0f 93 push r16 3550c: 1f 93 push r17 3550e: cf 93 push r28 35510: df 93 push r29 35512: c0 91 97 02 lds r28, 0x0297 ; 0x800297 35516: d0 91 98 02 lds r29, 0x0298 ; 0x800298 3551a: 80 e7 ldi r24, 0x70 ; 112 3551c: e8 2e mov r14, r24 3551e: 86 e0 ldi r24, 0x06 ; 6 35520: f8 2e mov r15, r24 35522: 0e ee ldi r16, 0xEE ; 238 35524: 17 e1 ldi r17, 0x17 ; 23 35526: 6e 01 movw r12, r28 35528: 80 e1 ldi r24, 0x10 ; 16 3552a: c8 0e add r12, r24 3552c: 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]; 3552e: 69 91 ld r22, Y+ 35530: 79 91 ld r23, Y+ 35532: 89 91 ld r24, Y+ 35534: 99 91 ld r25, Y+ 35536: f7 01 movw r30, r14 35538: 81 90 ld r8, Z+ 3553a: 91 90 ld r9, Z+ 3553c: a1 90 ld r10, Z+ 3553e: b1 90 ld r11, Z+ 35540: 7f 01 movw r14, r30 35542: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 35546: a5 01 movw r20, r10 35548: 94 01 movw r18, r8 3554a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3554e: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 35552: f8 01 movw r30, r16 35554: 61 93 st Z+, r22 35556: 71 93 st Z+, r23 35558: 81 93 st Z+, r24 3555a: 91 93 st Z+, r25 3555c: 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++) 3555e: cc 15 cp r28, r12 35560: dd 05 cpc r29, r13 35562: 29 f7 brne .-54 ; 0x3552e max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 35564: df 91 pop r29 35566: cf 91 pop r28 35568: 1f 91 pop r17 3556a: 0f 91 pop r16 3556c: ff 90 pop r15 3556e: ef 90 pop r14 35570: df 90 pop r13 35572: cf 90 pop r12 35574: bf 90 pop r11 35576: af 90 pop r10 35578: 9f 90 pop r9 3557a: 8f 90 pop r8 3557c: 08 95 ret 0003557e : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 3557e: 80 91 6a 06 lds r24, 0x066A ; 0x80066a 35582: 81 11 cpse r24, r1 35584: 0e c0 rjmp .+28 ; 0x355a2 { max_feedrate = cs.max_feedrate_normal; 35586: 80 e8 ldi r24, 0x80 ; 128 35588: 96 e0 ldi r25, 0x06 ; 6 3558a: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 3558e: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 35592: 80 e9 ldi r24, 0x90 ; 144 35594: 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; 35596: 90 93 98 02 sts 0x0298, r25 ; 0x800298 3559a: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } reset_acceleration_rates(); 3559e: 0d 94 7d aa jmp 0x354fa ; 0x354fa 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) 355a2: 81 30 cpi r24, 0x01 ; 1 355a4: e1 f7 brne .-8 ; 0x3559e { max_feedrate = cs.max_feedrate_silent; 355a6: 88 e0 ldi r24, 0x08 ; 8 355a8: 97 e0 ldi r25, 0x07 ; 7 355aa: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 355ae: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 355b2: 88 e1 ldi r24, 0x18 ; 24 355b4: 97 e0 ldi r25, 0x07 ; 7 355b6: ef cf rjmp .-34 ; 0x35596 000355b8 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 355b8: fc 01 movw r30, r24 355ba: 40 81 ld r20, Z 355bc: 51 81 ldd r21, Z+1 ; 0x01 355be: 62 81 ldd r22, Z+2 ; 0x02 355c0: 73 81 ldd r23, Z+3 ; 0x03 355c2: 40 93 da 04 sts 0x04DA, r20 ; 0x8004da 355c6: 50 93 db 04 sts 0x04DB, r21 ; 0x8004db 355ca: 60 93 dc 04 sts 0x04DC, r22 ; 0x8004dc 355ce: 70 93 dd 04 sts 0x04DD, r23 ; 0x8004dd #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 355d2: 20 91 7c 06 lds r18, 0x067C ; 0x80067c 355d6: 30 91 7d 06 lds r19, 0x067D ; 0x80067d 355da: 40 91 7e 06 lds r20, 0x067E ; 0x80067e 355de: 50 91 7f 06 lds r21, 0x067F ; 0x80067f 355e2: 60 81 ld r22, Z 355e4: 71 81 ldd r23, Z+1 ; 0x01 355e6: 82 81 ldd r24, Z+2 ; 0x02 355e8: 93 81 ldd r25, Z+3 ; 0x03 355ea: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 355ee: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 355f2: e2 e5 ldi r30, 0x52 ; 82 355f4: f7 e0 ldi r31, 0x07 ; 7 355f6: 64 87 std Z+12, r22 ; 0x0c 355f8: 75 87 std Z+13, r23 ; 0x0d 355fa: 86 87 std Z+14, r24 ; 0x0e 355fc: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 355fe: 8f b7 in r24, 0x3f ; 63 35600: f8 94 cli count_position[E_AXIS] = e; 35602: 44 85 ldd r20, Z+12 ; 0x0c 35604: 55 85 ldd r21, Z+13 ; 0x0d 35606: 66 85 ldd r22, Z+14 ; 0x0e 35608: 77 85 ldd r23, Z+15 ; 0x0f 3560a: 40 93 6e 07 sts 0x076E, r20 ; 0x80076e 3560e: 50 93 6f 07 sts 0x076F, r21 ; 0x80076f 35612: 60 93 70 07 sts 0x0770, r22 ; 0x800770 35616: 70 93 71 07 sts 0x0771, r23 ; 0x800771 CRITICAL_SECTION_END; 3561a: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 3561c: 08 95 ret 0003561e : // 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; 3561e: fc 01 movw r30, r24 35620: 40 81 ld r20, Z 35622: 51 81 ldd r21, Z+1 ; 0x01 35624: 62 81 ldd r22, Z+2 ; 0x02 35626: 73 81 ldd r23, Z+3 ; 0x03 35628: 40 93 d6 04 sts 0x04D6, r20 ; 0x8004d6 3562c: 50 93 d7 04 sts 0x04D7, r21 ; 0x8004d7 35630: 60 93 d8 04 sts 0x04D8, r22 ; 0x8004d8 35634: 70 93 d9 04 sts 0x04D9, r23 ; 0x8004d9 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 35638: 20 91 78 06 lds r18, 0x0678 ; 0x800678 3563c: 30 91 79 06 lds r19, 0x0679 ; 0x800679 35640: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 35644: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 35648: 60 81 ld r22, Z 3564a: 71 81 ldd r23, Z+1 ; 0x01 3564c: 82 81 ldd r24, Z+2 ; 0x02 3564e: 93 81 ldd r25, Z+3 ; 0x03 35650: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 35654: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 35658: 60 93 5a 07 sts 0x075A, r22 ; 0x80075a 3565c: 70 93 5b 07 sts 0x075B, r23 ; 0x80075b 35660: 80 93 5c 07 sts 0x075C, r24 ; 0x80075c 35664: 90 93 5d 07 sts 0x075D, r25 ; 0x80075d st_set_position(position); 35668: 0d 94 b5 87 jmp 0x30f6a ; 0x30f6a 0003566c : // 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) { 3566c: 2f 92 push r2 3566e: 3f 92 push r3 35670: 4f 92 push r4 35672: 5f 92 push r5 35674: 6f 92 push r6 35676: 7f 92 push r7 35678: 8f 92 push r8 3567a: 9f 92 push r9 3567c: af 92 push r10 3567e: bf 92 push r11 35680: cf 92 push r12 35682: df 92 push r13 35684: ef 92 push r14 35686: ff 92 push r15 35688: 0f 93 push r16 3568a: 1f 93 push r17 3568c: cf 93 push r28 3568e: df 93 push r29 35690: cd b7 in r28, 0x3d ; 61 35692: de b7 in r29, 0x3e ; 62 35694: c5 58 subi r28, 0x85 ; 133 35696: d1 09 sbc r29, r1 35698: 0f b6 in r0, 0x3f ; 63 3569a: f8 94 cli 3569c: de bf out 0x3e, r29 ; 62 3569e: 0f be out 0x3f, r0 ; 63 356a0: cd bf out 0x3d, r28 ; 61 356a2: 69 a3 std Y+33, r22 ; 0x21 356a4: 7a a3 std Y+34, r23 ; 0x22 356a6: 8b a3 std Y+35, r24 ; 0x23 356a8: 9c a3 std Y+36, r25 ; 0x24 356aa: 2d a3 std Y+37, r18 ; 0x25 356ac: 3e a3 std Y+38, r19 ; 0x26 356ae: 4f a3 std Y+39, r20 ; 0x27 356b0: 58 a7 std Y+40, r21 ; 0x28 356b2: a8 96 adiw r28, 0x28 ; 40 356b4: ec ae std Y+60, r14 ; 0x3c 356b6: fd ae std Y+61, r15 ; 0x3d 356b8: 0e af std Y+62, r16 ; 0x3e 356ba: 1f af std Y+63, r17 ; 0x3f 356bc: a8 97 sbiw r28, 0x28 ; 40 356be: aa 96 adiw r28, 0x2a ; 42 356c0: df ae std Y+63, r13 ; 0x3f 356c2: ce ae std Y+62, r12 ; 0x3e 356c4: aa 97 sbiw r28, 0x2a ; 42 356c6: 89 aa std Y+49, r8 ; 0x31 356c8: 99 ae std Y+57, r9 ; 0x39 356ca: ad ae std Y+61, r10 ; 0x3d 356cc: bd aa std Y+53, r11 ; 0x35 356ce: c5 56 subi r28, 0x65 ; 101 356d0: df 4f sbci r29, 0xFF ; 255 356d2: 08 81 ld r16, Y 356d4: 19 81 ldd r17, Y+1 ; 0x01 356d6: cb 59 subi r28, 0x9B ; 155 356d8: 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); 356da: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 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) 356de: 8f 5f subi r24, 0xFF ; 255 356e0: a1 96 adiw r28, 0x21 ; 33 356e2: 8f af std Y+63, r24 ; 0x3f 356e4: a1 97 sbiw r28, 0x21 ; 33 356e6: 80 31 cpi r24, 0x10 ; 16 356e8: 19 f4 brne .+6 ; 0x356f0 block_index = 0; 356ea: a1 96 adiw r28, 0x21 ; 33 356ec: 1f ae std Y+63, r1 ; 0x3f 356ee: 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) { 356f0: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 356f4: a1 96 adiw r28, 0x21 ; 33 356f6: 2f ad ldd r18, Y+63 ; 0x3f 356f8: a1 97 sbiw r28, 0x21 ; 33 356fa: 82 13 cpse r24, r18 356fc: 0f c0 rjmp .+30 ; 0x3571c do { manage_heater(); 356fe: 0f 94 98 4e call 0x29d30 ; 0x29d30 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 35702: 80 e0 ldi r24, 0x00 ; 0 35704: 0e 94 da 8b call 0x117b4 ; 0x117b4 lcd_update(0); 35708: 80 e0 ldi r24, 0x00 ; 0 3570a: 0e 94 54 6f call 0xdea8 ; 0xdea8 } while (block_buffer_tail == next_buffer_head); 3570e: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 35712: a1 96 adiw r28, 0x21 ; 33 35714: 3f ad ldd r19, Y+63 ; 0x3f 35716: a1 97 sbiw r28, 0x21 ; 33 35718: 83 17 cp r24, r19 3571a: 89 f3 breq .-30 ; 0x356fe } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 3571c: 40 91 5b 0e lds r20, 0x0E5B ; 0x800e5b 35720: a2 96 adiw r28, 0x22 ; 34 35722: 4f af std Y+63, r20 ; 0x3f 35724: a2 97 sbiw r28, 0x22 ; 34 35726: 44 23 and r20, r20 35728: 11 f1 breq .+68 ; 0x3576e // avoid planning the block early if aborted SERIAL_ECHO_START; 3572a: 82 ee ldi r24, 0xE2 ; 226 3572c: 99 ea ldi r25, 0xA9 ; 169 3572e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(_n("Move aborted")); 35732: 81 e3 ldi r24, 0x31 ; 49 35734: 91 e7 ldi r25, 0x71 ; 113 35736: 0e 94 fe 7a call 0xf5fc ; 0xf5fc // 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(); } 3573a: cb 57 subi r28, 0x7B ; 123 3573c: df 4f sbci r29, 0xFF ; 255 3573e: 0f b6 in r0, 0x3f ; 63 35740: f8 94 cli 35742: de bf out 0x3e, r29 ; 62 35744: 0f be out 0x3f, r0 ; 63 35746: cd bf out 0x3d, r28 ; 61 35748: df 91 pop r29 3574a: cf 91 pop r28 3574c: 1f 91 pop r17 3574e: 0f 91 pop r16 35750: ff 90 pop r15 35752: ef 90 pop r14 35754: df 90 pop r13 35756: cf 90 pop r12 35758: bf 90 pop r11 3575a: af 90 pop r10 3575c: 9f 90 pop r9 3575e: 8f 90 pop r8 35760: 7f 90 pop r7 35762: 6f 90 pop r6 35764: 5f 90 pop r5 35766: 4f 90 pop r4 35768: 3f 90 pop r3 3576a: 2f 90 pop r2 3576c: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 3576e: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 35772: 29 2e mov r2, r25 35774: 31 2c mov r3, r1 35776: 8e e6 ldi r24, 0x6E ; 110 35778: 98 9f mul r25, r24 3577a: d0 01 movw r26, r0 3577c: 11 24 eor r1, r1 3577e: a4 96 adiw r28, 0x24 ; 36 35780: bf af std Y+63, r27 ; 0x3f 35782: ae af std Y+62, r26 ; 0x3e 35784: 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; 35786: cd 01 movw r24, r26 35788: 8c 58 subi r24, 0x8C ; 140 3578a: 98 4f sbci r25, 0xF8 ; 248 3578c: fc 01 movw r30, r24 3578e: e9 5b subi r30, 0xB9 ; 185 35790: ff 4f sbci r31, 0xFF ; 255 35792: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 35794: 84 59 subi r24, 0x94 ; 148 35796: 9f 4f sbci r25, 0xFF ; 255 35798: fc 01 movw r30, r24 3579a: 11 82 std Z+1, r1 ; 0x01 3579c: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 3579e: 01 15 cp r16, r1 357a0: 11 05 cpc r17, r1 357a2: 11 f4 brne .+4 ; 0x357a8 357a4: 0d 94 2a b6 jmp 0x36c54 ; 0x36c54 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 357a8: 80 e1 ldi r24, 0x10 ; 16 357aa: f8 01 movw r30, r16 357ac: a4 53 subi r26, 0x34 ; 52 357ae: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 357b0: 01 90 ld r0, Z+ 357b2: 0d 92 st X+, r0 357b4: 8a 95 dec r24 357b6: e1 f7 brne .-8 ; 0x357b0 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 357b8: 8e e6 ldi r24, 0x6E ; 110 357ba: 82 9d mul r24, r2 357bc: 80 01 movw r16, r0 357be: 83 9d mul r24, r3 357c0: 10 0d add r17, r0 357c2: 11 24 eor r1, r1 357c4: 0c 58 subi r16, 0x8C ; 140 357c6: 18 4f sbci r17, 0xF8 ; 248 357c8: f8 01 movw r30, r16 357ca: e8 59 subi r30, 0x98 ; 152 357cc: ff 4f sbci r31, 0xFF ; 255 357ce: c3 56 subi r28, 0x63 ; 99 357d0: df 4f sbci r29, 0xFF ; 255 357d2: 88 81 ld r24, Y 357d4: 99 81 ldd r25, Y+1 ; 0x01 357d6: cd 59 subi r28, 0x9D ; 157 357d8: d0 40 sbci r29, 0x00 ; 0 357da: 91 83 std Z+1, r25 ; 0x01 357dc: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 357de: 06 59 subi r16, 0x96 ; 150 357e0: 1f 4f sbci r17, 0xFF ; 255 357e2: 60 91 90 02 lds r22, 0x0290 ; 0x800290 357e6: 70 91 91 02 lds r23, 0x0291 ; 0x800291 357ea: 80 91 92 02 lds r24, 0x0292 ; 0x800292 357ee: 90 91 93 02 lds r25, 0x0293 ; 0x800293 357f2: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 357f6: d8 01 movw r26, r16 357f8: 6d 93 st X+, r22 357fa: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 357fc: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL23plan_reset_next_e_queue.lto_priv.505> 35800: 88 23 and r24, r24 35802: a9 f0 breq .+42 ; 0x3582e { position[E_AXIS] = 0; 35804: 10 92 5e 07 sts 0x075E, r1 ; 0x80075e 35808: 10 92 5f 07 sts 0x075F, r1 ; 0x80075f 3580c: 10 92 60 07 sts 0x0760, r1 ; 0x800760 35810: 10 92 61 07 sts 0x0761, r1 ; 0x800761 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 35814: 10 92 da 04 sts 0x04DA, r1 ; 0x8004da 35818: 10 92 db 04 sts 0x04DB, r1 ; 0x8004db 3581c: 10 92 dc 04 sts 0x04DC, r1 ; 0x8004dc 35820: 10 92 dd 04 sts 0x04DD, r1 ; 0x8004dd #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; 35824: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL23plan_reset_next_e_queue.lto_priv.505> plan_reset_next_e_sched = true; 35828: 81 e0 ldi r24, 0x01 ; 1 3582a: 80 93 b8 04 sts 0x04B8, r24 ; 0x8004b8 <_ZL23plan_reset_next_e_sched.lto_priv.506> } // Apply the machine correction matrix. world2machine(x, y); 3582e: be 01 movw r22, r28 35830: 6b 5d subi r22, 0xDB ; 219 35832: 7f 4f sbci r23, 0xFF ; 255 35834: ce 01 movw r24, r28 35836: 81 96 adiw r24, 0x21 ; 33 35838: 0e 94 af 6a call 0xd55e ; 0xd55e // 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]); 3583c: c9 a0 ldd r12, Y+33 ; 0x21 3583e: da a0 ldd r13, Y+34 ; 0x22 35840: eb a0 ldd r14, Y+35 ; 0x23 35842: fc a0 ldd r15, Y+36 ; 0x24 35844: 20 91 70 06 lds r18, 0x0670 ; 0x800670 35848: 30 91 71 06 lds r19, 0x0671 ; 0x800671 3584c: 40 91 72 06 lds r20, 0x0672 ; 0x800672 35850: 50 91 73 06 lds r21, 0x0673 ; 0x800673 35854: c7 01 movw r24, r14 35856: b6 01 movw r22, r12 35858: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3585c: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 35860: c2 58 subi r28, 0x82 ; 130 35862: df 4f sbci r29, 0xFF ; 255 35864: 68 83 st Y, r22 35866: 79 83 std Y+1, r23 ; 0x01 35868: 8a 83 std Y+2, r24 ; 0x02 3586a: 9b 83 std Y+3, r25 ; 0x03 3586c: ce 57 subi r28, 0x7E ; 126 3586e: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 35870: 8d a0 ldd r8, Y+37 ; 0x25 35872: 9e a0 ldd r9, Y+38 ; 0x26 35874: af a0 ldd r10, Y+39 ; 0x27 35876: b8 a4 ldd r11, Y+40 ; 0x28 35878: 20 91 74 06 lds r18, 0x0674 ; 0x800674 3587c: 30 91 75 06 lds r19, 0x0675 ; 0x800675 35880: 40 91 76 06 lds r20, 0x0676 ; 0x800676 35884: 50 91 77 06 lds r21, 0x0677 ; 0x800677 35888: c5 01 movw r24, r10 3588a: b4 01 movw r22, r8 3588c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 35890: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 35894: ce 57 subi r28, 0x7E ; 126 35896: df 4f sbci r29, 0xFF ; 255 35898: 68 83 st Y, r22 3589a: 79 83 std Y+1, r23 ; 0x01 3589c: 8a 83 std Y+2, r24 ; 0x02 3589e: 9b 83 std Y+3, r25 ; 0x03 358a0: c2 58 subi r28, 0x82 ; 130 358a2: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 358a4: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 358a8: 88 23 and r24, r24 358aa: 11 f4 brne .+4 ; 0x358b0 358ac: 0d 94 31 b6 jmp 0x36c62 ; 0x36c62 target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 358b0: a5 01 movw r20, r10 358b2: 94 01 movw r18, r8 358b4: c7 01 movw r24, r14 358b6: b6 01 movw r22, r12 358b8: 0f 94 4b 96 call 0x32c96 ; 0x32c96 358bc: a8 96 adiw r28, 0x28 ; 40 358be: 2c ad ldd r18, Y+60 ; 0x3c 358c0: 3d ad ldd r19, Y+61 ; 0x3d 358c2: 4e ad ldd r20, Y+62 ; 0x3e 358c4: 5f ad ldd r21, Y+63 ; 0x3f 358c6: a8 97 sbiw r28, 0x28 ; 40 358c8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 358cc: 20 91 78 06 lds r18, 0x0678 ; 0x800678 358d0: 30 91 79 06 lds r19, 0x0679 ; 0x800679 358d4: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 358d8: 50 91 7b 06 lds r21, 0x067B ; 0x80067b }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 358dc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 358e0: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 358e4: e6 96 adiw r28, 0x36 ; 54 358e6: 6c af std Y+60, r22 ; 0x3c 358e8: 7d af std Y+61, r23 ; 0x3d 358ea: 8e af std Y+62, r24 ; 0x3e 358ec: 9f af std Y+63, r25 ; 0x3f 358ee: 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]); 358f0: aa 96 adiw r28, 0x2a ; 42 358f2: ee ad ldd r30, Y+62 ; 0x3e 358f4: ff ad ldd r31, Y+63 ; 0x3f 358f6: aa 97 sbiw r28, 0x2a ; 42 358f8: 80 80 ld r8, Z 358fa: 91 80 ldd r9, Z+1 ; 0x01 358fc: a2 80 ldd r10, Z+2 ; 0x02 358fe: b3 80 ldd r11, Z+3 ; 0x03 35900: 20 91 7c 06 lds r18, 0x067C ; 0x80067c 35904: 30 91 7d 06 lds r19, 0x067D ; 0x80067d 35908: 40 91 7e 06 lds r20, 0x067E ; 0x80067e 3590c: 50 91 7f 06 lds r21, 0x067F ; 0x80067f 35910: c5 01 movw r24, r10 35912: b4 01 movw r22, r8 35914: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 35918: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 3591c: ae 96 adiw r28, 0x2e ; 46 3591e: 6c af std Y+60, r22 ; 0x3c 35920: 7d af std Y+61, r23 ; 0x3d 35922: 8e af std Y+62, r24 ; 0x3e 35924: 9f af std Y+63, r25 ; 0x3f 35926: 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]; 35928: 80 91 5e 07 lds r24, 0x075E ; 0x80075e 3592c: 90 91 5f 07 lds r25, 0x075F ; 0x80075f 35930: a0 91 60 07 lds r26, 0x0760 ; 0x800760 35934: b0 91 61 07 lds r27, 0x0761 ; 0x800761 35938: ae 96 adiw r28, 0x2e ; 46 3593a: 4c ac ldd r4, Y+60 ; 0x3c 3593c: 5d ac ldd r5, Y+61 ; 0x3d 3593e: 6e ac ldd r6, Y+62 ; 0x3e 35940: 7f ac ldd r7, Y+63 ; 0x3f 35942: ae 97 sbiw r28, 0x2e ; 46 35944: 48 1a sub r4, r24 35946: 59 0a sbc r5, r25 35948: 6a 0a sbc r6, r26 3594a: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 3594c: 80 91 52 07 lds r24, 0x0752 ; 0x800752 35950: 90 91 53 07 lds r25, 0x0753 ; 0x800753 35954: a0 91 54 07 lds r26, 0x0754 ; 0x800754 35958: b0 91 55 07 lds r27, 0x0755 ; 0x800755 3595c: c2 58 subi r28, 0x82 ; 130 3595e: df 4f sbci r29, 0xFF ; 255 35960: c8 80 ld r12, Y 35962: d9 80 ldd r13, Y+1 ; 0x01 35964: ea 80 ldd r14, Y+2 ; 0x02 35966: fb 80 ldd r15, Y+3 ; 0x03 35968: ce 57 subi r28, 0x7E ; 126 3596a: d0 40 sbci r29, 0x00 ; 0 3596c: c8 1a sub r12, r24 3596e: d9 0a sbc r13, r25 35970: ea 0a sbc r14, r26 35972: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 35974: 80 91 56 07 lds r24, 0x0756 ; 0x800756 35978: 90 91 57 07 lds r25, 0x0757 ; 0x800757 3597c: a0 91 58 07 lds r26, 0x0758 ; 0x800758 35980: b0 91 59 07 lds r27, 0x0759 ; 0x800759 35984: ce 57 subi r28, 0x7E ; 126 35986: df 4f sbci r29, 0xFF ; 255 35988: 28 81 ld r18, Y 3598a: 39 81 ldd r19, Y+1 ; 0x01 3598c: 4a 81 ldd r20, Y+2 ; 0x02 3598e: 5b 81 ldd r21, Y+3 ; 0x03 35990: c2 58 subi r28, 0x82 ; 130 35992: d0 40 sbci r29, 0x00 ; 0 35994: 28 1b sub r18, r24 35996: 39 0b sbc r19, r25 35998: 4a 0b sbc r20, r26 3599a: 5b 0b sbc r21, r27 3599c: 29 a7 std Y+41, r18 ; 0x29 3599e: 3a a7 std Y+42, r19 ; 0x2a 359a0: 4b a7 std Y+43, r20 ; 0x2b 359a2: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 359a4: 80 91 5a 07 lds r24, 0x075A ; 0x80075a 359a8: 90 91 5b 07 lds r25, 0x075B ; 0x80075b 359ac: a0 91 5c 07 lds r26, 0x075C ; 0x80075c 359b0: b0 91 5d 07 lds r27, 0x075D ; 0x80075d 359b4: e6 96 adiw r28, 0x36 ; 54 359b6: 2c ad ldd r18, Y+60 ; 0x3c 359b8: 3d ad ldd r19, Y+61 ; 0x3d 359ba: 4e ad ldd r20, Y+62 ; 0x3e 359bc: 5f ad ldd r21, Y+63 ; 0x3f 359be: e6 97 sbiw r28, 0x36 ; 54 359c0: 28 1b sub r18, r24 359c2: 39 0b sbc r19, r25 359c4: 4a 0b sbc r20, r26 359c6: 5b 0b sbc r21, r27 359c8: 2d a7 std Y+45, r18 ; 0x2d 359ca: 3e a7 std Y+46, r19 ; 0x2e 359cc: 4f a7 std Y+47, r20 ; 0x2f 359ce: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 359d0: 41 14 cp r4, r1 359d2: 51 04 cpc r5, r1 359d4: 61 04 cpc r6, r1 359d6: 71 04 cpc r7, r1 359d8: 09 f4 brne .+2 ; 0x359dc 359da: 80 c0 rjmp .+256 ; 0x35adc { if((int)degHotend(active_extruder) 359e0: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 359e4: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 359e8: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 359ec: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 359f0: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 359f4: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 359f8: 62 17 cp r22, r18 359fa: 73 07 cpc r23, r19 359fc: 0c f5 brge .+66 ; 0x35a40 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 359fe: ae 96 adiw r28, 0x2e ; 46 35a00: 8c ad ldd r24, Y+60 ; 0x3c 35a02: 9d ad ldd r25, Y+61 ; 0x3d 35a04: ae ad ldd r26, Y+62 ; 0x3e 35a06: bf ad ldd r27, Y+63 ; 0x3f 35a08: ae 97 sbiw r28, 0x2e ; 46 35a0a: 80 93 5e 07 sts 0x075E, r24 ; 0x80075e 35a0e: 90 93 5f 07 sts 0x075F, r25 ; 0x80075f 35a12: a0 93 60 07 sts 0x0760, r26 ; 0x800760 35a16: b0 93 61 07 sts 0x0761, r27 ; 0x800761 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35a1a: 80 92 da 04 sts 0x04DA, r8 ; 0x8004da 35a1e: 90 92 db 04 sts 0x04DB, r9 ; 0x8004db 35a22: a0 92 dc 04 sts 0x04DC, r10 ; 0x8004dc 35a26: b0 92 dd 04 sts 0x04DD, r11 ; 0x8004dd #endif de = 0; // no difference SERIAL_ECHO_START; 35a2a: 82 ee ldi r24, 0xE2 ; 226 35a2c: 99 ea ldi r25, 0xA9 ; 169 35a2e: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 35a32: 87 e1 ldi r24, 0x17 ; 23 35a34: 91 e7 ldi r25, 0x71 ; 113 35a36: 0e 94 fe 7a call 0xf5fc ; 0xf5fc { 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 35a3a: 41 2c mov r4, r1 35a3c: 51 2c mov r5, r1 35a3e: 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) 35a40: c3 01 movw r24, r6 35a42: b2 01 movw r22, r4 35a44: 77 fe sbrs r7, 7 35a46: 07 c0 rjmp .+14 ; 0x35a56 35a48: 66 27 eor r22, r22 35a4a: 77 27 eor r23, r23 35a4c: cb 01 movw r24, r22 35a4e: 64 19 sub r22, r4 35a50: 75 09 sbc r23, r5 35a52: 86 09 sbc r24, r6 35a54: 97 09 sbc r25, r7 35a56: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 35a5a: 4b 01 movw r8, r22 35a5c: 5c 01 movw r10, r24 35a5e: 20 e0 ldi r18, 0x00 ; 0 35a60: 30 ec ldi r19, 0xC0 ; 192 35a62: 4b ee ldi r20, 0xEB ; 235 35a64: 53 e4 ldi r21, 0x43 ; 67 35a66: 60 91 7c 06 lds r22, 0x067C ; 0x80067c 35a6a: 70 91 7d 06 lds r23, 0x067D ; 0x80067d 35a6e: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 35a72: 90 91 7f 06 lds r25, 0x067F ; 0x80067f 35a76: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 35a7a: 9b 01 movw r18, r22 35a7c: ac 01 movw r20, r24 35a7e: c5 01 movw r24, r10 35a80: b4 01 movw r22, r8 35a82: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 35a86: 18 16 cp r1, r24 35a88: 4c f5 brge .+82 ; 0x35adc { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 35a8a: ae 96 adiw r28, 0x2e ; 46 35a8c: 2c ad ldd r18, Y+60 ; 0x3c 35a8e: 3d ad ldd r19, Y+61 ; 0x3d 35a90: 4e ad ldd r20, Y+62 ; 0x3e 35a92: 5f ad ldd r21, Y+63 ; 0x3f 35a94: ae 97 sbiw r28, 0x2e ; 46 35a96: 20 93 5e 07 sts 0x075E, r18 ; 0x80075e 35a9a: 30 93 5f 07 sts 0x075F, r19 ; 0x80075f 35a9e: 40 93 60 07 sts 0x0760, r20 ; 0x800760 35aa2: 50 93 61 07 sts 0x0761, r21 ; 0x800761 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35aa6: aa 96 adiw r28, 0x2a ; 42 35aa8: ee ad ldd r30, Y+62 ; 0x3e 35aaa: ff ad ldd r31, Y+63 ; 0x3f 35aac: aa 97 sbiw r28, 0x2a ; 42 35aae: 80 81 ld r24, Z 35ab0: 91 81 ldd r25, Z+1 ; 0x01 35ab2: a2 81 ldd r26, Z+2 ; 0x02 35ab4: b3 81 ldd r27, Z+3 ; 0x03 35ab6: 80 93 da 04 sts 0x04DA, r24 ; 0x8004da 35aba: 90 93 db 04 sts 0x04DB, r25 ; 0x8004db 35abe: a0 93 dc 04 sts 0x04DC, r26 ; 0x8004dc 35ac2: b0 93 dd 04 sts 0x04DD, r27 ; 0x8004dd #endif de = 0; // no difference SERIAL_ECHO_START; 35ac6: 82 ee ldi r24, 0xE2 ; 226 35ac8: 99 ea ldi r25, 0xA9 ; 169 35aca: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 35ace: 89 ef ldi r24, 0xF9 ; 249 35ad0: 90 e7 ldi r25, 0x70 ; 112 35ad2: 0e 94 fe 7a call 0xf5fc ; 0xf5fc { 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 35ad6: 41 2c mov r4, r1 35ad8: 51 2c mov r5, r1 35ada: 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); 35adc: 8e e6 ldi r24, 0x6E ; 110 35ade: 82 9d mul r24, r2 35ae0: f0 01 movw r30, r0 35ae2: 83 9d mul r24, r3 35ae4: f0 0d add r31, r0 35ae6: 11 24 eor r1, r1 35ae8: ec 58 subi r30, 0x8C ; 140 35aea: f8 4f sbci r31, 0xF8 ; 248 35aec: d7 01 movw r26, r14 35aee: c6 01 movw r24, r12 35af0: f7 fe sbrs r15, 7 35af2: 07 c0 rjmp .+14 ; 0x35b02 35af4: 88 27 eor r24, r24 35af6: 99 27 eor r25, r25 35af8: dc 01 movw r26, r24 35afa: 8c 19 sub r24, r12 35afc: 9d 09 sbc r25, r13 35afe: ae 09 sbc r26, r14 35b00: bf 09 sbc r27, r15 35b02: 80 83 st Z, r24 35b04: 91 83 std Z+1, r25 ; 0x01 35b06: a2 83 std Z+2, r26 ; 0x02 35b08: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 35b0a: 8e e6 ldi r24, 0x6E ; 110 35b0c: 82 9d mul r24, r2 35b0e: f0 01 movw r30, r0 35b10: 83 9d mul r24, r3 35b12: f0 0d add r31, r0 35b14: 11 24 eor r1, r1 35b16: ec 58 subi r30, 0x8C ; 140 35b18: f8 4f sbci r31, 0xF8 ; 248 35b1a: 89 a5 ldd r24, Y+41 ; 0x29 35b1c: 9a a5 ldd r25, Y+42 ; 0x2a 35b1e: ab a5 ldd r26, Y+43 ; 0x2b 35b20: bc a5 ldd r27, Y+44 ; 0x2c 35b22: b7 ff sbrs r27, 7 35b24: 07 c0 rjmp .+14 ; 0x35b34 35b26: b0 95 com r27 35b28: a0 95 com r26 35b2a: 90 95 com r25 35b2c: 81 95 neg r24 35b2e: 9f 4f sbci r25, 0xFF ; 255 35b30: af 4f sbci r26, 0xFF ; 255 35b32: bf 4f sbci r27, 0xFF ; 255 35b34: 84 83 std Z+4, r24 ; 0x04 35b36: 95 83 std Z+5, r25 ; 0x05 35b38: a6 83 std Z+6, r26 ; 0x06 35b3a: 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); 35b3c: 8e e6 ldi r24, 0x6E ; 110 35b3e: 82 9d mul r24, r2 35b40: f0 01 movw r30, r0 35b42: 83 9d mul r24, r3 35b44: f0 0d add r31, r0 35b46: 11 24 eor r1, r1 35b48: ec 58 subi r30, 0x8C ; 140 35b4a: f8 4f sbci r31, 0xF8 ; 248 35b4c: 8d a5 ldd r24, Y+45 ; 0x2d 35b4e: 9e a5 ldd r25, Y+46 ; 0x2e 35b50: af a5 ldd r26, Y+47 ; 0x2f 35b52: b8 a9 ldd r27, Y+48 ; 0x30 35b54: b7 ff sbrs r27, 7 35b56: 07 c0 rjmp .+14 ; 0x35b66 35b58: b0 95 com r27 35b5a: a0 95 com r26 35b5c: 90 95 com r25 35b5e: 81 95 neg r24 35b60: 9f 4f sbci r25, 0xFF ; 255 35b62: af 4f sbci r26, 0xFF ; 255 35b64: bf 4f sbci r27, 0xFF ; 255 35b66: 80 87 std Z+8, r24 ; 0x08 35b68: 91 87 std Z+9, r25 ; 0x09 35b6a: a2 87 std Z+10, r26 ; 0x0a 35b6c: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 35b6e: b3 01 movw r22, r6 35b70: a2 01 movw r20, r4 35b72: 77 fe sbrs r7, 7 35b74: 07 c0 rjmp .+14 ; 0x35b84 35b76: 44 27 eor r20, r20 35b78: 55 27 eor r21, r21 35b7a: ba 01 movw r22, r20 35b7c: 44 19 sub r20, r4 35b7e: 55 09 sbc r21, r5 35b80: 66 09 sbc r22, r6 35b82: 77 09 sbc r23, r7 35b84: 8e e6 ldi r24, 0x6E ; 110 35b86: 82 9d mul r24, r2 35b88: f0 01 movw r30, r0 35b8a: 83 9d mul r24, r3 35b8c: f0 0d add r31, r0 35b8e: 11 24 eor r1, r1 35b90: ec 58 subi r30, 0x8C ; 140 35b92: f8 4f sbci r31, 0xF8 ; 248 35b94: 44 87 std Z+12, r20 ; 0x0c 35b96: 55 87 std Z+13, r21 ; 0x0d 35b98: 66 87 std Z+14, r22 ; 0x0e 35b9a: 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))); 35b9c: 00 81 ld r16, Z 35b9e: 11 81 ldd r17, Z+1 ; 0x01 35ba0: 22 81 ldd r18, Z+2 ; 0x02 35ba2: 33 81 ldd r19, Z+3 ; 0x03 35ba4: 84 81 ldd r24, Z+4 ; 0x04 35ba6: 95 81 ldd r25, Z+5 ; 0x05 35ba8: a6 81 ldd r26, Z+6 ; 0x06 35baa: b7 81 ldd r27, Z+7 ; 0x07 35bac: 80 17 cp r24, r16 35bae: 91 07 cpc r25, r17 35bb0: a2 07 cpc r26, r18 35bb2: b3 07 cpc r27, r19 35bb4: 14 f4 brge .+4 ; 0x35bba 35bb6: d9 01 movw r26, r18 35bb8: c8 01 movw r24, r16 35bba: ee e6 ldi r30, 0x6E ; 110 35bbc: be 2e mov r11, r30 35bbe: b2 9c mul r11, r2 35bc0: f0 01 movw r30, r0 35bc2: b3 9c mul r11, r3 35bc4: f0 0d add r31, r0 35bc6: 11 24 eor r1, r1 35bc8: ec 58 subi r30, 0x8C ; 140 35bca: f8 4f sbci r31, 0xF8 ; 248 35bcc: 80 84 ldd r8, Z+8 ; 0x08 35bce: 91 84 ldd r9, Z+9 ; 0x09 35bd0: a2 84 ldd r10, Z+10 ; 0x0a 35bd2: b3 84 ldd r11, Z+11 ; 0x0b 35bd4: 88 15 cp r24, r8 35bd6: 99 05 cpc r25, r9 35bd8: aa 05 cpc r26, r10 35bda: bb 05 cpc r27, r11 35bdc: 14 f4 brge .+4 ; 0x35be2 35bde: d5 01 movw r26, r10 35be0: c4 01 movw r24, r8 35be2: 84 17 cp r24, r20 35be4: 95 07 cpc r25, r21 35be6: a6 07 cpc r26, r22 35be8: b7 07 cpc r27, r23 35bea: 14 f4 brge .+4 ; 0x35bf0 35bec: db 01 movw r26, r22 35bee: ca 01 movw r24, r20 35bf0: 4e e6 ldi r20, 0x6E ; 110 35bf2: 42 9d mul r20, r2 35bf4: f0 01 movw r30, r0 35bf6: 43 9d mul r20, r3 35bf8: f0 0d add r31, r0 35bfa: 11 24 eor r1, r1 35bfc: ec 58 subi r30, 0x8C ; 140 35bfe: f8 4f sbci r31, 0xF8 ; 248 35c00: 80 8b std Z+16, r24 ; 0x10 35c02: 91 8b std Z+17, r25 ; 0x11 35c04: a2 8b std Z+18, r26 ; 0x12 35c06: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 35c08: 06 97 sbiw r24, 0x06 ; 6 35c0a: a1 05 cpc r26, r1 35c0c: b1 05 cpc r27, r1 35c0e: 0c f4 brge .+2 ; 0x35c12 35c10: 94 cd rjmp .-1240 ; 0x3573a planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 35c12: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 35c16: df 01 movw r26, r30 35c18: aa 5b subi r26, 0xBA ; 186 35c1a: bf 4f sbci r27, 0xFF ; 255 35c1c: 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); 35c1e: f7 fe sbrs r15, 7 35c20: 02 c0 rjmp .+4 ; 0x35c26 35c22: 0d 94 41 b6 jmp 0x36c82 ; 0x36c82 } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 35c26: 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); 35c28: 89 a5 ldd r24, Y+41 ; 0x29 35c2a: 9a a5 ldd r25, Y+42 ; 0x2a 35c2c: ab a5 ldd r26, Y+43 ; 0x2b 35c2e: bc a5 ldd r27, Y+44 ; 0x2c 35c30: b7 ff sbrs r27, 7 35c32: 0b c0 rjmp .+22 ; 0x35c4a 35c34: 8e e6 ldi r24, 0x6E ; 110 35c36: 82 9d mul r24, r2 35c38: f0 01 movw r30, r0 35c3a: 83 9d mul r24, r3 35c3c: f0 0d add r31, r0 35c3e: 11 24 eor r1, r1 35c40: ec 58 subi r30, 0x8C ; 140 35c42: f8 4f sbci r31, 0xF8 ; 248 35c44: 80 8d ldd r24, Z+24 ; 0x18 35c46: 82 60 ori r24, 0x02 ; 2 35c48: 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); 35c4a: 8d a5 ldd r24, Y+45 ; 0x2d 35c4c: 9e a5 ldd r25, Y+46 ; 0x2e 35c4e: af a5 ldd r26, Y+47 ; 0x2f 35c50: b8 a9 ldd r27, Y+48 ; 0x30 35c52: b7 ff sbrs r27, 7 35c54: 0b c0 rjmp .+22 ; 0x35c6c 35c56: 8e e6 ldi r24, 0x6E ; 110 35c58: 82 9d mul r24, r2 35c5a: f0 01 movw r30, r0 35c5c: 83 9d mul r24, r3 35c5e: f0 0d add r31, r0 35c60: 11 24 eor r1, r1 35c62: ec 58 subi r30, 0x8C ; 140 35c64: f8 4f sbci r31, 0xF8 ; 248 35c66: 80 8d ldd r24, Z+24 ; 0x18 35c68: 84 60 ori r24, 0x04 ; 4 35c6a: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 35c6c: 77 fe sbrs r7, 7 35c6e: 0b c0 rjmp .+22 ; 0x35c86 35c70: 8e e6 ldi r24, 0x6E ; 110 35c72: 82 9d mul r24, r2 35c74: f0 01 movw r30, r0 35c76: 83 9d mul r24, r3 35c78: f0 0d add r31, r0 35c7a: 11 24 eor r1, r1 35c7c: ec 58 subi r30, 0x8C ; 140 35c7e: f8 4f sbci r31, 0xF8 ; 248 35c80: 80 8d ldd r24, Z+24 ; 0x18 35c82: 88 60 ori r24, 0x08 ; 8 35c84: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 35c86: 01 2b or r16, r17 35c88: 02 2b or r16, r18 35c8a: 03 2b or r16, r19 35c8c: 09 f0 breq .+2 ; 0x35c90 35c8e: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 35c90: 8e e6 ldi r24, 0x6E ; 110 35c92: 82 9d mul r24, r2 35c94: f0 01 movw r30, r0 35c96: 83 9d mul r24, r3 35c98: f0 0d add r31, r0 35c9a: 11 24 eor r1, r1 35c9c: ec 58 subi r30, 0x8C ; 140 35c9e: f8 4f sbci r31, 0xF8 ; 248 35ca0: 84 81 ldd r24, Z+4 ; 0x04 35ca2: 95 81 ldd r25, Z+5 ; 0x05 35ca4: a6 81 ldd r26, Z+6 ; 0x06 35ca6: b7 81 ldd r27, Z+7 ; 0x07 35ca8: 89 2b or r24, r25 35caa: 8a 2b or r24, r26 35cac: 8b 2b or r24, r27 35cae: 09 f0 breq .+2 ; 0x35cb2 35cb0: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 35cb2: 8e e6 ldi r24, 0x6E ; 110 35cb4: 82 9d mul r24, r2 35cb6: f0 01 movw r30, r0 35cb8: 83 9d mul r24, r3 35cba: f0 0d add r31, r0 35cbc: 11 24 eor r1, r1 35cbe: ec 58 subi r30, 0x8C ; 140 35cc0: f8 4f sbci r31, 0xF8 ; 248 35cc2: 80 85 ldd r24, Z+8 ; 0x08 35cc4: 91 85 ldd r25, Z+9 ; 0x09 35cc6: a2 85 ldd r26, Z+10 ; 0x0a 35cc8: b3 85 ldd r27, Z+11 ; 0x0b 35cca: 89 2b or r24, r25 35ccc: 8a 2b or r24, r26 35cce: 8b 2b or r24, r27 35cd0: 09 f0 breq .+2 ; 0x35cd4 35cd2: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 35cd4: 8e e6 ldi r24, 0x6E ; 110 35cd6: 82 9d mul r24, r2 35cd8: f0 01 movw r30, r0 35cda: 83 9d mul r24, r3 35cdc: f0 0d add r31, r0 35cde: 11 24 eor r1, r1 35ce0: ec 58 subi r30, 0x8C ; 140 35ce2: f8 4f sbci r31, 0xF8 ; 248 35ce4: 84 85 ldd r24, Z+12 ; 0x0c 35ce6: 95 85 ldd r25, Z+13 ; 0x0d 35ce8: a6 85 ldd r26, Z+14 ; 0x0e 35cea: b7 85 ldd r27, Z+15 ; 0x0f 35cec: 89 2b or r24, r25 35cee: 8a 2b or r24, r26 35cf0: 8b 2b or r24, r27 35cf2: 09 f0 breq .+2 ; 0x35cf6 35cf4: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 35cf6: 8e e6 ldi r24, 0x6E ; 110 35cf8: 82 9d mul r24, r2 35cfa: f0 01 movw r30, r0 35cfc: 83 9d mul r24, r3 35cfe: f0 0d add r31, r0 35d00: 11 24 eor r1, r1 35d02: ec 58 subi r30, 0x8C ; 140 35d04: f8 4f sbci r31, 0xF8 ; 248 35d06: 24 85 ldd r18, Z+12 ; 0x0c 35d08: 35 85 ldd r19, Z+13 ; 0x0d 35d0a: 46 85 ldd r20, Z+14 ; 0x0e 35d0c: 57 85 ldd r21, Z+15 ; 0x0f 35d0e: 2a 96 adiw r28, 0x0a ; 10 35d10: 2c af std Y+60, r18 ; 0x3c 35d12: 3d af std Y+61, r19 ; 0x3d 35d14: 4e af std Y+62, r20 ; 0x3e 35d16: 5f af std Y+63, r21 ; 0x3f 35d18: 2a 97 sbiw r28, 0x0a ; 10 35d1a: 23 2b or r18, r19 35d1c: 24 2b or r18, r20 35d1e: 25 2b or r18, r21 35d20: 09 f0 breq .+2 ; 0x35d24 35d22: b3 c7 rjmp .+3942 ; 0x36c8a { if(feed_rate 35d28: b0 90 ad 06 lds r11, 0x06AD ; 0x8006ad 35d2c: 00 91 ae 06 lds r16, 0x06AE ; 0x8006ae 35d30: 10 91 af 06 lds r17, 0x06AF ; 0x8006af } else { if(feed_rate 35d44: 18 16 cp r1, r24 35d46: 24 f4 brge .+8 ; 0x35d50 35d48: a9 aa std Y+49, r10 ; 0x31 35d4a: b9 ae std Y+57, r11 ; 0x39 35d4c: 0d af std Y+61, r16 ; 0x3d 35d4e: 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]; 35d50: c7 01 movw r24, r14 35d52: b6 01 movw r22, r12 35d54: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 35d58: 20 91 70 06 lds r18, 0x0670 ; 0x800670 35d5c: 30 91 71 06 lds r19, 0x0671 ; 0x800671 35d60: 40 91 72 06 lds r20, 0x0672 ; 0x800672 35d64: 50 91 73 06 lds r21, 0x0673 ; 0x800673 35d68: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 35d6c: 4b 01 movw r8, r22 35d6e: 5c 01 movw r10, r24 35d70: 89 82 std Y+1, r8 ; 0x01 35d72: 9a 82 std Y+2, r9 ; 0x02 35d74: ab 82 std Y+3, r10 ; 0x03 35d76: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 35d78: 69 a5 ldd r22, Y+41 ; 0x29 35d7a: 7a a5 ldd r23, Y+42 ; 0x2a 35d7c: 8b a5 ldd r24, Y+43 ; 0x2b 35d7e: 9c a5 ldd r25, Y+44 ; 0x2c 35d80: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 35d84: 20 91 74 06 lds r18, 0x0674 ; 0x800674 35d88: 30 91 75 06 lds r19, 0x0675 ; 0x800675 35d8c: 40 91 76 06 lds r20, 0x0676 ; 0x800676 35d90: 50 91 77 06 lds r21, 0x0677 ; 0x800677 35d94: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 35d98: 6b 01 movw r12, r22 35d9a: 7c 01 movw r14, r24 35d9c: cd 82 std Y+5, r12 ; 0x05 35d9e: de 82 std Y+6, r13 ; 0x06 35da0: ef 82 std Y+7, r14 ; 0x07 35da2: 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]; 35da4: 6d a5 ldd r22, Y+45 ; 0x2d 35da6: 7e a5 ldd r23, Y+46 ; 0x2e 35da8: 8f a5 ldd r24, Y+47 ; 0x2f 35daa: 98 a9 ldd r25, Y+48 ; 0x30 35dac: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 35db0: 20 91 78 06 lds r18, 0x0678 ; 0x800678 35db4: 30 91 79 06 lds r19, 0x0679 ; 0x800679 35db8: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 35dbc: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 35dc0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 35dc4: 22 96 adiw r28, 0x02 ; 2 35dc6: 6c af std Y+60, r22 ; 0x3c 35dc8: 7d af std Y+61, r23 ; 0x3d 35dca: 8e af std Y+62, r24 ; 0x3e 35dcc: 9f af std Y+63, r25 ; 0x3f 35dce: 22 97 sbiw r28, 0x02 ; 2 35dd0: 69 87 std Y+9, r22 ; 0x09 35dd2: 7a 87 std Y+10, r23 ; 0x0a 35dd4: 8b 87 std Y+11, r24 ; 0x0b 35dd6: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 35dd8: c3 01 movw r24, r6 35dda: b2 01 movw r22, r4 35ddc: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 35de0: 20 91 7c 06 lds r18, 0x067C ; 0x80067c 35de4: 30 91 7d 06 lds r19, 0x067D ; 0x80067d 35de8: 40 91 7e 06 lds r20, 0x067E ; 0x80067e 35dec: 50 91 7f 06 lds r21, 0x067F ; 0x80067f 35df0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 35df4: 26 96 adiw r28, 0x06 ; 6 35df6: 6c af std Y+60, r22 ; 0x3c 35df8: 7d af std Y+61, r23 ; 0x3d 35dfa: 8e af std Y+62, r24 ; 0x3e 35dfc: 9f af std Y+63, r25 ; 0x3f 35dfe: 26 97 sbiw r28, 0x06 ; 6 35e00: 6d 87 std Y+13, r22 ; 0x0d 35e02: 7e 87 std Y+14, r23 ; 0x0e 35e04: 8f 87 std Y+15, r24 ; 0x0f 35e06: 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 ) 35e08: 8e e6 ldi r24, 0x6E ; 110 35e0a: 82 9d mul r24, r2 35e0c: f0 01 movw r30, r0 35e0e: 83 9d mul r24, r3 35e10: f0 0d add r31, r0 35e12: 11 24 eor r1, r1 35e14: ec 58 subi r30, 0x8C ; 140 35e16: f8 4f sbci r31, 0xF8 ; 248 35e18: 80 81 ld r24, Z 35e1a: 91 81 ldd r25, Z+1 ; 0x01 35e1c: a2 81 ldd r26, Z+2 ; 0x02 35e1e: b3 81 ldd r27, Z+3 ; 0x03 35e20: 2e 96 adiw r28, 0x0e ; 14 35e22: 8c af std Y+60, r24 ; 0x3c 35e24: 9d af std Y+61, r25 ; 0x3d 35e26: ae af std Y+62, r26 ; 0x3e 35e28: bf af std Y+63, r27 ; 0x3f 35e2a: 2e 97 sbiw r28, 0x0e ; 14 35e2c: 06 97 sbiw r24, 0x06 ; 6 35e2e: a1 05 cpc r26, r1 35e30: b1 05 cpc r27, r1 35e32: 0c f0 brlt .+2 ; 0x35e36 35e34: 33 c7 rjmp .+3686 ; 0x36c9c 35e36: 84 81 ldd r24, Z+4 ; 0x04 35e38: 95 81 ldd r25, Z+5 ; 0x05 35e3a: a6 81 ldd r26, Z+6 ; 0x06 35e3c: b7 81 ldd r27, Z+7 ; 0x07 35e3e: 06 97 sbiw r24, 0x06 ; 6 35e40: a1 05 cpc r26, r1 35e42: b1 05 cpc r27, r1 35e44: 0c f0 brlt .+2 ; 0x35e48 35e46: 2a c7 rjmp .+3668 ; 0x36c9c 35e48: 80 85 ldd r24, Z+8 ; 0x08 35e4a: 91 85 ldd r25, Z+9 ; 0x09 35e4c: a2 85 ldd r26, Z+10 ; 0x0a 35e4e: b3 85 ldd r27, Z+11 ; 0x0b 35e50: 06 97 sbiw r24, 0x06 ; 6 35e52: a1 05 cpc r26, r1 35e54: b1 05 cpc r27, r1 35e56: 0c f0 brlt .+2 ; 0x35e5a 35e58: 21 c7 rjmp .+3650 ; 0x36c9c { block->millimeters = fabs(delta_mm[E_AXIS]); 35e5a: 26 96 adiw r28, 0x06 ; 6 35e5c: 8c ad ldd r24, Y+60 ; 0x3c 35e5e: 9d ad ldd r25, Y+61 ; 0x3d 35e60: ae ad ldd r26, Y+62 ; 0x3e 35e62: bf ad ldd r27, Y+63 ; 0x3f 35e64: 26 97 sbiw r28, 0x06 ; 6 35e66: bf 77 andi r27, 0x7F ; 127 35e68: 85 a7 std Z+45, r24 ; 0x2d 35e6a: 96 a7 std Z+46, r25 ; 0x2e 35e6c: a7 a7 std Z+47, r26 ; 0x2f 35e6e: 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 35e70: 8e e6 ldi r24, 0x6E ; 110 35e72: 82 9d mul r24, r2 35e74: f0 01 movw r30, r0 35e76: 83 9d mul r24, r3 35e78: f0 0d add r31, r0 35e7a: 11 24 eor r1, r1 35e7c: ec 58 subi r30, 0x8C ; 140 35e7e: f8 4f sbci r31, 0xF8 ; 248 35e80: 45 a4 ldd r4, Z+45 ; 0x2d 35e82: 56 a4 ldd r5, Z+46 ; 0x2e 35e84: 67 a4 ldd r6, Z+47 ; 0x2f 35e86: 70 a8 ldd r7, Z+48 ; 0x30 35e88: a3 01 movw r20, r6 35e8a: 92 01 movw r18, r4 35e8c: 60 e0 ldi r22, 0x00 ; 0 35e8e: 70 e0 ldi r23, 0x00 ; 0 35e90: 80 e8 ldi r24, 0x80 ; 128 35e92: 9f e3 ldi r25, 0x3F ; 63 35e94: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 35e98: 29 a9 ldd r18, Y+49 ; 0x31 35e9a: 39 ad ldd r19, Y+57 ; 0x39 35e9c: 4d ad ldd r20, Y+61 ; 0x3d 35e9e: 5d a9 ldd r21, Y+53 ; 0x35 35ea0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 35ea4: 6b 01 movw r12, r22 35ea6: 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); 35ea8: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 35eac: 90 91 55 0e lds r25, 0x0E55 ; 0x800e55 35eb0: 89 1b sub r24, r25 35eb2: 8f 70 andi r24, 0x0F ; 15 35eb4: 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)) { 35eb6: 82 50 subi r24, 0x02 ; 2 35eb8: 86 30 cpi r24, 0x06 ; 6 35eba: 08 f0 brcs .+2 ; 0x35ebe 35ebc: 40 c0 rjmp .+128 ; 0x35f3e // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 35ebe: a7 01 movw r20, r14 35ec0: 96 01 movw r18, r12 35ec2: 60 e0 ldi r22, 0x00 ; 0 35ec4: 74 e2 ldi r23, 0x24 ; 36 35ec6: 84 e7 ldi r24, 0x74 ; 116 35ec8: 99 e4 ldi r25, 0x49 ; 73 35eca: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 35ece: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 35ed2: 4b 01 movw r8, r22 35ed4: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 35ed6: 80 91 b0 06 lds r24, 0x06B0 ; 0x8006b0 35eda: 90 91 b1 06 lds r25, 0x06B1 ; 0x8006b1 35ede: a0 91 b2 06 lds r26, 0x06B2 ; 0x8006b2 35ee2: b0 91 b3 06 lds r27, 0x06B3 ; 0x8006b3 35ee6: 88 16 cp r8, r24 35ee8: 99 06 cpc r9, r25 35eea: aa 06 cpc r10, r26 35eec: bb 06 cpc r11, r27 35eee: 38 f5 brcc .+78 ; 0x35f3e // 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)); 35ef0: bc 01 movw r22, r24 35ef2: cd 01 movw r24, r26 35ef4: 68 19 sub r22, r8 35ef6: 79 09 sbc r23, r9 35ef8: 8a 09 sbc r24, r10 35efa: 9b 09 sbc r25, r11 35efc: 66 0f add r22, r22 35efe: 77 1f adc r23, r23 35f00: 88 1f adc r24, r24 35f02: 99 1f adc r25, r25 35f04: ad ad ldd r26, Y+61 ; 0x3d 35f06: 2a 2f mov r18, r26 35f08: 30 e0 ldi r19, 0x00 ; 0 35f0a: 50 e0 ldi r21, 0x00 ; 0 35f0c: 40 e0 ldi r20, 0x00 ; 0 35f0e: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 35f12: ca 01 movw r24, r20 35f14: b9 01 movw r22, r18 35f16: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 35f1a: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 35f1e: 68 0d add r22, r8 35f20: 79 1d adc r23, r9 35f22: 8a 1d adc r24, r10 35f24: 9b 1d adc r25, r11 35f26: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 35f2a: 9b 01 movw r18, r22 35f2c: ac 01 movw r20, r24 35f2e: 60 e0 ldi r22, 0x00 ; 0 35f30: 74 e2 ldi r23, 0x24 ; 36 35f32: 84 e7 ldi r24, 0x74 ; 116 35f34: 99 e4 ldi r25, 0x49 ; 73 35f36: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 35f3a: 6b 01 movw r12, r22 35f3c: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 35f3e: a3 01 movw r20, r6 35f40: 92 01 movw r18, r4 35f42: c7 01 movw r24, r14 35f44: b6 01 movw r22, r12 35f46: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 35f4a: 6d ab std Y+53, r22 ; 0x35 35f4c: 7e ab std Y+54, r23 ; 0x36 35f4e: 8f ab std Y+55, r24 ; 0x37 35f50: 98 af std Y+56, r25 ; 0x38 35f52: 8e e6 ldi r24, 0x6E ; 110 35f54: 82 9d mul r24, r2 35f56: 80 01 movw r16, r0 35f58: 83 9d mul r24, r3 35f5a: 10 0d add r17, r0 35f5c: 11 24 eor r1, r1 35f5e: 0c 58 subi r16, 0x8C ; 140 35f60: 18 4f sbci r17, 0xF8 ; 248 35f62: 2d a9 ldd r18, Y+53 ; 0x35 35f64: 3e a9 ldd r19, Y+54 ; 0x36 35f66: 4f a9 ldd r20, Y+55 ; 0x37 35f68: 58 ad ldd r21, Y+56 ; 0x38 35f6a: d8 01 movw r26, r16 35f6c: 91 96 adiw r26, 0x21 ; 33 35f6e: 2d 93 st X+, r18 35f70: 3d 93 st X+, r19 35f72: 4d 93 st X+, r20 35f74: 5c 93 st X, r21 35f76: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 35f78: 50 96 adiw r26, 0x10 ; 16 35f7a: 6d 91 ld r22, X+ 35f7c: 7d 91 ld r23, X+ 35f7e: 8d 91 ld r24, X+ 35f80: 9c 91 ld r25, X 35f82: 53 97 sbiw r26, 0x13 ; 19 35f84: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 35f88: 69 af std Y+57, r22 ; 0x39 35f8a: 7a af std Y+58, r23 ; 0x3a 35f8c: 8b af std Y+59, r24 ; 0x3b 35f8e: 9c af std Y+60, r25 ; 0x3c 35f90: 9b 01 movw r18, r22 35f92: ac 01 movw r20, r24 35f94: c7 01 movw r24, r14 35f96: b6 01 movw r22, r12 35f98: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 35f9c: 0f 94 8f df call 0x3bf1e ; 0x3bf1e 35fa0: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 35fa4: 62 96 adiw r28, 0x12 ; 18 35fa6: 6c af std Y+60, r22 ; 0x3c 35fa8: 7d af std Y+61, r23 ; 0x3d 35faa: 8e af std Y+62, r24 ; 0x3e 35fac: 9f af std Y+63, r25 ; 0x3f 35fae: 62 97 sbiw r28, 0x12 ; 18 35fb0: f8 01 movw r30, r16 35fb2: 66 ab std Z+54, r22 ; 0x36 35fb4: 77 ab std Z+55, r23 ; 0x37 35fb6: 80 af std Z+56, r24 ; 0x38 35fb8: 91 af std Z+57, r25 ; 0x39 35fba: 9e 01 movw r18, r28 35fbc: 2f 5f subi r18, 0xFF ; 255 35fbe: 3f 4f sbci r19, 0xFF ; 255 35fc0: 6c 96 adiw r28, 0x1c ; 28 35fc2: 3f af std Y+63, r19 ; 0x3f 35fc4: 2e af std Y+62, r18 ; 0x3e 35fc6: 6c 97 sbiw r28, 0x1c ; 28 35fc8: ae 01 movw r20, r28 35fca: 4f 5e subi r20, 0xEF ; 239 35fcc: 5f 4f sbci r21, 0xFF ; 255 35fce: a0 96 adiw r28, 0x20 ; 32 35fd0: 5f af std Y+63, r21 ; 0x3f 35fd2: 4e af std Y+62, r20 ; 0x3e 35fd4: a0 97 sbiw r28, 0x20 ; 32 35fd6: 80 91 99 02 lds r24, 0x0299 ; 0x800299 35fda: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 35fde: 9a ab std Y+50, r25 ; 0x32 35fe0: 89 ab std Y+49, r24 ; 0x31 35fe2: 40 96 adiw r24, 0x10 ; 16 35fe4: 6e 96 adiw r28, 0x1e ; 30 35fe6: 9f af std Y+63, r25 ; 0x3f 35fe8: 8e af std Y+62, r24 ; 0x3e 35fea: 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]) 35fec: 68 96 adiw r28, 0x18 ; 24 35fee: 5f af std Y+63, r21 ; 0x3f 35ff0: 4e af std Y+62, r20 ; 0x3e 35ff2: 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 35ff4: 19 a6 std Y+41, r1 ; 0x29 35ff6: 1d a6 std Y+45, r1 ; 0x2d 35ff8: 00 e8 ldi r16, 0x80 ; 128 35ffa: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 35ffc: 6c 96 adiw r28, 0x1c ; 28 35ffe: ae ad ldd r26, Y+62 ; 0x3e 36000: bf ad ldd r27, Y+63 ; 0x3f 36002: 6c 97 sbiw r28, 0x1c ; 28 36004: 2d 91 ld r18, X+ 36006: 3d 91 ld r19, X+ 36008: 4d 91 ld r20, X+ 3600a: 5d 91 ld r21, X+ 3600c: 6c 96 adiw r28, 0x1c ; 28 3600e: bf af std Y+63, r27 ; 0x3f 36010: ae af std Y+62, r26 ; 0x3e 36012: 6c 97 sbiw r28, 0x1c ; 28 36014: c7 01 movw r24, r14 36016: b6 01 movw r22, r12 36018: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3601c: 68 96 adiw r28, 0x18 ; 24 3601e: ee ad ldd r30, Y+62 ; 0x3e 36020: ff ad ldd r31, Y+63 ; 0x3f 36022: 68 97 sbiw r28, 0x18 ; 24 36024: 61 93 st Z+, r22 36026: 71 93 st Z+, r23 36028: 81 93 st Z+, r24 3602a: 91 93 st Z+, r25 3602c: 68 96 adiw r28, 0x18 ; 24 3602e: ff af std Y+63, r31 ; 0x3f 36030: ee af std Y+62, r30 ; 0x3e 36032: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 36034: 4b 01 movw r8, r22 36036: 5c 01 movw r10, r24 36038: e8 94 clt 3603a: b7 f8 bld r11, 7 3603c: a9 a9 ldd r26, Y+49 ; 0x31 3603e: ba a9 ldd r27, Y+50 ; 0x32 36040: 2d 91 ld r18, X+ 36042: 3d 91 ld r19, X+ 36044: 4d 91 ld r20, X+ 36046: 5d 91 ld r21, X+ 36048: ba ab std Y+50, r27 ; 0x32 3604a: a9 ab std Y+49, r26 ; 0x31 3604c: 66 96 adiw r28, 0x16 ; 22 3604e: 2c af std Y+60, r18 ; 0x3c 36050: 3d af std Y+61, r19 ; 0x3d 36052: 4e af std Y+62, r20 ; 0x3e 36054: 5f af std Y+63, r21 ; 0x3f 36056: 66 97 sbiw r28, 0x16 ; 22 36058: c5 01 movw r24, r10 3605a: b4 01 movw r22, r8 3605c: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36060: 18 16 cp r1, r24 36062: b4 f4 brge .+44 ; 0x36090 { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 36064: a5 01 movw r20, r10 36066: 94 01 movw r18, r8 36068: 66 96 adiw r28, 0x16 ; 22 3606a: 6c ad ldd r22, Y+60 ; 0x3c 3606c: 7d ad ldd r23, Y+61 ; 0x3d 3606e: 8e ad ldd r24, Y+62 ; 0x3e 36070: 9f ad ldd r25, Y+63 ; 0x3f 36072: 66 97 sbiw r28, 0x16 ; 22 36074: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36078: 4b 01 movw r8, r22 3607a: 5c 01 movw r10, r24 3607c: 29 a5 ldd r18, Y+41 ; 0x29 3607e: 3d a5 ldd r19, Y+45 ; 0x2d 36080: a8 01 movw r20, r16 36082: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36086: 18 16 cp r1, r24 36088: 1c f0 brlt .+6 ; 0x36090 3608a: 89 a6 std Y+41, r8 ; 0x29 3608c: 9d a6 std Y+45, r9 ; 0x2d 3608e: 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++) 36090: 6e 96 adiw r28, 0x1e ; 30 36092: ee ad ldd r30, Y+62 ; 0x3e 36094: ff ad ldd r31, Y+63 ; 0x3f 36096: 6e 97 sbiw r28, 0x1e ; 30 36098: 29 a9 ldd r18, Y+49 ; 0x31 3609a: 3a a9 ldd r19, Y+50 ; 0x32 3609c: e2 17 cp r30, r18 3609e: f3 07 cpc r31, r19 360a0: 09 f0 breq .+2 ; 0x360a4 360a2: ac cf rjmp .-168 ; 0x35ffc speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 360a4: 20 e0 ldi r18, 0x00 ; 0 360a6: 30 e0 ldi r19, 0x00 ; 0 360a8: 40 e8 ldi r20, 0x80 ; 128 360aa: 5f e3 ldi r21, 0x3F ; 63 360ac: 69 a5 ldd r22, Y+41 ; 0x29 360ae: 7d a5 ldd r23, Y+45 ; 0x2d 360b0: c8 01 movw r24, r16 360b2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 360b6: 87 ff sbrs r24, 7 360b8: 50 c0 rjmp .+160 ; 0x3615a 360ba: a0 96 adiw r28, 0x20 ; 32 360bc: ae ac ldd r10, Y+62 ; 0x3e 360be: bf ac ldd r11, Y+63 ; 0x3f 360c0: a0 97 sbiw r28, 0x20 ; 32 360c2: 30 e1 ldi r19, 0x10 ; 16 360c4: a3 0e add r10, r19 360c6: b1 1c adc r11, r1 360c8: a0 96 adiw r28, 0x20 ; 32 360ca: ce ac ldd r12, Y+62 ; 0x3e 360cc: df ac ldd r13, Y+63 ; 0x3f 360ce: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 360d0: d6 01 movw r26, r12 360d2: 6d 91 ld r22, X+ 360d4: 7d 91 ld r23, X+ 360d6: 8d 91 ld r24, X+ 360d8: 9d 91 ld r25, X+ 360da: 6d 01 movw r12, r26 360dc: 7d 01 movw r14, r26 360de: b4 e0 ldi r27, 0x04 ; 4 360e0: eb 1a sub r14, r27 360e2: f1 08 sbc r15, r1 360e4: 29 a5 ldd r18, Y+41 ; 0x29 360e6: 3d a5 ldd r19, Y+45 ; 0x2d 360e8: a8 01 movw r20, r16 360ea: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 360ee: f7 01 movw r30, r14 360f0: 60 83 st Z, r22 360f2: 71 83 std Z+1, r23 ; 0x01 360f4: 82 83 std Z+2, r24 ; 0x02 360f6: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 360f8: ac 14 cp r10, r12 360fa: bd 04 cpc r11, r13 360fc: 49 f7 brne .-46 ; 0x360d0 { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 360fe: 2e e6 ldi r18, 0x6E ; 110 36100: 22 9d mul r18, r2 36102: c0 01 movw r24, r0 36104: 23 9d mul r18, r3 36106: 90 0d add r25, r0 36108: 11 24 eor r1, r1 3610a: 9c 01 movw r18, r24 3610c: 2c 58 subi r18, 0x8C ; 140 3610e: 38 4f sbci r19, 0xF8 ; 248 36110: 79 01 movw r14, r18 36112: 29 a5 ldd r18, Y+41 ; 0x29 36114: 3d a5 ldd r19, Y+45 ; 0x2d 36116: a8 01 movw r20, r16 36118: 6d a9 ldd r22, Y+53 ; 0x35 3611a: 7e a9 ldd r23, Y+54 ; 0x36 3611c: 8f a9 ldd r24, Y+55 ; 0x37 3611e: 98 ad ldd r25, Y+56 ; 0x38 36120: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36124: d7 01 movw r26, r14 36126: 91 96 adiw r26, 0x21 ; 33 36128: 6d 93 st X+, r22 3612a: 7d 93 st X+, r23 3612c: 8d 93 st X+, r24 3612e: 9c 93 st X, r25 36130: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 36132: 62 96 adiw r28, 0x12 ; 18 36134: 6c ad ldd r22, Y+60 ; 0x3c 36136: 7d ad ldd r23, Y+61 ; 0x3d 36138: 8e ad ldd r24, Y+62 ; 0x3e 3613a: 9f ad ldd r25, Y+63 ; 0x3f 3613c: 62 97 sbiw r28, 0x12 ; 18 3613e: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 36142: 29 a5 ldd r18, Y+41 ; 0x29 36144: 3d a5 ldd r19, Y+45 ; 0x2d 36146: a8 01 movw r20, r16 36148: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3614c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 36150: f7 01 movw r30, r14 36152: 66 ab std Z+54, r22 ; 0x36 36154: 77 ab std Z+55, r23 ; 0x37 36156: 80 af std Z+56, r24 ; 0x38 36158: 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; 3615a: a3 01 movw r20, r6 3615c: 92 01 movw r18, r4 3615e: 69 ad ldd r22, Y+57 ; 0x39 36160: 7a ad ldd r23, Y+58 ; 0x3a 36162: 8b ad ldd r24, Y+59 ; 0x3b 36164: 9c ad ldd r25, Y+60 ; 0x3c 36166: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 3616a: 69 a7 std Y+41, r22 ; 0x29 3616c: 7a a7 std Y+42, r23 ; 0x2a 3616e: 8b a7 std Y+43, r24 ; 0x2b 36170: 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) 36172: 2e 96 adiw r28, 0x0e ; 14 36174: 2c ad ldd r18, Y+60 ; 0x3c 36176: 3d ad ldd r19, Y+61 ; 0x3d 36178: 4e ad ldd r20, Y+62 ; 0x3e 3617a: 5f ad ldd r21, Y+63 ; 0x3f 3617c: 2e 97 sbiw r28, 0x0e ; 14 3617e: 23 2b or r18, r19 36180: 24 2b or r18, r20 36182: 25 2b or r18, r21 36184: 09 f0 breq .+2 ; 0x36188 36186: b9 c5 rjmp .+2930 ; 0x36cfa 36188: 8e e6 ldi r24, 0x6E ; 110 3618a: 82 9d mul r24, r2 3618c: 80 01 movw r16, r0 3618e: 83 9d mul r24, r3 36190: 10 0d add r17, r0 36192: 11 24 eor r1, r1 36194: 0c 58 subi r16, 0x8C ; 140 36196: 18 4f sbci r17, 0xF8 ; 248 36198: f8 01 movw r30, r16 3619a: 84 81 ldd r24, Z+4 ; 0x04 3619c: 95 81 ldd r25, Z+5 ; 0x05 3619e: a6 81 ldd r26, Z+6 ; 0x06 361a0: b7 81 ldd r27, Z+7 ; 0x07 361a2: 89 2b or r24, r25 361a4: 8a 2b or r24, r26 361a6: 8b 2b or r24, r27 361a8: 09 f0 breq .+2 ; 0x361ac 361aa: a7 c5 rjmp .+2894 ; 0x36cfa 361ac: 80 85 ldd r24, Z+8 ; 0x08 361ae: 91 85 ldd r25, Z+9 ; 0x09 361b0: a2 85 ldd r26, Z+10 ; 0x0a 361b2: b3 85 ldd r27, Z+11 ; 0x0b 361b4: 89 2b or r24, r25 361b6: 8a 2b or r24, r26 361b8: 8b 2b or r24, r27 361ba: 09 f0 breq .+2 ; 0x361be 361bc: 9e c5 rjmp .+2876 ; 0x36cfa { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 361be: 20 91 a4 06 lds r18, 0x06A4 ; 0x8006a4 361c2: 30 91 a5 06 lds r19, 0x06A5 ; 0x8006a5 361c6: 40 91 a6 06 lds r20, 0x06A6 ; 0x8006a6 361ca: 50 91 a7 06 lds r21, 0x06A7 ; 0x8006a7 361ce: 69 a5 ldd r22, Y+41 ; 0x29 361d0: 7a a5 ldd r23, Y+42 ; 0x2a 361d2: 8b a5 ldd r24, Y+43 ; 0x2b 361d4: 9c a5 ldd r25, Y+44 ; 0x2c 361d6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 361da: 0f 94 8f df call 0x3bf1e ; 0x3bf1e 361de: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 361e2: 2b 01 movw r4, r22 361e4: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 361e6: f8 01 movw r30, r16 361e8: e4 5b subi r30, 0xB4 ; 180 361ea: ff 4f sbci r31, 0xFF ; 255 361ec: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 361ee: 6a 96 adiw r28, 0x1a ; 26 361f0: 1c ae std Y+60, r1 ; 0x3c 361f2: 1d ae std Y+61, r1 ; 0x3d 361f4: 1e ae std Y+62, r1 ; 0x3e 361f6: 1f ae std Y+63, r1 ; 0x3f 361f8: 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; 361fa: 8e e6 ldi r24, 0x6E ; 110 361fc: 82 9d mul r24, r2 361fe: 80 01 movw r16, r0 36200: 83 9d mul r24, r3 36202: 10 0d add r17, r0 36204: 11 24 eor r1, r1 36206: 0c 58 subi r16, 0x8C ; 140 36208: 18 4f sbci r17, 0xF8 ; 248 3620a: f8 01 movw r30, r16 3620c: ee 5b subi r30, 0xBE ; 190 3620e: ff 4f sbci r31, 0xFF ; 255 36210: 40 82 st Z, r4 36212: 51 82 std Z+1, r5 ; 0x01 36214: 62 82 std Z+2, r6 ; 0x02 36216: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 36218: c3 01 movw r24, r6 3621a: b2 01 movw r22, r4 3621c: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 36220: 6b 01 movw r12, r22 36222: 7c 01 movw r14, r24 36224: 29 a5 ldd r18, Y+41 ; 0x29 36226: 3a a5 ldd r19, Y+42 ; 0x2a 36228: 4b a5 ldd r20, Y+43 ; 0x2b 3622a: 5c a5 ldd r21, Y+44 ; 0x2c 3622c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36230: e2 96 adiw r28, 0x32 ; 50 36232: 6c af std Y+60, r22 ; 0x3c 36234: 7d af std Y+61, r23 ; 0x3d 36236: 8e af std Y+62, r24 ; 0x3e 36238: 9f af std Y+63, r25 ; 0x3f 3623a: e2 97 sbiw r28, 0x32 ; 50 3623c: f8 01 movw r30, r16 3623e: 61 ab std Z+49, r22 ; 0x31 36240: 72 ab std Z+50, r23 ; 0x32 36242: 83 ab std Z+51, r24 ; 0x33 36244: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 36246: 2d eb ldi r18, 0xBD ; 189 36248: 37 e3 ldi r19, 0x37 ; 55 3624a: 46 e0 ldi r20, 0x06 ; 6 3624c: 51 e4 ldi r21, 0x41 ; 65 3624e: c7 01 movw r24, r14 36250: b6 01 movw r22, r12 36252: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36256: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 3625a: d8 01 movw r26, r16 3625c: 54 96 adiw r26, 0x14 ; 20 3625e: 6d 93 st X+, r22 36260: 7d 93 st X+, r23 36262: 8d 93 st X+, r24 36264: 9c 93 st X, r25 36266: 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; 36268: 91 96 adiw r26, 0x21 ; 33 3626a: bc 91 ld r27, X 3626c: 27 96 adiw r28, 0x07 ; 7 3626e: bf af std Y+63, r27 ; 0x3f 36270: 27 97 sbiw r28, 0x07 ; 7 36272: f8 01 movw r30, r16 36274: f2 a1 ldd r31, Z+34 ; 0x22 36276: 2b 96 adiw r28, 0x0b ; 11 36278: ff af std Y+63, r31 ; 0x3f 3627a: 2b 97 sbiw r28, 0x0b ; 11 3627c: d8 01 movw r26, r16 3627e: 93 96 adiw r26, 0x23 ; 35 36280: bc 91 ld r27, X 36282: 2f 96 adiw r28, 0x0f ; 15 36284: bf af std Y+63, r27 ; 0x3f 36286: 2f 97 sbiw r28, 0x0f ; 15 36288: f8 01 movw r30, r16 3628a: f4 a1 ldd r31, Z+36 ; 0x24 3628c: 63 96 adiw r28, 0x13 ; 19 3628e: ff af std Y+63, r31 ; 0x3f 36290: 63 97 sbiw r28, 0x13 ; 19 36292: 24 eb ldi r18, 0xB4 ; 180 36294: 36 e0 ldi r19, 0x06 ; 6 36296: ee 96 adiw r28, 0x3e ; 62 36298: 3f af std Y+63, r19 ; 0x3f 3629a: 2e af std Y+62, r18 ; 0x3e 3629c: ee 97 sbiw r28, 0x3e ; 62 3629e: a0 96 adiw r28, 0x20 ; 32 362a0: 4e ac ldd r4, Y+62 ; 0x3e 362a2: 5f ac ldd r5, Y+63 ; 0x3f 362a4: a0 97 sbiw r28, 0x20 ; 32 362a6: 30 e1 ldi r19, 0x10 ; 16 362a8: 43 0e add r4, r19 362aa: 51 1c adc r5, r1 362ac: 04 eb ldi r16, 0xB4 ; 180 362ae: 16 e0 ldi r17, 0x06 ; 6 362b0: a0 96 adiw r28, 0x20 ; 32 362b2: 6e ac ldd r6, Y+62 ; 0x3e 362b4: 7f ac ldd r7, Y+63 ; 0x3f 362b6: a0 97 sbiw r28, 0x20 ; 32 362b8: 27 96 adiw r28, 0x07 ; 7 362ba: 4f ad ldd r20, Y+63 ; 0x3f 362bc: 27 97 sbiw r28, 0x07 ; 7 362be: 49 a7 std Y+41, r20 ; 0x29 362c0: 2b 96 adiw r28, 0x0b ; 11 362c2: 5f ad ldd r21, Y+63 ; 0x3f 362c4: 2b 97 sbiw r28, 0x0b ; 11 362c6: 5d a7 std Y+45, r21 ; 0x2d 362c8: b9 ab std Y+49, r27 ; 0x31 362ca: f9 af std Y+57, r31 ; 0x39 bool limited = false; 362cc: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 362ce: d3 01 movw r26, r6 362d0: 8d 90 ld r8, X+ 362d2: 9d 90 ld r9, X+ 362d4: ad 90 ld r10, X+ 362d6: bd 90 ld r11, X+ 362d8: 3d 01 movw r6, r26 362da: e8 94 clt 362dc: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 362de: f8 01 movw r30, r16 362e0: c1 90 ld r12, Z+ 362e2: d1 90 ld r13, Z+ 362e4: e1 90 ld r14, Z+ 362e6: f1 90 ld r15, Z+ 362e8: 8f 01 movw r16, r30 362ea: a5 01 movw r20, r10 362ec: 94 01 movw r18, r8 362ee: c7 01 movw r24, r14 362f0: b6 01 movw r22, r12 362f2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 362f6: 87 ff sbrs r24, 7 362f8: 3a c0 rjmp .+116 ; 0x3636e // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 362fa: fd a9 ldd r31, Y+53 ; 0x35 362fc: ff 23 and r31, r31 362fe: 09 f4 brne .+2 ; 0x36302 36300: 7e c6 rjmp .+3324 ; 0x36ffe // 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; 36302: 29 a5 ldd r18, Y+41 ; 0x29 36304: 3d a5 ldd r19, Y+45 ; 0x2d 36306: 49 a9 ldd r20, Y+49 ; 0x31 36308: 59 ad ldd r21, Y+57 ; 0x39 3630a: c5 01 movw r24, r10 3630c: b4 01 movw r22, r8 3630e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36312: 4b 01 movw r8, r22 36314: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 36316: a7 01 movw r20, r14 36318: 96 01 movw r18, r12 3631a: 27 96 adiw r28, 0x07 ; 7 3631c: 6f ad ldd r22, Y+63 ; 0x3f 3631e: 27 97 sbiw r28, 0x07 ; 7 36320: 2b 96 adiw r28, 0x0b ; 11 36322: 7f ad ldd r23, Y+63 ; 0x3f 36324: 2b 97 sbiw r28, 0x0b ; 11 36326: 2f 96 adiw r28, 0x0f ; 15 36328: 8f ad ldd r24, Y+63 ; 0x3f 3632a: 2f 97 sbiw r28, 0x0f ; 15 3632c: 63 96 adiw r28, 0x13 ; 19 3632e: 9f ad ldd r25, Y+63 ; 0x3f 36330: 63 97 sbiw r28, 0x13 ; 19 36332: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36336: 6b 01 movw r12, r22 36338: 7c 01 movw r14, r24 if (jerk > mjerk) { 3633a: ac 01 movw r20, r24 3633c: 9b 01 movw r18, r22 3633e: c5 01 movw r24, r10 36340: b4 01 movw r22, r8 36342: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36346: 18 16 cp r1, r24 36348: 94 f4 brge .+36 ; 0x3636e safe_speed *= mjerk / jerk; 3634a: a5 01 movw r20, r10 3634c: 94 01 movw r18, r8 3634e: c7 01 movw r24, r14 36350: b6 01 movw r22, r12 36352: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36356: 9b 01 movw r18, r22 36358: ac 01 movw r20, r24 3635a: 69 a5 ldd r22, Y+41 ; 0x29 3635c: 7d a5 ldd r23, Y+45 ; 0x2d 3635e: 89 a9 ldd r24, Y+49 ; 0x31 36360: 99 ad ldd r25, Y+57 ; 0x39 36362: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36366: 69 a7 std Y+41, r22 ; 0x29 36368: 7d a7 std Y+45, r23 ; 0x2d 3636a: 89 ab std Y+49, r24 ; 0x31 3636c: 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) { 3636e: 46 14 cp r4, r6 36370: 57 04 cpc r5, r7 36372: 09 f0 breq .+2 ; 0x36376 36374: ac cf rjmp .-168 ; 0x362ce } } } // Reset the block flag. block->flag = 0; 36376: 8e e6 ldi r24, 0x6E ; 110 36378: 82 9d mul r24, r2 3637a: f0 01 movw r30, r0 3637c: 83 9d mul r24, r3 3637e: f0 0d add r31, r0 36380: 11 24 eor r1, r1 36382: ec 58 subi r30, 0x8C ; 140 36384: f8 4f sbci r31, 0xF8 ; 248 36386: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 36388: 80 91 b8 04 lds r24, 0x04B8 ; 0x8004b8 <_ZL23plan_reset_next_e_sched.lto_priv.506> 3638c: 88 23 and r24, r24 3638e: 21 f0 breq .+8 ; 0x36398 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 36390: 80 e1 ldi r24, 0x10 ; 16 36392: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 36394: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_sched.lto_priv.506> 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) { 36398: 3d ad ldd r19, Y+61 ; 0x3d 3639a: 32 30 cpi r19, 0x02 ; 2 3639c: 08 f4 brcc .+2 ; 0x363a0 3639e: 8f c6 rjmp .+3358 ; 0x370be 363a0: 40 91 ba 04 lds r20, 0x04BA ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.507> 363a4: 6b 96 adiw r28, 0x1b ; 27 363a6: 4f af std Y+63, r20 ; 0x3f 363a8: 6b 97 sbiw r28, 0x1b ; 27 363aa: 50 91 bb 04 lds r21, 0x04BB ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.507+0x1> 363ae: 6d 96 adiw r28, 0x1d ; 29 363b0: 5f af std Y+63, r21 ; 0x3f 363b2: 6d 97 sbiw r28, 0x1d ; 29 363b4: 00 91 bc 04 lds r16, 0x04BC ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507+0x2> 363b8: 10 91 bd 04 lds r17, 0x04BD ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x3> 363bc: 27 e1 ldi r18, 0x17 ; 23 363be: 37 eb ldi r19, 0xB7 ; 183 363c0: 41 ed ldi r20, 0xD1 ; 209 363c2: 58 e3 ldi r21, 0x38 ; 56 363c4: 6b 96 adiw r28, 0x1b ; 27 363c6: 6f ad ldd r22, Y+63 ; 0x3f 363c8: 6b 97 sbiw r28, 0x1b ; 27 363ca: 6d 96 adiw r28, 0x1d ; 29 363cc: 7f ad ldd r23, Y+63 ; 0x3f 363ce: 6d 97 sbiw r28, 0x1d ; 29 363d0: c8 01 movw r24, r16 363d2: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 363d6: 18 16 cp r1, r24 363d8: 0c f0 brlt .+2 ; 0x363dc 363da: 71 c6 rjmp .+3298 ; 0x370be // 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); 363dc: 6b 96 adiw r28, 0x1b ; 27 363de: 2f ad ldd r18, Y+63 ; 0x3f 363e0: 6b 97 sbiw r28, 0x1b ; 27 363e2: 6d 96 adiw r28, 0x1d ; 29 363e4: 3f ad ldd r19, Y+63 ; 0x3f 363e6: 6d 97 sbiw r28, 0x1d ; 29 363e8: a8 01 movw r20, r16 363ea: 27 96 adiw r28, 0x07 ; 7 363ec: 6f ad ldd r22, Y+63 ; 0x3f 363ee: 27 97 sbiw r28, 0x07 ; 7 363f0: 2b 96 adiw r28, 0x0b ; 11 363f2: 7f ad ldd r23, Y+63 ; 0x3f 363f4: 2b 97 sbiw r28, 0x0b ; 11 363f6: 2f 96 adiw r28, 0x0f ; 15 363f8: 8f ad ldd r24, Y+63 ; 0x3f 363fa: 2f 97 sbiw r28, 0x0f ; 15 363fc: 63 96 adiw r28, 0x13 ; 19 363fe: 9f ad ldd r25, Y+63 ; 0x3f 36400: 63 97 sbiw r28, 0x13 ; 19 36402: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 36406: 87 ff sbrs r24, 7 36408: 01 c6 rjmp .+3074 ; 0x3700c 3640a: 6b 96 adiw r28, 0x1b ; 27 3640c: 2f ad ldd r18, Y+63 ; 0x3f 3640e: 6b 97 sbiw r28, 0x1b ; 27 36410: 6d 96 adiw r28, 0x1d ; 29 36412: 3f ad ldd r19, Y+63 ; 0x3f 36414: 6d 97 sbiw r28, 0x1d ; 29 36416: a8 01 movw r20, r16 36418: 27 96 adiw r28, 0x07 ; 7 3641a: 6f ad ldd r22, Y+63 ; 0x3f 3641c: 27 97 sbiw r28, 0x07 ; 7 3641e: 2b 96 adiw r28, 0x0b ; 11 36420: 7f ad ldd r23, Y+63 ; 0x3f 36422: 2b 97 sbiw r28, 0x0b ; 11 36424: 2f 96 adiw r28, 0x0f ; 15 36426: 8f ad ldd r24, Y+63 ; 0x3f 36428: 2f 97 sbiw r28, 0x0f ; 15 3642a: 63 96 adiw r28, 0x13 ; 19 3642c: 9f ad ldd r25, Y+63 ; 0x3f 3642e: 63 97 sbiw r28, 0x13 ; 19 36430: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36434: ec 96 adiw r28, 0x3c ; 60 36436: 6c af std Y+60, r22 ; 0x3c 36438: 7d af std Y+61, r23 ; 0x3d 3643a: 8e af std Y+62, r24 ; 0x3e 3643c: 9f af std Y+63, r25 ; 0x3f 3643e: 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; 36440: 27 96 adiw r28, 0x07 ; 7 36442: 8f ad ldd r24, Y+63 ; 0x3f 36444: 27 97 sbiw r28, 0x07 ; 7 36446: 8d af std Y+61, r24 ; 0x3d 36448: 2b 96 adiw r28, 0x0b ; 11 3644a: 9f ad ldd r25, Y+63 ; 0x3f 3644c: 2b 97 sbiw r28, 0x0b ; 11 3644e: 9d ab std Y+53, r25 ; 0x35 36450: 2f 96 adiw r28, 0x0f ; 15 36452: af ad ldd r26, Y+63 ; 0x3f 36454: 2f 97 sbiw r28, 0x0f ; 15 36456: ae af std Y+62, r26 ; 0x3e 36458: 63 96 adiw r28, 0x13 ; 19 3645a: bf ad ldd r27, Y+63 ; 0x3f 3645c: 63 97 sbiw r28, 0x13 ; 19 3645e: 23 96 adiw r28, 0x03 ; 3 36460: bf af std Y+63, r27 ; 0x3f 36462: 23 97 sbiw r28, 0x03 ; 3 36464: 2e eb ldi r18, 0xBE ; 190 36466: 34 e0 ldi r19, 0x04 ; 4 36468: e8 96 adiw r28, 0x38 ; 56 3646a: 3f af std Y+63, r19 ; 0x3f 3646c: 2e af std Y+62, r18 ; 0x3e 3646e: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 36470: 41 2c mov r4, r1 36472: 51 2c mov r5, r1 36474: 30 e8 ldi r19, 0x80 ; 128 36476: 63 2e mov r6, r19 36478: 3f e3 ldi r19, 0x3F ; 63 3647a: 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]; 3647c: e8 96 adiw r28, 0x38 ; 56 3647e: ae ad ldd r26, Y+62 ; 0x3e 36480: bf ad ldd r27, Y+63 ; 0x3f 36482: e8 97 sbiw r28, 0x38 ; 56 36484: 8d 90 ld r8, X+ 36486: 9d 90 ld r9, X+ 36488: ad 90 ld r10, X+ 3648a: bd 90 ld r11, X+ 3648c: e8 96 adiw r28, 0x38 ; 56 3648e: bf af std Y+63, r27 ; 0x3f 36490: ae af std Y+62, r26 ; 0x3e 36492: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 36494: a0 96 adiw r28, 0x20 ; 32 36496: ee ad ldd r30, Y+62 ; 0x3e 36498: ff ad ldd r31, Y+63 ; 0x3f 3649a: a0 97 sbiw r28, 0x20 ; 32 3649c: c1 90 ld r12, Z+ 3649e: d1 90 ld r13, Z+ 364a0: e1 90 ld r14, Z+ 364a2: f1 90 ld r15, Z+ 364a4: a0 96 adiw r28, 0x20 ; 32 364a6: ff af std Y+63, r31 ; 0x3f 364a8: ee af std Y+62, r30 ; 0x3e 364aa: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 364ac: 6b 96 adiw r28, 0x1b ; 27 364ae: 2f ad ldd r18, Y+63 ; 0x3f 364b0: 6b 97 sbiw r28, 0x1b ; 27 364b2: 6d 96 adiw r28, 0x1d ; 29 364b4: 3f ad ldd r19, Y+63 ; 0x3f 364b6: 6d 97 sbiw r28, 0x1d ; 29 364b8: a8 01 movw r20, r16 364ba: 27 96 adiw r28, 0x07 ; 7 364bc: 6f ad ldd r22, Y+63 ; 0x3f 364be: 27 97 sbiw r28, 0x07 ; 7 364c0: 2b 96 adiw r28, 0x0b ; 11 364c2: 7f ad ldd r23, Y+63 ; 0x3f 364c4: 2b 97 sbiw r28, 0x0b ; 11 364c6: 2f 96 adiw r28, 0x0f ; 15 364c8: 8f ad ldd r24, Y+63 ; 0x3f 364ca: 2f 97 sbiw r28, 0x0f ; 15 364cc: 63 96 adiw r28, 0x13 ; 19 364ce: 9f ad ldd r25, Y+63 ; 0x3f 364d0: 63 97 sbiw r28, 0x13 ; 19 364d2: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 364d6: 87 ff sbrs r24, 7 364d8: 0c c0 rjmp .+24 ; 0x364f2 v_exit *= smaller_speed_factor; 364da: ec 96 adiw r28, 0x3c ; 60 364dc: 2c ad ldd r18, Y+60 ; 0x3c 364de: 3d ad ldd r19, Y+61 ; 0x3d 364e0: 4e ad ldd r20, Y+62 ; 0x3e 364e2: 5f ad ldd r21, Y+63 ; 0x3f 364e4: ec 97 sbiw r28, 0x3c ; 60 364e6: c5 01 movw r24, r10 364e8: b4 01 movw r22, r8 364ea: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 364ee: 4b 01 movw r8, r22 364f0: 5c 01 movw r10, r24 if (limited) { 364f2: a2 96 adiw r28, 0x22 ; 34 364f4: ff ad ldd r31, Y+63 ; 0x3f 364f6: a2 97 sbiw r28, 0x22 ; 34 364f8: ff 23 and r31, r31 364fa: 81 f0 breq .+32 ; 0x3651c v_exit *= v_factor; 364fc: a3 01 movw r20, r6 364fe: 92 01 movw r18, r4 36500: c5 01 movw r24, r10 36502: b4 01 movw r22, r8 36504: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36508: 4b 01 movw r8, r22 3650a: 5c 01 movw r10, r24 v_entry *= v_factor; 3650c: a3 01 movw r20, r6 3650e: 92 01 movw r18, r4 36510: c7 01 movw r24, r14 36512: b6 01 movw r22, r12 36514: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36518: 6b 01 movw r12, r22 3651a: 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) ? 3651c: a7 01 movw r20, r14 3651e: 96 01 movw r18, r12 36520: c5 01 movw r24, r10 36522: b4 01 movw r22, r8 36524: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 36528: 20 e0 ldi r18, 0x00 ; 0 3652a: 30 e0 ldi r19, 0x00 ; 0 3652c: 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) ? 3652e: 18 16 cp r1, r24 36530: 0c f0 brlt .+2 ; 0x36534 36532: a3 c5 rjmp .+2886 ; 0x3707a ((v_entry > 0.f || v_exit < 0.f) ? 36534: c7 01 movw r24, r14 36536: b6 01 movw r22, r12 36538: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 3653c: 18 16 cp r1, r24 3653e: 4c f0 brlt .+18 ; 0x36552 36540: 20 e0 ldi r18, 0x00 ; 0 36542: 30 e0 ldi r19, 0x00 ; 0 36544: a9 01 movw r20, r18 36546: c5 01 movw r24, r10 36548: b4 01 movw r22, r8 3654a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3654e: 87 ff sbrs r24, 7 36550: 85 c5 rjmp .+2826 ; 0x3705c 36552: a7 01 movw r20, r14 36554: 96 01 movw r18, r12 36556: c5 01 movw r24, r10 36558: 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) ? 3655a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 3655e: 6b 01 movw r12, r22 36560: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 36562: ee 96 adiw r28, 0x3e ; 62 36564: ae ad ldd r26, Y+62 ; 0x3e 36566: bf ad ldd r27, Y+63 ; 0x3f 36568: ee 97 sbiw r28, 0x3e ; 62 3656a: 8d 90 ld r8, X+ 3656c: 9d 90 ld r9, X+ 3656e: ad 90 ld r10, X+ 36570: bd 90 ld r11, X+ 36572: ee 96 adiw r28, 0x3e ; 62 36574: bf af std Y+63, r27 ; 0x3f 36576: ae af std Y+62, r26 ; 0x3e 36578: ee 97 sbiw r28, 0x3e ; 62 3657a: a5 01 movw r20, r10 3657c: 94 01 movw r18, r8 3657e: c7 01 movw r24, r14 36580: b6 01 movw r22, r12 36582: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36586: 18 16 cp r1, r24 36588: 94 f4 brge .+36 ; 0x365ae v_factor *= cs.max_jerk[axis] / jerk; 3658a: a7 01 movw r20, r14 3658c: 96 01 movw r18, r12 3658e: c5 01 movw r24, r10 36590: b4 01 movw r22, r8 36592: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36596: 9b 01 movw r18, r22 36598: ac 01 movw r20, r24 3659a: c3 01 movw r24, r6 3659c: b2 01 movw r22, r4 3659e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 365a2: 2b 01 movw r4, r22 365a4: 3c 01 movw r6, r24 limited = true; 365a6: b1 e0 ldi r27, 0x01 ; 1 365a8: a2 96 adiw r28, 0x22 ; 34 365aa: bf af std Y+63, r27 ; 0x3f 365ac: 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) { 365ae: ee ec ldi r30, 0xCE ; 206 365b0: f4 e0 ldi r31, 0x04 ; 4 365b2: e8 96 adiw r28, 0x38 ; 56 365b4: 2e ad ldd r18, Y+62 ; 0x3e 365b6: 3f ad ldd r19, Y+63 ; 0x3f 365b8: e8 97 sbiw r28, 0x38 ; 56 365ba: e2 17 cp r30, r18 365bc: f3 07 cpc r31, r19 365be: 09 f0 breq .+2 ; 0x365c2 365c0: 5d cf rjmp .-326 ; 0x3647c if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 365c2: a2 96 adiw r28, 0x22 ; 34 365c4: 3f ad ldd r19, Y+63 ; 0x3f 365c6: a2 97 sbiw r28, 0x22 ; 34 365c8: 33 23 and r19, r19 365ca: 81 f0 breq .+32 ; 0x365ec vmax_junction *= v_factor; 365cc: a3 01 movw r20, r6 365ce: 92 01 movw r18, r4 365d0: 6d ad ldd r22, Y+61 ; 0x3d 365d2: 7d a9 ldd r23, Y+53 ; 0x35 365d4: 8e ad ldd r24, Y+62 ; 0x3e 365d6: 23 96 adiw r28, 0x03 ; 3 365d8: 9f ad ldd r25, Y+63 ; 0x3f 365da: 23 97 sbiw r28, 0x03 ; 3 365dc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 365e0: 6d af std Y+61, r22 ; 0x3d 365e2: 7d ab std Y+53, r23 ; 0x35 365e4: 8e af std Y+62, r24 ; 0x3e 365e6: 23 96 adiw r28, 0x03 ; 3 365e8: 9f af std Y+63, r25 ; 0x3f 365ea: 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; 365ec: 24 ea ldi r18, 0xA4 ; 164 365ee: 30 e7 ldi r19, 0x70 ; 112 365f0: 4d e7 ldi r20, 0x7D ; 125 365f2: 5f e3 ldi r21, 0x3F ; 63 365f4: 6d ad ldd r22, Y+61 ; 0x3d 365f6: 7d a9 ldd r23, Y+53 ; 0x35 365f8: 8e ad ldd r24, Y+62 ; 0x3e 365fa: 23 96 adiw r28, 0x03 ; 3 365fc: 9f ad ldd r25, Y+63 ; 0x3f 365fe: 23 97 sbiw r28, 0x03 ; 3 36600: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36604: 6b 01 movw r12, r22 36606: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 36608: ac 01 movw r20, r24 3660a: 9b 01 movw r18, r22 3660c: 60 91 ea 17 lds r22, 0x17EA ; 0x8017ea 36610: 70 91 eb 17 lds r23, 0x17EB ; 0x8017eb 36614: 80 91 ec 17 lds r24, 0x17EC ; 0x8017ec 36618: 90 91 ed 17 lds r25, 0x17ED ; 0x8017ed 3661c: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36620: 18 16 cp r1, r24 36622: fc f4 brge .+62 ; 0x36662 36624: 29 a5 ldd r18, Y+41 ; 0x29 36626: 3d a5 ldd r19, Y+45 ; 0x2d 36628: 49 a9 ldd r20, Y+49 ; 0x31 3662a: 59 ad ldd r21, Y+57 ; 0x39 3662c: c7 01 movw r24, r14 3662e: b6 01 movw r22, r12 36630: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 36634: 87 ff sbrs r24, 7 36636: 15 c0 rjmp .+42 ; 0x36662 // 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; 36638: 8e e6 ldi r24, 0x6E ; 110 3663a: 82 9d mul r24, r2 3663c: f0 01 movw r30, r0 3663e: 83 9d mul r24, r3 36640: f0 0d add r31, r0 36642: 11 24 eor r1, r1 36644: ec 58 subi r30, 0x8C ; 140 36646: f8 4f sbci r31, 0xF8 ; 248 36648: 85 a9 ldd r24, Z+53 ; 0x35 3664a: 84 60 ori r24, 0x04 ; 4 3664c: 85 ab std Z+53, r24 ; 0x35 3664e: 49 a5 ldd r20, Y+41 ; 0x29 36650: 4d af std Y+61, r20 ; 0x3d 36652: 5d a5 ldd r21, Y+45 ; 0x2d 36654: 5d ab std Y+53, r21 ; 0x35 36656: 89 a9 ldd r24, Y+49 ; 0x31 36658: 8e af std Y+62, r24 ; 0x3e 3665a: 99 ad ldd r25, Y+57 ; 0x39 3665c: 23 96 adiw r28, 0x03 ; 3 3665e: 9f af std Y+63, r25 ; 0x3f 36660: 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; 36662: 8e e6 ldi r24, 0x6E ; 110 36664: 82 9d mul r24, r2 36666: 80 01 movw r16, r0 36668: 83 9d mul r24, r3 3666a: 10 0d add r17, r0 3666c: 11 24 eor r1, r1 3666e: 0c 58 subi r16, 0x8C ; 140 36670: 18 4f sbci r17, 0xF8 ; 248 36672: 8d ad ldd r24, Y+61 ; 0x3d 36674: 9d a9 ldd r25, Y+53 ; 0x35 36676: ae ad ldd r26, Y+62 ; 0x3e 36678: 23 96 adiw r28, 0x03 ; 3 3667a: bf ad ldd r27, Y+63 ; 0x3f 3667c: 23 97 sbiw r28, 0x03 ; 3 3667e: f8 01 movw r30, r16 36680: 81 a7 std Z+41, r24 ; 0x29 36682: 92 a7 std Z+42, r25 ; 0x2a 36684: a3 a7 std Z+43, r26 ; 0x2b 36686: 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); 36688: 29 a5 ldd r18, Y+41 ; 0x29 3668a: 3d a5 ldd r19, Y+45 ; 0x2d 3668c: 49 a9 ldd r20, Y+49 ; 0x31 3668e: 59 ad ldd r21, Y+57 ; 0x39 36690: 69 a5 ldd r22, Y+41 ; 0x29 36692: 7d a5 ldd r23, Y+45 ; 0x2d 36694: 89 a9 ldd r24, Y+49 ; 0x31 36696: 99 ad ldd r25, Y+57 ; 0x39 36698: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3669c: 6b 01 movw r12, r22 3669e: 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); 366a0: e2 96 adiw r28, 0x32 ; 50 366a2: 6c ad ldd r22, Y+60 ; 0x3c 366a4: 7d ad ldd r23, Y+61 ; 0x3d 366a6: 8e ad ldd r24, Y+62 ; 0x3e 366a8: 9f ad ldd r25, Y+63 ; 0x3f 366aa: e2 97 sbiw r28, 0x32 ; 50 366ac: 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); 366ae: 9b 01 movw r18, r22 366b0: ac 01 movw r20, r24 366b2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 366b6: d8 01 movw r26, r16 366b8: 9d 96 adiw r26, 0x2d ; 45 366ba: 2d 91 ld r18, X+ 366bc: 3d 91 ld r19, X+ 366be: 4d 91 ld r20, X+ 366c0: 5c 91 ld r21, X 366c2: d0 97 sbiw r26, 0x30 ; 48 366c4: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 366c8: 9b 01 movw r18, r22 366ca: ac 01 movw r20, r24 366cc: c7 01 movw r24, r14 366ce: b6 01 movw r22, r12 366d0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 366d4: 0f 94 7f e2 call 0x3c4fe ; 0x3c4fe 366d8: d6 2e mov r13, r22 366da: e7 2e mov r14, r23 366dc: 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); 366de: 2d ad ldd r18, Y+61 ; 0x3d 366e0: 3d a9 ldd r19, Y+53 ; 0x35 366e2: 4e ad ldd r20, Y+62 ; 0x3e 366e4: 23 96 adiw r28, 0x03 ; 3 366e6: 5f ad ldd r21, Y+63 ; 0x3f 366e8: 23 97 sbiw r28, 0x03 ; 3 366ea: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 366ee: 18 16 cp r1, r24 366f0: 34 f0 brlt .+12 ; 0x366fe 366f2: dd ae std Y+61, r13 ; 0x3d 366f4: ed aa std Y+53, r14 ; 0x35 366f6: 0e af std Y+62, r16 ; 0x3e 366f8: 23 96 adiw r28, 0x03 ; 3 366fa: 1f af std Y+63, r17 ; 0x3f 366fc: 23 97 sbiw r28, 0x03 ; 3 366fe: 8e e6 ldi r24, 0x6E ; 110 36700: 82 9d mul r24, r2 36702: f0 01 movw r30, r0 36704: 83 9d mul r24, r3 36706: f0 0d add r31, r0 36708: 11 24 eor r1, r1 3670a: ec 58 subi r30, 0x8C ; 140 3670c: f8 4f sbci r31, 0xF8 ; 248 3670e: 8d ad ldd r24, Y+61 ; 0x3d 36710: 9d a9 ldd r25, Y+53 ; 0x35 36712: ae ad ldd r26, Y+62 ; 0x3e 36714: 23 96 adiw r28, 0x03 ; 3 36716: bf ad ldd r27, Y+63 ; 0x3f 36718: 23 97 sbiw r28, 0x03 ; 3 3671a: 85 a3 std Z+37, r24 ; 0x25 3671c: 96 a3 std Z+38, r25 ; 0x26 3671e: a7 a3 std Z+39, r26 ; 0x27 36720: 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; 36722: f5 a8 ldd r15, Z+53 ; 0x35 36724: 2d 2d mov r18, r13 36726: 3e 2d mov r19, r14 36728: a8 01 movw r20, r16 3672a: 27 96 adiw r28, 0x07 ; 7 3672c: 6f ad ldd r22, Y+63 ; 0x3f 3672e: 27 97 sbiw r28, 0x07 ; 7 36730: 2b 96 adiw r28, 0x0b ; 11 36732: 7f ad ldd r23, Y+63 ; 0x3f 36734: 2b 97 sbiw r28, 0x0b ; 11 36736: 2f 96 adiw r28, 0x0f ; 15 36738: 8f ad ldd r24, Y+63 ; 0x3f 3673a: 2f 97 sbiw r28, 0x0f ; 15 3673c: 63 96 adiw r28, 0x13 ; 19 3673e: 9f ad ldd r25, Y+63 ; 0x3f 36740: 63 97 sbiw r28, 0x13 ; 19 36742: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 36746: 18 16 cp r1, r24 36748: 0c f4 brge .+2 ; 0x3674c 3674a: cf c4 rjmp .+2462 ; 0x370ea 3674c: 83 e0 ldi r24, 0x03 ; 3 3674e: 9e e6 ldi r25, 0x6E ; 110 36750: 92 9d mul r25, r2 36752: 80 01 movw r16, r0 36754: 93 9d mul r25, r3 36756: 10 0d add r17, r0 36758: 11 24 eor r1, r1 3675a: 0c 58 subi r16, 0x8C ; 140 3675c: 18 4f sbci r17, 0xF8 ; 248 3675e: f8 2a or r15, r24 36760: f8 01 movw r30, r16 36762: 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[] 36764: 80 e1 ldi r24, 0x10 ; 16 36766: fe 01 movw r30, r28 36768: 71 96 adiw r30, 0x11 ; 17 3676a: ae eb ldi r26, 0xBE ; 190 3676c: b4 e0 ldi r27, 0x04 ; 4 3676e: 01 90 ld r0, Z+ 36770: 0d 92 st X+, r0 36772: 8a 95 dec r24 36774: e1 f7 brne .-8 ; 0x3676e previous_nominal_speed = block->nominal_speed; 36776: 27 96 adiw r28, 0x07 ; 7 36778: 8f ad ldd r24, Y+63 ; 0x3f 3677a: 27 97 sbiw r28, 0x07 ; 7 3677c: 2b 96 adiw r28, 0x0b ; 11 3677e: 9f ad ldd r25, Y+63 ; 0x3f 36780: 2b 97 sbiw r28, 0x0b ; 11 36782: 2f 96 adiw r28, 0x0f ; 15 36784: af ad ldd r26, Y+63 ; 0x3f 36786: 2f 97 sbiw r28, 0x0f ; 15 36788: 63 96 adiw r28, 0x13 ; 19 3678a: bf ad ldd r27, Y+63 ; 0x3f 3678c: 63 97 sbiw r28, 0x13 ; 19 3678e: 80 93 ba 04 sts 0x04BA, r24 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.507> 36792: 90 93 bb 04 sts 0x04BB, r25 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.507+0x1> 36796: a0 93 bc 04 sts 0x04BC, r26 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507+0x2> 3679a: b0 93 bd 04 sts 0x04BD, r27 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x3> previous_safe_speed = safe_speed; 3679e: 89 a5 ldd r24, Y+41 ; 0x29 367a0: 9d a5 ldd r25, Y+45 ; 0x2d 367a2: a9 a9 ldd r26, Y+49 ; 0x31 367a4: b9 ad ldd r27, Y+57 ; 0x39 367a6: 80 93 ea 17 sts 0x17EA, r24 ; 0x8017ea 367aa: 90 93 eb 17 sts 0x17EB, r25 ; 0x8017eb 367ae: a0 93 ec 17 sts 0x17EC, r26 ; 0x8017ec 367b2: b0 93 ed 17 sts 0x17ED, r27 ; 0x8017ed // 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; 367b6: d8 01 movw r26, r16 367b8: d6 96 adiw r26, 0x36 ; 54 367ba: 6d 91 ld r22, X+ 367bc: 7d 91 ld r23, X+ 367be: 8d 91 ld r24, X+ 367c0: 9c 91 ld r25, X 367c2: d9 97 sbiw r26, 0x39 ; 57 367c4: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 367c8: 27 96 adiw r28, 0x07 ; 7 367ca: 2f ad ldd r18, Y+63 ; 0x3f 367cc: 27 97 sbiw r28, 0x07 ; 7 367ce: 2b 96 adiw r28, 0x0b ; 11 367d0: 3f ad ldd r19, Y+63 ; 0x3f 367d2: 2b 97 sbiw r28, 0x0b ; 11 367d4: 2f 96 adiw r28, 0x0f ; 15 367d6: 4f ad ldd r20, Y+63 ; 0x3f 367d8: 2f 97 sbiw r28, 0x0f ; 15 367da: 63 96 adiw r28, 0x13 ; 19 367dc: 5f ad ldd r21, Y+63 ; 0x3f 367de: 63 97 sbiw r28, 0x13 ; 19 367e0: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 367e4: 2b 01 movw r4, r22 367e6: 3c 01 movw r6, r24 367e8: f8 01 movw r30, r16 367ea: e8 5b subi r30, 0xB8 ; 184 367ec: ff 4f sbci r31, 0xFF ; 255 367ee: 40 82 st Z, r4 367f0: 51 82 std Z+1, r5 ; 0x01 367f2: 62 82 std Z+2, r6 ; 0x02 367f4: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 367f6: 34 96 adiw r30, 0x04 ; 4 367f8: 80 81 ld r24, Z 367fa: 88 23 and r24, r24 367fc: 09 f4 brne .+2 ; 0x36800 367fe: 89 c0 rjmp .+274 ; 0x36912 // 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)) 36800: 20 91 05 18 lds r18, 0x1805 ; 0x801805 36804: 30 91 06 18 lds r19, 0x1806 ; 0x801806 36808: 40 91 07 18 lds r20, 0x1807 ; 0x801807 3680c: 50 91 08 18 lds r21, 0x1808 ; 0x801808 36810: 6a 96 adiw r28, 0x1a ; 26 36812: 6c ad ldd r22, Y+60 ; 0x3c 36814: 7d ad ldd r23, Y+61 ; 0x3d 36816: 8e ad ldd r24, Y+62 ; 0x3e 36818: 9f ad ldd r25, Y+63 ; 0x3f 3681a: 6a 97 sbiw r28, 0x1a ; 26 3681c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36820: 4b 01 movw r8, r22 36822: 5c 01 movw r10, r24 36824: c0 90 7c 06 lds r12, 0x067C ; 0x80067c 36828: d0 90 7d 06 lds r13, 0x067D ; 0x80067d 3682c: e0 90 7e 06 lds r14, 0x067E ; 0x80067e 36830: f0 90 7f 06 lds r15, 0x067F ; 0x80067f block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 36834: 0c 5a subi r16, 0xAC ; 172 36836: 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)) 36838: a7 01 movw r20, r14 3683a: 96 01 movw r18, r12 3683c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 36840: a3 01 movw r20, r6 36842: 92 01 movw r18, r4 36844: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36848: f8 01 movw r30, r16 3684a: 60 83 st Z, r22 3684c: 71 83 std Z+1, r23 ; 0x01 3684e: 82 83 std Z+2, r24 ; 0x02 36850: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 36852: 20 e0 ldi r18, 0x00 ; 0 36854: 30 e0 ldi r19, 0x00 ; 0 36856: a9 01 movw r20, r18 36858: 6a 96 adiw r28, 0x1a ; 26 3685a: 6c ad ldd r22, Y+60 ; 0x3c 3685c: 7d ad ldd r23, Y+61 ; 0x3d 3685e: 8e ad ldd r24, Y+62 ; 0x3e 36860: 9f ad ldd r25, Y+63 ; 0x3f 36862: 6a 97 sbiw r28, 0x1a ; 26 36864: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36868: 18 16 cp r1, r24 3686a: 0c f0 brlt .+2 ; 0x3686e 3686c: 40 c4 rjmp .+2176 ; 0x370ee advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 3686e: a5 01 movw r20, r10 36870: 94 01 movw r18, r8 36872: e2 96 adiw r28, 0x32 ; 50 36874: 6c ad ldd r22, Y+60 ; 0x3c 36876: 7d ad ldd r23, Y+61 ; 0x3d 36878: 8e ad ldd r24, Y+62 ; 0x3e 3687a: 9f ad ldd r25, Y+63 ; 0x3f 3687c: e2 97 sbiw r28, 0x32 ; 50 3687e: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36882: a7 01 movw r20, r14 36884: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 36886: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3688a: 6b 01 movw r12, r22 3688c: 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; 3688e: 20 e0 ldi r18, 0x00 ; 0 36890: 30 e4 ldi r19, 0x40 ; 64 36892: 4c e1 ldi r20, 0x1C ; 28 36894: 57 e4 ldi r21, 0x47 ; 71 36896: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 3689a: 18 16 cp r1, r24 3689c: 3c f4 brge .+14 ; 0x368ac 3689e: c1 2c mov r12, r1 368a0: 20 e4 ldi r18, 0x40 ; 64 368a2: d2 2e mov r13, r18 368a4: 2c e1 ldi r18, 0x1C ; 28 368a6: e2 2e mov r14, r18 368a8: 27 e4 ldi r18, 0x47 ; 71 368aa: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 368ac: a7 01 movw r20, r14 368ae: 96 01 movw r18, r12 368b0: 60 e0 ldi r22, 0x00 ; 0 368b2: 74 e2 ldi r23, 0x24 ; 36 368b4: 84 ef ldi r24, 0xF4 ; 244 368b6: 99 e4 ldi r25, 0x49 ; 73 368b8: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 368bc: 4b 01 movw r8, r22 368be: 5c 01 movw r10, r24 if (advance_speed > 20000) { 368c0: 20 e0 ldi r18, 0x00 ; 0 368c2: 30 e4 ldi r19, 0x40 ; 64 368c4: 4c e9 ldi r20, 0x9C ; 156 368c6: 56 e4 ldi r21, 0x46 ; 70 368c8: c7 01 movw r24, r14 368ca: b6 01 movw r22, r12 368cc: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 368d0: 18 16 cp r1, r24 368d2: 0c f0 brlt .+2 ; 0x368d6 368d4: 17 c4 rjmp .+2094 ; 0x37104 block->advance_rate = advance_rate * 4; 368d6: 8e e6 ldi r24, 0x6E ; 110 368d8: 82 9d mul r24, r2 368da: 80 01 movw r16, r0 368dc: 83 9d mul r24, r3 368de: 10 0d add r17, r0 368e0: 11 24 eor r1, r1 368e2: 0c 58 subi r16, 0x8C ; 140 368e4: 18 4f sbci r17, 0xF8 ; 248 368e6: 78 01 movw r14, r16 368e8: fd e4 ldi r31, 0x4D ; 77 368ea: ef 0e add r14, r31 368ec: f1 1c adc r15, r1 368ee: 20 e0 ldi r18, 0x00 ; 0 368f0: 30 e0 ldi r19, 0x00 ; 0 368f2: 40 e8 ldi r20, 0x80 ; 128 368f4: 50 e4 ldi r21, 0x40 ; 64 368f6: c5 01 movw r24, r10 368f8: b4 01 movw r22, r8 368fa: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 368fe: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 36902: d7 01 movw r26, r14 36904: 6d 93 st X+, r22 36906: 7c 93 st X, r23 block->advance_step_loops = 4; 36908: f8 01 movw r30, r16 3690a: ed 5a subi r30, 0xAD ; 173 3690c: ff 4f sbci r31, 0xFF ; 255 3690e: 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; 36910: 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); 36912: 09 a5 ldd r16, Y+41 ; 0x29 36914: 1d a5 ldd r17, Y+45 ; 0x2d 36916: 29 a9 ldd r18, Y+49 ; 0x31 36918: 39 ad ldd r19, Y+57 ; 0x39 3691a: 4d ad ldd r20, Y+61 ; 0x3d 3691c: 5d a9 ldd r21, Y+53 ; 0x35 3691e: 6e ad ldd r22, Y+62 ; 0x3e 36920: 23 96 adiw r28, 0x03 ; 3 36922: 7f ad ldd r23, Y+63 ; 0x3f 36924: 23 97 sbiw r28, 0x03 ; 3 36926: a4 96 adiw r28, 0x24 ; 36 36928: 8e ad ldd r24, Y+62 ; 0x3e 3692a: 9f ad ldd r25, Y+63 ; 0x3f 3692c: a4 97 sbiw r28, 0x24 ; 36 3692e: 8c 58 subi r24, 0x8C ; 140 36930: 98 4f sbci r25, 0xF8 ; 248 36932: 0f 94 7d a1 call 0x342fa ; 0x342fa if (block->step_event_count.wide <= 32767) 36936: 8e e6 ldi r24, 0x6E ; 110 36938: 82 9d mul r24, r2 3693a: f0 01 movw r30, r0 3693c: 83 9d mul r24, r3 3693e: f0 0d add r31, r0 36940: 11 24 eor r1, r1 36942: ec 58 subi r30, 0x8C ; 140 36944: f8 4f sbci r31, 0xF8 ; 248 36946: 80 89 ldd r24, Z+16 ; 0x10 36948: 91 89 ldd r25, Z+17 ; 0x11 3694a: a2 89 ldd r26, Z+18 ; 0x12 3694c: b3 89 ldd r27, Z+19 ; 0x13 3694e: 81 15 cp r24, r1 36950: 90 48 sbci r25, 0x80 ; 128 36952: a1 05 cpc r26, r1 36954: b1 05 cpc r27, r1 36956: 18 f4 brcc .+6 ; 0x3695e block->flag |= BLOCK_FLAG_DDA_LOWRES; 36958: 85 a9 ldd r24, Z+53 ; 0x35 3695a: 88 60 ori r24, 0x08 ; 8 3695c: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 3695e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 36960: 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; 36962: 90 91 5b 0e lds r25, 0x0E5B ; 0x800e5b 36966: 91 11 cpse r25, r1 36968: 93 c4 rjmp .+2342 ; 0x37290 block_buffer_head = next_buffer_head; 3696a: a1 96 adiw r28, 0x21 ; 33 3696c: 3f ad ldd r19, Y+63 ; 0x3f 3696e: a1 97 sbiw r28, 0x21 ; 33 36970: 30 93 54 0e sts 0x0E54, r19 ; 0x800e54 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 36974: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 36976: c2 58 subi r28, 0x82 ; 130 36978: df 4f sbci r29, 0xFF ; 255 3697a: 88 81 ld r24, Y 3697c: 99 81 ldd r25, Y+1 ; 0x01 3697e: aa 81 ldd r26, Y+2 ; 0x02 36980: bb 81 ldd r27, Y+3 ; 0x03 36982: ce 57 subi r28, 0x7E ; 126 36984: d0 40 sbci r29, 0x00 ; 0 36986: 80 93 52 07 sts 0x0752, r24 ; 0x800752 3698a: 90 93 53 07 sts 0x0753, r25 ; 0x800753 3698e: a0 93 54 07 sts 0x0754, r26 ; 0x800754 36992: b0 93 55 07 sts 0x0755, r27 ; 0x800755 36996: ce 57 subi r28, 0x7E ; 126 36998: df 4f sbci r29, 0xFF ; 255 3699a: 28 81 ld r18, Y 3699c: 39 81 ldd r19, Y+1 ; 0x01 3699e: 4a 81 ldd r20, Y+2 ; 0x02 369a0: 5b 81 ldd r21, Y+3 ; 0x03 369a2: c2 58 subi r28, 0x82 ; 130 369a4: d0 40 sbci r29, 0x00 ; 0 369a6: 20 93 56 07 sts 0x0756, r18 ; 0x800756 369aa: 30 93 57 07 sts 0x0757, r19 ; 0x800757 369ae: 40 93 58 07 sts 0x0758, r20 ; 0x800758 369b2: 50 93 59 07 sts 0x0759, r21 ; 0x800759 369b6: e6 96 adiw r28, 0x36 ; 54 369b8: 8c ad ldd r24, Y+60 ; 0x3c 369ba: 9d ad ldd r25, Y+61 ; 0x3d 369bc: ae ad ldd r26, Y+62 ; 0x3e 369be: bf ad ldd r27, Y+63 ; 0x3f 369c0: e6 97 sbiw r28, 0x36 ; 54 369c2: 80 93 5a 07 sts 0x075A, r24 ; 0x80075a 369c6: 90 93 5b 07 sts 0x075B, r25 ; 0x80075b 369ca: a0 93 5c 07 sts 0x075C, r26 ; 0x80075c 369ce: b0 93 5d 07 sts 0x075D, r27 ; 0x80075d 369d2: ae 96 adiw r28, 0x2e ; 46 369d4: 2c ad ldd r18, Y+60 ; 0x3c 369d6: 3d ad ldd r19, Y+61 ; 0x3d 369d8: 4e ad ldd r20, Y+62 ; 0x3e 369da: 5f ad ldd r21, Y+63 ; 0x3f 369dc: ae 97 sbiw r28, 0x2e ; 46 369de: 20 93 5e 07 sts 0x075E, r18 ; 0x80075e 369e2: 30 93 5f 07 sts 0x075F, r19 ; 0x80075f 369e6: 40 93 60 07 sts 0x0760, r20 ; 0x800760 369ea: 50 93 61 07 sts 0x0761, r21 ; 0x800761 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 369ee: 89 a1 ldd r24, Y+33 ; 0x21 369f0: 9a a1 ldd r25, Y+34 ; 0x22 369f2: ab a1 ldd r26, Y+35 ; 0x23 369f4: bc a1 ldd r27, Y+36 ; 0x24 369f6: 80 93 ce 04 sts 0x04CE, r24 ; 0x8004ce 369fa: 90 93 cf 04 sts 0x04CF, r25 ; 0x8004cf 369fe: a0 93 d0 04 sts 0x04D0, r26 ; 0x8004d0 36a02: b0 93 d1 04 sts 0x04D1, r27 ; 0x8004d1 position_float[Y_AXIS] = y; 36a06: 8d a1 ldd r24, Y+37 ; 0x25 36a08: 9e a1 ldd r25, Y+38 ; 0x26 36a0a: af a1 ldd r26, Y+39 ; 0x27 36a0c: b8 a5 ldd r27, Y+40 ; 0x28 36a0e: 80 93 d2 04 sts 0x04D2, r24 ; 0x8004d2 36a12: 90 93 d3 04 sts 0x04D3, r25 ; 0x8004d3 36a16: a0 93 d4 04 sts 0x04D4, r26 ; 0x8004d4 36a1a: b0 93 d5 04 sts 0x04D5, r27 ; 0x8004d5 position_float[Z_AXIS] = z; 36a1e: a8 96 adiw r28, 0x28 ; 40 36a20: 8c ad ldd r24, Y+60 ; 0x3c 36a22: 9d ad ldd r25, Y+61 ; 0x3d 36a24: ae ad ldd r26, Y+62 ; 0x3e 36a26: bf ad ldd r27, Y+63 ; 0x3f 36a28: a8 97 sbiw r28, 0x28 ; 40 36a2a: 80 93 d6 04 sts 0x04D6, r24 ; 0x8004d6 36a2e: 90 93 d7 04 sts 0x04D7, r25 ; 0x8004d7 36a32: a0 93 d8 04 sts 0x04D8, r26 ; 0x8004d8 36a36: b0 93 d9 04 sts 0x04D9, r27 ; 0x8004d9 position_float[E_AXIS] = e; 36a3a: aa 96 adiw r28, 0x2a ; 42 36a3c: ee ad ldd r30, Y+62 ; 0x3e 36a3e: ff ad ldd r31, Y+63 ; 0x3f 36a40: aa 97 sbiw r28, 0x2a ; 42 36a42: 80 81 ld r24, Z 36a44: 91 81 ldd r25, Z+1 ; 0x01 36a46: a2 81 ldd r26, Z+2 ; 0x02 36a48: b3 81 ldd r27, Z+3 ; 0x03 36a4a: 80 93 da 04 sts 0x04DA, r24 ; 0x8004da 36a4e: 90 93 db 04 sts 0x04DB, r25 ; 0x8004db 36a52: a0 93 dc 04 sts 0x04DC, r26 ; 0x8004dc 36a56: b0 93 dd 04 sts 0x04DD, r27 ; 0x8004dd 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; 36a5a: f0 90 55 0e lds r15, 0x0E55 ; 0x800e55 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); 36a5e: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 36a62: 8f 19 sub r24, r15 36a64: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 36a66: 83 30 cpi r24, 0x03 ; 3 36a68: 40 f1 brcs .+80 ; 0x36aba // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 36a6a: 10 91 54 0e lds r17, 0x0E54 ; 0x800e54 } // 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) 36a6e: 11 11 cpse r17, r1 36a70: 01 c0 rjmp .+2 ; 0x36a74 block_index = BLOCK_BUFFER_SIZE; 36a72: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36a74: 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; 36a76: fe e6 ldi r31, 0x6E ; 110 36a78: 1f 9f mul r17, r31 36a7a: c0 01 movw r24, r0 36a7c: 11 24 eor r1, r1 36a7e: 9c 01 movw r18, r24 36a80: 2c 58 subi r18, 0x8C ; 140 36a82: 38 4f sbci r19, 0xF8 ; 248 36a84: 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) 36a86: 11 11 cpse r17, r1 36a88: 01 c0 rjmp .+2 ; 0x36a8c block_index = BLOCK_BUFFER_SIZE; 36a8a: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36a8c: 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)); 36a8e: 3e e6 ldi r19, 0x6E ; 110 36a90: 13 9f mul r17, r19 36a92: c0 01 movw r24, r0 36a94: 11 24 eor r1, r1 36a96: ac 01 movw r20, r24 36a98: 4c 58 subi r20, 0x8C ; 140 36a9a: 58 4f sbci r21, 0xF8 ; 248 36a9c: 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)); 36a9e: 9e e6 ldi r25, 0x6E ; 110 36aa0: 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) { 36aa2: f1 16 cp r15, r17 36aa4: 69 f0 breq .+26 ; 0x36ac0 if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 36aa6: d6 01 movw r26, r12 36aa8: d5 96 adiw r26, 0x35 ; 53 36aaa: 0c 91 ld r16, X 36aac: 02 ff sbrs r16, 2 36aae: 7e c3 rjmp .+1788 ; 0x371ac // 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); 36ab0: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 36ab4: 81 1b sub r24, r17 36ab6: 8f 70 andi r24, 0x0F ; 15 36ab8: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 36aba: 82 30 cpi r24, 0x02 ; 2 36abc: 08 f4 brcc .+2 ; 0x36ac0 36abe: a3 c0 rjmp .+326 ; 0x36c06 // 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; 36ac0: 3e e6 ldi r19, 0x6E ; 110 36ac2: f3 9e mul r15, r19 36ac4: c0 01 movw r24, r0 36ac6: 11 24 eor r1, r1 36ac8: ac 01 movw r20, r24 36aca: 4c 58 subi r20, 0x8C ; 140 36acc: 58 4f sbci r21, 0xF8 ; 248 36ace: 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) 36ad0: f3 94 inc r15 36ad2: 50 e1 ldi r21, 0x10 ; 16 36ad4: f5 12 cpse r15, r21 36ad6: 01 c0 rjmp .+2 ; 0x36ada block_index = 0; 36ad8: 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)); 36ada: ae e6 ldi r26, 0x6E ; 110 36adc: fa 9e mul r15, r26 36ade: c0 01 movw r24, r0 36ae0: 11 24 eor r1, r1 36ae2: fc 01 movw r30, r24 36ae4: ec 58 subi r30, 0x8C ; 140 36ae6: f8 4f sbci r31, 0xF8 ; 248 36ae8: 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)); 36aea: 8e e6 ldi r24, 0x6E ; 110 36aec: 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) { 36aee: d5 01 movw r26, r10 36af0: d5 96 adiw r26, 0x35 ; 53 36af2: 8c 91 ld r24, X 36af4: d5 97 sbiw r26, 0x35 ; 53 36af6: 81 fd sbrc r24, 1 36af8: 5a c0 rjmp .+180 ; 0x36bae 36afa: 95 96 adiw r26, 0x25 ; 37 36afc: 4d 90 ld r4, X+ 36afe: 5d 90 ld r5, X+ 36b00: 6d 90 ld r6, X+ 36b02: 7c 90 ld r7, X 36b04: 98 97 sbiw r26, 0x28 ; 40 36b06: f6 01 movw r30, r12 36b08: 95 a0 ldd r9, Z+37 ; 0x25 36b0a: e6 a0 ldd r14, Z+38 ; 0x26 36b0c: 07 a1 ldd r16, Z+39 ; 0x27 36b0e: 10 a5 ldd r17, Z+40 ; 0x28 36b10: 29 2d mov r18, r9 36b12: 3e 2d mov r19, r14 36b14: a8 01 movw r20, r16 36b16: c3 01 movw r24, r6 36b18: b2 01 movw r22, r4 36b1a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 36b1e: 87 ff sbrs r24, 7 36b20: 46 c0 rjmp .+140 ; 0x36bae // 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); 36b22: a3 01 movw r20, r6 36b24: 92 01 movw r18, r4 36b26: c3 01 movw r24, r6 36b28: b2 01 movw r22, r4 36b2a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36b2e: 2b 01 movw r4, r22 36b30: 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)); 36b32: d5 01 movw r26, r10 36b34: d1 96 adiw r26, 0x31 ; 49 36b36: 6d 91 ld r22, X+ 36b38: 7d 91 ld r23, X+ 36b3a: 8d 91 ld r24, X+ 36b3c: 9c 91 ld r25, X 36b3e: d4 97 sbiw r26, 0x34 ; 52 36b40: 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); 36b42: 9b 01 movw r18, r22 36b44: ac 01 movw r20, r24 36b46: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 36b4a: f5 01 movw r30, r10 36b4c: 25 a5 ldd r18, Z+45 ; 0x2d 36b4e: 36 a5 ldd r19, Z+46 ; 0x2e 36b50: 47 a5 ldd r20, Z+47 ; 0x2f 36b52: 50 a9 ldd r21, Z+48 ; 0x30 36b54: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36b58: 9b 01 movw r18, r22 36b5a: ac 01 movw r20, r24 36b5c: c3 01 movw r24, r6 36b5e: b2 01 movw r22, r4 36b60: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 36b64: 0f 94 7f e2 call 0x3c4fe ; 0x3c4fe 36b68: 2b 01 movw r4, r22 36b6a: 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)); 36b6c: 9b 01 movw r18, r22 36b6e: ac 01 movw r20, r24 36b70: 69 2d mov r22, r9 36b72: 7e 2d mov r23, r14 36b74: c8 01 movw r24, r16 36b76: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 36b7a: 87 ff sbrs r24, 7 36b7c: 03 c0 rjmp .+6 ; 0x36b84 36b7e: 49 2c mov r4, r9 36b80: 5e 2c mov r5, r14 36b82: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 36b84: 92 01 movw r18, r4 36b86: a3 01 movw r20, r6 36b88: 69 2d mov r22, r9 36b8a: 7e 2d mov r23, r14 36b8c: c8 01 movw r24, r16 36b8e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 36b92: 88 23 and r24, r24 36b94: 61 f0 breq .+24 ; 0x36bae 36b96: d6 01 movw r26, r12 36b98: d5 96 adiw r26, 0x35 ; 53 36b9a: 2c 91 ld r18, X current->entry_speed = entry_speed; 36b9c: c2 01 movw r24, r4 36b9e: d3 01 movw r26, r6 36ba0: f6 01 movw r30, r12 36ba2: 85 a3 std Z+37, r24 ; 0x25 36ba4: 96 a3 std Z+38, r25 ; 0x26 36ba6: a7 a3 std Z+39, r26 ; 0x27 36ba8: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 36baa: 21 60 ori r18, 0x01 ; 1 36bac: 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) { 36bae: d5 01 movw r26, r10 36bb0: d5 96 adiw r26, 0x35 ; 53 36bb2: 8c 91 ld r24, X 36bb4: d5 97 sbiw r26, 0x35 ; 53 36bb6: f6 01 movw r30, r12 36bb8: 95 a9 ldd r25, Z+53 ; 0x35 36bba: 89 2b or r24, r25 36bbc: 80 ff sbrs r24, 0 36bbe: 14 c0 rjmp .+40 ; 0x36be8 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 36bc0: 05 a1 ldd r16, Z+37 ; 0x25 36bc2: 16 a1 ldd r17, Z+38 ; 0x26 36bc4: 27 a1 ldd r18, Z+39 ; 0x27 36bc6: 30 a5 ldd r19, Z+40 ; 0x28 36bc8: 95 96 adiw r26, 0x25 ; 37 36bca: 4d 91 ld r20, X+ 36bcc: 5d 91 ld r21, X+ 36bce: 6d 91 ld r22, X+ 36bd0: 7c 91 ld r23, X 36bd2: 98 97 sbiw r26, 0x28 ; 40 36bd4: c5 01 movw r24, r10 36bd6: 0f 94 7d a1 call 0x342fa ; 0x342fa // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 36bda: d5 01 movw r26, r10 36bdc: d5 96 adiw r26, 0x35 ; 53 36bde: 8c 91 ld r24, X 36be0: d5 97 sbiw r26, 0x35 ; 53 36be2: 8e 7f andi r24, 0xFE ; 254 36be4: d5 96 adiw r26, 0x35 ; 53 36be6: 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) 36be8: f3 94 inc r15 36bea: b0 e1 ldi r27, 0x10 ; 16 36bec: fb 12 cpse r15, r27 36bee: 01 c0 rjmp .+2 ; 0x36bf2 block_index = 0; 36bf0: 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)); 36bf2: f8 9c mul r15, r8 36bf4: c0 01 movw r24, r0 36bf6: 11 24 eor r1, r1 36bf8: 8c 58 subi r24, 0x8C ; 140 36bfa: 98 4f sbci r25, 0xF8 ; 248 } while (block_index != block_buffer_head); 36bfc: 20 91 54 0e lds r18, 0x0E54 ; 0x800e54 // 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; 36c00: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 36c02: f2 12 cpse r15, r18 36c04: 43 c3 rjmp .+1670 ; 0x3728c } // 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); 36c06: 80 91 54 0e lds r24, 0x0E54 ; 0x800e54 } // 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) 36c0a: 81 11 cpse r24, r1 36c0c: 01 c0 rjmp .+2 ; 0x36c10 block_index = BLOCK_BUFFER_SIZE; 36c0e: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 36c10: 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); 36c12: ee e6 ldi r30, 0x6E ; 110 36c14: 8e 9f mul r24, r30 36c16: c0 01 movw r24, r0 36c18: 11 24 eor r1, r1 36c1a: 9c 01 movw r18, r24 36c1c: 2c 58 subi r18, 0x8C ; 140 36c1e: 38 4f sbci r19, 0xF8 ; 248 36c20: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 36c22: d9 01 movw r26, r18 36c24: 95 96 adiw r26, 0x25 ; 37 36c26: 4d 91 ld r20, X+ 36c28: 5d 91 ld r21, X+ 36c2a: 6d 91 ld r22, X+ 36c2c: 7c 91 ld r23, X 36c2e: 98 97 sbiw r26, 0x28 ; 40 36c30: 09 a5 ldd r16, Y+41 ; 0x29 36c32: 1d a5 ldd r17, Y+45 ; 0x2d 36c34: 29 a9 ldd r18, Y+49 ; 0x31 36c36: 39 ad ldd r19, Y+57 ; 0x39 36c38: c7 01 movw r24, r14 36c3a: 0f 94 7d a1 call 0x342fa ; 0x342fa current->flag &= ~BLOCK_FLAG_RECALCULATE; 36c3e: f7 01 movw r30, r14 36c40: 85 a9 ldd r24, Z+53 ; 0x35 36c42: 8e 7f andi r24, 0xFE ; 254 36c44: 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(); 36c46: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36c4a: 82 60 ori r24, 0x02 ; 2 36c4c: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36c50: 0d 94 9d ab jmp 0x3573a ; 0x3573a // 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)); 36c54: a4 53 subi r26, 0x34 ; 52 36c56: b8 4f sbci r27, 0xF8 ; 248 36c58: 80 e1 ldi r24, 0x10 ; 16 36c5a: e1 e4 ldi r30, 0x41 ; 65 36c5c: f7 e0 ldi r31, 0x07 ; 7 36c5e: 0d 94 d8 ab jmp 0x357b0 ; 0x357b0 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]); 36c62: 20 91 78 06 lds r18, 0x0678 ; 0x800678 36c66: 30 91 79 06 lds r19, 0x0679 ; 0x800679 36c6a: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 36c6e: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 36c72: a8 96 adiw r28, 0x28 ; 40 36c74: 6c ad ldd r22, Y+60 ; 0x3c 36c76: 7d ad ldd r23, Y+61 ; 0x3d 36c78: 8e ad ldd r24, Y+62 ; 0x3e 36c7a: 9f ad ldd r25, Y+63 ; 0x3f 36c7c: a8 97 sbiw r28, 0x28 ; 40 36c7e: 0d 94 6e ac jmp 0x358dc ; 0x358dc 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); 36c82: 81 e0 ldi r24, 0x01 ; 1 36c84: 80 8f std Z+24, r24 ; 0x18 36c86: 0d 94 14 ae jmp 0x35c28 ; 0x35c28 { if(feed_rate 36c8e: b0 90 a9 06 lds r11, 0x06A9 ; 0x8006a9 36c92: 00 91 aa 06 lds r16, 0x06AA ; 0x8006aa 36c96: 10 91 ab 06 lds r17, 0x06AB ; 0x8006ab 36c9a: 4c c8 rjmp .-3944 ; 0x35d34 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])); 36c9c: c5 01 movw r24, r10 36c9e: b4 01 movw r22, r8 36ca0: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 36ca4: 4b 01 movw r8, r22 36ca6: 5c 01 movw r10, r24 36ca8: c7 01 movw r24, r14 36caa: b6 01 movw r22, r12 36cac: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 36cb0: 9b 01 movw r18, r22 36cb2: ac 01 movw r20, r24 36cb4: c5 01 movw r24, r10 36cb6: b4 01 movw r22, r8 36cb8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 36cbc: 6b 01 movw r12, r22 36cbe: 7c 01 movw r14, r24 36cc0: 22 96 adiw r28, 0x02 ; 2 36cc2: 6c ad ldd r22, Y+60 ; 0x3c 36cc4: 7d ad ldd r23, Y+61 ; 0x3d 36cc6: 8e ad ldd r24, Y+62 ; 0x3e 36cc8: 9f ad ldd r25, Y+63 ; 0x3f 36cca: 22 97 sbiw r28, 0x02 ; 2 36ccc: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 36cd0: 9b 01 movw r18, r22 36cd2: ac 01 movw r20, r24 36cd4: c7 01 movw r24, r14 36cd6: b6 01 movw r22, r12 36cd8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 36cdc: 0f 94 7f e2 call 0x3c4fe ; 0x3c4fe 36ce0: 2e e6 ldi r18, 0x6E ; 110 36ce2: 22 9d mul r18, r2 36ce4: f0 01 movw r30, r0 36ce6: 23 9d mul r18, r3 36ce8: f0 0d add r31, r0 36cea: 11 24 eor r1, r1 36cec: ec 58 subi r30, 0x8C ; 140 36cee: f8 4f sbci r31, 0xF8 ; 248 36cf0: 65 a7 std Z+45, r22 ; 0x2d 36cf2: 76 a7 std Z+46, r23 ; 0x2e 36cf4: 87 a7 std Z+47, r24 ; 0x2f 36cf6: 90 ab std Z+48, r25 ; 0x30 36cf8: bb c8 rjmp .-3722 ; 0x35e70 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 36cfa: 2a 96 adiw r28, 0x0a ; 10 36cfc: 2c ad ldd r18, Y+60 ; 0x3c 36cfe: 3d ad ldd r19, Y+61 ; 0x3d 36d00: 4e ad ldd r20, Y+62 ; 0x3e 36d02: 5f ad ldd r21, Y+63 ; 0x3f 36d04: 2a 97 sbiw r28, 0x0a ; 10 36d06: 23 2b or r18, r19 36d08: 24 2b or r18, r20 36d0a: 25 2b or r18, r21 36d0c: 09 f4 brne .+2 ; 0x36d10 36d0e: 0e c1 rjmp .+540 ; 0x36f2c 36d10: 60 91 a0 06 lds r22, 0x06A0 ; 0x8006a0 36d14: 70 91 a1 06 lds r23, 0x06A1 ; 0x8006a1 36d18: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 36d1c: 90 91 a3 06 lds r25, 0x06A3 ; 0x8006a3 36d20: 29 a5 ldd r18, Y+41 ; 0x29 36d22: 3a a5 ldd r19, Y+42 ; 0x2a 36d24: 4b a5 ldd r20, Y+43 ; 0x2b 36d26: 5c a5 ldd r21, Y+44 ; 0x2c 36d28: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36d2c: 0f 94 8f df call 0x3bf1e ; 0x3bf1e 36d30: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 36d34: 2b 01 movw r4, r22 36d36: 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 36d38: 80 91 05 18 lds r24, 0x1805 ; 0x801805 36d3c: 90 91 06 18 lds r25, 0x1806 ; 0x801806 36d40: a0 91 07 18 lds r26, 0x1807 ; 0x801807 36d44: b0 91 08 18 lds r27, 0x1808 ; 0x801808 36d48: 8d a7 std Y+45, r24 ; 0x2d 36d4a: 9e a7 std Y+46, r25 ; 0x2e 36d4c: af a7 std Y+47, r26 ; 0x2f 36d4e: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 36d50: 20 e0 ldi r18, 0x00 ; 0 36d52: 30 e0 ldi r19, 0x00 ; 0 36d54: a9 01 movw r20, r18 36d56: bc 01 movw r22, r24 36d58: cd 01 movw r24, r26 36d5a: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36d5e: 18 16 cp r1, r24 36d60: 0c f0 brlt .+2 ; 0x36d64 36d62: ed c0 rjmp .+474 ; 0x36f3e * 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 36d64: 20 e0 ldi r18, 0x00 ; 0 36d66: 30 e0 ldi r19, 0x00 ; 0 36d68: a9 01 movw r20, r18 36d6a: 26 96 adiw r28, 0x06 ; 6 36d6c: 6c ad ldd r22, Y+60 ; 0x3c 36d6e: 7d ad ldd r23, Y+61 ; 0x3d 36d70: 8e ad ldd r24, Y+62 ; 0x3e 36d72: 9f ad ldd r25, Y+63 ; 0x3f 36d74: 26 97 sbiw r28, 0x06 ; 6 36d76: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36d7a: 87 fd sbrc r24, 7 36d7c: e0 c0 rjmp .+448 ; 0x36f3e && fabs(delta_mm[Z_AXIS]) < 0.5; 36d7e: 22 96 adiw r28, 0x02 ; 2 36d80: 6c ad ldd r22, Y+60 ; 0x3c 36d82: 7d ad ldd r23, Y+61 ; 0x3d 36d84: 8e ad ldd r24, Y+62 ; 0x3e 36d86: 9f ad ldd r25, Y+63 ; 0x3f 36d88: 22 97 sbiw r28, 0x02 ; 2 36d8a: 9f 77 andi r25, 0x7F ; 127 36d8c: 20 e0 ldi r18, 0x00 ; 0 36d8e: 30 e0 ldi r19, 0x00 ; 0 36d90: 40 e0 ldi r20, 0x00 ; 0 36d92: 5f e3 ldi r21, 0x3F ; 63 36d94: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 36d98: 87 ff sbrs r24, 7 36d9a: d1 c0 rjmp .+418 ; 0x36f3e * * 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 36d9c: 8e e6 ldi r24, 0x6E ; 110 36d9e: 82 9d mul r24, r2 36da0: 80 01 movw r16, r0 36da2: 83 9d mul r24, r3 36da4: 10 0d add r17, r0 36da6: 11 24 eor r1, r1 36da8: 00 54 subi r16, 0x40 ; 64 36daa: 18 4f sbci r17, 0xF8 ; 248 36dac: 81 e0 ldi r24, 0x01 ; 1 36dae: d8 01 movw r26, r16 36db0: 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]) 36db2: 20 91 ce 04 lds r18, 0x04CE ; 0x8004ce 36db6: 30 91 cf 04 lds r19, 0x04CF ; 0x8004cf 36dba: 40 91 d0 04 lds r20, 0x04D0 ; 0x8004d0 36dbe: 50 91 d1 04 lds r21, 0x04D1 ; 0x8004d1 36dc2: 69 a1 ldd r22, Y+33 ; 0x21 36dc4: 7a a1 ldd r23, Y+34 ; 0x22 36dc6: 8b a1 ldd r24, Y+35 ; 0x23 36dc8: 9c a1 ldd r25, Y+36 ; 0x24 36dca: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 36dce: 69 ab std Y+49, r22 ; 0x31 36dd0: 7a ab std Y+50, r23 ; 0x32 36dd2: 8b ab std Y+51, r24 ; 0x33 36dd4: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36dd6: 20 91 d2 04 lds r18, 0x04D2 ; 0x8004d2 36dda: 30 91 d3 04 lds r19, 0x04D3 ; 0x8004d3 36dde: 40 91 d4 04 lds r20, 0x04D4 ; 0x8004d4 36de2: 50 91 d5 04 lds r21, 0x04D5 ; 0x8004d5 36de6: 6d a1 ldd r22, Y+37 ; 0x25 36de8: 7e a1 ldd r23, Y+38 ; 0x26 36dea: 8f a1 ldd r24, Y+39 ; 0x27 36dec: 98 a5 ldd r25, Y+40 ; 0x28 36dee: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 36df2: 4b 01 movw r8, r22 36df4: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36df6: 20 91 d6 04 lds r18, 0x04D6 ; 0x8004d6 36dfa: 30 91 d7 04 lds r19, 0x04D7 ; 0x8004d7 36dfe: 40 91 d8 04 lds r20, 0x04D8 ; 0x8004d8 36e02: 50 91 d9 04 lds r21, 0x04D9 ; 0x8004d9 36e06: a8 96 adiw r28, 0x28 ; 40 36e08: 6c ad ldd r22, Y+60 ; 0x3c 36e0a: 7d ad ldd r23, Y+61 ; 0x3d 36e0c: 8e ad ldd r24, Y+62 ; 0x3e 36e0e: 9f ad ldd r25, Y+63 ; 0x3f 36e10: a8 97 sbiw r28, 0x28 ; 40 36e12: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 36e16: 6b 01 movw r12, r22 36e18: 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]) 36e1a: 29 a9 ldd r18, Y+49 ; 0x31 36e1c: 3a a9 ldd r19, Y+50 ; 0x32 36e1e: 4b a9 ldd r20, Y+51 ; 0x33 36e20: 5c a9 ldd r21, Y+52 ; 0x34 36e22: ca 01 movw r24, r20 36e24: b9 01 movw r22, r18 36e26: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36e2a: 69 ab std Y+49, r22 ; 0x31 36e2c: 7a ab std Y+50, r23 ; 0x32 36e2e: 8b ab std Y+51, r24 ; 0x33 36e30: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36e32: a5 01 movw r20, r10 36e34: 94 01 movw r18, r8 36e36: c5 01 movw r24, r10 36e38: b4 01 movw r22, r8 36e3a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36e3e: 9b 01 movw r18, r22 36e40: ac 01 movw r20, r24 36e42: 69 a9 ldd r22, Y+49 ; 0x31 36e44: 7a a9 ldd r23, Y+50 ; 0x32 36e46: 8b a9 ldd r24, Y+51 ; 0x33 36e48: 9c a9 ldd r25, Y+52 ; 0x34 36e4a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 36e4e: 4b 01 movw r8, r22 36e50: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36e52: a7 01 movw r20, r14 36e54: 96 01 movw r18, r12 36e56: c7 01 movw r24, r14 36e58: b6 01 movw r22, r12 36e5a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36e5e: 9b 01 movw r18, r22 36e60: ac 01 movw r20, r24 36e62: c5 01 movw r24, r10 36e64: b4 01 movw r22, r8 36e66: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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]) 36e6a: 0f 94 7f e2 call 0x3c4fe ; 0x3c4fe 36e6e: 6b 01 movw r12, r22 36e70: 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]); 36e72: 20 91 da 04 lds r18, 0x04DA ; 0x8004da 36e76: 30 91 db 04 lds r19, 0x04DB ; 0x8004db 36e7a: 40 91 dc 04 lds r20, 0x04DC ; 0x8004dc 36e7e: 50 91 dd 04 lds r21, 0x04DD ; 0x8004dd 36e82: aa 96 adiw r28, 0x2a ; 42 36e84: ee ad ldd r30, Y+62 ; 0x3e 36e86: ff ad ldd r31, Y+63 ; 0x3f 36e88: aa 97 sbiw r28, 0x2a ; 42 36e8a: 60 81 ld r22, Z 36e8c: 71 81 ldd r23, Z+1 ; 0x01 36e8e: 82 81 ldd r24, Z+2 ; 0x02 36e90: 93 81 ldd r25, Z+3 ; 0x03 36e92: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__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; 36e96: a7 01 movw r20, r14 36e98: 96 01 movw r18, r12 36e9a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36e9e: 6a 96 adiw r28, 0x1a ; 26 36ea0: 6c af std Y+60, r22 ; 0x3c 36ea2: 7d af std Y+61, r23 ; 0x3d 36ea4: 8e af std Y+62, r24 ; 0x3e 36ea6: 9f af std Y+63, r25 ; 0x3f 36ea8: 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) 36eaa: 20 e0 ldi r18, 0x00 ; 0 36eac: 30 e0 ldi r19, 0x00 ; 0 36eae: 40 e4 ldi r20, 0x40 ; 64 36eb0: 50 e4 ldi r21, 0x40 ; 64 36eb2: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36eb6: 18 16 cp r1, r24 36eb8: 0c f4 brge .+2 ; 0x36ebc 36eba: 9e c0 rjmp .+316 ; 0x36ff8 block->use_advance_lead = false; else if (e_D_ratio > 0) { 36ebc: 20 e0 ldi r18, 0x00 ; 0 36ebe: 30 e0 ldi r19, 0x00 ; 0 36ec0: a9 01 movw r20, r18 36ec2: 6a 96 adiw r28, 0x1a ; 26 36ec4: 6c ad ldd r22, Y+60 ; 0x3c 36ec6: 7d ad ldd r23, Y+61 ; 0x3d 36ec8: 8e ad ldd r24, Y+62 ; 0x3e 36eca: 9f ad ldd r25, Y+63 ; 0x3f 36ecc: 6a 97 sbiw r28, 0x1a ; 26 36ece: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 36ed2: 18 16 cp r1, r24 36ed4: 0c f0 brlt .+2 ; 0x36ed8 36ed6: 42 c0 rjmp .+132 ; 0x36f5c const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 36ed8: 6a 96 adiw r28, 0x1a ; 26 36eda: 2c ad ldd r18, Y+60 ; 0x3c 36edc: 3d ad ldd r19, Y+61 ; 0x3d 36ede: 4e ad ldd r20, Y+62 ; 0x3e 36ee0: 5f ad ldd r21, Y+63 ; 0x3f 36ee2: 6a 97 sbiw r28, 0x1a ; 26 36ee4: 6d a5 ldd r22, Y+45 ; 0x2d 36ee6: 7e a5 ldd r23, Y+46 ; 0x2e 36ee8: 8f a5 ldd r24, Y+47 ; 0x2f 36eea: 98 a9 ldd r25, Y+48 ; 0x30 36eec: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36ef0: 9b 01 movw r18, r22 36ef2: ac 01 movw r20, r24 36ef4: 60 91 c0 06 lds r22, 0x06C0 ; 0x8006c0 36ef8: 70 91 c1 06 lds r23, 0x06C1 ; 0x8006c1 36efc: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 36f00: 90 91 c3 06 lds r25, 0x06C3 ; 0x8006c3 36f04: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36f08: 29 a5 ldd r18, Y+41 ; 0x29 36f0a: 3a a5 ldd r19, Y+42 ; 0x2a 36f0c: 4b a5 ldd r20, Y+43 ; 0x2b 36f0e: 5c a5 ldd r21, Y+44 ; 0x2c 36f10: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36f14: 0f 94 8f df call 0x3bf1e ; 0x3bf1e 36f18: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 36f1c: 64 15 cp r22, r4 36f1e: 75 05 cpc r23, r5 36f20: 86 05 cpc r24, r6 36f22: 97 05 cpc r25, r7 36f24: d8 f4 brcc .+54 ; 0x36f5c 36f26: 2b 01 movw r4, r22 36f28: 3c 01 movw r6, r24 36f2a: 18 c0 rjmp .+48 ; 0x36f5c 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 36f2c: 60 91 2c 07 lds r22, 0x072C ; 0x80072c 36f30: 70 91 2d 07 lds r23, 0x072D ; 0x80072d 36f34: 80 91 2e 07 lds r24, 0x072E ; 0x80072e 36f38: 90 91 2f 07 lds r25, 0x072F ; 0x80072f 36f3c: f1 ce rjmp .-542 ; 0x36d20 * * 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 36f3e: 8e e6 ldi r24, 0x6E ; 110 36f40: 82 9d mul r24, r2 36f42: f0 01 movw r30, r0 36f44: 83 9d mul r24, r3 36f46: f0 0d add r31, r0 36f48: 11 24 eor r1, r1 36f4a: e0 54 subi r30, 0x40 ; 64 36f4c: f8 4f sbci r31, 0xF8 ; 248 36f4e: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36f50: 6a 96 adiw r28, 0x1a ; 26 36f52: 1c ae std Y+60, r1 ; 0x3c 36f54: 1d ae std Y+61, r1 ; 0x3d 36f56: 1e ae std Y+62, r1 ; 0x3e 36f58: 1f ae std Y+63, r1 ; 0x3f 36f5a: 6a 97 sbiw r28, 0x1a ; 26 36f5c: 10 e0 ldi r17, 0x00 ; 0 36f5e: 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) 36f60: a4 96 adiw r28, 0x24 ; 36 36f62: ee ad ldd r30, Y+62 ; 0x3e 36f64: ff ad ldd r31, Y+63 ; 0x3f 36f66: a4 97 sbiw r28, 0x24 ; 36 36f68: e0 0f add r30, r16 36f6a: f1 1f adc r31, r17 36f6c: ec 58 subi r30, 0x8C ; 140 36f6e: f8 4f sbci r31, 0xF8 ; 248 36f70: c0 80 ld r12, Z 36f72: d1 80 ldd r13, Z+1 ; 0x01 36f74: e2 80 ldd r14, Z+2 ; 0x02 36f76: f3 80 ldd r15, Z+3 ; 0x03 36f78: c1 14 cp r12, r1 36f7a: d1 04 cpc r13, r1 36f7c: e1 04 cpc r14, r1 36f7e: f1 04 cpc r15, r1 36f80: a1 f1 breq .+104 ; 0x36fea 36f82: f8 01 movw r30, r16 36f84: e2 51 subi r30, 0x12 ; 18 36f86: f8 4e sbci r31, 0xE8 ; 232 36f88: 60 81 ld r22, Z 36f8a: 71 81 ldd r23, Z+1 ; 0x01 36f8c: 82 81 ldd r24, Z+2 ; 0x02 36f8e: 93 81 ldd r25, Z+3 ; 0x03 36f90: 64 15 cp r22, r4 36f92: 75 05 cpc r23, r5 36f94: 86 05 cpc r24, r6 36f96: 97 05 cpc r25, r7 36f98: 40 f5 brcc .+80 ; 0x36fea { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 36f9a: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 36f9e: 29 ad ldd r18, Y+57 ; 0x39 36fa0: 3a ad ldd r19, Y+58 ; 0x3a 36fa2: 4b ad ldd r20, Y+59 ; 0x3b 36fa4: 5c ad ldd r21, Y+60 ; 0x3c 36fa6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 36faa: 4b 01 movw r8, r22 36fac: 5c 01 movw r10, r24 36fae: c7 01 movw r24, r14 36fb0: b6 01 movw r22, r12 36fb2: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 36fb6: 9b 01 movw r18, r22 36fb8: ac 01 movw r20, r24 36fba: c5 01 movw r24, r10 36fbc: b4 01 movw r22, r8 36fbe: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 36fc2: 6b 01 movw r12, r22 36fc4: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 36fc6: c3 01 movw r24, r6 36fc8: b2 01 movw r22, r4 36fca: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 36fce: 9b 01 movw r18, r22 36fd0: ac 01 movw r20, r24 36fd2: c7 01 movw r24, r14 36fd4: b6 01 movw r22, r12 36fd6: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 36fda: 87 ff sbrs r24, 7 36fdc: 06 c0 rjmp .+12 ; 0x36fea 36fde: c7 01 movw r24, r14 36fe0: b6 01 movw r22, r12 36fe2: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 36fe6: 2b 01 movw r4, r22 36fe8: 3c 01 movw r6, r24 36fea: 0c 5f subi r16, 0xFC ; 252 36fec: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 36fee: 00 31 cpi r16, 0x10 ; 16 36ff0: 11 05 cpc r17, r1 36ff2: 09 f0 breq .+2 ; 0x36ff6 36ff4: b5 cf rjmp .-150 ; 0x36f60 36ff6: 01 c9 rjmp .-3582 ; 0x361fa // 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; 36ff8: d8 01 movw r26, r16 36ffa: 1c 92 st X, r1 36ffc: af cf rjmp .-162 ; 0x36f5c if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 36ffe: c9 a6 std Y+41, r12 ; 0x29 37000: dd a6 std Y+45, r13 ; 0x2d 37002: e9 aa std Y+49, r14 ; 0x31 37004: f9 ae std Y+57, r15 ; 0x39 limited = true; 37006: 21 e0 ldi r18, 0x01 ; 1 37008: 2d ab std Y+53, r18 ; 0x35 3700a: b1 c9 rjmp .-3230 ; 0x3636e // 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); 3700c: 27 96 adiw r28, 0x07 ; 7 3700e: 2f ad ldd r18, Y+63 ; 0x3f 37010: 27 97 sbiw r28, 0x07 ; 7 37012: 2b 96 adiw r28, 0x0b ; 11 37014: 3f ad ldd r19, Y+63 ; 0x3f 37016: 2b 97 sbiw r28, 0x0b ; 11 37018: 2f 96 adiw r28, 0x0f ; 15 3701a: 4f ad ldd r20, Y+63 ; 0x3f 3701c: 2f 97 sbiw r28, 0x0f ; 15 3701e: 63 96 adiw r28, 0x13 ; 19 37020: 5f ad ldd r21, Y+63 ; 0x3f 37022: 63 97 sbiw r28, 0x13 ; 19 37024: 6b 96 adiw r28, 0x1b ; 27 37026: 6f ad ldd r22, Y+63 ; 0x3f 37028: 6b 97 sbiw r28, 0x1b ; 27 3702a: 6d 96 adiw r28, 0x1d ; 29 3702c: 7f ad ldd r23, Y+63 ; 0x3f 3702e: 6d 97 sbiw r28, 0x1d ; 29 37030: c8 01 movw r24, r16 37032: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 37036: ec 96 adiw r28, 0x3c ; 60 37038: 6c af std Y+60, r22 ; 0x3c 3703a: 7d af std Y+61, r23 ; 0x3d 3703c: 8e af std Y+62, r24 ; 0x3e 3703e: 9f af std Y+63, r25 ; 0x3f 37040: 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; 37042: 6b 96 adiw r28, 0x1b ; 27 37044: ef ad ldd r30, Y+63 ; 0x3f 37046: 6b 97 sbiw r28, 0x1b ; 27 37048: ed af std Y+61, r30 ; 0x3d 3704a: 6d 96 adiw r28, 0x1d ; 29 3704c: ff ad ldd r31, Y+63 ; 0x3f 3704e: 6d 97 sbiw r28, 0x1d ; 29 37050: fd ab std Y+53, r31 ; 0x35 37052: 0e af std Y+62, r16 ; 0x3e 37054: 23 96 adiw r28, 0x03 ; 3 37056: 1f af std Y+63, r17 ; 0x3f 37058: 23 97 sbiw r28, 0x03 ; 3 3705a: 04 ca rjmp .-3064 ; 0x36464 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 3705c: f7 fa bst r15, 7 3705e: f0 94 com r15 37060: f7 f8 bld r15, 7 37062: f0 94 com r15 37064: a5 01 movw r20, r10 37066: 94 01 movw r18, r8 37068: c7 01 movw r24, r14 3706a: b6 01 movw r22, r12 3706c: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 37070: 87 ff sbrs r24, 7 37072: 77 ca rjmp .-2834 ; 0x36562 // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37074: 75 01 movw r14, r10 37076: 64 01 movw r12, r8 37078: 74 ca rjmp .-2840 ; 0x36562 // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 3707a: c7 01 movw r24, r14 3707c: b6 01 movw r22, r12 3707e: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 37082: 87 fd sbrc r24, 7 37084: 09 c0 rjmp .+18 ; 0x37098 37086: 20 e0 ldi r18, 0x00 ; 0 37088: 30 e0 ldi r19, 0x00 ; 0 3708a: a9 01 movw r20, r18 3708c: c5 01 movw r24, r10 3708e: b4 01 movw r22, r8 37090: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 37094: 18 16 cp r1, r24 37096: 2c f4 brge .+10 ; 0x370a2 37098: a5 01 movw r20, r10 3709a: 94 01 movw r18, r8 3709c: c7 01 movw r24, r14 3709e: b6 01 movw r22, r12 370a0: 5c ca rjmp .-2888 ; 0x3655a // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 370a2: b7 fa bst r11, 7 370a4: b0 94 com r11 370a6: b7 f8 bld r11, 7 370a8: b0 94 com r11 370aa: a7 01 movw r20, r14 370ac: 96 01 movw r18, r12 370ae: c5 01 movw r24, r10 370b0: b4 01 movw r22, r8 370b2: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 370b6: 18 16 cp r1, r24 370b8: 0c f0 brlt .+2 ; 0x370bc 370ba: 53 ca rjmp .-2906 ; 0x36562 370bc: db cf rjmp .-74 ; 0x37074 // 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; 370be: 8e e6 ldi r24, 0x6E ; 110 370c0: 82 9d mul r24, r2 370c2: f0 01 movw r30, r0 370c4: 83 9d mul r24, r3 370c6: f0 0d add r31, r0 370c8: 11 24 eor r1, r1 370ca: ec 58 subi r30, 0x8C ; 140 370cc: f8 4f sbci r31, 0xF8 ; 248 370ce: 85 a9 ldd r24, Z+53 ; 0x35 370d0: 84 60 ori r24, 0x04 ; 4 370d2: 85 ab std Z+53, r24 ; 0x35 370d4: a9 a5 ldd r26, Y+41 ; 0x29 370d6: ad af std Y+61, r26 ; 0x3d 370d8: bd a5 ldd r27, Y+45 ; 0x2d 370da: bd ab std Y+53, r27 ; 0x35 370dc: e9 a9 ldd r30, Y+49 ; 0x31 370de: ee af std Y+62, r30 ; 0x3e 370e0: f9 ad ldd r31, Y+57 ; 0x39 370e2: 23 96 adiw r28, 0x03 ; 3 370e4: ff af std Y+63, r31 ; 0x3f 370e6: 23 97 sbiw r28, 0x03 ; 3 370e8: bc ca rjmp .-2696 ; 0x36662 // 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; 370ea: 81 e0 ldi r24, 0x01 ; 1 370ec: 30 cb rjmp .-2464 ; 0x3674e 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]; 370ee: 20 91 c0 06 lds r18, 0x06C0 ; 0x8006c0 370f2: 30 91 c1 06 lds r19, 0x06C1 ; 0x8006c1 370f6: 40 91 c2 06 lds r20, 0x06C2 ; 0x8006c2 370fa: 50 91 c3 06 lds r21, 0x06C3 ; 0x8006c3 370fe: c7 01 movw r24, r14 37100: b6 01 movw r22, r12 37102: c1 cb rjmp .-2174 ; 0x36886 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) { 37104: 20 e0 ldi r18, 0x00 ; 0 37106: 30 e4 ldi r19, 0x40 ; 64 37108: 4c e1 ldi r20, 0x1C ; 28 3710a: 56 e4 ldi r21, 0x46 ; 70 3710c: c7 01 movw r24, r14 3710e: b6 01 movw r22, r12 37110: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 37114: 18 16 cp r1, r24 37116: d4 f4 brge .+52 ; 0x3714c block->advance_rate = advance_rate * 2; 37118: 8e e6 ldi r24, 0x6E ; 110 3711a: 82 9d mul r24, r2 3711c: 80 01 movw r16, r0 3711e: 83 9d mul r24, r3 37120: 10 0d add r17, r0 37122: 11 24 eor r1, r1 37124: 0c 58 subi r16, 0x8C ; 140 37126: 18 4f sbci r17, 0xF8 ; 248 37128: 78 01 movw r14, r16 3712a: bd e4 ldi r27, 0x4D ; 77 3712c: eb 0e add r14, r27 3712e: f1 1c adc r15, r1 37130: a5 01 movw r20, r10 37132: 94 01 movw r18, r8 37134: c5 01 movw r24, r10 37136: b4 01 movw r22, r8 37138: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3713c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 37140: f7 01 movw r30, r14 37142: 71 83 std Z+1, r23 ; 0x01 37144: 60 83 st Z, r22 block->advance_step_loops = 2; 37146: 36 96 adiw r30, 0x06 ; 6 37148: 82 e0 ldi r24, 0x02 ; 2 3714a: e2 cb rjmp .-2108 ; 0x36910 } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 3714c: 20 e0 ldi r18, 0x00 ; 0 3714e: 3f ef ldi r19, 0xFF ; 255 37150: 4f e7 ldi r20, 0x7F ; 127 37152: 57 e4 ldi r21, 0x47 ; 71 37154: c5 01 movw r24, r10 37156: b4 01 movw r22, r8 37158: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3715c: 87 ff sbrs r24, 7 3715e: 19 c0 rjmp .+50 ; 0x37192 block->advance_rate = advance_rate; 37160: 8e e6 ldi r24, 0x6E ; 110 37162: 82 9d mul r24, r2 37164: 80 01 movw r16, r0 37166: 83 9d mul r24, r3 37168: 10 0d add r17, r0 3716a: 11 24 eor r1, r1 3716c: 0f 53 subi r16, 0x3F ; 63 3716e: 18 4f sbci r17, 0xF8 ; 248 37170: c5 01 movw r24, r10 37172: b4 01 movw r22, r8 37174: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 37178: d8 01 movw r26, r16 3717a: 6d 93 st X+, r22 3717c: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 3717e: 8e e6 ldi r24, 0x6E ; 110 37180: 82 9d mul r24, r2 37182: f0 01 movw r30, r0 37184: 83 9d mul r24, r3 37186: f0 0d add r31, r0 37188: 11 24 eor r1, r1 3718a: e9 53 subi r30, 0x39 ; 57 3718c: f8 4f sbci r31, 0xF8 ; 248 3718e: 81 e0 ldi r24, 0x01 ; 1 37190: bf cb rjmp .-2178 ; 0x36910 { // 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; 37192: 8e e6 ldi r24, 0x6E ; 110 37194: 82 9d mul r24, r2 37196: f0 01 movw r30, r0 37198: 83 9d mul r24, r3 3719a: f0 0d add r31, r0 3719c: 11 24 eor r1, r1 3719e: ef 53 subi r30, 0x3F ; 63 371a0: f8 4f sbci r31, 0xF8 ; 248 371a2: 8f ef ldi r24, 0xFF ; 255 371a4: 9f ef ldi r25, 0xFF ; 255 371a6: 91 83 std Z+1, r25 ; 0x01 371a8: 80 83 st Z, r24 371aa: e9 cf rjmp .-46 ; 0x3717e 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) { 371ac: f6 01 movw r30, r12 371ae: 71 a4 ldd r7, Z+41 ; 0x29 371b0: 82 a4 ldd r8, Z+42 ; 0x2a 371b2: 93 a4 ldd r9, Z+43 ; 0x2b 371b4: e4 a4 ldd r14, Z+44 ; 0x2c 371b6: 27 2d mov r18, r7 371b8: 38 2d mov r19, r8 371ba: 49 2d mov r20, r9 371bc: 5e 2d mov r21, r14 371be: 65 a1 ldd r22, Z+37 ; 0x25 371c0: 76 a1 ldd r23, Z+38 ; 0x26 371c2: 87 a1 ldd r24, Z+39 ; 0x27 371c4: 90 a5 ldd r25, Z+40 ; 0x28 371c6: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 371ca: 88 23 and r24, r24 371cc: 09 f4 brne .+2 ; 0x371d0 371ce: 51 c0 rjmp .+162 ; 0x37272 // 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) ? 371d0: 01 fd sbrc r16, 1 371d2: 44 c0 rjmp .+136 ; 0x3725c 371d4: d5 01 movw r26, r10 371d6: 95 96 adiw r26, 0x25 ; 37 371d8: 2d 90 ld r2, X+ 371da: 3d 90 ld r3, X+ 371dc: 4d 90 ld r4, X+ 371de: 5c 90 ld r5, X 371e0: 98 97 sbiw r26, 0x28 ; 40 371e2: a2 01 movw r20, r4 371e4: 91 01 movw r18, r2 371e6: 67 2d mov r22, r7 371e8: 78 2d mov r23, r8 371ea: 89 2d mov r24, r9 371ec: 9e 2d mov r25, r14 371ee: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 371f2: 18 16 cp r1, r24 371f4: 9c f5 brge .+102 ; 0x3725c // 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); 371f6: a2 01 movw r20, r4 371f8: 91 01 movw r18, r2 371fa: c2 01 movw r24, r4 371fc: b1 01 movw r22, r2 371fe: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 37202: 1b 01 movw r2, r22 37204: 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)); 37206: f6 01 movw r30, r12 37208: 61 a9 ldd r22, Z+49 ; 0x31 3720a: 72 a9 ldd r23, Z+50 ; 0x32 3720c: 83 a9 ldd r24, Z+51 ; 0x33 3720e: 94 a9 ldd r25, Z+52 ; 0x34 37210: 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); 37212: 9b 01 movw r18, r22 37214: ac 01 movw r20, r24 37216: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3721a: d6 01 movw r26, r12 3721c: 9d 96 adiw r26, 0x2d ; 45 3721e: 2d 91 ld r18, X+ 37220: 3d 91 ld r19, X+ 37222: 4d 91 ld r20, X+ 37224: 5c 91 ld r21, X 37226: d0 97 sbiw r26, 0x30 ; 48 37228: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3722c: 9b 01 movw r18, r22 3722e: ac 01 movw r20, r24 37230: c2 01 movw r24, r4 37232: b1 01 movw r22, r2 37234: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 37238: 0f 94 7f e2 call 0x3c4fe ; 0x3c4fe 3723c: 2b 01 movw r4, r22 3723e: 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)); 37240: 9b 01 movw r18, r22 37242: ac 01 movw r20, r24 37244: 67 2d mov r22, r7 37246: 78 2d mov r23, r8 37248: 89 2d mov r24, r9 3724a: 9e 2d mov r25, r14 3724c: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 37250: 87 fd sbrc r24, 7 37252: 04 c0 rjmp .+8 ; 0x3725c 37254: 74 2c mov r7, r4 37256: 85 2c mov r8, r5 37258: 9a 2c mov r9, r10 3725a: 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) ? 3725c: 87 2d mov r24, r7 3725e: 98 2d mov r25, r8 37260: a9 2d mov r26, r9 37262: be 2d mov r27, r14 37264: f6 01 movw r30, r12 37266: 85 a3 std Z+37, r24 ; 0x25 37268: 96 a3 std Z+38, r25 ; 0x26 3726a: a7 a3 std Z+39, r26 ; 0x27 3726c: 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; 3726e: 01 60 ori r16, 0x01 ; 1 37270: 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) 37272: 11 11 cpse r17, r1 37274: 01 c0 rjmp .+2 ; 0x37278 block_index = BLOCK_BUFFER_SIZE; 37276: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37278: 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)); 3727a: 16 9d mul r17, r6 3727c: c0 01 movw r24, r0 3727e: 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; 37280: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 37282: 9c 01 movw r18, r24 37284: 2c 58 subi r18, 0x8C ; 140 37286: 38 4f sbci r19, 0xF8 ; 248 37288: 69 01 movw r12, r18 3728a: 0b cc rjmp .-2026 ; 0x36aa2 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)); 3728c: 6c 01 movw r12, r24 3728e: 2f cc rjmp .-1954 ; 0x36aee 37290: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 37292: 0d 94 9d ab jmp 0x3573a ; 0x3573a 00037296 : 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(){ 37296: 4f 92 push r4 37298: 5f 92 push r5 3729a: 6f 92 push r6 3729c: 7f 92 push r7 3729e: 8f 92 push r8 372a0: 9f 92 push r9 372a2: af 92 push r10 372a4: bf 92 push r11 372a6: cf 92 push r12 372a8: df 92 push r13 372aa: ef 92 push r14 372ac: ff 92 push r15 372ae: cf 93 push r28 372b0: df 93 push r29 372b2: cd b7 in r28, 0x3d ; 61 372b4: de b7 in r29, 0x3e ; 62 372b6: 2c 97 sbiw r28, 0x0c ; 12 372b8: 0f b6 in r0, 0x3f ; 63 372ba: f8 94 cli 372bc: de bf out 0x3e, r29 ; 62 372be: 0f be out 0x3f, r0 ; 63 372c0: 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]); 372c2: c0 90 49 07 lds r12, 0x0749 ; 0x800749 372c6: d0 90 4a 07 lds r13, 0x074A ; 0x80074a 372ca: e0 90 4b 07 lds r14, 0x074B ; 0x80074b 372ce: f0 90 4c 07 lds r15, 0x074C ; 0x80074c 372d2: 80 91 45 07 lds r24, 0x0745 ; 0x800745 372d6: 90 91 46 07 lds r25, 0x0746 ; 0x800746 372da: a0 91 47 07 lds r26, 0x0747 ; 0x800747 372de: b0 91 48 07 lds r27, 0x0748 ; 0x800748 372e2: 40 91 41 07 lds r20, 0x0741 ; 0x800741 372e6: 50 91 42 07 lds r21, 0x0742 ; 0x800742 372ea: 60 91 43 07 lds r22, 0x0743 ; 0x800743 372ee: 70 91 44 07 lds r23, 0x0744 ; 0x800744 372f2: 4d 83 std Y+5, r20 ; 0x05 372f4: 5e 83 std Y+6, r21 ; 0x06 372f6: 6f 83 std Y+7, r22 ; 0x07 372f8: 78 87 std Y+8, r23 ; 0x08 372fa: 89 83 std Y+1, r24 ; 0x01 372fc: 9a 83 std Y+2, r25 ; 0x02 372fe: ab 83 std Y+3, r26 ; 0x03 37300: 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); 37302: be 01 movw r22, r28 37304: 6f 5f subi r22, 0xFF ; 255 37306: 7f 4f sbci r23, 0xFF ; 255 37308: ce 01 movw r24, r28 3730a: 05 96 adiw r24, 0x05 ; 5 3730c: 0e 94 af 6a call 0xd55e ; 0xd55e position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 37310: 4d 80 ldd r4, Y+5 ; 0x05 37312: 5e 80 ldd r5, Y+6 ; 0x06 37314: 6f 80 ldd r6, Y+7 ; 0x07 37316: 78 84 ldd r7, Y+8 ; 0x08 37318: 20 91 70 06 lds r18, 0x0670 ; 0x800670 3731c: 30 91 71 06 lds r19, 0x0671 ; 0x800671 37320: 40 91 72 06 lds r20, 0x0672 ; 0x800672 37324: 50 91 73 06 lds r21, 0x0673 ; 0x800673 37328: c3 01 movw r24, r6 3732a: b2 01 movw r22, r4 3732c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 37330: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 37334: 60 93 52 07 sts 0x0752, r22 ; 0x800752 37338: 70 93 53 07 sts 0x0753, r23 ; 0x800753 3733c: 80 93 54 07 sts 0x0754, r24 ; 0x800754 37340: 90 93 55 07 sts 0x0755, r25 ; 0x800755 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 37344: 89 80 ldd r8, Y+1 ; 0x01 37346: 9a 80 ldd r9, Y+2 ; 0x02 37348: ab 80 ldd r10, Y+3 ; 0x03 3734a: bc 80 ldd r11, Y+4 ; 0x04 3734c: 20 91 74 06 lds r18, 0x0674 ; 0x800674 37350: 30 91 75 06 lds r19, 0x0675 ; 0x800675 37354: 40 91 76 06 lds r20, 0x0676 ; 0x800676 37358: 50 91 77 06 lds r21, 0x0677 ; 0x800677 3735c: c5 01 movw r24, r10 3735e: b4 01 movw r22, r8 37360: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 37364: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 37368: 60 93 56 07 sts 0x0756, r22 ; 0x800756 3736c: 70 93 57 07 sts 0x0757, r23 ; 0x800757 37370: 80 93 58 07 sts 0x0758, r24 ; 0x800758 37374: 90 93 59 07 sts 0x0759, r25 ; 0x800759 #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 37378: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 3737c: 88 23 and r24, r24 3737e: 09 f4 brne .+2 ; 0x37382 37380: 8c c0 rjmp .+280 ; 0x3749a lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 37382: a5 01 movw r20, r10 37384: 94 01 movw r18, r8 37386: c3 01 movw r24, r6 37388: b2 01 movw r22, r4 3738a: 0f 94 4b 96 call 0x32c96 ; 0x32c96 3738e: 9b 01 movw r18, r22 37390: ac 01 movw r20, r24 37392: c7 01 movw r24, r14 37394: b6 01 movw r22, r12 37396: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3739a: 20 91 78 06 lds r18, 0x0678 ; 0x800678 3739e: 30 91 79 06 lds r19, 0x0679 ; 0x800679 373a2: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 373a6: 50 91 7b 06 lds r21, 0x067B ; 0x80067b lround(z*cs.axis_steps_per_mm[Z_AXIS]); 373aa: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__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 ? 373ae: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 373b2: 60 93 5a 07 sts 0x075A, r22 ; 0x80075a 373b6: 70 93 5b 07 sts 0x075B, r23 ; 0x80075b 373ba: 80 93 5c 07 sts 0x075C, r24 ; 0x80075c 373be: 90 93 5d 07 sts 0x075D, r25 ; 0x80075d 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]); 373c2: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 373c6: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 373ca: a0 91 4f 07 lds r26, 0x074F ; 0x80074f 373ce: b0 91 50 07 lds r27, 0x0750 ; 0x800750 373d2: 89 87 std Y+9, r24 ; 0x09 373d4: 9a 87 std Y+10, r25 ; 0x0a 373d6: ab 87 std Y+11, r26 ; 0x0b 373d8: bc 87 std Y+12, r27 ; 0x0c 373da: 20 91 7c 06 lds r18, 0x067C ; 0x80067c 373de: 30 91 7d 06 lds r19, 0x067D ; 0x80067d 373e2: 40 91 7e 06 lds r20, 0x067E ; 0x80067e 373e6: 50 91 7f 06 lds r21, 0x067F ; 0x80067f 373ea: bc 01 movw r22, r24 373ec: cd 01 movw r24, r26 373ee: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 373f2: 0f 94 ee e1 call 0x3c3dc ; 0x3c3dc 373f6: 60 93 5e 07 sts 0x075E, r22 ; 0x80075e 373fa: 70 93 5f 07 sts 0x075F, r23 ; 0x80075f 373fe: 80 93 60 07 sts 0x0760, r24 ; 0x800760 37402: 90 93 61 07 sts 0x0761, r25 ; 0x800761 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37406: 40 92 ce 04 sts 0x04CE, r4 ; 0x8004ce 3740a: 50 92 cf 04 sts 0x04CF, r5 ; 0x8004cf 3740e: 60 92 d0 04 sts 0x04D0, r6 ; 0x8004d0 37412: 70 92 d1 04 sts 0x04D1, r7 ; 0x8004d1 position_float[Y_AXIS] = y; 37416: 80 92 d2 04 sts 0x04D2, r8 ; 0x8004d2 3741a: 90 92 d3 04 sts 0x04D3, r9 ; 0x8004d3 3741e: a0 92 d4 04 sts 0x04D4, r10 ; 0x8004d4 37422: b0 92 d5 04 sts 0x04D5, r11 ; 0x8004d5 position_float[Z_AXIS] = z; 37426: c0 92 d6 04 sts 0x04D6, r12 ; 0x8004d6 3742a: d0 92 d7 04 sts 0x04D7, r13 ; 0x8004d7 3742e: e0 92 d8 04 sts 0x04D8, r14 ; 0x8004d8 37432: f0 92 d9 04 sts 0x04D9, r15 ; 0x8004d9 position_float[E_AXIS] = e; 37436: 89 85 ldd r24, Y+9 ; 0x09 37438: 9a 85 ldd r25, Y+10 ; 0x0a 3743a: ab 85 ldd r26, Y+11 ; 0x0b 3743c: bc 85 ldd r27, Y+12 ; 0x0c 3743e: 80 93 da 04 sts 0x04DA, r24 ; 0x8004da 37442: 90 93 db 04 sts 0x04DB, r25 ; 0x8004db 37446: a0 93 dc 04 sts 0x04DC, r26 ; 0x8004dc 3744a: b0 93 dd 04 sts 0x04DD, r27 ; 0x8004dd #endif st_set_position(position); 3744e: 0f 94 b5 87 call 0x30f6a ; 0x30f6a previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 37452: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.507> 37456: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.507+0x1> 3745a: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507+0x2> 3745e: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37462: ee eb ldi r30, 0xBE ; 190 37464: f4 e0 ldi r31, 0x04 ; 4 37466: 80 e1 ldi r24, 0x10 ; 16 37468: df 01 movw r26, r30 3746a: 1d 92 st X+, r1 3746c: 8a 95 dec r24 3746e: e9 f7 brne .-6 ; 0x3746a 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]); } 37470: 2c 96 adiw r28, 0x0c ; 12 37472: 0f b6 in r0, 0x3f ; 63 37474: f8 94 cli 37476: de bf out 0x3e, r29 ; 62 37478: 0f be out 0x3f, r0 ; 63 3747a: cd bf out 0x3d, r28 ; 61 3747c: df 91 pop r29 3747e: cf 91 pop r28 37480: ff 90 pop r15 37482: ef 90 pop r14 37484: df 90 pop r13 37486: cf 90 pop r12 37488: bf 90 pop r11 3748a: af 90 pop r10 3748c: 9f 90 pop r9 3748e: 8f 90 pop r8 37490: 7f 90 pop r7 37492: 6f 90 pop r6 37494: 5f 90 pop r5 37496: 4f 90 pop r4 37498: 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]); 3749a: 20 91 78 06 lds r18, 0x0678 ; 0x800678 3749e: 30 91 79 06 lds r19, 0x0679 ; 0x800679 374a2: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 374a6: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 374aa: c7 01 movw r24, r14 374ac: b6 01 movw r22, r12 374ae: 7d cf rjmp .-262 ; 0x373aa 000374b0 : 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) { 374b0: 8f 92 push r8 374b2: 9f 92 push r9 374b4: af 92 push r10 374b6: bf 92 push r11 374b8: cf 92 push r12 374ba: df 92 push r13 374bc: ef 92 push r14 374be: ff 92 push r15 374c0: 0f 93 push r16 374c2: 1f 93 push r17 374c4: 4b 01 movw r8, r22 374c6: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 374c8: e2 e5 ldi r30, 0x52 ; 82 374ca: f5 e0 ldi r31, 0x05 ; 5 374cc: e0 84 ldd r14, Z+8 ; 0x08 374ce: f1 84 ldd r15, Z+9 ; 0x09 374d0: 02 85 ldd r16, Z+10 ; 0x0a 374d2: 13 85 ldd r17, Z+11 ; 0x0b 374d4: 24 81 ldd r18, Z+4 ; 0x04 374d6: 35 81 ldd r19, Z+5 ; 0x05 374d8: 46 81 ldd r20, Z+6 ; 0x06 374da: 57 81 ldd r21, Z+7 ; 0x07 374dc: 60 81 ld r22, Z 374de: 71 81 ldd r23, Z+1 ; 0x01 374e0: 82 81 ldd r24, Z+2 ; 0x02 374e2: 93 81 ldd r25, Z+3 ; 0x03 374e4: 1f 92 push r1 374e6: 1f 92 push r1 374e8: 1f 92 push r1 374ea: 1f 92 push r1 374ec: ee e5 ldi r30, 0x5E ; 94 374ee: ce 2e mov r12, r30 374f0: e5 e0 ldi r30, 0x05 ; 5 374f2: de 2e mov r13, r30 374f4: 0f 94 36 ab call 0x3566c ; 0x3566c 374f8: 0f 90 pop r0 374fa: 0f 90 pop r0 374fc: 0f 90 pop r0 374fe: 0f 90 pop r0 } 37500: 1f 91 pop r17 37502: 0f 91 pop r16 37504: ff 90 pop r15 37506: ef 90 pop r14 37508: df 90 pop r13 3750a: cf 90 pop r12 3750c: bf 90 pop r11 3750e: af 90 pop r10 37510: 9f 90 pop r9 37512: 8f 90 pop r8 37514: 08 95 ret 00037516 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 37516: 8f 92 push r8 37518: 9f 92 push r9 3751a: af 92 push r10 3751c: bf 92 push r11 3751e: cf 92 push r12 37520: df 92 push r13 37522: ef 92 push r14 37524: ff 92 push r15 37526: 0f 93 push r16 37528: 1f 93 push r17 3752a: 4b 01 movw r8, r22 3752c: 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); 3752e: e1 e4 ldi r30, 0x41 ; 65 37530: f7 e0 ldi r31, 0x07 ; 7 37532: e0 84 ldd r14, Z+8 ; 0x08 37534: f1 84 ldd r15, Z+9 ; 0x09 37536: 02 85 ldd r16, Z+10 ; 0x0a 37538: 13 85 ldd r17, Z+11 ; 0x0b 3753a: 24 81 ldd r18, Z+4 ; 0x04 3753c: 35 81 ldd r19, Z+5 ; 0x05 3753e: 46 81 ldd r20, Z+6 ; 0x06 37540: 57 81 ldd r21, Z+7 ; 0x07 37542: 60 81 ld r22, Z 37544: 71 81 ldd r23, Z+1 ; 0x01 37546: 82 81 ldd r24, Z+2 ; 0x02 37548: 93 81 ldd r25, Z+3 ; 0x03 3754a: 1f 92 push r1 3754c: 1f 92 push r1 3754e: 1f 92 push r1 37550: 1f 92 push r1 37552: ed e4 ldi r30, 0x4D ; 77 37554: ce 2e mov r12, r30 37556: e7 e0 ldi r30, 0x07 ; 7 37558: de 2e mov r13, r30 3755a: 0f 94 36 ab call 0x3566c ; 0x3566c 3755e: 0f 90 pop r0 37560: 0f 90 pop r0 37562: 0f 90 pop r0 37564: 0f 90 pop r0 } 37566: 1f 91 pop r17 37568: 0f 91 pop r16 3756a: ff 90 pop r15 3756c: ef 90 pop r14 3756e: df 90 pop r13 37570: cf 90 pop r12 37572: bf 90 pop r11 37574: af 90 pop r10 37576: 9f 90 pop r9 37578: 8f 90 pop r8 3757a: 08 95 ret 0003757c : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 3757c: 4f 92 push r4 3757e: 5f 92 push r5 37580: 6f 92 push r6 37582: 7f 92 push r7 37584: 8f 92 push r8 37586: 9f 92 push r9 37588: af 92 push r10 3758a: bf 92 push r11 3758c: cf 92 push r12 3758e: df 92 push r13 37590: ef 92 push r14 37592: ff 92 push r15 37594: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 37596: 80 e0 ldi r24, 0x00 ; 0 37598: 0f 94 02 59 call 0x2b204 ; 0x2b204 3759c: 60 93 52 07 sts 0x0752, r22 ; 0x800752 375a0: 70 93 53 07 sts 0x0753, r23 ; 0x800753 375a4: 80 93 54 07 sts 0x0754, r24 ; 0x800754 375a8: 90 93 55 07 sts 0x0755, r25 ; 0x800755 position[Y_AXIS] = st_get_position(Y_AXIS); 375ac: 81 e0 ldi r24, 0x01 ; 1 375ae: 0f 94 02 59 call 0x2b204 ; 0x2b204 375b2: 60 93 56 07 sts 0x0756, r22 ; 0x800756 375b6: 70 93 57 07 sts 0x0757, r23 ; 0x800757 375ba: 80 93 58 07 sts 0x0758, r24 ; 0x800758 375be: 90 93 59 07 sts 0x0759, r25 ; 0x800759 position[Z_AXIS] = st_get_position(Z_AXIS); 375c2: 82 e0 ldi r24, 0x02 ; 2 375c4: 0f 94 02 59 call 0x2b204 ; 0x2b204 375c8: 60 93 5a 07 sts 0x075A, r22 ; 0x80075a 375cc: 70 93 5b 07 sts 0x075B, r23 ; 0x80075b 375d0: 80 93 5c 07 sts 0x075C, r24 ; 0x80075c 375d4: 90 93 5d 07 sts 0x075D, r25 ; 0x80075d position[E_AXIS] = st_get_position(E_AXIS); 375d8: 83 e0 ldi r24, 0x03 ; 3 375da: 0f 94 02 59 call 0x2b204 ; 0x2b204 375de: 60 93 5e 07 sts 0x075E, r22 ; 0x80075e 375e2: 70 93 5f 07 sts 0x075F, r23 ; 0x80075f 375e6: 80 93 60 07 sts 0x0760, r24 ; 0x800760 375ea: 90 93 61 07 sts 0x0761, r25 ; 0x800761 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 375ee: 80 e0 ldi r24, 0x00 ; 0 375f0: 0f 94 10 59 call 0x2b220 ; 0x2b220 375f4: 60 93 41 07 sts 0x0741, r22 ; 0x800741 375f8: 70 93 42 07 sts 0x0742, r23 ; 0x800742 375fc: 80 93 43 07 sts 0x0743, r24 ; 0x800743 37600: 90 93 44 07 sts 0x0744, r25 ; 0x800744 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 37604: 81 e0 ldi r24, 0x01 ; 1 37606: 0f 94 10 59 call 0x2b220 ; 0x2b220 3760a: 60 93 45 07 sts 0x0745, r22 ; 0x800745 3760e: 70 93 46 07 sts 0x0746, r23 ; 0x800746 37612: 80 93 47 07 sts 0x0747, r24 ; 0x800747 37616: 90 93 48 07 sts 0x0748, r25 ; 0x800748 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 3761a: 82 e0 ldi r24, 0x02 ; 2 3761c: 0f 94 10 59 call 0x2b220 ; 0x2b220 37620: 60 93 49 07 sts 0x0749, r22 ; 0x800749 37624: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 37628: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 3762c: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c current_position[E_AXIS] = st_get_position_mm(E_AXIS); 37630: 83 e0 ldi r24, 0x03 ; 3 37632: 0f 94 10 59 call 0x2b220 ; 0x2b220 37636: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 3763a: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 3763e: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 37642: 90 93 50 07 sts 0x0750, r25 ; 0x800750 // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 37646: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 3764a: 88 23 and r24, r24 3764c: 31 f1 breq .+76 ; 0x3769a #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]); 3764e: 20 91 45 07 lds r18, 0x0745 ; 0x800745 37652: 30 91 46 07 lds r19, 0x0746 ; 0x800746 37656: 40 91 47 07 lds r20, 0x0747 ; 0x800747 3765a: 50 91 48 07 lds r21, 0x0748 ; 0x800748 3765e: 60 91 41 07 lds r22, 0x0741 ; 0x800741 37662: 70 91 42 07 lds r23, 0x0742 ; 0x800742 37666: 80 91 43 07 lds r24, 0x0743 ; 0x800743 3766a: 90 91 44 07 lds r25, 0x0744 ; 0x800744 3766e: 0f 94 4b 96 call 0x32c96 ; 0x32c96 37672: 9b 01 movw r18, r22 37674: ac 01 movw r20, r24 37676: 60 91 49 07 lds r22, 0x0749 ; 0x800749 3767a: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 3767e: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 37682: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 37686: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 3768a: 60 93 49 07 sts 0x0749, r22 ; 0x800749 3768e: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 37692: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 37696: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 3769a: c0 91 e9 17 lds r28, 0x17E9 ; 0x8017e9 3769e: cc 23 and r28, r28 376a0: 09 f4 brne .+2 ; 0x376a4 376a2: 9a c0 rjmp .+308 ; 0x377d8 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 376a4: c0 ff sbrs r28, 0 376a6: 34 c0 rjmp .+104 ; 0x37710 // Then add the offset. x -= world2machine_shift[0]; 376a8: 20 91 e1 17 lds r18, 0x17E1 ; 0x8017e1 376ac: 30 91 e2 17 lds r19, 0x17E2 ; 0x8017e2 376b0: 40 91 e3 17 lds r20, 0x17E3 ; 0x8017e3 376b4: 50 91 e4 17 lds r21, 0x17E4 ; 0x8017e4 376b8: 60 91 41 07 lds r22, 0x0741 ; 0x800741 376bc: 70 91 42 07 lds r23, 0x0742 ; 0x800742 376c0: 80 91 43 07 lds r24, 0x0743 ; 0x800743 376c4: 90 91 44 07 lds r25, 0x0744 ; 0x800744 376c8: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 376cc: 60 93 41 07 sts 0x0741, r22 ; 0x800741 376d0: 70 93 42 07 sts 0x0742, r23 ; 0x800742 376d4: 80 93 43 07 sts 0x0743, r24 ; 0x800743 376d8: 90 93 44 07 sts 0x0744, r25 ; 0x800744 y -= world2machine_shift[1]; 376dc: 20 91 e5 17 lds r18, 0x17E5 ; 0x8017e5 376e0: 30 91 e6 17 lds r19, 0x17E6 ; 0x8017e6 376e4: 40 91 e7 17 lds r20, 0x17E7 ; 0x8017e7 376e8: 50 91 e8 17 lds r21, 0x17E8 ; 0x8017e8 376ec: 60 91 45 07 lds r22, 0x0745 ; 0x800745 376f0: 70 91 46 07 lds r23, 0x0746 ; 0x800746 376f4: 80 91 47 07 lds r24, 0x0747 ; 0x800747 376f8: 90 91 48 07 lds r25, 0x0748 ; 0x800748 376fc: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 37700: 60 93 45 07 sts 0x0745, r22 ; 0x800745 37704: 70 93 46 07 sts 0x0746, r23 ; 0x800746 37708: 80 93 47 07 sts 0x0747, r24 ; 0x800747 3770c: 90 93 48 07 sts 0x0748, r25 ; 0x800748 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 37710: c1 ff sbrs r28, 1 37712: 62 c0 rjmp .+196 ; 0x377d8 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 37714: 80 90 41 07 lds r8, 0x0741 ; 0x800741 37718: 90 90 42 07 lds r9, 0x0742 ; 0x800742 3771c: a0 90 43 07 lds r10, 0x0743 ; 0x800743 37720: b0 90 44 07 lds r11, 0x0744 ; 0x800744 37724: c0 90 45 07 lds r12, 0x0745 ; 0x800745 37728: d0 90 46 07 lds r13, 0x0746 ; 0x800746 3772c: e0 90 47 07 lds r14, 0x0747 ; 0x800747 37730: f0 90 48 07 lds r15, 0x0748 ; 0x800748 float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 37734: 20 91 d9 17 lds r18, 0x17D9 ; 0x8017d9 37738: 30 91 da 17 lds r19, 0x17DA ; 0x8017da 3773c: 40 91 db 17 lds r20, 0x17DB ; 0x8017db 37740: 50 91 dc 17 lds r21, 0x17DC ; 0x8017dc 37744: c5 01 movw r24, r10 37746: b4 01 movw r22, r8 37748: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3774c: 2b 01 movw r4, r22 3774e: 3c 01 movw r6, r24 37750: 20 91 dd 17 lds r18, 0x17DD ; 0x8017dd 37754: 30 91 de 17 lds r19, 0x17DE ; 0x8017de 37758: 40 91 df 17 lds r20, 0x17DF ; 0x8017df 3775c: 50 91 e0 17 lds r21, 0x17E0 ; 0x8017e0 37760: c7 01 movw r24, r14 37762: b6 01 movw r22, r12 37764: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 37768: 9b 01 movw r18, r22 3776a: ac 01 movw r20, r24 3776c: c3 01 movw r24, r6 3776e: b2 01 movw r22, r4 37770: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 37774: 2b 01 movw r4, r22 37776: 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; 37778: 20 91 d1 17 lds r18, 0x17D1 ; 0x8017d1 3777c: 30 91 d2 17 lds r19, 0x17D2 ; 0x8017d2 37780: 40 91 d3 17 lds r20, 0x17D3 ; 0x8017d3 37784: 50 91 d4 17 lds r21, 0x17D4 ; 0x8017d4 37788: c5 01 movw r24, r10 3778a: b4 01 movw r22, r8 3778c: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 37790: 4b 01 movw r8, r22 37792: 5c 01 movw r10, r24 37794: 20 91 d5 17 lds r18, 0x17D5 ; 0x8017d5 37798: 30 91 d6 17 lds r19, 0x17D6 ; 0x8017d6 3779c: 40 91 d7 17 lds r20, 0x17D7 ; 0x8017d7 377a0: 50 91 d8 17 lds r21, 0x17D8 ; 0x8017d8 377a4: c7 01 movw r24, r14 377a6: b6 01 movw r22, r12 377a8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 377ac: 9b 01 movw r18, r22 377ae: ac 01 movw r20, r24 377b0: c5 01 movw r24, r10 377b2: b4 01 movw r22, r8 377b4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 377b8: 60 93 41 07 sts 0x0741, r22 ; 0x800741 377bc: 70 93 42 07 sts 0x0742, r23 ; 0x800742 377c0: 80 93 43 07 sts 0x0743, r24 ; 0x800743 377c4: 90 93 44 07 sts 0x0744, r25 ; 0x800744 y = out_y; 377c8: 40 92 45 07 sts 0x0745, r4 ; 0x800745 377cc: 50 92 46 07 sts 0x0746, r5 ; 0x800746 377d0: 60 92 47 07 sts 0x0747, r6 ; 0x800747 377d4: 70 92 48 07 sts 0x0748, r7 ; 0x800748 } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 377d8: 0e 94 e7 68 call 0xd1ce ; 0xd1ce #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 377dc: 80 e1 ldi r24, 0x10 ; 16 377de: e1 e4 ldi r30, 0x41 ; 65 377e0: f7 e0 ldi r31, 0x07 ; 7 377e2: ae ec ldi r26, 0xCE ; 206 377e4: b4 e0 ldi r27, 0x04 ; 4 377e6: 01 90 ld r0, Z+ 377e8: 0d 92 st X+, r0 377ea: 8a 95 dec r24 377ec: e1 f7 brne .-8 ; 0x377e6 #endif } 377ee: cf 91 pop r28 377f0: ff 90 pop r15 377f2: ef 90 pop r14 377f4: df 90 pop r13 377f6: cf 90 pop r12 377f8: bf 90 pop r11 377fa: af 90 pop r10 377fc: 9f 90 pop r9 377fe: 8f 90 pop r8 37800: 7f 90 pop r7 37802: 6f 90 pop r6 37804: 5f 90 pop r5 37806: 4f 90 pop r4 37808: 08 95 ret 0003780a : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 3780a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3780e: 8d 7f andi r24, 0xFD ; 253 37810: 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(); 37814: 0f 94 be ba call 0x3757c ; 0x3757c // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 37818: 81 e0 ldi r24, 0x01 ; 1 3781a: 80 93 5b 0e sts 0x0E5B, r24 ; 0x800e5b } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 3781e: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 37822: 8d 7f andi r24, 0xFD ; 253 37824: 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); 37828: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 3782c: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 while (blocks_queued()) plan_discard_current_block(); 37830: 98 17 cp r25, r24 37832: 69 f0 breq .+26 ; 0x3784e 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) { 37834: 90 91 54 0e lds r25, 0x0E54 ; 0x800e54 37838: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 3783c: 98 17 cp r25, r24 3783e: a1 f3 breq .-24 ; 0x37828 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 37840: 80 91 55 0e lds r24, 0x0E55 ; 0x800e55 37844: 8f 5f subi r24, 0xFF ; 255 37846: 8f 70 andi r24, 0x0F ; 15 37848: 80 93 55 0e sts 0x0E55, r24 ; 0x800e55 3784c: ed cf rjmp .-38 ; 0x37828 current_block = NULL; 3784e: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 37852: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 37856: 8f ef ldi r24, 0xFF ; 255 37858: 9f ef ldi r25, 0xFF ; 255 3785a: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 3785e: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL14nextAdvanceISR.lto_priv.493> current_adv_steps = 0; 37862: 10 92 e1 04 sts 0x04E1, r1 ; 0x8004e1 <_ZL17current_adv_steps.lto_priv.495+0x1> 37866: 10 92 e0 04 sts 0x04E0, r1 ; 0x8004e0 <_ZL17current_adv_steps.lto_priv.495> #endif st_reset_timer(); 3786a: 0f 94 7e 59 call 0x2b2fc ; 0x2b2fc ENABLE_STEPPER_DRIVER_INTERRUPT(); 3786e: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 37872: 82 60 ori r24, 0x02 ; 2 37874: 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; 37878: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL22previous_nominal_speed.lto_priv.507> 3787c: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL22previous_nominal_speed.lto_priv.507+0x1> 37880: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507+0x2> 37884: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37888: ee eb ldi r30, 0xBE ; 190 3788a: f4 e0 ldi r31, 0x04 ; 4 3788c: 80 e1 ldi r24, 0x10 ; 16 3788e: df 01 movw r26, r30 37890: 1d 92 st X+, r1 37892: 8a 95 dec r24 37894: e9 f7 brne .-6 ; 0x37890 // Reset position sync requests plan_reset_next_e_queue = false; 37896: 10 92 b9 04 sts 0x04B9, r1 ; 0x8004b9 <_ZL23plan_reset_next_e_queue.lto_priv.505> plan_reset_next_e_sched = false; 3789a: 10 92 b8 04 sts 0x04B8, r1 ; 0x8004b8 <_ZL23plan_reset_next_e_sched.lto_priv.506> } 3789e: 08 95 ret 000378a0 <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 378a0: 1f 92 push r1 378a2: 0f 92 push r0 378a4: 0f b6 in r0, 0x3f ; 63 378a6: 0f 92 push r0 378a8: 11 24 eor r1, r1 378aa: 0b b6 in r0, 0x3b ; 59 378ac: 0f 92 push r0 378ae: 8f 92 push r8 378b0: 9f 92 push r9 378b2: af 92 push r10 378b4: bf 92 push r11 378b6: cf 92 push r12 378b8: df 92 push r13 378ba: ef 92 push r14 378bc: ff 92 push r15 378be: 0f 93 push r16 378c0: 1f 93 push r17 378c2: 2f 93 push r18 378c4: 3f 93 push r19 378c6: 4f 93 push r20 378c8: 5f 93 push r21 378ca: 6f 93 push r22 378cc: 7f 93 push r23 378ce: 8f 93 push r24 378d0: 9f 93 push r25 378d2: af 93 push r26 378d4: bf 93 push r27 378d6: cf 93 push r28 378d8: df 93 push r29 378da: ef 93 push r30 378dc: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 378de: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 378e0: 8b e7 ldi r24, 0x7B ; 123 378e2: 9f e8 ldi r25, 0x8F ; 143 378e4: 0e 94 fe 7a call 0xf5fc ; 0xf5fc if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 378e8: 85 ea ldi r24, 0xA5 ; 165 378ea: 9f e0 ldi r25, 0x0F ; 15 378ec: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 378f0: 18 2f mov r17, r24 378f2: 81 11 cpse r24, r1 378f4: de c2 rjmp .+1468 ; 0x37eb2 <__vector_5+0x612> { if(printer_active()) { 378f6: 0e 94 8e 68 call 0xd11c ; 0xd11c 378fa: 88 23 and r24, r24 378fc: 09 f4 brne .+2 ; 0x37900 <__vector_5+0x60> 378fe: a9 c3 rjmp .+1874 ; 0x38052 <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 37900: 0f 94 83 3f call 0x27f06 ; 0x27f06 37904: 6b 01 movw r12, r22 37906: 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); 37908: c0 91 58 0e lds r28, 0x0E58 ; 0x800e58 3790c: cc 23 and r28, r28 3790e: 31 f0 breq .+12 ; 0x3791c <__vector_5+0x7c> 37910: c1 e0 ldi r28, 0x01 ; 1 37912: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 37916: 82 30 cpi r24, 0x02 ; 2 37918: 09 f4 brne .+2 ; 0x3791c <__vector_5+0x7c> 3791a: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 3791c: d0 91 57 0e lds r29, 0x0E57 ; 0x800e57 37920: d1 11 cpse r29, r1 37922: 02 c0 rjmp .+4 ; 0x37928 <__vector_5+0x88> 37924: d0 91 56 0e lds r29, 0x0E56 ; 0x800e56 // Conserve as much power as soon as possible // Turn off the LCD backlight #ifdef LCD_BL_PIN backlightMode = BACKLIGHT_MODE_DIM; 37928: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 3792c: 10 92 fa 03 sts 0x03FA, r1 ; 0x8003fa backlight_update(); 37930: 0e 94 31 8b call 0x11662 ; 0x11662 #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 37934: 17 9a sbi 0x02, 7 ; 2 37936: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_y(); 3793a: 16 9a sbi 0x02, 6 ; 2 3793c: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 37940: 64 e1 ldi r22, 0x14 ; 20 37942: 83 e6 ldi r24, 0x63 ; 99 37944: 92 e0 ldi r25, 0x02 ; 2 37946: 0e 94 ab 68 call 0xd156 ; 0xd156 currents[Z_AXIS].setiRun(20); 3794a: 64 e1 ldi r22, 0x14 ; 20 3794c: 83 e6 ldi r24, 0x63 ; 99 3794e: 92 e0 ldi r25, 0x02 ; 2 37950: 0e 94 b3 68 call 0xd166 ; 0xd166 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 37954: 50 e0 ldi r21, 0x00 ; 0 37956: 40 e0 ldi r20, 0x00 ; 0 37958: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 3795c: 82 e0 ldi r24, 0x02 ; 2 3795e: 0f 94 42 3a call 0x27484 ; 0x27484 currents[E_AXIS].setiHold(20); 37962: 64 e1 ldi r22, 0x14 ; 20 37964: 86 e6 ldi r24, 0x66 ; 102 37966: 92 e0 ldi r25, 0x02 ; 2 37968: 0e 94 ab 68 call 0xd156 ; 0xd156 currents[E_AXIS].setiRun(20); 3796c: 64 e1 ldi r22, 0x14 ; 20 3796e: 86 e6 ldi r24, 0x66 ; 102 37970: 92 e0 ldi r25, 0x02 ; 2 37972: 0e 94 b3 68 call 0xd166 ; 0xd166 tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 37976: 50 e0 ldi r21, 0x00 ; 0 37978: 40 e0 ldi r20, 0x00 ; 0 3797a: 60 91 f9 04 lds r22, 0x04F9 ; 0x8004f9 3797e: 83 e0 ldi r24, 0x03 ; 3 37980: 0f 94 42 3a call 0x27484 ; 0x27484 #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 37984: c1 11 cpse r28, r1 37986: 1b c0 rjmp .+54 ; 0x379be <__vector_5+0x11e> 37988: 80 91 51 07 lds r24, 0x0751 ; 0x800751 3798c: 81 11 cpse r24, r1 3798e: 17 c0 rjmp .+46 ; 0x379be <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 37990: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 37994: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_temperature = target_temperature[active_extruder]; 37998: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3799c: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 379a0: 90 93 ac 05 sts 0x05AC, r25 ; 0x8005ac 379a4: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 379a8: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 379ac: 83 fb bst r24, 3 379ae: 88 27 eor r24, r24 379b0: 80 f9 bld r24, 0 379b2: 80 93 04 18 sts 0x1804, r24 ; 0x801804 saved_fan_speed = fanSpeed; 379b6: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 379ba: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa } // Stop all heaters before continuing disable_heater(); 379be: 0f 94 4f 45 call 0x28a9e ; 0x28a9e // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 379c2: c1 11 cpse r28, r1 379c4: 04 c0 rjmp .+8 ; 0x379ce <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 379c6: 0e 94 e7 65 call 0xcbce ; 0xcbce // save the global state at planning time save_planner_global_state(); 379ca: 0e 94 9d 65 call 0xcb3a ; 0xcb3a } // 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; 379ce: 00 91 9e 13 lds r16, 0x139E ; 0x80139e mbl.active = false; 379d2: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e // 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(); 379d6: 0f 94 05 bc call 0x3780a ; 0x3780a // 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) 379da: c1 11 cpse r28, r1 379dc: 1b c0 rjmp .+54 ; 0x37a14 <__vector_5+0x174> 379de: 80 91 51 07 lds r24, 0x0751 ; 0x800751 379e2: 81 11 cpse r24, r1 379e4: 17 c0 rjmp .+46 ; 0x37a14 <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 379e6: 80 e1 ldi r24, 0x10 ; 16 379e8: e1 e4 ldi r30, 0x41 ; 65 379ea: f7 e0 ldi r31, 0x07 ; 7 379ec: ab e9 ldi r26, 0x9B ; 155 379ee: b2 e0 ldi r27, 0x02 ; 2 379f0: 01 90 ld r0, Z+ 379f2: 0d 92 st X+, r0 379f4: 8a 95 dec r24 379f6: e1 f7 brne .-8 ; 0x379f0 <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 379f8: dd 23 and r29, r29 379fa: 61 f0 breq .+24 ; 0x37a14 <__vector_5+0x174> 379fc: 80 e0 ldi r24, 0x00 ; 0 379fe: 90 e0 ldi r25, 0x00 ; 0 37a00: a0 e8 ldi r26, 0x80 ; 128 37a02: bf eb ldi r27, 0xBF ; 191 37a04: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 37a08: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 37a0c: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 37a10: 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]; 37a14: 80 90 a3 02 lds r8, 0x02A3 ; 0x8002a3 37a18: 90 90 a4 02 lds r9, 0x02A4 ; 0x8002a4 37a1c: a0 90 a5 02 lds r10, 0x02A5 ; 0x8002a5 37a20: b0 90 a6 02 lds r11, 0x02A6 ; 0x8002a6 if(mbl_was_active) { 37a24: 00 23 and r16, r16 37a26: d1 f0 breq .+52 ; 0x37a5c <__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]); 37a28: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 37a2c: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 37a30: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 37a34: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 37a38: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 37a3c: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 37a40: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 37a44: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 37a48: 0f 94 4b 96 call 0x32c96 ; 0x32c96 37a4c: 9b 01 movw r18, r22 37a4e: ac 01 movw r20, r24 37a50: c5 01 movw r24, r10 37a52: b4 01 movw r22, r8 37a54: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 37a58: 4b 01 movw r8, r22 37a5a: 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); 37a5c: b5 01 movw r22, r10 37a5e: a4 01 movw r20, r8 37a60: 8d e8 ldi r24, 0x8D ; 141 37a62: 9f e0 ldi r25, 0x0F ; 15 37a64: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 37a68: 40 91 a7 02 lds r20, 0x02A7 ; 0x8002a7 37a6c: 50 91 a8 02 lds r21, 0x02A8 ; 0x8002a8 37a70: 60 91 a9 02 lds r22, 0x02A9 ; 0x8002a9 37a74: 70 91 aa 02 lds r23, 0x02AA ; 0x8002aa 37a78: 8e e6 ldi r24, 0x6E ; 110 37a7a: 9f e0 ldi r25, 0x0F ; 15 37a7c: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e } 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); 37a80: 60 91 04 18 lds r22, 0x1804 ; 0x801804 37a84: c1 e0 ldi r28, 0x01 ; 1 37a86: 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); 37a88: 82 e7 ldi r24, 0x72 ; 114 37a8a: 9f e0 ldi r25, 0x0F ; 15 37a8c: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37a90: 0e 94 c7 80 call 0x1018e ; 0x1018e card.sdprinting = false; 37a94: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c saved_printing = true; 37a98: c0 93 58 0e sts 0x0E58, r28 ; 0x800e58 // 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; 37a9c: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b sei(); 37aa0: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 37aa2: 20 e0 ldi r18, 0x00 ; 0 37aa4: 30 e0 ldi r19, 0x00 ; 0 37aa6: 40 e8 ldi r20, 0x80 ; 128 37aa8: 5f e3 ldi r21, 0x3F ; 63 37aaa: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 37aae: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 37ab2: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 37ab6: 90 91 50 07 lds r25, 0x0750 ; 0x800750 37aba: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 37abe: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 37ac2: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 37ac6: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 37aca: 90 93 50 07 sts 0x0750, r25 ; 0x800750 plan_buffer_line_curposXYZE(95); 37ace: 60 e0 ldi r22, 0x00 ; 0 37ad0: 70 e0 ldi r23, 0x00 ; 0 37ad2: 8e eb ldi r24, 0xBE ; 190 37ad4: 92 e4 ldi r25, 0x42 ; 66 37ad6: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 37ada: 0f 94 24 59 call 0x2b248 ; 0x2b248 disable_e0(); 37ade: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 37ae0: 80 91 f8 04 lds r24, 0x04F8 ; 0x8004f8 37ae4: c0 e0 ldi r28, 0x00 ; 0 37ae6: d1 e0 ldi r29, 0x01 ; 1 37ae8: 02 c0 rjmp .+4 ; 0x37aee <__vector_5+0x24e> 37aea: d6 95 lsr r29 37aec: c7 95 ror r28 37aee: 8a 95 dec r24 37af0: e2 f7 brpl .-8 ; 0x37aea <__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); 37af2: 82 e0 ldi r24, 0x02 ; 2 37af4: 0f 94 28 3a call 0x27450 ; 0x27450 current_position[Z_AXIS] += float(1024 - z_microsteps) 37af8: 60 e0 ldi r22, 0x00 ; 0 37afa: 74 e0 ldi r23, 0x04 ; 4 37afc: 68 1b sub r22, r24 37afe: 79 0b sbc r23, r25 37b00: 90 e0 ldi r25, 0x00 ; 0 37b02: 80 e0 ldi r24, 0x00 ; 0 37b04: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 37b08: 4b 01 movw r8, r22 37b0a: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37b0c: be 01 movw r22, r28 37b0e: 90 e0 ldi r25, 0x00 ; 0 37b10: 80 e0 ldi r24, 0x00 ; 0 37b12: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 37b16: 20 91 78 06 lds r18, 0x0678 ; 0x800678 37b1a: 30 91 79 06 lds r19, 0x0679 ; 0x800679 37b1e: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 37b22: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 37b26: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 37b2a: 9b 01 movw r18, r22 37b2c: ac 01 movw r20, r24 37b2e: c5 01 movw r24, r10 37b30: b4 01 movw r22, r8 37b32: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> + UVLO_Z_AXIS_SHIFT; 37b36: 2a e0 ldi r18, 0x0A ; 10 37b38: 37 ed ldi r19, 0xD7 ; 215 37b3a: 43 e2 ldi r20, 0x23 ; 35 37b3c: 5f e3 ldi r21, 0x3F ; 63 37b3e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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) 37b42: 20 91 49 07 lds r18, 0x0749 ; 0x800749 37b46: 30 91 4a 07 lds r19, 0x074A ; 0x80074a 37b4a: 40 91 4b 07 lds r20, 0x074B ; 0x80074b 37b4e: 50 91 4c 07 lds r21, 0x074C ; 0x80074c 37b52: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 37b56: 60 93 49 07 sts 0x0749, r22 ; 0x800749 37b5a: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 37b5e: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 37b62: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37b66: 65 e5 ldi r22, 0x55 ; 85 37b68: 75 e5 ldi r23, 0x55 ; 85 37b6a: 85 e5 ldi r24, 0x55 ; 85 37b6c: 91 e4 ldi r25, 0x41 ; 65 37b6e: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 37b72: 0f 94 24 59 call 0x2b248 ; 0x2b248 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37b76: 40 91 00 18 lds r20, 0x1800 ; 0x801800 37b7a: 50 91 01 18 lds r21, 0x1801 ; 0x801801 37b7e: 60 91 02 18 lds r22, 0x1802 ; 0x801802 37b82: 70 91 03 18 lds r23, 0x1803 ; 0x801803 37b86: 81 e9 ldi r24, 0x91 ; 145 37b88: 9f e0 ldi r25, 0x0F ; 15 37b8a: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 37b8e: ce ea ldi r28, 0xAE ; 174 37b90: 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; 37b92: 97 e0 ldi r25, 0x07 ; 7 37b94: 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; 37b96: 70 e0 ldi r23, 0x00 ; 0 37b98: 60 e0 ldi r22, 0x00 ; 0 37b9a: 00 23 and r16, r16 37b9c: 19 f1 breq .+70 ; 0x37be4 <__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; 37b9e: 81 2f mov r24, r17 37ba0: 6b 2d mov r22, r11 37ba2: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__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; 37ba6: b8 9e mul r11, r24 37ba8: f0 01 movw r30, r0 37baa: 11 24 eor r1, r1 37bac: e9 0f add r30, r25 37bae: f1 1d adc r31, r1 37bb0: ee 0f add r30, r30 37bb2: ff 1f adc r31, r31 37bb4: ee 0f add r30, r30 37bb6: ff 1f adc r31, r31 37bb8: e2 56 subi r30, 0x62 ; 98 37bba: fc 4e sbci r31, 0xEC ; 236 37bbc: 20 e0 ldi r18, 0x00 ; 0 37bbe: 30 e0 ldi r19, 0x00 ; 0 37bc0: 4a e7 ldi r20, 0x7A ; 122 37bc2: 54 e4 ldi r21, 0x44 ; 68 37bc4: 61 81 ldd r22, Z+1 ; 0x01 37bc6: 72 81 ldd r23, Z+2 ; 0x02 37bc8: 83 81 ldd r24, Z+3 ; 0x03 37bca: 94 81 ldd r25, Z+4 ; 0x04 37bcc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 37bd0: 20 e0 ldi r18, 0x00 ; 0 37bd2: 30 e0 ldi r19, 0x00 ; 0 37bd4: 40 e0 ldi r20, 0x00 ; 0 37bd6: 5f e3 ldi r21, 0x3F ; 63 37bd8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 37bdc: 0f 94 58 e0 call 0x3c0b0 ; 0x3c0b0 37be0: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37be4: ce 01 movw r24, r28 37be6: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 // 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) 37bea: 1f 5f subi r17, 0xFF ; 255 37bec: 22 96 adiw r28, 0x02 ; 2 37bee: 11 33 cpi r17, 0x31 ; 49 37bf0: 91 f6 brne .-92 ; 0x37b96 <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37bf2: 40 91 49 07 lds r20, 0x0749 ; 0x800749 37bf6: 50 91 4a 07 lds r21, 0x074A ; 0x80074a 37bfa: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 37bfe: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 37c02: 8a ed ldi r24, 0xDA ; 218 37c04: 9e e0 ldi r25, 0x0E ; 14 37c06: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 37c0a: 40 91 9b 02 lds r20, 0x029B ; 0x80029b 37c0e: 50 91 9c 02 lds r21, 0x029C ; 0x80029c 37c12: 60 91 9d 02 lds r22, 0x029D ; 0x80029d 37c16: 70 91 9e 02 lds r23, 0x029E ; 0x80029e 37c1a: 8d e9 ldi r24, 0x9D ; 157 37c1c: 9f e0 ldi r25, 0x0F ; 15 37c1e: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 37c22: 40 91 9f 02 lds r20, 0x029F ; 0x80029f 37c26: 50 91 a0 02 lds r21, 0x02A0 ; 0x8002a0 37c2a: 60 91 a1 02 lds r22, 0x02A1 ; 0x8002a1 37c2e: 70 91 a2 02 lds r23, 0x02A2 ; 0x8002a2 37c32: 81 ea ldi r24, 0xA1 ; 161 37c34: 9f e0 ldi r25, 0x0F ; 15 37c36: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37c3a: 60 91 fe 17 lds r22, 0x17FE ; 0x8017fe 37c3e: 70 91 ff 17 lds r23, 0x17FF ; 0x8017ff 37c42: 89 e8 ldi r24, 0x89 ; 137 37c44: 9f e0 ldi r25, 0x0F ; 15 37c46: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 37c4a: 60 91 39 02 lds r22, 0x0239 ; 0x800239 37c4e: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 37c52: 85 e3 ldi r24, 0x35 ; 53 37c54: 9d e0 ldi r25, 0x0D ; 13 37c56: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 37c5a: 60 91 ab 05 lds r22, 0x05AB ; 0x8005ab 37c5e: 70 91 ac 05 lds r23, 0x05AC ; 0x8005ac 37c62: 88 ed ldi r24, 0xD8 ; 216 37c64: 9e e0 ldi r25, 0x0E ; 14 37c66: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37c6a: 60 91 ad 05 lds r22, 0x05AD ; 0x8005ad 37c6e: 8b e8 ldi r24, 0x8B ; 139 37c70: 9f e0 ldi r25, 0x0F ; 15 37c72: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 37c76: 60 91 aa 05 lds r22, 0x05AA ; 0x8005aa 37c7a: 88 e8 ldi r24, 0x88 ; 136 37c7c: 9f e0 ldi r25, 0x0F ; 15 37c7e: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c82: 40 91 bb 02 lds r20, 0x02BB ; 0x8002bb 37c86: 50 91 bc 02 lds r21, 0x02BC ; 0x8002bc 37c8a: 60 91 bd 02 lds r22, 0x02BD ; 0x8002bd 37c8e: 70 91 be 02 lds r23, 0x02BE ; 0x8002be 37c92: 88 ee ldi r24, 0xE8 ; 232 37c94: 9e e0 ldi r25, 0x0E ; 14 37c96: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37c9a: 60 91 94 02 lds r22, 0x0294 ; 0x800294 37c9e: 70 91 95 02 lds r23, 0x0295 ; 0x800295 37ca2: 8e ed ldi r24, 0xDE ; 222 37ca4: 9e e0 ldi r25, 0x0E ; 14 37ca6: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37caa: 40 91 a0 06 lds r20, 0x06A0 ; 0x8006a0 37cae: 50 91 a1 06 lds r21, 0x06A1 ; 0x8006a1 37cb2: 60 91 a2 06 lds r22, 0x06A2 ; 0x8006a2 37cb6: 70 91 a3 06 lds r23, 0x06A3 ; 0x8006a3 37cba: 81 e1 ldi r24, 0x11 ; 17 37cbc: 9d e0 ldi r25, 0x0D ; 13 37cbe: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 37cc2: 40 91 a4 06 lds r20, 0x06A4 ; 0x8006a4 37cc6: 50 91 a5 06 lds r21, 0x06A5 ; 0x8006a5 37cca: 60 91 a6 06 lds r22, 0x06A6 ; 0x8006a6 37cce: 70 91 a7 06 lds r23, 0x06A7 ; 0x8006a7 37cd2: 8d e0 ldi r24, 0x0D ; 13 37cd4: 9d e0 ldi r25, 0x0D ; 13 37cd6: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 37cda: 40 91 2c 07 lds r20, 0x072C ; 0x80072c 37cde: 50 91 2d 07 lds r21, 0x072D ; 0x80072d 37ce2: 60 91 2e 07 lds r22, 0x072E ; 0x80072e 37ce6: 70 91 2f 07 lds r23, 0x072F ; 0x80072f 37cea: 89 e0 ldi r24, 0x09 ; 9 37cec: 9d e0 ldi r25, 0x0D ; 13 37cee: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e #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); 37cf2: 40 e1 ldi r20, 0x10 ; 16 37cf4: 50 e0 ldi r21, 0x00 ; 0 37cf6: 67 e3 ldi r22, 0x37 ; 55 37cf8: 7d e0 ldi r23, 0x0D ; 13 37cfa: 8b ea ldi r24, 0xAB ; 171 37cfc: 92 e0 ldi r25, 0x02 ; 2 37cfe: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37d02: 60 91 09 18 lds r22, 0x1809 ; 0x801809 37d06: 70 91 0a 18 lds r23, 0x180A ; 0x80180a 37d0a: 8c e6 ldi r24, 0x6C ; 108 37d0c: 9f e0 ldi r25, 0x0F ; 15 37d0e: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37d12: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 37d16: 8c e8 ldi r24, 0x8C ; 140 37d18: 9f e0 ldi r25, 0x0F ; 15 37d1a: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37d1e: 40 91 05 18 lds r20, 0x1805 ; 0x801805 37d22: 50 91 06 18 lds r21, 0x1806 ; 0x801806 37d26: 60 91 07 18 lds r22, 0x1807 ; 0x801807 37d2a: 70 91 08 18 lds r23, 0x1808 ; 0x801808 37d2e: 8c e2 ldi r24, 0x2C ; 44 37d30: 9d e0 ldi r25, 0x0D ; 13 37d32: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37d36: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 37d3a: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 37d3e: 8d e7 ldi r24, 0x7D ; 125 37d40: 9c e0 ldi r25, 0x0C ; 12 37d42: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 #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); 37d46: 40 e1 ldi r20, 0x10 ; 16 37d48: 50 e0 ldi r21, 0x00 ; 0 37d4a: 6d e6 ldi r22, 0x6D ; 109 37d4c: 7c e0 ldi r23, 0x0C ; 12 37d4e: 80 e9 ldi r24, 0x90 ; 144 37d50: 96 e0 ldi r25, 0x06 ; 6 37d52: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 37d56: 40 e1 ldi r20, 0x10 ; 16 37d58: 50 e0 ldi r21, 0x00 ; 0 37d5a: 6d e5 ldi r22, 0x5D ; 93 37d5c: 7c e0 ldi r23, 0x0C ; 12 37d5e: 88 e1 ldi r24, 0x18 ; 24 37d60: 97 e0 ldi r25, 0x07 ; 7 37d62: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 37d66: 40 e1 ldi r20, 0x10 ; 16 37d68: 50 e0 ldi r21, 0x00 ; 0 37d6a: 6d e4 ldi r22, 0x4D ; 77 37d6c: 7c e0 ldi r23, 0x0C ; 12 37d6e: 80 e8 ldi r24, 0x80 ; 128 37d70: 96 e0 ldi r25, 0x06 ; 6 37d72: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 37d76: 40 e1 ldi r20, 0x10 ; 16 37d78: 50 e0 ldi r21, 0x00 ; 0 37d7a: 6d e3 ldi r22, 0x3D ; 61 37d7c: 7c e0 ldi r23, 0x0C ; 12 37d7e: 88 e0 ldi r24, 0x08 ; 8 37d80: 97 e0 ldi r25, 0x07 ; 7 37d82: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37d86: 40 91 a8 06 lds r20, 0x06A8 ; 0x8006a8 37d8a: 50 91 a9 06 lds r21, 0x06A9 ; 0x8006a9 37d8e: 60 91 aa 06 lds r22, 0x06AA ; 0x8006aa 37d92: 70 91 ab 06 lds r23, 0x06AB ; 0x8006ab 37d96: 89 e3 ldi r24, 0x39 ; 57 37d98: 9c e0 ldi r25, 0x0C ; 12 37d9a: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 37d9e: 40 91 ac 06 lds r20, 0x06AC ; 0x8006ac 37da2: 50 91 ad 06 lds r21, 0x06AD ; 0x8006ad 37da6: 60 91 ae 06 lds r22, 0x06AE ; 0x8006ae 37daa: 70 91 af 06 lds r23, 0x06AF ; 0x8006af 37dae: 85 e3 ldi r24, 0x35 ; 53 37db0: 9c e0 ldi r25, 0x0C ; 12 37db2: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37db6: 40 91 b0 06 lds r20, 0x06B0 ; 0x8006b0 37dba: 50 91 b1 06 lds r21, 0x06B1 ; 0x8006b1 37dbe: 60 91 b2 06 lds r22, 0x06B2 ; 0x8006b2 37dc2: 70 91 b3 06 lds r23, 0x06B3 ; 0x8006b3 37dc6: 81 e3 ldi r24, 0x31 ; 49 37dc8: 9c e0 ldi r25, 0x0C ; 12 37dca: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e #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); 37dce: 40 e1 ldi r20, 0x10 ; 16 37dd0: 50 e0 ldi r21, 0x00 ; 0 37dd2: 61 e2 ldi r22, 0x21 ; 33 37dd4: 7c e0 ldi r23, 0x0C ; 12 37dd6: 84 eb ldi r24, 0xB4 ; 180 37dd8: 96 e0 ldi r25, 0x06 ; 6 37dda: 0f 94 9d dd call 0x3bb3a ; 0x3bb3a 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) { 37dde: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 37de2: 88 23 and r24, r24 37de4: 29 f0 breq .+10 ; 0x37df0 <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37de6: 61 e0 ldi r22, 0x01 ; 1 37de8: 8f e7 ldi r24, 0x7F ; 127 37dea: 9c e0 ldi r25, 0x0C ; 12 37dec: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 37df0: 61 e0 ldi r22, 0x01 ; 1 37df2: 85 ea ldi r24, 0xA5 ; 165 37df4: 9f e0 ldi r25, 0x0F ; 15 37df6: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 37dfa: 84 e6 ldi r24, 0x64 ; 100 37dfc: 9f e0 ldi r25, 0x0F ; 15 37dfe: 0e 94 ab 77 call 0xef56 ; 0xef56 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 37e02: 8f ef ldi r24, 0xFF ; 255 37e04: 9e e0 ldi r25, 0x0E ; 14 37e06: 0e 94 9e 77 call 0xef3c ; 0xef3c printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 37e0a: 0f 94 83 3f call 0x27f06 ; 0x27f06 37e0e: dc 01 movw r26, r24 37e10: cb 01 movw r24, r22 37e12: 8c 19 sub r24, r12 37e14: 9d 09 sbc r25, r13 37e16: ae 09 sbc r26, r14 37e18: bf 09 sbc r27, r15 37e1a: bf 93 push r27 37e1c: af 93 push r26 37e1e: 9f 93 push r25 37e20: 8f 93 push r24 37e22: 83 e5 ldi r24, 0x53 ; 83 37e24: 91 e7 ldi r25, 0x71 ; 113 37e26: 9f 93 push r25 37e28: 8f 93 push r24 37e2a: 0f 94 4b dc call 0x3b896 ; 0x3b896 WRITE(BEEPER,HIGH); 37e2e: 9f b7 in r25, 0x3f ; 63 37e30: f8 94 cli 37e32: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37e36: 84 60 ori r24, 0x04 ; 4 37e38: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37e3c: 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(); 37e3e: 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; 37e40: 0f 90 pop r0 37e42: 0f 90 pop r0 37e44: 0f 90 pop r0 37e46: 0f 90 pop r0 37e48: 0f 90 pop r0 37e4a: 0f 90 pop r0 37e4c: 20 e0 ldi r18, 0x00 ; 0 37e4e: 30 e0 ldi r19, 0x00 ; 0 37e50: 4f ef ldi r20, 0xFF ; 255 37e52: 52 e4 ldi r21, 0x42 ; 66 37e54: 60 91 41 07 lds r22, 0x0741 ; 0x800741 37e58: 70 91 42 07 lds r23, 0x0742 ; 0x800742 37e5c: 80 91 43 07 lds r24, 0x0743 ; 0x800743 37e60: 90 91 44 07 lds r25, 0x0744 ; 0x800744 37e64: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 37e68: 87 fd sbrc r24, 7 37e6a: 1f c0 rjmp .+62 ; 0x37eaa <__vector_5+0x60a> 37e6c: 80 e0 ldi r24, 0x00 ; 0 37e6e: 90 e0 ldi r25, 0x00 ; 0 37e70: af e7 ldi r26, 0x7F ; 127 37e72: b3 e4 ldi r27, 0x43 ; 67 37e74: 80 93 41 07 sts 0x0741, r24 ; 0x800741 37e78: 90 93 42 07 sts 0x0742, r25 ; 0x800742 37e7c: a0 93 43 07 sts 0x0743, r26 ; 0x800743 37e80: b0 93 44 07 sts 0x0744, r27 ; 0x800744 plan_buffer_line_curposXYZE(500); 37e84: 60 e0 ldi r22, 0x00 ; 0 37e86: 70 e0 ldi r23, 0x00 ; 0 37e88: 8a ef ldi r24, 0xFA ; 250 37e8a: 93 e4 ldi r25, 0x43 ; 67 37e8c: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 37e90: 0f 94 24 59 call 0x2b248 ; 0x2b248 37e94: 88 e1 ldi r24, 0x18 ; 24 37e96: 9e e0 ldi r25, 0x0E ; 14 37e98: 0f b6 in r0, 0x3f ; 63 37e9a: f8 94 cli 37e9c: a8 95 wdr 37e9e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37ea2: 0f be out 0x3f, r0 ; 63 37ea4: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37ea8: ff cf rjmp .-2 ; 0x37ea8 <__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; 37eaa: 80 e0 ldi r24, 0x00 ; 0 37eac: 90 e0 ldi r25, 0x00 ; 0 37eae: dc 01 movw r26, r24 37eb0: e1 cf rjmp .-62 ; 0x37e74 <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 37eb2: 0f 94 83 3f call 0x27f06 ; 0x27f06 37eb6: 6b 01 movw r12, r22 37eb8: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 37eba: 17 9a sbi 0x02, 7 ; 2 37ebc: 10 92 3e 07 sts 0x073E, r1 ; 0x80073e disable_y(); 37ec0: 16 9a sbi 0x02, 6 ; 2 37ec2: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f disable_e0(); 37ec6: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 37ec8: 64 e1 ldi r22, 0x14 ; 20 37eca: 83 e6 ldi r24, 0x63 ; 99 37ecc: 92 e0 ldi r25, 0x02 ; 2 37ece: 0e 94 ab 68 call 0xd156 ; 0xd156 currents[Z_AXIS].setiRun(20); 37ed2: 64 e1 ldi r22, 0x14 ; 20 37ed4: 83 e6 ldi r24, 0x63 ; 99 37ed6: 92 e0 ldi r25, 0x02 ; 2 37ed8: 0e 94 b3 68 call 0xd166 ; 0xd166 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 37edc: 50 e0 ldi r21, 0x00 ; 0 37ede: 40 e0 ldi r20, 0x00 ; 0 37ee0: 60 91 f8 04 lds r22, 0x04F8 ; 0x8004f8 37ee4: 82 e0 ldi r24, 0x02 ; 2 37ee6: 0f 94 42 3a call 0x27484 ; 0x27484 #endif //TMC2130 // Stop all heaters disable_heater(); 37eea: 0f 94 4f 45 call 0x28a9e ; 0x28a9e // 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; 37eee: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e planner_abort_hard(); 37ef2: 0f 94 05 bc call 0x3780a ; 0x3780a // 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]) 37ef6: 80 90 49 07 lds r8, 0x0749 ; 0x800749 37efa: 90 90 4a 07 lds r9, 0x074A ; 0x80074a 37efe: a0 90 4b 07 lds r10, 0x074B ; 0x80074b 37f02: b0 90 4c 07 lds r11, 0x074C ; 0x80074c 37f06: 8a ed ldi r24, 0xDA ; 218 37f08: 9e e0 ldi r25, 0x0E ; 14 37f0a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37f0e: 9b 01 movw r18, r22 37f10: ac 01 movw r20, r24 37f12: c5 01 movw r24, r10 37f14: b4 01 movw r22, r8 37f16: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 37f1a: 4b 01 movw r8, r22 37f1c: 5c 01 movw r10, r24 37f1e: e8 94 clt 37f20: b7 f8 bld r11, 7 37f22: 20 91 78 06 lds r18, 0x0678 ; 0x800678 37f26: 30 91 79 06 lds r19, 0x0679 ; 0x800679 37f2a: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 37f2e: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 37f32: 60 e0 ldi r22, 0x00 ; 0 37f34: 70 e0 ldi r23, 0x00 ; 0 37f36: 80 e8 ldi r24, 0x80 ; 128 37f38: 9f e3 ldi r25, 0x3F ; 63 37f3a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 37f3e: 9b 01 movw r18, r22 37f40: ac 01 movw r20, r24 37f42: c5 01 movw r24, r10 37f44: b4 01 movw r22, r8 37f46: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 37f4a: 87 fd sbrc r24, 7 37f4c: 61 c0 rjmp .+194 ; 0x38010 <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37f4e: 0e 94 c7 80 call 0x1018e ; 0x1018e card.sdprinting = false; 37f52: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c saved_printing = true; 37f56: 81 e0 ldi r24, 0x01 ; 1 37f58: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 // 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; 37f5c: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b sei(); 37f60: 78 94 sei 37f62: 80 91 f8 04 lds r24, 0x04F8 ; 0x8004f8 37f66: c0 e0 ldi r28, 0x00 ; 0 37f68: d1 e0 ldi r29, 0x01 ; 1 37f6a: 02 c0 rjmp .+4 ; 0x37f70 <__vector_5+0x6d0> 37f6c: d6 95 lsr r29 37f6e: c7 95 ror r28 37f70: 8a 95 dec r24 37f72: e2 f7 brpl .-8 ; 0x37f6c <__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); 37f74: 82 e0 ldi r24, 0x02 ; 2 37f76: 0f 94 28 3a call 0x27450 ; 0x27450 current_position[Z_AXIS] += float(1024 - z_microsteps) 37f7a: 60 e0 ldi r22, 0x00 ; 0 37f7c: 74 e0 ldi r23, 0x04 ; 4 37f7e: 68 1b sub r22, r24 37f80: 79 0b sbc r23, r25 37f82: 90 e0 ldi r25, 0x00 ; 0 37f84: 80 e0 ldi r24, 0x00 ; 0 37f86: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 37f8a: 4b 01 movw r8, r22 37f8c: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37f8e: be 01 movw r22, r28 37f90: 90 e0 ldi r25, 0x00 ; 0 37f92: 80 e0 ldi r24, 0x00 ; 0 37f94: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 37f98: 20 91 78 06 lds r18, 0x0678 ; 0x800678 37f9c: 30 91 79 06 lds r19, 0x0679 ; 0x800679 37fa0: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 37fa4: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 37fa8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 37fac: 9b 01 movw r18, r22 37fae: ac 01 movw r20, r24 37fb0: c5 01 movw r24, r10 37fb2: b4 01 movw r22, r8 37fb4: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 37fb8: 2a e0 ldi r18, 0x0A ; 10 37fba: 37 ed ldi r19, 0xD7 ; 215 37fbc: 43 e2 ldi r20, 0x23 ; 35 37fbe: 5e e3 ldi r21, 0x3E ; 62 37fc0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__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) 37fc4: 20 91 49 07 lds r18, 0x0749 ; 0x800749 37fc8: 30 91 4a 07 lds r19, 0x074A ; 0x80074a 37fcc: 40 91 4b 07 lds r20, 0x074B ; 0x80074b 37fd0: 50 91 4c 07 lds r21, 0x074C ; 0x80074c 37fd4: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 37fd8: 60 93 49 07 sts 0x0749, r22 ; 0x800749 37fdc: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 37fe0: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 37fe4: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_TINY_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37fe8: 65 e5 ldi r22, 0x55 ; 85 37fea: 75 e5 ldi r23, 0x55 ; 85 37fec: 85 e5 ldi r24, 0x55 ; 85 37fee: 91 e4 ldi r25, 0x41 ; 65 37ff0: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 37ff4: 0f 94 24 59 call 0x2b248 ; 0x2b248 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37ff8: 40 91 49 07 lds r20, 0x0749 ; 0x800749 37ffc: 50 91 4a 07 lds r21, 0x074A ; 0x80074a 38000: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 38004: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 38008: 8a ed ldi r24, 0xDA ; 218 3800a: 9e e0 ldi r25, 0x0E ; 14 3800c: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 38010: 62 e0 ldi r22, 0x02 ; 2 38012: 85 ea ldi r24, 0xA5 ; 165 38014: 9f e0 ldi r25, 0x0F ; 15 38016: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a // 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); 3801a: 84 e6 ldi r24, 0x64 ; 100 3801c: 9f e0 ldi r25, 0x0F ; 15 3801e: 0e 94 ab 77 call 0xef56 ; 0xef56 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 38022: 8f ef ldi r24, 0xFF ; 255 38024: 9e e0 ldi r25, 0x0E ; 14 38026: 0e 94 9e 77 call 0xef3c ; 0xef3c printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 3802a: 0f 94 83 3f call 0x27f06 ; 0x27f06 3802e: dc 01 movw r26, r24 38030: cb 01 movw r24, r22 38032: 8c 19 sub r24, r12 38034: 9d 09 sbc r25, r13 38036: ae 09 sbc r26, r14 38038: bf 09 sbc r27, r15 3803a: bf 93 push r27 3803c: af 93 push r26 3803e: 9f 93 push r25 38040: 8f 93 push r24 38042: 82 e6 ldi r24, 0x62 ; 98 38044: 91 e7 ldi r25, 0x71 ; 113 38046: 9f 93 push r25 38048: 8f 93 push r24 3804a: 0f 94 4b dc call 0x3b896 ; 0x3b896 uvlo_drain_reset(); 3804e: 0f 94 32 aa call 0x35464 ; 0x35464 // 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(); } } 38052: ff 91 pop r31 38054: ef 91 pop r30 38056: df 91 pop r29 38058: cf 91 pop r28 3805a: bf 91 pop r27 3805c: af 91 pop r26 3805e: 9f 91 pop r25 38060: 8f 91 pop r24 38062: 7f 91 pop r23 38064: 6f 91 pop r22 38066: 5f 91 pop r21 38068: 4f 91 pop r20 3806a: 3f 91 pop r19 3806c: 2f 91 pop r18 3806e: 1f 91 pop r17 38070: 0f 91 pop r16 38072: ff 90 pop r15 38074: ef 90 pop r14 38076: df 90 pop r13 38078: cf 90 pop r12 3807a: bf 90 pop r11 3807c: af 90 pop r10 3807e: 9f 90 pop r9 38080: 8f 90 pop r8 38082: 0f 90 pop r0 38084: 0b be out 0x3b, r0 ; 59 38086: 0f 90 pop r0 38088: 0f be out 0x3f, r0 ; 63 3808a: 0f 90 pop r0 3808c: 1f 90 pop r1 3808e: 18 95 reti 00038090 : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 38090: 84 b1 in r24, 0x04 ; 4 38092: 81 7f andi r24, 0xF1 ; 241 38094: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 38096: 84 b1 in r24, 0x04 ; 4 38098: 87 60 ori r24, 0x07 ; 7 3809a: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 3809c: 85 b1 in r24, 0x05 ; 5 3809e: 81 7f andi r24, 0xF1 ; 241 380a0: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 380a2: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 380a4: 80 e5 ldi r24, 0x50 ; 80 380a6: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 380a8: 1d bc out 0x2d, r1 ; 45 } 380aa: 08 95 ret 000380ac : //! @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() { 380ac: 2f 92 push r2 380ae: 3f 92 push r3 380b0: 4f 92 push r4 380b2: 5f 92 push r5 380b4: 6f 92 push r6 380b6: 7f 92 push r7 380b8: 8f 92 push r8 380ba: 9f 92 push r9 380bc: af 92 push r10 380be: bf 92 push r11 380c0: cf 92 push r12 380c2: df 92 push r13 380c4: ef 92 push r14 380c6: ff 92 push r15 380c8: 0f 93 push r16 380ca: 1f 93 push r17 380cc: cf 93 push r28 380ce: df 93 push r29 380d0: cd b7 in r28, 0x3d ; 61 380d2: de b7 in r29, 0x3e ; 62 380d4: c6 50 subi r28, 0x06 ; 6 380d6: d1 40 sbci r29, 0x01 ; 1 380d8: 0f b6 in r0, 0x3f ; 63 380da: f8 94 cli 380dc: de bf out 0x3e, r29 ; 62 380de: 0f be out 0x3f, r0 ; 63 380e0: 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; 380e2: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e5> 380e6: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e6> 380ea: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e7> 380ee: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e8> 380f2: 8a 3a cpi r24, 0xAA ; 170 380f4: 95 45 sbci r25, 0x55 ; 85 380f6: aa 4a sbci r26, 0xAA ; 170 380f8: b5 45 sbci r27, 0x55 ; 85 380fa: 21 f4 brne .+8 ; 0x38104 380fc: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e4> 38100: 87 fd sbrc r24, 7 38102: c2 c1 rjmp .+900 ; 0x38488 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(); 38104: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 38106: d0 90 1f 05 lds r13, 0x051F ; 0x80051f // Flush the serial line. while (RECV_READY) { 3810a: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 3810e: 87 ff sbrs r24, 7 38110: 04 c0 rjmp .+8 ; 0x3811a wdt_reset(); 38112: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 38114: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 38118: f8 cf rjmp .-16 ; 0x3810a } selectedSerialPort = 0; //switch to Serial0 3811a: 10 92 1f 05 sts 0x051F, r1 ; 0x80051f // 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; 3811e: 00 91 93 04 lds r16, 0x0493 ; 0x800493 38122: 10 91 94 04 lds r17, 0x0494 ; 0x800494 38126: 10 93 92 04 sts 0x0492, r17 ; 0x800492 3812a: 00 93 91 04 sts 0x0491, r16 ; 0x800491 3812e: 51 e8 ldi r21, 0x81 ; 129 38130: e5 2e mov r14, r21 38132: 5b ea ldi r21, 0xAB ; 171 38134: f5 2e mov r15, r21 38136: 67 e8 ldi r22, 0x87 ; 135 38138: a6 2e mov r10, r22 3813a: 6b ea ldi r22, 0xAB ; 171 3813c: 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 ++)); 3813e: f7 01 movw r30, r14 38140: 84 91 lpm r24, Z 38142: 0f 94 60 a1 call 0x342c0 ; 0x342c0 38146: ff ef ldi r31, 0xFF ; 255 38148: ef 1a sub r14, r31 3814a: 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) 3814c: ae 14 cp r10, r14 3814e: bf 04 cpc r11, r15 38150: b1 f7 brne .-20 ; 0x3813e putch(pgm_read_byte(ptr ++)); wdt_reset(); 38152: a8 95 wdr 38154: 8f e0 ldi r24, 0x0F ; 15 38156: 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) 38158: 20 e8 ldi r18, 0x80 ; 128 3815a: 3b ea ldi r19, 0xAB ; 171 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(); 3815c: 40 e8 ldi r20, 0x80 ; 128 3815e: 54 e8 ldi r21, 0x84 ; 132 38160: 6e e1 ldi r22, 0x1E ; 30 38162: 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) { 38164: e0 91 91 04 lds r30, 0x0491 ; 0x800491 38168: f0 91 92 04 lds r31, 0x0492 ; 0x800492 3816c: e0 17 cp r30, r16 3816e: f1 07 cpc r31, r17 38170: 19 f5 brne .+70 ; 0x381b8 wdt_reset(); 38172: a8 95 wdr 38174: 41 50 subi r20, 0x01 ; 1 38176: 51 09 sbc r21, r1 38178: 61 09 sbc r22, r1 3817a: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 3817c: 99 f7 brne .-26 ; 0x38164 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 3817e: d0 92 1f 05 sts 0x051F, r13 ; 0x80051f return 0; 38182: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 38184: ca 5f subi r28, 0xFA ; 250 38186: de 4f sbci r29, 0xFE ; 254 38188: 0f b6 in r0, 0x3f ; 63 3818a: f8 94 cli 3818c: de bf out 0x3e, r29 ; 62 3818e: 0f be out 0x3f, r0 ; 63 38190: cd bf out 0x3d, r28 ; 61 38192: df 91 pop r29 38194: cf 91 pop r28 38196: 1f 91 pop r17 38198: 0f 91 pop r16 3819a: ff 90 pop r15 3819c: ef 90 pop r14 3819e: df 90 pop r13 381a0: cf 90 pop r12 381a2: bf 90 pop r11 381a4: af 90 pop r10 381a6: 9f 90 pop r9 381a8: 8f 90 pop r8 381aa: 7f 90 pop r7 381ac: 6f 90 pop r6 381ae: 5f 90 pop r5 381b0: 4f 90 pop r4 381b2: 3f 90 pop r3 381b4: 2f 90 pop r2 381b6: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 381b8: f8 01 movw r30, r16 381ba: ef 5e subi r30, 0xEF ; 239 381bc: fb 4f sbci r31, 0xFB ; 251 381be: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 381c0: 0f 5f subi r16, 0xFF ; 255 381c2: 1f 4f sbci r17, 0xFF ; 255 381c4: 0f 77 andi r16, 0x7F ; 127 381c6: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 381c8: f9 01 movw r30, r18 381ca: e8 1b sub r30, r24 381cc: f9 0b sbc r31, r25 381ce: e4 91 lpm r30, Z 381d0: 4e 13 cpse r20, r30 381d2: d5 cf rjmp .-86 ; 0x3817e { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 381d4: a8 95 wdr 381d6: 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) { 381d8: 09 f0 breq .+2 ; 0x381dc 381da: c0 cf rjmp .-128 ; 0x3815c selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 381dc: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 381e0: 8f 77 andi r24, 0x7F ; 127 381e2: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 381e6: 03 e6 ldi r16, 0x63 ; 99 381e8: 1b ea ldi r17, 0xAB ; 171 // Send the cfm magic string. ptr = entry_magic_cfm; end = strlen_P(entry_magic_cfm) + ptr; while (ptr != end) putch(pgm_read_byte(ptr ++)); 381ea: f8 01 movw r30, r16 381ec: 84 91 lpm r24, Z 381ee: 0f 94 60 a1 call 0x342c0 ; 0x342c0 381f2: 0f 5f subi r16, 0xFF ; 255 381f4: 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) 381f6: fb ea ldi r31, 0xAB ; 171 381f8: 00 37 cpi r16, 0x70 ; 112 381fa: 1f 07 cpc r17, r31 381fc: b1 f7 brne .-20 ; 0x381ea putch(pgm_read_byte(ptr ++)); } spi_init(); 381fe: 0f 94 48 c0 call 0x38090 ; 0x38090 xflash_init(); 38202: 0e 94 8e e4 call 0x1c91c ; 0x1c91c "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" ); 38206: 0f b6 in r0, 0x3f ; 63 38208: f8 94 cli 3820a: a8 95 wdr 3820c: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38210: 88 61 ori r24, 0x18 ; 24 38212: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38216: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3821a: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 3821c: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 38220: 4d e3 ldi r20, 0x3D ; 61 38222: 5b ea ldi r21, 0xAB ; 171 38224: 61 e0 ldi r22, 0x01 ; 1 38226: 80 e0 ldi r24, 0x00 ; 0 38228: 0e 94 a1 6f call 0xdf42 ; 0xdf42 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 3822c: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e5> 38230: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e6> 38234: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e7> 38238: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e8> 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; 3823c: cb 5f subi r28, 0xFB ; 251 3823e: de 4f sbci r29, 0xFE ; 254 38240: 18 82 st Y, r1 38242: c5 50 subi r28, 0x05 ; 5 38244: 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; 38246: 10 e0 ldi r17, 0x00 ; 0 38248: 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; 3824a: 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); 3824c: ae 01 movw r20, r28 3824e: 4f 5f subi r20, 0xFF ; 255 38250: 5f 4f sbci r21, 0xFF ; 255 38252: 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(); 38254: 0f 94 67 a1 call 0x342ce ; 0x342ce if(ch == STK_GET_PARAMETER) { 38258: 81 34 cpi r24, 0x41 ; 65 3825a: a9 f4 brne .+42 ; 0x38286 unsigned char which = getch(); 3825c: 0f 94 67 a1 call 0x342ce ; 0x342ce 38260: e8 2e mov r14, r24 verifySpace(); 38262: 0f 94 df a3 call 0x347be ; 0x347be /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 38266: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 38268: 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) { 3826a: e5 16 cp r14, r21 3826c: 21 f0 breq .+8 ; 0x38276 putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 3826e: 81 e8 ldi r24, 0x81 ; 129 38270: e8 12 cpse r14, r24 38272: 07 c0 rjmp .+14 ; 0x38282 putch(optiboot_version >> 8); 38274: 86 e0 ldi r24, 0x06 ; 6 38276: 0f 94 60 a1 call 0x342c0 ; 0x342c0 } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 3827a: 80 e1 ldi r24, 0x10 ; 16 3827c: 0f 94 60 a1 call 0x342c0 ; 0x342c0 38280: e9 cf rjmp .-46 ; 0x38254 } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 38282: 83 e0 ldi r24, 0x03 ; 3 38284: f8 cf rjmp .-16 ; 0x38276 } } else if(ch == STK_SET_DEVICE) { 38286: 82 34 cpi r24, 0x42 ; 66 38288: 21 f4 brne .+8 ; 0x38292 // SET DEVICE is ignored getNch(20); 3828a: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 3828c: 0f 94 eb a3 call 0x347d6 ; 0x347d6 38290: f4 cf rjmp .-24 ; 0x3827a } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 38292: 85 34 cpi r24, 0x45 ; 69 38294: 11 f4 brne .+4 ; 0x3829a // SET DEVICE EXT is ignored getNch(5); 38296: 85 e0 ldi r24, 0x05 ; 5 38298: f9 cf rjmp .-14 ; 0x3828c } else if(ch == STK_LOAD_ADDRESS) { 3829a: 85 35 cpi r24, 0x55 ; 85 3829c: c9 f4 brne .+50 ; 0x382d0 // 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(); 3829e: 0f 94 67 a1 call 0x342ce ; 0x342ce 382a2: 08 2f mov r16, r24 newAddress |= getch(); 382a4: 0f 94 67 a1 call 0x342ce ; 0x342ce 382a8: 08 2b or r16, r24 382aa: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 382ac: 0f 94 67 a1 call 0x342ce ; 0x342ce 382b0: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 382b2: 0f 94 67 a1 call 0x342ce ; 0x342ce 382b6: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 382b8: 17 ff sbrs r17, 7 382ba: 07 c0 rjmp .+14 ; 0x382ca rampz |= 0x01; 382bc: 68 94 set 382be: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 382c0: 00 0f add r16, r16 382c2: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 382c4: 0f 94 df a3 call 0x347be ; 0x347be 382c8: d8 cf rjmp .-80 ; 0x3827a newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 382ca: e8 94 clt 382cc: f0 f8 bld r15, 0 382ce: f8 cf rjmp .-16 ; 0x382c0 newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 382d0: 86 35 cpi r24, 0x56 ; 86 382d2: a1 f4 brne .+40 ; 0x382fc // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 382d4: 0f 94 67 a1 call 0x342ce ; 0x342ce 382d8: 8d 34 cpi r24, 0x4D ; 77 382da: 71 f4 brne .+28 ; 0x382f8 // get address getch(); // get '0' 382dc: 0f 94 67 a1 call 0x342ce ; 0x342ce rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 382e0: 0f 94 67 a1 call 0x342ce ; 0x342ce 382e4: 9f 2d mov r25, r15 382e6: 91 70 andi r25, 0x01 ; 1 382e8: f9 2e mov r15, r25 382ea: 88 0f add r24, r24 382ec: f8 2a or r15, r24 getNch(1); // get last '0' 382ee: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 382f0: 0f 94 eb a3 call 0x347d6 ; 0x347d6 putch(0x00); 382f4: 80 e0 ldi r24, 0x00 ; 0 382f6: bf cf rjmp .-130 ; 0x38276 // response putch(0x00); } else { // everything else is ignored getNch(3); 382f8: 83 e0 ldi r24, 0x03 ; 3 382fa: fa cf rjmp .-12 ; 0x382f0 putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 382fc: 84 36 cpi r24, 0x64 ; 100 382fe: 09 f0 breq .+2 ; 0x38302 38300: 77 c0 rjmp .+238 ; 0x383f0 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; 38302: 0f 94 67 a1 call 0x342ce ; 0x342ce 38306: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 38308: 0f 94 67 a1 call 0x342ce ; 0x342ce 3830c: c8 2e mov r12, r24 length |= getch(); 3830e: 0f 94 67 a1 call 0x342ce ; 0x342ce 38312: e8 2e mov r14, r24 length |= getch(); 38314: 0f 94 67 a1 call 0x342ce ; 0x342ce 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; 38318: d1 2c mov r13, r1 3831a: dc 2c mov r13, r12 3831c: cc 24 eor r12, r12 3831e: db 28 or r13, r11 length |= getch(); length |= getch(); 38320: 8e 29 or r24, r14 38322: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 38324: 0f 94 67 a1 call 0x342ce ; 0x342ce 38328: 58 2e mov r5, r24 3832a: fe 01 movw r30, r28 3832c: 31 96 adiw r30, 0x01 ; 1 3832e: 5f 01 movw r10, r30 38330: 46 01 movw r8, r12 38332: 8e 0e add r8, r30 38334: 9f 1e adc r9, r31 38336: ee 2e mov r14, r30 38338: ca 5f subi r28, 0xFA ; 250 3833a: de 4f sbci r29, 0xFE ; 254 3833c: b8 82 st Y, r11 3833e: c6 50 subi r28, 0x06 ; 6 38340: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 38342: 0f 94 67 a1 call 0x342ce ; 0x342ce 38346: f5 01 movw r30, r10 38348: 81 93 st Z+, r24 3834a: 5f 01 movw r10, r30 while (--length); 3834c: 8e 16 cp r8, r30 3834e: 9f 06 cpc r9, r31 38350: c1 f7 brne .-16 ; 0x38342 // Read command terminator, start reply verifySpace(); 38352: 0f 94 df a3 call 0x347be ; 0x347be if (desttype == 'E') { 38356: f5 e4 ldi r31, 0x45 ; 69 38358: 5f 12 cpse r5, r31 3835a: 01 c0 rjmp .+2 ; 0x3835e 3835c: ff cf rjmp .-2 ; 0x3835c while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 3835e: 18 01 movw r2, r16 38360: 51 2c mov r5, r1 38362: 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) { 38364: 01 15 cp r16, r1 38366: 11 05 cpc r17, r1 38368: 61 f5 brne .+88 ; 0x383c2 3836a: 42 01 movw r8, r4 3836c: aa 24 eor r10, r10 3836e: bb 24 eor r11, r11 38370: cb 5f subi r28, 0xFB ; 251 38372: de 4f sbci r29, 0xFE ; 254 38374: 28 81 ld r18, Y 38376: c5 50 subi r28, 0x05 ; 5 38378: d1 40 sbci r29, 0x01 ; 1 3837a: 82 2f mov r24, r18 3837c: 90 e0 ldi r25, 0x00 ; 0 3837e: 08 2c mov r0, r8 38380: 02 c0 rjmp .+4 ; 0x38386 38382: 95 95 asr r25 38384: 87 95 ror r24 38386: 0a 94 dec r0 38388: e2 f7 brpl .-8 ; 0x38382 3838a: 80 fd sbrc r24, 0 3838c: 1a c0 rjmp .+52 ; 0x383c2 xflash_wait_busy(); 3838e: 0e 94 1b e3 call 0x1c636 ; 0x1c636 xflash_enable_wr(); 38392: 0e 94 b7 e3 call 0x1c76e ; 0x1c76e return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 38396: b2 01 movw r22, r4 38398: a8 01 movw r20, r16 3839a: 88 ed ldi r24, 0xD8 ; 216 3839c: 0e 94 39 e3 call 0x1c672 ; 0x1c672 xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 383a0: 81 e0 ldi r24, 0x01 ; 1 383a2: 90 e0 ldi r25, 0x00 ; 0 383a4: 01 c0 rjmp .+2 ; 0x383a8 383a6: 88 0f add r24, r24 383a8: 8a 94 dec r8 383aa: ea f7 brpl .-6 ; 0x383a6 383ac: cb 5f subi r28, 0xFB ; 251 383ae: de 4f sbci r29, 0xFE ; 254 383b0: 48 81 ld r20, Y 383b2: c5 50 subi r28, 0x05 ; 5 383b4: d1 40 sbci r29, 0x01 ; 1 383b6: 48 2b or r20, r24 383b8: cb 5f subi r28, 0xFB ; 251 383ba: de 4f sbci r29, 0xFE ; 254 383bc: 48 83 st Y, r20 383be: c5 50 subi r28, 0x05 ; 5 383c0: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 383c2: 0e 94 1b e3 call 0x1c636 ; 0x1c636 xflash_enable_wr(); 383c6: 0e 94 b7 e3 call 0x1c76e ; 0x1c76e xflash_page_program(addr, buff, savelength); 383ca: 96 01 movw r18, r12 383cc: 4e 2d mov r20, r14 383ce: ca 5f subi r28, 0xFA ; 250 383d0: de 4f sbci r29, 0xFE ; 254 383d2: 58 81 ld r21, Y 383d4: c6 50 subi r28, 0x06 ; 6 383d6: d1 40 sbci r29, 0x01 ; 1 383d8: c2 01 movw r24, r4 383da: b1 01 movw r22, r2 383dc: 0e 94 3e e3 call 0x1c67c ; 0x1c67c xflash_wait_busy(); 383e0: 0e 94 1b e3 call 0x1c636 ; 0x1c636 _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 383e4: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 383e6: 84 e0 ldi r24, 0x04 ; 4 383e8: 0e 94 15 e3 call 0x1c62a ; 0x1c62a _CS_HIGH(); 383ec: 45 9a sbi 0x08, 5 ; 8 383ee: 45 cf rjmp .-374 ; 0x3827a xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 383f0: 84 37 cpi r24, 0x74 ; 116 383f2: 81 f5 brne .+96 ; 0x38454 uint32_t addr = (((uint32_t)rampz) << 16) | address; 383f4: b1 2c mov r11, r1 383f6: 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; 383f8: 0f 94 67 a1 call 0x342ce ; 0x342ce 383fc: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 383fe: 0f 94 67 a1 call 0x342ce ; 0x342ce 38402: c8 2e mov r12, r24 length |= getch(); 38404: 0f 94 67 a1 call 0x342ce ; 0x342ce 38408: e8 2e mov r14, r24 length |= getch(); 3840a: 0f 94 67 a1 call 0x342ce ; 0x342ce 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; 3840e: 2c 2d mov r18, r12 38410: 30 e0 ldi r19, 0x00 ; 0 38412: 32 2f mov r19, r18 38414: 22 27 eor r18, r18 38416: f9 01 movw r30, r18 38418: fd 29 or r31, r13 3841a: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 3841c: 8e 29 or r24, r14 3841e: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 38420: 0f 94 67 a1 call 0x342ce ; 0x342ce verifySpace(); 38424: 0f 94 df a3 call 0x347be ; 0x347be xflash_wait_busy(); 38428: 0e 94 1b e3 call 0x1c636 ; 0x1c636 xflash_rd_data(addr, buff, length); 3842c: 96 01 movw r18, r12 3842e: a3 01 movw r20, r6 38430: c5 01 movw r24, r10 38432: b8 01 movw r22, r16 38434: 0e 94 5e e3 call 0x1c6bc ; 0x1c6bc 38438: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 3843a: c5 01 movw r24, r10 3843c: 86 19 sub r24, r6 3843e: 97 09 sbc r25, r7 38440: 8c 15 cp r24, r12 38442: 9d 05 cpc r25, r13 38444: 08 f0 brcs .+2 ; 0x38448 38446: 19 cf rjmp .-462 ; 0x3827a putch(buff[i]); 38448: f5 01 movw r30, r10 3844a: 81 91 ld r24, Z+ 3844c: 5f 01 movw r10, r30 3844e: 0f 94 60 a1 call 0x342c0 ; 0x342c0 38452: f3 cf rjmp .-26 ; 0x3843a } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 38454: 85 37 cpi r24, 0x75 ; 117 38456: 51 f4 brne .+20 ; 0x3846c // READ SIGN - return what Avrdude wants to hear verifySpace(); 38458: 0f 94 df a3 call 0x347be ; 0x347be putch(XFLASH_SIGNATURE_0); 3845c: 8e e1 ldi r24, 0x1E ; 30 3845e: 0f 94 60 a1 call 0x342c0 ; 0x342c0 putch(XFLASH_SIGNATURE_1); 38462: 88 e9 ldi r24, 0x98 ; 152 38464: 0f 94 60 a1 call 0x342c0 ; 0x342c0 putch(XFLASH_SIGNATURE_2); 38468: 81 e0 ldi r24, 0x01 ; 1 3846a: 05 cf rjmp .-502 ; 0x38276 } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 3846c: 81 35 cpi r24, 0x51 ; 81 3846e: 09 f0 breq .+2 ; 0x38472 38470: 29 cf rjmp .-430 ; 0x382c4 : "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" ); 38472: f8 e1 ldi r31, 0x18 ; 24 38474: 28 e0 ldi r18, 0x08 ; 8 38476: 0f b6 in r0, 0x3f ; 63 38478: f8 94 cli 3847a: a8 95 wdr 3847c: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38480: 0f be out 0x3f, r0 ; 63 38482: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38486: 1e cf rjmp .-452 ; 0x382c4 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; 38488: 81 e0 ldi r24, 0x01 ; 1 3848a: 7c ce rjmp .-776 ; 0x38184 0003848c : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 3848c: 81 e0 ldi r24, 0x01 ; 1 3848e: 0c 94 d2 6f jmp 0xdfa4 ; 0xdfa4 00038492 : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 38492: 0f 93 push r16 38494: 1f 93 push r17 38496: cf 93 push r28 38498: 8c 01 movw r16, r24 3849a: c6 2f mov r28, r22 lcd_update_enable(false); 3849c: 80 e0 ldi r24, 0x00 ; 0 3849e: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_clear(); 384a2: 0e 94 c0 6f call 0xdf80 ; 0xdf80 lcd_puts_at_P(0, 1, pgmS); 384a6: a8 01 movw r20, r16 384a8: 61 e0 ldi r22, 0x01 ; 1 384aa: 80 e0 ldi r24, 0x00 ; 0 384ac: 0e 94 a1 6f call 0xdf42 ; 0xdf42 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 384b0: 80 e2 ldi r24, 0x20 ; 32 384b2: 0e 94 3c 70 call 0xe078 ; 0xe078 lcd_print(' '); lcd_print(slot + 1); 384b6: 6c 2f mov r22, r28 384b8: 70 e0 ldi r23, 0x00 ; 0 384ba: 6f 5f subi r22, 0xFF ; 255 384bc: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 384be: 07 2e mov r0, r23 384c0: 00 0c add r0, r0 384c2: 88 0b sbc r24, r24 384c4: 99 0b sbc r25, r25 } 384c6: cf 91 pop r28 384c8: 1f 91 pop r17 384ca: 0f 91 pop r16 384cc: 0c 94 46 71 jmp 0xe28c ; 0xe28c 000384d0 : 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); 384d0: 82 ed ldi r24, 0xD2 ; 210 384d2: 9e e0 ldi r25, 0x0E ; 14 384d4: 0e 94 ab 77 call 0xef56 ; 0xef56 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 384d8: 83 ed ldi r24, 0xD3 ; 211 384da: 9e e0 ldi r25, 0x0E ; 14 384dc: 0c 94 9e 77 jmp 0xef3c ; 0xef3c 000384e0 : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 384e0: 41 e0 ldi r20, 0x01 ; 1 384e2: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 384e6: 81 11 cpse r24, r1 384e8: 01 c0 rjmp .+2 ; 0x384ec 384ea: 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'); 384ec: 40 5d subi r20, 0xD0 ; 208 384ee: 62 e0 ldi r22, 0x02 ; 2 384f0: 83 e0 ldi r24, 0x03 ; 3 384f2: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 384f6: 0e 94 b4 e4 call 0x1c968 ; 0x1c968 384fa: 40 e3 ldi r20, 0x30 ; 48 384fc: 48 0f add r20, r24 384fe: 62 e0 ldi r22, 0x02 ; 2 38500: 88 e0 ldi r24, 0x08 ; 8 38502: 0e 94 ad 6f call 0xdf5a ; 0xdf5a // print active/changing filament slot lcd_set_cursor(10, 2); 38506: 62 e0 ldi r22, 0x02 ; 2 38508: 8a e0 ldi r24, 0x0A ; 10 3850a: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcdui_print_extruder(); 3850e: 0f 94 a1 37 call 0x26f42 ; 0x26f42 // Print active extruder temperature lcd_set_cursor(16, 2); 38512: 62 e0 ldi r22, 0x02 ; 2 38514: 80 e1 ldi r24, 0x10 ; 16 38516: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 3851a: 20 e0 ldi r18, 0x00 ; 0 3851c: 30 e0 ldi r19, 0x00 ; 0 3851e: 40 e0 ldi r20, 0x00 ; 0 38520: 5f e3 ldi r21, 0x3F ; 63 38522: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 38526: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 3852a: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 3852e: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 38532: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 38536: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> 3853a: 7f 93 push r23 3853c: 6f 93 push r22 3853e: 8b e2 ldi r24, 0x2B ; 43 38540: 9a ea ldi r25, 0xAA ; 170 38542: 9f 93 push r25 38544: 8f 93 push r24 38546: 0e 94 66 6f call 0xdecc ; 0xdecc 3854a: 0f 90 pop r0 3854c: 0f 90 pop r0 3854e: 0f 90 pop r0 38550: 0f 90 pop r0 } 38552: 08 95 ret 00038554 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 38554: 8a 30 cpi r24, 0x0A ; 10 38556: 20 f0 brcs .+8 ; 0x38560 38558: 80 31 cpi r24, 0x10 ; 16 3855a: 20 f4 brcc .+8 ; 0x38564 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 3855c: 89 5a subi r24, 0xA9 ; 169 3855e: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 38560: 80 5d subi r24, 0xD0 ; 208 38562: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 38564: 80 e0 ldi r24, 0x00 ; 0 } } 38566: 08 95 ret 00038568 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 38568: 0f 93 push r16 3856a: 1f 93 push r17 3856c: cf 93 push r28 3856e: df 93 push r29 38570: 08 2f mov r16, r24 38572: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 38574: 90 e0 ldi r25, 0x00 ; 0 38576: 24 e0 ldi r18, 0x04 ; 4 38578: 95 95 asr r25 3857a: 87 95 ror r24 3857c: 2a 95 dec r18 3857e: e1 f7 brne .-8 ; 0x38578 uint8_t charsOut = 1; 38580: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 38582: 00 97 sbiw r24, 0x00 ; 0 38584: 21 f0 breq .+8 ; 0x3858e *dst = Nibble2Char(v); 38586: 0f 94 aa c2 call 0x38554 ; 0x38554 3858a: 89 93 st Y+, r24 ++dst; charsOut = 2; 3858c: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 3858e: 80 2f mov r24, r16 38590: 8f 70 andi r24, 0x0F ; 15 38592: 0f 94 aa c2 call 0x38554 ; 0x38554 38596: 88 83 st Y, r24 return charsOut; } 38598: 81 2f mov r24, r17 3859a: df 91 pop r29 3859c: cf 91 pop r28 3859e: 1f 91 pop r17 385a0: 0f 91 pop r16 385a2: 08 95 ret 000385a4 : } 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) { 385a4: 80 33 cpi r24, 0x30 ; 48 385a6: 30 f0 brcs .+12 ; 0x385b4 385a8: 8a 33 cpi r24, 0x3A ; 58 385aa: 30 f0 brcs .+12 ; 0x385b8 385ac: 9f e9 ldi r25, 0x9F ; 159 385ae: 98 0f add r25, r24 385b0: 96 30 cpi r25, 0x06 ; 6 385b2: 20 f0 brcs .+8 ; 0x385bc case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 385b4: 80 e0 ldi r24, 0x00 ; 0 } } 385b6: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 385b8: 80 53 subi r24, 0x30 ; 48 385ba: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 385bc: 87 55 subi r24, 0x57 ; 87 385be: 08 95 ret 000385c0 : /// 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 { 385c0: cf 93 push r28 385c2: df 93 push r29 385c4: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 385c6: 68 81 ld r22, Y 385c8: 80 e0 ldi r24, 0x00 ; 0 385ca: 0f 94 73 a1 call 0x342e6 ; 0x342e6 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 385ce: 69 81 ldd r22, Y+1 ; 0x01 385d0: 0f 94 73 a1 call 0x342e6 ; 0x342e6 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 385d4: 6a 81 ldd r22, Y+2 ; 0x02 385d6: 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]); 385d8: 0f 94 73 a1 call 0x342e6 ; 0x342e6 385dc: 6c 2f mov r22, r28 return crc; } 385de: df 91 pop r29 385e0: cf 91 pop r28 385e2: 0d 94 73 a1 jmp 0x342e6 ; 0x342e6 000385e6 : 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 { 385e6: cf 93 push r28 385e8: df 93 push r29 385ea: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 385ec: 0f 94 e0 c2 call 0x385c0 ; 0x385c0 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 385f0: 6d 81 ldd r22, Y+5 ; 0x05 385f2: 0f 94 73 a1 call 0x342e6 ; 0x342e6 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 385f6: 6e 81 ldd r22, Y+6 ; 0x06 385f8: cf 81 ldd r28, Y+7 ; 0x07 385fa: 0f 94 73 a1 call 0x342e6 ; 0x342e6 385fe: 6c 2f mov r22, r28 return crc; } 38600: df 91 pop r29 38602: cf 91 pop r28 38604: 0d 94 73 a1 jmp 0x342e6 ; 0x342e6 00038608 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 38608: cf 93 push r28 3860a: df 93 push r29 3860c: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 3860e: 68 83 st Y, r22 38610: 49 83 std Y+1, r20 ; 0x01 38612: 1b 82 std Y+3, r1 ; 0x03 38614: 1a 82 std Y+2, r1 ; 0x02 38616: 0f 94 e0 c2 call 0x385c0 ; 0x385c0 3861a: 8c 83 std Y+4, r24 ; 0x04 } 3861c: df 91 pop r29 3861e: cf 91 pop r28 38620: 08 95 ret 00038622 : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 38622: 9f b7 in r25, 0x3f ; 63 38624: f8 94 cli 38626: e5 e0 ldi r30, 0x05 ; 5 38628: f1 e0 ldi r31, 0x01 ; 1 3862a: 80 81 ld r24, Z 3862c: 8f 7d andi r24, 0xDF ; 223 3862e: 80 83 st Z, r24 38630: 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); 38632: 8f e8 ldi r24, 0x8F ; 143 38634: 91 e0 ldi r25, 0x01 ; 1 38636: 01 97 sbiw r24, 0x01 ; 1 38638: f1 f7 brne .-4 ; 0x38636 3863a: 00 c0 rjmp .+0 ; 0x3863c 3863c: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 3863e: 9f b7 in r25, 0x3f ; 63 38640: f8 94 cli 38642: 80 81 ld r24, Z 38644: 80 62 ori r24, 0x20 ; 32 38646: 80 83 st Z, r24 38648: 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 } 3864a: 08 95 ret 0003864c : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 3864c: 14 9a sbi 0x02, 4 ; 2 } 3864e: 08 95 ret 00038650 : 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) { 38650: cf 92 push r12 38652: df 92 push r13 38654: ef 92 push r14 38656: ff 92 push r15 38658: cf 93 push r28 3865a: df 93 push r29 3865c: 69 01 movw r12, r18 3865e: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 38660: c1 e4 ldi r28, 0x41 ; 65 38662: d7 e0 ldi r29, 0x07 ; 7 38664: 9b 01 movw r18, r22 38666: ac 01 movw r20, r24 38668: 6c 85 ldd r22, Y+12 ; 0x0c 3866a: 7d 85 ldd r23, Y+13 ; 0x0d 3866c: 8e 85 ldd r24, Y+14 ; 0x0e 3866e: 9f 85 ldd r25, Y+15 ; 0x0f 38670: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 38674: 6c 87 std Y+12, r22 ; 0x0c 38676: 7d 87 std Y+13, r23 ; 0x0d 38678: 8e 87 std Y+14, r24 ; 0x0e 3867a: 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); 3867c: c7 01 movw r24, r14 3867e: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 38680: df 91 pop r29 38682: cf 91 pop r28 38684: ff 90 pop r15 38686: ef 90 pop r14 38688: df 90 pop r13 3868a: 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); 3868c: 0d 94 8b ba jmp 0x37516 ; 0x37516 00038690 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 38690: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 38694: 0d 94 24 59 jmp 0x2b248 ; 0x2b248 00038698 : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 38698: cf 93 push r28 3869a: df 93 push r29 3869c: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 3869e: 82 ee ldi r24, 0xE2 ; 226 386a0: 99 ea ldi r25, 0xA9 ; 169 386a2: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_MMU2(); 386a6: 85 e2 ldi r24, 0x25 ; 37 386a8: 9a ea ldi r25, 0xAA ; 170 386aa: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 SERIAL_ECHOLNRPGM(msg); 386ae: ce 01 movw r24, r28 } 386b0: df 91 pop r29 386b2: 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); 386b4: 0c 94 fe 7a jmp 0xf5fc ; 0xf5fc 000386b8 : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 386b8: 0c 94 b4 e4 jmp 0x1c968 ; 0x1c968 000386bc : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386bc: 89 32 cpi r24, 0x29 ; 41 386be: 20 e8 ldi r18, 0x80 ; 128 386c0: 92 07 cpc r25, r18 386c2: 09 f4 brne .+2 ; 0x386c6 386c4: 97 c0 rjmp .+302 ; 0x387f4 386c6: 08 f0 brcs .+2 ; 0x386ca 386c8: 48 c0 rjmp .+144 ; 0x3875a 386ca: 86 30 cpi r24, 0x06 ; 6 386cc: 60 e8 ldi r22, 0x80 ; 128 386ce: 96 07 cpc r25, r22 386d0: 09 f4 brne .+2 ; 0x386d4 386d2: 9a c0 rjmp .+308 ; 0x38808 386d4: 30 f5 brcc .+76 ; 0x38722 386d6: 83 30 cpi r24, 0x03 ; 3 386d8: 40 e8 ldi r20, 0x80 ; 128 386da: 94 07 cpc r25, r20 386dc: 09 f4 brne .+2 ; 0x386e0 386de: 80 c0 rjmp .+256 ; 0x387e0 386e0: a8 f4 brcc .+42 ; 0x3870c 386e2: 81 30 cpi r24, 0x01 ; 1 386e4: 20 e8 ldi r18, 0x80 ; 128 386e6: 92 07 cpc r25, r18 386e8: 09 f4 brne .+2 ; 0x386ec 386ea: 17 c1 rjmp .+558 ; 0x3891a 386ec: 82 30 cpi r24, 0x02 ; 2 386ee: 40 e8 ldi r20, 0x80 ; 128 386f0: 94 07 cpc r25, r20 386f2: 09 f4 brne .+2 ; 0x386f6 386f4: 73 c0 rjmp .+230 ; 0x387dc 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); 386f6: 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)) { 386f8: 86 ff sbrs r24, 6 386fa: 8e c0 rjmp .+284 ; 0x38818 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); 386fc: 22 27 eor r18, r18 386fe: 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) { 38700: 21 15 cp r18, r1 38702: 32 4c sbci r19, 0xC2 ; 194 38704: 09 f0 breq .+2 ; 0x38708 38706: 9e c0 rjmp .+316 ; 0x38844 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 38708: 8e e1 ldi r24, 0x1E ; 30 3870a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3870c: 84 30 cpi r24, 0x04 ; 4 3870e: 60 e8 ldi r22, 0x80 ; 128 38710: 96 07 cpc r25, r22 38712: 09 f4 brne .+2 ; 0x38716 38714: 67 c0 rjmp .+206 ; 0x387e4 38716: 85 30 cpi r24, 0x05 ; 5 38718: 20 e8 ldi r18, 0x80 ; 128 3871a: 92 07 cpc r25, r18 3871c: 61 f7 brne .-40 ; 0x386f6 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); 3871e: 84 e2 ldi r24, 0x24 ; 36 38720: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38722: 8a 30 cpi r24, 0x0A ; 10 38724: 40 e8 ldi r20, 0x80 ; 128 38726: 94 07 cpc r25, r20 38728: 09 f4 brne .+2 ; 0x3872c 3872a: 5e c0 rjmp .+188 ; 0x387e8 3872c: 58 f4 brcc .+22 ; 0x38744 3872e: 88 30 cpi r24, 0x08 ; 8 38730: 20 e8 ldi r18, 0x80 ; 128 38732: 92 07 cpc r25, r18 38734: 09 f4 brne .+2 ; 0x38738 38736: 6e c0 rjmp .+220 ; 0x38814 38738: 89 30 cpi r24, 0x09 ; 9 3873a: 40 e8 ldi r20, 0x80 ; 128 3873c: 94 07 cpc r25, r20 3873e: d9 f6 brne .-74 ; 0x386f6 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); 38740: 85 e0 ldi r24, 0x05 ; 5 38742: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38744: 8c 30 cpi r24, 0x0C ; 12 38746: 60 e8 ldi r22, 0x80 ; 128 38748: 96 07 cpc r25, r22 3874a: 09 f4 brne .+2 ; 0x3874e 3874c: 51 c0 rjmp .+162 ; 0x387f0 3874e: 8d 30 cpi r24, 0x0D ; 13 38750: 20 e8 ldi r18, 0x80 ; 128 38752: 92 07 cpc r25, r18 38754: 81 f6 brne .-96 ; 0x386f6 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); 38756: 81 e2 ldi r24, 0x21 ; 33 38758: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3875a: 8f 32 cpi r24, 0x2F ; 47 3875c: 40 e8 ldi r20, 0x80 ; 128 3875e: 94 07 cpc r25, r20 38760: 09 f4 brne .+2 ; 0x38764 38762: 56 c0 rjmp .+172 ; 0x38810 38764: e0 f4 brcc .+56 ; 0x3879e 38766: 8c 32 cpi r24, 0x2C ; 44 38768: 20 e8 ldi r18, 0x80 ; 128 3876a: 92 07 cpc r25, r18 3876c: 09 f4 brne .+2 ; 0x38770 3876e: 4e c0 rjmp .+156 ; 0x3880c 38770: 58 f4 brcc .+22 ; 0x38788 38772: 8a 32 cpi r24, 0x2A ; 42 38774: 60 e8 ldi r22, 0x80 ; 128 38776: 96 07 cpc r25, r22 38778: c9 f1 breq .+114 ; 0x387ec 3877a: 8b 32 cpi r24, 0x2B ; 43 3877c: 20 e8 ldi r18, 0x80 ; 128 3877e: 92 07 cpc r25, r18 38780: 09 f0 breq .+2 ; 0x38784 38782: b9 cf rjmp .-142 ; 0x386f6 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); 38784: 86 e2 ldi r24, 0x26 ; 38 38786: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38788: 8d 32 cpi r24, 0x2D ; 45 3878a: 40 e8 ldi r20, 0x80 ; 128 3878c: 94 07 cpc r25, r20 3878e: d1 f1 breq .+116 ; 0x38804 38790: 8e 32 cpi r24, 0x2E ; 46 38792: 60 e8 ldi r22, 0x80 ; 128 38794: 96 07 cpc r25, r22 38796: 09 f0 breq .+2 ; 0x3879a 38798: ae cf rjmp .-164 ; 0x386f6 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); 3879a: 82 e2 ldi r24, 0x22 ; 34 3879c: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3879e: 87 38 cpi r24, 0x87 ; 135 387a0: 20 e8 ldi r18, 0x80 ; 128 387a2: 92 07 cpc r25, r18 387a4: 49 f1 breq .+82 ; 0x387f8 387a6: 58 f4 brcc .+22 ; 0x387be 387a8: 87 34 cpi r24, 0x47 ; 71 387aa: 60 e8 ldi r22, 0x80 ; 128 387ac: 96 07 cpc r25, r22 387ae: 29 f0 breq .+10 ; 0x387ba 387b0: 8b 34 cpi r24, 0x4B ; 75 387b2: 20 e8 ldi r18, 0x80 ; 128 387b4: 92 07 cpc r25, r18 387b6: 09 f0 breq .+2 ; 0x387ba 387b8: 9e cf rjmp .-196 ; 0x386f6 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); 387ba: 84 e0 ldi r24, 0x04 ; 4 387bc: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 387be: 87 30 cpi r24, 0x07 ; 7 387c0: 41 e8 ldi r20, 0x81 ; 129 387c2: 94 07 cpc r25, r20 387c4: d9 f0 breq .+54 ; 0x387fc 387c6: 8b 30 cpi r24, 0x0B ; 11 387c8: 61 e8 ldi r22, 0x81 ; 129 387ca: 96 07 cpc r25, r22 387cc: c9 f0 breq .+50 ; 0x38800 387ce: 8b 38 cpi r24, 0x8B ; 139 387d0: 20 e8 ldi r18, 0x80 ; 128 387d2: 92 07 cpc r25, r18 387d4: 09 f0 breq .+2 ; 0x387d8 387d6: 8f cf rjmp .-226 ; 0x386f6 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); 387d8: 89 e0 ldi r24, 0x09 ; 9 387da: 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); 387dc: 81 e0 ldi r24, 0x01 ; 1 387de: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 387e0: 82 e0 ldi r24, 0x02 ; 2 387e2: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 387e4: 83 e0 ldi r24, 0x03 ; 3 387e6: 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); 387e8: 86 e0 ldi r24, 0x06 ; 6 387ea: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 387ec: 87 e0 ldi r24, 0x07 ; 7 387ee: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 387f0: 8a e2 ldi r24, 0x2A ; 42 387f2: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 387f4: 8b e2 ldi r24, 0x2B ; 43 387f6: 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); 387f8: 88 e0 ldi r24, 0x08 ; 8 387fa: 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); 387fc: 8a e0 ldi r24, 0x0A ; 10 387fe: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 38800: 8b e0 ldi r24, 0x0B ; 11 38802: 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); 38804: 83 e2 ldi r24, 0x23 ; 35 38806: 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); 38808: 85 e2 ldi r24, 0x25 ; 37 3880a: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 3880c: 87 e2 ldi r24, 0x27 ; 39 3880e: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 38810: 88 e2 ldi r24, 0x28 ; 40 38812: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 38814: 89 e2 ldi r24, 0x29 ; 41 38816: 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)) { 38818: 87 ff sbrs r24, 7 3881a: 07 c0 rjmp .+14 ; 0x3882a 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); 3881c: 22 27 eor r18, r18 3881e: 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) { 38820: 21 15 cp r18, r1 38822: 32 4c sbci r19, 0xC2 ; 194 38824: a1 f5 brne .+104 ; 0x3888e return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 38826: 8f e1 ldi r24, 0x1F ; 31 38828: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 3882a: 22 27 eor r18, r18 3882c: 31 70 andi r19, 0x01 ; 1 3882e: 90 ff sbrs r25, 0 38830: 52 c0 rjmp .+164 ; 0x388d6 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); 38832: ac 01 movw r20, r24 38834: 44 27 eor r20, r20 38836: 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) { 38838: 41 15 cp r20, r1 3883a: 52 4c sbci r21, 0xC2 ; 194 3883c: 09 f0 breq .+2 ; 0x38840 3883e: 4b c0 rjmp .+150 ; 0x388d6 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 38840: 80 e2 ldi r24, 0x20 ; 32 38842: 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; 38844: 9c 01 movw r18, r24 38846: 22 27 eor r18, r18 38848: 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)) { 3884a: 23 2b or r18, r19 3884c: 09 f0 breq .+2 ; 0x38850 3884e: 67 c0 rjmp .+206 ; 0x3891e 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; 38850: 9c 01 movw r18, r24 38852: 22 27 eor r18, r18 38854: 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)) { 38856: 23 2b or r18, r19 38858: 09 f0 breq .+2 ; 0x3885c 3885a: 63 c0 rjmp .+198 ; 0x38922 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; 3885c: 9c 01 movw r18, r24 3885e: 22 27 eor r18, r18 38860: 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)) { 38862: 23 2b or r18, r19 38864: 09 f0 breq .+2 ; 0x38868 38866: 5f c0 rjmp .+190 ; 0x38926 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; 38868: 9c 01 movw r18, r24 3886a: 22 27 eor r18, r18 3886c: 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)) { 3886e: 23 2b or r18, r19 38870: 09 f0 breq .+2 ; 0x38874 38872: 5b c0 rjmp .+182 ; 0x3892a 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; 38874: 9c 01 movw r18, r24 38876: 22 27 eor r18, r18 38878: 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)) { 3887a: 23 2b or r18, r19 3887c: 09 f0 breq .+2 ; 0x38880 3887e: 57 c0 rjmp .+174 ; 0x3892e constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 38880: 88 27 eor r24, r24 38882: 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)) { 38884: 89 2b or r24, r25 38886: 09 f4 brne .+2 ; 0x3888a 38888: 68 c0 rjmp .+208 ; 0x3895a return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 3888a: 8f e0 ldi r24, 0x0F ; 15 3888c: 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; 3888e: 9c 01 movw r18, r24 38890: 22 27 eor r18, r18 38892: 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)) { 38894: 23 2b or r18, r19 38896: 09 f0 breq .+2 ; 0x3889a 38898: 4c c0 rjmp .+152 ; 0x38932 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; 3889a: 9c 01 movw r18, r24 3889c: 22 27 eor r18, r18 3889e: 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)) { 388a0: 23 2b or r18, r19 388a2: 09 f0 breq .+2 ; 0x388a6 388a4: 48 c0 rjmp .+144 ; 0x38936 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; 388a6: 9c 01 movw r18, r24 388a8: 22 27 eor r18, r18 388aa: 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)) { 388ac: 23 2b or r18, r19 388ae: 09 f0 breq .+2 ; 0x388b2 388b0: 44 c0 rjmp .+136 ; 0x3893a constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 388b2: 9c 01 movw r18, r24 388b4: 22 27 eor r18, r18 388b6: 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)) { 388b8: 23 2b or r18, r19 388ba: 09 f0 breq .+2 ; 0x388be 388bc: 40 c0 rjmp .+128 ; 0x3893e 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; 388be: 9c 01 movw r18, r24 388c0: 22 27 eor r18, r18 388c2: 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)) { 388c4: 23 2b or r18, r19 388c6: e9 f5 brne .+122 ; 0x38942 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; 388c8: 88 27 eor r24, r24 388ca: 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)) { 388cc: 89 2b or r24, r25 388ce: 09 f4 brne .+2 ; 0x388d2 388d0: 44 c0 rjmp .+136 ; 0x3895a return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 388d2: 80 e1 ldi r24, 0x10 ; 16 388d4: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 388d6: 23 2b or r18, r19 388d8: 09 f4 brne .+2 ; 0x388dc 388da: 3f c0 rjmp .+126 ; 0x3895a 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; 388dc: 9c 01 movw r18, r24 388de: 22 27 eor r18, r18 388e0: 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)) { 388e2: 23 2b or r18, r19 388e4: 81 f5 brne .+96 ; 0x38946 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; 388e6: 9c 01 movw r18, r24 388e8: 22 27 eor r18, r18 388ea: 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)) { 388ec: 23 2b or r18, r19 388ee: 69 f5 brne .+90 ; 0x3894a 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; 388f0: 9c 01 movw r18, r24 388f2: 22 27 eor r18, r18 388f4: 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)) { 388f6: 23 2b or r18, r19 388f8: 51 f5 brne .+84 ; 0x3894e 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; 388fa: 9c 01 movw r18, r24 388fc: 22 27 eor r18, r18 388fe: 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)) { 38900: 23 2b or r18, r19 38902: 39 f5 brne .+78 ; 0x38952 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; 38904: 9c 01 movw r18, r24 38906: 22 27 eor r18, r18 38908: 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)) { 3890a: 23 2b or r18, r19 3890c: 21 f5 brne .+72 ; 0x38956 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; 3890e: 88 27 eor r24, r24 38910: 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)) { 38912: 89 2b or r24, r25 38914: 11 f1 breq .+68 ; 0x3895a return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 38916: 81 e1 ldi r24, 0x11 ; 17 38918: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 3891a: 80 e0 ldi r24, 0x00 ; 0 3891c: 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); 3891e: 82 e1 ldi r24, 0x12 ; 18 38920: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 38922: 85 e1 ldi r24, 0x15 ; 21 38924: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 38926: 88 e1 ldi r24, 0x18 ; 24 38928: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 3892a: 8b e1 ldi r24, 0x1B ; 27 3892c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 3892e: 8c e0 ldi r24, 0x0C ; 12 38930: 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); 38932: 83 e1 ldi r24, 0x13 ; 19 38934: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 38936: 86 e1 ldi r24, 0x16 ; 22 38938: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 3893a: 89 e1 ldi r24, 0x19 ; 25 3893c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 3893e: 8c e1 ldi r24, 0x1C ; 28 38940: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 38942: 8d e0 ldi r24, 0x0D ; 13 38944: 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); 38946: 84 e1 ldi r24, 0x14 ; 20 38948: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 3894a: 87 e1 ldi r24, 0x17 ; 23 3894c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 3894e: 8a e1 ldi r24, 0x1A ; 26 38950: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 38952: 8d e1 ldi r24, 0x1D ; 29 38954: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 38956: 8e e0 ldi r24, 0x0E ; 14 38958: 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); 3895a: 8c e2 ldi r24, 0x2C ; 44 } 3895c: 08 95 ret 0003895e : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 3895e: cf 92 push r12 38960: df 92 push r13 38962: ef 92 push r14 38964: ff 92 push r15 38966: 0f 93 push r16 38968: 1f 93 push r17 3896a: cf 93 push r28 3896c: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 3896e: 20 91 67 13 lds r18, 0x1367 ; 0x801367 38972: 30 91 68 13 lds r19, 0x1368 ; 0x801368 38976: 21 30 cpi r18, 0x01 ; 1 38978: 31 05 cpc r19, r1 3897a: 39 f4 brne .+14 ; 0x3898a 3897c: 20 91 90 13 lds r18, 0x1390 ; 0x801390 38980: 21 30 cpi r18, 0x01 ; 1 38982: 19 f4 brne .+6 ; 0x3898a // 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; 38984: 22 e0 ldi r18, 0x02 ; 2 38986: 20 93 d0 17 sts 0x17D0, r18 ; 0x8017d0 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 3898a: 0f 94 5e c3 call 0x386bc ; 0x386bc 3898e: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 38990: 80 91 d0 17 lds r24, 0x17D0 ; 0x8017d0 38994: 81 30 cpi r24, 0x01 ; 1 38996: 09 f4 brne .+2 ; 0x3899a 38998: 64 c0 rjmp .+200 ; 0x38a62 3899a: 60 f0 brcs .+24 ; 0x389b4 3899c: 82 30 cpi r24, 0x02 ; 2 3899e: 09 f4 brne .+2 ; 0x389a2 389a0: f4 c0 rjmp .+488 ; 0x38b8a ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 389a2: df 91 pop r29 389a4: cf 91 pop r28 389a6: 1f 91 pop r17 389a8: 0f 91 pop r16 389aa: ff 90 pop r15 389ac: ef 90 pop r14 389ae: df 90 pop r13 389b0: cf 90 pop r12 389b2: 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); 389b4: 84 e0 ldi r24, 0x04 ; 4 389b6: 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); 389ba: 0d 2f mov r16, r29 389bc: 10 e0 ldi r17, 0x00 ; 0 389be: f8 01 movw r30, r16 389c0: e1 57 subi r30, 0x71 ; 113 389c2: f5 45 sbci r31, 0x55 ; 85 389c4: 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); 389c6: fc 2e mov r15, r28 389c8: f2 94 swap r15 389ca: 6f e0 ldi r22, 0x0F ; 15 389cc: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 389ce: 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); 389d0: 80 e0 ldi r24, 0x00 ; 0 389d2: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_clear(); 389d6: 0e 94 c0 6f call 0xdf80 ; 0xdf80 // 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); 389da: 00 0f add r16, r16 389dc: 11 1f adc r17, r17 389de: f8 01 movw r30, r16 389e0: e4 54 subi r30, 0x44 ; 68 389e2: f5 45 sbci r31, 0x55 ; 85 389e4: c5 90 lpm r12, Z+ 389e6: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 389e8: 05 56 subi r16, 0x65 ; 101 389ea: 18 45 sbci r17, 0x58 ; 88 389ec: f8 01 movw r30, r16 389ee: 85 91 lpm r24, Z+ 389f0: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 389f2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 389f6: df 92 push r13 389f8: cf 92 push r12 389fa: 9f 93 push r25 389fc: 8f 93 push r24 389fe: 88 e2 ldi r24, 0x28 ; 40 38a00: 9b ea ldi r25, 0xAB ; 171 38a02: 9f 93 push r25 38a04: 8f 93 push r24 38a06: 0e 94 66 6f call 0xdecc ; 0xdecc 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)); 38a0a: 43 e1 ldi r20, 0x13 ; 19 38a0c: 58 ea ldi r21, 0xA8 ; 168 38a0e: 62 e0 ldi r22, 0x02 ; 2 38a10: 80 e0 ldi r24, 0x00 ; 0 38a12: 0e 94 a1 6f call 0xdf42 ; 0xdf42 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()); 38a16: 0f 90 pop r0 38a18: 0f 90 pop r0 38a1a: 0f 90 pop r0 38a1c: 0f 90 pop r0 38a1e: 0f 90 pop r0 38a20: 0f 90 pop r0 38a22: f1 10 cpse r15, r1 38a24: c6 c0 rjmp .+396 ; 0x38bb2 38a26: 10 e0 ldi r17, 0x00 ; 0 38a28: 00 e0 ldi r16, 0x00 ; 0 38a2a: 42 e1 ldi r20, 0x12 ; 18 38a2c: e4 2e mov r14, r20 38a2e: 57 ef ldi r21, 0xF7 ; 247 38a30: c5 2e mov r12, r21 38a32: 50 e7 ldi r21, 0x70 ; 112 38a34: 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); 38a36: ec 2f mov r30, r28 38a38: f0 e0 ldi r31, 0x00 ; 0 38a3a: ee 0f add r30, r30 38a3c: ff 1f adc r31, r31 38a3e: ec 5e subi r30, 0xEC ; 236 38a40: f4 45 sbci r31, 0x54 ; 84 38a42: 85 91 lpm r24, Z+ 38a44: 94 91 lpm r25, Z 38a46: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 38a4a: bc 01 movw r22, r24 38a4c: 81 e0 ldi r24, 0x01 ; 1 38a4e: f1 10 cpse r15, r1 38a50: 01 c0 rjmp .+2 ; 0x38a54 38a52: 80 e0 ldi r24, 0x00 ; 0 38a54: 2e 2d mov r18, r14 38a56: a6 01 movw r20, r12 38a58: 0f 94 2c 35 call 0x26a58 ; 0x26a58 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 38a5c: 81 e0 ldi r24, 0x01 ; 1 38a5e: 80 93 d0 17 sts 0x17D0, r24 ; 0x8017d0 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 38a62: 81 e0 ldi r24, 0x01 ; 1 38a64: 80 93 72 07 sts 0x0772, r24 ; 0x800772 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.509> ReportErrorHookDynamicRender(); // Render dynamic characters 38a68: 0f 94 70 c2 call 0x384e0 ; 0x384e0 sound_wait_for_user(); 38a6c: 0f 94 3d 6b call 0x2d67a ; 0x2d67a 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); 38a70: 0d 2f mov r16, r29 38a72: 10 e0 ldi r17, 0x00 ; 0 38a74: f8 01 movw r30, r16 38a76: e1 57 subi r30, 0x71 ; 113 38a78: f5 45 sbci r31, 0x55 ; 85 38a7a: 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); 38a7c: dc 2f mov r29, r28 38a7e: d2 95 swap r29 38a80: 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; 38a82: 80 91 c8 17 lds r24, 0x17C8 ; 0x8017c8 38a86: 81 11 cpse r24, r1 38a88: 09 c0 rjmp .+18 ; 0x38a9c 38a8a: 81 e0 ldi r24, 0x01 ; 1 38a8c: d1 11 cpse r29, r1 38a8e: 01 c0 rjmp .+2 ; 0x38a92 38a90: 80 e0 ldi r24, 0x00 ; 0 38a92: 80 93 c7 17 sts 0x17C7, r24 ; 0x8017c7 38a96: 81 e0 ldi r24, 0x01 ; 1 38a98: 80 93 c8 17 sts 0x17C8, r24 ; 0x8017c8 static int8_t choice_selected = -1; if (reset_button_selection) { 38a9c: 80 91 c6 17 lds r24, 0x17C6 ; 0x8017c6 38aa0: 88 23 and r24, r24 38aa2: 41 f0 breq .+16 ; 0x38ab4 // 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; 38aa4: 81 e0 ldi r24, 0x01 ; 1 38aa6: d1 11 cpse r29, r1 38aa8: 01 c0 rjmp .+2 ; 0x38aac 38aaa: 80 e0 ldi r24, 0x00 ; 0 38aac: 80 93 c7 17 sts 0x17C7, r24 ; 0x8017c7 choice_selected = -1; reset_button_selection = 0; 38ab0: 10 92 c6 17 sts 0x17C6, r1 ; 0x8017c6 } // Check if knob was rotated if (lcd_encoder) { 38ab4: 20 91 35 05 lds r18, 0x0535 ; 0x800535 38ab8: 30 91 36 05 lds r19, 0x0536 ; 0x800536 38abc: 21 15 cp r18, r1 38abe: 31 05 cpc r19, r1 38ac0: b9 f1 breq .+110 ; 0x38b30 38ac2: 80 91 c7 17 lds r24, 0x17C7 ; 0x8017c7 if (two_choices == false) { // third_choice is not nullptr, safe to dereference 38ac6: dd 23 and r29, r29 38ac8: 61 f0 breq .+24 ; 0x38ae2 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38aca: 37 ff sbrs r19, 7 38acc: 06 c0 rjmp .+12 ; 0x38ada 38ace: 88 23 and r24, r24 38ad0: 69 f0 breq .+26 ; 0x38aec // Rotating knob counter clockwise current_selection--; 38ad2: 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; 38ad4: 80 93 c7 17 sts 0x17C7, r24 ; 0x8017c7 38ad8: 09 c0 rjmp .+18 ; 0x38aec 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) { 38ada: 82 30 cpi r24, 0x02 ; 2 38adc: 39 f0 breq .+14 ; 0x38aec // Rotating knob clockwise current_selection++; 38ade: 8f 5f subi r24, 0xFF ; 255 38ae0: f9 cf rjmp .-14 ; 0x38ad4 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38ae2: 37 ff sbrs r19, 7 38ae4: 41 c0 rjmp .+130 ; 0x38b68 38ae6: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 38ae8: 10 92 c7 17 sts 0x17C7, r1 ; 0x8017c7 //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 38aec: 80 91 c7 17 lds r24, 0x17C7 ; 0x8017c7 38af0: 4e e3 ldi r20, 0x3E ; 62 38af2: 81 11 cpse r24, r1 38af4: 40 e2 ldi r20, 0x20 ; 32 38af6: 63 e0 ldi r22, 0x03 ; 3 38af8: 80 e0 ldi r24, 0x00 ; 0 38afa: 0e 94 ad 6f call 0xdf5a ; 0xdf5a 38afe: 80 91 c7 17 lds r24, 0x17C7 ; 0x8017c7 if (two_choices == false) 38b02: dd 23 and r29, r29 38b04: b1 f1 breq .+108 ; 0x38b72 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38b06: 4e e3 ldi r20, 0x3E ; 62 38b08: 81 30 cpi r24, 0x01 ; 1 38b0a: 09 f0 breq .+2 ; 0x38b0e 38b0c: 40 e2 ldi r20, 0x20 ; 32 38b0e: 63 e0 ldi r22, 0x03 ; 3 38b10: 89 e0 ldi r24, 0x09 ; 9 38b12: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 38b16: 80 91 c7 17 lds r24, 0x17C7 ; 0x8017c7 38b1a: 82 30 cpi r24, 0x02 ; 2 38b1c: 61 f5 brne .+88 ; 0x38b76 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38b1e: 4e e3 ldi r20, 0x3E ; 62 38b20: 63 e0 ldi r22, 0x03 ; 3 38b22: 82 e1 ldi r24, 0x12 ; 18 38b24: 0e 94 ad 6f call 0xdf5a ; 0xdf5a } // Consume rotation event lcd_encoder = 0; 38b28: 10 92 36 05 sts 0x0536, r1 ; 0x800536 38b2c: 10 92 35 05 sts 0x0535, r1 ; 0x800535 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 38b30: 0e 94 aa 71 call 0xe354 ; 0xe354 38b34: 88 23 and r24, r24 38b36: 09 f4 brne .+2 ; 0x38b3a 38b38: 34 cf rjmp .-408 ; 0x389a2 choice_selected = current_selection; 38b3a: 80 91 c7 17 lds r24, 0x17C7 ; 0x8017c7 } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 38b3e: d1 11 cpse r29, r1 38b40: 1c c0 rjmp .+56 ; 0x38b7a 38b42: 81 30 cpi r24, 0x01 ; 1 38b44: 89 f5 brne .+98 ; 0x38ba8 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); 38b46: f8 01 movw r30, r16 38b48: ee 0f add r30, r30 38b4a: ff 1f adc r31, r31 38b4c: eb 5c subi r30, 0xCB ; 203 38b4e: f5 45 sbci r31, 0x55 ; 85 38b50: 85 91 lpm r24, Z+ 38b52: 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))); 38b54: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 38b58: 0f 94 04 36 call 0x26c08 ; 0x26c08 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b5c: 81 e0 ldi r24, 0x01 ; 1 38b5e: 80 93 c6 17 sts 0x17C6, r24 ; 0x8017c6 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; 38b62: 10 92 d0 17 sts 0x17D0, r1 ; 0x8017d0 38b66: 1d cf rjmp .-454 ; 0x389a2 } } 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) { 38b68: 81 30 cpi r24, 0x01 ; 1 38b6a: 09 f4 brne .+2 ; 0x38b6e 38b6c: bf cf rjmp .-130 ; 0x38aec // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 38b6e: 81 e0 ldi r24, 0x01 ; 1 38b70: b1 cf rjmp .-158 ; 0x38ad4 { 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 ? '>': ' '); 38b72: 81 30 cpi r24, 0x01 ; 1 38b74: a1 f2 breq .-88 ; 0x38b1e 38b76: 40 e2 ldi r20, 0x20 ; 32 38b78: d3 cf rjmp .-90 ; 0x38b20 // 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 38b7a: 82 30 cpi r24, 0x02 ; 2 38b7c: 21 f3 breq .-56 ; 0x38b46 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 38b7e: 81 30 cpi r24, 0x01 ; 1 38b80: 99 f4 brne .+38 ; 0x38ba8 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 38b82: d0 93 5d 0e sts 0x0E5D, r29 ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b86: 80 93 c6 17 sts 0x17C6, r24 ; 0x8017c6 // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 38b8a: 81 e0 ldi r24, 0x01 ; 1 38b8c: 0e 94 d2 6f call 0xdfa4 ; 0xdfa4 lcd_return_to_status(); 38b90: 0f 94 4b 27 call 0x24e96 ; 0x24e96 38b94: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL10beep_timer.lto_priv.513> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 38b98: 10 92 6d 05 sts 0x056D, r1 ; 0x80056d <_ZL6bFirst.lto_priv.514> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 38b9c: 10 92 72 07 sts 0x0772, r1 ; 0x800772 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.509> KEEPALIVE_STATE(IN_HANDLER); 38ba0: 82 e0 ldi r24, 0x02 ; 2 38ba2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 38ba6: dd cf rjmp .-70 ; 0x38b62 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); 38ba8: cf 70 andi r28, 0x0F ; 15 38baa: c0 93 5d 0e sts 0x0E5D, r28 ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38bae: 81 e0 ldi r24, 0x01 ; 1 38bb0: ea cf rjmp .-44 ; 0x38b86 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); 38bb2: ef 2d mov r30, r15 38bb4: f0 e0 ldi r31, 0x00 ; 0 38bb6: ee 0f add r30, r30 38bb8: ff 1f adc r31, r31 38bba: ec 5e subi r30, 0xEC ; 236 38bbc: f4 45 sbci r31, 0x54 ; 84 38bbe: 85 91 lpm r24, Z+ 38bc0: 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()); 38bc2: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 38bc6: 6c 01 movw r12, r24 38bc8: 07 ef ldi r16, 0xF7 ; 247 38bca: 10 e7 ldi r17, 0x70 ; 112 38bcc: 99 e0 ldi r25, 0x09 ; 9 38bce: e9 2e mov r14, r25 38bd0: 32 cf rjmp .-412 ; 0x38a36 00038bd2 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 38bd2: 0f 94 5e c3 call 0x386bc ; 0x386bc // 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); 38bd6: e8 2f mov r30, r24 38bd8: f0 e0 ldi r31, 0x00 ; 0 38bda: ee 0f add r30, r30 38bdc: ff 1f adc r31, r31 38bde: e4 54 subi r30, 0x44 ; 68 38be0: f5 45 sbci r31, 0x55 ; 85 38be2: 25 91 lpm r18, Z+ 38be4: 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) ) { 38be6: 23 33 cpi r18, 0x33 ; 51 38be8: 81 e0 ldi r24, 0x01 ; 1 38bea: 38 07 cpc r19, r24 38bec: 08 f0 brcs .+2 ; 0x38bf0 38bee: 41 c0 rjmp .+130 ; 0x38c72 38bf0: 2d 32 cpi r18, 0x2D ; 45 38bf2: 81 e0 ldi r24, 0x01 ; 1 38bf4: 38 07 cpc r19, r24 38bf6: 78 f5 brcc .+94 ; 0x38c56 38bf8: 2e 37 cpi r18, 0x7E ; 126 38bfa: 31 05 cpc r19, r1 38bfc: 09 f4 brne .+2 ; 0x38c00 38bfe: 83 c0 rjmp .+262 ; 0x38d06 38c00: f0 f4 brcc .+60 ; 0x38c3e 38c02: 2c 36 cpi r18, 0x6C ; 108 38c04: 31 05 cpc r19, r1 38c06: 09 f4 brne .+2 ; 0x38c0a 38c08: 85 c0 rjmp .+266 ; 0x38d14 38c0a: 30 f4 brcc .+12 ; 0x38c18 38c0c: 25 36 cpi r18, 0x65 ; 101 38c0e: 31 05 cpc r19, r1 38c10: 08 f0 brcs .+2 ; 0x38c14 38c12: 79 c0 rjmp .+242 ; 0x38d06 default: break; } return Buttons::NoButton; 38c14: 8f ef ldi r24, 0xFF ; 255 38c16: 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) ) { 38c18: 24 37 cpi r18, 0x74 ; 116 38c1a: 31 05 cpc r19, r1 38c1c: 09 f4 brne .+2 ; 0x38c20 38c1e: 73 c0 rjmp .+230 ; 0x38d06 38c20: 2d 37 cpi r18, 0x7D ; 125 38c22: 31 05 cpc r19, r1 38c24: 19 f0 breq .+6 ; 0x38c2c 38c26: 23 37 cpi r18, 0x73 ; 115 38c28: 31 05 cpc r19, r1 38c2a: a1 f7 brne .-24 ; 0x38c14 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 38c2c: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38c30: 81 30 cpi r24, 0x01 ; 1 38c32: 09 f4 brne .+2 ; 0x38c36 38c34: 6d c0 rjmp .+218 ; 0x38d10 38c36: 87 30 cpi r24, 0x07 ; 7 38c38: 69 f7 brne .-38 ; 0x38c14 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 38c3a: 88 e0 ldi r24, 0x08 ; 8 38c3c: 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) ) { 38c3e: 23 3d cpi r18, 0xD3 ; 211 38c40: 31 05 cpc r19, r1 38c42: 09 f4 brne .+2 ; 0x38c46 38c44: 6e c0 rjmp .+220 ; 0x38d22 38c46: 50 f4 brcc .+20 ; 0x38c5c 38c48: 29 3c cpi r18, 0xC9 ; 201 38c4a: 31 05 cpc r19, r1 38c4c: 09 f4 brne .+2 ; 0x38c50 38c4e: 69 c0 rjmp .+210 ; 0x38d22 38c50: 2a 3c cpi r18, 0xCA ; 202 38c52: 31 05 cpc r19, r1 38c54: f9 f6 brne .-66 ; 0x38c14 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) { 38c56: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38c5a: 67 c0 rjmp .+206 ; 0x38d2a // 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) ) { 38c5c: 2d 3d cpi r18, 0xDD ; 221 38c5e: 31 05 cpc r19, r1 38c60: 09 f4 brne .+2 ; 0x38c64 38c62: 5f c0 rjmp .+190 ; 0x38d22 38c64: 2e 3d cpi r18, 0xDE ; 222 38c66: 31 05 cpc r19, r1 38c68: b1 f3 breq .-20 ; 0x38c56 38c6a: 24 3d cpi r18, 0xD4 ; 212 38c6c: 31 05 cpc r19, r1 38c6e: 91 f6 brne .-92 ; 0x38c14 38c70: f2 cf rjmp .-28 ; 0x38c56 38c72: 25 3f cpi r18, 0xF5 ; 245 38c74: 81 e0 ldi r24, 0x01 ; 1 38c76: 38 07 cpc r19, r24 38c78: 09 f4 brne .+2 ; 0x38c7c 38c7a: 5c c0 rjmp .+184 ; 0x38d34 38c7c: f8 f4 brcc .+62 ; 0x38cbc 38c7e: 26 34 cpi r18, 0x46 ; 70 38c80: 81 e0 ldi r24, 0x01 ; 1 38c82: 38 07 cpc r19, r24 38c84: 58 f4 brcc .+22 ; 0x38c9c 38c86: 21 34 cpi r18, 0x41 ; 65 38c88: 81 e0 ldi r24, 0x01 ; 1 38c8a: 38 07 cpc r19, r24 38c8c: 20 f7 brcc .-56 ; 0x38c56 38c8e: 27 53 subi r18, 0x37 ; 55 38c90: 31 40 sbci r19, 0x01 ; 1 38c92: 25 30 cpi r18, 0x05 ; 5 38c94: 31 05 cpc r19, r1 38c96: 08 f0 brcs .+2 ; 0x38c9a 38c98: bd cf rjmp .-134 ; 0x38c14 38c9a: dd cf rjmp .-70 ; 0x38c56 38c9c: 21 59 subi r18, 0x91 ; 145 38c9e: 31 40 sbci r19, 0x01 ; 1 38ca0: 22 30 cpi r18, 0x02 ; 2 38ca2: 31 05 cpc r19, r1 38ca4: 08 f0 brcs .+2 ; 0x38ca8 38ca6: b6 cf rjmp .-148 ; 0x38c14 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 38ca8: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38cac: 83 30 cpi r24, 0x03 ; 3 38cae: 09 f4 brne .+2 ; 0x38cb2 38cb0: 3f c0 rjmp .+126 ; 0x38d30 38cb2: 89 30 cpi r24, 0x09 ; 9 38cb4: 09 f0 breq .+2 ; 0x38cb8 38cb6: ae cf rjmp .-164 ; 0x38c14 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 38cb8: 87 e0 ldi r24, 0x07 ; 7 38cba: 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) ) { 38cbc: 29 3f cpi r18, 0xF9 ; 249 38cbe: 81 e0 ldi r24, 0x01 ; 1 38cc0: 38 07 cpc r19, r24 38cc2: 49 f2 breq .-110 ; 0x38c56 38cc4: 70 f4 brcc .+28 ; 0x38ce2 38cc6: 27 3f cpi r18, 0xF7 ; 247 38cc8: 81 e0 ldi r24, 0x01 ; 1 38cca: 38 07 cpc r19, r24 38ccc: 21 f2 breq .-120 ; 0x38c56 38cce: 60 f7 brcc .-40 ; 0x38ca8 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 38cd0: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38cd4: 83 30 cpi r24, 0x03 ; 3 38cd6: 61 f1 breq .+88 ; 0x38d30 38cd8: 88 30 cpi r24, 0x08 ; 8 38cda: 09 f0 breq .+2 ; 0x38cde 38cdc: 9b cf rjmp .-202 ; 0x38c14 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 38cde: 86 e0 ldi r24, 0x06 ; 6 38ce0: 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) ) { 38ce2: 2b 3f cpi r18, 0xFB ; 251 38ce4: 81 e0 ldi r24, 0x01 ; 1 38ce6: 38 07 cpc r19, r24 38ce8: a9 f0 breq .+42 ; 0x38d14 38cea: 68 f0 brcs .+26 ; 0x38d06 38cec: 2c 3f cpi r18, 0xFC ; 252 38cee: 31 40 sbci r19, 0x01 ; 1 38cf0: 09 f0 breq .+2 ; 0x38cf4 38cf2: 90 cf rjmp .-224 ; 0x38c14 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 38cf4: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38cf8: 85 30 cpi r24, 0x05 ; 5 38cfa: 89 f0 breq .+34 ; 0x38d1e 38cfc: 86 30 cpi r24, 0x06 ; 6 38cfe: 09 f0 breq .+2 ; 0x38d02 38d00: 89 cf rjmp .-238 ; 0x38c14 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 38d02: 85 e0 ldi r24, 0x05 ; 5 38d04: 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) { 38d06: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d0a: 81 30 cpi r24, 0x01 ; 1 38d0c: 09 f0 breq .+2 ; 0x38d10 38d0e: 82 cf rjmp .-252 ; 0x38c14 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; 38d10: 81 e0 ldi r24, 0x01 ; 1 38d12: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 38d14: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d18: 82 30 cpi r24, 0x02 ; 2 38d1a: d1 f3 breq .-12 ; 0x38d10 38d1c: 7b cf rjmp .-266 ; 0x38c14 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 38d1e: 84 e0 ldi r24, 0x04 ; 4 38d20: 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) { 38d22: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d26: 82 30 cpi r24, 0x02 ; 2 38d28: 61 f0 breq .+24 ; 0x38d42 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) { 38d2a: 83 30 cpi r24, 0x03 ; 3 38d2c: 09 f0 breq .+2 ; 0x38d30 38d2e: 72 cf rjmp .-284 ; 0x38c14 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; 38d30: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 38d32: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 38d34: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d38: 82 30 cpi r24, 0x02 ; 2 38d3a: 29 f0 breq .+10 ; 0x38d46 38d3c: 84 30 cpi r24, 0x04 ; 4 38d3e: 09 f0 breq .+2 ; 0x38d42 38d40: 69 cf rjmp .-302 ; 0x38c14 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; 38d42: 82 e0 ldi r24, 0x02 ; 2 38d44: 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; 38d46: 80 e0 ldi r24, 0x00 ; 0 38d48: 08 95 ret 00038d4a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 38d4a: cf 93 push r28 38d4c: df 93 push r29 38d4e: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 38d50: 60 91 5f 0e lds r22, 0x0E5F ; 0x800e5f 38d54: 70 91 60 0e lds r23, 0x0E60 ; 0x800e60 38d58: 80 91 61 0e lds r24, 0x0E61 ; 0x800e61 38d5c: 90 91 62 0e lds r25, 0x0E62 ; 0x800e62 38d60: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 38d64: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 38d68: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 38d6c: c9 01 movw r24, r18 38d6e: 86 1b sub r24, r22 38d70: 97 0b sbc r25, r23 38d72: 06 97 sbiw r24, 0x06 ; 6 38d74: 24 f0 brlt .+8 ; 0x38d7e (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); 38d76: ce 01 movw r24, r28 38d78: 0e 94 7f 8e call 0x11cfe ; 0x11cfe 38d7c: e9 cf rjmp .-46 ; 0x38d50 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]+0x6> f(); safe_delay_keep_alive(delay); } } 38d7e: df 91 pop r29 38d80: cf 91 pop r28 38d82: 08 95 ret 00038d84 : } //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) { 38d84: cf 93 push r28 38d86: df 93 push r29 38d88: 00 d0 rcall .+0 ; 0x38d8a 38d8a: 00 d0 rcall .+0 ; 0x38d8c 38d8c: 1f 92 push r1 38d8e: cd b7 in r28, 0x3d ; 61 38d90: 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)) 38d92: 87 30 cpi r24, 0x07 ; 7 38d94: 50 f5 brcc .+84 ; 0x38dea 38d96: 67 30 cpi r22, 0x07 ; 7 38d98: 40 f5 brcc .+80 ; 0x38dea return false; uint8_t valid_points_mask[7] = { 38d9a: 97 e0 ldi r25, 0x07 ; 7 38d9c: e6 ec ldi r30, 0xC6 ; 198 38d9e: f2 e0 ldi r31, 0x02 ; 2 38da0: de 01 movw r26, r28 38da2: 11 96 adiw r26, 0x01 ; 1 38da4: 01 90 ld r0, Z+ 38da6: 0d 92 st X+, r0 38da8: 9a 95 dec r25 38daa: e1 f7 brne .-8 ; 0x38da4 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 38dac: 46 e0 ldi r20, 0x06 ; 6 38dae: 50 e0 ldi r21, 0x00 ; 0 38db0: fa 01 movw r30, r20 38db2: e6 1b sub r30, r22 38db4: f1 09 sbc r31, r1 38db6: 21 e0 ldi r18, 0x01 ; 1 38db8: 30 e0 ldi r19, 0x00 ; 0 38dba: 2c 0f add r18, r28 38dbc: 3d 1f adc r19, r29 38dbe: e2 0f add r30, r18 38dc0: f3 1f adc r31, r19 38dc2: 20 81 ld r18, Z 38dc4: 30 e0 ldi r19, 0x00 ; 0 38dc6: 48 1b sub r20, r24 38dc8: 51 09 sbc r21, r1 38dca: c9 01 movw r24, r18 38dcc: 02 c0 rjmp .+4 ; 0x38dd2 38dce: 95 95 asr r25 38dd0: 87 95 ror r24 38dd2: 4a 95 dec r20 38dd4: e2 f7 brpl .-8 ; 0x38dce 38dd6: 81 70 andi r24, 0x01 ; 1 } 38dd8: 27 96 adiw r28, 0x07 ; 7 38dda: 0f b6 in r0, 0x3f ; 63 38ddc: f8 94 cli 38dde: de bf out 0x3e, r29 ; 62 38de0: 0f be out 0x3f, r0 ; 63 38de2: cd bf out 0x3d, r28 ; 61 38de4: df 91 pop r29 38de6: cf 91 pop r28 38de8: 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; 38dea: 80 e0 ldi r24, 0x00 ; 0 38dec: f5 cf rjmp .-22 ; 0x38dd8 00038dee : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 38dee: 10 92 69 05 sts 0x0569, r1 ; 0x800569 <_ZL13babystepLoadZ.lto_priv.516+0x1> 38df2: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.516> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 38df6: 80 e1 ldi r24, 0x10 ; 16 38df8: 0e 94 43 f9 call 0x1f286 ; 0x1f286 38dfc: 88 23 and r24, r24 38dfe: 91 f0 breq .+36 ; 0x38e24 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 38e00: 0e 94 02 7b call 0xf604 ; 0xf604 // 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))); 38e04: 81 ea ldi r24, 0xA1 ; 161 38e06: 9d e0 ldi r25, 0x0D ; 13 38e08: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 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-> 38e0c: 2b e0 ldi r18, 0x0B ; 11 38e0e: 82 9f mul r24, r18 38e10: c0 01 movw r24, r0 38e12: 11 24 eor r1, r1 38e14: 80 5b subi r24, 0xB0 ; 176 38e16: 92 4f sbci r25, 0xF2 ; 242 38e18: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 38e1c: 90 93 69 05 sts 0x0569, r25 ; 0x800569 <_ZL13babystepLoadZ.lto_priv.516+0x1> 38e20: 80 93 68 05 sts 0x0568, r24 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.516> SERIAL_ECHO("correction: "); SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_mm[Z_AXIS])); SERIAL_ECHOLN(""); #endif } } 38e24: 08 95 ret 00038e26 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 38e26: 0f 93 push r16 38e28: 1f 93 push r17 38e2a: cf 93 push r28 38e2c: df 93 push r29 38e2e: 00 d0 rcall .+0 ; 0x38e30 38e30: 1f 92 push r1 38e32: cd b7 in r28, 0x3d ; 61 38e34: de b7 in r29, 0x3e ; 62 38e36: 9b 01 movw r18, r22 38e38: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 38e3a: 01 e4 ldi r16, 0x41 ; 65 38e3c: 17 e0 ldi r17, 0x07 ; 7 38e3e: f8 01 movw r30, r16 38e40: 60 85 ldd r22, Z+8 ; 0x08 38e42: 71 85 ldd r23, Z+9 ; 0x09 38e44: 82 85 ldd r24, Z+10 ; 0x0a 38e46: 93 85 ldd r25, Z+11 ; 0x0b 38e48: 69 83 std Y+1, r22 ; 0x01 38e4a: 7a 83 std Y+2, r23 ; 0x02 38e4c: 8b 83 std Y+3, r24 ; 0x03 38e4e: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 38e50: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 38e54: f8 01 movw r30, r16 38e56: 60 87 std Z+8, r22 ; 0x08 38e58: 71 87 std Z+9, r23 ; 0x09 38e5a: 82 87 std Z+10, r24 ; 0x0a 38e5c: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 38e5e: 65 e5 ldi r22, 0x55 ; 85 38e60: 75 e5 ldi r23, 0x55 ; 85 38e62: 85 e5 ldi r24, 0x55 ; 85 38e64: 91 e4 ldi r25, 0x41 ; 65 38e66: 0f 94 8b ba call 0x37516 ; 0x37516 st_synchronize(); 38e6a: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position[Z_AXIS] = curpos_z; 38e6e: 89 81 ldd r24, Y+1 ; 0x01 38e70: 9a 81 ldd r25, Y+2 ; 0x02 38e72: ab 81 ldd r26, Y+3 ; 0x03 38e74: bc 81 ldd r27, Y+4 ; 0x04 38e76: f8 01 movw r30, r16 38e78: 80 87 std Z+8, r24 ; 0x08 38e7a: 91 87 std Z+9, r25 ; 0x09 38e7c: a2 87 std Z+10, r26 ; 0x0a 38e7e: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 38e80: ce 01 movw r24, r28 38e82: 01 96 adiw r24, 0x01 ; 1 38e84: 0f 94 0f ab call 0x3561e ; 0x3561e } 38e88: 0f 90 pop r0 38e8a: 0f 90 pop r0 38e8c: 0f 90 pop r0 38e8e: 0f 90 pop r0 38e90: df 91 pop r29 38e92: cf 91 pop r28 38e94: 1f 91 pop r17 38e96: 0f 91 pop r16 38e98: 08 95 ret 00038e9a : 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])); 38e9a: 60 91 68 05 lds r22, 0x0568 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.516> 38e9e: 70 91 69 05 lds r23, 0x0569 ; 0x800569 <_ZL13babystepLoadZ.lto_priv.516+0x1> 38ea2: 07 2e mov r0, r23 38ea4: 00 0c add r0, r0 38ea6: 88 0b sbc r24, r24 38ea8: 99 0b sbc r25, r25 38eaa: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 38eae: 20 91 78 06 lds r18, 0x0678 ; 0x800678 38eb2: 30 91 79 06 lds r19, 0x0679 ; 0x800679 38eb6: 40 91 7a 06 lds r20, 0x067A ; 0x80067a 38eba: 50 91 7b 06 lds r21, 0x067B ; 0x80067b 38ebe: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 38ec2: 0f 94 13 c7 call 0x38e26 ; 0x38e26 babystepLoadZ = 0; 38ec6: 10 92 69 05 sts 0x0569, r1 ; 0x800569 <_ZL13babystepLoadZ.lto_priv.516+0x1> 38eca: 10 92 68 05 sts 0x0568, r1 ; 0x800568 <_ZL13babystepLoadZ.lto_priv.516> } 38ece: 08 95 ret 00038ed0 : return sampled; } void go_home_with_z_lift() { 38ed0: cf 93 push r28 38ed2: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38ed4: 0e 94 70 67 call 0xcee0 ; 0xcee0 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 38ed8: c1 e4 ldi r28, 0x41 ; 65 38eda: d7 e0 ldi r29, 0x07 ; 7 38edc: 80 e0 ldi r24, 0x00 ; 0 38ede: 90 e0 ldi r25, 0x00 ; 0 38ee0: a0 ea ldi r26, 0xA0 ; 160 38ee2: b0 e4 ldi r27, 0x40 ; 64 38ee4: 88 87 std Y+8, r24 ; 0x08 38ee6: 99 87 std Y+9, r25 ; 0x09 38ee8: aa 87 std Y+10, r26 ; 0x0a 38eea: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38eec: 65 e5 ldi r22, 0x55 ; 85 38eee: 75 e5 ldi r23, 0x55 ; 85 38ef0: 85 e5 ldi r24, 0x55 ; 85 38ef2: 91 e4 ldi r25, 0x41 ; 65 38ef4: 0f 94 48 c3 call 0x38690 ; 0x38690 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 38ef8: 8d ec ldi r24, 0xCD ; 205 38efa: 9c ec ldi r25, 0xCC ; 204 38efc: ac e4 ldi r26, 0x4C ; 76 38efe: be e3 ldi r27, 0x3E ; 62 38f00: 88 83 st Y, r24 38f02: 99 83 std Y+1, r25 ; 0x01 38f04: aa 83 std Y+2, r26 ; 0x02 38f06: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 38f08: 83 e3 ldi r24, 0x33 ; 51 38f0a: 93 e3 ldi r25, 0x33 ; 51 38f0c: a3 e7 ldi r26, 0x73 ; 115 38f0e: b0 ec ldi r27, 0xC0 ; 192 38f10: 8c 83 std Y+4, r24 ; 0x04 38f12: 9d 83 std Y+5, r25 ; 0x05 38f14: ae 83 std Y+6, r26 ; 0x06 38f16: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 38f18: 65 e4 ldi r22, 0x45 ; 69 38f1a: 77 e0 ldi r23, 0x07 ; 7 38f1c: ce 01 movw r24, r28 38f1e: 0e 94 57 6b call 0xd6ae ; 0xd6ae go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 38f22: 60 e0 ldi r22, 0x00 ; 0 38f24: 70 e0 ldi r23, 0x00 ; 0 38f26: 86 e1 ldi r24, 0x16 ; 22 38f28: 93 e4 ldi r25, 0x43 ; 67 38f2a: 0f 94 48 c3 call 0x38690 ; 0x38690 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 38f2e: 8a e9 ldi r24, 0x9A ; 154 38f30: 99 e9 ldi r25, 0x99 ; 153 38f32: a9 e1 ldi r26, 0x19 ; 25 38f34: be e3 ldi r27, 0x3E ; 62 38f36: 88 87 std Y+8, r24 ; 0x08 38f38: 99 87 std Y+9, r25 ; 0x09 38f3a: aa 87 std Y+10, r26 ; 0x0a 38f3c: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38f3e: 65 e5 ldi r22, 0x55 ; 85 38f40: 75 e5 ldi r23, 0x55 ; 85 38f42: 85 e5 ldi r24, 0x55 ; 85 38f44: 91 e4 ldi r25, 0x41 ; 65 } 38f46: df 91 pop r29 38f48: 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); 38f4a: 0d 94 48 c3 jmp 0x38690 ; 0x38690 00038f4e : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 38f4e: 68 2f mov r22, r24 38f50: 70 e0 ldi r23, 0x00 ; 0 38f52: 90 e0 ldi r25, 0x00 ; 0 38f54: 80 e0 ldi r24, 0x00 ; 0 38f56: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 38f5a: 20 e0 ldi r18, 0x00 ; 0 38f5c: 30 e0 ldi r19, 0x00 ; 0 38f5e: 48 e0 ldi r20, 0x08 ; 8 38f60: 52 e4 ldi r21, 0x42 ; 66 38f62: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 38f66: 20 e0 ldi r18, 0x00 ; 0 38f68: 30 e0 ldi r19, 0x00 ; 0 38f6a: 40 e8 ldi r20, 0x80 ; 128 38f6c: 5f e3 ldi r21, 0x3F ; 63 38f6e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> } 38f72: 08 95 ret 00038f74 : // 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() { 38f74: 2f 92 push r2 38f76: 3f 92 push r3 38f78: 4f 92 push r4 38f7a: 5f 92 push r5 38f7c: 6f 92 push r6 38f7e: 7f 92 push r7 38f80: 8f 92 push r8 38f82: 9f 92 push r9 38f84: af 92 push r10 38f86: bf 92 push r11 38f88: cf 92 push r12 38f8a: df 92 push r13 38f8c: ef 92 push r14 38f8e: ff 92 push r15 38f90: 0f 93 push r16 38f92: 1f 93 push r17 38f94: cf 93 push r28 38f96: df 93 push r29 38f98: 00 d0 rcall .+0 ; 0x38f9a 38f9a: 00 d0 rcall .+0 ; 0x38f9c 38f9c: cd b7 in r28, 0x3d ; 61 38f9e: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 38fa0: 84 e0 ldi r24, 0x04 ; 4 38fa2: 0f 94 8b 3b call 0x27716 ; 0x27716 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 38fa6: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 38faa: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 38fac: 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); 38fb0: 80 e0 ldi r24, 0x00 ; 0 38fb2: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 38fb6: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38fb8: 0e 94 70 67 call 0xcee0 ; 0xcee0 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 38fbc: 85 ee ldi r24, 0xE5 ; 229 38fbe: 98 e4 ldi r25, 0x48 ; 72 38fc0: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 38fc4: 0f 94 7d 35 call 0x26afa ; 0x26afa // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 38fc8: 43 ef ldi r20, 0xF3 ; 243 38fca: 50 e7 ldi r21, 0x70 ; 112 38fcc: 63 e0 ldi r22, 0x03 ; 3 38fce: 80 e0 ldi r24, 0x00 ; 0 38fd0: 0e 94 a1 6f call 0xdf42 ; 0xdf42 38fd4: 81 e0 ldi r24, 0x01 ; 1 38fd6: 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; 38fda: 80 e0 ldi r24, 0x00 ; 0 38fdc: 90 e0 ldi r25, 0x00 ; 0 38fde: a0 ea ldi r26, 0xA0 ; 160 38fe0: b0 e4 ldi r27, 0x40 ; 64 38fe2: 80 93 49 07 sts 0x0749, r24 ; 0x800749 38fe6: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a 38fea: a0 93 4b 07 sts 0x074B, r26 ; 0x80074b 38fee: b0 93 4c 07 sts 0x074C, r27 ; 0x80074c go_to_current(homing_feedrate[Z_AXIS]/60); 38ff2: 65 e5 ldi r22, 0x55 ; 85 38ff4: 75 e5 ldi r23, 0x55 ; 85 38ff6: 85 e5 ldi r24, 0x55 ; 85 38ff8: 91 e4 ldi r25, 0x41 ; 65 38ffa: 0f 94 48 c3 call 0x38690 ; 0x38690 #ifdef TMC2130 check_Z_crash(); 38ffe: 0e 94 b4 7b call 0xf768 ; 0xf768 39002: 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; 39006: 80 e0 ldi r24, 0x00 ; 0 39008: 90 e0 ldi r25, 0x00 ; 0 3900a: a0 e8 ldi r26, 0x80 ; 128 3900c: bf e3 ldi r27, 0x3F ; 63 3900e: 80 93 41 07 sts 0x0741, r24 ; 0x800741 39012: 90 93 42 07 sts 0x0742, r25 ; 0x800742 39016: a0 93 43 07 sts 0x0743, r26 ; 0x800743 3901a: b0 93 44 07 sts 0x0744, r27 ; 0x800744 current_position[Y_AXIS] = BED_Y0; 3901e: 80 93 45 07 sts 0x0745, r24 ; 0x800745 39022: 90 93 46 07 sts 0x0746, r25 ; 0x800746 39026: a0 93 47 07 sts 0x0747, r26 ; 0x800747 3902a: b0 93 48 07 sts 0x0748, r27 ; 0x800748 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 3902e: 65 e4 ldi r22, 0x45 ; 69 39030: 77 e0 ldi r23, 0x07 ; 7 39032: 81 e4 ldi r24, 0x41 ; 65 39034: 97 e0 ldi r25, 0x07 ; 7 39036: 0e 94 57 6b call 0xd6ae ; 0xd6ae go_to_current(homing_feedrate[X_AXIS]/60); 3903a: 60 e0 ldi r22, 0x00 ; 0 3903c: 70 e0 ldi r23, 0x00 ; 0 3903e: 88 e4 ldi r24, 0x48 ; 72 39040: 92 e4 ldi r25, 0x42 ; 66 39042: 0f 94 48 c3 call 0x38690 ; 0x38690 set_destination_to_current(); 39046: 0e 94 e7 68 call 0xd1ce ; 0xd1ce homeaxis(Z_AXIS); 3904a: 50 e0 ldi r21, 0x00 ; 0 3904c: 40 e0 ldi r20, 0x00 ; 0 3904e: 61 e0 ldi r22, 0x01 ; 1 39050: 82 e0 ldi r24, 0x02 ; 2 39052: 0e 94 ee 7b call 0xf7dc ; 0xf7dc if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 39056: 43 e0 ldi r20, 0x03 ; 3 39058: 60 e0 ldi r22, 0x00 ; 0 3905a: 70 e0 ldi r23, 0x00 ; 0 3905c: 80 e2 ldi r24, 0x20 ; 32 3905e: 91 ec ldi r25, 0xC1 ; 193 39060: 0f 94 21 8c call 0x31842 ; 0x31842 39064: 81 11 cpse r24, r1 39066: 06 c0 rjmp .+12 ; 0x39074 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)); 39068: 80 ec ldi r24, 0xC0 ; 192 3906a: 94 e6 ldi r25, 0x64 ; 100 3906c: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 39070: 0e 94 8d 7b call 0xf71a ; 0xf71a float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 39074: 80 91 49 07 lds r24, 0x0749 ; 0x800749 39078: 90 91 4a 07 lds r25, 0x074A ; 0x80074a 3907c: a0 91 4b 07 lds r26, 0x074B ; 0x80074b 39080: b0 91 4c 07 lds r27, 0x074C ; 0x80074c 39084: 80 93 9f 13 sts 0x139F, r24 ; 0x80139f 39088: 90 93 a0 13 sts 0x13A0, r25 ; 0x8013a0 3908c: a0 93 a1 13 sts 0x13A1, r26 ; 0x8013a1 39090: b0 93 a2 13 sts 0x13A2, r27 ; 0x8013a2 39094: e2 e0 ldi r30, 0x02 ; 2 39096: f0 e0 ldi r31, 0x00 ; 0 39098: fa 83 std Y+2, r31 ; 0x02 3909a: 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; 3909c: c1 2c mov r12, r1 3909e: d1 2c mov r13, r1 390a0: 30 ea ldi r19, 0xA0 ; 160 390a2: e3 2e mov r14, r19 390a4: 30 e4 ldi r19, 0x40 ; 64 390a6: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 390a8: 43 e0 ldi r20, 0x03 ; 3 390aa: 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 390ac: 52 e0 ldi r21, 0x02 ; 2 390ae: 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); 390b0: 00 e2 ldi r16, 0x20 ; 32 390b2: 1a ea ldi r17, 0xAA ; 170 390b4: 67 e0 ldi r22, 0x07 ; 7 390b6: 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(); 390b8: 0e 94 70 67 call 0xcee0 ; 0xcee0 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 390bc: c0 92 49 07 sts 0x0749, r12 ; 0x800749 390c0: d0 92 4a 07 sts 0x074A, r13 ; 0x80074a 390c4: e0 92 4b 07 sts 0x074B, r14 ; 0x80074b 390c8: f0 92 4c 07 sts 0x074C, r15 ; 0x80074c go_to_current(homing_feedrate[Z_AXIS]/60); 390cc: 65 e5 ldi r22, 0x55 ; 85 390ce: 75 e5 ldi r23, 0x55 ; 85 390d0: 85 e5 ldi r24, 0x55 ; 85 390d2: 91 e4 ldi r25, 0x41 ; 65 390d4: 0f 94 48 c3 call 0x38690 ; 0x38690 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 390d8: 29 81 ldd r18, Y+1 ; 0x01 390da: 21 50 subi r18, 0x01 ; 1 390dc: 82 2f mov r24, r18 390de: 6b 2d mov r22, r11 390e0: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__udivmodqi4> 390e4: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 390e6: 82 2f mov r24, r18 390e8: 0f 94 44 de call 0x3bc88 ; 0x3bc88 <__divmodqi4> 390ec: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 390ee: 80 ff sbrs r24, 0 390f0: 03 c0 rjmp .+6 ; 0x390f8 390f2: f9 2d mov r31, r9 390f4: f8 19 sub r31, r8 390f6: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 390f8: 88 2d mov r24, r8 390fa: 88 0f add r24, r24 390fc: 88 0d add r24, r8 390fe: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 39102: 60 93 41 07 sts 0x0741, r22 ; 0x800741 39106: 70 93 42 07 sts 0x0742, r23 ; 0x800742 3910a: 80 93 43 07 sts 0x0743, r24 ; 0x800743 3910e: 90 93 44 07 sts 0x0744, r25 ; 0x800744 current_position[Y_AXIS] = BED_Y(iy * 3); 39112: 87 2d mov r24, r7 39114: 88 0f add r24, r24 39116: 87 0d add r24, r7 39118: 0f 94 a7 c7 call 0x38f4e ; 0x38f4e 3911c: 60 93 45 07 sts 0x0745, r22 ; 0x800745 39120: 70 93 46 07 sts 0x0746, r23 ; 0x800746 39124: 80 93 47 07 sts 0x0747, r24 ; 0x800747 39128: 90 93 48 07 sts 0x0748, r25 ; 0x800748 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 3912c: 65 e4 ldi r22, 0x45 ; 69 3912e: 77 e0 ldi r23, 0x07 ; 7 39130: 81 e4 ldi r24, 0x41 ; 65 39132: 97 e0 ldi r25, 0x07 ; 7 39134: 0e 94 57 6b call 0xd6ae ; 0xd6ae go_to_current(homing_feedrate[X_AXIS]/60); 39138: 60 e0 ldi r22, 0x00 ; 0 3913a: 70 e0 ldi r23, 0x00 ; 0 3913c: 88 e4 ldi r24, 0x48 ; 72 3913e: 92 e4 ldi r25, 0x42 ; 66 39140: 0f 94 48 c3 call 0x38690 ; 0x38690 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 39144: 63 e0 ldi r22, 0x03 ; 3 39146: 80 e0 ldi r24, 0x00 ; 0 39148: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_printf_P(PSTR("%d/9"),mesh_point+1); 3914c: 8a 81 ldd r24, Y+2 ; 0x02 3914e: 8f 93 push r24 39150: 99 81 ldd r25, Y+1 ; 0x01 39152: 9f 93 push r25 39154: 1f 93 push r17 39156: 0f 93 push r16 39158: 0e 94 66 6f call 0xdecc ; 0xdecc #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 3915c: 43 e0 ldi r20, 0x03 ; 3 3915e: 60 e0 ldi r22, 0x00 ; 0 39160: 70 e0 ldi r23, 0x00 ; 0 39162: 80 e2 ldi r24, 0x20 ; 32 39164: 91 ec ldi r25, 0xC1 ; 193 39166: 0f 94 21 8c call 0x31842 ; 0x31842 3916a: 58 2e mov r5, r24 3916c: 0f 90 pop r0 3916e: 0f 90 pop r0 39170: 0f 90 pop r0 39172: 0f 90 pop r0 39174: 88 23 and r24, r24 39176: 09 f4 brne .+2 ; 0x3917a 39178: 77 cf rjmp .-274 ; 0x39068 3917a: a7 9c mul r10, r7 3917c: f0 01 movw r30, r0 3917e: 11 24 eor r1, r1 39180: e8 0d add r30, r8 39182: f1 1d adc r31, r1 39184: ee 0f add r30, r30 39186: ff 1f adc r31, r31 39188: ee 0f add r30, r30 3918a: ff 1f adc r31, r31 3918c: e2 56 subi r30, 0x62 ; 98 3918e: fc 4e sbci r31, 0xEC ; 236 39190: 80 91 49 07 lds r24, 0x0749 ; 0x800749 39194: 90 91 4a 07 lds r25, 0x074A ; 0x80074a 39198: a0 91 4b 07 lds r26, 0x074B ; 0x80074b 3919c: b0 91 4c 07 lds r27, 0x074C ; 0x80074c 391a0: 81 83 std Z+1, r24 ; 0x01 391a2: 92 83 std Z+2, r25 ; 0x02 391a4: a3 83 std Z+3, r26 ; 0x03 391a6: b4 83 std Z+4, r27 ; 0x04 391a8: e9 81 ldd r30, Y+1 ; 0x01 391aa: fa 81 ldd r31, Y+2 ; 0x02 391ac: 31 96 adiw r30, 0x01 ; 1 391ae: fa 83 std Y+2, r31 ; 0x02 391b0: 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) { 391b2: 3a 97 sbiw r30, 0x0a ; 10 391b4: 09 f0 breq .+2 ; 0x391b8 391b6: 80 cf rjmp .-256 ; 0x390b8 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 391b8: 60 90 9f 13 lds r6, 0x139F ; 0x80139f 391bc: 70 90 a0 13 lds r7, 0x13A0 ; 0x8013a0 391c0: 80 90 a1 13 lds r8, 0x13A1 ; 0x8013a1 391c4: 90 90 a2 13 lds r9, 0x13A2 ; 0x8013a2 float zmax = zmin; 391c8: 46 2c mov r4, r6 391ca: a7 2c mov r10, r7 391cc: b8 2c mov r11, r8 391ce: 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]; 391d0: 1e 82 std Y+6, r1 ; 0x06 391d2: 1d 82 std Y+5, r1 ; 0x05 391d4: 0e e9 ldi r16, 0x9E ; 158 391d6: 13 e1 ldi r17, 0x13 ; 19 391d8: 8d 81 ldd r24, Y+5 ; 0x05 391da: 9e 81 ldd r25, Y+6 ; 0x06 391dc: 81 56 subi r24, 0x61 ; 97 391de: 9c 4e sbci r25, 0xEC ; 236 391e0: 9a 83 std Y+2, r25 ; 0x02 391e2: 89 83 std Y+1, r24 ; 0x01 391e4: 93 e0 ldi r25, 0x03 ; 3 391e6: 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]); 391e8: e9 81 ldd r30, Y+1 ; 0x01 391ea: fa 81 ldd r31, Y+2 ; 0x02 391ec: c1 90 ld r12, Z+ 391ee: d1 90 ld r13, Z+ 391f0: e1 90 ld r14, Z+ 391f2: f1 90 ld r15, Z+ 391f4: fa 83 std Y+2, r31 ; 0x02 391f6: e9 83 std Y+1, r30 ; 0x01 391f8: 93 01 movw r18, r6 391fa: a4 01 movw r20, r8 391fc: c7 01 movw r24, r14 391fe: b6 01 movw r22, r12 39200: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 39204: 18 16 cp r1, r24 39206: 14 f0 brlt .+4 ; 0x3920c 39208: 36 01 movw r6, r12 3920a: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 3920c: 24 2d mov r18, r4 3920e: 3a 2d mov r19, r10 39210: 4b 2d mov r20, r11 39212: 52 2d mov r21, r2 39214: c7 01 movw r24, r14 39216: b6 01 movw r22, r12 39218: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3921c: 87 fd sbrc r24, 7 3921e: 04 c0 rjmp .+8 ; 0x39228 39220: 4c 2c mov r4, r12 39222: ad 2c mov r10, r13 39224: be 2c mov r11, r14 39226: 2f 2c mov r2, r15 39228: 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) { 3922a: 31 10 cpse r3, r1 3922c: dd cf rjmp .-70 ; 0x391e8 3922e: 8d 81 ldd r24, Y+5 ; 0x05 39230: 9e 81 ldd r25, Y+6 ; 0x06 39232: 4c 96 adiw r24, 0x1c ; 28 39234: 9e 83 std Y+6, r25 ; 0x06 39236: 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) 39238: 84 35 cpi r24, 0x54 ; 84 3923a: 91 05 cpc r25, r1 3923c: 59 f6 brne .-106 ; 0x391d4 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) { 3923e: 93 01 movw r18, r6 39240: a4 01 movw r20, r8 39242: 64 2d mov r22, r4 39244: 7a 2d mov r23, r10 39246: 8b 2d mov r24, r11 39248: 92 2d mov r25, r2 3924a: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 3924e: 20 e0 ldi r18, 0x00 ; 0 39250: 30 e0 ldi r19, 0x00 ; 0 39252: 40 e4 ldi r20, 0x40 ; 64 39254: 50 e4 ldi r21, 0x40 ; 64 39256: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 3925a: 18 16 cp r1, r24 3925c: 3c f5 brge .+78 ; 0x392ac // 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!"); 3925e: 83 e0 ldi r24, 0x03 ; 3 39260: 9a ea ldi r25, 0xAA ; 170 39262: 0e 94 fe 7a call 0xf5fc ; 0xf5fc // 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; 39266: 51 2c mov r5, r1 39268: fc 81 ldd r31, Y+4 ; 0x04 3926a: 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); 3926e: 8b 81 ldd r24, Y+3 ; 0x03 39270: 0f 94 52 64 call 0x2c8a4 ; 0x2c8a4 #ifdef TMC2130 tmc2130_home_exit(); 39274: 0f 94 5c 3b call 0x276b8 ; 0x276b8 #endif return result; } 39278: 85 2d mov r24, r5 3927a: 26 96 adiw r28, 0x06 ; 6 3927c: 0f b6 in r0, 0x3f ; 63 3927e: f8 94 cli 39280: de bf out 0x3e, r29 ; 62 39282: 0f be out 0x3f, r0 ; 63 39284: cd bf out 0x3d, r28 ; 61 39286: df 91 pop r29 39288: cf 91 pop r28 3928a: 1f 91 pop r17 3928c: 0f 91 pop r16 3928e: ff 90 pop r15 39290: ef 90 pop r14 39292: df 90 pop r13 39294: cf 90 pop r12 39296: bf 90 pop r11 39298: af 90 pop r10 3929a: 9f 90 pop r9 3929c: 8f 90 pop r8 3929e: 7f 90 pop r7 392a0: 6f 90 pop r6 392a2: 5f 90 pop r5 392a4: 4f 90 pop r4 392a6: 3f 90 pop r3 392a8: 2f 90 pop r2 392aa: 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) 392ac: 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; 392ae: 85 ec ldi r24, 0xC5 ; 197 392b0: e8 2e mov r14, r24 392b2: 8f e0 ldi r24, 0x0F ; 15 392b4: f8 2e mov r15, r24 392b6: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 392b8: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 392ba: 9d 81 ldd r25, Y+5 ; 0x05 392bc: 91 11 cpse r25, r1 392be: 03 c0 rjmp .+6 ; 0x392c6 392c0: e9 81 ldd r30, Y+1 ; 0x01 392c2: ee 23 and r30, r30 392c4: 29 f1 breq .+74 ; 0x39310 continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 392c6: 20 91 9f 13 lds r18, 0x139F ; 0x80139f 392ca: 30 91 a0 13 lds r19, 0x13A0 ; 0x8013a0 392ce: 40 91 a1 13 lds r20, 0x13A1 ; 0x8013a1 392d2: 50 91 a2 13 lds r21, 0x13A2 ; 0x8013a2 392d6: f6 01 movw r30, r12 392d8: 61 81 ldd r22, Z+1 ; 0x01 392da: 72 81 ldd r23, Z+2 ; 0x02 392dc: 83 81 ldd r24, Z+3 ; 0x03 392de: 94 81 ldd r25, Z+4 ; 0x04 392e0: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 392e4: 20 e0 ldi r18, 0x00 ; 0 392e6: 30 e0 ldi r19, 0x00 ; 0 392e8: 48 ec ldi r20, 0xC8 ; 200 392ea: 52 e4 ldi r21, 0x42 ; 66 392ec: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 392f0: 20 e0 ldi r18, 0x00 ; 0 392f2: 30 e0 ldi r19, 0x00 ; 0 392f4: 40 e0 ldi r20, 0x00 ; 0 392f6: 5f e3 ldi r21, 0x3F ; 63 392f8: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 392fc: 0f 94 58 e0 call 0x3c0b0 ; 0x3c0b0 39300: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 39304: c7 01 movw r24, r14 39306: 0f 94 cb dd call 0x3bb96 ; 0x3bb96 SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 3930a: f2 e0 ldi r31, 0x02 ; 2 3930c: ef 0e add r14, r31 3930e: f1 1c adc r15, r1 39310: 84 e0 ldi r24, 0x04 ; 4 39312: c8 0e add r12, r24 39314: d1 1c adc r13, r1 39316: 9d 81 ldd r25, Y+5 ; 0x05 39318: 9f 5f subi r25, 0xFF ; 255 3931a: 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) { 3931c: 93 30 cpi r25, 0x03 ; 3 3931e: 69 f6 brne .-102 ; 0x392ba 39320: 04 5e subi r16, 0xE4 ; 228 39322: 1f 4f sbci r17, 0xFF ; 255 39324: e9 81 ldd r30, Y+1 ; 0x01 39326: ef 5f subi r30, 0xFF ; 255 39328: 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) 3932a: e3 30 cpi r30, 0x03 ; 3 3932c: 21 f6 brne .-120 ; 0x392b6 #endif addr += 2; } } mbl.reset(); 3932e: 0f 94 17 8c call 0x3182e ; 0x3182e go_home_with_z_lift(); 39332: 0f 94 68 c7 call 0x38ed0 ; 0x38ed0 39336: 98 cf rjmp .-208 ; 0x39268 00039338 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 39338: 82 e0 ldi r24, 0x02 ; 2 3933a: 0f 94 10 59 call 0x2b220 ; 0x2b220 3933e: 60 93 49 07 sts 0x0749, r22 ; 0x800749 39342: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 39346: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 3934a: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c plan_set_z_position(current_position[Z_AXIS]); 3934e: 89 e4 ldi r24, 0x49 ; 73 39350: 97 e0 ldi r25, 0x07 ; 7 39352: 0d 94 0f ab jmp 0x3561e ; 0x3561e 00039356 : * 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() { 39356: 4f 92 push r4 39358: 5f 92 push r5 3935a: 6f 92 push r6 3935c: 7f 92 push r7 3935e: 8f 92 push r8 39360: 9f 92 push r9 39362: af 92 push r10 39364: bf 92 push r11 39366: cf 92 push r12 39368: df 92 push r13 3936a: ef 92 push r14 3936c: ff 92 push r15 3936e: 0f 93 push r16 39370: 1f 93 push r17 39372: cf 93 push r28 39374: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 39376: 01 e4 ldi r16, 0x41 ; 65 39378: 17 e0 ldi r17, 0x07 ; 7 3937a: c1 ee ldi r28, 0xE1 ; 225 3937c: d7 e1 ldi r29, 0x17 ; 23 3937e: 28 81 ld r18, Y 39380: 39 81 ldd r19, Y+1 ; 0x01 39382: 4a 81 ldd r20, Y+2 ; 0x02 39384: 5b 81 ldd r21, Y+3 ; 0x03 39386: f8 01 movw r30, r16 39388: 60 81 ld r22, Z 3938a: 71 81 ldd r23, Z+1 ; 0x01 3938c: 82 81 ldd r24, Z+2 ; 0x02 3938e: 93 81 ldd r25, Z+3 ; 0x03 39390: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 39394: 4b 01 movw r8, r22 39396: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 39398: 2c 81 ldd r18, Y+4 ; 0x04 3939a: 3d 81 ldd r19, Y+5 ; 0x05 3939c: 4e 81 ldd r20, Y+6 ; 0x06 3939e: 5f 81 ldd r21, Y+7 ; 0x07 393a0: f8 01 movw r30, r16 393a2: 64 81 ldd r22, Z+4 ; 0x04 393a4: 75 81 ldd r23, Z+5 ; 0x05 393a6: 86 81 ldd r24, Z+6 ; 0x06 393a8: 97 81 ldd r25, Z+7 ; 0x07 393aa: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 393ae: 6b 01 movw r12, r22 393b0: 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; 393b2: c1 ed ldi r28, 0xD1 ; 209 393b4: d7 e1 ldi r29, 0x17 ; 23 393b6: 28 81 ld r18, Y 393b8: 39 81 ldd r19, Y+1 ; 0x01 393ba: 4a 81 ldd r20, Y+2 ; 0x02 393bc: 5b 81 ldd r21, Y+3 ; 0x03 393be: c5 01 movw r24, r10 393c0: b4 01 movw r22, r8 393c2: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 393c6: 2b 01 movw r4, r22 393c8: 3c 01 movw r6, r24 393ca: 2c 81 ldd r18, Y+4 ; 0x04 393cc: 3d 81 ldd r19, Y+5 ; 0x05 393ce: 4e 81 ldd r20, Y+6 ; 0x06 393d0: 5f 81 ldd r21, Y+7 ; 0x07 393d2: c7 01 movw r24, r14 393d4: b6 01 movw r22, r12 393d6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 393da: 9b 01 movw r18, r22 393dc: ac 01 movw r20, r24 393de: c3 01 movw r24, r6 393e0: b2 01 movw r22, r4 393e2: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 393e6: f8 01 movw r30, r16 393e8: 60 83 st Z, r22 393ea: 71 83 std Z+1, r23 ; 0x01 393ec: 82 83 std Z+2, r24 ; 0x02 393ee: 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; 393f0: 28 85 ldd r18, Y+8 ; 0x08 393f2: 39 85 ldd r19, Y+9 ; 0x09 393f4: 4a 85 ldd r20, Y+10 ; 0x0a 393f6: 5b 85 ldd r21, Y+11 ; 0x0b 393f8: c5 01 movw r24, r10 393fa: b4 01 movw r22, r8 393fc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 39400: 4b 01 movw r8, r22 39402: 5c 01 movw r10, r24 39404: 2c 85 ldd r18, Y+12 ; 0x0c 39406: 3d 85 ldd r19, Y+13 ; 0x0d 39408: 4e 85 ldd r20, Y+14 ; 0x0e 3940a: 5f 85 ldd r21, Y+15 ; 0x0f 3940c: c7 01 movw r24, r14 3940e: b6 01 movw r22, r12 39410: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 39414: 9b 01 movw r18, r22 39416: ac 01 movw r20, r24 39418: c5 01 movw r24, r10 3941a: b4 01 movw r22, r8 3941c: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 39420: f8 01 movw r30, r16 39422: 64 83 std Z+4, r22 ; 0x04 39424: 75 83 std Z+5, r23 ; 0x05 39426: 86 83 std Z+6, r24 ; 0x06 39428: 97 83 std Z+7, r25 ; 0x07 } 3942a: df 91 pop r29 3942c: cf 91 pop r28 3942e: 1f 91 pop r17 39430: 0f 91 pop r16 39432: ff 90 pop r15 39434: ef 90 pop r14 39436: df 90 pop r13 39438: cf 90 pop r12 3943a: bf 90 pop r11 3943c: af 90 pop r10 3943e: 9f 90 pop r9 39440: 8f 90 pop r8 39442: 7f 90 pop r7 39444: 6f 90 pop r6 39446: 5f 90 pop r5 39448: 4f 90 pop r4 3944a: 08 95 ret 0003944c : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 3944c: 4f 92 push r4 3944e: 5f 92 push r5 39450: 6f 92 push r6 39452: 7f 92 push r7 39454: 8f 92 push r8 39456: 9f 92 push r9 39458: af 92 push r10 3945a: bf 92 push r11 3945c: cf 92 push r12 3945e: df 92 push r13 39460: ef 92 push r14 39462: ff 92 push r15 39464: 0f 93 push r16 39466: 1f 93 push r17 39468: cf 93 push r28 3946a: df 93 push r29 3946c: 00 d0 rcall .+0 ; 0x3946e 3946e: 00 d0 rcall .+0 ; 0x39470 39470: 1f 92 push r1 39472: 1f 92 push r1 39474: cd b7 in r28, 0x3d ; 61 39476: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 39478: dc 01 movw r26, r24 3947a: cd 90 ld r12, X+ 3947c: dd 90 ld r13, X+ 3947e: ed 90 ld r14, X+ 39480: fc 90 ld r15, X 39482: 13 97 sbiw r26, 0x03 ; 3 39484: c0 92 b6 17 sts 0x17B6, r12 ; 0x8017b6 39488: d0 92 b7 17 sts 0x17B7, r13 ; 0x8017b7 3948c: e0 92 b8 17 sts 0x17B8, r14 ; 0x8017b8 39490: f0 92 b9 17 sts 0x17B9, r15 ; 0x8017b9 world2machine_rotation_and_skew[1][0] = vec_x[1]; 39494: 14 96 adiw r26, 0x04 ; 4 39496: 0d 91 ld r16, X+ 39498: 1d 91 ld r17, X+ 3949a: 2d 91 ld r18, X+ 3949c: 3c 91 ld r19, X 3949e: 17 97 sbiw r26, 0x07 ; 7 394a0: 09 83 std Y+1, r16 ; 0x01 394a2: 1a 83 std Y+2, r17 ; 0x02 394a4: 2b 83 std Y+3, r18 ; 0x03 394a6: 3c 83 std Y+4, r19 ; 0x04 394a8: 00 93 be 17 sts 0x17BE, r16 ; 0x8017be 394ac: 10 93 bf 17 sts 0x17BF, r17 ; 0x8017bf 394b0: 20 93 c0 17 sts 0x17C0, r18 ; 0x8017c0 394b4: 30 93 c1 17 sts 0x17C1, r19 ; 0x8017c1 world2machine_rotation_and_skew[0][1] = vec_y[0]; 394b8: db 01 movw r26, r22 394ba: 0d 91 ld r16, X+ 394bc: 1d 91 ld r17, X+ 394be: 2d 91 ld r18, X+ 394c0: 3c 91 ld r19, X 394c2: 13 97 sbiw r26, 0x03 ; 3 394c4: 0d 83 std Y+5, r16 ; 0x05 394c6: 1e 83 std Y+6, r17 ; 0x06 394c8: 2f 83 std Y+7, r18 ; 0x07 394ca: 38 87 std Y+8, r19 ; 0x08 394cc: 00 93 ba 17 sts 0x17BA, r16 ; 0x8017ba 394d0: 10 93 bb 17 sts 0x17BB, r17 ; 0x8017bb 394d4: 20 93 bc 17 sts 0x17BC, r18 ; 0x8017bc 394d8: 30 93 bd 17 sts 0x17BD, r19 ; 0x8017bd world2machine_rotation_and_skew[1][1] = vec_y[1]; 394dc: 14 96 adiw r26, 0x04 ; 4 394de: 4d 90 ld r4, X+ 394e0: 5d 90 ld r5, X+ 394e2: 6d 90 ld r6, X+ 394e4: 7c 90 ld r7, X 394e6: 17 97 sbiw r26, 0x07 ; 7 394e8: 40 92 c2 17 sts 0x17C2, r4 ; 0x8017c2 394ec: 50 92 c3 17 sts 0x17C3, r5 ; 0x8017c3 394f0: 60 92 c4 17 sts 0x17C4, r6 ; 0x8017c4 394f4: 70 92 c5 17 sts 0x17C5, r7 ; 0x8017c5 world2machine_shift[0] = cntr[0]; 394f8: fa 01 movw r30, r20 394fa: 60 81 ld r22, Z 394fc: 71 81 ldd r23, Z+1 ; 0x01 394fe: 82 81 ldd r24, Z+2 ; 0x02 39500: 93 81 ldd r25, Z+3 ; 0x03 39502: 60 93 e1 17 sts 0x17E1, r22 ; 0x8017e1 39506: 70 93 e2 17 sts 0x17E2, r23 ; 0x8017e2 3950a: 80 93 e3 17 sts 0x17E3, r24 ; 0x8017e3 3950e: 90 93 e4 17 sts 0x17E4, r25 ; 0x8017e4 world2machine_shift[1] = cntr[1]; 39512: 84 80 ldd r8, Z+4 ; 0x04 39514: 95 80 ldd r9, Z+5 ; 0x05 39516: a6 80 ldd r10, Z+6 ; 0x06 39518: b7 80 ldd r11, Z+7 ; 0x07 3951a: 80 92 e5 17 sts 0x17E5, r8 ; 0x8017e5 3951e: 90 92 e6 17 sts 0x17E6, r9 ; 0x8017e6 39522: a0 92 e7 17 sts 0x17E7, r10 ; 0x8017e7 39526: b0 92 e8 17 sts 0x17E8, r11 ; 0x8017e8 // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 3952a: 20 e0 ldi r18, 0x00 ; 0 3952c: 30 e0 ldi r19, 0x00 ; 0 3952e: a9 01 movw r20, r18 39530: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 39534: 81 11 cpse r24, r1 39536: aa c0 rjmp .+340 ; 0x3968c 39538: 20 e0 ldi r18, 0x00 ; 0 3953a: 30 e0 ldi r19, 0x00 ; 0 3953c: a9 01 movw r20, r18 3953e: c5 01 movw r24, r10 39540: b4 01 movw r22, r8 39542: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 39546: 81 11 cpse r24, r1 39548: a1 c0 rjmp .+322 ; 0x3968c 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; 3954a: 10 92 e9 17 sts 0x17E9, r1 ; 0x8017e9 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 || 3954e: 20 e0 ldi r18, 0x00 ; 0 39550: 30 e0 ldi r19, 0x00 ; 0 39552: 40 e8 ldi r20, 0x80 ; 128 39554: 5f e3 ldi r21, 0x3F ; 63 39556: c7 01 movw r24, r14 39558: b6 01 movw r22, r12 3955a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3955e: 81 11 cpse r24, r1 39560: 21 c0 rjmp .+66 ; 0x395a4 39562: 20 e0 ldi r18, 0x00 ; 0 39564: 30 e0 ldi r19, 0x00 ; 0 39566: a9 01 movw r20, r18 39568: 6d 81 ldd r22, Y+5 ; 0x05 3956a: 7e 81 ldd r23, Y+6 ; 0x06 3956c: 8f 81 ldd r24, Y+7 ; 0x07 3956e: 98 85 ldd r25, Y+8 ; 0x08 39570: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 39574: 81 11 cpse r24, r1 39576: 16 c0 rjmp .+44 ; 0x395a4 39578: 20 e0 ldi r18, 0x00 ; 0 3957a: 30 e0 ldi r19, 0x00 ; 0 3957c: a9 01 movw r20, r18 3957e: 69 81 ldd r22, Y+1 ; 0x01 39580: 7a 81 ldd r23, Y+2 ; 0x02 39582: 8b 81 ldd r24, Y+3 ; 0x03 39584: 9c 81 ldd r25, Y+4 ; 0x04 39586: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3958a: 81 11 cpse r24, r1 3958c: 0b c0 rjmp .+22 ; 0x395a4 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 3958e: 20 e0 ldi r18, 0x00 ; 0 39590: 30 e0 ldi r19, 0x00 ; 0 39592: 40 e8 ldi r20, 0x80 ; 128 39594: 5f e3 ldi r21, 0x3F ; 63 39596: c3 01 movw r24, r6 39598: b2 01 movw r22, r4 3959a: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3959e: 88 23 and r24, r24 395a0: 09 f4 brne .+2 ; 0x395a4 395a2: 78 c0 rjmp .+240 ; 0x39694 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 395a4: 80 91 e9 17 lds r24, 0x17E9 ; 0x8017e9 395a8: 82 60 ori r24, 0x02 ; 2 395aa: 80 93 e9 17 sts 0x17E9, r24 ; 0x8017e9 // 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]; 395ae: a3 01 movw r20, r6 395b0: 92 01 movw r18, r4 395b2: c7 01 movw r24, r14 395b4: b6 01 movw r22, r12 395b6: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 395ba: 4b 01 movw r8, r22 395bc: 5c 01 movw r10, r24 395be: 2d 81 ldd r18, Y+5 ; 0x05 395c0: 3e 81 ldd r19, Y+6 ; 0x06 395c2: 4f 81 ldd r20, Y+7 ; 0x07 395c4: 58 85 ldd r21, Y+8 ; 0x08 395c6: 69 81 ldd r22, Y+1 ; 0x01 395c8: 7a 81 ldd r23, Y+2 ; 0x02 395ca: 8b 81 ldd r24, Y+3 ; 0x03 395cc: 9c 81 ldd r25, Y+4 ; 0x04 395ce: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 395d2: 9b 01 movw r18, r22 395d4: ac 01 movw r20, r24 395d6: c5 01 movw r24, r10 395d8: b4 01 movw r22, r8 395da: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 395de: 4b 01 movw r8, r22 395e0: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 395e2: ac 01 movw r20, r24 395e4: 9b 01 movw r18, r22 395e6: c3 01 movw r24, r6 395e8: b2 01 movw r22, r4 395ea: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 395ee: 60 93 d1 17 sts 0x17D1, r22 ; 0x8017d1 395f2: 70 93 d2 17 sts 0x17D2, r23 ; 0x8017d2 395f6: 80 93 d3 17 sts 0x17D3, r24 ; 0x8017d3 395fa: 90 93 d4 17 sts 0x17D4, r25 ; 0x8017d4 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 395fe: 6d 81 ldd r22, Y+5 ; 0x05 39600: 7e 81 ldd r23, Y+6 ; 0x06 39602: 8f 81 ldd r24, Y+7 ; 0x07 39604: 98 85 ldd r25, Y+8 ; 0x08 39606: 90 58 subi r25, 0x80 ; 128 39608: a5 01 movw r20, r10 3960a: 94 01 movw r18, r8 3960c: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 39610: 60 93 d5 17 sts 0x17D5, r22 ; 0x8017d5 39614: 70 93 d6 17 sts 0x17D6, r23 ; 0x8017d6 39618: 80 93 d7 17 sts 0x17D7, r24 ; 0x8017d7 3961c: 90 93 d8 17 sts 0x17D8, r25 ; 0x8017d8 world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 39620: 69 81 ldd r22, Y+1 ; 0x01 39622: 7a 81 ldd r23, Y+2 ; 0x02 39624: 8b 81 ldd r24, Y+3 ; 0x03 39626: 9c 81 ldd r25, Y+4 ; 0x04 39628: 90 58 subi r25, 0x80 ; 128 3962a: a5 01 movw r20, r10 3962c: 94 01 movw r18, r8 3962e: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 39632: 60 93 d9 17 sts 0x17D9, r22 ; 0x8017d9 39636: 70 93 da 17 sts 0x17DA, r23 ; 0x8017da 3963a: 80 93 db 17 sts 0x17DB, r24 ; 0x8017db 3963e: 90 93 dc 17 sts 0x17DC, r25 ; 0x8017dc world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 39642: a5 01 movw r20, r10 39644: 94 01 movw r18, r8 39646: c7 01 movw r24, r14 39648: b6 01 movw r22, r12 3964a: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__divsf3> 3964e: 60 93 dd 17 sts 0x17DD, r22 ; 0x8017dd 39652: 70 93 de 17 sts 0x17DE, r23 ; 0x8017de 39656: 80 93 df 17 sts 0x17DF, r24 ; 0x8017df 3965a: 90 93 e0 17 sts 0x17E0, r25 ; 0x8017e0 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; } } 3965e: 28 96 adiw r28, 0x08 ; 8 39660: 0f b6 in r0, 0x3f ; 63 39662: f8 94 cli 39664: de bf out 0x3e, r29 ; 62 39666: 0f be out 0x3f, r0 ; 63 39668: cd bf out 0x3d, r28 ; 61 3966a: df 91 pop r29 3966c: cf 91 pop r28 3966e: 1f 91 pop r17 39670: 0f 91 pop r16 39672: ff 90 pop r15 39674: ef 90 pop r14 39676: df 90 pop r13 39678: cf 90 pop r12 3967a: bf 90 pop r11 3967c: af 90 pop r10 3967e: 9f 90 pop r9 39680: 8f 90 pop r8 39682: 7f 90 pop r7 39684: 6f 90 pop r6 39686: 5f 90 pop r5 39688: 4f 90 pop r4 3968a: 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; 3968c: 81 e0 ldi r24, 0x01 ; 1 3968e: 80 93 e9 17 sts 0x17E9, r24 ; 0x8017e9 39692: 5d cf rjmp .-326 ; 0x3954e 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; 39694: 80 e0 ldi r24, 0x00 ; 0 39696: 90 e0 ldi r25, 0x00 ; 0 39698: a0 e8 ldi r26, 0x80 ; 128 3969a: bf e3 ldi r27, 0x3F ; 63 3969c: 80 93 d1 17 sts 0x17D1, r24 ; 0x8017d1 396a0: 90 93 d2 17 sts 0x17D2, r25 ; 0x8017d2 396a4: a0 93 d3 17 sts 0x17D3, r26 ; 0x8017d3 396a8: b0 93 d4 17 sts 0x17D4, r27 ; 0x8017d4 world2machine_rotation_and_skew_inv[0][1] = 0.f; 396ac: 10 92 d5 17 sts 0x17D5, r1 ; 0x8017d5 396b0: 10 92 d6 17 sts 0x17D6, r1 ; 0x8017d6 396b4: 10 92 d7 17 sts 0x17D7, r1 ; 0x8017d7 396b8: 10 92 d8 17 sts 0x17D8, r1 ; 0x8017d8 world2machine_rotation_and_skew_inv[1][0] = 0.f; 396bc: 10 92 d9 17 sts 0x17D9, r1 ; 0x8017d9 396c0: 10 92 da 17 sts 0x17DA, r1 ; 0x8017da 396c4: 10 92 db 17 sts 0x17DB, r1 ; 0x8017db 396c8: 10 92 dc 17 sts 0x17DC, r1 ; 0x8017dc world2machine_rotation_and_skew_inv[1][1] = 1.f; 396cc: 80 93 dd 17 sts 0x17DD, r24 ; 0x8017dd 396d0: 90 93 de 17 sts 0x17DE, r25 ; 0x8017de 396d4: a0 93 df 17 sts 0x17DF, r26 ; 0x8017df 396d8: b0 93 e0 17 sts 0x17E0, r27 ; 0x8017e0 396dc: c0 cf rjmp .-128 ; 0x3965e 000396de : * * 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() { 396de: cf 93 push r28 396e0: df 93 push r29 396e2: cd b7 in r28, 0x3d ; 61 396e4: de b7 in r29, 0x3e ; 62 396e6: 68 97 sbiw r28, 0x18 ; 24 396e8: 0f b6 in r0, 0x3f ; 63 396ea: f8 94 cli 396ec: de bf out 0x3e, r29 ; 62 396ee: 0f be out 0x3f, r0 ; 63 396f0: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 396f2: 80 e0 ldi r24, 0x00 ; 0 396f4: 90 e0 ldi r25, 0x00 ; 0 396f6: a0 e8 ldi r26, 0x80 ; 128 396f8: bf e3 ldi r27, 0x3F ; 63 396fa: 89 83 std Y+1, r24 ; 0x01 396fc: 9a 83 std Y+2, r25 ; 0x02 396fe: ab 83 std Y+3, r26 ; 0x03 39700: bc 83 std Y+4, r27 ; 0x04 39702: 1d 82 std Y+5, r1 ; 0x05 39704: 1e 82 std Y+6, r1 ; 0x06 39706: 1f 82 std Y+7, r1 ; 0x07 39708: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 3970a: 19 86 std Y+9, r1 ; 0x09 3970c: 1a 86 std Y+10, r1 ; 0x0a 3970e: 1b 86 std Y+11, r1 ; 0x0b 39710: 1c 86 std Y+12, r1 ; 0x0c 39712: 8d 87 std Y+13, r24 ; 0x0d 39714: 9e 87 std Y+14, r25 ; 0x0e 39716: af 87 std Y+15, r26 ; 0x0f 39718: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 3971a: 19 8a std Y+17, r1 ; 0x11 3971c: 1a 8a std Y+18, r1 ; 0x12 3971e: 1b 8a std Y+19, r1 ; 0x13 39720: 1c 8a std Y+20, r1 ; 0x14 39722: 1d 8a std Y+21, r1 ; 0x15 39724: 1e 8a std Y+22, r1 ; 0x16 39726: 1f 8a std Y+23, r1 ; 0x17 39728: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 3972a: ae 01 movw r20, r28 3972c: 4f 5e subi r20, 0xEF ; 239 3972e: 5f 4f sbci r21, 0xFF ; 255 39730: be 01 movw r22, r28 39732: 67 5f subi r22, 0xF7 ; 247 39734: 7f 4f sbci r23, 0xFF ; 255 39736: ce 01 movw r24, r28 39738: 01 96 adiw r24, 0x01 ; 1 3973a: 0f 94 26 ca call 0x3944c ; 0x3944c } 3973e: 68 96 adiw r28, 0x18 ; 24 39740: 0f b6 in r0, 0x3f ; 63 39742: f8 94 cli 39744: de bf out 0x3e, r29 ; 62 39746: 0f be out 0x3f, r0 ; 63 39748: cd bf out 0x3d, r28 ; 61 3974a: df 91 pop r29 3974c: cf 91 pop r28 3974e: 08 95 ret 00039750 : * * 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) { 39750: 80 91 e9 17 lds r24, 0x17E9 ; 0x8017e9 39754: 88 23 and r24, r24 39756: d1 f0 breq .+52 ; 0x3978c world2machine_reset(); 39758: 0f 94 6f cb call 0x396de ; 0x396de st_synchronize(); 3975c: 0f 94 24 59 call 0x2b248 ; 0x2b248 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 39760: 80 e0 ldi r24, 0x00 ; 0 39762: 0f 94 10 59 call 0x2b220 ; 0x2b220 39766: 60 93 41 07 sts 0x0741, r22 ; 0x800741 3976a: 70 93 42 07 sts 0x0742, r23 ; 0x800742 3976e: 80 93 43 07 sts 0x0743, r24 ; 0x800743 39772: 90 93 44 07 sts 0x0744, r25 ; 0x800744 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 39776: 81 e0 ldi r24, 0x01 ; 1 39778: 0f 94 10 59 call 0x2b220 ; 0x2b220 3977c: 60 93 45 07 sts 0x0745, r22 ; 0x800745 39780: 70 93 46 07 sts 0x0746, r23 ; 0x800746 39784: 80 93 47 07 sts 0x0747, r24 ; 0x800747 39788: 90 93 48 07 sts 0x0748, r25 ; 0x800748 } } 3978c: 08 95 ret 0003978e : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 3978e: 4f ef ldi r20, 0xFF ; 255 39790: 5f ef ldi r21, 0xFF ; 255 39792: ba 01 movw r22, r20 39794: 85 ee ldi r24, 0xE5 ; 229 39796: 9f e0 ldi r25, 0x0F ; 15 39798: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 3979c: 4f ef ldi r20, 0xFF ; 255 3979e: 5f ef ldi r21, 0xFF ; 255 397a0: ba 01 movw r22, r20 397a2: 89 ee ldi r24, 0xE9 ; 233 397a4: 9f e0 ldi r25, 0x0F ; 15 397a6: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 397aa: 4f ef ldi r20, 0xFF ; 255 397ac: 5f ef ldi r21, 0xFF ; 255 397ae: ba 01 movw r22, r20 397b0: 8d ed ldi r24, 0xDD ; 221 397b2: 9f e0 ldi r25, 0x0F ; 15 397b4: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 397b8: 4f ef ldi r20, 0xFF ; 255 397ba: 5f ef ldi r21, 0xFF ; 255 397bc: ba 01 movw r22, r20 397be: 81 ee ldi r24, 0xE1 ; 225 397c0: 9f e0 ldi r25, 0x0F ; 15 397c2: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 397c6: 4f ef ldi r20, 0xFF ; 255 397c8: 5f ef ldi r21, 0xFF ; 255 397ca: ba 01 movw r22, r20 397cc: 85 ed ldi r24, 0xD5 ; 213 397ce: 9f e0 ldi r25, 0x0F ; 15 397d0: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 397d4: 4f ef ldi r20, 0xFF ; 255 397d6: 5f ef ldi r21, 0xFF ; 255 397d8: ba 01 movw r22, r20 397da: 89 ed ldi r24, 0xD9 ; 217 397dc: 9f e0 ldi r25, 0x0F ; 15 397de: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 397e2: 4f ef ldi r20, 0xFF ; 255 397e4: 5f ef ldi r21, 0xFF ; 255 397e6: ba 01 movw r22, r20 397e8: 85 ec ldi r24, 0xC5 ; 197 397ea: 9f e0 ldi r25, 0x0F ; 15 397ec: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 397f0: 4f ef ldi r20, 0xFF ; 255 397f2: 5f ef ldi r21, 0xFF ; 255 397f4: ba 01 movw r22, r20 397f6: 89 ec ldi r24, 0xC9 ; 201 397f8: 9f e0 ldi r25, 0x0F ; 15 397fa: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 397fe: 4f ef ldi r20, 0xFF ; 255 39800: 5f ef ldi r21, 0xFF ; 255 39802: ba 01 movw r22, r20 39804: 8d ec ldi r24, 0xCD ; 205 39806: 9f e0 ldi r25, 0x0F ; 15 39808: 0f 94 bf dd call 0x3bb7e ; 0x3bb7e 3980c: 4f ef ldi r20, 0xFF ; 255 3980e: 5f ef ldi r21, 0xFF ; 255 39810: ba 01 movw r22, r20 39812: 81 ed ldi r24, 0xD1 ; 209 39814: 9f e0 ldi r25, 0x0F ; 15 39816: 0d 94 bf dd jmp 0x3bb7e ; 0x3bb7e 0003981a : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 3981a: 4f 92 push r4 3981c: 5f 92 push r5 3981e: 6f 92 push r6 39820: 7f 92 push r7 39822: 8f 92 push r8 39824: 9f 92 push r9 39826: af 92 push r10 39828: bf 92 push r11 3982a: cf 92 push r12 3982c: df 92 push r13 3982e: ef 92 push r14 39830: ff 92 push r15 39832: 1f 93 push r17 39834: cf 93 push r28 39836: df 93 push r29 39838: cd b7 in r28, 0x3d ; 61 3983a: de b7 in r29, 0x3e ; 62 3983c: a8 97 sbiw r28, 0x28 ; 40 3983e: 0f b6 in r0, 0x3f ; 63 39840: f8 94 cli 39842: de bf out 0x3e, r29 ; 62 39844: 0f be out 0x3f, r0 ; 63 39846: 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); 39848: 48 e0 ldi r20, 0x08 ; 8 3984a: 50 e0 ldi r21, 0x00 ; 0 3984c: 6d ed ldi r22, 0xDD ; 221 3984e: 7f e0 ldi r23, 0x0F ; 15 39850: ce 01 movw r24, r28 39852: 01 96 adiw r24, 0x01 ; 1 39854: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 39858: 48 e0 ldi r20, 0x08 ; 8 3985a: 50 e0 ldi r21, 0x00 ; 0 3985c: 65 ed ldi r22, 0xD5 ; 213 3985e: 7f e0 ldi r23, 0x0F ; 15 39860: ce 01 movw r24, r28 39862: 09 96 adiw r24, 0x09 ; 9 39864: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 39868: 48 e0 ldi r20, 0x08 ; 8 3986a: 50 e0 ldi r21, 0x00 ; 0 3986c: 65 ee ldi r22, 0xE5 ; 229 3986e: 7f e0 ldi r23, 0x0F ; 15 39870: ce 01 movw r24, r28 39872: 41 96 adiw r24, 0x11 ; 17 39874: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 39878: 89 89 ldd r24, Y+17 ; 0x11 3987a: 9a 89 ldd r25, Y+18 ; 0x12 3987c: ab 89 ldd r26, Y+19 ; 0x13 3987e: bc 89 ldd r27, Y+20 ; 0x14 39880: 89 a3 std Y+33, r24 ; 0x21 39882: 9a a3 std Y+34, r25 ; 0x22 39884: ab a3 std Y+35, r26 ; 0x23 39886: bc a3 std Y+36, r27 ; 0x24 39888: 8f 3f cpi r24, 0xFF ; 255 3988a: 9f 4f sbci r25, 0xFF ; 255 3988c: af 4f sbci r26, 0xFF ; 255 3988e: bf 4f sbci r27, 0xFF ; 255 39890: 09 f4 brne .+2 ; 0x39894 39892: b1 c0 rjmp .+354 ; 0x399f6 39894: 8d 89 ldd r24, Y+21 ; 0x15 39896: 9e 89 ldd r25, Y+22 ; 0x16 39898: af 89 ldd r26, Y+23 ; 0x17 3989a: b8 8d ldd r27, Y+24 ; 0x18 3989c: 8d a3 std Y+37, r24 ; 0x25 3989e: 9e a3 std Y+38, r25 ; 0x26 398a0: af a3 std Y+39, r26 ; 0x27 398a2: b8 a7 std Y+40, r27 ; 0x28 398a4: 8f 3f cpi r24, 0xFF ; 255 398a6: 9f 4f sbci r25, 0xFF ; 255 398a8: af 4f sbci r26, 0xFF ; 255 398aa: bf 4f sbci r27, 0xFF ; 255 398ac: 09 f4 brne .+2 ; 0x398b0 398ae: a3 c0 rjmp .+326 ; 0x399f6 398b0: 89 80 ldd r8, Y+1 ; 0x01 398b2: 9a 80 ldd r9, Y+2 ; 0x02 398b4: ab 80 ldd r10, Y+3 ; 0x03 398b6: bc 80 ldd r11, Y+4 ; 0x04 398b8: 8f ef ldi r24, 0xFF ; 255 398ba: 88 16 cp r8, r24 398bc: 98 06 cpc r9, r24 398be: a8 06 cpc r10, r24 398c0: b8 06 cpc r11, r24 398c2: 09 f4 brne .+2 ; 0x398c6 398c4: 98 c0 rjmp .+304 ; 0x399f6 398c6: 8d 81 ldd r24, Y+5 ; 0x05 398c8: 9e 81 ldd r25, Y+6 ; 0x06 398ca: af 81 ldd r26, Y+7 ; 0x07 398cc: b8 85 ldd r27, Y+8 ; 0x08 398ce: 89 8f std Y+25, r24 ; 0x19 398d0: 9a 8f std Y+26, r25 ; 0x1a 398d2: ab 8f std Y+27, r26 ; 0x1b 398d4: bc 8f std Y+28, r27 ; 0x1c 398d6: 8f 3f cpi r24, 0xFF ; 255 398d8: 9f 4f sbci r25, 0xFF ; 255 398da: af 4f sbci r26, 0xFF ; 255 398dc: bf 4f sbci r27, 0xFF ; 255 398de: 09 f4 brne .+2 ; 0x398e2 398e0: 8a c0 rjmp .+276 ; 0x399f6 398e2: c9 84 ldd r12, Y+9 ; 0x09 398e4: da 84 ldd r13, Y+10 ; 0x0a 398e6: eb 84 ldd r14, Y+11 ; 0x0b 398e8: fc 84 ldd r15, Y+12 ; 0x0c 398ea: 8f ef ldi r24, 0xFF ; 255 398ec: c8 16 cp r12, r24 398ee: d8 06 cpc r13, r24 398f0: e8 06 cpc r14, r24 398f2: f8 06 cpc r15, r24 398f4: 09 f4 brne .+2 ; 0x398f8 398f6: 7f c0 rjmp .+254 ; 0x399f6 398f8: 8d 85 ldd r24, Y+13 ; 0x0d 398fa: 9e 85 ldd r25, Y+14 ; 0x0e 398fc: af 85 ldd r26, Y+15 ; 0x0f 398fe: b8 89 ldd r27, Y+16 ; 0x10 39900: 8d 8f std Y+29, r24 ; 0x1d 39902: 9e 8f std Y+30, r25 ; 0x1e 39904: af 8f std Y+31, r26 ; 0x1f 39906: b8 a3 std Y+32, r27 ; 0x20 39908: 8f 3f cpi r24, 0xFF ; 255 3990a: 9f 4f sbci r25, 0xFF ; 255 3990c: af 4f sbci r26, 0xFF ; 255 3990e: bf 4f sbci r27, 0xFF ; 255 39910: 09 f4 brne .+2 ; 0x39914 39912: 71 c0 rjmp .+226 ; 0x399f6 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 39914: 29 8d ldd r18, Y+25 ; 0x19 39916: 3a 8d ldd r19, Y+26 ; 0x1a 39918: 4b 8d ldd r20, Y+27 ; 0x1b 3991a: 5c 8d ldd r21, Y+28 ; 0x1c 3991c: c5 01 movw r24, r10 3991e: b4 01 movw r22, r8 39920: 0f 94 4d e1 call 0x3c29a ; 0x3c29a 39924: 2b 01 movw r4, r22 39926: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39928: 26 e6 ldi r18, 0x66 ; 102 3992a: 36 e6 ldi r19, 0x66 ; 102 3992c: 46 e6 ldi r20, 0x66 ; 102 3992e: 5f e3 ldi r21, 0x3F ; 63 39930: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__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; 39934: 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) 39936: 87 fd sbrc r24, 7 39938: 0b c0 rjmp .+22 ; 0x39950 3993a: 2d ec ldi r18, 0xCD ; 205 3993c: 3c ec ldi r19, 0xCC ; 204 3993e: 4c e8 ldi r20, 0x8C ; 140 39940: 5f e3 ldi r21, 0x3F ; 63 39942: c3 01 movw r24, r6 39944: b2 01 movw r22, r4 39946: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 3994a: 18 16 cp r1, r24 3994c: 0c f0 brlt .+2 ; 0x39950 3994e: 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]); 39950: 2d 8d ldd r18, Y+29 ; 0x1d 39952: 3e 8d ldd r19, Y+30 ; 0x1e 39954: 4f 8d ldd r20, Y+31 ; 0x1f 39956: 58 a1 ldd r21, Y+32 ; 0x20 39958: c7 01 movw r24, r14 3995a: b6 01 movw r22, r12 3995c: 0f 94 4d e1 call 0x3c29a ; 0x3c29a 39960: 2b 01 movw r4, r22 39962: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39964: 26 e6 ldi r18, 0x66 ; 102 39966: 36 e6 ldi r19, 0x66 ; 102 39968: 46 e6 ldi r20, 0x66 ; 102 3996a: 5f e3 ldi r21, 0x3F ; 63 3996c: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 39970: 87 fd sbrc r24, 7 39972: 7f c0 rjmp .+254 ; 0x39a72 39974: 2d ec ldi r18, 0xCD ; 205 39976: 3c ec ldi r19, 0xCC ; 204 39978: 4c e8 ldi r20, 0x8C ; 140 3997a: 5f e3 ldi r21, 0x3F ; 63 3997c: c3 01 movw r24, r6 3997e: b2 01 movw r22, r4 39980: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 39984: 18 16 cp r1, r24 39986: 0c f4 brge .+2 ; 0x3998a 39988: 74 c0 rjmp .+232 ; 0x39a72 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]); 3998a: 2d a1 ldd r18, Y+37 ; 0x25 3998c: 3e a1 ldd r19, Y+38 ; 0x26 3998e: 4f a1 ldd r20, Y+39 ; 0x27 39990: 58 a5 ldd r21, Y+40 ; 0x28 39992: 69 a1 ldd r22, Y+33 ; 0x21 39994: 7a a1 ldd r23, Y+34 ; 0x22 39996: 8b a1 ldd r24, Y+35 ; 0x23 39998: 9c a1 ldd r25, Y+36 ; 0x24 3999a: 0f 94 4d e1 call 0x3c29a ; 0x3c29a if (l > 15.f) 3999e: 20 e0 ldi r18, 0x00 ; 0 399a0: 30 e0 ldi r19, 0x00 ; 0 399a2: 40 e7 ldi r20, 0x70 ; 112 399a4: 51 e4 ldi r21, 0x41 ; 65 399a6: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 399aa: 18 16 cp r1, r24 399ac: 0c f4 brge .+2 ; 0x399b0 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 399ae: 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]; 399b0: a5 01 movw r20, r10 399b2: 94 01 movw r18, r8 399b4: c7 01 movw r24, r14 399b6: b6 01 movw r22, r12 399b8: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 399bc: 6b 01 movw r12, r22 399be: 7c 01 movw r14, r24 399c0: 2d 8d ldd r18, Y+29 ; 0x1d 399c2: 3e 8d ldd r19, Y+30 ; 0x1e 399c4: 4f 8d ldd r20, Y+31 ; 0x1f 399c6: 58 a1 ldd r21, Y+32 ; 0x20 399c8: 69 8d ldd r22, Y+25 ; 0x19 399ca: 7a 8d ldd r23, Y+26 ; 0x1a 399cc: 8b 8d ldd r24, Y+27 ; 0x1b 399ce: 9c 8d ldd r25, Y+28 ; 0x1c 399d0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 399d4: 9b 01 movw r18, r22 399d6: ac 01 movw r20, r24 399d8: c7 01 movw r24, r14 399da: b6 01 movw r22, r12 399dc: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> if (fabs(l) > 0.1f) 399e0: 9f 77 andi r25, 0x7F ; 127 399e2: 2d ec ldi r18, 0xCD ; 205 399e4: 3c ec ldi r19, 0xCC ; 204 399e6: 4c ec ldi r20, 0xCC ; 204 399e8: 5d e3 ldi r21, 0x3D ; 61 399ea: 0f 94 3a e1 call 0x3c274 ; 0x3c274 <__gesf2> 399ee: 18 16 cp r1, r24 399f0: 14 f0 brlt .+4 ; 0x399f6 #endif reset = true; } } if (reset) 399f2: 11 23 and r17, r17 399f4: f1 f0 breq .+60 ; 0x39a32 { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 399f6: 0f 94 c7 cb call 0x3978e ; 0x3978e * @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; 399fa: 80 e0 ldi r24, 0x00 ; 0 399fc: 90 e0 ldi r25, 0x00 ; 0 399fe: a0 e8 ldi r26, 0x80 ; 128 39a00: bf e3 ldi r27, 0x3F ; 63 39a02: 89 83 std Y+1, r24 ; 0x01 39a04: 9a 83 std Y+2, r25 ; 0x02 39a06: ab 83 std Y+3, r26 ; 0x03 39a08: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 39a0a: 1d 82 std Y+5, r1 ; 0x05 39a0c: 1e 82 std Y+6, r1 ; 0x06 39a0e: 1f 82 std Y+7, r1 ; 0x07 39a10: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 39a12: 19 86 std Y+9, r1 ; 0x09 39a14: 1a 86 std Y+10, r1 ; 0x0a 39a16: 1b 86 std Y+11, r1 ; 0x0b 39a18: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 39a1a: 8d 87 std Y+13, r24 ; 0x0d 39a1c: 9e 87 std Y+14, r25 ; 0x0e 39a1e: af 87 std Y+15, r26 ; 0x0f 39a20: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 39a22: 19 8a std Y+17, r1 ; 0x11 39a24: 1a 8a std Y+18, r1 ; 0x12 39a26: 1b 8a std Y+19, r1 ; 0x13 39a28: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 39a2a: 1d 8a std Y+21, r1 ; 0x15 39a2c: 1e 8a std Y+22, r1 ; 0x16 39a2e: 1f 8a std Y+23, r1 ; 0x17 39a30: 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); 39a32: ae 01 movw r20, r28 39a34: 4f 5e subi r20, 0xEF ; 239 39a36: 5f 4f sbci r21, 0xFF ; 255 39a38: be 01 movw r22, r28 39a3a: 67 5f subi r22, 0xF7 ; 247 39a3c: 7f 4f sbci r23, 0xFF ; 255 39a3e: ce 01 movw r24, r28 39a40: 01 96 adiw r24, 0x01 ; 1 39a42: 0f 94 26 ca call 0x3944c ; 0x3944c MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 39a46: a8 96 adiw r28, 0x28 ; 40 39a48: 0f b6 in r0, 0x3f ; 63 39a4a: f8 94 cli 39a4c: de bf out 0x3e, r29 ; 62 39a4e: 0f be out 0x3f, r0 ; 63 39a50: cd bf out 0x3d, r28 ; 61 39a52: df 91 pop r29 39a54: cf 91 pop r28 39a56: 1f 91 pop r17 39a58: ff 90 pop r15 39a5a: ef 90 pop r14 39a5c: df 90 pop r13 39a5e: cf 90 pop r12 39a60: bf 90 pop r11 39a62: af 90 pop r10 39a64: 9f 90 pop r9 39a66: 8f 90 pop r8 39a68: 7f 90 pop r7 39a6a: 6f 90 pop r6 39a6c: 5f 90 pop r5 39a6e: 4f 90 pop r4 39a70: 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; 39a72: 11 e0 ldi r17, 0x01 ; 1 39a74: 8a cf rjmp .-236 ; 0x3998a 00039a76 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 39a76: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 39a78: 24 e1 ldi r18, 0x14 ; 20 39a7a: ac 01 movw r20, r24 39a7c: 24 9f mul r18, r20 39a7e: c0 01 movw r24, r0 39a80: 25 9f mul r18, r21 39a82: 90 0d add r25, r0 39a84: 11 24 eor r1, r1 39a86: 60 91 b4 17 lds r22, 0x17B4 ; 0x8017b4 39a8a: 70 91 b5 17 lds r23, 0x17B5 ; 0x8017b5 39a8e: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 39a92: c6 2f mov r28, r22 39a94: 65 31 cpi r22, 0x15 ; 21 39a96: 08 f0 brcs .+2 ; 0x39a9a 39a98: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 39a9a: 80 91 b3 17 lds r24, 0x17B3 ; 0x8017b3 39a9e: 8c 17 cp r24, r28 39aa0: 48 f4 brcc .+18 ; 0x39ab4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 39aa2: 8f ef ldi r24, 0xFF ; 255 39aa4: 0e 94 3c 70 call 0xe078 ; 0xe078 { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 39aa8: 80 91 b3 17 lds r24, 0x17B3 ; 0x8017b3 39aac: 8f 5f subi r24, 0xFF ; 255 39aae: 80 93 b3 17 sts 0x17B3, r24 ; 0x8017b3 39ab2: f3 cf rjmp .-26 ; 0x39a9a } } 39ab4: cf 91 pop r28 39ab6: 08 95 ret 00039ab8 : void menu_progressbar_finish(void) { progressbar_total = 1; 39ab8: 81 e0 ldi r24, 0x01 ; 1 39aba: 90 e0 ldi r25, 0x00 ; 0 39abc: 90 93 b5 17 sts 0x17B5, r25 ; 0x8017b5 39ac0: 80 93 b4 17 sts 0x17B4, r24 ; 0x8017b4 menu_progressbar_update(1); 39ac4: 0f 94 3b cd call 0x39a76 ; 0x39a76 _delay(300); 39ac8: 6c e2 ldi r22, 0x2C ; 44 39aca: 71 e0 ldi r23, 0x01 ; 1 39acc: 80 e0 ldi r24, 0x00 ; 0 39ace: 90 e0 ldi r25, 0x00 ; 0 39ad0: 0d 94 8a 3d jmp 0x27b14 ; 0x27b14 00039ad4 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 39ad4: 0f 93 push r16 39ad6: 1f 93 push r17 39ad8: cf 93 push r28 39ada: df 93 push r29 39adc: 8c 01 movw r16, r24 39ade: eb 01 movw r28, r22 lcd_clear(); 39ae0: 0e 94 c0 6f call 0xdf80 ; 0xdf80 progressbar_block_count = 0; 39ae4: 10 92 b3 17 sts 0x17B3, r1 ; 0x8017b3 progressbar_total = total; 39ae8: 10 93 b5 17 sts 0x17B5, r17 ; 0x8017b5 39aec: 00 93 b4 17 sts 0x17B4, r16 ; 0x8017b4 lcd_set_cursor(0, 1); 39af0: 61 e0 ldi r22, 0x01 ; 1 39af2: 80 e0 ldi r24, 0x00 ; 0 39af4: 0e 94 8d 6f call 0xdf1a ; 0xdf1a lcd_print_pad_P(title, LCD_WIDTH); 39af8: 64 e1 ldi r22, 0x14 ; 20 39afa: ce 01 movw r24, r28 39afc: 0e 94 62 71 call 0xe2c4 ; 0xe2c4 lcd_set_cursor(0, 2); 39b00: 62 e0 ldi r22, 0x02 ; 2 39b02: 80 e0 ldi r24, 0x00 ; 0 } 39b04: df 91 pop r29 39b06: cf 91 pop r28 39b08: 1f 91 pop r17 39b0a: 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); 39b0c: 0c 94 8d 6f jmp 0xdf1a ; 0xdf1a 00039b10 : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 39b10: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39b14: 90 91 15 05 lds r25, 0x0515 ; 0x800515 39b18: 89 13 cpse r24, r25 39b1a: 0b c0 rjmp .+22 ; 0x39b32 39b1c: 90 91 14 05 lds r25, 0x0514 ; 0x800514 39b20: 99 23 and r25, r25 39b22: 39 f0 breq .+14 ; 0x39b32 39b24: 20 91 35 05 lds r18, 0x0535 ; 0x800535 39b28: 30 91 36 05 lds r19, 0x0536 ; 0x800536 39b2c: 82 17 cp r24, r18 39b2e: 13 06 cpc r1, r19 39b30: 39 f0 breq .+14 ; 0x39b40 39b32: 81 e0 ldi r24, 0x01 ; 1 39b34: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 39b38: 91 11 cpse r25, r1 39b3a: 03 c0 rjmp .+6 ; 0x39b42 39b3c: 80 e0 ldi r24, 0x00 ; 0 39b3e: 08 95 ret 39b40: 81 e0 ldi r24, 0x01 ; 1 } 39b42: 08 95 ret 00039b44 : //! @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) { 39b44: 0f 93 push r16 39b46: 1f 93 push r17 39b48: cf 93 push r28 39b4a: df 93 push r29 39b4c: 8c 01 movw r16, r24 39b4e: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 39b50: 8b e9 ldi r24, 0x9B ; 155 39b52: 93 e4 ldi r25, 0x43 ; 67 39b54: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 39b58: 9f 93 push r25 39b5a: 8f 93 push r24 39b5c: 88 ef ldi r24, 0xF8 ; 248 39b5e: 99 ea ldi r25, 0xA9 ; 169 39b60: 9f 93 push r25 39b62: 8f 93 push r24 39b64: df 93 push r29 39b66: cf 93 push r28 39b68: 0f 94 a0 dc call 0x3b940 ; 0x3b940 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 39b6c: c8 0f add r28, r24 39b6e: d1 1d adc r29, r1 39b70: 47 e0 ldi r20, 0x07 ; 7 39b72: 50 e0 ldi r21, 0x00 ; 0 39b74: b8 01 movw r22, r16 39b76: ce 01 movw r24, r28 39b78: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 //index += 7; buffer.c[index + 7] = '\0'; 39b7c: 1f 82 std Y+7, r1 ; 0x07 39b7e: 0f 90 pop r0 39b80: 0f 90 pop r0 39b82: 0f 90 pop r0 39b84: 0f 90 pop r0 39b86: 0f 90 pop r0 39b88: 0f 90 pop r0 } 39b8a: df 91 pop r29 39b8c: cf 91 pop r28 39b8e: 1f 91 pop r17 39b90: 0f 91 pop r16 39b92: 08 95 ret 00039b94 : 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)?'>':' '; 39b94: 20 91 16 05 lds r18, 0x0516 ; 0x800516 39b98: 80 91 35 05 lds r24, 0x0535 ; 0x800535 39b9c: 90 91 36 05 lds r25, 0x0536 ; 0x800536 39ba0: 28 17 cp r18, r24 39ba2: 19 06 cpc r1, r25 39ba4: 11 f0 breq .+4 ; 0x39baa 39ba6: 80 e2 ldi r24, 0x20 ; 32 39ba8: 08 95 ret 39baa: 8e e3 ldi r24, 0x3E ; 62 } 39bac: 08 95 ret 00039bae : static void menu_draw_item_puts_P(char type_char, const char* str) { 39bae: 0f 93 push r16 39bb0: 1f 93 push r17 39bb2: cf 93 push r28 39bb4: c8 2f mov r28, r24 39bb6: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 39bb8: 0f 94 ca cd call 0x39b94 ; 0x39b94 39bbc: 48 2f mov r20, r24 39bbe: 60 91 13 05 lds r22, 0x0513 ; 0x800513 39bc2: 80 e0 ldi r24, 0x00 ; 0 39bc4: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_print_pad_P(str, LCD_WIDTH - 2); 39bc8: 62 e1 ldi r22, 0x12 ; 18 39bca: c8 01 movw r24, r16 39bcc: 0e 94 62 71 call 0xe2c4 ; 0xe2c4 lcd_putc(type_char); 39bd0: 8c 2f mov r24, r28 } 39bd2: cf 91 pop r28 39bd4: 1f 91 pop r17 39bd6: 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); 39bd8: 0c 94 7c 6f jmp 0xdef8 ; 0xdef8 00039bdc : } } void menu_item_ret(void) { lcd_draw_update = 2; 39bdc: 82 e0 ldi r24, 0x02 ; 2 39bde: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 39be2: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39be6: 8f 5f subi r24, 0xFF ; 255 39be8: 80 93 16 05 sts 0x0516, r24 ; 0x800516 //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 39bec: 84 e0 ldi r24, 0x04 ; 4 39bee: 80 93 13 05 sts 0x0513, r24 ; 0x800513 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 39bf2: 10 92 15 05 sts 0x0515, r1 ; 0x800515 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 39bf6: 10 92 14 05 sts 0x0514, r1 ; 0x800514 } 39bfa: 08 95 ret 00039bfc : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 39bfc: cf 93 push r28 39bfe: df 93 push r29 if (menu_item == menu_line) 39c00: 30 91 16 05 lds r19, 0x0516 ; 0x800516 39c04: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39c08: 32 13 cpse r19, r18 39c0a: 20 c0 rjmp .+64 ; 0x39c4c 39c0c: eb 01 movw r28, r22 39c0e: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39c10: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39c14: 88 23 and r24, r24 39c16: 19 f0 breq .+6 ; 0x39c1e 39c18: 80 e2 ldi r24, 0x20 ; 32 39c1a: 0f 94 d7 cd call 0x39bae ; 0x39bae if (menu_clicked && (lcd_encoder == menu_item)) 39c1e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 39c22: 88 23 and r24, r24 39c24: 99 f0 breq .+38 ; 0x39c4c 39c26: 20 91 16 05 lds r18, 0x0516 ; 0x800516 39c2a: 80 91 35 05 lds r24, 0x0535 ; 0x800535 39c2e: 90 91 36 05 lds r25, 0x0536 ; 0x800536 39c32: 28 17 cp r18, r24 39c34: 19 06 cpc r1, r25 39c36: 51 f4 brne .+20 ; 0x39c4c { if (str_gcode) enquecommand_P(str_gcode); 39c38: 20 97 sbiw r28, 0x00 ; 0 39c3a: 21 f0 breq .+8 ; 0x39c44 39c3c: 61 e0 ldi r22, 0x01 ; 1 39c3e: ce 01 movw r24, r28 39c40: 0e 94 43 89 call 0x11286 ; 0x11286 menu_item_ret(); return; } } menu_item++; } 39c44: df 91 pop r29 39c46: 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(); 39c48: 0d 94 ee cd jmp 0x39bdc ; 0x39bdc return; } } menu_item++; 39c4c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39c50: 8f 5f subi r24, 0xFF ; 255 39c52: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 39c56: df 91 pop r29 39c58: cf 91 pop r28 39c5a: 08 95 ret 00039c5c : //! @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) { 39c5c: ef 92 push r14 39c5e: ff 92 push r15 39c60: 0f 93 push r16 39c62: 1f 93 push r17 39c64: cf 93 push r28 39c66: df 93 push r29 if (menu_item == menu_line) 39c68: 70 91 16 05 lds r23, 0x0516 ; 0x800516 39c6c: 30 91 15 05 lds r19, 0x0515 ; 0x800515 39c70: 73 13 cpse r23, r19 39c72: 3f c0 rjmp .+126 ; 0x39cf2 39c74: 12 2f mov r17, r18 39c76: ea 01 movw r28, r20 39c78: 06 2f mov r16, r22 39c7a: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 39c7c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39c80: 88 23 and r24, r24 39c82: d1 f0 breq .+52 ; 0x39cb8 } 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()); 39c84: 0f 94 ca cd call 0x39b94 ; 0x39b94 39c88: 48 2f mov r20, r24 39c8a: 60 91 13 05 lds r22, 0x0513 ; 0x800513 39c8e: 80 e0 ldi r24, 0x00 ; 0 39c90: 0e 94 ad 6f call 0xdf5a ; 0xdf5a uint8_t len = lcd_print_pad_P(str, max_strlen); 39c94: 61 e1 ldi r22, 0x11 ; 17 39c96: c7 01 movw r24, r14 39c98: 0e 94 62 71 call 0xe2c4 ; 0xe2c4 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 39c9c: 40 2f mov r20, r16 39c9e: 60 91 13 05 lds r22, 0x0513 ; 0x800513 39ca2: 93 e1 ldi r25, 0x13 ; 19 39ca4: 98 1b sub r25, r24 39ca6: 89 2f mov r24, r25 39ca8: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 39cac: 40 e2 ldi r20, 0x20 ; 32 39cae: 60 91 13 05 lds r22, 0x0513 ; 0x800513 39cb2: 83 e1 ldi r24, 0x13 ; 19 39cb4: 0e 94 ad 6f call 0xdf5a ; 0xdf5a 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)) 39cb8: 80 91 14 05 lds r24, 0x0514 ; 0x800514 39cbc: 88 23 and r24, r24 39cbe: c9 f0 breq .+50 ; 0x39cf2 39cc0: 20 91 16 05 lds r18, 0x0516 ; 0x800516 39cc4: 80 91 35 05 lds r24, 0x0535 ; 0x800535 39cc8: 90 91 36 05 lds r25, 0x0536 ; 0x800536 39ccc: 28 17 cp r18, r24 39cce: 19 06 cpc r1, r25 39cd0: 81 f4 brne .+32 ; 0x39cf2 { lcd_update_enabled = 0; 39cd2: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 39cd6: 81 2f mov r24, r17 39cd8: fe 01 movw r30, r28 39cda: 19 95 eicall lcd_update_enabled = 1; 39cdc: 81 e0 ldi r24, 0x01 ; 1 39cde: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39ce2: df 91 pop r29 39ce4: cf 91 pop r28 39ce6: 1f 91 pop r17 39ce8: 0f 91 pop r16 39cea: ff 90 pop r15 39cec: 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(); 39cee: 0d 94 ee cd jmp 0x39bdc ; 0x39bdc return; } } menu_item++; 39cf2: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39cf6: 8f 5f subi r24, 0xFF ; 255 39cf8: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 39cfc: df 91 pop r29 39cfe: cf 91 pop r28 39d00: 1f 91 pop r17 39d02: 0f 91 pop r16 39d04: ff 90 pop r15 39d06: ef 90 pop r14 39d08: 08 95 ret 00039d0a : 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) { 39d0a: cf 93 push r28 39d0c: df 93 push r29 if (menu_item == menu_line) 39d0e: 30 91 16 05 lds r19, 0x0516 ; 0x800516 39d12: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39d16: 32 13 cpse r19, r18 39d18: 21 c0 rjmp .+66 ; 0x39d5c 39d1a: eb 01 movw r28, r22 39d1c: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39d1e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39d22: 88 23 and r24, r24 39d24: 19 f0 breq .+6 ; 0x39d2c 39d26: 80 e2 ldi r24, 0x20 ; 32 39d28: 0f 94 d7 cd call 0x39bae ; 0x39bae if (menu_clicked && (lcd_encoder == menu_item)) 39d2c: 80 91 14 05 lds r24, 0x0514 ; 0x800514 39d30: 88 23 and r24, r24 39d32: a1 f0 breq .+40 ; 0x39d5c 39d34: 20 91 16 05 lds r18, 0x0516 ; 0x800516 39d38: 80 91 35 05 lds r24, 0x0535 ; 0x800535 39d3c: 90 91 36 05 lds r25, 0x0536 ; 0x800536 39d40: 28 17 cp r18, r24 39d42: 19 06 cpc r1, r25 39d44: 59 f4 brne .+22 ; 0x39d5c { lcd_update_enabled = 0; 39d46: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 39d4a: fe 01 movw r30, r28 39d4c: 19 95 eicall lcd_update_enabled = 1; 39d4e: 81 e0 ldi r24, 0x01 ; 1 39d50: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39d54: df 91 pop r29 39d56: 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(); 39d58: 0d 94 ee cd jmp 0x39bdc ; 0x39bdc return; } } menu_item++; 39d5c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39d60: 8f 5f subi r24, 0xFF ; 255 39d62: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 39d66: df 91 pop r29 39d68: cf 91 pop r28 39d6a: 08 95 ret 00039d6c : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 39d6c: 30 91 16 05 lds r19, 0x0516 ; 0x800516 39d70: 20 91 15 05 lds r18, 0x0515 ; 0x800515 39d74: 32 13 cpse r19, r18 39d76: 19 c0 rjmp .+50 ; 0x39daa 39d78: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39d7a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39d7e: 88 23 and r24, r24 39d80: 19 f0 breq .+6 ; 0x39d88 39d82: 80 e2 ldi r24, 0x20 ; 32 39d84: 0f 94 d7 cd call 0x39bae ; 0x39bae if (menu_clicked && (lcd_encoder == menu_item)) 39d88: 80 91 14 05 lds r24, 0x0514 ; 0x800514 39d8c: 88 23 and r24, r24 39d8e: 69 f0 breq .+26 ; 0x39daa 39d90: 20 91 16 05 lds r18, 0x0516 ; 0x800516 39d94: 80 91 35 05 lds r24, 0x0535 ; 0x800535 39d98: 90 91 36 05 lds r25, 0x0536 ; 0x800536 39d9c: 28 17 cp r18, r24 39d9e: 19 06 cpc r1, r25 39da0: 21 f4 brne .+8 ; 0x39daa { menu_item_ret(); 39da2: 0f 94 ee cd call 0x39bdc ; 0x39bdc return 1; 39da6: 81 e0 ldi r24, 0x01 ; 1 39da8: 08 95 ret } } menu_item++; 39daa: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39dae: 8f 5f subi r24, 0xFF ; 255 39db0: 80 93 16 05 sts 0x0516, r24 ; 0x800516 return 0; 39db4: 80 e0 ldi r24, 0x00 ; 0 } 39db6: 08 95 ret 00039db8 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 39db8: 80 91 13 05 lds r24, 0x0513 ; 0x800513 39dbc: 84 30 cpi r24, 0x04 ; 4 39dbe: 38 f5 brcc .+78 ; 0x39e0e { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 39dc0: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39dc4: 90 e0 ldi r25, 0x00 ; 0 39dc6: 20 91 35 05 lds r18, 0x0535 ; 0x800535 39dca: 30 91 36 05 lds r19, 0x0536 ; 0x800536 39dce: 28 17 cp r18, r24 39dd0: 39 07 cpc r19, r25 39dd2: 44 f0 brlt .+16 ; 0x39de4 { lcd_encoder = menu_item - 1; 39dd4: 01 97 sbiw r24, 0x01 ; 1 39dd6: 90 93 36 05 sts 0x0536, r25 ; 0x800536 39dda: 80 93 35 05 sts 0x0535, r24 ; 0x800535 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39dde: 87 e0 ldi r24, 0x07 ; 7 39de0: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 39de4: 80 91 35 05 lds r24, 0x0535 ; 0x800535 39de8: 20 91 a3 03 lds r18, 0x03A3 ; 0x8003a3 39dec: 30 e0 ldi r19, 0x00 ; 0 39dee: 2d 5f subi r18, 0xFD ; 253 39df0: 3f 4f sbci r19, 0xFF ; 255 39df2: 82 17 cp r24, r18 39df4: 13 06 cpc r1, r19 39df6: 59 f0 breq .+22 ; 0x39e0e 39df8: 54 f0 brlt .+20 ; 0x39e0e { menu_top = lcd_encoder - LCD_HEIGHT + 1; 39dfa: 9d ef ldi r25, 0xFD ; 253 39dfc: 98 0f add r25, r24 39dfe: 90 93 a3 03 sts 0x03A3, r25 ; 0x8003a3 menu_line = menu_top - 1; 39e02: 84 50 subi r24, 0x04 ; 4 39e04: 80 93 15 05 sts 0x0515, r24 ; 0x800515 menu_row = -1; 39e08: 8f ef ldi r24, 0xFF ; 255 39e0a: 80 93 13 05 sts 0x0513, r24 ; 0x800513 } } 39e0e: 08 95 ret 00039e10 : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 39e10: 80 91 35 05 lds r24, 0x0535 ; 0x800535 39e14: 90 91 36 05 lds r25, 0x0536 ; 0x800536 39e18: 97 ff sbrs r25, 7 39e1a: 07 c0 rjmp .+14 ; 0x39e2a { lcd_encoder = 0; 39e1c: 10 92 36 05 sts 0x0536, r1 ; 0x800536 39e20: 10 92 35 05 sts 0x0535, r1 ; 0x800535 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39e24: 87 e0 ldi r24, 0x07 ; 7 39e26: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee } if (lcd_encoder < menu_top) 39e2a: 80 91 35 05 lds r24, 0x0535 ; 0x800535 39e2e: 90 91 36 05 lds r25, 0x0536 ; 0x800536 39e32: 20 91 a3 03 lds r18, 0x03A3 ; 0x8003a3 39e36: 28 17 cp r18, r24 39e38: 19 06 cpc r1, r25 39e3a: 19 f0 breq .+6 ; 0x39e42 39e3c: 14 f0 brlt .+4 ; 0x39e42 menu_top = lcd_encoder; 39e3e: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 menu_line = menu_top; 39e42: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 39e46: 80 93 15 05 sts 0x0515, r24 ; 0x800515 menu_clicked = lcd_clicked(); // Consume click event 39e4a: 0e 94 aa 71 call 0xe354 ; 0xe354 39e4e: 80 93 14 05 sts 0x0514, r24 ; 0x800514 } 39e52: 08 95 ret 00039e54 : 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)); 39e54: e7 ea ldi r30, 0xA7 ; 167 39e56: f3 e0 ldi r31, 0x03 ; 3 39e58: 80 e2 ldi r24, 0x20 ; 32 39e5a: df 01 movw r26, r30 39e5c: 1d 92 st X+, r1 39e5e: 8a 95 dec r24 39e60: e9 f7 brne .-6 ; 0x39e5c } 39e62: 08 95 ret 00039e64 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 39e64: cf 93 push r28 CRITICAL_SECTION_START; 39e66: 3f b7 in r19, 0x3f ; 63 39e68: f8 94 cli if (menu_menu != menu) 39e6a: e0 91 67 0e lds r30, 0x0E67 ; 0x800e67 39e6e: f0 91 68 0e lds r31, 0x0E68 ; 0x800e68 39e72: e8 17 cp r30, r24 39e74: f9 07 cpc r31, r25 39e76: c9 f0 breq .+50 ; 0x39eaa 39e78: c4 2f mov r28, r20 { menu_menu = menu; 39e7a: 90 93 68 0e sts 0x0E68, r25 ; 0x800e68 39e7e: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 lcd_encoder = encoder; 39e82: 70 93 36 05 sts 0x0536, r23 ; 0x800536 39e86: 60 93 35 05 sts 0x0535, r22 ; 0x800535 menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 39e8a: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 lcd_draw_update = 2; // Full LCD re-draw 39e8e: 82 e0 ldi r24, 0x02 ; 2 39e90: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 39e94: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 39e96: 22 23 and r18, r18 39e98: 19 f0 breq .+6 ; 0x39ea0 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 39e9a: 80 e0 ldi r24, 0x00 ; 0 39e9c: 0f 94 77 64 call 0x2c8ee ; 0x2c8ee if (reset_menu_state) menu_data_reset(); 39ea0: cc 23 and r28, r28 39ea2: 21 f0 breq .+8 ; 0x39eac } else CRITICAL_SECTION_END; } 39ea4: 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(); 39ea6: 0d 94 2a cf jmp 0x39e54 ; 0x39e54 } else CRITICAL_SECTION_END; 39eaa: 3f bf out 0x3f, r19 ; 63 } 39eac: cf 91 pop r28 39eae: 08 95 ret 00039eb0 : 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) { 39eb0: 7f 92 push r7 39eb2: 8f 92 push r8 39eb4: 9f 92 push r9 39eb6: af 92 push r10 39eb8: bf 92 push r11 39eba: cf 92 push r12 39ebc: df 92 push r13 39ebe: ef 92 push r14 39ec0: ff 92 push r15 39ec2: 0f 93 push r16 39ec4: 1f 93 push r17 39ec6: cf 93 push r28 39ec8: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 39eca: e0 91 16 05 lds r30, 0x0516 ; 0x800516 39ece: 50 91 15 05 lds r21, 0x0515 ; 0x800515 39ed2: e5 13 cpse r30, r21 39ed4: 73 c0 rjmp .+230 ; 0x39fbc { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 39ed6: fb 01 movw r30, r22 39ed8: 48 30 cpi r20, 0x08 ; 8 39eda: 09 f0 breq .+2 ; 0x39ede 39edc: 6c c0 rjmp .+216 ; 0x39fb6 39ede: c0 81 ld r28, Z 39ee0: d0 e0 ldi r29, 0x00 ; 0 39ee2: 49 01 movw r8, r18 39ee4: 74 2e mov r7, r20 39ee6: 6b 01 movw r12, r22 39ee8: 5c 01 movw r10, r24 if (lcd_draw_update) 39eea: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39eee: 88 23 and r24, r24 39ef0: 59 f0 breq .+22 ; 0x39f08 { lcd_set_cursor(0, menu_row); 39ef2: 60 91 13 05 lds r22, 0x0513 ; 0x800513 39ef6: 80 e0 ldi r24, 0x00 ; 0 39ef8: 0e 94 8d 6f call 0xdf1a ; 0xdf1a menu_draw_P(menu_selection_mark(), str, cur_val); 39efc: 0f 94 ca cd call 0x39b94 ; 0x39b94 39f00: ae 01 movw r20, r28 39f02: b5 01 movw r22, r10 39f04: 0f 94 f4 a3 call 0x347e8 ; 0x347e8 } if (menu_clicked && (lcd_encoder == menu_item)) 39f08: 80 91 14 05 lds r24, 0x0514 ; 0x800514 39f0c: 88 23 and r24, r24 39f0e: 09 f4 brne .+2 ; 0x39f12 39f10: 55 c0 rjmp .+170 ; 0x39fbc 39f12: 90 91 16 05 lds r25, 0x0516 ; 0x800516 39f16: 20 91 35 05 lds r18, 0x0535 ; 0x800535 39f1a: 30 91 36 05 lds r19, 0x0536 ; 0x800536 39f1e: 92 17 cp r25, r18 39f20: 13 06 cpc r1, r19 39f22: 09 f0 breq .+2 ; 0x39f26 39f24: 4b c0 rjmp .+150 ; 0x39fbc } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 39f26: 80 91 f2 03 lds r24, 0x03F2 ; 0x8003f2 39f2a: 87 30 cpi r24, 0x07 ; 7 39f2c: d8 f4 brcc .+54 ; 0x39f64 { menu_stack[menu_depth].menu = menu_menu; 39f2e: 28 2f mov r18, r24 39f30: 30 e0 ldi r19, 0x00 ; 0 39f32: f9 01 movw r30, r18 39f34: ee 0f add r30, r30 39f36: ff 1f adc r31, r31 39f38: e2 0f add r30, r18 39f3a: f3 1f adc r31, r19 39f3c: e2 56 subi r30, 0x62 ; 98 39f3e: f8 4e sbci r31, 0xE8 ; 232 39f40: 20 91 67 0e lds r18, 0x0E67 ; 0x800e67 39f44: 30 91 68 0e lds r19, 0x0E68 ; 0x800e68 39f48: 31 83 std Z+1, r19 ; 0x01 39f4a: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 39f4c: 8f 5f subi r24, 0xFF ; 255 39f4e: 80 93 f2 03 sts 0x03F2, r24 ; 0x8003f2 39f52: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 39f54: 20 e0 ldi r18, 0x00 ; 0 39f56: 40 e0 ldi r20, 0x00 ; 0 39f58: 70 e0 ldi r23, 0x00 ; 0 39f5a: 60 e0 ldi r22, 0x00 ; 0 39f5c: 8b e8 ldi r24, 0x8B ; 139 39f5e: 99 e3 ldi r25, 0x39 ; 57 39f60: 0f 94 32 cf call 0x39e64 ; 0x39e64 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; 39f64: b0 92 a8 03 sts 0x03A8, r11 ; 0x8003a8 39f68: a0 92 a7 03 sts 0x03A7, r10 ; 0x8003a7 _md->editValuePtr = pval; 39f6c: d0 92 ab 03 sts 0x03AB, r13 ; 0x8003ab 39f70: c0 92 aa 03 sts 0x03AA, r12 ; 0x8003aa _md->editValueBits = pbits; 39f74: 70 92 a9 03 sts 0x03A9, r7 ; 0x8003a9 _md->currentValue = cur_val; 39f78: d0 93 ad 03 sts 0x03AD, r29 ; 0x8003ad 39f7c: c0 93 ac 03 sts 0x03AC, r28 ; 0x8003ac _md->minEditValue = min_val; 39f80: 90 92 af 03 sts 0x03AF, r9 ; 0x8003af 39f84: 80 92 ae 03 sts 0x03AE, r8 ; 0x8003ae _md->maxEditValue = max_val; 39f88: 10 93 b1 03 sts 0x03B1, r17 ; 0x8003b1 39f8c: 00 93 b0 03 sts 0x03B0, r16 ; 0x8003b0 _md->minJumpValue = jmp_val; 39f90: f0 92 b3 03 sts 0x03B3, r15 ; 0x8003b3 39f94: e0 92 b2 03 sts 0x03B2, r14 ; 0x8003b2 menu_item_ret(); return; } } menu_item++; } 39f98: df 91 pop r29 39f9a: cf 91 pop r28 39f9c: 1f 91 pop r17 39f9e: 0f 91 pop r16 39fa0: ff 90 pop r15 39fa2: ef 90 pop r14 39fa4: df 90 pop r13 39fa6: cf 90 pop r12 39fa8: bf 90 pop r11 39faa: af 90 pop r10 39fac: 9f 90 pop r9 39fae: 8f 90 pop r8 39fb0: 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(); 39fb2: 0d 94 ee cd jmp 0x39bdc ; 0x39bdc 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)); 39fb6: c0 81 ld r28, Z 39fb8: d1 81 ldd r29, Z+1 ; 0x01 39fba: 93 cf rjmp .-218 ; 0x39ee2 _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 39fbc: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39fc0: 8f 5f subi r24, 0xFF ; 255 39fc2: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 39fc6: df 91 pop r29 39fc8: cf 91 pop r28 39fca: 1f 91 pop r17 39fcc: 0f 91 pop r16 39fce: ff 90 pop r15 39fd0: ef 90 pop r14 39fd2: df 90 pop r13 39fd4: cf 90 pop r12 39fd6: bf 90 pop r11 39fd8: af 90 pop r10 39fda: 9f 90 pop r9 39fdc: 8f 90 pop r8 39fde: 7f 90 pop r7 39fe0: 08 95 ret 00039fe2 <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 39fe2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39fe6: 88 23 and r24, r24 39fe8: 09 f4 brne .+2 ; 0x39fec <_menu_edit_P()+0xa> 39fea: 52 c0 rjmp .+164 ; 0x3a090 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 39fec: 20 91 b2 03 lds r18, 0x03B2 ; 0x8003b2 39ff0: 30 91 b3 03 lds r19, 0x03B3 ; 0x8003b3 39ff4: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 39ff8: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 39ffc: 21 15 cp r18, r1 39ffe: 31 05 cpc r19, r1 3a000: d9 f0 breq .+54 ; 0x3a038 <_menu_edit_P()+0x56> 3a002: 40 91 35 05 lds r20, 0x0535 ; 0x800535 3a006: 50 91 36 05 lds r21, 0x0536 ; 0x800536 3a00a: 41 15 cp r20, r1 3a00c: 51 05 cpc r21, r1 3a00e: a1 f0 breq .+40 ; 0x3a038 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 3a010: 7c f0 brlt .+30 ; 0x3a030 <_menu_edit_P()+0x4e> 3a012: 40 91 ac 03 lds r20, 0x03AC ; 0x8003ac 3a016: 50 91 ad 03 lds r21, 0x03AD ; 0x8003ad 3a01a: 48 17 cp r20, r24 3a01c: 59 07 cpc r21, r25 3a01e: 41 f4 brne .+16 ; 0x3a030 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 3a020: 30 93 ad 03 sts 0x03AD, r19 ; 0x8003ad 3a024: 20 93 ac 03 sts 0x03AC, r18 ; 0x8003ac lcd_encoder = 0; 3a028: 10 92 36 05 sts 0x0536, r1 ; 0x800536 3a02c: 10 92 35 05 sts 0x0535, r1 ; 0x800535 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 3a030: 10 92 b3 03 sts 0x03B3, r1 ; 0x8003b3 3a034: 10 92 b2 03 sts 0x03B2, r1 ; 0x8003b2 } _md->currentValue += lcd_encoder; 3a038: 20 91 ac 03 lds r18, 0x03AC ; 0x8003ac 3a03c: 30 91 ad 03 lds r19, 0x03AD ; 0x8003ad 3a040: 40 91 35 05 lds r20, 0x0535 ; 0x800535 3a044: 50 91 36 05 lds r21, 0x0536 ; 0x800536 3a048: 24 0f add r18, r20 3a04a: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 3a04c: 10 92 36 05 sts 0x0536, r1 ; 0x800536 3a050: 10 92 35 05 sts 0x0535, r1 ; 0x800535 // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 3a054: 28 17 cp r18, r24 3a056: 39 07 cpc r19, r25 3a058: 44 f0 brlt .+16 ; 0x3a06a <_menu_edit_P()+0x88> 3a05a: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 3a05e: 90 91 b1 03 lds r25, 0x03B1 ; 0x8003b1 3a062: 28 17 cp r18, r24 3a064: 39 07 cpc r19, r25 3a066: 0c f4 brge .+2 ; 0x3a06a <_menu_edit_P()+0x88> 3a068: c9 01 movw r24, r18 3a06a: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 3a06e: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac lcd_set_cursor(0, 1); 3a072: 61 e0 ldi r22, 0x01 ; 1 3a074: 80 e0 ldi r24, 0x00 ; 0 3a076: 0e 94 8d 6f call 0xdf1a ; 0xdf1a menu_draw_P(' ', _md->editLabel, _md->currentValue); 3a07a: 40 91 ac 03 lds r20, 0x03AC ; 0x8003ac 3a07e: 50 91 ad 03 lds r21, 0x03AD ; 0x8003ad 3a082: 60 91 a7 03 lds r22, 0x03A7 ; 0x8003a7 3a086: 70 91 a8 03 lds r23, 0x03A8 ; 0x8003a8 3a08a: 80 e2 ldi r24, 0x20 ; 32 3a08c: 0f 94 f4 a3 call 0x347e8 ; 0x347e8 } if (lcd_clicked()) 3a090: 0e 94 aa 71 call 0xe354 ; 0xe354 3a094: 88 23 and r24, r24 3a096: 41 f1 breq .+80 ; 0x3a0e8 <_menu_edit_P()+0x106> 3a098: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 3a09c: f0 91 ab 03 lds r31, 0x03AB ; 0x8003ab 3a0a0: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 3a0a4: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad { if (_md->editValueBits == 8) 3a0a8: 20 91 a9 03 lds r18, 0x03A9 ; 0x8003a9 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 3a0ac: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 3a0ae: 28 30 cpi r18, 0x08 ; 8 3a0b0: c9 f4 brne .+50 ; 0x3a0e4 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3a0b2: 80 91 f2 03 lds r24, 0x03F2 ; 0x8003f2 3a0b6: 88 23 and r24, r24 3a0b8: b9 f0 breq .+46 ; 0x3a0e8 <_menu_edit_P()+0x106> { menu_depth--; 3a0ba: 81 50 subi r24, 0x01 ; 1 3a0bc: 80 93 f2 03 sts 0x03F2, r24 ; 0x8003f2 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3a0c0: 90 e0 ldi r25, 0x00 ; 0 3a0c2: fc 01 movw r30, r24 3a0c4: ee 0f add r30, r30 3a0c6: ff 1f adc r31, r31 3a0c8: e8 0f add r30, r24 3a0ca: f9 1f adc r31, r25 3a0cc: e2 56 subi r30, 0x62 ; 98 3a0ce: f8 4e sbci r31, 0xE8 ; 232 3a0d0: 62 81 ldd r22, Z+2 ; 0x02 3a0d2: 06 2e mov r0, r22 3a0d4: 00 0c add r0, r0 3a0d6: 77 0b sbc r23, r23 3a0d8: 20 e0 ldi r18, 0x00 ; 0 3a0da: 40 e0 ldi r20, 0x00 ; 0 3a0dc: 80 81 ld r24, Z 3a0de: 91 81 ldd r25, Z+1 ; 0x01 3a0e0: 0d 94 32 cf jmp 0x39e64 ; 0x39e64 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3a0e4: 91 83 std Z+1, r25 ; 0x01 3a0e6: e5 cf rjmp .-54 ; 0x3a0b2 <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 3a0e8: 08 95 ret 0003a0ea : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 3a0ea: dc 01 movw r26, r24 3a0ec: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 3a0ee: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 3a0f2: 97 30 cpi r25, 0x07 ; 7 3a0f4: d8 f4 brcc .+54 ; 0x3a12c { menu_stack[menu_depth].menu = menu_menu; 3a0f6: 49 2f mov r20, r25 3a0f8: 50 e0 ldi r21, 0x00 ; 0 3a0fa: fa 01 movw r30, r20 3a0fc: ee 0f add r30, r30 3a0fe: ff 1f adc r31, r31 3a100: e4 0f add r30, r20 3a102: f5 1f adc r31, r21 3a104: e2 56 subi r30, 0x62 ; 98 3a106: f8 4e sbci r31, 0xE8 ; 232 3a108: 40 91 67 0e lds r20, 0x0E67 ; 0x800e67 3a10c: 50 91 68 0e lds r21, 0x0E68 ; 0x800e68 3a110: 51 83 std Z+1, r21 ; 0x01 3a112: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a114: 80 91 35 05 lds r24, 0x0535 ; 0x800535 3a118: 9f 5f subi r25, 0xFF ; 255 3a11a: 90 93 f2 03 sts 0x03F2, r25 ; 0x8003f2 3a11e: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a120: 41 e0 ldi r20, 0x01 ; 1 3a122: 70 e0 ldi r23, 0x00 ; 0 3a124: 60 e0 ldi r22, 0x00 ; 0 3a126: cd 01 movw r24, r26 3a128: 0d 94 32 cf jmp 0x39e64 ; 0x39e64 } } 3a12c: 08 95 ret 0003a12e : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a12e: 8f 92 push r8 3a130: 9f 92 push r9 3a132: af 92 push r10 3a134: bf 92 push r11 3a136: cf 92 push r12 3a138: df 92 push r13 3a13a: ef 92 push r14 3a13c: ff 92 push r15 3a13e: 0f 93 push r16 3a140: 1f 93 push r17 3a142: cf 93 push r28 3a144: df 93 push r29 if (menu_item == menu_line) 3a146: e0 91 16 05 lds r30, 0x0516 ; 0x800516 3a14a: 30 91 15 05 lds r19, 0x0515 ; 0x800515 3a14e: e3 13 cpse r30, r19 3a150: 73 c0 rjmp .+230 ; 0x3a238 3a152: c2 2f mov r28, r18 3a154: 6a 01 movw r12, r20 3a156: 7b 01 movw r14, r22 3a158: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a15a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a15e: 88 23 and r24, r24 3a160: a1 f1 breq .+104 ; 0x3a1ca 3a162: 0f 94 ca cd call 0x39b94 ; 0x39b94 3a166: 01 e0 ldi r16, 0x01 ; 1 3a168: 8e 33 cpi r24, 0x3E ; 62 3a16a: 09 f0 breq .+2 ; 0x3a16e 3a16c: 00 e0 ldi r16, 0x00 ; 0 3a16e: 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; 3a170: 80 2f mov r24, r16 3a172: 82 70 andi r24, 0x02 ; 2 3a174: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a176: e1 14 cp r14, r1 3a178: f1 04 cpc r15, r1 3a17a: 09 f4 brne .+2 ; 0x3a17e 3a17c: 6f c0 rjmp .+222 ; 0x3a25c 3a17e: e7 01 movw r28, r14 3a180: 90 e2 ldi r25, 0x20 ; 32 3a182: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a184: 88 20 and r8, r8 3a186: 09 f4 brne .+2 ; 0x3a18a 3a188: 41 c0 rjmp .+130 ; 0x3a20c 3a18a: ce 01 movw r24, r28 3a18c: 0f 94 47 db call 0x3b68e ; 0x3b68e <__strlen_P> 3a190: 14 e0 ldi r17, 0x04 ; 4 3a192: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a194: 4e e3 ldi r20, 0x3E ; 62 3a196: 00 ff sbrs r16, 0 3a198: 40 e2 ldi r20, 0x20 ; 32 3a19a: 60 91 13 05 lds r22, 0x0513 ; 0x800513 3a19e: 80 e0 ldi r24, 0x00 ; 0 3a1a0: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_print_pad_P(str, LCD_WIDTH - len); 3a1a4: 64 e1 ldi r22, 0x14 ; 20 3a1a6: 61 1b sub r22, r17 3a1a8: c5 01 movw r24, r10 3a1aa: 0e 94 62 71 call 0xe2c4 ; 0xe2c4 lcd_putc('['); 3a1ae: 8b e5 ldi r24, 0x5B ; 91 3a1b0: 0e 94 7c 6f call 0xdef8 ; 0xdef8 if (is_progmem) { lcd_puts_P(toggle); 3a1b4: 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) 3a1b6: 88 20 and r8, r8 3a1b8: 89 f1 breq .+98 ; 0x3a21c { lcd_puts_P(toggle); 3a1ba: 0e 94 78 6f call 0xdef0 ; 0xdef0 } else { lcd_print(toggle); } lcd_putc(']'); 3a1be: 8d e5 ldi r24, 0x5D ; 93 3a1c0: 0e 94 7c 6f call 0xdef8 ; 0xdef8 lcd_putc(eol); 3a1c4: 89 2d mov r24, r9 3a1c6: 0e 94 7c 6f call 0xdef8 ; 0xdef8 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)) 3a1ca: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a1ce: 88 23 and r24, r24 3a1d0: 99 f1 breq .+102 ; 0x3a238 3a1d2: 20 91 16 05 lds r18, 0x0516 ; 0x800516 3a1d6: 80 91 35 05 lds r24, 0x0535 ; 0x800535 3a1da: 90 91 36 05 lds r25, 0x0536 ; 0x800536 3a1de: 28 17 cp r18, r24 3a1e0: 19 06 cpc r1, r25 3a1e2: 51 f5 brne .+84 ; 0x3a238 { if (toggle == NULL) // print N/A warning message 3a1e4: ef 28 or r14, r15 3a1e6: e9 f4 brne .+58 ; 0x3a222 { menu_submenu(func); 3a1e8: 60 e0 ldi r22, 0x00 ; 0 3a1ea: c6 01 movw r24, r12 3a1ec: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea menu_item_ret(); return; } } menu_item++; } 3a1f0: df 91 pop r29 3a1f2: cf 91 pop r28 3a1f4: 1f 91 pop r17 3a1f6: 0f 91 pop r16 3a1f8: ff 90 pop r15 3a1fa: ef 90 pop r14 3a1fc: df 90 pop r13 3a1fe: cf 90 pop r12 3a200: bf 90 pop r11 3a202: af 90 pop r10 3a204: 9f 90 pop r9 3a206: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a208: 0d 94 ee cd jmp 0x39bdc ; 0x39bdc //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)); 3a20c: fe 01 movw r30, r28 3a20e: 01 90 ld r0, Z+ 3a210: 00 20 and r0, r0 3a212: e9 f7 brne .-6 ; 0x3a20e 3a214: ec 1b sub r30, r28 3a216: 13 e0 ldi r17, 0x03 ; 3 3a218: 1e 0f add r17, r30 3a21a: bc cf rjmp .-136 ; 0x3a194 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a21c: 0e 94 94 71 call 0xe328 ; 0xe328 3a220: ce cf rjmp .-100 ; 0x3a1be { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a222: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a226: c1 14 cp r12, r1 3a228: d1 04 cpc r13, r1 3a22a: 11 f0 breq .+4 ; 0x3a230 3a22c: f6 01 movw r30, r12 3a22e: 19 95 eicall lcd_update_enabled = 1; 3a230: 81 e0 ldi r24, 0x01 ; 1 3a232: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a236: dc cf rjmp .-72 ; 0x3a1f0 } menu_item_ret(); return; } } menu_item++; 3a238: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a23c: 8f 5f subi r24, 0xFF ; 255 3a23e: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 3a242: df 91 pop r29 3a244: cf 91 pop r28 3a246: 1f 91 pop r17 3a248: 0f 91 pop r16 3a24a: ff 90 pop r15 3a24c: ef 90 pop r14 3a24e: df 90 pop r13 3a250: cf 90 pop r12 3a252: bf 90 pop r11 3a254: af 90 pop r10 3a256: 9f 90 pop r9 3a258: 8f 90 pop r8 3a25a: 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); 3a25c: 87 e0 ldi r24, 0x07 ; 7 3a25e: 9d e3 ldi r25, 0x3D ; 61 3a260: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 3a264: 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] : ' '; 3a266: 8e e7 ldi r24, 0x7E ; 126 3a268: 98 2e mov r9, r24 3a26a: 8c cf rjmp .-232 ; 0x3a184 0003a26c : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a26c: 0f 93 push r16 3a26e: 1f 93 push r17 3a270: cf 93 push r28 3a272: df 93 push r29 3a274: cd b7 in r28, 0x3d ; 61 3a276: de b7 in r29, 0x3e ; 62 3a278: 63 97 sbiw r28, 0x13 ; 19 3a27a: 0f b6 in r0, 0x3f ; 63 3a27c: f8 94 cli 3a27e: de bf out 0x3e, r29 ; 62 3a280: 0f be out 0x3f, r0 ; 63 3a282: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a284: 30 91 16 05 lds r19, 0x0516 ; 0x800516 3a288: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a28c: 32 13 cpse r19, r18 3a28e: 38 c0 rjmp .+112 ; 0x3a300 3a290: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a292: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a296: 22 23 and r18, r18 3a298: a9 f0 breq .+42 ; 0x3a2c4 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a29a: be 01 movw r22, r28 3a29c: 6f 5f subi r22, 0xFF ; 255 3a29e: 7f 4f sbci r23, 0xFF ; 255 3a2a0: 0f 94 a2 cd call 0x39b44 ; 0x39b44 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a2a4: 0f 94 ca cd call 0x39b94 ; 0x39b94 3a2a8: 48 2f mov r20, r24 3a2aa: 60 91 13 05 lds r22, 0x0513 ; 0x800513 3a2ae: 80 e0 ldi r24, 0x00 ; 0 3a2b0: 0e 94 ad 6f call 0xdf5a ; 0xdf5a lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a2b4: 62 e1 ldi r22, 0x12 ; 18 3a2b6: ce 01 movw r24, r28 3a2b8: 01 96 adiw r24, 0x01 ; 1 3a2ba: 0e 94 7c 71 call 0xe2f8 ; 0xe2f8 lcd_putc(type_char); 3a2be: 8e e7 ldi r24, 0x7E ; 126 3a2c0: 0e 94 7c 6f call 0xdef8 ; 0xdef8 void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); if (menu_clicked && (lcd_encoder == menu_item)) 3a2c4: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a2c8: 88 23 and r24, r24 3a2ca: d1 f0 breq .+52 ; 0x3a300 3a2cc: 20 91 16 05 lds r18, 0x0516 ; 0x800516 3a2d0: 80 91 35 05 lds r24, 0x0535 ; 0x800535 3a2d4: 90 91 36 05 lds r25, 0x0536 ; 0x800536 3a2d8: 28 17 cp r18, r24 3a2da: 19 06 cpc r1, r25 3a2dc: 89 f4 brne .+34 ; 0x3a300 if (menu_item == menu_line) { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); if (menu_clicked && (lcd_encoder == menu_item)) { menu_submenu(submenu); 3a2de: 60 e0 ldi r22, 0x00 ; 0 3a2e0: c8 01 movw r24, r16 3a2e2: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea menu_item_ret(); 3a2e6: 0f 94 ee cd call 0x39bdc ; 0x39bdc menu_item_ret(); return; } } menu_item++; } 3a2ea: 63 96 adiw r28, 0x13 ; 19 3a2ec: 0f b6 in r0, 0x3f ; 63 3a2ee: f8 94 cli 3a2f0: de bf out 0x3e, r29 ; 62 3a2f2: 0f be out 0x3f, r0 ; 63 3a2f4: cd bf out 0x3d, r28 ; 61 3a2f6: df 91 pop r29 3a2f8: cf 91 pop r28 3a2fa: 1f 91 pop r17 3a2fc: 0f 91 pop r16 3a2fe: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a300: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a304: 8f 5f subi r24, 0xFF ; 255 3a306: 80 93 16 05 sts 0x0516, r24 ; 0x800516 3a30a: ef cf rjmp .-34 ; 0x3a2ea 0003a30c : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a30c: cf 93 push r28 3a30e: df 93 push r29 if (menu_item == menu_line) 3a310: 30 91 16 05 lds r19, 0x0516 ; 0x800516 3a314: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a318: 32 13 cpse r19, r18 3a31a: 1e c0 rjmp .+60 ; 0x3a358 3a31c: eb 01 movw r28, r22 3a31e: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a320: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a324: 88 23 and r24, r24 3a326: 19 f0 breq .+6 ; 0x3a32e 3a328: 8e e7 ldi r24, 0x7E ; 126 3a32a: 0f 94 d7 cd call 0x39bae ; 0x39bae if (menu_clicked && (lcd_encoder == menu_item)) 3a32e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a332: 88 23 and r24, r24 3a334: 89 f0 breq .+34 ; 0x3a358 3a336: 20 91 16 05 lds r18, 0x0516 ; 0x800516 3a33a: 80 91 35 05 lds r24, 0x0535 ; 0x800535 3a33e: 90 91 36 05 lds r25, 0x0536 ; 0x800536 3a342: 28 17 cp r18, r24 3a344: 19 06 cpc r1, r25 3a346: 41 f4 brne .+16 ; 0x3a358 { menu_submenu(submenu); 3a348: 60 e0 ldi r22, 0x00 ; 0 3a34a: ce 01 movw r24, r28 3a34c: 0f 94 75 d0 call 0x3a0ea ; 0x3a0ea menu_item_ret(); return; } } menu_item++; } 3a350: df 91 pop r29 3a352: 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(); 3a354: 0d 94 ee cd jmp 0x39bdc ; 0x39bdc return; } } menu_item++; 3a358: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a35c: 8f 5f subi r24, 0xFF ; 255 3a35e: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 3a362: df 91 pop r29 3a364: cf 91 pop r28 3a366: 08 95 ret 0003a368 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a368: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a36a: 80 91 f2 03 lds r24, 0x03F2 ; 0x8003f2 3a36e: 98 17 cp r25, r24 3a370: a8 f4 brcc .+42 ; 0x3a39c 3a372: 89 1b sub r24, r25 3a374: 80 93 f2 03 sts 0x03F2, r24 ; 0x8003f2 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a378: 90 e0 ldi r25, 0x00 ; 0 3a37a: fc 01 movw r30, r24 3a37c: ee 0f add r30, r30 3a37e: ff 1f adc r31, r31 3a380: e8 0f add r30, r24 3a382: f9 1f adc r31, r25 3a384: e2 56 subi r30, 0x62 ; 98 3a386: f8 4e sbci r31, 0xE8 ; 232 3a388: 62 81 ldd r22, Z+2 ; 0x02 3a38a: 06 2e mov r0, r22 3a38c: 00 0c add r0, r0 3a38e: 77 0b sbc r23, r23 3a390: 20 e0 ldi r18, 0x00 ; 0 3a392: 41 e0 ldi r20, 0x01 ; 1 3a394: 80 81 ld r24, Z 3a396: 91 81 ldd r25, Z+1 ; 0x01 3a398: 0d 94 32 cf jmp 0x39e64 ; 0x39e64 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a39c: 80 e0 ldi r24, 0x00 ; 0 3a39e: ea cf rjmp .-44 ; 0x3a374 0003a3a0 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a3a0: 81 e0 ldi r24, 0x01 ; 1 3a3a2: 0d 94 b4 d1 jmp 0x3a368 ; 0x3a368 0003a3a6 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a3a6: 30 91 16 05 lds r19, 0x0516 ; 0x800516 3a3aa: 20 91 15 05 lds r18, 0x0515 ; 0x800515 3a3ae: 32 13 cpse r19, r18 3a3b0: 19 c0 rjmp .+50 ; 0x3a3e4 3a3b2: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a3b4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a3b8: 88 23 and r24, r24 3a3ba: 19 f0 breq .+6 ; 0x3a3c2 3a3bc: 83 e8 ldi r24, 0x83 ; 131 3a3be: 0f 94 d7 cd call 0x39bae ; 0x39bae if (menu_clicked && (lcd_encoder == menu_item)) 3a3c2: 80 91 14 05 lds r24, 0x0514 ; 0x800514 3a3c6: 88 23 and r24, r24 3a3c8: 69 f0 breq .+26 ; 0x3a3e4 3a3ca: 20 91 16 05 lds r18, 0x0516 ; 0x800516 3a3ce: 80 91 35 05 lds r24, 0x0535 ; 0x800535 3a3d2: 90 91 36 05 lds r25, 0x0536 ; 0x800536 3a3d6: 28 17 cp r18, r24 3a3d8: 19 06 cpc r1, r25 3a3da: 21 f4 brne .+8 ; 0x3a3e4 { menu_back(); 3a3dc: 0f 94 d0 d1 call 0x3a3a0 ; 0x3a3a0 menu_item_ret(); 3a3e0: 0d 94 ee cd jmp 0x39bdc ; 0x39bdc return; } } menu_item++; 3a3e4: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a3e8: 8f 5f subi r24, 0xFF ; 255 3a3ea: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 3a3ee: 08 95 ret 0003a3f0 : }; 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() { 3a3f0: ef 92 push r14 3a3f2: ff 92 push r15 3a3f4: 0f 93 push r16 3a3f6: 1f 93 push r17 3a3f8: cf 93 push r28 3a3fa: df 93 push r29 3a3fc: 10 92 d6 03 sts 0x03D6, r1 ; 0x8003d6 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) 3a400: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 3a404: 81 11 cpse r24, r1 3a406: 23 c0 rjmp .+70 ; 0x3a44e { _md->status = 1; // Menu entered for the first time 3a408: 81 e0 ldi r24, 0x01 ; 1 3a40a: 80 93 b4 03 sts 0x03B4, r24 ; 0x8003b4 // Fetch the TuneItem from PROGMEM const uint8_t offset = (mmu2.MMUCurrentErrorCode() == ErrorCode::HOMING_IDLER_FAILED) ? 1 : 0; 3a40e: 81 e0 ldi r24, 0x01 ; 1 3a410: 90 e0 ldi r25, 0x00 ; 0 3a412: 20 91 67 13 lds r18, 0x1367 ; 0x801367 3a416: 30 91 68 13 lds r19, 0x1368 ; 0x801368 3a41a: 27 30 cpi r18, 0x07 ; 7 3a41c: 31 48 sbci r19, 0x81 ; 129 3a41e: 11 f0 breq .+4 ; 0x3a424 3a420: 90 e0 ldi r25, 0x00 ; 0 3a422: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a424: bc 01 movw r22, r24 3a426: 66 0f add r22, r22 3a428: 77 1f adc r23, r23 3a42a: 68 0f add r22, r24 3a42c: 79 1f adc r23, r25 3a42e: 61 5d subi r22, 0xD1 ; 209 3a430: 75 45 sbci r23, 0x55 ; 85 3a432: 43 e0 ldi r20, 0x03 ; 3 3a434: 50 e0 ldi r21, 0x00 ; 0 3a436: 86 eb ldi r24, 0xB6 ; 182 3a438: 93 e0 ldi r25, 0x03 ; 3 3a43a: 0f 94 23 db call 0x3b646 ; 0x3b646 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a43e: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a442: 0f 94 d0 1d call 0x23ba0 ; 0x23ba0 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a446: 80 91 92 13 lds r24, 0x1392 ; 0x801392 3a44a: 80 93 b5 03 sts 0x03B5, r24 ; 0x8003b5 } MENU_BEGIN(); 3a44e: 0f 94 08 cf call 0x39e10 ; 0x39e10 3a452: 10 92 13 05 sts 0x0513, r1 ; 0x800513 3a456: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a45a: 84 30 cpi r24, 0x04 ; 4 3a45c: e0 f5 brcc .+120 ; 0x3a4d6 3a45e: 10 92 16 05 sts 0x0516, r1 ; 0x800516 ON_MENU_LEAVE( 3a462: 0f 94 88 cd call 0x39b10 ; 0x39b10 3a466: 88 23 and r24, r24 3a468: 89 f0 breq .+34 ; 0x3a48c 3a46a: 60 91 b5 03 lds r22, 0x03B5 ; 0x8003b5 3a46e: 70 e0 ldi r23, 0x00 ; 0 3a470: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a474: 0e 94 bb de call 0x1bd76 ; 0x1bd76 3a478: 10 92 5c 0e sts 0x0E5C, r1 ; 0x800e5c <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a47c: df 91 pop r29 3a47e: cf 91 pop r28 3a480: 1f 91 pop r17 3a482: 0f 91 pop r16 3a484: ff 90 pop r15 3a486: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3a488: 0d 94 4b 27 jmp 0x24e96 ; 0x24e96 mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3a48c: 81 e2 ldi r24, 0x21 ; 33 3a48e: 95 e6 ldi r25, 0x65 ; 101 3a490: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 3a494: 0f 94 d3 d1 call 0x3a3a6 ; 0x3a3a6 MENU_ITEM_EDIT_int3_P( 3a498: 00 91 b8 03 lds r16, 0x03B8 ; 0x8003b8 3a49c: 10 e0 ldi r17, 0x00 ; 0 3a49e: c0 91 b7 03 lds r28, 0x03B7 ; 0x8003b7 3a4a2: d0 e0 ldi r29, 0x00 ; 0 3a4a4: 83 e1 ldi r24, 0x13 ; 19 3a4a6: 95 e6 ldi r25, 0x65 ; 101 3a4a8: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 3a4ac: f1 2c mov r15, r1 3a4ae: e1 2c mov r14, r1 3a4b0: 9e 01 movw r18, r28 3a4b2: 48 e0 ldi r20, 0x08 ; 8 3a4b4: 65 eb ldi r22, 0xB5 ; 181 3a4b6: 73 e0 ldi r23, 0x03 ; 3 3a4b8: 0f 94 58 cf call 0x39eb0 ; 0x39eb0 _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3a4bc: 0f 94 dc ce call 0x39db8 ; 0x39db8 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3a4c0: 80 91 13 05 lds r24, 0x0513 ; 0x800513 3a4c4: 8f 5f subi r24, 0xFF ; 255 3a4c6: 80 93 13 05 sts 0x0513, r24 ; 0x800513 3a4ca: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a4ce: 8f 5f subi r24, 0xFF ; 255 3a4d0: 80 93 15 05 sts 0x0515, r24 ; 0x800515 3a4d4: c0 cf rjmp .-128 ; 0x3a456 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a4d6: df 91 pop r29 3a4d8: cf 91 pop r28 3a4da: 1f 91 pop r17 3a4dc: 0f 91 pop r16 3a4de: ff 90 pop r15 3a4e0: ef 90 pop r14 3a4e2: 08 95 ret 0003a4e4 : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3a4e4: 0e 94 aa 71 call 0xe354 ; 0xe354 3a4e8: 81 11 cpse r24, r1 menu_back(); 3a4ea: 0d 94 d0 d1 jmp 0x3a3a0 ; 0x3a3a0 } 3a4ee: 08 95 ret 0003a4f0 : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3a4f0: 8f 92 push r8 3a4f2: 9f 92 push r9 3a4f4: af 92 push r10 3a4f6: bf 92 push r11 3a4f8: ef 92 push r14 3a4fa: ff 92 push r15 3a4fc: 0f 93 push r16 3a4fe: 1f 93 push r17 3a500: cf 93 push r28 3a502: df 93 push r29 3a504: cd b7 in r28, 0x3d ; 61 3a506: de b7 in r29, 0x3e ; 62 3a508: a0 97 sbiw r28, 0x20 ; 32 3a50a: 0f b6 in r0, 0x3f ; 63 3a50c: f8 94 cli 3a50e: de bf out 0x3e, r29 ; 62 3a510: 0f be out 0x3f, r0 ; 63 3a512: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3a514: 61 15 cp r22, r1 3a516: 71 05 cpc r23, r1 3a518: 81 05 cpc r24, r1 3a51a: 91 05 cpc r25, r1 3a51c: 99 f4 brne .+38 ; 0x3a544 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a51e: 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)); } 3a520: a0 96 adiw r28, 0x20 ; 32 3a522: 0f b6 in r0, 0x3f ; 63 3a524: f8 94 cli 3a526: de bf out 0x3e, r29 ; 62 3a528: 0f be out 0x3f, r0 ; 63 3a52a: cd bf out 0x3d, r28 ; 61 3a52c: df 91 pop r29 3a52e: cf 91 pop r28 3a530: 1f 91 pop r17 3a532: 0f 91 pop r16 3a534: ff 90 pop r15 3a536: ef 90 pop r14 3a538: bf 90 pop r11 3a53a: af 90 pop r10 3a53c: 9f 90 pop r9 3a53e: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a540: 0c 94 ba 78 jmp 0xf174 ; 0xf174 // 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; 3a544: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a546: 84 2e mov r8, r20 3a548: 91 2c mov r9, r1 3a54a: b1 2c mov r11, r1 3a54c: a1 2c mov r10, r1 3a54e: 9e 01 movw r18, r28 3a550: 2f 5f subi r18, 0xFF ; 255 3a552: 3f 4f sbci r19, 0xFF ; 255 3a554: 79 01 movw r14, r18 3a556: a5 01 movw r20, r10 3a558: 94 01 movw r18, r8 3a55a: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 3a55e: f7 01 movw r30, r14 3a560: e0 0f add r30, r16 3a562: f1 1d adc r31, r1 3a564: 60 83 st Z, r22 n /= base; 3a566: b9 01 movw r22, r18 3a568: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a56a: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3a56c: 61 15 cp r22, r1 3a56e: 71 05 cpc r23, r1 3a570: 81 05 cpc r24, r1 3a572: 91 05 cpc r25, r1 3a574: 81 f7 brne .-32 ; 0x3a556 3a576: 0e 0d add r16, r14 3a578: 1f 2d mov r17, r15 3a57a: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3a57c: e0 16 cp r14, r16 3a57e: f1 06 cpc r15, r17 3a580: 59 f0 breq .+22 ; 0x3a598 print((char) (buf[i - 1] < 10 ? 3a582: f8 01 movw r30, r16 3a584: 82 91 ld r24, -Z 3a586: 8f 01 movw r16, r30 3a588: 8a 30 cpi r24, 0x0A ; 10 3a58a: 20 f4 brcc .+8 ; 0x3a594 '0' + buf[i - 1] : 3a58c: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a58e: 0e 94 ba 78 call 0xf174 ; 0xf174 3a592: f4 cf rjmp .-24 ; 0x3a57c } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3a594: 89 5c subi r24, 0xC9 ; 201 3a596: fb cf rjmp .-10 ; 0x3a58e } 3a598: a0 96 adiw r28, 0x20 ; 32 3a59a: 0f b6 in r0, 0x3f ; 63 3a59c: f8 94 cli 3a59e: de bf out 0x3e, r29 ; 62 3a5a0: 0f be out 0x3f, r0 ; 63 3a5a2: cd bf out 0x3d, r28 ; 61 3a5a4: df 91 pop r29 3a5a6: cf 91 pop r28 3a5a8: 1f 91 pop r17 3a5aa: 0f 91 pop r16 3a5ac: ff 90 pop r15 3a5ae: ef 90 pop r14 3a5b0: bf 90 pop r11 3a5b2: af 90 pop r10 3a5b4: 9f 90 pop r9 3a5b6: 8f 90 pop r8 3a5b8: 08 95 ret 0003a5ba : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3a5ba: cf 92 push r12 3a5bc: df 92 push r13 3a5be: ef 92 push r14 3a5c0: ff 92 push r15 3a5c2: 6b 01 movw r12, r22 3a5c4: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3a5c6: f7 fe sbrs r15, 7 3a5c8: 0b c0 rjmp .+22 ; 0x3a5e0 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a5ca: 8d e2 ldi r24, 0x2D ; 45 3a5cc: 0e 94 ba 78 call 0xf174 ; 0xf174 } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3a5d0: f0 94 com r15 3a5d2: e0 94 com r14 3a5d4: d0 94 com r13 3a5d6: c0 94 com r12 3a5d8: c1 1c adc r12, r1 3a5da: d1 1c adc r13, r1 3a5dc: e1 1c adc r14, r1 3a5de: f1 1c adc r15, r1 } printNumber(n, 10); 3a5e0: 4a e0 ldi r20, 0x0A ; 10 3a5e2: c7 01 movw r24, r14 3a5e4: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3a5e6: ff 90 pop r15 3a5e8: ef 90 pop r14 3a5ea: df 90 pop r13 3a5ec: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3a5ee: 0d 94 78 d2 jmp 0x3a4f0 ; 0x3a4f0 0003a5f2 : void recover_print(uint8_t automatic) { 3a5f2: 4f 92 push r4 3a5f4: 5f 92 push r5 3a5f6: 6f 92 push r6 3a5f8: 7f 92 push r7 3a5fa: 8f 92 push r8 3a5fc: 9f 92 push r9 3a5fe: af 92 push r10 3a600: bf 92 push r11 3a602: cf 92 push r12 3a604: df 92 push r13 3a606: ef 92 push r14 3a608: ff 92 push r15 3a60a: 0f 93 push r16 3a60c: 1f 93 push r17 3a60e: cf 93 push r28 3a610: df 93 push r29 3a612: 1f 92 push r1 3a614: 1f 92 push r1 3a616: cd b7 in r28, 0x3d ; 61 3a618: de b7 in r29, 0x3e ; 62 3a61a: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 3a61c: 88 e2 ldi r24, 0x28 ; 40 3a61e: 95 e6 ldi r25, 0x65 ; 101 3a620: 0e 94 59 73 call 0xe6b2 ; 0xe6b2 3a624: 0f 94 e2 0b call 0x217c4 ; 0x217c4 gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 3a628: 10 92 41 07 sts 0x0741, r1 ; 0x800741 3a62c: 10 92 42 07 sts 0x0742, r1 ; 0x800742 3a630: 10 92 43 07 sts 0x0743, r1 ; 0x800743 3a634: 10 92 44 07 sts 0x0744, r1 ; 0x800744 current_position[Y_AXIS] = 0; 3a638: 10 92 45 07 sts 0x0745, r1 ; 0x800745 3a63c: 10 92 46 07 sts 0x0746, r1 ; 0x800746 3a640: 10 92 47 07 sts 0x0747, r1 ; 0x800747 3a644: 10 92 48 07 sts 0x0748, r1 ; 0x800748 3a648: 9e ea ldi r25, 0xAE ; 174 3a64a: e9 2e mov r14, r25 3a64c: 9d e0 ldi r25, 0x0D ; 13 3a64e: 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; 3a650: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 3a652: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 3a654: 27 e0 ldi r18, 0x07 ; 7 3a656: b2 2e mov r11, r18 3a658: 8c 2d mov r24, r12 3a65a: 6b 2d mov r22, r11 3a65c: 0f 94 44 de call 0x3bc88 ; 0x3bc88 <__divmodqi4> 3a660: 08 2f mov r16, r24 3a662: 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); 3a664: 42 e0 ldi r20, 0x02 ; 2 3a666: 50 e0 ldi r21, 0x00 ; 0 3a668: b7 01 movw r22, r14 3a66a: ce 01 movw r24, r28 3a66c: 01 96 adiw r24, 0x01 ; 1 3a66e: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 if (v != 0) 3a672: 69 81 ldd r22, Y+1 ; 0x01 3a674: 7a 81 ldd r23, Y+2 ; 0x02 3a676: 61 15 cp r22, r1 3a678: 71 05 cpc r23, r1 3a67a: 11 f0 breq .+4 ; 0x3a680 mbl_was_active = true; 3a67c: dd 24 eor r13, r13 3a67e: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 3a680: 2b 2d mov r18, r11 3a682: 02 03 mulsu r16, r18 3a684: 80 01 movw r16, r0 3a686: 11 24 eor r1, r1 3a688: 09 0d add r16, r9 3a68a: 11 1d adc r17, r1 3a68c: 97 fc sbrc r9, 7 3a68e: 1a 95 dec r17 3a690: 00 0f add r16, r16 3a692: 11 1f adc r17, r17 3a694: 00 0f add r16, r16 3a696: 11 1f adc r17, r17 3a698: 02 56 subi r16, 0x62 ; 98 3a69a: 1c 4e sbci r17, 0xEC ; 236 3a69c: 07 2e mov r0, r23 3a69e: 00 0c add r0, r0 3a6a0: 88 0b sbc r24, r24 3a6a2: 99 0b sbc r25, r25 3a6a4: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3a6a8: 2f e6 ldi r18, 0x6F ; 111 3a6aa: 32 e1 ldi r19, 0x12 ; 18 3a6ac: 43 e8 ldi r20, 0x83 ; 131 3a6ae: 5a e3 ldi r21, 0x3A ; 58 3a6b0: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3a6b4: f8 01 movw r30, r16 3a6b6: 61 83 std Z+1, r22 ; 0x01 3a6b8: 72 83 std Z+2, r23 ; 0x02 3a6ba: 83 83 std Z+3, r24 ; 0x03 3a6bc: 94 83 std Z+4, r25 ; 0x04 3a6be: f2 e0 ldi r31, 0x02 ; 2 3a6c0: ef 0e add r14, r31 3a6c2: f1 1c adc r15, r1 3a6c4: 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) { 3a6c6: 21 e3 ldi r18, 0x31 ; 49 3a6c8: c2 12 cpse r12, r18 3a6ca: c6 cf rjmp .-116 ; 0x3a658 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)); 3a6cc: 8a ed ldi r24, 0xDA ; 218 3a6ce: 9e e0 ldi r25, 0x0E ; 14 3a6d0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a6d4: 60 93 49 07 sts 0x0749, r22 ; 0x800749 3a6d8: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 3a6dc: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 3a6e0: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c // Recover last E axis position current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3a6e4: 8e e6 ldi r24, 0x6E ; 110 3a6e6: 9f e0 ldi r25, 0x0F ; 15 3a6e8: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a6ec: 60 93 4d 07 sts 0x074D, r22 ; 0x80074d 3a6f0: 70 93 4e 07 sts 0x074E, r23 ; 0x80074e 3a6f4: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 3a6f8: 90 93 50 07 sts 0x0750, r25 ; 0x800750 // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 3a6fc: 0f 94 0d cc call 0x3981a ; 0x3981a // 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(); 3a700: 0f 94 f7 c6 call 0x38dee ; 0x38dee // 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); 3a704: 81 e4 ldi r24, 0x41 ; 65 3a706: 97 e0 ldi r25, 0x07 ; 7 3a708: 0e 94 76 6c call 0xd8ec ; 0xd8ec set_destination_to_current(); 3a70c: 0e 94 e7 68 call 0xd1ce ; 0xd1ce plan_set_position_curposXYZE(); 3a710: 0f 94 4b b9 call 0x37296 ; 0x37296 SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 3a714: 88 e8 ldi r24, 0x88 ; 136 3a716: 9b ea ldi r25, 0xAB ; 171 3a718: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 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]); 3a71c: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 3a720: 8f 93 push r24 3a722: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 3a726: 8f 93 push r24 3a728: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a72c: 8f 93 push r24 3a72e: 80 91 49 07 lds r24, 0x0749 ; 0x800749 3a732: 8f 93 push r24 3a734: 80 91 48 07 lds r24, 0x0748 ; 0x800748 3a738: 8f 93 push r24 3a73a: 80 91 47 07 lds r24, 0x0747 ; 0x800747 3a73e: 8f 93 push r24 3a740: 80 91 46 07 lds r24, 0x0746 ; 0x800746 3a744: 8f 93 push r24 3a746: 80 91 45 07 lds r24, 0x0745 ; 0x800745 3a74a: 8f 93 push r24 3a74c: 80 91 44 07 lds r24, 0x0744 ; 0x800744 3a750: 8f 93 push r24 3a752: 80 91 43 07 lds r24, 0x0743 ; 0x800743 3a756: 8f 93 push r24 3a758: 80 91 42 07 lds r24, 0x0742 ; 0x800742 3a75c: 8f 93 push r24 3a75e: 80 91 41 07 lds r24, 0x0741 ; 0x800741 3a762: 8f 93 push r24 3a764: 86 e7 ldi r24, 0x76 ; 118 3a766: 91 e7 ldi r25, 0x71 ; 113 3a768: 9f 93 push r25 3a76a: 8f 93 push r24 3a76c: 0f 94 4b dc call 0x3b896 ; 0x3b896 print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 3a770: 81 e0 ldi r24, 0x01 ; 1 3a772: 80 93 40 07 sts 0x0740, r24 ; 0x800740 enable_z(); 3a776: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 3a778: 88 ed ldi r24, 0xD8 ; 216 3a77a: 9e e0 ldi r25, 0x0E ; 14 3a77c: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 3a780: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 3a784: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 3a788: 8b e8 ldi r24, 0x8B ; 139 3a78a: 9f e0 ldi r25, 0x0F ; 15 3a78c: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 3a790: 90 e0 ldi r25, 0x00 ; 0 3a792: 90 93 6a 0e sts 0x0E6A, r25 ; 0x800e6a 3a796: 80 93 69 0e sts 0x0E69, r24 ; 0x800e69 // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 3a79a: 88 ee ldi r24, 0xE8 ; 232 3a79c: 9e e0 ldi r25, 0x0E ; 14 3a79e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a7a2: 60 93 bb 02 sts 0x02BB, r22 ; 0x8002bb 3a7a6: 70 93 bc 02 sts 0x02BC, r23 ; 0x8002bc 3a7aa: 80 93 bd 02 sts 0x02BD, r24 ; 0x8002bd 3a7ae: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 3a7b2: 8e ed ldi r24, 0xDE ; 222 3a7b4: 9e e0 ldi r25, 0x0E ; 14 3a7b6: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 3a7ba: 90 93 95 02 sts 0x0295, r25 ; 0x800295 3a7be: 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)); 3a7c2: 40 e1 ldi r20, 0x10 ; 16 3a7c4: 50 e0 ldi r21, 0x00 ; 0 3a7c6: 67 e3 ldi r22, 0x37 ; 55 3a7c8: 7d e0 ldi r23, 0x0D ; 13 3a7ca: 8b ea ldi r24, 0xAB ; 171 3a7cc: 92 e0 ldi r25, 0x02 ; 2 3a7ce: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 3a7d2: 8c e6 ldi r24, 0x6C ; 108 3a7d4: 9f e0 ldi r25, 0x0F ; 15 3a7d6: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 3a7da: 90 93 0a 18 sts 0x180A, r25 ; 0x80180a 3a7de: 80 93 09 18 sts 0x1809, r24 ; 0x801809 #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 3a7e2: 8c e2 ldi r24, 0x2C ; 44 3a7e4: 9d e0 ldi r25, 0x0D ; 13 3a7e6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a7ea: 60 93 05 18 sts 0x1805, r22 ; 0x801805 3a7ee: 70 93 06 18 sts 0x1806, r23 ; 0x801806 3a7f2: 80 93 07 18 sts 0x1807, r24 ; 0x801807 3a7f6: 90 93 08 18 sts 0x1808, r25 ; 0x801808 #endif #ifdef PREVENT_DANGEROUS_EXTRUDE extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP); 3a7fa: 8d e7 ldi r24, 0x7D ; 125 3a7fc: 9c e0 ldi r25, 0x0C ; 12 3a7fe: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 3a802: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 3a806: 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)); 3a80a: 40 e1 ldi r20, 0x10 ; 16 3a80c: 50 e0 ldi r21, 0x00 ; 0 3a80e: 6d e6 ldi r22, 0x6D ; 109 3a810: 7c e0 ldi r23, 0x0C ; 12 3a812: 80 e9 ldi r24, 0x90 ; 144 3a814: 96 e0 ldi r25, 0x06 ; 6 3a816: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 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)); 3a81a: 40 e1 ldi r20, 0x10 ; 16 3a81c: 50 e0 ldi r21, 0x00 ; 0 3a81e: 6d e5 ldi r22, 0x5D ; 93 3a820: 7c e0 ldi r23, 0x0C ; 12 3a822: 88 e1 ldi r24, 0x18 ; 24 3a824: 97 e0 ldi r25, 0x07 ; 7 3a826: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 3a82a: 40 e1 ldi r20, 0x10 ; 16 3a82c: 50 e0 ldi r21, 0x00 ; 0 3a82e: 6d e4 ldi r22, 0x4D ; 77 3a830: 7c e0 ldi r23, 0x0C ; 12 3a832: 80 e8 ldi r24, 0x80 ; 128 3a834: 96 e0 ldi r25, 0x06 ; 6 3a836: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 3a83a: 40 e1 ldi r20, 0x10 ; 16 3a83c: 50 e0 ldi r21, 0x00 ; 0 3a83e: 6d e3 ldi r22, 0x3D ; 61 3a840: 7c e0 ldi r23, 0x0C ; 12 3a842: 88 e0 ldi r24, 0x08 ; 8 3a844: 97 e0 ldi r25, 0x07 ; 7 3a846: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 3a84a: 89 e3 ldi r24, 0x39 ; 57 3a84c: 9c e0 ldi r25, 0x0C ; 12 3a84e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a852: 60 93 a8 06 sts 0x06A8, r22 ; 0x8006a8 3a856: 70 93 a9 06 sts 0x06A9, r23 ; 0x8006a9 3a85a: 80 93 aa 06 sts 0x06AA, r24 ; 0x8006aa 3a85e: 90 93 ab 06 sts 0x06AB, r25 ; 0x8006ab cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 3a862: 85 e3 ldi r24, 0x35 ; 53 3a864: 9c e0 ldi r25, 0x0C ; 12 3a866: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a86a: 60 93 ac 06 sts 0x06AC, r22 ; 0x8006ac 3a86e: 70 93 ad 06 sts 0x06AD, r23 ; 0x8006ad 3a872: 80 93 ae 06 sts 0x06AE, r24 ; 0x8006ae 3a876: 90 93 af 06 sts 0x06AF, r25 ; 0x8006af cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 3a87a: 81 e3 ldi r24, 0x31 ; 49 3a87c: 9c e0 ldi r25, 0x0C ; 12 3a87e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a882: 60 93 b0 06 sts 0x06B0, r22 ; 0x8006b0 3a886: 70 93 b1 06 sts 0x06B1, r23 ; 0x8006b1 3a88a: 80 93 b2 06 sts 0x06B2, r24 ; 0x8006b2 3a88e: 90 93 b3 06 sts 0x06B3, r25 ; 0x8006b3 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 3a892: 40 e1 ldi r20, 0x10 ; 16 3a894: 50 e0 ldi r21, 0x00 ; 0 3a896: 61 e2 ldi r22, 0x21 ; 33 3a898: 7c e0 ldi r23, 0x0C ; 12 3a89a: 84 eb ldi r24, 0xB4 ; 180 3a89c: 96 e0 ldi r25, 0x06 ; 6 3a89e: 0f 94 79 dd call 0x3baf2 ; 0x3baf2 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 ) { 3a8a2: 8f e7 ldi r24, 0x7F ; 127 3a8a4: 9c e0 ldi r25, 0x0C ; 12 3a8a6: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 3a8aa: 0f b6 in r0, 0x3f ; 63 3a8ac: f8 94 cli 3a8ae: de bf out 0x3e, r29 ; 62 3a8b0: 0f be out 0x3f, r0 ; 63 3a8b2: cd bf out 0x3d, r28 ; 61 3a8b4: 81 30 cpi r24, 0x01 ; 1 3a8b6: b1 f4 brne .+44 ; 0x3a8e4 current_position[Z_AXIS] += Z_PAUSE_LIFT; 3a8b8: 20 e0 ldi r18, 0x00 ; 0 3a8ba: 30 e0 ldi r19, 0x00 ; 0 3a8bc: 40 ea ldi r20, 0xA0 ; 160 3a8be: 51 e4 ldi r21, 0x41 ; 65 3a8c0: 60 91 49 07 lds r22, 0x0749 ; 0x800749 3a8c4: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 3a8c8: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 3a8cc: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 3a8d0: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3a8d4: 60 93 49 07 sts 0x0749, r22 ; 0x800749 3a8d8: 70 93 4a 07 sts 0x074A, r23 ; 0x80074a 3a8dc: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 3a8e0: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c } // 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) { 3a8e4: 8f e7 ldi r24, 0x7F ; 127 3a8e6: 9c e0 ldi r25, 0x0C ; 12 3a8e8: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 3a8ec: 81 11 cpse r24, r1 3a8ee: 23 c0 rjmp .+70 ; 0x3a936 enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 3a8f0: 20 e0 ldi r18, 0x00 ; 0 3a8f2: 30 e0 ldi r19, 0x00 ; 0 3a8f4: 40 ea ldi r20, 0xA0 ; 160 3a8f6: 51 e4 ldi r21, 0x41 ; 65 3a8f8: 60 91 49 07 lds r22, 0x0749 ; 0x800749 3a8fc: 70 91 4a 07 lds r23, 0x074A ; 0x80074a 3a900: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 3a904: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 3a908: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3a90c: 9f 93 push r25 3a90e: 8f 93 push r24 3a910: 7f 93 push r23 3a912: 6f 93 push r22 3a914: 8d e8 ldi r24, 0x8D ; 141 3a916: 9c ea ldi r25, 0xAC ; 172 3a918: 9f 93 push r25 3a91a: 8f 93 push r24 3a91c: 0e 94 e1 89 call 0x113c2 ; 0x113c2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 3a920: 61 e0 ldi r22, 0x01 ; 1 3a922: 8f e7 ldi r24, 0x7F ; 127 3a924: 9c e0 ldi r25, 0x0C ; 12 3a926: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 3a92a: 0f 90 pop r0 3a92c: 0f 90 pop r0 3a92e: 0f 90 pop r0 3a930: 0f 90 pop r0 3a932: 0f 90 pop r0 3a934: 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")); 3a936: 61 e0 ldi r22, 0x01 ; 1 3a938: 85 e8 ldi r24, 0x85 ; 133 3a93a: 9c ea ldi r25, 0xAC ; 172 3a93c: 0e 94 43 89 call 0x11286 ; 0x11286 // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 3a940: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 3a944: 8f 93 push r24 3a946: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3a94a: 8f 93 push r24 3a94c: 8c e7 ldi r24, 0x7C ; 124 3a94e: 9c ea ldi r25, 0xAC ; 172 3a950: 9f 93 push r25 3a952: 8f 93 push r24 3a954: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 3a958: 80 91 6a 0e lds r24, 0x0E6A ; 0x800e6a 3a95c: 8f 93 push r24 3a95e: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 3a962: 8f 93 push r24 3a964: 83 e7 ldi r24, 0x73 ; 115 3a966: 9c ea ldi r25, 0xAC ; 172 3a968: 9f 93 push r25 3a96a: 8f 93 push r24 3a96c: 0e 94 e1 89 call 0x113c2 ; 0x113c2 //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) { 3a970: 8c e8 ldi r24, 0x8C ; 140 3a972: 9f e0 ldi r25, 0x0F ; 15 3a974: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 3a978: 0f b6 in r0, 0x3f ; 63 3a97a: f8 94 cli 3a97c: de bf out 0x3e, r29 ; 62 3a97e: 0f be out 0x3f, r0 ; 63 3a980: cd bf out 0x3d, r28 ; 61 3a982: 81 11 cpse r24, r1 3a984: 10 c0 rjmp .+32 ; 0x3a9a6 enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 3a986: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 3a98a: 8f 93 push r24 3a98c: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3a990: 8f 93 push r24 3a992: 8a e6 ldi r24, 0x6A ; 106 3a994: 9c ea ldi r25, 0xAC ; 172 3a996: 9f 93 push r25 3a998: 8f 93 push r24 3a99a: 0e 94 e1 89 call 0x113c2 ; 0x113c2 3a99e: 0f 90 pop r0 3a9a0: 0f 90 pop r0 3a9a2: 0f 90 pop r0 3a9a4: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 3a9a6: 61 e0 ldi r22, 0x01 ; 1 3a9a8: 8d e1 ldi r24, 0x1D ; 29 3a9aa: 9c e6 ldi r25, 0x6C ; 108 3a9ac: 0e 94 43 89 call 0x11286 ; 0x11286 // If not automatically recoreverd (long power loss) if(automatic == 0){ 3a9b0: a1 10 cpse r10, r1 3a9b2: 17 c0 rjmp .+46 ; 0x3a9e2 //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 3a9b4: 61 e0 ldi r22, 0x01 ; 1 3a9b6: 8f e5 ldi r24, 0x5F ; 95 3a9b8: 9c ea ldi r25, 0xAC ; 172 3a9ba: 0e 94 43 89 call 0x11286 ; 0x11286 // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 3a9be: 8f e3 ldi r24, 0x3F ; 63 3a9c0: 8f 93 push r24 3a9c2: 80 e8 ldi r24, 0x80 ; 128 3a9c4: 8f 93 push r24 3a9c6: 1f 92 push r1 3a9c8: 1f 92 push r1 3a9ca: 81 ed ldi r24, 0xD1 ; 209 3a9cc: 91 e7 ldi r25, 0x71 ; 113 3a9ce: 9f 93 push r25 3a9d0: 8f 93 push r24 3a9d2: 0e 94 e1 89 call 0x113c2 ; 0x113c2 3a9d6: 0f 90 pop r0 3a9d8: 0f 90 pop r0 3a9da: 0f 90 pop r0 3a9dc: 0f 90 pop r0 3a9de: 0f 90 pop r0 3a9e0: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 3a9e2: 8b eb ldi r24, 0xBB ; 187 3a9e4: 91 e7 ldi r25, 0x71 ; 113 3a9e6: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 gcode_M114(); 3a9ea: 0e 94 ca 79 call 0xf394 ; 0xf394 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); 3a9ee: 88 e8 ldi r24, 0x88 ; 136 3a9f0: 9f e0 ldi r25, 0x0F ; 15 3a9f2: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 3a9f6: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 3a9f8: 89 e8 ldi r24, 0x89 ; 137 3a9fa: 9f e0 ldi r25, 0x0F ; 15 3a9fc: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 3aa00: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 3aa02: 85 e3 ldi r24, 0x35 ; 53 3aa04: 9d e0 ldi r25, 0x0D ; 13 3aa06: 0f 94 97 dd call 0x3bb2e ; 0x3bb2e 3aa0a: f8 2e mov r15, r24 3aa0c: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 3aa0e: 85 e5 ldi r24, 0x55 ; 85 3aa10: 9c ea ldi r25, 0xAC ; 172 3aa12: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3aa16: b8 01 movw r22, r16 3aa18: 01 2e mov r0, r17 3aa1a: 00 0c add r0, r0 3aa1c: 88 0b sbc r24, r24 3aa1e: 99 0b sbc r25, r25 3aa20: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 3aa24: 85 e4 ldi r24, 0x45 ; 69 3aa26: 9c ea ldi r25, 0xAC ; 172 3aa28: 0e 94 d3 78 call 0xf1a6 ; 0xf1a6 MYSERIAL.println(feedmultiply_rec); 3aa2c: 8f 2d mov r24, r15 3aa2e: 9e 2d mov r25, r14 3aa30: 0f 94 11 77 call 0x2ee22 ; 0x2ee22 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3aa34: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 3aa38: 81 11 cpse r24, r1 3aa3a: 02 c0 rjmp .+4 ; 0x3aa40 { // M23 restore_file_from_sd(); 3aa3c: 0e 94 06 8a call 0x1140c ; 0x1140c } // 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)); 3aa40: 8d e9 ldi r24, 0x9D ; 157 3aa42: 9f e0 ldi r25, 0x0F ; 15 3aa44: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3aa48: c6 2e mov r12, r22 3aa4a: b7 2e mov r11, r23 3aa4c: a8 2e mov r10, r24 3aa4e: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 3aa50: 81 ea ldi r24, 0xA1 ; 161 3aa52: 9f e0 ldi r25, 0x0F ; 15 3aa54: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3aa58: 76 2e mov r7, r22 3aa5a: 67 2e mov r6, r23 3aa5c: 58 2e mov r5, r24 3aa5e: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 3aa60: 20 e0 ldi r18, 0x00 ; 0 3aa62: 30 e0 ldi r19, 0x00 ; 0 3aa64: 40 e8 ldi r20, 0x80 ; 128 3aa66: 5f eb ldi r21, 0xBF ; 191 3aa68: 6c 2d mov r22, r12 3aa6a: 7b 2d mov r23, r11 3aa6c: 8a 2d mov r24, r10 3aa6e: 99 2d mov r25, r9 3aa70: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3aa74: 88 23 and r24, r24 3aa76: 99 f0 breq .+38 ; 0x3aa9e enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 3aa78: 4f 92 push r4 3aa7a: 5f 92 push r5 3aa7c: 6f 92 push r6 3aa7e: 7f 92 push r7 3aa80: 9f 92 push r9 3aa82: af 92 push r10 3aa84: bf 92 push r11 3aa86: cf 92 push r12 3aa88: 8e e2 ldi r24, 0x2E ; 46 3aa8a: 9c ea ldi r25, 0xAC ; 172 3aa8c: 9f 93 push r25 3aa8e: 8f 93 push r24 3aa90: 0e 94 e1 89 call 0x113c2 ; 0x113c2 3aa94: 0f b6 in r0, 0x3f ; 63 3aa96: f8 94 cli 3aa98: de bf out 0x3e, r29 ; 62 3aa9a: 0f be out 0x3f, r0 ; 63 3aa9c: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 3aa9e: dd 20 and r13, r13 3aaa0: 29 f0 breq .+10 ; 0x3aaac enquecommand_P(PSTR("PRUSA MBL V1")); 3aaa2: 61 e0 ldi r22, 0x01 ; 1 3aaa4: 81 e2 ldi r24, 0x21 ; 33 3aaa6: 9c ea ldi r25, 0xAC ; 172 3aaa8: 0e 94 43 89 call 0x11286 ; 0x11286 // 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))); 3aaac: 8d e8 ldi r24, 0x8D ; 141 3aaae: 9f e0 ldi r25, 0x0F ; 15 3aab0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3aab4: 9f 93 push r25 3aab6: 8f 93 push r24 3aab8: 7f 93 push r23 3aaba: 6f 93 push r22 3aabc: 87 e1 ldi r24, 0x17 ; 23 3aabe: 9c ea ldi r25, 0xAC ; 172 3aac0: 9f 93 push r25 3aac2: 8f 93 push r24 3aac4: 0e 94 e1 89 call 0x113c2 ; 0x113c2 // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 3aac8: 81 e1 ldi r24, 0x11 ; 17 3aaca: 9d e0 ldi r25, 0x0D ; 13 3aacc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3aad0: d6 2e mov r13, r22 3aad2: c7 2e mov r12, r23 3aad4: b8 2e mov r11, r24 3aad6: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 3aad8: 8d e0 ldi r24, 0x0D ; 13 3aada: 9d e0 ldi r25, 0x0D ; 13 3aadc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3aae0: 96 2e mov r9, r22 3aae2: 77 2e mov r7, r23 3aae4: 68 2e mov r6, r24 3aae6: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 3aae8: 89 e0 ldi r24, 0x09 ; 9 3aaea: 9d e0 ldi r25, 0x0D ; 13 3aaec: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 // 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); 3aaf0: 9f 93 push r25 3aaf2: 8f 93 push r24 3aaf4: 7f 93 push r23 3aaf6: 6f 93 push r22 3aaf8: 5f 92 push r5 3aafa: 6f 92 push r6 3aafc: 7f 92 push r7 3aafe: 9f 92 push r9 3ab00: af 92 push r10 3ab02: bf 92 push r11 3ab04: cf 92 push r12 3ab06: df 92 push r13 3ab08: 8d ef ldi r24, 0xFD ; 253 3ab0a: 9b ea ldi r25, 0xAB ; 171 3ab0c: 9f 93 push r25 3ab0e: 8f 93 push r24 3ab10: 0e 94 e1 89 call 0x113c2 ; 0x113c2 // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 3ab14: 8f e3 ldi r24, 0x3F ; 63 3ab16: 8f 93 push r24 3ab18: 80 e8 ldi r24, 0x80 ; 128 3ab1a: 8f 93 push r24 3ab1c: 1f 92 push r1 3ab1e: 1f 92 push r1 3ab20: 81 ed ldi r24, 0xD1 ; 209 3ab22: 91 e7 ldi r25, 0x71 ; 113 3ab24: 9f 93 push r25 3ab26: 8f 93 push r24 3ab28: 0e 94 e1 89 call 0x113c2 ; 0x113c2 // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3ab2c: 8e e6 ldi r24, 0x6E ; 110 3ab2e: 9f e0 ldi r25, 0x0F ; 15 3ab30: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 3ab34: 9f 93 push r25 3ab36: 8f 93 push r24 3ab38: 7f 93 push r23 3ab3a: 6f 93 push r22 3ab3c: 82 ef ldi r24, 0xF2 ; 242 3ab3e: 9b ea ldi r25, 0xAB ; 171 3ab40: 9f 93 push r25 3ab42: 8f 93 push r24 3ab44: 0e 94 e1 89 call 0x113c2 ; 0x113c2 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 3ab48: 0f b6 in r0, 0x3f ; 63 3ab4a: f8 94 cli 3ab4c: de bf out 0x3e, r29 ; 62 3ab4e: 0f be out 0x3f, r0 ; 63 3ab50: cd bf out 0x3d, r28 ; 61 3ab52: 82 e7 ldi r24, 0x72 ; 114 3ab54: 9f e0 ldi r25, 0x0F ; 15 3ab56: 0f 94 89 dd call 0x3bb12 ; 0x3bb12 3ab5a: 88 23 and r24, r24 3ab5c: 29 f0 breq .+10 ; 0x3ab68 enquecommand_P(PSTR("M82")); //E axis abslute mode 3ab5e: 61 e0 ldi r22, 0x01 ; 1 3ab60: 8e ee ldi r24, 0xEE ; 238 3ab62: 9b ea ldi r25, 0xAB ; 171 3ab64: 0e 94 43 89 call 0x11286 ; 0x11286 // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 3ab68: 1f 93 push r17 3ab6a: 0f 93 push r16 3ab6c: 87 ee ldi r24, 0xE7 ; 231 3ab6e: 9b ea ldi r25, 0xAB ; 171 3ab70: 9f 93 push r25 3ab72: 8f 93 push r24 3ab74: 0e 94 e1 89 call 0x113c2 ; 0x113c2 enquecommandf_P(MSG_M220, feedmultiply_rec); 3ab78: ef 92 push r14 3ab7a: ff 92 push r15 3ab7c: 8d e9 ldi r24, 0x9D ; 157 3ab7e: 91 e7 ldi r25, 0x71 ; 113 3ab80: 9f 93 push r25 3ab82: 8f 93 push r24 3ab84: 0e 94 e1 89 call 0x113c2 ; 0x113c2 // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 3ab88: 1f 92 push r1 3ab8a: 8f 92 push r8 3ab8c: 8e ed ldi r24, 0xDE ; 222 3ab8e: 9b ea ldi r25, 0xAB ; 171 3ab90: 9f 93 push r25 3ab92: 8f 93 push r24 3ab94: 0e 94 e1 89 call 0x113c2 ; 0x113c2 // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 3ab98: 81 e9 ldi r24, 0x91 ; 145 3ab9a: 9f e0 ldi r25, 0x0F ; 15 3ab9c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3aba0: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 3aba4: 0f b6 in r0, 0x3f ; 63 3aba6: f8 94 cli 3aba8: de bf out 0x3e, r29 ; 62 3abaa: 0f be out 0x3f, r0 ; 63 3abac: cd bf out 0x3d, r28 ; 61 3abae: 21 11 cpse r18, r1 3abb0: 33 c0 rjmp .+102 ; 0x3ac18 { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 3abb2: 9f 93 push r25 3abb4: 8f 93 push r24 3abb6: 7f 93 push r23 3abb8: 6f 93 push r22 3abba: 85 ed ldi r24, 0xD5 ; 213 3abbc: 9b ea ldi r25, 0xAB ; 171 } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3abbe: 9f 93 push r25 3abc0: 8f 93 push r24 3abc2: 0e 94 e1 89 call 0x113c2 ; 0x113c2 3abc6: 0f 90 pop r0 3abc8: 0f 90 pop r0 3abca: 0f 90 pop r0 3abcc: 0f 90 pop r0 3abce: 0f 90 pop r0 3abd0: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 3abd2: 61 e0 ldi r22, 0x01 ; 1 3abd4: 85 ec ldi r24, 0xC5 ; 197 3abd6: 9b ea ldi r25, 0xAB ; 171 3abd8: 0e 94 43 89 call 0x11286 ; 0x11286 enquecommand_P(PSTR("PRUSA uvlo")); 3abdc: 61 e0 ldi r22, 0x01 ; 1 3abde: 8a eb ldi r24, 0xBA ; 186 3abe0: 9b ea ldi r25, 0xAB ; 171 3abe2: 0e 94 43 89 call 0x11286 ; 0x11286 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")); 3abe6: 86 ea ldi r24, 0xA6 ; 166 3abe8: 91 e7 ldi r25, 0x71 ; 113 3abea: 0f 94 72 dc call 0x3b8e4 ; 0x3b8e4 gcode_M114(); 3abee: 0e 94 ca 79 call 0xf394 ; 0xf394 } 3abf2: 0f 90 pop r0 3abf4: 0f 90 pop r0 3abf6: df 91 pop r29 3abf8: cf 91 pop r28 3abfa: 1f 91 pop r17 3abfc: 0f 91 pop r16 3abfe: ff 90 pop r15 3ac00: ef 90 pop r14 3ac02: df 90 pop r13 3ac04: cf 90 pop r12 3ac06: bf 90 pop r11 3ac08: af 90 pop r10 3ac0a: 9f 90 pop r9 3ac0c: 8f 90 pop r8 3ac0e: 7f 90 pop r7 3ac10: 6f 90 pop r6 3ac12: 5f 90 pop r5 3ac14: 4f 90 pop r4 3ac16: 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) 3ac18: 21 30 cpi r18, 0x01 ; 1 3ac1a: d9 f6 brne .-74 ; 0x3abd2 { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3ac1c: 9f 93 push r25 3ac1e: 8f 93 push r24 3ac20: 7f 93 push r23 3ac22: 6f 93 push r22 3ac24: 8b ec ldi r24, 0xCB ; 203 3ac26: 9b ea ldi r25, 0xAB ; 171 3ac28: ca cf rjmp .-108 ; 0x3abbe 0003ac2a : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3ac2a: 8f 92 push r8 3ac2c: 9f 92 push r9 3ac2e: af 92 push r10 3ac30: bf 92 push r11 3ac32: cf 92 push r12 3ac34: df 92 push r13 3ac36: ef 92 push r14 3ac38: ff 92 push r15 3ac3a: cf 93 push r28 3ac3c: 6b 01 movw r12, r22 3ac3e: 7c 01 movw r14, r24 3ac40: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3ac42: 20 e0 ldi r18, 0x00 ; 0 3ac44: 30 e0 ldi r19, 0x00 ; 0 3ac46: a9 01 movw r20, r18 3ac48: 0f 94 a6 df call 0x3bf4c ; 0x3bf4c <__cmpsf2> 3ac4c: 87 ff sbrs r24, 7 3ac4e: 07 c0 rjmp .+14 ; 0x3ac5e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac50: 8d e2 ldi r24, 0x2D ; 45 3ac52: 0e 94 ba 78 call 0xf174 ; 0xf174 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3ac56: f7 fa bst r15, 7 3ac58: f0 94 com r15 3ac5a: f7 f8 bld r15, 7 3ac5c: 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; 3ac6c: 20 e0 ldi r18, 0x00 ; 0 3ac6e: 30 e0 ldi r19, 0x00 ; 0 3ac70: 40 e2 ldi r20, 0x20 ; 32 3ac72: 51 e4 ldi r21, 0x41 ; 65 3ac74: 0f 94 b0 df call 0x3bf60 ; 0x3bf60 <__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; 3ac7c: 9b 01 movw r18, r22 3ac7e: ac 01 movw r20, r24 3ac80: c7 01 movw r24, r14 3ac82: b6 01 movw r22, r12 3ac84: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3ac88: 6b 01 movw r12, r22 3ac8a: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3ac8c: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 3ac90: 4b 01 movw r8, r22 3ac92: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3ac94: 4a e0 ldi r20, 0x0A ; 10 3ac96: 0f 94 78 d2 call 0x3a4f0 ; 0x3a4f0 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) 3ac9a: cc 23 and r28, r28 3ac9c: 91 f1 breq .+100 ; 0x3ad02 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; 3ac9e: c5 01 movw r24, r10 3aca0: b4 01 movw r22, r8 3aca2: 0f 94 15 d8 call 0x3b02a ; 0x3b02a <__floatunsisf> 3aca6: 9b 01 movw r18, r22 3aca8: ac 01 movw r20, r24 3acaa: c7 01 movw r24, r14 3acac: b6 01 movw r22, r12 3acae: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 3acb2: 6b 01 movw r12, r22 3acb4: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3acb6: 8e e2 ldi r24, 0x2E ; 46 3acb8: 0e 94 ba 78 call 0xf174 ; 0xf174 // 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) 3acbc: c1 50 subi r28, 0x01 ; 1 3acbe: 08 f1 brcs .+66 ; 0x3ad02 { remainder *= 10.0; 3acc0: 20 e0 ldi r18, 0x00 ; 0 3acc2: 30 e0 ldi r19, 0x00 ; 0 3acc4: 40 e2 ldi r20, 0x20 ; 32 3acc6: 51 e4 ldi r21, 0x41 ; 65 3acc8: c7 01 movw r24, r14 3acca: b6 01 movw r22, r12 3accc: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3acd0: 4b 01 movw r8, r22 3acd2: 5c 01 movw r10, r24 int toPrint = int(remainder); 3acd4: 0f 94 22 e0 call 0x3c044 ; 0x3c044 <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3acd8: 6b 01 movw r12, r22 3acda: 77 0f add r23, r23 3acdc: ee 08 sbc r14, r14 3acde: ff 08 sbc r15, r15 3ace0: c7 01 movw r24, r14 3ace2: b6 01 movw r22, r12 3ace4: 0f 94 dd d2 call 0x3a5ba ; 0x3a5ba while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3ace8: c7 01 movw r24, r14 3acea: b6 01 movw r22, r12 3acec: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3acf0: 9b 01 movw r18, r22 3acf2: ac 01 movw r20, r24 3acf4: c5 01 movw r24, r10 3acf6: b4 01 movw r22, r8 3acf8: 0f 94 b0 de call 0x3bd60 ; 0x3bd60 <__subsf3> 3acfc: 6b 01 movw r12, r22 3acfe: 7c 01 movw r14, r24 3ad00: dd cf rjmp .-70 ; 0x3acbc } } 3ad02: cf 91 pop r28 3ad04: ff 90 pop r15 3ad06: ef 90 pop r14 3ad08: df 90 pop r13 3ad0a: cf 90 pop r12 3ad0c: bf 90 pop r11 3ad0e: af 90 pop r10 3ad10: 9f 90 pop r9 3ad12: 8f 90 pop r8 3ad14: 08 95 ret 0003ad16 : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ad16: 8a e0 ldi r24, 0x0A ; 10 3ad18: 0c 94 ba 78 jmp 0xf174 ; 0xf174 0003ad1c : 3ad1c: 0e 94 37 89 call 0x1126e ; 0x1126e }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3ad20: 0d 94 8b d6 jmp 0x3ad16 ; 0x3ad16 0003ad24 : } 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) { 3ad24: 20 91 93 04 lds r18, 0x0493 ; 0x800493 3ad28: 30 91 94 04 lds r19, 0x0494 ; 0x800494 3ad2c: 80 91 91 04 lds r24, 0x0491 ; 0x800491 3ad30: 90 91 92 04 lds r25, 0x0492 ; 0x800492 3ad34: 82 17 cp r24, r18 3ad36: 93 07 cpc r25, r19 3ad38: 71 f0 breq .+28 ; 0x3ad56 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3ad3a: f9 01 movw r30, r18 3ad3c: ef 5e subi r30, 0xEF ; 239 3ad3e: fb 4f sbci r31, 0xFB ; 251 3ad40: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3ad42: 2f 5f subi r18, 0xFF ; 255 3ad44: 3f 4f sbci r19, 0xFF ; 255 3ad46: 2f 77 andi r18, 0x7F ; 127 3ad48: 33 27 eor r19, r19 3ad4a: 30 93 94 04 sts 0x0494, r19 ; 0x800494 3ad4e: 20 93 93 04 sts 0x0493, r18 ; 0x800493 return c; 3ad52: 90 e0 ldi r25, 0x00 ; 0 3ad54: 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; 3ad56: 8f ef ldi r24, 0xFF ; 255 3ad58: 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; } } 3ad5a: 08 95 ret 0003ad5c <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3ad5c: 1f 92 push r1 3ad5e: 0f 92 push r0 3ad60: 0f b6 in r0, 0x3f ; 63 3ad62: 0f 92 push r0 3ad64: 11 24 eor r1, r1 3ad66: 0b b6 in r0, 0x3b ; 59 3ad68: 0f 92 push r0 3ad6a: 2f 93 push r18 3ad6c: 3f 93 push r19 3ad6e: 4f 93 push r20 3ad70: 6f 93 push r22 3ad72: 7f 93 push r23 3ad74: 8f 93 push r24 3ad76: 9f 93 push r25 3ad78: ef 93 push r30 3ad7a: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3ad80: 84 ff sbrs r24, 4 3ad82: 12 c0 rjmp .+36 ; 0x3ada8 <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3ad84: 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 } } 3ad88: ff 91 pop r31 3ad8a: ef 91 pop r30 3ad8c: 9f 91 pop r25 3ad8e: 8f 91 pop r24 3ad90: 7f 91 pop r23 3ad92: 6f 91 pop r22 3ad94: 4f 91 pop r20 3ad96: 3f 91 pop r19 3ad98: 2f 91 pop r18 3ad9a: 0f 90 pop r0 3ad9c: 0b be out 0x3b, r0 ; 59 3ad9e: 0f 90 pop r0 3ada0: 0f be out 0x3f, r0 ; 63 3ada2: 0f 90 pop r0 3ada4: 1f 90 pop r1 3ada6: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3ada8: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3adac: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 3adb0: 81 30 cpi r24, 0x01 ; 1 3adb2: 51 f7 brne .-44 ; 0x3ad88 <__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; 3adb4: 20 91 91 04 lds r18, 0x0491 ; 0x800491 3adb8: 30 91 92 04 lds r19, 0x0492 ; 0x800492 3adbc: c9 01 movw r24, r18 3adbe: 01 96 adiw r24, 0x01 ; 1 3adc0: 8f 77 andi r24, 0x7F ; 127 3adc2: 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) { 3adc4: 60 91 93 04 lds r22, 0x0493 ; 0x800493 3adc8: 70 91 94 04 lds r23, 0x0494 ; 0x800494 3adcc: 86 17 cp r24, r22 3adce: 97 07 cpc r25, r23 3add0: d9 f2 breq .-74 ; 0x3ad88 <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3add2: 2f 5e subi r18, 0xEF ; 239 3add4: 3b 4f sbci r19, 0xFB ; 251 3add6: f9 01 movw r30, r18 3add8: 40 83 st Z, r20 rx_buffer.head = i; 3adda: 90 93 92 04 sts 0x0492, r25 ; 0x800492 3adde: 80 93 91 04 sts 0x0491, r24 ; 0x800491 3ade2: d2 cf rjmp .-92 ; 0x3ad88 <__vector_36+0x2c> 0003ade4 <__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) { 3ade4: 1f 92 push r1 3ade6: 0f 92 push r0 3ade8: 0f b6 in r0, 0x3f ; 63 3adea: 0f 92 push r0 3adec: 11 24 eor r1, r1 3adee: 0b b6 in r0, 0x3b ; 59 3adf0: 0f 92 push r0 3adf2: 2f 93 push r18 3adf4: 3f 93 push r19 3adf6: 4f 93 push r20 3adf8: 6f 93 push r22 3adfa: 7f 93 push r23 3adfc: 8f 93 push r24 3adfe: 9f 93 push r25 3ae00: ef 93 push r30 3ae02: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3ae08: 84 ff sbrs r24, 4 3ae0a: 12 c0 rjmp .+36 ; 0x3ae30 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3ae0c: 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 } } 3ae10: ff 91 pop r31 3ae12: ef 91 pop r30 3ae14: 9f 91 pop r25 3ae16: 8f 91 pop r24 3ae18: 7f 91 pop r23 3ae1a: 6f 91 pop r22 3ae1c: 4f 91 pop r20 3ae1e: 3f 91 pop r19 3ae20: 2f 91 pop r18 3ae22: 0f 90 pop r0 3ae24: 0b be out 0x3b, r0 ; 59 3ae26: 0f 90 pop r0 3ae28: 0f be out 0x3f, r0 ; 63 3ae2a: 0f 90 pop r0 3ae2c: 1f 90 pop r1 3ae2e: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3ae30: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3ae34: 80 91 1f 05 lds r24, 0x051F ; 0x80051f 3ae38: 81 11 cpse r24, r1 3ae3a: ea cf rjmp .-44 ; 0x3ae10 <__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; 3ae3c: 20 91 91 04 lds r18, 0x0491 ; 0x800491 3ae40: 30 91 92 04 lds r19, 0x0492 ; 0x800492 3ae44: c9 01 movw r24, r18 3ae46: 01 96 adiw r24, 0x01 ; 1 3ae48: 8f 77 andi r24, 0x7F ; 127 3ae4a: 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) { 3ae4c: 60 91 93 04 lds r22, 0x0493 ; 0x800493 3ae50: 70 91 94 04 lds r23, 0x0494 ; 0x800494 3ae54: 86 17 cp r24, r22 3ae56: 97 07 cpc r25, r23 3ae58: d9 f2 breq .-74 ; 0x3ae10 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ae5a: 2f 5e subi r18, 0xEF ; 239 3ae5c: 3b 4f sbci r19, 0xFB ; 251 3ae5e: f9 01 movw r30, r18 3ae60: 40 83 st Z, r20 rx_buffer.head = i; 3ae62: 90 93 92 04 sts 0x0492, r25 ; 0x800492 3ae66: 80 93 91 04 sts 0x0491, r24 ; 0x800491 3ae6a: d2 cf rjmp .-92 ; 0x3ae10 <__vector_25+0x2c> 0003ae6c : * 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) { 3ae6c: 2f 92 push r2 3ae6e: 3f 92 push r3 3ae70: 4f 92 push r4 3ae72: 5f 92 push r5 3ae74: 6f 92 push r6 3ae76: 7f 92 push r7 3ae78: 8f 92 push r8 3ae7a: 9f 92 push r9 3ae7c: af 92 push r10 3ae7e: bf 92 push r11 3ae80: cf 92 push r12 3ae82: df 92 push r13 3ae84: ef 92 push r14 3ae86: ff 92 push r15 3ae88: 0f 93 push r16 3ae8a: 1f 93 push r17 3ae8c: cf 93 push r28 3ae8e: df 93 push r29 3ae90: cd b7 in r28, 0x3d ; 61 3ae92: de b7 in r29, 0x3e ; 62 3ae94: c2 54 subi r28, 0x42 ; 66 3ae96: d1 09 sbc r29, r1 3ae98: 0f b6 in r0, 0x3f ; 63 3ae9a: f8 94 cli 3ae9c: de bf out 0x3e, r29 ; 62 3ae9e: 0f be out 0x3f, r0 ; 63 3aea0: cd bf out 0x3d, r28 ; 61 3aea2: 4c 01 movw r8, r24 3aea4: 5b 01 movw r10, r22 3aea6: 6a 01 movw r12, r20 3aea8: 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) {} 3aeaa: 19 82 std Y+1, r1 ; 0x01 3aeac: 1c 82 std Y+4, r1 ; 0x04 3aeae: 1c 8e std Y+28, r1 ; 0x1c 3aeb0: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 3aeb2: 67 2b or r22, r23 3aeb4: 21 f5 brne .+72 ; 0x3aefe sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 3aeb6: 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; 3aeb8: ce 01 movw r24, r28 3aeba: 4c 96 adiw r24, 0x1c ; 28 3aebc: 0e 94 b4 78 call 0xf168 ; 0xf168 3aec0: ce 01 movw r24, r28 3aec2: 01 96 adiw r24, 0x01 ; 1 3aec4: 0e 94 b4 78 call 0xf168 ; 0xf168 } return open(parent, dname, oflag); fail: return false; } 3aec8: 81 2f mov r24, r17 3aeca: ce 5b subi r28, 0xBE ; 190 3aecc: df 4f sbci r29, 0xFF ; 255 3aece: 0f b6 in r0, 0x3f ; 63 3aed0: f8 94 cli 3aed2: de bf out 0x3e, r29 ; 62 3aed4: 0f be out 0x3f, r0 ; 63 3aed6: cd bf out 0x3d, r28 ; 61 3aed8: df 91 pop r29 3aeda: cf 91 pop r28 3aedc: 1f 91 pop r17 3aede: 0f 91 pop r16 3aee0: ff 90 pop r15 3aee2: ef 90 pop r14 3aee4: df 90 pop r13 3aee6: cf 90 pop r12 3aee8: bf 90 pop r11 3aeea: af 90 pop r10 3aeec: 9f 90 pop r9 3aeee: 8f 90 pop r8 3aef0: 7f 90 pop r7 3aef2: 6f 90 pop r6 3aef4: 5f 90 pop r5 3aef6: 4f 90 pop r4 3aef8: 3f 90 pop r3 3aefa: 2f 90 pop r2 3aefc: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 3aefe: fc 01 movw r30, r24 3af00: 83 81 ldd r24, Z+3 ; 0x03 3af02: 81 11 cpse r24, r1 3af04: d8 cf rjmp .-80 ; 0x3aeb6 if (*path == '/') { 3af06: fa 01 movw r30, r20 3af08: 80 81 ld r24, Z 3af0a: 8f 32 cpi r24, 0x2F ; 47 3af0c: c1 f4 brne .+48 ; 0x3af3e 3af0e: ca 01 movw r24, r20 3af10: 6c 01 movw r12, r24 3af12: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 3af14: f6 01 movw r30, r12 3af16: 20 81 ld r18, Z 3af18: 2f 32 cpi r18, 0x2F ; 47 3af1a: d1 f3 breq .-12 ; 0x3af10 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; 3af1c: f5 01 movw r30, r10 3af1e: 83 81 ldd r24, Z+3 ; 0x03 3af20: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 3af22: 82 30 cpi r24, 0x02 ; 2 3af24: 60 f0 brcs .+24 ; 0x3af3e if (!dir2.openRoot(dirFile->vol_)) goto fail; 3af26: 61 8d ldd r22, Z+25 ; 0x19 3af28: 72 8d ldd r23, Z+26 ; 0x1a 3af2a: ce 01 movw r24, r28 3af2c: 4c 96 adiw r24, 0x1c ; 28 3af2e: 0f 94 1c a4 call 0x34838 ; 0x34838 parent = &dir2; 3af32: 8e 01 movw r16, r28 3af34: 04 5e subi r16, 0xE4 ; 228 3af36: 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; 3af38: 81 11 cpse r24, r1 3af3a: 02 c0 rjmp .+4 ; 0x3af40 3af3c: bc cf rjmp .-136 ; 0x3aeb6 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 3af3e: 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; 3af40: ce 01 movw r24, r28 3af42: 01 96 adiw r24, 0x01 ; 1 3af44: 7c 01 movw r14, r24 3af46: 3c 01 movw r6, r24 3af48: 2e 01 movw r4, r28 3af4a: 9c e1 ldi r25, 0x1C ; 28 3af4c: 49 0e add r4, r25 3af4e: 51 1c adc r5, r1 3af50: 23 96 adiw r28, 0x03 ; 3 3af52: ef ae std Y+63, r14 ; 0x3f 3af54: 23 97 sbiw r28, 0x03 ; 3 3af56: 2f 2c mov r2, r15 3af58: fe 01 movw r30, r28 3af5a: f7 96 adiw r30, 0x37 ; 55 3af5c: cf 01 movw r24, r30 3af5e: 0b 96 adiw r24, 0x0b ; 11 3af60: 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++] = ' '; 3af62: 20 e2 ldi r18, 0x20 ; 32 3af64: 21 93 st Z+, r18 3af66: e8 17 cp r30, r24 3af68: f9 07 cpc r31, r25 3af6a: d9 f7 brne .-10 ; 0x3af62 3af6c: 96 01 movw r18, r12 i = 0; 3af6e: 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 3af70: 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 != '/') { 3af72: d9 01 movw r26, r18 3af74: 8d 91 ld r24, X+ 3af76: 88 23 and r24, r24 3af78: 49 f1 breq .+82 ; 0x3afcc 3af7a: 8f 32 cpi r24, 0x2F ; 47 3af7c: 39 f1 breq .+78 ; 0x3afcc c = *str++; 3af7e: 28 2f mov r18, r24 if (c == '.') { 3af80: 8e 32 cpi r24, 0x2E ; 46 3af82: 39 f4 brne .+14 ; 0x3af92 if (n == 10) goto fail; // only one dot allowed 3af84: 6a 30 cpi r22, 0x0A ; 10 3af86: 09 f4 brne .+2 ; 0x3af8a 3af88: 96 cf rjmp .-212 ; 0x3aeb6 n = 10; // max index for full 8.3 name i = 8; // place for extension 3af8a: 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 3af8c: 6a e0 ldi r22, 0x0A ; 10 3af8e: 9d 01 movw r18, r26 3af90: f0 cf rjmp .-32 ; 0x3af72 3af92: eb e9 ldi r30, 0x9B ; 155 3af94: fe ea ldi r31, 0xAE ; 174 //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; 3af96: 34 91 lpm r19, Z 3af98: 33 23 and r19, r19 3af9a: 21 f0 breq .+8 ; 0x3afa4 3af9c: 31 96 adiw r30, 0x01 ; 1 3af9e: 83 13 cpse r24, r19 3afa0: fa cf rjmp .-12 ; 0x3af96 3afa2: 89 cf rjmp .-238 ; 0x3aeb6 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 3afa4: 69 17 cp r22, r25 3afa6: 08 f4 brcc .+2 ; 0x3afaa 3afa8: 86 cf rjmp .-244 ; 0x3aeb6 3afaa: 3f ed ldi r19, 0xDF ; 223 3afac: 38 0f add r19, r24 3afae: 3e 35 cpi r19, 0x5E ; 94 3afb0: 08 f0 brcs .+2 ; 0x3afb4 3afb2: 81 cf rjmp .-254 ; 0x3aeb6 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 3afb4: 3f e9 ldi r19, 0x9F ; 159 3afb6: 38 0f add r19, r24 3afb8: 3a 31 cpi r19, 0x1A ; 26 3afba: 10 f4 brcc .+4 ; 0x3afc0 3afbc: 20 ee ldi r18, 0xE0 ; 224 3afbe: 28 0f add r18, r24 3afc0: fa 01 movw r30, r20 3afc2: e9 0f add r30, r25 3afc4: f1 1d adc r31, r1 3afc6: 20 83 st Z, r18 3afc8: 9f 5f subi r25, 0xFF ; 255 3afca: e1 cf rjmp .-62 ; 0x3af8e if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 3afcc: 8f a9 ldd r24, Y+55 ; 0x37 3afce: 80 32 cpi r24, 0x20 ; 32 3afd0: 09 f4 brne .+2 ; 0x3afd4 3afd2: 71 cf rjmp .-286 ; 0x3aeb6 3afd4: 69 01 movw r12, r18 while (*path == '/') path++; 3afd6: f9 01 movw r30, r18 3afd8: 80 81 ld r24, Z 3afda: 2f 5f subi r18, 0xFF ; 255 3afdc: 3f 4f sbci r19, 0xFF ; 255 3afde: 8f 32 cpi r24, 0x2F ; 47 3afe0: c9 f3 breq .-14 ; 0x3afd4 if (!*path) break; 3afe2: 88 23 and r24, r24 3afe4: d9 f0 breq .+54 ; 0x3b01c if (!sub->open(parent, dname, O_READ)) goto fail; 3afe6: 21 e0 ldi r18, 0x01 ; 1 3afe8: b8 01 movw r22, r16 3afea: c7 01 movw r24, r14 3afec: 0f 94 69 a8 call 0x350d2 ; 0x350d2 3aff0: 88 23 and r24, r24 3aff2: 09 f4 brne .+2 ; 0x3aff6 3aff4: 60 cf rjmp .-320 ; 0x3aeb6 if (parent != dirFile) parent->close(); 3aff6: 0a 15 cp r16, r10 3aff8: 1b 05 cpc r17, r11 3affa: 19 f0 breq .+6 ; 0x3b002 3affc: c8 01 movw r24, r16 3affe: 0f 94 6c a4 call 0x348d8 ; 0x348d8 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 3b002: 94 2d mov r25, r4 3b004: 85 2d mov r24, r5 3b006: 6e 14 cp r6, r14 3b008: 7f 04 cpc r7, r15 3b00a: 21 f0 breq .+8 ; 0x3b014 3b00c: 23 96 adiw r28, 0x03 ; 3 3b00e: 9f ad ldd r25, Y+63 ; 0x3f 3b010: 23 97 sbiw r28, 0x03 ; 3 3b012: 82 2d mov r24, r2 3b014: 87 01 movw r16, r14 3b016: e9 2e mov r14, r25 3b018: f8 2e mov r15, r24 3b01a: 9e cf rjmp .-196 ; 0x3af58 } return open(parent, dname, oflag); 3b01c: 23 2d mov r18, r3 3b01e: b8 01 movw r22, r16 3b020: c4 01 movw r24, r8 3b022: 0f 94 69 a8 call 0x350d2 ; 0x350d2 3b026: 18 2f mov r17, r24 3b028: 47 cf rjmp .-370 ; 0x3aeb8 0003b02a <__floatunsisf>: 3b02a: e8 94 clt 3b02c: 09 c0 rjmp .+18 ; 0x3b040 <__floatsisf+0x12> 0003b02e <__floatsisf>: 3b02e: 97 fb bst r25, 7 3b030: 3e f4 brtc .+14 ; 0x3b040 <__floatsisf+0x12> 3b032: 90 95 com r25 3b034: 80 95 com r24 3b036: 70 95 com r23 3b038: 61 95 neg r22 3b03a: 7f 4f sbci r23, 0xFF ; 255 3b03c: 8f 4f sbci r24, 0xFF ; 255 3b03e: 9f 4f sbci r25, 0xFF ; 255 3b040: 99 23 and r25, r25 3b042: a9 f0 breq .+42 ; 0x3b06e <__floatsisf+0x40> 3b044: f9 2f mov r31, r25 3b046: 96 e9 ldi r25, 0x96 ; 150 3b048: bb 27 eor r27, r27 3b04a: 93 95 inc r25 3b04c: f6 95 lsr r31 3b04e: 87 95 ror r24 3b050: 77 95 ror r23 3b052: 67 95 ror r22 3b054: b7 95 ror r27 3b056: f1 11 cpse r31, r1 3b058: f8 cf rjmp .-16 ; 0x3b04a <__floatsisf+0x1c> 3b05a: fa f4 brpl .+62 ; 0x3b09a <__floatsisf+0x6c> 3b05c: bb 0f add r27, r27 3b05e: 11 f4 brne .+4 ; 0x3b064 <__floatsisf+0x36> 3b060: 60 ff sbrs r22, 0 3b062: 1b c0 rjmp .+54 ; 0x3b09a <__floatsisf+0x6c> 3b064: 6f 5f subi r22, 0xFF ; 255 3b066: 7f 4f sbci r23, 0xFF ; 255 3b068: 8f 4f sbci r24, 0xFF ; 255 3b06a: 9f 4f sbci r25, 0xFF ; 255 3b06c: 16 c0 rjmp .+44 ; 0x3b09a <__floatsisf+0x6c> 3b06e: 88 23 and r24, r24 3b070: 11 f0 breq .+4 ; 0x3b076 <__floatsisf+0x48> 3b072: 96 e9 ldi r25, 0x96 ; 150 3b074: 11 c0 rjmp .+34 ; 0x3b098 <__floatsisf+0x6a> 3b076: 77 23 and r23, r23 3b078: 21 f0 breq .+8 ; 0x3b082 <__floatsisf+0x54> 3b07a: 9e e8 ldi r25, 0x8E ; 142 3b07c: 87 2f mov r24, r23 3b07e: 76 2f mov r23, r22 3b080: 05 c0 rjmp .+10 ; 0x3b08c <__floatsisf+0x5e> 3b082: 66 23 and r22, r22 3b084: 71 f0 breq .+28 ; 0x3b0a2 <__floatsisf+0x74> 3b086: 96 e8 ldi r25, 0x86 ; 134 3b088: 86 2f mov r24, r22 3b08a: 70 e0 ldi r23, 0x00 ; 0 3b08c: 60 e0 ldi r22, 0x00 ; 0 3b08e: 2a f0 brmi .+10 ; 0x3b09a <__floatsisf+0x6c> 3b090: 9a 95 dec r25 3b092: 66 0f add r22, r22 3b094: 77 1f adc r23, r23 3b096: 88 1f adc r24, r24 3b098: da f7 brpl .-10 ; 0x3b090 <__floatsisf+0x62> 3b09a: 88 0f add r24, r24 3b09c: 96 95 lsr r25 3b09e: 87 95 ror r24 3b0a0: 97 f9 bld r25, 7 3b0a2: 08 95 ret 0003b0a4 : 3b0a4: 9b 01 movw r18, r22 3b0a6: ac 01 movw r20, r24 3b0a8: 0d 94 56 d8 jmp 0x3b0ac ; 0x3b0ac <__mulsf3> 0003b0ac <__mulsf3>: 3b0ac: 0f 94 69 d8 call 0x3b0d2 ; 0x3b0d2 <__mulsf3x> 3b0b0: 0d 94 da d8 jmp 0x3b1b4 ; 0x3b1b4 <__fp_round> 3b0b4: 0f 94 cc d8 call 0x3b198 ; 0x3b198 <__fp_pscA> 3b0b8: 38 f0 brcs .+14 ; 0x3b0c8 <__mulsf3+0x1c> 3b0ba: 0f 94 d3 d8 call 0x3b1a6 ; 0x3b1a6 <__fp_pscB> 3b0be: 20 f0 brcs .+8 ; 0x3b0c8 <__mulsf3+0x1c> 3b0c0: 95 23 and r25, r21 3b0c2: 11 f0 breq .+4 ; 0x3b0c8 <__mulsf3+0x1c> 3b0c4: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 3b0c8: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 3b0cc: 11 24 eor r1, r1 3b0ce: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 0003b0d2 <__mulsf3x>: 3b0d2: 0f 94 eb d8 call 0x3b1d6 ; 0x3b1d6 <__fp_split3> 3b0d6: 70 f3 brcs .-36 ; 0x3b0b4 <__mulsf3+0x8> 0003b0d8 <__mulsf3_pse>: 3b0d8: 95 9f mul r25, r21 3b0da: c1 f3 breq .-16 ; 0x3b0cc <__mulsf3+0x20> 3b0dc: 95 0f add r25, r21 3b0de: 50 e0 ldi r21, 0x00 ; 0 3b0e0: 55 1f adc r21, r21 3b0e2: 62 9f mul r22, r18 3b0e4: f0 01 movw r30, r0 3b0e6: 72 9f mul r23, r18 3b0e8: bb 27 eor r27, r27 3b0ea: f0 0d add r31, r0 3b0ec: b1 1d adc r27, r1 3b0ee: 63 9f mul r22, r19 3b0f0: aa 27 eor r26, r26 3b0f2: f0 0d add r31, r0 3b0f4: b1 1d adc r27, r1 3b0f6: aa 1f adc r26, r26 3b0f8: 64 9f mul r22, r20 3b0fa: 66 27 eor r22, r22 3b0fc: b0 0d add r27, r0 3b0fe: a1 1d adc r26, r1 3b100: 66 1f adc r22, r22 3b102: 82 9f mul r24, r18 3b104: 22 27 eor r18, r18 3b106: b0 0d add r27, r0 3b108: a1 1d adc r26, r1 3b10a: 62 1f adc r22, r18 3b10c: 73 9f mul r23, r19 3b10e: b0 0d add r27, r0 3b110: a1 1d adc r26, r1 3b112: 62 1f adc r22, r18 3b114: 83 9f mul r24, r19 3b116: a0 0d add r26, r0 3b118: 61 1d adc r22, r1 3b11a: 22 1f adc r18, r18 3b11c: 74 9f mul r23, r20 3b11e: 33 27 eor r19, r19 3b120: a0 0d add r26, r0 3b122: 61 1d adc r22, r1 3b124: 23 1f adc r18, r19 3b126: 84 9f mul r24, r20 3b128: 60 0d add r22, r0 3b12a: 21 1d adc r18, r1 3b12c: 82 2f mov r24, r18 3b12e: 76 2f mov r23, r22 3b130: 6a 2f mov r22, r26 3b132: 11 24 eor r1, r1 3b134: 9f 57 subi r25, 0x7F ; 127 3b136: 50 40 sbci r21, 0x00 ; 0 3b138: 9a f0 brmi .+38 ; 0x3b160 <__mulsf3_pse+0x88> 3b13a: f1 f0 breq .+60 ; 0x3b178 <__mulsf3_pse+0xa0> 3b13c: 88 23 and r24, r24 3b13e: 4a f0 brmi .+18 ; 0x3b152 <__mulsf3_pse+0x7a> 3b140: ee 0f add r30, r30 3b142: ff 1f adc r31, r31 3b144: bb 1f adc r27, r27 3b146: 66 1f adc r22, r22 3b148: 77 1f adc r23, r23 3b14a: 88 1f adc r24, r24 3b14c: 91 50 subi r25, 0x01 ; 1 3b14e: 50 40 sbci r21, 0x00 ; 0 3b150: a9 f7 brne .-22 ; 0x3b13c <__mulsf3_pse+0x64> 3b152: 9e 3f cpi r25, 0xFE ; 254 3b154: 51 05 cpc r21, r1 3b156: 80 f0 brcs .+32 ; 0x3b178 <__mulsf3_pse+0xa0> 3b158: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 3b15c: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 3b160: 5f 3f cpi r21, 0xFF ; 255 3b162: e4 f3 brlt .-8 ; 0x3b15c <__mulsf3_pse+0x84> 3b164: 98 3e cpi r25, 0xE8 ; 232 3b166: d4 f3 brlt .-12 ; 0x3b15c <__mulsf3_pse+0x84> 3b168: 86 95 lsr r24 3b16a: 77 95 ror r23 3b16c: 67 95 ror r22 3b16e: b7 95 ror r27 3b170: f7 95 ror r31 3b172: e7 95 ror r30 3b174: 9f 5f subi r25, 0xFF ; 255 3b176: c1 f7 brne .-16 ; 0x3b168 <__mulsf3_pse+0x90> 3b178: fe 2b or r31, r30 3b17a: 88 0f add r24, r24 3b17c: 91 1d adc r25, r1 3b17e: 96 95 lsr r25 3b180: 87 95 ror r24 3b182: 97 f9 bld r25, 7 3b184: 08 95 ret 0003b186 <__fp_inf>: 3b186: 97 f9 bld r25, 7 3b188: 9f 67 ori r25, 0x7F ; 127 3b18a: 80 e8 ldi r24, 0x80 ; 128 3b18c: 70 e0 ldi r23, 0x00 ; 0 3b18e: 60 e0 ldi r22, 0x00 ; 0 3b190: 08 95 ret 0003b192 <__fp_nan>: 3b192: 9f ef ldi r25, 0xFF ; 255 3b194: 80 ec ldi r24, 0xC0 ; 192 3b196: 08 95 ret 0003b198 <__fp_pscA>: 3b198: 00 24 eor r0, r0 3b19a: 0a 94 dec r0 3b19c: 16 16 cp r1, r22 3b19e: 17 06 cpc r1, r23 3b1a0: 18 06 cpc r1, r24 3b1a2: 09 06 cpc r0, r25 3b1a4: 08 95 ret 0003b1a6 <__fp_pscB>: 3b1a6: 00 24 eor r0, r0 3b1a8: 0a 94 dec r0 3b1aa: 12 16 cp r1, r18 3b1ac: 13 06 cpc r1, r19 3b1ae: 14 06 cpc r1, r20 3b1b0: 05 06 cpc r0, r21 3b1b2: 08 95 ret 0003b1b4 <__fp_round>: 3b1b4: 09 2e mov r0, r25 3b1b6: 03 94 inc r0 3b1b8: 00 0c add r0, r0 3b1ba: 11 f4 brne .+4 ; 0x3b1c0 <__fp_round+0xc> 3b1bc: 88 23 and r24, r24 3b1be: 52 f0 brmi .+20 ; 0x3b1d4 <__fp_round+0x20> 3b1c0: bb 0f add r27, r27 3b1c2: 40 f4 brcc .+16 ; 0x3b1d4 <__fp_round+0x20> 3b1c4: bf 2b or r27, r31 3b1c6: 11 f4 brne .+4 ; 0x3b1cc <__fp_round+0x18> 3b1c8: 60 ff sbrs r22, 0 3b1ca: 04 c0 rjmp .+8 ; 0x3b1d4 <__fp_round+0x20> 3b1cc: 6f 5f subi r22, 0xFF ; 255 3b1ce: 7f 4f sbci r23, 0xFF ; 255 3b1d0: 8f 4f sbci r24, 0xFF ; 255 3b1d2: 9f 4f sbci r25, 0xFF ; 255 3b1d4: 08 95 ret 0003b1d6 <__fp_split3>: 3b1d6: 57 fd sbrc r21, 7 3b1d8: 90 58 subi r25, 0x80 ; 128 3b1da: 44 0f add r20, r20 3b1dc: 55 1f adc r21, r21 3b1de: 59 f0 breq .+22 ; 0x3b1f6 <__fp_splitA+0x10> 3b1e0: 5f 3f cpi r21, 0xFF ; 255 3b1e2: 71 f0 breq .+28 ; 0x3b200 <__fp_splitA+0x1a> 3b1e4: 47 95 ror r20 0003b1e6 <__fp_splitA>: 3b1e6: 88 0f add r24, r24 3b1e8: 97 fb bst r25, 7 3b1ea: 99 1f adc r25, r25 3b1ec: 61 f0 breq .+24 ; 0x3b206 <__fp_splitA+0x20> 3b1ee: 9f 3f cpi r25, 0xFF ; 255 3b1f0: 79 f0 breq .+30 ; 0x3b210 <__fp_splitA+0x2a> 3b1f2: 87 95 ror r24 3b1f4: 08 95 ret 3b1f6: 12 16 cp r1, r18 3b1f8: 13 06 cpc r1, r19 3b1fa: 14 06 cpc r1, r20 3b1fc: 55 1f adc r21, r21 3b1fe: f2 cf rjmp .-28 ; 0x3b1e4 <__fp_split3+0xe> 3b200: 46 95 lsr r20 3b202: f1 df rcall .-30 ; 0x3b1e6 <__fp_splitA> 3b204: 08 c0 rjmp .+16 ; 0x3b216 <__fp_splitA+0x30> 3b206: 16 16 cp r1, r22 3b208: 17 06 cpc r1, r23 3b20a: 18 06 cpc r1, r24 3b20c: 99 1f adc r25, r25 3b20e: f1 cf rjmp .-30 ; 0x3b1f2 <__fp_splitA+0xc> 3b210: 86 95 lsr r24 3b212: 71 05 cpc r23, r1 3b214: 61 05 cpc r22, r1 3b216: 08 94 sec 3b218: 08 95 ret 0003b21a <__fp_zero>: 3b21a: e8 94 clt 0003b21c <__fp_szero>: 3b21c: bb 27 eor r27, r27 3b21e: 66 27 eor r22, r22 3b220: 77 27 eor r23, r23 3b222: cb 01 movw r24, r22 3b224: 97 f9 bld r25, 7 3b226: 08 95 ret 0003b228 : 3b228: 3f 92 push r3 3b22a: 4f 92 push r4 3b22c: 5f 92 push r5 3b22e: 6f 92 push r6 3b230: 7f 92 push r7 3b232: 8f 92 push r8 3b234: 9f 92 push r9 3b236: af 92 push r10 3b238: bf 92 push r11 3b23a: cf 92 push r12 3b23c: df 92 push r13 3b23e: ef 92 push r14 3b240: ff 92 push r15 3b242: 0f 93 push r16 3b244: 1f 93 push r17 3b246: cf 93 push r28 3b248: df 93 push r29 3b24a: 5c 01 movw r10, r24 3b24c: 6b 01 movw r12, r22 3b24e: 7a 01 movw r14, r20 3b250: 61 15 cp r22, r1 3b252: 71 05 cpc r23, r1 3b254: 19 f0 breq .+6 ; 0x3b25c 3b256: fb 01 movw r30, r22 3b258: 91 83 std Z+1, r25 ; 0x01 3b25a: 80 83 st Z, r24 3b25c: e1 14 cp r14, r1 3b25e: f1 04 cpc r15, r1 3b260: 51 f0 breq .+20 ; 0x3b276 3b262: c7 01 movw r24, r14 3b264: 02 97 sbiw r24, 0x02 ; 2 3b266: 83 97 sbiw r24, 0x23 ; 35 3b268: 30 f0 brcs .+12 ; 0x3b276 3b26a: 40 e0 ldi r20, 0x00 ; 0 3b26c: 30 e0 ldi r19, 0x00 ; 0 3b26e: 20 e0 ldi r18, 0x00 ; 0 3b270: 90 e0 ldi r25, 0x00 ; 0 3b272: 6b c0 rjmp .+214 ; 0x3b34a 3b274: 5e 01 movw r10, r28 3b276: e5 01 movw r28, r10 3b278: 21 96 adiw r28, 0x01 ; 1 3b27a: f5 01 movw r30, r10 3b27c: 10 81 ld r17, Z 3b27e: 81 2f mov r24, r17 3b280: 90 e0 ldi r25, 0x00 ; 0 3b282: 0f 94 1a db call 0x3b634 ; 0x3b634 3b286: 89 2b or r24, r25 3b288: a9 f7 brne .-22 ; 0x3b274 3b28a: 1d 32 cpi r17, 0x2D ; 45 3b28c: 01 f5 brne .+64 ; 0x3b2ce 3b28e: 21 96 adiw r28, 0x01 ; 1 3b290: f5 01 movw r30, r10 3b292: 11 81 ldd r17, Z+1 ; 0x01 3b294: 01 e0 ldi r16, 0x01 ; 1 3b296: e1 14 cp r14, r1 3b298: f1 04 cpc r15, r1 3b29a: 09 f4 brne .+2 ; 0x3b29e 3b29c: e6 c0 rjmp .+460 ; 0x3b46a 3b29e: f0 e1 ldi r31, 0x10 ; 16 3b2a0: ef 16 cp r14, r31 3b2a2: f1 04 cpc r15, r1 3b2a4: 09 f0 breq .+2 ; 0x3b2a8 3b2a6: 88 c0 rjmp .+272 ; 0x3b3b8 3b2a8: 10 33 cpi r17, 0x30 ; 48 3b2aa: 59 f4 brne .+22 ; 0x3b2c2 3b2ac: 88 81 ld r24, Y 3b2ae: 8f 7d andi r24, 0xDF ; 223 3b2b0: 88 35 cpi r24, 0x58 ; 88 3b2b2: 09 f0 breq .+2 ; 0x3b2b6 3b2b4: 7c c0 rjmp .+248 ; 0x3b3ae 3b2b6: 19 81 ldd r17, Y+1 ; 0x01 3b2b8: 22 96 adiw r28, 0x02 ; 2 3b2ba: 02 60 ori r16, 0x02 ; 2 3b2bc: f0 e1 ldi r31, 0x10 ; 16 3b2be: ef 2e mov r14, r31 3b2c0: f1 2c mov r15, r1 3b2c2: 81 2c mov r8, r1 3b2c4: 91 2c mov r9, r1 3b2c6: a1 2c mov r10, r1 3b2c8: 88 e0 ldi r24, 0x08 ; 8 3b2ca: b8 2e mov r11, r24 3b2cc: 92 c0 rjmp .+292 ; 0x3b3f2 3b2ce: 1b 32 cpi r17, 0x2B ; 43 3b2d0: 21 f4 brne .+8 ; 0x3b2da 3b2d2: e5 01 movw r28, r10 3b2d4: 22 96 adiw r28, 0x02 ; 2 3b2d6: f5 01 movw r30, r10 3b2d8: 11 81 ldd r17, Z+1 ; 0x01 3b2da: 00 e0 ldi r16, 0x00 ; 0 3b2dc: dc cf rjmp .-72 ; 0x3b296 3b2de: ea e0 ldi r30, 0x0A ; 10 3b2e0: ee 16 cp r14, r30 3b2e2: f1 04 cpc r15, r1 3b2e4: 09 f4 brne .+2 ; 0x3b2e8 3b2e6: c7 c0 rjmp .+398 ; 0x3b476 3b2e8: f0 e1 ldi r31, 0x10 ; 16 3b2ea: ef 16 cp r14, r31 3b2ec: f1 04 cpc r15, r1 3b2ee: 09 f0 breq .+2 ; 0x3b2f2 3b2f0: 73 c0 rjmp .+230 ; 0x3b3d8 3b2f2: e7 cf rjmp .-50 ; 0x3b2c2 3b2f4: 78 e0 ldi r23, 0x08 ; 8 3b2f6: e7 2e mov r14, r23 3b2f8: f1 2c mov r15, r1 3b2fa: 81 2c mov r8, r1 3b2fc: 91 2c mov r9, r1 3b2fe: a1 2c mov r10, r1 3b300: 60 e1 ldi r22, 0x10 ; 16 3b302: b6 2e mov r11, r22 3b304: 76 c0 rjmp .+236 ; 0x3b3f2 3b306: 21 e0 ldi r18, 0x01 ; 1 3b308: ad c0 rjmp .+346 ; 0x3b464 3b30a: 30 2f mov r19, r16 3b30c: 31 70 andi r19, 0x01 ; 1 3b30e: c1 14 cp r12, r1 3b310: d1 04 cpc r13, r1 3b312: 31 f0 breq .+12 ; 0x3b320 3b314: 22 23 and r18, r18 3b316: 71 f1 breq .+92 ; 0x3b374 3b318: 21 97 sbiw r28, 0x01 ; 1 3b31a: f6 01 movw r30, r12 3b31c: d1 83 std Z+1, r29 ; 0x01 3b31e: c0 83 st Z, r28 3b320: 27 ff sbrs r18, 7 3b322: 2e c0 rjmp .+92 ; 0x3b380 3b324: 60 e0 ldi r22, 0x00 ; 0 3b326: 70 e0 ldi r23, 0x00 ; 0 3b328: 80 e0 ldi r24, 0x00 ; 0 3b32a: 90 e8 ldi r25, 0x80 ; 128 3b32c: 31 11 cpse r19, r1 3b32e: 04 c0 rjmp .+8 ; 0x3b338 3b330: 6f ef ldi r22, 0xFF ; 255 3b332: 7f ef ldi r23, 0xFF ; 255 3b334: 8f ef ldi r24, 0xFF ; 255 3b336: 9f e7 ldi r25, 0x7F ; 127 3b338: 22 e2 ldi r18, 0x22 ; 34 3b33a: 30 e0 ldi r19, 0x00 ; 0 3b33c: 30 93 0c 18 sts 0x180C, r19 ; 0x80180c 3b340: 20 93 0b 18 sts 0x180B, r18 ; 0x80180b 3b344: 46 2f mov r20, r22 3b346: 37 2f mov r19, r23 3b348: 28 2f mov r18, r24 3b34a: 64 2f mov r22, r20 3b34c: 73 2f mov r23, r19 3b34e: 82 2f mov r24, r18 3b350: df 91 pop r29 3b352: cf 91 pop r28 3b354: 1f 91 pop r17 3b356: 0f 91 pop r16 3b358: ff 90 pop r15 3b35a: ef 90 pop r14 3b35c: df 90 pop r13 3b35e: cf 90 pop r12 3b360: bf 90 pop r11 3b362: af 90 pop r10 3b364: 9f 90 pop r9 3b366: 8f 90 pop r8 3b368: 7f 90 pop r7 3b36a: 6f 90 pop r6 3b36c: 5f 90 pop r5 3b36e: 4f 90 pop r4 3b370: 3f 90 pop r3 3b372: 08 95 ret 3b374: 01 ff sbrs r16, 1 3b376: 04 c0 rjmp .+8 ; 0x3b380 3b378: 22 97 sbiw r28, 0x02 ; 2 3b37a: f6 01 movw r30, r12 3b37c: d1 83 std Z+1, r29 ; 0x01 3b37e: c0 83 st Z, r28 3b380: 33 23 and r19, r19 3b382: 41 f0 breq .+16 ; 0x3b394 3b384: 90 95 com r25 3b386: 80 95 com r24 3b388: 70 95 com r23 3b38a: 61 95 neg r22 3b38c: 7f 4f sbci r23, 0xFF ; 255 3b38e: 8f 4f sbci r24, 0xFF ; 255 3b390: 9f 4f sbci r25, 0xFF ; 255 3b392: d8 cf rjmp .-80 ; 0x3b344 3b394: 97 ff sbrs r25, 7 3b396: d6 cf rjmp .-84 ; 0x3b344 3b398: 82 e2 ldi r24, 0x22 ; 34 3b39a: 90 e0 ldi r25, 0x00 ; 0 3b39c: 90 93 0c 18 sts 0x180C, r25 ; 0x80180c 3b3a0: 80 93 0b 18 sts 0x180B, r24 ; 0x80180b 3b3a4: 6f ef ldi r22, 0xFF ; 255 3b3a6: 7f ef ldi r23, 0xFF ; 255 3b3a8: 8f ef ldi r24, 0xFF ; 255 3b3aa: 9f e7 ldi r25, 0x7F ; 127 3b3ac: cb cf rjmp .-106 ; 0x3b344 3b3ae: 10 e3 ldi r17, 0x30 ; 48 3b3b0: e1 14 cp r14, r1 3b3b2: f1 04 cpc r15, r1 3b3b4: 09 f4 brne .+2 ; 0x3b3b8 3b3b6: 9e cf rjmp .-196 ; 0x3b2f4 3b3b8: 28 e0 ldi r18, 0x08 ; 8 3b3ba: e2 16 cp r14, r18 3b3bc: f1 04 cpc r15, r1 3b3be: 09 f4 brne .+2 ; 0x3b3c2 3b3c0: 9c cf rjmp .-200 ; 0x3b2fa 3b3c2: 0c f0 brlt .+2 ; 0x3b3c6 3b3c4: 8c cf rjmp .-232 ; 0x3b2de 3b3c6: 81 2c mov r8, r1 3b3c8: 91 2c mov r9, r1 3b3ca: a1 2c mov r10, r1 3b3cc: e0 e4 ldi r30, 0x40 ; 64 3b3ce: be 2e mov r11, r30 3b3d0: 82 e0 ldi r24, 0x02 ; 2 3b3d2: e8 16 cp r14, r24 3b3d4: f1 04 cpc r15, r1 3b3d6: 69 f0 breq .+26 ; 0x3b3f2 3b3d8: 60 e0 ldi r22, 0x00 ; 0 3b3da: 70 e0 ldi r23, 0x00 ; 0 3b3dc: 80 e0 ldi r24, 0x00 ; 0 3b3de: 90 e8 ldi r25, 0x80 ; 128 3b3e0: 97 01 movw r18, r14 3b3e2: 0f 2c mov r0, r15 3b3e4: 00 0c add r0, r0 3b3e6: 44 0b sbc r20, r20 3b3e8: 55 0b sbc r21, r21 3b3ea: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 3b3ee: 49 01 movw r8, r18 3b3f0: 5a 01 movw r10, r20 3b3f2: 20 e0 ldi r18, 0x00 ; 0 3b3f4: 60 e0 ldi r22, 0x00 ; 0 3b3f6: 70 e0 ldi r23, 0x00 ; 0 3b3f8: cb 01 movw r24, r22 3b3fa: 27 01 movw r4, r14 3b3fc: 0f 2c mov r0, r15 3b3fe: 00 0c add r0, r0 3b400: 66 08 sbc r6, r6 3b402: 77 08 sbc r7, r7 3b404: fe 01 movw r30, r28 3b406: 50 ed ldi r21, 0xD0 ; 208 3b408: 35 2e mov r3, r21 3b40a: 31 0e add r3, r17 3b40c: 39 e0 ldi r19, 0x09 ; 9 3b40e: 33 15 cp r19, r3 3b410: 70 f4 brcc .+28 ; 0x3b42e 3b412: 3f eb ldi r19, 0xBF ; 191 3b414: 31 0f add r19, r17 3b416: 49 ec ldi r20, 0xC9 ; 201 3b418: 34 2e mov r3, r20 3b41a: 3a 31 cpi r19, 0x1A ; 26 3b41c: 38 f0 brcs .+14 ; 0x3b42c 3b41e: 3f e9 ldi r19, 0x9F ; 159 3b420: 31 0f add r19, r17 3b422: 3a 31 cpi r19, 0x1A ; 26 3b424: 08 f0 brcs .+2 ; 0x3b428 3b426: 71 cf rjmp .-286 ; 0x3b30a 3b428: 39 ea ldi r19, 0xA9 ; 169 3b42a: 33 2e mov r3, r19 3b42c: 31 0e add r3, r17 3b42e: 3e 14 cp r3, r14 3b430: 1f 04 cpc r1, r15 3b432: 0c f0 brlt .+2 ; 0x3b436 3b434: 6a cf rjmp .-300 ; 0x3b30a 3b436: 27 fd sbrc r18, 7 3b438: 15 c0 rjmp .+42 ; 0x3b464 3b43a: 86 16 cp r8, r22 3b43c: 97 06 cpc r9, r23 3b43e: a8 06 cpc r10, r24 3b440: b9 06 cpc r11, r25 3b442: 78 f0 brcs .+30 ; 0x3b462 3b444: a3 01 movw r20, r6 3b446: 92 01 movw r18, r4 3b448: 0f 94 ec dd call 0x3bbd8 ; 0x3bbd8 <__mulsi3> 3b44c: 63 0d add r22, r3 3b44e: 71 1d adc r23, r1 3b450: 81 1d adc r24, r1 3b452: 91 1d adc r25, r1 3b454: 61 30 cpi r22, 0x01 ; 1 3b456: 71 05 cpc r23, r1 3b458: 81 05 cpc r24, r1 3b45a: 20 e8 ldi r18, 0x80 ; 128 3b45c: 92 07 cpc r25, r18 3b45e: 08 f4 brcc .+2 ; 0x3b462 3b460: 52 cf rjmp .-348 ; 0x3b306 3b462: 2f ef ldi r18, 0xFF ; 255 3b464: 21 96 adiw r28, 0x01 ; 1 3b466: 10 81 ld r17, Z 3b468: cd cf rjmp .-102 ; 0x3b404 3b46a: 10 33 cpi r17, 0x30 ; 48 3b46c: 09 f4 brne .+2 ; 0x3b470 3b46e: 1e cf rjmp .-452 ; 0x3b2ac 3b470: 2a e0 ldi r18, 0x0A ; 10 3b472: e2 2e mov r14, r18 3b474: f1 2c mov r15, r1 3b476: 9c ec ldi r25, 0xCC ; 204 3b478: 89 2e mov r8, r25 3b47a: 98 2c mov r9, r8 3b47c: a8 2c mov r10, r8 3b47e: 9c e0 ldi r25, 0x0C ; 12 3b480: b9 2e mov r11, r25 3b482: b7 cf rjmp .-146 ; 0x3b3f2 0003b484 <__ftoa_engine>: 3b484: 28 30 cpi r18, 0x08 ; 8 3b486: 08 f0 brcs .+2 ; 0x3b48a <__ftoa_engine+0x6> 3b488: 27 e0 ldi r18, 0x07 ; 7 3b48a: 33 27 eor r19, r19 3b48c: da 01 movw r26, r20 3b48e: 99 0f add r25, r25 3b490: 31 1d adc r19, r1 3b492: 87 fd sbrc r24, 7 3b494: 91 60 ori r25, 0x01 ; 1 3b496: 00 96 adiw r24, 0x00 ; 0 3b498: 61 05 cpc r22, r1 3b49a: 71 05 cpc r23, r1 3b49c: 39 f4 brne .+14 ; 0x3b4ac <__ftoa_engine+0x28> 3b49e: 32 60 ori r19, 0x02 ; 2 3b4a0: 2e 5f subi r18, 0xFE ; 254 3b4a2: 3d 93 st X+, r19 3b4a4: 30 e3 ldi r19, 0x30 ; 48 3b4a6: 2a 95 dec r18 3b4a8: e1 f7 brne .-8 ; 0x3b4a2 <__ftoa_engine+0x1e> 3b4aa: 08 95 ret 3b4ac: 9f 3f cpi r25, 0xFF ; 255 3b4ae: 30 f0 brcs .+12 ; 0x3b4bc <__ftoa_engine+0x38> 3b4b0: 80 38 cpi r24, 0x80 ; 128 3b4b2: 71 05 cpc r23, r1 3b4b4: 61 05 cpc r22, r1 3b4b6: 09 f0 breq .+2 ; 0x3b4ba <__ftoa_engine+0x36> 3b4b8: 3c 5f subi r19, 0xFC ; 252 3b4ba: 3c 5f subi r19, 0xFC ; 252 3b4bc: 3d 93 st X+, r19 3b4be: 91 30 cpi r25, 0x01 ; 1 3b4c0: 08 f0 brcs .+2 ; 0x3b4c4 <__ftoa_engine+0x40> 3b4c2: 80 68 ori r24, 0x80 ; 128 3b4c4: 91 1d adc r25, r1 3b4c6: df 93 push r29 3b4c8: cf 93 push r28 3b4ca: 1f 93 push r17 3b4cc: 0f 93 push r16 3b4ce: ff 92 push r15 3b4d0: ef 92 push r14 3b4d2: 19 2f mov r17, r25 3b4d4: 98 7f andi r25, 0xF8 ; 248 3b4d6: 96 95 lsr r25 3b4d8: e9 2f mov r30, r25 3b4da: 96 95 lsr r25 3b4dc: 96 95 lsr r25 3b4de: e9 0f add r30, r25 3b4e0: ff 27 eor r31, r31 3b4e2: e8 5b subi r30, 0xB8 ; 184 3b4e4: f8 48 sbci r31, 0x88 ; 136 3b4e6: 99 27 eor r25, r25 3b4e8: 33 27 eor r19, r19 3b4ea: ee 24 eor r14, r14 3b4ec: ff 24 eor r15, r15 3b4ee: a7 01 movw r20, r14 3b4f0: e7 01 movw r28, r14 3b4f2: 05 90 lpm r0, Z+ 3b4f4: 08 94 sec 3b4f6: 07 94 ror r0 3b4f8: 28 f4 brcc .+10 ; 0x3b504 <__ftoa_engine+0x80> 3b4fa: 36 0f add r19, r22 3b4fc: e7 1e adc r14, r23 3b4fe: f8 1e adc r15, r24 3b500: 49 1f adc r20, r25 3b502: 51 1d adc r21, r1 3b504: 66 0f add r22, r22 3b506: 77 1f adc r23, r23 3b508: 88 1f adc r24, r24 3b50a: 99 1f adc r25, r25 3b50c: 06 94 lsr r0 3b50e: a1 f7 brne .-24 ; 0x3b4f8 <__ftoa_engine+0x74> 3b510: 05 90 lpm r0, Z+ 3b512: 07 94 ror r0 3b514: 28 f4 brcc .+10 ; 0x3b520 <__ftoa_engine+0x9c> 3b516: e7 0e add r14, r23 3b518: f8 1e adc r15, r24 3b51a: 49 1f adc r20, r25 3b51c: 56 1f adc r21, r22 3b51e: c1 1d adc r28, r1 3b520: 77 0f add r23, r23 3b522: 88 1f adc r24, r24 3b524: 99 1f adc r25, r25 3b526: 66 1f adc r22, r22 3b528: 06 94 lsr r0 3b52a: a1 f7 brne .-24 ; 0x3b514 <__ftoa_engine+0x90> 3b52c: 05 90 lpm r0, Z+ 3b52e: 07 94 ror r0 3b530: 28 f4 brcc .+10 ; 0x3b53c <__ftoa_engine+0xb8> 3b532: f8 0e add r15, r24 3b534: 49 1f adc r20, r25 3b536: 56 1f adc r21, r22 3b538: c7 1f adc r28, r23 3b53a: d1 1d adc r29, r1 3b53c: 88 0f add r24, r24 3b53e: 99 1f adc r25, r25 3b540: 66 1f adc r22, r22 3b542: 77 1f adc r23, r23 3b544: 06 94 lsr r0 3b546: a1 f7 brne .-24 ; 0x3b530 <__ftoa_engine+0xac> 3b548: 05 90 lpm r0, Z+ 3b54a: 07 94 ror r0 3b54c: 20 f4 brcc .+8 ; 0x3b556 <__ftoa_engine+0xd2> 3b54e: 49 0f add r20, r25 3b550: 56 1f adc r21, r22 3b552: c7 1f adc r28, r23 3b554: d8 1f adc r29, r24 3b556: 99 0f add r25, r25 3b558: 66 1f adc r22, r22 3b55a: 77 1f adc r23, r23 3b55c: 88 1f adc r24, r24 3b55e: 06 94 lsr r0 3b560: a9 f7 brne .-22 ; 0x3b54c <__ftoa_engine+0xc8> 3b562: 84 91 lpm r24, Z 3b564: 10 95 com r17 3b566: 17 70 andi r17, 0x07 ; 7 3b568: 41 f0 breq .+16 ; 0x3b57a <__ftoa_engine+0xf6> 3b56a: d6 95 lsr r29 3b56c: c7 95 ror r28 3b56e: 57 95 ror r21 3b570: 47 95 ror r20 3b572: f7 94 ror r15 3b574: e7 94 ror r14 3b576: 1a 95 dec r17 3b578: c1 f7 brne .-16 ; 0x3b56a <__ftoa_engine+0xe6> 3b57a: ee ee ldi r30, 0xEE ; 238 3b57c: f6 e7 ldi r31, 0x76 ; 118 3b57e: 68 94 set 3b580: 15 90 lpm r1, Z+ 3b582: 15 91 lpm r17, Z+ 3b584: 35 91 lpm r19, Z+ 3b586: 65 91 lpm r22, Z+ 3b588: 95 91 lpm r25, Z+ 3b58a: 05 90 lpm r0, Z+ 3b58c: 7f e2 ldi r23, 0x2F ; 47 3b58e: 73 95 inc r23 3b590: e1 18 sub r14, r1 3b592: f1 0a sbc r15, r17 3b594: 43 0b sbc r20, r19 3b596: 56 0b sbc r21, r22 3b598: c9 0b sbc r28, r25 3b59a: d0 09 sbc r29, r0 3b59c: c0 f7 brcc .-16 ; 0x3b58e <__ftoa_engine+0x10a> 3b59e: e1 0c add r14, r1 3b5a0: f1 1e adc r15, r17 3b5a2: 43 1f adc r20, r19 3b5a4: 56 1f adc r21, r22 3b5a6: c9 1f adc r28, r25 3b5a8: d0 1d adc r29, r0 3b5aa: 7e f4 brtc .+30 ; 0x3b5ca <__ftoa_engine+0x146> 3b5ac: 70 33 cpi r23, 0x30 ; 48 3b5ae: 11 f4 brne .+4 ; 0x3b5b4 <__ftoa_engine+0x130> 3b5b0: 8a 95 dec r24 3b5b2: e6 cf rjmp .-52 ; 0x3b580 <__ftoa_engine+0xfc> 3b5b4: e8 94 clt 3b5b6: 01 50 subi r16, 0x01 ; 1 3b5b8: 30 f0 brcs .+12 ; 0x3b5c6 <__ftoa_engine+0x142> 3b5ba: 08 0f add r16, r24 3b5bc: 0a f4 brpl .+2 ; 0x3b5c0 <__ftoa_engine+0x13c> 3b5be: 00 27 eor r16, r16 3b5c0: 02 17 cp r16, r18 3b5c2: 08 f4 brcc .+2 ; 0x3b5c6 <__ftoa_engine+0x142> 3b5c4: 20 2f mov r18, r16 3b5c6: 23 95 inc r18 3b5c8: 02 2f mov r16, r18 3b5ca: 7a 33 cpi r23, 0x3A ; 58 3b5cc: 28 f0 brcs .+10 ; 0x3b5d8 <__ftoa_engine+0x154> 3b5ce: 79 e3 ldi r23, 0x39 ; 57 3b5d0: 7d 93 st X+, r23 3b5d2: 2a 95 dec r18 3b5d4: e9 f7 brne .-6 ; 0x3b5d0 <__ftoa_engine+0x14c> 3b5d6: 10 c0 rjmp .+32 ; 0x3b5f8 <__ftoa_engine+0x174> 3b5d8: 7d 93 st X+, r23 3b5da: 2a 95 dec r18 3b5dc: 89 f6 brne .-94 ; 0x3b580 <__ftoa_engine+0xfc> 3b5de: 06 94 lsr r0 3b5e0: 97 95 ror r25 3b5e2: 67 95 ror r22 3b5e4: 37 95 ror r19 3b5e6: 17 95 ror r17 3b5e8: 17 94 ror r1 3b5ea: e1 18 sub r14, r1 3b5ec: f1 0a sbc r15, r17 3b5ee: 43 0b sbc r20, r19 3b5f0: 56 0b sbc r21, r22 3b5f2: c9 0b sbc r28, r25 3b5f4: d0 09 sbc r29, r0 3b5f6: 98 f0 brcs .+38 ; 0x3b61e <__ftoa_engine+0x19a> 3b5f8: 23 95 inc r18 3b5fa: 7e 91 ld r23, -X 3b5fc: 73 95 inc r23 3b5fe: 7a 33 cpi r23, 0x3A ; 58 3b600: 08 f0 brcs .+2 ; 0x3b604 <__ftoa_engine+0x180> 3b602: 70 e3 ldi r23, 0x30 ; 48 3b604: 7c 93 st X, r23 3b606: 20 13 cpse r18, r16 3b608: b8 f7 brcc .-18 ; 0x3b5f8 <__ftoa_engine+0x174> 3b60a: 7e 91 ld r23, -X 3b60c: 70 61 ori r23, 0x10 ; 16 3b60e: 7d 93 st X+, r23 3b610: 30 f0 brcs .+12 ; 0x3b61e <__ftoa_engine+0x19a> 3b612: 83 95 inc r24 3b614: 71 e3 ldi r23, 0x31 ; 49 3b616: 7d 93 st X+, r23 3b618: 70 e3 ldi r23, 0x30 ; 48 3b61a: 2a 95 dec r18 3b61c: e1 f7 brne .-8 ; 0x3b616 <__ftoa_engine+0x192> 3b61e: 11 24 eor r1, r1 3b620: ef 90 pop r14 3b622: ff 90 pop r15 3b624: 0f 91 pop r16 3b626: 1f 91 pop r17 3b628: cf 91 pop r28 3b62a: df 91 pop r29 3b62c: 99 27 eor r25, r25 3b62e: 87 fd sbrc r24, 7 3b630: 90 95 com r25 3b632: 08 95 ret 0003b634 : 3b634: 91 11 cpse r25, r1 3b636: 0d 94 76 dd jmp 0x3baec ; 0x3baec <__ctype_isfalse> 3b63a: 80 32 cpi r24, 0x20 ; 32 3b63c: 19 f0 breq .+6 ; 0x3b644 3b63e: 89 50 subi r24, 0x09 ; 9 3b640: 85 50 subi r24, 0x05 ; 5 3b642: c8 f7 brcc .-14 ; 0x3b636 3b644: 08 95 ret 0003b646 : 3b646: fb 01 movw r30, r22 3b648: dc 01 movw r26, r24 3b64a: 02 c0 rjmp .+4 ; 0x3b650 3b64c: 05 90 lpm r0, Z+ 3b64e: 0d 92 st X+, r0 3b650: 41 50 subi r20, 0x01 ; 1 3b652: 50 40 sbci r21, 0x00 ; 0 3b654: d8 f7 brcc .-10 ; 0x3b64c 3b656: 08 95 ret 0003b658 : 3b658: fb 01 movw r30, r22 3b65a: dc 01 movw r26, r24 3b65c: 0d 90 ld r0, X+ 3b65e: 00 20 and r0, r0 3b660: e9 f7 brne .-6 ; 0x3b65c 3b662: 11 97 sbiw r26, 0x01 ; 1 3b664: 05 90 lpm r0, Z+ 3b666: 0d 92 st X+, r0 3b668: 00 20 and r0, r0 3b66a: e1 f7 brne .-8 ; 0x3b664 3b66c: 08 95 ret 0003b66e : 3b66e: fb 01 movw r30, r22 3b670: dc 01 movw r26, r24 3b672: 8d 91 ld r24, X+ 3b674: 05 90 lpm r0, Z+ 3b676: 80 19 sub r24, r0 3b678: 01 10 cpse r0, r1 3b67a: d9 f3 breq .-10 ; 0x3b672 3b67c: 99 0b sbc r25, r25 3b67e: 08 95 ret 0003b680 : 3b680: fb 01 movw r30, r22 3b682: dc 01 movw r26, r24 3b684: 05 90 lpm r0, Z+ 3b686: 0d 92 st X+, r0 3b688: 00 20 and r0, r0 3b68a: e1 f7 brne .-8 ; 0x3b684 3b68c: 08 95 ret 0003b68e <__strlen_P>: 3b68e: fc 01 movw r30, r24 3b690: 05 90 lpm r0, Z+ 3b692: 00 20 and r0, r0 3b694: e9 f7 brne .-6 ; 0x3b690 <__strlen_P+0x2> 3b696: 80 95 com r24 3b698: 90 95 com r25 3b69a: 8e 0f add r24, r30 3b69c: 9f 1f adc r25, r31 3b69e: 08 95 ret 0003b6a0 : 3b6a0: fb 01 movw r30, r22 3b6a2: dc 01 movw r26, r24 3b6a4: 41 50 subi r20, 0x01 ; 1 3b6a6: 50 40 sbci r21, 0x00 ; 0 3b6a8: 88 f0 brcs .+34 ; 0x3b6cc 3b6aa: 8d 91 ld r24, X+ 3b6ac: 81 34 cpi r24, 0x41 ; 65 3b6ae: 1c f0 brlt .+6 ; 0x3b6b6 3b6b0: 8b 35 cpi r24, 0x5B ; 91 3b6b2: 0c f4 brge .+2 ; 0x3b6b6 3b6b4: 80 5e subi r24, 0xE0 ; 224 3b6b6: 65 91 lpm r22, Z+ 3b6b8: 61 34 cpi r22, 0x41 ; 65 3b6ba: 1c f0 brlt .+6 ; 0x3b6c2 3b6bc: 6b 35 cpi r22, 0x5B ; 91 3b6be: 0c f4 brge .+2 ; 0x3b6c2 3b6c0: 60 5e subi r22, 0xE0 ; 224 3b6c2: 86 1b sub r24, r22 3b6c4: 61 11 cpse r22, r1 3b6c6: 71 f3 breq .-36 ; 0x3b6a4 3b6c8: 99 0b sbc r25, r25 3b6ca: 08 95 ret 3b6cc: 88 1b sub r24, r24 3b6ce: fc cf rjmp .-8 ; 0x3b6c8 0003b6d0 : 3b6d0: fb 01 movw r30, r22 3b6d2: dc 01 movw r26, r24 3b6d4: 41 50 subi r20, 0x01 ; 1 3b6d6: 50 40 sbci r21, 0x00 ; 0 3b6d8: 30 f0 brcs .+12 ; 0x3b6e6 3b6da: 8d 91 ld r24, X+ 3b6dc: 05 90 lpm r0, Z+ 3b6de: 80 19 sub r24, r0 3b6e0: 19 f4 brne .+6 ; 0x3b6e8 3b6e2: 00 20 and r0, r0 3b6e4: b9 f7 brne .-18 ; 0x3b6d4 3b6e6: 88 1b sub r24, r24 3b6e8: 99 0b sbc r25, r25 3b6ea: 08 95 ret 0003b6ec : 3b6ec: fb 01 movw r30, r22 3b6ee: dc 01 movw r26, r24 3b6f0: 41 50 subi r20, 0x01 ; 1 3b6f2: 50 40 sbci r21, 0x00 ; 0 3b6f4: 48 f0 brcs .+18 ; 0x3b708 3b6f6: 05 90 lpm r0, Z+ 3b6f8: 0d 92 st X+, r0 3b6fa: 00 20 and r0, r0 3b6fc: c9 f7 brne .-14 ; 0x3b6f0 3b6fe: 01 c0 rjmp .+2 ; 0x3b702 3b700: 1d 92 st X+, r1 3b702: 41 50 subi r20, 0x01 ; 1 3b704: 50 40 sbci r21, 0x00 ; 0 3b706: e0 f7 brcc .-8 ; 0x3b700 3b708: 08 95 ret 0003b70a : 3b70a: fc 01 movw r30, r24 3b70c: 05 90 lpm r0, Z+ 3b70e: 61 50 subi r22, 0x01 ; 1 3b710: 70 40 sbci r23, 0x00 ; 0 3b712: 01 10 cpse r0, r1 3b714: d8 f7 brcc .-10 ; 0x3b70c 3b716: 80 95 com r24 3b718: 90 95 com r25 3b71a: 8e 0f add r24, r30 3b71c: 9f 1f adc r25, r31 3b71e: 08 95 ret 0003b720 : 3b720: fb 01 movw r30, r22 3b722: 55 91 lpm r21, Z+ 3b724: 55 23 and r21, r21 3b726: a9 f0 breq .+42 ; 0x3b752 3b728: bf 01 movw r22, r30 3b72a: dc 01 movw r26, r24 3b72c: 4d 91 ld r20, X+ 3b72e: 45 17 cp r20, r21 3b730: 41 11 cpse r20, r1 3b732: e1 f7 brne .-8 ; 0x3b72c 3b734: 59 f4 brne .+22 ; 0x3b74c 3b736: cd 01 movw r24, r26 3b738: 05 90 lpm r0, Z+ 3b73a: 00 20 and r0, r0 3b73c: 49 f0 breq .+18 ; 0x3b750 3b73e: 4d 91 ld r20, X+ 3b740: 40 15 cp r20, r0 3b742: 41 11 cpse r20, r1 3b744: c9 f3 breq .-14 ; 0x3b738 3b746: fb 01 movw r30, r22 3b748: 41 11 cpse r20, r1 3b74a: ef cf rjmp .-34 ; 0x3b72a 3b74c: 81 e0 ldi r24, 0x01 ; 1 3b74e: 90 e0 ldi r25, 0x00 ; 0 3b750: 01 97 sbiw r24, 0x01 ; 1 3b752: 08 95 ret 0003b754 : 3b754: fc 01 movw r30, r24 3b756: 61 50 subi r22, 0x01 ; 1 3b758: 70 40 sbci r23, 0x00 ; 0 3b75a: 01 90 ld r0, Z+ 3b75c: 01 10 cpse r0, r1 3b75e: d8 f7 brcc .-10 ; 0x3b756 3b760: 80 95 com r24 3b762: 90 95 com r25 3b764: 8e 0f add r24, r30 3b766: 9f 1f adc r25, r31 3b768: 08 95 ret 0003b76a : 3b76a: cf 93 push r28 3b76c: df 93 push r29 3b76e: ec 01 movw r28, r24 3b770: 2b 81 ldd r18, Y+3 ; 0x03 3b772: 20 ff sbrs r18, 0 3b774: 1a c0 rjmp .+52 ; 0x3b7aa 3b776: 26 ff sbrs r18, 6 3b778: 0c c0 rjmp .+24 ; 0x3b792 3b77a: 2f 7b andi r18, 0xBF ; 191 3b77c: 2b 83 std Y+3, r18 ; 0x03 3b77e: 8e 81 ldd r24, Y+6 ; 0x06 3b780: 9f 81 ldd r25, Y+7 ; 0x07 3b782: 01 96 adiw r24, 0x01 ; 1 3b784: 9f 83 std Y+7, r25 ; 0x07 3b786: 8e 83 std Y+6, r24 ; 0x06 3b788: 8a 81 ldd r24, Y+2 ; 0x02 3b78a: 90 e0 ldi r25, 0x00 ; 0 3b78c: df 91 pop r29 3b78e: cf 91 pop r28 3b790: 08 95 ret 3b792: 22 ff sbrs r18, 2 3b794: 18 c0 rjmp .+48 ; 0x3b7c6 3b796: e8 81 ld r30, Y 3b798: f9 81 ldd r31, Y+1 ; 0x01 3b79a: 80 81 ld r24, Z 3b79c: 08 2e mov r0, r24 3b79e: 00 0c add r0, r0 3b7a0: 99 0b sbc r25, r25 3b7a2: 00 97 sbiw r24, 0x00 ; 0 3b7a4: 29 f4 brne .+10 ; 0x3b7b0 3b7a6: 20 62 ori r18, 0x20 ; 32 3b7a8: 2b 83 std Y+3, r18 ; 0x03 3b7aa: 8f ef ldi r24, 0xFF ; 255 3b7ac: 9f ef ldi r25, 0xFF ; 255 3b7ae: ee cf rjmp .-36 ; 0x3b78c 3b7b0: 31 96 adiw r30, 0x01 ; 1 3b7b2: f9 83 std Y+1, r31 ; 0x01 3b7b4: e8 83 st Y, r30 3b7b6: 2e 81 ldd r18, Y+6 ; 0x06 3b7b8: 3f 81 ldd r19, Y+7 ; 0x07 3b7ba: 2f 5f subi r18, 0xFF ; 255 3b7bc: 3f 4f sbci r19, 0xFF ; 255 3b7be: 3f 83 std Y+7, r19 ; 0x07 3b7c0: 2e 83 std Y+6, r18 ; 0x06 3b7c2: 99 27 eor r25, r25 3b7c4: e3 cf rjmp .-58 ; 0x3b78c 3b7c6: ea 85 ldd r30, Y+10 ; 0x0a 3b7c8: fb 85 ldd r31, Y+11 ; 0x0b 3b7ca: 19 95 eicall 3b7cc: 97 ff sbrs r25, 7 3b7ce: f3 cf rjmp .-26 ; 0x3b7b6 3b7d0: 2b 81 ldd r18, Y+3 ; 0x03 3b7d2: 01 96 adiw r24, 0x01 ; 1 3b7d4: 21 f0 breq .+8 ; 0x3b7de 3b7d6: 80 e2 ldi r24, 0x20 ; 32 3b7d8: 82 2b or r24, r18 3b7da: 8b 83 std Y+3, r24 ; 0x03 3b7dc: e6 cf rjmp .-52 ; 0x3b7aa 3b7de: 80 e1 ldi r24, 0x10 ; 16 3b7e0: fb cf rjmp .-10 ; 0x3b7d8 0003b7e2 : 3b7e2: 0f 93 push r16 3b7e4: 1f 93 push r17 3b7e6: cf 93 push r28 3b7e8: df 93 push r29 3b7ea: 18 2f mov r17, r24 3b7ec: 09 2f mov r16, r25 3b7ee: eb 01 movw r28, r22 3b7f0: 8b 81 ldd r24, Y+3 ; 0x03 3b7f2: 81 fd sbrc r24, 1 3b7f4: 09 c0 rjmp .+18 ; 0x3b808 3b7f6: 1f ef ldi r17, 0xFF ; 255 3b7f8: 0f ef ldi r16, 0xFF ; 255 3b7fa: 81 2f mov r24, r17 3b7fc: 90 2f mov r25, r16 3b7fe: df 91 pop r29 3b800: cf 91 pop r28 3b802: 1f 91 pop r17 3b804: 0f 91 pop r16 3b806: 08 95 ret 3b808: 82 ff sbrs r24, 2 3b80a: 14 c0 rjmp .+40 ; 0x3b834 3b80c: 2e 81 ldd r18, Y+6 ; 0x06 3b80e: 3f 81 ldd r19, Y+7 ; 0x07 3b810: 8c 81 ldd r24, Y+4 ; 0x04 3b812: 9d 81 ldd r25, Y+5 ; 0x05 3b814: 28 17 cp r18, r24 3b816: 39 07 cpc r19, r25 3b818: 3c f4 brge .+14 ; 0x3b828 3b81a: e8 81 ld r30, Y 3b81c: f9 81 ldd r31, Y+1 ; 0x01 3b81e: cf 01 movw r24, r30 3b820: 01 96 adiw r24, 0x01 ; 1 3b822: 99 83 std Y+1, r25 ; 0x01 3b824: 88 83 st Y, r24 3b826: 10 83 st Z, r17 3b828: 8e 81 ldd r24, Y+6 ; 0x06 3b82a: 9f 81 ldd r25, Y+7 ; 0x07 3b82c: 01 96 adiw r24, 0x01 ; 1 3b82e: 9f 83 std Y+7, r25 ; 0x07 3b830: 8e 83 std Y+6, r24 ; 0x06 3b832: e3 cf rjmp .-58 ; 0x3b7fa 3b834: e8 85 ldd r30, Y+8 ; 0x08 3b836: f9 85 ldd r31, Y+9 ; 0x09 3b838: 81 2f mov r24, r17 3b83a: 19 95 eicall 3b83c: 89 2b or r24, r25 3b83e: a1 f3 breq .-24 ; 0x3b828 3b840: da cf rjmp .-76 ; 0x3b7f6 0003b842 : 3b842: ef 92 push r14 3b844: ff 92 push r15 3b846: 0f 93 push r16 3b848: 1f 93 push r17 3b84a: cf 93 push r28 3b84c: df 93 push r29 3b84e: 8c 01 movw r16, r24 3b850: 7b 01 movw r14, r22 3b852: db 01 movw r26, r22 3b854: 13 96 adiw r26, 0x03 ; 3 3b856: 8c 91 ld r24, X 3b858: d0 e0 ldi r29, 0x00 ; 0 3b85a: c0 e0 ldi r28, 0x00 ; 0 3b85c: 81 fd sbrc r24, 1 3b85e: 0f c0 rjmp .+30 ; 0x3b87e 3b860: cf ef ldi r28, 0xFF ; 255 3b862: df ef ldi r29, 0xFF ; 255 3b864: 10 c0 rjmp .+32 ; 0x3b886 3b866: d7 01 movw r26, r14 3b868: 18 96 adiw r26, 0x08 ; 8 3b86a: ed 91 ld r30, X+ 3b86c: fc 91 ld r31, X 3b86e: b7 01 movw r22, r14 3b870: 19 95 eicall 3b872: 89 2b or r24, r25 3b874: 11 f0 breq .+4 ; 0x3b87a 3b876: cf ef ldi r28, 0xFF ; 255 3b878: df ef ldi r29, 0xFF ; 255 3b87a: 0f 5f subi r16, 0xFF ; 255 3b87c: 1f 4f sbci r17, 0xFF ; 255 3b87e: f8 01 movw r30, r16 3b880: 84 91 lpm r24, Z 3b882: 81 11 cpse r24, r1 3b884: f0 cf rjmp .-32 ; 0x3b866 3b886: ce 01 movw r24, r28 3b888: df 91 pop r29 3b88a: cf 91 pop r28 3b88c: 1f 91 pop r17 3b88e: 0f 91 pop r16 3b890: ff 90 pop r15 3b892: ef 90 pop r14 3b894: 08 95 ret 0003b896 : 3b896: 0f 93 push r16 3b898: 1f 93 push r17 3b89a: cf 93 push r28 3b89c: df 93 push r29 3b89e: cd b7 in r28, 0x3d ; 61 3b8a0: de b7 in r29, 0x3e ; 62 3b8a2: ae 01 movw r20, r28 3b8a4: 48 5f subi r20, 0xF8 ; 248 3b8a6: 5f 4f sbci r21, 0xFF ; 255 3b8a8: da 01 movw r26, r20 3b8aa: 6d 91 ld r22, X+ 3b8ac: 7d 91 ld r23, X+ 3b8ae: ad 01 movw r20, r26 3b8b0: 01 e1 ldi r16, 0x11 ; 17 3b8b2: 18 e1 ldi r17, 0x18 ; 24 3b8b4: f8 01 movw r30, r16 3b8b6: 82 81 ldd r24, Z+2 ; 0x02 3b8b8: 93 81 ldd r25, Z+3 ; 0x03 3b8ba: dc 01 movw r26, r24 3b8bc: 13 96 adiw r26, 0x03 ; 3 3b8be: 2c 91 ld r18, X 3b8c0: 13 97 sbiw r26, 0x03 ; 3 3b8c2: 28 60 ori r18, 0x08 ; 8 3b8c4: 13 96 adiw r26, 0x03 ; 3 3b8c6: 2c 93 st X, r18 3b8c8: 0e 94 87 57 call 0xaf0e ; 0xaf0e 3b8cc: d8 01 movw r26, r16 3b8ce: 12 96 adiw r26, 0x02 ; 2 3b8d0: ed 91 ld r30, X+ 3b8d2: fc 91 ld r31, X 3b8d4: 23 81 ldd r18, Z+3 ; 0x03 3b8d6: 27 7f andi r18, 0xF7 ; 247 3b8d8: 23 83 std Z+3, r18 ; 0x03 3b8da: df 91 pop r29 3b8dc: cf 91 pop r28 3b8de: 1f 91 pop r17 3b8e0: 0f 91 pop r16 3b8e2: 08 95 ret 0003b8e4 : 3b8e4: 0f 93 push r16 3b8e6: 1f 93 push r17 3b8e8: cf 93 push r28 3b8ea: df 93 push r29 3b8ec: 8c 01 movw r16, r24 3b8ee: e0 91 13 18 lds r30, 0x1813 ; 0x801813 <__iob+0x2> 3b8f2: f0 91 14 18 lds r31, 0x1814 ; 0x801814 <__iob+0x3> 3b8f6: 83 81 ldd r24, Z+3 ; 0x03 3b8f8: d0 e0 ldi r29, 0x00 ; 0 3b8fa: c0 e0 ldi r28, 0x00 ; 0 3b8fc: 81 fd sbrc r24, 1 3b8fe: 0a c0 rjmp .+20 ; 0x3b914 3b900: cf ef ldi r28, 0xFF ; 255 3b902: df ef ldi r29, 0xFF ; 255 3b904: 17 c0 rjmp .+46 ; 0x3b934 3b906: 19 95 eicall 3b908: 89 2b or r24, r25 3b90a: 11 f0 breq .+4 ; 0x3b910 3b90c: cf ef ldi r28, 0xFF ; 255 3b90e: df ef ldi r29, 0xFF ; 255 3b910: 0f 5f subi r16, 0xFF ; 255 3b912: 1f 4f sbci r17, 0xFF ; 255 3b914: f8 01 movw r30, r16 3b916: 84 91 lpm r24, Z 3b918: 60 91 13 18 lds r22, 0x1813 ; 0x801813 <__iob+0x2> 3b91c: 70 91 14 18 lds r23, 0x1814 ; 0x801814 <__iob+0x3> 3b920: db 01 movw r26, r22 3b922: 18 96 adiw r26, 0x08 ; 8 3b924: ed 91 ld r30, X+ 3b926: fc 91 ld r31, X 3b928: 81 11 cpse r24, r1 3b92a: ed cf rjmp .-38 ; 0x3b906 3b92c: 8a e0 ldi r24, 0x0A ; 10 3b92e: 19 95 eicall 3b930: 89 2b or r24, r25 3b932: 31 f7 brne .-52 ; 0x3b900 3b934: ce 01 movw r24, r28 3b936: df 91 pop r29 3b938: cf 91 pop r28 3b93a: 1f 91 pop r17 3b93c: 0f 91 pop r16 3b93e: 08 95 ret 0003b940 : 3b940: 0f 93 push r16 3b942: 1f 93 push r17 3b944: cf 93 push r28 3b946: df 93 push r29 3b948: cd b7 in r28, 0x3d ; 61 3b94a: de b7 in r29, 0x3e ; 62 3b94c: 2e 97 sbiw r28, 0x0e ; 14 3b94e: 0f b6 in r0, 0x3f ; 63 3b950: f8 94 cli 3b952: de bf out 0x3e, r29 ; 62 3b954: 0f be out 0x3f, r0 ; 63 3b956: cd bf out 0x3d, r28 ; 61 3b958: 0e 89 ldd r16, Y+22 ; 0x16 3b95a: 1f 89 ldd r17, Y+23 ; 0x17 3b95c: 8e e0 ldi r24, 0x0E ; 14 3b95e: 8c 83 std Y+4, r24 ; 0x04 3b960: 1a 83 std Y+2, r17 ; 0x02 3b962: 09 83 std Y+1, r16 ; 0x01 3b964: 8f ef ldi r24, 0xFF ; 255 3b966: 9f e7 ldi r25, 0x7F ; 127 3b968: 9e 83 std Y+6, r25 ; 0x06 3b96a: 8d 83 std Y+5, r24 ; 0x05 3b96c: ae 01 movw r20, r28 3b96e: 46 5e subi r20, 0xE6 ; 230 3b970: 5f 4f sbci r21, 0xFF ; 255 3b972: 68 8d ldd r22, Y+24 ; 0x18 3b974: 79 8d ldd r23, Y+25 ; 0x19 3b976: ce 01 movw r24, r28 3b978: 01 96 adiw r24, 0x01 ; 1 3b97a: 0e 94 87 57 call 0xaf0e ; 0xaf0e 3b97e: 2f 81 ldd r18, Y+7 ; 0x07 3b980: 38 85 ldd r19, Y+8 ; 0x08 3b982: 02 0f add r16, r18 3b984: 13 1f adc r17, r19 3b986: f8 01 movw r30, r16 3b988: 10 82 st Z, r1 3b98a: 2e 96 adiw r28, 0x0e ; 14 3b98c: 0f b6 in r0, 0x3f ; 63 3b98e: f8 94 cli 3b990: de bf out 0x3e, r29 ; 62 3b992: 0f be out 0x3f, r0 ; 63 3b994: cd bf out 0x3d, r28 ; 61 3b996: df 91 pop r29 3b998: cf 91 pop r28 3b99a: 1f 91 pop r17 3b99c: 0f 91 pop r16 3b99e: 08 95 ret 0003b9a0 : 3b9a0: cf 93 push r28 3b9a2: df 93 push r29 3b9a4: ec 01 movw r28, r24 3b9a6: 8b 81 ldd r24, Y+3 ; 0x03 3b9a8: 88 60 ori r24, 0x08 ; 8 3b9aa: 8b 83 std Y+3, r24 ; 0x03 3b9ac: ce 01 movw r24, r28 3b9ae: 0e 94 87 57 call 0xaf0e ; 0xaf0e 3b9b2: 2b 81 ldd r18, Y+3 ; 0x03 3b9b4: 27 7f andi r18, 0xF7 ; 247 3b9b6: 2b 83 std Y+3, r18 ; 0x03 3b9b8: df 91 pop r29 3b9ba: cf 91 pop r28 3b9bc: 08 95 ret 0003b9be : 3b9be: 0f 93 push r16 3b9c0: 1f 93 push r17 3b9c2: cf 93 push r28 3b9c4: df 93 push r29 3b9c6: cd b7 in r28, 0x3d ; 61 3b9c8: de b7 in r29, 0x3e ; 62 3b9ca: 2e 97 sbiw r28, 0x0e ; 14 3b9cc: 0f b6 in r0, 0x3f ; 63 3b9ce: f8 94 cli 3b9d0: de bf out 0x3e, r29 ; 62 3b9d2: 0f be out 0x3f, r0 ; 63 3b9d4: cd bf out 0x3d, r28 ; 61 3b9d6: 8c 01 movw r16, r24 3b9d8: fa 01 movw r30, r20 3b9da: 8e e0 ldi r24, 0x0E ; 14 3b9dc: 8c 83 std Y+4, r24 ; 0x04 3b9de: 1a 83 std Y+2, r17 ; 0x02 3b9e0: 09 83 std Y+1, r16 ; 0x01 3b9e2: 77 ff sbrs r23, 7 3b9e4: 02 c0 rjmp .+4 ; 0x3b9ea 3b9e6: 60 e0 ldi r22, 0x00 ; 0 3b9e8: 70 e8 ldi r23, 0x80 ; 128 3b9ea: 61 50 subi r22, 0x01 ; 1 3b9ec: 71 09 sbc r23, r1 3b9ee: 7e 83 std Y+6, r23 ; 0x06 3b9f0: 6d 83 std Y+5, r22 ; 0x05 3b9f2: a9 01 movw r20, r18 3b9f4: bf 01 movw r22, r30 3b9f6: ce 01 movw r24, r28 3b9f8: 01 96 adiw r24, 0x01 ; 1 3b9fa: 0e 94 87 57 call 0xaf0e ; 0xaf0e 3b9fe: 4d 81 ldd r20, Y+5 ; 0x05 3ba00: 5e 81 ldd r21, Y+6 ; 0x06 3ba02: 57 fd sbrc r21, 7 3ba04: 0a c0 rjmp .+20 ; 0x3ba1a 3ba06: 2f 81 ldd r18, Y+7 ; 0x07 3ba08: 38 85 ldd r19, Y+8 ; 0x08 3ba0a: 42 17 cp r20, r18 3ba0c: 53 07 cpc r21, r19 3ba0e: 0c f4 brge .+2 ; 0x3ba12 3ba10: 9a 01 movw r18, r20 3ba12: 02 0f add r16, r18 3ba14: 13 1f adc r17, r19 3ba16: f8 01 movw r30, r16 3ba18: 10 82 st Z, r1 3ba1a: 2e 96 adiw r28, 0x0e ; 14 3ba1c: 0f b6 in r0, 0x3f ; 63 3ba1e: f8 94 cli 3ba20: de bf out 0x3e, r29 ; 62 3ba22: 0f be out 0x3f, r0 ; 63 3ba24: cd bf out 0x3d, r28 ; 61 3ba26: df 91 pop r29 3ba28: cf 91 pop r28 3ba2a: 1f 91 pop r17 3ba2c: 0f 91 pop r16 3ba2e: 08 95 ret 0003ba30 <__ultoa_invert>: 3ba30: fa 01 movw r30, r20 3ba32: aa 27 eor r26, r26 3ba34: 28 30 cpi r18, 0x08 ; 8 3ba36: 51 f1 breq .+84 ; 0x3ba8c <__ultoa_invert+0x5c> 3ba38: 20 31 cpi r18, 0x10 ; 16 3ba3a: 81 f1 breq .+96 ; 0x3ba9c <__ultoa_invert+0x6c> 3ba3c: e8 94 clt 3ba3e: 6f 93 push r22 3ba40: 6e 7f andi r22, 0xFE ; 254 3ba42: 6e 5f subi r22, 0xFE ; 254 3ba44: 7f 4f sbci r23, 0xFF ; 255 3ba46: 8f 4f sbci r24, 0xFF ; 255 3ba48: 9f 4f sbci r25, 0xFF ; 255 3ba4a: af 4f sbci r26, 0xFF ; 255 3ba4c: b1 e0 ldi r27, 0x01 ; 1 3ba4e: 3e d0 rcall .+124 ; 0x3bacc <__ultoa_invert+0x9c> 3ba50: b4 e0 ldi r27, 0x04 ; 4 3ba52: 3c d0 rcall .+120 ; 0x3bacc <__ultoa_invert+0x9c> 3ba54: 67 0f add r22, r23 3ba56: 78 1f adc r23, r24 3ba58: 89 1f adc r24, r25 3ba5a: 9a 1f adc r25, r26 3ba5c: a1 1d adc r26, r1 3ba5e: 68 0f add r22, r24 3ba60: 79 1f adc r23, r25 3ba62: 8a 1f adc r24, r26 3ba64: 91 1d adc r25, r1 3ba66: a1 1d adc r26, r1 3ba68: 6a 0f add r22, r26 3ba6a: 71 1d adc r23, r1 3ba6c: 81 1d adc r24, r1 3ba6e: 91 1d adc r25, r1 3ba70: a1 1d adc r26, r1 3ba72: 20 d0 rcall .+64 ; 0x3bab4 <__ultoa_invert+0x84> 3ba74: 09 f4 brne .+2 ; 0x3ba78 <__ultoa_invert+0x48> 3ba76: 68 94 set 3ba78: 3f 91 pop r19 3ba7a: 2a e0 ldi r18, 0x0A ; 10 3ba7c: 26 9f mul r18, r22 3ba7e: 11 24 eor r1, r1 3ba80: 30 19 sub r19, r0 3ba82: 30 5d subi r19, 0xD0 ; 208 3ba84: 31 93 st Z+, r19 3ba86: de f6 brtc .-74 ; 0x3ba3e <__ultoa_invert+0xe> 3ba88: cf 01 movw r24, r30 3ba8a: 08 95 ret 3ba8c: 46 2f mov r20, r22 3ba8e: 47 70 andi r20, 0x07 ; 7 3ba90: 40 5d subi r20, 0xD0 ; 208 3ba92: 41 93 st Z+, r20 3ba94: b3 e0 ldi r27, 0x03 ; 3 3ba96: 0f d0 rcall .+30 ; 0x3bab6 <__ultoa_invert+0x86> 3ba98: c9 f7 brne .-14 ; 0x3ba8c <__ultoa_invert+0x5c> 3ba9a: f6 cf rjmp .-20 ; 0x3ba88 <__ultoa_invert+0x58> 3ba9c: 46 2f mov r20, r22 3ba9e: 4f 70 andi r20, 0x0F ; 15 3baa0: 40 5d subi r20, 0xD0 ; 208 3baa2: 4a 33 cpi r20, 0x3A ; 58 3baa4: 18 f0 brcs .+6 ; 0x3baac <__ultoa_invert+0x7c> 3baa6: 49 5d subi r20, 0xD9 ; 217 3baa8: 31 fd sbrc r19, 1 3baaa: 40 52 subi r20, 0x20 ; 32 3baac: 41 93 st Z+, r20 3baae: 02 d0 rcall .+4 ; 0x3bab4 <__ultoa_invert+0x84> 3bab0: a9 f7 brne .-22 ; 0x3ba9c <__ultoa_invert+0x6c> 3bab2: ea cf rjmp .-44 ; 0x3ba88 <__ultoa_invert+0x58> 3bab4: b4 e0 ldi r27, 0x04 ; 4 3bab6: a6 95 lsr r26 3bab8: 97 95 ror r25 3baba: 87 95 ror r24 3babc: 77 95 ror r23 3babe: 67 95 ror r22 3bac0: ba 95 dec r27 3bac2: c9 f7 brne .-14 ; 0x3bab6 <__ultoa_invert+0x86> 3bac4: 00 97 sbiw r24, 0x00 ; 0 3bac6: 61 05 cpc r22, r1 3bac8: 71 05 cpc r23, r1 3baca: 08 95 ret 3bacc: 9b 01 movw r18, r22 3bace: ac 01 movw r20, r24 3bad0: 0a 2e mov r0, r26 3bad2: 06 94 lsr r0 3bad4: 57 95 ror r21 3bad6: 47 95 ror r20 3bad8: 37 95 ror r19 3bada: 27 95 ror r18 3badc: ba 95 dec r27 3bade: c9 f7 brne .-14 ; 0x3bad2 <__ultoa_invert+0xa2> 3bae0: 62 0f add r22, r18 3bae2: 73 1f adc r23, r19 3bae4: 84 1f adc r24, r20 3bae6: 95 1f adc r25, r21 3bae8: a0 1d adc r26, r0 3baea: 08 95 ret 0003baec <__ctype_isfalse>: 3baec: 99 27 eor r25, r25 3baee: 88 27 eor r24, r24 0003baf0 <__ctype_istrue>: 3baf0: 08 95 ret 0003baf2 : 3baf2: dc 01 movw r26, r24 3baf4: cb 01 movw r24, r22 0003baf6 : 3baf6: fc 01 movw r30, r24 3baf8: f9 99 sbic 0x1f, 1 ; 31 3bafa: fe cf rjmp .-4 ; 0x3baf8 3bafc: 06 c0 rjmp .+12 ; 0x3bb0a 3bafe: f2 bd out 0x22, r31 ; 34 3bb00: e1 bd out 0x21, r30 ; 33 3bb02: f8 9a sbi 0x1f, 0 ; 31 3bb04: 31 96 adiw r30, 0x01 ; 1 3bb06: 00 b4 in r0, 0x20 ; 32 3bb08: 0d 92 st X+, r0 3bb0a: 41 50 subi r20, 0x01 ; 1 3bb0c: 50 40 sbci r21, 0x00 ; 0 3bb0e: b8 f7 brcc .-18 ; 0x3bafe 3bb10: 08 95 ret 0003bb12 : 3bb12: f9 99 sbic 0x1f, 1 ; 31 3bb14: fe cf rjmp .-4 ; 0x3bb12 3bb16: 92 bd out 0x22, r25 ; 34 3bb18: 81 bd out 0x21, r24 ; 33 3bb1a: f8 9a sbi 0x1f, 0 ; 31 3bb1c: 99 27 eor r25, r25 3bb1e: 80 b5 in r24, 0x20 ; 32 3bb20: 08 95 ret 0003bb22 : 3bb22: a6 e1 ldi r26, 0x16 ; 22 3bb24: b0 e0 ldi r27, 0x00 ; 0 3bb26: 44 e0 ldi r20, 0x04 ; 4 3bb28: 50 e0 ldi r21, 0x00 ; 0 3bb2a: 0d 94 7b dd jmp 0x3baf6 ; 0x3baf6 0003bb2e : 3bb2e: a8 e1 ldi r26, 0x18 ; 24 3bb30: b0 e0 ldi r27, 0x00 ; 0 3bb32: 42 e0 ldi r20, 0x02 ; 2 3bb34: 50 e0 ldi r21, 0x00 ; 0 3bb36: 0d 94 7b dd jmp 0x3baf6 ; 0x3baf6 0003bb3a : 3bb3a: dc 01 movw r26, r24 3bb3c: a4 0f add r26, r20 3bb3e: b5 1f adc r27, r21 3bb40: 41 50 subi r20, 0x01 ; 1 3bb42: 50 40 sbci r21, 0x00 ; 0 3bb44: 48 f0 brcs .+18 ; 0x3bb58 3bb46: cb 01 movw r24, r22 3bb48: 84 0f add r24, r20 3bb4a: 95 1f adc r25, r21 3bb4c: 2e 91 ld r18, -X 3bb4e: 0f 94 ae dd call 0x3bb5c ; 0x3bb5c 3bb52: 41 50 subi r20, 0x01 ; 1 3bb54: 50 40 sbci r21, 0x00 ; 0 3bb56: d0 f7 brcc .-12 ; 0x3bb4c 3bb58: 08 95 ret 0003bb5a : 3bb5a: 26 2f mov r18, r22 0003bb5c : 3bb5c: f9 99 sbic 0x1f, 1 ; 31 3bb5e: fe cf rjmp .-4 ; 0x3bb5c 3bb60: 92 bd out 0x22, r25 ; 34 3bb62: 81 bd out 0x21, r24 ; 33 3bb64: f8 9a sbi 0x1f, 0 ; 31 3bb66: 01 97 sbiw r24, 0x01 ; 1 3bb68: 00 b4 in r0, 0x20 ; 32 3bb6a: 02 16 cp r0, r18 3bb6c: 39 f0 breq .+14 ; 0x3bb7c 3bb6e: 1f ba out 0x1f, r1 ; 31 3bb70: 20 bd out 0x20, r18 ; 32 3bb72: 0f b6 in r0, 0x3f ; 63 3bb74: f8 94 cli 3bb76: fa 9a sbi 0x1f, 2 ; 31 3bb78: f9 9a sbi 0x1f, 1 ; 31 3bb7a: 0f be out 0x3f, r0 ; 63 3bb7c: 08 95 ret 0003bb7e : 3bb7e: 03 96 adiw r24, 0x03 ; 3 3bb80: 27 2f mov r18, r23 3bb82: 0f 94 ae dd call 0x3bb5c ; 0x3bb5c 3bb86: 0f 94 ad dd call 0x3bb5a ; 0x3bb5a 3bb8a: 25 2f mov r18, r21 3bb8c: 0f 94 ae dd call 0x3bb5c ; 0x3bb5c 3bb90: 24 2f mov r18, r20 3bb92: 0d 94 ae dd jmp 0x3bb5c ; 0x3bb5c 0003bb96 : 3bb96: 01 96 adiw r24, 0x01 ; 1 3bb98: 27 2f mov r18, r23 3bb9a: 0f 94 ae dd call 0x3bb5c ; 0x3bb5c 3bb9e: 0d 94 ad dd jmp 0x3bb5a ; 0x3bb5a 0003bba2 : 3bba2: 26 2f mov r18, r22 0003bba4 : 3bba4: f9 99 sbic 0x1f, 1 ; 31 3bba6: fe cf rjmp .-4 ; 0x3bba4 3bba8: 1f ba out 0x1f, r1 ; 31 3bbaa: 92 bd out 0x22, r25 ; 34 3bbac: 81 bd out 0x21, r24 ; 33 3bbae: 20 bd out 0x20, r18 ; 32 3bbb0: 0f b6 in r0, 0x3f ; 63 3bbb2: f8 94 cli 3bbb4: fa 9a sbi 0x1f, 2 ; 31 3bbb6: f9 9a sbi 0x1f, 1 ; 31 3bbb8: 0f be out 0x3f, r0 ; 63 3bbba: 01 96 adiw r24, 0x01 ; 1 3bbbc: 08 95 ret 0003bbbe : 3bbbe: 24 2f mov r18, r20 3bbc0: 0f 94 d2 dd call 0x3bba4 ; 0x3bba4 3bbc4: 25 2f mov r18, r21 3bbc6: 0f 94 d2 dd call 0x3bba4 ; 0x3bba4 3bbca: 0d 94 e7 dd jmp 0x3bbce ; 0x3bbce 0003bbce : 3bbce: 0f 94 d1 dd call 0x3bba2 ; 0x3bba2 3bbd2: 27 2f mov r18, r23 3bbd4: 0d 94 d2 dd jmp 0x3bba4 ; 0x3bba4 0003bbd8 <__mulsi3>: 3bbd8: db 01 movw r26, r22 3bbda: 8f 93 push r24 3bbdc: 9f 93 push r25 3bbde: 0f 94 1e de call 0x3bc3c ; 0x3bc3c <__muluhisi3> 3bbe2: bf 91 pop r27 3bbe4: af 91 pop r26 3bbe6: a2 9f mul r26, r18 3bbe8: 80 0d add r24, r0 3bbea: 91 1d adc r25, r1 3bbec: a3 9f mul r26, r19 3bbee: 90 0d add r25, r0 3bbf0: b2 9f mul r27, r18 3bbf2: 90 0d add r25, r0 3bbf4: 11 24 eor r1, r1 3bbf6: 08 95 ret 0003bbf8 <__udivmodsi4>: 3bbf8: a1 e2 ldi r26, 0x21 ; 33 3bbfa: 1a 2e mov r1, r26 3bbfc: aa 1b sub r26, r26 3bbfe: bb 1b sub r27, r27 3bc00: fd 01 movw r30, r26 3bc02: 0d c0 rjmp .+26 ; 0x3bc1e <__udivmodsi4_ep> 0003bc04 <__udivmodsi4_loop>: 3bc04: aa 1f adc r26, r26 3bc06: bb 1f adc r27, r27 3bc08: ee 1f adc r30, r30 3bc0a: ff 1f adc r31, r31 3bc0c: a2 17 cp r26, r18 3bc0e: b3 07 cpc r27, r19 3bc10: e4 07 cpc r30, r20 3bc12: f5 07 cpc r31, r21 3bc14: 20 f0 brcs .+8 ; 0x3bc1e <__udivmodsi4_ep> 3bc16: a2 1b sub r26, r18 3bc18: b3 0b sbc r27, r19 3bc1a: e4 0b sbc r30, r20 3bc1c: f5 0b sbc r31, r21 0003bc1e <__udivmodsi4_ep>: 3bc1e: 66 1f adc r22, r22 3bc20: 77 1f adc r23, r23 3bc22: 88 1f adc r24, r24 3bc24: 99 1f adc r25, r25 3bc26: 1a 94 dec r1 3bc28: 69 f7 brne .-38 ; 0x3bc04 <__udivmodsi4_loop> 3bc2a: 60 95 com r22 3bc2c: 70 95 com r23 3bc2e: 80 95 com r24 3bc30: 90 95 com r25 3bc32: 9b 01 movw r18, r22 3bc34: ac 01 movw r20, r24 3bc36: bd 01 movw r22, r26 3bc38: cf 01 movw r24, r30 3bc3a: 08 95 ret 0003bc3c <__muluhisi3>: 3bc3c: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 3bc40: a5 9f mul r26, r21 3bc42: 90 0d add r25, r0 3bc44: b4 9f mul r27, r20 3bc46: 90 0d add r25, r0 3bc48: a4 9f mul r26, r20 3bc4a: 80 0d add r24, r0 3bc4c: 91 1d adc r25, r1 3bc4e: 11 24 eor r1, r1 3bc50: 08 95 ret 0003bc52 <__umulhisi3>: 3bc52: a2 9f mul r26, r18 3bc54: b0 01 movw r22, r0 3bc56: b3 9f mul r27, r19 3bc58: c0 01 movw r24, r0 3bc5a: a3 9f mul r26, r19 3bc5c: 70 0d add r23, r0 3bc5e: 81 1d adc r24, r1 3bc60: 11 24 eor r1, r1 3bc62: 91 1d adc r25, r1 3bc64: b2 9f mul r27, r18 3bc66: 70 0d add r23, r0 3bc68: 81 1d adc r24, r1 3bc6a: 11 24 eor r1, r1 3bc6c: 91 1d adc r25, r1 3bc6e: 08 95 ret 0003bc70 <__udivmodqi4>: 3bc70: 99 1b sub r25, r25 3bc72: 79 e0 ldi r23, 0x09 ; 9 3bc74: 04 c0 rjmp .+8 ; 0x3bc7e <__udivmodqi4_ep> 0003bc76 <__udivmodqi4_loop>: 3bc76: 99 1f adc r25, r25 3bc78: 96 17 cp r25, r22 3bc7a: 08 f0 brcs .+2 ; 0x3bc7e <__udivmodqi4_ep> 3bc7c: 96 1b sub r25, r22 0003bc7e <__udivmodqi4_ep>: 3bc7e: 88 1f adc r24, r24 3bc80: 7a 95 dec r23 3bc82: c9 f7 brne .-14 ; 0x3bc76 <__udivmodqi4_loop> 3bc84: 80 95 com r24 3bc86: 08 95 ret 0003bc88 <__divmodqi4>: 3bc88: 87 fb bst r24, 7 3bc8a: 08 2e mov r0, r24 3bc8c: 06 26 eor r0, r22 3bc8e: 87 fd sbrc r24, 7 3bc90: 81 95 neg r24 3bc92: 67 fd sbrc r22, 7 3bc94: 61 95 neg r22 3bc96: 0f 94 38 de call 0x3bc70 ; 0x3bc70 <__udivmodqi4> 3bc9a: 0e f4 brtc .+2 ; 0x3bc9e <__divmodqi4_1> 3bc9c: 91 95 neg r25 0003bc9e <__divmodqi4_1>: 3bc9e: 07 fc sbrc r0, 7 3bca0: 81 95 neg r24 0003bca2 <__divmodqi4_exit>: 3bca2: 08 95 ret 0003bca4 <__udivmodhi4>: 3bca4: aa 1b sub r26, r26 3bca6: bb 1b sub r27, r27 3bca8: 51 e1 ldi r21, 0x11 ; 17 3bcaa: 07 c0 rjmp .+14 ; 0x3bcba <__udivmodhi4_ep> 0003bcac <__udivmodhi4_loop>: 3bcac: aa 1f adc r26, r26 3bcae: bb 1f adc r27, r27 3bcb0: a6 17 cp r26, r22 3bcb2: b7 07 cpc r27, r23 3bcb4: 10 f0 brcs .+4 ; 0x3bcba <__udivmodhi4_ep> 3bcb6: a6 1b sub r26, r22 3bcb8: b7 0b sbc r27, r23 0003bcba <__udivmodhi4_ep>: 3bcba: 88 1f adc r24, r24 3bcbc: 99 1f adc r25, r25 3bcbe: 5a 95 dec r21 3bcc0: a9 f7 brne .-22 ; 0x3bcac <__udivmodhi4_loop> 3bcc2: 80 95 com r24 3bcc4: 90 95 com r25 3bcc6: bc 01 movw r22, r24 3bcc8: cd 01 movw r24, r26 3bcca: 08 95 ret 0003bccc <__divmodhi4>: 3bccc: 97 fb bst r25, 7 3bcce: 07 2e mov r0, r23 3bcd0: 16 f4 brtc .+4 ; 0x3bcd6 <__divmodhi4+0xa> 3bcd2: 00 94 com r0 3bcd4: 07 d0 rcall .+14 ; 0x3bce4 <__divmodhi4_neg1> 3bcd6: 77 fd sbrc r23, 7 3bcd8: 09 d0 rcall .+18 ; 0x3bcec <__divmodhi4_neg2> 3bcda: 0f 94 52 de call 0x3bca4 ; 0x3bca4 <__udivmodhi4> 3bcde: 07 fc sbrc r0, 7 3bce0: 05 d0 rcall .+10 ; 0x3bcec <__divmodhi4_neg2> 3bce2: 3e f4 brtc .+14 ; 0x3bcf2 <__divmodhi4_exit> 0003bce4 <__divmodhi4_neg1>: 3bce4: 90 95 com r25 3bce6: 81 95 neg r24 3bce8: 9f 4f sbci r25, 0xFF ; 255 3bcea: 08 95 ret 0003bcec <__divmodhi4_neg2>: 3bcec: 70 95 com r23 3bcee: 61 95 neg r22 3bcf0: 7f 4f sbci r23, 0xFF ; 255 0003bcf2 <__divmodhi4_exit>: 3bcf2: 08 95 ret 0003bcf4 <__divmodsi4>: 3bcf4: 05 2e mov r0, r21 3bcf6: 97 fb bst r25, 7 3bcf8: 1e f4 brtc .+6 ; 0x3bd00 <__divmodsi4+0xc> 3bcfa: 00 94 com r0 3bcfc: 0f 94 91 de call 0x3bd22 ; 0x3bd22 <__negsi2> 3bd00: 57 fd sbrc r21, 7 3bd02: 07 d0 rcall .+14 ; 0x3bd12 <__divmodsi4_neg2> 3bd04: 0f 94 fc dd call 0x3bbf8 ; 0x3bbf8 <__udivmodsi4> 3bd08: 07 fc sbrc r0, 7 3bd0a: 03 d0 rcall .+6 ; 0x3bd12 <__divmodsi4_neg2> 3bd0c: 4e f4 brtc .+18 ; 0x3bd20 <__divmodsi4_exit> 3bd0e: 0d 94 91 de jmp 0x3bd22 ; 0x3bd22 <__negsi2> 0003bd12 <__divmodsi4_neg2>: 3bd12: 50 95 com r21 3bd14: 40 95 com r20 3bd16: 30 95 com r19 3bd18: 21 95 neg r18 3bd1a: 3f 4f sbci r19, 0xFF ; 255 3bd1c: 4f 4f sbci r20, 0xFF ; 255 3bd1e: 5f 4f sbci r21, 0xFF ; 255 0003bd20 <__divmodsi4_exit>: 3bd20: 08 95 ret 0003bd22 <__negsi2>: 3bd22: 90 95 com r25 3bd24: 80 95 com r24 3bd26: 70 95 com r23 3bd28: 61 95 neg r22 3bd2a: 7f 4f sbci r23, 0xFF ; 255 3bd2c: 8f 4f sbci r24, 0xFF ; 255 3bd2e: 9f 4f sbci r25, 0xFF ; 255 3bd30: 08 95 ret 0003bd32 <__tablejump2__>: 3bd32: ee 0f add r30, r30 3bd34: ff 1f adc r31, r31 3bd36: 88 1f adc r24, r24 3bd38: 8b bf out 0x3b, r24 ; 59 3bd3a: 07 90 elpm r0, Z+ 3bd3c: f6 91 elpm r31, Z 3bd3e: e0 2d mov r30, r0 3bd40: 19 94 eijmp 0003bd42 <__mulhisi3>: 3bd42: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 3bd46: 33 23 and r19, r19 3bd48: 12 f4 brpl .+4 ; 0x3bd4e <__mulhisi3+0xc> 3bd4a: 8a 1b sub r24, r26 3bd4c: 9b 0b sbc r25, r27 3bd4e: 0d 94 ab de jmp 0x3bd56 ; 0x3bd56 <__usmulhisi3_tail> 0003bd52 <__usmulhisi3>: 3bd52: 0f 94 29 de call 0x3bc52 ; 0x3bc52 <__umulhisi3> 0003bd56 <__usmulhisi3_tail>: 3bd56: b7 ff sbrs r27, 7 3bd58: 08 95 ret 3bd5a: 82 1b sub r24, r18 3bd5c: 93 0b sbc r25, r19 3bd5e: 08 95 ret 0003bd60 <__subsf3>: 3bd60: 50 58 subi r21, 0x80 ; 128 0003bd62 <__addsf3>: 3bd62: bb 27 eor r27, r27 3bd64: aa 27 eor r26, r26 3bd66: 0f 94 c8 de call 0x3bd90 ; 0x3bd90 <__addsf3x> 3bd6a: 0d 94 da d8 jmp 0x3b1b4 ; 0x3b1b4 <__fp_round> 3bd6e: 0f 94 cc d8 call 0x3b198 ; 0x3b198 <__fp_pscA> 3bd72: 38 f0 brcs .+14 ; 0x3bd82 <__addsf3+0x20> 3bd74: 0f 94 d3 d8 call 0x3b1a6 ; 0x3b1a6 <__fp_pscB> 3bd78: 20 f0 brcs .+8 ; 0x3bd82 <__addsf3+0x20> 3bd7a: 39 f4 brne .+14 ; 0x3bd8a <__addsf3+0x28> 3bd7c: 9f 3f cpi r25, 0xFF ; 255 3bd7e: 19 f4 brne .+6 ; 0x3bd86 <__addsf3+0x24> 3bd80: 26 f4 brtc .+8 ; 0x3bd8a <__addsf3+0x28> 3bd82: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 3bd86: 0e f4 brtc .+2 ; 0x3bd8a <__addsf3+0x28> 3bd88: e0 95 com r30 3bd8a: e7 fb bst r30, 7 3bd8c: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 0003bd90 <__addsf3x>: 3bd90: e9 2f mov r30, r25 3bd92: 0f 94 eb d8 call 0x3b1d6 ; 0x3b1d6 <__fp_split3> 3bd96: 58 f3 brcs .-42 ; 0x3bd6e <__addsf3+0xc> 3bd98: ba 17 cp r27, r26 3bd9a: 62 07 cpc r22, r18 3bd9c: 73 07 cpc r23, r19 3bd9e: 84 07 cpc r24, r20 3bda0: 95 07 cpc r25, r21 3bda2: 20 f0 brcs .+8 ; 0x3bdac <__addsf3x+0x1c> 3bda4: 79 f4 brne .+30 ; 0x3bdc4 <__addsf3x+0x34> 3bda6: a6 f5 brtc .+104 ; 0x3be10 <__addsf3x+0x80> 3bda8: 0d 94 0d d9 jmp 0x3b21a ; 0x3b21a <__fp_zero> 3bdac: 0e f4 brtc .+2 ; 0x3bdb0 <__addsf3x+0x20> 3bdae: e0 95 com r30 3bdb0: 0b 2e mov r0, r27 3bdb2: ba 2f mov r27, r26 3bdb4: a0 2d mov r26, r0 3bdb6: 0b 01 movw r0, r22 3bdb8: b9 01 movw r22, r18 3bdba: 90 01 movw r18, r0 3bdbc: 0c 01 movw r0, r24 3bdbe: ca 01 movw r24, r20 3bdc0: a0 01 movw r20, r0 3bdc2: 11 24 eor r1, r1 3bdc4: ff 27 eor r31, r31 3bdc6: 59 1b sub r21, r25 3bdc8: 99 f0 breq .+38 ; 0x3bdf0 <__addsf3x+0x60> 3bdca: 59 3f cpi r21, 0xF9 ; 249 3bdcc: 50 f4 brcc .+20 ; 0x3bde2 <__addsf3x+0x52> 3bdce: 50 3e cpi r21, 0xE0 ; 224 3bdd0: 68 f1 brcs .+90 ; 0x3be2c <__addsf3x+0x9c> 3bdd2: 1a 16 cp r1, r26 3bdd4: f0 40 sbci r31, 0x00 ; 0 3bdd6: a2 2f mov r26, r18 3bdd8: 23 2f mov r18, r19 3bdda: 34 2f mov r19, r20 3bddc: 44 27 eor r20, r20 3bdde: 58 5f subi r21, 0xF8 ; 248 3bde0: f3 cf rjmp .-26 ; 0x3bdc8 <__addsf3x+0x38> 3bde2: 46 95 lsr r20 3bde4: 37 95 ror r19 3bde6: 27 95 ror r18 3bde8: a7 95 ror r26 3bdea: f0 40 sbci r31, 0x00 ; 0 3bdec: 53 95 inc r21 3bdee: c9 f7 brne .-14 ; 0x3bde2 <__addsf3x+0x52> 3bdf0: 7e f4 brtc .+30 ; 0x3be10 <__addsf3x+0x80> 3bdf2: 1f 16 cp r1, r31 3bdf4: ba 0b sbc r27, r26 3bdf6: 62 0b sbc r22, r18 3bdf8: 73 0b sbc r23, r19 3bdfa: 84 0b sbc r24, r20 3bdfc: ba f0 brmi .+46 ; 0x3be2c <__addsf3x+0x9c> 3bdfe: 91 50 subi r25, 0x01 ; 1 3be00: a1 f0 breq .+40 ; 0x3be2a <__addsf3x+0x9a> 3be02: ff 0f add r31, r31 3be04: bb 1f adc r27, r27 3be06: 66 1f adc r22, r22 3be08: 77 1f adc r23, r23 3be0a: 88 1f adc r24, r24 3be0c: c2 f7 brpl .-16 ; 0x3bdfe <__addsf3x+0x6e> 3be0e: 0e c0 rjmp .+28 ; 0x3be2c <__addsf3x+0x9c> 3be10: ba 0f add r27, r26 3be12: 62 1f adc r22, r18 3be14: 73 1f adc r23, r19 3be16: 84 1f adc r24, r20 3be18: 48 f4 brcc .+18 ; 0x3be2c <__addsf3x+0x9c> 3be1a: 87 95 ror r24 3be1c: 77 95 ror r23 3be1e: 67 95 ror r22 3be20: b7 95 ror r27 3be22: f7 95 ror r31 3be24: 9e 3f cpi r25, 0xFE ; 254 3be26: 08 f0 brcs .+2 ; 0x3be2a <__addsf3x+0x9a> 3be28: b0 cf rjmp .-160 ; 0x3bd8a <__addsf3+0x28> 3be2a: 93 95 inc r25 3be2c: 88 0f add r24, r24 3be2e: 08 f0 brcs .+2 ; 0x3be32 <__addsf3x+0xa2> 3be30: 99 27 eor r25, r25 3be32: ee 0f add r30, r30 3be34: 97 95 ror r25 3be36: 87 95 ror r24 3be38: 08 95 ret 3be3a: 0f 94 cc d8 call 0x3b198 ; 0x3b198 <__fp_pscA> 3be3e: 60 f0 brcs .+24 ; 0x3be58 <__addsf3x+0xc8> 3be40: 80 e8 ldi r24, 0x80 ; 128 3be42: 91 e0 ldi r25, 0x01 ; 1 3be44: 09 f4 brne .+2 ; 0x3be48 <__addsf3x+0xb8> 3be46: 9e ef ldi r25, 0xFE ; 254 3be48: 0f 94 d3 d8 call 0x3b1a6 ; 0x3b1a6 <__fp_pscB> 3be4c: 28 f0 brcs .+10 ; 0x3be58 <__addsf3x+0xc8> 3be4e: 40 e8 ldi r20, 0x80 ; 128 3be50: 51 e0 ldi r21, 0x01 ; 1 3be52: 71 f4 brne .+28 ; 0x3be70 3be54: 5e ef ldi r21, 0xFE ; 254 3be56: 0c c0 rjmp .+24 ; 0x3be70 3be58: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 3be5c: 0d 94 0d d9 jmp 0x3b21a ; 0x3b21a <__fp_zero> 0003be60 : 3be60: e9 2f mov r30, r25 3be62: e0 78 andi r30, 0x80 ; 128 3be64: 0f 94 eb d8 call 0x3b1d6 ; 0x3b1d6 <__fp_split3> 3be68: 40 f3 brcs .-48 ; 0x3be3a <__addsf3x+0xaa> 3be6a: 09 2e mov r0, r25 3be6c: 05 2a or r0, r21 3be6e: b1 f3 breq .-20 ; 0x3be5c <__addsf3x+0xcc> 3be70: 26 17 cp r18, r22 3be72: 37 07 cpc r19, r23 3be74: 48 07 cpc r20, r24 3be76: 59 07 cpc r21, r25 3be78: 38 f0 brcs .+14 ; 0x3be88 3be7a: 0e 2e mov r0, r30 3be7c: 07 f8 bld r0, 7 3be7e: e0 25 eor r30, r0 3be80: 69 f0 breq .+26 ; 0x3be9c 3be82: e0 25 eor r30, r0 3be84: e0 64 ori r30, 0x40 ; 64 3be86: 0a c0 rjmp .+20 ; 0x3be9c 3be88: ef 63 ori r30, 0x3F ; 63 3be8a: 07 f8 bld r0, 7 3be8c: 00 94 com r0 3be8e: 07 fa bst r0, 7 3be90: db 01 movw r26, r22 3be92: b9 01 movw r22, r18 3be94: 9d 01 movw r18, r26 3be96: dc 01 movw r26, r24 3be98: ca 01 movw r24, r20 3be9a: ad 01 movw r20, r26 3be9c: ef 93 push r30 3be9e: 0f 94 c7 df call 0x3bf8e ; 0x3bf8e <__divsf3_pse> 3bea2: 0f 94 da d8 call 0x3b1b4 ; 0x3b1b4 <__fp_round> 3bea6: 0f 94 60 df call 0x3bec0 ; 0x3bec0 3beaa: 5f 91 pop r21 3beac: 55 23 and r21, r21 3beae: 39 f0 breq .+14 ; 0x3bebe 3beb0: 2b ed ldi r18, 0xDB ; 219 3beb2: 3f e0 ldi r19, 0x0F ; 15 3beb4: 49 e4 ldi r20, 0x49 ; 73 3beb6: 50 fd sbrc r21, 0 3beb8: 49 ec ldi r20, 0xC9 ; 201 3beba: 0d 94 b1 de jmp 0x3bd62 ; 0x3bd62 <__addsf3> 3bebe: 08 95 ret 0003bec0 : 3bec0: df 93 push r29 3bec2: dd 27 eor r29, r29 3bec4: b9 2f mov r27, r25 3bec6: bf 77 andi r27, 0x7F ; 127 3bec8: 40 e8 ldi r20, 0x80 ; 128 3beca: 5f e3 ldi r21, 0x3F ; 63 3becc: 16 16 cp r1, r22 3bece: 17 06 cpc r1, r23 3bed0: 48 07 cpc r20, r24 3bed2: 5b 07 cpc r21, r27 3bed4: 18 f4 brcc .+6 ; 0x3bedc 3bed6: d9 2f mov r29, r25 3bed8: 0f 94 ac e1 call 0x3c358 ; 0x3c358 3bedc: 9f 93 push r25 3bede: 8f 93 push r24 3bee0: 7f 93 push r23 3bee2: 6f 93 push r22 3bee4: 0f 94 52 d8 call 0x3b0a4 ; 0x3b0a4 3bee8: e1 ee ldi r30, 0xE1 ; 225 3beea: f1 e7 ldi r31, 0x71 ; 113 3beec: 0f 94 bc e0 call 0x3c178 ; 0x3c178 <__fp_powser> 3bef0: 0f 94 da d8 call 0x3b1b4 ; 0x3b1b4 <__fp_round> 3bef4: 2f 91 pop r18 3bef6: 3f 91 pop r19 3bef8: 4f 91 pop r20 3befa: 5f 91 pop r21 3befc: 0f 94 69 d8 call 0x3b0d2 ; 0x3b0d2 <__mulsf3x> 3bf00: dd 23 and r29, r29 3bf02: 51 f0 breq .+20 ; 0x3bf18 3bf04: 90 58 subi r25, 0x80 ; 128 3bf06: a2 ea ldi r26, 0xA2 ; 162 3bf08: 2a ed ldi r18, 0xDA ; 218 3bf0a: 3f e0 ldi r19, 0x0F ; 15 3bf0c: 49 ec ldi r20, 0xC9 ; 201 3bf0e: 5f e3 ldi r21, 0x3F ; 63 3bf10: d0 78 andi r29, 0x80 ; 128 3bf12: 5d 27 eor r21, r29 3bf14: 0f 94 c8 de call 0x3bd90 ; 0x3bd90 <__addsf3x> 3bf18: df 91 pop r29 3bf1a: 0d 94 da d8 jmp 0x3b1b4 ; 0x3b1b4 <__fp_round> 0003bf1e : 3bf1e: 0f 94 22 e1 call 0x3c244 ; 0x3c244 <__fp_trunc> 3bf22: 90 f0 brcs .+36 ; 0x3bf48 3bf24: 9f 37 cpi r25, 0x7F ; 127 3bf26: 48 f4 brcc .+18 ; 0x3bf3a 3bf28: 91 11 cpse r25, r1 3bf2a: 16 f4 brtc .+4 ; 0x3bf30 3bf2c: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 3bf30: 60 e0 ldi r22, 0x00 ; 0 3bf32: 70 e0 ldi r23, 0x00 ; 0 3bf34: 80 e8 ldi r24, 0x80 ; 128 3bf36: 9f e3 ldi r25, 0x3F ; 63 3bf38: 08 95 ret 3bf3a: 26 f0 brts .+8 ; 0x3bf44 3bf3c: 1b 16 cp r1, r27 3bf3e: 61 1d adc r22, r1 3bf40: 71 1d adc r23, r1 3bf42: 81 1d adc r24, r1 3bf44: 0d 94 93 e0 jmp 0x3c126 ; 0x3c126 <__fp_mintl> 3bf48: 0d 94 ae e0 jmp 0x3c15c ; 0x3c15c <__fp_mpack> 0003bf4c <__cmpsf2>: 3bf4c: 0f 94 6f e0 call 0x3c0de ; 0x3c0de <__fp_cmp> 3bf50: 08 f4 brcc .+2 ; 0x3bf54 <__cmpsf2+0x8> 3bf52: 81 e0 ldi r24, 0x01 ; 1 3bf54: 08 95 ret 0003bf56 : 3bf56: 0f 94 e5 e0 call 0x3c1ca ; 0x3c1ca <__fp_rempio2> 3bf5a: e3 95 inc r30 3bf5c: 0d 94 0e e1 jmp 0x3c21c ; 0x3c21c <__fp_sinus> 0003bf60 <__divsf3>: 3bf60: 0f 94 c4 df call 0x3bf88 ; 0x3bf88 <__divsf3x> 3bf64: 0d 94 da d8 jmp 0x3b1b4 ; 0x3b1b4 <__fp_round> 3bf68: 0f 94 d3 d8 call 0x3b1a6 ; 0x3b1a6 <__fp_pscB> 3bf6c: 58 f0 brcs .+22 ; 0x3bf84 <__divsf3+0x24> 3bf6e: 0f 94 cc d8 call 0x3b198 ; 0x3b198 <__fp_pscA> 3bf72: 40 f0 brcs .+16 ; 0x3bf84 <__divsf3+0x24> 3bf74: 29 f4 brne .+10 ; 0x3bf80 <__divsf3+0x20> 3bf76: 5f 3f cpi r21, 0xFF ; 255 3bf78: 29 f0 breq .+10 ; 0x3bf84 <__divsf3+0x24> 3bf7a: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 3bf7e: 51 11 cpse r21, r1 3bf80: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 3bf84: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 0003bf88 <__divsf3x>: 3bf88: 0f 94 eb d8 call 0x3b1d6 ; 0x3b1d6 <__fp_split3> 3bf8c: 68 f3 brcs .-38 ; 0x3bf68 <__divsf3+0x8> 0003bf8e <__divsf3_pse>: 3bf8e: 99 23 and r25, r25 3bf90: b1 f3 breq .-20 ; 0x3bf7e <__divsf3+0x1e> 3bf92: 55 23 and r21, r21 3bf94: 91 f3 breq .-28 ; 0x3bf7a <__divsf3+0x1a> 3bf96: 95 1b sub r25, r21 3bf98: 55 0b sbc r21, r21 3bf9a: bb 27 eor r27, r27 3bf9c: aa 27 eor r26, r26 3bf9e: 62 17 cp r22, r18 3bfa0: 73 07 cpc r23, r19 3bfa2: 84 07 cpc r24, r20 3bfa4: 38 f0 brcs .+14 ; 0x3bfb4 <__divsf3_pse+0x26> 3bfa6: 9f 5f subi r25, 0xFF ; 255 3bfa8: 5f 4f sbci r21, 0xFF ; 255 3bfaa: 22 0f add r18, r18 3bfac: 33 1f adc r19, r19 3bfae: 44 1f adc r20, r20 3bfb0: aa 1f adc r26, r26 3bfb2: a9 f3 breq .-22 ; 0x3bf9e <__divsf3_pse+0x10> 3bfb4: 35 d0 rcall .+106 ; 0x3c020 <__divsf3_pse+0x92> 3bfb6: 0e 2e mov r0, r30 3bfb8: 3a f0 brmi .+14 ; 0x3bfc8 <__divsf3_pse+0x3a> 3bfba: e0 e8 ldi r30, 0x80 ; 128 3bfbc: 32 d0 rcall .+100 ; 0x3c022 <__divsf3_pse+0x94> 3bfbe: 91 50 subi r25, 0x01 ; 1 3bfc0: 50 40 sbci r21, 0x00 ; 0 3bfc2: e6 95 lsr r30 3bfc4: 00 1c adc r0, r0 3bfc6: ca f7 brpl .-14 ; 0x3bfba <__divsf3_pse+0x2c> 3bfc8: 2b d0 rcall .+86 ; 0x3c020 <__divsf3_pse+0x92> 3bfca: fe 2f mov r31, r30 3bfcc: 29 d0 rcall .+82 ; 0x3c020 <__divsf3_pse+0x92> 3bfce: 66 0f add r22, r22 3bfd0: 77 1f adc r23, r23 3bfd2: 88 1f adc r24, r24 3bfd4: bb 1f adc r27, r27 3bfd6: 26 17 cp r18, r22 3bfd8: 37 07 cpc r19, r23 3bfda: 48 07 cpc r20, r24 3bfdc: ab 07 cpc r26, r27 3bfde: b0 e8 ldi r27, 0x80 ; 128 3bfe0: 09 f0 breq .+2 ; 0x3bfe4 <__divsf3_pse+0x56> 3bfe2: bb 0b sbc r27, r27 3bfe4: 80 2d mov r24, r0 3bfe6: bf 01 movw r22, r30 3bfe8: ff 27 eor r31, r31 3bfea: 93 58 subi r25, 0x83 ; 131 3bfec: 5f 4f sbci r21, 0xFF ; 255 3bfee: 3a f0 brmi .+14 ; 0x3bffe <__divsf3_pse+0x70> 3bff0: 9e 3f cpi r25, 0xFE ; 254 3bff2: 51 05 cpc r21, r1 3bff4: 78 f0 brcs .+30 ; 0x3c014 <__divsf3_pse+0x86> 3bff6: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 3bffa: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 3bffe: 5f 3f cpi r21, 0xFF ; 255 3c000: e4 f3 brlt .-8 ; 0x3bffa <__divsf3_pse+0x6c> 3c002: 98 3e cpi r25, 0xE8 ; 232 3c004: d4 f3 brlt .-12 ; 0x3bffa <__divsf3_pse+0x6c> 3c006: 86 95 lsr r24 3c008: 77 95 ror r23 3c00a: 67 95 ror r22 3c00c: b7 95 ror r27 3c00e: f7 95 ror r31 3c010: 9f 5f subi r25, 0xFF ; 255 3c012: c9 f7 brne .-14 ; 0x3c006 <__divsf3_pse+0x78> 3c014: 88 0f add r24, r24 3c016: 91 1d adc r25, r1 3c018: 96 95 lsr r25 3c01a: 87 95 ror r24 3c01c: 97 f9 bld r25, 7 3c01e: 08 95 ret 3c020: e1 e0 ldi r30, 0x01 ; 1 3c022: 66 0f add r22, r22 3c024: 77 1f adc r23, r23 3c026: 88 1f adc r24, r24 3c028: bb 1f adc r27, r27 3c02a: 62 17 cp r22, r18 3c02c: 73 07 cpc r23, r19 3c02e: 84 07 cpc r24, r20 3c030: ba 07 cpc r27, r26 3c032: 20 f0 brcs .+8 ; 0x3c03c <__divsf3_pse+0xae> 3c034: 62 1b sub r22, r18 3c036: 73 0b sbc r23, r19 3c038: 84 0b sbc r24, r20 3c03a: ba 0b sbc r27, r26 3c03c: ee 1f adc r30, r30 3c03e: 88 f7 brcc .-30 ; 0x3c022 <__divsf3_pse+0x94> 3c040: e0 95 com r30 3c042: 08 95 ret 0003c044 <__fixsfsi>: 3c044: 0f 94 29 e0 call 0x3c052 ; 0x3c052 <__fixunssfsi> 3c048: 68 94 set 3c04a: b1 11 cpse r27, r1 3c04c: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 3c050: 08 95 ret 0003c052 <__fixunssfsi>: 3c052: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_splitA> 3c056: 88 f0 brcs .+34 ; 0x3c07a <__fixunssfsi+0x28> 3c058: 9f 57 subi r25, 0x7F ; 127 3c05a: 98 f0 brcs .+38 ; 0x3c082 <__fixunssfsi+0x30> 3c05c: b9 2f mov r27, r25 3c05e: 99 27 eor r25, r25 3c060: b7 51 subi r27, 0x17 ; 23 3c062: b0 f0 brcs .+44 ; 0x3c090 <__fixunssfsi+0x3e> 3c064: e1 f0 breq .+56 ; 0x3c09e <__fixunssfsi+0x4c> 3c066: 66 0f add r22, r22 3c068: 77 1f adc r23, r23 3c06a: 88 1f adc r24, r24 3c06c: 99 1f adc r25, r25 3c06e: 1a f0 brmi .+6 ; 0x3c076 <__fixunssfsi+0x24> 3c070: ba 95 dec r27 3c072: c9 f7 brne .-14 ; 0x3c066 <__fixunssfsi+0x14> 3c074: 14 c0 rjmp .+40 ; 0x3c09e <__fixunssfsi+0x4c> 3c076: b1 30 cpi r27, 0x01 ; 1 3c078: 91 f0 breq .+36 ; 0x3c09e <__fixunssfsi+0x4c> 3c07a: 0f 94 0d d9 call 0x3b21a ; 0x3b21a <__fp_zero> 3c07e: b1 e0 ldi r27, 0x01 ; 1 3c080: 08 95 ret 3c082: 0d 94 0d d9 jmp 0x3b21a ; 0x3b21a <__fp_zero> 3c086: 67 2f mov r22, r23 3c088: 78 2f mov r23, r24 3c08a: 88 27 eor r24, r24 3c08c: b8 5f subi r27, 0xF8 ; 248 3c08e: 39 f0 breq .+14 ; 0x3c09e <__fixunssfsi+0x4c> 3c090: b9 3f cpi r27, 0xF9 ; 249 3c092: cc f3 brlt .-14 ; 0x3c086 <__fixunssfsi+0x34> 3c094: 86 95 lsr r24 3c096: 77 95 ror r23 3c098: 67 95 ror r22 3c09a: b3 95 inc r27 3c09c: d9 f7 brne .-10 ; 0x3c094 <__fixunssfsi+0x42> 3c09e: 3e f4 brtc .+14 ; 0x3c0ae <__fixunssfsi+0x5c> 3c0a0: 90 95 com r25 3c0a2: 80 95 com r24 3c0a4: 70 95 com r23 3c0a6: 61 95 neg r22 3c0a8: 7f 4f sbci r23, 0xFF ; 255 3c0aa: 8f 4f sbci r24, 0xFF ; 255 3c0ac: 9f 4f sbci r25, 0xFF ; 255 3c0ae: 08 95 ret 0003c0b0 : 3c0b0: 0f 94 22 e1 call 0x3c244 ; 0x3c244 <__fp_trunc> 3c0b4: 90 f0 brcs .+36 ; 0x3c0da 3c0b6: 9f 37 cpi r25, 0x7F ; 127 3c0b8: 48 f4 brcc .+18 ; 0x3c0cc 3c0ba: 91 11 cpse r25, r1 3c0bc: 16 f0 brts .+4 ; 0x3c0c2 3c0be: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 3c0c2: 60 e0 ldi r22, 0x00 ; 0 3c0c4: 70 e0 ldi r23, 0x00 ; 0 3c0c6: 80 e8 ldi r24, 0x80 ; 128 3c0c8: 9f eb ldi r25, 0xBF ; 191 3c0ca: 08 95 ret 3c0cc: 26 f4 brtc .+8 ; 0x3c0d6 3c0ce: 1b 16 cp r1, r27 3c0d0: 61 1d adc r22, r1 3c0d2: 71 1d adc r23, r1 3c0d4: 81 1d adc r24, r1 3c0d6: 0d 94 93 e0 jmp 0x3c126 ; 0x3c126 <__fp_mintl> 3c0da: 0d 94 ae e0 jmp 0x3c15c ; 0x3c15c <__fp_mpack> 0003c0de <__fp_cmp>: 3c0de: 99 0f add r25, r25 3c0e0: 00 08 sbc r0, r0 3c0e2: 55 0f add r21, r21 3c0e4: aa 0b sbc r26, r26 3c0e6: e0 e8 ldi r30, 0x80 ; 128 3c0e8: fe ef ldi r31, 0xFE ; 254 3c0ea: 16 16 cp r1, r22 3c0ec: 17 06 cpc r1, r23 3c0ee: e8 07 cpc r30, r24 3c0f0: f9 07 cpc r31, r25 3c0f2: c0 f0 brcs .+48 ; 0x3c124 <__fp_cmp+0x46> 3c0f4: 12 16 cp r1, r18 3c0f6: 13 06 cpc r1, r19 3c0f8: e4 07 cpc r30, r20 3c0fa: f5 07 cpc r31, r21 3c0fc: 98 f0 brcs .+38 ; 0x3c124 <__fp_cmp+0x46> 3c0fe: 62 1b sub r22, r18 3c100: 73 0b sbc r23, r19 3c102: 84 0b sbc r24, r20 3c104: 95 0b sbc r25, r21 3c106: 39 f4 brne .+14 ; 0x3c116 <__fp_cmp+0x38> 3c108: 0a 26 eor r0, r26 3c10a: 61 f0 breq .+24 ; 0x3c124 <__fp_cmp+0x46> 3c10c: 23 2b or r18, r19 3c10e: 24 2b or r18, r20 3c110: 25 2b or r18, r21 3c112: 21 f4 brne .+8 ; 0x3c11c <__fp_cmp+0x3e> 3c114: 08 95 ret 3c116: 0a 26 eor r0, r26 3c118: 09 f4 brne .+2 ; 0x3c11c <__fp_cmp+0x3e> 3c11a: a1 40 sbci r26, 0x01 ; 1 3c11c: a6 95 lsr r26 3c11e: 8f ef ldi r24, 0xFF ; 255 3c120: 81 1d adc r24, r1 3c122: 81 1d adc r24, r1 3c124: 08 95 ret 0003c126 <__fp_mintl>: 3c126: 88 23 and r24, r24 3c128: 71 f4 brne .+28 ; 0x3c146 <__fp_mintl+0x20> 3c12a: 77 23 and r23, r23 3c12c: 21 f0 breq .+8 ; 0x3c136 <__fp_mintl+0x10> 3c12e: 98 50 subi r25, 0x08 ; 8 3c130: 87 2b or r24, r23 3c132: 76 2f mov r23, r22 3c134: 07 c0 rjmp .+14 ; 0x3c144 <__fp_mintl+0x1e> 3c136: 66 23 and r22, r22 3c138: 11 f4 brne .+4 ; 0x3c13e <__fp_mintl+0x18> 3c13a: 99 27 eor r25, r25 3c13c: 0d c0 rjmp .+26 ; 0x3c158 <__fp_mintl+0x32> 3c13e: 90 51 subi r25, 0x10 ; 16 3c140: 86 2b or r24, r22 3c142: 70 e0 ldi r23, 0x00 ; 0 3c144: 60 e0 ldi r22, 0x00 ; 0 3c146: 2a f0 brmi .+10 ; 0x3c152 <__fp_mintl+0x2c> 3c148: 9a 95 dec r25 3c14a: 66 0f add r22, r22 3c14c: 77 1f adc r23, r23 3c14e: 88 1f adc r24, r24 3c150: da f7 brpl .-10 ; 0x3c148 <__fp_mintl+0x22> 3c152: 88 0f add r24, r24 3c154: 96 95 lsr r25 3c156: 87 95 ror r24 3c158: 97 f9 bld r25, 7 3c15a: 08 95 ret 0003c15c <__fp_mpack>: 3c15c: 9f 3f cpi r25, 0xFF ; 255 3c15e: 31 f0 breq .+12 ; 0x3c16c <__fp_mpack_finite+0xc> 0003c160 <__fp_mpack_finite>: 3c160: 91 50 subi r25, 0x01 ; 1 3c162: 20 f4 brcc .+8 ; 0x3c16c <__fp_mpack_finite+0xc> 3c164: 87 95 ror r24 3c166: 77 95 ror r23 3c168: 67 95 ror r22 3c16a: b7 95 ror r27 3c16c: 88 0f add r24, r24 3c16e: 91 1d adc r25, r1 3c170: 96 95 lsr r25 3c172: 87 95 ror r24 3c174: 97 f9 bld r25, 7 3c176: 08 95 ret 0003c178 <__fp_powser>: 3c178: df 93 push r29 3c17a: cf 93 push r28 3c17c: 1f 93 push r17 3c17e: 0f 93 push r16 3c180: ff 92 push r15 3c182: ef 92 push r14 3c184: df 92 push r13 3c186: 7b 01 movw r14, r22 3c188: 8c 01 movw r16, r24 3c18a: 68 94 set 3c18c: 06 c0 rjmp .+12 ; 0x3c19a <__fp_powser+0x22> 3c18e: da 2e mov r13, r26 3c190: ef 01 movw r28, r30 3c192: 0f 94 69 d8 call 0x3b0d2 ; 0x3b0d2 <__mulsf3x> 3c196: fe 01 movw r30, r28 3c198: e8 94 clt 3c19a: a5 91 lpm r26, Z+ 3c19c: 25 91 lpm r18, Z+ 3c19e: 35 91 lpm r19, Z+ 3c1a0: 45 91 lpm r20, Z+ 3c1a2: 55 91 lpm r21, Z+ 3c1a4: a6 f3 brts .-24 ; 0x3c18e <__fp_powser+0x16> 3c1a6: ef 01 movw r28, r30 3c1a8: 0f 94 c8 de call 0x3bd90 ; 0x3bd90 <__addsf3x> 3c1ac: fe 01 movw r30, r28 3c1ae: 97 01 movw r18, r14 3c1b0: a8 01 movw r20, r16 3c1b2: da 94 dec r13 3c1b4: 69 f7 brne .-38 ; 0x3c190 <__fp_powser+0x18> 3c1b6: df 90 pop r13 3c1b8: ef 90 pop r14 3c1ba: ff 90 pop r15 3c1bc: 0f 91 pop r16 3c1be: 1f 91 pop r17 3c1c0: cf 91 pop r28 3c1c2: df 91 pop r29 3c1c4: 08 95 ret 3c1c6: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 0003c1ca <__fp_rempio2>: 3c1ca: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_splitA> 3c1ce: d8 f3 brcs .-10 ; 0x3c1c6 <__fp_powser+0x4e> 3c1d0: e8 94 clt 3c1d2: e0 e0 ldi r30, 0x00 ; 0 3c1d4: bb 27 eor r27, r27 3c1d6: 9f 57 subi r25, 0x7F ; 127 3c1d8: f0 f0 brcs .+60 ; 0x3c216 <__fp_rempio2+0x4c> 3c1da: 2a ed ldi r18, 0xDA ; 218 3c1dc: 3f e0 ldi r19, 0x0F ; 15 3c1de: 49 ec ldi r20, 0xC9 ; 201 3c1e0: 06 c0 rjmp .+12 ; 0x3c1ee <__fp_rempio2+0x24> 3c1e2: ee 0f add r30, r30 3c1e4: bb 0f add r27, r27 3c1e6: 66 1f adc r22, r22 3c1e8: 77 1f adc r23, r23 3c1ea: 88 1f adc r24, r24 3c1ec: 28 f0 brcs .+10 ; 0x3c1f8 <__fp_rempio2+0x2e> 3c1ee: b2 3a cpi r27, 0xA2 ; 162 3c1f0: 62 07 cpc r22, r18 3c1f2: 73 07 cpc r23, r19 3c1f4: 84 07 cpc r24, r20 3c1f6: 28 f0 brcs .+10 ; 0x3c202 <__fp_rempio2+0x38> 3c1f8: b2 5a subi r27, 0xA2 ; 162 3c1fa: 62 0b sbc r22, r18 3c1fc: 73 0b sbc r23, r19 3c1fe: 84 0b sbc r24, r20 3c200: e3 95 inc r30 3c202: 9a 95 dec r25 3c204: 72 f7 brpl .-36 ; 0x3c1e2 <__fp_rempio2+0x18> 3c206: 80 38 cpi r24, 0x80 ; 128 3c208: 30 f4 brcc .+12 ; 0x3c216 <__fp_rempio2+0x4c> 3c20a: 9a 95 dec r25 3c20c: bb 0f add r27, r27 3c20e: 66 1f adc r22, r22 3c210: 77 1f adc r23, r23 3c212: 88 1f adc r24, r24 3c214: d2 f7 brpl .-12 ; 0x3c20a <__fp_rempio2+0x40> 3c216: 90 48 sbci r25, 0x80 ; 128 3c218: 0d 94 b0 e0 jmp 0x3c160 ; 0x3c160 <__fp_mpack_finite> 0003c21c <__fp_sinus>: 3c21c: ef 93 push r30 3c21e: e0 ff sbrs r30, 0 3c220: 07 c0 rjmp .+14 ; 0x3c230 <__fp_sinus+0x14> 3c222: a2 ea ldi r26, 0xA2 ; 162 3c224: 2a ed ldi r18, 0xDA ; 218 3c226: 3f e0 ldi r19, 0x0F ; 15 3c228: 49 ec ldi r20, 0xC9 ; 201 3c22a: 5f eb ldi r21, 0xBF ; 191 3c22c: 0f 94 c8 de call 0x3bd90 ; 0x3bd90 <__addsf3x> 3c230: 0f 94 da d8 call 0x3b1b4 ; 0x3b1b4 <__fp_round> 3c234: 0f 90 pop r0 3c236: 03 94 inc r0 3c238: 01 fc sbrc r0, 1 3c23a: 90 58 subi r25, 0x80 ; 128 3c23c: ee e0 ldi r30, 0x0E ; 14 3c23e: f2 e7 ldi r31, 0x72 ; 114 3c240: 0d 94 05 e3 jmp 0x3c60a ; 0x3c60a <__fp_powsodd> 0003c244 <__fp_trunc>: 3c244: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_splitA> 3c248: a0 f0 brcs .+40 ; 0x3c272 <__fp_trunc+0x2e> 3c24a: be e7 ldi r27, 0x7E ; 126 3c24c: b9 17 cp r27, r25 3c24e: 88 f4 brcc .+34 ; 0x3c272 <__fp_trunc+0x2e> 3c250: bb 27 eor r27, r27 3c252: 9f 38 cpi r25, 0x8F ; 143 3c254: 60 f4 brcc .+24 ; 0x3c26e <__fp_trunc+0x2a> 3c256: 16 16 cp r1, r22 3c258: b1 1d adc r27, r1 3c25a: 67 2f mov r22, r23 3c25c: 78 2f mov r23, r24 3c25e: 88 27 eor r24, r24 3c260: 98 5f subi r25, 0xF8 ; 248 3c262: f7 cf rjmp .-18 ; 0x3c252 <__fp_trunc+0xe> 3c264: 86 95 lsr r24 3c266: 77 95 ror r23 3c268: 67 95 ror r22 3c26a: b1 1d adc r27, r1 3c26c: 93 95 inc r25 3c26e: 96 39 cpi r25, 0x96 ; 150 3c270: c8 f3 brcs .-14 ; 0x3c264 <__fp_trunc+0x20> 3c272: 08 95 ret 0003c274 <__gesf2>: 3c274: 0f 94 6f e0 call 0x3c0de ; 0x3c0de <__fp_cmp> 3c278: 08 f4 brcc .+2 ; 0x3c27c <__gesf2+0x8> 3c27a: 8f ef ldi r24, 0xFF ; 255 3c27c: 08 95 ret 3c27e: 0f 94 cc d8 call 0x3b198 ; 0x3b198 <__fp_pscA> 3c282: 29 f0 breq .+10 ; 0x3c28e <__gesf2+0x1a> 3c284: 0f 94 d3 d8 call 0x3b1a6 ; 0x3b1a6 <__fp_pscB> 3c288: 11 f0 breq .+4 ; 0x3c28e <__gesf2+0x1a> 3c28a: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 3c28e: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 3c292: b9 01 movw r22, r18 3c294: ca 01 movw r24, r20 3c296: 0d 94 ae e0 jmp 0x3c15c ; 0x3c15c <__fp_mpack> 0003c29a : 3c29a: 9f 77 andi r25, 0x7F ; 127 3c29c: 5f 77 andi r21, 0x7F ; 127 3c29e: 0f 94 eb d8 call 0x3b1d6 ; 0x3b1d6 <__fp_split3> 3c2a2: 68 f3 brcs .-38 ; 0x3c27e <__gesf2+0xa> 3c2a4: 99 23 and r25, r25 3c2a6: a9 f3 breq .-22 ; 0x3c292 <__gesf2+0x1e> 3c2a8: 55 23 and r21, r21 3c2aa: a9 f3 breq .-22 ; 0x3c296 <__gesf2+0x22> 3c2ac: ff 27 eor r31, r31 3c2ae: 95 17 cp r25, r21 3c2b0: 58 f4 brcc .+22 ; 0x3c2c8 3c2b2: e5 2f mov r30, r21 3c2b4: e9 1b sub r30, r25 3c2b6: ed 30 cpi r30, 0x0D ; 13 3c2b8: 60 f7 brcc .-40 ; 0x3c292 <__gesf2+0x1e> 3c2ba: 5e 3b cpi r21, 0xBE ; 190 3c2bc: 10 f0 brcs .+4 ; 0x3c2c2 3c2be: f1 e4 ldi r31, 0x41 ; 65 3c2c0: 1c c0 rjmp .+56 ; 0x3c2fa 3c2c2: 90 34 cpi r25, 0x40 ; 64 3c2c4: e0 f4 brcc .+56 ; 0x3c2fe 3c2c6: 0a c0 rjmp .+20 ; 0x3c2dc 3c2c8: e9 2f mov r30, r25 3c2ca: e5 1b sub r30, r21 3c2cc: ed 30 cpi r30, 0x0D ; 13 3c2ce: 18 f7 brcc .-58 ; 0x3c296 <__gesf2+0x22> 3c2d0: 9e 3b cpi r25, 0xBE ; 190 3c2d2: 10 f0 brcs .+4 ; 0x3c2d8 3c2d4: f1 e4 ldi r31, 0x41 ; 65 3c2d6: 11 c0 rjmp .+34 ; 0x3c2fa 3c2d8: 50 34 cpi r21, 0x40 ; 64 3c2da: 88 f4 brcc .+34 ; 0x3c2fe 3c2dc: f9 ea ldi r31, 0xA9 ; 169 3c2de: 88 23 and r24, r24 3c2e0: 2a f0 brmi .+10 ; 0x3c2ec 3c2e2: 9a 95 dec r25 3c2e4: 66 0f add r22, r22 3c2e6: 77 1f adc r23, r23 3c2e8: 88 1f adc r24, r24 3c2ea: da f7 brpl .-10 ; 0x3c2e2 3c2ec: 44 23 and r20, r20 3c2ee: 2a f0 brmi .+10 ; 0x3c2fa 3c2f0: 5a 95 dec r21 3c2f2: 22 0f add r18, r18 3c2f4: 33 1f adc r19, r19 3c2f6: 44 1f adc r20, r20 3c2f8: da f7 brpl .-10 ; 0x3c2f0 3c2fa: 9f 1b sub r25, r31 3c2fc: 5f 1b sub r21, r31 3c2fe: ff 93 push r31 3c300: 1f 93 push r17 3c302: 0f 93 push r16 3c304: ff 92 push r15 3c306: ef 92 push r14 3c308: 79 01 movw r14, r18 3c30a: 8a 01 movw r16, r20 3c30c: bb 27 eor r27, r27 3c30e: ab 2f mov r26, r27 3c310: 9b 01 movw r18, r22 3c312: ac 01 movw r20, r24 3c314: 0f 94 6c d8 call 0x3b0d8 ; 0x3b0d8 <__mulsf3_pse> 3c318: 97 01 movw r18, r14 3c31a: a8 01 movw r20, r16 3c31c: bf 93 push r27 3c31e: 7b 01 movw r14, r22 3c320: 8c 01 movw r16, r24 3c322: aa 27 eor r26, r26 3c324: ba 2f mov r27, r26 3c326: b9 01 movw r22, r18 3c328: ca 01 movw r24, r20 3c32a: 0f 94 6c d8 call 0x3b0d8 ; 0x3b0d8 <__mulsf3_pse> 3c32e: af 91 pop r26 3c330: 97 01 movw r18, r14 3c332: a8 01 movw r20, r16 3c334: ef 90 pop r14 3c336: ff 90 pop r15 3c338: 0f 91 pop r16 3c33a: 1f 91 pop r17 3c33c: 0f 94 c8 de call 0x3bd90 ; 0x3bd90 <__addsf3x> 3c340: 0f 94 da d8 call 0x3b1b4 ; 0x3b1b4 <__fp_round> 3c344: 0f 94 7f e2 call 0x3c4fe ; 0x3c4fe 3c348: 4f 91 pop r20 3c34a: 40 ff sbrs r20, 0 3c34c: 08 95 ret 3c34e: 55 27 eor r21, r21 3c350: 47 fd sbrc r20, 7 3c352: 50 95 com r21 3c354: 0d 94 b8 e1 jmp 0x3c370 ; 0x3c370 0003c358 : 3c358: 9b 01 movw r18, r22 3c35a: ac 01 movw r20, r24 3c35c: 60 e0 ldi r22, 0x00 ; 0 3c35e: 70 e0 ldi r23, 0x00 ; 0 3c360: 80 e8 ldi r24, 0x80 ; 128 3c362: 9f e3 ldi r25, 0x3F ; 63 3c364: 0d 94 b0 df jmp 0x3bf60 ; 0x3bf60 <__divsf3> 3c368: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 3c36c: 0d 94 ae e0 jmp 0x3c15c ; 0x3c15c <__fp_mpack> 0003c370 : 3c370: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_splitA> 3c374: d8 f3 brcs .-10 ; 0x3c36c 3c376: 99 23 and r25, r25 3c378: c9 f3 breq .-14 ; 0x3c36c 3c37a: 94 0f add r25, r20 3c37c: 51 1d adc r21, r1 3c37e: a3 f3 brvs .-24 ; 0x3c368 3c380: 91 50 subi r25, 0x01 ; 1 3c382: 50 40 sbci r21, 0x00 ; 0 3c384: 94 f0 brlt .+36 ; 0x3c3aa 3c386: 59 f0 breq .+22 ; 0x3c39e 3c388: 88 23 and r24, r24 3c38a: 32 f0 brmi .+12 ; 0x3c398 3c38c: 66 0f add r22, r22 3c38e: 77 1f adc r23, r23 3c390: 88 1f adc r24, r24 3c392: 91 50 subi r25, 0x01 ; 1 3c394: 50 40 sbci r21, 0x00 ; 0 3c396: c1 f7 brne .-16 ; 0x3c388 3c398: 9e 3f cpi r25, 0xFE ; 254 3c39a: 51 05 cpc r21, r1 3c39c: 2c f7 brge .-54 ; 0x3c368 3c39e: 88 0f add r24, r24 3c3a0: 91 1d adc r25, r1 3c3a2: 96 95 lsr r25 3c3a4: 87 95 ror r24 3c3a6: 97 f9 bld r25, 7 3c3a8: 08 95 ret 3c3aa: 5f 3f cpi r21, 0xFF ; 255 3c3ac: ac f0 brlt .+42 ; 0x3c3d8 3c3ae: 98 3e cpi r25, 0xE8 ; 232 3c3b0: 9c f0 brlt .+38 ; 0x3c3d8 3c3b2: bb 27 eor r27, r27 3c3b4: 86 95 lsr r24 3c3b6: 77 95 ror r23 3c3b8: 67 95 ror r22 3c3ba: b7 95 ror r27 3c3bc: 08 f4 brcc .+2 ; 0x3c3c0 3c3be: b1 60 ori r27, 0x01 ; 1 3c3c0: 93 95 inc r25 3c3c2: c1 f7 brne .-16 ; 0x3c3b4 3c3c4: bb 0f add r27, r27 3c3c6: 58 f7 brcc .-42 ; 0x3c39e 3c3c8: 11 f4 brne .+4 ; 0x3c3ce 3c3ca: 60 ff sbrs r22, 0 3c3cc: e8 cf rjmp .-48 ; 0x3c39e 3c3ce: 6f 5f subi r22, 0xFF ; 255 3c3d0: 7f 4f sbci r23, 0xFF ; 255 3c3d2: 8f 4f sbci r24, 0xFF ; 255 3c3d4: 9f 4f sbci r25, 0xFF ; 255 3c3d6: e3 cf rjmp .-58 ; 0x3c39e 3c3d8: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 0003c3dc : 3c3dc: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_splitA> 3c3e0: 58 f1 brcs .+86 ; 0x3c438 3c3e2: 9e 57 subi r25, 0x7E ; 126 3c3e4: 60 f1 brcs .+88 ; 0x3c43e 3c3e6: 98 51 subi r25, 0x18 ; 24 3c3e8: a0 f0 brcs .+40 ; 0x3c412 3c3ea: e9 f0 breq .+58 ; 0x3c426 3c3ec: 98 30 cpi r25, 0x08 ; 8 3c3ee: 20 f5 brcc .+72 ; 0x3c438 3c3f0: 09 2e mov r0, r25 3c3f2: 99 27 eor r25, r25 3c3f4: 66 0f add r22, r22 3c3f6: 77 1f adc r23, r23 3c3f8: 88 1f adc r24, r24 3c3fa: 99 1f adc r25, r25 3c3fc: 0a 94 dec r0 3c3fe: d1 f7 brne .-12 ; 0x3c3f4 3c400: 12 c0 rjmp .+36 ; 0x3c426 3c402: 06 2e mov r0, r22 3c404: 67 2f mov r22, r23 3c406: 78 2f mov r23, r24 3c408: 88 27 eor r24, r24 3c40a: 98 5f subi r25, 0xF8 ; 248 3c40c: 11 f4 brne .+4 ; 0x3c412 3c40e: 00 0c add r0, r0 3c410: 07 c0 rjmp .+14 ; 0x3c420 3c412: 99 3f cpi r25, 0xF9 ; 249 3c414: b4 f3 brlt .-20 ; 0x3c402 3c416: 86 95 lsr r24 3c418: 77 95 ror r23 3c41a: 67 95 ror r22 3c41c: 93 95 inc r25 3c41e: d9 f7 brne .-10 ; 0x3c416 3c420: 61 1d adc r22, r1 3c422: 71 1d adc r23, r1 3c424: 81 1d adc r24, r1 3c426: 3e f4 brtc .+14 ; 0x3c436 3c428: 90 95 com r25 3c42a: 80 95 com r24 3c42c: 70 95 com r23 3c42e: 61 95 neg r22 3c430: 7f 4f sbci r23, 0xFF ; 255 3c432: 8f 4f sbci r24, 0xFF ; 255 3c434: 9f 4f sbci r25, 0xFF ; 255 3c436: 08 95 ret 3c438: 68 94 set 3c43a: 0d 94 0e d9 jmp 0x3b21c ; 0x3b21c <__fp_szero> 3c43e: 0d 94 0d d9 jmp 0x3b21a ; 0x3b21a <__fp_zero> 0003c442 : 3c442: fa 01 movw r30, r20 3c444: ee 0f add r30, r30 3c446: ff 1f adc r31, r31 3c448: 30 96 adiw r30, 0x00 ; 0 3c44a: 21 05 cpc r18, r1 3c44c: 31 05 cpc r19, r1 3c44e: a1 f1 breq .+104 ; 0x3c4b8 3c450: 61 15 cp r22, r1 3c452: 71 05 cpc r23, r1 3c454: 61 f4 brne .+24 ; 0x3c46e 3c456: 80 38 cpi r24, 0x80 ; 128 3c458: bf e3 ldi r27, 0x3F ; 63 3c45a: 9b 07 cpc r25, r27 3c45c: 49 f1 breq .+82 ; 0x3c4b0 3c45e: 68 94 set 3c460: 90 38 cpi r25, 0x80 ; 128 3c462: 81 05 cpc r24, r1 3c464: 61 f0 breq .+24 ; 0x3c47e 3c466: 80 38 cpi r24, 0x80 ; 128 3c468: bf ef ldi r27, 0xFF ; 255 3c46a: 9b 07 cpc r25, r27 3c46c: 41 f0 breq .+16 ; 0x3c47e 3c46e: 99 23 and r25, r25 3c470: 4a f5 brpl .+82 ; 0x3c4c4 3c472: ff 3f cpi r31, 0xFF ; 255 3c474: e1 05 cpc r30, r1 3c476: 31 05 cpc r19, r1 3c478: 21 05 cpc r18, r1 3c47a: 19 f1 breq .+70 ; 0x3c4c2 3c47c: e8 94 clt 3c47e: 08 94 sec 3c480: e7 95 ror r30 3c482: d9 01 movw r26, r18 3c484: aa 23 and r26, r26 3c486: 29 f4 brne .+10 ; 0x3c492 3c488: ab 2f mov r26, r27 3c48a: be 2f mov r27, r30 3c48c: f8 5f subi r31, 0xF8 ; 248 3c48e: d0 f3 brcs .-12 ; 0x3c484 3c490: 10 c0 rjmp .+32 ; 0x3c4b2 3c492: ff 5f subi r31, 0xFF ; 255 3c494: 70 f4 brcc .+28 ; 0x3c4b2 3c496: a6 95 lsr r26 3c498: e0 f7 brcc .-8 ; 0x3c492 3c49a: f7 39 cpi r31, 0x97 ; 151 3c49c: 50 f0 brcs .+20 ; 0x3c4b2 3c49e: 19 f0 breq .+6 ; 0x3c4a6 3c4a0: ff 3a cpi r31, 0xAF ; 175 3c4a2: 38 f4 brcc .+14 ; 0x3c4b2 3c4a4: 9f 77 andi r25, 0x7F ; 127 3c4a6: 9f 93 push r25 3c4a8: 0d d0 rcall .+26 ; 0x3c4c4 3c4aa: 0f 90 pop r0 3c4ac: 07 fc sbrc r0, 7 3c4ae: 90 58 subi r25, 0x80 ; 128 3c4b0: 08 95 ret 3c4b2: 46 f0 brts .+16 ; 0x3c4c4 3c4b4: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 3c4b8: 60 e0 ldi r22, 0x00 ; 0 3c4ba: 70 e0 ldi r23, 0x00 ; 0 3c4bc: 80 e8 ldi r24, 0x80 ; 128 3c4be: 9f e3 ldi r25, 0x3F ; 63 3c4c0: 08 95 ret 3c4c2: 4f e7 ldi r20, 0x7F ; 127 3c4c4: 9f 77 andi r25, 0x7F ; 127 3c4c6: 5f 93 push r21 3c4c8: 4f 93 push r20 3c4ca: 3f 93 push r19 3c4cc: 2f 93 push r18 3c4ce: 0f 94 21 e3 call 0x3c642 ; 0x3c642 3c4d2: 2f 91 pop r18 3c4d4: 3f 91 pop r19 3c4d6: 4f 91 pop r20 3c4d8: 5f 91 pop r21 3c4da: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3c4de: 0d 94 cc e2 jmp 0x3c598 ; 0x3c598 0003c4e2 : 3c4e2: 9f 93 push r25 3c4e4: 0f 94 e5 e0 call 0x3c1ca ; 0x3c1ca <__fp_rempio2> 3c4e8: 0f 90 pop r0 3c4ea: 07 fc sbrc r0, 7 3c4ec: ee 5f subi r30, 0xFE ; 254 3c4ee: 0d 94 0e e1 jmp 0x3c21c ; 0x3c21c <__fp_sinus> 3c4f2: 19 f4 brne .+6 ; 0x3c4fa 3c4f4: 16 f4 brtc .+4 ; 0x3c4fa 3c4f6: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 3c4fa: 0d 94 ae e0 jmp 0x3c15c ; 0x3c15c <__fp_mpack> 0003c4fe : 3c4fe: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_splitA> 3c502: b8 f3 brcs .-18 ; 0x3c4f2 3c504: 99 23 and r25, r25 3c506: c9 f3 breq .-14 ; 0x3c4fa 3c508: b6 f3 brts .-20 ; 0x3c4f6 3c50a: 9f 57 subi r25, 0x7F ; 127 3c50c: 55 0b sbc r21, r21 3c50e: 87 ff sbrs r24, 7 3c510: 0f 94 fe e2 call 0x3c5fc ; 0x3c5fc <__fp_norm2> 3c514: 00 24 eor r0, r0 3c516: a0 e6 ldi r26, 0x60 ; 96 3c518: 40 ea ldi r20, 0xA0 ; 160 3c51a: 90 01 movw r18, r0 3c51c: 80 58 subi r24, 0x80 ; 128 3c51e: 56 95 lsr r21 3c520: 97 95 ror r25 3c522: 28 f4 brcc .+10 ; 0x3c52e 3c524: 80 5c subi r24, 0xC0 ; 192 3c526: 66 0f add r22, r22 3c528: 77 1f adc r23, r23 3c52a: 88 1f adc r24, r24 3c52c: 20 f0 brcs .+8 ; 0x3c536 3c52e: 26 17 cp r18, r22 3c530: 37 07 cpc r19, r23 3c532: 48 07 cpc r20, r24 3c534: 30 f4 brcc .+12 ; 0x3c542 3c536: 62 1b sub r22, r18 3c538: 73 0b sbc r23, r19 3c53a: 84 0b sbc r24, r20 3c53c: 20 29 or r18, r0 3c53e: 31 29 or r19, r1 3c540: 4a 2b or r20, r26 3c542: a6 95 lsr r26 3c544: 17 94 ror r1 3c546: 07 94 ror r0 3c548: 20 25 eor r18, r0 3c54a: 31 25 eor r19, r1 3c54c: 4a 27 eor r20, r26 3c54e: 58 f7 brcc .-42 ; 0x3c526 3c550: 66 0f add r22, r22 3c552: 77 1f adc r23, r23 3c554: 88 1f adc r24, r24 3c556: 20 f0 brcs .+8 ; 0x3c560 3c558: 26 17 cp r18, r22 3c55a: 37 07 cpc r19, r23 3c55c: 48 07 cpc r20, r24 3c55e: 30 f4 brcc .+12 ; 0x3c56c 3c560: 62 0b sbc r22, r18 3c562: 73 0b sbc r23, r19 3c564: 84 0b sbc r24, r20 3c566: 20 0d add r18, r0 3c568: 31 1d adc r19, r1 3c56a: 41 1d adc r20, r1 3c56c: a0 95 com r26 3c56e: 81 f7 brne .-32 ; 0x3c550 3c570: b9 01 movw r22, r18 3c572: 84 2f mov r24, r20 3c574: 91 58 subi r25, 0x81 ; 129 3c576: 88 0f add r24, r24 3c578: 96 95 lsr r25 3c57a: 87 95 ror r24 3c57c: 08 95 ret 0003c57e <__unordsf2>: 3c57e: 0f 94 6f e0 call 0x3c0de ; 0x3c0de <__fp_cmp> 3c582: 88 0b sbc r24, r24 3c584: 99 0b sbc r25, r25 3c586: 08 95 ret 3c588: 29 f4 brne .+10 ; 0x3c594 <__unordsf2+0x16> 3c58a: 16 f0 brts .+4 ; 0x3c590 <__unordsf2+0x12> 3c58c: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 3c590: 0d 94 0d d9 jmp 0x3b21a ; 0x3b21a <__fp_zero> 3c594: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 0003c598 : 3c598: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_splitA> 3c59c: a8 f3 brcs .-22 ; 0x3c588 <__unordsf2+0xa> 3c59e: 96 38 cpi r25, 0x86 ; 134 3c5a0: a0 f7 brcc .-24 ; 0x3c58a <__unordsf2+0xc> 3c5a2: 07 f8 bld r0, 7 3c5a4: 0f 92 push r0 3c5a6: e8 94 clt 3c5a8: 2b e3 ldi r18, 0x3B ; 59 3c5aa: 3a ea ldi r19, 0xAA ; 170 3c5ac: 48 eb ldi r20, 0xB8 ; 184 3c5ae: 5f e7 ldi r21, 0x7F ; 127 3c5b0: 0f 94 6c d8 call 0x3b0d8 ; 0x3b0d8 <__mulsf3_pse> 3c5b4: 0f 92 push r0 3c5b6: 0f 92 push r0 3c5b8: 0f 92 push r0 3c5ba: 4d b7 in r20, 0x3d ; 61 3c5bc: 5e b7 in r21, 0x3e ; 62 3c5be: 0f 92 push r0 3c5c0: 0f 94 69 e3 call 0x3c6d2 ; 0x3c6d2 3c5c4: ec e2 ldi r30, 0x2C ; 44 3c5c6: f2 e7 ldi r31, 0x72 ; 114 3c5c8: 0f 94 bc e0 call 0x3c178 ; 0x3c178 <__fp_powser> 3c5cc: 4f 91 pop r20 3c5ce: 5f 91 pop r21 3c5d0: ef 91 pop r30 3c5d2: ff 91 pop r31 3c5d4: e5 95 asr r30 3c5d6: ee 1f adc r30, r30 3c5d8: ff 1f adc r31, r31 3c5da: 49 f0 breq .+18 ; 0x3c5ee 3c5dc: fe 57 subi r31, 0x7E ; 126 3c5de: e0 68 ori r30, 0x80 ; 128 3c5e0: 44 27 eor r20, r20 3c5e2: ee 0f add r30, r30 3c5e4: 44 1f adc r20, r20 3c5e6: fa 95 dec r31 3c5e8: e1 f7 brne .-8 ; 0x3c5e2 3c5ea: 41 95 neg r20 3c5ec: 55 0b sbc r21, r21 3c5ee: 0f 94 b8 e1 call 0x3c370 ; 0x3c370 3c5f2: 0f 90 pop r0 3c5f4: 07 fe sbrs r0, 7 3c5f6: 0d 94 ac e1 jmp 0x3c358 ; 0x3c358 3c5fa: 08 95 ret 0003c5fc <__fp_norm2>: 3c5fc: 91 50 subi r25, 0x01 ; 1 3c5fe: 50 40 sbci r21, 0x00 ; 0 3c600: 66 0f add r22, r22 3c602: 77 1f adc r23, r23 3c604: 88 1f adc r24, r24 3c606: d2 f7 brpl .-12 ; 0x3c5fc <__fp_norm2> 3c608: 08 95 ret 0003c60a <__fp_powsodd>: 3c60a: 9f 93 push r25 3c60c: 8f 93 push r24 3c60e: 7f 93 push r23 3c610: 6f 93 push r22 3c612: ff 93 push r31 3c614: ef 93 push r30 3c616: 9b 01 movw r18, r22 3c618: ac 01 movw r20, r24 3c61a: 0f 94 56 d8 call 0x3b0ac ; 0x3b0ac <__mulsf3> 3c61e: ef 91 pop r30 3c620: ff 91 pop r31 3c622: 0f 94 bc e0 call 0x3c178 ; 0x3c178 <__fp_powser> 3c626: 2f 91 pop r18 3c628: 3f 91 pop r19 3c62a: 4f 91 pop r20 3c62c: 5f 91 pop r21 3c62e: 0d 94 56 d8 jmp 0x3b0ac ; 0x3b0ac <__mulsf3> 3c632: 16 f0 brts .+4 ; 0x3c638 <__fp_powsodd+0x2e> 3c634: 0d 94 ae e0 jmp 0x3c15c ; 0x3c15c <__fp_mpack> 3c638: 0d 94 c9 d8 jmp 0x3b192 ; 0x3b192 <__fp_nan> 3c63c: 68 94 set 3c63e: 0d 94 c3 d8 jmp 0x3b186 ; 0x3b186 <__fp_inf> 0003c642 : 3c642: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_splitA> 3c646: a8 f3 brcs .-22 ; 0x3c632 <__fp_powsodd+0x28> 3c648: 99 23 and r25, r25 3c64a: c1 f3 breq .-16 ; 0x3c63c <__fp_powsodd+0x32> 3c64c: ae f3 brts .-22 ; 0x3c638 <__fp_powsodd+0x2e> 3c64e: df 93 push r29 3c650: cf 93 push r28 3c652: 1f 93 push r17 3c654: 0f 93 push r16 3c656: ff 92 push r15 3c658: c9 2f mov r28, r25 3c65a: dd 27 eor r29, r29 3c65c: 88 23 and r24, r24 3c65e: 2a f0 brmi .+10 ; 0x3c66a 3c660: 21 97 sbiw r28, 0x01 ; 1 3c662: 66 0f add r22, r22 3c664: 77 1f adc r23, r23 3c666: 88 1f adc r24, r24 3c668: da f7 brpl .-10 ; 0x3c660 3c66a: 20 e0 ldi r18, 0x00 ; 0 3c66c: 30 e0 ldi r19, 0x00 ; 0 3c66e: 40 e8 ldi r20, 0x80 ; 128 3c670: 5f eb ldi r21, 0xBF ; 191 3c672: 9f e3 ldi r25, 0x3F ; 63 3c674: 88 39 cpi r24, 0x98 ; 152 3c676: 20 f0 brcs .+8 ; 0x3c680 3c678: 80 3e cpi r24, 0xE0 ; 224 3c67a: 38 f0 brcs .+14 ; 0x3c68a 3c67c: 21 96 adiw r28, 0x01 ; 1 3c67e: 8f 77 andi r24, 0x7F ; 127 3c680: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3c684: e4 e5 ldi r30, 0x54 ; 84 3c686: f2 e7 ldi r31, 0x72 ; 114 3c688: 04 c0 rjmp .+8 ; 0x3c692 3c68a: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__addsf3> 3c68e: e1 e8 ldi r30, 0x81 ; 129 3c690: f2 e7 ldi r31, 0x72 ; 114 3c692: 0f 94 bc e0 call 0x3c178 ; 0x3c178 <__fp_powser> 3c696: 8b 01 movw r16, r22 3c698: be 01 movw r22, r28 3c69a: ec 01 movw r28, r24 3c69c: fb 2e mov r15, r27 3c69e: 6f 57 subi r22, 0x7F ; 127 3c6a0: 71 09 sbc r23, r1 3c6a2: 75 95 asr r23 3c6a4: 77 1f adc r23, r23 3c6a6: 88 0b sbc r24, r24 3c6a8: 99 0b sbc r25, r25 3c6aa: 0f 94 17 d8 call 0x3b02e ; 0x3b02e <__floatsisf> 3c6ae: 28 e1 ldi r18, 0x18 ; 24 3c6b0: 32 e7 ldi r19, 0x72 ; 114 3c6b2: 41 e3 ldi r20, 0x31 ; 49 3c6b4: 5f e3 ldi r21, 0x3F ; 63 3c6b6: 0f 94 69 d8 call 0x3b0d2 ; 0x3b0d2 <__mulsf3x> 3c6ba: af 2d mov r26, r15 3c6bc: 98 01 movw r18, r16 3c6be: ae 01 movw r20, r28 3c6c0: ff 90 pop r15 3c6c2: 0f 91 pop r16 3c6c4: 1f 91 pop r17 3c6c6: cf 91 pop r28 3c6c8: df 91 pop r29 3c6ca: 0f 94 c8 de call 0x3bd90 ; 0x3bd90 <__addsf3x> 3c6ce: 0d 94 da d8 jmp 0x3b1b4 ; 0x3b1b4 <__fp_round> 0003c6d2 : 3c6d2: fa 01 movw r30, r20 3c6d4: dc 01 movw r26, r24 3c6d6: aa 0f add r26, r26 3c6d8: bb 1f adc r27, r27 3c6da: 9b 01 movw r18, r22 3c6dc: ac 01 movw r20, r24 3c6de: bf 57 subi r27, 0x7F ; 127 3c6e0: 28 f4 brcc .+10 ; 0x3c6ec 3c6e2: 22 27 eor r18, r18 3c6e4: 33 27 eor r19, r19 3c6e6: 44 27 eor r20, r20 3c6e8: 50 78 andi r21, 0x80 ; 128 3c6ea: 20 c0 rjmp .+64 ; 0x3c72c 3c6ec: b7 51 subi r27, 0x17 ; 23 3c6ee: 90 f4 brcc .+36 ; 0x3c714 3c6f0: ab 2f mov r26, r27 3c6f2: 00 24 eor r0, r0 3c6f4: 46 95 lsr r20 3c6f6: 37 95 ror r19 3c6f8: 27 95 ror r18 3c6fa: 01 1c adc r0, r1 3c6fc: a3 95 inc r26 3c6fe: d2 f3 brmi .-12 ; 0x3c6f4 3c700: 00 20 and r0, r0 3c702: 71 f0 breq .+28 ; 0x3c720 3c704: 22 0f add r18, r18 3c706: 33 1f adc r19, r19 3c708: 44 1f adc r20, r20 3c70a: b3 95 inc r27 3c70c: da f3 brmi .-10 ; 0x3c704 3c70e: 0e d0 rcall .+28 ; 0x3c72c 3c710: 0d 94 b0 de jmp 0x3bd60 ; 0x3bd60 <__subsf3> 3c714: 61 30 cpi r22, 0x01 ; 1 3c716: 71 05 cpc r23, r1 3c718: a0 e8 ldi r26, 0x80 ; 128 3c71a: 8a 07 cpc r24, r26 3c71c: b9 46 sbci r27, 0x69 ; 105 3c71e: 30 f4 brcc .+12 ; 0x3c72c 3c720: 9b 01 movw r18, r22 3c722: ac 01 movw r20, r24 3c724: 66 27 eor r22, r22 3c726: 77 27 eor r23, r23 3c728: 88 27 eor r24, r24 3c72a: 90 78 andi r25, 0x80 ; 128 3c72c: 30 96 adiw r30, 0x00 ; 0 3c72e: 21 f0 breq .+8 ; 0x3c738 3c730: 20 83 st Z, r18 3c732: 31 83 std Z+1, r19 ; 0x01 3c734: 42 83 std Z+2, r20 ; 0x02 3c736: 53 83 std Z+3, r21 ; 0x03 3c738: 08 95 ret 0003c73a : 3c73a: 91 11 cpse r25, r1 3c73c: 08 95 ret 3c73e: 81 54 subi r24, 0x41 ; 65 3c740: 8a 51 subi r24, 0x1A ; 26 3c742: 08 f4 brcc .+2 ; 0x3c746 3c744: 80 5e subi r24, 0xE0 ; 224 3c746: 85 5a subi r24, 0xA5 ; 165 3c748: 08 95 ret 0003c74a : 3c74a: fb 01 movw r30, r22 3c74c: dc 01 movw r26, r24 3c74e: 04 c0 rjmp .+8 ; 0x3c758 3c750: 8d 91 ld r24, X+ 3c752: 01 90 ld r0, Z+ 3c754: 80 19 sub r24, r0 3c756: 21 f4 brne .+8 ; 0x3c760 3c758: 41 50 subi r20, 0x01 ; 1 3c75a: 50 40 sbci r21, 0x00 ; 0 3c75c: c8 f7 brcc .-14 ; 0x3c750 3c75e: 88 1b sub r24, r24 3c760: 99 0b sbc r25, r25 3c762: 08 95 ret 0003c764 : 3c764: fb 01 movw r30, r22 3c766: dc 01 movw r26, r24 3c768: 02 c0 rjmp .+4 ; 0x3c76e 3c76a: 01 90 ld r0, Z+ 3c76c: 0d 92 st X+, r0 3c76e: 41 50 subi r20, 0x01 ; 1 3c770: 50 40 sbci r21, 0x00 ; 0 3c772: d8 f7 brcc .-10 ; 0x3c76a 3c774: 08 95 ret 0003c776 : 3c776: dc 01 movw r26, r24 3c778: 01 c0 rjmp .+2 ; 0x3c77c 3c77a: 6d 93 st X+, r22 3c77c: 41 50 subi r20, 0x01 ; 1 3c77e: 50 40 sbci r21, 0x00 ; 0 3c780: e0 f7 brcc .-8 ; 0x3c77a 3c782: 08 95 ret 0003c784 : 3c784: fb 01 movw r30, r22 3c786: dc 01 movw r26, r24 3c788: 8d 91 ld r24, X+ 3c78a: 81 34 cpi r24, 0x41 ; 65 3c78c: 1c f0 brlt .+6 ; 0x3c794 3c78e: 8b 35 cpi r24, 0x5B ; 91 3c790: 0c f4 brge .+2 ; 0x3c794 3c792: 80 5e subi r24, 0xE0 ; 224 3c794: 61 91 ld r22, Z+ 3c796: 61 34 cpi r22, 0x41 ; 65 3c798: 1c f0 brlt .+6 ; 0x3c7a0 3c79a: 6b 35 cpi r22, 0x5B ; 91 3c79c: 0c f4 brge .+2 ; 0x3c7a0 3c79e: 60 5e subi r22, 0xE0 ; 224 3c7a0: 86 1b sub r24, r22 3c7a2: 61 11 cpse r22, r1 3c7a4: 89 f3 breq .-30 ; 0x3c788 3c7a6: 99 0b sbc r25, r25 3c7a8: 08 95 ret 0003c7aa : 3c7aa: fb 01 movw r30, r22 3c7ac: dc 01 movw r26, r24 3c7ae: 0d 90 ld r0, X+ 3c7b0: 00 20 and r0, r0 3c7b2: e9 f7 brne .-6 ; 0x3c7ae 3c7b4: 11 97 sbiw r26, 0x01 ; 1 3c7b6: 01 90 ld r0, Z+ 3c7b8: 0d 92 st X+, r0 3c7ba: 00 20 and r0, r0 3c7bc: e1 f7 brne .-8 ; 0x3c7b6 3c7be: 08 95 ret 0003c7c0 : 3c7c0: fc 01 movw r30, r24 3c7c2: 81 91 ld r24, Z+ 3c7c4: 86 17 cp r24, r22 3c7c6: 21 f0 breq .+8 ; 0x3c7d0 3c7c8: 88 23 and r24, r24 3c7ca: d9 f7 brne .-10 ; 0x3c7c2 3c7cc: 99 27 eor r25, r25 3c7ce: 08 95 ret 3c7d0: 31 97 sbiw r30, 0x01 ; 1 3c7d2: cf 01 movw r24, r30 3c7d4: 08 95 ret 0003c7d6 : 3c7d6: fb 01 movw r30, r22 3c7d8: dc 01 movw r26, r24 3c7da: 8d 91 ld r24, X+ 3c7dc: 01 90 ld r0, Z+ 3c7de: 80 19 sub r24, r0 3c7e0: 01 10 cpse r0, r1 3c7e2: d9 f3 breq .-10 ; 0x3c7da 3c7e4: 99 0b sbc r25, r25 3c7e6: 08 95 ret 0003c7e8 : 3c7e8: fb 01 movw r30, r22 3c7ea: dc 01 movw r26, r24 3c7ec: 01 90 ld r0, Z+ 3c7ee: 0d 92 st X+, r0 3c7f0: 00 20 and r0, r0 3c7f2: e1 f7 brne .-8 ; 0x3c7ec 3c7f4: 08 95 ret 0003c7f6 : 3c7f6: fb 01 movw r30, r22 3c7f8: dc 01 movw r26, r24 3c7fa: 41 50 subi r20, 0x01 ; 1 3c7fc: 50 40 sbci r21, 0x00 ; 0 3c7fe: 30 f0 brcs .+12 ; 0x3c80c 3c800: 8d 91 ld r24, X+ 3c802: 01 90 ld r0, Z+ 3c804: 80 19 sub r24, r0 3c806: 19 f4 brne .+6 ; 0x3c80e 3c808: 00 20 and r0, r0 3c80a: b9 f7 brne .-18 ; 0x3c7fa 3c80c: 88 1b sub r24, r24 3c80e: 99 0b sbc r25, r25 3c810: 08 95 ret 0003c812 : 3c812: fb 01 movw r30, r22 3c814: dc 01 movw r26, r24 3c816: 41 50 subi r20, 0x01 ; 1 3c818: 50 40 sbci r21, 0x00 ; 0 3c81a: 48 f0 brcs .+18 ; 0x3c82e 3c81c: 01 90 ld r0, Z+ 3c81e: 0d 92 st X+, r0 3c820: 00 20 and r0, r0 3c822: c9 f7 brne .-14 ; 0x3c816 3c824: 01 c0 rjmp .+2 ; 0x3c828 3c826: 1d 92 st X+, r1 3c828: 41 50 subi r20, 0x01 ; 1 3c82a: 50 40 sbci r21, 0x00 ; 0 3c82c: e0 f7 brcc .-8 ; 0x3c826 3c82e: 08 95 ret 0003c830 : 3c830: 0f 93 push r16 3c832: 1f 93 push r17 3c834: cf 93 push r28 3c836: df 93 push r29 3c838: e0 91 13 18 lds r30, 0x1813 ; 0x801813 <__iob+0x2> 3c83c: f0 91 14 18 lds r31, 0x1814 ; 0x801814 <__iob+0x3> 3c840: 23 81 ldd r18, Z+3 ; 0x03 3c842: ec 01 movw r28, r24 3c844: 10 e0 ldi r17, 0x00 ; 0 3c846: 00 e0 ldi r16, 0x00 ; 0 3c848: 21 fd sbrc r18, 1 3c84a: 08 c0 rjmp .+16 ; 0x3c85c 3c84c: 0f ef ldi r16, 0xFF ; 255 3c84e: 1f ef ldi r17, 0xFF ; 255 3c850: 14 c0 rjmp .+40 ; 0x3c87a 3c852: 19 95 eicall 3c854: 89 2b or r24, r25 3c856: 11 f0 breq .+4 ; 0x3c85c 3c858: 0f ef ldi r16, 0xFF ; 255 3c85a: 1f ef ldi r17, 0xFF ; 255 3c85c: 89 91 ld r24, Y+ 3c85e: 60 91 13 18 lds r22, 0x1813 ; 0x801813 <__iob+0x2> 3c862: 70 91 14 18 lds r23, 0x1814 ; 0x801814 <__iob+0x3> 3c866: db 01 movw r26, r22 3c868: 18 96 adiw r26, 0x08 ; 8 3c86a: ed 91 ld r30, X+ 3c86c: fc 91 ld r31, X 3c86e: 81 11 cpse r24, r1 3c870: f0 cf rjmp .-32 ; 0x3c852 3c872: 8a e0 ldi r24, 0x0A ; 10 3c874: 19 95 eicall 3c876: 89 2b or r24, r25 3c878: 49 f7 brne .-46 ; 0x3c84c 3c87a: c8 01 movw r24, r16 3c87c: df 91 pop r29 3c87e: cf 91 pop r28 3c880: 1f 91 pop r17 3c882: 0f 91 pop r16 3c884: 08 95 ret 0003c886 <__do_global_dtors>: 3c886: 17 e5 ldi r17, 0x57 ; 87 3c888: c3 e5 ldi r28, 0x53 ; 83 3c88a: d7 e5 ldi r29, 0x57 ; 87 3c88c: 00 e0 ldi r16, 0x00 ; 0 3c88e: 06 c0 rjmp .+12 ; 0x3c89c <__do_global_dtors+0x16> 3c890: 80 2f mov r24, r16 3c892: fe 01 movw r30, r28 3c894: 0f 94 99 de call 0x3bd32 ; 0x3bd32 <__tablejump2__> 3c898: 21 96 adiw r28, 0x01 ; 1 3c89a: 01 1d adc r16, r1 3c89c: c4 35 cpi r28, 0x54 ; 84 3c89e: d1 07 cpc r29, r17 3c8a0: 80 e0 ldi r24, 0x00 ; 0 3c8a2: 08 07 cpc r16, r24 3c8a4: a9 f7 brne .-22 ; 0x3c890 <__do_global_dtors+0xa> 3c8a6: f8 94 cli 0003c8a8 <__stop_program>: 3c8a8: ff cf rjmp .-2 ; 0x3c8a8 <__stop_program>